@microsoft/teams-js 2.19.1-beta.0 → 2.20.0-beta.1

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.
@@ -1012,8 +1012,8 @@ var ApiName;
1012
1012
  ApiName["Dialog_Url_Bot_Open"] = "dialog.url.bot.open";
1013
1013
  ApiName["Dialog_Url_Open"] = "dialog.url.open";
1014
1014
  ApiName["Dialog_Url_Submit"] = "dialog.url.submit";
1015
- ApiName["Dialog_Url_SendMessageToParentFromDialog"] = "dialog.url.sendMessageToParentFromDialog";
1016
- ApiName["Dialog_Url_SendMessageToDialog"] = "dialog.url.sendMessageToDialog";
1015
+ ApiName["Dialog_Url_ParentCommunication_SendMessageToParentFromDialog"] = "dialog.url.parentCommunication.sendMessageToParentFromDialog";
1016
+ ApiName["Dialog_Url_ParentCommunication_SendMessageToDialog"] = "dialog.url.parentCommunication.sendMessageToDialog";
1017
1017
  ApiName["Files_AddCloudStorageFolder"] = "files.addCloudStorageFolder";
1018
1018
  ApiName["Files_AddCloudStorageProvider"] = "files.addCloudStorageProvider";
1019
1019
  ApiName["Files_AddCloudStorageProviderFile"] = "files.addCloudStorageProviderFile";
@@ -1035,7 +1035,7 @@ var ApiName;
1035
1035
  ApiName["GeoLocation_GetCurrentLocation"] = "geoLocation.getCurrentLocation";
1036
1036
  ApiName["GeoLocation_HasPermission"] = "geoLocation.hasPermission";
1037
1037
  ApiName["GeoLocation_Map_ChooseLocation"] = "geoLocation.map.chooseLocation";
1038
- ApiName["GeoLocation_RequestPermission"] = "geoLocation.hasPermission";
1038
+ ApiName["GeoLocation_RequestPermission"] = "geoLocation.requestPermission";
1039
1039
  ApiName["GeoLocation_ShowLocation"] = "geoLocation.showLocation";
1040
1040
  ApiName["Interactive_GetClientInfo"] = "interactive.getClientInfo";
1041
1041
  ApiName["Interactive_GetClientRoles"] = "interactive.getClientRoles";
@@ -1108,8 +1108,8 @@ var ApiName;
1108
1108
  ApiName["Pages_BackStack_NavigateBack"] = "pages.backStack.navigateBack";
1109
1109
  ApiName["Pages_BackStack_RegisterBackButtonHandler"] = "pages.backStack.registerBackButtonHandler";
1110
1110
  ApiName["Pages_Config_RegisterChangeConfigHandler"] = "pages.config.registerChangeConfigHandler";
1111
- ApiName["Pages_Config_RegisterOnRemoveHandlerHelper"] = "pages.config.registerOnRemoveHandlerHelper";
1112
- ApiName["Pages_Config_RegisterOnSaveHandlerHelper"] = "pages.config.registerOnSaveHandlerHelper";
1111
+ ApiName["Pages_Config_RegisterOnRemoveHandler"] = "pages.config.registerOnRemoveHandler";
1112
+ ApiName["Pages_Config_RegisterOnSaveHandler"] = "pages.config.registerOnSaveHandler";
1113
1113
  ApiName["Pages_Config_SetConfig"] = "pages.config.setConfig";
1114
1114
  ApiName["Pages_Config_SetValidityState"] = "pages.config.setValidityState";
1115
1115
  ApiName["Pages_CurrentApp_NavigateTo"] = "pages.currentApp.navigateTo";
@@ -1121,13 +1121,23 @@ var ApiName;
1121
1121
  ApiName["Pages_NavigateToApp"] = "pages.navigateToApp";
1122
1122
  ApiName["Pages_RegisterFocusEnterHandler"] = "pages.registerFocusEnterHandler";
1123
1123
  ApiName["Pages_RegisterFullScreenHandler"] = "pages.registerFullScreenHandler";
1124
+ ApiName["Pages_RemoveEvent_NotifyFailure"] = "pages.removeEvent.notifyFailure";
1125
+ ApiName["Pages_RemoveEvent_NotifySuccess"] = "pages.removeEvent.notifySuccess";
1124
1126
  ApiName["Pages_ReturnFocus"] = "pages.returnFocus";
1127
+ ApiName["Pages_SaveEvent_NotifyFailure"] = "pages.saveEvent.notifyFailure";
1128
+ ApiName["Pages_SaveEvent_NotifySuccess"] = "pages.saveEvent.notifySuccess";
1125
1129
  ApiName["Pages_SetCurrentFrame"] = "pages.setCurrentFrame";
1126
1130
  ApiName["Pages_ShareDeepLink"] = "pages.shareDeepLink";
1127
1131
  ApiName["Pages_Tabs_GetMruTabInstances"] = "pages.tabs.getMruTabInstances";
1128
1132
  ApiName["Pages_Tabs_GetTabInstances"] = "pages.tabs.getTabInstances";
1129
1133
  ApiName["Pages_Tabs_NavigateToTab"] = "pages.tabs.navigateToTab";
1130
1134
  ApiName["People_SelectPeople"] = "people.selectPeople";
1135
+ ApiName["PrivateAPIs_OpenFilePreview"] = "openFilePreview";
1136
+ ApiName["PrivateAPIs_RegisterCustomHandler"] = "registerCustomHandler";
1137
+ ApiName["PrivateAPIs_RegisterUserSettingsChangeHandler"] = "registerUserSettingsChangeHandler";
1138
+ ApiName["PrivateAPIs_SendCustomMessage"] = "sendCustomMessage";
1139
+ ApiName["PrivateAPIs_UploadCustomApp"] = "uploadCustomApp";
1140
+ ApiName["Profile_ShowProfile"] = "profile.showProfile";
1131
1141
  ApiName["PublicAPIs_ExecuteDeepLink"] = "executeDeepLink";
1132
1142
  ApiName["PublicAPIs_GetContext"] = "getContext";
1133
1143
  ApiName["PublicAPIs_GetMruTabInstances"] = "getMruTabInstances";
@@ -1146,17 +1156,70 @@ var ApiName;
1146
1156
  ApiName["PublicAPIs_ShareDeepLink"] = "shareDeepLink";
1147
1157
  ApiName["RegisterHandler"] = "registerHandler";
1148
1158
  ApiName["RegisterOnThemeChangeHandler"] = "registerOnThemeChangeHandler";
1159
+ ApiName["RemoteCamera_GetCapableParticipants"] = "remoteCamera.getCapableParticipants";
1160
+ ApiName["RemoteCamera_RegisterOnCapableParticipantsChangeHandler"] = "remoteCamera.registerOnCapableParticipantsChangeHandler";
1161
+ ApiName["RemoteCamera_RegisterOnDeviceStateChangeHandler"] = "remoteCamera.registerOnDeviceStateChangeHandler";
1162
+ ApiName["RemoteCamera_RegisterOnErrorHandler"] = "remoteCamera.registerOnErrorHandler";
1163
+ ApiName["RemoteCamera_RegisterOnSessionStatusChangeHandler"] = "remoteCamera.registerOnSessionStatusChangeHandler";
1164
+ ApiName["RemoteCamera_RequestControl"] = "remoteCamera.requestControl";
1165
+ ApiName["RemoteCamera_SendControlCommand"] = "remoteCamera.sendControlCommand";
1166
+ ApiName["RemoteCamera_TerminateSession"] = "remoteCamera.terminateSession";
1167
+ ApiName["Search_CloseSearch"] = "search.closeSearch";
1168
+ ApiName["Search_RegisterOnChangeHandler"] = "search.registerOnChangeHandler";
1169
+ ApiName["Search_RegisterOnClosedHandler"] = "search.registerOnClosedHandler";
1170
+ ApiName["Search_RegisterOnExecutedHandler"] = "search.registerOnExecutedHandler";
1171
+ ApiName["Search_UnregisterHandlers"] = "search.unregisterHandlers";
1172
+ ApiName["SecondaryBrowser_OpenUrl"] = "secondaryBrowser.openUrl";
1173
+ ApiName["Settings_GetSettings"] = "settings.getSettings";
1174
+ ApiName["Settings_RegisterOnRemoveHandler"] = "settings.registerOnRemoveHandler";
1175
+ ApiName["Settings_RegisterOnSaveHandler"] = "settings.registerOnSaveHandler";
1149
1176
  ApiName["Settings_Remove_Failure"] = "settings.remove.failure";
1150
1177
  ApiName["Settings_Remove_Success"] = "settings.remove.success";
1151
1178
  ApiName["Settings_Save_Failure"] = "settings.save.failure";
1152
1179
  ApiName["Settings_Save_Success"] = "settings.save.success";
1180
+ ApiName["Settings_SetSettings"] = "settings.setSettings";
1181
+ ApiName["Settings_SetValidityState"] = "settings.setValidityState";
1182
+ ApiName["StageView_Open"] = "stageView.open";
1153
1183
  ApiName["Tasks_StartTask"] = "tasks.startTask";
1154
1184
  ApiName["Tasks_SubmitTask"] = "tasks.submitTask";
1155
1185
  ApiName["Tasks_UpdateTask"] = "tasks.updateTask";
1186
+ ApiName["Teams_FullTrust_GetConfigSetting"] = "teams.fullTrust.getConfigSetting";
1187
+ ApiName["Teams_FullTrust_JoinedTeams_GetUserJoinedTeams"] = "teams.fullTrust.joinedTeams.getUserJoinedTeams";
1188
+ ApiName["Teams_GetTeamChannels"] = "teams.getTeamChannels";
1189
+ ApiName["Teams_RefreshSiteUrl"] = "teams.refreshSiteUrl";
1190
+ ApiName["VideoEffects_MediaStream_RegisterForVideoFrame"] = "videoEffects.mediaStream.registerForVideoFrame";
1191
+ ApiName["VideoEffects_NotifySelectedVideoEffectChanged"] = "videoEffects.notifySelectedVideoEffectChanged";
1192
+ ApiName["VideoEffects_NotifyError"] = "videoEffects.notifyError";
1193
+ ApiName["VideoEffects_NotifyVideoFrameProcessed"] = "videoEffects.notifyVideoFrameProcessed";
1194
+ ApiName["VideoEffects_RegisterEffectParameterChangeHandler"] = "videoEffects.registerEffectParameterChangeHandler";
1195
+ ApiName["VideoEffects_RegisterForVideoEffect"] = "videoEffects.registerForVideoEffect";
1196
+ ApiName["VideoEffects_RegisterForVideoFrame"] = "videoEffects.registerForVideoFrame";
1197
+ ApiName["VideoEffects_RegisterSetFrameProcessTimeLimitHandler"] = "videoEffects.setFrameProcessTimeLimitHandler";
1198
+ ApiName["VideoEffects_RegisterStartVideoExtensibilityVideoStreamHandler"] = "videoEffects.startVideoExtensibilityVideoStreamHandler";
1199
+ ApiName["VideoEffects_RegisterForVideoBufferHandler"] = "videoEffects.registerForVideoBufferHandler";
1200
+ ApiName["VideoEffectsEx_MediaStream_RegisterForVideoFrame"] = "videoEffectsEX.mediaStream.registerForVideoFrame";
1201
+ ApiName["VideoEffectsEx_NotifyError"] = "videoEffectsEx.notifyError";
1202
+ ApiName["VideoEffectsEx_NotifySelectedVideoEffectChanged"] = "videoEffectsEx.notifySelectedVideoEffectChanged";
1203
+ ApiName["VideoEffectsEx_NotifyVideoFrameProcessed"] = "videoEffectsEx.notifyVideoFrameProcessed";
1204
+ ApiName["VideoEffectsEx_RegisterEffectParameterChangeHandler"] = "videoEffectsEx.registerEffectParamterChangeHandler";
1205
+ ApiName["VideoEffectsEx_RegisterForVideoEffect"] = "videoEffectsEx.registerForVideoEffect";
1206
+ ApiName["VideoEffectsEx_RegisterForVideoFrame"] = "videoEffectsEx.registerForVideoFrame";
1207
+ ApiName["VideoEffectsEx_RegisterNewVideoFrameHandler"] = "videoEffectsEx.registerNewVideoFrameHandler";
1208
+ ApiName["VideoEffectsEx_RegisterSetFrameProcessTimeLimitHandler"] = "videoEffectsEX.registerSetFrameProcessTimeLimitHandler";
1209
+ ApiName["VideoEffectsEx_RegisterStartVideoExtensibilityVideoStreamHandler"] = "videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler";
1210
+ ApiName["VideoEffectsEx_UpdatePersonalizedEffects"] = "videoEffectsEx.updatePersonalizedEffects";
1211
+ ApiName["VideoPerformanceMonitor_Constructor"] = "videoPerformanceMonitor.performanceDataGenerated";
1212
+ ApiName["VideoPerformanceMonitor_ReportFrameProcessed"] = "videoPerformanceMonitor.reportFrameProcessed";
1213
+ ApiName["VideoPerformanceMonitor_ReportTextureStreamAcquired"] = "videoPerformanceMonitor.reportTextureStreamAcquired";
1214
+ ApiName["VideoPerformanceMonitor_StartMonitorSlowFrameProcessing"] = "videoPerformanceMonitor.startMonitorSlowFrameProcessing";
1215
+ ApiName["VisualMedia_HasPermission"] = "visualMedia.hasPermission";
1216
+ ApiName["VisualMedia_Image_CaptureImages"] = "visualMedia.image.captureImages";
1217
+ ApiName["VisualMedia_Image_RetrieveImages"] = "visualMedia.image.retrieveImages";
1218
+ ApiName["VisualMedia_RequestPermission"] = "visualMedia.requestPermission";
1156
1219
  })(ApiName || (ApiName = {}));
