@microsoft/teams-js 2.17.1-beta.1 → 2.18.0-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.
@@ -834,6 +834,8 @@ __webpack_require__.d(__webpack_exports__, {
834
834
  dialog: () => (/* reexport */ dialog),
835
835
  enablePrintCapability: () => (/* reexport */ enablePrintCapability),
836
836
  executeDeepLink: () => (/* reexport */ executeDeepLink),
837
+ externalAppAuthentication: () => (/* reexport */ externalAppAuthentication),
838
+ externalAppCardActions: () => (/* reexport */ externalAppCardActions),
837
839
  files: () => (/* reexport */ files),
838
840
  geoLocation: () => (/* reexport */ geoLocation),
839
841
  getAdaptiveCardSchemaVersion: () => (/* reexport */ getAdaptiveCardSchemaVersion),
@@ -958,6 +960,14 @@ var ApiName;
958
960
  ApiName["App_OpenLink"] = "app.openLink";
959
961
  ApiName["App_RegisterOnThemeChangeHandler"] = "app.registerOnThemeChangeHandler";
960
962
  ApiName["AppEntity_SelectAppEntity"] = "appEntity.selectAppEntity";
963
+ ApiName["BarCode_HasPermission"] = "barCode.hasPermission";
964
+ ApiName["BarCode_RequestPermission"] = "barCode.requestPermission";
965
+ ApiName["BarCode_ScanBarCode"] = "barCode.scanBarCode";
966
+ ApiName["Calendar_ComposeMeeting"] = "calendar.composeMeeting";
967
+ ApiName["Calendar_OpenCalendarItem"] = "calendar.openCalendarItem";
968
+ ApiName["Call_StartCall"] = "call.startCall";
969
+ ApiName["Clipboard_Read"] = "clipboard.read";
970
+ ApiName["Clipboard_Write"] = "clipboard.write";
961
971
  ApiName["Dialog_AdaptiveCard_Bot_Open"] = "dialog.adaptiveCard.bot.open";
962
972
  ApiName["Dialog_AdaptiveCard_Open"] = "dialog.adaptiveCard.open";
963
973
  ApiName["Dialog_Update_Resize"] = "dialog.update.resize";
@@ -973,6 +983,20 @@ var ApiName;
973
983
  ApiName["GeoLocation_ShowLocation"] = "geoLocation.showLocation";
974
984
  ApiName["Location_GetLocation"] = "location.getLocation";
975
985
  ApiName["Location_ShowLocation"] = "location.showLocation";
986
+ ApiName["Mail_ComposeMail"] = "mail.composeMail";
987
+ ApiName["Mail_OpenMailItem"] = "mail.openMailItem";
988
+ ApiName["Marketplace_AddOrUpdateCartItems"] = "marketplace.addOrUpdateCartItems";
989
+ ApiName["Marketplace_GetCart"] = "marketplace.getCart";
990
+ ApiName["Marketplace_RemoveCardItems"] = "marketplace.removeCartItems";
991
+ ApiName["Marketplace_UpdateCartStatus"] = "marketplace.updateCartStatus";
992
+ ApiName["Media_CaptureImage"] = "media.captureImage";
993
+ ApiName["Media_Controller"] = "media.controller";
994
+ ApiName["Media_GetMedia"] = "media.getMedia";
995
+ ApiName["Media_HasPermission"] = "media.hasPermission";
996
+ ApiName["Media_RequestPermission"] = "media.requestPermission";
997
+ ApiName["Media_ScanBarCode"] = "media.scanBarCode";
998
+ ApiName["Media_SelectMedia"] = "media.selectMedia";
999
+ ApiName["Media_ViewImages"] = "media.viewImages";
976
1000
  ApiName["Navigation_NavigateBack"] = "navigation.navigateBack";
977
1001
  ApiName["Navigation_NavigateCrossDomain"] = "navigation.navigateCrossDomain";
978
1002
  ApiName["Navigation_NavigateToTab"] = "navigation.navigateToTab";
@@ -1170,6 +1194,7 @@ var validOrigins = [
1170
1194
  'teams.cloud.microsoft',
1171
1195
  'outlook.cloud.microsoft',
1172
1196
  'm365.cloud.microsoft',
1197
+ 'copilot.microsoft.com',
1173
1198
  ];
1174
1199
  /**
1175
1200
  * @hidden
@@ -1348,6 +1373,9 @@ var SecondaryM365ContentIdName;
1348
1373
  /** User ID */
1349
1374
  SecondaryM365ContentIdName["UserId"] = "userId";
1350
1375
  })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
1376
+ function isSdkError(err) {
1377
+ return (err === null || err === void 0 ? void 0 : err.errorCode) !== undefined;
1378
+ }
1351
1379
  /** Error codes used to identify different types of errors that can occur while developing apps. */
1352
1380
  var ErrorCode;
