@microsoft/teams-js 2.0.0-beta.5-dev.3 → 2.0.0-beta.5-dev.6
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/MicrosoftTeams.d.ts
CHANGED
@@ -1653,6 +1653,7 @@ export enum ChannelType {
|
|
1653
1653
|
Private = "Private",
|
1654
1654
|
Shared = "Shared"
|
1655
1655
|
}
|
1656
|
+
export const errorNotSupportedOnPlatform: string;
|
1656
1657
|
|
1657
1658
|
/**
|
1658
1659
|
* Represents information about tabs for an app
|
@@ -2120,6 +2121,10 @@ export interface DialogSize {
|
|
2120
2121
|
export interface UrlDialogInfo {
|
2121
2122
|
/**
|
2122
2123
|
* The url to be rendered in the webview/iframe.
|
2124
|
+
*
|
2125
|
+
* @remarks
|
2126
|
+
* The domain of the url must match at least one of the
|
2127
|
+
* valid domains specified in the validDomains block of the manifest
|
2123
2128
|
*/
|
2124
2129
|
url: string;
|
2125
2130
|
size: DialogSize;
|
@@ -2146,6 +2151,10 @@ export interface BotUrlDialogInfo extends UrlDialogInfo {
|
|
2146
2151
|
export interface DialogInfo {
|
2147
2152
|
/**
|
2148
2153
|
* The url to be rendered in the webview/iframe.
|
2154
|
+
*
|
2155
|
+
* @remarks
|
2156
|
+
* The domain of the url must match at least one of the
|
2157
|
+
* valid domains specified in the validDomains block of the manifest
|
2149
2158
|
*/
|
2150
2159
|
url?: string;
|
2151
2160
|
/**
|
@@ -2810,7 +2819,7 @@ export namespace dialog {
|
|
2810
2819
|
*
|
2811
2820
|
* @returns a function that can be used to send messages to the dialog.
|
2812
2821
|
*/
|
2813
|
-
function open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel):
|
2822
|
+
function open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void;
|
2814
2823
|
/**
|
2815
2824
|
* Submit the dialog module.
|
2816
2825
|
*
|
@@ -2827,6 +2836,12 @@ export namespace dialog {
|
|
2827
2836
|
* @param message - The message to send to the parent
|
2828
2837
|
*/
|
2829
2838
|
function sendMessageToParentFromDialog(message: any): void;
|
2839
|
+
/**
|
2840
|
+
* Send message to the dialog from the parent
|
2841
|
+
*
|
2842
|
+
* @param message - The message to send
|
2843
|
+
*/
|
2844
|
+
function sendMessageToDialog(message: any): void;
|
2830
2845
|
/**
|
2831
2846
|
* Register a listener that will be triggered when a message is received from the app that opened the dialog.
|
2832
2847
|
*
|
@@ -2872,7 +2887,7 @@ export namespace dialog {
|
|
2872
2887
|
*
|
2873
2888
|
* @returns a function that can be used to send messages to the dialog.
|
2874
2889
|
*/
|
2875
|
-
function open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel):
|
2890
|
+
function open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void;
|
2876
2891
|
/**
|
2877
2892
|
* Checks if dialog.bot capability is supported by the host
|
2878
2893
|
*
|
package/dist/MicrosoftTeams.js
CHANGED
@@ -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.5-dev.
|
1124
|
+
var version = "2.0.0-beta.5-dev.6";
|
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.
|
@@ -1265,6 +1265,81 @@ var GlobalVars = /** @class */ (function () {
|
|
1265
1265
|
}());
|
1266
1266
|
|
1267
1267
|
|
1268
|
+
;// CONCATENATED MODULE: ./src/public/interfaces.ts
|
1269
|
+
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
1270
|
+
/**
|
1271
|
+
* Allowed user file open preferences
|
1272
|
+
*/
|
1273
|
+
var FileOpenPreference;
|
1274
|
+
(function (FileOpenPreference) {
|
1275
|
+
FileOpenPreference["Inline"] = "inline";
|
1276
|
+
FileOpenPreference["Desktop"] = "desktop";
|
1277
|
+
FileOpenPreference["Web"] = "web";
|
1278
|
+
})(FileOpenPreference || (FileOpenPreference = {}));
|
1279
|
+
var ErrorCode;
|
1280
|
+
(function (ErrorCode) {
|
1281
|
+
/**
|
1282
|
+
* API not supported in the current platform.
|
1283
|
+
*/
|
1284
|
+
ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
|
1285
|
+
/**
|
1286
|
+
* Internal error encountered while performing the required operation.
|
1287
|
+
*/
|
1288
|
+
ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
|
1289
|
+
/**
|
1290
|
+
* API is not supported in the current context
|
1291
|
+
*/
|
1292
|
+
ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
|
1293
|
+
/**
|
1294
|
+
Permissions denied by user
|
1295
|
+
*/
|
1296
|
+
ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
|
1297
|
+
/**
|
1298
|
+
* Network issue
|
1299
|
+
*/
|
1300
|
+
ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
|
1301
|
+
/**
|
1302
|
+
* Underlying hardware doesn't support the capability
|
1303
|
+
*/
|
1304
|
+
ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
|
1305
|
+
/**
|
1306
|
+
* One or more arguments are invalid
|
1307
|
+
*/
|
1308
|
+
ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
|
1309
|
+
/**
|
1310
|
+
* User is not authorized for this operation
|
1311
|
+
*/
|
1312
|
+
ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
|
1313
|
+
/**
|
1314
|
+
* Could not complete the operation due to insufficient resources
|
1315
|
+
*/
|
1316
|
+
ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
|
1317
|
+
/**
|
1318
|
+
* Platform throttled the request because of API was invoked too frequently
|
1319
|
+
*/
|
1320
|
+
ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
|
1321
|
+
/**
|
1322
|
+
* User aborted the operation
|
1323
|
+
*/
|
1324
|
+
ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
|
1325
|
+
/**
|
1326
|
+
* Could not complete the operation in the given time interval
|
1327
|
+
*/
|
1328
|
+
ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
|
1329
|
+
/**
|
1330
|
+
* Platform code is old and doesn't implement this API
|
1331
|
+
*/
|
1332
|
+
ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
|
1333
|
+
/**
|
1334
|
+
* The file specified was not found on the given location
|
1335
|
+
*/
|
1336
|
+
ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
|
1337
|
+
/**
|
1338
|
+
* The return value is too big and has exceeded our size boundries
|
1339
|
+
*/
|
1340
|
+
ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
|
1341
|
+
})(ErrorCode || (ErrorCode = {}));
|
1342
|
+
|
1268
1343
|
;// CONCATENATED MODULE: ./src/public/constants.ts
|
1269
1344
|
var HostClientType;
|
1270
1345
|
(function (HostClientType) {
|
@@ -1332,6 +1407,7 @@ var DialogDimension;
|
|
1332
1407
|
DialogDimension["Medium"] = "medium";
|
1333
1408
|
DialogDimension["Small"] = "small";
|
1334
1409
|
})(DialogDimension || (DialogDimension = {}));
|
1410
|
+
|
1335
1411
|
/**
|
1336
1412
|
* @deprecated
|
1337
1413
|
* As of 2.0.0-beta.1, please use {@link DialogDimension} instead.
|
@@ -1347,81 +1423,7 @@ var ChannelType;
|
|
1347
1423
|
ChannelType["Private"] = "Private";
|
1348
1424
|
ChannelType["Shared"] = "Shared";
|
1349
1425
|
})(ChannelType || (ChannelType = {}));
|
1350
|
-
|
1351
|
-
;// CONCATENATED MODULE: ./src/public/interfaces.ts
|
1352
|
-
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
1353
|
-
/**
|
1354
|
-
* Allowed user file open preferences
|
1355
|
-
*/
|
1356
|
-
var FileOpenPreference;
|
1357
|
-
(function (FileOpenPreference) {
|
1358
|
-
FileOpenPreference["Inline"] = "inline";
|
1359
|
-
FileOpenPreference["Desktop"] = "desktop";
|
1360
|
-
FileOpenPreference["Web"] = "web";
|
1361
|
-
})(FileOpenPreference || (FileOpenPreference = {}));
|
1362
|
-
var ErrorCode;
|
1363
|
-
(function (ErrorCode) {
|
1364
|
-
/**
|
1365
|
-
* API not supported in the current platform.
|
1366
|
-
*/
|
1367
|
-
ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
|
1368
|
-
/**
|
1369
|
-
* Internal error encountered while performing the required operation.
|
1370
|
-
*/
|
1371
|
-
ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
|
1372
|
-
/**
|
1373
|
-
* API is not supported in the current context
|
1374
|
-
*/
|
1375
|
-
ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
|
1376
|
-
/**
|
1377
|
-
Permissions denied by user
|
1378
|
-
*/
|
1379
|
-
ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
|
1380
|
-
/**
|
1381
|
-
* Network issue
|
1382
|
-
*/
|
1383
|
-
ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
|
1384
|
-
/**
|
1385
|
-
* Underlying hardware doesn't support the capability
|
1386
|
-
*/
|
1387
|
-
ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
|
1388
|
-
/**
|
1389
|
-
* One or more arguments are invalid
|
1390
|
-
*/
|
1391
|
-
ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
|
1392
|
-
/**
|
1393
|
-
* User is not authorized for this operation
|
1394
|
-
*/
|
1395
|
-
ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
|
1396
|
-
/**
|
1397
|
-
* Could not complete the operation due to insufficient resources
|
1398
|
-
*/
|
1399
|
-
ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
|
1400
|
-
/**
|
1401
|
-
* Platform throttled the request because of API was invoked too frequently
|
1402
|
-
*/
|
1403
|
-
ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
|
1404
|
-
/**
|
1405
|
-
* User aborted the operation
|
1406
|
-
*/
|
1407
|
-
ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
|
1408
|
-
/**
|
1409
|
-
* Could not complete the operation in the given time interval
|
1410
|
-
*/
|
1411
|
-
ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
|
1412
|
-
/**
|
1413
|
-
* Platform code is old and doesn't implement this API
|
1414
|
-
*/
|
1415
|
-
ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
|
1416
|
-
/**
|
1417
|
-
* The file specified was not found on the given location
|
1418
|
-
*/
|
1419
|
-
ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
|
1420
|
-
/**
|
1421
|
-
* The return value is too big and has exceeded our size boundries
|
1422
|
-
*/
|
1423
|
-
ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
|
1424
|
-
})(ErrorCode || (ErrorCode = {}));
|
1426
|
+
var errorNotSupportedOnPlatform = JSON.stringify({ errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM });
|
1425
1427
|
|
1426
1428
|
// EXTERNAL MODULE: ../../node_modules/uuid/index.js
|
1427
1429
|
var uuid = __webpack_require__(22);
|
@@ -4164,6 +4166,9 @@ var conversations;
|
|
4164
4166
|
function openConversation(openConversationRequest) {
|
4165
4167
|
return new Promise(function (resolve) {
|
4166
4168
|
ensureInitialized(FrameContexts.content);
|
4169
|
+
if (!isSupported()) {
|
4170
|
+
throw new Error(errorNotSupportedOnPlatform);
|
4171
|
+
}
|
4167
4172
|
var sendPromise = sendAndHandleStatusAndReason('conversations.openConversation', {
|
4168
4173
|
title: openConversationRequest.title,
|
4169
4174
|
subEntityId: openConversationRequest.subEntityId,
|
@@ -4203,6 +4208,9 @@ var conversations;
|
|
4203
4208
|
*/
|
4204
4209
|
function closeConversation() {
|
4205
4210
|
ensureInitialized(FrameContexts.content);
|
4211
|
+
if (!isSupported()) {
|
4212
|
+
throw new Error(errorNotSupportedOnPlatform);
|
4213
|
+
}
|
4206
4214
|
sendMessageToParent('conversations.closeConversation');
|
4207
4215
|
removeHandler('startConversation');
|
4208
4216
|
removeHandler('closeConversation');
|
@@ -4223,6 +4231,9 @@ var conversations;
|
|
4223
4231
|
function getChatMembers() {
|
4224
4232
|
return new Promise(function (resolve) {
|
4225
4233
|
ensureInitialized();
|
4234
|
+
if (!isSupported()) {
|
4235
|
+
throw new Error(errorNotSupportedOnPlatform);
|
4236
|
+
}
|
4226
4237
|
resolve(sendAndUnwrap('getChatMembers'));
|
4227
4238
|
});
|
4228
4239
|
}
|
@@ -4303,6 +4314,9 @@ var chat;
|
|
4303
4314
|
function openChat(openChatRequest) {
|
4304
4315
|
return new Promise(function (resolve) {
|
4305
4316
|
ensureInitialized(FrameContexts.content);
|
4317
|
+
if (!isSupported()) {
|
4318
|
+
throw new Error(errorNotSupportedOnPlatform);
|
4319
|
+
}
|
4306
4320
|
if (runtime.isLegacyTeams) {
|
4307
4321
|
resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message)));
|
4308
4322
|
}
|
@@ -4339,6 +4353,9 @@ var chat;
|
|
4339
4353
|
}
|
4340
4354
|
else {
|
4341
4355
|
ensureInitialized(FrameContexts.content);
|
4356
|
+
if (!isSupported()) {
|
4357
|
+
throw new Error(errorNotSupportedOnPlatform);
|
4358
|
+
}
|
4342
4359
|
if (runtime.isLegacyTeams) {
|
4343
4360
|
resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message)));
|
4344
4361
|
}
|
@@ -4397,11 +4414,6 @@ var dialog;
|
|
4397
4414
|
submitHandler({ err: err, result: result });
|
4398
4415
|
removeHandler('messageForParent');
|
4399
4416
|
});
|
4400
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
4401
|
-
var sendMessageToDialog = function (message) {
|
4402
|
-
sendMessageToParent('messageForChild', [message]);
|
4403
|
-
};
|
4404
|
-
return sendMessageToDialog;
|
4405
4417
|
}
|
4406
4418
|
dialog.open = open;
|
4407
4419
|
/**
|
@@ -4431,6 +4443,18 @@ var dialog;
|
|
4431
4443
|
sendMessageToParent('messageForParent', [message]);
|
4432
4444
|
}
|
4433
4445
|
dialog.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
|
4446
|
+
/**
|
4447
|
+
* Send message to the dialog from the parent
|
4448
|
+
*
|
4449
|
+
* @param message - The message to send
|
4450
|
+
*/
|
4451
|
+
function sendMessageToDialog(
|
4452
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
4453
|
+
message) {
|
4454
|
+
ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
4455
|
+
sendMessageToParent('messageForChild', [message]);
|
4456
|
+
}
|
4457
|
+
dialog.sendMessageToDialog = sendMessageToDialog;
|
4434
4458
|
/**
|
4435
4459
|
* Register a listener that will be triggered when a message is received from the app that opened the dialog.
|
4436
4460
|
*
|
@@ -4501,11 +4525,6 @@ var dialog;
|
|
4501
4525
|
submitHandler({ err: err, result: result });
|
4502
4526
|
removeHandler('messageForParent');
|
4503
4527
|
});
|
4504
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
4505
|
-
var sendMessageToDialog = function (message) {
|
4506
|
-
sendMessageToParent('messageForChild', [message]);
|
4507
|
-
};
|
4508
|
-
return sendMessageToDialog;
|
4509
4528
|
}
|
4510
4529
|
bot.open = open;
|
4511
4530
|
/**
|