@salesforce/plugin-settings 1.4.6 → 1.4.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/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 -9
- 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 -8
- package/lib/commands/config/list.js.map +1 -1
- package/lib/commands/config/set.d.ts +5 -6
- package/lib/commands/config/set.js +16 -39
- package/lib/commands/config/set.js.map +1 -1
- package/lib/commands/config/unset.d.ts +5 -6
- package/lib/commands/config/unset.js +11 -23
- package/lib/commands/config/unset.js.map +1 -1
- package/lib/config.d.ts +6 -9
- package/lib/config.js +83 -71
- 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 +15 -15
- 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,34 +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
|
+
const responses = [];
|
|
18
19
|
if (!argv || argv.length === 0) {
|
|
19
20
|
throw messages.createError('error.NoConfigKeysFound');
|
|
20
21
|
}
|
|
21
22
|
const aggregator = await core_1.ConfigAggregator.create();
|
|
22
23
|
for (const configName of argv) {
|
|
23
24
|
try {
|
|
24
|
-
|
|
25
|
+
responses.push((0, config_1.buildSuccessMsg)(aggregator.getInfo(configName)));
|
|
25
26
|
}
|
|
26
27
|
catch (err) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const suggestion = this.calculateSuggestion(configName);
|
|
28
|
+
if (err instanceof Error && err.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
|
|
29
|
+
const suggestion = (0, config_1.calculateSuggestion)(configName);
|
|
30
30
|
// eslint-disable-next-line no-await-in-loop
|
|
31
31
|
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
32
32
|
if (answer) {
|
|
33
|
-
|
|
33
|
+
responses.push((0, config_1.buildSuccessMsg)(aggregator.getInfo(suggestion, false)));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
|
|
37
|
+
responses.push((0, config_1.buildFailureMsg)(configName, err));
|
|
38
|
+
process.exitCode = 1;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
-
return
|
|
42
|
+
(0, config_1.output)(new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }), responses, 'get', flags.verbose);
|
|
43
|
+
return responses;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
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;Q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AC,IAAI,oBAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACrF,OAAO,SAAS,CAAC;IACnB,CAAC;;AA7CH,kBA8CC;AA7CwB,eAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,WAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,YAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,WAAO,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAC/B,oBAAgB,GAAG,IAAI,CAAC;AACxB,UAAM,GAAG,KAAK,CAAC;AACf,SAAK,GAAG;IAC7B,QAAQ,EAAR,0BAAQ;IACR,OAAO,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;KACtD,CAAC;CACH,CAAC;AAEY,iCAA6B,GAAG,4BAAmB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SfCommand } 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,16 +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
16
|
const aggregator = await core_1.ConfigAggregator.create();
|
|
17
|
-
aggregator.getConfigInfo().
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!this.jsonEnabled()) {
|
|
21
|
-
this.output('List Config', true);
|
|
22
|
-
}
|
|
23
|
-
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;
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
22
|
exports.default = List;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/config/list.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,2CAA8D;AAC9D,
|
|
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,26 +12,22 @@ 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
|
-
const value = parsed[name];
|
|
23
|
+
for (const [name, value] of Object.entries(parsed)) {
|
|
28
24
|
let resolvedName = name;
|
|
29
25
|
try {
|
|
30
26
|
// this needs to be inside the try/catch because it can throw an error
|
|
31
27
|
resolvedName = this.configAggregator.getPropertyMeta(name)?.newKey ?? name;
|
|
32
28
|
if (!value) {
|
|
33
29
|
// Push a failure if users are try to unset a value with `set=`.
|
|
34
|
-
|
|
30
|
+
responses.failures.push((0, config_1.buildFailureMsg)(name, messages.createError('error.ValueRequired'), value));
|
|
35
31
|
}
|
|
36
32
|
else {
|
|
37
33
|
// core's builtin config validation requires synchronous functions but there's
|
|
@@ -41,55 +37,36 @@ class Set extends config_1.ConfigCommand {
|
|
|
41
37
|
if (isOrgKey(resolvedName) && value)
|
|
42
38
|
await validateOrg(value);
|
|
43
39
|
config.set(resolvedName, value);
|
|
44
|
-
|
|
40
|
+
responses.successes.push({ name: resolvedName, value, success: true });
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
|
-
catch (
|
|
48
|
-
|
|
49
|
-
if (error.name.includes('UnknownConfigKeyError')) {
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error instanceof Error && error.name.includes('UnknownConfigKeyError')) {
|
|
50
45
|
if (this.jsonEnabled()) {
|
|
51
|
-
|
|
52
|
-
this.setResponses.failures.push({
|
|
53
|
-
name,
|
|
54
|
-
value,
|
|
55
|
-
success: false,
|
|
56
|
-
error,
|
|
57
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
58
|
-
});
|
|
46
|
+
responses.failures.push((0, config_1.buildFailureMsg)(resolvedName, error, value));
|
|
59
47
|
}
|
|
60
48
|
else {
|
|
61
|
-
const suggestion =
|
|
49
|
+
const suggestion = (0, config_1.calculateSuggestion)(name);
|
|
62
50
|
// eslint-disable-next-line no-await-in-loop
|
|
63
51
|
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
64
|
-
if (answer) {
|
|
52
|
+
if (answer && value) {
|
|
65
53
|
const key = core_1.Config.getPropertyConfigMeta(suggestion)?.key ?? suggestion;
|
|
66
54
|
config.set(key, value);
|
|
67
|
-
|
|
55
|
+
responses.successes.push({ name: key, value, success: true });
|
|
68
56
|
}
|
|
69
57
|
}
|
|
70
58
|
}
|
|
71
59
|
else {
|
|
72
|
-
|
|
60
|
+
responses.failures.push((0, config_1.buildFailureMsg)(resolvedName, error, value));
|
|
73
61
|
}
|
|
74
62
|
}
|
|
75
63
|
}
|
|
76
64
|
await config.write();
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
this.output('Set Config', false);
|
|
65
|
+
if (responses.failures.length) {
|
|
66
|
+
process.exitCode = 1;
|
|
80
67
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
pushFailure(name, err, value) {
|
|
84
|
-
const error = core_1.SfError.wrap(err);
|
|
85
|
-
this.setResponses.failures.push({
|
|
86
|
-
name,
|
|
87
|
-
success: false,
|
|
88
|
-
value,
|
|
89
|
-
error,
|
|
90
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
91
|
-
});
|
|
92
|
-
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;
|
|
93
70
|
}
|
|
94
71
|
}
|
|
95
72
|
exports.Set = Set;
|
|
@@ -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,yBAAyB,CAAC,CAAC;QAExE,MAAM,MAAM,GAAG,IAAA,8BAAY,EAAC,IAAI,EAAE,IAAgB,CAAC,CAAC;QAEpD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,C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etOrUnsetConfigCommandResult } 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,10 +12,10 @@ 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);
|
|
@@ -28,17 +28,16 @@ class UnSet extends config_1.ConfigCommand {
|
|
|
28
28
|
try {
|
|
29
29
|
const resolvedName = this.configAggregator.getPropertyMeta(key)?.newKey ?? key;
|
|
30
30
|
config.unset(resolvedName);
|
|
31
|
-
this.
|
|
31
|
+
this.responses.successes.push({ name: resolvedName, success: true });
|
|
32
32
|
}
|
|
33
|
-
catch (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
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);
|
|
37
36
|
// eslint-disable-next-line no-await-in-loop
|
|
38
37
|
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
39
38
|
if (answer) {
|
|
40
39
|
config.unset(suggestion);
|
|
41
|
-
this.
|
|
40
|
+
this.responses.successes.push({
|
|
42
41
|
name: suggestion,
|
|
43
42
|
success: true,
|
|
44
43
|
error,
|
|
@@ -47,25 +46,14 @@ class UnSet extends config_1.ConfigCommand {
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
else {
|
|
50
|
-
this.
|
|
49
|
+
this.responses.failures.push((0, config_1.buildFailureMsg)(key, error));
|
|
50
|
+
process.exitCode = 1;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
await config.write();
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
return this.unsetResponses;
|
|
58
|
-
}
|
|
59
|
-
pushFailure(name, err, value) {
|
|
60
|
-
const error = core_1.SfError.wrap(err);
|
|
61
|
-
this.unsetResponses.failures.push({
|
|
62
|
-
name,
|
|
63
|
-
success: false,
|
|
64
|
-
value,
|
|
65
|
-
error,
|
|
66
|
-
message: error.message.replace(/\.\.$/, '.'),
|
|
67
|
-
});
|
|
68
|
-
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;
|
|
69
57
|
}
|
|
70
58
|
}
|
|
71
59
|
exports.UnSet = UnSet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/config/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
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,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,cAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,YAAM,GAAG,KAAK,CAAC;AACf,aAAO,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACjC,sBAAgB,GAAG,IAAI,CAAC;AACjC,mCAA6B,GAAG,4BAAmB,CAAC;AAC3C,WAAK,GAAG;IAC7B,QAAQ,EAAR,0BAAQ;IACR,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;KACrD,CAAC;CACH,CAAC"}
|
package/lib/config.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ux } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { ConfigInfo } from '@salesforce/core';
|
|
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;
|
package/lib/config.js
CHANGED
|
@@ -6,81 +6,93 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
9
|
+
exports.output = exports.buildSuccessMsg = exports.buildFailureMsg = exports.calculateSuggestion = exports.CONFIG_HELP_SECTION = void 0;
|
|
11
10
|
const core_1 = require("@salesforce/core");
|
|
12
|
-
const
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
13
12
|
const Levenshtein = require("fast-levenshtein");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
const ts_types_1 = require("@salesforce/ts-types");
|
|
14
|
+
exports.CONFIG_HELP_SECTION = (0, sf_plugins_core_1.toHelpSection)('CONFIGURATION VARIABLES', ...new Set(core_1.Config.getAllowedProperties().map((k) => k.newKey ?? k.key)));
|
|
15
|
+
const calculateSuggestion = (userEnteredConfig) => {
|
|
16
|
+
// we'll use this array to keep track of which key is the closest to the users entered value.
|
|
17
|
+
// keys closer to the index 0 will be a closer guess than keys indexed further from 0
|
|
18
|
+
// an entry at 0 would be a direct match, an entry at 1 would be a single character off, etc.
|
|
19
|
+
const index = [];
|
|
20
|
+
core_1.Config.getAllowedProperties()
|
|
21
|
+
.map((k) => k.newKey ?? k.key)
|
|
22
|
+
.map((k) => (index[Levenshtein.get(userEnteredConfig, k)] = k));
|
|
23
|
+
return index.find((item) => item !== undefined) ?? '';
|
|
24
|
+
};
|
|
25
|
+
exports.calculateSuggestion = calculateSuggestion;
|
|
26
|
+
const buildFailureMsg = (name, err, value) => {
|
|
27
|
+
const error = core_1.SfError.wrap(typeof err !== 'string' && !(err instanceof Error) ? 'Unknown error' : err);
|
|
28
|
+
return {
|
|
29
|
+
name,
|
|
30
|
+
success: false,
|
|
31
|
+
value,
|
|
32
|
+
error,
|
|
33
|
+
message: error.message.replace(/\.\.$/, '.'),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.buildFailureMsg = buildFailureMsg;
|
|
37
|
+
const buildSuccessMsg = (configInfo) => {
|
|
38
|
+
if (Array.isArray(configInfo.value)) {
|
|
39
|
+
throw new core_1.SfError(`Config ${configInfo.key} is an Array. It should be a primitive.`);
|
|
30
40
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
name: configInfo.key,
|
|
34
|
-
key: configInfo.key,
|
|
35
|
-
value: configInfo.value,
|
|
36
|
-
path: configInfo.path,
|
|
37
|
-
success: true,
|
|
38
|
-
location: configInfo.location,
|
|
39
|
-
});
|
|
41
|
+
if ((0, ts_types_1.isJsonMap)(configInfo.value)) {
|
|
42
|
+
throw new core_1.SfError(`Config ${configInfo.key} is an Object. It should be a primitive.`);
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
return {
|
|
45
|
+
name: configInfo.key,
|
|
46
|
+
key: configInfo.key,
|
|
47
|
+
value: configInfo.value,
|
|
48
|
+
path: configInfo.path,
|
|
49
|
+
success: true,
|
|
50
|
+
location: configInfo.location,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports.buildSuccessMsg = buildSuccessMsg;
|
|
54
|
+
const output = (ux, responses, command, verbose = false) => {
|
|
55
|
+
if (!ux.outputEnabled) {
|
|
56
|
+
return;
|
|
51
57
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const columns = {
|
|
58
|
-
name: { header: 'Name' },
|
|
59
|
-
};
|
|
60
|
-
if (!title.includes('Unset')) {
|
|
61
|
-
columns.value = {
|
|
62
|
-
header: 'Value',
|
|
63
|
-
get: (row) => row.value ?? '',
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
if (!title.includes('List')) {
|
|
67
|
-
columns.success = { header: 'Success' };
|
|
68
|
-
}
|
|
69
|
-
if (verbose) {
|
|
70
|
-
columns.location = {
|
|
71
|
-
header: 'Location',
|
|
72
|
-
get: (row) => row.location ?? '',
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
if (this.responses.some((msg) => msg.error)) {
|
|
76
|
-
columns.message = {
|
|
77
|
-
header: 'Message',
|
|
78
|
-
get: (row) => row.message ?? '',
|
|
79
|
-
};
|
|
80
|
-
this.responses.map((msg) => (msg.message = msg.error?.message));
|
|
81
|
-
}
|
|
82
|
-
this.table(this.responses, columns, { title });
|
|
58
|
+
if (responses.length === 0) {
|
|
59
|
+
ux.log('No results found');
|
|
60
|
+
return;
|
|
83
61
|
}
|
|
84
|
-
|
|
85
|
-
|
|
62
|
+
ux.table(responses, {
|
|
63
|
+
name: { header: 'Name' },
|
|
64
|
+
...(verbose
|
|
65
|
+
? {
|
|
66
|
+
location: {
|
|
67
|
+
header: 'Location',
|
|
68
|
+
get: (row) => row.location ?? '',
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
: {}),
|
|
72
|
+
...(command === 'unset'
|
|
73
|
+
? {}
|
|
74
|
+
: {
|
|
75
|
+
value: {
|
|
76
|
+
header: 'Value',
|
|
77
|
+
get: (row) => row.value,
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
...(command === 'list' ? {} : { success: { header: 'Success' } }),
|
|
81
|
+
...(responses.some((msg) => msg.error)
|
|
82
|
+
? {
|
|
83
|
+
message: {
|
|
84
|
+
header: 'Message',
|
|
85
|
+
get: (row) => row.error?.message ?? '',
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
: {}),
|
|
89
|
+
}, { title: commandToTitleMapping[command] });
|
|
90
|
+
};
|
|
91
|
+
exports.output = output;
|
|
92
|
+
const commandToTitleMapping = {
|
|
93
|
+
set: 'Set Config',
|
|
94
|
+
unset: 'Unset Config',
|
|
95
|
+
list: 'List Config',
|
|
96
|
+
get: 'Get Config',
|
|
97
|
+
};
|
|
86
98
|
//# sourceMappingURL=config.js.map
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,2CAA+D;AAC/D,iEAA4D;AAC5D,gDAAgD;AAChD,mDAAiD;AAkBpC,QAAA,mBAAmB,GAAG,IAAA,+BAAa,EAC9C,yBAAyB,EACzB,GAAG,IAAI,GAAG,CAAC,aAAM,CAAC,oBAAoB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CACxE,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAAC,iBAAyB,EAAU,EAAE;IACvE,6FAA6F;IAC7F,qFAAqF;IACrF,6FAA6F;IAC7F,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,aAAM,CAAC,oBAAoB,EAAE;SAC1B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC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AAO,CAAC,EAAE,CAC1C,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,MAAM,UAyCjB;AAEF,MAAM,qBAAqB,GAAG;IAC5B,GAAG,EAAE,YAAY;IACjB,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,YAAY;CACT,CAAC"}
|
|
@@ -41,15 +41,14 @@ function loadConfigMeta(plugin) {
|
|
|
41
41
|
}
|
|
42
42
|
const hook = ({ config }) => {
|
|
43
43
|
const flattenedConfigMetas = (config.plugins || [])
|
|
44
|
-
.
|
|
44
|
+
.flatMap((plugin) => {
|
|
45
45
|
const configMeta = loadConfigMeta(plugin);
|
|
46
46
|
if (!configMeta) {
|
|
47
47
|
log.info(`No config meta found for ${plugin.name}`);
|
|
48
48
|
}
|
|
49
49
|
return configMeta;
|
|
50
50
|
})
|
|
51
|
-
.filter(ts_types_1.isObject)
|
|
52
|
-
.flat();
|
|
51
|
+
.filter(ts_types_1.isObject);
|
|
53
52
|
if (flattenedConfigMetas.length) {
|
|
54
53
|
core_2.Config.addAllowedProperties(flattenedConfigMetas);
|
|
55
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load_config_meta.js","sourceRoot":"","sources":["../../../src/hooks/init/load_config_meta.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAGH,sCAAqC;AACrC,2CAAsE;AACtE,mDAAqD;AAErD,MAAM,GAAG,GAAG,aAAM,CAAC,aAAa,CAAC,kCAAkC,CAAC,CAAC;AACrE,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAE1C,SAAS,cAAc,CAAC,MAAyB;IAC/C,IAAI,yBAA6C,CAAC;IAElD,IAAI;QACF,MAAM,cAAc,GAAG,IAAA,cAAG,EAAC,MAAM,EAAE,eAAe,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QAEhF,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;YACtC,OAAO;SACR;QAED,MAAM,YAAY,G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AAc,CAAC;KAC5D;IAAC,MAAM;QACN,OAAO;KACR;IAED,IAAI,CAAC,yBAAyB,EAAE;QAC9B,OAAO;KACR;IAED,IAAI;QACF,uGAAuG;QACvG,MAAM,oBAAoB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAEhE,2GAA2G;QAC3G,OAAO,oBAAoB,EAAE,OAAO,IAAI,oBAAoB,CAAC;KAC9D;IAAC,MAAM;QACN,GAAG,CAAC,KAAK,CAAC,yCAAyC,yBAAyB,EAAE,CAAC,CAAC;QAChF,OAAO;KACR;AACH,CAAC;AAED,MAAM,IAAI,GAAiB,CAAC,EAAE,MAAM,EAAE,EAAiB,EAAE;IACvD,MAAM,oBAAoB,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;SAChD,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE;YACf,GAAG,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;SACrD;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;SACD,MAAM,CAAqB,mBAAQ,CAAC,CAAC;IAExC,IAAI,oBAAoB,CAAC,MAAM,EAAE;QAC/B,aAAM,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;KACnD;IACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-settings",
|
|
3
3
|
"description": "configure the Salesforce CLI",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.8",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/core": "^2.8.2",
|
|
9
|
-
"@salesforce/core": "^3.
|
|
10
|
-
"@salesforce/sf-plugins-core": "^2.
|
|
9
|
+
"@salesforce/core": "^3.36.1",
|
|
10
|
+
"@salesforce/sf-plugins-core": "^2.4.0",
|
|
11
11
|
"fast-levenshtein": "^3.0.0",
|
|
12
12
|
"tslib": "^2"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@oclif/plugin-command-snapshot": "^3.3.
|
|
16
|
-
"@oclif/test": "^2.3.
|
|
17
|
-
"@salesforce/cli-plugins-testkit": "^3.3.
|
|
15
|
+
"@oclif/plugin-command-snapshot": "^3.3.14",
|
|
16
|
+
"@oclif/test": "^2.3.17",
|
|
17
|
+
"@salesforce/cli-plugins-testkit": "^3.3.6",
|
|
18
18
|
"@salesforce/dev-config": "^3.1.0",
|
|
19
|
-
"@salesforce/dev-scripts": "^4.3.
|
|
19
|
+
"@salesforce/dev-scripts": "^4.3.1",
|
|
20
20
|
"@salesforce/kit": "^1.8.5",
|
|
21
21
|
"@salesforce/plugin-command-reference": "^2.2.8",
|
|
22
|
-
"@salesforce/plugin-deploy-retrieve": "^1.8.
|
|
22
|
+
"@salesforce/plugin-deploy-retrieve": "^1.8.18",
|
|
23
23
|
"@salesforce/prettier-config": "^0.0.2",
|
|
24
24
|
"@salesforce/ts-sinon": "^1.4.4",
|
|
25
25
|
"@salesforce/ts-types": "^1.7.1",
|
|
@@ -27,24 +27,24 @@
|
|
|
27
27
|
"@types/fast-levenshtein": "^0.0.2",
|
|
28
28
|
"@types/fs-extra": "^9.0.13",
|
|
29
29
|
"@types/shelljs": "^0.8.12",
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
31
|
-
"@typescript-eslint/parser": "^5.
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
31
|
+
"@typescript-eslint/parser": "^5.59.1",
|
|
32
32
|
"chai": "^4.3.7",
|
|
33
|
-
"eslint": "^8.
|
|
33
|
+
"eslint": "^8.40.0",
|
|
34
34
|
"eslint-config-prettier": "^8.8.0",
|
|
35
|
-
"eslint-config-salesforce": "^1.
|
|
35
|
+
"eslint-config-salesforce": "^1.2.0",
|
|
36
36
|
"eslint-config-salesforce-license": "^0.2.0",
|
|
37
37
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
38
38
|
"eslint-plugin-header": "^3.1.1",
|
|
39
39
|
"eslint-plugin-import": "^2.27.5",
|
|
40
40
|
"eslint-plugin-jsdoc": "^39.9.1",
|
|
41
|
-
"eslint-plugin-sf-plugin": "^1.
|
|
41
|
+
"eslint-plugin-sf-plugin": "^1.15.1",
|
|
42
42
|
"fs-extra": "^10.1.0",
|
|
43
43
|
"husky": "^7.0.4",
|
|
44
44
|
"mocha": "^9.2.2",
|
|
45
45
|
"nyc": "^15.1.0",
|
|
46
|
-
"oclif": "^3.
|
|
47
|
-
"prettier": "^2.8.
|
|
46
|
+
"oclif": "^3.9.0",
|
|
47
|
+
"prettier": "^2.8.8",
|
|
48
48
|
"pretty-quick": "^3.1.3",
|
|
49
49
|
"shelljs": "^0.8.5",
|
|
50
50
|
"shx": "0.3.4",
|
package/schemas/config-get.json
CHANGED
package/schemas/config-list.json
CHANGED
package/schemas/config-set.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$ref": "#/definitions/
|
|
3
|
+
"$ref": "#/definitions/SetOrUnsetConfigCommandResult",
|
|
4
4
|
"definitions": {
|
|
5
|
-
"
|
|
5
|
+
"SetOrUnsetConfigCommandResult": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"successes": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"type": "string"
|
|
29
29
|
},
|
|
30
30
|
"value": {
|
|
31
|
-
"type": "string"
|
|
31
|
+
"type": ["string", "boolean", "number", "null"]
|
|
32
32
|
},
|
|
33
33
|
"success": {
|
|
34
34
|
"type": "boolean"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$ref": "#/definitions/
|
|
3
|
+
"$ref": "#/definitions/SetOrUnsetConfigCommandResult",
|
|
4
4
|
"definitions": {
|
|
5
|
-
"
|
|
5
|
+
"SetOrUnsetConfigCommandResult": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"successes": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"type": "string"
|
|
29
29
|
},
|
|
30
30
|
"value": {
|
|
31
|
-
"type": "string"
|
|
31
|
+
"type": ["string", "boolean", "number", "null"]
|
|
32
32
|
},
|
|
33
33
|
"success": {
|
|
34
34
|
"type": "boolean"
|