1157
1220
 
1158
1221
  ;// CONCATENATED MODULE: ./src/artifactsForCDN/validDomains.json
1159
- const validDomains_namespaceObject = JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","teams.live.com","devspaces.skype.com","ssauth.skype.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","*.teams.microsoft.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","teams.cloud.microsoft","outlook.cloud.microsoft","m365.cloud.microsoft","copilot.microsoft.com"]}');
1222
+ const validDomains_namespaceObject = JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","*.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","ssauth.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","teams.cloud.microsoft","outlook.cloud.microsoft","m365.cloud.microsoft","copilot.microsoft.com","windows.msn.com"]}');
1160
1223
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
1161
1224
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1162
1225
 
@@ -2102,7 +2165,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
2102
2165
 
2103
2166
 
2104
2167
  const runtimeLogger = getLogger('runtime');
2105
- const latestRuntimeApiVersion = 3;
2168
+ const latestRuntimeApiVersion = 4;
2106
2169
  function isLatestRuntimeVersion(runtime) {
2107
2170
  return runtime.apiVersion === latestRuntimeApiVersion;
2108
2171
  }
@@ -2134,7 +2197,7 @@ function isRuntimeInitialized(runtime) {
2134
2197
  }
2135
2198
  let runtime_runtime = _uninitializedRuntime;
2136
2199
  const versionAndPlatformAgnosticTeamsRuntimeConfig = {
2137
- apiVersion: 3,
2200
+ apiVersion: 4,
2138
2201
  hostVersionsInfo: teamsMinAdaptiveCardVersion,
2139
2202
  isLegacyTeams: true,
2140
2203
  supports: {
@@ -2149,6 +2212,7 @@ const versionAndPlatformAgnosticTeamsRuntimeConfig = {
2149
2212
  },
2150
2213
  url: {
2151
2214
  bot: {},
2215
+ parentCommunication: {},
2152
2216
  },
2153
2217
  update: {},
2154
2218
  },
@@ -2246,6 +2310,27 @@ const upgradeChain = [
2246
2310
  return Object.assign(Object.assign({}, previousVersionRuntime), { apiVersion: 3, supports: newSupports });
2247
2311
  },
2248
2312
  },
2313
+ {
2314
+ versionToUpgradeFrom: 3,
2315
+ upgradeToNextVersion: (previousVersionRuntime) => {
2316
+ var _a, _b, _c, _d, _e;
2317
+ return {
2318
+ apiVersion: 4,
2319
+ hostVersionsInfo: previousVersionRuntime.hostVersionsInfo,
2320
+ isLegacyTeams: previousVersionRuntime.isLegacyTeams,
2321
+ supports: Object.assign(Object.assign({}, previousVersionRuntime.supports), { dialog: previousVersionRuntime.supports.dialog
2322
+ ? {
2323
+ card: (_a = previousVersionRuntime.supports.dialog) === null || _a === void 0 ? void 0 : _a.card,
2324
+ url: {
2325
+ bot: (_c = (_b = previousVersionRuntime.supports.dialog) === null || _b === void 0 ? void 0 : _b.url) === null || _c === void 0 ? void 0 : _c.bot,
2326
+ parentCommunication: ((_d = previousVersionRuntime.supports.dialog) === null || _d === void 0 ? void 0 : _d.url) ? {} : undefined,
2327
+ },
2328
+ update: (_e = previousVersionRuntime.supports.dialog) === null || _e === void 0 ? void 0 : _e.update,
2329
+ }
2330
+ : undefined }),
2331
+ };
2332
+ },
2333
+ },
2249
2334
  ];
2250
2335
  const mapTeamsVersionToSupportedCapabilities = {
2251
2336
  // 1.0.0 just signifies "these capabilities have practically always been supported." For some of these
@@ -2417,7 +2502,7 @@ const _minRuntimeConfigToUninitialize = {
2417
2502
  * @hidden
2418
2503
  * Package version.
2419
2504
  */
2420
- const version = "2.19.1-beta.0";
2505
+ const version = "2.20.0-beta.1";
2421
2506
 
2422
2507
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2423
2508
 
@@ -2691,7 +2776,6 @@ function validateOrigin(messageOrigin) {
2691
2776
 
2692
2777
 
2693
2778
 
2694
-
2695
2779
  /**
2696
2780
  * Namespace to interact with the authentication-specific part of the SDK.
2697
2781
  *
@@ -2830,6 +2914,7 @@ var authentication;
2830
2914
  authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.resources,
2831
2915
  authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.claims,
2832
2916
  authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.silent,
2917
+ authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.tenantId,
2833
2918
  ]));
2834
2919
  }).then(([success, result]) => {
2835
2920
  if (success) {
@@ -2968,21 +3053,11 @@ var authentication;
2968
3053
  });
2969
3054
  }
2970
3055
  /**
2971
- * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}, the
2972
- * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of
2973
- * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>} that the
2974
- * authentication request was successful.
2975
- *
2976
- * @remarks
2977
- * This function is usable only from the authentication window.
2978
- * This call causes the authentication window to be closed.
2979
- *
2980
- * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives
2981
- * this value in its callback or via the `Promise` return value
2982
- * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.
3056
+ * @deprecated
3057
+ * This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.
3058
+ * Please use the {@link authentication.notifySuccess authentication.notifySuccess(result?: string): void} instead.
2983
3059
  */
2984
- function notifySuccess(result, callbackUrl) {
2985
- redirectIfWin32Outlook(callbackUrl, 'result', result);
3060
+ function notifySuccess(result, _callbackUrl) {
2986
3061
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.authentication);
2987
3062
  sendMessageToParent('authentication.authenticate.success', [result]);
2988
3063
  // Wait for the message to be sent before closing the window
@@ -2990,22 +3065,11 @@ var authentication;
2990
3065
  }
2991
3066
  authentication.notifySuccess = notifySuccess;
2992
3067
  /**
2993
- * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}, the
2994
- * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of
2995
- * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>} that the
2996
- * authentication request failed.
2997
-
2998
- *
2999
- * @remarks
3000
- * This function is usable only on the authentication window.
3001
- * This call causes the authentication window to be closed.
3002
- *
3003
- * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives
3004
- * this value in its callback or via the `Promise` return value
3005
- * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.
3068
+ * @deprecated
3069
+ * This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.
3070
+ * Please use the {@link authentication.notifyFailure authentication.notifyFailure(result?: string): void} instead.
3006
3071
  */
3007
- function notifyFailure(reason, callbackUrl) {
3008
- redirectIfWin32Outlook(callbackUrl, 'reason', reason);
3072
+ function notifyFailure(reason, _callbackUrl) {
3009
3073
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.authentication);
3010
3074
  sendMessageToParent('authentication.authenticate.failure', [reason]);
3011
3075
  // Wait for the message to be sent before closing the window
@@ -3034,48 +3098,6 @@ var authentication;
3034
3098
  closeAuthenticationWindow();
3035
3099
  }
3036
3100
  }
3037
- /**
3038
- * Validates that the callbackUrl param is a valid connector url, appends the result/reason and authSuccess/authFailure as URL fragments and redirects the window
3039
- * @param callbackUrl - the connectors url to redirect to
3040
- * @param key - "result" in case of success and "reason" in case of failure
3041
- * @param value - the value of the passed result/reason parameter
3042
- */
3043
- function redirectIfWin32Outlook(callbackUrl, key, value) {
3044
- if (callbackUrl) {
3045
- const link = document.createElement('a');
3046
- link.href = decodeURIComponent(callbackUrl);
3047
- if (link.host &&
3048
- link.host !== ssrSafeWindow().location.host &&
3049
- link.host === 'outlook.office.com' &&
3050
- link.search.indexOf('client_type=Win32_Outlook') > -1) {
3051
- if (key && key === 'result') {
3052
- if (value) {
3053
- link.href = updateUrlParameter(link.href, 'result', value);
3054
- }
3055
- Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authSuccess', ''));
3056
- }
3057
- if (key && key === 'reason') {
3058
- if (value) {
3059
- link.href = updateUrlParameter(link.href, 'reason', value);
3060
- }
3061
- Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authFailure', ''));
3062
- }
3063
- }
3064
- }
3065
- }
3066
- /**
3067
- * Appends either result or reason as a fragment to the 'callbackUrl'
3068
- * @param uri - the url to modify
3069
- * @param key - the fragment key
3070
- * @param value - the fragment value
3071
- */
3072
- function updateUrlParameter(uri, key, value) {
3073
- const i = uri.indexOf('#');
3074
- let hash = i === -1 ? '#' : uri.substr(i);
3075
- hash = hash + '&' + key + (value !== '' ? '=' + value : '');
3076
- uri = i === -1 ? uri : uri.substr(0, i);
3077
- return uri + hash;
3078
- }
3079
3101
  /**
3080
3102
  * @hidden
3081
3103
  * Limited set of data residencies information exposed to 1P application developers
@@ -3245,69 +3267,94 @@ var dialog;
3245
3267
  }
3246
3268
  url.submit = submit;
3247
3269
  /**
3248
- * Send message to the parent from dialog
3270
+ * Subcapability that allows communication between the dialog and the parent app.
3249
3271
  *
3250
3272
  * @remarks
3251
- * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
3252
- *
3253
- * @param message - The message to send to the parent
3273
+ * Note that dialog can be invoked from parentless scenarios e.g. Search Message Extensions. The subcapability `parentCommunication` is not supported in such scenarios.
3254
3274
  *
3255
3275
  * @beta
3256
3276
  */
3257
- function sendMessageToParentFromDialog(
3258
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3259
- message) {
3260
- internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
3261
- if (!isSupported()) {
3262
- throw errorNotSupportedOnPlatform;
3277
+ let parentCommunication;
3278
+ (function (parentCommunication) {
3279
+ /**
3280
+ * Send message to the parent from dialog
3281
+ *
3282
+ * @remarks
3283
+ * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
3284
+ *
3285
+ * @param message - The message to send to the parent
3286
+ *
3287
+ * @beta
3288
+ */
3289
+ function sendMessageToParentFromDialog(
3290
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3291
+ message) {
3292
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
3293
+ if (!isSupported()) {
3294
+ throw errorNotSupportedOnPlatform;
3295
+ }
3296
+ sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_ParentCommunication_SendMessageToParentFromDialog), 'messageForParent', [message]);
3263
3297
  }
3264
- sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_SendMessageToParentFromDialog), 'messageForParent', [message]);
3265
- }
3266
- url.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
3267
- /**
3268
- * Send message to the dialog from the parent
3269
- *
3270
- * @param message - The message to send
3271
- *
3272
- * @beta
3273
- */
3274
- function sendMessageToDialog(
3275
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3276
- message) {
3277
- internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3278
- if (!isSupported()) {
3279
- throw errorNotSupportedOnPlatform;
3298
+ parentCommunication.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
3299
+ /**
3300
+ * Send message to the dialog from the parent
3301
+ *
3302
+ * @param message - The message to send
3303
+ *
3304
+ * @beta
3305
+ */
3306
+ function sendMessageToDialog(
3307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3308
+ message) {
3309
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3310
+ if (!isSupported()) {
3311
+ throw errorNotSupportedOnPlatform;
3312
+ }
3313
+ sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_ParentCommunication_SendMessageToDialog), 'messageForChild', [message]);
3280
3314
  }
3281
- sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_SendMessageToDialog), 'messageForChild', [message]);
3282
- }
3283
- url.sendMessageToDialog = sendMessageToDialog;
3284
- /**
3285
- * Register a listener that will be triggered when a message is received from the app that opened the dialog.
3286
- *
3287
- * @remarks
3288
- * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
3289
- *
3290
- * @param listener - The listener that will be triggered.
3291
- *
3292
- * @beta
3293
- */
3294
- function registerOnMessageFromParent(listener) {
3295
- internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
3296
- if (!isSupported()) {
3297
- throw errorNotSupportedOnPlatform;
3315
+ parentCommunication.sendMessageToDialog = sendMessageToDialog;
3316
+ /**
3317
+ * Register a listener that will be triggered when a message is received from the app that opened the dialog.
3318
+ *
3319
+ * @remarks
3320
+ * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
3321
+ *
3322
+ * @param listener - The listener that will be triggered.
3323
+ *
3324
+ * @beta
3325
+ */
3326
+ function registerOnMessageFromParent(listener) {
3327
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
3328
+ if (!isSupported()) {
3329
+ throw errorNotSupportedOnPlatform;
3330
+ }
3331
+ // We need to remove the original 'messageForChild'
3332
+ // handler since the original does not allow for post messages.
3333
+ // It is replaced by the user specified listener that is passed in.
3334
+ removeHandler('messageForChild');
3335
+ registerHandler('messageForChild', listener);
3336
+ storedMessages.reverse();
3337
+ while (storedMessages.length > 0) {
3338
+ const message = storedMessages.pop();
3339
+ listener(message);
3340
+ }
3298
3341
  }
3299
- // We need to remove the original 'messageForChild'
3300
- // handler since the original does not allow for post messages.
3301
- // It is replaced by the user specified listener that is passed in.
3302
- removeHandler('messageForChild');
3303
- registerHandler('messageForChild', listener);
3304
- storedMessages.reverse();
3305
- while (storedMessages.length > 0) {
3306
- const message = storedMessages.pop();
3307
- listener(message);
3342
+ parentCommunication.registerOnMessageFromParent = registerOnMessageFromParent;
3343
+ /**
3344
+ * Checks if dialog.url.parentCommunication capability is supported by the host
3345
+ *
3346
+ * @returns boolean to represent whether dialog.url.parentCommunication capability is supported
3347
+ *
3348
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
3349
+ *
3350
+ * @beta
3351
+ */
3352
+ function isSupported() {
3353
+ var _a, _b;
3354
+ return internalAPIs_ensureInitialized(runtime_runtime) && !!((_b = (_a = runtime_runtime.supports.dialog) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.parentCommunication);
3308
3355
  }
3309
- }
3310
- url.registerOnMessageFromParent = registerOnMessageFromParent;
3356
+ parentCommunication.isSupported = isSupported;
3357
+ })(parentCommunication = url.parentCommunication || (url.parentCommunication = {}));
3311
3358
  /**
3312
3359
  * Checks if dialog.url module is supported by the host
3313
3360
  *
@@ -4310,6 +4357,31 @@ function setCurrentFrameHelper(apiVersionTag, frameInfo) {
4310
4357
  }
4311
4358
  sendMessageToParentWithVersion(apiVersionTag, 'setFrameContext', [frameInfo]);
4312
4359
  }
4360
+ function configSetValidityStateHelper(apiVersionTag, validityState) {
4361
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings, FrameContexts.remove);
4362
+ if (!pages.config.isSupported()) {
4363
+ throw errorNotSupportedOnPlatform;
4364
+ }
4365
+ sendMessageToParentWithVersion(apiVersionTag, 'settings.setValidityState', [validityState]);
4366
+ }
4367
+ function getConfigHelper(apiVersionTag) {
4368
+ return new Promise((resolve) => {
4369
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
4370
+ if (!pages.isSupported()) {
4371
+ throw errorNotSupportedOnPlatform;
4372
+ }
4373
+ resolve(sendAndUnwrapWithVersion(apiVersionTag, 'settings.getSettings'));
4374
+ });
4375
+ }
4376
+ function configSetConfigHelper(apiVersionTag, instanceConfig) {
4377
+ return new Promise((resolve) => {
4378
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
4379
+ if (!pages.config.isSupported()) {
4380
+ throw errorNotSupportedOnPlatform;
4381
+ }
4382
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'settings.setSettings', instanceConfig));
4383
+ });
4384
+ }
4313
4385
  /**
4314
4386
  * Navigation-specific part of the SDK.
4315
4387
  */
@@ -4375,13 +4447,7 @@ var pages;
4375
4447
  * @returns Promise that resolves with the {@link InstanceConfig} object.
4376
4448
  */
4377
4449
  function getConfig() {
4378
- return new Promise((resolve) => {
4379
- internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
4380
- if (!isSupported()) {
4381
- throw errorNotSupportedOnPlatform;
4382
- }
4383
- resolve(sendAndUnwrapWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_GetConfig), 'settings.getSettings'));
4384
- });
4450
+ return getConfigHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_GetConfig));
4385
4451
  }
