@microsoft/vscode-ui 1.0.15-alpha.d9ea25f7c.0 → 1.0.15-alpha.eaecfe55f.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/build/error.js +2 -2
- package/build/error.js.map +1 -1
- package/build/progressHandler.js +9 -1
- package/build/progressHandler.js.map +1 -1
- package/build/ui.d.ts.map +1 -1
- package/build/ui.js +73 -68
- package/build/ui.js.map +1 -1
- package/build/validationUtils.d.ts.map +1 -1
- package/build/validationUtils.js +3 -7
- package/build/validationUtils.js.map +1 -1
- package/build/visitor.d.ts +2 -2
- package/build/visitor.d.ts.map +1 -1
- package/build/visitor.js +37 -37
- package/build/visitor.js.map +1 -1
- package/package.json +21 -19
package/build/error.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.UnhandledError = exports.MissingRequiredInputError = exports.InputValidationError = exports.UnsupportedQuestionTypeError = exports.ScriptExecutionError = exports.ScriptTimeoutError = exports.InternalUIError = exports.EmptyOptionsError = exports.UserCancelError = void 0;
|
|
6
|
+
exports.assembleError = assembleError;
|
|
6
7
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
8
|
class UserCancelError extends teamsfx_api_1.UserError {
|
|
8
9
|
constructor(message, displayMessage) {
|
|
@@ -116,5 +117,4 @@ function assembleError(e, message, displayMessage) {
|
|
|
116
117
|
return e;
|
|
117
118
|
return new UnhandledError(e, message, displayMessage);
|
|
118
119
|
}
|
|
119
|
-
exports.assembleError = assembleError;
|
|
120
120
|
//# sourceMappingURL=error.js.map
|
package/build/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA,uCAAuC;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B,CAAC;QACF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF;AAXD,wCAWC;AACD,SAAgB,aAAa,CAAC,CAAM,EAAE,OAAe,EAAE,cAAsB;IAC3E,IAAI,CAAC,YAAY,uBAAS,IAAI,CAAC,YAAY,yBAAW;QAAE,OAAO,CAAC,CAAC;IACjE,OAAO,IAAI,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AACxD,CAAC"}
|
package/build/progressHandler.js
CHANGED
|
@@ -9,6 +9,14 @@ const util = tslib_1.__importStar(require("util"));
|
|
|
9
9
|
const vscode_1 = require("vscode");
|
|
10
10
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
11
11
|
class ProgressHandler {
|
|
12
|
+
totalSteps;
|
|
13
|
+
currentStep;
|
|
14
|
+
title;
|
|
15
|
+
detail;
|
|
16
|
+
ended;
|
|
17
|
+
mutex;
|
|
18
|
+
view;
|
|
19
|
+
resolve;
|
|
12
20
|
constructor(title, totalSteps, view = "output") {
|
|
13
21
|
this.totalSteps = totalSteps;
|
|
14
22
|
this.currentStep = 0;
|
|
@@ -44,7 +52,7 @@ class ProgressHandler {
|
|
|
44
52
|
progress.report(status);
|
|
45
53
|
await new Promise((_resolve) => (this.resolve = _resolve));
|
|
46
54
|
} while (!this.ended);
|
|
47
|
-
return teamsfx_api_1.ok(null);
|
|
55
|
+
return (0, teamsfx_api_1.ok)(null);
|
|
48
56
|
});
|
|
49
57
|
return Promise.resolve(undefined);
|
|
50
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressHandler.js","sourceRoot":"","sources":["../src/progressHandler.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,6CAAoC;AACpC,mDAA6B;AAC7B,mCAAkD;AAClD,wDAA8D;AAE9D,MAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"progressHandler.js","sourceRoot":"","sources":["../src/progressHandler.ts"],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GAAG,SAAS,CAAC;QAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,GAAG,CAAC,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,GAAG,SAAS,CAAC;QAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmHvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;CAmB3E"}
|
package/build/ui.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.VSCodeUI =
|
|
5
|
+
exports.VSCodeUI = void 0;
|
|
6
|
+
exports.sleep = sleep;
|
|
6
7
|
const tslib_1 = require("tslib");
|
|
7
8
|
const fs = tslib_1.__importStar(require("fs"));
|
|
8
9
|
const lodash_1 = require("lodash");
|
|
@@ -17,7 +18,6 @@ async function sleep(ms) {
|
|
|
17
18
|
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
18
19
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
19
20
|
}
|
|
20
|
-
exports.sleep = sleep;
|
|
21
21
|
function getOptionItem(item) {
|
|
22
22
|
return {
|
|
23
23
|
id: item.id,
|
|
@@ -38,7 +38,7 @@ function convertToFxQuickPickItems(options) {
|
|
|
38
38
|
const candidates = [...options];
|
|
39
39
|
while (candidates.length > 0) {
|
|
40
40
|
const groupName = candidates[0].groupName;
|
|
41
|
-
const group = lodash_1.remove(candidates, (option) => option.groupName === groupName);
|
|
41
|
+
const group = (0, lodash_1.remove)(candidates, (option) => option.groupName === groupName);
|
|
42
42
|
if (groupName) {
|
|
43
43
|
result.push({
|
|
44
44
|
id: groupName,
|
|
@@ -47,14 +47,13 @@ function convertToFxQuickPickItems(options) {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
result.push(...group.map((option) => {
|
|
50
|
-
var _a;
|
|
51
50
|
return {
|
|
52
51
|
id: option.id,
|
|
53
52
|
label: option.label,
|
|
54
53
|
description: option.description,
|
|
55
54
|
detail: option.detail,
|
|
56
55
|
data: option.data,
|
|
57
|
-
buttons:
|
|
56
|
+
buttons: option.buttons?.map((button) => {
|
|
58
57
|
return { iconPath: new vscode_1.ThemeIcon(button.iconPath), tooltip: button.tooltip };
|
|
59
58
|
}),
|
|
60
59
|
};
|
|
@@ -84,6 +83,9 @@ function isSame(set1, set2) {
|
|
|
84
83
|
* This is the default implementation of UserInteraction in vscode.
|
|
85
84
|
*/
|
|
86
85
|
class VSCodeUI {
|
|
86
|
+
terminalName;
|
|
87
|
+
assembleError;
|
|
88
|
+
localizer;
|
|
87
89
|
constructor(terminalName, assembleError, localizer) {
|
|
88
90
|
this.terminalName = terminalName;
|
|
89
91
|
this.assembleError = assembleError;
|
|
@@ -91,7 +93,7 @@ class VSCodeUI {
|
|
|
91
93
|
}
|
|
92
94
|
async selectOption(config) {
|
|
93
95
|
if (typeof config.options === "object" && config.options.length === 0) {
|
|
94
|
-
return teamsfx_api_1.err(new error_1.EmptyOptionsError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage()));
|
|
96
|
+
return (0, teamsfx_api_1.err)(new error_1.EmptyOptionsError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage()));
|
|
95
97
|
}
|
|
96
98
|
const disposables = [];
|
|
97
99
|
try {
|
|
@@ -137,13 +139,13 @@ class VSCodeUI {
|
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
catch (e) {
|
|
140
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
142
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
else
|
|
145
147
|
result = getOptionItem(item);
|
|
146
|
-
resolve(teamsfx_api_1.ok({ type: isSkip ? "skip" : "success", result: result, options: options }));
|
|
148
|
+
resolve((0, teamsfx_api_1.ok)({ type: isSkip ? "skip" : "success", result: result, options: options }));
|
|
147
149
|
}
|
|
148
150
|
};
|
|
149
151
|
const loadDynamicData = async () => {
|
|
@@ -164,7 +166,7 @@ class VSCodeUI {
|
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
168
|
catch (e) {
|
|
167
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
169
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
168
170
|
}
|
|
169
171
|
};
|
|
170
172
|
const onDataLoaded = () => {
|
|
@@ -197,13 +199,12 @@ class VSCodeUI {
|
|
|
197
199
|
}
|
|
198
200
|
};
|
|
199
201
|
disposables.push(quickPick.onDidAccept(onDidAccept), quickPick.onDidHide(() => {
|
|
200
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.cancelErrorMessage(), this.localizer.cancelErrorDisplayMessage())));
|
|
202
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.cancelErrorMessage(), this.localizer.cancelErrorDisplayMessage())));
|
|
201
203
|
}), quickPick.onDidTriggerButton(async (button) => {
|
|
202
|
-
var _a;
|
|
203
204
|
if (button === vscode_1.QuickInputButtons.Back)
|
|
204
|
-
resolve(teamsfx_api_1.ok({ type: "back" }));
|
|
205
|
+
resolve((0, teamsfx_api_1.ok)({ type: "back" }));
|
|
205
206
|
else if (config.buttons && buttons.indexOf(button) !== -1) {
|
|
206
|
-
const curButton =
|
|
207
|
+
const curButton = config.buttons?.find((btn) => {
|
|
207
208
|
return (btn.icon === button.iconPath.id && btn.tooltip === button.tooltip);
|
|
208
209
|
});
|
|
209
210
|
if (curButton) {
|
|
@@ -215,7 +216,6 @@ class VSCodeUI {
|
|
|
215
216
|
await onDidAccept();
|
|
216
217
|
}
|
|
217
218
|
}), quickPick.onDidTriggerItemButton(async (event) => {
|
|
218
|
-
var _a;
|
|
219
219
|
const itemOptions = options;
|
|
220
220
|
if (itemOptions.length > 0 && typeof itemOptions[0] === "string") {
|
|
221
221
|
return;
|
|
@@ -226,7 +226,7 @@ class VSCodeUI {
|
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
if (triggerItem) {
|
|
229
|
-
const triggerButton =
|
|
229
|
+
const triggerButton = triggerItem.buttons?.find((button) => {
|
|
230
230
|
return button.iconPath === event.button.iconPath.id;
|
|
231
231
|
});
|
|
232
232
|
if (triggerButton) {
|
|
@@ -259,10 +259,10 @@ class VSCodeUI {
|
|
|
259
259
|
quickPick.show();
|
|
260
260
|
loadDynamicData()
|
|
261
261
|
.then(onDataLoaded)
|
|
262
|
-
.catch((e) => resolve(teamsfx_api_1.err(this.assembleError(e))));
|
|
262
|
+
.catch((e) => resolve((0, teamsfx_api_1.err)(this.assembleError(e))));
|
|
263
263
|
}
|
|
264
264
|
})
|
|
265
|
-
.catch((e) => resolve(teamsfx_api_1.err(this.assembleError(e))));
|
|
265
|
+
.catch((e) => resolve((0, teamsfx_api_1.err)(this.assembleError(e))));
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
268
268
|
options = config.options;
|
|
@@ -280,7 +280,7 @@ class VSCodeUI {
|
|
|
280
280
|
}
|
|
281
281
|
async selectOptions(config) {
|
|
282
282
|
if (typeof config.options === "object" && config.options.length === 0) {
|
|
283
|
-
return teamsfx_api_1.err(new error_1.EmptyOptionsError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage()));
|
|
283
|
+
return (0, teamsfx_api_1.err)(new error_1.EmptyOptionsError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage()));
|
|
284
284
|
}
|
|
285
285
|
const disposables = [];
|
|
286
286
|
try {
|
|
@@ -323,7 +323,7 @@ class VSCodeUI {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
catch (e) {
|
|
326
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
326
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
329
|
const onDidAccept = async () => {
|
|
@@ -342,7 +342,7 @@ class VSCodeUI {
|
|
|
342
342
|
result = strArray;
|
|
343
343
|
else
|
|
344
344
|
result = quickPick.selectedItems.map((i) => getOptionItem(i));
|
|
345
|
-
resolve(teamsfx_api_1.ok({ type: isSkip ? "skip" : "success", result: result }));
|
|
345
|
+
resolve((0, teamsfx_api_1.ok)({ type: isSkip ? "skip" : "success", result: result }));
|
|
346
346
|
};
|
|
347
347
|
const onDataLoaded = () => {
|
|
348
348
|
quickPick.busy = false;
|
|
@@ -371,10 +371,10 @@ class VSCodeUI {
|
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
373
|
disposables.push(quickPick.onDidAccept(onDidAccept), quickPick.onDidHide(() => {
|
|
374
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
374
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
375
375
|
}), quickPick.onDidTriggerButton(async (button) => {
|
|
376
376
|
if (button === vscode_1.QuickInputButtons.Back)
|
|
377
|
-
resolve(teamsfx_api_1.ok({ type: "back" }));
|
|
377
|
+
resolve((0, teamsfx_api_1.ok)({ type: "back" }));
|
|
378
378
|
else {
|
|
379
379
|
await onDidAccept();
|
|
380
380
|
}
|
|
@@ -429,10 +429,10 @@ class VSCodeUI {
|
|
|
429
429
|
quickPick.show();
|
|
430
430
|
loadDynamicData()
|
|
431
431
|
.then(onDataLoaded)
|
|
432
|
-
.catch((e) => resolve(teamsfx_api_1.err(this.assembleError(e))));
|
|
432
|
+
.catch((e) => resolve((0, teamsfx_api_1.err)(this.assembleError(e))));
|
|
433
433
|
}
|
|
434
434
|
})
|
|
435
|
-
.catch((e) => resolve(teamsfx_api_1.err(this.assembleError(e))));
|
|
435
|
+
.catch((e) => resolve((0, teamsfx_api_1.err)(this.assembleError(e))));
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
438
438
|
options = config.options;
|
|
@@ -468,7 +468,7 @@ class VSCodeUI {
|
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
catch (e) {
|
|
471
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
471
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
474
|
const onDataLoaded = () => {
|
|
@@ -491,7 +491,7 @@ class VSCodeUI {
|
|
|
491
491
|
try {
|
|
492
492
|
const additionalValidationOnAcceptRes = await config.additionalValidationOnAccept(oldValue);
|
|
493
493
|
if (!additionalValidationOnAcceptRes) {
|
|
494
|
-
resolve(teamsfx_api_1.ok({ type: "success", result: oldValue }));
|
|
494
|
+
resolve((0, teamsfx_api_1.ok)({ type: "success", result: oldValue }));
|
|
495
495
|
}
|
|
496
496
|
else {
|
|
497
497
|
inputBox.validationMessage = additionalValidationOnAcceptRes;
|
|
@@ -502,13 +502,13 @@ class VSCodeUI {
|
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
catch (e) {
|
|
505
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
505
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
else {
|
|
509
|
-
resolve(teamsfx_api_1.ok({ type: "success", result: inputBox.value }));
|
|
509
|
+
resolve((0, teamsfx_api_1.ok)({ type: "success", result: inputBox.value }));
|
|
510
510
|
}
|
|
511
|
-
resolve(teamsfx_api_1.ok({ type: "success", result: inputBox.value }));
|
|
511
|
+
resolve((0, teamsfx_api_1.ok)({ type: "success", result: inputBox.value }));
|
|
512
512
|
}
|
|
513
513
|
else {
|
|
514
514
|
inputBox.validationMessage = validationRes;
|
|
@@ -520,7 +520,7 @@ class VSCodeUI {
|
|
|
520
520
|
inputBox.placeholder = this.localizer.loadingDefaultPlaceholder();
|
|
521
521
|
loadDynamicData()
|
|
522
522
|
.then(onDataLoaded)
|
|
523
|
-
.catch((e) => resolve(teamsfx_api_1.err(this.assembleError(e))));
|
|
523
|
+
.catch((e) => resolve((0, teamsfx_api_1.err)(this.assembleError(e))));
|
|
524
524
|
}
|
|
525
525
|
else {
|
|
526
526
|
defaultValue = config.default || "";
|
|
@@ -537,10 +537,10 @@ class VSCodeUI {
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
}), inputBox.onDidAccept(onDidAccept), inputBox.onDidHide(() => {
|
|
540
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
540
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
541
541
|
}), inputBox.onDidTriggerButton(async (button) => {
|
|
542
542
|
if (button === vscode_1.QuickInputButtons.Back)
|
|
543
|
-
resolve(teamsfx_api_1.ok({ type: "back" }));
|
|
543
|
+
resolve((0, teamsfx_api_1.ok)({ type: "back" }));
|
|
544
544
|
else {
|
|
545
545
|
await onDidAccept();
|
|
546
546
|
}
|
|
@@ -577,7 +577,7 @@ class VSCodeUI {
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
catch (e) {
|
|
580
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
580
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
583
|
const onDataLoaded = () => {
|
|
@@ -604,7 +604,7 @@ class VSCodeUI {
|
|
|
604
604
|
quickPick.placeholder = this.localizer.loadingDefaultPlaceholder();
|
|
605
605
|
loadDynamicData()
|
|
606
606
|
.then(onDataLoaded)
|
|
607
|
-
.catch((e) => resolve(teamsfx_api_1.err(this.assembleError(e))));
|
|
607
|
+
.catch((e) => resolve((0, teamsfx_api_1.err)(this.assembleError(e))));
|
|
608
608
|
}
|
|
609
609
|
else {
|
|
610
610
|
defaultValue = config.default;
|
|
@@ -616,7 +616,7 @@ class VSCodeUI {
|
|
|
616
616
|
if (selectedItems && selectedItems.length > 0) {
|
|
617
617
|
const item = selectedItems[0];
|
|
618
618
|
if (item.id === "default") {
|
|
619
|
-
resolve(teamsfx_api_1.ok({ type: "success", result: defaultValue }));
|
|
619
|
+
resolve((0, teamsfx_api_1.ok)({ type: "success", result: defaultValue }));
|
|
620
620
|
}
|
|
621
621
|
else {
|
|
622
622
|
hideByDialog = true;
|
|
@@ -629,21 +629,21 @@ class VSCodeUI {
|
|
|
629
629
|
});
|
|
630
630
|
if (uriList && uriList.length > 0) {
|
|
631
631
|
const result = uriList[0].fsPath;
|
|
632
|
-
resolve(teamsfx_api_1.ok({ type: "success", result: result }));
|
|
632
|
+
resolve((0, teamsfx_api_1.ok)({ type: "success", result: result }));
|
|
633
633
|
}
|
|
634
634
|
else {
|
|
635
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
635
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
639
|
};
|
|
640
640
|
disposables.push(quickPick.onDidAccept(onDidAccept), quickPick.onDidHide(() => {
|
|
641
641
|
if (!hideByDialog) {
|
|
642
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
642
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
643
643
|
}
|
|
644
644
|
}), quickPick.onDidTriggerButton((button) => {
|
|
645
645
|
if (button === vscode_1.QuickInputButtons.Back)
|
|
646
|
-
resolve(teamsfx_api_1.ok({ type: "back" }));
|
|
646
|
+
resolve((0, teamsfx_api_1.ok)({ type: "back" }));
|
|
647
647
|
}));
|
|
648
648
|
disposables.push(quickPick);
|
|
649
649
|
quickPick.show();
|
|
@@ -675,7 +675,7 @@ class VSCodeUI {
|
|
|
675
675
|
async selectFileInQuickPick(config, type, defaultValue) {
|
|
676
676
|
if (config.possibleFiles) {
|
|
677
677
|
if (config.possibleFiles.find((o) => o.id === "browse" || o.id === "default")) {
|
|
678
|
-
return Promise.resolve(teamsfx_api_1.err(new teamsfx_api_1.SystemError("UI", "InvalidInput", 'Possible files should not contain item with id "browse" or "default".')));
|
|
678
|
+
return Promise.resolve((0, teamsfx_api_1.err)(new teamsfx_api_1.SystemError("UI", "InvalidInput", 'Possible files should not contain item with id "browse" or "default".')));
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
/// TODO: use generic constraints.
|
|
@@ -716,7 +716,6 @@ class VSCodeUI {
|
|
|
716
716
|
},
|
|
717
717
|
];
|
|
718
718
|
const onDidAccept = async () => {
|
|
719
|
-
var _a, _b;
|
|
720
719
|
const selectedItems = quickPick.selectedItems;
|
|
721
720
|
let result;
|
|
722
721
|
if (selectedItems && selectedItems.length > 0) {
|
|
@@ -753,7 +752,7 @@ class VSCodeUI {
|
|
|
753
752
|
}
|
|
754
753
|
}
|
|
755
754
|
else {
|
|
756
|
-
result =
|
|
755
|
+
result = config.possibleFiles?.find((f) => f.id === item.id)?.id;
|
|
757
756
|
}
|
|
758
757
|
if (config.validation && result !== undefined) {
|
|
759
758
|
quickPick.busy = true;
|
|
@@ -770,18 +769,18 @@ class VSCodeUI {
|
|
|
770
769
|
}
|
|
771
770
|
}
|
|
772
771
|
catch (e) {
|
|
773
|
-
resolve(teamsfx_api_1.err(this.assembleError(e)));
|
|
772
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(e)));
|
|
774
773
|
}
|
|
775
774
|
}
|
|
776
|
-
resolve(teamsfx_api_1.ok({ type: "success", result: result }));
|
|
775
|
+
resolve((0, teamsfx_api_1.ok)({ type: "success", result: result }));
|
|
777
776
|
}
|
|
778
777
|
};
|
|
779
778
|
disposables.push(quickPick.onDidAccept(onDidAccept), quickPick.onDidHide(() => {
|
|
780
779
|
if (fileSelectorIsOpen === false)
|
|
781
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
780
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
782
781
|
}), quickPick.onDidTriggerButton((button) => {
|
|
783
782
|
if (button === vscode_1.QuickInputButtons.Back)
|
|
784
|
-
resolve(teamsfx_api_1.ok({ type: "back" }));
|
|
783
|
+
resolve((0, teamsfx_api_1.ok)({ type: "back" }));
|
|
785
784
|
}));
|
|
786
785
|
disposables.push(quickPick);
|
|
787
786
|
quickPick.show();
|
|
@@ -797,10 +796,10 @@ class VSCodeUI {
|
|
|
797
796
|
const uri = vscode_1.Uri.parse(link);
|
|
798
797
|
const result = await vscode_1.env.openExternal(uri);
|
|
799
798
|
if (result) {
|
|
800
|
-
return teamsfx_api_1.ok(result);
|
|
799
|
+
return (0, teamsfx_api_1.ok)(result);
|
|
801
800
|
}
|
|
802
801
|
else {
|
|
803
|
-
return teamsfx_api_1.err(new error_1.InternalUIError(this.localizer.internalErrorMessage(`env.openExternal('${link}')`), this.localizer.internalErrorDisplayMessage(`env.openExternal('${link}')`)));
|
|
802
|
+
return (0, teamsfx_api_1.err)(new error_1.InternalUIError(this.localizer.internalErrorMessage(`env.openExternal('${link}')`), this.localizer.internalErrorDisplayMessage(`env.openExternal('${link}')`)));
|
|
804
803
|
}
|
|
805
804
|
}
|
|
806
805
|
async selectFileOrInput(config) {
|
|
@@ -812,41 +811,47 @@ class VSCodeUI {
|
|
|
812
811
|
return await config.validation(input);
|
|
813
812
|
}
|
|
814
813
|
};
|
|
815
|
-
const selectFileConfig =
|
|
814
|
+
const selectFileConfig = {
|
|
815
|
+
...config,
|
|
816
|
+
validation: validtionOnSelect,
|
|
817
|
+
possibleFiles: [config.inputOptionItem],
|
|
818
|
+
};
|
|
816
819
|
while (true) {
|
|
817
820
|
const selectFileOrItemRes = await this.selectFile(selectFileConfig);
|
|
818
821
|
if (selectFileOrItemRes.isOk()) {
|
|
819
822
|
if (selectFileOrItemRes.value.result === config.inputOptionItem.id) {
|
|
820
|
-
const inputRes = await this.inputText(
|
|
823
|
+
const inputRes = await this.inputText({
|
|
824
|
+
...config.inputBoxConfig,
|
|
825
|
+
additionalValidationOnAccept: config.validation,
|
|
826
|
+
});
|
|
821
827
|
if (inputRes.isOk()) {
|
|
822
828
|
if (inputRes.value.type === "back")
|
|
823
829
|
continue;
|
|
824
|
-
return teamsfx_api_1.ok(inputRes.value);
|
|
830
|
+
return (0, teamsfx_api_1.ok)(inputRes.value);
|
|
825
831
|
}
|
|
826
832
|
else {
|
|
827
|
-
return teamsfx_api_1.err(inputRes.error);
|
|
833
|
+
return (0, teamsfx_api_1.err)(inputRes.error);
|
|
828
834
|
}
|
|
829
835
|
}
|
|
830
836
|
else {
|
|
831
|
-
return teamsfx_api_1.ok(selectFileOrItemRes.value);
|
|
837
|
+
return (0, teamsfx_api_1.ok)(selectFileOrItemRes.value);
|
|
832
838
|
}
|
|
833
839
|
}
|
|
834
840
|
else {
|
|
835
|
-
return teamsfx_api_1.err(selectFileOrItemRes.error);
|
|
841
|
+
return (0, teamsfx_api_1.err)(selectFileOrItemRes.error);
|
|
836
842
|
}
|
|
837
843
|
}
|
|
838
844
|
}
|
|
839
845
|
async confirm(config) {
|
|
840
|
-
|
|
841
|
-
const confirmText = ((_a = config.transformer) === null || _a === void 0 ? void 0 : _a.call(config, true)) || "Confirm";
|
|
846
|
+
const confirmText = config.transformer?.(true) || "Confirm";
|
|
842
847
|
const res = await this.showMessage("warn", config.title, true, confirmText);
|
|
843
848
|
if (res.isErr()) {
|
|
844
|
-
return teamsfx_api_1.err(res.error);
|
|
849
|
+
return (0, teamsfx_api_1.err)(res.error);
|
|
845
850
|
}
|
|
846
851
|
const value = res.value;
|
|
847
852
|
if (value === confirmText)
|
|
848
|
-
return teamsfx_api_1.ok({ type: "success", result: true });
|
|
849
|
-
return teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage()));
|
|
853
|
+
return (0, teamsfx_api_1.ok)({ type: "success", result: true });
|
|
854
|
+
return (0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage()));
|
|
850
855
|
}
|
|
851
856
|
async showMessage(level, message, modal, ...items) {
|
|
852
857
|
if (message instanceof Array) {
|
|
@@ -870,13 +875,13 @@ class VSCodeUI {
|
|
|
870
875
|
}
|
|
871
876
|
promise.then((v) => {
|
|
872
877
|
if (v)
|
|
873
|
-
resolve(teamsfx_api_1.ok(v));
|
|
878
|
+
resolve((0, teamsfx_api_1.ok)(v));
|
|
874
879
|
else
|
|
875
|
-
resolve(teamsfx_api_1.err(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
880
|
+
resolve((0, teamsfx_api_1.err)(new error_1.UserCancelError(this.localizer.emptyOptionErrorMessage(), this.localizer.emptyOptionErrorDisplayMessage())));
|
|
876
881
|
}, (error) => { });
|
|
877
882
|
}
|
|
878
883
|
catch (error) {
|
|
879
|
-
resolve(teamsfx_api_1.err(this.assembleError(error)));
|
|
884
|
+
resolve((0, teamsfx_api_1.err)(this.assembleError(error)));
|
|
880
885
|
}
|
|
881
886
|
});
|
|
882
887
|
}
|
|
@@ -916,7 +921,7 @@ class VSCodeUI {
|
|
|
916
921
|
if (isWindows) {
|
|
917
922
|
// PowerShell script for Windows
|
|
918
923
|
// Capture output to file within the script itself for compatibility
|
|
919
|
-
scriptContent =
|
|
924
|
+
scriptContent = `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = [System.Text.Encoding]::UTF8; $ErrorActionPreference = 'Continue'\n& {\n${cmd}\n} 2>&1 | ForEach-Object { $_ | Out-File -FilePath "${tempFile}" -Encoding utf8 -Append; $_ }\n`;
|
|
920
925
|
// Use the shell parameter if provided, otherwise default to powershell for broader compatibility
|
|
921
926
|
const shellCmd = args.shell || "powershell";
|
|
922
927
|
wrappedCmd = `${shellCmd} -NoProfile -ExecutionPolicy Bypass -File "${scriptFile}"`;
|
|
@@ -936,7 +941,7 @@ class VSCodeUI {
|
|
|
936
941
|
? new Promise((_, reject) => {
|
|
937
942
|
setTimeout(() => {
|
|
938
943
|
reject(new error_1.ScriptTimeoutError(this.localizer.commandTimeoutErrorMessage(cmd), this.localizer.commandTimeoutErrorDisplayMessage(cmd)));
|
|
939
|
-
}, timeout
|
|
944
|
+
}, timeout ?? 1000 * 60 * 30);
|
|
940
945
|
})
|
|
941
946
|
: undefined;
|
|
942
947
|
const taskPromise = new Promise((resolve, reject) => {
|
|
@@ -975,10 +980,10 @@ class VSCodeUI {
|
|
|
975
980
|
else {
|
|
976
981
|
output = await taskPromise;
|
|
977
982
|
}
|
|
978
|
-
return teamsfx_api_1.ok(output);
|
|
983
|
+
return (0, teamsfx_api_1.ok)(output);
|
|
979
984
|
}
|
|
980
985
|
catch (error) {
|
|
981
|
-
return teamsfx_api_1.err(this.assembleError(error));
|
|
986
|
+
return (0, teamsfx_api_1.err)(this.assembleError(error));
|
|
982
987
|
}
|
|
983
988
|
}
|
|
984
989
|
async openFile(filePath) {
|
|
@@ -991,10 +996,10 @@ class VSCodeUI {
|
|
|
991
996
|
else {
|
|
992
997
|
await vscode_1.window.showTextDocument(doc);
|
|
993
998
|
}
|
|
994
|
-
return teamsfx_api_1.ok(true);
|
|
999
|
+
return (0, teamsfx_api_1.ok)(true);
|
|
995
1000
|
}
|
|
996
1001
|
else {
|
|
997
|
-
return teamsfx_api_1.err(new error_1.InternalUIError(this.localizer.internalErrorMessage(`workspace.openTextDocument('${filePath}')`), this.localizer.internalErrorDisplayMessage(`workspace.openTextDocument('${filePath}')`)));
|
|
1002
|
+
return (0, teamsfx_api_1.err)(new error_1.InternalUIError(this.localizer.internalErrorMessage(`workspace.openTextDocument('${filePath}')`), this.localizer.internalErrorDisplayMessage(`workspace.openTextDocument('${filePath}')`)));
|
|
998
1003
|
}
|
|
999
1004
|
}
|
|
1000
1005
|
}
|