@microsoft/teams-js 2.0.0-beta.4-dev.18 → 2.0.0-beta.4-dev.21

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.
@@ -1063,10 +1063,10 @@ __webpack_require__.d(__webpack_exports__, {
1063
1063
  "appInitialization": () => (/* reexport */ appInitialization),
1064
1064
  "appInstallDialog": () => (/* reexport */ appInstallDialog),
1065
1065
  "authentication": () => (/* reexport */ authentication),
1066
- "bot": () => (/* reexport */ bot),
1067
1066
  "calendar": () => (/* reexport */ calendar),
1068
1067
  "call": () => (/* reexport */ call),
1069
1068
  "chat": () => (/* reexport */ chat),
1069
+ "conversation": () => (/* reexport */ conversation),
1070
1070
  "dialog": () => (/* reexport */ dialog),
1071
1071
  "enablePrintCapability": () => (/* reexport */ enablePrintCapability),
1072
1072
  "executeDeepLink": () => (/* reexport */ executeDeepLink),
@@ -1121,7 +1121,7 @@ __webpack_require__.d(__webpack_exports__, {
1121
1121
  });
1122
1122
 
1123
1123
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1124
- var version = "2.0.0-beta.4-dev.18";
1124
+ var version = "2.0.0-beta.4-dev.21";
1125
1125
  /**
1126
1126
  * @hidden
1127
1127
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -1809,137 +1809,6 @@ function processAdditionalValidOrigins(validMessageOrigins) {
1809
1809
  GlobalVars.additionalValidOrigins = combinedOriginUrls;
1810
1810
  }
1811
1811
 
1812
- ;// CONCATENATED MODULE: ./src/public/runtime.ts
1813
- /* eslint-disable @typescript-eslint/ban-types */
1814
-
1815
- var runtime = {
1816
- apiVersion: 1,
1817
- supports: {
1818
- appInstallDialog: undefined,
1819
- bot: undefined,
1820
- calendar: undefined,
1821
- call: undefined,
1822
- chat: {
1823
- conversation: undefined,
1824
- },
1825
- dialog: {
1826
- bot: undefined,
1827
- update: undefined,
1828
- },
1829
- location: undefined,
1830
- logs: undefined,
1831
- mail: undefined,
1832
- media: undefined,
1833
- meeting: undefined,
1834
- meetingRoom: undefined,
1835
- menus: undefined,
1836
- monetization: undefined,
1837
- notifications: undefined,
1838
- pages: {
1839
- appButton: undefined,
1840
- tabs: undefined,
1841
- config: undefined,
1842
- backStack: undefined,
1843
- fullTrust: undefined,
1844
- },
1845
- people: undefined,
1846
- remoteCamera: undefined,
1847
- sharing: undefined,
1848
- teams: {
1849
- fullTrust: undefined,
1850
- },
1851
- teamsCore: undefined,
1852
- video: undefined,
1853
- },
1854
- };
1855
- var teamsRuntimeConfig = {
1856
- apiVersion: 1,
1857
- isLegacyTeams: true,
1858
- supports: {
1859
- appInstallDialog: {},
1860
- appEntity: {},
1861
- bot: {},
1862
- call: {},
1863
- chat: {
1864
- conversation: {},
1865
- },
1866
- dialog: {
1867
- bot: {},
1868
- update: {},
1869
- },
1870
- files: {},
1871
- location: {},
1872
- logs: {},
1873
- media: {},
1874
- meeting: {},
1875
- meetingRoom: {},
1876
- menus: {},
1877
- monetization: {},
1878
- notifications: {},
1879
- pages: {
1880
- appButton: {},
1881
- tabs: {},
1882
- config: {},
1883
- backStack: {},
1884
- fullTrust: {},
1885
- },
1886
- people: {},
1887
- remoteCamera: {},
1888
- sharing: {},
1889
- teams: {
1890
- fullTrust: {},
1891
- },
1892
- teamsCore: {},
1893
- video: {},
1894
- },
1895
- };
1896
- function applyRuntimeConfig(runtimeConfig) {
1897
- runtime = deepFreeze(runtimeConfig);
1898
- }
1899
-
1900
- ;// CONCATENATED MODULE: ./src/private/logs.ts
1901
-
1902
-
1903
-
1904
-
1905
- /**
1906
- * @hidden
1907
- * Namespace to interact with the logging part of the SDK.
1908
- * This object is used to send the app logs on demand to the host client
1909
- *
1910
- * Hide from docs
1911
- *
1912
- * @internal
1913
- */
1914
- var logs;
1915
- (function (logs) {
1916
- /**
1917
- * @hidden
1918
- * Hide from docs
1919
- * ------
1920
- * Registers a handler for getting app log
1921
- *
1922
- * @param handler - The handler to invoke to get the app log
1923
- */
1924
- function registerGetLogHandler(handler) {
1925
- ensureInitialized();
1926
- if (handler) {
1927
- registerHandler('log.request', function () {
1928
- var log = handler();
1929
- sendMessageToParent('log.receive', [log]);
1930
- });
1931
- }
1932
- else {
1933
- removeHandler('log.request');
1934
- }
1935
- }
1936
- logs.registerGetLogHandler = registerGetLogHandler;
1937
- function isSupported() {
1938
- return runtime.supports.logs ? true : false;
1939
- }
1940
- logs.isSupported = isSupported;
1941
- })(logs || (logs = {}));
1942
-
1943
1812
  ;// CONCATENATED MODULE: ./src/private/privateAPIs.ts
1944
1813
  /* eslint-disable @typescript-eslint/no-explicit-any */
1945
1814
 
@@ -1950,7 +1819,7 @@ var logs;
1950
1819
  * @internal
1951
1820
  */
1952
1821
  function initializePrivateApis() {
1953
- //Keeping this API for any future usage, wherein privateAPIs need to be initialized
1822
+ // To maintain backwards compatability, this function cannot be deleted as it is callable
1954
1823
  }
1955
1824
  /**
1956
1825
  * @hidden
@@ -2420,6 +2289,170 @@ var authentication;
2420
2289
  }
2421
2290
  })(authentication || (authentication = {}));
2422
2291
 
2292
+ ;// CONCATENATED MODULE: ./src/public/runtime.ts
2293
+ /* eslint-disable @typescript-eslint/ban-types */
2294
+ var __assign = (undefined && undefined.__assign) || function () {
2295
+ __assign = Object.assign || function(t) {
2296
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2297
+ s = arguments[i];
2298
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2299
+ t[p] = s[p];
2300
+ }
2301
+ return t;
2302
+ };
2303
+ return __assign.apply(this, arguments);
2304
+ };
2305
+
2306
+
2307
+
2308
+ var runtime = {
2309
+ apiVersion: 1,
2310
+ supports: {
2311
+ appInstallDialog: undefined,
2312
+ calendar: undefined,
2313
+ call: undefined,
2314
+ chat: {
2315
+ conversation: undefined,
2316
+ },
2317
+ dialog: {
2318
+ bot: undefined,
2319
+ update: undefined,
2320
+ },
2321
+ location: undefined,
2322
+ logs: undefined,
2323
+ mail: undefined,
2324
+ media: undefined,
2325
+ meeting: undefined,
2326
+ meetingRoom: undefined,
2327
+ menus: undefined,
2328
+ monetization: undefined,
2329
+ notifications: undefined,
2330
+ pages: {
2331
+ appButton: undefined,
2332
+ tabs: undefined,
2333
+ config: undefined,
2334
+ backStack: undefined,
2335
+ fullTrust: undefined,
2336
+ },
2337
+ people: undefined,
2338
+ remoteCamera: undefined,
2339
+ sharing: undefined,
2340
+ teams: {
2341
+ fullTrust: {
2342
+ joinedTeams: undefined,
2343
+ },
2344
+ },
2345
+ teamsCore: undefined,
2346
+ video: undefined,
2347
+ },
2348
+ };
2349
+ var teamsRuntimeConfig = {
2350
+ apiVersion: 1,
2351
+ isLegacyTeams: true,
2352
+ supports: {
2353
+ appInstallDialog: {},
2354
+ appEntity: {},
2355
+ call: {},
2356
+ chat: {
2357
+ conversation: {},
2358
+ },
2359
+ dialog: {
2360
+ bot: {},
2361
+ update: {},
2362
+ },
2363
+ files: {},
2364
+ logs: {},
2365
+ media: {},
2366
+ meeting: {},
2367
+ meetingRoom: {},
2368
+ menus: {},
2369
+ monetization: {},
2370
+ notifications: {},
2371
+ pages: {
2372
+ appButton: {},
2373
+ tabs: {},
2374
+ config: {},
2375
+ backStack: {},
2376
+ fullTrust: {},
2377
+ },
2378
+ remoteCamera: {},
2379
+ sharing: {},
2380
+ teams: {
2381
+ fullTrust: {},
2382
+ },
2383
+ teamsCore: {},
2384
+ video: {},
2385
+ },
2386
+ };
2387
+ var v1HostClientTypes = [
2388
+ HostClientType.desktop,
2389
+ HostClientType.web,
2390
+ HostClientType.android,
2391
+ HostClientType.ios,
2392
+ HostClientType.rigel,
2393
+ HostClientType.surfaceHub,
2394
+ HostClientType.teamsRoomsWindows,
2395
+ HostClientType.teamsRoomsAndroid,
2396
+ HostClientType.teamsPhones,
2397
+ HostClientType.teamsDisplays,
2398
+ ];
2399
+ var versionConstants = {
2400
+ '1.9.0': [
2401
+ {
2402
+ capability: { location: {} },
2403
+ hostClientTypes: v1HostClientTypes,
2404
+ },
2405
+ ],
2406
+ '2.0.0': [
2407
+ {
2408
+ capability: { people: {} },
2409
+ hostClientTypes: v1HostClientTypes,
2410
+ },
2411
+ ],
2412
+ '2.0.1': [
2413
+ {
2414
+ capability: { teams: { fullTrust: { joinedTeams: {} } } },
2415
+ hostClientTypes: [
2416
+ HostClientType.android,
2417
+ HostClientType.teamsRoomsAndroid,
2418
+ HostClientType.teamsPhones,
2419
+ HostClientType.teamsDisplays,
2420
+ ],
2421
+ },
2422
+ ],
2423
+ };
2424
+ /**
2425
+ * @internal
2426
+ *
2427
+ * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version
2428
+ * and do not provide their own runtime config. Their supported capabilities are based on the highest
2429
+ * client SDK version that they can support.
2430
+ *
2431
+ * @param highestSupportedVersion - The highest client SDK version that the host client can support.
2432
+ * @returns runtime which describes the APIs supported by the legacy host client.
2433
+ */
2434
+ function generateBackCompatRuntimeConfig(highestSupportedVersion) {
2435
+ var newSupports = __assign({}, teamsRuntimeConfig.supports);
2436
+ Object.keys(versionConstants).forEach(function (versionNumber) {
2437
+ if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {
2438
+ versionConstants[versionNumber].forEach(function (capabilityReqs) {
2439
+ if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2440
+ newSupports = __assign(__assign({}, newSupports), capabilityReqs.capability);
2441
+ }
2442
+ });
2443
+ }
2444
+ });
2445
+ var backCompatRuntimeConfig = {
2446
+ apiVersion: 1,
2447
+ isLegacyTeams: true,
2448
+ supports: newSupports,
2449
+ };
2450
+ return backCompatRuntimeConfig;
2451
+ }
2452
+ function applyRuntimeConfig(runtimeConfig) {
2453
+ runtime = deepFreeze(runtimeConfig);
2454
+ }
2455
+
2423
2456
  ;// CONCATENATED MODULE: ./src/public/menus.ts
