@celonis/content-cli 0.3.4 → 0.4.1
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/api/compute-pool-api.js +2 -3
- package/api/node-api.js +7 -0
- package/api/package-api.js +55 -0
- package/api/package-dependencies-api.js +29 -0
- package/api/space-api.js +48 -0
- package/commands/package.command.js +11 -1
- package/content-cli-export.js +61 -0
- package/content-cli-import.js +61 -0
- package/content-cli.js +2 -0
- package/interfaces/manifest-transport.js +12 -0
- package/lib/api/node-api.d.ts +1 -0
- package/lib/api/package-api.d.ts +9 -1
- package/lib/api/package-dependencies-api.d.ts +4 -0
- package/lib/api/space-api.d.ts +9 -0
- package/lib/commands/package.command.d.ts +2 -0
- package/lib/content-cli-export.d.ts +4 -0
- package/lib/content-cli-import.d.ts +4 -0
- package/lib/interfaces/batch-export-node-transport.d.ts +10 -0
- package/lib/interfaces/manifest-transport.d.ts +27 -0
- package/lib/interfaces/package-manager.interfaces.d.ts +10 -0
- package/lib/interfaces/save-space.interface.d.ts +2 -1
- package/lib/services/file-service.d.ts +3 -0
- package/lib/services/http-client-service.v2.d.ts +8 -0
- package/lib/services/package-manager/datamodel-service.d.ts +2 -1
- package/lib/services/package-manager/package-service.d.ts +21 -4
- package/lib/services/package-manager/space-service.d.ts +11 -0
- package/lib/services/package-manager/variable-service.d.ts +3 -2
- package/package.json +1 -1
- package/services/file-service.js +9 -1
- package/services/http-client-service.v2.js +91 -3
- package/services/package-manager/datamodel-service.js +6 -8
- package/services/package-manager/package-service.js +331 -34
- package/services/package-manager/space-service.js +61 -0
- package/services/package-manager/variable-service.js +2 -7
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
(function (factory) {
|
|
11
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
+
var v = factory(require, exports);
|
|
13
|
+
if (v !== undefined) module.exports = v;
|
|
14
|
+
}
|
|
15
|
+
else if (typeof define === "function" && define.amd) {
|
|
16
|
+
define(["require", "exports", "../../api/space-api", "uuid"], factory);
|
|
17
|
+
}
|
|
18
|
+
})(function (require, exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const space_api_1 = require("../../api/space-api");
|
|
22
|
+
const uuid_1 = require("uuid");
|
|
23
|
+
class SpaceService {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.allSpaces = [];
|
|
26
|
+
}
|
|
27
|
+
getParentSpaces(nodes) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const promises = [];
|
|
30
|
+
nodes.forEach(node => {
|
|
31
|
+
promises.push(new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
node.space = yield space_api_1.spaceApi.findOne(node.spaceId);
|
|
33
|
+
resolve(node);
|
|
34
|
+
})));
|
|
35
|
+
});
|
|
36
|
+
return Promise.all(promises);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
createSpace(spaceName, spaceIcon) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const newSpace = yield space_api_1.spaceApi.createSpace({
|
|
42
|
+
id: uuid_1.v4(),
|
|
43
|
+
name: spaceName,
|
|
44
|
+
iconReference: spaceIcon
|
|
45
|
+
});
|
|
46
|
+
this.allSpaces.push(newSpace);
|
|
47
|
+
return newSpace;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
getAllSpaces() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
if (this.allSpaces.length) {
|
|
53
|
+
return this.allSpaces;
|
|
54
|
+
}
|
|
55
|
+
return yield space_api_1.spaceApi.findAllSpaces();
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
SpaceService.INSTANCE = new SpaceService();
|
|
60
|
+
exports.spaceService = SpaceService.INSTANCE;
|
|
61
|
+
});
|
|
@@ -20,14 +20,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const package_api_1 = require("../../api/package-api");
|
|
22
22
|
class VariableService {
|
|
23
|
-
|
|
23
|
+
getVariableAssignmentsForNodes(nodes) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
|
|
26
|
-
const variablesByNodeKey = new Map();
|
|
27
|
-
nodeWithVariablesAssignments.forEach(nodeWithVariablesAssignment => {
|
|
28
|
-
variablesByNodeKey.set(nodeWithVariablesAssignment.key, nodeWithVariablesAssignment.variableAssignments);
|
|
29
|
-
});
|
|
30
|
-
return variablesByNodeKey;
|
|
25
|
+
return yield package_api_1.packageApi.findAllPackagesWithVariableAssignments();
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
28
|
}
|