@nestia/sdk 2.0.0-dev.20230991 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/bundle/api/utils/NestiaSimulator.ts +5 -14
- package/lib/INestiaConfig.d.ts +60 -47
- package/lib/NestiaSdkApplication.d.ts +6 -5
- package/lib/NestiaSdkApplication.js +30 -87
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/analyses/ControllerAnalyzer.js +8 -5
- package/lib/analyses/ControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectAnalyzer.js +9 -1
- package/lib/analyses/ReflectAnalyzer.js.map +1 -1
- package/lib/executable/internal/NestiaConfigLoader.d.ts +7 -0
- package/lib/executable/internal/NestiaConfigLoader.js +582 -0
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -0
- package/lib/executable/internal/NestiaProjectGetter.d.ts +3 -0
- package/lib/executable/internal/NestiaProjectGetter.js +28 -0
- package/lib/executable/internal/NestiaProjectGetter.js.map +1 -0
- package/lib/executable/internal/NestiaSdkCommand.d.ts +3 -3
- package/lib/executable/internal/NestiaSdkCommand.js +13 -104
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/internal/{nestia.config.getter.js → nestia.project.getter.js} +3 -3
- package/lib/executable/internal/nestia.project.getter.js.map +1 -0
- package/lib/executable/sdk.js +3 -3
- package/lib/executable/sdk.js.map +1 -1
- package/lib/generates/SdkGenerator.d.ts +2 -1
- package/lib/generates/SdkGenerator.js +7 -3
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +26 -9
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +21 -15
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/{DistributionComposer.d.ts → SdkDistributionComposer.d.ts} +1 -1
- package/lib/generates/internal/{DistributionComposer.js → SdkDistributionComposer.js} +8 -12
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -0
- package/lib/generates/internal/SdkDtoGenerator.d.ts +9 -0
- package/lib/generates/internal/SdkDtoGenerator.js +264 -0
- package/lib/generates/internal/SdkDtoGenerator.js.map +1 -0
- package/lib/generates/internal/SdkFileProgrammer.js +8 -7
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkFunctionProgrammer.js +32 -22
- package/lib/generates/internal/SdkFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkImportWizard.d.ts +2 -0
- package/lib/generates/internal/SdkImportWizard.js +10 -0
- package/lib/generates/internal/SdkImportWizard.js.map +1 -1
- package/lib/generates/internal/SdkSimulationProgrammer.js +61 -25
- package/lib/generates/internal/SdkSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeDefiner.d.ts +11 -0
- package/lib/generates/internal/SdkTypeDefiner.js +82 -0
- package/lib/generates/internal/SdkTypeDefiner.js.map +1 -0
- package/lib/generates/internal/SwaggerSchemaGenerator.d.ts +1 -1
- package/lib/generates/internal/SwaggerSchemaGenerator.js +67 -75
- package/lib/generates/internal/SwaggerSchemaGenerator.js.map +1 -1
- package/lib/generates/internal/SwaggerSchemaValidator.js +0 -8
- package/lib/generates/internal/SwaggerSchemaValidator.js.map +1 -1
- package/lib/structures/IController.d.ts +2 -0
- package/lib/structures/IRoute.d.ts +9 -2
- package/lib/utils/ImportDictionary.d.ts +1 -2
- package/lib/utils/ImportDictionary.js +28 -24
- package/lib/utils/ImportDictionary.js.map +1 -1
- package/package.json +8 -8
- package/src/INestiaConfig.ts +65 -50
- package/src/NestiaSdkApplication.ts +39 -84
- package/src/analyses/ControllerAnalyzer.ts +10 -8
- package/src/analyses/ReflectAnalyzer.ts +8 -0
- package/src/executable/internal/NestiaConfigLoader.ts +82 -0
- package/src/executable/internal/NestiaProjectGetter.ts +11 -0
- package/src/executable/internal/NestiaSdkCommand.ts +23 -146
- package/src/executable/internal/{nestia.config.getter.ts → nestia.project.getter.ts} +2 -2
- package/src/executable/sdk.ts +3 -3
- package/src/generates/SdkGenerator.ts +9 -2
- package/src/generates/SwaggerGenerator.ts +37 -9
- package/src/generates/internal/E2eFileProgrammer.ts +33 -20
- package/src/generates/internal/{DistributionComposer.ts → SdkDistributionComposer.ts} +3 -6
- package/src/generates/internal/SdkDtoGenerator.ts +384 -0
- package/src/generates/internal/SdkFileProgrammer.ts +8 -7
- package/src/generates/internal/SdkFunctionProgrammer.ts +71 -37
- package/src/generates/internal/SdkImportWizard.ts +14 -0
- package/src/generates/internal/SdkSimulationProgrammer.ts +71 -37
- package/src/generates/internal/SdkTypeDefiner.ts +120 -0
- package/src/generates/internal/SwaggerSchemaGenerator.ts +94 -92
- package/src/generates/internal/SwaggerSchemaValidator.ts +0 -12
- package/src/structures/IController.ts +2 -0
- package/src/structures/IRoute.ts +10 -2
- package/src/utils/ImportDictionary.ts +29 -26
- package/lib/executable/internal/NestiaConfigCompilerOptions.d.ts +0 -12
- package/lib/executable/internal/NestiaConfigCompilerOptions.js +0 -18
- package/lib/executable/internal/NestiaConfigCompilerOptions.js.map +0 -1
- package/lib/executable/internal/NestiaSdkConfig.d.ts +0 -4
- package/lib/executable/internal/NestiaSdkConfig.js +0 -1019
- package/lib/executable/internal/NestiaSdkConfig.js.map +0 -1
- package/lib/executable/internal/nestia.config.getter.js.map +0 -1
- package/lib/generates/internal/DistributionComposer.js.map +0 -1
- package/src/executable/internal/NestiaConfigCompilerOptions.ts +0 -19
- package/src/executable/internal/NestiaSdkConfig.ts +0 -36
- /package/lib/executable/internal/{nestia.config.getter.d.ts → nestia.project.getter.d.ts} +0 -0
|
@@ -0,0 +1,582 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
35
|
+
var t = {};
|
|
36
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37
|
+
t[p] = s[p];
|
|
38
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
39
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
41
|
+
t[p[i]] = s[p[i]];
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
45
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
+
};
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.NestiaConfigLoader = void 0;
|
|
50
|
+
const fs_1 = __importDefault(require("fs"));
|
|
51
|
+
const path_1 = __importDefault(require("path"));
|
|
52
|
+
const WorkerConnector_1 = require("tgrid/protocols/workers/WorkerConnector");
|
|
53
|
+
const ts_node_1 = require("ts-node");
|
|
54
|
+
const tsconfck_1 = require("tsconfck");
|
|
55
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
56
|
+
const typia_1 = __importDefault(require("typia"));
|
|
57
|
+
var NestiaConfigLoader;
|
|
58
|
+
(function (NestiaConfigLoader) {
|
|
59
|
+
NestiaConfigLoader.compilerOptions = (project) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const configFileName = typescript_1.default.findConfigFile(process.cwd(), typescript_1.default.sys.fileExists, project);
|
|
61
|
+
if (!configFileName)
|
|
62
|
+
throw new Error(`unable to find "tsconfig.json" file.`);
|
|
63
|
+
const { tsconfig } = yield (0, tsconfck_1.parseNative)(configFileName);
|
|
64
|
+
const configFileText = JSON.stringify(tsconfig);
|
|
65
|
+
const { config } = typescript_1.default.parseConfigFileTextToJson(configFileName, configFileText);
|
|
66
|
+
const configParseResult = typescript_1.default.parseJsonConfigFileContent(config, typescript_1.default.sys, path_1.default.dirname(configFileName));
|
|
67
|
+
const _a = configParseResult.raw.compilerOptions, { moduleResolution } = _a, result = __rest(_a, ["moduleResolution"]);
|
|
68
|
+
return result;
|
|
69
|
+
});
|
|
70
|
+
NestiaConfigLoader.config = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
if (fs_1.default.existsSync(path_1.default.resolve("nestia.config.ts")) === false)
|
|
72
|
+
throw new Error(`unable to find "nestia.config.ts" file.`);
|
|
73
|
+
(0, ts_node_1.register)({
|
|
74
|
+
emit: false,
|
|
75
|
+
compilerOptions: options,
|
|
76
|
+
require: options.baseUrl ? ["tsconfig-paths/register"] : undefined,
|
|
77
|
+
});
|
|
78
|
+
const loaded = yield Promise.resolve(`${path_1.default.resolve("nestia.config.ts")}`).then(s => __importStar(require(s)));
|
|
79
|
+
const config = typeof (loaded === null || loaded === void 0 ? void 0 : loaded.default) === "object" && loaded.default !== null
|
|
80
|
+
? loaded.default
|
|
81
|
+
: loaded;
|
|
82
|
+
try {
|
|
83
|
+
return (input => {
|
|
84
|
+
const __is = input => {
|
|
85
|
+
const $io0 = input => (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && $io1(input.swagger)) && (null !== input.input && undefined !== input.input && ("string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && $io17(input.input)))) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.project || "string" === typeof input.project) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json);
|
|
86
|
+
const $io1 = input => "string" === typeof input.output && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && $io2(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io5(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && $io6(input.security)) && (undefined === input.decompose || "boolean" === typeof input.decompose);
|
|
87
|
+
const $io2 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.termsOfService)) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io3(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io4(input.license)) && (undefined === input.version || "string" === typeof input.version);
|
|
88
|
+
const $io3 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url)) && (undefined === input.email || "string" === typeof input.email && /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(input.email));
|
|
89
|
+
const $io4 = input => "string" === typeof input.name && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url));
|
|
90
|
+
const $io5 = input => "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) && (undefined === input.description || "string" === typeof input.description);
|
|
91
|
+
const $io6 = input => Object.keys(input).every(key => {
|
|
92
|
+
const value = input[key];
|
|
93
|
+
if (undefined === value)
|
|
94
|
+
return true;
|
|
95
|
+
if (RegExp(/(.*)/).test(key))
|
|
96
|
+
return "object" === typeof value && null !== value && $iu0(value);
|
|
97
|
+
return true;
|
|
98
|
+
});
|
|
99
|
+
const $io7 = input => "http" === input.type && "basic" === input.scheme;
|
|
100
|
+
const $io8 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat);
|
|
101
|
+
const $io9 = input => "apiKey" === input.type && (undefined === input["in"] || "header" === input["in"] || "query" === input["in"] || "cookie" === input["in"]) && (undefined === input.name || "string" === typeof input.name);
|
|
102
|
+
const $io10 = input => "openIdConnect" === input.type && "string" === typeof input.openIdConnectUrl;
|
|
103
|
+
const $io11 = input => "oauth2" === input.type && ("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) && $io12(input.flows)) && (undefined === input.description || "string" === typeof input.description);
|
|
104
|
+
const $io12 = input => (undefined === input.authorizationCode || "object" === typeof input.authorizationCode && null !== input.authorizationCode && $io13(input.authorizationCode)) && (undefined === input.implicit || "object" === typeof input.implicit && null !== input.implicit && $io15(input.implicit)) && (undefined === input.password || "object" === typeof input.password && null !== input.password && $io16(input.password)) && (undefined === input.clientCredentials || "object" === typeof input.clientCredentials && null !== input.clientCredentials && $io16(input.clientCredentials));
|
|
105
|
+
const $io13 = input => "string" === typeof input.authorizationUrl && "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));
|
|
106
|
+
const $io14 = input => Object.keys(input).every(key => {
|
|
107
|
+
const value = input[key];
|
|
108
|
+
if (undefined === value)
|
|
109
|
+
return true;
|
|
110
|
+
if (RegExp(/(.*)/).test(key))
|
|
111
|
+
return "string" === typeof value;
|
|
112
|
+
return true;
|
|
113
|
+
});
|
|
114
|
+
const $io15 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io14(input.scopes));
|
|
115
|
+
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));
|
|
116
|
+
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));
|
|
117
|
+
const $iu0 = input => (() => {
|
|
118
|
+
if ("basic" === input.scheme)
|
|
119
|
+
return $io7(input);
|
|
120
|
+
else if ("bearer" === input.scheme)
|
|
121
|
+
return $io8(input);
|
|
122
|
+
else if ("apiKey" === input.type)
|
|
123
|
+
return $io9(input);
|
|
124
|
+
else if ("openIdConnect" === input.type)
|
|
125
|
+
return $io10(input);
|
|
126
|
+
else if ("oauth2" === input.type)
|
|
127
|
+
return $io11(input);
|
|
128
|
+
else
|
|
129
|
+
return false;
|
|
130
|
+
})();
|
|
131
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
132
|
+
};
|
|
133
|
+
if (false === __is(input))
|
|
134
|
+
((input, _path, _exceptionable = true) => {
|
|
135
|
+
const $guard = typia_1.default.assert.guard;
|
|
136
|
+
const $join = typia_1.default.assert.join;
|
|
137
|
+
const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || $guard(_exceptionable, {
|
|
138
|
+
path: _path + ".swagger",
|
|
139
|
+
expected: "(INestiaConfig.ISwaggerConfig | undefined)",
|
|
140
|
+
value: input.swagger
|
|
141
|
+
})) && $ao1(input.swagger, _path + ".swagger", true && _exceptionable) || $guard(_exceptionable, {
|
|
142
|
+
path: _path + ".swagger",
|
|
143
|
+
expected: "(INestiaConfig.ISwaggerConfig | undefined)",
|
|
144
|
+
value: input.swagger
|
|
145
|
+
})) && ((null !== input.input || $guard(_exceptionable, {
|
|
146
|
+
path: _path + ".input",
|
|
147
|
+
expected: "(Array<string> | INestiaConfig.IInput | string)",
|
|
148
|
+
value: input.input
|
|
149
|
+
})) && (undefined !== input.input || $guard(_exceptionable, {
|
|
150
|
+
path: _path + ".input",
|
|
151
|
+
expected: "(Array<string> | INestiaConfig.IInput | string)",
|
|
152
|
+
value: input.input
|
|
153
|
+
})) && ("string" === typeof input.input || (Array.isArray(input.input) && input.input.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
154
|
+
path: _path + ".input[" + _index1 + "]",
|
|
155
|
+
expected: "string",
|
|
156
|
+
value: elem
|
|
157
|
+
})) || "object" === typeof input.input && null !== input.input && $ao17(input.input, _path + ".input", true && _exceptionable) || $guard(_exceptionable, {
|
|
158
|
+
path: _path + ".input",
|
|
159
|
+
expected: "(Array<string> | INestiaConfig.IInput | string)",
|
|
160
|
+
value: input.input
|
|
161
|
+
})) || $guard(_exceptionable, {
|
|
162
|
+
path: _path + ".input",
|
|
163
|
+
expected: "(Array<string> | INestiaConfig.IInput | string)",
|
|
164
|
+
value: input.input
|
|
165
|
+
}))) && (undefined === input.output || "string" === typeof input.output || $guard(_exceptionable, {
|
|
166
|
+
path: _path + ".output",
|
|
167
|
+
expected: "(string | undefined)",
|
|
168
|
+
value: input.output
|
|
169
|
+
})) && (undefined === input.distribute || "string" === typeof input.distribute || $guard(_exceptionable, {
|
|
170
|
+
path: _path + ".distribute",
|
|
171
|
+
expected: "(string | undefined)",
|
|
172
|
+
value: input.distribute
|
|
173
|
+
})) && (undefined === input.simulate || "boolean" === typeof input.simulate || $guard(_exceptionable, {
|
|
174
|
+
path: _path + ".simulate",
|
|
175
|
+
expected: "(boolean | undefined)",
|
|
176
|
+
value: input.simulate
|
|
177
|
+
})) && (undefined === input.e2e || "string" === typeof input.e2e || $guard(_exceptionable, {
|
|
178
|
+
path: _path + ".e2e",
|
|
179
|
+
expected: "(string | undefined)",
|
|
180
|
+
value: input.e2e
|
|
181
|
+
})) && (undefined === input.propagate || "boolean" === typeof input.propagate || $guard(_exceptionable, {
|
|
182
|
+
path: _path + ".propagate",
|
|
183
|
+
expected: "(boolean | undefined)",
|
|
184
|
+
value: input.propagate
|
|
185
|
+
})) && (undefined === input.clone || "boolean" === typeof input.clone || $guard(_exceptionable, {
|
|
186
|
+
path: _path + ".clone",
|
|
187
|
+
expected: "(boolean | undefined)",
|
|
188
|
+
value: input.clone
|
|
189
|
+
})) && (undefined === input.primitive || "boolean" === typeof input.primitive || $guard(_exceptionable, {
|
|
190
|
+
path: _path + ".primitive",
|
|
191
|
+
expected: "(boolean | undefined)",
|
|
192
|
+
value: input.primitive
|
|
193
|
+
})) && (undefined === input.project || "string" === typeof input.project || $guard(_exceptionable, {
|
|
194
|
+
path: _path + ".project",
|
|
195
|
+
expected: "(string | undefined)",
|
|
196
|
+
value: input.project
|
|
197
|
+
})) && (undefined === input.assert || "boolean" === typeof input.assert || $guard(_exceptionable, {
|
|
198
|
+
path: _path + ".assert",
|
|
199
|
+
expected: "(boolean | undefined)",
|
|
200
|
+
value: input.assert
|
|
201
|
+
})) && (undefined === input.json || "boolean" === typeof input.json || $guard(_exceptionable, {
|
|
202
|
+
path: _path + ".json",
|
|
203
|
+
expected: "(boolean | undefined)",
|
|
204
|
+
value: input.json
|
|
205
|
+
}));
|
|
206
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || $guard(_exceptionable, {
|
|
207
|
+
path: _path + ".output",
|
|
208
|
+
expected: "string",
|
|
209
|
+
value: input.output
|
|
210
|
+
})) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || $guard(_exceptionable, {
|
|
211
|
+
path: _path + ".info",
|
|
212
|
+
expected: "(Partial<ISwaggerInfo> | undefined)",
|
|
213
|
+
value: input.info
|
|
214
|
+
})) && $ao2(input.info, _path + ".info", true && _exceptionable) || $guard(_exceptionable, {
|
|
215
|
+
path: _path + ".info",
|
|
216
|
+
expected: "(Partial<ISwaggerInfo> | undefined)",
|
|
217
|
+
value: input.info
|
|
218
|
+
})) && (undefined === input.servers || (Array.isArray(input.servers) || $guard(_exceptionable, {
|
|
219
|
+
path: _path + ".servers",
|
|
220
|
+
expected: "(Array<ISwagger.IServer> | undefined)",
|
|
221
|
+
value: input.servers
|
|
222
|
+
})) && input.servers.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
223
|
+
path: _path + ".servers[" + _index2 + "]",
|
|
224
|
+
expected: "ISwagger.IServer",
|
|
225
|
+
value: elem
|
|
226
|
+
})) && $ao5(elem, _path + ".servers[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
227
|
+
path: _path + ".servers[" + _index2 + "]",
|
|
228
|
+
expected: "ISwagger.IServer",
|
|
229
|
+
value: elem
|
|
230
|
+
})) || $guard(_exceptionable, {
|
|
231
|
+
path: _path + ".servers",
|
|
232
|
+
expected: "(Array<ISwagger.IServer> | undefined)",
|
|
233
|
+
value: input.servers
|
|
234
|
+
})) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || $guard(_exceptionable, {
|
|
235
|
+
path: _path + ".security",
|
|
236
|
+
expected: "(Record<string, ISwaggerSecurityScheme> | undefined)",
|
|
237
|
+
value: input.security
|
|
238
|
+
})) && $ao6(input.security, _path + ".security", true && _exceptionable) || $guard(_exceptionable, {
|
|
239
|
+
path: _path + ".security",
|
|
240
|
+
expected: "(Record<string, ISwaggerSecurityScheme> | undefined)",
|
|
241
|
+
value: input.security
|
|
242
|
+
})) && (undefined === input.decompose || "boolean" === typeof input.decompose || $guard(_exceptionable, {
|
|
243
|
+
path: _path + ".decompose",
|
|
244
|
+
expected: "(boolean | undefined)",
|
|
245
|
+
value: input.decompose
|
|
246
|
+
}));
|
|
247
|
+
const $ao2 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
|
|
248
|
+
path: _path + ".title",
|
|
249
|
+
expected: "(string | undefined)",
|
|
250
|
+
value: input.title
|
|
251
|
+
})) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
|
|
252
|
+
path: _path + ".description",
|
|
253
|
+
expected: "(string | undefined)",
|
|
254
|
+
value: input.description
|
|
255
|
+
})) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.termsOfService) || $guard(_exceptionable, {
|
|
256
|
+
path: _path + ".termsOfService",
|
|
257
|
+
expected: "string & Format<url>",
|
|
258
|
+
value: input.termsOfService
|
|
259
|
+
})) || $guard(_exceptionable, {
|
|
260
|
+
path: _path + ".termsOfService",
|
|
261
|
+
expected: "((string & Format<url>) | undefined)",
|
|
262
|
+
value: input.termsOfService
|
|
263
|
+
})) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || $guard(_exceptionable, {
|
|
264
|
+
path: _path + ".contact",
|
|
265
|
+
expected: "(ISwaggerInfo.IContact | undefined)",
|
|
266
|
+
value: input.contact
|
|
267
|
+
})) && $ao3(input.contact, _path + ".contact", true && _exceptionable) || $guard(_exceptionable, {
|
|
268
|
+
path: _path + ".contact",
|
|
269
|
+
expected: "(ISwaggerInfo.IContact | undefined)",
|
|
270
|
+
value: input.contact
|
|
271
|
+
})) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || $guard(_exceptionable, {
|
|
272
|
+
path: _path + ".license",
|
|
273
|
+
expected: "(ISwaggerInfo.ILicense | undefined)",
|
|
274
|
+
value: input.license
|
|
275
|
+
})) && $ao4(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
|
|
276
|
+
path: _path + ".license",
|
|
277
|
+
expected: "(ISwaggerInfo.ILicense | undefined)",
|
|
278
|
+
value: input.license
|
|
279
|
+
})) && (undefined === input.version || "string" === typeof input.version || $guard(_exceptionable, {
|
|
280
|
+
path: _path + ".version",
|
|
281
|
+
expected: "(string | undefined)",
|
|
282
|
+
value: input.version
|
|
283
|
+
}));
|
|
284
|
+
const $ao3 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
|
|
285
|
+
path: _path + ".name",
|
|
286
|
+
expected: "(string | undefined)",
|
|
287
|
+
value: input.name
|
|
288
|
+
})) && (undefined === input.url || "string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
|
|
289
|
+
path: _path + ".url",
|
|
290
|
+
expected: "string & Format<url>",
|
|
291
|
+
value: input.url
|
|
292
|
+
})) || $guard(_exceptionable, {
|
|
293
|
+
path: _path + ".url",
|
|
294
|
+
expected: "((string & Format<url>) | undefined)",
|
|
295
|
+
value: input.url
|
|
296
|
+
})) && (undefined === input.email || "string" === typeof input.email && (/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(input.email) || $guard(_exceptionable, {
|
|
297
|
+
path: _path + ".email",
|
|
298
|
+
expected: "string & Format<email>",
|
|
299
|
+
value: input.email
|
|
300
|
+
})) || $guard(_exceptionable, {
|
|
301
|
+
path: _path + ".email",
|
|
302
|
+
expected: "((string & Format<email>) | undefined)",
|
|
303
|
+
value: input.email
|
|
304
|
+
}));
|
|
305
|
+
const $ao4 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
|
|
306
|
+
path: _path + ".name",
|
|
307
|
+
expected: "string",
|
|
308
|
+
value: input.name
|
|
309
|
+
})) && (undefined === input.url || "string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
|
|
310
|
+
path: _path + ".url",
|
|
311
|
+
expected: "string & Format<url>",
|
|
312
|
+
value: input.url
|
|
313
|
+
})) || $guard(_exceptionable, {
|
|
314
|
+
path: _path + ".url",
|
|
315
|
+
expected: "((string & Format<url>) | undefined)",
|
|
316
|
+
value: input.url
|
|
317
|
+
}));
|
|
318
|
+
const $ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
|
|
319
|
+
path: _path + ".url",
|
|
320
|
+
expected: "string & Format<url>",
|
|
321
|
+
value: input.url
|
|
322
|
+
})) || $guard(_exceptionable, {
|
|
323
|
+
path: _path + ".url",
|
|
324
|
+
expected: "(string & Format<url>)",
|
|
325
|
+
value: input.url
|
|
326
|
+
})) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
|
|
327
|
+
path: _path + ".description",
|
|
328
|
+
expected: "(string | undefined)",
|
|
329
|
+
value: input.description
|
|
330
|
+
}));
|
|
331
|
+
const $ao6 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
332
|
+
const value = input[key];
|
|
333
|
+
if (undefined === value)
|
|
334
|
+
return true;
|
|
335
|
+
if (RegExp(/(.*)/).test(key))
|
|
336
|
+
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
|
|
337
|
+
path: _path + $join(key),
|
|
338
|
+
expected: "(ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IOAuth2 | ISwaggerSecurityScheme.IOpenId)",
|
|
339
|
+
value: value
|
|
340
|
+
})) && $au0(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
341
|
+
path: _path + $join(key),
|
|
342
|
+
expected: "(ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IOAuth2 | ISwaggerSecurityScheme.IOpenId)",
|
|
343
|
+
value: value
|
|
344
|
+
});
|
|
345
|
+
return true;
|
|
346
|
+
});
|
|
347
|
+
const $ao7 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
|
|
348
|
+
path: _path + ".type",
|
|
349
|
+
expected: "\"http\"",
|
|
350
|
+
value: input.type
|
|
351
|
+
})) && ("basic" === input.scheme || $guard(_exceptionable, {
|
|
352
|
+
path: _path + ".scheme",
|
|
353
|
+
expected: "\"basic\"",
|
|
354
|
+
value: input.scheme
|
|
355
|
+
}));
|
|
356
|
+
const $ao8 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
|
|
357
|
+
path: _path + ".type",
|
|
358
|
+
expected: "\"http\"",
|
|
359
|
+
value: input.type
|
|
360
|
+
})) && ("bearer" === input.scheme || $guard(_exceptionable, {
|
|
361
|
+
path: _path + ".scheme",
|
|
362
|
+
expected: "\"bearer\"",
|
|
363
|
+
value: input.scheme
|
|
364
|
+
})) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || $guard(_exceptionable, {
|
|
365
|
+
path: _path + ".bearerFormat",
|
|
366
|
+
expected: "(string | undefined)",
|
|
367
|
+
value: input.bearerFormat
|
|
368
|
+
}));
|
|
369
|
+
const $ao9 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || $guard(_exceptionable, {
|
|
370
|
+
path: _path + ".type",
|
|
371
|
+
expected: "\"apiKey\"",
|
|
372
|
+
value: input.type
|
|
373
|
+
})) && (undefined === input["in"] || "header" === input["in"] || "query" === input["in"] || "cookie" === input["in"] || $guard(_exceptionable, {
|
|
374
|
+
path: _path + "[\"in\"]",
|
|
375
|
+
expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
|
|
376
|
+
value: input["in"]
|
|
377
|
+
})) && (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
|
|
378
|
+
path: _path + ".name",
|
|
379
|
+
expected: "(string | undefined)",
|
|
380
|
+
value: input.name
|
|
381
|
+
}));
|
|
382
|
+
const $ao10 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || $guard(_exceptionable, {
|
|
383
|
+
path: _path + ".type",
|
|
384
|
+
expected: "\"openIdConnect\"",
|
|
385
|
+
value: input.type
|
|
386
|
+
})) && ("string" === typeof input.openIdConnectUrl || $guard(_exceptionable, {
|
|
387
|
+
path: _path + ".openIdConnectUrl",
|
|
388
|
+
expected: "string",
|
|
389
|
+
value: input.openIdConnectUrl
|
|
390
|
+
}));
|
|
391
|
+
const $ao11 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || $guard(_exceptionable, {
|
|
392
|
+
path: _path + ".type",
|
|
393
|
+
expected: "\"oauth2\"",
|
|
394
|
+
value: input.type
|
|
395
|
+
})) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || $guard(_exceptionable, {
|
|
396
|
+
path: _path + ".flows",
|
|
397
|
+
expected: "ISwaggerSecurityScheme.IOAuth2.IFlowSet",
|
|
398
|
+
value: input.flows
|
|
399
|
+
})) && $ao12(input.flows, _path + ".flows", true && _exceptionable) || $guard(_exceptionable, {
|
|
400
|
+
path: _path + ".flows",
|
|
401
|
+
expected: "ISwaggerSecurityScheme.IOAuth2.IFlowSet",
|
|
402
|
+
value: input.flows
|
|
403
|
+
})) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
|
|
404
|
+
path: _path + ".description",
|
|
405
|
+
expected: "(string | undefined)",
|
|
406
|
+
value: input.description
|
|
407
|
+
}));
|
|
408
|
+
const $ao12 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode || $guard(_exceptionable, {
|
|
409
|
+
path: _path + ".authorizationCode",
|
|
410
|
+
expected: "(ISwaggerSecurityScheme.IOAuth2.IFlow | undefined)",
|
|
411
|
+
value: input.authorizationCode
|
|
412
|
+
})) && $ao13(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || $guard(_exceptionable, {
|
|
413
|
+
path: _path + ".authorizationCode",
|
|
414
|
+
expected: "(ISwaggerSecurityScheme.IOAuth2.IFlow | undefined)",
|
|
415
|
+
value: input.authorizationCode
|
|
416
|
+
})) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit || $guard(_exceptionable, {
|
|
417
|
+
path: _path + ".implicit",
|
|
418
|
+
expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
|
|
419
|
+
value: input.implicit
|
|
420
|
+
})) && $ao15(input.implicit, _path + ".implicit", true && _exceptionable) || $guard(_exceptionable, {
|
|
421
|
+
path: _path + ".implicit",
|
|
422
|
+
expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
|
|
423
|
+
value: input.implicit
|
|
424
|
+
})) && (undefined === input.password || ("object" === typeof input.password && null !== input.password || $guard(_exceptionable, {
|
|
425
|
+
path: _path + ".password",
|
|
426
|
+
expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
427
|
+
value: input.password
|
|
428
|
+
})) && $ao16(input.password, _path + ".password", true && _exceptionable) || $guard(_exceptionable, {
|
|
429
|
+
path: _path + ".password",
|
|
430
|
+
expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
431
|
+
value: input.password
|
|
432
|
+
})) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials || $guard(_exceptionable, {
|
|
433
|
+
path: _path + ".clientCredentials",
|
|
434
|
+
expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
435
|
+
value: input.clientCredentials
|
|
436
|
+
})) && $ao16(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || $guard(_exceptionable, {
|
|
437
|
+
path: _path + ".clientCredentials",
|
|
438
|
+
expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
|
|
439
|
+
value: input.clientCredentials
|
|
440
|
+
}));
|
|
441
|
+
const $ao13 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
|
|
442
|
+
path: _path + ".authorizationUrl",
|
|
443
|
+
expected: "string",
|
|
444
|
+
value: input.authorizationUrl
|
|
445
|
+
})) && ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
|
|
446
|
+
path: _path + ".tokenUrl",
|
|
447
|
+
expected: "string",
|
|
448
|
+
value: input.tokenUrl
|
|
449
|
+
})) && ("string" === typeof input.refreshUrl || $guard(_exceptionable, {
|
|
450
|
+
path: _path + ".refreshUrl",
|
|
451
|
+
expected: "string",
|
|
452
|
+
value: input.refreshUrl
|
|
453
|
+
})) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
|
|
454
|
+
path: _path + ".scopes",
|
|
455
|
+
expected: "(Record<string, string> | undefined)",
|
|
456
|
+
value: input.scopes
|
|
457
|
+
})) && $ao14(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
|
|
458
|
+
path: _path + ".scopes",
|
|
459
|
+
expected: "(Record<string, string> | undefined)",
|
|
460
|
+
value: input.scopes
|
|
461
|
+
}));
|
|
462
|
+
const $ao14 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
463
|
+
const value = input[key];
|
|
464
|
+
if (undefined === value)
|
|
465
|
+
return true;
|
|
466
|
+
if (RegExp(/(.*)/).test(key))
|
|
467
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
468
|
+
path: _path + $join(key),
|
|
469
|
+
expected: "string",
|
|
470
|
+
value: value
|
|
471
|
+
});
|
|
472
|
+
return true;
|
|
473
|
+
});
|
|
474
|
+
const $ao15 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
|
|
475
|
+
path: _path + ".authorizationUrl",
|
|
476
|
+
expected: "string",
|
|
477
|
+
value: input.authorizationUrl
|
|
478
|
+
})) && ("string" === typeof input.refreshUrl || $guard(_exceptionable, {
|
|
479
|
+
path: _path + ".refreshUrl",
|
|
480
|
+
expected: "string",
|
|
481
|
+
value: input.refreshUrl
|
|
482
|
+
})) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
|
|
483
|
+
path: _path + ".scopes",
|
|
484
|
+
expected: "(Record<string, string> | undefined)",
|
|
485
|
+
value: input.scopes
|
|
486
|
+
})) && $ao14(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
|
|
487
|
+
path: _path + ".scopes",
|
|
488
|
+
expected: "(Record<string, string> | undefined)",
|
|
489
|
+
value: input.scopes
|
|
490
|
+
}));
|
|
491
|
+
const $ao16 = (input, _path, _exceptionable = true) => ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
|
|
492
|
+
path: _path + ".tokenUrl",
|
|
493
|
+
expected: "string",
|
|
494
|
+
value: input.tokenUrl
|
|
495
|
+
})) && ("string" === typeof input.refreshUrl || $guard(_exceptionable, {
|
|
496
|
+
path: _path + ".refreshUrl",
|
|
497
|
+
expected: "string",
|
|
498
|
+
value: input.refreshUrl
|
|
499
|
+
})) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
|
|
500
|
+
path: _path + ".scopes",
|
|
501
|
+
expected: "(Record<string, string> | undefined)",
|
|
502
|
+
value: input.scopes
|
|
503
|
+
})) && $ao14(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
|
|
504
|
+
path: _path + ".scopes",
|
|
505
|
+
expected: "(Record<string, string> | undefined)",
|
|
506
|
+
value: input.scopes
|
|
507
|
+
}));
|
|
508
|
+
const $ao17 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || $guard(_exceptionable, {
|
|
509
|
+
path: _path + ".include",
|
|
510
|
+
expected: "Array<string>",
|
|
511
|
+
value: input.include
|
|
512
|
+
})) && input.include.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
|
|
513
|
+
path: _path + ".include[" + _index3 + "]",
|
|
514
|
+
expected: "string",
|
|
515
|
+
value: elem
|
|
516
|
+
})) || $guard(_exceptionable, {
|
|
517
|
+
path: _path + ".include",
|
|
518
|
+
expected: "Array<string>",
|
|
519
|
+
value: input.include
|
|
520
|
+
})) && (undefined === input.exclude || (Array.isArray(input.exclude) || $guard(_exceptionable, {
|
|
521
|
+
path: _path + ".exclude",
|
|
522
|
+
expected: "(Array<string> | undefined)",
|
|
523
|
+
value: input.exclude
|
|
524
|
+
})) && input.exclude.every((elem, _index4) => "string" === typeof elem || $guard(_exceptionable, {
|
|
525
|
+
path: _path + ".exclude[" + _index4 + "]",
|
|
526
|
+
expected: "string",
|
|
527
|
+
value: elem
|
|
528
|
+
})) || $guard(_exceptionable, {
|
|
529
|
+
path: _path + ".exclude",
|
|
530
|
+
expected: "(Array<string> | undefined)",
|
|
531
|
+
value: input.exclude
|
|
532
|
+
}));
|
|
533
|
+
const $au0 = (input, _path, _exceptionable = true) => (() => {
|
|
534
|
+
if ("basic" === input.scheme)
|
|
535
|
+
return $ao7(input, _path, true && _exceptionable);
|
|
536
|
+
else if ("bearer" === input.scheme)
|
|
537
|
+
return $ao8(input, _path, true && _exceptionable);
|
|
538
|
+
else if ("apiKey" === input.type)
|
|
539
|
+
return $ao9(input, _path, true && _exceptionable);
|
|
540
|
+
else if ("openIdConnect" === input.type)
|
|
541
|
+
return $ao10(input, _path, true && _exceptionable);
|
|
542
|
+
else if ("oauth2" === input.type)
|
|
543
|
+
return $ao11(input, _path, true && _exceptionable);
|
|
544
|
+
else
|
|
545
|
+
return $guard(_exceptionable, {
|
|
546
|
+
path: _path,
|
|
547
|
+
expected: "(ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IOpenId | ISwaggerSecurityScheme.IOAuth2)",
|
|
548
|
+
value: input
|
|
549
|
+
});
|
|
550
|
+
})();
|
|
551
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
552
|
+
path: _path + "",
|
|
553
|
+
expected: "INestiaConfig",
|
|
554
|
+
value: input
|
|
555
|
+
})) && $ao0(input, _path + "", true) || $guard(true, {
|
|
556
|
+
path: _path + "",
|
|
557
|
+
expected: "INestiaConfig",
|
|
558
|
+
value: input
|
|
559
|
+
});
|
|
560
|
+
})(input, "$input", true);
|
|
561
|
+
return input;
|
|
562
|
+
})(config);
|
|
563
|
+
}
|
|
564
|
+
catch (exp) {
|
|
565
|
+
if ((input => {
|
|
566
|
+
const $io0 = input => "string" === typeof input.method && (undefined === input.path || "string" === typeof input.path) && "string" === typeof input.expected && true && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack);
|
|
567
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
568
|
+
})(exp))
|
|
569
|
+
exp.message = `invalid "nestia.config.ts" data.`;
|
|
570
|
+
throw exp;
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
NestiaConfigLoader.project = () => __awaiter(this, void 0, void 0, function* () {
|
|
574
|
+
const connector = new WorkerConnector_1.WorkerConnector(null, null, "process");
|
|
575
|
+
yield connector.connect(`${__dirname}/nestia.project.getter.${__filename.substr(-2)}`);
|
|
576
|
+
const driver = yield connector.getDriver();
|
|
577
|
+
const project = yield driver.get();
|
|
578
|
+
yield connector.close();
|
|
579
|
+
return project;
|
|
580
|
+
});
|
|
581
|
+
})(NestiaConfigLoader || (exports.NestiaConfigLoader = NestiaConfigLoader = {}));
|
|
582
|
+
//# sourceMappingURL=NestiaConfigLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestiaConfigLoader.js","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfigLoader.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NestiaProjectGetter = void 0;
|
|
13
|
+
const NestiaConfigLoader_1 = require("./NestiaConfigLoader");
|
|
14
|
+
var NestiaProjectGetter;
|
|
15
|
+
(function (NestiaProjectGetter) {
|
|
16
|
+
function get() {
|
|
17
|
+
var _a;
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const config = yield NestiaConfigLoader_1.NestiaConfigLoader.config({
|
|
20
|
+
module: "CommonJS",
|
|
21
|
+
noEmit: true,
|
|
22
|
+
});
|
|
23
|
+
return (_a = config.project) !== null && _a !== void 0 ? _a : "tsconfig.json";
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
NestiaProjectGetter.get = get;
|
|
27
|
+
})(NestiaProjectGetter || (exports.NestiaProjectGetter = NestiaProjectGetter = {}));
|
|
28
|
+
//# sourceMappingURL=NestiaProjectGetter.js.map
|