@orval/core 7.11.2 → 7.12.2
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.d.ts +1334 -1111
- package/dist/index.js +3939 -53668
- package/dist/index.js.map +1 -1
- package/package.json +35 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,299 +1,286 @@
|
|
|
1
|
-
import SwaggerParser from
|
|
2
|
-
import { allLocales } from
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ValueIteratee } from
|
|
8
|
-
import { ServerObject } from
|
|
9
|
-
import { CompareOperator } from
|
|
10
|
-
import debug from
|
|
1
|
+
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
2
|
+
import { allLocales } from "@faker-js/faker";
|
|
3
|
+
import { JSONSchema6, JSONSchema7 } from "json-schema";
|
|
4
|
+
import { ComponentsObject, ExampleObject, InfoObject, OpenAPIObject, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemasObject } from "openapi3-ts/oas30";
|
|
5
|
+
import { ConvertInputOptions } from "swagger2openapi";
|
|
6
|
+
import { TypeDocOptions } from "typedoc";
|
|
7
|
+
import { ValueIteratee } from "lodash";
|
|
8
|
+
import { ServerObject } from "openapi3-ts/oas31";
|
|
9
|
+
import { CompareOperator } from "compare-versions";
|
|
10
|
+
import debug from "debug";
|
|
11
11
|
|
|
12
|
+
//#region rolldown:runtime
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/types.d.ts
|
|
12
15
|
interface Options {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
output?: string | OutputOptions;
|
|
17
|
+
input?: string | InputOptions;
|
|
18
|
+
hooks?: Partial<HooksOptions>;
|
|
16
19
|
}
|
|
17
20
|
type OptionsFn = () => Options | Promise<Options>;
|
|
18
21
|
type OptionsExport = Options | Promise<Options> | OptionsFn;
|
|
19
|
-
type Config =
|
|
20
|
-
[project: string]: OptionsExport;
|
|
21
|
-
};
|
|
22
|
+
type Config = Record<string, OptionsExport>;
|
|
22
23
|
type ConfigFn = () => Config | Promise<Config>;
|
|
23
24
|
type ConfigExternal = Config | Promise<Config> | ConfigFn;
|
|
24
|
-
type NormalizedConfig =
|
|
25
|
-
[project: string]: NormalizedOptions;
|
|
26
|
-
};
|
|
25
|
+
type NormalizedConfig = Record<string, NormalizedOptions | undefined>;
|
|
27
26
|
interface NormalizedOptions {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
output: NormalizedOutputOptions;
|
|
28
|
+
input: NormalizedInputOptions;
|
|
29
|
+
hooks: NormalizedHookOptions;
|
|
31
30
|
}
|
|
32
31
|
type NormalizedOutputOptions = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
propertySortOrder: PropertySortOrder;
|
|
32
|
+
workspace?: string;
|
|
33
|
+
target?: string;
|
|
34
|
+
schemas?: string;
|
|
35
|
+
namingConvention: NamingConvention;
|
|
36
|
+
fileExtension: string;
|
|
37
|
+
mode: OutputMode;
|
|
38
|
+
mock?: GlobalMockOptions | ClientMockBuilder;
|
|
39
|
+
override: NormalizedOverrideOutput;
|
|
40
|
+
client: OutputClient | OutputClientFunc;
|
|
41
|
+
httpClient: OutputHttpClient;
|
|
42
|
+
clean: boolean | string[];
|
|
43
|
+
docs: boolean | OutputDocsOptions;
|
|
44
|
+
prettier: boolean;
|
|
45
|
+
biome: boolean;
|
|
46
|
+
tsconfig?: Tsconfig;
|
|
47
|
+
packageJson?: PackageJson;
|
|
48
|
+
headers: boolean;
|
|
49
|
+
indexFiles: boolean;
|
|
50
|
+
baseUrl?: string | BaseUrlFromSpec | BaseUrlFromConstant;
|
|
51
|
+
allParamsOptional: boolean;
|
|
52
|
+
urlEncodeParameters: boolean;
|
|
53
|
+
unionAddMissingProperties: boolean;
|
|
54
|
+
optionsParamRequired: boolean;
|
|
55
|
+
propertySortOrder: PropertySortOrder;
|
|
58
56
|
};
|
|
59
57
|
type NormalizedParamsSerializerOptions = {
|
|
60
|
-
|
|
58
|
+
qs?: Record<string, any>;
|
|
61
59
|
};
|
|
62
60
|
type NormalizedOverrideOutput = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
title?: (title: string) => string;
|
|
62
|
+
transformer?: OutputTransformer;
|
|
63
|
+
mutator?: NormalizedMutator;
|
|
64
|
+
operations: Record<string, NormalizedOperationOptions>;
|
|
65
|
+
tags: Record<string, NormalizedOperationOptions>;
|
|
66
|
+
mock?: OverrideMockOptions;
|
|
67
|
+
contentType?: OverrideOutputContentType;
|
|
68
|
+
header: false | ((info: InfoObject) => string[] | string);
|
|
69
|
+
formData: NormalizedFormDataType<NormalizedMutator>;
|
|
70
|
+
formUrlEncoded: boolean | NormalizedMutator;
|
|
71
|
+
paramsSerializer?: NormalizedMutator;
|
|
72
|
+
paramsSerializerOptions?: NormalizedParamsSerializerOptions;
|
|
73
|
+
namingConvention: {
|
|
74
|
+
enum?: NamingConvention;
|
|
75
|
+
};
|
|
76
|
+
components: {
|
|
77
|
+
schemas: {
|
|
78
|
+
suffix: string;
|
|
79
|
+
itemSuffix: string;
|
|
68
80
|
};
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
responses: {
|
|
82
|
+
suffix: string;
|
|
71
83
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
header: false | ((info: InfoObject) => string[] | string);
|
|
75
|
-
formData: NormalizedFormDataType<NormalizedMutator>;
|
|
76
|
-
formUrlEncoded: boolean | NormalizedMutator;
|
|
77
|
-
paramsSerializer?: NormalizedMutator;
|
|
78
|
-
paramsSerializerOptions?: NormalizedParamsSerializerOptions;
|
|
79
|
-
namingConvention: {
|
|
80
|
-
enum?: NamingConvention;
|
|
84
|
+
parameters: {
|
|
85
|
+
suffix: string;
|
|
81
86
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
suffix: string;
|
|
85
|
-
itemSuffix: string;
|
|
86
|
-
};
|
|
87
|
-
responses: {
|
|
88
|
-
suffix: string;
|
|
89
|
-
};
|
|
90
|
-
parameters: {
|
|
91
|
-
suffix: string;
|
|
92
|
-
};
|
|
93
|
-
requestBodies: {
|
|
94
|
-
suffix: string;
|
|
95
|
-
};
|
|
87
|
+
requestBodies: {
|
|
88
|
+
suffix: string;
|
|
96
89
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
90
|
+
};
|
|
91
|
+
hono: NormalizedHonoOptions;
|
|
92
|
+
query: NormalizedQueryOptions;
|
|
93
|
+
angular: Required<AngularOptions>;
|
|
94
|
+
swr: SwrOptions;
|
|
95
|
+
zod: NormalizedZodOptions;
|
|
96
|
+
fetch: NormalizedFetchOptions;
|
|
97
|
+
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
98
|
+
requestOptions: Record<string, any> | boolean;
|
|
99
|
+
useDates?: boolean;
|
|
100
|
+
coerceTypes?: boolean;
|
|
101
|
+
useTypeOverInterfaces?: boolean;
|
|
102
|
+
useDeprecatedOperations?: boolean;
|
|
103
|
+
useBigInt?: boolean;
|
|
104
|
+
useNamedParameters?: boolean;
|
|
105
|
+
enumGenerationType: EnumGeneration;
|
|
106
|
+
suppressReadonlyModifier?: boolean;
|
|
107
|
+
jsDoc: NormalizedJsDocOptions;
|
|
114
108
|
};
|
|
115
109
|
type NormalizedMutator = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
path: string;
|
|
111
|
+
name?: string;
|
|
112
|
+
default: boolean;
|
|
113
|
+
alias?: Record<string, string>;
|
|
114
|
+
extension?: string;
|
|
121
115
|
};
|
|
122
116
|
type NormalizedOperationOptions = {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
117
|
+
transformer?: OutputTransformer;
|
|
118
|
+
mutator?: NormalizedMutator;
|
|
119
|
+
mock?: {
|
|
120
|
+
data?: MockData;
|
|
121
|
+
properties?: MockProperties;
|
|
122
|
+
};
|
|
123
|
+
contentType?: OverrideOutputContentType;
|
|
124
|
+
query?: NormalizedQueryOptions;
|
|
125
|
+
angular?: Required<AngularOptions>;
|
|
126
|
+
swr?: SwrOptions;
|
|
127
|
+
zod?: NormalizedZodOptions;
|
|
128
|
+
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
129
|
+
fetch?: FetchOptions;
|
|
130
|
+
formData?: NormalizedFormDataType<NormalizedMutator>;
|
|
131
|
+
formUrlEncoded?: boolean | NormalizedMutator;
|
|
132
|
+
paramsSerializer?: NormalizedMutator;
|
|
133
|
+
requestOptions?: object | boolean;
|
|
140
134
|
};
|
|
141
135
|
type NormalizedInputOptions = {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
target: string | Record<string, unknown> | OpenAPIObject;
|
|
137
|
+
validation: boolean | object;
|
|
138
|
+
override: OverrideInput;
|
|
139
|
+
converterOptions: Partial<ConvertInputOptions>;
|
|
140
|
+
parserOptions: SwaggerParserOptions;
|
|
141
|
+
filters?: InputFiltersOption;
|
|
148
142
|
};
|
|
149
143
|
type OutputClientFunc = (clients: GeneratorClients) => ClientGeneratorsBuilder;
|
|
150
144
|
type BaseUrlFromSpec = {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
index?: number;
|
|
156
|
-
baseUrl?: never;
|
|
145
|
+
getBaseUrlFromSpecification: true;
|
|
146
|
+
variables?: Record<string, string>;
|
|
147
|
+
index?: number;
|
|
148
|
+
baseUrl?: never;
|
|
157
149
|
};
|
|
158
150
|
type BaseUrlFromConstant = {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
151
|
+
getBaseUrlFromSpecification: false;
|
|
152
|
+
variables?: never;
|
|
153
|
+
index?: never;
|
|
154
|
+
baseUrl: string;
|
|
163
155
|
};
|
|
164
156
|
declare const PropertySortOrder: {
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
readonly ALPHABETICAL: "Alphabetical";
|
|
158
|
+
readonly SPECIFICATION: "Specification";
|
|
167
159
|
};
|
|
168
160
|
type PropertySortOrder = (typeof PropertySortOrder)[keyof typeof PropertySortOrder];
|
|
169
161
|
declare const NamingConvention: {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
162
|
+
readonly CAMEL_CASE: "camelCase";
|
|
163
|
+
readonly PASCAL_CASE: "PascalCase";
|
|
164
|
+
readonly SNAKE_CASE: "snake_case";
|
|
165
|
+
readonly KEBAB_CASE: "kebab-case";
|
|
174
166
|
};
|
|
175
167
|
type NamingConvention = (typeof NamingConvention)[keyof typeof NamingConvention];
|
|
176
168
|
declare const EnumGeneration: {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
169
|
+
readonly CONST: "const";
|
|
170
|
+
readonly ENUM: "enum";
|
|
171
|
+
readonly UNION: "union";
|
|
180
172
|
};
|
|
181
173
|
type EnumGeneration = (typeof EnumGeneration)[keyof typeof EnumGeneration];
|
|
182
174
|
type OutputOptions = {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
propertySortOrder?: PropertySortOrder;
|
|
175
|
+
workspace?: string;
|
|
176
|
+
target?: string;
|
|
177
|
+
schemas?: string;
|
|
178
|
+
namingConvention?: NamingConvention;
|
|
179
|
+
fileExtension?: string;
|
|
180
|
+
mode?: OutputMode;
|
|
181
|
+
mock?: boolean | GlobalMockOptions | ClientMockBuilder;
|
|
182
|
+
override?: OverrideOutput;
|
|
183
|
+
client?: OutputClient | OutputClientFunc;
|
|
184
|
+
httpClient?: OutputHttpClient;
|
|
185
|
+
clean?: boolean | string[];
|
|
186
|
+
docs?: boolean | OutputDocsOptions;
|
|
187
|
+
prettier?: boolean;
|
|
188
|
+
biome?: boolean;
|
|
189
|
+
tsconfig?: string | Tsconfig;
|
|
190
|
+
packageJson?: string;
|
|
191
|
+
headers?: boolean;
|
|
192
|
+
indexFiles?: boolean;
|
|
193
|
+
baseUrl?: string | BaseUrlFromSpec | BaseUrlFromConstant;
|
|
194
|
+
allParamsOptional?: boolean;
|
|
195
|
+
urlEncodeParameters?: boolean;
|
|
196
|
+
unionAddMissingProperties?: boolean;
|
|
197
|
+
optionsParamRequired?: boolean;
|
|
198
|
+
propertySortOrder?: PropertySortOrder;
|
|
208
199
|
};
|
|
209
200
|
type SwaggerParserOptions = Omit<SwaggerParser.Options, 'validate'> & {
|
|
210
|
-
|
|
201
|
+
validate?: boolean;
|
|
211
202
|
};
|
|
212
203
|
type InputFiltersOption = {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
204
|
+
mode?: 'include' | 'exclude';
|
|
205
|
+
tags?: (string | RegExp)[];
|
|
206
|
+
schemas?: (string | RegExp)[];
|
|
216
207
|
};
|
|
217
208
|
type InputOptions = {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
209
|
+
target: string | Record<string, unknown> | OpenAPIObject;
|
|
210
|
+
validation?: boolean | object;
|
|
211
|
+
override?: OverrideInput;
|
|
212
|
+
converterOptions?: Partial<ConvertInputOptions>;
|
|
213
|
+
parserOptions?: SwaggerParserOptions;
|
|
214
|
+
filters?: InputFiltersOption;
|
|
224
215
|
};
|
|
225
216
|
declare const OutputClient: {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
217
|
+
readonly ANGULAR: "angular";
|
|
218
|
+
readonly AXIOS: "axios";
|
|
219
|
+
readonly AXIOS_FUNCTIONS: "axios-functions";
|
|
220
|
+
readonly REACT_QUERY: "react-query";
|
|
221
|
+
readonly SVELTE_QUERY: "svelte-query";
|
|
222
|
+
readonly VUE_QUERY: "vue-query";
|
|
223
|
+
readonly SWR: "swr";
|
|
224
|
+
readonly ZOD: "zod";
|
|
225
|
+
readonly HONO: "hono";
|
|
226
|
+
readonly FETCH: "fetch";
|
|
227
|
+
readonly MCP: "mcp";
|
|
237
228
|
};
|
|
238
229
|
type OutputClient = (typeof OutputClient)[keyof typeof OutputClient];
|
|
239
230
|
declare const OutputHttpClient: {
|
|
240
|
-
|
|
241
|
-
|
|
231
|
+
readonly AXIOS: "axios";
|
|
232
|
+
readonly FETCH: "fetch";
|
|
242
233
|
};
|
|
243
234
|
type OutputHttpClient = (typeof OutputHttpClient)[keyof typeof OutputHttpClient];
|
|
244
235
|
declare const OutputMode: {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
236
|
+
readonly SINGLE: "single";
|
|
237
|
+
readonly SPLIT: "split";
|
|
238
|
+
readonly TAGS: "tags";
|
|
239
|
+
readonly TAGS_SPLIT: "tags-split";
|
|
249
240
|
};
|
|
250
241
|
type OutputMode = (typeof OutputMode)[keyof typeof OutputMode];
|
|
251
242
|
type OutputDocsOptions = {
|
|
252
|
-
|
|
243
|
+
configPath?: string;
|
|
253
244
|
} & Partial<TypeDocOptions>;
|
|
254
245
|
declare const OutputMockType: {
|
|
255
|
-
|
|
246
|
+
readonly MSW: "msw";
|
|
256
247
|
};
|
|
257
248
|
type OutputMockType = (typeof OutputMockType)[keyof typeof OutputMockType];
|
|
258
249
|
type GlobalMockOptions = {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
250
|
+
type: OutputMockType;
|
|
251
|
+
useExamples?: boolean;
|
|
252
|
+
generateEachHttpStatus?: boolean;
|
|
253
|
+
delay?: false | number | (() => number);
|
|
254
|
+
delayFunctionLazyExecute?: boolean;
|
|
255
|
+
baseUrl?: string;
|
|
256
|
+
locale?: keyof typeof allLocales;
|
|
257
|
+
indexMockFiles?: boolean;
|
|
267
258
|
};
|
|
268
259
|
type OverrideMockOptions = Partial<GlobalMockOptions> & {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
260
|
+
arrayMin?: number;
|
|
261
|
+
arrayMax?: number;
|
|
262
|
+
stringMin?: number;
|
|
263
|
+
stringMax?: number;
|
|
264
|
+
numberMin?: number;
|
|
265
|
+
numberMax?: number;
|
|
266
|
+
required?: boolean;
|
|
267
|
+
properties?: MockProperties;
|
|
268
|
+
format?: Record<string, unknown>;
|
|
269
|
+
fractionDigits?: number;
|
|
279
270
|
};
|
|
280
271
|
type MockOptions = Omit<OverrideMockOptions, 'properties'> & {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
};
|
|
289
|
-
type MockPropertiesObject =
|
|
290
|
-
[key: string]: unknown;
|
|
291
|
-
};
|
|
272
|
+
properties?: Record<string, unknown>;
|
|
273
|
+
operations?: Record<string, {
|
|
274
|
+
properties: Record<string, unknown>;
|
|
275
|
+
}>;
|
|
276
|
+
tags?: Record<string, {
|
|
277
|
+
properties: Record<string, unknown>;
|
|
278
|
+
}>;
|
|
279
|
+
};
|
|
280
|
+
type MockPropertiesObject = Record<string, unknown>;
|
|
292
281
|
type MockPropertiesObjectFn = (specs: OpenAPIObject) => MockPropertiesObject;
|
|
293
282
|
type MockProperties = MockPropertiesObject | MockPropertiesObjectFn;
|
|
294
|
-
type MockDataObject =
|
|
295
|
-
[key: string]: unknown;
|
|
296
|
-
};
|
|
283
|
+
type MockDataObject = Record<string, unknown>;
|
|
297
284
|
type MockDataObjectFn = (specs: OpenAPIObject) => MockDataObject;
|
|
298
285
|
type MockDataArray = unknown[];
|
|
299
286
|
type MockDataArrayFn = (specs: OpenAPIObject) => MockDataArray;
|
|
@@ -301,278 +288,283 @@ type MockData = MockDataObject | MockDataObjectFn | MockDataArray | MockDataArra
|
|
|
301
288
|
type OutputTransformerFn = (verb: GeneratorVerbOptions) => GeneratorVerbOptions;
|
|
302
289
|
type OutputTransformer = string | OutputTransformerFn;
|
|
303
290
|
type MutatorObject = {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
291
|
+
path: string;
|
|
292
|
+
name?: string;
|
|
293
|
+
default?: boolean;
|
|
294
|
+
alias?: Record<string, string>;
|
|
295
|
+
extension?: string;
|
|
309
296
|
};
|
|
310
297
|
type Mutator = string | MutatorObject;
|
|
311
298
|
type ParamsSerializerOptions = {
|
|
312
|
-
|
|
299
|
+
qs?: Record<string, any>;
|
|
313
300
|
};
|
|
314
301
|
declare const FormDataArrayHandling: {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
302
|
+
readonly SERIALIZE: "serialize";
|
|
303
|
+
readonly EXPLODE: "explode";
|
|
304
|
+
readonly SERIALIZE_WITH_BRACKETS: "serialize-with-brackets";
|
|
318
305
|
};
|
|
319
306
|
type FormDataArrayHandling = (typeof FormDataArrayHandling)[keyof typeof FormDataArrayHandling];
|
|
320
307
|
type NormalizedFormDataType<TMutator> = {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
308
|
+
disabled: true;
|
|
309
|
+
mutator?: never;
|
|
310
|
+
arrayHandling: FormDataArrayHandling;
|
|
324
311
|
} | {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
312
|
+
disabled: false;
|
|
313
|
+
mutator?: TMutator;
|
|
314
|
+
arrayHandling: FormDataArrayHandling;
|
|
328
315
|
};
|
|
329
316
|
type FormDataType<TMutator> = {
|
|
330
|
-
|
|
331
|
-
|
|
317
|
+
mutator: TMutator;
|
|
318
|
+
arrayHandling?: FormDataArrayHandling;
|
|
332
319
|
} | {
|
|
333
|
-
|
|
334
|
-
|
|
320
|
+
mutator?: TMutator;
|
|
321
|
+
arrayHandling: FormDataArrayHandling;
|
|
335
322
|
};
|
|
336
323
|
type OverrideOutput = {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
324
|
+
title?: (title: string) => string;
|
|
325
|
+
transformer?: OutputTransformer;
|
|
326
|
+
mutator?: Mutator;
|
|
327
|
+
operations?: Record<string, OperationOptions>;
|
|
328
|
+
tags?: Record<string, OperationOptions>;
|
|
329
|
+
mock?: OverrideMockOptions;
|
|
330
|
+
contentType?: OverrideOutputContentType;
|
|
331
|
+
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
332
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
333
|
+
formUrlEncoded?: boolean | Mutator;
|
|
334
|
+
paramsSerializer?: Mutator;
|
|
335
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
336
|
+
namingConvention?: {
|
|
337
|
+
enum?: NamingConvention;
|
|
338
|
+
};
|
|
339
|
+
components?: {
|
|
340
|
+
schemas?: {
|
|
341
|
+
suffix?: string;
|
|
342
|
+
itemSuffix?: string;
|
|
342
343
|
};
|
|
343
|
-
|
|
344
|
-
|
|
344
|
+
responses?: {
|
|
345
|
+
suffix?: string;
|
|
345
346
|
};
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
349
|
-
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
350
|
-
formUrlEncoded?: boolean | Mutator;
|
|
351
|
-
paramsSerializer?: Mutator;
|
|
352
|
-
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
353
|
-
namingConvention?: {
|
|
354
|
-
enum?: NamingConvention;
|
|
347
|
+
parameters?: {
|
|
348
|
+
suffix?: string;
|
|
355
349
|
};
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
suffix?: string;
|
|
359
|
-
itemSuffix?: string;
|
|
360
|
-
};
|
|
361
|
-
responses?: {
|
|
362
|
-
suffix?: string;
|
|
363
|
-
};
|
|
364
|
-
parameters?: {
|
|
365
|
-
suffix?: string;
|
|
366
|
-
};
|
|
367
|
-
requestBodies?: {
|
|
368
|
-
suffix?: string;
|
|
369
|
-
};
|
|
350
|
+
requestBodies?: {
|
|
351
|
+
suffix?: string;
|
|
370
352
|
};
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
353
|
+
};
|
|
354
|
+
hono?: HonoOptions;
|
|
355
|
+
query?: QueryOptions;
|
|
356
|
+
swr?: SwrOptions;
|
|
357
|
+
angular?: AngularOptions;
|
|
358
|
+
zod?: ZodOptions;
|
|
359
|
+
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
360
|
+
fetch?: FetchOptions;
|
|
361
|
+
requestOptions?: Record<string, any> | boolean;
|
|
362
|
+
useDates?: boolean;
|
|
363
|
+
useTypeOverInterfaces?: boolean;
|
|
364
|
+
useDeprecatedOperations?: boolean;
|
|
365
|
+
useBigInt?: boolean;
|
|
366
|
+
useNamedParameters?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* @deprecated use 'enumGenerationType="enum"' instead
|
|
369
|
+
*/
|
|
370
|
+
useNativeEnums?: boolean;
|
|
371
|
+
enumGenerationType?: EnumGeneration;
|
|
372
|
+
suppressReadonlyModifier?: boolean;
|
|
373
|
+
jsDoc?: JsDocOptions;
|
|
391
374
|
};
|
|
392
375
|
type JsDocOptions = {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
376
|
+
filter?: (schema: Record<string, any>) => {
|
|
377
|
+
key: string;
|
|
378
|
+
value: string;
|
|
379
|
+
}[];
|
|
397
380
|
};
|
|
398
381
|
type NormalizedJsDocOptions = {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
382
|
+
filter?: (schema: Record<string, any>) => {
|
|
383
|
+
key: string;
|
|
384
|
+
value: string;
|
|
385
|
+
}[];
|
|
403
386
|
};
|
|
404
387
|
type OverrideOutputContentType = {
|
|
405
|
-
|
|
406
|
-
|
|
388
|
+
include?: string[];
|
|
389
|
+
exclude?: string[];
|
|
407
390
|
};
|
|
408
391
|
type NormalizedHonoOptions = {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
392
|
+
handlers?: string;
|
|
393
|
+
compositeRoute: string;
|
|
394
|
+
validator: boolean | 'hono';
|
|
395
|
+
validatorOutputPath: string;
|
|
413
396
|
};
|
|
414
397
|
type ZodDateTimeOptions = {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
398
|
+
offset?: boolean;
|
|
399
|
+
local?: boolean;
|
|
400
|
+
precision?: number;
|
|
418
401
|
};
|
|
419
402
|
type ZodTimeOptions = {
|
|
420
|
-
|
|
403
|
+
precision?: -1 | 0 | 1 | 2 | 3;
|
|
421
404
|
};
|
|
422
405
|
type ZodOptions = {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
406
|
+
strict?: {
|
|
407
|
+
param?: boolean;
|
|
408
|
+
query?: boolean;
|
|
409
|
+
header?: boolean;
|
|
410
|
+
body?: boolean;
|
|
411
|
+
response?: boolean;
|
|
412
|
+
};
|
|
413
|
+
generate?: {
|
|
414
|
+
param?: boolean;
|
|
415
|
+
query?: boolean;
|
|
416
|
+
header?: boolean;
|
|
417
|
+
body?: boolean;
|
|
418
|
+
response?: boolean;
|
|
419
|
+
};
|
|
420
|
+
coerce?: {
|
|
421
|
+
param?: boolean | ZodCoerceType[];
|
|
422
|
+
query?: boolean | ZodCoerceType[];
|
|
423
|
+
header?: boolean | ZodCoerceType[];
|
|
424
|
+
body?: boolean | ZodCoerceType[];
|
|
425
|
+
response?: boolean | ZodCoerceType[];
|
|
426
|
+
};
|
|
427
|
+
preprocess?: {
|
|
428
|
+
param?: Mutator;
|
|
429
|
+
query?: Mutator;
|
|
430
|
+
header?: Mutator;
|
|
431
|
+
body?: Mutator;
|
|
432
|
+
response?: Mutator;
|
|
433
|
+
};
|
|
434
|
+
dateTimeOptions?: ZodDateTimeOptions;
|
|
435
|
+
timeOptions?: ZodTimeOptions;
|
|
436
|
+
generateEachHttpStatus?: boolean;
|
|
454
437
|
};
|
|
455
438
|
type ZodCoerceType = 'string' | 'number' | 'boolean' | 'bigint' | 'date';
|
|
456
439
|
type NormalizedZodOptions = {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
440
|
+
strict: {
|
|
441
|
+
param: boolean;
|
|
442
|
+
query: boolean;
|
|
443
|
+
header: boolean;
|
|
444
|
+
body: boolean;
|
|
445
|
+
response: boolean;
|
|
446
|
+
};
|
|
447
|
+
generate: {
|
|
448
|
+
param: boolean;
|
|
449
|
+
query: boolean;
|
|
450
|
+
header: boolean;
|
|
451
|
+
body: boolean;
|
|
452
|
+
response: boolean;
|
|
453
|
+
};
|
|
454
|
+
coerce: {
|
|
455
|
+
param: boolean | ZodCoerceType[];
|
|
456
|
+
query: boolean | ZodCoerceType[];
|
|
457
|
+
header: boolean | ZodCoerceType[];
|
|
458
|
+
body: boolean | ZodCoerceType[];
|
|
459
|
+
response: boolean | ZodCoerceType[];
|
|
460
|
+
};
|
|
461
|
+
preprocess: {
|
|
462
|
+
param?: NormalizedMutator;
|
|
463
|
+
query?: NormalizedMutator;
|
|
464
|
+
header?: NormalizedMutator;
|
|
465
|
+
body?: NormalizedMutator;
|
|
466
|
+
response?: NormalizedMutator;
|
|
467
|
+
};
|
|
468
|
+
generateEachHttpStatus: boolean;
|
|
469
|
+
dateTimeOptions: ZodDateTimeOptions;
|
|
470
|
+
timeOptions: ZodTimeOptions;
|
|
488
471
|
};
|
|
489
472
|
type HonoOptions = {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
473
|
+
handlers?: string;
|
|
474
|
+
compositeRoute?: string;
|
|
475
|
+
validator?: boolean | 'hono';
|
|
476
|
+
validatorOutputPath?: string;
|
|
494
477
|
};
|
|
495
478
|
type NormalizedQueryOptions = {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
479
|
+
useQuery?: boolean;
|
|
480
|
+
useSuspenseQuery?: boolean;
|
|
481
|
+
useMutation?: boolean;
|
|
482
|
+
useInfinite?: boolean;
|
|
483
|
+
useSuspenseInfiniteQuery?: boolean;
|
|
484
|
+
useInfiniteQueryParam?: string;
|
|
485
|
+
usePrefetch?: boolean;
|
|
486
|
+
options?: any;
|
|
487
|
+
queryKey?: NormalizedMutator;
|
|
488
|
+
queryOptions?: NormalizedMutator;
|
|
489
|
+
mutationOptions?: NormalizedMutator;
|
|
490
|
+
shouldExportMutatorHooks?: boolean;
|
|
491
|
+
shouldExportHttpClient?: boolean;
|
|
492
|
+
shouldExportQueryKey?: boolean;
|
|
493
|
+
shouldSplitQueryKey?: boolean;
|
|
494
|
+
useOperationIdAsQueryKey?: boolean;
|
|
495
|
+
signal?: boolean;
|
|
496
|
+
version?: 3 | 4 | 5;
|
|
513
497
|
};
|
|
514
498
|
type QueryOptions = {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
499
|
+
useQuery?: boolean;
|
|
500
|
+
useSuspenseQuery?: boolean;
|
|
501
|
+
useMutation?: boolean;
|
|
502
|
+
useInfinite?: boolean;
|
|
503
|
+
useSuspenseInfiniteQuery?: boolean;
|
|
504
|
+
useInfiniteQueryParam?: string;
|
|
505
|
+
usePrefetch?: boolean;
|
|
506
|
+
options?: any;
|
|
507
|
+
queryKey?: Mutator;
|
|
508
|
+
queryOptions?: Mutator;
|
|
509
|
+
mutationOptions?: Mutator;
|
|
510
|
+
shouldExportMutatorHooks?: boolean;
|
|
511
|
+
shouldExportHttpClient?: boolean;
|
|
512
|
+
shouldExportQueryKey?: boolean;
|
|
513
|
+
shouldSplitQueryKey?: boolean;
|
|
514
|
+
useOperationIdAsQueryKey?: boolean;
|
|
515
|
+
signal?: boolean;
|
|
516
|
+
version?: 3 | 4 | 5;
|
|
532
517
|
};
|
|
533
518
|
type AngularOptions = {
|
|
534
|
-
|
|
519
|
+
provideIn?: 'root' | 'any' | boolean;
|
|
535
520
|
};
|
|
536
521
|
type SwrOptions = {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
522
|
+
useInfinite?: boolean;
|
|
523
|
+
useSWRMutationForGet?: boolean;
|
|
524
|
+
swrOptions?: any;
|
|
525
|
+
swrMutationOptions?: any;
|
|
526
|
+
swrInfiniteOptions?: any;
|
|
527
|
+
};
|
|
528
|
+
type NormalizedFetchOptions = {
|
|
529
|
+
includeHttpResponseReturnType: boolean;
|
|
530
|
+
forceSuccessResponse: boolean;
|
|
531
|
+
explode: boolean;
|
|
532
|
+
jsonReviver?: Mutator;
|
|
542
533
|
};
|
|
543
534
|
type FetchOptions = {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
535
|
+
includeHttpResponseReturnType?: boolean;
|
|
536
|
+
forceSuccessResponse?: boolean;
|
|
537
|
+
explode?: boolean;
|
|
538
|
+
jsonReviver?: Mutator;
|
|
547
539
|
};
|
|
548
540
|
type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
549
541
|
type InputTransformer = string | InputTransformerFn;
|
|
550
542
|
type OverrideInput = {
|
|
551
|
-
|
|
543
|
+
transformer?: InputTransformer;
|
|
552
544
|
};
|
|
553
545
|
type OperationOptions = {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
546
|
+
transformer?: OutputTransformer;
|
|
547
|
+
mutator?: Mutator;
|
|
548
|
+
mock?: {
|
|
549
|
+
data?: MockData;
|
|
550
|
+
properties?: MockProperties;
|
|
551
|
+
};
|
|
552
|
+
query?: QueryOptions;
|
|
553
|
+
angular?: Required<AngularOptions>;
|
|
554
|
+
swr?: SwrOptions;
|
|
555
|
+
zod?: ZodOptions;
|
|
556
|
+
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
557
|
+
fetch?: FetchOptions;
|
|
558
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
559
|
+
formUrlEncoded?: boolean | Mutator;
|
|
560
|
+
paramsSerializer?: Mutator;
|
|
561
|
+
requestOptions?: object | boolean;
|
|
570
562
|
};
|
|
571
563
|
type Hook = 'afterAllFilesWrite';
|
|
572
564
|
type HookFunction = (...args: any[]) => void | Promise<void>;
|
|
573
565
|
interface HookOption {
|
|
574
|
-
|
|
575
|
-
|
|
566
|
+
command: string | HookFunction;
|
|
567
|
+
injectGeneratedDirsAndFiles?: boolean;
|
|
576
568
|
}
|
|
577
569
|
type HookCommand = string | HookFunction | HookOption | (string | HookFunction | HookOption)[];
|
|
578
570
|
type NormalizedHookCommand = HookCommand[];
|
|
@@ -580,618 +572,745 @@ type HooksOptions<T = HookCommand | NormalizedHookCommand> = Partial<Record<Hook
|
|
|
580
572
|
type NormalizedHookOptions = HooksOptions<NormalizedHookCommand>;
|
|
581
573
|
type Verbs = 'post' | 'put' | 'get' | 'patch' | 'delete' | 'head';
|
|
582
574
|
declare const Verbs: {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
575
|
+
POST: Verbs;
|
|
576
|
+
PUT: Verbs;
|
|
577
|
+
GET: Verbs;
|
|
578
|
+
PATCH: Verbs;
|
|
579
|
+
DELETE: Verbs;
|
|
580
|
+
HEAD: Verbs;
|
|
589
581
|
};
|
|
590
582
|
type ImportOpenApi = {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
583
|
+
data: JSONSchema6 | JSONSchema7 | Record<string, unknown | OpenAPIObject>;
|
|
584
|
+
input: NormalizedInputOptions;
|
|
585
|
+
output: NormalizedOutputOptions;
|
|
586
|
+
target: string;
|
|
587
|
+
workspace: string;
|
|
596
588
|
};
|
|
597
589
|
interface ContextSpecs {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
590
|
+
specKey: string;
|
|
591
|
+
target: string;
|
|
592
|
+
workspace: string;
|
|
593
|
+
specs: Record<string, OpenAPIObject>;
|
|
594
|
+
parents?: string[];
|
|
595
|
+
output: NormalizedOutputOptions;
|
|
604
596
|
}
|
|
605
597
|
interface GlobalOptions {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
output?: string;
|
|
598
|
+
projectName?: string;
|
|
599
|
+
watch?: boolean | string | (string | boolean)[];
|
|
600
|
+
clean?: boolean | string[];
|
|
601
|
+
prettier?: boolean;
|
|
602
|
+
biome?: boolean;
|
|
603
|
+
mock?: boolean | GlobalMockOptions;
|
|
604
|
+
client?: OutputClient;
|
|
605
|
+
httpClient?: OutputHttpClient;
|
|
606
|
+
mode?: OutputMode;
|
|
607
|
+
tsconfig?: string | Tsconfig;
|
|
608
|
+
packageJson?: string;
|
|
609
|
+
input?: string;
|
|
610
|
+
output?: string;
|
|
620
611
|
}
|
|
621
612
|
interface Tsconfig {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
613
|
+
baseUrl?: string;
|
|
614
|
+
compilerOptions?: {
|
|
615
|
+
esModuleInterop?: boolean;
|
|
616
|
+
allowSyntheticDefaultImports?: boolean;
|
|
617
|
+
exactOptionalPropertyTypes?: boolean;
|
|
618
|
+
paths?: Record<string, string[]>;
|
|
619
|
+
target?: TsConfigTarget;
|
|
620
|
+
};
|
|
630
621
|
}
|
|
631
622
|
type TsConfigTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
|
|
632
623
|
interface PackageJson {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
624
|
+
dependencies?: Record<string, string>;
|
|
625
|
+
devDependencies?: Record<string, string>;
|
|
626
|
+
peerDependencies?: Record<string, string>;
|
|
636
627
|
}
|
|
637
628
|
type GeneratorSchema = {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
629
|
+
name: string;
|
|
630
|
+
model: string;
|
|
631
|
+
imports: GeneratorImport[];
|
|
641
632
|
};
|
|
642
633
|
type GeneratorImport = {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
634
|
+
name: string;
|
|
635
|
+
schemaName?: string;
|
|
636
|
+
isConstant?: boolean;
|
|
637
|
+
alias?: string;
|
|
638
|
+
specKey?: string;
|
|
639
|
+
default?: boolean;
|
|
640
|
+
values?: boolean;
|
|
641
|
+
syntheticDefaultImport?: boolean;
|
|
651
642
|
};
|
|
652
643
|
type GeneratorDependency = {
|
|
653
|
-
|
|
654
|
-
|
|
644
|
+
exports: GeneratorImport[];
|
|
645
|
+
dependency: string;
|
|
655
646
|
};
|
|
656
647
|
type GeneratorApiResponse = {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
};
|
|
660
|
-
type GeneratorOperations = {
|
|
661
|
-
[operationId: string]: GeneratorOperation;
|
|
648
|
+
operations: GeneratorOperations;
|
|
649
|
+
schemas: GeneratorSchema[];
|
|
662
650
|
};
|
|
651
|
+
type GeneratorOperations = Record<string, GeneratorOperation>;
|
|
663
652
|
type GeneratorTarget = {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
653
|
+
imports: GeneratorImport[];
|
|
654
|
+
implementation: string;
|
|
655
|
+
implementationMock: string;
|
|
656
|
+
importsMock: GeneratorImport[];
|
|
657
|
+
mutators?: GeneratorMutator[];
|
|
658
|
+
clientMutators?: GeneratorMutator[];
|
|
659
|
+
formData?: GeneratorMutator[];
|
|
660
|
+
formUrlEncoded?: GeneratorMutator[];
|
|
661
|
+
paramsSerializer?: GeneratorMutator[];
|
|
662
|
+
fetchReviver?: GeneratorMutator[];
|
|
674
663
|
};
|
|
675
664
|
type GeneratorTargetFull = {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
665
|
+
imports: GeneratorImport[];
|
|
666
|
+
implementation: string;
|
|
667
|
+
implementationMock: {
|
|
668
|
+
function: string;
|
|
669
|
+
handler: string;
|
|
670
|
+
handlerName: string;
|
|
671
|
+
};
|
|
672
|
+
importsMock: GeneratorImport[];
|
|
673
|
+
mutators?: GeneratorMutator[];
|
|
674
|
+
clientMutators?: GeneratorMutator[];
|
|
675
|
+
formData?: GeneratorMutator[];
|
|
676
|
+
formUrlEncoded?: GeneratorMutator[];
|
|
677
|
+
paramsSerializer?: GeneratorMutator[];
|
|
678
|
+
fetchReviver?: GeneratorMutator[];
|
|
690
679
|
};
|
|
691
680
|
type GeneratorOperation = {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
681
|
+
imports: GeneratorImport[];
|
|
682
|
+
implementation: string;
|
|
683
|
+
implementationMock: {
|
|
684
|
+
function: string;
|
|
685
|
+
handler: string;
|
|
686
|
+
handlerName: string;
|
|
687
|
+
};
|
|
688
|
+
importsMock: GeneratorImport[];
|
|
689
|
+
tags: string[];
|
|
690
|
+
mutator?: GeneratorMutator;
|
|
691
|
+
clientMutators?: GeneratorMutator[];
|
|
692
|
+
formData?: GeneratorMutator;
|
|
693
|
+
formUrlEncoded?: GeneratorMutator;
|
|
694
|
+
paramsSerializer?: GeneratorMutator;
|
|
695
|
+
fetchReviver?: GeneratorMutator;
|
|
696
|
+
operationName: string;
|
|
697
|
+
types?: {
|
|
698
|
+
result: (title?: string) => string;
|
|
699
|
+
};
|
|
711
700
|
};
|
|
712
701
|
type GeneratorVerbOptions = {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
702
|
+
verb: Verbs;
|
|
703
|
+
route: string;
|
|
704
|
+
pathRoute: string;
|
|
705
|
+
summary?: string;
|
|
706
|
+
doc: string;
|
|
707
|
+
tags: string[];
|
|
708
|
+
operationId: string;
|
|
709
|
+
operationName: string;
|
|
710
|
+
response: GetterResponse;
|
|
711
|
+
body: GetterBody;
|
|
712
|
+
headers?: GetterQueryParam;
|
|
713
|
+
queryParams?: GetterQueryParam;
|
|
714
|
+
params: GetterParams;
|
|
715
|
+
props: GetterProps;
|
|
716
|
+
mutator?: GeneratorMutator;
|
|
717
|
+
formData?: GeneratorMutator;
|
|
718
|
+
formUrlEncoded?: GeneratorMutator;
|
|
719
|
+
paramsSerializer?: GeneratorMutator;
|
|
720
|
+
fetchReviver?: GeneratorMutator;
|
|
721
|
+
override: NormalizedOverrideOutput;
|
|
722
|
+
deprecated?: boolean;
|
|
723
|
+
originalOperation: OperationObject;
|
|
735
724
|
};
|
|
736
725
|
type GeneratorVerbsOptions = GeneratorVerbOptions[];
|
|
737
726
|
type GeneratorOptions = {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
727
|
+
route: string;
|
|
728
|
+
pathRoute: string;
|
|
729
|
+
override: NormalizedOverrideOutput;
|
|
730
|
+
context: ContextSpecs;
|
|
731
|
+
mock?: GlobalMockOptions | ClientMockBuilder;
|
|
732
|
+
output: string;
|
|
744
733
|
};
|
|
745
734
|
type GeneratorClient = {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
735
|
+
implementation: string;
|
|
736
|
+
imports: GeneratorImport[];
|
|
737
|
+
mutators?: GeneratorMutator[];
|
|
749
738
|
};
|
|
750
739
|
type GeneratorMutatorParsingInfo = {
|
|
751
|
-
|
|
752
|
-
|
|
740
|
+
numberOfParams: number;
|
|
741
|
+
returnNumberOfParams?: number;
|
|
753
742
|
};
|
|
754
743
|
type GeneratorMutator = {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
744
|
+
name: string;
|
|
745
|
+
path: string;
|
|
746
|
+
default: boolean;
|
|
747
|
+
hasErrorType: boolean;
|
|
748
|
+
errorTypeName: string;
|
|
749
|
+
hasSecondArg: boolean;
|
|
750
|
+
hasThirdArg: boolean;
|
|
751
|
+
isHook: boolean;
|
|
752
|
+
bodyTypeName?: string;
|
|
764
753
|
};
|
|
765
754
|
type ClientBuilder = (verbOptions: GeneratorVerbOptions, options: GeneratorOptions, outputClient: OutputClient | OutputClientFunc, output?: NormalizedOutputOptions) => GeneratorClient | Promise<GeneratorClient>;
|
|
766
755
|
type ClientFileBuilder = {
|
|
767
|
-
|
|
768
|
-
|
|
756
|
+
path: string;
|
|
757
|
+
content: string;
|
|
769
758
|
};
|
|
770
759
|
type ClientExtraFilesBuilder = (verbOptions: Record<string, GeneratorVerbOptions>, output: NormalizedOutputOptions, context: ContextSpecs) => Promise<ClientFileBuilder[]>;
|
|
771
760
|
type ClientHeaderBuilder = (params: {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
761
|
+
title: string;
|
|
762
|
+
isRequestOptions: boolean;
|
|
763
|
+
isMutator: boolean;
|
|
764
|
+
noFunction?: boolean;
|
|
765
|
+
isGlobalMutator: boolean;
|
|
766
|
+
provideIn: boolean | 'root' | 'any';
|
|
767
|
+
hasAwaitedType: boolean;
|
|
768
|
+
output: NormalizedOutputOptions;
|
|
769
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
770
|
+
tag?: string;
|
|
771
|
+
clientImplementation: string;
|
|
783
772
|
}) => string;
|
|
784
773
|
type ClientFooterBuilder = (params: {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
774
|
+
noFunction?: boolean | undefined;
|
|
775
|
+
operationNames: string[];
|
|
776
|
+
title?: string;
|
|
777
|
+
hasAwaitedType: boolean;
|
|
778
|
+
hasMutator: boolean;
|
|
790
779
|
}) => string;
|
|
791
780
|
type ClientTitleBuilder = (title: string) => string;
|
|
792
781
|
type ClientDependenciesBuilder = (hasGlobalMutator: boolean, hasParamsSerializerOptions: boolean, packageJson?: PackageJson, httpClient?: OutputHttpClient, hasTagsMutator?: boolean, override?: NormalizedOverrideOutput) => GeneratorDependency[];
|
|
793
782
|
type ClientMockGeneratorImplementation = {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
783
|
+
function: string;
|
|
784
|
+
handlerName: string;
|
|
785
|
+
handler: string;
|
|
797
786
|
};
|
|
798
787
|
type ClientMockGeneratorBuilder = {
|
|
799
|
-
|
|
800
|
-
|
|
788
|
+
imports: GeneratorImport[];
|
|
789
|
+
implementation: ClientMockGeneratorImplementation;
|
|
801
790
|
};
|
|
802
791
|
type ClientMockBuilder = (verbOptions: GeneratorVerbOptions, generatorOptions: GeneratorOptions) => ClientMockGeneratorBuilder;
|
|
803
792
|
interface ClientGeneratorsBuilder {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
793
|
+
client: ClientBuilder;
|
|
794
|
+
header?: ClientHeaderBuilder;
|
|
795
|
+
dependencies?: ClientDependenciesBuilder;
|
|
796
|
+
footer?: ClientFooterBuilder;
|
|
797
|
+
title?: ClientTitleBuilder;
|
|
798
|
+
extraFiles?: ClientExtraFilesBuilder;
|
|
810
799
|
}
|
|
811
800
|
type GeneratorClients = Record<OutputClient, ClientGeneratorsBuilder>;
|
|
812
801
|
type GetterResponse = {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
802
|
+
imports: GeneratorImport[];
|
|
803
|
+
definition: {
|
|
804
|
+
success: string;
|
|
805
|
+
errors: string;
|
|
806
|
+
};
|
|
807
|
+
isBlob: boolean;
|
|
808
|
+
types: {
|
|
809
|
+
success: ResReqTypesValue[];
|
|
810
|
+
errors: ResReqTypesValue[];
|
|
811
|
+
};
|
|
812
|
+
contentTypes: string[];
|
|
813
|
+
schemas: GeneratorSchema[];
|
|
814
|
+
originalSchema?: ResponsesObject;
|
|
826
815
|
};
|
|
827
816
|
type GetterBody = {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
817
|
+
originalSchema: ReferenceObject | RequestBodyObject;
|
|
818
|
+
imports: GeneratorImport[];
|
|
819
|
+
definition: string;
|
|
820
|
+
implementation: string;
|
|
821
|
+
schemas: GeneratorSchema[];
|
|
822
|
+
formData?: string;
|
|
823
|
+
formUrlEncoded?: string;
|
|
824
|
+
contentType: string;
|
|
825
|
+
isOptional: boolean;
|
|
837
826
|
};
|
|
838
827
|
type GetterParameters = {
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
828
|
+
query: {
|
|
829
|
+
parameter: ParameterObject;
|
|
830
|
+
imports: GeneratorImport[];
|
|
831
|
+
}[];
|
|
832
|
+
path: {
|
|
833
|
+
parameter: ParameterObject;
|
|
834
|
+
imports: GeneratorImport[];
|
|
835
|
+
}[];
|
|
836
|
+
header: {
|
|
837
|
+
parameter: ParameterObject;
|
|
838
|
+
imports: GeneratorImport[];
|
|
839
|
+
}[];
|
|
851
840
|
};
|
|
852
841
|
type GetterParam = {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
842
|
+
name: string;
|
|
843
|
+
definition: string;
|
|
844
|
+
implementation: string;
|
|
845
|
+
default: boolean;
|
|
846
|
+
required: boolean;
|
|
847
|
+
imports: GeneratorImport[];
|
|
859
848
|
};
|
|
860
849
|
type GetterParams = GetterParam[];
|
|
861
850
|
type GetterQueryParam = {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
851
|
+
schema: GeneratorSchema;
|
|
852
|
+
deps: GeneratorSchema[];
|
|
853
|
+
isOptional: boolean;
|
|
854
|
+
originalSchema?: SchemaObject;
|
|
866
855
|
};
|
|
867
856
|
type GetterPropType = 'param' | 'body' | 'queryParam' | 'header' | 'namedPathParams';
|
|
868
857
|
declare const GetterPropType: {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
858
|
+
readonly PARAM: "param";
|
|
859
|
+
readonly NAMED_PATH_PARAMS: "namedPathParams";
|
|
860
|
+
readonly BODY: "body";
|
|
861
|
+
readonly QUERY_PARAM: "queryParam";
|
|
862
|
+
readonly HEADER: "header";
|
|
874
863
|
};
|
|
875
864
|
type GetterPropBase = {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
865
|
+
name: string;
|
|
866
|
+
definition: string;
|
|
867
|
+
implementation: string;
|
|
868
|
+
default: boolean;
|
|
869
|
+
required: boolean;
|
|
881
870
|
};
|
|
882
871
|
type GetterProp = GetterPropBase & ({
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
872
|
+
type: 'namedPathParams';
|
|
873
|
+
destructured: string;
|
|
874
|
+
schema: GeneratorSchema;
|
|
886
875
|
} | {
|
|
887
|
-
|
|
876
|
+
type: Exclude<GetterPropType, 'namedPathParams'>;
|
|
888
877
|
});
|
|
889
878
|
type GetterProps = GetterProp[];
|
|
890
879
|
type SchemaType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array' | 'enum' | 'unknown';
|
|
891
880
|
declare const SchemaType: {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
881
|
+
integer: string;
|
|
882
|
+
number: string;
|
|
883
|
+
string: string;
|
|
884
|
+
boolean: string;
|
|
885
|
+
object: string;
|
|
886
|
+
null: string;
|
|
887
|
+
array: string;
|
|
888
|
+
enum: string;
|
|
889
|
+
unknown: string;
|
|
901
890
|
};
|
|
902
891
|
type ScalarValue = {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
892
|
+
value: string;
|
|
893
|
+
isEnum: boolean;
|
|
894
|
+
hasReadonlyProps: boolean;
|
|
895
|
+
type: SchemaType;
|
|
896
|
+
imports: GeneratorImport[];
|
|
897
|
+
schemas: GeneratorSchema[];
|
|
898
|
+
isRef: boolean;
|
|
899
|
+
example?: any;
|
|
900
|
+
examples?: Record<string, any>;
|
|
912
901
|
};
|
|
913
902
|
type ResolverValue = ScalarValue & {
|
|
914
|
-
|
|
903
|
+
originalSchema: SchemaObject;
|
|
915
904
|
};
|
|
916
905
|
type ResReqTypesValue = ScalarValue & {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
906
|
+
formData?: string;
|
|
907
|
+
formUrlEncoded?: string;
|
|
908
|
+
isRef?: boolean;
|
|
909
|
+
hasReadonlyProps?: boolean;
|
|
910
|
+
key: string;
|
|
911
|
+
contentType: string;
|
|
912
|
+
originalSchema?: SchemaObject;
|
|
924
913
|
};
|
|
925
914
|
type WriteSpecsBuilder = {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
915
|
+
operations: GeneratorOperations;
|
|
916
|
+
schemas: Record<string, GeneratorSchema[]>;
|
|
917
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
918
|
+
title: GeneratorClientTitle;
|
|
919
|
+
header: GeneratorClientHeader;
|
|
920
|
+
footer: GeneratorClientFooter;
|
|
921
|
+
imports: GeneratorClientImports;
|
|
922
|
+
importsMock: GenerateMockImports;
|
|
923
|
+
extraFiles: ClientFileBuilder[];
|
|
924
|
+
info: InfoObject;
|
|
925
|
+
target: string;
|
|
937
926
|
};
|
|
938
927
|
type WriteModeProps = {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
928
|
+
builder: WriteSpecsBuilder;
|
|
929
|
+
output: NormalizedOutputOptions;
|
|
930
|
+
workspace: string;
|
|
931
|
+
specsName: Record<string, string>;
|
|
932
|
+
header: string;
|
|
933
|
+
needSchema: boolean;
|
|
945
934
|
};
|
|
946
935
|
type GeneratorApiOperations = {
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
936
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
937
|
+
operations: GeneratorOperations;
|
|
938
|
+
schemas: GeneratorSchema[];
|
|
950
939
|
};
|
|
951
940
|
type GeneratorClientExtra = {
|
|
952
|
-
|
|
953
|
-
|
|
941
|
+
implementation: string;
|
|
942
|
+
implementationMock: string;
|
|
954
943
|
};
|
|
955
944
|
type GeneratorClientTitle = (data: {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
945
|
+
outputClient?: OutputClient | OutputClientFunc;
|
|
946
|
+
title: string;
|
|
947
|
+
customTitleFunc?: (title: string) => string;
|
|
948
|
+
output: NormalizedOutputOptions;
|
|
960
949
|
}) => GeneratorClientExtra;
|
|
961
950
|
type GeneratorClientHeader = (data: {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
951
|
+
outputClient?: OutputClient | OutputClientFunc;
|
|
952
|
+
isRequestOptions: boolean;
|
|
953
|
+
isMutator: boolean;
|
|
954
|
+
isGlobalMutator: boolean;
|
|
955
|
+
provideIn: boolean | 'root' | 'any';
|
|
956
|
+
hasAwaitedType: boolean;
|
|
957
|
+
titles: GeneratorClientExtra;
|
|
958
|
+
output: NormalizedOutputOptions;
|
|
959
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
960
|
+
tag?: string;
|
|
961
|
+
clientImplementation: string;
|
|
973
962
|
}) => GeneratorClientExtra;
|
|
974
963
|
type GeneratorClientFooter = (data: {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
964
|
+
outputClient: OutputClient | OutputClientFunc;
|
|
965
|
+
operationNames: string[];
|
|
966
|
+
hasMutator: boolean;
|
|
967
|
+
hasAwaitedType: boolean;
|
|
968
|
+
titles: GeneratorClientExtra;
|
|
969
|
+
output: NormalizedOutputOptions;
|
|
981
970
|
}) => GeneratorClientExtra;
|
|
982
971
|
type GeneratorClientImports = (data: {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
972
|
+
client: OutputClient | OutputClientFunc;
|
|
973
|
+
implementation: string;
|
|
974
|
+
imports: {
|
|
975
|
+
exports: GeneratorImport[];
|
|
976
|
+
dependency: string;
|
|
977
|
+
}[];
|
|
978
|
+
specsName: Record<string, string>;
|
|
979
|
+
hasSchemaDir: boolean;
|
|
980
|
+
isAllowSyntheticDefaultImports: boolean;
|
|
981
|
+
hasGlobalMutator: boolean;
|
|
982
|
+
hasTagsMutator: boolean;
|
|
983
|
+
hasParamsSerializerOptions: boolean;
|
|
984
|
+
packageJson?: PackageJson;
|
|
985
|
+
output: NormalizedOutputOptions;
|
|
997
986
|
}) => string;
|
|
998
987
|
type GenerateMockImports = (data: {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
988
|
+
implementation: string;
|
|
989
|
+
imports: {
|
|
990
|
+
exports: GeneratorImport[];
|
|
991
|
+
dependency: string;
|
|
992
|
+
}[];
|
|
993
|
+
specsName: Record<string, string>;
|
|
994
|
+
hasSchemaDir: boolean;
|
|
995
|
+
isAllowSyntheticDefaultImports: boolean;
|
|
996
|
+
options?: GlobalMockOptions;
|
|
1008
997
|
}) => string;
|
|
1009
998
|
type GeneratorApiBuilder = GeneratorApiOperations & {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
999
|
+
title: GeneratorClientTitle;
|
|
1000
|
+
header: GeneratorClientHeader;
|
|
1001
|
+
footer: GeneratorClientFooter;
|
|
1002
|
+
imports: GeneratorClientImports;
|
|
1003
|
+
importsMock: GenerateMockImports;
|
|
1004
|
+
extraFiles: ClientFileBuilder[];
|
|
1016
1005
|
};
|
|
1017
1006
|
interface SchemaWithConst extends SchemaObject {
|
|
1018
|
-
|
|
1007
|
+
const: string;
|
|
1019
1008
|
}
|
|
1020
|
-
|
|
1009
|
+
declare class ErrorWithTag extends Error {
|
|
1010
|
+
tag: string;
|
|
1011
|
+
constructor(message: string, tag: string, options?: ErrorOptions);
|
|
1012
|
+
}
|
|
1013
|
+
//#endregion
|
|
1014
|
+
//#region src/constants.d.ts
|
|
1021
1015
|
declare const generalJSTypes: string[];
|
|
1022
1016
|
declare const generalJSTypesWithArray: string[];
|
|
1023
1017
|
declare const VERBS_WITH_BODY: Verbs[];
|
|
1024
1018
|
declare const URL_REGEX: RegExp;
|
|
1025
1019
|
declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
1026
|
-
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region src/generators/component-definition.d.ts
|
|
1027
1022
|
declare const generateComponentDefinition: (responses: ComponentsObject["responses"] | ComponentsObject["requestBodies"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1023
|
+
//#endregion
|
|
1024
|
+
//#region src/generators/imports.d.ts
|
|
1025
|
+
declare const generateImports: ({
|
|
1026
|
+
imports,
|
|
1027
|
+
target,
|
|
1028
|
+
isRootKey,
|
|
1029
|
+
specsName,
|
|
1030
|
+
specKey: currentSpecKey,
|
|
1031
|
+
namingConvention
|
|
1032
|
+
}: {
|
|
1033
|
+
imports: GeneratorImport[];
|
|
1034
|
+
target: string;
|
|
1035
|
+
isRootKey: boolean;
|
|
1036
|
+
specsName: Record<string, string>;
|
|
1037
|
+
specKey: string;
|
|
1038
|
+
namingConvention?: NamingConvention;
|
|
1036
1039
|
}) => string;
|
|
1037
|
-
declare const generateMutatorImports: ({
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1040
|
+
declare const generateMutatorImports: ({
|
|
1041
|
+
mutators,
|
|
1042
|
+
implementation,
|
|
1043
|
+
oneMore
|
|
1044
|
+
}: {
|
|
1045
|
+
mutators: GeneratorMutator[];
|
|
1046
|
+
implementation?: string;
|
|
1047
|
+
oneMore?: boolean;
|
|
1041
1048
|
}) => string;
|
|
1042
|
-
declare const addDependency: ({
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
+
declare const addDependency: ({
|
|
1050
|
+
implementation,
|
|
1051
|
+
exports,
|
|
1052
|
+
dependency,
|
|
1053
|
+
specsName,
|
|
1054
|
+
hasSchemaDir,
|
|
1055
|
+
isAllowSyntheticDefaultImports
|
|
1056
|
+
}: {
|
|
1057
|
+
implementation: string;
|
|
1058
|
+
exports: GeneratorImport[];
|
|
1059
|
+
dependency: string;
|
|
1060
|
+
specsName: Record<string, string>;
|
|
1061
|
+
hasSchemaDir: boolean;
|
|
1062
|
+
isAllowSyntheticDefaultImports: boolean;
|
|
1049
1063
|
}) => string | undefined;
|
|
1050
1064
|
declare const generateDependencyImports: (implementation: string, imports: {
|
|
1051
|
-
|
|
1052
|
-
|
|
1065
|
+
exports: GeneratorImport[];
|
|
1066
|
+
dependency: string;
|
|
1053
1067
|
}[], specsName: Record<string, string>, hasSchemaDir: boolean, isAllowSyntheticDefaultImports: boolean) => string;
|
|
1054
|
-
declare const generateVerbImports: ({
|
|
1055
|
-
|
|
1068
|
+
declare const generateVerbImports: ({
|
|
1069
|
+
response,
|
|
1070
|
+
body,
|
|
1071
|
+
queryParams,
|
|
1072
|
+
props,
|
|
1073
|
+
headers,
|
|
1074
|
+
params
|
|
1075
|
+
}: GeneratorVerbOptions) => GeneratorImport[];
|
|
1076
|
+
//#endregion
|
|
1077
|
+
//#region src/generators/models-inline.d.ts
|
|
1056
1078
|
declare const generateModelInline: (acc: string, model: string) => string;
|
|
1057
1079
|
declare const generateModelsInline: (obj: Record<string, GeneratorSchema[]>) => string;
|
|
1058
|
-
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region src/generators/mutator.d.ts
|
|
1059
1082
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
1060
|
-
declare const generateMutator: ({
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1083
|
+
declare const generateMutator: ({
|
|
1084
|
+
output,
|
|
1085
|
+
mutator,
|
|
1086
|
+
name,
|
|
1087
|
+
workspace,
|
|
1088
|
+
tsconfig
|
|
1089
|
+
}: {
|
|
1090
|
+
output?: string;
|
|
1091
|
+
mutator?: NormalizedMutator;
|
|
1092
|
+
name: string;
|
|
1093
|
+
workspace: string;
|
|
1094
|
+
tsconfig?: Tsconfig;
|
|
1066
1095
|
}) => Promise<GeneratorMutator | undefined>;
|
|
1067
|
-
|
|
1096
|
+
//#endregion
|
|
1097
|
+
//#region src/generators/options.d.ts
|
|
1068
1098
|
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1069
|
-
declare const generateAxiosOptions: ({
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1099
|
+
declare const generateAxiosOptions: ({
|
|
1100
|
+
response,
|
|
1101
|
+
isExactOptionalPropertyTypes,
|
|
1102
|
+
queryParams,
|
|
1103
|
+
headers,
|
|
1104
|
+
requestOptions,
|
|
1105
|
+
hasSignal,
|
|
1106
|
+
isVue,
|
|
1107
|
+
isAngular,
|
|
1108
|
+
paramsSerializer,
|
|
1109
|
+
paramsSerializerOptions
|
|
1110
|
+
}: {
|
|
1111
|
+
response: GetterResponse;
|
|
1112
|
+
isExactOptionalPropertyTypes: boolean;
|
|
1113
|
+
queryParams?: GeneratorSchema;
|
|
1114
|
+
headers?: GeneratorSchema;
|
|
1115
|
+
requestOptions?: object | boolean;
|
|
1116
|
+
hasSignal: boolean;
|
|
1117
|
+
isVue: boolean;
|
|
1118
|
+
isAngular: boolean;
|
|
1119
|
+
paramsSerializer?: GeneratorMutator;
|
|
1120
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1079
1121
|
}) => string;
|
|
1080
|
-
declare const generateOptions: ({
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1122
|
+
declare const generateOptions: ({
|
|
1123
|
+
route,
|
|
1124
|
+
body,
|
|
1125
|
+
headers,
|
|
1126
|
+
queryParams,
|
|
1127
|
+
response,
|
|
1128
|
+
verb,
|
|
1129
|
+
requestOptions,
|
|
1130
|
+
isFormData,
|
|
1131
|
+
isFormUrlEncoded,
|
|
1132
|
+
isAngular,
|
|
1133
|
+
isExactOptionalPropertyTypes,
|
|
1134
|
+
hasSignal,
|
|
1135
|
+
isVue,
|
|
1136
|
+
paramsSerializer,
|
|
1137
|
+
paramsSerializerOptions
|
|
1138
|
+
}: {
|
|
1139
|
+
route: string;
|
|
1140
|
+
body: GetterBody;
|
|
1141
|
+
headers?: GetterQueryParam;
|
|
1142
|
+
queryParams?: GetterQueryParam;
|
|
1143
|
+
response: GetterResponse;
|
|
1144
|
+
verb: Verbs;
|
|
1145
|
+
requestOptions?: object | boolean;
|
|
1146
|
+
isFormData: boolean;
|
|
1147
|
+
isFormUrlEncoded: boolean;
|
|
1148
|
+
isAngular?: boolean;
|
|
1149
|
+
isExactOptionalPropertyTypes: boolean;
|
|
1150
|
+
hasSignal: boolean;
|
|
1151
|
+
isVue?: boolean;
|
|
1152
|
+
paramsSerializer?: GeneratorMutator;
|
|
1153
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1096
1154
|
}) => string;
|
|
1097
1155
|
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1098
1156
|
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, isVue: boolean, queryParams?: GetterQueryParam) => string;
|
|
1099
|
-
declare const generateMutatorConfig: ({
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1157
|
+
declare const generateMutatorConfig: ({
|
|
1158
|
+
route,
|
|
1159
|
+
body,
|
|
1160
|
+
headers,
|
|
1161
|
+
queryParams,
|
|
1162
|
+
response,
|
|
1163
|
+
verb,
|
|
1164
|
+
isFormData,
|
|
1165
|
+
isFormUrlEncoded,
|
|
1166
|
+
hasSignal,
|
|
1167
|
+
isExactOptionalPropertyTypes,
|
|
1168
|
+
isVue
|
|
1169
|
+
}: {
|
|
1170
|
+
route: string;
|
|
1171
|
+
body: GetterBody;
|
|
1172
|
+
headers?: GetterQueryParam;
|
|
1173
|
+
queryParams?: GetterQueryParam;
|
|
1174
|
+
response: GetterResponse;
|
|
1175
|
+
verb: Verbs;
|
|
1176
|
+
isFormData: boolean;
|
|
1177
|
+
isFormUrlEncoded: boolean;
|
|
1178
|
+
hasSignal: boolean;
|
|
1179
|
+
isExactOptionalPropertyTypes: boolean;
|
|
1180
|
+
isVue?: boolean;
|
|
1111
1181
|
}) => string;
|
|
1112
1182
|
declare const generateMutatorRequestOptions: (requestOptions: boolean | object | undefined, hasSecondArgument: boolean) => string;
|
|
1113
|
-
declare const generateFormDataAndUrlEncodedFunction: ({
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1183
|
+
declare const generateFormDataAndUrlEncodedFunction: ({
|
|
1184
|
+
body,
|
|
1185
|
+
formData,
|
|
1186
|
+
formUrlEncoded,
|
|
1187
|
+
isFormData,
|
|
1188
|
+
isFormUrlEncoded
|
|
1189
|
+
}: {
|
|
1190
|
+
body: GetterBody;
|
|
1191
|
+
formData?: GeneratorMutator;
|
|
1192
|
+
formUrlEncoded?: GeneratorMutator;
|
|
1193
|
+
isFormData: boolean;
|
|
1194
|
+
isFormUrlEncoded: boolean;
|
|
1119
1195
|
}) => string;
|
|
1120
|
-
|
|
1196
|
+
//#endregion
|
|
1197
|
+
//#region src/generators/parameter-definition.d.ts
|
|
1121
1198
|
declare const generateParameterDefinition: (parameters: ComponentsObject["parameters"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
1122
|
-
|
|
1199
|
+
//#endregion
|
|
1200
|
+
//#region src/generators/schema-definition.d.ts
|
|
1123
1201
|
/**
|
|
1124
1202
|
* Extract all types from #/components/schemas
|
|
1125
1203
|
*
|
|
1126
1204
|
* @param schemas
|
|
1127
1205
|
*/
|
|
1128
1206
|
declare const generateSchemasDefinition: (schemas: SchemasObject | undefined, context: ContextSpecs, suffix: string, filters?: InputFiltersOption) => GeneratorSchema[];
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1207
|
+
//#endregion
|
|
1208
|
+
//#region src/generators/verbs-options.d.ts
|
|
1209
|
+
declare const generateVerbsOptions: ({
|
|
1210
|
+
verbs,
|
|
1211
|
+
input,
|
|
1212
|
+
output,
|
|
1213
|
+
route,
|
|
1214
|
+
pathRoute,
|
|
1215
|
+
context
|
|
1216
|
+
}: {
|
|
1217
|
+
verbs: PathItemObject;
|
|
1218
|
+
input: NormalizedInputOptions;
|
|
1219
|
+
output: NormalizedOutputOptions;
|
|
1220
|
+
route: string;
|
|
1221
|
+
pathRoute: string;
|
|
1222
|
+
context: ContextSpecs;
|
|
1137
1223
|
}) => Promise<GeneratorVerbsOptions>;
|
|
1138
1224
|
declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOptions["filters"]) => [string, any][];
|
|
1139
|
-
|
|
1225
|
+
//#endregion
|
|
1226
|
+
//#region src/getters/array.d.ts
|
|
1140
1227
|
/**
|
|
1141
1228
|
* Return the output type from an array
|
|
1142
1229
|
*
|
|
1143
1230
|
* @param item item with type === "array"
|
|
1144
1231
|
*/
|
|
1145
|
-
declare const getArray: ({
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1232
|
+
declare const getArray: ({
|
|
1233
|
+
schema,
|
|
1234
|
+
name,
|
|
1235
|
+
context
|
|
1236
|
+
}: {
|
|
1237
|
+
schema: SchemaObject;
|
|
1238
|
+
name?: string;
|
|
1239
|
+
context: ContextSpecs;
|
|
1149
1240
|
}) => ScalarValue;
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region src/getters/body.d.ts
|
|
1243
|
+
declare const getBody: ({
|
|
1244
|
+
requestBody,
|
|
1245
|
+
operationName,
|
|
1246
|
+
context,
|
|
1247
|
+
contentType
|
|
1248
|
+
}: {
|
|
1249
|
+
requestBody: ReferenceObject | RequestBodyObject;
|
|
1250
|
+
operationName: string;
|
|
1251
|
+
context: ContextSpecs;
|
|
1252
|
+
contentType?: OverrideOutputContentType;
|
|
1156
1253
|
}) => GetterBody;
|
|
1157
|
-
|
|
1254
|
+
//#endregion
|
|
1255
|
+
//#region src/getters/combine.d.ts
|
|
1158
1256
|
type Separator = 'allOf' | 'anyOf' | 'oneOf';
|
|
1159
|
-
declare const combineSchemas: ({
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1257
|
+
declare const combineSchemas: ({
|
|
1258
|
+
name,
|
|
1259
|
+
schema,
|
|
1260
|
+
separator,
|
|
1261
|
+
context,
|
|
1262
|
+
nullable
|
|
1263
|
+
}: {
|
|
1264
|
+
name?: string;
|
|
1265
|
+
schema: SchemaObject;
|
|
1266
|
+
separator: Separator;
|
|
1267
|
+
context: ContextSpecs;
|
|
1268
|
+
nullable: string;
|
|
1165
1269
|
}) => ScalarValue;
|
|
1166
|
-
|
|
1270
|
+
//#endregion
|
|
1271
|
+
//#region src/getters/discriminators.d.ts
|
|
1167
1272
|
declare const resolveDiscriminators: (schemas: SchemasObject, context: ContextSpecs) => SchemasObject;
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
declare const
|
|
1273
|
+
//#endregion
|
|
1274
|
+
//#region src/getters/enum.d.ts
|
|
1275
|
+
declare const getEnumNames: (schemaObject: SchemaObject | undefined) => any;
|
|
1276
|
+
declare const getEnumDescriptions: (schemaObject: SchemaObject | undefined) => any;
|
|
1171
1277
|
declare const getEnum: (value: string, enumName: string, names: string[] | undefined, enumGenerationType: EnumGeneration, descriptions?: string[], enumNamingConvention?: NamingConvention) => string;
|
|
1172
1278
|
declare const getEnumImplementation: (value: string, names?: string[], descriptions?: string[], enumNamingConvention?: NamingConvention) => string;
|
|
1173
|
-
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region src/getters/keys.d.ts
|
|
1174
1281
|
declare const getKey: (key: string) => string;
|
|
1175
|
-
|
|
1282
|
+
//#endregion
|
|
1283
|
+
//#region src/getters/object.d.ts
|
|
1176
1284
|
/**
|
|
1177
1285
|
* Return the output type from an object
|
|
1178
1286
|
*
|
|
1179
1287
|
* @param item item with type === "object"
|
|
1180
1288
|
*/
|
|
1181
|
-
declare const getObject: ({
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1289
|
+
declare const getObject: ({
|
|
1290
|
+
item,
|
|
1291
|
+
name,
|
|
1292
|
+
context,
|
|
1293
|
+
nullable
|
|
1294
|
+
}: {
|
|
1295
|
+
item: SchemaObject;
|
|
1296
|
+
name?: string;
|
|
1297
|
+
context: ContextSpecs;
|
|
1298
|
+
nullable: string;
|
|
1186
1299
|
}) => ScalarValue;
|
|
1187
|
-
|
|
1300
|
+
//#endregion
|
|
1301
|
+
//#region src/getters/operation.d.ts
|
|
1188
1302
|
declare const getOperationId: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region src/getters/parameters.d.ts
|
|
1305
|
+
declare const getParameters: ({
|
|
1306
|
+
parameters,
|
|
1307
|
+
context
|
|
1308
|
+
}: {
|
|
1309
|
+
parameters: (ReferenceObject | ParameterObject)[];
|
|
1310
|
+
context: ContextSpecs;
|
|
1193
1311
|
}) => GetterParameters;
|
|
1194
|
-
|
|
1312
|
+
//#endregion
|
|
1313
|
+
//#region src/getters/params.d.ts
|
|
1195
1314
|
/**
|
|
1196
1315
|
* Return every params in a path
|
|
1197
1316
|
*
|
|
@@ -1203,43 +1322,64 @@ declare const getParameters: ({ parameters, context, }: {
|
|
|
1203
1322
|
* @param path
|
|
1204
1323
|
*/
|
|
1205
1324
|
declare const getParamsInPath: (path: string) => string[];
|
|
1206
|
-
declare const getParams: ({
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1325
|
+
declare const getParams: ({
|
|
1326
|
+
route,
|
|
1327
|
+
pathParams,
|
|
1328
|
+
operationId,
|
|
1329
|
+
context,
|
|
1330
|
+
output
|
|
1331
|
+
}: {
|
|
1332
|
+
route: string;
|
|
1333
|
+
pathParams?: GetterParameters["query"];
|
|
1334
|
+
operationId: string;
|
|
1335
|
+
context: ContextSpecs;
|
|
1336
|
+
output: NormalizedOutputOptions;
|
|
1212
1337
|
}) => GetterParams;
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1338
|
+
//#endregion
|
|
1339
|
+
//#region src/getters/props.d.ts
|
|
1340
|
+
declare const getProps: ({
|
|
1341
|
+
body,
|
|
1342
|
+
queryParams,
|
|
1343
|
+
params,
|
|
1344
|
+
operationName,
|
|
1345
|
+
headers,
|
|
1346
|
+
context
|
|
1347
|
+
}: {
|
|
1348
|
+
body: GetterBody;
|
|
1349
|
+
queryParams?: GetterQueryParam;
|
|
1350
|
+
params: GetterParams;
|
|
1351
|
+
operationName: string;
|
|
1352
|
+
headers?: GetterQueryParam;
|
|
1353
|
+
context: ContextSpecs;
|
|
1221
1354
|
}) => GetterProps;
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region src/getters/query-params.d.ts
|
|
1357
|
+
declare const getQueryParams: ({
|
|
1358
|
+
queryParams,
|
|
1359
|
+
operationName,
|
|
1360
|
+
context,
|
|
1361
|
+
suffix
|
|
1362
|
+
}: {
|
|
1363
|
+
queryParams: GetterParameters["query"];
|
|
1364
|
+
operationName: string;
|
|
1365
|
+
context: ContextSpecs;
|
|
1366
|
+
suffix?: string;
|
|
1228
1367
|
}) => GetterQueryParam | undefined;
|
|
1229
|
-
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/getters/ref.d.ts
|
|
1230
1370
|
type RefComponent = 'schemas' | 'responses' | 'parameters' | 'requestBodies';
|
|
1231
1371
|
declare const RefComponent: {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1372
|
+
schemas: RefComponent;
|
|
1373
|
+
responses: RefComponent;
|
|
1374
|
+
parameters: RefComponent;
|
|
1375
|
+
requestBodies: RefComponent;
|
|
1236
1376
|
};
|
|
1237
1377
|
declare const RefComponentSuffix: Record<RefComponent, string>;
|
|
1238
1378
|
interface RefInfo {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1379
|
+
name: string;
|
|
1380
|
+
originalName: string;
|
|
1381
|
+
refPaths?: string[];
|
|
1382
|
+
specKey?: string;
|
|
1243
1383
|
}
|
|
1244
1384
|
/**
|
|
1245
1385
|
* Return the output type from the $ref
|
|
@@ -1247,54 +1387,80 @@ interface RefInfo {
|
|
|
1247
1387
|
* @param $ref
|
|
1248
1388
|
*/
|
|
1249
1389
|
declare const getRefInfo: ($ref: ReferenceObject["$ref"], context: ContextSpecs) => RefInfo;
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1390
|
+
//#endregion
|
|
1391
|
+
//#region src/getters/res-req-types.d.ts
|
|
1392
|
+
declare const getResReqTypes: (responsesOrRequests: [string, ResponseObject | ReferenceObject | RequestBodyObject][], name: string, context: ContextSpecs, defaultType?: string, uniqueKey?: ValueIteratee<ResReqTypesValue>) => ResReqTypesValue[];
|
|
1393
|
+
//#endregion
|
|
1394
|
+
//#region src/getters/response.d.ts
|
|
1395
|
+
declare const getResponse: ({
|
|
1396
|
+
responses,
|
|
1397
|
+
operationName,
|
|
1398
|
+
context,
|
|
1399
|
+
contentType
|
|
1400
|
+
}: {
|
|
1401
|
+
responses: ResponsesObject;
|
|
1402
|
+
operationName: string;
|
|
1403
|
+
context: ContextSpecs;
|
|
1404
|
+
contentType?: OverrideOutputContentType;
|
|
1258
1405
|
}) => GetterResponse;
|
|
1259
|
-
|
|
1406
|
+
//#endregion
|
|
1407
|
+
//#region src/getters/route.d.ts
|
|
1260
1408
|
declare const getRoute: (route: string) => string;
|
|
1261
1409
|
declare const getFullRoute: (route: string, servers: ServerObject[] | undefined, baseUrl: string | BaseUrlFromConstant | BaseUrlFromSpec | undefined) => string;
|
|
1262
1410
|
declare const getRouteAsArray: (route: string) => string;
|
|
1263
|
-
|
|
1411
|
+
//#endregion
|
|
1412
|
+
//#region src/getters/scalar.d.ts
|
|
1264
1413
|
/**
|
|
1265
1414
|
* Return the typescript equivalent of open-api data type
|
|
1266
1415
|
*
|
|
1267
1416
|
* @param item
|
|
1268
1417
|
* @ref https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#data-types
|
|
1269
1418
|
*/
|
|
1270
|
-
declare const getScalar: ({
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1419
|
+
declare const getScalar: ({
|
|
1420
|
+
item,
|
|
1421
|
+
name,
|
|
1422
|
+
context
|
|
1423
|
+
}: {
|
|
1424
|
+
item: SchemaObject;
|
|
1425
|
+
name?: string;
|
|
1426
|
+
context: ContextSpecs;
|
|
1274
1427
|
}) => ScalarValue;
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/resolvers/object.d.ts
|
|
1430
|
+
declare const resolveObject: ({
|
|
1431
|
+
schema,
|
|
1432
|
+
propName,
|
|
1433
|
+
combined,
|
|
1434
|
+
context
|
|
1435
|
+
}: {
|
|
1436
|
+
schema: SchemaObject | ReferenceObject;
|
|
1437
|
+
propName?: string;
|
|
1438
|
+
combined?: boolean;
|
|
1439
|
+
context: ContextSpecs;
|
|
1281
1440
|
}) => ResolverValue;
|
|
1282
|
-
|
|
1441
|
+
//#endregion
|
|
1442
|
+
//#region src/resolvers/ref.d.ts
|
|
1283
1443
|
type ComponentObject = SchemaObject | ResponseObject | ParameterObject | RequestBodyObject | ReferenceObject;
|
|
1284
1444
|
declare const resolveRef: <Schema extends ComponentObject = ComponentObject>(schema: ComponentObject, context: ContextSpecs, imports?: GeneratorImport[]) => {
|
|
1285
|
-
|
|
1286
|
-
|
|
1445
|
+
schema: Schema;
|
|
1446
|
+
imports: GeneratorImport[];
|
|
1287
1447
|
};
|
|
1288
1448
|
type Example = ExampleObject | ReferenceObject;
|
|
1289
1449
|
type Examples = Example[] | Record<string, Example> | undefined;
|
|
1290
1450
|
declare const resolveExampleRefs: (examples: Examples, context: ContextSpecs) => Examples;
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region src/resolvers/value.d.ts
|
|
1453
|
+
declare const resolveValue: ({
|
|
1454
|
+
schema,
|
|
1455
|
+
name,
|
|
1456
|
+
context
|
|
1457
|
+
}: {
|
|
1458
|
+
schema: SchemaObject | ReferenceObject;
|
|
1459
|
+
name?: string;
|
|
1460
|
+
context: ContextSpecs;
|
|
1296
1461
|
}) => ResolverValue;
|
|
1297
|
-
|
|
1462
|
+
//#endregion
|
|
1463
|
+
//#region src/utils/assertion.d.ts
|
|
1298
1464
|
/**
|
|
1299
1465
|
* Discriminator helper for `ReferenceObject`
|
|
1300
1466
|
*
|
|
@@ -1313,177 +1479,180 @@ declare function isUndefined(x: any): x is undefined;
|
|
|
1313
1479
|
declare function isNull(x: any): x is null;
|
|
1314
1480
|
declare function isSchema(x: any): x is SchemaObject;
|
|
1315
1481
|
declare const isVerb: (verb: string) => verb is Verbs;
|
|
1316
|
-
declare const isRootKey: (specKey: string, target: string) => boolean;
|
|
1482
|
+
declare const isRootKey$1: (specKey: string, target: string) => boolean;
|
|
1317
1483
|
declare const isUrl: (str: string) => boolean;
|
|
1318
|
-
|
|
1484
|
+
//#endregion
|
|
1485
|
+
//#region src/utils/async-reduce.d.ts
|
|
1319
1486
|
declare function asyncReduce<IterationItem, AccValue>(array: IterationItem[], reducer: (accumulate: AccValue, current: IterationItem) => AccValue | Promise<AccValue>, initValue: AccValue): Promise<AccValue>;
|
|
1320
|
-
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region src/utils/case.d.ts
|
|
1321
1489
|
declare const pascal: (s: string) => string;
|
|
1322
1490
|
declare const camel: (s: string) => string;
|
|
1323
1491
|
declare const snake: (s: string) => string;
|
|
1324
1492
|
declare const kebab: (s: string) => string;
|
|
1325
1493
|
declare const upper: (s: string, fillWith: string, isDeapostrophe?: boolean) => string;
|
|
1326
1494
|
declare const conventionName: (name: string, convention: NamingConvention) => string;
|
|
1327
|
-
|
|
1495
|
+
//#endregion
|
|
1496
|
+
//#region src/utils/compare-version.d.ts
|
|
1328
1497
|
declare const compareVersions: (firstVersion: string, secondVersions: string, operator?: CompareOperator) => boolean;
|
|
1329
|
-
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/utils/debug.d.ts
|
|
1330
1500
|
interface DebuggerOptions {
|
|
1331
|
-
|
|
1501
|
+
onlyWhenFocused?: boolean | string;
|
|
1332
1502
|
}
|
|
1333
1503
|
declare function createDebugger(ns: string, options?: DebuggerOptions): debug.Debugger['log'];
|
|
1334
|
-
|
|
1504
|
+
//#endregion
|
|
1505
|
+
//#region src/utils/deep-non-nullable.d.ts
|
|
1506
|
+
type DeepNonNullable<T> = T extends Function ? T : T extends readonly (infer U)[] ? DeepNonNullable<NonNullable<U>>[] : T extends object ? { [K in keyof T]: DeepNonNullable<NonNullable<T[K]>> } : NonNullable<T>;
|
|
1507
|
+
//#endregion
|
|
1508
|
+
//#region src/utils/doc.d.ts
|
|
1335
1509
|
declare function jsDoc(schema: {
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1510
|
+
description?: string[] | string;
|
|
1511
|
+
deprecated?: boolean;
|
|
1512
|
+
summary?: string;
|
|
1513
|
+
minLength?: number;
|
|
1514
|
+
maxLength?: number;
|
|
1515
|
+
minimum?: number;
|
|
1516
|
+
maximum?: number;
|
|
1517
|
+
exclusiveMinimum?: boolean;
|
|
1518
|
+
exclusiveMaximum?: boolean;
|
|
1519
|
+
minItems?: number;
|
|
1520
|
+
maxItems?: number;
|
|
1521
|
+
nullable?: boolean;
|
|
1522
|
+
pattern?: string;
|
|
1349
1523
|
}, tryOneLine?: boolean, context?: ContextSpecs): string;
|
|
1350
1524
|
declare function keyValuePairsToJsDoc(keyValues: {
|
|
1351
|
-
|
|
1352
|
-
|
|
1525
|
+
key: string;
|
|
1526
|
+
value: string;
|
|
1353
1527
|
}[]): string;
|
|
1354
|
-
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region src/utils/dynamic-import.d.ts
|
|
1355
1530
|
declare const dynamicImport: <T>(toImport: T | string, from?: string, takeDefault?: boolean) => Promise<T>;
|
|
1356
|
-
|
|
1531
|
+
//#endregion
|
|
1532
|
+
//#region src/utils/extension.d.ts
|
|
1357
1533
|
declare const getExtension: (path: string) => "yaml" | "json";
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1534
|
+
//#endregion
|
|
1535
|
+
//#region src/utils/logger.d.ts
|
|
1536
|
+
declare const log: (message?: any, ...optionalParams: any[]) => void;
|
|
1537
|
+
declare const startMessage: ({
|
|
1538
|
+
name,
|
|
1539
|
+
version,
|
|
1540
|
+
description
|
|
1541
|
+
}: {
|
|
1542
|
+
name: string;
|
|
1543
|
+
version: string;
|
|
1544
|
+
description: string;
|
|
1545
|
+
}) => string;
|
|
1368
1546
|
declare const logError: (err: unknown, tag?: string) => void;
|
|
1369
1547
|
declare const mismatchArgsMessage: (mismatchArgs: string[]) => void;
|
|
1370
1548
|
declare const createSuccessMessage: (backend?: string) => void;
|
|
1371
1549
|
declare const ibmOpenapiValidatorWarnings: (warnings: {
|
|
1372
|
-
|
|
1373
|
-
|
|
1550
|
+
path: string[];
|
|
1551
|
+
message: string;
|
|
1374
1552
|
}[]) => void;
|
|
1375
1553
|
declare const ibmOpenapiValidatorErrors: (errors: {
|
|
1376
|
-
|
|
1377
|
-
|
|
1554
|
+
path: string[];
|
|
1555
|
+
message: string;
|
|
1378
1556
|
}[]) => void;
|
|
1379
1557
|
type LogType = 'error' | 'warn' | 'info';
|
|
1380
1558
|
type LogLevel = LogType | 'silent';
|
|
1381
1559
|
interface Logger {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1560
|
+
info(msg: string, options?: LogOptions): void;
|
|
1561
|
+
warn(msg: string, options?: LogOptions): void;
|
|
1562
|
+
warnOnce(msg: string, options?: LogOptions): void;
|
|
1563
|
+
error(msg: string, options?: LogOptions): void;
|
|
1564
|
+
clearScreen(type: LogType): void;
|
|
1565
|
+
hasWarned: boolean;
|
|
1388
1566
|
}
|
|
1389
1567
|
interface LogOptions {
|
|
1390
|
-
|
|
1391
|
-
|
|
1568
|
+
clear?: boolean;
|
|
1569
|
+
timestamp?: boolean;
|
|
1392
1570
|
}
|
|
1393
1571
|
declare const LogLevels: Record<LogLevel, number>;
|
|
1394
1572
|
interface LoggerOptions {
|
|
1395
|
-
|
|
1396
|
-
|
|
1573
|
+
prefix?: string;
|
|
1574
|
+
allowClearScreen?: boolean;
|
|
1397
1575
|
}
|
|
1398
1576
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1577
|
+
//#endregion
|
|
1578
|
+
//#region src/utils/file.d.ts
|
|
1579
|
+
declare const getFileInfo: (target?: string, {
|
|
1580
|
+
backupFilename,
|
|
1581
|
+
extension
|
|
1582
|
+
}?: {
|
|
1583
|
+
backupFilename?: string;
|
|
1584
|
+
extension?: string;
|
|
1403
1585
|
}) => {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1586
|
+
path: string;
|
|
1587
|
+
pathWithoutExtension: string;
|
|
1588
|
+
extension: string;
|
|
1589
|
+
isDirectory: boolean;
|
|
1590
|
+
dirname: string;
|
|
1591
|
+
filename: string;
|
|
1410
1592
|
};
|
|
1411
1593
|
declare function loadFile<File = any>(filePath?: string, options?: {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1594
|
+
root?: string;
|
|
1595
|
+
defaultFileName?: string;
|
|
1596
|
+
logLevel?: LogLevel;
|
|
1597
|
+
isDefault?: boolean;
|
|
1598
|
+
alias?: Record<string, string>;
|
|
1599
|
+
tsconfig?: Tsconfig;
|
|
1600
|
+
load?: boolean;
|
|
1419
1601
|
}): Promise<{
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1602
|
+
path: string;
|
|
1603
|
+
file?: File;
|
|
1604
|
+
error?: any;
|
|
1605
|
+
cached?: boolean;
|
|
1424
1606
|
}>;
|
|
1425
|
-
declare function
|
|
1426
|
-
|
|
1607
|
+
declare function removeFilesAndEmptyFolders(patterns: string[], dir: string): Promise<void>;
|
|
1608
|
+
//#endregion
|
|
1609
|
+
//#region src/utils/file-extensions.d.ts
|
|
1427
1610
|
declare const getMockFileExtensionByTypeName: (mock: GlobalMockOptions | ClientMockBuilder) => string;
|
|
1428
|
-
|
|
1611
|
+
//#endregion
|
|
1612
|
+
//#region src/utils/is-body-verb.d.ts
|
|
1613
|
+
declare const getIsBodyVerb: (verb: Verbs) => boolean;
|
|
1614
|
+
//#endregion
|
|
1615
|
+
//#region src/utils/merge-deep.d.ts
|
|
1429
1616
|
declare function mergeDeep<T extends Record<string, any>, U extends Record<string, any>>(source: T, target: U): T & U;
|
|
1430
|
-
|
|
1617
|
+
//#endregion
|
|
1618
|
+
//#region src/utils/occurrence.d.ts
|
|
1431
1619
|
declare const count: (str: string | undefined, key: string) => number;
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
declare
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
declare const dirname: (path: string) => string;
|
|
1439
|
-
declare const basename: (path: string, suffix?: string) => string;
|
|
1440
|
-
declare const isAbsolute: (path: string) => boolean;
|
|
1441
|
-
|
|
1620
|
+
//#endregion
|
|
1621
|
+
//#region src/utils/open-api-converter.d.ts
|
|
1622
|
+
declare const openApiConverter: (schema: any, options: Partial<ConvertInputOptions> | undefined, specKey: string) => Promise<OpenAPIObject>;
|
|
1623
|
+
declare namespace path_d_exports {
|
|
1624
|
+
export { basename, dirname, extname, getSchemaFileName, getSpecName, isAbsolute, join, joinSafe, normalizeSafe, relativeSafe, resolve, separator$1 as separator };
|
|
1625
|
+
}
|
|
1626
|
+
declare const join: (...paths: string[]) => string, resolve: (...paths: string[]) => string, extname: (path: string) => string, dirname: (path: string) => string, basename: (path: string, suffix?: string) => string, isAbsolute: (path: string) => boolean;
|
|
1442
1627
|
/**
|
|
1443
1628
|
* Behaves exactly like `path.relative(from, to)`, but keeps the first meaningful "./"
|
|
1444
1629
|
*/
|
|
1445
1630
|
declare const relativeSafe: (from: string, to: string) => string;
|
|
1446
1631
|
declare const getSpecName: (specKey: string, target: string) => string;
|
|
1447
1632
|
declare const getSchemaFileName: (path: string) => string;
|
|
1448
|
-
declare const separator = "/";
|
|
1633
|
+
declare const separator$1 = "/";
|
|
1449
1634
|
declare const normalizeSafe: (value: string) => string;
|
|
1450
1635
|
declare const joinSafe: (...values: string[]) => string;
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
declare const path_dirname: typeof dirname;
|
|
1454
|
-
declare const path_extname: typeof extname;
|
|
1455
|
-
declare const path_getSchemaFileName: typeof getSchemaFileName;
|
|
1456
|
-
declare const path_getSpecName: typeof getSpecName;
|
|
1457
|
-
declare const path_isAbsolute: typeof isAbsolute;
|
|
1458
|
-
declare const path_join: typeof join;
|
|
1459
|
-
declare const path_joinSafe: typeof joinSafe;
|
|
1460
|
-
declare const path_normalizeSafe: typeof normalizeSafe;
|
|
1461
|
-
declare const path_relativeSafe: typeof relativeSafe;
|
|
1462
|
-
declare const path_resolve: typeof resolve;
|
|
1463
|
-
declare const path_separator: typeof separator;
|
|
1464
|
-
declare namespace path {
|
|
1465
|
-
export { path_basename as basename, path_dirname as dirname, path_extname as extname, path_getSchemaFileName as getSchemaFileName, path_getSpecName as getSpecName, path_isAbsolute as isAbsolute, path_join as join, path_joinSafe as joinSafe, path_normalizeSafe as normalizeSafe, path_relativeSafe as relativeSafe, path_resolve as resolve, path_separator as separator };
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1636
|
+
//#endregion
|
|
1637
|
+
//#region src/utils/sort.d.ts
|
|
1468
1638
|
declare const sortByPriority: <T>(arr: (T & {
|
|
1469
|
-
|
|
1470
|
-
|
|
1639
|
+
default?: boolean;
|
|
1640
|
+
required?: boolean;
|
|
1471
1641
|
})[]) => (T & {
|
|
1472
|
-
|
|
1473
|
-
|
|
1642
|
+
default?: boolean;
|
|
1643
|
+
required?: boolean;
|
|
1474
1644
|
})[];
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
}) => string | undefined;
|
|
1645
|
+
//#endregion
|
|
1646
|
+
//#region src/utils/string.d.ts
|
|
1647
|
+
declare const stringify: (data?: string | any[] | Record<string, any>) => string | undefined;
|
|
1479
1648
|
declare const sanitize: (value: string, options?: {
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1649
|
+
whitespace?: string | true;
|
|
1650
|
+
underscore?: string | true;
|
|
1651
|
+
dot?: string | true;
|
|
1652
|
+
dash?: string | true;
|
|
1653
|
+
es5keyword?: boolean;
|
|
1654
|
+
es5IdentifierName?: boolean;
|
|
1655
|
+
special?: boolean;
|
|
1487
1656
|
}) => string;
|
|
1488
1657
|
declare const toObjectString: <T>(props: T[], path?: keyof T) => string;
|
|
1489
1658
|
declare const getNumberWord: (num: number) => string;
|
|
@@ -1498,57 +1667,111 @@ declare const escape: (str: string | null, char?: string) => string | undefined;
|
|
|
1498
1667
|
* @param input String to escape
|
|
1499
1668
|
*/
|
|
1500
1669
|
declare const jsStringEscape: (input: string) => string;
|
|
1501
|
-
|
|
1670
|
+
//#endregion
|
|
1671
|
+
//#region src/utils/tsconfig.d.ts
|
|
1502
1672
|
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
1503
|
-
|
|
1673
|
+
//#endregion
|
|
1674
|
+
//#region src/utils/validator.d.ts
|
|
1504
1675
|
/**
|
|
1505
1676
|
* Validate the spec with ibm-openapi-validator (with a custom pretty logger).
|
|
1506
1677
|
* More information: https://github.com/IBM/openapi-validator/#configuration
|
|
1507
1678
|
* @param specs openAPI spec
|
|
1508
1679
|
*/
|
|
1509
1680
|
declare const ibmOpenapiValidator: (specs: OpenAPIObject, validation: boolean | object) => Promise<void>;
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region src/writers/schemas.d.ts
|
|
1513
1683
|
declare const writeModelInline: (acc: string, model: string) => string;
|
|
1514
1684
|
declare const writeModelsInline: (array: GeneratorSchema[]) => string;
|
|
1515
|
-
declare const writeSchema: ({
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1685
|
+
declare const writeSchema: ({
|
|
1686
|
+
path,
|
|
1687
|
+
schema,
|
|
1688
|
+
target,
|
|
1689
|
+
namingConvention,
|
|
1690
|
+
fileExtension,
|
|
1691
|
+
specKey,
|
|
1692
|
+
isRootKey,
|
|
1693
|
+
specsName,
|
|
1694
|
+
header
|
|
1695
|
+
}: {
|
|
1696
|
+
path: string;
|
|
1697
|
+
schema: GeneratorSchema;
|
|
1698
|
+
target: string;
|
|
1699
|
+
namingConvention: NamingConvention;
|
|
1700
|
+
fileExtension: string;
|
|
1701
|
+
specKey: string;
|
|
1702
|
+
isRootKey: boolean;
|
|
1703
|
+
specsName: Record<string, string>;
|
|
1704
|
+
header: string;
|
|
1525
1705
|
}) => Promise<void>;
|
|
1526
|
-
declare const writeSchemas: ({
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1706
|
+
declare const writeSchemas: ({
|
|
1707
|
+
schemaPath,
|
|
1708
|
+
schemas,
|
|
1709
|
+
target,
|
|
1710
|
+
namingConvention,
|
|
1711
|
+
fileExtension,
|
|
1712
|
+
specKey,
|
|
1713
|
+
isRootKey,
|
|
1714
|
+
specsName,
|
|
1715
|
+
header,
|
|
1716
|
+
indexFiles
|
|
1717
|
+
}: {
|
|
1718
|
+
schemaPath: string;
|
|
1719
|
+
schemas: GeneratorSchema[];
|
|
1720
|
+
target: string;
|
|
1721
|
+
namingConvention: NamingConvention;
|
|
1722
|
+
fileExtension: string;
|
|
1723
|
+
specKey: string;
|
|
1724
|
+
isRootKey: boolean;
|
|
1725
|
+
specsName: Record<string, string>;
|
|
1726
|
+
header: string;
|
|
1727
|
+
indexFiles: boolean;
|
|
1537
1728
|
}) => Promise<void>;
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
declare const
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1729
|
+
//#endregion
|
|
1730
|
+
//#region src/writers/single-mode.d.ts
|
|
1731
|
+
declare const writeSingleMode: ({
|
|
1732
|
+
builder,
|
|
1733
|
+
output,
|
|
1734
|
+
specsName,
|
|
1735
|
+
header,
|
|
1736
|
+
needSchema
|
|
1737
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1738
|
+
//#endregion
|
|
1739
|
+
//#region src/writers/split-mode.d.ts
|
|
1740
|
+
declare const writeSplitMode: ({
|
|
1741
|
+
builder,
|
|
1742
|
+
output,
|
|
1743
|
+
specsName,
|
|
1744
|
+
header,
|
|
1745
|
+
needSchema
|
|
1746
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1747
|
+
//#endregion
|
|
1748
|
+
//#region src/writers/split-tags-mode.d.ts
|
|
1749
|
+
declare const writeSplitTagsMode: ({
|
|
1750
|
+
builder,
|
|
1751
|
+
output,
|
|
1752
|
+
specsName,
|
|
1753
|
+
header,
|
|
1754
|
+
needSchema
|
|
1755
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1756
|
+
//#endregion
|
|
1757
|
+
//#region src/writers/tags-mode.d.ts
|
|
1758
|
+
declare const writeTagsMode: ({
|
|
1759
|
+
builder,
|
|
1760
|
+
output,
|
|
1761
|
+
specsName,
|
|
1762
|
+
header,
|
|
1763
|
+
needSchema
|
|
1764
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1765
|
+
//#endregion
|
|
1766
|
+
//#region src/writers/target.d.ts
|
|
1550
1767
|
declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => GeneratorTarget;
|
|
1551
|
-
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region src/writers/target-tags.d.ts
|
|
1552
1770
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1553
|
-
|
|
1554
|
-
|
|
1771
|
+
//#endregion
|
|
1772
|
+
//#region src/writers/types.d.ts
|
|
1773
|
+
declare const getOrvalGeneratedTypes: () => string;
|
|
1774
|
+
declare const getTypedResponse: () => string;
|
|
1775
|
+
//#endregion
|
|
1776
|
+
export { AngularOptions, BODY_TYPE_NAME, BaseUrlFromConstant, BaseUrlFromSpec, ClientBuilder, ClientDependenciesBuilder, ClientExtraFilesBuilder, ClientFileBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMockBuilder, ClientMockGeneratorBuilder, ClientMockGeneratorImplementation, ClientTitleBuilder, Config, ConfigExternal, ConfigFn, ContextSpecs, DeepNonNullable, EnumGeneration, ErrorWithTag, FetchOptions, FormDataArrayHandling, FormDataType, GenerateMockImports, GeneratorApiBuilder, GeneratorApiOperations, GeneratorApiResponse, GeneratorClient, GeneratorClientExtra, GeneratorClientFooter, GeneratorClientHeader, GeneratorClientImports, GeneratorClientTitle, GeneratorClients, GeneratorDependency, GeneratorImport, GeneratorMutator, GeneratorMutatorParsingInfo, GeneratorOperation, GeneratorOperations, GeneratorOptions, GeneratorSchema, GeneratorTarget, GeneratorTargetFull, GeneratorVerbOptions, GeneratorVerbsOptions, GetterBody, GetterParam, GetterParameters, GetterParams, GetterProp, GetterPropType, GetterProps, GetterQueryParam, GetterResponse, GlobalMockOptions, GlobalOptions, HonoOptions, Hook, HookCommand, HookFunction, HookOption, HooksOptions, ImportOpenApi, InputFiltersOption, InputOptions, InputTransformerFn, JsDocOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, MockData, MockDataArray, MockDataArrayFn, MockDataObject, MockDataObjectFn, MockOptions, MockProperties, MockPropertiesObject, MockPropertiesObjectFn, Mutator, MutatorObject, NamingConvention, NormalizedConfig, NormalizedFetchOptions, NormalizedFormDataType, NormalizedHonoOptions, NormalizedHookCommand, NormalizedHookOptions, NormalizedInputOptions, NormalizedJsDocOptions, NormalizedMutator, NormalizedOperationOptions, NormalizedOptions, NormalizedOutputOptions, NormalizedOverrideOutput, NormalizedParamsSerializerOptions, NormalizedQueryOptions, NormalizedZodOptions, OperationOptions, Options, OptionsExport, OptionsFn, OutputClient, OutputClientFunc, OutputDocsOptions, OutputHttpClient, OutputMockType, OutputMode, OutputOptions, OverrideInput, OverrideMockOptions, OverrideOutput, OverrideOutputContentType, PackageJson, ParamsSerializerOptions, PropertySortOrder, QueryOptions, RefComponentSuffix, RefInfo, ResReqTypesValue, ResolverValue, ScalarValue, SchemaType, SchemaWithConst, SwaggerParserOptions, SwrOptions, TEMPLATE_TAG_REGEX, TsConfigTarget, Tsconfig, URL_REGEX, VERBS_WITH_BODY, Verbs, WriteModeProps, WriteSpecsBuilder, ZodCoerceType, ZodDateTimeOptions, ZodOptions, ZodTimeOptions, _filteredVerbs, addDependency, asyncReduce, camel, combineSchemas, compareVersions, conventionName, count, createDebugger, createLogger, createSuccessMessage, dynamicImport, escape, generalJSTypes, generalJSTypesWithArray, generateAxiosOptions, generateBodyMutatorConfig, generateBodyOptions, generateComponentDefinition, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateImports, generateModelInline, generateModelsInline, generateMutator, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateParameterDefinition, generateQueryParamsAxiosConfig, generateSchemasDefinition, generateTarget, generateTargetForTags, generateVerbImports, generateVerbsOptions, getArray, getBody, getEnum, getEnumDescriptions, getEnumImplementation, getEnumNames, getExtension, getFileInfo, getFullRoute, getIsBodyVerb, getKey, getMockFileExtensionByTypeName, getNumberWord, getObject, getOperationId, getOrvalGeneratedTypes, getParameters, getParams, getParamsInPath, getProps, getQueryParams, getRefInfo, getResReqTypes, getResponse, getRoute, getRouteAsArray, getScalar, getTypedResponse, ibmOpenapiValidator, ibmOpenapiValidatorErrors, ibmOpenapiValidatorWarnings, isBoolean, isDirectory, isFunction, isModule, isNull, isNumber, isNumeric, isObject, isReference, isRootKey$1 as isRootKey, isSchema, isString, isSyntheticDefaultImportsAllow, isUndefined, isUrl, isVerb, jsDoc, jsStringEscape, kebab, keyValuePairsToJsDoc, loadFile, log, logError, mergeDeep, mismatchArgsMessage, openApiConverter, pascal, removeFilesAndEmptyFolders, resolveDiscriminators, resolveExampleRefs, resolveObject, resolveRef, resolveValue, sanitize, snake, sortByPriority, startMessage, stringify, toObjectString, path_d_exports as upath, upper, writeModelInline, writeModelsInline, writeSchema, writeSchemas, writeSingleMode, writeSplitMode, writeSplitTagsMode, writeTagsMode };
|
|
1777
|
+
//# sourceMappingURL=index.d.ts.map
|