2424
2457
 
2425
2458
 
@@ -2745,7 +2778,7 @@ var app_app;
2745
2778
  }
2746
2779
  catch (e) {
2747
2780
  if (e instanceof SyntaxError) {
2748
- applyRuntimeConfig(teamsRuntimeConfig);
2781
+ applyRuntimeConfig(generateBackCompatRuntimeConfig(GlobalVars.clientSupportedSDKVersion));
2749
2782
  }
2750
2783
  else {
2751
2784
  throw e;
@@ -4009,89 +4042,48 @@ function createMessageEvent(func, args) {
4009
4042
  };
4010
4043
  }
4011
4044
 
4012
- ;// CONCATENATED MODULE: ./src/private/bot.ts
4013
- /* eslint-disable @typescript-eslint/no-explicit-any */
4045
+ ;// CONCATENATED MODULE: ./src/private/logs.ts
4046
+
4014
4047
 
4015
4048
 
4016
4049
 
4017
4050
  /**
4018
4051
  * @hidden
4019
- * Namespace to interact with bots using the SDK.
4052
+ * Namespace to interact with the logging part of the SDK.
4053
+ * This object is used to send the app logs on demand to the host client
4020
4054
  *
4021
- * @alpha
4055
+ * Hide from docs
4056
+ *
4057
+ * @internal
4022
4058
  */
4023
- var bot;
4024
- (function (bot) {
4059
+ var logs;
4060
+ (function (logs) {
4025
4061
  /**
4026
4062
  * @hidden
4027
- * Hide from docs until release.
4063
+ * Hide from docs
4028
4064
  * ------
4029
- * Sends query to bot in order to retrieve data.
4030
- *
4031
- * @param botRequest - query to send to bot.
4032
- * @param onSuccess - callback to invoke when data is retrieved from bot
4033
- * @param onError - callback to invoke should an error occur
4034
- */
4035
- function sendQuery(botRequest, onSuccess, onError) {
4036
- ensureInitialized();
4037
- sendMessageToParent('bot.executeQuery', [botRequest], function (success, response) {
4038
- if (success) {
4039
- onSuccess(response);
4040
- }
4041
- else {
4042
- onError(response);
4043
- }
4044
- });
4045
- }
4046
- bot.sendQuery = sendQuery;
4047
- /**
4048
- * @hidden
4049
- * Hide from docs until release.
4050
- * -----
4051
- * Retrieves list of support commands from bot
4052
- *
4053
- * @param onSuccess - callback to invoke when data is retrieved from bot
4054
- * @param onError - callback to invoke should an error occur
4055
- */
4056
- function getSupportedCommands(onSuccess, onError) {
4057
- ensureInitialized();
4058
- sendMessageToParent('bot.getSupportedCommands', function (success, response) {
4059
- if (success) {
4060
- onSuccess(response);
4061
- }
4062
- else {
4063
- onError(response);
4064
- }
4065
- });
4066
- }
4067
- bot.getSupportedCommands = getSupportedCommands;
4068
- /**
4069
- * @hidden
4070
- * Hide from docs until release.
4071
- * -----
4072
- * Authenticates a user for json tab
4065
+ * Registers a handler for getting app log
4073
4066
  *
4074
- * @param authRequest - callback to invoke when data is retrieved from bot
4075
- * @param onSuccess - callback to invoke when user is authenticated
4076
- * @param onError - callback to invoke should an error occur
4067
+ * @param handler - The handler to invoke to get the app log
4077
4068
  */
4078
- function authenticate(authRequest, onSuccess, onError) {
4069
+ function registerGetLogHandler(handler) {
4079
4070
  ensureInitialized();
4080
- sendMessageToParent('bot.authenticate', [authRequest], function (success, response) {
4081
- if (success) {
4082
- onSuccess(response);
4083
- }
4084
- else {
4085
- onError(response);
4086
- }
4087
- });
4071
+ if (handler) {
4072
+ registerHandler('log.request', function () {
4073
+ var log = handler();
4074
+ sendMessageToParent('log.receive', [log]);
4075
+ });
4076
+ }
4077
+ else {
4078
+ removeHandler('log.request');
4079
+ }
4088
4080
  }
4089
- bot.authenticate = authenticate;
4081
+ logs.registerGetLogHandler = registerGetLogHandler;
4090
4082
  function isSupported() {
4091
- return runtime.supports.bot ? true : false;
4083
+ return runtime.supports.logs ? true : false;
4092
4084
  }
4093
- bot.isSupported = isSupported;
4094
- })(bot || (bot = {}));
4085
+ logs.isSupported = isSupported;
4086
+ })(logs || (logs = {}));
4095
4087
 
4096
4088
  ;// CONCATENATED MODULE: ./src/private/interfaces.ts
4097
4089
  /**
@@ -4135,7 +4127,7 @@ var UserSettingTypes;
4135
4127
  UserSettingTypes["theme"] = "theme";
4136
4128
  })(UserSettingTypes || (UserSettingTypes = {}));
4137
4129
 
4138
- ;// CONCATENATED MODULE: ./src/private/chat.ts
4130
+ ;// CONCATENATED MODULE: ./src/private/conversation.ts
4139
4131
 
4140
4132
 
4141
4133
 
@@ -4147,66 +4139,63 @@ var UserSettingTypes;
4147
4139
  *
4148
4140
  * @alpha
4149
4141
  */
4150
- var chat;
4151
- (function (chat) {
4142
+ var conversation;
4143
+ (function (conversation) {
4152
4144
  /**
4153
4145
  * @hidden
4154
4146
  * Hide from docs
4155
4147
  * --------------
4156
- * Allows the user to open a chat with a single user and allows
4157
- * for the user to specify the message they wish to send.
4158
- *
4159
- *@param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
4148
+ * Allows the user to start or continue a conversation with each subentity inside the tab
4160
4149
  *
4161
4150
  * @returns Promise resolved upon completion
4162
4151
  */
4163
- function openChat(openChatRequest) {
4152
+ function openConversation(openConversationRequest) {
4164
4153
  return new Promise(function (resolve) {
4165
4154
  ensureInitialized(FrameContexts.content);
4166
- var sendPromise = sendAndHandleStatusAndReason('chat.openChat', {
4167
- members: openChatRequest.user,
4168
- message: openChatRequest.message,
4155
+ var sendPromise = sendAndHandleStatusAndReason('conversations.openConversation', {
4156
+ title: openConversationRequest.title,
4157
+ subEntityId: openConversationRequest.subEntityId,
4158
+ conversationId: openConversationRequest.conversationId,
4159
+ channelId: openConversationRequest.channelId,
4160
+ entityId: openConversationRequest.entityId,
4169
4161
  });
4162
+ if (openConversationRequest.onStartConversation) {
4163
+ registerHandler('startConversation', function (subEntityId, conversationId, channelId, entityId) {
4164
+ return openConversationRequest.onStartConversation({
4165
+ subEntityId: subEntityId,
4166
+ conversationId: conversationId,
4167
+ channelId: channelId,
4168
+ entityId: entityId,
4169
+ });
4170
+ });
4171
+ }
4172
+ if (openConversationRequest.onCloseConversation) {
4173
+ registerHandler('closeConversation', function (subEntityId, conversationId, channelId, entityId) {
4174
+ return openConversationRequest.onCloseConversation({
4175
+ subEntityId: subEntityId,
4176
+ conversationId: conversationId,
4177
+ channelId: channelId,
4178
+ entityId: entityId,
4179
+ });
4180
+ });
4181
+ }
4170
4182
  resolve(sendPromise);
4171
4183
  });
4172
4184
  }
4173
- chat.openChat = openChat;
4185
+ conversation.openConversation = openConversation;
4174
4186
  /**
4175
4187
  * @hidden
4176
4188
  * Hide from docs
4177
4189
  * --------------
4178
- * Allows the user to create a chat with multiple users (2+) and allows
4179
- * for the user to specify a message and name the topic of the conversation. If
4180
- * only 1 user is provided into users array default back to origin openChat.
4181
- *
4182
- * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).
4183
- *
4184
- * @returns Promise resolved upon completion
4190
+ * Allows the user to close the conversation in the right pane
4185
4191
  */
4186
- function openGroupChat(openChatRequest) {
4187
- return new Promise(function (resolve) {
4188
- if (openChatRequest.users.length < 1) {
4189
- throw Error('OpenGroupChat Failed: No users specified');
4190
- }
4191
- if (openChatRequest.users.length === 1) {
4192
- var chatRequest = {
4193
- user: openChatRequest.users[0],
4194
- message: openChatRequest.message,
4195
- };
4196
- openChat(chatRequest);
4197
- }
4198
- else {
4199
- ensureInitialized(FrameContexts.content);
4200
- var sendPromise = sendAndHandleStatusAndReason('chat.openChat', {
4201
- members: openChatRequest.users,
4202
- message: openChatRequest.message,
4203
- topic: openChatRequest.topic,
4204
- });
4205
- resolve(sendPromise);
4206
- }
4207
- });
4192
+ function closeConversation() {
4193
+ ensureInitialized(FrameContexts.content);
4194
+ sendMessageToParent('conversations.closeConversation');
4195
+ removeHandler('startConversation');
4196
+ removeHandler('closeConversation');
4208
4197
  }
4209
- chat.openGroupChat = openGroupChat;
4198
+ conversation.closeConversation = closeConversation;
4210
4199
  /**
4211
4200
  * @hidden
4212
4201
  * Hide from docs
@@ -4225,74 +4214,12 @@ var chat;
4225
4214
  resolve(sendAndUnwrap('getChatMembers'));
4226
4215
  });
4227
4216
  }
4228
- chat.getChatMembers = getChatMembers;
4217
+ conversation.getChatMembers = getChatMembers;
4229
4218
  function isSupported() {
4230
- return runtime.supports.chat ? true : false;
4219
+ return runtime.supports.chat.conversation ? true : false;
4231
4220
  }
4232
- chat.isSupported = isSupported;
4233
- var conversation;
4234
- (function (conversation) {
4235
- /**
4236
- * @hidden
4237
- * Hide from docs
4238
- * --------------
4239
- * Allows the user to start or continue a conversation with each subentity inside the tab
4240
- *
4241
- * @returns Promise resolved upon completion
4242
- */
4243
- function openConversation(openConversationRequest) {
4244
- return new Promise(function (resolve) {
4245
- ensureInitialized(FrameContexts.content);
4246
- var sendPromise = sendAndHandleStatusAndReason('conversations.openConversation', {
4247
- title: openConversationRequest.title,
4248
- subEntityId: openConversationRequest.subEntityId,
4249
- conversationId: openConversationRequest.conversationId,
4250
- channelId: openConversationRequest.channelId,
4251
- entityId: openConversationRequest.entityId,
4252
- });
4253
- if (openConversationRequest.onStartConversation) {
4254
- registerHandler('startConversation', function (subEntityId, conversationId, channelId, entityId) {
4255
- return openConversationRequest.onStartConversation({
4256
- subEntityId: subEntityId,
4257
- conversationId: conversationId,
4258
- channelId: channelId,
4259
- entityId: entityId,
4260
- });
4261
- });
4262
- }
4263
- if (openConversationRequest.onCloseConversation) {
4264
- registerHandler('closeConversation', function (subEntityId, conversationId, channelId, entityId) {
4265
- return openConversationRequest.onCloseConversation({
4266
- subEntityId: subEntityId,
4267
- conversationId: conversationId,
4268
- channelId: channelId,
4269
- entityId: entityId,
4270
- });
4271
- });
4272
- }
4273
- resolve(sendPromise);
4274
- });
4275
- }
4276
- conversation.openConversation = openConversation;
4277
- /**
4278
- * @hidden
4279
- * Hide from docs
4280
- * --------------
4281
- * Allows the user to close the conversation in the right pane
4282
- */
4283
- function closeConversation() {
4284
- ensureInitialized(FrameContexts.content);
4285
- sendMessageToParent('conversations.closeConversation');
4286
- removeHandler('startConversation');
4287
- removeHandler('closeConversation');
4288
- }
4289
- conversation.closeConversation = closeConversation;
4290
- function isSupported() {
4291
- return runtime.supports.chat.conversation ? true : false;
4292
- }
4293
- conversation.isSupported = isSupported;
4294
- })(conversation = chat.conversation || (chat.conversation = {}));
4295
- })(chat || (chat = {}));
4221
+ conversation.isSupported = isSupported;
4222
+ })(conversation || (conversation = {}));
4296
4223
 
4297
4224
  ;// CONCATENATED MODULE: ./src/public/appInstallDialog.ts
4298
4225
 
@@ -4321,6 +4248,83 @@ var appInstallDialog;
4321
4248
  appInstallDialog.isSupported = isSupported;
4322
4249
  })(appInstallDialog || (appInstallDialog = {}));
4323
4250
 
4251
+ ;// CONCATENATED MODULE: ./src/public/chat.ts
4252
+
4253
+
4254
+
4255
+
4256
+ /**
4257
+ * @hidden
4258
+ * Namespace to interact with the conversational subEntities inside the tab
4259
+ *
4260
+ * @alpha
4261
+ */
4262
+ var chat;
4263
+ (function (chat) {
4264
+ /**
4265
+ * @hidden
4266
+ * Hide from docs
4267
+ * --------------
4268
+ * Allows the user to open a chat with a single user and allows
4269
+ * for the user to specify the message they wish to send.
4270
+ *
4271
+ *@param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
4272
+ *
4273
+ * @returns Promise resolved upon completion
4274
+ */
4275
+ function openChat(openChatRequest) {
4276
+ return new Promise(function (resolve) {
4277
+ ensureInitialized(FrameContexts.content);
4278
+ var sendPromise = sendAndHandleStatusAndReason('chat.openChat', {
4279
+ members: openChatRequest.user,
4280
+ message: openChatRequest.message,
4281
+ });
4282
+ resolve(sendPromise);
4283
+ });
4284
+ }
4285
+ chat.openChat = openChat;
4286
+ /**
4287
+ * @hidden
4288
+ * Hide from docs
4289
+ * --------------
4290
+ * Allows the user to create a chat with multiple users (2+) and allows
4291
+ * for the user to specify a message and name the topic of the conversation. If
4292
+ * only 1 user is provided into users array default back to origin openChat.
4293
+ *
4294
+ * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).
4295
+ *
4296
+ * @returns Promise resolved upon completion
4297
+ */
4298
+ function openGroupChat(openChatRequest) {
4299
+ return new Promise(function (resolve) {
4300
+ if (openChatRequest.users.length < 1) {
4301
+ throw Error('OpenGroupChat Failed: No users specified');
4302
+ }
4303
+ if (openChatRequest.users.length === 1) {
4304
+ var chatRequest = {
4305
+ user: openChatRequest.users[0],
4306
+ message: openChatRequest.message,
4307
+ };
4308
+ openChat(chatRequest);
4309
+ }
4310
+ else {
4311
+ ensureInitialized(FrameContexts.content);
4312
+ var sendPromise = sendAndHandleStatusAndReason('chat.openChat', {
4313
+ members: openChatRequest.users,
4314
+ message: openChatRequest.message,
4315
+ topic: openChatRequest.topic,
4316
+ });
4317
+ resolve(sendPromise);
4318
+ }
4319
+ });
4320
+ }
4321
+ chat.openGroupChat = openGroupChat;
4322
+ function isSupported() {
4323
+ return runtime.supports.chat ? true : false;
4324
+ }
4325
+ chat.isSupported = isSupported;
4326
+ })(chat || (chat = {}));
4327
+
4324
4328
  ;// CONCATENATED MODULE: ./src/public/dialog.ts
4325
4329
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
4326
4330
  /* eslint-disable @typescript-eslint/ban-types */
@@ -4330,14 +4334,21 @@ var appInstallDialog;
4330
4334
 
4331
4335
 
4332
4336
 
4333
-
4337
+ /**
4338
+ * Namespace to interact with the dialog module-specific part of the SDK.
4339
+ *
4340
+ * @beta
4341
+ */
4334
4342
  var dialog;
4335
4343
  (function (dialog) {
4336
4344
  /**
4337
- * Allows an app to open the dialog module.
4345
+ * Allows app to open a url based dialog.
4346
+ *
4347
+ * @remarks
4348
+ * This function cannot be called from inside of a dialog
4338
4349
  *
4339
4350
  * @param urlDialogInfo - An object containing the parameters of the dialog module.
4340
- * @param submitHandler - This Handler is called when the dialog has been submitted or closed.
4351
+ * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
4341
4352
  * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
4342
4353
  *
4343
4354
  * @returns a function that can be used to send messages to the dialog.
@@ -4349,10 +4360,11 @@ var dialog;
4349
4360
  }
4350
4361
  sendMessageToParent('tasks.startTask', [urlDialogInfo], function (err, result) {
4351
4362
  submitHandler({ err: err, result: result });
4363
+ removeHandler('messageForParent');
4352
4364
  });
4353
4365
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4354
- var sendMessageToDialog = function (message, onComplete) {
4355
- sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
4366
+ var sendMessageToDialog = function (message) {
4367
+ sendMessageToParent('messageForChild', [message]);
4356
4368
  };
4357
4369
  return sendMessageToDialog;
4358
4370
  }
@@ -4360,7 +4372,7 @@ var dialog;
4360
4372
  /**
4361
4373
  * Submit the dialog module.
4362
4374
  *
4363
- * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
4375
+ * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
4364
4376
  * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
4365
4377
  */
4366
4378
  function submit(result, appIds) {
@@ -4372,32 +4384,43 @@ var dialog;
4372
4384
  /**
4373
4385
  * Send message to the parent from dialog
4374
4386
  *
4375
- * @param message - The message to send
4376
- * @param onComplete - The callback to know if the message to parent has been success/failed.
4387
+ * @remarks
4388
+ * This function is only called from inside of a dialog
4389
+ *
4390
+ * @param message - The message to send to the parent
4377
4391
  */
4378
4392
  function sendMessageToParentFromDialog(
4379
4393
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4380
- message, onComplete) {
4394
+ message) {
4381
4395
  ensureInitialized(FrameContexts.task);
4382
- sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
4396
+ sendMessageToParent('messageForParent', [message]);
4383
4397
  }
4384
4398
  dialog.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
4385
4399
  /**
4386
- * Fucntion to call when an event is received from the Parent
4400
+ * Register a listener that will be triggered when a message is received from the app that opened the dialog.
4387
4401
  *
4388
- * @param type - The event to listen to. Currently the only supported type is 'message'.
4389
- * @param listener - listener - The listener that will be called.
4402
+ * @remarks
4403
+ * This function is only called from inside of a dialog.
4404
+ *
4405
+ * @param listener - The listener that will be triggered.
4390
4406
  */
4391
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4392
4407
  function registerOnMessageFromParent(listener) {
4393
4408
  ensureInitialized();
4394
4409
  registerHandler('messageForChild', listener);
4395
4410
  }
4396
4411
  dialog.registerOnMessageFromParent = registerOnMessageFromParent;
4412
+ /**
4413
+ * Checks if dialog module is supported by the host
4414
+ *
4415
+ * @returns boolean to represent whether dialog module is supported
4416
+ */
4397
4417
  function isSupported() {
4398
4418
  return runtime.supports.dialog ? true : false;
4399
4419
  }
4400
4420
  dialog.isSupported = isSupported;
4421
+ /**
4422
+ * Namespace to update the dialog
4423
+ */
4401
4424
  var update;
4402
4425
  (function (update) {
4403
4426
  /**
@@ -4410,13 +4433,30 @@ var dialog;
4410
4433
  sendMessageToParent('tasks.updateTask', [dimensions]);
4411
4434
  }
4412
4435
  update.resize = resize;
4436
+ /**
4437
+ * Checks if dialog.update capability is supported by the host
4438
+ *
4439
+ * @returns boolean to represent whether dialog.update is supported
4440
+ */
4413
4441
  function isSupported() {
4414
4442
  return runtime.supports.dialog ? (runtime.supports.dialog.update ? true : false) : false;
4415
4443
  }
4416
4444
  update.isSupported = isSupported;
4417
4445
  })(update = dialog.update || (dialog.update = {}));
4446
+ /**
4447
+ * Namespace to open a dialog that sends results to the bot framework
4448
+ */
4418
4449
  var bot;
4419
4450
  (function (bot) {
4451
+ /**
4452
+ * Allows an app to open the dialog module using bot.
4453
+ *
4454
+ * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.
4455
+ * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
4456
+ * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
4457
+ *
4458
+ * @returns a function that can be used to send messages to the dialog.
4459
+ */
4420
4460
  function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
4421
4461
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
4422
4462
  if (messageFromChildHandler) {
@@ -4424,14 +4464,20 @@ var dialog;
4424
4464
  }
4425
4465
  sendMessageToParent('tasks.startTask', [botUrlDialogInfo], function (err, result) {
4426
4466
  submitHandler({ err: err, result: result });
4467
+ removeHandler('messageForParent');
4427
4468
  });
4428
4469
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4429
- var sendMessageToDialog = function (message, onComplete) {
4430
- sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
4470
+ var sendMessageToDialog = function (message) {
4471
+ sendMessageToParent('messageForChild', [message]);
4431
4472
  };
4432
4473
  return sendMessageToDialog;
4433
4474
  }
4434
4475
  bot.open = open;
4476
+ /**
4477
+ * Checks if dialog.bot capability is supported by the host
4478
+ *
4479
+ * @returns boolean to represent whether dialog.bot is supported
4480
+ */
4435
4481
  function isSupported() {
4436
4482
  return runtime.supports.dialog ? (runtime.supports.dialog.bot ? true : false) : false;
4437
4483
  }
@@ -5305,7 +5351,7 @@ var meeting;
5305
5351
  */
5306
5352
  function shareAppContentToStage(param1, param2) {
5307
5353
  var _a;
5308
- ensureInitialized(FrameContexts.sidePanel);
5354
+ ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
5309
5355
  var appContentUrl;
5310
5356
  var callback;
5311
5357
  if (typeof param1 === 'function') {
@@ -5330,7 +5376,7 @@ var meeting;
5330
5376
  });
5331
5377
  }
5332
5378
  function getAppContentStageSharingCapabilities(callback) {
5333
- ensureInitialized(FrameContexts.sidePanel);
5379
+ ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
5334
5380
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(getAppContentStageSharingCapabilitiesHelper, callback);
5335
5381
  }
5336
5382
  meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
@@ -5344,7 +5390,7 @@ var meeting;
5344
5390
  });
5345
5391
  }
5346
5392
  function stopSharingAppContentToStage(callback) {
5347
- ensureInitialized(FrameContexts.sidePanel);
5393
+ ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
5348
5394
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(stopSharingAppContentToStageHelper, callback);
5349
5395
  }
5350
5396
  meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
@@ -5358,7 +5404,7 @@ var meeting;
5358
5404
  });
5359
5405
  }
