@hey-api/openapi-ts 0.61.2 → 0.62.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 +0 -29
- package/dist/index.cjs +6 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -76
- package/dist/index.d.ts +51 -76
- package/dist/index.js +7 -19
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -640,7 +640,7 @@ interface ExternalDocumentationObject$2 {
|
|
|
640
640
|
* type: integer
|
|
641
641
|
* ```
|
|
642
642
|
*/
|
|
643
|
-
|
|
643
|
+
type HeaderObject$2 = Omit<ParameterObject$2, 'in' | 'name'>;
|
|
644
644
|
|
|
645
645
|
/**
|
|
646
646
|
* The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
|
|
@@ -1676,7 +1676,7 @@ interface ResponsesObject$2 {
|
|
|
1676
1676
|
*
|
|
1677
1677
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}, though as noted, additional properties MAY omit the `x-` prefix within this object.
|
|
1678
1678
|
*/
|
|
1679
|
-
|
|
1679
|
+
type SchemaObject$2 = JsonSchemaDraft2020_12;
|
|
1680
1680
|
|
|
1681
1681
|
/**
|
|
1682
1682
|
* Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsSecuritySchemes Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object Components Object}.
|
|
@@ -2483,7 +2483,6 @@ type JsonSchemaFormats$2 =
|
|
|
2483
2483
|
| 'uri-reference'
|
|
2484
2484
|
| 'uri-template'
|
|
2485
2485
|
| 'uuid'
|
|
2486
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2487
2486
|
| (string & {});
|
|
2488
2487
|
|
|
2489
2488
|
type JsonSchemaTypes$1 =
|
|
@@ -3444,7 +3443,6 @@ type JsonSchemaFormats$1 =
|
|
|
3444
3443
|
| 'ipv4'
|
|
3445
3444
|
| 'ipv6'
|
|
3446
3445
|
| 'uri'
|
|
3447
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
3448
3446
|
| (string & {});
|
|
3449
3447
|
|
|
3450
3448
|
type JsonSchemaTypes =
|
|
@@ -5307,7 +5305,7 @@ interface ExternalDocumentationObject {
|
|
|
5307
5305
|
*
|
|
5308
5306
|
* TODO: examples
|
|
5309
5307
|
*/
|
|
5310
|
-
|
|
5308
|
+
type HeaderObject = Omit<ParameterObject, 'in' | 'name'>;
|
|
5311
5309
|
|
|
5312
5310
|
/**
|
|
5313
5311
|
* The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
|
|
@@ -6331,11 +6329,7 @@ type OpenApiSchemaFormats =
|
|
|
6331
6329
|
| 'date-time'
|
|
6332
6330
|
| 'password';
|
|
6333
6331
|
|
|
6334
|
-
type Format =
|
|
6335
|
-
| JsonSchemaFormats
|
|
6336
|
-
| OpenApiSchemaFormats
|
|
6337
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6338
|
-
| (string & {});
|
|
6332
|
+
type Format = JsonSchemaFormats | OpenApiSchemaFormats | (string & {});
|
|
6339
6333
|
|
|
6340
6334
|
declare namespace OpenApi {
|
|
6341
6335
|
export type V2_0_X = OpenApiV2_0_X;
|
|
@@ -6389,7 +6383,6 @@ type PluginNames =
|
|
|
6389
6383
|
| 'fastify'
|
|
6390
6384
|
| 'zod';
|
|
6391
6385
|
|
|
6392
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6393
6386
|
type AnyPluginName = PluginNames | (string & {});
|
|
6394
6387
|
|
|
6395
6388
|
type PluginTag = 'transformer' | 'validator';
|
|
@@ -6401,8 +6394,6 @@ interface PluginContext {
|
|
|
6401
6394
|
|
|
6402
6395
|
interface BaseConfig {
|
|
6403
6396
|
/**
|
|
6404
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6405
|
-
*
|
|
6406
6397
|
* Should the exports from the plugin's file be re-exported in the index
|
|
6407
6398
|
* barrel file?
|
|
6408
6399
|
*/
|
|
@@ -6468,8 +6459,9 @@ declare namespace Plugin {
|
|
|
6468
6459
|
Pick<Required<BaseConfig>, 'exportFromIndex' | 'output'>;
|
|
6469
6460
|
|
|
6470
6461
|
/**
|
|
6471
|
-
*
|
|
6472
|
-
*
|
|
6462
|
+
* @deprecated
|
|
6463
|
+
*
|
|
6464
|
+
* Plugin implementation for legacy parser.
|
|
6473
6465
|
*/
|
|
6474
6466
|
export type LegacyHandler<Config extends BaseConfig> = (args: {
|
|
6475
6467
|
client: Client$1;
|
|
@@ -6532,8 +6524,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6532
6524
|
*/
|
|
6533
6525
|
asClass?: boolean;
|
|
6534
6526
|
/**
|
|
6535
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6536
|
-
*
|
|
6537
6527
|
* Should the generated functions contain auth mechanisms? You may want to
|
|
6538
6528
|
* disable this option if you're handling auth yourself or defining it
|
|
6539
6529
|
* globally on the client and want to reduce the size of generated code.
|
|
@@ -6542,6 +6532,8 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6542
6532
|
*/
|
|
6543
6533
|
auth?: boolean;
|
|
6544
6534
|
/**
|
|
6535
|
+
* @deprecated
|
|
6536
|
+
*
|
|
6545
6537
|
* **This feature works only with the legacy parser**
|
|
6546
6538
|
*
|
|
6547
6539
|
* Filter endpoints to be included in the generated SDK. The provided
|
|
@@ -6549,8 +6541,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6549
6541
|
* included in the output. The input pattern this string will be tested
|
|
6550
6542
|
* against is `{method} {path}`. For example, you can match
|
|
6551
6543
|
* `POST /api/v1/foo` with `^POST /api/v1/foo$`.
|
|
6552
|
-
*
|
|
6553
|
-
* @deprecated
|
|
6554
6544
|
*/
|
|
6555
6545
|
filter?: string;
|
|
6556
6546
|
/**
|
|
@@ -6612,8 +6602,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6612
6602
|
*/
|
|
6613
6603
|
transformer?: '@hey-api/transformers' | boolean;
|
|
6614
6604
|
/**
|
|
6615
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6616
|
-
*
|
|
6617
6605
|
* Validate response data against schema before returning. This is useful
|
|
6618
6606
|
* if you want to ensure the response conforms to a desired shape. However,
|
|
6619
6607
|
* validation adds runtime overhead, so it's not recommended to use unless
|
|
@@ -6631,8 +6619,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6631
6619
|
|
|
6632
6620
|
interface Config$9 extends Plugin.Name<'@hey-api/transformers'> {
|
|
6633
6621
|
/**
|
|
6634
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6635
|
-
*
|
|
6636
6622
|
* Convert long integers into BigInt values?
|
|
6637
6623
|
*
|
|
6638
6624
|
* @default true
|
|
@@ -6662,8 +6648,6 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6662
6648
|
*/
|
|
6663
6649
|
enums?: 'javascript' | 'typescript' | 'typescript+namespace' | false;
|
|
6664
6650
|
/**
|
|
6665
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6666
|
-
*
|
|
6667
6651
|
* Defines casing of the enum keys. By default, we use `SCREAMING_SNAKE_CASE`.
|
|
6668
6652
|
* This option has effect only when `enums` is defined.
|
|
6669
6653
|
*
|
|
@@ -6671,8 +6655,6 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6671
6655
|
*/
|
|
6672
6656
|
enumsCase?: StringCase;
|
|
6673
6657
|
/**
|
|
6674
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6675
|
-
*
|
|
6676
6658
|
* By default, inline enums (enums not defined as reusable components in
|
|
6677
6659
|
* the input file) are generated as inlined union types. You can set
|
|
6678
6660
|
* `exportInlineEnums` to `true` to treat inline enums as reusable components.
|
|
@@ -6682,19 +6664,17 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6682
6664
|
*/
|
|
6683
6665
|
exportInlineEnums?: boolean;
|
|
6684
6666
|
/**
|
|
6685
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6686
|
-
*
|
|
6687
6667
|
* Defines casing of the identifiers. By default, we use `PascalCase`.
|
|
6688
6668
|
*
|
|
6689
6669
|
* @default 'PascalCase'
|
|
6690
6670
|
*/
|
|
6691
6671
|
identifierCase?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
6692
6672
|
/**
|
|
6673
|
+
* @deprecated
|
|
6674
|
+
*
|
|
6693
6675
|
* **This feature works only with the legacy parser**
|
|
6694
6676
|
*
|
|
6695
6677
|
* Include only types matching regular expression.
|
|
6696
|
-
*
|
|
6697
|
-
* @deprecated
|
|
6698
6678
|
*/
|
|
6699
6679
|
include?: string;
|
|
6700
6680
|
/**
|
|
@@ -6704,24 +6684,24 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6704
6684
|
*/
|
|
6705
6685
|
output?: string;
|
|
6706
6686
|
/**
|
|
6687
|
+
* @deprecated
|
|
6688
|
+
*
|
|
6707
6689
|
* **This feature works only with the legacy parser**
|
|
6708
6690
|
*
|
|
6709
6691
|
* Use your preferred naming pattern
|
|
6710
6692
|
*
|
|
6711
6693
|
* @default 'preserve'
|
|
6712
|
-
*
|
|
6713
|
-
* @deprecated
|
|
6714
6694
|
*/
|
|
6715
6695
|
style?: 'PascalCase' | 'preserve';
|
|
6716
6696
|
/**
|
|
6697
|
+
* @deprecated
|
|
6698
|
+
*
|
|
6717
6699
|
* **This feature works only with the legacy parser**
|
|
6718
6700
|
*
|
|
6719
6701
|
* Generate a tree of types containing all operations? It will be named
|
|
6720
6702
|
* $OpenApiTs.
|
|
6721
6703
|
*
|
|
6722
6704
|
* @default false
|
|
6723
|
-
*
|
|
6724
|
-
* @deprecated
|
|
6725
6705
|
*/
|
|
6726
6706
|
tree?: boolean;
|
|
6727
6707
|
}
|
|
@@ -6917,12 +6897,6 @@ interface ClientConfig {
|
|
|
6917
6897
|
* @default false
|
|
6918
6898
|
*/
|
|
6919
6899
|
dryRun?: boolean;
|
|
6920
|
-
/**
|
|
6921
|
-
* Opt in to the experimental parser?
|
|
6922
|
-
*
|
|
6923
|
-
* @default false
|
|
6924
|
-
*/
|
|
6925
|
-
experimentalParser?: boolean;
|
|
6926
6900
|
/**
|
|
6927
6901
|
* Path to the OpenAPI specification. This can be either local or remote path.
|
|
6928
6902
|
* Both JSON and YAML file formats are supported. You can also pass the parsed
|
|
@@ -6932,8 +6906,6 @@ interface ClientConfig {
|
|
|
6932
6906
|
*/
|
|
6933
6907
|
input: string | Record<string, unknown> | {
|
|
6934
6908
|
/**
|
|
6935
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6936
|
-
*
|
|
6937
6909
|
* Prevent parts matching the regular expression from being processed.
|
|
6938
6910
|
* You can select both operations and components by reference within
|
|
6939
6911
|
* the bundled input. In case of conflicts, `exclude` takes precedence
|
|
@@ -6945,8 +6917,6 @@ interface ClientConfig {
|
|
|
6945
6917
|
*/
|
|
6946
6918
|
exclude?: string;
|
|
6947
6919
|
/**
|
|
6948
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6949
|
-
*
|
|
6950
6920
|
* Process only parts matching the regular expression. You can select both
|
|
6951
6921
|
* operations and components by reference within the bundled input. In
|
|
6952
6922
|
* case of conflicts, `exclude` takes precedence over `include`.
|
|
@@ -6999,8 +6969,6 @@ interface ClientConfig {
|
|
|
6999
6969
|
*/
|
|
7000
6970
|
output: string | {
|
|
7001
6971
|
/**
|
|
7002
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
7003
|
-
*
|
|
7004
6972
|
* Defines casing of the output fields. By default, we preserve `input`
|
|
7005
6973
|
* values as data transforms incur a performance penalty at runtime.
|
|
7006
6974
|
*
|
|
@@ -7042,70 +7010,77 @@ interface ClientConfig {
|
|
|
7042
7010
|
*/
|
|
7043
7011
|
plugins?: ReadonlyArray<UserPlugins['name'] | UserPlugins>;
|
|
7044
7012
|
/**
|
|
7045
|
-
*
|
|
7013
|
+
* Regenerate the client when the input file changes?
|
|
7046
7014
|
*
|
|
7015
|
+
* @default false
|
|
7016
|
+
*/
|
|
7017
|
+
watch?: boolean | number | {
|
|
7018
|
+
/**
|
|
7019
|
+
* Regenerate the client when the input file changes?
|
|
7020
|
+
*
|
|
7021
|
+
* @default false
|
|
7022
|
+
*/
|
|
7023
|
+
enabled?: boolean;
|
|
7024
|
+
/**
|
|
7025
|
+
* How often should we attempt to detect the input file change?
|
|
7026
|
+
*
|
|
7027
|
+
* @default 1000
|
|
7028
|
+
*/
|
|
7029
|
+
interval?: number;
|
|
7030
|
+
};
|
|
7031
|
+
/**
|
|
7047
7032
|
* @deprecated
|
|
7033
|
+
*
|
|
7034
|
+
* Manually set base in OpenAPI config instead of inferring from server value
|
|
7048
7035
|
*/
|
|
7049
7036
|
base?: string;
|
|
7050
7037
|
/**
|
|
7051
|
-
*
|
|
7038
|
+
* @deprecated
|
|
7039
|
+
*
|
|
7040
|
+
* Opt in to the experimental parser?
|
|
7052
7041
|
*
|
|
7042
|
+
* @default true
|
|
7043
|
+
*/
|
|
7044
|
+
experimentalParser?: boolean;
|
|
7045
|
+
/**
|
|
7053
7046
|
* @deprecated
|
|
7054
7047
|
*
|
|
7048
|
+
* Generate core client classes?
|
|
7049
|
+
*
|
|
7055
7050
|
* @default true
|
|
7056
7051
|
*/
|
|
7057
7052
|
exportCore?: boolean;
|
|
7058
7053
|
/**
|
|
7054
|
+
* @deprecated
|
|
7055
|
+
*
|
|
7059
7056
|
* Custom client class name. Please note this option is deprecated and
|
|
7060
7057
|
* will be removed in favor of clients.
|
|
7061
7058
|
*
|
|
7062
7059
|
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-name
|
|
7063
|
-
*
|
|
7064
|
-
* @deprecated
|
|
7065
7060
|
*/
|
|
7066
7061
|
name?: string;
|
|
7067
7062
|
/**
|
|
7063
|
+
* @deprecated
|
|
7064
|
+
*
|
|
7068
7065
|
* Path to custom request file. Please note this option is deprecated and
|
|
7069
7066
|
* will be removed in favor of clients.
|
|
7070
7067
|
*
|
|
7071
7068
|
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-request
|
|
7072
|
-
*
|
|
7073
|
-
* @deprecated
|
|
7074
7069
|
*/
|
|
7075
7070
|
request?: string;
|
|
7076
7071
|
/**
|
|
7072
|
+
* @deprecated
|
|
7073
|
+
*
|
|
7077
7074
|
* Use options or arguments functions. Please note this option is deprecated and
|
|
7078
7075
|
* will be removed in favor of clients.
|
|
7079
7076
|
*
|
|
7080
7077
|
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-useoptions
|
|
7081
7078
|
*
|
|
7082
|
-
* @deprecated
|
|
7083
|
-
*
|
|
7084
7079
|
* @default true
|
|
7085
7080
|
*/
|
|
7086
7081
|
useOptions?: boolean;
|
|
7087
|
-
/**
|
|
7088
|
-
* Regenerate the client when the input file changes?
|
|
7089
|
-
*
|
|
7090
|
-
* @default false
|
|
7091
|
-
*/
|
|
7092
|
-
watch?: boolean | number | {
|
|
7093
|
-
/**
|
|
7094
|
-
* Regenerate the client when the input file changes?
|
|
7095
|
-
*
|
|
7096
|
-
* @default false
|
|
7097
|
-
*/
|
|
7098
|
-
enabled?: boolean;
|
|
7099
|
-
/**
|
|
7100
|
-
* How often should we attempt to detect the input file change?
|
|
7101
|
-
*
|
|
7102
|
-
* @default 1000
|
|
7103
|
-
*/
|
|
7104
|
-
interval?: number;
|
|
7105
|
-
};
|
|
7106
|
-
}
|
|
7107
|
-
interface UserConfig extends ClientConfig {
|
|
7108
7082
|
}
|
|
7083
|
+
type UserConfig = ClientConfig;
|
|
7109
7084
|
type Config = Omit<Required<ClientConfig>, 'base' | 'client' | 'input' | 'logs' | 'name' | 'output' | 'plugins' | 'request' | 'watch'> & Pick<ClientConfig, 'base' | 'name' | 'request'> & {
|
|
7110
7085
|
client: Extract<Required<ClientConfig>['client'], object>;
|
|
7111
7086
|
input: ExtractWithDiscriminator<ClientConfig['input'], {
|
package/dist/index.d.ts
CHANGED
|
@@ -640,7 +640,7 @@ interface ExternalDocumentationObject$2 {
|
|
|
640
640
|
* type: integer
|
|
641
641
|
* ```
|
|
642
642
|
*/
|
|
643
|
-
|
|
643
|
+
type HeaderObject$2 = Omit<ParameterObject$2, 'in' | 'name'>;
|
|
644
644
|
|
|
645
645
|
/**
|
|
646
646
|
* The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
|
|
@@ -1676,7 +1676,7 @@ interface ResponsesObject$2 {
|
|
|
1676
1676
|
*
|
|
1677
1677
|
* This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}, though as noted, additional properties MAY omit the `x-` prefix within this object.
|
|
1678
1678
|
*/
|
|
1679
|
-
|
|
1679
|
+
type SchemaObject$2 = JsonSchemaDraft2020_12;
|
|
1680
1680
|
|
|
1681
1681
|
/**
|
|
1682
1682
|
* Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsSecuritySchemes Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object Components Object}.
|
|
@@ -2483,7 +2483,6 @@ type JsonSchemaFormats$2 =
|
|
|
2483
2483
|
| 'uri-reference'
|
|
2484
2484
|
| 'uri-template'
|
|
2485
2485
|
| 'uuid'
|
|
2486
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2487
2486
|
| (string & {});
|
|
2488
2487
|
|
|
2489
2488
|
type JsonSchemaTypes$1 =
|
|
@@ -3444,7 +3443,6 @@ type JsonSchemaFormats$1 =
|
|
|
3444
3443
|
| 'ipv4'
|
|
3445
3444
|
| 'ipv6'
|
|
3446
3445
|
| 'uri'
|
|
3447
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
3448
3446
|
| (string & {});
|
|
3449
3447
|
|
|
3450
3448
|
type JsonSchemaTypes =
|
|
@@ -5307,7 +5305,7 @@ interface ExternalDocumentationObject {
|
|
|
5307
5305
|
*
|
|
5308
5306
|
* TODO: examples
|
|
5309
5307
|
*/
|
|
5310
|
-
|
|
5308
|
+
type HeaderObject = Omit<ParameterObject, 'in' | 'name'>;
|
|
5311
5309
|
|
|
5312
5310
|
/**
|
|
5313
5311
|
* The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
|
|
@@ -6331,11 +6329,7 @@ type OpenApiSchemaFormats =
|
|
|
6331
6329
|
| 'date-time'
|
|
6332
6330
|
| 'password';
|
|
6333
6331
|
|
|
6334
|
-
type Format =
|
|
6335
|
-
| JsonSchemaFormats
|
|
6336
|
-
| OpenApiSchemaFormats
|
|
6337
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6338
|
-
| (string & {});
|
|
6332
|
+
type Format = JsonSchemaFormats | OpenApiSchemaFormats | (string & {});
|
|
6339
6333
|
|
|
6340
6334
|
declare namespace OpenApi {
|
|
6341
6335
|
export type V2_0_X = OpenApiV2_0_X;
|
|
@@ -6389,7 +6383,6 @@ type PluginNames =
|
|
|
6389
6383
|
| 'fastify'
|
|
6390
6384
|
| 'zod';
|
|
6391
6385
|
|
|
6392
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6393
6386
|
type AnyPluginName = PluginNames | (string & {});
|
|
6394
6387
|
|
|
6395
6388
|
type PluginTag = 'transformer' | 'validator';
|
|
@@ -6401,8 +6394,6 @@ interface PluginContext {
|
|
|
6401
6394
|
|
|
6402
6395
|
interface BaseConfig {
|
|
6403
6396
|
/**
|
|
6404
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6405
|
-
*
|
|
6406
6397
|
* Should the exports from the plugin's file be re-exported in the index
|
|
6407
6398
|
* barrel file?
|
|
6408
6399
|
*/
|
|
@@ -6468,8 +6459,9 @@ declare namespace Plugin {
|
|
|
6468
6459
|
Pick<Required<BaseConfig>, 'exportFromIndex' | 'output'>;
|
|
6469
6460
|
|
|
6470
6461
|
/**
|
|
6471
|
-
*
|
|
6472
|
-
*
|
|
6462
|
+
* @deprecated
|
|
6463
|
+
*
|
|
6464
|
+
* Plugin implementation for legacy parser.
|
|
6473
6465
|
*/
|
|
6474
6466
|
export type LegacyHandler<Config extends BaseConfig> = (args: {
|
|
6475
6467
|
client: Client$1;
|
|
@@ -6532,8 +6524,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6532
6524
|
*/
|
|
6533
6525
|
asClass?: boolean;
|
|
6534
6526
|
/**
|
|
6535
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6536
|
-
*
|
|
6537
6527
|
* Should the generated functions contain auth mechanisms? You may want to
|
|
6538
6528
|
* disable this option if you're handling auth yourself or defining it
|
|
6539
6529
|
* globally on the client and want to reduce the size of generated code.
|
|
@@ -6542,6 +6532,8 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6542
6532
|
*/
|
|
6543
6533
|
auth?: boolean;
|
|
6544
6534
|
/**
|
|
6535
|
+
* @deprecated
|
|
6536
|
+
*
|
|
6545
6537
|
* **This feature works only with the legacy parser**
|
|
6546
6538
|
*
|
|
6547
6539
|
* Filter endpoints to be included in the generated SDK. The provided
|
|
@@ -6549,8 +6541,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6549
6541
|
* included in the output. The input pattern this string will be tested
|
|
6550
6542
|
* against is `{method} {path}`. For example, you can match
|
|
6551
6543
|
* `POST /api/v1/foo` with `^POST /api/v1/foo$`.
|
|
6552
|
-
*
|
|
6553
|
-
* @deprecated
|
|
6554
6544
|
*/
|
|
6555
6545
|
filter?: string;
|
|
6556
6546
|
/**
|
|
@@ -6612,8 +6602,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6612
6602
|
*/
|
|
6613
6603
|
transformer?: '@hey-api/transformers' | boolean;
|
|
6614
6604
|
/**
|
|
6615
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6616
|
-
*
|
|
6617
6605
|
* Validate response data against schema before returning. This is useful
|
|
6618
6606
|
* if you want to ensure the response conforms to a desired shape. However,
|
|
6619
6607
|
* validation adds runtime overhead, so it's not recommended to use unless
|
|
@@ -6631,8 +6619,6 @@ interface Config$a extends Plugin.Name<'@hey-api/sdk'> {
|
|
|
6631
6619
|
|
|
6632
6620
|
interface Config$9 extends Plugin.Name<'@hey-api/transformers'> {
|
|
6633
6621
|
/**
|
|
6634
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6635
|
-
*
|
|
6636
6622
|
* Convert long integers into BigInt values?
|
|
6637
6623
|
*
|
|
6638
6624
|
* @default true
|
|
@@ -6662,8 +6648,6 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6662
6648
|
*/
|
|
6663
6649
|
enums?: 'javascript' | 'typescript' | 'typescript+namespace' | false;
|
|
6664
6650
|
/**
|
|
6665
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6666
|
-
*
|
|
6667
6651
|
* Defines casing of the enum keys. By default, we use `SCREAMING_SNAKE_CASE`.
|
|
6668
6652
|
* This option has effect only when `enums` is defined.
|
|
6669
6653
|
*
|
|
@@ -6671,8 +6655,6 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6671
6655
|
*/
|
|
6672
6656
|
enumsCase?: StringCase;
|
|
6673
6657
|
/**
|
|
6674
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6675
|
-
*
|
|
6676
6658
|
* By default, inline enums (enums not defined as reusable components in
|
|
6677
6659
|
* the input file) are generated as inlined union types. You can set
|
|
6678
6660
|
* `exportInlineEnums` to `true` to treat inline enums as reusable components.
|
|
@@ -6682,19 +6664,17 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6682
6664
|
*/
|
|
6683
6665
|
exportInlineEnums?: boolean;
|
|
6684
6666
|
/**
|
|
6685
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6686
|
-
*
|
|
6687
6667
|
* Defines casing of the identifiers. By default, we use `PascalCase`.
|
|
6688
6668
|
*
|
|
6689
6669
|
* @default 'PascalCase'
|
|
6690
6670
|
*/
|
|
6691
6671
|
identifierCase?: Exclude<StringCase, 'SCREAMING_SNAKE_CASE'>;
|
|
6692
6672
|
/**
|
|
6673
|
+
* @deprecated
|
|
6674
|
+
*
|
|
6693
6675
|
* **This feature works only with the legacy parser**
|
|
6694
6676
|
*
|
|
6695
6677
|
* Include only types matching regular expression.
|
|
6696
|
-
*
|
|
6697
|
-
* @deprecated
|
|
6698
6678
|
*/
|
|
6699
6679
|
include?: string;
|
|
6700
6680
|
/**
|
|
@@ -6704,24 +6684,24 @@ interface Config$8 extends Plugin.Name<'@hey-api/typescript'> {
|
|
|
6704
6684
|
*/
|
|
6705
6685
|
output?: string;
|
|
6706
6686
|
/**
|
|
6687
|
+
* @deprecated
|
|
6688
|
+
*
|
|
6707
6689
|
* **This feature works only with the legacy parser**
|
|
6708
6690
|
*
|
|
6709
6691
|
* Use your preferred naming pattern
|
|
6710
6692
|
*
|
|
6711
6693
|
* @default 'preserve'
|
|
6712
|
-
*
|
|
6713
|
-
* @deprecated
|
|
6714
6694
|
*/
|
|
6715
6695
|
style?: 'PascalCase' | 'preserve';
|
|
6716
6696
|
/**
|
|
6697
|
+
* @deprecated
|
|
6698
|
+
*
|
|
6717
6699
|
* **This feature works only with the legacy parser**
|
|
6718
6700
|
*
|
|
6719
6701
|
* Generate a tree of types containing all operations? It will be named
|
|
6720
6702
|
* $OpenApiTs.
|
|
6721
6703
|
*
|
|
6722
6704
|
* @default false
|
|
6723
|
-
*
|
|
6724
|
-
* @deprecated
|
|
6725
6705
|
*/
|
|
6726
6706
|
tree?: boolean;
|
|
6727
6707
|
}
|
|
@@ -6917,12 +6897,6 @@ interface ClientConfig {
|
|
|
6917
6897
|
* @default false
|
|
6918
6898
|
*/
|
|
6919
6899
|
dryRun?: boolean;
|
|
6920
|
-
/**
|
|
6921
|
-
* Opt in to the experimental parser?
|
|
6922
|
-
*
|
|
6923
|
-
* @default false
|
|
6924
|
-
*/
|
|
6925
|
-
experimentalParser?: boolean;
|
|
6926
6900
|
/**
|
|
6927
6901
|
* Path to the OpenAPI specification. This can be either local or remote path.
|
|
6928
6902
|
* Both JSON and YAML file formats are supported. You can also pass the parsed
|
|
@@ -6932,8 +6906,6 @@ interface ClientConfig {
|
|
|
6932
6906
|
*/
|
|
6933
6907
|
input: string | Record<string, unknown> | {
|
|
6934
6908
|
/**
|
|
6935
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6936
|
-
*
|
|
6937
6909
|
* Prevent parts matching the regular expression from being processed.
|
|
6938
6910
|
* You can select both operations and components by reference within
|
|
6939
6911
|
* the bundled input. In case of conflicts, `exclude` takes precedence
|
|
@@ -6945,8 +6917,6 @@ interface ClientConfig {
|
|
|
6945
6917
|
*/
|
|
6946
6918
|
exclude?: string;
|
|
6947
6919
|
/**
|
|
6948
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
6949
|
-
*
|
|
6950
6920
|
* Process only parts matching the regular expression. You can select both
|
|
6951
6921
|
* operations and components by reference within the bundled input. In
|
|
6952
6922
|
* case of conflicts, `exclude` takes precedence over `include`.
|
|
@@ -6999,8 +6969,6 @@ interface ClientConfig {
|
|
|
6999
6969
|
*/
|
|
7000
6970
|
output: string | {
|
|
7001
6971
|
/**
|
|
7002
|
-
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
|
|
7003
|
-
*
|
|
7004
6972
|
* Defines casing of the output fields. By default, we preserve `input`
|
|
7005
6973
|
* values as data transforms incur a performance penalty at runtime.
|
|
7006
6974
|
*
|
|
@@ -7042,70 +7010,77 @@ interface ClientConfig {
|
|
|
7042
7010
|
*/
|
|
7043
7011
|
plugins?: ReadonlyArray<UserPlugins['name'] | UserPlugins>;
|
|
7044
7012
|
/**
|
|
7045
|
-
*
|
|
7013
|
+
* Regenerate the client when the input file changes?
|
|
7046
7014
|
*
|
|
7015
|
+
* @default false
|
|
7016
|
+
*/
|
|
7017
|
+
watch?: boolean | number | {
|
|
7018
|
+
/**
|
|
7019
|
+
* Regenerate the client when the input file changes?
|
|
7020
|
+
*
|
|
7021
|
+
* @default false
|
|
7022
|
+
*/
|
|
7023
|
+
enabled?: boolean;
|
|
7024
|
+
/**
|
|
7025
|
+
* How often should we attempt to detect the input file change?
|
|
7026
|
+
*
|
|
7027
|
+
* @default 1000
|
|
7028
|
+
*/
|
|
7029
|
+
interval?: number;
|
|
7030
|
+
};
|
|
7031
|
+
/**
|
|
7047
7032
|
* @deprecated
|
|
7033
|
+
*
|
|
7034
|
+
* Manually set base in OpenAPI config instead of inferring from server value
|
|
7048
7035
|
*/
|
|
7049
7036
|
base?: string;
|
|
7050
7037
|
/**
|
|
7051
|
-
*
|
|
7038
|
+
* @deprecated
|
|
7039
|
+
*
|
|
7040
|
+
* Opt in to the experimental parser?
|
|
7052
7041
|
*
|
|
7042
|
+
* @default true
|
|
7043
|
+
*/
|
|
7044
|
+
experimentalParser?: boolean;
|
|
7045
|
+
/**
|
|
7053
7046
|
* @deprecated
|
|
7054
7047
|
*
|
|
7048
|
+
* Generate core client classes?
|
|
7049
|
+
*
|
|
7055
7050
|
* @default true
|
|
7056
7051
|
*/
|
|
7057
7052
|
exportCore?: boolean;
|
|
7058
7053
|
/**
|
|
7054
|
+
* @deprecated
|
|
7055
|
+
*
|
|
7059
7056
|
* Custom client class name. Please note this option is deprecated and
|
|
7060
7057
|
* will be removed in favor of clients.
|
|
7061
7058
|
*
|
|
7062
7059
|
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-name
|
|
7063
|
-
*
|
|
7064
|
-
* @deprecated
|
|
7065
7060
|
*/
|
|
7066
7061
|
name?: string;
|
|
7067
7062
|
/**
|
|
7063
|
+
* @deprecated
|
|
7064
|
+
*
|
|
7068
7065
|
* Path to custom request file. Please note this option is deprecated and
|
|
7069
7066
|
* will be removed in favor of clients.
|
|
7070
7067
|
*
|
|
7071
7068
|
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-request
|
|
7072
|
-
*
|
|
7073
|
-
* @deprecated
|
|
7074
7069
|
*/
|
|
7075
7070
|
request?: string;
|
|
7076
7071
|
/**
|
|
7072
|
+
* @deprecated
|
|
7073
|
+
*
|
|
7077
7074
|
* Use options or arguments functions. Please note this option is deprecated and
|
|
7078
7075
|
* will be removed in favor of clients.
|
|
7079
7076
|
*
|
|
7080
7077
|
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-useoptions
|
|
7081
7078
|
*
|
|
7082
|
-
* @deprecated
|
|
7083
|
-
*
|
|
7084
7079
|
* @default true
|
|
7085
7080
|
*/
|
|
7086
7081
|
useOptions?: boolean;
|
|
7087
|
-
/**
|
|
7088
|
-
* Regenerate the client when the input file changes?
|
|
7089
|
-
*
|
|
7090
|
-
* @default false
|
|
7091
|
-
*/
|
|
7092
|
-
watch?: boolean | number | {
|
|
7093
|
-
/**
|
|
7094
|
-
* Regenerate the client when the input file changes?
|
|
7095
|
-
*
|
|
7096
|
-
* @default false
|
|
7097
|
-
*/
|
|
7098
|
-
enabled?: boolean;
|
|
7099
|
-
/**
|
|
7100
|
-
* How often should we attempt to detect the input file change?
|
|
7101
|
-
*
|
|
7102
|
-
* @default 1000
|
|
7103
|
-
*/
|
|
7104
|
-
interval?: number;
|
|
7105
|
-
};
|
|
7106
|
-
}
|
|
7107
|
-
interface UserConfig extends ClientConfig {
|
|
7108
7082
|
}
|
|
7083
|
+
type UserConfig = ClientConfig;
|
|
7109
7084
|
type Config = Omit<Required<ClientConfig>, 'base' | 'client' | 'input' | 'logs' | 'name' | 'output' | 'plugins' | 'request' | 'watch'> & Pick<ClientConfig, 'base' | 'name' | 'request'> & {
|
|
7110
7085
|
client: Extract<Required<ClientConfig>['client'], object>;
|
|
7111
7086
|
input: ExtractWithDiscriminator<ClientConfig['input'], {
|