@microsoft/teamsfx 1.0.1-alpha.4edf8c10a.0 → 1.0.1-alpha.dbef2ba70.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/dist/index.esm2017.js +0 -136
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +0 -167
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +0 -136
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +0 -167
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -3
- package/types/teamsfx.d.ts +0 -253
package/types/teamsfx.d.ts
CHANGED
|
@@ -33,8 +33,6 @@ import { WebResponse } from 'botbuilder';
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Define available location for API Key location
|
|
36
|
-
*
|
|
37
|
-
* @beta
|
|
38
36
|
*/
|
|
39
37
|
export declare enum ApiKeyLocation {
|
|
40
38
|
/**
|
|
@@ -49,8 +47,6 @@ export declare enum ApiKeyLocation {
|
|
|
49
47
|
|
|
50
48
|
/**
|
|
51
49
|
* Provider that handles API Key authentication
|
|
52
|
-
*
|
|
53
|
-
* @beta
|
|
54
50
|
*/
|
|
55
51
|
export declare class ApiKeyProvider implements AuthProvider {
|
|
56
52
|
private keyName;
|
|
@@ -64,8 +60,6 @@ export declare class ApiKeyProvider implements AuthProvider {
|
|
|
64
60
|
*
|
|
65
61
|
* @throws {@link ErrorCode|InvalidParameter} - when key name or key value is empty.
|
|
66
62
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
67
|
-
*
|
|
68
|
-
* @beta
|
|
69
63
|
*/
|
|
70
64
|
constructor(keyName: string, keyValue: string, keyLocation: ApiKeyLocation);
|
|
71
65
|
/**
|
|
@@ -78,8 +72,6 @@ export declare class ApiKeyProvider implements AuthProvider {
|
|
|
78
72
|
*
|
|
79
73
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
|
|
80
74
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
81
|
-
*
|
|
82
|
-
* @beta
|
|
83
75
|
*/
|
|
84
76
|
AddAuthenticationInfo(config: AxiosRequestConfig): Promise<AxiosRequestConfig>;
|
|
85
77
|
}
|
|
@@ -95,8 +87,6 @@ export declare class ApiKeyProvider implements AuthProvider {
|
|
|
95
87
|
*
|
|
96
88
|
* @remarks
|
|
97
89
|
* Only works in in server side.
|
|
98
|
-
*
|
|
99
|
-
* @beta
|
|
100
90
|
*/
|
|
101
91
|
export declare class AppCredential implements TokenCredential {
|
|
102
92
|
private readonly msalClient;
|
|
@@ -110,8 +100,6 @@ export declare class AppCredential implements TokenCredential {
|
|
|
110
100
|
*
|
|
111
101
|
* @throws {@link ErrorCode|InvalidConfiguration} when client id, client secret or tenant id is not found in config.
|
|
112
102
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
|
|
113
|
-
*
|
|
114
|
-
* @beta
|
|
115
103
|
*/
|
|
116
104
|
constructor(authConfig: AuthenticationConfiguration);
|
|
117
105
|
/**
|
|
@@ -137,8 +125,6 @@ export declare class AppCredential implements TokenCredential {
|
|
|
137
125
|
*
|
|
138
126
|
* @returns Access token with expected scopes.
|
|
139
127
|
* Throw error if get access token failed.
|
|
140
|
-
*
|
|
141
|
-
* @beta
|
|
142
128
|
*/
|
|
143
129
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
|
|
144
130
|
/**
|
|
@@ -153,7 +139,6 @@ export declare class AppCredential implements TokenCredential {
|
|
|
153
139
|
|
|
154
140
|
/**
|
|
155
141
|
* Authentication related configuration.
|
|
156
|
-
* @beta
|
|
157
142
|
*/
|
|
158
143
|
export declare interface AuthenticationConfiguration {
|
|
159
144
|
/**
|
|
@@ -200,8 +185,6 @@ export declare interface AuthenticationConfiguration {
|
|
|
200
185
|
|
|
201
186
|
/**
|
|
202
187
|
* Defines method that injects authentication info to http requests
|
|
203
|
-
*
|
|
204
|
-
* @beta
|
|
205
188
|
*/
|
|
206
189
|
export declare interface AuthProvider {
|
|
207
190
|
/**
|
|
@@ -209,8 +192,6 @@ export declare interface AuthProvider {
|
|
|
209
192
|
*
|
|
210
193
|
* @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
|
|
211
194
|
* Refer https://axios-http.com/docs/req_config for detailed document.
|
|
212
|
-
*
|
|
213
|
-
* @beta
|
|
214
195
|
*/
|
|
215
196
|
AddAuthenticationInfo: (config: AxiosRequestConfig) => Promise<AxiosRequestConfig>;
|
|
216
197
|
}
|
|
@@ -219,8 +200,6 @@ export { AxiosInstance }
|
|
|
219
200
|
|
|
220
201
|
/**
|
|
221
202
|
* Provider that handles Basic authentication
|
|
222
|
-
*
|
|
223
|
-
* @beta
|
|
224
203
|
*/
|
|
225
204
|
export declare class BasicAuthProvider implements AuthProvider {
|
|
226
205
|
private userName;
|
|
@@ -232,8 +211,6 @@ export declare class BasicAuthProvider implements AuthProvider {
|
|
|
232
211
|
*
|
|
233
212
|
* @throws {@link ErrorCode|InvalidParameter} - when username or password is empty.
|
|
234
213
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
235
|
-
*
|
|
236
|
-
* @beta
|
|
237
214
|
*/
|
|
238
215
|
constructor(userName: string, password: string);
|
|
239
216
|
/**
|
|
@@ -246,23 +223,17 @@ export declare class BasicAuthProvider implements AuthProvider {
|
|
|
246
223
|
*
|
|
247
224
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
|
|
248
225
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
249
|
-
*
|
|
250
|
-
* @beta
|
|
251
226
|
*/
|
|
252
227
|
AddAuthenticationInfo(config: AxiosRequestConfig): Promise<AxiosRequestConfig>;
|
|
253
228
|
}
|
|
254
229
|
|
|
255
230
|
/**
|
|
256
231
|
* Provider that handles Bearer Token authentication
|
|
257
|
-
*
|
|
258
|
-
* @beta
|
|
259
232
|
*/
|
|
260
233
|
export declare class BearerTokenAuthProvider implements AuthProvider {
|
|
261
234
|
private getToken;
|
|
262
235
|
/**
|
|
263
236
|
* @param { () => Promise<string> } getToken - Function that returns the content of bearer token used in http request
|
|
264
|
-
*
|
|
265
|
-
* @beta
|
|
266
237
|
*/
|
|
267
238
|
constructor(getToken: () => Promise<string>);
|
|
268
239
|
/**
|
|
@@ -274,16 +245,12 @@ export declare class BearerTokenAuthProvider implements AuthProvider {
|
|
|
274
245
|
* @returns Updated axios request config.
|
|
275
246
|
*
|
|
276
247
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header already exists in request configuration.
|
|
277
|
-
*
|
|
278
|
-
* @beta
|
|
279
248
|
*/
|
|
280
249
|
AddAuthenticationInfo(config: AxiosRequestConfig): Promise<AxiosRequestConfig>;
|
|
281
250
|
}
|
|
282
251
|
|
|
283
252
|
/**
|
|
284
253
|
* Provider that handles Certificate authentication
|
|
285
|
-
*
|
|
286
|
-
* @beta
|
|
287
254
|
*/
|
|
288
255
|
export declare class CertificateAuthProvider implements AuthProvider {
|
|
289
256
|
private certOption;
|
|
@@ -292,8 +259,6 @@ export declare class CertificateAuthProvider implements AuthProvider {
|
|
|
292
259
|
* @param { SecureContextOptions } certOption - information about the cert used in http requests
|
|
293
260
|
*
|
|
294
261
|
* @throws {@link ErrorCode|InvalidParameter} - when cert option is empty.
|
|
295
|
-
*
|
|
296
|
-
* @beta
|
|
297
262
|
*/
|
|
298
263
|
constructor(certOption: SecureContextOptions);
|
|
299
264
|
/**
|
|
@@ -305,8 +270,6 @@ export declare class CertificateAuthProvider implements AuthProvider {
|
|
|
305
270
|
* @returns Updated axios request config.
|
|
306
271
|
*
|
|
307
272
|
* @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
|
|
308
|
-
*
|
|
309
|
-
* @beta
|
|
310
273
|
*/
|
|
311
274
|
AddAuthenticationInfo(config: AxiosRequestConfig): Promise<AxiosRequestConfig>;
|
|
312
275
|
}
|
|
@@ -316,26 +279,18 @@ export declare class CertificateAuthProvider implements AuthProvider {
|
|
|
316
279
|
*
|
|
317
280
|
* @remarks
|
|
318
281
|
* It's recommended to get channels from {@link TeamsBotInstallation.channels()}.
|
|
319
|
-
*
|
|
320
|
-
* @beta
|
|
321
282
|
*/
|
|
322
283
|
export declare class Channel implements NotificationTarget {
|
|
323
284
|
/**
|
|
324
285
|
* The parent {@link TeamsBotInstallation} where this channel is created from.
|
|
325
|
-
*
|
|
326
|
-
* @beta
|
|
327
286
|
*/
|
|
328
287
|
readonly parent: TeamsBotInstallation;
|
|
329
288
|
/**
|
|
330
289
|
* Detailed channel information.
|
|
331
|
-
*
|
|
332
|
-
* @beta
|
|
333
290
|
*/
|
|
334
291
|
readonly info: ChannelInfo;
|
|
335
292
|
/**
|
|
336
293
|
* Notification target type. For channel it's always "Channel".
|
|
337
|
-
*
|
|
338
|
-
* @beta
|
|
339
294
|
*/
|
|
340
295
|
readonly type: NotificationTargetType;
|
|
341
296
|
/**
|
|
@@ -346,8 +301,6 @@ export declare class Channel implements NotificationTarget {
|
|
|
346
301
|
*
|
|
347
302
|
* @param parent - The parent {@link TeamsBotInstallation} where this channel is created from.
|
|
348
303
|
* @param info - Detailed channel information.
|
|
349
|
-
*
|
|
350
|
-
* @beta
|
|
351
304
|
*/
|
|
352
305
|
constructor(parent: TeamsBotInstallation, info: ChannelInfo);
|
|
353
306
|
/**
|
|
@@ -355,8 +308,6 @@ export declare class Channel implements NotificationTarget {
|
|
|
355
308
|
*
|
|
356
309
|
* @param text - the plain text message.
|
|
357
310
|
* @returns A `Promise` representing the asynchronous operation.
|
|
358
|
-
*
|
|
359
|
-
* @beta
|
|
360
311
|
*/
|
|
361
312
|
sendMessage(text: string): Promise<void>;
|
|
362
313
|
/**
|
|
@@ -364,8 +315,6 @@ export declare class Channel implements NotificationTarget {
|
|
|
364
315
|
*
|
|
365
316
|
* @param card - the adaptive card raw JSON.
|
|
366
317
|
* @returns A `Promise` representing the asynchronous operation.
|
|
367
|
-
*
|
|
368
|
-
* @beta
|
|
369
318
|
*/
|
|
370
319
|
sendAdaptiveCard(card: unknown): Promise<void>;
|
|
371
320
|
/**
|
|
@@ -379,8 +328,6 @@ export declare class Channel implements NotificationTarget {
|
|
|
379
328
|
*
|
|
380
329
|
* @remarks
|
|
381
330
|
* Ensure each command should ONLY be registered with the command once, otherwise it'll cause unexpected behavior if you register the same command more than once.
|
|
382
|
-
*
|
|
383
|
-
* @beta
|
|
384
331
|
*/
|
|
385
332
|
export declare class CommandBot {
|
|
386
333
|
private readonly adapter;
|
|
@@ -390,24 +337,18 @@ export declare class CommandBot {
|
|
|
390
337
|
*
|
|
391
338
|
* @param adapter The bound `BotFrameworkAdapter`.
|
|
392
339
|
* @param options - initialize options
|
|
393
|
-
*
|
|
394
|
-
* @beta
|
|
395
340
|
*/
|
|
396
341
|
constructor(adapter: BotFrameworkAdapter, options?: CommandOptions);
|
|
397
342
|
/**
|
|
398
343
|
* Registers a command into the command bot.
|
|
399
344
|
*
|
|
400
345
|
* @param command The command to registered.
|
|
401
|
-
*
|
|
402
|
-
* @beta
|
|
403
346
|
*/
|
|
404
347
|
registerCommand(command: TeamsFxBotCommandHandler): void;
|
|
405
348
|
/**
|
|
406
349
|
* Registers commands into the command bot.
|
|
407
350
|
*
|
|
408
351
|
* @param commands The command to registered.
|
|
409
|
-
*
|
|
410
|
-
* @beta
|
|
411
352
|
*/
|
|
412
353
|
registerCommands(commands: TeamsFxBotCommandHandler[]): void;
|
|
413
354
|
}
|
|
@@ -428,14 +369,10 @@ export declare interface CommandMessage {
|
|
|
428
369
|
|
|
429
370
|
/**
|
|
430
371
|
* Options to initialize {@link CommandBot}.
|
|
431
|
-
*
|
|
432
|
-
* @beta
|
|
433
372
|
*/
|
|
434
373
|
export declare interface CommandOptions {
|
|
435
374
|
/**
|
|
436
375
|
* The commands to registered with the command bot. Each command should implement the interface {@link TeamsFxBotCommandHandler} so that it can be correctly handled by this command bot.
|
|
437
|
-
*
|
|
438
|
-
* @beta
|
|
439
376
|
*/
|
|
440
377
|
commands?: TeamsFxBotCommandHandler[];
|
|
441
378
|
}
|
|
@@ -490,26 +427,18 @@ export declare interface CommandOptions {
|
|
|
490
427
|
* For command and response, ensure each command should ONLY be registered with the command once, otherwise it'll cause unexpected behavior if you register the same command more than once.
|
|
491
428
|
*
|
|
492
429
|
* For notification, set `notification.storage` in {@link ConversationOptions} to use your own storage implementation.
|
|
493
|
-
*
|
|
494
|
-
* @beta
|
|
495
430
|
*/
|
|
496
431
|
export declare class ConversationBot {
|
|
497
432
|
/**
|
|
498
433
|
* The bot adapter.
|
|
499
|
-
*
|
|
500
|
-
* @beta
|
|
501
434
|
*/
|
|
502
435
|
readonly adapter: BotFrameworkAdapter;
|
|
503
436
|
/**
|
|
504
437
|
* The entrypoint of command and response.
|
|
505
|
-
*
|
|
506
|
-
* @beta
|
|
507
438
|
*/
|
|
508
439
|
readonly command?: CommandBot;
|
|
509
440
|
/**
|
|
510
441
|
* The entrypoint of notification.
|
|
511
|
-
*
|
|
512
|
-
* @beta
|
|
513
442
|
*/
|
|
514
443
|
readonly notification?: NotificationBot;
|
|
515
444
|
/**
|
|
@@ -519,8 +448,6 @@ export declare class ConversationBot {
|
|
|
519
448
|
* It's recommended to create your own adapter and storage for production environment instead of the default one.
|
|
520
449
|
*
|
|
521
450
|
* @param options - initialize options
|
|
522
|
-
*
|
|
523
|
-
* @beta
|
|
524
451
|
*/
|
|
525
452
|
constructor(options: ConversationOptions);
|
|
526
453
|
private createDefaultAdapter;
|
|
@@ -544,16 +471,12 @@ export declare class ConversationBot {
|
|
|
544
471
|
* });
|
|
545
472
|
* });
|
|
546
473
|
* ```
|
|
547
|
-
*
|
|
548
|
-
* @beta
|
|
549
474
|
*/
|
|
550
475
|
requestHandler(req: WebRequest, res: WebResponse, logic?: (context: TurnContext_2) => Promise<any>): Promise<void>;
|
|
551
476
|
}
|
|
552
477
|
|
|
553
478
|
/**
|
|
554
479
|
* Options to initialize {@link ConversationBot}
|
|
555
|
-
*
|
|
556
|
-
* @beta
|
|
557
480
|
*/
|
|
558
481
|
export declare interface ConversationOptions {
|
|
559
482
|
/**
|
|
@@ -563,8 +486,6 @@ export declare interface ConversationOptions {
|
|
|
563
486
|
*
|
|
564
487
|
* @remarks
|
|
565
488
|
* If neither `adapter` nor `adapterConfig` is provided, will use BOT_ID and BOT_PASSWORD from environment variables.
|
|
566
|
-
*
|
|
567
|
-
* @beta
|
|
568
489
|
*/
|
|
569
490
|
adapter?: BotFrameworkAdapter;
|
|
570
491
|
/**
|
|
@@ -572,35 +493,25 @@ export declare interface ConversationOptions {
|
|
|
572
493
|
*
|
|
573
494
|
* @remarks
|
|
574
495
|
* If neither `adapter` nor `adapterConfig` is provided, will use BOT_ID and BOT_PASSWORD from environment variables.
|
|
575
|
-
*
|
|
576
|
-
* @beta
|
|
577
496
|
*/
|
|
578
497
|
adapterConfig?: {
|
|
579
498
|
[key: string]: unknown;
|
|
580
499
|
};
|
|
581
500
|
/**
|
|
582
501
|
* The command part.
|
|
583
|
-
*
|
|
584
|
-
* @beta
|
|
585
502
|
*/
|
|
586
503
|
command?: CommandOptions & {
|
|
587
504
|
/**
|
|
588
505
|
* Whether to enable command or not.
|
|
589
|
-
*
|
|
590
|
-
* @beta
|
|
591
506
|
*/
|
|
592
507
|
enabled?: boolean;
|
|
593
508
|
};
|
|
594
509
|
/**
|
|
595
510
|
* The notification part.
|
|
596
|
-
*
|
|
597
|
-
* @beta
|
|
598
511
|
*/
|
|
599
512
|
notification?: NotificationOptions_2 & {
|
|
600
513
|
/**
|
|
601
514
|
* Whether to enable notification or not.
|
|
602
|
-
*
|
|
603
|
-
* @beta
|
|
604
515
|
*/
|
|
605
516
|
enabled?: boolean;
|
|
606
517
|
};
|
|
@@ -617,8 +528,6 @@ export declare interface ConversationOptions {
|
|
|
617
528
|
* ```typescript
|
|
618
529
|
* const client = createApiClient("https://my-api-endpoint-base-url", new BasicAuthProvider("xxx","xxx"));
|
|
619
530
|
* ```
|
|
620
|
-
*
|
|
621
|
-
* @beta
|
|
622
531
|
*/
|
|
623
532
|
export declare function createApiClient(apiEndpoint: string, authProvider: AuthProvider): AxiosInstance;
|
|
624
533
|
|
|
@@ -670,8 +579,6 @@ export declare function createApiClient(apiEndpoint: string, authProvider: AuthP
|
|
|
670
579
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
671
580
|
*
|
|
672
581
|
* @returns Graph client with specified scopes.
|
|
673
|
-
*
|
|
674
|
-
* @beta
|
|
675
582
|
*/
|
|
676
583
|
export declare function createMicrosoftGraphClient(teamsfx: TeamsFxConfiguration, scopes?: string | string[]): Client;
|
|
677
584
|
|
|
@@ -709,7 +616,6 @@ export declare function createPfxCertOption(pfx: string | Buffer, options?: {
|
|
|
709
616
|
|
|
710
617
|
/**
|
|
711
618
|
* Error code to trace the error types.
|
|
712
|
-
* @beta
|
|
713
619
|
*/
|
|
714
620
|
export declare enum ErrorCode {
|
|
715
621
|
/**
|
|
@@ -772,8 +678,6 @@ export declare enum ErrorCode {
|
|
|
772
678
|
|
|
773
679
|
/**
|
|
774
680
|
* Error class with code and message thrown by the SDK.
|
|
775
|
-
*
|
|
776
|
-
* @beta
|
|
777
681
|
*/
|
|
778
682
|
export declare class ErrorWithCode extends Error {
|
|
779
683
|
/**
|
|
@@ -787,8 +691,6 @@ export declare class ErrorWithCode extends Error {
|
|
|
787
691
|
*
|
|
788
692
|
* @param {string} message - error message.
|
|
789
693
|
* @param {ErrorCode} code - error code.
|
|
790
|
-
*
|
|
791
|
-
* @beta
|
|
792
694
|
*/
|
|
793
695
|
constructor(message?: string, code?: ErrorCode);
|
|
794
696
|
}
|
|
@@ -797,8 +699,6 @@ export declare class ErrorWithCode extends Error {
|
|
|
797
699
|
* Get log level.
|
|
798
700
|
*
|
|
799
701
|
* @returns Log level
|
|
800
|
-
*
|
|
801
|
-
* @beta
|
|
802
702
|
*/
|
|
803
703
|
export declare function getLogLevel(): LogLevel | undefined;
|
|
804
704
|
|
|
@@ -813,15 +713,11 @@ export declare function getLogLevel(): LogLevel | undefined;
|
|
|
813
713
|
* @throws {@link ErrorCode|InvalidConfiguration} when SQL config resource configuration is invalid.
|
|
814
714
|
* @throws {@link ErrorCode|InternalError} when get user MSI token failed or MSI token is invalid.
|
|
815
715
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
816
|
-
*
|
|
817
|
-
* @beta
|
|
818
716
|
*/
|
|
819
717
|
export declare function getTediousConnectionConfig(teamsfx: TeamsFx, databaseName?: string): Promise<ConnectionConfig>;
|
|
820
718
|
|
|
821
719
|
/**
|
|
822
720
|
* Identity type to use in authentication.
|
|
823
|
-
*
|
|
824
|
-
* @beta
|
|
825
721
|
*/
|
|
826
722
|
export declare enum IdentityType {
|
|
827
723
|
/**
|
|
@@ -836,14 +732,11 @@ export declare enum IdentityType {
|
|
|
836
732
|
|
|
837
733
|
/**
|
|
838
734
|
* Log function for customized logging.
|
|
839
|
-
*
|
|
840
|
-
* @beta
|
|
841
735
|
*/
|
|
842
736
|
export declare type LogFunction = (level: LogLevel, message: string) => void;
|
|
843
737
|
|
|
844
738
|
/**
|
|
845
739
|
* Interface for customized logger.
|
|
846
|
-
* @beta
|
|
847
740
|
*/
|
|
848
741
|
export declare interface Logger {
|
|
849
742
|
/**
|
|
@@ -866,8 +759,6 @@ export declare interface Logger {
|
|
|
866
759
|
|
|
867
760
|
/**
|
|
868
761
|
* Log level.
|
|
869
|
-
*
|
|
870
|
-
* @beta
|
|
871
762
|
*/
|
|
872
763
|
export declare enum LogLevel {
|
|
873
764
|
/**
|
|
@@ -893,26 +784,18 @@ export declare enum LogLevel {
|
|
|
893
784
|
*
|
|
894
785
|
* @remarks
|
|
895
786
|
* It's recommended to get members from {@link TeamsBotInstallation.members()}.
|
|
896
|
-
*
|
|
897
|
-
* @beta
|
|
898
787
|
*/
|
|
899
788
|
export declare class Member implements NotificationTarget {
|
|
900
789
|
/**
|
|
901
790
|
* The parent {@link TeamsBotInstallation} where this member is created from.
|
|
902
|
-
*
|
|
903
|
-
* @beta
|
|
904
791
|
*/
|
|
905
792
|
readonly parent: TeamsBotInstallation;
|
|
906
793
|
/**
|
|
907
794
|
* Detailed member account information.
|
|
908
|
-
*
|
|
909
|
-
* @beta
|
|
910
795
|
*/
|
|
911
796
|
readonly account: TeamsChannelAccount;
|
|
912
797
|
/**
|
|
913
798
|
* Notification target type. For member it's always "Person".
|
|
914
|
-
*
|
|
915
|
-
* @beta
|
|
916
799
|
*/
|
|
917
800
|
readonly type: NotificationTargetType;
|
|
918
801
|
/**
|
|
@@ -923,8 +806,6 @@ export declare class Member implements NotificationTarget {
|
|
|
923
806
|
*
|
|
924
807
|
* @param parent - The parent {@link TeamsBotInstallation} where this member is created from.
|
|
925
808
|
* @param account - Detailed member account information.
|
|
926
|
-
*
|
|
927
|
-
* @beta
|
|
928
809
|
*/
|
|
929
810
|
constructor(parent: TeamsBotInstallation, account: TeamsChannelAccount);
|
|
930
811
|
/**
|
|
@@ -932,8 +813,6 @@ export declare class Member implements NotificationTarget {
|
|
|
932
813
|
*
|
|
933
814
|
* @param text - the plain text message.
|
|
934
815
|
* @returns A `Promise` representing the asynchronous operation.
|
|
935
|
-
*
|
|
936
|
-
* @beta
|
|
937
816
|
*/
|
|
938
817
|
sendMessage(text: string): Promise<void>;
|
|
939
818
|
/**
|
|
@@ -941,8 +820,6 @@ export declare class Member implements NotificationTarget {
|
|
|
941
820
|
*
|
|
942
821
|
* @param card - the adaptive card raw JSON.
|
|
943
822
|
* @returns A `Promise` representing the asynchronous operation.
|
|
944
|
-
*
|
|
945
|
-
* @beta
|
|
946
823
|
*/
|
|
947
824
|
sendAdaptiveCard(card: unknown): Promise<void>;
|
|
948
825
|
/**
|
|
@@ -990,8 +867,6 @@ export declare class MessageBuilder {
|
|
|
990
867
|
* description: "sample card description"
|
|
991
868
|
* });
|
|
992
869
|
* ```
|
|
993
|
-
*
|
|
994
|
-
* @beta
|
|
995
870
|
*/
|
|
996
871
|
static attachAdaptiveCard<TData extends object>(cardTemplate: unknown, data: TData): Partial<Activity_2>;
|
|
997
872
|
/**
|
|
@@ -999,8 +874,6 @@ export declare class MessageBuilder {
|
|
|
999
874
|
*
|
|
1000
875
|
* @param card The adaptive card content.
|
|
1001
876
|
* @returns A bot message activity attached with an adaptive card.
|
|
1002
|
-
*
|
|
1003
|
-
* @beta
|
|
1004
877
|
*/
|
|
1005
878
|
static attachAdaptiveCardWithoutData(card: unknown): Partial<Activity_2>;
|
|
1006
879
|
/**
|
|
@@ -1022,8 +895,6 @@ export declare class MessageBuilder {
|
|
|
1022
895
|
* ['action']
|
|
1023
896
|
* );
|
|
1024
897
|
* ```
|
|
1025
|
-
*
|
|
1026
|
-
* @beta
|
|
1027
898
|
*/
|
|
1028
899
|
static attachHeroCard(title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], other?: Partial<HeroCard>): Partial<Activity_2>;
|
|
1029
900
|
/**
|
|
@@ -1037,8 +908,6 @@ export declare class MessageBuilder {
|
|
|
1037
908
|
*
|
|
1038
909
|
* @remarks
|
|
1039
910
|
* For channels that don't natively support sign-in cards, an alternative message is rendered.
|
|
1040
|
-
*
|
|
1041
|
-
* @beta
|
|
1042
911
|
*/
|
|
1043
912
|
static attachSigninCard(title: string, url: string, text?: string): Partial<Activity_2>;
|
|
1044
913
|
/**
|
|
@@ -1046,16 +915,12 @@ export declare class MessageBuilder {
|
|
|
1046
915
|
*
|
|
1047
916
|
* @param card A description of the Office 365 connector card.
|
|
1048
917
|
* @returns A bot message activity attached with an Office 365 connector card.
|
|
1049
|
-
*
|
|
1050
|
-
* @beta
|
|
1051
918
|
*/
|
|
1052
919
|
static attachO365ConnectorCard(card: O365ConnectorCard): Partial<Activity_2>;
|
|
1053
920
|
/**
|
|
1054
921
|
* Build a message activity attached with a receipt card.
|
|
1055
922
|
* @param card A description of the receipt card.
|
|
1056
923
|
* @returns A message activity attached with a receipt card.
|
|
1057
|
-
*
|
|
1058
|
-
* @beta
|
|
1059
924
|
*/
|
|
1060
925
|
static AttachReceiptCard(card: ReceiptCard): Partial<Activity_2>;
|
|
1061
926
|
/**
|
|
@@ -1066,24 +931,18 @@ export declare class MessageBuilder {
|
|
|
1066
931
|
* is converted to an `imBack` button with a title and value set to the value of the string.
|
|
1067
932
|
* @param other Optional. Any additional properties to include on the card.
|
|
1068
933
|
* @returns A message activity attached with a thumbnail card
|
|
1069
|
-
*
|
|
1070
|
-
* @beta
|
|
1071
934
|
*/
|
|
1072
935
|
static attachThumbnailCard(title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], other?: Partial<ThumbnailCard>): Partial<Activity_2>;
|
|
1073
936
|
/**
|
|
1074
937
|
* Add an attachement to a bot activity.
|
|
1075
938
|
* @param attachement The attachment object to attach.
|
|
1076
939
|
* @returns A message activity with an attachment.
|
|
1077
|
-
*
|
|
1078
|
-
* @beta
|
|
1079
940
|
*/
|
|
1080
941
|
static attachContent(attachement: Attachment): Partial<Activity_2>;
|
|
1081
942
|
}
|
|
1082
943
|
|
|
1083
944
|
/**
|
|
1084
945
|
* Microsoft Graph auth provider for Teams Framework
|
|
1085
|
-
*
|
|
1086
|
-
* @beta
|
|
1087
946
|
*/
|
|
1088
947
|
export declare class MsGraphAuthProvider implements AuthenticationProvider {
|
|
1089
948
|
private teamsfx;
|
|
@@ -1097,8 +956,6 @@ export declare class MsGraphAuthProvider implements AuthenticationProvider {
|
|
|
1097
956
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
1098
957
|
*
|
|
1099
958
|
* @returns An instance of MsGraphAuthProvider.
|
|
1100
|
-
*
|
|
1101
|
-
* @beta
|
|
1102
959
|
*/
|
|
1103
960
|
constructor(teamsfx: TeamsFxConfiguration, scopes?: string | string[]);
|
|
1104
961
|
/**
|
|
@@ -1118,8 +975,6 @@ export declare class MsGraphAuthProvider implements AuthenticationProvider {
|
|
|
1118
975
|
|
|
1119
976
|
/**
|
|
1120
977
|
* Provide utilities to send notification to varies targets (e.g., member, group, channel).
|
|
1121
|
-
*
|
|
1122
|
-
* @beta
|
|
1123
978
|
*/
|
|
1124
979
|
export declare class NotificationBot {
|
|
1125
980
|
private readonly conversationReferenceStore;
|
|
@@ -1132,8 +987,6 @@ export declare class NotificationBot {
|
|
|
1132
987
|
*
|
|
1133
988
|
* @param adapter - the bound `BotFrameworkAdapter`
|
|
1134
989
|
* @param options - initialize options
|
|
1135
|
-
*
|
|
1136
|
-
* @beta
|
|
1137
990
|
*/
|
|
1138
991
|
constructor(adapter: BotFrameworkAdapter, options?: NotificationOptions_2);
|
|
1139
992
|
/**
|
|
@@ -1143,16 +996,12 @@ export declare class NotificationBot {
|
|
|
1143
996
|
* The result is retrieving from the persisted storage.
|
|
1144
997
|
*
|
|
1145
998
|
* @returns - an array of {@link TeamsBotInstallation}.
|
|
1146
|
-
*
|
|
1147
|
-
* @beta
|
|
1148
999
|
*/
|
|
1149
1000
|
installations(): Promise<TeamsBotInstallation[]>;
|
|
1150
1001
|
}
|
|
1151
1002
|
|
|
1152
1003
|
/**
|
|
1153
1004
|
* Options to initialize {@link NotificationBot}.
|
|
1154
|
-
*
|
|
1155
|
-
* @beta
|
|
1156
1005
|
*/
|
|
1157
1006
|
declare interface NotificationOptions_2 {
|
|
1158
1007
|
/**
|
|
@@ -1165,8 +1014,6 @@ declare interface NotificationOptions_2 {
|
|
|
1165
1014
|
* - "${process.env.TEMP}/.notification.localstore.json" if `process.env.RUNNING_ON_AZURE` is set to "1"
|
|
1166
1015
|
*
|
|
1167
1016
|
* It's recommended to use your own shared storage for production environment.
|
|
1168
|
-
*
|
|
1169
|
-
* @beta
|
|
1170
1017
|
*/
|
|
1171
1018
|
storage?: NotificationTargetStorage;
|
|
1172
1019
|
}
|
|
@@ -1174,38 +1021,28 @@ export { NotificationOptions_2 as NotificationOptions }
|
|
|
1174
1021
|
|
|
1175
1022
|
/**
|
|
1176
1023
|
* Represent a notification target.
|
|
1177
|
-
*
|
|
1178
|
-
* @beta
|
|
1179
1024
|
*/
|
|
1180
1025
|
export declare interface NotificationTarget {
|
|
1181
1026
|
/**
|
|
1182
1027
|
* The type of target, could be "Channel" or "Group" or "Person".
|
|
1183
|
-
*
|
|
1184
|
-
* @beta
|
|
1185
1028
|
*/
|
|
1186
1029
|
readonly type?: NotificationTargetType;
|
|
1187
1030
|
/**
|
|
1188
1031
|
* Send a plain text message.
|
|
1189
1032
|
*
|
|
1190
1033
|
* @param text - the plain text message.
|
|
1191
|
-
*
|
|
1192
|
-
* @beta
|
|
1193
1034
|
*/
|
|
1194
1035
|
sendMessage(text: string): Promise<void>;
|
|
1195
1036
|
/**
|
|
1196
1037
|
* Send an adaptive card message.
|
|
1197
1038
|
*
|
|
1198
1039
|
* @param card - the adaptive card raw JSON.
|
|
1199
|
-
*
|
|
1200
|
-
* @beta
|
|
1201
1040
|
*/
|
|
1202
1041
|
sendAdaptiveCard(card: unknown): Promise<void>;
|
|
1203
1042
|
}
|
|
1204
1043
|
|
|
1205
1044
|
/**
|
|
1206
1045
|
* Interface for a storage provider that stores and retrieves notification target references.
|
|
1207
|
-
*
|
|
1208
|
-
* @beta
|
|
1209
1046
|
*/
|
|
1210
1047
|
export declare interface NotificationTargetStorage {
|
|
1211
1048
|
/**
|
|
@@ -1214,8 +1051,6 @@ export declare interface NotificationTargetStorage {
|
|
|
1214
1051
|
* @param key - the key of a notification target.
|
|
1215
1052
|
*
|
|
1216
1053
|
* @returns - the notification target. Or undefined if not found.
|
|
1217
|
-
*
|
|
1218
|
-
* @beta
|
|
1219
1054
|
*/
|
|
1220
1055
|
read(key: string): Promise<{
|
|
1221
1056
|
[key: string]: unknown;
|
|
@@ -1224,8 +1059,6 @@ export declare interface NotificationTargetStorage {
|
|
|
1224
1059
|
* List all stored notification targets.
|
|
1225
1060
|
*
|
|
1226
1061
|
* @returns - an array of notification target. Or an empty array if nothing is stored.
|
|
1227
|
-
*
|
|
1228
|
-
* @beta
|
|
1229
1062
|
*/
|
|
1230
1063
|
list(): Promise<{
|
|
1231
1064
|
[key: string]: unknown;
|
|
@@ -1235,8 +1068,6 @@ export declare interface NotificationTargetStorage {
|
|
|
1235
1068
|
*
|
|
1236
1069
|
* @param key - the key of a notification target.
|
|
1237
1070
|
* @param object - the notification target.
|
|
1238
|
-
*
|
|
1239
|
-
* @beta
|
|
1240
1071
|
*/
|
|
1241
1072
|
write(key: string, object: {
|
|
1242
1073
|
[key: string]: unknown;
|
|
@@ -1245,8 +1076,6 @@ export declare interface NotificationTargetStorage {
|
|
|
1245
1076
|
* Delete one notification target by its key.
|
|
1246
1077
|
*
|
|
1247
1078
|
* @param key - the key of a notification target.
|
|
1248
|
-
*
|
|
1249
|
-
* @beta
|
|
1250
1079
|
*/
|
|
1251
1080
|
delete(key: string): Promise<void>;
|
|
1252
1081
|
}
|
|
@@ -1258,8 +1087,6 @@ export declare interface NotificationTargetStorage {
|
|
|
1258
1087
|
* - "Channel" means to a team channel. (By default, notification to a team will be sent to its "General" channel.)
|
|
1259
1088
|
* - "Group" means to a group chat.
|
|
1260
1089
|
* - "Person" means to a personal chat.
|
|
1261
|
-
*
|
|
1262
|
-
* @beta
|
|
1263
1090
|
*/
|
|
1264
1091
|
export declare type NotificationTargetType = "Channel" | "Group" | "Person";
|
|
1265
1092
|
|
|
@@ -1273,8 +1100,6 @@ export declare type NotificationTargetType = "Channel" | "Group" | "Person";
|
|
|
1273
1100
|
*
|
|
1274
1101
|
* @remarks
|
|
1275
1102
|
* Can only be used in server side.
|
|
1276
|
-
*
|
|
1277
|
-
* @beta
|
|
1278
1103
|
*/
|
|
1279
1104
|
export declare class OnBehalfOfUserCredential implements TokenCredential {
|
|
1280
1105
|
private msalClient;
|
|
@@ -1291,8 +1116,6 @@ export declare class OnBehalfOfUserCredential implements TokenCredential {
|
|
|
1291
1116
|
* @throws {@link ErrorCode|InvalidConfiguration} when client id, client secret, certificate content, authority host or tenant id is not found in config.
|
|
1292
1117
|
* @throws {@link ErrorCode|InternalError} when SSO token is not valid.
|
|
1293
1118
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1294
|
-
*
|
|
1295
|
-
* @beta
|
|
1296
1119
|
*/
|
|
1297
1120
|
constructor(ssoToken: string, config: AuthenticationConfiguration);
|
|
1298
1121
|
/**
|
|
@@ -1327,8 +1150,6 @@ export declare class OnBehalfOfUserCredential implements TokenCredential {
|
|
|
1327
1150
|
* @remarks
|
|
1328
1151
|
* If scopes is empty string or array, it returns SSO token.
|
|
1329
1152
|
* If scopes is non-empty, it returns access token for target scope.
|
|
1330
|
-
*
|
|
1331
|
-
* @beta
|
|
1332
1153
|
*/
|
|
1333
1154
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
|
|
1334
1155
|
/**
|
|
@@ -1343,8 +1164,6 @@ export declare class OnBehalfOfUserCredential implements TokenCredential {
|
|
|
1343
1164
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1344
1165
|
*
|
|
1345
1166
|
* @returns Basic user info with user displayName, objectId and preferredUserName.
|
|
1346
|
-
*
|
|
1347
|
-
* @beta
|
|
1348
1167
|
*/
|
|
1349
1168
|
getUserInfo(): UserInfo;
|
|
1350
1169
|
private generateAuthServerError;
|
|
@@ -1356,8 +1175,6 @@ export declare class OnBehalfOfUserCredential implements TokenCredential {
|
|
|
1356
1175
|
* @param target - the notification target.
|
|
1357
1176
|
* @param card - the adaptive card raw JSON.
|
|
1358
1177
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1359
|
-
*
|
|
1360
|
-
* @beta
|
|
1361
1178
|
*/
|
|
1362
1179
|
export declare function sendAdaptiveCard(target: NotificationTarget, card: unknown): Promise<void>;
|
|
1363
1180
|
|
|
@@ -1367,8 +1184,6 @@ export declare function sendAdaptiveCard(target: NotificationTarget, card: unkno
|
|
|
1367
1184
|
* @param target - the notification target.
|
|
1368
1185
|
* @param text - the plain text message.
|
|
1369
1186
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1370
|
-
*
|
|
1371
|
-
* @beta
|
|
1372
1187
|
*/
|
|
1373
1188
|
export declare function sendMessage(target: NotificationTarget, text: string): Promise<void>;
|
|
1374
1189
|
|
|
@@ -1385,8 +1200,6 @@ export declare function sendMessage(target: NotificationTarget, text: string): P
|
|
|
1385
1200
|
* }
|
|
1386
1201
|
* });
|
|
1387
1202
|
* ```
|
|
1388
|
-
*
|
|
1389
|
-
* @beta
|
|
1390
1203
|
*/
|
|
1391
1204
|
export declare function setLogFunction(logFunction?: LogFunction): void;
|
|
1392
1205
|
|
|
@@ -1404,8 +1217,6 @@ export declare function setLogFunction(logFunction?: LogFunction): void;
|
|
|
1404
1217
|
* error: console.error,
|
|
1405
1218
|
* });
|
|
1406
1219
|
* ```
|
|
1407
|
-
*
|
|
1408
|
-
* @beta
|
|
1409
1220
|
*/
|
|
1410
1221
|
export declare function setLogger(logger?: Logger): void;
|
|
1411
1222
|
|
|
@@ -1413,8 +1224,6 @@ export declare function setLogger(logger?: Logger): void;
|
|
|
1413
1224
|
* Update log level helper.
|
|
1414
1225
|
*
|
|
1415
1226
|
* @param { LogLevel } level - log level in configuration
|
|
1416
|
-
*
|
|
1417
|
-
* @beta
|
|
1418
1227
|
*/
|
|
1419
1228
|
export declare function setLogLevel(level: LogLevel): void;
|
|
1420
1229
|
|
|
@@ -1426,20 +1235,14 @@ export declare function setLogLevel(level: LogLevel): void;
|
|
|
1426
1235
|
*
|
|
1427
1236
|
* @remarks
|
|
1428
1237
|
* It's recommended to get bot installations from {@link ConversationBot.installations()}.
|
|
1429
|
-
*
|
|
1430
|
-
* @beta
|
|
1431
1238
|
*/
|
|
1432
1239
|
export declare class TeamsBotInstallation implements NotificationTarget {
|
|
1433
1240
|
/**
|
|
1434
1241
|
* The bound `BotFrameworkAdapter`.
|
|
1435
|
-
*
|
|
1436
|
-
* @beta
|
|
1437
1242
|
*/
|
|
1438
1243
|
readonly adapter: BotFrameworkAdapter;
|
|
1439
1244
|
/**
|
|
1440
1245
|
* The bound `ConversationReference`.
|
|
1441
|
-
*
|
|
1442
|
-
* @beta
|
|
1443
1246
|
*/
|
|
1444
1247
|
readonly conversationReference: Partial<ConversationReference>;
|
|
1445
1248
|
/**
|
|
@@ -1449,8 +1252,6 @@ export declare class TeamsBotInstallation implements NotificationTarget {
|
|
|
1449
1252
|
* - "Channel" means bot is installed into a team and notification will be sent to its "General" channel.
|
|
1450
1253
|
* - "Group" means bot is installed into a group chat.
|
|
1451
1254
|
* - "Person" means bot is installed into a personal scope and notification will be sent to personal chat.
|
|
1452
|
-
*
|
|
1453
|
-
* @beta
|
|
1454
1255
|
*/
|
|
1455
1256
|
readonly type?: NotificationTargetType;
|
|
1456
1257
|
/**
|
|
@@ -1461,8 +1262,6 @@ export declare class TeamsBotInstallation implements NotificationTarget {
|
|
|
1461
1262
|
*
|
|
1462
1263
|
* @param adapter - the bound `BotFrameworkAdapter`.
|
|
1463
1264
|
* @param conversationReference - the bound `ConversationReference`.
|
|
1464
|
-
*
|
|
1465
|
-
* @beta
|
|
1466
1265
|
*/
|
|
1467
1266
|
constructor(adapter: BotFrameworkAdapter, conversationReference: Partial<ConversationReference>);
|
|
1468
1267
|
/**
|
|
@@ -1470,8 +1269,6 @@ export declare class TeamsBotInstallation implements NotificationTarget {
|
|
|
1470
1269
|
*
|
|
1471
1270
|
* @param text - the plain text message.
|
|
1472
1271
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1473
|
-
*
|
|
1474
|
-
* @beta
|
|
1475
1272
|
*/
|
|
1476
1273
|
sendMessage(text: string): Promise<void>;
|
|
1477
1274
|
/**
|
|
@@ -1479,24 +1276,18 @@ export declare class TeamsBotInstallation implements NotificationTarget {
|
|
|
1479
1276
|
*
|
|
1480
1277
|
* @param card - the adaptive card raw JSON.
|
|
1481
1278
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1482
|
-
*
|
|
1483
|
-
* @beta
|
|
1484
1279
|
*/
|
|
1485
1280
|
sendAdaptiveCard(card: unknown): Promise<void>;
|
|
1486
1281
|
/**
|
|
1487
1282
|
* Get channels from this bot installation.
|
|
1488
1283
|
*
|
|
1489
1284
|
* @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
|
|
1490
|
-
*
|
|
1491
|
-
* @beta
|
|
1492
1285
|
*/
|
|
1493
1286
|
channels(): Promise<Channel[]>;
|
|
1494
1287
|
/**
|
|
1495
1288
|
* Get members from this bot installation.
|
|
1496
1289
|
*
|
|
1497
1290
|
* @returns an array of members from where the bot is installed.
|
|
1498
|
-
*
|
|
1499
|
-
* @beta
|
|
1500
1291
|
*/
|
|
1501
1292
|
members(): Promise<Member[]>;
|
|
1502
1293
|
}
|
|
@@ -1548,8 +1339,6 @@ export declare class TeamsBotInstallation implements NotificationTarget {
|
|
|
1548
1339
|
* }
|
|
1549
1340
|
* ]));
|
|
1550
1341
|
* ```
|
|
1551
|
-
*
|
|
1552
|
-
* @beta
|
|
1553
1342
|
*/
|
|
1554
1343
|
export declare class TeamsBotSsoPrompt extends Dialog {
|
|
1555
1344
|
private teamsfx;
|
|
@@ -1563,8 +1352,6 @@ export declare class TeamsBotSsoPrompt extends Dialog {
|
|
|
1563
1352
|
*
|
|
1564
1353
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
1565
1354
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1566
|
-
*
|
|
1567
|
-
* @beta
|
|
1568
1355
|
*/
|
|
1569
1356
|
constructor(teamsfx: TeamsFx, dialogId: string, settings: TeamsBotSsoPromptSettings);
|
|
1570
1357
|
/**
|
|
@@ -1580,8 +1367,6 @@ export declare class TeamsBotSsoPrompt extends Dialog {
|
|
|
1580
1367
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1581
1368
|
*
|
|
1582
1369
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1583
|
-
*
|
|
1584
|
-
* @beta
|
|
1585
1370
|
*/
|
|
1586
1371
|
beginDialog(dc: DialogContext): Promise<DialogTurnResult>;
|
|
1587
1372
|
/**
|
|
@@ -1599,8 +1384,6 @@ export declare class TeamsBotSsoPrompt extends Dialog {
|
|
|
1599
1384
|
*
|
|
1600
1385
|
* @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
|
|
1601
1386
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1602
|
-
*
|
|
1603
|
-
* @beta
|
|
1604
1387
|
*/
|
|
1605
1388
|
continueDialog(dc: DialogContext): Promise<DialogTurnResult>;
|
|
1606
1389
|
private loadAndValidateConfig;
|
|
@@ -1650,8 +1433,6 @@ export declare class TeamsBotSsoPrompt extends Dialog {
|
|
|
1650
1433
|
|
|
1651
1434
|
/**
|
|
1652
1435
|
* Settings used to configure an TeamsBotSsoPrompt instance.
|
|
1653
|
-
*
|
|
1654
|
-
* @beta
|
|
1655
1436
|
*/
|
|
1656
1437
|
export declare interface TeamsBotSsoPromptSettings {
|
|
1657
1438
|
/**
|
|
@@ -1674,8 +1455,6 @@ export declare interface TeamsBotSsoPromptSettings {
|
|
|
1674
1455
|
|
|
1675
1456
|
/**
|
|
1676
1457
|
* Token response provided by Teams Bot SSO prompt
|
|
1677
|
-
*
|
|
1678
|
-
* @beta
|
|
1679
1458
|
*/
|
|
1680
1459
|
export declare interface TeamsBotSsoPromptTokenResponse extends TokenResponse {
|
|
1681
1460
|
/**
|
|
@@ -1690,7 +1469,6 @@ export declare interface TeamsBotSsoPromptTokenResponse extends TokenResponse {
|
|
|
1690
1469
|
|
|
1691
1470
|
/**
|
|
1692
1471
|
* A class providing credential and configuration.
|
|
1693
|
-
* @beta
|
|
1694
1472
|
*/
|
|
1695
1473
|
export declare class TeamsFx implements TeamsFxConfiguration {
|
|
1696
1474
|
private configuration;
|
|
@@ -1704,15 +1482,12 @@ export declare class TeamsFx implements TeamsFxConfiguration {
|
|
|
1704
1482
|
* @param customConfig - key/value pairs of customized configuration that overrides default ones.
|
|
1705
1483
|
*
|
|
1706
1484
|
* @throws {@link ErrorCode|IdentityTypeNotSupported} when setting app identity in browser.
|
|
1707
|
-
*
|
|
1708
|
-
* @beta
|
|
1709
1485
|
*/
|
|
1710
1486
|
constructor(identityType?: IdentityType, customConfig?: Record<string, string>);
|
|
1711
1487
|
/**
|
|
1712
1488
|
* Identity type set by user.
|
|
1713
1489
|
*
|
|
1714
1490
|
* @returns identity type.
|
|
1715
|
-
* @beta
|
|
1716
1491
|
*/
|
|
1717
1492
|
getIdentityType(): IdentityType;
|
|
1718
1493
|
/**
|
|
@@ -1723,13 +1498,11 @@ export declare class TeamsFx implements TeamsFxConfiguration {
|
|
|
1723
1498
|
* identity is chose, will return {@link AppCredential}.
|
|
1724
1499
|
*
|
|
1725
1500
|
* @returns instance implements TokenCredential interface.
|
|
1726
|
-
* @beta
|
|
1727
1501
|
*/
|
|
1728
1502
|
getCredential(): TokenCredential;
|
|
1729
1503
|
/**
|
|
1730
1504
|
* Get user information.
|
|
1731
1505
|
* @returns UserInfo object.
|
|
1732
|
-
* @beta
|
|
1733
1506
|
*/
|
|
1734
1507
|
getUserInfo(): Promise<UserInfo>;
|
|
1735
1508
|
/**
|
|
@@ -1751,35 +1524,29 @@ export declare class TeamsFx implements TeamsFxConfiguration {
|
|
|
1751
1524
|
* @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
|
|
1752
1525
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
1753
1526
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
|
|
1754
|
-
*
|
|
1755
|
-
* @beta
|
|
1756
1527
|
*/
|
|
1757
1528
|
login(scopes: string | string[]): Promise<void>;
|
|
1758
1529
|
/**
|
|
1759
1530
|
* Set SSO token when using user identity in NodeJS.
|
|
1760
1531
|
* @param {string} ssoToken - used for on behalf of user flow.
|
|
1761
1532
|
* @returns self instance.
|
|
1762
|
-
* @beta
|
|
1763
1533
|
*/
|
|
1764
1534
|
setSsoToken(ssoToken: string): TeamsFx;
|
|
1765
1535
|
/**
|
|
1766
1536
|
* Usually used by service plugins to retrieve specific config
|
|
1767
1537
|
* @param {string} key - configuration key.
|
|
1768
1538
|
* @returns value in configuration.
|
|
1769
|
-
* @beta
|
|
1770
1539
|
*/
|
|
1771
1540
|
getConfig(key: string): string;
|
|
1772
1541
|
/**
|
|
1773
1542
|
* Check the value of specific key.
|
|
1774
1543
|
* @param {string} key - configuration key.
|
|
1775
1544
|
* @returns true if corresponding value is not empty string.
|
|
1776
|
-
* @beta
|
|
1777
1545
|
*/
|
|
1778
1546
|
hasConfig(key: string): boolean;
|
|
1779
1547
|
/**
|
|
1780
1548
|
* Get all configurations.
|
|
1781
1549
|
* @returns key value mappings.
|
|
1782
|
-
* @beta
|
|
1783
1550
|
*/
|
|
1784
1551
|
getConfigs(): Record<string, string>;
|
|
1785
1552
|
/**
|
|
@@ -1790,8 +1557,6 @@ export declare class TeamsFx implements TeamsFxConfiguration {
|
|
|
1790
1557
|
|
|
1791
1558
|
/**
|
|
1792
1559
|
* Interface for a command handler that can process command to a TeamsFx bot and return a response.
|
|
1793
|
-
*
|
|
1794
|
-
* @beta
|
|
1795
1560
|
*/
|
|
1796
1561
|
export declare interface TeamsFxBotCommandHandler {
|
|
1797
1562
|
/**
|
|
@@ -1811,14 +1576,12 @@ export declare interface TeamsFxBotCommandHandler {
|
|
|
1811
1576
|
|
|
1812
1577
|
/**
|
|
1813
1578
|
* TeamsFx interface that provides credential and configuration.
|
|
1814
|
-
* @beta
|
|
1815
1579
|
*/
|
|
1816
1580
|
declare interface TeamsFxConfiguration {
|
|
1817
1581
|
/**
|
|
1818
1582
|
* Identity type set by user.
|
|
1819
1583
|
*
|
|
1820
1584
|
* @returns identity type.
|
|
1821
|
-
* @beta
|
|
1822
1585
|
*/
|
|
1823
1586
|
getIdentityType(): IdentityType;
|
|
1824
1587
|
/**
|
|
@@ -1829,13 +1592,11 @@ declare interface TeamsFxConfiguration {
|
|
|
1829
1592
|
* identity is chose, will return {@link AppCredential}.
|
|
1830
1593
|
*
|
|
1831
1594
|
* @returns instance implements TokenCredential interface.
|
|
1832
|
-
* @beta
|
|
1833
1595
|
*/
|
|
1834
1596
|
getCredential(): TokenCredential;
|
|
1835
1597
|
/**
|
|
1836
1598
|
* Get user information.
|
|
1837
1599
|
* @returns UserInfo object.
|
|
1838
|
-
* @beta
|
|
1839
1600
|
*/
|
|
1840
1601
|
getUserInfo(): Promise<UserInfo>;
|
|
1841
1602
|
/**
|
|
@@ -1857,35 +1618,29 @@ declare interface TeamsFxConfiguration {
|
|
|
1857
1618
|
* @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
|
|
1858
1619
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
1859
1620
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
|
|
1860
|
-
*
|
|
1861
|
-
* @beta
|
|
1862
1621
|
*/
|
|
1863
1622
|
login(scopes: string | string[]): Promise<void>;
|
|
1864
1623
|
/**
|
|
1865
1624
|
* Set SSO token when using user identity in NodeJS.
|
|
1866
1625
|
* @param {string} ssoToken - used for on behalf of user flow.
|
|
1867
1626
|
* @returns self instance.
|
|
1868
|
-
* @beta
|
|
1869
1627
|
*/
|
|
1870
1628
|
setSsoToken(ssoToken: string): TeamsFxConfiguration;
|
|
1871
1629
|
/**
|
|
1872
1630
|
* Usually used by service plugins to retrieve specific config
|
|
1873
1631
|
* @param {string} key - configuration key.
|
|
1874
1632
|
* @returns value in configuration.
|
|
1875
|
-
* @beta
|
|
1876
1633
|
*/
|
|
1877
1634
|
getConfig(key: string): string;
|
|
1878
1635
|
/**
|
|
1879
1636
|
* Check the value of specific key.
|
|
1880
1637
|
* @param {string} key - configuration key.
|
|
1881
1638
|
* @returns true if corresponding value is not empty string.
|
|
1882
|
-
* @beta
|
|
1883
1639
|
*/
|
|
1884
1640
|
hasConfig(key: string): boolean;
|
|
1885
1641
|
/**
|
|
1886
1642
|
* Get all configurations.
|
|
1887
1643
|
* @returns key value mappings.
|
|
1888
|
-
* @beta
|
|
1889
1644
|
*/
|
|
1890
1645
|
getConfigs(): Record<string, string>;
|
|
1891
1646
|
}
|
|
@@ -1895,36 +1650,30 @@ declare interface TeamsFxConfiguration {
|
|
|
1895
1650
|
*
|
|
1896
1651
|
* @remarks
|
|
1897
1652
|
* Can only be used within Teams.
|
|
1898
|
-
*
|
|
1899
|
-
* @beta
|
|
1900
1653
|
*/
|
|
1901
1654
|
export declare class TeamsUserCredential implements TokenCredential {
|
|
1902
1655
|
/**
|
|
1903
1656
|
* Constructor of TeamsUserCredential.
|
|
1904
1657
|
* @remarks
|
|
1905
1658
|
* Can only be used within Teams.
|
|
1906
|
-
* @beta
|
|
1907
1659
|
*/
|
|
1908
1660
|
constructor(authConfig: AuthenticationConfiguration);
|
|
1909
1661
|
/**
|
|
1910
1662
|
* Popup login page to get user's access token with specific scopes.
|
|
1911
1663
|
* @remarks
|
|
1912
1664
|
* Can only be used within Teams.
|
|
1913
|
-
* @beta
|
|
1914
1665
|
*/
|
|
1915
1666
|
login(scopes: string | string[]): Promise<void>;
|
|
1916
1667
|
/**
|
|
1917
1668
|
* Get access token from credential.
|
|
1918
1669
|
* @remarks
|
|
1919
1670
|
* Can only be used within Teams.
|
|
1920
|
-
* @beta
|
|
1921
1671
|
*/
|
|
1922
1672
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
|
|
1923
1673
|
/**
|
|
1924
1674
|
* Get basic user info from SSO token
|
|
1925
1675
|
* @remarks
|
|
1926
1676
|
* Can only be used within Teams.
|
|
1927
|
-
* @beta
|
|
1928
1677
|
*/
|
|
1929
1678
|
getUserInfo(): Promise<UserInfo>;
|
|
1930
1679
|
}
|
|
@@ -1936,8 +1685,6 @@ export declare type TriggerPatterns = string | RegExp | (string | RegExp)[];
|
|
|
1936
1685
|
|
|
1937
1686
|
/**
|
|
1938
1687
|
* UserInfo with user displayName, objectId and preferredUserName.
|
|
1939
|
-
*
|
|
1940
|
-
* @beta
|
|
1941
1688
|
*/
|
|
1942
1689
|
export declare interface UserInfo {
|
|
1943
1690
|
/**
|