@microsoft/teamsfx 1.1.2-alpha.7eddd6cf4.0 → 1.1.2-alpha.9bd0cb559.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,30 @@ var ErrorCode;
31
31
  * Channel is not supported error.
32
32
  */
33
33
  ErrorCode["ChannelNotSupported"] = "ChannelNotSupported";
34
+ /**
35
+ * Failed to retrieve sso token
36
+ */
37
+ ErrorCode["FailedToRetrieveSsoToken"] = "FailedToRetrieveSsoToken";
38
+ /**
39
+ * Failed to process sso handler
40
+ */
41
+ ErrorCode["FailedToProcessSsoHandler"] = "FailedToProcessSsoHandler";
42
+ /**
43
+ * Cannot find command
44
+ */
45
+ ErrorCode["CannotFindCommand"] = "CannotFindCommand";
46
+ /**
47
+ * Failed to run sso step
48
+ */
49
+ ErrorCode["FailedToRunSsoStep"] = "FailedToRunSsoStep";
50
+ /**
51
+ * Failed to run dedup step
52
+ */
53
+ ErrorCode["FailedToRunDedupStep"] = "FailedToRunDedupStep";
54
+ /**
55
+ * Sso activity handler is undefined
56
+ */
57
+ ErrorCode["SsoActivityHandlerIsUndefined"] = "SsoActivityHandlerIsUndefined";
34
58
  /**
35
59
  * Runtime is not supported error.
36
60
  */
@@ -86,6 +110,15 @@ ErrorMessage.NodejsRuntimeNotSupported = "{0} is not supported in Node.";
86
110
  ErrorMessage.FailToAcquireTokenOnBehalfOfUser = "Failed to acquire access token on behalf of user: {0}";
87
111
  // ChannelNotSupported Error
88
112
  ErrorMessage.OnlyMSTeamsChannelSupported = "{0} is only supported in MS Teams Channel";
113
+ ErrorMessage.FailedToProcessSsoHandler = "Failed to process sso handler: {0}";
114
+ // FailedToRetrieveSsoToken Error
115
+ ErrorMessage.FailedToRetrieveSsoToken = "Failed to retrieve sso token, user failed to finish the AAD consent flow.";
116
+ // CannotFindCommand Error
117
+ ErrorMessage.CannotFindCommand = "Cannot find command: {0}";
118
+ ErrorMessage.FailedToRunSsoStep = "Failed to run dialog to retrieve sso token: {0}";
119
+ ErrorMessage.FailedToRunDedupStep = "Failed to run dialog to remove duplicated messages: {0}";
120
+ // SsoActivityHandlerIsUndefined Error
121
+ ErrorMessage.SsoActivityHandlerIsNull = "Sso command can only be used or added when sso activity handler is not undefined";
89
122
  // IdentityTypeNotSupported Error
90
123
  ErrorMessage.IdentityTypeNotSupported = "{0} identity is not supported in {1}";
91
124
  // AuthorizationInfoError
@@ -1438,6 +1471,105 @@ class ConversationBot {
1438
1471
  }
1439
1472
  }
1440
1473
 
