@salesforce/plugin-settings 1.4.5 → 1.4.7
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/commands/alias/set.js +5 -1
- package/lib/commands/alias/set.js.map +1 -1
- package/lib/commands/alias/unset.js +5 -1
- package/lib/commands/alias/unset.js.map +1 -1
- package/lib/commands/config/get.d.ts +3 -2
- package/lib/commands/config/get.js +10 -27
- package/lib/commands/config/get.js.map +1 -1
- package/lib/commands/config/list.d.ts +4 -3
- package/lib/commands/config/list.js +4 -9
- package/lib/commands/config/list.js.map +1 -1
- package/lib/commands/config/set.d.ts +5 -6
- package/lib/commands/config/set.js +21 -67
- package/lib/commands/config/set.js.map +1 -1
- package/lib/commands/config/unset.d.ts +5 -6
- package/lib/commands/config/unset.js +13 -35
- package/lib/commands/config/unset.js.map +1 -1
- package/lib/config.d.ts +6 -9
- package/lib/config.js +83 -70
- package/lib/config.js.map +1 -1
- package/lib/hooks/init/load_config_meta.js +2 -3
- package/lib/hooks/init/load_config_meta.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +220 -221
- package/schemas/config-get.json +1 -1
- package/schemas/config-list.json +1 -1
- package/schemas/config-set.json +3 -3
- package/schemas/config-unset.json +3 -3
|
@@ -32,7 +32,11 @@ class AliasSet extends alias_1.AliasCommand {
|
|
|
32
32
|
return { alias, success: true, value };
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
|
-
const { name, message } = err
|
|
35
|
+
const { name, message } = err instanceof Error
|
|
36
|
+
? err
|
|
37
|
+
: typeof err === 'string'
|
|
38
|
+
? new Error(err)
|
|
39
|
+
: { name: 'UnknownError', message: 'Unknown Error' };
|
|
36
40
|
return { alias, success: false, error: { name, message }, value };
|
|
37
41
|
}
|
|
38
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/alias/set.ts"],"names":[],"mappings":";AAAA;;;;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,IAAI,EAAE,OAAO,EAAE,GACrB,GAAG,YAAY,KAAK;oBAClB,CAAC,CAAC,GAAG;oBACL,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ;wBACzB,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;wBAChB,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;gBACzD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC;aACnE;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAElC,OAAO,OAAO,CAAC;IACjB,CAAC;;AA7CH,2BA8CC;AA7Ce,gBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,oBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,iBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACnC,eAAM,GAAG,KAAK,CAAC,CAAC,sBAAsB;AACtC,gBAAO,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAC9B,yBAAgB,GAAG,IAAI,CAAC;AACxB,cAAK,GAAG,EAAE,QAAQ,EAAR,0BAAQ,EAAE,CAAC"}
|
|
@@ -37,7 +37,11 @@ class AliasUnset extends alias_1.AliasCommand {
|
|
|
37
37
|
return { alias, value, success: true };
|
|
38
38
|
}
|
|
39
39
|
catch (err) {
|
|
40
|
-
const { name, message } = err
|
|
40
|
+
const { name, message } = err instanceof Error
|
|
41
|
+
? err
|
|
42
|
+
: typeof err === 'string'
|
|
43
|
+
? new Error(err)
|
|
44
|
+
: { name: 'UnknownError', message: 'Unknown Error' };
|
|
41
45
|
return { alias, value, success: false, error: { name, message } };
|
|
42
46
|
}
|
|
43
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/alias/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/alias/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAA8D;AAC9D,2CAA6D;AAC7D,uCAAyD;AAEzD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,aAAa,CAAC,CAAC;AAErF,MAAqB,UAAW,SAAQ,oBAA0B;IAmBzD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAErD,MAAM,eAAe,GAAG,MAAM,sBAAe,CAAC,WAAW,EAAE,CAAC;QAC5D,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEjD,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,IAAiB,CAAC;QAEvE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,IAAI,KAAK,CAAC,GAAG,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC;gBACvD,OAAO,EAAE,CAAC;aACX;YACD,kDAAkD;YAClD,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;SAClD;QAED,uEAAuE;QACvE,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAA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AAC;AACnC,iBAAM,GAAG,KAAK,CAAC,CAAC,sBAAsB;AACtC,kBAAO,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAChC,2BAAgB,GAAG,IAAI,CAAC;AACjC,gBAAK,GAAG;IACpB,QAAQ,EAAR,0BAAQ;IACR,GAAG,EAAE,uBAAK,CAAC,OAAO,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC;QACjD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,WAAW,EAAE,uBAAK,CAAC,OAAO,CAAC;QACzB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;QACvD,IAAI,EAAE,GAAG;KACV,CAAC;CACH,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { ConfigResponses } from '../../config';
|
|
3
|
+
export declare class Get extends SfCommand<ConfigResponses> {
|
|
3
4
|
static readonly description: string;
|
|
4
5
|
static readonly summary: string;
|
|
5
6
|
static readonly examples: string[];
|
|
@@ -12,52 +12,35 @@ const core_1 = require("@salesforce/core");
|
|
|
12
12
|
const config_1 = require("../../config");
|
|
13
13
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
14
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.get');
|
|
15
|
-
class Get extends
|
|
15
|
+
class Get extends sf_plugins_core_1.SfCommand {
|
|
16
16
|
async run() {
|
|
17
17
|
const { argv, flags } = await this.parse(Get);
|
|
18
|
-
|
|
19
|
-
await core_1.SfdxConfigAggregator.create({});
|
|
18
|
+
const responses = [];
|
|
20
19
|
if (!argv || argv.length === 0) {
|
|
21
20
|
throw messages.createError('error.NoConfigKeysFound');
|
|
22
21
|
}
|
|
23
22
|
const aggregator = await core_1.ConfigAggregator.create();
|
|
24
23
|
for (const configName of argv) {
|
|
25
24
|
try {
|
|
26
|
-
|
|
25
|
+
responses.push((0, config_1.buildSuccessMsg)(aggregator.getInfo(configName)));
|
|
27
26
|
}
|
|
28
27
|
catch (err) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// because we've caught the deprecated error, the 'newKey' property will be set
|
|
32
|
-
const info = aggregator.getInfo(aggregator.getPropertyMeta(configName).newKey);
|
|
33
|
-
// deprecated key, so we'll get the replacement and return the value
|
|
34
|
-
this.responses.push({
|
|
35
|
-
name: info.key,
|
|
36
|
-
key: configName,
|
|
37
|
-
value: info.value,
|
|
38
|
-
deprecated: true,
|
|
39
|
-
location: info.location,
|
|
40
|
-
path: info.path,
|
|
41
|
-
error,
|
|
42
|
-
message: error.message,
|
|
43
|
-
success: true,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
else if (error.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
|
|
47
|
-
const suggestion = this.calculateSuggestion(configName);
|
|
28
|
+
if (err instanceof Error && err.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
|
|
29
|
+
const suggestion = (0, config_1.calculateSuggestion)(configName);
|
|
48
30
|
// eslint-disable-next-line no-await-in-loop
|
|
49
31
|
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
50
32
|
if (answer) {
|
|
51
|
-
|
|
33
|
+
responses.push((0, config_1.buildSuccessMsg)(aggregator.getInfo(suggestion, false)));
|
|
52
34
|
}
|
|
53
35
|
}
|
|
54
36
|
else {
|
|
55
|
-
|
|
37
|
+
responses.push((0, config_1.buildFailureMsg)(configName, err));
|
|
38
|
+
process.exitCode = 1;
|
|
56
39
|
}
|
|
57
40
|
}
|
|
58
41
|
}
|
|
59
|
-
|
|
60
|
-
return
|
|
42
|
+
(0, config_1.output)(new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }), responses, 'get', flags.verbose);
|
|
43
|
+
return responses;
|
|
61
44
|
}
|
|
62
45
|
}
|
|
63
46
|
exports.Get = Get;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/config/get.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/config/get.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iEAA6E;AAC7E,2CAA8D;AAC9D,yCAOsB;AAEtB,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,YAAY,CAAC,CAAC;AAEpF,MAAa,GAAI,SAAQ,2BAA0B;IAgB1C,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,SAAS,GAAoB,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,QAAQ,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;SACvD;QAED,MAAM,UAAU,GAAG,MAAM,uBAAgB,CAAC,MAAM,EAAE,CAAC;QAEnD,KAAK,MAAM,UAAU,IAAI,IAAgB,EAAE;YACzC,IAAI;gBACF,SAAS,CAAC,IAAI,CAAC,IAAA,wBAAe,EAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;aACjE;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;oBAC7F,MAAM,UAAU,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;oBACnD,4CAA4C;oBAC5C,MAAM,MAAM,GAAG,CAAC,MAAM,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ommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { ConfigResponses } from '../../config';
|
|
3
|
+
export default class List extends SfCommand<ConfigResponses> {
|
|
3
4
|
static readonly description: string;
|
|
4
5
|
static readonly summary: string;
|
|
5
6
|
static readonly examples: string[];
|
|
6
7
|
static readonly aliases: string[];
|
|
7
8
|
static readonly deprecateAliases = true;
|
|
8
|
-
static flags: {
|
|
9
|
+
static readonly flags: {
|
|
9
10
|
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<ConfigResponses>;
|
|
@@ -11,17 +11,12 @@ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
|
11
11
|
const config_1 = require("../../config");
|
|
12
12
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
13
13
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.list');
|
|
14
|
-
class List extends
|
|
14
|
+
class List extends sf_plugins_core_1.SfCommand {
|
|
15
15
|
async run() {
|
|
16
|
-
await core_1.SfdxConfigAggregator.create({});
|
|
17
16
|
const aggregator = await core_1.ConfigAggregator.create();
|
|
18
|
-
aggregator.getConfigInfo().
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!this.jsonEnabled()) {
|
|
22
|
-
this.output('List Config', true);
|
|
23
|
-
}
|
|
24
|
-
return this.responses;
|
|
17
|
+
const responses = aggregator.getConfigInfo().map((c) => (0, config_1.buildSuccessMsg)(c));
|
|
18
|
+
(0, config_1.output)(new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }), responses, 'list', true);
|
|
19
|
+
return responses;
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
exports.default = List;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/config/list.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/config/list.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,2CAA8D;AAC9D,iEAAsE;AACtE,yCAAwE;AAExE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,aAAa,CAAC,CAAC;AAErF,MAAqB,IAAK,SAAQ,2BAA0B;IAQnD,KAAK,CAAC,GAAG;QACd,MAAM,UAAU,GAAG,MAAM,uBAAgB,CAAC,MAAM,EAAE,CAAC;QAEnD,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,wBAAe,EAAC,CAAC,CAAC,CAAC,CAAC;QAE5E,IAAA,eAAM,EAAC,IAAI,oBAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAE7E,OAAO,SAAS,CAAC;IACnB,CAAC;;AAhBH,uBAiBC;AAhBwB,gBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,YAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,aAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,YAAO,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAChC,qBAAgB,GAAG,IAAI,CAAC;AACxB,UAAK,GAAG,EAAE,QAAQ,EAAR,0BAAQ,EAAE,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Msg } from '../../config';
|
|
3
|
+
export type SetOrUnsetConfigCommandResult = {
|
|
3
4
|
successes: Msg[];
|
|
4
5
|
failures: Msg[];
|
|
5
6
|
};
|
|
6
|
-
export declare class Set extends
|
|
7
|
+
export declare class Set extends SfCommand<SetOrUnsetConfigCommandResult> {
|
|
7
8
|
static readonly description: string;
|
|
8
9
|
static readonly summary: string;
|
|
9
10
|
static readonly examples: string[];
|
|
@@ -15,7 +16,5 @@ export declare class Set extends ConfigCommand<SetConfigCommandResult> {
|
|
|
15
16
|
global: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
};
|
|
17
18
|
static configurationVariablesSection: import("@oclif/core").HelpSection;
|
|
18
|
-
|
|
19
|
-
run(): Promise<SetConfigCommandResult>;
|
|
20
|
-
protected pushFailure(name: string, err: string | Error, value?: string): void;
|
|
19
|
+
run(): Promise<SetOrUnsetConfigCommandResult>;
|
|
21
20
|
}
|
|
@@ -12,106 +12,61 @@ const core_1 = require("@salesforce/core");
|
|
|
12
12
|
const config_1 = require("../../config");
|
|
13
13
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
14
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.set');
|
|
15
|
-
class Set extends
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.setResponses = { successes: [], failures: [] };
|
|
19
|
-
}
|
|
15
|
+
class Set extends sf_plugins_core_1.SfCommand {
|
|
20
16
|
async run() {
|
|
21
17
|
const { args, argv, flags } = await this.parse(Set);
|
|
22
18
|
const config = await loadConfig(flags.global);
|
|
19
|
+
const responses = { successes: [], failures: [] };
|
|
23
20
|
if (!argv.length)
|
|
24
21
|
throw messages.createError('error.ArgumentsRequired');
|
|
25
22
|
const parsed = (0, sf_plugins_core_1.parseVarArgs)(args, argv);
|
|
26
|
-
for (const name of Object.
|
|
27
|
-
|
|
23
|
+
for (const [name, value] of Object.entries(parsed)) {
|
|
24
|
+
let resolvedName = name;
|
|
28
25
|
try {
|
|
26
|
+
// this needs to be inside the try/catch because it can throw an error
|
|
27
|
+
resolvedName = this.configAggregator.getPropertyMeta(name)?.newKey ?? name;
|
|
29
28
|
if (!value) {
|
|
30
29
|
// Push a failure if users are try to unset a value with `set=`.
|
|
31
|
-
|
|
30
|
+
responses.failures.push((0, config_1.buildFailureMsg)(name, messages.createError('error.ValueRequired'), value));
|
|
32
31
|
}
|
|
33
32
|
else {
|
|
34
33
|
// core's builtin config validation requires synchronous functions but there's
|
|
35
34
|
// currently no way to validate an org synchronously. Therefore, we have to manually
|
|
36
35
|
// validate the org here and manually set the error message if it fails
|
|
37
36
|
// eslint-disable-next-line no-await-in-loop
|
|
38
|
-
if (isOrgKey(
|
|
37
|
+
if (isOrgKey(resolvedName) && value)
|
|
39
38
|
await validateOrg(value);
|
|
40
|
-
config.set(
|
|
41
|
-
|
|
39
|
+
config.set(resolvedName, value);
|
|
40
|
+
responses.successes.push({ name: resolvedName, value, success: true });
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
catch (
|
|
45
|
-
|
|
46
|
-
if (error.name === 'DeprecatedConfigKeyError') {
|
|
47
|
-
const newKey = core_1.Config.getPropertyConfigMeta(name)?.key ?? name;
|
|
48
|
-
try {
|
|
49
|
-
config.set(newKey, value);
|
|
50
|
-
this.setResponses.successes.push({
|
|
51
|
-
name,
|
|
52
|
-
value,
|
|
53
|
-
success: true,
|
|
54
|
-
error,
|
|
55
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
const secondError = e;
|
|
60
|
-
// if that deprecated value was also set to an invalid value
|
|
61
|
-
this.setResponses.failures.push({
|
|
62
|
-
name,
|
|
63
|
-
key: name,
|
|
64
|
-
success: false,
|
|
65
|
-
value,
|
|
66
|
-
error: secondError,
|
|
67
|
-
message: secondError.message.replace(/\.\.$/, '.'),
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else if (error.name.includes('UnknownConfigKeyError')) {
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error instanceof Error && error.name.includes('UnknownConfigKeyError')) {
|
|
72
45
|
if (this.jsonEnabled()) {
|
|
73
|
-
|
|
74
|
-
this.setResponses.failures.push({
|
|
75
|
-
name,
|
|
76
|
-
value,
|
|
77
|
-
success: false,
|
|
78
|
-
error,
|
|
79
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
80
|
-
});
|
|
46
|
+
responses.failures.push((0, config_1.buildFailureMsg)(resolvedName, error, value));
|
|
81
47
|
}
|
|
82
48
|
else {
|
|
83
|
-
const suggestion =
|
|
49
|
+
const suggestion = (0, config_1.calculateSuggestion)(name);
|
|
84
50
|
// eslint-disable-next-line no-await-in-loop
|
|
85
51
|
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
86
|
-
if (answer) {
|
|
52
|
+
if (answer && value) {
|
|
87
53
|
const key = core_1.Config.getPropertyConfigMeta(suggestion)?.key ?? suggestion;
|
|
88
54
|
config.set(key, value);
|
|
89
|
-
|
|
55
|
+
responses.successes.push({ name: key, value, success: true });
|
|
90
56
|
}
|
|
91
57
|
}
|
|
92
58
|
}
|
|
93
59
|
else {
|
|
94
|
-
|
|
60
|
+
responses.failures.push((0, config_1.buildFailureMsg)(resolvedName, error, value));
|
|
95
61
|
}
|
|
96
62
|
}
|
|
97
63
|
}
|
|
98
64
|
await config.write();
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
this.output('Set Config', false);
|
|
65
|
+
if (responses.failures.length) {
|
|
66
|
+
process.exitCode = 1;
|
|
102
67
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
pushFailure(name, err, value) {
|
|
106
|
-
const error = core_1.SfError.wrap(err);
|
|
107
|
-
this.setResponses.failures.push({
|
|
108
|
-
name,
|
|
109
|
-
success: false,
|
|
110
|
-
value,
|
|
111
|
-
error,
|
|
112
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
113
|
-
});
|
|
114
|
-
process.exitCode = 1;
|
|
68
|
+
(0, config_1.output)(new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }), [...responses.successes, ...responses.failures], 'set');
|
|
69
|
+
return responses;
|
|
115
70
|
}
|
|
116
71
|
}
|
|
117
72
|
exports.Set = Set;
|
|
@@ -131,7 +86,6 @@ Set.flags = {
|
|
|
131
86
|
Set.configurationVariablesSection = config_1.CONFIG_HELP_SECTION;
|
|
132
87
|
const loadConfig = async (global) => {
|
|
133
88
|
try {
|
|
134
|
-
await core_1.SfdxConfigAggregator.create({});
|
|
135
89
|
const config = await core_1.Config.create(core_1.Config.getDefaultOptions(global));
|
|
136
90
|
await config.read();
|
|
137
91
|
return config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/config/set.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/config/set.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAA2F;AAC3F,2CAAuF;AACvF,yCAAsG;AAEtG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,YAAY,CAAC,CAAC;AAIpF,MAAa,GAAI,SAAQ,2BAAwC;IAiBxD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,MAAM,GAAW,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,SAAS,GAAkC,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;QAEjF,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,QAAQ,CAAC,WAAW,CAAC,y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CAAC,CAAC;KAC/E;AACH,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare class UnSet extends
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SetOrUnsetConfigCommandResult } from './set';
|
|
3
|
+
export declare class UnSet extends SfCommand<SetOrUnsetConfigCommandResult> {
|
|
4
4
|
static readonly description: string;
|
|
5
5
|
static readonly summary: string;
|
|
6
6
|
static readonly examples: string[];
|
|
@@ -12,7 +12,6 @@ export declare class UnSet extends ConfigCommand<SetConfigCommandResult> {
|
|
|
12
12
|
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
13
|
global: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
};
|
|
15
|
-
private
|
|
16
|
-
run(): Promise<
|
|
17
|
-
protected pushFailure(name: string, err: string | Error, value?: string): void;
|
|
15
|
+
private responses;
|
|
16
|
+
run(): Promise<SetOrUnsetConfigCommandResult>;
|
|
18
17
|
}
|
|
@@ -12,14 +12,13 @@ const core_1 = require("@salesforce/core");
|
|
|
12
12
|
const config_1 = require("../../config");
|
|
13
13
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
14
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.unset');
|
|
15
|
-
class UnSet extends
|
|
15
|
+
class UnSet extends sf_plugins_core_1.SfCommand {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
this.
|
|
18
|
+
this.responses = { successes: [], failures: [] };
|
|
19
19
|
}
|
|
20
20
|
async run() {
|
|
21
21
|
const { argv, flags } = await this.parse(UnSet);
|
|
22
|
-
await core_1.SfdxConfigAggregator.create({});
|
|
23
22
|
if (!argv || argv.length === 0) {
|
|
24
23
|
throw messages.createError('error.NoConfigKeysFound');
|
|
25
24
|
}
|
|
@@ -27,28 +26,18 @@ class UnSet extends config_1.ConfigCommand {
|
|
|
27
26
|
await config.read();
|
|
28
27
|
for (const key of argv) {
|
|
29
28
|
try {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const resolvedName = this.configAggregator.getPropertyMeta(key)?.newKey ?? key;
|
|
30
|
+
config.unset(resolvedName);
|
|
31
|
+
this.responses.successes.push({ name: resolvedName, success: true });
|
|
32
32
|
}
|
|
33
|
-
catch (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const meta = core_1.Config.getPropertyConfigMeta(key);
|
|
37
|
-
config.unset(meta?.key ?? key);
|
|
38
|
-
this.unsetResponses.successes.push({
|
|
39
|
-
name: key,
|
|
40
|
-
success: true,
|
|
41
|
-
error,
|
|
42
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
else if (error.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
|
|
46
|
-
const suggestion = this.calculateSuggestion(key);
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (error instanceof Error && error.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
|
|
35
|
+
const suggestion = (0, config_1.calculateSuggestion)(key);
|
|
47
36
|
// eslint-disable-next-line no-await-in-loop
|
|
48
37
|
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
49
38
|
if (answer) {
|
|
50
39
|
config.unset(suggestion);
|
|
51
|
-
this.
|
|
40
|
+
this.responses.successes.push({
|
|
52
41
|
name: suggestion,
|
|
53
42
|
success: true,
|
|
54
43
|
error,
|
|
@@ -57,25 +46,14 @@ class UnSet extends config_1.ConfigCommand {
|
|
|
57
46
|
}
|
|
58
47
|
}
|
|
59
48
|
else {
|
|
60
|
-
this.
|
|
49
|
+
this.responses.failures.push((0, config_1.buildFailureMsg)(key, error));
|
|
50
|
+
process.exitCode = 1;
|
|
61
51
|
}
|
|
62
52
|
}
|
|
63
53
|
}
|
|
64
54
|
await config.write();
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
return this.unsetResponses;
|
|
68
|
-
}
|
|
69
|
-
pushFailure(name, err, value) {
|
|
70
|
-
const error = core_1.SfError.wrap(err);
|
|
71
|
-
this.unsetResponses.failures.push({
|
|
72
|
-
name,
|
|
73
|
-
success: false,
|
|
74
|
-
value,
|
|
75
|
-
error,
|
|
76
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
77
|
-
});
|
|
78
|
-
process.exitCode = 1;
|
|
55
|
+
(0, config_1.output)(new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }), [...this.responses.successes, ...this.responses.failures], 'unset');
|
|
56
|
+
return this.responses;
|
|
79
57
|
}
|
|
80
58
|
}
|
|
81
59
|
exports.UnSet = UnSet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/config/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/config/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAA6E;AAC7E,2CAAoD;AACpD,yCAAiG;AAGjG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAAC;AAEtF,MAAa,KAAM,SAAQ,2BAAwC;IAAnE;;QAeU,cAAS,GAAkC,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IA8CrF,CAAC;IA5CQ,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEhD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,E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3
3
|
export type Msg = {
|
|
4
4
|
name: string;
|
|
5
|
-
value?: string;
|
|
5
|
+
value?: string | boolean | number | null;
|
|
6
6
|
success: boolean;
|
|
7
7
|
location?: string;
|
|
8
8
|
path?: string;
|
|
@@ -21,10 +21,7 @@ export type Msg = {
|
|
|
21
21
|
};
|
|
22
22
|
export type ConfigResponses = Msg[];
|
|
23
23
|
export declare const CONFIG_HELP_SECTION: import("@oclif/core").HelpSection;
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
protected pushFailure(name: string, err: string | Error, value?: string): void;
|
|
29
|
-
protected output(title: string, verbose: boolean): void;
|
|
30
|
-
}
|
|
24
|
+
export declare const calculateSuggestion: (userEnteredConfig: string) => string;
|
|
25
|
+
export declare const buildFailureMsg: (name: string, err: unknown, value?: string) => Msg;
|
|
26
|
+
export declare const buildSuccessMsg: (configInfo: ConfigInfo) => Msg;
|
|
27
|
+
export declare const output: (ux: Ux, responses: Msg[], command: 'set' | 'unset' | 'list' | 'get', verbose?: boolean) => void;
|