@bluealba/pae-bootstrap-lib 2.0.0-feature-reverse-bootstrap-control-1241 → 2.0.0-feature-setup-e2e-tests-1246
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.d.ts +2 -5
- package/dist/src/bootstrap/bootstrap-platform.d.ts.map +1 -1
- package/dist/src/bootstrap/bootstrap-platform.js +45 -60
- package/dist/src/bootstrap/bootstrap-platform.js.map +1 -1
- package/dist/src/bootstrap/run-bootstrap-sync.service.d.ts.map +1 -1
- package/dist/src/bootstrap/run-bootstrap-sync.service.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/src/bootstrap/domain/index.d.ts +0 -2
- package/dist/src/bootstrap/domain/index.d.ts.map +0 -1
- package/dist/src/bootstrap/domain/index.js +0 -18
- package/dist/src/bootstrap/domain/index.js.map +0 -1
|
@@ -25,11 +25,8 @@ export type BootstrapOptions = {
|
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Reads the current application src/data folder assembles all the platform definitions
|
|
28
|
-
* and
|
|
29
|
-
*
|
|
30
|
-
* @deprecated The synchronization logic has been moved to the gateway service for centralization.
|
|
31
|
-
* This function now acts as a client that delegates to the gateway endpoint.
|
|
32
|
-
* The function signature remains unchanged for backward compatibility.
|
|
28
|
+
* and calls PAE API's to synchronize.
|
|
29
|
+
* This is the single-entry point to implement bootstrap projects without any code at all.
|
|
33
30
|
*/
|
|
34
31
|
export declare const bootstrapPlatform: (options: BootstrapOptions) => Promise<void>;
|
|
35
32
|
//# sourceMappingURL=bootstrap-platform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-platform.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/bootstrap-platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-platform.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/bootstrap-platform.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,CAAC;CACtE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS,gBAAgB,kBAqChE,CAAC"}
|
|
@@ -8,83 +8,68 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
14
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
26
|
exports.bootstrapPlatform = void 0;
|
|
16
27
|
const read_bootstrap_applications_1 = require("./read-bootstrap-applications");
|
|
17
|
-
const pae_core_1 = require("@bluealba/pae-core");
|
|
18
28
|
const initialize_pae_client_1 = __importDefault(require("./initialize-pae-client"));
|
|
29
|
+
const ramda_1 = require("ramda");
|
|
30
|
+
const run_bootstrap_sync_service_1 = require("./run-bootstrap-sync.service");
|
|
31
|
+
const pae_core_1 = require("@bluealba/pae-core");
|
|
32
|
+
const fix_created_by_1 = __importDefault(require("./fix-created-by"));
|
|
19
33
|
/**
|
|
20
34
|
* Reads the current application src/data folder assembles all the platform definitions
|
|
21
|
-
* and
|
|
22
|
-
*
|
|
23
|
-
* @deprecated The synchronization logic has been moved to the gateway service for centralization.
|
|
24
|
-
* This function now acts as a client that delegates to the gateway endpoint.
|
|
25
|
-
* The function signature remains unchanged for backward compatibility.
|
|
35
|
+
* and calls PAE API's to synchronize.
|
|
36
|
+
* This is the single-entry point to implement bootstrap projects without any code at all.
|
|
26
37
|
*/
|
|
27
38
|
const bootstrapPlatform = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
var _a, _b
|
|
39
|
+
var _a, _b;
|
|
29
40
|
if (!options.scopedTo) {
|
|
30
41
|
throw new Error('No options.scopedTo was provider neither the env var SERVICE_ACCESS_NAME is present ! Set one to identify the bootstrap as author for creating/updating entities in the platform');
|
|
31
42
|
}
|
|
32
|
-
console.log('[Bootstrap] Reading platform data from:', (_a = options.path) !== null && _a !== void 0 ? _a : process.cwd());
|
|
33
43
|
// init PAE
|
|
34
44
|
const pae = yield (0, initialize_pae_client_1.default)();
|
|
35
|
-
//
|
|
36
|
-
const platform = (0, read_bootstrap_applications_1.readPlatformBootstrapFolder)((
|
|
45
|
+
// read all files
|
|
46
|
+
const platform = (0, read_bootstrap_applications_1.readPlatformBootstrapFolder)((_a = options.path) !== null && _a !== void 0 ? _a : process.cwd(), options);
|
|
37
47
|
const applications = Object.values(platform.applications);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const url = `${gatewayUrl}/bootstrap/sync`;
|
|
64
|
-
console.log(`[Bootstrap] Sending data to gateway: ${url}`);
|
|
65
|
-
console.log(`[Bootstrap] Scoped to: ${options.scopedTo}`);
|
|
66
|
-
try {
|
|
67
|
-
const response = yield pae.invoke("/bootstrap/sync", {
|
|
68
|
-
method: 'POST',
|
|
69
|
-
headers: {
|
|
70
|
-
'Content-Type': 'application/json',
|
|
71
|
-
'x-bootstrap-scoped-to': options.scopedTo,
|
|
72
|
-
},
|
|
73
|
-
body: JSON.stringify(platform),
|
|
74
|
-
});
|
|
75
|
-
if (!response.ok) {
|
|
76
|
-
const errorText = yield response.text();
|
|
77
|
-
throw new Error(`Bootstrap sync failed with status ${response.status}: ${errorText}`);
|
|
78
|
-
}
|
|
79
|
-
console.log('[Bootstrap] Sync completed successfully');
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
if (error instanceof Error) {
|
|
83
|
-
console.error('[Bootstrap] Sync failed:', error.message);
|
|
84
|
-
throw error;
|
|
85
|
-
}
|
|
86
|
-
throw new Error('Bootstrap sync failed with unknown error');
|
|
87
|
-
}
|
|
48
|
+
// REVIEWME: this is a temporal behavior for the moment when added the missing createdBy/updatedBy fields
|
|
49
|
+
// it must be removed after all projects already run this once in 1.4.2
|
|
50
|
+
yield (0, fix_created_by_1.default)(platform, pae, options.scopedTo);
|
|
51
|
+
// sync
|
|
52
|
+
yield (0, run_bootstrap_sync_service_1.runBootstrapSync)(pae, {
|
|
53
|
+
syncConfig: {
|
|
54
|
+
scopedTo: options.scopedTo,
|
|
55
|
+
},
|
|
56
|
+
sharedLibraries: platform.sharedLibraries,
|
|
57
|
+
// TODO: refactor this. We should be passing the list of applications.
|
|
58
|
+
// this way we will be synchronizing "apps" instead of individual entities. And we could create better logs.
|
|
59
|
+
catalog: ((_b = options.transformModules) !== null && _b !== void 0 ? _b : ramda_1.identity)(applications.flatMap(app => app.modules)),
|
|
60
|
+
modulesConfig: (applications.flatMap(app => app.modulesConfig) || [])
|
|
61
|
+
.map(({ name, config }) => ({ moduleName: name, customProps: config })),
|
|
62
|
+
applicationsAuthz: applications
|
|
63
|
+
.filter(app => app.name !== pae_core_1.GLOBAL_APPLICATION_NAME)
|
|
64
|
+
.map(
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
66
|
+
(_a) => {
|
|
67
|
+
var { modules, operations, roles, modulesConfig } = _a, others = __rest(_a, ["modules", "operations", "roles", "modulesConfig"]);
|
|
68
|
+
return others;
|
|
69
|
+
}),
|
|
70
|
+
rolesAuthz: applications.flatMap(app => app.roles),
|
|
71
|
+
operationsAuthz: applications.flatMap(app => app.operations)
|
|
72
|
+
});
|
|
88
73
|
});
|
|
89
74
|
exports.bootstrapPlatform = bootstrapPlatform;
|
|
90
75
|
//# sourceMappingURL=bootstrap-platform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-platform.js","sourceRoot":"","sources":["../../../src/bootstrap/bootstrap-platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-platform.js","sourceRoot":"","sources":["../../../src/bootstrap/bootstrap-platform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA4E;AAC5E,oFAA0D;AAC1D,iCAAiC;AACjC,6EAAgE;AAChE,iDAA6D;AAC7D,sEAA4C;AA+B5C;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAAO,OAAyB,EAAE,EAAE;;IACnE,IAA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6DAA6D;QAC7D,CAAC,EAAwD,EAAE,EAAE;gBAA5D,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,OAAa,EAAR,MAAM,cAAtD,mDAAwD,CAAF;YAAO,OAAA,MAAM,CAAA;SAAA,CACrE;QACH,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;QAClD,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC;KAC7D,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AArCW,QAAA,iBAAiB,qBAqC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-bootstrap-sync.service.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/run-bootstrap-sync.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"run-bootstrap-sync.service.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/run-bootstrap-sync.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAQnF,eAAO,MAAM,gBAAgB,GAC3B,KAAK,GAAG,EACR,QAAQ,qBAAqB,kBAa9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-bootstrap-sync.service.js","sourceRoot":"","sources":["../../../src/bootstrap/run-bootstrap-sync.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+DAA2D;AAC3D,iFAA4E;AAC5E,yEAAqE;AACrE,6EAAwE;AACxE,6EAAwE;
|
|
1
|
+
{"version":3,"file":"run-bootstrap-sync.service.js","sourceRoot":"","sources":["../../../src/bootstrap/run-bootstrap-sync.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+DAA2D;AAC3D,iFAA4E;AAC5E,yEAAqE;AACrE,6EAAwE;AACxE,6EAAwE;AAGjE,MAAM,gBAAgB,GAAG,CAC9B,GAAQ,EACR,MAA6B,EAC7B,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAEvH,MAAM,IAAA,0BAAW,EAAC,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAE5C,MAAM,IAAA,uCAAiB,EAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IAE5C,MAAM,IAAA,2CAAmB,EAAC,GAAG,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IAE5D,MAAM,IAAA,oCAAgB,EAAC,GAAG,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAE3D,MAAM,IAAA,uCAAiB,EAAC,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;AACxE,CAAC,CAAA,CAAA;AAfY,QAAA,gBAAgB,oBAe5B"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bootstrap/domain"), exports);
|
|
18
17
|
__exportStar(require("./bootstrap/run-bootstrap-sync.service"), exports);
|
|
19
18
|
__exportStar(require("./bootstrap/bootstrap-platform"), exports);
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,yEAAuD;AACvD,iEAA8C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluealba/pae-bootstrap-lib",
|
|
3
3
|
"description": "PAE library for bootstrapping platforms",
|
|
4
|
-
"version": "2.0.0-feature-
|
|
4
|
+
"version": "2.0.0-feature-setup-e2e-tests-1246",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@bluealba/pae-core": "*",
|
|
22
|
-
"jest-diff": "^
|
|
22
|
+
"jest-diff": "^29.7.0",
|
|
23
23
|
"ramda": "^0.30.1",
|
|
24
24
|
"typia": "^9.1.1"
|
|
25
25
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bootstrap-sync-metadata.interface"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/bootstrap/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD"}
|