@celonis/content-cli 1.14.0 → 1.15.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 (73) hide show
  1. package/commands/action-flows/action-flow/action-flow.service.js +9 -9
  2. package/commands/asset-registry/asset-registry-api.js +0 -7
  3. package/commands/asset-registry/asset-registry.service.js +18 -63
  4. package/commands/asset-registry/module.js +0 -21
  5. package/commands/bookmarks/bookmarks-command.service.js +5 -3
  6. package/commands/configuration-management/api/node-api.js +17 -0
  7. package/commands/configuration-management/branch/branch-export-import.command.service.js +31 -24
  8. package/commands/configuration-management/branch/branch.command.service.js +14 -10
  9. package/commands/configuration-management/metadata.service.js +9 -5
  10. package/commands/configuration-management/module.js +6 -5
  11. package/commands/configuration-management/node-dependency.service.js +5 -3
  12. package/commands/configuration-management/node-diff.service.js +10 -6
  13. package/commands/configuration-management/node.service.js +14 -10
  14. package/commands/configuration-management/package-validation.service.js +11 -5
  15. package/commands/configuration-management/package-version.service.js +7 -5
  16. package/commands/configuration-management/single-package-export.service.js +6 -6
  17. package/commands/configuration-management/single-package-import.service.js +22 -18
  18. package/commands/configuration-management/staging-package.service.js +9 -5
  19. package/commands/configuration-management/variable.service.js +11 -7
  20. package/commands/data-pipeline/data-pool/data-pool-service.js +13 -9
  21. package/commands/deployment/deployment.service.js +15 -13
  22. package/commands/git-profile/module.js +2 -1
  23. package/commands/profile/module.js +2 -1
  24. package/commands/studio/manager/space.manager.js +21 -10
  25. package/commands/studio/service/asset-service.js +5 -4
  26. package/commands/studio/service/package.service.js +9 -5
  27. package/commands/t2tc/diff.service.js +15 -9
  28. package/commands/t2tc/t2tc-package.service.js +25 -23
  29. package/content-cli.js +10 -2
  30. package/core/command/module-handler.js +14 -1
  31. package/core/http/http-client.js +24 -3
  32. package/core/http/http-shared/base.manager.js +35 -59
  33. package/core/profile/profile.service.js +35 -21
  34. package/core/profile/profile.validator.js +19 -9
  35. package/core/utils/cui-api.js +52 -0
  36. package/core/utils/cui-file-service.js +106 -0
  37. package/core/utils/file-service.js +7 -6
  38. package/lib/commands/action-flows/action-flow/action-flow.service.d.ts +1 -0
  39. package/lib/commands/asset-registry/asset-registry-api.d.ts +0 -1
  40. package/lib/commands/asset-registry/asset-registry.interfaces.d.ts +0 -8
  41. package/lib/commands/asset-registry/asset-registry.service.d.ts +1 -5
  42. package/lib/commands/asset-registry/module.d.ts +0 -1
  43. package/lib/commands/bookmarks/bookmarks-command.service.d.ts +1 -0
  44. package/lib/commands/configuration-management/api/node-api.d.ts +1 -0
  45. package/lib/commands/configuration-management/branch/branch-export-import.command.service.d.ts +2 -1
  46. package/lib/commands/configuration-management/branch/branch.command.service.d.ts +2 -1
  47. package/lib/commands/configuration-management/interfaces/package-validation.interfaces.d.ts +1 -1
  48. package/lib/commands/configuration-management/metadata.service.d.ts +1 -0
  49. package/lib/commands/configuration-management/node-dependency.service.d.ts +1 -0
  50. package/lib/commands/configuration-management/node-diff.service.d.ts +1 -0
  51. package/lib/commands/configuration-management/node.service.d.ts +2 -1
  52. package/lib/commands/configuration-management/package-validation.service.d.ts +1 -0
  53. package/lib/commands/configuration-management/package-version.service.d.ts +1 -0
  54. package/lib/commands/configuration-management/single-package-export.service.d.ts +1 -0
  55. package/lib/commands/configuration-management/single-package-import.service.d.ts +1 -0
  56. package/lib/commands/configuration-management/staging-package.service.d.ts +1 -0
  57. package/lib/commands/configuration-management/variable.service.d.ts +1 -0
  58. package/lib/commands/data-pipeline/data-pool/data-pool-service.d.ts +1 -0
  59. package/lib/commands/deployment/deployment.service.d.ts +1 -0
  60. package/lib/commands/studio/service/asset-service.d.ts +1 -0
  61. package/lib/commands/studio/service/package.service.d.ts +1 -0
  62. package/lib/commands/t2tc/diff.service.d.ts +1 -0
  63. package/lib/commands/t2tc/t2tc-package.service.d.ts +1 -0
  64. package/lib/content-cli.d.ts +1 -0
  65. package/lib/core/command/module-handler.d.ts +2 -0
  66. package/lib/core/http/http-client.d.ts +4 -0
  67. package/lib/core/http/http-shared/base.manager.d.ts +7 -5
  68. package/lib/core/http/http-shared/manager-config.interface.d.ts +1 -1
  69. package/lib/core/profile/profile.service.d.ts +2 -0
  70. package/lib/core/profile/profile.validator.d.ts +3 -0
  71. package/lib/core/utils/cui-api.d.ts +26 -0
  72. package/lib/core/utils/cui-file-service.d.ts +19 -0
  73. package/package.json +1 -1
@@ -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
  }
@@ -10,6 +10,7 @@ export declare class ProfileService {
10
10
  makeDefaultProfile(profileName: string): Promise<Profile>;
11
11
  getDefaultProfile(): string;
12
12
  storeProfile(profile: Profile): Promise<void>;
13
+ private selectEnvProfileSource;
13
14
  private buildProfileFromEnvVariables;
14
15
  private storeConfig;
15
16
  private createProfileContainerIfNotExists;
@@ -18,6 +19,7 @@ export declare class ProfileService {
18
19
  getAllFilesInDirectory(): string[];
19
20
  authorizeProfile(profile: Profile): Promise<void>;
20
21
  refreshProfile(profile: Profile): Promise<void>;
22
+ private unrefreshableProfile;
21
23
  private getProfileEnvVariables;
22
24
  private getBaseTeamUrl;
23
25
  private isProfileExpired;
@@ -1,4 +1,7 @@
1
1
  import { Profile } from "./profile.interface";
2
2
  export declare class ProfileValidator {
3
3
  static validateProfile(profile: Profile): Promise<any>;
4
+ static validateEnvironmentProfile(profile: Profile): void;
5
+ private static validateIdentity;
6
+ private static validateTeamUrl;
4
7
  }
@@ -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.15.0",
4
4
  "description": "CLI Tool to help manage content in Celonis Platform",
5
5
  "main": "content-cli.js",
6
6
  "bin": {