@microsoft/teamsfx-api 0.22.4-alpha.d41ef8890.0 → 0.22.4-alpha.db09cdb89.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 ADDED
@@ -0,0 +1,195 @@
1
+ import { Result } from "neverthrow";
2
+ import { FxError } from "./error";
3
+ export declare type OptionValue = string | boolean | string[] | undefined;
4
+ export declare type CLIOptionType = "boolean" | "string" | "array";
5
+ export interface CLICommand {
6
+ /**
7
+ * @description command name, only meaningful to its parent command, like "sample"
8
+ */
9
+ name: string;
10
+ /**
11
+ * @description command full name, like "teamsfx new sample", only available after command finding
12
+ */
13
+ fullName?: string;
14
+ /**
15
+ * @description CLI version, only necessary for the root command
16
+ */
17
+ version?: string;
18
+ /**
19
+ * @description command description
20
+ */
21
+ description: string;
22
+ /**
23
+ * @description command argument, for example, "teamsfx new sample <sample-name>": sample-name is an argument, which is positional
24
+ */
25
+ arguments?: CLICommandArgument[];
26
+ /**
27
+ * @description command options, followed by "--" or "-" char, for example, "teamsfx new sample --option1 value1 --option2 value2"
28
+ */
29
+ options?: CLICommandOption[];
30
+ /**
31
+ * @description whether to sort options in "--help"
32
+ */
33
+ sortOptions?: boolean;
34
+ /**
35
+ * @description sub commands, CLI commands are organized in a tree structure, commands can have sub commands
36
+ */
37
+ commands?: CLICommand[];
38
+ /**
39
+ * @description whether to sort sub commands in "--help"
40
+ */
41
+ sortCommands?: boolean;
42
+ /**
43
+ * @description examples of how to use this command
44
+ */
45
+ examples?: CLIExample[];
46
+ /**
47
+ * @description command handler
48
+ */
49
+ handler?: (ctx: CLIContext) => Promise<Result<undefined, FxError>>;
50
+ /**
51
+ * @description telemetry will be sent when available
52
+ */
53
+ telemetry?: {
54
+ event: string;
55
+ };
56
+ /**
57
+ * @description header message will be printed on the top in "--help"
58
+ */
59
+ header?: string;
60
+ /**
61
+ * @description footer message will be printed on the bottom in "--help"
62
+ */
63
+ footer?: string;
64
+ /**
65
+ * @description whether to hide this command in "--help"
66
+ */
67
+ hidden?: boolean;
68
+ }
69
+ export interface CLIFoundCommand extends CLICommand {
70
+ fullName: string;
71
+ }
72
+ export interface CLIContext {
73
+ /**
74
+ * @description the command matched
75
+ */
76
+ command: CLIFoundCommand;
77
+ /**
78
+ * @description parsed option values
79
+ */
80
+ optionValues: Record<string, OptionValue>;
81
+ /**
82
+ * @description parsed global option values, global options are options defined by the root command in the command tree.
83
+ */
84
+ globalOptionValues: Record<string, OptionValue>;
85
+ /**
86
+ * @description parsed argument values
87
+ */
88
+ argumentValues: string[];
89
+ /**
90
+ * @description telemetry properties, which cen be accessed in the process of command execution lifecycle
91
+ */
92
+ telemetryProperties: Record<string, string>;
93
+ }
94
+ interface CLICommandOptionBase {
95
+ /**
96
+ * @description option/argument name
97
+ * */
98
+ name: string;
99
+ /**
100
+ * @description when converting option key-value into @Inputs for FxCore,
101
+ * the key will be used as the property name if defined, otherwise the name will be used
102
+ */
103
+ questionName?: string;
104
+ /**
105
+ * @description option/argument description
106
+ */
107
+ description: string;
108
+ /**
109
+ * @description option/argument abbreviation
110
+ */
111
+ shortName?: string;
112
+ /**
113
+ * @description option/argument value type: boolean, text, array
114
+ */
115
+ type: CLIOptionType;
116
+ /**
117
+ * @description whether this option/argument is required
118
+ */
119
+ required?: boolean;
120
+ /**
121
+ * @description whether this option/argument is hidden in "--help"
122
+ */
123
+ hidden?: boolean;
124
+ }
125
+ export interface CLIBooleanOption extends CLICommandOptionBase {
126
+ type: "boolean";
127
+ /**
128
+ * @description default value
129
+ */
130
+ default?: boolean;
131
+ /**
132
+ * @description parsed input value
133
+ */
134
+ value?: boolean;
135
+ }
136
+ export interface CLIStringOption extends CLICommandOptionBase {
137
+ type: "string";
138
+ /**
139
+ * @description default value
140
+ */
141
+ default?: string;
142
+ /**
143
+ * @description parsed input value
144
+ */
145
+ value?: string;
146
+ /**
147
+ * allowed values
148
+ */
149
+ choices?: string[];
150
+ /**
151
+ * @description whether to skip validation against allowed values defined in choices
152
+ */
153
+ skipValidation?: boolean;
154
+ /**
155
+ * @description command to get choice list
156
+ */
157
+ choiceListCommand?: string;
158
+ }
159
+ export interface CLIArrayOption extends CLICommandOptionBase {
160
+ type: "array";
161
+ /**
162
+ * @description default value
163
+ */
164
+ default?: string[];
165
+ /**
166
+ * @description parsed input value
167
+ */
168
+ value?: string[];
169
+ /**
170
+ * allowed values
171
+ */
172
+ choices?: string[];
173
+ /**
174
+ * @description whether to skip validation against allowed values defined in choices
175
+ */
176
+ skipValidation?: boolean;
177
+ /**
178
+ * @description command to get choice list
179
+ */
180
+ choiceListCommand?: string;
181
+ }
182
+ export declare type CLICommandOption = CLIBooleanOption | CLIStringOption | CLIArrayOption;
183
+ export declare type CLICommandArgument = CLICommandOption;
184
+ export interface CLIExample {
185
+ /**
186
+ * @description example command
187
+ */
188
+ command: string;
189
+ /**
190
+ * @description description of the sample command
191
+ */
192
+ description: string;
193
+ }
194
+ export {};
195
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;AAClE,oBAAY,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEjC;;OAEG;IACH,OA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+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
@@ -1,13 +1,14 @@
1
1
  export declare const ConfigFolderName = "fx";
