@salesforce/plugin-settings 1.2.2 → 1.4.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/lib/alias.d.ts +4 -2
- package/lib/alias.js.map +1 -1
- package/lib/commands/alias/list.d.ts +5 -1
- package/lib/commands/alias/list.js +5 -1
- package/lib/commands/alias/list.js.map +1 -1
- package/lib/commands/alias/set.d.ts +5 -1
- package/lib/commands/alias/set.js +10 -5
- package/lib/commands/alias/set.js.map +1 -1
- package/lib/commands/alias/unset.d.ts +3 -1
- package/lib/commands/alias/unset.js +6 -4
- package/lib/commands/alias/unset.js.map +1 -1
- package/lib/commands/config/get.d.ts +4 -4
- package/lib/commands/config/get.js +38 -10
- package/lib/commands/config/get.js.map +1 -1
- package/lib/commands/config/list.d.ts +5 -1
- package/lib/commands/config/list.js +5 -1
- package/lib/commands/config/list.js.map +1 -1
- package/lib/commands/config/set.d.ts +13 -7
- package/lib/commands/config/set.js +75 -12
- package/lib/commands/config/set.js.map +1 -1
- package/lib/commands/config/unset.d.ts +10 -7
- package/lib/commands/config/unset.js +56 -13
- package/lib/commands/config/unset.js.map +1 -1
- package/lib/config.d.ts +12 -4
- package/lib/config.js +14 -1
- package/lib/config.js.map +1 -1
- package/lib/hooks/init/load_config_meta.js +1 -1
- package/lib/hooks/init/load_config_meta.js.map +1 -1
- package/messages/config.get.md +4 -0
- package/messages/config.set.md +4 -0
- package/messages/config.unset.md +4 -0
- package/oclif.manifest.json +177 -65
- package/package.json +132 -27
- package/schemas/alias-list.json +4 -73
- package/schemas/alias-set.json +4 -73
- package/schemas/alias-unset.json +4 -73
- package/schemas/config-get.json +38 -0
- package/schemas/config-list.json +38 -0
- package/schemas/config-set.json +57 -6
- package/schemas/config-unset.json +57 -6
package/lib/alias.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { SfError } from '@salesforce/core';
|
|
2
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
2
|
export type AliasResult = {
|
|
4
3
|
alias: string;
|
|
5
4
|
value?: string;
|
|
6
5
|
success?: boolean;
|
|
7
6
|
message?: string;
|
|
8
|
-
error?:
|
|
7
|
+
error?: {
|
|
8
|
+
name: string;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
9
11
|
};
|
|
10
12
|
export type AliasResults = AliasResult[];
|
|
11
13
|
export declare abstract class AliasCommand<T> extends SfCommand<T> {
|
package/lib/alias.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias.js","sourceRoot":"","sources":["../src/alias.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"alias.js","sourceRoot":"","sources":["../src/alias.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,iEAAwD;AAexD,MAAsB,YAAgB,SAAQ,2BAAY;IAC9C,MAAM,CAAC,KAAa,EAAE,OAAqB;QACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACvB,OAAO;SACR;QAED,MAAM,OAAO,GAAwC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;YAC1B,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;SAC3B,CAAC;QAEF,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YACpD,OAAO,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;SACzC;QAED,oFAAoF;QACpF,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAErB,OAAO,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YAExC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;SACnE;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF;AA3BD,oCA2BC"}
|
|
@@ -3,6 +3,10 @@ export default class AliasList extends AliasCommand<AliasResults> {
|
|
|
3
3
|
static summary: string;
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
|
-
static readonly
|
|
6
|
+
static readonly aliases: string[];
|
|
7
|
+
static readonly deprecateAliases = true;
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
};
|
|
7
11
|
run(): Promise<AliasResults>;
|
|
8
12
|
}
|
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
10
11
|
const alias_1 = require("../../alias");
|
|
11
12
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
13
|
const messages = core_1.Messages.load('@salesforce/plugin-settings', 'alias.list', ['summary', 'description', 'examples']);
|
|
13
14
|
class AliasList extends alias_1.AliasCommand {
|
|
14
15
|
async run() {
|
|
16
|
+
await this.parse(AliasList);
|
|
15
17
|
const stateAggregator = await core_1.StateAggregator.getInstance();
|
|
16
18
|
const aliases = stateAggregator.aliases.getAll();
|
|
17
19
|
const results = Object.entries(aliases).map(([alias, value]) => ({ alias, value }));
|
|
@@ -23,5 +25,7 @@ exports.default = AliasList;
|
|
|
23
25
|
AliasList.summary = messages.getMessage('summary');
|
|
24
26
|
AliasList.description = messages.getMessage('description');
|
|
25
27
|
AliasList.examples = messages.getMessages('examples');
|
|
26
|
-
AliasList.
|
|
28
|
+
AliasList.aliases = ['force:alias:list'];
|
|
29
|
+
AliasList.deprecateAliases = true;
|
|
30
|
+
AliasList.flags = { loglevel: sf_plugins_core_1.loglevel };
|
|
27
31
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/alias/list.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA6D;AAC7D,uCAAyD;AAEzD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,6BAA6B,EAAE,YAAY,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;AACpH,MAAqB,SAAU,SAAQ,oBAA0B;IAOxD,KAAK,CAAC,GAAG;QACd,MAAM,eAAe,GAAG,MAAM,sBAAe,CAAC,WAAW,EAAE,CAAC;QAC5D,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAEpF,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAEnC,OAAO,OAAO,CAAC;IACjB,CAAC;;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/alias/list.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA6D;AAC7D,iEAAuD;AACvD,uCAAyD;AAEzD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,6BAA6B,EAAE,YAAY,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;AACpH,MAAqB,SAAU,SAAQ,oBAA0B;IAOxD,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5B,MAAM,eAAe,GAAG,MAAM,sBAAe,CAAC,WAAW,EAAE,CAAC;QAC5D,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAEpF,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAEnC,OAAO,OAAO,CAAC;IACjB,CAAC;;AAjBH,4BAkBC;AAjBe,iBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,qBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,kBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACnC,iBAAO,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAC/B,0BAAgB,GAAG,IAAI,CAAC;AACxB,eAAK,GAAG,EAAE,QAAQ,EAAR,0BAAQ,EAAE,CAAC"}
|
|
@@ -4,6 +4,10 @@ export default class AliasSet extends AliasCommand<AliasResults> {
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static readonly strict = false;
|
|
7
|
-
static readonly
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
9
|
+
static readonly flags: {
|
|
10
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
};
|
|
8
12
|
run(): Promise<AliasResults>;
|
|
9
13
|
}
|
|
@@ -19,6 +19,7 @@ const messages = core_1.Messages.load('@salesforce/plugin-settings', 'alias.set'
|
|
|
19
19
|
]);
|
|
20
20
|
class AliasSet extends alias_1.AliasCommand {
|
|
21
21
|
async run() {
|
|
22
|
+
await this.parse(AliasSet);
|
|
22
23
|
const stateAggregator = await core_1.StateAggregator.getInstance();
|
|
23
24
|
const { args, argv } = await this.parse(AliasSet);
|
|
24
25
|
if (!argv.length)
|
|
@@ -26,17 +27,19 @@ class AliasSet extends alias_1.AliasCommand {
|
|
|
26
27
|
const parsed = (0, sf_plugins_core_1.parseVarArgs)(args, argv);
|
|
27
28
|
const results = Object.entries(parsed).map(([alias, value]) => {
|
|
28
29
|
try {
|
|
30
|
+
// to support plugin-settings in sfdx, which allowed setting an alias to undefined, when that happens we'll unset the alias
|
|
31
|
+
// which is what the user wants
|
|
29
32
|
if (!value) {
|
|
30
|
-
|
|
33
|
+
stateAggregator.aliases.unset(alias);
|
|
31
34
|
}
|
|
32
35
|
else {
|
|
33
36
|
stateAggregator.aliases.set(alias, value);
|
|
34
|
-
return { alias, success: true, value };
|
|
35
37
|
}
|
|
38
|
+
return { alias, success: true, value };
|
|
36
39
|
}
|
|
37
40
|
catch (err) {
|
|
38
|
-
const
|
|
39
|
-
return { alias, success: false, error, value };
|
|
41
|
+
const { name, message } = err;
|
|
42
|
+
return { alias, success: false, error: { name, message }, value };
|
|
40
43
|
}
|
|
41
44
|
});
|
|
42
45
|
await stateAggregator.aliases.write();
|
|
@@ -49,5 +52,7 @@ AliasSet.summary = messages.getMessage('summary');
|
|
|
49
52
|
AliasSet.description = messages.getMessage('description');
|
|
50
53
|
AliasSet.examples = messages.getMessages('examples');
|
|
51
54
|
AliasSet.strict = false; // This allows varargs
|
|
52
|
-
AliasSet.
|
|
55
|
+
AliasSet.aliases = ['force:alias:set'];
|
|
56
|
+
AliasSet.deprecateAliases = true;
|
|
57
|
+
AliasSet.flags = { loglevel: sf_plugins_core_1.loglevel };
|
|
53
58
|
//# sourceMappingURL=set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/alias/set.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/alias/set.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAAqE;AACrE,2CAAsE;AACtE,uCAAyD;AAEzD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,6BAA6B,EAAE,WAAW,EAAE;IACzE,SAAS;IACT,aAAa;IACb,UAAU;IACV,yBAAyB;IACzB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAqB,QAAS,SAAQ,oBAA0B;IASvD,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3B,MAAM,eAAe,GAAG,MAAM,sBAAe,CAAC,WAAW,EAAE,CAAC;QAE5D,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAElD,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,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE;YAC5D,IAAI;gBACF,2HAA2H;gBAC3H,+BAA+B;gBAC/B,IAAI,CAAC,KAAK,EAAE;oBACV,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACtC;qBAAM;oBACL,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;iBAC3C;gBACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;aACxC;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,GAAc,CAAC;gBACzC,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;;AAxCH,2BAyCC;AAxCe,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"}
|
|
@@ -4,8 +4,10 @@ export default class AliasUnset extends AliasCommand<AliasResults> {
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static readonly strict = false;
|
|
7
|
-
static readonly
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
8
9
|
static flags: {
|
|
10
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
11
|
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
12
|
'no-prompt': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
13
|
};
|
|
@@ -36,7 +36,7 @@ class AliasUnset extends alias_1.AliasCommand {
|
|
|
36
36
|
}
|
|
37
37
|
// Confirm the users wants to remove all aliases. Supports --no-prompt.
|
|
38
38
|
if (flags.all && !flags['no-prompt'] && !(await this.confirm(messages.getMessage('prompt.RemoveAllAliases')))) {
|
|
39
|
-
return;
|
|
39
|
+
return [];
|
|
40
40
|
}
|
|
41
41
|
const results = toRemove.map((alias) => {
|
|
42
42
|
// We will log the value in the output in case an alias was unset by mistake.
|
|
@@ -46,8 +46,8 @@ class AliasUnset extends alias_1.AliasCommand {
|
|
|
46
46
|
return { alias, value, success: true };
|
|
47
47
|
}
|
|
48
48
|
catch (err) {
|
|
49
|
-
const
|
|
50
|
-
return { alias, value, success: false, error };
|
|
49
|
+
const { name, message } = err;
|
|
50
|
+
return { alias, value, success: false, error: { name, message } };
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
await stateAggregator.aliases.write();
|
|
@@ -60,8 +60,10 @@ AliasUnset.summary = messages.getMessage('summary');
|
|
|
60
60
|
AliasUnset.description = messages.getMessage('description');
|
|
61
61
|
AliasUnset.examples = messages.getMessages('examples');
|
|
62
62
|
AliasUnset.strict = false; // This allows varargs
|
|
63
|
-
AliasUnset.
|
|
63
|
+
AliasUnset.aliases = ['force:alias:unset'];
|
|
64
|
+
AliasUnset.deprecateAliases = true;
|
|
64
65
|
AliasUnset.flags = {
|
|
66
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
65
67
|
all: sf_plugins_core_1.Flags.boolean({
|
|
66
68
|
summary: messages.getMessage('flags.all.summary'),
|
|
67
69
|
char: 'a',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/alias/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,
|
|
1
|
+
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/alias/unset.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAA8D;AAC9D,2CAAsE;AACtE,uCAAyD;AAEzD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,6BAA6B,EAAE,aAAa,EAAE;IAC3E,SAAS;IACT,aAAa;IACb,UAAU;IACV,mBAAmB;IACnB,yBAAyB;IACzB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;CAC1B,CAAC,CAAC;AAEH,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,W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;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"}
|
|
@@ -3,13 +3,13 @@ export declare class Get extends ConfigCommand<ConfigResponses> {
|
|
|
3
3
|
static readonly description: string;
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly examples: string[];
|
|
6
|
+
static readonly aliases: string[];
|
|
7
|
+
static readonly deprecateAliases = true;
|
|
6
8
|
static readonly strict = false;
|
|
7
9
|
static readonly flags: {
|
|
10
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
11
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
12
|
};
|
|
10
|
-
static configurationVariablesSection:
|
|
11
|
-
header: string;
|
|
12
|
-
body: string | [string, string][] | import("@oclif/core").HelpSectionKeyValueTable;
|
|
13
|
-
};
|
|
13
|
+
static configurationVariablesSection: import("@oclif/core").HelpSection;
|
|
14
14
|
run(): Promise<ConfigResponses>;
|
|
15
15
|
}
|
|
@@ -15,32 +15,60 @@ const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'co
|
|
|
15
15
|
class Get extends config_1.ConfigCommand {
|
|
16
16
|
async run() {
|
|
17
17
|
const { argv, flags } = await this.parse(Get);
|
|
18
|
+
// instantiate a SfdxConfigAggregator to get the restDeploy <-> org-metadata-rest-deploy deprecation linked
|
|
19
|
+
await core_1.SfdxConfigAggregator.create({});
|
|
18
20
|
if (!argv || argv.length === 0) {
|
|
19
21
|
throw messages.createError('error.NoConfigKeysFound');
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const aggregator = await core_1.ConfigAggregator.create();
|
|
24
|
+
for (const configName of argv) {
|
|
25
|
+
try {
|
|
26
|
+
this.pushSuccess(aggregator.getInfo(configName, true));
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
const error = err;
|
|
30
|
+
if (error.message.includes('Deprecated config name')) {
|
|
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);
|
|
48
|
+
// eslint-disable-next-line no-await-in-loop
|
|
49
|
+
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
50
|
+
if (answer) {
|
|
51
|
+
this.pushSuccess(aggregator.getInfo(suggestion, false));
|
|
52
|
+
}
|
|
26
53
|
}
|
|
27
|
-
|
|
54
|
+
else {
|
|
28
55
|
this.pushFailure(configName, err);
|
|
29
56
|
}
|
|
30
|
-
});
|
|
31
|
-
if (!this.jsonEnabled()) {
|
|
32
|
-
this.output('Get Config', flags.verbose);
|
|
33
57
|
}
|
|
34
|
-
return this.responses;
|
|
35
58
|
}
|
|
59
|
+
this.output('Get Config', flags.verbose);
|
|
60
|
+
return this.responses;
|
|
36
61
|
}
|
|
37
62
|
}
|
|
38
63
|
exports.Get = Get;
|
|
39
64
|
Get.description = messages.getMessage('description');
|
|
40
65
|
Get.summary = messages.getMessage('summary');
|
|
41
66
|
Get.examples = messages.getMessages('examples');
|
|
67
|
+
Get.aliases = ['force:config:get'];
|
|
68
|
+
Get.deprecateAliases = true;
|
|
42
69
|
Get.strict = false;
|
|
43
70
|
Get.flags = {
|
|
71
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
44
72
|
verbose: sf_plugins_core_1.Flags.boolean({
|
|
45
73
|
summary: messages.getMessage('flags.verbose.summary'),
|
|
46
74
|
}),
|
|
@@ -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,iEAA8D;AAC9D,2CAAoF;AACpF,yCAAmF;AAEnF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,YAAY,CAAC,CAAC;AAEpF,MAAa,GAAI,SAAQ,sBAA8B;IAgB9C,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,2GAA2G;QAC3G,MAAM,2BAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEtC,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,CA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,EAAE,KAAK,CAAC,CAAC,CAAC;qBACzD;iBACF;qBAAM;oBACL,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,GAAY,CAAC,CAAC;iBAC5C;aACF;SACF;QAED,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEzC,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;;AA/DH,kBAgEC;AA/DwB,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"}
|
|
@@ -3,6 +3,10 @@ export default class List extends ConfigCommand<ConfigResponses> {
|
|
|
3
3
|
static readonly description: string;
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly examples: string[];
|
|
6
|
-
static
|
|
6
|
+
static readonly aliases: string[];
|
|
7
|
+
static readonly deprecateAliases = true;
|
|
8
|
+
static flags: {
|
|
9
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
};
|
|
7
11
|
run(): Promise<ConfigResponses>;
|
|
8
12
|
}
|
|
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
8
|
*/
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
10
11
|
const config_1 = require("../../config");
|
|
11
12
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
13
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.list');
|
|
13
14
|
class List extends config_1.ConfigCommand {
|
|
14
15
|
async run() {
|
|
16
|
+
await core_1.SfdxConfigAggregator.create({});
|
|
15
17
|
const aggregator = await core_1.ConfigAggregator.create();
|
|
16
18
|
aggregator.getConfigInfo().forEach((c) => {
|
|
17
19
|
this.pushSuccess(c);
|
|
@@ -26,5 +28,7 @@ exports.default = List;
|
|
|
26
28
|
List.description = messages.getMessage('description');
|
|
27
29
|
List.summary = messages.getMessage('summary');
|
|
28
30
|
List.examples = messages.getMessages('examples');
|
|
29
|
-
List.
|
|
31
|
+
List.aliases = ['force:config:list'];
|
|
32
|
+
List.deprecateAliases = true;
|
|
33
|
+
List.flags = { loglevel: sf_plugins_core_1.loglevel };
|
|
30
34
|
//# sourceMappingURL=list.js.map
|
|
@@ -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,2CAAoF;AACpF,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,2BAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACtC,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;;AApBH,uBAqBC;AApBwB,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,QAAQ,EAAR,0BAAQ,EAAE,CAAC"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { ConfigCommand,
|
|
2
|
-
export
|
|
1
|
+
import { ConfigCommand, Msg } from '../../config';
|
|
2
|
+
export type SetConfigCommandResult = {
|
|
3
|
+
successes: Msg[];
|
|
4
|
+
failures: Msg[];
|
|
5
|
+
};
|
|
6
|
+
export declare class Set extends ConfigCommand<SetConfigCommandResult> {
|
|
3
7
|
static readonly description: string;
|
|
4
8
|
static readonly summary: string;
|
|
5
9
|
static readonly examples: string[];
|
|
10
|
+
static readonly aliases: string[];
|
|
11
|
+
static readonly deprecateAliases = true;
|
|
6
12
|
static readonly strict = false;
|
|
7
13
|
static readonly flags: {
|
|
14
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
15
|
global: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
16
|
};
|
|
10
|
-
static configurationVariablesSection:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
run(): Promise<ConfigResponses>;
|
|
17
|
+
static configurationVariablesSection: import("@oclif/core").HelpSection;
|
|
18
|
+
private setResponses;
|
|
19
|
+
run(): Promise<SetConfigCommandResult>;
|
|
20
|
+
protected pushFailure(name: string, err: string | Error, value?: string): void;
|
|
15
21
|
}
|
|
@@ -11,15 +11,12 @@ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
|
11
11
|
const core_1 = require("@salesforce/core");
|
|
12
12
|
const config_1 = require("../../config");
|
|
13
13
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
|
-
const messages = core_1.Messages.
|
|
15
|
-
'summary',
|
|
16
|
-
'description',
|
|
17
|
-
'examples',
|
|
18
|
-
'flags.global.summary',
|
|
19
|
-
'error.ArgumentsRequired',
|
|
20
|
-
'error.ValueRequired',
|
|
21
|
-
]);
|
|
14
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-settings', 'config.set');
|
|
22
15
|
class Set extends config_1.ConfigCommand {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.setResponses = { successes: [], failures: [] };
|
|
19
|
+
}
|
|
23
20
|
async run() {
|
|
24
21
|
const { args, argv, flags } = await this.parse(Set);
|
|
25
22
|
const config = await loadConfig(flags.global);
|
|
@@ -41,26 +38,91 @@ class Set extends config_1.ConfigCommand {
|
|
|
41
38
|
if (isOrgKey(name) && value)
|
|
42
39
|
await validateOrg(value);
|
|
43
40
|
config.set(name, value);
|
|
44
|
-
this.
|
|
41
|
+
this.setResponses.successes.push({ name, value, success: true });
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
catch (err) {
|
|
48
|
-
|
|
45
|
+
const error = err;
|
|
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')) {
|
|
72
|
+
if (this.jsonEnabled()) {
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
this.setResponses.failures.push({
|
|
75
|
+
name,
|
|
76
|
+
value,
|
|
77
|
+
success: false,
|
|
78
|
+
error,
|
|
79
|
+
message: error.message.replace(/\.\.$/, '.'),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const suggestion = this.calculateSuggestion(name);
|
|
84
|
+
// eslint-disable-next-line no-await-in-loop
|
|
85
|
+
const answer = (await this.confirm(messages.getMessage('didYouMean', [suggestion]), 10 * 1000)) ?? false;
|
|
86
|
+
if (answer) {
|
|
87
|
+
const key = core_1.Config.getPropertyConfigMeta(suggestion)?.key ?? suggestion;
|
|
88
|
+
config.set(key, value);
|
|
89
|
+
this.setResponses.successes.push({ name: key, value, success: true });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.pushFailure(name, err, value);
|
|
95
|
+
}
|
|
49
96
|
}
|
|
50
97
|
}
|
|
51
98
|
await config.write();
|
|
52
99
|
if (!this.jsonEnabled()) {
|
|
100
|
+
this.responses = [...this.setResponses.successes, ...this.setResponses.failures];
|
|
53
101
|
this.output('Set Config', false);
|
|
54
102
|
}
|
|
55
|
-
return this.
|
|
103
|
+
return this.setResponses;
|
|
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;
|
|
56
115
|
}
|
|
57
116
|
}
|
|
58
117
|
exports.Set = Set;
|
|
59
118
|
Set.description = messages.getMessage('description');
|
|
60
119
|
Set.summary = messages.getMessage('summary');
|
|
61
120
|
Set.examples = messages.getMessages('examples');
|
|
121
|
+
Set.aliases = ['force:config:set'];
|
|
122
|
+
Set.deprecateAliases = true;
|
|
62
123
|
Set.strict = false;
|
|
63
124
|
Set.flags = {
|
|
125
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
64
126
|
global: sf_plugins_core_1.Flags.boolean({
|
|
65
127
|
char: 'g',
|
|
66
128
|
summary: messages.getMessage('flags.global.summary'),
|
|
@@ -69,13 +131,14 @@ Set.flags = {
|
|
|
69
131
|
Set.configurationVariablesSection = config_1.CONFIG_HELP_SECTION;
|
|
70
132
|
const loadConfig = async (global) => {
|
|
71
133
|
try {
|
|
134
|
+
await core_1.SfdxConfigAggregator.create({});
|
|
72
135
|
const config = await core_1.Config.create(core_1.Config.getDefaultOptions(global));
|
|
73
136
|
await config.read();
|
|
74
137
|
return config;
|
|
75
138
|
}
|
|
76
139
|
catch (error) {
|
|
77
140
|
if (error instanceof core_1.SfError) {
|
|
78
|
-
error.actions = error.actions
|
|
141
|
+
error.actions = error.actions ?? [];
|
|
79
142
|
error.actions.push('Run with --global to set for your entire workspace.');
|
|
80
143
|
}
|
|
81
144
|
throw error;
|
|
@@ -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,iEAA4E;AAC5E,2CAA6G;AAC7G,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;IA8FjF,CAAC;IA5FQ,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,IAAI,CAAC,KAAK,EAAE;oBACV,gEAAgE;oBAChE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,KAAK,CAAC,CAAC;iB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MAAM,GAAG,MAAM,aAAM,CAAC,MAAM,CAAC,aAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,YAAY,cAAO,EAAE;YAC5B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;YACpC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;SAC3E;QACD,MAAM,KAAK,CAAC;KACb;AACH,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAW,EAAE,CACzC,CAAC,0BAAmB,CAAC,cAAwB,EAAE,0BAAmB,CAAC,UAAoB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAE1G,MAAM,WAAW,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IACzD,IAAI;QACF,MAAM,UAAG,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC;KAC9C;IAAC,MAAM;QACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,yBAAyB,CAAC,CAAC;KAC/E;AACH,CAAC,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { ConfigCommand
|
|
2
|
-
|
|
1
|
+
import { ConfigCommand } from '../../config';
|
|
2
|
+
import { SetConfigCommandResult } from './set';
|
|
3
|
+
export declare class UnSet extends ConfigCommand<SetConfigCommandResult> {
|
|
3
4
|
static readonly description: string;
|
|
4
5
|
static readonly summary: string;
|
|
5
6
|
static readonly examples: string[];
|
|
6
7
|
static readonly strict = false;
|
|
7
|
-
static
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
8
|
+
static readonly aliases: string[];
|
|
9
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
12
13
|
global: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
private unsetResponses;
|
|
16
|
+
run(): Promise<SetConfigCommandResult>;
|
|
17
|
+
protected pushFailure(name: string, err: string | Error, value?: string): void;
|
|
15
18
|
}
|