@celonis/content-cli 0.13.4 → 1.0.0
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/README.md +13 -6
- package/{api → commands/action-flows/action-flow}/action-flow-api.js +10 -9
- package/commands/{action-flow.command.js → action-flows/action-flow/action-flow-command.service.js} +11 -8
- package/{services/action-flow/action-flow-service.js → commands/action-flows/action-flow/action-flow.service.js} +12 -10
- package/commands/action-flows/module.js +88 -0
- package/commands/{skill.command.js → action-flows/skill/skill-command.service.js} +9 -11
- package/{content/factory/skill-manager.factory.js → commands/action-flows/skill/skill.manager-factory.js} +7 -4
- package/{content/manager → commands/action-flows/skill}/skill.manager.js +7 -4
- package/commands/analysis/analysis-bookmarks-command.service.js +39 -0
- package/{content/factory/analysis-bookmarks-manager.factory.js → commands/analysis/analysis-bookmarks.manager-factory.js} +7 -4
- package/{content/manager → commands/analysis}/analysis-bookmarks.manager.js +8 -5
- package/commands/analysis/module.js +52 -0
- package/commands/configuration-management/api/batch-import-export-api.js +84 -0
- package/{api → commands/configuration-management/api}/diff-api.js +8 -7
- package/commands/configuration-management/api/variable-assignment-candidates-api.js +41 -0
- package/{services/package-manager/batch-import-export-service.js → commands/configuration-management/batch-import-export.service.js} +43 -23
- package/commands/configuration-management/config-command.service.js +76 -0
- package/{services/package-manager/diff-service.js → commands/configuration-management/diff.service.js} +11 -8
- package/commands/configuration-management/module.js +102 -0
- package/{services/studio → commands/configuration-management}/studio.service.js +33 -24
- package/commands/{variable.command.js → configuration-management/variable-command.service.js} +10 -7
- package/{services/package-manager/variable-service.js → commands/configuration-management/variable.service.js} +36 -42
- package/commands/{ctp.command.js → cpm4/ctp-command.service.js} +11 -13
- package/{content/manager → commands/cpm4}/ctp.analysis.manager.js +3 -0
- package/{content/manager → commands/cpm4}/ctp.datamodel.manager.js +2 -2
- package/{content/factory/ctp-manager.factory.js → commands/cpm4/ctp.manager-factory.js} +9 -6
- package/{content/manager → commands/cpm4}/ctp.manager.js +6 -4
- package/commands/cpm4/module.js +46 -0
- package/commands/{connection.command.js → data-pipeline/connection/connection-command.service.js} +14 -11
- package/commands/data-pipeline/connection/connection.commands.js +65 -0
- package/{services → commands/data-pipeline}/connection/connection.service.js +18 -15
- package/{api → commands/data-pipeline/data-pool}/data-pool-api.js +14 -13
- package/commands/{data-pool.command.js → data-pipeline/data-pool/data-pool-command.service.js} +25 -23
- package/{content/factory → commands/data-pipeline/data-pool}/data-pool-manager.factory.js +9 -6
- package/{services → commands/data-pipeline}/data-pool/data-pool-service.js +13 -10
- package/commands/data-pipeline/data-pool/data-pool.commands.js +99 -0
- package/{content/manager → commands/data-pipeline/data-pool}/data-pool.manager.js +8 -9
- package/commands/data-pipeline/module.js +24 -0
- package/commands/profile/module.js +60 -0
- package/commands/profile/profile-command.service.js +94 -0
- package/{api → commands/studio/api}/asset-api.js +8 -7
- package/{api → commands/studio/api}/compute-pool-api.js +7 -6
- package/{api → commands/studio/api}/node-api.js +9 -8
- package/{api → commands/studio/api}/package-api.js +18 -17
- package/{api → commands/studio/api}/package-dependencies-api.js +12 -11
- package/{api → commands/studio/api}/space-api.js +10 -9
- package/commands/{analysis-bookmarks.command.js → studio/api/studio-variables-api.js} +18 -13
- package/commands/{asset.command.js → studio/command-service/asset-command.service.js} +21 -19
- package/commands/{package.command.js → studio/command-service/package-command.service.js} +22 -20
- package/commands/{space.command.js → studio/command-service/space-command.service.js} +9 -11
- package/commands/studio/command-service/widget.command.js +56 -0
- package/{content/factory/asset-manager.factory.js → commands/studio/manager/asset.manager-factory.js} +7 -4
- package/{content → commands/studio}/manager/asset.manager.js +8 -5
- package/{content/factory/package-manager.factory.js → commands/studio/manager/package.manager-factory.js} +7 -4
- package/{content → commands/studio}/manager/package.manager.js +9 -6
- package/{content/factory/space-manager.factory.js → commands/studio/manager/space.manager-factory.js} +6 -3
- package/{content → commands/studio}/manager/space.manager.js +7 -4
- package/{content/factory/widget-manager.factory.js → commands/studio/manager/widget.manager-factory.js} +8 -5
- package/{content → commands/studio}/manager/widget.manager.js +5 -5
- package/commands/studio/module.js +169 -0
- package/{services/package-manager → commands/studio/service}/asset-service.js +10 -9
- package/{services/package-manager/datamodel-service.js → commands/studio/service/data-model.service.js} +8 -6
- package/{services/package-manager/package-service.js → commands/studio/service/package.service.js} +59 -49
- package/{services/package-manager/space-service.js → commands/studio/service/space.service.js} +9 -9
- package/commands/studio/service/studio-variable.service.js +41 -0
- package/content-cli.js +69 -20
- package/core/command/cli-context.js +69 -0
- package/core/command/module-handler.js +200 -0
- package/core/http/base-api.js +115 -0
- package/{services/http-client-service.v2.js → core/http/http-client.js} +39 -24
- package/{services/context.service.js → core/http/http-shared/base.manager.helper.js} +6 -16
- package/{content/manager → core/http/http-shared}/base.manager.js +14 -21
- package/{services → core/profile}/profile.service.js +11 -5
- package/{validators → core/profile}/profile.validator.js +3 -3
- package/{services → core/utils}/file-service.js +2 -7
- package/core/utils/logger.js +102 -0
- package/{services → core/utils}/question.service.js +18 -7
- package/{util → core/utils}/version.js +1 -1
- package/lib/{api → commands/action-flows/action-flow}/action-flow-api.d.ts +4 -4
- package/lib/commands/{action-flow.command.d.ts → action-flows/action-flow/action-flow-command.service.d.ts} +4 -1
- package/lib/{services/action-flow/action-flow-service.d.ts → commands/action-flows/action-flow/action-flow.service.d.ts} +4 -4
- package/lib/commands/action-flows/module.d.ts +14 -0
- package/lib/commands/{skill.command.d.ts → action-flows/skill/skill-command.service.d.ts} +3 -2
- package/lib/commands/action-flows/skill/skill.manager-factory.d.ts +8 -0
- package/lib/{content/manager → commands/action-flows/skill}/skill.manager.d.ts +4 -2
- package/lib/commands/analysis/analysis-bookmarks-command.service.d.ts +7 -0
- package/lib/commands/analysis/analysis-bookmarks.manager-factory.d.ts +8 -0
- package/lib/{content/manager → commands/analysis}/analysis-bookmarks.manager.d.ts +4 -2
- package/lib/commands/analysis/module.d.ts +11 -0
- package/lib/{api → commands/configuration-management/api}/batch-import-export-api.d.ts +6 -5
- package/lib/{api → commands/configuration-management/api}/diff-api.d.ts +5 -5
- package/lib/commands/configuration-management/api/variable-assignment-candidates-api.d.ts +8 -0
- package/lib/{services/package-manager/batch-import-export-service.d.ts → commands/configuration-management/batch-import-export.service.d.ts} +8 -3
- package/lib/commands/{config.command.d.ts → configuration-management/config-command.service.d.ts} +8 -2
- package/lib/{services/package-manager/diff-service.d.ts → commands/configuration-management/diff.service.d.ts} +4 -3
- package/lib/{interfaces/package-export-transport.d.ts → commands/configuration-management/interfaces/package-export.interfaces.d.ts} +2 -2
- package/lib/{api/variable-assignment-apis.d.ts → commands/configuration-management/interfaces/variable-assignment-apis.constants.d.ts} +3 -1
- package/lib/commands/configuration-management/module.d.ts +15 -0
- package/lib/{services/studio → commands/configuration-management}/studio.service.d.ts +12 -5
- package/lib/commands/configuration-management/variable-command.service.d.ts +6 -0
- package/lib/{services/package-manager/variable-service.d.ts → commands/configuration-management/variable.service.d.ts} +8 -8
- package/lib/commands/cpm4/ctp-command.service.d.ts +7 -0
- package/lib/{content/manager → commands/cpm4}/ctp.analysis.manager.d.ts +2 -0
- package/lib/{content/manager → commands/cpm4}/ctp.datamodel.manager.d.ts +2 -1
- package/lib/{content/factory/ctp-manager.factory.d.ts → commands/cpm4/ctp.manager-factory.d.ts} +4 -1
- package/lib/{content/manager → commands/cpm4}/ctp.manager.d.ts +4 -2
- package/lib/commands/cpm4/module.d.ts +10 -0
- package/lib/commands/data-pipeline/connection/connection-command.service.d.ts +8 -0
- package/lib/commands/data-pipeline/connection/connection.commands.d.ts +11 -0
- package/lib/{services → commands/data-pipeline}/connection/connection.service.d.ts +4 -3
- package/lib/{api → commands/data-pipeline/data-pool}/data-pool-api.d.ts +5 -5
- package/lib/commands/data-pipeline/data-pool/data-pool-command.service.d.ts +14 -0
- package/lib/commands/data-pipeline/data-pool/data-pool-manager.factory.d.ts +9 -0
- package/lib/{services → commands/data-pipeline}/data-pool/data-pool-service.d.ts +4 -3
- package/lib/commands/data-pipeline/data-pool/data-pool.commands.d.ts +15 -0
- package/lib/{content/manager → commands/data-pipeline/data-pool}/data-pool.manager.d.ts +4 -2
- package/lib/commands/data-pipeline/module.d.ts +9 -0
- package/lib/commands/profile/module.d.ts +12 -0
- package/lib/commands/{profile.command.d.ts → profile/profile-command.service.d.ts} +1 -1
- package/lib/{api → commands/studio/api}/asset-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/compute-pool-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/node-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/package-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/package-dependencies-api.d.ts +4 -4
- package/lib/commands/studio/api/space-api.d.ts +9 -0
- package/lib/commands/studio/api/studio-variables-api.d.ts +8 -0
- package/lib/commands/studio/command-service/asset-command.service.d.ts +11 -0
- package/lib/commands/{package.command.d.ts → studio/command-service/package-command.service.d.ts} +8 -5
- package/lib/commands/studio/command-service/space-command.service.d.ts +6 -0
- package/lib/commands/studio/command-service/widget.command.d.ts +7 -0
- package/lib/{interfaces/batch-export-node-transport.d.ts → commands/studio/interfaces/batch-export-node.interfaces.d.ts} +1 -9
- package/lib/{content/factory/asset-manager.factory.d.ts → commands/studio/manager/asset.manager-factory.d.ts} +4 -1
- package/lib/{content → commands/studio}/manager/asset.manager.d.ts +4 -2
- package/lib/{content/factory/package-manager.factory.d.ts → commands/studio/manager/package.manager-factory.d.ts} +4 -1
- package/lib/{content → commands/studio}/manager/package.manager.d.ts +4 -2
- package/lib/commands/studio/manager/space.manager-factory.d.ts +8 -0
- package/lib/{content → commands/studio}/manager/space.manager.d.ts +4 -2
- package/lib/{content/factory/widget-manager.factory.d.ts → commands/studio/manager/widget.manager-factory.d.ts} +10 -7
- package/lib/{content → commands/studio}/manager/widget.manager.d.ts +4 -2
- package/lib/commands/studio/module.d.ts +21 -0
- package/lib/{services/package-manager → commands/studio/service}/asset-service.d.ts +4 -3
- package/lib/{services/package-manager/datamodel-service.d.ts → commands/studio/service/data-model.service.d.ts} +5 -5
- package/lib/{services/package-manager/package-service.d.ts → commands/studio/service/package.service.d.ts} +13 -6
- package/lib/commands/studio/service/space.service.d.ts +11 -0
- package/lib/commands/studio/service/studio-variable.service.d.ts +9 -0
- package/lib/core/command/cli-context.d.ts +17 -0
- package/lib/core/command/module-handler.d.ts +57 -0
- package/lib/core/http/base-api.d.ts +32 -0
- package/lib/{services/http-client-service.v2.d.ts → core/http/http-client.d.ts} +8 -3
- package/lib/{content/manager → core/http/http-shared}/base.manager.d.ts +4 -6
- package/lib/core/http/http-shared/base.manager.helper.d.ts +4 -0
- package/lib/{services → core/profile}/profile.service.d.ts +2 -1
- package/lib/{validators → core/profile}/profile.validator.d.ts +1 -1
- package/lib/{services → core/utils}/file-service.d.ts +0 -2
- package/lib/core/utils/question.service.d.ts +10 -0
- package/package.json +3 -3
- package/api/batch-import-export-api.js +0 -51
- package/api/variables-api.js +0 -56
- package/commands/config.command.js +0 -57
- package/commands/profile.command.js +0 -88
- package/commands/widget.command.js +0 -36
- package/content-cli-analyze.js +0 -56
- package/content-cli-config.js +0 -117
- package/content-cli-export.js +0 -90
- package/content-cli-get.js +0 -52
- package/content-cli-import.js +0 -93
- package/content-cli-list.js +0 -129
- package/content-cli-profile.js +0 -64
- package/content-cli-pull.js +0 -104
- package/content-cli-push.js +0 -196
- package/content-cli-set.js +0 -55
- package/content-cli-update.js +0 -44
- package/interfaces/variable-assignment-api.interface.js +0 -12
- package/lib/api/space-api.d.ts +0 -9
- package/lib/api/variables-api.d.ts +0 -14
- package/lib/commands/analysis-bookmarks.command.d.ts +0 -6
- package/lib/commands/asset.command.d.ts +0 -8
- package/lib/commands/connection.command.d.ts +0 -5
- package/lib/commands/ctp.command.d.ts +0 -6
- package/lib/commands/data-pool.command.d.ts +0 -11
- package/lib/commands/space.command.d.ts +0 -5
- package/lib/commands/variable.command.d.ts +0 -3
- package/lib/commands/widget.command.d.ts +0 -5
- package/lib/content/factory/analysis-bookmarks-manager.factory.d.ts +0 -5
- package/lib/content/factory/data-pool-manager.factory.d.ts +0 -6
- package/lib/content/factory/skill-manager.factory.d.ts +0 -5
- package/lib/content/factory/space-manager.factory.d.ts +0 -5
- package/lib/content-cli-analyze.d.ts +0 -1
- package/lib/content-cli-config.d.ts +0 -8
- package/lib/content-cli-export.d.ts +0 -6
- package/lib/content-cli-get.d.ts +0 -1
- package/lib/content-cli-import.d.ts +0 -6
- package/lib/content-cli-list.d.ts +0 -9
- package/lib/content-cli-profile.d.ts +0 -1
- package/lib/content-cli-pull.d.ts +0 -1
- package/lib/content-cli-push.d.ts +0 -1
- package/lib/content-cli-set.d.ts +0 -1
- package/lib/content-cli-update.d.ts +0 -1
- package/lib/interfaces/variable-assignment-api.interface.d.ts +0 -3
- package/lib/services/command.service.d.ts +0 -6
- package/lib/services/content.service.d.ts +0 -11
- package/lib/services/context.service.d.ts +0 -13
- package/lib/services/http-client.service.d.ts +0 -15
- package/lib/services/package-manager/space-service.d.ts +0 -11
- package/lib/services/question.service.d.ts +0 -4
- package/lib/util/context-initializer.d.ts +0 -3
- package/lib/util/program.d.ts +0 -2
- package/services/command.service.js +0 -24
- package/services/content.service.js +0 -130
- package/services/http-client.service.js +0 -157
- package/util/context-initializer.js +0 -39
- package/util/logger.js +0 -49
- package/util/program.js +0 -16
- /package/{interfaces/batch-export-import-constants.js → commands/configuration-management/interfaces/batch-export-import.constants.js} +0 -0
- /package/{interfaces/diff-package.transport.js → commands/configuration-management/interfaces/diff-package.interfaces.js} +0 -0
- /package/{interfaces/batch-export-node-transport.js → commands/configuration-management/interfaces/package-export.interfaces.js} +0 -0
- /package/{api/variable-assignment-apis.js → commands/configuration-management/interfaces/variable-assignment-apis.constants.js} +0 -0
- /package/{interfaces → commands/data-pipeline/data-pool}/data-pool-manager.interfaces.js +0 -0
- /package/{interfaces/manager-config.interface.js → commands/studio/interfaces/batch-export-node.interfaces.js} +0 -0
- /package/{interfaces/manifest-transport.js → commands/studio/interfaces/manifest.interface.js} +0 -0
- /package/{interfaces → commands/studio/interfaces}/package-manager.interfaces.js +0 -0
- /package/{interfaces → commands/studio/interfaces}/save-content-node.interface.js +0 -0
- /package/{interfaces/package-export-transport.js → commands/studio/interfaces/space.interface.js} +0 -0
- /package/{util → commands/studio/utils}/semantic-versioning.js +0 -0
- /package/{util → core/http}/axios-initializer.js +0 -0
- /package/{interfaces/save-space.interface.js → core/http/http-shared/manager-config.interface.js} +0 -0
- /package/{util → core/http}/tracing.js +0 -0
- /package/{interfaces → core/profile}/profile.interface.js +0 -0
- /package/{util → core/utils}/json.js +0 -0
- /package/{util → core/utils}/yaml.js +0 -0
- /package/lib/{interfaces/batch-export-import-constants.d.ts → commands/configuration-management/interfaces/batch-export-import.constants.d.ts} +0 -0
- /package/lib/{interfaces/diff-package.transport.d.ts → commands/configuration-management/interfaces/diff-package.interfaces.d.ts} +0 -0
- /package/lib/{interfaces → commands/data-pipeline/data-pool}/data-pool-manager.interfaces.d.ts +0 -0
- /package/lib/{interfaces/manifest-transport.d.ts → commands/studio/interfaces/manifest.interface.d.ts} +0 -0
- /package/lib/{interfaces → commands/studio/interfaces}/package-manager.interfaces.d.ts +0 -0
- /package/lib/{interfaces → commands/studio/interfaces}/save-content-node.interface.d.ts +0 -0
- /package/lib/{interfaces/save-space.interface.d.ts → commands/studio/interfaces/space.interface.d.ts} +0 -0
- /package/lib/{util → commands/studio/utils}/semantic-versioning.d.ts +0 -0
- /package/lib/{util → core/http}/axios-initializer.d.ts +0 -0
- /package/lib/{interfaces → core/http/http-shared}/manager-config.interface.d.ts +0 -0
- /package/lib/{util → core/http}/tracing.d.ts +0 -0
- /package/lib/{interfaces → core/profile}/profile.interface.d.ts +0 -0
- /package/lib/{util → core/utils}/json.d.ts +0 -0
- /package/lib/{util → core/utils}/logger.d.ts +0 -0
- /package/lib/{util → core/utils}/version.d.ts +0 -0
- /package/lib/{util → core/utils}/yaml.d.ts +0 -0
|
@@ -13,25 +13,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports"
|
|
16
|
+
define(["require", "exports"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
const http_client_service_v2_1 = require("../services/http-client-service.v2");
|
|
21
|
+
exports.DiffApi = void 0;
|
|
23
22
|
class DiffApi {
|
|
23
|
+
constructor(context) {
|
|
24
|
+
this.httpClient = context.httpClient;
|
|
25
|
+
}
|
|
24
26
|
diffPackages(data) {
|
|
25
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
return
|
|
28
|
+
return this.httpClient.postFile("/package-manager/api/core/packages/diff/configuration", data);
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
hasChanges(data) {
|
|
30
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
return
|
|
33
|
+
return this.httpClient.postFile("/package-manager/api/core/packages/diff/configuration/has-changes", data);
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
DiffApi
|
|
36
|
-
exports.diffApi = DiffApi.INSTANCE;
|
|
37
|
+
exports.DiffApi = DiffApi;
|
|
37
38
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
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", "../interfaces/variable-assignment-apis.constants", "../../../core/utils/logger"], factory);
|
|
17
|
+
}
|
|
18
|
+
})(function (require, exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.VariableAssignmentCandidatesApi = void 0;
|
|
22
|
+
const variable_assignment_apis_constants_1 = require("../interfaces/variable-assignment-apis.constants");
|
|
23
|
+
const logger_1 = require("../../../core/utils/logger");
|
|
24
|
+
class VariableAssignmentCandidatesApi {
|
|
25
|
+
constructor(context) {
|
|
26
|
+
this.httpClient = context.httpClient;
|
|
27
|
+
}
|
|
28
|
+
getCandidateAssignments(type, params) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
if (!variable_assignment_apis_constants_1.variableAssignmentApis[type]) {
|
|
31
|
+
throw new logger_1.FatalError(`Variable type ${type} not supported.`);
|
|
32
|
+
}
|
|
33
|
+
const apiUrl = variable_assignment_apis_constants_1.variableAssignmentApis[type].url + (params.toString().length ? `?${params.toString()}` : "");
|
|
34
|
+
return this.httpClient.get(apiUrl).catch(e => {
|
|
35
|
+
throw new logger_1.FatalError(`Problem getting variables assignment values for type ${type}: ${e}`);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.VariableAssignmentCandidatesApi = VariableAssignmentCandidatesApi;
|
|
41
|
+
});
|
|
@@ -13,27 +13,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "
|
|
16
|
+
define(["require", "exports", "uuid", "form-data", "stream", "adm-zip", "./interfaces/batch-export-import.constants", "../../core/utils/file-service", "../../core/utils/logger", "../../core/utils/json", "../studio/api/package-api", "./api/batch-import-export-api", "./studio.service"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
const batch_import_export_api_1 = require("../../api/batch-import-export-api");
|
|
23
|
-
const logger_1 = require("../../util/logger");
|
|
21
|
+
exports.BatchImportExportService = void 0;
|
|
24
22
|
const uuid_1 = require("uuid");
|
|
25
|
-
const file_service_1 = require("../file-service");
|
|
26
|
-
const studio_service_1 = require("../studio/studio.service");
|
|
27
|
-
const json_1 = require("../../util/json");
|
|
28
23
|
const FormData = require("form-data");
|
|
29
|
-
const batch_export_import_constants_1 = require("../../interfaces/batch-export-import-constants");
|
|
30
|
-
const package_api_1 = require("../../api/package-api");
|
|
31
24
|
const stream_1 = require("stream");
|
|
32
25
|
const AdmZip = require("adm-zip");
|
|
26
|
+
const batch_export_import_constants_1 = require("./interfaces/batch-export-import.constants");
|
|
27
|
+
const file_service_1 = require("../../core/utils/file-service");
|
|
28
|
+
const logger_1 = require("../../core/utils/logger");
|
|
29
|
+
const json_1 = require("../../core/utils/json");
|
|
30
|
+
const package_api_1 = require("../studio/api/package-api");
|
|
31
|
+
const batch_import_export_api_1 = require("./api/batch-import-export-api");
|
|
32
|
+
const studio_service_1 = require("./studio.service");
|
|
33
33
|
class BatchImportExportService {
|
|
34
|
+
constructor(context) {
|
|
35
|
+
this.batchImportExportApi = new batch_import_export_api_1.BatchImportExportApi(context);
|
|
36
|
+
this.studioPackageApi = new package_api_1.PackageApi(context);
|
|
37
|
+
this.studioService = new studio_service_1.StudioService(context);
|
|
38
|
+
}
|
|
34
39
|
listActivePackages(flavors) {
|
|
35
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const activePackages = yield
|
|
41
|
+
const activePackages = yield this.batchImportExportApi.findAllActivePackages(flavors);
|
|
37
42
|
activePackages.forEach(pkg => {
|
|
38
43
|
logger_1.logger.info(`${pkg.name} - Key: "${pkg.key}"`);
|
|
39
44
|
});
|
|
@@ -43,34 +48,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
49
|
let packagesToExport;
|
|
45
50
|
if (packageKeys.length) {
|
|
46
|
-
packagesToExport = yield
|
|
51
|
+
packagesToExport = yield this.batchImportExportApi.findActivePackagesByKeys(packageKeys, withDependencies);
|
|
47
52
|
}
|
|
48
53
|
else {
|
|
49
|
-
packagesToExport = yield
|
|
54
|
+
packagesToExport = yield this.batchImportExportApi.findAllActivePackages(flavors, withDependencies);
|
|
50
55
|
}
|
|
51
|
-
packagesToExport = yield
|
|
56
|
+
packagesToExport = yield this.studioService.getExportPackagesWithStudioData(packagesToExport, withDependencies);
|
|
52
57
|
this.exportListOfPackages(packagesToExport);
|
|
53
58
|
});
|
|
54
59
|
}
|
|
55
60
|
batchExportPackages(packageKeys, withDependencies = false) {
|
|
56
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
const exportedPackagesData = yield
|
|
62
|
+
const exportedPackagesData = yield this.batchImportExportApi.exportPackages(packageKeys, withDependencies);
|
|
58
63
|
const exportedPackagesZip = new AdmZip(exportedPackagesData);
|
|
59
64
|
const manifest = (0, json_1.parse)(exportedPackagesZip.getEntry(batch_export_import_constants_1.BatchExportImportConstants.MANIFEST_FILE_NAME).getData().toString());
|
|
60
65
|
const versionsByPackageKey = this.getVersionsByPackageKey(manifest);
|
|
61
66
|
let exportedVariables = yield this.getVersionedVariablesForPackagesWithKeys(versionsByPackageKey);
|
|
62
|
-
exportedVariables =
|
|
67
|
+
exportedVariables = this.studioService.fixConnectionVariables(exportedVariables);
|
|
63
68
|
exportedPackagesZip.addFile(batch_export_import_constants_1.BatchExportImportConstants.VARIABLES_FILE_NAME, Buffer.from((0, json_1.stringify)(exportedVariables), "utf8"));
|
|
64
69
|
const studioPackageKeys = manifest.filter(packageManifest => packageManifest.flavor === batch_export_import_constants_1.BatchExportImportConstants.STUDIO)
|
|
65
70
|
.map(packageManifest => packageManifest.packageKey);
|
|
66
|
-
const studioData = yield
|
|
71
|
+
const studioData = yield this.studioService.getStudioPackageManifests(studioPackageKeys);
|
|
67
72
|
exportedPackagesZip.addFile(batch_export_import_constants_1.BatchExportImportConstants.STUDIO_FILE_NAME, Buffer.from((0, json_1.stringify)(studioData), "utf8"));
|
|
68
73
|
exportedPackagesZip.getEntries().forEach(entry => {
|
|
69
74
|
if (entry.name.endsWith(batch_export_import_constants_1.BatchExportImportConstants.ZIP_EXTENSION)) {
|
|
70
75
|
const lastUnderscoreIndex = entry.name.lastIndexOf("_");
|
|
71
76
|
const packageKey = entry.name.substring(0, lastUnderscoreIndex);
|
|
72
77
|
if (studioPackageKeys.includes(packageKey)) {
|
|
73
|
-
const updatedPackage =
|
|
78
|
+
const updatedPackage = this.studioService.processPackageForExport(entry, exportedVariables);
|
|
74
79
|
exportedPackagesZip.updateFile(entry, updatedPackage.toBuffer());
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -86,16 +91,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
86
91
|
let configs = new AdmZip(file);
|
|
87
92
|
const studioManifests = this.parseEntryData(configs, batch_export_import_constants_1.BatchExportImportConstants.STUDIO_FILE_NAME);
|
|
88
93
|
const variablesManifests = this.parseEntryData(configs, batch_export_import_constants_1.BatchExportImportConstants.VARIABLES_FILE_NAME);
|
|
89
|
-
configs = yield
|
|
90
|
-
const existingStudioPackages = yield
|
|
94
|
+
configs = yield this.studioService.mapSpaces(configs, studioManifests);
|
|
95
|
+
const existingStudioPackages = yield this.studioPackageApi.findAllPackages();
|
|
91
96
|
const formData = this.buildBodyForImport(configs, variablesManifests);
|
|
92
|
-
const postPackageImportData = yield
|
|
93
|
-
yield
|
|
97
|
+
const postPackageImportData = yield this.batchImportExportApi.importPackages(formData, overwrite);
|
|
98
|
+
yield this.studioService.processImportedPackages(configs, existingStudioPackages, studioManifests);
|
|
94
99
|
const reportFileName = "config_import_report_" + (0, uuid_1.v4)() + ".json";
|
|
95
100
|
file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(postPackageImportData), reportFileName);
|
|
96
101
|
logger_1.logger.info("Config import report file: " + reportFileName);
|
|
97
102
|
});
|
|
98
103
|
}
|
|
104
|
+
findAndExportListOfActivePackagesByVariableValue(flavors, variableValue, variableType) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
let packagesToExport = yield this.batchImportExportApi.findActivePackagesByVariableValue(flavors, variableValue, variableType);
|
|
107
|
+
packagesToExport = yield this.studioService.getExportPackagesWithStudioData(packagesToExport, false);
|
|
108
|
+
this.exportListOfPackages(packagesToExport);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
listActivePackagesByVariableValue(flavors, variableValue, variableType) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const packagesByVariableValue = yield this.batchImportExportApi.findActivePackagesByVariableValue(flavors, variableValue, variableType);
|
|
114
|
+
packagesByVariableValue.forEach(pkg => {
|
|
115
|
+
logger_1.logger.info(`${pkg.name} - Key: "${pkg.key}"`);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
99
119
|
exportListOfPackages(packages) {
|
|
100
120
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
101
121
|
file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(packages), filename);
|
|
@@ -118,7 +138,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
118
138
|
});
|
|
119
139
|
});
|
|
120
140
|
});
|
|
121
|
-
return
|
|
141
|
+
return this.batchImportExportApi.findVariablesWithValuesByPackageKeysAndVersion(variableExportRequest);
|
|
122
142
|
}
|
|
123
143
|
buildBodyForImport(configs, variablesManifests) {
|
|
124
144
|
const formData = new FormData();
|
|
@@ -147,5 +167,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
147
167
|
return null;
|
|
148
168
|
}
|
|
149
169
|
}
|
|
150
|
-
exports.
|
|
170
|
+
exports.BatchImportExportService = BatchImportExportService;
|
|
151
171
|
});
|
|
@@ -0,0 +1,76 @@
|
|
|
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", "./batch-import-export.service", "./variable.service", "./diff.service"], factory);
|
|
17
|
+
}
|
|
18
|
+
})(function (require, exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ConfigCommandService = void 0;
|
|
22
|
+
const batch_import_export_service_1 = require("./batch-import-export.service");
|
|
23
|
+
const variable_service_1 = require("./variable.service");
|
|
24
|
+
const diff_service_1 = require("./diff.service");
|
|
25
|
+
class ConfigCommandService {
|
|
26
|
+
constructor(context) {
|
|
27
|
+
this.batchImportExportService = new batch_import_export_service_1.BatchImportExportService(context);
|
|
28
|
+
this.variableService = new variable_service_1.VariableService(context);
|
|
29
|
+
this.diffService = new diff_service_1.DiffService(context);
|
|
30
|
+
}
|
|
31
|
+
listActivePackages(jsonResponse, flavors, withDependencies, packageKeys, variableValue, variableType) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
if (variableValue) {
|
|
34
|
+
yield this.listPackagesByVariableValue(jsonResponse, flavors, variableValue, variableType);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (jsonResponse) {
|
|
38
|
+
yield this.batchImportExportService.findAndExportListOfActivePackages(flavors !== null && flavors !== void 0 ? flavors : [], packageKeys !== null && packageKeys !== void 0 ? packageKeys : [], withDependencies);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
yield this.batchImportExportService.listActivePackages(flavors !== null && flavors !== void 0 ? flavors : []);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
listVariables(jsonResponse, keysByVersion, keysByVersionFile) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
if (jsonResponse) {
|
|
48
|
+
yield this.variableService.exportVariables(keysByVersion, keysByVersionFile);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
yield this.variableService.listVariables(keysByVersion, keysByVersionFile);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
batchExportPackages(packageKeys, withDependencies = false) {
|
|
56
|
+
return this.batchImportExportService.batchExportPackages(packageKeys, withDependencies);
|
|
57
|
+
}
|
|
58
|
+
batchImportPackages(file, overwrite) {
|
|
59
|
+
return this.batchImportExportService.batchImportPackages(file, overwrite);
|
|
60
|
+
}
|
|
61
|
+
diffPackages(file, hasChanges, jsonResponse) {
|
|
62
|
+
return this.diffService.diffPackages(file, hasChanges, jsonResponse);
|
|
63
|
+
}
|
|
64
|
+
listPackagesByVariableValue(jsonResponse, flavors, variableValue, variableType) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
if (jsonResponse) {
|
|
67
|
+
yield this.batchImportExportService.findAndExportListOfActivePackagesByVariableValue(flavors !== null && flavors !== void 0 ? flavors : [], variableValue, variableType);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
yield this.batchImportExportService.listActivePackagesByVariableValue(flavors !== null && flavors !== void 0 ? flavors : [], variableValue, variableType);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.ConfigCommandService = ConfigCommandService;
|
|
76
|
+
});
|
|
@@ -13,20 +13,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "adm-zip", "stream", "form-data", "../../
|
|
16
|
+
define(["require", "exports", "adm-zip", "stream", "form-data", "uuid", "../../core/utils/logger", "../../core/utils/file-service", "./api/diff-api"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
21
|
+
exports.DiffService = void 0;
|
|
22
22
|
const AdmZip = require("adm-zip");
|
|
23
23
|
const stream_1 = require("stream");
|
|
24
24
|
const FormData = require("form-data");
|
|
25
|
-
const diff_api_1 = require("../../api/diff-api");
|
|
26
|
-
const file_service_1 = require("../file-service");
|
|
27
|
-
const logger_1 = require("../../util/logger");
|
|
28
25
|
const uuid_1 = require("uuid");
|
|
26
|
+
const logger_1 = require("../../core/utils/logger");
|
|
27
|
+
const file_service_1 = require("../../core/utils/file-service");
|
|
28
|
+
const diff_api_1 = require("./api/diff-api");
|
|
29
29
|
class DiffService {
|
|
30
|
+
constructor(context) {
|
|
31
|
+
this.diffApi = new diff_api_1.DiffApi(context);
|
|
32
|
+
}
|
|
30
33
|
diffPackages(file, hasChanges, jsonResponse) {
|
|
31
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
35
|
if (hasChanges) {
|
|
@@ -41,7 +44,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
41
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
45
|
const packages = new AdmZip(file);
|
|
43
46
|
const formData = this.buildBodyForDiff(packages);
|
|
44
|
-
const returnedHasChangesData = yield
|
|
47
|
+
const returnedHasChangesData = yield this.diffApi.hasChanges(formData);
|
|
45
48
|
if (jsonResponse) {
|
|
46
49
|
this.exportListOfPackageDiffMetadata(returnedHasChangesData);
|
|
47
50
|
}
|
|
@@ -54,7 +57,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
54
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
58
|
const packages = new AdmZip(file);
|
|
56
59
|
const formData = this.buildBodyForDiff(packages);
|
|
57
|
-
const returnedHasChangesData = yield
|
|
60
|
+
const returnedHasChangesData = yield this.diffApi.diffPackages(formData);
|
|
58
61
|
if (jsonResponse) {
|
|
59
62
|
this.exportListOfPackageDiffs(returnedHasChangesData);
|
|
60
63
|
}
|
|
@@ -94,5 +97,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
94
97
|
return "\n" + JSON.stringify(packageDiffMetadata, null, 2);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
|
-
exports.
|
|
100
|
+
exports.DiffService = DiffService;
|
|
98
101
|
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commands related to Celonis configuration management.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
(function (factory) {
|
|
14
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
15
|
+
var v = factory(require, exports);
|
|
16
|
+
if (v !== undefined) module.exports = v;
|
|
17
|
+
}
|
|
18
|
+
else if (typeof define === "function" && define.amd) {
|
|
19
|
+
define(["require", "exports", "../../core/command/module-handler", "./config-command.service", "./variable-command.service"], factory);
|
|
20
|
+
}
|
|
21
|
+
})(function (require, exports) {
|
|
22
|
+
"use strict";
|
|
23
|
+
const module_handler_1 = require("../../core/command/module-handler");
|
|
24
|
+
const config_command_service_1 = require("./config-command.service");
|
|
25
|
+
const variable_command_service_1 = require("./variable-command.service");
|
|
26
|
+
class Module extends module_handler_1.IModule {
|
|
27
|
+
register(context, configurator) {
|
|
28
|
+
const configCommand = configurator.command("config");
|
|
29
|
+
configCommand.command("list")
|
|
30
|
+
.description("Command to list active packages that can be exported")
|
|
31
|
+
.option("--json", "Return response as json type", "")
|
|
32
|
+
.option("--flavors <flavors...>", "Lists only active packages of the given flavors")
|
|
33
|
+
.option("--withDependencies", "Include dependencies", "")
|
|
34
|
+
.option("--packageKeys <packageKeys...>", "Lists only given package keys")
|
|
35
|
+
.option("--variableValue <variableValue>", "Variable value for filtering packages by.")
|
|
36
|
+
.option("--variableType <variableType>", "Variable type for filtering packages by.")
|
|
37
|
+
.action(this.listActivePackages);
|
|
38
|
+
configCommand.command("export")
|
|
39
|
+
.description("Command to export package configs")
|
|
40
|
+
.requiredOption("--packageKeys <packageKeys...>", "Keys of packages to export")
|
|
41
|
+
.option("--withDependencies", "Include variables and dependencies", "")
|
|
42
|
+
.action(this.batchExportPackages);
|
|
43
|
+
configCommand.command("import")
|
|
44
|
+
.description("Command to import package configs")
|
|
45
|
+
.option("--overwrite", "Flag to allow overwriting of packages")
|
|
46
|
+
.requiredOption("-f, --file <file>", "Exported packages file (relative path)")
|
|
47
|
+
.action(this.batchImportPackages);
|
|
48
|
+
configCommand.command("diff")
|
|
49
|
+
.description("Command to diff configs of packages")
|
|
50
|
+
.option("--hasChanges", "Flag to return only the information if the package has changes without the actual changes")
|
|
51
|
+
.option("--json", "Return the response as a JSON file")
|
|
52
|
+
.requiredOption("-f, --file <file>", "Exported packages file (relative or absolute path)")
|
|
53
|
+
.action(this.diffPackages);
|
|
54
|
+
const variablesCommand = configCommand.command("variables")
|
|
55
|
+
.description("Commands related to variable configs");
|
|
56
|
+
variablesCommand.command("list")
|
|
57
|
+
.description("Command to list versioned variables of packages")
|
|
58
|
+
.option("--json", "Return response as json type", "")
|
|
59
|
+
.option("--keysByVersion <keysByVersion...>", "Mapping of package keys and versions", "")
|
|
60
|
+
.option("--keysByVersionFile <keysByVersionFile>", "Package keys by version mappings file path.", "")
|
|
61
|
+
.action(this.listVariables);
|
|
62
|
+
const listCommand = configurator.command("list");
|
|
63
|
+
listCommand.command("assignments")
|
|
64
|
+
.description("Command to list possible variable assignments for a type")
|
|
65
|
+
.option("--json", "Return response as json type", "")
|
|
66
|
+
.requiredOption("--type <type>", "Type of variable")
|
|
67
|
+
.option("--params <params>", "Variable query params")
|
|
68
|
+
.action(this.listAssignments);
|
|
69
|
+
}
|
|
70
|
+
listActivePackages(context, command, options) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
yield new config_command_service_1.ConfigCommandService(context).listActivePackages(options.json, options.flavors, options.withDependencies, options.packageKeys, options.variableValue, options.variableType);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
batchExportPackages(context, command, options) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
yield new config_command_service_1.ConfigCommandService(context).batchExportPackages(options.packageKeys, options.withDependencies);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
batchImportPackages(context, command, options) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
yield new config_command_service_1.ConfigCommandService(context).batchImportPackages(options.file, options.overwrite);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
diffPackages(context, command, options) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
yield new config_command_service_1.ConfigCommandService(context).diffPackages(options.file, options.hasChanges, options.json);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
listVariables(context, command, options) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
yield new config_command_service_1.ConfigCommandService(context).listVariables(options.json, options.keysByVersion, options.keysByVersionFile);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
listAssignments(context, command, options) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
yield new variable_command_service_1.VariableCommandService(context).listAssignments(options.type, options.json, options.params);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return Module;
|
|
102
|
+
});
|
|
@@ -13,31 +13,40 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "
|
|
16
|
+
define(["require", "exports", "adm-zip", "../studio/interfaces/package-manager.interfaces", "./interfaces/batch-export-import.constants", "../../core/utils/json", "../studio/api/package-api", "../studio/service/data-model.service", "../studio/api/node-api", "../studio/api/space-api", "../studio/api/studio-variables-api", "../studio/service/space.service", "../studio/service/studio-variable.service"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
const package_api_1 = require("../../api/package-api");
|
|
23
|
-
const package_manager_interfaces_1 = require("../../interfaces/package-manager.interfaces");
|
|
24
|
-
const datamodel_service_1 = require("../package-manager/datamodel-service");
|
|
25
|
-
const json_1 = require("../../util/json");
|
|
26
|
-
const node_api_1 = require("../../api/node-api");
|
|
27
|
-
const variables_api_1 = require("../../api/variables-api");
|
|
28
|
-
const space_api_1 = require("../../api/space-api");
|
|
29
|
-
const space_service_1 = require("../package-manager/space-service");
|
|
30
|
-
const variable_service_1 = require("../package-manager/variable-service");
|
|
31
|
-
const batch_export_import_constants_1 = require("../../interfaces/batch-export-import-constants");
|
|
21
|
+
exports.StudioService = void 0;
|
|
32
22
|
const AdmZip = require("adm-zip");
|
|
23
|
+
const package_manager_interfaces_1 = require("../studio/interfaces/package-manager.interfaces");
|
|
24
|
+
const batch_export_import_constants_1 = require("./interfaces/batch-export-import.constants");
|
|
25
|
+
const json_1 = require("../../core/utils/json");
|
|
26
|
+
const package_api_1 = require("../studio/api/package-api");
|
|
27
|
+
const data_model_service_1 = require("../studio/service/data-model.service");
|
|
28
|
+
const node_api_1 = require("../studio/api/node-api");
|
|
29
|
+
const space_api_1 = require("../studio/api/space-api");
|
|
30
|
+
const studio_variables_api_1 = require("../studio/api/studio-variables-api");
|
|
31
|
+
const space_service_1 = require("../studio/service/space.service");
|
|
32
|
+
const studio_variable_service_1 = require("../studio/service/studio-variable.service");
|
|
33
33
|
class StudioService {
|
|
34
|
+
constructor(context) {
|
|
35
|
+
this.studioPackageApi = new package_api_1.PackageApi(context);
|
|
36
|
+
this.studioNodeApi = new node_api_1.NodeApi(context);
|
|
37
|
+
this.studioSpaceApi = new space_api_1.SpaceApi(context);
|
|
38
|
+
this.studioVariablesApi = new studio_variables_api_1.StudioVariablesApi(context);
|
|
39
|
+
this.studioDataModelService = new data_model_service_1.DataModelService(context);
|
|
40
|
+
this.studioSpaceService = new space_service_1.SpaceService(context);
|
|
41
|
+
this.studioVariableService = new studio_variable_service_1.StudioVariableService(context);
|
|
42
|
+
}
|
|
34
43
|
getExportPackagesWithStudioData(packagesToExport, withDependencies) {
|
|
35
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const studioPackagesWithDataModels = yield
|
|
37
|
-
packagesToExport =
|
|
45
|
+
const studioPackagesWithDataModels = yield this.studioPackageApi.findAllPackagesWithVariableAssignments(package_manager_interfaces_1.PackageManagerVariableType.DATA_MODEL);
|
|
46
|
+
packagesToExport = this.setSpaceIdForStudioPackages(packagesToExport, studioPackagesWithDataModels);
|
|
38
47
|
if (withDependencies) {
|
|
39
|
-
const dataModelDetailsByNode = yield
|
|
40
|
-
packagesToExport =
|
|
48
|
+
const dataModelDetailsByNode = yield this.studioDataModelService.getDataModelDetailsForPackages(studioPackagesWithDataModels);
|
|
49
|
+
packagesToExport = this.setDataModelsForStudioPackages(packagesToExport, studioPackagesWithDataModels, dataModelDetailsByNode);
|
|
41
50
|
}
|
|
42
51
|
return packagesToExport;
|
|
43
52
|
});
|
|
@@ -53,9 +62,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
53
62
|
getStudioPackageManifests(studioPackageKeys) {
|
|
54
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
64
|
return Promise.all(studioPackageKeys.map((packageKey) => __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const node = yield
|
|
57
|
-
const nodeSpace = yield
|
|
58
|
-
const variableAssignments = yield
|
|
65
|
+
const node = yield this.studioNodeApi.findOneByKeyAndRootNodeKey(packageKey, packageKey);
|
|
66
|
+
const nodeSpace = yield this.studioSpaceApi.findOne(node.spaceId);
|
|
67
|
+
const variableAssignments = yield this.studioVariablesApi.getRuntimeVariableValues(packageKey, batch_export_import_constants_1.BatchExportImportConstants.APP_MODE_VIEWER);
|
|
59
68
|
return {
|
|
60
69
|
packageKey: packageKey,
|
|
61
70
|
space: {
|
|
@@ -81,7 +90,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
81
90
|
for (const manifest of studioManifests) {
|
|
82
91
|
const existingPackage = existingStudioPackages.find(existingPackage => existingPackage.key === manifest.packageKey);
|
|
83
92
|
if (existingPackage) {
|
|
84
|
-
yield
|
|
93
|
+
yield this.studioPackageApi.movePackageToSpace(existingPackage.id, manifest.space.id);
|
|
85
94
|
}
|
|
86
95
|
yield this.assignRuntimeVariables(manifest);
|
|
87
96
|
}
|
|
@@ -185,7 +194,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
185
194
|
}
|
|
186
195
|
findDesiredSpaceIdForPackage(studioPackageManifest) {
|
|
187
196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
-
const allSpaces = yield
|
|
197
|
+
const allSpaces = yield this.studioSpaceService.refreshAndGetAllSpaces();
|
|
189
198
|
if (studioPackageManifest.space.id) {
|
|
190
199
|
const targetSpace = allSpaces.find(space => space.id === studioPackageManifest.space.id);
|
|
191
200
|
if (!targetSpace) {
|
|
@@ -197,14 +206,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
197
206
|
if (targetSpaceByName) {
|
|
198
207
|
return targetSpaceByName.id;
|
|
199
208
|
}
|
|
200
|
-
const spaceTransport = yield
|
|
209
|
+
const spaceTransport = yield this.studioSpaceService.createSpace(studioPackageManifest.space.name, studioPackageManifest.space.iconReference);
|
|
201
210
|
return spaceTransport.id;
|
|
202
211
|
});
|
|
203
212
|
}
|
|
204
213
|
assignRuntimeVariables(manifest) {
|
|
205
214
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
215
|
if (manifest.runtimeVariableAssignments.length) {
|
|
207
|
-
yield
|
|
216
|
+
yield this.studioVariableService.assignVariableValues(manifest.packageKey, manifest.runtimeVariableAssignments);
|
|
208
217
|
}
|
|
209
218
|
});
|
|
210
219
|
}
|
|
@@ -215,5 +224,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
215
224
|
return nodeContent;
|
|
216
225
|
}
|
|
217
226
|
}
|
|
218
|
-
exports.
|
|
227
|
+
exports.StudioService = StudioService;
|
|
219
228
|
});
|
package/commands/{variable.command.js → configuration-management/variable-command.service.js}
RENAMED
|
@@ -13,24 +13,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "
|
|
16
|
+
define(["require", "exports", "./variable.service"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
const variable_service_1 = require("
|
|
23
|
-
class
|
|
21
|
+
exports.VariableCommandService = void 0;
|
|
22
|
+
const variable_service_1 = require("./variable.service");
|
|
23
|
+
class VariableCommandService {
|
|
24
|
+
constructor(context) {
|
|
25
|
+
this.variableService = new variable_service_1.VariableService(context);
|
|
26
|
+
}
|
|
24
27
|
listAssignments(variableType, jsonResponse, params) {
|
|
25
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
29
|
if (jsonResponse) {
|
|
27
|
-
yield
|
|
30
|
+
yield this.variableService.findAndExportCandidateAssignments(variableType, params);
|
|
28
31
|
}
|
|
29
32
|
else {
|
|
30
|
-
yield
|
|
33
|
+
yield this.variableService.listCandidateAssignments(variableType, params);
|
|
31
34
|
}
|
|
32
35
|
});
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
|
-
exports.
|
|
38
|
+
exports.VariableCommandService = VariableCommandService;
|
|
36
39
|
});
|