@contentstack/cli-command 1.1.0 → 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/lib/index.js +2 -15
- package/package.json +6 -8
- package/types/index.d.ts +2 -5
package/LICENSE
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
|
-
Object.defineProperty(exports, "flags", { enumerable: true, get: function () { return core_1.Flags; } });
|
|
6
|
-
const ContentstackManagementSDK = require("@contentstack/management");
|
|
3
|
+
exports.Command = void 0;
|
|
7
4
|
const ContentstackDeliverySDK = require("contentstack");
|
|
8
5
|
const url = require("url");
|
|
9
6
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
10
7
|
const defaultRateLimit = 5;
|
|
11
|
-
class ContentstackCommand extends
|
|
8
|
+
class ContentstackCommand extends cli_utilities_1.Command {
|
|
12
9
|
get context() {
|
|
13
10
|
// @ts-ignore
|
|
14
11
|
return this.config.context;
|
|
15
12
|
}
|
|
16
|
-
get managementAPIClient() {
|
|
17
|
-
if (this._managementAPIClient)
|
|
18
|
-
return this._managementAPIClient;
|
|
19
|
-
this._managementAPIClient = ContentstackManagementSDK.client({ host: this.cmaHost });
|
|
20
|
-
return this._managementAPIClient;
|
|
21
|
-
}
|
|
22
|
-
set managementAPIClient(params) {
|
|
23
|
-
this._managementAPIClient = ContentstackManagementSDK.client(params);
|
|
24
|
-
}
|
|
25
13
|
get email() {
|
|
26
14
|
if (this._email)
|
|
27
15
|
return this._email;
|
|
@@ -103,5 +91,4 @@ class ContentstackCommand extends core_1.Command {
|
|
|
103
91
|
exports.Command = ContentstackCommand;
|
|
104
92
|
module.exports = {
|
|
105
93
|
Command: ContentstackCommand,
|
|
106
|
-
flags: core_1.Flags,
|
|
107
94
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-command",
|
|
3
3
|
"description": "Contentstack CLI plugin for configuration",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"prepack": "
|
|
10
|
-
"clean": "rm -rf ./lib
|
|
9
|
+
"prepack": "pnpm compile",
|
|
10
|
+
"clean": "rm -rf ./lib ./node_modules tsconfig.build.tsbuildinfo",
|
|
11
11
|
"compile": "tsc -b tsconfig.json",
|
|
12
12
|
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
13
13
|
"pretest": "tsc -p test",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"format": "eslint src/**/*.ts --fix"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@contentstack/cli-utilities": "^1.1.0",
|
|
20
|
+
"@contentstack/cli-utilities": "^1.2.0",
|
|
22
21
|
"@contentstack/management": "^1.6.1",
|
|
23
22
|
"contentstack": "^3.10.1"
|
|
24
23
|
},
|
|
@@ -29,10 +28,9 @@
|
|
|
29
28
|
"@types/mocha": "^8.2.2",
|
|
30
29
|
"@types/node": "^14.14.32",
|
|
31
30
|
"@types/sinon": "^10.0.2",
|
|
32
|
-
"@types/tar": "^4.0.3",
|
|
33
31
|
"chai": "^4.3.4",
|
|
34
32
|
"eslint": "^8.18.0",
|
|
35
|
-
"eslint-config-oclif": "^
|
|
33
|
+
"eslint-config-oclif": "^4.0.0",
|
|
36
34
|
"eslint-config-oclif-typescript": "^0.1.0",
|
|
37
35
|
"mocha": "10.1.0",
|
|
38
36
|
"nyc": "^15.1.0",
|
|
@@ -42,7 +40,7 @@
|
|
|
42
40
|
"typescript": "^4.9.3"
|
|
43
41
|
},
|
|
44
42
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
43
|
+
"node": ">=14.0.0"
|
|
46
44
|
},
|
|
47
45
|
"files": [
|
|
48
46
|
"/types",
|
package/types/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { Command
|
|
1
|
+
import { Command } from '@contentstack/cli-utilities';
|
|
2
2
|
import { Region } from './interfaces';
|
|
3
3
|
declare abstract class ContentstackCommand extends Command {
|
|
4
|
-
private _managementAPIClient;
|
|
5
4
|
private _email;
|
|
6
5
|
private _region;
|
|
7
6
|
private _rateLimit;
|
|
8
7
|
private _authToken;
|
|
9
8
|
private _deliveryAPIClient;
|
|
10
9
|
get context(): any;
|
|
11
|
-
get managementAPIClient(): object;
|
|
12
|
-
set managementAPIClient(params: object);
|
|
13
10
|
get email(): string;
|
|
14
11
|
get deliveryAPIClient(): any;
|
|
15
12
|
get region(): Region;
|
|
@@ -22,4 +19,4 @@ declare abstract class ContentstackCommand extends Command {
|
|
|
22
19
|
getToken(alias: any): any;
|
|
23
20
|
isAuthenticated(): any;
|
|
24
21
|
}
|
|
25
|
-
export { ContentstackCommand as Command
|
|
22
|
+
export { ContentstackCommand as Command };
|