@celonis/content-cli 1.0.0 → 1.0.3
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 +8 -7
- package/commands/studio/service/package.service.js +2 -2
- package/content-cli.js +21 -15
- package/core/utils/version.js +20 -4
- package/lib/core/utils/version.d.ts +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Content CLI
|
|
2
2
|
|
|
3
|
-
Content CLI is a tool to help manage content in Celonis
|
|
4
|
-
content like analyses, packages, assets and others from your Celonis
|
|
3
|
+
Content CLI is a tool to help manage content in Celonis Platform. It provides various commands to help extract
|
|
4
|
+
content like analyses, packages, assets and others from your Celonis Platform team to your local machine, which
|
|
5
5
|
you can then push to other teams. This process can be easily achieved by creating profiles for your different
|
|
6
6
|
teams and execute commands in a profile's context.
|
|
7
7
|
|
|
@@ -39,7 +39,7 @@ as part of our pycelonis examples library [here](https://github.com/celonis/pyce
|
|
|
39
39
|
|
|
40
40
|
Content CLI has three core functionalities:
|
|
41
41
|
|
|
42
|
-
**Profile:** The CLI connects to the
|
|
42
|
+
**Profile:** The CLI connects to the Celonis Platform environments through profiles. For each of the commands you can specify
|
|
43
43
|
which profile you want to use. This makes it powerful in the sense that you can pull something from let's say
|
|
44
44
|
team1.cluser1 and push it directly to team2.cluster2 easily. You can create a profile using the following command:
|
|
45
45
|
|
|
@@ -47,8 +47,8 @@ team1.cluser1 and push it directly to team2.cluster2 easily. You can create a pr
|
|
|
47
47
|
content-cli profile create
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
**Pull:** This feature allows you to download content from the
|
|
51
|
-
as an example. These can be exported in the
|
|
50
|
+
**Pull:** This feature allows you to download content from the Celonis Platform to your local machine. Let's take Studio package
|
|
51
|
+
as an example. These can be exported in the Celonis Platform as ZIP files that contain all package assets. By using the following
|
|
52
52
|
command using the package key and profile you have created, you will pull the ZIP file.
|
|
53
53
|
|
|
54
54
|
```
|
|
@@ -59,7 +59,7 @@ Example, if you want to pull a package with key "interesting-package" from your
|
|
|
59
59
|
content-cli pull package -p my-dev-profile --key interesting-package
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
**Push:** This feature allows you to push a content file to a team in the
|
|
62
|
+
**Push:** This feature allows you to push a content file to a team in the Celonis Platform. To continue the last example,
|
|
63
63
|
you can use the following command to push he previously pulled package in another team.
|
|
64
64
|
|
|
65
65
|
```
|
|
@@ -84,7 +84,7 @@ content-cli pull package -h
|
|
|
84
84
|
|
|
85
85
|
## Building and Using the Project locally
|
|
86
86
|
|
|
87
|
-
This tool is tightly connected with the Celonis
|
|
87
|
+
This tool is tightly connected with the Celonis Platform and all capabilities require to have access to a Celonis Platform Team.
|
|
88
88
|
After cloning the project, the next step is to install the project dependencies. We use `yarn` as our package manager,
|
|
89
89
|
so running `yarn install` on the project root folder should install all the necessary dependencies. After installing
|
|
90
90
|
the project dependencies, you can run `yarn build` to build the project artifact. To use the built artifact, you can
|
|
@@ -92,6 +92,7 @@ run `node content-cli.js` in the generated `dist` folder.
|
|
|
92
92
|
|
|
93
93
|
If we want to use a specific local build of the tool globally, we can do this by:
|
|
94
94
|
- Move to the root directory of the project.
|
|
95
|
+
- Execute `cd dist`, to move to the `dist` directory.
|
|
95
96
|
- Execute the `npm link` command.
|
|
96
97
|
This will create a symbolic link in the global `node_modules` directory, allowing you to run the CLI from anywhere on your machine.
|
|
97
98
|
|
|
@@ -57,13 +57,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
57
57
|
}
|
|
58
58
|
findAndExportListOfAllPackages(includeDependencies, packageKeys) {
|
|
59
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const fieldsToInclude = ["key", "name", "changeDate", "activatedDraftId", "workingDraftId", "spaceId"];
|
|
60
|
+
const fieldsToInclude = ["key", "name", "changeDate", "activatedDraftId", "workingDraftId", "spaceId", "id"];
|
|
61
61
|
let nodesListToExport = yield this.packageApi.findAllPackages();
|
|
62
62
|
if (packageKeys.length > 0) {
|
|
63
63
|
nodesListToExport = nodesListToExport.filter(node => packageKeys.includes(node.rootNodeKey));
|
|
64
64
|
}
|
|
65
65
|
if (includeDependencies) {
|
|
66
|
-
fieldsToInclude.push("type", "value", "dependencies", "
|
|
66
|
+
fieldsToInclude.push("type", "value", "dependencies", "updateAvailable", "version", "poolId", "node", "dataModelId", "dataPool", "datamodels");
|
|
67
67
|
const unPublishedNodes = nodesListToExport.filter(node => !node.activatedDraftId);
|
|
68
68
|
let publishedNodes = nodesListToExport.filter(node => node.activatedDraftId);
|
|
69
69
|
publishedNodes = yield this.getNodesWithActiveVersion(publishedNodes);
|
package/content-cli.js
CHANGED
|
@@ -36,21 +36,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
36
36
|
logger_1.logger.error(`Node version ${process.version} not supported. Please upgrade your node version to ${requiredVersion}`);
|
|
37
37
|
process.exit(1);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
function configureGlobalConfigurationOptions() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const program = new commander_1.Command();
|
|
42
|
+
const currentCliVersion = yield version_1.VersionUtils.getCurrentCliVersion();
|
|
43
|
+
program.version(currentCliVersion);
|
|
44
|
+
program.option("-q, --quietmode", "Reduce output to a minimum", false);
|
|
45
|
+
program.option("-p, --profile [profile]");
|
|
46
|
+
program.option("--debug", "Print debug messages", false);
|
|
47
|
+
program.option("--dev", "Development Mode", false);
|
|
48
|
+
program.parseOptions(process.argv);
|
|
49
|
+
if (!program.opts().quietmode) {
|
|
50
|
+
console.log(`Content CLI - (C) Copyright 2025 - Celonis SE - Version ${currentCliVersion}`);
|
|
51
|
+
console.log();
|
|
52
|
+
}
|
|
53
|
+
if (program.opts().debug) {
|
|
54
|
+
logger_1.logger.transports.forEach(t => {
|
|
55
|
+
t.level = "debug";
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return program;
|
|
54
59
|
});
|
|
55
60
|
}
|
|
56
61
|
/**
|
|
@@ -64,6 +69,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
64
69
|
}
|
|
65
70
|
function run() {
|
|
66
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const program = yield configureGlobalConfigurationOptions();
|
|
67
73
|
const context = new cli_context_1.Context(program.opts());
|
|
68
74
|
yield context.init();
|
|
69
75
|
const moduleHandler = new module_handler_1.ModuleHandler(program, context);
|
package/core/utils/version.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
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
|
+
};
|
|
1
10
|
(function (factory) {
|
|
2
11
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
12
|
var v = factory(require, exports);
|
|
4
13
|
if (v !== undefined) module.exports = v;
|
|
5
14
|
}
|
|
6
15
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
16
|
+
define(["require", "exports", "fs", "find-up"], factory);
|
|
8
17
|
}
|
|
9
18
|
})(function (require, exports) {
|
|
10
19
|
"use strict";
|
|
11
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
21
|
exports.VersionUtils = void 0;
|
|
13
|
-
|
|
14
|
-
const
|
|
22
|
+
const fs = require("fs");
|
|
23
|
+
const findUp = require("find-up");
|
|
15
24
|
class VersionUtils {
|
|
16
25
|
static getCurrentCliVersion() {
|
|
17
|
-
return
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const packageJsonPath = yield findUp("package.json");
|
|
28
|
+
if (!packageJsonPath) {
|
|
29
|
+
throw new Error("Could not find package.json");
|
|
30
|
+
}
|
|
31
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
32
|
+
return pkg.version;
|
|
33
|
+
});
|
|
18
34
|
}
|
|
19
35
|
}
|
|
20
36
|
exports.VersionUtils = VersionUtils;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celonis/content-cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "CLI Tool to help manage content in Celonis
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "CLI Tool to help manage content in Celonis Platform",
|
|
5
5
|
"main": "content-cli.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"content-cli": "./
|
|
7
|
+
"content-cli": "./content-cli.js"
|
|
8
8
|
},
|
|
9
9
|
"author": "Celonis SE",
|
|
10
10
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"commander": "13.1.0",
|
|
25
25
|
"form-data": "4.0.1",
|
|
26
26
|
"openid-client": "5.6.1",
|
|
27
|
+
"find-up": "4.1.0",
|
|
27
28
|
"hpagent": "1.2.0",
|
|
28
29
|
"semver": "7.6.3",
|
|
29
30
|
"valid-url": "1.0.9",
|