@nestia/sdk 1.6.7-dev.20230830 → 2.0.0-dev.20230830
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/assets/config/nestia.config.ts +15 -40
- package/lib/executable/internal/NestiaSdkConfig.js +4 -0
- package/lib/executable/internal/NestiaSdkConfig.js.map +1 -1
- package/lib/generates/E2eGenerator.js +2 -1
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +10 -10
- package/lib/generates/internal/E2eFileProgrammer.d.ts +2 -1
- package/lib/generates/internal/E2eFileProgrammer.js +30 -19
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.js +14 -30
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkFunctionProgrammer.d.ts +2 -1
- package/lib/generates/internal/SdkFunctionProgrammer.js +72 -26
- package/lib/generates/internal/SdkFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkSimulationProgrammer.d.ts +3 -1
- package/lib/generates/internal/SdkSimulationProgrammer.js +42 -24
- package/lib/generates/internal/SdkSimulationProgrammer.js.map +1 -1
- package/lib/utils/ImportDictionary.d.ts +16 -2
- package/lib/utils/ImportDictionary.js +66 -25
- package/lib/utils/ImportDictionary.js.map +1 -1
- package/package.json +5 -5
- package/src/generates/E2eGenerator.ts +4 -1
- package/src/generates/internal/E2eFileProgrammer.ts +36 -19
- package/src/generates/internal/SdkFileProgrammer.ts +20 -56
- package/src/generates/internal/SdkFunctionProgrammer.ts +85 -24
- package/src/generates/internal/SdkSimulationProgrammer.ts +107 -73
- package/src/utils/ImportDictionary.ts +97 -33
|
@@ -30,55 +30,30 @@ export const NESTIA_CONFIG: INestiaConfig = {
|
|
|
30
30
|
output: "src/api",
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Target directory that SDK distribution files would be placed in.
|
|
34
34
|
*
|
|
35
|
-
* If you configure this property
|
|
36
|
-
*
|
|
37
|
-
* This option would make your SDK library slower, but would enahcne the type safety even
|
|
38
|
-
* in the runtime level.
|
|
35
|
+
* If you configure this property and runs `npx nestia sdk` command,
|
|
36
|
+
* distribution environments for the SDK library would be generated.
|
|
39
37
|
*
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Whether to optimize JSON string conversion 2x faster or not.
|
|
46
|
-
*
|
|
47
|
-
* If you configure this property to be `true`, the SDK library would utilize the
|
|
48
|
-
* [typia](https://github.com/samchon/typia#fastest-json-string-converter)
|
|
49
|
-
* and the JSON string conversion speed really be 2x faster.
|
|
50
|
-
*
|
|
51
|
-
* @default false
|
|
52
|
-
*/
|
|
53
|
-
// json: true,
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Whether to wrap DTO by primitive type.
|
|
57
|
-
*
|
|
58
|
-
* If you don't configure this property as `false`, all of DTOs in the
|
|
59
|
-
* SDK library would be automatically wrapped by {@link Primitive} type.
|
|
60
|
-
*
|
|
61
|
-
* For refenrece, if a DTO type be capsuled by the {@link Primitive} type,
|
|
62
|
-
* all of methods in the DTO type would be automatically erased. Also, if
|
|
63
|
-
* the DTO has a `toJSON()` method, the DTO type would be automatically
|
|
64
|
-
* converted to return type of the `toJSON()` method.
|
|
65
|
-
*
|
|
66
|
-
* @default true
|
|
38
|
+
* After the SDK library generation, move to the `distribute` directory,
|
|
39
|
+
* and runs `npm publish` command, then you can share SDK library with
|
|
40
|
+
* other client (frontend) developers.
|
|
67
41
|
*/
|
|
68
|
-
//
|
|
42
|
+
// distribute: "packages/api",
|
|
69
43
|
|
|
70
44
|
/**
|
|
71
|
-
* Allow
|
|
45
|
+
* Allow simulation mode.
|
|
72
46
|
*
|
|
73
|
-
* If you configure this property to be `true`,
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
47
|
+
* If you configure this property to be `true`, the SDK library would be contain
|
|
48
|
+
* simulation mode. In the simulation mode, the SDK library would not communicate
|
|
49
|
+
* with the real backend server, but just returns random mock-up data
|
|
50
|
+
* with requestion data validation.
|
|
77
51
|
*
|
|
78
|
-
* For reference, random
|
|
52
|
+
* For reference, random mock-up data would be generated by `typia.random<T>()`
|
|
53
|
+
* function.
|
|
79
54
|
*
|
|
80
55
|
* @default false
|
|
81
56
|
*/
|
|
82
|
-
//
|
|
57
|
+
// simulate: true,
|
|
83
58
|
};
|
|
84
59
|
export default NESTIA_CONFIG;
|
|
@@ -101,6 +101,8 @@ var NestiaSdkConfig;
|
|
|
101
101
|
const $io16 = input => "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io14(input.scopes));
|
|
102
102
|
const $io17 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem));
|
|
103
103
|
const $io18 = input => (undefined === input.allowImportingTsExtensions || "boolean" === typeof input.allowImportingTsExtensions) && (undefined === input.allowJs || "boolean" === typeof input.allowJs) && (undefined === input.allowArbitraryExtensions || "boolean" === typeof input.allowArbitraryExtensions) && (undefined === input.allowSyntheticDefaultImports || "boolean" === typeof input.allowSyntheticDefaultImports) && (undefined === input.allowUmdGlobalAccess || "boolean" === typeof input.allowUmdGlobalAccess) && (undefined === input.allowUnreachableCode || "boolean" === typeof input.allowUnreachableCode) && (undefined === input.allowUnusedLabels || "boolean" === typeof input.allowUnusedLabels) && (undefined === input.alwaysStrict || "boolean" === typeof input.alwaysStrict) && (undefined === input.baseUrl || "string" === typeof input.baseUrl) && (undefined === input.charset || "string" === typeof input.charset) && (undefined === input.checkJs || "boolean" === typeof input.checkJs) && (undefined === input.customConditions || Array.isArray(input.customConditions) && input.customConditions.every(elem => "string" === typeof elem)) && (undefined === input.declaration || "boolean" === typeof input.declaration) && (undefined === input.declarationMap || "boolean" === typeof input.declarationMap) && (undefined === input.emitDeclarationOnly || "boolean" === typeof input.emitDeclarationOnly) && (undefined === input.declarationDir || "string" === typeof input.declarationDir) && (undefined === input.disableSizeLimit || "boolean" === typeof input.disableSizeLimit) && (undefined === input.disableSourceOfProjectReferenceRedirect || "boolean" === typeof input.disableSourceOfProjectReferenceRedirect) && (undefined === input.disableSolutionSearching || "boolean" === typeof input.disableSolutionSearching) && (undefined === input.disableReferencedProjectLoad || "boolean" === typeof input.disableReferencedProjectLoad) && (undefined === input.downlevelIteration || "boolean" === typeof input.downlevelIteration) && (undefined === input.emitBOM || "boolean" === typeof input.emitBOM) && (undefined === input.emitDecoratorMetadata || "boolean" === typeof input.emitDecoratorMetadata) && (undefined === input.exactOptionalPropertyTypes || "boolean" === typeof input.exactOptionalPropertyTypes) && (undefined === input.experimentalDecorators || "boolean" === typeof input.experimentalDecorators) && (undefined === input.forceConsistentCasingInFileNames || "boolean" === typeof input.forceConsistentCasingInFileNames) && (undefined === input.ignoreDeprecations || "string" === typeof input.ignoreDeprecations) && (undefined === input.importHelpers || "boolean" === typeof input.importHelpers) && true && (undefined === input.inlineSourceMap || "boolean" === typeof input.inlineSourceMap) && (undefined === input.inlineSources || "boolean" === typeof input.inlineSources) && (undefined === input.isolatedModules || "boolean" === typeof input.isolatedModules) && true && (undefined === input.keyofStringsOnly || "boolean" === typeof input.keyofStringsOnly) && (undefined === input.lib || Array.isArray(input.lib) && input.lib.every(elem => "string" === typeof elem)) && (undefined === input.locale || "string" === typeof input.locale) && (undefined === input.mapRoot || "string" === typeof input.mapRoot) && true && true && true && (undefined === input.moduleSuffixes || Array.isArray(input.moduleSuffixes) && input.moduleSuffixes.every(elem => "string" === typeof elem)) && true && true && (undefined === input.noEmit || "boolean" === typeof input.noEmit) && (undefined === input.noEmitHelpers || "boolean" === typeof input.noEmitHelpers) && (undefined === input.noEmitOnError || "boolean" === typeof input.noEmitOnError) && (undefined === input.noErrorTruncation || "boolean" === typeof input.noErrorTruncation) && (undefined === input.noFallthroughCasesInSwitch || "boolean" === typeof input.noFallthroughCasesInSwitch) && (undefined === input.noImplicitAny || "boolean" === typeof input.noImplicitAny) && (undefined === input.noImplicitReturns || "boolean" === typeof input.noImplicitReturns) && (undefined === input.noImplicitThis || "boolean" === typeof input.noImplicitThis) && (undefined === input.noStrictGenericChecks || "boolean" === typeof input.noStrictGenericChecks) && (undefined === input.noUnusedLocals || "boolean" === typeof input.noUnusedLocals) && (undefined === input.noUnusedParameters || "boolean" === typeof input.noUnusedParameters) && (undefined === input.noImplicitUseStrict || "boolean" === typeof input.noImplicitUseStrict) && (undefined === input.noPropertyAccessFromIndexSignature || "boolean" === typeof input.noPropertyAccessFromIndexSignature) && (undefined === input.assumeChangesOnlyAffectDirectDependencies || "boolean" === typeof input.assumeChangesOnlyAffectDirectDependencies) && (undefined === input.noLib || "boolean" === typeof input.noLib) && (undefined === input.noResolve || "boolean" === typeof input.noResolve) && (undefined === input.noUncheckedIndexedAccess || "boolean" === typeof input.noUncheckedIndexedAccess) && (undefined === input.out || "string" === typeof input.out) && (undefined === input.outDir || "string" === typeof input.outDir) && (undefined === input.outFile || "string" === typeof input.outFile) && (undefined === input.paths || "object" === typeof input.paths && null !== input.paths && false === Array.isArray(input.paths) && $io19(input.paths)) && (undefined === input.preserveConstEnums || "boolean" === typeof input.preserveConstEnums) && (undefined === input.noImplicitOverride || "boolean" === typeof input.noImplicitOverride) && (undefined === input.preserveSymlinks || "boolean" === typeof input.preserveSymlinks) && (undefined === input.preserveValueImports || "boolean" === typeof input.preserveValueImports) && (undefined === input.project || "string" === typeof input.project) && (undefined === input.reactNamespace || "string" === typeof input.reactNamespace) && (undefined === input.jsxFactory || "string" === typeof input.jsxFactory) && (undefined === input.jsxFragmentFactory || "string" === typeof input.jsxFragmentFactory) && (undefined === input.jsxImportSource || "string" === typeof input.jsxImportSource) && (undefined === input.composite || "boolean" === typeof input.composite) && (undefined === input.incremental || "boolean" === typeof input.incremental) && (undefined === input.tsBuildInfoFile || "string" === typeof input.tsBuildInfoFile) && (undefined === input.removeComments || "boolean" === typeof input.removeComments) && (undefined === input.resolvePackageJsonExports || "boolean" === typeof input.resolvePackageJsonExports) && (undefined === input.resolvePackageJsonImports || "boolean" === typeof input.resolvePackageJsonImports) && (undefined === input.rootDir || "string" === typeof input.rootDir) && (undefined === input.rootDirs || Array.isArray(input.rootDirs) && input.rootDirs.every(elem => "string" === typeof elem)) && (undefined === input.skipLibCheck || "boolean" === typeof input.skipLibCheck) && (undefined === input.skipDefaultLibCheck || "boolean" === typeof input.skipDefaultLibCheck) && (undefined === input.sourceMap || "boolean" === typeof input.sourceMap) && (undefined === input.sourceRoot || "string" === typeof input.sourceRoot) && (undefined === input.strict || "boolean" === typeof input.strict) && (undefined === input.strictFunctionTypes || "boolean" === typeof input.strictFunctionTypes) && (undefined === input.strictBindCallApply || "boolean" === typeof input.strictBindCallApply) && (undefined === input.strictNullChecks || "boolean" === typeof input.strictNullChecks) && (undefined === input.strictPropertyInitialization || "boolean" === typeof input.strictPropertyInitialization) && (undefined === input.stripInternal || "boolean" === typeof input.stripInternal) && (undefined === input.suppressExcessPropertyErrors || "boolean" === typeof input.suppressExcessPropertyErrors) && (undefined === input.suppressImplicitAnyIndexErrors || "boolean" === typeof input.suppressImplicitAnyIndexErrors) && true && (undefined === input.traceResolution || "boolean" === typeof input.traceResolution) && (undefined === input.useUnknownInCatchVariables || "boolean" === typeof input.useUnknownInCatchVariables) && (undefined === input.resolveJsonModule || "boolean" === typeof input.resolveJsonModule) && (undefined === input.types || Array.isArray(input.types) && input.types.every(elem => "string" === typeof elem)) && (undefined === input.typeRoots || Array.isArray(input.typeRoots) && input.typeRoots.every(elem => "string" === typeof elem)) && (undefined === input.verbatimModuleSyntax || "boolean" === typeof input.verbatimModuleSyntax) && (undefined === input.esModuleInterop || "boolean" === typeof input.esModuleInterop) && (undefined === input.useDefineForClassFields || "boolean" === typeof input.useDefineForClassFields) && Object.keys(input).every(key => {
|
|
104
|
+
if (["allowImportingTsExtensions", "allowJs", "allowArbitraryExtensions", "allowSyntheticDefaultImports", "allowUmdGlobalAccess", "allowUnreachableCode", "allowUnusedLabels", "alwaysStrict", "baseUrl", "charset", "checkJs", "customConditions", "declaration", "declarationMap", "emitDeclarationOnly", "declarationDir", "disableSizeLimit", "disableSourceOfProjectReferenceRedirect", "disableSolutionSearching", "disableReferencedProjectLoad", "downlevelIteration", "emitBOM", "emitDecoratorMetadata", "exactOptionalPropertyTypes", "experimentalDecorators", "forceConsistentCasingInFileNames", "ignoreDeprecations", "importHelpers", "importsNotUsedAsValues", "inlineSourceMap", "inlineSources", "isolatedModules", "jsx", "keyofStringsOnly", "lib", "locale", "mapRoot", "maxNodeModuleJsDepth", "module", "moduleResolution", "moduleSuffixes", "moduleDetection", "newLine", "noEmit", "noEmitHelpers", "noEmitOnError", "noErrorTruncation", "noFallthroughCasesInSwitch", "noImplicitAny", "noImplicitReturns", "noImplicitThis", "noStrictGenericChecks", "noUnusedLocals", "noUnusedParameters", "noImplicitUseStrict", "noPropertyAccessFromIndexSignature", "assumeChangesOnlyAffectDirectDependencies", "noLib", "noResolve", "noUncheckedIndexedAccess", "out", "outDir", "outFile", "paths", "preserveConstEnums", "noImplicitOverride", "preserveSymlinks", "preserveValueImports", "project", "reactNamespace", "jsxFactory", "jsxFragmentFactory", "jsxImportSource", "composite", "incremental", "tsBuildInfoFile", "removeComments", "resolvePackageJsonExports", "resolvePackageJsonImports", "rootDir", "rootDirs", "skipLibCheck", "skipDefaultLibCheck", "sourceMap", "sourceRoot", "strict", "strictFunctionTypes", "strictBindCallApply", "strictNullChecks", "strictPropertyInitialization", "stripInternal", "suppressExcessPropertyErrors", "suppressImplicitAnyIndexErrors", "target", "traceResolution", "useUnknownInCatchVariables", "resolveJsonModule", "types", "typeRoots", "verbatimModuleSyntax", "esModuleInterop", "useDefineForClassFields"].some(prop => key === prop))
|
|
105
|
+
return true;
|
|
104
106
|
const value = input[key];
|
|
105
107
|
if (undefined === value)
|
|
106
108
|
return true;
|
|
@@ -963,6 +965,8 @@ var NestiaSdkConfig;
|
|
|
963
965
|
expected: "(boolean | undefined)",
|
|
964
966
|
value: input.useDefineForClassFields
|
|
965
967
|
})) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
968
|
+
if (["allowImportingTsExtensions", "allowJs", "allowArbitraryExtensions", "allowSyntheticDefaultImports", "allowUmdGlobalAccess", "allowUnreachableCode", "allowUnusedLabels", "alwaysStrict", "baseUrl", "charset", "checkJs", "customConditions", "declaration", "declarationMap", "emitDeclarationOnly", "declarationDir", "disableSizeLimit", "disableSourceOfProjectReferenceRedirect", "disableSolutionSearching", "disableReferencedProjectLoad", "downlevelIteration", "emitBOM", "emitDecoratorMetadata", "exactOptionalPropertyTypes", "experimentalDecorators", "forceConsistentCasingInFileNames", "ignoreDeprecations", "importHelpers", "importsNotUsedAsValues", "inlineSourceMap", "inlineSources", "isolatedModules", "jsx", "keyofStringsOnly", "lib", "locale", "mapRoot", "maxNodeModuleJsDepth", "module", "moduleResolution", "moduleSuffixes", "moduleDetection", "newLine", "noEmit", "noEmitHelpers", "noEmitOnError", "noErrorTruncation", "noFallthroughCasesInSwitch", "noImplicitAny", "noImplicitReturns", "noImplicitThis", "noStrictGenericChecks", "noUnusedLocals", "noUnusedParameters", "noImplicitUseStrict", "noPropertyAccessFromIndexSignature", "assumeChangesOnlyAffectDirectDependencies", "noLib", "noResolve", "noUncheckedIndexedAccess", "out", "outDir", "outFile", "paths", "preserveConstEnums", "noImplicitOverride", "preserveSymlinks", "preserveValueImports", "project", "reactNamespace", "jsxFactory", "jsxFragmentFactory", "jsxImportSource", "composite", "incremental", "tsBuildInfoFile", "removeComments", "resolvePackageJsonExports", "resolvePackageJsonImports", "rootDir", "rootDirs", "skipLibCheck", "skipDefaultLibCheck", "sourceMap", "sourceRoot", "strict", "strictFunctionTypes", "strictBindCallApply", "strictNullChecks", "strictPropertyInitialization", "stripInternal", "suppressExcessPropertyErrors", "suppressImplicitAnyIndexErrors", "target", "traceResolution", "useUnknownInCatchVariables", "resolveJsonModule", "types", "typeRoots", "verbatimModuleSyntax", "esModuleInterop", "useDefineForClassFields"].some(prop => key === prop))
|
|
969
|
+
return true;
|
|
966
970
|
const value = input[key];
|
|
967
971
|
if (undefined === value)
|
|
968
972
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaSdkConfig.js","sourceRoot":"","sources":["../../../src/executable/internal/NestiaSdkConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAkC;AAClC,qDAAkD;AAElD,iCAA+B;AAI/B,IAAiB,eAAe,CA0B/B;AA1BD,WAAiB,eAAe;IAC5B,SAAgB,GAAG;QACf,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC;IAFe,mBAAG,MAElB,CAAA;IAED,MAAM,SAAS,GAAG,IAAI,qBAAS,CAAC,GAAS,EAAE;QACvC,IAAI,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC;QAE7D,MAAM,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,KAAK;YACX,eAAe,EAAE;gBACb,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,IAAI;aACf;SACJ,CAAC,CAAC;QAEH,MAAM,MAAM,GACR,yBAAa,cAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,uCAAC,CAAC;QACnD,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAExE,MAAM,MAAM,GACR,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QACjE,MAAM,MAAM,GAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,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,EA1BgB,eAAe,+BAAf,eAAe,QA0B/B"}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.E2eGenerator = void 0;
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
17
|
const path_1 = __importDefault(require("path"));
|
|
18
|
+
const ImportDictionary_1 = require("../utils/ImportDictionary");
|
|
18
19
|
const NestiaConfigUtil_1 = require("../utils/NestiaConfigUtil");
|
|
19
20
|
const E2eFileProgrammer_1 = require("./internal/E2eFileProgrammer");
|
|
20
21
|
var E2eGenerator;
|
|
@@ -31,7 +32,7 @@ var E2eGenerator;
|
|
|
31
32
|
yield index(config)(path_1.default.join(config.e2e, "index.ts"));
|
|
32
33
|
// GENERATE EACH TEST FILES
|
|
33
34
|
for (const route of routeList)
|
|
34
|
-
yield E2eFileProgrammer_1.E2eFileProgrammer.generate(config)({
|
|
35
|
+
yield E2eFileProgrammer_1.E2eFileProgrammer.generate(config)(new ImportDictionary_1.ImportDictionary())({
|
|
35
36
|
api: path_1.default.resolve(config.output),
|
|
36
37
|
current: path_1.default.join(output, "features", "api", "automated"),
|
|
37
38
|
})(route);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2eGenerator.js","sourceRoot":"","sources":["../../src/generates/E2eGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAIxB,gEAA6D;AAC7D,oEAAiE;AAEjE,IAAiB,YAAY,
|
|
1
|
+
{"version":3,"file":"E2eGenerator.js","sourceRoot":"","sources":["../../src/generates/E2eGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAIxB,gEAA6D;AAC7D,gEAA6D;AAC7D,oEAAiE;AAEjE,IAAiB,YAAY,CAsD5B;AAtDD,WAAiB,YAAY;IACZ,qBAAQ,GACjB,CAAC,MAAqB,EAAE,EAAE,CAC1B,CAAO,SAAmB,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KAAK,EACL,UAAU,CACb,CAAC;QACF,MAAM,OAAO,GAAW,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAC9C,QAAQ,EACR,MAAM,CACT,CAAC;QAEF,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CACvB,MAAM,EACN,OAAO,CAAC,OAAO,CACX,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,mCAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CACvD,EACD,MAAM,CACT,CAAC;IACN,CAAC,CAAA,CAAC;AACV,CAAC,EAtDgB,YAAY,4BAAZ,YAAY,QAsD5B;AAED,MAAM,KAAK,GAAG,CAAO,QAAgB,EAAiB,EAAE;IACpD,IAAI;QACA,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;KACrC;IAAC,WAAM,GAAE;AACd,CAAC,CAAA,CAAC"}
|
|
@@ -332,7 +332,7 @@ var SwaggerGenerator;
|
|
|
332
332
|
return true;
|
|
333
333
|
});
|
|
334
334
|
const $io2 = input => Array.isArray(input["enum"]) && input["enum"].every(elem => "boolean" === typeof elem) && (undefined === input["default"] || "boolean" === typeof input["default"]) && "boolean" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
335
|
-
const $io3 = input => "type" === input.kind && ("int" === input.value || "uint" === input.value);
|
|
335
|
+
const $io3 = input => "type" === input.kind && ("int" === input.value || "uint" === input.value || "int32" === input.value || "uint32" === input.value || "int64" === input.value || "uint64" === input.value || "float" === input.value);
|
|
336
336
|
const $io4 = input => "minimum" === input.kind && "number" === typeof input.value;
|
|
337
337
|
const $io5 = input => "maximum" === input.kind && "number" === typeof input.value;
|
|
338
338
|
const $io6 = input => "exclusiveMinimum" === input.kind && "number" === typeof input.value;
|
|
@@ -352,11 +352,11 @@ var SwaggerGenerator;
|
|
|
352
352
|
const $io20 = input => Array.isArray(input["enum"]) && input["enum"].every(elem => "number" === typeof elem) && (undefined === input["default"] || "number" === typeof input["default"]) && "number" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
353
353
|
const $io21 = input => Array.isArray(input["enum"]) && input["enum"].every(elem => "string" === typeof elem) && (undefined === input["default"] || "string" === typeof input["default"]) && "string" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
354
354
|
const $io22 = input => (undefined === input["default"] || "boolean" === typeof input["default"]) && "boolean" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
355
|
-
const $io23 = input => (undefined === input.minimum || "number" === typeof input.minimum &&
|
|
355
|
+
const $io23 = input => (undefined === input.minimum || "number" === typeof input.minimum && Math.floor(input.minimum) === input.minimum && (-2147483648 <= input.minimum && input.minimum <= 2147483647)) && (undefined === input.maximum || "number" === typeof input.maximum && Math.floor(input.maximum) === input.maximum && (-2147483648 <= input.maximum && input.maximum <= 2147483647)) && (undefined === input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && Math.floor(input.multipleOf) === input.multipleOf && (-2147483648 <= input.multipleOf && input.multipleOf <= 2147483647)) && (undefined === input["default"] || "number" === typeof input["default"]) && "integer" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
356
356
|
const $io24 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf) && (undefined === input["default"] || "number" === typeof input["default"]) && "number" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
357
|
-
const $io25 = input => (undefined === input.minLength || "number" === typeof input.minLength &&
|
|
358
|
-
const $io26 = input => "object" === typeof input.items && null !== input.items && false === Array.isArray(input.items) && $iu1(input.items) && (undefined === input.minItems || "number" === typeof input.minItems &&
|
|
359
|
-
const $io27 = input => Array.isArray(input.items) && input.items.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $iu1(elem)) && ("number" === typeof input.minItems &&
|
|
357
|
+
const $io25 = input => (undefined === input.minLength || "number" === typeof input.minLength && Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 4294967295) && (undefined === input.maxLength || "number" === typeof input.maxLength && Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 4294967295) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.format || "string" === typeof input.format) && (undefined === input["default"] || "string" === typeof input["default"]) && "string" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
358
|
+
const $io26 = input => "object" === typeof input.items && null !== input.items && false === Array.isArray(input.items) && $iu1(input.items) && (undefined === input.minItems || "number" === typeof input.minItems && Math.floor(input.minItems) === input.minItems && 0 <= input.minItems && input.minItems <= 4294967295) && (undefined === input.maxItems || "number" === typeof input.maxItems && Math.floor(input.maxItems) === input.maxItems && 0 <= input.maxItems && input.maxItems <= 4294967295) && (undefined === input["x-typia-tuple"] || "object" === typeof input["x-typia-tuple"] && null !== input["x-typia-tuple"] && $io27(input["x-typia-tuple"])) && "array" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
359
|
+
const $io27 = input => Array.isArray(input.items) && input.items.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $iu1(elem)) && ("number" === typeof input.minItems && Math.floor(input.minItems) === input.minItems && 0 <= input.minItems && input.minItems <= 4294967295) && (undefined === input.maxItems || "number" === typeof input.maxItems && Math.floor(input.maxItems) === input.maxItems && 0 <= input.maxItems && input.maxItems <= 4294967295) && "array" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
360
360
|
const $io28 = input => Array.isArray(input.oneOf) && input.oneOf.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $iu1(elem)) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
361
361
|
const $io29 = input => "string" === typeof input.$ref && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
362
362
|
const $io30 = input => "null" === input.type && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
@@ -472,7 +472,7 @@ var SwaggerGenerator;
|
|
|
472
472
|
return true;
|
|
473
473
|
});
|
|
474
474
|
const $io2 = input => Array.isArray(input["enum"]) && input["enum"].every(elem => "boolean" === typeof elem) && (undefined === input["default"] || "boolean" === typeof input["default"]) && "boolean" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
475
|
-
const $io3 = input => "type" === input.kind && ("int" === input.value || "uint" === input.value);
|
|
475
|
+
const $io3 = input => "type" === input.kind && ("int" === input.value || "uint" === input.value || "int32" === input.value || "uint32" === input.value || "int64" === input.value || "uint64" === input.value || "float" === input.value);
|
|
476
476
|
const $io4 = input => "minimum" === input.kind && "number" === typeof input.value;
|
|
477
477
|
const $io5 = input => "maximum" === input.kind && "number" === typeof input.value;
|
|
478
478
|
const $io6 = input => "exclusiveMinimum" === input.kind && "number" === typeof input.value;
|
|
@@ -492,11 +492,11 @@ var SwaggerGenerator;
|
|
|
492
492
|
const $io20 = input => Array.isArray(input["enum"]) && input["enum"].every(elem => "number" === typeof elem) && (undefined === input["default"] || "number" === typeof input["default"]) && "number" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
493
493
|
const $io21 = input => Array.isArray(input["enum"]) && input["enum"].every(elem => "string" === typeof elem) && (undefined === input["default"] || "string" === typeof input["default"]) && "string" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
494
494
|
const $io22 = input => (undefined === input["default"] || "boolean" === typeof input["default"]) && "boolean" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
495
|
-
const $io23 = input => (undefined === input.minimum || "number" === typeof input.minimum &&
|
|
495
|
+
const $io23 = input => (undefined === input.minimum || "number" === typeof input.minimum && Math.floor(input.minimum) === input.minimum && (-2147483648 <= input.minimum && input.minimum <= 2147483647)) && (undefined === input.maximum || "number" === typeof input.maximum && Math.floor(input.maximum) === input.maximum && (-2147483648 <= input.maximum && input.maximum <= 2147483647)) && (undefined === input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && Math.floor(input.multipleOf) === input.multipleOf && (-2147483648 <= input.multipleOf && input.multipleOf <= 2147483647)) && (undefined === input["default"] || "number" === typeof input["default"]) && "integer" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
496
496
|
const $io24 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "boolean" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "boolean" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf) && (undefined === input["default"] || "number" === typeof input["default"]) && "number" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
497
|
-
const $io25 = input => (undefined === input.minLength || "number" === typeof input.minLength &&
|
|
498
|
-
const $io26 = input => "object" === typeof input.items && null !== input.items && false === Array.isArray(input.items) && $iu1(input.items) && (undefined === input.minItems || "number" === typeof input.minItems &&
|
|
499
|
-
const $io27 = input => Array.isArray(input.items) && input.items.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $iu1(elem)) && ("number" === typeof input.minItems &&
|
|
497
|
+
const $io25 = input => (undefined === input.minLength || "number" === typeof input.minLength && Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 4294967295) && (undefined === input.maxLength || "number" === typeof input.maxLength && Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 4294967295) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.format || "string" === typeof input.format) && (undefined === input["default"] || "string" === typeof input["default"]) && "string" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
498
|
+
const $io26 = input => "object" === typeof input.items && null !== input.items && false === Array.isArray(input.items) && $iu1(input.items) && (undefined === input.minItems || "number" === typeof input.minItems && Math.floor(input.minItems) === input.minItems && 0 <= input.minItems && input.minItems <= 4294967295) && (undefined === input.maxItems || "number" === typeof input.maxItems && Math.floor(input.maxItems) === input.maxItems && 0 <= input.maxItems && input.maxItems <= 4294967295) && (undefined === input["x-typia-tuple"] || "object" === typeof input["x-typia-tuple"] && null !== input["x-typia-tuple"] && $io27(input["x-typia-tuple"])) && "array" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
499
|
+
const $io27 = input => Array.isArray(input.items) && input.items.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $iu1(elem)) && ("number" === typeof input.minItems && Math.floor(input.minItems) === input.minItems && 0 <= input.minItems && input.minItems <= 4294967295) && (undefined === input.maxItems || "number" === typeof input.maxItems && Math.floor(input.maxItems) === input.maxItems && 0 <= input.maxItems && input.maxItems <= 4294967295) && "array" === input.type && (undefined === input.nullable || "boolean" === typeof input.nullable) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
500
500
|
const $io28 = input => Array.isArray(input.oneOf) && input.oneOf.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $iu1(elem)) && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
501
501
|
const $io29 = input => "string" === typeof input.$ref && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
502
502
|
const $io30 = input => "null" === input.type && (undefined === input.deprecated || "boolean" === typeof input.deprecated) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input["x-typia-metaTags"] || Array.isArray(input["x-typia-metaTags"]) && input["x-typia-metaTags"].every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (undefined === input["x-typia-jsDocTags"] || Array.isArray(input["x-typia-jsDocTags"]) && input["x-typia-jsDocTags"].every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (undefined === input["x-typia-required"] || "boolean" === typeof input["x-typia-required"]) && (undefined === input["x-typia-optional"] || "boolean" === typeof input["x-typia-optional"]) && (undefined === input["x-typia-rest"] || "boolean" === typeof input["x-typia-rest"]);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { INestiaConfig } from "../../INestiaConfig";
|
|
2
2
|
import { IRoute } from "../../structures/IRoute";
|
|
3
|
+
import { ImportDictionary } from "../../utils/ImportDictionary";
|
|
3
4
|
export declare namespace E2eFileProgrammer {
|
|
4
|
-
const generate: (config: INestiaConfig) => (props: {
|
|
5
|
+
const generate: (config: INestiaConfig) => (importer: ImportDictionary) => (props: {
|
|
5
6
|
api: string;
|
|
6
7
|
current: string;
|
|
7
8
|
}) => (route: IRoute) => Promise<void>;
|
|
@@ -18,11 +18,15 @@ const path_1 = __importDefault(require("path"));
|
|
|
18
18
|
const ImportDictionary_1 = require("../../utils/ImportDictionary");
|
|
19
19
|
var E2eFileProgrammer;
|
|
20
20
|
(function (E2eFileProgrammer) {
|
|
21
|
-
E2eFileProgrammer.generate = (config) => (props) => (route) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
E2eFileProgrammer.generate = (config) => (importer) => (props) => (route) => __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
const importDict = new ImportDictionary_1.ImportDictionary();
|
|
23
23
|
for (const tuple of route.imports)
|
|
24
24
|
for (const instance of tuple[1])
|
|
25
|
-
importDict.
|
|
25
|
+
importDict.internal({
|
|
26
|
+
file: tuple[0],
|
|
27
|
+
type: true,
|
|
28
|
+
instance,
|
|
29
|
+
});
|
|
26
30
|
const additional = [];
|
|
27
31
|
for (const param of route.parameters.filter((p) => p.category !== "headers")) {
|
|
28
32
|
const type = getAdditional(param);
|
|
@@ -32,14 +36,6 @@ var E2eFileProgrammer;
|
|
|
32
36
|
additional.push(DATE);
|
|
33
37
|
}
|
|
34
38
|
const content = [
|
|
35
|
-
...(!!route.parameters.filter((p) => p.category !== "headers" && getAdditional(p) === null).length || route.output.name !== "void"
|
|
36
|
-
? [
|
|
37
|
-
config.primitive === false
|
|
38
|
-
? `import typia from "typia";`
|
|
39
|
-
: `import typia, { Primitive } from "typia";`,
|
|
40
|
-
"",
|
|
41
|
-
]
|
|
42
|
-
: []),
|
|
43
39
|
`import api from "./${path_1.default
|
|
44
40
|
.relative(props.current, props.api)
|
|
45
41
|
.split("\\")
|
|
@@ -48,14 +44,19 @@ var E2eFileProgrammer;
|
|
|
48
44
|
? []
|
|
49
45
|
: [importDict.toScript(props.current)]),
|
|
50
46
|
"",
|
|
51
|
-
arrow(config)(route),
|
|
47
|
+
arrow(config)(importer)(route),
|
|
52
48
|
...(additional.length ? ["", ...additional] : []),
|
|
53
49
|
].join("\n");
|
|
54
50
|
yield fs_1.default.promises.writeFile(`${props.current}/${name(route)}.ts`, content, "utf8");
|
|
55
51
|
});
|
|
56
|
-
const arrow = (config) => (route) => {
|
|
52
|
+
const arrow = (config) => (importer) => (route) => {
|
|
57
53
|
const tab = route.output.name === "void" ? 2 : 3;
|
|
58
54
|
const headers = route.parameters.find((p) => p.category === "headers" && p.field === undefined);
|
|
55
|
+
const typiaLib = () => importer.external({
|
|
56
|
+
type: false,
|
|
57
|
+
library: "typia",
|
|
58
|
+
instance: null,
|
|
59
|
+
});
|
|
59
60
|
const output = [
|
|
60
61
|
`await ${accessor(route)}(`,
|
|
61
62
|
headers !== undefined
|
|
@@ -64,7 +65,7 @@ var E2eFileProgrammer;
|
|
|
64
65
|
" ...connection,",
|
|
65
66
|
" headers: {",
|
|
66
67
|
" ...(connection.headers ?? {}),",
|
|
67
|
-
`
|
|
68
|
+
` ...${typiaLib()}.random<${headers.type.name}>(),`,
|
|
68
69
|
" },",
|
|
69
70
|
"},",
|
|
70
71
|
]
|
|
@@ -73,7 +74,7 @@ var E2eFileProgrammer;
|
|
|
73
74
|
: `${" ".repeat(tab * 4)}connection,`,
|
|
74
75
|
...route.parameters
|
|
75
76
|
.filter((param) => param.category !== "headers")
|
|
76
|
-
.map(parameter(config)(tab)),
|
|
77
|
+
.map(parameter(config)(importer)(tab)),
|
|
77
78
|
`${" ".repeat((tab - 1) * 4)});`,
|
|
78
79
|
].join("\n");
|
|
79
80
|
return [
|
|
@@ -83,14 +84,14 @@ var E2eFileProgrammer;
|
|
|
83
84
|
...(route.output.name === "void"
|
|
84
85
|
? [` ${output}`]
|
|
85
86
|
: [
|
|
86
|
-
` const output: ${primitive(config)(route.output.name)} = `,
|
|
87
|
+
` const output: ${primitive(config)(importer)(route.output.name)} = `,
|
|
87
88
|
` ${output}`,
|
|
88
|
-
`
|
|
89
|
+
` ${typiaLib()}.assert(output);`,
|
|
89
90
|
]),
|
|
90
91
|
`};`,
|
|
91
92
|
].join("\n");
|
|
92
93
|
};
|
|
93
|
-
const parameter = (config) => (tab) => (param) => {
|
|
94
|
+
const parameter = (config) => (importer) => (tab) => (param) => {
|
|
94
95
|
var _a, _b;
|
|
95
96
|
const middle = param.category === "param" &&
|
|
96
97
|
param.custom &&
|
|
@@ -98,12 +99,22 @@ var E2eFileProgrammer;
|
|
|
98
99
|
? param.meta.nullable
|
|
99
100
|
? `Math.random() < .2 ? null : ${param.meta.type}()`
|
|
100
101
|
: `${param.meta.type}()`
|
|
101
|
-
:
|
|
102
|
+
: `${importer.external({
|
|
103
|
+
type: false,
|
|
104
|
+
library: "typia",
|
|
105
|
+
instance: null,
|
|
106
|
+
})}.random<${primitive(config)(importer)(param.type.name)}>()`;
|
|
102
107
|
return `${" ".repeat(4 * tab)}${middle},`;
|
|
103
108
|
};
|
|
104
109
|
const name = (route) => ["test", "api", ...route.accessors].join("_");
|
|
105
110
|
const accessor = (route) => ["api", "functional", ...route.accessors].join(".");
|
|
106
|
-
const primitive = (config) => (name) => config.primitive !== false
|
|
111
|
+
const primitive = (config) => (importer) => (name) => config.primitive !== false
|
|
112
|
+
? `${importer.external({
|
|
113
|
+
type: true,
|
|
114
|
+
library: "@nestia/fetch",
|
|
115
|
+
instance: "Primitive",
|
|
116
|
+
})}<${name}>`
|
|
117
|
+
: name;
|
|
107
118
|
const getAdditional = (param) => {
|
|
108
119
|
if (param.custom === false || param.category !== "param" || !param.meta)
|
|
109
120
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2eFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/E2eFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAIxB,mEAAgE;AAEhE,IAAiB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"E2eFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/E2eFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAIxB,mEAAgE;AAEhE,IAAiB,iBAAiB,CAkJjC;AAlJD,WAAiB,iBAAiB;IACjB,0BAAQ,GACjB,CAAC,MAAqB,EAAE,EAAE,CAC1B,CAAC,QAA0B,EAAE,EAAE,CAC/B,CAAC,KAAuC,EAAE,EAAE,CAC5C,CAAO,KAAa,EAAiB,EAAE;QACnC,MAAM,UAAU,GAAqB,IAAI,mCAAgB,EAAE,CAAC;QAC5D,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO;YAC7B,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC;gBAC3B,UAAU,CAAC,QAAQ,CAAC;oBAChB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;oBACd,IAAI,EAAE,IAAI;oBACV,QAAQ;iBACX,CAAC,CAAC;QAEX,MAAM,UAAU,GAAa,EAAE,CAAC;QAChC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CACvC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAClC,EAAE;YACC,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;YAClC,IAAI,IAAI,KAAK,MAAM;gBAAE,UAAU,CAAC,IAA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KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAU,EAAE,CACvC,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAExD,MAAM,SAAS,GACX,CAAC,MAAqB,EAAE,EAAE,CAC1B,CAAC,QAA0B,EAAE,EAAE,CAC/B,CAAC,IAAY,EAAU,EAAE,CACrB,MAAM,CAAC,SAAS,KAAK,KAAK;QACtB,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACjB,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,WAAW;SACxB,CAAC,IAAI,IAAI,GAAG;QACf,CAAC,CAAC,IAAI,CAAC;IAEnB,MAAM,aAAa,GAAG,CAClB,KAAwB,EACF,EAAE;QACxB,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI;YACnE,OAAO,IAAI,CAAC;aACX,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,MAAM,CAAC;aAC9C,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,MAAM,CAAC;QACnD,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,EAlJgB,iBAAiB,iCAAjB,iBAAiB,QAkJjC;AAED,MAAM,IAAI,GAAG;;;;;QAKL,CAAC;AACT,MAAM,IAAI,GAAG;;;;;;;EAOX,CAAC"}
|
|
@@ -57,45 +57,29 @@ var SdkFileProgrammer;
|
|
|
57
57
|
if (content.length && directory.routes.length)
|
|
58
58
|
content.push("");
|
|
59
59
|
// ITERATE ROUTES
|
|
60
|
-
const
|
|
60
|
+
const importer = new ImportDictionary_1.ImportDictionary();
|
|
61
61
|
if (config.simulate === true &&
|
|
62
62
|
directory.routes.some((r) => !!r.parameters.length))
|
|
63
|
-
|
|
63
|
+
importer.internal({
|
|
64
|
+
file: `${config.output}/utils/NestiaSimulator.ts`,
|
|
65
|
+
instance: "NestiaSimulator",
|
|
66
|
+
type: false,
|
|
67
|
+
});
|
|
64
68
|
directory.routes.forEach((route, i) => {
|
|
65
69
|
for (const tuple of route.imports)
|
|
66
70
|
for (const instance of tuple[1])
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
importer.internal({
|
|
72
|
+
file: tuple[0],
|
|
73
|
+
instance,
|
|
74
|
+
type: true,
|
|
75
|
+
});
|
|
76
|
+
content.push(SdkFunctionProgrammer_1.SdkFunctionProgrammer.generate(config)(importer)(route));
|
|
69
77
|
if (i !== directory.routes.length - 1)
|
|
70
78
|
content.push("");
|
|
71
79
|
});
|
|
72
80
|
// FINALIZE THE CONTENT
|
|
73
|
-
if (directory.routes.length !== 0)
|
|
74
|
-
|
|
75
|
-
directory.routes.some((route) => route.output.name !== "void" ||
|
|
76
|
-
route.parameters.some((param) => param.category !== "param"));
|
|
77
|
-
const asserted = config.assert === true &&
|
|
78
|
-
directory.routes.some((route) => route.parameters.length !== 0);
|
|
79
|
-
const json = config.json === true &&
|
|
80
|
-
directory.routes.some((route) => route.method === "POST" ||
|
|
81
|
-
route.method === "PUT" ||
|
|
82
|
-
route.method === "PATCH");
|
|
83
|
-
const random = config.simulate === true &&
|
|
84
|
-
directory.routes.some((s) => !!s.parameters.length || s.output.name !== "void");
|
|
85
|
-
const classes = ["Fetcher"];
|
|
86
|
-
const typings = ["IConnection"];
|
|
87
|
-
if (primitived)
|
|
88
|
-
typings.push("Primitive");
|
|
89
|
-
const head = [
|
|
90
|
-
`import { ${classes.join(", ")} } from "@nestia/fetcher";`,
|
|
91
|
-
`import type { ${typings.join(", ")} } from "@nestia/fetcher";`,
|
|
92
|
-
];
|
|
93
|
-
if (asserted || json || random)
|
|
94
|
-
head.push(`import typia from "typia";`);
|
|
95
|
-
if (!importDict.empty())
|
|
96
|
-
head.push("", importDict.toScript(outDir));
|
|
97
|
-
content.push(...head, "", ...content.splice(0, content.length));
|
|
98
|
-
}
|
|
81
|
+
if (directory.routes.length !== 0)
|
|
82
|
+
content.push(importer.toScript(outDir), "", ...content.splice(0, content.length));
|
|
99
83
|
const script = "/**\n" +
|
|
100
84
|
" * @packageDocumentation\n" +
|
|
101
85
|
` * @module ${directory.module}\n` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AAIpB,mEAAgE;AAChE,iDAA8C;AAC9C,mEAAgE;AAChE,2DAAwD;AAExD,IAAiB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"SdkFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AAIpB,mEAAgE;AAChE,iDAA8C;AAC9C,mEAAgE;AAChE,2DAAwD;AAExD,IAAiB,iBAAiB,CAkGjC;AAlGD,WAAiB,iBAAiB;IAC9B;;gEAE4D;IAC/C,0BAAQ,GACjB,CAAC,MAAqB,EAAE,EAAE,CAC1B,CAAO,SAAmB,EAAiB,EAAE;QACzC,wBAAwB;QACxB,MAAM,IAAI,GAAsB,IAAI,qCAAiB,CACjD,IAAI,EACJ,YAAY,CACf,CAAC;QACF,KAAK,MAAM,KAAK,IAAI,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;QAEpD,gBAAgB;QAChB,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,aAAa,CAAC,CAAC;IAC/D,CAAC,CAAA,CAAC;IAEN,MAAM,OAAO,GACT,CAAC,SAA4B,EAAE,E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Q,CAAC,SAAS,CAAC,GAAG,MAAM,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC,CAAA,CAAC;AACV,CAAC,EAlGgB,iBAAiB,iCAAjB,iBAAiB,QAkGjC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { INestiaConfig } from "../../INestiaConfig";
|
|
2
2
|
import { IRoute } from "../../structures/IRoute";
|
|
3
|
+
import { ImportDictionary } from "../../utils/ImportDictionary";
|
|
3
4
|
export declare namespace SdkFunctionProgrammer {
|
|
4
|
-
const generate: (config: INestiaConfig) => (route: IRoute) => string;
|
|
5
|
+
const generate: (config: INestiaConfig) => (importer: ImportDictionary) => (route: IRoute) => string;
|
|
5
6
|
}
|