Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/action-flows/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SkillCommandService } from "./skill/skill-command.service";

class Module extends IModule {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const analyzeCommand = configurator.command("analyze");
analyzeCommand.command("action-flows")
.description("Analyze Action Flows dependencies for a certain package")
Expand Down
2 changes: 1 addition & 1 deletion src/commands/analysis/analysis-bookmarks.manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class AnalysisBookmarksManager extends BaseManager {
return {
pushUrl: `${AnalysisBookmarksManager.BASE_URL}/import?analysisId=${this.analysisId}`,
pullUrl: pullUrl,
exportFileName: `${AnalysisBookmarksManager.ANALYSIS_BOOKMARKS_FILE_PREFIX}${this.analysisId}${".json"}`,
exportFileName: `${AnalysisBookmarksManager.ANALYSIS_BOOKMARKS_FILE_PREFIX}${this.analysisId}.json`,
onPushSuccessMessage: (): string => {
return "Analysis Bookmarks was pushed successfully.";
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands/analysis/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AnalysisBookmarksCommandService } from "./analysis-bookmarks-command.se

class Module extends IModule {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const pullCommand = configurator.command("pull");
pullCommand.command("bookmarks")
.description("Command to pull an analysis bookmarks")
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cpm4/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CTPCommandService } from "./ctp-command.service";

class Module extends IModule {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const pushCommand = configurator.command("push")
pushCommand.command("ctp")
.description("Command to push a .ctp (Celonis 4 transport file) to create a package")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Context } from "../../../core/command/cli-context";

export class ConnectionCommands {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const listCommand = configurator.command("list");
listCommand.command("connection")
.description("Command to list all connections in a Data Pool")
Expand All @@ -33,15 +33,15 @@ export class ConnectionCommands {
.action(this.updateConnectionProperty);
}

async getCommandProperties(context: Context, command: Command, options: OptionValues) {
private async getCommandProperties(context: Context, command: Command, options: OptionValues): Promise<void> {
await new ConnectionCommandService(context).getProperties(options.dataPoolId, options.connectionId);
}

async listConnections(context: Context, command: Command, options: OptionValues) {
private async listConnections(context: Context, command: Command, options: OptionValues): Promise<void> {
await new ConnectionCommandService(context).listConnections(options.dataPoolId);
}

async updateConnectionProperty(context: Context, command: Command, options: OptionValues) {
private async updateConnectionProperty(context: Context, command: Command, options: OptionValues): Promise<void> {
await new ConnectionCommandService(context).updateProperty(options.dataPoolId, options.connectionId, options.property, options.value);
}
}
10 changes: 5 additions & 5 deletions src/commands/data-pipeline/connection/connection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export class ConnectionService {
const type = connection.type;
const typedConnection = await this.dataPoolApi.getTypedConnection(dataPoolId, connectionId, type);
logger.info(`Connection ID: ${connection.id} - Name: ${connection.name} - Type: ${connection.type}`);
logger.info(`Properties:`)
for (let k in typedConnection) {
if (typeof typedConnection[k] === 'object') {
for (let o in typedConnection[k]) {
logger.info("Properties:")
for (const k in typedConnection) {
if (typeof typedConnection[k] === "object") {
for (const o in typedConnection[k]) {
logger.info(` ${k}.${o} : ${typeof typedConnection[k][o]} := ${typedConnection[k][o]}`)
}
} else {
Expand All @@ -36,7 +36,7 @@ export class ConnectionService {
return typedConnection;
}

public async updateProperty(dataPoolId: string, connectionId: string, property: string, value: string) {
public async updateProperty(dataPoolId: string, connectionId: string, property: string, value: string): Promise<void> {
const connection = await this.dataPoolApi.getConnection(dataPoolId, connectionId);
const type = connection.type;
const typedConnection = await this.dataPoolApi.getTypedConnection(dataPoolId, connectionId, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ContentService } from "../../../core/http/http-shared/content.service";
import { DataPoolManagerFactory } from "./data-pool-manager.factory";
import { Context } from "../../../core/command/cli-context";
import { DataPoolService } from "./data-pool-service";
import { logger } from "../../../core/utils/logger";

export class DataPoolCommandService {
private contentService = new ContentService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ export declare type DataPoolStatus = "CANCEL" | "FAIL" | "QUEUED" | "RUNNING" |
export type Tag = {};

export declare class DataSourceSlimTransport {
id: string;
name: string;
imported: boolean;
importedPoolId: string;
public id: string;
public name: string;
public imported: boolean;
public importedPoolId: string;
}

export interface DataPoolSlimTransport {
Expand All @@ -19,12 +19,12 @@ export interface DataPoolSlimTransport {
dataSources: DataSourceSlimTransport[];
}
export declare class DataPoolPageTransport {
content: DataPoolSlimTransport[];
pageSize: number;
pageNumber: number;
totalCount: number;
public content: DataPoolSlimTransport[];
public pageSize: number;
public pageNumber: number;
public totalCount: number;
}

export declare class DataPoolInstallVersionReport {
dataModelIdMappings: Map<string, string>;
public dataModelIdMappings: Map<string, string>;
}
16 changes: 8 additions & 8 deletions src/commands/data-pipeline/data-pool/data-pool.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { DataPoolCommandService } from "./data-pool-command.service";

export class DataPoolCommands {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const exportCommand = configurator.command("export");
exportCommand.command("data-pool")
.description("Command to export a data pool")
Expand Down Expand Up @@ -53,31 +53,31 @@ export class DataPoolCommands {
.action(this.updateDataPool);
}

async exportDataPool(context: Context, command: Command, options: OptionValues) {
private async exportDataPool(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).exportDataPool(options.id, options.outputToJsonFile);
}

async batchImportDataPools(context: Context, command: Command, options: OptionValues) {
private async batchImportDataPools(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).batchImportDataPools(options.jsonFile, options.outputToJsonFile);
}

async listDataPools(context: Context, command: Command, options: OptionValues) {
private async listDataPools(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).listDataPools(options.json);
}

async pullDataPool(context: Context, command: Command, options: OptionValues) {
private async pullDataPool(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).pullDataPool(options.id);
}

async pushDataPool(context: Context, command: Command, options: OptionValues) {
private async pushDataPool(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).pushDataPool(options.file);
}

async pushDataPools(context: Context, command: Command, options: OptionValues) {
private async pushDataPools(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).pushDataPools();
}

async updateDataPool(context: Context, command: Command, options: OptionValues) {
private async updateDataPool(context: Context, command: Command, options: OptionValues): Promise<void> {
await new DataPoolCommandService(context).updateDataPool(options.id, options.file);
}
}
2 changes: 1 addition & 1 deletion src/commands/data-pipeline/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DataPoolCommands } from "./data-pool/data-pool.commands";

class Module extends IModule {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
new DataPoolCommands().register(context, configurator);
new ConnectionCommands().register(context, configurator);
}
Expand Down
12 changes: 6 additions & 6 deletions src/commands/profile/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ProfileCommandService } from "./profile-command.service";

class Module extends IModule {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const command = configurator.command("profile")
.description("Manage profiles required to access a system.");

Expand All @@ -28,17 +28,17 @@ class Module extends IModule {
.action(this.defaultProfile);
}

async defaultProfile(context: Context, command: Command) {
let profile = command.args[0];
private async defaultProfile(context: Context, command: Command): Promise<void> {
const profile = command.args[0];
await new ProfileCommandService().makeDefaultProfile(profile);
}

async createProfile(context: Context, command: Command, options: OptionValues) {
private async createProfile(context: Context, command: Command, options: OptionValues): Promise<void> {
await new ProfileCommandService().createProfile(options.setAsDefault);
}

async listProfiles(context: Context, command: Command) {
logger.debug(`List profiles`);
private async listProfiles(context: Context, command: Command): Promise<void> {
logger.debug("List profiles");
await new ProfileCommandService().listProfiles();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/studio/api/studio-variables-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class StudioVariablesApi {
});
}

public getRuntimeVariableValues(packageKey: string, appMode: string): Promise<VariablesAssignments[]> {
public async getRuntimeVariableValues(packageKey: string, appMode: string): Promise<VariablesAssignments[]> {
const queryParams = new URLSearchParams();
queryParams.set("appMode", appMode);

Expand Down
2 changes: 1 addition & 1 deletion src/commands/studio/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SpaceCommandService } from "./command-service/space-command.service";

class Module extends IModule {

register(context: Context, configurator: Configurator) {
public register(context: Context, configurator: Configurator): void {
const exportCommand = configurator.command("export");
exportCommand.command("packages")
.description("Command to export all given packages")
Expand Down
11 changes: 5 additions & 6 deletions src/commands/studio/service/package.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export class PackageService {
continue;
}

const dependentPackage = manifestNodes.find((node) => node.packageKey === dependency.key);
const dependentPackage = manifestNodes.find(node => node.packageKey === dependency.key);
await this.importPackage(dependentPackage, manifestNodes, sourceToTargetVersionsByNodeKey, spaceMappings, dmTargetIdsBySourceIds, importedVersionsByNodeKey, draftIdsByPackageKeyAndVersion, importedFilePath, excludeActionFlows);
}
}
Expand All @@ -298,7 +298,7 @@ export class PackageService {
}

private async getTargetSpaceForExportedPackage(packageToImport: ManifestNodeTransport, spaceMappings: Map<string, string>): Promise<SpaceTransport> {
let targetSpace;
let targetSpace: SpaceTransport;
const allSpaces = await this.spaceService.refreshAndGetAllSpaces();
if (spaceMappings.has(packageToImport.packageKey)) {
const customSpaceId = spaceMappings.get(packageToImport.packageKey);
Expand Down Expand Up @@ -408,8 +408,7 @@ export class PackageService {
}

public async getPackagesWithDependencies(draftIdByNodeId: Map<string, string>): Promise<Map<string, PackageDependencyTransport[]>> {
const allPackageDependencies: Map<string, PackageDependencyTransport[]> = await this.packageDependenciesApi.findPackageDependenciesByIds(draftIdByNodeId);
return allPackageDependencies;
return await this.packageDependenciesApi.findPackageDependenciesByIds(draftIdByNodeId);
}

private async getDependencyPackages(nodesToResolve: BatchExportNodeTransport[], dependencyPackages: BatchExportNodeTransport[], allPackages: ContentNodeTransport[], resolvedDependencies: string[], versionsByNodeKey: Map<string, string[]>): Promise<BatchExportNodeTransport[]> {
Expand Down Expand Up @@ -499,15 +498,15 @@ export class PackageService {
private exportManifestOfPackages(nodes: BatchExportNodeTransport[], dependencyVersionsByNodeKey: Map<string, string[]>): ManifestNodeTransport[] {
const manifestNodesByPackageKey = new Map<string, ManifestNodeTransport>();

nodes.forEach((node) => {
nodes.forEach(node => {
const manifestNode = manifestNodesByPackageKey.get(node.key) ?? {} as ManifestNodeTransport;
manifestNode.packageKey = node.key;
manifestNode.packageId = node.id;
manifestNode.space = {
spaceName: node.space.name,
spaceIcon: node.space.iconReference
}
manifestNode.variables = node.variables?.map((variable) => {
manifestNode.variables = node.variables?.map(variable => {
if (variable.type === PackageManagerVariableType.DATA_MODEL) {
// @ts-ignore
const dataModel = node.datamodels?.find(dataModel => dataModel.dataModelId === variable.value);
Expand Down
20 changes: 10 additions & 10 deletions src/content-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ if (!program.opts().quietmode) {

if (program.opts().debug) {
logger.transports.forEach(t => {
t.level = 'debug';
t.level = "debug";
});
}

/**
* To support the legacy command structure, we have to configure some root commands
* that the individual modules will extend.
*/
function configureRootCommands(configurator: Configurator) {
function configureRootCommands(configurator: Configurator): void {
configurator.command("list")
.description("Commands to list content.")
.alias("ls");
}

async function run() {
let context = new Context(program.opts());
async function run(): Promise<void> {
const context = new Context(program.opts());
await context.init();

let moduleHandler = new ModuleHandler(program, context);
const moduleHandler = new ModuleHandler(program, context);

configureRootCommands(moduleHandler.configurator);

Expand All @@ -65,16 +65,16 @@ async function run() {
try {
program.parse(process.argv);
} catch (error) {
logger.error(`An unexpected error occured: ${error}`);
logger.error(`An unexpected error occurred: ${error}`);
}
}

run();

// catch uncaught exceptions
process.on('uncaughtException', (error: Error, origin: NodeJS.UncaughtExceptionOrigin) => {
console.error(`\n💥 UNCAUGHT EXCEPTION!\n`);
console.error('Error:', error);
console.error('Origin:', origin);
process.on("uncaughtException", (error: Error, origin: NodeJS.UncaughtExceptionOrigin) => {
console.error("\n💥 UNCAUGHT EXCEPTION!\n");
console.error("Error:", error);
console.error("Origin:", origin);
process.exit(1);
});
Loading