@nestia/sdk 11.2.0 → 12.0.0-dev.20260520.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/bundle/distribute/package.json +1 -1
- package/lib/NestiaSdkApplication.js +5 -4
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/NestiaSwaggerComposer.js +2 -2
- package/lib/NestiaSwaggerComposer.js.map +1 -1
- package/lib/analyses/AccessorAnalyzer.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.js +133 -7
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.d.ts +9 -2
- package/lib/analyses/ImportAnalyzer.js +13 -50
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +5 -4
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +22 -5
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +8 -8
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +15 -15
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/SecurityAnalyzer.js.map +1 -1
- package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +2 -1
- package/lib/analyses/TypedHttpRouteAnalyzer.js +296 -39
- package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js +1 -4
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
- package/lib/decorators/OperationMetadata.d.ts +1 -1
- package/lib/decorators/OperationMetadata.js.map +1 -1
- package/lib/executable/internal/CommandParser.js.map +1 -1
- package/lib/executable/internal/NestiaConfigLoader.d.ts +6 -2
- package/lib/executable/internal/NestiaConfigLoader.js +285 -792
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js +6 -4
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/sdk.js +17 -5
- package/lib/executable/sdk.js.map +1 -1
- package/lib/generates/CloneGenerator.js +2 -2
- package/lib/generates/CloneGenerator.js.map +1 -1
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.js +6 -9
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +20 -107
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +44 -28
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/FilePrinter.d.ts +4 -4
- package/lib/generates/internal/FilePrinter.js +25 -16
- package/lib/generates/internal/FilePrinter.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +2 -2
- package/lib/generates/internal/ImportDictionary.js +7 -5
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +11 -11
- package/lib/generates/internal/SdkAliasCollection.js +27 -31
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.js +15 -70
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.js +2 -2
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +2 -2
- package/lib/generates/internal/SdkHttpCloneProgrammer.js +6 -12
- package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.js +2 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +2 -2
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +73 -77
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +2 -2
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +64 -66
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +4 -10
- package/lib/generates/internal/SdkHttpParameterProgrammer.js +15 -22
- package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +2 -2
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +18 -20
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +3 -3
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +47 -49
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkImportWizard.js.map +1 -1
- package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
- package/lib/generates/internal/SdkTypeProgrammer.d.ts +4 -4
- package/lib/generates/internal/SdkTypeProgrammer.js +66 -67
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +1 -2
- package/lib/generates/internal/SdkTypeTagProgrammer.js +29 -11
- package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +2 -2
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +55 -55
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +3 -3
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +9 -12
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +2 -2
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +43 -45
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationComposer.d.ts +1 -1
- package/lib/generates/internal/SwaggerOperationComposer.js +5 -4
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +0 -3
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +19 -20
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +4 -3
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internal/legacy.d.ts +180 -0
- package/lib/internal/legacy.js +361 -0
- package/lib/internal/legacy.js.map +1 -0
- package/lib/structures/INestiaProject.d.ts +0 -2
- package/lib/{transformers → structures}/IOperationMetadata.d.ts +2 -7
- package/lib/structures/IOperationMetadata.js.map +1 -0
- package/lib/structures/IReflectHttpOperationException.d.ts +1 -1
- package/lib/structures/IReflectHttpOperationParameter.d.ts +1 -1
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +1 -1
- package/lib/structures/IReflectOperationError.d.ts +1 -1
- package/lib/structures/IReflectOperationError.js.map +1 -1
- package/lib/structures/IReflectWebSocketOperation.d.ts +2 -2
- package/lib/structures/ITypedApplication.d.ts +1 -1
- package/lib/structures/ITypedHttpRouteException.d.ts +1 -1
- package/lib/structures/ITypedHttpRouteParameter.d.ts +1 -1
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +1 -1
- package/lib/structures/ITypedWebSocketRoute.d.ts +2 -2
- package/lib/transform.d.ts +9 -3
- package/lib/transform.js +47 -5
- package/lib/transform.js.map +1 -1
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/lib/utils/FileRetriever.js.map +1 -1
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/PathUtil.js.map +1 -1
- package/lib/utils/SourceFinder.js.map +1 -1
- package/lib/utils/StringUtil.js.map +1 -1
- package/lib/utils/TsConfigReader.d.ts +7 -0
- package/lib/utils/TsConfigReader.js +102 -0
- package/lib/utils/TsConfigReader.js.map +1 -0
- package/lib/utils/TtscExecutor.d.ts +8 -0
- package/lib/utils/TtscExecutor.js +58 -0
- package/lib/utils/TtscExecutor.js.map +1 -0
- package/lib/utils/VersioningStrategy.js.map +1 -1
- package/lib/validators/HttpHeadersValidator.d.ts +8 -5
- package/lib/validators/HttpHeadersValidator.js +7 -26
- package/lib/validators/HttpHeadersValidator.js.map +1 -1
- package/lib/validators/HttpQueryValidator.d.ts +8 -5
- package/lib/validators/HttpQueryValidator.js +7 -26
- package/lib/validators/HttpQueryValidator.js.map +1 -1
- package/lib/{transformers → validators}/TextPlainValidator.d.ts +1 -1
- package/lib/{transformers → validators}/TextPlainValidator.js +2 -1
- package/lib/validators/TextPlainValidator.js.map +1 -0
- package/package.json +21 -19
- package/src/NestiaSdkApplication.ts +9 -5
- package/src/NestiaSwaggerComposer.ts +2 -3
- package/src/analyses/ConfigAnalyzer.ts +175 -1
- package/src/analyses/ImportAnalyzer.ts +15 -49
- package/src/analyses/ReflectControllerAnalyzer.ts +1 -1
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +1 -1
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +24 -6
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +3 -3
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +14 -10
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +2 -2
- package/src/analyses/TypedHttpRouteAnalyzer.ts +354 -22
- package/src/decorators/OperationMetadata.ts +1 -1
- package/src/executable/internal/NestiaConfigLoader.ts +419 -52
- package/src/executable/internal/NestiaSdkCommand.ts +9 -10
- package/src/executable/sdk.ts +15 -4
- package/src/generates/CloneGenerator.ts +10 -10
- package/src/generates/SwaggerGenerator.ts +28 -9
- package/src/generates/internal/E2eFileProgrammer.ts +80 -43
- package/src/generates/internal/FilePrinter.ts +38 -37
- package/src/generates/internal/ImportDictionary.ts +18 -16
- package/src/generates/internal/SdkAliasCollection.ts +41 -40
- package/src/generates/internal/SdkDistributionComposer.ts +21 -8
- package/src/generates/internal/SdkFileProgrammer.ts +7 -5
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +10 -10
- package/src/generates/internal/SdkHttpCloneReferencer.ts +6 -6
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +101 -78
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +153 -145
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +20 -33
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +2 -2
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +88 -86
- package/src/generates/internal/SdkTypeProgrammer.ts +93 -99
- package/src/generates/internal/SdkTypeTagProgrammer.ts +12 -12
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +128 -118
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +15 -13
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +133 -112
- package/src/generates/internal/SwaggerOperationComposer.ts +1 -1
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +10 -9
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +1 -1
- package/src/internal/legacy.ts +492 -0
- package/src/structures/INestiaProject.ts +0 -3
- package/src/{transformers → structures}/IOperationMetadata.ts +2 -7
- package/src/structures/IReflectHttpOperationException.ts +1 -1
- package/src/structures/IReflectHttpOperationParameter.ts +1 -1
- package/src/structures/IReflectHttpOperationSuccess.ts +1 -1
- package/src/structures/IReflectOperationError.ts +1 -1
- package/src/structures/IReflectWebSocketOperation.ts +2 -2
- package/src/structures/ITypedApplication.ts +1 -1
- package/src/structures/ITypedHttpRouteException.ts +1 -1
- package/src/structures/ITypedHttpRouteParameter.ts +1 -1
- package/src/structures/ITypedHttpRouteSuccess.ts +1 -1
- package/src/structures/ITypedWebSocketRoute.ts +2 -2
- package/src/transform.ts +68 -7
- package/src/utils/TsConfigReader.ts +108 -0
- package/src/utils/TtscExecutor.ts +63 -0
- package/src/validators/HttpHeadersValidator.ts +8 -37
- package/src/validators/HttpQueryValidator.ts +8 -37
- package/src/{transformers → validators}/TextPlainValidator.ts +2 -2
- package/lib/analyses/DtoAnalyzer.d.ts +0 -21
- package/lib/analyses/DtoAnalyzer.js +0 -219
- package/lib/analyses/DtoAnalyzer.js.map +0 -1
- package/lib/analyses/ExceptionAnalyzer.d.ts +0 -0
- package/lib/analyses/ExceptionAnalyzer.js +0 -2
- package/lib/analyses/ExceptionAnalyzer.js.map +0 -1
- package/lib/analyses/GenericAnalyzer.d.ts +0 -4
- package/lib/analyses/GenericAnalyzer.js +0 -42
- package/lib/analyses/GenericAnalyzer.js.map +0 -1
- package/lib/structures/IReflectApplication.d.ts +0 -6
- package/lib/structures/IReflectApplication.js +0 -3
- package/lib/structures/IReflectApplication.js.map +0 -1
- package/lib/structures/MethodType.d.ts +0 -4
- package/lib/structures/MethodType.js +0 -8
- package/lib/structures/MethodType.js.map +0 -1
- package/lib/structures/ParamCategory.d.ts +0 -1
- package/lib/structures/ParamCategory.js +0 -3
- package/lib/structures/ParamCategory.js.map +0 -1
- package/lib/structures/TypeEntry.d.ts +0 -9
- package/lib/structures/TypeEntry.js +0 -21
- package/lib/structures/TypeEntry.js.map +0 -1
- package/lib/transformers/IOperationMetadata.js.map +0 -1
- package/lib/transformers/ISdkOperationTransformerContext.d.ts +0 -7
- package/lib/transformers/ISdkOperationTransformerContext.js +0 -3
- package/lib/transformers/ISdkOperationTransformerContext.js.map +0 -1
- package/lib/transformers/SdkOperationProgrammer.d.ts +0 -15
- package/lib/transformers/SdkOperationProgrammer.js +0 -186
- package/lib/transformers/SdkOperationProgrammer.js.map +0 -1
- package/lib/transformers/SdkOperationTransformer.d.ts +0 -4
- package/lib/transformers/SdkOperationTransformer.js +0 -128
- package/lib/transformers/SdkOperationTransformer.js.map +0 -1
- package/lib/transformers/TextPlainValidator.js.map +0 -1
- package/lib/utils/MetadataUtil.d.ts +0 -4
- package/lib/utils/MetadataUtil.js +0 -34
- package/lib/utils/MetadataUtil.js.map +0 -1
- package/lib/utils/StripEnums.d.ts +0 -3
- package/lib/utils/StripEnums.js +0 -3
- package/lib/utils/StripEnums.js.map +0 -1
- package/lib/utils/TypeLiteralExpression.d.ts +0 -0
- package/lib/utils/TypeLiteralExpression.js +0 -2
- package/lib/utils/TypeLiteralExpression.js.map +0 -1
- package/src/analyses/DtoAnalyzer.ts +0 -260
- package/src/analyses/ExceptionAnalyzer.ts +0 -154
- package/src/analyses/GenericAnalyzer.ts +0 -49
- package/src/structures/IReflectApplication.ts +0 -8
- package/src/structures/MethodType.ts +0 -5
- package/src/structures/ParamCategory.ts +0 -1
- package/src/structures/TypeEntry.ts +0 -22
- package/src/transformers/ISdkOperationTransformerContext.ts +0 -8
- package/src/transformers/SdkOperationProgrammer.ts +0 -240
- package/src/transformers/SdkOperationTransformer.ts +0 -248
- package/src/utils/MetadataUtil.ts +0 -26
- package/src/utils/StripEnums.ts +0 -5
- package/src/utils/TypeLiteralExpression.ts +0 -0
- /package/lib/{transformers → structures}/IOperationMetadata.js +0 -0
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -46,783 +13,309 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
13
|
};
|
|
47
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
15
|
exports.NestiaConfigLoader = void 0;
|
|
49
|
-
const __typia_transform__assertGuard = __importStar(require("typia/lib/internal/_assertGuard"));
|
|
50
|
-
const __typia_transform__isFormatEmail = __importStar(require("typia/lib/internal/_isFormatEmail"));
|
|
51
|
-
const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString"));
|
|
52
16
|
const core_1 = require("@nestia/core");
|
|
53
17
|
const fs_1 = __importDefault(require("fs"));
|
|
54
18
|
const path_1 = __importDefault(require("path"));
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const typia_1 = __importDefault(require("typia"));
|
|
19
|
+
const url_1 = require("url");
|
|
20
|
+
const TsConfigReader_1 = require("../../utils/TsConfigReader");
|
|
21
|
+
const TtscExecutor_1 = require("../../utils/TtscExecutor");
|
|
59
22
|
var NestiaConfigLoader;
|
|
60
23
|
(function (NestiaConfigLoader) {
|
|
61
24
|
NestiaConfigLoader.compilerOptions = (project) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
const configFileName =
|
|
25
|
+
const configFileName = findConfigFile(process.cwd(), project);
|
|
63
26
|
if (!configFileName)
|
|
64
27
|
throw new Error(`unable to find "${project}" file.`);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
28
|
+
const tsconfig = yield TsConfigReader_1.TsConfigReader.read(configFileName);
|
|
29
|
+
return {
|
|
30
|
+
raw: {
|
|
31
|
+
compilerOptions: typeof (tsconfig === null || tsconfig === void 0 ? void 0 : tsconfig.compilerOptions) === "object"
|
|
32
|
+
? tsconfig.compilerOptions
|
|
33
|
+
: {},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
69
36
|
});
|
|
70
37
|
NestiaConfigLoader.configurations = (file, compilerOptions) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
var _a, _b;
|
|
72
38
|
if (fs_1.default.existsSync(path_1.default.resolve(file)) === false)
|
|
73
39
|
throw new Error(`Unable to find "${file}" file.`);
|
|
74
|
-
(0, core_1.doNotThrowTransformError)(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(true, {
|
|
84
|
-
method: "typia\n .assert",
|
|
85
|
-
path: _path + "[" + _index2 + "]",
|
|
86
|
-
expected: "object",
|
|
87
|
-
value: elem
|
|
88
|
-
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
89
|
-
method: "typia\n .assert",
|
|
90
|
-
path: _path + "[" + _index2 + "]",
|
|
91
|
-
expected: "object",
|
|
92
|
-
value: elem
|
|
93
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
94
|
-
method: "typia\n .assert",
|
|
95
|
-
path: _path + "",
|
|
96
|
-
expected: "Array<object>",
|
|
97
|
-
value: input
|
|
98
|
-
}, _errorFactory))(input, "$input", true);
|
|
99
|
-
}
|
|
100
|
-
return input;
|
|
101
|
-
}; })()((_a = compilerOptions.plugins) !== null && _a !== void 0 ? _a : []).some((x) => x.transform === "@nestia/sdk/lib/transform");
|
|
102
|
-
const plugins = [
|
|
103
|
-
...((_b = compilerOptions.plugins) !== null && _b !== void 0 ? _b : []),
|
|
104
|
-
...(setup ? [] : [{ transform: "@nestia/sdk/lib/transform" }]),
|
|
105
|
-
];
|
|
106
|
-
if (!process[Symbol.for("ts-node.register.instance")])
|
|
107
|
-
(0, ts_node_1.register)({
|
|
108
|
-
emit: false,
|
|
109
|
-
compilerOptions: Object.assign(Object.assign({}, compilerOptions), { plugins }),
|
|
110
|
-
require: compilerOptions.baseUrl
|
|
111
|
-
? ["tsconfig-paths/register"]
|
|
112
|
-
: undefined,
|
|
113
|
-
});
|
|
114
|
-
const loaded = yield Promise.resolve(`${path_1.default.resolve(file)}`).then(s => __importStar(require(s)));
|
|
115
|
-
const instance = typeof (loaded === null || loaded === void 0 ? void 0 : loaded.default) === "object" && loaded.default !== null
|
|
116
|
-
? loaded.default
|
|
117
|
-
: loaded;
|
|
40
|
+
(0, core_1.doNotThrowTransformError)(false);
|
|
41
|
+
if (compilerOptions.plugins !== undefined)
|
|
42
|
+
assertPlugins(file, compilerOptions.plugins);
|
|
43
|
+
const configFile = yield materializeConfiguration({
|
|
44
|
+
file,
|
|
45
|
+
compilerOptions,
|
|
46
|
+
});
|
|
47
|
+
const loaded = yield loadMaterializedModule(configFile);
|
|
48
|
+
const instance = extractConfiguration(file, loaded);
|
|
118
49
|
const configurations = Array.isArray(instance)
|
|
119
50
|
? instance
|
|
120
51
|
: [instance];
|
|
52
|
+
return assertConfigurations(file, configurations);
|
|
53
|
+
});
|
|
54
|
+
const MATERIALIZED_ROOTS = new Set();
|
|
55
|
+
let CLEANUP_REGISTERED = false;
|
|
56
|
+
const materializeConfiguration = (props) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const configFile = path_1.default.resolve(props.file);
|
|
59
|
+
const project = (_a = process.env.NESTIA_PROJECT) !== null && _a !== void 0 ? _a : "tsconfig.json";
|
|
60
|
+
const projectFile = findConfigFile(process.cwd(), project);
|
|
61
|
+
if (projectFile === undefined)
|
|
62
|
+
throw new Error(`unable to find "${project}" file.`);
|
|
63
|
+
const projectRoot = path_1.default.dirname(path_1.default.resolve(projectFile));
|
|
64
|
+
const wrapperRoot = fs_1.default.mkdtempSync(path_1.default.join(ensureMaterializedRoot(projectRoot), "tsconfig-"));
|
|
65
|
+
const outputRoot = fs_1.default.mkdtempSync(path_1.default.join(ensureMaterializedRoot(projectRoot), "run-"));
|
|
66
|
+
const wrapperFile = path_1.default.join(wrapperRoot, "tsconfig.json");
|
|
67
|
+
const wrapperConfig = {
|
|
68
|
+
extends: projectFile,
|
|
69
|
+
compilerOptions: Object.assign(Object.assign({ noEmit: false, noUnusedLocals: false, noUnusedParameters: false }, nodeAmbientCompilerOptions(projectRoot, props.compilerOptions)), { outDir: outputRoot, plugins: materializePlugins(props.compilerOptions.plugins), rootDir: projectRoot }),
|
|
70
|
+
include: [configFile],
|
|
71
|
+
exclude: [path_1.default.join(projectRoot, "src", "test", "**", "*")],
|
|
72
|
+
};
|
|
73
|
+
fs_1.default.writeFileSync(wrapperFile, JSON.stringify(wrapperConfig, null, 2), "utf8");
|
|
121
74
|
try {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
261
|
-
method: "typia.assert",
|
|
262
|
-
path: _path + ".exclude",
|
|
263
|
-
expected: "(Array<string> | undefined)",
|
|
264
|
-
value: input.exclude
|
|
265
|
-
}, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
266
|
-
method: "typia.assert",
|
|
267
|
-
path: _path + ".output",
|
|
268
|
-
expected: "string",
|
|
269
|
-
value: input.output
|
|
270
|
-
}, _errorFactory)) && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi || "3.2" === input.openapi || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
271
|
-
method: "typia.assert",
|
|
272
|
-
path: _path + ".openapi",
|
|
273
|
-
expected: "(\"2.0\" | \"3.0\" | \"3.1\" | \"3.2\" | undefined)",
|
|
274
|
-
value: input.openapi
|
|
275
|
-
}, _errorFactory)) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
276
|
-
method: "typia.assert",
|
|
277
|
-
path: _path + ".beautify",
|
|
278
|
-
expected: "(boolean | number | undefined)",
|
|
279
|
-
value: input.beautify
|
|
280
|
-
}, _errorFactory)) && (undefined === input.additional || "boolean" === typeof input.additional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
281
|
-
method: "typia.assert",
|
|
282
|
-
path: _path + ".additional",
|
|
283
|
-
expected: "(boolean | undefined)",
|
|
284
|
-
value: input.additional
|
|
285
|
-
}, _errorFactory)) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
286
|
-
method: "typia.assert",
|
|
287
|
-
path: _path + ".info",
|
|
288
|
-
expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
|
|
289
|
-
value: input.info
|
|
290
|
-
}, _errorFactory)) && _ao3(input.info, _path + ".info", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
291
|
-
method: "typia.assert",
|
|
292
|
-
path: _path + ".info",
|
|
293
|
-
expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
|
|
294
|
-
value: input.info
|
|
295
|
-
}, _errorFactory)) && (undefined === input.servers || (Array.isArray(input.servers) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
296
|
-
method: "typia.assert",
|
|
297
|
-
path: _path + ".servers",
|
|
298
|
-
expected: "(Array<OpenApi.IServer> | undefined)",
|
|
299
|
-
value: input.servers
|
|
300
|
-
}, _errorFactory)) && input.servers.every((elem, _index12) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
301
|
-
method: "typia.assert",
|
|
302
|
-
path: _path + ".servers[" + _index12 + "]",
|
|
303
|
-
expected: "OpenApi.IServer",
|
|
304
|
-
value: elem
|
|
305
|
-
}, _errorFactory)) && _ao6(elem, _path + ".servers[" + _index12 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
306
|
-
method: "typia.assert",
|
|
307
|
-
path: _path + ".servers[" + _index12 + "]",
|
|
308
|
-
expected: "OpenApi.IServer",
|
|
309
|
-
value: elem
|
|
310
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
311
|
-
method: "typia.assert",
|
|
312
|
-
path: _path + ".servers",
|
|
313
|
-
expected: "(Array<OpenApi.IServer> | undefined)",
|
|
314
|
-
value: input.servers
|
|
315
|
-
}, _errorFactory)) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
316
|
-
method: "typia.assert",
|
|
317
|
-
path: _path + ".security",
|
|
318
|
-
expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
|
|
319
|
-
value: input.security
|
|
320
|
-
}, _errorFactory)) && _ao9(input.security, _path + ".security", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
321
|
-
method: "typia.assert",
|
|
322
|
-
path: _path + ".security",
|
|
323
|
-
expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
|
|
324
|
-
value: input.security
|
|
325
|
-
}, _errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
326
|
-
method: "typia.assert",
|
|
327
|
-
path: _path + ".tags",
|
|
328
|
-
expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
|
|
329
|
-
value: input.tags
|
|
330
|
-
}, _errorFactory)) && input.tags.every((elem, _index13) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
331
|
-
method: "typia.assert",
|
|
332
|
-
path: _path + ".tags[" + _index13 + "]",
|
|
333
|
-
expected: "OpenApi.IDocument.ITag",
|
|
334
|
-
value: elem
|
|
335
|
-
}, _errorFactory)) && _ao21(elem, _path + ".tags[" + _index13 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
336
|
-
method: "typia.assert",
|
|
337
|
-
path: _path + ".tags[" + _index13 + "]",
|
|
338
|
-
expected: "OpenApi.IDocument.ITag",
|
|
339
|
-
value: elem
|
|
340
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
341
|
-
method: "typia.assert",
|
|
342
|
-
path: _path + ".tags",
|
|
343
|
-
expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
|
|
344
|
-
value: input.tags
|
|
345
|
-
}, _errorFactory)) && (undefined === input.decompose || "boolean" === typeof input.decompose || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
346
|
-
method: "typia.assert",
|
|
347
|
-
path: _path + ".decompose",
|
|
348
|
-
expected: "(boolean | undefined)",
|
|
349
|
-
value: input.decompose
|
|
350
|
-
}, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
351
|
-
method: "typia.assert",
|
|
352
|
-
path: _path + ".title",
|
|
353
|
-
expected: "(string | undefined)",
|
|
354
|
-
value: input.title
|
|
355
|
-
}, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
356
|
-
method: "typia.assert",
|
|
357
|
-
path: _path + ".summary",
|
|
358
|
-
expected: "(string | undefined)",
|
|
359
|
-
value: input.summary
|
|
360
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
361
|
-
method: "typia.assert",
|
|
362
|
-
path: _path + ".description",
|
|
363
|
-
expected: "(string | undefined)",
|
|
364
|
-
value: input.description
|
|
365
|
-
}, _errorFactory)) && (undefined === input.termsOfService || "string" === typeof input.termsOfService || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
366
|
-
method: "typia.assert",
|
|
367
|
-
path: _path + ".termsOfService",
|
|
368
|
-
expected: "(string | undefined)",
|
|
369
|
-
value: input.termsOfService
|
|
370
|
-
}, _errorFactory)) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
371
|
-
method: "typia.assert",
|
|
372
|
-
path: _path + ".contact",
|
|
373
|
-
expected: "(OpenApi.IDocument.IContact | undefined)",
|
|
374
|
-
value: input.contact
|
|
375
|
-
}, _errorFactory)) && _ao4(input.contact, _path + ".contact", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
376
|
-
method: "typia.assert",
|
|
377
|
-
path: _path + ".contact",
|
|
378
|
-
expected: "(OpenApi.IDocument.IContact | undefined)",
|
|
379
|
-
value: input.contact
|
|
380
|
-
}, _errorFactory)) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
381
|
-
method: "typia.assert",
|
|
382
|
-
path: _path + ".license",
|
|
383
|
-
expected: "(OpenApi.IDocument.ILicense | undefined)",
|
|
384
|
-
value: input.license
|
|
385
|
-
}, _errorFactory)) && _ao5(input.license, _path + ".license", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
386
|
-
method: "typia.assert",
|
|
387
|
-
path: _path + ".license",
|
|
388
|
-
expected: "(OpenApi.IDocument.ILicense | undefined)",
|
|
389
|
-
value: input.license
|
|
390
|
-
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
391
|
-
method: "typia.assert",
|
|
392
|
-
path: _path + ".version",
|
|
393
|
-
expected: "(string | undefined)",
|
|
394
|
-
value: input.version
|
|
395
|
-
}, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
396
|
-
method: "typia.assert",
|
|
397
|
-
path: _path + ".name",
|
|
398
|
-
expected: "(string | undefined)",
|
|
399
|
-
value: input.name
|
|
400
|
-
}, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
401
|
-
method: "typia.assert",
|
|
402
|
-
path: _path + ".url",
|
|
403
|
-
expected: "(string | undefined)",
|
|
404
|
-
value: input.url
|
|
405
|
-
}, _errorFactory)) && (undefined === input.email || "string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
406
|
-
method: "typia.assert",
|
|
407
|
-
path: _path + ".email",
|
|
408
|
-
expected: "string & Format<\"email\">",
|
|
409
|
-
value: input.email
|
|
410
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
411
|
-
method: "typia.assert",
|
|
412
|
-
path: _path + ".email",
|
|
413
|
-
expected: "((string & Format<\"email\">) | undefined)",
|
|
414
|
-
value: input.email
|
|
415
|
-
}, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
416
|
-
method: "typia.assert",
|
|
417
|
-
path: _path + ".name",
|
|
418
|
-
expected: "string",
|
|
419
|
-
value: input.name
|
|
420
|
-
}, _errorFactory)) && (undefined === input.identifier || "string" === typeof input.identifier || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
421
|
-
method: "typia.assert",
|
|
422
|
-
path: _path + ".identifier",
|
|
423
|
-
expected: "(string | undefined)",
|
|
424
|
-
value: input.identifier
|
|
425
|
-
}, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
426
|
-
method: "typia.assert",
|
|
427
|
-
path: _path + ".url",
|
|
428
|
-
expected: "(string | undefined)",
|
|
429
|
-
value: input.url
|
|
430
|
-
}, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
431
|
-
method: "typia.assert",
|
|
432
|
-
path: _path + ".url",
|
|
433
|
-
expected: "string",
|
|
434
|
-
value: input.url
|
|
435
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
436
|
-
method: "typia.assert",
|
|
437
|
-
path: _path + ".description",
|
|
438
|
-
expected: "(string | undefined)",
|
|
439
|
-
value: input.description
|
|
440
|
-
}, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
441
|
-
method: "typia.assert",
|
|
442
|
-
path: _path + ".variables",
|
|
443
|
-
expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
|
|
444
|
-
value: input.variables
|
|
445
|
-
}, _errorFactory)) && _ao7(input.variables, _path + ".variables", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
446
|
-
method: "typia.assert",
|
|
447
|
-
path: _path + ".variables",
|
|
448
|
-
expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
|
|
449
|
-
value: input.variables
|
|
450
|
-
}, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
451
|
-
const value = input[key];
|
|
452
|
-
if (undefined === value)
|
|
453
|
-
return true;
|
|
454
|
-
return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
455
|
-
method: "typia.assert",
|
|
456
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
457
|
-
expected: "OpenApi.IServer.IVariable",
|
|
458
|
-
value: value
|
|
459
|
-
}, _errorFactory)) && _ao8(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
460
|
-
method: "typia.assert",
|
|
461
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
462
|
-
expected: "OpenApi.IServer.IVariable",
|
|
463
|
-
value: value
|
|
464
|
-
}, _errorFactory);
|
|
465
|
-
}); const _ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input["default"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
466
|
-
method: "typia.assert",
|
|
467
|
-
path: _path + "[\"default\"]",
|
|
468
|
-
expected: "string",
|
|
469
|
-
value: input["default"]
|
|
470
|
-
}, _errorFactory)) && (undefined === input["enum"] || (Array.isArray(input["enum"]) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
471
|
-
method: "typia.assert",
|
|
472
|
-
path: _path + "[\"enum\"]",
|
|
473
|
-
expected: "(Array<string> | undefined)",
|
|
474
|
-
value: input["enum"]
|
|
475
|
-
}, _errorFactory)) && input["enum"].every((elem, _index14) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
476
|
-
method: "typia.assert",
|
|
477
|
-
path: _path + "[\"enum\"][" + _index14 + "]",
|
|
478
|
-
expected: "string",
|
|
479
|
-
value: elem
|
|
480
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
481
|
-
method: "typia.assert",
|
|
482
|
-
path: _path + "[\"enum\"]",
|
|
483
|
-
expected: "(Array<string> | undefined)",
|
|
484
|
-
value: input["enum"]
|
|
485
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
486
|
-
method: "typia.assert",
|
|
487
|
-
path: _path + ".description",
|
|
488
|
-
expected: "(string | undefined)",
|
|
489
|
-
value: input.description
|
|
490
|
-
}, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
491
|
-
const value = input[key];
|
|
492
|
-
if (undefined === value)
|
|
493
|
-
return true;
|
|
494
|
-
return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
495
|
-
method: "typia.assert",
|
|
496
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
497
|
-
expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
|
|
498
|
-
value: value
|
|
499
|
-
}, _errorFactory)) && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
500
|
-
method: "typia.assert",
|
|
501
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
502
|
-
expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
|
|
503
|
-
value: value
|
|
504
|
-
}, _errorFactory);
|
|
505
|
-
}); const _ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
506
|
-
method: "typia.assert",
|
|
507
|
-
path: _path + ".type",
|
|
508
|
-
expected: "\"apiKey\"",
|
|
509
|
-
value: input.type
|
|
510
|
-
}, _errorFactory)) && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
511
|
-
method: "typia.assert",
|
|
512
|
-
path: _path + "[\"in\"]",
|
|
513
|
-
expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
|
|
514
|
-
value: input["in"]
|
|
515
|
-
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
516
|
-
method: "typia.assert",
|
|
517
|
-
path: _path + ".name",
|
|
518
|
-
expected: "(string | undefined)",
|
|
519
|
-
value: input.name
|
|
520
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
521
|
-
method: "typia.assert",
|
|
522
|
-
path: _path + ".description",
|
|
523
|
-
expected: "(string | undefined)",
|
|
524
|
-
value: input.description
|
|
525
|
-
}, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => ("http" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
526
|
-
method: "typia.assert",
|
|
527
|
-
path: _path + ".type",
|
|
528
|
-
expected: "\"http\"",
|
|
529
|
-
value: input.type
|
|
530
|
-
}, _errorFactory)) && ("basic" === input.scheme || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
531
|
-
method: "typia.assert",
|
|
532
|
-
path: _path + ".scheme",
|
|
533
|
-
expected: "\"basic\"",
|
|
534
|
-
value: input.scheme
|
|
535
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
536
|
-
method: "typia.assert",
|
|
537
|
-
path: _path + ".description",
|
|
538
|
-
expected: "(string | undefined)",
|
|
539
|
-
value: input.description
|
|
540
|
-
}, _errorFactory)); const _ao12 = (input, _path, _exceptionable = true) => ("http" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
541
|
-
method: "typia.assert",
|
|
542
|
-
path: _path + ".type",
|
|
543
|
-
expected: "\"http\"",
|
|
544
|
-
value: input.type
|
|
545
|
-
}, _errorFactory)) && ("bearer" === input.scheme || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
546
|
-
method: "typia.assert",
|
|
547
|
-
path: _path + ".scheme",
|
|
548
|
-
expected: "\"bearer\"",
|
|
549
|
-
value: input.scheme
|
|
550
|
-
}, _errorFactory)) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
551
|
-
method: "typia.assert",
|
|
552
|
-
path: _path + ".bearerFormat",
|
|
553
|
-
expected: "(string | undefined)",
|
|
554
|
-
value: input.bearerFormat
|
|
555
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
556
|
-
method: "typia.assert",
|
|
557
|
-
path: _path + ".description",
|
|
558
|
-
expected: "(string | undefined)",
|
|
559
|
-
value: input.description
|
|
560
|
-
}, _errorFactory)); const _ao13 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
561
|
-
method: "typia.assert",
|
|
562
|
-
path: _path + ".type",
|
|
563
|
-
expected: "\"oauth2\"",
|
|
564
|
-
value: input.type
|
|
565
|
-
}, _errorFactory)) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
566
|
-
method: "typia.assert",
|
|
567
|
-
path: _path + ".flows",
|
|
568
|
-
expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
|
|
569
|
-
value: input.flows
|
|
570
|
-
}, _errorFactory)) && _ao14(input.flows, _path + ".flows", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
571
|
-
method: "typia.assert",
|
|
572
|
-
path: _path + ".flows",
|
|
573
|
-
expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
|
|
574
|
-
value: input.flows
|
|
575
|
-
}, _errorFactory)) && (undefined === input.oauth2MetadataUrl || "string" === typeof input.oauth2MetadataUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
576
|
-
method: "typia.assert",
|
|
577
|
-
path: _path + ".oauth2MetadataUrl",
|
|
578
|
-
expected: "(string | undefined)",
|
|
579
|
-
value: input.oauth2MetadataUrl
|
|
580
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
581
|
-
method: "typia.assert",
|
|
582
|
-
path: _path + ".description",
|
|
583
|
-
expected: "(string | undefined)",
|
|
584
|
-
value: input.description
|
|
585
|
-
}, _errorFactory)); const _ao14 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
586
|
-
method: "typia.assert",
|
|
587
|
-
path: _path + ".authorizationCode",
|
|
588
|
-
expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
|
|
589
|
-
value: input.authorizationCode
|
|
590
|
-
}, _errorFactory)) && _ao15(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
591
|
-
method: "typia.assert",
|
|
592
|
-
path: _path + ".authorizationCode",
|
|
593
|
-
expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
|
|
594
|
-
value: input.authorizationCode
|
|
595
|
-
}, _errorFactory)) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
596
|
-
method: "typia.assert",
|
|
597
|
-
path: _path + ".implicit",
|
|
598
|
-
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
|
|
599
|
-
value: input.implicit
|
|
600
|
-
}, _errorFactory)) && _ao17(input.implicit, _path + ".implicit", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
601
|
-
method: "typia.assert",
|
|
602
|
-
path: _path + ".implicit",
|
|
603
|
-
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
|
|
604
|
-
value: input.implicit
|
|
605
|
-
}, _errorFactory)) && (undefined === input.password || ("object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
606
|
-
method: "typia.assert",
|
|
607
|
-
path: _path + ".password",
|
|
608
|
-
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
609
|
-
value: input.password
|
|
610
|
-
}, _errorFactory)) && _ao18(input.password, _path + ".password", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
611
|
-
method: "typia.assert",
|
|
612
|
-
path: _path + ".password",
|
|
613
|
-
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
614
|
-
value: input.password
|
|
615
|
-
}, _errorFactory)) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
616
|
-
method: "typia.assert",
|
|
617
|
-
path: _path + ".clientCredentials",
|
|
618
|
-
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
619
|
-
value: input.clientCredentials
|
|
620
|
-
}, _errorFactory)) && _ao18(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
621
|
-
method: "typia.assert",
|
|
622
|
-
path: _path + ".clientCredentials",
|
|
623
|
-
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
624
|
-
value: input.clientCredentials
|
|
625
|
-
}, _errorFactory)) && (undefined === input.deviceAuthorization || ("object" === typeof input.deviceAuthorization && null !== input.deviceAuthorization || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
626
|
-
method: "typia.assert",
|
|
627
|
-
path: _path + ".deviceAuthorization",
|
|
628
|
-
expected: "(OpenApi.ISecurityScheme.IOAuth2.IDeviceFlow | undefined)",
|
|
629
|
-
value: input.deviceAuthorization
|
|
630
|
-
}, _errorFactory)) && _ao19(input.deviceAuthorization, _path + ".deviceAuthorization", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
631
|
-
method: "typia.assert",
|
|
632
|
-
path: _path + ".deviceAuthorization",
|
|
633
|
-
expected: "(OpenApi.ISecurityScheme.IOAuth2.IDeviceFlow | undefined)",
|
|
634
|
-
value: input.deviceAuthorization
|
|
635
|
-
}, _errorFactory)); const _ao15 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
636
|
-
method: "typia.assert",
|
|
637
|
-
path: _path + ".authorizationUrl",
|
|
638
|
-
expected: "(string | undefined)",
|
|
639
|
-
value: input.authorizationUrl
|
|
640
|
-
}, _errorFactory)) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
641
|
-
method: "typia.assert",
|
|
642
|
-
path: _path + ".tokenUrl",
|
|
643
|
-
expected: "(string | undefined)",
|
|
644
|
-
value: input.tokenUrl
|
|
645
|
-
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
646
|
-
method: "typia.assert",
|
|
647
|
-
path: _path + ".refreshUrl",
|
|
648
|
-
expected: "(string | undefined)",
|
|
649
|
-
value: input.refreshUrl
|
|
650
|
-
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
651
|
-
method: "typia.assert",
|
|
652
|
-
path: _path + ".scopes",
|
|
653
|
-
expected: "(Record<string, string> | undefined)",
|
|
654
|
-
value: input.scopes
|
|
655
|
-
}, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
656
|
-
method: "typia.assert",
|
|
657
|
-
path: _path + ".scopes",
|
|
658
|
-
expected: "(Record<string, string> | undefined)",
|
|
659
|
-
value: input.scopes
|
|
660
|
-
}, _errorFactory)); const _ao16 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
661
|
-
const value = input[key];
|
|
662
|
-
if (undefined === value)
|
|
663
|
-
return true;
|
|
664
|
-
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
665
|
-
method: "typia.assert",
|
|
666
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
667
|
-
expected: "string",
|
|
668
|
-
value: value
|
|
669
|
-
}, _errorFactory);
|
|
670
|
-
}); const _ao17 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
671
|
-
method: "typia.assert",
|
|
672
|
-
path: _path + ".authorizationUrl",
|
|
673
|
-
expected: "(string | undefined)",
|
|
674
|
-
value: input.authorizationUrl
|
|
675
|
-
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
676
|
-
method: "typia.assert",
|
|
677
|
-
path: _path + ".refreshUrl",
|
|
678
|
-
expected: "(string | undefined)",
|
|
679
|
-
value: input.refreshUrl
|
|
680
|
-
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
681
|
-
method: "typia.assert",
|
|
682
|
-
path: _path + ".scopes",
|
|
683
|
-
expected: "(Record<string, string> | undefined)",
|
|
684
|
-
value: input.scopes
|
|
685
|
-
}, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
686
|
-
method: "typia.assert",
|
|
687
|
-
path: _path + ".scopes",
|
|
688
|
-
expected: "(Record<string, string> | undefined)",
|
|
689
|
-
value: input.scopes
|
|
690
|
-
}, _errorFactory)); const _ao18 = (input, _path, _exceptionable = true) => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
691
|
-
method: "typia.assert",
|
|
692
|
-
path: _path + ".tokenUrl",
|
|
693
|
-
expected: "(string | undefined)",
|
|
694
|
-
value: input.tokenUrl
|
|
695
|
-
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
696
|
-
method: "typia.assert",
|
|
697
|
-
path: _path + ".refreshUrl",
|
|
698
|
-
expected: "(string | undefined)",
|
|
699
|
-
value: input.refreshUrl
|
|
700
|
-
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
701
|
-
method: "typia.assert",
|
|
702
|
-
path: _path + ".scopes",
|
|
703
|
-
expected: "(Record<string, string> | undefined)",
|
|
704
|
-
value: input.scopes
|
|
705
|
-
}, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
706
|
-
method: "typia.assert",
|
|
707
|
-
path: _path + ".scopes",
|
|
708
|
-
expected: "(Record<string, string> | undefined)",
|
|
709
|
-
value: input.scopes
|
|
710
|
-
}, _errorFactory)); const _ao19 = (input, _path, _exceptionable = true) => ("string" === typeof input.deviceAuthorizationUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
711
|
-
method: "typia.assert",
|
|
712
|
-
path: _path + ".deviceAuthorizationUrl",
|
|
713
|
-
expected: "string",
|
|
714
|
-
value: input.deviceAuthorizationUrl
|
|
715
|
-
}, _errorFactory)) && ("string" === typeof input.tokenUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
716
|
-
method: "typia.assert",
|
|
717
|
-
path: _path + ".tokenUrl",
|
|
718
|
-
expected: "string",
|
|
719
|
-
value: input.tokenUrl
|
|
720
|
-
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
721
|
-
method: "typia.assert",
|
|
722
|
-
path: _path + ".refreshUrl",
|
|
723
|
-
expected: "(string | undefined)",
|
|
724
|
-
value: input.refreshUrl
|
|
725
|
-
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
726
|
-
method: "typia.assert",
|
|
727
|
-
path: _path + ".scopes",
|
|
728
|
-
expected: "(Record<string, string> | undefined)",
|
|
729
|
-
value: input.scopes
|
|
730
|
-
}, _errorFactory)) && _ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
731
|
-
method: "typia.assert",
|
|
732
|
-
path: _path + ".scopes",
|
|
733
|
-
expected: "(Record<string, string> | undefined)",
|
|
734
|
-
value: input.scopes
|
|
735
|
-
}, _errorFactory)); const _ao20 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
736
|
-
method: "typia.assert",
|
|
737
|
-
path: _path + ".type",
|
|
738
|
-
expected: "\"openIdConnect\"",
|
|
739
|
-
value: input.type
|
|
740
|
-
}, _errorFactory)) && ("string" === typeof input.openIdConnectUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
741
|
-
method: "typia.assert",
|
|
742
|
-
path: _path + ".openIdConnectUrl",
|
|
743
|
-
expected: "string",
|
|
744
|
-
value: input.openIdConnectUrl
|
|
745
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
746
|
-
method: "typia.assert",
|
|
747
|
-
path: _path + ".description",
|
|
748
|
-
expected: "(string | undefined)",
|
|
749
|
-
value: input.description
|
|
750
|
-
}, _errorFactory)); const _ao21 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
751
|
-
method: "typia.assert",
|
|
752
|
-
path: _path + ".name",
|
|
753
|
-
expected: "string",
|
|
754
|
-
value: input.name
|
|
755
|
-
}, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
756
|
-
method: "typia.assert",
|
|
757
|
-
path: _path + ".summary",
|
|
758
|
-
expected: "(string | undefined)",
|
|
759
|
-
value: input.summary
|
|
760
|
-
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
761
|
-
method: "typia.assert",
|
|
762
|
-
path: _path + ".description",
|
|
763
|
-
expected: "(string | undefined)",
|
|
764
|
-
value: input.description
|
|
765
|
-
}, _errorFactory)) && (undefined === input.parent || "string" === typeof input.parent || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
766
|
-
method: "typia.assert",
|
|
767
|
-
path: _path + ".parent",
|
|
768
|
-
expected: "(string | undefined)",
|
|
769
|
-
value: input.parent
|
|
770
|
-
}, _errorFactory)) && (undefined === input.kind || "string" === typeof input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
771
|
-
method: "typia.assert",
|
|
772
|
-
path: _path + ".kind",
|
|
773
|
-
expected: "(string | undefined)",
|
|
774
|
-
value: input.kind
|
|
775
|
-
}, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
776
|
-
if ("apiKey" === input.type)
|
|
777
|
-
return _ao10(input, _path, true && _exceptionable);
|
|
778
|
-
else if ("basic" === input.scheme)
|
|
779
|
-
return _ao11(input, _path, true && _exceptionable);
|
|
780
|
-
else if ("bearer" === input.scheme)
|
|
781
|
-
return _ao12(input, _path, true && _exceptionable);
|
|
782
|
-
else if ("oauth2" === input.type)
|
|
783
|
-
return _ao13(input, _path, true && _exceptionable);
|
|
784
|
-
else if ("openIdConnect" === input.type)
|
|
785
|
-
return _ao20(input, _path, true && _exceptionable);
|
|
786
|
-
else
|
|
787
|
-
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
788
|
-
method: "typia.assert",
|
|
789
|
-
path: _path,
|
|
790
|
-
expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
|
|
791
|
-
value: input
|
|
792
|
-
}, _errorFactory);
|
|
793
|
-
})(); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
794
|
-
if (false === __is(input)) {
|
|
795
|
-
_errorFactory = errorFactory;
|
|
796
|
-
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
797
|
-
method: "typia.assert",
|
|
798
|
-
path: _path + "",
|
|
799
|
-
expected: "Array<INestiaConfig>",
|
|
800
|
-
value: input
|
|
801
|
-
}, _errorFactory)) && input.every((elem, _index8) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
802
|
-
method: "typia.assert",
|
|
803
|
-
path: _path + "[" + _index8 + "]",
|
|
804
|
-
expected: "INestiaConfig",
|
|
805
|
-
value: elem
|
|
806
|
-
}, _errorFactory)) && _ao0(elem, _path + "[" + _index8 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
807
|
-
method: "typia.assert",
|
|
808
|
-
path: _path + "[" + _index8 + "]",
|
|
809
|
-
expected: "INestiaConfig",
|
|
810
|
-
value: elem
|
|
811
|
-
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
812
|
-
method: "typia.assert",
|
|
813
|
-
path: _path + "",
|
|
814
|
-
expected: "Array<INestiaConfig>",
|
|
815
|
-
value: input
|
|
816
|
-
}, _errorFactory))(input, "$input", true);
|
|
817
|
-
}
|
|
818
|
-
return input;
|
|
819
|
-
}; })()(configurations);
|
|
75
|
+
TtscExecutor_1.TtscExecutor.run({
|
|
76
|
+
cwd: projectRoot,
|
|
77
|
+
project: wrapperFile,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
const stderr = readChildOutput(error, "stderr");
|
|
82
|
+
const stdout = readChildOutput(error, "stdout");
|
|
83
|
+
const detail = stderr || stdout;
|
|
84
|
+
const cause = error instanceof Error ? error : new Error(String(error));
|
|
85
|
+
const status = (_b = cause.status) !== null && _b !== void 0 ? _b : cause.code;
|
|
86
|
+
throw new Error(detail
|
|
87
|
+
? `failed to compile "${props.file}" through ttsc:\n${detail}`
|
|
88
|
+
: `failed to compile "${props.file}" through ttsc (exit code ${status !== null && status !== void 0 ? status : "unknown"}). Run \`npx ttsc -p ${projectFile}\` to see the underlying diagnostics.`, { cause });
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
fs_1.default.rmSync(wrapperRoot, { force: true, recursive: true });
|
|
92
|
+
}
|
|
93
|
+
const configKey = emittedJavaScriptKey(projectRoot, configFile);
|
|
94
|
+
const next = path_1.default.join(outputRoot, configKey);
|
|
95
|
+
if (fs_1.default.existsSync(next) === false)
|
|
96
|
+
throw new Error(`failed to materialize "${props.file}" through ttsc native transform.`);
|
|
97
|
+
return next;
|
|
98
|
+
});
|
|
99
|
+
const ensureMaterializedRoot = (projectRoot) => {
|
|
100
|
+
const root = path_1.default.join(projectRoot, "node_modules", ".nestia", "config-loader");
|
|
101
|
+
fs_1.default.mkdirSync(root, { recursive: true });
|
|
102
|
+
MATERIALIZED_ROOTS.add(root);
|
|
103
|
+
if (CLEANUP_REGISTERED === false) {
|
|
104
|
+
CLEANUP_REGISTERED = true;
|
|
105
|
+
const sweep = () => {
|
|
106
|
+
for (const location of MATERIALIZED_ROOTS)
|
|
107
|
+
fs_1.default.rmSync(location, { force: true, recursive: true });
|
|
108
|
+
};
|
|
109
|
+
process.once("exit", sweep);
|
|
110
|
+
// process.once("exit", …) does not fire on SIGINT/SIGTERM. Without
|
|
111
|
+
// these handlers a Ctrl-C during codegen leaves `run-*` and
|
|
112
|
+
// `tsconfig-*` mkdtempSync directories behind under
|
|
113
|
+
// node_modules/.nestia/config-loader/ until a subsequent clean exit.
|
|
114
|
+
// The module-level CLEANUP_REGISTERED flag above guards against
|
|
115
|
+
// re-entrancy within this module; we deliberately do NOT gate on
|
|
116
|
+
// `process.listenerCount(signal) > 0` because the parallel sweep in
|
|
117
|
+
// `ConfigAnalyzer.ensureRuntimeCleanup` (or any user-app SIGINT
|
|
118
|
+
// handler) could register first, and that gate would skip our
|
|
119
|
+
// registration — leaving MATERIALIZED_ROOTS unswept on Ctrl-C.
|
|
120
|
+
// Windows note: `process.kill(pid, "SIGINT")` calls TerminateProcess
|
|
121
|
+
// rather than re-raising; whichever module registers FIRST runs its
|
|
122
|
+
// sweep, the second is skipped, RUNTIME/MATERIALIZED cleanup is
|
|
123
|
+
// best-effort on Windows. SIGHUP is a no-op for most common code
|
|
124
|
+
// paths on Windows (Node fires it on console-close and exits within
|
|
125
|
+
// seconds).
|
|
126
|
+
const onSignal = (signal) => {
|
|
127
|
+
sweep();
|
|
128
|
+
process.kill(process.pid, signal);
|
|
129
|
+
};
|
|
130
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
131
|
+
process.once(signal, onSignal);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return root;
|
|
135
|
+
};
|
|
136
|
+
const emittedJavaScriptKey = (projectRoot, file) => {
|
|
137
|
+
const relative = path_1.default.relative(projectRoot, file);
|
|
138
|
+
const extension = path_1.default.extname(relative).toLowerCase();
|
|
139
|
+
const emitted = extension === ".mts" ? ".mjs" : extension === ".cts" ? ".cjs" : ".js";
|
|
140
|
+
return path_1.default
|
|
141
|
+
.join(path_1.default.dirname(relative), `${path_1.default.basename(relative, extension)}${emitted}`)
|
|
142
|
+
.split(path_1.default.sep)
|
|
143
|
+
.join(path_1.default.posix.sep);
|
|
144
|
+
};
|
|
145
|
+
const nodeAmbientCompilerOptions = (projectRoot, compilerOptions) => {
|
|
146
|
+
const typeRoots = uniqueStrings([
|
|
147
|
+
...asStringArray(compilerOptions.typeRoots),
|
|
148
|
+
...resolveNodeTypeRoots(projectRoot),
|
|
149
|
+
]);
|
|
150
|
+
const types = uniqueStrings([
|
|
151
|
+
"node",
|
|
152
|
+
...asStringArray(compilerOptions.types).filter((value) => value !== "*"),
|
|
153
|
+
]);
|
|
154
|
+
return Object.assign(Object.assign({}, (typeRoots.length !== 0 ? { typeRoots } : {})), { types });
|
|
155
|
+
};
|
|
156
|
+
const resolveNodeTypeRoots = (projectRoot) => {
|
|
157
|
+
const roots = [];
|
|
158
|
+
for (const base of [projectRoot, process.cwd(), __dirname])
|
|
159
|
+
try {
|
|
160
|
+
const location = require.resolve("@types/node/package.json", {
|
|
161
|
+
paths: [base],
|
|
162
|
+
});
|
|
163
|
+
roots.push(path_1.default.dirname(path_1.default.dirname(location)));
|
|
164
|
+
}
|
|
165
|
+
catch (_a) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
return roots;
|
|
169
|
+
};
|
|
170
|
+
const asStringArray = (input) => Array.isArray(input)
|
|
171
|
+
? input.filter((elem) => typeof elem === "string")
|
|
172
|
+
: [];
|
|
173
|
+
const uniqueStrings = (input) => [...new Set(input)];
|
|
174
|
+
const materializePlugins = (input) => {
|
|
175
|
+
const plugins = Array.isArray(input)
|
|
176
|
+
? input
|
|
177
|
+
.filter((p) => typeof p === "object" && p !== null)
|
|
178
|
+
.map((p) => (Object.assign({}, p)))
|
|
179
|
+
: [];
|
|
180
|
+
const typia = plugins.find((p) => isTransform(p, "typia"));
|
|
181
|
+
const sdk = plugins.find((p) => isTransform(p, "@nestia/sdk"));
|
|
182
|
+
const core = plugins.find((p) => isTransform(p, "@nestia/core"));
|
|
183
|
+
return [
|
|
184
|
+
Object.assign(Object.assign({}, (typia !== null && typia !== void 0 ? typia : {})), { transform: "typia/lib/transform", enabled: false }),
|
|
185
|
+
normalizePlugin(Object.assign(Object.assign({}, (sdk !== null && sdk !== void 0 ? sdk : {})), { transform: "@nestia/sdk/lib/transform" })),
|
|
186
|
+
normalizePlugin(Object.assign(Object.assign({}, (core !== null && core !== void 0 ? core : {})), { transform: "@nestia/core/native/transform.cjs" })),
|
|
187
|
+
];
|
|
188
|
+
};
|
|
189
|
+
const normalizePlugin = (plugin) => {
|
|
190
|
+
const output = Object.assign({}, plugin);
|
|
191
|
+
if (output.enabled === false)
|
|
192
|
+
delete output.enabled;
|
|
193
|
+
return output;
|
|
194
|
+
};
|
|
195
|
+
const isTransform = (plugin, name) => typeof plugin.transform === "string" && plugin.transform.includes(name);
|
|
196
|
+
const findConfigFile = (cwd, project) => {
|
|
197
|
+
const candidate = path_1.default.isAbsolute(project)
|
|
198
|
+
? project
|
|
199
|
+
: path_1.default.resolve(cwd, project);
|
|
200
|
+
if (fs_1.default.existsSync(candidate))
|
|
201
|
+
return candidate;
|
|
202
|
+
if (path_1.default.isAbsolute(project) || project.includes(path_1.default.sep))
|
|
203
|
+
return undefined;
|
|
204
|
+
let current = path_1.default.resolve(cwd);
|
|
205
|
+
while (true) {
|
|
206
|
+
const next = path_1.default.join(current, project);
|
|
207
|
+
if (fs_1.default.existsSync(next))
|
|
208
|
+
return next;
|
|
209
|
+
const parent = path_1.default.dirname(current);
|
|
210
|
+
if (parent === current)
|
|
211
|
+
return undefined;
|
|
212
|
+
current = parent;
|
|
820
213
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
214
|
+
};
|
|
215
|
+
const extractConfiguration = (file, loaded) => {
|
|
216
|
+
const candidates = [];
|
|
217
|
+
const collect = (value) => {
|
|
218
|
+
if (isObject(value)) {
|
|
219
|
+
candidates.push(value.default);
|
|
220
|
+
candidates.push(value.NESTIA_CONFIG);
|
|
221
|
+
if (isObject(value.default)) {
|
|
222
|
+
candidates.push(value.default.default);
|
|
223
|
+
candidates.push(value.default.NESTIA_CONFIG);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
candidates.push(value);
|
|
227
|
+
};
|
|
228
|
+
collect(loaded);
|
|
229
|
+
const matched = candidates.find((value) => Array.isArray(value) ||
|
|
230
|
+
(isObject(value) && Object.hasOwn(value, "input")));
|
|
231
|
+
if (matched === undefined)
|
|
232
|
+
throw new Error(`invalid "${file}" data: configuration must be exported.`);
|
|
233
|
+
return matched;
|
|
234
|
+
};
|
|
235
|
+
const loadMaterializedModule = (file) => __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
if (file.endsWith(".mjs")) {
|
|
237
|
+
const dynamicImport = new Function("specifier", "return import(specifier)");
|
|
238
|
+
return dynamicImport((0, url_1.pathToFileURL)(file).href);
|
|
825
239
|
}
|
|
240
|
+
return require(file);
|
|
826
241
|
});
|
|
242
|
+
const assertPlugins = (file, input) => {
|
|
243
|
+
if (Array.isArray(input) &&
|
|
244
|
+
input.every((elem) => typeof elem === "object" && elem !== null))
|
|
245
|
+
return input;
|
|
246
|
+
throw new Error(`invalid "${file}" data: compilerOptions.plugins must be an array.`);
|
|
247
|
+
};
|
|
248
|
+
const assertConfigurations = (file, input) => {
|
|
249
|
+
input.forEach((config, index) => assertConfig(file, config, index));
|
|
250
|
+
return input;
|
|
251
|
+
};
|
|
252
|
+
const assertConfig = (file, input, index) => {
|
|
253
|
+
if (isObject(input) === false)
|
|
254
|
+
throw new Error(`invalid "${file}" data: configuration #${index} must be an object.`);
|
|
255
|
+
const config = input;
|
|
256
|
+
if (isInput(config.input) === false)
|
|
257
|
+
throw new Error(`invalid "${file}" data: configuration #${index}.input is invalid.`);
|
|
258
|
+
for (const [key, value] of [
|
|
259
|
+
["output", config.output],
|
|
260
|
+
["distribute", config.distribute],
|
|
261
|
+
["e2e", config.e2e],
|
|
262
|
+
])
|
|
263
|
+
if (value !== undefined && typeof value !== "string")
|
|
264
|
+
throw new Error(`invalid "${file}" data: configuration #${index}.${key} must be a string.`);
|
|
265
|
+
for (const [key, value] of [
|
|
266
|
+
["keyword", config.keyword],
|
|
267
|
+
["simulate", config.simulate],
|
|
268
|
+
["propagate", config.propagate],
|
|
269
|
+
["clone", config.clone],
|
|
270
|
+
["primitive", config.primitive],
|
|
271
|
+
["assert", config.assert],
|
|
272
|
+
["json", config.json],
|
|
273
|
+
])
|
|
274
|
+
if (value !== undefined && typeof value !== "boolean")
|
|
275
|
+
throw new Error(`invalid "${file}" data: configuration #${index}.${key} must be a boolean.`);
|
|
276
|
+
if (config.swagger !== undefined && isSwagger(config.swagger) === false)
|
|
277
|
+
throw new Error(`invalid "${file}" data: configuration #${index}.swagger is invalid.`);
|
|
278
|
+
};
|
|
279
|
+
const isInput = (input) => {
|
|
280
|
+
if (typeof input === "string" ||
|
|
281
|
+
typeof input === "function" ||
|
|
282
|
+
isStringArray(input))
|
|
283
|
+
return true;
|
|
284
|
+
if (isObject(input) === false)
|
|
285
|
+
return false;
|
|
286
|
+
return (isStringArray(input.include) &&
|
|
287
|
+
(input.exclude === undefined || isStringArray(input.exclude)));
|
|
288
|
+
};
|
|
289
|
+
const isSwagger = (input) => {
|
|
290
|
+
if (isObject(input) === false)
|
|
291
|
+
return false;
|
|
292
|
+
return (typeof input.output === "string" &&
|
|
293
|
+
(input.openapi === undefined ||
|
|
294
|
+
["2.0", "3.0", "3.1", "3.2"].includes(input.openapi)) &&
|
|
295
|
+
(input.beautify === undefined ||
|
|
296
|
+
typeof input.beautify === "boolean" ||
|
|
297
|
+
typeof input.beautify === "number") &&
|
|
298
|
+
(input.additional === undefined ||
|
|
299
|
+
typeof input.additional === "boolean") &&
|
|
300
|
+
(input.decompose === undefined || typeof input.decompose === "boolean") &&
|
|
301
|
+
(input.operationId === undefined ||
|
|
302
|
+
typeof input.operationId === "function"));
|
|
303
|
+
};
|
|
304
|
+
const isObject = (input) => typeof input === "object" &&
|
|
305
|
+
input !== null &&
|
|
306
|
+
Array.isArray(input) === false;
|
|
307
|
+
const isStringArray = (input) => Array.isArray(input) && input.every((elem) => typeof elem === "string");
|
|
308
|
+
const readChildOutput = (error, key) => {
|
|
309
|
+
if (!error || typeof error !== "object" || !(key in error))
|
|
310
|
+
return "";
|
|
311
|
+
const value = error[key];
|
|
312
|
+
if (value === null || value === undefined)
|
|
313
|
+
return "";
|
|
314
|
+
if (typeof value === "string")
|
|
315
|
+
return value.trim();
|
|
316
|
+
if (Buffer.isBuffer(value))
|
|
317
|
+
return value.toString("utf8").trim();
|
|
318
|
+
return "";
|
|
319
|
+
};
|
|
827
320
|
})(NestiaConfigLoader || (exports.NestiaConfigLoader = NestiaConfigLoader = {}));
|
|
828
321
|
//# sourceMappingURL=NestiaConfigLoader.js.map
|