@salesforce/sf-plugins-core 1.19.3 → 1.21.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/compatibility.d.ts +5 -0
- package/lib/compatibility.js +18 -1
- package/lib/ux/prompter.d.ts +2 -1
- package/lib/ux/prompter.js +3 -1
- package/messages/messages.md +4 -0
- package/package.json +2 -2
package/lib/compatibility.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OptionFlagProps } from '@oclif/core/lib/interfaces';
|
|
1
2
|
/**
|
|
2
3
|
* Adds an alias for the deprecated sfdx-style "apiversion" and provides a warning if it is used
|
|
3
4
|
* See orgApiVersionFlag for full details
|
|
@@ -36,4 +37,8 @@ export declare const requiredOrgFlagWithDeprecations: import("@oclif/core/lib/in
|
|
|
36
37
|
* @deprecated
|
|
37
38
|
*/
|
|
38
39
|
export declare const requiredHubFlagWithDeprecations: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
*/
|
|
43
|
+
export declare const arrayWithDeprecation: (options: Partial<Omit<OptionFlagProps, 'multiple' | 'parse'>>) => import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
|
|
39
44
|
//# sourceMappingURL=compatibility.d.ts.map
|
package/lib/compatibility.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
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.requiredHubFlagWithDeprecations = exports.requiredOrgFlagWithDeprecations = exports.optionalOrgFlagWithDeprecations = exports.loglevel = exports.orgApiVersionFlagWithDeprecations = void 0;
|
|
9
|
+
exports.arrayWithDeprecation = exports.requiredHubFlagWithDeprecations = exports.requiredOrgFlagWithDeprecations = exports.optionalOrgFlagWithDeprecations = exports.loglevel = exports.orgApiVersionFlagWithDeprecations = void 0;
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
11
|
const core_2 = require("@salesforce/core");
|
|
12
12
|
const orgApiVersion_1 = require("./flags/orgApiVersion");
|
|
@@ -70,4 +70,21 @@ exports.requiredHubFlagWithDeprecations = (0, orgFlags_1.requiredHubFlag)({
|
|
|
70
70
|
aliases: ['targetdevhubusername'],
|
|
71
71
|
deprecateAliases: true,
|
|
72
72
|
});
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated
|
|
75
|
+
*/
|
|
76
|
+
const arrayWithDeprecation = (options) => core_1.Flags.string({
|
|
77
|
+
// populate passed options
|
|
78
|
+
...options,
|
|
79
|
+
// overlay those options we own
|
|
80
|
+
multiple: true,
|
|
81
|
+
parse: async (input) => {
|
|
82
|
+
const inputParts = input.split(',').map((i) => i.trim());
|
|
83
|
+
if (inputParts.length > 1) {
|
|
84
|
+
await core_2.Lifecycle.getInstance().emitWarning(messages.getMessage('warning.arrayInputFormat'));
|
|
85
|
+
}
|
|
86
|
+
return inputParts;
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
exports.arrayWithDeprecation = arrayWithDeprecation;
|
|
73
90
|
//# sourceMappingURL=compatibility.js.map
|
package/lib/ux/prompter.d.ts
CHANGED
|
@@ -14,9 +14,10 @@ export declare class Prompter {
|
|
|
14
14
|
*
|
|
15
15
|
* @param message text to display. Do not include a question mark.
|
|
16
16
|
* @param ms milliseconds to wait for user input. Defaults to 10s.
|
|
17
|
+
* @param defaultAnswer default answer for the prompt. Defaults to true. Pass in `false` to require a positive response.
|
|
17
18
|
* @return true if the user confirms, false if they do not.
|
|
18
19
|
*/
|
|
19
|
-
confirm(message: string, ms?: number): Promise<boolean>;
|
|
20
|
+
confirm(message: string, ms?: number, defaultAnswer?: boolean): Promise<boolean>;
|
|
20
21
|
}
|
|
21
22
|
export declare namespace Prompter {
|
|
22
23
|
type Answers<T = Record<string, unknown>> = T & Record<string, unknown>;
|
package/lib/ux/prompter.js
CHANGED
|
@@ -46,14 +46,16 @@ class Prompter {
|
|
|
46
46
|
*
|
|
47
47
|
* @param message text to display. Do not include a question mark.
|
|
48
48
|
* @param ms milliseconds to wait for user input. Defaults to 10s.
|
|
49
|
+
* @param defaultAnswer default answer for the prompt. Defaults to true. Pass in `false` to require a positive response.
|
|
49
50
|
* @return true if the user confirms, false if they do not.
|
|
50
51
|
*/
|
|
51
|
-
async confirm(message, ms = 10000) {
|
|
52
|
+
async confirm(message, ms = 10000, defaultAnswer = true) {
|
|
52
53
|
const { confirmed } = await this.timedPrompt([
|
|
53
54
|
{
|
|
54
55
|
name: 'confirmed',
|
|
55
56
|
message,
|
|
56
57
|
type: 'confirm',
|
|
58
|
+
default: defaultAnswer,
|
|
57
59
|
},
|
|
58
60
|
], ms);
|
|
59
61
|
return confirmed;
|
package/messages/messages.md
CHANGED
|
@@ -94,3 +94,7 @@ Set varargs with this format: key=value or key="value with spaces".
|
|
|
94
94
|
# error.DuplicateArgument
|
|
95
95
|
|
|
96
96
|
Found duplicate argument %s.
|
|
97
|
+
|
|
98
|
+
# warning.arrayInputFormat
|
|
99
|
+
|
|
100
|
+
The input format for array arguments has changed. Use this format: --array-flag value1 --array-flag value2 --array-flag value3
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sf-plugins-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Utils for writing deploy and retrieve plugins",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"/messages"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@oclif/core": "^1.
|
|
35
|
+
"@oclif/core": "^1.21.0",
|
|
36
36
|
"@salesforce/core": "^3.32.6",
|
|
37
37
|
"@salesforce/kit": "^1.7.1",
|
|
38
38
|
"@salesforce/ts-types": "^1.7.1",
|