@celonis/content-cli 1.9.1 → 1.11.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 (43) hide show
  1. package/README.md +1 -1
  2. package/commands/action-flows/action-flow/action-flow.service.js +5 -4
  3. package/commands/asset-registry/asset-registry-api.js +16 -19
  4. package/commands/asset-registry/asset-registry-error.js +57 -0
  5. package/commands/asset-registry/asset-registry.service.js +86 -8
  6. package/commands/asset-registry/module.js +27 -5
  7. package/commands/configuration-management/api/batch-import-export-api.js +14 -2
  8. package/commands/configuration-management/api/node-api.js +31 -0
  9. package/commands/configuration-management/api/node-diff-api.js +15 -1
  10. package/commands/configuration-management/batch-import-export.service.js +30 -13
  11. package/commands/configuration-management/config-command.service.js +12 -10
  12. package/commands/configuration-management/module.js +57 -5
  13. package/commands/configuration-management/node-diff.service.js +40 -17
  14. package/commands/configuration-management/node.service.js +54 -0
  15. package/commands/configuration-management/studio.service.js +3 -2
  16. package/commands/studio/manager/widget.manager-factory.js +3 -2
  17. package/core/git-profile/git/git.service.js +4 -3
  18. package/core/git-profile/git-profile.service.js +5 -3
  19. package/core/http/http-shared/base.manager.js +4 -2
  20. package/core/profile/profile.service.js +5 -3
  21. package/core/utils/branches.js +23 -0
  22. package/core/utils/file-service.js +25 -8
  23. package/core/utils/file.constants.js +18 -0
  24. package/core/utils/logger.js +3 -2
  25. package/lib/commands/asset-registry/asset-registry-api.d.ts +3 -2
  26. package/lib/commands/asset-registry/asset-registry-error.d.ts +3 -0
  27. package/lib/commands/asset-registry/asset-registry.interfaces.d.ts +21 -1
  28. package/lib/commands/asset-registry/asset-registry.service.d.ts +7 -1
  29. package/lib/commands/asset-registry/module.d.ts +2 -1
  30. package/lib/commands/configuration-management/api/batch-import-export-api.d.ts +3 -2
  31. package/lib/commands/configuration-management/api/node-api.d.ts +4 -1
  32. package/lib/commands/configuration-management/api/node-diff-api.d.ts +2 -1
  33. package/lib/commands/configuration-management/batch-import-export.service.d.ts +5 -4
  34. package/lib/commands/configuration-management/config-command.service.d.ts +1 -1
  35. package/lib/commands/configuration-management/interfaces/node-diff.interfaces.d.ts +8 -0
  36. package/lib/commands/configuration-management/interfaces/node.interfaces.d.ts +20 -0
  37. package/lib/commands/configuration-management/module.d.ts +3 -0
  38. package/lib/commands/configuration-management/node-diff.service.d.ts +3 -0
  39. package/lib/commands/configuration-management/node.service.d.ts +4 -0
  40. package/lib/core/utils/branches.d.ts +4 -0
  41. package/lib/core/utils/file-service.d.ts +1 -0
  42. package/lib/core/utils/file.constants.d.ts +4 -0
  43. package/package.json +1 -1
