@hey-api/openapi-ts 0.94.3 → 0.94.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/clients/angular/utils.ts +1 -1
- package/dist/clients/axios/utils.ts +2 -2
- package/dist/clients/core/types.ts +1 -1
- package/dist/clients/core/utils.ts +1 -1
- package/dist/clients/fetch/utils.ts +1 -1
- package/dist/clients/next/utils.ts +1 -1
- package/dist/clients/nuxt/utils.ts +1 -1
- package/dist/clients/ofetch/utils.ts +1 -1
- package/dist/index.d.mts +630 -452
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init-OaZZcRie.mjs → init-DXg2DSyt.mjs} +837 -493
- package/dist/init-DXg2DSyt.mjs.map +1 -0
- package/dist/internal.mjs +1 -1
- package/dist/run.mjs +5 -5
- package/dist/run.mjs.map +1 -1
- package/dist/{src-CwAmA-wp.mjs → src-onOyaUFS.mjs} +3 -3
- package/dist/src-onOyaUFS.mjs.map +1 -0
- package/package.json +6 -5
- package/dist/init-OaZZcRie.mjs.map +0 -1
- package/dist/src-CwAmA-wp.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -306,9 +306,9 @@ Plugins are responsible for generating artifacts from your input. By default, He
|
|
|
306
306
|
|
|
307
307
|
### Client
|
|
308
308
|
|
|
309
|
-
Clients are responsible for sending the actual HTTP requests.
|
|
309
|
+
Clients are responsible for sending the actual HTTP requests. We default to Fetch client if you're generating SDKs, but you can choose a different option from the available clients.
|
|
310
310
|
|
|
311
|
-
###
|
|
311
|
+
### Available Clients
|
|
312
312
|
|
|
313
313
|
- [`@hey-api/client-fetch`](https://heyapi.dev/openapi-ts/clients/fetch)
|
|
314
314
|
- [`@hey-api/client-angular`](https://heyapi.dev/openapi-ts/clients/angular)
|
|
@@ -318,15 +318,15 @@ Clients are responsible for sending the actual HTTP requests. Using clients is n
|
|
|
318
318
|
- [`@hey-api/client-nuxt`](https://heyapi.dev/openapi-ts/clients/nuxt)
|
|
319
319
|
- [`@hey-api/client-ofetch`](https://heyapi.dev/openapi-ts/clients/ofetch)
|
|
320
320
|
|
|
321
|
-
###
|
|
321
|
+
### Proposed Clients (Vote to Prioritize)
|
|
322
322
|
|
|
323
|
-
The following clients are
|
|
323
|
+
The following clients are roadmap proposals and are not started yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/issues?q=state%3Aopen%20label%3A%22vote%20%F0%9F%93%A9%22).
|
|
324
324
|
|
|
325
325
|
- [`@hey-api/client-effect`](https://heyapi.dev/openapi-ts/clients/effect)
|
|
326
326
|
|
|
327
327
|
Don't see your client? [Build your own](https://heyapi.dev/openapi-ts/clients/custom) or let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).
|
|
328
328
|
|
|
329
|
-
###
|
|
329
|
+
### Available Plugins
|
|
330
330
|
|
|
331
331
|
These plugins help reduce boilerplate associated with third-party dependencies. Hey API natively supports the most popular packages. Please open an issue on [GitHub](https://github.com/hey-api/openapi-ts/issues) if you'd like us to support your favorite package.
|
|
332
332
|
|
|
@@ -343,13 +343,14 @@ These plugins help reduce boilerplate associated with third-party dependencies.
|
|
|
343
343
|
- [`@tanstack/svelte-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
|
|
344
344
|
- [`@tanstack/vue-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
|
|
345
345
|
- [`fastify`](https://heyapi.dev/openapi-ts/plugins/fastify)
|
|
346
|
+
- [`orpc`](https://heyapi.dev/openapi-ts/plugins/orpc)
|
|
346
347
|
- [`nestjs`](https://heyapi.dev/openapi-ts/plugins/nest)
|
|
347
348
|
- [`valibot`](https://heyapi.dev/openapi-ts/plugins/valibot)
|
|
348
349
|
- [`zod`](https://heyapi.dev/openapi-ts/plugins/zod)
|
|
349
350
|
|
|
350
|
-
###
|
|
351
|
+
### Proposed Plugins (Vote to Prioritize)
|
|
351
352
|
|
|
352
|
-
The following plugins are
|
|
353
|
+
The following plugins are roadmap proposals and are not started yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/issues?q=state%3Aopen%20label%3A%22vote%20%F0%9F%93%A9%22).
|
|
353
354
|
|
|
354
355
|
- [Adonis](https://heyapi.dev/openapi-ts/plugins/adonis)
|
|
355
356
|
- [Ajv](https://heyapi.dev/openapi-ts/plugins/ajv)
|
|
@@ -296,7 +296,7 @@ export const mergeHeaders = (
|
|
|
296
296
|
mergedHeaders = mergedHeaders.append(key, v as string);
|
|
297
297
|
}
|
|
298
298
|
} else if (value !== undefined) {
|
|
299
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
299
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
300
300
|
// content value in OpenAPI specification is 'application/json'
|
|
301
301
|
mergedHeaders = mergedHeaders.set(
|
|
302
302
|
key,
|
|
@@ -128,7 +128,7 @@ export const buildUrl: Client['buildUrl'] = (options) => {
|
|
|
128
128
|
const instanceBaseUrl = options.axios?.defaults?.baseURL;
|
|
129
129
|
|
|
130
130
|
const baseUrl =
|
|
131
|
-
|
|
131
|
+
options.baseURL && typeof options.baseURL === 'string' ? options.baseURL : instanceBaseUrl;
|
|
132
132
|
|
|
133
133
|
return getUrl({
|
|
134
134
|
baseUrl: baseUrl as string,
|
|
@@ -190,7 +190,7 @@ export const mergeHeaders = (
|
|
|
190
190
|
mergedHeaders[key] = [...(mergedHeaders[key] ?? []), v as string];
|
|
191
191
|
}
|
|
192
192
|
} else if (value !== undefined) {
|
|
193
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
193
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
194
194
|
// content value in OpenAPI specification is 'application/json'
|
|
195
195
|
mergedHeaders[key] = typeof value === 'object' ? JSON.stringify(value) : (value as string);
|
|
196
196
|
}
|
|
@@ -78,7 +78,7 @@ export interface Config {
|
|
|
78
78
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
79
79
|
/**
|
|
80
80
|
* A function transforming response data before it's returned. This is useful
|
|
81
|
-
* for post-processing data, e.g
|
|
81
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
82
82
|
*/
|
|
83
83
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
84
84
|
/**
|
|
@@ -124,7 +124,7 @@ export function getValidRequestBody(options: {
|
|
|
124
124
|
return hasSerializedBody ? options.serializedBody : null;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
// not all clients implement a serializedBody property (i.e
|
|
127
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
128
128
|
return options.body !== '' ? options.body : null;
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -202,7 +202,7 @@ export const mergeHeaders = (
|
|
|
202
202
|
mergedHeaders.append(key, v as string);
|
|
203
203
|
}
|
|
204
204
|
} else if (value !== undefined) {
|
|
205
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
205
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
206
206
|
// content value in OpenAPI specification is 'application/json'
|
|
207
207
|
mergedHeaders.set(
|
|
208
208
|
key,
|
|
@@ -311,7 +311,7 @@ export const mergeHeaders = (
|
|
|
311
311
|
mergedHeaders.append(key, v as string);
|
|
312
312
|
}
|
|
313
313
|
} else if (value !== undefined) {
|
|
314
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
314
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
315
315
|
// content value in OpenAPI specification is 'application/json'
|
|
316
316
|
mergedHeaders.set(
|
|
317
317
|
key,
|
|
@@ -286,7 +286,7 @@ export const mergeHeaders = (
|
|
|
286
286
|
}
|
|
287
287
|
} else if (value !== undefined) {
|
|
288
288
|
const v = unwrapRefs(value);
|
|
289
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
289
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
290
290
|
// content value in OpenAPI specification is 'application/json'
|
|
291
291
|
mergedHeaders.set(key, typeof v === 'object' ? JSON.stringify(v) : (v as string));
|
|
292
292
|
}
|
|
@@ -233,7 +233,7 @@ export const mergeHeaders = (
|
|
|
233
233
|
mergedHeaders.append(key, v as string);
|
|
234
234
|
}
|
|
235
235
|
} else if (value !== undefined) {
|
|
236
|
-
// assume object headers are meant to be JSON stringified, i.e
|
|
236
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
237
237
|
// content value in OpenAPI specification is 'application/json'
|
|
238
238
|
mergedHeaders.set(
|
|
239
239
|
key,
|