@contentstack/cli-config 1.0.4 → 1.2.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/LICENSE +1 -1
- package/README.md +20 -10
- package/lib/commands/config/set/region.js +7 -9
- package/oclif.manifest.json +75 -1
- package/package.json +11 -14
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ The config namespace contains all the commands that you will need to configure t
|
|
|
15
15
|
$ npm install -g @contentstack/cli-config
|
|
16
16
|
$ csdx COMMAND
|
|
17
17
|
running command...
|
|
18
|
-
$ csdx (
|
|
19
|
-
@contentstack/cli-config/1.0
|
|
18
|
+
$ csdx (--version)
|
|
19
|
+
@contentstack/cli-config/1.2.0 linux-x64 node-v16.19.1
|
|
20
20
|
$ csdx --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ csdx COMMAND
|
|
@@ -36,7 +36,10 @@ Get current region set for CLI
|
|
|
36
36
|
USAGE
|
|
37
37
|
$ csdx config:get:region
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
DESCRIPTION
|
|
40
|
+
Get current region set for CLI
|
|
41
|
+
|
|
42
|
+
EXAMPLES
|
|
40
43
|
$ csdx config:get:region
|
|
41
44
|
```
|
|
42
45
|
|
|
@@ -48,21 +51,28 @@ Set region for CLI
|
|
|
48
51
|
|
|
49
52
|
```
|
|
50
53
|
USAGE
|
|
51
|
-
$ csdx config:set:region [REGION]
|
|
54
|
+
$ csdx config:set:region [REGION] [-d <value> -m <value> -n <value>]
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
required
|
|
56
|
+
ARGUMENTS
|
|
57
|
+
REGION Name for the region
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
FLAGS
|
|
60
|
+
-d, --cda=<value> Custom host to set for content delivery API, if this flag is added then cma and name flags are
|
|
61
|
+
required
|
|
62
|
+
-m, --cma=<value> Custom host to set for content management API, , if this flag is added then cda and name flags are
|
|
63
|
+
required
|
|
64
|
+
-n, --name=<value> Name for the region, if this flag is added then cda and cma flags are required
|
|
59
65
|
|
|
60
|
-
|
|
66
|
+
DESCRIPTION
|
|
67
|
+
Set region for CLI
|
|
61
68
|
|
|
62
69
|
EXAMPLES
|
|
63
70
|
$ csdx config:set:region
|
|
71
|
+
|
|
64
72
|
$ csdx config:set:region NA
|
|
73
|
+
|
|
65
74
|
$ csdx config:set:region NA
|
|
75
|
+
|
|
66
76
|
$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --name "India"
|
|
67
77
|
```
|
|
68
78
|
|
|
@@ -5,7 +5,7 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
|
5
5
|
const utils_1 = require("../../../utils");
|
|
6
6
|
class RegionSetCommand extends cli_command_1.Command {
|
|
7
7
|
async run() {
|
|
8
|
-
const { args, flags: regionSetFlags } = this.parse(RegionSetCommand);
|
|
8
|
+
const { args, flags: regionSetFlags } = await this.parse(RegionSetCommand);
|
|
9
9
|
let cda = regionSetFlags.cda;
|
|
10
10
|
let cma = regionSetFlags.cma;
|
|
11
11
|
let name = regionSetFlags.name;
|
|
@@ -50,19 +50,19 @@ class RegionSetCommand extends cli_command_1.Command {
|
|
|
50
50
|
exports.default = RegionSetCommand;
|
|
51
51
|
RegionSetCommand.description = 'Set region for CLI';
|
|
52
52
|
RegionSetCommand.flags = {
|
|
53
|
-
cda:
|
|
53
|
+
cda: cli_utilities_1.flags.string({
|
|
54
54
|
char: 'd',
|
|
55
55
|
description: 'Custom host to set for content delivery API, if this flag is added then cma and name flags are required',
|
|
56
56
|
dependsOn: ['cma', 'name'],
|
|
57
57
|
parse: (0, cli_utilities_1.printFlagDeprecation)(['-d'], ['--cda']),
|
|
58
58
|
}),
|
|
59
|
-
cma:
|
|
59
|
+
cma: cli_utilities_1.flags.string({
|
|
60
60
|
char: 'm',
|
|
61
61
|
description: 'Custom host to set for content management API, , if this flag is added then cda and name flags are required',
|
|
62
62
|
dependsOn: ['cda', 'name'],
|
|
63
63
|
parse: (0, cli_utilities_1.printFlagDeprecation)(['-m'], ['--cma']),
|
|
64
64
|
}),
|
|
65
|
-
name:
|
|
65
|
+
name: cli_utilities_1.flags.string({
|
|
66
66
|
char: 'n',
|
|
67
67
|
description: 'Name for the region, if this flag is added then cda and cma flags are required',
|
|
68
68
|
dependsOn: ['cda', 'cma'],
|
|
@@ -74,8 +74,6 @@ RegionSetCommand.examples = [
|
|
|
74
74
|
'$ csdx config:set:region NA',
|
|
75
75
|
'$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --name "India"',
|
|
76
76
|
];
|
|
77
|
-
RegionSetCommand.args =
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
];
|
|
77
|
+
RegionSetCommand.args = {
|
|
78
|
+
region: cli_utilities_1.args.string({ description: 'Name for the region' })
|
|
79
|
+
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1,75 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": "1.2.0",
|
|
3
|
+
"commands": {
|
|
4
|
+
"config:get:region": {
|
|
5
|
+
"id": "config:get:region",
|
|
6
|
+
"description": "Get current region set for CLI",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"pluginName": "@contentstack/cli-config",
|
|
9
|
+
"pluginAlias": "@contentstack/cli-config",
|
|
10
|
+
"pluginType": "core",
|
|
11
|
+
"aliases": [],
|
|
12
|
+
"examples": [
|
|
13
|
+
"$ csdx config:get:region"
|
|
14
|
+
],
|
|
15
|
+
"flags": {},
|
|
16
|
+
"args": {}
|
|
17
|
+
},
|
|
18
|
+
"config:set:region": {
|
|
19
|
+
"id": "config:set:region",
|
|
20
|
+
"description": "Set region for CLI",
|
|
21
|
+
"strict": true,
|
|
22
|
+
"pluginName": "@contentstack/cli-config",
|
|
23
|
+
"pluginAlias": "@contentstack/cli-config",
|
|
24
|
+
"pluginType": "core",
|
|
25
|
+
"aliases": [],
|
|
26
|
+
"examples": [
|
|
27
|
+
"$ csdx config:set:region",
|
|
28
|
+
"$ csdx config:set:region NA",
|
|
29
|
+
"$ csdx config:set:region NA",
|
|
30
|
+
"$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --name \"India\""
|
|
31
|
+
],
|
|
32
|
+
"flags": {
|
|
33
|
+
"cda": {
|
|
34
|
+
"name": "cda",
|
|
35
|
+
"type": "option",
|
|
36
|
+
"char": "d",
|
|
37
|
+
"description": "Custom host to set for content delivery API, if this flag is added then cma and name flags are required",
|
|
38
|
+
"multiple": false,
|
|
39
|
+
"dependsOn": [
|
|
40
|
+
"cma",
|
|
41
|
+
"name"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"cma": {
|
|
45
|
+
"name": "cma",
|
|
46
|
+
"type": "option",
|
|
47
|
+
"char": "m",
|
|
48
|
+
"description": "Custom host to set for content management API, , if this flag is added then cda and name flags are required",
|
|
49
|
+
"multiple": false,
|
|
50
|
+
"dependsOn": [
|
|
51
|
+
"cda",
|
|
52
|
+
"name"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"name": {
|
|
56
|
+
"name": "name",
|
|
57
|
+
"type": "option",
|
|
58
|
+
"char": "n",
|
|
59
|
+
"description": "Name for the region, if this flag is added then cda and cma flags are required",
|
|
60
|
+
"multiple": false,
|
|
61
|
+
"dependsOn": [
|
|
62
|
+
"cda",
|
|
63
|
+
"cma"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"args": {
|
|
68
|
+
"region": {
|
|
69
|
+
"name": "region",
|
|
70
|
+
"description": "Name for the region"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-config",
|
|
3
3
|
"description": "Contentstack CLI plugin for configuration",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run clean && npm run compile",
|
|
8
|
-
"clean": "rm -rf ./lib
|
|
8
|
+
"clean": "rm -rf ./lib ./node_modules tsconfig.build.tsbuildinfo",
|
|
9
9
|
"compile": "tsc -b tsconfig.json",
|
|
10
10
|
"postpack": "rm -f oclif.manifest.json",
|
|
11
|
-
"prepack": "
|
|
12
|
-
"version": "oclif
|
|
11
|
+
"prepack": "pnpm compile && oclif manifest && oclif readme",
|
|
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
15
|
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
@@ -20,40 +20,37 @@
|
|
|
20
20
|
"test:unit": "mocha --forbid-only \"test/unit/*.test.ts\" --unit-test"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contentstack/cli-command": "^1.0
|
|
24
|
-
"@contentstack/cli-utilities": "^1.0
|
|
25
|
-
"@oclif/command": "^1.8.16",
|
|
26
|
-
"@oclif/config": "^1.18.3",
|
|
23
|
+
"@contentstack/cli-command": "^1.2.0",
|
|
24
|
+
"@contentstack/cli-utilities": "^1.2.0",
|
|
27
25
|
"chalk": "^4.0.0",
|
|
28
26
|
"debug": "^4.1.1",
|
|
29
27
|
"inquirer": "8.2.4",
|
|
30
28
|
"winston": "^3.7.2"
|
|
31
29
|
},
|
|
32
30
|
"devDependencies": {
|
|
33
|
-
"@oclif/
|
|
34
|
-
"@oclif/test": "^1.2.8",
|
|
31
|
+
"@oclif/test": "^2.2.10",
|
|
35
32
|
"@types/chai": "^4.2.18",
|
|
36
33
|
"@types/inquirer": "^9.0.3",
|
|
37
34
|
"@types/mkdirp": "^1.0.1",
|
|
38
35
|
"@types/mocha": "^8.2.2",
|
|
39
36
|
"@types/node": "^14.14.32",
|
|
40
37
|
"@types/sinon": "^10.0.2",
|
|
41
|
-
"@types/tar": "^4.0.3",
|
|
42
38
|
"chai": "^4.3.4",
|
|
43
39
|
"eslint": "^8.18.0",
|
|
44
|
-
"eslint-config-oclif": "^
|
|
40
|
+
"eslint-config-oclif": "^4.0.0",
|
|
45
41
|
"eslint-config-oclif-typescript": "^0.1.0",
|
|
46
42
|
"globby": "^10.0.2",
|
|
47
43
|
"mocha": "10.1.0",
|
|
48
44
|
"nyc": "^15.1.0",
|
|
45
|
+
"oclif": "^3.1.2",
|
|
49
46
|
"rimraf": "^2.7.1",
|
|
50
|
-
"sinon": "^
|
|
47
|
+
"sinon": "^15.0.1",
|
|
51
48
|
"tmp": "^0.2.1",
|
|
52
49
|
"ts-node": "^10.9.1",
|
|
53
50
|
"typescript": "^4.9.3"
|
|
54
51
|
},
|
|
55
52
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
53
|
+
"node": ">=14.0.0"
|
|
57
54
|
},
|
|
58
55
|
"files": [
|
|
59
56
|
"/lib",
|