Skip to content

Commit 2701ab2

Browse files
chore(deps): update dependency @hey-api/openapi-ts to v0.94.4 (#1798)
* chore(deps): update dependency @hey-api/openapi-ts to v0.94.4 * chore: regenerate artifacts after dependency update --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0d47bb5 commit 2701ab2

6 files changed

Lines changed: 48 additions & 53 deletions

File tree

common/api/generated/client/client.gen.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const createClient = (config: Config = {}): Client => {
4747
...options,
4848
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
4949
headers: mergeHeaders(_config.headers, options.headers),
50-
serializedBody: undefined,
50+
serializedBody: undefined as string | undefined,
5151
}
5252

5353
if (opts.security) {
@@ -62,7 +62,7 @@ export const createClient = (config: Config = {}): Client => {
6262
}
6363

6464
if (opts.body !== undefined && opts.bodySerializer) {
65-
opts.serializedBody = opts.bodySerializer(opts.body)
65+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined
6666
}
6767

6868
// remove Content-Type header if body is empty to avoid sending invalid requests
@@ -281,8 +281,11 @@ export const createClient = (config: Config = {}): Client => {
281281
})
282282
}
283283

284+
const _buildUrl: Client['buildUrl'] = (options) =>
285+
buildUrl({ ..._config, ...options })
286+
284287
return {
285-
buildUrl,
288+
buildUrl: _buildUrl,
286289
connect: makeMethodFn('CONNECT'),
287290
delete: makeMethodFn('DELETE'),
288291
get: makeMethodFn('GET'),

common/api/generated/client/types.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface RequestOptions<
7676
}>,
7777
Pick<
7878
ServerSentEventsOptions<TData>,
79+
| 'onRequest'
7980
| 'onSseError'
8081
| 'onSseEvent'
8182
| 'sseDefaultRetryDelay'

common/api/generated/core/bodySerializer.gen.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88

99
export type QuerySerializer = (query: Record<string, unknown>) => string
1010

11-
export type BodySerializer = (body: any) => any
11+
export type BodySerializer = (body: unknown) => unknown
1212

1313
type QuerySerializerOptionsObject = {
1414
allowReserved?: boolean
@@ -51,12 +51,10 @@ const serializeUrlSearchParamsPair = (
5151
}
5252

5353
export const formDataBodySerializer = {
54-
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
55-
body: T
56-
): FormData => {
54+
bodySerializer: (body: unknown): FormData => {
5755
const data = new FormData()
5856

59-
Object.entries(body).forEach(([key, value]) => {
57+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
6058
if (value === undefined || value === null) {
6159
return
6260
}
@@ -72,19 +70,17 @@ export const formDataBodySerializer = {
7270
}
7371

7472
export const jsonBodySerializer = {
75-
bodySerializer: <T>(body: T): string =>
73+
bodySerializer: (body: unknown): string =>
7674
JSON.stringify(body, (_key, value) =>
7775
typeof value === 'bigint' ? value.toString() : value
7876
),
7977
}
8078

8179
export const urlSearchParamsBodySerializer = {
82-
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
83-
body: T
84-
): string => {
80+
bodySerializer: (body: unknown): string => {
8581
const data = new URLSearchParams()
8682

87-
Object.entries(body).forEach(([key, value]) => {
83+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
8884
if (value === undefined || value === null) {
8985
return
9086
}

common/api/generated/core/params.gen.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ interface Params {
9696

9797
const stripEmptySlots = (params: Params) => {
9898
for (const [slot, value] of Object.entries(params)) {
99-
if (value && typeof value === 'object' && !Object.keys(value).length) {
99+
if (
100+
value &&
101+
typeof value === 'object' &&
102+
!Array.isArray(value) &&
103+
!Object.keys(value).length
104+
) {
100105
delete params[slot as Slot]
101106
}
102107
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@electron/fuses": "^2.0.0",
5454
"@electron/rebuild": "^4.0.3",
5555
"@eslint/js": "^9.25.0",
56-
"@hey-api/openapi-ts": "0.92.3",
56+
"@hey-api/openapi-ts": "0.94.4",
5757
"@playwright/test": "^1.57.0",
5858
"@tailwindcss/postcss": "^4.1.10",
5959
"@tanstack/router-plugin": "^1.120.11",

pnpm-lock.yaml

Lines changed: 28 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)