@microsoft/teams-js 2.12.0 → 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.
@@ -7523,7 +7523,10 @@ export namespace call {
7523
7523
  * Starts a call with other users
7524
7524
  *
7525
7525
  * @param startCallParams - Parameters for the call
7526
- * @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
7527
7530
  */
7528
7531
  function startCall(startCallParams: StartCallParams): Promise<boolean>;
7529
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";
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
  });
@@ -8647,7 +8649,10 @@ var call;
8647
8649
  * Starts a call with other users
8648
8650
  *
8649
8651
  * @param startCallParams - Parameters for the call
8650
- * @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
8651
8656
  */
8652
8657
  function startCall(startCallParams) {
8653
8658
  return new Promise(function (resolve) {
@@ -8657,7 +8662,12 @@ var call;
8657
8662
  throw errorNotSupportedOnPlatform;
8658
8663
  }
8659
8664
  if (runtime.isLegacyTeams) {
8660
- 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
+ }));
8661
8671
  }
8662
8672
  else {
8663
8673
  return sendMessageToParent('call.startCall', [startCallParams], resolve);