@celonis/content-cli 1.12.0 → 1.14.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.
Files changed (53) hide show
  1. package/README.md +17 -5
  2. package/commands/action-flows/action-flow/action-flow.service.js +4 -2
  3. package/commands/action-flows/module.js +2 -1
  4. package/commands/asset-registry/asset-registry-api.js +9 -12
  5. package/commands/asset-registry/asset-registry.service.js +2 -31
  6. package/commands/asset-registry/module.js +0 -11
  7. package/commands/bookmarks/bookmarks-api.js +49 -0
  8. package/commands/bookmarks/bookmarks-command.service.js +46 -0
  9. package/commands/bookmarks/bookmarks.interfaces.js +12 -0
  10. package/commands/bookmarks/module.js +49 -0
  11. package/commands/configuration-management/api/single-package-export-api.js +38 -0
  12. package/commands/configuration-management/branch/api/branch.api.js +88 -0
  13. package/commands/configuration-management/branch/branch-export-import.command.service.js +276 -0
  14. package/commands/configuration-management/branch/branch.command.service.js +178 -0
  15. package/commands/configuration-management/branch/interfaces/branch.interfaces.js +41 -0
  16. package/commands/configuration-management/module.js +189 -5
  17. package/commands/configuration-management/single-package-export.service.js +64 -0
  18. package/commands/configuration-management/single-package-import.service.js +37 -17
  19. package/commands/configuration-management/variable.service.js +12 -14
  20. package/commands/data-pipeline/connection/connection.commands.js +4 -2
  21. package/commands/data-pipeline/data-pool/data-pool.commands.js +2 -1
  22. package/commands/deployment/module.js +4 -7
  23. package/commands/studio/manager/package.manager.js +1 -1
  24. package/commands/studio/module.js +8 -4
  25. package/commands/t2tc/module.js +1 -1
  26. package/commands/t2tc/t2tc-package.service.js +5 -3
  27. package/content-cli.js +65 -35
  28. package/core/command/module-handler.js +13 -1
  29. package/core/feature-flag/feature-disabled-error.js +52 -0
  30. package/core/utils/branches.js +10 -0
  31. package/core/utils/file-service.js +27 -17
  32. package/lib/commands/asset-registry/asset-registry-api.d.ts +4 -3
  33. package/lib/commands/asset-registry/asset-registry.interfaces.d.ts +0 -12
  34. package/lib/commands/asset-registry/asset-registry.service.d.ts +1 -3
  35. package/lib/commands/asset-registry/module.d.ts +0 -1
  36. package/lib/commands/bookmarks/bookmarks-api.d.ts +8 -0
  37. package/lib/commands/bookmarks/bookmarks-command.service.d.ts +7 -0
  38. package/lib/commands/bookmarks/bookmarks.interfaces.d.ts +34 -0
  39. package/lib/commands/bookmarks/module.d.ts +8 -0
  40. package/lib/commands/configuration-management/api/single-package-export-api.d.ts +7 -0
  41. package/lib/commands/configuration-management/branch/api/branch.api.d.ts +12 -0
  42. package/lib/commands/configuration-management/branch/branch-export-import.command.service.d.ts +36 -0
  43. package/lib/commands/configuration-management/branch/branch.command.service.d.ts +18 -0
  44. package/lib/commands/configuration-management/branch/interfaces/branch.interfaces.d.ts +139 -0
  45. package/lib/commands/configuration-management/module.d.ts +9 -0
  46. package/lib/commands/configuration-management/single-package-export.service.d.ts +8 -0
  47. package/lib/commands/configuration-management/single-package-import.service.d.ts +7 -4
  48. package/lib/content-cli.d.ts +15 -1
  49. package/lib/core/command/module-handler.d.ts +4 -4
  50. package/lib/core/feature-flag/feature-disabled-error.d.ts +16 -0
  51. package/lib/core/utils/branches.d.ts +3 -0
  52. package/lib/core/utils/file-service.d.ts +6 -1
  53. package/package.json +5 -5
