@salesforce/plugin-settings 1.5.0-qa.4 → 2.0.1

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.
Files changed (43) hide show
  1. package/README.md +173 -17
  2. package/lib/alias.js +2 -6
  3. package/lib/alias.js.map +1 -1
  4. package/lib/commands/alias/list.d.ts +2 -2
  5. package/lib/commands/alias/list.js +15 -16
  6. package/lib/commands/alias/list.js.map +1 -1
  7. package/lib/commands/alias/set.d.ts +2 -2
  8. package/lib/commands/alias/set.js +22 -19
  9. package/lib/commands/alias/set.js.map +1 -1
  10. package/lib/commands/alias/unset.d.ts +4 -4
  11. package/lib/commands/alias/unset.js +31 -28
  12. package/lib/commands/alias/unset.js.map +1 -1
  13. package/lib/commands/config/get.d.ts +5 -4
  14. package/lib/commands/config/get.js +31 -32
  15. package/lib/commands/config/get.js.map +1 -1
  16. package/lib/commands/config/list.d.ts +5 -4
  17. package/lib/commands/config/list.js +18 -23
  18. package/lib/commands/config/list.js.map +1 -1
  19. package/lib/commands/config/set.d.ts +7 -8
  20. package/lib/commands/config/set.js +46 -69
  21. package/lib/commands/config/set.js.map +1 -1
  22. package/lib/commands/config/unset.d.ts +7 -8
  23. package/lib/commands/config/unset.js +39 -52
  24. package/lib/commands/config/unset.js.map +1 -1
  25. package/lib/config.d.ts +8 -10
  26. package/lib/config.js +80 -75
  27. package/lib/config.js.map +1 -1
  28. package/lib/hooks/init/load_config_meta.js +14 -41
  29. package/lib/hooks/init/load_config_meta.js.map +1 -1
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.js +2 -3
  32. package/lib/index.js.map +1 -1
  33. package/messages/config.get.md +3 -1
  34. package/messages/config.list.md +6 -2
  35. package/messages/config.set.md +8 -8
  36. package/messages/config.unset.md +7 -1
  37. package/oclif.lock +8544 -0
  38. package/oclif.manifest.json +286 -144
  39. package/package.json +225 -220
  40. package/schemas/config-get.json +1 -1
  41. package/schemas/config-list.json +1 -1
  42. package/schemas/config-set.json +3 -3
  43. package/schemas/config-unset.json +3 -3
@@ -1,59 +1,58 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Get = void 0;
4
1
  /*
5
2
  * Copyright (c) 2020, salesforce.com, inc.
6
3
  * All rights reserved.
7
4
  * Licensed under the BSD 3-Clause license.
8
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
6
  */
