@hey-api/openapi-ts 0.82.5 → 0.83.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.
@@ -1,5 +1,5 @@
1
1
  import { SemVer, RangeOptions } from 'semver';
2
- import { CodegenProject } from '@hey-api/codegen-core';
2
+ import { CodegenProject, ICodegenSymbolSelector, ICodegenFile, ICodegenSymbolOut } from '@hey-api/codegen-core';
3
3
  import fs from 'node:fs';
4
4
  import typescript__default from 'typescript';
5
5
 
@@ -2496,15 +2496,6 @@ type JsonSchemaTypes$1 =
2496
2496
  | 'object'
2497
2497
  | 'string';
2498
2498
 
2499
- type StringCase =
2500
- | 'camelCase'
2501
- | 'PascalCase'
2502
- | 'preserve'
2503
- | 'snake_case'
2504
- | 'SCREAMING_SNAKE_CASE';
2505
-
2506
- type StringName = string | ((name: string) => string);
2507
-
2508
2499
  type Package = {
2509
2500
  /**
2510
2501
  * Get the installed version of a package.
@@ -2548,98 +2539,11 @@ type CommentObject = {
2548
2539
  };
2549
2540
  type Comments = CommentLines | Array<CommentObject>;
2550
2541
 
2551
- interface Identifier {
2552
- /**
2553
- * Did this function add a new property to the file's `identifiers` map?
2554
- */
2555
- created: boolean;
2556
- /**
2557
- * The resolved identifier name. False means the identifier has been blacklisted.
2558
- */
2559
- name: string | false;
2560
- }
2561
-
2562
- type NamespaceEntry = Pick<Identifier, 'name'> & {
2563
- /**
2564
- * Ref to the type in OpenAPI specification.
2565
- */
2566
- $ref: string;
2567
- };
2568
-
2569
- type Identifiers = Record<
2570
- string,
2571
- {
2572
- /**
2573
- * TypeScript enum only namespace.
2574
- *
2575
- * @example
2576
- * ```ts
2577
- * export enum Foo = {
2578
- * FOO = 'foo'
2579
- * }
2580
- * ```
2581
- */
2582
- enum?: Record<string, NamespaceEntry>;
2583
- /**
2584
- * Type namespace. Types, interfaces, and type aliases exist here.
2585
- *
2586
- * @example
2587
- * ```ts
2588
- * export type Foo = string;
2589
- * ```
2590
- */
2591
- type?: Record<string, NamespaceEntry>;
2592
- /**
2593
- * Value namespace. Variables, functions, classes, and constants exist here.
2594
- *
2595
- * @example
2596
- * ```js
2597
- * export const foo = '';
2598
- * ```
2599
- */
2600
- value?: Record<string, NamespaceEntry>;
2601
- }
2602
- >;
2603
-
2604
- type Namespace = keyof Identifiers[keyof Identifiers];
2605
-
2606
- type FileImportResult<
2607
- Name extends string | undefined = string | undefined,
2608
- Alias extends string | undefined = undefined,
2609
- > = {
2610
- asType?: boolean;
2611
- name: Alias extends string ? Alias : Name;
2612
- };
2613
-
2614
- type NodeInfo = {
2615
- /**
2616
- * Is this node exported from the file?
2617
- *
2618
- * @default false
2619
- */
2620
- exported?: boolean;
2621
- /**
2622
- * Reference to the node object.
2623
- */
2624
- node: typescript__default.TypeReferenceNode;
2625
- };
2626
-
2627
- type NodeReference<T = void> = {
2628
- /**
2629
- * Factory function that creates the node reference.
2630
- *
2631
- * @param name Identifier name.
2632
- * @returns Reference to the node object.
2633
- */
2634
- factory: (name: string) => T;
2635
- /**
2636
- * Reference to the node object.
2637
- */
2638
- node: T;
2542
+ type FileImportResult<Name extends string | undefined = string | undefined, Alias extends string | undefined = undefined> = {
2543
+ asType?: boolean;
2544
+ name: Alias extends string ? Alias : Name;
2639
2545
  };
2640
-
2641
2546
  declare class GeneratedFile {
2642
- private _case;
2643
2547
  /**
2644
2548
  * Should the exports from this file be re-exported in the index barrel file?
2645
2549
  */
@@ -2650,49 +2554,7 @@ declare class GeneratedFile {
2650
2554
  private _items;
2651
2555
  private _name;
2652
2556
  private _path;
2653
- /** @deprecated use `names` and `nodes` */
2654
- identifiers: Identifiers;
2655
- /**
2656
- * Map of node IDs. This can be used to obtain actual node names. Keys are
2657
- * node IDs which can be any string, values are names. Values are kept in
2658
- * sync with `nodes`.
2659
- *
2660
- * @example
2661
- * ```json
2662
- * {
2663
- * "#/my-id": "final_name",
2664
- * "anyId": "name"
2665
- * }
2666
- * ```
2667
- */
2668
- private names;
2669
- /**
2670
- * Another approach for named nodes, with proper support for renaming. Keys
2671
- * are node IDs and values are an array of references for given ID.
2672
- */
2673
- private nodeReferences;
2674
- /**
2675
- * Text value from node is kept in sync with `names`.
2676
- *
2677
- * @deprecated
2678
- * @example
2679
- * ```js
2680
- * {
2681
- * "#/my-id": {
2682
- * "node": TypeReferenceNode
2683
- * },
2684
- * "anyId": {
2685
- * "node": TypeReferenceNode
2686
- * }
2687
- * }
2688
- * ```
2689
- */
2690
- private nodes;
2691
- /**
2692
- * Path relative to the client output root.
2693
- */
2694
- constructor({ case: _case, dir, exportFromIndex, header, id, name, }: {
2695
- case?: StringCase;
2557
+ constructor({ dir, exportFromIndex, header, id, name, }: {
2696
2558
  dir: string;
2697
2559
  /**
2698
2560
  * Should the exports from this file be re-exported in the index barrel file?
@@ -2708,33 +2570,8 @@ declare class GeneratedFile {
2708
2570
  name: string;
2709
2571
  });
2710
2572
  add(...nodes: Array<typescript__default.Node | string>): void;
2711
- /**
2712
- * Adds a reference node for a name. This can be used later to rename
2713
- * identifiers.
2714
- */
2715
- addNodeReference<T>(id: string, node: Pick<NodeReference<T>, 'factory'>): T;
2716
2573
  get exportFromIndex(): boolean;
2717
- /**
2718
- * Returns an actual node name. If node doesn't exist throws an error.
2719
- *
2720
- * @param id Node ID.
2721
- * @returns Actual node name.
2722
- */
2723
- getName(id: string): string | undefined;
2724
- /**
2725
- * Returns a node. If node doesn't exist, creates a blank reference.
2726
- *
2727
- * @deprecated
2728
- * @param id Node ID.
2729
- * @returns Information about the node.
2730
- */
2731
- getNode(id: string): NodeInfo;
2732
2574
  get id(): string;
2733
- /** @deprecated use `names` and `nodes` */
2734
- identifier(args: Pick<EnsureUniqueIdentifierData, '$ref' | 'count' | 'create' | 'nameTransformer'> & {
2735
- case?: StringCase;
2736
- namespace: Namespace;
2737
- }): Identifier;
2738
2575
  /**
2739
2576
  * Adds an import to the provided module. Handles duplication, returns added
2740
2577
  * import. Returns the imported name. If we import an aliased export, `name`
@@ -2758,39 +2595,8 @@ declare class GeneratedFile {
2758
2595
  removeNode_LEGACY(): void;
2759
2596
  private _setName;
2760
2597
  private _toString;
2761
- /**
2762
- * Inserts or updates a node.
2763
- *
2764
- * @deprecated
2765
- * @param id Node ID.
2766
- * @param args Information about the node.
2767
- * @returns Updated node.
2768
- */
2769
- updateNode(id: string, args: Pick<NodeInfo, 'exported'> & {
2770
- name: string;
2771
- }): NodeInfo;
2772
- /**
2773
- * Updates collected reference nodes for a name with the latest value.
2774
- *
2775
- * @param id Node ID.
2776
- * @param name Updated name for the nodes.
2777
- * @returns noop
2778
- */
2779
- updateNodeReferences(id: string, name: string): void;
2780
2598
  write(separator?: string, tsConfig?: typescript__default.ParsedCommandLine | null): void;
2781
2599
  }
2782
- interface EnsureUniqueIdentifierData {
2783
- $ref: string;
2784
- case: StringCase | undefined;
2785
- count?: number;
2786
- create?: boolean;
2787
- identifiers: Identifiers;
2788
- /**
2789
- * Transforms name obtained from `$ref` before it's passed to `stringCase()`.
2790
- */
2791
- nameTransformer?: ((name: string) => string) | string;
2792
- namespace: Namespace;
2793
- }
2794
2600
 
2795
2601
  type ObjectType<T> = Extract<T, Record<string, any>> extends never ? Record<string, any> : Extract<T, Record<string, any>>;
2796
2602
  type NotArray<T> = T extends any[] ? never : T;
@@ -2954,6 +2760,15 @@ type Logs = {
2954
2760
  path?: string;
2955
2761
  };
2956
2762
 
2763
+ type StringCase =
2764
+ | 'camelCase'
2765
+ | 'PascalCase'
2766
+ | 'preserve'
2767
+ | 'snake_case'
2768
+ | 'SCREAMING_SNAKE_CASE';
2769
+
2770
+ type StringName = string | ((name: string) => string);
2771
+
2957
2772
  type Formatters = 'biome' | 'prettier';
2958
2773
 
2959
2774
  type Linters = 'biome' | 'eslint' | 'oxlint';
@@ -6833,7 +6648,7 @@ interface UserConfig$o {
6833
6648
  watch?: boolean | number | Watch;
6834
6649
  }
6835
6650
 
6836
- type Config$b = Omit<
6651
+ type Config$c = Omit<
6837
6652
  Required<UserConfig$o>,
6838
6653
  | 'base'
6839
6654
  | 'input'
@@ -7115,7 +6930,7 @@ interface Client$2 {
7115
6930
  * Configuration for parsing and generating the output. This
7116
6931
  * is a mix of user-provided and default values.
7117
6932
  */
7118
- config: Config$b;
6933
+ config: Config$c;
7119
6934
  models: Model[];
7120
6935
  operations: Operation$1[];
7121
6936
  server: string;
@@ -7787,6 +7602,15 @@ declare class PluginInstance<T extends Plugin.Types = Plugin.Types> {
7787
7602
  * @returns The plugin instance if found, undefined otherwise.
7788
7603
  */
7789
7604
  getPlugin<T extends keyof PluginConfigMap>(name: T): T extends any ? PluginInstance<PluginConfigMap[T]> | undefined : never;
7605
+ /**
7606
+ * Retrieves a registered plugin instance by its name from the context. This
7607
+ * allows plugins to access other plugins that have been registered in the
7608
+ * same context, enabling cross-plugin communication and dependencies.
7609
+ *
7610
+ * @param name Plugin name as defined in the configuration.
7611
+ * @returns The plugin instance if found, throw otherwise.
7612
+ */
7613
+ getPluginOrThrow<T extends keyof PluginConfigMap>(name: T): T extends any ? PluginInstance<PluginConfigMap[T]> : never;
7790
7614
  hooks: {
7791
7615
  operation: {
7792
7616
  isMutation: (operation: IR$1.OperationObject) => boolean;
@@ -7967,6 +7791,22 @@ type DefinePlugin<
7967
7791
  Types: Plugin.Types<Config, ResolvedConfig, Api>;
7968
7792
  };
7969
7793
 
7794
+ type SelectorType$i = 'class' | 'httpRequest' | 'httpResource' | 'HttpRequest' | 'inject' | 'Injectable';
7795
+ type IApi$i = {
7796
+ /**
7797
+ * @param type Selector type.
7798
+ * @param value Depends on `type`:
7799
+ * - `class`: raw string entry from path
7800
+ * - `httpRequest`: `operation.id` string
7801
+ * - `httpResource`: never
7802
+ * - `HttpRequest`: never
7803
+ * - `inject`: never
7804
+ * - `Injectable`: never
7805
+ * @returns Selector array
7806
+ */
7807
+ getSelector: (type: SelectorType$i, value?: string) => ICodegenSymbolSelector;
7808
+ };
7809
+
7970
7810
  type UserConfig$n = Plugin.Name<'@angular/common'> & {
7971
7811
  /**
7972
7812
  * Should the exports from the generated files be re-exported in the index
@@ -8046,7 +7886,7 @@ type UserConfig$n = Plugin.Name<'@angular/common'> & {
8046
7886
  output?: string;
8047
7887
  };
8048
7888
 
8049
- type Config$a = Plugin.Name<'@angular/common'> & {
7889
+ type Config$b = Plugin.Name<'@angular/common'> & {
8050
7890
  /**
8051
7891
  * Should the exports from the generated files be re-exported in the index
8052
7892
  * barrel file?
@@ -8116,7 +7956,29 @@ type Config$a = Plugin.Name<'@angular/common'> & {
8116
7956
  output: string;
8117
7957
  };
8118
7958
 
8119
- type AngularCommonPlugin = DefinePlugin<UserConfig$n, Config$a>;
7959
+ type AngularCommonPlugin = DefinePlugin<UserConfig$n, Config$b, IApi$i>;
7960
+
7961
+ type SelectorType$h = 'client';
7962
+ type IApi$h = {
7963
+ /**
7964
+ * @param type Selector type.
7965
+ * @param value Depends on `type`:
7966
+ * - `client`: never
7967
+ * @returns Selector array
7968
+ */
7969
+ getSelector: (type: SelectorType$h, value?: string) => ICodegenSymbolSelector;
7970
+ };
7971
+
7972
+ type SelectorType$g = 'client';
7973
+ type IApi$g = {
7974
+ /**
7975
+ * @param type Selector type.
7976
+ * @param value Depends on `type`:
7977
+ * - `client`: never
7978
+ * @returns Selector array
7979
+ */
7980
+ getSelector: (type: SelectorType$g, value?: string) => ICodegenSymbolSelector;
7981
+ };
8120
7982
 
8121
7983
  type UserConfig$m = Plugin.Name<'@hey-api/client-axios'> &
8122
7984
  Client.Config & {
@@ -8128,7 +7990,22 @@ type UserConfig$m = Plugin.Name<'@hey-api/client-axios'> &
8128
7990
  throwOnError?: boolean;
8129
7991
  };
8130
7992
 
8131
- type HeyApiClientAxiosPlugin = DefinePlugin<UserConfig$m>;
7993
+ type HeyApiClientAxiosPlugin = DefinePlugin<
7994
+ UserConfig$m,
7995
+ UserConfig$m,
7996
+ IApi$g
7997
+ >;
7998
+
7999
+ type SelectorType$f = 'client';
8000
+ type IApi$f = {
8001
+ /**
8002
+ * @param type Selector type.
8003
+ * @param value Depends on `type`:
8004
+ * - `client`: never
8005
+ * @returns Selector array
8006
+ */
8007
+ getSelector: (type: SelectorType$f, value?: string) => ICodegenSymbolSelector;
8008
+ };
8132
8009
 
8133
8010
  type UserConfig$l = Plugin.Name<'@hey-api/client-fetch'> &
8134
8011
  Client.Config & {
@@ -8140,7 +8017,22 @@ type UserConfig$l = Plugin.Name<'@hey-api/client-fetch'> &
8140
8017
  throwOnError?: boolean;
8141
8018
  };
8142
8019
 
8143
- type HeyApiClientFetchPlugin = DefinePlugin<UserConfig$l>;
8020
+ type HeyApiClientFetchPlugin = DefinePlugin<
8021
+ UserConfig$l,
8022
+ UserConfig$l,
8023
+ IApi$f
8024
+ >;
8025
+
8026
+ type SelectorType$e = 'client';
8027
+ type IApi$e = {
8028
+ /**
8029
+ * @param type Selector type.
8030
+ * @param value Depends on `type`:
8031
+ * - `client`: never
8032
+ * @returns Selector array
8033
+ */
8034
+ getSelector: (type: SelectorType$e, value?: string) => ICodegenSymbolSelector;
8035
+ };
8144
8036
 
8145
8037
  type UserConfig$k = Plugin.Name<'@hey-api/client-next'> &
8146
8038
  Client.Config & {
@@ -8152,18 +8044,30 @@ type UserConfig$k = Plugin.Name<'@hey-api/client-next'> &
8152
8044
  throwOnError?: boolean;
8153
8045
  };
8154
8046
 
8155
- type HeyApiClientNextPlugin = DefinePlugin<UserConfig$k>;
8047
+ type HeyApiClientNextPlugin = DefinePlugin<UserConfig$k, UserConfig$k, IApi$e>;
8048
+
8049
+ type SelectorType$d = 'client';
8050
+ type IApi$d = {
8051
+ /**
8052
+ * @param type Selector type.
8053
+ * @param value Depends on `type`:
8054
+ * - `client`: never
8055
+ * @returns Selector array
8056
+ */
8057
+ getSelector: (type: SelectorType$d, value?: string) => ICodegenSymbolSelector;
8058
+ };
8156
8059
 
8157
8060
  type UserConfig$j = Plugin.Name<'@hey-api/client-nuxt'> & Client.Config;
8158
8061
 
8159
- type HeyApiClientNuxtPlugin = DefinePlugin<UserConfig$j>;
8062
+ type HeyApiClientNuxtPlugin = DefinePlugin<UserConfig$j, UserConfig$j, IApi$d>;
8160
8063
 
8161
- type PluginHandler =
8162
- | HeyApiClientAngularPlugin['Handler']
8163
- | HeyApiClientAxiosPlugin['Handler']
8164
- | HeyApiClientFetchPlugin['Handler']
8165
- | HeyApiClientNextPlugin['Handler']
8166
- | HeyApiClientNuxtPlugin['Handler'];
8064
+ interface PluginHandler {
8065
+ (...args: Parameters<HeyApiClientAngularPlugin['Handler']>): void;
8066
+ (...args: Parameters<HeyApiClientAxiosPlugin['Handler']>): void;
8067
+ (...args: Parameters<HeyApiClientFetchPlugin['Handler']>): void;
8068
+ (...args: Parameters<HeyApiClientNextPlugin['Handler']>): void;
8069
+ (...args: Parameters<HeyApiClientNuxtPlugin['Handler']>): void;
8070
+ }
8167
8071
 
8168
8072
  /**
8169
8073
  * Public Client API.
@@ -8239,7 +8143,11 @@ type UserConfig$i = Plugin.Name<'@hey-api/client-angular'> &
8239
8143
  throwOnError?: boolean;
8240
8144
  };
8241
8145
 
8242
- type HeyApiClientAngularPlugin = DefinePlugin<UserConfig$i>;
8146
+ type HeyApiClientAngularPlugin = DefinePlugin<
8147
+ UserConfig$i,
8148
+ UserConfig$i,
8149
+ IApi$h
8150
+ >;
8243
8151
 
8244
8152
  type UserConfig$h = Plugin.Name<'legacy/angular'> &
8245
8153
  Pick<Client.Config, 'output'>;
@@ -8266,6 +8174,17 @@ type UserConfig$d = Plugin.Name<'legacy/xhr'> &
8266
8174
 
8267
8175
  type HeyApiClientLegacyXhrPlugin = DefinePlugin<UserConfig$d>;
8268
8176
 
8177
+ type SelectorType$c = 'ref';
8178
+ type IApi$c = {
8179
+ /**
8180
+ * @param type Selector type.
8181
+ * @param value Depends on `type`:
8182
+ * - `ref`: `$ref` JSON pointer
8183
+ * @returns Selector array
8184
+ */
8185
+ getSelector: (type: SelectorType$c, value?: string) => ICodegenSymbolSelector;
8186
+ };
8187
+
8269
8188
  type UserConfig$c = Plugin.Name<'@hey-api/schemas'> & {
8270
8189
  /**
8271
8190
  * Should the exports from the generated files be re-exported in the index
@@ -8309,7 +8228,24 @@ type UserConfig$c = Plugin.Name<'@hey-api/schemas'> & {
8309
8228
  type?: 'form' | 'json';
8310
8229
  };
8311
8230
 
8312
- type HeyApiSchemasPlugin = DefinePlugin<UserConfig$c>;
8231
+ type HeyApiSchemasPlugin = DefinePlugin<UserConfig$c, UserConfig$c, IApi$c>;
8232
+
8233
+ type SelectorType$b = 'buildClientParams' | 'class' | 'Client' | 'formDataBodySerializer' | 'function' | 'Options' | 'urlSearchParamsBodySerializer';
8234
+ type IApi$b = {
8235
+ /**
8236
+ * @param type Selector type.
8237
+ * @param value Depends on `type`:
8238
+ * - `buildClientParams`: never
8239
+ * - `class`: current class name
8240
+ * - `Client`: never
8241
+ * - `formDataBodySerializer`: never
8242
+ * - `function`: `operation.id` string
8243
+ * - `Options`: never
8244
+ * - `urlSearchParamsBodySerializer`: never
8245
+ * @returns Selector array
8246
+ */
8247
+ getSelector: (type: SelectorType$b, value?: string) => ICodegenSymbolSelector;
8248
+ };
8313
8249
 
8314
8250
  type UserConfig$b = Plugin.Name<'@hey-api/sdk'> & {
8315
8251
  /**
@@ -8486,7 +8422,7 @@ type UserConfig$b = Plugin.Name<'@hey-api/sdk'> & {
8486
8422
  response?: 'body' | 'response';
8487
8423
  };
8488
8424
 
8489
- type Config$9 = Plugin.Name<'@hey-api/sdk'> & {
8425
+ type Config$a = Plugin.Name<'@hey-api/sdk'> & {
8490
8426
  /**
8491
8427
  * Group operation methods into classes? When enabled, you can select which
8492
8428
  * classes to export with `sdk.include` and/or transform their names with
@@ -8640,12 +8576,24 @@ type Config$9 = Plugin.Name<'@hey-api/sdk'> & {
8640
8576
  response: 'body' | 'response';
8641
8577
  };
8642
8578
 
8643
- type HeyApiSdkPlugin = DefinePlugin<UserConfig$b, Config$9>;
8579
+ type HeyApiSdkPlugin = DefinePlugin<UserConfig$b, Config$a, IApi$b>;
8580
+
8581
+ type SelectorType$a = 'response' | 'response-ref';
8582
+ type IApi$a = {
8583
+ /**
8584
+ * @param type Selector type.
8585
+ * @param value Depends on `type`:
8586
+ * - `response`: `operation.id` string
8587
+ * - `response-ref`: `$ref` JSON pointer
8588
+ * @returns Selector array
8589
+ */
8590
+ getSelector: (type: SelectorType$a, value?: string) => ICodegenSymbolSelector;
8591
+ };
8644
8592
 
8645
8593
  type ExpressionTransformer = ({ config, dataExpression, file, schema, }: {
8646
8594
  config: Omit<UserConfig$a, 'name'>;
8647
8595
  dataExpression?: typescript__default.Expression | string;
8648
- file: GeneratedFile;
8596
+ file: ICodegenFile;
8649
8597
  schema: IR$1.SchemaObject;
8650
8598
  }) => Array<typescript__default.Expression> | undefined;
8651
8599
 
@@ -8657,7 +8605,7 @@ type TypeTransformer = ({
8657
8605
  file,
8658
8606
  schema,
8659
8607
  }: {
8660
- file: GeneratedFile;
8608
+ file: ICodegenFile;
8661
8609
  schema: IR$1.SchemaObject;
8662
8610
  }) => typescript__default.TypeNode | undefined;
8663
8611
 
@@ -8691,14 +8639,49 @@ type UserConfig$a = Plugin.Name<'@hey-api/transformers'> & {
8691
8639
  * Custom transforms to apply to the generated code.
8692
8640
  */
8693
8641
  transformers?: ReadonlyArray<ExpressionTransformer>;
8694
-
8695
8642
  /**
8696
8643
  * Custom type transformers that modify the TypeScript types generated.
8697
8644
  */
8698
8645
  typeTransformers?: ReadonlyArray<TypeTransformer>;
8699
8646
  };
8700
8647
 
8701
- type HeyApiTransformersPlugin = DefinePlugin<UserConfig$a>;
8648
+ type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
8649
+ /**
8650
+ * Convert long integers into BigInt values?
8651
+ *
8652
+ * @default true
8653
+ */
8654
+ bigInt: boolean;
8655
+ /**
8656
+ * Convert date strings into Date objects?
8657
+ *
8658
+ * @default true
8659
+ */
8660
+ dates: boolean;
8661
+ /**
8662
+ * Should the exports from the generated files be re-exported in the index
8663
+ * barrel file?
8664
+ *
8665
+ * @default false
8666
+ */
8667
+ exportFromIndex: boolean;
8668
+ /**
8669
+ * Name of the generated file.
8670
+ *
8671
+ * @default 'transformers'
8672
+ */
8673
+ output: string;
8674
+ /**
8675
+ * Custom transforms to apply to the generated code.
8676
+ */
8677
+ transformers: ReadonlyArray<ExpressionTransformer>;
8678
+ /**
8679
+ * Custom type transformers that modify the TypeScript types generated.
8680
+ */
8681
+ typeTransformers: ReadonlyArray<TypeTransformer>;
8682
+ };
8683
+
8684
+ type HeyApiTransformersPlugin = DefinePlugin<UserConfig$a, Config$9, IApi$a>;
8702
8685
 
8703
8686
  type EnumsType = 'javascript' | 'typescript' | 'typescript-const';
8704
8687
 
@@ -9191,9 +9174,9 @@ interface PluginState {
9191
9174
  usedTypeIDs: Set<string>;
9192
9175
  }
9193
9176
 
9194
- type HeyApiTypeScriptPlugin = DefinePlugin<UserConfig$9, Config$8, Api$2>;
9177
+ type HeyApiTypeScriptPlugin = DefinePlugin<UserConfig$9, Config$8, IApi$9>;
9195
9178
 
9196
- type OnRef = (id: string) => void;
9179
+ type OnRef = (symbol: ICodegenSymbolOut) => void;
9197
9180
  declare const schemaToType: ({ onRef, plugin, schema, state, }: {
9198
9181
  /**
9199
9182
  * Callback that can be used to perform side-effects when we encounter a
@@ -9205,18 +9188,43 @@ declare const schemaToType: ({ onRef, plugin, schema, state, }: {
9205
9188
  state: PluginState;
9206
9189
  }) => typescript__default.TypeNode;
9207
9190
 
9208
- type GetIdArgs$1 = {
9209
- type: 'ClientOptions' | 'Webhooks';
9210
- } | {
9211
- operation: IR$1.OperationObject;
9212
- type: 'data' | 'error' | 'errors' | 'response' | 'responses' | 'webhook-payload' | 'webhook-request';
9213
- } | {
9214
- type: 'ref';
9215
- value: string;
9191
+ type SelectorType$9 = 'ClientOptions' | 'data' | 'error' | 'errors' | 'ref' | 'response' | 'responses' | 'webhook-payload' | 'webhook-request' | 'Webhooks';
9192
+ type SchemaToTypeArgs = Omit<Parameters<typeof schemaToType>[0], 'onRef'> & Pick<Partial<Parameters<typeof schemaToType>[0]>, 'onRef'>;
9193
+ type IApi$9 = {
9194
+ /**
9195
+ * @param type Selector type.
9196
+ * @param value Depends on `type`:
9197
+ * - `ClientOptions`: never
9198
+ * - `data`: `operation.id` string
9199
+ * - `error`: `operation.id` string
9200
+ * - `errors`: `operation.id` string
9201
+ * - `ref`: `$ref` JSON pointer
9202
+ * - `response`: `operation.id` string
9203
+ * - `responses`: `operation.id` string
9204
+ * - `webhook-payload`: `operation.id` string
9205
+ * - `webhook-request`: `operation.id` string
9206
+ * - `Webhooks`: never
9207
+ * @returns Selector array
9208
+ */
9209
+ getSelector: (type: SelectorType$9, value?: string) => ICodegenSymbolSelector;
9210
+ schemaToType: (args: SchemaToTypeArgs) => typescript__default.TypeNode;
9216
9211
  };
9217
- type Api$2 = {
9218
- getId: (args: GetIdArgs$1) => string;
9219
- schemaToType: (args: Omit<Parameters<typeof schemaToType>[0], 'onRef'> & Pick<Partial<Parameters<typeof schemaToType>[0]>, 'onRef'>) => typescript__default.TypeNode;
9212
+
9213
+ type SelectorType$8 = '_JSONValue' | 'AxiosError' | 'createQueryKey' | 'queryOptionsFn' | 'QueryKey' | 'UseMutationOptions' | 'UseQueryOptions';
9214
+ type IApi$8 = {
9215
+ /**
9216
+ * @param type Selector type.
9217
+ * @param value Depends on `type`:
9218
+ * - `_JSONValue`: never
9219
+ * - `AxiosError`: never
9220
+ * - `createQueryKey`: never
9221
+ * - `queryOptionsFn`: `operation.id` string
9222
+ * - `QueryKey`: never
9223
+ * - `UseMutationOptions`: never
9224
+ * - `UseQueryOptions`: never
9225
+ * @returns Selector array
9226
+ */
9227
+ getSelector: (type: SelectorType$8, value?: string) => ICodegenSymbolSelector;
9220
9228
  };
9221
9229
 
9222
9230
  type UserConfig$8 = Plugin.Name<'@pinia/colada'> &
@@ -9245,14 +9253,6 @@ type UserConfig$8 = Plugin.Name<'@pinia/colada'> &
9245
9253
  * @default false
9246
9254
  */
9247
9255
  exportFromIndex?: boolean;
9248
- /**
9249
- * Group generated files by OpenAPI tags. When enabled, operations will be organized
9250
- * into separate files based on their tags, allowing for better code organization
9251
- * and tree-shaking.
9252
- *
9253
- * @default false
9254
- */
9255
- groupByTag?: boolean;
9256
9256
  /**
9257
9257
  * Configuration for generated mutation options helpers.
9258
9258
  *
@@ -9442,14 +9442,6 @@ type Config$7 = Plugin.Name<'@pinia/colada'> &
9442
9442
  * @default false
9443
9443
  */
9444
9444
  exportFromIndex: boolean;
9445
- /**
9446
- * Group generated files by OpenAPI tags. When enabled, operations will be organized
9447
- * into separate files based on their tags, allowing for better code organization
9448
- * and tree-shaking.
9449
- *
9450
- * @default false
9451
- */
9452
- groupByTag: boolean;
9453
9445
  /**
9454
9446
  * Resolved configuration for generated mutation options helpers.
9455
9447
  */
@@ -9591,7 +9583,28 @@ type Config$7 = Plugin.Name<'@pinia/colada'> &
9591
9583
  };
9592
9584
  };
9593
9585
 
9594
- type PiniaColadaPlugin = DefinePlugin<UserConfig$8, Config$7>;
9586
+ type PiniaColadaPlugin = DefinePlugin<UserConfig$8, Config$7, IApi$8>;
9587
+
9588
+ type SelectorType$7 = 'AxiosError' | 'createInfiniteParams' | 'createQueryKey' | 'DefaultError' | 'infiniteQueryOptions' | 'InfiniteData' | 'MutationOptions' | 'queryOptions' | 'queryOptionsFn' | 'QueryKey' | 'useQuery';
9589
+ type IApi$7 = {
9590
+ /**
9591
+ * @param type Selector type.
9592
+ * @param value Depends on `type`:
9593
+ * - `AxiosError`: never
9594
+ * - `createInfiniteParams`: never
9595
+ * - `createQueryKey`: never
9596
+ * - `DefaultError`: never
9597
+ * - `infiniteQueryOptions`: never
9598
+ * - `InfiniteData`: never
9599
+ * - `MutationOptions`: never
9600
+ * - `queryOptions`: never
9601
+ * - `queryOptionsFn`: `operation.id` string
9602
+ * - `QueryKey`: never
9603
+ * - `useQuery`: never
9604
+ * @returns Selector array
9605
+ */
9606
+ getSelector: (type: SelectorType$7, value?: string) => ICodegenSymbolSelector;
9607
+ };
9595
9608
 
9596
9609
  type UserConfig$7 = Plugin.Name<'@tanstack/angular-query-experimental'> &
9597
9610
  Plugin.Hooks & {
@@ -10146,7 +10159,28 @@ type Config$6 = Plugin.Name<'@tanstack/angular-query-experimental'> &
10146
10159
  };
10147
10160
  };
10148
10161
 
10149
- type TanStackAngularQueryPlugin = DefinePlugin<UserConfig$7, Config$6>;
10162
+ type TanStackAngularQueryPlugin = DefinePlugin<UserConfig$7, Config$6, IApi$7>;
10163
+
10164
+ type SelectorType$6 = 'AxiosError' | 'createInfiniteParams' | 'createQueryKey' | 'DefaultError' | 'infiniteQueryOptions' | 'InfiniteData' | 'MutationOptions' | 'queryOptions' | 'queryOptionsFn' | 'QueryKey' | 'useQuery';
10165
+ type IApi$6 = {
10166
+ /**
10167
+ * @param type Selector type.
10168
+ * @param value Depends on `type`:
10169
+ * - `AxiosError`: never
10170
+ * - `createInfiniteParams`: never
10171
+ * - `createQueryKey`: never
10172
+ * - `DefaultError`: never
10173
+ * - `infiniteQueryOptions`: never
10174
+ * - `InfiniteData`: never
10175
+ * - `MutationOptions`: never
10176
+ * - `queryOptions`: never
10177
+ * - `queryOptionsFn`: `operation.id` string
10178
+ * - `QueryKey`: never
10179
+ * - `useQuery`: never
10180
+ * @returns Selector array
10181
+ */
10182
+ getSelector: (type: SelectorType$6, value?: string) => ICodegenSymbolSelector;
10183
+ };
10150
10184
 
10151
10185
  type UserConfig$6 = Plugin.Name<'@tanstack/react-query'> &
10152
10186
  Plugin.Hooks & {
@@ -10779,7 +10813,28 @@ type Config$5 = Plugin.Name<'@tanstack/react-query'> &
10779
10813
  };
10780
10814
  };
10781
10815
 
10782
- type TanStackReactQueryPlugin = DefinePlugin<UserConfig$6, Config$5>;
10816
+ type TanStackReactQueryPlugin = DefinePlugin<UserConfig$6, Config$5, IApi$6>;
10817
+
10818
+ type SelectorType$5 = 'AxiosError' | 'createInfiniteParams' | 'createQueryKey' | 'DefaultError' | 'infiniteQueryOptions' | 'InfiniteData' | 'MutationOptions' | 'queryOptions' | 'queryOptionsFn' | 'QueryKey' | 'useQuery';
10819
+ type IApi$5 = {
10820
+ /**
10821
+ * @param type Selector type.
10822
+ * @param value Depends on `type`:
10823
+ * - `AxiosError`: never
10824
+ * - `createInfiniteParams`: never
10825
+ * - `createQueryKey`: never
10826
+ * - `DefaultError`: never
10827
+ * - `infiniteQueryOptions`: never
10828
+ * - `InfiniteData`: never
10829
+ * - `MutationOptions`: never
10830
+ * - `queryOptions`: never
10831
+ * - `queryOptionsFn`: `operation.id` string
10832
+ * - `QueryKey`: never
10833
+ * - `useQuery`: never
10834
+ * @returns Selector array
10835
+ */
10836
+ getSelector: (type: SelectorType$5, value?: string) => ICodegenSymbolSelector;
10837
+ };
10783
10838
 
10784
10839
  type UserConfig$5 = Plugin.Name<'@tanstack/solid-query'> &
10785
10840
  Plugin.Hooks & {
@@ -11335,7 +11390,28 @@ type Config$4 = Plugin.Name<'@tanstack/solid-query'> &
11335
11390
  };
11336
11391
  };
11337
11392
 
11338
- type TanStackSolidQueryPlugin = DefinePlugin<UserConfig$5, Config$4>;
11393
+ type TanStackSolidQueryPlugin = DefinePlugin<UserConfig$5, Config$4, IApi$5>;
11394
+
11395
+ type SelectorType$4 = 'AxiosError' | 'createInfiniteParams' | 'createQueryKey' | 'DefaultError' | 'infiniteQueryOptions' | 'InfiniteData' | 'MutationOptions' | 'queryOptions' | 'queryOptionsFn' | 'QueryKey' | 'useQuery';
11396
+ type IApi$4 = {
11397
+ /**
11398
+ * @param type Selector type.
11399
+ * @param value Depends on `type`:
11400
+ * - `AxiosError`: never
11401
+ * - `createInfiniteParams`: never
11402
+ * - `createQueryKey`: never
11403
+ * - `DefaultError`: never
11404
+ * - `infiniteQueryOptions`: never
11405
+ * - `InfiniteData`: never
11406
+ * - `MutationOptions`: never
11407
+ * - `queryOptions`: never
11408
+ * - `queryOptionsFn`: `operation.id` string
11409
+ * - `QueryKey`: never
11410
+ * - `useQuery`: never
11411
+ * @returns Selector array
11412
+ */
11413
+ getSelector: (type: SelectorType$4, value?: string) => ICodegenSymbolSelector;
11414
+ };
11339
11415
 
11340
11416
  type UserConfig$4 = Plugin.Name<'@tanstack/svelte-query'> &
11341
11417
  Plugin.Hooks & {
@@ -11890,7 +11966,28 @@ type Config$3 = Plugin.Name<'@tanstack/svelte-query'> &
11890
11966
  };
11891
11967
  };
11892
11968
 
11893
- type TanStackSvelteQueryPlugin = DefinePlugin<UserConfig$4, Config$3>;
11969
+ type TanStackSvelteQueryPlugin = DefinePlugin<UserConfig$4, Config$3, IApi$4>;
11970
+
11971
+ type SelectorType$3 = 'AxiosError' | 'createInfiniteParams' | 'createQueryKey' | 'DefaultError' | 'infiniteQueryOptions' | 'InfiniteData' | 'MutationOptions' | 'queryOptions' | 'queryOptionsFn' | 'QueryKey' | 'useQuery';
11972
+ type IApi$3 = {
11973
+ /**
11974
+ * @param type Selector type.
11975
+ * @param value Depends on `type`:
11976
+ * - `AxiosError`: never
11977
+ * - `createInfiniteParams`: never
11978
+ * - `createQueryKey`: never
11979
+ * - `DefaultError`: never
11980
+ * - `infiniteQueryOptions`: never
11981
+ * - `InfiniteData`: never
11982
+ * - `MutationOptions`: never
11983
+ * - `queryOptions`: never
11984
+ * - `queryOptionsFn`: `operation.id` string
11985
+ * - `QueryKey`: never
11986
+ * - `useQuery`: never
11987
+ * @returns Selector array
11988
+ */
11989
+ getSelector: (type: SelectorType$3, value?: string) => ICodegenSymbolSelector;
11990
+ };
11894
11991
 
11895
11992
  type UserConfig$3 = Plugin.Name<'@tanstack/vue-query'> &
11896
11993
  Plugin.Hooks & {
@@ -12451,7 +12548,18 @@ type Config$2 = Plugin.Name<'@tanstack/vue-query'> &
12451
12548
  };
12452
12549
  };
12453
12550
 
12454
- type TanStackVueQueryPlugin = DefinePlugin<UserConfig$3, Config$2>;
12551
+ type TanStackVueQueryPlugin = DefinePlugin<UserConfig$3, Config$2, IApi$3>;
12552
+
12553
+ type SelectorType$2 = 'RouteHandler';
12554
+ type IApi$2 = {
12555
+ /**
12556
+ * @param type Selector type.
12557
+ * @param value Depends on `type`:
12558
+ * - `RouteHandler`: never
12559
+ * @returns Selector array
12560
+ */
12561
+ getSelector: (type: SelectorType$2, value?: string) => ICodegenSymbolSelector;
12562
+ };
12455
12563
 
12456
12564
  type UserConfig$2 = Plugin.Name<'fastify'> & {
12457
12565
  /**
@@ -12469,7 +12577,7 @@ type UserConfig$2 = Plugin.Name<'fastify'> & {
12469
12577
  output?: string;
12470
12578
  };
12471
12579
 
12472
- type FastifyPlugin = DefinePlugin<UserConfig$2>;
12580
+ type FastifyPlugin = DefinePlugin<UserConfig$2, UserConfig$2, IApi$2>;
12473
12581
 
12474
12582
  type UserConfig$1 = Plugin.Name<'valibot'> & {
12475
12583
  /**
@@ -12791,19 +12899,28 @@ type Config$1 = Plugin.Name<'valibot'> & {
12791
12899
  };
12792
12900
  };
12793
12901
 
12794
- type ValibotPlugin = DefinePlugin<UserConfig$1, Config$1, Api$1>;
12795
-
12796
- type Api$1 = {
12797
- createRequestValidator: (args: {
12798
- file: GeneratedFile;
12799
- operation: IR$1.OperationObject;
12800
- plugin: ValibotPlugin['Instance'];
12801
- }) => typescript__default.ArrowFunction | undefined;
12802
- createResponseValidator: (args: {
12803
- file: GeneratedFile;
12804
- operation: IR$1.OperationObject;
12805
- plugin: ValibotPlugin['Instance'];
12806
- }) => typescript__default.ArrowFunction | undefined;
12902
+ type ValibotPlugin = DefinePlugin<UserConfig$1, Config$1, IApi$1>;
12903
+
12904
+ type SelectorType$1 = 'data' | 'import' | 'ref' | 'responses' | 'webhook-request';
12905
+ type ValidatorArgs$1 = {
12906
+ file: ICodegenFile;
12907
+ operation: IR$1.OperationObject;
12908
+ plugin: ValibotPlugin['Instance'];
12909
+ };
12910
+ type IApi$1 = {
12911
+ createRequestValidator: (args: ValidatorArgs$1) => typescript__default.ArrowFunction | undefined;
12912
+ createResponseValidator: (args: ValidatorArgs$1) => typescript__default.ArrowFunction | undefined;
12913
+ /**
12914
+ * @param type Selector type.
12915
+ * @param value Depends on `type`:
12916
+ * - `data`: `operation.id` string
12917
+ * - `import`: headless symbols representing module imports
12918
+ * - `ref`: `$ref` JSON pointer
12919
+ * - `responses`: `operation.id` string
12920
+ * - `webhook-request`: `operation.id` string
12921
+ * @returns Selector array
12922
+ */
12923
+ getSelector: (type: SelectorType$1, value?: string) => ICodegenSymbolSelector;
12807
12924
  };
12808
12925
 
12809
12926
  type UserConfig = Plugin.Name<'zod'> & {
@@ -13552,27 +13669,32 @@ type Config = Plugin.Name<'zod'> & {
13552
13669
  };
13553
13670
  };
13554
13671
 
13555
- type ZodPlugin = DefinePlugin<UserConfig, Config, Api>;
13672
+ type ZodPlugin = DefinePlugin<UserConfig, Config, IApi>;
13556
13673
 
13557
- type GetIdArgs = {
13674
+ type SelectorType = 'data' | 'import' | 'ref' | 'responses' | 'type-infer-data' | 'type-infer-ref' | 'type-infer-responses' | 'type-infer-webhook-request' | 'webhook-request';
13675
+ type ValidatorArgs = {
13676
+ file: ICodegenFile;
13558
13677
  operation: IR$1.OperationObject;
13559
- type: 'data' | 'responses' | 'type-infer-data' | 'type-infer-responses' | 'type-infer-webhook-request' | 'webhook-request';
13560
- } | {
13561
- type: 'ref' | 'type-infer-ref';
13562
- value: string;
13678
+ plugin: ZodPlugin['Instance'];
13563
13679
  };
13564
- type Api = {
13565
- createRequestValidator: (args: {
13566
- file: GeneratedFile;
13567
- operation: IR$1.OperationObject;
13568
- plugin: ZodPlugin['Instance'];
13569
- }) => typescript__default.ArrowFunction | undefined;
13570
- createResponseValidator: (args: {
13571
- file: GeneratedFile;
13572
- operation: IR$1.OperationObject;
13573
- plugin: ZodPlugin['Instance'];
13574
- }) => typescript__default.ArrowFunction | undefined;
13575
- getId: (args: GetIdArgs) => string;
13680
+ type IApi = {
13681
+ createRequestValidator: (args: ValidatorArgs) => typescript__default.ArrowFunction | undefined;
13682
+ createResponseValidator: (args: ValidatorArgs) => typescript__default.ArrowFunction | undefined;
13683
+ /**
13684
+ * @param type Selector type.
13685
+ * @param value Depends on `type`:
13686
+ * - `data`: `operation.id` string
13687
+ * - `import`: headless symbols representing module imports
13688
+ * - `ref`: `$ref` JSON pointer
13689
+ * - `responses`: `operation.id` string
13690
+ * - `type-infer-data`: `operation.id` string
13691
+ * - `type-infer-ref`: `$ref` JSON pointer
13692
+ * - `type-infer-responses`: `operation.id` string
13693
+ * - `type-infer-webhook-request`: `operation.id` string
13694
+ * - `webhook-request`: `operation.id` string
13695
+ * @returns Selector array
13696
+ */
13697
+ getSelector: (type: SelectorType, value?: string) => ICodegenSymbolSelector;
13576
13698
  };
13577
13699
 
13578
13700
  interface PluginConfigMap {
@@ -13607,7 +13729,7 @@ declare class IRContext<Spec extends Record<string, any> = any> {
13607
13729
  * Configuration for parsing and generating the output. This
13608
13730
  * is a mix of user-provided and default values.
13609
13731
  */
13610
- config: Config$b;
13732
+ config: Config$c;
13611
13733
  /**
13612
13734
  * A map of files that will be generated from `spec`.
13613
13735
  */
@@ -13637,7 +13759,7 @@ declare class IRContext<Spec extends Record<string, any> = any> {
13637
13759
  */
13638
13760
  spec: Spec;
13639
13761
  constructor({ config, dependencies, logger, spec, }: {
13640
- config: Config$b;
13762
+ config: Config$c;
13641
13763
  dependencies: Record<string, string>;
13642
13764
  logger: Logger;
13643
13765
  spec: Spec;
@@ -13700,10 +13822,6 @@ interface IRComponentsObject {
13700
13822
  }
13701
13823
 
13702
13824
  interface IRContextFile {
13703
- /**
13704
- * Define casing for identifiers in this file.
13705
- */
13706
- case?: StringCase;
13707
13825
  /**
13708
13826
  * Should the exports from this file be re-exported in the index barrel file?
13709
13827
  */
@@ -14022,4 +14140,4 @@ interface WatchValues {
14022
14140
  lastValue?: string;
14023
14141
  }
14024
14142
 
14025
- export { type Comments as C, type DefinePlugin as D, type ExpressionTransformer as E, type ImportExportItemObject as I, Logger as L, OpenApi$3 as O, type PluginHandler as P, type StringCase as S, type TypeTransformer as T, type UserConfig$o as U, type WatchValues as W, Plugin as a, type Client$1 as b, IR$1 as c, OpenApiMetaObject as d, OpenApiOperationObject as e, OpenApiParameterObject as f, OpenApiRequestBodyObject as g, OpenApiResponseObject as h, OpenApiSchemaObject as i, Client as j, LegacyIR as k, type Config$b as l, tsNodeToString as t };
14143
+ export { type Comments as C, type DefinePlugin as D, type ExpressionTransformer as E, type ImportExportItemObject as I, Logger as L, OpenApi$3 as O, type PluginHandler as P, type StringCase as S, type TypeTransformer as T, type UserConfig$o as U, type WatchValues as W, Plugin as a, type Client$1 as b, IR$1 as c, OpenApiMetaObject as d, OpenApiOperationObject as e, OpenApiParameterObject as f, OpenApiRequestBodyObject as g, OpenApiResponseObject as h, OpenApiSchemaObject as i, Client as j, LegacyIR as k, type Config$c as l, tsNodeToString as t };