@celonis/content-cli 0.1.3 → 0.2.5
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 +68 -18
- package/commands/analysis.command.js +2 -1
- package/commands/asset.command.js +2 -1
- package/commands/ctp.command.js +2 -1
- package/commands/data-pool.command.js +2 -1
- package/commands/objective.command.js +2 -1
- package/commands/package.command.js +2 -1
- package/commands/profile.command.js +2 -1
- package/commands/skill.command.js +2 -1
- package/commands/widget-sourcemaps.command.js +33 -0
- package/commands/widget.command.js +2 -1
- package/content/factory/widget-manager.factory.js +2 -16
- package/content/factory/widget-sourcemaps-manager.factory.js +34 -0
- package/content/manager/analysis.manager.js +1 -1
- package/content/manager/asset.manager.js +1 -1
- package/content/manager/base.manager.js +2 -1
- package/content/manager/ctp.analysis.manager.js +1 -1
- package/content/manager/ctp.datamodel.manager.js +1 -1
- package/content/manager/data-pool.manager.js +1 -1
- package/content/manager/objective.manager.js +1 -1
- package/content/manager/package.manager.js +1 -1
- package/content/manager/skill.manager.js +1 -1
- package/content/manager/widget-sourcemaps.manager.js +83 -0
- package/content/manager/widget.manager.js +1 -1
- package/content-cli-list.js +2 -1
- package/content-cli-profile.js +2 -1
- package/content-cli-pull.js +2 -1
- package/content-cli-push.js +33 -3
- package/content-cli-update.js +2 -1
- package/content-cli.js +0 -0
- package/lib/commands/widget-sourcemaps.command.d.ts +4 -0
- package/lib/content/factory/widget-manager.factory.d.ts +15 -2
- package/lib/content/factory/widget-sourcemaps-manager.factory.d.ts +5 -0
- package/lib/content/manager/analysis.manager.d.ts +8 -4
- package/lib/content/manager/asset.manager.d.ts +7 -4
- package/lib/content/manager/base.manager.d.ts +2 -1
- package/lib/content/manager/ctp.manager.d.ts +6 -3
- package/lib/content/manager/data-pool.manager.d.ts +4 -2
- package/lib/content/manager/objective.manager.d.ts +4 -2
- package/lib/content/manager/package.manager.d.ts +14 -7
- package/lib/content/manager/skill.manager.d.ts +6 -3
- package/lib/content/manager/widget-sourcemaps.manager.d.ts +12 -0
- package/lib/content/manager/widget.manager.d.ts +6 -3
- package/lib/validators/profile.validator.d.ts +1 -0
- package/package.json +5 -3
- package/services/content.service.js +2 -1
- package/services/http-client.service.js +2 -1
- package/services/profile.service.js +2 -1
- package/services/question.service.js +3 -2
- package/validators/profile.validator.js +15 -13
package/README.md
CHANGED
|
@@ -1,53 +1,100 @@
|
|
|
1
1
|
# Content CLI
|
|
2
2
|
|
|
3
|
-
Content CLI is a tool to help manage content in Celonis EMS. It provides various commands to help extract
|
|
3
|
+
Content CLI is a tool to help manage content in Celonis EMS. It provides various commands to help extract
|
|
4
|
+
content like analyses, packages, assets and others from your Celonis EMS team to your local machine, which
|
|
5
|
+
you can then push to other teams. This process can be easily achieved by creating profiles for your different
|
|
6
|
+
teams and execute commands in a profile's context.
|
|
4
7
|
|
|
5
8
|
## Table of Contents
|
|
6
9
|
|
|
7
|
-
1. [
|
|
8
|
-
2. [
|
|
9
|
-
3. [
|
|
10
|
-
4. [
|
|
11
|
-
5. [
|
|
10
|
+
1. [Getting Started](#getting-started)
|
|
11
|
+
2. [About the Project](#about-the-project)
|
|
12
|
+
3. [Building the Project](#building-the-project)
|
|
13
|
+
4. [Release Process](#release-process)
|
|
14
|
+
5. [Contributing](#contributing)
|
|
15
|
+
6. [License](#license)
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
To get started with using Content CLI, you will need to have `node` installed in your local machine. Please download
|
|
20
|
+
the LTS version that is recommended for most users from the `node` web page [here](https://nodejs.org/en/). After
|
|
21
|
+
installing `node` you can run the following command in the terminal (cmd for Windows users) to install Content CLI.
|
|
22
|
+
Note that the same command is used for updating Content CLI too.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npm install -g @celonis/content-cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
You can verify that the installation was successful by running the following command in the terminal, which prints
|
|
29
|
+
the installed version of Content CLI:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
content-cli -V
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To get started with using Content CLI, you can follow some examples to manage content that are available
|
|
36
|
+
as part of our pycelonis examples library [here](https://github.com/celonis/pycelonis-examples/tree/main/00_manage_celonis/00_ibc_to_ibc_movers).
|
|
12
37
|
|
|
13
38
|
## About the Project
|
|
14
39
|
|
|
15
40
|
Content CLI has three core functionalities:
|
|
16
41
|
|
|
17
|
-
**Profile:** The CLI connects to the EMS environments through profiles. For each of the commands you can specify
|
|
42
|
+
**Profile:** The CLI connects to the EMS environments through profiles. For each of the commands you can specify
|
|
43
|
+
which profile you want to use. This makes it powerful in the sense that you can pull something from let's say
|
|
44
|
+
team1.cluser1 and push it directly to team2.cluster2 easily. You can create a profile using the following command:
|
|
18
45
|
|
|
19
46
|
```
|
|
20
47
|
content-cli profile create
|
|
21
48
|
```
|
|
22
49
|
|
|
23
|
-
**Pull:** This feature allows you to download content from the EMS to your local machine. Let's take Studio package
|
|
50
|
+
**Pull:** This feature allows you to download content from the EMS to your local machine. Let's take Studio package
|
|
51
|
+
as an example. These can be exported in the EMS as ZIP files that contain all package assets. By using the following
|
|
52
|
+
command using the package key and profile you have created, you will pull the ZIP file.
|
|
24
53
|
|
|
25
54
|
```
|
|
26
|
-
content-cli pull package -p
|
|
55
|
+
content-cli pull package -p <profile-name> --key <package-key>
|
|
56
|
+
```
|
|
57
|
+
Example, if you want to pull a package with key "interesting-package" from your profile "my-dev-profile", the command will look like this:
|
|
58
|
+
```
|
|
59
|
+
content-cli pull package -p my-dev-profile --key interesting-package
|
|
27
60
|
```
|
|
28
61
|
|
|
29
|
-
**Push:** This feature allows you to push a content file to a team in the EMS. To continue the last example,
|
|
62
|
+
**Push:** This feature allows you to push a content file to a team in the EMS. To continue the last example,
|
|
63
|
+
you can use the following command to push he previously pulled package in another team.
|
|
30
64
|
|
|
31
65
|
```
|
|
32
|
-
content-cli push package -p
|
|
66
|
+
content-cli push package -p <profile-name> --spaceKey <space-key> -f <file-to-push.zip>
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Example, if you want to push a package from zipped file "interesting-package.zip" to you team of profile "my-dev-profile" with the space "my-cool-space", the command will look like this:
|
|
70
|
+
```
|
|
71
|
+
content-cli push package -p my-dev-profile --spaceKey my-cool-space -f interesting-package.zip
|
|
33
72
|
```
|
|
34
73
|
|
|
35
|
-
A more comprehensive list of Content CLI capabilities can be found on the following
|
|
74
|
+
A more comprehensive list of Content CLI capabilities can be found on the following
|
|
75
|
+
[documentation](https://github.com/celonis/content-cli/blob/master/DOCUMENTATION.md).
|
|
36
76
|
|
|
37
|
-
You can still explore the full capabilities of Content CLI and the list of options for the different commands
|
|
77
|
+
You can still explore the full capabilities of Content CLI and the list of options for the different commands
|
|
78
|
+
by using the `-h` option in your command.
|
|
38
79
|
|
|
39
80
|
```
|
|
40
81
|
content-cli -h
|
|
41
82
|
content-cli pull package -h
|
|
42
83
|
```
|
|
43
84
|
|
|
44
|
-
##
|
|
85
|
+
## Building the Project
|
|
45
86
|
|
|
46
|
-
This tool is tightly connected with the Celonis EMS and all capabilities require to have access to a Celonis EMS Team.
|
|
87
|
+
This tool is tightly connected with the Celonis EMS and all capabilities require to have access to a Celonis EMS Team.
|
|
88
|
+
After cloning the project, the next step is to install the project dependencies. We use `yarn` as our package manager,
|
|
89
|
+
so running `yarn install` on the project root folder should install all the necessary dependencies. After installing
|
|
90
|
+
the project dependencies, you can run `yarn build` to build the project artifact. To use the built artifact, you can
|
|
91
|
+
run `node content-cli.js` in the generated `dist` folder.
|
|
47
92
|
|
|
48
93
|
## Release Process
|
|
49
94
|
|
|
50
|
-
We manage releases using Github Actions with the `Build and Publish Workflow`. This action runs after merging to
|
|
95
|
+
We manage releases using Github Actions with the `Build and Publish Workflow`. This action runs after merging to
|
|
96
|
+
the master branch, which builds the project and publishes the package to the Github registry. You can install
|
|
97
|
+
a published version of the Content CLI using the following command:
|
|
51
98
|
|
|
52
99
|
```
|
|
53
100
|
npm i -g @celonis/content-cli
|
|
@@ -55,10 +102,13 @@ npm i -g @celonis/content-cli
|
|
|
55
102
|
|
|
56
103
|
## Contributing
|
|
57
104
|
|
|
58
|
-
We encourage public contributions! Please review
|
|
105
|
+
We encourage public contributions! Please review
|
|
106
|
+
[CONTRIBUTING.md](https://github.com/celonis/content-cli/blob/master/CONTRIBUTING.md) for details on our
|
|
107
|
+
code of conduct and development process.
|
|
59
108
|
|
|
60
109
|
## License
|
|
61
110
|
|
|
62
111
|
Copyright (c) 2021 Celonis SE
|
|
63
112
|
|
|
64
|
-
This project is licensed under the MIT License -
|
|
113
|
+
This project is licensed under the MIT License -
|
|
114
|
+
see [LICENSE](https://github.com/celonis/content-cli/blob/master/LICENSE) file for details.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
package/commands/ctp.command.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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", "../content/factory/widget-sourcemaps-manager.factory"], factory);
|
|
17
|
+
}
|
|
18
|
+
})(function (require, exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const widget_sourcemaps_manager_factory_1 = require("../content/factory/widget-sourcemaps-manager.factory");
|
|
22
|
+
class WidgetSourcemapsCommand {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.widgetSourcemapsFactory = new widget_sourcemaps_manager_factory_1.WidgetSourcemapsManagerFactory();
|
|
25
|
+
}
|
|
26
|
+
pushSourceMaps() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
yield this.widgetSourcemapsFactory.createManager().push();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.WidgetSourcemapsCommand = WidgetSourcemapsCommand;
|
|
33
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -31,20 +31,9 @@
|
|
|
31
31
|
this.validateManifest(manifest);
|
|
32
32
|
const zip = new AdmZip();
|
|
33
33
|
const zipFileName = path.resolve(process.cwd(), "output.zip");
|
|
34
|
-
|
|
35
|
-
zip.addLocalFolder(path.resolve(process.cwd(), "assets"), "assets");
|
|
36
|
-
}
|
|
37
|
-
if (fs.existsSync(path.resolve(process.cwd(), "manifest.yaml"))) {
|
|
38
|
-
zip.addLocalFile(path.resolve(process.cwd(), "manifest.yaml"));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
zip.addLocalFile(path.resolve(process.cwd(), "manifest.yml"));
|
|
42
|
-
}
|
|
43
|
-
zip.addLocalFile(path.resolve(process.cwd(), manifest.bundle));
|
|
34
|
+
zip.addLocalFolder(path.resolve(process.cwd()));
|
|
44
35
|
zip.writeZip(zipFileName);
|
|
45
|
-
|
|
46
|
-
fs.unlinkSync(zipFileName);
|
|
47
|
-
return stream;
|
|
36
|
+
return fs.createReadStream(path.resolve(process.cwd(), "output.zip"));
|
|
48
37
|
}
|
|
49
38
|
fetchManifest() {
|
|
50
39
|
if (fs.existsSync(path.resolve(process.cwd(), "manifest.yaml"))) {
|
|
@@ -65,9 +54,6 @@
|
|
|
65
54
|
if (!manifest.key) {
|
|
66
55
|
logger_1.logger.error(new logger_1.FatalError("Missing 'key' attribute."));
|
|
67
56
|
}
|
|
68
|
-
if (!manifest.key) {
|
|
69
|
-
logger_1.logger.error(new logger_1.FatalError("Missing 'key' attribute."));
|
|
70
|
-
}
|
|
71
57
|
if (!fs.existsSync(manifest.bundle)) {
|
|
72
58
|
logger_1.logger.error(new logger_1.FatalError("Missing bundle."));
|
|
73
59
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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", "path", "../../util/logger", "../manager/widget-sourcemaps.manager", "./widget-manager.factory"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const logger_1 = require("../../util/logger");
|
|
14
|
+
const widget_sourcemaps_manager_1 = require("../manager/widget-sourcemaps.manager");
|
|
15
|
+
const widget_manager_factory_1 = require("./widget-manager.factory");
|
|
16
|
+
class WidgetSourcemapsManagerFactory {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.widgetManagerFactory = new widget_manager_factory_1.WidgetManagerFactory();
|
|
19
|
+
}
|
|
20
|
+
createManager() {
|
|
21
|
+
const widgetSourcemapsManager = new widget_sourcemaps_manager_1.WidgetSourcemapsManager();
|
|
22
|
+
const manifest = this.widgetManagerFactory.fetchManifest();
|
|
23
|
+
if (!manifest) {
|
|
24
|
+
logger_1.logger.error(new logger_1.FatalError("Missing manifest file."));
|
|
25
|
+
}
|
|
26
|
+
this.widgetManagerFactory.validateManifest(manifest);
|
|
27
|
+
widgetSourcemapsManager.distPath = path.resolve(process.cwd());
|
|
28
|
+
widgetSourcemapsManager.service = manifest.key;
|
|
29
|
+
widgetSourcemapsManager.releaseVersion = manifest.version;
|
|
30
|
+
return widgetSourcemapsManager;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.WidgetSourcemapsManagerFactory = WidgetSourcemapsManagerFactory;
|
|
34
|
+
});
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
return JSON.stringify(data);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
exports.AnalysisManager = AnalysisManager;
|
|
69
70
|
AnalysisManager.BASE_URL = "/process-mining/api/analysis/";
|
|
70
71
|
AnalysisManager.PULL_URL = `${AnalysisManager.BASE_URL}/export?id=`;
|
|
71
72
|
AnalysisManager.ANALYSIS_FILE_PREFIX = "analysis_";
|
|
72
|
-
exports.AnalysisManager = AnalysisManager;
|
|
73
73
|
});
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
return YAML.stringify(data);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
exports.AssetManager = AssetManager;
|
|
63
64
|
AssetManager.ASSET_FILE_PREFIX = "asset_";
|
|
64
65
|
AssetManager.BASE_URL = "/package-manager/api/nodes";
|
|
65
66
|
AssetManager.PUSH_URL = `${AssetManager.BASE_URL}/asset/import`;
|
|
66
67
|
AssetManager.PULL_URL = `${AssetManager.BASE_URL}/asset/export`;
|
|
67
|
-
exports.AssetManager = AssetManager;
|
|
68
68
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
return JSON.stringify(data);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
exports.DataPoolManager = DataPoolManager;
|
|
59
60
|
DataPoolManager.DATA_POOL_FILE_NAME_PREFIX = "data-pool_";
|
|
60
61
|
DataPoolManager.API_URL = "/integration/api";
|
|
61
62
|
DataPoolManager.DATA_POOL_PUSH_URL = DataPoolManager.API_URL + "/pool-import";
|
|
62
63
|
DataPoolManager.DATA_POOL_ACTIONS_URL = DataPoolManager.API_URL + "/pools/{id}";
|
|
63
64
|
DataPoolManager.DATA_POOL_PULL_URL = DataPoolManager.DATA_POOL_ACTIONS_URL + "/export";
|
|
64
|
-
exports.DataPoolManager = DataPoolManager;
|
|
65
65
|
});
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
return pushUrlWithParams;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
exports.PackageManager = PackageManager;
|
|
107
108
|
PackageManager.PACKAGE_FILE_PREFIX = "package_";
|
|
108
109
|
PackageManager.PACKAGE_FILE_EXTENSION = ".zip";
|
|
109
110
|
PackageManager.BASE_URL = "/package-manager/api/packages";
|
|
110
111
|
PackageManager.IMPORT_ENDPOINT_PATH = "import";
|
|
111
112
|
PackageManager.EXPORT_ENDPOINT_PATH = "export";
|
|
112
|
-
exports.PackageManager = PackageManager;
|
|
113
113
|
});
|
|
@@ -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", "child_process", "../../util/logger", "./base.manager"], factory);
|
|
17
|
+
}
|
|
18
|
+
})(function (require, exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const child_process_1 = require("child_process");
|
|
22
|
+
const logger_1 = require("../../util/logger");
|
|
23
|
+
const base_manager_1 = require("./base.manager");
|
|
24
|
+
class WidgetSourcemapsManager extends base_manager_1.BaseManager {
|
|
25
|
+
push() {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
return this.pushWidgetSourcemaps(`assets/widgets/${this.service}`, `assets/widgets/${this.service}`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
pushWidgetSourcemaps(sourcemapsPath, distPathPostfix) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
if (!process.env.DATADOG_SITE) {
|
|
34
|
+
logger_1.logger.error(new logger_1.GracefulError("Missing DATADOG_SITE"));
|
|
35
|
+
}
|
|
36
|
+
else if (!process.env.DATADOG_API_KEY) {
|
|
37
|
+
logger_1.logger.error(new logger_1.GracefulError("Missing DATADOG_API_KEY"));
|
|
38
|
+
}
|
|
39
|
+
const datadogCiPath = require.resolve("@datadog/datadog-ci/dist/cli.js");
|
|
40
|
+
const commandLines = [
|
|
41
|
+
`node ${datadogCiPath} sourcemaps upload .`,
|
|
42
|
+
`--service=package-manager`,
|
|
43
|
+
`--release-version=1.0.0`,
|
|
44
|
+
"--disable-git",
|
|
45
|
+
];
|
|
46
|
+
const datadogCommandLine = [...commandLines, "--minified-path-prefix=/package-manager/"].join(" ");
|
|
47
|
+
child_process_1.exec(datadogCommandLine, (error, stdout) => {
|
|
48
|
+
var _a;
|
|
49
|
+
if (error) {
|
|
50
|
+
logger_1.logger.error(new logger_1.GracefulError(error.message));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
logger_1.logger.info(new logger_1.GracefulError(stdout));
|
|
54
|
+
}
|
|
55
|
+
if (process.env.AWS_ACCESS_KEY_ID_CDN && process.env.AWS_SECRET_ACCESS_KEY_CDN) {
|
|
56
|
+
try {
|
|
57
|
+
const uploadSourcemapsStdout = child_process_1.execSync([
|
|
58
|
+
...commandLines,
|
|
59
|
+
`--minified-path-prefix=https://static.celonis.cloud/static/package-manager/`,
|
|
60
|
+
].join(" "));
|
|
61
|
+
logger_1.logger.info(uploadSourcemapsStdout);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger_1.logger.error(new logger_1.GracefulError(((_a = error.stderr) === null || _a === void 0 ? void 0 : _a.toString()) || error.message));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return resolve(error || stdout);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getConfig() {
|
|
73
|
+
return {};
|
|
74
|
+
}
|
|
75
|
+
getBody() {
|
|
76
|
+
return {};
|
|
77
|
+
}
|
|
78
|
+
getSerializedFileContent(data) {
|
|
79
|
+
return "";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.WidgetSourcemapsManager = WidgetSourcemapsManager;
|
|
83
|
+
});
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
return data;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
exports.WidgetManager = WidgetManager;
|
|
62
63
|
WidgetManager.PACKAGE_MANAGER_BASE_URL = "/package-manager";
|
|
63
64
|
WidgetManager.WIDGET_API = "/api/widgets/upload";
|
|
64
65
|
WidgetManager.WIDGET_TENANT_INDEPENDENT_API = "/api/widgets/upload-tenant-independently";
|
|
65
66
|
WidgetManager.WIDGET_USER_SPECIFIC_API = "/api/widgets/upload-user";
|
|
66
|
-
exports.WidgetManager = WidgetManager;
|
|
67
67
|
});
|
package/content-cli-list.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
package/content-cli-profile.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
package/content-cli-pull.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
package/content-cli-push.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -12,11 +13,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
13
|
if (v !== undefined) module.exports = v;
|
|
13
14
|
}
|
|
14
15
|
else if (typeof define === "function" && define.amd) {
|
|
15
|
-
define(["require", "exports", "./commands/analysis.command", "./commands/skill.command", "./commands/widget.command", "./commands/data-pool.command", "./commands/asset.command", "./commands/package.command", "./commands/ctp.command", "
|
|
16
|
+
define(["require", "exports", "commander", "fs", "path", "./commands/analysis.command", "./commands/skill.command", "./commands/widget.command", "./commands/data-pool.command", "./commands/asset.command", "./commands/package.command", "./commands/ctp.command", "./commands/widget-sourcemaps.command", "child_process", "./util/logger"], factory);
|
|
16
17
|
}
|
|
17
18
|
})(function (require, exports) {
|
|
18
19
|
"use strict";
|
|
19
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const commander = require("commander");
|
|
22
|
+
const fs = require("fs");
|
|
23
|
+
const path = require("path");
|
|
20
24
|
const analysis_command_1 = require("./commands/analysis.command");
|
|
21
25
|
const skill_command_1 = require("./commands/skill.command");
|
|
22
26
|
const widget_command_1 = require("./commands/widget.command");
|
|
@@ -24,7 +28,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
28
|
const asset_command_1 = require("./commands/asset.command");
|
|
25
29
|
const package_command_1 = require("./commands/package.command");
|
|
26
30
|
const ctp_command_1 = require("./commands/ctp.command");
|
|
27
|
-
const
|
|
31
|
+
const widget_sourcemaps_command_1 = require("./commands/widget-sourcemaps.command");
|
|
32
|
+
const child_process_1 = require("child_process");
|
|
33
|
+
const logger_1 = require("./util/logger");
|
|
28
34
|
class Push {
|
|
29
35
|
static analysis(program) {
|
|
30
36
|
program
|
|
@@ -79,7 +85,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
79
85
|
.option("--userSpecific", "Upload widget only for the user in the provided api token")
|
|
80
86
|
.option("--packageManager", "Upload widget to package manager (deprecated)") // Deprecated
|
|
81
87
|
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
var _a;
|
|
82
89
|
yield new widget_command_1.WidgetCommand().pushWidget(cmd.profile, !!cmd.tenantIndependent, !!cmd.userSpecific);
|
|
90
|
+
if (process.env.AWS_ACCESS_KEY_ID_CDN && process.env.AWS_SECRET_ACCESS_KEY_CDN) {
|
|
91
|
+
try {
|
|
92
|
+
const dir = path.resolve(process.cwd());
|
|
93
|
+
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");
|
|
94
|
+
logger_1.logger.info(pushToS3stdout);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
logger_1.logger.error(new logger_1.GracefulError(((_a = error.stderr) === null || _a === void 0 ? void 0 : _a.toString()) || error.message));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const zipFileName = path.resolve(process.cwd(), "output.zip");
|
|
101
|
+
fs.unlinkSync(zipFileName);
|
|
102
|
+
process.exit();
|
|
103
|
+
}));
|
|
104
|
+
return program;
|
|
105
|
+
}
|
|
106
|
+
static widgetSourcemaps(program) {
|
|
107
|
+
program
|
|
108
|
+
.command("widget-sourcemaps")
|
|
109
|
+
.description("Command to upload sourcemaps to Datadog RUM")
|
|
110
|
+
.action(() => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
yield new widget_sourcemaps_command_1.WidgetSourcemapsCommand().pushSourceMaps();
|
|
83
112
|
process.exit();
|
|
84
113
|
}));
|
|
85
114
|
return program;
|
|
@@ -170,6 +199,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
170
199
|
Push.assets(commander);
|
|
171
200
|
Push.package(commander);
|
|
172
201
|
Push.packages(commander);
|
|
202
|
+
Push.widgetSourcemaps(commander);
|
|
173
203
|
commander.parse(process.argv);
|
|
174
204
|
if (!process.argv.slice(2).length) {
|
|
175
205
|
commander.outputHelp();
|
package/content-cli-update.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
package/content-cli.js
CHANGED
|
File without changes
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { WidgetManager } from "../manager/widget.manager";
|
|
2
|
+
interface Manifest {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
bundle: string;
|
|
6
|
+
version: string;
|
|
7
|
+
externalResource: string;
|
|
8
|
+
widgets: ManifestWidget[];
|
|
9
|
+
}
|
|
10
|
+
interface ManifestWidget {
|
|
11
|
+
widgetId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
2
14
|
export declare class WidgetManagerFactory {
|
|
3
15
|
createManager(tenantIndependent?: boolean, userSpecific?: boolean): WidgetManager;
|
|
4
16
|
private readContent;
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
fetchManifest(): Manifest;
|
|
18
|
+
validateManifest(manifest: Manifest): void;
|
|
7
19
|
}
|
|
20
|
+
export {};
|
|
@@ -8,10 +8,14 @@ export declare class AnalysisManager extends BaseManager {
|
|
|
8
8
|
private _processId;
|
|
9
9
|
private _fileName;
|
|
10
10
|
private _packageManager;
|
|
11
|
-
fileName: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
get fileName(): string;
|
|
12
|
+
set fileName(value: string);
|
|
13
|
+
get id(): string;
|
|
14
|
+
set id(value: string);
|
|
15
|
+
get processId(): string;
|
|
16
|
+
set processId(value: string);
|
|
17
|
+
get packageManager(): boolean;
|
|
18
|
+
set packageManager(value: boolean);
|
|
15
19
|
getConfig(): ManagerConfig;
|
|
16
20
|
getBody(): any;
|
|
17
21
|
protected getSerializedFileContent(data: any): string;
|
|
@@ -8,10 +8,13 @@ export declare class AssetManager extends BaseManager {
|
|
|
8
8
|
private _key;
|
|
9
9
|
private _content;
|
|
10
10
|
private _packageKey;
|
|
11
|
-
key: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
get key(): string;
|
|
12
|
+
set key(value: string);
|
|
13
|
+
get content(): string;
|
|
14
|
+
set content(value: string);
|
|
15
|
+
get packageKey(): string;
|
|
16
|
+
set packageKey(value: string);
|
|
17
|
+
private get onlyKey();
|
|
15
18
|
getConfig(): ManagerConfig;
|
|
16
19
|
getBody(): any;
|
|
17
20
|
private toNodeTransport;
|
|
@@ -2,7 +2,8 @@ import { Profile } from "../../interfaces/profile.interface";
|
|
|
2
2
|
import { ManagerConfig } from "../../interfaces/manager-config.interface";
|
|
3
3
|
export declare abstract class BaseManager {
|
|
4
4
|
private httpClientService;
|
|
5
|
-
profile: Profile;
|
|
5
|
+
get profile(): Profile;
|
|
6
|
+
set profile(value: Profile);
|
|
6
7
|
private _profile;
|
|
7
8
|
pull(): Promise<any>;
|
|
8
9
|
pullFile(): Promise<any>;
|
|
@@ -4,9 +4,12 @@ export declare abstract class CtpManager extends BaseManager {
|
|
|
4
4
|
protected _content: any;
|
|
5
5
|
protected _password: string;
|
|
6
6
|
protected _spaceKey?: string;
|
|
7
|
-
content: any;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
get content(): any;
|
|
8
|
+
set content(value: any);
|
|
9
|
+
get password(): string;
|
|
10
|
+
set password(value: string);
|
|
11
|
+
get spaceKey(): string;
|
|
12
|
+
set spaceKey(value: string);
|
|
10
13
|
getConfig(): ManagerConfig;
|
|
11
14
|
protected getSerializedFileContent(data: any): string;
|
|
12
15
|
protected abstract getUrl(): string;
|
|
@@ -8,8 +8,10 @@ export declare class DataPoolManager extends BaseManager {
|
|
|
8
8
|
private static DATA_POOL_PULL_URL;
|
|
9
9
|
private _id;
|
|
10
10
|
private _content;
|
|
11
|
-
content: string;
|
|
12
|
-
|
|
11
|
+
get content(): string;
|
|
12
|
+
set content(value: string);
|
|
13
|
+
get id(): string;
|
|
14
|
+
set id(value: string);
|
|
13
15
|
getConfig(): ManagerConfig;
|
|
14
16
|
getBody(): any;
|
|
15
17
|
protected getSerializedFileContent(data: any): string;
|
|
@@ -4,8 +4,10 @@ export declare class ObjectiveManager extends BaseManager {
|
|
|
4
4
|
private static BASE_URL;
|
|
5
5
|
private _id;
|
|
6
6
|
private _content;
|
|
7
|
-
content: string;
|
|
8
|
-
|
|
7
|
+
get content(): string;
|
|
8
|
+
set content(value: string);
|
|
9
|
+
get id(): string;
|
|
10
|
+
set id(value: string);
|
|
9
11
|
getConfig(): ManagerConfig;
|
|
10
12
|
getBody(): any;
|
|
11
13
|
protected getSerializedFileContent(data: any): string;
|
|
@@ -13,13 +13,20 @@ export declare class PackageManager extends BaseManager {
|
|
|
13
13
|
private _newKey;
|
|
14
14
|
private _overwrite;
|
|
15
15
|
private _draft;
|
|
16
|
-
key: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
get key(): string;
|
|
17
|
+
set key(value: string);
|
|
18
|
+
get spaceKey(): string;
|
|
19
|
+
set spaceKey(value: string);
|
|
20
|
+
get fileName(): string;
|
|
21
|
+
set fileName(value: string);
|
|
22
|
+
get store(): boolean;
|
|
23
|
+
set store(value: boolean);
|
|
24
|
+
get newKey(): string;
|
|
25
|
+
set newKey(value: string);
|
|
26
|
+
get overwrite(): boolean;
|
|
27
|
+
set overwrite(value: boolean);
|
|
28
|
+
get draft(): boolean;
|
|
29
|
+
set draft(value: boolean);
|
|
23
30
|
getConfig(): ManagerConfig;
|
|
24
31
|
getBody(): any;
|
|
25
32
|
protected getSerializedFileContent(data: any): string;
|
|
@@ -5,9 +5,12 @@ export declare class SkillManager extends BaseManager {
|
|
|
5
5
|
private _skillId;
|
|
6
6
|
private _projectId;
|
|
7
7
|
private _content;
|
|
8
|
-
content: any;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
get content(): any;
|
|
9
|
+
set content(value: any);
|
|
10
|
+
get skillId(): string;
|
|
11
|
+
set skillId(value: string);
|
|
12
|
+
get projectId(): string;
|
|
13
|
+
set projectId(value: string);
|
|
11
14
|
getConfig(): ManagerConfig;
|
|
12
15
|
getBody(): any;
|
|
13
16
|
protected getSerializedFileContent(data: any): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ManagerConfig } from "../../interfaces/manager-config.interface";
|
|
2
|
+
import { BaseManager } from "./base.manager";
|
|
3
|
+
export declare class WidgetSourcemapsManager extends BaseManager {
|
|
4
|
+
service: string;
|
|
5
|
+
releaseVersion: string;
|
|
6
|
+
distPath: string;
|
|
7
|
+
push(): Promise<any>;
|
|
8
|
+
private pushWidgetSourcemaps;
|
|
9
|
+
protected getConfig(): ManagerConfig;
|
|
10
|
+
protected getBody(): object;
|
|
11
|
+
protected getSerializedFileContent(data: any): string;
|
|
12
|
+
}
|
|
@@ -8,9 +8,12 @@ export declare class WidgetManager extends BaseManager {
|
|
|
8
8
|
private _content;
|
|
9
9
|
private _tenantIndependent;
|
|
10
10
|
private _userSpecific;
|
|
11
|
-
content: any;
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
get content(): any;
|
|
12
|
+
set content(value: any);
|
|
13
|
+
get tenantIndependent(): any;
|
|
14
|
+
set tenantIndependent(value: any);
|
|
15
|
+
get userSpecific(): any;
|
|
16
|
+
set userSpecific(value: any);
|
|
14
17
|
getConfig(): ManagerConfig;
|
|
15
18
|
getBody(): any;
|
|
16
19
|
protected getSerializedFileContent(data: any): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celonis/content-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "CLI Tool to help manage content in Celonis EMS",
|
|
5
5
|
"main": "content-cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"lint": "tslint -p ."
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@datadog/datadog-ci": "^0.17.12",
|
|
17
18
|
"adm-zip": "^0.4.14",
|
|
18
19
|
"commander": "^6.0.0",
|
|
19
20
|
"request": "^2.88.0",
|
|
@@ -24,7 +25,8 @@
|
|
|
24
25
|
"yaml": "^1.7.2"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@types/
|
|
28
|
+
"@types/adm-zip": "^0.4.34",
|
|
29
|
+
"@types/node": "^16.11.19",
|
|
28
30
|
"@types/request": "~2.48.1",
|
|
29
31
|
"husky": "^4.0.3",
|
|
30
32
|
"lint-staged": "^9.5.0",
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
"tslint": "^5.20.1",
|
|
33
35
|
"tslint-config-prettier": "^1.18.0",
|
|
34
36
|
"tslint-consistent-codestyle": "^1.16.0",
|
|
35
|
-
"typescript": "3.
|
|
37
|
+
"typescript": "~3.8.0"
|
|
36
38
|
},
|
|
37
39
|
"husky": {
|
|
38
40
|
"hooks": {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -27,10 +28,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
exports.QuestionService = QuestionService;
|
|
30
32
|
QuestionService.readLine = readline.createInterface({
|
|
31
33
|
input: process.stdin,
|
|
32
34
|
output: process.stdout,
|
|
33
35
|
terminal: true,
|
|
34
36
|
});
|
|
35
|
-
exports.QuestionService = QuestionService;
|
|
36
37
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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); }); }
|
|
2
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3
4
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4
5
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -37,25 +38,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
37
38
|
if (!validUrl.isUri(profile.team)) {
|
|
38
39
|
logger_1.logger.error(new logger_1.FatalError("The provided url is not a valid url."));
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
const options = {
|
|
41
42
|
headers: {
|
|
42
43
|
authorization: `${profile_interface_1.AuthenticationType.BEARER} ${profile.apiToken}`,
|
|
43
44
|
},
|
|
44
45
|
};
|
|
45
|
-
const url = profile.team.replace(/\/?$/, "/api/cloud");
|
|
46
|
+
const url = profile.team.replace(/\/?$/, "/api/cloud/team");
|
|
46
47
|
request.get(url, options, (err, res) => {
|
|
47
|
-
let body;
|
|
48
|
-
|
|
49
|
-
body = JSON.parse(res.body);
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
logger_1.logger.error(new logger_1.FatalError("The provided team or api key is wrong."));
|
|
53
|
-
reject();
|
|
54
|
-
}
|
|
55
|
-
if (res.statusCode >= 400 || body.teamDomain == null) {
|
|
48
|
+
let body = this.parseBody(res.body);
|
|
49
|
+
if (res.statusCode >= 400 || !(body === null || body === void 0 ? void 0 : body.domain)) {
|
|
56
50
|
options.headers.authorization = `${profile_interface_1.AuthenticationType.APPKEY} ${profile.apiToken}`;
|
|
57
51
|
request.get(url, options, (err, res) => {
|
|
58
|
-
|
|
52
|
+
body = this.parseBody(res.body);
|
|
53
|
+
if (res.statusCode === 200 && (body === null || body === void 0 ? void 0 : body.domain)) {
|
|
59
54
|
resolve(profile_interface_1.AuthenticationType.APPKEY);
|
|
60
55
|
}
|
|
61
56
|
else {
|
|
@@ -71,6 +66,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
71
66
|
});
|
|
72
67
|
});
|
|
73
68
|
}
|
|
69
|
+
static parseBody(responseBody) {
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(responseBody);
|
|
72
|
+
// tslint:disable-next-line:no-empty
|
|
73
|
+
}
|
|
74
|
+
catch (ignored) { }
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
exports.ProfileValidator = ProfileValidator;
|
|
76
78
|
});
|