Skip to content

Commit a7aba23

Browse files
authored
chore: upgrade thv (#616)
1 parent 627851a commit a7aba23

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

renderer/src/common/api/generated/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
}
144144
}
145145

146-
let error = await response.text()
146+
const textError = await response.text()
147+
let jsonError: unknown
147148

148149
try {
149-
error = JSON.parse(error)
150+
jsonError = JSON.parse(textError)
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError
154156
let finalError = error
155157

156158
for (const fn of interceptors.error._fns) {

renderer/src/common/api/generated/core/bodySerializer.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export interface QuerySerializerOptions {
1414
object?: SerializerOptions<ObjectStyle>
1515
}
1616

17-
const serializeFormDataPair = (data: FormData, key: string, value: unknown) => {
17+
const serializeFormDataPair = (
18+
data: FormData,
19+
key: string,
20+
value: unknown
21+
): void => {
1822
if (typeof value === 'string' || value instanceof Blob) {
1923
data.append(key, value)
2024
} else {
@@ -26,7 +30,7 @@ const serializeUrlSearchParamsPair = (
2630
data: URLSearchParams,
2731
key: string,
2832
value: unknown
29-
) => {
33+
): void => {
3034
if (typeof value === 'string') {
3135
data.append(key, value)
3236
} else {
@@ -37,7 +41,7 @@ const serializeUrlSearchParamsPair = (
3741
export const formDataBodySerializer = {
3842
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
3943
body: T
40-
) => {
44+
): FormData => {
4145
const data = new FormData()
4246

4347
Object.entries(body).forEach(([key, value]) => {
@@ -56,7 +60,7 @@ export const formDataBodySerializer = {
5660
}
5761

5862
export const jsonBodySerializer = {
59-
bodySerializer: <T>(body: T) =>
63+
bodySerializer: <T>(body: T): string =>
6064
JSON.stringify(body, (_key, value) =>
6165
typeof value === 'bigint' ? value.toString() : value
6266
),
@@ -65,7 +69,7 @@ export const jsonBodySerializer = {
6569
export const urlSearchParamsBodySerializer = {
6670
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
6771
body: T
68-
) => {
72+
): string => {
6973
const data = new URLSearchParams()
7074

7175
Object.entries(body).forEach(([key, value]) => {

renderer/src/common/api/generated/types.gen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,12 @@ export type WorkloadsWorkload = {
593593
* CreatedAt is the timestamp when the workload was created.
594594
*/
595595
created_at?: string
596+
/**
597+
* Labels are the container labels (excluding standard ToolHive labels)
598+
*/
599+
labels?: {
600+
[key: string]: string
601+
}
596602
/**
597603
* Name is the name of the workload.
598604
* It is used as a unique identifier.

renderer/src/common/api/openapi.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@
658658
"description": "CreatedAt is the timestamp when the workload was created.",
659659
"type": "string"
660660
},
661+
"labels": {
662+
"additionalProperties": { "type": "string" },
663+
"description": "Labels are the container labels (excluding standard ToolHive labels)",
664+
"type": "object"
665+
},
661666
"name": {
662667
"description": "Name is the name of the workload.\nIt is used as a unique identifier.",
663668
"type": "string"

utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const TOOLHIVE_VERSION = process.env.THV_VERSION ?? 'v0.1.8'
1+
export const TOOLHIVE_VERSION = process.env.THV_VERSION ?? 'v0.1.9'

0 commit comments

Comments
 (0)