@microsoft/teams-js 2.0.0-beta.4-dev.7 → 2.0.0-beta.4-dev.10

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.
@@ -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.7";
1124
+ var version = "2.0.0-beta.4-dev.10";
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.
@@ -1928,151 +1928,17 @@ var logs;
1928
1928
  logs.isSupported = isSupported;
1929
1929
  })(logs || (logs = {}));
1930
1930
 
1931
- ;// CONCATENATED MODULE: ./src/private/menus.ts
1932
-
1933
-
1934
-
1935
-
1936
- /**
1937
- * @hidden
1938
- * Namespace to interact with the menu-specific part of the SDK.
1939
- * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
1940
- *
1941
- * Hide from docs until feature is complete
1942
- * @alpha
1943
- */
1944
- var menus;
1945
- (function (menus) {
1946
- /**
1947
- * Defines how a menu item should appear in the NavBar.
1948
- */
1949
- var DisplayMode;
1950
- (function (DisplayMode) {
1951
- /**
1952
- * Only place this item in the NavBar if there's room for it.
1953
- * If there's no room, item is shown in the overflow menu.
1954
- */
1955
- DisplayMode[DisplayMode["ifRoom"] = 0] = "ifRoom";
1956
- /**
1957
- * Never place this item in the NavBar.
1958
- * The item would always be shown in NavBar's overflow menu.
1959
- */
1960
- DisplayMode[DisplayMode["overflowOnly"] = 1] = "overflowOnly";
1961
- })(DisplayMode = menus.DisplayMode || (menus.DisplayMode = {}));
1962
- /**
1963
- * @hidden
1964
- * Represents information about menu item for Action Menu and Navigation Bar Menu.
1965
- */
1966
- var MenuItem = /** @class */ (function () {
1967
- function MenuItem() {
1968
- /**
1969
- * @hidden
1970
- * State of the menu item
1971
- */
1972
- this.enabled = true;
1973
- /**
1974
- * @hidden
1975
- * Whether the menu item is selected or not
1976
- */
1977
- this.selected = false;
1978
- }
1979
- return MenuItem;
1980
- }());
1981
- menus.MenuItem = MenuItem;
1982
- /**
1983
- * @hidden
1984
- * Represents information about type of list to display in Navigation Bar Menu.
1985
- */
1986
- var MenuListType;
1987
- (function (MenuListType) {
1988
- MenuListType["dropDown"] = "dropDown";
1989
- MenuListType["popOver"] = "popOver";
1990
- })(MenuListType = menus.MenuListType || (menus.MenuListType = {}));
1991
- var navBarMenuItemPressHandler;
1992
- var actionMenuItemPressHandler;
1993
- var viewConfigItemPressHandler;
1994
- function initialize() {
1995
- registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);
1996
- registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);
1997
- registerHandler('setModuleView', handleViewConfigItemPress, false);
1998
- }
1999
- menus.initialize = initialize;
2000
- /**
2001
- * @hidden
2002
- * Registers list of view configurations and it's handler.
2003
- * Handler is responsible for listening selection of View Configuration.
2004
- *
2005
- * @param viewConfig - List of view configurations. Minimum 1 value is required.
2006
- * @param handler - The handler to invoke when the user selects view configuration.
2007
- */
2008
- function setUpViews(viewConfig, handler) {
2009
- ensureInitialized();
2010
- viewConfigItemPressHandler = handler;
2011
- sendMessageToParent('setUpViews', [viewConfig]);
2012
- }
2013
- menus.setUpViews = setUpViews;
2014
- function handleViewConfigItemPress(id) {
2015
- if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
2016
- ensureInitialized();
2017
- sendMessageToParent('viewConfigItemPress', [id]);
2018
- }
2019
- }
2020
- /**
2021
- * @hidden
2022
- * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
2023
- *
2024
- * @param items List of MenuItems for Navigation Bar Menu.
2025
- * @param handler The handler to invoke when the user selects menu item.
2026
- */
2027
- function setNavBarMenu(items, handler) {
2028
- ensureInitialized();
2029
- navBarMenuItemPressHandler = handler;
2030
- sendMessageToParent('setNavBarMenu', [items]);
2031
- }
2032
- menus.setNavBarMenu = setNavBarMenu;
2033
- function handleNavBarMenuItemPress(id) {
2034
- if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
2035
- ensureInitialized();
2036
- sendMessageToParent('handleNavBarMenuItemPress', [id]);
2037
- }
2038
- }
2039
- /**
2040
- * @hidden
2041
- * Used to show Action Menu.
2042
- *
2043
- * @param params - Parameters for Menu Parameters
2044
- * @param handler - The handler to invoke when the user selects menu item.
2045
- */
2046
- function showActionMenu(params, handler) {
2047
- ensureInitialized();
2048
- actionMenuItemPressHandler = handler;
2049
- sendMessageToParent('showActionMenu', [params]);
2050
- }
2051
- menus.showActionMenu = showActionMenu;
2052
- function handleActionMenuItemPress(id) {
2053
- if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
2054
- ensureInitialized();
2055
- sendMessageToParent('handleActionMenuItemPress', [id]);
2056
- }
2057
- }
2058
- function isSupported() {
2059
- return runtime.supports.menus ? true : false;
2060
- }
2061
- menus.isSupported = isSupported;
2062
- })(menus || (menus = {}));
2063
-
2064
1931
  ;// CONCATENATED MODULE: ./src/private/privateAPIs.ts
