@contentstack/cli 1.2.5 → 1.4.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 +1307 -221
- package/bin/dev +4 -15
- package/bin/run +4 -3
- package/lib/hooks/prerun/auth-guard.js +5 -4
- package/lib/index.js +1 -3
- package/oclif.manifest.json +4 -1
- package/package.json +29 -31
package/bin/dev
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// In dev mode -> use ts-node and dev plugins
|
|
9
|
-
process.env.NODE_ENV = 'development'
|
|
10
|
-
|
|
11
|
-
require('ts-node').register({project})
|
|
12
|
-
|
|
13
|
-
// In dev mode, always show stack traces
|
|
14
|
-
oclif.settings.debug = true;
|
|
15
|
-
|
|
16
|
-
// Start the CLI
|
|
17
|
-
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
|
3
|
+
(async () => {
|
|
4
|
+
const oclif = require('@oclif/core')
|
|
5
|
+
await oclif.execute({type: 'cjs', development: true, dir: __dirname})
|
|
6
|
+
})()
|
package/bin/run
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
oclif.
|
|
3
|
+
(async () => {
|
|
4
|
+
const oclif = require('@oclif/core')
|
|
5
|
+
await oclif.execute({type: 'cjs', dir: __dirname})
|
|
6
|
+
})()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
4
|
+
const ContentstackManagementSDK = require("@contentstack/management");
|
|
4
5
|
// TBD: run region command if region is not there
|
|
5
6
|
async function default_1(opts) {
|
|
6
7
|
const { context: { plugin: { config: { protectedCommands = {} } = {} } = {}, region = null } = {} } = this.config;
|
|
@@ -20,9 +21,10 @@ async function default_1(opts) {
|
|
|
20
21
|
cli_utilities_1.cliux.error('Please login to execute the command');
|
|
21
22
|
this.exit();
|
|
22
23
|
}
|
|
24
|
+
const client = ContentstackManagementSDK.client({ host: region.cma, authtoken: authToken });
|
|
23
25
|
try {
|
|
24
|
-
const result = await
|
|
25
|
-
if (result
|
|
26
|
+
const result = await client.getUser();
|
|
27
|
+
if (!result) {
|
|
26
28
|
cli_utilities_1.logger.error('error in auth validation');
|
|
27
29
|
cli_utilities_1.cliux.error('Please login to execute the command');
|
|
28
30
|
this.exit();
|
|
@@ -32,8 +34,7 @@ async function default_1(opts) {
|
|
|
32
34
|
catch (error) {
|
|
33
35
|
cli_utilities_1.logger.error('error in auth validation', error);
|
|
34
36
|
cli_utilities_1.cliux.error('Please login to execute the command');
|
|
35
|
-
|
|
36
|
-
return;
|
|
37
|
+
process.exit();
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var core_1 = require("@oclif/core");
|
|
5
|
-
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
|
|
3
|
+
exports.default = '@oclif/core';
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli",
|
|
3
3
|
"description": "Command-line tool (CLI) to interact with Contentstack",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bin": {
|
|
7
7
|
"csdx": "./bin/run"
|
|
@@ -9,38 +9,35 @@
|
|
|
9
9
|
"main": "lib/index.js",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "npm run clean && npm run compile",
|
|
12
|
-
"clean": "rm -rf ./lib
|
|
12
|
+
"clean": "rm -rf ./lib ./node_modules tsconfig.build.tsbuildinfo",
|
|
13
13
|
"compile": "tsc -b tsconfig.json",
|
|
14
14
|
"postpack": "rm -f oclif.manifest.json",
|
|
15
|
-
"
|
|
16
|
-
"version": "oclif-dev readme && git add README.md",
|
|
15
|
+
"version": "oclif readme && git add README.md",
|
|
17
16
|
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
18
17
|
"pretest": "tsc -p test",
|
|
19
18
|
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
20
19
|
"posttest": "npm run lint",
|
|
21
|
-
"lint": "eslint src/**/*.ts"
|
|
20
|
+
"lint": "eslint src/**/*.ts",
|
|
21
|
+
"prepack": "pnpm compile && oclif manifest && oclif readme"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contentstack/cli-auth": "^1.0
|
|
25
|
-
"@contentstack/cli-cm-bootstrap": "^1.
|
|
26
|
-
"@contentstack/cli-cm-bulk-publish": "^1.0
|
|
27
|
-
"@contentstack/cli-cm-clone": "^1.
|
|
28
|
-
"@contentstack/cli-cm-export": "^1.
|
|
29
|
-
"@contentstack/cli-cm-export-to-csv": "^1.0
|
|
30
|
-
"@contentstack/cli-cm-import": "^1.
|
|
31
|
-
"@contentstack/cli-cm-migrate-rte": "^1.
|
|
32
|
-
"@contentstack/cli-cm-seed": "^1.
|
|
33
|
-
"@contentstack/cli-command": "^1.0
|
|
34
|
-
"@contentstack/cli-config": "^1.0
|
|
35
|
-
"@contentstack/cli-migration": "^1.0
|
|
36
|
-
"@contentstack/cli-utilities": "^1.0
|
|
37
|
-
"@contentstack/management": "^1.6.
|
|
38
|
-
"@oclif/
|
|
39
|
-
"@oclif/
|
|
40
|
-
"@oclif/
|
|
41
|
-
"@oclif/errors": "^1.3.3",
|
|
42
|
-
"@oclif/plugin-not-found": "^2.3.1",
|
|
43
|
-
"@oclif/plugin-plugins": "^2.1.0",
|
|
24
|
+
"@contentstack/cli-auth": "^1.2.0",
|
|
25
|
+
"@contentstack/cli-cm-bootstrap": "^1.3.0",
|
|
26
|
+
"@contentstack/cli-cm-bulk-publish": "^1.2.0",
|
|
27
|
+
"@contentstack/cli-cm-clone": "^1.3.0",
|
|
28
|
+
"@contentstack/cli-cm-export": "^1.4.0",
|
|
29
|
+
"@contentstack/cli-cm-export-to-csv": "^1.2.0",
|
|
30
|
+
"@contentstack/cli-cm-import": "^1.4.0",
|
|
31
|
+
"@contentstack/cli-cm-migrate-rte": "^1.3.0",
|
|
32
|
+
"@contentstack/cli-cm-seed": "^1.3.0",
|
|
33
|
+
"@contentstack/cli-command": "^1.2.0",
|
|
34
|
+
"@contentstack/cli-config": "^1.2.0",
|
|
35
|
+
"@contentstack/cli-migration": "^1.2.0",
|
|
36
|
+
"@contentstack/cli-utilities": "^1.2.0",
|
|
37
|
+
"@contentstack/management": "^1.6.1",
|
|
38
|
+
"@oclif/plugin-help": "^5",
|
|
39
|
+
"@oclif/plugin-not-found": "^2.3.9",
|
|
40
|
+
"@oclif/plugin-plugins": "^2.1.7",
|
|
44
41
|
"chalk": "^4.1.2",
|
|
45
42
|
"debug": "^4.1.1",
|
|
46
43
|
"figlet": "^1.5.2",
|
|
@@ -49,32 +46,31 @@
|
|
|
49
46
|
"winston": "^3.7.2"
|
|
50
47
|
},
|
|
51
48
|
"devDependencies": {
|
|
52
|
-
"@oclif/
|
|
53
|
-
"@oclif/test": "^1.2.8",
|
|
49
|
+
"@oclif/test": "^2.2.10",
|
|
54
50
|
"@types/chai": "^4.2.18",
|
|
55
51
|
"@types/inquirer": "^9.0.3",
|
|
56
52
|
"@types/mkdirp": "^1.0.1",
|
|
57
53
|
"@types/mocha": "^8.2.2",
|
|
58
54
|
"@types/node": "^14.14.32",
|
|
59
55
|
"@types/sinon": "^10.0.2",
|
|
60
|
-
"@types/tar": "^4.0.3",
|
|
61
56
|
"chai": "^4.3.4",
|
|
62
57
|
"eslint": "^8.18.0",
|
|
63
|
-
"eslint-config-oclif": "^
|
|
58
|
+
"eslint-config-oclif": "^4.0.0",
|
|
64
59
|
"eslint-config-oclif-typescript": "^0.1.0",
|
|
65
60
|
"globby": "^10.0.2",
|
|
66
61
|
"mocha": "^10.0.0",
|
|
67
62
|
"nock": "^13.1.0",
|
|
68
63
|
"nyc": "^15.1.0",
|
|
64
|
+
"oclif": "^3.1.2",
|
|
69
65
|
"rimraf": "^2.7.1",
|
|
70
66
|
"shelljs": "^0.8.4",
|
|
71
|
-
"sinon": "^
|
|
67
|
+
"sinon": "^15.0.1",
|
|
72
68
|
"tmp": "^0.2.1",
|
|
73
69
|
"ts-node": "^10.9.1",
|
|
74
70
|
"typescript": "^4.9.3"
|
|
75
71
|
},
|
|
76
72
|
"engines": {
|
|
77
|
-
"node": ">=
|
|
73
|
+
"node": ">=14.0.0"
|
|
78
74
|
},
|
|
79
75
|
"files": [
|
|
80
76
|
"/bin",
|
|
@@ -90,6 +86,7 @@
|
|
|
90
86
|
],
|
|
91
87
|
"license": "MIT",
|
|
92
88
|
"oclif": {
|
|
89
|
+
"topicSeparator": ":",
|
|
93
90
|
"additionalHelpFlags": [
|
|
94
91
|
"-h"
|
|
95
92
|
],
|
|
@@ -122,6 +119,7 @@
|
|
|
122
119
|
"helpClass": "./lib/help.js",
|
|
123
120
|
"bin": "csdx",
|
|
124
121
|
"plugins": [
|
|
122
|
+
"@oclif/plugin-help",
|
|
125
123
|
"@oclif/plugin-not-found",
|
|
126
124
|
"@oclif/plugin-plugins",
|
|
127
125
|
"@contentstack/cli-config",
|