@celonis/content-cli 0.5.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/api/asset-api.js +1 -0
  2. package/api/compute-pool-api.js +1 -0
  3. package/api/data-pool-api.js +29 -0
  4. package/api/node-api.js +1 -0
  5. package/api/package-api.js +1 -0
  6. package/api/package-dependencies-api.js +1 -0
  7. package/api/space-api.js +1 -0
  8. package/api/variable-assignment-apis.js +1 -0
  9. package/api/variables-api.js +1 -0
  10. package/commands/analysis-bookmarks.command.js +1 -0
  11. package/commands/analysis.command.js +1 -0
  12. package/commands/asset.command.js +1 -0
  13. package/commands/connection.command.js +41 -0
  14. package/commands/ctp.command.js +1 -0
  15. package/commands/data-pool.command.js +1 -0
  16. package/commands/objective.command.js +1 -0
  17. package/commands/package.command.js +1 -0
  18. package/commands/profile.command.js +1 -0
  19. package/commands/skill.command.js +1 -0
  20. package/commands/space.command.js +1 -0
  21. package/commands/variable.command.js +1 -0
  22. package/commands/widget-sourcemaps.command.js +1 -0
  23. package/commands/widget.command.js +1 -0
  24. package/content/factory/analysis-bookmarks-manager.factory.js +1 -0
  25. package/content/factory/analysis-manager.factory.js +1 -0
  26. package/content/factory/asset-manager.factory.js +1 -0
  27. package/content/factory/ctp-manager.factory.js +1 -0
  28. package/content/factory/data-pool-manager.factory.js +1 -0
  29. package/content/factory/objective-manager.factory.js +1 -0
  30. package/content/factory/package-manager.factory.js +1 -0
  31. package/content/factory/skill-manager.factory.js +1 -0
  32. package/content/factory/space-manager.factory.js +1 -0
  33. package/content/factory/widget-manager.factory.js +3 -2
  34. package/content/factory/widget-sourcemaps-manager.factory.js +1 -0
  35. package/content/manager/analysis-bookmarks.manager.js +6 -6
  36. package/content/manager/analysis.manager.js +7 -7
  37. package/content/manager/asset.manager.js +4 -5
  38. package/content/manager/base.manager.js +1 -0
  39. package/content/manager/ctp.analysis.manager.js +8 -8
  40. package/content/manager/ctp.datamodel.manager.js +1 -0
  41. package/content/manager/ctp.manager.js +1 -0
  42. package/content/manager/data-pool.manager.js +3 -6
  43. package/content/manager/objective.manager.js +3 -4
  44. package/content/manager/package.manager.js +6 -6
  45. package/content/manager/skill.manager.js +6 -6
  46. package/content/manager/space.manager.js +2 -1
  47. package/content/manager/widget-sourcemaps.manager.js +3 -2
  48. package/content/manager/widget.manager.js +6 -6
  49. package/content-cli-export.js +1 -0
  50. package/content-cli-get.js +52 -0
  51. package/content-cli-import.js +1 -0
  52. package/content-cli-list.js +16 -1
  53. package/content-cli-push.js +1 -1
  54. package/content-cli-set.js +54 -0
  55. package/content-cli.js +2 -0
  56. package/interfaces/package-manager.interfaces.js +2 -1
  57. package/interfaces/profile.interface.js +1 -0
  58. package/lib/api/data-pool-api.d.ts +4 -0
  59. package/lib/commands/connection.command.d.ts +5 -0
  60. package/lib/content-cli-get.d.ts +1 -0
  61. package/lib/content-cli-list.d.ts +2 -1
  62. package/lib/content-cli-set.d.ts +1 -0
  63. package/lib/interfaces/data-pool-manager.interfaces.d.ts +1 -1
  64. package/lib/interfaces/profile.interface.d.ts +1 -1
  65. package/lib/services/connection/connection.service.d.ts +7 -0
  66. package/lib/services/http-client-service.v2.d.ts +1 -3
  67. package/lib/services/http-client.service.d.ts +2 -3
  68. package/lib/validators/profile.validator.d.ts +1 -1
  69. package/package.json +6 -7
  70. package/services/connection/connection.service.js +83 -0
  71. package/services/content.service.js +1 -0
  72. package/services/context.service.js +1 -0
  73. package/services/data-pool/data-pool-service.js +4 -3
  74. package/services/file-service.js +2 -1
  75. package/services/http-client-service.v2.js +60 -54
  76. package/services/http-client.service.js +55 -45
  77. package/services/package-manager/asset-service.js +2 -1
  78. package/services/package-manager/datamodel-service.js +1 -0
  79. package/services/package-manager/package-service.js +5 -4
  80. package/services/package-manager/space-service.js +2 -1
  81. package/services/package-manager/variable-service.js +2 -1
  82. package/services/profile.service.js +1 -0
  83. package/services/question.service.js +1 -0
  84. package/util/context-initializer.js +1 -0
  85. package/util/logger.js +1 -0
  86. package/util/semantic-versioning.js +1 -0
  87. package/util/tracing.js +1 -0
  88. package/util/version.js +1 -0
  89. package/util/yaml.js +1 -0
  90. package/validators/profile.validator.js +31 -33
