@celonis/content-cli 1.13.1 → 1.14.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/README.md +17 -5
- package/commands/action-flows/action-flow/action-flow.service.js +9 -9
- package/commands/action-flows/module.js +2 -1
- package/commands/asset-registry/asset-registry-api.js +1 -30
- package/commands/asset-registry/asset-registry.service.js +20 -67
- package/commands/asset-registry/module.js +0 -26
- package/commands/bookmarks/bookmarks-api.js +49 -0
- package/commands/bookmarks/bookmarks-command.service.js +48 -0
- package/{core/utils/path.js → commands/bookmarks/bookmarks.interfaces.js} +0 -5
- package/commands/bookmarks/module.js +49 -0
- package/commands/configuration-management/api/node-api.js +17 -0
- package/commands/configuration-management/branch/api/branch.api.js +88 -0
- package/commands/configuration-management/branch/branch-export-import.command.service.js +283 -0
- package/commands/configuration-management/branch/branch.command.service.js +182 -0
- package/commands/configuration-management/branch/interfaces/branch.interfaces.js +41 -0
- package/commands/configuration-management/metadata.service.js +9 -5
- package/commands/configuration-management/module.js +170 -6
- package/commands/configuration-management/node-dependency.service.js +5 -3
- package/commands/configuration-management/node-diff.service.js +10 -6
- package/commands/configuration-management/node.service.js +14 -10
- package/commands/configuration-management/package-validation.service.js +11 -5
- package/commands/configuration-management/package-version.service.js +7 -5
- package/commands/configuration-management/single-package-export.service.js +6 -6
- package/commands/configuration-management/single-package-import.service.js +28 -24
- package/commands/configuration-management/staging-package.service.js +9 -5
- package/commands/configuration-management/variable.service.js +11 -7
- package/commands/data-pipeline/connection/connection.commands.js +4 -2
- package/commands/data-pipeline/data-pool/data-pool-service.js +13 -9
- package/commands/data-pipeline/data-pool/data-pool.commands.js +2 -1
- package/commands/deployment/deployment.service.js +15 -13
- package/commands/deployment/module.js +4 -7
- package/commands/studio/manager/space.manager.js +21 -10
- package/commands/studio/service/asset-service.js +5 -4
- package/commands/studio/service/package.service.js +9 -5
- package/commands/t2tc/diff.service.js +15 -9
- package/commands/t2tc/t2tc-package.service.js +25 -23
- package/content-cli.js +4 -0
- package/core/command/module-handler.js +8 -1
- package/core/feature-flag/feature-disabled-error.js +52 -0
- package/core/http/http-client.js +18 -0
- package/core/http/http-shared/base.manager.js +35 -59
- package/core/utils/branches.js +10 -0
- package/core/utils/cui-api.js +52 -0
- package/core/utils/cui-file-service.js +106 -0
- package/core/utils/file-service.js +7 -13
- package/lib/commands/action-flows/action-flow/action-flow.service.d.ts +1 -0
- package/lib/commands/asset-registry/asset-registry-api.d.ts +2 -6
- package/lib/commands/asset-registry/asset-registry.interfaces.d.ts +0 -17
- package/lib/commands/asset-registry/asset-registry.service.d.ts +3 -6
- package/lib/commands/asset-registry/module.d.ts +0 -2
- package/lib/commands/bookmarks/bookmarks-api.d.ts +8 -0
- package/lib/commands/bookmarks/bookmarks-command.service.d.ts +8 -0
- package/lib/commands/bookmarks/bookmarks.interfaces.d.ts +34 -0
- package/lib/commands/bookmarks/module.d.ts +8 -0
- package/lib/commands/configuration-management/api/node-api.d.ts +1 -0
- package/lib/commands/configuration-management/branch/api/branch.api.d.ts +12 -0
- package/lib/commands/configuration-management/branch/branch-export-import.command.service.d.ts +37 -0
- package/lib/commands/configuration-management/branch/branch.command.service.d.ts +19 -0
- package/lib/commands/configuration-management/branch/interfaces/branch.interfaces.d.ts +139 -0
- package/lib/commands/configuration-management/interfaces/package-validation.interfaces.d.ts +1 -1
- package/lib/commands/configuration-management/metadata.service.d.ts +1 -0
- package/lib/commands/configuration-management/module.d.ts +8 -0
- package/lib/commands/configuration-management/node-dependency.service.d.ts +1 -0
- package/lib/commands/configuration-management/node-diff.service.d.ts +1 -0
- package/lib/commands/configuration-management/node.service.d.ts +2 -1
- package/lib/commands/configuration-management/package-validation.service.d.ts +1 -0
- package/lib/commands/configuration-management/package-version.service.d.ts +1 -0
- package/lib/commands/configuration-management/single-package-export.service.d.ts +1 -0
- package/lib/commands/configuration-management/single-package-import.service.d.ts +6 -3
- package/lib/commands/configuration-management/staging-package.service.d.ts +1 -0
- package/lib/commands/configuration-management/variable.service.d.ts +1 -0
- package/lib/commands/data-pipeline/data-pool/data-pool-service.d.ts +1 -0
- package/lib/commands/deployment/deployment.service.d.ts +1 -0
- package/lib/commands/studio/service/asset-service.d.ts +1 -0
- package/lib/commands/studio/service/package.service.d.ts +1 -0
- package/lib/commands/t2tc/diff.service.d.ts +1 -0
- package/lib/commands/t2tc/t2tc-package.service.d.ts +1 -0
- package/lib/core/command/module-handler.d.ts +4 -4
- package/lib/core/feature-flag/feature-disabled-error.d.ts +16 -0
- package/lib/core/http/http-client.d.ts +4 -0
- package/lib/core/http/http-shared/base.manager.d.ts +7 -5
- package/lib/core/http/http-shared/manager-config.interface.d.ts +1 -1
- package/lib/core/utils/branches.d.ts +3 -0
- package/lib/core/utils/cui-api.d.ts +26 -0
- package/lib/core/utils/cui-file-service.d.ts +19 -0
- package/lib/core/utils/file-service.d.ts +0 -1
- package/package.json +3 -3
- package/lib/core/utils/path.d.ts +0 -1
|
@@ -16,7 +16,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
16
|
if (v !== undefined) module.exports = v;
|
|
17
17
|
}
|
|
18
18
|
else if (typeof define === "function" && define.amd) {
|
|
19
|
-
define(["require", "exports", "../../core/command/module-handler", "./config-command.service", "./staging-package.service", "./metadata.service", "../t2tc/t2tc-command.service", "./variable-command.service", "./node.service", "./node-diff.service", "./node-dependency.service", "./package-version-command.service", "./package-validation.service", "./single-package-import.service", "./single-package-export.service"], factory);
|
|
19
|
+
define(["require", "exports", "../../core/command/module-handler", "./config-command.service", "./staging-package.service", "./metadata.service", "../t2tc/t2tc-command.service", "./variable-command.service", "./node.service", "./node-diff.service", "./node-dependency.service", "./package-version-command.service", "./package-validation.service", "./single-package-import.service", "./single-package-export.service", "./branch/branch.command.service", "./branch/branch-export-import.command.service", "../../core/utils/branches"], factory);
|
|
20
20
|
}
|
|
21
21
|
})(function (require, exports) {
|
|
22
22
|
"use strict";
|
|
@@ -33,10 +33,80 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
33
33
|
const package_validation_service_1 = require("./package-validation.service");
|
|
34
34
|
const single_package_import_service_1 = require("./single-package-import.service");
|
|
35
35
|
const single_package_export_service_1 = require("./single-package-export.service");
|
|
36
|
+
const branch_command_service_1 = require("./branch/branch.command.service");
|
|
37
|
+
const branch_export_import_command_service_1 = require("./branch/branch-export-import.command.service");
|
|
38
|
+
const branches_1 = require("../../core/utils/branches");
|
|
36
39
|
class Module extends module_handler_1.IModule {
|
|
37
40
|
register(context, configurator) {
|
|
38
41
|
const configCommand = configurator.command("config")
|
|
39
42
|
.description("Manage package configurations and their resources (package, nodes, versions, variables, metadata). Note: 'config list/export/import/diff' are deprecated — bulk Team-to-Team Copy operations have moved to the 't2tc package' group, and single-package operations live under 'config package'.");
|
|
43
|
+
const branchCommand = configCommand.command("branch").beta()
|
|
44
|
+
.description("Author, merge, and mirror package branches");
|
|
45
|
+
const branchSettingsCommand = branchCommand.command("settings").beta()
|
|
46
|
+
.description("Commands to manage branch settings on a package");
|
|
47
|
+
branchSettingsCommand.command("set").beta()
|
|
48
|
+
.description("Configure branch settings on a main package")
|
|
49
|
+
.requiredOption("--packageKey <packageKey>", "Main package key")
|
|
50
|
+
.requiredOption("--enabled <enabled>", "true|false")
|
|
51
|
+
.option("--json", "Write response to a JSON file", false)
|
|
52
|
+
.action(this.setBranchSettings);
|
|
53
|
+
branchCommand.command("create").beta()
|
|
54
|
+
.description("Create a new branch from a source version")
|
|
55
|
+
.requiredOption("--packageKey <packageKey>", "Main package key to branch from")
|
|
56
|
+
.requiredOption("--branchKey <branchKey>", "New branch key")
|
|
57
|
+
.requiredOption("--sourceVersion <sourceVersion>", "Source version to branch from. Must be an existing version; 'LATEST' is not supported here")
|
|
58
|
+
.option("--validate", "Only validate the request without creating the branch", false)
|
|
59
|
+
.option("--json", "Write response to a JSON file", false)
|
|
60
|
+
.action(this.createBranch);
|
|
61
|
+
branchCommand.command("list").beta()
|
|
62
|
+
.description("List branches of a main package")
|
|
63
|
+
.requiredOption("--packageKey <packageKey>", "Main package key")
|
|
64
|
+
.option("--json", "Write response to a JSON file", false)
|
|
65
|
+
.action(this.listBranches);
|
|
66
|
+
branchCommand.command("delete").beta()
|
|
67
|
+
.description("Delete a branch")
|
|
68
|
+
.requiredOption("--packageKey <packageKey>", "Main package key (no '@')")
|
|
69
|
+
.requiredOption("--branchKey <branchKey>", "Branch key to delete")
|
|
70
|
+
.action(this.deleteBranch);
|
|
71
|
+
const branchMergeCommand = branchCommand.command("merge").beta()
|
|
72
|
+
.description("Commands to preview and apply branch merges");
|
|
73
|
+
branchMergeCommand.command("preview").beta()
|
|
74
|
+
.description("Preview the changes a merge would apply to a target branch")
|
|
75
|
+
.requiredOption("--packageKey <packageKey>", "Target package key (main package key or '<mainPackageKey>@<branchKey>')")
|
|
76
|
+
.requiredOption("--sourceKey <sourceKey>", "Source package key (main package key or '<mainPackageKey>@<branchKey>')")
|
|
77
|
+
.requiredOption("--sourceVersion <sourceVersion>", "Source version (or 'LATEST')")
|
|
78
|
+
.option("--json", "Write response to a JSON file", false)
|
|
79
|
+
.action(this.previewBranchMerge);
|
|
80
|
+
branchMergeCommand.command("apply").beta()
|
|
81
|
+
.description("Merge changes from a source into a target branch")
|
|
82
|
+
.requiredOption("--packageKey <packageKey>", "Target package key (main package key or '<mainPackageKey>@<branchKey>')")
|
|
83
|
+
.option("-f, --file <file>", "Path to a JSON file containing the MergeBranchTransport payload")
|
|
84
|
+
.option("--sourceKey <sourceKey>", "Source package key, main package key or '<mainPackageKey>@<branchKey>' (overrides the file's 'sourceKey')")
|
|
85
|
+
.option("--sourceVersion <sourceVersion>", "Source version (overrides the file's 'sourceVersion'; or 'LATEST')")
|
|
86
|
+
.option("--bump <bump>", "Version bump for the new published version: PATCH (the default when neither --bump nor --newVersion is given)")
|
|
87
|
+
.option("--newVersion <newVersion>", "Pin the new published version to an explicit semver")
|
|
88
|
+
.option("--summary <summary>", "Summary of changes for the new published version")
|
|
89
|
+
.option("--json", "Write response to a JSON file", false)
|
|
90
|
+
.action(this.applyBranchMerge);
|
|
91
|
+
branchCommand.command("export").beta()
|
|
92
|
+
.description("Export a branch's package, rewriting the package.json key to the main package key. Writes an unzipped '<packageKey>' directory by default (or a '<packageKey>.zip' with --zip), or pushes to the Git branch named after --branchKey when --gitProfile is set.")
|
|
93
|
+
.requiredOption("--packageKey <packageKey>", "Main package key (no '@')")
|
|
94
|
+
.option("--branchKey <branchKey>", "Branch key to export. The Git branch, when pushing, is named after this value. Mutually exclusive with --all")
|
|
95
|
+
.option("--all", "Push the main package and every one of its branches to Git. Requires --gitProfile and is mutually exclusive with --branchKey", false)
|
|
96
|
+
.option("--zip", "Export the branch as a single '<packageKey>.zip' file instead of an unzipped directory (local export only)", false)
|
|
97
|
+
.option("--gitProfile <gitProfile>", "Git profile to use. When set, the export is pushed to Git instead of written locally")
|
|
98
|
+
.option("--json", "Write response to a JSON file", false)
|
|
99
|
+
.action(this.exportBranch);
|
|
100
|
+
branchCommand.command("import").beta()
|
|
101
|
+
.description("Import a branch's package from a zip file, directory, or Git branch, restoring the package.json key to '<packageKey>@<branchKey>'. Pulls the Git branch named after --branchKey when --gitProfile is set; otherwise reads --file or --directory.")
|
|
102
|
+
.requiredOption("--packageKey <packageKey>", "Main package key (no '@')")
|
|
103
|
+
.requiredOption("--branchKey <branchKey>", "Branch key to import into. The Git branch, when pulling, is named after this value")
|
|
104
|
+
.option("-f, --file <file>", "Package zip file (relative path). Mutually exclusive with --directory and --gitProfile")
|
|
105
|
+
.option("-d, --directory <directory>", "Package directory (relative path). Mutually exclusive with --file and --gitProfile")
|
|
106
|
+
.option("--overwrite", "Flag to allow overwriting an existing package with the same key", false)
|
|
107
|
+
.option("--gitProfile <gitProfile>", "Git profile to use. When set, the package is pulled from Git instead of read locally")
|
|
108
|
+
.option("--json", "Write response to a JSON file", false)
|
|
109
|
+
.action(this.importBranch);
|
|
40
110
|
configCommand.command("list")
|
|
41
111
|
.description("[Deprecated] Use 't2tc package list' instead. List packages in the target team.")
|
|
42
112
|
.deprecationNotice("'config list' is deprecated and will be removed in a future release. Use 't2tc package list' instead.")
|
|
@@ -99,7 +169,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
99
169
|
packageCommand.command("validate")
|
|
100
170
|
.description("Validate package node configurations")
|
|
101
171
|
.requiredOption("--packageKey <packageKey>", "Key of the package to validate")
|
|
102
|
-
.option("--layers <layers...>", "Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS
|
|
172
|
+
.option("--layers <layers...>", "Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS). Omit to run every layer available for the team.")
|
|
103
173
|
.option("--nodeKeys <nodeKeys...>", "Specific node keys to validate (default: all nodes)")
|
|
104
174
|
.option("--json", "Return the response as a JSON file")
|
|
105
175
|
.action(this.validatePackage);
|
|
@@ -112,7 +182,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
112
182
|
.description("[Deprecated] Use 'config package validate' instead. Validate package node configurations.")
|
|
113
183
|
.deprecationNotice("'config validate' is deprecated and will be removed in a future release. Use 'config package validate' instead.")
|
|
114
184
|
.requiredOption("--packageKey <packageKey>", "Key of the package to validate")
|
|
115
|
-
.option("--layers <layers...>", "Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS
|
|
185
|
+
.option("--layers <layers...>", "Validation layers to run. Allowed values: SCHEMA, BUSINESS, PACKAGE_SETTINGS, PIG_SEMANTICS, DATA_PIPELINES (can be combined, e.g. --layers SCHEMA BUSINESS). Omit to run every layer available for the team.")
|
|
116
186
|
.option("--nodeKeys <nodeKeys...>", "Specific node keys to validate (default: all nodes)")
|
|
117
187
|
.option("--json", "Return the response as a JSON file")
|
|
118
188
|
.action(this.validatePackage);
|
|
@@ -184,9 +254,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
184
254
|
.option("--force", "Force archive even if the node has dependants", false)
|
|
185
255
|
.action(this.archiveNode);
|
|
186
256
|
nodesCommand.command("list")
|
|
187
|
-
.description("List nodes in a
|
|
257
|
+
.description("List nodes in a package. Lists staging nodes by default.")
|
|
188
258
|
.requiredOption("--packageKey <packageKey>", "Identifier of the package")
|
|
189
|
-
.
|
|
259
|
+
.option("--packageVersion <packageVersion>", "Version of the package. If not sent, the staging state of the package will be used.")
|
|
190
260
|
.option("--limit <limit>", "Limit the number of results returned")
|
|
191
261
|
.option("--offset <offset>", "Offset for pagination")
|
|
192
262
|
.option("--withConfiguration", "Include node configuration in the response", false)
|
|
@@ -218,6 +288,99 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
218
288
|
.option("--params <params>", "Variable query params")
|
|
219
289
|
.action(this.listAssignments);
|
|
220
290
|
}
|
|
291
|
+
setBranchSettings(context, command, options) {
|
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
const enabled = String(options.enabled).toLowerCase();
|
|
294
|
+
if (enabled !== "true" && enabled !== "false") {
|
|
295
|
+
throw new Error("Please provide either 'true' or 'false' for --enabled.");
|
|
296
|
+
}
|
|
297
|
+
yield new branch_command_service_1.BranchCommandService(context).setBranchingEnabled(options.packageKey, enabled === "true", !!options.json);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
createBranch(context, command, options) {
|
|
301
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
302
|
+
yield new branch_command_service_1.BranchCommandService(context).createBranch(options.packageKey, options.branchKey, options.sourceVersion, !!options.validate, !!options.json);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
listBranches(context, command, options) {
|
|
306
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
307
|
+
yield new branch_command_service_1.BranchCommandService(context).listBranches(options.packageKey, !!options.json);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
deleteBranch(context, command, options) {
|
|
311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
+
yield new branch_command_service_1.BranchCommandService(context).deleteBranch(options.packageKey, options.branchKey);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
previewBranchMerge(context, command, options) {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
yield new branch_command_service_1.BranchCommandService(context).mergePreview(options.packageKey, options.sourceKey, options.sourceVersion, !!options.json);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
applyBranchMerge(context, command, options) {
|
|
321
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
+
yield new branch_command_service_1.BranchCommandService(context).mergeApply(options.packageKey, {
|
|
323
|
+
sourceKey: options.sourceKey,
|
|
324
|
+
sourceVersion: options.sourceVersion,
|
|
325
|
+
file: options.file,
|
|
326
|
+
bump: options.bump,
|
|
327
|
+
version: options.newVersion,
|
|
328
|
+
summary: options.summary,
|
|
329
|
+
jsonResponse: !!options.json,
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
exportBranch(context, command, options) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
const gitEnabled = !!options.gitProfile;
|
|
336
|
+
const service = new branch_export_import_command_service_1.BranchExportImportCommandService(context);
|
|
337
|
+
if (options.all) {
|
|
338
|
+
if (options.branchKey) {
|
|
339
|
+
throw new Error("Please provide either --branchKey or --all, but not both.");
|
|
340
|
+
}
|
|
341
|
+
if (!gitEnabled) {
|
|
342
|
+
throw new Error("--all pushes to Git and requires a Git profile. Please provide --gitProfile.");
|
|
343
|
+
}
|
|
344
|
+
yield service.exportAll(options.packageKey, !!options.json);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (!options.branchKey) {
|
|
348
|
+
throw new Error("Please provide --branchKey, or use --all to export every branch.");
|
|
349
|
+
}
|
|
350
|
+
if (options.branchKey.toLowerCase() === branches_1.BranchUtils.MAIN_BRANCH_KEY) {
|
|
351
|
+
throw new Error(`'${branches_1.BranchUtils.MAIN_BRANCH_KEY}' is a reserved branch key. The main package is exported only with --all.`);
|
|
352
|
+
}
|
|
353
|
+
yield service.exportBranch(options.packageKey, options.branchKey, {
|
|
354
|
+
zip: !!options.zip,
|
|
355
|
+
gitEnabled,
|
|
356
|
+
jsonResponse: !!options.json,
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
importBranch(context, command, options) {
|
|
361
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
362
|
+
const gitEnabled = !!options.gitProfile;
|
|
363
|
+
if (options.branchKey.toLowerCase() === branches_1.BranchUtils.MAIN_BRANCH_KEY) {
|
|
364
|
+
throw new Error(`'${branches_1.BranchUtils.MAIN_BRANCH_KEY}' is a reserved branch key. Use 'config package import' to import into the main package.`);
|
|
365
|
+
}
|
|
366
|
+
if (gitEnabled && (options.file || options.directory)) {
|
|
367
|
+
throw new Error("You cannot use --file or --directory together with --gitProfile. Only one import source can be defined.");
|
|
368
|
+
}
|
|
369
|
+
if (!gitEnabled && !options.file && !options.directory) {
|
|
370
|
+
throw new Error("You must provide a --file, a --directory, or a --gitProfile option to import a branch.");
|
|
371
|
+
}
|
|
372
|
+
if (options.file && options.directory) {
|
|
373
|
+
throw new Error("You cannot use both --file and --directory options at the same time. Only one import source can be defined.");
|
|
374
|
+
}
|
|
375
|
+
yield new branch_export_import_command_service_1.BranchExportImportCommandService(context).importBranch(options.packageKey, options.branchKey, {
|
|
376
|
+
file: options.file,
|
|
377
|
+
directory: options.directory,
|
|
378
|
+
overwrite: !!options.overwrite,
|
|
379
|
+
gitEnabled,
|
|
380
|
+
jsonResponse: !!options.json,
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
}
|
|
221
384
|
listPackages(context, command, options) {
|
|
222
385
|
return __awaiter(this, void 0, void 0, function* () {
|
|
223
386
|
if (options.staging && (options.withDependencies || options.packageKeys || options.keysByVersion || options.variableValue || options.variableType)) {
|
|
@@ -345,8 +508,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
345
508
|
});
|
|
346
509
|
}
|
|
347
510
|
listNodes(context, command, options) {
|
|
511
|
+
var _a;
|
|
348
512
|
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
-
yield new node_service_1.NodeService(context).listNodes(options.packageKey, options.packageVersion, options.limit, options.offset, options.withConfiguration, options.json);
|
|
513
|
+
yield new node_service_1.NodeService(context).listNodes(options.packageKey, (_a = options.packageVersion) !== null && _a !== void 0 ? _a : null, options.limit, options.offset, options.withConfiguration, options.json);
|
|
350
514
|
});
|
|
351
515
|
}
|
|
352
516
|
diffNode(context, command, options) {
|
|
@@ -13,7 +13,7 @@ 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", "./api/node-dependency-api", "../../core/utils/file-service", "../../core/utils/logger", "uuid"], factory);
|
|
16
|
+
define(["require", "exports", "./api/node-dependency-api", "../../core/utils/file-service", "../../core/utils/cui-file-service", "../../core/utils/logger", "uuid"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -21,11 +21,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
exports.NodeDependencyService = void 0;
|
|
22
22
|
const node_dependency_api_1 = require("./api/node-dependency-api");
|
|
23
23
|
const file_service_1 = require("../../core/utils/file-service");
|
|
24
|
+
const cui_file_service_1 = require("../../core/utils/cui-file-service");
|
|
24
25
|
const logger_1 = require("../../core/utils/logger");
|
|
25
26
|
const uuid_1 = require("uuid");
|
|
26
27
|
class NodeDependencyService {
|
|
27
28
|
constructor(context) {
|
|
28
29
|
this.nodeDependencyApi = new node_dependency_api_1.NodeDependencyApi(context);
|
|
30
|
+
this.cuiFileService = new cui_file_service_1.CuiFileService(context);
|
|
29
31
|
}
|
|
30
32
|
listNodeDependencies(packageKey, nodeKey, version, jsonResponse) {
|
|
31
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38,8 +40,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
38
40
|
}
|
|
39
41
|
if (jsonResponse) {
|
|
40
42
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
41
|
-
|
|
42
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
43
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(dependencies, null, 2), filename);
|
|
44
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
47
|
if (dependencies.length === 0) {
|
|
@@ -13,7 +13,7 @@ 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", "node:fs", "uuid", "../../core/utils/logger", "../../core/utils/file-service", "./api/node-diff-api"], factory);
|
|
16
|
+
define(["require", "exports", "node:fs", "uuid", "../../core/utils/logger", "../../core/utils/file-service", "../../core/utils/cui-file-service", "./api/node-diff-api"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -23,10 +23,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
const uuid_1 = require("uuid");
|
|
24
24
|
const logger_1 = require("../../core/utils/logger");
|
|
25
25
|
const file_service_1 = require("../../core/utils/file-service");
|
|
26
|
+
const cui_file_service_1 = require("../../core/utils/cui-file-service");
|
|
26
27
|
const node_diff_api_1 = require("./api/node-diff-api");
|
|
27
28
|
class NodeDiffService {
|
|
28
29
|
constructor(context) {
|
|
29
30
|
this.nodeDiffApi = new node_diff_api_1.NodeDiffApi(context);
|
|
31
|
+
this.cuiFileService = new cui_file_service_1.CuiFileService(context);
|
|
30
32
|
}
|
|
31
33
|
diff(packageKey, nodeKey, baseVersion, compareVersion, jsonResponse) {
|
|
32
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37,7 +39,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
37
39
|
compareVersion,
|
|
38
40
|
});
|
|
39
41
|
if (jsonResponse) {
|
|
40
|
-
this.exportDiffAsJson(nodeDiff);
|
|
42
|
+
yield this.exportDiffAsJson(nodeDiff);
|
|
41
43
|
}
|
|
42
44
|
else {
|
|
43
45
|
this.logDiff(nodeDiff);
|
|
@@ -53,7 +55,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
53
55
|
file: fs.createReadStream(file),
|
|
54
56
|
});
|
|
55
57
|
if (jsonResponse) {
|
|
56
|
-
this.exportDiffAsJson(nodeDiff);
|
|
58
|
+
yield this.exportDiffAsJson(nodeDiff);
|
|
57
59
|
}
|
|
58
60
|
else {
|
|
59
61
|
this.logDiff(nodeDiff);
|
|
@@ -61,9 +63,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
exportDiffAsJson(nodeDiff) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const filename = (0, uuid_1.v4)() + ".json";
|
|
68
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(nodeDiff, null, 2), filename);
|
|
69
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
70
|
+
});
|
|
67
71
|
}
|
|
68
72
|
logDiff(nodeDiff) {
|
|
69
73
|
logger_1.logger.info(`Package Key: ${nodeDiff.packageKey}`);
|
|
@@ -13,7 +13,7 @@ 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", "./api/node-api", "../../core/utils/file-service", "../../core/utils/logger", "uuid"], factory);
|
|
16
|
+
define(["require", "exports", "./api/node-api", "../../core/utils/file-service", "../../core/utils/cui-file-service", "../../core/utils/logger", "uuid"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -21,11 +21,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
exports.NodeService = void 0;
|
|
22
22
|
const node_api_1 = require("./api/node-api");
|
|
23
23
|
const file_service_1 = require("../../core/utils/file-service");
|
|
24
|
+
const cui_file_service_1 = require("../../core/utils/cui-file-service");
|
|
24
25
|
const logger_1 = require("../../core/utils/logger");
|
|
25
26
|
const uuid_1 = require("uuid");
|
|
26
27
|
class NodeService {
|
|
27
28
|
constructor(context) {
|
|
28
29
|
this.nodeApi = new node_api_1.NodeApi(context);
|
|
30
|
+
this.cuiFileService = new cui_file_service_1.CuiFileService(context);
|
|
29
31
|
}
|
|
30
32
|
findNode(packageKey, nodeKey, withConfiguration, packageVersion, jsonResponse) {
|
|
31
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -34,8 +36,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
34
36
|
: yield this.nodeApi.findStagingNodeByKey(packageKey, nodeKey, withConfiguration);
|
|
35
37
|
if (jsonResponse) {
|
|
36
38
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
37
|
-
|
|
38
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
39
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(node, null, 2), filename);
|
|
40
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
39
41
|
}
|
|
40
42
|
else {
|
|
41
43
|
this.printNode(node);
|
|
@@ -44,11 +46,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
46
|
}
|
|
45
47
|
listNodes(packageKey, packageVersion, limit, offset, withConfiguration, jsonResponse) {
|
|
46
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const nodes =
|
|
49
|
+
const nodes = packageVersion
|
|
50
|
+
? yield this.nodeApi.findVersionedNodesByPackage(packageKey, packageVersion, withConfiguration, limit, offset)
|
|
51
|
+
: yield this.nodeApi.findStagingNodesByPackage(packageKey, withConfiguration, limit, offset);
|
|
48
52
|
if (jsonResponse) {
|
|
49
53
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
50
|
-
|
|
51
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
54
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(nodes, null, 2), filename);
|
|
55
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
52
56
|
}
|
|
53
57
|
else {
|
|
54
58
|
nodes.forEach(node => {
|
|
@@ -67,8 +71,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
67
71
|
}
|
|
68
72
|
if (jsonResponse) {
|
|
69
73
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
70
|
-
|
|
71
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
74
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(node, null, 2), filename);
|
|
75
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
72
76
|
}
|
|
73
77
|
else {
|
|
74
78
|
this.printNode(node);
|
|
@@ -85,8 +89,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
85
89
|
}
|
|
86
90
|
if (jsonResponse) {
|
|
87
91
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
88
|
-
|
|
89
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
92
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(node, null, 2), filename);
|
|
93
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
90
94
|
}
|
|
91
95
|
else {
|
|
92
96
|
this.printNode(node);
|
|
@@ -13,7 +13,7 @@ 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", "uuid", "./api/package-validation-api", "../../core/utils/logger", "../../core/utils/file-service"], factory);
|
|
16
|
+
define(["require", "exports", "uuid", "./api/package-validation-api", "../../core/utils/logger", "../../core/utils/cui-file-service"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -22,22 +22,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
const uuid_1 = require("uuid");
|
|
23
23
|
const package_validation_api_1 = require("./api/package-validation-api");
|
|
24
24
|
const logger_1 = require("../../core/utils/logger");
|
|
25
|
-
const
|
|
25
|
+
const cui_file_service_1 = require("../../core/utils/cui-file-service");
|
|
26
26
|
class PackageValidationService {
|
|
27
27
|
constructor(context) {
|
|
28
28
|
this.packageValidationApi = new package_validation_api_1.PackageValidationApi(context);
|
|
29
|
+
this.cuiFileService = new cui_file_service_1.CuiFileService(context);
|
|
29
30
|
}
|
|
30
31
|
validatePackage(packageKey, layers, nodeKeys, jsonOutput) {
|
|
31
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const request = {
|
|
33
|
+
const request = {};
|
|
34
|
+
// Omitted rather than defaulted here: the API reads an absent "layers" as every layer available for
|
|
35
|
+
// the team, and rejects an empty list.
|
|
36
|
+
if (layers && layers.length > 0) {
|
|
37
|
+
request.layers = layers;
|
|
38
|
+
}
|
|
33
39
|
if (nodeKeys && nodeKeys.length > 0) {
|
|
34
40
|
request.nodeKeys = nodeKeys;
|
|
35
41
|
}
|
|
36
42
|
const response = yield this.packageValidationApi.validatePackage(packageKey, request);
|
|
37
43
|
if (jsonOutput) {
|
|
38
44
|
const reportFileName = "config_validate_report_" + (0, uuid_1.v4)() + ".json";
|
|
39
|
-
|
|
40
|
-
logger_1.logger.info("Validation report file: " +
|
|
45
|
+
const writtenFileName = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(response), reportFileName);
|
|
46
|
+
logger_1.logger.info("Validation report file: " + writtenFileName);
|
|
41
47
|
}
|
|
42
48
|
else {
|
|
43
49
|
this.printValidationResult(response);
|
|
@@ -13,27 +13,29 @@ 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", "../../core/utils/file-service", "../../core/utils/logger", "uuid", "./api/package-version-api"], factory);
|
|
16
|
+
define(["require", "exports", "../../core/utils/file-service", "../../core/utils/cui-file-service", "../../core/utils/logger", "uuid", "./api/package-version-api"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.PackageVersionService = void 0;
|
|
22
22
|
const file_service_1 = require("../../core/utils/file-service");
|
|
23
|
+
const cui_file_service_1 = require("../../core/utils/cui-file-service");
|
|
23
24
|
const logger_1 = require("../../core/utils/logger");
|
|
24
25
|
const uuid_1 = require("uuid");
|
|
25
26
|
const package_version_api_1 = require("./api/package-version-api");
|
|
26
27
|
class PackageVersionService {
|
|
27
28
|
constructor(context) {
|
|
28
29
|
this.packageVersionApi = new package_version_api_1.PackageVersionApi(context);
|
|
30
|
+
this.cuiFileService = new cui_file_service_1.CuiFileService(context);
|
|
29
31
|
}
|
|
30
32
|
findPackageVersion(packageKey, version, jsonResponse) {
|
|
31
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
34
|
const packageVersionTransport = yield this.packageVersionApi.findOne(packageKey, version);
|
|
33
35
|
if (jsonResponse) {
|
|
34
36
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
35
|
-
|
|
36
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
37
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(packageVersionTransport, null, 2), filename);
|
|
38
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
37
39
|
}
|
|
38
40
|
else {
|
|
39
41
|
this.printPackageVersionTransport(packageVersionTransport);
|
|
@@ -56,8 +58,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
56
58
|
const created = yield this.packageVersionApi.createVersion(packageKey, request);
|
|
57
59
|
if (jsonResponse) {
|
|
58
60
|
const filename = (0, uuid_1.v4)() + ".json";
|
|
59
|
-
|
|
60
|
-
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage +
|
|
61
|
+
const writtenFilename = yield this.cuiFileService.writeToFileWithGivenName(JSON.stringify(created, null, 2), filename);
|
|
62
|
+
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + writtenFilename);
|
|
61
63
|
}
|
|
62
64
|
else {
|
|
63
65
|
this.printPackageVersionCreatedTransport(created);
|
|
@@ -13,7 +13,7 @@ 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", "node:fs", "../../core/utils/file-service", "../../core/utils/logger", "../../core/git-profile/git/git.service", "./api/single-package-export-api", "
|
|
16
|
+
define(["require", "exports", "node:fs", "../../core/utils/file-service", "../../core/utils/logger", "../../core/git-profile/git/git.service", "./api/single-package-export-api", "../../core/utils/cui-file-service"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -24,11 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
const logger_1 = require("../../core/utils/logger");
|
|
25
25
|
const git_service_1 = require("../../core/git-profile/git/git.service");
|
|
26
26
|
const single_package_export_api_1 = require("./api/single-package-export-api");
|
|
27
|
-
const
|
|
27
|
+
const cui_file_service_1 = require("../../core/utils/cui-file-service");
|
|
28
28
|
class SinglePackageExportService {
|
|
29
29
|
constructor(context) {
|
|
30
30
|
this.singlePackageExportApi = new single_package_export_api_1.SinglePackageExportApi(context);
|
|
31
31
|
this.gitService = new git_service_1.GitService(context);
|
|
32
|
+
this.cuiFileService = new cui_file_service_1.CuiFileService(context);
|
|
32
33
|
}
|
|
33
34
|
exportPackage(packageKey, zip, gitBranch) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38,13 +39,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
if (zip) {
|
|
41
|
-
const fileName = `${packageKey}.zip
|
|
42
|
-
file_service_1.fileService.writeBufferToFileWithGivenName(packageData, (0, node_path_1.resolve)(process.cwd(), fileName));
|
|
42
|
+
const fileName = yield this.cuiFileService.writeZipToFileWithGivenName(packageData, `${packageKey}.zip`);
|
|
43
43
|
logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + fileName);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
file_service_1.fileService.extractZipBufferToDirectory(packageData, packageKey);
|
|
47
|
-
logger_1.logger.info(`Successful export. Exported directory: ${
|
|
46
|
+
const directoryName = yield this.cuiFileService.writeDirectoryWithGivenName(targetDir => file_service_1.fileService.extractZipBufferToDirectory(packageData, targetDir), packageKey);
|
|
47
|
+
logger_1.logger.info(`Successful export. Exported directory: ${directoryName}`);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
exportToGitBranch(packageData, gitBranch) {
|