@celonis/content-cli 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -18
- package/commands/analysis.command.js +2 -1
- package/commands/asset.command.js +2 -1
- package/commands/ctp.command.js +4 -3
- package/commands/data-pool.command.js +2 -1
- package/commands/objective.command.js +2 -1
- package/commands/package.command.js +6 -5
- package/commands/profile.command.js +3 -2
- 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/ctp-manager.factory.js +4 -3
- package/content/factory/package-manager.factory.js +20 -13
- 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 +2 -1
- package/content/manager/ctp.datamodel.manager.js +1 -1
- package/content/manager/ctp.manager.js +6 -0
- package/content/manager/data-pool.manager.js +1 -1
- package/content/manager/objective.manager.js +1 -1
- package/content/manager/package.manager.js +8 -10
- package/content/manager/skill.manager.js +1 -1
- package/content/manager/widget-sourcemaps.manager.js +69 -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 +4 -2
- package/content-cli-push.js +22 -4
- package/content-cli-update.js +2 -1
- package/content-cli.js +0 -0
- package/interfaces/profile.interface.js +5 -0
- package/lib/commands/ctp.command.d.ts +1 -1
- package/lib/commands/package.command.d.ts +1 -1
- package/lib/commands/widget-sourcemaps.command.d.ts +4 -0
- package/lib/content/factory/ctp-manager.factory.d.ts +1 -1
- package/lib/content/factory/package-manager.factory.d.ts +4 -2
- 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 +7 -2
- 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 +15 -6
- 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/interfaces/profile.interface.d.ts +5 -0
- package/lib/services/http-client.service.d.ts +1 -1
- package/lib/validators/profile.validator.d.ts +1 -1
- package/package.json +6 -4
- package/services/content.service.js +2 -1
- package/services/http-client.service.js +10 -7
- package/services/profile.service.js +12 -6
- package/services/question.service.js +3 -2
- package/validators/profile.validator.js +17 -7
|
@@ -0,0 +1,69 @@
|
|
|
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 ${this.distPath}/${distPathPostfix}`,
|
|
42
|
+
`--service=${this.service}`,
|
|
43
|
+
`--release-version=${this.releaseVersion}`,
|
|
44
|
+
`--minified-path-prefix=/package-manager/${sourcemapsPath}`,
|
|
45
|
+
];
|
|
46
|
+
child_process_1.exec(commandLines.join(" "), (error, stdout) => {
|
|
47
|
+
if (error) {
|
|
48
|
+
logger_1.logger.error(new logger_1.GracefulError(error.message));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
logger_1.logger.info(new logger_1.GracefulError(stdout));
|
|
52
|
+
}
|
|
53
|
+
return resolve(error || stdout);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getConfig() {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
getBody() {
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
getSerializedFileContent(data) {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.WidgetSourcemapsManager = WidgetSourcemapsManager;
|
|
69
|
+
});
|
|
@@ -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
|
};
|
|
@@ -95,8 +96,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
95
96
|
.requiredOption("--key <key>", "Key of the package you want to pull")
|
|
96
97
|
.option("--store", "Pull package with store deployment metadata")
|
|
97
98
|
.option("--newKey <newKey>", "Define a new key for your package")
|
|
99
|
+
.option("--draft", "Pull draft version of package")
|
|
98
100
|
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
yield new package_command_1.PackageCommand().pullPackage(cmd.profile, cmd.key, !!cmd.store, cmd.newKey);
|
|
101
|
+
yield new package_command_1.PackageCommand().pullPackage(cmd.profile, cmd.key, !!cmd.store, cmd.newKey, !!cmd.draft);
|
|
100
102
|
process.exit();
|
|
101
103
|
}));
|
|
102
104
|
return program;
|
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"], 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,7 @@ 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");
|
|
28
32
|
class Push {
|
|
29
33
|
static analysis(program) {
|
|
30
34
|
program
|
|
@@ -48,10 +52,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
48
52
|
.option("-d, --pushDataModels", "Specify this option if you want to push data models from the CTP file")
|
|
49
53
|
.option("--globalPoolName <globalPoolName>", "Specify this option if you want to push all Data models into one newly created pool along with value to set the name of the pool to be created", null)
|
|
50
54
|
.option("--existingPoolId <existingPoolId>", "Specify this option if you want to push all Data models into one already existing pool with provided ID", null)
|
|
55
|
+
.option("-s, --spaceKey <spaceKey>", "The key of the destination space where the analyses from .ctp file will be created.", "")
|
|
51
56
|
.requiredOption("-f, --file <file>", "The .ctp file you want to push")
|
|
52
57
|
.requiredOption("--password <password>", "The password used for extracting the .ctp file")
|
|
53
58
|
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
yield new ctp_command_1.CTPCommand().pushCTPFile(cmd.profile, cmd.file, cmd.password, cmd.pushAnalysis, cmd.pushDataModels, cmd.existingPoolId, cmd.globalPoolName);
|
|
59
|
+
yield new ctp_command_1.CTPCommand().pushCTPFile(cmd.profile, cmd.file, cmd.password, cmd.pushAnalysis, cmd.pushDataModels, cmd.existingPoolId, cmd.globalPoolName, cmd.spaceKey);
|
|
55
60
|
process.exit();
|
|
56
61
|
}));
|
|
57
62
|
return program;
|
|
@@ -79,6 +84,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
79
84
|
.option("--packageManager", "Upload widget to package manager (deprecated)") // Deprecated
|
|
80
85
|
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
81
86
|
yield new widget_command_1.WidgetCommand().pushWidget(cmd.profile, !!cmd.tenantIndependent, !!cmd.userSpecific);
|
|
87
|
+
const zipFileName = path.resolve(process.cwd(), "output.zip");
|
|
88
|
+
fs.unlinkSync(zipFileName);
|
|
89
|
+
process.exit();
|
|
90
|
+
}));
|
|
91
|
+
return program;
|
|
92
|
+
}
|
|
93
|
+
static widgetSourcemaps(program) {
|
|
94
|
+
program
|
|
95
|
+
.command("widget-sourcemaps")
|
|
96
|
+
.description("Command to upload sourcemaps to Datadog RUM")
|
|
97
|
+
.action(() => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
yield new widget_sourcemaps_command_1.WidgetSourcemapsCommand().pushSourceMaps();
|
|
82
99
|
process.exit();
|
|
83
100
|
}));
|
|
84
101
|
return program;
|
|
@@ -169,6 +186,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
169
186
|
Push.assets(commander);
|
|
170
187
|
Push.package(commander);
|
|
171
188
|
Push.packages(commander);
|
|
189
|
+
Push.widgetSourcemaps(commander);
|
|
172
190
|
commander.parse(process.argv);
|
|
173
191
|
if (!process.argv.slice(2).length) {
|
|
174
192
|
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,6 +1,6 @@
|
|
|
1
1
|
export declare class CTPCommand {
|
|
2
2
|
private contentService;
|
|
3
3
|
private ctpManagerFactory;
|
|
4
|
-
pushCTPFile(profile: string, filename: string, password: string, pushAnalysis: boolean, pushDataModels: boolean, existingPoolId: string, globalPoolName: string): Promise<void>;
|
|
4
|
+
pushCTPFile(profile: string, filename: string, password: string, pushAnalysis: boolean, pushDataModels: boolean, existingPoolId: string, globalPoolName: string, spaceKey: string): Promise<void>;
|
|
5
5
|
private validateParamsForDataModelPush;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare class PackageCommand {
|
|
2
2
|
private contentService;
|
|
3
3
|
private packageManagerFactory;
|
|
4
|
-
pullPackage(profile: string, key: string, store: boolean, newKey: string): Promise<void>;
|
|
4
|
+
pullPackage(profile: string, key: string, store: boolean, newKey: string, draft: boolean): Promise<void>;
|
|
5
5
|
pushPackage(profile: string, spaceKey: string, fileName: string, newKey: string, overwrite: boolean): Promise<void>;
|
|
6
6
|
pushPackages(profile: string, spaceKey: string): Promise<void>;
|
|
7
7
|
listPackages(profile: string): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CtpManager } from "../manager/ctp.manager";
|
|
2
2
|
export declare class CTPManagerFactory {
|
|
3
|
-
createCtpAnalysisManager(filename: string, password: string): CtpManager;
|
|
3
|
+
createCtpAnalysisManager(filename: string, password: string, spaceKey: string): CtpManager;
|
|
4
4
|
createCtpDataModelManager(filename: string, password: string, existingPoolId: string, globalPoolName: string): CtpManager;
|
|
5
5
|
private initManager;
|
|
6
6
|
private readFile;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { PackageManager } from "../manager/package.manager";
|
|
2
2
|
export declare class PackageManagerFactory {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
createPullManager(key: string, store?: boolean, newKey?: string, draft?: boolean): PackageManager;
|
|
4
|
+
createPushManager(spaceKey: string, fileName: string, newKey?: string, overwrite?: boolean): PackageManager;
|
|
5
|
+
createPushManagers(spaceKey: string): PackageManager[];
|
|
6
|
+
createManager(key?: string, spaceKey?: string, fileName?: string, store?: boolean, newKey?: string, overwrite?: boolean, draft?: boolean): PackageManager;
|
|
5
7
|
private isPackageFilePath;
|
|
6
8
|
private resolvePackageFilePath;
|
|
7
9
|
}
|
|
@@ -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>;
|
|
@@ -3,8 +3,13 @@ import { ManagerConfig } from "../../interfaces/manager-config.interface";
|
|
|
3
3
|
export declare abstract class CtpManager extends BaseManager {
|
|
4
4
|
protected _content: any;
|
|
5
5
|
protected _password: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
protected _spaceKey?: string;
|
|
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);
|
|
8
13
|
getConfig(): ManagerConfig;
|
|
9
14
|
protected getSerializedFileContent(data: any): string;
|
|
10
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;
|
|
@@ -12,12 +12,21 @@ export declare class PackageManager extends BaseManager {
|
|
|
12
12
|
private _store;
|
|
13
13
|
private _newKey;
|
|
14
14
|
private _overwrite;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
private _draft;
|
|
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);
|
|
21
30
|
getConfig(): ManagerConfig;
|
|
22
31
|
getBody(): any;
|
|
23
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;
|
|
@@ -2,4 +2,9 @@ export interface Profile {
|
|
|
2
2
|
name: string;
|
|
3
3
|
team: string;
|
|
4
4
|
apiToken: string;
|
|
5
|
+
authenticationType: AuthenticationType;
|
|
5
6
|
}
|
|
7
|
+
export declare type AuthenticationType = "Bearer" | "AppKey";
|
|
8
|
+
export declare const AuthenticationType: {
|
|
9
|
+
[key: string]: AuthenticationType;
|
|
10
|
+
};
|
|
@@ -7,7 +7,7 @@ export declare class HttpClientService {
|
|
|
7
7
|
findAll(url: string, profile: Profile): Promise<any>;
|
|
8
8
|
private makeOptions;
|
|
9
9
|
private makeFileDownloadOptions;
|
|
10
|
-
private
|
|
10
|
+
private buildAuthorizationHeaders;
|
|
11
11
|
private handleResponseStreamData;
|
|
12
12
|
private handleResponse;
|
|
13
13
|
private checkBadRequest;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celonis/content-cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "CLI Tool to help manage content in Celonis EMS",
|
|
5
5
|
"main": "content-cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"homepage": "https://github.com/celonis/content-cli",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "./node_modules/.bin/tsc",
|
|
13
|
+
"build": "./node_modules/.bin/tsc && cp package.json dist/package.json",
|
|
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
|
};
|
|
@@ -12,11 +13,12 @@ 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", "../util/logger", "request"], factory);
|
|
16
|
+
define(["require", "exports", "../interfaces/profile.interface", "../util/logger", "request"], factory);
|
|
16
17
|
}
|
|
17
18
|
})(function (require, exports) {
|
|
18
19
|
"use strict";
|
|
19
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const profile_interface_1 = require("../interfaces/profile.interface");
|
|
20
22
|
const logger_1 = require("../util/logger");
|
|
21
23
|
const request = require("request");
|
|
22
24
|
class HttpClientService {
|
|
@@ -73,7 +75,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
73
75
|
findAll(url, profile) {
|
|
74
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
77
|
return new Promise((resolve, reject) => {
|
|
76
|
-
request.get(url, this.makeOptions(profile), (err, res) => {
|
|
78
|
+
request.get(url, this.makeOptions(profile, null), (err, res) => {
|
|
77
79
|
this.handleResponse(res, resolve, reject);
|
|
78
80
|
});
|
|
79
81
|
});
|
|
@@ -81,19 +83,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
81
83
|
}
|
|
82
84
|
makeOptions(profile, body = {}) {
|
|
83
85
|
const options = {
|
|
84
|
-
headers: this.
|
|
86
|
+
headers: this.buildAuthorizationHeaders(profile),
|
|
85
87
|
};
|
|
86
88
|
return Object.assign(options, body);
|
|
87
89
|
}
|
|
88
90
|
makeFileDownloadOptions(profile) {
|
|
89
91
|
return {
|
|
90
|
-
headers: this.
|
|
92
|
+
headers: this.buildAuthorizationHeaders(profile),
|
|
91
93
|
responseType: "binary",
|
|
92
94
|
};
|
|
93
95
|
}
|
|
94
|
-
|
|
96
|
+
buildAuthorizationHeaders(profile) {
|
|
97
|
+
const authenticationType = profile.authenticationType || profile_interface_1.AuthenticationType.BEARER;
|
|
95
98
|
return {
|
|
96
|
-
authorization:
|
|
99
|
+
authorization: `${authenticationType} ${profile.apiToken}`,
|
|
97
100
|
"content-type": "application/json",
|
|
98
101
|
};
|
|
99
102
|
}
|