@@ -0,0 +1,139 @@
1
+ export declare enum MergeResolution {
2
+ CUSTOM = "CUSTOM",
3
+ ACCEPT_SOURCE = "ACCEPT_SOURCE",
4
+ ACCEPT_TARGET = "ACCEPT_TARGET"
5
+ }
6
+ export declare enum MergeStatus {
7
+ UNKNOWN = "UNKNOWN",
8
+ UNCHANGED = "UNCHANGED",
9
+ SOURCE_ONLY = "SOURCE_ONLY",
10
+ TARGET_ONLY = "TARGET_ONLY",
11
+ AUTO_MERGE = "AUTO_MERGE",
12
+ CONFLICT = "CONFLICT"
13
+ }
14
+ export declare enum ChangeType {
15
+ UNKNOWN = "UNKNOWN",
16
+ ADDED = "ADDED",
17
+ DELETED = "DELETED",
18
+ CHANGED = "CHANGED",
19
+ UNCHANGED = "UNCHANGED"
20
+ }
21
+ export declare enum VersionBumpOption {
22
+ NONE = "NONE",
23
+ PATCH = "PATCH"
24
+ }
25
+ export interface BranchingSettingsTransport {
26
+ branchingEnabled: boolean;
27
+ }
28
+ export interface CreateBranchTransport {
29
+ branchKey: string;
30
+ version: string;
31
+ }
32
+ export interface BranchTransport {
33
+ projectKey: string;
34
+ branchKey: string;
35
+ sourcePackageKey: string;
36
+ sourceVersion: string;
37
+ packageKey: string;
38
+ packageId?: string;
39
+ }
40
+ export interface ConfigurationChangeTransport {
41
+ op: string;
42
+ path: string;
43
+ from?: string;
44
+ value?: unknown;
45
+ fromValue?: unknown;
46
+ }
47
+ export interface MergePackageResolutionTransport {
48
+ resolution: MergeResolution;
49
+ customConfigurationChanges?: ConfigurationChangeTransport[];
50
+ customMetadataChanges?: ConfigurationChangeTransport[];
51
+ }
52
+ export interface MergeNodeResolutionTransport {
53
+ nodeKey: string;
54
+ resolution: MergeResolution;
55
+ customConfigurationChanges?: ConfigurationChangeTransport[];
56
+ customMetadataChanges?: ConfigurationChangeTransport[];
57
+ }
58
+ export interface NodeFilterTransport {
59
+ nodeKeys?: string[];
60
+ }
61
+ export interface SavePackageVersionTransport {
62
+ version?: string | null;
63
+ versionBumpOption?: VersionBumpOption;
64
+ summaryOfChanges?: string;
65
+ nodeFilter?: NodeFilterTransport | null;
66
+ }
67
+ export interface MergePreviewRequestTransport {
68
+ sourceKey: string;
69
+ sourceVersion: string;
70
+ }
71
+ export interface MergeBranchTransport {
72
+ sourceKey: string;
73
+ sourceVersion: string;
74
+ resolvedPackageConflict?: MergePackageResolutionTransport | null;
75
+ resolvedNodeConflicts?: MergeNodeResolutionTransport[];
76
+ versionCreate: SavePackageVersionTransport;
77
+ }
78
+ export interface MergePathConflictTransport {
79
+ path: string;
80
+ sourceChange: ConfigurationChangeTransport;
81
+ targetChange: ConfigurationChangeTransport;
82
+ }
83
+ export interface MergeDiffDetailTransport {
84
+ status: MergeStatus;
85
+ sourceChanges: ConfigurationChangeTransport[];
86
+ targetChanges: ConfigurationChangeTransport[];
87
+ conflicts: MergePathConflictTransport[];
88
+ autoMergedChanges: ConfigurationChangeTransport[];
89
+ }
90
+ export interface MergeDiffTransport {
91
+ configuration: MergeDiffDetailTransport;
92
+ metadata: MergeDiffDetailTransport;
93
+ }
94
+ export interface MergePreviewPackageTransport {
95
+ sourceChange: ChangeType;
96
+ targetChange: ChangeType;
97
+ changeDate: string;
98
+ updatedBy: string;
99
+ changes: MergeDiffTransport;
100
+ }
101
+ export interface MergePreviewNodeTransport {
102
+ nodeKey: string;
103
+ name: string;
104
+ type: string;
105
+ parentNodeKey?: string;
106
+ invalidContent: boolean;
107
+ sourceChange: ChangeType;
108
+ targetChange: ChangeType;
109
+ changeDate: string;
110
+ updatedBy: string;
111
+ changes: MergeDiffTransport;
112
+ }
113
+ export interface MergePreviewTransport {
114
+ commonPackageKey: string;
115
+ commonVersion: string;
116
+ packageChanges: MergePreviewPackageTransport;
117
+ nodeChanges: MergePreviewNodeTransport[];
118
+ }
119
+ export interface PackageVersionCreatedTransport {
120
+ packageKey: string;
121
+ version: string;
122
+ summaryOfChanges?: string;
123
+ creationDate: string;
124
+ createdBy: string;
125
+ }
126
+ export interface MergeApplyOptions {
127
+ sourceKey?: string;
128
+ sourceVersion?: string;
129
+ file?: string;
130
+ bump?: string;
131
+ version?: string;
132
+ summary?: string;
133
+ jsonResponse?: boolean;
134
+ }
135
+ export interface BranchSyncSummary {
136
+ packageKey: string;
137
+ branchName: string;
138
+ synced?: string[];
139
+ }
@@ -5,6 +5,14 @@ import { Configurator, IModule } from "../../core/command/module-handler";
5
5
  import { Context } from "../../core/command/cli-context";
