@hey-api/openapi-ts 0.73.0 → 0.75.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.
@@ -3295,6 +3295,48 @@ interface OpenApi$2 {
3295
3295
 
3296
3296
  type OpenApi$1 = OpenApi$3 | OpenApi$2;
3297
3297
 
3298
+ interface Operation extends Omit<Operation$1, 'tags'> {
3299
+ service: string;
3300
+ }
3301
+
3302
+ interface Service extends Pick<Model, '$refs' | 'imports' | 'name'> {
3303
+ operations: Operation[];
3304
+ }
3305
+
3306
+ interface Client$1 extends Omit<Client$2, 'operations'> {
3307
+ services: Service[];
3308
+ }
3309
+
3310
+ type ExtractWithDiscriminator<T, Discriminator> = T extends Discriminator
3311
+ ? T
3312
+ : never;
3313
+
3314
+ /**
3315
+ * Accepts an array of elements union and attempts to extract only objects.
3316
+ * For example, Array<string | number | { id: string }> would result in
3317
+ * Array<{ id: string }>.
3318
+ */
3319
+ type ExtractArrayOfObjects<T, Discriminator> =
3320
+ T extends Array<infer U>
3321
+ ? Array<ExtractWithDiscriminator<U, Discriminator>>
3322
+ : T extends ReadonlyArray<infer U>
3323
+ ? ReadonlyArray<ExtractWithDiscriminator<U, Discriminator>>
3324
+ : never;
3325
+
3326
+ type Files = Record<string, TypeScriptFile>;
3327
+
3328
+ /**
3329
+ * Transforms an array of objects into an optional object map.
3330
+ * For example, Array<{ id: string }> would result in
3331
+ * { [key: string]?: { id: string } }
3332
+ */
3333
+ type ArrayOfObjectsToObjectMap<
3334
+ T extends ReadonlyArray<Record<string, any>>,
3335
+ D extends keyof T[number],
3336
+ > = {
3337
+ [K in T[number][D]]?: Extract<T[number], Record<D, K>>;
3338
+ };
3339
+
3298
3340
  interface JsonSchemaDraft4 extends EnumExtensions {
3299
3341
  /**
3300
3342
  * A schema can reference another schema using the `$ref` keyword. The value of `$ref` is a URI-reference that is resolved against the schema's {@link https://json-schema.org/understanding-json-schema/structuring#base-uri Base URI}. When evaluating a `$ref`, an implementation uses the resolved identifier to retrieve the referenced schema and applies that schema to the {@link https://json-schema.org/learn/glossary#instance instance}.
@@ -5051,6 +5093,7 @@ interface XMLObject$1 {
5051
5093
  }
5052
5094
 
5053
5095
  interface OpenApiV2_0_XTypes {
5096
+ InfoObject: InfoObject$1;
5054
5097
  SchemaObject: SchemaObject$1;
5055
5098
  }
5056
5099
 
@@ -6336,6 +6379,7 @@ type OpenApiSchemaFormats =
6336
6379
  type Format = JsonSchemaFormats | OpenApiSchemaFormats | (string & {});
6337
6380
 
6338
6381
  interface OpenApiV3_0_XTypes {
6382
+ InfoObject: InfoObject;
6339
6383
  ParameterObject: ParameterObject;
6340
6384
  ReferenceObject: ReferenceObject;
6341
6385
  RequestBodyObject: RequestBodyObject;
@@ -6344,6 +6388,7 @@ interface OpenApiV3_0_XTypes {
6344
6388
  }
6345
6389
 
6346
6390
  interface OpenApiV3_1_XTypes {
6391
+ InfoObject: InfoObject$2;
6347
6392
  ParameterObject: ParameterObject$2;
6348
6393
  ReferenceObject: ReferenceObject$2;
6349
6394
  RequestBodyObject: RequestBodyObject$1;
@@ -6359,6 +6404,14 @@ declare namespace OpenApi {
6359
6404
  export type V3_1_X = OpenApiV3_1_X;
6360
6405
  }
6361
6406
 
6407
+ declare namespace OpenApiMetaObject {
6408
+ export type V2_0_X = OpenApiV2_0_XTypes['InfoObject'];
6409
+
6410
+ export type V3_0_X = OpenApiV3_0_XTypes['InfoObject'];
6411
+
6412
+ export type V3_1_X = OpenApiV3_1_XTypes['InfoObject'];
6413
+ }
6414
+
6362
6415
  declare namespace OpenApiParameterObject {
6363
6416
  export type V3_0_X =
6364
6417
  | OpenApiV3_0_XTypes['ParameterObject']
@@ -6397,52 +6450,96 @@ declare namespace OpenApiSchemaObject {
6397
6450
  export type V3_1_X = OpenApiV3_1_XTypes['SchemaObject'];
6398
6451
  }
6399
6452
 
6400
- interface Operation extends Omit<Operation$1, 'tags'> {
6401
- service: string;
6402
- }
6453
+ type WalkEvents =
6454
+ | {
6455
+ method: keyof IR.PathItemObject;
6456
+ operation: IR.OperationObject;
6457
+ path: string;
6458
+ type: 'operation';
6459
+ }
6460
+ | {
6461
+ $ref: string;
6462
+ name: string;
6463
+ parameter: IR.ParameterObject;
6464
+ type: 'parameter';
6465
+ }
6466
+ | {
6467
+ $ref: string;
6468
+ name: string;
6469
+ requestBody: IR.RequestBodyObject;
6470
+ type: 'requestBody';
6471
+ }
6472
+ | {
6473
+ $ref: string;
6474
+ name: string;
6475
+ schema: IR.SchemaObject;
6476
+ type: 'schema';
6477
+ }
6478
+ | {
6479
+ server: IR.ServerObject;
6480
+ type: 'server';
6481
+ };
6403
6482
 
6404
- interface Service extends Pick<Model, '$refs' | 'imports' | 'name'> {
6405
- operations: Operation[];
6406
- }
6483
+ type WalkEventType = WalkEvents['type'];
6484
+ type WalkEvent<T extends WalkEventType = WalkEventType> = Extract<
6485
+ WalkEvents,
6486
+ { type: T }
6487
+ >;
6407
6488
 
6408
- interface Client$1 extends Omit<Client$2, 'operations'> {
6409
- services: Service[];
6489
+ declare class PluginInstance<PluginConfig extends BaseConfig = BaseConfig> {
6490
+ config: Plugin.Config<PluginConfig>['config'];
6491
+ context: IR.Context;
6492
+ dependencies: Required<Plugin.Config<PluginConfig>>['dependencies'];
6493
+ private handler;
6494
+ name: Plugin.Config<PluginConfig>['name'];
6495
+ output: Required<PluginConfig>['output'];
6496
+ constructor(props: Pick<Required<Plugin.Config<PluginConfig>>, 'config' | 'dependencies' | 'handler'> & Pick<Required<PluginConfig>, 'output'> & {
6497
+ context: IR.Context<OpenApi.V2_0_X | OpenApi.V3_0_X | OpenApi.V3_1_X>;
6498
+ name: string;
6499
+ });
6500
+ createFile(file: IR.ContextFile): TypeScriptFile;
6501
+ /**
6502
+ * Iterates over various input elements as specified by the event types, in
6503
+ * a specific order: servers, schemas, parameters, request bodies, then
6504
+ * operations.
6505
+ *
6506
+ * This ensures, for example, that schemas are always processed before
6507
+ * operations, which may reference them.
6508
+ *
6509
+ * @template T - The event type(s) to yield. Defaults to all event types.
6510
+ * @param events - The event types to walk over. If none are provided, all event types are included.
6511
+ * @param callback - Function to execute for each event.
6512
+ *
6513
+ * @example
6514
+ * // Iterate over all operations and schemas
6515
+ * plugin.forEach('operation', 'schema', (event) => {
6516
+ * if (event.type === 'operation') {
6517
+ * // handle operation
6518
+ * } else if (event.type === 'schema') {
6519
+ * // handle schema
6520
+ * }
6521
+ * });
6522
+ */
6523
+ forEach<T extends WalkEventType = WalkEventType>(...args: [
6524
+ ...events: ReadonlyArray<T>,
6525
+ callback: (event: WalkEvent<T>) => void
6526
+ ]): void;
6527
+ private forEachError;
6528
+ /**
6529
+ * Retrieves a registered plugin instance by its name from the context. This
6530
+ * allows plugins to access other plugins that have been registered in the
6531
+ * same context, enabling cross-plugin communication and dependencies.
6532
+ *
6533
+ * @param name Plugin name as defined in the configuration.
6534
+ * @returns The plugin instance if found, undefined otherwise.
6535
+ */
6536
+ getPlugin<T extends keyof Config['plugins']>(name: T): IR.Context['plugins'][T];
6537
+ /**
6538
+ * Executes plugin's handler function.
6539
+ */
6540
+ run(): Promise<void>;
6410
6541
  }
6411
6542
 
6412
- type ExtractWithDiscriminator<T, Discriminator> = T extends Discriminator
6413
- ? T
6414
- : never;
6415
-
6416
- /**
6417
- * Accepts an array of elements union and attempts to extract only objects.
6418
- * For example, Array<string | number | { id: string }> would result in
6419
- * Array<{ id: string }>.
6420
- */
6421
- type ExtractArrayOfObjects<T, Discriminator> =
6422
- T extends Array<infer U>
6423
- ? Array<ExtractWithDiscriminator<U, Discriminator>>
6424
- : T extends ReadonlyArray<infer U>
6425
- ? ReadonlyArray<ExtractWithDiscriminator<U, Discriminator>>
6426
- : never;
6427
-
6428
- type Files = Record<string, TypeScriptFile>;
6429
-
6430
- /**
6431
- * Transforms an array of objects into an optional object map.
6432
- * For example, Array<{ id: string }> would result in
6433
- * { [key: string]?: { id: string } }
6434
- */
6435
- type ArrayOfObjectsToObjectMap<
6436
- T extends ReadonlyArray<Record<string, any>>,
6437
- D extends keyof T[number],
6438
- > = {
6439
- [K in T[number][D]]?: Extract<T[number], Record<D, K>>;
6440
- };
6441
-
6442
- type OmitUnderscoreKeys<T> = {
6443
- [K in keyof T as K extends `_${string}` ? never : K]: T[K];
6444
- };
6445
-
6446
6543
  type PluginClientNames =
6447
6544
  | '@hey-api/client-axios'
6448
6545
  | '@hey-api/client-fetch'
@@ -6474,13 +6571,38 @@ type AnyPluginName = PluginNames | (string & {});
6474
6571
 
6475
6572
  type PluginTag = 'client' | 'transformer' | 'validator';
6476
6573
 
6574
+ type ObjectType<T> =
6575
+ Extract<T, Record<string, any>> extends never
6576
+ ? Record<string, any>
6577
+ : Extract<T, Record<string, any>>;
6578
+
6477
6579
  interface PluginContext {
6478
- ensureDependency: (name: PluginNames | true) => void;
6479
- pluginByTag: (props: {
6480
- defaultPlugin?: AnyPluginName;
6481
- errorMessage?: string;
6482
- tag: PluginTag;
6483
- }) => AnyPluginName | undefined;
6580
+ pluginByTag: <T extends AnyPluginName | boolean = AnyPluginName>(
6581
+ tag: PluginTag,
6582
+ props?: {
6583
+ defaultPlugin?: Exclude<T, boolean>;
6584
+ errorMessage?: string;
6585
+ },
6586
+ ) => Exclude<T, boolean> | undefined;
6587
+ valueToObject: <
6588
+ T extends undefined | string | boolean | number | Record<string, any>,
6589
+ >(args: {
6590
+ defaultValue: ObjectType<T>;
6591
+ mappers: {
6592
+ boolean: T extends boolean
6593
+ ? (value: boolean) => Partial<ObjectType<T>>
6594
+ : never;
6595
+ number: T extends number
6596
+ ? (value: number) => Partial<ObjectType<T>>
6597
+ : never;
6598
+ string: T extends string
6599
+ ? (value: string) => Partial<ObjectType<T>>
6600
+ : never;
6601
+ } extends infer U
6602
+ ? { [K in keyof U as U[K] extends never ? never : K]: U[K] }
6603
+ : never;
6604
+ value: T;
6605
+ }) => ObjectType<T>;
6484
6606
  }
6485
6607
 
6486
6608
  interface BaseConfig {
@@ -6493,42 +6615,63 @@ interface BaseConfig {
6493
6615
  output?: string;
6494
6616
  }
6495
6617
 
6496
- interface Meta<Config extends BaseConfig> {
6618
+ interface Meta<
6619
+ Config extends BaseConfig,
6620
+ ResolvedConfig extends BaseConfig = Config,
6621
+ > {
6497
6622
  /**
6498
6623
  * Dependency plugins will be always processed, regardless of whether user
6499
6624
  * explicitly defines them in their `plugins` config.
6500
6625
  */
6501
- _dependencies?: ReadonlyArray<AnyPluginName>;
6626
+ dependencies?: ReadonlyArray<AnyPluginName>;
6502
6627
  /**
6503
- * Allows overriding config before it's sent to the parser. An example is
6504
- * defining `validator` as `true` and the plugin figures out which plugin
6628
+ * Resolves static configuration values into their runtime equivalents. For
6629
+ * example, when `validator` is set to `true`, it figures out which plugin
6505
6630
  * should be used for validation.
6506
6631
  */
6507
- _infer?: (
6508
- config: Config & Omit<Meta<Config>, '_infer'>,
6632
+ resolveConfig?: (
6633
+ plugin: Omit<Plugin.Config<Config, ResolvedConfig>, 'dependencies'> & {
6634
+ dependencies: Set<AnyPluginName>;
6635
+ },
6509
6636
  context: PluginContext,
6510
6637
  ) => void;
6511
6638
  /**
6512
- * Optional tags can be used to help with deciding plugin order and inferring
6639
+ * Optional tags can be used to help with deciding plugin order and resolving
6513
6640
  * plugin configuration options.
6514
6641
  */
6515
- _tags?: ReadonlyArray<PluginTag>;
6642
+ tags?: ReadonlyArray<PluginTag>;
6516
6643
  }
6517
6644
 
6518
6645
  /**
6519
6646
  * Public Plugin API.
6520
6647
  */
6521
6648
  declare namespace Plugin {
6522
- export type Config<Config extends BaseConfig> = Config &
6523
- Meta<Config> & {
6524
- _handler: Plugin.Handler<Config>;
6525
- _handlerLegacy: Plugin.LegacyHandler<Config>;
6526
- exportFromIndex?: boolean;
6649
+ export type Config<
6650
+ Config extends BaseConfig,
6651
+ ResolvedConfig extends BaseConfig = Config,
6652
+ > = Pick<Config, 'name' | 'output'> &
6653
+ Meta<Config, ResolvedConfig> & {
6654
+ config: Omit<Config, 'name' | 'output'>;
6655
+ handler: Plugin.Handler<
6656
+ Omit<ResolvedConfig, 'name'> & {
6657
+ name: any;
6658
+ }
6659
+ >;
6660
+ handlerLegacy: Plugin.LegacyHandler<
6661
+ Omit<ResolvedConfig, 'name'> & {
6662
+ name: any;
6663
+ }
6664
+ >;
6527
6665
  };
6528
6666
 
6529
- export type DefineConfig<Config extends BaseConfig> = (
6530
- config?: Plugin.UserConfig<Omit<Config, 'name'>>,
6531
- ) => Omit<Plugin.Config<Config>, 'name'> & {
6667
+ /** @deprecated - use `definePluginConfig()` instead */
6668
+ export type DefineConfig<
6669
+ Config extends BaseConfig,
6670
+ ResolvedConfig extends BaseConfig = Config,
6671
+ > = (config?: Plugin.UserConfig<Omit<Config, 'name'>>) => Omit<
6672
+ Plugin.Config<Config, ResolvedConfig>,
6673
+ 'name'
6674
+ > & {
6532
6675
  /**
6533
6676
  * Cast name to `any` so it doesn't throw type error in `plugins` array.
6534
6677
  * We could allow any `string` as plugin `name` in the object syntax, but
@@ -6542,12 +6685,10 @@ declare namespace Plugin {
6542
6685
  * Plugin implementation for experimental parser.
6543
6686
  */
6544
6687
  export type Handler<Config extends BaseConfig, ReturnType = void> = (args: {
6545
- context: IR.Context<OpenApi.V2_0_X | OpenApi.V3_0_X | OpenApi.V3_1_X>;
6546
6688
  plugin: Plugin.Instance<Config>;
6547
6689
  }) => ReturnType;
6548
6690
 
6549
- export type Instance<Config extends BaseConfig> = OmitUnderscoreKeys<Config> &
6550
- Pick<Required<BaseConfig>, 'exportFromIndex' | 'output'>;
6691
+ export type Instance<Config extends BaseConfig> = PluginInstance<Config>;
6551
6692
 
6552
6693
  /**
6553
6694
  * Plugin implementation for legacy parser.
@@ -6598,10 +6739,7 @@ interface Config$j
6598
6739
  Client.Config {}
6599
6740
 
6600
6741
  type PluginHandler<ReturnType = void> = Plugin.Handler<
6601
- Omit<
6602
- Config$i | Config$l | Config$k | Config$j,
6603
- 'name'
6604
- >,
6742
+ Config$i | Config$l | Config$k | Config$j,
6605
6743
  ReturnType
6606
6744
  >;
6607
6745
 
@@ -7026,213 +7164,579 @@ interface Config$9 extends Plugin.Name<'@hey-api/typescript'> {
7026
7164
  }
7027
7165
 
7028
7166
  interface Config$8
7029
- extends Plugin.Name<'@tanstack/react-query'>,
7030
- TanStackQuery.Config {
7167
+ extends Plugin.Name<'@tanstack/angular-query-experimental'> {
7031
7168
  /**
7032
- * 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.
7169
+ * The casing convention to use for generated names.
7033
7170
  *
7034
- * @default true
7171
+ * @default 'camelCase'
7035
7172
  */
7036
- infiniteQueryOptions?: boolean;
7173
+ case?: StringCase;
7037
7174
  /**
7038
- * Generate {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation `useMutation()`} helpers? These will be generated from DELETE, PATCH, POST, and PUT requests.
7175
+ * Add comments from SDK functions to the generated TanStack Query code?
7039
7176
  *
7040
7177
  * @default true
7041
7178
  */
7042
- mutationOptions?: boolean;
7179
+ comments?: boolean;
7180
+ /**
7181
+ * Should the exports from the generated files be re-exported in the index barrel file?
7182
+ *
7183
+ * @default false
7184
+ */
7185
+ exportFromIndex?: boolean;
7186
+ /**
7187
+ * Configuration for generated infinite query key helpers.
7188
+ *
7189
+ * See {@link https://tanstack.com/query/v5/docs/framework/angular/reference/infiniteQueryOptions}
7190
+ */
7191
+ infiniteQueryKeys?:
7192
+ | boolean
7193
+ | string
7194
+ | {
7195
+ case?: StringCase;
7196
+ enabled?: boolean;
7197
+ name?: string | ((name: string) => string);
7198
+ };
7199
+ /**
7200
+ * Configuration for generated infinite query options helpers.
7201
+ *
7202
+ * See {@link https://tanstack.com/query/v5/docs/framework/angular/reference/infiniteQueryOptions}
7203
+ */
7204
+ infiniteQueryOptions?:
7205
+ | boolean
7206
+ | string
7207
+ | {
7208
+ case?: StringCase;
7209
+ enabled?: boolean;
7210
+ name?: string | ((name: string) => string);
7211
+ };
7212
+ /**
7213
+ * Configuration for generated mutation options helpers.
7214
+ *
7215
+ * See {@link https://tanstack.com/query/v5/docs/framework/angular/reference/useMutation}
7216
+ */
7217
+ mutationOptions?:
7218
+ | boolean
7219
+ | string
7220
+ | {
7221
+ case?: StringCase;
7222
+ enabled?: boolean;
7223
+ name?: string | ((name: string) => string);
7224
+ };
7043
7225
  /**
7044
7226
  * Name of the generated file.
7045
7227
  *
7046
- * @default '@tanstack/react-query'
7228
+ * @default '@tanstack/angular-query-experimental'
7047
7229
  */
7048
7230
  output?: string;
7049
7231
  /**
7050
- * Generate {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions `queryOptions()`} helpers?
7051
- * These will be generated from all requests.
7232
+ * Configuration for generated query keys.
7052
7233
  *
7053
- * @default true
7234
+ * See {@link https://tanstack.com/query/v5/docs/framework/angular/reference/queryKey}
7235
+ */
7236
+ queryKeys?:
7237
+ | boolean
7238
+ | string
7239
+ | {
7240
+ case?: StringCase;
7241
+ enabled?: boolean;
7242
+ name?: string | ((name: string) => string);
7243
+ };
7244
+ /**
7245
+ * Configuration for generated query options helpers.
7246
+ *
7247
+ * See {@link https://tanstack.com/query/v5/docs/framework/angular/reference/queryOptions}
7054
7248
  */
7055
- queryOptions?: boolean;
7249
+ queryOptions?:
7250
+ | boolean
7251
+ | string
7252
+ | {
7253
+ case?: StringCase;
7254
+ enabled?: boolean;
7255
+ name?: string | ((name: string) => string);
7256
+ };
7056
7257
  }
7057
7258
 
7058
- interface Config$7
7059
- extends Plugin.Name<'@tanstack/solid-query'>,
7060
- TanStackQuery.Config {
7259
+ interface Config$7 extends Plugin.Name<'@tanstack/react-query'> {
7061
7260
  /**
7062
- * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
7261
+ * The casing convention to use for generated names.
7063
7262
  *
7064
- * @default true
7263
+ * @default 'camelCase'
7065
7264
  */
7066
- infiniteQueryOptions?: boolean;
7265
+ case?: StringCase;
7067
7266
  /**
7068
- * Generate `createMutation()` helpers? These will be generated from DELETE, PATCH, POST, and PUT requests.
7267
+ * Add comments from SDK functions to the generated TanStack Query code?
7268
+ * Duplicating comments this way is useful so you don't need to drill into
7269
+ * the underlying SDK function to learn what it does or whether it's
7270
+ * deprecated. You can set this option to `false` if you prefer less
7271
+ * comment duplication.
7069
7272
  *
7070
7273
  * @default true
7071
7274
  */
7072
- mutationOptions?: boolean;
7275
+ comments?: boolean;
7276
+ /**
7277
+ * Should the exports from the generated files be re-exported in the index
7278
+ * barrel file?
7279
+ *
7280
+ * @default false
7281
+ */
7282
+ exportFromIndex?: boolean;
7283
+ /**
7284
+ * Configuration for generated infinite query key helpers.
7285
+ *
7286
+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions TanStack Query: infiniteQueryOptions}
7287
+ *
7288
+ * Can be:
7289
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7290
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7291
+ * - `object`: Full configuration object
7292
+ */
7293
+ infiniteQueryKeys?:
7294
+ | boolean
7295
+ | string
7296
+ | {
7297
+ /**
7298
+ * The casing convention to use for generated names.
7299
+ *
7300
+ * @default 'camelCase'
7301
+ */
7302
+ case?: StringCase;
7303
+ /**
7304
+ * Whether to generate infinite query key helpers.
7305
+ *
7306
+ * @default true
7307
+ */
7308
+ enabled?: boolean;
7309
+ /**
7310
+ * Custom naming pattern for generated infinite query key names. The name variable is
7311
+ * obtained from the SDK function name.
7312
+ *
7313
+ * @default '{{name}}InfiniteQueryKey'
7314
+ * @see https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions
7315
+ */
7316
+ name?: string | ((name: string) => string);
7317
+ };
7318
+ /**
7319
+ * Configuration for generated infinite query options helpers.
7320
+ *
7321
+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions TanStack Query: infiniteQueryOptions}
7322
+ *
7323
+ * Can be:
7324
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7325
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7326
+ * - `object`: Full configuration object
7327
+ */
7328
+ infiniteQueryOptions?:
7329
+ | boolean
7330
+ | string
7331
+ | {
7332
+ /**
7333
+ * The casing convention to use for generated names.
7334
+ *
7335
+ * @default 'camelCase'
7336
+ */
7337
+ case?: StringCase;
7338
+ /**
7339
+ * Whether to generate infinite query options helpers.
7340
+ *
7341
+ * @default true
7342
+ */
7343
+ enabled?: boolean;
7344
+ /**
7345
+ * Custom naming pattern for generated infinite query options names. The name variable is
7346
+ * obtained from the SDK function name.
7347
+ *
7348
+ * @default '{{name}}InfiniteOptions'
7349
+ * @see https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions
7350
+ */
7351
+ name?: string | ((name: string) => string);
7352
+ };
7353
+ /**
7354
+ * Configuration for generated mutation options helpers.
7355
+ *
7356
+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation TanStack Query: useMutation}
7357
+ *
7358
+ * Can be:
7359
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7360
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7361
+ * - `object`: Full configuration object
7362
+ */
7363
+ mutationOptions?:
7364
+ | boolean
7365
+ | string
7366
+ | {
7367
+ /**
7368
+ * The casing convention to use for generated names.
7369
+ *
7370
+ * @default 'camelCase'
7371
+ */
7372
+ case?: StringCase;
7373
+ /**
7374
+ * Whether to generate mutation options helpers.
7375
+ *
7376
+ * @default true
7377
+ */
7378
+ enabled?: boolean;
7379
+ /**
7380
+ * Custom naming pattern for generated mutation options names. The name variable is
7381
+ * obtained from the SDK function name.
7382
+ *
7383
+ * @default '{{name}}Mutation'
7384
+ * @see https://tanstack.com/query/v5/docs/framework/react/reference/useMutation
7385
+ */
7386
+ name?: string | ((name: string) => string);
7387
+ };
7073
7388
  /**
7074
7389
  * Name of the generated file.
7075
7390
  *
7076
- * @default '@tanstack/solid-query'
7391
+ * @default '@tanstack/react-query'
7077
7392
  */
7078
7393
  output?: string;
7079
7394
  /**
7080
- * Generate {@link https://tanstack.com/query/v5/docs/framework/solid/reference/createQuery `createQuery()`} helpers?
7081
- * These will be generated from all requests.
7395
+ * Configuration for generated query keys.
7082
7396
  *
7083
- * @default true
7397
+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryKey TanStack Query: queryKey}
7398
+ *
7399
+ * Can be:
7400
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7401
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7402
+ * - `object`: Full configuration object
7084
7403
  */
7085
- queryOptions?: boolean;
7404
+ queryKeys?:
7405
+ | boolean
7406
+ | string
7407
+ | {
7408
+ /**
7409
+ * The casing convention to use for generated names.
7410
+ *
7411
+ * @default 'camelCase'
7412
+ */
7413
+ case?: StringCase;
7414
+ /**
7415
+ * Whether to generate query keys.
7416
+ *
7417
+ * @default true
7418
+ */
7419
+ enabled?: boolean;
7420
+ /**
7421
+ * Custom naming pattern for generated query key names. The name variable is
7422
+ * obtained from the SDK function name.
7423
+ *
7424
+ * @default '{{name}}QueryKey'
7425
+ * @see https://tanstack.com/query/v5/docs/framework/react/reference/queryKey
7426
+ */
7427
+ name?: string | ((name: string) => string);
7428
+ };
7429
+ /**
7430
+ * Configuration for generated query options helpers.
7431
+ *
7432
+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions TanStack Query: queryOptions}
7433
+ *
7434
+ * Can be:
7435
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7436
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7437
+ * - `object`: Full configuration object
7438
+ */
7439
+ queryOptions?:
7440
+ | boolean
7441
+ | string
7442
+ | {
7443
+ /**
7444
+ * The casing convention to use for generated names.
7445
+ *
7446
+ * @default 'camelCase'
7447
+ */
7448
+ case?: StringCase;
7449
+ /**
7450
+ * Whether to generate query options helpers.
7451
+ *
7452
+ * @default true
7453
+ */
7454
+ enabled?: boolean;
7455
+ /**
7456
+ * Custom naming pattern for generated query options names. The name variable is
7457
+ * obtained from the SDK function name.
7458
+ *
7459
+ * @default '{{name}}Options'
7460
+ * @see https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions
7461
+ */
7462
+ name?: string | ((name: string) => string);
7463
+ };
7086
7464
  }
7087
7465
 
7088
- interface Config$6
7089
- extends Plugin.Name<'@tanstack/svelte-query'>,
7090
- TanStackQuery.Config {
7466
+ interface Config$6 extends Plugin.Name<'@tanstack/solid-query'> {
7091
7467
  /**
7092
- * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
7468
+ * The casing convention to use for generated names.
7093
7469
  *
7094
- * @default true
7470
+ * @default 'camelCase'
7095
7471
  */
7096
- infiniteQueryOptions?: boolean;
7472
+ case?: StringCase;
7097
7473
  /**
7098
- * Generate {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/functions/createmutation `createMutation()`} helpers? These will be generated from DELETE, PATCH, POST, and PUT requests.
7474
+ * Add comments from SDK functions to the generated TanStack Query code?
7099
7475
  *
7100
7476
  * @default true
7101
7477
  */
7102
- mutationOptions?: boolean;
7478
+ comments?: boolean;
7479
+ /**
7480
+ * Should the exports from the generated files be re-exported in the index barrel file?
7481
+ *
7482
+ * @default false
7483
+ */
7484
+ exportFromIndex?: boolean;
7485
+ /**
7486
+ * Configuration for generated infinite query key helpers.
7487
+ *
7488
+ * See {@link https://tanstack.com/query/v5/docs/framework/solid/reference/createInfiniteQuery}
7489
+ */
7490
+ infiniteQueryKeys?:
7491
+ | boolean
7492
+ | string
7493
+ | {
7494
+ case?: StringCase;
7495
+ enabled?: boolean;
7496
+ name?: string | ((name: string) => string);
7497
+ };
7498
+ /**
7499
+ * Configuration for generated infinite query options helpers.
7500
+ *
7501
+ * See {@link https://tanstack.com/query/v5/docs/framework/solid/reference/createInfiniteQuery}
7502
+ */
7503
+ infiniteQueryOptions?:
7504
+ | boolean
7505
+ | string
7506
+ | {
7507
+ case?: StringCase;
7508
+ enabled?: boolean;
7509
+ name?: string | ((name: string) => string);
7510
+ };
7511
+ /**
7512
+ * Configuration for generated mutation options helpers.
7513
+ *
7514
+ * See {@link https://tanstack.com/query/v5/docs/framework/solid/reference/createMutation}
7515
+ */
7516
+ mutationOptions?:
7517
+ | boolean
7518
+ | string
7519
+ | {
7520
+ case?: StringCase;
7521
+ enabled?: boolean;
7522
+ name?: string | ((name: string) => string);
7523
+ };
7103
7524
  /**
7104
7525
  * Name of the generated file.
7105
7526
  *
7106
- * @default '@tanstack/svelte-query'
7527
+ * @default '@tanstack/solid-query'
7107
7528
  */
7108
7529
  output?: string;
7109
7530
  /**
7110
- * Generate {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/functions/createquery `createQuery()`} helpers?
7111
- * These will be generated from all requests.
7531
+ * Configuration for generated query keys.
7112
7532
  *
7113
- * @default true
7533
+ * See {@link https://tanstack.com/query/v5/docs/framework/solid/reference/queryKey}
7534
+ */
7535
+ queryKeys?:
7536
+ | boolean
7537
+ | string
7538
+ | {
7539
+ case?: StringCase;
7540
+ enabled?: boolean;
7541
+ name?: string | ((name: string) => string);
7542
+ };
7543
+ /**
7544
+ * Configuration for generated query options helpers.
7545
+ *
7546
+ * See {@link https://tanstack.com/query/v5/docs/framework/solid/reference/createQuery}
7114
7547
  */
7115
- queryOptions?: boolean;
7548
+ queryOptions?:
7549
+ | boolean
7550
+ | string
7551
+ | {
7552
+ case?: StringCase;
7553
+ enabled?: boolean;
7554
+ name?: string | ((name: string) => string);
7555
+ };
7116
7556
  }
7117
7557
 
7118
- interface Config$5
7119
- extends Plugin.Name<'@tanstack/vue-query'>,
7120
- TanStackQuery.Config {
7558
+ interface Config$5 extends Plugin.Name<'@tanstack/svelte-query'> {
7121
7559
  /**
7122
- * 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.
7560
+ * The casing convention to use for generated names.
7123
7561
  *
7124
- * @default true
7562
+ * @default 'camelCase'
7125
7563
  */
7126
- infiniteQueryOptions?: boolean;
7564
+ case?: StringCase;
7127
7565
  /**
7128
- * Generate {@link https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation `useMutation()`} helpers? These will be generated from DELETE, PATCH, POST, and PUT requests.
7566
+ * Add comments from SDK functions to the generated TanStack Query code?
7129
7567
  *
7130
7568
  * @default true
7131
7569
  */
7132
- mutationOptions?: boolean;
7570
+ comments?: boolean;
7571
+ /**
7572
+ * Should the exports from the generated files be re-exported in the index barrel file?
7573
+ *
7574
+ * @default false
7575
+ */
7576
+ exportFromIndex?: boolean;
7577
+ /**
7578
+ * Configuration for generated infinite query key helpers.
7579
+ *
7580
+ * See {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/createInfiniteQuery}
7581
+ */
7582
+ infiniteQueryKeys?:
7583
+ | boolean
7584
+ | string
7585
+ | {
7586
+ case?: StringCase;
7587
+ enabled?: boolean;
7588
+ name?: string | ((name: string) => string);
7589
+ };
7590
+ /**
7591
+ * Configuration for generated infinite query options helpers.
7592
+ *
7593
+ * See {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/createInfiniteQuery}
7594
+ */
7595
+ infiniteQueryOptions?:
7596
+ | boolean
7597
+ | string
7598
+ | {
7599
+ case?: StringCase;
7600
+ enabled?: boolean;
7601
+ name?: string | ((name: string) => string);
7602
+ };
7603
+ /**
7604
+ * Configuration for generated mutation options helpers.
7605
+ *
7606
+ * See {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/createMutation}
7607
+ */
7608
+ mutationOptions?:
7609
+ | boolean
7610
+ | string
7611
+ | {
7612
+ case?: StringCase;
7613
+ enabled?: boolean;
7614
+ name?: string | ((name: string) => string);
7615
+ };
7133
7616
  /**
7134
7617
  * Name of the generated file.
7135
7618
  *
7136
- * @default '@tanstack/vue-query'
7619
+ * @default '@tanstack/svelte-query'
7137
7620
  */
7138
7621
  output?: string;
7139
7622
  /**
7140
- * Generate {@link https://tanstack.com/query/v5/docs/framework/vue/guides/query-options `queryOptions()`} helpers?
7141
- * These will be generated from all requests.
7623
+ * Configuration for generated query keys.
7142
7624
  *
7143
- * @default true
7625
+ * See {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/queryKey}
7144
7626
  */
7145
- queryOptions?: boolean;
7146
- }
7147
-
7148
- /**
7149
- * Public TanStack Query API.
7150
- */
7151
- declare namespace TanStackQuery {
7152
- export type Config = {
7153
- /**
7154
- * Add comments from SDK functions to the generated TanStack Query code?
7155
- * Duplicating comments this way is useful so you don't need to drill into
7156
- * the underlying SDK function to learn what it does or whether it's
7157
- * deprecated. You can set this option to `false` if you prefer less
7158
- * comment duplication.
7159
- *
7160
- * @default true
7161
- */
7162
- comments?: boolean;
7163
- /**
7164
- * Should the exports from the generated files be re-exported in the index
7165
- * barrel file?
7166
- *
7167
- * @default false
7168
- */
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);
7205
- };
7627
+ queryKeys?:
7628
+ | boolean
7629
+ | string
7630
+ | {
7631
+ case?: StringCase;
7632
+ enabled?: boolean;
7633
+ name?: string | ((name: string) => string);
7634
+ };
7635
+ /**
7636
+ * Configuration for generated query options helpers.
7637
+ *
7638
+ * See {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/createQuery}
7639
+ */
7640
+ queryOptions?:
7641
+ | boolean
7642
+ | string
7643
+ | {
7644
+ case?: StringCase;
7645
+ enabled?: boolean;
7646
+ name?: string | ((name: string) => string);
7647
+ };
7206
7648
  }
7207
7649
 
7208
- interface Config$4
7209
- extends Plugin.Name<'@tanstack/angular-query-experimental'>,
7210
- TanStackQuery.Config {
7650
+ interface Config$4 extends Plugin.Name<'@tanstack/vue-query'> {
7211
7651
  /**
7212
- * 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.
7652
+ * The casing convention to use for generated names.
7213
7653
  *
7214
- * @default true
7654
+ * @default 'camelCase'
7215
7655
  */
7216
- infiniteQueryOptions?: boolean;
7656
+ case?: StringCase;
7217
7657
  /**
7218
- * Generate {@link https://tanstack.com/query/v5/docs/framework/angular/reference/useMutation `useMutation()`} helpers? These will be generated from DELETE, PATCH, POST, and PUT requests.
7658
+ * Add comments from SDK functions to the generated TanStack Query code?
7219
7659
  *
7220
7660
  * @default true
7221
7661
  */
7222
- mutationOptions?: boolean;
7662
+ comments?: boolean;
7663
+ /**
7664
+ * Should the exports from the generated files be re-exported in the index barrel file?
7665
+ *
7666
+ * @default false
7667
+ */
7668
+ exportFromIndex?: boolean;
7669
+ /**
7670
+ * Configuration for generated infinite query key helpers.
7671
+ *
7672
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions}
7673
+ */
7674
+ infiniteQueryKeys?:
7675
+ | boolean
7676
+ | string
7677
+ | {
7678
+ case?: StringCase;
7679
+ enabled?: boolean;
7680
+ name?: string | ((name: string) => string);
7681
+ };
7682
+ /**
7683
+ * Configuration for generated infinite query options helpers.
7684
+ *
7685
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions}
7686
+ */
7687
+ infiniteQueryOptions?:
7688
+ | boolean
7689
+ | string
7690
+ | {
7691
+ case?: StringCase;
7692
+ enabled?: boolean;
7693
+ name?: string | ((name: string) => string);
7694
+ };
7695
+ /**
7696
+ * Configuration for generated mutation options helpers.
7697
+ *
7698
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation}
7699
+ */
7700
+ mutationOptions?:
7701
+ | boolean
7702
+ | string
7703
+ | {
7704
+ case?: StringCase;
7705
+ enabled?: boolean;
7706
+ name?: string | ((name: string) => string);
7707
+ };
7223
7708
  /**
7224
7709
  * Name of the generated file.
7225
7710
  *
7226
- * @default '@tanstack/angular-query-experimental'
7711
+ * @default '@tanstack/vue-query'
7227
7712
  */
7228
7713
  output?: string;
7229
7714
  /**
7230
- * Generate {@link https://tanstack.com/query/v5/docs/framework/angular/reference/queryOptions `queryOptions()`} helpers?
7231
- * These will be generated from all requests.
7715
+ * Configuration for generated query keys.
7232
7716
  *
7233
- * @default true
7717
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/queryKey}
7718
+ */
7719
+ queryKeys?:
7720
+ | boolean
7721
+ | string
7722
+ | {
7723
+ case?: StringCase;
7724
+ enabled?: boolean;
7725
+ name?: string | ((name: string) => string);
7726
+ };
7727
+ /**
7728
+ * Configuration for generated query options helpers.
7729
+ *
7730
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/queryOptions}
7234
7731
  */
7235
- queryOptions?: boolean;
7732
+ queryOptions?:
7733
+ | boolean
7734
+ | string
7735
+ | {
7736
+ case?: StringCase;
7737
+ enabled?: boolean;
7738
+ name?: string | ((name: string) => string);
7739
+ };
7236
7740
  }
7237
7741
 
7238
7742
  interface Config$3 extends Plugin.Name<'fastify'> {
@@ -7281,16 +7785,52 @@ interface Config$2 extends Plugin.Name<'valibot'> {
7281
7785
  output?: string;
7282
7786
  }
7283
7787
 
7284
- // import type { IR } from '../../ir/types';
7285
-
7286
-
7287
7788
  interface Config$1 extends Plugin.Name<'zod'> {
7789
+ /**
7790
+ * The casing convention to use for generated names.
7791
+ *
7792
+ * @default 'camelCase'
7793
+ */
7794
+ case?: StringCase;
7288
7795
  /**
7289
7796
  * Add comments from input to the generated Zod schemas?
7290
7797
  *
7291
7798
  * @default true
7292
7799
  */
7293
7800
  comments?: boolean;
7801
+ /**
7802
+ * Configuration for reusable schema definitions. Controls generation of
7803
+ * shared Zod schemas that can be referenced across requests and responses.
7804
+ *
7805
+ * Can be:
7806
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7807
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7808
+ * - `object`: Full configuration object
7809
+ */
7810
+ definitions?:
7811
+ | boolean
7812
+ | string
7813
+ | {
7814
+ /**
7815
+ * The casing convention to use for generated names.
7816
+ *
7817
+ * @default 'camelCase'
7818
+ */
7819
+ case?: StringCase;
7820
+ /**
7821
+ * Whether to generate Zod schemas for reusable definitions.
7822
+ *
7823
+ * @default true
7824
+ */
7825
+ enabled?: boolean;
7826
+ /**
7827
+ * Custom naming pattern for generated schema names. The name variable is
7828
+ * obtained from the schema name.
7829
+ *
7830
+ * @default 'z{{name}}'
7831
+ */
7832
+ name?: string | ((name: string) => string);
7833
+ };
7294
7834
  /**
7295
7835
  * Should the exports from the generated files be re-exported in the index
7296
7836
  * barrel file?
@@ -7306,27 +7846,88 @@ interface Config$1 extends Plugin.Name<'zod'> {
7306
7846
  * @default false
7307
7847
  */
7308
7848
  metadata?: boolean;
7309
- /**
7310
- * Customise the Zod schema name. By default, `z{{name}}` is used,
7311
- * where `name` is a definition name or an operation name.
7312
- */
7313
- // nameBuilder?: (model: IR.OperationObject | IR.SchemaObject) => string;
7314
7849
  /**
7315
7850
  * Name of the generated file.
7316
7851
  *
7317
7852
  * @default 'zod'
7318
7853
  */
7319
7854
  output?: string;
7855
+ /**
7856
+ * Configuration for request-specific Zod schemas.
7857
+ * Controls generation of Zod schemas for request bodies, query parameters, path parameters, and headers.
7858
+ *
7859
+ * Can be:
7860
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7861
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7862
+ * - `object`: Full configuration object
7863
+ */
7864
+ requests?:
7865
+ | boolean
7866
+ | string
7867
+ | {
7868
+ /**
7869
+ * The casing convention to use for generated names.
7870
+ *
7871
+ * @default 'camelCase'
7872
+ */
7873
+ case?: StringCase;
7874
+ /**
7875
+ * Whether to generate Zod schemas for request definitions.
7876
+ *
7877
+ * @default true
7878
+ */
7879
+ enabled?: boolean;
7880
+ /**
7881
+ * Custom naming pattern for generated schema names. The name variable is
7882
+ * obtained from the operation name.
7883
+ *
7884
+ * @default 'z{{name}}Data'
7885
+ */
7886
+ name?: string | ((name: string) => string);
7887
+ };
7888
+ /**
7889
+ * Configuration for response-specific Zod schemas.
7890
+ * Controls generation of Zod schemas for response bodies, error responses, and status codes.
7891
+ *
7892
+ * Can be:
7893
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7894
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7895
+ * - `object`: Full configuration object
7896
+ */
7897
+ responses?:
7898
+ | boolean
7899
+ | string
7900
+ | {
7901
+ /**
7902
+ * The casing convention to use for generated names.
7903
+ *
7904
+ * @default 'camelCase'
7905
+ */
7906
+ case?: StringCase;
7907
+ /**
7908
+ * Whether to generate Zod schemas for response definitions.
7909
+ *
7910
+ * @default true
7911
+ */
7912
+ enabled?: boolean;
7913
+ /**
7914
+ * Custom naming pattern for generated schema names. The name variable is
7915
+ * obtained from the operation name.
7916
+ *
7917
+ * @default 'z{{name}}Response'
7918
+ */
7919
+ name?: string | ((name: string) => string);
7920
+ };
7320
7921
  }
7321
7922
 
7322
7923
  /**
7323
7924
  * User-facing plugin types.
7324
7925
  */
7325
- type UserPlugins = Plugin.UserConfig<Config$i> | Plugin.UserConfig<Config$l> | Plugin.UserConfig<Config$k> | Plugin.UserConfig<Config$j> | Plugin.UserConfig<Config$h> | Plugin.UserConfig<Config$g> | Plugin.UserConfig<Config$f> | Plugin.UserConfig<Config$e> | Plugin.UserConfig<Config$d> | Plugin.UserConfig<Config$c> | Plugin.UserConfig<Config$b> | Plugin.UserConfig<Config$a> | Plugin.UserConfig<Config$9> | Plugin.UserConfig<Config$4> | Plugin.UserConfig<Config$8> | Plugin.UserConfig<Config$7> | Plugin.UserConfig<Config$6> | Plugin.UserConfig<Config$5> | Plugin.UserConfig<Config$3> | Plugin.UserConfig<Config$2> | Plugin.UserConfig<Config$1>;
7926
+ type UserPlugins = Plugin.UserConfig<Config$i> | Plugin.UserConfig<Config$l> | Plugin.UserConfig<Config$k> | Plugin.UserConfig<Config$j> | Plugin.UserConfig<Config$h> | Plugin.UserConfig<Config$g> | Plugin.UserConfig<Config$f> | Plugin.UserConfig<Config$e> | Plugin.UserConfig<Config$d> | Plugin.UserConfig<Config$c> | Plugin.UserConfig<Config$b> | Plugin.UserConfig<Config$a> | Plugin.UserConfig<Config$9> | Plugin.UserConfig<Config$8> | Plugin.UserConfig<Config$7> | Plugin.UserConfig<Config$6> | Plugin.UserConfig<Config$5> | Plugin.UserConfig<Config$4> | Plugin.UserConfig<Config$3> | Plugin.UserConfig<Config$2> | Plugin.UserConfig<Config$1>;
7326
7927
  /**
7327
7928
  * Internal plugin types.
7328
7929
  */
7329
- type ClientPlugins = Plugin.Config<Config$i> | Plugin.Config<Config$l> | Plugin.Config<Config$k> | Plugin.Config<Config$j> | Plugin.Config<Config$h> | Plugin.Config<Config$g> | Plugin.Config<Config$f> | Plugin.Config<Config$e> | Plugin.Config<Config$d> | Plugin.Config<Config$c> | Plugin.Config<Config$b> | Plugin.Config<Config$a> | Plugin.Config<Config$9> | Plugin.Config<Config$4> | Plugin.Config<Config$8> | Plugin.Config<Config$7> | Plugin.Config<Config$6> | Plugin.Config<Config$5> | Plugin.Config<Config$3> | Plugin.Config<Config$2> | Plugin.Config<Config$1>;
7930
+ type ClientPlugins = Plugin.Config<Config$i> | Plugin.Config<Config$l> | Plugin.Config<Config$k> | Plugin.Config<Config$j> | Plugin.Config<Config$h> | Plugin.Config<Config$g> | Plugin.Config<Config$f> | Plugin.Config<Config$e> | Plugin.Config<Config$d> | Plugin.Config<Config$c> | Plugin.Config<Config$b> | Plugin.Config<Config$a> | Plugin.Config<Config$9> | Plugin.Config<Config$8> | Plugin.Config<Config$7> | Plugin.Config<Config$6> | Plugin.Config<Config$5> | Plugin.Config<Config$4> | Plugin.Config<Config$3> | Plugin.Config<Config$2> | Plugin.Config<Config$1>;
7330
7931
 
7331
7932
  interface Input {
7332
7933
  /**
@@ -7569,12 +8170,43 @@ interface Filters {
7569
8170
  }
7570
8171
 
7571
8172
  interface Patch {
8173
+ /**
8174
+ * Patch the OpenAPI meta object in place. Useful for modifying general metadata such as title, description, version, or custom fields before further processing.
8175
+ *
8176
+ * @param meta The OpenAPI meta object for the current version.
8177
+ */
8178
+ meta?: (
8179
+ meta:
8180
+ | OpenApiMetaObject.V2_0_X
8181
+ | OpenApiMetaObject.V3_0_X
8182
+ | OpenApiMetaObject.V3_1_X,
8183
+ ) => void;
8184
+ /**
8185
+ * Patch OpenAPI parameters in place. The key is the parameter name, and the function receives the parameter object to modify directly.
8186
+ *
8187
+ * @example
8188
+ * parameters: {
8189
+ * limit: (parameter) => {
8190
+ * parameter.schema.type = 'integer';
8191
+ * }
8192
+ * }
8193
+ */
7572
8194
  parameters?: Record<
7573
8195
  string,
7574
8196
  (
7575
8197
  parameter: OpenApiParameterObject.V3_0_X | OpenApiParameterObject.V3_1_X,
7576
8198
  ) => void
7577
8199
  >;
8200
+ /**
8201
+ * Patch OpenAPI request bodies in place. The key is the request body name, and the function receives the request body object to modify directly.
8202
+ *
8203
+ * @example
8204
+ * requestBodies: {
8205
+ * CreateUserRequest: (requestBody) => {
8206
+ * requestBody.required = true;
8207
+ * }
8208
+ * }
8209
+ */
7578
8210
  requestBodies?: Record<
7579
8211
  string,
7580
8212
  (
@@ -7583,6 +8215,16 @@ interface Patch {
7583
8215
  | OpenApiRequestBodyObject.V3_1_X,
7584
8216
  ) => void
7585
8217
  >;
8218
+ /**
8219
+ * Patch OpenAPI responses in place. The key is the response name, and the function receives the response object to modify directly.
8220
+ *
8221
+ * @example
8222
+ * responses: {
8223
+ * NotFound: (response) => {
8224
+ * response.description = 'Resource not found.';
8225
+ * }
8226
+ * }
8227
+ */
7586
8228
  responses?: Record<
7587
8229
  string,
7588
8230
  (
@@ -7626,6 +8268,17 @@ interface Patch {
7626
8268
  | OpenApiSchemaObject.V3_1_X,
7627
8269
  ) => void
7628
8270
  >;
8271
+ /**
8272
+ * Patch the OpenAPI version string. The function receives the current version and should return the new version string.
8273
+ * Useful for normalizing or overriding the version value before further processing.
8274
+ *
8275
+ * @param version The current OpenAPI version string.
8276
+ * @returns The new version string to use.
8277
+ *
8278
+ * @example
8279
+ * version: (version) => version.replace(/^v/, '')
8280
+ */
8281
+ version?: (version: string) => string;
7629
8282
  }
7630
8283
 
7631
8284
  interface Watch {
@@ -7966,6 +8619,7 @@ declare class TypeScriptFile {
7966
8619
  get exportFromIndex(): boolean;
7967
8620
  get id(): string;
7968
8621
  identifier(args: Pick<EnsureUniqueIdentifierData, '$ref' | 'count' | 'create' | 'nameTransformer'> & {
8622
+ case?: StringCase;
7969
8623
  namespace: Namespace;
7970
8624
  }): Identifier;
7971
8625
  /**
@@ -8000,10 +8654,18 @@ interface EnsureUniqueIdentifierData {
8000
8654
  /**
8001
8655
  * Transforms name obtained from `$ref` before it's passed to `stringCase()`.
8002
8656
  */
8003
- nameTransformer?: (name: string) => string;
8657
+ nameTransformer?: ((name: string) => string) | string;
8004
8658
  namespace: Namespace;
8005
8659
  }
8006
8660
 
8661
+ type ExtractConfig<T> = T extends {
8662
+ config: infer C;
8663
+ } ? C & {
8664
+ name: string;
8665
+ } : never;
8666
+ type PluginInstanceMap = {
8667
+ [K in keyof Config['plugins']]?: PluginInstance<ExtractConfig<Config['plugins'][K]>>;
8668
+ };
8007
8669
  interface ContextFile {
8008
8670
  /**
8009
8671
  * Should the exports from this file be re-exported in the index barrel file?
@@ -8019,44 +8681,12 @@ interface ContextFile {
8019
8681
  identifierCase?: StringCase;
8020
8682
  /**
8021
8683
  * Relative file path to the output path.
8684
+ *
8022
8685
  * @example
8023
8686
  * 'bar/foo.ts'
8024
8687
  */
8025
8688
  path: string;
8026
8689
  }
8027
- interface Events {
8028
- /**
8029
- * Called after parsing.
8030
- */
8031
- after: () => void;
8032
- /**
8033
- * Called before parsing.
8034
- */
8035
- before: () => void;
8036
- operation: (args: {
8037
- method: keyof IR.PathItemObject;
8038
- operation: IR.OperationObject;
8039
- path: string;
8040
- }) => void;
8041
- parameter: (args: {
8042
- $ref: string;
8043
- name: string;
8044
- parameter: IR.ParameterObject;
8045
- }) => void;
8046
- requestBody: (args: {
8047
- $ref: string;
8048
- name: string;
8049
- requestBody: IR.RequestBodyObject;
8050
- }) => void;
8051
- schema: (args: {
8052
- $ref: string;
8053
- name: string;
8054
- schema: IR.SchemaObject;
8055
- }) => void;
8056
- server: (args: {
8057
- server: IR.ServerObject;
8058
- }) => void;
8059
- }
8060
8690
  declare class IRContext<Spec extends Record<string, any> = any> {
8061
8691
  /**
8062
8692
  * Configuration for parsing and generating the output. This
@@ -8072,21 +8702,19 @@ declare class IRContext<Spec extends Record<string, any> = any> {
8072
8702
  */
8073
8703
  ir: IR.Model;
8074
8704
  /**
8075
- * Resolved specification from `input`.
8705
+ * A map of registered plugin instances, keyed by plugin name. Plugins are
8706
+ * registered through the `registerPlugin` method and can be accessed by
8707
+ * their configured name from the config.
8076
8708
  */
8077
- spec: Spec;
8709
+ plugins: PluginInstanceMap;
8078
8710
  /**
8079
- * A map of event listeners.
8711
+ * Resolved specification from `input`.
8080
8712
  */
8081
- private listeners;
8713
+ spec: Spec;
8082
8714
  constructor({ config, spec }: {
8083
8715
  config: Config;
8084
8716
  spec: Spec;
8085
8717
  });
8086
- /**
8087
- * Notify all event listeners about `event`.
8088
- */
8089
- broadcast<T extends keyof Events>(event: T, ...args: Parameters<Events[T]>): Promise<void>;
8090
8718
  /**
8091
8719
  * Create and return a new TypeScript file. Also set the current file context
8092
8720
  * to the newly created file.
@@ -8102,15 +8730,26 @@ declare class IRContext<Spec extends Record<string, any> = any> {
8102
8730
  * Returns a specific file by ID from `files`.
8103
8731
  */
8104
8732
  file({ id }: Pick<ContextFile, 'id'>): TypeScriptFile | undefined;
8733
+ /**
8734
+ * Registers a new plugin to the global context.
8735
+ *
8736
+ * @param name Plugin name.
8737
+ * @returns Registered plugin instance.
8738
+ */
8739
+ private registerPlugin;
8740
+ /**
8741
+ * Registers all plugins in the order specified by the configuration and returns
8742
+ * an array of the registered PluginInstance objects. Each plugin is instantiated
8743
+ * and added to the context's plugins map.
8744
+ *
8745
+ * @returns {ReadonlyArray<PluginInstance>} An array of registered plugin instances in order.
8746
+ */
8747
+ registerPlugins(): ReadonlyArray<PluginInstance>;
8105
8748
  resolveIrRef<T>($ref: string): T;
8106
8749
  /**
8107
8750
  * Returns a resolved reference from `spec`.
8108
8751
  */
8109
8752
  resolveRef<T>($ref: string): T;
8110
- /**
8111
- * Register a new `event` listener.
8112
- */
8113
- subscribe<T extends keyof Events>(event: T, callbackFn: Events[T], pluginName?: string): void;
8114
8753
  }
8115
8754
 
8116
8755
  type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params' | 'octet-stream';
@@ -8326,6 +8965,7 @@ declare namespace IR {
8326
8965
  export type BodyObject = IRBodyObject;
8327
8966
  export type ComponentsObject = IRComponentsObject;
8328
8967
  export type Context<Spec extends Record<string, any> = any> = IRContext<Spec>;
8968
+ export type ContextFile = ContextFile;
8329
8969
  export type Model = IRModel;
8330
8970
  export type OperationObject = IROperationObject;
8331
8971
  export type ParameterObject = IRParameterObject;
@@ -8374,4 +9014,4 @@ interface WatchValues {
8374
9014
  lastValue?: string;
8375
9015
  }
8376
9016
 
8377
- export { type Client$1 as C, IR as I, LegacyIR as L, OpenApi as O, type PluginHandler as P, type StringCase as S, type UserConfig as U, type WatchValues as W, OpenApiSchemaObject as a, Client as b, Plugin as c, defaultPlugins as d, type Config as e, initConfigs as i };
9017
+ export { type BaseConfig as B, type Client$1 as C, IR as I, LegacyIR as L, OpenApi as O, type PluginHandler as P, type StringCase as S, type UserConfig as U, type WatchValues as W, Plugin as a, OpenApiSchemaObject as b, Client as c, defaultPlugins as d, type Config as e, initConfigs as i };