@celonis/content-cli 0.13.5 → 1.0.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.
- package/README.md +13 -6
- package/{api → commands/action-flows/action-flow}/action-flow-api.js +10 -9
- package/commands/{action-flow.command.js → action-flows/action-flow/action-flow-command.service.js} +11 -8
- package/{services/action-flow/action-flow-service.js → commands/action-flows/action-flow/action-flow.service.js} +12 -10
- package/commands/action-flows/module.js +88 -0
- package/commands/{skill.command.js → action-flows/skill/skill-command.service.js} +9 -11
- package/{content/factory/skill-manager.factory.js → commands/action-flows/skill/skill.manager-factory.js} +7 -4
- package/{content/manager → commands/action-flows/skill}/skill.manager.js +7 -4
- package/commands/analysis/analysis-bookmarks-command.service.js +39 -0
- package/{content/factory/analysis-bookmarks-manager.factory.js → commands/analysis/analysis-bookmarks.manager-factory.js} +7 -4
- package/{content/manager → commands/analysis}/analysis-bookmarks.manager.js +8 -5
- package/commands/analysis/module.js +52 -0
- package/commands/configuration-management/api/batch-import-export-api.js +84 -0
- package/{api → commands/configuration-management/api}/diff-api.js +8 -7
- package/commands/configuration-management/api/variable-assignment-candidates-api.js +41 -0
- package/{services/package-manager/batch-import-export-service.js → commands/configuration-management/batch-import-export.service.js} +31 -26
- package/commands/{config.command.js → configuration-management/config-command.service.js} +21 -16
- package/{services/package-manager/diff-service.js → commands/configuration-management/diff.service.js} +11 -8
- package/commands/configuration-management/module.js +102 -0
- package/{services/studio → commands/configuration-management}/studio.service.js +33 -24
- package/commands/{variable.command.js → configuration-management/variable-command.service.js} +10 -7
- package/{services/package-manager/variable-service.js → commands/configuration-management/variable.service.js} +36 -42
- package/commands/{ctp.command.js → cpm4/ctp-command.service.js} +11 -13
- package/{content/manager → commands/cpm4}/ctp.analysis.manager.js +3 -0
- package/{content/manager → commands/cpm4}/ctp.datamodel.manager.js +2 -2
- package/{content/factory/ctp-manager.factory.js → commands/cpm4/ctp.manager-factory.js} +9 -6
- package/{content/manager → commands/cpm4}/ctp.manager.js +6 -4
- package/commands/cpm4/module.js +46 -0
- package/commands/{connection.command.js → data-pipeline/connection/connection-command.service.js} +14 -11
- package/commands/data-pipeline/connection/connection.commands.js +65 -0
- package/{services → commands/data-pipeline}/connection/connection.service.js +18 -15
- package/{api → commands/data-pipeline/data-pool}/data-pool-api.js +14 -13
- package/commands/{data-pool.command.js → data-pipeline/data-pool/data-pool-command.service.js} +25 -23
- package/{content/factory → commands/data-pipeline/data-pool}/data-pool-manager.factory.js +9 -6
- package/{services → commands/data-pipeline}/data-pool/data-pool-service.js +13 -10
- package/commands/data-pipeline/data-pool/data-pool.commands.js +99 -0
- package/{content/manager → commands/data-pipeline/data-pool}/data-pool.manager.js +8 -9
- package/commands/data-pipeline/module.js +24 -0
- package/commands/profile/module.js +60 -0
- package/commands/profile/profile-command.service.js +94 -0
- package/{api → commands/studio/api}/asset-api.js +8 -7
- package/{api → commands/studio/api}/compute-pool-api.js +7 -6
- package/{api → commands/studio/api}/node-api.js +9 -8
- package/{api → commands/studio/api}/package-api.js +18 -17
- package/{api → commands/studio/api}/package-dependencies-api.js +12 -11
- package/{api → commands/studio/api}/space-api.js +10 -9
- package/commands/{analysis-bookmarks.command.js → studio/api/studio-variables-api.js} +18 -13
- package/commands/{asset.command.js → studio/command-service/asset-command.service.js} +21 -19
- package/commands/{package.command.js → studio/command-service/package-command.service.js} +22 -20
- package/commands/{space.command.js → studio/command-service/space-command.service.js} +9 -11
- package/commands/studio/command-service/widget.command.js +56 -0
- package/{content/factory/asset-manager.factory.js → commands/studio/manager/asset.manager-factory.js} +7 -4
- package/{content → commands/studio}/manager/asset.manager.js +8 -5
- package/{content/factory/package-manager.factory.js → commands/studio/manager/package.manager-factory.js} +7 -4
- package/{content → commands/studio}/manager/package.manager.js +9 -6
- package/{content/factory/space-manager.factory.js → commands/studio/manager/space.manager-factory.js} +6 -3
- package/{content → commands/studio}/manager/space.manager.js +7 -4
- package/{content/factory/widget-manager.factory.js → commands/studio/manager/widget.manager-factory.js} +8 -5
- package/{content → commands/studio}/manager/widget.manager.js +5 -5
- package/commands/studio/module.js +169 -0
- package/{services/package-manager → commands/studio/service}/asset-service.js +10 -9
- package/{services/package-manager/datamodel-service.js → commands/studio/service/data-model.service.js} +8 -6
- package/{services/package-manager/package-service.js → commands/studio/service/package.service.js} +59 -49
- package/{services/package-manager/space-service.js → commands/studio/service/space.service.js} +9 -9
- package/commands/studio/service/studio-variable.service.js +41 -0
- package/content-cli.js +69 -20
- package/core/command/cli-context.js +69 -0
- package/core/command/module-handler.js +200 -0
- package/core/http/base-api.js +115 -0
- package/{services/http-client-service.v2.js → core/http/http-client.js} +39 -24
- package/{services/context.service.js → core/http/http-shared/base.manager.helper.js} +6 -16
- package/{content/manager → core/http/http-shared}/base.manager.js +14 -21
- package/{services → core/profile}/profile.service.js +11 -5
- package/{validators → core/profile}/profile.validator.js +3 -3
- package/{services → core/utils}/file-service.js +2 -7
- package/core/utils/logger.js +102 -0
- package/{services → core/utils}/question.service.js +18 -7
- package/{util → core/utils}/version.js +1 -1
- package/lib/{api → commands/action-flows/action-flow}/action-flow-api.d.ts +4 -4
- package/lib/commands/{action-flow.command.d.ts → action-flows/action-flow/action-flow-command.service.d.ts} +4 -1
- package/lib/{services/action-flow/action-flow-service.d.ts → commands/action-flows/action-flow/action-flow.service.d.ts} +4 -4
- package/lib/commands/action-flows/module.d.ts +14 -0
- package/lib/commands/{skill.command.d.ts → action-flows/skill/skill-command.service.d.ts} +3 -2
- package/lib/commands/action-flows/skill/skill.manager-factory.d.ts +8 -0
- package/lib/{content/manager → commands/action-flows/skill}/skill.manager.d.ts +4 -2
- package/lib/commands/analysis/analysis-bookmarks-command.service.d.ts +7 -0
- package/lib/commands/analysis/analysis-bookmarks.manager-factory.d.ts +8 -0
- package/lib/{content/manager → commands/analysis}/analysis-bookmarks.manager.d.ts +4 -2
- package/lib/commands/analysis/module.d.ts +11 -0
- package/lib/{api → commands/configuration-management/api}/batch-import-export-api.d.ts +5 -5
- package/lib/{api → commands/configuration-management/api}/diff-api.d.ts +5 -5
- package/lib/commands/configuration-management/api/variable-assignment-candidates-api.d.ts +8 -0
- package/lib/{services/package-manager/batch-import-export-service.d.ts → commands/configuration-management/batch-import-export.service.d.ts} +6 -3
- package/lib/commands/{config.command.d.ts → configuration-management/config-command.service.d.ts} +6 -1
- package/lib/{services/package-manager/diff-service.d.ts → commands/configuration-management/diff.service.d.ts} +4 -3
- package/lib/{interfaces/package-export-transport.d.ts → commands/configuration-management/interfaces/package-export.interfaces.d.ts} +2 -2
- package/lib/{api/variable-assignment-apis.d.ts → commands/configuration-management/interfaces/variable-assignment-apis.constants.d.ts} +3 -1
- package/lib/commands/configuration-management/module.d.ts +15 -0
- package/lib/{services/studio → commands/configuration-management}/studio.service.d.ts +12 -5
- package/lib/commands/configuration-management/variable-command.service.d.ts +6 -0
- package/lib/{services/package-manager/variable-service.d.ts → commands/configuration-management/variable.service.d.ts} +8 -8
- package/lib/commands/cpm4/ctp-command.service.d.ts +7 -0
- package/lib/{content/manager → commands/cpm4}/ctp.analysis.manager.d.ts +2 -0
- package/lib/{content/manager → commands/cpm4}/ctp.datamodel.manager.d.ts +2 -1
- package/lib/{content/factory/ctp-manager.factory.d.ts → commands/cpm4/ctp.manager-factory.d.ts} +4 -1
- package/lib/{content/manager → commands/cpm4}/ctp.manager.d.ts +4 -2
- package/lib/commands/cpm4/module.d.ts +10 -0
- package/lib/commands/data-pipeline/connection/connection-command.service.d.ts +8 -0
- package/lib/commands/data-pipeline/connection/connection.commands.d.ts +11 -0
- package/lib/{services → commands/data-pipeline}/connection/connection.service.d.ts +4 -3
- package/lib/{api → commands/data-pipeline/data-pool}/data-pool-api.d.ts +5 -5
- package/lib/commands/data-pipeline/data-pool/data-pool-command.service.d.ts +14 -0
- package/lib/commands/data-pipeline/data-pool/data-pool-manager.factory.d.ts +9 -0
- package/lib/{services → commands/data-pipeline}/data-pool/data-pool-service.d.ts +4 -3
- package/lib/commands/data-pipeline/data-pool/data-pool.commands.d.ts +15 -0
- package/lib/{content/manager → commands/data-pipeline/data-pool}/data-pool.manager.d.ts +4 -2
- package/lib/commands/data-pipeline/module.d.ts +9 -0
- package/lib/commands/profile/module.d.ts +12 -0
- package/lib/commands/{profile.command.d.ts → profile/profile-command.service.d.ts} +1 -1
- package/lib/{api → commands/studio/api}/asset-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/compute-pool-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/node-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/package-api.d.ts +4 -4
- package/lib/{api → commands/studio/api}/package-dependencies-api.d.ts +4 -4
- package/lib/commands/studio/api/space-api.d.ts +9 -0
- package/lib/commands/studio/api/studio-variables-api.d.ts +8 -0
- package/lib/commands/studio/command-service/asset-command.service.d.ts +11 -0
- package/lib/commands/{package.command.d.ts → studio/command-service/package-command.service.d.ts} +8 -5
- package/lib/commands/studio/command-service/space-command.service.d.ts +6 -0
- package/lib/commands/studio/command-service/widget.command.d.ts +7 -0
- package/lib/{interfaces/batch-export-node-transport.d.ts → commands/studio/interfaces/batch-export-node.interfaces.d.ts} +1 -9
- package/lib/{content/factory/asset-manager.factory.d.ts → commands/studio/manager/asset.manager-factory.d.ts} +4 -1
- package/lib/{content → commands/studio}/manager/asset.manager.d.ts +4 -2
- package/lib/{content/factory/package-manager.factory.d.ts → commands/studio/manager/package.manager-factory.d.ts} +4 -1
- package/lib/{content → commands/studio}/manager/package.manager.d.ts +4 -2
- package/lib/commands/studio/manager/space.manager-factory.d.ts +8 -0
- package/lib/{content → commands/studio}/manager/space.manager.d.ts +4 -2
- package/lib/{content/factory/widget-manager.factory.d.ts → commands/studio/manager/widget.manager-factory.d.ts} +10 -7
- package/lib/{content → commands/studio}/manager/widget.manager.d.ts +4 -2
- package/lib/commands/studio/module.d.ts +21 -0
- package/lib/{services/package-manager → commands/studio/service}/asset-service.d.ts +4 -3
- package/lib/{services/package-manager/datamodel-service.d.ts → commands/studio/service/data-model.service.d.ts} +5 -5
- package/lib/{services/package-manager/package-service.d.ts → commands/studio/service/package.service.d.ts} +13 -6
- package/lib/commands/studio/service/space.service.d.ts +11 -0
- package/lib/commands/studio/service/studio-variable.service.d.ts +9 -0
- package/lib/core/command/cli-context.d.ts +17 -0
- package/lib/core/command/module-handler.d.ts +57 -0
- package/lib/core/http/base-api.d.ts +32 -0
- package/lib/{services/http-client-service.v2.d.ts → core/http/http-client.d.ts} +8 -3
- package/lib/{content/manager → core/http/http-shared}/base.manager.d.ts +4 -6
- package/lib/core/http/http-shared/base.manager.helper.d.ts +4 -0
- package/lib/{services → core/profile}/profile.service.d.ts +2 -1
- package/lib/{validators → core/profile}/profile.validator.d.ts +1 -1
- package/lib/{services → core/utils}/file-service.d.ts +0 -2
- package/lib/core/utils/question.service.d.ts +10 -0
- package/package.json +3 -3
- package/api/batch-import-export-api.js +0 -62
- package/api/variables-api.js +0 -56
- package/commands/profile.command.js +0 -88
- package/commands/widget.command.js +0 -36
- package/content-cli-analyze.js +0 -56
- package/content-cli-config.js +0 -119
- package/content-cli-export.js +0 -90
- package/content-cli-get.js +0 -52
- package/content-cli-import.js +0 -93
- package/content-cli-list.js +0 -129
- package/content-cli-profile.js +0 -64
- package/content-cli-pull.js +0 -104
- package/content-cli-push.js +0 -196
- package/content-cli-set.js +0 -55
- package/content-cli-update.js +0 -44
- package/interfaces/variable-assignment-api.interface.js +0 -12
- package/lib/api/space-api.d.ts +0 -9
- package/lib/api/variables-api.d.ts +0 -14
- package/lib/commands/analysis-bookmarks.command.d.ts +0 -6
- package/lib/commands/asset.command.d.ts +0 -8
- package/lib/commands/connection.command.d.ts +0 -5
- package/lib/commands/ctp.command.d.ts +0 -6
- package/lib/commands/data-pool.command.d.ts +0 -11
- package/lib/commands/space.command.d.ts +0 -5
- package/lib/commands/variable.command.d.ts +0 -3
- package/lib/commands/widget.command.d.ts +0 -5
- package/lib/content/factory/analysis-bookmarks-manager.factory.d.ts +0 -5
- package/lib/content/factory/data-pool-manager.factory.d.ts +0 -6
- package/lib/content/factory/skill-manager.factory.d.ts +0 -5
- package/lib/content/factory/space-manager.factory.d.ts +0 -5
- package/lib/content-cli-analyze.d.ts +0 -1
- package/lib/content-cli-config.d.ts +0 -8
- package/lib/content-cli-export.d.ts +0 -6
- package/lib/content-cli-get.d.ts +0 -1
- package/lib/content-cli-import.d.ts +0 -6
- package/lib/content-cli-list.d.ts +0 -9
- package/lib/content-cli-profile.d.ts +0 -1
- package/lib/content-cli-pull.d.ts +0 -1
- package/lib/content-cli-push.d.ts +0 -1
- package/lib/content-cli-set.d.ts +0 -1
- package/lib/content-cli-update.d.ts +0 -1
- package/lib/interfaces/variable-assignment-api.interface.d.ts +0 -3
- package/lib/services/command.service.d.ts +0 -6
- package/lib/services/content.service.d.ts +0 -11
- package/lib/services/context.service.d.ts +0 -13
- package/lib/services/http-client.service.d.ts +0 -15
- package/lib/services/package-manager/space-service.d.ts +0 -11
- package/lib/services/question.service.d.ts +0 -4
- package/lib/util/context-initializer.d.ts +0 -3
- package/lib/util/program.d.ts +0 -2
- package/services/command.service.js +0 -24
- package/services/content.service.js +0 -130
- package/services/http-client.service.js +0 -157
- package/util/context-initializer.js +0 -39
- package/util/logger.js +0 -49
- package/util/program.js +0 -16
- /package/{interfaces/batch-export-import-constants.js → commands/configuration-management/interfaces/batch-export-import.constants.js} +0 -0
- /package/{interfaces/diff-package.transport.js → commands/configuration-management/interfaces/diff-package.interfaces.js} +0 -0
- /package/{interfaces/batch-export-node-transport.js → commands/configuration-management/interfaces/package-export.interfaces.js} +0 -0
- /package/{api/variable-assignment-apis.js → commands/configuration-management/interfaces/variable-assignment-apis.constants.js} +0 -0
- /package/{interfaces → commands/data-pipeline/data-pool}/data-pool-manager.interfaces.js +0 -0
- /package/{interfaces/manager-config.interface.js → commands/studio/interfaces/batch-export-node.interfaces.js} +0 -0
- /package/{interfaces/manifest-transport.js → commands/studio/interfaces/manifest.interface.js} +0 -0
- /package/{interfaces → commands/studio/interfaces}/package-manager.interfaces.js +0 -0
- /package/{interfaces → commands/studio/interfaces}/save-content-node.interface.js +0 -0
- /package/{interfaces/package-export-transport.js → commands/studio/interfaces/space.interface.js} +0 -0
- /package/{util → commands/studio/utils}/semantic-versioning.js +0 -0
- /package/{util → core/http}/axios-initializer.js +0 -0
- /package/{interfaces/save-space.interface.js → core/http/http-shared/manager-config.interface.js} +0 -0
- /package/{util → core/http}/tracing.js +0 -0
- /package/{interfaces → core/profile}/profile.interface.js +0 -0
- /package/{util → core/utils}/json.js +0 -0
- /package/{util → core/utils}/yaml.js +0 -0
- /package/lib/{interfaces/batch-export-import-constants.d.ts → commands/configuration-management/interfaces/batch-export-import.constants.d.ts} +0 -0
- /package/lib/{interfaces/diff-package.transport.d.ts → commands/configuration-management/interfaces/diff-package.interfaces.d.ts} +0 -0
- /package/lib/{interfaces → commands/data-pipeline/data-pool}/data-pool-manager.interfaces.d.ts +0 -0
- /package/lib/{interfaces/manifest-transport.d.ts → commands/studio/interfaces/manifest.interface.d.ts} +0 -0
- /package/lib/{interfaces → commands/studio/interfaces}/package-manager.interfaces.d.ts +0 -0
- /package/lib/{interfaces → commands/studio/interfaces}/save-content-node.interface.d.ts +0 -0
- /package/lib/{interfaces/save-space.interface.d.ts → commands/studio/interfaces/space.interface.d.ts} +0 -0
- /package/lib/{util → commands/studio/utils}/semantic-versioning.d.ts +0 -0
- /package/lib/{util → core/http}/axios-initializer.d.ts +0 -0
- /package/lib/{interfaces → core/http/http-shared}/manager-config.interface.d.ts +0 -0
- /package/lib/{util → core/http}/tracing.d.ts +0 -0
- /package/lib/{interfaces → core/profile}/profile.interface.d.ts +0 -0
- /package/lib/{util → core/utils}/json.d.ts +0 -0
- /package/lib/{util → core/utils}/logger.d.ts +0 -0
- /package/lib/{util → core/utils}/version.d.ts +0 -0
- /package/lib/{util → core/utils}/yaml.d.ts +0 -0
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as FormData from "form-data";
|
|
2
|
-
|
|
2
|
+
import { Context } from "../command/cli-context";
|
|
3
|
+
/**
|
|
4
|
+
* Http client configured based upon the CLI context. It will authenticate
|
|
5
|
+
* based on the profile in the context and also use the base URL accordingly.
|
|
6
|
+
*/
|
|
7
|
+
export declare class HttpClient {
|
|
8
|
+
private context;
|
|
3
9
|
private axios;
|
|
10
|
+
constructor(context: Context);
|
|
4
11
|
get(url: string): Promise<any>;
|
|
5
12
|
getFile(url: string): Promise<any>;
|
|
6
13
|
postFile(url: string, formData: FormData, parameters?: {}): Promise<any>;
|
|
@@ -17,5 +24,3 @@ declare class HttpClientServiceV2 {
|
|
|
17
24
|
private buildHeaders;
|
|
18
25
|
private buildAuthorizationHeaders;
|
|
19
26
|
}
|
|
20
|
-
export declare const httpClientV2: HttpClientServiceV2;
|
|
21
|
-
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ManagerConfig } from "./manager-config.interface";
|
|
2
|
+
import { Context } from "../../command/cli-context";
|
|
3
3
|
export declare abstract class BaseManager {
|
|
4
|
-
private
|
|
5
|
-
get profile(): Profile;
|
|
6
|
-
set profile(value: Profile);
|
|
7
|
-
private _profile;
|
|
4
|
+
private httpClient;
|
|
8
5
|
protected readonly fileDownloadedMessage = "File downloaded successfully. New filename: ";
|
|
6
|
+
protected constructor(context: Context);
|
|
9
7
|
pull(): Promise<any>;
|
|
10
8
|
pullFile(): Promise<any>;
|
|
11
9
|
push(): Promise<any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Profile } from "
|
|
1
|
+
import { Profile } from "./profile.interface";
|
|
2
2
|
export interface Config {
|
|
3
3
|
defaultProfile: string;
|
|
4
4
|
}
|
|
@@ -21,5 +21,6 @@ export declare class ProfileService {
|
|
|
21
21
|
private getBaseTeamUrl;
|
|
22
22
|
private isProfileExpired;
|
|
23
23
|
private tryKeyAuthentication;
|
|
24
|
+
private checkIfMissingProfile;
|
|
24
25
|
}
|
|
25
26
|
export declare const profileService: ProfileService;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ManifestNodeTransport } from "../interfaces/manifest-transport";
|
|
2
1
|
export declare class FileService {
|
|
3
2
|
static readonly fileDownloadedMessage = "File downloaded successfully. New filename: ";
|
|
4
3
|
writeToFileWithGivenName(data: any, filename: string): void;
|
|
5
4
|
createDirectoryWithGivenName(dirName: string): void;
|
|
6
|
-
readManifestFile(importedFileName: string): Promise<ManifestNodeTransport[]>;
|
|
7
5
|
readFileToJson<T>(fileName: string): Promise<T>;
|
|
8
6
|
readFile(filename: string): string;
|
|
9
7
|
private getSerializedFileContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple method to get input from the user/console using ReadLine. The
|
|
3
|
+
* class must be closed in order to avoid the CLI to not terminate properly.
|
|
4
|
+
*/
|
|
5
|
+
export declare class QuestionService {
|
|
6
|
+
private readLine;
|
|
7
|
+
constructor();
|
|
8
|
+
ask(question: string): Promise<string>;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celonis/content-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "CLI Tool to help manage content in Celonis EMS",
|
|
5
5
|
"main": "content-cli.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"content-cli": "./content-cli.js"
|
|
7
|
+
"content-cli": "./dist/content-cli.js"
|
|
8
8
|
},
|
|
9
9
|
"author": "Celonis SE",
|
|
10
10
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@datadog/datadog-ci": "2.48.0",
|
|
22
22
|
"adm-zip": "0.5.14",
|
|
23
|
-
"axios": "1.
|
|
23
|
+
"axios": "1.8.4",
|
|
24
24
|
"commander": "13.1.0",
|
|
25
25
|
"form-data": "4.0.1",
|
|
26
26
|
"openid-client": "5.6.1",
|
|
@@ -1,62 +0,0 @@
|
|
|
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", "../services/http-client-service.v2", "../util/logger"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.batchImportExportApi = void 0;
|
|
13
|
-
const http_client_service_v2_1 = require("../services/http-client-service.v2");
|
|
14
|
-
const logger_1 = require("../util/logger");
|
|
15
|
-
class BatchImportExportApi {
|
|
16
|
-
findAllActivePackages(flavors, withDependencies = false) {
|
|
17
|
-
const queryParams = new URLSearchParams();
|
|
18
|
-
queryParams.set("withDependencies", withDependencies.toString());
|
|
19
|
-
flavors.forEach(flavor => queryParams.append("flavors", flavor));
|
|
20
|
-
return http_client_service_v2_1.httpClientV2.get(`/package-manager/api/core/packages/export/list?${queryParams.toString()}`).catch(e => {
|
|
21
|
-
throw new logger_1.FatalError(`Problem getting active packages: ${e}`);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
findActivePackagesByVariableValue(flavors, variableValue, variableType) {
|
|
25
|
-
const queryParams = new URLSearchParams();
|
|
26
|
-
queryParams.set("variableValue", variableValue);
|
|
27
|
-
if (variableType) {
|
|
28
|
-
queryParams.set("variableType", variableType);
|
|
29
|
-
}
|
|
30
|
-
flavors.forEach(flavor => queryParams.append("flavors", flavor));
|
|
31
|
-
return http_client_service_v2_1.httpClientV2.get(`/package-manager/api/core/packages/export/list-by-variable-value?${queryParams.toString()}`).catch(e => {
|
|
32
|
-
throw new logger_1.FatalError(`Problem getting active packages by variable value: ${e}`);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
findActivePackagesByKeys(packageKeys, withDependencies = false) {
|
|
36
|
-
const queryParams = new URLSearchParams();
|
|
37
|
-
packageKeys.forEach(key => queryParams.append("packageKeys", key));
|
|
38
|
-
queryParams.set("withDependencies", withDependencies.toString());
|
|
39
|
-
return http_client_service_v2_1.httpClientV2.get(`/package-manager/api/core/packages/export/list-by-keys?${queryParams.toString()}`).catch(e => {
|
|
40
|
-
throw new logger_1.FatalError(`Problem getting active packages by keys: ${e}`);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
exportPackages(packageKeys, withDependencies = false) {
|
|
44
|
-
const queryParams = new URLSearchParams();
|
|
45
|
-
packageKeys.forEach(packageKey => queryParams.append("packageKeys", packageKey));
|
|
46
|
-
queryParams.set("withDependencies", withDependencies.toString());
|
|
47
|
-
return http_client_service_v2_1.httpClientV2.getFile(`/package-manager/api/core/packages/export/batch?${queryParams.toString()}`).catch(e => {
|
|
48
|
-
throw new logger_1.FatalError(`Problem exporting packages: ${e}`);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
importPackages(data, overwrite) {
|
|
52
|
-
return http_client_service_v2_1.httpClientV2.postFile("/package-manager/api/core/packages/import/batch", data, { overwrite });
|
|
53
|
-
}
|
|
54
|
-
findVariablesWithValuesByPackageKeysAndVersion(packagesByKeyAndVersion) {
|
|
55
|
-
return http_client_service_v2_1.httpClientV2.post("/package-manager/api/core/packages/export/batch/variables-with-assignments", packagesByKeyAndVersion).catch(e => {
|
|
56
|
-
throw new logger_1.FatalError(`Problem exporting package variables: ${e}`);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
BatchImportExportApi.INSTANCE = new BatchImportExportApi();
|
|
61
|
-
exports.batchImportExportApi = BatchImportExportApi.INSTANCE;
|
|
62
|
-
});
|
package/api/variables-api.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
(function (factory) {
|
|
11
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
-
var v = factory(require, exports);
|
|
13
|
-
if (v !== undefined) module.exports = v;
|
|
14
|
-
}
|
|
15
|
-
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "../services/http-client-service.v2", "../util/logger", "./variable-assignment-apis", "url"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.variablesApi = void 0;
|
|
22
|
-
const http_client_service_v2_1 = require("../services/http-client-service.v2");
|
|
23
|
-
const logger_1 = require("../util/logger");
|
|
24
|
-
const variable_assignment_apis_1 = require("./variable-assignment-apis");
|
|
25
|
-
const url_1 = require("url");
|
|
26
|
-
class VariablesApi {
|
|
27
|
-
assignVariableValues(packageKey, variablesAssignments) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
return http_client_service_v2_1.httpClientV2.post(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/values`, variablesAssignments).catch(e => {
|
|
30
|
-
throw new logger_1.FatalError(`Problem updating variables of package ${packageKey}: ${e}`);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
getCandidateAssignments(type, params) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
if (!VariablesApi.ASSIGNMENT_APIS[type]) {
|
|
37
|
-
throw new logger_1.FatalError(`Variable type ${type} not supported.`);
|
|
38
|
-
}
|
|
39
|
-
const apiUrl = VariablesApi.ASSIGNMENT_APIS[type].url + (params.toString().length ? `?${params.toString()}` : "");
|
|
40
|
-
return http_client_service_v2_1.httpClientV2.get(apiUrl).catch(e => {
|
|
41
|
-
throw new logger_1.FatalError(`Problem getting variables assignment values for type ${type}: ${e}`);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
getRuntimeVariableValues(packageKey, appMode) {
|
|
46
|
-
const queryParams = new url_1.URLSearchParams();
|
|
47
|
-
queryParams.set("appMode", appMode);
|
|
48
|
-
return http_client_service_v2_1.httpClientV2.get(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/runtime-values?${queryParams.toString()}`).catch(e => {
|
|
49
|
-
throw new logger_1.FatalError(`Problem getting runtime variables of package ${packageKey}: ${e}`);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
VariablesApi.INSTANCE = new VariablesApi();
|
|
54
|
-
VariablesApi.ASSIGNMENT_APIS = variable_assignment_apis_1.variableAssignmentApis;
|
|
55
|
-
exports.variablesApi = VariablesApi.INSTANCE;
|
|
56
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
(function (factory) {
|
|
11
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
-
var v = factory(require, exports);
|
|
13
|
-
if (v !== undefined) module.exports = v;
|
|
14
|
-
}
|
|
15
|
-
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "../services/question.service", "../interfaces/profile.interface", "../services/profile.service", "../validators/profile.validator", "../util/logger"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.ProfileCommand = void 0;
|
|
22
|
-
const question_service_1 = require("../services/question.service");
|
|
23
|
-
const profile_interface_1 = require("../interfaces/profile.interface");
|
|
24
|
-
const profile_service_1 = require("../services/profile.service");
|
|
25
|
-
const profile_validator_1 = require("../validators/profile.validator");
|
|
26
|
-
const logger_1 = require("../util/logger");
|
|
27
|
-
class ProfileCommand {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.profileService = new profile_service_1.ProfileService();
|
|
30
|
-
}
|
|
31
|
-
createProfile(setAsDefault) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const profile = {};
|
|
34
|
-
profile.name = yield question_service_1.QuestionService.ask("Name of the profile: ");
|
|
35
|
-
profile.team = yield question_service_1.QuestionService.ask("Your team (please provide the full url): ");
|
|
36
|
-
const type = yield question_service_1.QuestionService.ask("Profile type: OAuth Device Code (1), OAuth Client Credentials (2) or Application Key / API Key (3): ");
|
|
37
|
-
switch (type) {
|
|
38
|
-
case "1":
|
|
39
|
-
profile.type = profile_interface_1.ProfileType.DEVICE_CODE;
|
|
40
|
-
break;
|
|
41
|
-
case "2":
|
|
42
|
-
profile.type = profile_interface_1.ProfileType.CLIENT_CREDENTIALS;
|
|
43
|
-
profile.clientId = yield question_service_1.QuestionService.ask("Your client id: ");
|
|
44
|
-
profile.clientSecret = yield question_service_1.QuestionService.ask("Your client secret: ");
|
|
45
|
-
break;
|
|
46
|
-
case "3":
|
|
47
|
-
profile.type = profile_interface_1.ProfileType.KEY;
|
|
48
|
-
profile.apiToken = yield question_service_1.QuestionService.ask("Your api token: ");
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
logger_1.logger.error(new logger_1.FatalError("Invalid type"));
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
profile.authenticationType = yield profile_validator_1.ProfileValidator.validateProfile(profile);
|
|
55
|
-
yield this.profileService.authorizeProfile(profile);
|
|
56
|
-
this.profileService.storeProfile(profile);
|
|
57
|
-
if (setAsDefault) {
|
|
58
|
-
yield this.makeDefaultProfile(profile.name);
|
|
59
|
-
}
|
|
60
|
-
logger_1.logger.info("Profile created successfully!");
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
listProfiles() {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
this.profileService.readAllProfiles().then((profiles) => {
|
|
66
|
-
const defaultProfile = this.profileService.getDefaultProfile();
|
|
67
|
-
if (profiles) {
|
|
68
|
-
profiles.forEach(profile => {
|
|
69
|
-
if (defaultProfile && defaultProfile === profile) {
|
|
70
|
-
logger_1.logger.info(profile + " (default)");
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
logger_1.logger.info(profile);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
makeDefaultProfile(profile) {
|
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
yield this.profileService.makeDefaultProfile(profile);
|
|
83
|
-
logger_1.logger.info("Default profile: " + profile);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.ProfileCommand = ProfileCommand;
|
|
88
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
(function (factory) {
|
|
11
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
-
var v = factory(require, exports);
|
|
13
|
-
if (v !== undefined) module.exports = v;
|
|
14
|
-
}
|
|
15
|
-
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "../services/content.service", "../content/factory/widget-manager.factory"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.WidgetCommand = void 0;
|
|
22
|
-
const content_service_1 = require("../services/content.service");
|
|
23
|
-
const widget_manager_factory_1 = require("../content/factory/widget-manager.factory");
|
|
24
|
-
class WidgetCommand {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.contentService = new content_service_1.ContentService();
|
|
27
|
-
this.widgetManagerFactory = new widget_manager_factory_1.WidgetManagerFactory();
|
|
28
|
-
}
|
|
29
|
-
pushWidget(profile, tenantIndependent, userSpecific) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
yield this.contentService.push(profile, this.widgetManagerFactory.createManager(tenantIndependent, userSpecific));
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.WidgetCommand = WidgetCommand;
|
|
36
|
-
});
|
package/content-cli-analyze.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
(function (factory) {
|
|
11
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
-
var v = factory(require, exports);
|
|
13
|
-
if (v !== undefined) module.exports = v;
|
|
14
|
-
}
|
|
15
|
-
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./util/context-initializer", "./util/logger", "./commands/action-flow.command", "./util/program"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const context_initializer_1 = require("./util/context-initializer");
|
|
22
|
-
const logger_1 = require("./util/logger");
|
|
23
|
-
const action_flow_command_1 = require("./commands/action-flow.command");
|
|
24
|
-
const program_1 = require("./util/program");
|
|
25
|
-
class Analyze {
|
|
26
|
-
static actionFlows(program) {
|
|
27
|
-
program
|
|
28
|
-
.command("action-flows")
|
|
29
|
-
.description("Analyze Action Flows dependencies for a certain package")
|
|
30
|
-
.option("-p, --profile <profile>", "Profile which you want to use to analyze Action Flows")
|
|
31
|
-
.requiredOption("--packageId <packageId>", "ID of the package from which you want to export Action Flows")
|
|
32
|
-
.option("-o, --outputToJsonFile", "Output the analyze result in a JSON file")
|
|
33
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
yield new action_flow_command_1.ActionFlowCommand().analyzeActionFlows(cmd.packageId, cmd.outputToJsonFile);
|
|
35
|
-
process.exit();
|
|
36
|
-
}));
|
|
37
|
-
return program;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const loadCommands = () => {
|
|
41
|
-
getAllCommands();
|
|
42
|
-
};
|
|
43
|
-
context_initializer_1.ContextInitializer.initContext()
|
|
44
|
-
.then(loadCommands, loadCommands)
|
|
45
|
-
.catch(e => {
|
|
46
|
-
logger_1.logger.error(e);
|
|
47
|
-
});
|
|
48
|
-
if (!process.argv.slice(2).length) {
|
|
49
|
-
program_1.program.outputHelp();
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
function getAllCommands() {
|
|
53
|
-
Analyze.actionFlows(program_1.program);
|
|
54
|
-
program_1.program.parse(process.argv);
|
|
55
|
-
}
|
|
56
|
-
});
|
package/content-cli-config.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
(function (factory) {
|
|
11
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
-
var v = factory(require, exports);
|
|
13
|
-
if (v !== undefined) module.exports = v;
|
|
14
|
-
}
|
|
15
|
-
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/config.command", "./util/program", "./util/logger", "./util/context-initializer"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Config = void 0;
|
|
22
|
-
const config_command_1 = require("./commands/config.command");
|
|
23
|
-
const program_1 = require("./util/program");
|
|
24
|
-
const logger_1 = require("./util/logger");
|
|
25
|
-
const context_initializer_1 = require("./util/context-initializer");
|
|
26
|
-
class Config {
|
|
27
|
-
static list(program) {
|
|
28
|
-
program
|
|
29
|
-
.command("list")
|
|
30
|
-
.description("Command to list active packages that can be exported")
|
|
31
|
-
.option("-p, --profile <profile>", "Profile which you want to use to list possible variable assignments")
|
|
32
|
-
.option("--json", "Return response as json type", "")
|
|
33
|
-
.option("--flavors <flavors...>", "Lists only active packages of the given flavors")
|
|
34
|
-
.option("--withDependencies", "Include dependencies", "")
|
|
35
|
-
.option("--packageKeys <packageKeys...>", "Lists only given package keys")
|
|
36
|
-
.option("--variableValue <variableValue>", "Variable value for filtering packages by.")
|
|
37
|
-
.option("--variableType <variableType>", "Variable type for filtering packages by.")
|
|
38
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
yield new config_command_1.ConfigCommand().listActivePackages(cmd.json, cmd.flavors, cmd.withDependencies, cmd.packageKeys, cmd.variableValue, cmd.variableType);
|
|
40
|
-
process.exit();
|
|
41
|
-
}));
|
|
42
|
-
return program;
|
|
43
|
-
}
|
|
44
|
-
static listVariables(program) {
|
|
45
|
-
program
|
|
46
|
-
.command("variables")
|
|
47
|
-
.description("Commands related to variable configs")
|
|
48
|
-
.command("list")
|
|
49
|
-
.description("Command to list versioned variables of packages")
|
|
50
|
-
.option("-p, --profile <profile>", "Profile which you want to use to list packages")
|
|
51
|
-
.option("--json", "Return response as json type", "")
|
|
52
|
-
.option("--keysByVersion <keysByVersion...>", "Mapping of package keys and versions", "")
|
|
53
|
-
.option("--keysByVersionFile <keysByVersionFile>", "Package keys by version mappings file path.", "")
|
|
54
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
yield new config_command_1.ConfigCommand().listVariables(cmd.json, cmd.keysByVersion, cmd.keysByVersionFile);
|
|
56
|
-
process.exit();
|
|
57
|
-
}));
|
|
58
|
-
return program;
|
|
59
|
-
}
|
|
60
|
-
static export(program) {
|
|
61
|
-
program
|
|
62
|
-
.command("export")
|
|
63
|
-
.description("Command to export package configs")
|
|
64
|
-
.option("-p, --profile <profile>", "Profile which you want to use to export packages")
|
|
65
|
-
.requiredOption("--packageKeys <packageKeys...>", "Keys of packages to export")
|
|
66
|
-
.option("--withDependencies", "Include variables and dependencies", "")
|
|
67
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
yield new config_command_1.ConfigCommand().batchExportPackages(cmd.packageKeys, cmd.withDependencies);
|
|
69
|
-
process.exit();
|
|
70
|
-
}));
|
|
71
|
-
return program;
|
|
72
|
-
}
|
|
73
|
-
static import(program) {
|
|
74
|
-
program
|
|
75
|
-
.command("import")
|
|
76
|
-
.description("Command to import package configs")
|
|
77
|
-
.option("-p, --profile <profile>", "Profile which you want to use to import packages")
|
|
78
|
-
.option("--overwrite", "Flag to allow overwriting of packages")
|
|
79
|
-
.requiredOption("-f, --file <file>", "Exported packages file (relative path)")
|
|
80
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
yield new config_command_1.ConfigCommand().batchImportPackages(cmd.file, cmd.overwrite);
|
|
82
|
-
process.exit();
|
|
83
|
-
}));
|
|
84
|
-
return program;
|
|
85
|
-
}
|
|
86
|
-
static diff(program) {
|
|
87
|
-
program
|
|
88
|
-
.command("diff")
|
|
89
|
-
.description("Command to diff configs of packages")
|
|
90
|
-
.option("-p, --profile <profile>", "Profile of the team/realm which you want to use to diff the packages with")
|
|
91
|
-
.option("--hasChanges", "Flag to return only the information if the package has changes without the actual changes")
|
|
92
|
-
.option("--json", "Return the response as a JSON file")
|
|
93
|
-
.requiredOption("-f, --file <file>", "Exported packages file (relative or absolute path)")
|
|
94
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
yield new config_command_1.ConfigCommand().diffPackages(cmd.file, cmd.hasChanges, cmd.json);
|
|
96
|
-
process.exit();
|
|
97
|
-
}));
|
|
98
|
-
return program;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.Config = Config;
|
|
102
|
-
const loadAllCommands = () => {
|
|
103
|
-
Config.list(program_1.program);
|
|
104
|
-
Config.listVariables(program_1.program);
|
|
105
|
-
Config.export(program_1.program);
|
|
106
|
-
Config.import(program_1.program);
|
|
107
|
-
Config.diff(program_1.program);
|
|
108
|
-
program_1.program.parse(process.argv);
|
|
109
|
-
};
|
|
110
|
-
context_initializer_1.ContextInitializer.initContext()
|
|
111
|
-
.then(loadAllCommands, loadAllCommands)
|
|
112
|
-
.catch(e => {
|
|
113
|
-
logger_1.logger.error(e);
|
|
114
|
-
});
|
|
115
|
-
if (!process.argv.slice(2).length) {
|
|
116
|
-
program_1.program.outputHelp();
|
|
117
|
-
process.exit(1);
|
|
118
|
-
}
|
|
119
|
-
});
|
package/content-cli-export.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
(function (factory) {
|
|
11
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
|
-
var v = factory(require, exports);
|
|
13
|
-
if (v !== undefined) module.exports = v;
|
|
14
|
-
}
|
|
15
|
-
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "./commands/package.command", "./util/logger", "./commands/data-pool.command", "./util/context-initializer", "./commands/action-flow.command", "./util/program"], factory);
|
|
17
|
-
}
|
|
18
|
-
})(function (require, exports) {
|
|
19
|
-
"use strict";
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Export = void 0;
|
|
22
|
-
const package_command_1 = require("./commands/package.command");
|
|
23
|
-
const logger_1 = require("./util/logger");
|
|
24
|
-
const data_pool_command_1 = require("./commands/data-pool.command");
|
|
25
|
-
const context_initializer_1 = require("./util/context-initializer");
|
|
26
|
-
const action_flow_command_1 = require("./commands/action-flow.command");
|
|
27
|
-
const program_1 = require("./util/program");
|
|
28
|
-
class Export {
|
|
29
|
-
static packages(program) {
|
|
30
|
-
program
|
|
31
|
-
.command("packages")
|
|
32
|
-
.description("Command to export all given packages")
|
|
33
|
-
.option("-p, --profile <profile>", "Profile which you want to use to list packages")
|
|
34
|
-
.requiredOption("--packageKeys <packageKeys...>", "Exports only given package keys")
|
|
35
|
-
.option("--includeDependencies", "Include variables and dependencies", "")
|
|
36
|
-
.option("--excludeActionFlows", "Don't export action flows")
|
|
37
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
var _a;
|
|
39
|
-
yield new package_command_1.PackageCommand().batchExportPackages(cmd.packageKeys, cmd.includeDependencies, (_a = cmd.excludeActionFlows) !== null && _a !== void 0 ? _a : false);
|
|
40
|
-
process.exit();
|
|
41
|
-
}));
|
|
42
|
-
return program;
|
|
43
|
-
}
|
|
44
|
-
static dataPool(program) {
|
|
45
|
-
program
|
|
46
|
-
.command("data-pool")
|
|
47
|
-
.description("Command to export a data pool")
|
|
48
|
-
.option("-p, --profile <profile>", "Profile which you want to use to export the data pool")
|
|
49
|
-
.requiredOption("--id <id>", "ID of the data pool you want to export")
|
|
50
|
-
.option("--outputToJsonFile", "Output the exported data pool to a JSON file")
|
|
51
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
yield new data_pool_command_1.DataPoolCommand().exportDataPool(cmd.id, cmd.outputToJsonFile);
|
|
53
|
-
process.exit();
|
|
54
|
-
}));
|
|
55
|
-
return program;
|
|
56
|
-
}
|
|
57
|
-
static actionFlows(program) {
|
|
58
|
-
program
|
|
59
|
-
.command("action-flows")
|
|
60
|
-
.description("Command to export all Action Flows in a package with their objects and dependencies")
|
|
61
|
-
.option("-p, --profile <profile>", "Profile which you want to use to export Action Flows")
|
|
62
|
-
.requiredOption("--packageId <packageId>", "ID of the package from which you want to export Action Flows")
|
|
63
|
-
.option("-f, --file <file>", "Action flows metadata file (relative path)")
|
|
64
|
-
.action((cmd) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
yield new action_flow_command_1.ActionFlowCommand().exportActionFlows(cmd.packageId, cmd.file);
|
|
66
|
-
process.exit();
|
|
67
|
-
}));
|
|
68
|
-
return program;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.Export = Export;
|
|
72
|
-
const loadCommands = () => {
|
|
73
|
-
getAllCommands();
|
|
74
|
-
};
|
|
75
|
-
context_initializer_1.ContextInitializer.initContext()
|
|
76
|
-
.then(loadCommands, loadCommands)
|
|
77
|
-
.catch(e => {
|
|
78
|
-
logger_1.logger.error(e);
|
|
79
|
-
});
|
|
80
|
-
if (!process.argv.slice(2).length) {
|
|
81
|
-
program_1.program.outputHelp();
|
|
82
|
-
process.exit(1);
|
|
83
|
-
}
|
|
84
|
-
function getAllCommands() {
|
|
85
|
-
Export.packages(program_1.program);
|
|
86
|
-
Export.dataPool(program_1.program);
|
|
87
|
-
Export.actionFlows(program_1.program);
|
|
88
|
-
program_1.program.parse(process.argv);
|
|
89
|
-
}
|
|
90
|
-
});
|