1474
+ // Copyright (c) Microsoft Corporation.
1475
+ /*
1476
+ * Sso execution dialog, use to handle sso command
1477
+ */
1478
+ class BotSsoExecutionDialog {
1479
+ /**
1480
+ * Creates a new instance of the BotSsoExecutionDialog.
1481
+ * @param dedupStorage Helper storage to remove duplicated messages
1482
+ * @param requiredScopes The list of scopes for which the token will have access
1483
+ * @param teamsfx {@link TeamsFx} instance for authentication
1484
+ */
1485
+ constructor(dedupStorage, requiredScopes, teamsfx) {
1486
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1487
+ }
1488
+ /**
1489
+ * Add TeamsFxBotSsoCommandHandler instance
1490
+ * @param handler {@link BotSsoExecutionDialogHandler} callback function
1491
+ * @param triggerPatterns The trigger pattern
1492
+ */
1493
+ addCommand(handler, triggerPatterns) {
1494
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1495
+ }
1496
+ /**
1497
+ * The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.
1498
+ *
1499
+ * @param context The context object for the current turn.
1500
+ * @param accessor The instance of StatePropertyAccessor for dialog system.
1501
+ */
1502
+ async run(context, accessor) {
1503
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1504
+ }
1505
+ /**
1506
+ * Called when the component is ending.
1507
+ *
1508
+ * @param context Context for the current turn of conversation.
1509
+ */
1510
+ async onEndDialog(context) {
1511
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1512
+ }
1513
+ }
1514
+
1515
+ // Copyright (c) Microsoft Corporation.
1516
+ /**
1517
+ * Default sso execution activity handler
1518
+ */
1519
+ class DefaultBotSsoExecutionActivityHandler {
1520
+ /**
1521
+ * Creates a new instance of the DefaultBotSsoExecutionActivityHandler.
1522
+ * @param ssoConfig configuration for sso command bot
1523
+ */
1524
+ constructor(ssoConfig) {
1525
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1526
+ }
1527
+ /**
1528
+ * Add TeamsFxBotSsoCommandHandler instance to sso execution dialog
1529
+ * @param handler {@link BotSsoExecutionDialogHandler} callback function
1530
+ * @param triggerPatterns The trigger pattern
1531
+ */
1532
+ addCommand(handler, triggerPatterns) {
1533
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1534
+ }
1535
+ /**
1536
+ * Called to initiate the event emission process.
1537
+ * @param context The context object for the current turn.
1538
+ */
1539
+ async run(context) {
1540
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1541
+ }
1542
+ /**
1543
+ * Receives invoke activities with Activity name of 'signin/verifyState'.
1544
+ * @param context A context object for this turn.
1545
+ * @param query Signin state (part of signin action auth flow) verification invoke query.
1546
+ * @returns A promise that represents the work queued.
1547
+ */
1548
+ async handleTeamsSigninVerifyState(context, query) {
1549
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1550
+ }
1551
+ /**
1552
+ * Receives invoke activities with Activity name of 'signin/tokenExchange'
1553
+ * @param context A context object for this turn.
1554
+ * @param query Signin state (part of signin action auth flow) verification invoke query
1555
+ * @returns A promise that represents the work queued.
1556
+ */
1557
+ async handleTeamsSigninTokenExchange(context, query) {
1558
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1559
+ }
1560
+ /**
1561
+ * Handle signin invoke activity type.
1562
+ *
1563
+ * @param context The context object for the current turn.
1564
+ *
1565
+ * @remarks
1566
+ * Override this method to support channel-specific behavior across multiple channels.
1567
+ */
1568
+ async onSignInInvoke(context) {
1569
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1570
+ }
1571
+ }
1572
+
1441
1573
  // Copyright (c) Microsoft Corporation.
1442
1574
  /**
1443
1575
  * Send a plain text message to a notification target.
@@ -1742,6 +1874,22 @@ class CommandBot {
1742
1874
  registerCommands(commands) {
1743
1875
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
1744
1876
  }
1877
+ /**
1878
+ * Registers a sso command into the command bot.
1879
+ *
1880
+ * @param command The command to register.
1881
+ */
1882
+ registerSsoCommand(ssoCommand) {
1883
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
1884
+ }
1885
+ /**
1886
+ * Registers commands into the command bot.
1887
+ *
1888
+ * @param commands The commands to register.
1889
+ */
1890
+ registerSsoCommands(ssoCommands) {
1891
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
1892
+ }
1745
1893
  }
1746
1894
 
1747
1895
  /**
@@ -1782,5 +1930,5 @@ class CardActionBot {
1782
1930
  }
1783
1931
  }
1784
1932
 
1785
- export { AdaptiveCardResponse, ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, CardActionBot, CertificateAuthProvider, Channel, CommandBot, ConversationBot, ErrorCode, ErrorWithCode, IdentityType, InvokeResponseErrorCode, LogLevel, Member, MsGraphAuthProvider, NotificationBot, NotificationTargetType, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
1933
+ export { AdaptiveCardResponse, ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, BotSsoExecutionDialog, CardActionBot, CertificateAuthProvider, Channel, CommandBot, ConversationBot, DefaultBotSsoExecutionActivityHandler, ErrorCode, ErrorWithCode, IdentityType, InvokeResponseErrorCode, LogLevel, Member, MsGraphAuthProvider, NotificationBot, NotificationTargetType, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
1786
1934
  //# sourceMappingURL=index.esm2017.js.map