orval 6.10.3 → 6.11.0-alpha.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/bin/orval.js +1 -1
- package/dist/chunk-ZDK7MU3F.js +15 -0
- package/dist/index.d.ts +3 -605
- package/dist/index.js +1 -1
- package/package.json +19 -70
- package/LICENSE +0 -21
- package/dist/chunk-PMC5SXPB.js +0 -352
package/dist/index.d.ts
CHANGED
|
@@ -1,505 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import swagger2openapi from 'swagger2openapi';
|
|
4
|
-
|
|
5
|
-
declare type ResolverValue = {
|
|
6
|
-
value: string;
|
|
7
|
-
isEnum: boolean;
|
|
8
|
-
type: string;
|
|
9
|
-
imports: GeneratorImport[];
|
|
10
|
-
schemas: GeneratorSchema[];
|
|
11
|
-
originalSchema?: SchemaObject;
|
|
12
|
-
isRef: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare type ResReqTypesValue = ResolverValue & {
|
|
15
|
-
formData?: string;
|
|
16
|
-
formUrlEncoded?: string;
|
|
17
|
-
isRef?: boolean;
|
|
18
|
-
key: string;
|
|
19
|
-
contentType: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
declare type GetterResponse = {
|
|
23
|
-
imports: GeneratorImport[];
|
|
24
|
-
definition: {
|
|
25
|
-
success: string;
|
|
26
|
-
errors: string;
|
|
27
|
-
};
|
|
28
|
-
isBlob: boolean;
|
|
29
|
-
types: {
|
|
30
|
-
success: ResReqTypesValue[];
|
|
31
|
-
errors: ResReqTypesValue[];
|
|
32
|
-
};
|
|
33
|
-
contentTypes: string[];
|
|
34
|
-
schemas: GeneratorSchema[];
|
|
35
|
-
};
|
|
36
|
-
declare type GetterBody = {
|
|
37
|
-
imports: GeneratorImport[];
|
|
38
|
-
definition: string;
|
|
39
|
-
implementation: string;
|
|
40
|
-
schemas: GeneratorSchema[];
|
|
41
|
-
formData?: string;
|
|
42
|
-
formUrlEncoded?: string;
|
|
43
|
-
contentType: string;
|
|
44
|
-
};
|
|
45
|
-
declare type GetterParam = {
|
|
46
|
-
name: string;
|
|
47
|
-
definition: string;
|
|
48
|
-
implementation: string;
|
|
49
|
-
default: boolean;
|
|
50
|
-
required: boolean;
|
|
51
|
-
imports: GeneratorImport[];
|
|
52
|
-
};
|
|
53
|
-
declare type GetterParams = GetterParam[];
|
|
54
|
-
declare type GetterQueryParam = {
|
|
55
|
-
schema: GeneratorSchema;
|
|
56
|
-
deps: GeneratorSchema[];
|
|
57
|
-
isOptional: boolean;
|
|
58
|
-
};
|
|
59
|
-
declare type GetterPropType = 'param' | 'body' | 'queryParam' | 'header';
|
|
60
|
-
declare const GetterPropType: {
|
|
61
|
-
PARAM: GetterPropType;
|
|
62
|
-
BODY: GetterPropType;
|
|
63
|
-
QUERY_PARAM: GetterPropType;
|
|
64
|
-
HEADER: GetterPropType;
|
|
65
|
-
};
|
|
66
|
-
declare type GetterProp = {
|
|
67
|
-
name: string;
|
|
68
|
-
definition: string;
|
|
69
|
-
implementation: string;
|
|
70
|
-
default: boolean;
|
|
71
|
-
required: boolean;
|
|
72
|
-
type: GetterPropType;
|
|
73
|
-
};
|
|
74
|
-
declare type GetterProps = GetterProp[];
|
|
75
|
-
|
|
76
|
-
declare type GeneratorSchema = {
|
|
77
|
-
name: string;
|
|
78
|
-
model: string;
|
|
79
|
-
imports: GeneratorImport[];
|
|
80
|
-
};
|
|
81
|
-
declare type GeneratorImport = {
|
|
82
|
-
name: string;
|
|
83
|
-
schemaName?: string;
|
|
84
|
-
alias?: string;
|
|
85
|
-
specKey?: string;
|
|
86
|
-
default?: boolean;
|
|
87
|
-
values?: boolean;
|
|
88
|
-
syntheticDefaultImport?: boolean;
|
|
89
|
-
};
|
|
90
|
-
declare type GeneratorDependency = {
|
|
91
|
-
exports: GeneratorImport[];
|
|
92
|
-
dependency: string;
|
|
93
|
-
};
|
|
94
|
-
declare type GeneratorApiResponse = {
|
|
95
|
-
operations: GeneratorOperations;
|
|
96
|
-
schemas: GeneratorSchema[];
|
|
97
|
-
};
|
|
98
|
-
declare type GeneratorOperations = {
|
|
99
|
-
[operationId: string]: GeneratorOperation;
|
|
100
|
-
};
|
|
101
|
-
declare type GeneratorTarget = {
|
|
102
|
-
imports: GeneratorImport[];
|
|
103
|
-
implementation: string;
|
|
104
|
-
implementationMSW: string;
|
|
105
|
-
importsMSW: GeneratorImport[];
|
|
106
|
-
mutators?: GeneratorMutator[];
|
|
107
|
-
formData?: GeneratorMutator[];
|
|
108
|
-
formUrlEncoded?: GeneratorMutator[];
|
|
109
|
-
};
|
|
110
|
-
declare type GeneratorTargetFull = {
|
|
111
|
-
imports: GeneratorImport[];
|
|
112
|
-
implementation: string;
|
|
113
|
-
implementationMSW: {
|
|
114
|
-
function: string;
|
|
115
|
-
handler: string;
|
|
116
|
-
};
|
|
117
|
-
importsMSW: GeneratorImport[];
|
|
118
|
-
mutators?: GeneratorMutator[];
|
|
119
|
-
formData?: GeneratorMutator[];
|
|
120
|
-
formUrlEncoded?: GeneratorMutator[];
|
|
121
|
-
};
|
|
122
|
-
declare type GeneratorOperation = {
|
|
123
|
-
imports: GeneratorImport[];
|
|
124
|
-
implementation: string;
|
|
125
|
-
implementationMSW: {
|
|
126
|
-
function: string;
|
|
127
|
-
handler: string;
|
|
128
|
-
};
|
|
129
|
-
importsMSW: GeneratorImport[];
|
|
130
|
-
tags: string[];
|
|
131
|
-
mutator?: GeneratorMutator;
|
|
132
|
-
formData?: GeneratorMutator;
|
|
133
|
-
formUrlEncoded?: GeneratorMutator;
|
|
134
|
-
operationName: string;
|
|
135
|
-
types?: {
|
|
136
|
-
result: (title?: string) => string;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
declare type GeneratorVerbOptions = {
|
|
140
|
-
verb: Verbs;
|
|
141
|
-
summary?: string;
|
|
142
|
-
doc: string;
|
|
143
|
-
tags: string[];
|
|
144
|
-
operationId: string;
|
|
145
|
-
operationName: string;
|
|
146
|
-
response: GetterResponse;
|
|
147
|
-
body: GetterBody;
|
|
148
|
-
headers?: GetterQueryParam;
|
|
149
|
-
queryParams?: GetterQueryParam;
|
|
150
|
-
params: GetterParams;
|
|
151
|
-
props: GetterProps;
|
|
152
|
-
mutator?: GeneratorMutator;
|
|
153
|
-
formData?: GeneratorMutator;
|
|
154
|
-
formUrlEncoded?: GeneratorMutator;
|
|
155
|
-
override: NormalizedOverrideOutput;
|
|
156
|
-
deprecated?: boolean;
|
|
157
|
-
};
|
|
158
|
-
declare type GeneratorVerbsOptions = GeneratorVerbOptions[];
|
|
159
|
-
declare type GeneratorOptions = {
|
|
160
|
-
route: string;
|
|
161
|
-
pathRoute: string;
|
|
162
|
-
override: NormalizedOverrideOutput;
|
|
163
|
-
context: ContextSpecs;
|
|
164
|
-
mock: boolean;
|
|
165
|
-
};
|
|
166
|
-
declare type GeneratorClient = {
|
|
167
|
-
implementation: string;
|
|
168
|
-
imports: GeneratorImport[];
|
|
169
|
-
types?: {
|
|
170
|
-
result: (title?: string) => string;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
declare type GeneratorClientExtra = {
|
|
174
|
-
implementation: string;
|
|
175
|
-
implementationMSW: string;
|
|
176
|
-
};
|
|
177
|
-
declare type GeneratorMutatorParsingInfo = {
|
|
178
|
-
numberOfParams: number;
|
|
179
|
-
returnNumberOfParams?: number;
|
|
180
|
-
};
|
|
181
|
-
declare type GeneratorMutator = {
|
|
182
|
-
name: string;
|
|
183
|
-
path: string;
|
|
184
|
-
default: boolean;
|
|
185
|
-
hasErrorType: boolean;
|
|
186
|
-
errorTypeName: string;
|
|
187
|
-
hasSecondArg: boolean;
|
|
188
|
-
hasThirdArg: boolean;
|
|
189
|
-
isHook: boolean;
|
|
190
|
-
bodyTypeName?: string;
|
|
191
|
-
};
|
|
192
|
-
declare type ClientBuilder = (verbOptions: GeneratorVerbOptions, options: GeneratorOptions, outputClient: OutputClient | OutputClientFunc) => GeneratorClient;
|
|
193
|
-
declare type ClientHeaderBuilder = (params: {
|
|
194
|
-
title: string;
|
|
195
|
-
isRequestOptions: boolean;
|
|
196
|
-
isMutator: boolean;
|
|
197
|
-
noFunction?: boolean;
|
|
198
|
-
isGlobalMutator: boolean;
|
|
199
|
-
provideIn: boolean | 'root' | 'any';
|
|
200
|
-
hasAwaitedType: boolean;
|
|
201
|
-
}) => string;
|
|
202
|
-
declare type ClientFooterBuilder = (params: {
|
|
203
|
-
noFunction?: boolean | undefined;
|
|
204
|
-
operationNames: string[];
|
|
205
|
-
title?: string;
|
|
206
|
-
hasAwaitedType: boolean;
|
|
207
|
-
hasMutator: boolean;
|
|
208
|
-
}) => string;
|
|
209
|
-
declare type ClientTitleBuilder = (title: string) => string;
|
|
210
|
-
declare type ClientDependenciesBuilder = (hasGlobalMutator: boolean, packageJson?: PackageJson) => GeneratorDependency[];
|
|
211
|
-
declare type ClientMSWBuilder = (verbOptions: GeneratorVerbOptions, generatorOptions: GeneratorOptions) => {
|
|
212
|
-
imports: string[];
|
|
213
|
-
implementation: string;
|
|
214
|
-
};
|
|
215
|
-
interface ClientGeneratorsBuilder {
|
|
216
|
-
client: ClientBuilder;
|
|
217
|
-
header: ClientHeaderBuilder;
|
|
218
|
-
dependencies: ClientDependenciesBuilder;
|
|
219
|
-
footer: ClientFooterBuilder;
|
|
220
|
-
title: ClientTitleBuilder;
|
|
221
|
-
}
|
|
222
|
-
declare type GeneratorClients = Record<OutputClient, ClientGeneratorsBuilder>;
|
|
223
|
-
|
|
224
|
-
interface Options {
|
|
225
|
-
output?: string | OutputOptions;
|
|
226
|
-
input?: string | InputOptions;
|
|
227
|
-
hooks?: Partial<HooksOptions>;
|
|
228
|
-
}
|
|
229
|
-
declare type OptionsFn = () => Options | Promise<Options>;
|
|
230
|
-
declare type OptionsExport = Options | Promise<Options> | OptionsFn;
|
|
231
|
-
declare type Config = {
|
|
232
|
-
[project: string]: OptionsExport;
|
|
233
|
-
};
|
|
234
|
-
declare type ConfigFn = () => Config | Promise<Config>;
|
|
235
|
-
declare type ConfigExternal = Config | Promise<Config> | ConfigFn;
|
|
236
|
-
declare type NormalizedOverrideOutput = {
|
|
237
|
-
title?: (title: string) => string;
|
|
238
|
-
transformer?: OutputTransformer;
|
|
239
|
-
mutator?: NormalizedMutator;
|
|
240
|
-
operations: {
|
|
241
|
-
[key: string]: NormalizedOperationOptions;
|
|
242
|
-
};
|
|
243
|
-
tags: {
|
|
244
|
-
[key: string]: NormalizedOperationOptions;
|
|
245
|
-
};
|
|
246
|
-
mock?: {
|
|
247
|
-
arrayMin?: number;
|
|
248
|
-
arrayMax?: number;
|
|
249
|
-
properties?: MockProperties;
|
|
250
|
-
format?: {
|
|
251
|
-
[key: string]: unknown;
|
|
252
|
-
};
|
|
253
|
-
required?: boolean;
|
|
254
|
-
baseUrl?: string;
|
|
255
|
-
delay?: number;
|
|
256
|
-
};
|
|
257
|
-
contentType?: OverrideOutputContentType;
|
|
258
|
-
header: false | ((info: InfoObject) => string[] | string);
|
|
259
|
-
formData: boolean | NormalizedMutator;
|
|
260
|
-
formUrlEncoded: boolean | NormalizedMutator;
|
|
261
|
-
components: {
|
|
262
|
-
schemas: {
|
|
263
|
-
suffix: string;
|
|
264
|
-
};
|
|
265
|
-
responses: {
|
|
266
|
-
suffix: string;
|
|
267
|
-
};
|
|
268
|
-
parameters: {
|
|
269
|
-
suffix: string;
|
|
270
|
-
};
|
|
271
|
-
requestBodies: {
|
|
272
|
-
suffix: string;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
query: QueryOptions;
|
|
276
|
-
angular: Required<AngularOptions>;
|
|
277
|
-
swr: {
|
|
278
|
-
options?: any;
|
|
279
|
-
};
|
|
280
|
-
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
281
|
-
requestOptions: Record<string, any> | boolean;
|
|
282
|
-
useDates?: boolean;
|
|
283
|
-
useTypeOverInterfaces?: boolean;
|
|
284
|
-
useDeprecatedOperations?: boolean;
|
|
285
|
-
};
|
|
286
|
-
declare type NormalizedMutator = {
|
|
287
|
-
path: string;
|
|
288
|
-
name?: string;
|
|
289
|
-
default: boolean;
|
|
290
|
-
alias?: Record<string, string>;
|
|
291
|
-
};
|
|
292
|
-
declare type NormalizedOperationOptions = {
|
|
293
|
-
transformer?: OutputTransformer;
|
|
294
|
-
mutator?: NormalizedMutator;
|
|
295
|
-
mock?: {
|
|
296
|
-
data?: MockProperties;
|
|
297
|
-
properties?: MockProperties;
|
|
298
|
-
};
|
|
299
|
-
contentType?: OverrideOutputContentType;
|
|
300
|
-
query?: QueryOptions;
|
|
301
|
-
angular?: Required<AngularOptions>;
|
|
302
|
-
swr?: {
|
|
303
|
-
options?: any;
|
|
304
|
-
};
|
|
305
|
-
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
306
|
-
formData?: boolean | NormalizedMutator;
|
|
307
|
-
formUrlEncoded?: boolean | NormalizedMutator;
|
|
308
|
-
requestOptions?: object | boolean;
|
|
309
|
-
};
|
|
310
|
-
declare type OutputClientFunc = (clients: GeneratorClients) => ClientGeneratorsBuilder;
|
|
311
|
-
declare type OutputOptions = {
|
|
312
|
-
workspace?: string;
|
|
313
|
-
target?: string;
|
|
314
|
-
schemas?: string;
|
|
315
|
-
mode?: OutputMode;
|
|
316
|
-
mock?: boolean | ClientMSWBuilder;
|
|
317
|
-
override?: OverrideOutput;
|
|
318
|
-
client?: OutputClient | OutputClientFunc;
|
|
319
|
-
clean?: boolean | string[];
|
|
320
|
-
prettier?: boolean;
|
|
321
|
-
tslint?: boolean;
|
|
322
|
-
tsconfig?: string | Tsconfig;
|
|
323
|
-
packageJson?: string;
|
|
324
|
-
headers?: boolean;
|
|
325
|
-
};
|
|
326
|
-
declare type SwaggerParserOptions = Omit<SwaggerParser.Options, 'validate'> & {
|
|
327
|
-
validate?: boolean;
|
|
328
|
-
};
|
|
329
|
-
declare type InputOptions = {
|
|
330
|
-
target: string | OpenAPIObject;
|
|
331
|
-
validation?: boolean;
|
|
332
|
-
override?: OverrideInput;
|
|
333
|
-
converterOptions?: swagger2openapi.Options;
|
|
334
|
-
parserOptions?: SwaggerParserOptions;
|
|
335
|
-
};
|
|
336
|
-
declare type OutputClient = 'axios' | 'axios-functions' | 'angular' | 'react-query' | 'svelte-query' | 'vue-query' | 'swr';
|
|
337
|
-
declare const OutputClient: {
|
|
338
|
-
ANGULAR: OutputClient;
|
|
339
|
-
AXIOS: OutputClient;
|
|
340
|
-
AXIOS_FUNCTIONS: OutputClient;
|
|
341
|
-
REACT_QUERY: OutputClient;
|
|
342
|
-
SVELTE_QUERY: OutputClient;
|
|
343
|
-
VUE_QUERY: OutputClient;
|
|
344
|
-
};
|
|
345
|
-
declare type OutputMode = 'single' | 'split' | 'tags' | 'tags-split';
|
|
346
|
-
declare const OutputMode: {
|
|
347
|
-
SINGLE: OutputMode;
|
|
348
|
-
SPLIT: OutputMode;
|
|
349
|
-
TAGS: OutputMode;
|
|
350
|
-
TAGS_SPLIT: OutputMode;
|
|
351
|
-
};
|
|
352
|
-
declare type MockProperties = {
|
|
353
|
-
[key: string]: unknown;
|
|
354
|
-
} | ((specs: OpenAPIObject) => {
|
|
355
|
-
[key: string]: unknown;
|
|
356
|
-
});
|
|
357
|
-
declare type OutputTransformerFn = (verb: GeneratorVerbOptions) => GeneratorVerbOptions;
|
|
358
|
-
declare type OutputTransformer = string | OutputTransformerFn;
|
|
359
|
-
declare type MutatorObject = {
|
|
360
|
-
path: string;
|
|
361
|
-
name?: string;
|
|
362
|
-
default?: boolean;
|
|
363
|
-
alias?: Record<string, string>;
|
|
364
|
-
};
|
|
365
|
-
declare type Mutator = string | MutatorObject;
|
|
366
|
-
declare type OverrideOutput = {
|
|
367
|
-
title?: (title: string) => string;
|
|
368
|
-
transformer?: OutputTransformer;
|
|
369
|
-
mutator?: Mutator;
|
|
370
|
-
operations?: {
|
|
371
|
-
[key: string]: OperationOptions;
|
|
372
|
-
};
|
|
373
|
-
tags?: {
|
|
374
|
-
[key: string]: OperationOptions;
|
|
375
|
-
};
|
|
376
|
-
mock?: {
|
|
377
|
-
arrayMin?: number;
|
|
378
|
-
arrayMax?: number;
|
|
379
|
-
properties?: MockProperties;
|
|
380
|
-
format?: {
|
|
381
|
-
[key: string]: unknown;
|
|
382
|
-
};
|
|
383
|
-
required?: boolean;
|
|
384
|
-
baseUrl?: string;
|
|
385
|
-
delay?: number;
|
|
386
|
-
};
|
|
387
|
-
contentType?: OverrideOutputContentType;
|
|
388
|
-
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
389
|
-
formData?: boolean | Mutator;
|
|
390
|
-
formUrlEncoded?: boolean | Mutator;
|
|
391
|
-
components?: {
|
|
392
|
-
schemas?: {
|
|
393
|
-
suffix?: string;
|
|
394
|
-
};
|
|
395
|
-
responses?: {
|
|
396
|
-
suffix?: string;
|
|
397
|
-
};
|
|
398
|
-
parameters?: {
|
|
399
|
-
suffix?: string;
|
|
400
|
-
};
|
|
401
|
-
requestBodies?: {
|
|
402
|
-
suffix?: string;
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
query?: QueryOptions;
|
|
406
|
-
swr?: {
|
|
407
|
-
options?: any;
|
|
408
|
-
};
|
|
409
|
-
angular?: AngularOptions;
|
|
410
|
-
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
411
|
-
requestOptions?: Record<string, any> | boolean;
|
|
412
|
-
useDates?: boolean;
|
|
413
|
-
useTypeOverInterfaces?: boolean;
|
|
414
|
-
useDeprecatedOperations?: boolean;
|
|
415
|
-
};
|
|
416
|
-
declare type OverrideOutputContentType = {
|
|
417
|
-
include?: string[];
|
|
418
|
-
exclude?: string[];
|
|
419
|
-
};
|
|
420
|
-
declare type QueryOptions = {
|
|
421
|
-
useQuery?: boolean;
|
|
422
|
-
useInfinite?: boolean;
|
|
423
|
-
useInfiniteQueryParam?: string;
|
|
424
|
-
options?: any;
|
|
425
|
-
signal?: boolean;
|
|
426
|
-
};
|
|
427
|
-
declare type AngularOptions = {
|
|
428
|
-
provideIn?: 'root' | 'any' | boolean;
|
|
429
|
-
};
|
|
430
|
-
declare type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
431
|
-
declare type InputTransformer = string | InputTransformerFn;
|
|
432
|
-
declare type OverrideInput = {
|
|
433
|
-
transformer?: InputTransformer;
|
|
434
|
-
};
|
|
435
|
-
declare type OperationOptions = {
|
|
436
|
-
transformer?: OutputTransformer;
|
|
437
|
-
mutator?: Mutator;
|
|
438
|
-
mock?: {
|
|
439
|
-
data?: MockProperties;
|
|
440
|
-
properties?: MockProperties;
|
|
441
|
-
};
|
|
442
|
-
query?: QueryOptions;
|
|
443
|
-
angular?: Required<AngularOptions>;
|
|
444
|
-
swr?: {
|
|
445
|
-
options?: any;
|
|
446
|
-
};
|
|
447
|
-
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
448
|
-
formData?: boolean | Mutator;
|
|
449
|
-
formUrlEncoded?: boolean | Mutator;
|
|
450
|
-
requestOptions?: object | boolean;
|
|
451
|
-
};
|
|
452
|
-
declare type Hook = 'afterAllFilesWrite';
|
|
453
|
-
declare type HookFunction = (...args: any[]) => void | Promise<void>;
|
|
454
|
-
declare type HookCommand = string | HookFunction | (string | HookFunction)[];
|
|
455
|
-
declare type NormalizedHookCommand = HookCommand[];
|
|
456
|
-
declare type HooksOptions<T = HookCommand | NormalizedHookCommand> = Partial<Record<Hook, T>>;
|
|
457
|
-
declare type Verbs = 'post' | 'put' | 'get' | 'patch' | 'delete' | 'head';
|
|
458
|
-
declare const Verbs: {
|
|
459
|
-
POST: Verbs;
|
|
460
|
-
PUT: Verbs;
|
|
461
|
-
GET: Verbs;
|
|
462
|
-
PATCH: Verbs;
|
|
463
|
-
DELETE: Verbs;
|
|
464
|
-
HEAD: Verbs;
|
|
465
|
-
};
|
|
466
|
-
interface ContextSpecs {
|
|
467
|
-
specKey: string;
|
|
468
|
-
target: string;
|
|
469
|
-
workspace: string;
|
|
470
|
-
tslint: boolean;
|
|
471
|
-
specs: Record<string, OpenAPIObject>;
|
|
472
|
-
override: NormalizedOverrideOutput;
|
|
473
|
-
tsconfig?: Tsconfig;
|
|
474
|
-
packageJson?: PackageJson;
|
|
475
|
-
}
|
|
476
|
-
interface GlobalOptions {
|
|
477
|
-
projectName?: string;
|
|
478
|
-
watch?: boolean | string | (string | boolean)[];
|
|
479
|
-
clean?: boolean | string[];
|
|
480
|
-
prettier?: boolean;
|
|
481
|
-
tslint?: boolean;
|
|
482
|
-
mock?: boolean;
|
|
483
|
-
client?: OutputClient;
|
|
484
|
-
mode?: OutputMode;
|
|
485
|
-
tsconfig?: string | Tsconfig;
|
|
486
|
-
packageJson?: string;
|
|
487
|
-
input?: string;
|
|
488
|
-
output?: string;
|
|
489
|
-
}
|
|
490
|
-
interface Tsconfig {
|
|
491
|
-
baseUrl?: string;
|
|
492
|
-
compilerOptions?: {
|
|
493
|
-
esModuleInterop?: boolean;
|
|
494
|
-
allowSyntheticDefaultImports?: boolean;
|
|
495
|
-
exactOptionalPropertyTypes?: boolean;
|
|
496
|
-
paths?: Record<string, string[]>;
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
interface PackageJson {
|
|
500
|
-
dependencies?: Record<string, string>;
|
|
501
|
-
devDependencies?: Record<string, string>;
|
|
502
|
-
}
|
|
1
|
+
import { ConfigExternal, OptionsExport, GlobalOptions } from '@orval/core';
|
|
2
|
+
export { Options } from '@orval/core';
|
|
503
3
|
|
|
504
4
|
/**
|
|
505
5
|
* Type helper to make it easier to use orval.config.ts
|
|
@@ -507,108 +7,6 @@ interface PackageJson {
|
|
|
507
7
|
*/
|
|
508
8
|
declare function defineConfig(options: ConfigExternal): ConfigExternal;
|
|
509
9
|
|
|
510
|
-
declare const generalJSTypes: string[];
|
|
511
|
-
declare const generalJSTypesWithArray: string[];
|
|
512
|
-
declare const VERBS_WITH_BODY: Verbs[];
|
|
513
|
-
declare const URL_REGEX: RegExp;
|
|
514
|
-
|
|
515
|
-
declare const generateImports: ({ imports, target, isRootKey, specsName, }: {
|
|
516
|
-
imports: GeneratorImport[];
|
|
517
|
-
target: string;
|
|
518
|
-
isRootKey: boolean;
|
|
519
|
-
specsName: Record<string, string>;
|
|
520
|
-
}) => string;
|
|
521
|
-
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
522
|
-
mutators: GeneratorMutator[];
|
|
523
|
-
implementation?: string | undefined;
|
|
524
|
-
oneMore?: boolean | undefined;
|
|
525
|
-
}) => string;
|
|
526
|
-
declare const addDependency: ({ implementation, exports, dependency, specsName, hasSchemaDir, isAllowSyntheticDefaultImports, }: {
|
|
527
|
-
implementation: string;
|
|
528
|
-
exports: GeneratorImport[];
|
|
529
|
-
dependency: string;
|
|
530
|
-
specsName: Record<string, string>;
|
|
531
|
-
hasSchemaDir: boolean;
|
|
532
|
-
isAllowSyntheticDefaultImports: boolean;
|
|
533
|
-
}) => string | undefined;
|
|
534
|
-
declare const generateDependencyImports: (implementation: string, imports: {
|
|
535
|
-
exports: GeneratorImport[];
|
|
536
|
-
dependency: string;
|
|
537
|
-
}[], specsName: Record<string, string>, hasSchemaDir: boolean, isAllowSyntheticDefaultImports: boolean) => string;
|
|
538
|
-
declare const generateVerbImports: ({ response, body, queryParams, headers, params, }: GeneratorVerbOptions) => GeneratorImport[];
|
|
539
|
-
|
|
540
|
-
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
541
|
-
declare const generateAxiosOptions: ({ response, isExactOptionalPropertyTypes, queryParams, headers, requestOptions, hasSignal, }: {
|
|
542
|
-
response: GetterResponse;
|
|
543
|
-
isExactOptionalPropertyTypes: boolean;
|
|
544
|
-
queryParams?: GeneratorSchema | undefined;
|
|
545
|
-
headers?: GeneratorSchema | undefined;
|
|
546
|
-
requestOptions?: boolean | object | undefined;
|
|
547
|
-
hasSignal: boolean;
|
|
548
|
-
}) => string;
|
|
549
|
-
declare const generateOptions: ({ route, body, headers, queryParams, response, verb, requestOptions, isFormData, isFormUrlEncoded, isAngular, isExactOptionalPropertyTypes, hasSignal, }: {
|
|
550
|
-
route: string;
|
|
551
|
-
body: GetterBody;
|
|
552
|
-
headers?: GetterQueryParam | undefined;
|
|
553
|
-
queryParams?: GetterQueryParam | undefined;
|
|
554
|
-
response: GetterResponse;
|
|
555
|
-
verb: Verbs;
|
|
556
|
-
requestOptions?: boolean | object | undefined;
|
|
557
|
-
isFormData: boolean;
|
|
558
|
-
isFormUrlEncoded: boolean;
|
|
559
|
-
isAngular?: boolean | undefined;
|
|
560
|
-
isExactOptionalPropertyTypes: boolean;
|
|
561
|
-
hasSignal: boolean;
|
|
562
|
-
}) => string;
|
|
563
|
-
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
564
|
-
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, queryParams?: GetterQueryParam) => string;
|
|
565
|
-
declare const generateMutatorConfig: ({ route, body, headers, queryParams, response, verb, isFormData, isFormUrlEncoded, isBodyVerb, hasSignal, isExactOptionalPropertyTypes, }: {
|
|
566
|
-
route: string;
|
|
567
|
-
body: GetterBody;
|
|
568
|
-
headers?: GetterQueryParam | undefined;
|
|
569
|
-
queryParams?: GetterQueryParam | undefined;
|
|
570
|
-
response: GetterResponse;
|
|
571
|
-
verb: Verbs;
|
|
572
|
-
isFormData: boolean;
|
|
573
|
-
isFormUrlEncoded: boolean;
|
|
574
|
-
isBodyVerb: boolean;
|
|
575
|
-
hasSignal: boolean;
|
|
576
|
-
isExactOptionalPropertyTypes: boolean;
|
|
577
|
-
}) => string;
|
|
578
|
-
declare const generateMutatorRequestOptions: (requestOptions: boolean | object | undefined, hasSecondArgument: boolean) => string | undefined;
|
|
579
|
-
declare const generateFormDataAndUrlEncodedFunction: ({ body, formData, formUrlEncoded, isFormData, isFormUrlEncoded, }: {
|
|
580
|
-
body: GetterBody;
|
|
581
|
-
formData?: GeneratorMutator | undefined;
|
|
582
|
-
formUrlEncoded?: GeneratorMutator | undefined;
|
|
583
|
-
isFormData: boolean;
|
|
584
|
-
isFormUrlEncoded: boolean;
|
|
585
|
-
}) => string;
|
|
586
|
-
|
|
587
|
-
declare const loadTsconfig: (tsconfig?: Tsconfig | string, workspace?: string) => Promise<Tsconfig | undefined>;
|
|
588
|
-
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
589
|
-
|
|
590
|
-
declare const stringify: (data?: string | any[] | {
|
|
591
|
-
[key: string]: any;
|
|
592
|
-
} | undefined) => string | undefined;
|
|
593
|
-
declare const sanitize: (value: string, options?: {
|
|
594
|
-
whitespace?: string | true;
|
|
595
|
-
underscore?: string | true;
|
|
596
|
-
dot?: string | true;
|
|
597
|
-
dash?: string | true;
|
|
598
|
-
es5keyword?: boolean;
|
|
599
|
-
es5IdentifierName?: boolean;
|
|
600
|
-
special?: boolean;
|
|
601
|
-
}) => string;
|
|
602
|
-
declare const toObjectString: <T>(props: T[], path?: keyof T | undefined) => string;
|
|
603
|
-
declare const getNumberWord: (num: number) => string;
|
|
604
|
-
declare const escape: (str: string, char?: string) => string;
|
|
605
|
-
|
|
606
|
-
declare const pascal: (s: string) => string;
|
|
607
|
-
declare const camel: (s: string) => string;
|
|
608
|
-
declare const snake: (s: string) => string;
|
|
609
|
-
declare const kebab: (s: string) => string;
|
|
610
|
-
declare const upper: (s: string, fillWith?: string, isDeapostrophe?: boolean) => string;
|
|
611
|
-
|
|
612
10
|
declare const generate: (optionsExport?: string | OptionsExport, workspace?: string, options?: GlobalOptions) => Promise<void>;
|
|
613
11
|
|
|
614
|
-
export {
|
|
12
|
+
export { generate as default, defineConfig, generate };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkZDK7MU3Fjs = require('./chunk-ZDK7MU3F.js');_chunkZDK7MU3Fjs.k.call(void 0, );_chunkZDK7MU3Fjs.f.call(void 0, );_chunkZDK7MU3Fjs.h.call(void 0, );var _core = require('@orval/core');var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var y=async(r,a=process.cwd(),e)=>{if(!r||_core.isString.call(void 0, r))return _chunkZDK7MU3Fjs.j.call(void 0, r,e);let c=await _chunkZDK7MU3Fjs.e.call(void 0, r,a,e);if(e!=null&&e.watch)_chunkZDK7MU3Fjs.g.call(void 0, e==null?void 0:e.watch,async()=>{try{await _chunkZDK7MU3Fjs.i.call(void 0, a,c)}catch(m){_core.log.call(void 0, _chalk2.default.red(`\u{1F6D1} ${e!=null&&e.projectName?`${e==null?void 0:e.projectName} - `:""}${m}`))}},c.input.target);else try{return await _chunkZDK7MU3Fjs.i.call(void 0, a,c)}catch(m){_core.log.call(void 0, _chalk2.default.red(`\u{1F6D1} ${e!=null&&e.projectName?`${e==null?void 0:e.projectName} - `:""}${m}`))}};var q=y;exports.Options = _core.Options; exports.default = q; exports.defineConfig = _chunkZDK7MU3Fjs.d; exports.generate = y;
|