@hey-api/openapi-ts 0.56.1 → 0.56.3

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/dist/index.d.cts CHANGED
@@ -3802,7 +3802,7 @@ interface XMLObject {
3802
3802
  wrapped?: boolean;
3803
3803
  }
3804
3804
 
3805
- interface Config$9 extends PluginName<'@hey-api/schemas'> {
3805
+ interface Config$a extends PluginName<'@hey-api/schemas'> {
3806
3806
  /**
3807
3807
  * Customise the schema name. By default, `{{name}}Schema` is used. `name` is a
3808
3808
  * valid JavaScript/TypeScript identifier, e.g. if your schema name is
@@ -3920,7 +3920,21 @@ interface IRResponseObject {
3920
3920
  interface IRSchemaObject
3921
3921
  extends Pick<
3922
3922
  JsonSchemaDraft2020_12,
3923
- '$ref' | 'const' | 'deprecated' | 'description' | 'required' | 'title'
3923
+ | '$ref'
3924
+ | 'const'
3925
+ | 'default'
3926
+ | 'deprecated'
3927
+ | 'description'
3928
+ | 'exclusiveMaximum'
3929
+ | 'exclusiveMinimum'
3930
+ | 'maximum'
3931
+ | 'maxItems'
3932
+ | 'maxLength'
3933
+ | 'minimum'
3934
+ | 'minItems'
3935
+ | 'minLength'
3936
+ | 'required'
3937
+ | 'title'
3924
3938
  > {
3925
3939
  /**
3926
3940
  * If the schema is intended to be used as an object property, it can be
@@ -3970,7 +3984,7 @@ interface IRSchemaObject
3970
3984
  | 'void';
3971
3985
  }
3972
3986
 
3973
- interface Config$8 extends PluginName<'@hey-api/services'> {
3987
+ interface Config$9 extends PluginName<'@hey-api/services'> {
3974
3988
  /**
3975
3989
  * Group operation methods into service classes? When enabled, you can
3976
3990
  * select which classes to export with `services.include` and/or
@@ -4031,7 +4045,7 @@ interface Config$8 extends PluginName<'@hey-api/services'> {
4031
4045
  serviceNameBuilder?: string;
4032
4046
  }
4033
4047
 
4034
- interface Config$7 extends PluginName<'@hey-api/transformers'> {
4048
+ interface Config$8 extends PluginName<'@hey-api/transformers'> {
4035
4049
  /**
4036
4050
  * Convert date strings into Date objects?
4037
4051
  * @default false
@@ -4044,7 +4058,7 @@ interface Config$7 extends PluginName<'@hey-api/transformers'> {
4044
4058
  output?: string;
4045
4059
  }
4046
4060
 
4047
- interface Config$6 extends PluginName<'@hey-api/types'> {
4061
+ interface Config$7 extends PluginName<'@hey-api/types'> {
4048
4062
  /**
4049
4063
  * Generate enum definitions?
4050
4064
  * @default false
@@ -4078,7 +4092,7 @@ interface Config$6 extends PluginName<'@hey-api/types'> {
4078
4092
  tree?: boolean;
4079
4093
  }
4080
4094
 
4081
- interface Config$5
4095
+ interface Config$6
4082
4096
  extends PluginName<'@tanstack/angular-query-experimental'> {
4083
4097
  /**
4084
4098
  * Generate {@link https://tanstack.com/query/v5/docs/framework/angular/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
@@ -4103,7 +4117,7 @@ interface Config$5
4103
4117
  queryOptions?: boolean;
4104
4118
  }
4105
4119
 
4106
- interface Config$4 extends PluginName<'@tanstack/react-query'> {
4120
+ interface Config$5 extends PluginName<'@tanstack/react-query'> {
4107
4121
  /**
4108
4122
  * Generate {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4109
4123
  * @default true
@@ -4127,7 +4141,7 @@ interface Config$4 extends PluginName<'@tanstack/react-query'> {
4127
4141
  queryOptions?: boolean;
4128
4142
  }
4129
4143
 
4130
- interface Config$3 extends PluginName<'@tanstack/solid-query'> {
4144
+ interface Config$4 extends PluginName<'@tanstack/solid-query'> {
4131
4145
  /**
4132
4146
  * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4133
4147
  * @default true
@@ -4151,7 +4165,7 @@ interface Config$3 extends PluginName<'@tanstack/solid-query'> {
4151
4165
  queryOptions?: boolean;
4152
4166
  }
4153
4167
 
4154
- interface Config$2 extends PluginName<'@tanstack/svelte-query'> {
4168
+ interface Config$3 extends PluginName<'@tanstack/svelte-query'> {
4155
4169
  /**
4156
4170
  * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4157
4171
  * @default true
@@ -4175,7 +4189,7 @@ interface Config$2 extends PluginName<'@tanstack/svelte-query'> {
4175
4189
  queryOptions?: boolean;
4176
4190
  }
4177
4191
 
4178
- interface Config$1 extends PluginName<'@tanstack/vue-query'> {
4192
+ interface Config$2 extends PluginName<'@tanstack/vue-query'> {
4179
4193
  /**
4180
4194
  * Generate {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4181
4195
  * @default true
@@ -4199,7 +4213,7 @@ interface Config$1 extends PluginName<'@tanstack/vue-query'> {
4199
4213
  queryOptions?: boolean;
4200
4214
  }
4201
4215
 
4202
- interface Config extends PluginName<'fastify'> {
4216
+ interface Config$1 extends PluginName<'fastify'> {
4203
4217
  /**
4204
4218
  * Name of the generated file.
4205
4219
  * @default 'fastify'
@@ -4207,10 +4221,26 @@ interface Config extends PluginName<'fastify'> {
4207
4221
  output?: string;
4208
4222
  }
4209
4223
 
4224
+ // import type { IROperationObject, IRSchemaObject } from '../../ir/ir';
4225
+
4226
+
4227
+ interface Config extends PluginName<'zod'> {
4228
+ /**
4229
+ * Customise the Zod schema name. By default, `z{{name}}` is used,
4230
+ * where `name` is a definition name or an operation name.
4231
+ */
4232
+ // nameBuilder?: (model: IROperationObject | IRSchemaObject) => string;
4233
+ /**
4234
+ * Name of the generated file.
4235
+ * @default 'zod'
4236
+ */
4237
+ output?: string;
4238
+ }
4239
+
4210
4240
  /**
4211
4241
  * User-facing plugin types.
4212
4242
  */
4213
- type UserPlugins = UserConfig$1<Config$9> | UserConfig$1<Config$8> | UserConfig$1<Config$7> | UserConfig$1<Config$6> | UserConfig$1<Config$5> | UserConfig$1<Config$4> | UserConfig$1<Config$3> | UserConfig$1<Config$2> | UserConfig$1<Config$1> | UserConfig$1<Config>;
4243
+ type UserPlugins = UserConfig$1<Config$a> | UserConfig$1<Config$9> | UserConfig$1<Config$8> | UserConfig$1<Config$7> | UserConfig$1<Config$6> | UserConfig$1<Config$5> | UserConfig$1<Config$4> | UserConfig$1<Config$3> | UserConfig$1<Config$2> | UserConfig$1<Config$1> | UserConfig$1<Config>;
4214
4244
 
4215
4245
  declare const CLIENTS: readonly ["@hey-api/client-axios", "@hey-api/client-fetch", "legacy/angular", "legacy/axios", "legacy/fetch", "legacy/node", "legacy/xhr"];
4216
4246
  type Client$2 = (typeof CLIENTS)[number];
@@ -4272,9 +4302,21 @@ interface ClientConfig {
4272
4302
  * Alternatively, you can define a configuration object with more options.
4273
4303
  */
4274
4304
  input: string | Record<string, unknown> | {
4305
+ /**
4306
+ * Prevent parts matching the regular expression from being processed.
4307
+ * You can select both operations and components by reference within
4308
+ * the bundled input. In case of conflicts, `exclude` takes precedence
4309
+ * over `include`.
4310
+ *
4311
+ * @example
4312
+ * operation: '^#/paths/api/v1/foo/get$'
4313
+ * schema: '^#/components/schemas/Foo$'
4314
+ */
4315
+ exclude?: string;
4275
4316
  /**
4276
4317
  * Process only parts matching the regular expression. You can select both
4277
- * operations and components by reference within the bundled input.
4318
+ * operations and components by reference within the bundled input. In
4319
+ * case of conflicts, `exclude` takes precedence over `include`.
4278
4320
  *
4279
4321
  * @example
4280
4322
  * operation: '^#/paths/api/v1/foo/get$'
package/dist/index.d.ts CHANGED
@@ -3802,7 +3802,7 @@ interface XMLObject {
3802
3802
  wrapped?: boolean;
3803
3803
  }
3804
3804
 
3805
- interface Config$9 extends PluginName<'@hey-api/schemas'> {
3805
+ interface Config$a extends PluginName<'@hey-api/schemas'> {
3806
3806
  /**
3807
3807
  * Customise the schema name. By default, `{{name}}Schema` is used. `name` is a
3808
3808
  * valid JavaScript/TypeScript identifier, e.g. if your schema name is
@@ -3920,7 +3920,21 @@ interface IRResponseObject {
3920
3920
  interface IRSchemaObject
3921
3921
  extends Pick<
3922
3922
  JsonSchemaDraft2020_12,
3923
- '$ref' | 'const' | 'deprecated' | 'description' | 'required' | 'title'
3923
+ | '$ref'
3924
+ | 'const'
3925
+ | 'default'
3926
+ | 'deprecated'
3927
+ | 'description'
3928
+ | 'exclusiveMaximum'
3929
+ | 'exclusiveMinimum'
3930
+ | 'maximum'
3931
+ | 'maxItems'
3932
+ | 'maxLength'
3933
+ | 'minimum'
3934
+ | 'minItems'
3935
+ | 'minLength'
3936
+ | 'required'
3937
+ | 'title'
3924
3938
  > {
3925
3939
  /**
3926
3940
  * If the schema is intended to be used as an object property, it can be
@@ -3970,7 +3984,7 @@ interface IRSchemaObject
3970
3984
  | 'void';
3971
3985
  }
3972
3986
 
3973
- interface Config$8 extends PluginName<'@hey-api/services'> {
3987
+ interface Config$9 extends PluginName<'@hey-api/services'> {
3974
3988
  /**
3975
3989
  * Group operation methods into service classes? When enabled, you can
3976
3990
  * select which classes to export with `services.include` and/or
@@ -4031,7 +4045,7 @@ interface Config$8 extends PluginName<'@hey-api/services'> {
4031
4045
  serviceNameBuilder?: string;
4032
4046
  }
4033
4047
 
4034
- interface Config$7 extends PluginName<'@hey-api/transformers'> {
4048
+ interface Config$8 extends PluginName<'@hey-api/transformers'> {
4035
4049
  /**
4036
4050
  * Convert date strings into Date objects?
4037
4051
  * @default false
@@ -4044,7 +4058,7 @@ interface Config$7 extends PluginName<'@hey-api/transformers'> {
4044
4058
  output?: string;
4045
4059
  }
4046
4060
 
4047
- interface Config$6 extends PluginName<'@hey-api/types'> {
4061
+ interface Config$7 extends PluginName<'@hey-api/types'> {
4048
4062
  /**
4049
4063
  * Generate enum definitions?
4050
4064
  * @default false
@@ -4078,7 +4092,7 @@ interface Config$6 extends PluginName<'@hey-api/types'> {
4078
4092
  tree?: boolean;
4079
4093
  }
4080
4094
 
4081
- interface Config$5
4095
+ interface Config$6
4082
4096
  extends PluginName<'@tanstack/angular-query-experimental'> {
4083
4097
  /**
4084
4098
  * Generate {@link https://tanstack.com/query/v5/docs/framework/angular/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
@@ -4103,7 +4117,7 @@ interface Config$5
4103
4117
  queryOptions?: boolean;
4104
4118
  }
4105
4119
 
4106
- interface Config$4 extends PluginName<'@tanstack/react-query'> {
4120
+ interface Config$5 extends PluginName<'@tanstack/react-query'> {
4107
4121
  /**
4108
4122
  * Generate {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4109
4123
  * @default true
@@ -4127,7 +4141,7 @@ interface Config$4 extends PluginName<'@tanstack/react-query'> {
4127
4141
  queryOptions?: boolean;
4128
4142
  }
4129
4143
 
4130
- interface Config$3 extends PluginName<'@tanstack/solid-query'> {
4144
+ interface Config$4 extends PluginName<'@tanstack/solid-query'> {
4131
4145
  /**
4132
4146
  * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4133
4147
  * @default true
@@ -4151,7 +4165,7 @@ interface Config$3 extends PluginName<'@tanstack/solid-query'> {
4151
4165
  queryOptions?: boolean;
4152
4166
  }
4153
4167
 
4154
- interface Config$2 extends PluginName<'@tanstack/svelte-query'> {
4168
+ interface Config$3 extends PluginName<'@tanstack/svelte-query'> {
4155
4169
  /**
4156
4170
  * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4157
4171
  * @default true
@@ -4175,7 +4189,7 @@ interface Config$2 extends PluginName<'@tanstack/svelte-query'> {
4175
4189
  queryOptions?: boolean;
4176
4190
  }
4177
4191
 
4178
- interface Config$1 extends PluginName<'@tanstack/vue-query'> {
4192
+ interface Config$2 extends PluginName<'@tanstack/vue-query'> {
4179
4193
  /**
4180
4194
  * Generate {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
4181
4195
  * @default true
@@ -4199,7 +4213,7 @@ interface Config$1 extends PluginName<'@tanstack/vue-query'> {
4199
4213
  queryOptions?: boolean;
4200
4214
  }
4201
4215
 
4202
- interface Config extends PluginName<'fastify'> {
4216
+ interface Config$1 extends PluginName<'fastify'> {
4203
4217
  /**
4204
4218
  * Name of the generated file.
4205
4219
  * @default 'fastify'
@@ -4207,10 +4221,26 @@ interface Config extends PluginName<'fastify'> {
4207
4221
  output?: string;
4208
4222
  }
4209
4223
 
4224
+ // import type { IROperationObject, IRSchemaObject } from '../../ir/ir';
4225
+
4226
+
4227
+ interface Config extends PluginName<'zod'> {
4228
+ /**
4229
+ * Customise the Zod schema name. By default, `z{{name}}` is used,
4230
+ * where `name` is a definition name or an operation name.
4231
+ */
4232
+ // nameBuilder?: (model: IROperationObject | IRSchemaObject) => string;
4233
+ /**
4234
+ * Name of the generated file.
4235
+ * @default 'zod'
4236
+ */
4237
+ output?: string;
4238
+ }
4239
+
4210
4240
  /**
4211
4241
  * User-facing plugin types.
4212
4242
  */
4213
- type UserPlugins = UserConfig$1<Config$9> | UserConfig$1<Config$8> | UserConfig$1<Config$7> | UserConfig$1<Config$6> | UserConfig$1<Config$5> | UserConfig$1<Config$4> | UserConfig$1<Config$3> | UserConfig$1<Config$2> | UserConfig$1<Config$1> | UserConfig$1<Config>;
4243
+ type UserPlugins = UserConfig$1<Config$a> | UserConfig$1<Config$9> | UserConfig$1<Config$8> | UserConfig$1<Config$7> | UserConfig$1<Config$6> | UserConfig$1<Config$5> | UserConfig$1<Config$4> | UserConfig$1<Config$3> | UserConfig$1<Config$2> | UserConfig$1<Config$1> | UserConfig$1<Config>;
4214
4244
 
4215
4245
  declare const CLIENTS: readonly ["@hey-api/client-axios", "@hey-api/client-fetch", "legacy/angular", "legacy/axios", "legacy/fetch", "legacy/node", "legacy/xhr"];
4216
4246
  type Client$2 = (typeof CLIENTS)[number];
@@ -4272,9 +4302,21 @@ interface ClientConfig {
4272
4302
  * Alternatively, you can define a configuration object with more options.
4273
4303
  */
4274
4304
  input: string | Record<string, unknown> | {
4305
+ /**
4306
+ * Prevent parts matching the regular expression from being processed.
4307
+ * You can select both operations and components by reference within
4308
+ * the bundled input. In case of conflicts, `exclude` takes precedence
4309
+ * over `include`.
4310
+ *
4311
+ * @example
4312
+ * operation: '^#/paths/api/v1/foo/get$'
4313
+ * schema: '^#/components/schemas/Foo$'
4314
+ */
4315
+ exclude?: string;
4275
4316
  /**
4276
4317
  * Process only parts matching the regular expression. You can select both
4277
- * operations and components by reference within the bundled input.
4318
+ * operations and components by reference within the bundled input. In
4319
+ * case of conflicts, `exclude` takes precedence over `include`.
4278
4320
  *
4279
4321
  * @example
4280
4322
  * operation: '^#/paths/api/v1/foo/get$'