@celonis/content-cli
Advanced tools
Comparing version 0.0.51 to 0.0.53
@@ -15,3 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "../services/content.service", "../content/factory/ctp-manager.factory"], factory); | ||
define(["require", "exports", "../services/content.service", "../content/factory/ctp-manager.factory", "../util/logger"], factory); | ||
} | ||
@@ -23,2 +23,3 @@ })(function (require, exports) { | ||
const ctp_manager_factory_1 = require("../content/factory/ctp-manager.factory"); | ||
const logger_1 = require("../util/logger"); | ||
class CTPCommand { | ||
@@ -29,3 +30,3 @@ constructor() { | ||
} | ||
pushCTPFile(profile, filename, password, pushAnalysis, pushDataModels) { | ||
pushCTPFile(profile, filename, password, pushAnalysis, pushDataModels, existingPoolId, globalPoolName) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -36,8 +37,14 @@ if (pushAnalysis) { | ||
if (pushDataModels) { | ||
yield this.contentService.push(profile, this.ctpManagerFactory.createCtpDataModelManager(filename, password)); | ||
this.validateParamsForDataModelPush(existingPoolId, globalPoolName); | ||
yield this.contentService.push(profile, this.ctpManagerFactory.createCtpDataModelManager(filename, password, existingPoolId, globalPoolName)); | ||
} | ||
}); | ||
} | ||
validateParamsForDataModelPush(existingPoolId, globalPoolName) { | ||
if (existingPoolId != null && globalPoolName != null) { | ||
logger_1.logger.error(new logger_1.FatalError("You should specify only one of those options --globalPoolName, --existingPoolId, they are mutual exclusive")); | ||
} | ||
} | ||
} | ||
exports.CTPCommand = CTPCommand; | ||
}); |
@@ -49,6 +49,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
.option("-d, --pushDataModels", "Specify this option if you want to push data models from the CTP file") | ||
.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) | ||
.option("--existingPoolId <existingPoolId>", "Specify this option if you want to push all Data models into one already existing pool with provided ID", null) | ||
.requiredOption("-f, --file <file>", "The .ctp file you want to push") | ||
.requiredOption("--password <password>", "The password used for extracting the .ctp file") | ||
.action((cmd) => __awaiter(this, void 0, void 0, function* () { | ||
yield new ctp_command_1.CTPCommand().pushCTPFile(cmd.profile, cmd.file, cmd.password, cmd.pushAnalysis, cmd.pushDataModels); | ||
yield new ctp_command_1.CTPCommand().pushCTPFile(cmd.profile, cmd.file, cmd.password, cmd.pushAnalysis, cmd.pushDataModels, cmd.existingPoolId, cmd.globalPoolName); | ||
process.exit(); | ||
@@ -55,0 +57,0 @@ })); |
@@ -22,4 +22,4 @@ (function (factory) { | ||
} | ||
createCtpDataModelManager(filename, password) { | ||
const ctpManager = new ctp_datamodel_manager_1.CtpDataModelManager(); | ||
createCtpDataModelManager(filename, password, existingPoolId, globalPoolName) { | ||
const ctpManager = new ctp_datamodel_manager_1.CtpDataModelManager(existingPoolId, globalPoolName); | ||
return this.initManager(ctpManager, filename, password); | ||
@@ -26,0 +26,0 @@ } |
@@ -17,2 +17,10 @@ (function (factory) { | ||
} | ||
getBody() { | ||
return { | ||
formData: { | ||
file: this.content, | ||
password: this.password, | ||
}, | ||
}; | ||
} | ||
} | ||
@@ -19,0 +27,0 @@ CtpAnalysisManager.BASE_URL = "/process-analytics/import/ctp"; |
@@ -14,5 +14,22 @@ (function (factory) { | ||
class CtpDataModelManager extends ctp_manager_1.CtpManager { | ||
constructor(existingPoolId, globalPoolName) { | ||
super(); | ||
this.existingPoolId = existingPoolId; | ||
this.globalPoolName = globalPoolName; | ||
} | ||
getUrl() { | ||
return CtpDataModelManager.BASE_URL; | ||
} | ||
getBody() { | ||
return { | ||
formData: { | ||
file: this.content, | ||
transport: JSON.stringify({ | ||
password: this.password, | ||
existingPoolId: this.existingPoolId, | ||
globalPoolName: this.globalPoolName, | ||
}), | ||
}, | ||
}; | ||
} | ||
} | ||
@@ -19,0 +36,0 @@ CtpDataModelManager.BASE_URL = "/cpm-ems-migrator/migration/api/ctp"; |
@@ -35,10 +35,2 @@ (function (factory) { | ||
} | ||
getBody() { | ||
return { | ||
formData: { | ||
file: this.content, | ||
password: this.password, | ||
}, | ||
}; | ||
} | ||
getSerializedFileContent(data) { | ||
@@ -45,0 +37,0 @@ return JSON.stringify(data); |
export declare class CTPCommand { | ||
private contentService; | ||
private ctpManagerFactory; | ||
pushCTPFile(profile: string, filename: string, password: string, pushAnalysis: boolean, pushDataModels: boolean): Promise<void>; | ||
pushCTPFile(profile: string, filename: string, password: string, pushAnalysis: boolean, pushDataModels: boolean, existingPoolId: string, globalPoolName: string): Promise<void>; | ||
private validateParamsForDataModelPush; | ||
} |
import { CtpManager } from "../manager/ctp.manager"; | ||
export declare class CTPManagerFactory { | ||
createCtpAnalysisManager(filename: string, password: string): CtpManager; | ||
createCtpDataModelManager(filename: string, password: string): CtpManager; | ||
createCtpDataModelManager(filename: string, password: string, existingPoolId: string, globalPoolName: string): CtpManager; | ||
private initManager; | ||
private readFile; | ||
} |
@@ -5,2 +5,3 @@ import { CtpManager } from "./ctp.manager"; | ||
protected getUrl(): string; | ||
getBody(): any; | ||
} |
import { CtpManager } from "./ctp.manager"; | ||
export declare class CtpDataModelManager extends CtpManager { | ||
private static BASE_URL; | ||
private readonly existingPoolId; | ||
private readonly globalPoolName; | ||
constructor(existingPoolId: string, globalPoolName: string); | ||
protected getUrl(): string; | ||
protected getBody(): object; | ||
} |
@@ -9,5 +9,4 @@ import { BaseManager } from "./base.manager"; | ||
getConfig(): ManagerConfig; | ||
getBody(): any; | ||
protected getSerializedFileContent(data: any): string; | ||
protected abstract getUrl(): string; | ||
} |
{ | ||
"name": "@celonis/content-cli", | ||
"version": "0.0.51", | ||
"version": "0.0.53", | ||
"description": "CLI Tool to help manage content in Celonis EMS", | ||
@@ -5,0 +5,0 @@ "main": "content-cli.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
134071
2929
0