@hey-api/openapi-ts 0.74.0 → 0.76.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.
@@ -5093,6 +5093,7 @@ interface XMLObject$1 {
5093
5093
  }
5094
5094
 
5095
5095
  interface OpenApiV2_0_XTypes {
5096
+ InfoObject: InfoObject$1;
5096
5097
  SchemaObject: SchemaObject$1;
5097
5098
  }
5098
5099
 
@@ -6378,6 +6379,7 @@ type OpenApiSchemaFormats =
6378
6379
  type Format = JsonSchemaFormats | OpenApiSchemaFormats | (string & {});
6379
6380
 
6380
6381
  interface OpenApiV3_0_XTypes {
6382
+ InfoObject: InfoObject;
6381
6383
  ParameterObject: ParameterObject;
6382
6384
  ReferenceObject: ReferenceObject;
6383
6385
  RequestBodyObject: RequestBodyObject;
@@ -6386,6 +6388,7 @@ interface OpenApiV3_0_XTypes {
6386
6388
  }
6387
6389
 
6388
6390
  interface OpenApiV3_1_XTypes {
6391
+ InfoObject: InfoObject$2;
6389
6392
  ParameterObject: ParameterObject$2;
6390
6393
  ReferenceObject: ReferenceObject$2;
6391
6394
  RequestBodyObject: RequestBodyObject$1;
@@ -6401,6 +6404,14 @@ declare namespace OpenApi {
6401
6404
  export type V3_1_X = OpenApiV3_1_X;
6402
6405
  }
6403
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
+
6404
6415
  declare namespace OpenApiParameterObject {
6405
6416
  export type V3_0_X =
6406
6417
  | OpenApiV3_0_XTypes['ParameterObject']
@@ -6439,6 +6450,42 @@ declare namespace OpenApiSchemaObject {
6439
6450
  export type V3_1_X = OpenApiV3_1_XTypes['SchemaObject'];
6440
6451
  }
6441
6452
 
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
+ };
6482
+
6483
+ type WalkEventType = WalkEvents['type'];
6484
+ type WalkEvent<T extends WalkEventType = WalkEventType> = Extract<
6485
+ WalkEvents,
6486
+ { type: T }
6487
+ >;
6488
+
6442
6489
  declare class PluginInstance<PluginConfig extends BaseConfig = BaseConfig> {
6443
6490
  config: Plugin.Config<PluginConfig>['config'];
6444
6491
  context: IR.Context;
@@ -6451,6 +6498,33 @@ declare class PluginInstance<PluginConfig extends BaseConfig = BaseConfig> {
6451
6498
  name: string;
6452
6499
  });
6453
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;
6454
6528
  /**
6455
6529
  * Retrieves a registered plugin instance by its name from the context. This
6456
6530
  * allows plugins to access other plugins that have been registered in the
@@ -6464,14 +6538,6 @@ declare class PluginInstance<PluginConfig extends BaseConfig = BaseConfig> {
6464
6538
  * Executes plugin's handler function.
6465
6539
  */
6466
6540
  run(): Promise<void>;
6467
- /**
6468
- * Subscribe to an input parser event.
6469
- *
6470
- * @param event Event type from the parser.
6471
- * @param callbackFn Function to execute on event.
6472
- * @returns void
6473
- */
6474
- subscribe<T extends keyof IR.ContextEvents>(event: T, callbackFn: IR.ContextEvents[T]): void;
6475
6541
  }
6476
6542
 
6477
6543
  type PluginClientNames =
@@ -7098,20 +7164,227 @@ interface Config$9 extends Plugin.Name<'@hey-api/typescript'> {
7098
7164
  }
7099
7165
 
7100
7166
  interface Config$8
7101
- extends Plugin.Name<'@tanstack/react-query'>,
7102
- TanStackQuery.Config {
7167
+ extends Plugin.Name<'@tanstack/angular-query-experimental'> {
7103
7168
  /**
7104
- * 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.
7170
+ *
7171
+ * @default 'camelCase'
7172
+ */
7173
+ case?: StringCase;
7174
+ /**
7175
+ * Add comments from SDK functions to the generated TanStack Query code?
7105
7176
  *
7106
7177
  * @default true
7107
7178
  */
7108
- infiniteQueryOptions?: 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
+ };
7225
+ /**
7226
+ * Name of the generated file.
7227
+ *
7228
+ * @default '@tanstack/angular-query-experimental'
7229
+ */
7230
+ output?: string;
7231
+ /**
7232
+ * Configuration for generated query keys.
7233
+ *
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}
7248
+ */
7249
+ queryOptions?:
7250
+ | boolean
7251
+ | string
7252
+ | {
7253
+ case?: StringCase;
7254
+ enabled?: boolean;
7255
+ name?: string | ((name: string) => string);
7256
+ };
7257
+ }
7258
+
7259
+ interface Config$7 extends Plugin.Name<'@tanstack/react-query'> {
7260
+ /**
7261
+ * The casing convention to use for generated names.
7262
+ *
7263
+ * @default 'camelCase'
7264
+ */
7265
+ case?: StringCase;
7109
7266
  /**
7110
- * 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.
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.
7111
7272
  *
7112
7273
  * @default true
7113
7274
  */
7114
- 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
+ };
7115
7388
  /**
7116
7389
  * Name of the generated file.
7117
7390
  *
@@ -7119,29 +7392,135 @@ interface Config$8
7119
7392
  */
7120
7393
  output?: string;
7121
7394
  /**
7122
- * Generate {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions `queryOptions()`} helpers?
7123
- * These will be generated from all requests.
7395
+ * Configuration for generated query keys.
7124
7396
  *
7125
- * @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
7126
7403
  */
7127
- 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
+ };
7128
7464
  }