2
2
  export declare const AppPackageFolderName = "appPackage";
3
3
  export declare const BuildFolderName = "build";
4
+ export declare const AdaptiveFolderName = "adaptiveCards";
4
5
  export declare const TemplateFolderName = "templates";
5
- export declare const AdaptiveCardsFolderName = "adaptiveCards";
6
6
  export declare const LocalEnvironmentName = "local";
7
7
  export declare const ProductName = "teamsfx";
8
8
  export declare const AutoGeneratedReadme = "README-auto-generated.md";
9
9
  export declare const DefaultReadme = "README.md";
10
10
  export declare const SettingsFolderName = "teamsfx";
11
+ export declare const ManifestTemplateFileName = "manifest.json";
11
12
  /**
12
13
  * questions for VS and CLI_HELP platforms are static question which don't depend on project context
13
14
  * questions for VSCode and CLI platforms are dynamic question which depend on project context
@@ -59,7 +60,8 @@ export declare enum Stage {
59
60
  publishInDeveloperPortal = "publishInDeveloperPortal",
60
61
  validateApplication = "validateApplication",
61
62
  createAppPackage = "createAppPackage",
62
- previewWithManifest = "previewWithManifest"
63
+ previewWithManifest = "previewWithManifest",
64
+ copilotPluginAddAPI = "copilotPluginAddAPI"
63
65
  }
64
66
  export declare enum TelemetryEvent {
65
67
  askQuestion = "askQuestion"
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAC9C,eAAO,MAAM,uBAAuB,k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SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,wBAAwB,6BAA6B;IACrD,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;CAC5C;AAED,oBAAY,cAAc;IACxB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,iBAAiB;IAC3B,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB"}
@@ -2,17 +2,18 @@
2
2
  // Licensed under the MIT license.
3
3
  "use strict";
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.CoreCallbackEvent = exports.TelemetryProperty = exports.TelemetryEvent = exports.Stage = exports.VsCodeEnv = exports.CLIPlatforms = exports.DynamicPlatforms = exports.StaticPlatforms = exports.Platform = exports.SettingsFolderName = exports.DefaultReadme = exports.AutoGeneratedReadme = exports.ProductName = exports.LocalEnvironmentName = exports.AdaptiveCardsFolderName = exports.TemplateFolderName = exports.BuildFolderName = exports.AppPackageFolderName = exports.ConfigFolderName = void 0;
5
+ exports.CoreCallbackEvent = exports.TelemetryProperty = exports.TelemetryEvent = exports.Stage = exports.VsCodeEnv = exports.CLIPlatforms = exports.DynamicPlatforms = exports.StaticPlatforms = exports.Platform = exports.ManifestTemplateFileName = exports.SettingsFolderName = exports.DefaultReadme = exports.AutoGeneratedReadme = exports.ProductName = exports.LocalEnvironmentName = exports.TemplateFolderName = exports.AdaptiveFolderName = exports.BuildFolderName = exports.AppPackageFolderName = exports.ConfigFolderName = void 0;
6
6
  exports.ConfigFolderName = "fx";
7
7
  exports.AppPackageFolderName = "appPackage";
8
8
  exports.BuildFolderName = "build";
9
+ exports.AdaptiveFolderName = "adaptiveCards";
9
10
  exports.TemplateFolderName = "templates";
10
- exports.AdaptiveCardsFolderName = "adaptiveCards";
11
11
  exports.LocalEnvironmentName = "local";
12
12
  exports.ProductName = "teamsfx";
13
13
  exports.AutoGeneratedReadme = "README-auto-generated.md";
14
14
  exports.DefaultReadme = "README.md";
15
15
  exports.SettingsFolderName = "teamsfx";
16
+ exports.ManifestTemplateFileName = "manifest.json";
16
17
  /**
17
18
  * questions for VS and CLI_HELP platforms are static question which don't depend on project context
18
19
  * questions for VSCode and CLI platforms are dynamic question which depend on project context
@@ -68,6 +69,7 @@ var Stage;
68
69
  Stage["validateApplication"] = "validateApplication";
69
70
  Stage["createAppPackage"] = "createAppPackage";
70
71
  Stage["previewWithManifest"] = "previewWithManifest";
72
+ Stage["copilotPluginAddAPI"] = "copilotPluginAddAPI";
71
73
  })(Stage = exports.Stage || (exports.Stage = {}));
72
74
  var TelemetryEvent;
73
75
  (function (TelemetryEvent) {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEA,QAAA,gBAAgB,GAAG,IAAI,CAAC;AACxB,QAAA,oBAAoB,GAAG,YAAY,CAAC;AACpC,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,kBAAkB,GAAG,WAAW,CAAC;AACjC,QAAA,uBAAuB,GAAG,eAAe,CAAC;AAC1C,QAAA,oBAAoB,GAAG,OAAO,CAAC;AAC/B,QAAA,WAAW,GAAG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B,CAAA;IAC3B,gCAAuB,CAAA;IACvB,gCAAuB,CAAA;IACvB,8DAAqD,CAAA;IACrD,oDAA2C,CAAA;IAC3C,8CAAqC,CAAA;IACrC,oDAA2C,CAAA;IAC3C,oDAA2C,CAAA;AAC7C,CAAC,EAlCW,KAAK,GAAL,aAAK,KAAL,aAAK,QAkChB;AAED,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,6CAA2B,CAAA;AAC7B,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,8CAAyB,CAAA;IACzB,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,oCAAe,CAAA;AACjB,CAAC,EANW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAM5B;AAED;;;GAGG;AACH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,sCAAiB,CAAA;AACnB,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B"}
package/build/error.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface FxError extends Error {
12
12
  */
