@hey-api/openapi-ts 0.72.1 → 0.73.0

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.
Files changed (40) hide show
  1. package/README.md +5 -12
  2. package/dist/chunk-QUDCWAFW.js +39 -0
  3. package/dist/chunk-QUDCWAFW.js.map +1 -0
  4. package/dist/clients/axios/client.ts +111 -0
  5. package/dist/clients/axios/index.ts +21 -0
  6. package/dist/clients/axios/types.ts +178 -0
  7. package/dist/clients/axios/utils.ts +286 -0
  8. package/dist/clients/core/auth.ts +40 -0
  9. package/dist/clients/core/bodySerializer.ts +84 -0
  10. package/dist/clients/core/params.ts +141 -0
  11. package/dist/clients/core/pathSerializer.ts +179 -0
  12. package/dist/clients/core/types.ts +98 -0
  13. package/dist/clients/fetch/client.ts +181 -0
  14. package/dist/clients/fetch/index.ts +22 -0
  15. package/dist/clients/fetch/types.ts +215 -0
  16. package/dist/clients/fetch/utils.ts +415 -0
  17. package/dist/clients/next/client.ts +163 -0
  18. package/dist/clients/next/index.ts +21 -0
  19. package/dist/clients/next/types.ts +166 -0
  20. package/dist/clients/next/utils.ts +404 -0
  21. package/dist/clients/nuxt/client.ts +145 -0
  22. package/dist/clients/nuxt/index.ts +22 -0
  23. package/dist/clients/nuxt/types.ts +192 -0
  24. package/dist/clients/nuxt/utils.ts +358 -0
  25. package/dist/index.cjs +63 -63
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +6 -4
  28. package/dist/index.d.ts +6 -4
  29. package/dist/index.js +9 -9
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal.cjs +10 -10
  32. package/dist/internal.cjs.map +1 -1
  33. package/dist/internal.d.cts +2 -2
  34. package/dist/internal.d.ts +2 -2
  35. package/dist/internal.js +1 -1
  36. package/dist/{types.d-DMy4lDbN.d.cts → types.d-CAqtwzfv.d.cts} +61 -27
  37. package/dist/{types.d-DMy4lDbN.d.ts → types.d-CAqtwzfv.d.ts} +61 -27
  38. package/package.json +4 -3
  39. package/dist/chunk-LGCLNROS.js +0 -39
  40. package/dist/chunk-LGCLNROS.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
2
- import { e as Config, I as IR, W as WatchValues } from './types.d-DMy4lDbN.cjs';
3
- export { i as initConfigs } from './types.d-DMy4lDbN.cjs';
2
+ import { e as Config, I as IR, W as WatchValues } from './types.d-CAqtwzfv.cjs';
3
+ export { i as initConfigs } from './types.d-CAqtwzfv.cjs';
4
4
  import 'node:fs';
5
5
  import 'typescript';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
2
- import { e as Config, I as IR, W as WatchValues } from './types.d-DMy4lDbN.js';
3
- export { i as initConfigs } from './types.d-DMy4lDbN.js';
2
+ import { e as Config, I as IR, W as WatchValues } from './types.d-CAqtwzfv.js';
3
+ export { i as initConfigs } from './types.d-CAqtwzfv.js';
4
4
  import 'node:fs';
5
5
  import 'typescript';
6
6
 
package/dist/internal.js CHANGED
@@ -1,2 +1,2 @@
1
- import {createRequire}from'module';export{r as getSpec,F as initConfigs,A as parseOpenApiSpec}from'./chunk-LGCLNROS.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
1
+ import {createRequire}from'module';export{r as getSpec,G as initConfigs,B as parseOpenApiSpec}from'./chunk-QUDCWAFW.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
2
2
  //# sourceMappingURL=internal.js.map
@@ -6476,10 +6476,11 @@ type PluginTag = 'client' | 'transformer' | 'validator';
6476
6476
 
6477
6477
  interface PluginContext {
6478
6478
  ensureDependency: (name: PluginNames | true) => void;
6479
- pluginByTag: (
6480
- tag: PluginTag,
6481
- errorMessage?: string,
6482
- ) => AnyPluginName | undefined;
6479
+ pluginByTag: (props: {
6480
+ defaultPlugin?: AnyPluginName;
6481
+ errorMessage?: string;
6482
+ tag: PluginTag;
6483
+ }) => AnyPluginName | undefined;
6483
6484
  }
