swagger-typescript-api 13.1.2 → 13.2.0
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/CHANGELOG.md +22 -0
- package/dist/cli.cjs +7 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +7 -6
- package/dist/cli.js.map +1 -1
- package/dist/lib.cjs +3 -3
- package/dist/lib.d.cts +4 -30
- package/dist/lib.d.ts +4 -30
- package/dist/lib.js +1 -1
- package/dist/src-Bt12Ak64.js +3134 -0
- package/dist/src-Bt12Ak64.js.map +1 -0
- package/dist/src-uYLAh71S.cjs +3200 -0
- package/dist/src-uYLAh71S.cjs.map +1 -0
- package/package.json +12 -12
- package/templates/base/http-clients/axios-http-client.ejs +1 -0
- package/templates/base/http-clients/fetch-http-client.ejs +2 -0
- package/templates/default/procedure-call.ejs +1 -0
- package/templates/modular/procedure-call.ejs +1 -0
- package/dist/lib.d.cts.map +0 -1
- package/dist/lib.d.ts.map +0 -1
- package/dist/src-D3nQpZ1i.cjs +0 -3133
- package/dist/src-D3nQpZ1i.cjs.map +0 -1
- package/dist/src-gaIHrOQ9.js +0 -3066
- package/dist/src-gaIHrOQ9.js.map +0 -1
package/dist/lib.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as typescript$1 from "typescript";
|
|
|
6
6
|
import * as typescript from "typescript";
|
|
7
7
|
import * as eta20 from "eta";
|
|
8
8
|
import { OpenAPI } from "openapi-types";
|
|
9
|
-
import * as
|
|
9
|
+
import * as swagger_schema_official16 from "swagger-schema-official";
|
|
10
10
|
|
|
11
11
|
//#region src/schema-components-map.d.ts
|
|
12
12
|
declare class SchemaComponentsMap {
|
|
@@ -22,7 +22,6 @@ declare class SchemaComponentsMap {
|
|
|
22
22
|
get($ref: string): SchemaComponent | null;
|
|
23
23
|
enumsFirst(): void;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
25
|
//#endregion
|
|
27
26
|
//#region src/util/file-system.d.ts
|
|
28
27
|
declare class FileSystem {
|
|
@@ -46,7 +45,6 @@ declare class FileSystem {
|
|
|
46
45
|
withPrefix: any;
|
|
47
46
|
}) => void;
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
//#endregion
|
|
51
49
|
//#region src/util/request.d.ts
|
|
52
50
|
declare class Request {
|
|
@@ -62,7 +60,6 @@ declare class Request {
|
|
|
62
60
|
options?: Partial<RequestInit>;
|
|
63
61
|
}): Promise<string>;
|
|
64
62
|
}
|
|
65
|
-
|
|
66
63
|
//#endregion
|
|
67
64
|
//#region src/swagger-schema-resolver.d.ts
|
|
68
65
|
declare class SwaggerSchemaResolver {
|
|
@@ -91,7 +88,6 @@ declare class SwaggerSchemaResolver {
|
|
|
91
88
|
originalSchema: any;
|
|
92
89
|
}): void;
|
|
93
90
|
}
|
|
94
|
-
|
|
95
91
|
//#endregion
|
|
96
92
|
//#region src/schema-walker.d.ts
|
|
97
93
|
declare class SchemaWalker {
|
|
@@ -105,7 +101,6 @@ declare class SchemaWalker {
|
|
|
105
101
|
_isRemoteRef: (ref: string) => boolean;
|
|
106
102
|
_getRefDataFromSchema: (schema: Record<string, unknown>, ref: string) => any;
|
|
107
103
|
}
|
|
108
|
-
|
|
109
104
|
//#endregion
|
|
110
105
|
//#region src/type-name-formatter.d.ts
|
|
111
106
|
type FormattingSchemaType = "enum-key" | "type-name";
|
|
@@ -121,7 +116,6 @@ declare class TypeNameFormatter {
|
|
|
121
116
|
type?: FormattingSchemaType;
|
|
122
117
|
}) => string;
|
|
123
118
|
}
|
|
124
|
-
|
|
125
119
|
//#endregion
|
|
126
120
|
//#region src/schema-parser/schema-utils.d.ts
|
|
127
121
|
declare class SchemaUtils {
|
|
@@ -169,7 +163,6 @@ declare class SchemaUtils {
|
|
|
169
163
|
isConstantSchema(schema: any): boolean;
|
|
170
164
|
formatJsValue: (value: any) => string;
|
|
171
165
|
}
|
|
172
|
-
|
|
173
166
|
//#endregion
|
|
174
167
|
//#region src/schema-parser/schema-formatters.d.ts
|
|
175
168
|
declare class SchemaFormatters {
|
|
@@ -190,7 +183,6 @@ declare class SchemaFormatters {
|
|
|
190
183
|
formatDescription: (description: any, inline: any) => any;
|
|
191
184
|
formatObjectContent: (content: any) => string;
|
|
192
185
|
}
|
|
193
|
-
|
|
194
186
|
//#endregion
|
|
195
187
|
//#region src/schema-parser/schema-parser-fabric.d.ts
|
|
196
188
|
declare class SchemaParserFabric {
|
|
@@ -237,7 +229,6 @@ declare class SchemaParserFabric {
|
|
|
237
229
|
getInlineParseContent: (schema: string, typeName: string | null, schemaPath: string[]) => Record<string, any>;
|
|
238
230
|
getParseContent: (schema: string, typeName: string | null, schemaPath: string[]) => Record<string, any>;
|
|
239
231
|
}
|
|
240
|
-
|
|
241
232
|
//#endregion
|
|
242
233
|
//#region src/schema-routes/schema-routes.d.ts
|
|
243
234
|
declare class SchemaRoutes {
|
|
@@ -388,7 +379,6 @@ declare class SchemaRoutes {
|
|
|
388
379
|
};
|
|
389
380
|
sortRoutes: (routes: ParsedRoute[]) => ParsedRoute[];
|
|
390
381
|
}
|
|
391
|
-
|
|
392
382
|
//#endregion
|
|
393
383
|
//#region src/translators/javascript.d.ts
|
|
394
384
|
declare class JavascriptTranslator extends Translator {
|
|
@@ -399,11 +389,9 @@ declare class JavascriptTranslator extends Translator {
|
|
|
399
389
|
fileContent: string;
|
|
400
390
|
}[]>;
|
|
401
391
|
}
|
|
402
|
-
|
|
403
392
|
//#endregion
|
|
404
393
|
//#region src/util/internal-case.d.ts
|
|
405
394
|
declare function internalCase(value: string): string;
|
|
406
|
-
|
|
407
395
|
//#endregion
|
|
408
396
|
//#region src/util/name-resolver.d.ts
|
|
409
397
|
type Resolver = (reserved: string[], extras?: string[]) => string;
|
|
@@ -417,11 +405,9 @@ declare class NameResolver {
|
|
|
417
405
|
isReserved(name: string): boolean;
|
|
418
406
|
resolve(variants: string[], resolver?: Resolver, extras?: string[], shouldReserve?: boolean): string | null;
|
|
419
407
|
}
|
|
420
|
-
|
|
421
408
|
//#endregion
|
|
422
409
|
//#region src/util/pascal-case.d.ts
|
|
423
410
|
declare function pascalCase(value: string): Capitalize<string>;
|
|
424
|
-
|
|
425
411
|
//#endregion
|
|
426
412
|
//#region src/code-gen-process.d.ts
|
|
427
413
|
declare class CodeGenProcess {
|
|
@@ -678,7 +664,6 @@ declare class CodeGenProcess {
|
|
|
678
664
|
};
|
|
679
665
|
injectClassInstance: (key: any, value: any) => void;
|
|
680
666
|
}
|
|
681
|
-
|
|
682
667
|
//#endregion
|
|
683
668
|
//#region src/templates-worker.d.ts
|
|
684
669
|
declare class TemplatesWorker {
|
|
@@ -698,7 +683,6 @@ declare class TemplatesWorker {
|
|
|
698
683
|
getTemplateContent: (path_: string) => string;
|
|
699
684
|
renderTemplate: (template: string, configuration: object, options?: object) => string;
|
|
700
685
|
}
|
|
701
|
-
|
|
702
686
|
//#endregion
|
|
703
687
|
//#region src/schema-parser/schema-parser.d.ts
|
|
704
688
|
declare class SchemaParser {
|
|
@@ -737,7 +721,6 @@ declare class SchemaParser {
|
|
|
737
721
|
getParseContent: () => any;
|
|
738
722
|
extractSchemaFromResponseStruct: (responseStruct: any) => any;
|
|
739
723
|
}
|
|
740
|
-
|
|
741
724
|
//#endregion
|
|
742
725
|
//#region src/component-type-name-resolver.d.ts
|
|
743
726
|
declare class ComponentTypeNameResolver extends NameResolver {
|
|
@@ -746,9 +729,6 @@ declare class ComponentTypeNameResolver extends NameResolver {
|
|
|
746
729
|
countersByVariant: Map<string, number>;
|
|
747
730
|
constructor(config: CodeGenConfig, reservedNames: string[]);
|
|
748
731
|
}
|
|
749
|
-
|
|
750
|
-
//#endregion
|
|
751
|
-
//#region src/constants.d.ts
|
|
752
732
|
declare namespace constants_d_exports {
|
|
753
733
|
export { DEFAULT_BODY_ARG_NAME, FILE_PREFIX, HTTP_CLIENT, PROJECT_VERSION, RESERVED_BODY_ARG_NAMES, RESERVED_HEADER_ARG_NAMES, RESERVED_PATH_ARG_NAMES, RESERVED_QUERY_ARG_NAMES, RESERVED_REQ_PARAMS_ARG_NAMES, SCHEMA_TYPES$1 as SCHEMA_TYPES };
|
|
754
734
|
}
|
|
@@ -778,7 +758,6 @@ declare const SCHEMA_TYPES$1: {
|
|
|
778
758
|
readonly COMPLEX_NOT: "not";
|
|
779
759
|
readonly COMPLEX_UNKNOWN: "__unknown";
|
|
780
760
|
};
|
|
781
|
-
|
|
782
761
|
//#endregion
|
|
783
762
|
//#region src/schema-parser/mono-schema-parser.d.ts
|
|
784
763
|
declare class MonoSchemaParser {
|
|
@@ -796,7 +775,6 @@ declare class MonoSchemaParser {
|
|
|
796
775
|
parse(): void;
|
|
797
776
|
buildTypeNameFromPath: () => Capitalize<string> | null;
|
|
798
777
|
}
|
|
799
|
-
|
|
800
778
|
//#endregion
|
|
801
779
|
//#region types/index.d.ts
|
|
802
780
|
type HttpClientType = (typeof HTTP_CLIENT)[keyof typeof HTTP_CLIENT];
|
|
@@ -935,7 +913,7 @@ type RawRouteInfo = {
|
|
|
935
913
|
description?: string;
|
|
936
914
|
tags?: string[];
|
|
937
915
|
summary?: string;
|
|
938
|
-
responses?:
|
|
916
|
+
responses?: swagger_schema_official16.Spec["responses"];
|
|
939
917
|
produces?: string[];
|
|
940
918
|
requestBody?: object;
|
|
941
919
|
consumes?: string[];
|
|
@@ -1206,7 +1184,8 @@ interface GenerateTemplatesParams {
|
|
|
1206
1184
|
silent?: boolean;
|
|
1207
1185
|
debug?: boolean;
|
|
1208
1186
|
}
|
|
1209
|
-
interface GenerateTemplatesOutput extends Pick<GenerateApiOutput, "files" | "createFile"> {}
|
|
1187
|
+
interface GenerateTemplatesOutput extends Pick<GenerateApiOutput, "files" | "createFile"> {}
|
|
1188
|
+
//#endregion
|
|
1210
1189
|
//#region src/configuration.d.ts
|
|
1211
1190
|
declare class CodeGenConfig {
|
|
1212
1191
|
version: string;
|
|
@@ -1460,7 +1439,6 @@ declare class CodeGenConfig {
|
|
|
1460
1439
|
}: Partial<GenerateApiConfiguration["config"]>);
|
|
1461
1440
|
update: (update: Partial<GenerateApiConfiguration["config"]>) => void;
|
|
1462
1441
|
}
|
|
1463
|
-
|
|
1464
1442
|
//#endregion
|
|
1465
1443
|
//#region src/code-formatter.d.ts
|
|
1466
1444
|
declare class CodeFormatter {
|
|
@@ -1476,7 +1454,6 @@ declare class CodeFormatter {
|
|
|
1476
1454
|
format?: boolean | undefined;
|
|
1477
1455
|
}) => Promise<string>;
|
|
1478
1456
|
}
|
|
1479
|
-
|
|
1480
1457
|
//#endregion
|
|
1481
1458
|
//#region src/translators/translator.d.ts
|
|
1482
1459
|
interface TranslatorIO {
|
|
@@ -1490,11 +1467,9 @@ declare class Translator {
|
|
|
1490
1467
|
constructor(config: CodeGenConfig, codeFormatter: CodeFormatter);
|
|
1491
1468
|
translate(_input: TranslatorIO): Promise<TranslatorIO[]>;
|
|
1492
1469
|
}
|
|
1493
|
-
|
|
1494
1470
|
//#endregion
|
|
1495
1471
|
//#region src/commands/generate-templates/index.d.ts
|
|
1496
1472
|
declare function generateTemplates(config: GenerateTemplatesParams): Promise<GenerateTemplatesOutput>;
|
|
1497
|
-
|
|
1498
1473
|
//#endregion
|
|
1499
1474
|
//#region src/index.d.ts
|
|
1500
1475
|
declare function generateApi(config: Partial<GenerateApiConfiguration["config"]>): Promise<{
|
|
@@ -1631,7 +1606,6 @@ declare function generateApi(config: Partial<GenerateApiConfiguration["config"]>
|
|
|
1631
1606
|
format?: boolean | undefined;
|
|
1632
1607
|
}) => Promise<string>;
|
|
1633
1608
|
}>;
|
|
1634
|
-
|
|
1635
1609
|
//#endregion
|
|
1636
1610
|
export { constants_d_exports as constants, generateApi, generateTemplates };
|
|
1637
1611
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/lib.js
CHANGED