2065
1932
  /* eslint-disable @typescript-eslint/no-explicit-any */
2066
1933
 
2067
1934
 
2068
1935
 
2069
1936
 
2070
-
2071
1937
  /**
2072
1938
  * @internal
2073
1939
  */
2074
1940
  function initializePrivateApis() {
2075
- menus.initialize();
1941
+ //Keeping this API for any future usage, wherein privateAPIs need to be initialized
2076
1942
  }
2077
1943
  /**
2078
1944
  * @hidden
@@ -2542,6 +2408,135 @@ var authentication;
2542
2408
  }
2543
2409
  })(authentication || (authentication = {}));
2544
2410
 
2411
+ ;// CONCATENATED MODULE: ./src/public/menus.ts
2412
+
2413
+
2414
+
2415
+
2416
+ /**
2417
+ * Namespace to interact with the menu-specific part of the SDK.
2418
+ * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.
2419
+ */
2420
+ var menus;
2421
+ (function (menus) {
2422
+ /**
2423
+ * Defines how a menu item should appear in the NavBar.
2424
+ */
2425
+ var DisplayMode;
2426
+ (function (DisplayMode) {
2427
+ /**
2428
+ * Only place this item in the NavBar if there's room for it.
2429
+ * If there's no room, item is shown in the overflow menu.
2430
+ */
2431
+ DisplayMode[DisplayMode["ifRoom"] = 0] = "ifRoom";
2432
+ /**
2433
+ * Never place this item in the NavBar.
2434
+ * The item would always be shown in NavBar's overflow menu.
2435
+ */
2436
+ DisplayMode[DisplayMode["overflowOnly"] = 1] = "overflowOnly";
2437
+ })(DisplayMode = menus.DisplayMode || (menus.DisplayMode = {}));
2438
+ /**
2439
+ * @hidden
2440
+ * Represents information about menu item for Action Menu and Navigation Bar Menu.
2441
+ */
2442
+ var MenuItem = /** @class */ (function () {
2443
+ function MenuItem() {
2444
+ /**
2445
+ * @hidden
2446
+ * State of the menu item
2447
+ */
2448
+ this.enabled = true;
2449
+ /**
2450
+ * @hidden
2451
+ * Whether the menu item is selected or not
2452
+ */
2453
+ this.selected = false;
2454
+ }
2455
+ return MenuItem;
2456
+ }());
2457
+ menus.MenuItem = MenuItem;
2458
+ /**
2459
+ * @hidden
2460
+ * Represents information about type of list to display in Navigation Bar Menu.
2461
+ */
2462
+ var MenuListType;
2463
+ (function (MenuListType) {
2464
+ MenuListType["dropDown"] = "dropDown";
2465
+ MenuListType["popOver"] = "popOver";
2466
+ })(MenuListType = menus.MenuListType || (menus.MenuListType = {}));
2467
+ var navBarMenuItemPressHandler;
2468
+ var actionMenuItemPressHandler;
2469
+ var viewConfigItemPressHandler;
2470
+ function initialize() {
2471
+ registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);
2472
+ registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);
2473
+ registerHandler('setModuleView', handleViewConfigItemPress, false);
2474
+ }
2475
+ menus.initialize = initialize;
2476
+ /**
2477
+ * @hidden
2478
+ * Registers list of view configurations and it's handler.
2479
+ * Handler is responsible for listening selection of View Configuration.
2480
+ *
2481
+ * @param viewConfig - List of view configurations. Minimum 1 value is required.
2482
+ * @param handler - The handler to invoke when the user selects view configuration.
2483
+ */
2484
+ function setUpViews(viewConfig, handler) {
2485
+ ensureInitialized();
2486
+ viewConfigItemPressHandler = handler;
2487
+ sendMessageToParent('setUpViews', [viewConfig]);
2488
+ }
2489
+ menus.setUpViews = setUpViews;
2490
+ function handleViewConfigItemPress(id) {
2491
+ if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
2492
+ ensureInitialized();
2493
+ sendMessageToParent('viewConfigItemPress', [id]);
2494
+ }
2495
+ }
2496
+ /**
2497
+ * @hidden
2498
+ * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.
2499
+ *
2500
+ * @param items List of MenuItems for Navigation Bar Menu.
2501
+ * @param handler The handler to invoke when the user selects menu item.
2502
+ */
2503
+ function setNavBarMenu(items, handler) {
2504
+ ensureInitialized();
2505
+ navBarMenuItemPressHandler = handler;
2506
+ sendMessageToParent('setNavBarMenu', [items]);
2507
+ }
2508
+ menus.setNavBarMenu = setNavBarMenu;
2509
+ function handleNavBarMenuItemPress(id) {
2510
+ if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
2511
+ ensureInitialized();
2512
+ sendMessageToParent('handleNavBarMenuItemPress', [id]);
2513
+ }
2514
+ }
2515
+ /**
2516
+ * @hidden
2517
+ * Used to show Action Menu.
2518
+ *
2519
+ * @param params - Parameters for Menu Parameters
2520
+ * @param handler - The handler to invoke when the user selects menu item.
2521
+ */
2522
+ function showActionMenu(params, handler) {
2523
+ ensureInitialized();
2524
+ actionMenuItemPressHandler = handler;
2525
+ sendMessageToParent('showActionMenu', [params]);
2526
+ }
2527
+ menus.showActionMenu = showActionMenu;
2528
+ function handleActionMenuItemPress(id) {
2529
+ if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
2530
+ ensureInitialized();
2531
+ sendMessageToParent('handleActionMenuItemPress', [id]);
2532
+ }
2533
+ }
2534
+ function isSupported() {
2535
+ return runtime.supports.menus ? true : false;
2536
+ }
2537
+ menus.isSupported = isSupported;
2538
+ })(menus || (menus = {}));
2539
+
2545
2540
  ;// CONCATENATED MODULE: ./src/public/teamsAPIs.ts
