@celonis/content-cli 1.14.0 → 1.14.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.
Files changed (58) hide show
  1. package/commands/action-flows/action-flow/action-flow.service.js +9 -9
  2. package/commands/asset-registry/asset-registry.service.js +20 -16
  3. package/commands/bookmarks/bookmarks-command.service.js +5 -3
  4. package/commands/configuration-management/api/node-api.js +17 -0
  5. package/commands/configuration-management/branch/branch-export-import.command.service.js +31 -24
  6. package/commands/configuration-management/branch/branch.command.service.js +14 -10
  7. package/commands/configuration-management/metadata.service.js +9 -5
  8. package/commands/configuration-management/module.js +6 -5
  9. package/commands/configuration-management/node-dependency.service.js +5 -3
  10. package/commands/configuration-management/node-diff.service.js +10 -6
  11. package/commands/configuration-management/node.service.js +14 -10
  12. package/commands/configuration-management/package-validation.service.js +11 -5
  13. package/commands/configuration-management/package-version.service.js +7 -5
  14. package/commands/configuration-management/single-package-export.service.js +6 -6
  15. package/commands/configuration-management/single-package-import.service.js +22 -18
  16. package/commands/configuration-management/staging-package.service.js +9 -5
  17. package/commands/configuration-management/variable.service.js +11 -7
  18. package/commands/data-pipeline/data-pool/data-pool-service.js +13 -9
  19. package/commands/deployment/deployment.service.js +15 -13
  20. package/commands/studio/manager/space.manager.js +21 -10
  21. package/commands/studio/service/asset-service.js +5 -4
  22. package/commands/studio/service/package.service.js +9 -5
  23. package/commands/t2tc/diff.service.js +15 -9
  24. package/commands/t2tc/t2tc-package.service.js +25 -23
  25. package/core/http/http-client.js +18 -0
  26. package/core/http/http-shared/base.manager.js +35 -59
  27. package/core/utils/cui-api.js +52 -0
  28. package/core/utils/cui-file-service.js +106 -0
  29. package/core/utils/file-service.js +7 -6
  30. package/lib/commands/action-flows/action-flow/action-flow.service.d.ts +1 -0
  31. package/lib/commands/asset-registry/asset-registry.service.d.ts +1 -0
  32. package/lib/commands/bookmarks/bookmarks-command.service.d.ts +1 -0
  33. package/lib/commands/configuration-management/api/node-api.d.ts +1 -0
  34. package/lib/commands/configuration-management/branch/branch-export-import.command.service.d.ts +2 -1
  35. package/lib/commands/configuration-management/branch/branch.command.service.d.ts +2 -1
  36. package/lib/commands/configuration-management/interfaces/package-validation.interfaces.d.ts +1 -1
  37. package/lib/commands/configuration-management/metadata.service.d.ts +1 -0
  38. package/lib/commands/configuration-management/node-dependency.service.d.ts +1 -0
  39. package/lib/commands/configuration-management/node-diff.service.d.ts +1 -0
  40. package/lib/commands/configuration-management/node.service.d.ts +2 -1
  41. package/lib/commands/configuration-management/package-validation.service.d.ts +1 -0
  42. package/lib/commands/configuration-management/package-version.service.d.ts +1 -0
  43. package/lib/commands/configuration-management/single-package-export.service.d.ts +1 -0
  44. package/lib/commands/configuration-management/single-package-import.service.d.ts +1 -0
  45. package/lib/commands/configuration-management/staging-package.service.d.ts +1 -0
  46. package/lib/commands/configuration-management/variable.service.d.ts +1 -0
  47. package/lib/commands/data-pipeline/data-pool/data-pool-service.d.ts +1 -0
  48. package/lib/commands/deployment/deployment.service.d.ts +1 -0
  49. package/lib/commands/studio/service/asset-service.d.ts +1 -0
  50. package/lib/commands/studio/service/package.service.d.ts +1 -0
  51. package/lib/commands/t2tc/diff.service.d.ts +1 -0
  52. package/lib/commands/t2tc/t2tc-package.service.d.ts +1 -0
  53. package/lib/core/http/http-client.d.ts +4 -0
  54. package/lib/core/http/http-shared/base.manager.d.ts +7 -5
  55. package/lib/core/http/http-shared/manager-config.interface.d.ts +1 -1
  56. package/lib/core/utils/cui-api.d.ts +26 -0
  57. package/lib/core/utils/cui-file-service.d.ts +19 -0
  58. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class BookmarksCommandService {
3
3
  private readonly bookmarksApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  exportBookmarks(packageKey: string, file?: string): Promise<void>;
6
7
  importBookmarks(packageKey: string, file: string): Promise<void>;
@@ -8,5 +8,6 @@ export declare class NodeApi {
8
8
  createStagingNode(packageKey: string, transport: SaveNodeTransport, validateOnly: boolean): Promise<NodeTransport | void>;
9
9
  updateStagingNode(packageKey: string, nodeKey: string, transport: UpdateNodeTransport, validateOnly: boolean): Promise<NodeTransport | void>;
10
10
  archiveStagingNode(packageKey: string, nodeKey: string, force: boolean): Promise<void>;
11
+ findStagingNodesByPackage(packageKey: string, withConfiguration: boolean, limit: number, offset: number): Promise<NodeTransport[]>;
11
12
  findVersionedNodesByPackage(packageKey: string, version: string, withConfiguration: boolean, limit: number, offset: number): Promise<NodeTransport[]>;
12
13
  }
@@ -16,6 +16,7 @@ export declare class BranchExportImportCommandService {
16
16
  private readonly singlePackageImportApi;
17
17
  private readonly branchApi;
18
18
  private readonly gitService;
19
+ private readonly cuiFileService;
19
20
  constructor(context: Context);
20
21
  exportBranch(packageKey: string, branchKey: string, options?: BranchExportOptions): Promise<void>;
21
22
  exportAll(packageKey: string, jsonResponse?: boolean): Promise<void>;
@@ -32,5 +33,5 @@ export declare class BranchExportImportCommandService {
32
33
  private escapeRegExp;
33
34
  private removeDir;
34
35
  private static isExportableBranch;
35
- private static writeJson;
36
+ private writeJson;
36
37
  }
@@ -2,6 +2,7 @@ import { Context } from "../../../core/command/cli-context";
2
2
  import { BranchTransport, BranchingSettingsTransport, MergeApplyOptions, MergePreviewTransport, PackageVersionCreatedTransport } from "./interfaces/branch.interfaces";
3
3
  export declare class BranchCommandService {
4
4
  private readonly branchApi;
5
+ private readonly cuiFileService;
5
6
  constructor(context: Context);
6
7
  setBranchingEnabled(packageKey: string, enabled: boolean, jsonResponse: boolean): Promise<BranchingSettingsTransport>;
7
8
  createBranch(packageKey: string, branchKey: string, sourceVersion: string, validate: boolean, jsonResponse: boolean): Promise<BranchTransport | void>;
@@ -10,7 +11,7 @@ export declare class BranchCommandService {
10
11
  mergePreview(targetPackageKey: string, sourceKey: string, sourceVersion: string, jsonResponse: boolean): Promise<MergePreviewTransport>;
11
12
  mergeApply(targetPackageKey: string, options: MergeApplyOptions): Promise<PackageVersionCreatedTransport>;
12
13
  private static buildVersionCreate;
13
- private static writeJson;
14
+ private writeJson;
14
15
  private static printBranch;
15
16
  private static printPreviewSummary;
16
17
  private static countConflictPaths;
@@ -1,5 +1,5 @@
1
1
  export interface PackageValidationRequest {
2
- layers: string[];
2
+ layers?: string[];
3
3
  nodeKeys?: string[];
4
4
  }
5
5
  export interface SchemaValidationResponse {
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class MetadataService {
3
3
  private metadataApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  exportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
6
7
  private exportListOfPackagesMetadata;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class NodeDependencyService {
3
3
  private readonly nodeDependencyApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  listNodeDependencies(packageKey: string, nodeKey: string, version: string, jsonResponse: boolean): Promise<void>;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class NodeDiffService {
3
3
  private nodeDiffApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  diff(packageKey: string, nodeKey: string, baseVersion: string, compareVersion: string, jsonResponse: boolean): Promise<void>;
6
7
  diffWithFile(packageKey: string, nodeKey: string, baseVersion: string, file: string, jsonResponse: boolean): Promise<void>;
@@ -1,9 +1,10 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class NodeService {
3
3
  private nodeApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, packageVersion: string | null, jsonResponse: boolean): Promise<void>;
6
- listNodes(packageKey: string, packageVersion: string, limit: number, offset: number, withConfiguration: boolean, jsonResponse: boolean): Promise<void>;
7
+ listNodes(packageKey: string, packageVersion: string | null, limit: number, offset: number, withConfiguration: boolean, jsonResponse: boolean): Promise<void>;
7
8
  createNode(packageKey: string, body: string | undefined, file: string | undefined, validateOnly: boolean, jsonResponse: boolean): Promise<void>;
8
9
  updateNode(packageKey: string, nodeKey: string, body: string | undefined, file: string | undefined, validateOnly: boolean, jsonResponse: boolean): Promise<void>;
9
10
  archiveNode(packageKey: string, nodeKey: string, force: boolean): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class PackageValidationService {
3
3
  private packageValidationApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  validatePackage(packageKey: string, layers: string[], nodeKeys: string[], jsonOutput: boolean): Promise<void>;
6
7
  private printValidationResult;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class PackageVersionService {
3
3
  private packageVersionApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  findPackageVersion(packageKey: string, version: string, jsonResponse: boolean): Promise<void>;
6
7
  createPackageVersion(packageKey: string, version: string | undefined, versionBumpOption: string, summaryOfChanges: string | undefined, nodeFilterKeys: string[] | undefined, jsonResponse: boolean): Promise<void>;
@@ -2,6 +2,7 @@ import { Context } from "../../core/command/cli-context";
2
2
  export declare class SinglePackageExportService {
3
3
  private readonly singlePackageExportApi;
4
4
  private readonly gitService;
5
+ private readonly cuiFileService;
5
6
  constructor(context: Context);
6
7
  exportPackage(packageKey: string, zip: boolean, gitBranch: string): Promise<void>;
7
8
  private exportToGitBranch;
@@ -5,6 +5,7 @@ export declare class SinglePackageImportService {
5
5
  private static readonly MAX_UNCOMPRESSED_ZIP_SIZE;
6
6
  private readonly singlePackageImportApi;
7
7
  private readonly gitService;
8
+ private readonly cuiFileService;
8
9
  constructor(context: Context);
9
10
  importPackage(file: string, directory: string, overwrite: boolean, jsonResponse: boolean, gitBranch: string): Promise<void>;
10
11
  private resolveSource;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class StagingPackageService {
3
3
  private stagingPackageApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  listStagingPackages(flavors: string[], includeBranches: boolean, jsonResponse: boolean): Promise<void>;
6
7
  private exportListOfPackages;
@@ -3,6 +3,7 @@ export declare class VariableService {
3
3
  private variableApi;
4
4
  private variableAssignmentCandidatesApi;
5
5
  private readonly stagingPackageVariablesApi;
6
+ private readonly cuiFileService;
6
7
  constructor(context: Context);
7
8
  listVariables(keysByVersion: string[], keysByVersionFile: string): Promise<void>;
8
9
  listCandidateAssignments(type: string, params: string): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../../core/command/cli-context";
2
2
  export declare class DataPoolService {
3
3
  private dataPoolApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  batchImportDataPools(requestFilePath: string, outputToJsonFile: boolean): Promise<void>;
6
7
  exportDataPool(poolId: string, outputToJsonFile: boolean): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class DeploymentService {
3
3
  private deploymentApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  createDeployment(packageKey: string, packageVersion: string, deployableType: string, targetId: string, jsonResponse: boolean): Promise<void>;
6
7
  getDeployments(jsonResponse: boolean, packageKey?: string, targetId?: string, deployableType?: string, status?: string, createdBy?: string, limit?: string, offset?: string): Promise<void>;
@@ -2,6 +2,7 @@ import { Context } from "../../../core/command/cli-context";
2
2
  export declare class AssetService {
3
3
  protected readonly fileDownloadedMessage = "File downloaded successfully. New filename: ";
4
4
  private assetApi;
5
+ private readonly cuiFileService;
5
6
  constructor(context: Context);
6
7
  listAssets(assetType: string): Promise<void>;
7
8
  findAndExportAllAssets(assetType: string): Promise<void>;
@@ -7,6 +7,7 @@ export declare class PackageService {
7
7
  private packageDependenciesApi;
8
8
  private dataModelService;
9
9
  private variableService;
10
+ private readonly cuiFileService;
10
11
  constructor(context: Context);
11
12
  listPackages(): Promise<void>;
12
13
  findAndExportListOfAllPackages(includeDependencies: boolean, packageKeys: string[]): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
2
  export declare class DiffService {
3
3
  private diffApi;
4
+ private readonly cuiFileService;
4
5
  constructor(context: Context);
5
6
  diffPackages(file: string, hasChanges: boolean, baseVersion: string, jsonResponse: boolean): Promise<void>;
6
7
  private hasChanges;
@@ -5,6 +5,7 @@ export declare class T2tcPackageService {
5
5
  private studioPackageApi;
6
6
  private studioService;
7
7
  private gitService;
8
+ private readonly cuiFileService;
8
9
  constructor(context: Context);
9
10
  listActivePackages(flavors: string[], includeBranches: boolean): Promise<void>;
10
11
  findAndExportListOfPackages(flavors: string[], packageKeys: string[], keysByVersion: string[], withDependencies: boolean, includeBranches: boolean): Promise<void>;
@@ -9,6 +9,10 @@ export declare class HttpClient {
9
9
  private axios;
10
10
  constructor(context: Context);
11
11
  get(url: string): Promise<any>;
12
+ getStatusAndData(url: string): Promise<{
13
+ status: number;
14
+ data: any;
15
+ }>;
12
16
  getFile(url: string): Promise<any>;
13
17
  postFile(url: string, formData: FormData, parameters?: {}): Promise<any>;
14
18
  post(url: string, body: any): Promise<any>;
@@ -1,17 +1,19 @@
1
+ /// <reference types="node" />
1
2
  import { ManagerConfig } from "./manager-config.interface";
2
3
  import { Context } from "../../command/cli-context";
4
+ import { CuiFileService } from "../../utils/cui-file-service";
3
5
  export declare abstract class BaseManager {
4
6
  private httpClient;
7
+ protected readonly cuiFileService: CuiFileService;
5
8
  protected readonly fileDownloadedMessage = "File downloaded successfully. New filename: ";
6
9
  protected constructor(context: Context);
7
- pull(): Promise<any>;
8
- pullFile(): Promise<any>;
10
+ pull(): Promise<void>;
11
+ pullFile(): Promise<void>;
9
12
  push(): Promise<any>;
10
13
  update(): Promise<any>;
11
14
  findAll(): Promise<any>;
12
- protected writeToFile(data: any): string;
13
- protected writeStreamToFile(data: any): string;
14
- protected writeToFileWithGivenName(data: any, filename: string): void;
15
+ protected writeToFile(data: any): Promise<string>;
16
+ protected writeStreamToFile(data: Buffer): Promise<string>;
15
17
  protected abstract getConfig(): ManagerConfig;
16
18
  protected abstract getBody(): object;
17
19
  protected abstract getSerializedFileContent(data: any): string;
@@ -6,6 +6,6 @@ export interface ManagerConfig {
6
6
  exportFileName?: string;
7
7
  onPushSuccessMessage?: (data: any) => string;
8
8
  onUpdateSuccessMessage?: () => string;
9
- onFindAll?: (data: any) => void;
9
+ onFindAll?: (data: any) => void | Promise<void>;
10
10
  onFindAllAndExport?: (data: any) => void;
11
11
  }
@@ -0,0 +1,26 @@
1
+ import { Context } from "../command/cli-context";
2
+ export declare const CUI_MARKING_FAILED_MESSAGE = "Could not resolve CUI marking. No file was written";
3
+ export interface CuiPdfCoverResponse {
4
+ coverPage?: {
5
+ pdfContent: string;
6
+ encoding: string;
7
+ };
8
+ }
9
+ export declare enum CuiMarking {
10
+ DISABLED = "DISABLED",
11
+ CLASSIFIED = "CLASSIFIED"
12
+ }
13
+ export type CuiMarkingDecision = {
14
+ marking: CuiMarking.DISABLED;
15
+ } | {
16
+ marking: CuiMarking.CLASSIFIED;
17
+ cover: CuiPdfCoverResponse;
18
+ };
19
+ export declare class CuiApi {
20
+ private static readonly CUI_PDF_COVER_SHEET_URL;
21
+ private static readonly STATUS_OK;
22
+ private static readonly STATUS_FORBIDDEN;
23
+ private readonly httpClient;
24
+ constructor(context: Context);
25
+ getCuiMarking(): Promise<CuiMarkingDecision>;
26
+ }
@@ -0,0 +1,19 @@
1
+ /// <reference types="node" />
2
+ import { Context } from "../command/cli-context";
3
+ export declare class CuiFileService {
4
+ static readonly COVER_SHEET_FILE_NAME = "CUI_Cover_Sheet.pdf";
5
+ static readonly CLASSIFIED_PREFIX = "CUI - ";
6
+ private static readonly BASE64_ENCODING;
7
+ private readonly cuiApi;
8
+ constructor(context: Context);
9
+ writeToFileWithGivenName(data: string, filename: string): Promise<string>;
10
+ writeZipToFileWithGivenName(zipData: Buffer, filename: string): Promise<string>;
11
+ writeDirectoryWithGivenName(write: (targetDir: string) => void, directoryName: string): Promise<string>;
12
+ private writeWithCoverHandling;
13
+ private writeClassifiedArchive;
14
+ private addCoverPage;
15
+ private writeArchive;
16
+ private decodeCoverPage;
17
+ private buildClassifiedArchiveName;
18
+ private prefixFileName;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celonis/content-cli",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "CLI Tool to help manage content in Celonis Platform",
5
5
  "main": "content-cli.js",
6
6
  "bin": {