@microsoft/teams-js 2.20.0-beta.4 → 2.20.1-beta.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/MicrosoftTeams.js
CHANGED
@@ -969,14 +969,12 @@ function isFollowingApiVersionTagFormat(apiVersionTag) {
|
|
969
969
|
}
|
970
970
|
/**
|
971
971
|
* Use enum to set or update API version number
|
972
|
-
*
|
973
|
-
* but haven't been implemented yet.
|
972
|
+
* v3 will be used for next beta version of APIs if they have used v2
|
974
973
|
* @internal
|
975
974
|
* Limited to Microsoft-internal use
|
976
975
|
*/
|
977
976
|
var ApiVersionNumber;
|
978
977
|
(function (ApiVersionNumber) {
|
979
|
-
ApiVersionNumber["V_0"] = "v0";
|
980
978
|
ApiVersionNumber["V_1"] = "v1";
|
981
979
|
ApiVersionNumber["V_2"] = "v2";
|
982
980
|
ApiVersionNumber["V_3"] = "v3";
|
@@ -1001,6 +999,15 @@ var ApiName;
|
|
1001
999
|
ApiName["AppWindow_ChildAppWindow_PostMessage"] = "appWindow.childAppWindow.postMessage";
|
1002
1000
|
ApiName["AppWindow_ParentAppWindow_AddEventListener"] = "appWindow.parentAppWindow.addEventListener";
|
1003
1001
|
ApiName["AppWindow_ParentAppWindow_PostMessage"] = "appWindow.parentAppWindow.postMessage";
|
1002
|
+
ApiName["Authentication_AuthenticationWindow_RegisterInitializeHandler"] = "authentication.authenticationWindow.registerInitializeHandler";
|
1003
|
+
ApiName["Authentication_AuthenticationWindow_RegisterNavigateCrossDomainHandler"] = "authentication.authenticationWindow.registerNavigateCrossDomainHandler";
|
1004
|
+
ApiName["Authentication_Authenticate"] = "authentication.authenticate";
|
1005
|
+
ApiName["Authentication_GetAuthToken"] = "authentication.getAuthToken";
|
1006
|
+
ApiName["Authentication_GetUser"] = "authentication.getUser";
|
1007
|
+
ApiName["Authentication_NotifyFailure"] = "authentication.notifyFailure";
|
1008
|
+
ApiName["Authentication_NotifySuccess"] = "authentication.notifySuccess";
|
1009
|
+
ApiName["Authentication_RegisterAuthenticateFailureHandler"] = "authentication.registerAuthenticateFailureHandler";
|
1010
|
+
ApiName["Authentication_RegisterAuthenticateSuccessHandler"] = "authentication.registerAuthenticateSuccessHandler";
|
1004
1011
|
ApiName["BarCode_HasPermission"] = "barCode.hasPermission";
|
1005
1012
|
ApiName["BarCode_RequestPermission"] = "barCode.requestPermission";
|
1006
1013
|
ApiName["BarCode_ScanBarCode"] = "barCode.scanBarCode";
|
@@ -1018,12 +1025,21 @@ var ApiName;
|
|
1018
1025
|
ApiName["Conversations_RegisterStartConversationHandler"] = "conversations.registerStartConversationHandler";
|
1019
1026
|
ApiName["Dialog_AdaptiveCard_Bot_Open"] = "dialog.adaptiveCard.bot.open";
|
1020
1027
|
ApiName["Dialog_AdaptiveCard_Open"] = "dialog.adaptiveCard.open";
|
1028
|
+
ApiName["Dialog_RegisterMessageForChildHandler"] = "dialog.registerMessageForChildHandler";
|
1021
1029
|
ApiName["Dialog_Update_Resize"] = "dialog.update.resize";
|
1022
1030
|
ApiName["Dialog_Url_Bot_Open"] = "dialog.url.bot.open";
|
1031
|
+
ApiName["Dialog_Url_Bot_RegisterMessageForParentHandler"] = "dialog.url.bot.registerMessageForParentHandler";
|
1023
1032
|
ApiName["Dialog_Url_Open"] = "dialog.url.open";
|
1033
|
+
ApiName["Dialog_Url_RegisterMessageForParentHandler"] = "dialog.url.registerMessageForParentHandler";
|
1024
1034
|
ApiName["Dialog_Url_Submit"] = "dialog.url.submit";
|
1035
|
+
ApiName["Dialog_Url_ParentCommunication_RegisterMessageForChildHandler"] = "dialog.url.parentCommunication.registerMessageForChildHandler";
|
1025
1036
|
ApiName["Dialog_Url_ParentCommunication_SendMessageToParentFromDialog"] = "dialog.url.parentCommunication.sendMessageToParentFromDialog";
|
1026
1037
|
ApiName["Dialog_Url_ParentCommunication_SendMessageToDialog"] = "dialog.url.parentCommunication.sendMessageToDialog";
|
1038
|
+
ApiName["ExternalAppAuthentication_AuthenticateAndResendRequest"] = "externalAppAuthentication.authenticateAndResendRequest";
|
1039
|
+
ApiName["ExternalAppAuthentication_AuthenticateWithSSO"] = "externalAppAuthentication.authenticateWithSSO";
|
1040
|
+
ApiName["ExternalAppAuthentication_AuthenticateWithSSOAndResendRequest"] = "externalAppAuthentication.authenticateWithSSOAndResendRequest";
|
1041
|
+
ApiName["ExternalAppCardActions_ProcessActionOpenUrl"] = "externalAppCardActions.processActionOpenUrl";
|
1042
|
+
ApiName["ExternalAppCardActions_ProcessActionSubmit"] = "externalAppCardActions.processActionSubmit";
|
1027
1043
|
ApiName["Files_AddCloudStorageFolder"] = "files.addCloudStorageFolder";
|
1028
1044
|
ApiName["Files_AddCloudStorageProvider"] = "files.addCloudStorageProvider";
|
1029
1045
|
ApiName["Files_AddCloudStorageProviderFile"] = "files.addCloudStorageProviderFile";
|
@@ -1047,6 +1063,7 @@ var ApiName;
|
|
1047
1063
|
ApiName["GeoLocation_Map_ChooseLocation"] = "geoLocation.map.chooseLocation";
|
1048
1064
|
ApiName["GeoLocation_RequestPermission"] = "geoLocation.requestPermission";
|
1049
1065
|
ApiName["GeoLocation_ShowLocation"] = "geoLocation.showLocation";
|
1066
|
+
ApiName["HandleBeforeUnload"] = "handleBeforeUnload";
|
1050
1067
|
ApiName["Interactive_GetClientInfo"] = "interactive.getClientInfo";
|
1051
1068
|
ApiName["Interactive_GetClientRoles"] = "interactive.getClientRoles";
|
1052
1069
|
ApiName["Interactive_GetFluidContainerId"] = "interactive.getFluidContainerId";
|
@@ -1069,6 +1086,7 @@ var ApiName;
|
|
1069
1086
|
ApiName["Media_Controller"] = "media.controller";
|
1070
1087
|
ApiName["Media_GetMedia"] = "media.getMedia";
|
1071
1088
|
ApiName["Media_HasPermission"] = "media.hasPermission";
|
1089
|
+
ApiName["Media_RegisterGetMediaRequestHandler"] = "media.registerGetMediaRequestHandler";
|
1072
1090
|
ApiName["Media_RequestPermission"] = "media.requestPermission";
|
1073
1091
|
ApiName["Media_ScanBarCode"] = "media.scanBarCode";
|
1074
1092
|
ApiName["Media_SelectMedia"] = "media.selectMedia";
|
@@ -1118,13 +1136,17 @@ var ApiName;
|
|
1118
1136
|
ApiName["Pages_AppButton_OnHoverLeave"] = "pages.appButton.onHoverLeave";
|
1119
1137
|
ApiName["Pages_BackStack_NavigateBack"] = "pages.backStack.navigateBack";
|
1120
1138
|
ApiName["Pages_BackStack_RegisterBackButtonHandler"] = "pages.backStack.registerBackButtonHandler";
|
1139
|
+
ApiName["Pages_BackStack_RegisterBackButtonPressHandler"] = "pages.backStack.registerBackButtonPressHandler";
|
1121
1140
|
ApiName["Pages_Config_RegisterChangeConfigHandler"] = "pages.config.registerChangeConfigHandler";
|
1122
1141
|
ApiName["Pages_Config_RegisterOnRemoveHandler"] = "pages.config.registerOnRemoveHandler";
|
1123
1142
|
ApiName["Pages_Config_RegisterOnSaveHandler"] = "pages.config.registerOnSaveHandler";
|
1143
|
+
ApiName["Pages_Config_RegisterSettingsRemoveHandler"] = "pages.config.registerSettingsRemoveHandler";
|
1144
|
+
ApiName["Pages_Config_RegisterSettingsSaveHandler"] = "pages.config.registerSettingsSaveHandler";
|
1124
1145
|
ApiName["Pages_Config_SetConfig"] = "pages.config.setConfig";
|
1125
1146
|
ApiName["Pages_Config_SetValidityState"] = "pages.config.setValidityState";
|
1126
1147
|
ApiName["Pages_CurrentApp_NavigateTo"] = "pages.currentApp.navigateTo";
|
1127
1148
|
ApiName["Pages_CurrentApp_NavigateToDefaultPage"] = "pages.currentApp.navigateToDefaultPage";
|
1149
|
+
ApiName["Pages_InitializeWithFrameContext"] = "pages.initializeWithFrameContext";
|
1128
1150
|
ApiName["Pages_FullTrust_EnterFullscreen"] = "pages.fullTrust.enterFullscreen";
|
1129
1151
|
ApiName["Pages_FullTrust_ExitFullscreen"] = "pages.fullTrust.exitFullscreen";
|
1130
1152
|
ApiName["Pages_GetConfig"] = "pages.getConfig.";
|
@@ -1154,10 +1176,12 @@ var ApiName;
|
|
1154
1176
|
ApiName["PublicAPIs_GetMruTabInstances"] = "getMruTabInstances";
|
1155
1177
|
ApiName["PublicAPIs_GetTabInstances"] = "getTabInstances";
|
1156
1178
|
ApiName["PublicAPIs_Initialize"] = "initialize";
|
1179
|
+
ApiName["PublicAPIs_InitializeWithFrameContext"] = "initializeWithFrameContext";
|
1157
1180
|
ApiName["PublicAPIs_RegisterAppButtonClickHandler"] = "registerAppButtonClickHandler";
|
1158
1181
|
ApiName["PublicAPIs_RegisterAppButtonHoverEnterHandler"] = "registerAppButtonHoverEnterHandler";
|
1159
1182
|
ApiName["PublicAPIs_RegisterAppButtonHoverLeaveHandler"] = "registerAppButtonHoverLeaveHandler";
|
1160
1183
|
ApiName["PublicAPIs_RegisterBackButtonHandler"] = "registerBackButtonHandler";
|
1184
|
+
ApiName["PublicAPIs_RegisterBeforeUnloadHandler"] = "registerBeforeUnloadHandler";
|
1161
1185
|
ApiName["PublicAPIs_RegisterChangeSettingsHandler"] = "registerChangeSettingsHandler";
|
1162
1186
|
ApiName["PublicAPIs_RegisterFocusEnterHandler"] = "registerFocusEnterHandler";
|
1163
1187
|
ApiName["PublicAPIs_RegisterFullScreenHandler"] = "registerFullScreenHandler";
|
@@ -1165,9 +1189,9 @@ var ApiName;
|
|
1165
1189
|
ApiName["PublicAPIs_RegisterOnThemeChangeHandlerHelper"] = "registerOnThemeChangeHandlerHelper";
|
1166
1190
|
ApiName["PublicAPIs_SetFrameContext"] = "setFrameContext";
|
1167
1191
|
ApiName["PublicAPIs_ShareDeepLink"] = "shareDeepLink";
|
1192
|
+
ApiName["RegisterBeforeSuspendOrTerminateHandler"] = "registerBeforeSuspendOrTerminateHandler";
|
1168
1193
|
ApiName["RegisterHandler"] = "registerHandler";
|
1169
|
-
ApiName["
|
1170
|
-
ApiName["RegisterLoadHandler"] = "registerLoadHandler";
|
1194
|
+
ApiName["RegisterOnResumeHandler"] = "registerOnResumeHandler";
|
1171
1195
|
ApiName["RegisterOnThemeChangeHandler"] = "registerOnThemeChangeHandler";
|
1172
1196
|
ApiName["RemoteCamera_GetCapableParticipants"] = "remoteCamera.getCapableParticipants";
|
1173
1197
|
ApiName["RemoteCamera_RegisterOnCapableParticipantsChangeHandler"] = "remoteCamera.registerOnCapableParticipantsChangeHandler";
|
@@ -1192,6 +1216,7 @@ var ApiName;
|
|
1192
1216
|
ApiName["Settings_Save_Success"] = "settings.save.success";
|
1193
1217
|
ApiName["Settings_SetSettings"] = "settings.setSettings";
|
1194
1218
|
ApiName["Settings_SetValidityState"] = "settings.setValidityState";
|
1219
|
+
ApiName["Sharing_ShareWebContent"] = "sharing.shareWebContent";
|
1195
1220
|
ApiName["StageView_Open"] = "stageView.open";
|
1196
1221
|
ApiName["Tasks_StartTask"] = "tasks.startTask";
|
1197
1222
|
ApiName["Tasks_SubmitTask"] = "tasks.submitTask";
|
@@ -1200,6 +1225,9 @@ var ApiName;
|
|
1200
1225
|
ApiName["Teams_FullTrust_JoinedTeams_GetUserJoinedTeams"] = "teams.fullTrust.joinedTeams.getUserJoinedTeams";
|
1201
1226
|
ApiName["Teams_GetTeamChannels"] = "teams.getTeamChannels";
|
1202
1227
|
ApiName["Teams_RefreshSiteUrl"] = "teams.refreshSiteUrl";
|
1228
|
+
ApiName["TeamsAPIs_RegisterBeforeUnloadHandler"] = "teamsAPIs_registerBeforeUnloadHandler";
|
1229
|
+
ApiName["TeamsAPIs_RegisterOnLoadHandler"] = "teamsAPIs_registerOnLoadHandler";
|
1230
|
+
ApiName["ThirdPartyCloudStorage_GetDragAndDropFiles"] = "thirdPartyCloudStorage.getDragAndDropFiles";
|
1203
1231
|
ApiName["VideoEffects_MediaStream_RegisterForVideoFrame"] = "videoEffects.mediaStream.registerForVideoFrame";
|
1204
1232
|
ApiName["VideoEffects_NotifySelectedVideoEffectChanged"] = "videoEffects.notifySelectedVideoEffectChanged";
|
1205
1233
|
ApiName["VideoEffects_NotifyError"] = "videoEffects.notifyError";
|
@@ -1520,7 +1548,7 @@ var ActionObjectType;
|
|
1520
1548
|
})(ActionObjectType || (ActionObjectType = {}));
|
1521
1549
|
/**
|
1522
1550
|
* These correspond with field names in the MSGraph.
|
1523
|
-
* See
|
1551
|
+
* See [commonly accessed resources](https://learn.microsoft.com/graph/api/resources/onedrive?view=graph-rest-1.0#commonly-accessed-resources).
|
1524
1552
|
* @beta
|
1525
1553
|
*/
|
1526
1554
|
var SecondaryM365ContentIdName;
|
@@ -2213,7 +2241,7 @@ function isRuntimeInitialized(runtime) {
|
|
2213
2241
|
throw new Error(errorRuntimeNotSupported);
|
2214
2242
|
}
|
2215
2243
|
}
|
2216
|
-
let
|
2244
|
+
let runtime = _uninitializedRuntime;
|
2217
2245
|
const versionAndPlatformAgnosticTeamsRuntimeConfig = {
|
2218
2246
|
apiVersion: 4,
|
2219
2247
|
hostVersionsInfo: teamsMinAdaptiveCardVersion,
|
@@ -2487,10 +2515,10 @@ function applyRuntimeConfig(runtimeConfig) {
|
|
2487
2515
|
applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);
|
2488
2516
|
const ffRuntimeConfig = fastForwardRuntime(runtimeConfig);
|
2489
2517
|
applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);
|
2490
|
-
|
2518
|
+
runtime = utils_deepFreeze(ffRuntimeConfig);
|
2491
2519
|
}
|
2492
2520
|
function setUnitializedRuntime() {
|
2493
|
-
|
2521
|
+
runtime = deepFreeze(_uninitializedRuntime);
|
2494
2522
|
}
|
2495
2523
|
/**
|
2496
2524
|
* @hidden
|
@@ -2520,7 +2548,7 @@ const _minRuntimeConfigToUninitialize = {
|
|
2520
2548
|
* @hidden
|
2521
2549
|
* Package version.
|
2522
2550
|
*/
|
2523
|
-
const version = "2.20.
|
2551
|
+
const version = "2.20.1-beta.0";
|
2524
2552
|
|
2525
2553
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2526
2554
|
|
@@ -2559,7 +2587,7 @@ function ensureInitializeCalled() {
|
|
2559
2587
|
* @internal
|
2560
2588
|
* Limited to Microsoft-internal use
|
2561
2589
|
*/
|
2562
|
-
function
|
2590
|
+
function ensureInitialized(runtime, ...expectedFrameContexts) {
|
2563
2591
|
// This global var can potentially be removed in the future if we use the initialization status of the runtime object as our source of truth
|
2564
2592
|
if (!GlobalVars.initializeCompleted) {
|
2565
2593
|
ensureInitializedLogger('%s. initializeCalled: %s', errorLibraryNotInitialized, GlobalVars.initializeCalled.toString());
|
@@ -2794,11 +2822,17 @@ function validateOrigin(messageOrigin) {
|
|
2794
2822
|
|
2795
2823
|
|
2796
2824
|
|
2825
|
+
|
2797
2826
|
/**
|
2798
2827
|
* Namespace to interact with the authentication-specific part of the SDK.
|
2799
2828
|
*
|
2800
2829
|
* This object is used for starting or completing authentication flows.
|
2801
2830
|
*/
|
2831
|
+
/**
|
2832
|
+
* Exceptional APIs telemetry versioning file: v1 and v2 APIs are mixed together in this file
|
2833
|
+
*/
|
2834
|
+
const authenticationTelemetryVersionNumber_v1 = ApiVersionNumber.V_1;
|
2835
|
+
const authenticationTelemetryVersionNumber_v2 = ApiVersionNumber.V_2;
|
2802
2836
|
var authentication;
|
2803
2837
|
(function (authentication) {
|
2804
2838
|
let authHandlers;
|
@@ -2809,8 +2843,8 @@ var authentication;
|
|
2809
2843
|
* Limited to Microsoft-internal use; automatically called when library is initialized
|
2810
2844
|
*/
|
2811
2845
|
function initialize() {
|
2812
|
-
registerHandler('authentication.authenticate.success', handleSuccess, false);
|
2813
|
-
registerHandler('authentication.authenticate.failure', handleFailure, false);
|
2846
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_RegisterAuthenticateSuccessHandler), 'authentication.authenticate.success', handleSuccess, false);
|
2847
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_RegisterAuthenticateFailureHandler), 'authentication.authenticate.failure', handleFailure, false);
|
2814
2848
|
}
|
2815
2849
|
authentication.initialize = initialize;
|
2816
2850
|
let authParams;
|
@@ -2834,8 +2868,11 @@ var authentication;
|
|
2834
2868
|
if (!authenticateParams) {
|
2835
2869
|
throw new Error('No parameters are provided for authentication');
|
2836
2870
|
}
|
2837
|
-
|
2838
|
-
|
2871
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
2872
|
+
const apiVersionTag = authenticateParams.successCallback || authenticateParams.failureCallback
|
2873
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_Authenticate)
|
2874
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_Authenticate);
|
2875
|
+
return authenticateHelper(apiVersionTag, authenticateParams)
|
2839
2876
|
.then((value) => {
|
2840
2877
|
try {
|
2841
2878
|
if (authenticateParams && authenticateParams.successCallback) {
|
@@ -2866,7 +2903,7 @@ var authentication;
|
|
2866
2903
|
});
|
2867
2904
|
}
|
2868
2905
|
authentication.authenticate = authenticate;
|
2869
|
-
function authenticateHelper(authenticateParameters) {
|
2906
|
+
function authenticateHelper(apiVersionTag, authenticateParameters) {
|
2870
2907
|
return new Promise((resolve, reject) => {
|
2871
2908
|
if (GlobalVars.hostClientType === HostClientType.desktop ||
|
2872
2909
|
GlobalVars.hostClientType === HostClientType.android ||
|
@@ -2883,7 +2920,7 @@ var authentication;
|
|
2883
2920
|
const link = document.createElement('a');
|
2884
2921
|
link.href = authenticateParameters.url;
|
2885
2922
|
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
2886
|
-
resolve(sendMessageToParentAsync('authentication.authenticate', [
|
2923
|
+
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.authenticate', [
|
2887
2924
|
link.href,
|
2888
2925
|
authenticateParameters.width,
|
2889
2926
|
authenticateParameters.height,
|
@@ -2909,7 +2946,10 @@ var authentication;
|
|
2909
2946
|
}
|
2910
2947
|
function getAuthToken(authTokenRequest) {
|
2911
2948
|
ensureInitializeCalled();
|
2912
|
-
|
2949
|
+
const apiVersionTag = authTokenRequest && (authTokenRequest.successCallback || authTokenRequest.failureCallback)
|
2950
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_GetAuthToken)
|
2951
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_GetAuthToken);
|
2952
|
+
return getAuthTokenHelper(apiVersionTag, authTokenRequest)
|
2913
2953
|
.then((value) => {
|
2914
2954
|
if (authTokenRequest && authTokenRequest.successCallback) {
|
2915
2955
|
authTokenRequest.successCallback(value);
|
@@ -2926,9 +2966,9 @@ var authentication;
|
|
2926
2966
|
});
|
2927
2967
|
}
|
2928
2968
|
authentication.getAuthToken = getAuthToken;
|
2929
|
-
function getAuthTokenHelper(authTokenRequest) {
|
2969
|
+
function getAuthTokenHelper(apiVersionTag, authTokenRequest) {
|
2930
2970
|
return new Promise((resolve) => {
|
2931
|
-
resolve(sendMessageToParentAsync('authentication.getAuthToken', [
|
2971
|
+
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getAuthToken', [
|
2932
2972
|
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.resources,
|
2933
2973
|
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.claims,
|
2934
2974
|
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.silent,
|
@@ -2945,7 +2985,10 @@ var authentication;
|
|
2945
2985
|
}
|
2946
2986
|
function getUser(userRequest) {
|
2947
2987
|
ensureInitializeCalled();
|
2948
|
-
|
2988
|
+
const apiVersionTag = userRequest && (userRequest.successCallback || userRequest.failureCallback)
|
2989
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_GetUser)
|
2990
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_GetUser);
|
2991
|
+
return getUserHelper(apiVersionTag)
|
2949
2992
|
.then((value) => {
|
2950
2993
|
if (userRequest && userRequest.successCallback) {
|
2951
2994
|
userRequest.successCallback(value);
|
@@ -2962,9 +3005,9 @@ var authentication;
|
|
2962
3005
|
});
|
2963
3006
|
}
|
2964
3007
|
authentication.getUser = getUser;
|
2965
|
-
function getUserHelper() {
|
3008
|
+
function getUserHelper(apiVersionTag) {
|
2966
3009
|
return new Promise((resolve) => {
|
2967
|
-
resolve(sendMessageToParentAsync('authentication.getUser'));
|
3010
|
+
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getUser'));
|
2968
3011
|
}).then(([success, result]) => {
|
2969
3012
|
if (success) {
|
2970
3013
|
return result;
|
@@ -3059,14 +3102,14 @@ var authentication;
|
|
3059
3102
|
}
|
3060
3103
|
}, 100);
|
3061
3104
|
// Set up an initialize-message handler that gives the authentication window its frame context
|
3062
|
-
registerHandler('initialize', () => {
|
3105
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_AuthenticationWindow_RegisterInitializeHandler), 'initialize', () => {
|
3063
3106
|
return [FrameContexts.authentication, GlobalVars.hostClientType];
|
3064
3107
|
});
|
3065
3108
|
// Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts
|
3066
3109
|
// in the authentication window. We could at some point choose to implement this method via a call to
|
3067
3110
|
// authenticationWindow.location.href = url; however, we would first need to figure out how to
|
3068
3111
|
// validate the URL against the tab's list of valid domains.
|
3069
|
-
registerHandler('navigateCrossDomain', () => {
|
3112
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_AuthenticationWindow_RegisterNavigateCrossDomainHandler), 'navigateCrossDomain', () => {
|
3070
3113
|
return false;
|
3071
3114
|
});
|
3072
3115
|
}
|
@@ -3076,8 +3119,11 @@ var authentication;
|
|
3076
3119
|
* Please use the {@link authentication.notifySuccess authentication.notifySuccess(result?: string): void} instead.
|
3077
3120
|
*/
|
3078
3121
|
function notifySuccess(result, _callbackUrl) {
|
3079
|
-
|
3080
|
-
|
3122
|
+
ensureInitialized(runtime, FrameContexts.authentication);
|
3123
|
+
const apiVersionTag = _callbackUrl
|
3124
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_NotifySuccess)
|
3125
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_NotifySuccess);
|
3126
|
+
sendMessageToParent(apiVersionTag, 'authentication.authenticate.success', [result]);
|
3081
3127
|
// Wait for the message to be sent before closing the window
|
3082
3128
|
waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));
|
3083
3129
|
}
|
@@ -3088,8 +3134,11 @@ var authentication;
|
|
3088
3134
|
* Please use the {@link authentication.notifyFailure authentication.notifyFailure(result?: string): void} instead.
|
3089
3135
|
*/
|
3090
3136
|
function notifyFailure(reason, _callbackUrl) {
|
3091
|
-
|
3092
|
-
|
3137
|
+
ensureInitialized(runtime, FrameContexts.authentication);
|
3138
|
+
const apiVersionTag = _callbackUrl
|
3139
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_NotifyFailure)
|
3140
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_NotifyFailure);
|
3141
|
+
sendMessageToParent(apiVersionTag, 'authentication.authenticate.failure', [reason]);
|
3093
3142
|
// Wait for the message to be sent before closing the window
|
3094
3143
|
waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));
|
3095
3144
|
}
|
@@ -3157,36 +3206,36 @@ var authentication;
|
|
3157
3206
|
*/
|
3158
3207
|
const dialogTelemetryVersionNumber = ApiVersionNumber.V_2;
|
3159
3208
|
function updateResizeHelper(apiVersionTag, dimensions) {
|
3160
|
-
|
3209
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
3161
3210
|
if (!dialog.update.isSupported()) {
|
3162
3211
|
throw errorNotSupportedOnPlatform;
|
3163
3212
|
}
|
3164
|
-
|
3213
|
+
sendMessageToParent(apiVersionTag, 'tasks.updateTask', [dimensions]);
|
3165
3214
|
}
|
3166
3215
|
function urlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
|
3167
|
-
|
3216
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
3168
3217
|
if (!dialog.url.isSupported()) {
|
3169
3218
|
throw errorNotSupportedOnPlatform;
|
3170
3219
|
}
|
3171
3220
|
if (messageFromChildHandler) {
|
3172
|
-
registerHandler('messageForParent', messageFromChildHandler);
|
3221
|
+
registerHandler(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_RegisterMessageForParentHandler), 'messageForParent', messageFromChildHandler);
|
3173
3222
|
}
|
3174
3223
|
const dialogInfo = dialog.url.getDialogInfoFromUrlDialogInfo(urlDialogInfo);
|
3175
|
-
|
3224
|
+
sendMessageToParent(apiVersionTag, 'tasks.startTask', [dialogInfo], (err, result) => {
|
3176
3225
|
submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err, result });
|
3177
3226
|
removeHandler('messageForParent');
|
3178
3227
|
});
|
3179
3228
|
}
|
3180
3229
|
function botUrlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
|
3181
|
-
|
3230
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
3182
3231
|
if (!dialog.url.bot.isSupported()) {
|
3183
3232
|
throw errorNotSupportedOnPlatform;
|
3184
3233
|
}
|
3185
3234
|
if (messageFromChildHandler) {
|
3186
|
-
registerHandler('messageForParent', messageFromChildHandler);
|
3235
|
+
registerHandler(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Bot_RegisterMessageForParentHandler), 'messageForParent', messageFromChildHandler);
|
3187
3236
|
}
|
3188
3237
|
const dialogInfo = dialog.url.getDialogInfoFromBotUrlDialogInfo(urlDialogInfo);
|
3189
|
-
|
3238
|
+
sendMessageToParent(apiVersionTag, 'tasks.startTask', [dialogInfo], (err, result) => {
|
3190
3239
|
submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err, result });
|
3191
3240
|
removeHandler('messageForParent');
|
3192
3241
|
});
|
@@ -3195,12 +3244,12 @@ function urlSubmitHelper(apiVersionTag, result, appIds) {
|
|
3195
3244
|
// FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
|
3196
3245
|
// but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
|
3197
3246
|
// FrameContexts.content will be removed once the bug is fixed.
|
3198
|
-
|
3247
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
3199
3248
|
if (!dialog.url.isSupported()) {
|
3200
3249
|
throw errorNotSupportedOnPlatform;
|
3201
3250
|
}
|
3202
3251
|
// Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
|
3203
|
-
|
3252
|
+
sendMessageToParent(apiVersionTag, 'tasks.completeTask', [
|
3204
3253
|
result,
|
3205
3254
|
appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : [],
|
3206
3255
|
]);
|
@@ -3233,7 +3282,7 @@ var dialog;
|
|
3233
3282
|
* @beta
|
3234
3283
|
*/
|
3235
3284
|
function initialize() {
|
3236
|
-
registerHandler('messageForChild', handleDialogMessage, false);
|
3285
|
+
registerHandler(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_RegisterMessageForChildHandler), 'messageForChild', handleDialogMessage, false);
|
3237
3286
|
}
|
3238
3287
|
dialog.initialize = initialize;
|
3239
3288
|
function handleDialogMessage(message) {
|
@@ -3307,11 +3356,11 @@ var dialog;
|
|
3307
3356
|
function sendMessageToParentFromDialog(
|
3308
3357
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3309
3358
|
message) {
|
3310
|
-
|
3359
|
+
ensureInitialized(runtime, FrameContexts.task);
|
3311
3360
|
if (!isSupported()) {
|
3312
3361
|
throw errorNotSupportedOnPlatform;
|
3313
3362
|
}
|
3314
|
-
|
3363
|
+
sendMessageToParent(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_ParentCommunication_SendMessageToParentFromDialog), 'messageForParent', [message]);
|
3315
3364
|
}
|
3316
3365
|
parentCommunication.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
|
3317
3366
|
/**
|
@@ -3324,11 +3373,11 @@ var dialog;
|
|
3324
3373
|
function sendMessageToDialog(
|
3325
3374
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3326
3375
|
message) {
|
3327
|
-
|
3376
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
3328
3377
|
if (!isSupported()) {
|
3329
3378
|
throw errorNotSupportedOnPlatform;
|
3330
3379
|
}
|
3331
|
-
|
3380
|
+
sendMessageToParent(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_ParentCommunication_SendMessageToDialog), 'messageForChild', [message]);
|
3332
3381
|
}
|
3333
3382
|
parentCommunication.sendMessageToDialog = sendMessageToDialog;
|
3334
3383
|
/**
|
@@ -3342,7 +3391,7 @@ var dialog;
|
|
3342
3391
|
* @beta
|
3343
3392
|
*/
|
3344
3393
|
function registerOnMessageFromParent(listener) {
|
3345
|
-
|
3394
|
+
ensureInitialized(runtime, FrameContexts.task);
|
3346
3395
|
if (!isSupported()) {
|
3347
3396
|
throw errorNotSupportedOnPlatform;
|
3348
3397
|
}
|
@@ -3350,7 +3399,7 @@ var dialog;
|
|
3350
3399
|
// handler since the original does not allow for post messages.
|
3351
3400
|
// It is replaced by the user specified listener that is passed in.
|
3352
3401
|
removeHandler('messageForChild');
|
3353
|
-
registerHandler('messageForChild', listener);
|
3402
|
+
registerHandler(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_ParentCommunication_RegisterMessageForChildHandler), 'messageForChild', listener);
|
3354
3403
|
storedMessages.reverse();
|
3355
3404
|
while (storedMessages.length > 0) {
|
3356
3405
|
const message = storedMessages.pop();
|
@@ -3369,7 +3418,7 @@ var dialog;
|
|
3369
3418
|
*/
|
3370
3419
|
function isSupported() {
|
3371
3420
|
var _a, _b;
|
3372
|
-
return
|
3421
|
+
return ensureInitialized(runtime) && !!((_b = (_a = runtime.supports.dialog) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.parentCommunication);
|
3373
3422
|
}
|
3374
3423
|
parentCommunication.isSupported = isSupported;
|
3375
3424
|
})(parentCommunication = url.parentCommunication || (url.parentCommunication = {}));
|
@@ -3383,7 +3432,7 @@ var dialog;
|
|
3383
3432
|
* @beta
|
3384
3433
|
*/
|
3385
3434
|
function isSupported() {
|
3386
|
-
return
|
3435
|
+
return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;
|
3387
3436
|
}
|
3388
3437
|
url.isSupported = isSupported;
|
3389
3438
|
/**
|
@@ -3418,8 +3467,8 @@ var dialog;
|
|
3418
3467
|
* @beta
|
3419
3468
|
*/
|
3420
3469
|
function isSupported() {
|
3421
|
-
return (
|
3422
|
-
(
|
3470
|
+
return (ensureInitialized(runtime) &&
|
3471
|
+
(runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined);
|
3423
3472
|
}
|
3424
3473
|
bot.isSupported = isSupported;
|
3425
3474
|
})(bot = url.bot || (url.bot = {}));
|
@@ -3465,7 +3514,7 @@ var dialog;
|
|
3465
3514
|
* @hidden
|
3466
3515
|
*/
|
3467
3516
|
function isSupported() {
|
3468
|
-
return
|
3517
|
+
return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;
|
3469
3518
|
}
|
3470
3519
|
dialog.isSupported = isSupported;
|
3471
3520
|
/**
|
@@ -3495,8 +3544,8 @@ var dialog;
|
|
3495
3544
|
* @beta
|
3496
3545
|
*/
|
3497
3546
|
function isSupported() {
|
3498
|
-
return
|
3499
|
-
?
|
3547
|
+
return ensureInitialized(runtime) && runtime.supports.dialog
|
3548
|
+
? runtime.supports.dialog.update
|
3500
3549
|
? true
|
3501
3550
|
: false
|
3502
3551
|
: false;
|
@@ -3521,12 +3570,12 @@ var dialog;
|
|
3521
3570
|
* @beta
|
3522
3571
|
*/
|
3523
3572
|
function open(adaptiveCardDialogInfo, submitHandler) {
|
3524
|
-
|
3573
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
3525
3574
|
if (!isSupported()) {
|
3526
3575
|
throw errorNotSupportedOnPlatform;
|
3527
3576
|
}
|
3528
3577
|
const dialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);
|
3529
|
-
|
3578
|
+
sendMessageToParent(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Open), 'tasks.startTask', [dialogInfo], (err, result) => {
|
3530
3579
|
submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err, result });
|
3531
3580
|
});
|
3532
3581
|
}
|
@@ -3541,11 +3590,11 @@ var dialog;
|
|
3541
3590
|
* @beta
|
3542
3591
|
*/
|
3543
3592
|
function isSupported() {
|
3544
|
-
const isAdaptiveCardVersionSupported =
|
3545
|
-
|
3546
|
-
!isHostAdaptiveCardSchemaVersionUnsupported(
|
3547
|
-
return (
|
3548
|
-
(isAdaptiveCardVersionSupported &&
|
3593
|
+
const isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
|
3594
|
+
runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
|
3595
|
+
!isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
|
3596
|
+
return (ensureInitialized(runtime) &&
|
3597
|
+
(isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined);
|
3549
3598
|
}
|
3550
3599
|
adaptiveCard.isSupported = isSupported;
|
3551
3600
|
/**
|
@@ -3564,12 +3613,12 @@ var dialog;
|
|
3564
3613
|
* @beta
|
3565
3614
|
*/
|
3566
3615
|
function open(botAdaptiveCardDialogInfo, submitHandler) {
|
3567
|
-
|
3616
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
3568
3617
|
if (!isSupported()) {
|
3569
3618
|
throw errorNotSupportedOnPlatform;
|
3570
3619
|
}
|
3571
3620
|
const dialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);
|
3572
|
-
|
3621
|
+
sendMessageToParent(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Bot_Open), 'tasks.startTask', [dialogInfo], (err, result) => {
|
3573
3622
|
submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err, result });
|
3574
3623
|
});
|
3575
3624
|
}
|
@@ -3584,14 +3633,14 @@ var dialog;
|
|
3584
3633
|
* @beta
|
3585
3634
|
*/
|
3586
3635
|
function isSupported() {
|
3587
|
-
const isAdaptiveCardVersionSupported =
|
3588
|
-
|
3589
|
-
!isHostAdaptiveCardSchemaVersionUnsupported(
|
3590
|
-
return (
|
3636
|
+
const isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
|
3637
|
+
runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
|
3638
|
+
!isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
|
3639
|
+
return (ensureInitialized(runtime) &&
|
3591
3640
|
(isAdaptiveCardVersionSupported &&
|
3592
|
-
|
3593
|
-
|
3594
|
-
|
3641
|
+
runtime.supports.dialog &&
|
3642
|
+
runtime.supports.dialog.card &&
|
3643
|
+
runtime.supports.dialog.card.bot) !== undefined);
|
3595
3644
|
}
|
3596
3645
|
bot.isSupported = isSupported;
|
3597
3646
|
})(bot = adaptiveCard.bot || (adaptiveCard.bot = {}));
|
@@ -3700,9 +3749,9 @@ var menus;
|
|
3700
3749
|
* Limited to Microsoft-internal use.
|
3701
3750
|
*/
|
3702
3751
|
function initialize() {
|
3703
|
-
|
3704
|
-
|
3705
|
-
|
3752
|
+
registerHandler(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_RegisterNavBarMenuItemPressHandler), 'navBarMenuItemPress', handleNavBarMenuItemPress, false);
|
3753
|
+
registerHandler(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_RegisterActionMenuItemPressHandler), 'actionMenuItemPress', handleActionMenuItemPress, false);
|
3754
|
+
registerHandler(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_RegisterSetModuleViewHandler), 'setModuleView', handleViewConfigItemPress, false);
|
3706
3755
|
}
|
3707
3756
|
menus.initialize = initialize;
|
3708
3757
|
/**
|
@@ -3714,18 +3763,20 @@ var menus;
|
|
3714
3763
|
* @param handler - The handler to invoke when the user selects view configuration.
|
3715
3764
|
*/
|
3716
3765
|
function setUpViews(viewConfig, handler) {
|
3717
|
-
|
3766
|
+
ensureInitialized(runtime);
|
3718
3767
|
if (!isSupported()) {
|
3719
3768
|
throw errorNotSupportedOnPlatform;
|
3720
3769
|
}
|
3721
3770
|
viewConfigItemPressHandler = handler;
|
3722
|
-
|
3771
|
+
sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_SetUpViews), 'setUpViews', [
|
3772
|
+
viewConfig,
|
3773
|
+
]);
|
3723
3774
|
}
|
3724
3775
|
menus.setUpViews = setUpViews;
|
3725
3776
|
function handleViewConfigItemPress(id) {
|
3726
3777
|
if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
|
3727
|
-
|
3728
|
-
|
3778
|
+
ensureInitialized(runtime);
|
3779
|
+
sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_HandleViewConfigItemPress), 'viewConfigItemPress', [id]);
|
3729
3780
|
}
|
3730
3781
|
}
|
3731
3782
|
/**
|
@@ -3736,18 +3787,20 @@ var menus;
|
|
3736
3787
|
* @param handler The handler to invoke when the user selects menu item.
|
3737
3788
|
*/
|
3738
3789
|
function setNavBarMenu(items, handler) {
|
3739
|
-
|
3790
|
+
ensureInitialized(runtime);
|
3740
3791
|
if (!isSupported()) {
|
3741
3792
|
throw errorNotSupportedOnPlatform;
|
3742
3793
|
}
|
3743
3794
|
navBarMenuItemPressHandler = handler;
|
3744
|
-
|
3795
|
+
sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_SetNavBarMenu), 'setNavBarMenu', [
|
3796
|
+
items,
|
3797
|
+
]);
|
3745
3798
|
}
|
3746
3799
|
menus.setNavBarMenu = setNavBarMenu;
|
3747
3800
|
function handleNavBarMenuItemPress(id) {
|
3748
3801
|
if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
|
3749
|
-
|
3750
|
-
|
3802
|
+
ensureInitialized(runtime);
|
3803
|
+
sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_HandleNavBarMenuItemPress), 'handleNavBarMenuItemPress', [id]);
|
3751
3804
|
}
|
3752
3805
|
}
|
3753
3806
|
/**
|
@@ -3758,18 +3811,20 @@ var menus;
|
|
3758
3811
|
* @param handler - The handler to invoke when the user selects menu item.
|
3759
3812
|
*/
|
3760
3813
|
function showActionMenu(params, handler) {
|
3761
|
-
|
3814
|
+
ensureInitialized(runtime);
|
3762
3815
|
if (!isSupported()) {
|
3763
3816
|
throw errorNotSupportedOnPlatform;
|
3764
3817
|
}
|
3765
3818
|
actionMenuItemPressHandler = handler;
|
3766
|
-
|
3819
|
+
sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_ShowActionMenu), 'showActionMenu', [
|
3820
|
+
params,
|
3821
|
+
]);
|
3767
3822
|
}
|
3768
3823
|
menus.showActionMenu = showActionMenu;
|
3769
3824
|
function handleActionMenuItemPress(id) {
|
3770
3825
|
if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
|
3771
|
-
|
3772
|
-
|
3826
|
+
ensureInitialized(runtime);
|
3827
|
+
sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_HandleActionMenuItemPress), 'handleActionMenuItemPress', [id]);
|
3773
3828
|
}
|
3774
3829
|
}
|
3775
3830
|
/**
|
@@ -3779,7 +3834,7 @@ var menus;
|
|
3779
3834
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
3780
3835
|
*/
|
3781
3836
|
function isSupported() {
|
3782
|
-
return
|
3837
|
+
return ensureInitialized(runtime) && runtime.supports.menus ? true : false;
|
3783
3838
|
}
|
3784
3839
|
menus.isSupported = isSupported;
|
3785
3840
|
})(menus || (menus = {}));
|
@@ -3827,22 +3882,22 @@ function appInitializeHelper(apiVersionTag, validMessageOrigins) {
|
|
3827
3882
|
}
|
3828
3883
|
}
|
3829
3884
|
function notifyAppLoadedHelper(apiVersionTag) {
|
3830
|
-
|
3885
|
+
sendMessageToParent(apiVersionTag, app.Messages.AppLoaded, [version]);
|
3831
3886
|
}
|
3832
3887
|
function notifyExpectedFailureHelper(apiVersionTag, expectedFailureRequest) {
|
3833
|
-
|
3888
|
+
sendMessageToParent(apiVersionTag, app.Messages.ExpectedFailure, [
|
3834
3889
|
expectedFailureRequest.reason,
|
3835
3890
|
expectedFailureRequest.message,
|
3836
3891
|
]);
|
3837
3892
|
}
|
3838
3893
|
function notifyFailureHelper(apiVersiontag, appInitializationFailedRequest) {
|
3839
|
-
|
3894
|
+
sendMessageToParent(apiVersiontag, app.Messages.Failure, [
|
3840
3895
|
appInitializationFailedRequest.reason,
|
3841
3896
|
appInitializationFailedRequest.message,
|
3842
3897
|
]);
|
3843
3898
|
}
|
3844
3899
|
function notifySuccessHelper(apiVersionTag) {
|
3845
|
-
|
3900
|
+
sendMessageToParent(apiVersionTag, app.Messages.Success, [version]);
|
3846
3901
|
}
|
3847
3902
|
const initializeHelperLogger = appLogger.extend('initializeHelper');
|
3848
3903
|
function initializeHelper(apiVersionTag, validMessageOrigins) {
|
@@ -3935,8 +3990,8 @@ function registerOnThemeChangeHandlerHelper(apiVersionTag, handler) {
|
|
3935
3990
|
}
|
3936
3991
|
function openLinkHelper(apiVersionTag, deepLink) {
|
3937
3992
|
return new Promise((resolve) => {
|
3938
|
-
|
3939
|
-
resolve(
|
3993
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
3994
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', deepLink));
|
3940
3995
|
});
|
3941
3996
|
}
|
3942
3997
|
/**
|
@@ -4092,7 +4147,7 @@ var app;
|
|
4092
4147
|
function getContext() {
|
4093
4148
|
return new Promise((resolve) => {
|
4094
4149
|
ensureInitializeCalled();
|
4095
|
-
resolve(
|
4150
|
+
resolve(sendAndUnwrap(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetContext), 'getContext'));
|
4096
4151
|
}).then((legacyContext) => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context
|
4097
4152
|
}
|
4098
4153
|
app.getContext = getContext;
|
@@ -4178,7 +4233,7 @@ var app;
|
|
4178
4233
|
if (!handler) {
|
4179
4234
|
throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');
|
4180
4235
|
}
|
4181
|
-
|
4236
|
+
ensureInitialized(runtime);
|
4182
4237
|
handlers_registerBeforeSuspendOrTerminateHandler(handler);
|
4183
4238
|
}
|
4184
4239
|
lifecycle.registerBeforeSuspendOrTerminateHandler = registerBeforeSuspendOrTerminateHandler;
|
@@ -4194,7 +4249,7 @@ var app;
|
|
4194
4249
|
if (!handler) {
|
4195
4250
|
throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');
|
4196
4251
|
}
|
4197
|
-
|
4252
|
+
ensureInitialized(runtime);
|
4198
4253
|
handlers_registerOnResumeHandler(handler);
|
4199
4254
|
}
|
4200
4255
|
lifecycle.registerOnResumeHandler = registerOnResumeHandler;
|
@@ -4314,108 +4369,109 @@ function transformLegacyContextToAppContext(legacyContext) {
|
|
4314
4369
|
|
4315
4370
|
|
4316
4371
|
|
4372
|
+
|
4317
4373
|
/**
|
4318
4374
|
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
4319
4375
|
*/
|
4320
4376
|
const pagesTelemetryVersionNumber = ApiVersionNumber.V_2;
|
4321
4377
|
function navigateCrossDomainHelper(apiVersionTag, url) {
|
4322
4378
|
return new Promise((resolve) => {
|
4323
|
-
|
4379
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
4324
4380
|
if (!pages.isSupported()) {
|
4325
4381
|
throw errorNotSupportedOnPlatform;
|
4326
4382
|
}
|
4327
4383
|
const errorMessage = 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';
|
4328
|
-
resolve(
|
4384
|
+
resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateCrossDomain', errorMessage, url));
|
4329
4385
|
});
|
4330
4386
|
}
|
4331
4387
|
function backStackNavigateBackHelper(apiVersionTag) {
|
4332
4388
|
return new Promise((resolve) => {
|
4333
|
-
|
4389
|
+
ensureInitialized(runtime);
|
4334
4390
|
if (!pages.backStack.isSupported()) {
|
4335
4391
|
throw errorNotSupportedOnPlatform;
|
4336
4392
|
}
|
4337
4393
|
const errorMessage = 'Back navigation is not supported in the current client or context.';
|
4338
|
-
resolve(
|
4394
|
+
resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateBack', errorMessage));
|
4339
4395
|
});
|
4340
4396
|
}
|
4341
4397
|
function tabsNavigateToTabHelper(apiVersionTag, tabInstance) {
|
4342
4398
|
return new Promise((resolve) => {
|
4343
|
-
|
4399
|
+
ensureInitialized(runtime);
|
4344
4400
|
if (!pages.tabs.isSupported()) {
|
4345
4401
|
throw errorNotSupportedOnPlatform;
|
4346
4402
|
}
|
4347
4403
|
const errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';
|
4348
|
-
resolve(
|
4404
|
+
resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateToTab', errorMessage, tabInstance));
|
4349
4405
|
});
|
4350
4406
|
}
|
4351
4407
|
function returnFocusHelper(apiVersionTag, navigateForward) {
|
4352
|
-
|
4408
|
+
ensureInitialized(runtime);
|
4353
4409
|
if (!pages.isSupported()) {
|
4354
4410
|
throw errorNotSupportedOnPlatform;
|
4355
4411
|
}
|
4356
|
-
|
4412
|
+
sendMessageToParent(apiVersionTag, 'returnFocus', [navigateForward]);
|
4357
4413
|
}
|
4358
4414
|
function getTabInstancesHelper(apiVersionTag, tabInstanceParameters) {
|
4359
4415
|
return new Promise((resolve) => {
|
4360
|
-
|
4416
|
+
ensureInitialized(runtime);
|
4361
4417
|
if (!pages.tabs.isSupported()) {
|
4362
4418
|
throw errorNotSupportedOnPlatform;
|
4363
4419
|
}
|
4364
4420
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
4365
|
-
resolve(
|
4421
|
+
resolve(sendAndUnwrap(apiVersionTag, 'getTabInstances', tabInstanceParameters));
|
4366
4422
|
});
|
4367
4423
|
}
|
4368
4424
|
function getMruTabInstancesHelper(apiVersionTag, tabInstanceParameters) {
|
4369
4425
|
return new Promise((resolve) => {
|
4370
|
-
|
4426
|
+
ensureInitialized(runtime);
|
4371
4427
|
if (!pages.tabs.isSupported()) {
|
4372
4428
|
throw errorNotSupportedOnPlatform;
|
4373
4429
|
}
|
4374
4430
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
4375
|
-
resolve(
|
4431
|
+
resolve(sendAndUnwrap(apiVersionTag, 'getMruTabInstances', tabInstanceParameters));
|
4376
4432
|
});
|
4377
4433
|
}
|
4378
4434
|
function shareDeepLinkHelper(apiVersionTag, deepLinkParameters) {
|
4379
|
-
|
4435
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
4380
4436
|
if (!pages.isSupported()) {
|
4381
4437
|
throw errorNotSupportedOnPlatform;
|
4382
4438
|
}
|
4383
|
-
|
4439
|
+
sendMessageToParent(apiVersionTag, 'shareDeepLink', [
|
4384
4440
|
deepLinkParameters.subPageId,
|
4385
4441
|
deepLinkParameters.subPageLabel,
|
4386
4442
|
deepLinkParameters.subPageWebUrl,
|
4387
4443
|
]);
|
4388
4444
|
}
|
4389
4445
|
function setCurrentFrameHelper(apiVersionTag, frameInfo) {
|
4390
|
-
|
4446
|
+
ensureInitialized(runtime, FrameContexts.content);
|
4391
4447
|
if (!pages.isSupported()) {
|
4392
4448
|
throw errorNotSupportedOnPlatform;
|
4393
4449
|
}
|
4394
|
-
|
4450
|
+
sendMessageToParent(apiVersionTag, 'setFrameContext', [frameInfo]);
|
4395
4451
|
}
|
4396
4452
|
function configSetValidityStateHelper(apiVersionTag, validityState) {
|
4397
|
-
|
4453
|
+
ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);
|
4398
4454
|
if (!pages.config.isSupported()) {
|
4399
4455
|
throw errorNotSupportedOnPlatform;
|
4400
4456
|
}
|
4401
|
-
|
4457
|
+
sendMessageToParent(apiVersionTag, 'settings.setValidityState', [validityState]);
|
4402
4458
|
}
|
4403
4459
|
function getConfigHelper(apiVersionTag) {
|
4404
4460
|
return new Promise((resolve) => {
|
4405
|
-
|
4461
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
|
4406
4462
|
if (!pages.isSupported()) {
|
4407
4463
|
throw errorNotSupportedOnPlatform;
|
4408
4464
|
}
|
4409
|
-
resolve(
|
4465
|
+
resolve(sendAndUnwrap(apiVersionTag, 'settings.getSettings'));
|
4410
4466
|
});
|
4411
4467
|
}
|
4412
4468
|
function configSetConfigHelper(apiVersionTag, instanceConfig) {
|
4413
4469
|
return new Promise((resolve) => {
|
4414
|
-
|
4470
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
|
4415
4471
|
if (!pages.config.isSupported()) {
|
4416
4472
|
throw errorNotSupportedOnPlatform;
|
4417
4473
|
}
|
4418
|
-
resolve(
|
4474
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'settings.setSettings', instanceConfig));
|
4419
4475
|
});
|
4420
4476
|
}
|
4421
4477
|
/**
|
@@ -4447,7 +4503,7 @@ var pages;
|
|
4447
4503
|
* Limited to Microsoft-internal use
|
4448
4504
|
*/
|
4449
4505
|
function registerFocusEnterHandler(handler) {
|
4450
|
-
|
4506
|
+
registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFocusEnterHandler), 'focusEnter', handler, [], () => {
|
4451
4507
|
if (!isSupported()) {
|
4452
4508
|
throw errorNotSupportedOnPlatform;
|
4453
4509
|
}
|
@@ -4474,7 +4530,8 @@ var pages;
|
|
4474
4530
|
* https: protocol otherwise they will be ignored. Example: https:www.example.com
|
4475
4531
|
*/
|
4476
4532
|
function initializeWithFrameContext(frameInfo, callback, validMessageOrigins) {
|
4477
|
-
|
4533
|
+
prefetchOriginsFromCDN();
|
4534
|
+
appInitializeHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_InitializeWithFrameContext), validMessageOrigins).then(() => callback && callback());
|
4478
4535
|
setCurrentFrame(frameInfo);
|
4479
4536
|
}
|
4480
4537
|
pages.initializeWithFrameContext = initializeWithFrameContext;
|
@@ -4510,16 +4567,16 @@ var pages;
|
|
4510
4567
|
*/
|
4511
4568
|
function navigateToApp(params) {
|
4512
4569
|
return new Promise((resolve) => {
|
4513
|
-
|
4570
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
4514
4571
|
if (!isSupported()) {
|
4515
4572
|
throw errorNotSupportedOnPlatform;
|
4516
4573
|
}
|
4517
4574
|
const apiVersionTag = getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateCrossDomain);
|
4518
|
-
if (
|
4519
|
-
resolve(
|
4575
|
+
if (runtime.isLegacyTeams) {
|
4576
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsAppLink(params)));
|
4520
4577
|
}
|
4521
4578
|
else {
|
4522
|
-
resolve(
|
4579
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'pages.navigateToApp', params));
|
4523
4580
|
}
|
4524
4581
|
});
|
4525
4582
|
}
|
@@ -4542,7 +4599,7 @@ var pages;
|
|
4542
4599
|
* @param handler - The handler to invoke when the user toggles full-screen view for a tab.
|
4543
4600
|
*/
|
4544
4601
|
function registerFullScreenHandler(handler) {
|
4545
|
-
|
4602
|
+
registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFullScreenHandler), 'fullScreenChange', handler, [], () => {
|
4546
4603
|
if (!isNullOrUndefined(handler) && !isSupported()) {
|
4547
4604
|
throw errorNotSupportedOnPlatform;
|
4548
4605
|
}
|
@@ -4556,7 +4613,7 @@ var pages;
|
|
4556
4613
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4557
4614
|
*/
|
4558
4615
|
function isSupported() {
|
4559
|
-
return
|
4616
|
+
return ensureInitialized(runtime) && runtime.supports.pages ? true : false;
|
4560
4617
|
}
|
4561
4618
|
pages.isSupported = isSupported;
|
4562
4619
|
/**
|
@@ -4600,8 +4657,8 @@ var pages;
|
|
4600
4657
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4601
4658
|
*/
|
4602
4659
|
function isSupported() {
|
4603
|
-
return
|
4604
|
-
?
|
4660
|
+
return ensureInitialized(runtime) && runtime.supports.pages
|
4661
|
+
? runtime.supports.pages.tabs
|
4605
4662
|
? true
|
4606
4663
|
: false
|
4607
4664
|
: false;
|
@@ -4625,8 +4682,8 @@ var pages;
|
|
4625
4682
|
* Limited to Microsoft-internal use
|
4626
4683
|
*/
|
4627
4684
|
function initialize() {
|
4628
|
-
registerHandler('settings.save', handleSave, false);
|
4629
|
-
registerHandler('settings.remove', handleRemove, false);
|
4685
|
+
registerHandler(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterSettingsSaveHandler), 'settings.save', handleSave, false);
|
4686
|
+
registerHandler(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterSettingsRemoveHandler), 'settings.remove', handleRemove, false);
|
4630
4687
|
}
|
4631
4688
|
config.initialize = initialize;
|
4632
4689
|
/**
|
@@ -4676,12 +4733,12 @@ var pages;
|
|
4676
4733
|
*/
|
4677
4734
|
function registerOnSaveHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
|
4678
4735
|
// allow for registration cleanup even when not finished initializing
|
4679
|
-
!isNullOrUndefined(handler) &&
|
4736
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.settings);
|
4680
4737
|
if (versionSpecificHelper) {
|
4681
4738
|
versionSpecificHelper();
|
4682
4739
|
}
|
4683
4740
|
saveHandler = handler;
|
4684
|
-
!isNullOrUndefined(handler) &&
|
4741
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['save']);
|
4685
4742
|
}
|
4686
4743
|
config.registerOnSaveHandlerHelper = registerOnSaveHandlerHelper;
|
4687
4744
|
/**
|
@@ -4712,12 +4769,12 @@ var pages;
|
|
4712
4769
|
*/
|
4713
4770
|
function registerOnRemoveHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
|
4714
4771
|
// allow for registration cleanup even when not finished initializing
|
4715
|
-
!isNullOrUndefined(handler) &&
|
4772
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);
|
4716
4773
|
if (versionSpecificHelper) {
|
4717
4774
|
versionSpecificHelper();
|
4718
4775
|
}
|
4719
4776
|
removeHandler = handler;
|
4720
|
-
!isNullOrUndefined(handler) &&
|
4777
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['remove']);
|
4721
4778
|
}
|
4722
4779
|
config.registerOnRemoveHandlerHelper = registerOnRemoveHandlerHelper;
|
4723
4780
|
function handleSave(result) {
|
@@ -4738,7 +4795,7 @@ var pages;
|
|
4738
4795
|
* @param handler - The handler to invoke when the user clicks on Settings.
|
4739
4796
|
*/
|
4740
4797
|
function registerChangeConfigHandler(handler) {
|
4741
|
-
|
4798
|
+
registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterChangeConfigHandler), 'changeSettings', handler, [FrameContexts.content], () => {
|
4742
4799
|
if (!isSupported()) {
|
4743
4800
|
throw errorNotSupportedOnPlatform;
|
4744
4801
|
}
|
@@ -4756,12 +4813,12 @@ var pages;
|
|
4756
4813
|
}
|
4757
4814
|
notifySuccess() {
|
4758
4815
|
this.ensureNotNotified();
|
4759
|
-
|
4816
|
+
sendMessageToParent(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SaveEvent_NotifySuccess), 'settings.save.success');
|
4760
4817
|
this.notified = true;
|
4761
4818
|
}
|
4762
4819
|
notifyFailure(reason) {
|
4763
4820
|
this.ensureNotNotified();
|
4764
|
-
|
4821
|
+
sendMessageToParent(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SaveEvent_NotifyFailure), 'settings.save.failure', [reason]);
|
4765
4822
|
this.notified = true;
|
4766
4823
|
}
|
4767
4824
|
ensureNotNotified() {
|
@@ -4793,12 +4850,12 @@ var pages;
|
|
4793
4850
|
}
|
4794
4851
|
notifySuccess() {
|
4795
4852
|
this.ensureNotNotified();
|
4796
|
-
|
4853
|
+
sendMessageToParent(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RemoveEvent_NotifySuccess), 'settings.remove.success');
|
4797
4854
|
this.notified = true;
|
4798
4855
|
}
|
4799
4856
|
notifyFailure(reason) {
|
4800
4857
|
this.ensureNotNotified();
|
4801
|
-
|
4858
|
+
sendMessageToParent(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RemoveEvent_NotifyFailure), 'settings.remove.failure', [reason]);
|
4802
4859
|
this.notified = true;
|
4803
4860
|
}
|
4804
4861
|
ensureNotNotified() {
|
@@ -4814,8 +4871,8 @@ var pages;
|
|
4814
4871
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4815
4872
|
*/
|
4816
4873
|
function isSupported() {
|
4817
|
-
return
|
4818
|
-
?
|
4874
|
+
return ensureInitialized(runtime) && runtime.supports.pages
|
4875
|
+
? runtime.supports.pages.config
|
4819
4876
|
? true
|
4820
4877
|
: false
|
4821
4878
|
: false;
|
@@ -4836,7 +4893,7 @@ var pages;
|
|
4836
4893
|
* Limited to Microsoft-internal use.
|
4837
4894
|
*/
|
4838
4895
|
function _initialize() {
|
4839
|
-
registerHandler('backButtonPress', handleBackButtonPress, false);
|
4896
|
+
registerHandler(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_RegisterBackButtonPressHandler), 'backButtonPress', handleBackButtonPress, false);
|
4840
4897
|
}
|
4841
4898
|
backStack._initialize = _initialize;
|
4842
4899
|
/**
|
@@ -4874,12 +4931,12 @@ var pages;
|
|
4874
4931
|
*/
|
4875
4932
|
function registerBackButtonHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
|
4876
4933
|
// allow for registration cleanup even when not finished initializing
|
4877
|
-
!isNullOrUndefined(handler) &&
|
4934
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
4878
4935
|
if (versionSpecificHelper) {
|
4879
4936
|
versionSpecificHelper();
|
4880
4937
|
}
|
4881
4938
|
backButtonPressHandler = handler;
|
4882
|
-
!isNullOrUndefined(handler) &&
|
4939
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['backButton']);
|
4883
4940
|
}
|
4884
4941
|
backStack.registerBackButtonHandlerHelper = registerBackButtonHandlerHelper;
|
4885
4942
|
function handleBackButtonPress() {
|
@@ -4900,8 +4957,8 @@ var pages;
|
|
4900
4957
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4901
4958
|
*/
|
4902
4959
|
function isSupported() {
|
4903
|
-
return
|
4904
|
-
?
|
4960
|
+
return ensureInitialized(runtime) && runtime.supports.pages
|
4961
|
+
? runtime.supports.pages.backStack
|
4905
4962
|
? true
|
4906
4963
|
: false
|
4907
4964
|
: false;
|
@@ -4926,11 +4983,11 @@ var pages;
|
|
4926
4983
|
*
|
4927
4984
|
*/
|
4928
4985
|
function enterFullscreen() {
|
4929
|
-
|
4986
|
+
ensureInitialized(runtime, FrameContexts.content);
|
4930
4987
|
if (!isSupported()) {
|
4931
4988
|
throw errorNotSupportedOnPlatform;
|
4932
4989
|
}
|
4933
|
-
|
4990
|
+
sendMessageToParent(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_EnterFullscreen), 'enterFullscreen', []);
|
4934
4991
|
}
|
4935
4992
|
fullTrust.enterFullscreen = enterFullscreen;
|
4936
4993
|
/**
|
@@ -4940,11 +4997,11 @@ var pages;
|
|
4940
4997
|
* Reverts the tab into normal-screen mode.
|
4941
4998
|
*/
|
4942
4999
|
function exitFullscreen() {
|
4943
|
-
|
5000
|
+
ensureInitialized(runtime, FrameContexts.content);
|
4944
5001
|
if (!isSupported()) {
|
4945
5002
|
throw errorNotSupportedOnPlatform;
|
4946
5003
|
}
|
4947
|
-
|
5004
|
+
sendMessageToParent(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_ExitFullscreen), 'exitFullscreen', []);
|
4948
5005
|
}
|
4949
5006
|
fullTrust.exitFullscreen = exitFullscreen;
|
4950
5007
|
/**
|
@@ -4956,8 +5013,8 @@ var pages;
|
|
4956
5013
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4957
5014
|
*/
|
4958
5015
|
function isSupported() {
|
4959
|
-
return
|
4960
|
-
?
|
5016
|
+
return ensureInitialized(runtime) && runtime.supports.pages
|
5017
|
+
? runtime.supports.pages.fullTrust
|
4961
5018
|
? true
|
4962
5019
|
: false
|
4963
5020
|
: false;
|
@@ -4975,7 +5032,7 @@ var pages;
|
|
4975
5032
|
* @param handler - The handler to invoke when the personal app button is clicked in the app bar.
|
4976
5033
|
*/
|
4977
5034
|
function onClick(handler) {
|
4978
|
-
|
5035
|
+
registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnClick), 'appButtonClick', handler, [FrameContexts.content], () => {
|
4979
5036
|
if (!isSupported()) {
|
4980
5037
|
throw errorNotSupportedOnPlatform;
|
4981
5038
|
}
|
@@ -4988,7 +5045,7 @@ var pages;
|
|
4988
5045
|
* @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
|
4989
5046
|
*/
|
4990
5047
|
function onHoverEnter(handler) {
|
4991
|
-
|
5048
|
+
registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverEnter), 'appButtonHoverEnter', handler, [FrameContexts.content], () => {
|
4992
5049
|
if (!isSupported()) {
|
4993
5050
|
throw errorNotSupportedOnPlatform;
|
4994
5051
|
}
|
@@ -5001,7 +5058,7 @@ var pages;
|
|
5001
5058
|
* @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.
|
5002
5059
|
*/
|
5003
5060
|
function onHoverLeave(handler) {
|
5004
|
-
|
5061
|
+
registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverLeave), 'appButtonHoverLeave', handler, [FrameContexts.content], () => {
|
5005
5062
|
if (!isSupported()) {
|
5006
5063
|
throw errorNotSupportedOnPlatform;
|
5007
5064
|
}
|
@@ -5015,8 +5072,8 @@ var pages;
|
|
5015
5072
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
5016
5073
|
*/
|
5017
5074
|
function isSupported() {
|
5018
|
-
return
|
5019
|
-
?
|
5075
|
+
return ensureInitialized(runtime) && runtime.supports.pages
|
5076
|
+
? runtime.supports.pages.appButton
|
5020
5077
|
? true
|
5021
5078
|
: false
|
5022
5079
|
: false;
|
@@ -5040,11 +5097,11 @@ var pages;
|
|
5040
5097
|
*/
|
5041
5098
|
function navigateTo(params) {
|
5042
5099
|
return new Promise((resolve) => {
|
5043
|
-
|
5100
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
5044
5101
|
if (!isSupported()) {
|
5045
5102
|
throw errorNotSupportedOnPlatform;
|
5046
5103
|
}
|
5047
|
-
resolve(
|
5104
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateTo), 'pages.currentApp.navigateTo', params));
|
5048
5105
|
});
|
5049
5106
|
}
|
5050
5107
|
currentApp.navigateTo = navigateTo;
|
@@ -5055,11 +5112,11 @@ var pages;
|
|
5055
5112
|
*/
|
5056
5113
|
function navigateToDefaultPage() {
|
5057
5114
|
return new Promise((resolve) => {
|
5058
|
-
|
5115
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
5059
5116
|
if (!isSupported()) {
|
5060
5117
|
throw errorNotSupportedOnPlatform;
|
5061
5118
|
}
|
5062
|
-
resolve(
|
5119
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateToDefaultPage), 'pages.currentApp.navigateToDefaultPage'));
|
5063
5120
|
});
|
5064
5121
|
}
|
5065
5122
|
currentApp.navigateToDefaultPage = navigateToDefaultPage;
|
@@ -5072,8 +5129,8 @@ var pages;
|
|
5072
5129
|
* @beta
|
5073
5130
|
*/
|
5074
5131
|
function isSupported() {
|
5075
|
-
return
|
5076
|
-
?
|
5132
|
+
return ensureInitialized(runtime) && runtime.supports.pages
|
5133
|
+
? runtime.supports.pages.currentApp
|
5077
5134
|
? true
|
5078
5135
|
: false
|
5079
5136
|
: false;
|
@@ -5174,24 +5231,10 @@ function callHandler(name, args) {
|
|
5174
5231
|
* @internal
|
5175
5232
|
* Limited to Microsoft-internal use
|
5176
5233
|
*/
|
5177
|
-
function
|
5234
|
+
function registerHandler(apiVersionTag, name, handler, sendMessage = true, args = []) {
|
5178
5235
|
if (handler) {
|
5179
5236
|
HandlersPrivate.handlers[name] = handler;
|
5180
|
-
sendMessage &&
|
5181
|
-
}
|
5182
|
-
else {
|
5183
|
-
delete HandlersPrivate.handlers[name];
|
5184
|
-
}
|
5185
|
-
}
|
5186
|
-
/**
|
5187
|
-
* @internal
|
5188
|
-
* Limited to Microsoft-internal use
|
5189
|
-
*/
|
5190
|
-
function registerHandler(name, handler, sendMessage = true, args = []) {
|
5191
|
-
if (handler) {
|
5192
|
-
HandlersPrivate.handlers[name] = handler;
|
5193
|
-
sendMessage &&
|
5194
|
-
sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_0, ApiName.RegisterHandler), 'registerHandler', [name, ...args]);
|
5237
|
+
sendMessage && sendMessageToParent(apiVersionTag, 'registerHandler', [name, ...args]);
|
5195
5238
|
}
|
5196
5239
|
else {
|
5197
5240
|
delete HandlersPrivate.handlers[name];
|
@@ -5218,39 +5261,19 @@ function doesHandlerExist(name) {
|
|
5218
5261
|
* @internal
|
5219
5262
|
* Limited to Microsoft-internal use
|
5220
5263
|
*
|
5221
|
-
* @param apiVersionTag - The tag
|
5222
|
-
* @param name - The name of the handler to register.
|
5223
|
-
* @param handler - The handler to invoke.
|
5224
|
-
* @param contexts - The context within which it is valid to register this handler.
|
5225
|
-
* @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.
|
5226
|
-
*/
|
5227
|
-
function registerHandlerHelperWithVersion(apiVersionTag, name, handler, contexts, registrationHelper) {
|
5228
|
-
// allow for registration cleanup even when not finished initializing
|
5229
|
-
handler && internalAPIs_ensureInitialized(runtime_runtime, ...contexts);
|
5230
|
-
if (registrationHelper) {
|
5231
|
-
registrationHelper();
|
5232
|
-
}
|
5233
|
-
registerHandler(name, handler);
|
5234
|
-
}
|
5235
|
-
/**
|
5236
|
-
* @hidden
|
5237
|
-
* Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs
|
5238
|
-
*
|
5239
|
-
* @internal
|
5240
|
-
* Limited to Microsoft-internal use
|
5241
|
-
*
|
5264
|
+
* @param apiVersionTag - The tag of the api version and name
|
5242
5265
|
* @param name - The name of the handler to register.
|
5243
5266
|
* @param handler - The handler to invoke.
|
5244
5267
|
* @param contexts - The context within which it is valid to register this handler.
|
5245
5268
|
* @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.
|
5246
5269
|
*/
|
5247
|
-
function registerHandlerHelper(name, handler, contexts, registrationHelper) {
|
5270
|
+
function registerHandlerHelper(apiVersionTag, name, handler, contexts, registrationHelper) {
|
5248
5271
|
// allow for registration cleanup even when not finished initializing
|
5249
5272
|
handler && ensureInitialized(runtime, ...contexts);
|
5250
5273
|
if (registrationHelper) {
|
5251
5274
|
registrationHelper();
|
5252
5275
|
}
|
5253
|
-
registerHandler(name, handler);
|
5276
|
+
registerHandler(apiVersionTag, name, handler);
|
5254
5277
|
}
|
5255
5278
|
/**
|
5256
5279
|
* @internal
|
@@ -5258,7 +5281,7 @@ function registerHandlerHelper(name, handler, contexts, registrationHelper) {
|
|
5258
5281
|
*/
|
5259
5282
|
function registerOnThemeChangeHandler(apiVersionTag, handler) {
|
5260
5283
|
HandlersPrivate.themeChangeHandler = handler;
|
5261
|
-
!isNullOrUndefined(handler) &&
|
5284
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['themeChange']);
|
5262
5285
|
}
|
5263
5286
|
/**
|
5264
5287
|
* @internal
|
@@ -5278,12 +5301,9 @@ function handleThemeChange(theme) {
|
|
5278
5301
|
*
|
5279
5302
|
* @deprecated
|
5280
5303
|
*/
|
5281
|
-
function handlers_registerOnLoadHandler(handler) {
|
5304
|
+
function handlers_registerOnLoadHandler(apiVersionTag, handler) {
|
5282
5305
|
HandlersPrivate.loadHandler = handler;
|
5283
|
-
!isNullOrUndefined(handler) &&
|
5284
|
-
sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterHandler), 'registerHandler', [
|
5285
|
-
'load',
|
5286
|
-
]);
|
5306
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['load']);
|
5287
5307
|
}
|
5288
5308
|
/**
|
5289
5309
|
* @internal
|
@@ -5306,12 +5326,9 @@ function handleLoad(context) {
|
|
5306
5326
|
*
|
5307
5327
|
* @deprecated
|
5308
5328
|
*/
|
5309
|
-
function handlers_registerBeforeUnloadHandler(handler) {
|
5329
|
+
function handlers_registerBeforeUnloadHandler(apiVersionTag, handler) {
|
5310
5330
|
HandlersPrivate.beforeUnloadHandler = handler;
|
5311
|
-
!isNullOrUndefined(handler) &&
|
5312
|
-
sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterHandler), 'registerHandler', [
|
5313
|
-
'beforeUnload',
|
5314
|
-
]);
|
5331
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['beforeUnload']);
|
5315
5332
|
}
|
5316
5333
|
/**
|
5317
5334
|
* @internal
|
@@ -5319,7 +5336,7 @@ function handlers_registerBeforeUnloadHandler(handler) {
|
|
5319
5336
|
*/
|
5320
5337
|
function handleBeforeUnload() {
|
5321
5338
|
const readyToUnload = () => {
|
5322
|
-
sendMessageToParent('readyToUnload', []);
|
5339
|
+
sendMessageToParent(getApiVersionTag(ApiVersionNumber.V_2, ApiName.HandleBeforeUnload), 'readyToUnload', []);
|
5323
5340
|
};
|
5324
5341
|
if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
|
5325
5342
|
HandlersPrivate.beforeSuspendOrTerminateHandler();
|
@@ -5346,7 +5363,7 @@ function handleBeforeUnload() {
|
|
5346
5363
|
function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
|
5347
5364
|
HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
|
5348
5365
|
!isNullOrUndefined(handler) &&
|
5349
|
-
|
5366
|
+
sendMessageToParent(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterBeforeSuspendOrTerminateHandler), 'registerHandler', ['beforeUnload']);
|
5350
5367
|
}
|
5351
5368
|
/**
|
5352
5369
|
* @internal
|
@@ -5355,7 +5372,9 @@ function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
|
|
5355
5372
|
function handlers_registerOnResumeHandler(handler) {
|
5356
5373
|
HandlersPrivate.resumeHandler = handler;
|
5357
5374
|
!isNullOrUndefined(handler) &&
|
5358
|
-
|
5375
|
+
sendMessageToParent(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterOnResumeHandler), 'registerHandler', [
|
5376
|
+
'load',
|
5377
|
+
]);
|
5359
5378
|
}
|
5360
5379
|
|
5361
5380
|
;// CONCATENATED MODULE: ./src/internal/nestedAppAuth.ts
|
@@ -5554,7 +5573,7 @@ function initializeCommunication(validMessageOrigins, apiVersionTag) {
|
|
5554
5573
|
// Send the initialized message to any origin, because at this point we most likely don't know the origin
|
5555
5574
|
// of the parent window, and this message contains no data that could pose a security risk.
|
5556
5575
|
Communication.parentOrigin = '*';
|
5557
|
-
return
|
5576
|
+
return sendMessageToParentAsync(apiVersionTag, 'initialize', [
|
5558
5577
|
version,
|
5559
5578
|
latestRuntimeApiVersion,
|
5560
5579
|
]).then(([context, clientType, runtimeConfig, clientSupportedSDKVersion]) => {
|
@@ -5593,38 +5612,22 @@ function uninitializeCommunication() {
|
|
5593
5612
|
* @hidden
|
5594
5613
|
* Send a message to parent and then unwrap result. Uses nativeInterface on mobile to communicate with parent context
|
5595
5614
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
5596
|
-
* for telemetry work.
|
5597
|
-
* and this function will be removed when the project is completed.
|
5615
|
+
* for telemetry work.
|
5598
5616
|
*
|
5599
5617
|
* @internal
|
5600
5618
|
* Limited to Microsoft-internal use
|
5601
5619
|
*/
|
5602
|
-
function
|
5603
|
-
return
|
5604
|
-
}
|
5605
|
-
/**
|
5606
|
-
* @internal
|
5607
|
-
* Limited to Microsoft-internal use
|
5608
|
-
*/
|
5609
|
-
function sendAndUnwrap(actionName, ...args) {
|
5610
|
-
return sendMessageToParentAsync(actionName, args).then(([result]) => result);
|
5620
|
+
function sendAndUnwrap(apiVersionTag, actionName, ...args) {
|
5621
|
+
return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([result]) => result);
|
5611
5622
|
}
|
5612
5623
|
/**
|
5613
5624
|
* @hidden
|
5614
5625
|
* Send a message to parent and then handle status and reason. Uses nativeInterface on mobile to communicate with parent context
|
5615
5626
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
5616
|
-
* for telemetry work.
|
5617
|
-
* and this function will be removed when the project is completed.
|
5627
|
+
* for telemetry work.
|
5618
5628
|
*/
|
5619
|
-
function
|
5620
|
-
return
|
5621
|
-
if (!wasSuccessful) {
|
5622
|
-
throw new Error(reason);
|
5623
|
-
}
|
5624
|
-
});
|
5625
|
-
}
|
5626
|
-
function sendAndHandleStatusAndReason(actionName, ...args) {
|
5627
|
-
return sendMessageToParentAsync(actionName, args).then(([wasSuccessful, reason]) => {
|
5629
|
+
function sendAndHandleStatusAndReason(apiVersionTag, actionName, ...args) {
|
5630
|
+
return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([wasSuccessful, reason]) => {
|
5628
5631
|
if (!wasSuccessful) {
|
5629
5632
|
throw new Error(reason);
|
5630
5633
|
}
|
@@ -5634,25 +5637,13 @@ function sendAndHandleStatusAndReason(actionName, ...args) {
|
|
5634
5637
|
* @hidden
|
5635
5638
|
* Send a message to parent and then handle status and reason with default error. Uses nativeInterface on mobile to communicate with parent context
|
5636
5639
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
5637
|
-
* for telemetry work.
|
5638
|
-
* and this function will be removed when the project is completed.
|
5640
|
+
* for telemetry work.
|
5639
5641
|
*
|
5640
5642
|
* @internal
|
5641
5643
|
* Limited to Microsoft-internal use
|
5642
5644
|
*/
|
5643
|
-
function
|
5644
|
-
return
|
5645
|
-
if (!wasSuccessful) {
|
5646
|
-
throw new Error(reason ? reason : defaultError);
|
5647
|
-
}
|
5648
|
-
});
|
5649
|
-
}
|
5650
|
-
/**
|
5651
|
-
* @internal
|
5652
|
-
* Limited to Microsoft-internal use
|
5653
|
-
*/
|
5654
|
-
function sendAndHandleStatusAndReasonWithDefaultError(actionName, defaultError, ...args) {
|
5655
|
-
return sendMessageToParentAsync(actionName, args).then(([wasSuccessful, reason]) => {
|
5645
|
+
function sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, actionName, defaultError, ...args) {
|
5646
|
+
return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([wasSuccessful, reason]) => {
|
5656
5647
|
if (!wasSuccessful) {
|
5657
5648
|
throw new Error(reason ? reason : defaultError);
|
5658
5649
|
}
|
@@ -5662,26 +5653,13 @@ function sendAndHandleStatusAndReasonWithDefaultError(actionName, defaultError,
|
|
5662
5653
|
* @hidden
|
5663
5654
|
* Send a message to parent and then handle SDK error. Uses nativeInterface on mobile to communicate with parent context
|
5664
5655
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
5665
|
-
* for telemetry work.
|
5666
|
-
* and this function will be removed when the project is completed.
|
5656
|
+
* for telemetry work.
|
5667
5657
|
*
|
5668
5658
|
* @internal
|
5669
5659
|
* Limited to Microsoft-internal use
|
5670
5660
|
*/
|
5671
|
-
function
|
5672
|
-
return
|
5673
|
-
if (error) {
|
5674
|
-
throw error;
|
5675
|
-
}
|
5676
|
-
return result;
|
5677
|
-
});
|
5678
|
-
}
|
5679
|
-
/**
|
5680
|
-
* @internal
|
5681
|
-
* Limited to Microsoft-internal use
|
5682
|
-
*/
|
5683
|
-
function sendAndHandleSdkError(actionName, ...args) {
|
5684
|
-
return sendMessageToParentAsync(actionName, args).then(([error, result]) => {
|
5661
|
+
function sendAndHandleSdkError(apiVersionTag, actionName, ...args) {
|
5662
|
+
return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([error, result]) => {
|
5685
5663
|
if (error) {
|
5686
5664
|
throw error;
|
5687
5665
|
}
|
@@ -5692,33 +5670,17 @@ function sendAndHandleSdkError(actionName, ...args) {
|
|
5692
5670
|
* @hidden
|
5693
5671
|
* Send a message to parent asynchronously. Uses nativeInterface on mobile to communicate with parent context
|
5694
5672
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
5695
|
-
* for telemetry work.
|
5696
|
-
* and this function will be removed when the project is completed.
|
5673
|
+
* for telemetry work.
|
5697
5674
|
*
|
5698
5675
|
* @internal
|
5699
5676
|
* Limited to Microsoft-internal use
|
5700
5677
|
*/
|
5701
|
-
function
|
5678
|
+
function sendMessageToParentAsync(apiVersionTag, actionName, args = undefined) {
|
5702
5679
|
if (!isFollowingApiVersionTagFormat(apiVersionTag)) {
|
5703
5680
|
throw Error(`apiVersionTag: ${apiVersionTag} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);
|
5704
5681
|
}
|
5705
5682
|
return new Promise((resolve) => {
|
5706
5683
|
const request = sendMessageToParentHelper(apiVersionTag, actionName, args);
|
5707
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
5708
|
-
// @ts-ignore
|
5709
|
-
resolve(waitForResponse(request.id));
|
5710
|
-
});
|
5711
|
-
}
|
5712
|
-
/**
|
5713
|
-
* @hidden
|
5714
|
-
* Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
|
5715
|
-
*
|
5716
|
-
* @internal
|
5717
|
-
* Limited to Microsoft-internal use
|
5718
|
-
*/
|
5719
|
-
function sendMessageToParentAsync(actionName, args = undefined) {
|
5720
|
-
return new Promise((resolve) => {
|
5721
|
-
const request = sendMessageToParentHelper(getApiVersionTag(ApiVersionNumber.V_0, 'testing'), actionName, args);
|
5722
5684
|
resolve(waitForResponse(request.id));
|
5723
5685
|
});
|
5724
5686
|
}
|
@@ -5765,10 +5727,10 @@ function waitForResponse(requestId) {
|
|
5765
5727
|
* @hidden
|
5766
5728
|
* Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
|
5767
5729
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
5768
|
-
* for telemetry work.
|
5769
|
-
*
|
5730
|
+
* for telemetry work.
|
5731
|
+
*
|
5770
5732
|
*/
|
5771
|
-
function
|
5733
|
+
function sendMessageToParent(apiVersionTag, actionName, argsOrCallback, callback) {
|
5772
5734
|
let args;
|
5773
5735
|
if (argsOrCallback instanceof Function) {
|
5774
5736
|
callback = argsOrCallback;
|
@@ -5779,9 +5741,6 @@ function sendMessageToParentWithVersion(apiVersionTag, actionName, argsOrCallbac
|
|
5779
5741
|
if (!isFollowingApiVersionTagFormat(apiVersionTag)) {
|
5780
5742
|
throw Error(`apiVersionTag: ${apiVersionTag} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);
|
5781
5743
|
}
|
5782
|
-
// APIs with v0 represents beta changes haven't been implemented on them
|
5783
|
-
// Otherwise, minimum version number will be v1
|
5784
|
-
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
5785
5744
|
const request = sendMessageToParentHelper(apiVersionTag, actionName, args);
|
5786
5745
|
if (callback) {
|
5787
5746
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
@@ -5789,25 +5748,6 @@ function sendMessageToParentWithVersion(apiVersionTag, actionName, argsOrCallbac
|
|
5789
5748
|
CommunicationPrivate.callbacks[request.id] = callback;
|
5790
5749
|
}
|
5791
5750
|
}
|
5792
|
-
/**
|
5793
|
-
* @internal
|
5794
|
-
* Limited to Microsoft-internal use
|
5795
|
-
*/
|
5796
|
-
function sendMessageToParent(actionName, argsOrCallback, callback) {
|
5797
|
-
let args;
|
5798
|
-
if (argsOrCallback instanceof Function) {
|
5799
|
-
callback = argsOrCallback;
|
5800
|
-
}
|
5801
|
-
else if (argsOrCallback instanceof Array) {
|
5802
|
-
args = argsOrCallback;
|
5803
|
-
}
|
5804
|
-
const request = sendMessageToParentHelper(getApiVersionTag(ApiVersionNumber.V_0, 'testing'), actionName, args);
|
5805
|
-
if (callback) {
|
5806
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
5807
|
-
// @ts-ignore
|
5808
|
-
CommunicationPrivate.callbacks[request.id] = callback;
|
5809
|
-
}
|
5810
|
-
}
|
5811
5751
|
const sendNestedAuthRequestToTopWindowLogger = communicationLogger.extend('sendNestedAuthRequestToTopWindow');
|
5812
5752
|
/**
|
5813
5753
|
* @internal
|
@@ -6097,7 +6037,7 @@ function handleChildMessage(evt) {
|
|
6097
6037
|
}
|
6098
6038
|
else {
|
6099
6039
|
// No handler, proxy to parent
|
6100
|
-
sendMessageToParent(message.func, message.args, (...args) => {
|
6040
|
+
sendMessageToParent(getApiVersionTag(ApiVersionNumber.V_2, ApiName.Tasks_StartTask), message.func, message.args, (...args) => {
|
6101
6041
|
if (Communication.childWindow) {
|
6102
6042
|
const isPartialResponse = args.pop();
|
6103
6043
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
@@ -6335,14 +6275,14 @@ var logs;
|
|
6335
6275
|
*/
|
6336
6276
|
function registerGetLogHandler(handler) {
|
6337
6277
|
// allow for registration cleanup even when not finished initializing
|
6338
|
-
!isNullOrUndefined(handler) &&
|
6278
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
6339
6279
|
if (!isNullOrUndefined(handler) && !isSupported()) {
|
6340
6280
|
throw errorNotSupportedOnPlatform;
|
6341
6281
|
}
|
6342
6282
|
if (handler) {
|
6343
|
-
|
6283
|
+
registerHandler(getApiVersionTag(logsTelemetryVersionNumber, ApiName.Logs_RegisterLogRequestHandler), 'log.request', () => {
|
6344
6284
|
const log = handler();
|
6345
|
-
|
6285
|
+
sendMessageToParent(getApiVersionTag(logsTelemetryVersionNumber, ApiName.Logs_Receive), 'log.receive', [log]);
|
6346
6286
|
});
|
6347
6287
|
}
|
6348
6288
|
else {
|
@@ -6362,7 +6302,7 @@ var logs;
|
|
6362
6302
|
* Limited to Microsoft-internal use
|
6363
6303
|
*/
|
6364
6304
|
function isSupported() {
|
6365
|
-
return
|
6305
|
+
return ensureInitialized(runtime) && runtime.supports.logs ? true : false;
|
6366
6306
|
}
|
6367
6307
|
logs.isSupported = isSupported;
|
6368
6308
|
})(logs || (logs = {}));
|
@@ -6437,8 +6377,8 @@ var UserSettingTypes;
|
|
6437
6377
|
*/
|
6438
6378
|
const privateAPIsTelemetryVersionNumber = ApiVersionNumber.V_1;
|
6439
6379
|
function uploadCustomApp(manifestBlob, onComplete) {
|
6440
|
-
|
6441
|
-
|
6380
|
+
ensureInitialized(runtime);
|
6381
|
+
sendMessageToParent(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_UploadCustomApp), 'uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());
|
6442
6382
|
}
|
6443
6383
|
/**
|
6444
6384
|
* @hidden
|
@@ -6453,8 +6393,8 @@ function uploadCustomApp(manifestBlob, onComplete) {
|
|
6453
6393
|
* Limited to Microsoft-internal use
|
6454
6394
|
*/
|
6455
6395
|
function sendCustomMessage(actionName, args, callback) {
|
6456
|
-
|
6457
|
-
|
6396
|
+
ensureInitialized(runtime);
|
6397
|
+
sendMessageToParent(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_SendCustomMessage), actionName, args, callback);
|
6458
6398
|
}
|
6459
6399
|
/**
|
6460
6400
|
* @hidden
|
@@ -6469,7 +6409,7 @@ function sendCustomMessage(actionName, args, callback) {
|
|
6469
6409
|
* Limited to Microsoft-internal use
|
6470
6410
|
*/
|
6471
6411
|
function sendCustomEvent(actionName, args) {
|
6472
|
-
|
6412
|
+
ensureInitialized(runtime);
|
6473
6413
|
//validate childWindow
|
6474
6414
|
if (!Communication.childWindow) {
|
6475
6415
|
throw new Error('The child window has not yet been initialized or is not present');
|
@@ -6487,8 +6427,8 @@ function sendCustomEvent(actionName, args) {
|
|
6487
6427
|
* Limited to Microsoft-internal use
|
6488
6428
|
*/
|
6489
6429
|
function registerCustomHandler(actionName, customHandler) {
|
6490
|
-
|
6491
|
-
|
6430
|
+
ensureInitialized(runtime);
|
6431
|
+
registerHandler(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_RegisterCustomHandler), actionName, (...args) => {
|
6492
6432
|
return customHandler.apply(this, args);
|
6493
6433
|
});
|
6494
6434
|
}
|
@@ -6503,8 +6443,8 @@ function registerCustomHandler(actionName, customHandler) {
|
|
6503
6443
|
* Limited to Microsoft-internal use
|
6504
6444
|
*/
|
6505
6445
|
function registerUserSettingsChangeHandler(settingTypes, handler) {
|
6506
|
-
|
6507
|
-
|
6446
|
+
ensureInitialized(runtime);
|
6447
|
+
registerHandler(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_RegisterUserSettingsChangeHandler), 'userSettingsChange', handler, true, [settingTypes]);
|
6508
6448
|
}
|
6509
6449
|
/**
|
6510
6450
|
* @hidden
|
@@ -6516,7 +6456,7 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
|
|
6516
6456
|
* Limited to Microsoft-internal use
|
6517
6457
|
*/
|
6518
6458
|
function openFilePreview(filePreviewParameters) {
|
6519
|
-
|
6459
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
6520
6460
|
const params = [
|
6521
6461
|
filePreviewParameters.entityId,
|
6522
6462
|
filePreviewParameters.title,
|
@@ -6534,7 +6474,7 @@ function openFilePreview(filePreviewParameters) {
|
|
6534
6474
|
filePreviewParameters.conversationId,
|
6535
6475
|
filePreviewParameters.sizeInBytes,
|
6536
6476
|
];
|
6537
|
-
|
6477
|
+
sendMessageToParent(getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_OpenFilePreview), 'openFilePreview', params);
|
6538
6478
|
}
|
6539
6479
|
|
6540
6480
|
;// CONCATENATED MODULE: ./src/private/conversations.ts
|
@@ -6575,11 +6515,11 @@ var conversations;
|
|
6575
6515
|
*/
|
6576
6516
|
function openConversation(openConversationRequest) {
|
6577
6517
|
return new Promise((resolve) => {
|
6578
|
-
|
6518
|
+
ensureInitialized(runtime, FrameContexts.content);
|
6579
6519
|
if (!isSupported()) {
|
6580
6520
|
throw errorNotSupportedOnPlatform;
|
6581
6521
|
}
|
6582
|
-
const sendPromise =
|
6522
|
+
const sendPromise = sendAndHandleStatusAndReason(getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_OpenConversation), 'conversations.openConversation', {
|
6583
6523
|
title: openConversationRequest.title,
|
6584
6524
|
subEntityId: openConversationRequest.subEntityId,
|
6585
6525
|
conversationId: openConversationRequest.conversationId,
|
@@ -6587,7 +6527,7 @@ var conversations;
|
|
6587
6527
|
entityId: openConversationRequest.entityId,
|
6588
6528
|
});
|
6589
6529
|
if (openConversationRequest.onStartConversation) {
|
6590
|
-
|
6530
|
+
registerHandler(getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_RegisterStartConversationHandler), 'startConversation', (subEntityId, conversationId, channelId, entityId) => {
|
6591
6531
|
var _a;
|
6592
6532
|
return (_a = openConversationRequest.onStartConversation) === null || _a === void 0 ? void 0 : _a.call(openConversationRequest, {
|
6593
6533
|
subEntityId,
|
@@ -6598,7 +6538,7 @@ var conversations;
|
|
6598
6538
|
});
|
6599
6539
|
}
|
6600
6540
|
if (openConversationRequest.onCloseConversation) {
|
6601
|
-
|
6541
|
+
registerHandler(getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_RegisterCloseConversationHandler), 'closeConversation', (subEntityId, conversationId, channelId, entityId) => {
|
6602
6542
|
var _a;
|
6603
6543
|
return (_a = openConversationRequest.onCloseConversation) === null || _a === void 0 ? void 0 : _a.call(openConversationRequest, {
|
6604
6544
|
subEntityId,
|
@@ -6621,11 +6561,11 @@ var conversations;
|
|
6621
6561
|
* Limited to Microsoft-internal use
|
6622
6562
|
*/
|
6623
6563
|
function closeConversation() {
|
6624
|
-
|
6564
|
+
ensureInitialized(runtime, FrameContexts.content);
|
6625
6565
|
if (!isSupported()) {
|
6626
6566
|
throw errorNotSupportedOnPlatform;
|
6627
6567
|
}
|
6628
|
-
|
6568
|
+
sendMessageToParent(getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_CloseConversation), 'conversations.closeConversation');
|
6629
6569
|
removeHandler('startConversation');
|
6630
6570
|
removeHandler('closeConversation');
|
6631
6571
|
}
|
@@ -6645,11 +6585,11 @@ var conversations;
|
|
6645
6585
|
*/
|
6646
6586
|
function getChatMembers() {
|
6647
6587
|
return new Promise((resolve) => {
|
6648
|
-
|
6588
|
+
ensureInitialized(runtime);
|
6649
6589
|
if (!isSupported()) {
|
6650
6590
|
throw errorNotSupportedOnPlatform;
|
6651
6591
|
}
|
6652
|
-
resolve(
|
6592
|
+
resolve(sendAndUnwrap(getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_GetChatMember), 'getChatMembers'));
|
6653
6593
|
});
|
6654
6594
|
}
|
6655
6595
|
conversations.getChatMembers = getChatMembers;
|
@@ -6663,7 +6603,7 @@ var conversations;
|
|
6663
6603
|
* Limited to Microsoft-internal use
|
6664
6604
|
*/
|
6665
6605
|
function isSupported() {
|
6666
|
-
return
|
6606
|
+
return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;
|
6667
6607
|
}
|
6668
6608
|
conversations.isSupported = isSupported;
|
6669
6609
|
})(conversations || (conversations = {}));
|
@@ -6742,7 +6682,6 @@ function createTeamsDeepLinkForAppInstallDialog(appId) {
|
|
6742
6682
|
|
6743
6683
|
|
6744
6684
|
|
6745
|
-
|
6746
6685
|
/**
|
6747
6686
|
* v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
|
6748
6687
|
*/
|
@@ -6756,18 +6695,16 @@ var appInstallDialog;
|
|
6756
6695
|
*/
|
6757
6696
|
function openAppInstallDialog(openAPPInstallDialogParams) {
|
6758
6697
|
return new Promise((resolve) => {
|
6759
|
-
|
6698
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
6760
6699
|
if (!isSupported()) {
|
6761
6700
|
throw new Error('Not supported');
|
6762
6701
|
}
|
6763
6702
|
const apiVersionTag = getApiVersionTag(appInstallDialogTelemetryVersionNumber, ApiName.AppInstallDialog_OpenAppInstallDialog);
|
6764
|
-
if (
|
6765
|
-
resolve(
|
6703
|
+
if (runtime.isLegacyTeams) {
|
6704
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId)));
|
6766
6705
|
}
|
6767
6706
|
else {
|
6768
|
-
|
6769
|
-
openAPPInstallDialogParams,
|
6770
|
-
]);
|
6707
|
+
sendMessageToParent(apiVersionTag, 'appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);
|
6771
6708
|
resolve();
|
6772
6709
|
}
|
6773
6710
|
});
|
@@ -6780,7 +6717,7 @@ var appInstallDialog;
|
|
6780
6717
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6781
6718
|
*/
|
6782
6719
|
function isSupported() {
|
6783
|
-
return
|
6720
|
+
return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;
|
6784
6721
|
}
|
6785
6722
|
appInstallDialog.isSupported = isSupported;
|
6786
6723
|
})(appInstallDialog || (appInstallDialog = {}));
|
@@ -6839,7 +6776,7 @@ var media;
|
|
6839
6776
|
if (!callback) {
|
6840
6777
|
throw new Error('[captureImage] Callback cannot be null');
|
6841
6778
|
}
|
6842
|
-
|
6779
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
6843
6780
|
if (!GlobalVars.isFramelessWindow) {
|
6844
6781
|
const notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
|
6845
6782
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
@@ -6852,7 +6789,7 @@ var media;
|
|
6852
6789
|
callback(oldPlatformError, []);
|
6853
6790
|
return;
|
6854
6791
|
}
|
6855
|
-
|
6792
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_CaptureImage), 'captureImage', callback);
|
6856
6793
|
}
|
6857
6794
|
media.captureImage = captureImage;
|
6858
6795
|
/**
|
@@ -6864,13 +6801,13 @@ var media;
|
|
6864
6801
|
* @beta
|
6865
6802
|
*/
|
6866
6803
|
function hasPermission() {
|
6867
|
-
|
6804
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
6868
6805
|
if (!isPermissionSupported()) {
|
6869
6806
|
throw errorNotSupportedOnPlatform;
|
6870
6807
|
}
|
6871
6808
|
const permissions = DevicePermission.Media;
|
6872
6809
|
return new Promise((resolve) => {
|
6873
|
-
resolve(
|
6810
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_HasPermission), 'permissions.has', permissions));
|
6874
6811
|
});
|
6875
6812
|
}
|
6876
6813
|
media.hasPermission = hasPermission;
|
@@ -6883,13 +6820,13 @@ var media;
|
|
6883
6820
|
* @beta
|
6884
6821
|
*/
|
6885
6822
|
function requestPermission() {
|
6886
|
-
|
6823
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
6887
6824
|
if (!isPermissionSupported()) {
|
6888
6825
|
throw errorNotSupportedOnPlatform;
|
6889
6826
|
}
|
6890
6827
|
const permissions = DevicePermission.Media;
|
6891
6828
|
return new Promise((resolve) => {
|
6892
|
-
resolve(
|
6829
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_RequestPermission), 'permissions.request', permissions));
|
6893
6830
|
});
|
6894
6831
|
}
|
6895
6832
|
media.requestPermission = requestPermission;
|
@@ -6900,7 +6837,7 @@ var media;
|
|
6900
6837
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6901
6838
|
*/
|
6902
6839
|
function isPermissionSupported() {
|
6903
|
-
return
|
6840
|
+
return ensureInitialized(runtime) && runtime.supports.permissions ? true : false;
|
6904
6841
|
}
|
6905
6842
|
/**
|
6906
6843
|
* Media object returned by the select Media API
|
@@ -6926,7 +6863,7 @@ var media;
|
|
6926
6863
|
if (!callback) {
|
6927
6864
|
throw new Error('[get Media] Callback cannot be null');
|
6928
6865
|
}
|
6929
|
-
|
6866
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
6930
6867
|
if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
|
6931
6868
|
const oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
6932
6869
|
callback(oldPlatformError, new Blob());
|
@@ -6982,7 +6919,7 @@ var media;
|
|
6982
6919
|
}
|
6983
6920
|
}
|
6984
6921
|
}
|
6985
|
-
|
6922
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_GetMedia), 'getMedia', localUriId, handleGetMediaCallbackRequest);
|
6986
6923
|
}
|
6987
6924
|
/** Function to retrieve media content, such as images or videos, via handler. */
|
6988
6925
|
getMediaViaHandler(callback) {
|
@@ -6994,7 +6931,7 @@ var media;
|
|
6994
6931
|
const params = [actionName, this.content];
|
6995
6932
|
this.content &&
|
6996
6933
|
!isNullOrUndefined(callback) &&
|
6997
|
-
|
6934
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_GetMedia), 'getMedia', params);
|
6998
6935
|
function handleGetMediaRequest(response) {
|
6999
6936
|
if (callback) {
|
7000
6937
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
@@ -7027,7 +6964,7 @@ var media;
|
|
7027
6964
|
}
|
7028
6965
|
}
|
7029
6966
|
}
|
7030
|
-
registerHandler('getMedia' + actionName, handleGetMediaRequest);
|
6967
|
+
registerHandler(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_RegisterGetMediaRequestHandler), 'getMedia' + actionName, handleGetMediaRequest);
|
7031
6968
|
}
|
7032
6969
|
}
|
7033
6970
|
media.Media = Media;
|
@@ -7050,7 +6987,7 @@ var media;
|
|
7050
6987
|
* Optional; @param callback is used to send app if host client has successfully handled the notification event or not
|
7051
6988
|
*/
|
7052
6989
|
notifyEventToHost(mediaEvent, callback) {
|
7053
|
-
|
6990
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7054
6991
|
try {
|
7055
6992
|
throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);
|
7056
6993
|
}
|
@@ -7061,7 +6998,7 @@ var media;
|
|
7061
6998
|
return;
|
7062
6999
|
}
|
7063
7000
|
const params = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };
|
7064
|
-
|
7001
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_Controller), 'media.controller', [params], (err) => {
|
7065
7002
|
if (callback) {
|
7066
7003
|
callback(err);
|
7067
7004
|
}
|
@@ -7178,7 +7115,7 @@ var media;
|
|
7178
7115
|
if (!callback) {
|
7179
7116
|
throw new Error('[select Media] Callback cannot be null');
|
7180
7117
|
}
|
7181
|
-
|
7118
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7182
7119
|
if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
|
7183
7120
|
const oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
7184
7121
|
callback(oldPlatformError, []);
|
@@ -7198,7 +7135,7 @@ var media;
|
|
7198
7135
|
}
|
7199
7136
|
const params = [mediaInputs];
|
7200
7137
|
// What comes back from native as attachments would just be objects and will be missing getMedia method on them
|
7201
|
-
|
7138
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_SelectMedia), 'selectMedia', params, (err, localAttachments, mediaEvent) => {
|
7202
7139
|
var _a, _b;
|
7203
7140
|
// MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
|
7204
7141
|
if (mediaEvent) {
|
@@ -7230,7 +7167,7 @@ var media;
|
|
7230
7167
|
if (!callback) {
|
7231
7168
|
throw new Error('[view images] Callback cannot be null');
|
7232
7169
|
}
|
7233
|
-
|
7170
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7234
7171
|
if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
|
7235
7172
|
const oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
|
7236
7173
|
callback(oldPlatformError);
|
@@ -7242,7 +7179,7 @@ var media;
|
|
7242
7179
|
return;
|
7243
7180
|
}
|
7244
7181
|
const params = [uriList];
|
7245
|
-
|
7182
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_ViewImages), 'viewImages', params, callback);
|
7246
7183
|
}
|
7247
7184
|
media.viewImages = viewImages;
|
7248
7185
|
/**
|
@@ -7261,7 +7198,7 @@ var media;
|
|
7261
7198
|
if (!callback) {
|
7262
7199
|
throw new Error('[media.scanBarCode] Callback cannot be null');
|
7263
7200
|
}
|
7264
|
-
|
7201
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7265
7202
|
if (GlobalVars.hostClientType === HostClientType.desktop ||
|
7266
7203
|
GlobalVars.hostClientType === HostClientType.web ||
|
7267
7204
|
GlobalVars.hostClientType === HostClientType.rigel ||
|
@@ -7283,7 +7220,7 @@ var media;
|
|
7283
7220
|
callback(invalidInput, '');
|
7284
7221
|
return;
|
7285
7222
|
}
|
7286
|
-
|
7223
|
+
sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_ScanBarCode), 'media.scanBarCode', [config], callback);
|
7287
7224
|
}
|
7288
7225
|
media.scanBarCode = scanBarCode;
|
7289
7226
|
})(media || (media = {}));
|
@@ -7535,14 +7472,14 @@ var barCode;
|
|
7535
7472
|
*/
|
7536
7473
|
function scanBarCode(barCodeConfig) {
|
7537
7474
|
return new Promise((resolve) => {
|
7538
|
-
|
7475
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7539
7476
|
if (!isSupported()) {
|
7540
7477
|
throw errorNotSupportedOnPlatform;
|
7541
7478
|
}
|
7542
7479
|
if (!validateScanBarCodeInput(barCodeConfig)) {
|
7543
7480
|
throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
7544
7481
|
}
|
7545
|
-
resolve(
|
7482
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_ScanBarCode), 'media.scanBarCode', barCodeConfig));
|
7546
7483
|
});
|
7547
7484
|
}
|
7548
7485
|
barCode.scanBarCode = scanBarCode;
|
@@ -7554,13 +7491,13 @@ var barCode;
|
|
7554
7491
|
* @beta
|
7555
7492
|
*/
|
7556
7493
|
function hasPermission() {
|
7557
|
-
|
7494
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7558
7495
|
if (!isSupported()) {
|
7559
7496
|
throw errorNotSupportedOnPlatform;
|
7560
7497
|
}
|
7561
7498
|
const permissions = DevicePermission.Media;
|
7562
7499
|
return new Promise((resolve) => {
|
7563
|
-
resolve(
|
7500
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_HasPermission), 'permissions.has', permissions));
|
7564
7501
|
});
|
7565
7502
|
}
|
7566
7503
|
barCode.hasPermission = hasPermission;
|
@@ -7572,13 +7509,13 @@ var barCode;
|
|
7572
7509
|
* @beta
|
7573
7510
|
*/
|
7574
7511
|
function requestPermission() {
|
7575
|
-
|
7512
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7576
7513
|
if (!isSupported()) {
|
7577
7514
|
throw errorNotSupportedOnPlatform;
|
7578
7515
|
}
|
7579
7516
|
const permissions = DevicePermission.Media;
|
7580
7517
|
return new Promise((resolve) => {
|
7581
|
-
resolve(
|
7518
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_RequestPermission), 'permissions.request', permissions));
|
7582
7519
|
});
|
7583
7520
|
}
|
7584
7521
|
barCode.requestPermission = requestPermission;
|
@@ -7591,7 +7528,7 @@ var barCode;
|
|
7591
7528
|
* @beta
|
7592
7529
|
*/
|
7593
7530
|
function isSupported() {
|
7594
|
-
return
|
7531
|
+
return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;
|
7595
7532
|
}
|
7596
7533
|
barCode.isSupported = isSupported;
|
7597
7534
|
})(barCode || (barCode = {}));
|
@@ -7636,15 +7573,15 @@ var chat;
|
|
7636
7573
|
chat.openChat = openChat;
|
7637
7574
|
function openChatHelper(apiVersionTag, openChatRequest) {
|
7638
7575
|
return new Promise((resolve) => {
|
7639
|
-
|
7576
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7640
7577
|
if (!isSupported()) {
|
7641
7578
|
throw errorNotSupportedOnPlatform;
|
7642
7579
|
}
|
7643
|
-
if (
|
7644
|
-
resolve(
|
7580
|
+
if (runtime.isLegacyTeams) {
|
7581
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message)));
|
7645
7582
|
}
|
7646
7583
|
else {
|
7647
|
-
const sendPromise =
|
7584
|
+
const sendPromise = sendAndHandleStatusAndReason(apiVersionTag, 'chat.openChat', {
|
7648
7585
|
members: [openChatRequest.user],
|
7649
7586
|
message: openChatRequest.message,
|
7650
7587
|
});
|
@@ -7677,15 +7614,15 @@ var chat;
|
|
7677
7614
|
resolve(openChatHelper(apiVersionTag, chatRequest));
|
7678
7615
|
}
|
7679
7616
|
else {
|
7680
|
-
|
7617
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7681
7618
|
if (!isSupported()) {
|
7682
7619
|
throw errorNotSupportedOnPlatform;
|
7683
7620
|
}
|
7684
|
-
if (
|
7685
|
-
resolve(
|
7621
|
+
if (runtime.isLegacyTeams) {
|
7622
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message)));
|
7686
7623
|
}
|
7687
7624
|
else {
|
7688
|
-
const sendPromise =
|
7625
|
+
const sendPromise = sendAndHandleStatusAndReason(apiVersionTag, 'chat.openChat', {
|
7689
7626
|
members: openChatRequest.users,
|
7690
7627
|
message: openChatRequest.message,
|
7691
7628
|
topic: openChatRequest.topic,
|
@@ -7705,7 +7642,7 @@ var chat;
|
|
7705
7642
|
* @beta
|
7706
7643
|
*/
|
7707
7644
|
function isSupported() {
|
7708
|
-
return
|
7645
|
+
return ensureInitialized(runtime) && runtime.supports.chat ? true : false;
|
7709
7646
|
}
|
7710
7647
|
chat.isSupported = isSupported;
|
7711
7648
|
})(chat || (chat = {}));
|
@@ -7752,7 +7689,7 @@ var clipboard;
|
|
7752
7689
|
*/
|
7753
7690
|
function write(blob) {
|
7754
7691
|
return clipboard_awaiter(this, void 0, void 0, function* () {
|
7755
|
-
|
7692
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
|
7756
7693
|
if (!isSupported()) {
|
7757
7694
|
throw errorNotSupportedOnPlatform;
|
7758
7695
|
}
|
@@ -7764,7 +7701,7 @@ var clipboard;
|
|
7764
7701
|
mimeType: blob.type,
|
7765
7702
|
content: base64StringContent,
|
7766
7703
|
};
|
7767
|
-
return
|
7704
|
+
return sendAndHandleSdkError(getApiVersionTag(clipboardTelemetryVersionNumber, ApiName.Clipboard_Write), 'clipboard.writeToClipboard', writeParams);
|
7768
7705
|
});
|
7769
7706
|
}
|
7770
7707
|
clipboard.write = write;
|
@@ -7777,16 +7714,17 @@ var clipboard;
|
|
7777
7714
|
*/
|
7778
7715
|
function read() {
|
7779
7716
|
return clipboard_awaiter(this, void 0, void 0, function* () {
|
7780
|
-
|
7717
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
|
7718
|
+
const apiVersionTag = getApiVersionTag(clipboardTelemetryVersionNumber, ApiName.Clipboard_Read);
|
7781
7719
|
if (!isSupported()) {
|
7782
7720
|
throw errorNotSupportedOnPlatform;
|
7783
7721
|
}
|
7784
7722
|
if (isHostClientMobile() || GlobalVars.hostClientType === HostClientType.macos) {
|
7785
|
-
const response = JSON.parse(yield sendAndHandleSdkError('clipboard.readFromClipboard'));
|
7723
|
+
const response = JSON.parse(yield sendAndHandleSdkError(apiVersionTag, 'clipboard.readFromClipboard'));
|
7786
7724
|
return base64ToBlob(response.mimeType, response.content);
|
7787
7725
|
}
|
7788
7726
|
else {
|
7789
|
-
return
|
7727
|
+
return sendAndHandleSdkError(apiVersionTag, 'clipboard.readFromClipboard');
|
7790
7728
|
}
|
7791
7729
|
});
|
7792
7730
|
}
|
@@ -7800,7 +7738,7 @@ var clipboard;
|
|
7800
7738
|
* @beta
|
7801
7739
|
*/
|
7802
7740
|
function isSupported() {
|
7803
|
-
return
|
7741
|
+
return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard ? true : false;
|
7804
7742
|
}
|
7805
7743
|
clipboard.isSupported = isSupported;
|
7806
7744
|
})(clipboard || (clipboard = {}));
|
@@ -7830,11 +7768,11 @@ var geoLocation;
|
|
7830
7768
|
* @beta
|
7831
7769
|
*/
|
7832
7770
|
function getCurrentLocation() {
|
7833
|
-
|
7771
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7834
7772
|
if (!isSupported()) {
|
7835
7773
|
throw errorNotSupportedOnPlatform;
|
7836
7774
|
}
|
7837
|
-
return
|
7775
|
+
return sendAndHandleSdkError(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_GetCurrentLocation), 'location.getLocation', {
|
7838
7776
|
allowChooseLocation: false,
|
7839
7777
|
showMap: false,
|
7840
7778
|
});
|
@@ -7849,13 +7787,13 @@ var geoLocation;
|
|
7849
7787
|
* @beta
|
7850
7788
|
*/
|
7851
7789
|
function hasPermission() {
|
7852
|
-
|
7790
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7853
7791
|
if (!isSupported()) {
|
7854
7792
|
throw errorNotSupportedOnPlatform;
|
7855
7793
|
}
|
7856
7794
|
const permissions = DevicePermission.GeoLocation;
|
7857
7795
|
return new Promise((resolve) => {
|
7858
|
-
resolve(
|
7796
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_HasPermission), 'permissions.has', permissions));
|
7859
7797
|
});
|
7860
7798
|
}
|
7861
7799
|
geoLocation.hasPermission = hasPermission;
|
@@ -7869,13 +7807,13 @@ var geoLocation;
|
|
7869
7807
|
* @beta
|
7870
7808
|
*/
|
7871
7809
|
function requestPermission() {
|
7872
|
-
|
7810
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7873
7811
|
if (!isSupported()) {
|
7874
7812
|
throw errorNotSupportedOnPlatform;
|
7875
7813
|
}
|
7876
7814
|
const permissions = DevicePermission.GeoLocation;
|
7877
7815
|
return new Promise((resolve) => {
|
7878
|
-
resolve(
|
7816
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_RequestPermission), 'permissions.request', permissions));
|
7879
7817
|
});
|
7880
7818
|
}
|
7881
7819
|
geoLocation.requestPermission = requestPermission;
|
@@ -7888,7 +7826,7 @@ var geoLocation;
|
|
7888
7826
|
* @beta
|
7889
7827
|
*/
|
7890
7828
|
function isSupported() {
|
7891
|
-
return
|
7829
|
+
return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;
|
7892
7830
|
}
|
7893
7831
|
geoLocation.isSupported = isSupported;
|
7894
7832
|
/**
|
@@ -7906,11 +7844,11 @@ var geoLocation;
|
|
7906
7844
|
* @beta
|
7907
7845
|
*/
|
7908
7846
|
function chooseLocation() {
|
7909
|
-
|
7847
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7910
7848
|
if (!isSupported()) {
|
7911
7849
|
throw errorNotSupportedOnPlatform;
|
7912
7850
|
}
|
7913
|
-
return
|
7851
|
+
return sendAndHandleSdkError(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_Map_ChooseLocation), 'location.getLocation', {
|
7914
7852
|
allowChooseLocation: true,
|
7915
7853
|
showMap: true,
|
7916
7854
|
});
|
@@ -7925,14 +7863,14 @@ var geoLocation;
|
|
7925
7863
|
* @beta
|
7926
7864
|
*/
|
7927
7865
|
function showLocation(location) {
|
7928
|
-
|
7866
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
7929
7867
|
if (!isSupported()) {
|
7930
7868
|
throw errorNotSupportedOnPlatform;
|
7931
7869
|
}
|
7932
7870
|
if (!location) {
|
7933
7871
|
throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
7934
7872
|
}
|
7935
|
-
return
|
7873
|
+
return sendAndHandleSdkError(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_ShowLocation), 'location.showLocation', location);
|
7936
7874
|
}
|
7937
7875
|
map.showLocation = showLocation;
|
7938
7876
|
/**
|
@@ -7944,10 +7882,10 @@ var geoLocation;
|
|
7944
7882
|
* @beta
|
7945
7883
|
*/
|
7946
7884
|
function isSupported() {
|
7947
|
-
return
|
7948
|
-
|
7949
|
-
|
7950
|
-
|
7885
|
+
return ensureInitialized(runtime) &&
|
7886
|
+
runtime.supports.geoLocation &&
|
7887
|
+
runtime.supports.geoLocation.map &&
|
7888
|
+
runtime.supports.permissions
|
7951
7889
|
? true
|
7952
7890
|
: false;
|
7953
7891
|
}
|
@@ -7962,11 +7900,11 @@ var geoLocation;
|
|
7962
7900
|
* version supported by the host, or undefined if the host does not support Adaptive Cards
|
7963
7901
|
*/
|
7964
7902
|
function getAdaptiveCardSchemaVersion() {
|
7965
|
-
if (!
|
7903
|
+
if (!runtime.hostVersionsInfo) {
|
7966
7904
|
return undefined;
|
7967
7905
|
}
|
7968
7906
|
else {
|
7969
|
-
return
|
7907
|
+
return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;
|
7970
7908
|
}
|
7971
7909
|
}
|
7972
7910
|
|
@@ -7997,8 +7935,8 @@ class ChildAppWindow {
|
|
7997
7935
|
* @param onComplete - The callback to know if the postMessage has been success/failed.
|
7998
7936
|
*/
|
7999
7937
|
postMessage(message, onComplete) {
|
8000
|
-
|
8001
|
-
|
7938
|
+
ensureInitialized(runtime);
|
7939
|
+
sendMessageToParent(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ChildAppWindow_PostMessage), 'messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
8002
7940
|
}
|
8003
7941
|
/**
|
8004
7942
|
* Add a listener that will be called when an event is received from the ChildAppWindow.
|
@@ -8007,9 +7945,9 @@ class ChildAppWindow {
|
|
8007
7945
|
* @param listener - The listener that will be called
|
8008
7946
|
*/
|
8009
7947
|
addEventListener(type, listener) {
|
8010
|
-
|
7948
|
+
ensureInitialized(runtime);
|
8011
7949
|
if (type === 'message') {
|
8012
|
-
|
7950
|
+
registerHandler(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ChildAppWindow_AddEventListener), 'messageForParent', listener);
|
8013
7951
|
}
|
8014
7952
|
}
|
8015
7953
|
}
|
@@ -8031,8 +7969,8 @@ class ParentAppWindow {
|
|
8031
7969
|
* @param onComplete - The callback to know if the postMessage has been success/failed.
|
8032
7970
|
*/
|
8033
7971
|
postMessage(message, onComplete) {
|
8034
|
-
|
8035
|
-
|
7972
|
+
ensureInitialized(runtime, FrameContexts.task);
|
7973
|
+
sendMessageToParent(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ParentAppWindow_PostMessage), 'messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
|
8036
7974
|
}
|
8037
7975
|
/**
|
8038
7976
|
* Add a listener that will be called when an event is received from the ParentAppWindow.
|
@@ -8041,9 +7979,9 @@ class ParentAppWindow {
|
|
8041
7979
|
* @param listener - The listener that will be called
|
8042
7980
|
*/
|
8043
7981
|
addEventListener(type, listener) {
|
8044
|
-
|
7982
|
+
ensureInitialized(runtime, FrameContexts.task);
|
8045
7983
|
if (type === 'message') {
|
8046
|
-
|
7984
|
+
registerHandler(getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ParentAppWindow_AddEventListener), 'messageForChild', listener);
|
8047
7985
|
}
|
8048
7986
|
}
|
8049
7987
|
}
|
@@ -8083,14 +8021,14 @@ var secondaryBrowser;
|
|
8083
8021
|
* @beta
|
8084
8022
|
*/
|
8085
8023
|
function open(url) {
|
8086
|
-
|
8024
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8087
8025
|
if (!isSupported()) {
|
8088
8026
|
throw errorNotSupportedOnPlatform;
|
8089
8027
|
}
|
8090
8028
|
if (!url || !isValidHttpsURL(url)) {
|
8091
8029
|
throw { errorCode: ErrorCode.INVALID_ARGUMENTS, message: 'Invalid Url: Only https URL is allowed' };
|
8092
8030
|
}
|
8093
|
-
return
|
8031
|
+
return sendAndHandleSdkError(getApiVersionTag(secondaryBrowserTelemetryVersionNumber, ApiName.SecondaryBrowser_OpenUrl), 'secondaryBrowser.open', url.toString());
|
8094
8032
|
}
|
8095
8033
|
secondaryBrowser.open = open;
|
8096
8034
|
/**
|
@@ -8102,7 +8040,7 @@ var secondaryBrowser;
|
|
8102
8040
|
* @beta
|
8103
8041
|
*/
|
8104
8042
|
function isSupported() {
|
8105
|
-
return
|
8043
|
+
return ensureInitialized(runtime) && runtime.supports.secondaryBrowser ? true : false;
|
8106
8044
|
}
|
8107
8045
|
secondaryBrowser.isSupported = isSupported;
|
8108
8046
|
})(secondaryBrowser || (secondaryBrowser = {}));
|
@@ -8141,7 +8079,7 @@ var location_location;
|
|
8141
8079
|
if (!callback) {
|
8142
8080
|
throw new Error('[location.getLocation] Callback cannot be null');
|
8143
8081
|
}
|
8144
|
-
|
8082
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
8145
8083
|
if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
|
8146
8084
|
throw { errorCode: ErrorCode.OLD_PLATFORM };
|
8147
8085
|
}
|
@@ -8151,7 +8089,7 @@ var location_location;
|
|
8151
8089
|
if (!isSupported()) {
|
8152
8090
|
throw errorNotSupportedOnPlatform;
|
8153
8091
|
}
|
8154
|
-
|
8092
|
+
sendMessageToParent(getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_GetLocation), 'location.getLocation', [props], callback);
|
8155
8093
|
}
|
8156
8094
|
location_1.getLocation = getLocation;
|
8157
8095
|
/**
|
@@ -8167,7 +8105,7 @@ var location_location;
|
|
8167
8105
|
if (!callback) {
|
8168
8106
|
throw new Error('[location.showLocation] Callback cannot be null');
|
8169
8107
|
}
|
8170
|
-
|
8108
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
8171
8109
|
if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
|
8172
8110
|
throw { errorCode: ErrorCode.OLD_PLATFORM };
|
8173
8111
|
}
|
@@ -8177,7 +8115,7 @@ var location_location;
|
|
8177
8115
|
if (!isSupported()) {
|
8178
8116
|
throw errorNotSupportedOnPlatform;
|
8179
8117
|
}
|
8180
|
-
|
8118
|
+
sendMessageToParent(getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_ShowLocation), 'location.showLocation', [location], callback);
|
8181
8119
|
}
|
8182
8120
|
location_1.showLocation = showLocation;
|
8183
8121
|
/**
|
@@ -8191,7 +8129,7 @@ var location_location;
|
|
8191
8129
|
* @returns boolean to represent whether Location is supported
|
8192
8130
|
*/
|
8193
8131
|
function isSupported() {
|
8194
|
-
return
|
8132
|
+
return ensureInitialized(runtime) && runtime.supports.location ? true : false;
|
8195
8133
|
}
|
8196
8134
|
location_1.isSupported = isSupported;
|
8197
8135
|
})(location_location || (location_location = {}));
|
@@ -8369,8 +8307,8 @@ var meeting;
|
|
8369
8307
|
if (!callback) {
|
8370
8308
|
throw new Error('[get incoming client audio state] Callback cannot be null');
|
8371
8309
|
}
|
8372
|
-
|
8373
|
-
|
8310
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8311
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetIncomingClientAudioState), 'getIncomingClientAudioState', callback);
|
8374
8312
|
}
|
8375
8313
|
meeting.getIncomingClientAudioState = getIncomingClientAudioState;
|
8376
8314
|
/**
|
@@ -8391,8 +8329,8 @@ var meeting;
|
|
8391
8329
|
if (!callback) {
|
8392
8330
|
throw new Error('[toggle incoming client audio] Callback cannot be null');
|
8393
8331
|
}
|
8394
|
-
|
8395
|
-
|
8332
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8333
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_ToggleIncomingClientAudio), 'toggleIncomingClientAudio', callback);
|
8396
8334
|
}
|
8397
8335
|
meeting.toggleIncomingClientAudio = toggleIncomingClientAudio;
|
8398
8336
|
/**
|
@@ -8410,8 +8348,8 @@ var meeting;
|
|
8410
8348
|
if (!callback) {
|
8411
8349
|
throw new Error('[get meeting details] Callback cannot be null');
|
8412
8350
|
}
|
8413
|
-
|
8414
|
-
|
8351
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
|
8352
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetMeetingDetails), 'meeting.getMeetingDetails', callback);
|
8415
8353
|
}
|
8416
8354
|
meeting.getMeetingDetails = getMeetingDetails;
|
8417
8355
|
/**
|
@@ -8429,8 +8367,8 @@ var meeting;
|
|
8429
8367
|
if (!callback) {
|
8430
8368
|
throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');
|
8431
8369
|
}
|
8432
|
-
|
8433
|
-
|
8370
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);
|
8371
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetAuthenticationTokenForAnonymousUser), 'meeting.getAuthenticationTokenForAnonymousUser', callback);
|
8434
8372
|
}
|
8435
8373
|
meeting.getAuthenticationTokenForAnonymousUser = getAuthenticationTokenForAnonymousUser;
|
8436
8374
|
/**
|
@@ -8450,8 +8388,8 @@ var meeting;
|
|
8450
8388
|
if (!callback) {
|
8451
8389
|
throw new Error('[get live stream state] Callback cannot be null');
|
8452
8390
|
}
|
8453
|
-
|
8454
|
-
|
8391
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
8392
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetLiveStreamState), 'meeting.getLiveStreamState', callback);
|
8455
8393
|
}
|
8456
8394
|
meeting.getLiveStreamState = getLiveStreamState;
|
8457
8395
|
/**
|
@@ -8474,8 +8412,8 @@ var meeting;
|
|
8474
8412
|
if (!callback) {
|
8475
8413
|
throw new Error('[request start live streaming] Callback cannot be null');
|
8476
8414
|
}
|
8477
|
-
|
8478
|
-
|
8415
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
8416
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestStartLiveStreaming), 'meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);
|
8479
8417
|
}
|
8480
8418
|
meeting.requestStartLiveStreaming = requestStartLiveStreaming;
|
8481
8419
|
/**
|
@@ -8493,8 +8431,8 @@ var meeting;
|
|
8493
8431
|
if (!callback) {
|
8494
8432
|
throw new Error('[request stop live streaming] Callback cannot be null');
|
8495
8433
|
}
|
8496
|
-
|
8497
|
-
|
8434
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
8435
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestStopLiveStreaming), 'meeting.requestStopLiveStreaming', callback);
|
8498
8436
|
}
|
8499
8437
|
meeting.requestStopLiveStreaming = requestStopLiveStreaming;
|
8500
8438
|
/**
|
@@ -8513,8 +8451,8 @@ var meeting;
|
|
8513
8451
|
if (!handler) {
|
8514
8452
|
throw new Error('[register live stream changed handler] Handler cannot be null');
|
8515
8453
|
}
|
8516
|
-
|
8517
|
-
|
8454
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
8455
|
+
registerHandler(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterLiveStreamChangedHandler), 'meeting.liveStreamChanged', handler);
|
8518
8456
|
}
|
8519
8457
|
meeting.registerLiveStreamChangedHandler = registerLiveStreamChangedHandler;
|
8520
8458
|
/**
|
@@ -8541,8 +8479,8 @@ var meeting;
|
|
8541
8479
|
if (!callback) {
|
8542
8480
|
throw new Error('[share app content to stage] Callback cannot be null');
|
8543
8481
|
}
|
8544
|
-
|
8545
|
-
|
8482
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8483
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_ShareAppContentToStage), 'meeting.shareAppContentToStage', [appContentUrl, shareOptions], callback);
|
8546
8484
|
}
|
8547
8485
|
meeting.shareAppContentToStage = shareAppContentToStage;
|
8548
8486
|
/**
|
@@ -8566,8 +8504,8 @@ var meeting;
|
|
8566
8504
|
if (!callback) {
|
8567
8505
|
throw new Error('[get app content stage sharing capabilities] Callback cannot be null');
|
8568
8506
|
}
|
8569
|
-
|
8570
|
-
|
8507
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8508
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetAppContentStageSharingCapabilities), 'meeting.getAppContentStageSharingCapabilities', callback);
|
8571
8509
|
}
|
8572
8510
|
meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
|
8573
8511
|
/**
|
@@ -8583,8 +8521,8 @@ var meeting;
|
|
8583
8521
|
if (!callback) {
|
8584
8522
|
throw new Error('[stop sharing app content to stage] Callback cannot be null');
|
8585
8523
|
}
|
8586
|
-
|
8587
|
-
|
8524
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8525
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_StopSharingAppContentToStage), 'meeting.stopSharingAppContentToStage', callback);
|
8588
8526
|
}
|
8589
8527
|
meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
|
8590
8528
|
/**
|
@@ -8605,8 +8543,8 @@ var meeting;
|
|
8605
8543
|
if (!callback) {
|
8606
8544
|
throw new Error('[get app content stage sharing state] Callback cannot be null');
|
8607
8545
|
}
|
8608
|
-
|
8609
|
-
|
8546
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8547
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetAppContentStageSharingState), 'meeting.getAppContentStageSharingState', callback);
|
8610
8548
|
}
|
8611
8549
|
meeting.getAppContentStageSharingState = getAppContentStageSharingState;
|
8612
8550
|
/**
|
@@ -8628,8 +8566,8 @@ var meeting;
|
|
8628
8566
|
if (!handler) {
|
8629
8567
|
throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');
|
8630
8568
|
}
|
8631
|
-
|
8632
|
-
|
8569
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8570
|
+
registerHandler(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterSpeakingStateChangeHandler), 'meeting.speakingStateChanged', handler);
|
8633
8571
|
}
|
8634
8572
|
meeting.registerSpeakingStateChangeHandler = registerSpeakingStateChangeHandler;
|
8635
8573
|
/**
|
@@ -8652,8 +8590,8 @@ var meeting;
|
|
8652
8590
|
if (!handler) {
|
8653
8591
|
throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');
|
8654
8592
|
}
|
8655
|
-
|
8656
|
-
|
8593
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8594
|
+
registerHandler(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterRaiseHandStateChangedHandler), 'meeting.raiseHandStateChanged', handler);
|
8657
8595
|
}
|
8658
8596
|
meeting.registerRaiseHandStateChangedHandler = registerRaiseHandStateChangedHandler;
|
8659
8597
|
/**
|
@@ -8674,8 +8612,8 @@ var meeting;
|
|
8674
8612
|
if (!handler) {
|
8675
8613
|
throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');
|
8676
8614
|
}
|
8677
|
-
|
8678
|
-
|
8615
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8616
|
+
registerHandler(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterMeetingReactionReceivedHandler), 'meeting.meetingReactionReceived', handler);
|
8679
8617
|
}
|
8680
8618
|
meeting.registerMeetingReactionReceivedHandler = registerMeetingReactionReceivedHandler;
|
8681
8619
|
/**
|
@@ -8709,11 +8647,11 @@ var meeting;
|
|
8709
8647
|
* @beta
|
8710
8648
|
*/
|
8711
8649
|
function setOptions(shareInformation) {
|
8712
|
-
|
8650
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
8713
8651
|
if (shareInformation.contentUrl) {
|
8714
8652
|
new URL(shareInformation.contentUrl);
|
8715
8653
|
}
|
8716
|
-
|
8654
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_AppShareButton_SetOptions), 'meeting.appShareButton.setOptions', [shareInformation]);
|
8717
8655
|
}
|
8718
8656
|
appShareButton.setOptions = setOptions;
|
8719
8657
|
})(appShareButton = meeting.appShareButton || (meeting.appShareButton = {}));
|
@@ -8749,7 +8687,7 @@ var meeting;
|
|
8749
8687
|
if (!requestAppAudioHandlingParams.micMuteStateChangedCallback) {
|
8750
8688
|
throw new Error('[requestAppAudioHandling] Callback Mic mute state handler cannot be null');
|
8751
8689
|
}
|
8752
|
-
|
8690
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8753
8691
|
if (requestAppAudioHandlingParams.isAppHandlingAudio) {
|
8754
8692
|
startAppAudioHandling(requestAppAudioHandlingParams, callback);
|
8755
8693
|
}
|
@@ -8779,15 +8717,15 @@ var meeting;
|
|
8779
8717
|
setMicStateWithReason(micState, MicStateChangeReason.AppFailedToChange);
|
8780
8718
|
}
|
8781
8719
|
});
|
8782
|
-
|
8720
|
+
registerHandler(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterMicStateChangeHandler), 'meeting.micStateChanged', micStateChangedCallback);
|
8783
8721
|
const audioDeviceSelectionChangedCallback = (selectedDevicesInHost) => {
|
8784
8722
|
var _a;
|
8785
8723
|
(_a = requestAppAudioHandlingParams.audioDeviceSelectionChangedCallback) === null || _a === void 0 ? void 0 : _a.call(requestAppAudioHandlingParams, selectedDevicesInHost);
|
8786
8724
|
};
|
8787
|
-
|
8725
|
+
registerHandler(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterAudioDeviceSelectionChangedHandler), 'meeting.audioDeviceSelectionChanged', audioDeviceSelectionChangedCallback);
|
8788
8726
|
callback(isHostAudioless);
|
8789
8727
|
};
|
8790
|
-
|
8728
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestAppAudioHandling), 'meeting.requestAppAudioHandling', [requestAppAudioHandlingParams.isAppHandlingAudio], callbackInternalRequest);
|
8791
8729
|
}
|
8792
8730
|
function stopAppAudioHandling(requestAppAudioHandlingParams, callback) {
|
8793
8731
|
const callbackInternalStop = (error, isHostAudioless) => {
|
@@ -8808,7 +8746,7 @@ var meeting;
|
|
8808
8746
|
}
|
8809
8747
|
callback(isHostAudioless);
|
8810
8748
|
};
|
8811
|
-
|
8749
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestAppAudioHandling), 'meeting.requestAppAudioHandling', [requestAppAudioHandlingParams.isAppHandlingAudio], callbackInternalStop);
|
8812
8750
|
}
|
8813
8751
|
/**
|
8814
8752
|
* Notifies the host that the microphone state has changed in the app.
|
@@ -8828,8 +8766,8 @@ var meeting;
|
|
8828
8766
|
}
|
8829
8767
|
meeting.updateMicState = updateMicState;
|
8830
8768
|
function setMicStateWithReason(micState, reason) {
|
8831
|
-
|
8832
|
-
|
8769
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
8770
|
+
sendMessageToParent(getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_SetMicStateWithReason), 'meeting.updateMicState', [micState, reason]);
|
8833
8771
|
}
|
8834
8772
|
})(meeting || (meeting = {}));
|
8835
8773
|
|
@@ -8882,10 +8820,10 @@ var monetization;
|
|
8882
8820
|
throw errorNotSupportedOnPlatform;
|
8883
8821
|
}
|
8884
8822
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
8885
|
-
resolve(
|
8823
|
+
resolve(sendAndHandleSdkError(apiVersionTag, 'monetization.openPurchaseExperience', planInfo));
|
8886
8824
|
});
|
8887
8825
|
};
|
8888
|
-
|
8826
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8889
8827
|
return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);
|
8890
8828
|
}
|
8891
8829
|
monetization.openPurchaseExperience = openPurchaseExperience;
|
@@ -8898,7 +8836,7 @@ var monetization;
|
|
8898
8836
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
8899
8837
|
*/
|
8900
8838
|
function isSupported() {
|
8901
|
-
return
|
8839
|
+
return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;
|
8902
8840
|
}
|
8903
8841
|
monetization.isSupported = isSupported;
|
8904
8842
|
})(monetization || (monetization = {}));
|
@@ -8926,14 +8864,14 @@ var calendar;
|
|
8926
8864
|
*/
|
8927
8865
|
function openCalendarItem(openCalendarItemParams) {
|
8928
8866
|
return new Promise((resolve) => {
|
8929
|
-
|
8867
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8930
8868
|
if (!isSupported()) {
|
8931
8869
|
throw new Error('Not supported');
|
8932
8870
|
}
|
8933
8871
|
if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {
|
8934
8872
|
throw new Error('Must supply an itemId to openCalendarItem');
|
8935
8873
|
}
|
8936
|
-
resolve(
|
8874
|
+
resolve(sendAndHandleStatusAndReason(getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_OpenCalendarItem), 'calendar.openCalendarItem', openCalendarItemParams));
|
8937
8875
|
});
|
8938
8876
|
}
|
8939
8877
|
calendar.openCalendarItem = openCalendarItem;
|
@@ -8944,16 +8882,16 @@ var calendar;
|
|
8944
8882
|
*/
|
8945
8883
|
function composeMeeting(composeMeetingParams) {
|
8946
8884
|
return new Promise((resolve) => {
|
8947
|
-
|
8885
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8948
8886
|
if (!isSupported()) {
|
8949
8887
|
throw new Error('Not supported');
|
8950
8888
|
}
|
8951
8889
|
const apiVersionTag = getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_ComposeMeeting);
|
8952
|
-
if (
|
8953
|
-
resolve(
|
8890
|
+
if (runtime.isLegacyTeams) {
|
8891
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
|
8954
8892
|
}
|
8955
8893
|
else {
|
8956
|
-
resolve(
|
8894
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'calendar.composeMeeting', composeMeetingParams));
|
8957
8895
|
}
|
8958
8896
|
});
|
8959
8897
|
}
|
@@ -8965,7 +8903,7 @@ var calendar;
|
|
8965
8903
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
8966
8904
|
*/
|
8967
8905
|
function isSupported() {
|
8968
|
-
return
|
8906
|
+
return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
|
8969
8907
|
}
|
8970
8908
|
calendar.isSupported = isSupported;
|
8971
8909
|
})(calendar || (calendar = {}));
|
@@ -8992,14 +8930,14 @@ var mail;
|
|
8992
8930
|
*/
|
8993
8931
|
function openMailItem(openMailItemParams) {
|
8994
8932
|
return new Promise((resolve) => {
|
8995
|
-
|
8933
|
+
ensureInitialized(runtime, FrameContexts.content);
|
8996
8934
|
if (!isSupported()) {
|
8997
8935
|
throw new Error('Not supported');
|
8998
8936
|
}
|
8999
8937
|
if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {
|
9000
8938
|
throw new Error('Must supply an itemId to openMailItem');
|
9001
8939
|
}
|
9002
|
-
resolve(
|
8940
|
+
resolve(sendAndHandleStatusAndReason(getApiVersionTag(mailTelemetryVersionNumber, ApiName.Mail_OpenMailItem), 'mail.openMailItem', openMailItemParams));
|
9003
8941
|
});
|
9004
8942
|
}
|
9005
8943
|
mail.openMailItem = openMailItem;
|
@@ -9011,11 +8949,11 @@ var mail;
|
|
9011
8949
|
*/
|
9012
8950
|
function composeMail(composeMailParams) {
|
9013
8951
|
return new Promise((resolve) => {
|
9014
|
-
|
8952
|
+
ensureInitialized(runtime, FrameContexts.content);
|
9015
8953
|
if (!isSupported()) {
|
9016
8954
|
throw new Error('Not supported');
|
9017
8955
|
}
|
9018
|
-
resolve(
|
8956
|
+
resolve(sendAndHandleStatusAndReason(getApiVersionTag(mailTelemetryVersionNumber, ApiName.Mail_ComposeMail), 'mail.composeMail', composeMailParams));
|
9019
8957
|
});
|
9020
8958
|
}
|
9021
8959
|
mail.composeMail = composeMail;
|
@@ -9026,7 +8964,7 @@ var mail;
|
|
9026
8964
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
9027
8965
|
*/
|
9028
8966
|
function isSupported() {
|
9029
|
-
return
|
8967
|
+
return ensureInitialized(runtime) && runtime.supports.mail ? true : false;
|
9030
8968
|
}
|
9031
8969
|
mail.isSupported = isSupported;
|
9032
8970
|
/** Defines compose mail types. */
|
@@ -9051,9 +8989,13 @@ var mail;
|
|
9051
8989
|
|
9052
8990
|
|
9053
8991
|
|
8992
|
+
|
9054
8993
|
/**
|
9055
8994
|
* Namespace containing the set of APIs that support Teams-specific functionalities.
|
8995
|
+
*
|
8996
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
9056
8997
|
*/
|
8998
|
+
const teamsAPIsTelemetryVersionNumber_v2 = ApiVersionNumber.V_2;
|
9057
8999
|
var teamsCore;
|
9058
9000
|
(function (teamsCore) {
|
9059
9001
|
/**
|
@@ -9061,7 +9003,7 @@ var teamsCore;
|
|
9061
9003
|
*/
|
9062
9004
|
function enablePrintCapability() {
|
9063
9005
|
if (!GlobalVars.printCapabilityEnabled) {
|
9064
|
-
|
9006
|
+
ensureInitialized(runtime);
|
9065
9007
|
if (!isSupported()) {
|
9066
9008
|
throw errorNotSupportedOnPlatform;
|
9067
9009
|
}
|
@@ -9088,7 +9030,7 @@ var teamsCore;
|
|
9088
9030
|
/**
|
9089
9031
|
* Registers a handler to be called when the page has been requested to load.
|
9090
9032
|
*
|
9091
|
-
* @remarks Check out [App Caching in Teams](https://learn.microsoft.com/
|
9033
|
+
* @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)
|
9092
9034
|
* for a more detailed explanation about using this API.
|
9093
9035
|
*
|
9094
9036
|
* @param handler - The handler to invoke when the page is loaded.
|
@@ -9096,7 +9038,7 @@ var teamsCore;
|
|
9096
9038
|
* @beta
|
9097
9039
|
*/
|
9098
9040
|
function registerOnLoadHandler(handler) {
|
9099
|
-
registerOnLoadHandlerHelper(handler, () => {
|
9041
|
+
registerOnLoadHandlerHelper(getApiVersionTag(teamsAPIsTelemetryVersionNumber_v2, ApiName.TeamsAPIs_RegisterOnLoadHandler), handler, () => {
|
9100
9042
|
if (!isNullOrUndefined(handler) && !isSupported()) {
|
9101
9043
|
throw errorNotSupportedOnPlatform;
|
9102
9044
|
}
|
@@ -9110,24 +9052,25 @@ var teamsCore;
|
|
9110
9052
|
* @internal
|
9111
9053
|
* Limited to Microsoft-internal use
|
9112
9054
|
*
|
9055
|
+
* @param apiVersionTag - The tag indicating API version number with name
|
9113
9056
|
* @param handler - The handler to invoke when the page is loaded.
|
9114
9057
|
* @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
|
9115
9058
|
*
|
9116
9059
|
* @deprecated
|
9117
9060
|
*/
|
9118
|
-
function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
|
9061
|
+
function registerOnLoadHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
|
9119
9062
|
// allow for registration cleanup even when not finished initializing
|
9120
|
-
!isNullOrUndefined(handler) &&
|
9063
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
9121
9064
|
if (!isNullOrUndefined(handler) && versionSpecificHelper) {
|
9122
9065
|
versionSpecificHelper();
|
9123
9066
|
}
|
9124
|
-
handlers_registerOnLoadHandler(handler);
|
9067
|
+
handlers_registerOnLoadHandler(apiVersionTag, handler);
|
9125
9068
|
}
|
9126
9069
|
teamsCore.registerOnLoadHandlerHelper = registerOnLoadHandlerHelper;
|
9127
9070
|
/**
|
9128
9071
|
* Registers a handler to be called before the page is unloaded.
|
9129
9072
|
*
|
9130
|
-
* @remarks Check out [App Caching in Teams](https://learn.microsoft.com/
|
9073
|
+
* @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)
|
9131
9074
|
* for a more detailed explanation about using this API.
|
9132
9075
|
*
|
9133
9076
|
* @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
|
@@ -9136,7 +9079,7 @@ var teamsCore;
|
|
9136
9079
|
* @beta
|
9137
9080
|
*/
|
9138
9081
|
function registerBeforeUnloadHandler(handler) {
|
9139
|
-
registerBeforeUnloadHandlerHelper(handler, () => {
|
9082
|
+
registerBeforeUnloadHandlerHelper(getApiVersionTag(teamsAPIsTelemetryVersionNumber_v2, ApiName.TeamsAPIs_RegisterBeforeUnloadHandler), handler, () => {
|
9140
9083
|
if (!isNullOrUndefined(handler) && !isSupported()) {
|
9141
9084
|
throw errorNotSupportedOnPlatform;
|
9142
9085
|
}
|
@@ -9156,13 +9099,13 @@ var teamsCore;
|
|
9156
9099
|
*
|
9157
9100
|
* @deprecated
|
9158
9101
|
*/
|
9159
|
-
function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
|
9102
|
+
function registerBeforeUnloadHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
|
9160
9103
|
// allow for registration cleanup even when not finished initializing
|
9161
|
-
!isNullOrUndefined(handler) &&
|
9104
|
+
!isNullOrUndefined(handler) && ensureInitialized(runtime);
|
9162
9105
|
if (!isNullOrUndefined(handler) && versionSpecificHelper) {
|
9163
9106
|
versionSpecificHelper();
|
9164
9107
|
}
|
9165
|
-
handlers_registerBeforeUnloadHandler(handler);
|
9108
|
+
handlers_registerBeforeUnloadHandler(apiVersionTag, handler);
|
9166
9109
|
}
|
9167
9110
|
teamsCore.registerBeforeUnloadHandlerHelper = registerBeforeUnloadHandlerHelper;
|
9168
9111
|
/**
|
@@ -9174,7 +9117,7 @@ var teamsCore;
|
|
9174
9117
|
*
|
9175
9118
|
*/
|
9176
9119
|
function isSupported() {
|
9177
|
-
return
|
9120
|
+
return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
|
9178
9121
|
}
|
9179
9122
|
teamsCore.isSupported = isSupported;
|
9180
9123
|
})(teamsCore || (teamsCore = {}));
|
@@ -9208,7 +9151,7 @@ var people;
|
|
9208
9151
|
* @returns Promise of Array of PeoplePickerResult objects.
|
9209
9152
|
*/
|
9210
9153
|
function selectPeople(param1, param2) {
|
9211
|
-
|
9154
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
|
9212
9155
|
let callback = undefined;
|
9213
9156
|
let peoplePickerInputs = undefined;
|
9214
9157
|
let apiVersionTag = '';
|
@@ -9235,7 +9178,7 @@ var people;
|
|
9235
9178
|
throw errorNotSupportedOnPlatform;
|
9236
9179
|
}
|
9237
9180
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
9238
|
-
resolve(
|
9181
|
+
resolve(sendAndHandleSdkError(apiVersionTag, 'people.selectPeople', peoplePickerInputs));
|
9239
9182
|
});
|
9240
9183
|
}
|
9241
9184
|
/**
|
@@ -9245,7 +9188,7 @@ var people;
|
|
9245
9188
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
9246
9189
|
*/
|
9247
9190
|
function isSupported() {
|
9248
|
-
return
|
9191
|
+
return ensureInitialized(runtime) && runtime.supports.people ? true : false;
|
9249
9192
|
}
|
9250
9193
|
people_1.isSupported = isSupported;
|
9251
9194
|
})(people || (people = {}));
|
@@ -9340,7 +9283,7 @@ var profile;
|
|
9340
9283
|
* @beta
|
9341
9284
|
*/
|
9342
9285
|
function showProfile(showProfileRequest) {
|
9343
|
-
|
9286
|
+
ensureInitialized(runtime, FrameContexts.content);
|
9344
9287
|
return new Promise((resolve) => {
|
9345
9288
|
const [isValid, message] = validateShowProfileRequest(showProfileRequest);
|
9346
9289
|
if (!isValid) {
|
@@ -9358,7 +9301,7 @@ var profile;
|
|
9358
9301
|
height: showProfileRequest.targetElementBoundingRect.height,
|
9359
9302
|
},
|
9360
9303
|
};
|
9361
|
-
resolve(
|
9304
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(profileTelemetryVersionNumber, ApiName.Profile_ShowProfile), 'profile.showProfile', requestInternal));
|
9362
9305
|
});
|
9363
9306
|
}
|
9364
9307
|
profile.showProfile = showProfile;
|
@@ -9371,7 +9314,7 @@ var profile;
|
|
9371
9314
|
* @beta
|
9372
9315
|
*/
|
9373
9316
|
function isSupported() {
|
9374
|
-
return
|
9317
|
+
return ensureInitialized(runtime) && runtime.supports.profile ? true : false;
|
9375
9318
|
}
|
9376
9319
|
profile.isSupported = isSupported;
|
9377
9320
|
})(profile || (profile = {}));
|
@@ -9667,7 +9610,7 @@ class TransformerWithMetadata {
|
|
9667
9610
|
// The rectangle of pixels to copy from the texture. The first two rows are the header.
|
9668
9611
|
const headerRect = { x: 0, y: 0, width: texture.codedWidth, height: 2 };
|
9669
9612
|
// allocate buffer for the header
|
9670
|
-
// The texture is in NV12 format (https://learn.microsoft.com/
|
9613
|
+
// The texture is in NV12 format (https://learn.microsoft.com/windows/win32/medfound/recommended-8-bit-yuv-formats-for-video-rendering#nv12).
|
9671
9614
|
// NV12 has one luma "luminance" plane Y and one UV plane with U and V values interleaved.
|
9672
9615
|
// In NV12, chroma planes (blue and red) are subsampled in both the horizontal and vertical dimensions by a factor of 2.
|
9673
9616
|
// So for a 2×2 group of pixels, you have 4 Y samples and 1 U and 1 V sample, each sample being 1 byte.
|
@@ -9711,7 +9654,7 @@ class TransformerWithMetadata {
|
|
9711
9654
|
},
|
9712
9655
|
};
|
9713
9656
|
});
|
9714
|
-
|
9657
|
+
registerHandler(getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_TransformerWithMetadata_Constructor), 'video.mediaStream.audioInferenceDiscardStatusChange', ({ discardAudioInferenceResult }) => {
|
9715
9658
|
this.shouldDiscardAudioInferenceResult = discardAudioInferenceResult;
|
9716
9659
|
});
|
9717
9660
|
}
|
@@ -9725,11 +9668,11 @@ function createEffectParameterChangeCallback(callback, videoPerformanceMonitor)
|
|
9725
9668
|
callback(effectId, effectParam)
|
9726
9669
|
.then(() => {
|
9727
9670
|
videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportVideoEffectChanged(effectId || '', effectParam);
|
9728
|
-
|
9671
|
+
sendMessageToParent(getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_ReportVideoEffectChanged), 'video.videoEffectReadiness', [true, effectId, undefined, effectParam]);
|
9729
9672
|
})
|
9730
9673
|
.catch((reason) => {
|
9731
9674
|
const validReason = reason in videoEffects.EffectFailureReason ? reason : videoEffects.EffectFailureReason.InitializationFailure;
|
9732
|
-
|
9675
|
+
sendMessageToParent(getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_EffectFailure), 'video.videoEffectReadiness', [false, effectId, validReason, effectParam]);
|
9733
9676
|
});
|
9734
9677
|
};
|
9735
9678
|
}
|
@@ -10031,7 +9974,7 @@ var videoEffects;
|
|
10031
9974
|
(function (videoEffects) {
|
10032
9975
|
const videoPerformanceMonitor = inServerSideRenderingEnvironment()
|
10033
9976
|
? undefined
|
10034
|
-
: new VideoPerformanceMonitor(
|
9977
|
+
: new VideoPerformanceMonitor(sendMessageToParent);
|
10035
9978
|
/**
|
10036
9979
|
* Video frame format enum, currently only support NV12
|
10037
9980
|
* @beta
|
@@ -10110,14 +10053,14 @@ var videoEffects;
|
|
10110
10053
|
* ```
|
10111
10054
|
*/
|
10112
10055
|
function registerForVideoFrame(parameters) {
|
10113
|
-
|
10056
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
10114
10057
|
if (!isSupported()) {
|
10115
10058
|
throw errorNotSupportedOnPlatform;
|
10116
10059
|
}
|
10117
10060
|
if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {
|
10118
10061
|
throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');
|
10119
10062
|
}
|
10120
|
-
|
10063
|
+
registerHandler(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterSetFrameProcessTimeLimitHandler), 'video.setFrameProcessTimeLimit', (timeLimitInfo) => videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimitInfo.timeLimit), false);
|
10121
10064
|
if (doesSupportMediaStream()) {
|
10122
10065
|
registerForMediaStream(parameters.videoFrameHandler, parameters.config);
|
10123
10066
|
}
|
@@ -10140,11 +10083,11 @@ var videoEffects;
|
|
10140
10083
|
* @param effectId - Newly selected effect id.
|
10141
10084
|
*/
|
10142
10085
|
function notifySelectedVideoEffectChanged(effectChangeType, effectId) {
|
10143
|
-
|
10086
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
10144
10087
|
if (!isSupported()) {
|
10145
10088
|
throw errorNotSupportedOnPlatform;
|
10146
10089
|
}
|
10147
|
-
|
10090
|
+
sendMessageToParent(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifySelectedVideoEffectChanged), 'video.videoEffectChanged', [effectChangeType, effectId]);
|
10148
10091
|
}
|
10149
10092
|
videoEffects.notifySelectedVideoEffectChanged = notifySelectedVideoEffectChanged;
|
10150
10093
|
/**
|
@@ -10153,12 +10096,12 @@ var videoEffects;
|
|
10153
10096
|
* @param callback - Function to be called when new video effect is applied.
|
10154
10097
|
*/
|
10155
10098
|
function registerForVideoEffect(callback) {
|
10156
|
-
|
10099
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
10157
10100
|
if (!isSupported()) {
|
10158
10101
|
throw errorNotSupportedOnPlatform;
|
10159
10102
|
}
|
10160
|
-
|
10161
|
-
|
10103
|
+
registerHandler(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterEffectParameterChangeHandler), 'video.effectParameterChange', createEffectParameterChangeCallback(callback, videoPerformanceMonitor), false);
|
10104
|
+
sendMessageToParent(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoEffect), 'video.registerForVideoEffect');
|
10162
10105
|
}
|
10163
10106
|
videoEffects.registerForVideoEffect = registerForVideoEffect;
|
10164
10107
|
/**
|
@@ -10167,7 +10110,7 @@ var videoEffects;
|
|
10167
10110
|
* @beta
|
10168
10111
|
*/
|
10169
10112
|
function notifyVideoFrameProcessed(timestamp) {
|
10170
|
-
|
10113
|
+
sendMessageToParent(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifyVideoFrameProcessed), 'video.videoFrameProcessed', [timestamp]);
|
10171
10114
|
}
|
10172
10115
|
/**
|
10173
10116
|
* Sending error notification to host
|
@@ -10175,7 +10118,7 @@ var videoEffects;
|
|
10175
10118
|
* @param errorMessage - The error message that will be sent to the host
|
10176
10119
|
*/
|
10177
10120
|
function notifyError(errorMessage) {
|
10178
|
-
|
10121
|
+
sendMessageToParent(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifyError), 'video.notifyError', [errorMessage]);
|
10179
10122
|
}
|
10180
10123
|
/**
|
10181
10124
|
* Checks if video capability is supported by the host.
|
@@ -10186,24 +10129,24 @@ var videoEffects;
|
|
10186
10129
|
*
|
10187
10130
|
*/
|
10188
10131
|
function isSupported() {
|
10189
|
-
return (
|
10190
|
-
!!
|
10132
|
+
return (ensureInitialized(runtime) &&
|
10133
|
+
!!runtime.supports.video &&
|
10191
10134
|
/** A host should support either mediaStream or sharedFrame sub-capability to support the video capability */
|
10192
|
-
(!!
|
10135
|
+
(!!runtime.supports.video.mediaStream || !!runtime.supports.video.sharedFrame));
|
10193
10136
|
}
|
10194
10137
|
videoEffects.isSupported = isSupported;
|
10195
10138
|
function registerForMediaStream(videoFrameHandler, config) {
|
10196
|
-
|
10139
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
10197
10140
|
if (!isSupported() || !doesSupportMediaStream()) {
|
10198
10141
|
throw errorNotSupportedOnPlatform;
|
10199
10142
|
}
|
10200
|
-
|
10143
|
+
registerHandler(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterStartVideoExtensibilityVideoStreamHandler), 'video.startVideoExtensibilityVideoStream', (mediaStreamInfo) => videoEffects_awaiter(this, void 0, void 0, function* () {
|
10201
10144
|
// when a new streamId is ready:
|
10202
10145
|
const { streamId } = mediaStreamInfo;
|
10203
10146
|
const monitoredVideoFrameHandler = createMonitoredVideoFrameHandler(videoFrameHandler, videoPerformanceMonitor);
|
10204
10147
|
yield processMediaStream(streamId, monitoredVideoFrameHandler, notifyError, videoPerformanceMonitor);
|
10205
10148
|
}), false);
|
10206
|
-
|
10149
|
+
sendMessageToParent(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_MediaStream_RegisterForVideoFrame), 'video.mediaStream.registerForVideoFrame', [config]);
|
10207
10150
|
}
|
10208
10151
|
function createMonitoredVideoFrameHandler(videoFrameHandler, videoPerformanceMonitor) {
|
10209
10152
|
return (videoFrameData) => videoEffects_awaiter(this, void 0, void 0, function* () {
|
@@ -10216,11 +10159,11 @@ var videoEffects;
|
|
10216
10159
|
});
|
10217
10160
|
}
|
10218
10161
|
function registerForVideoBuffer(videoBufferHandler, config) {
|
10219
|
-
|
10162
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
10220
10163
|
if (!isSupported() || !doesSupportSharedFrame()) {
|
10221
10164
|
throw errorNotSupportedOnPlatform;
|
10222
10165
|
}
|
10223
|
-
|
10166
|
+
registerHandler(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoBufferHandler), 'video.newVideoFrame',
|
10224
10167
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
10225
10168
|
(videoBufferData) => {
|
10226
10169
|
if (videoBufferData) {
|
@@ -10232,7 +10175,7 @@ var videoEffects;
|
|
10232
10175
|
}, notifyError);
|
10233
10176
|
}
|
10234
10177
|
}, false);
|
10235
|
-
|
10178
|
+
sendMessageToParent(getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoFrame), 'video.registerForVideoFrame', [config]);
|
10236
10179
|
}
|
10237
10180
|
function normalizeVideoBufferData(videoBufferData) {
|
10238
10181
|
if ('videoFrameBuffer' in videoBufferData) {
|
@@ -10246,9 +10189,9 @@ var videoEffects;
|
|
10246
10189
|
}
|
10247
10190
|
function doesSupportMediaStream() {
|
10248
10191
|
var _a;
|
10249
|
-
return (
|
10192
|
+
return (ensureInitialized(runtime, FrameContexts.sidePanel) &&
|
10250
10193
|
isTextureStreamAvailable() &&
|
10251
|
-
!!((_a =
|
10194
|
+
!!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream));
|
10252
10195
|
}
|
10253
10196
|
function isTextureStreamAvailable() {
|
10254
10197
|
var _a, _b, _c, _d;
|
@@ -10256,7 +10199,7 @@ var videoEffects;
|
|
10256
10199
|
}
|
10257
10200
|
function doesSupportSharedFrame() {
|
10258
10201
|
var _a;
|
10259
|
-
return
|
10202
|
+
return ensureInitialized(runtime, FrameContexts.sidePanel) && !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.sharedFrame);
|
10260
10203
|
}
|
10261
10204
|
})(videoEffects || (videoEffects = {})); //end of video namespace
|
10262
10205
|
|
@@ -10326,14 +10269,14 @@ var search;
|
|
10326
10269
|
* @beta
|
10327
10270
|
*/
|
10328
10271
|
function registerHandlers(onClosedHandler, onExecuteHandler, onChangeHandler) {
|
10329
|
-
|
10272
|
+
ensureInitialized(runtime, FrameContexts.content);
|
10330
10273
|
if (!isSupported()) {
|
10331
10274
|
throw errorNotSupportedOnPlatform;
|
10332
10275
|
}
|
10333
|
-
|
10334
|
-
|
10276
|
+
registerHandler(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnClosedHandler), onClosedHandlerName, onClosedHandler);
|
10277
|
+
registerHandler(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnExecutedHandler), onExecutedHandlerName, onExecuteHandler);
|
10335
10278
|
if (onChangeHandler) {
|
10336
|
-
|
10279
|
+
registerHandler(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnChangeHandler), onChangeHandlerName, onChangeHandler);
|
10337
10280
|
}
|
10338
10281
|
}
|
10339
10282
|
search.registerHandlers = registerHandlers;
|
@@ -10344,13 +10287,13 @@ var search;
|
|
10344
10287
|
* @beta
|
10345
10288
|
*/
|
10346
10289
|
function unregisterHandlers() {
|
10347
|
-
|
10290
|
+
ensureInitialized(runtime, FrameContexts.content);
|
10348
10291
|
if (!isSupported()) {
|
10349
10292
|
throw errorNotSupportedOnPlatform;
|
10350
10293
|
}
|
10351
10294
|
// This should let the host know to stop making the app scope show up in the search experience
|
10352
10295
|
// Can also be used to clean up handlers on the host if desired
|
10353
|
-
|
10296
|
+
sendMessageToParent(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_UnregisterHandlers), 'search.unregister');
|
10354
10297
|
removeHandler(onChangeHandlerName);
|
10355
10298
|
removeHandler(onClosedHandlerName);
|
10356
10299
|
removeHandler(onExecutedHandlerName);
|
@@ -10365,7 +10308,7 @@ var search;
|
|
10365
10308
|
* @beta
|
10366
10309
|
*/
|
10367
10310
|
function isSupported() {
|
10368
|
-
return
|
10311
|
+
return ensureInitialized(runtime) && runtime.supports.search ? true : false;
|
10369
10312
|
}
|
10370
10313
|
search.isSupported = isSupported;
|
10371
10314
|
/**
|
@@ -10375,11 +10318,11 @@ var search;
|
|
10375
10318
|
*/
|
10376
10319
|
function closeSearch() {
|
10377
10320
|
return new Promise((resolve) => {
|
10378
|
-
|
10321
|
+
ensureInitialized(runtime, FrameContexts.content);
|
10379
10322
|
if (!isSupported()) {
|
10380
10323
|
throw new Error('Not supported');
|
10381
10324
|
}
|
10382
|
-
resolve(
|
10325
|
+
resolve(sendAndHandleStatusAndReason(getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_CloseSearch), 'search.closeSearch'));
|
10383
10326
|
});
|
10384
10327
|
}
|
10385
10328
|
search.closeSearch = closeSearch;
|
@@ -10393,7 +10336,6 @@ var search;
|
|
10393
10336
|
|
10394
10337
|
|
10395
10338
|
|
10396
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
10397
10339
|
const sharingTelemetryVersionNumber_v1 = ApiVersionNumber.V_1;
|
10398
10340
|
const sharingTelemetryVersionNumber_v2 = ApiVersionNumber.V_2;
|
10399
10341
|
/**
|
@@ -10411,7 +10353,6 @@ var sharing;
|
|
10411
10353
|
shareWebContent: 'sharing.shareWebContent',
|
10412
10354
|
};
|
10413
10355
|
function shareWebContent(shareWebContentRequest, callback) {
|
10414
|
-
const apiVersionTag = '';
|
10415
10356
|
// validate the given input (synchronous check)
|
10416
10357
|
try {
|
10417
10358
|
validateNonEmptyContent(shareWebContentRequest);
|
@@ -10423,16 +10364,19 @@ var sharing;
|
|
10423
10364
|
const wrappedFunction = () => Promise.reject(err);
|
10424
10365
|
return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);
|
10425
10366
|
}
|
10426
|
-
|
10427
|
-
|
10367
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
10368
|
+
const apiVersionTag = callback
|
10369
|
+
? getApiVersionTag(sharingTelemetryVersionNumber_v1, ApiName.Sharing_ShareWebContent)
|
10370
|
+
: getApiVersionTag(sharingTelemetryVersionNumber_v2, ApiName.Sharing_ShareWebContent);
|
10371
|
+
return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, apiVersionTag, shareWebContentRequest);
|
10428
10372
|
}
|
10429
10373
|
sharing.shareWebContent = shareWebContent;
|
10430
|
-
function shareWebContentHelper(shareWebContentRequest) {
|
10374
|
+
function shareWebContentHelper(apiVersionTag, shareWebContentRequest) {
|
10431
10375
|
return new Promise((resolve) => {
|
10432
10376
|
if (!isSupported()) {
|
10433
10377
|
throw errorNotSupportedOnPlatform;
|
10434
10378
|
}
|
10435
|
-
resolve(sendAndHandleSdkError(sharing.SharingAPIMessages.shareWebContent, shareWebContentRequest));
|
10379
|
+
resolve(sendAndHandleSdkError(apiVersionTag, sharing.SharingAPIMessages.shareWebContent, shareWebContentRequest));
|
10436
10380
|
});
|
10437
10381
|
}
|
10438
10382
|
/**
|
@@ -10490,7 +10434,7 @@ var sharing;
|
|
10490
10434
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
10491
10435
|
*/
|
10492
10436
|
function isSupported() {
|
10493
|
-
return
|
10437
|
+
return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;
|
10494
10438
|
}
|
10495
10439
|
sharing.isSupported = isSupported;
|
10496
10440
|
})(sharing || (sharing = {}));
|
@@ -10541,14 +10485,14 @@ var stageView;
|
|
10541
10485
|
*/
|
10542
10486
|
function open(stageViewParams) {
|
10543
10487
|
return new Promise((resolve) => {
|
10544
|
-
|
10488
|
+
ensureInitialized(runtime, FrameContexts.content);
|
10545
10489
|
if (!isSupported()) {
|
10546
10490
|
throw errorNotSupportedOnPlatform;
|
10547
10491
|
}
|
10548
10492
|
if (!stageViewParams) {
|
10549
10493
|
throw new Error('[stageView.open] Stage view params cannot be null');
|
10550
10494
|
}
|
10551
|
-
resolve(
|
10495
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(stageViewTelemetryVersionNumber, ApiName.StageView_Open), 'stageView.open', stageViewParams));
|
10552
10496
|
});
|
10553
10497
|
}
|
10554
10498
|
stageView.open = open;
|
@@ -10561,7 +10505,7 @@ var stageView;
|
|
10561
10505
|
*
|
10562
10506
|
*/
|
10563
10507
|
function isSupported() {
|
10564
|
-
return
|
10508
|
+
return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;
|
10565
10509
|
}
|
10566
10510
|
stageView.isSupported = isSupported;
|
10567
10511
|
})(stageView || (stageView = {}));
|
@@ -10634,12 +10578,12 @@ var visualMedia;
|
|
10634
10578
|
* @beta
|
10635
10579
|
*/
|
10636
10580
|
function hasPermission() {
|
10637
|
-
|
10581
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
10638
10582
|
if (!image.isSupported()) {
|
10639
10583
|
throw errorNotSupportedOnPlatform;
|
10640
10584
|
}
|
10641
10585
|
const permissions = DevicePermission.Media;
|
10642
|
-
return
|
10586
|
+
return sendAndHandleSdkError(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_HasPermission), 'permissions.has', permissions);
|
10643
10587
|
}
|
10644
10588
|
visualMedia.hasPermission = hasPermission;
|
10645
10589
|
/**
|
@@ -10652,12 +10596,12 @@ var visualMedia;
|
|
10652
10596
|
* @beta
|
10653
10597
|
*/
|
10654
10598
|
function requestPermission() {
|
10655
|
-
|
10599
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
10656
10600
|
if (!image.isSupported()) {
|
10657
10601
|
throw errorNotSupportedOnPlatform;
|
10658
10602
|
}
|
10659
10603
|
const permissions = DevicePermission.Media;
|
10660
|
-
return
|
10604
|
+
return sendAndHandleSdkError(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_RequestPermission), 'permissions.request', permissions);
|
10661
10605
|
}
|
10662
10606
|
visualMedia.requestPermission = requestPermission;
|
10663
10607
|
/**
|
@@ -10679,10 +10623,10 @@ var visualMedia;
|
|
10679
10623
|
*/
|
10680
10624
|
function captureImages(cameraImageInputs) {
|
10681
10625
|
return visualMedia_awaiter(this, void 0, void 0, function* () {
|
10682
|
-
|
10626
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
10683
10627
|
ensureSupported();
|
10684
10628
|
ensureImageInputValid(cameraImageInputs);
|
10685
|
-
const files = yield
|
10629
|
+
const files = yield sendAndHandleSdkError(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_Image_CaptureImages), 'visualMedia.image.captureImages', cameraImageInputs);
|
10686
10630
|
ensureResponseValid(cameraImageInputs.maxVisualMediaCount, files);
|
10687
10631
|
return files;
|
10688
10632
|
});
|
@@ -10699,10 +10643,10 @@ var visualMedia;
|
|
10699
10643
|
*/
|
10700
10644
|
function retrieveImages(galleryImageInputs) {
|
10701
10645
|
return visualMedia_awaiter(this, void 0, void 0, function* () {
|
10702
|
-
|
10646
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
10703
10647
|
ensureSupported();
|
10704
10648
|
ensureImageInputValid(galleryImageInputs);
|
10705
|
-
const files = yield
|
10649
|
+
const files = yield sendAndHandleSdkError(getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_Image_RetrieveImages), 'visualMedia.image.retrieveImages', galleryImageInputs);
|
10706
10650
|
ensureResponseValid(galleryImageInputs.maxVisualMediaCount, files);
|
10707
10651
|
return files;
|
10708
10652
|
});
|
@@ -10717,10 +10661,10 @@ var visualMedia;
|
|
10717
10661
|
* @beta
|
10718
10662
|
*/
|
10719
10663
|
function isSupported() {
|
10720
|
-
return
|
10721
|
-
|
10722
|
-
|
10723
|
-
|
10664
|
+
return ensureInitialized(runtime) &&
|
10665
|
+
runtime.supports.visualMedia &&
|
10666
|
+
runtime.supports.visualMedia.image &&
|
10667
|
+
runtime.supports.permissions
|
10724
10668
|
? true
|
10725
10669
|
: false;
|
10726
10670
|
}
|
@@ -10787,7 +10731,7 @@ var webStorage;
|
|
10787
10731
|
* @beta
|
10788
10732
|
*/
|
10789
10733
|
function isWebStorageClearedOnUserLogOut() {
|
10790
|
-
|
10734
|
+
ensureInitialized(runtime);
|
10791
10735
|
return isSupported();
|
10792
10736
|
}
|
10793
10737
|
webStorage.isWebStorageClearedOnUserLogOut = isWebStorageClearedOnUserLogOut;
|
@@ -10800,7 +10744,7 @@ var webStorage;
|
|
10800
10744
|
* @beta
|
10801
10745
|
*/
|
10802
10746
|
function isSupported() {
|
10803
|
-
return
|
10747
|
+
return ensureInitialized(runtime) && runtime.supports.webStorage ? true : false;
|
10804
10748
|
}
|
10805
10749
|
webStorage.isSupported = isSupported;
|
10806
10750
|
})(webStorage || (webStorage = {}));
|
@@ -10849,12 +10793,12 @@ var call;
|
|
10849
10793
|
const apiVersionTag = getApiVersionTag(callTelemetryVersionNumber, ApiName.Call_StartCall);
|
10850
10794
|
return new Promise((resolve) => {
|
10851
10795
|
var _a;
|
10852
|
-
|
10796
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
10853
10797
|
if (!isSupported()) {
|
10854
10798
|
throw errorNotSupportedOnPlatform;
|
10855
10799
|
}
|
10856
|
-
if (
|
10857
|
-
resolve(
|
10800
|
+
if (runtime.isLegacyTeams) {
|
10801
|
+
resolve(sendAndUnwrap(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then((result) => {
|
10858
10802
|
if (!result) {
|
10859
10803
|
throw new Error(errorCallNotStarted);
|
10860
10804
|
}
|
@@ -10862,7 +10806,7 @@ var call;
|
|
10862
10806
|
}));
|
10863
10807
|
}
|
10864
10808
|
else {
|
10865
|
-
return
|
10809
|
+
return sendMessageToParent(apiVersionTag, 'call.startCall', [startCallParams], resolve);
|
10866
10810
|
}
|
10867
10811
|
});
|
10868
10812
|
}
|
@@ -10874,7 +10818,7 @@ var call;
|
|
10874
10818
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
10875
10819
|
*/
|
10876
10820
|
function isSupported() {
|
10877
|
-
return
|
10821
|
+
return ensureInitialized(runtime) && runtime.supports.call ? true : false;
|
10878
10822
|
}
|
10879
10823
|
call.isSupported = isSupported;
|
10880
10824
|
})(call || (call = {}));
|
@@ -10963,6 +10907,10 @@ var appInitialization;
|
|
10963
10907
|
|
10964
10908
|
|
10965
10909
|
const Files3PLogger = getLogger('thirdPartyCloudStorage');
|
10910
|
+
/**
|
10911
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
10912
|
+
*/
|
10913
|
+
const thirdPartyCloudStorageTelemetryVersionNumber = ApiVersionNumber.V_2;
|
10966
10914
|
/**
|
10967
10915
|
* Extended files API 3P storage providers, features like sending Blob from Teams to 3P app on user
|
10968
10916
|
* actions like drag and drop to compose
|
@@ -11001,7 +10949,7 @@ var thirdPartyCloudStorage;
|
|
11001
10949
|
dragAndDropFileCallback([], invalidInput);
|
11002
10950
|
return;
|
11003
10951
|
}
|
11004
|
-
|
10952
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
11005
10953
|
if (!isSupported()) {
|
11006
10954
|
throw errorNotSupportedOnPlatform;
|
11007
10955
|
}
|
@@ -11013,7 +10961,7 @@ var thirdPartyCloudStorage;
|
|
11013
10961
|
callback = dragAndDropFileCallback;
|
11014
10962
|
}
|
11015
10963
|
lastChunkVal = true;
|
11016
|
-
sendMessageToParent('thirdPartyCloudStorage.getDragAndDropFiles', [dragAndDropInput], handleGetDragAndDropFilesCallbackRequest);
|
10964
|
+
sendMessageToParent(getApiVersionTag(thirdPartyCloudStorageTelemetryVersionNumber, ApiName.ThirdPartyCloudStorage_GetDragAndDropFiles), 'thirdPartyCloudStorage.getDragAndDropFiles', [dragAndDropInput], handleGetDragAndDropFilesCallbackRequest);
|
11017
10965
|
}
|
11018
10966
|
thirdPartyCloudStorage.getDragAndDropFiles = getDragAndDropFiles;
|
11019
10967
|
function handleGetDragAndDropFilesCallbackRequest(fileResult) {
|
@@ -11099,7 +11047,7 @@ var thirdPartyCloudStorage;
|
|
11099
11047
|
* @beta
|
11100
11048
|
*/
|
11101
11049
|
function isSupported() {
|
11102
|
-
return
|
11050
|
+
return ensureInitialized(runtime) && runtime.supports.thirdPartyCloudStorage ? true : false;
|
11103
11051
|
}
|
11104
11052
|
thirdPartyCloudStorage.isSupported = isSupported;
|
11105
11053
|
})(thirdPartyCloudStorage || (thirdPartyCloudStorage = {}));
|
@@ -11166,7 +11114,7 @@ function print() {
|
|
11166
11114
|
*/
|
11167
11115
|
function getContext(callback) {
|
11168
11116
|
ensureInitializeCalled();
|
11169
|
-
|
11117
|
+
sendMessageToParent(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetContext), 'getContext', (context) => {
|
11170
11118
|
if (!context.frameContext) {
|
11171
11119
|
// Fallback logic for frameContext properties
|
11172
11120
|
context.frameContext = GlobalVars.frameContext;
|
@@ -11196,7 +11144,7 @@ function publicAPIs_registerOnThemeChangeHandler(handler) {
|
|
11196
11144
|
* @param handler - The handler to invoke when the user toggles full-screen view for a tab.
|
11197
11145
|
*/
|
11198
11146
|
function registerFullScreenHandler(handler) {
|
11199
|
-
|
11147
|
+
registerHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFullScreenHandler), 'fullScreenChange', handler, []);
|
11200
11148
|
}
|
11201
11149
|
/**
|
11202
11150
|
* @deprecated
|
@@ -11208,7 +11156,7 @@ function registerFullScreenHandler(handler) {
|
|
11208
11156
|
* @param handler - The handler to invoke when the personal app button is clicked in the app bar.
|
11209
11157
|
*/
|
11210
11158
|
function registerAppButtonClickHandler(handler) {
|
11211
|
-
|
11159
|
+
registerHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonClickHandler), 'appButtonClick', handler, [FrameContexts.content]);
|
11212
11160
|
}
|
11213
11161
|
/**
|
11214
11162
|
* @deprecated
|
@@ -11220,7 +11168,7 @@ function registerAppButtonClickHandler(handler) {
|
|
11220
11168
|
* @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
|
11221
11169
|
*/
|
11222
11170
|
function registerAppButtonHoverEnterHandler(handler) {
|
11223
|
-
|
11171
|
+
registerHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverEnterHandler), 'appButtonHoverEnter', handler, [FrameContexts.content]);
|
11224
11172
|
}
|
11225
11173
|
/**
|
11226
11174
|
* @deprecated
|
@@ -11232,7 +11180,7 @@ function registerAppButtonHoverEnterHandler(handler) {
|
|
11232
11180
|
*
|
11233
11181
|
*/
|
11234
11182
|
function registerAppButtonHoverLeaveHandler(handler) {
|
11235
|
-
|
11183
|
+
registerHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverLeaveHandler), 'appButtonHoverLeave', handler, [FrameContexts.content]);
|
11236
11184
|
}
|
11237
11185
|
/**
|
11238
11186
|
* @deprecated
|
@@ -11258,7 +11206,7 @@ function registerBackButtonHandler(handler) {
|
|
11258
11206
|
* @param handler - The handler to invoke when the page is loaded.
|
11259
11207
|
*/
|
11260
11208
|
function registerOnLoadHandler(handler) {
|
11261
|
-
teamsCore.registerOnLoadHandlerHelper(handler);
|
11209
|
+
teamsCore.registerOnLoadHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterOnLoadHandler), handler);
|
11262
11210
|
}
|
11263
11211
|
/**
|
11264
11212
|
* @deprecated
|
@@ -11271,7 +11219,7 @@ function registerOnLoadHandler(handler) {
|
|
11271
11219
|
* invoke the readyToUnload function provided to it once it's ready to be unloaded.
|
11272
11220
|
*/
|
11273
11221
|
function registerBeforeUnloadHandler(handler) {
|
11274
|
-
teamsCore.registerBeforeUnloadHandlerHelper(handler);
|
11222
|
+
teamsCore.registerBeforeUnloadHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterBeforeUnloadHandler), handler);
|
11275
11223
|
}
|
11276
11224
|
/**
|
11277
11225
|
* @deprecated
|
@@ -11283,7 +11231,7 @@ function registerBeforeUnloadHandler(handler) {
|
|
11283
11231
|
* @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.
|
11284
11232
|
*/
|
11285
11233
|
function registerFocusEnterHandler(handler) {
|
11286
|
-
|
11234
|
+
registerHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFocusEnterHandler), 'focusEnter', handler, []);
|
11287
11235
|
}
|
11288
11236
|
/**
|
11289
11237
|
* @deprecated
|
@@ -11294,7 +11242,7 @@ function registerFocusEnterHandler(handler) {
|
|
11294
11242
|
* @param handler - The handler to invoke when the user click on Settings.
|
11295
11243
|
*/
|
11296
11244
|
function registerChangeSettingsHandler(handler) {
|
11297
|
-
|
11245
|
+
registerHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterChangeSettingsHandler), 'changeSettings', handler, [FrameContexts.content]);
|
11298
11246
|
}
|
11299
11247
|
/**
|
11300
11248
|
* @deprecated
|
@@ -11307,7 +11255,7 @@ function registerChangeSettingsHandler(handler) {
|
|
11307
11255
|
* @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
|
11308
11256
|
*/
|
11309
11257
|
function getTabInstances(callback, tabInstanceParameters) {
|
11310
|
-
|
11258
|
+
ensureInitialized(runtime);
|
11311
11259
|
getTabInstancesHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetTabInstances), tabInstanceParameters).then((tabInfo) => {
|
11312
11260
|
callback(tabInfo);
|
11313
11261
|
});
|
@@ -11322,7 +11270,7 @@ function getTabInstances(callback, tabInstanceParameters) {
|
|
11322
11270
|
* @param tabInstanceParameters - OPTIONAL Ignored, kept for future use
|
11323
11271
|
*/
|
11324
11272
|
function getMruTabInstances(callback, tabInstanceParameters) {
|
11325
|
-
|
11273
|
+
ensureInitialized(runtime);
|
11326
11274
|
getMruTabInstancesHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetMruTabInstances), tabInstanceParameters).then((tabInfo) => {
|
11327
11275
|
callback(tabInfo);
|
11328
11276
|
});
|
@@ -11351,7 +11299,7 @@ function shareDeepLink(deepLinkParameters) {
|
|
11351
11299
|
* @param deepLink - deep link.
|
11352
11300
|
*/
|
11353
11301
|
function executeDeepLink(deepLink, onComplete) {
|
11354
|
-
|
11302
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
11355
11303
|
const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
11356
11304
|
openLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ExecuteDeepLink), deepLink)
|
11357
11305
|
.then(() => {
|
@@ -11384,7 +11332,7 @@ function setFrameContext(frameContext) {
|
|
11384
11332
|
* They must have https: protocol otherwise they will be ignored. Example: https:www.example.com
|
11385
11333
|
*/
|
11386
11334
|
function initializeWithFrameContext(frameContext, callback, validMessageOrigins) {
|
11387
|
-
appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.
|
11335
|
+
appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_InitializeWithFrameContext), validMessageOrigins).then(() => callback && callback());
|
11388
11336
|
setCurrentFrameHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext), frameContext);
|
11389
11337
|
}
|
11390
11338
|
|
@@ -11420,7 +11368,7 @@ function returnFocus(navigateForward) {
|
|
11420
11368
|
* @param onComplete - The callback to invoke when the action is complete.
|
11421
11369
|
*/
|
11422
11370
|
function navigateToTab(tabInstance, onComplete) {
|
11423
|
-
|
11371
|
+
ensureInitialized(runtime);
|
11424
11372
|
const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
11425
11373
|
tabsNavigateToTabHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateToTab), tabInstance)
|
11426
11374
|
.then(() => {
|
@@ -11444,7 +11392,7 @@ function navigateToTab(tabInstance, onComplete) {
|
|
11444
11392
|
* @param onComplete - The callback to invoke when the action is complete.
|
11445
11393
|
*/
|
11446
11394
|
function navigateCrossDomain(url, onComplete) {
|
11447
|
-
|
11395
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
11448
11396
|
const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
11449
11397
|
navigateCrossDomainHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateCrossDomain), url)
|
11450
11398
|
.then(() => {
|
@@ -11464,7 +11412,7 @@ function navigateCrossDomain(url, onComplete) {
|
|
11464
11412
|
* @param onComplete - The callback to invoke when the action is complete.
|
11465
11413
|
*/
|
11466
11414
|
function navigateBack(onComplete) {
|
11467
|
-
|
11415
|
+
ensureInitialized(runtime);
|
11468
11416
|
const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
11469
11417
|
backStackNavigateBackHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateBack))
|
11470
11418
|
.then(() => {
|
@@ -11517,7 +11465,7 @@ var settings;
|
|
11517
11465
|
* @param callback - The callback to invoke when the {@link Settings} object is retrieved.
|
11518
11466
|
*/
|
11519
11467
|
function getSettings(callback) {
|
11520
|
-
|
11468
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
|
11521
11469
|
getConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_GetSettings)).then((config) => {
|
11522
11470
|
callback(config);
|
11523
11471
|
});
|
@@ -11533,7 +11481,7 @@ var settings;
|
|
11533
11481
|
* @param - Set the desired settings for this instance.
|
11534
11482
|
*/
|
11535
11483
|
function setSettings(instanceSettings, onComplete) {
|
11536
|
-
|
11484
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
|
11537
11485
|
const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
11538
11486
|
configSetConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_SetSettings), instanceSettings)
|
11539
11487
|
.then(() => {
|
@@ -11631,12 +11579,12 @@ var tasks;
|
|
11631
11579
|
? (sdkResponse) => { var _a, _b; return submitHandler((_a = sdkResponse.err) !== null && _a !== void 0 ? _a : '', (_b = sdkResponse.result) !== null && _b !== void 0 ? _b : ''); }
|
11632
11580
|
: undefined;
|
11633
11581
|
if (taskInfo.card === undefined && taskInfo.url === undefined) {
|
11634
|
-
|
11635
|
-
|
11582
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
11583
|
+
sendMessageToParent(apiVersionTag, 'tasks.startTask', [taskInfo], submitHandler);
|
11636
11584
|
}
|
11637
11585
|
else if (taskInfo.card) {
|
11638
|
-
|
11639
|
-
|
11586
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
11587
|
+
sendMessageToParent(apiVersionTag, 'tasks.startTask', [taskInfo], submitHandler);
|
11640
11588
|
}
|
11641
11589
|
else if (taskInfo.completionBotId !== undefined) {
|
11642
11590
|
botUrlOpenHelper(apiVersionTag, getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
|
@@ -11811,8 +11759,8 @@ var liveShare;
|
|
11811
11759
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
11812
11760
|
*/
|
11813
11761
|
function isSupported() {
|
11814
|
-
return
|
11815
|
-
|
11762
|
+
return ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel) &&
|
11763
|
+
runtime.supports.interactive
|
11816
11764
|
? true
|
11817
11765
|
: false;
|
11818
11766
|
}
|
@@ -11835,7 +11783,7 @@ class LiveShareHost {
|
|
11835
11783
|
getFluidTenantInfo() {
|
11836
11784
|
ensureSupported();
|
11837
11785
|
return new Promise((resolve) => {
|
11838
|
-
resolve(
|
11786
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetFluidTenantInfo), 'interactive.getFluidTenantInfo'));
|
11839
11787
|
});
|
11840
11788
|
}
|
11841
11789
|
/**
|
@@ -11848,7 +11796,7 @@ class LiveShareHost {
|
|
11848
11796
|
getFluidToken(containerId) {
|
11849
11797
|
ensureSupported();
|
11850
11798
|
return new Promise((resolve) => {
|
11851
|
-
resolve(
|
11799
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetFluidToken), 'interactive.getFluidToken',
|
11852
11800
|
// eslint-disable-next-line strict-null-checks/all
|
11853
11801
|
containerId));
|
11854
11802
|
});
|
@@ -11860,7 +11808,7 @@ class LiveShareHost {
|
|
11860
11808
|
getFluidContainerId() {
|
11861
11809
|
ensureSupported();
|
11862
11810
|
return new Promise((resolve) => {
|
11863
|
-
resolve(
|
11811
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetFluidContainerId), 'interactive.getFluidContainerId'));
|
11864
11812
|
});
|
11865
11813
|
}
|
11866
11814
|
/**
|
@@ -11876,7 +11824,7 @@ class LiveShareHost {
|
|
11876
11824
|
setFluidContainerId(containerId) {
|
11877
11825
|
ensureSupported();
|
11878
11826
|
return new Promise((resolve) => {
|
11879
|
-
resolve(
|
11827
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_SetFluidContainerId), 'interactive.setFluidContainerId', containerId));
|
11880
11828
|
});
|
11881
11829
|
}
|
11882
11830
|
/**
|
@@ -11886,7 +11834,7 @@ class LiveShareHost {
|
|
11886
11834
|
getNtpTime() {
|
11887
11835
|
ensureSupported();
|
11888
11836
|
return new Promise((resolve) => {
|
11889
|
-
resolve(
|
11837
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetNtpTime), 'interactive.getNtpTime'));
|
11890
11838
|
});
|
11891
11839
|
}
|
11892
11840
|
/**
|
@@ -11899,7 +11847,7 @@ class LiveShareHost {
|
|
11899
11847
|
registerClientId(clientId) {
|
11900
11848
|
ensureSupported();
|
11901
11849
|
return new Promise((resolve) => {
|
11902
|
-
resolve(
|
11850
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_RegisterClientId), 'interactive.registerClientId', clientId));
|
11903
11851
|
});
|
11904
11852
|
}
|
11905
11853
|
/**
|
@@ -11912,7 +11860,7 @@ class LiveShareHost {
|
|
11912
11860
|
getClientRoles(clientId) {
|
11913
11861
|
ensureSupported();
|
11914
11862
|
return new Promise((resolve) => {
|
11915
|
-
resolve(
|
11863
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetClientRoles), 'interactive.getClientRoles', clientId));
|
11916
11864
|
});
|
11917
11865
|
}
|
11918
11866
|
/**
|
@@ -11925,7 +11873,7 @@ class LiveShareHost {
|
|
11925
11873
|
getClientInfo(clientId) {
|
11926
11874
|
ensureSupported();
|
11927
11875
|
return new Promise((resolve) => {
|
11928
|
-
resolve(
|
11876
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetClientInfo), 'interactive.getClientInfo', clientId));
|
11929
11877
|
});
|
11930
11878
|
}
|
11931
11879
|
/**
|
@@ -12263,11 +12211,11 @@ var marketplace;
|
|
12263
12211
|
* @beta
|
12264
12212
|
*/
|
12265
12213
|
function getCart() {
|
12266
|
-
|
12214
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12267
12215
|
if (!isSupported()) {
|
12268
12216
|
throw errorNotSupportedOnPlatform;
|
12269
12217
|
}
|
12270
|
-
return
|
12218
|
+
return sendAndHandleSdkError(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_GetCart), 'marketplace.getCart', marketplace.cartVersion).then(deserializeCart);
|
12271
12219
|
}
|
12272
12220
|
marketplace.getCart = getCart;
|
12273
12221
|
/**
|
@@ -12278,7 +12226,7 @@ var marketplace;
|
|
12278
12226
|
* @beta
|
12279
12227
|
*/
|
12280
12228
|
function addOrUpdateCartItems(addOrUpdateCartItemsParams) {
|
12281
|
-
|
12229
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12282
12230
|
if (!isSupported()) {
|
12283
12231
|
throw errorNotSupportedOnPlatform;
|
12284
12232
|
}
|
@@ -12287,7 +12235,7 @@ var marketplace;
|
|
12287
12235
|
}
|
12288
12236
|
validateUuid(addOrUpdateCartItemsParams === null || addOrUpdateCartItemsParams === void 0 ? void 0 : addOrUpdateCartItemsParams.cartId);
|
12289
12237
|
validateCartItems(addOrUpdateCartItemsParams === null || addOrUpdateCartItemsParams === void 0 ? void 0 : addOrUpdateCartItemsParams.cartItems);
|
12290
|
-
return
|
12238
|
+
return sendAndHandleSdkError(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_AddOrUpdateCartItems), 'marketplace.addOrUpdateCartItems', Object.assign(Object.assign({}, addOrUpdateCartItemsParams), { cartItems: serializeCartItems(addOrUpdateCartItemsParams.cartItems), cartVersion: marketplace.cartVersion })).then(deserializeCart);
|
12291
12239
|
}
|
12292
12240
|
marketplace.addOrUpdateCartItems = addOrUpdateCartItems;
|
12293
12241
|
/**
|
@@ -12298,7 +12246,7 @@ var marketplace;
|
|
12298
12246
|
* @beta
|
12299
12247
|
*/
|
12300
12248
|
function removeCartItems(removeCartItemsParams) {
|
12301
|
-
|
12249
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12302
12250
|
if (!isSupported()) {
|
12303
12251
|
throw errorNotSupportedOnPlatform;
|
12304
12252
|
}
|
@@ -12309,7 +12257,7 @@ var marketplace;
|
|
12309
12257
|
if (!Array.isArray(removeCartItemsParams === null || removeCartItemsParams === void 0 ? void 0 : removeCartItemsParams.cartItemIds) || (removeCartItemsParams === null || removeCartItemsParams === void 0 ? void 0 : removeCartItemsParams.cartItemIds.length) === 0) {
|
12310
12258
|
throw new Error('cartItemIds must be a non-empty array');
|
12311
12259
|
}
|
12312
|
-
return
|
12260
|
+
return sendAndHandleSdkError(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_RemoveCardItems), 'marketplace.removeCartItems', Object.assign(Object.assign({}, removeCartItemsParams), { cartVersion: marketplace.cartVersion })).then(deserializeCart);
|
12313
12261
|
}
|
12314
12262
|
marketplace.removeCartItems = removeCartItems;
|
12315
12263
|
/**
|
@@ -12320,7 +12268,7 @@ var marketplace;
|
|
12320
12268
|
* @beta
|
12321
12269
|
*/
|
12322
12270
|
function updateCartStatus(updateCartStatusParams) {
|
12323
|
-
|
12271
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12324
12272
|
if (!isSupported()) {
|
12325
12273
|
throw errorNotSupportedOnPlatform;
|
12326
12274
|
}
|
@@ -12329,7 +12277,7 @@ var marketplace;
|
|
12329
12277
|
}
|
12330
12278
|
validateUuid(updateCartStatusParams === null || updateCartStatusParams === void 0 ? void 0 : updateCartStatusParams.cartId);
|
12331
12279
|
validateCartStatus(updateCartStatusParams === null || updateCartStatusParams === void 0 ? void 0 : updateCartStatusParams.cartStatus);
|
12332
|
-
return
|
12280
|
+
return sendAndHandleSdkError(getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_UpdateCartStatus), 'marketplace.updateCartStatus', Object.assign(Object.assign({}, updateCartStatusParams), { cartVersion: marketplace.cartVersion })).then(deserializeCart);
|
12333
12281
|
}
|
12334
12282
|
marketplace.updateCartStatus = updateCartStatus;
|
12335
12283
|
/**
|
@@ -12340,7 +12288,7 @@ var marketplace;
|
|
12340
12288
|
* @beta
|
12341
12289
|
*/
|
12342
12290
|
function isSupported() {
|
12343
|
-
return
|
12291
|
+
return ensureInitialized(runtime) && runtime.supports.marketplace ? true : false;
|
12344
12292
|
}
|
12345
12293
|
marketplace.isSupported = isSupported;
|
12346
12294
|
})(marketplace || (marketplace = {}));
|
@@ -12394,6 +12342,11 @@ var marketplace;
|
|
12394
12342
|
|
12395
12343
|
|
12396
12344
|
|
12345
|
+
|
12346
|
+
/**
|
12347
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
12348
|
+
*/
|
12349
|
+
const externalAppAuthenticationTelemetryVersionNumber = ApiVersionNumber.V_2;
|
12397
12350
|
/**
|
12398
12351
|
* @hidden
|
12399
12352
|
* Namespace to delegate authentication and message extension requests to the host
|
@@ -12487,14 +12440,14 @@ var externalAppAuthentication;
|
|
12487
12440
|
* @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
12488
12441
|
*/
|
12489
12442
|
function authenticateAndResendRequest(appId, authenticateParameters, originalRequestInfo) {
|
12490
|
-
|
12443
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12491
12444
|
if (!isSupported()) {
|
12492
12445
|
throw errorNotSupportedOnPlatform;
|
12493
12446
|
}
|
12494
12447
|
validateAppIdIsGuid(appId);
|
12495
12448
|
validateOriginalRequestInfo(originalRequestInfo);
|
12496
12449
|
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
12497
|
-
return sendMessageToParentAsync('externalAppAuthentication.authenticateAndResendRequest', [
|
12450
|
+
return sendMessageToParentAsync(getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, ApiName.ExternalAppAuthentication_AuthenticateAndResendRequest), 'externalAppAuthentication.authenticateAndResendRequest', [
|
12498
12451
|
appId,
|
12499
12452
|
originalRequestInfo,
|
12500
12453
|
authenticateParameters.url.href,
|
@@ -12523,16 +12476,12 @@ var externalAppAuthentication;
|
|
12523
12476
|
* @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
|
12524
12477
|
*/
|
12525
12478
|
function authenticateWithSSO(appId, authTokenRequest) {
|
12526
|
-
|
12479
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12527
12480
|
if (!isSupported()) {
|
12528
12481
|
throw errorNotSupportedOnPlatform;
|
12529
12482
|
}
|
12530
12483
|
validateAppIdIsGuid(appId);
|
12531
|
-
return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSO', [
|
12532
|
-
appId,
|
12533
|
-
authTokenRequest.claims,
|
12534
|
-
authTokenRequest.silent,
|
12535
|
-
]).then(([wasSuccessful, error]) => {
|
12484
|
+
return sendMessageToParentAsync(getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, ApiName.ExternalAppAuthentication_AuthenticateWithSSO), 'externalAppAuthentication.authenticateWithSSO', [appId, authTokenRequest.claims, authTokenRequest.silent]).then(([wasSuccessful, error]) => {
|
12536
12485
|
if (!wasSuccessful) {
|
12537
12486
|
throw error;
|
12538
12487
|
}
|
@@ -12551,13 +12500,13 @@ var externalAppAuthentication;
|
|
12551
12500
|
* @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
12552
12501
|
*/
|
12553
12502
|
function authenticateWithSSOAndResendRequest(appId, authTokenRequest, originalRequestInfo) {
|
12554
|
-
|
12503
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12555
12504
|
if (!isSupported()) {
|
12556
12505
|
throw errorNotSupportedOnPlatform;
|
12557
12506
|
}
|
12558
12507
|
validateAppIdIsGuid(appId);
|
12559
12508
|
validateOriginalRequestInfo(originalRequestInfo);
|
12560
|
-
return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSOAndResendRequest', [appId, originalRequestInfo, authTokenRequest.claims, authTokenRequest.silent]).then(([wasSuccessful, response]) => {
|
12509
|
+
return sendMessageToParentAsync(getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, ApiName.ExternalAppAuthentication_AuthenticateWithSSOAndResendRequest), 'externalAppAuthentication.authenticateWithSSOAndResendRequest', [appId, originalRequestInfo, authTokenRequest.claims, authTokenRequest.silent]).then(([wasSuccessful, response]) => {
|
12561
12510
|
if (wasSuccessful && response.responseType != null) {
|
12562
12511
|
return response;
|
12563
12512
|
}
|
@@ -12579,7 +12528,7 @@ var externalAppAuthentication;
|
|
12579
12528
|
* Limited to Microsoft-internal use
|
12580
12529
|
*/
|
12581
12530
|
function isSupported() {
|
12582
|
-
return
|
12531
|
+
return ensureInitialized(runtime) && runtime.supports.externalAppAuthentication ? true : false;
|
12583
12532
|
}
|
12584
12533
|
externalAppAuthentication.isSupported = isSupported;
|
12585
12534
|
})(externalAppAuthentication || (externalAppAuthentication = {}));
|
@@ -12591,6 +12540,11 @@ var externalAppAuthentication;
|
|
12591
12540
|
|
12592
12541
|
|
12593
12542
|
|
12543
|
+
|
12544
|
+
/**
|
12545
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
12546
|
+
*/
|
12547
|
+
const externalAppCardActionsTelemetryVersionNumber = ApiVersionNumber.V_2;
|
12594
12548
|
/**
|
12595
12549
|
* @hidden
|
12596
12550
|
* Namespace to delegate adaptive card action execution to the host
|
@@ -12646,15 +12600,12 @@ var externalAppCardActions;
|
|
12646
12600
|
* @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
|
12647
12601
|
*/
|
12648
12602
|
function processActionSubmit(appId, actionSubmitPayload) {
|
12649
|
-
|
12603
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12650
12604
|
if (!isSupported()) {
|
12651
12605
|
throw errorNotSupportedOnPlatform;
|
12652
12606
|
}
|
12653
12607
|
validateAppIdIsGuid(appId);
|
12654
|
-
return sendMessageToParentAsync('externalAppCardActions.processActionSubmit', [
|
12655
|
-
appId,
|
12656
|
-
actionSubmitPayload,
|
12657
|
-
]).then(([wasSuccessful, error]) => {
|
12608
|
+
return sendMessageToParentAsync(getApiVersionTag(externalAppCardActionsTelemetryVersionNumber, ApiName.ExternalAppCardActions_ProcessActionSubmit), 'externalAppCardActions.processActionSubmit', [appId, actionSubmitPayload]).then(([wasSuccessful, error]) => {
|
12658
12609
|
if (!wasSuccessful) {
|
12659
12610
|
throw error;
|
12660
12611
|
}
|
@@ -12672,12 +12623,12 @@ var externalAppCardActions;
|
|
12672
12623
|
* @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails
|
12673
12624
|
*/
|
12674
12625
|
function processActionOpenUrl(appId, url) {
|
12675
|
-
|
12626
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12676
12627
|
if (!isSupported()) {
|
12677
12628
|
throw errorNotSupportedOnPlatform;
|
12678
12629
|
}
|
12679
12630
|
validateAppIdIsGuid(appId);
|
12680
|
-
return sendMessageToParentAsync('externalAppCardActions.processActionOpenUrl', [appId, url.href]).then(([error, response]) => {
|
12631
|
+
return sendMessageToParentAsync(getApiVersionTag(externalAppCardActionsTelemetryVersionNumber, ApiName.ExternalAppCardActions_ProcessActionOpenUrl), 'externalAppCardActions.processActionOpenUrl', [appId, url.href]).then(([error, response]) => {
|
12681
12632
|
if (error) {
|
12682
12633
|
throw error;
|
12683
12634
|
}
|
@@ -12698,7 +12649,7 @@ var externalAppCardActions;
|
|
12698
12649
|
* Limited to Microsoft-internal use
|
12699
12650
|
*/
|
12700
12651
|
function isSupported() {
|
12701
|
-
return
|
12652
|
+
return ensureInitialized(runtime) && runtime.supports.externalAppCardActions ? true : false;
|
12702
12653
|
}
|
12703
12654
|
externalAppCardActions.isSupported = isSupported;
|
12704
12655
|
})(externalAppCardActions || (externalAppCardActions = {}));
|
@@ -12828,14 +12779,14 @@ var files;
|
|
12828
12779
|
* Limited to Microsoft-internal use
|
12829
12780
|
*/
|
12830
12781
|
function getCloudStorageFolders(channelId, callback) {
|
12831
|
-
|
12782
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12832
12783
|
if (!channelId || channelId.length === 0) {
|
12833
12784
|
throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
|
12834
12785
|
}
|
12835
12786
|
if (!callback) {
|
12836
12787
|
throw new Error('[files.getCloudStorageFolders] Callback cannot be null');
|
12837
12788
|
}
|
12838
|
-
|
12789
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetCloudStorageFolders), 'files.getCloudStorageFolders', [channelId], callback);
|
12839
12790
|
}
|
12840
12791
|
files_1.getCloudStorageFolders = getCloudStorageFolders;
|
12841
12792
|
/**
|
@@ -12851,14 +12802,14 @@ var files;
|
|
12851
12802
|
* Limited to Microsoft-internal use
|
12852
12803
|
*/
|
12853
12804
|
function addCloudStorageFolder(channelId, callback) {
|
12854
|
-
|
12805
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12855
12806
|
if (!channelId || channelId.length === 0) {
|
12856
12807
|
throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
|
12857
12808
|
}
|
12858
12809
|
if (!callback) {
|
12859
12810
|
throw new Error('[files.addCloudStorageFolder] Callback cannot be null');
|
12860
12811
|
}
|
12861
|
-
|
12812
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_AddCloudStorageFolder), 'files.addCloudStorageFolder', [channelId], callback);
|
12862
12813
|
}
|
12863
12814
|
files_1.addCloudStorageFolder = addCloudStorageFolder;
|
12864
12815
|
/**
|
@@ -12876,7 +12827,7 @@ var files;
|
|
12876
12827
|
* Limited to Microsoft-internal use
|
12877
12828
|
*/
|
12878
12829
|
function deleteCloudStorageFolder(channelId, folderToDelete, callback) {
|
12879
|
-
|
12830
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12880
12831
|
if (!channelId) {
|
12881
12832
|
throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');
|
12882
12833
|
}
|
@@ -12886,7 +12837,7 @@ var files;
|
|
12886
12837
|
if (!callback) {
|
12887
12838
|
throw new Error('[files.deleteCloudStorageFolder] Callback cannot be null');
|
12888
12839
|
}
|
12889
|
-
|
12840
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_DeleteCloudStorageFolder), 'files.deleteCloudStorageFolder', [channelId, folderToDelete], callback);
|
12890
12841
|
}
|
12891
12842
|
files_1.deleteCloudStorageFolder = deleteCloudStorageFolder;
|
12892
12843
|
/**
|
@@ -12904,7 +12855,7 @@ var files;
|
|
12904
12855
|
* Limited to Microsoft-internal use
|
12905
12856
|
*/
|
12906
12857
|
function getCloudStorageFolderContents(folder, providerCode, callback) {
|
12907
|
-
|
12858
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12908
12859
|
if (!folder || !providerCode) {
|
12909
12860
|
throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');
|
12910
12861
|
}
|
@@ -12914,7 +12865,7 @@ var files;
|
|
12914
12865
|
if ('isSubdirectory' in folder && !folder.isSubdirectory) {
|
12915
12866
|
throw new Error('[files.getCloudStorageFolderContents] provided folder is not a subDirectory');
|
12916
12867
|
}
|
12917
|
-
|
12868
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetCloudStorageFolderContents), 'files.getCloudStorageFolderContents', [folder, providerCode], callback);
|
12918
12869
|
}
|
12919
12870
|
files_1.getCloudStorageFolderContents = getCloudStorageFolderContents;
|
12920
12871
|
/**
|
@@ -12932,14 +12883,14 @@ var files;
|
|
12932
12883
|
* Limited to Microsoft-internal use
|
12933
12884
|
*/
|
12934
12885
|
function openCloudStorageFile(file, providerCode, fileOpenPreference) {
|
12935
|
-
|
12886
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12936
12887
|
if (!file || !providerCode) {
|
12937
12888
|
throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');
|
12938
12889
|
}
|
12939
12890
|
if (file.isSubdirectory) {
|
12940
12891
|
throw new Error('[files.openCloudStorageFile] provided file is a subDirectory');
|
12941
12892
|
}
|
12942
|
-
|
12893
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_OpenCloudStorageFile), 'files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);
|
12943
12894
|
}
|
12944
12895
|
files_1.openCloudStorageFile = openCloudStorageFile;
|
12945
12896
|
/**
|
@@ -12953,11 +12904,11 @@ var files;
|
|
12953
12904
|
* Limited to Microsoft-internal use
|
12954
12905
|
*/
|
12955
12906
|
function getExternalProviders(excludeAddedProviders = false, callback) {
|
12956
|
-
|
12907
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12957
12908
|
if (!callback) {
|
12958
12909
|
throw new Error('[files.getExternalProviders] Callback cannot be null');
|
12959
12910
|
}
|
12960
|
-
|
12911
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetExternalProviders), 'files.getExternalProviders', [excludeAddedProviders], callback);
|
12961
12912
|
}
|
12962
12913
|
files_1.getExternalProviders = getExternalProviders;
|
12963
12914
|
/**
|
@@ -12969,7 +12920,7 @@ var files;
|
|
12969
12920
|
* Limited to Microsoft-internal use
|
12970
12921
|
*/
|
12971
12922
|
function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove = false, callback) {
|
12972
|
-
|
12923
|
+
ensureInitialized(runtime, FrameContexts.content);
|
12973
12924
|
if (!selectedFiles || selectedFiles.length === 0) {
|
12974
12925
|
throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
|
12975
12926
|
}
|
@@ -12985,7 +12936,7 @@ var files;
|
|
12985
12936
|
if (!callback) {
|
12986
12937
|
throw new Error('[files.copyMoveFiles] callback cannot be null');
|
12987
12938
|
}
|
12988
|
-
|
12939
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_CopyMoveFiles), 'files.copyMoveFiles', [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove], callback);
|
12989
12940
|
}
|
12990
12941
|
files_1.copyMoveFiles = copyMoveFiles;
|
12991
12942
|
/**
|
@@ -13000,11 +12951,11 @@ var files;
|
|
13000
12951
|
* Limited to Microsoft-internal use
|
13001
12952
|
*/
|
13002
12953
|
function getFileDownloads(callback) {
|
13003
|
-
|
12954
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13004
12955
|
if (!callback) {
|
13005
12956
|
throw new Error('[files.getFileDownloads] Callback cannot be null');
|
13006
12957
|
}
|
13007
|
-
|
12958
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetFileDownloads), 'files.getFileDownloads', [], callback);
|
13008
12959
|
}
|
13009
12960
|
files_1.getFileDownloads = getFileDownloads;
|
13010
12961
|
/**
|
@@ -13019,11 +12970,11 @@ var files;
|
|
13019
12970
|
* Limited to Microsoft-internal use
|
13020
12971
|
*/
|
13021
12972
|
function openDownloadFolder(fileObjectId = undefined, callback) {
|
13022
|
-
|
12973
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13023
12974
|
if (!callback) {
|
13024
12975
|
throw new Error('[files.openDownloadFolder] Callback cannot be null');
|
13025
12976
|
}
|
13026
|
-
|
12977
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_OpenDownloadFolder), 'files.openDownloadFolder', [fileObjectId], callback);
|
13027
12978
|
}
|
13028
12979
|
files_1.openDownloadFolder = openDownloadFolder;
|
13029
12980
|
/**
|
@@ -13043,11 +12994,11 @@ var files;
|
|
13043
12994
|
* Limited to Microsoft-internal use
|
13044
12995
|
*/
|
13045
12996
|
function addCloudStorageProvider(callback) {
|
13046
|
-
|
12997
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13047
12998
|
if (!callback) {
|
13048
12999
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');
|
13049
13000
|
}
|
13050
|
-
|
13001
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_AddCloudStorageProvider), 'files.addCloudStorageProvider', [], callback);
|
13051
13002
|
}
|
13052
13003
|
files_1.addCloudStorageProvider = addCloudStorageProvider;
|
13053
13004
|
/**
|
@@ -13065,14 +13016,14 @@ var files;
|
|
13065
13016
|
* Limited to Microsoft-internal use
|
13066
13017
|
*/
|
13067
13018
|
function removeCloudStorageProvider(logoutRequest, callback) {
|
13068
|
-
|
13019
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13069
13020
|
if (!callback) {
|
13070
13021
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');
|
13071
13022
|
}
|
13072
13023
|
if (!(logoutRequest && logoutRequest.content)) {
|
13073
13024
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] 3P cloud storage provider request content is missing');
|
13074
13025
|
}
|
13075
|
-
|
13026
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RemoveCloudStorageProvider), 'files.removeCloudStorageProvider', [logoutRequest], callback);
|
13076
13027
|
}
|
13077
13028
|
files_1.removeCloudStorageProvider = removeCloudStorageProvider;
|
13078
13029
|
/**
|
@@ -13088,14 +13039,14 @@ var files;
|
|
13088
13039
|
* Limited to Microsoft-internal use
|
13089
13040
|
*/
|
13090
13041
|
function addCloudStorageProviderFile(addNewFileRequest, callback) {
|
13091
|
-
|
13042
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13092
13043
|
if (!callback) {
|
13093
13044
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');
|
13094
13045
|
}
|
13095
13046
|
if (!(addNewFileRequest && addNewFileRequest.content)) {
|
13096
13047
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] 3P cloud storage provider request content is missing');
|
13097
13048
|
}
|
13098
|
-
|
13049
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_AddCloudStorageProviderFile), 'files.addCloudStorageProviderFile', [addNewFileRequest], callback);
|
13099
13050
|
}
|
13100
13051
|
files_1.addCloudStorageProviderFile = addCloudStorageProviderFile;
|
13101
13052
|
/**
|
@@ -13111,14 +13062,14 @@ var files;
|
|
13111
13062
|
* Limited to Microsoft-internal use
|
13112
13063
|
*/
|
13113
13064
|
function renameCloudStorageProviderFile(renameFileRequest, callback) {
|
13114
|
-
|
13065
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13115
13066
|
if (!callback) {
|
13116
13067
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');
|
13117
13068
|
}
|
13118
13069
|
if (!(renameFileRequest && renameFileRequest.content)) {
|
13119
13070
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] 3P cloud storage provider request content is missing');
|
13120
13071
|
}
|
13121
|
-
|
13072
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RenameCloudStorageProviderFile), 'files.renameCloudStorageProviderFile', [renameFileRequest], callback);
|
13122
13073
|
}
|
13123
13074
|
files_1.renameCloudStorageProviderFile = renameCloudStorageProviderFile;
|
13124
13075
|
/**
|
@@ -13135,7 +13086,7 @@ var files;
|
|
13135
13086
|
* Limited to Microsoft-internal use
|
13136
13087
|
*/
|
13137
13088
|
function deleteCloudStorageProviderFile(deleteFileRequest, callback) {
|
13138
|
-
|
13089
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13139
13090
|
if (!callback) {
|
13140
13091
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');
|
13141
13092
|
}
|
@@ -13145,7 +13096,7 @@ var files;
|
|
13145
13096
|
deleteFileRequest.content.itemList.length > 0)) {
|
13146
13097
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing');
|
13147
13098
|
}
|
13148
|
-
|
13099
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_DeleteCloudStorageProviderFile), 'files.deleteCloudStorageProviderFile', [deleteFileRequest], callback);
|
13149
13100
|
}
|
13150
13101
|
files_1.deleteCloudStorageProviderFile = deleteCloudStorageProviderFile;
|
13151
13102
|
/**
|
@@ -13162,7 +13113,7 @@ var files;
|
|
13162
13113
|
* Limited to Microsoft-internal use
|
13163
13114
|
*/
|
13164
13115
|
function downloadCloudStorageProviderFile(downloadFileRequest, callback) {
|
13165
|
-
|
13116
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13166
13117
|
if (!callback) {
|
13167
13118
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] callback cannot be null');
|
13168
13119
|
}
|
@@ -13172,7 +13123,7 @@ var files;
|
|
13172
13123
|
downloadFileRequest.content.itemList.length > 0)) {
|
13173
13124
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing');
|
13174
13125
|
}
|
13175
|
-
|
13126
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_DownloadCloudStorageProviderFile), 'files.downloadCloudStorageProviderFile', [downloadFileRequest], callback);
|
13176
13127
|
}
|
13177
13128
|
files_1.downloadCloudStorageProviderFile = downloadCloudStorageProviderFile;
|
13178
13129
|
/**
|
@@ -13189,7 +13140,7 @@ var files;
|
|
13189
13140
|
* Limited to Microsoft-internal use
|
13190
13141
|
*/
|
13191
13142
|
function uploadCloudStorageProviderFile(uploadFileRequest, callback) {
|
13192
|
-
|
13143
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13193
13144
|
if (!callback) {
|
13194
13145
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');
|
13195
13146
|
}
|
@@ -13202,7 +13153,7 @@ var files;
|
|
13202
13153
|
if (!uploadFileRequest.content.destinationFolder) {
|
13203
13154
|
throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] Invalid destination folder details');
|
13204
13155
|
}
|
13205
|
-
|
13156
|
+
sendMessageToParent(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_UploadCloudStorageProviderFile), 'files.uploadCloudStorageProviderFile', [uploadFileRequest], callback);
|
13206
13157
|
}
|
13207
13158
|
files_1.uploadCloudStorageProviderFile = uploadCloudStorageProviderFile;
|
13208
13159
|
/**
|
@@ -13217,11 +13168,11 @@ var files;
|
|
13217
13168
|
* @internal Limited to Microsoft-internal use
|
13218
13169
|
*/
|
13219
13170
|
function registerCloudStorageProviderListChangeHandler(handler) {
|
13220
|
-
|
13171
|
+
ensureInitialized(runtime);
|
13221
13172
|
if (!handler) {
|
13222
13173
|
throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');
|
13223
13174
|
}
|
13224
|
-
|
13175
|
+
registerHandler(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RegisterCloudStorageProviderListChangeHandler), 'files.cloudStorageProviderListChange', handler);
|
13225
13176
|
}
|
13226
13177
|
files_1.registerCloudStorageProviderListChangeHandler = registerCloudStorageProviderListChangeHandler;
|
13227
13178
|
/**
|
@@ -13237,11 +13188,11 @@ var files;
|
|
13237
13188
|
* Limited to Microsoft-internal use
|
13238
13189
|
*/
|
13239
13190
|
function registerCloudStorageProviderContentChangeHandler(handler) {
|
13240
|
-
|
13191
|
+
ensureInitialized(runtime);
|
13241
13192
|
if (!handler) {
|
13242
13193
|
throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');
|
13243
13194
|
}
|
13244
|
-
|
13195
|
+
registerHandler(getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RegisterCloudStorageProviderContentChangeHandler), 'files.cloudStorageProviderContentChange', handler);
|
13245
13196
|
}
|
13246
13197
|
files_1.registerCloudStorageProviderContentChangeHandler = registerCloudStorageProviderContentChangeHandler;
|
13247
13198
|
function getSdkError(errorCode, message) {
|
@@ -13282,11 +13233,11 @@ var meetingRoom;
|
|
13282
13233
|
*/
|
13283
13234
|
function getPairedMeetingRoomInfo() {
|
13284
13235
|
return new Promise((resolve) => {
|
13285
|
-
|
13236
|
+
ensureInitialized(runtime);
|
13286
13237
|
if (!isSupported()) {
|
13287
13238
|
throw errorNotSupportedOnPlatform;
|
13288
13239
|
}
|
13289
|
-
resolve(
|
13240
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_GetPairedMeetingRoomInfo), 'meetingRoom.getPairedMeetingRoomInfo'));
|
13290
13241
|
});
|
13291
13242
|
}
|
13292
13243
|
meetingRoom.getPairedMeetingRoomInfo = getPairedMeetingRoomInfo;
|
@@ -13305,11 +13256,11 @@ var meetingRoom;
|
|
13305
13256
|
if (!commandName || commandName.length == 0) {
|
13306
13257
|
throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');
|
13307
13258
|
}
|
13308
|
-
|
13259
|
+
ensureInitialized(runtime);
|
13309
13260
|
if (!isSupported()) {
|
13310
13261
|
throw errorNotSupportedOnPlatform;
|
13311
13262
|
}
|
13312
|
-
resolve(
|
13263
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_SendCommandToPairedMeetingRoom), 'meetingRoom.sendCommandToPairedMeetingRoom', commandName));
|
13313
13264
|
});
|
13314
13265
|
}
|
13315
13266
|
meetingRoom.sendCommandToPairedMeetingRoom = sendCommandToPairedMeetingRoom;
|
@@ -13327,12 +13278,12 @@ var meetingRoom;
|
|
13327
13278
|
if (!handler) {
|
13328
13279
|
throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');
|
13329
13280
|
}
|
13330
|
-
|
13281
|
+
ensureInitialized(runtime);
|
13331
13282
|
if (!isSupported()) {
|
13332
13283
|
throw errorNotSupportedOnPlatform;
|
13333
13284
|
}
|
13334
|
-
|
13335
|
-
|
13285
|
+
registerHandler(getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_RegisterMeetingRoomCapabilitiesUpdateHandler), 'meetingRoom.meetingRoomCapabilitiesUpdate', (capabilities) => {
|
13286
|
+
ensureInitialized(runtime);
|
13336
13287
|
handler(capabilities);
|
13337
13288
|
});
|
13338
13289
|
}
|
@@ -13352,12 +13303,12 @@ var meetingRoom;
|
|
13352
13303
|
if (!handler) {
|
13353
13304
|
throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');
|
13354
13305
|
}
|
13355
|
-
|
13306
|
+
ensureInitialized(runtime);
|
13356
13307
|
if (!isSupported()) {
|
13357
13308
|
throw errorNotSupportedOnPlatform;
|
13358
13309
|
}
|
13359
|
-
|
13360
|
-
|
13310
|
+
registerHandler(getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_RegisterMeetingRoomStatesUpdateHandler), 'meetingRoom.meetingRoomStatesUpdate', (states) => {
|
13311
|
+
ensureInitialized(runtime);
|
13361
13312
|
handler(states);
|
13362
13313
|
});
|
13363
13314
|
}
|
@@ -13374,7 +13325,7 @@ var meetingRoom;
|
|
13374
13325
|
* Limited to Microsoft-internal use
|
13375
13326
|
*/
|
13376
13327
|
function isSupported() {
|
13377
|
-
return
|
13328
|
+
return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;
|
13378
13329
|
}
|
13379
13330
|
meetingRoom.isSupported = isSupported;
|
13380
13331
|
})(meetingRoom || (meetingRoom = {}));
|
@@ -13452,7 +13403,7 @@ var messageChannels;
|
|
13452
13403
|
* Limited to Microsoft-internal use
|
13453
13404
|
*/
|
13454
13405
|
function isSupported() {
|
13455
|
-
return
|
13406
|
+
return ensureInitialized(runtime) && runtime.supports.messageChannels ? true : false;
|
13456
13407
|
}
|
13457
13408
|
messageChannels.isSupported = isSupported;
|
13458
13409
|
/**
|
@@ -13499,11 +13450,11 @@ var notifications;
|
|
13499
13450
|
* Limited to Microsoft-internal use
|
13500
13451
|
*/
|
13501
13452
|
function showNotification(showNotificationParameters) {
|
13502
|
-
|
13453
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13503
13454
|
if (!isSupported()) {
|
13504
13455
|
throw errorNotSupportedOnPlatform;
|
13505
13456
|
}
|
13506
|
-
|
13457
|
+
sendMessageToParent(getApiVersionTag(notificationsTelemetryVersionNumber, ApiName.Notifications_ShowNotification), 'notifications.showNotification', [showNotificationParameters]);
|
13507
13458
|
}
|
13508
13459
|
notifications.showNotification = showNotification;
|
13509
13460
|
/**
|
@@ -13518,7 +13469,7 @@ var notifications;
|
|
13518
13469
|
* Limited to Microsoft-internal use
|
13519
13470
|
*/
|
13520
13471
|
function isSupported() {
|
13521
|
-
return
|
13472
|
+
return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;
|
13522
13473
|
}
|
13523
13474
|
notifications.isSupported = isSupported;
|
13524
13475
|
})(notifications || (notifications = {}));
|
@@ -13613,11 +13564,11 @@ var remoteCamera;
|
|
13613
13564
|
if (!callback) {
|
13614
13565
|
throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');
|
13615
13566
|
}
|
13616
|
-
|
13567
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13617
13568
|
if (!isSupported()) {
|
13618
13569
|
throw errorNotSupportedOnPlatform;
|
13619
13570
|
}
|
13620
|
-
|
13571
|
+
sendMessageToParent(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_GetCapableParticipants), 'remoteCamera.getCapableParticipants', callback);
|
13621
13572
|
}
|
13622
13573
|
remoteCamera.getCapableParticipants = getCapableParticipants;
|
13623
13574
|
/**
|
@@ -13640,11 +13591,11 @@ var remoteCamera;
|
|
13640
13591
|
if (!callback) {
|
13641
13592
|
throw new Error('[remoteCamera.requestControl] Callback cannot be null');
|
13642
13593
|
}
|
13643
|
-
|
13594
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13644
13595
|
if (!isSupported()) {
|
13645
13596
|
throw errorNotSupportedOnPlatform;
|
13646
13597
|
}
|
13647
|
-
|
13598
|
+
sendMessageToParent(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RequestControl), 'remoteCamera.requestControl', [participant], callback);
|
13648
13599
|
}
|
13649
13600
|
remoteCamera.requestControl = requestControl;
|
13650
13601
|
/**
|
@@ -13664,11 +13615,11 @@ var remoteCamera;
|
|
13664
13615
|
if (!callback) {
|
13665
13616
|
throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');
|
13666
13617
|
}
|
13667
|
-
|
13618
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13668
13619
|
if (!isSupported()) {
|
13669
13620
|
throw errorNotSupportedOnPlatform;
|
13670
13621
|
}
|
13671
|
-
|
13622
|
+
sendMessageToParent(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_SendControlCommand), 'remoteCamera.sendControlCommand', [ControlCommand], callback);
|
13672
13623
|
}
|
13673
13624
|
remoteCamera.sendControlCommand = sendControlCommand;
|
13674
13625
|
/**
|
@@ -13684,11 +13635,11 @@ var remoteCamera;
|
|
13684
13635
|
if (!callback) {
|
13685
13636
|
throw new Error('[remoteCamera.terminateSession] Callback cannot be null');
|
13686
13637
|
}
|
13687
|
-
|
13638
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13688
13639
|
if (!isSupported()) {
|
13689
13640
|
throw errorNotSupportedOnPlatform;
|
13690
13641
|
}
|
13691
|
-
|
13642
|
+
sendMessageToParent(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_TerminateSession), 'remoteCamera.terminateSession', callback);
|
13692
13643
|
}
|
13693
13644
|
remoteCamera.terminateSession = terminateSession;
|
13694
13645
|
/**
|
@@ -13705,11 +13656,11 @@ var remoteCamera;
|
|
13705
13656
|
if (!handler) {
|
13706
13657
|
throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');
|
13707
13658
|
}
|
13708
|
-
|
13659
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13709
13660
|
if (!isSupported()) {
|
13710
13661
|
throw errorNotSupportedOnPlatform;
|
13711
13662
|
}
|
13712
|
-
|
13663
|
+
registerHandler(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnCapableParticipantsChangeHandler), 'remoteCamera.capableParticipantsChange', handler);
|
13713
13664
|
}
|
13714
13665
|
remoteCamera.registerOnCapableParticipantsChangeHandler = registerOnCapableParticipantsChangeHandler;
|
13715
13666
|
/**
|
@@ -13726,11 +13677,11 @@ var remoteCamera;
|
|
13726
13677
|
if (!handler) {
|
13727
13678
|
throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');
|
13728
13679
|
}
|
13729
|
-
|
13680
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13730
13681
|
if (!isSupported()) {
|
13731
13682
|
throw errorNotSupportedOnPlatform;
|
13732
13683
|
}
|
13733
|
-
|
13684
|
+
registerHandler(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnErrorHandler), 'remoteCamera.handlerError', handler);
|
13734
13685
|
}
|
13735
13686
|
remoteCamera.registerOnErrorHandler = registerOnErrorHandler;
|
13736
13687
|
/**
|
@@ -13747,11 +13698,11 @@ var remoteCamera;
|
|
13747
13698
|
if (!handler) {
|
13748
13699
|
throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');
|
13749
13700
|
}
|
13750
|
-
|
13701
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13751
13702
|
if (!isSupported()) {
|
13752
13703
|
throw errorNotSupportedOnPlatform;
|
13753
13704
|
}
|
13754
|
-
|
13705
|
+
registerHandler(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnDeviceStateChangeHandler), 'remoteCamera.deviceStateChange', handler);
|
13755
13706
|
}
|
13756
13707
|
remoteCamera.registerOnDeviceStateChangeHandler = registerOnDeviceStateChangeHandler;
|
13757
13708
|
/**
|
@@ -13768,11 +13719,11 @@ var remoteCamera;
|
|
13768
13719
|
if (!handler) {
|
13769
13720
|
throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');
|
13770
13721
|
}
|
13771
|
-
|
13722
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
13772
13723
|
if (!isSupported()) {
|
13773
13724
|
throw errorNotSupportedOnPlatform;
|
13774
13725
|
}
|
13775
|
-
|
13726
|
+
registerHandler(getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnSessionStatusChangeHandler), 'remoteCamera.sessionStatusChange', handler);
|
13776
13727
|
}
|
13777
13728
|
remoteCamera.registerOnSessionStatusChangeHandler = registerOnSessionStatusChangeHandler;
|
13778
13729
|
/**
|
@@ -13787,7 +13738,7 @@ var remoteCamera;
|
|
13787
13738
|
* Limited to Microsoft-internal use
|
13788
13739
|
*/
|
13789
13740
|
function isSupported() {
|
13790
|
-
return
|
13741
|
+
return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;
|
13791
13742
|
}
|
13792
13743
|
remoteCamera.isSupported = isSupported;
|
13793
13744
|
})(remoteCamera || (remoteCamera = {}));
|
@@ -13829,7 +13780,7 @@ var appEntity;
|
|
13829
13780
|
* Limited to Microsoft-internal use
|
13830
13781
|
*/
|
13831
13782
|
function selectAppEntity(threadId, categories, subEntityId, callback) {
|
13832
|
-
|
13783
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13833
13784
|
if (!isSupported()) {
|
13834
13785
|
throw errorNotSupportedOnPlatform;
|
13835
13786
|
}
|
@@ -13839,7 +13790,7 @@ var appEntity;
|
|
13839
13790
|
if (!callback) {
|
13840
13791
|
throw new Error('[appEntity.selectAppEntity] Callback cannot be null');
|
13841
13792
|
}
|
13842
|
-
|
13793
|
+
sendMessageToParent(getApiVersionTag(appEntityTelemetryVersionNumber, ApiName.AppEntity_SelectAppEntity), 'appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);
|
13843
13794
|
}
|
13844
13795
|
appEntity_1.selectAppEntity = selectAppEntity;
|
13845
13796
|
/**
|
@@ -13854,7 +13805,7 @@ var appEntity;
|
|
13854
13805
|
* Limited to Microsoft-internal use
|
13855
13806
|
*/
|
13856
13807
|
function isSupported() {
|
13857
|
-
return
|
13808
|
+
return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;
|
13858
13809
|
}
|
13859
13810
|
appEntity_1.isSupported = isSupported;
|
13860
13811
|
})(appEntity || (appEntity = {}));
|
@@ -13896,7 +13847,7 @@ var teams;
|
|
13896
13847
|
* Limited to Microsoft-internal use
|
13897
13848
|
*/
|
13898
13849
|
function getTeamChannels(groupId, callback) {
|
13899
|
-
|
13850
|
+
ensureInitialized(runtime, FrameContexts.content);
|
13900
13851
|
if (!isSupported()) {
|
13901
13852
|
throw errorNotSupportedOnPlatform;
|
13902
13853
|
}
|
@@ -13906,7 +13857,7 @@ var teams;
|
|
13906
13857
|
if (!callback) {
|
13907
13858
|
throw new Error('[teams.getTeamChannels] Callback cannot be null');
|
13908
13859
|
}
|
13909
|
-
|
13860
|
+
sendMessageToParent(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_GetTeamChannels), 'teams.getTeamChannels', [groupId], callback);
|
13910
13861
|
}
|
13911
13862
|
teams.getTeamChannels = getTeamChannels;
|
13912
13863
|
/**
|
@@ -13921,7 +13872,7 @@ var teams;
|
|
13921
13872
|
* Limited to Microsoft-internal use
|
13922
13873
|
*/
|
13923
13874
|
function refreshSiteUrl(threadId, callback) {
|
13924
|
-
|
13875
|
+
ensureInitialized(runtime);
|
13925
13876
|
if (!isSupported()) {
|
13926
13877
|
throw errorNotSupportedOnPlatform;
|
13927
13878
|
}
|
@@ -13931,7 +13882,7 @@ var teams;
|
|
13931
13882
|
if (!callback) {
|
13932
13883
|
throw new Error('[teams.refreshSiteUrl] Callback cannot be null');
|
13933
13884
|
}
|
13934
|
-
|
13885
|
+
sendMessageToParent(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_RefreshSiteUrl), 'teams.refreshSiteUrl', [threadId], callback);
|
13935
13886
|
}
|
13936
13887
|
teams.refreshSiteUrl = refreshSiteUrl;
|
13937
13888
|
/**
|
@@ -13946,7 +13897,7 @@ var teams;
|
|
13946
13897
|
* Limited to Microsoft-internal use
|
13947
13898
|
*/
|
13948
13899
|
function isSupported() {
|
13949
|
-
return
|
13900
|
+
return ensureInitialized(runtime) && runtime.supports.teams ? true : false;
|
13950
13901
|
}
|
13951
13902
|
teams.isSupported = isSupported;
|
13952
13903
|
/**
|
@@ -13975,7 +13926,7 @@ var teams;
|
|
13975
13926
|
*/
|
13976
13927
|
function getUserJoinedTeams(teamInstanceParameters) {
|
13977
13928
|
return new Promise((resolve) => {
|
13978
|
-
|
13929
|
+
ensureInitialized(runtime);
|
13979
13930
|
if (!isSupported()) {
|
13980
13931
|
throw errorNotSupportedOnPlatform;
|
13981
13932
|
}
|
@@ -13988,7 +13939,7 @@ var teams;
|
|
13988
13939
|
throw new Error(JSON.stringify(oldPlatformError));
|
13989
13940
|
}
|
13990
13941
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
13991
|
-
resolve(
|
13942
|
+
resolve(sendAndUnwrap(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_FullTrust_JoinedTeams_GetUserJoinedTeams), 'getUserJoinedTeams',
|
13992
13943
|
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
13993
13944
|
teamInstanceParameters));
|
13994
13945
|
});
|
@@ -14006,9 +13957,9 @@ var teams;
|
|
14006
13957
|
* Limited to Microsoft-internal use
|
14007
13958
|
*/
|
14008
13959
|
function isSupported() {
|
14009
|
-
return
|
14010
|
-
?
|
14011
|
-
?
|
13960
|
+
return ensureInitialized(runtime) && runtime.supports.teams
|
13961
|
+
? runtime.supports.teams.fullTrust
|
13962
|
+
? runtime.supports.teams.fullTrust.joinedTeams
|
14012
13963
|
? true
|
14013
13964
|
: false
|
14014
13965
|
: false
|
@@ -14028,11 +13979,11 @@ var teams;
|
|
14028
13979
|
*/
|
14029
13980
|
function getConfigSetting(key) {
|
14030
13981
|
return new Promise((resolve) => {
|
14031
|
-
|
13982
|
+
ensureInitialized(runtime);
|
14032
13983
|
if (!isSupported()) {
|
14033
13984
|
throw errorNotSupportedOnPlatform;
|
14034
13985
|
}
|
14035
|
-
resolve(
|
13986
|
+
resolve(sendAndUnwrap(getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_FullTrust_GetConfigSetting), 'getConfigSetting', key));
|
14036
13987
|
});
|
14037
13988
|
}
|
14038
13989
|
fullTrust.getConfigSetting = getConfigSetting;
|
@@ -14048,8 +13999,8 @@ var teams;
|
|
14048
13999
|
* Limited to Microsoft-internal use
|
14049
14000
|
*/
|
14050
14001
|
function isSupported() {
|
14051
|
-
return
|
14052
|
-
?
|
14002
|
+
return ensureInitialized(runtime) && runtime.supports.teams
|
14003
|
+
? runtime.supports.teams.fullTrust
|
14053
14004
|
? true
|
14054
14005
|
: false
|
14055
14006
|
: false;
|
@@ -14093,7 +14044,7 @@ var videoEffectsEx;
|
|
14093
14044
|
videoEffectsEx.frameProcessingTimeoutInMs = 2000;
|
14094
14045
|
const videoPerformanceMonitor = inServerSideRenderingEnvironment()
|
14095
14046
|
? undefined
|
14096
|
-
: new VideoPerformanceMonitor(
|
14047
|
+
: new VideoPerformanceMonitor(sendMessageToParent);
|
14097
14048
|
/**
|
14098
14049
|
* @hidden
|
14099
14050
|
* Error level when notifying errors to the host, the host will decide what to do acording to the error level.
|
@@ -14127,10 +14078,10 @@ var videoEffectsEx;
|
|
14127
14078
|
if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {
|
14128
14079
|
throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');
|
14129
14080
|
}
|
14130
|
-
if (
|
14131
|
-
|
14132
|
-
if ((_a =
|
14133
|
-
|
14081
|
+
if (ensureInitialized(runtime, FrameContexts.sidePanel)) {
|
14082
|
+
registerHandler(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterSetFrameProcessTimeLimitHandler), 'video.setFrameProcessTimeLimit', (timeLimit) => videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimit), false);
|
14083
|
+
if ((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream) {
|
14084
|
+
registerHandler(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterStartVideoExtensibilityVideoStreamHandler), 'video.startVideoExtensibilityVideoStream', (mediaStreamInfo) => videoEffectsEx_awaiter(this, void 0, void 0, function* () {
|
14134
14085
|
const { streamId, metadataInTexture } = mediaStreamInfo;
|
14135
14086
|
const handler = videoPerformanceMonitor
|
14136
14087
|
? createMonitoredVideoFrameHandler(parameters.videoFrameHandler, videoPerformanceMonitor)
|
@@ -14139,10 +14090,10 @@ var videoEffectsEx;
|
|
14139
14090
|
? yield processMediaStreamWithMetadata(streamId, handler, notifyError, videoPerformanceMonitor)
|
14140
14091
|
: yield processMediaStream(streamId, handler, notifyError, videoPerformanceMonitor);
|
14141
14092
|
}), false);
|
14142
|
-
|
14093
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_MediaStream_RegisterForVideoFrame), 'video.mediaStream.registerForVideoFrame', [parameters.config]);
|
14143
14094
|
}
|
14144
|
-
else if ((_b =
|
14145
|
-
|
14095
|
+
else if ((_b = runtime.supports.video) === null || _b === void 0 ? void 0 : _b.sharedFrame) {
|
14096
|
+
registerHandler(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterNewVideoFrameHandler), 'video.newVideoFrame', (videoBufferData) => {
|
14146
14097
|
if (videoBufferData) {
|
14147
14098
|
videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);
|
14148
14099
|
const clearProcessingTimeout = createFrameProcessingTimeout();
|
@@ -14154,7 +14105,7 @@ var videoEffectsEx;
|
|
14154
14105
|
}, notifyError);
|
14155
14106
|
}
|
14156
14107
|
}, false);
|
14157
|
-
|
14108
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterForVideoFrame), 'video.registerForVideoFrame', [parameters.config]);
|
14158
14109
|
}
|
14159
14110
|
else {
|
14160
14111
|
// should not happen if isSupported() is true
|
@@ -14203,11 +14154,11 @@ var videoEffectsEx;
|
|
14203
14154
|
* Limited to Microsoft-internal use
|
14204
14155
|
*/
|
14205
14156
|
function notifySelectedVideoEffectChanged(effectChangeType, effectId, effectParam) {
|
14206
|
-
|
14157
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
14207
14158
|
if (!isSupported()) {
|
14208
14159
|
throw errorNotSupportedOnPlatform;
|
14209
14160
|
}
|
14210
|
-
|
14161
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifySelectedVideoEffectChanged), 'video.videoEffectChanged', [effectChangeType, effectId, effectParam]);
|
14211
14162
|
}
|
14212
14163
|
videoEffectsEx.notifySelectedVideoEffectChanged = notifySelectedVideoEffectChanged;
|
14213
14164
|
/**
|
@@ -14220,12 +14171,12 @@ var videoEffectsEx;
|
|
14220
14171
|
* Limited to Microsoft-internal use
|
14221
14172
|
*/
|
14222
14173
|
function registerForVideoEffect(callback) {
|
14223
|
-
|
14174
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
14224
14175
|
if (!isSupported()) {
|
14225
14176
|
throw errorNotSupportedOnPlatform;
|
14226
14177
|
}
|
14227
|
-
|
14228
|
-
|
14178
|
+
registerHandler(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterEffectParameterChangeHandler), 'video.effectParameterChange', createEffectParameterChangeCallback(callback, videoPerformanceMonitor), false);
|
14179
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterForVideoEffect), 'video.registerForVideoEffect');
|
14229
14180
|
}
|
14230
14181
|
videoEffectsEx.registerForVideoEffect = registerForVideoEffect;
|
14231
14182
|
/**
|
@@ -14237,11 +14188,11 @@ var videoEffectsEx;
|
|
14237
14188
|
* Limited to Microsoft-internal use
|
14238
14189
|
*/
|
14239
14190
|
function updatePersonalizedEffects(effects) {
|
14240
|
-
|
14191
|
+
ensureInitialized(runtime, FrameContexts.sidePanel);
|
14241
14192
|
if (!videoEffects.isSupported()) {
|
14242
14193
|
throw errorNotSupportedOnPlatform;
|
14243
14194
|
}
|
14244
|
-
|
14195
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_UpdatePersonalizedEffects), 'video.personalizedEffectsChanged', [effects]);
|
14245
14196
|
}
|
14246
14197
|
videoEffectsEx.updatePersonalizedEffects = updatePersonalizedEffects;
|
14247
14198
|
/**
|
@@ -14258,7 +14209,7 @@ var videoEffectsEx;
|
|
14258
14209
|
* Limited to Microsoft-internal use
|
14259
14210
|
*/
|
14260
14211
|
function isSupported() {
|
14261
|
-
|
14212
|
+
ensureInitialized(runtime);
|
14262
14213
|
return videoEffects.isSupported();
|
14263
14214
|
}
|
14264
14215
|
videoEffectsEx.isSupported = isSupported;
|
@@ -14272,7 +14223,7 @@ var videoEffectsEx;
|
|
14272
14223
|
* Limited to Microsoft-internal use
|
14273
14224
|
*/
|
14274
14225
|
function notifyVideoFrameProcessed(timestamp) {
|
14275
|
-
|
14226
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifyVideoFrameProcessed), 'video.videoFrameProcessed', [timestamp]);
|
14276
14227
|
}
|
14277
14228
|
/**
|
14278
14229
|
* @hidden
|
@@ -14285,7 +14236,7 @@ var videoEffectsEx;
|
|
14285
14236
|
* Limited to Microsoft-internal use
|
14286
14237
|
*/
|
14287
14238
|
function notifyError(errorMessage, errorLevel = ErrorLevel.Warn) {
|
14288
|
-
|
14239
|
+
sendMessageToParent(getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifyError), 'video.notifyError', [errorMessage, errorLevel]);
|
14289
14240
|
}
|
14290
14241
|
/**
|
14291
14242
|
* @hidden
|
@@ -14298,7 +14249,7 @@ var videoEffectsEx;
|
|
14298
14249
|
* Limited to Microsoft-internal use
|
14299
14250
|
*/
|
14300
14251
|
function notifyFatalError(errorMessage) {
|
14301
|
-
|
14252
|
+
ensureInitialized(runtime);
|
14302
14253
|
if (!videoEffects.isSupported()) {
|
14303
14254
|
throw errorNotSupportedOnPlatform;
|
14304
14255
|
}
|