@celonis/content-cli 1.0.5 → 1.0.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/commands/configuration-management/api/batch-import-export-api.js +9 -0
- package/commands/configuration-management/batch-import-export.service.js +18 -0
- package/commands/configuration-management/config-command.service.js +3 -0
- package/commands/configuration-management/module.js +13 -0
- package/lib/commands/configuration-management/api/batch-import-export-api.d.ts +2 -1
- package/lib/commands/configuration-management/batch-import-export.service.d.ts +2 -0
- package/lib/commands/configuration-management/config-command.service.d.ts +1 -0
- package/lib/commands/configuration-management/interfaces/package-export.interfaces.d.ts +4 -0
- package/lib/commands/configuration-management/module.d.ts +1 -0
- package/package.json +1 -1
|
@@ -67,6 +67,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
+
batchExportPackagesMetadata(packageKeys) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const queryParams = new URLSearchParams();
|
|
73
|
+
packageKeys.forEach(packageKey => queryParams.append("packageKeys", packageKey));
|
|
74
|
+
return this.httpClient().get(`/package-manager/api/core/packages/metadata/export?${queryParams.toString()}`).catch(e => {
|
|
75
|
+
throw new logger_1.FatalError(`Problem exporting packages metadata: ${e}`);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
70
79
|
importPackages(data, overwrite) {
|
|
71
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
81
|
return this.httpClient().postFile("/package-manager/api/core/packages/import/batch", data, { overwrite });
|
|
@@ -86,6 +86,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
86
86
|
logger_1.logger.info(fileDownloadedMessage + filename);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
+
batchExportPackagesMetadata(packageKeys, jsonResponse) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const exportedPackagesMetadata = yield this.batchImportExportApi.batchExportPackagesMetadata(packageKeys);
|
|
92
|
+
if (jsonResponse) {
|
|
93
|
+
this.exportListOfPackagesMetadata(exportedPackagesMetadata);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
exportedPackagesMetadata.forEach(pkg => {
|
|
97
|
+
logger_1.logger.info(`${pkg.key} - Has Unpublished Changes: ${pkg.hasUnpublishedChanges}`);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
89
102
|
batchImportPackages(file, overwrite) {
|
|
90
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
104
|
let configs = new AdmZip(file);
|
|
@@ -140,6 +153,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
140
153
|
});
|
|
141
154
|
return this.batchImportExportApi.findVariablesWithValuesByPackageKeysAndVersion(variableExportRequest);
|
|
142
155
|
}
|
|
156
|
+
exportListOfPackagesMetadata(packagesMetadata) {
|
|
157
|
+
const filename = (0, uuid_1.v4)() + ".json";
|
|
158
|
+
file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(packagesMetadata), filename);
|
|
159
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + filename);
|
|
160
|
+
}
|
|
143
161
|
buildBodyForImport(configs, variablesManifests) {
|
|
144
162
|
const formData = new FormData();
|
|
145
163
|
const readableStream = this.getReadableStream(configs);
|
|
@@ -55,6 +55,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
55
55
|
batchExportPackages(packageKeys, withDependencies = false) {
|
|
56
56
|
return this.batchImportExportService.batchExportPackages(packageKeys, withDependencies);
|
|
57
57
|
}
|
|
58
|
+
batchExportPackagesMetadata(packageKeys, jsonResponse) {
|
|
59
|
+
return this.batchImportExportService.batchExportPackagesMetadata(packageKeys, jsonResponse);
|
|
60
|
+
}
|
|
58
61
|
batchImportPackages(file, overwrite) {
|
|
59
62
|
return this.batchImportExportService.batchImportPackages(file, overwrite);
|
|
60
63
|
}
|
|
@@ -40,6 +40,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
40
40
|
.requiredOption("--packageKeys <packageKeys...>", "Keys of packages to export")
|
|
41
41
|
.option("--withDependencies", "Include variables and dependencies", "")
|
|
42
42
|
.action(this.batchExportPackages);
|
|
43
|
+
const metadataCommand = configCommand.command("metadata")
|
|
44
|
+
.description("Commands related to package metadata");
|
|
45
|
+
metadataCommand
|
|
46
|
+
.command("export")
|
|
47
|
+
.description("Command to show whether packages have unpublished changes")
|
|
48
|
+
.requiredOption("--packageKeys <packageKeys...>", "Keys of packages to find the metadata of")
|
|
49
|
+
.option("--json", "Return response as json type", "")
|
|
50
|
+
.action(this.batchExportPackagesMetadata);
|
|
43
51
|
configCommand.command("import")
|
|
44
52
|
.description("Command to import package configs")
|
|
45
53
|
.option("--overwrite", "Flag to allow overwriting of packages")
|
|
@@ -77,6 +85,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
77
85
|
yield new config_command_service_1.ConfigCommandService(context).batchExportPackages(options.packageKeys, options.withDependencies);
|
|
78
86
|
});
|
|
79
87
|
}
|
|
88
|
+
batchExportPackagesMetadata(context, command, options) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
yield new config_command_service_1.ConfigCommandService(context).batchExportPackagesMetadata(options.packageKeys, options.json);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
80
93
|
batchImportPackages(context, command, options) {
|
|
81
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
95
|
yield new config_command_service_1.ConfigCommandService(context).batchImportPackages(options.file, options.overwrite);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as FormData from "form-data";
|
|
3
|
-
import { PackageExportTransport, PackageKeyAndVersionPair, PostPackageImportData, VariableManifestTransport } from "../interfaces/package-export.interfaces";
|
|
3
|
+
import { PackageExportTransport, PackageKeyAndVersionPair, PackageMetadataExportTransport, PostPackageImportData, VariableManifestTransport } from "../interfaces/package-export.interfaces";
|
|
4
4
|
import { Context } from "../../../core/command/cli-context";
|
|
5
5
|
export declare class BatchImportExportApi {
|
|
6
6
|
private httpClient;
|
|
@@ -9,6 +9,7 @@ export declare class BatchImportExportApi {
|
|
|
9
9
|
findActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<PackageExportTransport[]>;
|
|
10
10
|
findActivePackagesByKeys(packageKeys: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
|
|
11
11
|
exportPackages(packageKeys: string[], withDependencies?: boolean): Promise<Buffer>;
|
|
12
|
+
batchExportPackagesMetadata(packageKeys: string[]): Promise<PackageMetadataExportTransport[]>;
|
|
12
13
|
importPackages(data: FormData, overwrite: boolean): Promise<PostPackageImportData[]>;
|
|
13
14
|
findVariablesWithValuesByPackageKeysAndVersion(packagesByKeyAndVersion: PackageKeyAndVersionPair[]): Promise<VariableManifestTransport[]>;
|
|
14
15
|
}
|
|
@@ -7,12 +7,14 @@ export declare class BatchImportExportService {
|
|
|
7
7
|
listActivePackages(flavors: string[]): Promise<void>;
|
|
8
8
|
findAndExportListOfActivePackages(flavors: string[], packageKeys: string[], withDependencies: boolean): Promise<void>;
|
|
9
9
|
batchExportPackages(packageKeys: string[], withDependencies?: boolean): Promise<void>;
|
|
10
|
+
batchExportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
|
|
10
11
|
batchImportPackages(file: string, overwrite: boolean): Promise<void>;
|
|
11
12
|
findAndExportListOfActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<void>;
|
|
12
13
|
listActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<void>;
|
|
13
14
|
private exportListOfPackages;
|
|
14
15
|
private getVersionsByPackageKey;
|
|
15
16
|
private getVersionedVariablesForPackagesWithKeys;
|
|
17
|
+
private exportListOfPackagesMetadata;
|
|
16
18
|
private buildBodyForImport;
|
|
17
19
|
private getReadableStream;
|
|
18
20
|
private parseEntryData;
|
|
@@ -7,6 +7,7 @@ export declare class ConfigCommandService {
|
|
|
7
7
|
listActivePackages(jsonResponse: boolean, flavors: string[], withDependencies: boolean, packageKeys: string[], variableValue: string, variableType: string): Promise<void>;
|
|
8
8
|
listVariables(jsonResponse: boolean, keysByVersion: string[], keysByVersionFile: string): Promise<void>;
|
|
9
9
|
batchExportPackages(packageKeys: string[], withDependencies?: boolean): Promise<void>;
|
|
10
|
+
batchExportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
|
|
10
11
|
batchImportPackages(file: string, overwrite: boolean): Promise<void>;
|
|
11
12
|
diffPackages(file: string, hasChanges: boolean, jsonResponse: boolean): Promise<void>;
|
|
12
13
|
private listPackagesByVariableValue;
|
|
@@ -18,6 +18,10 @@ export interface PackageExportTransport {
|
|
|
18
18
|
spaceId?: string;
|
|
19
19
|
datamodels?: StudioComputeNodeDescriptor[];
|
|
20
20
|
}
|
|
21
|
+
export interface PackageMetadataExportTransport {
|
|
22
|
+
key: string;
|
|
23
|
+
hasUnpublishedChanges: boolean;
|
|
24
|
+
}
|
|
21
25
|
export interface PackageManifestTransport {
|
|
22
26
|
packageKey: string;
|
|
23
27
|
flavor: string;
|
|
@@ -7,6 +7,7 @@ declare class Module extends IModule {
|
|
|
7
7
|
register(context: Context, configurator: Configurator): void;
|
|
8
8
|
private listActivePackages;
|
|
9
9
|
private batchExportPackages;
|
|
10
|
+
private batchExportPackagesMetadata;
|
|
10
11
|
private batchImportPackages;
|
|
11
12
|
private diffPackages;
|
|
12
13
|
private listVariables;
|