6484
6485
 
6485
6486
  interface BaseConfig {
@@ -6624,25 +6625,12 @@ declare namespace Client {
6624
6625
  */
6625
6626
  baseUrl?: string | number | boolean;
6626
6627
  /**
6627
- * Bundle the client module? Set this to true if don't want to declare it
6628
- * as a separate dependency. When true, the client module will be generated
6629
- * from the client package and bundled with the rest of the generated output.
6630
- * This is useful if you're repackaging the output, publishing it to other
6631
- * users, and you don't want them to install any dependencies.
6628
+ * Bundle the client module? When `true`, the client module will be copied
6629
+ * from the client plugin and bundled with the generated output.
6632
6630
  *
6633
- * @default false
6631
+ * @default true
6634
6632
  */
6635
6633
  bundle?: boolean;
6636
- /**
6637
- * **This is an experimental feature.**
6638
- *
6639
- * When `bundle` is set to `true`, you can optionally set this option
6640
- * to `true` to bundle the client source code instead of the `dist` folder.
6641
- * This will copy the TypeScript files instead of CJS/ESM JavaScript files.
6642
- *
6643
- * @default false
6644
- */
6645
- bundleSource_EXPERIMENTAL?: boolean;
6646
6634
  /**
6647
6635
  * Should the exports from the generated files be re-exported in the index
6648
6636
  * barrel file?
@@ -6795,10 +6783,10 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6795
6783
  * Use an internal client instance to send HTTP requests? This is useful if
6796
6784
  * you don't want to manually pass the client to each SDK function.
6797
6785
  *
6798
- * Ensure you have declared the selected library as a dependency to avoid
6799
- * errors. You can customize the selected client output through its plugin.
6800
- * You can also set `client` to `true` to automatically choose the client
6801
- * from your defined plugins.
6786
+ * You can customize the selected client output through its plugin. You can
6787
+ * also set `client` to `true` to automatically choose the client from your
6788
+ * defined plugins. If we can't detect a client plugin when using `true`, we
6789
+ * will default to `@hey-api/client-fetch`.
6802
6790
  *
6803
6791
  * @default true
6804
6792
  */
@@ -7179,6 +7167,41 @@ declare namespace TanStackQuery {
7179
7167
  * @default false
7180
7168
  */
7181
7169
  exportFromIndex?: boolean;
7170
+ /**
7171
+ * Customize the generated infinite query key names. The name variable is
7172
+ * obtained from the SDK function name.
7173
+ *
7174
+ * @default '{{name}}InfiniteQueryKey'
7175
+ */
7176
+ infiniteQueryKeyNameBuilder?: string | ((name: string) => string);
7177
+ /**
7178
+ * Customize the generated infinite query options names. The name variable
7179
+ * is obtained from the SDK function name.
7180
+ *
7181
+ * @default '{{name}}InfiniteOptions'
7182
+ */
7183
+ infiniteQueryOptionsNameBuilder?: string | ((name: string) => string);
7184
+ /**
7185
+ * Customize the generated mutation options names. The name variable is
7186
+ * obtained from the SDK function name.
7187
+ *
7188
+ * @default '{{name}}Mutation'
7189
+ */
7190
+ mutationOptionsNameBuilder?: string | ((name: string) => string);
7191
+ /**
7192
+ * Customize the generated query key names. The name variable is obtained
7193
+ * from the SDK function name.
7194
+ *
7195
+ * @default '{{name}}QueryKey'
7196
+ */
7197
+ queryKeyNameBuilder?: string | ((name: string) => string);
7198
+ /**
7199
+ * Customize the generated query options names. The name variable is
7200
+ * obtained from the SDK function name.
7201
+ *
7202
+ * @default '{{name}}Options'
7203
+ */
7204
+ queryOptionsNameBuilder?: string | ((name: string) => string);
7182
7205
  };
7183
7206
  }
7184
7207
 
@@ -7275,6 +7298,14 @@ interface Config$1 extends Plugin.Name<'zod'> {
7275
7298
  * @default false
7276
7299
  */
7277
7300
  exportFromIndex?: boolean;
7301
+ /**
7302
+ * Enable Zod metadata support? It's often useful to associate a schema with
7303
+ * some additional metadata for documentation, code generation, AI
7304
+ * structured outputs, form validation, and other purposes.
7305
+ *
7306
+ * @default false
7307
+ */
7308
+ metadata?: boolean;
7278
7309
  /**
7279
7310
  * Customise the Zod schema name. By default, `z{{name}}` is used,
7280
7311
  * where `name` is a definition name or an operation name.
@@ -7432,8 +7463,8 @@ interface Filters {
7432
7463
  include?: ReadonlyArray<string>;
7433
7464
  };
7434
7465
  /**
7435
- * Keep reusable components without any references in the output? By
7436
- * default, we exclude orphaned resources.
7466
+ * Keep reusable components without any references from operations in the
7467
+ * output? By default, we exclude orphaned resources.
7437
7468
  *
7438
7469
  * @default false
7439
7470
  */
@@ -8316,7 +8347,10 @@ declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
8316
8347
  /**
8317
8348
  * @internal
8318
8349
  */
8319
- declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<Config[]>;
8350
+ declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<ReadonlyArray<{
8351
+ config: Config;
8352
+ errors: ReadonlyArray<Error>;
8353
+ }>>;
8320
8354
 
8321
8355
  declare namespace LegacyIR {
8322
8356
  export type LegacyOperation = Operation;
@@ -6476,10 +6476,11 @@ type PluginTag = 'client' | 'transformer' | 'validator';
6476
6476
 
6477
6477
  interface PluginContext {
6478
6478
  ensureDependency: (name: PluginNames | true) => void;
6479
- pluginByTag: (
6480
- tag: PluginTag,
6481
- errorMessage?: string,
6482
- ) => AnyPluginName | undefined;
6479
+ pluginByTag: (props: {
6480
+ defaultPlugin?: AnyPluginName;
6481
+ errorMessage?: string;
6482
+ tag: PluginTag;
6483
+ }) => AnyPluginName | undefined;
6483
6484
  }
6484
6485
 
6485
6486
  interface BaseConfig {
@@ -6624,25 +6625,12 @@ declare namespace Client {
6624
6625
  */
6625
6626
  baseUrl?: string | number | boolean;
6626
6627
  /**
6627
- * Bundle the client module? Set this to true if don't want to declare it
6628
- * as a separate dependency. When true, the client module will be generated
6629
- * from the client package and bundled with the rest of the generated output.
6630
- * This is useful if you're repackaging the output, publishing it to other
6631
- * users, and you don't want them to install any dependencies.
6628
+ * Bundle the client module? When `true`, the client module will be copied
6629
+ * from the client plugin and bundled with the generated output.
6632
6630
  *
6633
- * @default false
6631
+ * @default true
6634
6632
  */
6635
6633
  bundle?: boolean;
6636
- /**
6637
- * **This is an experimental feature.**
6638
- *
6639
- * When `bundle` is set to `true`, you can optionally set this option
6640
- * to `true` to bundle the client source code instead of the `dist` folder.
6641
- * This will copy the TypeScript files instead of CJS/ESM JavaScript files.
6642
- *
6643
- * @default false
6644
- */
6645
- bundleSource_EXPERIMENTAL?: boolean;
6646
6634
  /**
6647
6635
  * Should the exports from the generated files be re-exported in the index
6648
6636
  * barrel file?
@@ -6795,10 +6783,10 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6795
6783
  * Use an internal client instance to send HTTP requests? This is useful if
6796
6784
  * you don't want to manually pass the client to each SDK function.
6797
6785
  *
6798
- * Ensure you have declared the selected library as a dependency to avoid
6799
- * errors. You can customize the selected client output through its plugin.
6800
- * You can also set `client` to `true` to automatically choose the client
6801
- * from your defined plugins.
6786
+ * You can customize the selected client output through its plugin. You can
6787
+ * also set `client` to `true` to automatically choose the client from your
6788
+ * defined plugins. If we can't detect a client plugin when using `true`, we
6789
+ * will default to `@hey-api/client-fetch`.
6802
6790
  *
6803
6791
  * @default true
6804
6792
  */
@@ -7179,6 +7167,41 @@ declare namespace TanStackQuery {
7179
7167
  * @default false
7180
7168
  */
7181
7169
  exportFromIndex?: boolean;
7170
+ /**
7171
+ * Customize the generated infinite query key names. The name variable is
7172
+ * obtained from the SDK function name.
7173
+ *
7174
+ * @default '{{name}}InfiniteQueryKey'
7175
+ */
7176
+ infiniteQueryKeyNameBuilder?: string | ((name: string) => string);
7177
+ /**
7178
+ * Customize the generated infinite query options names. The name variable
7179
+ * is obtained from the SDK function name.
7180
+ *
7181
+ * @default '{{name}}InfiniteOptions'
7182
+ */
7183
+ infiniteQueryOptionsNameBuilder?: string | ((name: string) => string);
7184
+ /**
7185
+ * Customize the generated mutation options names. The name variable is
7186
+ * obtained from the SDK function name.
7187
+ *
7188
+ * @default '{{name}}Mutation'
7189
+ */
7190
+ mutationOptionsNameBuilder?: string | ((name: string) => string);
7191
+ /**
7192
+ * Customize the generated query key names. The name variable is obtained
7193
+ * from the SDK function name.
7194
+ *
7195
+ * @default '{{name}}QueryKey'
7196
+ */
7197
+ queryKeyNameBuilder?: string | ((name: string) => string);
7198
+ /**
7199
+ * Customize the generated query options names. The name variable is
7200
+ * obtained from the SDK function name.
7201
+ *
7202
+ * @default '{{name}}Options'
7203
+ */
7204
+ queryOptionsNameBuilder?: string | ((name: string) => string);
7182
7205
  };
7183
7206
  }
7184
7207
 
@@ -7275,6 +7298,14 @@ interface Config$1 extends Plugin.Name<'zod'> {
7275
7298
  * @default false
7276
7299
  */
7277
7300
  exportFromIndex?: boolean;
7301
+ /**
7302
+ * Enable Zod metadata support? It's often useful to associate a schema with
7303
+ * some additional metadata for documentation, code generation, AI
7304
+ * structured outputs, form validation, and other purposes.
7305
+ *
7306
+ * @default false
7307
+ */
7308
+ metadata?: boolean;
7278
7309
  /**
7279
7310
  * Customise the Zod schema name. By default, `z{{name}}` is used,
7280
7311
  * where `name` is a definition name or an operation name.
@@ -7432,8 +7463,8 @@ interface Filters {
7432
7463
  include?: ReadonlyArray<string>;
7433
7464
  };
7434
7465
  /**
7435
- * Keep reusable components without any references in the output? By
7436
- * default, we exclude orphaned resources.
7466
+ * Keep reusable components without any references from operations in the
7467
+ * output? By default, we exclude orphaned resources.
7437
7468
  *
7438
7469
  * @default false
7439
7470
  */
@@ -8316,7 +8347,10 @@ declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
8316
8347
  /**
8317
8348
  * @internal
8318
8349
  */
8319
- declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<Config[]>;
8350
+ declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<ReadonlyArray<{
8351
+ config: Config;
8352
+ errors: ReadonlyArray<Error>;
8353
+ }>>;
8320
8354
 
8321
8355
  declare namespace LegacyIR {
8322
8356
  export type LegacyOperation = Operation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hey-api/openapi-ts",
3
- "version": "0.72.1",
3
+ "version": "0.73.0",
4
4
  "description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.",
5
5
  "homepage": "https://heyapi.dev/",
6
6
  "repository": {
@@ -96,13 +96,14 @@
96
96
  "express": "4.21.0",
97
97
  "glob": "10.4.3",
98
98
  "node-fetch": "3.3.2",
99
+ "nuxt": "3.14.1592",
99
100
  "prettier": "3.4.2",
100
101
  "ts-node": "10.9.2",
101
102
  "tslib": "2.8.1",
102
103
  "typescript": "5.8.3",
104
+ "vue": "3.5.13",
103
105
  "yaml": "2.8.0",
104
- "@config/vite-base": "0.0.1",
105
- "@hey-api/client-core": "0.2.0"
106
+ "@config/vite-base": "0.0.1"
106
107
  },
107
108
  "scripts": {
108
109
  "build": "tsup && pnpm check-exports",