@hey-api/openapi-ts 0.77.0 → 0.78.1
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-4AJU36PO.js +39 -0
- package/dist/chunk-4AJU36PO.js.map +1 -0
- package/dist/clients/core/bodySerializer.ts +9 -5
- package/dist/index.cjs +63 -63
- 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-DtZlpeRE.d.cts} +721 -302
- package/dist/{types.d-CBVwu8Hi.d.ts → types.d-DtZlpeRE.d.ts} +721 -302
- package/package.json +1 -1
- package/dist/chunk-EH476QS3.js +0 -39
- package/dist/chunk-EH476QS3.js.map +0 -1
|
@@ -2639,6 +2639,210 @@ 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 MappersType<T> = {
|
|
2644
|
+
boolean: T extends boolean ? (value: boolean) => Partial<ObjectType<T>> : never;
|
|
2645
|
+
number: T extends number ? (value: number) => Partial<ObjectType<T>> : never;
|
|
2646
|
+
object?: (value: Partial<ObjectType<T>>) => Partial<ObjectType<T>>;
|
|
2647
|
+
string: T extends string ? (value: string) => Partial<ObjectType<T>> : never;
|
|
2648
|
+
} extends infer U ? {
|
|
2649
|
+
[K in keyof U as U[K] extends never ? never : K]: U[K];
|
|
2650
|
+
} : never;
|
|
2651
|
+
type IsObjectOnly<T> = T extends Record<string, any> | undefined ? Extract<T, string | boolean | number> extends never ? true : false : false;
|
|
2652
|
+
type ValueToObject = <T extends undefined | string | boolean | number | Record<string, any>>(args: {
|
|
2653
|
+
defaultValue: ObjectType<T>;
|
|
2654
|
+
value: T;
|
|
2655
|
+
} & (IsObjectOnly<T> extends true ? {
|
|
2656
|
+
mappers?: MappersType<T>;
|
|
2657
|
+
} : {
|
|
2658
|
+
mappers: MappersType<T>;
|
|
2659
|
+
})) => ObjectType<T>;
|
|
2660
|
+
|
|
2661
|
+
type Input = {
|
|
2662
|
+
/**
|
|
2663
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2664
|
+
*
|
|
2665
|
+
* Projects are private by default, you will need to be authenticated
|
|
2666
|
+
* to download OpenAPI specifications. We recommend using project API
|
|
2667
|
+
* keys in CI workflows and personal API keys for local development.
|
|
2668
|
+
*
|
|
2669
|
+
* API key isn't required for public projects. You can also omit this
|
|
2670
|
+
* parameter and provide an environment variable `HEY_API_TOKEN`.
|
|
2671
|
+
*/
|
|
2672
|
+
api_key?: string;
|
|
2673
|
+
/**
|
|
2674
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2675
|
+
*
|
|
2676
|
+
* You can fetch the last build from branch by providing the branch
|
|
2677
|
+
* name.
|
|
2678
|
+
*/
|
|
2679
|
+
branch?: string;
|
|
2680
|
+
/**
|
|
2681
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2682
|
+
*
|
|
2683
|
+
* You can fetch an exact specification by providing a commit sha.
|
|
2684
|
+
* This will always return the same file.
|
|
2685
|
+
*/
|
|
2686
|
+
commit_sha?: string;
|
|
2687
|
+
/**
|
|
2688
|
+
* You can pass any valid Fetch API options to the request for fetching your
|
|
2689
|
+
* specification. This is useful if your file is behind auth for example.
|
|
2690
|
+
*/
|
|
2691
|
+
fetch?: RequestInit;
|
|
2692
|
+
/**
|
|
2693
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2694
|
+
*
|
|
2695
|
+
* Organization created in Hey API Platform.
|
|
2696
|
+
*/
|
|
2697
|
+
organization?: string;
|
|
2698
|
+
/**
|
|
2699
|
+
* Path to the OpenAPI specification. This can be either local or remote path.
|
|
2700
|
+
* Both JSON and YAML file formats are supported. You can also pass the parsed
|
|
2701
|
+
* object directly if you're fetching the file yourself.
|
|
2702
|
+
*/
|
|
2703
|
+
path?:
|
|
2704
|
+
| 'https://get.heyapi.dev/<organization>/<project>'
|
|
2705
|
+
| (string & {})
|
|
2706
|
+
| Record<string, unknown>;
|
|
2707
|
+
/**
|
|
2708
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2709
|
+
*
|
|
2710
|
+
* Project created in Hey API Platform.
|
|
2711
|
+
*/
|
|
2712
|
+
project?: string;
|
|
2713
|
+
/**
|
|
2714
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2715
|
+
*
|
|
2716
|
+
* If you're tagging your specifications with custom tags, you can use
|
|
2717
|
+
* them to filter the results. When you provide multiple tags, only
|
|
2718
|
+
* the first match will be returned.
|
|
2719
|
+
*/
|
|
2720
|
+
tags?: ReadonlyArray<string>;
|
|
2721
|
+
/**
|
|
2722
|
+
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
2723
|
+
*
|
|
2724
|
+
* Every OpenAPI document contains a required version field. You can
|
|
2725
|
+
* use this value to fetch the last uploaded specification matching
|
|
2726
|
+
* the value.
|
|
2727
|
+
*/
|
|
2728
|
+
version?: string;
|
|
2729
|
+
/**
|
|
2730
|
+
* Regenerate the client when the input file changes? You can alternatively
|
|
2731
|
+
* pass a numeric value for the interval in ms.
|
|
2732
|
+
*
|
|
2733
|
+
* @default false
|
|
2734
|
+
*/
|
|
2735
|
+
watch?: boolean | number | Watch;
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2738
|
+
type Watch = {
|
|
2739
|
+
/**
|
|
2740
|
+
* Regenerate the client when the input file changes?
|
|
2741
|
+
*
|
|
2742
|
+
* @default false
|
|
2743
|
+
*/
|
|
2744
|
+
enabled?: boolean;
|
|
2745
|
+
/**
|
|
2746
|
+
* How often should we attempt to detect the input file change? (in ms)
|
|
2747
|
+
*
|
|
2748
|
+
* @default 1000
|
|
2749
|
+
*/
|
|
2750
|
+
interval?: number;
|
|
2751
|
+
/**
|
|
2752
|
+
* How long will we wait before the request times out?
|
|
2753
|
+
*
|
|
2754
|
+
* @default 60_000
|
|
2755
|
+
*/
|
|
2756
|
+
timeout?: number;
|
|
2757
|
+
};
|
|
2758
|
+
|
|
2759
|
+
type Logs = {
|
|
2760
|
+
/**
|
|
2761
|
+
* Whether or not error logs should be written to a file or not
|
|
2762
|
+
*
|
|
2763
|
+
* @default true
|
|
2764
|
+
* */
|
|
2765
|
+
file?: boolean;
|
|
2766
|
+
/**
|
|
2767
|
+
* The logging level to control the verbosity of log output.
|
|
2768
|
+
* Determines which messages are logged based on their severity.
|
|
2769
|
+
*
|
|
2770
|
+
* Available levels (in increasing order of severity):
|
|
2771
|
+
* - `trace`: Detailed debug information, primarily for development.
|
|
2772
|
+
* - `debug`: Diagnostic information useful during debugging.
|
|
2773
|
+
* - `info`: General operational messages that indicate normal application behavior.
|
|
2774
|
+
* - `warn`: Potentially problematic situations that require attention.
|
|
2775
|
+
* - `error`: Errors that prevent some functionality but do not crash the application.
|
|
2776
|
+
* - `fatal`: Critical errors that cause the application to terminate.
|
|
2777
|
+
* - `silent`: Disables all logging.
|
|
2778
|
+
*
|
|
2779
|
+
* Messages with a severity equal to or higher than the specified level will be logged.
|
|
2780
|
+
*
|
|
2781
|
+
* @default 'info'
|
|
2782
|
+
*/
|
|
2783
|
+
level?: 'debug' | 'error' | 'fatal' | 'info' | 'silent' | 'trace' | 'warn';
|
|
2784
|
+
/**
|
|
2785
|
+
* The relative location of the logs folder
|
|
2786
|
+
*
|
|
2787
|
+
* @default process.cwd()
|
|
2788
|
+
*/
|
|
2789
|
+
path?: string;
|
|
2790
|
+
};
|
|
2791
|
+
|
|
2792
|
+
type Formatters = 'biome' | 'prettier';
|
|
2793
|
+
|
|
2794
|
+
type Linters = 'biome' | 'eslint' | 'oxlint';
|
|
2795
|
+
|
|
2796
|
+
type Output = {
|
|
2797
|
+
/**
|
|
2798
|
+
* Defines casing of the output fields. By default, we preserve `input`
|
|
2799
|
+
* values as data transforms incur a performance penalty at runtime.
|
|
2800
|
+
*
|
|
2801
|
+
* @default undefined
|
|
2802
|
+
*/
|
|
2803
|
+
case?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
2804
|
+
/**
|
|
2805
|
+
* Clean the `output` folder on every run? If disabled, this folder may
|
|
2806
|
+
* be used to store additional files. The default option is `true` to
|
|
2807
|
+
* reduce the risk of keeping outdated files around when configuration,
|
|
2808
|
+
* input, or package version changes.
|
|
2809
|
+
*
|
|
2810
|
+
* @default true
|
|
2811
|
+
*/
|
|
2812
|
+
clean?: boolean;
|
|
2813
|
+
/**
|
|
2814
|
+
* Process output folder with formatter?
|
|
2815
|
+
*
|
|
2816
|
+
* @default false
|
|
2817
|
+
*/
|
|
2818
|
+
format?: Formatters | false;
|
|
2819
|
+
/**
|
|
2820
|
+
* Should the exports from plugin files be re-exported in the index
|
|
2821
|
+
* barrel file? By default, this is enabled and only default plugins
|
|
2822
|
+
* are re-exported.
|
|
2823
|
+
*
|
|
2824
|
+
* @default true
|
|
2825
|
+
*/
|
|
2826
|
+
indexFile?: boolean;
|
|
2827
|
+
/**
|
|
2828
|
+
* Process output folder with linter?
|
|
2829
|
+
*
|
|
2830
|
+
* @default false
|
|
2831
|
+
*/
|
|
2832
|
+
lint?: Linters | false;
|
|
2833
|
+
/**
|
|
2834
|
+
* The relative location of the output folder
|
|
2835
|
+
*/
|
|
2836
|
+
path: string;
|
|
2837
|
+
/**
|
|
2838
|
+
* Relative or absolute path to the tsconfig file we should use to
|
|
2839
|
+
* generate the output. If a path to tsconfig file is not provided, we
|
|
2840
|
+
* attempt to find one starting from the location of the
|
|
2841
|
+
* `@hey-api/openapi-ts` configuration file and traversing up.
|
|
2842
|
+
*/
|
|
2843
|
+
tsConfigPath?: 'off' | (string & {});
|
|
2844
|
+
};
|
|
2845
|
+
|
|
2642
2846
|
interface JsonSchemaDraft4 extends EnumExtensions {
|
|
2643
2847
|
/**
|
|
2644
2848
|
* 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 +4600,7 @@ interface XMLObject$1 {
|
|
|
4396
4600
|
|
|
4397
4601
|
interface OpenApiV2_0_XTypes {
|
|
4398
4602
|
InfoObject: InfoObject$1;
|
|
4603
|
+
OperationObject: OperationObject$1;
|
|
4399
4604
|
SchemaObject: SchemaObject$1;
|
|
4400
4605
|
}
|
|
4401
4606
|
|
|
@@ -5682,6 +5887,7 @@ type Format = JsonSchemaFormats | OpenApiSchemaFormats | (string & {});
|
|
|
5682
5887
|
|
|
5683
5888
|
interface OpenApiV3_0_XTypes {
|
|
5684
5889
|
InfoObject: InfoObject;
|
|
5890
|
+
OperationObject: OperationObject;
|
|
5685
5891
|
ParameterObject: ParameterObject;
|
|
5686
5892
|
ReferenceObject: ReferenceObject;
|
|
5687
5893
|
RequestBodyObject: RequestBodyObject;
|
|
@@ -5691,6 +5897,7 @@ interface OpenApiV3_0_XTypes {
|
|
|
5691
5897
|
|
|
5692
5898
|
interface OpenApiV3_1_XTypes {
|
|
5693
5899
|
InfoObject: InfoObject$2;
|
|
5900
|
+
OperationObject: OperationObject$2;
|
|
5694
5901
|
ParameterObject: ParameterObject$2;
|
|
5695
5902
|
ReferenceObject: ReferenceObject$2;
|
|
5696
5903
|
RequestBodyObject: RequestBodyObject$1;
|
|
@@ -5714,6 +5921,14 @@ declare namespace OpenApiMetaObject {
|
|
|
5714
5921
|
export type V3_1_X = OpenApiV3_1_XTypes['InfoObject'];
|
|
5715
5922
|
}
|
|
5716
5923
|
|
|
5924
|
+
declare namespace OpenApiOperationObject {
|
|
5925
|
+
export type V2_0_X = OpenApiV2_0_XTypes['OperationObject'];
|
|
5926
|
+
|
|
5927
|
+
export type V3_0_X = OpenApiV3_0_XTypes['OperationObject'];
|
|
5928
|
+
|
|
5929
|
+
export type V3_1_X = OpenApiV3_1_XTypes['OperationObject'];
|
|
5930
|
+
}
|
|
5931
|
+
|
|
5717
5932
|
declare namespace OpenApiParameterObject {
|
|
5718
5933
|
export type V3_0_X =
|
|
5719
5934
|
| OpenApiV3_0_XTypes['ParameterObject']
|
|
@@ -5752,88 +5967,287 @@ declare namespace OpenApiSchemaObject {
|
|
|
5752
5967
|
export type V3_1_X = OpenApiV3_1_XTypes['SchemaObject'];
|
|
5753
5968
|
}
|
|
5754
5969
|
|
|
5755
|
-
|
|
5970
|
+
type EnumsMode = 'inline' | 'root';
|
|
5971
|
+
|
|
5972
|
+
type Parser = {
|
|
5756
5973
|
/**
|
|
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`.
|
|
5974
|
+
* Filters can be used to select a subset of your input before it's passed
|
|
5975
|
+
* to plugins.
|
|
5765
5976
|
*/
|
|
5766
|
-
|
|
5977
|
+
filters?: Filters;
|
|
5767
5978
|
/**
|
|
5768
|
-
*
|
|
5769
|
-
*
|
|
5770
|
-
* You can fetch the last build from branch by providing the branch
|
|
5771
|
-
* name.
|
|
5979
|
+
* Pagination configuration.
|
|
5772
5980
|
*/
|
|
5773
|
-
|
|
5981
|
+
pagination?: {
|
|
5982
|
+
/**
|
|
5983
|
+
* Array of keywords to be considered as pagination field names.
|
|
5984
|
+
* These will be used to detect pagination fields in schemas and parameters.
|
|
5985
|
+
*
|
|
5986
|
+
* @default ['after', 'before', 'cursor', 'offset', 'page', 'start']
|
|
5987
|
+
*/
|
|
5988
|
+
keywords?: ReadonlyArray<string>;
|
|
5989
|
+
};
|
|
5774
5990
|
/**
|
|
5775
|
-
*
|
|
5776
|
-
*
|
|
5777
|
-
* You can fetch an exact specification by providing a commit sha.
|
|
5778
|
-
* This will always return the same file.
|
|
5991
|
+
* Custom input transformations to execute before parsing. Use this
|
|
5992
|
+
* to modify, fix, or enhance input before it's passed to plugins.
|
|
5779
5993
|
*/
|
|
5780
|
-
|
|
5994
|
+
patch?: Patch;
|
|
5781
5995
|
/**
|
|
5782
|
-
*
|
|
5783
|
-
*
|
|
5996
|
+
* Built-in transformations that modify or normalize the input before it's
|
|
5997
|
+
* passed to plugins. These options enable predictable, documented behaviors
|
|
5998
|
+
* and are distinct from custom patches. Use this to perform structural
|
|
5999
|
+
* changes to input in a standardized way.
|
|
5784
6000
|
*/
|
|
5785
|
-
|
|
6001
|
+
transforms?: {
|
|
6002
|
+
/**
|
|
6003
|
+
* Your input might contain two types of enums:
|
|
6004
|
+
* - enums defined as reusable components (root enums)
|
|
6005
|
+
* - non-reusable enums nested within other schemas (inline enums)
|
|
6006
|
+
*
|
|
6007
|
+
* You may want all enums to be reusable. This is because only root enums
|
|
6008
|
+
* are typically exported by plugins. Inline enums will never be directly
|
|
6009
|
+
* importable since they're nested inside other schemas.
|
|
6010
|
+
*
|
|
6011
|
+
* For example, to export nested enum types with the `@hey-api/typescript`
|
|
6012
|
+
* plugin, set `enums` to `root`. Likewise, if you don't want to export any
|
|
6013
|
+
* enum types, set `enums` to `inline`.
|
|
6014
|
+
*
|
|
6015
|
+
* @default false
|
|
6016
|
+
*/
|
|
6017
|
+
enums?:
|
|
6018
|
+
| boolean
|
|
6019
|
+
| EnumsMode
|
|
6020
|
+
| {
|
|
6021
|
+
/**
|
|
6022
|
+
* The casing convention to use for generated names.
|
|
6023
|
+
*
|
|
6024
|
+
* @default 'PascalCase'
|
|
6025
|
+
*/
|
|
6026
|
+
case?: StringCase;
|
|
6027
|
+
/**
|
|
6028
|
+
* Whether to transform all enums.
|
|
6029
|
+
*
|
|
6030
|
+
* @default true
|
|
6031
|
+
*/
|
|
6032
|
+
enabled?: boolean;
|
|
6033
|
+
/**
|
|
6034
|
+
* Controls whether enums are promoted to reusable root components
|
|
6035
|
+
* ('root') or kept inline within schemas ('inline').
|
|
6036
|
+
*
|
|
6037
|
+
* @default 'root'
|
|
6038
|
+
*/
|
|
6039
|
+
mode?: EnumsMode;
|
|
6040
|
+
/**
|
|
6041
|
+
* Customize the generated name of enums.
|
|
6042
|
+
*
|
|
6043
|
+
* @default '{{name}}Enum'
|
|
6044
|
+
*/
|
|
6045
|
+
name?: string | ((name: string) => string);
|
|
6046
|
+
};
|
|
6047
|
+
/**
|
|
6048
|
+
* Your schemas might contain read-only or write-only fields. Using such
|
|
6049
|
+
* schemas directly could mean asking the user to provide a read-only
|
|
6050
|
+
* field in requests, or expecting a write-only field in responses.
|
|
6051
|
+
*
|
|
6052
|
+
* We separate schemas for requests and responses if direct usage
|
|
6053
|
+
* would result in such scenarios. You can still disable this
|
|
6054
|
+
* behavior if you prefer.
|
|
6055
|
+
*
|
|
6056
|
+
* @default true
|
|
6057
|
+
*/
|
|
6058
|
+
readWrite?:
|
|
6059
|
+
| boolean
|
|
6060
|
+
| {
|
|
6061
|
+
/**
|
|
6062
|
+
* Whether to split read-only and write-only schemas.
|
|
6063
|
+
*
|
|
6064
|
+
* @default true
|
|
6065
|
+
*/
|
|
6066
|
+
enabled?: boolean;
|
|
6067
|
+
/**
|
|
6068
|
+
* Configuration for generated request-specific schemas.
|
|
6069
|
+
*
|
|
6070
|
+
* @default '{{name}}Writable'
|
|
6071
|
+
*/
|
|
6072
|
+
requests?:
|
|
6073
|
+
| string
|
|
6074
|
+
| {
|
|
6075
|
+
/**
|
|
6076
|
+
* The casing convention to use for generated names.
|
|
6077
|
+
*
|
|
6078
|
+
* @default 'preserve'
|
|
6079
|
+
*/
|
|
6080
|
+
case?: StringCase;
|
|
6081
|
+
/**
|
|
6082
|
+
* Customize the generated name of schemas used in requests or
|
|
6083
|
+
* containing write-only fields.
|
|
6084
|
+
*
|
|
6085
|
+
* @default '{{name}}Writable'
|
|
6086
|
+
*/
|
|
6087
|
+
name?: string | ((name: string) => string);
|
|
6088
|
+
};
|
|
6089
|
+
/**
|
|
6090
|
+
* Configuration for generated response-specific schemas.
|
|
6091
|
+
*
|
|
6092
|
+
* @default '{{name}}'
|
|
6093
|
+
*/
|
|
6094
|
+
responses?:
|
|
6095
|
+
| string
|
|
6096
|
+
| {
|
|
6097
|
+
/**
|
|
6098
|
+
* The casing convention to use for generated names.
|
|
6099
|
+
*
|
|
6100
|
+
* @default 'preserve'
|
|
6101
|
+
*/
|
|
6102
|
+
case?: StringCase;
|
|
6103
|
+
/**
|
|
6104
|
+
* Customize the generated name of schemas used in responses or
|
|
6105
|
+
* containing read-only fields. We default to the original name
|
|
6106
|
+
* to avoid breaking output when a read-only field is added.
|
|
6107
|
+
*
|
|
6108
|
+
* @default '{{name}}'
|
|
6109
|
+
*/
|
|
6110
|
+
name?: string | ((name: string) => string);
|
|
6111
|
+
};
|
|
6112
|
+
};
|
|
6113
|
+
};
|
|
5786
6114
|
/**
|
|
5787
|
-
*
|
|
5788
|
-
*
|
|
6115
|
+
* **This is an experimental feature.**
|
|
6116
|
+
*
|
|
6117
|
+
* Validate the input before generating output? This is an experimental,
|
|
6118
|
+
* lightweight feature and support will be added on an ad hoc basis. Setting
|
|
6119
|
+
* `validate_EXPERIMENTAL` to `true` is the same as `warn`.
|
|
6120
|
+
*
|
|
6121
|
+
* @default false
|
|
5789
6122
|
*/
|
|
5790
|
-
|
|
6123
|
+
validate_EXPERIMENTAL?: boolean | 'strict' | 'warn';
|
|
6124
|
+
};
|
|
6125
|
+
|
|
6126
|
+
type ResolvedParser = {
|
|
5791
6127
|
/**
|
|
5792
|
-
*
|
|
5793
|
-
*
|
|
5794
|
-
* Organization created in Hey API platform.
|
|
6128
|
+
* Filters can be used to select a subset of your input before it's passed
|
|
6129
|
+
* to plugins.
|
|
5795
6130
|
*/
|
|
5796
|
-
|
|
6131
|
+
filters?: Filters;
|
|
5797
6132
|
/**
|
|
5798
6133
|
* Pagination configuration.
|
|
5799
6134
|
*/
|
|
5800
|
-
pagination
|
|
6135
|
+
pagination: {
|
|
5801
6136
|
/**
|
|
5802
6137
|
* Array of keywords to be considered as pagination field names.
|
|
5803
6138
|
* These will be used to detect pagination fields in schemas and parameters.
|
|
5804
6139
|
*
|
|
5805
6140
|
* @default ['after', 'before', 'cursor', 'offset', 'page', 'start']
|
|
5806
6141
|
*/
|
|
5807
|
-
keywords
|
|
6142
|
+
keywords: ReadonlyArray<string>;
|
|
5808
6143
|
};
|
|
5809
6144
|
/**
|
|
5810
|
-
* Custom input transformations to execute before parsing.
|
|
5811
|
-
* to modify, fix, or enhance input
|
|
6145
|
+
* Custom input transformations to execute before parsing. Use this
|
|
6146
|
+
* to modify, fix, or enhance input before it's passed to plugins.
|
|
5812
6147
|
*/
|
|
5813
6148
|
patch?: Patch;
|
|
5814
6149
|
/**
|
|
5815
|
-
*
|
|
5816
|
-
*
|
|
5817
|
-
*
|
|
6150
|
+
* Built-in transformations that modify or normalize the input before it's
|
|
6151
|
+
* passed to plugins. These options enable predictable, documented behaviors
|
|
6152
|
+
* and are distinct from custom patches. Use this to perform structural
|
|
6153
|
+
* changes to input in a standardized way.
|
|
5818
6154
|
*/
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
6155
|
+
transforms: {
|
|
6156
|
+
/**
|
|
6157
|
+
* Your input might contain two types of enums:
|
|
6158
|
+
* - enums defined as reusable components (root enums)
|
|
6159
|
+
* - non-reusable enums nested within other schemas (inline enums)
|
|
6160
|
+
*
|
|
6161
|
+
* You may want all enums to be reusable. This is because only root enums
|
|
6162
|
+
* are typically exported by plugins. Inline enums will never be directly
|
|
6163
|
+
* importable since they're nested inside other schemas.
|
|
6164
|
+
*
|
|
6165
|
+
* For example, to export nested enum types with the `@hey-api/typescript`
|
|
6166
|
+
* plugin, set `enums` to `root`. Likewise, if you don't want to export any
|
|
6167
|
+
* enum types, set `enums` to `inline`.
|
|
6168
|
+
*/
|
|
6169
|
+
enums: {
|
|
6170
|
+
/**
|
|
6171
|
+
* The casing convention to use for generated names.
|
|
6172
|
+
*
|
|
6173
|
+
* @default 'PascalCase'
|
|
6174
|
+
*/
|
|
6175
|
+
case: StringCase;
|
|
6176
|
+
/**
|
|
6177
|
+
* Whether to transform all enums.
|
|
6178
|
+
*
|
|
6179
|
+
* @default true
|
|
6180
|
+
*/
|
|
6181
|
+
enabled: boolean;
|
|
6182
|
+
/**
|
|
6183
|
+
* Controls whether enums are promoted to reusable root components
|
|
6184
|
+
* ('root') or kept inline within schemas ('inline').
|
|
6185
|
+
*
|
|
6186
|
+
* @default 'root'
|
|
6187
|
+
*/
|
|
6188
|
+
mode: EnumsMode;
|
|
6189
|
+
/**
|
|
6190
|
+
* Customize the generated name of enums.
|
|
6191
|
+
*
|
|
6192
|
+
* @default '{{name}}Enum'
|
|
6193
|
+
*/
|
|
6194
|
+
name: string | ((name: string) => string);
|
|
6195
|
+
};
|
|
6196
|
+
/**
|
|
6197
|
+
* Your schemas might contain read-only or write-only fields. Using such
|
|
6198
|
+
* schemas directly could mean asking the user to provide a read-only
|
|
6199
|
+
* field in requests, or expecting a write-only field in responses.
|
|
6200
|
+
*
|
|
6201
|
+
* We separate schemas for requests and responses if direct usage
|
|
6202
|
+
* would result in such scenarios. You can still disable this
|
|
6203
|
+
* behavior if you prefer.
|
|
6204
|
+
*/
|
|
6205
|
+
readWrite: {
|
|
6206
|
+
/**
|
|
6207
|
+
* Whether to split read-only and write-only schemas.
|
|
6208
|
+
*
|
|
6209
|
+
* @default true
|
|
6210
|
+
*/
|
|
6211
|
+
enabled: boolean;
|
|
6212
|
+
/**
|
|
6213
|
+
* Configuration for generated request-specific schemas.
|
|
6214
|
+
*/
|
|
6215
|
+
requests: {
|
|
6216
|
+
/**
|
|
6217
|
+
* The casing convention to use for generated names.
|
|
6218
|
+
*
|
|
6219
|
+
* @default 'preserve'
|
|
6220
|
+
*/
|
|
6221
|
+
case: StringCase;
|
|
6222
|
+
/**
|
|
6223
|
+
* Customize the generated name of schemas used in requests or
|
|
6224
|
+
* containing write-only fields.
|
|
6225
|
+
*
|
|
6226
|
+
* @default '{{name}}Writable'
|
|
6227
|
+
*/
|
|
6228
|
+
name: string | ((name: string) => string);
|
|
6229
|
+
};
|
|
6230
|
+
/**
|
|
6231
|
+
* Configuration for generated response-specific schemas.
|
|
6232
|
+
*/
|
|
6233
|
+
responses: {
|
|
6234
|
+
/**
|
|
6235
|
+
* The casing convention to use for generated names.
|
|
6236
|
+
*
|
|
6237
|
+
* @default 'preserve'
|
|
6238
|
+
*/
|
|
6239
|
+
case: StringCase;
|
|
6240
|
+
/**
|
|
6241
|
+
* Customize the generated name of schemas used in responses or
|
|
6242
|
+
* containing read-only fields. We default to the original name
|
|
6243
|
+
* to avoid breaking output when a read-only field is added.
|
|
6244
|
+
*
|
|
6245
|
+
* @default '{{name}}'
|
|
6246
|
+
*/
|
|
6247
|
+
name: string | ((name: string) => string);
|
|
6248
|
+
};
|
|
6249
|
+
};
|
|
6250
|
+
};
|
|
5837
6251
|
/**
|
|
5838
6252
|
* **This is an experimental feature.**
|
|
5839
6253
|
*
|
|
@@ -5843,25 +6257,10 @@ interface Input {
|
|
|
5843
6257
|
*
|
|
5844
6258
|
* @default false
|
|
5845
6259
|
*/
|
|
5846
|
-
validate_EXPERIMENTAL
|
|
5847
|
-
|
|
5848
|
-
* **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
|
|
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.
|
|
5853
|
-
*/
|
|
5854
|
-
version?: string;
|
|
5855
|
-
/**
|
|
5856
|
-
* Regenerate the client when the input file changes? You can alternatively
|
|
5857
|
-
* pass a numeric value for the interval in ms.
|
|
5858
|
-
*
|
|
5859
|
-
* @default false
|
|
5860
|
-
*/
|
|
5861
|
-
watch?: boolean | number | Watch;
|
|
5862
|
-
}
|
|
6260
|
+
validate_EXPERIMENTAL: false | 'strict' | 'warn';
|
|
6261
|
+
};
|
|
5863
6262
|
|
|
5864
|
-
|
|
6263
|
+
type Filters = {
|
|
5865
6264
|
/**
|
|
5866
6265
|
* Include deprecated resources in the output?
|
|
5867
6266
|
*
|
|
@@ -5990,9 +6389,9 @@ interface Filters {
|
|
|
5990
6389
|
*/
|
|
5991
6390
|
include?: ReadonlyArray<string>;
|
|
5992
6391
|
};
|
|
5993
|
-
}
|
|
6392
|
+
};
|
|
5994
6393
|
|
|
5995
|
-
|
|
6394
|
+
type Patch = {
|
|
5996
6395
|
/**
|
|
5997
6396
|
* Patch the OpenAPI meta object in place. Useful for modifying general metadata such as title, description, version, or custom fields before further processing.
|
|
5998
6397
|
*
|
|
@@ -6004,6 +6403,25 @@ interface Patch {
|
|
|
6004
6403
|
| OpenApiMetaObject.V3_0_X
|
|
6005
6404
|
| OpenApiMetaObject.V3_1_X,
|
|
6006
6405
|
) => void;
|
|
6406
|
+
/**
|
|
6407
|
+
* Patch OpenAPI operations in place. The key is the operation method and operation path, and the function receives the operation object to modify directly.
|
|
6408
|
+
*
|
|
6409
|
+
* @example
|
|
6410
|
+
* operations: {
|
|
6411
|
+
* 'GET /foo': (operation) => {
|
|
6412
|
+
* operation.responses['200'].description = 'foo';
|
|
6413
|
+
* }
|
|
6414
|
+
* }
|
|
6415
|
+
*/
|
|
6416
|
+
operations?: Record<
|
|
6417
|
+
string,
|
|
6418
|
+
(
|
|
6419
|
+
operation:
|
|
6420
|
+
| OpenApiOperationObject.V2_0_X
|
|
6421
|
+
| OpenApiOperationObject.V3_0_X
|
|
6422
|
+
| OpenApiOperationObject.V3_1_X,
|
|
6423
|
+
) => void
|
|
6424
|
+
>;
|
|
6007
6425
|
/**
|
|
6008
6426
|
* Patch OpenAPI parameters in place. The key is the parameter name, and the function receives the parameter object to modify directly.
|
|
6009
6427
|
*
|
|
@@ -6101,33 +6519,8 @@ interface Patch {
|
|
|
6101
6519
|
* @example
|
|
6102
6520
|
* version: (version) => version.replace(/^v/, '')
|
|
6103
6521
|
*/
|
|
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';
|
|
6522
|
+
version?: string | ((version: string) => string);
|
|
6523
|
+
};
|
|
6131
6524
|
|
|
6132
6525
|
interface UserConfig {
|
|
6133
6526
|
/**
|
|
@@ -6154,106 +6547,20 @@ interface UserConfig {
|
|
|
6154
6547
|
| (Record<string, unknown> & { path?: never })
|
|
6155
6548
|
| Input;
|
|
6156
6549
|
/**
|
|
6157
|
-
* The relative location of the logs folder
|
|
6550
|
+
* The relative location of the logs folder.
|
|
6158
6551
|
*
|
|
6159
6552
|
* @default process.cwd()
|
|
6160
6553
|
*/
|
|
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
|
-
};
|
|
6554
|
+
logs?: string | Logs;
|
|
6203
6555
|
/**
|
|
6204
|
-
* The relative location of the output folder
|
|
6556
|
+
* The relative location of the output folder.
|
|
6205
6557
|
*/
|
|
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
|
-
};
|
|
6558
|
+
output: string | Output;
|
|
6559
|
+
/**
|
|
6560
|
+
* Customize how the input is parsed and transformed before it's passed to
|
|
6561
|
+
* plugins.
|
|
6562
|
+
*/
|
|
6563
|
+
parser?: Parser;
|
|
6257
6564
|
/**
|
|
6258
6565
|
* Plugins generate artifacts from `input`. By default, we generate SDK
|
|
6259
6566
|
* functions and TypeScript interfaces. If you manually define `plugins`,
|
|
@@ -6331,17 +6638,23 @@ type Config$l = Omit<
|
|
|
6331
6638
|
| 'logs'
|
|
6332
6639
|
| 'name'
|
|
6333
6640
|
| 'output'
|
|
6641
|
+
| 'parser'
|
|
6334
6642
|
| 'plugins'
|
|
6335
6643
|
| 'request'
|
|
6336
6644
|
| 'watch'
|
|
6337
6645
|
> &
|
|
6338
6646
|
Pick<UserConfig, 'base' | 'name' | 'request'> & {
|
|
6339
|
-
input: Omit<Input, 'path' | '
|
|
6340
|
-
Pick<Required<Input>, 'path'
|
|
6647
|
+
input: Omit<Input, 'path' | 'watch'> &
|
|
6648
|
+
Pick<Required<Input>, 'path'> & {
|
|
6341
6649
|
watch: Extract<Required<Required<Input>['watch']>, object>;
|
|
6342
6650
|
};
|
|
6343
6651
|
logs: Extract<Required<UserConfig['logs']>, object>;
|
|
6344
6652
|
output: Extract<UserConfig['output'], object>;
|
|
6653
|
+
/**
|
|
6654
|
+
* Customize how the input is parsed and transformed before it's passed to
|
|
6655
|
+
* plugins.
|
|
6656
|
+
*/
|
|
6657
|
+
parser: ResolvedParser;
|
|
6345
6658
|
pluginOrder: ReadonlyArray<keyof PluginConfigMap>;
|
|
6346
6659
|
plugins: {
|
|
6347
6660
|
[K in PluginNames]?: Plugin.ConfigWithName<PluginConfigMap[K]>;
|
|
@@ -7281,11 +7594,6 @@ type AnyPluginName = PluginNames | (string & {});
|
|
|
7281
7594
|
|
|
7282
7595
|
type PluginTag = 'client' | 'transformer' | 'validator';
|
|
7283
7596
|
|
|
7284
|
-
type ObjectType<T> =
|
|
7285
|
-
Extract<T, Record<string, any>> extends never
|
|
7286
|
-
? Record<string, any>
|
|
7287
|
-
: Extract<T, Record<string, any>>;
|
|
7288
|
-
|
|
7289
7597
|
interface PluginContext {
|
|
7290
7598
|
pluginByTag: <T extends AnyPluginName | boolean = AnyPluginName>(
|
|
7291
7599
|
tag: PluginTag,
|
|
@@ -7294,25 +7602,7 @@ interface PluginContext {
|
|
|
7294
7602
|
errorMessage?: string;
|
|
7295
7603
|
},
|
|
7296
7604
|
) => 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>;
|
|
7605
|
+
valueToObject: ValueToObject;
|
|
7316
7606
|
}
|
|
7317
7607
|
|
|
7318
7608
|
type BaseApi = Record<string, unknown>;
|
|
@@ -7775,7 +8065,7 @@ type Config$a = Plugin.Name<'@hey-api/sdk'> & {
|
|
|
7775
8065
|
response?: 'body' | 'response';
|
|
7776
8066
|
};
|
|
7777
8067
|
|
|
7778
|
-
type ResolvedConfig$
|
|
8068
|
+
type ResolvedConfig$8 = Plugin.Name<'@hey-api/sdk'> & {
|
|
7779
8069
|
/**
|
|
7780
8070
|
* Group operation methods into classes? When enabled, you can select which
|
|
7781
8071
|
* classes to export with `sdk.include` and/or transform their names with
|
|
@@ -7927,7 +8217,7 @@ type ResolvedConfig$7 = Plugin.Name<'@hey-api/sdk'> & {
|
|
|
7927
8217
|
response: 'body' | 'response';
|
|
7928
8218
|
};
|
|
7929
8219
|
|
|
7930
|
-
type HeyApiSdkPlugin = DefinePlugin<Config$a, ResolvedConfig$
|
|
8220
|
+
type HeyApiSdkPlugin = DefinePlugin<Config$a, ResolvedConfig$8>;
|
|
7931
8221
|
|
|
7932
8222
|
type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
7933
8223
|
/**
|
|
@@ -7959,31 +8249,62 @@ type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
|
7959
8249
|
|
|
7960
8250
|
type HeyApiTransformersPlugin = DefinePlugin<Config$9>;
|
|
7961
8251
|
|
|
8252
|
+
type EnumsType = 'javascript' | 'typescript' | 'typescript+namespace';
|
|
8253
|
+
|
|
7962
8254
|
type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
7963
8255
|
/**
|
|
7964
|
-
*
|
|
7965
|
-
* you can choose to generate them as JavaScript objects, TypeScript enums,
|
|
7966
|
-
* or TypeScript enums contained within namespaces.
|
|
8256
|
+
* The casing convention to use for generated names.
|
|
7967
8257
|
*
|
|
7968
|
-
* @default
|
|
8258
|
+
* @default 'PascalCase'
|
|
7969
8259
|
*/
|
|
7970
|
-
|
|
8260
|
+
case?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
7971
8261
|
/**
|
|
7972
|
-
*
|
|
7973
|
-
* This option has effect only when `enums` is defined.
|
|
8262
|
+
* By default, enums are emitted as types to preserve runtime-free output.
|
|
7974
8263
|
*
|
|
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.
|
|
8264
|
+
* However, you may want to generate enums as JavaScript objects or
|
|
8265
|
+
* TypeScript enums for runtime usage, interoperability, or integration with
|
|
8266
|
+
* other tools.
|
|
7983
8267
|
*
|
|
7984
8268
|
* @default false
|
|
7985
8269
|
*/
|
|
7986
|
-
|
|
8270
|
+
enums?:
|
|
8271
|
+
| boolean
|
|
8272
|
+
| EnumsType
|
|
8273
|
+
| {
|
|
8274
|
+
/**
|
|
8275
|
+
* The casing convention to use for generated names.
|
|
8276
|
+
*
|
|
8277
|
+
* @default 'SCREAMING_SNAKE_CASE'
|
|
8278
|
+
*/
|
|
8279
|
+
case?: StringCase;
|
|
8280
|
+
/**
|
|
8281
|
+
* When generating enums as JavaScript objects, they'll contain a null
|
|
8282
|
+
* value if they're nullable. This might be undesirable if you want to do
|
|
8283
|
+
* `Object.values(Foo)` and have all values be of the same type.
|
|
8284
|
+
*
|
|
8285
|
+
* This setting is disabled by default to preserve the source schemas.
|
|
8286
|
+
*
|
|
8287
|
+
* @default false
|
|
8288
|
+
*/
|
|
8289
|
+
constantsIgnoreNull?: boolean;
|
|
8290
|
+
/**
|
|
8291
|
+
* Whether to generate runtime enums.
|
|
8292
|
+
*
|
|
8293
|
+
* @default true
|
|
8294
|
+
*/
|
|
8295
|
+
enabled?: boolean;
|
|
8296
|
+
/**
|
|
8297
|
+
* Specifies the output mode for generated enums.
|
|
8298
|
+
*
|
|
8299
|
+
* Can be:
|
|
8300
|
+
* - `javascript`: Generates JavaScript objects
|
|
8301
|
+
* - `typescript`: Generates TypeScript enums
|
|
8302
|
+
* - `typescript+namespace`: Generates TypeScript enums within a namespace
|
|
8303
|
+
*
|
|
8304
|
+
* @default 'javascript'
|
|
8305
|
+
*/
|
|
8306
|
+
mode?: EnumsType;
|
|
8307
|
+
};
|
|
7987
8308
|
/**
|
|
7988
8309
|
* Should the exports from the generated files be re-exported in the index
|
|
7989
8310
|
* barrel file?
|
|
@@ -7992,48 +8313,106 @@ type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
|
7992
8313
|
*/
|
|
7993
8314
|
exportFromIndex?: boolean;
|
|
7994
8315
|
/**
|
|
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`.
|
|
8316
|
+
* Name of the generated file.
|
|
7999
8317
|
*
|
|
8000
|
-
* @default
|
|
8318
|
+
* @default 'types'
|
|
8001
8319
|
*/
|
|
8002
|
-
|
|
8320
|
+
output?: string;
|
|
8321
|
+
|
|
8322
|
+
// DEPRECATED OPTIONS BELOW
|
|
8323
|
+
|
|
8003
8324
|
/**
|
|
8004
|
-
*
|
|
8325
|
+
* **This feature works only with the legacy parser**
|
|
8005
8326
|
*
|
|
8006
|
-
*
|
|
8327
|
+
* Include only types matching regular expression.
|
|
8328
|
+
*
|
|
8329
|
+
* @deprecated
|
|
8007
8330
|
*/
|
|
8008
|
-
|
|
8331
|
+
// eslint-disable-next-line typescript-sort-keys/interface
|
|
8332
|
+
include?: string;
|
|
8009
8333
|
/**
|
|
8010
|
-
*
|
|
8334
|
+
* **This feature works only with the legacy parser**
|
|
8011
8335
|
*
|
|
8012
|
-
*
|
|
8336
|
+
* Use your preferred naming pattern
|
|
8337
|
+
*
|
|
8338
|
+
* @deprecated
|
|
8339
|
+
* @default 'preserve'
|
|
8013
8340
|
*/
|
|
8014
|
-
|
|
8341
|
+
style?: 'PascalCase' | 'preserve';
|
|
8342
|
+
/**
|
|
8343
|
+
* **This feature works only with the legacy parser**
|
|
8344
|
+
*
|
|
8345
|
+
* Generate a tree of types containing all operations? It will be named
|
|
8346
|
+
* $OpenApiTs.
|
|
8347
|
+
*
|
|
8348
|
+
* @deprecated
|
|
8349
|
+
* @default false
|
|
8350
|
+
*/
|
|
8351
|
+
tree?: boolean;
|
|
8352
|
+
};
|
|
8353
|
+
|
|
8354
|
+
type ResolvedConfig$7 = Plugin.Name<'@hey-api/typescript'> & {
|
|
8355
|
+
/**
|
|
8356
|
+
* The casing convention to use for generated names.
|
|
8357
|
+
*
|
|
8358
|
+
* @default 'PascalCase'
|
|
8359
|
+
*/
|
|
8360
|
+
case: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
8015
8361
|
/**
|
|
8016
|
-
*
|
|
8017
|
-
* This option exists for backward compatibility with outputs created before
|
|
8018
|
-
* this feature existed.
|
|
8362
|
+
* By default, enums are emitted as types to preserve runtime-free output.
|
|
8019
8363
|
*
|
|
8020
|
-
*
|
|
8364
|
+
* However, you may want to generate enums as JavaScript objects or
|
|
8365
|
+
* TypeScript enums for runtime usage, interoperability, or integration with
|
|
8366
|
+
* other tools.
|
|
8021
8367
|
*/
|
|
8022
|
-
|
|
8368
|
+
enums: {
|
|
8369
|
+
/**
|
|
8370
|
+
* The casing convention to use for generated names.
|
|
8371
|
+
*
|
|
8372
|
+
* @default 'SCREAMING_SNAKE_CASE'
|
|
8373
|
+
*/
|
|
8374
|
+
case: StringCase;
|
|
8375
|
+
/**
|
|
8376
|
+
* When generating enums as JavaScript objects, they'll contain a null
|
|
8377
|
+
* value if they're nullable. This might be undesirable if you want to do
|
|
8378
|
+
* `Object.values(Foo)` and have all values be of the same type.
|
|
8379
|
+
*
|
|
8380
|
+
* This setting is disabled by default to preserve the source schemas.
|
|
8381
|
+
*
|
|
8382
|
+
* @default false
|
|
8383
|
+
*/
|
|
8384
|
+
constantsIgnoreNull: boolean;
|
|
8385
|
+
/**
|
|
8386
|
+
* Whether to generate runtime enums.
|
|
8387
|
+
*
|
|
8388
|
+
* @default false
|
|
8389
|
+
*/
|
|
8390
|
+
enabled: boolean;
|
|
8391
|
+
/**
|
|
8392
|
+
* Specifies the output mode for generated enums.
|
|
8393
|
+
*
|
|
8394
|
+
* Can be:
|
|
8395
|
+
* - `javascript`: Generates JavaScript objects
|
|
8396
|
+
* - `typescript`: Generates TypeScript enums
|
|
8397
|
+
* - `typescript+namespace`: Generates TypeScript enums within a namespace
|
|
8398
|
+
*
|
|
8399
|
+
* @default 'javascript'
|
|
8400
|
+
*/
|
|
8401
|
+
mode: EnumsType;
|
|
8402
|
+
};
|
|
8023
8403
|
/**
|
|
8024
|
-
*
|
|
8025
|
-
*
|
|
8404
|
+
* Should the exports from the generated files be re-exported in the index
|
|
8405
|
+
* barrel file?
|
|
8026
8406
|
*
|
|
8027
|
-
* @default
|
|
8407
|
+
* @default true
|
|
8028
8408
|
*/
|
|
8029
|
-
|
|
8409
|
+
exportFromIndex: boolean;
|
|
8030
8410
|
/**
|
|
8031
|
-
*
|
|
8032
|
-
* fields.
|
|
8411
|
+
* Name of the generated file.
|
|
8033
8412
|
*
|
|
8034
|
-
* @default '
|
|
8413
|
+
* @default 'types'
|
|
8035
8414
|
*/
|
|
8036
|
-
|
|
8415
|
+
output: string;
|
|
8037
8416
|
|
|
8038
8417
|
// DEPRECATED OPTIONS BELOW
|
|
8039
8418
|
|
|
@@ -8054,7 +8433,7 @@ type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
|
8054
8433
|
* @deprecated
|
|
8055
8434
|
* @default 'preserve'
|
|
8056
8435
|
*/
|
|
8057
|
-
style
|
|
8436
|
+
style: 'PascalCase' | 'preserve';
|
|
8058
8437
|
/**
|
|
8059
8438
|
* **This feature works only with the legacy parser**
|
|
8060
8439
|
*
|
|
@@ -8064,10 +8443,10 @@ type Config$8 = Plugin.Name<'@hey-api/typescript'> & {
|
|
|
8064
8443
|
* @deprecated
|
|
8065
8444
|
* @default false
|
|
8066
8445
|
*/
|
|
8067
|
-
tree
|
|
8446
|
+
tree: boolean;
|
|
8068
8447
|
};
|
|
8069
8448
|
|
|
8070
|
-
type HeyApiTypeScriptPlugin = DefinePlugin<Config$8>;
|
|
8449
|
+
type HeyApiTypeScriptPlugin = DefinePlugin<Config$8, ResolvedConfig$7>;
|
|
8071
8450
|
|
|
8072
8451
|
type Config$7 = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
|
8073
8452
|
/**
|
|
@@ -9152,9 +9531,10 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9152
9531
|
*/
|
|
9153
9532
|
comments?: boolean;
|
|
9154
9533
|
/**
|
|
9155
|
-
* Configuration for reusable schema definitions.
|
|
9156
|
-
*
|
|
9157
|
-
*
|
|
9534
|
+
* Configuration for reusable schema definitions.
|
|
9535
|
+
*
|
|
9536
|
+
* Controls generation of shared Valibot schemas that can be referenced
|
|
9537
|
+
* across requests and responses.
|
|
9158
9538
|
*
|
|
9159
9539
|
* Can be:
|
|
9160
9540
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9178,8 +9558,8 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9178
9558
|
*/
|
|
9179
9559
|
enabled?: boolean;
|
|
9180
9560
|
/**
|
|
9181
|
-
* Custom naming pattern for generated schema names. The name variable
|
|
9182
|
-
* obtained from the schema name.
|
|
9561
|
+
* Custom naming pattern for generated schema names. The name variable
|
|
9562
|
+
* is obtained from the schema name.
|
|
9183
9563
|
*
|
|
9184
9564
|
* @default 'v{{name}}'
|
|
9185
9565
|
*/
|
|
@@ -9208,6 +9588,7 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9208
9588
|
output?: string;
|
|
9209
9589
|
/**
|
|
9210
9590
|
* Configuration for request-specific Valibot schemas.
|
|
9591
|
+
*
|
|
9211
9592
|
* Controls generation of Valibot schemas for request bodies, query
|
|
9212
9593
|
* parameters, path parameters, and headers.
|
|
9213
9594
|
*
|
|
@@ -9233,8 +9614,8 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9233
9614
|
*/
|
|
9234
9615
|
enabled?: boolean;
|
|
9235
9616
|
/**
|
|
9236
|
-
* Custom naming pattern for generated schema names. The name variable
|
|
9237
|
-
* obtained from the operation name.
|
|
9617
|
+
* Custom naming pattern for generated schema names. The name variable
|
|
9618
|
+
* is obtained from the operation name.
|
|
9238
9619
|
*
|
|
9239
9620
|
* @default 'v{{name}}Data'
|
|
9240
9621
|
*/
|
|
@@ -9242,6 +9623,7 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9242
9623
|
};
|
|
9243
9624
|
/**
|
|
9244
9625
|
* Configuration for response-specific Valibot schemas.
|
|
9626
|
+
*
|
|
9245
9627
|
* Controls generation of Valibot schemas for response bodies, error
|
|
9246
9628
|
* responses, and status codes.
|
|
9247
9629
|
*
|
|
@@ -9267,8 +9649,8 @@ type Config$1 = Plugin.Name<'valibot'> & {
|
|
|
9267
9649
|
*/
|
|
9268
9650
|
enabled?: boolean;
|
|
9269
9651
|
/**
|
|
9270
|
-
* Custom naming pattern for generated schema names. The name variable
|
|
9271
|
-
* obtained from the operation name.
|
|
9652
|
+
* Custom naming pattern for generated schema names. The name variable
|
|
9653
|
+
* is obtained from the operation name.
|
|
9272
9654
|
*
|
|
9273
9655
|
* @default 'v{{name}}Response'
|
|
9274
9656
|
*/
|
|
@@ -9290,9 +9672,10 @@ type ResolvedConfig$1 = Plugin.Name<'valibot'> & {
|
|
|
9290
9672
|
*/
|
|
9291
9673
|
comments: boolean;
|
|
9292
9674
|
/**
|
|
9293
|
-
* Configuration for reusable schema definitions.
|
|
9294
|
-
*
|
|
9295
|
-
*
|
|
9675
|
+
* Configuration for reusable schema definitions.
|
|
9676
|
+
*
|
|
9677
|
+
* Controls generation of shared Valibot schemas that can be referenced
|
|
9678
|
+
* across requests and responses.
|
|
9296
9679
|
*/
|
|
9297
9680
|
definitions: {
|
|
9298
9681
|
/**
|
|
@@ -9338,6 +9721,7 @@ type ResolvedConfig$1 = Plugin.Name<'valibot'> & {
|
|
|
9338
9721
|
output: string;
|
|
9339
9722
|
/**
|
|
9340
9723
|
* Configuration for request-specific Valibot schemas.
|
|
9724
|
+
*
|
|
9341
9725
|
* Controls generation of Valibot schemas for request bodies, query
|
|
9342
9726
|
* parameters, path parameters, and headers.
|
|
9343
9727
|
*/
|
|
@@ -9364,6 +9748,7 @@ type ResolvedConfig$1 = Plugin.Name<'valibot'> & {
|
|
|
9364
9748
|
};
|
|
9365
9749
|
/**
|
|
9366
9750
|
* Configuration for response-specific Valibot schemas.
|
|
9751
|
+
*
|
|
9367
9752
|
* Controls generation of Valibot schemas for response bodies, error
|
|
9368
9753
|
* responses, and status codes.
|
|
9369
9754
|
*/
|
|
@@ -9419,8 +9804,27 @@ type Config = Plugin.Name<'zod'> & {
|
|
|
9419
9804
|
*/
|
|
9420
9805
|
comments?: boolean;
|
|
9421
9806
|
/**
|
|
9422
|
-
* Configuration for
|
|
9423
|
-
*
|
|
9807
|
+
* Configuration for date handling in generated Zod schemas.
|
|
9808
|
+
*
|
|
9809
|
+
* Controls how date values are processed and validated using Zod's
|
|
9810
|
+
* date validation features.
|
|
9811
|
+
*/
|
|
9812
|
+
dates?: {
|
|
9813
|
+
/**
|
|
9814
|
+
* Whether to include timezone offset information when handling dates.
|
|
9815
|
+
*
|
|
9816
|
+
* When enabled, date strings will preserve timezone information.
|
|
9817
|
+
* When disabled, dates will be treated as local time.
|
|
9818
|
+
*
|
|
9819
|
+
* @default false
|
|
9820
|
+
*/
|
|
9821
|
+
offset?: boolean;
|
|
9822
|
+
};
|
|
9823
|
+
/**
|
|
9824
|
+
* Configuration for reusable schema definitions.
|
|
9825
|
+
*
|
|
9826
|
+
* Controls generation of shared Zod schemas that can be referenced across
|
|
9827
|
+
* requests and responses.
|
|
9424
9828
|
*
|
|
9425
9829
|
* Can be:
|
|
9426
9830
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9474,7 +9878,9 @@ type Config = Plugin.Name<'zod'> & {
|
|
|
9474
9878
|
output?: string;
|
|
9475
9879
|
/**
|
|
9476
9880
|
* Configuration for request-specific Zod schemas.
|
|
9477
|
-
*
|
|
9881
|
+
*
|
|
9882
|
+
* Controls generation of Zod schemas for request bodies, query parameters, path
|
|
9883
|
+
* parameters, and headers.
|
|
9478
9884
|
*
|
|
9479
9885
|
* Can be:
|
|
9480
9886
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9507,7 +9913,9 @@ type Config = Plugin.Name<'zod'> & {
|
|
|
9507
9913
|
};
|
|
9508
9914
|
/**
|
|
9509
9915
|
* Configuration for response-specific Zod schemas.
|
|
9510
|
-
*
|
|
9916
|
+
*
|
|
9917
|
+
* Controls generation of Zod schemas for response bodies, error responses,
|
|
9918
|
+
* and status codes.
|
|
9511
9919
|
*
|
|
9512
9920
|
* Can be:
|
|
9513
9921
|
* - `boolean`: Shorthand for `{ enabled: boolean }`
|
|
@@ -9554,8 +9962,27 @@ type ResolvedConfig = Plugin.Name<'zod'> & {
|
|
|
9554
9962
|
*/
|
|
9555
9963
|
comments: boolean;
|
|
9556
9964
|
/**
|
|
9557
|
-
* Configuration for
|
|
9558
|
-
*
|
|
9965
|
+
* Configuration for date handling in generated Zod schemas.
|
|
9966
|
+
*
|
|
9967
|
+
* Controls how date values are processed and validated using Zod's
|
|
9968
|
+
* date validation features.
|
|
9969
|
+
*/
|
|
9970
|
+
dates: {
|
|
9971
|
+
/**
|
|
9972
|
+
* Whether to include timezone offset information when handling dates.
|
|
9973
|
+
*
|
|
9974
|
+
* When enabled, date strings will preserve timezone information.
|
|
9975
|
+
* When disabled, dates will be treated as local time.
|
|
9976
|
+
*
|
|
9977
|
+
* @default false
|
|
9978
|
+
*/
|
|
9979
|
+
offset: boolean;
|
|
9980
|
+
};
|
|
9981
|
+
/**
|
|
9982
|
+
* Configuration for reusable schema definitions.
|
|
9983
|
+
*
|
|
9984
|
+
* Controls generation of shared Zod schemas that can be referenced across
|
|
9985
|
+
* requests and responses.
|
|
9559
9986
|
*/
|
|
9560
9987
|
definitions: {
|
|
9561
9988
|
/**
|
|
@@ -9601,7 +10028,9 @@ type ResolvedConfig = Plugin.Name<'zod'> & {
|
|
|
9601
10028
|
output: string;
|
|
9602
10029
|
/**
|
|
9603
10030
|
* Configuration for request-specific Zod schemas.
|
|
9604
|
-
*
|
|
10031
|
+
*
|
|
10032
|
+
* Controls generation of Zod schemas for request bodies, query parameters, path
|
|
10033
|
+
* parameters, and headers.
|
|
9605
10034
|
*/
|
|
9606
10035
|
requests: {
|
|
9607
10036
|
/**
|
|
@@ -9626,7 +10055,9 @@ type ResolvedConfig = Plugin.Name<'zod'> & {
|
|
|
9626
10055
|
};
|
|
9627
10056
|
/**
|
|
9628
10057
|
* Configuration for response-specific Zod schemas.
|
|
9629
|
-
*
|
|
10058
|
+
*
|
|
10059
|
+
* Controls generation of Zod schemas for response bodies, error responses,
|
|
10060
|
+
* and status codes.
|
|
9630
10061
|
*/
|
|
9631
10062
|
responses: {
|
|
9632
10063
|
/**
|
|
@@ -10004,18 +10435,6 @@ declare namespace IR {
|
|
|
10004
10435
|
export type ServerObject = IRServerObject;
|
|
10005
10436
|
}
|
|
10006
10437
|
|
|
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
10438
|
declare namespace LegacyIR {
|
|
10020
10439
|
export type LegacyOperation = Operation;
|
|
10021
10440
|
}
|
|
@@ -10038,4 +10457,4 @@ interface WatchValues {
|
|
|
10038
10457
|
lastValue?: string;
|
|
10039
10458
|
}
|
|
10040
10459
|
|
|
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,
|
|
10460
|
+
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 };
|