@celonis/content-cli 1.11.0 → 1.13.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.
Files changed (71) hide show
  1. package/commands/action-flows/action-flow/action-flow.service.js +4 -2
  2. package/commands/asset-registry/asset-registry-api.js +33 -7
  3. package/commands/asset-registry/asset-registry.service.js +25 -3
  4. package/commands/asset-registry/module.js +15 -0
  5. package/commands/configuration-management/api/metadata-api.js +38 -0
  6. package/commands/configuration-management/api/single-package-export-api.js +38 -0
  7. package/commands/configuration-management/api/{diff-api.js → single-package-import-api.js} +5 -10
  8. package/commands/configuration-management/api/staging-package-api.js +39 -0
  9. package/commands/configuration-management/api/variable-api.js +36 -0
  10. package/commands/configuration-management/config-command.service.js +1 -63
  11. package/commands/configuration-management/connection-variable.helper.js +30 -0
  12. package/commands/configuration-management/interfaces/single-package-import.interfaces.js +12 -0
  13. package/commands/configuration-management/metadata.service.js +50 -0
  14. package/commands/configuration-management/module.js +80 -16
  15. package/commands/configuration-management/single-package-export.service.js +64 -0
  16. package/commands/configuration-management/single-package-import.service.js +131 -0
  17. package/commands/configuration-management/staging-package.service.js +50 -0
  18. package/commands/configuration-management/variable.service.js +18 -21
  19. package/commands/studio/manager/package.manager.js +1 -1
  20. package/commands/studio/module.js +8 -4
  21. package/commands/t2tc/api/diff-api.js +40 -0
  22. package/commands/{configuration-management/api/batch-import-export-api.js → t2tc/api/t2tc-package-api.js} +3 -29
  23. package/commands/{configuration-management → t2tc}/diff.service.js +7 -7
  24. package/commands/t2tc/module.js +105 -0
  25. package/commands/{configuration-management → t2tc}/studio.service.js +2 -17
  26. package/commands/t2tc/t2tc-command.service.js +88 -0
  27. package/commands/{configuration-management/batch-import-export.service.js → t2tc/t2tc-package.service.js} +26 -52
  28. package/commands/view/module.js +54 -0
  29. package/commands/view/view-bookmarks-command.service.js +45 -0
  30. package/commands/view/view-bookmarks.manager-factory.js +39 -0
  31. package/commands/view/view-bookmarks.manager.js +60 -0
  32. package/content-cli.js +61 -35
  33. package/core/command/module-handler.js +5 -0
  34. package/core/utils/file-service.js +45 -16
  35. package/core/utils/path.js +17 -0
  36. package/lib/commands/asset-registry/asset-registry-api.d.ts +5 -0
  37. package/lib/commands/asset-registry/asset-registry.interfaces.d.ts +5 -0
  38. package/lib/commands/asset-registry/asset-registry.service.d.ts +3 -1
  39. package/lib/commands/asset-registry/module.d.ts +1 -0
  40. package/lib/commands/configuration-management/api/metadata-api.d.ts +7 -0
  41. package/lib/commands/configuration-management/api/single-package-export-api.d.ts +7 -0
  42. package/lib/commands/configuration-management/api/single-package-import-api.d.ts +8 -0
  43. package/lib/commands/configuration-management/api/staging-package-api.d.ts +7 -0
  44. package/lib/commands/configuration-management/api/variable-api.d.ts +7 -0
  45. package/lib/commands/configuration-management/config-command.service.d.ts +0 -8
  46. package/lib/commands/configuration-management/connection-variable.helper.d.ts +2 -0
  47. package/lib/commands/configuration-management/interfaces/single-package-import.interfaces.d.ts +19 -0
  48. package/lib/commands/configuration-management/metadata.service.d.ts +7 -0
  49. package/lib/commands/configuration-management/module.d.ts +4 -1
  50. package/lib/commands/configuration-management/single-package-export.service.d.ts +8 -0
  51. package/lib/commands/configuration-management/single-package-import.service.d.ts +13 -0
  52. package/lib/commands/configuration-management/staging-package.service.d.ts +7 -0
  53. package/lib/commands/configuration-management/variable.service.d.ts +1 -2
  54. package/lib/commands/t2tc/api/diff-api.d.ts +9 -0
  55. package/lib/commands/{configuration-management/api/batch-import-export-api.d.ts → t2tc/api/t2tc-package-api.d.ts} +3 -6
  56. package/lib/commands/{configuration-management → t2tc}/diff.service.d.ts +1 -1
  57. package/lib/commands/t2tc/module.d.ts +10 -0
  58. package/lib/commands/{configuration-management → t2tc}/studio.service.d.ts +1 -3
  59. package/lib/commands/t2tc/t2tc-command.service.d.ts +12 -0
  60. package/lib/commands/{configuration-management/batch-import-export.service.d.ts → t2tc/t2tc-package.service.d.ts} +3 -5
  61. package/lib/commands/view/module.d.ts +11 -0
  62. package/lib/commands/view/view-bookmarks-command.service.d.ts +7 -0
  63. package/lib/commands/view/view-bookmarks.manager-factory.d.ts +8 -0
  64. package/lib/commands/view/view-bookmarks.manager.d.ts +20 -0
  65. package/lib/content-cli.d.ts +15 -1
  66. package/lib/core/utils/file-service.d.ts +8 -1
  67. package/lib/core/utils/path.d.ts +1 -0
  68. package/package.json +4 -4
  69. package/lib/commands/configuration-management/api/diff-api.d.ts +0 -9
  70. /package/commands/{configuration-management/interfaces → t2tc}/batch-export-import.constants.js +0 -0
  71. /package/lib/commands/{configuration-management/interfaces → t2tc}/batch-export-import.constants.d.ts +0 -0