1353
1381
  (function (ErrorCode) {
@@ -2405,7 +2433,7 @@ var _minRuntimeConfigToUninitialize = {
2405
2433
  * @hidden
2406
2434
  * Package version.
2407
2435
  */
2408
- var version = "2.17.1-beta.1";
2436
+ var version = "2.18.0-beta.0";
2409
2437
 
2410
2438
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2411
2439
 
@@ -6301,6 +6329,10 @@ var __extends = (undefined && undefined.__extends) || (function () {
6301
6329
 
6302
6330
 
6303
6331
 
6332
+ /**
6333
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
6334
+ */
6335
+ var mediaTelemetryVersionNumber = ApiVersionNumber.V_1;
6304
6336
  var mediaLogger = getLogger('media');
6305
6337
  /**
6306
6338
  * Interact with media, including capturing and viewing images.
@@ -6353,7 +6385,7 @@ var media;
6353
6385
  callback(oldPlatformError, []);
6354
6386
  return;
6355
6387
  }
6356
- sendMessageToParent('captureImage', callback);
6388
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_CaptureImage), 'captureImage', callback);
6357
6389
  }
6358
6390
  media.captureImage = captureImage;
6359
6391
  /**
@@ -6371,7 +6403,7 @@ var media;
6371
6403
  }
6372
6404
  var permissions = DevicePermission.Media;
6373
6405
  return new Promise(function (resolve) {
6374
- resolve(sendAndHandleSdkError('permissions.has', permissions));
6406
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_HasPermission), 'permissions.has', permissions));
6375
6407
  });
6376
6408
  }
6377
6409
  media.hasPermission = hasPermission;
@@ -6390,7 +6422,7 @@ var media;
6390
6422
  }
6391
6423
  var permissions = DevicePermission.Media;
6392
6424
  return new Promise(function (resolve) {
6393
- resolve(sendAndHandleSdkError('permissions.request', permissions));
6425
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_RequestPermission), 'permissions.request', permissions));
6394
6426
  });
6395
6427
  }
6396
6428
  media.requestPermission = requestPermission;
@@ -6485,7 +6517,7 @@ var media;
6485
6517
  }
6486
6518
  }
6487
6519
  }
6488
- sendMessageToParent('getMedia', localUriId, handleGetMediaCallbackRequest);
6520
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_GetMedia), 'getMedia', localUriId, handleGetMediaCallbackRequest);
6489
6521
  };
6490
6522
  /** Function to retrieve media content, such as images or videos, via handler. */
6491
6523
  Media.prototype.getMediaViaHandler = function (callback) {
@@ -6495,7 +6527,9 @@ var media;
6495
6527
  assembleAttachment: [],
6496
6528
  };
6497
6529
  var params = [actionName, this.content];
6498
- this.content && !isNullOrUndefined(callback) && sendMessageToParent('getMedia', params);
6530
+ this.content &&
6531
+ !isNullOrUndefined(callback) &&
6532
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_GetMedia), 'getMedia', params);
6499
6533
  function handleGetMediaRequest(response) {
6500
6534
  if (callback) {
6501
6535
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
@@ -6563,7 +6597,7 @@ var media;
6563
6597
  return;
6564
6598
  }
6565
6599
  var params = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };
6566
- sendMessageToParent('media.controller', [params], function (err) {
6600
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_Controller), 'media.controller', [params], function (err) {
6567
6601
  if (callback) {
6568
6602
  callback(err);
6569
6603
  }
@@ -6706,7 +6740,7 @@ var media;
6706
6740
  }
6707
6741
  var params = [mediaInputs];
6708
6742
  // What comes back from native as attachments would just be objects and will be missing getMedia method on them
6709
- sendMessageToParent('selectMedia', params, function (err, localAttachments, mediaEvent) {
6743
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_SelectMedia), 'selectMedia', params, function (err, localAttachments, mediaEvent) {
6710
6744
  var _a, _b;
6711
6745
  // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
6712
6746
  if (mediaEvent) {
@@ -6751,7 +6785,7 @@ var media;
6751
6785
  return;
6752
6786
  }
6753
6787
  var params = [uriList];
6754
- sendMessageToParent('viewImages', params, callback);
6788
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_ViewImages), 'viewImages', params, callback);
6755
6789
  }
6756
6790
  media.viewImages = viewImages;
6757
6791
  /**
@@ -6792,7 +6826,7 @@ var media;
6792
6826
  callback(invalidInput, '');
6793
6827
  return;
6794
6828
  }
6795
- sendMessageToParent('media.scanBarCode', [config], callback);
6829
+ communication_sendMessageToParentWithVersion(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_ScanBarCode), 'media.scanBarCode', [config], callback);
6796
6830
  }
6797
6831
  media.scanBarCode = scanBarCode;
6798
6832
  })(media || (media = {}));
@@ -7021,6 +7055,11 @@ function validatePeoplePickerInput(peoplePickerInputs) {
7021
7055
 
7022
7056
 
7023
7057
 
7058
+
7059
+ /**
7060
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
7061
+ */
7062
+ var barCodeTelemetryVersionNumber = ApiVersionNumber.V_2;
7024
7063
  /**
7025
7064
  * Namespace to interact with the barcode scanning-specific part of the SDK.
7026
7065
  *
@@ -7046,7 +7085,7 @@ var barCode;
7046
7085
  if (!validateScanBarCodeInput(barCodeConfig)) {
7047
7086
  throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
7048
7087
  }
7049
- resolve(sendAndHandleSdkError('media.scanBarCode', barCodeConfig));
7088
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_ScanBarCode), 'media.scanBarCode', barCodeConfig));
7050
7089
  });
7051
7090
  }
7052
7091
  barCode.scanBarCode = scanBarCode;
@@ -7064,7 +7103,7 @@ var barCode;
7064
7103
  }
7065
7104
  var permissions = DevicePermission.Media;
7066
7105
  return new Promise(function (resolve) {
7067
- resolve(sendAndHandleSdkError('permissions.has', permissions));
7106
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_HasPermission), 'permissions.has', permissions));
7068
7107
  });
7069
7108
  }
7070
7109
  barCode.hasPermission = hasPermission;
@@ -7082,7 +7121,7 @@ var barCode;
7082
7121
  }
7083
7122
  var permissions = DevicePermission.Media;
7084
7123
  return new Promise(function (resolve) {
7085
- resolve(sendAndHandleSdkError('permissions.request', permissions));
7124
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_RequestPermission), 'permissions.request', permissions));
7086
7125
  });
7087
7126
  }
7088
7127
  barCode.requestPermission = requestPermission;
@@ -7134,7 +7173,7 @@ var chat;
7134
7173
  }
7135
7174
  else {
7136
7175
  var sendPromise = sendAndHandleStatusAndReason('chat.openChat', {
7137
- members: openChatRequest.user,
7176
+ members: [openChatRequest.user],
7138
7177
  message: openChatRequest.message,
7139
7178
  });
7140
7179
  resolve(sendPromise);
@@ -7163,7 +7202,7 @@ var chat;
7163
7202
  user: openChatRequest.users[0],
7164
7203
  message: openChatRequest.message,
7165
7204
  };
7166
- openChat(chatRequest);
7205
+ resolve(openChat(chatRequest));
7167
7206
  }
7168
7207
  else {
7169
7208
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
@@ -7243,6 +7282,11 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
7243
7282
 
7244
7283
 
7245
7284
 
7285
+
7286
+ /**
7287
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
7288
+ */
7289
+ var clipboardTelemetryVersionNumber = ApiVersionNumber.V_2;
7246
7290
  /**
7247
7291
  * Interact with the system clipboard
7248
7292
  *
@@ -7281,7 +7325,7 @@ var clipboard;
7281
7325
  mimeType: blob.type,
7282
7326
  content: base64StringContent,
7283
7327
  };
7284
- return [2 /*return*/, sendAndHandleSdkError('clipboard.writeToClipboard', writeParams)];
7328
+ return [2 /*return*/, sendAndHandleSdkErrorWithVersion(getApiVersionTag(clipboardTelemetryVersionNumber, ApiName.Clipboard_Write), 'clipboard.writeToClipboard', writeParams)];
7285
7329
  }
7286
7330
  });