4386
4452
  pages.getConfig = getConfig;
4387
4453
  /**
@@ -4533,11 +4599,7 @@ var pages;
4533
4599
  * @param validityState - Indicates whether the save or remove button is enabled for the user.
4534
4600
  */
4535
4601
  function setValidityState(validityState) {
4536
- internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings, FrameContexts.remove);
4537
- if (!isSupported()) {
4538
- throw errorNotSupportedOnPlatform;
4539
- }
4540
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetValidityState), 'settings.setValidityState', [validityState]);
4602
+ return configSetValidityStateHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetValidityState), validityState);
4541
4603
  }
4542
4604
  config.setValidityState = setValidityState;
4543
4605
  /**
@@ -4547,13 +4609,7 @@ var pages;
4547
4609
  * @returns Promise that resolves when the operation has completed.
4548
4610
  */
4549
4611
  function setConfig(instanceConfig) {
4550
- return new Promise((resolve) => {
4551
- internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
4552
- if (!isSupported()) {
4553
- throw errorNotSupportedOnPlatform;
4554
- }
4555
- resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetConfig), 'settings.setSettings', instanceConfig));
4556
- });
4612
+ return configSetConfigHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetConfig), instanceConfig);
4557
4613
  }
4558
4614
  config.setConfig = setConfig;
4559
4615
  /**
@@ -4564,7 +4620,7 @@ var pages;
4564
4620
  * @param handler - The handler to invoke when the user selects the Save button.
4565
4621
  */
4566
4622
  function registerOnSaveHandler(handler) {
4567
- registerOnSaveHandlerHelper(handler, () => {
4623
+ registerOnSaveHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnSaveHandler), handler, () => {
4568
4624
  if (!isNullOrUndefined(handler) && !isSupported()) {
4569
4625
  throw errorNotSupportedOnPlatform;
4570
4626
  }
@@ -4578,18 +4634,18 @@ var pages;
4578
4634
  * @internal
4579
4635
  * Limited to Microsoft-internal use
4580
4636
  *
4637
+ * @param apiVersionTag - The API version tag, which is used for telemetry, composed by API version number and source API name.
4581
4638
  * @param handler - The handler to invoke when the user selects the Save button.
4582
4639
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4583
4640
  */
4584
- function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
4641
+ function registerOnSaveHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
4585
4642
  // allow for registration cleanup even when not finished initializing
4586
4643
  !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings);
4587
4644
  if (versionSpecificHelper) {
4588
4645
  versionSpecificHelper();
4589
4646
  }
4590
4647
  saveHandler = handler;
4591
- !isNullOrUndefined(handler) &&
4592
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnSaveHandlerHelper), 'registerHandler', ['save']);
4648
+ !isNullOrUndefined(handler) && sendMessageToParentWithVersion(apiVersionTag, 'registerHandler', ['save']);
4593
4649
  }
4594
4650
  config.registerOnSaveHandlerHelper = registerOnSaveHandlerHelper;
4595
4651
  /**
@@ -4600,7 +4656,7 @@ var pages;
4600
4656
  * @param handler - The handler to invoke when the user selects the Remove button.
4601
4657
  */
4602
4658
  function registerOnRemoveHandler(handler) {
4603
- registerOnRemoveHandlerHelper(handler, () => {
4659
+ registerOnRemoveHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnRemoveHandler), handler, () => {
4604
4660
  if (!isNullOrUndefined(handler) && !isSupported()) {
4605
4661
  throw errorNotSupportedOnPlatform;
4606
4662
  }
@@ -4614,18 +4670,18 @@ var pages;
4614
4670
  * @internal
4615
4671
  * Limited to Microsoft-internal use
4616
4672
  *
4673
+ * @param apiVersionTag - The API version tag, which is used for telemetry, composed by API version number and source API name.
4617
4674
  * @param handler - The handler to invoke when the user selects the Remove button.
4618
4675
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4619
4676
  */
4620
- function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
4677
+ function registerOnRemoveHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
4621
4678
  // allow for registration cleanup even when not finished initializing
4622
4679
  !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.remove, FrameContexts.settings);
4623
4680
  if (versionSpecificHelper) {
4624
4681
  versionSpecificHelper();
4625
4682
  }
4626
4683
  removeHandler = handler;
4627
- !isNullOrUndefined(handler) &&
4628
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnRemoveHandlerHelper), 'registerHandler', ['remove']);
4684
+ !isNullOrUndefined(handler) && sendMessageToParentWithVersion(apiVersionTag, 'registerHandler', ['remove']);
4629
4685
  }
4630
4686
  config.registerOnRemoveHandlerHelper = registerOnRemoveHandlerHelper;
4631
4687
  function handleSave(result) {
@@ -4664,12 +4720,12 @@ var pages;
4664
4720
  }
4665
4721
  notifySuccess() {
4666
4722
  this.ensureNotNotified();
4667
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Save_Success), 'settings.save.success');
4723
+ sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SaveEvent_NotifySuccess), 'settings.save.success');
4668
4724
  this.notified = true;
4669
4725
  }
4670
4726
  notifyFailure(reason) {
4671
4727
  this.ensureNotNotified();
4672
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Save_Failure), 'settings.save.failure', [reason]);
4728
+ sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SaveEvent_NotifyFailure), 'settings.save.failure', [reason]);
4673
4729
  this.notified = true;
4674
4730
  }
4675
4731
  ensureNotNotified() {
@@ -4701,12 +4757,12 @@ var pages;
4701
4757
  }
4702
4758
  notifySuccess() {
4703
4759
  this.ensureNotNotified();
4704
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Remove_Success), 'settings.remove.success');
4760
+ sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RemoveEvent_NotifySuccess), 'settings.remove.success');
4705
4761
  this.notified = true;
4706
4762
  }
4707
4763
  notifyFailure(reason) {
4708
4764
  this.ensureNotNotified();
4709
- sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Remove_Failure), 'settings.remove.failure', [reason]);
4765
+ sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RemoveEvent_NotifyFailure), 'settings.remove.failure', [reason]);
4710
4766
  this.notified = true;
4711
4767
  }
