@contentstack/cli-config 1.16.2 → 1.17.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/README.md +1 -1
- package/lib/base-command.d.ts +11 -2
- package/lib/base-command.js +3 -2
- package/lib/commands/config/get/base-branch.js +1 -1
- package/lib/commands/config/get/early-access-header.js +1 -1
- package/lib/commands/config/get/log.js +1 -1
- package/lib/commands/config/get/rate-limit.js +1 -1
- package/lib/commands/config/get/region.js +2 -2
- package/lib/commands/config/remove/base-branch.js +1 -1
- package/lib/commands/config/remove/early-access-header.js +5 -2
- package/lib/commands/config/remove/rate-limit.js +1 -1
- package/lib/commands/config/set/base-branch.js +1 -1
- package/lib/commands/config/set/early-access-header.js +1 -1
- package/lib/commands/config/set/log.js +1 -1
- package/lib/commands/config/set/rate-limit.js +1 -0
- package/lib/commands/config/set/region.js +1 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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.
|
|
21
|
+
@contentstack/cli-config/1.17.0 linux-x64 node-v22.21.1
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
package/lib/base-command.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { Command } from '@contentstack/cli-command';
|
|
2
|
-
import { ArgInput, Interfaces
|
|
2
|
+
import { ArgInput, Interfaces } from '@contentstack/cli-utilities';
|
|
3
3
|
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
|
|
4
4
|
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)['baseFlags'] & T['flags']>;
|
|
5
5
|
export declare abstract class BaseCommand<T extends typeof Command> extends Command {
|
|
6
|
-
|
|
6
|
+
contextDetails: {
|
|
7
|
+
command: string;
|
|
8
|
+
module: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
email: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
orgId: string;
|
|
14
|
+
authenticationMethod: string;
|
|
15
|
+
};
|
|
7
16
|
protected args: Args<T>;
|
|
8
17
|
protected flags: Flags<T>;
|
|
9
18
|
static args: ArgInput<{
|
package/lib/base-command.js
CHANGED
|
@@ -9,9 +9,10 @@ class BaseCommand extends cli_command_1.Command {
|
|
|
9
9
|
* plugins, registering the configuration, and initializing the logger.
|
|
10
10
|
*/
|
|
11
11
|
async init() {
|
|
12
|
+
var _a, _b;
|
|
12
13
|
await super.init();
|
|
13
|
-
// Init logger
|
|
14
|
-
this.
|
|
14
|
+
// Init logger context
|
|
15
|
+
this.contextDetails = Object.assign({}, (0, cli_utilities_1.createLogContext)(((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'config', '', cli_utilities_1.configHandler.get('authenticationMethod')));
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* The catch function is used to handle errors from a command, either by adding custom logic or
|
|
@@ -26,7 +26,7 @@ class GetEarlyAccessHeaderCommand extends cli_command_1.Command {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
catch (error) {
|
|
29
|
-
|
|
29
|
+
(0, cli_utilities_1.handleAndLogError)(error, { module: 'config-get-early-access-header' });
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -30,7 +30,7 @@ class RateLimitGetCommand extends cli_command_1.Command {
|
|
|
30
30
|
cli_utilities_1.cliux.table(headers, tableData);
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
33
|
-
|
|
33
|
+
(0, cli_utilities_1.handleAndLogError)(error, { module: 'config-get-rate-limit' });
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -6,7 +6,7 @@ class RegionGetCommand extends base_command_1.BaseCommand {
|
|
|
6
6
|
async run() {
|
|
7
7
|
let currentRegion = this.region;
|
|
8
8
|
if (!currentRegion) {
|
|
9
|
-
|
|
9
|
+
cli_utilities_1.log.error('No region is set.', this.contextDetails);
|
|
10
10
|
cli_utilities_1.cliux.error('CLI_CONFIG_GET_REGION_NOT_FOUND');
|
|
11
11
|
this.exit();
|
|
12
12
|
}
|
|
@@ -17,7 +17,7 @@ class RegionGetCommand extends base_command_1.BaseCommand {
|
|
|
17
17
|
cli_utilities_1.cliux.print(`Developer Hub URL: ${currentRegion.developerHubUrl}`);
|
|
18
18
|
cli_utilities_1.cliux.print(`Launch URL: ${currentRegion.launchHubUrl}`);
|
|
19
19
|
cli_utilities_1.cliux.print(`Personalize URL: ${currentRegion.personalizeUrl}`);
|
|
20
|
-
|
|
20
|
+
cli_utilities_1.log.info(`Currently using ${currentRegion.name} region`, this.contextDetails);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.default = RegionGetCommand;
|
|
@@ -24,7 +24,7 @@ class RemoveEarlyAccessHeader extends cli_command_1.Command {
|
|
|
24
24
|
cli_utilities_1.cliux.success(`Early Access header has been successfully removed`);
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
|
-
|
|
27
|
+
(0, cli_utilities_1.handleAndLogError)(error, { module: 'config-remove-early-access-header' });
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -33,7 +33,10 @@ RemoveEarlyAccessHeader.description = 'Remove Early Access header';
|
|
|
33
33
|
RemoveEarlyAccessHeader.aliases = ['config:remove:ea-header'];
|
|
34
34
|
RemoveEarlyAccessHeader.flags = {
|
|
35
35
|
'header-alias': cli_utilities_1.flags.string({ description: '(optional) Provide the Early Access header alias name.' }),
|
|
36
|
-
yes: cli_utilities_1.flags.boolean({
|
|
36
|
+
yes: cli_utilities_1.flags.boolean({
|
|
37
|
+
char: 'y',
|
|
38
|
+
description: '(optional) Force the removal of Early Access header configuration by skipping the confirmation.',
|
|
39
|
+
}),
|
|
37
40
|
};
|
|
38
41
|
RemoveEarlyAccessHeader.examples = [
|
|
39
42
|
'$ <%= config.bin %> <%= command.id %>',
|
|
@@ -20,7 +20,7 @@ class RateLimitRemoveCommand extends cli_command_1.Command {
|
|
|
20
20
|
cli_utilities_1.cliux.print(`Rate limit entry for organization UID ${org} has been removed.`, { color: 'green' });
|
|
21
21
|
}
|
|
22
22
|
catch (error) {
|
|
23
|
-
|
|
23
|
+
(0, cli_utilities_1.handleAndLogError)(error, { module: 'config-remove-rate-limit' });
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -21,7 +21,7 @@ class BranchSetCommand extends cli_command_1.Command {
|
|
|
21
21
|
cli_utilities_1.cliux.success(`Base branch configuration for stack-api-key: ${apiKey} and branch: ${baseBranch} set successfully`);
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
|
-
cli_utilities_1.
|
|
24
|
+
(0, cli_utilities_1.handleAndLogError)(error, { module: 'config-set-base-branch' });
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -18,7 +18,7 @@ class SetEarlyAccessHeaderCommand extends cli_command_1.Command {
|
|
|
18
18
|
cli_utilities_1.cliux.success(`Early Access header has been successfully set`);
|
|
19
19
|
}
|
|
20
20
|
catch (error) {
|
|
21
|
-
|
|
21
|
+
(0, cli_utilities_1.handleAndLogError)(error, { module: 'config-set-early-access-header' });
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -52,6 +52,7 @@ class SetRateLimitCommand extends base_command_1.BaseCommand {
|
|
|
52
52
|
await limitHandler.setRateLimit(config);
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
|
+
(0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.contextDetails), { module: 'config-set-rate-limit' }));
|
|
55
56
|
if (error === null || error === void 0 ? void 0 : error.message) {
|
|
56
57
|
cli_utilities_1.cliux.error(error.message);
|
|
57
58
|
}
|
|
@@ -65,8 +65,7 @@ class RegionSetCommand extends base_command_1.BaseCommand {
|
|
|
65
65
|
cli_utilities_1.cliux.success(`Studio URL: ${customRegion.composableStudioUrl}`);
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
|
-
|
|
69
|
-
cli_utilities_1.cliux.error(`Failed to set region due to: ${error.message}`);
|
|
68
|
+
(0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.contextDetails), { module: 'config-set-region' }));
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
else if (['NA', 'EU', 'AU', 'AWS-NA', 'AWS-EU', 'AWS-AU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED