@bluealba/pae-bootstrap-lib 1.7.2-develop-1171
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/LICENSE +134 -0
- package/README.md +43 -0
- package/dist/src/bootstrap/bootstrap-platform.d.ts +32 -0
- package/dist/src/bootstrap/bootstrap-platform.d.ts.map +1 -0
- package/dist/src/bootstrap/bootstrap-platform.js +75 -0
- package/dist/src/bootstrap/bootstrap-platform.js.map +1 -0
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts +37 -0
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.d.ts.map +1 -0
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.js +3 -0
- package/dist/src/bootstrap/domain/bootstrap-sync-metadata.interface.js.map +1 -0
- package/dist/src/bootstrap/domain/domain-validation.test.d.ts +2 -0
- package/dist/src/bootstrap/domain/domain-validation.test.d.ts.map +1 -0
- package/dist/src/bootstrap/domain/domain-validation.test.js +1872 -0
- package/dist/src/bootstrap/domain/domain-validation.test.js.map +1 -0
- package/dist/src/bootstrap/entity-synchronizer.d.ts +53 -0
- package/dist/src/bootstrap/entity-synchronizer.d.ts.map +1 -0
- package/dist/src/bootstrap/entity-synchronizer.js +69 -0
- package/dist/src/bootstrap/entity-synchronizer.js.map +1 -0
- package/dist/src/bootstrap/entity-synchronizer.test.d.ts +2 -0
- package/dist/src/bootstrap/entity-synchronizer.test.d.ts.map +1 -0
- package/dist/src/bootstrap/entity-synchronizer.test.js +270 -0
- package/dist/src/bootstrap/entity-synchronizer.test.js.map +1 -0
- package/dist/src/bootstrap/fix-created-by.d.ts +10 -0
- package/dist/src/bootstrap/fix-created-by.d.ts.map +1 -0
- package/dist/src/bootstrap/fix-created-by.js +36 -0
- package/dist/src/bootstrap/fix-created-by.js.map +1 -0
- package/dist/src/bootstrap/initialize-pae-client.d.ts +7 -0
- package/dist/src/bootstrap/initialize-pae-client.d.ts.map +1 -0
- package/dist/src/bootstrap/initialize-pae-client.js +24 -0
- package/dist/src/bootstrap/initialize-pae-client.js.map +1 -0
- package/dist/src/bootstrap/read-bootstrap-applications.d.ts +10 -0
- package/dist/src/bootstrap/read-bootstrap-applications.d.ts.map +1 -0
- package/dist/src/bootstrap/read-bootstrap-applications.js +650 -0
- package/dist/src/bootstrap/read-bootstrap-applications.js.map +1 -0
- package/dist/src/bootstrap/run-bootstrap-sync.service.d.ts +4 -0
- package/dist/src/bootstrap/run-bootstrap-sync.service.d.ts.map +1 -0
- package/dist/src/bootstrap/run-bootstrap-sync.service.js +27 -0
- package/dist/src/bootstrap/run-bootstrap-sync.service.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-applications.d.ts +4 -0
- package/dist/src/bootstrap/synchronizers/sync-applications.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-applications.js +53 -0
- package/dist/src/bootstrap/synchronizers/sync-applications.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.d.ts +11 -0
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.js +58 -0
- package/dist/src/bootstrap/synchronizers/sync-authz-entities.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-catalog.d.ts +5 -0
- package/dist/src/bootstrap/synchronizers/sync-catalog.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-catalog.js +73 -0
- package/dist/src/bootstrap/synchronizers/sync-catalog.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.d.ts +11 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.js +38 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performDeletes.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.d.ts +12 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.js +43 -0
- package/dist/src/bootstrap/synchronizers/sync-entities/performUpdates.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.d.ts +19 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.js +59 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.test.d.ts +2 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.test.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.test.js +158 -0
- package/dist/src/bootstrap/synchronizers/sync-entities.test.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entity-options.d.ts +11 -0
- package/dist/src/bootstrap/synchronizers/sync-entity-options.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-entity-options.js +3 -0
- package/dist/src/bootstrap/synchronizers/sync-entity-options.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-modules-config.d.ts +4 -0
- package/dist/src/bootstrap/synchronizers/sync-modules-config.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-modules-config.js +28 -0
- package/dist/src/bootstrap/synchronizers/sync-modules-config.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-operations.d.ts +5 -0
- package/dist/src/bootstrap/synchronizers/sync-operations.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-operations.js +41 -0
- package/dist/src/bootstrap/synchronizers/sync-operations.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-role-operations.d.ts +8 -0
- package/dist/src/bootstrap/synchronizers/sync-role-operations.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-role-operations.js +74 -0
- package/dist/src/bootstrap/synchronizers/sync-role-operations.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-roles.d.ts +5 -0
- package/dist/src/bootstrap/synchronizers/sync-roles.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-roles.js +41 -0
- package/dist/src/bootstrap/synchronizers/sync-roles.js.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.d.ts +4 -0
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.d.ts.map +1 -0
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.js +32 -0
- package/dist/src/bootstrap/synchronizers/sync-shared-libraries.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/utils/compare-lists-by.d.ts +23 -0
- package/dist/src/utils/compare-lists-by.d.ts.map +1 -0
- package/dist/src/utils/compare-lists-by.js +34 -0
- package/dist/src/utils/compare-lists-by.js.map +1 -0
- package/dist/src/utils/format-diff.d.ts +106 -0
- package/dist/src/utils/format-diff.d.ts.map +1 -0
- package/dist/src/utils/format-diff.js +166 -0
- package/dist/src/utils/format-diff.js.map +1 -0
- package/dist/src/utils/format-diff.test.d.ts +2 -0
- package/dist/src/utils/format-diff.test.d.ts.map +1 -0
- package/dist/src/utils/format-diff.test.js +242 -0
- package/dist/src/utils/format-diff.test.js.map +1 -0
- package/dist/src/utils/get-common-keys.d.ts +6 -0
- package/dist/src/utils/get-common-keys.d.ts.map +1 -0
- package/dist/src/utils/get-common-keys.js +9 -0
- package/dist/src/utils/get-common-keys.js.map +1 -0
- package/dist/src/utils/io.d.ts +3 -0
- package/dist/src/utils/io.d.ts.map +1 -0
- package/dist/src/utils/io.js +13 -0
- package/dist/src/utils/io.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.readPlatformBootstrapFolder = void 0;
|
|
40
|
+
const __typia_transform__assertGuard = __importStar(require("typia/lib/internal/_assertGuard.js"));
|
|
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
|
+
const pae_core_1 = require("@bluealba/pae-core");
|
|
45
|
+
const typia_1 = __importDefault(require("typia"));
|
|
46
|
+
// conventions
|
|
47
|
+
const FILE_SHARED_LIBRARIES = 'shared-libraries.json';
|
|
48
|
+
const FILE_APPLICATION = 'application.json';
|
|
49
|
+
const FILE_OPERATIONS = 'operations.json';
|
|
50
|
+
const FILE_MODULES = 'modules.json';
|
|
51
|
+
const FILE_MODULES_CONFIG = 'modules-config.json';
|
|
52
|
+
const FILE_ROLES = 'roles.json';
|
|
53
|
+
/**
|
|
54
|
+
* Inspects the filesystem reading all application definitions
|
|
55
|
+
* NOTE: this is a really quick implementation pretty raw.
|
|
56
|
+
* But allow us to stop repeating code in projects.
|
|
57
|
+
* Feel free to add tests (:P) and improve it.
|
|
58
|
+
*/
|
|
59
|
+
const readPlatformBootstrapFolder = (path, options) => {
|
|
60
|
+
const globalApplication = createGlobalApplication();
|
|
61
|
+
const { readdirSync } = require("fs");
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
return readdirSync(path, { withFileTypes: true }).reduce((acc, item) => {
|
|
64
|
+
var _a;
|
|
65
|
+
if (item.name === FILE_SHARED_LIBRARIES) {
|
|
66
|
+
try {
|
|
67
|
+
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, {
|
|
68
|
+
method: "typia.assert",
|
|
69
|
+
path: _path + ".name",
|
|
70
|
+
expected: "string",
|
|
71
|
+
value: input.name
|
|
72
|
+
}, _errorFactory)) && ("string" === typeof input.url || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
73
|
+
method: "typia.assert",
|
|
74
|
+
path: _path + ".url",
|
|
75
|
+
expected: "string",
|
|
76
|
+
value: input.url
|
|
77
|
+
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
78
|
+
method: "typia.assert",
|
|
79
|
+
path: _path + ".description",
|
|
80
|
+
expected: "(string | undefined)",
|
|
81
|
+
value: input.description
|
|
82
|
+
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
83
|
+
if (false === __is(input)) {
|
|
84
|
+
_errorFactory = errorFactory;
|
|
85
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
86
|
+
method: "typia.assert",
|
|
87
|
+
path: _path + "",
|
|
88
|
+
expected: "Array<CreateSharedLibraryDTO>",
|
|
89
|
+
value: input
|
|
90
|
+
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
91
|
+
method: "typia.assert",
|
|
92
|
+
path: _path + "[" + _index2 + "]",
|
|
93
|
+
expected: "CreateSharedLibraryDTO",
|
|
94
|
+
value: elem
|
|
95
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
96
|
+
method: "typia.assert",
|
|
97
|
+
path: _path + "[" + _index2 + "]",
|
|
98
|
+
expected: "CreateSharedLibraryDTO",
|
|
99
|
+
value: elem
|
|
100
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
101
|
+
method: "typia.assert",
|
|
102
|
+
path: _path + "",
|
|
103
|
+
expected: "Array<CreateSharedLibraryDTO>",
|
|
104
|
+
value: input
|
|
105
|
+
}, _errorFactory))(input, "$input", true);
|
|
106
|
+
}
|
|
107
|
+
return input;
|
|
108
|
+
}; })()((0, io_1.readJSONFile)((0, path_1.join)(path, FILE_SHARED_LIBRARIES)));
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
throw new Error(`Error reading ${FILE_SHARED_LIBRARIES} file: ${e}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else if (item.isDirectory()) {
|
|
115
|
+
if (((_a = options.exclude) !== null && _a !== void 0 ? _a : []).includes(item.name)) {
|
|
116
|
+
console.log(`Excluding application [${item.name}] !`);
|
|
117
|
+
return acc;
|
|
118
|
+
}
|
|
119
|
+
const app = readApplicationDirectory((0, path_1.join)(path, item.name), globalApplication);
|
|
120
|
+
if (app.name !== pae_core_1.GLOBAL_APPLICATION_NAME) {
|
|
121
|
+
acc.applications[app.name] = app;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return acc;
|
|
125
|
+
}, { applications: { [pae_core_1.GLOBAL_APPLICATION_NAME]: globalApplication } });
|
|
126
|
+
};
|
|
127
|
+
exports.readPlatformBootstrapFolder = readPlatformBootstrapFolder;
|
|
128
|
+
const createGlobalApplication = () => ({
|
|
129
|
+
name: pae_core_1.GLOBAL_APPLICATION_NAME,
|
|
130
|
+
description: 'Global Application',
|
|
131
|
+
modules: [],
|
|
132
|
+
operations: [],
|
|
133
|
+
roles: [],
|
|
134
|
+
modulesConfig: []
|
|
135
|
+
});
|
|
136
|
+
const readApplicationDirectory = (path, globalApplication) => {
|
|
137
|
+
const { existsSync } = require("fs");
|
|
138
|
+
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, {
|
|
139
|
+
method: "typia.createAssert",
|
|
140
|
+
path: _path + ".name",
|
|
141
|
+
expected: "string",
|
|
142
|
+
value: input.name
|
|
143
|
+
}, _errorFactory)) && (undefined === input.displayName || "string" === typeof input.displayName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
144
|
+
method: "typia.createAssert",
|
|
145
|
+
path: _path + ".displayName",
|
|
146
|
+
expected: "(string | undefined)",
|
|
147
|
+
value: input.displayName
|
|
148
|
+
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
149
|
+
method: "typia.createAssert",
|
|
150
|
+
path: _path + ".description",
|
|
151
|
+
expected: "(string | undefined)",
|
|
152
|
+
value: input.description
|
|
153
|
+
}, _errorFactory)) && (undefined === input.allowedByDefault || "boolean" === typeof input.allowedByDefault || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
154
|
+
method: "typia.createAssert",
|
|
155
|
+
path: _path + ".allowedByDefault",
|
|
156
|
+
expected: "(boolean | undefined)",
|
|
157
|
+
value: input.allowedByDefault
|
|
158
|
+
}, _errorFactory)); const __is = input => "object" === typeof input && null !== input && _io0(input); let _errorFactory; return (input, errorFactory = (props) => {
|
|
159
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_APPLICATION)} file: invalid type on ${props.path}, expect to be ${props.expected}`);
|
|
160
|
+
}) => {
|
|
161
|
+
if (false === __is(input)) {
|
|
162
|
+
_errorFactory = errorFactory;
|
|
163
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
164
|
+
method: "typia.createAssert",
|
|
165
|
+
path: _path + "",
|
|
166
|
+
expected: "CreateApplicationDTO",
|
|
167
|
+
value: input
|
|
168
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
169
|
+
method: "typia.createAssert",
|
|
170
|
+
path: _path + "",
|
|
171
|
+
expected: "CreateApplicationDTO",
|
|
172
|
+
value: input
|
|
173
|
+
}, _errorFactory))(input, "$input", true);
|
|
174
|
+
}
|
|
175
|
+
return input;
|
|
176
|
+
}; })();
|
|
177
|
+
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: [] }) : globalApplication;
|
|
178
|
+
// read modules setting the application (if app is not global)
|
|
179
|
+
if (existsSync((0, path_1.join)(path, FILE_MODULES))) {
|
|
180
|
+
const data = readApplicationItems(path, FILE_MODULES, application, 'application');
|
|
181
|
+
try {
|
|
182
|
+
application.modules.push(...(() => { const _io0 = input => "string" === typeof input.name && "string" === typeof input.displayName && ("service" === input.type || "app" === input.type || "utility" === input.type || "cloud-function" === 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); 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 => {
|
|
183
|
+
const value = input[key];
|
|
184
|
+
if (undefined === value)
|
|
185
|
+
return true;
|
|
186
|
+
return true;
|
|
187
|
+
}); 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 => "GET" === elem || "POST" === elem || "PUT" === elem || "DELETE" === elem || "PATCH" === elem || "OPTIONS" === elem || "HEAD" === 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, {
|
|
188
|
+
method: "typia.assert",
|
|
189
|
+
path: _path + ".name",
|
|
190
|
+
expected: "string",
|
|
191
|
+
value: input.name
|
|
192
|
+
}, _errorFactory)) && ("string" === typeof input.displayName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
193
|
+
method: "typia.assert",
|
|
194
|
+
path: _path + ".displayName",
|
|
195
|
+
expected: "string",
|
|
196
|
+
value: input.displayName
|
|
197
|
+
}, _errorFactory)) && ("service" === input.type || "app" === input.type || "utility" === input.type || "cloud-function" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
198
|
+
method: "typia.assert",
|
|
199
|
+
path: _path + ".type",
|
|
200
|
+
expected: "(\"app\" | \"cloud-function\" | \"service\" | \"utility\")",
|
|
201
|
+
value: input.type
|
|
202
|
+
}, _errorFactory)) && ("string" === typeof input.baseUrl || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
203
|
+
method: "typia.assert",
|
|
204
|
+
path: _path + ".baseUrl",
|
|
205
|
+
expected: "string",
|
|
206
|
+
value: input.baseUrl
|
|
207
|
+
}, _errorFactory)) && (("object" === typeof input.service && null !== input.service || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
208
|
+
method: "typia.assert",
|
|
209
|
+
path: _path + ".service",
|
|
210
|
+
expected: "ServiceConfig",
|
|
211
|
+
value: input.service
|
|
212
|
+
}, _errorFactory)) && _ao1(input.service, _path + ".service", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
213
|
+
method: "typia.assert",
|
|
214
|
+
path: _path + ".service",
|
|
215
|
+
expected: "ServiceConfig",
|
|
216
|
+
value: input.service
|
|
217
|
+
}, _errorFactory)) && ((Array.isArray(input.dependsOn) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
218
|
+
method: "typia.assert",
|
|
219
|
+
path: _path + ".dependsOn",
|
|
220
|
+
expected: "Array<string>",
|
|
221
|
+
value: input.dependsOn
|
|
222
|
+
}, _errorFactory)) && input.dependsOn.every((elem, _index8) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
223
|
+
method: "typia.assert",
|
|
224
|
+
path: _path + ".dependsOn[" + _index8 + "]",
|
|
225
|
+
expected: "string",
|
|
226
|
+
value: elem
|
|
227
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
228
|
+
method: "typia.assert",
|
|
229
|
+
path: _path + ".dependsOn",
|
|
230
|
+
expected: "Array<string>",
|
|
231
|
+
value: input.dependsOn
|
|
232
|
+
}, _errorFactory)) && (undefined === input.commonPaths || ("object" === typeof input.commonPaths && null !== input.commonPaths && false === Array.isArray(input.commonPaths) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
233
|
+
method: "typia.assert",
|
|
234
|
+
path: _path + ".commonPaths",
|
|
235
|
+
expected: "(CommonPathsMetadata | undefined)",
|
|
236
|
+
value: input.commonPaths
|
|
237
|
+
}, _errorFactory)) && _ao2(input.commonPaths, _path + ".commonPaths", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
238
|
+
method: "typia.assert",
|
|
239
|
+
path: _path + ".commonPaths",
|
|
240
|
+
expected: "(CommonPathsMetadata | undefined)",
|
|
241
|
+
value: input.commonPaths
|
|
242
|
+
}, _errorFactory)) && (undefined === input.ui || ("object" === typeof input.ui && null !== input.ui || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
243
|
+
method: "typia.assert",
|
|
244
|
+
path: _path + ".ui",
|
|
245
|
+
expected: "(UIConfig | undefined)",
|
|
246
|
+
value: input.ui
|
|
247
|
+
}, _errorFactory)) && _ao3(input.ui, _path + ".ui", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
248
|
+
method: "typia.assert",
|
|
249
|
+
path: _path + ".ui",
|
|
250
|
+
expected: "(UIConfig | undefined)",
|
|
251
|
+
value: input.ui
|
|
252
|
+
}, _errorFactory)) && (undefined === input.cloudFunction || ("object" === typeof input.cloudFunction && null !== input.cloudFunction || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
253
|
+
method: "typia.assert",
|
|
254
|
+
path: _path + ".cloudFunction",
|
|
255
|
+
expected: "(CloudFunctionConfig | undefined)",
|
|
256
|
+
value: input.cloudFunction
|
|
257
|
+
}, _errorFactory)) && _ao5(input.cloudFunction, _path + ".cloudFunction", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
258
|
+
method: "typia.assert",
|
|
259
|
+
path: _path + ".cloudFunction",
|
|
260
|
+
expected: "(CloudFunctionConfig | undefined)",
|
|
261
|
+
value: input.cloudFunction
|
|
262
|
+
}, _errorFactory)) && (undefined === input.authorization || ("object" === typeof input.authorization && null !== input.authorization && false === Array.isArray(input.authorization) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
263
|
+
method: "typia.assert",
|
|
264
|
+
path: _path + ".authorization",
|
|
265
|
+
expected: "(AuthorizationMetadata | undefined)",
|
|
266
|
+
value: input.authorization
|
|
267
|
+
}, _errorFactory)) && _ao6(input.authorization, _path + ".authorization", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
268
|
+
method: "typia.assert",
|
|
269
|
+
path: _path + ".authorization",
|
|
270
|
+
expected: "(AuthorizationMetadata | undefined)",
|
|
271
|
+
value: input.authorization
|
|
272
|
+
}, _errorFactory)) && (undefined === input.application || "string" === typeof input.application || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
273
|
+
method: "typia.assert",
|
|
274
|
+
path: _path + ".application",
|
|
275
|
+
expected: "(string | undefined)",
|
|
276
|
+
value: input.application
|
|
277
|
+
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
278
|
+
method: "typia.assert",
|
|
279
|
+
path: _path + ".version",
|
|
280
|
+
expected: "(string | undefined)",
|
|
281
|
+
value: input.version
|
|
282
|
+
}, _errorFactory)) && (undefined === input.isPublic || "boolean" === typeof input.isPublic || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
283
|
+
method: "typia.assert",
|
|
284
|
+
path: _path + ".isPublic",
|
|
285
|
+
expected: "(boolean | undefined)",
|
|
286
|
+
value: input.isPublic
|
|
287
|
+
}, _errorFactory)) && (undefined === input.id || "number" === typeof input.id || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
288
|
+
method: "typia.assert",
|
|
289
|
+
path: _path + ".id",
|
|
290
|
+
expected: "(number | undefined)",
|
|
291
|
+
value: input.id
|
|
292
|
+
}, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.host || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
293
|
+
method: "typia.assert",
|
|
294
|
+
path: _path + ".host",
|
|
295
|
+
expected: "string",
|
|
296
|
+
value: input.host
|
|
297
|
+
}, _errorFactory)) && ("number" === typeof input.port || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
298
|
+
method: "typia.assert",
|
|
299
|
+
path: _path + ".port",
|
|
300
|
+
expected: "number",
|
|
301
|
+
value: input.port
|
|
302
|
+
}, _errorFactory)) && (undefined === input.protocol || "string" === typeof input.protocol || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
303
|
+
method: "typia.assert",
|
|
304
|
+
path: _path + ".protocol",
|
|
305
|
+
expected: "(string | undefined)",
|
|
306
|
+
value: input.protocol
|
|
307
|
+
}, _errorFactory)) && (undefined === input.includeBaseURL || "boolean" === typeof input.includeBaseURL || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
308
|
+
method: "typia.assert",
|
|
309
|
+
path: _path + ".includeBaseURL",
|
|
310
|
+
expected: "(boolean | undefined)",
|
|
311
|
+
value: input.includeBaseURL
|
|
312
|
+
}, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => (undefined === input.apiDocs || "string" === typeof input.apiDocs || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
313
|
+
method: "typia.assert",
|
|
314
|
+
path: _path + ".apiDocs",
|
|
315
|
+
expected: "(string | undefined)",
|
|
316
|
+
value: input.apiDocs
|
|
317
|
+
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
318
|
+
method: "typia.assert",
|
|
319
|
+
path: _path + ".version",
|
|
320
|
+
expected: "(string | undefined)",
|
|
321
|
+
value: input.version
|
|
322
|
+
}, _errorFactory)) && (undefined === input.health || "string" === typeof input.health || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
323
|
+
method: "typia.assert",
|
|
324
|
+
path: _path + ".health",
|
|
325
|
+
expected: "(string | undefined)",
|
|
326
|
+
value: input.health
|
|
327
|
+
}, _errorFactory)) && (undefined === input.changelog || "string" === typeof input.changelog || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
328
|
+
method: "typia.assert",
|
|
329
|
+
path: _path + ".changelog",
|
|
330
|
+
expected: "(string | undefined)",
|
|
331
|
+
value: input.changelog
|
|
332
|
+
}, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.route || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
333
|
+
method: "typia.assert",
|
|
334
|
+
path: _path + ".route",
|
|
335
|
+
expected: "string",
|
|
336
|
+
value: input.route
|
|
337
|
+
}, _errorFactory)) && (null === input.mountAtSelector || undefined === input.mountAtSelector || "string" === typeof input.mountAtSelector || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
338
|
+
method: "typia.assert",
|
|
339
|
+
path: _path + ".mountAtSelector",
|
|
340
|
+
expected: "(null | string | undefined)",
|
|
341
|
+
value: input.mountAtSelector
|
|
342
|
+
}, _errorFactory)) && ("string" === typeof input.bundleFile || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
343
|
+
method: "typia.assert",
|
|
344
|
+
path: _path + ".bundleFile",
|
|
345
|
+
expected: "string",
|
|
346
|
+
value: input.bundleFile
|
|
347
|
+
}, _errorFactory)) && (("object" === typeof input.customProps && null !== input.customProps && false === Array.isArray(input.customProps) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
348
|
+
method: "typia.assert",
|
|
349
|
+
path: _path + ".customProps",
|
|
350
|
+
expected: "ModuleProps",
|
|
351
|
+
value: input.customProps
|
|
352
|
+
}, _errorFactory)) && _ao4(input.customProps, _path + ".customProps", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
353
|
+
method: "typia.assert",
|
|
354
|
+
path: _path + ".customProps",
|
|
355
|
+
expected: "ModuleProps",
|
|
356
|
+
value: input.customProps
|
|
357
|
+
}, _errorFactory)) && (undefined === input.shell || "boolean" === typeof input.shell || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
358
|
+
method: "typia.assert",
|
|
359
|
+
path: _path + ".shell",
|
|
360
|
+
expected: "(boolean | undefined)",
|
|
361
|
+
value: input.shell
|
|
362
|
+
}, _errorFactory)) && (undefined === input.isPlatformCustomization || "boolean" === typeof input.isPlatformCustomization || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
363
|
+
method: "typia.assert",
|
|
364
|
+
path: _path + ".isPlatformCustomization",
|
|
365
|
+
expected: "(boolean | undefined)",
|
|
366
|
+
value: input.isPlatformCustomization
|
|
367
|
+
}, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
368
|
+
const value = input[key];
|
|
369
|
+
if (undefined === value)
|
|
370
|
+
return true;
|
|
371
|
+
return true;
|
|
372
|
+
}); const _ao5 = (input, _path, _exceptionable = true) => ("aws" === input.provider || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
373
|
+
method: "typia.assert",
|
|
374
|
+
path: _path + ".provider",
|
|
375
|
+
expected: "\"aws\"",
|
|
376
|
+
value: input.provider
|
|
377
|
+
}, _errorFactory)) && ("boolean" === typeof input.requiresSignature || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
378
|
+
method: "typia.assert",
|
|
379
|
+
path: _path + ".requiresSignature",
|
|
380
|
+
expected: "boolean",
|
|
381
|
+
value: input.requiresSignature
|
|
382
|
+
}, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => (undefined === input.operations || (Array.isArray(input.operations) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
383
|
+
method: "typia.assert",
|
|
384
|
+
path: _path + ".operations",
|
|
385
|
+
expected: "(Array<string> | undefined)",
|
|
386
|
+
value: input.operations
|
|
387
|
+
}, _errorFactory)) && input.operations.every((elem, _index9) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
388
|
+
method: "typia.assert",
|
|
389
|
+
path: _path + ".operations[" + _index9 + "]",
|
|
390
|
+
expected: "string",
|
|
391
|
+
value: elem
|
|
392
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
393
|
+
method: "typia.assert",
|
|
394
|
+
path: _path + ".operations",
|
|
395
|
+
expected: "(Array<string> | undefined)",
|
|
396
|
+
value: input.operations
|
|
397
|
+
}, _errorFactory)) && (undefined === input.routes || (Array.isArray(input.routes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
398
|
+
method: "typia.assert",
|
|
399
|
+
path: _path + ".routes",
|
|
400
|
+
expected: "(Array<RouteAuthorization> | undefined)",
|
|
401
|
+
value: input.routes
|
|
402
|
+
}, _errorFactory)) && input.routes.every((elem, _index10) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
403
|
+
method: "typia.assert",
|
|
404
|
+
path: _path + ".routes[" + _index10 + "]",
|
|
405
|
+
expected: "RouteAuthorization",
|
|
406
|
+
value: elem
|
|
407
|
+
}, _errorFactory)) && _ao7(elem, _path + ".routes[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
408
|
+
method: "typia.assert",
|
|
409
|
+
path: _path + ".routes[" + _index10 + "]",
|
|
410
|
+
expected: "RouteAuthorization",
|
|
411
|
+
value: elem
|
|
412
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
413
|
+
method: "typia.assert",
|
|
414
|
+
path: _path + ".routes",
|
|
415
|
+
expected: "(Array<RouteAuthorization> | undefined)",
|
|
416
|
+
value: input.routes
|
|
417
|
+
}, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => (undefined === input.methods || (Array.isArray(input.methods) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
418
|
+
method: "typia.assert",
|
|
419
|
+
path: _path + ".methods",
|
|
420
|
+
expected: "(Array<HttpMethod> | undefined)",
|
|
421
|
+
value: input.methods
|
|
422
|
+
}, _errorFactory)) && input.methods.every((elem, _index11) => "GET" === elem || "POST" === elem || "PUT" === elem || "DELETE" === elem || "PATCH" === elem || "OPTIONS" === elem || "HEAD" === elem || "CONNECT" === elem || "TRACE" === elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
423
|
+
method: "typia.assert",
|
|
424
|
+
path: _path + ".methods[" + _index11 + "]",
|
|
425
|
+
expected: "(\"CONNECT\" | \"DELETE\" | \"GET\" | \"HEAD\" | \"OPTIONS\" | \"PATCH\" | \"POST\" | \"PUT\" | \"TRACE\")",
|
|
426
|
+
value: elem
|
|
427
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
428
|
+
method: "typia.assert",
|
|
429
|
+
path: _path + ".methods",
|
|
430
|
+
expected: "(Array<HttpMethod> | undefined)",
|
|
431
|
+
value: input.methods
|
|
432
|
+
}, _errorFactory)) && ("string" === typeof input.pattern || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
433
|
+
method: "typia.assert",
|
|
434
|
+
path: _path + ".pattern",
|
|
435
|
+
expected: "string",
|
|
436
|
+
value: input.pattern
|
|
437
|
+
}, _errorFactory)) && ((Array.isArray(input.operations) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
438
|
+
method: "typia.assert",
|
|
439
|
+
path: _path + ".operations",
|
|
440
|
+
expected: "Array<string>",
|
|
441
|
+
value: input.operations
|
|
442
|
+
}, _errorFactory)) && input.operations.every((elem, _index12) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
443
|
+
method: "typia.assert",
|
|
444
|
+
path: _path + ".operations[" + _index12 + "]",
|
|
445
|
+
expected: "string",
|
|
446
|
+
value: elem
|
|
447
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
448
|
+
method: "typia.assert",
|
|
449
|
+
path: _path + ".operations",
|
|
450
|
+
expected: "Array<string>",
|
|
451
|
+
value: input.operations
|
|
452
|
+
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
453
|
+
if (false === __is(input)) {
|
|
454
|
+
_errorFactory = errorFactory;
|
|
455
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
456
|
+
method: "typia.assert",
|
|
457
|
+
path: _path + "",
|
|
458
|
+
expected: "Array<CreateOrUpdateModule>",
|
|
459
|
+
value: input
|
|
460
|
+
}, _errorFactory)) && input.every((elem, _index7) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
461
|
+
method: "typia.assert",
|
|
462
|
+
path: _path + "[" + _index7 + "]",
|
|
463
|
+
expected: "CreateOrUpdateModule",
|
|
464
|
+
value: elem
|
|
465
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index7 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
466
|
+
method: "typia.assert",
|
|
467
|
+
path: _path + "[" + _index7 + "]",
|
|
468
|
+
expected: "CreateOrUpdateModule",
|
|
469
|
+
value: elem
|
|
470
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
471
|
+
method: "typia.assert",
|
|
472
|
+
path: _path + "",
|
|
473
|
+
expected: "Array<CreateOrUpdateModule>",
|
|
474
|
+
value: input
|
|
475
|
+
}, _errorFactory))(input, "$input", true);
|
|
476
|
+
}
|
|
477
|
+
return input;
|
|
478
|
+
}; })()(data));
|
|
479
|
+
}
|
|
480
|
+
catch (e) {
|
|
481
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_MODULES)} file: ${e}`);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (existsSync((0, path_1.join)(path, FILE_MODULES_CONFIG))) {
|
|
485
|
+
const data = readApplicationItems(path, FILE_MODULES_CONFIG, application, 'application');
|
|
486
|
+
try {
|
|
487
|
+
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)); const _io1 = input => Object.keys(input).every(key => {
|
|
488
|
+
const value = input[key];
|
|
489
|
+
if (undefined === value)
|
|
490
|
+
return true;
|
|
491
|
+
return true;
|
|
492
|
+
}); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
493
|
+
method: "typia.assert",
|
|
494
|
+
path: _path + ".name",
|
|
495
|
+
expected: "string",
|
|
496
|
+
value: input.name
|
|
497
|
+
}, _errorFactory)) && (("object" === typeof input.config && null !== input.config && false === Array.isArray(input.config) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
498
|
+
method: "typia.assert",
|
|
499
|
+
path: _path + ".config",
|
|
500
|
+
expected: "Record<string, any>",
|
|
501
|
+
value: input.config
|
|
502
|
+
}, _errorFactory)) && _ao1(input.config, _path + ".config", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
503
|
+
method: "typia.assert",
|
|
504
|
+
path: _path + ".config",
|
|
505
|
+
expected: "Record<string, any>",
|
|
506
|
+
value: input.config
|
|
507
|
+
}, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
508
|
+
const value = input[key];
|
|
509
|
+
if (undefined === value)
|
|
510
|
+
return true;
|
|
511
|
+
return true;
|
|
512
|
+
}); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
513
|
+
if (false === __is(input)) {
|
|
514
|
+
_errorFactory = errorFactory;
|
|
515
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
516
|
+
method: "typia.assert",
|
|
517
|
+
path: _path + "",
|
|
518
|
+
expected: "Array<ModuleConfig>",
|
|
519
|
+
value: input
|
|
520
|
+
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
521
|
+
method: "typia.assert",
|
|
522
|
+
path: _path + "[" + _index2 + "]",
|
|
523
|
+
expected: "ModuleConfig",
|
|
524
|
+
value: elem
|
|
525
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
526
|
+
method: "typia.assert",
|
|
527
|
+
path: _path + "[" + _index2 + "]",
|
|
528
|
+
expected: "ModuleConfig",
|
|
529
|
+
value: elem
|
|
530
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
531
|
+
method: "typia.assert",
|
|
532
|
+
path: _path + "",
|
|
533
|
+
expected: "Array<ModuleConfig>",
|
|
534
|
+
value: input
|
|
535
|
+
}, _errorFactory))(input, "$input", true);
|
|
536
|
+
}
|
|
537
|
+
return input;
|
|
538
|
+
}; })()(data));
|
|
539
|
+
}
|
|
540
|
+
catch (e) {
|
|
541
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_MODULES_CONFIG)} file: ${e}`);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
if (existsSync((0, path_1.join)(path, FILE_OPERATIONS))) {
|
|
545
|
+
const data = readApplicationItems(path, FILE_OPERATIONS, application);
|
|
546
|
+
try {
|
|
547
|
+
application.operations.push(...(() => { const _io0 = input => "string" === typeof input.name && (undefined === input.applicationName || "string" === typeof input.applicationName) && (undefined === input.description || "string" === typeof input.description); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
548
|
+
method: "typia.assert",
|
|
549
|
+
path: _path + ".name",
|
|
550
|
+
expected: "string",
|
|
551
|
+
value: input.name
|
|
552
|
+
}, _errorFactory)) && (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
553
|
+
method: "typia.assert",
|
|
554
|
+
path: _path + ".applicationName",
|
|
555
|
+
expected: "(string | undefined)",
|
|
556
|
+
value: input.applicationName
|
|
557
|
+
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
558
|
+
method: "typia.assert",
|
|
559
|
+
path: _path + ".description",
|
|
560
|
+
expected: "(string | undefined)",
|
|
561
|
+
value: input.description
|
|
562
|
+
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
563
|
+
if (false === __is(input)) {
|
|
564
|
+
_errorFactory = errorFactory;
|
|
565
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
566
|
+
method: "typia.assert",
|
|
567
|
+
path: _path + "",
|
|
568
|
+
expected: "Array<CreateOperationDTO>",
|
|
569
|
+
value: input
|
|
570
|
+
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
571
|
+
method: "typia.assert",
|
|
572
|
+
path: _path + "[" + _index2 + "]",
|
|
573
|
+
expected: "CreateOperationDTO",
|
|
574
|
+
value: elem
|
|
575
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
576
|
+
method: "typia.assert",
|
|
577
|
+
path: _path + "[" + _index2 + "]",
|
|
578
|
+
expected: "CreateOperationDTO",
|
|
579
|
+
value: elem
|
|
580
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
581
|
+
method: "typia.assert",
|
|
582
|
+
path: _path + "",
|
|
583
|
+
expected: "Array<CreateOperationDTO>",
|
|
584
|
+
value: input
|
|
585
|
+
}, _errorFactory))(input, "$input", true);
|
|
586
|
+
}
|
|
587
|
+
return input;
|
|
588
|
+
}; })()(data));
|
|
589
|
+
}
|
|
590
|
+
catch (e) {
|
|
591
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_OPERATIONS)} file: ${e}`);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (existsSync((0, path_1.join)(path, FILE_ROLES))) {
|
|
595
|
+
const data = readApplicationItems(path, FILE_ROLES, application);
|
|
596
|
+
try {
|
|
597
|
+
application.roles.push(...(() => { const _io0 = input => (undefined === input.applicationName || "string" === typeof input.applicationName) && "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description); const _ao0 = (input, _path, _exceptionable = true) => (undefined === input.applicationName || "string" === typeof input.applicationName || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
598
|
+
method: "typia.assert",
|
|
599
|
+
path: _path + ".applicationName",
|
|
600
|
+
expected: "(string | undefined)",
|
|
601
|
+
value: input.applicationName
|
|
602
|
+
}, _errorFactory)) && ("string" === typeof input.name || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
603
|
+
method: "typia.assert",
|
|
604
|
+
path: _path + ".name",
|
|
605
|
+
expected: "string",
|
|
606
|
+
value: input.name
|
|
607
|
+
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
608
|
+
method: "typia.assert",
|
|
609
|
+
path: _path + ".description",
|
|
610
|
+
expected: "(string | undefined)",
|
|
611
|
+
value: input.description
|
|
612
|
+
}, _errorFactory)); const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && _io0(elem)); let _errorFactory; return (input, errorFactory) => {
|
|
613
|
+
if (false === __is(input)) {
|
|
614
|
+
_errorFactory = errorFactory;
|
|
615
|
+
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
616
|
+
method: "typia.assert",
|
|
617
|
+
path: _path + "",
|
|
618
|
+
expected: "Array<CreateRoleDTO>",
|
|
619
|
+
value: input
|
|
620
|
+
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(true, {
|
|
621
|
+
method: "typia.assert",
|
|
622
|
+
path: _path + "[" + _index2 + "]",
|
|
623
|
+
expected: "CreateRoleDTO",
|
|
624
|
+
value: elem
|
|
625
|
+
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
626
|
+
method: "typia.assert",
|
|
627
|
+
path: _path + "[" + _index2 + "]",
|
|
628
|
+
expected: "CreateRoleDTO",
|
|
629
|
+
value: elem
|
|
630
|
+
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
631
|
+
method: "typia.assert",
|
|
632
|
+
path: _path + "",
|
|
633
|
+
expected: "Array<CreateRoleDTO>",
|
|
634
|
+
value: input
|
|
635
|
+
}, _errorFactory))(input, "$input", true);
|
|
636
|
+
}
|
|
637
|
+
return input;
|
|
638
|
+
}; })()(data));
|
|
639
|
+
}
|
|
640
|
+
catch (e) {
|
|
641
|
+
throw new Error(`Error reading ${(0, path_1.join)(path, FILE_ROLES)} file: ${e}`);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
return application;
|
|
645
|
+
};
|
|
646
|
+
const readApplicationItems = (path, fileName, application, fieldName = 'applicationName') => (0, io_1.readJSONFile)((0, path_1.join)(path, fileName))
|
|
647
|
+
.map(role => {
|
|
648
|
+
return application.name === pae_core_1.GLOBAL_APPLICATION_NAME ? role : (Object.assign(Object.assign({}, role), { [fieldName]: application.name }));
|
|
649
|
+
});
|
|
650
|
+
//# sourceMappingURL=read-bootstrap-applications.js.map
|