@orval/core 7.11.2 → 7.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1332 -1111
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3939 -53668
- package/dist/index.js.map +1 -1
- package/package.json +32 -19
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,281 @@ 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
|
+
signal?: boolean;
|
|
495
|
+
version?: 3 | 4 | 5;
|
|
513
496
|
};
|
|
514
497
|
type QueryOptions = {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
498
|
+
useQuery?: boolean;
|
|
499
|
+
useSuspenseQuery?: boolean;
|
|
500
|
+
useMutation?: boolean;
|
|
501
|
+
useInfinite?: boolean;
|
|
502
|
+
useSuspenseInfiniteQuery?: boolean;
|
|
503
|
+
useInfiniteQueryParam?: string;
|
|
504
|
+
usePrefetch?: boolean;
|
|
505
|
+
options?: any;
|
|
506
|
+
queryKey?: Mutator;
|
|
507
|
+
queryOptions?: Mutator;
|
|
508
|
+
mutationOptions?: Mutator;
|
|
509
|
+
shouldExportMutatorHooks?: boolean;
|
|
510
|
+
shouldExportHttpClient?: boolean;
|
|
511
|
+
shouldExportQueryKey?: boolean;
|
|
512
|
+
shouldSplitQueryKey?: boolean;
|
|
513
|
+
signal?: boolean;
|
|
514
|
+
version?: 3 | 4 | 5;
|
|
532
515
|
};
|
|
533
516
|
type AngularOptions = {
|
|
534
|
-
|
|
517
|
+
provideIn?: 'root' | 'any' | boolean;
|
|
535
518
|
};
|
|
536
519
|
type SwrOptions = {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
520
|
+
useInfinite?: boolean;
|
|
521
|
+
useSWRMutationForGet?: boolean;
|
|
522
|
+
swrOptions?: any;
|
|
523
|
+
swrMutationOptions?: any;
|
|
524
|
+
swrInfiniteOptions?: any;
|
|
525
|
+
};
|
|
526
|
+
type NormalizedFetchOptions = {
|
|
527
|
+
includeHttpResponseReturnType: boolean;
|
|
528
|
+
forceSuccessResponse: boolean;
|
|
529
|
+
explode: boolean;
|
|
530
|
+
jsonReviver?: Mutator;
|
|
542
531
|
};
|
|
543
532
|
type FetchOptions = {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
533
|
+
includeHttpResponseReturnType?: boolean;
|
|
534
|
+
forceSuccessResponse?: boolean;
|
|
535
|
+
explode?: boolean;
|
|
536
|
+
jsonReviver?: Mutator;
|
|
547
537
|
};
|
|
548
538
|
type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
549
539
|
type InputTransformer = string | InputTransformerFn;
|
|
550
540
|
type OverrideInput = {
|
|
551
|
-
|
|
541
|
+
transformer?: InputTransformer;
|
|
552
542
|
};
|
|
553
543
|
type OperationOptions = {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
544
|
+
transformer?: OutputTransformer;
|
|
545
|
+
mutator?: Mutator;
|
|
546
|
+
mock?: {
|
|
547
|
+
data?: MockData;
|
|
548
|
+
properties?: MockProperties;
|
|
549
|
+
};
|
|
550
|
+
query?: QueryOptions;
|
|
551
|
+
angular?: Required<AngularOptions>;
|
|
552
|
+
swr?: SwrOptions;
|
|
553
|
+
zod?: ZodOptions;
|
|
554
|
+
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
555
|
+
fetch?: FetchOptions;
|
|
556
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
557
|
+
formUrlEncoded?: boolean | Mutator;
|
|
558
|
+
paramsSerializer?: Mutator;
|
|
559
|
+
requestOptions?: object | boolean;
|
|
570
560
|
};
|
|
571
561
|
type Hook = 'afterAllFilesWrite';
|
|
572
562
|
type HookFunction = (...args: any[]) => void | Promise<void>;
|
|
573
563
|
interface HookOption {
|
|
574
|
-
|
|
575
|
-
|
|
564
|
+
command: string | HookFunction;
|
|
565
|
+
injectGeneratedDirsAndFiles?: boolean;
|
|
576
566
|
}
|
|
577
567
|
type HookCommand = string | HookFunction | HookOption | (string | HookFunction | HookOption)[];
|
|
578
568
|
type NormalizedHookCommand = HookCommand[];
|
|
@@ -580,618 +570,745 @@ type HooksOptions<T = HookCommand | NormalizedHookCommand> = Partial<Record<Hook
|
|
|
580
570
|
type NormalizedHookOptions = HooksOptions<NormalizedHookCommand>;
|
|
581
571
|
type Verbs = 'post' | 'put' | 'get' | 'patch' | 'delete' | 'head';
|
|
582
572
|
declare const Verbs: {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
573
|
+
POST: Verbs;
|
|
574
|
+
PUT: Verbs;
|
|
575
|
+
GET: Verbs;
|
|
576
|
+
PATCH: Verbs;
|
|
577
|
+
DELETE: Verbs;
|
|
578
|
+
HEAD: Verbs;
|
|
589
579
|
};
|
|
590
580
|
type ImportOpenApi = {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
581
|
+
data: JSONSchema6 | JSONSchema7 | Record<string, unknown | OpenAPIObject>;
|
|
582
|
+
input: NormalizedInputOptions;
|
|
583
|
+
output: NormalizedOutputOptions;
|
|
584
|
+
target: string;
|
|
585
|
+
workspace: string;
|
|
596
586
|
};
|
|
597
587
|
interface ContextSpecs {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
588
|
+
specKey: string;
|
|
589
|
+
target: string;
|
|
590
|
+
workspace: string;
|
|
591
|
+
specs: Record<string, OpenAPIObject>;
|
|
592
|
+
parents?: string[];
|
|
593
|
+
output: NormalizedOutputOptions;
|
|
604
594
|
}
|
|
605
595
|
interface GlobalOptions {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
output?: string;
|
|
596
|
+
projectName?: string;
|
|
597
|
+
watch?: boolean | string | (string | boolean)[];
|
|
598
|
+
clean?: boolean | string[];
|
|
599
|
+
prettier?: boolean;
|
|
600
|
+
biome?: boolean;
|
|
601
|
+
mock?: boolean | GlobalMockOptions;
|
|
602
|
+
client?: OutputClient;
|
|
603
|
+
httpClient?: OutputHttpClient;
|
|
604
|
+
mode?: OutputMode;
|
|
605
|
+
tsconfig?: string | Tsconfig;
|
|
606
|
+
packageJson?: string;
|
|
607
|
+
input?: string;
|
|
608
|
+
output?: string;
|
|
620
609
|
}
|
|
621
610
|
interface Tsconfig {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
611
|
+
baseUrl?: string;
|
|
612
|
+
compilerOptions?: {
|
|
613
|
+
esModuleInterop?: boolean;
|
|
614
|
+
allowSyntheticDefaultImports?: boolean;
|
|
615
|
+
exactOptionalPropertyTypes?: boolean;
|
|
616
|
+
paths?: Record<string, string[]>;
|
|
617
|
+
target?: TsConfigTarget;
|
|
618
|
+
};
|
|
630
619
|
}
|
|
631
620
|
type TsConfigTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
|
|
632
621
|
interface PackageJson {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
622
|
+
dependencies?: Record<string, string>;
|
|
623
|
+
devDependencies?: Record<string, string>;
|
|
624
|
+
peerDependencies?: Record<string, string>;
|
|
636
625
|
}
|
|
637
626
|
type GeneratorSchema = {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
627
|
+
name: string;
|
|
628
|
+
model: string;
|
|
629
|
+
imports: GeneratorImport[];
|
|
641
630
|
};
|
|
642
631
|
type GeneratorImport = {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
632
|
+
name: string;
|
|
633
|
+
schemaName?: string;
|
|
634
|
+
isConstant?: boolean;
|
|
635
|
+
alias?: string;
|
|
636
|
+
specKey?: string;
|
|
637
|
+
default?: boolean;
|
|
638
|
+
values?: boolean;
|
|
639
|
+
syntheticDefaultImport?: boolean;
|
|
651
640
|
};
|
|
652
641
|
type GeneratorDependency = {
|
|
653
|
-
|
|
654
|
-
|
|
642
|
+
exports: GeneratorImport[];
|
|
643
|
+
dependency: string;
|
|
655
644
|
};
|
|
656
645
|
type GeneratorApiResponse = {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
};
|
|
660
|
-
type GeneratorOperations = {
|
|
661
|
-
[operationId: string]: GeneratorOperation;
|
|
646
|
+
operations: GeneratorOperations;
|
|
647
|
+
schemas: GeneratorSchema[];
|
|
662
648
|
};
|
|
649
|
+
type GeneratorOperations = Record<string, GeneratorOperation>;
|
|
663
650
|
type GeneratorTarget = {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
651
|
+
imports: GeneratorImport[];
|
|
652
|
+
implementation: string;
|
|
653
|
+
implementationMock: string;
|
|
654
|
+
importsMock: GeneratorImport[];
|
|
655
|
+
mutators?: GeneratorMutator[];
|
|
656
|
+
clientMutators?: GeneratorMutator[];
|
|
657
|
+
formData?: GeneratorMutator[];
|
|
658
|
+
formUrlEncoded?: GeneratorMutator[];
|
|
659
|
+
paramsSerializer?: GeneratorMutator[];
|
|
660
|
+
fetchReviver?: GeneratorMutator[];
|
|
674
661
|
};
|
|
675
662
|
type GeneratorTargetFull = {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
663
|
+
imports: GeneratorImport[];
|
|
664
|
+
implementation: string;
|
|
665
|
+
implementationMock: {
|
|
666
|
+
function: string;
|
|
667
|
+
handler: string;
|
|
668
|
+
handlerName: string;
|
|
669
|
+
};
|
|
670
|
+
importsMock: GeneratorImport[];
|
|
671
|
+
mutators?: GeneratorMutator[];
|
|
672
|
+
clientMutators?: GeneratorMutator[];
|
|
673
|
+
formData?: GeneratorMutator[];
|
|
674
|
+
formUrlEncoded?: GeneratorMutator[];
|
|
675
|
+
paramsSerializer?: GeneratorMutator[];
|
|
676
|
+
fetchReviver?: GeneratorMutator[];
|
|
690
677
|
};
|
|
691
678
|
type GeneratorOperation = {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
679
|
+
imports: GeneratorImport[];
|
|
680
|
+
implementation: string;
|
|
681
|
+
implementationMock: {
|
|
682
|
+
function: string;
|
|
683
|
+
handler: string;
|
|
684
|
+
handlerName: string;
|
|
685
|
+
};
|
|
686
|
+
importsMock: GeneratorImport[];
|
|
687
|
+
tags: string[];
|
|
688
|
+
mutator?: GeneratorMutator;
|
|
689
|
+
clientMutators?: GeneratorMutator[];
|
|
690
|
+
formData?: GeneratorMutator;
|
|
691
|
+
formUrlEncoded?: GeneratorMutator;
|
|
692
|
+
paramsSerializer?: GeneratorMutator;
|
|
693
|
+
fetchReviver?: GeneratorMutator;
|
|
694
|
+
operationName: string;
|
|
695
|
+
types?: {
|
|
696
|
+
result: (title?: string) => string;
|
|
697
|
+
};
|
|
711
698
|
};
|
|
712
699
|
type GeneratorVerbOptions = {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
700
|
+
verb: Verbs;
|
|
701
|
+
route: string;
|
|
702
|
+
pathRoute: string;
|
|
703
|
+
summary?: string;
|
|
704
|
+
doc: string;
|
|
705
|
+
tags: string[];
|
|
706
|
+
operationId: string;
|
|
707
|
+
operationName: string;
|
|
708
|
+
response: GetterResponse;
|
|
709
|
+
body: GetterBody;
|
|
710
|
+
headers?: GetterQueryParam;
|
|
711
|
+
queryParams?: GetterQueryParam;
|
|
712
|
+
params: GetterParams;
|
|
713
|
+
props: GetterProps;
|
|
714
|
+
mutator?: GeneratorMutator;
|
|
715
|
+
formData?: GeneratorMutator;
|
|
716
|
+
formUrlEncoded?: GeneratorMutator;
|
|
717
|
+
paramsSerializer?: GeneratorMutator;
|
|
718
|
+
fetchReviver?: GeneratorMutator;
|
|
719
|
+
override: NormalizedOverrideOutput;
|
|
720
|
+
deprecated?: boolean;
|
|
721
|
+
originalOperation: OperationObject;
|
|
735
722
|
};
|
|
736
723
|
type GeneratorVerbsOptions = GeneratorVerbOptions[];
|
|
737
724
|
type GeneratorOptions = {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
725
|
+
route: string;
|
|
726
|
+
pathRoute: string;
|
|
727
|
+
override: NormalizedOverrideOutput;
|
|
728
|
+
context: ContextSpecs;
|
|
729
|
+
mock?: GlobalMockOptions | ClientMockBuilder;
|
|
730
|
+
output: string;
|
|
744
731
|
};
|
|
745
732
|
type GeneratorClient = {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
733
|
+
implementation: string;
|
|
734
|
+
imports: GeneratorImport[];
|
|
735
|
+
mutators?: GeneratorMutator[];
|
|
749
736
|
};
|
|
750
737
|
type GeneratorMutatorParsingInfo = {
|
|
751
|
-
|
|
752
|
-
|
|
738
|
+
numberOfParams: number;
|
|
739
|
+
returnNumberOfParams?: number;
|
|
753
740
|
};
|
|
754
741
|
type GeneratorMutator = {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
742
|
+
name: string;
|
|
743
|
+
path: string;
|
|
744
|
+
default: boolean;
|
|
745
|
+
hasErrorType: boolean;
|
|
746
|
+
errorTypeName: string;
|
|
747
|
+
hasSecondArg: boolean;
|
|
748
|
+
hasThirdArg: boolean;
|
|
749
|
+
isHook: boolean;
|
|
750
|
+
bodyTypeName?: string;
|
|
764
751
|
};
|
|
765
752
|
type ClientBuilder = (verbOptions: GeneratorVerbOptions, options: GeneratorOptions, outputClient: OutputClient | OutputClientFunc, output?: NormalizedOutputOptions) => GeneratorClient | Promise<GeneratorClient>;
|
|
766
753
|
type ClientFileBuilder = {
|
|
767
|
-
|
|
768
|
-
|
|
754
|
+
path: string;
|
|
755
|
+
content: string;
|
|
769
756
|
};
|
|
770
757
|
type ClientExtraFilesBuilder = (verbOptions: Record<string, GeneratorVerbOptions>, output: NormalizedOutputOptions, context: ContextSpecs) => Promise<ClientFileBuilder[]>;
|
|
771
758
|
type ClientHeaderBuilder = (params: {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
759
|
+
title: string;
|
|
760
|
+
isRequestOptions: boolean;
|
|
761
|
+
isMutator: boolean;
|
|
762
|
+
noFunction?: boolean;
|
|
763
|
+
isGlobalMutator: boolean;
|
|
764
|
+
provideIn: boolean | 'root' | 'any';
|
|
765
|
+
hasAwaitedType: boolean;
|
|
766
|
+
output: NormalizedOutputOptions;
|
|
767
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
768
|
+
tag?: string;
|
|
769
|
+
clientImplementation: string;
|
|
783
770
|
}) => string;
|
|
784
771
|
type ClientFooterBuilder = (params: {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
772
|
+
noFunction?: boolean | undefined;
|
|
773
|
+
operationNames: string[];
|
|
774
|
+
title?: string;
|
|
775
|
+
hasAwaitedType: boolean;
|
|
776
|
+
hasMutator: boolean;
|
|
790
777
|
}) => string;
|
|
791
778
|
type ClientTitleBuilder = (title: string) => string;
|
|
792
779
|
type ClientDependenciesBuilder = (hasGlobalMutator: boolean, hasParamsSerializerOptions: boolean, packageJson?: PackageJson, httpClient?: OutputHttpClient, hasTagsMutator?: boolean, override?: NormalizedOverrideOutput) => GeneratorDependency[];
|
|
793
780
|
type ClientMockGeneratorImplementation = {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
781
|
+
function: string;
|
|
782
|
+
handlerName: string;
|
|
783
|
+
handler: string;
|
|
797
784
|
};
|
|
798
785
|
type ClientMockGeneratorBuilder = {
|
|
799
|
-
|
|
800
|
-
|
|
786
|
+
imports: GeneratorImport[];
|
|
787
|
+
implementation: ClientMockGeneratorImplementation;
|
|
801
788
|
};
|
|
802
789
|
type ClientMockBuilder = (verbOptions: GeneratorVerbOptions, generatorOptions: GeneratorOptions) => ClientMockGeneratorBuilder;
|
|
803
790
|
interface ClientGeneratorsBuilder {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
791
|
+
client: ClientBuilder;
|
|
792
|
+
header?: ClientHeaderBuilder;
|
|
793
|
+
dependencies?: ClientDependenciesBuilder;
|
|
794
|
+
footer?: ClientFooterBuilder;
|
|
795
|
+
title?: ClientTitleBuilder;
|
|
796
|
+
extraFiles?: ClientExtraFilesBuilder;
|
|
810
797
|
}
|
|
811
798
|
type GeneratorClients = Record<OutputClient, ClientGeneratorsBuilder>;
|
|
812
799
|
type GetterResponse = {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
800
|
+
imports: GeneratorImport[];
|
|
801
|
+
definition: {
|
|
802
|
+
success: string;
|
|
803
|
+
errors: string;
|
|
804
|
+
};
|
|
805
|
+
isBlob: boolean;
|
|
806
|
+
types: {
|
|
807
|
+
success: ResReqTypesValue[];
|
|
808
|
+
errors: ResReqTypesValue[];
|
|
809
|
+
};
|
|
810
|
+
contentTypes: string[];
|
|
811
|
+
schemas: GeneratorSchema[];
|
|
812
|
+
originalSchema?: ResponsesObject;
|
|
826
813
|
};
|
|
827
814
|
type GetterBody = {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
815
|
+
originalSchema: ReferenceObject | RequestBodyObject;
|
|
816
|
+
imports: GeneratorImport[];
|
|
817
|
+
definition: string;
|
|
818
|
+
implementation: string;
|
|
819
|
+
schemas: GeneratorSchema[];
|
|
820
|
+
formData?: string;
|
|
821
|
+
formUrlEncoded?: string;
|
|
822
|
+
contentType: string;
|
|
823
|
+
isOptional: boolean;
|
|
837
824
|
};
|
|
838
825
|
type GetterParameters = {
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
826
|
+
query: {
|
|
827
|
+
parameter: ParameterObject;
|
|
828
|
+
imports: GeneratorImport[];
|
|
829
|
+
}[];
|
|
830
|
+
path: {
|
|
831
|
+
parameter: ParameterObject;
|
|
832
|
+
imports: GeneratorImport[];
|
|
833
|
+
}[];
|
|
834
|
+
header: {
|
|
835
|
+
parameter: ParameterObject;
|
|
836
|
+
imports: GeneratorImport[];
|
|
837
|
+
}[];
|
|
851
838
|
};
|
|
852
839
|
type GetterParam = {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
840
|
+
name: string;
|
|
841
|
+
definition: string;
|
|
842
|
+
implementation: string;
|
|
843
|
+
default: boolean;
|
|
844
|
+
required: boolean;
|
|
845
|
+
imports: GeneratorImport[];
|
|
859
846
|
};
|
|
860
847
|
type GetterParams = GetterParam[];
|
|
861
848
|
type GetterQueryParam = {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
849
|
+
schema: GeneratorSchema;
|
|
850
|
+
deps: GeneratorSchema[];
|
|
851
|
+
isOptional: boolean;
|
|
852
|
+
originalSchema?: SchemaObject;
|
|
866
853
|
};
|
|
867
854
|
type GetterPropType = 'param' | 'body' | 'queryParam' | 'header' | 'namedPathParams';
|
|
868
855
|
declare const GetterPropType: {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
856
|
+
readonly PARAM: "param";
|
|
857
|
+
readonly NAMED_PATH_PARAMS: "namedPathParams";
|
|
858
|
+
readonly BODY: "body";
|
|
859
|
+
readonly QUERY_PARAM: "queryParam";
|
|
860
|
+
readonly HEADER: "header";
|
|
874
861
|
};
|
|
875
862
|
type GetterPropBase = {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
863
|
+
name: string;
|
|
864
|
+
definition: string;
|
|
865
|
+
implementation: string;
|
|
866
|
+
default: boolean;
|
|
867
|
+
required: boolean;
|
|
881
868
|
};
|
|
882
869
|
type GetterProp = GetterPropBase & ({
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
870
|
+
type: 'namedPathParams';
|
|
871
|
+
destructured: string;
|
|
872
|
+
schema: GeneratorSchema;
|
|
886
873
|
} | {
|
|
887
|
-
|
|
874
|
+
type: Exclude<GetterPropType, 'namedPathParams'>;
|
|
888
875
|
});
|
|
889
876
|
type GetterProps = GetterProp[];
|
|
890
877
|
type SchemaType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array' | 'enum' | 'unknown';
|
|
891
878
|
declare const SchemaType: {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
879
|
+
integer: string;
|
|
880
|
+
number: string;
|
|
881
|
+
string: string;
|
|
882
|
+
boolean: string;
|
|
883
|
+
object: string;
|
|
884
|
+
null: string;
|
|
885
|
+
array: string;
|
|
886
|
+
enum: string;
|
|
887
|
+
unknown: string;
|
|
901
888
|
};
|
|
902
889
|
type ScalarValue = {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
890
|
+
value: string;
|
|
891
|
+
isEnum: boolean;
|
|
892
|
+
hasReadonlyProps: boolean;
|
|
893
|
+
type: SchemaType;
|
|
894
|
+
imports: GeneratorImport[];
|
|
895
|
+
schemas: GeneratorSchema[];
|
|
896
|
+
isRef: boolean;
|
|
897
|
+
example?: any;
|
|
898
|
+
examples?: Record<string, any>;
|
|
912
899
|
};
|
|
913
900
|
type ResolverValue = ScalarValue & {
|
|
914
|
-
|
|
901
|
+
originalSchema: SchemaObject;
|
|
915
902
|
};
|
|
916
903
|
type ResReqTypesValue = ScalarValue & {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
904
|
+
formData?: string;
|
|
905
|
+
formUrlEncoded?: string;
|
|
906
|
+
isRef?: boolean;
|
|
907
|
+
hasReadonlyProps?: boolean;
|
|
908
|
+
key: string;
|
|
909
|
+
contentType: string;
|
|
910
|
+
originalSchema?: SchemaObject;
|
|
924
911
|
};
|
|
925
912
|
type WriteSpecsBuilder = {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
913
|
+
operations: GeneratorOperations;
|
|
914
|
+
schemas: Record<string, GeneratorSchema[]>;
|
|
915
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
916
|
+
title: GeneratorClientTitle;
|
|
917
|
+
header: GeneratorClientHeader;
|
|
918
|
+
footer: GeneratorClientFooter;
|
|
919
|
+
imports: GeneratorClientImports;
|
|
920
|
+
importsMock: GenerateMockImports;
|
|
921
|
+
extraFiles: ClientFileBuilder[];
|
|
922
|
+
info: InfoObject;
|
|
923
|
+
target: string;
|
|
937
924
|
};
|
|
938
925
|
type WriteModeProps = {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
926
|
+
builder: WriteSpecsBuilder;
|
|
927
|
+
output: NormalizedOutputOptions;
|
|
928
|
+
workspace: string;
|
|
929
|
+
specsName: Record<string, string>;
|
|
930
|
+
header: string;
|
|
931
|
+
needSchema: boolean;
|
|
945
932
|
};
|
|
946
933
|
type GeneratorApiOperations = {
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
934
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
935
|
+
operations: GeneratorOperations;
|
|
936
|
+
schemas: GeneratorSchema[];
|
|
950
937
|
};
|
|
951
938
|
type GeneratorClientExtra = {
|
|
952
|
-
|
|
953
|
-
|
|
939
|
+
implementation: string;
|
|
940
|
+
implementationMock: string;
|
|
954
941
|
};
|
|
955
942
|
type GeneratorClientTitle = (data: {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
943
|
+
outputClient?: OutputClient | OutputClientFunc;
|
|
944
|
+
title: string;
|
|
945
|
+
customTitleFunc?: (title: string) => string;
|
|
946
|
+
output: NormalizedOutputOptions;
|
|
960
947
|
}) => GeneratorClientExtra;
|
|
961
948
|
type GeneratorClientHeader = (data: {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
949
|
+
outputClient?: OutputClient | OutputClientFunc;
|
|
950
|
+
isRequestOptions: boolean;
|
|
951
|
+
isMutator: boolean;
|
|
952
|
+
isGlobalMutator: boolean;
|
|
953
|
+
provideIn: boolean | 'root' | 'any';
|
|
954
|
+
hasAwaitedType: boolean;
|
|
955
|
+
titles: GeneratorClientExtra;
|
|
956
|
+
output: NormalizedOutputOptions;
|
|
957
|
+
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
958
|
+
tag?: string;
|
|
959
|
+
clientImplementation: string;
|
|
973
960
|
}) => GeneratorClientExtra;
|
|
974
961
|
type GeneratorClientFooter = (data: {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
962
|
+
outputClient: OutputClient | OutputClientFunc;
|
|
963
|
+
operationNames: string[];
|
|
964
|
+
hasMutator: boolean;
|
|
965
|
+
hasAwaitedType: boolean;
|
|
966
|
+
titles: GeneratorClientExtra;
|
|
967
|
+
output: NormalizedOutputOptions;
|
|
981
968
|
}) => GeneratorClientExtra;
|
|
982
969
|
type GeneratorClientImports = (data: {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
970
|
+
client: OutputClient | OutputClientFunc;
|
|
971
|
+
implementation: string;
|
|
972
|
+
imports: {
|
|
973
|
+
exports: GeneratorImport[];
|
|
974
|
+
dependency: string;
|
|
975
|
+
}[];
|
|
976
|
+
specsName: Record<string, string>;
|
|
977
|
+
hasSchemaDir: boolean;
|
|
978
|
+
isAllowSyntheticDefaultImports: boolean;
|
|
979
|
+
hasGlobalMutator: boolean;
|
|
980
|
+
hasTagsMutator: boolean;
|
|
981
|
+
hasParamsSerializerOptions: boolean;
|
|
982
|
+
packageJson?: PackageJson;
|
|
983
|
+
output: NormalizedOutputOptions;
|
|
997
984
|
}) => string;
|
|
998
985
|
type GenerateMockImports = (data: {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
986
|
+
implementation: string;
|
|
987
|
+
imports: {
|
|
988
|
+
exports: GeneratorImport[];
|
|
989
|
+
dependency: string;
|
|
990
|
+
}[];
|
|
991
|
+
specsName: Record<string, string>;
|
|
992
|
+
hasSchemaDir: boolean;
|
|
993
|
+
isAllowSyntheticDefaultImports: boolean;
|
|
994
|
+
options?: GlobalMockOptions;
|
|
1008
995
|
}) => string;
|
|
1009
996
|
type GeneratorApiBuilder = GeneratorApiOperations & {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
997
|
+
title: GeneratorClientTitle;
|
|
998
|
+
header: GeneratorClientHeader;
|
|
999
|
+
footer: GeneratorClientFooter;
|
|
1000
|
+
imports: GeneratorClientImports;
|
|
1001
|
+
importsMock: GenerateMockImports;
|
|
1002
|
+
extraFiles: ClientFileBuilder[];
|
|
1016
1003
|
};
|
|
1017
1004
|
interface SchemaWithConst extends SchemaObject {
|
|
1018
|
-
|
|
1005
|
+
const: string;
|
|
1019
1006
|
}
|
|
1020
|
-
|
|
1007
|
+
declare class ErrorWithTag extends Error {
|
|
1008
|
+
tag: string;
|
|
1009
|
+
constructor(message: string, tag: string, options?: ErrorOptions);
|
|
1010
|
+
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region src/constants.d.ts
|
|
1021
1013
|
declare const generalJSTypes: string[];
|
|
1022
1014
|
declare const generalJSTypesWithArray: string[];
|
|
1023
1015
|
declare const VERBS_WITH_BODY: Verbs[];
|
|
1024
1016
|
declare const URL_REGEX: RegExp;
|
|
1025
1017
|
declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
1026
|
-
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region src/generators/component-definition.d.ts
|
|
1027
1020
|
declare const generateComponentDefinition: (responses: ComponentsObject["responses"] | ComponentsObject["requestBodies"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1021
|
+
//#endregion
|
|
1022
|
+
//#region src/generators/imports.d.ts
|
|
1023
|
+
declare const generateImports: ({
|
|
1024
|
+
imports,
|
|
1025
|
+
target,
|
|
1026
|
+
isRootKey,
|
|
1027
|
+
specsName,
|
|
1028
|
+
specKey: currentSpecKey,
|
|
1029
|
+
namingConvention
|
|
1030
|
+
}: {
|
|
1031
|
+
imports: GeneratorImport[];
|
|
1032
|
+
target: string;
|
|
1033
|
+
isRootKey: boolean;
|
|
1034
|
+
specsName: Record<string, string>;
|
|
1035
|
+
specKey: string;
|
|
1036
|
+
namingConvention?: NamingConvention;
|
|
1036
1037
|
}) => string;
|
|
1037
|
-
declare const generateMutatorImports: ({
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1038
|
+
declare const generateMutatorImports: ({
|
|
1039
|
+
mutators,
|
|
1040
|
+
implementation,
|
|
1041
|
+
oneMore
|
|
1042
|
+
}: {
|
|
1043
|
+
mutators: GeneratorMutator[];
|
|
1044
|
+
implementation?: string;
|
|
1045
|
+
oneMore?: boolean;
|
|
1041
1046
|
}) => string;
|
|
1042
|
-
declare const addDependency: ({
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1047
|
+
declare const addDependency: ({
|
|
1048
|
+
implementation,
|
|
1049
|
+
exports,
|
|
1050
|
+
dependency,
|
|
1051
|
+
specsName,
|
|
1052
|
+
hasSchemaDir,
|
|
1053
|
+
isAllowSyntheticDefaultImports
|
|
1054
|
+
}: {
|
|
1055
|
+
implementation: string;
|
|
1056
|
+
exports: GeneratorImport[];
|
|
1057
|
+
dependency: string;
|
|
1058
|
+
specsName: Record<string, string>;
|
|
1059
|
+
hasSchemaDir: boolean;
|
|
1060
|
+
isAllowSyntheticDefaultImports: boolean;
|
|
1049
1061
|
}) => string | undefined;
|
|
1050
1062
|
declare const generateDependencyImports: (implementation: string, imports: {
|
|
1051
|
-
|
|
1052
|
-
|
|
1063
|
+
exports: GeneratorImport[];
|
|
1064
|
+
dependency: string;
|
|
1053
1065
|
}[], specsName: Record<string, string>, hasSchemaDir: boolean, isAllowSyntheticDefaultImports: boolean) => string;
|
|
1054
|
-
declare const generateVerbImports: ({
|
|
1055
|
-
|
|
1066
|
+
declare const generateVerbImports: ({
|
|
1067
|
+
response,
|
|
1068
|
+
body,
|
|
1069
|
+
queryParams,
|
|
1070
|
+
props,
|
|
1071
|
+
headers,
|
|
1072
|
+
params
|
|
1073
|
+
}: GeneratorVerbOptions) => GeneratorImport[];
|
|
1074
|
+
//#endregion
|
|
1075
|
+
//#region src/generators/models-inline.d.ts
|
|
1056
1076
|
declare const generateModelInline: (acc: string, model: string) => string;
|
|
1057
1077
|
declare const generateModelsInline: (obj: Record<string, GeneratorSchema[]>) => string;
|
|
1058
|
-
|
|
1078
|
+
//#endregion
|
|
1079
|
+
//#region src/generators/mutator.d.ts
|
|
1059
1080
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
1060
|
-
declare const generateMutator: ({
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1081
|
+
declare const generateMutator: ({
|
|
1082
|
+
output,
|
|
1083
|
+
mutator,
|
|
1084
|
+
name,
|
|
1085
|
+
workspace,
|
|
1086
|
+
tsconfig
|
|
1087
|
+
}: {
|
|
1088
|
+
output?: string;
|
|
1089
|
+
mutator?: NormalizedMutator;
|
|
1090
|
+
name: string;
|
|
1091
|
+
workspace: string;
|
|
1092
|
+
tsconfig?: Tsconfig;
|
|
1066
1093
|
}) => Promise<GeneratorMutator | undefined>;
|
|
1067
|
-
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region src/generators/options.d.ts
|
|
1068
1096
|
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1069
|
-
declare const generateAxiosOptions: ({
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1097
|
+
declare const generateAxiosOptions: ({
|
|
1098
|
+
response,
|
|
1099
|
+
isExactOptionalPropertyTypes,
|
|
1100
|
+
queryParams,
|
|
1101
|
+
headers,
|
|
1102
|
+
requestOptions,
|
|
1103
|
+
hasSignal,
|
|
1104
|
+
isVue,
|
|
1105
|
+
isAngular,
|
|
1106
|
+
paramsSerializer,
|
|
1107
|
+
paramsSerializerOptions
|
|
1108
|
+
}: {
|
|
1109
|
+
response: GetterResponse;
|
|
1110
|
+
isExactOptionalPropertyTypes: boolean;
|
|
1111
|
+
queryParams?: GeneratorSchema;
|
|
1112
|
+
headers?: GeneratorSchema;
|
|
1113
|
+
requestOptions?: object | boolean;
|
|
1114
|
+
hasSignal: boolean;
|
|
1115
|
+
isVue: boolean;
|
|
1116
|
+
isAngular: boolean;
|
|
1117
|
+
paramsSerializer?: GeneratorMutator;
|
|
1118
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1079
1119
|
}) => string;
|
|
1080
|
-
declare const generateOptions: ({
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1120
|
+
declare const generateOptions: ({
|
|
1121
|
+
route,
|
|
1122
|
+
body,
|
|
1123
|
+
headers,
|
|
1124
|
+
queryParams,
|
|
1125
|
+
response,
|
|
1126
|
+
verb,
|
|
1127
|
+
requestOptions,
|
|
1128
|
+
isFormData,
|
|
1129
|
+
isFormUrlEncoded,
|
|
1130
|
+
isAngular,
|
|
1131
|
+
isExactOptionalPropertyTypes,
|
|
1132
|
+
hasSignal,
|
|
1133
|
+
isVue,
|
|
1134
|
+
paramsSerializer,
|
|
1135
|
+
paramsSerializerOptions
|
|
1136
|
+
}: {
|
|
1137
|
+
route: string;
|
|
1138
|
+
body: GetterBody;
|
|
1139
|
+
headers?: GetterQueryParam;
|
|
1140
|
+
queryParams?: GetterQueryParam;
|
|
1141
|
+
response: GetterResponse;
|
|
1142
|
+
verb: Verbs;
|
|
1143
|
+
requestOptions?: object | boolean;
|
|
1144
|
+
isFormData: boolean;
|
|
1145
|
+
isFormUrlEncoded: boolean;
|
|
1146
|
+
isAngular?: boolean;
|
|
1147
|
+
isExactOptionalPropertyTypes: boolean;
|
|
1148
|
+
hasSignal: boolean;
|
|
1149
|
+
isVue?: boolean;
|
|
1150
|
+
paramsSerializer?: GeneratorMutator;
|
|
1151
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1096
1152
|
}) => string;
|
|
1097
1153
|
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1098
1154
|
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
|
-
|
|
1155
|
+
declare const generateMutatorConfig: ({
|
|
1156
|
+
route,
|
|
1157
|
+
body,
|
|
1158
|
+
headers,
|
|
1159
|
+
queryParams,
|
|
1160
|
+
response,
|
|
1161
|
+
verb,
|
|
1162
|
+
isFormData,
|
|
1163
|
+
isFormUrlEncoded,
|
|
1164
|
+
hasSignal,
|
|
1165
|
+
isExactOptionalPropertyTypes,
|
|
1166
|
+
isVue
|
|
1167
|
+
}: {
|
|
1168
|
+
route: string;
|
|
1169
|
+
body: GetterBody;
|
|
1170
|
+
headers?: GetterQueryParam;
|
|
1171
|
+
queryParams?: GetterQueryParam;
|
|
1172
|
+
response: GetterResponse;
|
|
1173
|
+
verb: Verbs;
|
|
1174
|
+
isFormData: boolean;
|
|
1175
|
+
isFormUrlEncoded: boolean;
|
|
1176
|
+
hasSignal: boolean;
|
|
1177
|
+
isExactOptionalPropertyTypes: boolean;
|
|
1178
|
+
isVue?: boolean;
|
|
1111
1179
|
}) => string;
|
|
1112
1180
|
declare const generateMutatorRequestOptions: (requestOptions: boolean | object | undefined, hasSecondArgument: boolean) => string;
|
|
1113
|
-
declare const generateFormDataAndUrlEncodedFunction: ({
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1181
|
+
declare const generateFormDataAndUrlEncodedFunction: ({
|
|
1182
|
+
body,
|
|
1183
|
+
formData,
|
|
1184
|
+
formUrlEncoded,
|
|
1185
|
+
isFormData,
|
|
1186
|
+
isFormUrlEncoded
|
|
1187
|
+
}: {
|
|
1188
|
+
body: GetterBody;
|
|
1189
|
+
formData?: GeneratorMutator;
|
|
1190
|
+
formUrlEncoded?: GeneratorMutator;
|
|
1191
|
+
isFormData: boolean;
|
|
1192
|
+
isFormUrlEncoded: boolean;
|
|
1119
1193
|
}) => string;
|
|
1120
|
-
|
|
1194
|
+
//#endregion
|
|
1195
|
+
//#region src/generators/parameter-definition.d.ts
|
|
1121
1196
|
declare const generateParameterDefinition: (parameters: ComponentsObject["parameters"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
1122
|
-
|
|
1197
|
+
//#endregion
|
|
1198
|
+
//#region src/generators/schema-definition.d.ts
|
|
1123
1199
|
/**
|
|
1124
1200
|
* Extract all types from #/components/schemas
|
|
1125
1201
|
*
|
|
1126
1202
|
* @param schemas
|
|
1127
1203
|
*/
|
|
1128
1204
|
declare const generateSchemasDefinition: (schemas: SchemasObject | undefined, context: ContextSpecs, suffix: string, filters?: InputFiltersOption) => GeneratorSchema[];
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1205
|
+
//#endregion
|
|
1206
|
+
//#region src/generators/verbs-options.d.ts
|
|
1207
|
+
declare const generateVerbsOptions: ({
|
|
1208
|
+
verbs,
|
|
1209
|
+
input,
|
|
1210
|
+
output,
|
|
1211
|
+
route,
|
|
1212
|
+
pathRoute,
|
|
1213
|
+
context
|
|
1214
|
+
}: {
|
|
1215
|
+
verbs: PathItemObject;
|
|
1216
|
+
input: NormalizedInputOptions;
|
|
1217
|
+
output: NormalizedOutputOptions;
|
|
1218
|
+
route: string;
|
|
1219
|
+
pathRoute: string;
|
|
1220
|
+
context: ContextSpecs;
|
|
1137
1221
|
}) => Promise<GeneratorVerbsOptions>;
|
|
1138
1222
|
declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOptions["filters"]) => [string, any][];
|
|
1139
|
-
|
|
1223
|
+
//#endregion
|
|
1224
|
+
//#region src/getters/array.d.ts
|
|
1140
1225
|
/**
|
|
1141
1226
|
* Return the output type from an array
|
|
1142
1227
|
*
|
|
1143
1228
|
* @param item item with type === "array"
|
|
1144
1229
|
*/
|
|
1145
|
-
declare const getArray: ({
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1230
|
+
declare const getArray: ({
|
|
1231
|
+
schema,
|
|
1232
|
+
name,
|
|
1233
|
+
context
|
|
1234
|
+
}: {
|
|
1235
|
+
schema: SchemaObject;
|
|
1236
|
+
name?: string;
|
|
1237
|
+
context: ContextSpecs;
|
|
1149
1238
|
}) => ScalarValue;
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1239
|
+
//#endregion
|
|
1240
|
+
//#region src/getters/body.d.ts
|
|
1241
|
+
declare const getBody: ({
|
|
1242
|
+
requestBody,
|
|
1243
|
+
operationName,
|
|
1244
|
+
context,
|
|
1245
|
+
contentType
|
|
1246
|
+
}: {
|
|
1247
|
+
requestBody: ReferenceObject | RequestBodyObject;
|
|
1248
|
+
operationName: string;
|
|
1249
|
+
context: ContextSpecs;
|
|
1250
|
+
contentType?: OverrideOutputContentType;
|
|
1156
1251
|
}) => GetterBody;
|
|
1157
|
-
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region src/getters/combine.d.ts
|
|
1158
1254
|
type Separator = 'allOf' | 'anyOf' | 'oneOf';
|
|
1159
|
-
declare const combineSchemas: ({
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1255
|
+
declare const combineSchemas: ({
|
|
1256
|
+
name,
|
|
1257
|
+
schema,
|
|
1258
|
+
separator,
|
|
1259
|
+
context,
|
|
1260
|
+
nullable
|
|
1261
|
+
}: {
|
|
1262
|
+
name?: string;
|
|
1263
|
+
schema: SchemaObject;
|
|
1264
|
+
separator: Separator;
|
|
1265
|
+
context: ContextSpecs;
|
|
1266
|
+
nullable: string;
|
|
1165
1267
|
}) => ScalarValue;
|
|
1166
|
-
|
|
1268
|
+
//#endregion
|
|
1269
|
+
//#region src/getters/discriminators.d.ts
|
|
1167
1270
|
declare const resolveDiscriminators: (schemas: SchemasObject, context: ContextSpecs) => SchemasObject;
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
declare const
|
|
1271
|
+
//#endregion
|
|
1272
|
+
//#region src/getters/enum.d.ts
|
|
1273
|
+
declare const getEnumNames: (schemaObject: SchemaObject | undefined) => any;
|
|
1274
|
+
declare const getEnumDescriptions: (schemaObject: SchemaObject | undefined) => any;
|
|
1171
1275
|
declare const getEnum: (value: string, enumName: string, names: string[] | undefined, enumGenerationType: EnumGeneration, descriptions?: string[], enumNamingConvention?: NamingConvention) => string;
|
|
1172
1276
|
declare const getEnumImplementation: (value: string, names?: string[], descriptions?: string[], enumNamingConvention?: NamingConvention) => string;
|
|
1173
|
-
|
|
1277
|
+
//#endregion
|
|
1278
|
+
//#region src/getters/keys.d.ts
|
|
1174
1279
|
declare const getKey: (key: string) => string;
|
|
1175
|
-
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region src/getters/object.d.ts
|
|
1176
1282
|
/**
|
|
1177
1283
|
* Return the output type from an object
|
|
1178
1284
|
*
|
|
1179
1285
|
* @param item item with type === "object"
|
|
1180
1286
|
*/
|
|
1181
|
-
declare const getObject: ({
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1287
|
+
declare const getObject: ({
|
|
1288
|
+
item,
|
|
1289
|
+
name,
|
|
1290
|
+
context,
|
|
1291
|
+
nullable
|
|
1292
|
+
}: {
|
|
1293
|
+
item: SchemaObject;
|
|
1294
|
+
name?: string;
|
|
1295
|
+
context: ContextSpecs;
|
|
1296
|
+
nullable: string;
|
|
1186
1297
|
}) => ScalarValue;
|
|
1187
|
-
|
|
1298
|
+
//#endregion
|
|
1299
|
+
//#region src/getters/operation.d.ts
|
|
1188
1300
|
declare const getOperationId: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1301
|
+
//#endregion
|
|
1302
|
+
//#region src/getters/parameters.d.ts
|
|
1303
|
+
declare const getParameters: ({
|
|
1304
|
+
parameters,
|
|
1305
|
+
context
|
|
1306
|
+
}: {
|
|
1307
|
+
parameters: (ReferenceObject | ParameterObject)[];
|
|
1308
|
+
context: ContextSpecs;
|
|
1193
1309
|
}) => GetterParameters;
|
|
1194
|
-
|
|
1310
|
+
//#endregion
|
|
1311
|
+
//#region src/getters/params.d.ts
|
|
1195
1312
|
/**
|
|
1196
1313
|
* Return every params in a path
|
|
1197
1314
|
*
|
|
@@ -1203,43 +1320,64 @@ declare const getParameters: ({ parameters, context, }: {
|
|
|
1203
1320
|
* @param path
|
|
1204
1321
|
*/
|
|
1205
1322
|
declare const getParamsInPath: (path: string) => string[];
|
|
1206
|
-
declare const getParams: ({
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1323
|
+
declare const getParams: ({
|
|
1324
|
+
route,
|
|
1325
|
+
pathParams,
|
|
1326
|
+
operationId,
|
|
1327
|
+
context,
|
|
1328
|
+
output
|
|
1329
|
+
}: {
|
|
1330
|
+
route: string;
|
|
1331
|
+
pathParams?: GetterParameters["query"];
|
|
1332
|
+
operationId: string;
|
|
1333
|
+
context: ContextSpecs;
|
|
1334
|
+
output: NormalizedOutputOptions;
|
|
1212
1335
|
}) => GetterParams;
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1336
|
+
//#endregion
|
|
1337
|
+
//#region src/getters/props.d.ts
|
|
1338
|
+
declare const getProps: ({
|
|
1339
|
+
body,
|
|
1340
|
+
queryParams,
|
|
1341
|
+
params,
|
|
1342
|
+
operationName,
|
|
1343
|
+
headers,
|
|
1344
|
+
context
|
|
1345
|
+
}: {
|
|
1346
|
+
body: GetterBody;
|
|
1347
|
+
queryParams?: GetterQueryParam;
|
|
1348
|
+
params: GetterParams;
|
|
1349
|
+
operationName: string;
|
|
1350
|
+
headers?: GetterQueryParam;
|
|
1351
|
+
context: ContextSpecs;
|
|
1221
1352
|
}) => GetterProps;
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1353
|
+
//#endregion
|
|
1354
|
+
//#region src/getters/query-params.d.ts
|
|
1355
|
+
declare const getQueryParams: ({
|
|
1356
|
+
queryParams,
|
|
1357
|
+
operationName,
|
|
1358
|
+
context,
|
|
1359
|
+
suffix
|
|
1360
|
+
}: {
|
|
1361
|
+
queryParams: GetterParameters["query"];
|
|
1362
|
+
operationName: string;
|
|
1363
|
+
context: ContextSpecs;
|
|
1364
|
+
suffix?: string;
|
|
1228
1365
|
}) => GetterQueryParam | undefined;
|
|
1229
|
-
|
|
1366
|
+
//#endregion
|
|
1367
|
+
//#region src/getters/ref.d.ts
|
|
1230
1368
|
type RefComponent = 'schemas' | 'responses' | 'parameters' | 'requestBodies';
|
|
1231
1369
|
declare const RefComponent: {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1370
|
+
schemas: RefComponent;
|
|
1371
|
+
responses: RefComponent;
|
|
1372
|
+
parameters: RefComponent;
|
|
1373
|
+
requestBodies: RefComponent;
|
|
1236
1374
|
};
|
|
1237
1375
|
declare const RefComponentSuffix: Record<RefComponent, string>;
|
|
1238
1376
|
interface RefInfo {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1377
|
+
name: string;
|
|
1378
|
+
originalName: string;
|
|
1379
|
+
refPaths?: string[];
|
|
1380
|
+
specKey?: string;
|
|
1243
1381
|
}
|
|
1244
1382
|
/**
|
|
1245
1383
|
* Return the output type from the $ref
|
|
@@ -1247,54 +1385,80 @@ interface RefInfo {
|
|
|
1247
1385
|
* @param $ref
|
|
1248
1386
|
*/
|
|
1249
1387
|
declare const getRefInfo: ($ref: ReferenceObject["$ref"], context: ContextSpecs) => RefInfo;
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/getters/res-req-types.d.ts
|
|
1390
|
+
declare const getResReqTypes: (responsesOrRequests: [string, ResponseObject | ReferenceObject | RequestBodyObject][], name: string, context: ContextSpecs, defaultType?: string, uniqueKey?: ValueIteratee<ResReqTypesValue>) => ResReqTypesValue[];
|
|
1391
|
+
//#endregion
|
|
1392
|
+
//#region src/getters/response.d.ts
|
|
1393
|
+
declare const getResponse: ({
|
|
1394
|
+
responses,
|
|
1395
|
+
operationName,
|
|
1396
|
+
context,
|
|
1397
|
+
contentType
|
|
1398
|
+
}: {
|
|
1399
|
+
responses: ResponsesObject;
|
|
1400
|
+
operationName: string;
|
|
1401
|
+
context: ContextSpecs;
|
|
1402
|
+
contentType?: OverrideOutputContentType;
|
|
1258
1403
|
}) => GetterResponse;
|
|
1259
|
-
|
|
1404
|
+
//#endregion
|
|
1405
|
+
//#region src/getters/route.d.ts
|
|
1260
1406
|
declare const getRoute: (route: string) => string;
|
|
1261
1407
|
declare const getFullRoute: (route: string, servers: ServerObject[] | undefined, baseUrl: string | BaseUrlFromConstant | BaseUrlFromSpec | undefined) => string;
|
|
1262
1408
|
declare const getRouteAsArray: (route: string) => string;
|
|
1263
|
-
|
|
1409
|
+
//#endregion
|
|
1410
|
+
//#region src/getters/scalar.d.ts
|
|
1264
1411
|
/**
|
|
1265
1412
|
* Return the typescript equivalent of open-api data type
|
|
1266
1413
|
*
|
|
1267
1414
|
* @param item
|
|
1268
1415
|
* @ref https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#data-types
|
|
1269
1416
|
*/
|
|
1270
|
-
declare const getScalar: ({
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1417
|
+
declare const getScalar: ({
|
|
1418
|
+
item,
|
|
1419
|
+
name,
|
|
1420
|
+
context
|
|
1421
|
+
}: {
|
|
1422
|
+
item: SchemaObject;
|
|
1423
|
+
name?: string;
|
|
1424
|
+
context: ContextSpecs;
|
|
1274
1425
|
}) => ScalarValue;
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1426
|
+
//#endregion
|
|
1427
|
+
//#region src/resolvers/object.d.ts
|
|
1428
|
+
declare const resolveObject: ({
|
|
1429
|
+
schema,
|
|
1430
|
+
propName,
|
|
1431
|
+
combined,
|
|
1432
|
+
context
|
|
1433
|
+
}: {
|
|
1434
|
+
schema: SchemaObject | ReferenceObject;
|
|
1435
|
+
propName?: string;
|
|
1436
|
+
combined?: boolean;
|
|
1437
|
+
context: ContextSpecs;
|
|
1281
1438
|
}) => ResolverValue;
|
|
1282
|
-
|
|
1439
|
+
//#endregion
|
|
1440
|
+
//#region src/resolvers/ref.d.ts
|
|
1283
1441
|
type ComponentObject = SchemaObject | ResponseObject | ParameterObject | RequestBodyObject | ReferenceObject;
|
|
1284
1442
|
declare const resolveRef: <Schema extends ComponentObject = ComponentObject>(schema: ComponentObject, context: ContextSpecs, imports?: GeneratorImport[]) => {
|
|
1285
|
-
|
|
1286
|
-
|
|
1443
|
+
schema: Schema;
|
|
1444
|
+
imports: GeneratorImport[];
|
|
1287
1445
|
};
|
|
1288
1446
|
type Example = ExampleObject | ReferenceObject;
|
|
1289
1447
|
type Examples = Example[] | Record<string, Example> | undefined;
|
|
1290
1448
|
declare const resolveExampleRefs: (examples: Examples, context: ContextSpecs) => Examples;
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1449
|
+
//#endregion
|
|
1450
|
+
//#region src/resolvers/value.d.ts
|
|
1451
|
+
declare const resolveValue: ({
|
|
1452
|
+
schema,
|
|
1453
|
+
name,
|
|
1454
|
+
context
|
|
1455
|
+
}: {
|
|
1456
|
+
schema: SchemaObject | ReferenceObject;
|
|
1457
|
+
name?: string;
|
|
1458
|
+
context: ContextSpecs;
|
|
1296
1459
|
}) => ResolverValue;
|
|
1297
|
-
|
|
1460
|
+
//#endregion
|
|
1461
|
+
//#region src/utils/assertion.d.ts
|
|
1298
1462
|
/**
|
|
1299
1463
|
* Discriminator helper for `ReferenceObject`
|
|
1300
1464
|
*
|
|
@@ -1313,177 +1477,180 @@ declare function isUndefined(x: any): x is undefined;
|
|
|
1313
1477
|
declare function isNull(x: any): x is null;
|
|
1314
1478
|
declare function isSchema(x: any): x is SchemaObject;
|
|
1315
1479
|
declare const isVerb: (verb: string) => verb is Verbs;
|
|
1316
|
-
declare const isRootKey: (specKey: string, target: string) => boolean;
|
|
1480
|
+
declare const isRootKey$1: (specKey: string, target: string) => boolean;
|
|
1317
1481
|
declare const isUrl: (str: string) => boolean;
|
|
1318
|
-
|
|
1482
|
+
//#endregion
|
|
1483
|
+
//#region src/utils/async-reduce.d.ts
|
|
1319
1484
|
declare function asyncReduce<IterationItem, AccValue>(array: IterationItem[], reducer: (accumulate: AccValue, current: IterationItem) => AccValue | Promise<AccValue>, initValue: AccValue): Promise<AccValue>;
|
|
1320
|
-
|
|
1485
|
+
//#endregion
|
|
1486
|
+
//#region src/utils/case.d.ts
|
|
1321
1487
|
declare const pascal: (s: string) => string;
|
|
1322
1488
|
declare const camel: (s: string) => string;
|
|
1323
1489
|
declare const snake: (s: string) => string;
|
|
1324
1490
|
declare const kebab: (s: string) => string;
|
|
1325
1491
|
declare const upper: (s: string, fillWith: string, isDeapostrophe?: boolean) => string;
|
|
1326
1492
|
declare const conventionName: (name: string, convention: NamingConvention) => string;
|
|
1327
|
-
|
|
1493
|
+
//#endregion
|
|
1494
|
+
//#region src/utils/compare-version.d.ts
|
|
1328
1495
|
declare const compareVersions: (firstVersion: string, secondVersions: string, operator?: CompareOperator) => boolean;
|
|
1329
|
-
|
|
1496
|
+
//#endregion
|
|
1497
|
+
//#region src/utils/debug.d.ts
|
|
1330
1498
|
interface DebuggerOptions {
|
|
1331
|
-
|
|
1499
|
+
onlyWhenFocused?: boolean | string;
|
|
1332
1500
|
}
|
|
1333
1501
|
declare function createDebugger(ns: string, options?: DebuggerOptions): debug.Debugger['log'];
|
|
1334
|
-
|
|
1502
|
+
//#endregion
|
|
1503
|
+
//#region src/utils/deep-non-nullable.d.ts
|
|
1504
|
+
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>;
|
|
1505
|
+
//#endregion
|
|
1506
|
+
//#region src/utils/doc.d.ts
|
|
1335
1507
|
declare function jsDoc(schema: {
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1508
|
+
description?: string[] | string;
|
|
1509
|
+
deprecated?: boolean;
|
|
1510
|
+
summary?: string;
|
|
1511
|
+
minLength?: number;
|
|
1512
|
+
maxLength?: number;
|
|
1513
|
+
minimum?: number;
|
|
1514
|
+
maximum?: number;
|
|
1515
|
+
exclusiveMinimum?: boolean;
|
|
1516
|
+
exclusiveMaximum?: boolean;
|
|
1517
|
+
minItems?: number;
|
|
1518
|
+
maxItems?: number;
|
|
1519
|
+
nullable?: boolean;
|
|
1520
|
+
pattern?: string;
|
|
1349
1521
|
}, tryOneLine?: boolean, context?: ContextSpecs): string;
|
|
1350
1522
|
declare function keyValuePairsToJsDoc(keyValues: {
|
|
1351
|
-
|
|
1352
|
-
|
|
1523
|
+
key: string;
|
|
1524
|
+
value: string;
|
|
1353
1525
|
}[]): string;
|
|
1354
|
-
|
|
1526
|
+
//#endregion
|
|
1527
|
+
//#region src/utils/dynamic-import.d.ts
|
|
1355
1528
|
declare const dynamicImport: <T>(toImport: T | string, from?: string, takeDefault?: boolean) => Promise<T>;
|
|
1356
|
-
|
|
1529
|
+
//#endregion
|
|
1530
|
+
//#region src/utils/extension.d.ts
|
|
1357
1531
|
declare const getExtension: (path: string) => "yaml" | "json";
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1532
|
+
//#endregion
|
|
1533
|
+
//#region src/utils/logger.d.ts
|
|
1534
|
+
declare const log: (message?: any, ...optionalParams: any[]) => void;
|
|
1535
|
+
declare const startMessage: ({
|
|
1536
|
+
name,
|
|
1537
|
+
version,
|
|
1538
|
+
description
|
|
1539
|
+
}: {
|
|
1540
|
+
name: string;
|
|
1541
|
+
version: string;
|
|
1542
|
+
description: string;
|
|
1543
|
+
}) => string;
|
|
1368
1544
|
declare const logError: (err: unknown, tag?: string) => void;
|
|
1369
1545
|
declare const mismatchArgsMessage: (mismatchArgs: string[]) => void;
|
|
1370
1546
|
declare const createSuccessMessage: (backend?: string) => void;
|
|
1371
1547
|
declare const ibmOpenapiValidatorWarnings: (warnings: {
|
|
1372
|
-
|
|
1373
|
-
|
|
1548
|
+
path: string[];
|
|
1549
|
+
message: string;
|
|
1374
1550
|
}[]) => void;
|
|
1375
1551
|
declare const ibmOpenapiValidatorErrors: (errors: {
|
|
1376
|
-
|
|
1377
|
-
|
|
1552
|
+
path: string[];
|
|
1553
|
+
message: string;
|
|
1378
1554
|
}[]) => void;
|
|
1379
1555
|
type LogType = 'error' | 'warn' | 'info';
|
|
1380
1556
|
type LogLevel = LogType | 'silent';
|
|
1381
1557
|
interface Logger {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1558
|
+
info(msg: string, options?: LogOptions): void;
|
|
1559
|
+
warn(msg: string, options?: LogOptions): void;
|
|
1560
|
+
warnOnce(msg: string, options?: LogOptions): void;
|
|
1561
|
+
error(msg: string, options?: LogOptions): void;
|
|
1562
|
+
clearScreen(type: LogType): void;
|
|
1563
|
+
hasWarned: boolean;
|
|
1388
1564
|
}
|
|
1389
1565
|
interface LogOptions {
|
|
1390
|
-
|
|
1391
|
-
|
|
1566
|
+
clear?: boolean;
|
|
1567
|
+
timestamp?: boolean;
|
|
1392
1568
|
}
|
|
1393
1569
|
declare const LogLevels: Record<LogLevel, number>;
|
|
1394
1570
|
interface LoggerOptions {
|
|
1395
|
-
|
|
1396
|
-
|
|
1571
|
+
prefix?: string;
|
|
1572
|
+
allowClearScreen?: boolean;
|
|
1397
1573
|
}
|
|
1398
1574
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1575
|
+
//#endregion
|
|
1576
|
+
//#region src/utils/file.d.ts
|
|
1577
|
+
declare const getFileInfo: (target?: string, {
|
|
1578
|
+
backupFilename,
|
|
1579
|
+
extension
|
|
1580
|
+
}?: {
|
|
1581
|
+
backupFilename?: string;
|
|
1582
|
+
extension?: string;
|
|
1403
1583
|
}) => {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1584
|
+
path: string;
|
|
1585
|
+
pathWithoutExtension: string;
|
|
1586
|
+
extension: string;
|
|
1587
|
+
isDirectory: boolean;
|
|
1588
|
+
dirname: string;
|
|
1589
|
+
filename: string;
|
|
1410
1590
|
};
|
|
1411
1591
|
declare function loadFile<File = any>(filePath?: string, options?: {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1592
|
+
root?: string;
|
|
1593
|
+
defaultFileName?: string;
|
|
1594
|
+
logLevel?: LogLevel;
|
|
1595
|
+
isDefault?: boolean;
|
|
1596
|
+
alias?: Record<string, string>;
|
|
1597
|
+
tsconfig?: Tsconfig;
|
|
1598
|
+
load?: boolean;
|
|
1419
1599
|
}): Promise<{
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1600
|
+
path: string;
|
|
1601
|
+
file?: File;
|
|
1602
|
+
error?: any;
|
|
1603
|
+
cached?: boolean;
|
|
1424
1604
|
}>;
|
|
1425
|
-
declare function
|
|
1426
|
-
|
|
1605
|
+
declare function removeFilesAndEmptyFolders(patterns: string[], dir: string): Promise<void>;
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region src/utils/file-extensions.d.ts
|
|
1427
1608
|
declare const getMockFileExtensionByTypeName: (mock: GlobalMockOptions | ClientMockBuilder) => string;
|
|
1428
|
-
|
|
1609
|
+
//#endregion
|
|
1610
|
+
//#region src/utils/is-body-verb.d.ts
|
|
1611
|
+
declare const getIsBodyVerb: (verb: Verbs) => boolean;
|
|
1612
|
+
//#endregion
|
|
1613
|
+
//#region src/utils/merge-deep.d.ts
|
|
1429
1614
|
declare function mergeDeep<T extends Record<string, any>, U extends Record<string, any>>(source: T, target: U): T & U;
|
|
1430
|
-
|
|
1615
|
+
//#endregion
|
|
1616
|
+
//#region src/utils/occurrence.d.ts
|
|
1431
1617
|
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
|
-
|
|
1618
|
+
//#endregion
|
|
1619
|
+
//#region src/utils/open-api-converter.d.ts
|
|
1620
|
+
declare const openApiConverter: (schema: any, options: Partial<ConvertInputOptions> | undefined, specKey: string) => Promise<OpenAPIObject>;
|
|
1621
|
+
declare namespace path_d_exports {
|
|
1622
|
+
export { basename, dirname, extname, getSchemaFileName, getSpecName, isAbsolute, join, joinSafe, normalizeSafe, relativeSafe, resolve, separator$1 as separator };
|
|
1623
|
+
}
|
|
1624
|
+
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
1625
|
/**
|
|
1443
1626
|
* Behaves exactly like `path.relative(from, to)`, but keeps the first meaningful "./"
|
|
1444
1627
|
*/
|
|
1445
1628
|
declare const relativeSafe: (from: string, to: string) => string;
|
|
1446
1629
|
declare const getSpecName: (specKey: string, target: string) => string;
|
|
1447
1630
|
declare const getSchemaFileName: (path: string) => string;
|
|
1448
|
-
declare const separator = "/";
|
|
1631
|
+
declare const separator$1 = "/";
|
|
1449
1632
|
declare const normalizeSafe: (value: string) => string;
|
|
1450
1633
|
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
|
-
|
|
1634
|
+
//#endregion
|
|
1635
|
+
//#region src/utils/sort.d.ts
|
|
1468
1636
|
declare const sortByPriority: <T>(arr: (T & {
|
|
1469
|
-
|
|
1470
|
-
|
|
1637
|
+
default?: boolean;
|
|
1638
|
+
required?: boolean;
|
|
1471
1639
|
})[]) => (T & {
|
|
1472
|
-
|
|
1473
|
-
|
|
1640
|
+
default?: boolean;
|
|
1641
|
+
required?: boolean;
|
|
1474
1642
|
})[];
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
}) => string | undefined;
|
|
1643
|
+
//#endregion
|
|
1644
|
+
//#region src/utils/string.d.ts
|
|
1645
|
+
declare const stringify: (data?: string | any[] | Record<string, any>) => string | undefined;
|
|
1479
1646
|
declare const sanitize: (value: string, options?: {
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1647
|
+
whitespace?: string | true;
|
|
1648
|
+
underscore?: string | true;
|
|
1649
|
+
dot?: string | true;
|
|
1650
|
+
dash?: string | true;
|
|
1651
|
+
es5keyword?: boolean;
|
|
1652
|
+
es5IdentifierName?: boolean;
|
|
1653
|
+
special?: boolean;
|
|
1487
1654
|
}) => string;
|
|
1488
1655
|
declare const toObjectString: <T>(props: T[], path?: keyof T) => string;
|
|
1489
1656
|
declare const getNumberWord: (num: number) => string;
|
|
@@ -1498,57 +1665,111 @@ declare const escape: (str: string | null, char?: string) => string | undefined;
|
|
|
1498
1665
|
* @param input String to escape
|
|
1499
1666
|
*/
|
|
1500
1667
|
declare const jsStringEscape: (input: string) => string;
|
|
1501
|
-
|
|
1668
|
+
//#endregion
|
|
1669
|
+
//#region src/utils/tsconfig.d.ts
|
|
1502
1670
|
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
1503
|
-
|
|
1671
|
+
//#endregion
|
|
1672
|
+
//#region src/utils/validator.d.ts
|
|
1504
1673
|
/**
|
|
1505
1674
|
* Validate the spec with ibm-openapi-validator (with a custom pretty logger).
|
|
1506
1675
|
* More information: https://github.com/IBM/openapi-validator/#configuration
|
|
1507
1676
|
* @param specs openAPI spec
|
|
1508
1677
|
*/
|
|
1509
1678
|
declare const ibmOpenapiValidator: (specs: OpenAPIObject, validation: boolean | object) => Promise<void>;
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1679
|
+
//#endregion
|
|
1680
|
+
//#region src/writers/schemas.d.ts
|
|
1513
1681
|
declare const writeModelInline: (acc: string, model: string) => string;
|
|
1514
1682
|
declare const writeModelsInline: (array: GeneratorSchema[]) => string;
|
|
1515
|
-
declare const writeSchema: ({
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1683
|
+
declare const writeSchema: ({
|
|
1684
|
+
path,
|
|
1685
|
+
schema,
|
|
1686
|
+
target,
|
|
1687
|
+
namingConvention,
|
|
1688
|
+
fileExtension,
|
|
1689
|
+
specKey,
|
|
1690
|
+
isRootKey,
|
|
1691
|
+
specsName,
|
|
1692
|
+
header
|
|
1693
|
+
}: {
|
|
1694
|
+
path: string;
|
|
1695
|
+
schema: GeneratorSchema;
|
|
1696
|
+
target: string;
|
|
1697
|
+
namingConvention: NamingConvention;
|
|
1698
|
+
fileExtension: string;
|
|
1699
|
+
specKey: string;
|
|
1700
|
+
isRootKey: boolean;
|
|
1701
|
+
specsName: Record<string, string>;
|
|
1702
|
+
header: string;
|
|
1525
1703
|
}) => Promise<void>;
|
|
1526
|
-
declare const writeSchemas: ({
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1704
|
+
declare const writeSchemas: ({
|
|
1705
|
+
schemaPath,
|
|
1706
|
+
schemas,
|
|
1707
|
+
target,
|
|
1708
|
+
namingConvention,
|
|
1709
|
+
fileExtension,
|
|
1710
|
+
specKey,
|
|
1711
|
+
isRootKey,
|
|
1712
|
+
specsName,
|
|
1713
|
+
header,
|
|
1714
|
+
indexFiles
|
|
1715
|
+
}: {
|
|
1716
|
+
schemaPath: string;
|
|
1717
|
+
schemas: GeneratorSchema[];
|
|
1718
|
+
target: string;
|
|
1719
|
+
namingConvention: NamingConvention;
|
|
1720
|
+
fileExtension: string;
|
|
1721
|
+
specKey: string;
|
|
1722
|
+
isRootKey: boolean;
|
|
1723
|
+
specsName: Record<string, string>;
|
|
1724
|
+
header: string;
|
|
1725
|
+
indexFiles: boolean;
|
|
1537
1726
|
}) => Promise<void>;
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
declare const
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1727
|
+
//#endregion
|
|
1728
|
+
//#region src/writers/single-mode.d.ts
|
|
1729
|
+
declare const writeSingleMode: ({
|
|
1730
|
+
builder,
|
|
1731
|
+
output,
|
|
1732
|
+
specsName,
|
|
1733
|
+
header,
|
|
1734
|
+
needSchema
|
|
1735
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1736
|
+
//#endregion
|
|
1737
|
+
//#region src/writers/split-mode.d.ts
|
|
1738
|
+
declare const writeSplitMode: ({
|
|
1739
|
+
builder,
|
|
1740
|
+
output,
|
|
1741
|
+
specsName,
|
|
1742
|
+
header,
|
|
1743
|
+
needSchema
|
|
1744
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1745
|
+
//#endregion
|
|
1746
|
+
//#region src/writers/split-tags-mode.d.ts
|
|
1747
|
+
declare const writeSplitTagsMode: ({
|
|
1748
|
+
builder,
|
|
1749
|
+
output,
|
|
1750
|
+
specsName,
|
|
1751
|
+
header,
|
|
1752
|
+
needSchema
|
|
1753
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1754
|
+
//#endregion
|
|
1755
|
+
//#region src/writers/tags-mode.d.ts
|
|
1756
|
+
declare const writeTagsMode: ({
|
|
1757
|
+
builder,
|
|
1758
|
+
output,
|
|
1759
|
+
specsName,
|
|
1760
|
+
header,
|
|
1761
|
+
needSchema
|
|
1762
|
+
}: WriteModeProps) => Promise<string[]>;
|
|
1763
|
+
//#endregion
|
|
1764
|
+
//#region src/writers/target.d.ts
|
|
1550
1765
|
declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => GeneratorTarget;
|
|
1551
|
-
|
|
1766
|
+
//#endregion
|
|
1767
|
+
//#region src/writers/target-tags.d.ts
|
|
1552
1768
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1553
|
-
|
|
1554
|
-
|
|
1769
|
+
//#endregion
|
|
1770
|
+
//#region src/writers/types.d.ts
|
|
1771
|
+
declare const getOrvalGeneratedTypes: () => string;
|
|
1772
|
+
declare const getTypedResponse: () => string;
|
|
1773
|
+
//#endregion
|
|
1774
|
+
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 };
|
|
1775
|
+
//# sourceMappingURL=index.d.ts.map
|