@bluealba/pae-bootstrap-lib 2.1.3-develop-94 → 2.1.3-develop-117
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/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.map +1 -1
- package/dist/src/bootstrap/bootstrap-platform.js +4 -2
- package/dist/src/bootstrap/bootstrap-platform.js.map +1 -1
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts +5 -3
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts.map +1 -1
- package/dist/src/bootstrap/domain/domain-validation.test.js +160 -64
- package/dist/src/bootstrap/domain/domain-validation.test.js.map +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.d.ts.map +1 -1
- package/dist/src/bootstrap/read-bootstrap-applications.js +216 -57
- package/dist/src/bootstrap/read-bootstrap-applications.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-validation.test.js","sourceRoot":"","sources":["../../../../src/bootstrap/domain/domain-validation.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAI1B,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IAExD,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,WAAW,GAA0B;YACzC,UAAU,EAAE;gBACV,QAAQ,EAAE,MAAM;aACjB;SACuB,CAA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CAAC,eAAe;iBACpC;aACF;YACD,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,EAAE;YACd,eAAe,EAAE,EAAE;YACnB,aAAa,EAAE,EAAE;YACjB,UAAU,EAAE;gBACV,QAAQ,EAAE,KAAK;aAChB;SACF,CAAC;QAEF,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAyC,+BAA+B,CAAC,CAAC;QAEtF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -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,17 +288,24 @@ 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) && (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 => {
|
|
291
304
|
const value = input[key];
|
|
292
305
|
if (undefined === value)
|
|
293
306
|
return true;
|
|
294
307
|
return true;
|
|
295
|
-
}); 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 _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
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, {
|
|
296
309
|
method: "typia.assert",
|
|
297
310
|
path: _path + ".name",
|
|
298
311
|
expected: "string",
|
|
@@ -397,7 +410,29 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
397
410
|
path: _path + ".id",
|
|
398
411
|
expected: "(number | undefined)",
|
|
399
412
|
value: input.id
|
|
400
|
-
}, _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, {
|
|
401
436
|
method: "typia.assert",
|
|
402
437
|
path: _path + ".host",
|
|
403
438
|
expected: "string",
|
|
@@ -557,28 +592,48 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
557
592
|
path: _path + ".operations",
|
|
558
593
|
expected: "Array<string>",
|
|
559
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
|
|
560
615
|
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
561
616
|
if (false === __is(input)) {
|
|
562
617
|
_errorFactory = errorFactory;
|
|
563
618
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
564
619
|
method: "typia.assert",
|
|
565
620
|
path: _path + "",
|
|
566
|
-
expected: "Array<CreateOrUpdateModule>",
|
|
621
|
+
expected: "Array<CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }>",
|
|
567
622
|
value: input
|
|
568
623
|
}, _errorFactory)) && input.every((elem, _index7) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
569
624
|
method: "typia.assert",
|
|
570
625
|
path: _path + "[" + _index7 + "]",
|
|
571
|
-
expected: "CreateOrUpdateModule",
|
|
626
|
+
expected: "CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }",
|
|
572
627
|
value: elem
|
|
573
628
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index7 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
574
629
|
method: "typia.assert",
|
|
575
630
|
path: _path + "[" + _index7 + "]",
|
|
576
|
-
expected: "CreateOrUpdateModule",
|
|
631
|
+
expected: "CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }",
|
|
577
632
|
value: elem
|
|
578
633
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
579
634
|
method: "typia.assert",
|
|
580
635
|
path: _path + "",
|
|
581
|
-
expected: "Array<CreateOrUpdateModule>",
|
|
636
|
+
expected: "Array<CreateOrUpdateModule & { serviceLocal?: Partial<ServiceConfig> | undefined; } & { [x: string]: string; }>",
|
|
582
637
|
value: input
|
|
583
638
|
}, _errorFactory))(input, "$input", true);
|
|
584
639
|
}
|
|
@@ -592,7 +647,14 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
592
647
|
if (existsSync((0, path_1.join)(path, FILE_MODULES_CONFIG))) {
|
|
593
648
|
const data = readApplicationItems(path, FILE_MODULES_CONFIG, application, 'application');
|
|
594
649
|
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))
|
|
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 => {
|
|
596
658
|
const value = input[key];
|
|
597
659
|
if (undefined === value)
|
|
598
660
|
return true;
|
|
@@ -612,7 +674,19 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
612
674
|
path: _path + ".config",
|
|
613
675
|
expected: "Record<string, any>",
|
|
614
676
|
value: input.config
|
|
615
|
-
}, _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 => {
|
|
616
690
|
const value = input[key];
|
|
617
691
|
if (undefined === value)
|
|
618
692
|
return true;
|
|
@@ -623,22 +697,22 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
623
697
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
624
698
|
method: "typia.assert",
|
|
625
699
|
path: _path + "",
|
|
626
|
-
expected: "Array<ModuleConfig>",
|
|
700
|
+
expected: "Array<ModuleConfig & { [x: string]: string; }>",
|
|
627
701
|
value: input
|
|
628
702
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
629
703
|
method: "typia.assert",
|
|
630
704
|
path: _path + "[" + _index2 + "]",
|
|
631
|
-
expected: "ModuleConfig",
|
|
705
|
+
expected: "ModuleConfig & { [x: string]: string; }",
|
|
632
706
|
value: elem
|
|
633
707
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
634
708
|
method: "typia.assert",
|
|
635
709
|
path: _path + "[" + _index2 + "]",
|
|
636
|
-
expected: "ModuleConfig",
|
|
710
|
+
expected: "ModuleConfig & { [x: string]: string; }",
|
|
637
711
|
value: elem
|
|
638
712
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
639
713
|
method: "typia.assert",
|
|
640
714
|
path: _path + "",
|
|
641
|
-
expected: "Array<ModuleConfig>",
|
|
715
|
+
expected: "Array<ModuleConfig & { [x: string]: string; }>",
|
|
642
716
|
value: input
|
|
643
717
|
}, _errorFactory))(input, "$input", true);
|
|
644
718
|
}
|
|
@@ -652,43 +726,77 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
652
726
|
if (existsSync((0, path_1.join)(path, FILE_OPERATIONS))) {
|
|
653
727
|
const data = readApplicationItems(path, FILE_OPERATIONS, application);
|
|
654
728
|
try {
|
|
655
|
-
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, {
|
|
656
752
|
method: "typia.assert",
|
|
657
753
|
path: _path + ".name",
|
|
658
754
|
expected: "string",
|
|
659
755
|
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
756
|
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
666
757
|
method: "typia.assert",
|
|
667
758
|
path: _path + ".description",
|
|
668
759
|
expected: "(string | undefined)",
|
|
669
760
|
value: input.description
|
|
670
|
-
}, _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) => {
|
|
671
779
|
if (false === __is(input)) {
|
|
672
780
|
_errorFactory = errorFactory;
|
|
673
781
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
674
782
|
method: "typia.assert",
|
|
675
783
|
path: _path + "",
|
|
676
|
-
expected: "Array<
|
|
784
|
+
expected: "Array<OperationAuthzBootstrap & { [x: string]: string; }>",
|
|
677
785
|
value: input
|
|
678
|
-
}, _errorFactory)) && input.every((elem,
|
|
786
|
+
}, _errorFactory)) && input.every((elem, _index3) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
679
787
|
method: "typia.assert",
|
|
680
|
-
path: _path + "[" +
|
|
681
|
-
expected: "
|
|
788
|
+
path: _path + "[" + _index3 + "]",
|
|
789
|
+
expected: "OperationAuthzBootstrap & { [x: string]: string; }",
|
|
682
790
|
value: elem
|
|
683
|
-
}, _errorFactory)) && _ao0(elem, _path + "[" +
|
|
791
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index3 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
684
792
|
method: "typia.assert",
|
|
685
|
-
path: _path + "[" +
|
|
686
|
-
expected: "
|
|
793
|
+
path: _path + "[" + _index3 + "]",
|
|
794
|
+
expected: "OperationAuthzBootstrap & { [x: string]: string; }",
|
|
687
795
|
value: elem
|
|
688
796
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
689
797
|
method: "typia.assert",
|
|
690
798
|
path: _path + "",
|
|
691
|
-
expected: "Array<
|
|
799
|
+
expected: "Array<OperationAuthzBootstrap & { [x: string]: string; }>",
|
|
692
800
|
value: input
|
|
693
801
|
}, _errorFactory))(input, "$input", true);
|
|
694
802
|
}
|
|
@@ -702,7 +810,14 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
702
810
|
if (existsSync((0, path_1.join)(path, FILE_ROLES))) {
|
|
703
811
|
const data = readApplicationItems(path, FILE_ROLES, application);
|
|
704
812
|
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)
|
|
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, {
|
|
706
821
|
method: "typia.assert",
|
|
707
822
|
path: _path + ".applicationName",
|
|
708
823
|
expected: "(string | undefined)",
|
|
@@ -717,28 +832,40 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
717
832
|
path: _path + ".description",
|
|
718
833
|
expected: "(string | undefined)",
|
|
719
834
|
value: input.description
|
|
720
|
-
}, _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) => {
|
|
721
848
|
if (false === __is(input)) {
|
|
722
849
|
_errorFactory = errorFactory;
|
|
723
850
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
724
851
|
method: "typia.assert",
|
|
725
852
|
path: _path + "",
|
|
726
|
-
expected: "Array<CreateRoleDTO>",
|
|
853
|
+
expected: "Array<CreateRoleDTO & { [x: string]: string; }>",
|
|
727
854
|
value: input
|
|
728
855
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
729
856
|
method: "typia.assert",
|
|
730
857
|
path: _path + "[" + _index2 + "]",
|
|
731
|
-
expected: "CreateRoleDTO",
|
|
858
|
+
expected: "CreateRoleDTO & { [x: string]: string; }",
|
|
732
859
|
value: elem
|
|
733
860
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
734
861
|
method: "typia.assert",
|
|
735
862
|
path: _path + "[" + _index2 + "]",
|
|
736
|
-
expected: "CreateRoleDTO",
|
|
863
|
+
expected: "CreateRoleDTO & { [x: string]: string; }",
|
|
737
864
|
value: elem
|
|
738
865
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
739
866
|
method: "typia.assert",
|
|
740
867
|
path: _path + "",
|
|
741
|
-
expected: "Array<CreateRoleDTO>",
|
|
868
|
+
expected: "Array<CreateRoleDTO & { [x: string]: string; }>",
|
|
742
869
|
value: input
|
|
743
870
|
}, _errorFactory))(input, "$input", true);
|
|
744
871
|
}
|
|
@@ -923,9 +1050,7 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
923
1050
|
}
|
|
924
1051
|
return input;
|
|
925
1052
|
}; })()((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 }));
|
|
1053
|
+
application.featureFlags = rawFlags.map(flag => (Object.assign(Object.assign({}, flag), { applicationName: application.name })));
|
|
929
1054
|
}
|
|
930
1055
|
catch (e) {
|
|
931
1056
|
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_FEATURE_FLAGS)} file: ${e}`);
|
|
@@ -934,7 +1059,41 @@ const readApplicationDirectory = (path, globalApplication) => {
|
|
|
934
1059
|
return application;
|
|
935
1060
|
};
|
|
936
1061
|
const readApplicationItems = (path, fileName, application, fieldName = 'applicationName') => (0, io_1.readJSONFile)((0, path_1.join)(path, fileName))
|
|
937
|
-
.map(role => {
|
|
938
|
-
|
|
939
|
-
|
|
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
|
+
};
|
|
940
1099
|
//# 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,YA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