@orval/core 8.0.0-rc.2 → 8.0.0-rc.4
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.mts +410 -358
- package/dist/index.mjs +1262 -1117
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { CompareOperator } from "compare-versions";
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import { ConvertInputOptions } from "swagger2openapi";
|
|
4
|
-
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
5
3
|
import { allLocales } from "@faker-js/faker";
|
|
6
|
-
import {
|
|
7
|
-
import { ComponentsObject, ExampleObject, InfoObject, OpenAPIObject, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemasObject } from "openapi3-ts/oas30";
|
|
4
|
+
import { OpenAPIV3_1 } from "@scalar/openapi-types";
|
|
8
5
|
import { TypeDocOptions } from "typedoc";
|
|
9
|
-
import { ServerObject } from "openapi3-ts/oas31";
|
|
10
6
|
|
|
11
7
|
//#region src/types.d.ts
|
|
12
8
|
interface Options {
|
|
@@ -28,7 +24,7 @@ interface NormalizedOptions {
|
|
|
28
24
|
type NormalizedOutputOptions = {
|
|
29
25
|
workspace?: string;
|
|
30
26
|
target: string;
|
|
31
|
-
schemas?: string;
|
|
27
|
+
schemas?: string | SchemaOptions;
|
|
32
28
|
namingConvention: NamingConvention;
|
|
33
29
|
fileExtension: string;
|
|
34
30
|
mode: OutputMode;
|
|
@@ -62,7 +58,7 @@ type NormalizedOverrideOutput = {
|
|
|
62
58
|
tags: Record<string, NormalizedOperationOptions | undefined>;
|
|
63
59
|
mock?: OverrideMockOptions;
|
|
64
60
|
contentType?: OverrideOutputContentType;
|
|
65
|
-
header: false | ((info:
|
|
61
|
+
header: false | ((info: OpenApiInfoObject) => string[] | string);
|
|
66
62
|
formData: NormalizedFormDataType<NormalizedMutator>;
|
|
67
63
|
formUrlEncoded: boolean | NormalizedMutator;
|
|
68
64
|
paramsSerializer?: NormalizedMutator;
|
|
@@ -91,7 +87,7 @@ type NormalizedOverrideOutput = {
|
|
|
91
87
|
swr: SwrOptions;
|
|
92
88
|
zod: NormalizedZodOptions;
|
|
93
89
|
fetch: NormalizedFetchOptions;
|
|
94
|
-
operationName?: (operation:
|
|
90
|
+
operationName?: (operation: OpenApiOperationObject, route: string, verb: Verbs) => string;
|
|
95
91
|
requestOptions: Record<string, any> | boolean;
|
|
96
92
|
useDates?: boolean;
|
|
97
93
|
useTypeOverInterfaces?: boolean;
|
|
@@ -101,6 +97,7 @@ type NormalizedOverrideOutput = {
|
|
|
101
97
|
enumGenerationType: EnumGeneration;
|
|
102
98
|
suppressReadonlyModifier?: boolean;
|
|
103
99
|
jsDoc: NormalizedJsDocOptions;
|
|
100
|
+
aliasCombinedTypes: boolean;
|
|
104
101
|
};
|
|
105
102
|
type NormalizedMutator = {
|
|
106
103
|
path: string;
|
|
@@ -121,7 +118,7 @@ type NormalizedOperationOptions = {
|
|
|
121
118
|
angular?: Required<AngularOptions>;
|
|
122
119
|
swr?: SwrOptions;
|
|
123
120
|
zod?: NormalizedZodOptions;
|
|
124
|
-
operationName?: (operation:
|
|
121
|
+
operationName?: (operation: OpenApiOperationObject, route: string, verb: Verbs) => string;
|
|
125
122
|
fetch?: FetchOptions;
|
|
126
123
|
formData?: NormalizedFormDataType<NormalizedMutator>;
|
|
127
124
|
formUrlEncoded?: boolean | NormalizedMutator;
|
|
@@ -129,12 +126,15 @@ type NormalizedOperationOptions = {
|
|
|
129
126
|
requestOptions?: object | boolean;
|
|
130
127
|
};
|
|
131
128
|
type NormalizedInputOptions = {
|
|
132
|
-
target: string |
|
|
133
|
-
validation: boolean | object;
|
|
129
|
+
target: string | OpenApiDocument;
|
|
134
130
|
override: OverrideInput;
|
|
135
|
-
|
|
136
|
-
parserOptions
|
|
137
|
-
|
|
131
|
+
filters?: InputFiltersOptions;
|
|
132
|
+
parserOptions?: {
|
|
133
|
+
headers?: {
|
|
134
|
+
domains: string[];
|
|
135
|
+
headers: Record<string, string>;
|
|
136
|
+
}[];
|
|
137
|
+
};
|
|
138
138
|
};
|
|
139
139
|
type OutputClientFunc = (clients: GeneratorClients) => ClientGeneratorsBuilder;
|
|
140
140
|
type BaseUrlFromSpec = {
|
|
@@ -167,10 +167,19 @@ declare const EnumGeneration: {
|
|
|
167
167
|
readonly UNION: "union";
|
|
168
168
|
};
|
|
169
169
|
type EnumGeneration = (typeof EnumGeneration)[keyof typeof EnumGeneration];
|
|
170
|
+
type SchemaGenerationType = 'typescript' | 'zod';
|
|
171
|
+
type SchemaOptions = {
|
|
172
|
+
path: string;
|
|
173
|
+
type: SchemaGenerationType | SchemaGenerationType[];
|
|
174
|
+
};
|
|
175
|
+
type NormalizedSchemaOptions = {
|
|
176
|
+
path: string;
|
|
177
|
+
type: SchemaGenerationType[];
|
|
178
|
+
};
|
|
170
179
|
type OutputOptions = {
|
|
171
180
|
workspace?: string;
|
|
172
181
|
target: string;
|
|
173
|
-
schemas?: string;
|
|
182
|
+
schemas?: string | SchemaOptions;
|
|
174
183
|
namingConvention?: NamingConvention;
|
|
175
184
|
fileExtension?: string;
|
|
176
185
|
mode?: OutputMode;
|
|
@@ -193,21 +202,21 @@ type OutputOptions = {
|
|
|
193
202
|
optionsParamRequired?: boolean;
|
|
194
203
|
propertySortOrder?: PropertySortOrder;
|
|
195
204
|
};
|
|
196
|
-
type
|
|
197
|
-
validate?: boolean;
|
|
198
|
-
};
|
|
199
|
-
type InputFiltersOption = {
|
|
205
|
+
type InputFiltersOptions = {
|
|
200
206
|
mode?: 'include' | 'exclude';
|
|
201
207
|
tags?: (string | RegExp)[];
|
|
202
208
|
schemas?: (string | RegExp)[];
|
|
203
209
|
};
|
|
204
210
|
type InputOptions = {
|
|
205
|
-
target: string | Record<string, unknown> |
|
|
206
|
-
validation?: boolean | object;
|
|
211
|
+
target: string | Record<string, unknown> | OpenApiDocument;
|
|
207
212
|
override?: OverrideInput;
|
|
208
|
-
|
|
209
|
-
parserOptions?:
|
|
210
|
-
|
|
213
|
+
filters?: InputFiltersOptions;
|
|
214
|
+
parserOptions?: {
|
|
215
|
+
headers?: {
|
|
216
|
+
domains: string[];
|
|
217
|
+
headers: Record<string, string>;
|
|
218
|
+
}[];
|
|
219
|
+
};
|
|
211
220
|
};
|
|
212
221
|
declare const OutputClient: {
|
|
213
222
|
readonly ANGULAR: "angular";
|
|
@@ -274,12 +283,12 @@ type MockOptions = Omit<OverrideMockOptions, 'properties'> & {
|
|
|
274
283
|
}>;
|
|
275
284
|
};
|
|
276
285
|
type MockPropertiesObject = Record<string, unknown>;
|
|
277
|
-
type MockPropertiesObjectFn = (specs:
|
|
286
|
+
type MockPropertiesObjectFn = (specs: OpenApiDocument) => MockPropertiesObject;
|
|
278
287
|
type MockProperties = MockPropertiesObject | MockPropertiesObjectFn;
|
|
279
288
|
type MockDataObject = Record<string, unknown>;
|
|
280
|
-
type MockDataObjectFn = (specs:
|
|
289
|
+
type MockDataObjectFn = (specs: OpenApiDocument) => MockDataObject;
|
|
281
290
|
type MockDataArray = unknown[];
|
|
282
|
-
type MockDataArrayFn = (specs:
|
|
291
|
+
type MockDataArrayFn = (specs: OpenApiDocument) => MockDataArray;
|
|
283
292
|
type MockData = MockDataObject | MockDataObjectFn | MockDataArray | MockDataArrayFn;
|
|
284
293
|
type OutputTransformerFn = (verb: GeneratorVerbOptions) => GeneratorVerbOptions;
|
|
285
294
|
type OutputTransformer = string | OutputTransformerFn;
|
|
@@ -324,7 +333,7 @@ type OverrideOutput = {
|
|
|
324
333
|
tags?: Record<string, OperationOptions>;
|
|
325
334
|
mock?: OverrideMockOptions;
|
|
326
335
|
contentType?: OverrideOutputContentType;
|
|
327
|
-
header?: boolean | ((info:
|
|
336
|
+
header?: boolean | ((info: OpenApiInfoObject) => string[] | string);
|
|
328
337
|
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
329
338
|
formUrlEncoded?: boolean | Mutator;
|
|
330
339
|
paramsSerializer?: Mutator;
|
|
@@ -352,7 +361,7 @@ type OverrideOutput = {
|
|
|
352
361
|
swr?: SwrOptions;
|
|
353
362
|
angular?: AngularOptions;
|
|
354
363
|
zod?: ZodOptions;
|
|
355
|
-
operationName?: (operation:
|
|
364
|
+
operationName?: (operation: OpenApiOperationObject, route: string, verb: Verbs) => string;
|
|
356
365
|
fetch?: FetchOptions;
|
|
357
366
|
requestOptions?: Record<string, any> | boolean;
|
|
358
367
|
useDates?: boolean;
|
|
@@ -363,6 +372,7 @@ type OverrideOutput = {
|
|
|
363
372
|
enumGenerationType?: EnumGeneration;
|
|
364
373
|
suppressReadonlyModifier?: boolean;
|
|
365
374
|
jsDoc?: JsDocOptions;
|
|
375
|
+
aliasCombinedTypes?: boolean;
|
|
366
376
|
};
|
|
367
377
|
type JsDocOptions = {
|
|
368
378
|
filter?: (schema: Record<string, any>) => {
|
|
@@ -523,13 +533,17 @@ type NormalizedFetchOptions = {
|
|
|
523
533
|
includeHttpResponseReturnType: boolean;
|
|
524
534
|
forceSuccessResponse: boolean;
|
|
525
535
|
jsonReviver?: Mutator;
|
|
536
|
+
useZodSchemaResponse: boolean;
|
|
537
|
+
runtimeValidation: boolean;
|
|
526
538
|
};
|
|
527
539
|
type FetchOptions = {
|
|
528
540
|
includeHttpResponseReturnType?: boolean;
|
|
529
541
|
forceSuccessResponse?: boolean;
|
|
530
542
|
jsonReviver?: Mutator;
|
|
543
|
+
useZodSchemaResponse?: boolean;
|
|
544
|
+
runtimeValidation?: boolean;
|
|
531
545
|
};
|
|
532
|
-
type InputTransformerFn = (spec:
|
|
546
|
+
type InputTransformerFn = (spec: OpenApiDocument) => OpenApiDocument;
|
|
533
547
|
type InputTransformer = string | InputTransformerFn;
|
|
534
548
|
type OverrideInput = {
|
|
535
549
|
transformer?: InputTransformer;
|
|
@@ -545,7 +559,7 @@ type OperationOptions = {
|
|
|
545
559
|
angular?: Required<AngularOptions>;
|
|
546
560
|
swr?: SwrOptions;
|
|
547
561
|
zod?: ZodOptions;
|
|
548
|
-
operationName?: (operation:
|
|
562
|
+
operationName?: (operation: OpenApiOperationObject, route: string, verb: Verbs) => string;
|
|
549
563
|
fetch?: FetchOptions;
|
|
550
564
|
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
551
565
|
formUrlEncoded?: boolean | Mutator;
|
|
@@ -572,17 +586,18 @@ declare const Verbs: {
|
|
|
572
586
|
HEAD: Verbs;
|
|
573
587
|
};
|
|
574
588
|
type ImportOpenApi = {
|
|
575
|
-
|
|
589
|
+
spec: OpenApiDocument;
|
|
576
590
|
input: NormalizedInputOptions;
|
|
577
591
|
output: NormalizedOutputOptions;
|
|
578
592
|
target: string;
|
|
579
593
|
workspace: string;
|
|
594
|
+
projectName?: string;
|
|
580
595
|
};
|
|
581
|
-
interface
|
|
582
|
-
|
|
596
|
+
interface ContextSpec {
|
|
597
|
+
projectName?: string;
|
|
583
598
|
target: string;
|
|
584
599
|
workspace: string;
|
|
585
|
-
|
|
600
|
+
spec: OpenApiDocument;
|
|
586
601
|
parents?: string[];
|
|
587
602
|
output: NormalizedOutputOptions;
|
|
588
603
|
}
|
|
@@ -620,13 +635,15 @@ type GeneratorSchema = {
|
|
|
620
635
|
name: string;
|
|
621
636
|
model: string;
|
|
622
637
|
imports: GeneratorImport[];
|
|
638
|
+
dependencies?: string[];
|
|
639
|
+
schema?: OpenApiSchemaObject;
|
|
623
640
|
};
|
|
624
641
|
type GeneratorImport = {
|
|
625
642
|
name: string;
|
|
626
643
|
schemaName?: string;
|
|
644
|
+
isZodSchema?: boolean;
|
|
627
645
|
isConstant?: boolean;
|
|
628
646
|
alias?: string;
|
|
629
|
-
specKey?: string;
|
|
630
647
|
default?: boolean;
|
|
631
648
|
values?: boolean;
|
|
632
649
|
syntheticDefaultImport?: boolean;
|
|
@@ -712,14 +729,14 @@ type GeneratorVerbOptions = {
|
|
|
712
729
|
fetchReviver?: GeneratorMutator;
|
|
713
730
|
override: NormalizedOverrideOutput;
|
|
714
731
|
deprecated?: boolean;
|
|
715
|
-
originalOperation:
|
|
732
|
+
originalOperation: OpenApiOperationObject;
|
|
716
733
|
};
|
|
717
734
|
type GeneratorVerbsOptions = GeneratorVerbOptions[];
|
|
718
735
|
type GeneratorOptions = {
|
|
719
736
|
route: string;
|
|
720
737
|
pathRoute: string;
|
|
721
738
|
override: NormalizedOverrideOutput;
|
|
722
|
-
context:
|
|
739
|
+
context: ContextSpec;
|
|
723
740
|
mock?: GlobalMockOptions | ClientMockBuilder;
|
|
724
741
|
output: string;
|
|
725
742
|
};
|
|
@@ -748,7 +765,7 @@ type ClientFileBuilder = {
|
|
|
748
765
|
path: string;
|
|
749
766
|
content: string;
|
|
750
767
|
};
|
|
751
|
-
type ClientExtraFilesBuilder = (verbOptions: Record<string, GeneratorVerbOptions>, output: NormalizedOutputOptions, context:
|
|
768
|
+
type ClientExtraFilesBuilder = (verbOptions: Record<string, GeneratorVerbOptions>, output: NormalizedOutputOptions, context: ContextSpec) => Promise<ClientFileBuilder[]>;
|
|
752
769
|
type ClientHeaderBuilder = (params: {
|
|
753
770
|
title: string;
|
|
754
771
|
isRequestOptions: boolean;
|
|
@@ -803,10 +820,10 @@ type GetterResponse = {
|
|
|
803
820
|
};
|
|
804
821
|
contentTypes: string[];
|
|
805
822
|
schemas: GeneratorSchema[];
|
|
806
|
-
originalSchema?:
|
|
823
|
+
originalSchema?: OpenApiResponsesObject;
|
|
807
824
|
};
|
|
808
825
|
type GetterBody = {
|
|
809
|
-
originalSchema:
|
|
826
|
+
originalSchema: OpenApiReferenceObject | OpenApiRequestBodyObject;
|
|
810
827
|
imports: GeneratorImport[];
|
|
811
828
|
definition: string;
|
|
812
829
|
implementation: string;
|
|
@@ -818,15 +835,15 @@ type GetterBody = {
|
|
|
818
835
|
};
|
|
819
836
|
type GetterParameters = {
|
|
820
837
|
query: {
|
|
821
|
-
parameter:
|
|
838
|
+
parameter: OpenApiParameterObject;
|
|
822
839
|
imports: GeneratorImport[];
|
|
823
840
|
}[];
|
|
824
841
|
path: {
|
|
825
|
-
parameter:
|
|
842
|
+
parameter: OpenApiParameterObject;
|
|
826
843
|
imports: GeneratorImport[];
|
|
827
844
|
}[];
|
|
828
845
|
header: {
|
|
829
|
-
parameter:
|
|
846
|
+
parameter: OpenApiParameterObject;
|
|
830
847
|
imports: GeneratorImport[];
|
|
831
848
|
}[];
|
|
832
849
|
};
|
|
@@ -843,7 +860,7 @@ type GetterQueryParam = {
|
|
|
843
860
|
schema: GeneratorSchema;
|
|
844
861
|
deps: GeneratorSchema[];
|
|
845
862
|
isOptional: boolean;
|
|
846
|
-
originalSchema?:
|
|
863
|
+
originalSchema?: OpenApiSchemaObject;
|
|
847
864
|
};
|
|
848
865
|
type GetterPropType = 'param' | 'body' | 'queryParam' | 'header' | 'namedPathParams';
|
|
849
866
|
declare const GetterPropType: {
|
|
@@ -888,11 +905,12 @@ type ScalarValue = {
|
|
|
888
905
|
imports: GeneratorImport[];
|
|
889
906
|
schemas: GeneratorSchema[];
|
|
890
907
|
isRef: boolean;
|
|
908
|
+
dependencies: string[];
|
|
891
909
|
example?: any;
|
|
892
910
|
examples?: Record<string, any>;
|
|
893
911
|
};
|
|
894
912
|
type ResolverValue = ScalarValue & {
|
|
895
|
-
originalSchema:
|
|
913
|
+
originalSchema: OpenApiSchemaObject;
|
|
896
914
|
};
|
|
897
915
|
type ResReqTypesValue = ScalarValue & {
|
|
898
916
|
formData?: string;
|
|
@@ -901,26 +919,27 @@ type ResReqTypesValue = ScalarValue & {
|
|
|
901
919
|
hasReadonlyProps?: boolean;
|
|
902
920
|
key: string;
|
|
903
921
|
contentType: string;
|
|
904
|
-
originalSchema?:
|
|
922
|
+
originalSchema?: OpenApiSchemaObject;
|
|
905
923
|
};
|
|
906
|
-
type
|
|
924
|
+
type WriteSpecBuilder = {
|
|
907
925
|
operations: GeneratorOperations;
|
|
908
|
-
schemas: Record<string, GeneratorSchema[]>;
|
|
909
926
|
verbOptions: Record<string, GeneratorVerbOptions>;
|
|
927
|
+
schemas: GeneratorSchema[];
|
|
910
928
|
title: GeneratorClientTitle;
|
|
911
929
|
header: GeneratorClientHeader;
|
|
912
930
|
footer: GeneratorClientFooter;
|
|
913
931
|
imports: GeneratorClientImports;
|
|
914
932
|
importsMock: GenerateMockImports;
|
|
915
933
|
extraFiles: ClientFileBuilder[];
|
|
916
|
-
info:
|
|
934
|
+
info: OpenApiInfoObject;
|
|
917
935
|
target: string;
|
|
936
|
+
spec: OpenApiDocument;
|
|
918
937
|
};
|
|
919
938
|
type WriteModeProps = {
|
|
920
|
-
builder:
|
|
939
|
+
builder: WriteSpecBuilder;
|
|
921
940
|
output: NormalizedOutputOptions;
|
|
922
941
|
workspace: string;
|
|
923
|
-
|
|
942
|
+
projectName?: string;
|
|
924
943
|
header: string;
|
|
925
944
|
needSchema: boolean;
|
|
926
945
|
};
|
|
@@ -967,7 +986,7 @@ type GeneratorClientImports = (data: {
|
|
|
967
986
|
exports: GeneratorImport[];
|
|
968
987
|
dependency: string;
|
|
969
988
|
}[];
|
|
970
|
-
|
|
989
|
+
projectName?: string;
|
|
971
990
|
hasSchemaDir: boolean;
|
|
972
991
|
isAllowSyntheticDefaultImports: boolean;
|
|
973
992
|
hasGlobalMutator: boolean;
|
|
@@ -982,7 +1001,7 @@ type GenerateMockImports = (data: {
|
|
|
982
1001
|
exports: GeneratorImport[];
|
|
983
1002
|
dependency: string;
|
|
984
1003
|
}[];
|
|
985
|
-
|
|
1004
|
+
projectName?: string;
|
|
986
1005
|
hasSchemaDir: boolean;
|
|
987
1006
|
isAllowSyntheticDefaultImports: boolean;
|
|
988
1007
|
options?: GlobalMockOptions;
|
|
@@ -995,13 +1014,30 @@ type GeneratorApiBuilder = GeneratorApiOperations & {
|
|
|
995
1014
|
importsMock: GenerateMockImports;
|
|
996
1015
|
extraFiles: ClientFileBuilder[];
|
|
997
1016
|
};
|
|
998
|
-
interface SchemaWithConst extends SchemaObject {
|
|
999
|
-
const: string;
|
|
1000
|
-
}
|
|
1001
1017
|
declare class ErrorWithTag extends Error {
|
|
1002
1018
|
tag: string;
|
|
1003
1019
|
constructor(message: string, tag: string, options?: ErrorOptions);
|
|
1004
1020
|
}
|
|
1021
|
+
type OpenApiSchemaObjectType = 'string' | 'number' | 'boolean' | 'object' | 'integer' | 'null' | 'array';
|
|
1022
|
+
type OpenApiDocument = OpenAPIV3_1.Document;
|
|
1023
|
+
type OpenApiSchemaObject = OpenAPIV3_1.SchemaObject;
|
|
1024
|
+
type OpenApiSchemasObject = Record<string, OpenApiSchemaObject>;
|
|
1025
|
+
type OpenApiReferenceObject = OpenAPIV3_1.ReferenceObject & {
|
|
1026
|
+
$ref?: string;
|
|
1027
|
+
};
|
|
1028
|
+
type OpenApiComponentsObject = OpenAPIV3_1.ComponentsObject;
|
|
1029
|
+
type OpenApiPathsObject = OpenAPIV3_1.PathsObject;
|
|
1030
|
+
type OpenApiPathItemObject = OpenAPIV3_1.PathItemObject;
|
|
1031
|
+
type OpenApiResponsesObject = OpenAPIV3_1.ResponsesObject;
|
|
1032
|
+
type OpenApiResponseObject = OpenAPIV3_1.ResponseObject;
|
|
1033
|
+
type OpenApiParameterObject = OpenAPIV3_1.ParameterObject;
|
|
1034
|
+
type OpenApiRequestBodyObject = OpenAPIV3_1.RequestBodyObject;
|
|
1035
|
+
type OpenApiInfoObject = OpenAPIV3_1.InfoObject;
|
|
1036
|
+
type OpenApiExampleObject = OpenAPIV3_1.ExampleObject;
|
|
1037
|
+
type OpenApiOperationObject = OpenAPIV3_1.OperationObject;
|
|
1038
|
+
type OpenApiMediaTypeObject = OpenAPIV3_1.MediaTypeObject;
|
|
1039
|
+
type OpenApiEncodingObject = OpenAPIV3_1.EncodingObject;
|
|
1040
|
+
type OpenApiServerObject = OpenAPIV3_1.ServerObject;
|
|
1005
1041
|
//#endregion
|
|
1006
1042
|
//#region src/constants.d.ts
|
|
1007
1043
|
declare const generalJSTypes: string[];
|
|
@@ -1011,95 +1047,88 @@ declare const URL_REGEX: RegExp;
|
|
|
1011
1047
|
declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
1012
1048
|
//#endregion
|
|
1013
1049
|
//#region src/generators/component-definition.d.ts
|
|
1014
|
-
declare
|
|
1050
|
+
declare function generateComponentDefinition(responses: OpenApiComponentsObject['responses'] | OpenApiComponentsObject['requestBodies'], context: ContextSpec, suffix: string): GeneratorSchema[];
|
|
1015
1051
|
//#endregion
|
|
1016
1052
|
//#region src/generators/imports.d.ts
|
|
1017
|
-
|
|
1018
|
-
imports,
|
|
1019
|
-
target,
|
|
1020
|
-
isRootKey,
|
|
1021
|
-
specsName,
|
|
1022
|
-
specKey: currentSpecKey,
|
|
1023
|
-
namingConvention
|
|
1024
|
-
}: {
|
|
1053
|
+
interface GenerateImportsOptions {
|
|
1025
1054
|
imports: GeneratorImport[];
|
|
1026
1055
|
target: string;
|
|
1027
|
-
isRootKey: boolean;
|
|
1028
|
-
specsName: Record<string, string>;
|
|
1029
|
-
specKey: string;
|
|
1030
1056
|
namingConvention?: NamingConvention;
|
|
1031
|
-
}
|
|
1032
|
-
declare
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1057
|
+
}
|
|
1058
|
+
declare function generateImports({
|
|
1059
|
+
imports,
|
|
1060
|
+
namingConvention
|
|
1061
|
+
}: GenerateImportsOptions): string;
|
|
1062
|
+
interface GenerateMutatorImportsOptions {
|
|
1037
1063
|
mutators: GeneratorMutator[];
|
|
1038
1064
|
implementation?: string;
|
|
1039
1065
|
oneMore?: boolean;
|
|
1040
|
-
}
|
|
1041
|
-
declare
|
|
1066
|
+
}
|
|
1067
|
+
declare function generateMutatorImports({
|
|
1068
|
+
mutators,
|
|
1042
1069
|
implementation,
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
hasSchemaDir,
|
|
1047
|
-
isAllowSyntheticDefaultImports
|
|
1048
|
-
}: {
|
|
1070
|
+
oneMore
|
|
1071
|
+
}: GenerateMutatorImportsOptions): string;
|
|
1072
|
+
interface AddDependencyOptions {
|
|
1049
1073
|
implementation: string;
|
|
1050
1074
|
exports: GeneratorImport[];
|
|
1051
1075
|
dependency: string;
|
|
1052
|
-
|
|
1076
|
+
projectName?: string;
|
|
1053
1077
|
hasSchemaDir: boolean;
|
|
1054
1078
|
isAllowSyntheticDefaultImports: boolean;
|
|
1055
|
-
}
|
|
1056
|
-
declare
|
|
1079
|
+
}
|
|
1080
|
+
declare function addDependency({
|
|
1081
|
+
implementation,
|
|
1082
|
+
exports,
|
|
1083
|
+
dependency,
|
|
1084
|
+
projectName,
|
|
1085
|
+
hasSchemaDir,
|
|
1086
|
+
isAllowSyntheticDefaultImports
|
|
1087
|
+
}: AddDependencyOptions): string | undefined;
|
|
1088
|
+
declare function generateDependencyImports(implementation: string, imports: {
|
|
1057
1089
|
exports: GeneratorImport[];
|
|
1058
1090
|
dependency: string;
|
|
1059
|
-
}[],
|
|
1060
|
-
declare
|
|
1091
|
+
}[], projectName: string | undefined, hasSchemaDir: boolean, isAllowSyntheticDefaultImports: boolean): string;
|
|
1092
|
+
declare function generateVerbImports({
|
|
1061
1093
|
response,
|
|
1062
1094
|
body,
|
|
1063
1095
|
queryParams,
|
|
1064
1096
|
props,
|
|
1065
1097
|
headers,
|
|
1066
1098
|
params
|
|
1067
|
-
}: GeneratorVerbOptions)
|
|
1099
|
+
}: GeneratorVerbOptions): GeneratorImport[];
|
|
1068
1100
|
//#endregion
|
|
1069
1101
|
//#region src/generators/models-inline.d.ts
|
|
1070
|
-
declare
|
|
1071
|
-
declare
|
|
1102
|
+
declare function generateModelInline(acc: string, model: string): string;
|
|
1103
|
+
declare function generateModelsInline(obj: Record<string, GeneratorSchema[]>): string;
|
|
1072
1104
|
//#endregion
|
|
1073
1105
|
//#region src/generators/mutator.d.ts
|
|
1074
1106
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
1107
|
+
interface GenerateMutatorOptions {
|
|
1108
|
+
output?: string;
|
|
1109
|
+
mutator?: NormalizedMutator;
|
|
1110
|
+
name: string;
|
|
1111
|
+
workspace: string;
|
|
1112
|
+
tsconfig?: Tsconfig;
|
|
1113
|
+
}
|
|
1075
1114
|
declare function generateMutator({
|
|
1076
1115
|
output,
|
|
1077
1116
|
mutator,
|
|
1078
1117
|
name,
|
|
1079
1118
|
workspace,
|
|
1080
1119
|
tsconfig
|
|
1081
|
-
}:
|
|
1082
|
-
output?: string;
|
|
1083
|
-
mutator?: NormalizedMutator;
|
|
1084
|
-
name: string;
|
|
1085
|
-
workspace: string;
|
|
1086
|
-
tsconfig?: Tsconfig;
|
|
1087
|
-
}): Promise<GeneratorMutator | undefined>;
|
|
1120
|
+
}: GenerateMutatorOptions): Promise<GeneratorMutator | undefined>;
|
|
1088
1121
|
//#endregion
|
|
1089
1122
|
//#region src/generators/options.d.ts
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
isAngular,
|
|
1100
|
-
paramsSerializer,
|
|
1101
|
-
paramsSerializerOptions
|
|
1102
|
-
}: {
|
|
1123
|
+
interface GenerateFormDataAndUrlEncodedFunctionOptions {
|
|
1124
|
+
body: GetterBody;
|
|
1125
|
+
formData?: GeneratorMutator;
|
|
1126
|
+
formUrlEncoded?: GeneratorMutator;
|
|
1127
|
+
isFormData: boolean;
|
|
1128
|
+
isFormUrlEncoded: boolean;
|
|
1129
|
+
}
|
|
1130
|
+
declare function generateBodyOptions(body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean): string;
|
|
1131
|
+
interface GenerateAxiosOptions {
|
|
1103
1132
|
response: GetterResponse;
|
|
1104
1133
|
isExactOptionalPropertyTypes: boolean;
|
|
1105
1134
|
queryParams?: GeneratorSchema;
|
|
@@ -1110,24 +1139,20 @@ declare const generateAxiosOptions: ({
|
|
|
1110
1139
|
isAngular: boolean;
|
|
1111
1140
|
paramsSerializer?: GeneratorMutator;
|
|
1112
1141
|
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1113
|
-
}
|
|
1114
|
-
declare
|
|
1115
|
-
route,
|
|
1116
|
-
body,
|
|
1117
|
-
headers,
|
|
1118
|
-
queryParams,
|
|
1142
|
+
}
|
|
1143
|
+
declare function generateAxiosOptions({
|
|
1119
1144
|
response,
|
|
1120
|
-
verb,
|
|
1121
|
-
requestOptions,
|
|
1122
|
-
isFormData,
|
|
1123
|
-
isFormUrlEncoded,
|
|
1124
|
-
isAngular,
|
|
1125
1145
|
isExactOptionalPropertyTypes,
|
|
1146
|
+
queryParams,
|
|
1147
|
+
headers,
|
|
1148
|
+
requestOptions,
|
|
1126
1149
|
hasSignal,
|
|
1127
1150
|
isVue,
|
|
1151
|
+
isAngular,
|
|
1128
1152
|
paramsSerializer,
|
|
1129
1153
|
paramsSerializerOptions
|
|
1130
|
-
}:
|
|
1154
|
+
}: GenerateAxiosOptions): string;
|
|
1155
|
+
interface GenerateOptionsOptions {
|
|
1131
1156
|
route: string;
|
|
1132
1157
|
body: GetterBody;
|
|
1133
1158
|
headers?: GetterQueryParam;
|
|
@@ -1143,22 +1168,27 @@ declare const generateOptions: ({
|
|
|
1143
1168
|
isVue?: boolean;
|
|
1144
1169
|
paramsSerializer?: GeneratorMutator;
|
|
1145
1170
|
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1146
|
-
}
|
|
1147
|
-
declare
|
|
1148
|
-
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, isVue: boolean, queryParams?: GetterQueryParam) => string;
|
|
1149
|
-
declare const generateMutatorConfig: ({
|
|
1171
|
+
}
|
|
1172
|
+
declare function generateOptions({
|
|
1150
1173
|
route,
|
|
1151
1174
|
body,
|
|
1152
1175
|
headers,
|
|
1153
1176
|
queryParams,
|
|
1154
1177
|
response,
|
|
1155
1178
|
verb,
|
|
1179
|
+
requestOptions,
|
|
1156
1180
|
isFormData,
|
|
1157
1181
|
isFormUrlEncoded,
|
|
1158
|
-
|
|
1182
|
+
isAngular,
|
|
1159
1183
|
isExactOptionalPropertyTypes,
|
|
1160
|
-
|
|
1161
|
-
|
|
1184
|
+
hasSignal,
|
|
1185
|
+
isVue,
|
|
1186
|
+
paramsSerializer,
|
|
1187
|
+
paramsSerializerOptions
|
|
1188
|
+
}: GenerateOptionsOptions): string;
|
|
1189
|
+
declare function generateBodyMutatorConfig(body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean): string;
|
|
1190
|
+
declare function generateQueryParamsAxiosConfig(response: GetterResponse, isVue: boolean, queryParams?: GetterQueryParam): string;
|
|
1191
|
+
interface GenerateMutatorConfigOptions {
|
|
1162
1192
|
route: string;
|
|
1163
1193
|
body: GetterBody;
|
|
1164
1194
|
headers?: GetterQueryParam;
|
|
@@ -1170,24 +1200,31 @@ declare const generateMutatorConfig: ({
|
|
|
1170
1200
|
hasSignal: boolean;
|
|
1171
1201
|
isExactOptionalPropertyTypes: boolean;
|
|
1172
1202
|
isVue?: boolean;
|
|
1173
|
-
}
|
|
1174
|
-
declare
|
|
1175
|
-
|
|
1203
|
+
}
|
|
1204
|
+
declare function generateMutatorConfig({
|
|
1205
|
+
route,
|
|
1206
|
+
body,
|
|
1207
|
+
headers,
|
|
1208
|
+
queryParams,
|
|
1209
|
+
response,
|
|
1210
|
+
verb,
|
|
1211
|
+
isFormData,
|
|
1212
|
+
isFormUrlEncoded,
|
|
1213
|
+
hasSignal,
|
|
1214
|
+
isExactOptionalPropertyTypes,
|
|
1215
|
+
isVue
|
|
1216
|
+
}: GenerateMutatorConfigOptions): string;
|
|
1217
|
+
declare function generateMutatorRequestOptions(requestOptions: boolean | object | undefined, hasSecondArgument: boolean): string;
|
|
1218
|
+
declare function generateFormDataAndUrlEncodedFunction({
|
|
1176
1219
|
body,
|
|
1177
1220
|
formData,
|
|
1178
1221
|
formUrlEncoded,
|
|
1179
1222
|
isFormData,
|
|
1180
1223
|
isFormUrlEncoded
|
|
1181
|
-
}:
|
|
1182
|
-
body: GetterBody;
|
|
1183
|
-
formData?: GeneratorMutator;
|
|
1184
|
-
formUrlEncoded?: GeneratorMutator;
|
|
1185
|
-
isFormData: boolean;
|
|
1186
|
-
isFormUrlEncoded: boolean;
|
|
1187
|
-
}) => string;
|
|
1224
|
+
}: GenerateFormDataAndUrlEncodedFunctionOptions): string;
|
|
1188
1225
|
//#endregion
|
|
1189
1226
|
//#region src/generators/parameter-definition.d.ts
|
|
1190
|
-
declare
|
|
1227
|
+
declare function generateParameterDefinition(parameters: OpenApiComponentsObject['parameters'], context: ContextSpec, suffix: string): GeneratorSchema[];
|
|
1191
1228
|
//#endregion
|
|
1192
1229
|
//#region src/generators/schema-definition.d.ts
|
|
1193
1230
|
/**
|
|
@@ -1195,58 +1232,80 @@ declare const generateParameterDefinition: (parameters: ComponentsObject["parame
|
|
|
1195
1232
|
*
|
|
1196
1233
|
* @param schemas
|
|
1197
1234
|
*/
|
|
1198
|
-
declare
|
|
1235
|
+
declare function generateSchemasDefinition(schemas: OpenApiSchemasObject | undefined, context: ContextSpec, suffix: string, filters?: InputFiltersOptions): GeneratorSchema[];
|
|
1199
1236
|
//#endregion
|
|
1200
1237
|
//#region src/generators/verbs-options.d.ts
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1238
|
+
interface GenerateVerbOptionsParams {
|
|
1239
|
+
verb: Verbs;
|
|
1240
|
+
output: NormalizedOutputOptions;
|
|
1241
|
+
operation: OpenApiOperationObject;
|
|
1242
|
+
route: string;
|
|
1243
|
+
pathRoute: string;
|
|
1244
|
+
verbParameters?: OpenApiPathItemObject['parameters'];
|
|
1245
|
+
components?: OpenApiComponentsObject;
|
|
1246
|
+
context: ContextSpec;
|
|
1247
|
+
}
|
|
1248
|
+
declare function generateVerbOptions({
|
|
1249
|
+
verb,
|
|
1204
1250
|
output,
|
|
1251
|
+
operation,
|
|
1205
1252
|
route,
|
|
1206
1253
|
pathRoute,
|
|
1254
|
+
verbParameters,
|
|
1207
1255
|
context
|
|
1208
|
-
}:
|
|
1209
|
-
|
|
1256
|
+
}: GenerateVerbOptionsParams): Promise<GeneratorVerbOptions>;
|
|
1257
|
+
interface GenerateVerbsOptionsParams {
|
|
1258
|
+
verbs: OpenApiPathItemObject;
|
|
1210
1259
|
input: NormalizedInputOptions;
|
|
1211
1260
|
output: NormalizedOutputOptions;
|
|
1212
1261
|
route: string;
|
|
1213
1262
|
pathRoute: string;
|
|
1214
|
-
context:
|
|
1215
|
-
}
|
|
1216
|
-
declare
|
|
1263
|
+
context: ContextSpec;
|
|
1264
|
+
}
|
|
1265
|
+
declare function generateVerbsOptions({
|
|
1266
|
+
verbs,
|
|
1267
|
+
input,
|
|
1268
|
+
output,
|
|
1269
|
+
route,
|
|
1270
|
+
pathRoute,
|
|
1271
|
+
context
|
|
1272
|
+
}: GenerateVerbsOptionsParams): Promise<GeneratorVerbsOptions>;
|
|
1273
|
+
declare function _filteredVerbs(verbs: OpenApiPathItemObject, filters: NormalizedInputOptions['filters']): [string, any][];
|
|
1217
1274
|
//#endregion
|
|
1218
1275
|
//#region src/getters/array.d.ts
|
|
1276
|
+
interface GetArrayOptions {
|
|
1277
|
+
schema: OpenApiSchemaObject;
|
|
1278
|
+
name?: string;
|
|
1279
|
+
context: ContextSpec;
|
|
1280
|
+
}
|
|
1219
1281
|
/**
|
|
1220
1282
|
* Return the output type from an array
|
|
1221
1283
|
*
|
|
1222
1284
|
* @param item item with type === "array"
|
|
1223
1285
|
*/
|
|
1224
|
-
declare
|
|
1286
|
+
declare function getArray({
|
|
1225
1287
|
schema,
|
|
1226
1288
|
name,
|
|
1227
1289
|
context
|
|
1228
|
-
}:
|
|
1229
|
-
schema: SchemaObject;
|
|
1230
|
-
name?: string;
|
|
1231
|
-
context: ContextSpecs;
|
|
1232
|
-
}) => ScalarValue;
|
|
1290
|
+
}: GetArrayOptions): ScalarValue;
|
|
1233
1291
|
//#endregion
|
|
1234
1292
|
//#region src/getters/body.d.ts
|
|
1235
|
-
|
|
1293
|
+
interface GetBodyOptions {
|
|
1294
|
+
requestBody: OpenApiReferenceObject | OpenApiRequestBodyObject;
|
|
1295
|
+
operationName: string;
|
|
1296
|
+
context: ContextSpec;
|
|
1297
|
+
contentType?: OverrideOutputContentType;
|
|
1298
|
+
}
|
|
1299
|
+
declare function getBody({
|
|
1236
1300
|
requestBody,
|
|
1237
1301
|
operationName,
|
|
1238
1302
|
context,
|
|
1239
1303
|
contentType
|
|
1240
|
-
}:
|
|
1241
|
-
requestBody: ReferenceObject | RequestBodyObject;
|
|
1242
|
-
operationName: string;
|
|
1243
|
-
context: ContextSpecs;
|
|
1244
|
-
contentType?: OverrideOutputContentType;
|
|
1245
|
-
}) => GetterBody;
|
|
1304
|
+
}: GetBodyOptions): GetterBody;
|
|
1246
1305
|
//#endregion
|
|
1247
1306
|
//#region src/getters/combine.d.ts
|
|
1248
1307
|
type Separator = 'allOf' | 'anyOf' | 'oneOf';
|
|
1249
|
-
declare
|
|
1308
|
+
declare function combineSchemas({
|
|
1250
1309
|
name,
|
|
1251
1310
|
schema,
|
|
1252
1311
|
separator,
|
|
@@ -1254,53 +1313,61 @@ declare const combineSchemas: ({
|
|
|
1254
1313
|
nullable
|
|
1255
1314
|
}: {
|
|
1256
1315
|
name?: string;
|
|
1257
|
-
schema:
|
|
1316
|
+
schema: OpenApiSchemaObject;
|
|
1258
1317
|
separator: Separator;
|
|
1259
|
-
context:
|
|
1318
|
+
context: ContextSpec;
|
|
1260
1319
|
nullable: string;
|
|
1261
|
-
})
|
|
1320
|
+
}): ScalarValue;
|
|
1262
1321
|
//#endregion
|
|
1263
1322
|
//#region src/getters/discriminators.d.ts
|
|
1264
|
-
declare
|
|
1323
|
+
declare function resolveDiscriminators(schemas: OpenApiSchemasObject, context: ContextSpec): OpenApiSchemasObject;
|
|
1265
1324
|
//#endregion
|
|
1266
1325
|
//#region src/getters/enum.d.ts
|
|
1267
|
-
declare
|
|
1268
|
-
declare
|
|
1269
|
-
declare
|
|
1270
|
-
declare
|
|
1326
|
+
declare function getEnumNames(schemaObject: OpenApiSchemaObject | undefined): any;
|
|
1327
|
+
declare function getEnumDescriptions(schemaObject: OpenApiSchemaObject | undefined): any;
|
|
1328
|
+
declare function getEnum(value: string, enumName: string, names: string[] | undefined, enumGenerationType: EnumGeneration, descriptions?: string[], enumNamingConvention?: NamingConvention): string;
|
|
1329
|
+
declare function getEnumImplementation(value: string, names?: string[], descriptions?: string[], enumNamingConvention?: NamingConvention): string;
|
|
1271
1330
|
//#endregion
|
|
1272
1331
|
//#region src/getters/keys.d.ts
|
|
1273
|
-
declare
|
|
1332
|
+
declare function getKey(key: string): string;
|
|
1274
1333
|
//#endregion
|
|
1275
1334
|
//#region src/getters/object.d.ts
|
|
1335
|
+
interface GetObjectOptions {
|
|
1336
|
+
item: OpenApiSchemaObject;
|
|
1337
|
+
name?: string;
|
|
1338
|
+
context: ContextSpec;
|
|
1339
|
+
nullable: string;
|
|
1340
|
+
/**
|
|
1341
|
+
* Override resolved values for properties at THIS level only.
|
|
1342
|
+
* Not passed to nested schemas. Used by form-data for file type handling.
|
|
1343
|
+
*/
|
|
1344
|
+
propertyOverrides?: Record<string, ScalarValue>;
|
|
1345
|
+
}
|
|
1276
1346
|
/**
|
|
1277
1347
|
* Return the output type from an object
|
|
1278
1348
|
*
|
|
1279
1349
|
* @param item item with type === "object"
|
|
1280
1350
|
*/
|
|
1281
|
-
declare
|
|
1351
|
+
declare function getObject({
|
|
1282
1352
|
item,
|
|
1283
1353
|
name,
|
|
1284
1354
|
context,
|
|
1285
|
-
nullable
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
name?: string;
|
|
1289
|
-
context: ContextSpecs;
|
|
1290
|
-
nullable: string;
|
|
1291
|
-
}) => ScalarValue;
|
|
1355
|
+
nullable,
|
|
1356
|
+
propertyOverrides
|
|
1357
|
+
}: GetObjectOptions): ScalarValue;
|
|
1292
1358
|
//#endregion
|
|
1293
1359
|
//#region src/getters/operation.d.ts
|
|
1294
|
-
declare
|
|
1360
|
+
declare function getOperationId(operation: OpenApiOperationObject, route: string, verb: Verbs): string;
|
|
1295
1361
|
//#endregion
|
|
1296
1362
|
//#region src/getters/parameters.d.ts
|
|
1297
|
-
|
|
1363
|
+
interface GetParametersOptions {
|
|
1364
|
+
parameters: (OpenApiReferenceObject | OpenApiParameterObject)[];
|
|
1365
|
+
context: ContextSpec;
|
|
1366
|
+
}
|
|
1367
|
+
declare function getParameters({
|
|
1298
1368
|
parameters,
|
|
1299
1369
|
context
|
|
1300
|
-
}:
|
|
1301
|
-
parameters: (ReferenceObject | ParameterObject)[];
|
|
1302
|
-
context: ContextSpecs;
|
|
1303
|
-
}) => GetterParameters;
|
|
1370
|
+
}: GetParametersOptions): GetterParameters;
|
|
1304
1371
|
//#endregion
|
|
1305
1372
|
//#region src/getters/params.d.ts
|
|
1306
1373
|
/**
|
|
@@ -1313,50 +1380,53 @@ declare const getParameters: ({
|
|
|
1313
1380
|
* ```
|
|
1314
1381
|
* @param path
|
|
1315
1382
|
*/
|
|
1316
|
-
declare
|
|
1317
|
-
|
|
1383
|
+
declare function getParamsInPath(path: string): string[];
|
|
1384
|
+
interface GetParamsOptions {
|
|
1385
|
+
route: string;
|
|
1386
|
+
pathParams?: GetterParameters['query'];
|
|
1387
|
+
operationId: string;
|
|
1388
|
+
context: ContextSpec;
|
|
1389
|
+
output: NormalizedOutputOptions;
|
|
1390
|
+
}
|
|
1391
|
+
declare function getParams({
|
|
1318
1392
|
route,
|
|
1319
1393
|
pathParams,
|
|
1320
1394
|
operationId,
|
|
1321
1395
|
context,
|
|
1322
1396
|
output
|
|
1323
|
-
}:
|
|
1324
|
-
route: string;
|
|
1325
|
-
pathParams?: GetterParameters["query"];
|
|
1326
|
-
operationId: string;
|
|
1327
|
-
context: ContextSpecs;
|
|
1328
|
-
output: NormalizedOutputOptions;
|
|
1329
|
-
}) => GetterParams;
|
|
1397
|
+
}: GetParamsOptions): GetterParams;
|
|
1330
1398
|
//#endregion
|
|
1331
1399
|
//#region src/getters/props.d.ts
|
|
1332
|
-
|
|
1400
|
+
interface GetPropsOptions {
|
|
1401
|
+
body: GetterBody;
|
|
1402
|
+
queryParams?: GetterQueryParam;
|
|
1403
|
+
params: GetterParams;
|
|
1404
|
+
operationName: string;
|
|
1405
|
+
headers?: GetterQueryParam;
|
|
1406
|
+
context: ContextSpec;
|
|
1407
|
+
}
|
|
1408
|
+
declare function getProps({
|
|
1333
1409
|
body,
|
|
1334
1410
|
queryParams,
|
|
1335
1411
|
params,
|
|
1336
1412
|
operationName,
|
|
1337
1413
|
headers,
|
|
1338
1414
|
context
|
|
1339
|
-
}:
|
|
1340
|
-
body: GetterBody;
|
|
1341
|
-
queryParams?: GetterQueryParam;
|
|
1342
|
-
params: GetterParams;
|
|
1343
|
-
operationName: string;
|
|
1344
|
-
headers?: GetterQueryParam;
|
|
1345
|
-
context: ContextSpecs;
|
|
1346
|
-
}) => GetterProps;
|
|
1415
|
+
}: GetPropsOptions): GetterProps;
|
|
1347
1416
|
//#endregion
|
|
1348
1417
|
//#region src/getters/query-params.d.ts
|
|
1349
|
-
|
|
1418
|
+
interface GetQueryParamsOptions {
|
|
1419
|
+
queryParams: GetterParameters['query'];
|
|
1420
|
+
operationName: string;
|
|
1421
|
+
context: ContextSpec;
|
|
1422
|
+
suffix?: string;
|
|
1423
|
+
}
|
|
1424
|
+
declare function getQueryParams({
|
|
1350
1425
|
queryParams,
|
|
1351
1426
|
operationName,
|
|
1352
1427
|
context,
|
|
1353
1428
|
suffix
|
|
1354
|
-
}:
|
|
1355
|
-
queryParams: GetterParameters["query"];
|
|
1356
|
-
operationName: string;
|
|
1357
|
-
context: ContextSpecs;
|
|
1358
|
-
suffix?: string;
|
|
1359
|
-
}) => GetterQueryParam | undefined;
|
|
1429
|
+
}: GetQueryParamsOptions): GetterQueryParam | undefined;
|
|
1360
1430
|
//#endregion
|
|
1361
1431
|
//#region src/getters/ref.d.ts
|
|
1362
1432
|
type RefComponent = 'schemas' | 'responses' | 'parameters' | 'requestBodies';
|
|
@@ -1371,86 +1441,99 @@ interface RefInfo {
|
|
|
1371
1441
|
name: string;
|
|
1372
1442
|
originalName: string;
|
|
1373
1443
|
refPaths?: string[];
|
|
1374
|
-
specKey?: string;
|
|
1375
1444
|
}
|
|
1376
1445
|
/**
|
|
1377
1446
|
* Return the output type from the $ref
|
|
1378
1447
|
*
|
|
1379
1448
|
* @param $ref
|
|
1380
1449
|
*/
|
|
1381
|
-
declare
|
|
1450
|
+
declare function getRefInfo($ref: string, context: ContextSpec): RefInfo;
|
|
1382
1451
|
//#endregion
|
|
1383
1452
|
//#region src/getters/res-req-types.d.ts
|
|
1384
|
-
declare
|
|
1453
|
+
declare function getResReqTypes(responsesOrRequests: [string, OpenApiReferenceObject | OpenApiResponseObject | OpenApiRequestBodyObject][], name: string, context: ContextSpec, defaultType?: string, uniqueKey?: (item: ResReqTypesValue, index: number, data: ResReqTypesValue[]) => unknown): ResReqTypesValue[];
|
|
1454
|
+
declare function isBinaryContentType(contentType: string): boolean;
|
|
1455
|
+
/**
|
|
1456
|
+
* Determine if a form-data root field should be treated as binary or text file
|
|
1457
|
+
* based on encoding.contentType or contentMediaType.
|
|
1458
|
+
*
|
|
1459
|
+
* Returns:
|
|
1460
|
+
* - 'binary': field is a binary file (Blob in types, File in zod)
|
|
1461
|
+
* - 'text': field is a text file that can accept string (Blob | string in types, File | string in zod)
|
|
1462
|
+
* - undefined: no override, use standard resolution
|
|
1463
|
+
*/
|
|
1464
|
+
declare function getFormDataFieldFileType(resolvedSchema: OpenApiSchemaObject, encodingContentType: string | undefined): 'binary' | 'text' | undefined;
|
|
1385
1465
|
//#endregion
|
|
1386
1466
|
//#region src/getters/response.d.ts
|
|
1387
|
-
|
|
1467
|
+
interface GetResponseOptions {
|
|
1468
|
+
responses: OpenApiResponsesObject;
|
|
1469
|
+
operationName: string;
|
|
1470
|
+
context: ContextSpec;
|
|
1471
|
+
contentType?: OverrideOutputContentType;
|
|
1472
|
+
}
|
|
1473
|
+
declare function getResponse({
|
|
1388
1474
|
responses,
|
|
1389
1475
|
operationName,
|
|
1390
1476
|
context,
|
|
1391
1477
|
contentType
|
|
1392
|
-
}:
|
|
1393
|
-
responses: ResponsesObject;
|
|
1394
|
-
operationName: string;
|
|
1395
|
-
context: ContextSpecs;
|
|
1396
|
-
contentType?: OverrideOutputContentType;
|
|
1397
|
-
}) => GetterResponse;
|
|
1478
|
+
}: GetResponseOptions): GetterResponse;
|
|
1398
1479
|
//#endregion
|
|
1399
1480
|
//#region src/getters/route.d.ts
|
|
1400
|
-
declare
|
|
1401
|
-
declare
|
|
1402
|
-
declare
|
|
1481
|
+
declare function getRoute(route: string): string;
|
|
1482
|
+
declare function getFullRoute(route: string, servers: OpenApiServerObject[] | undefined, baseUrl: string | BaseUrlFromConstant | BaseUrlFromSpec | undefined): string;
|
|
1483
|
+
declare function getRouteAsArray(route: string): string;
|
|
1403
1484
|
//#endregion
|
|
1404
1485
|
//#region src/getters/scalar.d.ts
|
|
1486
|
+
interface GetScalarOptions {
|
|
1487
|
+
item: OpenApiSchemaObject;
|
|
1488
|
+
name?: string;
|
|
1489
|
+
context: ContextSpec;
|
|
1490
|
+
}
|
|
1405
1491
|
/**
|
|
1406
1492
|
* Return the typescript equivalent of open-api data type
|
|
1407
1493
|
*
|
|
1408
1494
|
* @param item
|
|
1409
|
-
* @ref https://github.com/OAI/OpenAPI-Specification/blob/
|
|
1495
|
+
* @ref https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#data-types
|
|
1410
1496
|
*/
|
|
1411
|
-
declare
|
|
1497
|
+
declare function getScalar({
|
|
1412
1498
|
item,
|
|
1413
1499
|
name,
|
|
1414
1500
|
context
|
|
1415
|
-
}:
|
|
1416
|
-
item: SchemaObject;
|
|
1417
|
-
name?: string;
|
|
1418
|
-
context: ContextSpecs;
|
|
1419
|
-
}) => ScalarValue;
|
|
1501
|
+
}: GetScalarOptions): ScalarValue;
|
|
1420
1502
|
//#endregion
|
|
1421
1503
|
//#region src/resolvers/object.d.ts
|
|
1422
|
-
|
|
1504
|
+
interface ResolveOptions {
|
|
1505
|
+
schema: OpenApiSchemaObject | OpenApiReferenceObject;
|
|
1506
|
+
propName?: string;
|
|
1507
|
+
combined?: boolean;
|
|
1508
|
+
context: ContextSpec;
|
|
1509
|
+
}
|
|
1510
|
+
declare function resolveObject({
|
|
1423
1511
|
schema,
|
|
1424
1512
|
propName,
|
|
1425
1513
|
combined,
|
|
1426
1514
|
context
|
|
1427
|
-
}:
|
|
1428
|
-
schema: SchemaObject | ReferenceObject;
|
|
1429
|
-
propName?: string;
|
|
1430
|
-
combined?: boolean;
|
|
1431
|
-
context: ContextSpecs;
|
|
1432
|
-
}) => ResolverValue;
|
|
1515
|
+
}: ResolveOptions): ResolverValue;
|
|
1433
1516
|
//#endregion
|
|
1434
1517
|
//#region src/resolvers/ref.d.ts
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
schema: Schema;
|
|
1518
|
+
declare function resolveRef<TSchema extends OpenApiComponentsObject = OpenApiComponentsObject>(schema: OpenApiComponentsObject, context: ContextSpec, imports?: GeneratorImport[]): {
|
|
1519
|
+
schema: TSchema;
|
|
1438
1520
|
imports: GeneratorImport[];
|
|
1439
1521
|
};
|
|
1440
|
-
type Example =
|
|
1522
|
+
type Example = OpenApiExampleObject | OpenApiReferenceObject;
|
|
1441
1523
|
type Examples = Example[] | Record<string, Example> | undefined;
|
|
1442
|
-
declare
|
|
1524
|
+
declare function resolveExampleRefs(examples: Examples, context: ContextSpec): Examples;
|
|
1443
1525
|
//#endregion
|
|
1444
1526
|
//#region src/resolvers/value.d.ts
|
|
1445
|
-
|
|
1527
|
+
interface ResolveValueOptions {
|
|
1528
|
+
schema: OpenApiSchemaObject | OpenApiReferenceObject;
|
|
1529
|
+
name?: string;
|
|
1530
|
+
context: ContextSpec;
|
|
1531
|
+
}
|
|
1532
|
+
declare function resolveValue({
|
|
1446
1533
|
schema,
|
|
1447
1534
|
name,
|
|
1448
1535
|
context
|
|
1449
|
-
}:
|
|
1450
|
-
schema: SchemaObject | ReferenceObject;
|
|
1451
|
-
name?: string;
|
|
1452
|
-
context: ContextSpecs;
|
|
1453
|
-
}) => ResolverValue;
|
|
1536
|
+
}: ResolveValueOptions): ResolverValue;
|
|
1454
1537
|
//#endregion
|
|
1455
1538
|
//#region src/utils/assertion.d.ts
|
|
1456
1539
|
/**
|
|
@@ -1458,8 +1541,8 @@ declare const resolveValue: ({
|
|
|
1458
1541
|
*
|
|
1459
1542
|
* @param property
|
|
1460
1543
|
*/
|
|
1461
|
-
declare
|
|
1462
|
-
declare
|
|
1544
|
+
declare function isReference(obj: object): obj is OpenApiReferenceObject;
|
|
1545
|
+
declare function isDirectory(path: string): boolean;
|
|
1463
1546
|
declare function isObject(x: any): x is Record<string, unknown>;
|
|
1464
1547
|
declare function isModule(x: any): x is Record<string, unknown>;
|
|
1465
1548
|
declare function isString(x: any): x is string;
|
|
@@ -1469,24 +1552,23 @@ declare function isBoolean(x: any): x is boolean;
|
|
|
1469
1552
|
declare function isFunction(x: any): x is Function;
|
|
1470
1553
|
declare function isUndefined(x: any): x is undefined;
|
|
1471
1554
|
declare function isNull(x: any): x is null;
|
|
1472
|
-
declare function isSchema(x:
|
|
1473
|
-
declare
|
|
1474
|
-
declare
|
|
1475
|
-
declare const isUrl: (str: string) => boolean;
|
|
1555
|
+
declare function isSchema(x: unknown): x is OpenApiSchemaObject;
|
|
1556
|
+
declare function isVerb(verb: string): verb is Verbs;
|
|
1557
|
+
declare function isUrl(str: string): boolean;
|
|
1476
1558
|
//#endregion
|
|
1477
1559
|
//#region src/utils/async-reduce.d.ts
|
|
1478
1560
|
declare function asyncReduce<IterationItem, AccValue>(array: IterationItem[], reducer: (accumulate: AccValue, current: IterationItem) => AccValue | Promise<AccValue>, initValue: AccValue): Promise<AccValue>;
|
|
1479
1561
|
//#endregion
|
|
1480
1562
|
//#region src/utils/case.d.ts
|
|
1481
|
-
declare
|
|
1482
|
-
declare
|
|
1483
|
-
declare
|
|
1484
|
-
declare
|
|
1485
|
-
declare
|
|
1486
|
-
declare
|
|
1563
|
+
declare function pascal(s: string): string;
|
|
1564
|
+
declare function camel(s: string): string;
|
|
1565
|
+
declare function snake(s: string): string;
|
|
1566
|
+
declare function kebab(s: string): string;
|
|
1567
|
+
declare function upper(s: string, fillWith: string, isDeapostrophe?: boolean): string;
|
|
1568
|
+
declare function conventionName(name: string, convention: NamingConvention): string;
|
|
1487
1569
|
//#endregion
|
|
1488
1570
|
//#region src/utils/compare-version.d.ts
|
|
1489
|
-
declare
|
|
1571
|
+
declare function compareVersions(firstVersion: string, secondVersions: string, operator?: CompareOperator): boolean;
|
|
1490
1572
|
//#endregion
|
|
1491
1573
|
//#region src/utils/debug.d.ts
|
|
1492
1574
|
interface DebuggerOptions {
|
|
@@ -1506,32 +1588,32 @@ declare function jsDoc(schema: {
|
|
|
1506
1588
|
maxLength?: number;
|
|
1507
1589
|
minimum?: number;
|
|
1508
1590
|
maximum?: number;
|
|
1509
|
-
exclusiveMinimum?:
|
|
1510
|
-
exclusiveMaximum?:
|
|
1591
|
+
exclusiveMinimum?: number;
|
|
1592
|
+
exclusiveMaximum?: number;
|
|
1511
1593
|
minItems?: number;
|
|
1512
1594
|
maxItems?: number;
|
|
1513
|
-
|
|
1595
|
+
type?: string | string[];
|
|
1514
1596
|
pattern?: string;
|
|
1515
|
-
}, tryOneLine?: boolean, context?:
|
|
1597
|
+
}, tryOneLine?: boolean, context?: ContextSpec): string;
|
|
1516
1598
|
declare function keyValuePairsToJsDoc(keyValues: {
|
|
1517
1599
|
key: string;
|
|
1518
1600
|
value: string;
|
|
1519
1601
|
}[]): string;
|
|
1520
1602
|
//#endregion
|
|
1521
1603
|
//#region src/utils/dynamic-import.d.ts
|
|
1522
|
-
declare
|
|
1604
|
+
declare function dynamicImport<T>(toImport: T | string, from?: string, takeDefault?: boolean): Promise<T>;
|
|
1523
1605
|
//#endregion
|
|
1524
1606
|
//#region src/utils/extension.d.ts
|
|
1525
|
-
declare
|
|
1607
|
+
declare function getExtension(path: string): "yaml" | "json";
|
|
1526
1608
|
//#endregion
|
|
1527
1609
|
//#region src/utils/file.d.ts
|
|
1528
|
-
declare
|
|
1610
|
+
declare function getFileInfo(target?: string, {
|
|
1529
1611
|
backupFilename,
|
|
1530
1612
|
extension
|
|
1531
1613
|
}?: {
|
|
1532
1614
|
backupFilename?: string;
|
|
1533
1615
|
extension?: string;
|
|
1534
|
-
})
|
|
1616
|
+
}): {
|
|
1535
1617
|
path: string;
|
|
1536
1618
|
pathWithoutExtension: string;
|
|
1537
1619
|
extension: string;
|
|
@@ -1542,7 +1624,7 @@ declare const getFileInfo: (target?: string, {
|
|
|
1542
1624
|
declare function removeFilesAndEmptyFolders(patterns: string[], dir: string): Promise<void>;
|
|
1543
1625
|
//#endregion
|
|
1544
1626
|
//#region src/utils/file-extensions.d.ts
|
|
1545
|
-
declare
|
|
1627
|
+
declare function getMockFileExtensionByTypeName(mock: GlobalMockOptions | ClientMockBuilder): string;
|
|
1546
1628
|
//#endregion
|
|
1547
1629
|
//#region src/utils/get-property-safe.d.ts
|
|
1548
1630
|
/**
|
|
@@ -1563,11 +1645,11 @@ declare function getPropertySafe<T extends object, K$1 extends keyof T>(obj: T,
|
|
|
1563
1645
|
};
|
|
1564
1646
|
//#endregion
|
|
1565
1647
|
//#region src/utils/is-body-verb.d.ts
|
|
1566
|
-
declare
|
|
1648
|
+
declare function getIsBodyVerb(verb: Verbs): boolean;
|
|
1567
1649
|
//#endregion
|
|
1568
1650
|
//#region src/utils/logger.d.ts
|
|
1569
1651
|
declare const log: (message?: any, ...optionalParams: any[]) => void;
|
|
1570
|
-
declare
|
|
1652
|
+
declare function startMessage({
|
|
1571
1653
|
name,
|
|
1572
1654
|
version,
|
|
1573
1655
|
description
|
|
@@ -1575,18 +1657,10 @@ declare const startMessage: ({
|
|
|
1575
1657
|
name: string;
|
|
1576
1658
|
version: string;
|
|
1577
1659
|
description: string;
|
|
1578
|
-
})
|
|
1579
|
-
declare
|
|
1580
|
-
declare
|
|
1581
|
-
declare
|
|
1582
|
-
declare const ibmOpenapiValidatorWarnings: (warnings: {
|
|
1583
|
-
path: string[];
|
|
1584
|
-
message: string;
|
|
1585
|
-
}[]) => void;
|
|
1586
|
-
declare const ibmOpenapiValidatorErrors: (errors: {
|
|
1587
|
-
path: string[];
|
|
1588
|
-
message: string;
|
|
1589
|
-
}[]) => void;
|
|
1660
|
+
}): string;
|
|
1661
|
+
declare function logError(err: unknown, tag?: string): void;
|
|
1662
|
+
declare function mismatchArgsMessage(mismatchArgs: string[]): void;
|
|
1663
|
+
declare function createSuccessMessage(backend?: string): void;
|
|
1590
1664
|
type LogType = 'error' | 'warn' | 'info';
|
|
1591
1665
|
type LogLevel = LogType | 'silent';
|
|
1592
1666
|
interface Logger {
|
|
@@ -1612,23 +1686,19 @@ declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger
|
|
|
1612
1686
|
declare function mergeDeep<T extends Record<string, any>, U$1 extends Record<string, any>>(source: T, target: U$1): T & U$1;
|
|
1613
1687
|
//#endregion
|
|
1614
1688
|
//#region src/utils/occurrence.d.ts
|
|
1615
|
-
declare
|
|
1616
|
-
//#endregion
|
|
1617
|
-
//#region src/utils/open-api-converter.d.ts
|
|
1618
|
-
declare const openApiConverter: (schema: any, options: Partial<ConvertInputOptions> | undefined, specKey: string) => Promise<OpenAPIObject>;
|
|
1689
|
+
declare function count(str: string | undefined, key: string): number;
|
|
1619
1690
|
declare namespace path_d_exports {
|
|
1620
|
-
export { basename, dirname, extname, getSchemaFileName,
|
|
1691
|
+
export { basename, dirname, extname, getSchemaFileName, isAbsolute, join, joinSafe, normalizeSafe, relativeSafe, resolve, separator$1 as separator };
|
|
1621
1692
|
}
|
|
1622
1693
|
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;
|
|
1623
1694
|
/**
|
|
1624
1695
|
* Behaves exactly like `path.relative(from, to)`, but keeps the first meaningful "./"
|
|
1625
1696
|
*/
|
|
1626
|
-
declare
|
|
1627
|
-
declare
|
|
1628
|
-
declare const getSchemaFileName: (path: string) => string;
|
|
1697
|
+
declare function relativeSafe(from: string, to: string): string;
|
|
1698
|
+
declare function getSchemaFileName(path: string): string;
|
|
1629
1699
|
declare const separator$1 = "/";
|
|
1630
|
-
declare
|
|
1631
|
-
declare
|
|
1700
|
+
declare function normalizeSafe(value: string): string;
|
|
1701
|
+
declare function joinSafe(...values: string[]): string;
|
|
1632
1702
|
//#endregion
|
|
1633
1703
|
//#region src/utils/sort.d.ts
|
|
1634
1704
|
declare const sortByPriority: <T>(arr: (T & {
|
|
@@ -1640,8 +1710,8 @@ declare const sortByPriority: <T>(arr: (T & {
|
|
|
1640
1710
|
})[];
|
|
1641
1711
|
//#endregion
|
|
1642
1712
|
//#region src/utils/string.d.ts
|
|
1643
|
-
declare
|
|
1644
|
-
declare
|
|
1713
|
+
declare function stringify(data?: string | any[] | Record<string, any>): string | undefined;
|
|
1714
|
+
declare function sanitize(value: string, options?: {
|
|
1645
1715
|
whitespace?: string | true;
|
|
1646
1716
|
underscore?: string | true;
|
|
1647
1717
|
dot?: string | true;
|
|
@@ -1649,10 +1719,10 @@ declare const sanitize: (value: string, options?: {
|
|
|
1649
1719
|
es5keyword?: boolean;
|
|
1650
1720
|
es5IdentifierName?: boolean;
|
|
1651
1721
|
special?: boolean;
|
|
1652
|
-
})
|
|
1653
|
-
declare
|
|
1654
|
-
declare
|
|
1655
|
-
declare
|
|
1722
|
+
}): string;
|
|
1723
|
+
declare function toObjectString<T>(props: T[], path?: keyof T): string;
|
|
1724
|
+
declare function getNumberWord(num: number): string;
|
|
1725
|
+
declare function escape(str: string | null, char?: string): string | undefined;
|
|
1656
1726
|
/**
|
|
1657
1727
|
* Escape all characters not included in SingleStringCharacters and
|
|
1658
1728
|
* DoubleStringCharacters on
|
|
@@ -1662,112 +1732,94 @@ declare const escape: (str: string | null, char?: string) => string | undefined;
|
|
|
1662
1732
|
*
|
|
1663
1733
|
* @param input String to escape
|
|
1664
1734
|
*/
|
|
1665
|
-
declare
|
|
1735
|
+
declare function jsStringEscape(input: string): string;
|
|
1666
1736
|
//#endregion
|
|
1667
1737
|
//#region src/utils/tsconfig.d.ts
|
|
1668
|
-
declare
|
|
1669
|
-
//#endregion
|
|
1670
|
-
//#region src/utils/validator.d.ts
|
|
1671
|
-
/**
|
|
1672
|
-
* Validate the spec with ibm-openapi-validator (with a custom pretty logger).
|
|
1673
|
-
* More information: https://github.com/IBM/openapi-validator/#configuration
|
|
1674
|
-
* @param specs openAPI spec
|
|
1675
|
-
*/
|
|
1676
|
-
declare const ibmOpenapiValidator: (specs: OpenAPIObject, validation: boolean | object) => Promise<void>;
|
|
1738
|
+
declare function isSyntheticDefaultImportsAllow(config?: Tsconfig): boolean;
|
|
1677
1739
|
//#endregion
|
|
1678
1740
|
//#region src/writers/schemas.d.ts
|
|
1679
|
-
declare
|
|
1680
|
-
declare
|
|
1681
|
-
|
|
1741
|
+
declare function writeModelInline(acc: string, model: string): string;
|
|
1742
|
+
declare function writeModelsInline(array: GeneratorSchema[]): string;
|
|
1743
|
+
interface WriteSchemaOptions {
|
|
1744
|
+
path: string;
|
|
1745
|
+
schema: GeneratorSchema;
|
|
1746
|
+
target: string;
|
|
1747
|
+
namingConvention: NamingConvention;
|
|
1748
|
+
fileExtension: string;
|
|
1749
|
+
header: string;
|
|
1750
|
+
}
|
|
1751
|
+
declare function writeSchema({
|
|
1682
1752
|
path,
|
|
1683
1753
|
schema,
|
|
1684
1754
|
target,
|
|
1685
1755
|
namingConvention,
|
|
1686
1756
|
fileExtension,
|
|
1687
|
-
specKey,
|
|
1688
|
-
isRootKey,
|
|
1689
|
-
specsName,
|
|
1690
1757
|
header
|
|
1691
|
-
}:
|
|
1692
|
-
|
|
1693
|
-
|
|
1758
|
+
}: WriteSchemaOptions): Promise<void>;
|
|
1759
|
+
interface WriteSchemasOptions {
|
|
1760
|
+
schemaPath: string;
|
|
1761
|
+
schemas: GeneratorSchema[];
|
|
1694
1762
|
target: string;
|
|
1695
1763
|
namingConvention: NamingConvention;
|
|
1696
1764
|
fileExtension: string;
|
|
1697
|
-
specKey: string;
|
|
1698
|
-
isRootKey: boolean;
|
|
1699
|
-
specsName: Record<string, string>;
|
|
1700
1765
|
header: string;
|
|
1701
|
-
|
|
1702
|
-
|
|
1766
|
+
indexFiles: boolean;
|
|
1767
|
+
}
|
|
1768
|
+
declare function writeSchemas({
|
|
1703
1769
|
schemaPath,
|
|
1704
1770
|
schemas,
|
|
1705
1771
|
target,
|
|
1706
1772
|
namingConvention,
|
|
1707
1773
|
fileExtension,
|
|
1708
|
-
specKey,
|
|
1709
|
-
isRootKey,
|
|
1710
|
-
specsName,
|
|
1711
1774
|
header,
|
|
1712
1775
|
indexFiles
|
|
1713
|
-
}:
|
|
1714
|
-
schemaPath: string;
|
|
1715
|
-
schemas: GeneratorSchema[];
|
|
1716
|
-
target: string;
|
|
1717
|
-
namingConvention: NamingConvention;
|
|
1718
|
-
fileExtension: string;
|
|
1719
|
-
specKey: string;
|
|
1720
|
-
isRootKey: boolean;
|
|
1721
|
-
specsName: Record<string, string>;
|
|
1722
|
-
header: string;
|
|
1723
|
-
indexFiles: boolean;
|
|
1724
|
-
}) => Promise<void>;
|
|
1776
|
+
}: WriteSchemasOptions): Promise<void>;
|
|
1725
1777
|
//#endregion
|
|
1726
1778
|
//#region src/writers/single-mode.d.ts
|
|
1727
|
-
declare
|
|
1779
|
+
declare function writeSingleMode({
|
|
1728
1780
|
builder,
|
|
1729
1781
|
output,
|
|
1730
|
-
|
|
1782
|
+
projectName,
|
|
1731
1783
|
header,
|
|
1732
1784
|
needSchema
|
|
1733
|
-
}: WriteModeProps)
|
|
1785
|
+
}: WriteModeProps): Promise<string[]>;
|
|
1734
1786
|
//#endregion
|
|
1735
1787
|
//#region src/writers/split-mode.d.ts
|
|
1736
|
-
declare
|
|
1788
|
+
declare function writeSplitMode({
|
|
1737
1789
|
builder,
|
|
1738
1790
|
output,
|
|
1739
|
-
|
|
1791
|
+
projectName,
|
|
1740
1792
|
header,
|
|
1741
1793
|
needSchema
|
|
1742
|
-
}: WriteModeProps)
|
|
1794
|
+
}: WriteModeProps): Promise<string[]>;
|
|
1743
1795
|
//#endregion
|
|
1744
1796
|
//#region src/writers/split-tags-mode.d.ts
|
|
1745
|
-
declare
|
|
1797
|
+
declare function writeSplitTagsMode({
|
|
1746
1798
|
builder,
|
|
1747
1799
|
output,
|
|
1748
|
-
|
|
1800
|
+
projectName,
|
|
1749
1801
|
header,
|
|
1750
1802
|
needSchema
|
|
1751
|
-
}: WriteModeProps)
|
|
1803
|
+
}: WriteModeProps): Promise<string[]>;
|
|
1752
1804
|
//#endregion
|
|
1753
1805
|
//#region src/writers/tags-mode.d.ts
|
|
1754
|
-
declare
|
|
1806
|
+
declare function writeTagsMode({
|
|
1755
1807
|
builder,
|
|
1756
1808
|
output,
|
|
1757
|
-
|
|
1809
|
+
projectName,
|
|
1758
1810
|
header,
|
|
1759
1811
|
needSchema
|
|
1760
|
-
}: WriteModeProps)
|
|
1812
|
+
}: WriteModeProps): Promise<string[]>;
|
|
1761
1813
|
//#endregion
|
|
1762
1814
|
//#region src/writers/target.d.ts
|
|
1763
|
-
declare
|
|
1815
|
+
declare function generateTarget(builder: WriteSpecBuilder, options: NormalizedOutputOptions): GeneratorTarget;
|
|
1764
1816
|
//#endregion
|
|
1765
1817
|
//#region src/writers/target-tags.d.ts
|
|
1766
|
-
declare
|
|
1818
|
+
declare function generateTargetForTags(builder: WriteSpecBuilder, options: NormalizedOutputOptions): Record<string, GeneratorTarget>;
|
|
1767
1819
|
//#endregion
|
|
1768
1820
|
//#region src/writers/types.d.ts
|
|
1769
|
-
declare
|
|
1770
|
-
declare
|
|
1821
|
+
declare function getOrvalGeneratedTypes(): string;
|
|
1822
|
+
declare function getTypedResponse(): string;
|
|
1771
1823
|
//#endregion
|
|
1772
|
-
export { AngularOptions, BODY_TYPE_NAME, BaseUrlFromConstant, BaseUrlFromSpec, ClientBuilder, ClientDependenciesBuilder, ClientExtraFilesBuilder, ClientFileBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMockBuilder, ClientMockGeneratorBuilder, ClientMockGeneratorImplementation, ClientTitleBuilder, Config, ConfigExternal, ConfigFn,
|
|
1824
|
+
export { AngularOptions, BODY_TYPE_NAME, BaseUrlFromConstant, BaseUrlFromSpec, ClientBuilder, ClientDependenciesBuilder, ClientExtraFilesBuilder, ClientFileBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMockBuilder, ClientMockGeneratorBuilder, ClientMockGeneratorImplementation, ClientTitleBuilder, Config, ConfigExternal, ConfigFn, ContextSpec, DeepNonNullable, EnumGeneration, ErrorWithTag, FetchOptions, FormDataArrayHandling, FormDataType, GenerateMockImports, GenerateVerbOptionsParams, GenerateVerbsOptionsParams, 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, InputFiltersOptions, 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, NormalizedSchemaOptions, NormalizedZodOptions, OpenApiComponentsObject, OpenApiDocument, OpenApiEncodingObject, OpenApiExampleObject, OpenApiInfoObject, OpenApiMediaTypeObject, OpenApiOperationObject, OpenApiParameterObject, OpenApiPathItemObject, OpenApiPathsObject, OpenApiReferenceObject, OpenApiRequestBodyObject, OpenApiResponseObject, OpenApiResponsesObject, OpenApiSchemaObject, OpenApiSchemaObjectType, OpenApiSchemasObject, OpenApiServerObject, OperationOptions, Options, OptionsExport, OptionsFn, OutputClient, OutputClientFunc, OutputDocsOptions, OutputHttpClient, OutputMockType, OutputMode, OutputOptions, OverrideInput, OverrideMockOptions, OverrideOutput, OverrideOutputContentType, PackageJson, ParamsSerializerOptions, PropertySortOrder, QueryOptions, RefComponentSuffix, RefInfo, ResReqTypesValue, ResolverValue, ScalarValue, SchemaGenerationType, SchemaOptions, SchemaType, SwrOptions, TEMPLATE_TAG_REGEX, TsConfigTarget, Tsconfig, URL_REGEX, VERBS_WITH_BODY, Verbs, WriteModeProps, WriteSpecBuilder, 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, generateVerbOptions, generateVerbsOptions, getArray, getBody, getEnum, getEnumDescriptions, getEnumImplementation, getEnumNames, getExtension, getFileInfo, getFormDataFieldFileType, getFullRoute, getIsBodyVerb, getKey, getMockFileExtensionByTypeName, getNumberWord, getObject, getOperationId, getOrvalGeneratedTypes, getParameters, getParams, getParamsInPath, getPropertySafe, getProps, getQueryParams, getRefInfo, getResReqTypes, getResponse, getRoute, getRouteAsArray, getScalar, getTypedResponse, isBinaryContentType, isBoolean, isDirectory, isFunction, isModule, isNull, isNumber, isNumeric, isObject, isReference, isSchema, isString, isSyntheticDefaultImportsAllow, isUndefined, isUrl, isVerb, jsDoc, jsStringEscape, kebab, keyValuePairsToJsDoc, log, logError, mergeDeep, mismatchArgsMessage, 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 };
|
|
1773
1825
|
//# sourceMappingURL=index.d.mts.map
|