7287
7331
  });
@@ -7310,7 +7354,7 @@ var clipboard;
7310
7354
  case 1:
7311
7355
  response = _b.apply(_a, [_c.sent()]);
7312
7356
  return [2 /*return*/, base64ToBlob(response.mimeType, response.content)];
7313
- case 2: return [2 /*return*/, sendAndHandleSdkError('clipboard.readFromClipboard')];
7357
+ case 2: return [2 /*return*/, sendAndHandleSdkErrorWithVersion(getApiVersionTag(clipboardTelemetryVersionNumber, ApiName.Clipboard_Read), 'clipboard.readFromClipboard')];
7314
7358
  }
7315
7359
  });
7316
7360
  });
@@ -8323,6 +8367,11 @@ var meeting;
8323
8367
  });
8324
8368
  }); };
8325
8369
  registerHandler('meeting.micStateChanged', micStateChangedCallback);
8370
+ var audioDeviceSelectionChangedCallback = function (selectedDevicesInHost) {
8371
+ var _a;
8372
+ (_a = requestAppAudioHandlingParams.audioDeviceSelectionChangedCallback) === null || _a === void 0 ? void 0 : _a.call(requestAppAudioHandlingParams, selectedDevicesInHost);
8373
+ };
8374
+ registerHandler('meeting.audioDeviceSelectionChanged', audioDeviceSelectionChangedCallback);
8326
8375
  callback(isHostAudioless);