2546
2541
 
2547
2542
  // Conflict with some names
@@ -2630,6 +2625,7 @@ var teamsCore;
2630
2625
 
2631
2626
 
2632
2627
 
2628
+
2633
2629
  /**
2634
2630
  * Namespace to interact with app initialization and lifecycle.
2635
2631
  *
@@ -2752,6 +2748,7 @@ var app_app;
2752
2748
  GlobalVars.initializeCompleted = true;
2753
2749
  });
2754
2750
  authentication.initialize();
2751
+ menus.initialize();
2755
2752
  pages.config.initialize();
2756
2753
  initializePrivateApis();
2757
2754
  }
@@ -5628,27 +5625,21 @@ var sharing;
5628
5625
 
5629
5626
 
5630
5627
 
5628
+
5631
5629
  /**
5632
5630
  * Namespace to interact with the stage view specific part of the SDK.
5633
5631
  */
5634
5632
  var stageView;
5635
5633
  (function (stageView) {
5636
- /**
5637
- * @hidden
5638
- * Feature is under development
5639
- *
5640
- * Opens a stage view to display a Teams app
5641
- * @param stageViewParams The parameters to pass into the stage view.
5642
- * @param callback Callback that will be triggered once the stage view is closed.
5643
- * The callback takes as an argument an SdkError in case something happened (i.e.
5644
- * no permissions to execute the API)
5645
- */
5646
5634
  function open(stageViewParams, callback) {
5647
5635
  ensureInitialized(FrameContexts.content);
5648
5636
  if (!stageViewParams) {
5649
5637
  throw new Error('[stageView.open] Stage view params cannot be null');
5650
5638
  }
5651
- sendMessageToParent('stageView.open', [stageViewParams], callback);
5639
+ var wrappedFunction = function () {
5640
+ return new Promise(function (resolve) { return resolve(sendAndHandleSdkError('stageView.open', stageViewParams)); });
5641
+ };
5642
+ return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(wrappedFunction, callback);
5652
5643
  }
5653
5644
  stageView.open = open;
5654
5645
  })(stageView || (stageView = {}));
