@microsoft/teams-js 2.35.0-beta.0 → 2.35.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.
Files changed (30) hide show
  1. package/dist/esm/packages/teams-js/dts/internal/{appIdValidation.d.ts → idValidation.d.ts} +12 -1
  2. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +1 -0
  3. package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +1 -1
  4. package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForDA.d.ts +75 -0
  5. package/dist/esm/packages/teams-js/dts/private/externalAppErrorHandling.d.ts +19 -0
  6. package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
  7. package/dist/esm/packages/teams-js/dts/public/appId.d.ts +6 -11
  8. package/dist/esm/packages/teams-js/dts/public/featureFlags.d.ts +44 -0
  9. package/dist/esm/packages/teams-js/dts/public/index.d.ts +2 -0
  10. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +1 -0
  11. package/dist/esm/packages/teams-js/dts/public/uuidObject.d.ts +15 -1
  12. package/dist/esm/packages/teams-js/dts/public/validatedSafeString.d.ts +25 -0
  13. package/dist/esm/packages/teams-js/src/index.js +1 -1
  14. package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -1
  15. package/dist/esm/packages/teams-js/src/internal/idValidation.js +1 -0
  16. package/dist/esm/packages/teams-js/src/private/constants.js +1 -0
  17. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  18. package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -0
  19. package/dist/esm/packages/teams-js/src/private/externalAppErrorHandling.js +1 -0
  20. package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
  21. package/dist/esm/packages/teams-js/src/public/featureFlags.js +1 -0
  22. package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -1
  23. package/dist/esm/packages/teams-js/src/public/validatedSafeString.js +1 -0
  24. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  25. package/dist/umd/MicrosoftTeams.js +321 -27
  26. package/dist/umd/MicrosoftTeams.js.map +1 -1
  27. package/dist/umd/MicrosoftTeams.min.js +1 -1
  28. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  29. package/package.json +1 -1
  30. package/dist/esm/packages/teams-js/src/internal/appIdValidation.js +0 -1
