@hey-api/openapi-ts 0.77.0 → 0.78.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.
- package/README.md +18 -14
- package/dist/chunk-RASXZ2HF.js +39 -0
- package/dist/chunk-RASXZ2HF.js.map +1 -0
- package/dist/index.cjs +65 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +171 -171
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +11 -11
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +10 -3
- package/dist/internal.d.ts +10 -3
- package/dist/internal.js +1 -1
- package/dist/{types.d-CBVwu8Hi.d.cts → types.d-BsTxgeRq.d.cts} +682 -302
- package/dist/{types.d-CBVwu8Hi.d.ts → types.d-BsTxgeRq.d.ts} +682 -302
- package/package.json +1 -1
- package/dist/chunk-EH476QS3.js +0 -39
- package/dist/chunk-EH476QS3.js.map +0 -1
|
@@ -2639,6 +2639,205 @@ interface EnsureUniqueIdentifierData {
|
|
|
2639
2639
|
namespace: Namespace;
|
|
2640
2640
|
}
|
|
2641
2641
|
|
|
2642
|
+
type ObjectType<T> = Extract<T, Record<string, any>> extends never ? Record<string, any> : Extract<T, Record<string, any>>;
|
|
2643
|
+
type ValueToObject = <T extends undefined | string | boolean | number | Record<string, any>>(args: {
|
|
2644
|
+
defaultValue: ObjectType<T>;
|
|
2645
|
+
mappers: {
|
|
2646
|
+
boolean: T extends boolean ? (value: boolean) => Partial<ObjectType<T>> : never;
|
|
2647
|
+
number: T extends number ? (value: number) => Partial<ObjectType<T>> : never;
|
|
2648
|
+
object?: (value: Partial<ObjectType<T>>) => Partial<ObjectType<T>>;
|
|
2649
|
+
string: T extends string ? (value: string) => Partial<ObjectType<T>> : never;
|
|
2650
|
+
} extends infer U ? {
|
|
2651
|
+
[K in keyof U as U[K] extends never ? never : K]: U[K];
|
|
2652
|
+
} : never;
|
|
2653
|
+
value: T;
|
|
2654
|
+
}) => ObjectType<T>;
|
|
2655
|
+
|
|
2656
|
+
type Input = {
|
|
2657
|
+
/**
|
|
2658
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2659
|
+
*
|
|
2660
|
+
* Projects are private by default, you will need to be authenticated
|
|
2661
|
+
* to download OpenAPI specifications. We recommend using project API
|
|
2662
|
+
* keys in CI workflows and personal API keys for local development.
|
|
2663
|
+
*
|
|
2664
|
+
* API key isn't required for public projects. You can also omit this
|
|
2665
|
+
* parameter and provide an environment variable `HEY_API_TOKEN`.
|
|
2666
|
+
*/
|
|
2667
|
+
api_key?: string;
|
|
2668
|
+
/**
|
|
2669
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2670
|
+
*
|
|
2671
|
+
* You can fetch the last build from branch by providing the branch
|
|
2672
|
+
* name.
|
|
2673
|
+
*/
|
|
2674
|
+
branch?: string;
|
|
2675
|
+
/**
|
|
2676
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2677
|
+
*
|
|
2678
|
+
* You can fetch an exact specification by providing a commit sha.
|
|
2679
|
+
* This will always return the same file.
|
|
2680
|
+
*/
|
|
2681
|
+
commit_sha?: string;
|
|
2682
|
+
/**
|
|
2683
|
+
* You can pass any valid Fetch API options to the request for fetching your
|
|
2684
|
+
* specification. This is useful if your file is behind auth for example.
|
|
2685
|
+
*/
|
|
2686
|
+
fetch?: RequestInit;
|
|
2687
|
+
/**
|
|
2688
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2689
|
+
*
|
|
2690
|
+
* Organization created in Hey API Platform.
|
|
2691
|
+
*/
|
|
2692
|
+
organization?: string;
|
|
2693
|
+
/**
|
|
2694
|
+
* Path to the OpenAPI specification. This can be either local or remote path.
|
|
2695
|
+
* Both JSON and YAML file formats are supported. You can also pass the parsed
|
|
2696
|
+
* object directly if you're fetching the file yourself.
|
|
2697
|
+
*/
|
|
2698
|
+
path?:
|
|
2699
|
+
| 'https://get.heyapi.dev/<organization>/<project>'
|
|
2700
|
+
| (string & {})
|
|
2701
|
+
| Record<string, unknown>;
|
|
2702
|
+
/**
|
|
2703
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2704
|
+
*
|
|
2705
|
+
* Project created in Hey API Platform.
|
|
2706
|
+
*/
|
|
2707
|
+
project?: string;
|
|
2708
|
+
/**
|
|
2709
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2710
|
+
*
|
|
2711
|
+
* If you're tagging your specifications with custom tags, you can use
|
|
2712
|
+
* them to filter the results. When you provide multiple tags, only
|
|
2713
|
+
* the first match will be returned.
|
|
2714
|
+
*/
|
|
2715
|
+
tags?: ReadonlyArray<string>;
|
|
2716
|
+
/**
|
|
2717
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2718
|
+
*
|
|
2719
|
+
* Every OpenAPI document contains a required version field. You can
|
|
2720
|
+
* use this value to fetch the last uploaded specification matching
|
|
2721
|
+
* the value.
|
|
2722
|
+
*/
|
|
2723
|
+
version?: string;
|
|
2724
|
+
/**
|
|
2725
|
+
* Regenerate the client when the input file changes? You can alternatively
|
|
2726
|
+
* pass a numeric value for the interval in ms.
|
|
2727
|
+
*
|
|
2728
|
+
* @default false
|
|
2729
|
+
*/
|
|
2730
|
+
watch?: boolean | number | Watch;
|
|
2731
|
+
};
|
|
2732
|
+
|
|
2733
|
+
type Watch = {
|
|
2734
|
+
/**
|
|
2735
|
+
* Regenerate the client when the input file changes?
|
|
2736
|
+
*
|
|
2737
|
+
* @default false
|
|
2738
|
+
*/
|
|
2739
|
+
enabled?: boolean;
|
|
2740
|
+
/**
|
|
2741
|
+
* How often should we attempt to detect the input file change? (in ms)
|
|
2742
|
+
*
|
|
2743
|
+
* @default 1000
|
|
2744
|
+
*/
|
|
2745
|
+
interval?: number;
|
|
2746
|
+
/**
|
|
2747
|
+
* How long will we wait before the request times out?
|
|
2748
|
+
*
|
|
2749
|
+
* @default 60_000
|
|
2750
|
+
*/
|
|
2751
|
+
timeout?: number;
|
|
2752
|
+
};
|
|
2753
|
+
|
|
2754
|
+
type Logs = {
|
|
2755
|
+
/**
|
|
2756
|
+
* Whether or not error logs should be written to a file or not
|
|
2757
|
+
*
|
|
2758
|
+
* @default true
|
|
2759
|
+
* */
|
|
2760
|
+
file?: boolean;
|
|
2761
|
+
/**
|
|
2762
|
+
* The logging level to control the verbosity of log output.
|
|
2763
|
+
* Determines which messages are logged based on their severity.
|
|
2764
|
+
*
|
|
2765
|
+
* Available levels (in increasing order of severity):
|
|
2766
|
+
* - `trace`: Detailed debug information, primarily for development.
|
|
2767
|
+
* - `debug`: Diagnostic information useful during debugging.
|
|
2768
|
+
* - `info`: General operational messages that indicate normal application behavior.
|
|
2769
|
+
* - `warn`: Potentially problematic situations that require attention.
|
|
2770
|
+
* - `error`: Errors that prevent some functionality but do not crash the application.
|
|
2771
|
+
* - `fatal`: Critical errors that cause the application to terminate.
|
|
2772
|
+
* - `silent`: Disables all logging.
|
|
2773
|
+
*
|
|
2774
|
+
* Messages with a severity equal to or higher than the specified level will be logged.
|
|
2775
|
+
*
|
|
2776
|
+
* @default 'info'
|
|
2777
|
+
*/
|
|
2778
|
+
level?: 'debug' | 'error' | 'fatal' | 'info' | 'silent' | 'trace' | 'warn';
|
|
2779
|
+
/**
|
|
2780
|
+
* The relative location of the logs folder
|
|
2781
|
+
*
|
|
2782
|
+
* @default process.cwd()
|
|
2783
|
+
*/
|
|
2784
|
+
path?: string;
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2787
|
+
type Formatters = 'biome' | 'prettier';
|
|
2788
|
+
|
|
2789
|
+
type Linters = 'biome' | 'eslint' | 'oxlint';
|
|
2790
|
+
|
|
2791
|
+
type Output = {
|
|
2792
|
+
/**
|
|
2793
|
+
* Defines casing of the output fields. By default, we preserve `input`
|
|
2794
|
+
* values as data transforms incur a performance penalty at runtime.
|
|
2795
|
+
*
|
|
2796
|
+
* @default undefined
|
|
2797
|
+
*/
|
|
2798
|
+
case?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
2799
|
+
/**
|
|
2800
|
+
* Clean the `output` folder on every run? If disabled, this folder may
|
|
2801
|
+
* be used to store additional files. The default option is `true` to
|
|
2802
|
+
* reduce the risk of keeping outdated files around when configuration,
|
|
2803
|
+
* input, or package version changes.
|
|
2804
|
+
*
|
|
2805
|
+
* @default true
|
|
2806
|
+
*/
|
|
2807
|
+
clean?: boolean;
|
|
2808
|
+
/**
|
|
2809
|
+
* Process output folder with formatter?
|
|
2810
|
+
*
|
|
2811
|
+
* @default false
|
|
2812
|
+
*/
|
|
2813
|
+
format?: Formatters | false;
|
|
2814
|
+
/**
|
|
2815
|
+
* Should the exports from plugin files be re-exported in the index
|
|
2816
|
+
* barrel file? By default, this is enabled and only default plugins
|
|
2817
|
+
* are re-exported.
|
|
2818
|
+
*
|
|
2819
|
+
* @default true
|
|
2820
|
+
*/
|
|
2821
|
+
indexFile?: boolean;
|
|
2822
|
+
/**
|
|
2823
|
+
* Process output folder with linter?
|
|
2824
|
+
*
|
|
2825
|
+
* @default false
|
|
2826
|
+
*/
|
|
2827
|
+
lint?: Linters | false;
|
|
2828
|
+
/**
|
|
2829
|
+
* The relative location of the output folder
|
|
2830
|
+
*/
|
|
2831
|
+
path: string;
|
|
2832
|
+
/**
|
|
2833
|
+
* Relative or absolute path to the tsconfig file we should use to
|
|
2834
|
+
* generate the output. If a path to tsconfig file is not provided, we
|
|
2835
|
+
* attempt to find one starting from the location of the
|
|
2836
|
+
* `@hey-api/openapi-ts` configuration file and traversing up.
|
|
2837
|
+
*/
|
|
2838
|
+
tsConfigPath?: 'off' | (string & {});
|
|
2839
|
+
};
|
|
2840
|
+
|
|
2642
2841
|
interface JsonSchemaDraft4 extends EnumExtensions {
|
|
2643
2842
|
/**
|
|
2644
2843
|
* 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}.
|
|
@@ -4396,6 +4595,7 @@ interface XMLObject$1 {
|
|
|
4396
4595
|
|
|
4397
4596
|
interface OpenApiV2_0_XTypes {
|
|
4398
4597
|
InfoObject: InfoObject$1;
|
|
4598
|
+
OperationObject: OperationObject$1;
|
|
4399
4599
|
SchemaObject: SchemaObject$1;
|
|
4400
4600
|
}
|
|
4401
4601
|
|
|
@@ -5682,6 +5882,7 @@ type Format = JsonSchemaFormats | OpenApiSchemaFormats | (string & {});
|
|
|
5682
5882
|
|
|
5683
5883
|
interface OpenApiV3_0_XTypes {
|
|
5684
5884
|
InfoObject: InfoObject;
|
|
5885
|
+
OperationObject: OperationObject;
|
|
5685
5886
|
ParameterObject: ParameterObject;
|
|
5686
5887
|
ReferenceObject: ReferenceObject;
|
|
5687
5888
|
RequestBodyObject: RequestBodyObject;
|
|
@@ -5691,6 +5892,7 @@ interface OpenApiV3_0_XTypes {
|
|
|
5691
5892
|
|
|
5692
5893
|
interface OpenApiV3_1_XTypes {
|
|
5693
5894
|
InfoObject: InfoObject$2;
|
|
5895
|
+
OperationObject: OperationObject$2;
|
|
5694
5896
|
ParameterObject: ParameterObject$2;
|
|
5695
5897
|
ReferenceObject: ReferenceObject$2;
|
|
5696
5898
|
RequestBodyObject: RequestBodyObject$1;
|
|
@@ -5714,6 +5916,14 @@ declare namespace OpenApiMetaObject {
|
|
|
5714
5916
|
export type V3_1_X = OpenApiV3_1_XTypes['InfoObject'];
|
|
5715
5917
|
}
|
|
5716
5918
|
|
|
5919
|
+
declare namespace OpenApiOperationObject {
|
|
5920
|
+
export type V2_0_X = OpenApiV2_0_XTypes['OperationObject'];
|
|
5921
|
+
|
|
5922
|
+
export type V3_0_X = OpenApiV3_0_XTypes['OperationObject'];
|
|
5923
|
+
|
|
5924
|
+
export type V3_1_X = OpenApiV3_1_XTypes['OperationObject'];
|
|
5925
|
+
}
|
|
5926
|
+
|
|
5717
5927
|
declare namespace OpenApiParameterObject {
|
|
5718
5928
|
export type V3_0_X =
|
|
5719
5929
|
| OpenApiV3_0_XTypes['ParameterObject']
|
|
@@ -5752,48 +5962,14 @@ declare namespace OpenApiSchemaObject {
|
|
|
5752
5962
|
export type V3_1_X = OpenApiV3_1_XTypes['SchemaObject'];
|
|
5753
5963
|
}
|
|
5754
5964
|
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
*
|
|
5759
|
-
* Projects are private by default, you will need to be authenticated
|
|
5760
|
-
* to download OpenAPI specifications. We recommend using project API
|
|
5761
|
-
* keys in CI workflows and personal API keys for local development.
|
|
5762
|
-
*
|
|
5763
|
-
* API key isn't required for public projects. You can also omit this
|
|
5764
|
-
* parameter and provide an environment variable `HEY_API_TOKEN`.
|
|
5765
|
-
*/
|
|
5766
|
-
api_key?: string;
|
|
5767
|
-
/**
|
|
5768
|
-
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
5769
|
-
*
|
|
5770
|
-
* You can fetch the last build from branch by providing the branch
|
|
5771
|
-
* name.
|
|
5772
|
-
*/
|
|
5773
|
-
branch?: string;
|
|
5774
|
-
/**
|
|
5775
|
-
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
5776
|
-
*
|
|
5777
|
-
* You can fetch an exact specification by providing a commit sha.
|
|
5778
|
-
* This will always return the same file.
|
|
5779
|
-
*/
|
|
5780
|
-
commit_sha?: string;
|
|
5781
|
-
/**
|
|
5782
|
-
* You pass any valid Fetch API options to the request for fetching your
|
|
5783
|
-
* specification. This is useful if your file is behind auth for example.
|
|
5784
|
-
*/
|
|
5785
|
-
fetch?: RequestInit;
|
|
5965
|
+
type EnumsMode = 'inline' | 'root';
|
|
5966
|
+
|
|
5967
|
+
type Parser = {
|
|
5786
5968
|
/**
|
|
5787
|
-
* Filters can be used to select a subset of your input before it's
|
|
5788
|
-
*
|
|
5969
|
+
* Filters can be used to select a subset of your input before it's passed
|
|
5970
|
+
* to plugins.
|
|
5789
5971
|
*/
|
|
5790
5972
|
filters?: Filters;
|
|
5791
|
-
/**
|
|
5792
|
-
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
5793
|
-
*
|
|
5794
|
-
* Organization created in Hey API platform.
|
|
5795
|
-
*/
|
|
5796
|
-
organization?: string;
|
|
5797
5973
|
/**
|
|
5798
5974
|
* Pagination configuration.
|
|
5799
5975
|
*/
|
|
@@ -5807,33 +5983,129 @@ interface Input {
|
|
|
5807
5983
|
keywords?: ReadonlyArray<string>;
|
|
5808
5984
|
};
|
|
5809
5985
|
/**
|
|
5810
|
-
* Custom input transformations to execute before parsing.
|
|
5811
|
-
* to modify, fix, or enhance input
|
|
5986
|
+
* Custom input transformations to execute before parsing. Use this
|
|
5987
|
+
* to modify, fix, or enhance input before it's passed to plugins.
|
|
5812
5988
|
*/
|
|
5813
5989
|
patch?: Patch;
|
|
5814
5990
|
/**
|
|
5815
|
-
*
|
|
5816
|
-
*
|
|
5817
|
-
*
|
|
5818
|
-
|
|
5819
|
-
path?:
|
|
5820
|
-
| 'https://get.heyapi.dev/<organization>/<project>'
|
|
5821
|
-
| (string & {})
|
|
5822
|
-
| Record<string, unknown>;
|
|
5823
|
-
/**
|
|
5824
|
-
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
5825
|
-
*
|
|
5826
|
-
* Project created in Hey API platform.
|
|
5827
|
-
*/
|
|
5828
|
-
project?: string;
|
|
5829
|
-
/**
|
|
5830
|
-
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
5831
|
-
*
|
|
5832
|
-
* If you're tagging your specifications with custom tags, you can use
|
|
5833
|
-
* them to filter the results. When you provide multiple tags, only
|
|
5834
|
-
* the first match will be returned.
|
|
5991
|
+
* Built-in transformations that modify or normalize the input before it's
|
|
5992
|
+
* passed to plugins. These options enable predictable, documented behaviors
|
|
5993
|
+
* and are distinct from custom patches. Use this to perform structural
|
|
5994
|
+
* changes to input in a standardized way.
|
|
5835
5995
|
*/
|
|
5836
|
-
|
|
5996
|
+
transforms?: {
|
|
5997
|
+
/**
|
|
5998
|
+
* Your input might contain two types of enums:
|
|
5999
|
+
* - enums defined as reusable components (root enums)
|
|
6000
|
+
* - non-reusable enums nested within other schemas (inline enums)
|
|
6001
|
+
*
|
|
6002
|
+
* You may want all enums to be reusable. This is because only root enums
|
|
6003
|
+
* are typically exported by plugins. Inline enums will never be directly
|
|
6004
|
+
* importable since they're nested inside other schemas.
|
|
6005
|
+
*
|
|
6006
|
+
* For example, to export nested enum types with the `@hey-api/typescript`
|
|
6007
|
+
* plugin, set `enums` to `root`. Likewise, if you don't want to export any
|
|
6008
|
+
* enum types, set `enums` to `inline`.
|
|
6009
|
+
*
|
|
6010
|
+
* @default false
|
|
6011
|
+
*/
|
|
6012
|
+
enums?:
|
|
6013
|
+
| boolean
|
|
6014
|
+
| EnumsMode
|
|
6015
|
+
| {
|
|
6016
|
+
/**
|
|
6017
|
+
* The casing convention to use for generated names.
|
|
6018
|
+
*
|
|
6019
|
+
* @default 'PascalCase'
|
|
6020
|
+
*/
|
|
6021
|
+
case?: StringCase;
|
|
6022
|
+
/**
|
|
6023
|
+
* Whether to transform all enums.
|
|
6024
|
+
*
|
|
6025
|
+
* @default true
|
|
6026
|
+
*/
|
|
6027
|
+
enabled?: boolean;
|
|
6028
|
+
/**
|
|
6029
|
+
* Controls whether enums are promoted to reusable root components
|
|
6030
|
+
* ('root') or kept inline within schemas ('inline').
|
|
6031
|
+
*
|
|
6032
|
+
* @default 'root'
|
|
6033
|
+
*/
|
|
6034
|
+
mode?: EnumsMode;
|
|
6035
|
+
/**
|
|
6036
|
+
* Customize the generated name of enums.
|
|
6037
|
+
*
|
|
6038
|
+
* @default '{{name}}Enum'
|
|
6039
|
+
*/
|
|
6040
|
+
name?: string | ((name: string) => string);
|
|
6041
|
+
};
|
|
6042
|
+
/**
|
|
6043
|
+
* Your schemas might contain read-only or write-only fields. Using such
|
|
6044
|
+
* schemas directly could mean asking the user to provide a read-only
|
|
6045
|
+
* field in requests, or expecting a write-only field in responses.
|
|
6046
|
+
*
|
|
6047
|
+
* We separate schemas for requests and responses if direct usage
|
|
6048
|
+
* would result in such scenarios. You can still disable this
|
|
6049
|
+
* behavior if you prefer.
|
|
6050
|
+
*
|
|
6051
|
+
* @default true
|
|
6052
|
+
*/
|
|
6053
|
+
readWrite?:
|
|
6054
|
+
| boolean
|
|
6055
|
+
| {
|
|
6056
|
+
/**
|
|
6057
|
+
* Whether to split read-only and write-only schemas.
|
|
6058
|
+
*
|
|
6059
|
+
* @default true
|
|
6060
|
+
*/
|
|
6061
|
+
enabled?: boolean;
|
|
6062
|
+
/**
|
|
6063
|
+
* Configuration for generated request-specific schemas.
|
|
6064
|
+
*
|
|
6065
|
+
* @default '{{name}}Writable'
|
|
6066
|
+
*/
|
|
6067
|
+
requests?:
|
|
6068
|
+
| string
|
|
6069
|
+
| {
|
|
6070
|
+
/**
|
|
6071
|
+
* The casing convention to use for generated names.
|
|
6072
|
+
*
|
|
6073
|
+
* @default 'preserve'
|
|
6074
|
+
*/
|
|
6075
|
+
case?: StringCase;
|
|
6076
|
+
/**
|
|
6077
|
+
* Customize the generated name of schemas used in requests or
|
|
6078
|
+
* containing write-only fields.
|
|
6079
|
+
*
|
|
6080
|
+
* @default '{{name}}Writable'
|
|
6081
|
+
*/
|
|
6082
|
+
name?: string | ((name: string) => string);
|
|
6083
|
+
};
|
|
6084
|
+
/**
|
|
6085
|
+
* Configuration for generated response-specific schemas.
|
|
6086
|
+
*
|
|
6087
|
+
* @default '{{name}}'
|
|
6088
|
+
*/
|
|
6089
|
+
responses?:
|
|
6090
|
+
| string
|
|
6091
|
+
| {
|
|
6092
|
+
/**
|
|
6093
|
+
* The casing convention to use for generated names.
|
|
6094
|
+
*
|
|
6095
|
+
* @default 'preserve'
|
|
6096
|
+
*/
|
|
6097
|
+
case?: StringCase;
|
|
6098
|
+
/**
|
|
6099
|
+
* Customize the generated name of schemas used in responses or
|
|
6100
|
+
* containing read-only fields. We default to the original name
|
|
6101
|
+
* to avoid breaking output when a read-only field is added.
|
|
6102
|
+
*
|
|
6103
|
+
* @default '{{name}}'
|
|
6104
|
+
*/
|
|
6105
|
+
name?: string | ((name: string) => string);
|
|
6106
|
+
};
|
|
6107
|
+
};
|
|
6108
|
+
};
|
|
5837
6109
|
/**
|
|
5838
6110
|
* **This is an experimental feature.**
|
|
5839
6111
|
*
|
|
@@ -5844,24 +6116,146 @@ interface Input {
|
|
|
5844
6116
|
* @default false
|
|
5845
6117
|
*/
|
|
5846
6118
|
validate_EXPERIMENTAL?: boolean | 'strict' | 'warn';
|
|
6119
|
+
};
|
|
6120
|
+
|
|
6121
|
+
type ResolvedParser = {
|
|
5847
6122
|
/**
|
|
5848
|
-
*
|
|
5849
|
-
*
|
|
5850
|
-
* Every OpenAPI document contains a required version field. You can
|
|
5851
|
-
* use this value to fetch the last uploaded specification matching
|
|
5852
|
-
* the value.
|
|
6123
|
+
* Filters can be used to select a subset of your input before it's passed
|
|
6124
|
+
* to plugins.
|
|
5853
6125
|
*/
|
|
5854
|
-
|
|
6126
|
+
filters?: Filters;
|
|
5855
6127
|
/**
|
|
5856
|
-
*
|
|
5857
|
-
|
|
6128
|
+
* Pagination configuration.
|
|
6129
|
+
*/
|
|
6130
|
+
pagination: {
|
|
6131
|
+
/**
|
|
6132
|
+
* Array of keywords to be considered as pagination field names.
|
|
6133
|
+
* These will be used to detect pagination fields in schemas and parameters.
|
|
6134
|
+
*
|
|
6135
|
+
* @default ['after', 'before', 'cursor', 'offset', 'page', 'start']
|
|
6136
|
+
*/
|
|
6137
|
+
keywords: ReadonlyArray<string>;
|
|
6138
|
+
};
|
|
6139
|
+
/**
|
|
6140
|
+
* Custom input transformations to execute before parsing. Use this
|
|
6141
|
+
* to modify, fix, or enhance input before it's passed to plugins.
|
|
6142
|
+
*/
|
|
6143
|
+
patch?: Patch;
|
|
6144
|
+
/**
|
|
6145
|
+
* Built-in transformations that modify or normalize the input before it's
|
|
6146
|
+
* passed to plugins. These options enable predictable, documented behaviors
|
|
6147
|
+
* and are distinct from custom patches. Use this to perform structural
|
|
6148
|
+
* changes to input in a standardized way.
|
|
6149
|
+
*/
|
|
6150
|
+
transforms: {
|
|
6151
|
+
/**
|
|
6152
|
+
* Your input might contain two types of enums:
|
|
6153
|
+
* - enums defined as reusable components (root enums)
|
|
6154
|
+
* - non-reusable enums nested within other schemas (inline enums)
|
|
6155
|
+
*
|
|
6156
|
+
* You may want all enums to be reusable. This is because only root enums
|
|
6157
|
+
* are typically exported by plugins. Inline enums will never be directly
|
|
6158
|
+
* importable since they're nested inside other schemas.
|
|
6159
|
+
*
|
|
6160
|
+
* For example, to export nested enum types with the `@hey-api/typescript`
|
|
6161
|
+
* plugin, set `enums` to `root`. Likewise, if you don't want to export any
|
|
6162
|
+
* enum types, set `enums` to `inline`.
|
|
6163
|
+
*/
|
|
6164
|
+
enums: {
|
|
6165
|
+
/**
|
|
6166
|
+
* The casing convention to use for generated names.
|
|
6167
|
+
*
|
|
6168
|
+
* @default 'PascalCase'
|
|
6169
|
+
*/
|
|
6170
|
+
case: StringCase;
|
|
6171
|
+
/**
|
|
6172
|
+
* Whether to transform all enums.
|
|
6173
|
+
*
|
|
6174
|
+
* @default true
|
|
6175
|
+
*/
|
|
6176
|
+
enabled: boolean;
|
|
6177
|
+
/**
|
|
6178
|
+
* Controls whether enums are promoted to reusable root components
|
|
6179
|
+
* ('root') or kept inline within schemas ('inline').
|
|
6180
|
+
*
|
|
6181
|
+
* @default 'root'
|
|
6182
|
+
*/
|
|
6183
|
+
mode: EnumsMode;
|
|
6184
|
+
/**
|
|
6185
|
+
* Customize the generated name of enums.
|
|
6186
|
+
*
|
|
6187
|
+
* @default '{{name}}Enum'
|
|
6188
|
+
*/
|
|
6189
|
+
name: string | ((name: string) => string);
|
|
6190
|
+
};
|
|
6191
|
+
/**
|
|
6192
|
+
* Your schemas might contain read-only or write-only fields. Using such
|
|
6193
|
+
* schemas directly could mean asking the user to provide a read-only
|
|
6194
|
+
* field in requests, or expecting a write-only field in responses.
|
|
6195
|
+
*
|
|
6196
|
+
* We separate schemas for requests and responses if direct usage
|
|
6197
|
+
* would result in such scenarios. You can still disable this
|
|
6198
|
+
* behavior if you prefer.
|
|
6199
|
+
*/
|
|
6200
|
+
readWrite: {
|
|
6201
|
+
/**
|
|
6202
|
+
* Whether to split read-only and write-only schemas.
|
|
6203
|
+
*
|
|
6204
|
+
* @default true
|
|
6205
|
+
*/
|
|
6206
|
+
enabled: boolean;
|
|
6207
|
+
/**
|
|
6208
|
+
* Configuration for generated request-specific schemas.
|
|
6209
|
+
*/
|
|
6210
|
+
requests: {
|
|
6211
|
+
/**
|
|
6212
|
+
* The casing convention to use for generated names.
|
|
6213
|
+
*
|
|
6214
|
+
* @default 'preserve'
|
|
6215
|
+
*/
|
|
6216
|
+
case: StringCase;
|
|
6217
|
+
/**
|
|
6218
|
+
* Customize the generated name of schemas used in requests or
|
|
6219
|
+
* containing write-only fields.
|
|
6220
|
+
*
|
|
6221
|
+
* @default '{{name}}Writable'
|
|
6222
|
+
*/
|
|
6223
|
+
name: string | ((name: string) => string);
|
|
6224
|
+
};
|
|
6225
|
+
/**
|
|
6226
|
+
* Configuration for generated response-specific schemas.
|
|
6227
|
+
*/
|
|
6228
|
+
responses: {
|
|
6229
|
+
/**
|
|
6230
|
+
* The casing convention to use for generated names.
|
|
6231
|
+
*
|
|
6232
|
+
* @default 'preserve'
|
|
6233
|
+
*/
|
|
6234
|
+
case: StringCase;
|
|
6235
|
+
/**
|
|
6236
|
+
* Customize the generated name of schemas used in responses or
|
|
6237
|
+
* containing read-only fields. We default to the original name
|
|
6238
|
+
* to avoid breaking output when a read-only field is added.
|
|
6239
|
+
*
|
|
6240
|
+
* @default '{{name}}'
|
|
6241
|
+
*/
|
|
6242
|
+
name: string | ((name: string) => string);
|
|
6243
|
+
};
|
|
6244
|
+
};
|
|
6245
|
+
};
|
|
6246
|
+
/**
|
|
6247
|
+
* **This is an experimental feature.**
|
|
6248
|
+
*
|
|
6249
|
+
* Validate the input before generating output? This is an experimental,
|
|
6250
|
+
* lightweight feature and support will be added on an ad hoc basis. Setting
|
|
6251
|
+
* `validate_EXPERIMENTAL` to `true` is the same as `warn`.
|
|
5858
6252
|
*
|
|
5859
6253
|
* @default false
|
|
5860
6254
|
*/
|
|
5861
|
-
|
|
5862
|
-
}
|
|
6255
|
+
validate_EXPERIMENTAL: false | 'strict' | 'warn';
|
|
6256
|
+
};
|
|
5863
6257
|
|
|
5864
|
-
|
|
6258
|
+
type Filters = {
|
|
5865
6259
|
/**
|
|
5866
6260
|
* Include deprecated resources in the output?
|
|
5867
6261
|
*
|
|
@@ -5990,9 +6384,9 @@ interface Filters {
|
|
|
5990
6384
|
*/
|
|
5991
6385
|
include?: ReadonlyArray<string>;
|
|
5992
6386
|
};
|
|
5993
|
-
}
|
|
6387
|
+
};
|
|
5994
6388
|
|
|
5995
|
-
|
|
6389
|
+
type Patch = {
|
|
5996
6390
|
/**
|
|
5997
6391
|
* Patch the OpenAPI meta object in place. Useful for modifying general metadata such as title, description, version, or custom fields before further processing.
|
|
5998
6392
|
*
|
|
@@ -6004,6 +6398,25 @@ interface Patch {
|
|
|
6004
6398
|
| OpenApiMetaObject.V3_0_X
|
|
6005
6399
|
| OpenApiMetaObject.V3_1_X,
|
|
6006
6400
|
) => void;
|
|
6401
|
+
/**
|
|
6402
|
+
* Patch OpenAPI operations in place. The key is the operation method and operation path, and the function receives the operation object to modify directly.
|
|
6403
|
+
*
|
|
6404
|
+
* @example
|
|
6405
|
+
* operations: {
|
|
6406
|
+
* 'GET /foo': (operation) => {
|
|
6407
|
+
* operation.responses['200'].description = 'foo';
|
|
6408
|
+
* }
|
|
6409
|
+
* }
|
|
6410
|
+
*/
|
|
6411
|
+
operations?: Record<
|
|
6412
|
+
string,
|
|
6413
|
+
(
|
|
6414
|
+
operation:
|
|
6415
|
+
| OpenApiOperationObject.V2_0_X
|
|
6416
|
+
| OpenApiOperationObject.V3_0_X
|
|
6417
|
+
| OpenApiOperationObject.V3_1_X,
|
|
6418
|
+
) => void
|
|
6419
|
+
>;
|
|
6007
6420
|
/**
|
|
6008
6421
|
* Patch OpenAPI parameters in place. The key is the parameter name, and the function receives the parameter object to modify directly.
|
|
6009
6422
|
*
|
|
@@ -6101,33 +6514,8 @@ interface Patch {
|
|
|
6101
6514
|
* @example
|
|
6102
6515
|
* version: (version) => version.replace(/^v/, '')
|
|
6103
6516
|
*/
|
|
6104
|
-
version?: (version: string) => string;
|
|
6105
|
-
}
|
|
6106
|
-
|
|
6107
|
-
interface Watch {
|
|
6108
|
-
/**
|
|
6109
|
-
* Regenerate the client when the input file changes?
|
|
6110
|
-
*
|
|
6111
|
-
* @default false
|
|
6112
|
-
*/
|
|
6113
|
-
enabled?: boolean;
|
|
6114
|
-
/**
|
|
6115
|
-
* How often should we attempt to detect the input file change? (in ms)
|
|
6116
|
-
*
|
|
6117
|
-
* @default 1000
|
|
6118
|
-
*/
|
|
6119
|
-
interval?: number;
|
|
6120
|
-
/**
|
|
6121
|
-
* How long will we wait before the request times out?
|
|
6122
|
-
*
|
|
6123
|
-
* @default 60_000
|
|
6124
|
-
*/
|
|
6125
|
-
timeout?: number;
|
|
6126
|
-
}
|
|
6127
|
-
|
|
6128
|
-
type Formatters = 'biome' | 'prettier';
|
|
6129
|
-
|
|
6130
|
-
type Linters = 'biome' | 'eslint' | 'oxlint';
|
|
6517
|
+
version?: string | ((version: string) => string);
|
|
6518
|
+
};
|
|
6131
6519
|
|
|
6132
6520
|
interface UserConfig {
|
|
6133
6521
|
/**
|
|
@@ -6154,106 +6542,20 @@ interface UserConfig {
|
|
|
6154
6542
|
| (Record<string, unknown> & { path?: never })
|
|
6155
6543
|
| Input;
|
|
6156
6544
|
/**
|
|
6157
|
-
* The relative location of the logs folder
|
|
6545
|
+
* The relative location of the logs folder.
|
|
6158
6546
|
*
|
|
6159
6547
|
* @default process.cwd()
|
|
6160
6548
|
*/
|
|
6161
|
-
logs?:
|
|
6162
|
-
| string
|
|
6163
|
-
| {
|
|
6164
|
-
/**
|
|
6165
|
-
* Whether or not error logs should be written to a file or not
|
|
6166
|
-
*
|
|
6167
|
-
* @default true
|
|
6168
|
-
* */
|
|
6169
|
-
file?: boolean;
|
|
6170
|
-
/**
|
|
6171
|
-
* The logging level to control the verbosity of log output.
|
|
6172
|
-
* Determines which messages are logged based on their severity.
|
|
6173
|
-
*
|
|
6174
|
-
* Available levels (in increasing order of severity):
|
|
6175
|
-
* - `trace`: Detailed debug information, primarily for development.
|
|
6176
|
-
* - `debug`: Diagnostic information useful during debugging.
|
|
6177
|
-
* - `info`: General operational messages that indicate normal application behavior.
|
|
6178
|
-
* - `warn`: Potentially problematic situations that require attention.
|
|
6179
|
-
* - `error`: Errors that prevent some functionality but do not crash the application.
|
|
6180
|
-
* - `fatal`: Critical errors that cause the application to terminate.
|
|
6181
|
-
* - `silent`: Disables all logging.
|
|
6182
|
-
*
|
|
6183
|
-
* Messages with a severity equal to or higher than the specified level will be logged.
|
|
6184
|
-
*
|
|
6185
|
-
* @default 'info'
|
|
6186
|
-
*/
|
|
6187
|
-
level?:
|
|
6188
|
-
| 'debug'
|
|
6189
|
-
| 'error'
|
|
6190
|
-
| 'fatal'
|
|
6191
|
-
| 'info'
|
|
6192
|
-
| 'silent'
|
|
6193
|
-
| 'trace'
|
|
6194
|
-
| 'warn';
|
|
6195
|
-
|
|
6196
|
-
/**
|
|
6197
|
-
* The relative location of the logs folder
|
|
6198
|
-
*
|
|
6199
|
-
* @default process.cwd()
|
|
6200
|
-
*/
|
|
6201
|
-
path?: string;
|
|
6202
|
-
};
|
|
6549
|
+
logs?: string | Logs;
|
|
6203
6550
|
/**
|
|
6204
|
-
* The relative location of the output folder
|
|
6551
|
+
* The relative location of the output folder.
|
|
6205
6552
|
*/
|
|
6206
|
-
output:
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
*
|
|
6213
|
-
* @default undefined
|
|
6214
|
-
*/
|
|
6215
|
-
case?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
6216
|
-
/**
|
|
6217
|
-
* Clean the `output` folder on every run? If disabled, this folder may
|
|
6218
|
-
* be used to store additional files. The default option is `true` to
|
|
6219
|
-
* reduce the risk of keeping outdated files around when configuration,
|
|
6220
|
-
* input, or package version changes.
|
|
6221
|
-
*
|
|
6222
|
-
* @default true
|
|
6223
|
-
*/
|
|
6224
|
-
clean?: boolean;
|
|
6225
|
-
/**
|
|
6226
|
-
* Process output folder with formatter?
|
|
6227
|
-
*
|
|
6228
|
-
* @default false
|
|
6229
|
-
*/
|
|
6230
|
-
format?: Formatters | false;
|
|
6231
|
-
/**
|
|
6232
|
-
* Should the exports from plugin files be re-exported in the index
|
|
6233
|
-
* barrel file? By default, this is enabled and only default plugins
|
|
6234
|
-
* are re-exported.
|
|
6235
|
-
*
|
|
6236
|
-
* @default true
|
|
6237
|
-
*/
|
|
6238
|
-
indexFile?: boolean;
|
|
6239
|
-
/**
|
|
6240
|
-
* Process output folder with linter?
|
|
6241
|
-
*
|
|
6242
|
-
* @default false
|
|
6243
|
-
*/
|
|
6244
|
-
lint?: Linters | false;
|
|
6245
|
-
/**
|
|
6246
|
-
* The relative location of the output folder
|
|
6247
|
-
*/
|
|
6248
|
-
path: string;
|
|
6249
|
-
/**
|
|
6250
|
-
* Relative or absolute path to the tsconfig file we should use to
|
|
6251
|
-
* generate the output. If a path to tsconfig file is not provided, we
|
|
6252
|
-
* attempt to find one starting from the location of the
|
|
6253
|
-
* `@hey-api/openapi-ts` configuration file and traversing up.
|
|
6254
|
-
*/
|
|
6255
|
-
tsConfigPath?: 'off' | (string & {});
|
|
6256
|
-
};
|
|
6553
|
+
output: string | Output;
|
|
6554
|
+
/**
|
|
6555
|
+
* Customize how the input is parsed and transformed before it's passed to
|
|
6556
|
+
* plugins.
|
|
6557
|
+
*/
|
|
6558
|
+
parser?: Parser;
|
|
6257
6559
|
/**
|
|
6258
6560
|
* Plugins generate artifacts from `input`. By default, we generate SDK
|
|
6259
6561
|
* functions and TypeScript interfaces. If you manually define `plugins`,
|
|
@@ -6331,17 +6633,23 @@ type Config$l = Omit<
|
|
|
6331
6633
|
| 'logs'
|
|
6332
6634
|
| 'name'
|
|
6333
6635
|
| 'output'
|
|
6636
|
+
| 'parser'
|
|
6334
6637
|
| 'plugins'
|
|
6335
6638
|
| 'request'
|
|
6336
6639
|
| 'watch'
|
|
6337
6640
|
> &
|
|
6338
6641
|
Pick<UserConfig, 'base' | 'name' | 'request'> & {
|
|
6339
|
-
input: Omit<Input, 'path' | '
|
|
6340
|
-
Pick<Required<Input>, 'path'
|
|
6642
|
+
input: Omit<Input, 'path' | 'watch'> &
|
|
6643
|
+
Pick<Required<Input>, 'path'> & {
|
|
6341
6644
|
watch: Extract<Required<Required<Input>['watch']>, object>;
|
|
6342
6645
|
};
|
|
6343
6646
|
logs: Extract<Required<UserConfig['logs']>, object>;
|
|
6344
6647
|
output: Extract<UserConfig['output'], object>;
|
|
6648
|
+
/**
|
|
6649
|
+
* Customize how the input is parsed and transformed before it's passed to
|
|
6650
|
+
* plugins.
|
|
6651
|
+
*/
|
|
6652
|
+
parser: ResolvedParser;
|
|
6345
6653
|
pluginOrder: ReadonlyArray<keyof PluginConfigMap>;
|
|
6346
6654
|
plugins: {
|
|
6347
6655
|
[K in PluginNames]?: Plugin.ConfigWithName<PluginConfigMap[K]>;
|
|
@@ -7281,11 +7589,6 @@ type AnyPluginName = PluginNames | (string & {});
|
|
|
7281
7589
|
|
|
7282
7590
|
type PluginTag = 'client' | 'transformer' | 'validator';
|
|
7283
7591
|
|
|
7284
|
-
type ObjectType<T> =
|
|
7285
|
-
Extract<T, Record<string, any>> extends never
|
|
7286
|
-
? Record<string, any>
|
|
7287
|
-
: Extract<T, Record<string, any>>;
|
|
7288
|
-
|
|
7289
7592
|
interface PluginContext {
|
|
7290
7593
|
pluginByTag: <T extends AnyPluginName | boolean = AnyPluginName>(
|
|
7291
7594
|
tag: PluginTag,
|
|
@@ -7294,25 +7597,7 @@ interface PluginContext {
|
|
|
7294
7597
|
errorMessage?: string;
|
|
7295
7598
|
},
|
|
7296
7599
|
) => Exclude<T, boolean> | undefined;
|
|
7297
|
-
valueToObject:
|
|
7298
|
-
T extends undefined | string | boolean | number | Record<string, any>,
|
|
7299
|
-
>(args: {
|
|
7300
|
-
defaultValue: ObjectType<T>;
|
|
7301
|
-
mappers: {
|
|
7302
|
-
boolean: T extends boolean
|
|
7303
|
-
? (value: boolean) => Partial<ObjectType<T>>
|
|
7304
|
-
: never;
|
|
7305
|
-
number: T extends number
|
|
7306
|
-
? (value: number) => Partial<ObjectType<T>>
|
|
7307
|
-
: never;
|
|
7308
|
-
string: T extends string
|
|
7309
|
-
? (value: string) => Partial<ObjectType<T>>
|
|
7310
|
-
: never;
|
|
7311
|
-
} extends infer U
|
|
7312
|
-
? { [K in keyof U as U[K] extends never ? never : K]: U[K] }
|
|
7313
|
-
: never;
|
|
7314
|
-
value: T;
|
|
7315
|
-
}) => ObjectType<T>;
|
|
7600
|
+
valueToObject: ValueToObject;
|
|
7316
7601
|
}
|
|
7317
7602
|
|
|
7318
7603
|
type BaseApi = Record<string, unknown>;
|
|
@@ -7775,7 +8060,7 @@ type Config$a = Plugin.Name<'@hey-api/sdk'> & {
|
|
|
7775
8060
|
response?: 'body' | 'response';
|
|
7776
8061
|
};
|
|
7777
8062
|
|
|
7778
|
-
type ResolvedConfig$
|
|
8063
|
+
type ResolvedConfig$8 = Plugin.Name<'@hey-api/sdk'> & {
|
|
7779
8064
|
/**
|
|
7780
8065
|
* Group operation methods into classes? When enabled, you can select which
|
|
7781
8066
|
* classes to export with `sdk.include` and/or transform their names with
|
|
@@ -7927,7 +8212,7 @@ type ResolvedConfig$7 = Plugin.Name<'@hey-api/sdk'> & {
|
|
|
7927
8212
|
response: 'body' | 'response';
|
|
7928
8213
|
};
|
|
7929
8214
|
|
|
7930
|
-
type HeyApiSdkPlugin = DefinePlugin<Config$a, ResolvedConfig$
|
|
8215
|
+
type HeyApiSdkPlugin = DefinePlugin<Config$a, ResolvedConfig$8>;
|
|
7931
8216
|
|
|
7932
8217
|
type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
7933
8218
|
/**
|
|
@@ -7959,31 +8244,62 @@ type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
|
7959
8244
|
|
|
7960
8245
|
type HeyApiTransformersPlugin = DefinePlugin<Config$9>;
|
|
7961
8246
|
|
|
8247
|
+
type EnumsType = 'javascript' | 'typescript' | 'typescript+namespace';
|
|
8248
|
+
|
|
7962
8249
|
type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
7963
8250
|
/**
|
|
7964
|
-
*
|
|
7965
|
-
* you can choose to generate them as JavaScript objects, TypeScript enums,
|
|
7966
|
-
* or TypeScript enums contained within namespaces.
|
|
8251
|
+
* The casing convention to use for generated names.
|
|
7967
8252
|
*
|
|
7968
|
-
* @default
|
|
8253
|
+
* @default 'PascalCase'
|
|
7969
8254
|
*/
|
|
7970
|
-
|
|
8255
|
+
case?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
7971
8256
|
/**
|
|
7972
|
-
*
|
|
7973
|
-
* This option has effect only when `enums` is defined.
|
|
8257
|
+
* By default, enums are emitted as types to preserve runtime-free output.
|
|
7974
8258
|
*
|
|
7975
|
-
*
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
/**
|
|
7979
|
-
* When generating enums as JavaScript objects, they'll contain a null value
|
|
7980
|
-
* if they're nullable. This might be undesirable if you want to do
|
|
7981
|
-
* `Object.values(Foo)` and have all values be of the same type. This setting
|
|
7982
|
-
* is disabled by default to preserve the source schemas.
|
|
8259
|
+
* However, you may want to generate enums as JavaScript objects or
|
|
8260
|
+
* TypeScript enums for runtime usage, interoperability, or integration with
|
|
8261
|
+
* other tools.
|
|
7983
8262
|
*
|
|
7984
8263
|
* @default false
|
|
7985
8264
|
*/
|
|
7986
|
-
|
|
8265
|
+
enums?:
|
|
8266
|
+
| boolean
|
|
8267
|
+
| EnumsType
|
|
8268
|
+
| {
|
|
8269
|
+
/**
|
|
8270
|
+
* The casing convention to use for generated names.
|
|
8271
|
+
*
|
|
8272
|
+
* @default 'SCREAMING_SNAKE_CASE'
|
|
8273
|
+
*/
|
|
8274
|
+
case?: StringCase;
|
|
8275
|
+
/**
|
|
8276
|
+
* When generating enums as JavaScript objects, they'll contain a null
|
|
8277
|
+
* value if they're nullable. This might be undesirable if you want to do
|
|
8278
|
+
* `Object.values(Foo)` and have all values be of the same type.
|
|
8279
|
+
*
|
|
8280
|
+
* This setting is disabled by default to preserve the source schemas.
|
|
8281
|
+
*
|
|
8282
|
+
* @default false
|
|
8283
|
+
*/
|
|
8284
|
+
constantsIgnoreNull?: boolean;
|
|
8285
|
+
/**
|
|
8286
|
+
* Whether to generate runtime enums.
|
|
8287
|
+
*
|
|
8288
|
+
* @default true
|
|
8289
|
+
*/
|
|
8290
|
+
enabled?: boolean;
|
|
8291
|
+
/**
|
|
8292
|
+
* Specifies the output mode for generated enums.
|
|
8293
|
+
*
|
|
8294
|
+
* Can be:
|
|
8295
|
+
* - `javascript`: Generates JavaScript objects
|
|
8296
|
+
* - `typescript`: Generates TypeScript enums
|
|
8297
|
+
* - `typescript+namespace`: Generates TypeScript enums within a namespace
|
|
8298
|
+
*
|
|
8299
|
+
* @default 'javascript'
|
|
8300
|
+
*/
|
|
8301
|
+
mode?: EnumsType;
|
|
8302
|
+
};
|
|
7987
8303
|
/**
|
|
7988
8304
|
* Should the exports from the generated files be re-exported in the index
|
|
7989
8305
|
* barrel file?
|
|
@@ -7992,48 +8308,106 @@ type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
|
7992
8308
|
*/
|
|
7993
8309
|
exportFromIndex?: boolean;
|
|
7994
8310
|
/**
|
|
7995
|
-
*
|
|
7996
|
-
* the input file) are generated as inlined union types. You can set
|
|
7997
|
-
* `exportInlineEnums` to `true` to treat inline enums as reusable components.
|
|
7998
|
-
* When `true`, the exported enums will follow the style defined in `enums`.
|
|
8311
|
+
* Name of the generated file.
|
|
7999
8312
|
*
|
|
8000
|
-
* @default
|
|
8313
|
+
* @default 'types'
|
|
8001
8314
|
*/
|
|
8002
|
-
|
|
8315
|
+
output?: string;
|
|
8316
|
+
|
|
8317
|
+
// DEPRECATED OPTIONS BELOW
|
|
8318
|
+
|
|
8003
8319
|
/**
|
|
8004
|
-
*
|
|
8320
|
+
* **This feature works only with the legacy parser**
|
|
8005
8321
|
*
|
|
8006
|
-
*
|
|
8322
|
+
* Include only types matching regular expression.
|
|
8323
|
+
*
|
|
8324
|
+
* @deprecated
|
|
8007
8325
|
*/
|
|
8008
|
-
|
|
8326
|
+
// eslint-disable-next-line typescript-sort-keys/interface
|
|
8327
|
+
include?: string;
|
|
8009
8328
|
/**
|
|
8010
|
-
*
|
|
8329
|
+
* **This feature works only with the legacy parser**
|
|
8011
8330
|
*
|
|
8012
|
-
*
|
|
8331
|
+
* Use your preferred naming pattern
|
|
8332
|
+
*
|
|
8333
|
+
* @deprecated
|
|
8334
|
+
* @default 'preserve'
|
|
8013
8335
|
*/
|
|
8014
|
-
|
|
8336
|
+
style?: 'PascalCase' | 'preserve';
|
|
8015
8337
|
/**
|
|
8016
|
-
*
|
|
8017
|
-
* This option exists for backward compatibility with outputs created before
|
|
8018
|
-
* this feature existed.
|
|
8338
|
+
* **This feature works only with the legacy parser**
|
|
8019
8339
|
*
|
|
8020
|
-
*
|
|
8340
|
+
* Generate a tree of types containing all operations? It will be named
|
|
8341
|
+
* $OpenApiTs.
|
|
8342
|
+
*
|
|
8343
|
+
* @deprecated
|
|
8344
|
+
* @default false
|
|
8021
8345
|
*/
|
|
8022
|
-
|
|
8346
|
+
tree?: boolean;
|
|
8347
|
+
};
|
|
8348
|
+
|
|
8349
|
+
type ResolvedConfig$7 = Plugin.Name<'@hey-api/typescript'> & {
|
|
8350
|
+
/**
|
|
8351
|
+
* The casing convention to use for generated names.
|
|
8352
|
+
*
|
|
8353
|
+
* @default 'PascalCase'
|
|
8354
|
+
*/
|
|
8355
|
+
case: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
8023
8356
|
/**
|
|
8024
|
-
*
|
|
8025
|
-
*
|
|
8357
|
+
* By default, enums are emitted as types to preserve runtime-free output.
|
|
8358
|
+
*
|
|
8359
|
+
* However, you may want to generate enums as JavaScript objects or
|
|
8360
|
+
* TypeScript enums for runtime usage, interoperability, or integration with
|
|
8361
|
+
* other tools.
|
|
8362
|
+
*/
|
|
8363
|
+
enums: {
|
|
8364
|
+
/**
|
|
8365
|
+
* The casing convention to use for generated names.
|
|
8366
|
+
*
|
|
8367
|
+
* @default 'SCREAMING_SNAKE_CASE'
|
|
8368
|
+
*/
|
|
8369
|
+
case: StringCase;
|
|
8370
|
+
/**
|
|
8371
|
+
* When generating enums as JavaScript objects, they'll contain a null
|
|
8372
|
+
* value if they're nullable. This might be undesirable if you want to do
|
|
8373
|
+
* `Object.values(Foo)` and have all values be of the same type.
|
|
8374
|
+
*
|
|
8375
|
+
* This setting is disabled by default to preserve the source schemas.
|
|
8376
|
+
*
|
|
8377
|
+
* @default false
|
|
8378
|
+
*/
|
|
8379
|
+
constantsIgnoreNull: boolean;
|
|
8380
|
+
/**
|
|
8381
|
+
* Whether to generate runtime enums.
|
|
8382
|
+
*
|
|
8383
|
+
* @default false
|
|
8384
|
+
*/
|
|
8385
|
+
enabled: boolean;
|
|
8386
|
+
/**
|
|
8387
|
+
* Specifies the output mode for generated enums.
|
|
8388
|
+
*
|
|
8389
|
+
* Can be:
|
|
8390
|
+
* - `javascript`: Generates JavaScript objects
|
|
8391
|
+
* - `typescript`: Generates TypeScript enums
|
|
8392
|
+
* - `typescript+namespace`: Generates TypeScript enums within a namespace
|
|
8393
|
+
*
|
|
8394
|
+
* @default 'javascript'
|
|
8395
|
+
*/
|
|
8396
|
+
mode: EnumsType;
|
|
8397
|
+
};
|
|
8398
|
+
/**
|
|
8399
|
+
* Should the exports from the generated files be re-exported in the index
|
|
8400
|
+
* barrel file?
|
|
8026
8401
|
*
|
|
8027
|
-
* @default
|
|
8402
|
+
* @default true
|
|
8028
8403
|
*/
|
|
8029
|
-
|
|
8404
|
+
exportFromIndex: boolean;
|
|
8030
8405
|
/**
|
|
8031
|
-
*
|
|
8032
|
-
* fields.
|
|
8406
|
+
* Name of the generated file.
|
|
8033
8407
|
*
|
|
8034
|
-
* @default '
|
|
8408
|
+
* @default 'types'
|
|
8035
8409
|
*/
|
|
8036
|
-
|
|
8410
|
+
output: string;
|
|
8037
8411
|
|
|
8038
8412
|
// DEPRECATED OPTIONS BELOW
|
|
8039
8413
|
|
|
@@ -8054,7 +8428,7 @@ type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
|
8054
8428
|
* @deprecated
|
|
8055
8429
|
* @default 'preserve'
|
|
8056
8430
|
*/
|
|
8057
|
-
style
|
|
8431
|
+
style: 'PascalCase' | 'preserve';
|
|
8058
8432
|
/**
|
|
8059
8433
|
* **This feature works only with the legacy parser**
|
|
8060
8434
|
*
|
|
@@ -8064,10 +8438,10 @@ type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
|
8064
8438
|
* @deprecated
|
|
8065
8439
|
* @default false
|
|
8066
8440
|
*/
|
|
8067
|
-
tree
|
|
8441
|
+
tree: boolean;
|
|
8068
8442
|
};
|
|
8069
8443
|
|
|
8070
|
-
type HeyApiTypeScriptPlugin = DefinePlugin<Config$8>;
|
|
8444
|
+
type HeyApiTypeScriptPlugin = DefinePlugin<Config$8, ResolvedConfig$7>;
|
|
8071
8445
|
|
|
8072
8446
|
type Config$7 = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
|
8073
8447
|
/**
|
|
@@ -9152,9 +9526,10 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9152
9526
|
*/
|
|
9153
9527
|
comments?: boolean;
|
|
9154
9528
|
/**
|
|
9155
|
-
* Configuration for reusable schema definitions.
|
|
9156
|
-
*
|
|
9157
|
-
*
|
|
9529
|
+
* Configuration for reusable schema definitions.
|
|
9530
|
+
*
|
|
9531
|
+
* Controls generation of shared Valibot schemas that can be referenced
|
|
9532
|
+
* across requests and responses.
|
|
9158
9533
|
*
|
|
9159
9534
|
* Can be:
|
|
9160
9535
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9178,8 +9553,8 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9178
9553
|
*/
|
|
9179
9554
|
enabled?: boolean;
|
|
9180
9555
|
/**
|
|
9181
|
-
* Custom naming pattern for generated schema names. The name variable
|
|
9182
|
-
* obtained from the schema name.
|
|
9556
|
+
* Custom naming pattern for generated schema names. The name variable
|
|
9557
|
+
* is obtained from the schema name.
|
|
9183
9558
|
*
|
|
9184
9559
|
* @default 'v{{name}}'
|
|
9185
9560
|
*/
|
|
@@ -9208,6 +9583,7 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9208
9583
|
output?: string;
|
|
9209
9584
|
/**
|
|
9210
9585
|
* Configuration for request-specific Valibot schemas.
|
|
9586
|
+
*
|
|
9211
9587
|
* Controls generation of Valibot schemas for request bodies, query
|
|
9212
9588
|
* parameters, path parameters, and headers.
|
|
9213
9589
|
*
|
|
@@ -9233,8 +9609,8 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9233
9609
|
*/
|
|
9234
9610
|
enabled?: boolean;
|
|
9235
9611
|
/**
|
|
9236
|
-
* Custom naming pattern for generated schema names. The name variable
|
|
9237
|
-
* obtained from the operation name.
|
|
9612
|
+
* Custom naming pattern for generated schema names. The name variable
|
|
9613
|
+
* is obtained from the operation name.
|
|
9238
9614
|
*
|
|
9239
9615
|
* @default 'v{{name}}Data'
|
|
9240
9616
|
*/
|
|
@@ -9242,6 +9618,7 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9242
9618
|
};
|
|
9243
9619
|
/**
|
|
9244
9620
|
* Configuration for response-specific Valibot schemas.
|
|
9621
|
+
*
|
|
9245
9622
|
* Controls generation of Valibot schemas for response bodies, error
|
|
9246
9623
|
* responses, and status codes.
|
|
9247
9624
|
*
|
|
@@ -9267,8 +9644,8 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9267
9644
|
*/
|
|
9268
9645
|
enabled?: boolean;
|
|
9269
9646
|
/**
|
|
9270
|
-
* Custom naming pattern for generated schema names. The name variable
|
|
9271
|
-
* obtained from the operation name.
|
|
9647
|
+
* Custom naming pattern for generated schema names. The name variable
|
|
9648
|
+
* is obtained from the operation name.
|
|
9272
9649
|
*
|
|
9273
9650
|
* @default 'v{{name}}Response'
|
|
9274
9651
|
*/
|
|
@@ -9290,9 +9667,10 @@ type ResolvedConfig$1 = Plugin.Name<'valibot'> & {
|
|
|
9290
9667
|
*/
|
|
9291
9668
|
comments: boolean;
|
|
9292
9669
|
/**
|
|
9293
|
-
* Configuration for reusable schema definitions.
|
|
9294
|
-
*
|
|
9295
|
-
*
|
|
9670
|
+
* Configuration for reusable schema definitions.
|
|
9671
|
+
*
|
|
9672
|
+
* Controls generation of shared Valibot schemas that can be referenced
|
|
9673
|
+
* across requests and responses.
|
|
9296
9674
|
*/
|
|
9297
9675
|
definitions: {
|
|
9298
9676
|
/**
|
|
@@ -9338,6 +9716,7 @@ type ResolvedConfig$1 = Plugin.Name<'valibot'> & {
|
|
|
9338
9716
|
output: string;
|
|
9339
9717
|
/**
|
|
9340
9718
|
* Configuration for request-specific Valibot schemas.
|
|
9719
|
+
*
|
|
9341
9720
|
* Controls generation of Valibot schemas for request bodies, query
|
|
9342
9721
|
* parameters, path parameters, and headers.
|
|
9343
9722
|
*/
|
|
@@ -9364,6 +9743,7 @@ type ResolvedConfig$1 = Plugin.Name<'valibot'> & {
|
|
|
9364
9743
|
};
|
|
9365
9744
|
/**
|
|
9366
9745
|
* Configuration for response-specific Valibot schemas.
|
|
9746
|
+
*
|
|
9367
9747
|
* Controls generation of Valibot schemas for response bodies, error
|
|
9368
9748
|
* responses, and status codes.
|
|
9369
9749
|
*/
|
|
@@ -9419,8 +9799,10 @@ type Config = Plugin.Name<'zod'> & {
|
|
|
9419
9799
|
*/
|
|
9420
9800
|
comments?: boolean;
|
|
9421
9801
|
/**
|
|
9422
|
-
* Configuration for reusable schema definitions.
|
|
9423
|
-
*
|
|
9802
|
+
* Configuration for reusable schema definitions.
|
|
9803
|
+
*
|
|
9804
|
+
* Controls generation of shared Zod schemas that can be referenced across
|
|
9805
|
+
* requests and responses.
|
|
9424
9806
|
*
|
|
9425
9807
|
* Can be:
|
|
9426
9808
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9474,7 +9856,9 @@ type Config = Plugin.Name<'zod'> & {
|
|
|
9474
9856
|
output?: string;
|
|
9475
9857
|
/**
|
|
9476
9858
|
* Configuration for request-specific Zod schemas.
|
|
9477
|
-
*
|
|
9859
|
+
*
|
|
9860
|
+
* Controls generation of Zod schemas for request bodies, query parameters, path
|
|
9861
|
+
* parameters, and headers.
|
|
9478
9862
|
*
|
|
9479
9863
|
* Can be:
|
|
9480
9864
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9507,7 +9891,9 @@ type Config = Plugin.Name<'zod'> & {
|
|
|
9507
9891
|
};
|
|
9508
9892
|
/**
|
|
9509
9893
|
* Configuration for response-specific Zod schemas.
|
|
9510
|
-
*
|
|
9894
|
+
*
|
|
9895
|
+
* Controls generation of Zod schemas for response bodies, error responses,
|
|
9896
|
+
* and status codes.
|
|
9511
9897
|
*
|
|
9512
9898
|
* Can be:
|
|
9513
9899
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9554,8 +9940,10 @@ type ResolvedConfig = Plugin.Name<'zod'> & {
|
|
|
9554
9940
|
*/
|
|
9555
9941
|
comments: boolean;
|
|
9556
9942
|
/**
|
|
9557
|
-
* Configuration for reusable schema definitions.
|
|
9558
|
-
*
|
|
9943
|
+
* Configuration for reusable schema definitions.
|
|
9944
|
+
*
|
|
9945
|
+
* Controls generation of shared Zod schemas that can be referenced across
|
|
9946
|
+
* requests and responses.
|
|
9559
9947
|
*/
|
|
9560
9948
|
definitions: {
|
|
9561
9949
|
/**
|
|
@@ -9601,7 +9989,9 @@ type ResolvedConfig = Plugin.Name<'zod'> & {
|
|
|
9601
9989
|
output: string;
|
|
9602
9990
|
/**
|
|
9603
9991
|
* Configuration for request-specific Zod schemas.
|
|
9604
|
-
*
|
|
9992
|
+
*
|
|
9993
|
+
* Controls generation of Zod schemas for request bodies, query parameters, path
|
|
9994
|
+
* parameters, and headers.
|
|
9605
9995
|
*/
|
|
9606
9996
|
requests: {
|
|
9607
9997
|
/**
|
|
@@ -9626,7 +10016,9 @@ type ResolvedConfig = Plugin.Name<'zod'> & {
|
|
|
9626
10016
|
};
|
|
9627
10017
|
/**
|
|
9628
10018
|
* Configuration for response-specific Zod schemas.
|
|
9629
|
-
*
|
|
10019
|
+
*
|
|
10020
|
+
* Controls generation of Zod schemas for response bodies, error responses,
|
|
10021
|
+
* and status codes.
|
|
9630
10022
|
*/
|
|
9631
10023
|
responses: {
|
|
9632
10024
|
/**
|
|
@@ -10004,18 +10396,6 @@ declare namespace IR {
|
|
|
10004
10396
|
export type ServerObject = IRServerObject;
|
|
10005
10397
|
}
|
|
10006
10398
|
|
|
10007
|
-
/**
|
|
10008
|
-
* Default plugins used to generate artifacts if plugins aren't specified.
|
|
10009
|
-
*/
|
|
10010
|
-
declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
|
|
10011
|
-
/**
|
|
10012
|
-
* @internal
|
|
10013
|
-
*/
|
|
10014
|
-
declare const initConfigs: (userConfig: UserConfig | undefined) => Promise<ReadonlyArray<{
|
|
10015
|
-
config: Config$l;
|
|
10016
|
-
errors: ReadonlyArray<Error>;
|
|
10017
|
-
}>>;
|
|
10018
|
-
|
|
10019
10399
|
declare namespace LegacyIR {
|
|
10020
10400
|
export type LegacyOperation = Operation;
|
|
10021
10401
|
}
|
|
@@ -10038,4 +10418,4 @@ interface WatchValues {
|
|
|
10038
10418
|
lastValue?: string;
|
|
10039
10419
|
}
|
|
10040
10420
|
|
|
10041
|
-
export { type Client$1 as C, type DefinePlugin as D, IR as I, LegacyIR as L, OpenApi$3 as O, type PluginHandler as P, type StringCase as S, type UserConfig as U, type WatchValues as W, Plugin as a,
|
|
10421
|
+
export { type Client$1 as C, type DefinePlugin as D, IR as I, LegacyIR as L, OpenApi$3 as O, type PluginHandler as P, type StringCase as S, type UserConfig as U, type WatchValues as W, Plugin as a, OpenApiMetaObject as b, OpenApiOperationObject as c, OpenApiParameterObject as d, OpenApiRequestBodyObject as e, OpenApiResponseObject as f, OpenApiSchemaObject as g, Client as h, type Config$l as i };
|