@contentstack/cli-config 1.0.0 → 1.0.1
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
|
@@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-config
|
|
|
16
16
|
$ csdx COMMAND
|
|
17
17
|
running command...
|
|
18
18
|
$ csdx (-v|--version|version)
|
|
19
|
-
@contentstack/cli-config/1.0.
|
|
19
|
+
@contentstack/cli-config/1.0.1 darwin-arm64 node-v16.17.0
|
|
20
20
|
$ csdx --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ csdx COMMAND
|
|
@@ -40,7 +40,7 @@ EXAMPLE
|
|
|
40
40
|
$ csdx config:get:region
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
_See code: [src/commands/config/get/region.ts](https://github.com/contentstack/cli/blob/v1.0.
|
|
43
|
+
_See code: [src/commands/config/get/region.ts](https://github.com/contentstack/cli/blob/v1.0.1/src/commands/config/get/region.ts)_
|
|
44
44
|
|
|
45
45
|
## `csdx config:set:region [REGION]`
|
|
46
46
|
|
|
@@ -66,5 +66,5 @@ EXAMPLES
|
|
|
66
66
|
$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --name "India"
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
_See code: [src/commands/config/set/region.ts](https://github.com/contentstack/cli/blob/v1.0.
|
|
69
|
+
_See code: [src/commands/config/set/region.ts](https://github.com/contentstack/cli/blob/v1.0.1/src/commands/config/set/region.ts)_
|
|
70
70
|
<!-- commandsstop -->
|
|
@@ -5,10 +5,10 @@ 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 } = this.parse(RegionSetCommand);
|
|
9
|
-
let cda =
|
|
10
|
-
let cma =
|
|
11
|
-
let name =
|
|
8
|
+
const { args, flags: regionSetFlags } = this.parse(RegionSetCommand);
|
|
9
|
+
let cda = regionSetFlags.cda;
|
|
10
|
+
let cma = regionSetFlags.cma;
|
|
11
|
+
let name = regionSetFlags.name;
|
|
12
12
|
let selectedRegion = args.region;
|
|
13
13
|
if (!(cda && cma && name) && !selectedRegion) {
|
|
14
14
|
selectedRegion = await utils_1.interactive.askRegions();
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
4
4
|
function validURL(str) {
|
|
5
5
|
const pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
|
|
6
|
-
'((([a-
|
|
6
|
+
'(([a-z0-9A-Z]\\.)*[a-z0-9-]+\\.([a-z0-9]{2,})+(\\.[a-z]{2,}\\.([a-z]{2,})|\\.([a-z]{2,}))|' + // domain name
|
|
7
7
|
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
|
8
8
|
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
|
9
9
|
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
|
10
|
-
'(\\#[-a-z\\d_]*)?$', 'i');
|
|
10
|
+
'(\\#[-a-z\\d_]*)?$', 'i');
|
|
11
11
|
return Boolean(pattern.test(str));
|
|
12
12
|
}
|
|
13
13
|
// Available region list
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.1","commands":{"config:get:region":{"id":"config:get:region","description":"Get current region set for CLI","pluginName":"@contentstack/cli-config","pluginType":"core","aliases":[],"examples":["$ csdx config:get:region"],"flags":{},"args":[]},"config:set:region":{"id":"config:set:region","description":"Set region for CLI","pluginName":"@contentstack/cli-config","pluginType":"core","aliases":[],"examples":["$ csdx config:set:region","$ csdx config:set:region NA","$ csdx config:set:region NA","$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --name \"India\""],"flags":{"cda":{"name":"cda","type":"option","char":"d","description":"Custom host to set for content delivery API, if this flag is added then cma and name flags are required"},"cma":{"name":"cma","type":"option","char":"m","description":"Custom host to set for content management API, , if this flag is added then cda and name flags are required"},"name":{"name":"name","type":"option","char":"n","description":"Name for the region, if this flag is added then cda and cma flags are required"}},"args":[{"name":"region"}]}}}
|
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.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bin": {
|
|
7
7
|
"csdx": "./bin/run"
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"format": "eslint src/**/*.ts --fix"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contentstack/cli-command": "^1.0.
|
|
25
|
-
"@contentstack/cli-utilities": "^1.0.
|
|
24
|
+
"@contentstack/cli-command": "^1.0.1",
|
|
25
|
+
"@contentstack/cli-utilities": "^1.0.2",
|
|
26
26
|
"@oclif/command": "^1.8.16",
|
|
27
27
|
"@oclif/config": "^1.18.3",
|
|
28
28
|
"chalk": "^4.0.0",
|