@microsoft/teams-js 2.12.0-beta.1 → 2.12.1-beta.0

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/README.md CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.11.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.12.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.11.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-eCh6qbZkXfEZapUgP+aGo0x6qEpGiryOoYXrQr6BLrtZ988BjkbaVyRh1rQef3q9"
48
+ src="https://res.cdn.office.net/teams-js/2.12.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-H8/uiTqHq6b1eqm04U0wlhoD92qH4Ibgxrj4QLh8F5iomB4eqTdvi5dzPZkyKNxz"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.11.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.12.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -7311,6 +7311,12 @@ export namespace search {
7311
7311
  * @beta
7312
7312
  */
7313
7313
  function isSupported(): boolean;
7314
+ /**
7315
+ * Clear the host M365 application's search box
7316
+ *
7317
+ * @beta
7318
+ */
7319
+ function closeSearch(): Promise<void>;
7314
7320
  }
7315
7321
 
7316
7322
  /**
@@ -7517,7 +7523,10 @@ export namespace call {
7517
7523
  * Starts a call with other users
7518
7524
  *
7519
7525
  * @param startCallParams - Parameters for the call
7520
- * @returns If the call is accepted
7526
+ *
7527
+ * @throws Error if call capability is not supported
7528
+ * @throws Error if host notifies of a failed start call attempt in a legacy Teams environment
7529
+ * @returns always true if the host notifies of a successful call inititation
7521
7530
  */
7522
7531
  function startCall(startCallParams: StartCallParams): Promise<boolean>;
7523
7532
  /**
@@ -1059,6 +1059,8 @@ var errorLibraryNotInitialized = 'The library has not yet been initialized';
1059
1059
  var errorRuntimeNotInitialized = 'The runtime has not yet been initialized';
1060
1060
  /** @hidden */
1061
1061
  var errorRuntimeNotSupported = 'The runtime version is not supported';
1062
+ /** @hidden */
1063
+ var errorCallNotStarted = 'The call was not properly started';
1062
1064
 
1063
1065
  ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
1064
1066
  var GlobalVars = /** @class */ (function () {
@@ -2088,7 +2090,7 @@ var _minRuntimeConfigToUninitialize = {
2088
2090
  * @hidden
2089
2091
  * Package version.
2090
2092
  */
2091
- var version = "2.12.0-beta.1";
2093
+ var version = "2.12.1-beta.0";
2092
2094
 
2093
2095
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2094
2096
 
@@ -4853,8 +4855,8 @@ function sendAndHandleStatusAndReason(actionName) {
4853
4855
  args[_i - 1] = arguments[_i];
4854
4856
  }
4855
4857
  return sendMessageToParentAsync(actionName, args).then(function (_a) {
4856
- var status = _a[0], reason = _a[1];
4857
- if (!status) {
4858
+ var wasSuccessful = _a[0], reason = _a[1];
4859
+ if (!wasSuccessful) {
4858
4860
  throw new Error(reason);
4859
4861
  }
4860
4862
  });
@@ -4869,8 +4871,8 @@ function sendAndHandleStatusAndReasonWithDefaultError(actionName, defaultError)
4869
4871
  args[_i - 2] = arguments[_i];
4870
4872
  }
4871
4873
  return sendMessageToParentAsync(actionName, args).then(function (_a) {
4872
- var status = _a[0], reason = _a[1];
4873
- if (!status) {
4874
+ var wasSuccessful = _a[0], reason = _a[1];
4875
+ if (!wasSuccessful) {
4874
4876
  throw new Error(reason ? reason : defaultError);
4875
4877
  }
4876
4878
  });
@@ -8411,6 +8413,21 @@ var search;
8411
8413
  return ensureInitialized(runtime) && runtime.supports.search ? true : false;
8412
8414
  }
8413
8415
  search.isSupported = isSupported;
8416
+ /**
8417
+ * Clear the host M365 application's search box
8418
+ *
8419
+ * @beta
8420
+ */
8421
+ function closeSearch() {
8422
+ return new Promise(function (resolve) {
8423
+ ensureInitialized(runtime, FrameContexts.content);
8424
+ if (!isSupported()) {
8425
+ throw new Error('Not supported');
8426
+ }
8427
+ resolve(sendAndHandleStatusAndReason('search.closeSearch'));
8428
+ });
8429
+ }
8430
+ search.closeSearch = closeSearch;
8414
8431
  })(search || (search = {}));
8415
8432
 
8416
8433
  ;// CONCATENATED MODULE: ./src/public/sharing.ts
@@ -8632,7 +8649,10 @@ var call;
8632
8649
  * Starts a call with other users
8633
8650
  *
8634
8651
  * @param startCallParams - Parameters for the call
8635
- * @returns If the call is accepted
8652
+ *
8653
+ * @throws Error if call capability is not supported
8654
+ * @throws Error if host notifies of a failed start call attempt in a legacy Teams environment
8655
+ * @returns always true if the host notifies of a successful call inititation
8636
8656
  */
8637
8657
  function startCall(startCallParams) {
8638
8658
  return new Promise(function (resolve) {
@@ -8642,7 +8662,12 @@ var call;
8642
8662
  throw errorNotSupportedOnPlatform;
8643
8663
  }
8644
8664
  if (runtime.isLegacyTeams) {
8645
- resolve(sendAndHandleSdkError('executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)));
8665
+ resolve(sendAndUnwrap('executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then(function (result) {
8666
+ if (!result) {
8667
+ throw new Error(errorCallNotStarted);
8668
+ }
8669
+ return result;
8670
+ }));
8646
8671
  }
8647
8672
  else {
8648
8673
  return sendMessageToParent('call.startCall', [startCallParams], resolve);