4712
4768
  ensureNotNotified() {
@@ -4821,6 +4877,8 @@ var pages;
4821
4877
  * Hide from docs
4822
4878
  * ------
4823
4879
  * Provides APIs to interact with the full-trust part of the SDK. Limited to 1P applications
4880
+ * @internal
4881
+ * Limited to Microsoft-internal use
4824
4882
  */
4825
4883
  let fullTrust;
4826
4884
  (function (fullTrust) {
@@ -4829,6 +4887,7 @@ var pages;
4829
4887
  * Hide from docs
4830
4888
  * ------
4831
4889
  * Place the tab into full-screen mode.
4890
+ *
4832
4891
  */
4833
4892
  function enterFullscreen() {
4834
4893
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
@@ -5261,6 +5320,125 @@ function handlers_registerOnResumeHandler(handler) {
5261
5320
  !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['load']);
5262
5321
  }
5263
5322
 
5323
+ ;// CONCATENATED MODULE: ./src/internal/nestedAppAuth.ts
5324
+
5325
+
5326
+ const nestedAppAuthLogger = getLogger('nestedAppAuth');
5327
+ const tryPolyfillWithNestedAppAuthBridgeLogger = nestedAppAuthLogger.extend('tryPolyfillWithNestedAppAuthBridge');
5328
+ /**
5329
+ * @hidden
5330
+ * Enumeration for nested app authentication message event names.
5331
+ *
5332
+ * @internal
5333
+ * Limited to Microsoft-internal use
5334
+ *
5335
+ * @enum {string}
5336
+ *
5337
+ * @property {string} Request - Event name for a nested app authentication request.
5338
+ * @property {string} Response - Event name for a nested app authentication response.
5339
+ */
5340
+ var NestedAppAuthMessageEventNames;
5341
+ (function (NestedAppAuthMessageEventNames) {
5342
+ NestedAppAuthMessageEventNames["Request"] = "NestedAppAuthRequest";
5343
+ NestedAppAuthMessageEventNames["Response"] = "NestedAppAuthResponse";
5344
+ })(NestedAppAuthMessageEventNames || (NestedAppAuthMessageEventNames = {}));
5345
+ /**
5346
+ * @hidden
5347
+ * Attempt to polyfill the nestedAppAuthBridge object on the given window
5348
+ *
5349
+ * @internal
5350
+ * Limited to Microsoft-internal use
5351
+ */
5352
+ function tryPolyfillWithNestedAppAuthBridge(clientSupportedSDKVersion, window, handlers) {
5353
+ var _a;
5354
+ const logger = tryPolyfillWithNestedAppAuthBridgeLogger;
5355
+ if (GlobalVars.isFramelessWindow) {
5356
+ logger('Cannot polyfill nestedAppAuthBridge as current window is frameless');
5357
+ return;
5358
+ }
5359
+ if (!window) {
5360
+ logger('Cannot polyfill nestedAppAuthBridge as current window does not exist');
5361
+ return;
5362
+ }
5363
+ const parsedClientSupportedSDKVersion = (() => {
5364
+ try {
5365
+ return JSON.parse(clientSupportedSDKVersion);
5366
+ }
5367
+ catch (e) {
5368
+ return null;
5369
+ }
5370
+ })();
5371
+ if (!parsedClientSupportedSDKVersion || !((_a = parsedClientSupportedSDKVersion.supports) === null || _a === void 0 ? void 0 : _a.nestedAppAuth)) {
5372
+ logger('Cannot polyfill nestedAppAuthBridge as current hub does not support nested app auth');
5373
+ return;
5374
+ }
5375
+ const extendedWindow = window;
5376
+ if (extendedWindow.nestedAppAuthBridge) {
5377
+ logger('nestedAppAuthBridge already exists on current window, skipping polyfill');
5378
+ return;
5379
+ }
5380
+ const nestedAppAuthBridge = createNestedAppAuthBridge(extendedWindow, handlers);
5381
+ if (nestedAppAuthBridge) {
5382
+ extendedWindow.nestedAppAuthBridge = nestedAppAuthBridge;
5383
+ }
5384
+ }
5385
+ const createNestedAppAuthBridgeLogger = nestedAppAuthLogger.extend('createNestedAppAuthBridge');
5386
+ /**
5387
+ * @hidden
5388
+ * Creates a bridge for nested app authentication.
5389
+ *
5390
+ * @internal
5391
+ * Limited to Microsoft-internal use
5392
+ *
5393
+ * @param {Window | null} window - The window object where the nested app authentication bridge will be created. If null, the function will log an error message and return null.
5394
+ * @returns {NestedAppAuthBridge | null} Returns an object with methods for adding and removing event listeners, and posting messages. If the provided window is null, returns null.
5395
+ *
5396
+ * @property {Function} addEventListener - Adds an event listener to the window. Only supports the 'message' event. If an unsupported event is passed, logs an error message.
5397
+ * @property {Function} postMessage - Posts a message to the window. The message should be a stringified JSON object with a messageType of 'NestedAppAuthRequest'. If the message does not meet these criteria, logs an error message.
5398
+ * @property {Function} removeEventListener - Removes an event listener from the window.
5399
+ */
5400
+ function createNestedAppAuthBridge(window, bridgeHandlers) {
5401
+ const logger = createNestedAppAuthBridgeLogger;
5402
+ if (!window) {
5403
+ logger('nestedAppAuthBridge cannot be created as current window does not exist');
5404
+ return null;
5405
+ }
5406
+ const { onMessage, sendPostMessage } = bridgeHandlers;
5407
+ const nestedAppAuthBridgeHandler = (callback) => (evt) => onMessage(evt, callback);
5408
+ return {
5409
+ addEventListener: (eventName, callback) => {
5410
+ if (eventName === 'message') {
5411
+ window.addEventListener(eventName, nestedAppAuthBridgeHandler(callback));
5412
+ }
5413
+ else {
5414
+ logger(`Event ${eventName} is not supported by nestedAppAuthBridge`);
5415
+ }
5416
+ },
5417
+ postMessage: (message) => {
5418
+ // Validate that it is a valid auth bridge request message
5419
+ const parsedMessage = (() => {
5420
+ try {
5421
+ return JSON.parse(message);
5422
+ }
5423
+ catch (e) {
5424
+ return null;
5425
+ }
5426
+ })();
5427
+ if (!parsedMessage ||
5428
+ typeof parsedMessage !== 'object' ||
5429
+ parsedMessage.messageType !== NestedAppAuthMessageEventNames.Request) {
5430
+ logger('Unrecognized data format received by app, message being ignored. Message: %o', message);
5431
+ return;
5432
+ }
5433
+ // Post the message to the top window
5434
+ sendPostMessage(message);
5435
+ },
5436
+ removeEventListener: (eventName, callback) => {
5437
+ window.removeEventListener(eventName, nestedAppAuthBridgeHandler(callback));
5438
+ },
5439
+ };
5440
+ }
5441
+
5264
5442
  ;// CONCATENATED MODULE: ./src/internal/communication.ts
5265
5443
  /* eslint-disable @typescript-eslint/ban-types */
5266
5444
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -5282,6 +5460,7 @@ var communication_awaiter = (undefined && undefined.__awaiter) || function (this
5282
5460
 
5283
5461
 
5284
5462
 
5463
+
5285
5464
  const communicationLogger = getLogger('communication');
5286
5465
  /**
5287
5466
  * @internal
@@ -5297,6 +5476,7 @@ class CommunicationPrivate {
5297
5476
  }
5298
5477
  CommunicationPrivate.parentMessageQueue = [];
5299
5478
  CommunicationPrivate.childMessageQueue = [];
5479
+ CommunicationPrivate.topMessageQueue = [];
5300
5480
  CommunicationPrivate.nextMessageId = 0;
5301
5481
  CommunicationPrivate.callbacks = {};
5302
5482
  CommunicationPrivate.promiseCallbacks = {};
@@ -5314,6 +5494,7 @@ function initializeCommunication(validMessageOrigins, apiVersionTag) {
5314
5494
  Communication.currentWindow.parent !== Communication.currentWindow.self
5315
5495
  ? Communication.currentWindow.parent
5316
5496
  : Communication.currentWindow.opener;
5497
+ Communication.topWindow = Communication.currentWindow.top;
5317
5498
  // Listen to messages from the parent or child frame.
5318
5499
  // Frameless windows will only receive this event from child frames and if validMessageOrigins is passed.
5319
5500
  if (Communication.parentWindow || validMessageOrigins) {
@@ -5338,6 +5519,10 @@ function initializeCommunication(validMessageOrigins, apiVersionTag) {
5338
5519
  version,
5339
5520
  latestRuntimeApiVersion,
5340
5521
  ]).then(([context, clientType, runtimeConfig, clientSupportedSDKVersion]) => {
5522
+ tryPolyfillWithNestedAppAuthBridge(clientSupportedSDKVersion, Communication.currentWindow, {
5523
+ onMessage: processAuthBridgeMessage,
5524
+ sendPostMessage: sendNestedAuthRequestToTopWindow,
5525
+ });
5341
5526
  return { context, clientType, runtimeConfig, clientSupportedSDKVersion };
5342
5527
  });
5343
5528
  }
@@ -5553,19 +5738,29 @@ function sendMessageToParent(actionName, argsOrCallback, callback) {
5553
5738
  CommunicationPrivate.callbacks[request.id] = callback;
5554
5739
  }
5555
5740
  }
5556
- const sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');
5741
+ const sendNestedAuthRequestToTopWindowLogger = communicationLogger.extend('sendNestedAuthRequestToTopWindow');
5557
5742
  /**
5558
5743
  * @internal
5559
5744
  * Limited to Microsoft-internal use
5560
5745
  */
5561
- function sendMessageToParentHelper(apiVersionTag, actionName, args) {
5562
- const logger = sendMessageToParentHelperLogger;
5563
- const targetWindow = Communication.parentWindow;
5564
- const request = createMessageRequest(apiVersionTag, actionName, args);
5565
- logger('Message %i information: %o', request.id, { actionName, args });
5746
+ function sendNestedAuthRequestToTopWindow(message) {
5747
+ const logger = sendNestedAuthRequestToTopWindowLogger;
5748
+ const targetWindow = Communication.topWindow;
5749
+ const request = createNestedAppAuthRequest(message);
5750
+ logger('Message %i information: %o', request.id, { actionName: request.func });
5751
+ return sendRequestToTargetWindowHelper(targetWindow, request);
5752
+ }
5753
+ const sendRequestToTargetWindowHelperLogger = communicationLogger.extend('sendRequestToTargetWindowHelper');
5754
+ /**
5755
+ * @internal
5756
+ * Limited to Microsoft-internal use
5757
+ */
5758
+ function sendRequestToTargetWindowHelper(targetWindow, request) {
5759
+ const logger = sendRequestToTargetWindowHelperLogger;
5760
+ const targetWindowName = getTargetName(targetWindow);
5566
5761
  if (GlobalVars.isFramelessWindow) {
5567
5762
  if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {
5568
- logger('Sending message %i to parent via framelessPostMessage interface', request.id);
5763
+ logger(`Sending message %i to ${targetWindowName} via framelessPostMessage interface`, request.id);
5569
5764
  Communication.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(request));
5570
5765
  }
5571
5766
  }
@@ -5574,16 +5769,29 @@ function sendMessageToParentHelper(apiVersionTag, actionName, args) {
5574
5769
  // If the target window isn't closed and we already know its origin, send the message right away; otherwise,
5575
5770
  // queue the message and send it after the origin is established
5576
5771
  if (targetWindow && targetOrigin) {
5577
- logger('Sending message %i to parent via postMessage', request.id);
5772
+ logger(`Sending message %i to ${targetWindowName} via postMessage`, request.id);
5578
5773
  targetWindow.postMessage(request, targetOrigin);
5579
5774
  }
5580
5775
  else {
5581
- logger('Adding message %i to parent message queue', request.id);
5776
+ logger(`Adding message %i to ${targetWindowName} message queue`, request.id);
5582
5777
  getTargetMessageQueue(targetWindow).push(request);
5583
5778
  }
5584
5779
  }
5585
5780
  return request;
5586
5781
  }
5782
+ const sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');
5783
+ /**
5784
+ * @internal
5785
+ * Limited to Microsoft-internal use
5786
+ */
5787
+ function sendMessageToParentHelper(apiVersionTag, actionName, args) {
5788
+ const logger = sendMessageToParentHelperLogger;
5789
+ const targetWindow = Communication.parentWindow;
5790
+ const request = createMessageRequest(apiVersionTag, actionName, args);
5791
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5792
+ logger('Message %i information: %o', request.id, { actionName, args });
5793
+ return sendRequestToTargetWindowHelper(targetWindow, request);
5794
+ }
5587
5795
  const processMessageLogger = communicationLogger.extend('processMessage');
5588
5796
  /**
5589
5797
  * @internal
@@ -5618,6 +5826,69 @@ function processMessage(evt) {
5618
5826
  });
5619
5827
  });
5620
5828
  }
5829
+ const processAuthBridgeMessageLogger = communicationLogger.extend('processAuthBridgeMessage');
5830
+ /**
5831
+ * @internal
5832
+ * Limited to Microsoft-internal use
5833
+ */
5834
+ function processAuthBridgeMessage(evt, onMessageReceived) {
5835
+ var _a, _b;
5836
+ const logger = processAuthBridgeMessageLogger;
5837
+ // Process only if we received a valid message
5838
+ if (!evt || !evt.data || typeof evt.data !== 'object') {
5839
+ logger('Unrecognized message format received by app, message being ignored. Message: %o', evt);
5840
+ return;
5841
+ }
5842
+ const { args } = evt.data;
5843
+ const [, message] = args !== null && args !== void 0 ? args : [];
5844
+ const parsedData = (() => {
5845
+ try {
5846
+ return JSON.parse(message);
5847
+ }
5848
+ catch (e) {
5849
+ return null;
5850
+ }
5851
+ })();
5852
+ // Validate that it is a valid auth bridge response message
5853
+ if (!parsedData ||
5854
+ typeof parsedData !== 'object' ||
5855
+ parsedData.messageType !== NestedAppAuthMessageEventNames.Response) {
5856
+ logger('Unrecognized data format received by app, message being ignored. Message: %o', evt);
5857
+ return;
5858
+ }
5859
+ // Process only if the message is coming from a different window and a valid origin
5860
+ // valid origins are either a pre-known origin or one specified by the app developer
5861
+ // in their call to app.initialize
5862
+ const messageSource = evt.source || ((_a = evt === null || evt === void 0 ? void 0 : evt.originalEvent) === null || _a === void 0 ? void 0 : _a.source);
5863
+ const messageOrigin = evt.origin || ((_b = evt === null || evt === void 0 ? void 0 : evt.originalEvent) === null || _b === void 0 ? void 0 : _b.origin);
5864
+ if (!messageSource) {
5865
+ logger('Message being ignored by app because it is coming for a target that is null');
5866
+ return;
5867
+ }
5868
+ if (!shouldProcessMessage(messageSource, messageOrigin)) {
5869
+ logger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin');
5870
+ return;
5871
+ }
5872
+ /**
5873
+ * In most cases, top level window and the parent window will be same.
5874
+ * If they're not, perform the necessary updates for the top level window.
5875
+ *
5876
+ * Top window logic to flush messages is kept independent so that we don't affect
5877
+ * any of the code for the existing communication channel.
5878
+ */
5879
+ if (!Communication.topWindow || Communication.topWindow.closed || messageSource === Communication.topWindow) {
5880
+ Communication.topWindow = messageSource;
5881
+ Communication.topOrigin = messageOrigin;
5882
+ }
5883
+ // Clean up pointers to closed parent and child windows
5884
+ if (Communication.topWindow && Communication.topWindow.closed) {
5885
+ Communication.topWindow = null;
5886
+ Communication.topOrigin = null;
5887
+ }
5888
+ flushMessageQueue(Communication.topWindow);
5889
+ // Return the response to the registered callback
5890
+ onMessageReceived(message);
5891
+ }
5621
5892
  const shouldProcessMessageLogger = communicationLogger.extend('shouldProcessMessage');
5622
5893
  /**
5623
5894
  * @hidden
@@ -5756,27 +6027,70 @@ function handleChildMessage(evt) {
5756
6027
  }
5757
6028
  }
5758
6029
  }
6030
+ /**
6031
+ * @internal
6032
+ * Limited to Microsoft-internal use
6033
+ *
6034
+ * Checks if the top window and the parent window are different.
6035
+ *
6036
+ * @returns {boolean} Returns true if the top window and the parent window are different, false otherwise.
6037
+ */
6038
+ function areTopAndParentWindowsDistinct() {
6039
+ return Communication.topWindow !== Communication.parentWindow;
6040
+ }
5759
6041
  /**
5760
6042
  * @internal
5761
6043
  * Limited to Microsoft-internal use
5762
6044
  */
5763
6045
  function getTargetMessageQueue(targetWindow) {
5764
- return targetWindow === Communication.parentWindow
5765
- ? CommunicationPrivate.parentMessageQueue
5766
- : targetWindow === Communication.childWindow
5767
- ? CommunicationPrivate.childMessageQueue
5768
- : [];
6046
+ if (targetWindow === Communication.topWindow && areTopAndParentWindowsDistinct()) {
6047
+ return CommunicationPrivate.topMessageQueue;
6048
+ }
6049
+ else if (targetWindow === Communication.parentWindow) {
6050
+ return CommunicationPrivate.parentMessageQueue;
6051
+ }
6052
+ else if (targetWindow === Communication.childWindow) {
6053
+ return CommunicationPrivate.childMessageQueue;
6054
+ }
6055
+ else {
6056
+ return [];
6057
+ }
5769
6058
  }
5770
6059
  /**
5771
6060
  * @internal
5772
6061
  * Limited to Microsoft-internal use
5773
6062
  */
5774
6063
  function getTargetOrigin(targetWindow) {
5775
- return targetWindow === Communication.parentWindow
5776
- ? Communication.parentOrigin
5777
- : targetWindow === Communication.childWindow
5778
- ? Communication.childOrigin
5779
- : null;
6064
+ if (targetWindow === Communication.topWindow && areTopAndParentWindowsDistinct()) {
6065
+ return Communication.topOrigin;
6066
+ }
6067
+ else if (targetWindow === Communication.parentWindow) {
6068
+ return Communication.parentOrigin;
6069
+ }
6070
+ else if (targetWindow === Communication.childWindow) {
6071
+ return Communication.childOrigin;
6072
+ }
6073
+ else {
6074
+ return null;
6075
+ }
6076
+ }
6077
+ /**
6078
+ * @internal
6079
+ * Limited to Microsoft-internal use
6080
+ */
6081
+ function getTargetName(targetWindow) {
6082
+ if (targetWindow === Communication.topWindow && areTopAndParentWindowsDistinct()) {
6083
+ return 'top';
6084
+ }
6085
+ else if (targetWindow === Communication.parentWindow) {
6086
+ return 'parent';
6087
+ }
6088
+ else if (targetWindow === Communication.childWindow) {
6089
+ return 'child';
6090
+ }
6091
+ else {
6092
+ return null;
6093
+ }
5780
6094
  }
5781
6095
  const flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');
5782
6096
  /**
@@ -5786,7 +6100,7 @@ const flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');
5786
6100
  function flushMessageQueue(targetWindow) {
5787
6101
  const targetOrigin = getTargetOrigin(targetWindow);
5788
6102
  const targetMessageQueue = getTargetMessageQueue(targetWindow);
5789
- const target = targetWindow == Communication.parentWindow ? 'parent' : 'child';
6103
+ const target = getTargetName(targetWindow);
5790
6104
  while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
5791
6105
  const request = targetMessageQueue.shift();
5792
6106
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
@@ -5860,6 +6174,28 @@ function createMessageRequest(apiVersionTag, func, args) {
5860
6174
  apiversiontag: apiVersionTag,
5861
6175
  };
5862
6176
  }
6177
+ /**
6178
+ * @internal
6179
+ * Limited to Microsoft-internal use
6180
+ *
6181
+ * Creates a nested app authentication request.
6182
+ *
6183
+ * @param {string} message - The message to be included in the request. This is typically a stringified JSON object containing the details of the authentication request.
6184
+ * The reason for using a string is to allow complex data structures to be sent as a message while avoiding potential issues with object serialization and deserialization.
6185
+ *
6186
+ * @returns {NestedAppAuthRequest} Returns a NestedAppAuthRequest object with a unique id, the function name set to 'nestedAppAuthRequest', the current timestamp, an empty args array, and the provided message as data.
6187
+ */
6188
+ function createNestedAppAuthRequest(message) {
6189
+ return {
6190
+ id: CommunicationPrivate.nextMessageId++,
6191
+ func: 'nestedAppAuth.execute',
6192
+ timestamp: Date.now(),
6193
+ // Since this is a nested app auth request, we don't need to send any args.
6194
+ // We avoid overloading the args array with the message to avoid potential issues processing of these messages on the hubSDK.
6195
+ args: [],
6196
+ data: message,
6197
+ };
6198
+ }
5863
6199
  /**
5864
6200
  * @internal
5865
6201
  * Limited to Microsoft-internal use
@@ -6007,6 +6343,7 @@ var UserSettingTypes;
6007
6343
 
6008
6344
 
6009
6345
 
6346
+
6010
6347
  /**
6011
6348
  * @hidden
6012
6349
  * Upload a custom App manifest directly to both team and personal scopes.
@@ -6014,10 +6351,13 @@ var UserSettingTypes;
6014
6351
  *
6015
6352
  * @internal
6016
6353
  * Limited to Microsoft-internal use
6354
+ *
6355
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
6017
6356
  */
6357
+ const privateAPIsTelemetryVersionNumber = ApiVersionNumber.V_1;
6018
6358
  function uploadCustomApp(manifestBlob, onComplete) {
6019
6359
  internalAPIs_ensureInitialized(runtime_runtime);
6020
- sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());
6360
+ sendMessageToParentWithVersion(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_UploadCustomApp), 'uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());
6021
6361
  }
6022
6362
  /**
6023
6363
  * @hidden
@@ -6033,7 +6373,7 @@ function uploadCustomApp(manifestBlob, onComplete) {
6033
6373
  */
6034
6374
  function sendCustomMessage(actionName, args, callback) {
6035
6375
  internalAPIs_ensureInitialized(runtime_runtime);
6036
- sendMessageToParent(actionName, args, callback);
6376
+ sendMessageToParentWithVersion(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_SendCustomMessage), actionName, args, callback);
6037
6377
  }
6038
6378
  /**
6039
6379
  * @hidden
@@ -6067,7 +6407,7 @@ function sendCustomEvent(actionName, args) {
6067
6407
  */
6068
6408
  function registerCustomHandler(actionName, customHandler) {
6069
6409
  internalAPIs_ensureInitialized(runtime_runtime);
6070
- registerHandler(actionName, (...args) => {
6410
+ registerHandlerWithVersion(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_RegisterCustomHandler), actionName, (...args) => {
6071
6411
  return customHandler.apply(this, args);
6072
6412
  });
6073
6413
  }
@@ -6083,7 +6423,7 @@ function registerCustomHandler(actionName, customHandler) {
6083
6423
  */
6084
6424
  function registerUserSettingsChangeHandler(settingTypes, handler) {
6085
6425
  internalAPIs_ensureInitialized(runtime_runtime);
6086
- registerHandler('userSettingsChange', handler, true, [settingTypes]);
6426
+ registerHandlerWithVersion(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_RegisterUserSettingsChangeHandler), 'userSettingsChange', handler, true, [settingTypes]);
6087
6427
  }
6088
6428
  /**
6089
6429
  * @hidden
@@ -6113,7 +6453,7 @@ function openFilePreview(filePreviewParameters) {
6113
6453
  filePreviewParameters.conversationId,
6114
6454
  filePreviewParameters.sizeInBytes,
6115
6455
  ];
6116
- sendMessageToParent('openFilePreview', params);
6456
+ sendMessageToParentWithVersion(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_OpenFilePreview), 'openFilePreview', params);
6117
6457
  }
6118
6458
 
6119
6459
  ;// CONCATENATED MODULE: ./src/private/conversations.ts
@@ -7621,6 +7961,11 @@ class ParentAppWindow {
7621
7961
 
7622
7962
 
7623
7963
 
7964
+
7965
+ /**
7966
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
7967
+ */
7968
+ const secondaryBrowserTelemetryVersionNumber = ApiVersionNumber.V_2;
7624
7969
  /**
7625
7970
  * Namespace to power up the in-app browser experiences in the host app.
7626
7971
  * For e.g., opening a URL in the host app inside a browser
@@ -7651,7 +7996,7 @@ var secondaryBrowser;
7651
7996
  if (!url || !isValidHttpsURL(url)) {
7652
7997
  throw { errorCode: ErrorCode.INVALID_ARGUMENTS, message: 'Invalid Url: Only https URL is allowed' };
7653
7998
  }
7654
- return sendAndHandleSdkError('secondaryBrowser.open', url.toString());
7999
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(secondaryBrowserTelemetryVersionNumber, ApiName.SecondaryBrowser_OpenUrl), 'secondaryBrowser.open', url.toString());
7655
8000
  }
7656
8001
  secondaryBrowser.open = open;
7657
8002
  /**
@@ -8880,6 +9225,11 @@ function validatePersona(persona) {
8880
9225
 
8881
9226
 
8882
9227
 
9228
+
9229
+ /**
9230
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
9231
+ */
9232
+ const profileTelemetryVersionNumber = ApiVersionNumber.V_2;
8883
9233
  /**
8884
9234
  * Namespace for profile related APIs.
8885
9235
  *
@@ -8913,7 +9263,7 @@ var profile;
8913
9263
  height: showProfileRequest.targetElementBoundingRect.height,
8914
9264
  },
8915
9265
  };
8916
- resolve(sendAndHandleSdkError('profile.showProfile', requestInternal));
9266
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(profileTelemetryVersionNumber, ApiName.Profile_ShowProfile), 'profile.showProfile', requestInternal));
8917
9267
  });
8918
9268
  }
8919
9269
  profile.showProfile = showProfile;
@@ -9414,6 +9764,11 @@ VideoPerformanceStatistics.maxSessionTimeoutInMs = 1000 * 30;
9414
9764
  ;// CONCATENATED MODULE: ./src/internal/videoPerformanceMonitor.ts
9415
9765
 
9416
9766
 
9767
+
9768
+ /**
9769
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
9770
+ */
9771
+ const videoPerformanceMonitorTelemetryVersionNumber = ApiVersionNumber.V_2;
9417
9772
  /**
9418
9773
  * This class is used to monitor the performance of video processing, and report performance events.
9419
9774
  */
@@ -9425,7 +9780,7 @@ class VideoPerformanceMonitor {
9425
9780
  this.frameProcessingStartedAt = 0;
9426
9781
  this.frameProcessingTimeCost = 0;
9427
9782
  this.processedFrameCount = 0;
9428
- this.performanceStatistics = new VideoPerformanceStatistics(VideoPerformanceMonitor.distributionBinSize, (result) => this.reportPerformanceEvent('video.performance.performanceDataGenerated', [result]));
9783
+ this.performanceStatistics = new VideoPerformanceStatistics(VideoPerformanceMonitor.distributionBinSize, (result) => this.reportPerformanceEvent(getApiVersionTag(videoPerformanceMonitorTelemetryVersionNumber, ApiName.VideoPerformanceMonitor_Constructor), 'video.performance.performanceDataGenerated', [result]));
9429
9784
  }
9430
9785
  /**
9431
9786
  * Start to check frame processing time intervally
@@ -9438,7 +9793,7 @@ class VideoPerformanceMonitor {
9438
9793
  }
9439
9794
  const averageFrameProcessingTime = this.frameProcessingTimeCost / this.processedFrameCount;
9440
9795
  if (averageFrameProcessingTime > this.frameProcessTimeLimit) {
9441
- this.reportPerformanceEvent('video.performance.frameProcessingSlow', [averageFrameProcessingTime]);
9796
+ this.reportPerformanceEvent(getApiVersionTag(videoPerformanceMonitorTelemetryVersionNumber, ApiName.VideoPerformanceMonitor_StartMonitorSlowFrameProcessing), 'video.performance.frameProcessingSlow', [averageFrameProcessingTime]);
9442
9797
  }
9443
9798
  this.frameProcessingTimeCost = 0;
9444
9799
  this.processedFrameCount = 0;
@@ -9506,11 +9861,7 @@ class VideoPerformanceMonitor {
9506
9861
  this.performanceStatistics.processEnds();
9507
9862
  if (!this.isFirstFrameProcessed) {
9508
9863
  this.isFirstFrameProcessed = true;
9509
- this.reportPerformanceEvent('video.performance.firstFrameProcessed', [
9510
- Date.now(),
9511
- this.appliedEffect.effectId,
9512
- (_a = this.appliedEffect) === null || _a === void 0 ? void 0 : _a.effectParam,
9513
- ]);
9864
+ this.reportPerformanceEvent(getApiVersionTag(videoPerformanceMonitorTelemetryVersionNumber, ApiName.VideoPerformanceMonitor_ReportFrameProcessed), 'video.performance.firstFrameProcessed', [Date.now(), this.appliedEffect.effectId, (_a = this.appliedEffect) === null || _a === void 0 ? void 0 : _a.effectParam]);
9514
9865
  }
9515
9866
  }
9516
9867
  /**
@@ -9526,7 +9877,7 @@ class VideoPerformanceMonitor {
9526
9877
  reportTextureStreamAcquired() {
9527
9878
  if (this.gettingTextureStreamStartedAt !== undefined) {
9528
9879
  const timeTaken = performance.now() - this.gettingTextureStreamStartedAt;
9529
- this.reportPerformanceEvent('video.performance.textureStreamAcquired', [this.currentStreamId, timeTaken]);
9880
+ this.reportPerformanceEvent(getApiVersionTag(videoPerformanceMonitorTelemetryVersionNumber, ApiName.VideoPerformanceMonitor_ReportTextureStreamAcquired), 'video.performance.textureStreamAcquired', [this.currentStreamId, timeTaken]);
9530
9881
  }
9531
9882
  }
9532
9883
  }
@@ -9562,6 +9913,11 @@ var videoEffects_rest = (undefined && undefined.__rest) || function (s, e) {
9562
9913
 
9563
9914
 
9564
9915
 
9916
+
9917
+ /**
9918
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
9919
+ */
9920
+ const videoEffectsTelemetryVersionNumber = ApiVersionNumber.V_2;
9565
9921
  /**
9566
9922
  * Namespace to video extensibility of the SDK
9567
9923
  * @beta
@@ -9570,7 +9926,7 @@ var videoEffects;
9570
9926
  (function (videoEffects) {
9571
9927
  const videoPerformanceMonitor = inServerSideRenderingEnvironment()
9572
9928
  ? undefined
9573
- : new VideoPerformanceMonitor(sendMessageToParent);
9929
+ : new VideoPerformanceMonitor(sendMessageToParentWithVersion);
9574
9930
  /**
9575
9931
  * Video frame format enum, currently only support NV12
9576
9932
  * @beta
@@ -9656,7 +10012,7 @@ var videoEffects;
9656
10012
  if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {
9657
10013
  throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');
9658
10014
  }
9659
- registerHandler('video.setFrameProcessTimeLimit', (timeLimitInfo) => videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimitInfo.timeLimit), false);
10015
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterSetFrameProcessTimeLimitHandler), 'video.setFrameProcessTimeLimit', (timeLimitInfo) => videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimitInfo.timeLimit), false);
9660
10016
  if (doesSupportMediaStream()) {
9661
10017
  registerForMediaStream(parameters.videoFrameHandler, parameters.config);
9662
10018
  }
@@ -9683,7 +10039,7 @@ var videoEffects;
9683
10039
  if (!isSupported()) {
9684
10040
  throw errorNotSupportedOnPlatform;
9685
10041
  }
9686
- sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId]);
10042
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifySelectedVideoEffectChanged), 'video.videoEffectChanged', [effectChangeType, effectId]);
9687
10043
  }
9688
10044
  videoEffects.notifySelectedVideoEffectChanged = notifySelectedVideoEffectChanged;
9689
10045
  /**
@@ -9696,8 +10052,8 @@ var videoEffects;
9696
10052
  if (!isSupported()) {
9697
10053
  throw errorNotSupportedOnPlatform;
9698
10054
  }
9699
- registerHandler('video.effectParameterChange', createEffectParameterChangeCallback(callback, videoPerformanceMonitor), false);
9700
- sendMessageToParent('video.registerForVideoEffect');
10055
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterEffectParameterChangeHandler), 'video.effectParameterChange', createEffectParameterChangeCallback(callback, videoPerformanceMonitor), false);
10056
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoEffect), 'video.registerForVideoEffect');
9701
10057
  }
9702
10058
  videoEffects.registerForVideoEffect = registerForVideoEffect;
9703
10059
  /**
@@ -9706,7 +10062,7 @@ var videoEffects;
9706
10062
  * @beta
9707
10063
  */
9708
10064
  function notifyVideoFrameProcessed(timestamp) {
9709
- sendMessageToParent('video.videoFrameProcessed', [timestamp]);
10065
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifyVideoFrameProcessed), 'video.videoFrameProcessed', [timestamp]);
9710
10066
  }
9711
10067
  /**
9712
10068
  * Sending error notification to host
@@ -9714,7 +10070,7 @@ var videoEffects;
9714
10070
  * @param errorMessage - The error message that will be sent to the host
9715
10071
  */
9716
10072
  function notifyError(errorMessage) {
9717
- sendMessageToParent('video.notifyError', [errorMessage]);
10073
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifyError), 'video.notifyError', [errorMessage]);
9718
10074
  }