@@ -4,14 +4,16 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./base.manager", "fs", "../../util/logger"], factory);
7
+ define(["require", "exports", "./base.manager", "fs", "../../util/logger", "form-data"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PackageManager = void 0;
12
13
  const base_manager_1 = require("./base.manager");
13
14
  const fs = require("fs");
14
15
  const logger_1 = require("../../util/logger");
16
+ const FormData = require("form-data");
15
17
  class PackageManager extends base_manager_1.BaseManager {
16
18
  get key() {
17
19
  return this._key;
@@ -68,11 +70,9 @@
68
70
  };
69
71
  }
70
72
  getBody() {
71
- return {
72
- formData: {
73
- package: fs.createReadStream(this.fileName),
74
- },
75
- };
73
+ const formData = new FormData();
74
+ formData.append("package", fs.createReadStream(this.fileName));
75
+ return formData;
76
76
  }
77
77
  getSerializedFileContent(data) {
78
78
  return data;
@@ -4,12 +4,14 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./base.manager"], factory);
7
+ define(["require", "exports", "./base.manager", "form-data"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SkillManager = void 0;
12
13
  const base_manager_1 = require("./base.manager");
14
+ const FormData = require("form-data");
13
15
  class SkillManager extends base_manager_1.BaseManager {
14
16
  get content() {
15
17
  return this._content;
@@ -40,11 +42,9 @@
40
42
  };
41
43
  }
42
44
  getBody() {
43
- return {
44
- formData: {
45
- file: this.content,
46
- },
47
- };
45
+ const formData = new FormData();
46
+ formData.append("file", this.content);
47
+ return formData;
48
48
  }
49
49
  getSerializedFileContent(data) {
50
50
  return JSON.stringify(data);
@@ -9,6 +9,7 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SpaceManager = void 0;
12
13
  const base_manager_1 = require("./base.manager");
13
14
  const logger_1 = require("../../util/logger");
14
15
  const uuid_1 = require("uuid");
@@ -27,7 +28,7 @@
27
28
  }
28
29
  listSpaces(nodes) {
29
30
  if (this.jsonResponse) {
30
- const filename = uuid_1.v4() + ".json";
31
+ const filename = (0, uuid_1.v4)() + ".json";
31
32
  this.writeToFileWithGivenName(JSON.stringify(nodes, ["id", "name"]), filename);
32
33
  logger_1.logger.info(this.fileDownloadedMessage + filename);
33
34
  }
@@ -18,6 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.WidgetSourcemapsManager = void 0;
21
22
  const child_process_1 = require("child_process");
22
23
  const logger_1 = require("../../util/logger");
23
24
  const base_manager_1 = require("./base.manager");
@@ -44,7 +45,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
44
45
  "--disable-git",
45
46
  ];
46
47
  const datadogCommandLine = [...commandLines, "--minified-path-prefix=/package-manager/"].join(" ");
47
- child_process_1.exec(datadogCommandLine, (error, stdout) => {
48
+ (0, child_process_1.exec)(datadogCommandLine, (error, stdout) => {
48
49
  var _a;
49
50
  if (error) {
50
51
  logger_1.logger.error(new logger_1.GracefulError(error.message));
@@ -54,7 +55,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54
55
  }
55
56
  if (process.env.AWS_ACCESS_KEY_ID_CDN && process.env.AWS_SECRET_ACCESS_KEY_CDN) {
56
57
  try {
57
- const uploadSourcemapsStdout = child_process_1.execSync([
58
+ const uploadSourcemapsStdout = (0, child_process_1.execSync)([
58
59
  ...commandLines,
59
60
  `--minified-path-prefix=https://static.celonis.cloud/static/package-manager/`,
60
61
  ].join(" "));
@@ -4,12 +4,14 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./base.manager"], factory);
7
+ define(["require", "exports", "./base.manager", "form-data"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WidgetManager = void 0;
12
13
  const base_manager_1 = require("./base.manager");
14
+ const FormData = require("form-data");
13
15
  class WidgetManager extends base_manager_1.BaseManager {
14
16
  constructor() {
15
17
  super(...arguments);
@@ -49,11 +51,9 @@
49
51
  };
50
52
  }
51
53
  getBody() {
52
- return {
53
- formData: {
54
- file: this.content,
55
- },
56
- };
54
+ const formData = new FormData();
55
+ formData.append("file", this.content);
56
+ return formData;
57
57
  }
58
58
  getSerializedFileContent(data) {
59
59
  return data;
@@ -18,6 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.Export = void 0;
21
22
  const commander = require("commander");
22
23
  const package_command_1 = require("./commands/package.command");
23
24
  const logger_1 = require("./util/logger");
@@ -0,0 +1,52 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ (function (factory) {
11
+ if (typeof module === "object" && typeof module.exports === "object") {
12
+ var v = factory(require, exports);
13
+ if (v !== undefined) module.exports = v;
14
+ }
15
+ else if (typeof define === "function" && define.amd) {
16
+ define(["require", "exports", "./commands/connection.command", "commander", "./util/context-initializer", "./util/logger"], factory);
17
+ }
18
+ })(function (require, exports) {
19
+ "use strict";
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const connection_command_1 = require("./commands/connection.command");
22
+ const commander = require("commander");
23
+ const context_initializer_1 = require("./util/context-initializer");
24
+ const logger_1 = require("./util/logger");
25
+ class Get {
26
+ static connection(program) {
27
+ program
28
+ .command("connection")
29
+ .description("Programmatically read properties of your connections")
30
+ .option("-p, --profile <profile>", "Profile which you want to use to update the data pool configuration")
31
+ .requiredOption("--dataPoolId <dataPoolId>", "Id of the data pool you want to update")
32
+ .requiredOption("--connectionId <connectionId>", "Id of the connection you want to update")
33
+ .action((cmd) => __awaiter(this, void 0, void 0, function* () {
34
+ yield new connection_command_1.ConnectionCommand().getProperties(cmd.profile, cmd.dataPoolId, cmd.connectionId);
35
+ process.exit();
36
+ }));
37
+ return program;
38
+ }
39
+ }
40
+ context_initializer_1.ContextInitializer.initContext()
41
+ .then(() => {
42
+ Get.connection(commander);
43
+ commander.parse(process.argv);
44
+ })
45
+ .catch(e => {
46
+ logger_1.logger.error(e);
47
+ });
48
+ if (!process.argv.slice(2).length) {
49
+ commander.outputHelp();
50
+ process.exit(1);
51
+ }
52
+ });
@@ -18,6 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.Import = void 0;
21
22
  const commander = require("commander");
22
23
  const package_command_1 = require("./commands/package.command");
23
24
  const data_pool_command_1 = require("./commands/data-pool.command");
@@ -13,11 +13,12 @@ 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", "./commands/package.command", "./commands/space.command", "./commands/data-pool.command", "./commands/asset.command", "./util/logger", "commander", "./util/context-initializer", "./commands/variable.command"], factory);
16
+ define(["require", "exports", "./commands/package.command", "./commands/space.command", "./commands/data-pool.command", "./commands/asset.command", "./util/logger", "commander", "./util/context-initializer", "./commands/connection.command", "./commands/variable.command"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.List = void 0;
21
22
  const package_command_1 = require("./commands/package.command");
22
23
  const space_command_1 = require("./commands/space.command");
23
24
  const data_pool_command_1 = require("./commands/data-pool.command");
@@ -25,6 +26,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
25
26
  const logger_1 = require("./util/logger");
26
27
  const commander = require("commander");
27
28
  const context_initializer_1 = require("./util/context-initializer");
29
+ const connection_command_1 = require("./commands/connection.command");
28
30
  const variable_command_1 = require("./commands/variable.command");
29
31
  class List {
30
32
  static packages(program) {
@@ -65,6 +67,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
65
67
  }));
66
68
  return program;
67
69
  }
70
+ static connections(program) {
71
+ program
72
+ .command("connection")
73
+ .description("Command to list all connections in a Data Pool")
74
+ .option("-p, --profile <profile>", "Profile which you want to use to list connections")
75
+ .requiredOption("--dataPoolId <dataPoolId>", "ID of the data pool")
76
+ .action((cmd) => __awaiter(this, void 0, void 0, function* () {
77
+ yield new connection_command_1.ConnectionCommand().listConnections(cmd.profile, cmd.dataPoolId);
78
+ process.exit();
79
+ }));
80
+ return program;
81
+ }
68
82
  static assets(program) {
69
83
  program
70
84
  .command("assets")
@@ -102,6 +116,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
102
116
  List.spaces(commander);
103
117
  List.dataPools(commander);
104
118
  List.assets(commander);
119
+ List.connections(commander);
105
120
  List.assignments(commander);
106
121
  commander.parse(process.argv);
107
122
  };
@@ -104,7 +104,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
104
104
  if (process.env.AWS_ACCESS_KEY_ID_CDN && process.env.AWS_SECRET_ACCESS_KEY_CDN) {
105
105
  try {
106
106
  const dir = path.resolve(process.cwd());
107
- const pushToS3stdout = child_process_1.execSync(`aws s3 cp ${dir} s3://celonis-static-origin/static/package-manager/ --recursive --exclude="*.map" --exclude="*.yaml" --profile default`).toString("utf-8");
107
+ const pushToS3stdout = (0, child_process_1.execSync)(`aws s3 cp ${dir} s3://celonis-static-origin/static/package-manager/ --recursive --exclude="*.map" --exclude="*.yaml" --profile default`).toString("utf-8");
108
108
  logger_1.logger.info(pushToS3stdout);
109
109
  }
110
110
  catch (error) {
@@ -0,0 +1,54 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ (function (factory) {
11
+ if (typeof module === "object" && typeof module.exports === "object") {
12
+ var v = factory(require, exports);
13
+ if (v !== undefined) module.exports = v;
14
+ }
15
+ else if (typeof define === "function" && define.amd) {
16
+ define(["require", "exports", "./commands/connection.command", "commander", "./util/context-initializer", "./util/logger"], factory);
17
+ }
18
+ })(function (require, exports) {
19
+ "use strict";
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const connection_command_1 = require("./commands/connection.command");
22
+ const commander = require("commander");
23
+ const context_initializer_1 = require("./util/context-initializer");
24
+ const logger_1 = require("./util/logger");
25
+ class Set {
26
+ static connection(program) {
27
+ program
28
+ .command("connection")
29
+ .description("Programmatically update properties of your connections")
30
+ .option("-p, --profile <profile>", "Profile which you want to use to update the data pool configuration")
31
+ .requiredOption("--dataPoolId <dataPoolId>", "Id of the data pool you want to update")
32
+ .requiredOption("--connectionId <connectionId>", "Id of the connection you want to update")
33
+ .requiredOption("--property <property>", "The property you want to update")
34
+ .requiredOption("--value <value>", "The value you want to update")
35
+ .action((cmd) => __awaiter(this, void 0, void 0, function* () {
36
+ yield new connection_command_1.ConnectionCommand().updateProperty(cmd.profile, cmd.dataPoolId, cmd.connectionId, cmd.property, cmd.value);
37
+ process.exit();
38
+ }));
39
+ return program;
40
+ }
41
+ }
42
+ context_initializer_1.ContextInitializer.initContext()
43
+ .then(() => {
44
+ Set.connection(commander);
45
+ commander.parse(process.argv);
46
+ })
47
+ .catch(e => {
48
+ logger_1.logger.error(e);
49
+ });
50
+ if (!process.argv.slice(2).length) {
51
+ commander.outputHelp();
52
+ process.exit(1);
53
+ }
54
+ });
package/content-cli.js CHANGED
@@ -26,6 +26,8 @@
26
26
  program.command("push", "Commands to push content.");
27
27
  program.command("update", "Commands to update content.");
28
28
  program.command("list", "Commands to list content.").alias("ls");
29
+ program.command("get", "Commands to get configuration properties.");
30
+ program.command("set", "Commands to set configuration properties.");
29
31
  program.version(version_1.VersionUtils.getCurrentCliVersion());
30
32
  program.parse(process.argv);
31
33
  if (!process.argv.slice(2).length) {
@@ -9,11 +9,12 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PackageManagerVariableType = void 0;
12
13
  var PackageManagerVariableType;
13
14
  (function (PackageManagerVariableType) {
14
15
  PackageManagerVariableType["DATA_MODEL"] = "DATA_MODEL";
15
16
  PackageManagerVariableType["CONNECTION"] = "CONNECTION";
16
17
  PackageManagerVariableType["ASSIGNMENT_RULE"] = "ASSIGNMENT_RULE";
17
18
  PackageManagerVariableType["PLAIN_TEXT"] = "PLAIN_TEXT";
18
- })(PackageManagerVariableType = exports.PackageManagerVariableType || (exports.PackageManagerVariableType = {}));
19
+ })(PackageManagerVariableType || (exports.PackageManagerVariableType = PackageManagerVariableType = {}));
19
20
  });
@@ -9,6 +9,7 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthenticationType = void 0;
12
13
  // tslint:disable-next-line:variable-name
13
14
  exports.AuthenticationType = {
14
15
  BEARER: "Bearer",
@@ -4,6 +4,10 @@ declare class DataPoolApi {
4
4
  findAllPagedPools(limit: string, page: string): Promise<DataPoolPageTransport>;
5
5
  executeDataPoolsBatchImport(importRequest: string): Promise<DataPoolInstallVersionReport>;
6
6
  exportDataPool(poolId: string): Promise<string>;
7
+ listConnections(poolId: string): Promise<any>;
8
+ getConnection(poolId: string, connectionId: string): Promise<any>;
9
+ getTypedConnection(poolId: string, connectionId: string, type: string): Promise<any>;
10
+ updateTypedConnection(poolId: string, connectionId: string, type: string, data: any): Promise<any>;
7
11
  }
8
12
  export declare const dataPoolApi: DataPoolApi;
9
13
  export {};
@@ -0,0 +1,5 @@
1
+ export declare class ConnectionCommand {
2
+ updateProperty(profile: string, dataPoolId: string, connectionId: string, property: string, value: string): Promise<void>;
3
+ getProperties(profile: string, dataPoolId: string, connectionId: string): Promise<void>;
4
+ listConnections(profile: string, dataPoolId: string): Promise<any>;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,10 @@
1
1
  import commander = require("commander");
2
- declare type CommanderStatic = commander.CommanderStatic;
2
+ type CommanderStatic = commander.CommanderStatic;
3
3
  export declare class List {
4
4
  static packages(program: CommanderStatic): CommanderStatic;
5
5
  static spaces(program: CommanderStatic): CommanderStatic;
6
6
  static dataPools(program: CommanderStatic): CommanderStatic;
7
+ static connections(program: CommanderStatic): CommanderStatic;
7
8
  static assets(program: CommanderStatic): CommanderStatic;
8
9
  static assignments(program: CommanderStatic): CommanderStatic;
9
10
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  export declare type DataPoolStatus = "CANCEL" | "FAIL" | "QUEUED" | "RUNNING" | "SKIPPED" | "SUCCESS" | "UNCONFIGURED";
2
- export declare type Tag = {};
2
+ export type Tag = {};
3
3
  export declare class DataSourceSlimTransport {
4
4
  id: string;
5
5
  name: string;
@@ -4,7 +4,7 @@ export interface Profile {
4
4
  apiToken: string;
5
5
  authenticationType: AuthenticationType;
6
6
  }
7
- export declare type AuthenticationType = "Bearer" | "AppKey";
7
+ export type AuthenticationType = "Bearer" | "AppKey";
8
8
  export declare const AuthenticationType: {
9
9
  [key: string]: AuthenticationType;
10
10
  };
@@ -0,0 +1,7 @@
1
+ declare class ConnectionService {
2
+ findAllConnections(dataPoolId: string): Promise<any[]>;
3
+ listProperties(dataPoolId: string, connectionId: string): Promise<any[]>;
4
+ updateProperty(dataPoolId: string, connectionId: string, property: string, value: string): Promise<void>;
5
+ }
6
+ export declare const connectionService: ConnectionService;
7
+ export {};
@@ -7,12 +7,10 @@ declare class HttpClientServiceV2 {
7
7
  downloadFile(url: string): Promise<any>;
8
8
  private handleResponseStreamData;
9
9
  private resolveUrl;
10
- private makeFileDownloadOptions;
11
10
  private handleResponse;
11
+ private handleError;
12
12
  private checkBadRequest;
13
13
  private handleBadRequest;
14
- private makeOptions;
15
- private makeOptionsJson;
16
14
  private buildHeaders;
17
15
  private buildAuthorizationHeaders;
18
16
  }
@@ -1,15 +1,14 @@
1
1
  import { Profile } from "../interfaces/profile.interface";
2
2
  export declare class HttpClientService {
3
- pushData(url: string, profile: Profile, body: object): Promise<any>;
3
+ pushData(url: string, profile: Profile, body: any): Promise<any>;
4
4
  pullData(url: string, profile: Profile): Promise<any>;
5
5
  pullFileData(url: string, profile: Profile): Promise<any>;
6
6
  updateData(url: string, profile: Profile, body: object): Promise<any>;
7
7
  findAll(url: string, profile: Profile): Promise<any>;
8
- private makeOptions;
9
- private makeFileDownloadOptions;
10
8
  private buildAuthorizationHeaders;
11
9
  private handleResponseStreamData;
12
10
  private handleResponse;
11
+ private handleError;
13
12
  private checkBadRequest;
14
13
  private handleBadRequest;
15
14
  }
@@ -1,5 +1,5 @@
1
1
  import { Profile } from "../interfaces/profile.interface";
2
2
  export declare class ProfileValidator {
3
3
  static validateProfile(profile: Profile): Promise<any>;
4
- private static parseBody;
4
+ private static tryAuthenticationType;
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celonis/content-cli",
3
- "version": "0.5.4",
3
+ "version": "0.6.0",
4
4
  "description": "CLI Tool to help manage content in Celonis EMS",
5
5
  "main": "content-cli.js",
6
6
  "bin": {
@@ -16,24 +16,23 @@
16
16
  "dependencies": {
17
17
  "@datadog/datadog-ci": "^0.17.12",
18
18
  "adm-zip": "^0.4.14",
19
+ "axios": "1.6.2",
19
20
  "commander": "^6.0.0",
20
- "request": "^2.88.0",
21
- "request-promise-native": "^1.0.5",
21
+ "form-data": "4.0.0",
22
22
  "semver": "^7.3.2",
23
23
  "valid-url": "^1.0.9",
24
24
  "winston": "^3.1.0",
25
- "yaml": "2.0.0-8"
25
+ "yaml": "2.2.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/adm-zip": "^0.4.34",
29
- "@types/node": "^16.11.19",
30
- "@types/request": "~2.48.1",
29
+ "@types/node": "20.10.4",
31
30
  "lint-staged": "^9.5.0",
32
31
  "prettier": "^1.19.1",
33
32
  "tslint": "^5.20.1",
34
33
  "tslint-config-prettier": "^1.18.0",
35
34
  "tslint-consistent-codestyle": "^1.16.0",
36
- "typescript": "~3.8.0"
35
+ "typescript": "5.3.3"
37
36
  },
38
37
  "lint-staged": {
39
38
  "src/**/*.ts": [
@@ -0,0 +1,83 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ (function (factory) {
11
+ if (typeof module === "object" && typeof module.exports === "object") {
12
+ var v = factory(require, exports);
13
+ if (v !== undefined) module.exports = v;
14
+ }
15
+ else if (typeof define === "function" && define.amd) {
16
+ define(["require", "exports", "../../api/data-pool-api", "../../util/logger"], factory);
17
+ }
18
+ })(function (require, exports) {
19
+ "use strict";
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.connectionService = void 0;
22
+ const data_pool_api_1 = require("../../api/data-pool-api");
23
+ const logger_1 = require("../../util/logger");
24
+ class ConnectionService {
25
+ findAllConnections(dataPoolId) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const connections = yield data_pool_api_1.dataPoolApi.listConnections(dataPoolId);
28
+ connections.forEach(connection => {
29
+ logger_1.logger.info(`Connection ID: ${connection.id} - Name: ${connection.name} - Type: ${connection.type}`);
30
+ });
31
+ return connections;
32
+ });
33
+ }
34
+ listProperties(dataPoolId, connectionId) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const connection = yield data_pool_api_1.dataPoolApi.getConnection(dataPoolId, connectionId);
37
+ const type = connection.type;
38
+ const typedConnection = yield data_pool_api_1.dataPoolApi.getTypedConnection(dataPoolId, connectionId, type);
39
+ logger_1.logger.info(`Connection ID: ${connection.id} - Name: ${connection.name} - Type: ${connection.type}`);
40
+ logger_1.logger.info(`Properties:`);
41
+ for (let k in typedConnection) {
42
+ if (typeof typedConnection[k] === 'object') {
43
+ for (let o in typedConnection[k]) {
44
+ logger_1.logger.info(` ${k}.${o} : ${typeof typedConnection[k][o]} := ${typedConnection[k][o]}`);
45
+ }
46
+ }
47
+ else {
48
+ logger_1.logger.info(` ${k} : ${typeof typedConnection[k]} := ${typedConnection[k]}`);
49
+ }
50
+ }
51
+ return typedConnection;
52
+ });
53
+ }
54
+ updateProperty(dataPoolId, connectionId, property, value) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const connection = yield data_pool_api_1.dataPoolApi.getConnection(dataPoolId, connectionId);
57
+ const type = connection.type;
58
+ const typedConnection = yield data_pool_api_1.dataPoolApi.getTypedConnection(dataPoolId, connectionId, type);
59
+ const parts = property.split(".");
60
+ // update the typed connection object
61
+ let currentObject = typedConnection;
62
+ for (let i = 0; i < parts.length; i++) {
63
+ const part = parts[i];
64
+ if (currentObject.hasOwnProperty(part)) {
65
+ if (i < parts.length - 1) {
66
+ currentObject = currentObject[part];
67
+ }
68
+ else {
69
+ currentObject[part] = value;
70
+ }
71
+ }
72
+ else {
73
+ logger_1.logger.error(`Property ${property} not found on connection.`);
74
+ return;
75
+ }
76
+ }
77
+ yield data_pool_api_1.dataPoolApi.updateTypedConnection(dataPoolId, connectionId, type, typedConnection);
78
+ logger_1.logger.info(`Property ${property} updated.`);
79
+ });
80
+ }
81
+ }
82
+ exports.connectionService = new ConnectionService();
83
+ });
@@ -18,6 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.ContentService = void 0;
21
22
  const profile_service_1 = require("./profile.service");
22
23
  const logger_1 = require("../util/logger");
23
24
  class ContentService {
@@ -18,6 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.contextService = void 0;
21
22
  const profile_service_1 = require("./profile.service");
22
23
  class ContextService {
23
24
  getContext() {