13
13
  timestamp: Date;
14
14
  userData?: any;
15
+ categories?: string[];
15
16
  }
16
17
  export interface ErrorOptionBase {
17
18
  source?: string;
@@ -20,6 +21,7 @@ export interface ErrorOptionBase {
20
21
  error?: Error;
21
22
  userData?: any;
22
23
  displayMessage?: string;
24
+ categories?: string[];
23
25
  }
24
26
  export interface UserErrorOptions extends ErrorOptionBase {
25
27
  helpLink?: string;
@@ -55,6 +57,7 @@ export declare class UserError extends Error implements FxError {
55
57
  * message show in the UI
56
58
  */
57
59
  displayMessage?: string;
60
+ categories?: string[];
58
61
  constructor(opt: UserErrorOptions);
59
62
  constructor(source: string, name: string, message: string, displayMessage?: string);
60
63
  }
@@ -86,6 +89,7 @@ export declare class SystemError extends Error implements FxError {
86
89
  * message show in the UI
87
90
  */
88
91
  displayMessage?: string;
92
+ categories?: string[];
89
93
  constructor(opt: SystemErrorOptions);
90
94
  constructor(source: string, name: string, message: string, displayMessage?: string);
91
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,OAAQ,SAAQ,KAAK;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AACD,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAM,YAAW,OAAO;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,GAAG,EAAE,gBAAgB;gBACrB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,E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kBAAmB,SAAQ,eAAe;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAM,YAAW,OAAO;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;gBAEV,GAAG,EAAE,gBAAgB;gBACrB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CA6CnF;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAM,YAAW,OAAO;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;gBAEV,GAAG,EAAE,kBAAkB;gBACvB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CA6CnF"}
package/build/error.js CHANGED
@@ -8,7 +8,7 @@ exports.SystemError = exports.UserError = void 0;
8
8
  */
9
9
  class UserError extends Error {
10
10
  constructor(param1, param2, param3, param4) {
11
- var _a, _b;
11
+ var _a;
12
12
  let option;
13
13
  if (typeof param1 === "string") {
14
14
  option = {
@@ -25,7 +25,7 @@ class UserError extends Error {
25
25
  const message = option.message || ((_a = option.error) === null || _a === void 0 ? void 0 : _a.message);
26
26
  super(message);
27
27
  //name
28
- this.name = option.name || ((_b = option.error) === null || _b === void 0 ? void 0 : _b.name) || new.target.name;
28
+ this.name = option.name || new.target.name;
29
29
  //source
30
30
  this.source = option.source || "unknown";
31
31
  //stack
@@ -39,6 +39,7 @@ class UserError extends Error {
39
39
  this.userData = option.userData;
40
40
  this.displayMessage = option.displayMessage;
41
41
  this.timestamp = new Date();
42
+ this.categories = option.categories;
42
43
  }
43
44
  }
44
45
  exports.UserError = UserError;
@@ -47,7 +48,7 @@ exports.UserError = UserError;
47
48
  */
48
49
  class SystemError extends Error {
49
50
  constructor(param1, param2, param3, param4) {
50
- var _a, _b;
51
+ var _a;
51
52
  let option;
52
53
  if (typeof param1 === "string") {
53
54
  option = {
@@ -64,7 +65,7 @@ class SystemError extends Error {
64
65
  const message = option.message || ((_a = option.error) === null || _a === void 0 ? void 0 : _a.message);
65
66
  super(message);
66
67
  //name
67
- this.name = option.name || ((_b = option.error) === null || _b === void 0 ? void 0 : _b.name) || new.target.name;
68
+ this.name = option.name || new.target.name;
68
69
  //source
69
70
  this.source = option.source || "unknown";
70
71
  //stack
@@ -78,6 +79,7 @@ class SystemError extends Error {
78
79
  this.userData = option.userData;
79
80
  this.displayMessage = option.displayMessage;
80
81
  this.timestamp = new Date();
82
+ this.categories = option.categories;
81
83
  }
82
84
  }
83
85
  exports.SystemError = SystemError;
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAkClC;;GAEG;AACH,MAAa,SAAU,SAAQ,KAAK;IA4BlC,YACE,MAAiC,EACjC,MAAe,EACf,MAAe,EACf,MAAe;;QAEf,IAAI,MAAwB,CAAC;QAC7B,IAAI,OAAO,MAA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./error";
6
6
  export * from "./types";
7
7
  export * from "neverthrow";
8
8
  export * from "@microsoft/teams-manifest";
9
+ export * from "./cli";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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"}
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
@@ -11,4 +11,5 @@ tslib_1.__exportStar(require("./error"), exports);
11
11
  tslib_1.__exportStar(require("./types"), exports);
12
12
  tslib_1.__exportStar(require("neverthrow"), exports);
13
13
  tslib_1.__exportStar(require("@microsoft/teams-manifest"), exports);
14
+ tslib_1.__exportStar(require("./cli"), exports);
14
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
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"}
@@ -1,6 +1,5 @@
1
1
  import { Inputs, OptionItem } from "../types";
2
- import { InputTextConfig } from "./ui";
3
- import { FuncValidation, StringArrayValidation, StringValidation, ValidationSchema } from "./validation";
2
+ import { ConditionFunc, FuncValidation, StringArrayValidation, StringValidation, ValidationSchema } from "./validation";
4
3
  export interface FunctionRouter {
5
4
  namespace: string;
6
5
  method: string;
@@ -39,6 +38,7 @@ export interface BaseQuestion {
39
38
  * the answer of the question
40
39
  */
41
40
  value?: unknown;
41
+ valueType?: "skip" | "success";
42
42
  /**
43
43
  * default input value
44
44
  */
@@ -103,6 +103,37 @@ export interface UserInputQuestion extends BaseQuestion {
103
103
  * An optional validation message indicating or explaining the problem with the current input value.
104
104
  */
105
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;
106
137
  }
107
138
  /**
108
139
  * Definition of single selection question
@@ -137,6 +168,14 @@ export interface SingleSelectQuestion extends UserInputQuestion {
137
168
  * if false: use still need to do the selection manually even there is no other choice.
138
169
  */
139
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;
140
179
  }
141
180
  /**
142
181
  * Definition of multiple selection question
@@ -182,6 +221,14 @@ export interface MultiSelectQuestion extends UserInputQuestion {
182
221
  * validation schema for the answer values
183
222
  */
184
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;
185
232
  }
186
233
  /**
187
234
  * Definition of text input question
@@ -205,6 +252,10 @@ export interface TextInputQuestion extends UserInputQuestion {
205
252
  * validation schema, which can be a dynamic function closure
206
253
  */
207
254
  validation?: StringValidation | FuncValidation<string>;
255
+ /**
256
+ * validation when user confirms the input.
257
+ */
258
+ additionalValidationOnAccept?: StringValidation | FuncValidation<string>;
208
259
  }
209
260
  /**
210
261
  * Definition of single file selection
@@ -223,6 +274,20 @@ export interface SingleFileQuestion extends UserInputQuestion {
223
274
  * validation function
224
275
  */
225
276
  validation?: FuncValidation<string>;
277
+ /**
278
+ * This will only take effect in VSC.
279
+ * A set of file filters that are used by the dialog. Each entry is a human-readable label,
280
+ * like "TypeScript", and an array of extensions, e.g.
281
+ * ```ts
282
+ * {
283
+ * 'Images': ['png', 'jpg']
284
+ * 'TypeScript': ['ts', 'tsx']
285
+ * }
286
+ * ```
287
+ */
288
+ filters?: {
289
+ [name: string]: string[];
290
+ };
226
291
  }
227
292
  export interface MultiFileQuestion extends UserInputQuestion {
228
293
  type: "multiFile";
@@ -254,21 +319,30 @@ export interface FolderQuestion extends UserInputQuestion {
254
319
  */
255
320
  validation?: FuncValidation<string>;
256
321
  }
257
- /**
258
- * `FuncQuestion` will not show any UI, but load some dynamic data in the question flow;
259
- * The dynamic data can be referred by the following question.
260
- */
261
- export interface FuncQuestion extends BaseQuestion {
262
- type: "func";
263
- /**
264
- * A function that will be called to when the question is activated.
265
- */
266
- func: LocalFunc<any>;
267
- }
268
322
  export interface SingleFileOrInputQuestion extends UserInputQuestion {
269
323
  type: "singleFileOrText";
324
+ /**
325
+ * An item shown in the list in VSC that user can click to input text.
326
+ */
270
327
  inputOptionItem: OptionItem;
271
- inputBoxConfig: InputTextConfig;
328
+ /**
329
+ * Config for the input box.
330
+ */
331
+ inputBoxConfig: TextInputQuestion;
332
+ /**
333
+ * This will only take effect in VSC.
334
+ * A set of file filters that are used by the dialog. Each entry is a human-readable label,
335
+ * like "TypeScript", and an array of extensions, e.g.
336
+ * ```ts
337
+ * {
338
+ * 'Images': ['png', 'jpg']
339
+ * 'TypeScript': ['ts', 'tsx']
340
+ * }
341
+ * ```
342
+ */
343
+ filters?: {
344
+ [name: string]: string[];
345
+ };
272
346
  }
273
347
  /**
274
348
  * `Group` is a virtual node in the question tree that wraps a group of questions, which share the same activation condition in this group.
@@ -277,7 +351,7 @@ export interface Group {
277
351
  type: "group";
278
352
  name?: string;
279
353
  }
280
- export declare type Question = SingleSelectQuestion | MultiSelectQuestion | TextInputQuestion | SingleFileQuestion | MultiFileQuestion | FolderQuestion | FuncQuestion | SingleFileQuestion | SingleFileOrInputQuestion;
354
+ export declare type Question = SingleSelectQuestion | MultiSelectQuestion | TextInputQuestion | SingleFileQuestion | MultiFileQuestion | FolderQuestion | SingleFileQuestion | SingleFileOrInputQuestion;
281
355
  /**
282
356
  * QTreeNode is the tree node data structure, which have three main properties:
283
357
  * - data: data is either a group or question. Questions can be organized into a group, which has the same trigger condition.
@@ -286,10 +360,22 @@ export declare type Question = SingleSelectQuestion | MultiSelectQuestion | Text
286
360
  */
287
361
  export declare class QTreeNode implements IQTreeNode {
288
362
  data: Question | Group;
289
- condition?: ValidationSchema & {
290
- target?: string;
291
- };
363
+ condition?: StringValidation | StringArrayValidation | ConditionFunc;
292
364
  children?: QTreeNode[];
365
+ /**
366
+ * @description the question node will be ignored as CLI option in non-interactive mode
367
+ * "self" - only ignore the question itself
368
+ * "children" - ignore all nodes in sub-tree
369
+ * "all" - ignore self and all nodes in sub-tree
370
+ */
371
+ cliOptionDisabled?: "self" | "children" | "all";
372
+ /**
373
+ * @description the question node will be ignored as an Inputs property
374
+ * "self" - only ignore the question itself
375
+ * "children" - ignore all nodes in sub-tree
376
+ * "all" - ignore self and all nodes in sub-tree
377
+ */
378
+ inputsDisabled?: "self" | "children" | "all";
293
379
  addChild(node: QTreeNode): QTreeNode;
294
380
  validate(): boolean;
295
381
  /**
@@ -300,9 +386,21 @@ export declare class QTreeNode implements IQTreeNode {
300
386
  }
301
387
  export interface IQTreeNode {
302
388
  data: Question | Group;
303
- condition?: ValidationSchema & {
304
- target?: string;
305
- };
389
+ condition?: StringValidation | StringArrayValidation | ConditionFunc;
306
390
  children?: IQTreeNode[];
391
+ /**
392
+ * @description the question node will be ignored as CLI option in non-interactive mode
393
+ * "self" - only ignore the question itself
394
+ * "children" - ignore all nodes in sub-tree
395
+ * "all" - ignore self and all nodes in sub-tree
396
+ */
397
+ cliOptionDisabled?: "self" | "children" | "all";
398
+ /**
399
+ * @description the question node will be ignored as an Inputs property
400
+ * "self" - only ignore the question itself
401
+ * "children" - ignore all nodes in sub-tree
402
+ * "all" - ignore self and all nodes in sub-tree
403
+ */
404
+ inputsDisabled?: "self" | "children" | "all";
307
405
  }
308
406
  //# sourceMappingURL=question.d.ts.map