@contentstack/cli-config 1.4.5 → 1.4.6
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 +1 -1
- package/lib/commands/config/get/base-branch.d.ts +6 -0
- package/lib/commands/config/get/region.d.ts +7 -0
- package/lib/commands/config/remove/base-branch.d.ts +8 -0
- package/lib/commands/config/set/base-branch.d.ts +8 -0
- package/lib/commands/config/set/region.d.ts +10 -0
- package/lib/config/index.d.ts +7 -0
- package/lib/interfaces/index.d.ts +16 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/interactive.d.ts +6 -0
- package/lib/utils/region-handler.d.ts +42 -0
- package/lib/utils/region-handler.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
|
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ csdx (--version)
|
|
21
|
-
@contentstack/cli-config/1.4.
|
|
21
|
+
@contentstack/cli-config/1.4.6 linux-x64 node-v16.20.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from '@contentstack/cli-command';
|
|
2
|
+
import { FlagInput } from '@contentstack/cli-utilities';
|
|
3
|
+
export default class RemoveBranchConfigCommand extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: FlagInput;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from '@contentstack/cli-command';
|
|
2
|
+
import { FlagInput } from '@contentstack/cli-utilities';
|
|
3
|
+
export default class BranchSetCommand extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: FlagInput;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@contentstack/cli-command';
|
|
2
|
+
import { FlagInput, ArgInput } from '@contentstack/cli-utilities';
|
|
3
|
+
export default class RegionSetCommand extends Command {
|
|
4
|
+
config: any;
|
|
5
|
+
static description: string;
|
|
6
|
+
static flags: FlagInput;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static args: ArgInput;
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface PrintOptions {
|
|
2
|
+
color?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface InquirePayload {
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
message: string;
|
|
8
|
+
choices?: Array<any>;
|
|
9
|
+
transformer?: Function;
|
|
10
|
+
}
|
|
11
|
+
export interface Region {
|
|
12
|
+
name: string;
|
|
13
|
+
cma: string;
|
|
14
|
+
cda: string;
|
|
15
|
+
uiHost: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const askRegions: () => Promise<string>;
|
|
2
|
+
export declare const askCustomRegion: () => Promise<any>;
|
|
3
|
+
export declare function askStackAPIKey(): Promise<string>;
|
|
4
|
+
export declare function askBaseBranch(): Promise<string>;
|
|
5
|
+
export declare function askConfirmation(): Promise<boolean>;
|
|
6
|
+
export declare function inquireRequireFieldValidation(input: any): string | boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare class UserConfig {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Set region to config store
|
|
5
|
+
* @param {string} region It Can be NA, EU
|
|
6
|
+
* @returns {object} region object with cma, cda, region property
|
|
7
|
+
*/
|
|
8
|
+
setRegion(region: any): any;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Get current host set for CLI
|
|
12
|
+
* @returns { object } Object contains url for cma and cda, and region to which it is pointing to
|
|
13
|
+
*/
|
|
14
|
+
getRegion(): any;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* Set region to config store
|
|
18
|
+
* @param {object} regionObject should contain cma, cda, region property
|
|
19
|
+
* @returns {object} region object with cma, cda, region(name of region) property
|
|
20
|
+
*/
|
|
21
|
+
setCustomRegion(regionObject: any): any;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* Set rateLimit to config store
|
|
25
|
+
* @param {object} rateLimitObject should contain rate limit property
|
|
26
|
+
* @returns {object} ratelimit object with limit property
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Validate given region JSON object
|
|
30
|
+
* @param {*} regionObject JSON object needs to be validated
|
|
31
|
+
* @returns {boolean} True if contains cma, cda and region property otherwise false
|
|
32
|
+
*/
|
|
33
|
+
validateRegion(regionObject: any): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Sanitize given region JSON object by removing any other properties than cma, cda and region
|
|
36
|
+
* @param { object } regionObject JSON object needs to be sanitized
|
|
37
|
+
* @returns { object } JSON object with only valid keys for region
|
|
38
|
+
*/
|
|
39
|
+
sanitizeRegionObject(regionObject: any): any;
|
|
40
|
+
}
|
|
41
|
+
declare const _default: UserConfig;
|
|
42
|
+
export default _default;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
4
4
|
function validURL(str) {
|
|
5
|
-
const pattern = new RegExp('^(https
|
|
6
|
-
'(([a-z0-9A-Z]
|
|
5
|
+
const pattern = new RegExp('^(https:\\/\\/)?' + // protocol
|
|
6
|
+
'((([a-z0-9A-Z]*)[\\. |-]([a-z0-9A-Z]*))[\\.|-]([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
|
package/oclif.manifest.json
CHANGED
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.4.
|
|
4
|
+
"version": "1.4.6",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run clean && npm run compile",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@contentstack/cli-command": "^1.2.
|
|
25
|
-
"@contentstack/cli-utilities": "^1.4.
|
|
24
|
+
"@contentstack/cli-command": "^1.2.8",
|
|
25
|
+
"@contentstack/cli-utilities": "^1.4.4",
|
|
26
26
|
"chalk": "^4.0.0",
|
|
27
27
|
"debug": "^4.1.1",
|
|
28
28
|
"inquirer": "8.2.4",
|
|
@@ -81,4 +81,4 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"repository": "contentstack/cli"
|
|
84
|
-
}
|
|
84
|
+
}
|