6
6
  declare class Module extends IModule {
7
7
  register(context: Context, configurator: Configurator): void;
8
+ private setBranchSettings;
9
+ private createBranch;
10
+ private listBranches;
11
+ private deleteBranch;
12
+ private previewBranchMerge;
13
+ private applyBranchMerge;
14
+ private exportBranch;
15
+ private importBranch;
8
16
  private listPackages;
9
17
  private listStagingPackages;
10
18
  private batchExportPackages;
@@ -13,6 +21,7 @@ declare class Module extends IModule {
13
21
  private createPackageVersion;
14
22
  private batchImportPackages;
15
23
  private importSinglePackage;
24
+ private exportSinglePackage;
16
25
  private diffPackages;
17
26
  private validatePackage;
18
27
  private listVariables;
@@ -0,0 +1,8 @@
1
+ import { Context } from "../../core/command/cli-context";
2
+ export declare class SinglePackageExportService {
3
+ private readonly singlePackageExportApi;
4
+ private readonly gitService;
5
+ constructor(context: Context);
6
+ exportPackage(packageKey: string, zip: boolean, gitBranch: string): Promise<void>;
7
+ private exportToGitBranch;
8
+ }
@@ -1,12 +1,15 @@
1
+ import * as FormData from "form-data";
2
+ import * as AdmZip from "adm-zip";
1
3
  import { Context } from "../../core/command/cli-context";
2
4
  export declare class SinglePackageImportService {
3
5
  private static readonly MAX_UNCOMPRESSED_ZIP_SIZE;
4
6
  private readonly singlePackageImportApi;
7
+ private readonly gitService;
5
8
  constructor(context: Context);
6
- importPackage(file: string, directory: string, overwrite: boolean, jsonResponse: boolean): Promise<void>;
9
+ importPackage(file: string, directory: string, overwrite: boolean, jsonResponse: boolean, gitBranch: string): Promise<void>;
7
10
  private resolveSource;
8
- private buildBodyForImport;
9
- private assertUncompressedSizeWithinLimit;
10
- private getReadableStream;
11
+ static buildBodyForImport(packageZip: AdmZip, sourcePath: string): FormData;
12
+ static assertUncompressedSizeWithinLimit(packageZip: AdmZip, sourcePath: string): void;
13
+ private static getReadableStream;
11
14
  private outputResult;
12
15
  }
@@ -1,2 +1,16 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ import { Command } from "commander";
3
+ import { IModuleConstructor } from "./core/command/module-handler";
4
+ import { Context } from "./core/command/cli-context";
5
+ export interface CreateProgramOptions {
6
+ /**
7
+ * Explicit list of module classes to register. When provided, the factory
8
+ * skips automatic, filesystem-based module discovery.
9
+ */
10
+ modules?: IModuleConstructor[];
11
+ devMode?: boolean;
12
+ }
13
+ /**
14
+ * Build a fully-configured Commander program without parsing argv
15
+ */
16
+ export declare function createProgram(context: Context, opts?: CreateProgramOptions): Command;
@@ -24,8 +24,8 @@ type CommandHandler = (context: Context, command: Command, options: OptionValues
24
24
  * Allows the creation of root level commands.
25
25
  */
26
26
  export declare class Configurator {
27
- private program;
28
- private ctx;
27
+ private readonly program;
28
+ private readonly ctx;
29
29
  rootCommandMap: Map<string, CommandConfig>;
30
30
  constructor(program: Command, ctx: Context);
31
31
  /**
@@ -40,8 +40,8 @@ export declare class Configurator {
40
40
  * executed.
41
41
  */
42
42
  export declare class CommandConfig {
43
- private cmd;
44
- private ctx;
43
+ private readonly cmd;
44
+ private readonly ctx;
45
45
  private deprecationMessage;
46
46
  constructor(cmd: Command, ctx: Context);
47
47
  command(nameAndArgs: string, opts?: CommandOptions): CommandConfig;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Recognizes the backend's "feature not enabled" response so the CLI can surface a
3
+ * clear message instead of a raw error. Enforcement stays entirely in the backend
4
+ * (pacman); the CLI only translates the response — it never decides entitlement.
5
+ *
6
+ * The backend rejects a flag-gated request with 403 and a machine-readable body:
7
+ * {"errorCode":"feature-disabled", ...} (pacman's standard ErrorTransport). Keying
8
+ * off the stable code (rather than a free-text message) keeps this robust.
9
+ */
10
+ export declare const FEATURE_DISABLED_CODE = "feature-disabled";
11
+ /**
12
+ * True when the given error represents a backend "feature disabled" rejection.
13
+ * HttpClient rejects with the stringified response body (often wrapped as
14
+ * "FatalError: {json}"), so we extract and parse the embedded JSON payload.
15
+ */
16
+ export declare function isFeatureDisabledError(error: unknown): boolean;
@@ -1,4 +1,7 @@
1
1
  export declare class BranchUtils {
2
+ static readonly MAIN_BRANCH_KEY = "main";
2
3
  private static readonly BRANCH_SEPARATOR;
3
4
  static isBranchPackageKey(packageKey: string): boolean;
5
+ static constructBranchKey(projectKey: string, branchKey: string): string;
6
+ static extractProjectKey(packageKey: string): string;
4
7
  }
@@ -1,8 +1,12 @@
1
+ /// <reference types="node" />
1
2
  import AdmZip = require("adm-zip");
2
3
  export declare class FileService {
3
4
  static readonly fileDownloadedMessage = "File downloaded successfully. New filename: ";
4
5
  writeToFileWithGivenName(data: any, filename: string): void;
5
- readFileToJson<T>(fileName: string): Promise<T>;
6
+ writeBufferToFileWithGivenName(data: Buffer, filename: string): void;
7
+ extractZipBufferToDirectory(data: Buffer, targetDir: string): void;
8
+ extractZipBufferToTempDirectory(data: Buffer): string;
9
+ readFileToJson(fileName: string): any;
6
10
  readFile(filename: string): string;
7
11
  extractExportedZipWithNestedZips(zipFile: AdmZip): string;
8
12
  extractExportedZipWithNestedZipsToDir(zipFile: AdmZip, targetDir: string): string;
@@ -10,6 +14,7 @@ export declare class FileService {
10
14
  zipDirectoryInBatchExportFormat(sourceDir: string): string;
11
15
  zipDirectoryAsSinglePackage(sourceDir: string): string;
12
16
  private getSerializedFileContent;
17
+ private mkdirRecursive;
13
18
  private restrictFilePermissions;
14
19
  }
15
20
  export declare const fileService: FileService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celonis/content-cli",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "CLI Tool to help manage content in Celonis Platform",
5
5
  "main": "content-cli.js",
6
6
  "bin": {
@@ -18,17 +18,17 @@
18
18
  "node": ">=18.20.5"
19
19
  },
20
20
  "dependencies": {
21
- "adm-zip": "0.5.14",
21
+ "adm-zip": "0.6.0",
22
22
  "chalk": "4.1.2",
23
23
  "uuid": "9.0.1",
24
- "axios": "1.13.5",
24
+ "axios": "1.18.0",
25
25
  "commander": "13.1.0",
26
- "form-data": "4.0.4",
26
+ "form-data": "4.0.6",
27
27
  "openid-client": "5.6.1",
28
28
  "hpagent": "1.2.0",
29
29
  "@github/keytar": "7.10.6",
30
30
  "semver": "7.6.3",
31
- "simple-git": "3.32.3",
31
+ "simple-git": "3.36.0",
32
32
  "valid-url": "1.0.9",
33
33
  "winston": "3.17.0",
34
34
  "yaml": "2.8.3"