@celonis/content-cli 0.13.4 → 0.13.6
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/batch-import-export-api.js +11 -0
- package/commands/config.command.js +15 -1
- package/content-cli-config.js +3 -1
- package/lib/api/batch-import-export-api.d.ts +1 -0
- package/lib/commands/config.command.d.ts +2 -1
- package/lib/services/package-manager/batch-import-export-service.d.ts +2 -0
- package/package.json +1 -1
- package/services/package-manager/batch-import-export-service.js +15 -0
- package/services/package-manager/package-service.js +2 -2
|
@@ -21,6 +21,17 @@
|
|
|
21
21
|
throw new logger_1.FatalError(`Problem getting active packages: ${e}`);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
findActivePackagesByVariableValue(flavors, variableValue, variableType) {
|
|
25
|
+
const queryParams = new URLSearchParams();
|
|
26
|
+
queryParams.set("variableValue", variableValue);
|
|
27
|
+
if (variableType) {
|
|
28
|
+
queryParams.set("variableType", variableType);
|
|
29
|
+
}
|
|
30
|
+
flavors.forEach(flavor => queryParams.append("flavors", flavor));
|
|
31
|
+
return http_client_service_v2_1.httpClientV2.get(`/package-manager/api/core/packages/export/list-by-variable-value?${queryParams.toString()}`).catch(e => {
|
|
32
|
+
throw new logger_1.FatalError(`Problem getting active packages by variable value: ${e}`);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
24
35
|
findActivePackagesByKeys(packageKeys, withDependencies = false) {
|
|
25
36
|
const queryParams = new URLSearchParams();
|
|
26
37
|
packageKeys.forEach(key => queryParams.append("packageKeys", key));
|
|
@@ -23,8 +23,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
const variable_service_1 = require("../services/package-manager/variable-service");
|
|
24
24
|
const diff_service_1 = require("../services/package-manager/diff-service");
|
|
25
25
|
class ConfigCommand {
|
|
26
|
-
listActivePackages(jsonResponse, flavors, withDependencies, packageKeys) {
|
|
26
|
+
listActivePackages(jsonResponse, flavors, withDependencies, packageKeys, variableValue, variableType) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (variableValue) {
|
|
29
|
+
yield this.listPackagesByVariableValue(jsonResponse, flavors, variableValue, variableType);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
28
32
|
if (jsonResponse) {
|
|
29
33
|
yield batch_import_export_service_1.batchImportExportService.findAndExportListOfActivePackages(flavors !== null && flavors !== void 0 ? flavors : [], packageKeys !== null && packageKeys !== void 0 ? packageKeys : [], withDependencies);
|
|
30
34
|
}
|
|
@@ -52,6 +56,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
52
56
|
diffPackages(file, hasChanges, jsonResponse) {
|
|
53
57
|
return diff_service_1.diffService.diffPackages(file, hasChanges, jsonResponse);
|
|
54
58
|
}
|
|
59
|
+
listPackagesByVariableValue(jsonResponse, flavors, variableValue, variableType) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
if (jsonResponse) {
|
|
62
|
+
yield batch_import_export_service_1.batchImportExportService.findAndExportListOfActivePackagesByVariableValue(flavors !== null && flavors !== void 0 ? flavors : [], variableValue, variableType);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
yield batch_import_export_service_1.batchImportExportService.listActivePackagesByVariableValue(flavors !== null && flavors !== void 0 ? flavors : [], variableValue, variableType);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
55
69
|
}
|
|
56
70
|
exports.ConfigCommand = ConfigCommand;
|
|
57
71
|
});
|
package/content-cli-config.js
CHANGED
|
@@ -33,8 +33,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
33
33
|
.option("--flavors <flavors...>", "Lists only active packages of the given flavors")
|
|
34
34
|
.option("--withDependencies", "Include dependencies", "")
|
|
35
35
|
.option("--packageKeys <packageKeys...>", "Lists only given package keys")
|
|
36
|
+
.option("--variableValue <variableValue>", "Variable value for filtering packages by.")
|
|
37
|
+
.option("--variableType <variableType>", "Variable type for filtering packages by.")
|
|
36
38
|
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
yield new config_command_1.ConfigCommand().listActivePackages(cmd.json, cmd.flavors, cmd.withDependencies, cmd.packageKeys);
|
|
39
|
+
yield new config_command_1.ConfigCommand().listActivePackages(cmd.json, cmd.flavors, cmd.withDependencies, cmd.packageKeys, cmd.variableValue, cmd.variableType);
|
|
38
40
|
process.exit();
|
|
39
41
|
}));
|
|
40
42
|
return program;
|
|
@@ -4,6 +4,7 @@ import * as FormData from "form-data";
|
|
|
4
4
|
declare class BatchImportExportApi {
|
|
5
5
|
static readonly INSTANCE: BatchImportExportApi;
|
|
6
6
|
findAllActivePackages(flavors: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
|
|
7
|
+
findActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<PackageExportTransport[]>;
|
|
7
8
|
findActivePackagesByKeys(packageKeys: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
|
|
8
9
|
exportPackages(packageKeys: string[], withDependencies?: boolean): Promise<Buffer>;
|
|
9
10
|
importPackages(data: FormData, overwrite: boolean): Promise<PostPackageImportData[]>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare class ConfigCommand {
|
|
2
|
-
listActivePackages(jsonResponse: boolean, flavors: string[], withDependencies: boolean, packageKeys: string[]): Promise<void>;
|
|
2
|
+
listActivePackages(jsonResponse: boolean, flavors: string[], withDependencies: boolean, packageKeys: string[], variableValue: string, variableType: string): Promise<void>;
|
|
3
3
|
listVariables(jsonResponse: boolean, keysByVersion: string[], keysByVersionFile: string): Promise<void>;
|
|
4
4
|
batchExportPackages(packageKeys: string[], withDependencies?: boolean): Promise<void>;
|
|
5
5
|
batchImportPackages(file: string, overwrite: boolean): Promise<void>;
|
|
6
6
|
diffPackages(file: string, hasChanges: boolean, jsonResponse: boolean): Promise<void>;
|
|
7
|
+
private listPackagesByVariableValue;
|
|
7
8
|
}
|
|
@@ -3,6 +3,8 @@ declare class BatchImportExportService {
|
|
|
3
3
|
findAndExportListOfActivePackages(flavors: string[], packageKeys: string[], withDependencies: boolean): Promise<void>;
|
|
4
4
|
batchExportPackages(packageKeys: string[], withDependencies?: boolean): Promise<void>;
|
|
5
5
|
batchImportPackages(file: string, overwrite: boolean): Promise<void>;
|
|
6
|
+
findAndExportListOfActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<void>;
|
|
7
|
+
listActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<void>;
|
|
6
8
|
private exportListOfPackages;
|
|
7
9
|
private getVersionsByPackageKey;
|
|
8
10
|
private getVersionedVariablesForPackagesWithKeys;
|
package/package.json
CHANGED
|
@@ -96,6 +96,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
96
96
|
logger_1.logger.info("Config import report file: " + reportFileName);
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
+
findAndExportListOfActivePackagesByVariableValue(flavors, variableValue, variableType) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
let packagesToExport = yield batch_import_export_api_1.batchImportExportApi.findActivePackagesByVariableValue(flavors, variableValue, variableType);
|
|
102
|
+
packagesToExport = yield studio_service_1.studioService.getExportPackagesWithStudioData(packagesToExport, false);
|
|
103
|
+
this.exportListOfPackages(packagesToExport);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
listActivePackagesByVariableValue(flavors, variableValue, variableType) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const packagesByVariableValue = yield batch_import_export_api_1.batchImportExportApi.findActivePackagesByVariableValue(flavors, variableValue, variableType);
|
|
109
|
+
packagesByVariableValue.forEach(pkg => {
|
|
110
|
+
logger_1.logger.info(`${pkg.name} - Key: "${pkg.key}"`);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
99
114
|
exportListOfPackages(packages) {
|
|
100
115
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
101
116
|
file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(packages), filename);
|
|
@@ -50,13 +50,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
50
50
|
}
|
|
51
51
|
findAndExportListOfAllPackages(includeDependencies, packageKeys) {
|
|
52
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const fieldsToInclude = ["key", "name", "changeDate", "activatedDraftId", "workingDraftId", "spaceId"];
|
|
53
|
+
const fieldsToInclude = ["key", "name", "changeDate", "activatedDraftId", "workingDraftId", "spaceId", "id"];
|
|
54
54
|
let nodesListToExport = yield package_api_1.packageApi.findAllPackages();
|
|
55
55
|
if (packageKeys.length > 0) {
|
|
56
56
|
nodesListToExport = nodesListToExport.filter(node => packageKeys.includes(node.rootNodeKey));
|
|
57
57
|
}
|
|
58
58
|
if (includeDependencies) {
|
|
59
|
-
fieldsToInclude.push("type", "value", "dependencies", "
|
|
59
|
+
fieldsToInclude.push("type", "value", "dependencies", "updateAvailable", "version", "poolId", "node", "dataModelId", "dataPool", "datamodels");
|
|
60
60
|
const unPublishedNodes = nodesListToExport.filter(node => !node.activatedDraftId);
|
|
61
61
|
let publishedNodes = nodesListToExport.filter(node => node.activatedDraftId);
|
|
62
62
|
publishedNodes = yield this.getNodesWithActiveVersion(publishedNodes);
|