@microsoft/teamsfx 0.6.2-rc.0 → 0.6.3-alpha.633d9d21e.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.
@@ -11,10 +11,35 @@ var identity = require('@azure/identity');
11
11
  var botbuilder = require('botbuilder');
12
12
  var botbuilderDialogs = require('botbuilder-dialogs');
13
13
  var uuid = require('uuid');
14
+ var axios = require('axios');
15
+ var https = require('https');
16
+ var path = require('path');
17
+ var fs = require('fs');
14
18
 
15
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
20
 
21
+ function _interopNamespace(e) {
22
+ if (e && e.__esModule) return e;
23
+ var n = Object.create(null);
24
+ if (e) {
25
+ Object.keys(e).forEach(function (k) {
26
+ if (k !== 'default') {
27
+ var d = Object.getOwnPropertyDescriptor(e, k);
28
+ Object.defineProperty(n, k, d.get ? d : {
29
+ enumerable: true,
30
+ get: function () { return e[k]; }
31
+ });
32
+ }
33
+ });
34
+ }
35
+ n["default"] = e;
36
+ return Object.freeze(n);
37
+ }
38
+
17
39
  var jwt_decode__default = /*#__PURE__*/_interopDefaultLegacy(jwt_decode);
40
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
41
+ var path__namespace = /*#__PURE__*/_interopNamespace(path);
42
+ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
18
43
 
19
44
  // Copyright (c) Microsoft Corporation.
20
45
  // Licensed under the MIT license.
@@ -97,6 +122,9 @@ ErrorMessage.FailToAcquireTokenOnBehalfOfUser = "Failed to acquire access token
97
122
  ErrorMessage.OnlyMSTeamsChannelSupported = "{0} is only supported in MS Teams Channel";
98
123
  // IdentityTypeNotSupported Error
99
124
  ErrorMessage.IdentityTypeNotSupported = "{0} identity is not supported in {1}";
125
+ // InvalidParameter Error
126
+ ErrorMessage.EmptyParameter = "Parameter {0} is empty";
127
+ ErrorMessage.DuplicateHttpsOptionProperty = "Axios HTTPS agent already defined value for property {0}";
100
128
  /**
101
129
  * Error class with code and message thrown by the SDK.
102
130
  *
@@ -1416,6 +1444,171 @@ class TeamsBotSsoPrompt extends botbuilderDialogs.Dialog {
1416
1444
  }
1417
1445
  }
1418
1446
 
1447
+ // Copyright (c) Microsoft Corporation.
1448
+ /**
1449
+ * Initializes new Axios instance with specific auth provider
1450
+ *
1451
+ * @param apiEndpoint - Base url of the API
1452
+ * @param authProvider - Auth provider that injects authentication info to each request
1453
+ * @returns axios instance configured with specfic auth provider
1454
+ *
1455
+ * @example
1456
+ * ```typescript
1457
+ * const client = createApiClient("https://my-api-endpoint-base-url", new BasicAuthProvider("xxx","xxx"));
1458
+ * ```
1459
+ *
1460
+ * @beta
1461
+ */
1462
+ function createApiClient(apiEndpoint, authProvider) {
1463
+ // Add a request interceptor
1464
+ const instance = axios__default["default"].create({
1465
+ baseURL: apiEndpoint,
1466
+ });
1467
+ instance.interceptors.request.use(function (config) {
1468
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1469
+ return yield authProvider.AddAuthenticationInfo(config);
1470
+ });
1471
+ });
1472
+ return instance;
1473
+ }
1474
+
1475
+ // Copyright (c) Microsoft Corporation.
1476
+ /**
1477
+ * Provider that handles Bearer Token authentication
1478
+ *
1479
+ * @beta
1480
+ */
1481
+ class BearerTokenAuthProvider {
1482
+ /**
1483
+ * @param getToken Function that returns the content of bearer token used in http request
1484
+ *
1485
+ * @beta
1486
+ */
1487
+ constructor(getToken) {
1488
+ this.getToken = getToken;
1489
+ }
1490
+ /**
1491
+ * Adds authentication info to http requests
1492
+ *
1493
+ * @param config - Contains all the request information and can be updated to include extra authentication info.
1494
+ * Refer https://axios-http.com/docs/req_config for detailed document.
1495
+ *
1496
+ * @beta
1497
+ */
1498
+ AddAuthenticationInfo(config) {
1499
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1500
+ const token = yield this.getToken();
1501
+ if (!config.headers) {
1502
+ config.headers = {};
1503
+ }
1504
+ if (config.headers["Authorization"]) {
1505
+ throw new Error("Authorization header already exists!");
1506
+ }
1507
+ config.headers["Authorization"] = `Bearer ${token}`;
1508
+ return config;
1509
+ });
1510
+ }
1511
+ }
1512
+
1513
+ // Copyright (c) Microsoft Corporation.
1514
+ /**
1515
+ * Provider that handles Certificate authentication
1516
+ *
1517
+ * @beta
1518
+ */
1519
+ class CertificateAuthProvider {
1520
+ /**
1521
+ *
1522
+ * @param { SecureContextOptions } certOption - information about the cert used in http requests
1523
+ *
1524
+ * @beta
1525
+ */
1526
+ constructor(certOption) {
1527
+ if (certOption && Object.keys(certOption).length !== 0) {
1528
+ this.certOption = certOption;
1529
+ }
1530
+ else {
1531
+ throw new ErrorWithCode(formatString(ErrorMessage.EmptyParameter, "certOption"), exports.ErrorCode.InvalidParameter);
1532
+ }
1533
+ }
1534
+ /**
1535
+ * Adds authentication info to http requests.
1536
+ *
1537
+ * @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
1538
+ * Refer https://axios-http.com/docs/req_config for detailed document.
1539
+ *
1540
+ * @returns Updated axios request config.
1541
+ *
1542
+ * @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
1543
+ *
1544
+ * @beta
1545
+ */
1546
+ AddAuthenticationInfo(config) {
1547
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1548
+ if (!config.httpsAgent) {
1549
+ config.httpsAgent = new https.Agent(this.certOption);
1550
+ }
1551
+ else {
1552
+ const existingProperties = new Set(Object.keys(config.httpsAgent.options));
1553
+ for (const property of Object.keys(this.certOption)) {
1554
+ if (existingProperties.has(property)) {
1555
+ throw new ErrorWithCode(formatString(ErrorMessage.DuplicateHttpsOptionProperty, property), exports.ErrorCode.InvalidParameter);
1556
+ }
1557
+ }
1558
+ Object.assign(config.httpsAgent.options, this.certOption);
1559
+ }
1560
+ return config;
1561
+ });
1562
+ }
1563
+ }
1564
+ /**
1565
+ * Helper to create SecureContextOptions from PEM format cert
1566
+ *
1567
+ * @param { string | Buffer } cert - The cert chain in PEM format
1568
+ * @param { string | Buffer } key - The private key for the cert chain
1569
+ * @param { string? } passphrase - The passphrase for private key
1570
+ * @param { string? | Buffer? } ca - Overrides the trusted CA certificates
1571
+ *
1572
+ * @returns Instance of SecureContextOptions
1573
+ *
1574
+ * @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
1575
+ *
1576
+ */
1577
+ function createPemCertOption(cert, key, passphrase, ca) {
1578
+ if (cert.length === 0) {
1579
+ throw new ErrorWithCode(formatString(ErrorMessage.EmptyParameter, "cert"), exports.ErrorCode.InvalidParameter);
1580
+ }
1581
+ if (key.length === 0) {
1582
+ throw new ErrorWithCode(formatString(ErrorMessage.EmptyParameter, "key"), exports.ErrorCode.InvalidParameter);
1583
+ }
1584
+ return {
1585
+ cert,
1586
+ key,
1587
+ passphrase,
1588
+ ca,
1589
+ };
1590
+ }
1591
+ /**
1592
+ * Helper to create SecureContextOptions from PFX format cert
1593
+ *
1594
+ * @param { string | Buffer } pfx - The content of .pfx file
1595
+ * @param { string? } passphrase - Optional. The passphrase of .pfx file
1596
+ *
1597
+ * @returns Instance of SecureContextOptions
1598
+ *
1599
+ * @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
1600
+ *
1601
+ */
1602
+ function createPfxCertOption(pfx, passphrase) {
1603
+ if (pfx.length === 0) {
1604
+ throw new ErrorWithCode(formatString(ErrorMessage.EmptyParameter, "pfx"), exports.ErrorCode.InvalidParameter);
1605
+ }
1606
+ return {
1607
+ pfx,
1608
+ passphrase,
1609
+ };
1610
+ }
1611
+
1419
1612
  // Copyright (c) Microsoft Corporation.