9719
10075
  /**
9720
10076
  * Checks if video capability is supported by the host.
@@ -9736,13 +10092,13 @@ var videoEffects;
9736
10092
  if (!isSupported() || !doesSupportMediaStream()) {
9737
10093
  throw errorNotSupportedOnPlatform;
9738
10094
  }
9739
- registerHandler('video.startVideoExtensibilityVideoStream', (mediaStreamInfo) => videoEffects_awaiter(this, void 0, void 0, function* () {
10095
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterStartVideoExtensibilityVideoStreamHandler), 'video.startVideoExtensibilityVideoStream', (mediaStreamInfo) => videoEffects_awaiter(this, void 0, void 0, function* () {
9740
10096
  // when a new streamId is ready:
9741
10097
  const { streamId } = mediaStreamInfo;
9742
10098
  const monitoredVideoFrameHandler = createMonitoredVideoFrameHandler(videoFrameHandler, videoPerformanceMonitor);
9743
10099
  yield processMediaStream(streamId, monitoredVideoFrameHandler, notifyError, videoPerformanceMonitor);
9744
10100
  }), false);
9745
- sendMessageToParent('video.mediaStream.registerForVideoFrame', [config]);
10101
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_MediaStream_RegisterForVideoFrame), 'video.mediaStream.registerForVideoFrame', [config]);
9746
10102
  }
9747
10103
  function createMonitoredVideoFrameHandler(videoFrameHandler, videoPerformanceMonitor) {
9748
10104
  return (videoFrameData) => videoEffects_awaiter(this, void 0, void 0, function* () {
@@ -9759,7 +10115,7 @@ var videoEffects;
9759
10115
  if (!isSupported() || !doesSupportSharedFrame()) {
9760
10116
  throw errorNotSupportedOnPlatform;
9761
10117
  }
9762
- registerHandler('video.newVideoFrame',
10118
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoBufferHandler), 'video.newVideoFrame',
9763
10119
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9764
10120
  (videoBufferData) => {
9765
10121
  if (videoBufferData) {
@@ -9771,7 +10127,7 @@ var videoEffects;
9771
10127
  }, notifyError);
9772
10128
  }
9773
10129
  }, false);
9774
- sendMessageToParent('video.registerForVideoFrame', [config]);
10130
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoFrame), 'video.registerForVideoFrame', [config]);
9775
10131
  }
9776
10132
  function normalizeVideoBufferData(videoBufferData) {
9777
10133
  if ('videoFrameBuffer' in videoBufferData) {
@@ -9805,6 +10161,11 @@ var videoEffects;
9805
10161
 
9806
10162
 
9807
10163
 
10164
+
10165
+ /**
10166
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
10167
+ */
10168
+ const searchTelemetryVersionNumber = ApiVersionNumber.V_2;
9808
10169
  /**
9809
10170
  * Allows your application to interact with the host M365 application's search box.
9810
10171
  * By integrating your application with the host's search box, users can search
@@ -9864,10 +10225,10 @@ var search;
9864
10225
  if (!isSupported()) {
9865
10226
  throw errorNotSupportedOnPlatform;
9866
10227
  }
9867
- registerHandler(onClosedHandlerName, onClosedHandler);
9868
- registerHandler(onExecutedHandlerName, onExecuteHandler);
10228
+ registerHandlerWithVersion(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnClosedHandler), onClosedHandlerName, onClosedHandler);
10229
+ registerHandlerWithVersion(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnExecutedHandler), onExecutedHandlerName, onExecuteHandler);
9869
10230
  if (onChangeHandler) {
9870
- registerHandler(onChangeHandlerName, onChangeHandler);
10231
+ registerHandlerWithVersion(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnChangeHandler), onChangeHandlerName, onChangeHandler);
9871
10232
  }
9872
10233
  }
9873
10234
  search.registerHandlers = registerHandlers;
@@ -9884,7 +10245,7 @@ var search;
9884
10245
  }
9885
10246
  // This should let the host know to stop making the app scope show up in the search experience
9886
10247
  // Can also be used to clean up handlers on the host if desired
9887
- sendMessageToParent('search.unregister');
10248
+ sendMessageToParentWithVersion(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_UnregisterHandlers), 'search.unregister');
9888
10249
  removeHandler(onChangeHandlerName);
9889
10250
  removeHandler(onClosedHandlerName);
9890
10251
  removeHandler(onExecutedHandlerName);
@@ -9913,7 +10274,7 @@ var search;
9913
10274
  if (!isSupported()) {
9914
10275
  throw new Error('Not supported');
9915
10276
  }
9916
- resolve(sendAndHandleStatusAndReason('search.closeSearch'));
10277
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_CloseSearch), 'search.closeSearch'));
9917
10278
  });
9918
10279
  }
9919
10280
  search.closeSearch = closeSearch;
@@ -9926,6 +10287,10 @@ var search;
9926
10287
 
9927
10288
 
9928
10289
 
10290
+
10291
+ /* eslint-disable @typescript-eslint/no-unused-vars */
10292
+ const sharingTelemetryVersionNumber_v1 = ApiVersionNumber.V_1;
10293
+ const sharingTelemetryVersionNumber_v2 = ApiVersionNumber.V_2;
9929
10294
  /**
9930
10295
  * Namespace to open a share dialog for web content.
9931
10296
  * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab)
@@ -9941,6 +10306,7 @@ var sharing;
9941
10306
  shareWebContent: 'sharing.shareWebContent',
9942
10307
  };
9943
10308
  function shareWebContent(shareWebContentRequest, callback) {
10309
+ const apiVersionTag = '';
9944
10310
  // validate the given input (synchronous check)
9945
10311
  try {
9946
10312
  validateNonEmptyContent(shareWebContentRequest);
@@ -10029,6 +10395,11 @@ var sharing;
10029
10395
 
10030
10396
 
10031
10397
 
10398
+
10399
+ /**
10400
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
10401
+ */
10402
+ const stageViewTelemetryVersionNumber = ApiVersionNumber.V_2;
10032
10403
  /**
10033
10404
  * Namespace to interact with the stage view specific part of the SDK.
10034
10405
  *
@@ -10072,7 +10443,7 @@ var stageView;
10072
10443
  if (!stageViewParams) {
10073
10444
  throw new Error('[stageView.open] Stage view params cannot be null');
10074
10445
  }
10075
- resolve(sendAndHandleSdkError('stageView.open', stageViewParams));
10446
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(stageViewTelemetryVersionNumber, ApiName.StageView_Open), 'stageView.open', stageViewParams));
10076
10447
  });
10077
10448
  }
10078
10449
  stageView.open = open;
@@ -10105,6 +10476,11 @@ var visualMedia_awaiter = (undefined && undefined.__awaiter) || function (thisAr
10105
10476
 
10106
10477
 
10107
10478
 
10479
+
10480
+ /**
10481
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
10482
+ */
10483
+ const visualMediaTelemetryVersionNumber = ApiVersionNumber.V_2;
10108
10484
  /**
10109
10485
  * @hidden
10110
10486
  * Interact with images. Allows the app developer ask the user to get images from their camera / camera roll / file system.
@@ -10158,7 +10534,7 @@ var visualMedia;
10158
10534
  throw errorNotSupportedOnPlatform;
10159
10535
  }
10160
10536
  const permissions = DevicePermission.Media;
10161
- return sendAndHandleSdkError('permissions.has', permissions);
10537
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_HasPermission), 'permissions.has', permissions);
10162
10538
  }
10163
10539
  visualMedia.hasPermission = hasPermission;
10164
10540
  /**
@@ -10176,7 +10552,7 @@ var visualMedia;
10176
10552
  throw errorNotSupportedOnPlatform;
10177
10553
  }
10178
10554
  const permissions = DevicePermission.Media;
10179
- return sendAndHandleSdkError('permissions.request', permissions);
10555
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_RequestPermission), 'permissions.request', permissions);
10180
10556
  }
10181
10557
  visualMedia.requestPermission = requestPermission;
10182
10558
  /**
@@ -10201,7 +10577,7 @@ var visualMedia;
10201
10577
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
10202
10578
  ensureSupported();
10203
10579
  ensureImageInputValid(cameraImageInputs);
10204
- const files = yield sendAndHandleSdkError('visualMedia.image.captureImages', cameraImageInputs);
10580
+ const files = yield sendAndHandleSdkErrorWithVersion(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_Image_CaptureImages), 'visualMedia.image.captureImages', cameraImageInputs);
10205
10581
  ensureResponseValid(cameraImageInputs.maxVisualMediaCount, files);
10206
10582
  return files;
10207
10583
  });
@@ -10221,7 +10597,7 @@ var visualMedia;
10221
10597
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
10222
10598
  ensureSupported();
10223
10599
  ensureImageInputValid(galleryImageInputs);
10224
- const files = yield sendAndHandleSdkError('visualMedia.image.retrieveImages', galleryImageInputs);
10600
+ const files = yield sendAndHandleSdkErrorWithVersion(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_Image_RetrieveImages), 'visualMedia.image.retrieveImages', galleryImageInputs);
10225
10601
  ensureResponseValid(galleryImageInputs.maxVisualMediaCount, files);
10226
10602
  return files;
10227
10603
  });
@@ -10996,6 +11372,11 @@ function navigateBack(onComplete) {
10996
11372
 
10997
11373
 
10998
11374
 
11375
+
11376
+ /**
11377
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
11378
+ */
11379
+ const settingsTelemetryVersionNumber = ApiVersionNumber.V_1;
10999
11380
  /**
11000
11381
  * @deprecated
11001
11382
  * As of 2.0.0, please use {@link pages.config} namespace instead.
@@ -11015,7 +11396,7 @@ var settings;
11015
11396
  * @param validityState - Indicates whether the save or remove button is enabled for the user.
11016
11397
  */
