@microsoft/teams-js 1.12.0-beta.1 → 1.12.0-beta.2

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.
@@ -113,7 +113,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
113
113
  exports.sendMessageEventToChild = exports.waitForMessageQueue = exports.sendMessageToParent = exports.uninitializeCommunication = exports.initializeCommunication = exports.Communication = void 0;
114
114
  /* eslint-disable @typescript-eslint/ban-types */
115
115
  var constants_1 = __webpack_require__(4);
116
- var globalVars_1 = __webpack_require__(6);
116
+ var globalVars_1 = __webpack_require__(7);
117
117
  var handlers_1 = __webpack_require__(3);
118
118
  var Communication = /** @class */ (function () {
119
119
  function Communication() {
@@ -422,9 +422,11 @@ function createMessageEvent(func, args) {
422
422
  "use strict";
423
423
 
424
424
  Object.defineProperty(exports, "__esModule", { value: true });
425
- exports.processAdditionalValidOrigins = exports.isAPISupportedByPlatform = exports.ensureInitialized = void 0;
426
- var constants_1 = __webpack_require__(4);
427
- var globalVars_1 = __webpack_require__(6);
425
+ exports.processAdditionalValidOrigins = exports.isApiSupportedOnMobile = exports.isHostClientMobile = exports.isAPISupportedByPlatform = exports.ensureInitialized = void 0;
426
+ var constants_1 = __webpack_require__(2);
427
+ var interfaces_1 = __webpack_require__(6);
428
+ var constants_2 = __webpack_require__(4);
429
+ var globalVars_1 = __webpack_require__(7);
428
430
  var utils_1 = __webpack_require__(5);
429
431
  function ensureInitialized() {
430
432
  var expectedFrameContexts = [];
@@ -454,7 +456,7 @@ exports.ensureInitialized = ensureInitialized;
454
456
  * @param requiredVersion SDK version required by the API
455
457
  */
456
458
  function isAPISupportedByPlatform(requiredVersion) {
457
- if (requiredVersion === void 0) { requiredVersion = constants_1.defaultSDKVersionForCompatCheck; }
459
+ if (requiredVersion === void 0) { requiredVersion = constants_2.defaultSDKVersionForCompatCheck; }
458
460
  var value = (0, utils_1.compareSDKVersions)(globalVars_1.GlobalVars.clientSupportedSDKVersion, requiredVersion);
459
461
  if (isNaN(value)) {
460
462
  return false;
@@ -462,13 +464,38 @@ function isAPISupportedByPlatform(requiredVersion) {
462
464
  return value >= 0;
463
465
  }
464
466
  exports.isAPISupportedByPlatform = isAPISupportedByPlatform;
467
+ /**
468
+ * Helper function to identify if host client is either android or ios
469
+ */
470
+ function isHostClientMobile() {
471
+ return globalVars_1.GlobalVars.hostClientType == constants_1.HostClientType.android || globalVars_1.GlobalVars.hostClientType == constants_1.HostClientType.ios;
472
+ }
473
+ exports.isHostClientMobile = isHostClientMobile;
474
+ /**
475
+ * Helper function which indicates if current API is supported on mobile or not.
476
+ * @returns SdkError if host client is not android/ios or if the requiredVersion is not
477
+ * supported by platform or not. Null is returned in case of success.
478
+ */
479
+ function isApiSupportedOnMobile(requiredVersion) {
480
+ if (requiredVersion === void 0) { requiredVersion = constants_2.defaultSDKVersionForCompatCheck; }
481
+ if (!isHostClientMobile()) {
482
+ var notSupportedError = { errorCode: interfaces_1.ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
483
+ return notSupportedError;
484
+ }
485
+ else if (!isAPISupportedByPlatform(requiredVersion)) {
486
+ var oldPlatformError = { errorCode: interfaces_1.ErrorCode.OLD_PLATFORM };
487
+ return oldPlatformError;
488
+ }
489
+ return null;
490
+ }
491
+ exports.isApiSupportedOnMobile = isApiSupportedOnMobile;
465
492
  /**
466
493
  * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp
467
494
  * which is used later for message source/origin validation
468
495
  */
469
496
  function processAdditionalValidOrigins(validMessageOrigins) {
470
497
  var combinedOriginUrls = globalVars_1.GlobalVars.additionalValidOrigins.concat(validMessageOrigins.filter(function (_origin) {
471
- return typeof _origin === 'string' && constants_1.userOriginUrlValidationRegExp.test(_origin);
498
+ return typeof _origin === 'string' && constants_2.userOriginUrlValidationRegExp.test(_origin);
472
499
  }));
473
500
  var dedupUrls = {};
474
501
  combinedOriginUrls = combinedOriginUrls.filter(function (_originUrl) {
@@ -697,45 +724,53 @@ function handleBeforeUnload() {
697
724
  "use strict";
698
725
 
699
726
  Object.defineProperty(exports, "__esModule", { value: true });
700
- exports.userOriginUrlValidationRegExp = exports.validOriginRegExp = exports.validOrigins = exports.scanBarCodeAPIMobileSupportVersion = exports.getMediaCallbackSupportVersion = exports.mediaAPISupportVersion = exports.captureImageMobileSupportVersion = exports.peoplePickerRequiredVersion = exports.locationAPIsRequiredVersion = exports.getUserJoinedTeamsSupportedAndroidClientVersion = exports.videoAndImageMediaAPISupportVersion = exports.defaultSDKVersionForCompatCheck = exports.version = void 0;
727
+ exports.userOriginUrlValidationRegExp = exports.validOriginRegExp = exports.validOrigins = exports.scanBarCodeAPIMobileSupportVersion = exports.getMediaCallbackSupportVersion = exports.mediaAPISupportVersion = exports.captureImageMobileSupportVersion = exports.peoplePickerRequiredVersion = exports.locationAPIsRequiredVersion = exports.getUserJoinedTeamsSupportedAndroidClientVersion = exports.imageOutputFormatsAPISupportVersion = exports.nonFullScreenVideoModeAPISupportVersion = exports.videoAndImageMediaAPISupportVersion = exports.defaultSDKVersionForCompatCheck = exports.version = void 0;
701
728
  var utils_1 = __webpack_require__(5);
702
- exports.version = '1.12.0-beta.1';
729
+ exports.version = '1.12.0-beta.2';
703
730
  /**
704
- * The SDK version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
731
+ * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
705
732
  * Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.
706
733
  * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.
707
734
  */
708
735
  exports.defaultSDKVersionForCompatCheck = '2.0.1';
709
736
  /**
710
- * This is the SDK version when selectMedia API - VideoAndImage is supported on mobile.
737
+ * This is the client version when selectMedia API - VideoAndImage is supported on mobile.
711
738
  */
712
739
  exports.videoAndImageMediaAPISupportVersion = '2.0.2';
740
+ /**
741
+ * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.
742
+ */
743
+ exports.nonFullScreenVideoModeAPISupportVersion = '2.0.3';
744
+ /**
745
+ * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.
746
+ */
747
+ exports.imageOutputFormatsAPISupportVersion = '2.0.4';
713
748
  /**
714
749
  * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
715
750
  */
716
751
  exports.getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';
717
752
  /**
718
- * This is the SDK version when location APIs (getLocation and showLocation) are supported.
753
+ * This is the client version when location APIs (getLocation and showLocation) are supported.
719
754
  */
720
755
  exports.locationAPIsRequiredVersion = '1.9.0';
721
756
  /**
722
- * This is the SDK version when people picker API is supported on mobile.
757
+ * This is the client version when people picker API is supported on mobile.
723
758
  */
724
759
  exports.peoplePickerRequiredVersion = '2.0.0';
725
760
  /**
726
- * This is the SDK version when captureImage API is supported on mobile.
761
+ * This is the client version when captureImage API is supported on mobile.
727
762
  */
728
763
  exports.captureImageMobileSupportVersion = '1.7.0';
729
764
  /**
730
- * This is the SDK version when media APIs are supported on all three platforms ios, android and web.
765
+ * This is the client version when media APIs are supported on all three platforms ios, android and web.
731
766
  */
732
767
  exports.mediaAPISupportVersion = '1.8.0';
733
768
  /**
734
- * This is the SDK version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
769
+ * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
735
770
  */
736
771
  exports.getMediaCallbackSupportVersion = '2.0.0';
737
772
  /**
738
- * This is the SDK version when scanBarCode API is supported on mobile.
773
+ * This is the client version when scanBarCode API is supported on mobile.
739
774
  */
740
775
  exports.scanBarCodeAPIMobileSupportVersion = '1.9.0';
741
776
  /**
@@ -876,29 +911,6 @@ exports.generateGUID = generateGUID;
876
911
 
877
912
  "use strict";
878
913
 
879
- Object.defineProperty(exports, "__esModule", { value: true });
880
- exports.GlobalVars = void 0;
881
- var GlobalVars = /** @class */ (function () {
882
- function GlobalVars() {
883
- }
884
- GlobalVars.initializeCalled = false;
885
- GlobalVars.initializeCompleted = false;
886
- GlobalVars.additionalValidOrigins = [];
887
- GlobalVars.additionalValidOriginsRegexp = null;
888
- GlobalVars.initializeCallbacks = [];
889
- GlobalVars.isFramelessWindow = false;
890
- GlobalVars.printCapabilityEnabled = false;
891
- return GlobalVars;
892
- }());
893
- exports.GlobalVars = GlobalVars;
894
-
895
-
896
- /***/ }),
897
- /* 7 */
898
- /***/ (function(module, exports, __webpack_require__) {
899
-
900
- "use strict";
901
-
902
914
  Object.defineProperty(exports, "__esModule", { value: true });
903
915
  exports.ErrorCode = exports.FileOpenPreference = void 0;
904
916
  /**
@@ -975,6 +987,29 @@ var ErrorCode;
975
987
  })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
976
988
 
977
989
 
990
+ /***/ }),
991
+ /* 7 */
992
+ /***/ (function(module, exports, __webpack_require__) {
993
+
994
+ "use strict";
995
+
996
+ Object.defineProperty(exports, "__esModule", { value: true });
997
+ exports.GlobalVars = void 0;
998
+ var GlobalVars = /** @class */ (function () {
999
+ function GlobalVars() {
1000
+ }
1001
+ GlobalVars.initializeCalled = false;
1002
+ GlobalVars.initializeCompleted = false;
1003
+ GlobalVars.additionalValidOrigins = [];
1004
+ GlobalVars.additionalValidOriginsRegexp = null;
1005
+ GlobalVars.initializeCallbacks = [];
1006
+ GlobalVars.isFramelessWindow = false;
1007
+ GlobalVars.printCapabilityEnabled = false;
1008
+ return GlobalVars;
1009
+ }());
1010
+ exports.GlobalVars = GlobalVars;
1011
+
1012
+
978
1013
  /***/ }),
979
1014
  /* 8 */
980
1015
  /***/ (function(module, exports, __webpack_require__) {
@@ -994,7 +1029,7 @@ Object.defineProperty(exports, "TaskModuleDimension", { enumerable: true, get: f
994
1029
  Object.defineProperty(exports, "TeamType", { enumerable: true, get: function () { return constants_1.TeamType; } });
995
1030
  Object.defineProperty(exports, "UserTeamRole", { enumerable: true, get: function () { return constants_1.UserTeamRole; } });
996
1031
  Object.defineProperty(exports, "ChannelType", { enumerable: true, get: function () { return constants_1.ChannelType; } });
997
- var interfaces_1 = __webpack_require__(7);
1032
+ var interfaces_1 = __webpack_require__(6);
998
1033
  Object.defineProperty(exports, "ErrorCode", { enumerable: true, get: function () { return interfaces_1.ErrorCode; } });
999
1034
  Object.defineProperty(exports, "FileOpenPreference", { enumerable: true, get: function () { return interfaces_1.FileOpenPreference; } });
1000
1035
  var publicAPIs_1 = __webpack_require__(26);
@@ -1127,7 +1162,7 @@ module.exports = bytesToUuid;
1127
1162
  Object.defineProperty(exports, "__esModule", { value: true });
1128
1163
  exports.authentication = void 0;
1129
1164
  var internalAPIs_1 = __webpack_require__(1);
1130
- var globalVars_1 = __webpack_require__(6);
1165
+ var globalVars_1 = __webpack_require__(7);
1131
1166
  var constants_1 = __webpack_require__(2);
1132
1167
  var communication_1 = __webpack_require__(0);
1133
1168
  var handlers_1 = __webpack_require__(3);
@@ -1170,7 +1205,7 @@ var authentication;
1170
1205
  var link = document.createElement('a');
1171
1206
  link.href = authenticateParams.url;
1172
1207
  // Ask the parent window to open an authentication window with the parameters provided by the caller.
1173
- (0, communication_1.sendMessageToParent)('authentication.authenticate', [link.href, authenticateParams.width, authenticateParams.height], function (success, response) {
1208
+ (0, communication_1.sendMessageToParent)('authentication.authenticate', [link.href, authenticateParams.width, authenticateParams.height, authenticateParams.isExternal], function (success, response) {
1174
1209
  if (success) {
1175
1210
  authenticateParams.successCallback(response);
1176
1211
  }
@@ -1246,7 +1281,7 @@ var authentication;
1246
1281
  height = Math.min(height, communication_1.Communication.currentWindow.outerHeight - 200);
1247
1282
  // Convert any relative URLs into absolute URLs before sending them over to the parent window
1248
1283
  var link = document.createElement('a');
1249
- link.href = authParams.url;
1284
+ link.href = authParams.url.replace('{oauthRedirectMethod}', 'web');
1250
1285
  // We are running in the browser, so we need to center the new window ourselves
1251
1286
  var left = typeof communication_1.Communication.currentWindow.screenLeft !== 'undefined'
1252
1287
  ? communication_1.Communication.currentWindow.screenLeft
@@ -1626,8 +1661,8 @@ var utils_1 = __webpack_require__(5);
1626
1661
  var communication_1 = __webpack_require__(0);
1627
1662
  var menus_1 = __webpack_require__(15);
1628
1663
  var handlers_1 = __webpack_require__(3);
1629
- var globalVars_1 = __webpack_require__(6);
1630
- var interfaces_1 = __webpack_require__(7);
1664
+ var globalVars_1 = __webpack_require__(7);
1665
+ var interfaces_1 = __webpack_require__(6);
1631
1666
  var constants_2 = __webpack_require__(4);
1632
1667
  function initializePrivateApis() {
1633
1668
  menus_1.menus.initialize();
@@ -1847,6 +1882,22 @@ var handlers_1 = __webpack_require__(3);
1847
1882
  */
1848
1883
  var menus;
1849
1884
  (function (menus) {
1885
+ /**
1886
+ * Defines how a menu item should appear in the NavBar.
1887
+ */
1888
+ var DisplayMode;
1889
+ (function (DisplayMode) {
1890
+ /**
1891
+ * Only place this item in the NavBar if there's room for it.
1892
+ * If there's no room, item is shown in the overflow menu.
1893
+ */
1894
+ DisplayMode[DisplayMode["ifRoom"] = 0] = "ifRoom";
1895
+ /**
1896
+ * Never place this item in the NavBar.
1897
+ * The item would always be shown in NavBar's overflow menu.
1898
+ */
1899
+ DisplayMode[DisplayMode["overflowOnly"] = 1] = "overflowOnly";
1900
+ })(DisplayMode = menus.DisplayMode || (menus.DisplayMode = {}));
1850
1901
  /**
1851
1902
  * Represents information about menu item for Action Menu and Navigation Bar Menu.
1852
1903
  */
@@ -2013,8 +2064,8 @@ var __extends = (this && this.__extends) || (function () {
2013
2064
  })();
2014
2065
  Object.defineProperty(exports, "__esModule", { value: true });
2015
2066
  exports.media = void 0;
2016
- var globalVars_1 = __webpack_require__(6);
2017
- var interfaces_1 = __webpack_require__(7);
2067
+ var globalVars_1 = __webpack_require__(7);
2068
+ var interfaces_1 = __webpack_require__(6);
2018
2069
  var internalAPIs_1 = __webpack_require__(1);
2019
2070
  var constants_1 = __webpack_require__(2);
2020
2071
  var utils_1 = __webpack_require__(5);
@@ -2189,6 +2240,87 @@ var media;
2189
2240
  return Media;
2190
2241
  }(File));
2191
2242
  media.Media = Media;
2243
+ /**
2244
+ * @private
2245
+ * Hide from docs
2246
+ * --------
2247
+ * Base class which holds the callback and notifies events to the host client
2248
+ */
2249
+ var MediaController = /** @class */ (function () {
2250
+ function MediaController(controllerCallback) {
2251
+ this.controllerCallback = controllerCallback;
2252
+ }
2253
+ /**
2254
+ * @private
2255
+ * Hide from docs
2256
+ * --------
2257
+ * Function to notify the host client to programatically control the experience
2258
+ * @param mediaEvent indicates what the event that needs to be signaled to the host client
2259
+ * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
2260
+ */
2261
+ MediaController.prototype.notifyEventToHost = function (mediaEvent, callback) {
2262
+ (0, internalAPIs_1.ensureInitialized)(constants_1.FrameContexts.content, constants_1.FrameContexts.task);
2263
+ var err = (0, internalAPIs_1.isApiSupportedOnMobile)(constants_2.nonFullScreenVideoModeAPISupportVersion);
2264
+ if (err) {
2265
+ if (callback) {
2266
+ callback(err);
2267
+ }
2268
+ return;
2269
+ }
2270
+ var params = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };
2271
+ (0, communication_1.sendMessageToParent)('media.controller', [params], function (err) {
2272
+ if (callback) {
2273
+ callback(err);
2274
+ }
2275
+ });
2276
+ };
2277
+ /**
2278
+ * Function to programatically stop the ongoing media event
2279
+ * Optional; @param callback is used to send app if host client has successfully stopped the event or not
2280
+ */
2281
+ MediaController.prototype.stop = function (callback) {
2282
+ this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);
2283
+ };
2284
+ return MediaController;
2285
+ }());
2286
+ /**
2287
+ * VideoController class is used to communicate between the app and the host client during the video capture flow
2288
+ */
2289
+ var VideoController = /** @class */ (function (_super) {
2290
+ __extends(VideoController, _super);
2291
+ function VideoController() {
2292
+ return _super !== null && _super.apply(this, arguments) || this;
2293
+ }
2294
+ VideoController.prototype.getMediaType = function () {
2295
+ return MediaType.Video;
2296
+ };
2297
+ VideoController.prototype.notifyEventToApp = function (mediaEvent) {
2298
+ if (!this.controllerCallback) {
2299
+ // Early return as app has not registered with the callback
2300
+ return;
2301
+ }
2302
+ switch (mediaEvent) {
2303
+ case MediaControllerEvent.StartRecording:
2304
+ if (this.controllerCallback.onRecordingStarted) {
2305
+ this.controllerCallback.onRecordingStarted();
2306
+ break;
2307
+ }
2308
+ }
2309
+ };
2310
+ return VideoController;
2311
+ }(MediaController));
2312
+ media.VideoController = VideoController;
2313
+ /**
2314
+ * @private
2315
+ * Hide from docs
2316
+ * --------
2317
+ * Events which are used to communicate between the app and the host client during the media recording flow
2318
+ */
2319
+ var MediaControllerEvent;
2320
+ (function (MediaControllerEvent) {
2321
+ MediaControllerEvent[MediaControllerEvent["StartRecording"] = 1] = "StartRecording";
2322
+ MediaControllerEvent[MediaControllerEvent["StopRecording"] = 2] = "StopRecording";
2323
+ })(MediaControllerEvent || (MediaControllerEvent = {}));
2192
2324
  /**
2193
2325
  * The modes in which camera can be launched in select Media API
2194
2326
  */
@@ -2213,7 +2345,7 @@ var media;
2213
2345
  var MediaType;
2214
2346
  (function (MediaType) {
2215
2347
  MediaType[MediaType["Image"] = 1] = "Image";
2216
- // Video = 2, // Not implemented yet
2348
+ MediaType[MediaType["Video"] = 2] = "Video";
2217
2349
  MediaType[MediaType["VideoAndImage"] = 3] = "VideoAndImage";
2218
2350
  MediaType[MediaType["Audio"] = 4] = "Audio";
2219
2351
  })(MediaType = media.MediaType || (media.MediaType = {}));
@@ -2225,6 +2357,14 @@ var media;
2225
2357
  ImageUriType[ImageUriType["ID"] = 1] = "ID";
2226
2358
  ImageUriType[ImageUriType["URL"] = 2] = "URL";
2227
2359
  })(ImageUriType = media.ImageUriType || (media.ImageUriType = {}));
2360
+ /**
2361
+ * Specifies the image output formats.
2362
+ */
2363
+ var ImageOutputFormats;
2364
+ (function (ImageOutputFormats) {
2365
+ ImageOutputFormats[ImageOutputFormats["IMAGE"] = 1] = "IMAGE";
2366
+ ImageOutputFormats[ImageOutputFormats["PDF"] = 2] = "PDF";
2367
+ })(ImageOutputFormats = media.ImageOutputFormats || (media.ImageOutputFormats = {}));
2228
2368
  /**
2229
2369
  * Select an attachment using camera/gallery
2230
2370
  * @param mediaInputs The input params to customize the media to be selected
@@ -2240,17 +2380,10 @@ var media;
2240
2380
  callback(oldPlatformError, null);
2241
2381
  return;
2242
2382
  }
2243
- if ((0, mediaUtil_1.isMediaCallForVideoAndImageInputs)(mediaInputs)) {
2244
- if (globalVars_1.GlobalVars.hostClientType != constants_1.HostClientType.android && globalVars_1.GlobalVars.hostClientType != constants_1.HostClientType.ios) {
2245
- var notSupportedError = { errorCode: interfaces_1.ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
2246
- callback(notSupportedError, null);
2247
- return;
2248
- }
2249
- else if (!(0, internalAPIs_1.isAPISupportedByPlatform)(constants_2.videoAndImageMediaAPISupportVersion)) {
2250
- var oldPlatformError = { errorCode: interfaces_1.ErrorCode.OLD_PLATFORM };
2251
- callback(oldPlatformError, null);
2252
- return;
2253
- }
2383
+ var err = (0, mediaUtil_1.isMediaCallSupportedOnMobile)(mediaInputs);
2384
+ if (err) {
2385
+ callback(err, null);
2386
+ return;
2254
2387
  }
2255
2388
  if (!(0, mediaUtil_1.validateSelectMediaInputs)(mediaInputs)) {
2256
2389
  var invalidInput = { errorCode: interfaces_1.ErrorCode.INVALID_ARGUMENTS };
@@ -2258,8 +2391,16 @@ var media;
2258
2391
  return;
2259
2392
  }
2260
2393
  var params = [mediaInputs];
2261
- // What comes back from native at attachments would just be objects and will be missing getMedia method on them.
2262
- (0, communication_1.sendMessageToParent)('selectMedia', params, function (err, localAttachments) {
2394
+ // What comes back from native as attachments would just be objects and will be missing getMedia method on them
2395
+ (0, communication_1.sendMessageToParent)('selectMedia', params, function (err, localAttachments, mediaEvent) {
2396
+ // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
2397
+ if (mediaEvent) {
2398
+ if ((0, mediaUtil_1.isVideoControllerRegistered)(mediaInputs)) {
2399
+ mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);
2400
+ }
2401
+ return;
2402
+ }
2403
+ // Media Attachments are final response to selectMedia
2263
2404
  if (!localAttachments) {
2264
2405
  callback(err, null);
2265
2406
  return;
@@ -2342,8 +2483,10 @@ var media;
2342
2483
  "use strict";
2343
2484
 
2344
2485
  Object.defineProperty(exports, "__esModule", { value: true });
2345
- exports.validatePeoplePickerInput = exports.validateScanBarCodeInput = exports.validateViewImagesInput = exports.validateGetMediaInputs = exports.isMediaCallForVideoAndImageInputs = exports.validateSelectMediaInputs = exports.decodeAttachment = exports.createFile = void 0;
2486
+ exports.validatePeoplePickerInput = exports.validateScanBarCodeInput = exports.validateViewImagesInput = exports.validateGetMediaInputs = exports.isMediaCallForNonFullScreenVideoMode = exports.isMediaCallForVideoAndImageInputs = exports.isMediaCallForImageOutputFormats = exports.validateSelectMediaInputs = exports.isVideoControllerRegistered = exports.isMediaCallSupportedOnMobile = exports.decodeAttachment = exports.createFile = void 0;
2346
2487
  var media_1 = __webpack_require__(17);
2488
+ var constants_1 = __webpack_require__(4);
2489
+ var internalAPIs_1 = __webpack_require__(1);
2347
2490
  /**
2348
2491
  * Helper function to create a blob from media chunks based on their sequence
2349
2492
  */
@@ -2390,6 +2533,34 @@ function decodeAttachment(attachment, mimeType) {
2390
2533
  return assemble;
2391
2534
  }
2392
2535
  exports.decodeAttachment = decodeAttachment;
2536
+ /**
2537
+ * Function returns null if the media call is supported on current mobile version, else SdkError.
2538
+ */
2539
+ function isMediaCallSupportedOnMobile(mediaInputs) {
2540
+ if (isMediaCallForVideoAndImageInputs(mediaInputs)) {
2541
+ return (0, internalAPIs_1.isApiSupportedOnMobile)(constants_1.videoAndImageMediaAPISupportVersion);
2542
+ }
2543
+ else if (isMediaCallForNonFullScreenVideoMode(mediaInputs)) {
2544
+ return (0, internalAPIs_1.isApiSupportedOnMobile)(constants_1.nonFullScreenVideoModeAPISupportVersion);
2545
+ }
2546
+ else if (isMediaCallForImageOutputFormats(mediaInputs)) {
2547
+ return (0, internalAPIs_1.isApiSupportedOnMobile)(constants_1.imageOutputFormatsAPISupportVersion);
2548
+ }
2549
+ return null;
2550
+ }
2551
+ exports.isMediaCallSupportedOnMobile = isMediaCallSupportedOnMobile;
2552
+ /**
2553
+ * Function returns true if the app has registered to listen to video controller events, else false.
2554
+ */
2555
+ function isVideoControllerRegistered(mediaInputs) {
2556
+ if (mediaInputs.mediaType == media_1.media.MediaType.Video &&
2557
+ mediaInputs.videoProps &&
2558
+ mediaInputs.videoProps.videoController) {
2559
+ return true;
2560
+ }
2561
+ return false;
2562
+ }
2563
+ exports.isVideoControllerRegistered = isVideoControllerRegistered;
2393
2564
  /**
2394
2565
  * Returns true if the mediaInput params are valid and false otherwise
2395
2566
  */
@@ -2400,18 +2571,40 @@ function validateSelectMediaInputs(mediaInputs) {
2400
2571
  return true;
2401
2572
  }
2402
2573
  exports.validateSelectMediaInputs = validateSelectMediaInputs;
2574
+ /**
2575
+ * Returns true if the mediaInput params are called for mediatype Image and contains Image outputs formats, false otherwise
2576
+ */
2577
+ function isMediaCallForImageOutputFormats(mediaInputs) {
2578
+ var _a;
2579
+ if ((mediaInputs === null || mediaInputs === void 0 ? void 0 : mediaInputs.mediaType) == media_1.media.MediaType.Image && ((_a = mediaInputs === null || mediaInputs === void 0 ? void 0 : mediaInputs.imageProps) === null || _a === void 0 ? void 0 : _a.imageOutputFormats)) {
2580
+ return true;
2581
+ }
2582
+ return false;
2583
+ }
2584
+ exports.isMediaCallForImageOutputFormats = isMediaCallForImageOutputFormats;
2403
2585
  /**
2404
2586
  * Returns true if the mediaInput params are called for mediatype VideoAndImage and false otherwise
2405
2587
  */
2406
2588
  function isMediaCallForVideoAndImageInputs(mediaInputs) {
2407
- if (mediaInputs) {
2408
- if (mediaInputs.mediaType == media_1.media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps) {
2409
- return true;
2410
- }
2589
+ if (mediaInputs && (mediaInputs.mediaType == media_1.media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps)) {
2590
+ return true;
2411
2591
  }
2412
2592
  return false;
2413
2593
  }
2414
2594
  exports.isMediaCallForVideoAndImageInputs = isMediaCallForVideoAndImageInputs;
2595
+ /**
2596
+ * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise
2597
+ */
2598
+ function isMediaCallForNonFullScreenVideoMode(mediaInputs) {
2599
+ if (mediaInputs &&
2600
+ mediaInputs.mediaType == media_1.media.MediaType.Video &&
2601
+ mediaInputs.videoProps &&
2602
+ !mediaInputs.videoProps.isFullScreenMode) {
2603
+ return true;
2604
+ }
2605
+ return false;
2606
+ }
2607
+ exports.isMediaCallForNonFullScreenVideoMode = isMediaCallForNonFullScreenVideoMode;
2415
2608
  /**
2416
2609
  * Returns true if the get Media params are valid and false otherwise
2417
2610
  */
@@ -2873,7 +3066,7 @@ var appInitialization;
2873
3066
  Object.defineProperty(exports, "__esModule", { value: true });
2874
3067
  exports.initializeWithFrameContext = exports.setFrameContext = exports.executeDeepLink = exports.shareDeepLink = exports.getMruTabInstances = exports.getTabInstances = exports.registerEnterSettingsHandler = exports.registerFocusEnterHandler = exports.registerBeforeUnloadHandler = exports.registerOnLoadHandler = exports.registerBackButtonHandler = exports.registerAppButtonHoverLeaveHandler = exports.registerAppButtonHoverEnterHandler = exports.registerAppButtonClickHandler = exports.registerFullScreenHandler = exports.registerOnThemeChangeHandler = exports.getContext = exports.print = exports.enablePrintCapability = exports._uninitialize = exports._initialize = exports.initialize = void 0;
2875
3068
  var internalAPIs_1 = __webpack_require__(1);
2876
- var globalVars_1 = __webpack_require__(6);
3069
+ var globalVars_1 = __webpack_require__(7);
2877
3070
  var constants_1 = __webpack_require__(4);
2878
3071
  var settings_1 = __webpack_require__(12);
2879
3072
  var utils_1 = __webpack_require__(5);
@@ -3273,7 +3466,7 @@ var tasks;
3273
3466
  * @param taskInfo An object containing width and height properties
3274
3467
  */
3275
3468
  function updateTask(taskInfo) {
3276
- (0, internalAPIs_1.ensureInitialized)(constants_1.FrameContexts.content, constants_1.FrameContexts.sidePanel, constants_1.FrameContexts.task, constants_1.FrameContexts.meetingStage);
3469
+ (0, internalAPIs_1.ensureInitialized)(constants_1.FrameContexts.task);
3277
3470
  var width = taskInfo.width, height = taskInfo.height, extra = __rest(taskInfo, ["width", "height"]);
3278
3471
  if (!Object.keys(extra).length) {
3279
3472
  (0, communication_1.sendMessageToParent)('tasks.updateTask', [taskInfo]);
@@ -3289,7 +3482,7 @@ var tasks;
3289
3482
  * @param appIds Helps to validate that the call originates from the same appId as the one that invoked the task module
3290
3483
  */
3291
3484
  function submitTask(result, appIds) {
3292
- (0, internalAPIs_1.ensureInitialized)(constants_1.FrameContexts.content, constants_1.FrameContexts.sidePanel, constants_1.FrameContexts.task, constants_1.FrameContexts.meetingStage);
3485
+ (0, internalAPIs_1.ensureInitialized)(constants_1.FrameContexts.task);
3293
3486
  // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
3294
3487
  (0, communication_1.sendMessageToParent)('tasks.completeTask', [result, Array.isArray(appIds) ? appIds : [appIds]]);
3295
3488
  }
@@ -3305,7 +3498,7 @@ var tasks;
3305
3498
 
3306
3499
  Object.defineProperty(exports, "__esModule", { value: true });
3307
3500
  exports.location = void 0;
3308
- var interfaces_1 = __webpack_require__(7);
3501
+ var interfaces_1 = __webpack_require__(6);
3309
3502
  var internalAPIs_1 = __webpack_require__(1);
3310
3503
  var constants_1 = __webpack_require__(2);
3311
3504
  var communication_1 = __webpack_require__(0);
@@ -3500,6 +3693,8 @@ var meeting;
3500
3693
  }
3501
3694
  meeting.registerLiveStreamChangedHandler = registerLiveStreamChangedHandler;
3502
3695
  /**
3696
+ * @private
3697
+ * Hide from docs
3503
3698
  * Allows an app to share contents in the meeting
3504
3699
  * @param callback Callback contains 2 parameters, error and result.
3505
3700
  * error can either contain an error of type SdkError, incase of an error, or null when share is successful
@@ -3515,6 +3710,8 @@ var meeting;
3515
3710
  }
3516
3711
  meeting.shareAppContentToStage = shareAppContentToStage;
3517
3712
  /**
3713
+ * @private
3714
+ * Hide from docs
3518
3715
  * Provides information related app's in-meeting sharing capabilities
3519
3716
  * @param callback Callback contains 2 parameters, error and result.
3520
3717
  * error can either contain an error of type SdkError (error indication), or null (non-error indication)
@@ -3546,6 +3743,8 @@ var meeting;
3546
3743
  }
3547
3744
  meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
3548
3745
  /**
3746
+ * @private
3747
+ * Hide from docs
3549
3748
  * Provides information related to current stage sharing state for app
3550
3749
  * @param callback Callback contains 2 parameters, error and result.
3551
3750
  * error can either contain an error of type SdkError (error indication), or null (non-error indication)
@@ -3605,7 +3804,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3605
3804
  exports.people = void 0;
3606
3805
  var internalAPIs_1 = __webpack_require__(1);
3607
3806
  var constants_1 = __webpack_require__(2);
3608
- var interfaces_1 = __webpack_require__(7);
3807
+ var interfaces_1 = __webpack_require__(6);
3609
3808
  var mediaUtil_1 = __webpack_require__(18);
3610
3809
  var communication_1 = __webpack_require__(0);
3611
3810
  var constants_2 = __webpack_require__(4);
@@ -3736,7 +3935,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3736
3935
  exports.sharing = void 0;
3737
3936
  var internalAPIs_1 = __webpack_require__(1);
3738
3937
  var communication_1 = __webpack_require__(0);
3739
- var interfaces_1 = __webpack_require__(7);
3938
+ var interfaces_1 = __webpack_require__(6);
3740
3939
  var constants_1 = __webpack_require__(2);
3741
3940
  var sharing;
3742
3941
  (function (sharing) {
@@ -4307,19 +4506,47 @@ var files;
4307
4506
  CloudStorageProvider["Sharefile"] = "SHAREFILE";
4308
4507
  CloudStorageProvider["GoogleDrive"] = "GOOGLEDRIVE";
4309
4508
  CloudStorageProvider["Egnyte"] = "EGNYTE";
4509
+ CloudStorageProvider["SharePoint"] = "SharePoint";
4310
4510
  })(CloudStorageProvider = files.CloudStorageProvider || (files.CloudStorageProvider = {}));
4311
4511
  /**
4312
4512
  * @private
4313
4513
  * Hide from docs
4314
4514
  *
4315
- * Cloud storage provider integration type
4515
+ * Cloud storage provider type enums
4316
4516
  */
4317
4517
  var CloudStorageProviderType;
4318
4518
  (function (CloudStorageProviderType) {
4319
4519
  CloudStorageProviderType[CloudStorageProviderType["Sharepoint"] = 0] = "Sharepoint";
4320
4520
  CloudStorageProviderType[CloudStorageProviderType["WopiIntegration"] = 1] = "WopiIntegration";
4321
4521
  CloudStorageProviderType[CloudStorageProviderType["Google"] = 2] = "Google";
4522
+ CloudStorageProviderType[CloudStorageProviderType["OneDrive"] = 3] = "OneDrive";
4523
+ CloudStorageProviderType[CloudStorageProviderType["Recent"] = 4] = "Recent";
4524
+ CloudStorageProviderType[CloudStorageProviderType["Aggregate"] = 5] = "Aggregate";
4525
+ CloudStorageProviderType[CloudStorageProviderType["FileSystem"] = 6] = "FileSystem";
4526
+ CloudStorageProviderType[CloudStorageProviderType["Search"] = 7] = "Search";
4527
+ CloudStorageProviderType[CloudStorageProviderType["AllFiles"] = 8] = "AllFiles";
4528
+ CloudStorageProviderType[CloudStorageProviderType["SharedWithMe"] = 9] = "SharedWithMe";
4322
4529
  })(CloudStorageProviderType = files.CloudStorageProviderType || (files.CloudStorageProviderType = {}));
4530
+ /**
4531
+ * @private
4532
+ * Hide from docs
4533
+ *
4534
+ * Special Document Library enum
4535
+ */
4536
+ var SpecialDocumentLibraryType;
4537
+ (function (SpecialDocumentLibraryType) {
4538
+ SpecialDocumentLibraryType["ClassMaterials"] = "classMaterials";
4539
+ })(SpecialDocumentLibraryType = files.SpecialDocumentLibraryType || (files.SpecialDocumentLibraryType = {}));
4540
+ /**
4541
+ * @private
4542
+ * Hide from docs
4543
+ *
4544
+ * Document Library Access enum
4545
+ */
4546
+ var DocumentLibraryAccessType;
4547
+ (function (DocumentLibraryAccessType) {
4548
+ DocumentLibraryAccessType["Readonly"] = "readonly";
4549
+ })(DocumentLibraryAccessType = files.DocumentLibraryAccessType || (files.DocumentLibraryAccessType = {}));
4323
4550
  /**
4324
4551
  * @private
4325
4552
  * Hide from docs
@@ -4330,7 +4557,7 @@ var files;
4330
4557
  */
4331
4558
  function getCloudStorageFolders(channelId, callback) {
4332
4559
  (0, internalAPIs_1.ensureInitialized)(public_1.FrameContexts.content);
4333
- if (!channelId || channelId.length == 0) {
4560
+ if (!channelId || channelId.length === 0) {
4334
4561
  throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
4335
4562
  }
4336
4563
  if (!callback) {
@@ -4349,7 +4576,7 @@ var files;
4349
4576
  */
4350
4577
  function addCloudStorageFolder(channelId, callback) {
4351
4578
  (0, internalAPIs_1.ensureInitialized)(public_1.FrameContexts.content);
4352
- if (!channelId || channelId.length == 0) {
4579
+ if (!channelId || channelId.length === 0) {
4353
4580
  throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
4354
4581
  }
4355
4582
  if (!callback) {
@@ -4424,6 +4651,48 @@ var files;
4424
4651
  (0, communication_1.sendMessageToParent)('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);
4425
4652
  }
4426
4653
  files.openCloudStorageFile = openCloudStorageFile;
4654
+ /**
4655
+ * @private
4656
+ * Allow 1st party apps to call this function to get the external
4657
+ * third party cloud storage accounts that the tenant supports
4658
+ * @param excludeAddedProviders: return a list of support third party
4659
+ * cloud storages that hasn't been added yet.
4660
+ */
4661
+ function getExternalProviders(excludeAddedProviders, callback) {
4662
+ if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
4663
+ (0, internalAPIs_1.ensureInitialized)(public_1.FrameContexts.content);
4664
+ if (!callback) {
4665
+ throw new Error('[files.getExternalProviders] Callback cannot be null');
4666
+ }
4667
+ (0, communication_1.sendMessageToParent)('files.getExternalProviders', [excludeAddedProviders], callback);
4668
+ }
4669
+ files.getExternalProviders = getExternalProviders;
4670
+ /**
4671
+ * @private
4672
+ * Allow 1st party apps to call this function to move files
4673
+ * among SharePoint and third party cloud storages.
4674
+ */
4675
+ function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove, callback) {
4676
+ if (isMove === void 0) { isMove = false; }
4677
+ (0, internalAPIs_1.ensureInitialized)(public_1.FrameContexts.content);
4678
+ if (!selectedFiles || selectedFiles.length === 0) {
4679
+ throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
4680
+ }
4681
+ if (!providerCode) {
4682
+ throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');
4683
+ }
4684
+ if (!destinationFolder) {
4685
+ throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');
4686
+ }
4687
+ if (!destinationProviderCode) {
4688
+ throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');
4689
+ }
4690
+ if (!callback) {
4691
+ throw new Error('[files.copyMoveFiles] callback cannot be null');
4692
+ }
4693
+ (0, communication_1.sendMessageToParent)('files.copyMoveFiles', [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove], callback);
4694
+ }
4695
+ files.copyMoveFiles = copyMoveFiles;
4427
4696
  })(files = exports.files || (exports.files = {}));
4428
4697
 
4429
4698