@bluealba/pae-bootstrap-lib 2.1.3 → 3.0.0-develop-119
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/README.md +2 -1
- package/dist/src/bootstrap/apply-service-local.d.ts +17 -0
- package/dist/src/bootstrap/apply-service-local.d.ts.map +1 -0
- package/dist/src/bootstrap/apply-service-local.js +54 -0
- package/dist/src/bootstrap/apply-service-local.js.map +1 -0
- package/dist/src/bootstrap/apply-service-local.test.d.ts +2 -0
- package/dist/src/bootstrap/apply-service-local.test.d.ts.map +1 -0
- package/dist/src/bootstrap/apply-service-local.test.js +125 -0
- package/dist/src/bootstrap/apply-service-local.test.js.map +1 -0
- package/dist/src/bootstrap/bootstrap-platform.d.ts +0 -4
- package/dist/src/bootstrap/bootstrap-platform.d.ts.map +1 -1
- package/dist/src/bootstrap/bootstrap-platform.js +15 -21
- package/dist/src/bootstrap/bootstrap-platform.js.map +1 -1
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts +24 -8
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts.map +1 -1
- package/dist/src/bootstrap/domain/domain-validation.test.js +180 -68
- package/dist/src/bootstrap/domain/domain-validation.test.js.map +1 -1
- package/dist/src/bootstrap/entity-synchronizer.js.map +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.d.ts +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.d.ts.map +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.js +408 -54
- package/dist/src/bootstrap/read-bootstrap-applications.js.map +1 -1
- package/dist/src/expression-language/expression-engine.d.ts +3 -0
- package/dist/src/expression-language/expression-engine.d.ts.map +1 -0
- package/dist/src/expression-language/expression-engine.js +80 -0
- package/dist/src/expression-language/expression-engine.js.map +1 -0
- package/dist/src/expression-language/expression-engine.test.d.ts +2 -0
- package/dist/src/expression-language/expression-engine.test.d.ts.map +1 -0
- package/dist/src/expression-language/expression-engine.test.js +107 -0
- package/dist/src/expression-language/expression-engine.test.js.map +1 -0
- package/dist/src/expression-language/index.d.ts +5 -0
- package/dist/src/expression-language/index.d.ts.map +1 -0
- package/dist/src/expression-language/index.js +14 -0
- package/dist/src/expression-language/index.js.map +1 -0
- package/dist/src/expression-language/resolve-deep.d.ts +2 -0
- package/dist/src/expression-language/resolve-deep.d.ts.map +1 -0
- package/dist/src/expression-language/resolve-deep.js +21 -0
- package/dist/src/expression-language/resolve-deep.js.map +1 -0
- package/dist/src/expression-language/resolve-deep.test.d.ts +2 -0
- package/dist/src/expression-language/resolve-deep.test.d.ts.map +1 -0
- package/dist/src/expression-language/resolve-deep.test.js +117 -0
- package/dist/src/expression-language/resolve-deep.test.js.map +1 -0
- package/dist/src/expression-language/resolvers/env.resolver.d.ts +3 -0
- package/dist/src/expression-language/resolvers/env.resolver.d.ts.map +1 -0
- package/dist/src/expression-language/resolvers/env.resolver.js +14 -0
- package/dist/src/expression-language/resolvers/env.resolver.js.map +1 -0
- package/dist/src/expression-language/resolvers/env.resolver.test.d.ts +2 -0
- package/dist/src/expression-language/resolvers/env.resolver.test.d.ts.map +1 -0
- package/dist/src/expression-language/resolvers/env.resolver.test.js +23 -0
- package/dist/src/expression-language/resolvers/env.resolver.test.js.map +1 -0
- package/dist/src/expression-language/resolvers/index.d.ts +8 -0
- package/dist/src/expression-language/resolvers/index.d.ts.map +1 -0
- package/dist/src/expression-language/resolvers/index.js +12 -0
- package/dist/src/expression-language/resolvers/index.js.map +1 -0
- package/dist/src/expression-language/resolvers/resolver.interface.d.ts +5 -0
- package/dist/src/expression-language/resolvers/resolver.interface.d.ts.map +1 -0
- package/dist/src/{bootstrap/synchronizers/sync-entity-options.js → expression-language/resolvers/resolver.interface.js} +1 -1
- package/dist/src/expression-language/resolvers/resolver.interface.js.map +1 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/utils/io.d.ts +1 -1
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +4 -1
- package/dist/src/utils/io.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/bootstrap/fix-created-by.d.ts +0 -10
- package/dist/src/bootstrap/fix-created-by.d.ts.map +0 -1
- package/dist/src/bootstrap/fix-created-by.js +0 -36
- package/dist/src/bootstrap/fix-created-by.js.map +0 -1
- package/dist/src/bootstrap/initialize-pae-client.d.ts +0 -7
- package/dist/src/bootstrap/initialize-pae-client.d.ts.map +0 -1
- package/dist/src/bootstrap/initialize-pae-client.js +0 -24
- package/dist/src/bootstrap/initialize-pae-client.js.map +0 -1
- package/dist/src/bootstrap/run-bootstrap-sync.service.d.ts +0 -4
- package/dist/src/bootstrap/run-bootstrap-sync.service.d.ts.map +0 -1
- package/dist/src/bootstrap/run-bootstrap-sync.service.js +0 -29
- package/dist/src/bootstrap/run-bootstrap-sync.service.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-applications.d.ts +0 -4
- package/dist/src/bootstrap/synchronizers/sync-applications.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-applications.js +0 -53
- package/dist/src/bootstrap/synchronizers/sync-applications.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.d.ts +0 -11
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.js +0 -58
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-catalog.d.ts +0 -5
- package/dist/src/bootstrap/synchronizers/sync-catalog.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-catalog.js +0 -95
- package/dist/src/bootstrap/synchronizers/sync-catalog.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.d.ts +0 -11
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.js +0 -38
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.d.ts +0 -12
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.js +0 -43
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities.d.ts +0 -19
- package/dist/src/bootstrap/synchronizers/sync-entities.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities.js +0 -59
- package/dist/src/bootstrap/synchronizers/sync-entities.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities.test.d.ts +0 -2
- package/dist/src/bootstrap/synchronizers/sync-entities.test.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entities.test.js +0 -158
- package/dist/src/bootstrap/synchronizers/sync-entities.test.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entity-options.d.ts +0 -11
- package/dist/src/bootstrap/synchronizers/sync-entity-options.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-entity-options.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-feature-flags.d.ts +0 -8
- package/dist/src/bootstrap/synchronizers/sync-feature-flags.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-feature-flags.js +0 -67
- package/dist/src/bootstrap/synchronizers/sync-feature-flags.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-modules-config.d.ts +0 -4
- package/dist/src/bootstrap/synchronizers/sync-modules-config.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-modules-config.js +0 -28
- package/dist/src/bootstrap/synchronizers/sync-modules-config.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-operations.d.ts +0 -5
- package/dist/src/bootstrap/synchronizers/sync-operations.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-operations.js +0 -41
- package/dist/src/bootstrap/synchronizers/sync-operations.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-role-operations.d.ts +0 -8
- package/dist/src/bootstrap/synchronizers/sync-role-operations.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-role-operations.js +0 -74
- package/dist/src/bootstrap/synchronizers/sync-role-operations.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-roles.d.ts +0 -5
- package/dist/src/bootstrap/synchronizers/sync-roles.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-roles.js +0 -41
- package/dist/src/bootstrap/synchronizers/sync-roles.js.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.d.ts +0 -4
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.d.ts.map +0 -1
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.js +0 -32
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.js.map +0 -1
|
@@ -39,10 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.readPlatformBootstrapFolder = void 0;
|
|
40
40
|
const __typia_transform__assertGuard = __importStar(require("typia/lib/internal/_assertGuard.js"));
|
|
41
41
|
const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString.js"));
|
|
42
|
-
const path_1 = require("path");
|
|
43
|
-
const io_1 = require("../utils/io");
|
|
44
42
|
const pae_core_1 = require("@bluealba/pae-core");
|
|
43
|
+
const path_1 = require("path");
|
|
45
44
|
const typia_1 = __importDefault(require("typia"));
|
|
45
|
+
const io_1 = require("../utils/io");
|
|
46
46
|
// conventions
|
|
47
47
|
const FILE_SHARED_LIBRARIES = 'shared-libraries.json';
|
|
48
48
|
const FILE_FEATURE_FLAGS = 'feature-flags.json';
|
|
@@ -51,6 +51,8 @@ const FILE_OPERATIONS = 'operations.json';
|
|
|
51
51
|
const FILE_MODULES = 'modules.json';
|
|
52
52
|
const FILE_MODULES_CONFIG = 'modules-config.json';
|
|
53
53
|
const FILE_ROLES = 'roles.json';
|
|
54
|
+
const FILE_JOBS = 'jobs.json';
|
|
55
|
+
const FOLDER_GLOBAL = 'global';
|
|
54
56
|
/**
|
|
55
57
|
* Inspects the filesystem reading all application definitions
|
|
56
58
|
* NOTE: this is a really quick implementation pretty raw.
|
|
@@ -58,11 +60,12 @@ const FILE_ROLES = 'roles.json';
|
|
|
58
60
|
* Feel free to add tests (:P) and improve it.
|
|
59
61
|
*/
|
|
60
62
|
const readPlatformBootstrapFolder = (path, options) => {
|
|
61
|
-
const
|
|
62
|
-
const { readdirSync } = require("fs");
|
|
63
|
+
const defaultApplication = createDefaultPlatformApplication();
|
|
64
|
+
const { readdirSync, existsSync } = require("fs");
|
|
65
|
+
migrateGlobalFolderToPlatform(path);
|
|
63
66
|
// @ts-ignore
|
|
64
67
|
return readdirSync(path, { withFileTypes: true }).reduce((acc, item) => {
|
|
65
|
-
var _a;
|
|
68
|
+
var _a, _b, _c;
|
|
66
69
|
if (item.name === FILE_SHARED_LIBRARIES) {
|
|
67
70
|
try {
|
|
68
71
|
acc.sharedLibraries = (() => { const _io0 = input => "string" === typeof input.name && "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -114,7 +117,7 @@ const readPlatformBootstrapFolder = (path, options) => {
|
|
|
114
117
|
}
|
|
115
118
|
else if (item.name === FILE_FEATURE_FLAGS) {
|
|
116
119
|
try {
|
|
117
|
-
acc.featureFlags = (() => { const _io0 = input => "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description) && (undefined === input.enabled || "boolean" === typeof input.enabled) && (undefined === input.constraints || Array.isArray(input.constraints) && input.constraints.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.contextName && "string" === typeof input.operator && (undefined === input.values || Array.isArray(input.values) && input.values.every(elem => "string" === typeof elem)); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
120
|
+
acc.featureFlags = (() => { const _io0 = input => "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description) && (undefined === input.enabled || "boolean" === typeof input.enabled) && (undefined === input.applicationName || "string" === typeof input.applicationName) && (undefined === input.constraints || Array.isArray(input.constraints) && input.constraints.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.contextName && "string" === typeof input.operator && (undefined === input.values || Array.isArray(input.values) && input.values.every(elem => "string" === typeof elem)); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
118
121
|
method: "typia.assert",
|
|
119
122
|
path: _path + ".name",
|
|
120
123
|
expected: "string",
|
|
@@ -129,6 +132,11 @@ const readPlatformBootstrapFolder = (path, options) => {
|
|
|
129
132
|
path: _path + ".enabled",
|
|
130
133
|
expected: "(boolean | undefined)",
|
|
131
134
|
value: input.enabled
|
|
135
|
+
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
136
|
+
method: "typia.assert",
|
|
137
|
+
path: _path + ".applicationName",
|
|
138
|
+
expected: "(string | undefined)",
|
|
139
|
+
value: input.applicationName
|
|
132
140
|
}, _errorFactory)) && (undefined === input.constraints || (Array.isArray(input.constraints) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
133
141
|
method: "typia.assert",
|
|
134
142
|
path: _path + ".constraints",
|
|
@@ -207,28 +215,39 @@ const readPlatformBootstrapFolder = (path, options) => {
|
|
|
207
215
|
}
|
|
208
216
|
}
|
|
209
217
|
else if (item.isDirectory()) {
|
|
218
|
+
if (item.name === FOLDER_GLOBAL) {
|
|
219
|
+
return acc;
|
|
220
|
+
}
|
|
210
221
|
if (((_a = options.exclude) !== null && _a !== void 0 ? _a : []).includes(item.name)) {
|
|
211
222
|
console.log(`Excluding application [${item.name}] !`);
|
|
212
223
|
return acc;
|
|
213
224
|
}
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
216
|
-
|
|
225
|
+
const appPath = (0, path_1.join)(path, item.name);
|
|
226
|
+
if (item.name !== pae_core_1.PLATFORM_APPLICATION_NAME && !existsSync((0, path_1.join)(appPath, FILE_APPLICATION))) {
|
|
227
|
+
throw new Error(`Application directory [${item.name}] is missing required ${FILE_APPLICATION} file`);
|
|
228
|
+
}
|
|
229
|
+
const app = readApplicationDirectory(appPath, defaultApplication);
|
|
230
|
+
acc.applications[app.name] = app;
|
|
231
|
+
if ((_b = app.featureFlags) === null || _b === void 0 ? void 0 : _b.length) {
|
|
232
|
+
acc.featureFlags = [...((_c = acc.featureFlags) !== null && _c !== void 0 ? _c : []), ...app.featureFlags];
|
|
217
233
|
}
|
|
218
234
|
}
|
|
219
235
|
return acc;
|
|
220
|
-
}, { applications: {
|
|
236
|
+
}, { applications: {} });
|
|
221
237
|
};
|
|
222
238
|
exports.readPlatformBootstrapFolder = readPlatformBootstrapFolder;
|
|
223
|
-
const
|
|
224
|
-
name: pae_core_1.
|
|
225
|
-
|
|
239
|
+
const createDefaultPlatformApplication = () => ({
|
|
240
|
+
name: pae_core_1.PLATFORM_APPLICATION_NAME,
|
|
241
|
+
displayName: "Platform",
|
|
242
|
+
description: "Platform Administration",
|
|
243
|
+
allowedByDefault: true,
|
|
226
244
|
modules: [],
|
|
227
245
|
operations: [],
|
|
228
246
|
roles: [],
|
|
229
|
-
modulesConfig: []
|
|
247
|
+
modulesConfig: [],
|
|
248
|
+
jobs: []
|
|
230
249
|
});
|
|
231
|
-
const readApplicationDirectory = (path,
|
|
250
|
+
const readApplicationDirectory = (path, defaultApplication) => {
|
|
232
251
|
const { existsSync } = require("fs");
|
|
233
252
|
const assert = (() => { const _io0 = input => "string" === typeof input.name && (undefined === input.displayName || "string" === typeof input.displayName) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.allowedByDefault || "boolean" === typeof input.allowedByDefault); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
234
253
|
method: "typia.createAssert",
|
|
@@ -269,17 +288,24 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
269
288
|
}
|
|
270
289
|
return input;
|
|
271
290
|
}; })();
|
|
272
|
-
const application = existsSync((0, path_1.join)(path, FILE_APPLICATION)) ? Object.assign(Object.assign({}, assert((0, io_1.readJSONFile)((0, path_1.join)(path, FILE_APPLICATION)))), { modules: [], operations: [], roles: [], modulesConfig: [] }) :
|
|
291
|
+
const application = existsSync((0, path_1.join)(path, FILE_APPLICATION)) ? Object.assign(Object.assign({}, assert((0, io_1.readJSONFile)((0, path_1.join)(path, FILE_APPLICATION)))), { modules: [], operations: [], roles: [], modulesConfig: [], jobs: [] }) : defaultApplication;
|
|
273
292
|
// read modules setting the application (if app is not global)
|
|
274
293
|
if (existsSync((0, path_1.join)(path, FILE_MODULES))) {
|
|
275
294
|
const data = readApplicationItems(path, FILE_MODULES, application, 'application');
|
|
276
295
|
try {
|
|
277
|
-
application.modules.push(...(() => { const _io0 = input => "string" === typeof input.name && "string" === typeof input.displayName && ("service" === input.type || "app" === input.type || "tool" === input.type || "utility" === input.type || "cloud-function" === input.type || "documentation" === input.type) && "string" === typeof input.baseUrl && ("object" === typeof input.service && null !== input.service && _io1(input.service)) && (Array.isArray(input.dependsOn) && input.dependsOn.every(elem => "string" === typeof elem)) && (undefined === input.commonPaths || "object" === typeof input.commonPaths && null !== input.commonPaths && false === Array.isArray(input.commonPaths) && _io2(input.commonPaths)) && (undefined === input.ui || "object" === typeof input.ui && null !== input.ui && _io3(input.ui)) && (undefined === input.cloudFunction || "object" === typeof input.cloudFunction && null !== input.cloudFunction && _io5(input.cloudFunction)) && (undefined === input.authorization || "object" === typeof input.authorization && null !== input.authorization && false === Array.isArray(input.authorization) && _io6(input.authorization)) && (undefined === input.application || "string" === typeof input.application) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.isPublic || "boolean" === typeof input.isPublic) && (undefined === input.id || "number" === typeof input.id)
|
|
296
|
+
application.modules.push(...(() => { const _io0 = input => "string" === typeof input.name && "string" === typeof input.displayName && ("service" === input.type || "app" === input.type || "tool" === input.type || "utility" === input.type || "cloud-function" === input.type || "documentation" === input.type) && "string" === typeof input.baseUrl && ("object" === typeof input.service && null !== input.service && _io1(input.service)) && (Array.isArray(input.dependsOn) && input.dependsOn.every(elem => "string" === typeof elem)) && (undefined === input.commonPaths || "object" === typeof input.commonPaths && null !== input.commonPaths && false === Array.isArray(input.commonPaths) && _io2(input.commonPaths)) && (undefined === input.ui || "object" === typeof input.ui && null !== input.ui && _io3(input.ui)) && (undefined === input.cloudFunction || "object" === typeof input.cloudFunction && null !== input.cloudFunction && _io5(input.cloudFunction)) && (undefined === input.authorization || "object" === typeof input.authorization && null !== input.authorization && false === Array.isArray(input.authorization) && _io6(input.authorization)) && (undefined === input.application || "string" === typeof input.application) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.isPublic || "boolean" === typeof input.isPublic) && (undefined === input.id || "number" === typeof input.id) && (undefined === input.serviceLocal || "object" === typeof input.serviceLocal && null !== input.serviceLocal && false === Array.isArray(input.serviceLocal) && _io8(input.serviceLocal)) && Object.keys(input).every(key => {
|
|
297
|
+
if (["name", "displayName", "type", "baseUrl", "service", "dependsOn", "commonPaths", "ui", "cloudFunction", "authorization", "application", "version", "isPublic", "id", "serviceLocal"].some(prop => key === prop))
|
|
298
|
+
return true;
|
|
299
|
+
const value = input[key];
|
|
300
|
+
if (undefined === value)
|
|
301
|
+
return true;
|
|
302
|
+
return "string" === typeof value;
|
|
303
|
+
}); const _io1 = input => "string" === typeof input.host && "number" === typeof input.port && (undefined === input.protocol || "string" === typeof input.protocol) && (undefined === input.includeBaseURL || "boolean" === typeof input.includeBaseURL); const _io2 = input => (undefined === input.apiDocs || "string" === typeof input.apiDocs) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.health || "string" === typeof input.health) && (undefined === input.changelog || "string" === typeof input.changelog); const _io3 = input => "string" === typeof input.route && (null === input.mountAtSelector || undefined === input.mountAtSelector || "string" === typeof input.mountAtSelector) && "string" === typeof input.bundleFile && ("object" === typeof input.customProps && null !== input.customProps && false === Array.isArray(input.customProps) && _io4(input.customProps)) && (undefined === input.shell || "boolean" === typeof input.shell) && (undefined === input.isPlatformCustomization || "boolean" === typeof input.isPlatformCustomization); const _io4 = input => Object.keys(input).every(key => {
|
|
278
304
|
const value = input[key];
|
|
279
305
|
if (undefined === value)
|
|
280
306
|
return true;
|
|
281
307
|
return true;
|
|
282
|
-
}); const _io5 = input => "aws" === input.provider && "boolean" === typeof input.requiresSignature; const _io6 = input => (undefined === input.operations || Array.isArray(input.operations) && input.operations.every(elem => "string" === typeof elem)) && (undefined === input.routes || Array.isArray(input.routes) && input.routes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))); const _io7 = input => (undefined === input.methods || Array.isArray(input.methods) && input.methods.every(elem => "
|
|
308
|
+
}); const _io5 = input => "aws" === input.provider && "boolean" === typeof input.requiresSignature; const _io6 = input => (undefined === input.operations || Array.isArray(input.operations) && input.operations.every(elem => "string" === typeof elem)) && (undefined === input.routes || Array.isArray(input.routes) && input.routes.every(elem => "object" === typeof elem && null !== elem && _io7(elem))); const _io7 = input => (undefined === input.methods || Array.isArray(input.methods) && input.methods.every(elem => "POST" === elem || "DELETE" === elem || "GET" === elem || "HEAD" === elem || "OPTIONS" === elem || "PUT" === elem || "PATCH" === elem || "CONNECT" === elem || "TRACE" === elem)) && "string" === typeof input.pattern && (Array.isArray(input.operations) && input.operations.every(elem => "string" === typeof elem)); const _io8 = input => (undefined === input.host || "string" === typeof input.host) && (undefined === input.port || "number" === typeof input.port) && (undefined === input.protocol || "string" === typeof input.protocol) && (undefined === input.includeBaseURL || "boolean" === typeof input.includeBaseURL); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
283
309
|
method: "typia.assert",
|
|
284
310
|
path: _path + ".name",
|
|
285
311
|
expected: "string",
|
|
@@ -384,7 +410,29 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
384
410
|
path: _path + ".id",
|
|
385
411
|
expected: "(number | undefined)",
|
|
386
412
|
value: input.id
|
|
387
|
-
}, _errorFactory))
|
|
413
|
+
}, _errorFactory)) && (undefined === input.serviceLocal || ("object" === typeof input.serviceLocal && null !== input.serviceLocal && false === Array.isArray(input.serviceLocal) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
414
|
+
method: "typia.assert",
|
|
415
|
+
path: _path + ".serviceLocal",
|
|
416
|
+
expected: "(Partial<ServiceConfig> | undefined)",
|
|
417
|
+
value: input.serviceLocal
|
|
418
|
+
}, _errorFactory)) && _ao8(input.serviceLocal, _path + ".serviceLocal", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
419
|
+
method: "typia.assert",
|
|
420
|
+
path: _path + ".serviceLocal",
|
|
421
|
+
expected: "(Partial<ServiceConfig> | undefined)",
|
|
422
|
+
value: input.serviceLocal
|
|
423
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
424
|
+
if (["name", "displayName", "type", "baseUrl", "service", "dependsOn", "commonPaths", "ui", "cloudFunction", "authorization", "application", "version", "isPublic", "id", "serviceLocal"].some(prop => key === prop))
|
|
425
|
+
return true;
|
|
426
|
+
const value = input[key];
|
|
427
|
+
if (undefined === value)
|
|
428
|
+
return true;
|
|
429
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
430
|
+
method: "typia.assert",
|
|
431
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
432
|
+
expected: "string",
|
|
433
|
+
value: value
|
|
434
|
+
}, _errorFactory);
|
|
435
|
+
})); const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.host || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
388
436
|
method: "typia.assert",
|
|
389
437
|
path: _path + ".host",
|
|
390
438
|
expected: "string",
|
|
@@ -514,7 +562,7 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
514
562
|
path: _path + ".methods",
|
|
515
563
|
expected: "(Array<HttpMethod> | undefined)",
|
|
516
564
|
value: input.methods
|
|
517
|
-
}, _errorFactory)) && input.methods.every((elem, _index11) => "
|
|
565
|
+
}, _errorFactory)) && input.methods.every((elem, _index11) => "POST" === elem || "DELETE" === elem || "GET" === elem || "HEAD" === elem || "OPTIONS" === elem || "PUT" === elem || "PATCH" === elem || "CONNECT" === elem || "TRACE" === elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
518
566
|
method: "typia.assert",
|
|
519
567
|
path: _path + ".methods[" + _index11 + "]",
|
|
520
568
|
expected: "(\"CONNECT\" | \"DELETE\" | \"GET\" | \"HEAD\" | \"OPTIONS\" | \"PATCH\" | \"POST\" | \"PUT\" | \"TRACE\")",
|
|
@@ -544,28 +592,48 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
544
592
|
path: _path + ".operations",
|
|
545
593
|
expected: "Array<string>",
|
|
546
594
|
value: input.operations
|
|
595
|
+
}, _errorFactory)); const _ao8 = (input, _path, _exceptionable = true) => (undefined === input.host || "string" === typeof input.host || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
596
|
+
method: "typia.assert",
|
|
597
|
+
path: _path + ".host",
|
|
598
|
+
expected: "(string | undefined)",
|
|
599
|
+
value: input.host
|
|
600
|
+
}, _errorFactory)) && (undefined === input.port || "number" === typeof input.port || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
601
|
+
method: "typia.assert",
|
|
602
|
+
path: _path + ".port",
|
|
603
|
+
expected: "(number | undefined)",
|
|
604
|
+
value: input.port
|
|
605
|
+
}, _errorFactory)) && (undefined === input.protocol || "string" === typeof input.protocol || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
606
|
+
method: "typia.assert",
|
|
607
|
+
path: _path + ".protocol",
|
|
608
|
+
expected: "(string | undefined)",
|
|
609
|
+
value: input.protocol
|
|
610
|
+
}, _errorFactory)) && (undefined === input.includeBaseURL || "boolean" === typeof input.includeBaseURL || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
611
|
+
method: "typia.assert",
|
|
612
|
+
path: _path + ".includeBaseURL",
|
|
613
|
+
expected: "(boolean | undefined)",
|
|
614
|
+
value: input.includeBaseURL
|
|
547
615
|
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
548
616
|
if (false === __is(input)) {
|
|
549
617
|
_errorFactory = errorFactory;
|
|
550
618
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
551
619
|
method: "typia.assert",
|
|
552
620
|
path: _path + "",
|
|
553
|
-
expected: "Array<CreateOrUpdateModule>",
|
|
621
|
+
expected: "Array<CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }>",
|
|
554
622
|
value: input
|
|
555
623
|
}, _errorFactory)) && input.every((elem, _index7) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
556
624
|
method: "typia.assert",
|
|
557
625
|
path: _path + "[" + _index7 + "]",
|
|
558
|
-
expected: "CreateOrUpdateModule",
|
|
626
|
+
expected: "CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }",
|
|
559
627
|
value: elem
|
|
560
628
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index7 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
561
629
|
method: "typia.assert",
|
|
562
630
|
path: _path + "[" + _index7 + "]",
|
|
563
|
-
expected: "CreateOrUpdateModule",
|
|
631
|
+
expected: "CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }",
|
|
564
632
|
value: elem
|
|
565
633
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
566
634
|
method: "typia.assert",
|
|
567
635
|
path: _path + "",
|
|
568
|
-
expected: "Array<CreateOrUpdateModule>",
|
|
636
|
+
expected: "Array<CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }>",
|
|
569
637
|
value: input
|
|
570
638
|
}, _errorFactory))(input, "$input", true);
|
|
571
639
|
}
|
|
@@ -579,7 +647,14 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
579
647
|
if (existsSync((0, path_1.join)(path, FILE_MODULES_CONFIG))) {
|
|
580
648
|
const data = readApplicationItems(path, FILE_MODULES_CONFIG, application, 'application');
|
|
581
649
|
try {
|
|
582
|
-
application.modulesConfig.push(...(() => { const _io0 = input => "string" === typeof input.name && ("object" === typeof input.config && null !== input.config && false === Array.isArray(input.config) && _io1(input.config))
|
|
650
|
+
application.modulesConfig.push(...(() => { const _io0 = input => "string" === typeof input.name && ("object" === typeof input.config && null !== input.config && false === Array.isArray(input.config) && _io1(input.config)) && Object.keys(input).every(key => {
|
|
651
|
+
if (["name", "config"].some(prop => key === prop))
|
|
652
|
+
return true;
|
|
653
|
+
const value = input[key];
|
|
654
|
+
if (undefined === value)
|
|
655
|
+
return true;
|
|
656
|
+
return "string" === typeof value;
|
|
657
|
+
}); const _io1 = input => Object.keys(input).every(key => {
|
|
583
658
|
const value = input[key];
|
|
584
659
|
if (undefined === value)
|
|
585
660
|
return true;
|
|
@@ -599,7 +674,19 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
599
674
|
path: _path + ".config",
|
|
600
675
|
expected: "Record<string, any>",
|
|
601
676
|
value: input.config
|
|
602
|
-
}, _errorFactory))
|
|
677
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
678
|
+
if (["name", "config"].some(prop => key === prop))
|
|
679
|
+
return true;
|
|
680
|
+
const value = input[key];
|
|
681
|
+
if (undefined === value)
|
|
682
|
+
return true;
|
|
683
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
684
|
+
method: "typia.assert",
|
|
685
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
686
|
+
expected: "string",
|
|
687
|
+
value: value
|
|
688
|
+
}, _errorFactory);
|
|
689
|
+
})); const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
603
690
|
const value = input[key];
|
|
604
691
|
if (undefined === value)
|
|
605
692
|
return true;
|
|
@@ -610,22 +697,22 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
610
697
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
611
698
|
method: "typia.assert",
|
|
612
699
|
path: _path + "",
|
|
613
|
-
expected: "Array<ModuleConfig>",
|
|
700
|
+
expected: "Array<ModuleConfig & { [x: string]: string; }>",
|
|
614
701
|
value: input
|
|
615
702
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
616
703
|
method: "typia.assert",
|
|
617
704
|
path: _path + "[" + _index2 + "]",
|
|
618
|
-
expected: "ModuleConfig",
|
|
705
|
+
expected: "ModuleConfig & { [x: string]: string; }",
|
|
619
706
|
value: elem
|
|
620
707
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
621
708
|
method: "typia.assert",
|
|
622
709
|
path: _path + "[" + _index2 + "]",
|
|
623
|
-
expected: "ModuleConfig",
|
|
710
|
+
expected: "ModuleConfig & { [x: string]: string; }",
|
|
624
711
|
value: elem
|
|
625
712
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
626
713
|
method: "typia.assert",
|
|
627
714
|
path: _path + "",
|
|
628
|
-
expected: "Array<ModuleConfig>",
|
|
715
|
+
expected: "Array<ModuleConfig & { [x: string]: string; }>",
|
|
629
716
|
value: input
|
|
630
717
|
}, _errorFactory))(input, "$input", true);
|
|
631
718
|
}
|
|
@@ -639,43 +726,77 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
639
726
|
if (existsSync((0, path_1.join)(path, FILE_OPERATIONS))) {
|
|
640
727
|
const data = readApplicationItems(path, FILE_OPERATIONS, application);
|
|
641
728
|
try {
|
|
642
|
-
application.operations.push(...(() => { const _io0 = input =>
|
|
729
|
+
application.operations.push(...(() => { const _io0 = input => (undefined === input.roles || Array.isArray(input.roles) && input.roles.every(elem => "string" === typeof elem)) && "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description) && (undefined === input.applicationName || "string" === typeof input.applicationName) && Object.keys(input).every(key => {
|
|
730
|
+
if (["roles", "name", "description", "applicationName"].some(prop => key === prop))
|
|
731
|
+
return true;
|
|
732
|
+
const value = input[key];
|
|
733
|
+
if (undefined === value)
|
|
734
|
+
return true;
|
|
735
|
+
return "string" === typeof value;
|
|
736
|
+
}); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.roles || (Array.isArray(input.roles) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
737
|
+
method: "typia.assert",
|
|
738
|
+
path: _path + ".roles",
|
|
739
|
+
expected: "(Array<string> | undefined)",
|
|
740
|
+
value: input.roles
|
|
741
|
+
}, _errorFactory)) && input.roles.every((elem, _index4) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
742
|
+
method: "typia.assert",
|
|
743
|
+
path: _path + ".roles[" + _index4 + "]",
|
|
744
|
+
expected: "string",
|
|
745
|
+
value: elem
|
|
746
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
747
|
+
method: "typia.assert",
|
|
748
|
+
path: _path + ".roles",
|
|
749
|
+
expected: "(Array<string> | undefined)",
|
|
750
|
+
value: input.roles
|
|
751
|
+
}, _errorFactory)) && ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
643
752
|
method: "typia.assert",
|
|
644
753
|
path: _path + ".name",
|
|
645
754
|
expected: "string",
|
|
646
755
|
value: input.name
|
|
647
|
-
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
648
|
-
method: "typia.assert",
|
|
649
|
-
path: _path + ".applicationName",
|
|
650
|
-
expected: "(string | undefined)",
|
|
651
|
-
value: input.applicationName
|
|
652
756
|
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
653
757
|
method: "typia.assert",
|
|
654
758
|
path: _path + ".description",
|
|
655
759
|
expected: "(string | undefined)",
|
|
656
760
|
value: input.description
|
|
657
|
-
}, _errorFactory))
|
|
761
|
+
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
762
|
+
method: "typia.assert",
|
|
763
|
+
path: _path + ".applicationName",
|
|
764
|
+
expected: "(string | undefined)",
|
|
765
|
+
value: input.applicationName
|
|
766
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
767
|
+
if (["roles", "name", "description", "applicationName"].some(prop => key === prop))
|
|
768
|
+
return true;
|
|
769
|
+
const value = input[key];
|
|
770
|
+
if (undefined === value)
|
|
771
|
+
return true;
|
|
772
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
773
|
+
method: "typia.assert",
|
|
774
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
775
|
+
expected: "string",
|
|
776
|
+
value: value
|
|
777
|
+
}, _errorFactory);
|
|
778
|
+
})); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
658
779
|
if (false === __is(input)) {
|
|
659
780
|
_errorFactory = errorFactory;
|
|
660
781
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
661
782
|
method: "typia.assert",
|
|
662
783
|
path: _path + "",
|
|
663
|
-
expected: "Array<
|
|
784
|
+
expected: "Array<OperationAuthzBootstrap & { [x: string]: string; }>",
|
|
664
785
|
value: input
|
|
665
|
-
}, _errorFactory)) && input.every((elem,
|
|
786
|
+
}, _errorFactory)) && input.every((elem, _index3) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
666
787
|
method: "typia.assert",
|
|
667
|
-
path: _path + "[" +
|
|
668
|
-
expected: "
|
|
788
|
+
path: _path + "[" + _index3 + "]",
|
|
789
|
+
expected: "OperationAuthzBootstrap & { [x: string]: string; }",
|
|
669
790
|
value: elem
|
|
670
|
-
}, _errorFactory)) && _ao0(elem, _path + "[" +
|
|
791
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index3 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
671
792
|
method: "typia.assert",
|
|
672
|
-
path: _path + "[" +
|
|
673
|
-
expected: "
|
|
793
|
+
path: _path + "[" + _index3 + "]",
|
|
794
|
+
expected: "OperationAuthzBootstrap & { [x: string]: string; }",
|
|
674
795
|
value: elem
|
|
675
796
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
676
797
|
method: "typia.assert",
|
|
677
798
|
path: _path + "",
|
|
678
|
-
expected: "Array<
|
|
799
|
+
expected: "Array<OperationAuthzBootstrap & { [x: string]: string; }>",
|
|
679
800
|
value: input
|
|
680
801
|
}, _errorFactory))(input, "$input", true);
|
|
681
802
|
}
|
|
@@ -689,7 +810,14 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
689
810
|
if (existsSync((0, path_1.join)(path, FILE_ROLES))) {
|
|
690
811
|
const data = readApplicationItems(path, FILE_ROLES, application);
|
|
691
812
|
try {
|
|
692
|
-
application.roles.push(...(() => { const _io0 = input => (undefined === input.applicationName || "string" === typeof input.applicationName) && "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description)
|
|
813
|
+
application.roles.push(...(() => { const _io0 = input => (undefined === input.applicationName || "string" === typeof input.applicationName) && "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description) && Object.keys(input).every(key => {
|
|
814
|
+
if (["applicationName", "name", "description"].some(prop => key === prop))
|
|
815
|
+
return true;
|
|
816
|
+
const value = input[key];
|
|
817
|
+
if (undefined === value)
|
|
818
|
+
return true;
|
|
819
|
+
return "string" === typeof value;
|
|
820
|
+
}); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
693
821
|
method: "typia.assert",
|
|
694
822
|
path: _path + ".applicationName",
|
|
695
823
|
expected: "(string | undefined)",
|
|
@@ -704,28 +832,40 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
704
832
|
path: _path + ".description",
|
|
705
833
|
expected: "(string | undefined)",
|
|
706
834
|
value: input.description
|
|
707
|
-
}, _errorFactory))
|
|
835
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
836
|
+
if (["applicationName", "name", "description"].some(prop => key === prop))
|
|
837
|
+
return true;
|
|
838
|
+
const value = input[key];
|
|
839
|
+
if (undefined === value)
|
|
840
|
+
return true;
|
|
841
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
842
|
+
method: "typia.assert",
|
|
843
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
844
|
+
expected: "string",
|
|
845
|
+
value: value
|
|
846
|
+
}, _errorFactory);
|
|
847
|
+
})); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
708
848
|
if (false === __is(input)) {
|
|
709
849
|
_errorFactory = errorFactory;
|
|
710
850
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
711
851
|
method: "typia.assert",
|
|
712
852
|
path: _path + "",
|
|
713
|
-
expected: "Array<CreateRoleDTO>",
|
|
853
|
+
expected: "Array<CreateRoleDTO & { [x: string]: string; }>",
|
|
714
854
|
value: input
|
|
715
855
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
716
856
|
method: "typia.assert",
|
|
717
857
|
path: _path + "[" + _index2 + "]",
|
|
718
|
-
expected: "CreateRoleDTO",
|
|
858
|
+
expected: "CreateRoleDTO & { [x: string]: string; }",
|
|
719
859
|
value: elem
|
|
720
860
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
721
861
|
method: "typia.assert",
|
|
722
862
|
path: _path + "[" + _index2 + "]",
|
|
723
|
-
expected: "CreateRoleDTO",
|
|
863
|
+
expected: "CreateRoleDTO & { [x: string]: string; }",
|
|
724
864
|
value: elem
|
|
725
865
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
726
866
|
method: "typia.assert",
|
|
727
867
|
path: _path + "",
|
|
728
|
-
expected: "Array<CreateRoleDTO>",
|
|
868
|
+
expected: "Array<CreateRoleDTO & { [x: string]: string; }>",
|
|
729
869
|
value: input
|
|
730
870
|
}, _errorFactory))(input, "$input", true);
|
|
731
871
|
}
|
|
@@ -736,10 +876,224 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
736
876
|
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_ROLES)} file: ${e}`);
|
|
737
877
|
}
|
|
738
878
|
}
|
|
879
|
+
if (existsSync((0, path_1.join)(path, FILE_JOBS))) {
|
|
880
|
+
const data = (0, io_1.readJSONFile)((0, path_1.join)(path, FILE_JOBS));
|
|
881
|
+
try {
|
|
882
|
+
application.jobs.push(...(() => { const _io0 = input => "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description) && (undefined === input.enabled || "boolean" === typeof input.enabled) && "string" === typeof input.pattern && "string" === typeof input.taskType && ("object" === typeof input.taskConfig && null !== input.taskConfig && false === Array.isArray(input.taskConfig) && _io1(input.taskConfig)); const _io1 = input => Object.keys(input).every(key => {
|
|
883
|
+
const value = input[key];
|
|
884
|
+
if (undefined === value)
|
|
885
|
+
return true;
|
|
886
|
+
return true;
|
|
887
|
+
}); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
888
|
+
method: "typia.assert",
|
|
889
|
+
path: _path + ".name",
|
|
890
|
+
expected: "string",
|
|
891
|
+
value: input.name
|
|
892
|
+
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
893
|
+
method: "typia.assert",
|
|
894
|
+
path: _path + ".description",
|
|
895
|
+
expected: "(string | undefined)",
|
|
896
|
+
value: input.description
|
|
897
|
+
}, _errorFactory)) && (undefined === input.enabled || "boolean" === typeof input.enabled || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
898
|
+
method: "typia.assert",
|
|
899
|
+
path: _path + ".enabled",
|
|
900
|
+
expected: "(boolean | undefined)",
|
|
901
|
+
value: input.enabled
|
|
902
|
+
}, _errorFactory)) && ("string" === typeof input.pattern || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
903
|
+
method: "typia.assert",
|
|
904
|
+
path: _path + ".pattern",
|
|
905
|
+
expected: "string",
|
|
906
|
+
value: input.pattern
|
|
907
|
+
}, _errorFactory)) && ("string" === typeof input.taskType || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
908
|
+
method: "typia.assert",
|
|
909
|
+
path: _path + ".taskType",
|
|
910
|
+
expected: "string",
|
|
911
|
+
value: input.taskType
|
|
912
|
+
}, _errorFactory)) && (("object" === typeof input.taskConfig && null !== input.taskConfig && false === Array.isArray(input.taskConfig) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
913
|
+
method: "typia.assert",
|
|
914
|
+
path: _path + ".taskConfig",
|
|
915
|
+
expected: "Record<string, any>",
|
|
916
|
+
value: input.taskConfig
|
|
917
|
+
}, _errorFactory)) && _ao1(input.taskConfig, _path + ".taskConfig", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
918
|
+
method: "typia.assert",
|
|
919
|
+
path: _path + ".taskConfig",
|
|
920
|
+
expected: "Record<string, any>",
|
|
921
|
+
value: input.taskConfig
|
|
922
|
+
}, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
923
|
+
const value = input[key];
|
|
924
|
+
if (undefined === value)
|
|
925
|
+
return true;
|
|
926
|
+
return true;
|
|
927
|
+
}); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
928
|
+
if (false === __is(input)) {
|
|
929
|
+
_errorFactory = errorFactory;
|
|
930
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
931
|
+
method: "typia.assert",
|
|
932
|
+
path: _path + "",
|
|
933
|
+
expected: "Array<BootstrapJob>",
|
|
934
|
+
value: input
|
|
935
|
+
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
936
|
+
method: "typia.assert",
|
|
937
|
+
path: _path + "[" + _index2 + "]",
|
|
938
|
+
expected: "BootstrapJob",
|
|
939
|
+
value: elem
|
|
940
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
941
|
+
method: "typia.assert",
|
|
942
|
+
path: _path + "[" + _index2 + "]",
|
|
943
|
+
expected: "BootstrapJob",
|
|
944
|
+
value: elem
|
|
945
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
946
|
+
method: "typia.assert",
|
|
947
|
+
path: _path + "",
|
|
948
|
+
expected: "Array<BootstrapJob>",
|
|
949
|
+
value: input
|
|
950
|
+
}, _errorFactory))(input, "$input", true);
|
|
951
|
+
}
|
|
952
|
+
return input;
|
|
953
|
+
}; })()(data));
|
|
954
|
+
}
|
|
955
|
+
catch (e) {
|
|
956
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_JOBS)} file: ${e}`);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
if (existsSync((0, path_1.join)(path, FILE_FEATURE_FLAGS))) {
|
|
960
|
+
try {
|
|
961
|
+
const rawFlags = (() => { const _io0 = input => "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description) && (undefined === input.enabled || "boolean" === typeof input.enabled) && (undefined === input.applicationName || "string" === typeof input.applicationName) && (undefined === input.constraints || Array.isArray(input.constraints) && input.constraints.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.contextName && "string" === typeof input.operator && (undefined === input.values || Array.isArray(input.values) && input.values.every(elem => "string" === typeof elem)); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
962
|
+
method: "typia.assert",
|
|
963
|
+
path: _path + ".name",
|
|
964
|
+
expected: "string",
|
|
965
|
+
value: input.name
|
|
966
|
+
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
967
|
+
method: "typia.assert",
|
|
968
|
+
path: _path + ".description",
|
|
969
|
+
expected: "(string | undefined)",
|
|
970
|
+
value: input.description
|
|
971
|
+
}, _errorFactory)) && (undefined === input.enabled || "boolean" === typeof input.enabled || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
972
|
+
method: "typia.assert",
|
|
973
|
+
path: _path + ".enabled",
|
|
974
|
+
expected: "(boolean | undefined)",
|
|
975
|
+
value: input.enabled
|
|
976
|
+
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
977
|
+
method: "typia.assert",
|
|
978
|
+
path: _path + ".applicationName",
|
|
979
|
+
expected: "(string | undefined)",
|
|
980
|
+
value: input.applicationName
|
|
981
|
+
}, _errorFactory)) && (undefined === input.constraints || (Array.isArray(input.constraints) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
982
|
+
method: "typia.assert",
|
|
983
|
+
path: _path + ".constraints",
|
|
984
|
+
expected: "(Array<__type> | undefined)",
|
|
985
|
+
value: input.constraints
|
|
986
|
+
}, _errorFactory)) && input.constraints.every((elem, _index5) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
987
|
+
method: "typia.assert",
|
|
988
|
+
path: _path + ".constraints[" + _index5 + "]",
|
|
989
|
+
expected: "__type",
|
|
990
|
+
value: elem
|
|
991
|
+
}, _errorFactory)) && _ao1(elem, _path + ".constraints[" + _index5 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
992
|
+
method: "typia.assert",
|
|
993
|
+
path: _path + ".constraints[" + _index5 + "]",
|
|
994
|
+
expected: "__type",
|
|
995
|
+
value: elem
|
|
996
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
997
|
+
method: "typia.assert",
|
|
998
|
+
path: _path + ".constraints",
|
|
999
|
+
expected: "(Array<__type> | undefined)",
|
|
1000
|
+
value: input.constraints
|
|
1001
|
+
}, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.contextName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1002
|
+
method: "typia.assert",
|
|
1003
|
+
path: _path + ".contextName",
|
|
1004
|
+
expected: "string",
|
|
1005
|
+
value: input.contextName
|
|
1006
|
+
}, _errorFactory)) && ("string" === typeof input.operator || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1007
|
+
method: "typia.assert",
|
|
1008
|
+
path: _path + ".operator",
|
|
1009
|
+
expected: "string",
|
|
1010
|
+
value: input.operator
|
|
1011
|
+
}, _errorFactory)) && (undefined === input.values || (Array.isArray(input.values) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1012
|
+
method: "typia.assert",
|
|
1013
|
+
path: _path + ".values",
|
|
1014
|
+
expected: "(Array<string> | undefined)",
|
|
1015
|
+
value: input.values
|
|
1016
|
+
}, _errorFactory)) && input.values.every((elem, _index6) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1017
|
+
method: "typia.assert",
|
|
1018
|
+
path: _path + ".values[" + _index6 + "]",
|
|
1019
|
+
expected: "string",
|
|
1020
|
+
value: elem
|
|
1021
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1022
|
+
method: "typia.assert",
|
|
1023
|
+
path: _path + ".values",
|
|
1024
|
+
expected: "(Array<string> | undefined)",
|
|
1025
|
+
value: input.values
|
|
1026
|
+
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
1027
|
+
if (false === __is(input)) {
|
|
1028
|
+
_errorFactory = errorFactory;
|
|
1029
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
1030
|
+
method: "typia.assert",
|
|
1031
|
+
path: _path + "",
|
|
1032
|
+
expected: "Array<BootstrapFeatureFlag>",
|
|
1033
|
+
value: input
|
|
1034
|
+
}, _errorFactory)) && input.every((elem, _index4) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
1035
|
+
method: "typia.assert",
|
|
1036
|
+
path: _path + "[" + _index4 + "]",
|
|
1037
|
+
expected: "BootstrapFeatureFlag",
|
|
1038
|
+
value: elem
|
|
1039
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index4 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
1040
|
+
method: "typia.assert",
|
|
1041
|
+
path: _path + "[" + _index4 + "]",
|
|
1042
|
+
expected: "BootstrapFeatureFlag",
|
|
1043
|
+
value: elem
|
|
1044
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
1045
|
+
method: "typia.assert",
|
|
1046
|
+
path: _path + "",
|
|
1047
|
+
expected: "Array<BootstrapFeatureFlag>",
|
|
1048
|
+
value: input
|
|
1049
|
+
}, _errorFactory))(input, "$input", true);
|
|
1050
|
+
}
|
|
1051
|
+
return input;
|
|
1052
|
+
}; })()((0, io_1.readJSONFile)((0, path_1.join)(path, FILE_FEATURE_FLAGS)));
|
|
1053
|
+
application.featureFlags = rawFlags.map(flag => (Object.assign(Object.assign({}, flag), { applicationName: application.name })));
|
|
1054
|
+
}
|
|
1055
|
+
catch (e) {
|
|
1056
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_FEATURE_FLAGS)} file: ${e}`);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
739
1059
|
return application;
|
|
740
1060
|
};
|
|
741
1061
|
const readApplicationItems = (path, fileName, application, fieldName = 'applicationName') => (0, io_1.readJSONFile)((0, path_1.join)(path, fileName))
|
|
742
|
-
.map(role => {
|
|
743
|
-
|
|
744
|
-
|
|
1062
|
+
.map(role => (Object.assign(Object.assign({}, role), { [fieldName]: application.name })));
|
|
1063
|
+
/**
|
|
1064
|
+
* Migrates the legacy "Global" folder content into the "platform" folder.
|
|
1065
|
+
* For each file in "Global":
|
|
1066
|
+
* - If the file does not exist in "platform", it is created with the same content.
|
|
1067
|
+
* - If the file already exists in "platform", its JSON array content is merged (Global appended at the end).
|
|
1068
|
+
* The "Global" folder itself is left untouched after migration.
|
|
1069
|
+
*/
|
|
1070
|
+
const migrateGlobalFolderToPlatform = (basePath) => {
|
|
1071
|
+
const { existsSync, readdirSync, mkdirSync, writeFileSync, rmSync } = require("fs");
|
|
1072
|
+
const globalPath = (0, path_1.join)(basePath, FOLDER_GLOBAL);
|
|
1073
|
+
if (!existsSync(globalPath))
|
|
1074
|
+
return;
|
|
1075
|
+
const platformPath = (0, path_1.join)(basePath, pae_core_1.PLATFORM_APPLICATION_NAME);
|
|
1076
|
+
if (!existsSync(platformPath)) {
|
|
1077
|
+
mkdirSync(platformPath, { recursive: true });
|
|
1078
|
+
}
|
|
1079
|
+
console.log(`Migrating [${FOLDER_GLOBAL}] folder content into [${pae_core_1.PLATFORM_APPLICATION_NAME}]...`);
|
|
1080
|
+
const files = readdirSync(globalPath, { withFileTypes: true });
|
|
1081
|
+
for (const file of files) {
|
|
1082
|
+
if (file.isDirectory())
|
|
1083
|
+
continue;
|
|
1084
|
+
const globalFilePath = (0, path_1.join)(globalPath, file.name);
|
|
1085
|
+
const platformFilePath = (0, path_1.join)(platformPath, file.name);
|
|
1086
|
+
const globalContent = (0, io_1.readJSONFile)(globalFilePath);
|
|
1087
|
+
if (existsSync(platformFilePath)) {
|
|
1088
|
+
const platformContent = (0, io_1.readJSONFile)(platformFilePath);
|
|
1089
|
+
writeFileSync(platformFilePath, JSON.stringify([...platformContent, ...globalContent], null, 2));
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
writeFileSync(platformFilePath, JSON.stringify(globalContent, null, 2));
|
|
1093
|
+
}
|
|
1094
|
+
console.log(` Migrated [${FOLDER_GLOBAL}/${file.name}] -> [${pae_core_1.PLATFORM_APPLICATION_NAME}/${file.name}]`);
|
|
1095
|
+
}
|
|
1096
|
+
rmSync(globalPath, { recursive: true, force: true });
|
|
1097
|
+
console.log(`Removed legacy [${FOLDER_GLOBAL}] folder`);
|
|
1098
|
+
};
|
|
745
1099
|
//# sourceMappingURL=read-bootstrap-applications.js.map
|