1420
1613
  /**
1421
1614
  * A class providing credential and configuration.
@@ -1602,16 +1795,1039 @@ class TeamsFx {
1602
1795
  }
1603
1796
  }
1604
1797
 
1798
+ // Copyright (c) Microsoft Corporation.
1799
+ /**
1800
+ * @internal
1801
+ */
1802
+ var ActivityType;
1803
+ (function (ActivityType) {
1804
+ ActivityType[ActivityType["CurrentBotInstalled"] = 0] = "CurrentBotInstalled";
1805
+ ActivityType[ActivityType["CurrentBotMessaged"] = 1] = "CurrentBotMessaged";
1806
+ ActivityType[ActivityType["CurrentBotUninstalled"] = 2] = "CurrentBotUninstalled";
1807
+ ActivityType[ActivityType["TeamDeleted"] = 3] = "TeamDeleted";
1808
+ ActivityType[ActivityType["TeamRestored"] = 4] = "TeamRestored";
1809
+ ActivityType[ActivityType["Unknown"] = 5] = "Unknown";
1810
+ })(ActivityType || (ActivityType = {}));
1811
+ /**
1812
+ * @internal
1813
+ */
1814
+ class NotificationMiddleware {
1815
+ constructor(options) {
1816
+ this.conversationReferenceStore = options.conversationReferenceStore;
1817
+ }
1818
+ onTurn(context, next) {
1819
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1820
+ const type = this.classifyActivity(context.activity);
1821
+ switch (type) {
1822
+ case ActivityType.CurrentBotInstalled:
1823
+ case ActivityType.TeamRestored: {
1824
+ const reference = botbuilder.TurnContext.getConversationReference(context.activity);
1825
+ yield this.conversationReferenceStore.set(reference);
1826
+ break;
1827
+ }
1828
+ case ActivityType.CurrentBotMessaged: {
1829
+ const reference = botbuilder.TurnContext.getConversationReference(context.activity);
1830
+ if (!(yield this.conversationReferenceStore.check(reference))) {
1831
+ yield this.conversationReferenceStore.set(reference);
1832
+ }
1833
+ break;
1834
+ }
1835
+ case ActivityType.CurrentBotUninstalled:
1836
+ case ActivityType.TeamDeleted: {
1837
+ const reference = botbuilder.TurnContext.getConversationReference(context.activity);
1838
+ yield this.conversationReferenceStore.delete(reference);
1839
+ break;
1840
+ }
1841
+ }
1842
+ yield next();
1843
+ });
1844
+ }
1845
+ classifyActivity(activity) {
1846
+ var _a, _b;
1847
+ const activityType = activity.type;
1848
+ if (activityType === "installationUpdate") {
1849
+ const action = (_a = activity.action) === null || _a === void 0 ? void 0 : _a.toLowerCase();
1850
+ if (action === "add") {
1851
+ return ActivityType.CurrentBotInstalled;
1852
+ }
1853
+ else {
1854
+ return ActivityType.CurrentBotUninstalled;
1855
+ }
1856
+ }
1857
+ else if (activityType === "message") {
1858
+ return ActivityType.CurrentBotMessaged;
1859
+ }
1860
+ else if (activityType === "conversationUpdate") {
1861
+ const eventType = (_b = activity.channelData) === null || _b === void 0 ? void 0 : _b.eventType;
1862
+ if (eventType === "teamDeleted") {
1863
+ return ActivityType.TeamDeleted;
1864
+ }
1865
+ else if (eventType === "teamRestored") {
1866
+ return ActivityType.TeamRestored;
1867
+ }
1868
+ }
1869
+ return ActivityType.Unknown;
1870
+ }
1871
+ }
1872
+ class CommandResponseMiddleware {
1873
+ constructor(handlers) {
1874
+ this.commandHandlers = [];
1875
+ if (handlers && handlers.length > 0) {
1876
+ this.commandHandlers.push(...handlers);
1877
+ }
1878
+ }
1879
+ onTurn(context, next) {
1880
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1881
+ const type = this.classifyActivity(context.activity);
1882
+ switch (type) {
1883
+ case ActivityType.CurrentBotMessaged:
1884
+ // Invoke corresponding command handler for the command response
1885
+ const commandText = this.getActivityText(context.activity);
1886
+ const message = {
1887
+ text: commandText,
1888
+ };
1889
+ for (const handler of this.commandHandlers) {
1890
+ const matchResult = this.shouldTrigger(handler.triggerPatterns, commandText);
1891
+ // It is important to note that the command bot will stop processing handlers
1892
+ // when the first command handler is matched.
1893
+ if (!!matchResult) {
1894
+ message.matches = Array.isArray(matchResult) ? matchResult : void 0;
1895
+ const response = yield handler.handleCommandReceived(context, message);
1896
+ yield context.sendActivity(response);
1897
+ break;
1898
+ }
1899
+ }
1900
+ break;
1901
+ }
1902
+ yield next();
1903
+ });
1904
+ }
1905
+ classifyActivity(activity) {
1906
+ if (activity.type === botbuilder.ActivityTypes.Message) {
1907
+ return ActivityType.CurrentBotMessaged;
1908
+ }
1909
+ return ActivityType.Unknown;
1910
+ }
1911
+ matchPattern(pattern, text) {
1912
+ if (text) {
1913
+ if (typeof pattern === "string") {
1914
+ const regExp = new RegExp(pattern, "i");
1915
+ return regExp.test(text);
1916
+ }
1917
+ if (pattern instanceof RegExp) {
1918
+ const matches = text.match(pattern);
1919
+ return matches !== null && matches !== void 0 ? matches : false;
1920
+ }
1921
+ }
1922
+ return false;
1923
+ }
1924
+ shouldTrigger(patterns, text) {
1925
+ const expressions = Array.isArray(patterns) ? patterns : [patterns];
1926
+ for (const ex of expressions) {
1927
+ const arg = this.matchPattern(ex, text);
1928
+ if (arg)
1929
+ return arg;
1930
+ }
1931
+ return false;
1932
+ }
1933
+ getActivityText(activity) {
1934
+ let text = activity.text;
1935
+ const removedMentionText = botbuilder.TurnContext.removeRecipientMention(activity);
1936
+ if (removedMentionText) {
1937
+ text = removedMentionText
1938
+ .toLowerCase()
1939
+ .replace(/\n|\r\n/g, "")
1940
+ .trim();
1941
+ }
1942
+ return text;
1943
+ }
1944
+ }
1945
+
1946
+ // Copyright (c) Microsoft Corporation.
1947
+ /**
1948
+ * A command bot for receiving commands and sending responses in Teams.
1949
+ *
1950
+ * @remarks
1951
+ * Ensure each command should ONLY be registered with the command once, otherwise it'll cause unexpected behavior if you register the same command more than once.
1952
+ *
1953
+ * @beta
1954
+ */
1955
+ class CommandBot {
1956
+ /**
1957
+ * Creates a new instance of the `CommandBot`.
1958
+ *
1959
+ * @param adapter The bound `BotFrameworkAdapter`.
1960
+ * @param options - initialize options
1961
+ *
1962
+ * @beta
1963
+ */
1964
+ constructor(adapter, options) {
1965
+ this.middleware = new CommandResponseMiddleware(options === null || options === void 0 ? void 0 : options.commands);
1966
+ this.adapter = adapter.use(this.middleware);
1967
+ }
1968
+ /**
1969
+ * Registers a command into the command bot.
1970
+ *
1971
+ * @param command The command to registered.
1972
+ *
1973
+ * @beta
1974
+ */
1975
+ registerCommand(command) {
1976
+ if (command) {
1977
+ this.middleware.commandHandlers.push(command);
1978
+ }
1979
+ }
1980
+ /**
1981
+ * Registers commands into the command bot.
1982
+ *
1983
+ * @param commands The command to registered.
1984
+ *
1985
+ * @beta
1986
+ */
1987
+ registerCommands(commands) {
1988
+ if (commands) {
1989
+ this.middleware.commandHandlers.push(...commands);
1990
+ }
1991
+ }
1992
+ }
1993
+
1994
+ // Copyright (c) Microsoft Corporation.
1995
+ /**
1996
+ * @internal
1997
+ */
1998
+ class LocalFileStorage {
1999
+ constructor(fileDir) {
2000
+ this.localFileName = ".notification.localstore.json";
2001
+ this.filePath = path__namespace.resolve(fileDir, this.localFileName);
2002
+ }
2003
+ read(key) {
2004
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2005
+ if (!(yield this.storeFileExists())) {
2006
+ return undefined;
2007
+ }
2008
+ const data = yield this.readFromFile();
2009
+ return data[key];
2010
+ });
2011
+ }
2012
+ list() {
2013
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2014
+ if (!(yield this.storeFileExists())) {
2015
+ return [];
2016
+ }
2017
+ const data = yield this.readFromFile();
2018
+ return Object.entries(data).map((entry) => entry[1]);
2019
+ });
2020
+ }
2021
+ write(key, object) {
2022
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2023
+ if (!(yield this.storeFileExists())) {
2024
+ yield this.writeToFile({ [key]: object });
2025
+ return;
2026
+ }
2027
+ const data = yield this.readFromFile();
2028
+ yield this.writeToFile(Object.assign(data, { [key]: object }));
2029
+ });
2030
+ }
2031
+ delete(key) {
2032
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2033
+ if (yield this.storeFileExists()) {
2034
+ const data = yield this.readFromFile();
2035
+ if (data[key] !== undefined) {
2036
+ delete data[key];
2037
+ yield this.writeToFile(data);
2038
+ }
2039
+ }
2040
+ });
2041
+ }
2042
+ storeFileExists() {
2043
+ return new Promise((resolve) => {
2044
+ try {
2045
+ fs__namespace.access(this.filePath, (err) => {
2046
+ if (err) {
2047
+ resolve(false);
2048
+ }
2049
+ else {
2050
+ resolve(true);
2051
+ }
2052
+ });
2053
+ }
2054
+ catch (error) {
2055
+ resolve(false);
2056
+ }
2057
+ });
2058
+ }
2059
+ readFromFile() {
2060
+ return new Promise((resolve, reject) => {
2061
+ try {
2062
+ fs__namespace.readFile(this.filePath, { encoding: "utf-8" }, (err, rawData) => {
2063
+ if (err) {
2064
+ reject(err);
2065
+ }
2066
+ else {
2067
+ resolve(JSON.parse(rawData));
2068
+ }
2069
+ });
2070
+ }
2071
+ catch (error) {
2072
+ reject(error);
2073
+ }
2074
+ });
2075
+ }
2076
+ writeToFile(data) {
2077
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2078
+ return new Promise((resolve, reject) => {
2079
+ try {
2080
+ const rawData = JSON.stringify(data, undefined, 2);
2081
+ fs__namespace.writeFile(this.filePath, rawData, { encoding: "utf-8" }, (err) => {
2082
+ if (err) {
2083
+ reject(err);
2084
+ }
2085
+ else {
2086
+ resolve();
2087
+ }
2088
+ });
2089
+ }
2090
+ catch (error) {
2091
+ reject(error);
2092
+ }
2093
+ });
2094
+ });
2095
+ }
2096
+ }
2097
+ /**
2098
+ * @internal
2099
+ */
2100
+ class ConversationReferenceStore {
2101
+ constructor(storage) {
2102
+ this.storage = storage;
2103
+ }
2104
+ check(reference) {
2105
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2106
+ const ref = yield this.storage.read(this.getKey(reference));
2107
+ return ref !== undefined;
2108
+ });
2109
+ }
2110
+ getAll() {
2111
+ return this.storage.list();
2112
+ }
2113
+ set(reference) {
2114
+ return this.storage.write(this.getKey(reference), reference);
2115
+ }
2116
+ delete(reference) {
2117
+ return this.storage.delete(this.getKey(reference));
2118
+ }
2119
+ getKey(reference) {
2120
+ var _a, _b;
2121
+ return `_${(_a = reference.conversation) === null || _a === void 0 ? void 0 : _a.tenantId}_${(_b = reference.conversation) === null || _b === void 0 ? void 0 : _b.id}`;
2122
+ }
2123
+ }
2124
+
2125
+ // Copyright (c) Microsoft Corporation.
2126
+ // Licensed under the MIT license.
2127
+ /**
2128
+ * @internal
2129
+ */
2130
+ function cloneConversation(conversation) {
2131
+ return Object.assign({}, conversation);
2132
+ }
2133
+ /**
2134
+ * @internal
2135
+ */
2136
+ function getTargetType(conversationReference) {
2137
+ var _a;
2138
+ const conversationType = (_a = conversationReference.conversation) === null || _a === void 0 ? void 0 : _a.conversationType;
2139
+ if (conversationType === "personal") {
2140
+ return "Person";
2141
+ }
2142
+ else if (conversationType === "groupChat") {
2143
+ return "Group";
2144
+ }
2145
+ else if (conversationType === "channel") {
2146
+ return "Channel";
2147
+ }
2148
+ else {
2149
+ return undefined;
2150
+ }
2151
+ }
2152
+ /**
2153
+ * @internal
2154
+ */
2155
+ function getTeamsBotInstallationId(context) {
2156
+ var _a, _b, _c, _d;
2157
+ return (_d = (_c = (_b = (_a = context.activity) === null || _a === void 0 ? void 0 : _a.channelData) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : context.activity.conversation.id;
2158
+ }
2159
+
2160
+ // Copyright (c) Microsoft Corporation.
2161
+ /**
2162
+ * Send a plain text message to a notification target.
2163
+ *
2164
+ * @param target - the notification target.
2165
+ * @param text - the plain text message.
2166
+ * @returns A `Promise` representing the asynchronous operation.
2167
+ *
2168
+ * @beta
2169
+ */
2170
+ function sendMessage(target, text) {
2171
+ return target.sendMessage(text);
2172
+ }
2173
+ /**
2174
+ * Send an adaptive card message to a notification target.
2175
+ *
2176
+ * @param target - the notification target.
2177
+ * @param card - the adaptive card raw JSON.
2178
+ * @returns A `Promise` representing the asynchronous operation.
2179
+ *
2180
+ * @beta
2181
+ */
2182
+ function sendAdaptiveCard(target, card) {
2183
+ return target.sendAdaptiveCard(card);
2184
+ }
2185
+ /**
2186
+ * A {@link NotificationTarget} that represents a team channel.
2187
+ *
2188
+ * @remarks
2189
+ * It's recommended to get channels from {@link TeamsBotInstallation.channels()}.
2190
+ *
2191
+ * @beta
2192
+ */
2193
+ class Channel {
2194
+ /**
2195
+ * Constuctor.
2196
+ *
2197
+ * @remarks
2198
+ * It's recommended to get channels from {@link TeamsBotInstallation.channels()}, instead of using this constructor.
2199
+ *
2200
+ * @param parent - The parent {@link TeamsBotInstallation} where this channel is created from.
2201
+ * @param info - Detailed channel information.
2202
+ *
2203
+ * @beta
2204
+ */
2205
+ constructor(parent, info) {
2206
+ /**
2207
+ * Notification target type. For channel it's always "Channel".
2208
+ *
2209
+ * @beta
2210
+ */
2211
+ this.type = "Channel";
2212
+ this.parent = parent;
2213
+ this.info = info;
2214
+ }
2215
+ /**
2216
+ * Send a plain text message.
2217
+ *
2218
+ * @param text - the plain text message.
2219
+ * @returns A `Promise` representing the asynchronous operation.
2220
+ *
2221
+ * @beta
2222
+ */
2223
+ sendMessage(text) {
2224
+ return this.parent.adapter.continueConversation(this.parent.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2225
+ const conversation = yield this.newConversation(context);
2226
+ yield this.parent.adapter.continueConversation(conversation, (ctx) => tslib.__awaiter(this, void 0, void 0, function* () {
2227
+ yield ctx.sendActivity(text);
2228
+ }));
2229
+ }));
2230
+ }
2231
+ /**
2232
+ * Send an adaptive card message.
2233
+ *
2234
+ * @param card - the adaptive card raw JSON.
2235
+ * @returns A `Promise` representing the asynchronous operation.
2236
+ *
2237
+ * @beta
2238
+ */
2239
+ sendAdaptiveCard(card) {
2240
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2241
+ return this.parent.adapter.continueConversation(this.parent.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2242
+ const conversation = yield this.newConversation(context);
2243
+ yield this.parent.adapter.continueConversation(conversation, (ctx) => tslib.__awaiter(this, void 0, void 0, function* () {
2244
+ yield ctx.sendActivity({
2245
+ attachments: [botbuilder.CardFactory.adaptiveCard(card)],
2246
+ });
2247
+ }));
2248
+ }));
2249
+ });
2250
+ }
2251
+ /**
2252
+ * @internal
2253
+ */
2254
+ newConversation(context) {
2255
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2256
+ const reference = botbuilder.TurnContext.getConversationReference(context.activity);
2257
+ const channelConversation = cloneConversation(reference);
2258
+ channelConversation.conversation.id = this.info.id || "";
2259
+ return channelConversation;
2260
+ });
2261
+ }
2262
+ }
2263
+ /**
2264
+ * A {@link NotificationTarget} that represents a team member.
2265
+ *
2266
+ * @remarks
2267
+ * It's recommended to get members from {@link TeamsBotInstallation.members()}.
2268
+ *
2269
+ * @beta
2270
+ */
2271
+ class Member {
2272
+ /**
2273
+ * Constuctor.
2274
+ *
2275
+ * @remarks
2276
+ * It's recommended to get members from {@link TeamsBotInstallation.members()}, instead of using this constructor.
2277
+ *
2278
+ * @param parent - The parent {@link TeamsBotInstallation} where this member is created from.
2279
+ * @param account - Detailed member account information.
2280
+ *
2281
+ * @beta
2282
+ */
2283
+ constructor(parent, account) {
2284
+ /**
2285
+ * Notification target type. For member it's always "Person".
2286
+ *
2287
+ * @beta
2288
+ */
2289
+ this.type = "Person";
2290
+ this.parent = parent;
2291
+ this.account = account;
2292
+ }
2293
+ /**
2294
+ * Send a plain text message.
2295
+ *
2296
+ * @param text - the plain text message.
2297
+ * @returns A `Promise` representing the asynchronous operation.
2298
+ *
2299
+ * @beta
2300
+ */
2301
+ sendMessage(text) {
2302
+ return this.parent.adapter.continueConversation(this.parent.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2303
+ const conversation = yield this.newConversation(context);
2304
+ yield this.parent.adapter.continueConversation(conversation, (ctx) => tslib.__awaiter(this, void 0, void 0, function* () {
2305
+ yield ctx.sendActivity(text);
2306
+ }));
2307
+ }));
2308
+ }
2309
+ /**
2310
+ * Send an adaptive card message.
2311
+ *
2312
+ * @param card - the adaptive card raw JSON.
2313
+ * @returns A `Promise` representing the asynchronous operation.
2314
+ *
2315
+ * @beta
2316
+ */
2317
+ sendAdaptiveCard(card) {
2318
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2319
+ return this.parent.adapter.continueConversation(this.parent.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2320
+ const conversation = yield this.newConversation(context);
2321
+ yield this.parent.adapter.continueConversation(conversation, (ctx) => tslib.__awaiter(this, void 0, void 0, function* () {
2322
+ yield ctx.sendActivity({
2323
+ attachments: [botbuilder.CardFactory.adaptiveCard(card)],
2324
+ });
2325
+ }));
2326
+ }));
2327
+ });
2328
+ }
2329
+ /**
2330
+ * @internal
2331
+ */
2332
+ newConversation(context) {
2333
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2334
+ const reference = botbuilder.TurnContext.getConversationReference(context.activity);
2335
+ const personalConversation = cloneConversation(reference);
2336
+ const connectorClient = context.turnState.get(this.parent.adapter.ConnectorClientKey);
2337
+ const conversation = yield connectorClient.conversations.createConversation({
2338
+ isGroup: false,
2339
+ tenantId: context.activity.conversation.tenantId,
2340
+ bot: context.activity.recipient,
2341
+ members: [this.account],
2342
+ channelData: {},
2343
+ });
2344
+ personalConversation.conversation.id = conversation.id;
2345
+ return personalConversation;
2346
+ });
2347
+ }
2348
+ }
2349
+ /**
2350
+ * A {@link NotificationTarget} that represents a bot installation. Teams Bot could be installed into
2351
+ * - Personal chat
2352
+ * - Group chat
2353
+ * - Team (by default the `General` channel)
2354
+ *
2355
+ * @remarks
2356
+ * It's recommended to get bot installations from {@link ConversationBot.installations()}.
2357
+ *
2358
+ * @beta
2359
+ */
2360
+ class TeamsBotInstallation {
2361
+ /**
2362
+ * Constructor
2363
+ *
2364
+ * @remarks
2365
+ * It's recommended to get bot installations from {@link ConversationBot.installations()}, instead of using this constructor.
2366
+ *
2367
+ * @param adapter - the bound `BotFrameworkAdapter`.
2368
+ * @param conversationReference - the bound `ConversationReference`.
2369
+ *
2370
+ * @beta
2371
+ */
2372
+ constructor(adapter, conversationReference) {
2373
+ this.adapter = adapter;
2374
+ this.conversationReference = conversationReference;
2375
+ this.type = getTargetType(conversationReference);
2376
+ }
2377
+ /**
2378
+ * Send a plain text message.
2379
+ *
2380
+ * @param text - the plain text message.
2381
+ * @returns A `Promise` representing the asynchronous operation.
2382
+ *
2383
+ * @beta
2384
+ */
2385
+ sendMessage(text) {
2386
+ return this.adapter.continueConversation(this.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2387
+ yield context.sendActivity(text);
2388
+ }));
2389
+ }
2390
+ /**
2391
+ * Send an adaptive card message.
2392
+ *
2393
+ * @param card - the adaptive card raw JSON.
2394
+ * @returns A `Promise` representing the asynchronous operation.
2395
+ *
2396
+ * @beta
2397
+ */
2398
+ sendAdaptiveCard(card) {
2399
+ return this.adapter.continueConversation(this.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2400
+ yield context.sendActivity({
2401
+ attachments: [botbuilder.CardFactory.adaptiveCard(card)],
2402
+ });
2403
+ }));
2404
+ }
2405
+ /**
2406
+ * Get channels from this bot installation.
2407
+ *
2408
+ * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
2409
+ *
2410
+ * @beta
2411
+ */
2412
+ channels() {
2413
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2414
+ let teamsChannels = [];
2415
+ yield this.adapter.continueConversation(this.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2416
+ const teamId = getTeamsBotInstallationId(context);
2417
+ if (teamId !== undefined) {
2418
+ teamsChannels = yield botbuilder.TeamsInfo.getTeamChannels(context, teamId);
2419
+ }
2420
+ }));
2421
+ const channels = [];
2422
+ for (const channel of teamsChannels) {
2423
+ channels.push(new Channel(this, channel));
2424
+ }
2425
+ return channels;
2426
+ });
2427
+ }
2428
+ /**
2429
+ * Get members from this bot installation.
2430
+ *
2431
+ * @returns an array of members from where the bot is installed.
2432
+ *
2433
+ * @beta
2434
+ */
2435
+ members() {
2436
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2437
+ const members = [];
2438
+ yield this.adapter.continueConversation(this.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2439
+ let continuationToken;
2440
+ do {
2441
+ const pagedMembers = yield botbuilder.TeamsInfo.getPagedMembers(context, undefined, continuationToken);
2442
+ continuationToken = pagedMembers.continuationToken;
2443
+ for (const member of pagedMembers.members) {
2444
+ members.push(new Member(this, member));
2445
+ }
2446
+ } while (continuationToken !== undefined);
2447
+ }));
2448
+ return members;
2449
+ });
2450
+ }
2451
+ }
2452
+ /**
2453
+ * Provide utilities to send notification to varies targets (e.g., member, group, channel).
2454
+ *
2455
+ * @beta
2456
+ */
2457
+ class NotificationBot {
2458
+ /**
2459
+ * constructor of the notification bot.
2460
+ *
2461
+ * @remarks
2462
+ * To ensure accuracy, it's recommended to initialize before handling any message.
2463
+ *
2464
+ * @param adapter - the bound `BotFrameworkAdapter`
2465
+ * @param options - initialize options
2466
+ *
2467
+ * @beta
2468
+ */
2469
+ constructor(adapter, options) {
2470
+ var _a, _b;
2471
+ const storage = (_a = options === null || options === void 0 ? void 0 : options.storage) !== null && _a !== void 0 ? _a : new LocalFileStorage(path__namespace.resolve(process.env.RUNNING_ON_AZURE === "1" ? (_b = process.env.TEMP) !== null && _b !== void 0 ? _b : "./" : "./"));
2472
+ this.conversationReferenceStore = new ConversationReferenceStore(storage);
2473
+ this.adapter = adapter.use(new NotificationMiddleware({
2474
+ conversationReferenceStore: this.conversationReferenceStore,
2475
+ }));
2476
+ }
2477
+ /**
2478
+ * Get all targets where the bot is installed.
2479
+ *
2480
+ * @remarks
2481
+ * The result is retrieving from the persisted storage.
2482
+ *
2483
+ * @returns - an array of {@link TeamsBotInstallation}.
2484
+ *
2485
+ * @beta
2486
+ */
2487
+ installations() {
2488
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2489
+ if (this.conversationReferenceStore === undefined || this.adapter === undefined) {
2490
+ throw new Error("NotificationBot has not been initialized.");
2491
+ }
2492
+ const references = (yield this.conversationReferenceStore.getAll()).values();
2493
+ const targets = [];
2494
+ for (const reference of references) {
2495
+ // validate connection
2496
+ let valid = true;
2497
+ this.adapter.continueConversation(reference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
2498
+ try {
2499
+ // try get member to see if the installation is still valid
2500
+ yield botbuilder.TeamsInfo.getPagedMembers(context, 1);
2501
+ }
2502
+ catch (error) {
2503
+ if (error.code === "BotNotInConversationRoster") {
2504
+ valid = false;
2505
+ }
2506
+ }
2507
+ }));
2508
+ if (valid) {
2509
+ targets.push(new TeamsBotInstallation(this.adapter, reference));
2510
+ }
2511
+ else {
2512
+ this.conversationReferenceStore.delete(reference);
2513
+ }
2514
+ }
2515
+ return targets;
2516
+ });
2517
+ }
2518
+ }
2519
+
2520
+ // Copyright (c) Microsoft Corporation.
2521
+ /**
2522
+ * Provide utilities for bot conversation, including:
2523
+ * - handle command and response.
2524
+ * - send notification to varies targets (e.g., member, group, channel).
2525
+ *
2526
+ * @example
2527
+ * For command and response, you can register your commands through the constructor, or use the `registerCommand` and `registerCommands` API to add commands later.
2528
+ *
2529
+ * ```typescript
2530
+ * // register through constructor
2531
+ * const conversationBot = new ConversationBot({
2532
+ * command: {
2533
+ * enabled: true,
2534
+ * commands: [ new HelloWorldCommandHandler() ],
2535
+ * },
2536
+ * });
2537
+ *
2538
+ * // register through `register*` API
2539
+ * conversationBot.command.registerCommand(new HelpCommandHandler());
2540
+ * ```
2541
+ *
2542
+ * For notification, you can enable notification at initialization, then send notifications at any time.
2543
+ *
2544
+ * ```typescript
2545
+ * // enable through constructor
2546
+ * const conversationBot = new ConversationBot({
2547
+ * notification: {
2548
+ * enabled: true,
2549
+ * },
2550
+ * });
2551
+ *
2552
+ * // get all bot installations and send message
2553
+ * for (const target of await conversationBot.notification.installations()) {
2554
+ * await target.sendMessage("Hello Notification");
2555
+ * }
2556
+ *
2557
+ * // alternative - send message to all members
2558
+ * for (const target of await conversationBot.notification.installations()) {
2559
+ * for (const member of await target.members()) {
2560
+ * await member.sendMessage("Hello Notification");
2561
+ * }
2562
+ * }
2563
+ * ```
2564
+ *
2565
+ * @remarks
2566
+ * Set `adapter` in {@link ConversationOptions} to use your own bot adapter.
2567
+ *
2568
+ * For command and response, ensure each command should ONLY be registered with the command once, otherwise it'll cause unexpected behavior if you register the same command more than once.
2569
+ *
2570
+ * For notification, set `notification.storage` in {@link ConversationOptions} to use your own storage implementation.
2571
+ *
2572
+ * @beta
2573
+ */
2574
+ class ConversationBot {
2575
+ /**
2576
+ * Creates new instance of the `ConversationBot`.
2577
+ *
2578
+ * @remarks
2579
+ * It's recommended to create your own adapter and storage for production environment instead of the default one.
2580
+ *
2581
+ * @param options - initialize options
2582
+ *
2583
+ * @beta
2584
+ */
2585
+ constructor(options) {
2586
+ var _a, _b;
2587
+ if (options.adapter) {
2588
+ this.adapter = options.adapter;
2589
+ }
2590
+ else {
2591
+ this.adapter = this.createDefaultAdapter(options.adapterConfig);
2592
+ }
2593
+ if ((_a = options.command) === null || _a === void 0 ? void 0 : _a.enabled) {
2594
+ this.command = new CommandBot(this.adapter, options.command);
2595
+ }
2596
+ if ((_b = options.notification) === null || _b === void 0 ? void 0 : _b.enabled) {
2597
+ this.notification = new NotificationBot(this.adapter, options.notification);
2598
+ }
2599
+ }
2600
+ createDefaultAdapter(adapterConfig) {
2601
+ const adapter = adapterConfig === undefined
2602
+ ? new botbuilder.BotFrameworkAdapter({
2603
+ appId: process.env.BOT_ID,
2604
+ appPassword: process.env.BOT_PASSWORD,
2605
+ })
2606
+ : new botbuilder.BotFrameworkAdapter(adapterConfig);
2607
+ // the default error handler
2608
+ adapter.onTurnError = (context, error) => tslib.__awaiter(this, void 0, void 0, function* () {
2609
+ // This check writes out errors to console.
2610
+ console.error(`[onTurnError] unhandled error: ${error}`);
2611
+ // Send a trace activity, which will be displayed in Bot Framework Emulator
2612
+ yield context.sendTraceActivity("OnTurnError Trace", `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
2613
+ // Send a message to the user
2614
+ yield context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
2615
+ yield context.sendActivity("To continue to run this bot, please fix the bot source code.");
2616
+ });
2617
+ return adapter;
2618
+ }
2619
+ /**
2620
+ * The request handler to integrate with web request.
2621
+ *
2622
+ * @param req - an Express or Restify style request object.
2623
+ * @param res - an Express or Restify style response object.
2624
+ * @param logic - the additional function to handle bot context.
2625
+ *
2626
+ * @example
2627
+ * For example, to use with Restify:
2628
+ * ``` typescript
2629
+ * // The default/empty behavior
2630
+ * server.post("api/messages", conversationBot.requestHandler);
2631
+ *
2632
+ * // Or, add your own logic
2633
+ * server.post("api/messages", async (req, res) => {
2634
+ * await conversationBot.requestHandler(req, res, async (context) => {
2635
+ * // your-own-context-logic
2636
+ * });
2637
+ * });
2638
+ * ```
2639
+ *
2640
+ * @beta
2641
+ */
2642
+ requestHandler(req, res, logic) {
2643
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2644
+ if (logic === undefined) {
2645
+ // create empty logic
2646
+ logic = () => tslib.__awaiter(this, void 0, void 0, function* () { });
2647
+ }
2648
+ yield this.adapter.processActivity(req, res, logic);
2649
+ });
2650
+ }
2651
+ }
2652
+
2653
+ // Copyright (c) Microsoft Corporation.
2654
+ const { AdaptiveCards } = require("@microsoft/adaptivecards-tools");
2655
+ /**
2656
+ * Provides utility method to build bot message with cards that supported in Teams.
2657
+ */
2658
+ class MessageBuilder {
2659
+ /**
2660
+ * Build a bot message activity attached with adaptive card.
2661
+ *
2662
+ * @param getCardData Function to prepare your card data.
2663
+ * @param cardTemplate The adaptive card template.
2664
+ * @returns A bot message activity attached with an adaptive card.
2665
+ *
2666
+ * @example
2667
+ * ```javascript
2668
+ * const cardTemplate = {
2669
+ * type: "AdaptiveCard",
2670
+ * body: [
2671
+ * {
2672
+ * "type": "TextBlock",
2673
+ * "text": "${title}",
2674
+ * "size": "Large"
2675
+ * },
2676
+ * {
2677
+ * "type": "TextBlock",
2678
+ * "text": "${description}"
2679
+ * }],
2680
+ * $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
2681
+ * version: "1.4"
2682
+ * };
2683
+ *
2684
+ * type CardData = {
2685
+ * title: string,
2686
+ * description: string
2687
+ * };
2688
+ * const card = MessageBuilder.attachAdaptiveCard<CardData>(() => {
2689
+ * return {
2690
+ * title: "sample card title",
2691
+ * description: "sample card description"
2692
+ * }}, cardTemplate);
2693
+ * ```
2694
+ *
2695
+ * @beta
2696
+ */
2697
+ static attachAdaptiveCard(getCardData, cardTemplate) {
2698
+ const cardData = getCardData();
2699
+ return {
2700
+ attachments: [botbuilder.CardFactory.adaptiveCard(AdaptiveCards.declare(cardTemplate).render(cardData))],
2701
+ };
2702
+ }
2703
+ /**
2704
+ * Build a bot message activity attached with an adaptive card.
2705
+ *
2706
+ * @param card The adaptive card content.
2707
+ * @returns A bot message activity attached with an adaptive card.
2708
+ *
2709
+ * @beta
2710
+ */
2711
+ static attachAdaptiveCardWithoutData(card) {
2712
+ return {
2713
+ attachments: [botbuilder.CardFactory.adaptiveCard(AdaptiveCards.declareWithoutData(card).render())],
2714
+ };
2715
+ }
2716
+ /**
2717
+ * Build a bot message activity attached with an hero card.
2718
+ *
2719
+ * @param title The card title.
2720
+ * @param images Optional. The array of images to include on the card.
2721
+ * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array
2722
+ * is converted to an `imBack` button with a title and value set to the value of the string.
2723
+ * @param other Optional. Any additional properties to include on the card.
2724
+ *
2725
+ * @returns A bot message activity attached with a hero card.
2726
+ *
2727
+ * @example
2728
+ * ```javascript
2729
+ * const message = MessageBuilder.attachHeroCard(
2730
+ * 'sample title',
2731
+ * ['https://example.com/sample.jpg'],
2732
+ * ['action']
2733
+ * );
2734
+ * ```
2735
+ *
2736
+ * @beta
2737
+ */
2738
+ static attachHeroCard(title, images, buttons, other) {
2739
+ return MessageBuilder.attachContent(botbuilder.CardFactory.heroCard(title, images, buttons, other));
2740
+ }
2741
+ /**
2742
+ * Returns an attachment for a sign-in card.
2743
+ *
2744
+ * @param title The title for the card's sign-in button.
2745
+ * @param url The URL of the sign-in page to use.
2746
+ * @param text Optional. Additional text to include on the card.
2747
+ *
2748
+ * @returns A bot message activity attached with a sign-in card.
2749
+ *
2750
+ * @remarks
2751
+ * For channels that don't natively support sign-in cards, an alternative message is rendered.
2752
+ *
2753
+ * @beta
2754
+ */
2755
+ static attachSigninCard(title, url, text) {
2756
+ return MessageBuilder.attachContent(botbuilder.CardFactory.signinCard(title, url, text));
2757
+ }
2758
+ /**
2759
+ * Build a bot message activity attached with an Office 365 connector card.
2760
+ *
2761
+ * @param card A description of the Office 365 connector card.
2762
+ * @returns A bot message activity attached with an Office 365 connector card.
2763
+ *
2764
+ * @beta
2765
+ */
2766
+ static attachO365ConnectorCard(card) {
2767
+ return MessageBuilder.attachContent(botbuilder.CardFactory.o365ConnectorCard(card));
2768
+ }
2769
+ /**
2770
+ * Build a message activity attached with a receipt card.
2771
+ * @param card A description of the receipt card.
2772
+ * @returns A message activity attached with a receipt card.
2773
+ *
2774
+ * @beta
2775
+ */
2776
+ static AttachReceiptCard(card) {
2777
+ return MessageBuilder.attachContent(botbuilder.CardFactory.receiptCard(card));
2778
+ }
2779
+ /**
2780
+ *
2781
+ * @param title The card title.
2782
+ * @param images Optional. The array of images to include on the card.
2783
+ * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array
2784
+ * is converted to an `imBack` button with a title and value set to the value of the string.
2785
+ * @param other Optional. Any additional properties to include on the card.
2786
+ * @returns A message activity attached with a thumbnail card
2787
+ *
2788
+ * @beta
2789
+ */
2790
+ static attachThumbnailCard(title, images, buttons, other) {
2791
+ return MessageBuilder.attachContent(botbuilder.CardFactory.thumbnailCard(title, images, buttons, other));
2792
+ }
2793
+ /**
2794
+ * Add an attachement to a bot activity.
2795
+ * @param attachement The attachment object to attach.
2796
+ * @returns A message activity with an attachment.
2797
+ *
2798
+ * @beta
2799
+ */
2800
+ static attachContent(attachement) {
2801
+ return {
2802
+ attachments: [attachement],
2803
+ };
2804
+ }
2805
+ }
2806
+
1605
2807
  exports.AppCredential = AppCredential;
2808
+ exports.BearerTokenAuthProvider = BearerTokenAuthProvider;
2809
+ exports.CertificateAuthProvider = CertificateAuthProvider;
2810
+ exports.Channel = Channel;
2811
+ exports.CommandBot = CommandBot;
2812
+ exports.ConversationBot = ConversationBot;
1606
2813
  exports.ErrorWithCode = ErrorWithCode;
2814
+ exports.Member = Member;
2815
+ exports.MessageBuilder = MessageBuilder;
1607
2816
  exports.MsGraphAuthProvider = MsGraphAuthProvider;
2817
+ exports.NotificationBot = NotificationBot;
1608
2818
  exports.OnBehalfOfUserCredential = OnBehalfOfUserCredential;
2819
+ exports.TeamsBotInstallation = TeamsBotInstallation;
1609
2820
  exports.TeamsBotSsoPrompt = TeamsBotSsoPrompt;
1610
2821
  exports.TeamsFx = TeamsFx;
1611
2822
  exports.TeamsUserCredential = TeamsUserCredential;
2823
+ exports.createApiClient = createApiClient;
1612
2824
  exports.createMicrosoftGraphClient = createMicrosoftGraphClient;
2825
+ exports.createPemCertOption = createPemCertOption;
2826
+ exports.createPfxCertOption = createPfxCertOption;
1613
2827
  exports.getLogLevel = getLogLevel;
1614
2828
  exports.getTediousConnectionConfig = getTediousConnectionConfig;
2829
+ exports.sendAdaptiveCard = sendAdaptiveCard;
2830
+ exports.sendMessage = sendMessage;
1615
2831
  exports.setLogFunction = setLogFunction;
1616
2832
  exports.setLogLevel = setLogLevel;
1617
2833
  exports.setLogger = setLogger;