5360
5406
  function getAppContentStageSharingState(callback) {
5361
- ensureInitialized(FrameContexts.sidePanel);
5407
+ ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
5362
5408
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(getAppContentStageSharingStateHelper, callback);
5363
5409
  }
5364
5410
  meeting.getAppContentStageSharingState = getAppContentStageSharingState;
@@ -5367,6 +5413,20 @@ var meeting;
5367
5413
  resolve(sendAndHandleSdkError('meeting.getAppContentStageSharingState'));
5368
5414
  });
5369
5415
  }
5416
+ /**
5417
+ * Registers a handler for changes to paticipant speaking states. If any participant is speaking, isSpeakingDetected
5418
+ * will be true. If no participants are speaking, isSpeakingDetected will be false. Only one handler can be registered
5419
+ * at a time. A subsequent registration replaces an existing registration.
5420
+ * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).
5421
+ */
5422
+ function registerSpeakingStateChangeHandler(handler) {
5423
+ if (!handler) {
5424
+ throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');
5425
+ }
5426
+ ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
5427
+ registerHandler('meeting.speakingStateChanged', handler);
5428
+ }
5429
+ meeting.registerSpeakingStateChangeHandler = registerSpeakingStateChangeHandler;
5370
5430
  })(meeting || (meeting = {}));