@@ -0,0 +1,39 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "node:fs", "node:path", "./view-bookmarks.manager", "../../core/utils/logger"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ViewBookmarksManagerFactory = void 0;
13
+ const fs = require("node:fs");
14
+ const path = require("node:path");
15
+ const view_bookmarks_manager_1 = require("./view-bookmarks.manager");
16
+ const logger_1 = require("../../core/utils/logger");
17
+ class ViewBookmarksManagerFactory {
18
+ constructor(context) {
19
+ this.context = context;
20
+ }
21
+ createViewBookmarksManager(filename, boardId, type) {
22
+ const viewBookmarksManager = new view_bookmarks_manager_1.ViewBookmarksManager(this.context);
23
+ viewBookmarksManager.boardId = boardId;
24
+ type = (type !== null && type !== void 0 ? type : "USER").toUpperCase();
25
+ viewBookmarksManager.type = type;
26
+ if (filename !== null) {
27
+ viewBookmarksManager.filePath = this.resolveFilePath(filename);
28
+ }
29
+ return viewBookmarksManager;
30
+ }
31
+ resolveFilePath(fileName) {
32
+ if (!fs.existsSync(path.resolve(process.cwd(), fileName))) {
33
+ logger_1.logger.error(new logger_1.FatalError("The provided file does not exist"));
34
+ }
35
+ return path.resolve(process.cwd(), fileName);
36
+ }
37
+ }
38
+ exports.ViewBookmarksManagerFactory = ViewBookmarksManagerFactory;
39
+ });
@@ -0,0 +1,60 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "node:fs", "form-data", "../../core/http/http-shared/base.manager"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ViewBookmarksManager = void 0;
13
+ const fs = require("node:fs");
14
+ const FormData = require("form-data");
15
+ const base_manager_1 = require("../../core/http/http-shared/base.manager");
16
+ class ViewBookmarksManager extends base_manager_1.BaseManager {
17
+ constructor(context) {
18
+ super(context);
19
+ }
20
+ get filePath() {
21
+ return this._filePath;
22
+ }
23
+ set filePath(value) {
24
+ this._filePath = value;
25
+ }
26
+ get boardId() {
27
+ return this._boardId;
28
+ }
29
+ set boardId(value) {
30
+ this._boardId = value;
31
+ }
32
+ get type() {
33
+ return this._type;
34
+ }
35
+ set type(value) {
36
+ this._type = value;
37
+ }
38
+ getConfig() {
39
+ return {
40
+ pushUrl: `${ViewBookmarksManager.BASE_URL}/import?boardId=${encodeURIComponent(this.boardId)}`,
41
+ pullUrl: `${ViewBookmarksManager.BASE_URL}/export?boardId=${encodeURIComponent(this.boardId)}&type=${encodeURIComponent(this.type)}`,
42
+ exportFileName: `${ViewBookmarksManager.VIEW_BOOKMARKS_FILE_PREFIX}${this.boardId}.json`,
43
+ onPushSuccessMessage: () => {
44
+ return "View Bookmarks were pushed successfully.";
45
+ },
46
+ };
47
+ }
48
+ getBody() {
49
+ const formData = new FormData();
50
+ formData.append("file", fs.createReadStream(this.filePath));
51
+ return formData;
52
+ }
53
+ getSerializedFileContent(data) {
54
+ return JSON.stringify(data);
55
+ }
56
+ }
57
+ exports.ViewBookmarksManager = ViewBookmarksManager;
58
+ ViewBookmarksManager.BASE_URL = "/blueprint/api/bookmarks";
59
+ ViewBookmarksManager.VIEW_BOOKMARKS_FILE_PREFIX = "studio_view_bookmarks_";
60
+ });
package/content-cli.js CHANGED
@@ -19,6 +19,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
19
  })(function (require, exports) {
20
20
  "use strict";
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.createProgram = void 0;
22
23
  const semverSatisfies = require("semver/functions/satisfies");
23
24
  const commander_1 = require("commander");
24
25
  const module_handler_1 = require("./core/command/module-handler");
@@ -31,61 +32,86 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
32
  *
32
33
  * This is the main entry point for the CLI.
33
34
  */
34
- // Check if the Node.js version satisfies the minimum requirements
35
35
  const requiredVersion = ">=10.10.0";
36
- if (!semverSatisfies(process.version, requiredVersion)) {
37
- logger_1.logger.error(`Node version ${process.version} not supported. Please upgrade your node version to ${requiredVersion}`);
38
- process.exit(1);
39
- }
40
- // Global configuration options
41
- const program = new commander_1.Command();
42
- program.configureHelp({
43
- formatHelp: (cmd, helper) => new CustomHelp_1.ContentCLIHelp().formatHelp(cmd, helper),
44
- subcommandTerm: cmd => new CustomHelp_1.ContentCLIHelp().subcommandTerm(cmd),
45
- optionTerm: opt => new CustomHelp_1.ContentCLIHelp().optionTerm(opt),
46
- });
47
- program.version(version_1.VersionUtils.getCurrentCliVersion());
48
- program.option("-q, --quietmode", "Reduce output to a minimum", false);
49
- program.option("-p, --profile [profile]");
50
- program.option("--gitProfile [gitProfile]", "Git profile to use");
51
- program.option("--debug", "Print debug messages", false);
52
- program.option("--dev", "Development Mode", false);
53
- program.parseOptions(process.argv);
54
- if (!program.opts().quietmode) {
55
- console.log(`Content CLI - (C) Copyright 2025 - Celonis SE - Version ${version_1.VersionUtils.getCurrentCliVersion()}`);
56
- console.log();
36
+ function addDefaultOptions(program) {
37
+ program.option("-q, --quietmode", "Reduce output to a minimum", false);
38
+ program.option("-p, --profile [profile]");
39
+ program.option("--gitProfile [gitProfile]", "Git profile to use");
40
+ program.option("--debug", "Print debug messages", false);
41
+ program.option("--dev", "Development Mode", false);
57
42
  }
58
- if (program.opts().debug) {
59
- logger_1.logger.transports.forEach(t => {
60
- t.level = "debug";
43
+ /**
44
+ * Build a fully-configured Commander program without parsing argv
45
+ */
46
+ function createProgram(context, opts = {}) {
47
+ var _a;
48
+ const program = new commander_1.Command();
49
+ program.configureHelp({
50
+ formatHelp: (cmd, helper) => new CustomHelp_1.ContentCLIHelp().formatHelp(cmd, helper),
51
+ subcommandTerm: cmd => new CustomHelp_1.ContentCLIHelp().subcommandTerm(cmd),
52
+ optionTerm: opt => new CustomHelp_1.ContentCLIHelp().optionTerm(opt),
61
53
  });
54
+ program.version(version_1.VersionUtils.getCurrentCliVersion());
55
+ addDefaultOptions(program);
56
+ const moduleHandler = new module_handler_1.ModuleHandler(program, context);
57
+ configureRootCommands(moduleHandler.configurator);
58
+ if (opts.modules) {
59
+ for (const moduleClass of opts.modules) {
60
+ const moduleInstance = new moduleClass();
61
+ moduleInstance.register(context, moduleHandler.configurator);
62
+ }
63
+ }
64
+ else {
65
+ const rootPath = __dirname;
66
+ const devMode = (_a = opts.devMode) !== null && _a !== void 0 ? _a : !!program.opts().dev;
67
+ moduleHandler.discoverAndRegisterModules(rootPath, devMode);
68
+ }
69
+ return program;
62
70
  }
71
+ exports.createProgram = createProgram;
63
72
  /**
64
73
  * To support the legacy command structure, we have to configure some root commands
65
74
  * that the individual modules will extend.
66
75
  */
67
76
  function configureRootCommands(configurator) {
68
- configurator.command("list")
69
- .description("Commands to list content.")
70
- .alias("ls");
77
+ configurator.command("list").description("Commands to list content.").alias("ls");
71
78
  }
72
79
  function run() {
73
80
  return __awaiter(this, void 0, void 0, function* () {
74
- const context = new cli_context_1.Context(program.opts());
81
+ if (!semverSatisfies(process.version, requiredVersion)) {
82
+ logger_1.logger.error(`Node version ${process.version} not supported. Please upgrade your node version to ${requiredVersion}`);
83
+ process.exit(1);
84
+ }
85
+ // Parse global options up-front so banner/debug-level decisions can use
86
+ // them before module discovery runs.
87
+ const bootstrapProgram = new commander_1.Command();
88
+ addDefaultOptions(bootstrapProgram);
89
+ bootstrapProgram.allowUnknownOption(true);
90
+ bootstrapProgram.parseOptions(process.argv);
91
+ const globalOpts = bootstrapProgram.opts();
92
+ if (!globalOpts.quietmode) {
93
+ console.log(`Content CLI - (C) Copyright 2025 - Celonis SE - Version ${version_1.VersionUtils.getCurrentCliVersion()}`);
94
+ console.log();
95
+ }
96
+ if (globalOpts.debug) {
97
+ logger_1.logger.transports.forEach(t => {
98
+ t.level = "debug";
99
+ });
100
+ }
101
+ const context = new cli_context_1.Context(globalOpts);
75
102
  yield context.init();
76
- const moduleHandler = new module_handler_1.ModuleHandler(program, context);
77
- configureRootCommands(moduleHandler.configurator);
78
- moduleHandler.discoverAndRegisterModules(__dirname, program.opts().dev);
103
+ const program = createProgram(context, { devMode: !!globalOpts.dev });
79
104
  try {
80
- program.parse(process.argv);
105
+ yield program.parseAsync(process.argv);
81
106
  }
82
107
  catch (error) {
83
108
  logger_1.logger.error(`An unexpected error occurred: ${error}`);
84
109
  }
85
110
  });
86
111
  }
87
- run();
88
- // catch uncaught exceptions
112
+ if (require.main === module) {
113
+ run();
114
+ }
89
115
  process.on("uncaughtException", (error, origin) => {
90
116
  console.error("\n💥 UNCAUGHT EXCEPTION!\n");
91
117
  console.error("Error:", error);
@@ -200,7 +200,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
200
200
  yield handler(this.ctx, this.cmd, this.cmd.optsWithGlobals());
201
201
  }
202
202
  catch (error) {
203
+ if (error instanceof logger_1.GracefulError) {
204
+ logger_1.logger.error(error.message);
205
+ return;
206
+ }
203
207
  logger_1.logger.error(`An unexpected error occured executing a command: ${error}`);
208
+ process.exitCode = 1;
204
209
  }
205
210
  }));
206
211
  }
@@ -1,12 +1,3 @@
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
1
  (function (factory) {
11
2
  if (typeof module === "object" && typeof module.exports === "object") {
12
3
  var v = factory(require, exports);
@@ -33,12 +24,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
24
  mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS,
34
25
  });
35
26
  }
36
- readFileToJson(fileName) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const fileContent = this.readFile(fileName);
39
- return JSON.parse(fileContent);
27
+ writeBufferToFileWithGivenName(data, filename) {
28
+ fs.writeFileSync(path.resolve(process.cwd(), filename), data, {
29
+ mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS,
40
30
  });
41
31
  }
32
+ writeBufferToPath(targetDir, filename, data) {
33
+ const resolvedDir = path.resolve(process.cwd(), targetDir);
34
+ const absolutePath = path.join(resolvedDir, filename);
35
+ this.mkdirRecursive(resolvedDir);
36
+ this.writeBufferToFileWithGivenName(data, absolutePath);
37
+ return absolutePath;
38
+ }
39
+ extractZipBufferToDirectory(data, targetDir) {
40
+ const targetPath = path.resolve(process.cwd(), targetDir);
41
+ this.mkdirRecursive(targetPath);
42
+ new AdmZip(data).extractAllTo(targetPath, true, true);
43
+ this.restrictFilePermissions(targetPath);
44
+ }
45
+ extractZipBufferToTempDirectory(data) {
46
+ const tempDir = path.join(os.tmpdir(), `content-cli-${(0, uuid_1.v4)()}`);
47
+ this.mkdirRecursive(tempDir);
48
+ new AdmZip(data).extractAllTo(tempDir, true, true);
49
+ this.restrictFilePermissions(tempDir);
50
+ return tempDir;
51
+ }
52
+ readFileToJson(fileName) {
53
+ const fileContent = this.readFile(fileName);
54
+ return JSON.parse(fileContent);
55
+ }
42
56
  readFile(filename) {
43
57
  if (!fs.existsSync(path.resolve(process.cwd(), filename))) {
44
58
  logger_1.logger.error(new logger_1.FatalError(`The provided file '${filename}' does not exit`));
@@ -50,7 +64,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
50
64
  return this.extractExportedZipWithNestedZipsToDir(zipFile, tempDir);
51
65
  }
52
66
  extractExportedZipWithNestedZipsToDir(zipFile, targetDir) {
53
- fs.mkdirSync(targetDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
67
+ this.mkdirRecursive(targetDir);
54
68
  zipFile.extractAllTo(targetDir, true, true);
55
69
  const files = fs.readdirSync(targetDir);
56
70
  for (const file of files) {
@@ -58,7 +72,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
58
72
  if (file.endsWith(".zip")) {
59
73
  const nestedZip = new AdmZip(innerZipPath);
60
74
  const nestedDir = innerZipPath.replace(/\.zip$/, "");
61
- fs.mkdirSync(nestedDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
75
+ this.mkdirRecursive(nestedDir);
62
76
  nestedZip.extractAllTo(nestedDir, true, true);
63
77
  fs.rmSync(innerZipPath); // Optionally remove the inner zip
64
78
  }
@@ -90,14 +104,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
90
104
  }
91
105
  });
92
106
  const tempDir = path.join(os.tmpdir(), "content-cli-exports");
93
- fs.mkdirSync(tempDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
107
+ this.mkdirRecursive(tempDir);
94
108
  const zipFilePath = path.join(tempDir, `export_${(0, uuid_1.v4)()}.zip`);
95
109
  finalZip.writeZip(zipFilePath, () => fs.chmodSync(zipFilePath, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS));
96
110
  return zipFilePath;
97
111
  }
112
+ zipDirectoryAsSinglePackage(sourceDir) {
113
+ if (fs.lstatSync(sourceDir).isSymbolicLink()) {
114
+ throw new logger_1.FatalError("Source directory cannot be a symbolic link.");
115
+ }
116
+ const zip = new AdmZip();
117
+ zip.addLocalFolder(sourceDir);
118
+ const tempDir = path.join(os.tmpdir(), "content-cli-imports");
119
+ this.mkdirRecursive(tempDir);
120
+ const zipFilePath = path.join(tempDir, `single_package_${(0, uuid_1.v4)()}.zip`);
121
+ zip.writeZip(zipFilePath, () => fs.chmodSync(zipFilePath, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS));
122
+ return zipFilePath;
123
+ }
98
124
  getSerializedFileContent(data) {
99
125
  return data;
100
126
  }
127
+ mkdirRecursive(dir) {
128
+ fs.mkdirSync(dir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
129
+ }
101
130
  restrictFilePermissions(targetDir) {
102
131
  var _a;
103
132
  const files = fs.readdirSync(targetDir);
@@ -0,0 +1,17 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.trimSlashes = void 0;
13
+ function trimSlashes(value) {
14
+ return value.replace(/^\/+/, "").replace(/\/+$/, "");
15
+ }
16
+ exports.trimSlashes = trimSlashes;
17
+ });
@@ -1,6 +1,8 @@
1
+ /// <reference types="node" />
1
2
  import { Context } from "../../core/command/cli-context";
2
3
  import { AgentSkillsResponse, AssetRegistryDescriptor, AssetRegistryMetadata } from "./asset-registry.interfaces";
3
4
  export declare class AssetRegistryApi {
5
+ private static readonly BASE_URL;
4
6
  private httpClient;
5
7
  constructor(context: Context);
6
8
  listTypes(): Promise<AssetRegistryMetadata>;
@@ -9,4 +11,7 @@ export declare class AssetRegistryApi {
9
11
  getSchema(assetType: string): Promise<any>;
10
12
  getExamples(assetType: string): Promise<any>;
11
13
  validate(assetType: string, body: any): Promise<any>;
14
+ getSkillFile(skillPath: string, filePath?: string): Promise<Buffer>;
15
+ private buildSkillFileUrl;
16
+ private static endpointUrl;
12
17
  }
@@ -48,3 +48,8 @@ export interface AgentSkill {
48
48
  export interface AgentSkillsResponse {
49
49
  skills: AgentSkill[];
50
50
  }
51
+ export interface GetSkillFileOptions {
52
+ path: string;
53
+ file?: string;
54
+ output?: string;
55
+ }
@@ -1,9 +1,11 @@
1
- import { ValidateOptions } from "./asset-registry.interfaces";
1
+ import { GetSkillFileOptions, ValidateOptions } from "./asset-registry.interfaces";
2
2
  import { Context } from "../../core/command/cli-context";
3
3
  export declare class AssetRegistryService {
4
4
  private api;
5
5
  constructor(context: Context);
6
6
  listTypes(jsonResponse: boolean): Promise<void>;
7
+ getSkillFile(opts: GetSkillFileOptions): Promise<void>;
8
+ private resolveLocalFilename;
7
9
  listSkills(jsonResponse: boolean): Promise<void>;
8
10
  getType(assetType: string, jsonResponse: boolean): Promise<void>;
9
11
  getSchema(assetType: string, jsonResponse: boolean): Promise<void>;
@@ -8,5 +8,6 @@ declare class Module extends IModule {
8
8
  private validate;
9
9
  private getExamples;
10
10
  private listSkills;
11
+ private getSkillFile;
11
12
  }
12
13
  export = Module;
@@ -0,0 +1,7 @@
1
+ import { PackageMetadataExportTransport } from "../interfaces/package-export.interfaces";
2
+ import { Context } from "../../../core/command/cli-context";
3
+ export declare class MetadataApi {
4
+ private readonly httpClient;
5
+ constructor(context: Context);
6
+ exportPackagesMetadata(packageKeys: string[]): Promise<PackageMetadataExportTransport[]>;
7
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="node" />
2
+ import { Context } from "../../../core/command/cli-context";
3
+ export declare class SinglePackageExportApi {
4
+ private readonly httpClient;
5
+ constructor(context: Context);
6
+ exportPackage(packageKey: string): Promise<Buffer>;
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as FormData from "form-data";
2
+ import { Context } from "../../../core/command/cli-context";
3
+ import { SinglePackageImportResult } from "../interfaces/single-package-import.interfaces";
4
+ export declare class SinglePackageImportApi {
5
+ private readonly httpClient;
6
+ constructor(context: Context);
7
+ importPackage(data: FormData, overwrite: boolean): Promise<SinglePackageImportResult>;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { PackageExportTransport } from "../interfaces/package-export.interfaces";
2
+ import { Context } from "../../../core/command/cli-context";
3
+ export declare class StagingPackageApi {
4
+ private readonly httpClient;
5
+ constructor(context: Context);
6
+ findAllStagingPackages(flavors: string[], includeBranches?: boolean): Promise<PackageExportTransport[]>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { PackageKeyAndVersionPair, VariableManifestTransport } from "../interfaces/package-export.interfaces";
2
+ import { Context } from "../../../core/command/cli-context";
3
+ export declare class VariableApi {
4
+ private readonly httpClient;
5
+ constructor(context: Context);
6
+ findVariablesWithValuesByPackageKeysAndVersion(packagesByKeyAndVersion: PackageKeyAndVersionPair[]): Promise<VariableManifestTransport[]>;
7
+ }
@@ -1,14 +1,6 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class ConfigCommandService {
3
- private batchImportExportService;
4
3
  private variableService;
5
- private diffService;
6
4
  constructor(context: Context);
7
- listPackages(jsonResponse: boolean, flavors: string[], withDependencies: boolean, packageKeys: string[], keysByVersion: string[], variableValue: string, variableType: string, includeBranches: boolean, staging: boolean): Promise<void>;
8
5
  listVariables(jsonResponse: boolean, keysByVersion: string[], keysByVersionFile: string, packageKeys: string[]): Promise<void>;
9
- batchExportPackages(packageKeys: string[], packageKeysByVersion: string[], withDependencies: boolean, gitBranch: string, unzip: boolean): Promise<void>;
10
- batchExportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
11
- batchImportPackages(file: string, directory: string, overwrite: boolean, gitBranch: string, performValidation?: boolean): Promise<void>;
12
- diffPackages(file: string, hasChanges: boolean, jsonResponse: boolean): Promise<void>;
13
- private listPackagesByVariableValue;
14
6
  }
@@ -0,0 +1,2 @@
1
+ import { VariableManifestTransport } from "./interfaces/package-export.interfaces";
2
+ export declare function fixConnectionVariables(variables: VariableManifestTransport[]): VariableManifestTransport[];
@@ -0,0 +1,19 @@
1
+ import { NodeTransport } from "./node.interfaces";
2
+ export interface PackageTransport {
3
+ id: string;
4
+ key: string;
5
+ name: string;
6
+ type?: string;
7
+ version?: string;
8
+ flavor?: string;
9
+ schemaVersion?: number;
10
+ createdBy?: string;
11
+ updatedBy?: string;
12
+ creationDate?: string;
13
+ changeDate?: string;
14
+ [key: string]: any;
15
+ }
16
+ export interface SinglePackageImportResult {
17
+ importedPackage: PackageTransport;
18
+ importedNodes: NodeTransport[];
19
+ }
@@ -0,0 +1,7 @@
1
+ import { Context } from "../../core/command/cli-context";
2
+ export declare class MetadataService {
3
+ private metadataApi;
4
+ constructor(context: Context);
5
+ exportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
6
+ private exportListOfPackagesMetadata;
7
+ }
@@ -6,11 +6,14 @@ import { Context } from "../../core/command/cli-context";
6
6
  declare class Module extends IModule {
7
7
  register(context: Context, configurator: Configurator): void;
8
8
  private listPackages;
9
+ private listStagingPackages;
9
10
  private batchExportPackages;
10
- private batchExportPackagesMetadata;
11
+ private exportPackagesMetadata;
11
12
  private getPackageVersion;
12
13
  private createPackageVersion;
13
14
  private batchImportPackages;
15
+ private importSinglePackage;
16
+ private exportSinglePackage;
14
17
  private diffPackages;
15
18
  private validatePackage;
16
19
  private listVariables;
@@ -0,0 +1,8 @@
1
+ import { Context } from "../../core/command/cli-context";
2
+ export declare class SinglePackageExportService {
3
+ private readonly singlePackageExportApi;
4
+ private readonly gitService;
5
+ constructor(context: Context);
6
+ exportPackage(packageKey: string, zip: boolean, gitBranch: string): Promise<void>;
7
+ private exportToGitBranch;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { Context } from "../../core/command/cli-context";
2
+ export declare class SinglePackageImportService {
3
+ private static readonly MAX_UNCOMPRESSED_ZIP_SIZE;
4
+ private readonly singlePackageImportApi;
5
+ private readonly gitService;
6
+ constructor(context: Context);
7
+ importPackage(file: string, directory: string, overwrite: boolean, jsonResponse: boolean, gitBranch: string): Promise<void>;
8
+ private resolveSource;
9
+ private buildBodyForImport;
10
+ private assertUncompressedSizeWithinLimit;
11
+ private getReadableStream;
12
+ private outputResult;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { Context } from "../../core/command/cli-context";
2
+ export declare class StagingPackageService {
3
+ private stagingPackageApi;
4
+ constructor(context: Context);
5
+ listStagingPackages(flavors: string[], includeBranches: boolean, jsonResponse: boolean): Promise<void>;
6
+ private exportListOfPackages;
7
+ }
@@ -1,9 +1,8 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class VariableService {
3
- private batchImportExportApi;
3
+ private variableApi;
4
4
  private variableAssignmentCandidatesApi;
5
5
  private readonly stagingPackageVariablesApi;
6
- private studioService;
7
6
  constructor(context: Context);
8
7
  listVariables(keysByVersion: string[], keysByVersionFile: string): Promise<void>;
9
8
  listCandidateAssignments(type: string, params: string): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import * as FormData from "form-data";
2
+ import { Context } from "../../../core/command/cli-context";
3
+ import { PackageDiffMetadata, PackageDiffTransport } from "../../configuration-management/interfaces/diff-package.interfaces";
4
+ export declare class DiffApi {
5
+ private readonly httpClient;
6
+ constructor(context: Context);
7
+ diffPackages(baseVersion: string, data: FormData): Promise<PackageDiffTransport[]>;
8
+ hasChanges(baseVersion: string, data: FormData): Promise<PackageDiffMetadata[]>;
9
+ }
@@ -1,18 +1,15 @@
1
1
  /// <reference types="node" />
2
2
  import * as FormData from "form-data";
3
- import { PackageExportTransport, PackageKeyAndVersionPair, PackageMetadataExportTransport, PostPackageImportData, VariableManifestTransport } from "../interfaces/package-export.interfaces";
3
+ import { PackageExportTransport, PostPackageImportData } from "../../configuration-management/interfaces/package-export.interfaces";
4
4
  import { Context } from "../../../core/command/cli-context";
5
- export declare class BatchImportExportApi {
6
- private httpClient;
5
+ export declare class T2tcPackageApi {
6
+ private readonly httpClient;
7
7
  constructor(context: Context);
8
8
  findAllActivePackages(flavors: string[], withDependencies?: boolean, includeBranches?: boolean): Promise<PackageExportTransport[]>;
9
- findAllStagingPackages(flavors: string[], includeBranches?: boolean): Promise<PackageExportTransport[]>;
10
9
  findActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string, includeBranches?: boolean): Promise<PackageExportTransport[]>;
11
10
  findActivePackagesByKeys(packageKeys: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
12
11
  findPackagesByKeysAndVersion(packageKeysWithVersion: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
13
12
  exportPackages(packageKeys: string[], withDependencies: boolean): Promise<Buffer>;
14
13
  exportPackagesByVersions(packageKeysWithVersion: string[], withDependencies: boolean): Promise<Buffer>;
15
- batchExportPackagesMetadata(packageKeys: string[]): Promise<PackageMetadataExportTransport[]>;
16
14
  importPackages(data: FormData, overwrite: boolean, performValidation: boolean): Promise<PostPackageImportData[]>;
17
- findVariablesWithValuesByPackageKeysAndVersion(packagesByKeyAndVersion: PackageKeyAndVersionPair[]): Promise<VariableManifestTransport[]>;
18
15
  }
@@ -2,7 +2,7 @@ import { Context } from "../../core/command/cli-context";
2
2
  export declare class DiffService {
3
3
  private diffApi;
4
4
  constructor(context: Context);
5
- diffPackages(file: string, hasChanges: boolean, jsonResponse: boolean): Promise<void>;
5
+ diffPackages(file: string, hasChanges: boolean, baseVersion: string, jsonResponse: boolean): Promise<void>;
6
6
  private hasChanges;
7
7
  private diffPackagesAndReturnDiff;
8
8
  private buildBodyForDiff;
@@ -0,0 +1,10 @@
1
+ import { Configurator, IModule } from "../../core/command/module-handler";
2
+ import { Context } from "../../core/command/cli-context";
3
+ declare class Module extends IModule {
4
+ register(context: Context, configurator: Configurator): void;
5
+ private listPackages;
6
+ private batchExportPackages;
7
+ private batchImportPackages;
8
+ private diffPackages;
9
+ }
10
+ export = Module;