@@ -0,0 +1,18 @@
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
+ exports.FileConstants = void 0;
13
+ var FileConstants;
14
+ (function (FileConstants) {
15
+ FileConstants[FileConstants["DEFAULT_FILE_PERMISSIONS"] = 384] = "DEFAULT_FILE_PERMISSIONS";
16
+ FileConstants[FileConstants["DEFAULT_FOLDER_PERMISSIONS"] = 448] = "DEFAULT_FOLDER_PERMISSIONS";
17
+ })(FileConstants || (exports.FileConstants = FileConstants = {}));
18
+ });
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "winston", "winston-transport", "os", "path", "fs"], factory);
7
+ define(["require", "exports", "winston", "winston-transport", "os", "path", "fs", "./file.constants"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
@@ -15,6 +15,7 @@
15
15
  const os = require("os");
16
16
  const path = require("path");
17
17
  const fs = require("fs");
18
+ const file_constants_1 = require("./file.constants");
18
19
  class CustomTransport extends Transport {
19
20
  constructor(opts) {
20
21
  super(opts);
@@ -43,7 +44,7 @@
43
44
  // --- Ensure log directory exists ---
44
45
  try {
45
46
  if (!fs.existsSync(logDir)) {
46
- fs.mkdirSync(logDir, { recursive: true });
47
+ fs.mkdirSync(logDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
47
48
  }
48
49
  }
49
50
  catch (error) {
@@ -1,11 +1,12 @@
1
1
  import { Context } from "../../core/command/cli-context";
2
- import { AssetRegistryDescriptor, AssetRegistryMetadata } from "./asset-registry.interfaces";
2
+ import { AgentSkillsResponse, AssetRegistryDescriptor, AssetRegistryMetadata } from "./asset-registry.interfaces";
3
3
  export declare class AssetRegistryApi {
4
4
  private httpClient;
5
5
  constructor(context: Context);
6
6
  listTypes(): Promise<AssetRegistryMetadata>;
7
+ listSkills(): Promise<AgentSkillsResponse>;
7
8
  getType(assetType: string): Promise<AssetRegistryDescriptor>;
8
9
  getSchema(assetType: string): Promise<any>;
9
10
  getExamples(assetType: string): Promise<any>;
10
- getMethodology(assetType: string): Promise<any>;
11
+ validate(assetType: string, body: any): Promise<any>;
11
12
  }
@@ -0,0 +1,3 @@
1
+ export declare const ASSET_REGISTRY_DISABLED_ERROR = "Asset registry feature is currently disabled";
2
+ export declare const ASSET_REGISTRY_DISABLED_USER_MESSAGE = "Asset registry is not enabled for this team. Contact your administrator to enable the feature.";
3
+ export declare function handleAssetRegistryApiError(operation: string, error: unknown): never;
@@ -20,11 +20,31 @@ export interface AssetService {
20
20
  export interface AssetEndpoints {
21
21
  schema: string;
22
22
  validate: string;
23
- methodology?: string;
24
23
  examples?: string;
24
+ skills?: string;
25
25
  }
26
26
  export interface AssetContributions {
27
27
  pigEntityTypes: string[];
28
28
  dataPipelineEntityTypes: string[];
29
29
  actionTypes: string[];
30
30
  }
31
+ export interface ValidateOptions {
32
+ assetType: string;
33
+ packageKey?: string;
34
+ nodeKey?: string;
35
+ configuration?: string;
36
+ file?: string;
37
+ json: boolean;
38
+ }
39
+ export interface AgentSkillMetadata {
40
+ version: string;
41
+ }
42
+ export interface AgentSkill {
43
+ name: string;
44
+ description: string;
45
+ path: string;
46
+ metadata: AgentSkillMetadata;
47
+ }
48
+ export interface AgentSkillsResponse {
49
+ skills: AgentSkill[];
50
+ }
@@ -1,13 +1,19 @@
1
+ import { ValidateOptions } from "./asset-registry.interfaces";
1
2
  import { Context } from "../../core/command/cli-context";
2
3
  export declare class AssetRegistryService {
3
4
  private api;
4
5
  constructor(context: Context);
5
6
  listTypes(jsonResponse: boolean): Promise<void>;
7
+ listSkills(jsonResponse: boolean): Promise<void>;
6
8
  getType(assetType: string, jsonResponse: boolean): Promise<void>;
7
9
  getSchema(assetType: string, jsonResponse: boolean): Promise<void>;
8
10
  getExamples(assetType: string, jsonResponse: boolean): Promise<void>;
9
- getMethodology(assetType: string, jsonResponse: boolean): Promise<void>;
11
+ validate(opts: ValidateOptions): Promise<void>;
12
+ private static readonly INLINE_VALIDATION_NODE_KEY;
13
+ private buildValidatePayload;
14
+ private parseJson;
10
15
  private outputResponse;
11
16
  private logDescriptorSummary;
17
+ private logSkillSummary;
12
18
  private logDescriptorDetail;
13
19
  }
@@ -5,7 +5,8 @@ declare class Module extends IModule {
5
5
  private listTypes;
6
6
  private getType;
7
7
  private getSchema;
8
+ private validate;
8
9
  private getExamples;
9
- private getMethodology;
10
+ private listSkills;
10
11
  }
11
12
  export = Module;
@@ -5,8 +5,9 @@ import { Context } from "../../../core/command/cli-context";
5
5
  export declare class BatchImportExportApi {
6
6
  private httpClient;
7
7
  constructor(context: Context);
8
- findAllActivePackages(flavors: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
9
- findActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<PackageExportTransport[]>;
8
+ findAllActivePackages(flavors: string[], withDependencies?: boolean, includeBranches?: boolean): Promise<PackageExportTransport[]>;
9
+ findAllStagingPackages(flavors: string[], includeBranches?: boolean): Promise<PackageExportTransport[]>;
10
+ findActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string, includeBranches?: boolean): Promise<PackageExportTransport[]>;
10
11
  findActivePackagesByKeys(packageKeys: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
11
12
  findPackagesByKeysAndVersion(packageKeysWithVersion: string[], withDependencies?: boolean): Promise<PackageExportTransport[]>;
12
13
  exportPackages(packageKeys: string[], withDependencies: boolean): Promise<Buffer>;
@@ -1,9 +1,12 @@
1
1
  import { Context } from "../../../core/command/cli-context";
2
- import { NodeTransport } from "../interfaces/node.interfaces";
2
+ import { NodeTransport, SaveNodeTransport, UpdateNodeTransport } from "../interfaces/node.interfaces";
3
3
  export declare class NodeApi {
4
4
  private httpClient;
5
5
  constructor(context: Context);
6
6
  findStagingNodeByKey(packageKey: string, nodeKey: string, withConfiguration: boolean): Promise<NodeTransport>;
7
7
  findVersionedNodeByKey(packageKey: string, nodeKey: string, version: string, withConfiguration: boolean): Promise<NodeTransport>;
8
+ createStagingNode(packageKey: string, transport: SaveNodeTransport, validateOnly: boolean): Promise<NodeTransport | void>;
9
+ updateStagingNode(packageKey: string, nodeKey: string, transport: UpdateNodeTransport, validateOnly: boolean): Promise<NodeTransport | void>;
10
+ archiveStagingNode(packageKey: string, nodeKey: string, force: boolean): Promise<void>;
8
11
  findVersionedNodesByPackage(packageKey: string, version: string, withConfiguration: boolean, limit: number, offset: number): Promise<NodeTransport[]>;
9
12
  }
@@ -1,7 +1,8 @@
1
1
  import { Context } from "../../../core/command/cli-context";
2
- import { GetNodeDiffRequest, NodeConfigurationDiffTransport } from "../interfaces/node-diff.interfaces";
2
+ import { GetNodeDiffRequest, GetNodeDiffWithFileRequest, NodeConfigurationDiffTransport } from "../interfaces/node-diff.interfaces";
3
3
  export declare class NodeDiffApi {
4
4
  private httpClient;
5
5
  constructor(context: Context);
6
6
  diff(request: GetNodeDiffRequest): Promise<NodeConfigurationDiffTransport>;
7
+ diffWithFile(request: GetNodeDiffWithFileRequest): Promise<NodeConfigurationDiffTransport>;
7
8
  }
@@ -5,14 +5,15 @@ export declare class BatchImportExportService {
5
5
  private studioService;
6
6
  private gitService;
7
7
  constructor(context: Context);
8
- listActivePackages(flavors: string[]): Promise<void>;
9
- findAndExportListOfPackages(flavors: string[], packageKeys: string[], keysByVersion: string[], withDependencies: boolean): Promise<void>;
8
+ listActivePackages(flavors: string[], includeBranches: boolean): Promise<void>;
9
+ listStagingPackages(flavors: string[], includeBranches: boolean, jsonResponse: boolean): Promise<void>;
10
+ findAndExportListOfPackages(flavors: string[], packageKeys: string[], keysByVersion: string[], withDependencies: boolean, includeBranches: boolean): Promise<void>;
10
11
  listPackagesByKeysWithVersion(keysByVersion: string[], withDependencies: boolean): Promise<void>;
11
12
  batchExportPackages(packageKeys: string[], packageKeysByVersion: string[], withDependencies: boolean, gitBranch: string, unzip: boolean): Promise<void>;
12
13
  batchExportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
13
14
  batchImportPackages(sourcePath: string, overwrite: boolean, gitBranch: string, performValidation?: boolean): Promise<void>;
14
- findAndExportListOfActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<void>;
15
- listActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string): Promise<void>;
15
+ findAndExportListOfActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string, includeBranches: boolean): Promise<void>;
16
+ listActivePackagesByVariableValue(flavors: string[], variableValue: string, variableType: string, includeBranches: boolean): Promise<void>;
16
17
  private exportListOfPackages;
17
18
  private getVersionsByPackageKey;
18
19
  private getVersionedVariablesForPackagesWithKeys;
@@ -4,7 +4,7 @@ export declare class ConfigCommandService {
4
4
  private variableService;
5
5
  private diffService;
6
6
  constructor(context: Context);
7
- listPackages(jsonResponse: boolean, flavors: string[], withDependencies: boolean, packageKeys: string[], keysByVersion: string[], variableValue: string, variableType: string): Promise<void>;
7
+ listPackages(jsonResponse: boolean, flavors: string[], withDependencies: boolean, packageKeys: string[], keysByVersion: string[], variableValue: string, variableType: string, includeBranches: boolean, staging: boolean): Promise<void>;
8
8
  listVariables(jsonResponse: boolean, keysByVersion: string[], keysByVersionFile: string, packageKeys: string[]): Promise<void>;
9
9
  batchExportPackages(packageKeys: string[], packageKeysByVersion: string[], withDependencies: boolean, gitBranch: string, unzip: boolean): Promise<void>;
10
10
  batchExportPackagesMetadata(packageKeys: string[], jsonResponse: boolean): Promise<void>;
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ import { ReadStream } from "node:fs";
1
3
  import { ConfigurationChangeTransport, NodeConfigurationChangeType } from "./diff-package.interfaces";
2
4
  export interface GetNodeDiffRequest {
3
5
  packageKey: string;
@@ -5,6 +7,12 @@ export interface GetNodeDiffRequest {
5
7
  baseVersion: string;
6
8
  compareVersion: string;
7
9
  }
10
+ export interface GetNodeDiffWithFileRequest {
11
+ packageKey: string;
12
+ nodeKey: string;
13
+ baseVersion: string;
14
+ file: ReadStream;
15
+ }
8
16
  export interface NodeConfigurationDiffTransport {
9
17
  packageKey: string;
10
18
  nodeKey: string;
@@ -19,3 +19,23 @@ export interface NodeTransport {
19
19
  schemaVersion: number;
20
20
  flavor?: string;
21
21
  }
22
+ export interface SaveNodeTransport {
23
+ key: string;
24
+ name: string;
25
+ parentNodeKey: string;
26
+ type: string;
27
+ configuration?: NodeConfiguration;
28
+ invalidConfiguration?: string;
29
+ invalidContent?: boolean;
30
+ schemaVersion?: number;
31
+ [key: string]: any;
32
+ }
33
+ export interface UpdateNodeTransport {
34
+ name: string;
35
+ parentNodeKey: string;
36
+ configuration?: NodeConfiguration;
37
+ invalidConfiguration?: string;
38
+ invalidContent?: boolean;
39
+ schemaVersion?: number;
40
+ [key: string]: any;
41
+ }
@@ -16,6 +16,9 @@ declare class Module extends IModule {
16
16
  private listVariables;
17
17
  private listAssignments;
18
18
  private findNode;
19
+ private createNode;
20
+ private updateNode;
21
+ private archiveNode;
19
22
  private listNodes;
20
23
  private diffNode;
21
24
  private listNodeDependencies;
@@ -3,4 +3,7 @@ export declare class NodeDiffService {
3
3
  private nodeDiffApi;
4
4
  constructor(context: Context);
5
5
  diff(packageKey: string, nodeKey: string, baseVersion: string, compareVersion: string, jsonResponse: boolean): Promise<void>;
6
+ diffWithFile(packageKey: string, nodeKey: string, baseVersion: string, file: string, jsonResponse: boolean): Promise<void>;
7
+ private exportDiffAsJson;
8
+ private logDiff;
6
9
  }
@@ -4,5 +4,9 @@ export declare class NodeService {
4
4
  constructor(context: Context);
5
5
  findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, packageVersion: string | null, jsonResponse: boolean): Promise<void>;
6
6
  listNodes(packageKey: string, packageVersion: string, limit: number, offset: number, withConfiguration: boolean, jsonResponse: boolean): Promise<void>;
7
+ createNode(packageKey: string, body: string | undefined, file: string | undefined, validateOnly: boolean, jsonResponse: boolean): Promise<void>;
8
+ updateNode(packageKey: string, nodeKey: string, body: string | undefined, file: string | undefined, validateOnly: boolean, jsonResponse: boolean): Promise<void>;
9
+ archiveNode(packageKey: string, nodeKey: string, force: boolean): Promise<void>;
10
+ private static resolveBody;
7
11
  private printNode;
8
12
  }
@@ -0,0 +1,4 @@
1
+ export declare class BranchUtils {
2
+ private static readonly BRANCH_SEPARATOR;
3
+ static isBranchPackageKey(packageKey: string): boolean;
4
+ }
@@ -9,5 +9,6 @@ export declare class FileService {
9
9
  isDirectory(sourcePath: string): boolean;
10
10
  zipDirectoryInBatchExportFormat(sourceDir: string): string;
11
11
  private getSerializedFileContent;
12
+ private restrictFilePermissions;
12
13
  }
13
14
  export declare const fileService: FileService;
@@ -0,0 +1,4 @@
1
+ export declare enum FileConstants {
2
+ DEFAULT_FILE_PERMISSIONS = 384,
3
+ DEFAULT_FOLDER_PERMISSIONS = 448
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celonis/content-cli",
3
- "version": "1.9.1",
3
+ "version": "1.11.0",
4
4
  "description": "CLI Tool to help manage content in Celonis Platform",
5
5
  "main": "content-cli.js",
6
6
  "bin": {