8327
8376
  };
8328
8377
  sendMessageToParent('meeting.requestAppAudioHandling', [requestAppAudioHandlingParams.isAppHandlingAudio], callbackInternalRequest);
@@ -8341,6 +8390,9 @@ var meeting;
8341
8390
  if (doesHandlerExist('meeting.micStateChanged')) {
8342
8391
  removeHandler('meeting.micStateChanged');
8343
8392
  }
8393
+ if (doesHandlerExist('meeting.audioDeviceSelectionChanged')) {
8394
+ removeHandler('meeting.audioDeviceSelectionChanged');
8395
+ }
8344
8396
  callback(isHostAudioless);
8345
8397
  };
8346
8398
  sendMessageToParent('meeting.requestAppAudioHandling', [requestAppAudioHandlingParams.isAppHandlingAudio], callbackInternalStop);
@@ -8428,6 +8480,11 @@ var monetization;
8428
8480
 
8429
8481
 
8430
8482
 
8483
+
8484
+ /**
8485
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
8486
+ */
8487
+ var calendarTelemetryVersionNumber = ApiVersionNumber.V_2;
8431
8488
  /**
8432
8489
  * Interact with the user's calendar, including opening calendar items and composing meetings.
8433
8490
  */
@@ -8447,7 +8504,7 @@ var calendar;
8447
8504
  if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {
8448
8505
  throw new Error('Must supply an itemId to openCalendarItem');
8449
8506
  }
8450
- resolve(sendAndHandleStatusAndReason('calendar.openCalendarItem', openCalendarItemParams));
8507
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_OpenCalendarItem), 'calendar.openCalendarItem', openCalendarItemParams));
8451
8508
  });
8452
8509
  }
8453
8510
  calendar.openCalendarItem = openCalendarItem;
@@ -8466,7 +8523,7 @@ var calendar;
8466
8523
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
8467
8524
  }
8468
8525
  else {
8469
- resolve(sendAndHandleStatusAndReason('calendar.composeMeeting', composeMeetingParams));
8526
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_ComposeMeeting), 'calendar.composeMeeting', composeMeetingParams));
8470
8527
  }
8471
8528
  });
8472
8529
  }
@@ -8488,6 +8545,11 @@ var calendar;
8488
8545
 
8489
8546
 
8490
8547
 
8548
+
8549
+ /**
8550
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
8551
+ */
8552
+ var mailTelemetryVersionNumber = ApiVersionNumber.V_2;
8491
8553
  /**
8492
8554
  * Used to interact with mail capability, including opening and composing mail.
8493
8555
  */
@@ -8507,7 +8569,7 @@ var mail;
8507
8569
  if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {
8508
8570
  throw new Error('Must supply an itemId to openMailItem');
8509
8571
  }
8510
- resolve(sendAndHandleStatusAndReason('mail.openMailItem', openMailItemParams));
8572
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(mailTelemetryVersionNumber, ApiName.Mail_OpenMailItem), 'mail.openMailItem', openMailItemParams));
8511
8573
  });
8512
8574
  }
8513
8575
  mail.openMailItem = openMailItem;
@@ -8523,7 +8585,7 @@ var mail;
8523
8585
  if (!isSupported()) {
8524
8586
  throw new Error('Not supported');
8525
8587
  }
8526
- resolve(sendAndHandleStatusAndReason('mail.composeMail', composeMailParams));
8588
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(mailTelemetryVersionNumber, ApiName.Mail_ComposeMail), 'mail.composeMail', composeMailParams));
8527
8589
  });
8528
8590
  }
8529
8591
  mail.composeMail = composeMail;
@@ -10499,6 +10561,11 @@ var webStorage;
10499
10561
 
10500
10562
 
10501
10563
 
10564
+
10565
+ /**
10566
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
10567
+ */
10568
+ var callTelemetryVersionNumber = ApiVersionNumber.V_2;
10502
10569
  /**
10503
10570
  * Used to interact with call functionality, including starting calls with other users.
10504
10571
  */
@@ -10528,6 +10595,7 @@ var call;
10528
10595
  * @returns always true if the host notifies of a successful call inititation
10529
10596
  */
