@microsoft/teamsfx-api 0.22.3 → 0.22.4-alpha.06f5ef6da.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/cli.d.ts +203 -0
- package/build/cli.d.ts.map +1 -0
- package/build/{v3/core.js → cli.js} +1 -1
- package/build/cli.js.map +1 -0
- package/build/constants.d.ts +4 -12
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +4 -12
- package/build/constants.js.map +1 -1
- package/build/context.d.ts +9 -28
- package/build/context.d.ts.map +1 -1
- package/build/error.d.ts +4 -47
- package/build/error.d.ts.map +1 -1
- package/build/error.js +9 -139
- package/build/error.js.map +1 -1
- package/build/index.d.ts +5 -16
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -17
- package/build/index.js.map +1 -1
- package/build/qm/index.d.ts +0 -1
- package/build/qm/index.d.ts.map +1 -1
- package/build/qm/index.js +0 -1
- package/build/qm/index.js.map +1 -1
- package/build/qm/question.d.ts +134 -26
- package/build/qm/question.d.ts.map +1 -1
- package/build/qm/question.js +0 -53
- package/build/qm/question.js.map +1 -1
- package/build/qm/ui.d.ts +72 -99
- package/build/qm/ui.d.ts.map +1 -1
- package/build/qm/ui.js +0 -86
- package/build/qm/ui.js.map +1 -1
- package/build/qm/validation.d.ts +7 -18
- package/build/qm/validation.d.ts.map +1 -1
- package/build/qm/validation.js +0 -159
- package/build/qm/validation.js.map +1 -1
- package/build/types.d.ts +73 -149
- package/build/types.d.ts.map +1 -1
- package/build/types.js +8 -97
- package/build/types.js.map +1 -1
- package/build/utils/log.d.ts +23 -36
- package/build/utils/log.d.ts.map +1 -1
- package/build/utils/log.js +7 -11
- package/build/utils/log.js.map +1 -1
- package/build/utils/login.d.ts +4 -4
- package/build/utils/login.d.ts.map +1 -1
- package/build/utils/login.js +4 -4
- package/build/utils/login.js.map +1 -1
- package/build/utils/telemetry.d.ts.map +1 -1
- package/package.json +8 -6
- package/build/action.d.ts +0 -109
- package/build/action.d.ts.map +0 -1
- package/build/action.js +0 -5
- package/build/action.js.map +0 -1
- package/build/bicep.d.ts +0 -19
- package/build/bicep.d.ts.map +0 -1
- package/build/bicep.js +0 -5
- package/build/bicep.js.map +0 -1
- package/build/component.d.ts +0 -31
- package/build/component.d.ts.map +0 -1
- package/build/component.js +0 -3
- package/build/component.js.map +0 -1
- package/build/core.d.ts +0 -50
- package/build/core.d.ts.map +0 -1
- package/build/core.js +0 -5
- package/build/core.js.map +0 -1
- package/build/plugin.d.ts +0 -71
- package/build/plugin.d.ts.map +0 -1
- package/build/plugin.js +0 -5
- package/build/plugin.js.map +0 -1
- package/build/qm/visitor.d.ts +0 -15
- package/build/qm/visitor.d.ts.map +0 -1
- package/build/qm/visitor.js +0 -388
- package/build/qm/visitor.js.map +0 -1
- package/build/solution.d.ts +0 -29
- package/build/solution.d.ts.map +0 -1
- package/build/solution.js +0 -5
- package/build/solution.js.map +0 -1
- package/build/v2/index.d.ts +0 -4
- package/build/v2/index.d.ts.map +0 -1
- package/build/v2/index.js +0 -9
- package/build/v2/index.js.map +0 -1
- package/build/v2/resourcePlugin.d.ts +0 -180
- package/build/v2/resourcePlugin.d.ts.map +0 -1
- package/build/v2/resourcePlugin.js +0 -5
- package/build/v2/resourcePlugin.js.map +0 -1
- package/build/v2/solutionPlugin.d.ts +0 -100
- package/build/v2/solutionPlugin.d.ts.map +0 -1
- package/build/v2/solutionPlugin.js +0 -5
- package/build/v2/solutionPlugin.js.map +0 -1
- package/build/v2/types.d.ts +0 -67
- package/build/v2/types.d.ts.map +0 -1
- package/build/v2/types.js +0 -28
- package/build/v2/types.js.map +0 -1
- package/build/v3/AzureResourceStates.d.ts +0 -58
- package/build/v3/AzureResourceStates.d.ts.map +0 -1
- package/build/v3/AzureResourceStates.js +0 -3
- package/build/v3/AzureResourceStates.js.map +0 -1
- package/build/v3/core.d.ts +0 -22
- package/build/v3/core.d.ts.map +0 -1
- package/build/v3/core.js.map +0 -1
- package/build/v3/index.d.ts +0 -7
- package/build/v3/index.d.ts.map +0 -1
- package/build/v3/index.js +0 -12
- package/build/v3/index.js.map +0 -1
- package/build/v3/plugins.d.ts +0 -104
- package/build/v3/plugins.d.ts.map +0 -1
- package/build/v3/plugins.js +0 -5
- package/build/v3/plugins.js.map +0 -1
- package/build/v3/resourceStates.d.ts +0 -66
- package/build/v3/resourceStates.d.ts.map +0 -1
- package/build/v3/resourceStates.js +0 -5
- package/build/v3/resourceStates.js.map +0 -1
- package/build/v3/solution.d.ts +0 -40
- package/build/v3/solution.d.ts.map +0 -1
- package/build/v3/solution.js +0 -5
- package/build/v3/solution.js.map +0 -1
- package/build/v3/types.d.ts +0 -28
- package/build/v3/types.d.ts.map +0 -1
- package/build/v3/types.js +0 -5
- package/build/v3/types.js.map +0 -1
- package/build/vscode.d.ts +0 -22
- package/build/vscode.d.ts.map +0 -1
- package/build/vscode.js +0 -5
- package/build/vscode.js.map +0 -1
package/build/error.js
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
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.SystemError = exports.UserError = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Users can recover by themselves, e.g., users input invalid app names.
|
|
8
8
|
*/
|
|
9
9
|
class UserError extends Error {
|
|
10
10
|
constructor(param1, param2, param3, param4) {
|
|
11
|
-
var _a
|
|
11
|
+
var _a;
|
|
12
12
|
let option;
|
|
13
|
-
let stack;
|
|
14
13
|
if (typeof param1 === "string") {
|
|
15
14
|
option = {
|
|
16
15
|
source: param1,
|
|
@@ -26,16 +25,11 @@ class UserError extends Error {
|
|
|
26
25
|
const message = option.message || ((_a = option.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
27
26
|
super(message);
|
|
28
27
|
//name
|
|
29
|
-
this.name = option.name ||
|
|
28
|
+
this.name = option.name || new.target.name;
|
|
30
29
|
//source
|
|
31
30
|
this.source = option.source || "unknown";
|
|
32
31
|
//stack
|
|
33
|
-
|
|
34
|
-
this.stack = stack;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
Error.captureStackTrace(this, new.target);
|
|
38
|
-
}
|
|
32
|
+
Error.captureStackTrace(this, new.target);
|
|
39
33
|
//prototype
|
|
40
34
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
41
35
|
//innerError
|
|
@@ -45,6 +39,7 @@ class UserError extends Error {
|
|
|
45
39
|
this.userData = option.userData;
|
|
46
40
|
this.displayMessage = option.displayMessage;
|
|
47
41
|
this.timestamp = new Date();
|
|
42
|
+
this.categories = option.categories;
|
|
48
43
|
}
|
|
49
44
|
}
|
|
50
45
|
exports.UserError = UserError;
|
|
@@ -53,9 +48,8 @@ exports.UserError = UserError;
|
|
|
53
48
|
*/
|
|
54
49
|
class SystemError extends Error {
|
|
55
50
|
constructor(param1, param2, param3, param4) {
|
|
56
|
-
var _a
|
|
51
|
+
var _a;
|
|
57
52
|
let option;
|
|
58
|
-
let stack;
|
|
59
53
|
if (typeof param1 === "string") {
|
|
60
54
|
option = {
|
|
61
55
|
source: param1,
|
|
@@ -71,16 +65,11 @@ class SystemError extends Error {
|
|
|
71
65
|
const message = option.message || ((_a = option.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
72
66
|
super(message);
|
|
73
67
|
//name
|
|
74
|
-
this.name = option.name ||
|
|
68
|
+
this.name = option.name || new.target.name;
|
|
75
69
|
//source
|
|
76
70
|
this.source = option.source || "unknown";
|
|
77
71
|
//stack
|
|
78
|
-
|
|
79
|
-
this.stack = stack;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
Error.captureStackTrace(this, new.target);
|
|
83
|
-
}
|
|
72
|
+
Error.captureStackTrace(this, new.target);
|
|
84
73
|
//prototype
|
|
85
74
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
86
75
|
//innerError
|
|
@@ -90,127 +79,8 @@ class SystemError extends Error {
|
|
|
90
79
|
this.userData = option.userData;
|
|
91
80
|
this.displayMessage = option.displayMessage;
|
|
92
81
|
this.timestamp = new Date();
|
|
82
|
+
this.categories = option.categories;
|
|
93
83
|
}
|
|
94
84
|
}
|
|
95
85
|
exports.SystemError = SystemError;
|
|
96
|
-
function assembleError(e, source) {
|
|
97
|
-
if (e instanceof UserError || e instanceof SystemError)
|
|
98
|
-
return e;
|
|
99
|
-
if (!source)
|
|
100
|
-
source = "unknown";
|
|
101
|
-
const type = typeof e;
|
|
102
|
-
if (type === "string") {
|
|
103
|
-
return new UnknownError(source, e);
|
|
104
|
-
}
|
|
105
|
-
else if (e instanceof Error) {
|
|
106
|
-
const err = e;
|
|
107
|
-
const fxError = new SystemError({ error: err, source });
|
|
108
|
-
fxError.stack = err.stack;
|
|
109
|
-
return fxError;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
return new UnknownError(source, JSON.stringify(e));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
exports.assembleError = assembleError;
|
|
116
|
-
class UnknownError extends SystemError {
|
|
117
|
-
constructor(source, message) {
|
|
118
|
-
super({ source: source || "API", message: message });
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.UnknownError = UnknownError;
|
|
122
|
-
exports.UserCancelError = new UserError("UI", "UserCancel", "User canceled.");
|
|
123
|
-
class EmptyOptionError extends SystemError {
|
|
124
|
-
constructor(source) {
|
|
125
|
-
super({ source: source || "API" });
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.EmptyOptionError = EmptyOptionError;
|
|
129
|
-
class PathAlreadyExistsError extends UserError {
|
|
130
|
-
constructor(source, path) {
|
|
131
|
-
super({ source: source, message: `Path ${path} already exists.` });
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.PathAlreadyExistsError = PathAlreadyExistsError;
|
|
135
|
-
class ObjectAlreadyExistsError extends UserError {
|
|
136
|
-
constructor(source, name) {
|
|
137
|
-
super({ source: source, message: `${name} already exists.` });
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.ObjectAlreadyExistsError = ObjectAlreadyExistsError;
|
|
141
|
-
class ObjectNotExistError extends UserError {
|
|
142
|
-
constructor(source, name) {
|
|
143
|
-
super({ source: source, message: `${name} does not exist.` });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.ObjectNotExistError = ObjectNotExistError;
|
|
147
|
-
class UndefinedError extends SystemError {
|
|
148
|
-
constructor(source, name) {
|
|
149
|
-
super({ source: source, message: `${name} is undefined, which is not expected` });
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
exports.UndefinedError = UndefinedError;
|
|
153
|
-
class NotImplementedError extends SystemError {
|
|
154
|
-
constructor(source, method) {
|
|
155
|
-
super({ source: source, message: `Method not implemented:${method}` });
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
exports.NotImplementedError = NotImplementedError;
|
|
159
|
-
class WriteFileError extends SystemError {
|
|
160
|
-
constructor(source, e) {
|
|
161
|
-
super({ source: source, error: e, name: "WriteFileError" });
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
exports.WriteFileError = WriteFileError;
|
|
165
|
-
class ReadFileError extends SystemError {
|
|
166
|
-
constructor(source, e) {
|
|
167
|
-
super({ source: source, error: e, name: "ReadFileError" });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
exports.ReadFileError = ReadFileError;
|
|
171
|
-
class NoProjectOpenedError extends UserError {
|
|
172
|
-
constructor(source) {
|
|
173
|
-
super({
|
|
174
|
-
source: source,
|
|
175
|
-
message: "No project opened, you can create a new project or open an existing one.",
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.NoProjectOpenedError = NoProjectOpenedError;
|
|
180
|
-
class ConcurrentError extends UserError {
|
|
181
|
-
constructor(source) {
|
|
182
|
-
super({
|
|
183
|
-
source: source,
|
|
184
|
-
message: "Previous task is still running. Please wait util your previous task to finish and try again.",
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
exports.ConcurrentError = ConcurrentError;
|
|
189
|
-
class InvalidInputError extends UserError {
|
|
190
|
-
constructor(source, name, reason) {
|
|
191
|
-
super({ source: source, message: `Input '${name}' is invalid: ${reason}` });
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
exports.InvalidInputError = InvalidInputError;
|
|
195
|
-
class InvalidProjectError extends UserError {
|
|
196
|
-
constructor(source, msg) {
|
|
197
|
-
super({
|
|
198
|
-
source: source,
|
|
199
|
-
message: `The command only works for project created by Teams Toolkit. ${msg ? ": " + msg : ""}`,
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
exports.InvalidProjectError = InvalidProjectError;
|
|
204
|
-
class InvalidObjectError extends UserError {
|
|
205
|
-
constructor(source, name, reason) {
|
|
206
|
-
super({ source: source, message: `${name} is invalid: ${reason}` });
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
exports.InvalidObjectError = InvalidObjectError;
|
|
210
|
-
class InvalidOperationError extends UserError {
|
|
211
|
-
constructor(source, name, reason) {
|
|
212
|
-
super({ source: source, message: `Invalid operation: ${name} ${reason}` });
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
exports.InvalidOperationError = InvalidOperationError;
|
|
216
86
|
//# 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;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAqClC;;GAEG;AACH,MAAa,SAAU,SAAQ,KAAK;IA8BlC,YACE,MAAiC,EACjC,MAAe,EACf,MAAe,EACf,MAAe;;QAEf,IAAI,MAAwB,C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from "./utils";
|
|
3
3
|
export * from "./constants";
|
|
4
4
|
export * from "./context";
|
|
5
|
-
export * from "./core";
|
|
6
|
-
export * from "./types";
|
|
7
|
-
export * from "./plugin";
|
|
8
|
-
export * from "./solution";
|
|
9
|
-
export * from "./vscode";
|
|
10
|
-
export * from "@microsoft/teams-manifest";
|
|
11
|
-
export * from "./utils";
|
|
12
5
|
export * from "./error";
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./schemas";
|
|
15
|
-
export * from "./action";
|
|
16
|
-
export * from "./bicep";
|
|
17
|
-
export * from "./component";
|
|
18
|
-
export { v2 };
|
|
19
|
-
export { v3 };
|
|
6
|
+
export * from "./types";
|
|
20
7
|
export * from "neverthrow";
|
|
8
|
+
export * from "@microsoft/teams-manifest";
|
|
9
|
+
export * from "./cli";
|
|
21
10
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,OAAO,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -2,26 +2,14 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.v3 = exports.v2 = void 0;
|
|
6
5
|
const tslib_1 = require("tslib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const v3 = tslib_1.__importStar(require("./v3"));
|
|
10
|
-
exports.v3 = v3;
|
|
6
|
+
tslib_1.__exportStar(require("./qm"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./utils"), exports);
|
|
11
8
|
tslib_1.__exportStar(require("./constants"), exports);
|
|
12
9
|
tslib_1.__exportStar(require("./context"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./core"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./plugin"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./solution"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./vscode"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("@microsoft/teams-manifest"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./utils"), exports);
|
|
20
10
|
tslib_1.__exportStar(require("./error"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./
|
|
22
|
-
tslib_1.__exportStar(require("./schemas"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./action"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./bicep"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./component"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
26
12
|
tslib_1.__exportStar(require("neverthrow"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("@microsoft/teams-manifest"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./cli"), exports);
|
|
27
15
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AACb,+CAAqB;AACrB,kDAAwB;AACxB,sDAA4B;AAC5B,oDAA0B;AAC1B,kDAAwB;AACxB,kDAAwB;AACxB,qDAA2B;AAC3B,oEAA0C;AAC1C,gDAAsB"}
|
package/build/qm/index.d.ts
CHANGED
package/build/qm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/qm/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/qm/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC"}
|
package/build/qm/index.js
CHANGED
|
@@ -5,6 +5,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
tslib_1.__exportStar(require("./question"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./ui"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./visitor"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./validation"), exports);
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/build/qm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/qm/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,qDAA2B;AAC3B,+CAAqB;AACrB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/qm/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,qDAA2B;AAC3B,+CAAqB;AACrB,uDAA6B"}
|
package/build/qm/question.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inputs, OptionItem } from "../types";
|
|
2
|
-
import { FuncValidation, StringArrayValidation, StringValidation, ValidationSchema } from "./validation";
|
|
2
|
+
import { ConditionFunc, FuncValidation, StringArrayValidation, StringValidation, ValidationSchema } from "./validation";
|
|
3
3
|
export interface FunctionRouter {
|
|
4
4
|
namespace: string;
|
|
5
5
|
method: string;
|
|
@@ -10,18 +10,18 @@ export interface Func extends FunctionRouter {
|
|
|
10
10
|
/**
|
|
11
11
|
* definition of a function that return some dynamic value
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type LocalFunc<T> = (inputs: Inputs) => T | Promise<T>;
|
|
14
|
+
export type OnSelectionChangeFunc = (currentSelectedIds: Set<string>, previousSelectedIds: Set<string>) => Promise<Set<string>>;
|
|
15
15
|
/**
|
|
16
16
|
* static option is `string` array or `OptionItem` array.
|
|
17
17
|
* If the option is a string array, each element of which will be converted to an `OptionItem` object with `id` and `label` field equal to the string element.
|
|
18
18
|
* For example, option=['id1','id2'] => [{'id':'id1', label:'id1'},{'id':'id2', label:'id2'}].
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type StaticOptions = string[] | OptionItem[];
|
|
21
21
|
/**
|
|
22
22
|
* dynamic option is defined by a function
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type DynamicOptions = LocalFunc<StaticOptions>;
|
|
25
25
|
/**
|
|
26
26
|
* Basic question data
|
|
27
27
|
*/
|
|
@@ -38,6 +38,7 @@ export interface BaseQuestion {
|
|
|
38
38
|
* the answer of the question
|
|
39
39
|
*/
|
|
40
40
|
value?: unknown;
|
|
41
|
+
valueType?: "skip" | "success";
|
|
41
42
|
/**
|
|
42
43
|
* default input value
|
|
43
44
|
*/
|
|
@@ -75,7 +76,7 @@ export interface UserInputQuestion extends BaseQuestion {
|
|
|
75
76
|
/**
|
|
76
77
|
* question type
|
|
77
78
|
*/
|
|
78
|
-
type: "singleSelect" | "multiSelect" | "singleFile" | "multiFile" | "folder" | "text";
|
|
79
|
+
type: "singleSelect" | "multiSelect" | "singleFile" | "multiFile" | "folder" | "text" | "singleFileOrText" | "innerText";
|
|
79
80
|
/**
|
|
80
81
|
* title is required for human input question
|
|
81
82
|
*/
|
|
@@ -102,6 +103,37 @@ export interface UserInputQuestion extends BaseQuestion {
|
|
|
102
103
|
* An optional validation message indicating or explaining the problem with the current input value.
|
|
103
104
|
*/
|
|
104
105
|
validationHelp?: string;
|
|
106
|
+
/**
|
|
107
|
+
* A flag to indicate whether the question is required for CLI non-interactive mode.
|
|
108
|
+
* Default value is false.
|
|
109
|
+
* If not explicitly defined, the framework will try to fillin this field.
|
|
110
|
+
*/
|
|
111
|
+
required?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* alternative names of the question that use to map the input properties into final Input object
|
|
114
|
+
*/
|
|
115
|
+
alternativeNames?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* CLI option/argument name, if not specified, the question name will be used as the CLI option/argument name
|
|
118
|
+
*/
|
|
119
|
+
cliName?: string;
|
|
120
|
+
/**
|
|
121
|
+
* the question is only for CLI option abbrevation
|
|
122
|
+
*/
|
|
123
|
+
cliShortName?: string;
|
|
124
|
+
/**
|
|
125
|
+
* whether the value is a boolean string value, if true, it will support '--option', which is equivalant to '--option true'
|
|
126
|
+
*/
|
|
127
|
+
isBoolean?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* whether the question is mapped to CLI option or argument, default is option
|
|
130
|
+
*/
|
|
131
|
+
cliType?: "option" | "argument";
|
|
132
|
+
cliDescription?: string;
|
|
133
|
+
/**
|
|
134
|
+
* @description the question will converted to a hidden option in CLI
|
|
135
|
+
*/
|
|
136
|
+
cliHidden?: boolean;
|
|
105
137
|
}
|
|
106
138
|
/**
|
|
107
139
|
* Definition of single selection question
|
|
@@ -136,6 +168,14 @@ export interface SingleSelectQuestion extends UserInputQuestion {
|
|
|
136
168
|
* if false: use still need to do the selection manually even there is no other choice.
|
|
137
169
|
*/
|
|
138
170
|
skipSingleOption?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* the command is only for CLI option description
|
|
173
|
+
*/
|
|
174
|
+
cliChoiceListCommand?: string;
|
|
175
|
+
/**
|
|
176
|
+
* whether to skip validation against allowed list in non-interactive mode, default false
|
|
177
|
+
*/
|
|
178
|
+
skipValidation?: boolean;
|
|
139
179
|
}
|
|
140
180
|
/**
|
|
141
181
|
* Definition of multiple selection question
|
|
@@ -181,6 +221,14 @@ export interface MultiSelectQuestion extends UserInputQuestion {
|
|
|
181
221
|
* validation schema for the answer values
|
|
182
222
|
*/
|
|
183
223
|
validation?: StringArrayValidation | FuncValidation<string[]>;
|
|
224
|
+
/**
|
|
225
|
+
* the command is only for CLI option description
|
|
226
|
+
*/
|
|
227
|
+
cliChoiceListCommand?: string;
|
|
228
|
+
/**
|
|
229
|
+
* whether to skip validation against allowed list in non-interactive mode, default false
|
|
230
|
+
*/
|
|
231
|
+
skipValidation?: boolean;
|
|
184
232
|
}
|
|
185
233
|
/**
|
|
186
234
|
* Definition of text input question
|
|
@@ -204,6 +252,33 @@ export interface TextInputQuestion extends UserInputQuestion {
|
|
|
204
252
|
* validation schema, which can be a dynamic function closure
|
|
205
253
|
*/
|
|
206
254
|
validation?: StringValidation | FuncValidation<string>;
|
|
255
|
+
/**
|
|
256
|
+
* validation when user confirms the input.
|
|
257
|
+
*/
|
|
258
|
+
additionalValidationOnAccept?: StringValidation | FuncValidation<string>;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Definition of text input question of a sub-question of SingleFileOrInputQuestion
|
|
262
|
+
*/
|
|
263
|
+
export interface InnerTextInputQuestion extends UserInputQuestion {
|
|
264
|
+
type: "innerText";
|
|
265
|
+
/**
|
|
266
|
+
* If the input value should be hidden. Defaults to false.
|
|
267
|
+
*/
|
|
268
|
+
password?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* input value.
|
|
271
|
+
*/
|
|
272
|
+
value?: string;
|
|
273
|
+
/**
|
|
274
|
+
* default value
|
|
275
|
+
*
|
|
276
|
+
*/
|
|
277
|
+
default?: string | LocalFunc<string | undefined>;
|
|
278
|
+
/**
|
|
279
|
+
* validation schema, which can be a dynamic function closure
|
|
280
|
+
*/
|
|
281
|
+
validation?: StringValidation | FuncValidation<string>;
|
|
207
282
|
}
|
|
208
283
|
/**
|
|
209
284
|
* Definition of single file selection
|
|
@@ -222,6 +297,20 @@ export interface SingleFileQuestion extends UserInputQuestion {
|
|
|
222
297
|
* validation function
|
|
223
298
|
*/
|
|
224
299
|
validation?: FuncValidation<string>;
|
|
300
|
+
/**
|
|
301
|
+
* This will only take effect in VSC.
|
|
302
|
+
* A set of file filters that are used by the dialog. Each entry is a human-readable label,
|
|
303
|
+
* like "TypeScript", and an array of extensions, e.g.
|
|
304
|
+
* ```ts
|
|
305
|
+
* {
|
|
306
|
+
* 'Images': ['png', 'jpg']
|
|
307
|
+
* 'TypeScript': ['ts', 'tsx']
|
|
308
|
+
* }
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
filters?: {
|
|
312
|
+
[name: string]: string[];
|
|
313
|
+
};
|
|
225
314
|
}
|
|
226
315
|
export interface MultiFileQuestion extends UserInputQuestion {
|
|
227
316
|
type: "multiFile";
|
|
@@ -253,16 +342,30 @@ export interface FolderQuestion extends UserInputQuestion {
|
|
|
253
342
|
*/
|
|
254
343
|
validation?: FuncValidation<string>;
|
|
255
344
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
345
|
+
export interface SingleFileOrInputQuestion extends UserInputQuestion {
|
|
346
|
+
type: "singleFileOrText";
|
|
347
|
+
/**
|
|
348
|
+
* An item shown in the list in VSC that user can click to input text.
|
|
349
|
+
*/
|
|
350
|
+
inputOptionItem: OptionItem;
|
|
351
|
+
/**
|
|
352
|
+
* Config for the input box.
|
|
353
|
+
*/
|
|
354
|
+
inputBoxConfig: InnerTextInputQuestion;
|
|
262
355
|
/**
|
|
263
|
-
*
|
|
356
|
+
* This will only take effect in VSC.
|
|
357
|
+
* A set of file filters that are used by the dialog. Each entry is a human-readable label,
|
|
358
|
+
* like "TypeScript", and an array of extensions, e.g.
|
|
359
|
+
* ```ts
|
|
360
|
+
* {
|
|
361
|
+
* 'Images': ['png', 'jpg']
|
|
362
|
+
* 'TypeScript': ['ts', 'tsx']
|
|
363
|
+
* }
|
|
364
|
+
* ```
|
|
264
365
|
*/
|
|
265
|
-
|
|
366
|
+
filters?: {
|
|
367
|
+
[name: string]: string[];
|
|
368
|
+
};
|
|
266
369
|
}
|
|
267
370
|
/**
|
|
268
371
|
* `Group` is a virtual node in the question tree that wraps a group of questions, which share the same activation condition in this group.
|
|
@@ -271,25 +374,30 @@ export interface Group {
|
|
|
271
374
|
type: "group";
|
|
272
375
|
name?: string;
|
|
273
376
|
}
|
|
274
|
-
export
|
|
377
|
+
export type Question = SingleSelectQuestion | MultiSelectQuestion | TextInputQuestion | SingleFileQuestion | MultiFileQuestion | FolderQuestion | SingleFileQuestion | SingleFileOrInputQuestion;
|
|
275
378
|
/**
|
|
276
|
-
*
|
|
379
|
+
* IQTreeNode is the tree node data structure, which have three main properties:
|
|
277
380
|
* - data: data is either a group or question. Questions can be organized into a group, which has the same trigger condition.
|
|
278
381
|
* - condition: trigger condition for this node to be activated;
|
|
279
382
|
* - children: child questions that will be activated according their trigger condition.
|
|
280
383
|
*/
|
|
281
|
-
export
|
|
384
|
+
export interface IQTreeNode {
|
|
282
385
|
data: Question | Group;
|
|
283
|
-
condition?:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
386
|
+
condition?: StringValidation | StringArrayValidation | ConditionFunc;
|
|
387
|
+
children?: IQTreeNode[];
|
|
388
|
+
/**
|
|
389
|
+
* @description the question node will be ignored as CLI option in non-interactive mode
|
|
390
|
+
* "self" - only ignore the question itself
|
|
391
|
+
* "children" - ignore all nodes in sub-tree
|
|
392
|
+
* "all" - ignore self and all nodes in sub-tree
|
|
393
|
+
*/
|
|
394
|
+
cliOptionDisabled?: "self" | "children" | "all";
|
|
289
395
|
/**
|
|
290
|
-
*
|
|
396
|
+
* @description the question node will be ignored as an Inputs property
|
|
397
|
+
* "self" - only ignore the question itself
|
|
398
|
+
* "children" - ignore all nodes in sub-tree
|
|
399
|
+
* "all" - ignore self and all nodes in sub-tree
|
|
291
400
|
*/
|
|
292
|
-
|
|
293
|
-
constructor(data: Question | Group);
|
|
401
|
+
inputsDisabled?: "self" | "children" | "all";
|
|
294
402
|
}
|
|
295
403
|
//# sourceMappingURL=question.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../src/qm/question.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../src/qm/question.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EACL,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAK,SAAQ,cAAc;IAC1C,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE9D,MAAM,MAAM,qBAAqB,GAAG,CAClC,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC/B,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,KAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1B;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAA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AEG;IACH,eAAe,EAAE,UAAU,CAAC;IAE5B;;OAEG;IACH,cAAc,EAAE,sBAAsB,CAAC;IAEvC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,QAAQ,GAChB,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,yBAAyB,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,GAAG,qBAAqB,GAAG,aAAa,CAAC;IACrE,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;IAChD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;CAC9C"}
|
package/build/qm/question.js
CHANGED
|
@@ -2,57 +2,4 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.QTreeNode = void 0;
|
|
6
|
-
/**
|
|
7
|
-
* QTreeNode is the tree node data structure, which have three main properties:
|
|
8
|
-
* - data: data is either a group or question. Questions can be organized into a group, which has the same trigger condition.
|
|
9
|
-
* - condition: trigger condition for this node to be activated;
|
|
10
|
-
* - children: child questions that will be activated according their trigger condition.
|
|
11
|
-
*/
|
|
12
|
-
class QTreeNode {
|
|
13
|
-
constructor(data) {
|
|
14
|
-
this.data = data;
|
|
15
|
-
}
|
|
16
|
-
addChild(node) {
|
|
17
|
-
if (!this.children) {
|
|
18
|
-
this.children = [];
|
|
19
|
-
}
|
|
20
|
-
this.children.push(node);
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
validate() {
|
|
24
|
-
//1. validate the cycle dependency
|
|
25
|
-
//2. validate the name uniqueness
|
|
26
|
-
//3. validate the params of RPC
|
|
27
|
-
// if (this.data.type === NodeType.group && (!this.children || this.children.length === 0)) return false;
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* trim the tree
|
|
32
|
-
*/
|
|
33
|
-
trim() {
|
|
34
|
-
if (this.children) {
|
|
35
|
-
const newChildren = [];
|
|
36
|
-
for (const node of this.children) {
|
|
37
|
-
const trimmed = node.trim();
|
|
38
|
-
if (trimmed)
|
|
39
|
-
newChildren.push(trimmed);
|
|
40
|
-
}
|
|
41
|
-
this.children = newChildren;
|
|
42
|
-
}
|
|
43
|
-
if (this.data.type === "group") {
|
|
44
|
-
if (!this.children || this.children.length === 0)
|
|
45
|
-
return undefined;
|
|
46
|
-
if (this.children.length === 1) {
|
|
47
|
-
const child = this.children[0];
|
|
48
|
-
if (!(this.condition && child.condition)) {
|
|
49
|
-
child.condition || (child.condition = this.condition);
|
|
50
|
-
return child;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.QTreeNode = QTreeNode;
|
|
58
5
|
//# sourceMappingURL=question.js.map
|
package/build/qm/question.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.js","sourceRoot":"","sources":["../../src/qm/question.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC
|
|
1
|
+
{"version":3,"file":"question.js","sourceRoot":"","sources":["../../src/qm/question.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
|