10
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
- const core_1 = require("@salesforce/core");
12
- const config_1 = require("../../config");
13
- core_1.Messages.importMessagesDirectory(__dirname);
14
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.get');
15
- class Get extends config_1.ConfigCommand {
7
+ import { fileURLToPath } from 'node:url';
8
+ import { dirname } from 'node:path';
9
+ import { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
10
+ import { ConfigAggregator, Messages } from '@salesforce/core';
11
+ import { CONFIG_HELP_SECTION, calculateSuggestion, buildFailureMsg, buildSuccessMsg, output, } from '../../config.js';
12
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13
+ const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.get');
14
+ export class Get extends SfCommand {
15
+ static description = messages.getMessage('description');
16
+ static summary = messages.getMessage('summary');
17
+ static examples = messages.getMessages('examples');
18
+ static aliases = ['force:config:get'];
19
+ static deprecateAliases = true;
20
+ static strict = false;
21
+ static flags = {
22
+ loglevel,
23
+ verbose: Flags.boolean({
24
+ summary: messages.getMessage('flags.verbose.summary'),
25
+ }),
26
+ };
27
+ static configurationVariablesSection = CONFIG_HELP_SECTION;
16
28
  async run() {
17
29
  const { argv, flags } = await this.parse(Get);
30
+ const responses = [];
18
31
  if (!argv || argv.length === 0) {
19
32
  throw messages.createError('error.NoConfigKeysFound');
20
33
  }
21
- const aggregator = await core_1.ConfigAggregator.create();
34
+ const aggregator = await ConfigAggregator.create();
22
35
  for (const configName of argv) {
23
36
  try {
24
- this.pushSuccess(aggregator.getInfo(configName));
37
+ responses.push(buildSuccessMsg(aggregator.getInfo(configName)));
25
38
  }
26
39
  catch (err) {
27
- const error = err;
28
- if (error.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
29
- const suggestion = this.calculateSuggestion(configName);
40
+ if (err instanceof Error && err.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
41
+ const suggestion = calculateSuggestion(configName);
30
42
  // eslint-disable-next-line no-await-in-loop
31
43
  const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
32
44
  if (answer) {
33
- this.pushSuccess(aggregator.getInfo(suggestion, false));
45
+ responses.push(buildSuccessMsg(aggregator.getInfo(suggestion, false)));
34
46
  }
35
47
  }
36
48
  else {
37
- this.pushFailure(configName, err);
49
+ responses.push(buildFailureMsg(configName, err));
50
+ process.exitCode = 1;
38
51
  }
39
52
  }
40
53
  }
41
- this.output('Get Config', flags.verbose);
42
- return this.responses;
54
+ output(new Ux({ jsonEnabled: this.jsonEnabled() }), responses, 'get', flags.verbose);
55
+ return responses;
43
56
  }
44
57
  }
45
- exports.Get = Get;
46
- Get.description = messages.getMessage('description');
47
- Get.summary = messages.getMessage('summary');
48
- Get.examples = messages.getMessages('examples');
49
- Get.aliases = ['force:config:get'];
50
- Get.deprecateAliases = true;
51
- Get.strict = false;
52
- Get.flags = {
53
- loglevel: sf_plugins_core_1.loglevel,
54
- verbose: sf_plugins_core_1.Flags.boolean({
55
- summary: messages.getMessage('flags.verbose.summary'),
56
- }),
57
- };
58
- Get.configurationVariablesSection = config_1.CONFIG_HELP_SECTION;
59
58
  //# sourceMappingURL=get.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/config/get.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iEAA8D;AAC9D,2CAA8D;AAC9D,yCAAmF;AAEnF,eAAQ,CAAC,uBAAuB,CA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AAY,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;oBAC7F,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;oBACnD,4CAA4C;oBAC5C,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC;oBACzG,IAAI,MAAM,EAAE;wBACV,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;qBACxE;iBACF;qBAAM;oBACL,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;oBACjD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;iBACtB;aACF;SACF;QAED,MAAM,CAAC,IAAI,EAAE,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"}
@@ -1,12 +1,13 @@
1
- import { ConfigCommand, ConfigResponses } from '../../config';
2
- export default class List extends ConfigCommand<ConfigResponses> {
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { ConfigResponses } from '../../config.js';
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
- loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ static readonly flags: {
10
+ loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
11
  };
11
12
  run(): Promise<ConfigResponses>;
12
13
  }
@@ -1,33 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /*
4
2
  * Copyright (c) 2020, salesforce.com, inc.
5
3
  * All rights reserved.
6
4
  * Licensed under the BSD 3-Clause license.
7
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
8
6
  */
9
- const core_1 = require("@salesforce/core");
10
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
- const config_1 = require("../../config");
12
- core_1.Messages.importMessagesDirectory(__dirname);
13
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.list');
14
- class List extends config_1.ConfigCommand {
7
+ import { fileURLToPath } from 'node:url';
8
+ import { dirname } from 'node:path';
9
+ import { ConfigAggregator, Messages } from '@salesforce/core';
10
+ import { loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
11
+ import { buildSuccessMsg, output } from '../../config.js';
12
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13
+ const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.list');
14
+ export default class List extends SfCommand {
15
+ static description = messages.getMessage('description');
16
+ static summary = messages.getMessage('summary');
17
+ static examples = messages.getMessages('examples');
18
+ static aliases = ['force:config:list'];
19
+ static deprecateAliases = true;
20
+ static flags = { loglevel };
15
21
  async run() {
16
- const aggregator = await core_1.ConfigAggregator.create();
17
- aggregator.getConfigInfo().forEach((c) => {
18
- this.pushSuccess(c);
19
- });
20
- if (!this.jsonEnabled()) {
21
- this.output('List Config', true);
22
- }
23
- return this.responses;
22
+ const aggregator = await ConfigAggregator.create();
23
+ const responses = aggregator.getConfigInfo().map((c) => buildSuccessMsg(c));
24
+ output(new Ux({ jsonEnabled: this.jsonEnabled() }), responses, 'list', true);
25
+ return responses;
24
26
  }
25
27
  }
26
- exports.default = List;
27
- List.description = messages.getMessage('description');
28
- List.summary = messages.getMessage('summary');
29
- List.examples = messages.getMessages('examples');
30
- List.aliases = ['force:config:list'];
31
- List.deprecateAliases = true;
32
- List.flags = { loglevel: sf_plugins_core_1.loglevel };
33
28
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/config/list.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,2CAA8D;AAC9D,iEAAuD;AACvD,yCAA8D;AAE9D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,aAAa,CAAC,CAAC;AAErF,MAAqB,IAAK,SAAQ,sBAA8B;IAQvD,KAAK,CAAC,GAAG;QACd,MAAM,UAAU,GAAG,MAAM,uBAAgB,CAAC,MAAM,EAAE,CAAC;QAEnD,UAAU,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACvC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;YACvB,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;;AAnBH,uBAoBC;AAnBwB,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;AACjC,UAAK,GAAG,EAAE,Q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,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5E,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAE7E,OAAO,SAAS,CAAC;IACnB,CAAC"}
@@ -1,9 +1,10 @@
1
- import { ConfigCommand, Msg } from '../../config';
2
- export type SetConfigCommandResult = {
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { Msg } from '../../config.js';
3
+ export type SetOrUnsetConfigCommandResult = {
3
4
  successes: Msg[];
4
5
  failures: Msg[];
5
6
  };
6
- export declare class Set extends ConfigCommand<SetConfigCommandResult> {
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[];
@@ -11,11 +12,9 @@ export declare class Set extends ConfigCommand<SetConfigCommandResult> {
11
12
  static readonly deprecateAliases = true;
12
13
  static readonly strict = false;
13
14
  static readonly flags: {
14
- loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
- global: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
+ global: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
17
  };
17
18
  static configurationVariablesSection: import("@oclif/core").HelpSection;
18
- private setResponses;
19
- run(): Promise<SetConfigCommandResult>;
20
- protected pushFailure(name: string, err: string | Error, value?: string): void;
19
+ run(): Promise<SetOrUnsetConfigCommandResult>;
21
20
  }
@@ -1,35 +1,46 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2020, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Set = void 0;
10
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
- const core_1 = require("@salesforce/core");
12
- const config_1 = require("../../config");
13
- core_1.Messages.importMessagesDirectory(__dirname);
14
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.set');
15
- class Set extends config_1.ConfigCommand {
16
- constructor() {
17
- super(...arguments);
18
- this.setResponses = { successes: [], failures: [] };
19
- }
7
+ import { fileURLToPath } from 'node:url';
8
+ import { dirname } from 'node:path';
9
+ import { parseVarArgs, Flags, loglevel, Ux, SfCommand } from '@salesforce/sf-plugins-core';
10
+ import { Config, Messages, Org, SfError, OrgConfigProperties } from '@salesforce/core';
11
+ import { CONFIG_HELP_SECTION, buildFailureMsg, calculateSuggestion, output } from '../../config.js';
12
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13
+ const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.set');
14
+ export class Set extends SfCommand {
15
+ static description = messages.getMessage('description');
16
+ static summary = messages.getMessage('summary');
17
+ static examples = messages.getMessages('examples');
18
+ static aliases = ['force:config:set'];
19
+ static deprecateAliases = true;
20
+ static strict = false;
21
+ static flags = {
22
+ loglevel,
23
+ global: Flags.boolean({
24
+ char: 'g',
25
+ summary: messages.getMessage('flags.global.summary'),
26
+ }),
27
+ };
28
+ static configurationVariablesSection = CONFIG_HELP_SECTION;
20
29
  async run() {
21
30
  const { args, argv, flags } = await this.parse(Set);
22
31
  const config = await loadConfig(flags.global);
32
+ const responses = { successes: [], failures: [] };
23
33
  if (!argv.length)
24
34
  throw messages.createError('error.ArgumentsRequired');
25
- const parsed = (0, sf_plugins_core_1.parseVarArgs)(args, argv);
26
- for (const name of Object.keys(parsed)) {
27
- const value = parsed[name];
35
+ const parsed = parseVarArgs(args, argv);
36
+ for (const [name, value] of Object.entries(parsed)) {
37
+ let resolvedName = name;
28
38
  try {
29
- const resolvedName = this.configAggregator.getPropertyMeta(name)?.newKey ?? name;
39
+ // this needs to be inside the try/catch because it can throw an error
40
+ resolvedName = this.configAggregator.getPropertyMeta(name)?.newKey ?? name;
30
41
  if (!value) {
31
42
  // Push a failure if users are try to unset a value with `set=`.
32
- this.pushFailure(name, messages.createError('error.ValueRequired'), value);
43
+ responses.failures.push(buildFailureMsg(name, messages.createError('error.ValueRequired'), value));
33
44
  }
34
45
  else {
35
46
  // core's builtin config validation requires synchronous functions but there's
@@ -39,90 +50,56 @@ class Set extends config_1.ConfigCommand {
39
50
  if (isOrgKey(resolvedName) && value)
40
51
  await validateOrg(value);
41
52
  config.set(resolvedName, value);
42
- this.setResponses.successes.push({ name: resolvedName, value, success: true });
53
+ responses.successes.push({ name: resolvedName, value, success: true });
43
54
  }
44
55
  }
45
- catch (err) {
46
- const error = err;
47
- if (error.name.includes('UnknownConfigKeyError')) {
56
+ catch (error) {
57
+ if (error instanceof Error && error.name.includes('UnknownConfigKeyError')) {
48
58
  if (this.jsonEnabled()) {
49
- process.exitCode = 1;
50
- this.setResponses.failures.push({
51
- name,
52
- value,
53
- success: false,
54
- error,
55
- message: error.message.replace(/\.\.$/, '.'),
56
- });
59
+ responses.failures.push(buildFailureMsg(resolvedName, error, value));
57
60
  }
58
61
  else {
59
- const suggestion = this.calculateSuggestion(name);
62
+ const suggestion = calculateSuggestion(name);
60
63
  // eslint-disable-next-line no-await-in-loop
61
64
  const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
62
- if (answer) {
63
- const key = core_1.Config.getPropertyConfigMeta(suggestion)?.key ?? suggestion;
65
+ if (answer && value) {
66
+ const key = Config.getPropertyConfigMeta(suggestion)?.key ?? suggestion;
64
67
  config.set(key, value);
65
- this.setResponses.successes.push({ name: key, value, success: true });
68
+ responses.successes.push({ name: key, value, success: true });
66
69
  }
67
70
  }
68
71
  }
69
72
  else {
70
- this.pushFailure(name, err, value);
73
+ responses.failures.push(buildFailureMsg(resolvedName, error, value));
71
74
  }
72
75
  }
73
76
  }
74
77
  await config.write();
75
- if (!this.jsonEnabled()) {
76
- this.responses = [...this.setResponses.successes, ...this.setResponses.failures];
77
- this.output('Set Config', false);
78
+ if (responses.failures.length) {
79
+ process.exitCode = 1;
78
80
  }
79
- return this.setResponses;
80
- }
81
- pushFailure(name, err, value) {
82
- const error = core_1.SfError.wrap(err);
83
- this.setResponses.failures.push({
84
- name,
85
- success: false,
86
- value,
87
- error,
88
- message: error.message.replace(/\.\.$/, '.'),
89
- });
90
- process.exitCode = 1;
81
+ output(new Ux({ jsonEnabled: this.jsonEnabled() }), [...responses.successes, ...responses.failures], 'set');
82
+ return responses;
91
83
  }
92
84
  }
93
- exports.Set = Set;
94
- Set.description = messages.getMessage('description');
95
- Set.summary = messages.getMessage('summary');
96
- Set.examples = messages.getMessages('examples');
97
- Set.aliases = ['force:config:set'];
98
- Set.deprecateAliases = true;
99
- Set.strict = false;
100
- Set.flags = {
101
- loglevel: sf_plugins_core_1.loglevel,
102
- global: sf_plugins_core_1.Flags.boolean({
103
- char: 'g',
104
- summary: messages.getMessage('flags.global.summary'),
105
- }),
106
- };
107
- Set.configurationVariablesSection = config_1.CONFIG_HELP_SECTION;
108
85
  const loadConfig = async (global) => {
109
86
  try {
110
- const config = await core_1.Config.create(core_1.Config.getDefaultOptions(global));
87
+ const config = await Config.create(Config.getDefaultOptions(global));
111
88
  await config.read();
112
89
  return config;
113
90
  }
114
91
  catch (error) {
115
- if (error instanceof core_1.SfError) {
92
+ if (error instanceof SfError) {
116
93
  error.actions = error.actions ?? [];
117
94
  error.actions.push('Run with --global to set for your entire workspace.');
118
95
  }
119
96
  throw error;
120
97
  }
121
98
  };
122
- const isOrgKey = (name) => [core_1.OrgConfigProperties.TARGET_DEV_HUB, core_1.OrgConfigProperties.TARGET_ORG].includes(name);
99
+ const isOrgKey = (name) => [OrgConfigProperties.TARGET_DEV_HUB, OrgConfigProperties.TARGET_ORG].includes(name);
123
100
  const validateOrg = async (value) => {
124
101
  try {
125
- await core_1.Org.create({ aliasOrUsername: value });
102
+ await Org.create({ aliasOrUsername: value });
126
103
  }
127
104
  catch {
128
105
  throw new Error(`Invalid config value: org "${value}" is not authenticated.`);
@@ -1 +1 @@
1
- {"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/config/set.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAA4E;AAC5E,2CAAuF;AACvF,yCAAuE;AAEvE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,YAAY,CAAC,CAAC;AAIpF,MAAa,GAAI,SAAQ,sBAAqC;IAA9D;;QAgBU,iBAAY,GAA2B,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAwEjF,CAAC;IAtEQ,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;QAEtD,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,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAW,CAAC;YACrC,IAAI;gBACF,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,IAAI,CAAC;gBACjF,IAAI,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;KAC/E;AACH,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
- import { ConfigCommand } from '../../config';
2
- import { SetConfigCommandResult } from './set';
3
- export declare class UnSet extends ConfigCommand<SetConfigCommandResult> {
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { SetOrUnsetConfigCommandResult } from './set.js';
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[];
@@ -9,10 +9,9 @@ export declare class UnSet extends ConfigCommand<SetConfigCommandResult> {
9
9
  static readonly deprecateAliases = true;
10
10
  static configurationVariablesSection: import("@oclif/core").HelpSection;
11
11
  static readonly flags: {
12
- loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- global: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
+ global: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
14
14
  };
15
- private unsetResponses;
16
- run(): Promise<SetConfigCommandResult>;
17
- protected pushFailure(name: string, err: string | Error, value?: string): void;
15
+ private responses;
16
+ run(): Promise<SetOrUnsetConfigCommandResult>;
18
17
  }
@@ -1,86 +1,73 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2020, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.UnSet = void 0;
10
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
- const core_1 = require("@salesforce/core");
12
- const config_1 = require("../../config");
13
- core_1.Messages.importMessagesDirectory(__dirname);
14
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.unset');
15
- class UnSet extends config_1.ConfigCommand {
16
- constructor() {
17
- super(...arguments);
18
- this.unsetResponses = { successes: [], failures: [] };
19
- }
7
+ import { fileURLToPath } from 'node:url';
8
+ import { dirname } from 'node:path';
9
+ import { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
10
+ import { Config, Messages } from '@salesforce/core';
11
+ import { CONFIG_HELP_SECTION, buildFailureMsg, calculateSuggestion, output } from '../../config.js';
12
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13
+ const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.unset');
14
+ export class UnSet extends SfCommand {
15
+ static description = messages.getMessage('description');
16
+ static summary = messages.getMessage('summary');
17
+ static examples = messages.getMessages('examples');
18
+ static strict = false;
19
+ static aliases = ['force:config:unset'];
20
+ static deprecateAliases = true;
21
+ static configurationVariablesSection = CONFIG_HELP_SECTION;
22
+ static flags = {
23
+ loglevel,
24
+ global: Flags.boolean({
25
+ char: 'g',
26
+ summary: messages.getMessage('flags.global.summary'),
27
+ }),
28
+ };
29
+ responses = { successes: [], failures: [] };
20
30
  async run() {
21
31
  const { argv, flags } = await this.parse(UnSet);
22
32
  if (!argv || argv.length === 0) {
23
33
  throw messages.createError('error.NoConfigKeysFound');
24
34
  }
25
- const config = await core_1.Config.create(core_1.Config.getDefaultOptions(flags.global));
35
+ const config = await Config.create(Config.getDefaultOptions(flags.global));
36
+ const globalConfig = flags.global ? config : await Config.create(Config.getDefaultOptions(true));
37
+ await globalConfig.read();
26
38
  await config.read();
27
39
  for (const key of argv) {
28
40
  try {
29
41
  const resolvedName = this.configAggregator.getPropertyMeta(key)?.newKey ?? key;
30
42
  config.unset(resolvedName);
31
- this.unsetResponses.successes.push({ name: resolvedName, success: true });
43
+ if (!flags.global && globalConfig.has(resolvedName)) {
44
+ // If the config var is still set globally after an unset and the user didn't have the `--global` flag set, warn them.
45
+ this.warn(messages.getMessage('unsetGlobalWarning', [resolvedName]));
46
+ }
47
+ this.responses.successes.push({ name: resolvedName, success: true });
32
48
  }
33
- catch (err) {
34
- const error = err;
35
- if (error.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
36
- const suggestion = this.calculateSuggestion(key);
49
+ catch (error) {
50
+ if (error instanceof Error && error.name.includes('UnknownConfigKeyError') && !this.jsonEnabled()) {
51
+ const suggestion = calculateSuggestion(key);
37
52
  // eslint-disable-next-line no-await-in-loop
38
53
  const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
39
54
  if (answer) {
40
55
  config.unset(suggestion);
41
- this.unsetResponses.successes.push({
56
+ this.responses.successes.push({
42
57
  name: suggestion,
43
58
  success: true,
44
- error,
45
- message: error.message.replace(/\.\.$/, '.'),
46
59
  });
47
60
  }
48
61
  }
49
62
  else {
50
- this.pushFailure(key, err);
63
+ this.responses.failures.push(buildFailureMsg(key, error));
64
+ process.exitCode = 1;
51
65
  }
52
66
  }
53
67
  }
54
68
  await config.write();
55
- this.responses = [...this.unsetResponses.successes, ...this.unsetResponses.failures];
56
- this.output('Unset Config', false);
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;
69
+ output(new Ux({ jsonEnabled: this.jsonEnabled() }), [...this.responses.successes, ...this.responses.failures], 'unset');
70
+ return this.responses;
69
71
  }
70
72
  }
71
- exports.UnSet = UnSet;
72
- UnSet.description = messages.getMessage('description');
73
- UnSet.summary = messages.getMessage('summary');
74
- UnSet.examples = messages.getMessages('examples');
75
- UnSet.strict = false;
76
- UnSet.aliases = ['force:config:unset'];
77
- UnSet.deprecateAliases = true;
78
- UnSet.configurationVariablesSection = config_1.CONFIG_HELP_SECTION;
79
- UnSet.flags = {
80
- loglevel: sf_plugins_core_1.loglevel,
81
- global: sf_plugins_core_1.Flags.boolean({
82
- char: 'g',
83
- summary: messages.getMessage('flags.global.summary'),
84
- }),
85
- };
86
73
  //# sourceMappingURL=unset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/config/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAA8D;AAC9D,2CAA6D;AAC7D,yCAAkE;AAGlE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,cAAc,CAAC,CAAC;AAEtF,MAAa,KAAM,SAAQ,sBAAqC;IAAhE;;QAeU,mBAAc,GAA2B,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAuDnF,CAAC;IArDQ,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,EAAE;YAC9B,MAAM,QAAQ,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;SACvD;QACD,MAAM,MAAM,GAAW,MAAM,aAAM,CAAC,MAAM,CAAC,aAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAEnF,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM,GAAG,IAAI,IAAgB,EAAE;YAClC,IAAI;gBACF,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,GAAG,CAAC;gBAC/E,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAC3B,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,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