11017
11398
  function setValidityState(validityState) {
11018
- pages.config.setValidityState(validityState);
11399
+ configSetValidityStateHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_SetValidityState), validityState);
11019
11400
  }
11020
11401
  settings.setValidityState = setValidityState;
11021
11402
  /**
@@ -11028,7 +11409,7 @@ var settings;
11028
11409
  */
11029
11410
  function getSettings(callback) {
11030
11411
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
11031
- pages.getConfig().then((config) => {
11412
+ getConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_GetSettings)).then((config) => {
11032
11413
  callback(config);
11033
11414
  });
11034
11415
  }
@@ -11045,8 +11426,7 @@ var settings;
11045
11426
  function setSettings(instanceSettings, onComplete) {
11046
11427
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
11047
11428
  const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
11048
- pages.config
11049
- .setConfig(instanceSettings)
11429
+ configSetConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_SetSettings), instanceSettings)
11050
11430
  .then(() => {
11051
11431
  completionHandler(true);
11052
11432
  })
@@ -11067,7 +11447,7 @@ var settings;
11067
11447
  * @param handler - The handler to invoke when the user selects the save button.
11068
11448
  */
11069
11449
  function registerOnSaveHandler(handler) {
11070
- pages.config.registerOnSaveHandlerHelper(handler);
11450
+ pages.config.registerOnSaveHandlerHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_RegisterOnSaveHandler), handler);
11071
11451
  }