@@ -1011,7 +1011,9 @@ __webpack_require__.d(__webpack_exports__, {
1011
1011
  UUID: () => (/* reexport */ UUID),
1012
1012
  UserSettingTypes: () => (/* reexport */ UserSettingTypes),
1013
1013
  UserTeamRole: () => (/* reexport */ UserTeamRole),
1014
+ ValidatedSafeString: () => (/* reexport */ validatedSafeString_ValidatedSafeString),
1014
1015
  ViewerActionTypes: () => (/* reexport */ ViewerActionTypes),
1016
+ activateChildProxyingCommunication: () => (/* reexport */ activateChildProxyingCommunication),
1015
1017
  app: () => (/* reexport */ app_namespaceObject),
1016
1018
  appEntity: () => (/* reexport */ appEntity_namespaceObject),
1017
1019
  appInitialization: () => (/* reexport */ appInitialization_namespaceObject),
@@ -1031,11 +1033,13 @@ __webpack_require__.d(__webpack_exports__, {
1031
1033
  externalAppAuthenticationForCEA: () => (/* reexport */ externalAppAuthenticationForCEA_namespaceObject),
1032
1034
  externalAppCardActions: () => (/* reexport */ externalAppCardActions_namespaceObject),
1033
1035
  externalAppCardActionsForCEA: () => (/* reexport */ externalAppCardActionsForCEA_namespaceObject),
1036
+ externalAppCardActionsForDA: () => (/* reexport */ externalAppCardActionsForDA_namespaceObject),
1034
1037
  externalAppCommands: () => (/* reexport */ externalAppCommands_namespaceObject),
1035
1038
  files: () => (/* reexport */ files_namespaceObject),
1036
1039
  geoLocation: () => (/* reexport */ geoLocation_namespaceObject),
1037
1040
  getAdaptiveCardSchemaVersion: () => (/* reexport */ getAdaptiveCardSchemaVersion),
1038
1041
  getContext: () => (/* reexport */ publicAPIs_getContext),
1042
+ getCurrentFeatureFlagsState: () => (/* reexport */ getCurrentFeatureFlagsState),
1039
1043
  getMruTabInstances: () => (/* reexport */ publicAPIs_getMruTabInstances),
1040
1044
  getTabInstances: () => (/* reexport */ publicAPIs_getTabInstances),
1041
1045
  hostEntity: () => (/* reexport */ hostEntity_namespaceObject),
@@ -1059,6 +1063,7 @@ __webpack_require__.d(__webpack_exports__, {
1059
1063
  notifications: () => (/* reexport */ notifications_namespaceObject),
1060
1064
  openFilePreview: () => (/* reexport */ openFilePreview),
1061
1065
  otherAppStateChange: () => (/* reexport */ otherAppStateChange_namespaceObject),
1066
+ overwriteFeatureFlagsState: () => (/* reexport */ overwriteFeatureFlagsState),
1062
1067
  pages: () => (/* reexport */ pages_namespaceObject),
1063
1068
  people: () => (/* reexport */ people_namespaceObject),
1064
1069
  print: () => (/* reexport */ publicAPIs_print),
@@ -1081,6 +1086,7 @@ __webpack_require__.d(__webpack_exports__, {
1081
1086
  secondaryBrowser: () => (/* reexport */ secondaryBrowser_namespaceObject),
1082
1087
  sendCustomEvent: () => (/* reexport */ sendCustomEvent),
1083
1088
  sendCustomMessage: () => (/* reexport */ sendCustomMessage),
1089
+ setFeatureFlagsState: () => (/* reexport */ setFeatureFlagsState),
1084
1090
  setFrameContext: () => (/* reexport */ setFrameContext),
1085
1091
  settings: () => (/* reexport */ settings_namespaceObject),
1086
1092
  shareDeepLink: () => (/* reexport */ publicAPIs_shareDeepLink),
@@ -1412,6 +1418,15 @@ __webpack_require__.d(externalAppCardActionsForCEA_namespaceObject, {
1412
1418
  processActionSubmit: () => (externalAppCardActionsForCEA_processActionSubmit)
1413
1419
  });
1414
1420
 
1421
+ // NAMESPACE OBJECT: ./src/private/externalAppCardActionsForDA.ts
1422
+ var externalAppCardActionsForDA_namespaceObject = {};
1423
+ __webpack_require__.r(externalAppCardActionsForDA_namespaceObject);
1424
+ __webpack_require__.d(externalAppCardActionsForDA_namespaceObject, {
1425
+ SerializableActionOpenUrlDialogInfo: () => (SerializableActionOpenUrlDialogInfo),
1426
+ isSupported: () => (externalAppCardActionsForDA_isSupported),
1427
+ processActionOpenUrlDialog: () => (processActionOpenUrlDialog)
1428
+ });
1429
+
1415
1430
  // NAMESPACE OBJECT: ./src/private/externalAppCommands.ts
1416
1431
  var externalAppCommands_namespaceObject = {};
1417
1432
  __webpack_require__.r(externalAppCommands_namespaceObject);
@@ -4026,6 +4041,25 @@ class UUID {
4026
4041
  toString() {
4027
4042
  return this.uuid;
4028
4043
  }
4044
+ /**
4045
+ * @returns A serializable representation of an uuid, used for passing uuids to the host.
4046
+ */
4047
+ serialize() {
4048
+ return this.toString();
4049
+ }
4050
+ }
4051
+ /**
4052
+ * @hidden
4053
+ * Checks if the incoming id is an instance of ValidatedSafeString
4054
+ * @param id An object to check if it's an instance of ValidatedSafeString
4055
+ * @throws Error with a message describing the violation
4056
+ * @internal
4057
+ * Limited to Microsoft-internal use
4058
+ */
4059
+ function validateUuidInstance(id) {
4060
+ if (!(id instanceof UUID)) {
4061
+ throw new Error(`Potential id (${JSON.stringify(id)}) is invalid; it is not an instance of UUID class.`);
4062
+ }
4029
4063
  }
4030
4064
 
4031
4065
  ;// ./src/internal/telemetry.ts
@@ -4484,7 +4518,65 @@ function isSerializable(arg) {
4484
4518
  * @hidden
4485
4519
  * Package version.
4486
4520
  */
4487
- const version = "2.35.0-beta.0";
4521
+ const version = "2.35.0-beta.2";
4522
+
4523
+ ;// ./src/public/featureFlags.ts
4524
+ // All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
4525
+ const buildFeatureFlags = {
4526
+ childProxyingCommunication: false,
4527
+ };
4528
+ /**
4529
+ * This function enables child proxying communication for apps that still needs it.
4530
+ *
4531
+ * @deprecated Child proxying is considered an insecure feature and will be removed in future releases.
4532
+ */
4533
+ function activateChildProxyingCommunication() {
4534
+ buildFeatureFlags.childProxyingCommunication = true;
4535
+ }
4536
+ /**
4537
+ * @hidden
4538
+ * @internal
4539
+ * Limited to Microsoft-internal use.
4540
+ */
4541
+ function isChildProxyingEnabled() {
4542
+ return buildFeatureFlags.childProxyingCommunication;
4543
+ }
4544
+ /**
4545
+ * @hidden
4546
+ * @internal
4547
+ * Limited to Microsoft-internal use.
4548
+ */
4549
+ function resetBuildFeatureFlags() {
4550
+ buildFeatureFlags.childProxyingCommunication = false;
4551
+ }
4552
+ // Default runtime feature flags
4553
+ const defaultFeatureFlags = {
4554
+ disableEnforceOriginMatchForChildResponses: false,
4555
+ };
4556
+ // Object that stores the current runtime feature flag state
4557
+ let runtimeFeatureFlags = defaultFeatureFlags;
4558
+ /**
4559
+ * @returns The current state of the runtime feature flags.
4560
+ */
4561
+ function getCurrentFeatureFlagsState() {
4562
+ return runtimeFeatureFlags;
4563
+ }
4564
+ /**
4565
+ * It sets the runtime feature flags to the new feature flags provided.
4566
+ * @param featureFlags The new feature flags to set.
4567
+ */
4568
+ function setFeatureFlagsState(featureFlags) {
4569
+ runtimeFeatureFlags = featureFlags;
4570
+ }
4571
+ /**
4572
+ * It overwrites all the feature flags in the runtime feature flags object with the new feature flags provided.
4573
+ * @param newFeatureFlags The new feature flags to set.
4574
+ * @returns The current state of the runtime feature flags.
4575
+ */
4576
+ function overwriteFeatureFlagsState(newFeatureFlags) {
4577
+ setFeatureFlagsState(Object.assign(Object.assign({}, runtimeFeatureFlags), newFeatureFlags));
4578
+ return getCurrentFeatureFlagsState();
4579
+ }
4488
4580
 
4489
4581
  ;// ./src/internal/messageObjects.ts
4490
4582
  var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
@@ -4689,7 +4781,8 @@ function processAdditionalValidOrigins(validMessageOrigins) {
4689
4781
  GlobalVars.additionalValidOrigins = combinedOriginUrls;
4690
4782
  }
4691
4783
 
4692
- ;// ./src/internal/appIdValidation.ts
4784
+ ;// ./src/internal/idValidation.ts
4785
+
4693
4786
 
4694
4787
 
4695
4788
  /**
@@ -4703,13 +4796,15 @@ function processAdditionalValidOrigins(validMessageOrigins) {
4703
4796
  * @param potentialAppId A string to check if it's a "valid" app id
4704
4797
  * @throws Error with a message describing the exact validation violation
4705
4798
  */
4706
- function validateStringAsAppId(potentialAppId) {
4707
- if (hasScriptTags(potentialAppId)) {
4708
- throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains script tags.`);
4709
- }
4799
+ function validateStringLength(potentialAppId) {
4710
4800
  if (!isStringWithinAppIdLengthLimits(potentialAppId)) {
4711
4801
  throw new Error(`Potential app id (${potentialAppId}) is invalid; its length ${potentialAppId.length} is not within the length limits (${minimumValidAppIdLength}-${maximumValidAppIdLength}).`);
4712
4802
  }
4803
+ }
4804
+ function validateSafeContent(potentialAppId) {
4805
+ if (hasScriptTags(potentialAppId)) {
4806
+ throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains script tags.`);
4807
+ }
4713
4808
  if (doesStringContainNonPrintableCharacters(potentialAppId)) {
4714
4809
  throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains non-printable characters.`);
4715
4810
  }
@@ -4738,9 +4833,56 @@ function validateAppIdInstance(potentialAppId) {
4738
4833
  throw new Error(`Potential app id (${potentialAppId}) is invalid; it is not an instance of AppId class.`);
4739
4834
  }
4740
4835
  }
4836
+ /**
4837
+ * @hidden
4838
+ * Checks if the incoming string is an instance of ValidatedSafeString
4839
+ * @param incomingString An object to check if it's an instance of ValidatedSafeString
4840
+ * @throws Error with a message describing the violation
4841
+ * @internal
4842
+ * Limited to Microsoft-internal use
4843
+ */
4844
+ function validateSafeStringInstance(incomingString) {
4845
+ if (!(incomingString instanceof ValidatedSafeString)) {
4846
+ throw new Error(`The string (${incomingString}) is invalid; it is not an instance of ValidatedSafeString class.`);
4847
+ }
4848
+ }
4849
+
4850
+ ;// ./src/public/validatedSafeString.ts
4851
+
4852
+ /**
4853
+ * A strongly typed class used to represent a "valid" string id.
4854
+ */
4855
+ class validatedSafeString_ValidatedSafeString {
4856
+ /**
4857
+ * Creates a strongly-typed Id from a string
4858
+ *
4859
+ * @param idAsString An id represented as a string
4860
+ * @throws Error with a message describing the exact validation violation
4861
+ */
4862
+ constructor(idAsString) {
4863
+ this.idAsString = idAsString;
4864
+ validateSafeContent(idAsString);
4865
+ }
4866
+ /**
4867
+ * @hidden
4868
+ * @internal
4869
+ *
4870
+ * @returns A serializable representation of an AppId, used for passing AppIds to the host.
4871
+ */
4872
+ serialize() {
4873
+ return this.toString();
4874
+ }
4875
+ /**
4876
+ * Returns the app id as a string
4877
+ */
4878
+ toString() {
4879
+ return this.idAsString;
4880
+ }
4881
+ }
4741
4882
 
4742
4883
  ;// ./src/public/appId.ts
4743
4884
 
4885
+
4744
4886
  /**
4745
4887
  * A strongly-typed class used to represent a "valid" app id.
4746
4888
  *
@@ -4752,7 +4894,7 @@ function validateAppIdInstance(potentialAppId) {
4752
4894
  * for script tags, length, and non-printable characters. Validation will be updated in the future to ensure
4753
4895
  * the app id is a valid UUID as legacy apps update.
4754
4896
  */
4755
- class AppId {
4897
+ class AppId extends validatedSafeString_ValidatedSafeString {
4756
4898
  /**
4757
4899
  * Creates a strongly-typed AppId from a string
4758
4900
  *
@@ -4760,23 +4902,17 @@ class AppId {
4760
4902
  * @throws Error with a message describing the exact validation violation
4761
4903
  */
4762
4904
  constructor(appIdAsString) {
4763
- this.appIdAsString = appIdAsString;
4764
- validateStringAsAppId(appIdAsString);
4905
+ super(appIdAsString);
4906
+ validateStringLength(appIdAsString);
4765
4907
  }
4766
4908
  /**
4767
- * @hidden
4768
- * @internal
4909
+ * Returns a JSON representation of the AppId object
4910
+ * @returns A JSON representation of the AppId object
4769
4911
  *
4770
- * @returns A serializable representation of an AppId, used for passing AppIds to the host.
4771
- */
4772
- serialize() {
4773
- return this.toString();
4774
- }
4775
- /**
4776
- * Returns the app id as a string
4912
+ * note: this method maintains backward compatibility for JSON serialization
4777
4913
  */
4778
- toString() {
4779
- return this.appIdAsString;
4914
+ toJSON() {
4915
+ return { appIdAsString: this.toString() };
4780
4916
  }
4781
4917
  }
4782
4918
 
@@ -7522,6 +7658,7 @@ var childCommunication_awaiter = (undefined && undefined.__awaiter) || function
7522
7658
 
7523
7659
 
7524
7660
 
7661
+
7525
7662
  const communicationLogger = getLogger('childProxyingCommunication');
7526
7663
  /**
7527
7664
  * @internal
@@ -7545,6 +7682,9 @@ function uninitializeChildCommunication() {
7545
7682
  * Limited to Microsoft-internal use
7546
7683
  */
7547
7684
  function shouldEventBeRelayedToChild() {
7685
+ if (!isChildProxyingEnabled()) {
7686
+ return false;
7687
+ }
7548
7688
  return !!ChildCommunication.window;
7549
7689
  }
7550
7690
  /**
@@ -7553,6 +7693,9 @@ function shouldEventBeRelayedToChild() {
7553
7693
  * Limited to Microsoft-internal use
7554
7694
  */
7555
7695
  function shouldProcessChildMessage(messageSource, messageOrigin) {
7696
+ if (!isChildProxyingEnabled()) {
7697
+ return false;
7698
+ }
7556
7699
  if (!ChildCommunication.window || ChildCommunication.window.closed || messageSource === ChildCommunication.window) {
7557
7700
  ChildCommunication.window = messageSource;
7558
7701
  ChildCommunication.origin = messageOrigin;
@@ -7610,14 +7753,22 @@ function handleIncomingMessage(evt, sendMessageToParentHelper, setCallbackForReq
7610
7753
  */
7611
7754
  function sendChildMessageToParent(message, sendMessageToParentHelper, setCallbackForRequest) {
7612
7755
  const request = sendMessageToParentHelper(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "tasks.startTask" /* ApiName.Tasks_StartTask */), message.func, message.args, true);
7756
+ // Copy variable to new pointer
7757
+ const requestChildWindowOrigin = ChildCommunication.origin;
7613
7758
  setCallbackForRequest(request.uuid, (...args) => {
7614
- if (ChildCommunication.window) {
7615
- const isPartialResponse = args.pop();
7616
- handleIncomingMessageFromChildLogger('Message from parent being relayed to child, id: %s', getMessageIdsAsLogString(message));
7617
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7618
- // @ts-ignore
7619
- sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
7759
+ if (!ChildCommunication.window) {
7760
+ return;
7620
7761
  }
7762
+ if (!getCurrentFeatureFlagsState().disableEnforceOriginMatchForChildResponses &&
7763
+ requestChildWindowOrigin !== ChildCommunication.origin) {
7764
+ handleIncomingMessageFromChildLogger('Origin of child window has changed, not sending response back to child window');
7765
+ return;
7766
+ }
7767
+ const isPartialResponse = args.pop();
7768
+ handleIncomingMessageFromChildLogger('Message from parent being relayed to child, id: %s', getMessageIdsAsLogString(message));
7769
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7770
+ // @ts-ignore
7771
+ sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
7621
7772
  });
7622
7773
  }
7623
7774
  /**
@@ -9557,7 +9708,14 @@ function externalAppAuthenticationForCEA_authenticateWithSSO(appId, conversation
9557
9708
  throw errorNotSupportedOnPlatform;
9558
9709
  }
9559
9710
  validateInput(appId, conversationId);
9560
- return callFunctionInHost("externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */, [appId, conversationId, authTokenRequest.claims, authTokenRequest.silent], getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */), isInvokeError);
9711
+ return callFunctionInHost("externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */, [
9712
+ appId,
9713
+ conversationId,
9714
+ authTokenRequest.authId,
9715
+ authTokenRequest.connectionName,
9716
+ authTokenRequest.claims,
9717
+ authTokenRequest.silent,
9718
+ ], getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */), isInvokeError);
9561
9719
  });
9562
9720
  }
9563
9721
  /**
@@ -9889,6 +10047,138 @@ function externalAppCardActionsForCEA_isSupported() {
9889
10047
  return ensureInitialized(runtime) && runtime.supports.externalAppCardActionsForCEA ? true : false;
9890
10048
  }
9891
10049
 
10050
+ ;// ./src/private/constants.ts
10051
+ /**
10052
+ * @hidden
10053
+ * Error codes that can be thrown from externalAppCommands and externalAppCardCommands Action Submit specifically
10054
+ * @internal
10055
+ * Limited to Microsoft-internal use
10056
+ */
10057
+ var ExternalAppErrorCode;
10058
+ (function (ExternalAppErrorCode) {
10059
+ ExternalAppErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
10060
+ })(ExternalAppErrorCode || (ExternalAppErrorCode = {}));
10061
+
10062
+ ;// ./src/private/externalAppErrorHandling.ts
10063
+
10064
+ /**
10065
+ * @hidden
10066
+ * Determines if the provided error object is an instance of ExternalAppError
10067
+ * @internal
10068
+ * Limited to Microsoft-internal use
10069
+ * @param err The error object to check whether it is of ExternalAppError type
10070
+ */
10071
+ function isExternalAppError(err) {
10072
+ if (typeof err !== 'object' || err === null) {
10073
+ return false;
10074
+ }
10075
+ const error = err;
10076
+ return (Object.values(ExternalAppErrorCode).includes(error.errorCode) &&
10077
+ (error.message === undefined || typeof error.message === 'string'));
10078
+ }
10079
+
10080
+ ;// ./src/private/externalAppCardActionsForDA.ts
10081
+ /**
10082
+ * @beta
10083
+ * @hidden
10084
+ * Module to delegate adaptive card action for Declarative Agents execution to the host
10085
+ * @internal
10086
+ * Limited to Microsoft-internal use
10087
+ * @module
10088
+ */
10089
+ var externalAppCardActionsForDA_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
10090
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10091
+ return new (P || (P = Promise))(function (resolve, reject) {
10092
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10093
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10094
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10095
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10096
+ });
10097
+ };
10098
+
10099
+
10100
+
10101
+
10102
+
10103
+
10104
+
10105
+
10106
+ /**
10107
+ * All of APIs in this capability file should send out API version v2 ONLY
10108
+ */
10109
+ const externalAppCardActionsForDATelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
10110
+ /**
10111
+ * @beta
10112
+ * @hidden
10113
+ * Delegates an Adaptive Card Action.OpenUrlDialog request to the host for the application with the provided app ID
10114
+ * @internal
10115
+ * Limited to Microsoft-internal use
10116
+ * @param appId ID of the application the request is intended for. This must be a UUID
10117
+ * @param actionOpenUrlDialogInfo Information required to open the URL dialog
10118
+ * @param traceId The trace identifier used for monitoring and live site investigations
10119
+ * @returns Promise that resolves when the request is completed and rejects with ExternalAppError if the request fails
10120
+ */
10121
+ function processActionOpenUrlDialog(appId, actionOpenUrlDialogInfo, traceId) {
10122
+ return externalAppCardActionsForDA_awaiter(this, void 0, void 0, function* () {
10123
+ ensureInitialized(runtime, FrameContexts.content);
10124
+ if (!externalAppCardActionsForDA_isSupported()) {
10125
+ throw errorNotSupportedOnPlatform;
10126
+ }
10127
+ externalAppCardActionsForDA_validateInput(appId, traceId);
10128
+ return callFunctionInHost("externalAppCardActionsForDA.processActionOpenUrlDialog" /* ApiName.ExternalAppCardActionsForDA_ProcessActionOpenUrlDialog */, [appId, new SerializableActionOpenUrlDialogInfo(actionOpenUrlDialogInfo), traceId], getApiVersionTag(externalAppCardActionsForDATelemetryVersionNumber, "externalAppCardActionsForDA.processActionOpenUrlDialog" /* ApiName.ExternalAppCardActionsForDA_ProcessActionOpenUrlDialog */), isExternalAppError);
10129
+ });
10130
+ }
10131
+ /**
10132
+ * @beta
10133
+ * @hidden
10134
+ * Checks if the externalAppCardActions capability is supported by the host
10135
+ * @returns boolean to represent whether externalAppCardActions capability is supported
10136
+ *
10137
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
10138
+ *
10139
+ * @internal
10140
+ * Limited to Microsoft-internal use
10141
+ */
10142
+ function externalAppCardActionsForDA_isSupported() {
10143
+ return ensureInitialized(runtime) && runtime.supports.externalAppCardActionsForDA ? true : false;
10144
+ }
10145
+ /**
10146
+ * @beta
10147
+ * @hidden
10148
+ * Checks if the externalAppCardActions capability is supported by the host
10149
+ * @returns boolean to represent whether externalAppCardActions capability is supported
10150
+ *
10151
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
10152
+ *
10153
+ * @internal
10154
+ * Limited to Microsoft-internal use
10155
+ */
10156
+ function externalAppCardActionsForDA_validateInput(appId, traceId) {
10157
+ validateAppIdInstance(appId);
10158
+ validateUuidInstance(traceId);
10159
+ }
10160
+ /**
10161
+ * @beta
10162
+ * @hidden
10163
+ * Serializable class for ActionOpenUrlDialogInfo to send info to the host
10164
+ *
10165
+ * @internal
10166
+ * Limited to Microsoft-internal use
10167
+ */
10168
+ class SerializableActionOpenUrlDialogInfo {
10169
+ constructor(info) {
10170
+ this.info = info;
10171
+ }
10172
+ serialize() {
10173
+ const { url, title, size } = this.info;
10174
+ return {
10175
+ url: url.href,
10176
+ title,
10177
+ size,
10178
+ };
10179
+ }
10180
+ }
10181
+
9892
10182
  ;// ./src/private/externalAppCommands.ts
9893
10183
  /**
9894
10184
  * @hidden
@@ -12942,6 +13232,8 @@ function serializeValidSize(size) {
12942
13232
 
12943
13233
 
12944
13234
 
13235
+
13236
+
12945
13237
 
12946
13238
 
12947
13239
 
@@ -18342,6 +18634,8 @@ function marketplace_isSupported() {
18342
18634
 
18343
18635
 
18344
18636
 
18637
+
18638
+
18345
18639
 
18346
18640
 
18347
18641