@bluealba/pae-bootstrap-lib 2.1.3-develop-94 → 2.1.3-develop-112
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/dist/src/bootstrap/bootstrap-platform.js +1 -1
- package/dist/src/bootstrap/bootstrap-platform.js.map +1 -1
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts +1 -1
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts.map +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.d.ts.map +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.js +185 -56
- package/dist/src/bootstrap/read-bootstrap-applications.js.map +1 -1
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ const bootstrapPlatform = (options) => __awaiter(void 0, void 0, void 0, functio
|
|
|
35
35
|
// Group modules by application name
|
|
36
36
|
const modulesByApp = new Map();
|
|
37
37
|
transformedModules.forEach(module => {
|
|
38
|
-
const appName = module.application || pae_core_1.
|
|
38
|
+
const appName = module.application || pae_core_1.PLATFORM_APPLICATION_NAME;
|
|
39
39
|
if (!modulesByApp.has(appName)) {
|
|
40
40
|
modulesByApp.set(appName, []);
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-platform.js","sourceRoot":"","sources":["../../../src/bootstrap/bootstrap-platform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"bootstrap-platform.js","sourceRoot":"","sources":["../../../src/bootstrap/bootstrap-platform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAwE;AACxE,+EAA4E;AA+B5E;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAAO,OAAyB,EAAE,EAAE;;IACnE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,kLAAkL,CAAC,CAAA;IACrM,CAAC;IAED,OAAO,CAAC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0B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACzD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAA,CAAC;AAtEW,QAAA,iBAAiB,qBAsE5B"}
|
|
@@ -49,7 +49,7 @@ export interface BootstrapSyncMetadata {
|
|
|
49
49
|
export type BootstrapModule = CreateOrUpdateModule;
|
|
50
50
|
export type BootstrapApplication = CreateApplicationDTO & {
|
|
51
51
|
modules: BootstrapModule[];
|
|
52
|
-
operations:
|
|
52
|
+
operations: OperationAuthzBootstrap[];
|
|
53
53
|
roles: CreateRoleDTO[];
|
|
54
54
|
modulesConfig: ModuleConfig[];
|
|
55
55
|
jobs: BootstrapJob[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-sync-metadata.interface.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/domain/bootstrap-sync-metadata.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;I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,GAAG;IACxD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"bootstrap-sync-metadata.interface.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/domain/bootstrap-sync-metadata.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,uBAAwB,SACvC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,EAC3C,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-bootstrap-applications.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/read-bootstrap-applications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-bootstrap-applications.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/read-bootstrap-applications.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAKL,iBAAiB,EAGlB,MAAM,4CAA4C,CAAC;AAapD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,MAAM,EAAE,SAAS,gBAAgB,KAAG,iBA6CrF,CAAA"}
|
|
@@ -52,6 +52,7 @@ const FILE_MODULES = 'modules.json';
|
|
|
52
52
|
const FILE_MODULES_CONFIG = 'modules-config.json';
|
|
53
53
|
const FILE_ROLES = 'roles.json';
|
|
54
54
|
const FILE_JOBS = 'jobs.json';
|
|
55
|
+
const FOLDER_GLOBAL = 'global';
|
|
55
56
|
/**
|
|
56
57
|
* Inspects the filesystem reading all application definitions
|
|
57
58
|
* NOTE: this is a really quick implementation pretty raw.
|
|
@@ -59,11 +60,12 @@ const FILE_JOBS = 'jobs.json';
|
|
|
59
60
|
* Feel free to add tests (:P) and improve it.
|
|
60
61
|
*/
|
|
61
62
|
const readPlatformBootstrapFolder = (path, options) => {
|
|
62
|
-
const
|
|
63
|
-
const { readdirSync } = require("fs");
|
|
63
|
+
const defaultApplication = createDefaultPlatformApplication();
|
|
64
|
+
const { readdirSync, existsSync } = require("fs");
|
|
65
|
+
migrateGlobalFolderToPlatform(path);
|
|
64
66
|
// @ts-ignore
|
|
65
67
|
return readdirSync(path, { withFileTypes: true }).reduce((acc, item) => {
|
|
66
|
-
var _a, _b, _c
|
|
68
|
+
var _a, _b, _c;
|
|
67
69
|
if (item.name === FILE_SHARED_LIBRARIES) {
|
|
68
70
|
try {
|
|
69
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, {
|
|
@@ -213,35 +215,39 @@ const readPlatformBootstrapFolder = (path, options) => {
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
else if (item.isDirectory()) {
|
|
218
|
+
if (item.name === FOLDER_GLOBAL) {
|
|
219
|
+
return acc;
|
|
220
|
+
}
|
|
216
221
|
if (((_a = options.exclude) !== null && _a !== void 0 ? _a : []).includes(item.name)) {
|
|
217
222
|
console.log(`Excluding application [${item.name}] !`);
|
|
218
223
|
return acc;
|
|
219
224
|
}
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
if ((_b = app.featureFlags) === null || _b === void 0 ? void 0 : _b.length) {
|
|
224
|
-
acc.featureFlags = [...((_c = acc.featureFlags) !== null && _c !== void 0 ? _c : []), ...app.featureFlags];
|
|
225
|
-
}
|
|
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`);
|
|
226
228
|
}
|
|
227
|
-
|
|
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];
|
|
229
233
|
}
|
|
230
234
|
}
|
|
231
235
|
return acc;
|
|
232
|
-
}, { applications: {
|
|
236
|
+
}, { applications: {} });
|
|
233
237
|
};
|
|
234
238
|
exports.readPlatformBootstrapFolder = readPlatformBootstrapFolder;
|
|
235
|
-
const
|
|
236
|
-
name: pae_core_1.
|
|
237
|
-
|
|
239
|
+
const createDefaultPlatformApplication = () => ({
|
|
240
|
+
name: pae_core_1.PLATFORM_APPLICATION_NAME,
|
|
241
|
+
displayName: "Platform",
|
|
242
|
+
description: "Platform Administration",
|
|
243
|
+
allowedByDefault: true,
|
|
238
244
|
modules: [],
|
|
239
245
|
operations: [],
|
|
240
246
|
roles: [],
|
|
241
247
|
modulesConfig: [],
|
|
242
248
|
jobs: []
|
|
243
249
|
});
|
|
244
|
-
const readApplicationDirectory = (path,
|
|
250
|
+
const readApplicationDirectory = (path, defaultApplication) => {
|
|
245
251
|
const { existsSync } = require("fs");
|
|
246
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, {
|
|
247
253
|
method: "typia.createAssert",
|
|
@@ -282,12 +288,19 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
282
288
|
}
|
|
283
289
|
return input;
|
|
284
290
|
}; })();
|
|
285
|
-
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: [] }) :
|
|
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;
|
|
286
292
|
// read modules setting the application (if app is not global)
|
|
287
293
|
if (existsSync((0, path_1.join)(path, FILE_MODULES))) {
|
|
288
294
|
const data = readApplicationItems(path, FILE_MODULES, application, 'application');
|
|
289
295
|
try {
|
|
290
|
-
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) && Object.keys(input).every(key => {
|
|
297
|
+
if (["name", "displayName", "type", "baseUrl", "service", "dependsOn", "commonPaths", "ui", "cloudFunction", "authorization", "application", "version", "isPublic", "id"].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 => {
|
|
291
304
|
const value = input[key];
|
|
292
305
|
if (undefined === value)
|
|
293
306
|
return true;
|
|
@@ -397,7 +410,19 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
397
410
|
path: _path + ".id",
|
|
398
411
|
expected: "(number | undefined)",
|
|
399
412
|
value: input.id
|
|
400
|
-
}, _errorFactory))
|
|
413
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
414
|
+
if (["name", "displayName", "type", "baseUrl", "service", "dependsOn", "commonPaths", "ui", "cloudFunction", "authorization", "application", "version", "isPublic", "id"].some(prop => key === prop))
|
|
415
|
+
return true;
|
|
416
|
+
const value = input[key];
|
|
417
|
+
if (undefined === value)
|
|
418
|
+
return true;
|
|
419
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
420
|
+
method: "typia.assert",
|
|
421
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
422
|
+
expected: "string",
|
|
423
|
+
value: value
|
|
424
|
+
}, _errorFactory);
|
|
425
|
+
})); const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.host || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
401
426
|
method: "typia.assert",
|
|
402
427
|
path: _path + ".host",
|
|
403
428
|
expected: "string",
|
|
@@ -563,22 +588,22 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
563
588
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
564
589
|
method: "typia.assert",
|
|
565
590
|
path: _path + "",
|
|
566
|
-
expected: "Array<CreateOrUpdateModule>",
|
|
591
|
+
expected: "Array<CreateOrUpdateModule & { [x: string]: string; }>",
|
|
567
592
|
value: input
|
|
568
593
|
}, _errorFactory)) && input.every((elem, _index7) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
569
594
|
method: "typia.assert",
|
|
570
595
|
path: _path + "[" + _index7 + "]",
|
|
571
|
-
expected: "CreateOrUpdateModule",
|
|
596
|
+
expected: "CreateOrUpdateModule & { [x: string]: string; }",
|
|
572
597
|
value: elem
|
|
573
598
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index7 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
574
599
|
method: "typia.assert",
|
|
575
600
|
path: _path + "[" + _index7 + "]",
|
|
576
|
-
expected: "CreateOrUpdateModule",
|
|
601
|
+
expected: "CreateOrUpdateModule & { [x: string]: string; }",
|
|
577
602
|
value: elem
|
|
578
603
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
579
604
|
method: "typia.assert",
|
|
580
605
|
path: _path + "",
|
|
581
|
-
expected: "Array<CreateOrUpdateModule>",
|
|
606
|
+
expected: "Array<CreateOrUpdateModule & { [x: string]: string; }>",
|
|
582
607
|
value: input
|
|
583
608
|
}, _errorFactory))(input, "$input", true);
|
|
584
609
|
}
|
|
@@ -592,7 +617,14 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
592
617
|
if (existsSync((0, path_1.join)(path, FILE_MODULES_CONFIG))) {
|
|
593
618
|
const data = readApplicationItems(path, FILE_MODULES_CONFIG, application, 'application');
|
|
594
619
|
try {
|
|
595
|
-
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))
|
|
620
|
+
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 => {
|
|
621
|
+
if (["name", "config"].some(prop => key === prop))
|
|
622
|
+
return true;
|
|
623
|
+
const value = input[key];
|
|
624
|
+
if (undefined === value)
|
|
625
|
+
return true;
|
|
626
|
+
return "string" === typeof value;
|
|
627
|
+
}); const _io1 = input => Object.keys(input).every(key => {
|
|
596
628
|
const value = input[key];
|
|
597
629
|
if (undefined === value)
|
|
598
630
|
return true;
|
|
@@ -612,7 +644,19 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
612
644
|
path: _path + ".config",
|
|
613
645
|
expected: "Record<string, any>",
|
|
614
646
|
value: input.config
|
|
615
|
-
}, _errorFactory))
|
|
647
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
648
|
+
if (["name", "config"].some(prop => key === prop))
|
|
649
|
+
return true;
|
|
650
|
+
const value = input[key];
|
|
651
|
+
if (undefined === value)
|
|
652
|
+
return true;
|
|
653
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
654
|
+
method: "typia.assert",
|
|
655
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
656
|
+
expected: "string",
|
|
657
|
+
value: value
|
|
658
|
+
}, _errorFactory);
|
|
659
|
+
})); const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
616
660
|
const value = input[key];
|
|
617
661
|
if (undefined === value)
|
|
618
662
|
return true;
|
|
@@ -623,22 +667,22 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
623
667
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
624
668
|
method: "typia.assert",
|
|
625
669
|
path: _path + "",
|
|
626
|
-
expected: "Array<ModuleConfig>",
|
|
670
|
+
expected: "Array<ModuleConfig & { [x: string]: string; }>",
|
|
627
671
|
value: input
|
|
628
672
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
629
673
|
method: "typia.assert",
|
|
630
674
|
path: _path + "[" + _index2 + "]",
|
|
631
|
-
expected: "ModuleConfig",
|
|
675
|
+
expected: "ModuleConfig & { [x: string]: string; }",
|
|
632
676
|
value: elem
|
|
633
677
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
634
678
|
method: "typia.assert",
|
|
635
679
|
path: _path + "[" + _index2 + "]",
|
|
636
|
-
expected: "ModuleConfig",
|
|
680
|
+
expected: "ModuleConfig & { [x: string]: string; }",
|
|
637
681
|
value: elem
|
|
638
682
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
639
683
|
method: "typia.assert",
|
|
640
684
|
path: _path + "",
|
|
641
|
-
expected: "Array<ModuleConfig>",
|
|
685
|
+
expected: "Array<ModuleConfig & { [x: string]: string; }>",
|
|
642
686
|
value: input
|
|
643
687
|
}, _errorFactory))(input, "$input", true);
|
|
644
688
|
}
|
|
@@ -652,43 +696,77 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
652
696
|
if (existsSync((0, path_1.join)(path, FILE_OPERATIONS))) {
|
|
653
697
|
const data = readApplicationItems(path, FILE_OPERATIONS, application);
|
|
654
698
|
try {
|
|
655
|
-
application.operations.push(...(() => { const _io0 = input =>
|
|
699
|
+
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 => {
|
|
700
|
+
if (["roles", "name", "description", "applicationName"].some(prop => key === prop))
|
|
701
|
+
return true;
|
|
702
|
+
const value = input[key];
|
|
703
|
+
if (undefined === value)
|
|
704
|
+
return true;
|
|
705
|
+
return "string" === typeof value;
|
|
706
|
+
}); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.roles || (Array.isArray(input.roles) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
707
|
+
method: "typia.assert",
|
|
708
|
+
path: _path + ".roles",
|
|
709
|
+
expected: "(Array<string> | undefined)",
|
|
710
|
+
value: input.roles
|
|
711
|
+
}, _errorFactory)) && input.roles.every((elem, _index4) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
712
|
+
method: "typia.assert",
|
|
713
|
+
path: _path + ".roles[" + _index4 + "]",
|
|
714
|
+
expected: "string",
|
|
715
|
+
value: elem
|
|
716
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
717
|
+
method: "typia.assert",
|
|
718
|
+
path: _path + ".roles",
|
|
719
|
+
expected: "(Array<string> | undefined)",
|
|
720
|
+
value: input.roles
|
|
721
|
+
}, _errorFactory)) && ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
656
722
|
method: "typia.assert",
|
|
657
723
|
path: _path + ".name",
|
|
658
724
|
expected: "string",
|
|
659
725
|
value: input.name
|
|
660
|
-
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
661
|
-
method: "typia.assert",
|
|
662
|
-
path: _path + ".applicationName",
|
|
663
|
-
expected: "(string | undefined)",
|
|
664
|
-
value: input.applicationName
|
|
665
726
|
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
666
727
|
method: "typia.assert",
|
|
667
728
|
path: _path + ".description",
|
|
668
729
|
expected: "(string | undefined)",
|
|
669
730
|
value: input.description
|
|
670
|
-
}, _errorFactory))
|
|
731
|
+
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
732
|
+
method: "typia.assert",
|
|
733
|
+
path: _path + ".applicationName",
|
|
734
|
+
expected: "(string | undefined)",
|
|
735
|
+
value: input.applicationName
|
|
736
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
737
|
+
if (["roles", "name", "description", "applicationName"].some(prop => key === prop))
|
|
738
|
+
return true;
|
|
739
|
+
const value = input[key];
|
|
740
|
+
if (undefined === value)
|
|
741
|
+
return true;
|
|
742
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
743
|
+
method: "typia.assert",
|
|
744
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
745
|
+
expected: "string",
|
|
746
|
+
value: value
|
|
747
|
+
}, _errorFactory);
|
|
748
|
+
})); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
671
749
|
if (false === __is(input)) {
|
|
672
750
|
_errorFactory = errorFactory;
|
|
673
751
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
674
752
|
method: "typia.assert",
|
|
675
753
|
path: _path + "",
|
|
676
|
-
expected: "Array<
|
|
754
|
+
expected: "Array<OperationAuthzBootstrap & { [x: string]: string; }>",
|
|
677
755
|
value: input
|
|
678
|
-
}, _errorFactory)) && input.every((elem,
|
|
756
|
+
}, _errorFactory)) && input.every((elem, _index3) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
679
757
|
method: "typia.assert",
|
|
680
|
-
path: _path + "[" +
|
|
681
|
-
expected: "
|
|
758
|
+
path: _path + "[" + _index3 + "]",
|
|
759
|
+
expected: "OperationAuthzBootstrap & { [x: string]: string; }",
|
|
682
760
|
value: elem
|
|
683
|
-
}, _errorFactory)) && _ao0(elem, _path + "[" +
|
|
761
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index3 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
684
762
|
method: "typia.assert",
|
|
685
|
-
path: _path + "[" +
|
|
686
|
-
expected: "
|
|
763
|
+
path: _path + "[" + _index3 + "]",
|
|
764
|
+
expected: "OperationAuthzBootstrap & { [x: string]: string; }",
|
|
687
765
|
value: elem
|
|
688
766
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
689
767
|
method: "typia.assert",
|
|
690
768
|
path: _path + "",
|
|
691
|
-
expected: "Array<
|
|
769
|
+
expected: "Array<OperationAuthzBootstrap & { [x: string]: string; }>",
|
|
692
770
|
value: input
|
|
693
771
|
}, _errorFactory))(input, "$input", true);
|
|
694
772
|
}
|
|
@@ -702,7 +780,14 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
702
780
|
if (existsSync((0, path_1.join)(path, FILE_ROLES))) {
|
|
703
781
|
const data = readApplicationItems(path, FILE_ROLES, application);
|
|
704
782
|
try {
|
|
705
|
-
application.roles.push(...(() => { const _io0 = input => (undefined === input.applicationName || "string" === typeof input.applicationName) && "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description)
|
|
783
|
+
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 => {
|
|
784
|
+
if (["applicationName", "name", "description"].some(prop => key === prop))
|
|
785
|
+
return true;
|
|
786
|
+
const value = input[key];
|
|
787
|
+
if (undefined === value)
|
|
788
|
+
return true;
|
|
789
|
+
return "string" === typeof value;
|
|
790
|
+
}); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
706
791
|
method: "typia.assert",
|
|
707
792
|
path: _path + ".applicationName",
|
|
708
793
|
expected: "(string | undefined)",
|
|
@@ -717,28 +802,40 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
717
802
|
path: _path + ".description",
|
|
718
803
|
expected: "(string | undefined)",
|
|
719
804
|
value: input.description
|
|
720
|
-
}, _errorFactory))
|
|
805
|
+
}, _errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
806
|
+
if (["applicationName", "name", "description"].some(prop => key === prop))
|
|
807
|
+
return true;
|
|
808
|
+
const value = input[key];
|
|
809
|
+
if (undefined === value)
|
|
810
|
+
return true;
|
|
811
|
+
return "string" === typeof value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
812
|
+
method: "typia.assert",
|
|
813
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
814
|
+
expected: "string",
|
|
815
|
+
value: value
|
|
816
|
+
}, _errorFactory);
|
|
817
|
+
})); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
721
818
|
if (false === __is(input)) {
|
|
722
819
|
_errorFactory = errorFactory;
|
|
723
820
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
724
821
|
method: "typia.assert",
|
|
725
822
|
path: _path + "",
|
|
726
|
-
expected: "Array<CreateRoleDTO>",
|
|
823
|
+
expected: "Array<CreateRoleDTO & { [x: string]: string; }>",
|
|
727
824
|
value: input
|
|
728
825
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
729
826
|
method: "typia.assert",
|
|
730
827
|
path: _path + "[" + _index2 + "]",
|
|
731
|
-
expected: "CreateRoleDTO",
|
|
828
|
+
expected: "CreateRoleDTO & { [x: string]: string; }",
|
|
732
829
|
value: elem
|
|
733
830
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
734
831
|
method: "typia.assert",
|
|
735
832
|
path: _path + "[" + _index2 + "]",
|
|
736
|
-
expected: "CreateRoleDTO",
|
|
833
|
+
expected: "CreateRoleDTO & { [x: string]: string; }",
|
|
737
834
|
value: elem
|
|
738
835
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
739
836
|
method: "typia.assert",
|
|
740
837
|
path: _path + "",
|
|
741
|
-
expected: "Array<CreateRoleDTO>",
|
|
838
|
+
expected: "Array<CreateRoleDTO & { [x: string]: string; }>",
|
|
742
839
|
value: input
|
|
743
840
|
}, _errorFactory))(input, "$input", true);
|
|
744
841
|
}
|
|
@@ -923,9 +1020,7 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
923
1020
|
}
|
|
924
1021
|
return input;
|
|
925
1022
|
}; })()((0, io_1.readJSONFile)((0, path_1.join)(path, FILE_FEATURE_FLAGS)));
|
|
926
|
-
application.featureFlags = rawFlags.map(flag => application.name
|
|
927
|
-
? flag
|
|
928
|
-
: Object.assign(Object.assign({}, flag), { applicationName: application.name }));
|
|
1023
|
+
application.featureFlags = rawFlags.map(flag => (Object.assign(Object.assign({}, flag), { applicationName: application.name })));
|
|
929
1024
|
}
|
|
930
1025
|
catch (e) {
|
|
931
1026
|
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_FEATURE_FLAGS)} file: ${e}`);
|
|
@@ -934,7 +1029,41 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
934
1029
|
return application;
|
|
935
1030
|
};
|
|
936
1031
|
const readApplicationItems = (path, fileName, application, fieldName = 'applicationName') => (0, io_1.readJSONFile)((0, path_1.join)(path, fileName))
|
|
937
|
-
.map(role => {
|
|
938
|
-
|
|
939
|
-
|
|
1032
|
+
.map(role => (Object.assign(Object.assign({}, role), { [fieldName]: application.name })));
|
|
1033
|
+
/**
|
|
1034
|
+
* Migrates the legacy "Global" folder content into the "platform" folder.
|
|
1035
|
+
* For each file in "Global":
|
|
1036
|
+
* - If the file does not exist in "platform", it is created with the same content.
|
|
1037
|
+
* - If the file already exists in "platform", its JSON array content is merged (Global appended at the end).
|
|
1038
|
+
* The "Global" folder itself is left untouched after migration.
|
|
1039
|
+
*/
|
|
1040
|
+
const migrateGlobalFolderToPlatform = (basePath) => {
|
|
1041
|
+
const { existsSync, readdirSync, mkdirSync, writeFileSync, rmSync } = require("fs");
|
|
1042
|
+
const globalPath = (0, path_1.join)(basePath, FOLDER_GLOBAL);
|
|
1043
|
+
if (!existsSync(globalPath))
|
|
1044
|
+
return;
|
|
1045
|
+
const platformPath = (0, path_1.join)(basePath, pae_core_1.PLATFORM_APPLICATION_NAME);
|
|
1046
|
+
if (!existsSync(platformPath)) {
|
|
1047
|
+
mkdirSync(platformPath, { recursive: true });
|
|
1048
|
+
}
|
|
1049
|
+
console.log(`Migrating [${FOLDER_GLOBAL}] folder content into [${pae_core_1.PLATFORM_APPLICATION_NAME}]...`);
|
|
1050
|
+
const files = readdirSync(globalPath, { withFileTypes: true });
|
|
1051
|
+
for (const file of files) {
|
|
1052
|
+
if (file.isDirectory())
|
|
1053
|
+
continue;
|
|
1054
|
+
const globalFilePath = (0, path_1.join)(globalPath, file.name);
|
|
1055
|
+
const platformFilePath = (0, path_1.join)(platformPath, file.name);
|
|
1056
|
+
const globalContent = (0, io_1.readJSONFile)(globalFilePath);
|
|
1057
|
+
if (existsSync(platformFilePath)) {
|
|
1058
|
+
const platformContent = (0, io_1.readJSONFile)(platformFilePath);
|
|
1059
|
+
writeFileSync(platformFilePath, JSON.stringify([...platformContent, ...globalContent], null, 2));
|
|
1060
|
+
}
|
|
1061
|
+
else {
|
|
1062
|
+
writeFileSync(platformFilePath, JSON.stringify(globalContent, null, 2));
|
|
1063
|
+
}
|
|
1064
|
+
console.log(` Migrated [${FOLDER_GLOBAL}/${file.name}] -> [${pae_core_1.PLATFORM_APPLICATION_NAME}/${file.name}]`);
|
|
1065
|
+
}
|
|
1066
|
+
rmSync(globalPath, { recursive: true, force: true });
|
|
1067
|
+
console.log(`Removed legacy [${FOLDER_GLOBAL}] folder`);
|
|
1068
|
+
};
|
|
940
1069
|
//# sourceMappingURL=read-bootstrap-applications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-bootstrap-applications.js","sourceRoot":"","sources":["../../../src/bootstrap/read-bootstrap-applications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"read-bootstrap-applications.js","sourceRoot":"","sources":["../../../src/bootstrap/read-bootstrap-applications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAI4B;AAC5B,+BAA4B;AAC5B,kDAA0B;AAC1B,oCAA2C;AAY3C,cAAc;AACd,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAC3C,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,UAAU,GAAG,YAAY,CAAA;AAC/B,MAAM,SAAS,GAAG,WAAW,CAAA;AAC7B,MAAM,aAAa,GAAG,QAAQ,CAAA;AAE9B;;;;;GAKG;AACI,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAE,OAAyB,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