@contentstack/cli-config 1.4.4 → 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 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.4 linux-x64 node-v16.20.0
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,6 @@
1
+ import { Command } from '@contentstack/cli-command';
2
+ export default class BranchGetCommand extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { Command } from '@contentstack/cli-command';
2
+ export default class RegionGetCommand extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ config: any;
6
+ run(): Promise<void>;
7
+ }
@@ -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,7 @@
1
+ declare const _default: {
2
+ logger: {
3
+ level: string;
4
+ silent: boolean;
5
+ };
6
+ };
7
+ export default _default;
@@ -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,2 @@
1
+ export { default as regionHandler } from './region-handler';
2
+ export * as interactive from './interactive';
@@ -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?:\\/\\/)?' + // protocol
6
- '(([a-z0-9A-Z]\\.)*[a-z0-9-]+\\.([a-z0-9]{2,})+(\\.[a-z]{2,}\\.([a-z]{2,})|\\.([a-z]{2,}))|' + // domain name
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.4",
2
+ "version": "1.4.6",
3
3
  "commands": {
4
4
  "config:get:base-branch": {
5
5
  "id": "config:get:base-branch",
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",
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.6",
25
- "@contentstack/cli-utilities": "^1.4.2",
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
+ }