7129
7465
 
7130
- interface Config$7
7131
- extends Plugin.Name<'@tanstack/solid-query'>,
7132
- TanStackQuery.Config {
7466
+ interface Config$6 extends Plugin.Name<'@tanstack/solid-query'> {
7133
7467
  /**
7134
- * 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.
7135
7469
  *
7136
- * @default true
7470
+ * @default 'camelCase'
7137
7471
  */
7138
- infiniteQueryOptions?: boolean;
7472
+ case?: StringCase;
7139
7473
  /**
7140
- * Generate `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?
7141
7475
  *
7142
7476
  * @default true
7143
7477
  */
7144
- 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
+ };
7145
7524
  /**
7146
7525
  * Name of the generated file.
7147
7526
  *
@@ -7149,29 +7528,91 @@ interface Config$7
7149
7528
  */
7150
7529
  output?: string;
7151
7530
  /**
7152
- * Generate {@link https://tanstack.com/query/v5/docs/framework/solid/reference/createQuery `createQuery()`} helpers?
7153
- * These will be generated from all requests.
7531
+ * Configuration for generated query keys.
7154
7532
  *
7155
- * @default true
7533
+ * See {@link https://tanstack.com/query/v5/docs/framework/solid/reference/queryKey}
7156
7534
  */
7157
- queryOptions?: boolean;
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}
7547
+ */
7548
+ queryOptions?:
7549
+ | boolean
7550
+ | string
7551
+ | {
7552
+ case?: StringCase;
7553
+ enabled?: boolean;
7554
+ name?: string | ((name: string) => string);
7555
+ };
7158
7556
  }
7159
7557
 
