@microsoft/teams-js 2.0.0-beta.5-dev.5 → 2.0.0-beta.5-dev.8

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.
@@ -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
@@ -2085,6 +2086,26 @@ export interface Context {
2085
2086
  */
2086
2087
  mySitePath?: string;
2087
2088
  }
2089
+ export interface ShareDeepLinkParameters {
2090
+ /**
2091
+ * The developer-defined unique ID for the sub-page to which this deep link points in the current page.
2092
+ * This field should be used to restore to a specific state within a page, such as scrolling to or activating a specific piece of content.
2093
+ */
2094
+ subPageId: string;
2095
+ /**
2096
+ * The label for the sub-page that should be displayed when the deep link is rendered in a client.
2097
+ */
2098
+ subPageLabel: string;
2099
+ /**
2100
+ * The fallback URL to which to navigate the user if the client cannot render the page.
2101
+ * This URL should lead directly to the sub-entity.
2102
+ */
2103
+ subPageWebUrl?: string;
2104
+ }
2105
+ /**
2106
+ * @deprecated
2107
+ * As of 2.0.0-beta.5, please use {@link ShareDeepLinkParameters} instead.
2108
+ */
2088
2109
  export interface DeepLinkParameters {
2089
2110
  /**
2090
2111
  * The developer-defined unique ID for the sub-entity to which this deep link points in the current entity.
@@ -2972,7 +2993,7 @@ export namespace pages {
2972
2993
  *
2973
2994
  * @param deepLinkParameters - ID and label for the link and fallback URL.
2974
2995
  */
2975
- function shareDeepLink(deepLinkParameters: DeepLinkParameters): void;
2996
+ function shareDeepLink(deepLinkParameters: ShareDeepLinkParameters): void;
2976
2997
  /**
2977
2998
  * Registers a handler for changes from or to full-screen view for a tab.
2978
2999
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
@@ -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.5";
1124
+ var version = "2.0.0-beta.5-dev.8";
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);
@@ -3142,9 +3144,9 @@ var pages;
3142
3144
  function shareDeepLink(deepLinkParameters) {
3143
3145
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3144
3146
  sendMessageToParent('shareDeepLink', [
3145
- deepLinkParameters.subEntityId,
3146
- deepLinkParameters.subEntityLabel,
3147
- deepLinkParameters.subEntityWebUrl,
3147
+ deepLinkParameters.subPageId,
3148
+ deepLinkParameters.subPageLabel,
3149
+ deepLinkParameters.subPageWebUrl,
3148
3150
  ]);
3149
3151
  }
3150
3152
  pages.shareDeepLink = shareDeepLink;
@@ -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
  }
@@ -6206,7 +6223,11 @@ function getMruTabInstances(callback, tabInstanceParameters) {
6206
6223
  * @param deepLinkParameters - ID and label for the link and fallback URL.
6207
6224
  */
6208
6225
  function shareDeepLink(deepLinkParameters) {
6209
- pages.shareDeepLink(deepLinkParameters);
6226
+ pages.shareDeepLink({
6227
+ subPageId: deepLinkParameters.subEntityId,
6228
+ subPageLabel: deepLinkParameters.subEntityLabel,
6229
+ subPageWebUrl: deepLinkParameters.subEntityWebUrl,
6230
+ });
6210
6231
  }
6211
6232
  /**
6212
6233
  * @deprecated
@@ -6666,6 +6687,7 @@ var tasks;
6666
6687
 
6667
6688
 
6668
6689
 
6690
+
6669
6691
  /**
6670
6692
  * @hidden
6671
6693
  * Hide from docs
@@ -6753,6 +6775,9 @@ var files;
6753
6775
  function getCloudStorageFolders(channelId) {
6754
6776
  return new Promise(function (resolve) {
6755
6777
  ensureInitialized(FrameContexts.content);
6778
+ if (!isSupported()) {
6779
+ throw new Error(errorNotSupportedOnPlatform);
6780
+ }
6756
6781
  if (!channelId || channelId.length === 0) {
6757
6782
  throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
6758
6783
  }
@@ -6770,6 +6795,9 @@ var files;
6770
6795
  function addCloudStorageFolder(channelId) {
6771
6796
  return new Promise(function (resolve) {
6772
6797
  ensureInitialized(FrameContexts.content);
6798
+ if (!isSupported()) {
6799
+ throw new Error(errorNotSupportedOnPlatform);
6800
+ }
6773
6801
  if (!channelId || channelId.length === 0) {
6774
6802
  throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
6775
6803
  }
@@ -6796,6 +6824,9 @@ var files;
6796
6824
  function deleteCloudStorageFolder(channelId, folderToDelete) {
6797
6825
  return new Promise(function (resolve) {
6798
6826
  ensureInitialized(FrameContexts.content);
6827
+ if (!isSupported()) {
6828
+ throw new Error(errorNotSupportedOnPlatform);
6829
+ }
6799
6830
  if (!channelId) {
6800
6831
  throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');
6801
6832
  }
@@ -6818,6 +6849,9 @@ var files;
6818
6849
  function getCloudStorageFolderContents(folder, providerCode) {
6819
6850
  return new Promise(function (resolve) {
6820
6851
  ensureInitialized(FrameContexts.content);
6852
+ if (!isSupported()) {
6853
+ throw new Error(errorNotSupportedOnPlatform);
6854
+ }
6821
6855
  if (!folder || !providerCode) {
6822
6856
  throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');
6823
6857
  }
@@ -6840,6 +6874,9 @@ var files;
6840
6874
  */
6841
6875
  function openCloudStorageFile(file, providerCode, fileOpenPreference) {
6842
6876
  ensureInitialized(FrameContexts.content);
6877
+ if (!isSupported()) {
6878
+ throw new Error(errorNotSupportedOnPlatform);
6879
+ }
6843
6880
  if (!file || !providerCode) {
6844
6881
  throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');
6845
6882
  }
@@ -6859,6 +6896,9 @@ var files;
6859
6896
  */
6860
6897
  function openFilePreview(filePreviewParameters) {
6861
6898
  ensureInitialized(FrameContexts.content);
6899
+ if (!isSupported()) {
6900
+ throw new Error(errorNotSupportedOnPlatform);
6901
+ }
6862
6902
  var params = [
6863
6903
  filePreviewParameters.entityId,
6864
6904
  filePreviewParameters.title,
@@ -6889,6 +6929,9 @@ var files;
6889
6929
  if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
6890
6930
  return new Promise(function (resolve) {
6891
6931
  ensureInitialized(FrameContexts.content);
6932
+ if (!isSupported()) {
6933
+ throw new Error(errorNotSupportedOnPlatform);
6934
+ }
6892
6935
  resolve(sendAndHandleSdkError('files.getExternalProviders', excludeAddedProviders));
6893
6936
  });
6894
6937
  }
@@ -6902,6 +6945,9 @@ var files;
6902
6945
  if (isMove === void 0) { isMove = false; }
6903
6946
  return new Promise(function (resolve) {
6904
6947
  ensureInitialized(FrameContexts.content);
6948
+ if (!isSupported()) {
6949
+ throw new Error(errorNotSupportedOnPlatform);
6950
+ }
6905
6951
  if (!selectedFiles || selectedFiles.length === 0) {
6906
6952
  throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
6907
6953
  }
@@ -6924,6 +6970,9 @@ var files;
6924
6970
  files_1.isSupported = isSupported;
6925
6971
  function getFileDownloads(callback) {
6926
6972
  ensureInitialized(FrameContexts.content);
6973
+ if (!isSupported()) {
6974
+ throw new Error(errorNotSupportedOnPlatform);
6975
+ }
6927
6976
  var wrappedFunction = function () {
6928
6977
  return new Promise(function (resolve) { return resolve(sendAndHandleSdkError('files.getFileDownloads', [])); });
6929
6978
  };
@@ -6941,6 +6990,9 @@ var files;
6941
6990
  function openDownloadFolder(fileObjectId, callback) {
6942
6991
  if (fileObjectId === void 0) { fileObjectId = undefined; }
6943
6992
  ensureInitialized(FrameContexts.content);
6993
+ if (!isSupported()) {
6994
+ throw new Error(errorNotSupportedOnPlatform);
6995
+ }
6944
6996
  if (!callback) {
6945
6997
  throw new Error('[files.openDownloadFolder] Callback cannot be null');
6946
6998
  }