@celonis/content-cli 0.2.8 → 0.2.9
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/commands/space.command.js +35 -0
- package/content/factory/space-manager.factory.js +19 -0
- package/content/manager/space.manager.js +47 -0
- package/content-cli-list.js +14 -1
- package/interfaces/save-space.interface.js +12 -0
- package/lib/commands/space.command.d.ts +5 -0
- package/lib/content/factory/space-manager.factory.d.ts +4 -0
- package/lib/content/manager/space.manager.d.ts +15 -0
- package/lib/interfaces/save-space.interface.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
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/space-manager.factory"], factory);
|
|
17
|
+
}
|
|
18
|
+
})(function (require, exports) {
|
|
19
|
+
"use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const content_service_1 = require("../services/content.service");
|
|
22
|
+
const space_manager_factory_1 = require("../content/factory/space-manager.factory");
|
|
23
|
+
class SpaceCommand {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.contentService = new content_service_1.ContentService();
|
|
26
|
+
this.spaceManagerFactory = new space_manager_factory_1.SpaceManagerFactory();
|
|
27
|
+
}
|
|
28
|
+
listSpaces(profile) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
yield this.contentService.findAll(profile, this.spaceManagerFactory.createManager());
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.SpaceCommand = SpaceCommand;
|
|
35
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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", "../manager/space.manager"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const space_manager_1 = require("../manager/space.manager");
|
|
13
|
+
class SpaceManagerFactory {
|
|
14
|
+
createManager() {
|
|
15
|
+
return new space_manager_1.SpaceManager();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.SpaceManagerFactory = SpaceManagerFactory;
|
|
19
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
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", "../../util/logger"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const base_manager_1 = require("./base.manager");
|
|
13
|
+
const logger_1 = require("../../util/logger");
|
|
14
|
+
class SpaceManager extends base_manager_1.BaseManager {
|
|
15
|
+
get id() {
|
|
16
|
+
return this._id;
|
|
17
|
+
}
|
|
18
|
+
set id(value) {
|
|
19
|
+
this._id = value;
|
|
20
|
+
}
|
|
21
|
+
get name() {
|
|
22
|
+
return this._name;
|
|
23
|
+
}
|
|
24
|
+
set name(value) {
|
|
25
|
+
this._name = value;
|
|
26
|
+
}
|
|
27
|
+
getConfig() {
|
|
28
|
+
return {
|
|
29
|
+
findAllUrl: this.profile.team.replace(/\/?$/, SpaceManager.BASE_URL),
|
|
30
|
+
onFindAll: (data) => this.listSpaces(data),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
listSpaces(nodes) {
|
|
34
|
+
nodes.forEach(node => {
|
|
35
|
+
logger_1.logger.info(`${node.id} - Name: "${node.name}"`);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
getBody() {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
getSerializedFileContent(data) {
|
|
42
|
+
return "";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.SpaceManager = SpaceManager;
|
|
46
|
+
SpaceManager.BASE_URL = "/package-manager/api/spaces";
|
|
47
|
+
});
|
package/content-cli-list.js
CHANGED
|
@@ -13,12 +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/package.command", "commander"], factory);
|
|
16
|
+
define(["require", "exports", "./commands/package.command", "./commands/space.command", "commander"], factory);
|
|
17
17
|
}
|
|
18
18
|
})(function (require, exports) {
|
|
19
19
|
"use strict";
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const package_command_1 = require("./commands/package.command");
|
|
22
|
+
const space_command_1 = require("./commands/space.command");
|
|
22
23
|
const commander = require("commander");
|
|
23
24
|
class List {
|
|
24
25
|
static packages(program) {
|
|
@@ -32,8 +33,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
33
|
}));
|
|
33
34
|
return program;
|
|
34
35
|
}
|
|
36
|
+
static spaces(program) {
|
|
37
|
+
program
|
|
38
|
+
.command("spaces")
|
|
39
|
+
.description("Command to list all spaces")
|
|
40
|
+
.option("-p, --profile <profile>", "Profile which you want to use to list spaces")
|
|
41
|
+
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
yield new space_command_1.SpaceCommand().listSpaces(cmd.profile);
|
|
43
|
+
process.exit();
|
|
44
|
+
}));
|
|
45
|
+
return program;
|
|
46
|
+
}
|
|
35
47
|
}
|
|
36
48
|
List.packages(commander);
|
|
49
|
+
List.spaces(commander);
|
|
37
50
|
commander.parse(process.argv);
|
|
38
51
|
if (!process.argv.slice(2).length) {
|
|
39
52
|
commander.outputHelp();
|
|
@@ -0,0 +1,12 @@
|
|
|
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"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ManagerConfig } from "../../interfaces/manager-config.interface";
|
|
2
|
+
import { BaseManager } from "./base.manager";
|
|
3
|
+
export declare class SpaceManager extends BaseManager {
|
|
4
|
+
private static BASE_URL;
|
|
5
|
+
private _id;
|
|
6
|
+
private _name;
|
|
7
|
+
get id(): string;
|
|
8
|
+
set id(value: string);
|
|
9
|
+
get name(): string;
|
|
10
|
+
set name(value: string);
|
|
11
|
+
getConfig(): ManagerConfig;
|
|
12
|
+
private listSpaces;
|
|
13
|
+
protected getBody(): object;
|
|
14
|
+
protected getSerializedFileContent(data: any): string;
|
|
15
|
+
}
|