11072
11452
  settings.registerOnSaveHandler = registerOnSaveHandler;
11073
11453
  /**
@@ -11082,7 +11462,7 @@ var settings;
11082
11462
  * @param handler - The handler to invoke when the user selects the remove button.
11083
11463
  */
11084
11464
  function registerOnRemoveHandler(handler) {
11085
- pages.config.registerOnRemoveHandlerHelper(handler);
11465
+ pages.config.registerOnRemoveHandlerHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_RegisterOnRemoveHandler), handler);
11086
11466
  }
11087
11467
  settings.registerOnRemoveHandler = registerOnRemoveHandler;
11088
11468
  })(settings || (settings = {}));
@@ -12329,7 +12709,9 @@ var files;
12329
12709
  * @hidden
12330
12710
  * Hide from docs
12331
12711
  *
12332
- * Gets a list of cloud storage folders added to the channel
12712
+ * Gets a list of cloud storage folders added to the channel. This function will not timeout;
12713
+ * the callback will only return when the host responds with a list of folders or error.
12714
+ *
12333
12715
  * @param channelId - ID of the channel whose cloud storage folders should be retrieved
12334
12716
  * @param callback - Callback that will be triggered post folders load
12335
12717
  *
@@ -12947,12 +13329,16 @@ var notifications;
12947
13329
 
12948
13330
 
12949
13331
 
13332
+
12950
13333
  /**
12951
13334
  * @hidden
12952
13335
  *
12953
13336
  * @internal
12954
13337
  * Limited to Microsoft-internal use
13338
+ *
13339
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
12955
13340
  */
13341
+ const remoteCameraTelemetryVersionNumber = ApiVersionNumber.V_1;
12956
13342
  var remoteCamera;