@@ -6415,6 +6406,7 @@ var tasks;
6415
6406
 
6416
6407
 
6417
6408
 
6409
+
6418
6410
 
6419
6411
 
6420
6412
 
@@ -6432,7 +6424,7 @@ var tasks;
6432
6424
  * @alpha
6433
6425
  */
6434
6426
  var files;
6435
- (function (files) {
6427
+ (function (files_1) {
6436
6428
  /**
6437
6429
  * @hidden
6438
6430
  * Hide from docs
@@ -6447,7 +6439,7 @@ var files;
6447
6439
  CloudStorageProvider["GoogleDrive"] = "GOOGLEDRIVE";
6448
6440
  CloudStorageProvider["Egnyte"] = "EGNYTE";
6449
6441
  CloudStorageProvider["SharePoint"] = "SharePoint";
6450
- })(CloudStorageProvider = files.CloudStorageProvider || (files.CloudStorageProvider = {}));
6442
+ })(CloudStorageProvider = files_1.CloudStorageProvider || (files_1.CloudStorageProvider = {}));
6451
6443
  /**
6452
6444
  * @hidden
6453
6445
  * Hide from docs
@@ -6466,7 +6458,7 @@ var files;
6466
6458
  CloudStorageProviderType[CloudStorageProviderType["Search"] = 7] = "Search";
6467
6459
  CloudStorageProviderType[CloudStorageProviderType["AllFiles"] = 8] = "AllFiles";
6468
6460
  CloudStorageProviderType[CloudStorageProviderType["SharedWithMe"] = 9] = "SharedWithMe";
6469
- })(CloudStorageProviderType = files.CloudStorageProviderType || (files.CloudStorageProviderType = {}));
6461
+ })(CloudStorageProviderType = files_1.CloudStorageProviderType || (files_1.CloudStorageProviderType = {}));
6470
6462
  /**
6471
6463
  * @hidden
6472
6464
  * Hide from docs
@@ -6476,7 +6468,7 @@ var files;
6476
6468
  var SpecialDocumentLibraryType;
6477
6469
  (function (SpecialDocumentLibraryType) {
6478
6470
  SpecialDocumentLibraryType["ClassMaterials"] = "classMaterials";
6479
- })(SpecialDocumentLibraryType = files.SpecialDocumentLibraryType || (files.SpecialDocumentLibraryType = {}));
6471
+ })(SpecialDocumentLibraryType = files_1.SpecialDocumentLibraryType || (files_1.SpecialDocumentLibraryType = {}));
6480
6472
  /**
6481
6473
  * @hidden
6482
6474
  * Hide from docs
@@ -6486,7 +6478,19 @@ var files;
6486
6478
  var DocumentLibraryAccessType;
6487
6479
  (function (DocumentLibraryAccessType) {
6488
6480
  DocumentLibraryAccessType["Readonly"] = "readonly";
6489
- })(DocumentLibraryAccessType = files.DocumentLibraryAccessType || (files.DocumentLibraryAccessType = {}));
6481
+ })(DocumentLibraryAccessType = files_1.DocumentLibraryAccessType || (files_1.DocumentLibraryAccessType = {}));
6482
+ /**
6483
+ * @hidden
6484
+ * Hide from docs
6485
+ *
6486
+ * Download status enum
6487
+ */
6488
+ var FileDownloadStatus;
6489
+ (function (FileDownloadStatus) {
6490
+ FileDownloadStatus["Downloaded"] = "Downloaded";
6491
+ FileDownloadStatus["Downloading"] = "Downloading";
6492
+ FileDownloadStatus["Failed"] = "Failed";
6493
+ })(FileDownloadStatus = files_1.FileDownloadStatus || (files_1.FileDownloadStatus = {}));
6490
6494
  /**
6491
6495
  * @hidden
6492
6496
  * Hide from docs
@@ -6504,7 +6508,7 @@ var files;
6504
6508
  resolve(sendAndHandleSdkError('files.getCloudStorageFolders', channelId));
6505
6509
  });
6506
6510
  }
6507
- files.getCloudStorageFolders = getCloudStorageFolders;
6511
+ files_1.getCloudStorageFolders = getCloudStorageFolders;
6508
6512
  /**
6509
6513
  * @hidden
6510
6514
  * Hide from docs
@@ -6528,7 +6532,7 @@ var files;
6528
6532
  return result;
6529
6533
  });
6530
6534
  }
6531
- files.addCloudStorageFolder = addCloudStorageFolder;
6535
+ files_1.addCloudStorageFolder = addCloudStorageFolder;
6532
6536
  /**
6533
6537
  * @hidden
6534
6538
  * Hide from docs
@@ -6550,7 +6554,7 @@ var files;
6550
6554
  resolve(sendAndHandleSdkError('files.deleteCloudStorageFolder', channelId, folderToDelete));
6551
6555
  });
6552
6556
  }
6553
- files.deleteCloudStorageFolder = deleteCloudStorageFolder;
6557
+ files_1.deleteCloudStorageFolder = deleteCloudStorageFolder;
6554
6558
  /**
6555
6559
  * @hidden
6556
6560
  * Hide from docs
@@ -6572,7 +6576,7 @@ var files;
6572
6576
  resolve(sendAndHandleSdkError('files.getCloudStorageFolderContents', folder, providerCode));
6573
6577
  });
6574
6578
  }
6575
- files.getCloudStorageFolderContents = getCloudStorageFolderContents;
6579
+ files_1.getCloudStorageFolderContents = getCloudStorageFolderContents;
6576
6580
  /**
6577
6581
  * @hidden
6578
6582
  * Hide from docs
@@ -6593,7 +6597,7 @@ var files;
6593
6597
  }
6594
6598
  sendMessageToParent('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);
6595
6599
  }
6596
- files.openCloudStorageFile = openCloudStorageFile;
6600
+ files_1.openCloudStorageFile = openCloudStorageFile;
6597
6601
  /**
6598
6602
  * @hidden
6599
6603
  * Hide from docs.
@@ -6622,7 +6626,7 @@ var files;
6622
6626
  ];
6623
6627
  sendMessageToParent('openFilePreview', params);
6624
6628
  }
6625
- files.openFilePreview = openFilePreview;
6629
+ files_1.openFilePreview = openFilePreview;
6626
6630
  /**
6627
6631
  * @hidden
6628
6632
  * Allow 1st party apps to call this function to get the external
@@ -6637,7 +6641,7 @@ var files;
6637
6641
  resolve(sendAndHandleSdkError('files.getExternalProviders', excludeAddedProviders));
6638
6642
  });
6639
6643
  }
6640
- files.getExternalProviders = getExternalProviders;
6644
+ files_1.getExternalProviders = getExternalProviders;
6641
6645
  /**
6642
6646
  * @hidden
6643
6647
  * Allow 1st party apps to call this function to move files
@@ -6662,11 +6666,37 @@ var files;
6662
6666
  resolve(sendAndHandleSdkError('files.copyMoveFiles', selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove));
6663
6667
  });
6664
6668
  }
6665
- files.copyMoveFiles = copyMoveFiles;
6669
+ files_1.copyMoveFiles = copyMoveFiles;
6666
6670
  function isSupported() {
6667
6671
  return runtime.supports.files ? true : false;
6668
6672
  }
6669
- files.isSupported = isSupported;
6673
+ files_1.isSupported = isSupported;
6674
+ /**
6675
+ * @hidden
6676
+ * Hide from docs
6677
+ * ------
6678
+ * Gets list of downloads for current user
6679
+ * @param callback Callback that will be triggered post downloads load
6680
+ */
6681
+ function getFileDownloads(callback) {
6682
+ ensureInitialized(FrameContexts.content);
6683
+ if (!callback) {
6684
+ throw new Error('[files.getFileDownloads] Callback cannot be null');
6685
+ }
6686
+ sendMessageToParent('files.getFileDownloads', [], callback);
6687
+ }
6688
+ files_1.getFileDownloads = getFileDownloads;
6689
+ /**
6690
+ * @hidden
6691
+ * Hide from docs
6692
+ * ------
6693
+ * Open download preference folder
6694
+ */
6695
+ function openDownloadFolder() {
6696
+ ensureInitialized(FrameContexts.content);
6697
+ sendMessageToParent('files.openDownloadFolder', []);
6698
+ }
6699
+ files_1.openDownloadFolder = openDownloadFolder;
6670
6700
  })(files || (files = {}));
6671
6701
 
6672
6702
  ;// CONCATENATED MODULE: ./src/private/legacy.ts
@@ -7183,7 +7213,6 @@ var teams;
7183
7213
 
7184
7214
 
7185
7215
 
7186
-
7187
7216
 
7188
7217
  ;// CONCATENATED MODULE: ./src/index.ts
7189
7218