@contentstack/cli-config 1.10.1 → 1.12.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 +23 -19
- package/lib/commands/config/get/base-branch.js +7 -8
- package/lib/commands/config/get/early-access-header.js +8 -9
- package/lib/commands/config/get/rate-limit.js +11 -11
- package/lib/commands/config/set/region.js +3 -1
- package/lib/utils/interactive.js +3 -1
- package/lib/utils/rate-limit-handler.js +1 -1
- package/lib/utils/region-handler.d.ts +9 -1
- package/lib/utils/region-handler.js +20 -3
- package/oclif.manifest.json +281 -163
- package/package.json +6 -6
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/1.
|
|
21
|
+
@contentstack/cli-config/1.12.0 linux-x64 node-v22.14.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -165,9 +165,9 @@ USAGE
|
|
|
165
165
|
$ csdx config:remove:ea-header [--header-alias <value>] [-y]
|
|
166
166
|
|
|
167
167
|
FLAGS
|
|
168
|
-
-y, --yes
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
-y, --yes (optional) Force the removal of Early Access header configuration by skipping the
|
|
169
|
+
confirmation.
|
|
170
|
+
--header-alias=<value> (optional) Provide the Early Access header alias name.
|
|
171
171
|
|
|
172
172
|
DESCRIPTION
|
|
173
173
|
Remove Early Access header
|
|
@@ -190,9 +190,9 @@ USAGE
|
|
|
190
190
|
$ csdx config:remove:early-access-header [--header-alias <value>] [-y]
|
|
191
191
|
|
|
192
192
|
FLAGS
|
|
193
|
-
-y, --yes
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
-y, --yes (optional) Force the removal of Early Access header configuration by skipping the
|
|
194
|
+
confirmation.
|
|
195
|
+
--header-alias=<value> (optional) Provide the Early Access header alias name.
|
|
196
196
|
|
|
197
197
|
DESCRIPTION
|
|
198
198
|
Remove Early Access header
|
|
@@ -238,7 +238,7 @@ USAGE
|
|
|
238
238
|
|
|
239
239
|
FLAGS
|
|
240
240
|
-k, --stack-api-key=<value> Stack API key
|
|
241
|
-
|
|
241
|
+
--base-branch=<value> Base branch (Target branch).
|
|
242
242
|
|
|
243
243
|
DESCRIPTION
|
|
244
244
|
Set branch for CLI
|
|
@@ -307,7 +307,7 @@ Set rate-limit for CLI
|
|
|
307
307
|
|
|
308
308
|
```
|
|
309
309
|
USAGE
|
|
310
|
-
$ csdx config:set:rate-limit [--org <value>] [--utilize <value>] [--limit-name <value
|
|
310
|
+
$ csdx config:set:rate-limit [--org <value>] [--utilize <value>] [--limit-name <value>...] [--default]
|
|
311
311
|
|
|
312
312
|
FLAGS
|
|
313
313
|
--default Reset to default rate limit
|
|
@@ -341,16 +341,16 @@ ARGUMENTS
|
|
|
341
341
|
REGION Name for the region
|
|
342
342
|
|
|
343
343
|
FLAGS
|
|
344
|
-
-d, --cda=<value>
|
|
345
|
-
|
|
346
|
-
-m, --cma=<value>
|
|
347
|
-
|
|
348
|
-
-n, --name=<value>
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
344
|
+
-d, --cda=<value> Custom host to set for content delivery API, if this flag is added then cma, ui-host and
|
|
345
|
+
name flags are required
|
|
346
|
+
-m, --cma=<value> Custom host to set for content management API, , if this flag is added then cda, ui-host
|
|
347
|
+
and name flags are required
|
|
348
|
+
-n, --name=<value> Name for the region, if this flag is added then cda, cma and ui-host flags are required
|
|
349
|
+
--developer-hub=<value> Custom host to set for Developer hub API
|
|
350
|
+
--launch=<value> Custom host to set for Launch API
|
|
351
|
+
--personalize=<value> Custom host to set for Personalize API
|
|
352
|
+
--ui-host=<value> Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are
|
|
353
|
+
required
|
|
354
354
|
|
|
355
355
|
DESCRIPTION
|
|
356
356
|
Set region for CLI
|
|
@@ -362,6 +362,10 @@ EXAMPLES
|
|
|
362
362
|
|
|
363
363
|
$ csdx config:set:region EU
|
|
364
364
|
|
|
365
|
+
$ csdx config:set:region AWS-NA
|
|
366
|
+
|
|
367
|
+
$ csdx config:set:region AWS-EU
|
|
368
|
+
|
|
365
369
|
$ csdx config:set:region AZURE-NA
|
|
366
370
|
|
|
367
371
|
$ csdx config:set:region AZURE-EU
|
|
@@ -8,16 +8,15 @@ class BranchGetCommand extends cli_command_1.Command {
|
|
|
8
8
|
let config = cli_utilities_1.configHandler.get(`baseBranch`);
|
|
9
9
|
if (config && Object.keys(config).length > 0) {
|
|
10
10
|
let configList = Object.keys(config).map((key) => ({ ['Stack API Key']: key, ['Branch']: config[key] }));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const headers = [
|
|
12
|
+
{
|
|
13
|
+
value: 'Stack API Key',
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
{
|
|
16
|
+
value: 'Branch',
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
18
|
+
];
|
|
19
|
+
cli_utilities_1.cliux.table(headers, configList);
|
|
21
20
|
}
|
|
22
21
|
else {
|
|
23
22
|
cli_utilities_1.cliux.print(`error: ${cli_utilities_1.messageHandler.parse('CLI_CONFIG_BRANCH_LIST_NO_BRANCHES')}`, { color: 'red' });
|
|
@@ -7,20 +7,19 @@ class GetEarlyAccessHeaderCommand extends cli_command_1.Command {
|
|
|
7
7
|
try {
|
|
8
8
|
let config = cli_utilities_1.configHandler.get(`earlyAccessHeaders`);
|
|
9
9
|
if (config && Object.keys(config).length > 0) {
|
|
10
|
-
let
|
|
10
|
+
let tableData = Object.keys(config).map((key) => ({
|
|
11
11
|
['Alias']: key,
|
|
12
12
|
['Early access header']: config[key],
|
|
13
13
|
}));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const tableHeaders = [
|
|
15
|
+
{
|
|
16
|
+
value: 'Alias',
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
{
|
|
19
|
+
value: 'Early access header',
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
21
|
+
];
|
|
22
|
+
cli_utilities_1.cliux.table(tableHeaders, tableData);
|
|
24
23
|
}
|
|
25
24
|
else {
|
|
26
25
|
cli_utilities_1.cliux.print(`No Early Access header found!`, { color: 'red' });
|
|
@@ -13,21 +13,21 @@ class RateLimitGetCommand extends cli_command_1.Command {
|
|
|
13
13
|
Limit: formatLimit(limits.limit),
|
|
14
14
|
'Bulk Limit': formatLimit(limits.bulkLimit),
|
|
15
15
|
}));
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const headers = [
|
|
17
|
+
{
|
|
18
|
+
value: 'Org',
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
{
|
|
21
|
+
value: 'Get Limit',
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
{
|
|
24
|
+
value: 'Limit',
|
|
25
25
|
},
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
{
|
|
27
|
+
value: 'Bulk Limit',
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
cli_utilities_1.cliux.table(
|
|
29
|
+
];
|
|
30
|
+
cli_utilities_1.cliux.table(headers, tableData);
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
33
33
|
this.log('Unable to retrieve the rate limits configuration', error instanceof Error ? error.message : error);
|
|
@@ -55,7 +55,7 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
55
55
|
cli_utilities_1.cliux.error(`Failed to set region due to: ${error.message}`);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
else if (['NA', 'EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
|
|
58
|
+
else if (['NA', 'EU', 'AWS-NA', 'AWS-EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
|
|
59
59
|
const regionDetails = utils_1.regionHandler.setRegion(selectedRegion);
|
|
60
60
|
await cli_utilities_1.authHandler.setConfigData('logout'); //Todo: Handle this logout flow well through logout command call
|
|
61
61
|
cli_utilities_1.cliux.success(`Region has been set to ${regionDetails.name}`);
|
|
@@ -118,6 +118,8 @@ RegionSetCommand.examples = [
|
|
|
118
118
|
'$ csdx config:set:region',
|
|
119
119
|
'$ csdx config:set:region NA',
|
|
120
120
|
'$ csdx config:set:region EU',
|
|
121
|
+
'$ csdx config:set:region AWS-NA',
|
|
122
|
+
'$ csdx config:set:region AWS-EU',
|
|
121
123
|
'$ csdx config:set:region AZURE-NA',
|
|
122
124
|
'$ csdx config:set:region AZURE-EU',
|
|
123
125
|
'$ csdx config:set:region GCP-NA',
|
package/lib/utils/interactive.js
CHANGED
|
@@ -10,12 +10,14 @@ const askRegions = async () => {
|
|
|
10
10
|
choices: [
|
|
11
11
|
{ name: 'NA', value: 'NA' },
|
|
12
12
|
{ name: 'EU', value: 'EU' },
|
|
13
|
+
{ name: 'AWS-NA', value: 'AWS-NA' },
|
|
14
|
+
{ name: 'AWS-EU', value: 'AWS-EU' },
|
|
13
15
|
{ name: 'AZURE-NA', value: 'AZURE-NA' },
|
|
14
16
|
{ name: 'AZURE-EU', value: 'AZURE-EU' },
|
|
15
17
|
{ name: 'GCP-NA', value: 'GCP-NA' },
|
|
16
18
|
{ name: 'GCP-EU', value: 'GCP-EU' },
|
|
17
19
|
{ name: 'Custom', value: 'custom' },
|
|
18
|
-
{ name: '
|
|
20
|
+
{ name: 'Exit', value: 'exit' },
|
|
19
21
|
],
|
|
20
22
|
});
|
|
21
23
|
};
|
|
@@ -28,7 +28,7 @@ class RateLimitHandler {
|
|
|
28
28
|
const organizations = await client.organization(config.org).fetch({ include_plan: true });
|
|
29
29
|
const features = ((_a = organizations.plan) === null || _a === void 0 ? void 0 : _a.features) || [];
|
|
30
30
|
const limitsToUpdate = Object.assign({}, rateLimit[config.org]);
|
|
31
|
-
|
|
31
|
+
const utilizationMap = {};
|
|
32
32
|
limitNames.forEach((name, index) => {
|
|
33
33
|
if (utilizeValues[index] !== undefined) {
|
|
34
34
|
utilizationMap[name] = utilizeValues[index];
|
|
@@ -36,7 +36,15 @@ declare class UserConfig {
|
|
|
36
36
|
* @param { object } regionObject JSON object needs to be sanitized
|
|
37
37
|
* @returns { object } JSON object with only valid keys for region
|
|
38
38
|
*/
|
|
39
|
-
sanitizeRegionObject(regionObject: any):
|
|
39
|
+
sanitizeRegionObject(regionObject: any): {
|
|
40
|
+
cma: any;
|
|
41
|
+
cda: any;
|
|
42
|
+
uiHost: any;
|
|
43
|
+
name: any;
|
|
44
|
+
developerHubUrl: any;
|
|
45
|
+
personalizeUrl: any;
|
|
46
|
+
launchHubUrl: any;
|
|
47
|
+
};
|
|
40
48
|
}
|
|
41
49
|
declare const _default: UserConfig;
|
|
42
50
|
export default _default;
|
|
@@ -23,6 +23,15 @@ const regions = {
|
|
|
23
23
|
launchHubUrl: 'https://launch-api.contentstack.com',
|
|
24
24
|
personalizeUrl: 'https://personalize-api.contentstack.com',
|
|
25
25
|
},
|
|
26
|
+
'AWS-NA': {
|
|
27
|
+
name: 'AWS-NA',
|
|
28
|
+
cma: 'https://api.contentstack.io',
|
|
29
|
+
cda: 'https://cdn.contentstack.io',
|
|
30
|
+
uiHost: 'https://app.contentstack.com',
|
|
31
|
+
developerHubUrl: 'https://developerhub-api.contentstack.com',
|
|
32
|
+
launchHubUrl: 'https://launch-api.contentstack.com',
|
|
33
|
+
personalizeUrl: 'https://personalize-api.contentstack.com',
|
|
34
|
+
},
|
|
26
35
|
EU: {
|
|
27
36
|
name: 'EU',
|
|
28
37
|
cma: 'https://eu-api.contentstack.com',
|
|
@@ -32,6 +41,15 @@ const regions = {
|
|
|
32
41
|
launchHubUrl: 'https://eu-launch-api.contentstack.com',
|
|
33
42
|
personalizeUrl: 'https://eu-personalize-api.contentstack.com',
|
|
34
43
|
},
|
|
44
|
+
'AWS-EU': {
|
|
45
|
+
name: 'AWS-EU',
|
|
46
|
+
cma: 'https://eu-api.contentstack.com',
|
|
47
|
+
cda: 'https://eu-cdn.contentstack.com',
|
|
48
|
+
uiHost: 'https://eu-app.contentstack.com',
|
|
49
|
+
developerHubUrl: 'https://eu-developerhub-api.contentstack.com',
|
|
50
|
+
launchHubUrl: 'https://eu-launch-api.contentstack.com',
|
|
51
|
+
personalizeUrl: 'https://eu-personalize-api.contentstack.com',
|
|
52
|
+
},
|
|
35
53
|
'AZURE-NA': {
|
|
36
54
|
name: 'AZURE-NA',
|
|
37
55
|
cma: 'https://azure-na-api.contentstack.com',
|
|
@@ -77,7 +95,7 @@ class UserConfig {
|
|
|
77
95
|
* @returns {object} region object with cma, cda, region property
|
|
78
96
|
*/
|
|
79
97
|
setRegion(region) {
|
|
80
|
-
|
|
98
|
+
const selectedRegion = regions[region];
|
|
81
99
|
if (selectedRegion) {
|
|
82
100
|
cli_utilities_1.configHandler.set('region', selectedRegion);
|
|
83
101
|
return selectedRegion;
|
|
@@ -141,8 +159,7 @@ class UserConfig {
|
|
|
141
159
|
* @returns { object } JSON object with only valid keys for region
|
|
142
160
|
*/
|
|
143
161
|
sanitizeRegionObject(regionObject) {
|
|
144
|
-
|
|
145
|
-
sanitizedRegion = {
|
|
162
|
+
const sanitizedRegion = {
|
|
146
163
|
cma: regionObject.cma,
|
|
147
164
|
cda: regionObject.cda,
|
|
148
165
|
uiHost: regionObject.uiHost,
|
package/oclif.manifest.json
CHANGED
|
@@ -1,223 +1,305 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.10.1",
|
|
3
2
|
"commands": {
|
|
4
3
|
"config:get:base-branch": {
|
|
5
|
-
"id": "config:get:base-branch",
|
|
6
|
-
"description": "Get current branch set for CLI",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"pluginName": "@contentstack/cli-config",
|
|
9
|
-
"pluginAlias": "@contentstack/cli-config",
|
|
10
|
-
"pluginType": "core",
|
|
11
4
|
"aliases": [],
|
|
12
|
-
"
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Get current branch set for CLI",
|
|
13
7
|
"examples": [
|
|
14
8
|
"$ csdx config:get:base-branch"
|
|
15
9
|
],
|
|
16
10
|
"flags": {},
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"id": "config:get:early-access-header",
|
|
21
|
-
"description": "Display Early Access headers",
|
|
22
|
-
"strict": true,
|
|
23
|
-
"pluginName": "@contentstack/cli-config",
|
|
11
|
+
"hasDynamicHelp": false,
|
|
12
|
+
"hiddenAliases": [],
|
|
13
|
+
"id": "config:get:base-branch",
|
|
24
14
|
"pluginAlias": "@contentstack/cli-config",
|
|
15
|
+
"pluginName": "@contentstack/cli-config",
|
|
25
16
|
"pluginType": "core",
|
|
17
|
+
"strict": true,
|
|
18
|
+
"isESM": false,
|
|
19
|
+
"relativePath": [
|
|
20
|
+
"lib",
|
|
21
|
+
"commands",
|
|
22
|
+
"config",
|
|
23
|
+
"get",
|
|
24
|
+
"base-branch.js"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"config:get:early-access-header": {
|
|
26
28
|
"aliases": [
|
|
27
29
|
"config:get:ea-header"
|
|
28
30
|
],
|
|
29
|
-
"
|
|
31
|
+
"args": {},
|
|
32
|
+
"description": "Display Early Access headers",
|
|
30
33
|
"examples": [
|
|
31
34
|
"$ <%= config.bin %> <%= command.id %>"
|
|
32
35
|
],
|
|
33
36
|
"flags": {},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"id": "config:get:rate-limit",
|
|
38
|
-
"description": "Get rate-limit of organizations",
|
|
39
|
-
"strict": true,
|
|
40
|
-
"pluginName": "@contentstack/cli-config",
|
|
37
|
+
"hasDynamicHelp": false,
|
|
38
|
+
"hiddenAliases": [],
|
|
39
|
+
"id": "config:get:early-access-header",
|
|
41
40
|
"pluginAlias": "@contentstack/cli-config",
|
|
41
|
+
"pluginName": "@contentstack/cli-config",
|
|
42
42
|
"pluginType": "core",
|
|
43
|
+
"strict": true,
|
|
44
|
+
"isESM": false,
|
|
45
|
+
"relativePath": [
|
|
46
|
+
"lib",
|
|
47
|
+
"commands",
|
|
48
|
+
"config",
|
|
49
|
+
"get",
|
|
50
|
+
"early-access-header.js"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"config:get:rate-limit": {
|
|
43
54
|
"aliases": [],
|
|
44
|
-
"
|
|
55
|
+
"args": {},
|
|
56
|
+
"description": "Get rate-limit of organizations",
|
|
45
57
|
"examples": [
|
|
46
58
|
"$ csdx config:get:rate-limit"
|
|
47
59
|
],
|
|
48
60
|
"flags": {},
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"id": "config:get:region",
|
|
53
|
-
"description": "Get current region set for CLI",
|
|
54
|
-
"strict": true,
|
|
55
|
-
"pluginName": "@contentstack/cli-config",
|
|
61
|
+
"hasDynamicHelp": false,
|
|
62
|
+
"hiddenAliases": [],
|
|
63
|
+
"id": "config:get:rate-limit",
|
|
56
64
|
"pluginAlias": "@contentstack/cli-config",
|
|
65
|
+
"pluginName": "@contentstack/cli-config",
|
|
57
66
|
"pluginType": "core",
|
|
67
|
+
"strict": true,
|
|
68
|
+
"isESM": false,
|
|
69
|
+
"relativePath": [
|
|
70
|
+
"lib",
|
|
71
|
+
"commands",
|
|
72
|
+
"config",
|
|
73
|
+
"get",
|
|
74
|
+
"rate-limit.js"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"config:get:region": {
|
|
58
78
|
"aliases": [],
|
|
59
|
-
"
|
|
79
|
+
"args": {},
|
|
80
|
+
"description": "Get current region set for CLI",
|
|
60
81
|
"examples": [
|
|
61
82
|
"$ csdx config:get:region"
|
|
62
83
|
],
|
|
63
84
|
"flags": {},
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"id": "config:remove:base-branch",
|
|
68
|
-
"description": "Remove branch config for CLI",
|
|
69
|
-
"strict": true,
|
|
70
|
-
"pluginName": "@contentstack/cli-config",
|
|
85
|
+
"hasDynamicHelp": false,
|
|
86
|
+
"hiddenAliases": [],
|
|
87
|
+
"id": "config:get:region",
|
|
71
88
|
"pluginAlias": "@contentstack/cli-config",
|
|
89
|
+
"pluginName": "@contentstack/cli-config",
|
|
72
90
|
"pluginType": "core",
|
|
91
|
+
"strict": true,
|
|
92
|
+
"isESM": false,
|
|
93
|
+
"relativePath": [
|
|
94
|
+
"lib",
|
|
95
|
+
"commands",
|
|
96
|
+
"config",
|
|
97
|
+
"get",
|
|
98
|
+
"region.js"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"config:remove:base-branch": {
|
|
73
102
|
"aliases": [],
|
|
74
|
-
"
|
|
103
|
+
"args": {},
|
|
104
|
+
"description": "Remove branch config for CLI",
|
|
75
105
|
"examples": [
|
|
76
106
|
"$ csdx config:remove:base-branch",
|
|
77
107
|
"$ csdx config:remove:base-branch --stack-api-key <value>"
|
|
78
108
|
],
|
|
79
109
|
"flags": {
|
|
80
110
|
"stack-api-key": {
|
|
81
|
-
"name": "stack-api-key",
|
|
82
|
-
"type": "option",
|
|
83
111
|
"char": "k",
|
|
84
112
|
"description": "Stack API key.",
|
|
85
|
-
"
|
|
113
|
+
"name": "stack-api-key",
|
|
114
|
+
"hasDynamicHelp": false,
|
|
115
|
+
"multiple": false,
|
|
116
|
+
"type": "option"
|
|
86
117
|
},
|
|
87
118
|
"yes": {
|
|
88
|
-
"name": "yes",
|
|
89
|
-
"type": "boolean",
|
|
90
119
|
"char": "y",
|
|
91
120
|
"description": "Force remove.",
|
|
92
|
-
"
|
|
121
|
+
"name": "yes",
|
|
122
|
+
"allowNo": false,
|
|
123
|
+
"type": "boolean"
|
|
93
124
|
}
|
|
94
125
|
},
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"id": "config:remove:early-access-header",
|
|
99
|
-
"description": "Remove Early Access header",
|
|
100
|
-
"strict": true,
|
|
101
|
-
"pluginName": "@contentstack/cli-config",
|
|
126
|
+
"hasDynamicHelp": false,
|
|
127
|
+
"hiddenAliases": [],
|
|
128
|
+
"id": "config:remove:base-branch",
|
|
102
129
|
"pluginAlias": "@contentstack/cli-config",
|
|
130
|
+
"pluginName": "@contentstack/cli-config",
|
|
103
131
|
"pluginType": "core",
|
|
132
|
+
"strict": true,
|
|
133
|
+
"isESM": false,
|
|
134
|
+
"relativePath": [
|
|
135
|
+
"lib",
|
|
136
|
+
"commands",
|
|
137
|
+
"config",
|
|
138
|
+
"remove",
|
|
139
|
+
"base-branch.js"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"config:remove:early-access-header": {
|
|
104
143
|
"aliases": [
|
|
105
144
|
"config:remove:ea-header"
|
|
106
145
|
],
|
|
107
|
-
"
|
|
146
|
+
"args": {},
|
|
147
|
+
"description": "Remove Early Access header",
|
|
108
148
|
"examples": [
|
|
109
149
|
"$ <%= config.bin %> <%= command.id %>",
|
|
110
150
|
"$ <%= config.bin %> <%= command.id %> --header-alias <value>"
|
|
111
151
|
],
|
|
112
152
|
"flags": {
|
|
113
153
|
"header-alias": {
|
|
114
|
-
"name": "header-alias",
|
|
115
|
-
"type": "option",
|
|
116
154
|
"description": "(optional) Provide the Early Access header alias name.",
|
|
117
|
-
"
|
|
155
|
+
"name": "header-alias",
|
|
156
|
+
"hasDynamicHelp": false,
|
|
157
|
+
"multiple": false,
|
|
158
|
+
"type": "option"
|
|
118
159
|
},
|
|
119
160
|
"yes": {
|
|
120
|
-
"name": "yes",
|
|
121
|
-
"type": "boolean",
|
|
122
161
|
"char": "y",
|
|
123
162
|
"description": "(optional) Force the removal of Early Access header configuration by skipping the confirmation.",
|
|
124
|
-
"
|
|
163
|
+
"name": "yes",
|
|
164
|
+
"allowNo": false,
|
|
165
|
+
"type": "boolean"
|
|
125
166
|
}
|
|
126
167
|
},
|
|
127
|
-
"
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"id": "config:remove:rate-limit",
|
|
131
|
-
"description": "Remove rate-limit of the organization",
|
|
132
|
-
"strict": true,
|
|
133
|
-
"pluginName": "@contentstack/cli-config",
|
|
168
|
+
"hasDynamicHelp": false,
|
|
169
|
+
"hiddenAliases": [],
|
|
170
|
+
"id": "config:remove:early-access-header",
|
|
134
171
|
"pluginAlias": "@contentstack/cli-config",
|
|
172
|
+
"pluginName": "@contentstack/cli-config",
|
|
135
173
|
"pluginType": "core",
|
|
174
|
+
"strict": true,
|
|
175
|
+
"isESM": false,
|
|
176
|
+
"relativePath": [
|
|
177
|
+
"lib",
|
|
178
|
+
"commands",
|
|
179
|
+
"config",
|
|
180
|
+
"remove",
|
|
181
|
+
"early-access-header.js"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"config:remove:rate-limit": {
|
|
136
185
|
"aliases": [],
|
|
137
|
-
"
|
|
186
|
+
"args": {},
|
|
187
|
+
"description": "Remove rate-limit of the organization",
|
|
138
188
|
"examples": [
|
|
139
189
|
"$ csdx config:remove:rate-limit --org <<org_uid>>"
|
|
140
190
|
],
|
|
141
191
|
"flags": {
|
|
142
192
|
"org": {
|
|
143
|
-
"name": "org",
|
|
144
|
-
"type": "option",
|
|
145
193
|
"description": "Provide the organization UID",
|
|
146
|
-
"
|
|
194
|
+
"name": "org",
|
|
195
|
+
"hasDynamicHelp": false,
|
|
196
|
+
"multiple": false,
|
|
197
|
+
"type": "option"
|
|
147
198
|
}
|
|
148
199
|
},
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"id": "config:set:base-branch",
|
|
153
|
-
"description": "Set branch for CLI",
|
|
154
|
-
"strict": true,
|
|
155
|
-
"pluginName": "@contentstack/cli-config",
|
|
200
|
+
"hasDynamicHelp": false,
|
|
201
|
+
"hiddenAliases": [],
|
|
202
|
+
"id": "config:remove:rate-limit",
|
|
156
203
|
"pluginAlias": "@contentstack/cli-config",
|
|
204
|
+
"pluginName": "@contentstack/cli-config",
|
|
157
205
|
"pluginType": "core",
|
|
206
|
+
"strict": true,
|
|
207
|
+
"isESM": false,
|
|
208
|
+
"relativePath": [
|
|
209
|
+
"lib",
|
|
210
|
+
"commands",
|
|
211
|
+
"config",
|
|
212
|
+
"remove",
|
|
213
|
+
"rate-limit.js"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"config:set:base-branch": {
|
|
158
217
|
"aliases": [],
|
|
159
|
-
"
|
|
218
|
+
"args": {},
|
|
219
|
+
"description": "Set branch for CLI",
|
|
160
220
|
"examples": [
|
|
161
221
|
"$ csdx config:set:base-branch",
|
|
162
222
|
"$ csdx config:set:base-branch --stack-api-key <value> --base-branch <value>"
|
|
163
223
|
],
|
|
164
224
|
"flags": {
|
|
165
225
|
"stack-api-key": {
|
|
166
|
-
"name": "stack-api-key",
|
|
167
|
-
"type": "option",
|
|
168
226
|
"char": "k",
|
|
169
227
|
"description": "Stack API key",
|
|
170
|
-
"
|
|
228
|
+
"name": "stack-api-key",
|
|
229
|
+
"hasDynamicHelp": false,
|
|
230
|
+
"multiple": false,
|
|
231
|
+
"type": "option"
|
|
171
232
|
},
|
|
172
233
|
"base-branch": {
|
|
173
|
-
"name": "base-branch",
|
|
174
|
-
"type": "option",
|
|
175
234
|
"description": "Base branch (Target branch).",
|
|
176
|
-
"
|
|
235
|
+
"name": "base-branch",
|
|
236
|
+
"hasDynamicHelp": false,
|
|
237
|
+
"multiple": false,
|
|
238
|
+
"type": "option"
|
|
177
239
|
}
|
|
178
240
|
},
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"id": "config:set:early-access-header",
|
|
183
|
-
"description": "Set Early Access header",
|
|
184
|
-
"strict": true,
|
|
185
|
-
"pluginName": "@contentstack/cli-config",
|
|
241
|
+
"hasDynamicHelp": false,
|
|
242
|
+
"hiddenAliases": [],
|
|
243
|
+
"id": "config:set:base-branch",
|
|
186
244
|
"pluginAlias": "@contentstack/cli-config",
|
|
245
|
+
"pluginName": "@contentstack/cli-config",
|
|
187
246
|
"pluginType": "core",
|
|
247
|
+
"strict": true,
|
|
248
|
+
"isESM": false,
|
|
249
|
+
"relativePath": [
|
|
250
|
+
"lib",
|
|
251
|
+
"commands",
|
|
252
|
+
"config",
|
|
253
|
+
"set",
|
|
254
|
+
"base-branch.js"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
"config:set:early-access-header": {
|
|
188
258
|
"aliases": [
|
|
189
259
|
"config:set:ea-header"
|
|
190
260
|
],
|
|
191
|
-
"
|
|
261
|
+
"args": {},
|
|
262
|
+
"description": "Set Early Access header",
|
|
192
263
|
"examples": [
|
|
193
264
|
"$ <%= config.bin %> <%= command.id %>",
|
|
194
265
|
"$ <%= config.bin %> <%= command.id %> --header <value> --header-alias <value>"
|
|
195
266
|
],
|
|
196
267
|
"flags": {
|
|
197
268
|
"header-alias": {
|
|
198
|
-
"name": "header-alias",
|
|
199
|
-
"type": "option",
|
|
200
269
|
"description": "(optional) Provide the Early Access header value.",
|
|
201
|
-
"
|
|
270
|
+
"name": "header-alias",
|
|
271
|
+
"hasDynamicHelp": false,
|
|
272
|
+
"multiple": false,
|
|
273
|
+
"type": "option"
|
|
202
274
|
},
|
|
203
275
|
"header": {
|
|
204
|
-
"name": "header",
|
|
205
|
-
"type": "option",
|
|
206
276
|
"description": "(optional) Provide the Early Access header alias name.",
|
|
207
|
-
"
|
|
277
|
+
"name": "header",
|
|
278
|
+
"hasDynamicHelp": false,
|
|
279
|
+
"multiple": false,
|
|
280
|
+
"type": "option"
|
|
208
281
|
}
|
|
209
282
|
},
|
|
210
|
-
"
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
"id": "config:set:rate-limit",
|
|
214
|
-
"description": "Set rate-limit for CLI",
|
|
215
|
-
"strict": true,
|
|
216
|
-
"pluginName": "@contentstack/cli-config",
|
|
283
|
+
"hasDynamicHelp": false,
|
|
284
|
+
"hiddenAliases": [],
|
|
285
|
+
"id": "config:set:early-access-header",
|
|
217
286
|
"pluginAlias": "@contentstack/cli-config",
|
|
287
|
+
"pluginName": "@contentstack/cli-config",
|
|
218
288
|
"pluginType": "core",
|
|
289
|
+
"strict": true,
|
|
290
|
+
"isESM": false,
|
|
291
|
+
"relativePath": [
|
|
292
|
+
"lib",
|
|
293
|
+
"commands",
|
|
294
|
+
"config",
|
|
295
|
+
"set",
|
|
296
|
+
"early-access-header.js"
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
"config:set:rate-limit": {
|
|
219
300
|
"aliases": [],
|
|
220
|
-
"
|
|
301
|
+
"args": {},
|
|
302
|
+
"description": "Set rate-limit for CLI",
|
|
221
303
|
"examples": [
|
|
222
304
|
"$ csdx config:set:rate-limit --org <<org_uid>>",
|
|
223
305
|
"$ csdx config:set:rate-limit --org <<org_uid>> --utilize 70,80 --limit-name getLimit,limit",
|
|
@@ -225,46 +307,65 @@
|
|
|
225
307
|
],
|
|
226
308
|
"flags": {
|
|
227
309
|
"org": {
|
|
228
|
-
"name": "org",
|
|
229
|
-
"type": "option",
|
|
230
310
|
"description": "Provide the organization UID",
|
|
231
|
-
"
|
|
311
|
+
"name": "org",
|
|
312
|
+
"hasDynamicHelp": false,
|
|
313
|
+
"multiple": false,
|
|
314
|
+
"type": "option"
|
|
232
315
|
},
|
|
233
316
|
"utilize": {
|
|
234
|
-
"name": "utilize",
|
|
235
|
-
"type": "option",
|
|
236
317
|
"description": "Provide the utilization percentages for rate limit, separated by commas",
|
|
318
|
+
"name": "utilize",
|
|
319
|
+
"default": "50",
|
|
320
|
+
"hasDynamicHelp": false,
|
|
237
321
|
"multiple": false,
|
|
238
|
-
"
|
|
322
|
+
"type": "option"
|
|
239
323
|
},
|
|
240
324
|
"limit-name": {
|
|
241
|
-
"name": "limit-name",
|
|
242
|
-
"type": "option",
|
|
243
325
|
"description": "[Optional] Provide the limit names separated by commas ['limit', 'getLimit', 'bulkLimit']",
|
|
244
|
-
"
|
|
326
|
+
"name": "limit-name",
|
|
327
|
+
"hasDynamicHelp": false,
|
|
328
|
+
"multiple": true,
|
|
329
|
+
"type": "option"
|
|
245
330
|
},
|
|
246
331
|
"default": {
|
|
247
|
-
"name": "default",
|
|
248
|
-
"type": "boolean",
|
|
249
332
|
"description": "Reset to default rate limit",
|
|
250
|
-
"
|
|
333
|
+
"name": "default",
|
|
334
|
+
"allowNo": false,
|
|
335
|
+
"type": "boolean"
|
|
251
336
|
}
|
|
252
337
|
},
|
|
253
|
-
"
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
"id": "config:set:region",
|
|
257
|
-
"description": "Set region for CLI",
|
|
258
|
-
"strict": true,
|
|
259
|
-
"pluginName": "@contentstack/cli-config",
|
|
338
|
+
"hasDynamicHelp": false,
|
|
339
|
+
"hiddenAliases": [],
|
|
340
|
+
"id": "config:set:rate-limit",
|
|
260
341
|
"pluginAlias": "@contentstack/cli-config",
|
|
342
|
+
"pluginName": "@contentstack/cli-config",
|
|
261
343
|
"pluginType": "core",
|
|
344
|
+
"strict": true,
|
|
345
|
+
"isESM": false,
|
|
346
|
+
"relativePath": [
|
|
347
|
+
"lib",
|
|
348
|
+
"commands",
|
|
349
|
+
"config",
|
|
350
|
+
"set",
|
|
351
|
+
"rate-limit.js"
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
"config:set:region": {
|
|
262
355
|
"aliases": [],
|
|
263
|
-
"
|
|
356
|
+
"args": {
|
|
357
|
+
"region": {
|
|
358
|
+
"description": "Name for the region",
|
|
359
|
+
"name": "region"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"description": "Set region for CLI",
|
|
264
363
|
"examples": [
|
|
265
364
|
"$ csdx config:set:region",
|
|
266
365
|
"$ csdx config:set:region NA",
|
|
267
366
|
"$ csdx config:set:region EU",
|
|
367
|
+
"$ csdx config:set:region AWS-NA",
|
|
368
|
+
"$ csdx config:set:region AWS-EU",
|
|
268
369
|
"$ csdx config:set:region AZURE-NA",
|
|
269
370
|
"$ csdx config:set:region AZURE-EU",
|
|
270
371
|
"$ csdx config:set:region GCP-NA",
|
|
@@ -277,77 +378,94 @@
|
|
|
277
378
|
],
|
|
278
379
|
"flags": {
|
|
279
380
|
"cda": {
|
|
280
|
-
"name": "cda",
|
|
281
|
-
"type": "option",
|
|
282
381
|
"char": "d",
|
|
283
|
-
"description": "Custom host to set for content delivery API, if this flag is added then cma, ui-host and name flags are required",
|
|
284
|
-
"multiple": false,
|
|
285
382
|
"dependsOn": [
|
|
286
383
|
"cma",
|
|
287
384
|
"ui-host",
|
|
288
385
|
"name"
|
|
289
|
-
]
|
|
386
|
+
],
|
|
387
|
+
"description": "Custom host to set for content delivery API, if this flag is added then cma, ui-host and name flags are required",
|
|
388
|
+
"name": "cda",
|
|
389
|
+
"hasDynamicHelp": false,
|
|
390
|
+
"multiple": false,
|
|
391
|
+
"type": "option"
|
|
290
392
|
},
|
|
291
393
|
"cma": {
|
|
292
|
-
"name": "cma",
|
|
293
|
-
"type": "option",
|
|
294
394
|
"char": "m",
|
|
295
|
-
"description": "Custom host to set for content management API, , if this flag is added then cda, ui-host and name flags are required",
|
|
296
|
-
"multiple": false,
|
|
297
395
|
"dependsOn": [
|
|
298
396
|
"cda",
|
|
299
397
|
"ui-host",
|
|
300
398
|
"name"
|
|
301
|
-
]
|
|
399
|
+
],
|
|
400
|
+
"description": "Custom host to set for content management API, , if this flag is added then cda, ui-host and name flags are required",
|
|
401
|
+
"name": "cma",
|
|
402
|
+
"hasDynamicHelp": false,
|
|
403
|
+
"multiple": false,
|
|
404
|
+
"type": "option"
|
|
302
405
|
},
|
|
303
406
|
"ui-host": {
|
|
304
|
-
"name": "ui-host",
|
|
305
|
-
"type": "option",
|
|
306
|
-
"description": "Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are required",
|
|
307
|
-
"multiple": false,
|
|
308
407
|
"dependsOn": [
|
|
309
408
|
"cda",
|
|
310
409
|
"cma",
|
|
311
410
|
"name"
|
|
312
|
-
]
|
|
411
|
+
],
|
|
412
|
+
"description": "Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are required",
|
|
413
|
+
"name": "ui-host",
|
|
414
|
+
"hasDynamicHelp": false,
|
|
415
|
+
"multiple": false,
|
|
416
|
+
"type": "option"
|
|
313
417
|
},
|
|
314
418
|
"name": {
|
|
315
|
-
"name": "name",
|
|
316
|
-
"type": "option",
|
|
317
419
|
"char": "n",
|
|
318
|
-
"description": "Name for the region, if this flag is added then cda, cma and ui-host flags are required",
|
|
319
|
-
"multiple": false,
|
|
320
420
|
"dependsOn": [
|
|
321
421
|
"cda",
|
|
322
422
|
"cma",
|
|
323
423
|
"ui-host"
|
|
324
|
-
]
|
|
424
|
+
],
|
|
425
|
+
"description": "Name for the region, if this flag is added then cda, cma and ui-host flags are required",
|
|
426
|
+
"name": "name",
|
|
427
|
+
"hasDynamicHelp": false,
|
|
428
|
+
"multiple": false,
|
|
429
|
+
"type": "option"
|
|
325
430
|
},
|
|
326
431
|
"developer-hub": {
|
|
327
|
-
"name": "developer-hub",
|
|
328
|
-
"type": "option",
|
|
329
432
|
"description": "Custom host to set for Developer hub API",
|
|
330
|
-
"
|
|
433
|
+
"name": "developer-hub",
|
|
434
|
+
"hasDynamicHelp": false,
|
|
435
|
+
"multiple": false,
|
|
436
|
+
"type": "option"
|
|
331
437
|
},
|
|
332
438
|
"personalize": {
|
|
333
|
-
"name": "personalize",
|
|
334
|
-
"type": "option",
|
|
335
439
|
"description": "Custom host to set for Personalize API",
|
|
336
|
-
"
|
|
440
|
+
"name": "personalize",
|
|
441
|
+
"hasDynamicHelp": false,
|
|
442
|
+
"multiple": false,
|
|
443
|
+
"type": "option"
|
|
337
444
|
},
|
|
338
445
|
"launch": {
|
|
339
|
-
"name": "launch",
|
|
340
|
-
"type": "option",
|
|
341
446
|
"description": "Custom host to set for Launch API",
|
|
342
|
-
"
|
|
447
|
+
"name": "launch",
|
|
448
|
+
"hasDynamicHelp": false,
|
|
449
|
+
"multiple": false,
|
|
450
|
+
"type": "option"
|
|
343
451
|
}
|
|
344
452
|
},
|
|
345
|
-
"
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
453
|
+
"hasDynamicHelp": false,
|
|
454
|
+
"hiddenAliases": [],
|
|
455
|
+
"id": "config:set:region",
|
|
456
|
+
"pluginAlias": "@contentstack/cli-config",
|
|
457
|
+
"pluginName": "@contentstack/cli-config",
|
|
458
|
+
"pluginType": "core",
|
|
459
|
+
"strict": true,
|
|
460
|
+
"isESM": false,
|
|
461
|
+
"relativePath": [
|
|
462
|
+
"lib",
|
|
463
|
+
"commands",
|
|
464
|
+
"config",
|
|
465
|
+
"set",
|
|
466
|
+
"region.js"
|
|
467
|
+
]
|
|
351
468
|
}
|
|
352
|
-
}
|
|
469
|
+
},
|
|
470
|
+
"version": "1.12.0"
|
|
353
471
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-config",
|
|
3
3
|
"description": "Contentstack CLI plugin for configuration",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run clean && npm run compile",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"version": "oclif readme && git add README.md",
|
|
13
13
|
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
14
14
|
"pretest": "tsc -p test",
|
|
15
|
-
"test": "
|
|
15
|
+
"test": "mocha --require ts-node/register 'test/**/*.test.ts'",
|
|
16
16
|
"posttest": "npm run lint",
|
|
17
17
|
"lint": "eslint src/**/*.ts",
|
|
18
18
|
"format": "eslint src/**/*.ts --fix",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contentstack/cli-command": "~1.
|
|
25
|
-
"@contentstack/cli-utilities": "~1.
|
|
24
|
+
"@contentstack/cli-command": "~1.5.0",
|
|
25
|
+
"@contentstack/cli-utilities": "~1.11.0",
|
|
26
26
|
"lodash": "^4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@types/sinon": "^10.0.20",
|
|
34
34
|
"chai": "^4.5.0",
|
|
35
35
|
"eslint": "^8.57.1",
|
|
36
|
-
"eslint-config-oclif": "^
|
|
36
|
+
"eslint-config-oclif": "^6.0.15",
|
|
37
37
|
"eslint-config-oclif-typescript": "^3.1.13",
|
|
38
38
|
"mocha": "10.8.2",
|
|
39
39
|
"nyc": "^15.1.0",
|
|
40
|
-
"oclif": "^
|
|
40
|
+
"oclif": "^4.17.30",
|
|
41
41
|
"sinon": "^19.0.2",
|
|
42
42
|
"ts-node": "^10.9.2",
|
|
43
43
|
"typescript": "^4.9.5"
|