@celonis/content-cli 0.11.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content-cli-analyze.js +5 -5
- package/content-cli-config.js +9 -9
- package/content-cli-export.js +7 -7
- package/content-cli-get.js +5 -5
- package/content-cli-import.js +7 -7
- package/content-cli-list.js +10 -10
- package/content-cli-profile.js +7 -7
- package/content-cli-pull.js +9 -24
- package/content-cli-push.js +14 -29
- package/content-cli-set.js +5 -5
- package/content-cli-update.js +5 -5
- package/content-cli.js +16 -16
- package/lib/content-cli-config.d.ts +6 -8
- package/lib/content-cli-export.d.ts +4 -4
- package/lib/content-cli-import.d.ts +4 -4
- package/lib/content-cli-list.d.ts +7 -9
- package/lib/services/command.service.d.ts +6 -0
- package/lib/util/program.d.ts +2 -0
- package/package.json +23 -20
- package/services/command.service.js +24 -0
- package/services/profile.service.js +2 -0
- package/util/context-initializer.js +3 -3
- package/util/program.js +16 -0
- package/commands/analysis.command.js +0 -41
- package/content/factory/analysis-manager.factory.js +0 -36
- package/content/manager/analysis.manager.js +0 -72
- package/lib/commands/analysis.command.d.ts +0 -6
- package/lib/content/factory/analysis-manager.factory.d.ts +0 -5
- package/lib/content/manager/analysis.manager.d.ts +0 -22
package/content-cli-analyze.js
CHANGED
|
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./util/context-initializer", "./util/logger", "./commands/action-flow.command", "
|
|
16
|
+
define(["require", "exports", "./util/context-initializer", "./util/logger", "./commands/action-flow.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
const context_initializer_1 = require("./util/context-initializer");
|
|
22
22
|
const logger_1 = require("./util/logger");
|
|
23
23
|
const action_flow_command_1 = require("./commands/action-flow.command");
|
|
24
|
-
const
|
|
24
|
+
const program_1 = require("./util/program");
|
|
25
25
|
class Analyze {
|
|
26
26
|
static actionFlows(program) {
|
|
27
27
|
program
|
|
@@ -46,11 +46,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
46
46
|
logger_1.logger.error(e);
|
|
47
47
|
});
|
|
48
48
|
if (!process.argv.slice(2).length) {
|
|
49
|
-
|
|
49
|
+
program_1.program.outputHelp();
|
|
50
50
|
process.exit(1);
|
|
51
51
|
}
|
|
52
52
|
function getAllCommands() {
|
|
53
|
-
Analyze.actionFlows(
|
|
54
|
-
|
|
53
|
+
Analyze.actionFlows(program_1.program);
|
|
54
|
+
program_1.program.parse(process.argv);
|
|
55
55
|
}
|
|
56
56
|
});
|
package/content-cli-config.js
CHANGED
|
@@ -13,14 +13,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/config.command", "
|
|
16
|
+
define(["require", "exports", "./commands/config.command", "./util/program", "./util/logger", "./util/context-initializer"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.Config = void 0;
|
|
22
22
|
const config_command_1 = require("./commands/config.command");
|
|
23
|
-
const
|
|
23
|
+
const program_1 = require("./util/program");
|
|
24
24
|
const logger_1 = require("./util/logger");
|
|
25
25
|
const context_initializer_1 = require("./util/context-initializer");
|
|
26
26
|
class Config {
|
|
@@ -98,12 +98,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
98
98
|
}
|
|
99
99
|
exports.Config = Config;
|
|
100
100
|
const loadAllCommands = () => {
|
|
101
|
-
Config.list(
|
|
102
|
-
Config.listVariables(
|
|
103
|
-
Config.export(
|
|
104
|
-
Config.import(
|
|
105
|
-
Config.diff(
|
|
106
|
-
|
|
101
|
+
Config.list(program_1.program);
|
|
102
|
+
Config.listVariables(program_1.program);
|
|
103
|
+
Config.export(program_1.program);
|
|
104
|
+
Config.import(program_1.program);
|
|
105
|
+
Config.diff(program_1.program);
|
|
106
|
+
program_1.program.parse(process.argv);
|
|
107
107
|
};
|
|
108
108
|
context_initializer_1.ContextInitializer.initContext()
|
|
109
109
|
.then(loadAllCommands, loadAllCommands)
|
|
@@ -111,7 +111,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
111
111
|
logger_1.logger.error(e);
|
|
112
112
|
});
|
|
113
113
|
if (!process.argv.slice(2).length) {
|
|
114
|
-
|
|
114
|
+
program_1.program.outputHelp();
|
|
115
115
|
process.exit(1);
|
|
116
116
|
}
|
|
117
117
|
});
|
package/content-cli-export.js
CHANGED
|
@@ -13,18 +13,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "
|
|
16
|
+
define(["require", "exports", "./commands/package.command", "./util/logger", "./commands/data-pool.command", "./util/context-initializer", "./commands/action-flow.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.Export = void 0;
|
|
22
|
-
const commander = require("commander");
|
|
23
22
|
const package_command_1 = require("./commands/package.command");
|
|
24
23
|
const logger_1 = require("./util/logger");
|
|
25
24
|
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
26
25
|
const context_initializer_1 = require("./util/context-initializer");
|
|
27
26
|
const action_flow_command_1 = require("./commands/action-flow.command");
|
|
27
|
+
const program_1 = require("./util/program");
|
|
28
28
|
class Export {
|
|
29
29
|
static packages(program) {
|
|
30
30
|
program
|
|
@@ -78,13 +78,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
78
78
|
logger_1.logger.error(e);
|
|
79
79
|
});
|
|
80
80
|
if (!process.argv.slice(2).length) {
|
|
81
|
-
|
|
81
|
+
program_1.program.outputHelp();
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
function getAllCommands() {
|
|
85
|
-
Export.packages(
|
|
86
|
-
Export.dataPool(
|
|
87
|
-
Export.actionFlows(
|
|
88
|
-
|
|
85
|
+
Export.packages(program_1.program);
|
|
86
|
+
Export.dataPool(program_1.program);
|
|
87
|
+
Export.actionFlows(program_1.program);
|
|
88
|
+
program_1.program.parse(process.argv);
|
|
89
89
|
}
|
|
90
90
|
});
|
package/content-cli-get.js
CHANGED
|
@@ -13,15 +13,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/connection.command", "
|
|
16
|
+
define(["require", "exports", "./commands/connection.command", "./util/context-initializer", "./util/logger", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const connection_command_1 = require("./commands/connection.command");
|
|
22
|
-
const commander = require("commander");
|
|
23
22
|
const context_initializer_1 = require("./util/context-initializer");
|
|
24
23
|
const logger_1 = require("./util/logger");
|
|
24
|
+
const program_1 = require("./util/program");
|
|
25
25
|
class Get {
|
|
26
26
|
static connection(program) {
|
|
27
27
|
program
|
|
@@ -39,14 +39,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39
39
|
}
|
|
40
40
|
context_initializer_1.ContextInitializer.initContext()
|
|
41
41
|
.then(() => {
|
|
42
|
-
Get.connection(
|
|
43
|
-
|
|
42
|
+
Get.connection(program_1.program);
|
|
43
|
+
program_1.program.parse(process.argv);
|
|
44
44
|
})
|
|
45
45
|
.catch(e => {
|
|
46
46
|
logger_1.logger.error(e);
|
|
47
47
|
});
|
|
48
48
|
if (!process.argv.slice(2).length) {
|
|
49
|
-
|
|
49
|
+
program_1.program.outputHelp();
|
|
50
50
|
process.exit(1);
|
|
51
51
|
}
|
|
52
52
|
});
|
package/content-cli-import.js
CHANGED
|
@@ -13,18 +13,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "
|
|
16
|
+
define(["require", "exports", "./commands/package.command", "./commands/data-pool.command", "./util/context-initializer", "./util/logger", "./commands/action-flow.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.Import = void 0;
|
|
22
|
-
const commander = require("commander");
|
|
23
22
|
const package_command_1 = require("./commands/package.command");
|
|
24
23
|
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
25
24
|
const context_initializer_1 = require("./util/context-initializer");
|
|
26
25
|
const logger_1 = require("./util/logger");
|
|
27
26
|
const action_flow_command_1 = require("./commands/action-flow.command");
|
|
27
|
+
const program_1 = require("./util/program");
|
|
28
28
|
class Import {
|
|
29
29
|
static packages(program) {
|
|
30
30
|
program
|
|
@@ -81,13 +81,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
81
81
|
logger_1.logger.error(e);
|
|
82
82
|
});
|
|
83
83
|
if (!process.argv.slice(2).length) {
|
|
84
|
-
|
|
84
|
+
program_1.program.outputHelp();
|
|
85
85
|
process.exit(1);
|
|
86
86
|
}
|
|
87
87
|
function getAllCommands() {
|
|
88
|
-
Import.packages(
|
|
89
|
-
Import.dataPools(
|
|
90
|
-
Import.actionFlows(
|
|
91
|
-
|
|
88
|
+
Import.packages(program_1.program);
|
|
89
|
+
Import.dataPools(program_1.program);
|
|
90
|
+
Import.actionFlows(program_1.program);
|
|
91
|
+
program_1.program.parse(process.argv);
|
|
92
92
|
}
|
|
93
93
|
});
|
package/content-cli-list.js
CHANGED
|
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/package.command", "./commands/space.command", "./commands/data-pool.command", "./commands/asset.command", "./util/logger", "
|
|
16
|
+
define(["require", "exports", "./commands/package.command", "./commands/space.command", "./commands/data-pool.command", "./commands/asset.command", "./util/logger", "./util/context-initializer", "./commands/connection.command", "./commands/variable.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -24,10 +24,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
25
25
|
const asset_command_1 = require("./commands/asset.command");
|
|
26
26
|
const logger_1 = require("./util/logger");
|
|
27
|
-
const commander = require("commander");
|
|
28
27
|
const context_initializer_1 = require("./util/context-initializer");
|
|
29
28
|
const connection_command_1 = require("./commands/connection.command");
|
|
30
29
|
const variable_command_1 = require("./commands/variable.command");
|
|
30
|
+
const program_1 = require("./util/program");
|
|
31
31
|
class List {
|
|
32
32
|
static packages(program) {
|
|
33
33
|
program
|
|
@@ -109,13 +109,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
109
109
|
}
|
|
110
110
|
exports.List = List;
|
|
111
111
|
const loadAllCommands = () => {
|
|
112
|
-
List.packages(
|
|
113
|
-
List.spaces(
|
|
114
|
-
List.dataPools(
|
|
115
|
-
List.assets(
|
|
116
|
-
List.connections(
|
|
117
|
-
List.assignments(
|
|
118
|
-
|
|
112
|
+
List.packages(program_1.program);
|
|
113
|
+
List.spaces(program_1.program);
|
|
114
|
+
List.dataPools(program_1.program);
|
|
115
|
+
List.assets(program_1.program);
|
|
116
|
+
List.connections(program_1.program);
|
|
117
|
+
List.assignments(program_1.program);
|
|
118
|
+
program_1.program.parse(process.argv);
|
|
119
119
|
};
|
|
120
120
|
context_initializer_1.ContextInitializer.initContext()
|
|
121
121
|
.then(loadAllCommands, loadAllCommands)
|
|
@@ -123,7 +123,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
123
123
|
logger_1.logger.error(e);
|
|
124
124
|
});
|
|
125
125
|
if (!process.argv.slice(2).length) {
|
|
126
|
-
|
|
126
|
+
program_1.program.outputHelp();
|
|
127
127
|
process.exit(1);
|
|
128
128
|
}
|
|
129
129
|
});
|
package/content-cli-profile.js
CHANGED
|
@@ -13,13 +13,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/profile.command", "
|
|
16
|
+
define(["require", "exports", "./commands/profile.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const profile_command_1 = require("./commands/profile.command");
|
|
22
|
-
const
|
|
22
|
+
const program_1 = require("./util/program");
|
|
23
23
|
class Profile {
|
|
24
24
|
static listProfile(program) {
|
|
25
25
|
program
|
|
@@ -53,12 +53,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
53
53
|
return program;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
Profile.listProfile(
|
|
57
|
-
Profile.createProfile(
|
|
58
|
-
Profile.defaultProfile(
|
|
59
|
-
|
|
56
|
+
Profile.listProfile(program_1.program);
|
|
57
|
+
Profile.createProfile(program_1.program);
|
|
58
|
+
Profile.defaultProfile(program_1.program);
|
|
59
|
+
program_1.program.parse(process.argv);
|
|
60
60
|
if (!process.argv.slice(2).length) {
|
|
61
|
-
|
|
61
|
+
program_1.program.outputHelp();
|
|
62
62
|
process.exit(1);
|
|
63
63
|
}
|
|
64
64
|
});
|
package/content-cli-pull.js
CHANGED
|
@@ -13,32 +13,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/
|
|
16
|
+
define(["require", "exports", "./commands/skill.command", "./commands/data-pool.command", "./commands/asset.command", "./commands/package.command", "./commands/analysis-bookmarks.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const analysis_command_1 = require("./commands/analysis.command");
|
|
22
21
|
const skill_command_1 = require("./commands/skill.command");
|
|
23
22
|
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
24
23
|
const asset_command_1 = require("./commands/asset.command");
|
|
25
24
|
const package_command_1 = require("./commands/package.command");
|
|
26
25
|
const analysis_bookmarks_command_1 = require("./commands/analysis-bookmarks.command");
|
|
27
|
-
const
|
|
26
|
+
const program_1 = require("./util/program");
|
|
28
27
|
class Pull {
|
|
29
|
-
static analysis(program) {
|
|
30
|
-
program
|
|
31
|
-
.command("analysis")
|
|
32
|
-
.description("Command to pull an analysis")
|
|
33
|
-
.option("-p, --profile <profile>", "Profile which you want to use to pull the analysis")
|
|
34
|
-
.requiredOption("--id <id>", "Id of the analysis you want to pull")
|
|
35
|
-
.option("--asset", "Pull workflow as an asset")
|
|
36
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
yield new analysis_command_1.AnalysisCommand().pullAnalysis(cmd.profile, cmd.id, !!cmd.asset);
|
|
38
|
-
process.exit();
|
|
39
|
-
}));
|
|
40
|
-
return program;
|
|
41
|
-
}
|
|
42
28
|
static analysisBookmarks(program) {
|
|
43
29
|
program
|
|
44
30
|
.command("bookmarks")
|
|
@@ -105,15 +91,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
105
91
|
return program;
|
|
106
92
|
}
|
|
107
93
|
}
|
|
108
|
-
Pull.
|
|
109
|
-
Pull.
|
|
110
|
-
Pull.
|
|
111
|
-
Pull.
|
|
112
|
-
Pull.
|
|
113
|
-
|
|
114
|
-
commander.parse(process.argv);
|
|
94
|
+
Pull.analysisBookmarks(program_1.program);
|
|
95
|
+
Pull.skill(program_1.program);
|
|
96
|
+
Pull.dataPool(program_1.program);
|
|
97
|
+
Pull.asset(program_1.program);
|
|
98
|
+
Pull.package(program_1.program);
|
|
99
|
+
program_1.program.parse(process.argv);
|
|
115
100
|
if (!process.argv.slice(2).length) {
|
|
116
|
-
|
|
101
|
+
program_1.program.outputHelp();
|
|
117
102
|
process.exit(1);
|
|
118
103
|
}
|
|
119
104
|
});
|
package/content-cli-push.js
CHANGED
|
@@ -13,15 +13,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "
|
|
16
|
+
define(["require", "exports", "fs", "path", "./commands/skill.command", "./commands/widget.command", "./commands/data-pool.command", "./commands/asset.command", "./commands/package.command", "./commands/ctp.command", "./commands/analysis-bookmarks.command", "child_process", "./util/logger", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const commander = require("commander");
|
|
22
21
|
const fs = require("fs");
|
|
23
22
|
const path = require("path");
|
|
24
|
-
const analysis_command_1 = require("./commands/analysis.command");
|
|
25
23
|
const skill_command_1 = require("./commands/skill.command");
|
|
26
24
|
const widget_command_1 = require("./commands/widget.command");
|
|
27
25
|
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
@@ -31,20 +29,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
29
|
const analysis_bookmarks_command_1 = require("./commands/analysis-bookmarks.command");
|
|
32
30
|
const child_process_1 = require("child_process");
|
|
33
31
|
const logger_1 = require("./util/logger");
|
|
32
|
+
const program_1 = require("./util/program");
|
|
34
33
|
class Push {
|
|
35
|
-
static analysis(program) {
|
|
36
|
-
program
|
|
37
|
-
.command("analysis")
|
|
38
|
-
.description("Command to push an analysis to a workspace")
|
|
39
|
-
.option("-p, --profile <profile>", "Profile which you want to use to push the analysis")
|
|
40
|
-
.requiredOption("--workspaceId <workspaceId>", "Id of the workspace to which you want to push the analysis")
|
|
41
|
-
.requiredOption("-f, --file <file>", "The file you want to push")
|
|
42
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
yield new analysis_command_1.AnalysisCommand().pushAnalysis(cmd.profile, cmd.workspaceId, cmd.file);
|
|
44
|
-
process.exit();
|
|
45
|
-
}));
|
|
46
|
-
return program;
|
|
47
|
-
}
|
|
48
34
|
static analysisBookmarks(program) {
|
|
49
35
|
program
|
|
50
36
|
.command("bookmarks")
|
|
@@ -192,20 +178,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
192
178
|
return program;
|
|
193
179
|
}
|
|
194
180
|
}
|
|
195
|
-
Push.
|
|
196
|
-
Push.
|
|
197
|
-
Push.
|
|
198
|
-
Push.
|
|
199
|
-
Push.
|
|
200
|
-
Push.
|
|
201
|
-
Push.
|
|
202
|
-
Push.
|
|
203
|
-
Push.
|
|
204
|
-
Push.
|
|
205
|
-
|
|
206
|
-
commander.parse(process.argv);
|
|
181
|
+
Push.analysisBookmarks(program_1.program);
|
|
182
|
+
Push.ctp(program_1.program);
|
|
183
|
+
Push.skill(program_1.program);
|
|
184
|
+
Push.widget(program_1.program);
|
|
185
|
+
Push.dataPool(program_1.program);
|
|
186
|
+
Push.dataPools(program_1.program);
|
|
187
|
+
Push.asset(program_1.program);
|
|
188
|
+
Push.assets(program_1.program);
|
|
189
|
+
Push.package(program_1.program);
|
|
190
|
+
Push.packages(program_1.program);
|
|
191
|
+
program_1.program.parse(process.argv);
|
|
207
192
|
if (!process.argv.slice(2).length) {
|
|
208
|
-
|
|
193
|
+
program_1.program.outputHelp();
|
|
209
194
|
process.exit(1);
|
|
210
195
|
}
|
|
211
196
|
});
|
package/content-cli-set.js
CHANGED
|
@@ -13,15 +13,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/connection.command", "
|
|
16
|
+
define(["require", "exports", "./commands/connection.command", "./util/context-initializer", "./util/logger", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const connection_command_1 = require("./commands/connection.command");
|
|
22
|
-
const commander = require("commander");
|
|
23
22
|
const context_initializer_1 = require("./util/context-initializer");
|
|
24
23
|
const logger_1 = require("./util/logger");
|
|
24
|
+
const program_1 = require("./util/program");
|
|
25
25
|
class Set {
|
|
26
26
|
static connection(program) {
|
|
27
27
|
program
|
|
@@ -40,8 +40,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
const loadAllCommands = () => {
|
|
43
|
-
Set.connection(
|
|
44
|
-
|
|
43
|
+
Set.connection(program_1.program);
|
|
44
|
+
program_1.program.parse(process.argv);
|
|
45
45
|
};
|
|
46
46
|
context_initializer_1.ContextInitializer.initContext()
|
|
47
47
|
.then(loadAllCommands, loadAllCommands)
|
|
@@ -49,7 +49,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
49
49
|
logger_1.logger.error(e);
|
|
50
50
|
});
|
|
51
51
|
if (!process.argv.slice(2).length) {
|
|
52
|
-
|
|
52
|
+
program_1.program.outputHelp();
|
|
53
53
|
process.exit(1);
|
|
54
54
|
}
|
|
55
55
|
});
|
package/content-cli-update.js
CHANGED
|
@@ -13,13 +13,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/data-pool.command", "
|
|
16
|
+
define(["require", "exports", "./commands/data-pool.command", "./util/program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
22
|
-
const
|
|
22
|
+
const program_1 = require("./util/program");
|
|
23
23
|
class Update {
|
|
24
24
|
static dataPool(program) {
|
|
25
25
|
program
|
|
@@ -35,10 +35,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
35
35
|
return program;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
Update.dataPool(
|
|
39
|
-
|
|
38
|
+
Update.dataPool(program_1.program);
|
|
39
|
+
program_1.program.parse(process.argv);
|
|
40
40
|
if (!process.argv.slice(2).length) {
|
|
41
|
-
|
|
41
|
+
program_1.program.outputHelp();
|
|
42
42
|
process.exit(1);
|
|
43
43
|
}
|
|
44
44
|
});
|
package/content-cli.js
CHANGED
|
@@ -5,35 +5,35 @@
|
|
|
5
5
|
if (v !== undefined) module.exports = v;
|
|
6
6
|
}
|
|
7
7
|
else if (typeof define === "function" && define.amd) {
|
|
8
|
-
define(["require", "exports", "./util/logger", "semver/functions/satisfies", "
|
|
8
|
+
define(["require", "exports", "./util/logger", "semver/functions/satisfies", "./util/program", "./util/version"], factory);
|
|
9
9
|
}
|
|
10
10
|
})(function (require, exports) {
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
const logger_1 = require("./util/logger");
|
|
14
14
|
const semverSatisfies = require("semver/functions/satisfies");
|
|
15
|
-
const
|
|
15
|
+
const program_1 = require("./util/program");
|
|
16
16
|
const version_1 = require("./util/version");
|
|
17
17
|
const requiredVersion = ">=10.10.0";
|
|
18
18
|
if (!semverSatisfies(process.version, requiredVersion)) {
|
|
19
19
|
logger_1.logger.error(`Node version ${process.version} not supported. Please upgrade your node version to ${requiredVersion}`);
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
|
-
program.command("profile", "Commands related to profiles.");
|
|
23
|
-
program.command("pull", "Commands to pull content.");
|
|
24
|
-
program.command("export", "Commands to export content.");
|
|
25
|
-
program.command("import", "Commands to import content.");
|
|
26
|
-
program.command("push", "Commands to push content.");
|
|
27
|
-
program.command("update", "Commands to update content.");
|
|
28
|
-
program.command("list", "Commands to list content.").alias("ls");
|
|
29
|
-
program.command("get", "Commands to get configuration properties.");
|
|
30
|
-
program.command("set", "Commands to set configuration properties.");
|
|
31
|
-
program.command("config", "Commands related to config management.");
|
|
32
|
-
program.command("analyze", "Commands to analyze assets dependencies.");
|
|
33
|
-
program.version(version_1.VersionUtils.getCurrentCliVersion());
|
|
34
|
-
program.parse(process.argv);
|
|
22
|
+
program_1.program.command("profile", "Commands related to profiles.");
|
|
23
|
+
program_1.program.command("pull", "Commands to pull content.");
|
|
24
|
+
program_1.program.command("export", "Commands to export content.");
|
|
25
|
+
program_1.program.command("import", "Commands to import content.");
|
|
26
|
+
program_1.program.command("push", "Commands to push content.");
|
|
27
|
+
program_1.program.command("update", "Commands to update content.");
|
|
28
|
+
program_1.program.command("list", "Commands to list content.").alias("ls");
|
|
29
|
+
program_1.program.command("get", "Commands to get configuration properties.");
|
|
30
|
+
program_1.program.command("set", "Commands to set configuration properties.");
|
|
31
|
+
program_1.program.command("config", "Commands related to config management.");
|
|
32
|
+
program_1.program.command("analyze", "Commands to analyze assets dependencies.");
|
|
33
|
+
program_1.program.version(version_1.VersionUtils.getCurrentCliVersion());
|
|
34
|
+
program_1.program.parse(process.argv);
|
|
35
35
|
if (!process.argv.slice(2).length) {
|
|
36
|
-
program.outputHelp();
|
|
36
|
+
program_1.program.outputHelp();
|
|
37
37
|
process.exit(1);
|
|
38
38
|
}
|
|
39
39
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
type CommanderStatic = commander.CommanderStatic;
|
|
1
|
+
import { Command } from "commander";
|
|
3
2
|
export declare class Config {
|
|
4
|
-
static list(program:
|
|
5
|
-
static listVariables(program:
|
|
6
|
-
static export(program:
|
|
7
|
-
static import(program:
|
|
8
|
-
static diff(program:
|
|
3
|
+
static list(program: Command): Command;
|
|
4
|
+
static listVariables(program: Command): Command;
|
|
5
|
+
static export(program: Command): Command;
|
|
6
|
+
static import(program: Command): Command;
|
|
7
|
+
static diff(program: Command): Command;
|
|
9
8
|
}
|
|
10
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from "commander";
|
|
2
2
|
export declare class Export {
|
|
3
|
-
static packages(program:
|
|
4
|
-
static dataPool(program:
|
|
5
|
-
static actionFlows(program:
|
|
3
|
+
static packages(program: Command): Command;
|
|
4
|
+
static dataPool(program: Command): Command;
|
|
5
|
+
static actionFlows(program: Command): Command;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from "commander";
|
|
2
2
|
export declare class Import {
|
|
3
|
-
static packages(program:
|
|
4
|
-
static dataPools(program:
|
|
5
|
-
static actionFlows(program:
|
|
3
|
+
static packages(program: Command): Command;
|
|
4
|
+
static dataPools(program: Command): Command;
|
|
5
|
+
static actionFlows(program: Command): Command;
|
|
6
6
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
type CommanderStatic = commander.CommanderStatic;
|
|
1
|
+
import { Command } from "commander";
|
|
3
2
|
export declare class List {
|
|
4
|
-
static packages(program:
|
|
5
|
-
static spaces(program:
|
|
6
|
-
static dataPools(program:
|
|
7
|
-
static connections(program:
|
|
8
|
-
static assets(program:
|
|
9
|
-
static assignments(program:
|
|
3
|
+
static packages(program: Command): Command;
|
|
4
|
+
static spaces(program: Command): Command;
|
|
5
|
+
static dataPools(program: Command): Command;
|
|
6
|
+
static connections(program: Command): Command;
|
|
7
|
+
static assets(program: Command): Command;
|
|
8
|
+
static assignments(program: Command): Command;
|
|
10
9
|
}
|
|
11
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celonis/content-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "CLI Tool to help manage content in Celonis EMS",
|
|
5
5
|
"main": "content-cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,31 +14,34 @@
|
|
|
14
14
|
"lint": "tslint -p .",
|
|
15
15
|
"test": "jest"
|
|
16
16
|
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.20.5"
|
|
19
|
+
},
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@datadog/datadog-ci": "
|
|
19
|
-
"adm-zip": "
|
|
20
|
-
"axios": "1.
|
|
21
|
-
"commander": "
|
|
22
|
-
"form-data": "4.0.
|
|
23
|
-
"openid-client": "
|
|
24
|
-
"hpagent": "
|
|
25
|
-
"semver": "
|
|
26
|
-
"valid-url": "
|
|
27
|
-
"winston": "
|
|
28
|
-
"yaml": "2.
|
|
21
|
+
"@datadog/datadog-ci": "2.48.0",
|
|
22
|
+
"adm-zip": "0.5.16",
|
|
23
|
+
"axios": "1.7.9",
|
|
24
|
+
"commander": "13.1.0",
|
|
25
|
+
"form-data": "4.0.1",
|
|
26
|
+
"openid-client": "5.6.1",
|
|
27
|
+
"hpagent": "1.2.0",
|
|
28
|
+
"semver": "7.6.3",
|
|
29
|
+
"valid-url": "1.0.9",
|
|
30
|
+
"winston": "3.17.0",
|
|
31
|
+
"yaml": "2.7.0"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@types/adm-zip": "
|
|
32
|
-
"@types/jest": "29.5.
|
|
34
|
+
"@types/adm-zip": "0.5.7",
|
|
35
|
+
"@types/jest": "29.5.14",
|
|
33
36
|
"@types/node": "20.10.4",
|
|
34
37
|
"jest": "29.7.0",
|
|
35
|
-
"lint-staged": "
|
|
36
|
-
"prettier": "
|
|
37
|
-
"ts-jest": "29.
|
|
38
|
+
"lint-staged": "15.4.1",
|
|
39
|
+
"prettier": "3.4.2",
|
|
40
|
+
"ts-jest": "29.2.5",
|
|
38
41
|
"ts-node": "10.9.2",
|
|
39
|
-
"tslint": "
|
|
40
|
-
"tslint-config-prettier": "
|
|
41
|
-
"tslint-consistent-codestyle": "
|
|
42
|
+
"tslint": "5.20.1",
|
|
43
|
+
"tslint-config-prettier": "1.18.0",
|
|
44
|
+
"tslint-consistent-codestyle": "1.16.0",
|
|
42
45
|
"typescript": "5.3.3"
|
|
43
46
|
},
|
|
44
47
|
"lint-staged": {
|
|
@@ -0,0 +1,24 @@
|
|
|
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", "commander"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CommandService = void 0;
|
|
13
|
+
const commander_1 = require("commander");
|
|
14
|
+
class CommandService {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.command = new commander_1.Command();
|
|
17
|
+
this.command.parseOptions(process.argv);
|
|
18
|
+
}
|
|
19
|
+
get program() {
|
|
20
|
+
return this.command;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.CommandService = CommandService;
|
|
24
|
+
});
|
|
@@ -153,6 +153,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
153
153
|
}
|
|
154
154
|
catch (err) {
|
|
155
155
|
logger_1.logger.error(new logger_1.FatalError("The provided team or api key is wrong."));
|
|
156
|
+
logger_1.logger.error(err);
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
break;
|
|
@@ -174,6 +175,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
174
175
|
}
|
|
175
176
|
catch (err) {
|
|
176
177
|
logger_1.logger.error(new logger_1.FatalError("The provided team is wrong."));
|
|
178
|
+
logger_1.logger.error(err);
|
|
177
179
|
}
|
|
178
180
|
break;
|
|
179
181
|
case profile_interface_1.ProfileType.CLIENT_CREDENTIALS:
|
|
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
if (v !== undefined) module.exports = v;
|
|
14
14
|
}
|
|
15
15
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./logger", "../services/context.service", "
|
|
16
|
+
define(["require", "exports", "./logger", "../services/context.service", "./program"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
@@ -21,11 +21,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
exports.ContextInitializer = void 0;
|
|
22
22
|
const logger_1 = require("./logger");
|
|
23
23
|
const context_service_1 = require("../services/context.service");
|
|
24
|
-
const
|
|
24
|
+
const program_1 = require("./program");
|
|
25
25
|
class ContextInitializer {
|
|
26
26
|
static initContext() {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const options =
|
|
28
|
+
const options = program_1.program.parseOptions(process.argv);
|
|
29
29
|
const pOptionIndex = options.unknown.indexOf("-p");
|
|
30
30
|
const indexOfProfileOption = pOptionIndex !== -1 ? pOptionIndex : options.unknown.indexOf("--profile");
|
|
31
31
|
process.on("unhandledRejection", (e, promise) => {
|
package/util/program.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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", "../services/command.service"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.program = void 0;
|
|
13
|
+
const command_service_1 = require("../services/command.service");
|
|
14
|
+
const commandService = new command_service_1.CommandService();
|
|
15
|
+
exports.program = commandService.program;
|
|
16
|
+
});
|
|
@@ -1,41 +0,0 @@
|
|
|
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", "../services/content.service", "../content/factory/analysis-manager.factory"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.AnalysisCommand = void 0;
|
|
22
|
-
const content_service_1 = require("../services/content.service");
|
|
23
|
-
const analysis_manager_factory_1 = require("../content/factory/analysis-manager.factory");
|
|
24
|
-
class AnalysisCommand {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.contentService = new content_service_1.ContentService();
|
|
27
|
-
this.analysisManagerFactory = new analysis_manager_factory_1.AnalysisManagerFactory();
|
|
28
|
-
}
|
|
29
|
-
pullAnalysis(profile, id, packageManager) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
yield this.contentService.pull(profile, this.analysisManagerFactory.createManager(id, null, null, packageManager));
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
pushAnalysis(profile, workspaceId, filename) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
yield this.contentService.push(profile, this.analysisManagerFactory.createManager(null, workspaceId, filename));
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.AnalysisCommand = AnalysisCommand;
|
|
41
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
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", "fs", "path", "../../util/logger", "../manager/analysis.manager"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AnalysisManagerFactory = void 0;
|
|
13
|
-
const fs = require("fs");
|
|
14
|
-
const path = require("path");
|
|
15
|
-
const logger_1 = require("../../util/logger");
|
|
16
|
-
const analysis_manager_1 = require("../manager/analysis.manager");
|
|
17
|
-
class AnalysisManagerFactory {
|
|
18
|
-
createManager(id, processId, filename, packageManager) {
|
|
19
|
-
const analysisManager = new analysis_manager_1.AnalysisManager();
|
|
20
|
-
analysisManager.id = id;
|
|
21
|
-
analysisManager.processId = processId;
|
|
22
|
-
if (filename !== null) {
|
|
23
|
-
analysisManager.fileName = this.resolvePackageFilePath(filename);
|
|
24
|
-
}
|
|
25
|
-
analysisManager.packageManager = packageManager;
|
|
26
|
-
return analysisManager;
|
|
27
|
-
}
|
|
28
|
-
resolvePackageFilePath(fileName) {
|
|
29
|
-
if (!fs.existsSync(path.resolve(process.cwd(), fileName))) {
|
|
30
|
-
logger_1.logger.error(new logger_1.FatalError("The provided file does not exist"));
|
|
31
|
-
}
|
|
32
|
-
return path.resolve(process.cwd(), fileName);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.AnalysisManagerFactory = AnalysisManagerFactory;
|
|
36
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
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", "./base.manager", "./asset.manager", "fs", "../../util/yaml", "form-data"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AnalysisManager = void 0;
|
|
13
|
-
const base_manager_1 = require("./base.manager");
|
|
14
|
-
const asset_manager_1 = require("./asset.manager");
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
const yaml_1 = require("../../util/yaml");
|
|
17
|
-
const FormData = require("form-data");
|
|
18
|
-
class AnalysisManager extends base_manager_1.BaseManager {
|
|
19
|
-
get fileName() {
|
|
20
|
-
return this._fileName;
|
|
21
|
-
}
|
|
22
|
-
set fileName(value) {
|
|
23
|
-
this._fileName = value;
|
|
24
|
-
}
|
|
25
|
-
get id() {
|
|
26
|
-
return this._id;
|
|
27
|
-
}
|
|
28
|
-
set id(value) {
|
|
29
|
-
this._id = value;
|
|
30
|
-
}
|
|
31
|
-
get processId() {
|
|
32
|
-
return this._processId;
|
|
33
|
-
}
|
|
34
|
-
set processId(value) {
|
|
35
|
-
this._processId = value;
|
|
36
|
-
}
|
|
37
|
-
get packageManager() {
|
|
38
|
-
return this._packageManager;
|
|
39
|
-
}
|
|
40
|
-
set packageManager(value) {
|
|
41
|
-
this._packageManager = value;
|
|
42
|
-
}
|
|
43
|
-
getConfig() {
|
|
44
|
-
const pullUrl = this.packageManager
|
|
45
|
-
? `${AnalysisManager.BASE_URL}${this.id}/package/export`
|
|
46
|
-
: `${AnalysisManager.PULL_URL}${this.id}`;
|
|
47
|
-
return {
|
|
48
|
-
pushUrl: this.profile.team.replace(/\/?$/, `${AnalysisManager.BASE_URL}/import?processId=${this.processId}`),
|
|
49
|
-
pullUrl: this.profile.team.replace(/\/?$/, pullUrl),
|
|
50
|
-
exportFileName: `${this.packageManager ? asset_manager_1.AssetManager.ASSET_FILE_PREFIX : AnalysisManager.ANALYSIS_FILE_PREFIX}${this.id}${this.packageManager ? ".yaml" : ".json"}`,
|
|
51
|
-
onPushSuccessMessage: (data) => {
|
|
52
|
-
return "Analysis was pushed successfully. New ID: " + data.id;
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
getBody() {
|
|
57
|
-
const formData = new FormData();
|
|
58
|
-
formData.append("file", fs.createReadStream(this.fileName));
|
|
59
|
-
return formData;
|
|
60
|
-
}
|
|
61
|
-
getSerializedFileContent(data) {
|
|
62
|
-
if (this.packageManager) {
|
|
63
|
-
return (0, yaml_1.stringify)(data);
|
|
64
|
-
}
|
|
65
|
-
return JSON.stringify(data);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.AnalysisManager = AnalysisManager;
|
|
69
|
-
AnalysisManager.BASE_URL = "/process-mining/api/analysis/";
|
|
70
|
-
AnalysisManager.PULL_URL = `${AnalysisManager.BASE_URL}/export?id=`;
|
|
71
|
-
AnalysisManager.ANALYSIS_FILE_PREFIX = "analysis_";
|
|
72
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare class AnalysisCommand {
|
|
2
|
-
private contentService;
|
|
3
|
-
private analysisManagerFactory;
|
|
4
|
-
pullAnalysis(profile: string, id: string, packageManager: boolean): Promise<void>;
|
|
5
|
-
pushAnalysis(profile: string, workspaceId: string, filename: string): Promise<void>;
|
|
6
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseManager } from "./base.manager";
|
|
2
|
-
import { ManagerConfig } from "../../interfaces/manager-config.interface";
|
|
3
|
-
export declare class AnalysisManager extends BaseManager {
|
|
4
|
-
private static BASE_URL;
|
|
5
|
-
private static PULL_URL;
|
|
6
|
-
private static ANALYSIS_FILE_PREFIX;
|
|
7
|
-
private _id;
|
|
8
|
-
private _processId;
|
|
9
|
-
private _fileName;
|
|
10
|
-
private _packageManager;
|
|
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);
|
|
19
|
-
getConfig(): ManagerConfig;
|
|
20
|
-
getBody(): any;
|
|
21
|
-
protected getSerializedFileContent(data: any): string;
|
|
22
|
-
}
|