10530
10597
  function startCall(startCallParams) {
10598
+ var apiVersionTag = getApiVersionTag(callTelemetryVersionNumber, ApiName.Call_StartCall);
10531
10599
  return new Promise(function (resolve) {
10532
10600
  var _a;
10533
10601
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
@@ -10535,7 +10603,7 @@ var call;
10535
10603
  throw errorNotSupportedOnPlatform;
10536
10604
  }
10537
10605
  if (runtime_runtime.isLegacyTeams) {
10538
- resolve(sendAndUnwrap('executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then(function (result) {
10606
+ resolve(sendAndUnwrapWithVersion(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then(function (result) {
10539
10607
  if (!result) {
10540
10608
  throw new Error(errorCallNotStarted);
10541
10609
  }
@@ -10543,7 +10611,7 @@ var call;
10543
10611
  }));
10544
10612
  }
10545
10613
  else {
10546
- return sendMessageToParent('call.startCall', [startCallParams], resolve);
10614
+ return communication_sendMessageToParentWithVersion(apiVersionTag, 'call.startCall', [startCallParams], resolve);
10547
10615
  }
10548
10616
  });
10549
10617
  }
@@ -11709,6 +11777,11 @@ var marketplace_assign = (undefined && undefined.__assign) || function () {
11709
11777
 
11710
11778
 
11711
11779
 
11780
+
11781
+ /**
11782
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
11783
+ */
11784
+ var marketplaceTelemetryVersionNumber = ApiVersionNumber.V_2;
11712
11785
  /**
11713
11786
  * @hidden
11714
11787
  * Namespace for an app to support a checkout flow by interacting with the marketplace cart in the host.
@@ -11807,7 +11880,7 @@ var marketplace;
11807
11880
  if (!isSupported()) {
11808
11881
  throw errorNotSupportedOnPlatform;
11809
11882
  }
11810
- return sendAndHandleSdkError('marketplace.getCart', marketplace.cartVersion).then(deserializeCart);
11883
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_GetCart), 'marketplace.getCart', marketplace.cartVersion).then(deserializeCart);
11811
11884
  }
11812
11885
  marketplace.getCart = getCart;
11813
11886
  /**
@@ -11827,7 +11900,7 @@ var marketplace;
11827
11900
  }
11828
11901
  validateUuid(addOrUpdateCartItemsParams === null || addOrUpdateCartItemsParams === void 0 ? void 0 : addOrUpdateCartItemsParams.cartId);
11829
11902
  validateCartItems(addOrUpdateCartItemsParams === null || addOrUpdateCartItemsParams === void 0 ? void 0 : addOrUpdateCartItemsParams.cartItems);
11830
- return sendAndHandleSdkError('marketplace.addOrUpdateCartItems', marketplace_assign(marketplace_assign({}, addOrUpdateCartItemsParams), { cartItems: serializeCartItems(addOrUpdateCartItemsParams.cartItems), cartVersion: marketplace.cartVersion })).then(deserializeCart);
11903
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_AddOrUpdateCartItems), 'marketplace.addOrUpdateCartItems', marketplace_assign(marketplace_assign({}, addOrUpdateCartItemsParams), { cartItems: serializeCartItems(addOrUpdateCartItemsParams.cartItems), cartVersion: marketplace.cartVersion })).then(deserializeCart);
11831
11904
  }
11832
11905
  marketplace.addOrUpdateCartItems = addOrUpdateCartItems;
11833
11906
  /**
@@ -11849,7 +11922,7 @@ var marketplace;
11849
11922
  if (!Array.isArray(removeCartItemsParams === null || removeCartItemsParams === void 0 ? void 0 : removeCartItemsParams.cartItemIds) || (removeCartItemsParams === null || removeCartItemsParams === void 0 ? void 0 : removeCartItemsParams.cartItemIds.length) === 0) {
11850
11923
  throw new Error('cartItemIds must be a non-empty array');
11851
11924
  }
11852
- return sendAndHandleSdkError('marketplace.removeCartItems', marketplace_assign(marketplace_assign({}, removeCartItemsParams), { cartVersion: marketplace.cartVersion })).then(deserializeCart);
11925
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_RemoveCardItems), 'marketplace.removeCartItems', marketplace_assign(marketplace_assign({}, removeCartItemsParams), { cartVersion: marketplace.cartVersion })).then(deserializeCart);
11853
11926
  }
11854
11927
  marketplace.removeCartItems = removeCartItems;
11855
11928
  /**
@@ -11869,7 +11942,7 @@ var marketplace;
11869
11942
  }
11870
11943
  validateUuid(updateCartStatusParams === null || updateCartStatusParams === void 0 ? void 0 : updateCartStatusParams.cartId);
11871
11944
  validateCartStatus(updateCartStatusParams === null || updateCartStatusParams === void 0 ? void 0 : updateCartStatusParams.cartStatus);
11872
- return sendAndHandleSdkError('marketplace.updateCartStatus', marketplace_assign(marketplace_assign({}, updateCartStatusParams), { cartVersion: marketplace.cartVersion })).then(deserializeCart);
11945
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_UpdateCartStatus), 'marketplace.updateCartStatus', marketplace_assign(marketplace_assign({}, updateCartStatusParams), { cartVersion: marketplace.cartVersion })).then(deserializeCart);
11873
11946
  }
11874
11947
  marketplace.updateCartStatus = updateCartStatus;
11875
11948
  /**
@@ -11925,6 +11998,307 @@ var marketplace;
11925
11998
 
11926
11999
 
11927
12000
 
12001
+
12002
+ ;// CONCATENATED MODULE: ./src/private/externalAppAuthentication.ts
12003
+
12004
+
12005
+
12006
+
12007
+
12008
+ /**
12009
+ * @hidden
12010
+ * Namespace to delegate authentication and message extension requests to the host
12011
+ * @internal
12012
+ * Limited to Microsoft-internal use
12013
+ */
12014
+ var externalAppAuthentication;
12015
+ (function (externalAppAuthentication) {
12016
+ /**
12017
+ * @hidden
12018
+ * This is the only allowed value for IActionExecuteInvokeRequest.type. Used for validation
12019
+ * @internal
12020
+ * Limited to Microsoft-internal use
12021
+ */
12022
+ var ActionExecuteInvokeRequestType = 'Action.Execute';
12023
+ /**
12024
+ * @hidden
12025
+ * Used to differentiate between IOriginalRequestInfo types
12026
+ * @internal
12027
+ * Limited to Microsoft-internal use
12028
+ */
12029
+ var OriginalRequestType;
12030
+ (function (OriginalRequestType) {
12031
+ OriginalRequestType["ActionExecuteInvokeRequest"] = "ActionExecuteInvokeRequest";
12032
+ OriginalRequestType["QueryMessageExtensionRequest"] = "QueryMessageExtensionRequest";
12033
+ })(OriginalRequestType = externalAppAuthentication.OriginalRequestType || (externalAppAuthentication.OriginalRequestType = {}));
12034
+ /**
12035
+ * @hidden
12036
+ * Used to differentiate between IInvokeResponse types
12037
+ * @internal
12038
+ * Limited to Microsoft-internal use
12039
+ */
12040
+ var InvokeResponseType;
12041
+ (function (InvokeResponseType) {
12042
+ InvokeResponseType["ActionExecuteInvokeResponse"] = "ActionExecuteInvokeResponse";
12043
+ InvokeResponseType["QueryMessageExtensionResponse"] = "QueryMessageExtensionResponse";
12044
+ })(InvokeResponseType = externalAppAuthentication.InvokeResponseType || (externalAppAuthentication.InvokeResponseType = {}));
12045
+ /**
12046
+ * @hidden
12047
+ *
12048
+ * @internal
12049
+ * Limited to Microsoft-internal use
12050
+ */
12051
+ var InvokeErrorCode;
12052
+ (function (InvokeErrorCode) {
12053
+ InvokeErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
12054
+ })(InvokeErrorCode = externalAppAuthentication.InvokeErrorCode || (externalAppAuthentication.InvokeErrorCode = {}));
12055
+ /*********** END ERROR TYPE ***********/
12056
+ /**
12057
+ * @hidden
12058
+ * @internal
12059
+ * Limited to Microsoft-internal use
12060
+ * TODO - Add more validation here as we get more details on the allowed request schemas
12061
+ */
12062
+ function validateOriginalRequestInfo(originalRequestInfo) {
12063
+ if (originalRequestInfo.requestType === OriginalRequestType.ActionExecuteInvokeRequest) {
12064
+ var actionExecuteRequest = originalRequestInfo;
12065
+ if (actionExecuteRequest.type !== ActionExecuteInvokeRequestType) {
12066
+ var error = {
12067
+ errorCode: InvokeErrorCode.INTERNAL_ERROR,
12068
+ message: "Invalid action type ".concat(actionExecuteRequest.type, ". Action type must be \"").concat(ActionExecuteInvokeRequestType, "\""),
12069
+ };
12070
+ throw error;
12071
+ }
12072
+ }
12073
+ }
12074
+ /**
12075
+ * @beta
12076
+ * @hidden
12077
+ * Signals to the host to perform authentication using the given authentication parameters and then resend the request to the application specified by the app ID with the authentication result.
12078
+ * @internal
12079
+ * Limited to Microsoft-internal use
12080
+ * @param appId ID of the application backend to which the request and authentication response should be sent
12081
+ * @param authenticateParameters Parameters for the authentication pop-up
12082
+ * @param originalRequestInfo Information about the original request that should be resent
12083
+ * @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
12084
+ */
12085
+ function authenticateAndResendRequest(appId, authenticateParameters, originalRequestInfo) {
12086
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12087
+ if (!isSupported()) {
12088
+ throw errorNotSupportedOnPlatform;
12089
+ }
12090
+ validateOriginalRequestInfo(originalRequestInfo);
12091
+ // Ask the parent window to open an authentication window with the parameters provided by the caller.
12092
+ return sendMessageToParentAsync('externalAppAuthentication.authenticateAndResendRequest', [
12093
+ appId,
12094
+ originalRequestInfo,
12095
+ authenticateParameters.url,
12096
+ authenticateParameters.width,
12097
+ authenticateParameters.height,
12098
+ authenticateParameters.isExternal,
12099
+ ]).then(function (_a) {
12100
+ var wasSuccessful = _a[0], response = _a[1];
12101
+ if (wasSuccessful && response.responseType != null) {
12102
+ return response;
12103
+ }
12104
+ else {
12105
+ var error = response;
12106
+ throw error;
12107
+ }
12108
+ });
12109
+ }
12110
+ externalAppAuthentication.authenticateAndResendRequest = authenticateAndResendRequest;
12111
+ /**
12112
+ * @beta
12113
+ * @hidden
12114
+ * Signals to the host to perform SSO authentication for the application specified by the app ID
12115
+ * @internal
12116
+ * Limited to Microsoft-internal use
12117
+ * @param appId ID of the application backend for which the host should attempt SSO authentication
12118
+ * @param authTokenRequest Parameters for SSO authentication
12119
+ * @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
12120
+ */
12121
+ function authenticateWithSSO(appId, authTokenRequest) {
12122
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12123
+ if (!isSupported()) {
12124
+ throw errorNotSupportedOnPlatform;
12125
+ }
12126
+ return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSO', [
12127
+ appId,
12128
+ authTokenRequest.resources,
12129
+ authTokenRequest.claims,
12130
+ authTokenRequest.silent,
12131
+ ]).then(function (_a) {
12132
+ var wasSuccessful = _a[0], error = _a[1];
12133
+ if (!wasSuccessful) {
12134
+ throw error;
12135
+ }
12136
+ });
12137
+ }
12138
+ externalAppAuthentication.authenticateWithSSO = authenticateWithSSO;
12139
+ /**
12140
+ * @beta
12141
+ * @hidden
12142
+ * Signals to the host to perform SSO authentication for the application specified by the app ID and then resend the request to the application backend with the authentication result
12143
+ * @internal
12144
+ * Limited to Microsoft-internal use
12145
+ * @param appId ID of the application backend for which the host should attempt SSO authentication and resend the request and authentication response
12146
+ * @param authTokenRequest Parameters for SSO authentication
12147
+ * @param originalRequestInfo Information about the original request that should be resent
12148
+ * @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
12149
+ */
12150
+ function authenticateWithSSOAndResendRequest(appId, authTokenRequest, originalRequestInfo) {
12151
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12152
+ if (!isSupported()) {
12153
+ throw errorNotSupportedOnPlatform;
12154
+ }
12155
+ validateOriginalRequestInfo(originalRequestInfo);
12156
+ return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSOAndResendRequest', [appId, originalRequestInfo, authTokenRequest.resources, authTokenRequest.claims, authTokenRequest.silent]).then(function (_a) {
12157
+ var wasSuccessful = _a[0], response = _a[1];
12158
+ if (wasSuccessful && response.responseType != null) {
12159
+ return response;
12160
+ }
12161
+ else {
12162
+ var error = response;
12163
+ throw error;
12164
+ }
12165
+ });
12166
+ }
12167
+ externalAppAuthentication.authenticateWithSSOAndResendRequest = authenticateWithSSOAndResendRequest;
12168
+ /**
12169
+ * @hidden
12170
+ * Checks if the externalAppAuthentication capability is supported by the host
12171
+ * @returns boolean to represent whether externalAppAuthentication capability is supported
12172
+ *
12173
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
12174
+ *
12175
+ * @internal
12176
+ * Limited to Microsoft-internal use
12177
+ */
12178
+ function isSupported() {
12179
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.externalAppAuthentication ? true : false;
12180
+ }
12181
+ externalAppAuthentication.isSupported = isSupported;
12182
+ })(externalAppAuthentication || (externalAppAuthentication = {}));
12183
+
12184
+ ;// CONCATENATED MODULE: ./src/private/externalAppCardActions.ts
12185
+
12186
+
12187
+
12188
+
12189
+
12190
+ /**
12191
+ * @hidden
12192
+ * Namespace to delegate adaptive card action execution to the host
12193
+ * @internal
12194
+ * Limited to Microsoft-internal use
12195
+ */
12196
+ var externalAppCardActions;
12197
+ (function (externalAppCardActions) {
12198
+ /**
12199
+ * @hidden
12200
+ * The type of deeplink action that was executed by the host
12201
+ * @internal
12202
+ * Limited to Microsoft-internal use
12203
+ */
12204
+ var ActionOpenUrlType;
12205
+ (function (ActionOpenUrlType) {
12206
+ ActionOpenUrlType["DeepLinkDialog"] = "DeepLinkDialog";
12207
+ ActionOpenUrlType["DeepLinkOther"] = "DeepLinkOther";
12208
+ ActionOpenUrlType["DeepLinkStageView"] = "DeepLinkStageView";
12209
+ ActionOpenUrlType["GenericUrl"] = "GenericUrl";
12210
+ })(ActionOpenUrlType = externalAppCardActions.ActionOpenUrlType || (externalAppCardActions.ActionOpenUrlType = {}));
12211
+ /**
12212
+ * @hidden
12213
+ * Error codes that can be thrown from IExternalAppCardActionService.handleActionOpenUrl
12214
+ * @internal
12215
+ * Limited to Microsoft-internal use
12216
+ */
12217
+ var ActionOpenUrlErrorCode;
12218
+ (function (ActionOpenUrlErrorCode) {
12219
+ ActionOpenUrlErrorCode["INVALID_LINK"] = "INVALID_LINK";
12220
+ ActionOpenUrlErrorCode["NOT_SUPPORTED"] = "NOT_SUPPORTED";
12221
+ ActionOpenUrlErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
12222
+ })(ActionOpenUrlErrorCode = externalAppCardActions.ActionOpenUrlErrorCode || (externalAppCardActions.ActionOpenUrlErrorCode = {}));
12223
+ /**
12224
+ * @hidden
12225
+ * Error codes that can be thrown from IExternalAppCardActionService.handleActionSubmit
12226
+ * @internal
12227
+ * Limited to Microsoft-internal use
12228
+ */
12229
+ var ActionSubmitErrorCode;
12230
+ (function (ActionSubmitErrorCode) {
12231
+ ActionSubmitErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
12232
+ })(ActionSubmitErrorCode = externalAppCardActions.ActionSubmitErrorCode || (externalAppCardActions.ActionSubmitErrorCode = {}));
12233
+ /**
12234
+ * @beta
12235
+ * @hidden
12236
+ * Delegates an Adaptive Card Action.Submit request to the host for the application with the provided app ID
12237
+ * @internal
12238
+ * Limited to Microsoft-internal use
12239
+ * @param appId ID of the application the request is intended for
12240
+ * @param actionSubmitPayload The Adaptive Card Action.Submit payload
12241
+ * @param cardActionsConfig The card actions configuration. This indicates which subtypes should be handled by this API
12242
+ * @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
12243
+ */
12244
+ function processActionSubmit(appId, actionSubmitPayload, cardActionsConfig) {
12245
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12246
+ if (!isSupported()) {
12247
+ throw errorNotSupportedOnPlatform;
12248
+ }
12249
+ return sendMessageToParentAsync('externalAppCardActions.processActionSubmit', [
12250
+ appId,
12251
+ actionSubmitPayload,
12252
+ cardActionsConfig,
12253
+ ]).then(function (_a) {
12254
+ var wasSuccessful = _a[0], error = _a[1];
12255
+ if (!wasSuccessful) {
12256
+ throw error;
12257
+ }
12258
+ });
12259
+ }
12260
+ externalAppCardActions.processActionSubmit = processActionSubmit;
12261
+ /**
12262
+ * @beta
12263
+ * @hidden
12264
+ * Delegates an Adaptive Card Action.OpenUrl request to the host for the application with the provided app ID
12265
+ * @internal
12266
+ * Limited to Microsoft-internal use
12267
+ * @param appId ID of the application the request is intended for
12268
+ * @param url The URL to open
12269
+ * @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails
12270
+ */
12271
+ function processActionOpenUrl(appId, url) {
12272
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12273
+ if (!isSupported()) {
12274
+ throw errorNotSupportedOnPlatform;
12275
+ }
12276
+ return sendMessageToParentAsync('externalAppCardActions.processActionOpenUrl', [appId, url]).then(function (_a) {
12277
+ var error = _a[0], response = _a[1];
12278
+ if (error) {
12279
+ throw error;
12280
+ }
12281
+ else {
12282
+ return response;
12283
+ }
12284
+ });
12285
+ }
12286
+ externalAppCardActions.processActionOpenUrl = processActionOpenUrl;
12287
+ /**
12288
+ * @hidden
12289
+ * Checks if the externalAppCardActions capability is supported by the host
12290
+ * @returns boolean to represent whether externalAppCardActions capability is supported
12291
+ *
12292
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
12293
+ *
12294
+ * @internal
12295
+ * Limited to Microsoft-internal use
12296
+ */
12297
+ function isSupported() {
12298
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.externalAppCardActions ? true : false;
12299
+ }
12300
+ externalAppCardActions.isSupported = isSupported;
12301
+ })(externalAppCardActions || (externalAppCardActions = {}));
11928
12302
 
11929
12303
  ;// CONCATENATED MODULE: ./src/private/files.ts
11930
12304
 
@@ -13459,6 +13833,8 @@ var videoEffectsEx;
13459
13833
 
13460
13834
 
13461
13835
 
13836
+
13837
+
13462
13838
 
13463
13839
  ;// CONCATENATED MODULE: ./src/index.ts
13464
13840