12957
13343
  (function (remoteCamera) {
12958
13344
  /**
@@ -13031,7 +13417,7 @@ var remoteCamera;
13031
13417
  if (!isSupported()) {
13032
13418
  throw errorNotSupportedOnPlatform;
13033
13419
  }
13034
- sendMessageToParent('remoteCamera.getCapableParticipants', callback);
13420
+ sendMessageToParentWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_GetCapableParticipants), 'remoteCamera.getCapableParticipants', callback);
13035
13421
  }
13036
13422
  remoteCamera.getCapableParticipants = getCapableParticipants;
13037
13423
  /**
@@ -13058,7 +13444,7 @@ var remoteCamera;
13058
13444
  if (!isSupported()) {
13059
13445
  throw errorNotSupportedOnPlatform;
13060
13446
  }
13061
- sendMessageToParent('remoteCamera.requestControl', [participant], callback);
13447
+ sendMessageToParentWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RequestControl), 'remoteCamera.requestControl', [participant], callback);
13062
13448
  }
13063
13449
  remoteCamera.requestControl = requestControl;
13064
13450
  /**
@@ -13082,7 +13468,7 @@ var remoteCamera;
13082
13468
  if (!isSupported()) {
13083
13469
  throw errorNotSupportedOnPlatform;
13084
13470
  }
13085
- sendMessageToParent('remoteCamera.sendControlCommand', [ControlCommand], callback);
13471
+ sendMessageToParentWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_SendControlCommand), 'remoteCamera.sendControlCommand', [ControlCommand], callback);
13086
13472
  }
13087
13473
  remoteCamera.sendControlCommand = sendControlCommand;
13088
13474
  /**
@@ -13102,7 +13488,7 @@ var remoteCamera;
13102
13488
  if (!isSupported()) {
13103
13489
  throw errorNotSupportedOnPlatform;
13104
13490
  }
13105
- sendMessageToParent('remoteCamera.terminateSession', callback);
13491
+ sendMessageToParentWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_TerminateSession), 'remoteCamera.terminateSession', callback);
13106
13492
  }
13107
13493
  remoteCamera.terminateSession = terminateSession;
13108
13494
  /**
@@ -13123,7 +13509,7 @@ var remoteCamera;
13123
13509
  if (!isSupported()) {
13124
13510
  throw errorNotSupportedOnPlatform;
13125
13511
  }
13126
- registerHandler('remoteCamera.capableParticipantsChange', handler);
13512
+ registerHandlerWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnCapableParticipantsChangeHandler), 'remoteCamera.capableParticipantsChange', handler);
13127
13513
  }
13128
13514
  remoteCamera.registerOnCapableParticipantsChangeHandler = registerOnCapableParticipantsChangeHandler;
13129
13515
  /**
@@ -13144,7 +13530,7 @@ var remoteCamera;
13144
13530
  if (!isSupported()) {
13145
13531
  throw errorNotSupportedOnPlatform;
13146
13532
  }
13147
- registerHandler('remoteCamera.handlerError', handler);
13533
+ registerHandlerWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnErrorHandler), 'remoteCamera.handlerError', handler);
13148
13534
  }
13149
13535
  remoteCamera.registerOnErrorHandler = registerOnErrorHandler;
13150
13536
  /**
@@ -13165,7 +13551,7 @@ var remoteCamera;
13165
13551
  if (!isSupported()) {
13166
13552
  throw errorNotSupportedOnPlatform;
13167
13553
  }
13168
- registerHandler('remoteCamera.deviceStateChange', handler);
13554
+ registerHandlerWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnDeviceStateChangeHandler), 'remoteCamera.deviceStateChange', handler);
13169
13555
  }
13170
13556
  remoteCamera.registerOnDeviceStateChangeHandler = registerOnDeviceStateChangeHandler;
13171
13557
  /**
@@ -13186,7 +13572,7 @@ var remoteCamera;
13186
13572
  if (!isSupported()) {
13187
13573
  throw errorNotSupportedOnPlatform;
13188
13574
  }
13189
- registerHandler('remoteCamera.sessionStatusChange', handler);
13575
+ registerHandlerWithVersion(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnSessionStatusChangeHandler), 'remoteCamera.sessionStatusChange', handler);
13190
13576
  }
13191
13577
  remoteCamera.registerOnSessionStatusChangeHandler = registerOnSessionStatusChangeHandler;
13192
13578
  /**
@@ -13281,13 +13667,17 @@ var appEntity;
13281
13667
 
13282
13668
 
13283
13669
 
13670
+
13284
13671
  /**
13285
13672
  * @hidden
13286
13673
  * Namespace to interact with the `teams` specific part of the SDK.
13287
13674
  *
13288
13675
  * @internal
13289
13676
  * Limited to Microsoft-internal use
13677
+ *
13678
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
13290
13679
  */
13680
+ const teamsTelemetryVersionNumber = ApiVersionNumber.V_1;
13291
13681
  var teams;
13292
13682
  (function (teams) {
13293
13683
  let ChannelType;
@@ -13316,7 +13706,7 @@ var teams;
13316
13706
  if (!callback) {
13317
13707
  throw new Error('[teams.getTeamChannels] Callback cannot be null');
13318
13708
  }
13319
- sendMessageToParent('teams.getTeamChannels', [groupId], callback);
13709
+ sendMessageToParentWithVersion(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_GetTeamChannels), 'teams.getTeamChannels', [groupId], callback);
13320
13710
  }
13321
13711
  teams.getTeamChannels = getTeamChannels;
13322
13712
  /**
@@ -13341,7 +13731,7 @@ var teams;
13341
13731
  if (!callback) {
13342
13732
  throw new Error('[teams.refreshSiteUrl] Callback cannot be null');
13343
13733
  }
13344
- sendMessageToParent('teams.refreshSiteUrl', [threadId], callback);
13734
+ sendMessageToParentWithVersion(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_RefreshSiteUrl), 'teams.refreshSiteUrl', [threadId], callback);
13345
13735
  }
13346
13736
  teams.refreshSiteUrl = refreshSiteUrl;
13347
13737
  /**
@@ -13398,7 +13788,9 @@ var teams;
13398
13788
  throw new Error(JSON.stringify(oldPlatformError));
13399
13789
  }
13400
13790
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
13401
- resolve(sendAndUnwrap('getUserJoinedTeams', teamInstanceParameters));
13791
+ resolve(sendAndUnwrapWithVersion(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_FullTrust_JoinedTeams_GetUserJoinedTeams), 'getUserJoinedTeams',
13792
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
13793
+ teamInstanceParameters));
13402
13794
  });
13403
13795
  }
13404
13796
  joinedTeams.getUserJoinedTeams = getUserJoinedTeams;
@@ -13440,7 +13832,7 @@ var teams;
13440
13832
  if (!isSupported()) {
13441
13833
  throw errorNotSupportedOnPlatform;
13442
13834
  }
13443
- resolve(sendAndUnwrap('getConfigSetting', key));
13835
+ resolve(sendAndUnwrapWithVersion(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_FullTrust_GetConfigSetting), 'getConfigSetting', key));
13444
13836
  });
13445
13837
  }
13446
13838
  fullTrust.getConfigSetting = getConfigSetting;
@@ -13485,6 +13877,7 @@ var videoEffectsEx_awaiter = (undefined && undefined.__awaiter) || function (thi
13485
13877
 
13486
13878
 
13487
13879
 
13880
+
13488
13881
  /**
13489
13882
  * @hidden
13490
13883
  * Extended video API
@@ -13492,13 +13885,15 @@ var videoEffectsEx_awaiter = (undefined && undefined.__awaiter) || function (thi
13492
13885
  *
13493
13886
  * @internal
13494
13887
  * Limited to Microsoft-internal use
13888
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
13495
13889
  */
13890
+ const videoEffectsExTelemetryVersionNumber = ApiVersionNumber.V_2;
13496
13891
  var videoEffectsEx;
13497
13892
  (function (videoEffectsEx) {
13498
13893
  videoEffectsEx.frameProcessingTimeoutInMs = 2000;
13499
13894
  const videoPerformanceMonitor = inServerSideRenderingEnvironment()
13500
13895
  ? undefined
13501
- : new VideoPerformanceMonitor(sendMessageToParent);
13896
+ : new VideoPerformanceMonitor(sendMessageToParentWithVersion);
13502
13897
  /**
13503
13898
  * @hidden
13504
13899
  * Error level when notifying errors to the host, the host will decide what to do acording to the error level.
@@ -13533,9 +13928,9 @@ var videoEffectsEx;
13533
13928
  throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');
13534
13929
  }
13535
13930
  if (internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel)) {
13536
- registerHandler('video.setFrameProcessTimeLimit', (timeLimit) => videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimit), false);
13931
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterSetFrameProcessTimeLimitHandler), 'video.setFrameProcessTimeLimit', (timeLimit) => videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimit), false);
13537
13932
  if ((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream) {
13538
- registerHandler('video.startVideoExtensibilityVideoStream', (mediaStreamInfo) => videoEffectsEx_awaiter(this, void 0, void 0, function* () {
13933
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterStartVideoExtensibilityVideoStreamHandler), 'video.startVideoExtensibilityVideoStream', (mediaStreamInfo) => videoEffectsEx_awaiter(this, void 0, void 0, function* () {
13539
13934
  const { streamId, metadataInTexture } = mediaStreamInfo;
13540
13935
  const handler = videoPerformanceMonitor
13541
13936
  ? createMonitoredVideoFrameHandler(parameters.videoFrameHandler, videoPerformanceMonitor)
@@ -13544,10 +13939,10 @@ var videoEffectsEx;
13544
13939
  ? yield processMediaStreamWithMetadata(streamId, handler, notifyError, videoPerformanceMonitor)
13545
13940
  : yield processMediaStream(streamId, handler, notifyError, videoPerformanceMonitor);
13546
13941
  }), false);
13547
- sendMessageToParent('video.mediaStream.registerForVideoFrame', [parameters.config]);
13942
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_MediaStream_RegisterForVideoFrame), 'video.mediaStream.registerForVideoFrame', [parameters.config]);
13548
13943
  }
13549
13944
  else if ((_b = runtime_runtime.supports.video) === null || _b === void 0 ? void 0 : _b.sharedFrame) {
13550
- registerHandler('video.newVideoFrame', (videoBufferData) => {
13945
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterNewVideoFrameHandler), 'video.newVideoFrame', (videoBufferData) => {
13551
13946
  if (videoBufferData) {
13552
13947
  videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);
13553
13948
  const clearProcessingTimeout = createFrameProcessingTimeout();
@@ -13559,7 +13954,7 @@ var videoEffectsEx;
13559
13954
  }, notifyError);
13560
13955
  }
13561
13956
  }, false);
13562
- sendMessageToParent('video.registerForVideoFrame', [parameters.config]);
13957
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterForVideoFrame), 'video.registerForVideoFrame', [parameters.config]);
13563
13958
  }
13564
13959
  else {
13565
13960
  // should not happen if isSupported() is true
@@ -13612,7 +14007,7 @@ var videoEffectsEx;
13612
14007
  if (!isSupported()) {
13613
14008
  throw errorNotSupportedOnPlatform;
13614
14009
  }
13615
- sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId, effectParam]);
14010
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifySelectedVideoEffectChanged), 'video.videoEffectChanged', [effectChangeType, effectId, effectParam]);
13616
14011
  }
13617
14012
  videoEffectsEx.notifySelectedVideoEffectChanged = notifySelectedVideoEffectChanged;
13618
14013
  /**
@@ -13629,8 +14024,8 @@ var videoEffectsEx;
13629
14024
  if (!isSupported()) {
13630
14025
  throw errorNotSupportedOnPlatform;
13631
14026
  }
13632
- registerHandler('video.effectParameterChange', createEffectParameterChangeCallback(callback, videoPerformanceMonitor), false);
13633
- sendMessageToParent('video.registerForVideoEffect');
14027
+ registerHandlerWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterEffectParameterChangeHandler), 'video.effectParameterChange', createEffectParameterChangeCallback(callback, videoPerformanceMonitor), false);
14028
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterForVideoEffect), 'video.registerForVideoEffect');
13634
14029
  }
13635
14030
  videoEffectsEx.registerForVideoEffect = registerForVideoEffect;
13636
14031
  /**
@@ -13646,7 +14041,7 @@ var videoEffectsEx;
13646
14041
  if (!videoEffects.isSupported()) {
13647
14042
  throw errorNotSupportedOnPlatform;
13648
14043
  }
13649
- sendMessageToParent('video.personalizedEffectsChanged', [effects]);
14044
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_UpdatePersonalizedEffects), 'video.personalizedEffectsChanged', [effects]);
13650
14045
  }
13651
14046
  videoEffectsEx.updatePersonalizedEffects = updatePersonalizedEffects;
13652
14047
  /**
@@ -13677,7 +14072,7 @@ var videoEffectsEx;
13677
14072
  * Limited to Microsoft-internal use
13678
14073
  */
13679
14074
  function notifyVideoFrameProcessed(timestamp) {
13680
- sendMessageToParent('video.videoFrameProcessed', [timestamp]);
14075
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifyVideoFrameProcessed), 'video.videoFrameProcessed', [timestamp]);
13681
14076
  }
13682
14077
  /**
13683
14078
  * @hidden
@@ -13690,7 +14085,7 @@ var videoEffectsEx;
13690
14085
  * Limited to Microsoft-internal use
13691
14086
  */
13692
14087
  function notifyError(errorMessage, errorLevel = ErrorLevel.Warn) {
13693
- sendMessageToParent('video.notifyError', [errorMessage, errorLevel]);
14088
+ sendMessageToParentWithVersion(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifyError), 'video.notifyError', [errorMessage, errorLevel]);
13694
14089
  }
13695
14090
  /**
13696
14091
  * @hidden