@contentstack/cli-command 1.2.6 → 1.2.8
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/lib/index.d.ts +20 -0
- package/lib/index.js +5 -7
- package/lib/interfaces/index.d.ts +6 -0
- package/package.json +4 -4
- package/types/index.d.ts +0 -22
- package/types/interfaces/index.d.ts +0 -6
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from '@contentstack/cli-utilities';
|
|
2
|
+
import { Region } from './interfaces';
|
|
3
|
+
declare abstract class ContentstackCommand extends Command {
|
|
4
|
+
private _email;
|
|
5
|
+
private _region;
|
|
6
|
+
private _rateLimit;
|
|
7
|
+
private _deliveryAPIClient;
|
|
8
|
+
get context(): any;
|
|
9
|
+
get email(): string;
|
|
10
|
+
get deliveryAPIClient(): any;
|
|
11
|
+
get region(): Region;
|
|
12
|
+
get rateLimit(): string | 5;
|
|
13
|
+
get cmaHost(): string;
|
|
14
|
+
get cdaHost(): string;
|
|
15
|
+
get uiHost(): string;
|
|
16
|
+
get cdaAPIUrl(): string;
|
|
17
|
+
get cmaAPIUrl(): string;
|
|
18
|
+
getToken(alias: any): any;
|
|
19
|
+
}
|
|
20
|
+
export { ContentstackCommand as Command };
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Command = void 0;
|
|
4
|
-
const ContentstackDeliverySDK = require("contentstack");
|
|
5
4
|
const url_1 = require("url");
|
|
5
|
+
const ContentstackDeliverySDK = require("contentstack");
|
|
6
6
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
7
7
|
const defaultRateLimit = 5;
|
|
8
8
|
class ContentstackCommand extends cli_utilities_1.Command {
|
|
@@ -25,15 +25,13 @@ class ContentstackCommand extends cli_utilities_1.Command {
|
|
|
25
25
|
return this._deliveryAPIClient;
|
|
26
26
|
}
|
|
27
27
|
get region() {
|
|
28
|
-
if (this._region)
|
|
29
|
-
|
|
30
|
-
this._region = cli_utilities_1.configHandler.get('region');
|
|
28
|
+
if (!this._region)
|
|
29
|
+
this._region = cli_utilities_1.configHandler.get('region');
|
|
31
30
|
if (!this._region) {
|
|
32
|
-
cli_utilities_1.cliux.print(
|
|
31
|
+
cli_utilities_1.cliux.print('Error: Region not configured. Please set the region.', { color: 'red' });
|
|
33
32
|
process.exit(1);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
return this._region;
|
|
34
|
+
return this._region;
|
|
37
35
|
}
|
|
38
36
|
get rateLimit() {
|
|
39
37
|
this._rateLimit = cli_utilities_1.configHandler.get('rate-limit');
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-command",
|
|
3
3
|
"description": "Contentstack CLI plugin for configuration",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.8",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
|
-
"types": "
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"prepack": "pnpm compile",
|
|
10
10
|
"clean": "rm -rf ./lib ./node_modules tsconfig.build.tsbuildinfo",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"format": "eslint src/**/*.ts --fix"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contentstack/cli-utilities": "^1.4.
|
|
20
|
+
"@contentstack/cli-utilities": "^1.4.4",
|
|
21
21
|
"contentstack": "^3.10.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-command/<%- commandPath %>"
|
|
66
66
|
},
|
|
67
67
|
"repository": "contentstack/cli"
|
|
68
|
-
}
|
|
68
|
+
}
|
package/types/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Command } from '@contentstack/cli-utilities';
|
|
2
|
-
import { Region } from './interfaces';
|
|
3
|
-
declare abstract class ContentstackCommand extends Command {
|
|
4
|
-
private _email;
|
|
5
|
-
private _region;
|
|
6
|
-
private _rateLimit;
|
|
7
|
-
private _authToken;
|
|
8
|
-
private _deliveryAPIClient;
|
|
9
|
-
get context(): any;
|
|
10
|
-
get email(): string;
|
|
11
|
-
get deliveryAPIClient(): any;
|
|
12
|
-
get region(): Region;
|
|
13
|
-
get rateLimit(): string | 5;
|
|
14
|
-
get cmaHost(): string;
|
|
15
|
-
get cdaHost(): string;
|
|
16
|
-
get uiHost(): string;
|
|
17
|
-
get cdaAPIUrl(): string;
|
|
18
|
-
get cmaAPIUrl(): string;
|
|
19
|
-
get authToken(): string;
|
|
20
|
-
getToken(alias: any): any;
|
|
21
|
-
}
|
|
22
|
-
export { ContentstackCommand as Command };
|