5371
5431
 
5372
5432
  ;// CONCATENATED MODULE: ./src/public/monetization.ts
@@ -6439,7 +6499,8 @@ var tasks;
6439
6499
  (function (tasks) {
6440
6500
  /**
6441
6501
  * @deprecated
6442
- * As of 2.0.0-beta.4, please use {@link dialog.open(dialogInfo: DialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} instead.
6502
+ * As of 2.0.0-beta.4, please use {@link dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for url based dialogs
6503
+ * and {@link dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for bot based dialogs.
6443
6504
  *
6444
6505
  * Allows an app to open the task module.
6445
6506
  *
@@ -6556,6 +6617,7 @@ var tasks;
6556
6617
 
6557
6618
 
6558
6619
 
6620
+
6559
6621
 
6560
6622
 
6561
6623
 
@@ -6832,12 +6894,18 @@ var files;
6832
6894
  /**
6833
6895
  * @hidden
6834
6896
  * Hide from docs
6835
- * ------
6836
- * Open download preference folder
6897
+ *
6898
+ * Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId
6899
+ * @param fileObjectId Id of the file whose containing folder should be opened
6900
+ * @param callback Callback that will be triggered post open download folder/path
6837
6901
  */
6838
- function openDownloadFolder() {
6902
+ function openDownloadFolder(fileObjectId, callback) {
6903
+ if (fileObjectId === void 0) { fileObjectId = undefined; }
6839
6904
  ensureInitialized(FrameContexts.content);
6840
- sendMessageToParent('files.openDownloadFolder', []);
6905
+ if (!callback) {
6906
+ throw new Error('[files.openDownloadFolder] Callback cannot be null');
6907
+ }
6908
+ sendMessageToParent('files.openDownloadFolder', [fileObjectId], callback);
6841
6909
  }
6842
6910
  files_1.openDownloadFolder = openDownloadFolder;
6843
6911
  })(files || (files = {}));
@@ -6857,30 +6925,43 @@ var legacy;
6857
6925
  (function (legacy) {
6858
6926
  var fullTrust;
6859
6927
  (function (fullTrust) {
6860
- /**
6861
- * @hidden
6862
- * Hide from docs
6863
- * ------
6864
- * Allows an app to retrieve information of all user joined teams
6865
- *
6866
- * @param teamInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams
6867
- * @returns Promise resolved containing information about the user joined teams or rejected with error
6868
- */
6869
- function getUserJoinedTeams(teamInstanceParameters) {
6870
- return new Promise(function (resolve) {
6871
- ensureInitialized();
6872
- if ((GlobalVars.hostClientType === HostClientType.android ||
6873
- GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||
6874
- GlobalVars.hostClientType === HostClientType.teamsPhones ||
6875
- GlobalVars.hostClientType === HostClientType.teamsDisplays) &&
6876
- !isCurrentSDKVersionAtLeast(getUserJoinedTeamsSupportedAndroidClientVersion)) {
6877
- var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6878
- throw new Error(JSON.stringify(oldPlatformError));
6879
- }
6880
- resolve(sendAndUnwrap('getUserJoinedTeams', teamInstanceParameters));
6881
- });
6882
- }
6883
- fullTrust.getUserJoinedTeams = getUserJoinedTeams;
6928
+ var joinedTeams;
6929
+ (function (joinedTeams) {
6930
+ /**
6931
+ * @hidden
6932
+ * Hide from docs
6933
+ * ------
6934
+ * Allows an app to retrieve information of all user joined teams
6935
+ *
6936
+ * @param teamInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams
6937
+ * @returns Promise resolved containing information about the user joined teams or rejected with error
6938
+ */
6939
+ function getUserJoinedTeams(teamInstanceParameters) {
6940
+ return new Promise(function (resolve) {
6941
+ ensureInitialized();
6942
+ if ((GlobalVars.hostClientType === HostClientType.android ||
6943
+ GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||
6944
+ GlobalVars.hostClientType === HostClientType.teamsPhones ||
6945
+ GlobalVars.hostClientType === HostClientType.teamsDisplays) &&
6946
+ !isCurrentSDKVersionAtLeast(getUserJoinedTeamsSupportedAndroidClientVersion)) {
6947
+ var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6948
+ throw new Error(JSON.stringify(oldPlatformError));
6949
+ }
6950
+ resolve(sendAndUnwrap('getUserJoinedTeams', teamInstanceParameters));
6951
+ });
6952
+ }
6953
+ joinedTeams.getUserJoinedTeams = getUserJoinedTeams;
6954
+ function isSupported() {
6955
+ return runtime.supports.teams
6956
+ ? runtime.supports.teams.fullTrust
6957
+ ? runtime.supports.teams.fullTrust.joinedTeams
6958
+ ? true
6959
+ : false
6960
+ : false
6961
+ : false;
6962
+ }
6963
+ joinedTeams.isSupported = isSupported;
6964
+ })(joinedTeams = fullTrust.joinedTeams || (fullTrust.joinedTeams = {}));
6884
6965
  /**
6885
6966
  * @hidden
6886
6967
  * Hide from docs
@@ -7355,7 +7436,6 @@ var teams;
7355
7436
 
7356
7437
 
7357
7438
 
7358
-
7359
7439
 
7360
7440
  ;// CONCATENATED MODULE: ./src/index.ts
7361
7441