@contentstack/cli-config 2.0.0-beta.1 → 2.0.0-beta.3
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
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
|
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ csdx (--version)
|
|
21
|
-
@contentstack/cli-config/2.0.0-beta.
|
|
21
|
+
@contentstack/cli-config/2.0.0-beta.3 linux-x64 node-v22.22.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -457,23 +457,25 @@ Set region for CLI
|
|
|
457
457
|
```
|
|
458
458
|
USAGE
|
|
459
459
|
$ csdx config:set:region [REGION] [--cda <value> --cma <value> --ui-host <value> -n <value>] [--developer-hub
|
|
460
|
-
<value>] [--personalize <value>] [--launch <value>] [--studio <value>]
|
|
460
|
+
<value>] [--personalize <value>] [--launch <value>] [--studio <value>] [--asset-management <value>]
|
|
461
461
|
|
|
462
462
|
ARGUMENTS
|
|
463
463
|
[REGION] Name for the region
|
|
464
464
|
|
|
465
465
|
FLAGS
|
|
466
|
-
-n, --name=<value>
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
--
|
|
470
|
-
|
|
471
|
-
--
|
|
472
|
-
|
|
473
|
-
--
|
|
474
|
-
--
|
|
475
|
-
--
|
|
476
|
-
|
|
466
|
+
-n, --name=<value> Name for the region, if this flag is added then cda, cma and ui-host flags are
|
|
467
|
+
required
|
|
468
|
+
--asset-management=<value> Custom host to set for Asset Management API
|
|
469
|
+
--cda=<value> Custom host to set for content delivery API, if this flag is added then cma, ui-host
|
|
470
|
+
and name flags are required
|
|
471
|
+
--cma=<value> Custom host to set for content management API, , if this flag is added then cda,
|
|
472
|
+
ui-host and name flags are required
|
|
473
|
+
--developer-hub=<value> Custom host to set for Developer hub API
|
|
474
|
+
--launch=<value> Custom host to set for Launch API
|
|
475
|
+
--personalize=<value> Custom host to set for Personalize API
|
|
476
|
+
--studio=<value> Custom host to set for Studio API
|
|
477
|
+
--ui-host=<value> Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are
|
|
478
|
+
required
|
|
477
479
|
|
|
478
480
|
DESCRIPTION
|
|
479
481
|
Set region for CLI
|
|
@@ -505,6 +507,8 @@ EXAMPLES
|
|
|
505
507
|
|
|
506
508
|
$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --studio <custom_studio_url>
|
|
507
509
|
|
|
510
|
+
$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --asset-management <asset_management_url>
|
|
511
|
+
|
|
508
512
|
$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --studio <custom_studio_url>
|
|
509
513
|
```
|
|
510
514
|
|
|
@@ -14,6 +14,7 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
14
14
|
let personalizeUrl = regionSetFlags['personalize'];
|
|
15
15
|
let launchHubUrl = regionSetFlags['launch'];
|
|
16
16
|
let composableStudioUrl = regionSetFlags['studio'];
|
|
17
|
+
let assetManagementUrl = regionSetFlags['asset-management'];
|
|
17
18
|
let selectedRegion = args.region;
|
|
18
19
|
if (!(cda && cma && uiHost && name) && !selectedRegion) {
|
|
19
20
|
selectedRegion = await utils_1.interactive.askRegions();
|
|
@@ -43,6 +44,9 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
43
44
|
if (!composableStudioUrl) {
|
|
44
45
|
composableStudioUrl = this.transformUrl(cma, 'composable-studio-api');
|
|
45
46
|
}
|
|
47
|
+
if (!assetManagementUrl) {
|
|
48
|
+
assetManagementUrl = this.transformUrl(cma, 'am-api');
|
|
49
|
+
}
|
|
46
50
|
let customRegion = {
|
|
47
51
|
cda,
|
|
48
52
|
cma,
|
|
@@ -52,6 +56,7 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
52
56
|
personalizeUrl,
|
|
53
57
|
launchHubUrl,
|
|
54
58
|
composableStudioUrl,
|
|
59
|
+
assetManagementUrl,
|
|
55
60
|
};
|
|
56
61
|
customRegion = utils_1.regionHandler.setCustomRegion(customRegion);
|
|
57
62
|
await cli_utilities_1.authHandler.setConfigData('logout'); //Todo: Handle this logout flow well through logout command call
|
|
@@ -63,6 +68,7 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
63
68
|
cli_utilities_1.cliux.success(`Personalize URL: ${customRegion.personalizeUrl}`);
|
|
64
69
|
cli_utilities_1.cliux.success(`Launch URL: ${customRegion.launchHubUrl}`);
|
|
65
70
|
cli_utilities_1.cliux.success(`Studio URL: ${customRegion.composableStudioUrl}`);
|
|
71
|
+
cli_utilities_1.cliux.success(`Asset Management URL: ${customRegion.assetManagementUrl}`);
|
|
66
72
|
}
|
|
67
73
|
catch (error) {
|
|
68
74
|
(0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.contextDetails), { module: 'config-set-region' }));
|
|
@@ -79,6 +85,7 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
79
85
|
cli_utilities_1.cliux.success(`Personalize URL: ${regionDetails.personalizeUrl}`);
|
|
80
86
|
cli_utilities_1.cliux.success(`Launch URL: ${regionDetails.launchHubUrl}`);
|
|
81
87
|
cli_utilities_1.cliux.success(`Studio URL: ${regionDetails.composableStudioUrl}`);
|
|
88
|
+
cli_utilities_1.cliux.success(`Asset Management URL: ${regionDetails.assetManagementUrl}`);
|
|
82
89
|
}
|
|
83
90
|
else {
|
|
84
91
|
cli_utilities_1.cliux.error(`Invalid region specified.`);
|
|
@@ -126,6 +133,9 @@ RegionSetCommand.flags = {
|
|
|
126
133
|
studio: cli_utilities_1.flags.string({
|
|
127
134
|
description: 'Custom host to set for Studio API',
|
|
128
135
|
}),
|
|
136
|
+
'asset-management': cli_utilities_1.flags.string({
|
|
137
|
+
description: 'Custom host to set for Asset Management API',
|
|
138
|
+
}),
|
|
129
139
|
};
|
|
130
140
|
RegionSetCommand.examples = [
|
|
131
141
|
'$ csdx config:set:region',
|
|
@@ -141,6 +151,7 @@ RegionSetCommand.examples = [
|
|
|
141
151
|
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --personalize <custom_personalize_url>',
|
|
142
152
|
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --launch <custom_launch_url>',
|
|
143
153
|
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --studio <custom_studio_url>',
|
|
154
|
+
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --asset-management <asset_management_url>',
|
|
144
155
|
'$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --studio <custom_studio_url>',
|
|
145
156
|
];
|
|
146
157
|
RegionSetCommand.args = {
|
|
@@ -35,6 +35,7 @@ function getRegionObject(regionKey) {
|
|
|
35
35
|
launchHubUrl: endpoints.launch,
|
|
36
36
|
personalizeUrl: endpoints.personalizeManagement,
|
|
37
37
|
composableStudioUrl: endpoints.composableStudio,
|
|
38
|
+
assetManagementUrl: endpoints.assetManagement,
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
catch (error) {
|
|
@@ -46,18 +47,7 @@ function getRegionObject(regionKey) {
|
|
|
46
47
|
* This creates a regions object similar to the old hardcoded one but using @contentstack/utils
|
|
47
48
|
*/
|
|
48
49
|
function getAvailableRegions() {
|
|
49
|
-
const regionKeys = [
|
|
50
|
-
'NA',
|
|
51
|
-
'AWS-NA',
|
|
52
|
-
'EU',
|
|
53
|
-
'AWS-EU',
|
|
54
|
-
'AU',
|
|
55
|
-
'AWS-AU',
|
|
56
|
-
'AZURE-NA',
|
|
57
|
-
'AZURE-EU',
|
|
58
|
-
'GCP-NA',
|
|
59
|
-
'GCP-EU',
|
|
60
|
-
];
|
|
50
|
+
const regionKeys = ['NA', 'AWS-NA', 'EU', 'AWS-EU', 'AU', 'AWS-AU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'];
|
|
61
51
|
const regions = {};
|
|
62
52
|
for (const key of regionKeys) {
|
|
63
53
|
const regionObj = getRegionObject(key);
|
|
@@ -151,6 +141,7 @@ class UserConfig {
|
|
|
151
141
|
personalizeUrl: regionObject['personalizeUrl'],
|
|
152
142
|
launchHubUrl: regionObject['launchHubUrl'],
|
|
153
143
|
composableStudioUrl: regionObject['composableStudioUrl'],
|
|
144
|
+
assetManagementUrl: regionObject['assetManagementUrl'],
|
|
154
145
|
};
|
|
155
146
|
return sanitizedRegion;
|
|
156
147
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -567,6 +567,7 @@
|
|
|
567
567
|
"$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name \"India\" --personalize <custom_personalize_url>",
|
|
568
568
|
"$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name \"India\" --launch <custom_launch_url>",
|
|
569
569
|
"$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name \"India\" --studio <custom_studio_url>",
|
|
570
|
+
"$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name \"India\" --asset-management <asset_management_url>",
|
|
570
571
|
"$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name \"India\" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --studio <custom_studio_url>"
|
|
571
572
|
],
|
|
572
573
|
"flags": {
|
|
@@ -646,6 +647,13 @@
|
|
|
646
647
|
"hasDynamicHelp": false,
|
|
647
648
|
"multiple": false,
|
|
648
649
|
"type": "option"
|
|
650
|
+
},
|
|
651
|
+
"asset-management": {
|
|
652
|
+
"description": "Custom host to set for Asset Management API",
|
|
653
|
+
"name": "asset-management",
|
|
654
|
+
"hasDynamicHelp": false,
|
|
655
|
+
"multiple": false,
|
|
656
|
+
"type": "option"
|
|
649
657
|
}
|
|
650
658
|
},
|
|
651
659
|
"hasDynamicHelp": false,
|
|
@@ -665,5 +673,5 @@
|
|
|
665
673
|
]
|
|
666
674
|
}
|
|
667
675
|
},
|
|
668
|
-
"version": "2.0.0-beta.
|
|
676
|
+
"version": "2.0.0-beta.3"
|
|
669
677
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-config",
|
|
3
3
|
"description": "Contentstack CLI plugin for configuration",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.3",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "
|
|
8
|
-
"clean": "rm -rf ./lib ./node_modules tsconfig.
|
|
7
|
+
"build": "pnpm compile && oclif manifest && oclif readme",
|
|
8
|
+
"clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo",
|
|
9
9
|
"compile": "tsc -b tsconfig.json",
|
|
10
10
|
"postpack": "rm -f oclif.manifest.json",
|
|
11
11
|
"prepack": "pnpm compile && oclif manifest && oclif readme",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contentstack/cli-command": "~2.0.0-beta",
|
|
25
|
-
"@contentstack/cli-utilities": "~2.0.0-beta",
|
|
24
|
+
"@contentstack/cli-command": "~2.0.0-beta.2",
|
|
25
|
+
"@contentstack/cli-utilities": "~2.0.0-beta.2",
|
|
26
26
|
"@contentstack/utils": "~1.7.0",
|
|
27
|
-
"@oclif/core": "^4.
|
|
27
|
+
"@oclif/core": "^4.8.1",
|
|
28
28
|
"@oclif/plugin-help": "^6.2.28",
|
|
29
29
|
"lodash": "^4.17.23"
|
|
30
30
|
},
|