@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.
- package/dist/index.esm2017.js +149 -1
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +477 -26
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +161 -1
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +498 -23
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -3
- package/types/teamsfx.d.ts +315 -22
package/dist/index.esm5.js
CHANGED
|
@@ -32,6 +32,30 @@ var ErrorCode;
|
|
|
32
32
|
* Channel is not supported error.
|
|
33
33
|
*/
|
|
34
34
|
ErrorCode["ChannelNotSupported"] = "ChannelNotSupported";
|
|
35
|
+
/**
|
|
36
|
+
* Failed to retrieve sso token
|
|
37
|
+
*/
|
|
38
|
+
ErrorCode["FailedToRetrieveSsoToken"] = "FailedToRetrieveSsoToken";
|
|
39
|
+
/**
|
|
40
|
+
* Failed to process sso handler
|
|
41
|
+
*/
|
|
42
|
+
ErrorCode["FailedToProcessSsoHandler"] = "FailedToProcessSsoHandler";
|
|
43
|
+
/**
|
|
44
|
+
* Cannot find command
|
|
45
|
+
*/
|
|
46
|
+
ErrorCode["CannotFindCommand"] = "CannotFindCommand";
|
|
47
|
+
/**
|
|
48
|
+
* Failed to run sso step
|
|
49
|
+
*/
|
|
50
|
+
ErrorCode["FailedToRunSsoStep"] = "FailedToRunSsoStep";
|
|
51
|
+
/**
|
|
52
|
+
* Failed to run dedup step
|
|
53
|
+
*/
|
|
54
|
+
ErrorCode["FailedToRunDedupStep"] = "FailedToRunDedupStep";
|
|
55
|
+
/**
|
|
56
|
+
* Sso activity handler is undefined
|
|
57
|
+
*/
|
|
58
|
+
ErrorCode["SsoActivityHandlerIsUndefined"] = "SsoActivityHandlerIsUndefined";
|
|
35
59
|
/**
|
|
36
60
|
* Runtime is not supported error.
|
|
37
61
|
*/
|
|
@@ -87,6 +111,15 @@ ErrorMessage.NodejsRuntimeNotSupported = "{0} is not supported in Node.";
|
|
|
87
111
|
ErrorMessage.FailToAcquireTokenOnBehalfOfUser = "Failed to acquire access token on behalf of user: {0}";
|
|
88
112
|
// ChannelNotSupported Error
|
|
89
113
|
ErrorMessage.OnlyMSTeamsChannelSupported = "{0} is only supported in MS Teams Channel";
|
|
114
|
+
ErrorMessage.FailedToProcessSsoHandler = "Failed to process sso handler: {0}";
|
|
115
|
+
// FailedToRetrieveSsoToken Error
|
|
116
|
+
ErrorMessage.FailedToRetrieveSsoToken = "Failed to retrieve sso token, user failed to finish the AAD consent flow.";
|
|
117
|
+
// CannotFindCommand Error
|
|
118
|
+
ErrorMessage.CannotFindCommand = "Cannot find command: {0}";
|
|
119
|
+
ErrorMessage.FailedToRunSsoStep = "Failed to run dialog to retrieve sso token: {0}";
|
|
120
|
+
ErrorMessage.FailedToRunDedupStep = "Failed to run dialog to remove duplicated messages: {0}";
|
|
121
|
+
// SsoActivityHandlerIsUndefined Error
|
|
122
|
+
ErrorMessage.SsoActivityHandlerIsNull = "Sso command can only be used or added when sso activity handler is not undefined";
|
|
90
123
|
// IdentityTypeNotSupported Error
|
|
91
124
|
ErrorMessage.IdentityTypeNotSupported = "{0} identity is not supported in {1}";
|
|
92
125
|
// AuthorizationInfoError
|
|
@@ -1475,6 +1508,117 @@ class ConversationBot {
|
|
|
1475
1508
|
}
|
|
1476
1509
|
}
|
|
1477
1510
|
|
|
1511
|
+
// Copyright (c) Microsoft Corporation.
|
|
1512
|
+
/*
|
|
1513
|
+
* Sso execution dialog, use to handle sso command
|
|
1514
|
+
*/
|
|
1515
|
+
class BotSsoExecutionDialog {
|
|
1516
|
+
/**
|
|
1517
|
+
* Creates a new instance of the BotSsoExecutionDialog.
|
|
1518
|
+
* @param dedupStorage Helper storage to remove duplicated messages
|
|
1519
|
+
* @param requiredScopes The list of scopes for which the token will have access
|
|
1520
|
+
* @param teamsfx {@link TeamsFx} instance for authentication
|
|
1521
|
+
*/
|
|
1522
|
+
constructor(dedupStorage, requiredScopes, teamsfx) {
|
|
1523
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Add TeamsFxBotSsoCommandHandler instance
|
|
1527
|
+
* @param handler {@link BotSsoExecutionDialogHandler} callback function
|
|
1528
|
+
* @param triggerPatterns The trigger pattern
|
|
1529
|
+
*/
|
|
1530
|
+
addCommand(handler, triggerPatterns) {
|
|
1531
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.
|
|
1535
|
+
*
|
|
1536
|
+
* @param context The context object for the current turn.
|
|
1537
|
+
* @param accessor The instance of StatePropertyAccessor for dialog system.
|
|
1538
|
+
*/
|
|
1539
|
+
run(context, accessor) {
|
|
1540
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1541
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Called when the component is ending.
|
|
1546
|
+
*
|
|
1547
|
+
* @param context Context for the current turn of conversation.
|
|
1548
|
+
*/
|
|
1549
|
+
onEndDialog(context) {
|
|
1550
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1551
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// Copyright (c) Microsoft Corporation.
|
|
1557
|
+
/**
|
|
1558
|
+
* Default sso execution activity handler
|
|
1559
|
+
*/
|
|
1560
|
+
class DefaultBotSsoExecutionActivityHandler {
|
|
1561
|
+
/**
|
|
1562
|
+
* Creates a new instance of the DefaultBotSsoExecutionActivityHandler.
|
|
1563
|
+
* @param ssoConfig configuration for sso command bot
|
|
1564
|
+
*/
|
|
1565
|
+
constructor(ssoConfig) {
|
|
1566
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Add TeamsFxBotSsoCommandHandler instance to sso execution dialog
|
|
1570
|
+
* @param handler {@link BotSsoExecutionDialogHandler} callback function
|
|
1571
|
+
* @param triggerPatterns The trigger pattern
|
|
1572
|
+
*/
|
|
1573
|
+
addCommand(handler, triggerPatterns) {
|
|
1574
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Called to initiate the event emission process.
|
|
1578
|
+
* @param context The context object for the current turn.
|
|
1579
|
+
*/
|
|
1580
|
+
run(context) {
|
|
1581
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1582
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Receives invoke activities with Activity name of 'signin/verifyState'.
|
|
1587
|
+
* @param context A context object for this turn.
|
|
1588
|
+
* @param query Signin state (part of signin action auth flow) verification invoke query.
|
|
1589
|
+
* @returns A promise that represents the work queued.
|
|
1590
|
+
*/
|
|
1591
|
+
handleTeamsSigninVerifyState(context, query) {
|
|
1592
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1593
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Receives invoke activities with Activity name of 'signin/tokenExchange'
|
|
1598
|
+
* @param context A context object for this turn.
|
|
1599
|
+
* @param query Signin state (part of signin action auth flow) verification invoke query
|
|
1600
|
+
* @returns A promise that represents the work queued.
|
|
1601
|
+
*/
|
|
1602
|
+
handleTeamsSigninTokenExchange(context, query) {
|
|
1603
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1604
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* Handle signin invoke activity type.
|
|
1609
|
+
*
|
|
1610
|
+
* @param context The context object for the current turn.
|
|
1611
|
+
*
|
|
1612
|
+
* @remarks
|
|
1613
|
+
* Override this method to support channel-specific behavior across multiple channels.
|
|
1614
|
+
*/
|
|
1615
|
+
onSignInInvoke(context) {
|
|
1616
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1617
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1478
1622
|
// Copyright (c) Microsoft Corporation.
|
|
1479
1623
|
/**
|
|
1480
1624
|
* Send a plain text message to a notification target.
|
|
@@ -1789,6 +1933,22 @@ class CommandBot {
|
|
|
1789
1933
|
registerCommands(commands) {
|
|
1790
1934
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
|
|
1791
1935
|
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Registers a sso command into the command bot.
|
|
1938
|
+
*
|
|
1939
|
+
* @param command The command to register.
|
|
1940
|
+
*/
|
|
1941
|
+
registerSsoCommand(ssoCommand) {
|
|
1942
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Registers commands into the command bot.
|
|
1946
|
+
*
|
|
1947
|
+
* @param commands The commands to register.
|
|
1948
|
+
*/
|
|
1949
|
+
registerSsoCommands(ssoCommands) {
|
|
1950
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
|
|
1951
|
+
}
|
|
1792
1952
|
}
|
|
1793
1953
|
|
|
1794
1954
|
/**
|
|
@@ -1829,5 +1989,5 @@ class CardActionBot {
|
|
|
1829
1989
|
}
|
|
1830
1990
|
}
|
|
1831
1991
|
|
|
1832
|
-
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 };
|
|
1992
|
+
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 };
|
|
1833
1993
|
//# sourceMappingURL=index.esm5.js.map
|