@microsoft/teamsfx 0.6.3-alpha.ffd3f8bc7.0 → 0.7.0-beta.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.
@@ -31,6 +31,59 @@ import { TurnContext as TurnContext_2 } from 'botbuilder';
31
31
  import { WebRequest } from 'botbuilder';
32
32
  import { WebResponse } from 'botbuilder';
33
33
 
34
+ /**
35
+ * Define available location for API Key location
36
+ *
37
+ * @beta
38
+ */
39
+ export declare enum ApiKeyLocation {
40
+ /**
41
+ * The API Key is placed in request header
42
+ */
43
+ Header = 0,
44
+ /**
45
+ * The API Key is placed in query parameter
46
+ */
47
+ QueryParams = 1
48
+ }
49
+
50
+ /**
51
+ * Provider that handles API Key authentication
52
+ *
53
+ * @beta
54
+ */
55
+ export declare class ApiKeyProvider implements AuthProvider {
56
+ private keyName;
57
+ private keyValue;
58
+ private keyLocation;
59
+ /**
60
+ *
61
+ * @param { string } keyName - The name of request header or query parameter that specifies API Key
62
+ * @param { string } keyValue - The value of API Key
63
+ * @param { ApiKeyLocation } keyLocation - The location of API Key: request header or query parameter.
64
+ *
65
+ * @throws {@link ErrorCode|InvalidParameter} - when key name or key value is empty.
66
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
67
+ *
68
+ * @beta
69
+ */
70
+ constructor(keyName: string, keyValue: string, keyLocation: ApiKeyLocation);
71
+ /**
72
+ * Adds authentication info to http requests
73
+ *
74
+ * @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
75
+ * Refer https://axios-http.com/docs/req_config for detailed document.
76
+ *
77
+ * @returns Updated axios request config.
78
+ *
79
+ * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
80
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
81
+ *
82
+ * @beta
83
+ */
84
+ AddAuthenticationInfo(config: AxiosRequestConfig): Promise<AxiosRequestConfig>;
85
+ }
86
+
34
87
  /**
35
88
  * Represent Microsoft 365 tenant identity, and it is usually used when user is not involved like time-triggered automation job.
36
89
  *
@@ -154,7 +207,7 @@ export declare interface AuthProvider {
154
207
  /**
155
208
  * Adds authentication info to http requests
156
209
  *
157
- * @param config - Contains all the request information and can be updated to include extra authentication info.
210
+ * @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
158
211
  * Refer https://axios-http.com/docs/req_config for detailed document.
159
212
  *
160
213
  * @beta
@@ -174,8 +227,11 @@ export declare class BasicAuthProvider implements AuthProvider {
174
227
  private password;
175
228
  /**
176
229
  *
177
- * @param userName - Username used in basic auth
178
- * @param password - Password used in basic auth
230
+ * @param { string } userName - Username used in basic auth
231
+ * @param { string } password - Password used in basic auth
232
+ *
233
+ * @throws {@link ErrorCode|InvalidParameter} - when username or password is empty.
234
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
179
235
  *
180
236
  * @beta
181
237
  */