7160
- interface Config$6
7161
- extends Plugin.Name<'@tanstack/svelte-query'>,
7162
- TanStackQuery.Config {
7558
+ interface Config$5 extends Plugin.Name<'@tanstack/svelte-query'> {
7163
7559
  /**
7164
- * Generate `createInfiniteQuery()` 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.
7165
7561
  *
7166
- * @default true
7562
+ * @default 'camelCase'
7167
7563
  */
7168
- infiniteQueryOptions?: boolean;
7564
+ case?: StringCase;
7169
7565
  /**
7170
- * 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.
7566
+ * Add comments from SDK functions to the generated TanStack Query code?
7171
7567
  *
7172
7568
  * @default true
7173
7569
  */
7174
- 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
+ };
7175
7616
  /**
7176
7617
  * Name of the generated file.
7177
7618
  *
@@ -7179,132 +7620,123 @@ interface Config$6
7179
7620
  */
7180
7621
  output?: string;
7181
7622
  /**
7182
- * Generate {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/functions/createquery `createQuery()`} helpers?
7183
- * These will be generated from all requests.
7623
+ * Configuration for generated query keys.
7184
7624
  *
7185
- * @default true
7625
+ * See {@link https://tanstack.com/query/v5/docs/framework/svelte/reference/queryKey}
7626
+ */
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}
7186
7639
  */
7187
- queryOptions?: boolean;
7640
+ queryOptions?:
7641
+ | boolean
7642
+ | string
7643
+ | {
7644
+ case?: StringCase;
7645
+ enabled?: boolean;
7646
+ name?: string | ((name: string) => string);
7647
+ };
7188
7648
  }
7189
7649
 
