@hey-api/openapi-ts 0.63.2 → 0.64.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/dist/index.cjs +55 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +292 -202
- package/dist/index.d.ts +292 -202
- package/dist/index.js +56 -56
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -6340,30 +6340,45 @@ declare namespace OpenApi {
|
|
|
6340
6340
|
}
|
|
6341
6341
|
|
|
6342
6342
|
interface Operation extends Omit<Operation$1, 'tags'> {
|
|
6343
|
-
|
|
6343
|
+
service: string;
|
|
6344
6344
|
}
|
|
6345
|
+
|
|
6345
6346
|
interface Service extends Pick<Model, '$refs' | 'imports' | 'name'> {
|
|
6346
|
-
|
|
6347
|
+
operations: Operation[];
|
|
6347
6348
|
}
|
|
6349
|
+
|
|
6348
6350
|
interface Client$1 extends Omit<Client$2, 'operations'> {
|
|
6349
|
-
|
|
6351
|
+
services: Service[];
|
|
6350
6352
|
}
|
|
6351
6353
|
|
|
6352
|
-
type ExtractWithDiscriminator<T, Discriminator> = T extends Discriminator
|
|
6354
|
+
type ExtractWithDiscriminator<T, Discriminator> = T extends Discriminator
|
|
6355
|
+
? T
|
|
6356
|
+
: never;
|
|
6357
|
+
|
|
6353
6358
|
/**
|
|
6354
6359
|
* Accepts an array of elements union and attempts to extract only objects.
|
|
6355
6360
|
* For example, Array<string | number | { id: string }> would result in
|
|
6356
6361
|
* Array<{ id: string }>.
|
|
6357
6362
|
*/
|
|
6358
|
-
type ExtractArrayOfObjects<T, Discriminator> =
|
|
6363
|
+
type ExtractArrayOfObjects<T, Discriminator> =
|
|
6364
|
+
T extends Array<infer U>
|
|
6365
|
+
? Array<ExtractWithDiscriminator<U, Discriminator>>
|
|
6366
|
+
: T extends ReadonlyArray<infer U>
|
|
6367
|
+
? ReadonlyArray<ExtractWithDiscriminator<U, Discriminator>>
|
|
6368
|
+
: never;
|
|
6369
|
+
|
|
6359
6370
|
type Files = Record<string, TypeScriptFile>;
|
|
6371
|
+
|
|
6360
6372
|
/**
|
|
6361
6373
|
* Transforms an array of objects into an optional object map.
|
|
6362
6374
|
* For example, Array<{ id: string }> would result in
|
|
6363
6375
|
* { [key: string]?: { id: string } }
|
|
6364
6376
|
*/
|
|
6365
|
-
type ArrayOfObjectsToObjectMap<
|
|
6366
|
-
|
|
6377
|
+
type ArrayOfObjectsToObjectMap<
|
|
6378
|
+
T extends ReadonlyArray<Record<string, any>>,
|
|
6379
|
+
D extends keyof T[number],
|
|
6380
|
+
> = {
|
|
6381
|
+
[K in T[number][D]]?: Extract<T[number], Record<D, K>>;
|
|
6367
6382
|
};
|
|
6368
6383
|
|
|
6369
6384
|
type OmitUnderscoreKeys<T> = {
|
|
@@ -6441,41 +6456,6 @@ interface Meta<Config extends BaseConfig> {
|
|
|
6441
6456
|
_tags?: ReadonlyArray<PluginTag>;
|
|
6442
6457
|
}
|
|
6443
6458
|
|
|
6444
|
-
/**
|
|
6445
|
-
* Public Client API.
|
|
6446
|
-
*/
|
|
6447
|
-
declare namespace Client {
|
|
6448
|
-
export type Config = {
|
|
6449
|
-
/**
|
|
6450
|
-
* Bundle the client module? Set this to true if don't want to declare it
|
|
6451
|
-
* as a separate dependency. When true, the client module will be generated
|
|
6452
|
-
* from the client package and bundled with the rest of the generated output.
|
|
6453
|
-
* This is useful if you're repackaging the output, publishing it to other
|
|
6454
|
-
* users, and you don't want them to install any dependencies.
|
|
6455
|
-
*
|
|
6456
|
-
* @default false
|
|
6457
|
-
*/
|
|
6458
|
-
bundle?: boolean;
|
|
6459
|
-
/**
|
|
6460
|
-
* Name of the generated file.
|
|
6461
|
-
*
|
|
6462
|
-
* @default 'client'
|
|
6463
|
-
*/
|
|
6464
|
-
output?: string;
|
|
6465
|
-
/**
|
|
6466
|
-
* Relative path to the runtime configuration file. This file must export
|
|
6467
|
-
* a `createClientConfig()` function. The `createClientConfig()` function
|
|
6468
|
-
* will be called on client initialization and the returned object will
|
|
6469
|
-
* become the client's initial configuration.
|
|
6470
|
-
*
|
|
6471
|
-
* You may want to initialize your client this way instead of calling
|
|
6472
|
-
* `setConfig()`. This is useful for example if you're using Next.js
|
|
6473
|
-
* to ensure your client always has the correct values.
|
|
6474
|
-
*/
|
|
6475
|
-
runtimeConfigPath?: string;
|
|
6476
|
-
};
|
|
6477
|
-
}
|
|
6478
|
-
|
|
6479
6459
|
/**
|
|
6480
6460
|
* Public Plugin API.
|
|
6481
6461
|
*/
|
|
@@ -6502,10 +6482,10 @@ declare namespace Plugin {
|
|
|
6502
6482
|
/**
|
|
6503
6483
|
* Plugin implementation for experimental parser.
|
|
6504
6484
|
*/
|
|
6505
|
-
export type Handler<Config extends BaseConfig> = (args: {
|
|
6485
|
+
export type Handler<Config extends BaseConfig, ReturnType = void> = (args: {
|
|
6506
6486
|
context: IR.Context<OpenApi.V2_0_X | OpenApi.V3_0_X | OpenApi.V3_1_X>;
|
|
6507
6487
|
plugin: Plugin.Instance<Config>;
|
|
6508
|
-
}) =>
|
|
6488
|
+
}) => ReturnType;
|
|
6509
6489
|
|
|
6510
6490
|
export type Instance<Config extends BaseConfig> = OmitUnderscoreKeys<Config> &
|
|
6511
6491
|
Pick<Required<BaseConfig>, 'exportFromIndex' | 'output'>;
|
|
@@ -6533,7 +6513,7 @@ declare namespace Plugin {
|
|
|
6533
6513
|
}
|
|
6534
6514
|
|
|
6535
6515
|
interface Config$k
|
|
6536
|
-
extends Plugin.Name<'@hey-api/client-
|
|
6516
|
+
extends Plugin.Name<'@hey-api/client-fetch'>,
|
|
6537
6517
|
Client.Config {
|
|
6538
6518
|
/**
|
|
6539
6519
|
* Throw an error instead of returning it in the response?
|
|
@@ -6544,7 +6524,7 @@ interface Config$k
|
|
|
6544
6524
|
}
|
|
6545
6525
|
|
|
6546
6526
|
interface Config$j
|
|
6547
|
-
extends Plugin.Name<'@hey-api/client-
|
|
6527
|
+
extends Plugin.Name<'@hey-api/client-next'>,
|
|
6548
6528
|
Client.Config {
|
|
6549
6529
|
/**
|
|
6550
6530
|
* Throw an error instead of returning it in the response?
|
|
@@ -6555,7 +6535,71 @@ interface Config$j
|
|
|
6555
6535
|
}
|
|
6556
6536
|
|
|
6557
6537
|
interface Config$i
|
|
6558
|
-
extends Plugin.Name<'@hey-api/client-
|
|
6538
|
+
extends Plugin.Name<'@hey-api/client-nuxt'>,
|
|
6539
|
+
Client.Config {}
|
|
6540
|
+
|
|
6541
|
+
/**
|
|
6542
|
+
* Public Client API.
|
|
6543
|
+
*/
|
|
6544
|
+
declare namespace Client {
|
|
6545
|
+
export type Config = {
|
|
6546
|
+
/**
|
|
6547
|
+
* Set a default base URL when creating the client? You can set `baseUrl`
|
|
6548
|
+
* to a string which will be used as the base URL. If your input defines
|
|
6549
|
+
* server(s), you can set `baseUrl` to a number to pick a specific server
|
|
6550
|
+
* to use as the base URL. You can disable setting the base URL by setting
|
|
6551
|
+
* `baseUrl` to `false`. By default, `baseUrl` is `true` and it will try to
|
|
6552
|
+
* use the first defined server value. If there's none, we won't set a
|
|
6553
|
+
* base URL.
|
|
6554
|
+
*
|
|
6555
|
+
* If the matched URL contains template literals, it will be ignored.
|
|
6556
|
+
*
|
|
6557
|
+
* @default true
|
|
6558
|
+
*/
|
|
6559
|
+
baseUrl?: string | number | boolean;
|
|
6560
|
+
/**
|
|
6561
|
+
* Bundle the client module? Set this to true if don't want to declare it
|
|
6562
|
+
* as a separate dependency. When true, the client module will be generated
|
|
6563
|
+
* from the client package and bundled with the rest of the generated output.
|
|
6564
|
+
* This is useful if you're repackaging the output, publishing it to other
|
|
6565
|
+
* users, and you don't want them to install any dependencies.
|
|
6566
|
+
*
|
|
6567
|
+
* @default false
|
|
6568
|
+
*/
|
|
6569
|
+
bundle?: boolean;
|
|
6570
|
+
/**
|
|
6571
|
+
* Name of the generated file.
|
|
6572
|
+
*
|
|
6573
|
+
* @default 'client'
|
|
6574
|
+
*/
|
|
6575
|
+
output?: string;
|
|
6576
|
+
/**
|
|
6577
|
+
* Relative path to the runtime configuration file. This file must export
|
|
6578
|
+
* a `createClientConfig()` function. The `createClientConfig()` function
|
|
6579
|
+
* will be called on client initialization and the returned object will
|
|
6580
|
+
* become the client's initial configuration.
|
|
6581
|
+
*
|
|
6582
|
+
* You may want to initialize your client this way instead of calling
|
|
6583
|
+
* `setConfig()`. This is useful for example if you're using Next.js
|
|
6584
|
+
* to ensure your client always has the correct values.
|
|
6585
|
+
*/
|
|
6586
|
+
runtimeConfigPath?: string;
|
|
6587
|
+
/**
|
|
6588
|
+
* Should the type helper for base URL allow only values matching the
|
|
6589
|
+
* server(s) defined in the input? By default, `strictBaseUrl` is `false`
|
|
6590
|
+
* which will provide type hints and allow you to pass any string.
|
|
6591
|
+
*
|
|
6592
|
+
* Note that setting `strictBaseUrl` to `true` can produce an invalid
|
|
6593
|
+
* build if you specify `baseUrl` which doesn't conform to the type helper.
|
|
6594
|
+
*
|
|
6595
|
+
* @default false
|
|
6596
|
+
*/
|
|
6597
|
+
strictBaseUrl?: boolean;
|
|
6598
|
+
};
|
|
6599
|
+
}
|
|
6600
|
+
|
|
6601
|
+
interface Config$h
|
|
6602
|
+
extends Plugin.Name<'@hey-api/client-axios'>,
|
|
6559
6603
|
Client.Config {
|
|
6560
6604
|
/**
|
|
6561
6605
|
* Throw an error instead of returning it in the response?
|
|
@@ -6565,10 +6609,6 @@ interface Config$i
|
|
|
6565
6609
|
throwOnError?: boolean;
|
|
6566
6610
|
}
|
|
6567
6611
|
|
|
6568
|
-
interface Config$h
|
|
6569
|
-
extends Plugin.Name<'@hey-api/client-nuxt'>,
|
|
6570
|
-
Client.Config {}
|
|
6571
|
-
|
|
6572
6612
|
interface Config$g
|
|
6573
6613
|
extends Plugin.Name<'legacy/angular'>,
|
|
6574
6614
|
Pick<Client.Config, 'output'> {}
|
|
@@ -6993,35 +7033,46 @@ interface Config$1 extends Plugin.Name<'zod'> {
|
|
|
6993
7033
|
/**
|
|
6994
7034
|
* User-facing plugin types.
|
|
6995
7035
|
*/
|
|
6996
|
-
type UserPlugins = Plugin.UserConfig<Config$
|
|
7036
|
+
type UserPlugins = Plugin.UserConfig<Config$h> | Plugin.UserConfig<Config$k> | Plugin.UserConfig<Config$j> | Plugin.UserConfig<Config$i> | Plugin.UserConfig<Config$g> | Plugin.UserConfig<Config$f> | Plugin.UserConfig<Config$e> | Plugin.UserConfig<Config$d> | Plugin.UserConfig<Config$c> | Plugin.UserConfig<Config$b> | Plugin.UserConfig<Config$a> | Plugin.UserConfig<Config$9> | Plugin.UserConfig<Config$8> | Plugin.UserConfig<Config$7> | Plugin.UserConfig<Config$6> | Plugin.UserConfig<Config$5> | Plugin.UserConfig<Config$4> | Plugin.UserConfig<Config$3> | Plugin.UserConfig<Config$2> | Plugin.UserConfig<Config$1>;
|
|
6997
7037
|
/**
|
|
6998
7038
|
* Internal plugin types.
|
|
6999
7039
|
*/
|
|
7000
|
-
type ClientPlugins = Plugin.Config<Config$
|
|
7040
|
+
type ClientPlugins = Plugin.Config<Config$h> | Plugin.Config<Config$k> | Plugin.Config<Config$j> | Plugin.Config<Config$i> | Plugin.Config<Config$g> | Plugin.Config<Config$f> | Plugin.Config<Config$e> | Plugin.Config<Config$d> | Plugin.Config<Config$c> | Plugin.Config<Config$b> | Plugin.Config<Config$a> | Plugin.Config<Config$9> | Plugin.Config<Config$8> | Plugin.Config<Config$7> | Plugin.Config<Config$6> | Plugin.Config<Config$5> | Plugin.Config<Config$4> | Plugin.Config<Config$3> | Plugin.Config<Config$2> | Plugin.Config<Config$1>;
|
|
7001
7041
|
|
|
7002
7042
|
type Formatters = 'biome' | 'prettier';
|
|
7043
|
+
|
|
7003
7044
|
type Linters = 'biome' | 'eslint' | 'oxlint';
|
|
7004
|
-
|
|
7045
|
+
|
|
7046
|
+
type StringCase =
|
|
7047
|
+
| 'camelCase'
|
|
7048
|
+
| 'PascalCase'
|
|
7049
|
+
| 'preserve'
|
|
7050
|
+
| 'snake_case'
|
|
7051
|
+
| 'SCREAMING_SNAKE_CASE';
|
|
7052
|
+
|
|
7005
7053
|
interface UserConfig {
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7054
|
+
/**
|
|
7055
|
+
* Path to the config file. Set this value if you don't use the default
|
|
7056
|
+
* config file name, or it's not located in the project root.
|
|
7057
|
+
*/
|
|
7058
|
+
configFile?: string;
|
|
7059
|
+
/**
|
|
7060
|
+
* Skip writing files to disk?
|
|
7061
|
+
*
|
|
7062
|
+
* @default false
|
|
7063
|
+
*/
|
|
7064
|
+
dryRun?: boolean;
|
|
7065
|
+
/**
|
|
7066
|
+
* Path to the OpenAPI specification. This can be either local or remote path.
|
|
7067
|
+
* Both JSON and YAML file formats are supported. You can also pass the parsed
|
|
7068
|
+
* object directly if you're fetching the file yourself.
|
|
7069
|
+
*
|
|
7070
|
+
* Alternatively, you can define a configuration object with more options.
|
|
7071
|
+
*/
|
|
7072
|
+
input:
|
|
7073
|
+
| string
|
|
7074
|
+
| Record<string, unknown>
|
|
7075
|
+
| {
|
|
7025
7076
|
/**
|
|
7026
7077
|
* Prevent parts matching the regular expression from being processed.
|
|
7027
7078
|
* You can select both operations and components by reference within
|
|
@@ -7049,13 +7100,15 @@ interface UserConfig {
|
|
|
7049
7100
|
* object directly if you're fetching the file yourself.
|
|
7050
7101
|
*/
|
|
7051
7102
|
path: string | Record<string, unknown>;
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7103
|
+
};
|
|
7104
|
+
/**
|
|
7105
|
+
* The relative location of the logs folder
|
|
7106
|
+
*
|
|
7107
|
+
* @default process.cwd()
|
|
7108
|
+
*/
|
|
7109
|
+
logs?:
|
|
7110
|
+
| string
|
|
7111
|
+
| {
|
|
7059
7112
|
/**
|
|
7060
7113
|
* The logging level to control the verbosity of log output.
|
|
7061
7114
|
* Determines which messages are logged based on their severity.
|
|
@@ -7073,18 +7126,27 @@ interface UserConfig {
|
|
|
7073
7126
|
*
|
|
7074
7127
|
* @default 'info'
|
|
7075
7128
|
*/
|
|
7076
|
-
level?:
|
|
7129
|
+
level?:
|
|
7130
|
+
| 'debug'
|
|
7131
|
+
| 'error'
|
|
7132
|
+
| 'fatal'
|
|
7133
|
+
| 'info'
|
|
7134
|
+
| 'silent'
|
|
7135
|
+
| 'trace'
|
|
7136
|
+
| 'warn';
|
|
7077
7137
|
/**
|
|
7078
7138
|
* The relative location of the logs folder
|
|
7079
7139
|
*
|
|
7080
7140
|
* @default process.cwd()
|
|
7081
7141
|
*/
|
|
7082
7142
|
path?: string;
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7143
|
+
};
|
|
7144
|
+
/**
|
|
7145
|
+
* The relative location of the output folder
|
|
7146
|
+
*/
|
|
7147
|
+
output:
|
|
7148
|
+
| string
|
|
7149
|
+
| {
|
|
7088
7150
|
/**
|
|
7089
7151
|
* Defines casing of the output fields. By default, we preserve `input`
|
|
7090
7152
|
* values as data transforms incur a performance penalty at runtime.
|
|
@@ -7125,21 +7187,25 @@ interface UserConfig {
|
|
|
7125
7187
|
* The relative location of the output folder
|
|
7126
7188
|
*/
|
|
7127
7189
|
path: string;
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7190
|
+
};
|
|
7191
|
+
/**
|
|
7192
|
+
* Plugins generate artifacts from `input`. By default, we generate SDK
|
|
7193
|
+
* functions and TypeScript interfaces. If you manually define `plugins`,
|
|
7194
|
+
* you need to include the default plugins if you wish to use them.
|
|
7195
|
+
*
|
|
7196
|
+
* @default ['@hey-api/typescript', '@hey-api/sdk']
|
|
7197
|
+
*/
|
|
7198
|
+
plugins?: ReadonlyArray<UserPlugins['name'] | UserPlugins>;
|
|
7199
|
+
/**
|
|
7200
|
+
* Regenerate the client when the input file changes? You can alternatively
|
|
7201
|
+
* pass a numeric value for the interval in ms.
|
|
7202
|
+
*
|
|
7203
|
+
* @default false
|
|
7204
|
+
*/
|
|
7205
|
+
watch?:
|
|
7206
|
+
| boolean
|
|
7207
|
+
| number
|
|
7208
|
+
| {
|
|
7143
7209
|
/**
|
|
7144
7210
|
* Regenerate the client when the input file changes?
|
|
7145
7211
|
*
|
|
@@ -7147,76 +7213,94 @@ interface UserConfig {
|
|
|
7147
7213
|
*/
|
|
7148
7214
|
enabled?: boolean;
|
|
7149
7215
|
/**
|
|
7150
|
-
* How often should we attempt to detect the input file change?
|
|
7216
|
+
* How often should we attempt to detect the input file change? (in ms)
|
|
7151
7217
|
*
|
|
7152
7218
|
* @default 1000
|
|
7153
7219
|
*/
|
|
7154
7220
|
interval?: number;
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7221
|
+
/**
|
|
7222
|
+
* How long will we wait before the request times out?
|
|
7223
|
+
*
|
|
7224
|
+
* @default 60_000
|
|
7225
|
+
*/
|
|
7226
|
+
timeout?: number;
|
|
7227
|
+
};
|
|
7228
|
+
/**
|
|
7229
|
+
* @deprecated
|
|
7230
|
+
*
|
|
7231
|
+
* Manually set base in OpenAPI config instead of inferring from server value
|
|
7232
|
+
*/
|
|
7233
|
+
// eslint-disable-next-line typescript-sort-keys/interface
|
|
7234
|
+
base?: string;
|
|
7235
|
+
/**
|
|
7236
|
+
* @deprecated
|
|
7237
|
+
*
|
|
7238
|
+
* Opt in to the experimental parser?
|
|
7239
|
+
*
|
|
7240
|
+
* @default true
|
|
7241
|
+
*/
|
|
7242
|
+
experimentalParser?: boolean;
|
|
7243
|
+
/**
|
|
7244
|
+
* @deprecated
|
|
7245
|
+
*
|
|
7246
|
+
* Generate core client classes?
|
|
7247
|
+
*
|
|
7248
|
+
* @default true
|
|
7249
|
+
*/
|
|
7250
|
+
exportCore?: boolean;
|
|
7251
|
+
/**
|
|
7252
|
+
* @deprecated
|
|
7253
|
+
*
|
|
7254
|
+
* Custom client class name. Please note this option is deprecated and
|
|
7255
|
+
* will be removed in favor of clients.
|
|
7256
|
+
*
|
|
7257
|
+
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-name
|
|
7258
|
+
*/
|
|
7259
|
+
name?: string;
|
|
7260
|
+
/**
|
|
7261
|
+
* @deprecated
|
|
7262
|
+
*
|
|
7263
|
+
* Path to custom request file. Please note this option is deprecated and
|
|
7264
|
+
* will be removed in favor of clients.
|
|
7265
|
+
*
|
|
7266
|
+
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-request
|
|
7267
|
+
*/
|
|
7268
|
+
request?: string;
|
|
7269
|
+
/**
|
|
7270
|
+
* @deprecated
|
|
7271
|
+
*
|
|
7272
|
+
* Use options or arguments functions. Please note this option is deprecated and
|
|
7273
|
+
* will be removed in favor of clients.
|
|
7274
|
+
*
|
|
7275
|
+
* @link https://heyapi.dev/openapi-ts/migrating.html#deprecated-useoptions
|
|
7276
|
+
*
|
|
7277
|
+
* @default true
|
|
7278
|
+
*/
|
|
7279
|
+
useOptions?: boolean;
|
|
7280
|
+
}
|
|
7281
|
+
|
|
7282
|
+
type Config = Omit<
|
|
7283
|
+
Required<UserConfig>,
|
|
7284
|
+
| 'base'
|
|
7285
|
+
| 'input'
|
|
7286
|
+
| 'logs'
|
|
7287
|
+
| 'name'
|
|
7288
|
+
| 'output'
|
|
7289
|
+
| 'plugins'
|
|
7290
|
+
| 'request'
|
|
7291
|
+
| 'watch'
|
|
7292
|
+
> &
|
|
7293
|
+
Pick<UserConfig, 'base' | 'name' | 'request'> & {
|
|
7294
|
+
input: ExtractWithDiscriminator<UserConfig['input'], { path: unknown }>;
|
|
7212
7295
|
logs: Extract<Required<UserConfig['logs']>, object>;
|
|
7213
7296
|
output: Extract<UserConfig['output'], object>;
|
|
7214
7297
|
pluginOrder: ReadonlyArray<ClientPlugins['name']>;
|
|
7215
|
-
plugins: ArrayOfObjectsToObjectMap<
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7298
|
+
plugins: ArrayOfObjectsToObjectMap<
|
|
7299
|
+
ExtractArrayOfObjects<ReadonlyArray<ClientPlugins>, { name: string }>,
|
|
7300
|
+
'name'
|
|
7301
|
+
>;
|
|
7302
|
+
watch: Extract<Required<UserConfig['watch']>, object>;
|
|
7303
|
+
};
|
|
7220
7304
|
|
|
7221
7305
|
interface Identifier {
|
|
7222
7306
|
/**
|
|
@@ -7375,6 +7459,9 @@ interface Events {
|
|
|
7375
7459
|
name: string;
|
|
7376
7460
|
schema: IR.SchemaObject;
|
|
7377
7461
|
}) => void;
|
|
7462
|
+
server: (args: {
|
|
7463
|
+
server: IR.ServerObject;
|
|
7464
|
+
}) => void;
|
|
7378
7465
|
}
|
|
7379
7466
|
declare class IRContext<Spec extends Record<string, any> = any> {
|
|
7380
7467
|
/**
|
|
@@ -7428,27 +7515,24 @@ declare class IRContext<Spec extends Record<string, any> = any> {
|
|
|
7428
7515
|
|
|
7429
7516
|
type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params';
|
|
7430
7517
|
|
|
7518
|
+
interface IRBodyObject {
|
|
7519
|
+
mediaType: string;
|
|
7520
|
+
/**
|
|
7521
|
+
* Does body control pagination? We handle only simple values
|
|
7522
|
+
* for now, up to 1 nested field.
|
|
7523
|
+
*/
|
|
7524
|
+
pagination?: boolean | string;
|
|
7525
|
+
required?: boolean;
|
|
7526
|
+
schema: IRSchemaObject;
|
|
7527
|
+
type?: IRMediaType;
|
|
7528
|
+
}
|
|
7529
|
+
|
|
7431
7530
|
interface IRComponentsObject {
|
|
7432
7531
|
parameters?: Record<string, IRParameterObject>;
|
|
7433
7532
|
requestBodies?: Record<string, IRRequestBodyObject>;
|
|
7434
7533
|
schemas?: Record<string, IRSchemaObject>;
|
|
7435
7534
|
}
|
|
7436
7535
|
|
|
7437
|
-
interface IRPathsObject {
|
|
7438
|
-
[path: `/${string}`]: IRPathItemObject;
|
|
7439
|
-
}
|
|
7440
|
-
|
|
7441
|
-
interface IRPathItemObject {
|
|
7442
|
-
delete?: IROperationObject;
|
|
7443
|
-
get?: IROperationObject;
|
|
7444
|
-
head?: IROperationObject;
|
|
7445
|
-
options?: IROperationObject;
|
|
7446
|
-
patch?: IROperationObject;
|
|
7447
|
-
post?: IROperationObject;
|
|
7448
|
-
put?: IROperationObject;
|
|
7449
|
-
trace?: IROperationObject;
|
|
7450
|
-
}
|
|
7451
|
-
|
|
7452
7536
|
interface IROperationObject {
|
|
7453
7537
|
body?: IRBodyObject;
|
|
7454
7538
|
deprecated?: boolean;
|
|
@@ -7459,24 +7543,11 @@ interface IROperationObject {
|
|
|
7459
7543
|
path: keyof IRPathsObject;
|
|
7460
7544
|
responses?: IRResponsesObject;
|
|
7461
7545
|
security?: ReadonlyArray<IRSecurityObject>;
|
|
7462
|
-
|
|
7463
|
-
// servers?: ReadonlyArray<ServerObject>;
|
|
7546
|
+
servers?: ReadonlyArray<IRServerObject>;
|
|
7464
7547
|
summary?: string;
|
|
7465
7548
|
tags?: ReadonlyArray<string>;
|
|
7466
7549
|
}
|
|
7467
7550
|
|
|
7468
|
-
interface IRBodyObject {
|
|
7469
|
-
mediaType: string;
|
|
7470
|
-
/**
|
|
7471
|
-
* Does body control pagination? We handle only simple values
|
|
7472
|
-
* for now, up to 1 nested field.
|
|
7473
|
-
*/
|
|
7474
|
-
pagination?: boolean | string;
|
|
7475
|
-
required?: boolean;
|
|
7476
|
-
schema: IRSchemaObject;
|
|
7477
|
-
type?: IRMediaType;
|
|
7478
|
-
}
|
|
7479
|
-
|
|
7480
7551
|
interface IRParametersObject {
|
|
7481
7552
|
cookie?: Record<string, IRParameterObject>;
|
|
7482
7553
|
header?: Record<string, IRParameterObject>;
|
|
@@ -7519,6 +7590,21 @@ interface IRParameterObject
|
|
|
7519
7590
|
| 'spaceDelimited';
|
|
7520
7591
|
}
|
|
7521
7592
|
|
|
7593
|
+
interface IRPathsObject {
|
|
7594
|
+
[path: `/${string}`]: IRPathItemObject;
|
|
7595
|
+
}
|
|
7596
|
+
|
|
7597
|
+
interface IRPathItemObject {
|
|
7598
|
+
delete?: IROperationObject;
|
|
7599
|
+
get?: IROperationObject;
|
|
7600
|
+
head?: IROperationObject;
|
|
7601
|
+
options?: IROperationObject;
|
|
7602
|
+
patch?: IROperationObject;
|
|
7603
|
+
post?: IROperationObject;
|
|
7604
|
+
put?: IROperationObject;
|
|
7605
|
+
trace?: IROperationObject;
|
|
7606
|
+
}
|
|
7607
|
+
|
|
7522
7608
|
interface IRRequestBodyObject
|
|
7523
7609
|
extends Pick<JsonSchemaDraft2020_12, 'description'> {
|
|
7524
7610
|
required?: boolean;
|
|
@@ -7613,9 +7699,12 @@ interface IRSchemaObject
|
|
|
7613
7699
|
|
|
7614
7700
|
type IRSecurityObject = SecuritySchemeObject$2;
|
|
7615
7701
|
|
|
7702
|
+
type IRServerObject = ServerObject$1;
|
|
7703
|
+
|
|
7616
7704
|
interface IRModel {
|
|
7617
7705
|
components?: IRComponentsObject;
|
|
7618
7706
|
paths?: IRPathsObject;
|
|
7707
|
+
servers?: ReadonlyArray<IRServerObject>;
|
|
7619
7708
|
}
|
|
7620
7709
|
|
|
7621
7710
|
declare namespace IR {
|
|
@@ -7633,8 +7722,14 @@ declare namespace IR {
|
|
|
7633
7722
|
export type ResponsesObject = IRResponsesObject;
|
|
7634
7723
|
export type SchemaObject = IRSchemaObject;
|
|
7635
7724
|
export type SecurityObject = IRSecurityObject;
|
|
7725
|
+
export type ServerObject = IRServerObject;
|
|
7636
7726
|
}
|
|
7637
7727
|
|
|
7728
|
+
/**
|
|
7729
|
+
* Default plugins used to generate artifacts if plugins aren't specified.
|
|
7730
|
+
*/
|
|
7731
|
+
declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
|
|
7732
|
+
|
|
7638
7733
|
declare namespace LegacyIR {
|
|
7639
7734
|
export type LegacyOperation = Operation;
|
|
7640
7735
|
}
|
|
@@ -7648,16 +7743,11 @@ declare const utils: {
|
|
|
7648
7743
|
};
|
|
7649
7744
|
|
|
7650
7745
|
/**
|
|
7651
|
-
* Generate
|
|
7652
|
-
*
|
|
7653
|
-
*
|
|
7654
|
-
* @param userConfig {@link UserConfig} passed to the `createClient()` method
|
|
7655
|
-
*/
|
|
7656
|
-
declare function createClient(userConfig: UserConfig): Promise<ReadonlyArray<Client$1 | IR.Context>>;
|
|
7657
|
-
/**
|
|
7658
|
-
* Default plugins used to generate artifacts if plugins aren't specified.
|
|
7746
|
+
* Generate a client from the provided configuration.
|
|
7747
|
+
*
|
|
7748
|
+
* @param userConfig User provided {@link UserConfig} configuration.
|
|
7659
7749
|
*/
|
|
7660
|
-
declare const
|
|
7750
|
+
declare const createClient: (userConfig: UserConfig) => Promise<ReadonlyArray<Client$1 | IR.Context>>;
|
|
7661
7751
|
/**
|
|
7662
7752
|
* Type helper for openapi-ts.config.ts, returns {@link UserConfig} object
|
|
7663
7753
|
*/
|