@@ -183,12 +239,13 @@ export declare class BasicAuthProvider implements AuthProvider {
183
239
  /**
184
240
  * Adds authentication info to http requests
185
241
  *
186
- * @param config - Contains all the request information and can be updated to include extra authentication info.
242
+ * @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
187
243
  * Refer https://axios-http.com/docs/req_config for detailed document.
188
244
  *
189
245
  * @returns Updated axios request config.
190
246
  *
191
247
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
248
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
192
249
  *
193
250
  * @beta
194
251
  */
@@ -203,7 +260,7 @@ export declare class BasicAuthProvider implements AuthProvider {
203
260
  export declare class BearerTokenAuthProvider implements AuthProvider {
204
261
  private getToken;
205
262
  /**
206
- * @param getToken Function that returns the content of bearer token used in http request
263
+ * @param { () => Promise<string> } getToken - Function that returns the content of bearer token used in http request
207
264
  *
208
265
  * @beta
209
266
  */
@@ -211,7 +268,7 @@ export declare class BearerTokenAuthProvider implements AuthProvider {
211
268
  /**
212
269
  * Adds authentication info to http requests
213
270
  *
214
- * @param config - Contains all the request information and can be updated to include extra authentication info.
271
+ * @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
215
272
  * Refer https://axios-http.com/docs/req_config for detailed document.
216
273
  *
217
274
  * @returns Updated axios request config.
@@ -234,6 +291,8 @@ export declare class CertificateAuthProvider implements AuthProvider {
234
291
  *
235
292
  * @param { SecureContextOptions } certOption - information about the cert used in http requests
236
293
  *
294
+ * @throws {@link ErrorCode|InvalidParameter} - when cert option is empty.
295
+ *
237
296
  * @beta
238
297
  */
239
298
  constructor(certOption: SecureContextOptions);
@@ -621,1279 +680,1283 @@ export declare function createMicrosoftGraphClient(teamsfx: TeamsFxConfiguration
621
680
  *
622
681
  * @param { string | Buffer } cert - The cert chain in PEM format
623
682
  * @param { string | Buffer } key - The private key for the cert chain
624
- * @param { string? } passphrase - The passphrase for private key
625
- * @param { string? | Buffer? } ca - Overrides the trusted CA certificates
683
+ * @param { {passphrase?: string; ca?: string | Buffer} } options - Optional settings when create the cert options.
684
+ *
685
+ * @returns Instance of SecureContextOptions
686
+ *
687
+ * @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
688
+ *
689
+ */
690
+ export declare function createPemCertOption(cert: string | Buffer, key: string | Buffer, options?: {
691
+ passphrase?: string;
692
+ ca?: string | Buffer;
693
+ }): SecureContextOptions;
694
+
695
+ /**
696
+ * Helper to create SecureContextOptions from PFX format cert
697
+ *
698
+ * @param { string | Buffer } pfx - The content of .pfx file
699
+ * @param { {passphrase?: string} } options - Optional settings when create the cert options.
700
+ *
701
+ * @returns Instance of SecureContextOptions
702
+ *
703
+ * @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
704
+ *
705
+ */
706
+ export declare function createPfxCertOption(pfx: string | Buffer, options?: {
707
+ passphrase?: string;
708
+ }): SecureContextOptions;
709
+
710
+ /**
711
+ * Error code to trace the error types.
712
+ * @beta
713
+ */
714
+ export declare enum ErrorCode {
715
+ /**
716
+ * Invalid parameter error.
717
+ */
718
+ InvalidParameter = "InvalidParameter",
719
+ /**
720
+ * Invalid configuration error.
721
+ */
722
+ InvalidConfiguration = "InvalidConfiguration",
723
+ /**
724
+ * Invalid certificate error.
725
+ */
726
+ InvalidCertificate = "InvalidCertificate",
727
+ /**
728
+ * Internal error.
729
+ */
730
+ InternalError = "InternalError",
731
+ /**
732
+ * Channel is not supported error.
733
+ */
734
+ ChannelNotSupported = "ChannelNotSupported",
735
+ /**
736
+ * Runtime is not supported error.
737
+ */
738
+ RuntimeNotSupported = "RuntimeNotSupported",
739
+ /**
740
+ * User failed to finish the AAD consent flow failed.
741
+ */
742
+ ConsentFailed = "ConsentFailed",
743
+ /**
744
+ * The user or administrator has not consented to use the application error.
745
+ */
746
+ UiRequiredError = "UiRequiredError",
747
+ /**
748
+ * Token is not within its valid time range error.
749
+ */
750
+ TokenExpiredError = "TokenExpiredError",
751
+ /**
752
+ * Call service (AAD or simple authentication server) failed.
753
+ */
754
+ ServiceError = "ServiceError",
755
+ /**
756
+ * Operation failed.
757
+ */
758
+ FailedOperation = "FailedOperation",
759
+ /**
760
+ * Invalid response error.
761
+ */
762
+ InvalidResponse = "InvalidResponse",
763
+ /**
764
+ * Identity type error.
765
+ */
766
+ IdentityTypeNotSupported = "IdentityTypeNotSupported",
767
+ /**
768
+ * Authentication info already exists error.
769
+ */
770
+ AuthorizationInfoAlreadyExists = "AuthorizationInfoAlreadyExists"
771
+ }
772
+
773
+ /**
774
+ * Error class with code and message thrown by the SDK.
775
+ *
776
+ * @beta
777
+ */
778
+ export declare class ErrorWithCode extends Error {
779
+ /**
780
+ * Error code
626
781
  *
627
- * @returns Instance of SecureContextOptions
782
+ * @readonly
783
+ */
784
+ code: string | undefined;
785
+ /**
786
+ * Constructor of ErrorWithCode.
628
787
  *
629
- * @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
788
+ * @param {string} message - error message.
789
+ * @param {ErrorCode} code - error code.
630
790
  *
791
+ * @beta
631
792
  */
632
- export declare function createPemCertOption(cert: string | Buffer, key: string | Buffer, passphrase?: string, ca?: string | Buffer): SecureContextOptions;
633
-
634
- /**
635
- * Helper to create SecureContextOptions from PFX format cert
636
- *
637
- * @param { string | Buffer } pfx - The content of .pfx file
638
- * @param { string? } passphrase - Optional. The passphrase of .pfx file
639
- *
640
- * @returns Instance of SecureContextOptions
641
- *
642
- * @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
643
- *
644
- */
645
- export declare function createPfxCertOption(pfx: string | Buffer, passphrase?: string): SecureContextOptions;
646
-
647
- /**
648
- * Error code to trace the error types.
649
- * @beta
650
- */
651
- export declare enum ErrorCode {
652
- /**
653
- * Invalid parameter error.
654
- */
655
- InvalidParameter = "InvalidParameter",
656
- /**
657
- * Invalid configuration error.
658
- */
659
- InvalidConfiguration = "InvalidConfiguration",
660
- /**
661
- * Invalid certificate error.
662
- */
663
- InvalidCertificate = "InvalidCertificate",
664
- /**
665
- * Internal error.
666
- */
667
- InternalError = "InternalError",
668
- /**
669
- * Channel is not supported error.
670
- */
671
- ChannelNotSupported = "ChannelNotSupported",
672
- /**
673
- * Runtime is not supported error.
674
- */
675
- RuntimeNotSupported = "RuntimeNotSupported",
676
- /**
677
- * User failed to finish the AAD consent flow failed.
678
- */
679
- ConsentFailed = "ConsentFailed",
680
- /**
681
- * The user or administrator has not consented to use the application error.
682
- */
683
- UiRequiredError = "UiRequiredError",
684
- /**
685
- * Token is not within its valid time range error.
686
- */
687
- TokenExpiredError = "TokenExpiredError",
688
- /**
689
- * Call service (AAD or simple authentication server) failed.
690
- */
691
- ServiceError = "ServiceError",
692
- /**
693
- * Operation failed.
694
- */
695
- FailedOperation = "FailedOperation",
696
- /**
697
- * Invalid response error.
698
- */
699
- InvalidResponse = "InvalidResponse",
700
- /**
701
- * Identity type error.
702
- */
703
- IdentityTypeNotSupported = "IdentityTypeNotSupported",
704
- /**
705
- * Authentication info already exists error.
706
- */
707
- AuthorizationInfoAlreadyExists = "AuthorizationInfoAlreadyExists"
708
- }
709
-
710
- /**
711
- * Error class with code and message thrown by the SDK.
712
- *
713
- * @beta
714
- */
715
- export declare class ErrorWithCode extends Error {
716
- /**
717
- * Error code
718
- *
719
- * @readonly
720
- */
721
- code: string | undefined;
722
- /**
723
- * Constructor of ErrorWithCode.
724
- *
725
- * @param {string} message - error message.
726
- * @param {ErrorCode} code - error code.
727
- *
728
- * @beta
729
- */
730
- constructor(message?: string, code?: ErrorCode);
731
- }
732
-
733
- /**
734
- * Get log level.
735
- *
736
- * @returns Log level
737
- *
738
- * @beta
739
- */
740
- export declare function getLogLevel(): LogLevel | undefined;
741
-
742
- /**
743
- * Generate connection configuration consumed by tedious.
744
- *
745
- * @param {TeamsFx} teamsfx - Used to provide configuration and auth
746
- * @param { string? } databaseName - specify database name to override default one if there are multiple databases.
747
- *
748
- * @returns Connection configuration of tedious for the SQL.
749
- *
750
- * @throws {@link ErrorCode|InvalidConfiguration} when SQL config resource configuration is invalid.
751
- * @throws {@link ErrorCode|InternalError} when get user MSI token failed or MSI token is invalid.
752
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
753
- *
754
- * @beta
755
- */
756
- export declare function getTediousConnectionConfig(teamsfx: TeamsFx, databaseName?: string): Promise<ConnectionConfig>;
757
-
758
- /**
759
- * Identity type to use in authentication.
760
- *
761
- * @beta
762
- */
763
- export declare enum IdentityType {
764
- /**
765
- * Represents the current user of Teams.
766
- */
767
- User = "User",
768
- /**
769
- * Represents the application itself.
770
- */
771
- App = "Application"
772
- }
773
-
774
- /**
775
- * Log function for customized logging.
776
- *
777
- * @beta
778
- */
779
- export declare type LogFunction = (level: LogLevel, message: string) => void;
780
-
781
- /**
782
- * Interface for customized logger.
783
- * @beta
784
- */
785
- export declare interface Logger {
786
- /**
787
- * Writes to error level logging or lower.
788
- */
789
- error(message: string): void;
790
- /**
791
- * Writes to warning level logging or lower.
792
- */
793
- warn(message: string): void;
794
- /**
795
- * Writes to info level logging or lower.
796
- */
797
- info(message: string): void;
798
- /**
799
- * Writes to verbose level logging.
800
- */
801
- verbose(message: string): void;
802
- }
803
-
804
- /**
805
- * Log level.
806
- *
807
- * @beta
808
- */
809
- export declare enum LogLevel {
810
- /**
811
- * Show verbose, information, warning and error message.
812
- */
813
- Verbose = 0,
814
- /**
815
- * Show information, warning and error message.
816
- */
817
- Info = 1,
818
- /**
819
- * Show warning and error message.
820
- */
821
- Warn = 2,
822
- /**
823
- * Show error message.
824
- */
825
- Error = 3
826
- }
793
+ constructor(message?: string, code?: ErrorCode);
794
+ }
827
795
 
828
- /**
829
- * A {@link NotificationTarget} that represents a team member.
830
- *
831
- * @remarks
832
- * It's recommended to get members from {@link TeamsBotInstallation.members()}.
833
- *
834
- * @beta
835
- */
836
- export declare class Member implements NotificationTarget {
837
- /**
838
- * The parent {@link TeamsBotInstallation} where this member is created from.
839
- *
840
- * @beta
841
- */
842
- readonly parent: TeamsBotInstallation;
843
- /**
844
- * Detailed member account information.
845
- *
846
- * @beta
847
- */
848
- readonly account: TeamsChannelAccount;
849
- /**
850
- * Notification target type. For member it's always "Person".
851
- *
852
- * @beta
853
- */
854
- readonly type: NotificationTargetType;
855
- /**
856
- * Constuctor.
857
- *
858
- * @remarks
859
- * It's recommended to get members from {@link TeamsBotInstallation.members()}, instead of using this constructor.
860
- *
861
- * @param parent - The parent {@link TeamsBotInstallation} where this member is created from.
862
- * @param account - Detailed member account information.
863
- *
864
- * @beta
865
- */
866
- constructor(parent: TeamsBotInstallation, account: TeamsChannelAccount);
867
- /**
868
- * Send a plain text message.
869
- *
870
- * @param text - the plain text message.
871
- * @returns A `Promise` representing the asynchronous operation.
872
- *
873
- * @beta
874
- */
875
- sendMessage(text: string): Promise<void>;
876
- /**
877
- * Send an adaptive card message.
878
- *
879
- * @param card - the adaptive card raw JSON.
880
- * @returns A `Promise` representing the asynchronous operation.
881
- *
882
- * @beta
883
- */
884
- sendAdaptiveCard(card: unknown): Promise<void>;
885
- /**
886
- * @internal
887
- */
888
- private newConversation;
889
- }
796
+ /**
797
+ * Get log level.
798
+ *
799
+ * @returns Log level
800
+ *
801
+ * @beta
802
+ */
803
+ export declare function getLogLevel(): LogLevel | undefined;
890
804
 
891
- /**
892
- * Provides utility method to build bot message with cards that supported in Teams.
893
- */
894
- export declare class MessageBuilder {
895
- /**
896
- * Build a bot message activity attached with adaptive card.
897
- *
898
- * @param cardTemplate The adaptive card template.
899
- * @param data card data used to render the template.
900
- * @returns A bot message activity attached with an adaptive card.
901
- *
902
- * @example
903
- * ```javascript
904
- * const cardTemplate = {
905
- * type: "AdaptiveCard",
906
- * body: [
907
- * {
908
- * "type": "TextBlock",
909
- * "text": "${title}",
910
- * "size": "Large"
911
- * },
912
- * {
913
- * "type": "TextBlock",
914
- * "text": "${description}"
915
- * }],
916
- * $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
917
- * version: "1.4"
918
- * };
919
- *
920
- * type CardData = {
921
- * title: string,
922
- * description: string
923
- * };
924
- * const card = MessageBuilder.attachAdaptiveCard<CardData>(
925
- * cardTemplate, {
926
- * title: "sample card title",
927
- * description: "sample card description"
928
- * });
929
- * ```
930
- *
931
- * @beta
932
- */
933
- static attachAdaptiveCard<TData>(cardTemplate: any, data: TData): Partial<Activity_2>;
934
- /**
935
- * Build a bot message activity attached with an adaptive card.
936
- *
937
- * @param card The adaptive card content.
938
- * @returns A bot message activity attached with an adaptive card.
939
- *
940
- * @beta
941
- */
942
- static attachAdaptiveCardWithoutData(card: any): Partial<Activity_2>;
943
- /**
944
- * Build a bot message activity attached with an hero card.
945
- *
946
- * @param title The card title.
947
- * @param images Optional. The array of images to include on the card.
948
- * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array
949
- * is converted to an `imBack` button with a title and value set to the value of the string.
950
- * @param other Optional. Any additional properties to include on the card.
951
- *
952
- * @returns A bot message activity attached with a hero card.
953
- *
954
- * @example
955
- * ```javascript
956
- * const message = MessageBuilder.attachHeroCard(
957
- * 'sample title',
958
- * ['https://example.com/sample.jpg'],
959
- * ['action']
960
- * );
961
- * ```
962
- *
963
- * @beta
964
- */
965
- static attachHeroCard(title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], other?: Partial<HeroCard>): Partial<Activity_2>;
966
- /**
967
- * Returns an attachment for a sign-in card.
968
- *
969
- * @param title The title for the card's sign-in button.
970
- * @param url The URL of the sign-in page to use.
971
- * @param text Optional. Additional text to include on the card.
972
- *
973
- * @returns A bot message activity attached with a sign-in card.
974
- *
975
- * @remarks
976
- * For channels that don't natively support sign-in cards, an alternative message is rendered.
977
- *
978
- * @beta
979
- */
980
- static attachSigninCard(title: string, url: string, text?: string): Partial<Activity_2>;
981
- /**
982
- * Build a bot message activity attached with an Office 365 connector card.
983
- *
984
- * @param card A description of the Office 365 connector card.
985
- * @returns A bot message activity attached with an Office 365 connector card.
986
- *
987
- * @beta
988
- */
989
- static attachO365ConnectorCard(card: O365ConnectorCard): Partial<Activity_2>;
990
- /**
991
- * Build a message activity attached with a receipt card.
992
- * @param card A description of the receipt card.
993
- * @returns A message activity attached with a receipt card.
994
- *
995
- * @beta
996
- */
997
- static AttachReceiptCard(card: ReceiptCard): Partial<Activity_2>;
998
- /**
999
- *
1000
- * @param title The card title.
1001
- * @param images Optional. The array of images to include on the card.
1002
- * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array
1003
- * is converted to an `imBack` button with a title and value set to the value of the string.
1004
- * @param other Optional. Any additional properties to include on the card.
1005
- * @returns A message activity attached with a thumbnail card
1006
- *
1007
- * @beta
1008
- */
1009
- static attachThumbnailCard(title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], other?: Partial<ThumbnailCard>): Partial<Activity_2>;
1010
- /**
1011
- * Add an attachement to a bot activity.
1012
- * @param attachement The attachment object to attach.
1013
- * @returns A message activity with an attachment.
1014
- *
1015
- * @beta
1016
- */
1017
- static attachContent(attachement: Attachment): Partial<Activity_2>;
1018
- }
805
+ /**
806
+ * Generate connection configuration consumed by tedious.
807
+ *
808
+ * @param {TeamsFx} teamsfx - Used to provide configuration and auth
809
+ * @param { string? } databaseName - specify database name to override default one if there are multiple databases.
810
+ *
811
+ * @returns Connection configuration of tedious for the SQL.
812
+ *
813
+ * @throws {@link ErrorCode|InvalidConfiguration} when SQL config resource configuration is invalid.
814
+ * @throws {@link ErrorCode|InternalError} when get user MSI token failed or MSI token is invalid.
815
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
816
+ *
817
+ * @beta
818
+ */
819
+ export declare function getTediousConnectionConfig(teamsfx: TeamsFx, databaseName?: string): Promise<ConnectionConfig>;
1019
820
 
1020
- /**
1021
- * Microsoft Graph auth provider for Teams Framework
1022
- *
1023
- * @beta
1024
- */
1025
- export declare class MsGraphAuthProvider implements AuthenticationProvider {
1026
- private teamsfx;
1027
- private scopes;
1028
- /**
1029
- * Constructor of MsGraphAuthProvider.
1030
- *
1031
- * @param {TeamsFx} teamsfx - Used to provide configuration and auth.
1032
- * @param {string | string[]} scopes - The list of scopes for which the token will have access.
1033
- *
1034
- * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1035
- *
1036
- * @returns An instance of MsGraphAuthProvider.
1037
- *
1038
- * @beta
1039
- */
1040
- constructor(teamsfx: TeamsFxConfiguration, scopes?: string | string[]);
1041
- /**
1042
- * Get access token for Microsoft Graph API requests.
1043
- *
1044
- * @throws {@link ErrorCode|InternalError} when get access token failed due to empty token or unknown other problems.
1045
- * @throws {@link ErrorCode|TokenExpiredError} when SSO token has already expired.
1046
- * @throws {@link ErrorCode|UiRequiredError} when need user consent to get access token.
1047
- * @throws {@link ErrorCode|ServiceError} when failed to get access token from simple auth or AAD server.
1048
- * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1049
- *
1050
- * @returns Access token from the credential.
1051
- *
1052
- */
1053
- getAccessToken(): Promise<string>;
1054
- }
821
+ /**
822
+ * Identity type to use in authentication.
823
+ *
824
+ * @beta
825
+ */
826
+ export declare enum IdentityType {
827
+ /**
828
+ * Represents the current user of Teams.
829
+ */
830
+ User = "User",
831
+ /**
832
+ * Represents the application itself.
833
+ */
834
+ App = "Application"
835
+ }
1055
836
 
1056
- /**
1057
- * Provide utilities to send notification to varies targets (e.g., member, group, channel).
1058
- *
1059
- * @beta
1060
- */
1061
- export declare class NotificationBot {
1062
- private readonly conversationReferenceStore;
1063
- private readonly adapter;
1064
- /**
1065
- * constructor of the notification bot.
1066
- *
1067
- * @remarks
1068
- * To ensure accuracy, it's recommended to initialize before handling any message.
1069
- *
1070
- * @param adapter - the bound `BotFrameworkAdapter`
1071
- * @param options - initialize options
1072
- *
1073
- * @beta
1074
- */
1075
- constructor(adapter: BotFrameworkAdapter, options?: NotificationOptions_2);
1076
- /**
1077
- * Get all targets where the bot is installed.
1078
- *
1079
- * @remarks
1080
- * The result is retrieving from the persisted storage.
1081
- *
1082
- * @returns - an array of {@link TeamsBotInstallation}.
1083
- *
1084
- * @beta
1085
- */
1086
- installations(): Promise<TeamsBotInstallation[]>;
1087
- }
837
+ /**
838
+ * Log function for customized logging.
839
+ *
840
+ * @beta
841
+ */
842
+ export declare type LogFunction = (level: LogLevel, message: string) => void;
1088
843
 
1089
- /**
1090
- * Options to initialize {@link NotificationBot}.
1091
- *
1092
- * @beta
1093
- */
1094
- declare interface NotificationOptions_2 {
1095
- /**
1096
- * An optional storage to persist bot notification connections.
1097
- *
1098
- * @remarks
1099
- * If `storage` is not provided, a default local file storage will be used,
1100
- * which stores notification connections into:
1101
- * - ".notification.localstore.json" if running locally
1102
- * - "${process.env.TEMP}/.notification.localstore.json" if `process.env.RUNNING_ON_AZURE` is set to "1"
1103
- *
1104
- * It's recommended to use your own shared storage for production environment.
1105
- *
1106
- * @beta
1107
- */
1108
- storage?: NotificationTargetStorage;
1109
- }
1110
- export { NotificationOptions_2 as NotificationOptions }
844
+ /**
845
+ * Interface for customized logger.
846
+ * @beta
847
+ */
848
+ export declare interface Logger {
849
+ /**
850
+ * Writes to error level logging or lower.
851
+ */
852
+ error(message: string): void;
853
+ /**
854
+ * Writes to warning level logging or lower.
855
+ */
856
+ warn(message: string): void;
857
+ /**
858
+ * Writes to info level logging or lower.
859
+ */
860
+ info(message: string): void;
861
+ /**
862
+ * Writes to verbose level logging.
863
+ */
864
+ verbose(message: string): void;
865
+ }
1111
866
 
1112
- /**
1113
- * Represent a notification target.
1114
- *
1115
- * @beta
1116
- */
1117
- export declare interface NotificationTarget {
1118
- /**
1119
- * The type of target, could be "Channel" or "Group" or "Person".
1120
- *
1121
- * @beta
1122
- */
1123
- readonly type?: NotificationTargetType;
1124
- /**
1125
- * Send a plain text message.
1126
- *
1127
- * @param text - the plain text message.
1128
- *
1129
- * @beta
1130
- */
1131
- sendMessage(text: string): Promise<void>;
1132
- /**
1133
- * Send an adaptive card message.
1134
- *
1135
- * @param card - the adaptive card raw JSON.
1136
- *
1137
- * @beta
1138
- */
1139
- sendAdaptiveCard(card: unknown): Promise<void>;
1140
- }
867
+ /**
868
+ * Log level.
869
+ *
870
+ * @beta
871
+ */
872
+ export declare enum LogLevel {
873
+ /**
874
+ * Show verbose, information, warning and error message.
875
+ */
876
+ Verbose = 0,
877
+ /**
878
+ * Show information, warning and error message.
879
+ */
880
+ Info = 1,
881
+ /**
882
+ * Show warning and error message.
883
+ */
884
+ Warn = 2,
885
+ /**
886
+ * Show error message.
887
+ */
888
+ Error = 3
889
+ }
1141
890
 
1142
- /**
1143
- * Interface for a storage provider that stores and retrieves notification target references.
1144
- *
1145
- * @beta
1146
- */
1147
- export declare interface NotificationTargetStorage {
1148
- /**
1149
- * Read one notification target by its key.
1150
- *
1151
- * @param key - the key of a notification target.
1152
- *
1153
- * @returns - the notification target. Or undefined if not found.
1154
- *
1155
- * @beta
1156
- */
1157
- read(key: string): Promise<{
1158
- [key: string]: unknown;
1159
- } | undefined>;
1160
- /**
1161
- * List all stored notification targets.
1162
- *
1163
- * @returns - an array of notification target. Or an empty array if nothing is stored.
1164
- *
1165
- * @beta
1166
- */
1167
- list(): Promise<{
1168
- [key: string]: unknown;
1169
- }[]>;
1170
- /**
1171
- * Write one notification target by its key.
1172
- *
1173
- * @param key - the key of a notification target.
1174
- * @param object - the notification target.
1175
- *
1176
- * @beta
1177
- */
1178
- write(key: string, object: {
1179
- [key: string]: unknown;
1180
- }): Promise<void>;
1181
- /**
1182
- * Delete one notificaton target by its key.
1183
- *
1184
- * @param key - the key of a notification target.
1185
- *
1186
- * @beta
1187
- */
1188
- delete(key: string): Promise<void>;
1189
- }
891
+ /**
892
+ * A {@link NotificationTarget} that represents a team member.
893
+ *
894
+ * @remarks
895
+ * It's recommended to get members from {@link TeamsBotInstallation.members()}.
896
+ *
897
+ * @beta
898
+ */
899
+ export declare class Member implements NotificationTarget {
900
+ /**
901
+ * The parent {@link TeamsBotInstallation} where this member is created from.
902
+ *
903
+ * @beta
904
+ */
905
+ readonly parent: TeamsBotInstallation;
906
+ /**
907
+ * Detailed member account information.
908
+ *
909
+ * @beta
910
+ */
911
+ readonly account: TeamsChannelAccount;
912
+ /**
913
+ * Notification target type. For member it's always "Person".
914
+ *
915
+ * @beta
916
+ */
917
+ readonly type: NotificationTargetType;
918
+ /**
919
+ * Constuctor.
920
+ *
921
+ * @remarks
922
+ * It's recommended to get members from {@link TeamsBotInstallation.members()}, instead of using this constructor.
923
+ *
924
+ * @param parent - The parent {@link TeamsBotInstallation} where this member is created from.
925
+ * @param account - Detailed member account information.
926
+ *
927
+ * @beta
928
+ */
929
+ constructor(parent: TeamsBotInstallation, account: TeamsChannelAccount);
930
+ /**
931
+ * Send a plain text message.
932
+ *
933
+ * @param text - the plain text message.
934
+ * @returns A `Promise` representing the asynchronous operation.
935
+ *
936
+ * @beta
937
+ */
938
+ sendMessage(text: string): Promise<void>;
939
+ /**
940
+ * Send an adaptive card message.
941
+ *
942
+ * @param card - the adaptive card raw JSON.
943
+ * @returns A `Promise` representing the asynchronous operation.
944
+ *
945
+ * @beta
946
+ */
947
+ sendAdaptiveCard(card: unknown): Promise<void>;
948
+ /**
949
+ * @internal
950
+ */
951
+ private newConversation;
952
+ }
1190
953
 
1191
- /**
1192
- * The target type where the notification will be sent to.
1193
- *
1194
- * @remarks
1195
- * - "Channel" means to a team channel. (By default, notification to a team will be sent to its "General" channel.)
1196
- * - "Group" means to a group chat.
1197
- * - "Person" means to a personal chat.
1198
- *
1199
- * @beta
1200
- */
1201
- export declare type NotificationTargetType = "Channel" | "Group" | "Person";
954
+ /**
955
+ * Provides utility method to build bot message with cards that supported in Teams.
956
+ */
957
+ export declare class MessageBuilder {
958
+ /**
959
+ * Build a bot message activity attached with adaptive card.
960
+ *
961
+ * @param cardTemplate The adaptive card template.
962
+ * @param data card data used to render the template.
963
+ * @returns A bot message activity attached with an adaptive card.
964
+ *
965
+ * @example
966
+ * ```javascript
967
+ * const cardTemplate = {
968
+ * type: "AdaptiveCard",
969
+ * body: [
970
+ * {
971
+ * "type": "TextBlock",
972
+ * "text": "${title}",
973
+ * "size": "Large"
974
+ * },
975
+ * {
976
+ * "type": "TextBlock",
977
+ * "text": "${description}"
978
+ * }],
979
+ * $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
980
+ * version: "1.4"
981
+ * };
982
+ *
983
+ * type CardData = {
984
+ * title: string,
985
+ * description: string
986
+ * };
987
+ * const card = MessageBuilder.attachAdaptiveCard<CardData>(
988
+ * cardTemplate, {
989
+ * title: "sample card title",
990
+ * description: "sample card description"
991
+ * });
992
+ * ```
993
+ *
994
+ * @beta
995
+ */
996
+ static attachAdaptiveCard<TData>(cardTemplate: any, data: TData): Partial<Activity_2>;
997
+ /**
998
+ * Build a bot message activity attached with an adaptive card.
999
+ *
1000
+ * @param card The adaptive card content.
1001
+ * @returns A bot message activity attached with an adaptive card.
1002
+ *
1003
+ * @beta
1004
+ */
1005
+ static attachAdaptiveCardWithoutData(card: any): Partial<Activity_2>;
1006
+ /**
1007
+ * Build a bot message activity attached with an hero card.
1008
+ *
1009
+ * @param title The card title.
1010
+ * @param images Optional. The array of images to include on the card.
1011
+ * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array
1012
+ * is converted to an `imBack` button with a title and value set to the value of the string.
1013
+ * @param other Optional. Any additional properties to include on the card.
1014
+ *
1015
+ * @returns A bot message activity attached with a hero card.
1016
+ *
1017
+ * @example
1018
+ * ```javascript
1019
+ * const message = MessageBuilder.attachHeroCard(
1020
+ * 'sample title',
1021
+ * ['https://example.com/sample.jpg'],
1022
+ * ['action']
1023
+ * );
1024
+ * ```
1025
+ *
1026
+ * @beta
1027
+ */
1028
+ static attachHeroCard(title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], other?: Partial<HeroCard>): Partial<Activity_2>;
1029
+ /**
1030
+ * Returns an attachment for a sign-in card.
1031
+ *
1032
+ * @param title The title for the card's sign-in button.
1033
+ * @param url The URL of the sign-in page to use.
1034
+ * @param text Optional. Additional text to include on the card.
1035
+ *
1036
+ * @returns A bot message activity attached with a sign-in card.
1037
+ *
1038
+ * @remarks
1039
+ * For channels that don't natively support sign-in cards, an alternative message is rendered.
1040
+ *
1041
+ * @beta
1042
+ */
1043
+ static attachSigninCard(title: string, url: string, text?: string): Partial<Activity_2>;
1044
+ /**
1045
+ * Build a bot message activity attached with an Office 365 connector card.
1046
+ *
1047
+ * @param card A description of the Office 365 connector card.
1048
+ * @returns A bot message activity attached with an Office 365 connector card.
1049
+ *
1050
+ * @beta
1051
+ */
1052
+ static attachO365ConnectorCard(card: O365ConnectorCard): Partial<Activity_2>;
1053
+ /**
1054
+ * Build a message activity attached with a receipt card.
1055
+ * @param card A description of the receipt card.
1056
+ * @returns A message activity attached with a receipt card.
1057
+ *
1058
+ * @beta
1059
+ */
1060
+ static AttachReceiptCard(card: ReceiptCard): Partial<Activity_2>;
1061
+ /**
1062
+ *
1063
+ * @param title The card title.
1064
+ * @param images Optional. The array of images to include on the card.
1065
+ * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array
1066
+ * is converted to an `imBack` button with a title and value set to the value of the string.
1067
+ * @param other Optional. Any additional properties to include on the card.
1068
+ * @returns A message activity attached with a thumbnail card
1069
+ *
1070
+ * @beta
1071
+ */
1072
+ static attachThumbnailCard(title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], other?: Partial<ThumbnailCard>): Partial<Activity_2>;
1073
+ /**
1074
+ * Add an attachement to a bot activity.
1075
+ * @param attachement The attachment object to attach.
1076
+ * @returns A message activity with an attachment.
1077
+ *
1078
+ * @beta
1079
+ */
1080
+ static attachContent(attachement: Attachment): Partial<Activity_2>;
1081
+ }
1202
1082
 
1203
- /**
1204
- * Represent on-behalf-of flow to get user identity, and it is designed to be used in server side.
1205
- *
1206
- * @example
1207
- * ```typescript
1208
- * const credential = new OnBehalfOfUserCredential(ssoToken);
1209
- * ```
1210
- *
1211
- * @remarks
1212
- * Can only be used in server side.
1213
- *
1214
- * @beta
1215
- */
1216
- export declare class OnBehalfOfUserCredential implements TokenCredential {
1217
- private msalClient;
1218
- private ssoToken;
1219
- /**
1220
- * Constructor of OnBehalfOfUserCredential
1221
- *
1222
- * @remarks
1223
- * Only works in in server side.
1224
- *
1225
- * @param {string} ssoToken - User token provided by Teams SSO feature.
1226
- * @param {AuthenticationConfiguration} config - The authentication configuration. Use environment variables if not provided.
1227
- *
1228
- * @throws {@link ErrorCode|InvalidConfiguration} when client id, client secret, certificate content, authority host or tenant id is not found in config.
1229
- * @throws {@link ErrorCode|InternalError} when SSO token is not valid.
1230
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1231
- *
1232
- * @beta
1233
- */
1234
- constructor(ssoToken: string, config: AuthenticationConfiguration);
1235
- /**
1236
- * Get access token from credential.
1237
- *
1238
- * @example
1239
- * ```typescript
1240
- * await credential.getToken([]) // Get SSO token using empty string array
1241
- * await credential.getToken("") // Get SSO token using empty string
1242
- * await credential.getToken([".default"]) // Get Graph access token with default scope using string array
1243
- * await credential.getToken(".default") // Get Graph access token with default scope using string
1244
- * await credential.getToken(["User.Read"]) // Get Graph access token for single scope using string array
1245
- * await credential.getToken("User.Read") // Get Graph access token for single scope using string
1246
- * await credential.getToken(["User.Read", "Application.Read.All"]) // Get Graph access token for multiple scopes using string array
1247
- * await credential.getToken("User.Read Application.Read.All") // Get Graph access token for multiple scopes using space-separated string
1248
- * await credential.getToken("https://graph.microsoft.com/User.Read") // Get Graph access token with full resource URI
1249
- * await credential.getToken(["https://outlook.office.com/Mail.Read"]) // Get Outlook access token
1250
- * ```
1251
- *
1252
- * @param {string | string[]} scopes - The list of scopes for which the token will have access.
1253
- * @param {GetTokenOptions} options - The options used to configure any requests this TokenCredential implementation might make.
1254
- *
1255
- * @throws {@link ErrorCode|InternalError} when failed to acquire access token on behalf of user with unknown error.
1256
- * @throws {@link ErrorCode|TokenExpiredError} when SSO token has already expired.
1257
- * @throws {@link ErrorCode|UiRequiredError} when need user consent to get access token.
1258
- * @throws {@link ErrorCode|ServiceError} when failed to get access token from simple auth server.
1259
- * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1260
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1261
- *
1262
- * @returns Access token with expected scopes.
1263
- *
1264
- * @remarks
1265
- * If scopes is empty string or array, it returns SSO token.
1266
- * If scopes is non-empty, it returns access token for target scope.
1267
- *
1268
- * @beta
1269
- */
1270
- getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
1271
- /**
1272
- * Get basic user info from SSO token.
1273
- *
1274
- * @example
1275
- * ```typescript
1276
- * const currentUser = getUserInfo();
1277
- * ```
1278
- *
1279
- * @throws {@link ErrorCode|InternalError} when SSO token is not valid.
1280
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1281
- *
1282
- * @returns Basic user info with user displayName, objectId and preferredUserName.
1283
- *
1284
- * @beta
1285
- */
1286
- getUserInfo(): UserInfo;
1287
- private generateAuthServerError;
1288
- }
1083
+ /**
1084
+ * Microsoft Graph auth provider for Teams Framework
1085
+ *
1086
+ * @beta
1087
+ */
1088
+ export declare class MsGraphAuthProvider implements AuthenticationProvider {
1089
+ private teamsfx;
1090
+ private scopes;
1091
+ /**
1092
+ * Constructor of MsGraphAuthProvider.
1093
+ *
1094
+ * @param {TeamsFx} teamsfx - Used to provide configuration and auth.
1095
+ * @param {string | string[]} scopes - The list of scopes for which the token will have access.
1096
+ *
1097
+ * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1098
+ *
1099
+ * @returns An instance of MsGraphAuthProvider.
1100
+ *
1101
+ * @beta
1102
+ */
1103
+ constructor(teamsfx: TeamsFxConfiguration, scopes?: string | string[]);
1104
+ /**
1105
+ * Get access token for Microsoft Graph API requests.
1106
+ *
1107
+ * @throws {@link ErrorCode|InternalError} when get access token failed due to empty token or unknown other problems.
1108
+ * @throws {@link ErrorCode|TokenExpiredError} when SSO token has already expired.
1109
+ * @throws {@link ErrorCode|UiRequiredError} when need user consent to get access token.
1110
+ * @throws {@link ErrorCode|ServiceError} when failed to get access token from simple auth or AAD server.
1111
+ * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1112
+ *
1113
+ * @returns Access token from the credential.
1114
+ *
1115
+ */
1116
+ getAccessToken(): Promise<string>;
1117
+ }
1118
+
1119
+ /**
1120
+ * Provide utilities to send notification to varies targets (e.g., member, group, channel).
1121
+ *
1122
+ * @beta
1123
+ */
1124
+ export declare class NotificationBot {
1125
+ private readonly conversationReferenceStore;
1126
+ private readonly adapter;
1127
+ /**
1128
+ * constructor of the notification bot.
1129
+ *
1130
+ * @remarks
1131
+ * To ensure accuracy, it's recommended to initialize before handling any message.
1132
+ *
1133
+ * @param adapter - the bound `BotFrameworkAdapter`
1134
+ * @param options - initialize options
1135
+ *
1136
+ * @beta
1137
+ */
1138
+ constructor(adapter: BotFrameworkAdapter, options?: NotificationOptions_2);
1139
+ /**
1140
+ * Get all targets where the bot is installed.
1141
+ *
1142
+ * @remarks
1143
+ * The result is retrieving from the persisted storage.
1144
+ *
1145
+ * @returns - an array of {@link TeamsBotInstallation}.
1146
+ *
1147
+ * @beta
1148
+ */
1149
+ installations(): Promise<TeamsBotInstallation[]>;
1150
+ }
1151
+
1152
+ /**
1153
+ * Options to initialize {@link NotificationBot}.
1154
+ *
1155
+ * @beta
1156
+ */
1157
+ declare interface NotificationOptions_2 {
1158
+ /**
1159
+ * An optional storage to persist bot notification connections.
1160
+ *
1161
+ * @remarks
1162
+ * If `storage` is not provided, a default local file storage will be used,
1163
+ * which stores notification connections into:
1164
+ * - ".notification.localstore.json" if running locally
1165
+ * - "${process.env.TEMP}/.notification.localstore.json" if `process.env.RUNNING_ON_AZURE` is set to "1"
1166
+ *
1167
+ * It's recommended to use your own shared storage for production environment.
1168
+ *
1169
+ * @beta
1170
+ */
1171
+ storage?: NotificationTargetStorage;
1172
+ }
1173
+ export { NotificationOptions_2 as NotificationOptions }
1174
+
1175
+ /**
1176
+ * Represent a notification target.
1177
+ *
1178
+ * @beta
1179
+ */
1180
+ export declare interface NotificationTarget {
1181
+ /**
1182
+ * The type of target, could be "Channel" or "Group" or "Person".
1183
+ *
1184
+ * @beta
1185
+ */
1186
+ readonly type?: NotificationTargetType;
1187
+ /**
1188
+ * Send a plain text message.
1189
+ *
1190
+ * @param text - the plain text message.
1191
+ *
1192
+ * @beta
1193
+ */
1194
+ sendMessage(text: string): Promise<void>;
1195
+ /**
1196
+ * Send an adaptive card message.
1197
+ *
1198
+ * @param card - the adaptive card raw JSON.
1199
+ *
1200
+ * @beta
1201
+ */
1202
+ sendAdaptiveCard(card: unknown): Promise<void>;
1203
+ }
1204
+
1205
+ /**
1206
+ * Interface for a storage provider that stores and retrieves notification target references.
1207
+ *
1208
+ * @beta
1209
+ */
1210
+ export declare interface NotificationTargetStorage {
1211
+ /**
1212
+ * Read one notification target by its key.
1213
+ *
1214
+ * @param key - the key of a notification target.
1215
+ *
1216
+ * @returns - the notification target. Or undefined if not found.
1217
+ *
1218
+ * @beta
1219
+ */
1220
+ read(key: string): Promise<{
1221
+ [key: string]: unknown;
1222
+ } | undefined>;
1223
+ /**
1224
+ * List all stored notification targets.
1225
+ *
1226
+ * @returns - an array of notification target. Or an empty array if nothing is stored.
1227
+ *
1228
+ * @beta
1229
+ */
1230
+ list(): Promise<{
1231
+ [key: string]: unknown;
1232
+ }[]>;
1233
+ /**
1234
+ * Write one notification target by its key.
1235
+ *
1236
+ * @param key - the key of a notification target.
1237
+ * @param object - the notification target.
1238
+ *
1239
+ * @beta
1240
+ */
1241
+ write(key: string, object: {
1242
+ [key: string]: unknown;
1243
+ }): Promise<void>;
1244
+ /**
1245
+ * Delete one notificaton target by its key.
1246
+ *
1247
+ * @param key - the key of a notification target.
1248
+ *
1249
+ * @beta
1250
+ */
1251
+ delete(key: string): Promise<void>;
1252
+ }
1253
+
1254
+ /**
1255
+ * The target type where the notification will be sent to.
1256
+ *
1257
+ * @remarks
1258
+ * - "Channel" means to a team channel. (By default, notification to a team will be sent to its "General" channel.)
1259
+ * - "Group" means to a group chat.
1260
+ * - "Person" means to a personal chat.
1261
+ *
1262
+ * @beta
1263
+ */
1264
+ export declare type NotificationTargetType = "Channel" | "Group" | "Person";
1265
+
1266
+ /**
1267
+ * Represent on-behalf-of flow to get user identity, and it is designed to be used in server side.
1268
+ *
1269
+ * @example
1270
+ * ```typescript
1271
+ * const credential = new OnBehalfOfUserCredential(ssoToken);
1272
+ * ```
1273
+ *
1274
+ * @remarks
1275
+ * Can only be used in server side.
1276
+ *
1277
+ * @beta
1278
+ */
1279
+ export declare class OnBehalfOfUserCredential implements TokenCredential {
1280
+ private msalClient;
1281
+ private ssoToken;
1282
+ /**
1283
+ * Constructor of OnBehalfOfUserCredential
1284
+ *
1285
+ * @remarks
1286
+ * Only works in in server side.
1287
+ *
1288
+ * @param {string} ssoToken - User token provided by Teams SSO feature.
1289
+ * @param {AuthenticationConfiguration} config - The authentication configuration. Use environment variables if not provided.
1290
+ *
1291
+ * @throws {@link ErrorCode|InvalidConfiguration} when client id, client secret, certificate content, authority host or tenant id is not found in config.
1292
+ * @throws {@link ErrorCode|InternalError} when SSO token is not valid.
1293
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1294
+ *
1295
+ * @beta
1296
+ */
1297
+ constructor(ssoToken: string, config: AuthenticationConfiguration);
1298
+ /**
1299
+ * Get access token from credential.
1300
+ *
1301
+ * @example
1302
+ * ```typescript
1303
+ * await credential.getToken([]) // Get SSO token using empty string array
1304
+ * await credential.getToken("") // Get SSO token using empty string
1305
+ * await credential.getToken([".default"]) // Get Graph access token with default scope using string array
1306
+ * await credential.getToken(".default") // Get Graph access token with default scope using string
1307
+ * await credential.getToken(["User.Read"]) // Get Graph access token for single scope using string array
1308
+ * await credential.getToken("User.Read") // Get Graph access token for single scope using string
1309
+ * await credential.getToken(["User.Read", "Application.Read.All"]) // Get Graph access token for multiple scopes using string array
1310
+ * await credential.getToken("User.Read Application.Read.All") // Get Graph access token for multiple scopes using space-separated string
1311
+ * await credential.getToken("https://graph.microsoft.com/User.Read") // Get Graph access token with full resource URI
1312
+ * await credential.getToken(["https://outlook.office.com/Mail.Read"]) // Get Outlook access token
1313
+ * ```
1314
+ *
1315
+ * @param {string | string[]} scopes - The list of scopes for which the token will have access.
1316
+ * @param {GetTokenOptions} options - The options used to configure any requests this TokenCredential implementation might make.
1317
+ *
1318
+ * @throws {@link ErrorCode|InternalError} when failed to acquire access token on behalf of user with unknown error.
1319
+ * @throws {@link ErrorCode|TokenExpiredError} when SSO token has already expired.
1320
+ * @throws {@link ErrorCode|UiRequiredError} when need user consent to get access token.
1321
+ * @throws {@link ErrorCode|ServiceError} when failed to get access token from simple auth server.
1322
+ * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1323
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1324
+ *
1325
+ * @returns Access token with expected scopes.
1326
+ *
1327
+ * @remarks
1328
+ * If scopes is empty string or array, it returns SSO token.
1329
+ * If scopes is non-empty, it returns access token for target scope.
1330
+ *
1331
+ * @beta
1332
+ */
1333
+ getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
1334
+ /**
1335
+ * Get basic user info from SSO token.
1336
+ *
1337
+ * @example
1338
+ * ```typescript
1339
+ * const currentUser = getUserInfo();
1340
+ * ```
1341
+ *
1342
+ * @throws {@link ErrorCode|InternalError} when SSO token is not valid.
1343
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1344
+ *
1345
+ * @returns Basic user info with user displayName, objectId and preferredUserName.
1346
+ *
1347
+ * @beta
1348
+ */
1349
+ getUserInfo(): UserInfo;
1350
+ private generateAuthServerError;
1351
+ }
1289
1352
 
1290
- /**
1291
- * Send an adaptive card message to a notification target.
1292
- *
1293
- * @param target - the notification target.
1294
- * @param card - the adaptive card raw JSON.
1295
- * @returns A `Promise` representing the asynchronous operation.
1296
- *
1297
- * @beta
1298
- */
1299
- export declare function sendAdaptiveCard(target: NotificationTarget, card: unknown): Promise<void>;
1353
+ /**
1354
+ * Send an adaptive card message to a notification target.
1355
+ *
1356
+ * @param target - the notification target.
1357
+ * @param card - the adaptive card raw JSON.
1358
+ * @returns A `Promise` representing the asynchronous operation.
1359
+ *
1360
+ * @beta
1361
+ */
1362
+ export declare function sendAdaptiveCard(target: NotificationTarget, card: unknown): Promise<void>;
1300
1363
 
1301
- /**
1302
- * Send a plain text message to a notification target.
1303
- *
1304
- * @param target - the notification target.
1305
- * @param text - the plain text message.
1306
- * @returns A `Promise` representing the asynchronous operation.
1307
- *
1308
- * @beta
1309
- */
1310
- export declare function sendMessage(target: NotificationTarget, text: string): Promise<void>;
1364
+ /**
1365
+ * Send a plain text message to a notification target.
1366
+ *
1367
+ * @param target - the notification target.
1368
+ * @param text - the plain text message.
1369
+ * @returns A `Promise` representing the asynchronous operation.
1370
+ *
1371
+ * @beta
1372
+ */
1373
+ export declare function sendMessage(target: NotificationTarget, text: string): Promise<void>;
1311
1374
 
1312
- /**
1313
- * Set custom log function. Use the function if it's set. Priority is lower than setLogger.
1314
- *
1315
- * @param {LogFunction} logFunction - custom log function. If it's undefined, custom log function will be cleared.
1316
- *
1317
- * @example
1318
- * ```typescript
1319
- * setLogFunction((level: LogLevel, message: string) => {
1320
- * if (level === LogLevel.Error) {
1321
- * console.log(message);
1322
- * }
1323
- * });
1324
- * ```
1325
- *
1326
- * @beta
1327
- */
1328
- export declare function setLogFunction(logFunction?: LogFunction): void;
1375
+ /**
1376
+ * Set custom log function. Use the function if it's set. Priority is lower than setLogger.
1377
+ *
1378
+ * @param {LogFunction} logFunction - custom log function. If it's undefined, custom log function will be cleared.
1379
+ *
1380
+ * @example
1381
+ * ```typescript
1382
+ * setLogFunction((level: LogLevel, message: string) => {
1383
+ * if (level === LogLevel.Error) {
1384
+ * console.log(message);
1385
+ * }
1386
+ * });
1387
+ * ```
1388
+ *
1389
+ * @beta
1390
+ */
1391
+ export declare function setLogFunction(logFunction?: LogFunction): void;
1329
1392
 
1330
- /**
1331
- * Set custom logger. Use the output functions if it's set. Priority is higher than setLogFunction.
1332
- *
1333
- * @param {Logger} logger - custom logger. If it's undefined, custom logger will be cleared.
1334
- *
1335
- * @example
1336
- * ```typescript
1337
- * setLogger({
1338
- * verbose: console.debug,
1339
- * info: console.info,
1340
- * warn: console.warn,
1341
- * error: console.error,
1342
- * });
1343
- * ```
1344
- *
1345
- * @beta
1346
- */
1347
- export declare function setLogger(logger?: Logger): void;
1393
+ /**
1394
+ * Set custom logger. Use the output functions if it's set. Priority is higher than setLogFunction.
1395
+ *
1396
+ * @param {Logger} logger - custom logger. If it's undefined, custom logger will be cleared.
1397
+ *
1398
+ * @example
1399
+ * ```typescript
1400
+ * setLogger({
1401
+ * verbose: console.debug,
1402
+ * info: console.info,
1403
+ * warn: console.warn,
1404
+ * error: console.error,
1405
+ * });
1406
+ * ```
1407
+ *
1408
+ * @beta
1409
+ */
1410
+ export declare function setLogger(logger?: Logger): void;
1348
1411
 
1349
- /**
1350
- * Update log level helper.
1351
- *
1352
- * @param { LogLevel } level - log level in configuration
1353
- *
1354
- * @beta
1355
- */
1356
- export declare function setLogLevel(level: LogLevel): void;
1412
+ /**
1413
+ * Update log level helper.
1414
+ *
1415
+ * @param { LogLevel } level - log level in configuration
1416
+ *
1417
+ * @beta
1418
+ */
1419
+ export declare function setLogLevel(level: LogLevel): void;
1357
1420
 
1358
- /**
1359
- * A {@link NotificationTarget} that represents a bot installation. Teams Bot could be installed into
1360
- * - Personal chat
1361
- * - Group chat
1362
- * - Team (by default the `General` channel)
1363
- *
1364
- * @remarks
1365
- * It's recommended to get bot installations from {@link ConversationBot.installations()}.
1366
- *
1367
- * @beta
1368
- */
1369
- export declare class TeamsBotInstallation implements NotificationTarget {
1370
- /**
1371
- * The bound `BotFrameworkAdapter`.
1372
- *
1373
- * @beta
1374
- */
1375
- readonly adapter: BotFrameworkAdapter;
1376
- /**
1377
- * The bound `ConversationReference`.
1378
- *
1379
- * @beta
1380
- */
1381
- readonly conversationReference: Partial<ConversationReference>;
1382
- /**
1383
- * Notification target type.
1384
- *
1385
- * @remarks
1386
- * - "Channel" means bot is installed into a team and notification will be sent to its "General" channel.
1387
- * - "Group" means bot is installed into a group chat.
1388
- * - "Person" means bot is installed into a personal scope and notification will be sent to personal chat.
1389
- *
1390
- * @beta
1391
- */
1392
- readonly type?: NotificationTargetType;
1393
- /**
1394
- * Constructor
1395
- *
1396
- * @remarks
1397
- * It's recommended to get bot installations from {@link ConversationBot.installations()}, instead of using this constructor.
1398
- *
1399
- * @param adapter - the bound `BotFrameworkAdapter`.
1400
- * @param conversationReference - the bound `ConversationReference`.
1401
- *
1402
- * @beta
1403
- */
1404
- constructor(adapter: BotFrameworkAdapter, conversationReference: Partial<ConversationReference>);
1405
- /**
1406
- * Send a plain text message.
1407
- *
1408
- * @param text - the plain text message.
1409
- * @returns A `Promise` representing the asynchronous operation.
1410
- *
1411
- * @beta
1412
- */
1413
- sendMessage(text: string): Promise<void>;
1414
- /**
1415
- * Send an adaptive card message.
1416
- *
1417
- * @param card - the adaptive card raw JSON.
1418
- * @returns A `Promise` representing the asynchronous operation.
1419
- *
1420
- * @beta
1421
- */
1422
- sendAdaptiveCard(card: unknown): Promise<void>;
1423
- /**
1424
- * Get channels from this bot installation.
1425
- *
1426
- * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
1427
- *
1428
- * @beta
1429
- */
1430
- channels(): Promise<Channel[]>;
1431
- /**
1432
- * Get members from this bot installation.
1433
- *
1434
- * @returns an array of members from where the bot is installed.
1435
- *
1436
- * @beta
1437
- */
1438
- members(): Promise<Member[]>;
1439
- }
1421
+ /**
1422
+ * A {@link NotificationTarget} that represents a bot installation. Teams Bot could be installed into
1423
+ * - Personal chat
1424
+ * - Group chat
1425
+ * - Team (by default the `General` channel)
1426
+ *
1427
+ * @remarks
1428
+ * It's recommended to get bot installations from {@link ConversationBot.installations()}.
1429
+ *
1430
+ * @beta
1431
+ */
1432
+ export declare class TeamsBotInstallation implements NotificationTarget {
1433
+ /**
1434
+ * The bound `BotFrameworkAdapter`.
1435
+ *
1436
+ * @beta
1437
+ */
1438
+ readonly adapter: BotFrameworkAdapter;
1439
+ /**
1440
+ * The bound `ConversationReference`.
1441
+ *
1442
+ * @beta
1443
+ */
1444
+ readonly conversationReference: Partial<ConversationReference>;
1445
+ /**
1446
+ * Notification target type.
1447
+ *
1448
+ * @remarks
1449
+ * - "Channel" means bot is installed into a team and notification will be sent to its "General" channel.
1450
+ * - "Group" means bot is installed into a group chat.
1451
+ * - "Person" means bot is installed into a personal scope and notification will be sent to personal chat.
1452
+ *
1453
+ * @beta
1454
+ */
1455
+ readonly type?: NotificationTargetType;
1456
+ /**
1457
+ * Constructor
1458
+ *
1459
+ * @remarks
1460
+ * It's recommended to get bot installations from {@link ConversationBot.installations()}, instead of using this constructor.
1461
+ *
1462
+ * @param adapter - the bound `BotFrameworkAdapter`.
1463
+ * @param conversationReference - the bound `ConversationReference`.
1464
+ *
1465
+ * @beta
1466
+ */
1467
+ constructor(adapter: BotFrameworkAdapter, conversationReference: Partial<ConversationReference>);
1468
+ /**
1469
+ * Send a plain text message.
1470
+ *
1471
+ * @param text - the plain text message.
1472
+ * @returns A `Promise` representing the asynchronous operation.
1473
+ *
1474
+ * @beta
1475
+ */
1476
+ sendMessage(text: string): Promise<void>;
1477
+ /**
1478
+ * Send an adaptive card message.
1479
+ *
1480
+ * @param card - the adaptive card raw JSON.
1481
+ * @returns A `Promise` representing the asynchronous operation.
1482
+ *
1483
+ * @beta
1484
+ */
1485
+ sendAdaptiveCard(card: unknown): Promise<void>;
1486
+ /**
1487
+ * Get channels from this bot installation.
1488
+ *
1489
+ * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
1490
+ *
1491
+ * @beta
1492
+ */
1493
+ channels(): Promise<Channel[]>;
1494
+ /**
1495
+ * Get members from this bot installation.
1496
+ *
1497
+ * @returns an array of members from where the bot is installed.
1498
+ *
1499
+ * @beta
1500
+ */
1501
+ members(): Promise<Member[]>;
1502
+ }
1440
1503
 
1441
- /**
1442
- * Creates a new prompt that leverage Teams Single Sign On (SSO) support for bot to automatically sign in user and
1443
- * help receive oauth token, asks the user to consent if needed.
1444
- *
1445
- * @remarks
1446
- * The prompt will attempt to retrieve the users current token of the desired scopes and store it in
1447
- * the token store.
1448
- *
1449
- * User will be automatically signed in leveraging Teams support of Bot Single Sign On(SSO):
1450
- * https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/auth-aad-sso-bots
1451
- *
1452
- * @example
1453
- * When used with your bots `DialogSet` you can simply add a new instance of the prompt as a named
1454
- * dialog using `DialogSet.add()`. You can then start the prompt from a waterfall step using either
1455
- * `DialogContext.beginDialog()` or `DialogContext.prompt()`. The user will be prompted to sign in as
1456
- * needed and their access token will be passed as an argument to the callers next waterfall step:
1457
- *
1458
- * ```JavaScript
1459
- * const { ConversationState, MemoryStorage } = require('botbuilder');
1460
- * const { DialogSet, WaterfallDialog } = require('botbuilder-dialogs');
1461
- * const { TeamsBotSsoPrompt } = require('@microsoft/teamsfx');
1462
- *
1463
- * const convoState = new ConversationState(new MemoryStorage());
1464
- * const dialogState = convoState.createProperty('dialogState');
1465
- * const dialogs = new DialogSet(dialogState);
1466
- *
1467
- * dialogs.add(new TeamsBotSsoPrompt('TeamsBotSsoPrompt', {
1468
- * scopes: ["User.Read"],
1469
- * }));
1470
- *
1471
- * dialogs.add(new WaterfallDialog('taskNeedingLogin', [
1472
- * async (step) => {
1473
- * return await step.beginDialog('TeamsBotSsoPrompt');
1474
- * },
1475
- * async (step) => {
1476
- * const token = step.result;
1477
- * if (token) {
1478
- *
1479
- * // ... continue with task needing access token ...
1480
- *
1481
- * } else {
1482
- * await step.context.sendActivity(`Sorry... We couldn't log you in. Try again later.`);
1483
- * return await step.endDialog();
1484
- * }
1485
- * }
1486
- * ]));
1487
- * ```
1488
- *
1489
- * @beta
1490
- */
1491
- export declare class TeamsBotSsoPrompt extends Dialog {
1492
- private teamsfx;
1493
- private settings;
1494
- /**
1495
- * Constructor of TeamsBotSsoPrompt.
1496
- *
1497
- * @param {TeamsFx} teamsfx - Used to provide configuration and auth
1498
- * @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`.
1499
- * @param settings Settings used to configure the prompt.
1500
- *
1501
- * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1502
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1503
- *
1504
- * @beta
1505
- */
1506
- constructor(teamsfx: TeamsFx, dialogId: string, settings: TeamsBotSsoPromptSettings);
1507
- /**
1508
- * Called when a prompt dialog is pushed onto the dialog stack and is being activated.
1509
- * @remarks
1510
- * If the task is successful, the result indicates whether the prompt is still
1511
- * active after the turn has been processed by the prompt.
1512
- *
1513
- * @param dc The DialogContext for the current turn of the conversation.
1514
- *
1515
- * @throws {@link ErrorCode|InvalidParameter} when timeout property in teams bot sso prompt settings is not number or is not positive.
1516
- * @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
1517
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1518
- *
1519
- * @returns A `Promise` representing the asynchronous operation.
1520
- *
1521
- * @beta
1522
- */
1523
- beginDialog(dc: DialogContext): Promise<DialogTurnResult>;
1524
- /**
1525
- * Called when a prompt dialog is the active dialog and the user replied with a new activity.
1526
- *
1527
- * @remarks
1528
- * If the task is successful, the result indicates whether the dialog is still
1529
- * active after the turn has been processed by the dialog.
1530
- * The prompt generally continues to receive the user's replies until it accepts the
1531
- * user's reply as valid input for the prompt.
1532
- *
1533
- * @param dc The DialogContext for the current turn of the conversation.
1534
- *
1535
- * @returns A `Promise` representing the asynchronous operation.
1536
- *
1537
- * @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
1538
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1539
- *
1540
- * @beta
1541
- */
1542
- continueDialog(dc: DialogContext): Promise<DialogTurnResult>;
1543
- private loadAndValidateConfig;
1544
- /**
1545
- * Ensure bot is running in MS Teams since TeamsBotSsoPrompt is only supported in MS Teams channel.
1546
- * @param dc dialog context
1547
- * @throws {@link ErrorCode|ChannelNotSupported} if bot channel is not MS Teams
1548
- * @internal
1549
- */
1550
- private ensureMsTeamsChannel;
1551
- /**
1552
- * Send OAuthCard that tells Teams to obtain an authentication token for the bot application.
1553
- * For details see https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/auth-aad-sso-bots.
1554
- *
1555
- * @internal
1556
- */
1557
- private sendOAuthCardAsync;
1558
- /**
1559
- * Get sign in resource.
1560
- *
1561
- * @throws {@link ErrorCode|InvalidConfiguration} if client id, tenant id or initiate login endpoint is not found in config.
1562
- *
1563
- * @internal
1564
- */
1565
- private getSignInResource;
1566
- /**
1567
- * @internal
1568
- */
1569
- private recognizeToken;
1570
- /**
1571
- * @internal
1572
- */
1573
- private getTokenExchangeInvokeResponse;
1574
- /**
1575
- * @internal
1576
- */
1577
- private isTeamsVerificationInvoke;
1578
- /**
1579
- * @internal
1580
- */
1581
- private isTokenExchangeRequestInvoke;
1582
- /**
1583
- * @internal
1584
- */
1585
- private isTokenExchangeRequest;
1586
- }
1504
+ /**
1505
+ * Creates a new prompt that leverage Teams Single Sign On (SSO) support for bot to automatically sign in user and
1506
+ * help receive oauth token, asks the user to consent if needed.
1507
+ *
1508
+ * @remarks
1509
+ * The prompt will attempt to retrieve the users current token of the desired scopes and store it in
1510
+ * the token store.
1511
+ *
1512
+ * User will be automatically signed in leveraging Teams support of Bot Single Sign On(SSO):
1513
+ * https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/auth-aad-sso-bots
1514
+ *
1515
+ * @example
1516
+ * When used with your bots `DialogSet` you can simply add a new instance of the prompt as a named
1517
+ * dialog using `DialogSet.add()`. You can then start the prompt from a waterfall step using either
1518
+ * `DialogContext.beginDialog()` or `DialogContext.prompt()`. The user will be prompted to sign in as
1519
+ * needed and their access token will be passed as an argument to the callers next waterfall step:
1520
+ *
1521
+ * ```JavaScript
1522
+ * const { ConversationState, MemoryStorage } = require('botbuilder');
1523
+ * const { DialogSet, WaterfallDialog } = require('botbuilder-dialogs');
1524
+ * const { TeamsBotSsoPrompt } = require('@microsoft/teamsfx');
1525
+ *
1526
+ * const convoState = new ConversationState(new MemoryStorage());
1527
+ * const dialogState = convoState.createProperty('dialogState');
1528
+ * const dialogs = new DialogSet(dialogState);
1529
+ *
1530
+ * dialogs.add(new TeamsBotSsoPrompt('TeamsBotSsoPrompt', {
1531
+ * scopes: ["User.Read"],
1532
+ * }));
1533
+ *
1534
+ * dialogs.add(new WaterfallDialog('taskNeedingLogin', [
1535
+ * async (step) => {
1536
+ * return await step.beginDialog('TeamsBotSsoPrompt');
1537
+ * },
1538
+ * async (step) => {
1539
+ * const token = step.result;
1540
+ * if (token) {
1541
+ *
1542
+ * // ... continue with task needing access token ...
1543
+ *
1544
+ * } else {
1545
+ * await step.context.sendActivity(`Sorry... We couldn't log you in. Try again later.`);
1546
+ * return await step.endDialog();
1547
+ * }
1548
+ * }
1549
+ * ]));
1550
+ * ```
1551
+ *
1552
+ * @beta
1553
+ */
1554
+ export declare class TeamsBotSsoPrompt extends Dialog {
1555
+ private teamsfx;
1556
+ private settings;
1557
+ /**
1558
+ * Constructor of TeamsBotSsoPrompt.
1559
+ *
1560
+ * @param {TeamsFx} teamsfx - Used to provide configuration and auth
1561
+ * @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`.
1562
+ * @param settings Settings used to configure the prompt.
1563
+ *
1564
+ * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1565
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1566
+ *
1567
+ * @beta
1568
+ */
1569
+ constructor(teamsfx: TeamsFx, dialogId: string, settings: TeamsBotSsoPromptSettings);
1570
+ /**
1571
+ * Called when a prompt dialog is pushed onto the dialog stack and is being activated.
1572
+ * @remarks
1573
+ * If the task is successful, the result indicates whether the prompt is still
1574
+ * active after the turn has been processed by the prompt.
1575
+ *
1576
+ * @param dc The DialogContext for the current turn of the conversation.
1577
+ *
1578
+ * @throws {@link ErrorCode|InvalidParameter} when timeout property in teams bot sso prompt settings is not number or is not positive.
1579
+ * @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
1580
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1581
+ *
1582
+ * @returns A `Promise` representing the asynchronous operation.
1583
+ *
1584
+ * @beta
1585
+ */
1586
+ beginDialog(dc: DialogContext): Promise<DialogTurnResult>;
1587
+ /**
1588
+ * Called when a prompt dialog is the active dialog and the user replied with a new activity.
1589
+ *
1590
+ * @remarks
1591
+ * If the task is successful, the result indicates whether the dialog is still
1592
+ * active after the turn has been processed by the dialog.
1593
+ * The prompt generally continues to receive the user's replies until it accepts the
1594
+ * user's reply as valid input for the prompt.
1595
+ *
1596
+ * @param dc The DialogContext for the current turn of the conversation.
1597
+ *
1598
+ * @returns A `Promise` representing the asynchronous operation.
1599
+ *
1600
+ * @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
1601
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1602
+ *
1603
+ * @beta
1604
+ */
1605
+ continueDialog(dc: DialogContext): Promise<DialogTurnResult>;
1606
+ private loadAndValidateConfig;
1607
+ /**
1608
+ * Ensure bot is running in MS Teams since TeamsBotSsoPrompt is only supported in MS Teams channel.
1609
+ * @param dc dialog context
1610
+ * @throws {@link ErrorCode|ChannelNotSupported} if bot channel is not MS Teams
1611
+ * @internal
1612
+ */
1613
+ private ensureMsTeamsChannel;
1614
+ /**
1615
+ * Send OAuthCard that tells Teams to obtain an authentication token for the bot application.
1616
+ * For details see https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/auth-aad-sso-bots.
1617
+ *
1618
+ * @internal
1619
+ */
1620
+ private sendOAuthCardAsync;
1621
+ /**
1622
+ * Get sign in resource.
1623
+ *
1624
+ * @throws {@link ErrorCode|InvalidConfiguration} if client id, tenant id or initiate login endpoint is not found in config.
1625
+ *
1626
+ * @internal
1627
+ */
1628
+ private getSignInResource;
1629
+ /**
1630
+ * @internal
1631
+ */
1632
+ private recognizeToken;
1633
+ /**
1634
+ * @internal
1635
+ */
1636
+ private getTokenExchangeInvokeResponse;
1637
+ /**
1638
+ * @internal
1639
+ */
1640
+ private isTeamsVerificationInvoke;
1641
+ /**
1642
+ * @internal
1643
+ */
1644
+ private isTokenExchangeRequestInvoke;
1645
+ /**
1646
+ * @internal
1647
+ */
1648
+ private isTokenExchangeRequest;
1649
+ }
1587
1650
 
1588
- /**
1589
- * Settings used to configure an TeamsBotSsoPrompt instance.
1590
- *
1591
- * @beta
1592
- */
1593
- export declare interface TeamsBotSsoPromptSettings {
1594
- /**
1595
- * The array of strings that declare the desired permissions and the resources requested.
1596
- */
1597
- scopes: string[];
1598
- /**
1599
- * (Optional) number of milliseconds the prompt will wait for the user to authenticate.
1600
- * Defaults to a value `900,000` (15 minutes.)
1601
- */
1602
- timeout?: number;
1603
- /**
1604
- * (Optional) value indicating whether the TeamsBotSsoPrompt should end upon receiving an
1605
- * invalid message. Generally the TeamsBotSsoPrompt will end the auth flow when receives user
1606
- * message not related to the auth flow. Setting the flag to false ignores the user's message instead.
1607
- * Defaults to value `true`
1608
- */
1609
- endOnInvalidMessage?: boolean;
1610
- }
1651
+ /**
1652
+ * Settings used to configure an TeamsBotSsoPrompt instance.
1653
+ *
1654
+ * @beta
1655
+ */
1656
+ export declare interface TeamsBotSsoPromptSettings {
1657
+ /**
1658
+ * The array of strings that declare the desired permissions and the resources requested.
1659
+ */
1660
+ scopes: string[];
1661
+ /**
1662
+ * (Optional) number of milliseconds the prompt will wait for the user to authenticate.
1663
+ * Defaults to a value `900,000` (15 minutes.)
1664
+ */
1665
+ timeout?: number;
1666
+ /**
1667
+ * (Optional) value indicating whether the TeamsBotSsoPrompt should end upon receiving an
1668
+ * invalid message. Generally the TeamsBotSsoPrompt will end the auth flow when receives user
1669
+ * message not related to the auth flow. Setting the flag to false ignores the user's message instead.
1670
+ * Defaults to value `true`
1671
+ */
1672
+ endOnInvalidMessage?: boolean;
1673
+ }
1611
1674
 
1612
- /**
1613
- * Token response provided by Teams Bot SSO prompt
1614
- *
1615
- * @beta
1616
- */
1617
- export declare interface TeamsBotSsoPromptTokenResponse extends TokenResponse {
1618
- /**
1619
- * SSO token for user
1620
- */
1621
- ssoToken: string;
1622
- /**
1623
- * Expire time of SSO token
1624
- */
1625
- ssoTokenExpiration: string;
1626
- }
1675
+ /**
1676
+ * Token response provided by Teams Bot SSO prompt
1677
+ *
1678
+ * @beta
1679
+ */
1680
+ export declare interface TeamsBotSsoPromptTokenResponse extends TokenResponse {
1681
+ /**
1682
+ * SSO token for user
1683
+ */
1684
+ ssoToken: string;
1685
+ /**
1686
+ * Expire time of SSO token
1687
+ */
1688
+ ssoTokenExpiration: string;
1689
+ }
1627
1690
 
1628
- /**
1629
- * A class providing credential and configuration.
1630
- * @beta
1631
- */
1632
- export declare class TeamsFx implements TeamsFxConfiguration {
1633
- private configuration;
1634
- private oboUserCredential?;
1635
- private appCredential?;
1636
- private identityType;
1637
- /**
1638
- * Constructor of TeamsFx
1639
- *
1640
- * @param {IdentityType} identityType - Choose user or app identity
1641
- * @param customConfig - key/value pairs of customized configuration that overrides default ones.
1642
- *
1643
- * @throws {@link ErrorCode|IdentityTypeNotSupported} when setting app identity in browser.
1644
- *
1645
- * @beta
1646
- */
1647
- constructor(identityType?: IdentityType, customConfig?: Record<string, string>);
1648
- /**
1649
- * Identity type set by user.
1650
- *
1651
- * @returns identity type.
1652
- * @beta
1653
- */
1654
- getIdentityType(): IdentityType;
1655
- /**
1656
- * Credential instance according to identity type choice.
1657
- *
1658
- * @remarks If user identity is chose, will return {@link TeamsUserCredential}
1659
- * in browser environment and {@link OnBehalfOfUserCredential} in NodeJS. If app
1660
- * identity is chose, will return {@link AppCredential}.
1661
- *
1662
- * @returns instance implements TokenCredential interface.
1663
- * @beta
1664
- */
1665
- getCredential(): TokenCredential;
1666
- /**
1667
- * Get user information.
1668
- * @returns UserInfo object.
1669
- * @beta
1670
- */
1671
- getUserInfo(): Promise<UserInfo>;
1672
- /**
1673
- * Popup login page to get user's access token with specific scopes.
1674
- *
1675
- * @remarks
1676
- * Only works in Teams client APP. User will be redirected to the authorization page to login and consent.
1677
- *
1678
- * @example
1679
- * ```typescript
1680
- * await teamsfx.login(["https://graph.microsoft.com/User.Read"]); // single scope using string array
1681
- * await teamsfx.login("https://graph.microsoft.com/User.Read"); // single scopes using string
1682
- * await teamsfx.login(["https://graph.microsoft.com/User.Read", "Calendars.Read"]); // multiple scopes using string array
1683
- * await teamsfx.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
1684
- * ```
1685
- * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
1686
- *
1687
- * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
1688
- * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
1689
- * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1690
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
1691
- *
1692
- * @beta
1693
- */
1694
- login(scopes: string | string[]): Promise<void>;
1695
- /**
1696
- * Set SSO token when using user identity in NodeJS.
1697
- * @param {string} ssoToken - used for on behalf of user flow.
1698
- * @returns self instance.
1699
- * @beta
1700
- */
1701
- setSsoToken(ssoToken: string): TeamsFx;
1702
- /**
1703
- * Usually used by service plugins to retrieve specific config
1704
- * @param {string} key - configuration key.
1705
- * @returns value in configuration.
1706
- * @beta
1707
- */
1708
- getConfig(key: string): string;
1709
- /**
1710
- * Check the value of specific key.
1711
- * @param {string} key - configuration key.
1712
- * @returns true if corresponding value is not empty string.
1713
- * @beta
1714
- */
1715
- hasConfig(key: string): boolean;
1716
- /**
1717
- * Get all configurations.
1718
- * @returns key value mappings.
1719
- * @beta
1720
- */
1721
- getConfigs(): Record<string, string>;
1722
- /**
1723
- * Load configuration from environment variables.
1724
- */
1725
- private loadFromEnv;
1726
- }
1691
+ /**
1692
+ * A class providing credential and configuration.
1693
+ * @beta
1694
+ */
1695
+ export declare class TeamsFx implements TeamsFxConfiguration {
1696
+ private configuration;
1697
+ private oboUserCredential?;
1698
+ private appCredential?;
1699
+ private identityType;
1700
+ /**
1701
+ * Constructor of TeamsFx
1702
+ *
1703
+ * @param {IdentityType} identityType - Choose user or app identity
1704
+ * @param customConfig - key/value pairs of customized configuration that overrides default ones.
1705
+ *
1706
+ * @throws {@link ErrorCode|IdentityTypeNotSupported} when setting app identity in browser.
1707
+ *
1708
+ * @beta
1709
+ */
1710
+ constructor(identityType?: IdentityType, customConfig?: Record<string, string>);
1711
+ /**
1712
+ * Identity type set by user.
1713
+ *
1714
+ * @returns identity type.
1715
+ * @beta
1716
+ */
1717
+ getIdentityType(): IdentityType;
1718
+ /**
1719
+ * Credential instance according to identity type choice.
1720
+ *
1721
+ * @remarks If user identity is chose, will return {@link TeamsUserCredential}
1722
+ * in browser environment and {@link OnBehalfOfUserCredential} in NodeJS. If app
1723
+ * identity is chose, will return {@link AppCredential}.
1724
+ *
1725
+ * @returns instance implements TokenCredential interface.
1726
+ * @beta
1727
+ */
1728
+ getCredential(): TokenCredential;
1729
+ /**
1730
+ * Get user information.
1731
+ * @returns UserInfo object.
1732
+ * @beta
1733
+ */
1734
+ getUserInfo(): Promise<UserInfo>;
1735
+ /**
1736
+ * Popup login page to get user's access token with specific scopes.
1737
+ *
1738
+ * @remarks
1739
+ * Only works in Teams client APP. User will be redirected to the authorization page to login and consent.
1740
+ *
1741
+ * @example
1742
+ * ```typescript
1743
+ * await teamsfx.login(["https://graph.microsoft.com/User.Read"]); // single scope using string array
1744
+ * await teamsfx.login("https://graph.microsoft.com/User.Read"); // single scopes using string
1745
+ * await teamsfx.login(["https://graph.microsoft.com/User.Read", "Calendars.Read"]); // multiple scopes using string array
1746
+ * await teamsfx.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
1747
+ * ```
1748
+ * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
1749
+ *
1750
+ * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
1751
+ * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
1752
+ * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1753
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
1754
+ *
1755
+ * @beta
1756
+ */
1757
+ login(scopes: string | string[]): Promise<void>;
1758
+ /**
1759
+ * Set SSO token when using user identity in NodeJS.
1760
+ * @param {string} ssoToken - used for on behalf of user flow.
1761
+ * @returns self instance.
1762
+ * @beta
1763
+ */
1764
+ setSsoToken(ssoToken: string): TeamsFx;
1765
+ /**
1766
+ * Usually used by service plugins to retrieve specific config
1767
+ * @param {string} key - configuration key.
1768
+ * @returns value in configuration.
1769
+ * @beta
1770
+ */
1771
+ getConfig(key: string): string;
1772
+ /**
1773
+ * Check the value of specific key.
1774
+ * @param {string} key - configuration key.
1775
+ * @returns true if corresponding value is not empty string.
1776
+ * @beta
1777
+ */
1778
+ hasConfig(key: string): boolean;
1779
+ /**
1780
+ * Get all configurations.
1781
+ * @returns key value mappings.
1782
+ * @beta
1783
+ */
1784
+ getConfigs(): Record<string, string>;
1785
+ /**
1786
+ * Load configuration from environment variables.
1787
+ */
1788
+ private loadFromEnv;
1789
+ }
1727
1790
 
1728
- /**
1729
- * Interface for a command handler that can process command to a TeamsFx bot and return a response.
1730
- *
1731
- * @beta
1732
- */
1733
- export declare interface TeamsFxBotCommandHandler {
1734
- /**
1735
- * The string or regular expression patterns that can trigger this handler.
1736
- */
1737
- triggerPatterns: TriggerPatterns;
1738
- /**
1739
- * Handles a bot command received activity.
1740
- *
1741
- * @param context The bot context.
1742
- * @param message The command message the user types from Teams.
1743
- * @returns A `Promise` representing an activity or text to send as the command response.
1744
- */
1745
- handleCommandReceived(context: TurnContext, message: CommandMessage): Promise<string | Partial<Activity>>;
1746
- }
1791
+ /**
1792
+ * Interface for a command handler that can process command to a TeamsFx bot and return a response.
1793
+ *
1794
+ * @beta
1795
+ */
1796
+ export declare interface TeamsFxBotCommandHandler {
1797
+ /**
1798
+ * The string or regular expression patterns that can trigger this handler.
1799
+ */
1800
+ triggerPatterns: TriggerPatterns;
1801
+ /**
1802
+ * Handles a bot command received activity.
1803
+ *
1804
+ * @param context The bot context.
1805
+ * @param message The command message the user types from Teams.
1806
+ * @returns A `Promise` representing an activity or text to send as the command response.
1807
+ */
1808
+ handleCommandReceived(context: TurnContext, message: CommandMessage): Promise<string | Partial<Activity>>;
1809
+ }
1747
1810
 
1748
- /**
1749
- * TeamsFx interface that provides credential and configuration.
1750
- * @beta
1751
- */
1752
- declare interface TeamsFxConfiguration {
1753
- /**
1754
- * Identity type set by user.
1755
- *
1756
- * @returns identity type.
1757
- * @beta
1758
- */
1759
- getIdentityType(): IdentityType;
1760
- /**
1761
- * Credential instance according to identity type choice.
1762
- *
1763
- * @remarks If user identity is chose, will return {@link TeamsUserCredential}
1764
- * in browser environment and {@link OnBehalfOfUserCredential} in NodeJS. If app
1765
- * identity is chose, will return {@link AppCredential}.
1766
- *
1767
- * @returns instance implements TokenCredential interface.
1768
- * @beta
1769
- */
1770
- getCredential(): TokenCredential;
1771
- /**
1772
- * Get user information.
1773
- * @returns UserInfo object.
1774
- * @beta
1775
- */
1776
- getUserInfo(): Promise<UserInfo>;
1777
- /**
1778
- * Popup login page to get user's access token with specific scopes.
1779
- *
1780
- * @remarks
1781
- * Only works in Teams client APP. User will be redirected to the authorization page to login and consent.
1782
- *
1783
- * @example
1784
- * ```typescript
1785
- * await teamsfx.login(["https://graph.microsoft.com/User.Read"]); // single scope using string array
1786
- * await teamsfx.login("https://graph.microsoft.com/User.Read"); // single scopes using string
1787
- * await teamsfx.login(["https://graph.microsoft.com/User.Read", "Calendars.Read"]); // multiple scopes using string array
1788
- * await teamsfx.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
1789
- * ```
1790
- * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
1791
- *
1792
- * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
1793
- * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
1794
- * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1795
- * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
1796
- *
1797
- * @beta
1798
- */
1799
- login(scopes: string | string[]): Promise<void>;
1800
- /**
1801
- * Set SSO token when using user identity in NodeJS.
1802
- * @param {string} ssoToken - used for on behalf of user flow.
1803
- * @returns self instance.
1804
- * @beta
1805
- */
1806
- setSsoToken(ssoToken: string): TeamsFxConfiguration;
1807
- /**
1808
- * Usually used by service plugins to retrieve specific config
1809
- * @param {string} key - configuration key.
1810
- * @returns value in configuration.
1811
- * @beta
1812
- */
1813
- getConfig(key: string): string;
1814
- /**
1815
- * Check the value of specific key.
1816
- * @param {string} key - configuration key.
1817
- * @returns true if corresponding value is not empty string.
1818
- * @beta
1819
- */
1820
- hasConfig(key: string): boolean;
1821
- /**
1822
- * Get all configurations.
1823
- * @returns key value mappings.
1824
- * @beta
1825
- */
1826
- getConfigs(): Record<string, string>;
1827
- }
1811
+ /**
1812
+ * TeamsFx interface that provides credential and configuration.
1813
+ * @beta
1814
+ */
1815
+ declare interface TeamsFxConfiguration {
1816
+ /**
1817
+ * Identity type set by user.
1818
+ *
1819
+ * @returns identity type.
1820
+ * @beta
1821
+ */
1822
+ getIdentityType(): IdentityType;
1823
+ /**
1824
+ * Credential instance according to identity type choice.
1825
+ *
1826
+ * @remarks If user identity is chose, will return {@link TeamsUserCredential}
1827
+ * in browser environment and {@link OnBehalfOfUserCredential} in NodeJS. If app
1828
+ * identity is chose, will return {@link AppCredential}.
1829
+ *
1830
+ * @returns instance implements TokenCredential interface.
1831
+ * @beta
1832
+ */
1833
+ getCredential(): TokenCredential;
1834
+ /**
1835
+ * Get user information.
1836
+ * @returns UserInfo object.
1837
+ * @beta
1838
+ */
1839
+ getUserInfo(): Promise<UserInfo>;
1840
+ /**
1841
+ * Popup login page to get user's access token with specific scopes.
1842
+ *
1843
+ * @remarks
1844
+ * Only works in Teams client APP. User will be redirected to the authorization page to login and consent.
1845
+ *
1846
+ * @example
1847
+ * ```typescript
1848
+ * await teamsfx.login(["https://graph.microsoft.com/User.Read"]); // single scope using string array
1849
+ * await teamsfx.login("https://graph.microsoft.com/User.Read"); // single scopes using string
1850
+ * await teamsfx.login(["https://graph.microsoft.com/User.Read", "Calendars.Read"]); // multiple scopes using string array
1851
+ * await teamsfx.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
1852
+ * ```
1853
+ * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
1854
+ *
1855
+ * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
1856
+ * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
1857
+ * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1858
+ * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
1859
+ *
1860
+ * @beta
1861
+ */
1862
+ login(scopes: string | string[]): Promise<void>;
1863
+ /**
1864
+ * Set SSO token when using user identity in NodeJS.
1865
+ * @param {string} ssoToken - used for on behalf of user flow.
1866
+ * @returns self instance.
1867
+ * @beta
1868
+ */
1869
+ setSsoToken(ssoToken: string): TeamsFxConfiguration;
1870
+ /**
1871
+ * Usually used by service plugins to retrieve specific config
1872
+ * @param {string} key - configuration key.
1873
+ * @returns value in configuration.
1874
+ * @beta
1875
+ */
1876
+ getConfig(key: string): string;
1877
+ /**
1878
+ * Check the value of specific key.
1879
+ * @param {string} key - configuration key.
1880
+ * @returns true if corresponding value is not empty string.
1881
+ * @beta
1882
+ */
1883
+ hasConfig(key: string): boolean;
1884
+ /**
1885
+ * Get all configurations.
1886
+ * @returns key value mappings.
1887
+ * @beta
1888
+ */
1889
+ getConfigs(): Record<string, string>;
1890
+ }
1828
1891
 
1829
- /**
1830
- * Represent Teams current user's identity, and it is used within Teams client applications.
1831
- *
1832
- * @remarks
1833
- * Can only be used within Teams.
1834
- *
1835
- * @beta
1836
- */
1837
- export declare class TeamsUserCredential implements TokenCredential {
1838
- /**
1839
- * Constructor of TeamsUserCredential.
1840
- * @remarks
1841
- * Can only be used within Teams.
1842
- * @beta
1843
- */
1844
- constructor(authConfig: AuthenticationConfiguration);
1845
- /**
1846
- * Popup login page to get user's access token with specific scopes.
1847
- * @remarks
1848
- * Can only be used within Teams.
1849
- * @beta
1850
- */
1851
- login(scopes: string | string[]): Promise<void>;
1852
- /**
1853
- * Get access token from credential.
1854
- * @remarks
1855
- * Can only be used within Teams.
1856
- * @beta
1857
- */
1858
- getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
1859
- /**
1860
- * Get basic user info from SSO token
1861
- * @remarks
1862
- * Can only be used within Teams.
1863
- * @beta
1864
- */
1865
- getUserInfo(): Promise<UserInfo>;
1866
- }
1892
+ /**
1893
+ * Represent Teams current user's identity, and it is used within Teams client applications.
1894
+ *
1895
+ * @remarks
1896
+ * Can only be used within Teams.
1897
+ *
1898
+ * @beta
1899
+ */
1900
+ export declare class TeamsUserCredential implements TokenCredential {
1901
+ /**
1902
+ * Constructor of TeamsUserCredential.
1903
+ * @remarks
1904
+ * Can only be used within Teams.
1905
+ * @beta
1906
+ */
1907
+ constructor(authConfig: AuthenticationConfiguration);
1908
+ /**
1909
+ * Popup login page to get user's access token with specific scopes.
1910
+ * @remarks
1911
+ * Can only be used within Teams.
1912
+ * @beta
1913
+ */
1914
+ login(scopes: string | string[]): Promise<void>;
1915
+ /**
1916
+ * Get access token from credential.
1917
+ * @remarks
1918
+ * Can only be used within Teams.
1919
+ * @beta
1920
+ */
1921
+ getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
1922
+ /**
1923
+ * Get basic user info from SSO token
1924
+ * @remarks
1925
+ * Can only be used within Teams.
1926
+ * @beta
1927
+ */
1928
+ getUserInfo(): Promise<UserInfo>;
1929
+ }
1867
1930
 
1868
- /**
1869
- * The trigger pattern used to trigger a {@link TeamsFxBotCommandHandler} instance.
1870
- */
1871
- export declare type TriggerPatterns = string | RegExp | (string | RegExp)[];
1931
+ /**
1932
+ * The trigger pattern used to trigger a {@link TeamsFxBotCommandHandler} instance.
1933
+ */
1934
+ export declare type TriggerPatterns = string | RegExp | (string | RegExp)[];
1872
1935
 
1873
- /**
1874
- * UserInfo with user displayName, objectId and preferredUserName.
1875
- *
1876
- * @beta
1877
- */
1878
- export declare interface UserInfo {
1879
- /**
1880
- * User Display Name.
1881
- *
1882
- * @readonly
1883
- */
1884
- displayName: string;
1885
- /**
1886
- * User unique reference within the Azure Active Directory domain.
1887
- *
1888
- * @readonly
1889
- */
1890
- objectId: string;
1891
- /**
1892
- * Usually be the email address.
1893
- *
1894
- * @readonly
1895
- */
1896
- preferredUserName: string;
1897
- }
1936
+ /**
1937
+ * UserInfo with user displayName, objectId and preferredUserName.
1938
+ *
1939
+ * @beta
1940
+ */
1941
+ export declare interface UserInfo {
1942
+ /**
1943
+ * User Display Name.
1944
+ *
1945
+ * @readonly
1946
+ */
1947
+ displayName: string;
1948
+ /**
1949
+ * User unique reference within the Azure Active Directory domain.
1950
+ *
1951
+ * @readonly
1952
+ */
1953
+ objectId: string;
1954
+ /**
1955
+ * Usually be the email address.
1956
+ *
1957
+ * @readonly
1958
+ */
1959
+ preferredUserName: string;
1960
+ }
1898
1961
 
1899
- export { }
1962
+ export { }