7190
- interface Config$5
7191
- extends Plugin.Name<'@tanstack/vue-query'>,
7192
- TanStackQuery.Config {
7650
+ interface Config$4 extends Plugin.Name<'@tanstack/vue-query'> {
7193
7651
  /**
7194
- * 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.
7652
+ * The casing convention to use for generated names.
7195
7653
  *
7196
- * @default true
7654
+ * @default 'camelCase'
7197
7655
  */
7198
- infiniteQueryOptions?: boolean;
7656
+ case?: StringCase;
7199
7657
  /**
7200
- * 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.
7658
+ * Add comments from SDK functions to the generated TanStack Query code?
7201
7659
  *
7202
7660
  * @default true
7203
7661
  */
7204
- mutationOptions?: boolean;
7662
+ comments?: boolean;
7205
7663
  /**
7206
- * Name of the generated file.
7664
+ * Should the exports from the generated files be re-exported in the index barrel file?
7207
7665
  *
7208
- * @default '@tanstack/vue-query'
7666
+ * @default false
7209
7667
  */
7210
- output?: string;
7668
+ exportFromIndex?: boolean;
7211
7669
  /**
7212
- * Generate {@link https://tanstack.com/query/v5/docs/framework/vue/guides/query-options `queryOptions()`} helpers?
7213
- * These will be generated from all requests.
7670
+ * Configuration for generated infinite query key helpers.
7214
7671
  *
7215
- * @default true
7672
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions}
7216
7673
  */
7217
- queryOptions?: boolean;
7218
- }
7219
-
7220
- /**
7221
- * Public TanStack Query API.
7222
- */
7223
- declare namespace TanStackQuery {
7224
- export type Config = {
7225
- /**
7226
- * Add comments from SDK functions to the generated TanStack Query code?
7227
- * Duplicating comments this way is useful so you don't need to drill into
7228
- * the underlying SDK function to learn what it does or whether it's
7229
- * deprecated. You can set this option to `false` if you prefer less
7230
- * comment duplication.
7231
- *
7232
- * @default true
7233
- */
7234
- comments?: boolean;
7235
- /**
7236
- * Should the exports from the generated files be re-exported in the index
7237
- * barrel file?
7238
- *
7239
- * @default false
7240
- */
7241
- exportFromIndex?: boolean;
7242
- /**
7243
- * Customize the generated infinite query key names. The name variable is
7244
- * obtained from the SDK function name.
7245
- *
7246
- * @default '{{name}}InfiniteQueryKey'
7247
- */
7248
- infiniteQueryKeyNameBuilder?: string | ((name: string) => string);
7249
- /**
7250
- * Customize the generated infinite query options names. The name variable
7251
- * is obtained from the SDK function name.
7252
- *
7253
- * @default '{{name}}InfiniteOptions'
7254
- */
7255
- infiniteQueryOptionsNameBuilder?: string | ((name: string) => string);
7256
- /**
7257
- * Customize the generated mutation options names. The name variable is
7258
- * obtained from the SDK function name.
7259
- *
7260
- * @default '{{name}}Mutation'
7261
- */
7262
- mutationOptionsNameBuilder?: string | ((name: string) => string);
7263
- /**
7264
- * Customize the generated query key names. The name variable is obtained
7265
- * from the SDK function name.
7266
- *
7267
- * @default '{{name}}QueryKey'
7268
- */
7269
- queryKeyNameBuilder?: string | ((name: string) => string);
7270
- /**
7271
- * Customize the generated query options names. The name variable is
7272
- * obtained from the SDK function name.
7273
- *
7274
- * @default '{{name}}Options'
7275
- */
7276
- queryOptionsNameBuilder?: string | ((name: string) => string);
7277
- };
7278
- }
7279
-
7280
- interface Config$4
7281
- extends Plugin.Name<'@tanstack/angular-query-experimental'>,
7282
- TanStackQuery.Config {
7674
+ infiniteQueryKeys?:
7675
+ | boolean
7676
+ | string
7677
+ | {
7678
+ case?: StringCase;
7679
+ enabled?: boolean;
7680
+ name?: string | ((name: string) => string);
7681
+ };
7283
7682
  /**
7284
- * 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.
7683
+ * Configuration for generated infinite query options helpers.
7285
7684
  *
7286
- * @default true
7685
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions}
7287
7686
  */
7288
- infiniteQueryOptions?: boolean;
7687
+ infiniteQueryOptions?:
7688
+ | boolean
7689
+ | string
7690
+ | {
7691
+ case?: StringCase;
7692
+ enabled?: boolean;
7693
+ name?: string | ((name: string) => string);
7694
+ };
7289
7695
  /**
7290
- * 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.
7696
+ * Configuration for generated mutation options helpers.
7291
7697
  *
7292
- * @default true
7698
+ * See {@link https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation}
7293
7699
  */
7294
- mutationOptions?: boolean;
7700
+ mutationOptions?:
7701
+ | boolean
7702
+ | string
7703
+ | {
7704
+ case?: StringCase;
7705
+ enabled?: boolean;
7706
+ name?: string | ((name: string) => string);
7707
+ };
7295
7708
  /**
7296
7709
  * Name of the generated file.
7297
7710
  *
7298
- * @default '@tanstack/angular-query-experimental'
7711
+ * @default '@tanstack/vue-query'
7299
7712
  */
7300
7713
  output?: string;
7301
7714
  /**
7302
- * Generate {@link https://tanstack.com/query/v5/docs/framework/angular/reference/queryOptions `queryOptions()`} helpers?
7303
- * These will be generated from all requests.
7715
+ * Configuration for generated query keys.
7304
7716
  *
7305
- * @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}
7306
7731
  */
7307
- queryOptions?: boolean;
7732
+ queryOptions?:
7733
+ | boolean
7734
+ | string
7735
+ | {
7736
+ case?: StringCase;
7737
+ enabled?: boolean;
7738
+ name?: string | ((name: string) => string);
7739
+ };
7308
7740
  }
7309
7741
 
7310
7742
  interface Config$3 extends Plugin.Name<'fastify'> {
@@ -7323,16 +7755,53 @@ interface Config$3 extends Plugin.Name<'fastify'> {
7323
7755
  output?: string;
7324
7756
  }
7325
7757
 
7326
- // import type { IR } from '../../ir/types';
7327
-
7328
-
7329
7758
  interface Config$2 extends Plugin.Name<'valibot'> {
7759
+ /**
7760
+ * The casing convention to use for generated names.
7761
+ *
7762
+ * @default 'camelCase'
7763
+ */
7764
+ case?: StringCase;
7330
7765
  /**
7331
7766
  * Add comments from input to the generated Valibot schemas?
7332
7767
  *
7333
7768
  * @default true
7334
7769
  */
7335
7770
  comments?: boolean;
7771
+ /**
7772
+ * Configuration for reusable schema definitions. Controls generation of
7773
+ * shared Valibot schemas that can be referenced across requests and
7774
+ * responses.
7775
+ *
7776
+ * Can be:
7777
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7778
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7779
+ * - `object`: Full configuration object
7780
+ */
7781
+ definitions?:
7782
+ | boolean
7783
+ | string
7784
+ | {
7785
+ /**
7786
+ * The casing convention to use for generated names.
7787
+ *
7788
+ * @default 'camelCase'
7789
+ */
7790
+ case?: StringCase;
7791
+ /**
7792
+ * Whether to generate Valibot schemas for reusable definitions.
7793
+ *
7794
+ * @default true
7795
+ */
7796
+ enabled?: boolean;
7797
+ /**
7798
+ * Custom naming pattern for generated schema names. The name variable is
7799
+ * obtained from the schema name.
7800
+ *
7801
+ * @default 'v{{name}}'
7802
+ */
7803
+ name?: string | ((name: string) => string);
7804
+ };
7336
7805
  /**
7337
7806
  * Should the exports from the generated files be re-exported in the index
7338
7807
  * barrel file?
@@ -7341,16 +7810,87 @@ interface Config$2 extends Plugin.Name<'valibot'> {
7341
7810
  */
7342
7811
  exportFromIndex?: boolean;
7343
7812
  /**
7344
- * Customise the Valibot schema name. By default, `v{{name}}` is used,
7345
- * where `name` is a definition name or an operation name.
7813
+ * Enable Valibot metadata support? It's often useful to associate a schema
7814
+ * with some additional metadata for documentation, code generation, AI
7815
+ * structured outputs, form validation, and other purposes.
7816
+ *
7817
+ * @default false
7346
7818
  */
7347
- // nameBuilder?: (model: IR.OperationObject | IR.SchemaObject) => string;
7819
+ metadata?: boolean;
7348
7820
  /**
7349
7821
  * Name of the generated file.
7350
7822
  *
7351
7823
  * @default 'valibot'
7352
7824
  */
7353
7825
  output?: string;
7826
+ /**
7827
+ * Configuration for request-specific Valibot schemas.
7828
+ * Controls generation of Valibot schemas for request bodies, query
7829
+ * parameters, path parameters, and headers.
7830
+ *
7831
+ * Can be:
7832
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7833
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7834
+ * - `object`: Full configuration object
7835
+ */
7836
+ requests?:
7837
+ | boolean
7838
+ | string
7839
+ | {
7840
+ /**
7841
+ * The casing convention to use for generated names.
7842
+ *
7843
+ * @default 'camelCase'
7844
+ */
7845
+ case?: StringCase;
7846
+ /**
7847
+ * Whether to generate Valibot schemas for request definitions.
7848
+ *
7849
+ * @default true
7850
+ */
7851
+ enabled?: boolean;
7852
+ /**
7853
+ * Custom naming pattern for generated schema names. The name variable is
7854
+ * obtained from the operation name.
7855
+ *
7856
+ * @default 'v{{name}}Data'
7857
+ */
7858
+ name?: string | ((name: string) => string);
7859
+ };
7860
+ /**
7861
+ * Configuration for response-specific Valibot schemas.
7862
+ * Controls generation of Valibot schemas for response bodies, error
7863
+ * responses, and status codes.
7864
+ *
7865
+ * Can be:
7866
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
7867
+ * - `string`: Shorthand for `{ enabled: true; name: string }`
7868
+ * - `object`: Full configuration object
7869
+ */
7870
+ responses?:
7871
+ | boolean
7872
+ | string
7873
+ | {
7874
+ /**
7875
+ * The casing convention to use for generated names.
7876
+ *
7877
+ * @default 'camelCase'
7878
+ */
7879
+ case?: StringCase;
7880
+ /**
7881
+ * Whether to generate Valibot schemas for response definitions.
7882
+ *
7883
+ * @default true
7884
+ */
7885
+ enabled?: boolean;
7886
+ /**
7887
+ * Custom naming pattern for generated schema names. The name variable is
7888
+ * obtained from the operation name.
7889
+ *
7890
+ * @default 'v{{name}}Response'
7891
+ */
7892
+ name?: string | ((name: string) => string);
7893
+ };
7354
7894
  }
7355
7895
 
7356
7896
  interface Config$1 extends Plugin.Name<'zod'> {
@@ -7491,11 +8031,11 @@ interface Config$1 extends Plugin.Name<'zod'> {
7491
8031
  /**
7492
8032
  * User-facing plugin types.
7493
8033
  */
7494
- 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>;
8034
+ 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>;
7495
8035
  /**
7496
8036
  * Internal plugin types.
7497
8037
  */
7498
- 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>;
8038
+ 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>;
7499
8039
 
7500
8040
  interface Input {
7501
8041
  /**
@@ -7738,12 +8278,43 @@ interface Filters {
7738
8278
  }
7739
8279
 
7740
8280
  interface Patch {
8281
+ /**
8282
+ * Patch the OpenAPI meta object in place. Useful for modifying general metadata such as title, description, version, or custom fields before further processing.
8283
+ *
8284
+ * @param meta The OpenAPI meta object for the current version.
8285
+ */
8286
+ meta?: (
8287
+ meta:
8288
+ | OpenApiMetaObject.V2_0_X
8289
+ | OpenApiMetaObject.V3_0_X
8290
+ | OpenApiMetaObject.V3_1_X,
8291
+ ) => void;
8292
+ /**
8293
+ * Patch OpenAPI parameters in place. The key is the parameter name, and the function receives the parameter object to modify directly.
8294
+ *
8295
+ * @example
8296
+ * parameters: {
8297
+ * limit: (parameter) => {
8298
+ * parameter.schema.type = 'integer';
8299
+ * }
8300
+ * }
8301
+ */
7741
8302
  parameters?: Record<
7742
8303
  string,
7743
8304
  (
7744
8305
  parameter: OpenApiParameterObject.V3_0_X | OpenApiParameterObject.V3_1_X,
7745
8306
  ) => void
7746
8307
  >;
8308
+ /**
8309
+ * Patch OpenAPI request bodies in place. The key is the request body name, and the function receives the request body object to modify directly.
8310
+ *
8311
+ * @example
8312
+ * requestBodies: {
8313
+ * CreateUserRequest: (requestBody) => {
8314
+ * requestBody.required = true;
8315
+ * }
8316
+ * }
8317
+ */
7747
8318
  requestBodies?: Record<
7748
8319
  string,
7749
8320
  (
@@ -7752,6 +8323,16 @@ interface Patch {
7752
8323
  | OpenApiRequestBodyObject.V3_1_X,
7753
8324
  ) => void
7754
8325
  >;
8326
+ /**
8327
+ * Patch OpenAPI responses in place. The key is the response name, and the function receives the response object to modify directly.
8328
+ *
8329
+ * @example
8330
+ * responses: {
8331
+ * NotFound: (response) => {
8332
+ * response.description = 'Resource not found.';
8333
+ * }
8334
+ * }
8335
+ */
7755
8336
  responses?: Record<
7756
8337
  string,
7757
8338
  (
@@ -7795,6 +8376,17 @@ interface Patch {
7795
8376
  | OpenApiSchemaObject.V3_1_X,
7796
8377
  ) => void
7797
8378
  >;
8379
+ /**
8380
+ * Patch the OpenAPI version string. The function receives the current version and should return the new version string.
8381
+ * Useful for normalizing or overriding the version value before further processing.
8382
+ *
8383
+ * @param version The current OpenAPI version string.
8384
+ * @returns The new version string to use.
8385
+ *
8386
+ * @example
8387
+ * version: (version) => version.replace(/^v/, '')
8388
+ */
8389
+ version?: (version: string) => string;
7798
8390
  }
7799
8391
 
7800
8392
  interface Watch {
@@ -8203,39 +8795,6 @@ interface ContextFile {
8203
8795
  */
8204
8796
  path: string;
8205
8797
  }
8206
- interface Events {
8207
- /**
8208
- * Called after parsing.
8209
- */
8210
- after: () => void;
8211
- /**
8212
- * Called before parsing.
8213
- */
8214
- before: () => void;
8215
- operation: (args: {
8216
- method: keyof IR.PathItemObject;
8217
- operation: IR.OperationObject;
8218
- path: string;
8219
- }) => void;
8220
- parameter: (args: {
8221
- $ref: string;
8222
- name: string;
8223
- parameter: IR.ParameterObject;
8224
- }) => void;
8225
- requestBody: (args: {
8226
- $ref: string;
8227
- name: string;
8228
- requestBody: IR.RequestBodyObject;
8229
- }) => void;
8230
- schema: (args: {
8231
- $ref: string;
8232
- name: string;
8233
- schema: IR.SchemaObject;
8234
- }) => void;
8235
- server: (args: {
8236
- server: IR.ServerObject;
8237
- }) => void;
8238
- }
8239
8798
  declare class IRContext<Spec extends Record<string, any> = any> {
8240
8799
  /**
8241
8800
  * Configuration for parsing and generating the output. This
@@ -8260,18 +8819,10 @@ declare class IRContext<Spec extends Record<string, any> = any> {
8260
8819
  * Resolved specification from `input`.
8261
8820
  */
8262
8821
  spec: Spec;
8263
- /**
8264
- * A map of event listeners.
8265
- */
8266
- private listeners;
8267
8822
  constructor({ config, spec }: {
8268
8823
  config: Config;
8269
8824
  spec: Spec;
8270
8825
  });
8271
- /**
8272
- * Notify all event listeners about `event`.
8273
- */
8274
- broadcast<T extends keyof Events>(event: T, ...args: Parameters<Events[T]>): Promise<void>;
8275
8826
  /**
8276
8827
  * Create and return a new TypeScript file. Also set the current file context
8277
8828
  * to the newly created file.
@@ -8295,19 +8846,18 @@ declare class IRContext<Spec extends Record<string, any> = any> {
8295
8846
  */
8296
8847
  private registerPlugin;
8297
8848
  /**
8298
- * Generator that iterates through plugin order and registers each plugin.
8299
- * Yields the registered plugin instance for each plugin name.
8849
+ * Registers all plugins in the order specified by the configuration and returns
8850
+ * an array of the registered PluginInstance objects. Each plugin is instantiated
8851
+ * and added to the context's plugins map.
8852
+ *
8853
+ * @returns {ReadonlyArray<PluginInstance>} An array of registered plugin instances in order.
8300
8854
  */
8301
- registerPlugins(): Generator<PluginInstance>;
8855
+ registerPlugins(): ReadonlyArray<PluginInstance>;
8302
8856
  resolveIrRef<T>($ref: string): T;
8303
8857
  /**
8304
8858
  * Returns a resolved reference from `spec`.
8305
8859
  */
8306
8860
  resolveRef<T>($ref: string): T;
8307
- /**
8308
- * Register a new `event` listener.
8309
- */
8310
- subscribe<T extends keyof Events>(event: T, callbackFn: Events[T], pluginName: string): void;
8311
8861
  }
8312
8862
 
8313
8863
  type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params' | 'octet-stream';
@@ -8523,7 +9073,6 @@ declare namespace IR {
8523
9073
  export type BodyObject = IRBodyObject;
8524
9074
  export type ComponentsObject = IRComponentsObject;
8525
9075
  export type Context<Spec extends Record<string, any> = any> = IRContext<Spec>;
8526
- export type ContextEvents = Events;
8527
9076
  export type ContextFile = ContextFile;
8528
9077
  export type Model = IRModel;
8529
9078
  export type OperationObject = IROperationObject;