@contentstack/cli-command 1.0.1 → 1.0.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/package.json +15 -6
- package/types/index.d.ts +24 -0
- package/types/interfaces/index.d.ts +5 -0
- package/README.md +0 -70
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-command",
|
|
3
3
|
"description": "Contentstack CLI plugin for configuration",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"format": "eslint src/**/*.ts --fix"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contentstack/cli-utilities": "^1.0.
|
|
21
|
-
"@contentstack/management": "^1.
|
|
20
|
+
"@contentstack/cli-utilities": "^1.0.4",
|
|
21
|
+
"@contentstack/management": "^1.6.0",
|
|
22
22
|
"@oclif/command": "^1.8.16",
|
|
23
23
|
"contentstack": "^3.10.1"
|
|
24
24
|
},
|
|
@@ -35,17 +35,18 @@
|
|
|
35
35
|
"eslint": "^8.18.0",
|
|
36
36
|
"eslint-config-oclif": "^3.1.0",
|
|
37
37
|
"eslint-config-oclif-typescript": "^0.1.0",
|
|
38
|
-
"mocha": "
|
|
38
|
+
"mocha": "10.1.0",
|
|
39
39
|
"nyc": "^15.1.0",
|
|
40
40
|
"rimraf": "^2.7.1",
|
|
41
41
|
"sinon": "^11.1.1",
|
|
42
42
|
"ts-node": "^8.10.2",
|
|
43
|
-
"typescript": "^4.
|
|
43
|
+
"typescript": "^4.9.3"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=8.0.0"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
|
+
"/types",
|
|
49
50
|
"/lib",
|
|
50
51
|
"/npm-shrinkwrap.json",
|
|
51
52
|
"/oclif.manifest.json"
|
|
@@ -62,5 +63,13 @@
|
|
|
62
63
|
"pre-commit": "npm run lint"
|
|
63
64
|
}
|
|
64
65
|
},
|
|
66
|
+
"oclif": {
|
|
67
|
+
"commands": "./lib/commands",
|
|
68
|
+
"bin": "csdx",
|
|
69
|
+
"devPlugins": [
|
|
70
|
+
"@oclif/plugin-help"
|
|
71
|
+
],
|
|
72
|
+
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-command/<%- commandPath %>"
|
|
73
|
+
},
|
|
65
74
|
"repository": "contentstack/cli"
|
|
66
|
-
}
|
|
75
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command, flags } from '@oclif/command';
|
|
2
|
+
import { Region } from './interfaces';
|
|
3
|
+
declare abstract class ContentstackCommand extends Command {
|
|
4
|
+
private _managementAPIClient;
|
|
5
|
+
private _email;
|
|
6
|
+
private _region;
|
|
7
|
+
private _rateLimit;
|
|
8
|
+
private _authToken;
|
|
9
|
+
private _deliveryAPIClient;
|
|
10
|
+
get context(): any;
|
|
11
|
+
get managementAPIClient(): object;
|
|
12
|
+
set managementAPIClient(params: object);
|
|
13
|
+
get email(): string;
|
|
14
|
+
get deliveryAPIClient(): any;
|
|
15
|
+
get region(): Region;
|
|
16
|
+
get rateLimit(): string | 5;
|
|
17
|
+
get cmaHost(): string;
|
|
18
|
+
get cdaHost(): string;
|
|
19
|
+
get cdaAPIUrl(): string;
|
|
20
|
+
get cmaAPIUrl(): string;
|
|
21
|
+
get authToken(): string;
|
|
22
|
+
getToken(alias: any): any;
|
|
23
|
+
}
|
|
24
|
+
export { ContentstackCommand as Command, flags };
|
package/README.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
@contentstack/cli-auth
|
|
2
|
-
===
|
|
3
|
-
|
|
4
|
-
It is Contentstack’s CLI plugin to perform authentication-related activities. To get started with authenticating yourself with the CLI, refer to the [CLI’s Authentication documentation](https://www.contentstack.com/docs/developers/cli/authentication)
|
|
5
|
-
|
|
6
|
-
[](https://github.com/contentstack/cli/blob/main/LICENSE)
|
|
7
|
-
|
|
8
|
-
<!-- toc -->
|
|
9
|
-
* [Usage](#usage)
|
|
10
|
-
* [Commands](#commands)
|
|
11
|
-
<!-- tocstop -->
|
|
12
|
-
# Usage
|
|
13
|
-
<!-- usage -->
|
|
14
|
-
```sh-session
|
|
15
|
-
$ npm install -g @contentstack/cli-command-test
|
|
16
|
-
$ csdx COMMAND
|
|
17
|
-
running command...
|
|
18
|
-
$ csdx (-v|--version|version)
|
|
19
|
-
@contentstack/cli-command-test/0.1.1-beta.1 linux-x64 node-v12.22.1
|
|
20
|
-
$ csdx --help [COMMAND]
|
|
21
|
-
USAGE
|
|
22
|
-
$ csdx COMMAND
|
|
23
|
-
...
|
|
24
|
-
```
|
|
25
|
-
<!-- usagestop -->
|
|
26
|
-
# Commands
|
|
27
|
-
<!-- commands -->
|
|
28
|
-
* [`csdx config:get:region`](#csdx-configgetregion)
|
|
29
|
-
* [`csdx config:set:region`](#csdx-configsetregion)
|
|
30
|
-
|
|
31
|
-
## `csdx config:get:region`
|
|
32
|
-
|
|
33
|
-
Set region for CLI
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
USAGE
|
|
37
|
-
$ csdx config:get:region
|
|
38
|
-
|
|
39
|
-
EXAMPLE
|
|
40
|
-
$ csdx config:get:region
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
_See code: [src/commands/config/get/region.ts](https://github.com/contentstack/cli/blob/v0.1.1-beta.1/src/commands/config/get/region.ts)_
|
|
44
|
-
|
|
45
|
-
## `csdx config:set:region`
|
|
46
|
-
|
|
47
|
-
Set region for CLI
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
USAGE
|
|
51
|
-
$ csdx config:set:region
|
|
52
|
-
|
|
53
|
-
OPTIONS
|
|
54
|
-
-d, --cda=cda Custom host to set for content delivery API, if this flag is added then cma and name flags are
|
|
55
|
-
required
|
|
56
|
-
|
|
57
|
-
-m, --cma=cma Custom host to set for content management API, , if this flag is added then cda and name flags are
|
|
58
|
-
required
|
|
59
|
-
|
|
60
|
-
-n, --name=name Name for the region, if this flag is added then cda and cma flags are required
|
|
61
|
-
|
|
62
|
-
EXAMPLES
|
|
63
|
-
$ csdx config:set:region EU
|
|
64
|
-
$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --name "India"
|
|
65
|
-
$ csdx config:set:region --cma="https://in-api.contentstack.com" --cda="https://in-cda.contentstack.com"
|
|
66
|
-
--name="India"
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
_See code: [src/commands/config/set/region.ts](https://github.com/contentstack/cli/blob/v0.1.1-beta.1/src/commands/config/set/region.ts)_
|
|
70
|
-
<!-- commandsstop -->
|