@microsoft/teams-js 2.30.0 → 2.31.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/_virtual/__polyfill-node.os.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.os.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -1
- package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +1 -0
- package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +1 -0
- package/dist/esm/packages/teams-js/dts/index.d.ts +2 -0
- package/dist/esm/packages/teams-js/dts/internal/VideoFrameTypes.d.ts +78 -0
- package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +8 -0
- package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +16 -0
- package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +162 -0
- package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +146 -0
- package/dist/esm/packages/teams-js/dts/internal/deepLinkConstants.d.ts +26 -0
- package/dist/esm/packages/teams-js/dts/internal/deepLinkUtilities.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/internal/emailAddressValidation.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +12 -0
- package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +80 -0
- package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +47 -0
- package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +61 -0
- package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +94 -0
- package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +95 -0
- package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +73 -0
- package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.d.ts +105 -0
- package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +11 -0
- package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +30 -0
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +344 -0
- package/dist/esm/packages/teams-js/dts/internal/typeCheckUtilities.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +200 -0
- package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +11 -0
- package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +31 -0
- package/dist/esm/packages/teams-js/dts/internal/videoFrameTick.d.ts +10 -0
- package/dist/esm/packages/teams-js/dts/internal/videoPerformanceMonitor.d.ts +54 -0
- package/dist/esm/packages/teams-js/dts/internal/videoPerformanceStatistics.d.ts +49 -0
- package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +89 -0
- package/dist/esm/packages/teams-js/dts/private/constants.d.ts +9 -0
- package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +152 -0
- package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +39 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +378 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +75 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +112 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +49 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +123 -0
- package/dist/esm/packages/teams-js/dts/private/files.d.ts +758 -0
- package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +176 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +20 -0
- package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +250 -0
- package/dist/esm/packages/teams-js/dts/private/logs.d.ts +25 -0
- package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +203 -0
- package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +107 -0
- package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +26 -0
- package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +81 -0
- package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +60 -0
- package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +298 -0
- package/dist/esm/packages/teams-js/dts/private/teams.d.ts +116 -0
- package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +244 -0
- package/dist/esm/packages/teams-js/dts/public/adaptiveCards.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/public/app.d.ts +592 -0
- package/dist/esm/packages/teams-js/dts/public/appId.d.ts +33 -0
- package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +57 -0
- package/dist/esm/packages/teams-js/dts/public/appInstallDialog.d.ts +18 -0
- package/dist/esm/packages/teams-js/dts/public/appWindow.d.ts +66 -0
- package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +409 -0
- package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +53 -0
- package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +40 -0
- package/dist/esm/packages/teams-js/dts/public/call.d.ts +53 -0
- package/dist/esm/packages/teams-js/dts/public/chat.d.ts +66 -0
- package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +34 -0
- package/dist/esm/packages/teams-js/dts/public/constants.d.ts +179 -0
- package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +286 -0
- package/dist/esm/packages/teams-js/dts/public/emailAddress.d.ts +12 -0
- package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +100 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +44 -0
- package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +1133 -0
- package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +221 -0
- package/dist/esm/packages/teams-js/dts/public/location.d.ts +86 -0
- package/dist/esm/packages/teams-js/dts/public/mail.d.ts +95 -0
- package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +321 -0
- package/dist/esm/packages/teams-js/dts/public/media.d.ts +440 -0
- package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +906 -0
- package/dist/esm/packages/teams-js/dts/public/menus.d.ts +188 -0
- package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +58 -0
- package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +45 -0
- package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +15 -0
- package/dist/esm/packages/teams-js/dts/public/pages.d.ts +574 -0
- package/dist/esm/packages/teams-js/dts/public/people.d.ts +75 -0
- package/dist/esm/packages/teams-js/dts/public/profile.d.ts +127 -0
- package/dist/esm/packages/teams-js/dts/public/publicAPIs.d.ts +218 -0
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +207 -0
- package/dist/esm/packages/teams-js/dts/public/search.d.ts +91 -0
- package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +32 -0
- package/dist/esm/packages/teams-js/dts/public/serializable.interface.d.ts +17 -0
- package/dist/esm/packages/teams-js/dts/public/settings.d.ts +101 -0
- package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +124 -0
- package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +104 -0
- package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +62 -0
- package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +77 -0
- package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +119 -0
- package/dist/esm/packages/teams-js/dts/public/version.d.ts +5 -0
- package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +213 -0
- package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +192 -0
- package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +27 -0
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/responseHandler.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -1
- package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
- package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
- package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
- package/dist/esm/packages/teams-js/src/public/call.js +1 -1
- package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages.js +1 -1
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/serializable.interface.js +1 -0
- package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
- package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.d.ts +10740 -10768
- package/dist/umd/MicrosoftTeams.js +1571 -1359
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -51
- package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +0 -1
@@ -1005,21 +1005,21 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1005
1005
|
NotificationTypes: () => (/* reexport */ NotificationTypes),
|
1006
1006
|
ParentAppWindow: () => (/* reexport */ ParentAppWindow),
|
1007
1007
|
SecondaryM365ContentIdName: () => (/* reexport */ SecondaryM365ContentIdName),
|
1008
|
-
TaskModuleDimension: () => (/* reexport */
|
1008
|
+
TaskModuleDimension: () => (/* reexport */ DialogDimension),
|
1009
1009
|
TeamType: () => (/* reexport */ TeamType),
|
1010
1010
|
UserSettingTypes: () => (/* reexport */ UserSettingTypes),
|
1011
1011
|
UserTeamRole: () => (/* reexport */ UserTeamRole),
|
1012
1012
|
ViewerActionTypes: () => (/* reexport */ ViewerActionTypes),
|
1013
|
-
app: () => (/* reexport */
|
1013
|
+
app: () => (/* reexport */ app_namespaceObject),
|
1014
1014
|
appEntity: () => (/* reexport */ appEntity),
|
1015
|
-
appInitialization: () => (/* reexport */
|
1016
|
-
appInstallDialog: () => (/* reexport */
|
1017
|
-
authentication: () => (/* reexport */
|
1018
|
-
barCode: () => (/* reexport */
|
1019
|
-
calendar: () => (/* reexport */
|
1020
|
-
call: () => (/* reexport */
|
1015
|
+
appInitialization: () => (/* reexport */ appInitialization_namespaceObject),
|
1016
|
+
appInstallDialog: () => (/* reexport */ appInstallDialog_namespaceObject),
|
1017
|
+
authentication: () => (/* reexport */ authentication_namespaceObject),
|
1018
|
+
barCode: () => (/* reexport */ barCode_namespaceObject),
|
1019
|
+
calendar: () => (/* reexport */ calendar_namespaceObject),
|
1020
|
+
call: () => (/* reexport */ call_namespaceObject),
|
1021
1021
|
chat: () => (/* reexport */ chat),
|
1022
|
-
clipboard: () => (/* reexport */
|
1022
|
+
clipboard: () => (/* reexport */ clipboard_namespaceObject),
|
1023
1023
|
conversations: () => (/* reexport */ conversations),
|
1024
1024
|
copilot: () => (/* reexport */ copilot),
|
1025
1025
|
dialog: () => (/* reexport */ dialog),
|
@@ -1033,11 +1033,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1033
1033
|
files: () => (/* reexport */ files),
|
1034
1034
|
geoLocation: () => (/* reexport */ geoLocation),
|
1035
1035
|
getAdaptiveCardSchemaVersion: () => (/* reexport */ getAdaptiveCardSchemaVersion),
|
1036
|
-
getContext: () => (/* reexport */
|
1036
|
+
getContext: () => (/* reexport */ publicAPIs_getContext),
|
1037
1037
|
getMruTabInstances: () => (/* reexport */ getMruTabInstances),
|
1038
1038
|
getTabInstances: () => (/* reexport */ getTabInstances),
|
1039
1039
|
hostEntity: () => (/* reexport */ hostEntity),
|
1040
|
-
initialize: () => (/* reexport */
|
1040
|
+
initialize: () => (/* reexport */ publicAPIs_initialize),
|
1041
1041
|
initializeWithFrameContext: () => (/* reexport */ initializeWithFrameContext),
|
1042
1042
|
liveShare: () => (/* reexport */ liveShare),
|
1043
1043
|
location: () => (/* reexport */ location_location),
|
@@ -1080,7 +1080,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1080
1080
|
sendCustomEvent: () => (/* reexport */ sendCustomEvent),
|
1081
1081
|
sendCustomMessage: () => (/* reexport */ sendCustomMessage),
|
1082
1082
|
setFrameContext: () => (/* reexport */ setFrameContext),
|
1083
|
-
settings: () => (/* reexport */
|
1083
|
+
settings: () => (/* reexport */ settings_namespaceObject),
|
1084
1084
|
shareDeepLink: () => (/* reexport */ shareDeepLink),
|
1085
1085
|
sharing: () => (/* reexport */ sharing),
|
1086
1086
|
stageView: () => (/* reexport */ stageView),
|
@@ -1096,6 +1096,111 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1096
1096
|
webStorage: () => (/* reexport */ webStorage)
|
1097
1097
|
});
|
1098
1098
|
|
1099
|
+
// NAMESPACE OBJECT: ./src/public/app.ts
|
1100
|
+
var app_namespaceObject = {};
|
1101
|
+
__webpack_require__.r(app_namespaceObject);
|
1102
|
+
__webpack_require__.d(app_namespaceObject, {
|
1103
|
+
ExpectedFailureReason: () => (ExpectedFailureReason),
|
1104
|
+
FailedReason: () => (FailedReason),
|
1105
|
+
Messages: () => (Messages),
|
1106
|
+
_initialize: () => (_initialize),
|
1107
|
+
_uninitialize: () => (_uninitialize),
|
1108
|
+
getContext: () => (getContext),
|
1109
|
+
getFrameContext: () => (getFrameContext),
|
1110
|
+
initialize: () => (initialize),
|
1111
|
+
isInitialized: () => (isInitialized),
|
1112
|
+
lifecycle: () => (lifecycle),
|
1113
|
+
notifyAppLoaded: () => (notifyAppLoaded),
|
1114
|
+
notifyExpectedFailure: () => (notifyExpectedFailure),
|
1115
|
+
notifyFailure: () => (notifyFailure),
|
1116
|
+
notifySuccess: () => (notifySuccess),
|
1117
|
+
openLink: () => (openLink),
|
1118
|
+
registerOnThemeChangeHandler: () => (registerOnThemeChangeHandler)
|
1119
|
+
});
|
1120
|
+
|
1121
|
+
// NAMESPACE OBJECT: ./src/public/authentication.ts
|
1122
|
+
var authentication_namespaceObject = {};
|
1123
|
+
__webpack_require__.r(authentication_namespaceObject);
|
1124
|
+
__webpack_require__.d(authentication_namespaceObject, {
|
1125
|
+
DataResidency: () => (DataResidency),
|
1126
|
+
authenticate: () => (authenticate),
|
1127
|
+
getAuthToken: () => (getAuthToken),
|
1128
|
+
getUser: () => (getUser),
|
1129
|
+
initialize: () => (authentication_initialize),
|
1130
|
+
notifyFailure: () => (authentication_notifyFailure),
|
1131
|
+
notifySuccess: () => (authentication_notifySuccess),
|
1132
|
+
registerAuthenticationHandlers: () => (registerAuthenticationHandlers)
|
1133
|
+
});
|
1134
|
+
|
1135
|
+
// NAMESPACE OBJECT: ./src/public/appInstallDialog.ts
|
1136
|
+
var appInstallDialog_namespaceObject = {};
|
1137
|
+
__webpack_require__.r(appInstallDialog_namespaceObject);
|
1138
|
+
__webpack_require__.d(appInstallDialog_namespaceObject, {
|
1139
|
+
isSupported: () => (isSupported),
|
1140
|
+
openAppInstallDialog: () => (openAppInstallDialog)
|
1141
|
+
});
|
1142
|
+
|
1143
|
+
// NAMESPACE OBJECT: ./src/public/barCode.ts
|
1144
|
+
var barCode_namespaceObject = {};
|
1145
|
+
__webpack_require__.r(barCode_namespaceObject);
|
1146
|
+
__webpack_require__.d(barCode_namespaceObject, {
|
1147
|
+
hasPermission: () => (hasPermission),
|
1148
|
+
isSupported: () => (barCode_isSupported),
|
1149
|
+
requestPermission: () => (requestPermission),
|
1150
|
+
scanBarCode: () => (scanBarCode)
|
1151
|
+
});
|
1152
|
+
|
1153
|
+
// NAMESPACE OBJECT: ./src/public/clipboard.ts
|
1154
|
+
var clipboard_namespaceObject = {};
|
1155
|
+
__webpack_require__.r(clipboard_namespaceObject);
|
1156
|
+
__webpack_require__.d(clipboard_namespaceObject, {
|
1157
|
+
isSupported: () => (clipboard_isSupported),
|
1158
|
+
read: () => (read),
|
1159
|
+
write: () => (write)
|
1160
|
+
});
|
1161
|
+
|
1162
|
+
// NAMESPACE OBJECT: ./src/public/calendar.ts
|
1163
|
+
var calendar_namespaceObject = {};
|
1164
|
+
__webpack_require__.r(calendar_namespaceObject);
|
1165
|
+
__webpack_require__.d(calendar_namespaceObject, {
|
1166
|
+
composeMeeting: () => (composeMeeting),
|
1167
|
+
isSupported: () => (calendar_isSupported),
|
1168
|
+
openCalendarItem: () => (openCalendarItem)
|
1169
|
+
});
|
1170
|
+
|
1171
|
+
// NAMESPACE OBJECT: ./src/public/call.ts
|
1172
|
+
var call_namespaceObject = {};
|
1173
|
+
__webpack_require__.r(call_namespaceObject);
|
1174
|
+
__webpack_require__.d(call_namespaceObject, {
|
1175
|
+
CallModalities: () => (CallModalities),
|
1176
|
+
isSupported: () => (call_isSupported),
|
1177
|
+
startCall: () => (startCall)
|
1178
|
+
});
|
1179
|
+
|
1180
|
+
// NAMESPACE OBJECT: ./src/public/appInitialization.ts
|
1181
|
+
var appInitialization_namespaceObject = {};
|
1182
|
+
__webpack_require__.r(appInitialization_namespaceObject);
|
1183
|
+
__webpack_require__.d(appInitialization_namespaceObject, {
|
1184
|
+
ExpectedFailureReason: () => (ExpectedFailureReason),
|
1185
|
+
FailedReason: () => (FailedReason),
|
1186
|
+
Messages: () => (Messages),
|
1187
|
+
notifyAppLoaded: () => (appInitialization_notifyAppLoaded),
|
1188
|
+
notifyExpectedFailure: () => (appInitialization_notifyExpectedFailure),
|
1189
|
+
notifyFailure: () => (appInitialization_notifyFailure),
|
1190
|
+
notifySuccess: () => (appInitialization_notifySuccess)
|
1191
|
+
});
|
1192
|
+
|
1193
|
+
// NAMESPACE OBJECT: ./src/public/settings.ts
|
1194
|
+
var settings_namespaceObject = {};
|
1195
|
+
__webpack_require__.r(settings_namespaceObject);
|
1196
|
+
__webpack_require__.d(settings_namespaceObject, {
|
1197
|
+
getSettings: () => (getSettings),
|
1198
|
+
registerOnRemoveHandler: () => (registerOnRemoveHandler),
|
1199
|
+
registerOnSaveHandler: () => (registerOnSaveHandler),
|
1200
|
+
setSettings: () => (setSettings),
|
1201
|
+
setValidityState: () => (setValidityState)
|
1202
|
+
});
|
1203
|
+
|
1099
1204
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js
|
1100
1205
|
var browser = __webpack_require__(815);
|
1101
1206
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
|
@@ -2411,7 +2516,7 @@ var DialogDimension;
|
|
2411
2516
|
* As of TeamsJS v2.0.0, please use {@link DialogDimension} instead.
|
2412
2517
|
*/
|
2413
2518
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2414
|
-
|
2519
|
+
|
2415
2520
|
/**
|
2416
2521
|
* The type of the channel with which the content is associated.
|
2417
2522
|
*/
|
@@ -3506,12 +3611,27 @@ const _minRuntimeConfigToUninitialize = {
|
|
3506
3611
|
},
|
3507
3612
|
};
|
3508
3613
|
|
3614
|
+
;// CONCATENATED MODULE: ./src/public/serializable.interface.ts
|
3615
|
+
/**
|
3616
|
+
* @hidden
|
3617
|
+
* @internal
|
3618
|
+
* Used by the communication layer to make sure that an argument being passed to the host is serializable.
|
3619
|
+
* @param arg The argument to evaluate
|
3620
|
+
* @returns Whether or not the argument is serializable.
|
3621
|
+
*/
|
3622
|
+
function isSerializable(arg) {
|
3623
|
+
return (arg !== undefined &&
|
3624
|
+
arg !== null &&
|
3625
|
+
arg.serialize !== undefined &&
|
3626
|
+
typeof arg.serialize === 'function');
|
3627
|
+
}
|
3628
|
+
|
3509
3629
|
;// CONCATENATED MODULE: ./src/public/version.ts
|
3510
3630
|
/**
|
3511
3631
|
* @hidden
|
3512
3632
|
* Package version.
|
3513
3633
|
*/
|
3514
|
-
const version = "2.
|
3634
|
+
const version = "2.31.0-beta.0";
|
3515
3635
|
|
3516
3636
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
3517
3637
|
|
@@ -3778,74 +3898,6 @@ function validateOrigin(messageOrigin) {
|
|
3778
3898
|
});
|
3779
3899
|
}
|
3780
3900
|
|
3781
|
-
;// CONCATENATED MODULE: ./src/internal/appIdValidation.ts
|
3782
|
-
|
3783
|
-
/**
|
3784
|
-
* This function can be used to validate if a string is a "valid" app id.
|
3785
|
-
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
3786
|
-
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
3787
|
-
* However, there are some older internal/hard-coded apps which violate this schema and use names like com.microsoft.teamspace.tab.youtube.
|
3788
|
-
* For compatibility with these legacy apps, we unfortunately cannot securely and completely validate app ids as UUIDs. Based
|
3789
|
-
* on this, the validation is limited to checking for script tags, length, and non-printable characters.
|
3790
|
-
*
|
3791
|
-
* @param potentialAppId A string to check if it's a "valid" app id
|
3792
|
-
* @throws Error with a message describing the exact validation violation
|
3793
|
-
*/
|
3794
|
-
function validateStringAsAppId(potentialAppId) {
|
3795
|
-
if (hasScriptTags(potentialAppId)) {
|
3796
|
-
throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains script tags.`);
|
3797
|
-
}
|
3798
|
-
if (!isStringWithinAppIdLengthLimits(potentialAppId)) {
|
3799
|
-
throw new Error(`Potential app id (${potentialAppId}) is invalid; its length ${potentialAppId.length} is not within the length limits (${minimumValidAppIdLength}-${maximumValidAppIdLength}).`);
|
3800
|
-
}
|
3801
|
-
if (doesStringContainNonPrintableCharacters(potentialAppId)) {
|
3802
|
-
throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains non-printable characters.`);
|
3803
|
-
}
|
3804
|
-
}
|
3805
|
-
const minimumValidAppIdLength = 4;
|
3806
|
-
const maximumValidAppIdLength = 256;
|
3807
|
-
function isStringWithinAppIdLengthLimits(potentialAppId) {
|
3808
|
-
return potentialAppId.length < maximumValidAppIdLength && potentialAppId.length > minimumValidAppIdLength;
|
3809
|
-
}
|
3810
|
-
function doesStringContainNonPrintableCharacters(str) {
|
3811
|
-
return [...str].some((char) => {
|
3812
|
-
const charCode = char.charCodeAt(0);
|
3813
|
-
return charCode < 32 || charCode > 126;
|
3814
|
-
});
|
3815
|
-
}
|
3816
|
-
|
3817
|
-
;// CONCATENATED MODULE: ./src/public/appId.ts
|
3818
|
-
|
3819
|
-
/**
|
3820
|
-
* A strongly-typed class used to represent a "valid" app id.
|
3821
|
-
*
|
3822
|
-
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
3823
|
-
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
3824
|
-
* However, there are some older internal/hard-coded apps which violate this schema and use names like
|
3825
|
-
* com.microsoft.teamspace.tab.youtube. For compatibility with these legacy apps, we unfortunately cannot
|
3826
|
-
* securely and completely validate app ids as UUIDs. Based on this, the validation is limited to checking
|
3827
|
-
* for script tags, length, and non-printable characters. Validation will be updated in the future to ensure
|
3828
|
-
* the app id is a valid UUID as legacy apps update.
|
3829
|
-
*/
|
3830
|
-
class AppId {
|
3831
|
-
/**
|
3832
|
-
* Creates a strongly-typed AppId from a string
|
3833
|
-
*
|
3834
|
-
* @param appIdAsString An app id represented as a string
|
3835
|
-
* @throws Error with a message describing the exact validation violation
|
3836
|
-
*/
|
3837
|
-
constructor(appIdAsString) {
|
3838
|
-
this.appIdAsString = appIdAsString;
|
3839
|
-
validateStringAsAppId(appIdAsString);
|
3840
|
-
}
|
3841
|
-
/**
|
3842
|
-
* Returns the app id as a string
|
3843
|
-
*/
|
3844
|
-
toString() {
|
3845
|
-
return this.appIdAsString;
|
3846
|
-
}
|
3847
|
-
}
|
3848
|
-
|
3849
3901
|
;// CONCATENATED MODULE: ./src/private/messageChannels.ts
|
3850
3902
|
var messageChannels_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3851
3903
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
@@ -4025,7 +4077,14 @@ var messageChannels;
|
|
4025
4077
|
messageChannels.isSupported = isSupported;
|
4026
4078
|
})(messageChannels || (messageChannels = {}));
|
4027
4079
|
|
4028
|
-
;// CONCATENATED MODULE: ./src/public/
|
4080
|
+
;// CONCATENATED MODULE: ./src/public/app.ts
|
4081
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
4082
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
4083
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
4084
|
+
|
4085
|
+
|
4086
|
+
|
4087
|
+
// Conflict with some names
|
4029
4088
|
|
4030
4089
|
|
4031
4090
|
|
@@ -4035,394 +4094,779 @@ var messageChannels;
|
|
4035
4094
|
|
4036
4095
|
|
4037
4096
|
/**
|
4038
|
-
*
|
4039
|
-
*
|
4040
|
-
* This object is used for starting or completing authentication flows.
|
4097
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
4041
4098
|
*/
|
4099
|
+
const appTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
4042
4100
|
/**
|
4043
|
-
*
|
4101
|
+
* Namespace to interact with app initialization and lifecycle.
|
4044
4102
|
*/
|
4045
|
-
const
|
4046
|
-
|
4047
|
-
|
4048
|
-
|
4049
|
-
|
4050
|
-
|
4103
|
+
const appLogger = getLogger('app');
|
4104
|
+
// ::::::::::::::::::::::: MicrosoftTeams client SDK public API ::::::::::::::::::::
|
4105
|
+
/** App Initialization Messages */
|
4106
|
+
const Messages = {
|
4107
|
+
/** App loaded. */
|
4108
|
+
AppLoaded: 'appInitialization.appLoaded',
|
4109
|
+
/** App initialized successfully. */
|
4110
|
+
Success: 'appInitialization.success',
|
4111
|
+
/** App initialization failed. */
|
4112
|
+
Failure: 'appInitialization.failure',
|
4113
|
+
/** App initialization expected failure. */
|
4114
|
+
ExpectedFailure: 'appInitialization.expectedFailure',
|
4115
|
+
};
|
4116
|
+
/**
|
4117
|
+
* Describes errors that caused app initialization to fail
|
4118
|
+
*/
|
4119
|
+
var FailedReason;
|
4120
|
+
(function (FailedReason) {
|
4051
4121
|
/**
|
4052
|
-
*
|
4053
|
-
* @internal
|
4054
|
-
* Limited to Microsoft-internal use; automatically called when library is initialized
|
4122
|
+
* Authentication failed
|
4055
4123
|
*/
|
4056
|
-
|
4057
|
-
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.registerAuthenticateSuccessHandler" /* ApiName.Authentication_RegisterAuthenticateSuccessHandler */), 'authentication.authenticate.success', handleSuccess, false);
|
4058
|
-
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.registerAuthenticateFailureHandler" /* ApiName.Authentication_RegisterAuthenticateFailureHandler */), 'authentication.authenticate.failure', handleFailure, false);
|
4059
|
-
}
|
4060
|
-
authentication.initialize = initialize;
|
4061
|
-
let authParams;
|
4124
|
+
FailedReason["AuthFailed"] = "AuthFailed";
|
4062
4125
|
/**
|
4063
|
-
*
|
4064
|
-
* As of TeamsJS v2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}
|
4065
|
-
*
|
4066
|
-
* Registers handlers to be called with the result of an authentication flow triggered using {@link authentication.authenticate authentication.authenticate(authenticateParameters?: AuthenticateParameters): void}
|
4067
|
-
*
|
4068
|
-
* @param authenticateParameters - Configuration for authentication flow pop-up result communication
|
4126
|
+
* The application timed out
|
4069
4127
|
*/
|
4070
|
-
|
4071
|
-
authParams = authenticateParameters;
|
4072
|
-
}
|
4073
|
-
authentication.registerAuthenticationHandlers = registerAuthenticationHandlers;
|
4074
|
-
function authenticate(authenticateParameters) {
|
4075
|
-
const isDifferentParamsInCall = authenticateParameters !== undefined;
|
4076
|
-
const authenticateParams = isDifferentParamsInCall
|
4077
|
-
? authenticateParameters
|
4078
|
-
: authParams;
|
4079
|
-
if (!authenticateParams) {
|
4080
|
-
throw new Error('No parameters are provided for authentication');
|
4081
|
-
}
|
4082
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
4083
|
-
const apiVersionTag = authenticateParams.successCallback || authenticateParams.failureCallback
|
4084
|
-
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.authenticate" /* ApiName.Authentication_Authenticate */)
|
4085
|
-
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.authenticate" /* ApiName.Authentication_Authenticate */);
|
4086
|
-
return authenticateHelper(apiVersionTag, authenticateParams)
|
4087
|
-
.then((value) => {
|
4088
|
-
try {
|
4089
|
-
if (authenticateParams && authenticateParams.successCallback) {
|
4090
|
-
authenticateParams.successCallback(value);
|
4091
|
-
return '';
|
4092
|
-
}
|
4093
|
-
return value;
|
4094
|
-
}
|
4095
|
-
finally {
|
4096
|
-
if (!isDifferentParamsInCall) {
|
4097
|
-
authParams = undefined;
|
4098
|
-
}
|
4099
|
-
}
|
4100
|
-
})
|
4101
|
-
.catch((err) => {
|
4102
|
-
try {
|
4103
|
-
if (authenticateParams && authenticateParams.failureCallback) {
|
4104
|
-
authenticateParams.failureCallback(err.message);
|
4105
|
-
return '';
|
4106
|
-
}
|
4107
|
-
throw err;
|
4108
|
-
}
|
4109
|
-
finally {
|
4110
|
-
if (!isDifferentParamsInCall) {
|
4111
|
-
authParams = undefined;
|
4112
|
-
}
|
4113
|
-
}
|
4114
|
-
});
|
4115
|
-
}
|
4116
|
-
authentication.authenticate = authenticate;
|
4117
|
-
function authenticateHelper(apiVersionTag, authenticateParameters) {
|
4118
|
-
return new Promise((resolve, reject) => {
|
4119
|
-
if (GlobalVars.hostClientType !== HostClientType.web) {
|
4120
|
-
// Convert any relative URLs into absolute URLs before sending them over to the parent window.
|
4121
|
-
const fullyQualifiedURL = fullyQualifyUrlString(authenticateParameters.url);
|
4122
|
-
validateUrl(fullyQualifiedURL);
|
4123
|
-
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
4124
|
-
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.authenticate', [
|
4125
|
-
fullyQualifiedURL.href,
|
4126
|
-
authenticateParameters.width,
|
4127
|
-
authenticateParameters.height,
|
4128
|
-
authenticateParameters.isExternal,
|
4129
|
-
]).then(([success, response]) => {
|
4130
|
-
if (success) {
|
4131
|
-
return response;
|
4132
|
-
}
|
4133
|
-
else {
|
4134
|
-
throw new Error(response);
|
4135
|
-
}
|
4136
|
-
}));
|
4137
|
-
}
|
4138
|
-
else {
|
4139
|
-
// Open an authentication window with the parameters provided by the caller.
|
4140
|
-
authHandlers = {
|
4141
|
-
success: resolve,
|
4142
|
-
fail: reject,
|
4143
|
-
};
|
4144
|
-
openAuthenticationWindow(authenticateParameters);
|
4145
|
-
}
|
4146
|
-
});
|
4147
|
-
}
|
4148
|
-
function getAuthToken(authTokenRequest) {
|
4149
|
-
ensureInitializeCalled();
|
4150
|
-
const apiVersionTag = authTokenRequest && (authTokenRequest.successCallback || authTokenRequest.failureCallback)
|
4151
|
-
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.getAuthToken" /* ApiName.Authentication_GetAuthToken */)
|
4152
|
-
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.getAuthToken" /* ApiName.Authentication_GetAuthToken */);
|
4153
|
-
return getAuthTokenHelper(apiVersionTag, authTokenRequest)
|
4154
|
-
.then((value) => {
|
4155
|
-
if (authTokenRequest && authTokenRequest.successCallback) {
|
4156
|
-
authTokenRequest.successCallback(value);
|
4157
|
-
return '';
|
4158
|
-
}
|
4159
|
-
return value;
|
4160
|
-
})
|
4161
|
-
.catch((err) => {
|
4162
|
-
if (authTokenRequest && authTokenRequest.failureCallback) {
|
4163
|
-
authTokenRequest.failureCallback(err.message);
|
4164
|
-
return '';
|
4165
|
-
}
|
4166
|
-
throw err;
|
4167
|
-
});
|
4168
|
-
}
|
4169
|
-
authentication.getAuthToken = getAuthToken;
|
4170
|
-
function getAuthTokenHelper(apiVersionTag, authTokenRequest) {
|
4171
|
-
return new Promise((resolve) => {
|
4172
|
-
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getAuthToken', [
|
4173
|
-
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.resources,
|
4174
|
-
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.claims,
|
4175
|
-
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.silent,
|
4176
|
-
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.tenantId,
|
4177
|
-
]));
|
4178
|
-
}).then(([success, result]) => {
|
4179
|
-
if (success) {
|
4180
|
-
return result;
|
4181
|
-
}
|
4182
|
-
else {
|
4183
|
-
throw new Error(result);
|
4184
|
-
}
|
4185
|
-
});
|
4186
|
-
}
|
4187
|
-
function getUser(userRequest) {
|
4188
|
-
ensureInitializeCalled();
|
4189
|
-
const apiVersionTag = userRequest && (userRequest.successCallback || userRequest.failureCallback)
|
4190
|
-
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.getUser" /* ApiName.Authentication_GetUser */)
|
4191
|
-
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.getUser" /* ApiName.Authentication_GetUser */);
|
4192
|
-
return getUserHelper(apiVersionTag)
|
4193
|
-
.then((value) => {
|
4194
|
-
if (userRequest && userRequest.successCallback) {
|
4195
|
-
userRequest.successCallback(value);
|
4196
|
-
return null;
|
4197
|
-
}
|
4198
|
-
return value;
|
4199
|
-
})
|
4200
|
-
.catch((err) => {
|
4201
|
-
const errorMessage = `Error returned, code = ${err.errorCode}, message = ${err.message}`;
|
4202
|
-
if (userRequest && userRequest.failureCallback) {
|
4203
|
-
userRequest.failureCallback(errorMessage);
|
4204
|
-
return null;
|
4205
|
-
}
|
4206
|
-
throw new Error(errorMessage);
|
4207
|
-
});
|
4208
|
-
}
|
4209
|
-
authentication.getUser = getUser;
|
4210
|
-
function getUserHelper(apiVersionTag) {
|
4211
|
-
return new Promise((resolve) => {
|
4212
|
-
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getUser'));
|
4213
|
-
}).then(([success, result]) => {
|
4214
|
-
if (success) {
|
4215
|
-
return result;
|
4216
|
-
}
|
4217
|
-
else {
|
4218
|
-
throw result;
|
4219
|
-
}
|
4220
|
-
});
|
4221
|
-
}
|
4222
|
-
function closeAuthenticationWindow() {
|
4223
|
-
// Stop monitoring the authentication window
|
4224
|
-
stopAuthenticationWindowMonitor();
|
4225
|
-
// Try to close the authentication window and clear all properties associated with it
|
4226
|
-
try {
|
4227
|
-
if (Communication.childWindow) {
|
4228
|
-
Communication.childWindow.close();
|
4229
|
-
}
|
4230
|
-
}
|
4231
|
-
finally {
|
4232
|
-
Communication.childWindow = null;
|
4233
|
-
Communication.childOrigin = null;
|
4234
|
-
}
|
4235
|
-
}
|
4128
|
+
FailedReason["Timeout"] = "Timeout";
|
4236
4129
|
/**
|
4237
|
-
*
|
4238
|
-
* Firefox and Safari, which use Quantum and WebKit browser engines respectively, block the use of 'window.open' for pop-up windows.
|
4239
|
-
* Any chrome-based browser (Chrome, Edge, Brave, etc.) opens a new browser window without any user-prompts.
|
4240
|
-
* To ensure consistent behavior across all browsers, consider using the following function to create a new authentication window.
|
4241
|
-
*
|
4242
|
-
* @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow.
|
4130
|
+
* The app failed for a different reason
|
4243
4131
|
*/
|
4244
|
-
|
4245
|
-
|
4246
|
-
|
4247
|
-
|
4248
|
-
|
4249
|
-
|
4250
|
-
|
4251
|
-
|
4252
|
-
height = Math.min(height, Communication.currentWindow.outerHeight - 200);
|
4253
|
-
// Convert any relative URLs into absolute URLs before sending them over to the parent window
|
4254
|
-
const fullyQualifiedURL = fullyQualifyUrlString(authenticateParameters.url.replace('{oauthRedirectMethod}', 'web'));
|
4255
|
-
validateUrl(fullyQualifiedURL);
|
4256
|
-
// We are running in the browser, so we need to center the new window ourselves
|
4257
|
-
let left = typeof Communication.currentWindow.screenLeft !== 'undefined'
|
4258
|
-
? Communication.currentWindow.screenLeft
|
4259
|
-
: Communication.currentWindow.screenX;
|
4260
|
-
let top = typeof Communication.currentWindow.screenTop !== 'undefined'
|
4261
|
-
? Communication.currentWindow.screenTop
|
4262
|
-
: Communication.currentWindow.screenY;
|
4263
|
-
left += Communication.currentWindow.outerWidth / 2 - width / 2;
|
4264
|
-
top += Communication.currentWindow.outerHeight / 2 - height / 2;
|
4265
|
-
// Open a child window with a desired set of standard browser features
|
4266
|
-
Communication.childWindow = Communication.currentWindow.open(fullyQualifiedURL.href, '_blank', 'toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=' +
|
4267
|
-
top +
|
4268
|
-
', left=' +
|
4269
|
-
left +
|
4270
|
-
', width=' +
|
4271
|
-
width +
|
4272
|
-
', height=' +
|
4273
|
-
height);
|
4274
|
-
if (Communication.childWindow) {
|
4275
|
-
// Start monitoring the authentication window so that we can detect if it gets closed before the flow completes
|
4276
|
-
startAuthenticationWindowMonitor();
|
4277
|
-
}
|
4278
|
-
else {
|
4279
|
-
// If we failed to open the window, fail the authentication flow
|
4280
|
-
handleFailure('FailedToOpenWindow');
|
4281
|
-
}
|
4282
|
-
}
|
4283
|
-
function stopAuthenticationWindowMonitor() {
|
4284
|
-
if (authWindowMonitor) {
|
4285
|
-
clearInterval(authWindowMonitor);
|
4286
|
-
authWindowMonitor = 0;
|
4287
|
-
}
|
4288
|
-
removeHandler('initialize');
|
4289
|
-
removeHandler('navigateCrossDomain');
|
4290
|
-
}
|
4291
|
-
function startAuthenticationWindowMonitor() {
|
4292
|
-
// Stop the previous window monitor if one is running
|
4293
|
-
stopAuthenticationWindowMonitor();
|
4294
|
-
// Create an interval loop that
|
4295
|
-
// - Notifies the caller of failure if it detects that the authentication window is closed
|
4296
|
-
// - Keeps pinging the authentication window while it is open to re-establish
|
4297
|
-
// contact with any pages along the authentication flow that need to communicate
|
4298
|
-
// with us
|
4299
|
-
authWindowMonitor = Communication.currentWindow.setInterval(() => {
|
4300
|
-
if (!Communication.childWindow || Communication.childWindow.closed) {
|
4301
|
-
handleFailure('CancelledByUser');
|
4302
|
-
}
|
4303
|
-
else {
|
4304
|
-
const savedChildOrigin = Communication.childOrigin;
|
4305
|
-
try {
|
4306
|
-
Communication.childOrigin = '*';
|
4307
|
-
sendMessageEventToChild('ping');
|
4308
|
-
}
|
4309
|
-
finally {
|
4310
|
-
Communication.childOrigin = savedChildOrigin;
|
4311
|
-
}
|
4312
|
-
}
|
4313
|
-
}, 100);
|
4314
|
-
// Set up an initialize-message handler that gives the authentication window its frame context
|
4315
|
-
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.authenticationWindow.registerInitializeHandler" /* ApiName.Authentication_AuthenticationWindow_RegisterInitializeHandler */), 'initialize', () => {
|
4316
|
-
return [FrameContexts.authentication, GlobalVars.hostClientType];
|
4317
|
-
});
|
4318
|
-
// Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts
|
4319
|
-
// in the authentication window. We could at some point choose to implement this method via a call to
|
4320
|
-
// authenticationWindow.location.href = url; however, we would first need to figure out how to
|
4321
|
-
// validate the URL against the tab's list of valid domains.
|
4322
|
-
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.authenticationWindow.registerNavigateCrossDomainHandler" /* ApiName.Authentication_AuthenticationWindow_RegisterNavigateCrossDomainHandler */), 'navigateCrossDomain', () => {
|
4323
|
-
return false;
|
4324
|
-
});
|
4325
|
-
}
|
4132
|
+
FailedReason["Other"] = "Other";
|
4133
|
+
})(FailedReason || (FailedReason = {}));
|
4134
|
+
/**
|
4135
|
+
* Describes expected errors that occurred during an otherwise successful
|
4136
|
+
* app initialization
|
4137
|
+
*/
|
4138
|
+
var ExpectedFailureReason;
|
4139
|
+
(function (ExpectedFailureReason) {
|
4326
4140
|
/**
|
4327
|
-
*
|
4328
|
-
* This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.
|
4329
|
-
* Please use the {@link authentication.notifySuccess authentication.notifySuccess(result?: string): void} instead.
|
4141
|
+
* There was a permission error
|
4330
4142
|
*/
|
4331
|
-
|
4332
|
-
ensureInitialized(runtime, FrameContexts.authentication);
|
4333
|
-
const apiVersionTag = _callbackUrl
|
4334
|
-
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.notifySuccess" /* ApiName.Authentication_NotifySuccess */)
|
4335
|
-
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.notifySuccess" /* ApiName.Authentication_NotifySuccess */);
|
4336
|
-
sendMessageToParent(apiVersionTag, 'authentication.authenticate.success', [result]);
|
4337
|
-
// Wait for the message to be sent before closing the window
|
4338
|
-
waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));
|
4339
|
-
}
|
4340
|
-
authentication.notifySuccess = notifySuccess;
|
4143
|
+
ExpectedFailureReason["PermissionError"] = "PermissionError";
|
4341
4144
|
/**
|
4342
|
-
*
|
4343
|
-
|
4344
|
-
|
4345
|
-
*/
|
4346
|
-
function notifyFailure(reason, _callbackUrl) {
|
4347
|
-
ensureInitialized(runtime, FrameContexts.authentication);
|
4348
|
-
const apiVersionTag = _callbackUrl
|
4349
|
-
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.notifyFailure" /* ApiName.Authentication_NotifyFailure */)
|
4350
|
-
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.notifyFailure" /* ApiName.Authentication_NotifyFailure */);
|
4351
|
-
sendMessageToParent(apiVersionTag, 'authentication.authenticate.failure', [reason]);
|
4352
|
-
// Wait for the message to be sent before closing the window
|
4353
|
-
waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));
|
4354
|
-
}
|
4355
|
-
authentication.notifyFailure = notifyFailure;
|
4356
|
-
function handleSuccess(result) {
|
4357
|
-
try {
|
4358
|
-
if (authHandlers) {
|
4359
|
-
authHandlers.success(result);
|
4360
|
-
}
|
4361
|
-
}
|
4362
|
-
finally {
|
4363
|
-
authHandlers = undefined;
|
4364
|
-
closeAuthenticationWindow();
|
4365
|
-
}
|
4366
|
-
}
|
4367
|
-
function handleFailure(reason) {
|
4368
|
-
try {
|
4369
|
-
if (authHandlers) {
|
4370
|
-
authHandlers.fail(new Error(reason));
|
4371
|
-
}
|
4372
|
-
}
|
4373
|
-
finally {
|
4374
|
-
authHandlers = undefined;
|
4375
|
-
closeAuthenticationWindow();
|
4376
|
-
}
|
4377
|
-
}
|
4145
|
+
* The item was not found
|
4146
|
+
*/
|
4147
|
+
ExpectedFailureReason["NotFound"] = "NotFound";
|
4378
4148
|
/**
|
4379
|
-
*
|
4380
|
-
* Limited set of data residencies information exposed to 1P application developers
|
4381
|
-
*
|
4382
|
-
* @internal
|
4383
|
-
* Limited to Microsoft-internal use
|
4149
|
+
* The network is currently throttled
|
4384
4150
|
*/
|
4385
|
-
|
4386
|
-
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
|
4391
|
-
|
4392
|
-
|
4393
|
-
|
4394
|
-
|
4395
|
-
/**
|
4396
|
-
* Other, stored to cover fields that will not be exposed
|
4397
|
-
*/
|
4398
|
-
DataResidency["Other"] = "other";
|
4399
|
-
})(DataResidency = authentication.DataResidency || (authentication.DataResidency = {}));
|
4400
|
-
})(authentication || (authentication = {}));
|
4401
|
-
|
4402
|
-
;// CONCATENATED MODULE: ./src/public/dialog.ts
|
4403
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
4404
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
4405
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
4406
|
-
|
4407
|
-
|
4408
|
-
|
4409
|
-
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
|
4151
|
+
ExpectedFailureReason["Throttling"] = "Throttling";
|
4152
|
+
/**
|
4153
|
+
* The application is currently offline
|
4154
|
+
*/
|
4155
|
+
ExpectedFailureReason["Offline"] = "Offline";
|
4156
|
+
/**
|
4157
|
+
* The app failed for a different reason
|
4158
|
+
*/
|
4159
|
+
ExpectedFailureReason["Other"] = "Other";
|
4160
|
+
})(ExpectedFailureReason || (ExpectedFailureReason = {}));
|
4414
4161
|
/**
|
4415
|
-
*
|
4162
|
+
* Checks whether the Teams client SDK has been initialized.
|
4163
|
+
* @returns whether the Teams client SDK has been initialized.
|
4416
4164
|
*/
|
4417
|
-
|
4418
|
-
|
4419
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
4420
|
-
if (!dialog.update.isSupported()) {
|
4421
|
-
throw errorNotSupportedOnPlatform;
|
4422
|
-
}
|
4423
|
-
sendMessageToParent(apiVersionTag, 'tasks.updateTask', [dimensions]);
|
4165
|
+
function isInitialized() {
|
4166
|
+
return GlobalVars.initializeCompleted;
|
4424
4167
|
}
|
4425
|
-
|
4168
|
+
/**
|
4169
|
+
* Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.
|
4170
|
+
* @returns the Frame Context.
|
4171
|
+
*/
|
4172
|
+
function getFrameContext() {
|
4173
|
+
return GlobalVars.frameContext;
|
4174
|
+
}
|
4175
|
+
function logWhereTeamsJsIsBeingUsed() {
|
4176
|
+
if (inServerSideRenderingEnvironment()) {
|
4177
|
+
return;
|
4178
|
+
}
|
4179
|
+
const scripts = document.getElementsByTagName('script');
|
4180
|
+
// This will always be the current script because browsers load and execute scripts in order.
|
4181
|
+
// Whenever a script is executing for the first time it will be the last script in this array.
|
4182
|
+
const currentScriptSrc = scripts && scripts[scripts.length - 1] && scripts[scripts.length - 1].src;
|
4183
|
+
const scriptUsageWarning = 'Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues';
|
4184
|
+
if (!currentScriptSrc || currentScriptSrc.length === 0) {
|
4185
|
+
appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);
|
4186
|
+
}
|
4187
|
+
else {
|
4188
|
+
appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);
|
4189
|
+
}
|
4190
|
+
}
|
4191
|
+
// This is called right away to make sure that we capture which script is being executed and important stats about the current teamsjs instance
|
4192
|
+
appLogger('teamsjs instance is version %s, starting at %s UTC (%s local)', version, new Date().toISOString(), new Date().toLocaleString());
|
4193
|
+
logWhereTeamsJsIsBeingUsed();
|
4194
|
+
/**
|
4195
|
+
* Initializes the library.
|
4196
|
+
*
|
4197
|
+
* @remarks
|
4198
|
+
* Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
|
4199
|
+
*
|
4200
|
+
* @param validMessageOrigins - Optionally specify a list of cross-frame message origins. This parameter is used if you know that your app
|
4201
|
+
* will be hosted on a custom domain (i.e., not a standard Microsoft 365 host like Teams, Outlook, etc.) Most apps will never need
|
4202
|
+
* to pass a value for this parameter.
|
4203
|
+
* Any domains passed in the array must have the https: protocol on the string otherwise they will be ignored. Example: https://www.example.com
|
4204
|
+
* @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
|
4205
|
+
*/
|
4206
|
+
function initialize(validMessageOrigins) {
|
4207
|
+
prefetchOriginsFromCDN();
|
4208
|
+
return appInitializeHelper(getApiVersionTag(appTelemetryVersionNumber, "app.initialize" /* ApiName.App_Initialize */), validMessageOrigins);
|
4209
|
+
}
|
4210
|
+
/**
|
4211
|
+
* @hidden
|
4212
|
+
* Undocumented function used to set a mock window for unit tests
|
4213
|
+
*
|
4214
|
+
* @internal
|
4215
|
+
* Limited to Microsoft-internal use
|
4216
|
+
*/
|
4217
|
+
function _initialize(hostWindow) {
|
4218
|
+
Communication.currentWindow = hostWindow;
|
4219
|
+
}
|
4220
|
+
/**
|
4221
|
+
* @hidden
|
4222
|
+
* Undocumented function used to clear state between unit tests
|
4223
|
+
*
|
4224
|
+
* @internal
|
4225
|
+
* Limited to Microsoft-internal use
|
4226
|
+
*/
|
4227
|
+
function _uninitialize() {
|
4228
|
+
if (!GlobalVars.initializeCalled) {
|
4229
|
+
return;
|
4230
|
+
}
|
4231
|
+
uninitializeHandlers();
|
4232
|
+
GlobalVars.initializeCalled = false;
|
4233
|
+
GlobalVars.initializeCompleted = false;
|
4234
|
+
GlobalVars.initializePromise = undefined;
|
4235
|
+
GlobalVars.additionalValidOrigins = [];
|
4236
|
+
GlobalVars.frameContext = undefined;
|
4237
|
+
GlobalVars.hostClientType = undefined;
|
4238
|
+
GlobalVars.isFramelessWindow = false;
|
4239
|
+
messageChannels.telemetry._clearTelemetryPort();
|
4240
|
+
messageChannels.dataLayer._clearDataLayerPort();
|
4241
|
+
uninitializeCommunication();
|
4242
|
+
}
|
4243
|
+
/**
|
4244
|
+
* Retrieves the current context the frame is running in.
|
4245
|
+
*
|
4246
|
+
* @returns Promise that will resolve with the {@link app.Context} object.
|
4247
|
+
*/
|
4248
|
+
function getContext() {
|
4249
|
+
return new Promise((resolve) => {
|
4250
|
+
ensureInitializeCalled();
|
4251
|
+
resolve(sendAndUnwrap(getApiVersionTag(appTelemetryVersionNumber, "app.getContext" /* ApiName.App_GetContext */), 'getContext'));
|
4252
|
+
}).then((legacyContext) => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context
|
4253
|
+
}
|
4254
|
+
/**
|
4255
|
+
* Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
|
4256
|
+
*/
|
4257
|
+
function notifyAppLoaded() {
|
4258
|
+
ensureInitializeCalled();
|
4259
|
+
notifyAppLoadedHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyAppLoaded" /* ApiName.App_NotifyAppLoaded */));
|
4260
|
+
}
|
4261
|
+
/**
|
4262
|
+
* Notifies the frame that app initialization is successful and is ready for user interaction.
|
4263
|
+
*/
|
4264
|
+
function notifySuccess() {
|
4265
|
+
ensureInitializeCalled();
|
4266
|
+
notifySuccessHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifySuccess" /* ApiName.App_NotifySuccess */));
|
4267
|
+
}
|
4268
|
+
/**
|
4269
|
+
* Notifies the frame that app initialization has failed and to show an error page in its place.
|
4270
|
+
*
|
4271
|
+
* @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
|
4272
|
+
* during initialization as well as an optional message.
|
4273
|
+
*/
|
4274
|
+
function notifyFailure(appInitializationFailedRequest) {
|
4275
|
+
ensureInitializeCalled();
|
4276
|
+
notifyFailureHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyFailure" /* ApiName.App_NotifyFailure */), appInitializationFailedRequest);
|
4277
|
+
}
|
4278
|
+
/**
|
4279
|
+
* Notifies the frame that app initialized with some expected errors.
|
4280
|
+
*
|
4281
|
+
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
4282
|
+
*/
|
4283
|
+
function notifyExpectedFailure(expectedFailureRequest) {
|
4284
|
+
ensureInitializeCalled();
|
4285
|
+
notifyExpectedFailureHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyExpectedFailure" /* ApiName.App_NotifyExpectedFailure */), expectedFailureRequest);
|
4286
|
+
}
|
4287
|
+
/**
|
4288
|
+
* Registers a handler for theme changes.
|
4289
|
+
*
|
4290
|
+
* @remarks
|
4291
|
+
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
|
4292
|
+
*
|
4293
|
+
* @param handler - The handler to invoke when the user changes their theme.
|
4294
|
+
*/
|
4295
|
+
function registerOnThemeChangeHandler(handler) {
|
4296
|
+
registerOnThemeChangeHandlerHelper(getApiVersionTag(appTelemetryVersionNumber, "app.registerOnThemeChangeHandler" /* ApiName.App_RegisterOnThemeChangeHandler */), handler);
|
4297
|
+
}
|
4298
|
+
/**
|
4299
|
+
* This function opens deep links to other modules in the host such as chats or channels or
|
4300
|
+
* general-purpose links (to external websites). It should not be used for navigating to your
|
4301
|
+
* own or other apps.
|
4302
|
+
*
|
4303
|
+
* @remarks
|
4304
|
+
* If you need to navigate to your own or other apps, use:
|
4305
|
+
*
|
4306
|
+
* - {@link pages.currentApp.navigateToDefaultPage} for navigating to the default page of your own app
|
4307
|
+
* - {@link pages.currentApp.navigateTo} for navigating to a section of your own app
|
4308
|
+
* - {@link pages.navigateToApp} for navigating to other apps besides your own
|
4309
|
+
*
|
4310
|
+
* Many areas of functionality previously provided by deep links are now handled by strongly-typed functions in capabilities.
|
4311
|
+
* If your app is using a deep link to trigger these specific components, use the strongly-typed alternatives.
|
4312
|
+
* For example (this list is not exhaustive):
|
4313
|
+
* - To open an app installation dialog, use the {@link appInstallDialog} capability
|
4314
|
+
* - To start a call, use the {@link call} capability
|
4315
|
+
* - To open a chat, use the {@link chat} capability
|
4316
|
+
* - To open a dialog, use the {@link dialog} capability
|
4317
|
+
* - To create a new meeting, use the {@link calendar.composeMeeting} function
|
4318
|
+
* - To open a Stage View, use the {@link stageView} capability
|
4319
|
+
*
|
4320
|
+
* In each of these capabilities, you can use the `isSupported()` function to determine if the host supports that capability.
|
4321
|
+
* When using a deep link to trigger these components, there's no way to determine whether the host supports it.
|
4322
|
+
*
|
4323
|
+
* For more information on crafting deep links to the host, see [Configure deep links](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/deep-links)
|
4324
|
+
*
|
4325
|
+
* @param deepLink The host deep link or external web URL to which to navigate
|
4326
|
+
* @returns `Promise` that will be fulfilled when the navigation has initiated. A successful `Promise` resolution
|
4327
|
+
* does not necessarily indicate whether the target loaded successfully.
|
4328
|
+
*/
|
4329
|
+
function openLink(deepLink) {
|
4330
|
+
return openLinkHelper(getApiVersionTag(appTelemetryVersionNumber, "app.openLink" /* ApiName.App_OpenLink */), deepLink);
|
4331
|
+
}
|
4332
|
+
/**
|
4333
|
+
* A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
|
4334
|
+
* When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
|
4335
|
+
* When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
|
4336
|
+
* Please note that selecting suspension doesn't guarantee prevention of background termination.
|
4337
|
+
* The outcome is influenced by factors such as available memory and the number of suspended apps.
|
4338
|
+
*
|
4339
|
+
* @beta
|
4340
|
+
*/
|
4341
|
+
var lifecycle;
|
4342
|
+
(function (lifecycle) {
|
4343
|
+
/**
|
4344
|
+
* Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
|
4345
|
+
* the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
|
4346
|
+
*
|
4347
|
+
* @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
|
4348
|
+
* Upon returning, the app will be suspended or terminated.
|
4349
|
+
*
|
4350
|
+
*/
|
4351
|
+
function registerBeforeSuspendOrTerminateHandler(handler) {
|
4352
|
+
if (!handler) {
|
4353
|
+
throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');
|
4354
|
+
}
|
4355
|
+
ensureInitialized(runtime);
|
4356
|
+
handlers_registerBeforeSuspendOrTerminateHandler(handler);
|
4357
|
+
}
|
4358
|
+
lifecycle.registerBeforeSuspendOrTerminateHandler = registerBeforeSuspendOrTerminateHandler;
|
4359
|
+
/**
|
4360
|
+
* Registers a handler to be called when the page has been requested to resume from being suspended.
|
4361
|
+
*
|
4362
|
+
* @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
|
4363
|
+
* the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
|
4364
|
+
*
|
4365
|
+
* @beta
|
4366
|
+
*/
|
4367
|
+
function registerOnResumeHandler(handler) {
|
4368
|
+
if (!handler) {
|
4369
|
+
throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');
|
4370
|
+
}
|
4371
|
+
ensureInitialized(runtime);
|
4372
|
+
handlers_registerOnResumeHandler(handler);
|
4373
|
+
}
|
4374
|
+
lifecycle.registerOnResumeHandler = registerOnResumeHandler;
|
4375
|
+
})(lifecycle || (lifecycle = {}));
|
4376
|
+
/**
|
4377
|
+
* @hidden
|
4378
|
+
* Transforms the Legacy Context object received from Messages to the structured app.Context object
|
4379
|
+
*
|
4380
|
+
* @internal
|
4381
|
+
* Limited to Microsoft-internal use
|
4382
|
+
*/
|
4383
|
+
function transformLegacyContextToAppContext(legacyContext) {
|
4384
|
+
var _a;
|
4385
|
+
const context = {
|
4386
|
+
actionInfo: legacyContext.actionInfo,
|
4387
|
+
app: {
|
4388
|
+
locale: legacyContext.locale,
|
4389
|
+
sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',
|
4390
|
+
theme: legacyContext.theme ? legacyContext.theme : 'default',
|
4391
|
+
iconPositionVertical: legacyContext.appIconPosition,
|
4392
|
+
osLocaleInfo: legacyContext.osLocaleInfo,
|
4393
|
+
parentMessageId: legacyContext.parentMessageId,
|
4394
|
+
userClickTime: legacyContext.userClickTime,
|
4395
|
+
userFileOpenPreference: legacyContext.userFileOpenPreference,
|
4396
|
+
host: {
|
4397
|
+
name: legacyContext.hostName ? legacyContext.hostName : HostName.teams,
|
4398
|
+
clientType: legacyContext.hostClientType ? legacyContext.hostClientType : HostClientType.web,
|
4399
|
+
sessionId: legacyContext.sessionId ? legacyContext.sessionId : '',
|
4400
|
+
ringId: legacyContext.ringId,
|
4401
|
+
},
|
4402
|
+
appLaunchId: legacyContext.appLaunchId,
|
4403
|
+
},
|
4404
|
+
page: {
|
4405
|
+
id: legacyContext.entityId,
|
4406
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
4407
|
+
// @ts-ignore
|
4408
|
+
frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,
|
4409
|
+
subPageId: legacyContext.subEntityId,
|
4410
|
+
isFullScreen: legacyContext.isFullScreen,
|
4411
|
+
isMultiWindow: legacyContext.isMultiWindow,
|
4412
|
+
isBackgroundLoad: legacyContext.isBackgroundLoad,
|
4413
|
+
sourceOrigin: legacyContext.sourceOrigin,
|
4414
|
+
},
|
4415
|
+
user: {
|
4416
|
+
id: (_a = legacyContext.userObjectId) !== null && _a !== void 0 ? _a : '',
|
4417
|
+
displayName: legacyContext.userDisplayName,
|
4418
|
+
isCallingAllowed: legacyContext.isCallingAllowed,
|
4419
|
+
isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,
|
4420
|
+
licenseType: legacyContext.userLicenseType,
|
4421
|
+
loginHint: legacyContext.loginHint,
|
4422
|
+
userPrincipalName: legacyContext.userPrincipalName,
|
4423
|
+
tenant: legacyContext.tid
|
4424
|
+
? {
|
4425
|
+
id: legacyContext.tid,
|
4426
|
+
teamsSku: legacyContext.tenantSKU,
|
4427
|
+
}
|
4428
|
+
: undefined,
|
4429
|
+
},
|
4430
|
+
channel: legacyContext.channelId
|
4431
|
+
? {
|
4432
|
+
id: legacyContext.channelId,
|
4433
|
+
displayName: legacyContext.channelName,
|
4434
|
+
relativeUrl: legacyContext.channelRelativeUrl,
|
4435
|
+
membershipType: legacyContext.channelType,
|
4436
|
+
defaultOneNoteSectionId: legacyContext.defaultOneNoteSectionId,
|
4437
|
+
ownerGroupId: legacyContext.hostTeamGroupId,
|
4438
|
+
ownerTenantId: legacyContext.hostTeamTenantId,
|
4439
|
+
}
|
4440
|
+
: undefined,
|
4441
|
+
chat: legacyContext.chatId
|
4442
|
+
? {
|
4443
|
+
id: legacyContext.chatId,
|
4444
|
+
}
|
4445
|
+
: undefined,
|
4446
|
+
meeting: legacyContext.meetingId
|
4447
|
+
? {
|
4448
|
+
id: legacyContext.meetingId,
|
4449
|
+
}
|
4450
|
+
: undefined,
|
4451
|
+
sharepoint: legacyContext.sharepoint,
|
4452
|
+
team: legacyContext.teamId
|
4453
|
+
? {
|
4454
|
+
internalId: legacyContext.teamId,
|
4455
|
+
displayName: legacyContext.teamName,
|
4456
|
+
type: legacyContext.teamType,
|
4457
|
+
groupId: legacyContext.groupId,
|
4458
|
+
templateId: legacyContext.teamTemplateId,
|
4459
|
+
isArchived: legacyContext.isTeamArchived,
|
4460
|
+
userRole: legacyContext.userTeamRole,
|
4461
|
+
}
|
4462
|
+
: undefined,
|
4463
|
+
sharePointSite: legacyContext.teamSiteUrl ||
|
4464
|
+
legacyContext.teamSiteDomain ||
|
4465
|
+
legacyContext.teamSitePath ||
|
4466
|
+
legacyContext.mySitePath ||
|
4467
|
+
legacyContext.mySiteDomain
|
4468
|
+
? {
|
4469
|
+
teamSiteUrl: legacyContext.teamSiteUrl,
|
4470
|
+
teamSiteDomain: legacyContext.teamSiteDomain,
|
4471
|
+
teamSitePath: legacyContext.teamSitePath,
|
4472
|
+
teamSiteId: legacyContext.teamSiteId,
|
4473
|
+
mySitePath: legacyContext.mySitePath,
|
4474
|
+
mySiteDomain: legacyContext.mySiteDomain,
|
4475
|
+
}
|
4476
|
+
: undefined,
|
4477
|
+
dialogParameters: legacyContext.dialogParameters || {},
|
4478
|
+
};
|
4479
|
+
return context;
|
4480
|
+
}
|
4481
|
+
|
4482
|
+
;// CONCATENATED MODULE: ./src/public/authentication.ts
|
4483
|
+
|
4484
|
+
|
4485
|
+
|
4486
|
+
|
4487
|
+
|
4488
|
+
|
4489
|
+
|
4490
|
+
|
4491
|
+
/**
|
4492
|
+
* Namespace to interact with the authentication-specific part of the SDK.
|
4493
|
+
*
|
4494
|
+
* This object is used for starting or completing authentication flows.
|
4495
|
+
*/
|
4496
|
+
/**
|
4497
|
+
* Exceptional APIs telemetry versioning file: v1 and v2 APIs are mixed together in this file
|
4498
|
+
*/
|
4499
|
+
const authenticationTelemetryVersionNumber_v1 = "v1" /* ApiVersionNumber.V_1 */;
|
4500
|
+
const authenticationTelemetryVersionNumber_v2 = "v2" /* ApiVersionNumber.V_2 */;
|
4501
|
+
let authHandlers;
|
4502
|
+
let authWindowMonitor;
|
4503
|
+
/**
|
4504
|
+
* @hidden
|
4505
|
+
* @internal
|
4506
|
+
* Limited to Microsoft-internal use; automatically called when library is initialized
|
4507
|
+
*/
|
4508
|
+
function authentication_initialize() {
|
4509
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.registerAuthenticateSuccessHandler" /* ApiName.Authentication_RegisterAuthenticateSuccessHandler */), 'authentication.authenticate.success', handleSuccess, false);
|
4510
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.registerAuthenticateFailureHandler" /* ApiName.Authentication_RegisterAuthenticateFailureHandler */), 'authentication.authenticate.failure', handleFailure, false);
|
4511
|
+
}
|
4512
|
+
let authParams;
|
4513
|
+
/**
|
4514
|
+
* @deprecated
|
4515
|
+
* As of TeamsJS v2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}
|
4516
|
+
*
|
4517
|
+
* Registers handlers to be called with the result of an authentication flow triggered using {@link authentication.authenticate authentication.authenticate(authenticateParameters?: AuthenticateParameters): void}
|
4518
|
+
*
|
4519
|
+
* @param authenticateParameters - Configuration for authentication flow pop-up result communication
|
4520
|
+
*/
|
4521
|
+
function registerAuthenticationHandlers(authenticateParameters) {
|
4522
|
+
authParams = authenticateParameters;
|
4523
|
+
}
|
4524
|
+
function authenticate(authenticateParameters) {
|
4525
|
+
const isDifferentParamsInCall = authenticateParameters !== undefined;
|
4526
|
+
const authenticateParams = isDifferentParamsInCall
|
4527
|
+
? authenticateParameters
|
4528
|
+
: authParams;
|
4529
|
+
if (!authenticateParams) {
|
4530
|
+
throw new Error('No parameters are provided for authentication');
|
4531
|
+
}
|
4532
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
4533
|
+
const apiVersionTag = authenticateParams.successCallback || authenticateParams.failureCallback
|
4534
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.authenticate" /* ApiName.Authentication_Authenticate */)
|
4535
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.authenticate" /* ApiName.Authentication_Authenticate */);
|
4536
|
+
return authenticateHelper(apiVersionTag, authenticateParams)
|
4537
|
+
.then((value) => {
|
4538
|
+
try {
|
4539
|
+
if (authenticateParams && authenticateParams.successCallback) {
|
4540
|
+
authenticateParams.successCallback(value);
|
4541
|
+
return '';
|
4542
|
+
}
|
4543
|
+
return value;
|
4544
|
+
}
|
4545
|
+
finally {
|
4546
|
+
if (!isDifferentParamsInCall) {
|
4547
|
+
authParams = undefined;
|
4548
|
+
}
|
4549
|
+
}
|
4550
|
+
})
|
4551
|
+
.catch((err) => {
|
4552
|
+
try {
|
4553
|
+
if (authenticateParams && authenticateParams.failureCallback) {
|
4554
|
+
authenticateParams.failureCallback(err.message);
|
4555
|
+
return '';
|
4556
|
+
}
|
4557
|
+
throw err;
|
4558
|
+
}
|
4559
|
+
finally {
|
4560
|
+
if (!isDifferentParamsInCall) {
|
4561
|
+
authParams = undefined;
|
4562
|
+
}
|
4563
|
+
}
|
4564
|
+
});
|
4565
|
+
}
|
4566
|
+
function authenticateHelper(apiVersionTag, authenticateParameters) {
|
4567
|
+
return new Promise((resolve, reject) => {
|
4568
|
+
if (GlobalVars.hostClientType !== HostClientType.web) {
|
4569
|
+
// Convert any relative URLs into absolute URLs before sending them over to the parent window.
|
4570
|
+
const fullyQualifiedURL = fullyQualifyUrlString(authenticateParameters.url);
|
4571
|
+
validateUrl(fullyQualifiedURL);
|
4572
|
+
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
4573
|
+
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.authenticate', [
|
4574
|
+
fullyQualifiedURL.href,
|
4575
|
+
authenticateParameters.width,
|
4576
|
+
authenticateParameters.height,
|
4577
|
+
authenticateParameters.isExternal,
|
4578
|
+
]).then(([success, response]) => {
|
4579
|
+
if (success) {
|
4580
|
+
return response;
|
4581
|
+
}
|
4582
|
+
else {
|
4583
|
+
throw new Error(response);
|
4584
|
+
}
|
4585
|
+
}));
|
4586
|
+
}
|
4587
|
+
else {
|
4588
|
+
// Open an authentication window with the parameters provided by the caller.
|
4589
|
+
authHandlers = {
|
4590
|
+
success: resolve,
|
4591
|
+
fail: reject,
|
4592
|
+
};
|
4593
|
+
openAuthenticationWindow(authenticateParameters);
|
4594
|
+
}
|
4595
|
+
});
|
4596
|
+
}
|
4597
|
+
function getAuthToken(authTokenRequest) {
|
4598
|
+
ensureInitializeCalled();
|
4599
|
+
const apiVersionTag = authTokenRequest && (authTokenRequest.successCallback || authTokenRequest.failureCallback)
|
4600
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.getAuthToken" /* ApiName.Authentication_GetAuthToken */)
|
4601
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.getAuthToken" /* ApiName.Authentication_GetAuthToken */);
|
4602
|
+
return getAuthTokenHelper(apiVersionTag, authTokenRequest)
|
4603
|
+
.then((value) => {
|
4604
|
+
if (authTokenRequest && authTokenRequest.successCallback) {
|
4605
|
+
authTokenRequest.successCallback(value);
|
4606
|
+
return '';
|
4607
|
+
}
|
4608
|
+
return value;
|
4609
|
+
})
|
4610
|
+
.catch((err) => {
|
4611
|
+
if (authTokenRequest && authTokenRequest.failureCallback) {
|
4612
|
+
authTokenRequest.failureCallback(err.message);
|
4613
|
+
return '';
|
4614
|
+
}
|
4615
|
+
throw err;
|
4616
|
+
});
|
4617
|
+
}
|
4618
|
+
function getAuthTokenHelper(apiVersionTag, authTokenRequest) {
|
4619
|
+
return new Promise((resolve) => {
|
4620
|
+
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getAuthToken', [
|
4621
|
+
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.resources,
|
4622
|
+
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.claims,
|
4623
|
+
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.silent,
|
4624
|
+
authTokenRequest === null || authTokenRequest === void 0 ? void 0 : authTokenRequest.tenantId,
|
4625
|
+
]));
|
4626
|
+
}).then(([success, result]) => {
|
4627
|
+
if (success) {
|
4628
|
+
return result;
|
4629
|
+
}
|
4630
|
+
else {
|
4631
|
+
throw new Error(result);
|
4632
|
+
}
|
4633
|
+
});
|
4634
|
+
}
|
4635
|
+
function getUser(userRequest) {
|
4636
|
+
ensureInitializeCalled();
|
4637
|
+
const apiVersionTag = userRequest && (userRequest.successCallback || userRequest.failureCallback)
|
4638
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.getUser" /* ApiName.Authentication_GetUser */)
|
4639
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.getUser" /* ApiName.Authentication_GetUser */);
|
4640
|
+
return getUserHelper(apiVersionTag)
|
4641
|
+
.then((value) => {
|
4642
|
+
if (userRequest && userRequest.successCallback) {
|
4643
|
+
userRequest.successCallback(value);
|
4644
|
+
return null;
|
4645
|
+
}
|
4646
|
+
return value;
|
4647
|
+
})
|
4648
|
+
.catch((err) => {
|
4649
|
+
const errorMessage = `Error returned, code = ${err.errorCode}, message = ${err.message}`;
|
4650
|
+
if (userRequest && userRequest.failureCallback) {
|
4651
|
+
userRequest.failureCallback(errorMessage);
|
4652
|
+
return null;
|
4653
|
+
}
|
4654
|
+
throw new Error(errorMessage);
|
4655
|
+
});
|
4656
|
+
}
|
4657
|
+
function getUserHelper(apiVersionTag) {
|
4658
|
+
return new Promise((resolve) => {
|
4659
|
+
resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getUser'));
|
4660
|
+
}).then(([success, result]) => {
|
4661
|
+
if (success) {
|
4662
|
+
return result;
|
4663
|
+
}
|
4664
|
+
else {
|
4665
|
+
throw result;
|
4666
|
+
}
|
4667
|
+
});
|
4668
|
+
}
|
4669
|
+
function closeAuthenticationWindow() {
|
4670
|
+
// Stop monitoring the authentication window
|
4671
|
+
stopAuthenticationWindowMonitor();
|
4672
|
+
// Try to close the authentication window and clear all properties associated with it
|
4673
|
+
try {
|
4674
|
+
if (Communication.childWindow) {
|
4675
|
+
Communication.childWindow.close();
|
4676
|
+
}
|
4677
|
+
}
|
4678
|
+
finally {
|
4679
|
+
Communication.childWindow = null;
|
4680
|
+
Communication.childOrigin = null;
|
4681
|
+
}
|
4682
|
+
}
|
4683
|
+
/**
|
4684
|
+
* Different browsers handle authentication flows in pop-up windows differently.
|
4685
|
+
* Firefox and Safari, which use Quantum and WebKit browser engines respectively, block the use of 'window.open' for pop-up windows.
|
4686
|
+
* Any chrome-based browser (Chrome, Edge, Brave, etc.) opens a new browser window without any user-prompts.
|
4687
|
+
* To ensure consistent behavior across all browsers, consider using the following function to create a new authentication window.
|
4688
|
+
*
|
4689
|
+
* @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow.
|
4690
|
+
*/
|
4691
|
+
function openAuthenticationWindow(authenticateParameters) {
|
4692
|
+
// Close the previously opened window if we have one
|
4693
|
+
closeAuthenticationWindow();
|
4694
|
+
// Start with a sensible default size
|
4695
|
+
let width = authenticateParameters.width || 600;
|
4696
|
+
let height = authenticateParameters.height || 400;
|
4697
|
+
// Ensure that the new window is always smaller than our app's window so that it never fully covers up our app
|
4698
|
+
width = Math.min(width, Communication.currentWindow.outerWidth - 400);
|
4699
|
+
height = Math.min(height, Communication.currentWindow.outerHeight - 200);
|
4700
|
+
// Convert any relative URLs into absolute URLs before sending them over to the parent window
|
4701
|
+
const fullyQualifiedURL = fullyQualifyUrlString(authenticateParameters.url.replace('{oauthRedirectMethod}', 'web'));
|
4702
|
+
validateUrl(fullyQualifiedURL);
|
4703
|
+
// We are running in the browser, so we need to center the new window ourselves
|
4704
|
+
let left = typeof Communication.currentWindow.screenLeft !== 'undefined'
|
4705
|
+
? Communication.currentWindow.screenLeft
|
4706
|
+
: Communication.currentWindow.screenX;
|
4707
|
+
let top = typeof Communication.currentWindow.screenTop !== 'undefined'
|
4708
|
+
? Communication.currentWindow.screenTop
|
4709
|
+
: Communication.currentWindow.screenY;
|
4710
|
+
left += Communication.currentWindow.outerWidth / 2 - width / 2;
|
4711
|
+
top += Communication.currentWindow.outerHeight / 2 - height / 2;
|
4712
|
+
// Open a child window with a desired set of standard browser features
|
4713
|
+
Communication.childWindow = Communication.currentWindow.open(fullyQualifiedURL.href, '_blank', 'toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=' +
|
4714
|
+
top +
|
4715
|
+
', left=' +
|
4716
|
+
left +
|
4717
|
+
', width=' +
|
4718
|
+
width +
|
4719
|
+
', height=' +
|
4720
|
+
height);
|
4721
|
+
if (Communication.childWindow) {
|
4722
|
+
// Start monitoring the authentication window so that we can detect if it gets closed before the flow completes
|
4723
|
+
startAuthenticationWindowMonitor();
|
4724
|
+
}
|
4725
|
+
else {
|
4726
|
+
// If we failed to open the window, fail the authentication flow
|
4727
|
+
handleFailure('FailedToOpenWindow');
|
4728
|
+
}
|
4729
|
+
}
|
4730
|
+
function stopAuthenticationWindowMonitor() {
|
4731
|
+
if (authWindowMonitor) {
|
4732
|
+
clearInterval(authWindowMonitor);
|
4733
|
+
authWindowMonitor = 0;
|
4734
|
+
}
|
4735
|
+
removeHandler('initialize');
|
4736
|
+
removeHandler('navigateCrossDomain');
|
4737
|
+
}
|
4738
|
+
function startAuthenticationWindowMonitor() {
|
4739
|
+
// Stop the previous window monitor if one is running
|
4740
|
+
stopAuthenticationWindowMonitor();
|
4741
|
+
// Create an interval loop that
|
4742
|
+
// - Notifies the caller of failure if it detects that the authentication window is closed
|
4743
|
+
// - Keeps pinging the authentication window while it is open to re-establish
|
4744
|
+
// contact with any pages along the authentication flow that need to communicate
|
4745
|
+
// with us
|
4746
|
+
authWindowMonitor = Communication.currentWindow.setInterval(() => {
|
4747
|
+
if (!Communication.childWindow || Communication.childWindow.closed) {
|
4748
|
+
handleFailure('CancelledByUser');
|
4749
|
+
}
|
4750
|
+
else {
|
4751
|
+
const savedChildOrigin = Communication.childOrigin;
|
4752
|
+
try {
|
4753
|
+
Communication.childOrigin = '*';
|
4754
|
+
sendMessageEventToChild('ping');
|
4755
|
+
}
|
4756
|
+
finally {
|
4757
|
+
Communication.childOrigin = savedChildOrigin;
|
4758
|
+
}
|
4759
|
+
}
|
4760
|
+
}, 100);
|
4761
|
+
// Set up an initialize-message handler that gives the authentication window its frame context
|
4762
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.authenticationWindow.registerInitializeHandler" /* ApiName.Authentication_AuthenticationWindow_RegisterInitializeHandler */), 'initialize', () => {
|
4763
|
+
return [FrameContexts.authentication, GlobalVars.hostClientType];
|
4764
|
+
});
|
4765
|
+
// Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts
|
4766
|
+
// in the authentication window. We could at some point choose to implement this method via a call to
|
4767
|
+
// authenticationWindow.location.href = url; however, we would first need to figure out how to
|
4768
|
+
// validate the URL against the tab's list of valid domains.
|
4769
|
+
registerHandler(getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.authenticationWindow.registerNavigateCrossDomainHandler" /* ApiName.Authentication_AuthenticationWindow_RegisterNavigateCrossDomainHandler */), 'navigateCrossDomain', () => {
|
4770
|
+
return false;
|
4771
|
+
});
|
4772
|
+
}
|
4773
|
+
/**
|
4774
|
+
* @deprecated
|
4775
|
+
* This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.
|
4776
|
+
* Please use the {@link authentication.notifySuccess authentication.notifySuccess(result?: string): void} instead.
|
4777
|
+
*/
|
4778
|
+
function authentication_notifySuccess(result, _callbackUrl) {
|
4779
|
+
ensureInitialized(runtime, FrameContexts.authentication);
|
4780
|
+
const apiVersionTag = _callbackUrl
|
4781
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.notifySuccess" /* ApiName.Authentication_NotifySuccess */)
|
4782
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.notifySuccess" /* ApiName.Authentication_NotifySuccess */);
|
4783
|
+
sendMessageToParent(apiVersionTag, 'authentication.authenticate.success', [result]);
|
4784
|
+
// Wait for the message to be sent before closing the window
|
4785
|
+
waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));
|
4786
|
+
}
|
4787
|
+
/**
|
4788
|
+
* @deprecated
|
4789
|
+
* This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.
|
4790
|
+
* Please use the {@link authentication.notifyFailure authentication.notifyFailure(result?: string): void} instead.
|
4791
|
+
*/
|
4792
|
+
function authentication_notifyFailure(reason, _callbackUrl) {
|
4793
|
+
ensureInitialized(runtime, FrameContexts.authentication);
|
4794
|
+
const apiVersionTag = _callbackUrl
|
4795
|
+
? getApiVersionTag(authenticationTelemetryVersionNumber_v1, "authentication.notifyFailure" /* ApiName.Authentication_NotifyFailure */)
|
4796
|
+
: getApiVersionTag(authenticationTelemetryVersionNumber_v2, "authentication.notifyFailure" /* ApiName.Authentication_NotifyFailure */);
|
4797
|
+
sendMessageToParent(apiVersionTag, 'authentication.authenticate.failure', [reason]);
|
4798
|
+
// Wait for the message to be sent before closing the window
|
4799
|
+
waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));
|
4800
|
+
}
|
4801
|
+
function handleSuccess(result) {
|
4802
|
+
try {
|
4803
|
+
if (authHandlers) {
|
4804
|
+
authHandlers.success(result);
|
4805
|
+
}
|
4806
|
+
}
|
4807
|
+
finally {
|
4808
|
+
authHandlers = undefined;
|
4809
|
+
closeAuthenticationWindow();
|
4810
|
+
}
|
4811
|
+
}
|
4812
|
+
function handleFailure(reason) {
|
4813
|
+
try {
|
4814
|
+
if (authHandlers) {
|
4815
|
+
authHandlers.fail(new Error(reason));
|
4816
|
+
}
|
4817
|
+
}
|
4818
|
+
finally {
|
4819
|
+
authHandlers = undefined;
|
4820
|
+
closeAuthenticationWindow();
|
4821
|
+
}
|
4822
|
+
}
|
4823
|
+
/**
|
4824
|
+
* @hidden
|
4825
|
+
* Limited set of data residencies information exposed to 1P application developers
|
4826
|
+
*
|
4827
|
+
* @internal
|
4828
|
+
* Limited to Microsoft-internal use
|
4829
|
+
*/
|
4830
|
+
var DataResidency;
|
4831
|
+
(function (DataResidency) {
|
4832
|
+
/**
|
4833
|
+
* Public
|
4834
|
+
*/
|
4835
|
+
DataResidency["Public"] = "public";
|
4836
|
+
/**
|
4837
|
+
* European Union Data Boundary
|
4838
|
+
*/
|
4839
|
+
DataResidency["EUDB"] = "eudb";
|
4840
|
+
/**
|
4841
|
+
* Other, stored to cover fields that will not be exposed
|
4842
|
+
*/
|
4843
|
+
DataResidency["Other"] = "other";
|
4844
|
+
})(DataResidency || (DataResidency = {}));
|
4845
|
+
|
4846
|
+
;// CONCATENATED MODULE: ./src/public/dialog.ts
|
4847
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
4848
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
4849
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
4850
|
+
|
4851
|
+
|
4852
|
+
|
4853
|
+
|
4854
|
+
|
4855
|
+
|
4856
|
+
|
4857
|
+
|
4858
|
+
/**
|
4859
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
4860
|
+
*/
|
4861
|
+
const dialogTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
4862
|
+
function updateResizeHelper(apiVersionTag, dimensions) {
|
4863
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
|
4864
|
+
if (!dialog.update.isSupported()) {
|
4865
|
+
throw errorNotSupportedOnPlatform;
|
4866
|
+
}
|
4867
|
+
sendMessageToParent(apiVersionTag, 'tasks.updateTask', [dimensions]);
|
4868
|
+
}
|
4869
|
+
function urlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
|
4426
4870
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
4427
4871
|
if (!dialog.url.isSupported()) {
|
4428
4872
|
throw errorNotSupportedOnPlatform;
|
@@ -5046,7 +5490,7 @@ var menus;
|
|
5046
5490
|
menus.isSupported = isSupported;
|
5047
5491
|
})(menus || (menus = {}));
|
5048
5492
|
|
5049
|
-
;// CONCATENATED MODULE: ./src/
|
5493
|
+
;// CONCATENATED MODULE: ./src/internal/appHelpers.ts
|
5050
5494
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
5051
5495
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
5052
5496
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
@@ -5066,23 +5510,17 @@ var menus;
|
|
5066
5510
|
|
5067
5511
|
|
5068
5512
|
|
5069
|
-
|
5070
|
-
|
5071
|
-
/**
|
5072
|
-
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
5073
|
-
*/
|
5074
|
-
const appTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
5075
5513
|
/**
|
5076
5514
|
* Number of milliseconds we'll give the initialization call to return before timing it out
|
5077
5515
|
*/
|
5078
5516
|
const initializationTimeoutInMs = 5000;
|
5079
|
-
const
|
5517
|
+
const appHelpers_appLogger = getLogger('app');
|
5080
5518
|
function appInitializeHelper(apiVersionTag, validMessageOrigins) {
|
5081
5519
|
if (!inServerSideRenderingEnvironment()) {
|
5082
5520
|
return runWithTimeout(() => initializeHelper(apiVersionTag, validMessageOrigins), initializationTimeoutInMs, new Error('SDK initialization timed out.'));
|
5083
5521
|
}
|
5084
5522
|
else {
|
5085
|
-
const initializeLogger =
|
5523
|
+
const initializeLogger = appHelpers_appLogger.extend('initialize');
|
5086
5524
|
// This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.
|
5087
5525
|
// If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.
|
5088
5526
|
initializeLogger('window object undefined at initialization');
|
@@ -5090,24 +5528,24 @@ function appInitializeHelper(apiVersionTag, validMessageOrigins) {
|
|
5090
5528
|
}
|
5091
5529
|
}
|
5092
5530
|
function notifyAppLoadedHelper(apiVersionTag) {
|
5093
|
-
sendMessageToParent(apiVersionTag,
|
5531
|
+
sendMessageToParent(apiVersionTag, Messages.AppLoaded, [version]);
|
5094
5532
|
}
|
5095
5533
|
function notifyExpectedFailureHelper(apiVersionTag, expectedFailureRequest) {
|
5096
|
-
sendMessageToParent(apiVersionTag,
|
5534
|
+
sendMessageToParent(apiVersionTag, Messages.ExpectedFailure, [
|
5097
5535
|
expectedFailureRequest.reason,
|
5098
5536
|
expectedFailureRequest.message,
|
5099
5537
|
]);
|
5100
5538
|
}
|
5101
5539
|
function notifyFailureHelper(apiVersiontag, appInitializationFailedRequest) {
|
5102
|
-
sendMessageToParent(apiVersiontag,
|
5540
|
+
sendMessageToParent(apiVersiontag, Messages.Failure, [
|
5103
5541
|
appInitializationFailedRequest.reason,
|
5104
5542
|
appInitializationFailedRequest.message,
|
5105
5543
|
]);
|
5106
5544
|
}
|
5107
5545
|
function notifySuccessHelper(apiVersionTag) {
|
5108
|
-
sendMessageToParent(apiVersionTag,
|
5546
|
+
sendMessageToParent(apiVersionTag, Messages.Success, [version]);
|
5109
5547
|
}
|
5110
|
-
const initializeHelperLogger =
|
5548
|
+
const initializeHelperLogger = appHelpers_appLogger.extend('initializeHelper');
|
5111
5549
|
function initializeHelper(apiVersionTag, validMessageOrigins) {
|
5112
5550
|
return new Promise((resolve) => {
|
5113
5551
|
// Independent components might not know whether the SDK is initialized so might call it to be safe.
|
@@ -5174,7 +5612,7 @@ function initializeHelper(apiVersionTag, validMessageOrigins) {
|
|
5174
5612
|
}
|
5175
5613
|
GlobalVars.initializeCompleted = true;
|
5176
5614
|
});
|
5177
|
-
|
5615
|
+
authentication_initialize();
|
5178
5616
|
menus.initialize();
|
5179
5617
|
pages.config.initialize();
|
5180
5618
|
dialog.initialize();
|
@@ -5194,7 +5632,7 @@ function initializeHelper(apiVersionTag, validMessageOrigins) {
|
|
5194
5632
|
function registerOnThemeChangeHandlerHelper(apiVersionTag, handler) {
|
5195
5633
|
// allow for registration cleanup even when not called initialize
|
5196
5634
|
!isNullOrUndefined(handler) && ensureInitializeCalled();
|
5197
|
-
|
5635
|
+
handlers_registerOnThemeChangeHandler(apiVersionTag, handler);
|
5198
5636
|
}
|
5199
5637
|
function openLinkHelper(apiVersionTag, deepLink) {
|
5200
5638
|
return new Promise((resolve) => {
|
@@ -5202,401 +5640,82 @@ function openLinkHelper(apiVersionTag, deepLink) {
|
|
5202
5640
|
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', deepLink));
|
5203
5641
|
});
|
5204
5642
|
}
|
5643
|
+
|
5644
|
+
;// CONCATENATED MODULE: ./src/internal/appIdValidation.ts
|
5645
|
+
|
5205
5646
|
/**
|
5206
|
-
*
|
5207
|
-
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
5212
|
-
|
5213
|
-
|
5214
|
-
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
Failure: 'appInitialization.failure',
|
5220
|
-
/** App initialization expected failure. */
|
5221
|
-
ExpectedFailure: 'appInitialization.expectedFailure',
|
5222
|
-
};
|
5223
|
-
/**
|
5224
|
-
* Describes errors that caused app initialization to fail
|
5225
|
-
*/
|
5226
|
-
let FailedReason;
|
5227
|
-
(function (FailedReason) {
|
5228
|
-
/**
|
5229
|
-
* Authentication failed
|
5230
|
-
*/
|
5231
|
-
FailedReason["AuthFailed"] = "AuthFailed";
|
5232
|
-
/**
|
5233
|
-
* The application timed out
|
5234
|
-
*/
|
5235
|
-
FailedReason["Timeout"] = "Timeout";
|
5236
|
-
/**
|
5237
|
-
* The app failed for a different reason
|
5238
|
-
*/
|
5239
|
-
FailedReason["Other"] = "Other";
|
5240
|
-
})(FailedReason = app.FailedReason || (app.FailedReason = {}));
|
5241
|
-
/**
|
5242
|
-
* Describes expected errors that occurred during an otherwise successful
|
5243
|
-
* app initialization
|
5244
|
-
*/
|
5245
|
-
let ExpectedFailureReason;
|
5246
|
-
(function (ExpectedFailureReason) {
|
5247
|
-
/**
|
5248
|
-
* There was a permission error
|
5249
|
-
*/
|
5250
|
-
ExpectedFailureReason["PermissionError"] = "PermissionError";
|
5251
|
-
/**
|
5252
|
-
* The item was not found
|
5253
|
-
*/
|
5254
|
-
ExpectedFailureReason["NotFound"] = "NotFound";
|
5255
|
-
/**
|
5256
|
-
* The network is currently throttled
|
5257
|
-
*/
|
5258
|
-
ExpectedFailureReason["Throttling"] = "Throttling";
|
5259
|
-
/**
|
5260
|
-
* The application is currently offline
|
5261
|
-
*/
|
5262
|
-
ExpectedFailureReason["Offline"] = "Offline";
|
5263
|
-
/**
|
5264
|
-
* The app failed for a different reason
|
5265
|
-
*/
|
5266
|
-
ExpectedFailureReason["Other"] = "Other";
|
5267
|
-
})(ExpectedFailureReason = app.ExpectedFailureReason || (app.ExpectedFailureReason = {}));
|
5268
|
-
/**
|
5269
|
-
* Checks whether the Teams client SDK has been initialized.
|
5270
|
-
* @returns whether the Teams client SDK has been initialized.
|
5271
|
-
*/
|
5272
|
-
function isInitialized() {
|
5273
|
-
return GlobalVars.initializeCompleted;
|
5274
|
-
}
|
5275
|
-
app.isInitialized = isInitialized;
|
5276
|
-
/**
|
5277
|
-
* Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.
|
5278
|
-
* @returns the Frame Context.
|
5279
|
-
*/
|
5280
|
-
function getFrameContext() {
|
5281
|
-
return GlobalVars.frameContext;
|
5647
|
+
* This function can be used to validate if a string is a "valid" app id.
|
5648
|
+
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
5649
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
5650
|
+
* However, there are some older internal/hard-coded apps which violate this schema and use names like com.microsoft.teamspace.tab.youtube.
|
5651
|
+
* For compatibility with these legacy apps, we unfortunately cannot securely and completely validate app ids as UUIDs. Based
|
5652
|
+
* on this, the validation is limited to checking for script tags, length, and non-printable characters.
|
5653
|
+
*
|
5654
|
+
* @param potentialAppId A string to check if it's a "valid" app id
|
5655
|
+
* @throws Error with a message describing the exact validation violation
|
5656
|
+
*/
|
5657
|
+
function validateStringAsAppId(potentialAppId) {
|
5658
|
+
if (hasScriptTags(potentialAppId)) {
|
5659
|
+
throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains script tags.`);
|
5282
5660
|
}
|
5283
|
-
|
5284
|
-
|
5285
|
-
if (inServerSideRenderingEnvironment()) {
|
5286
|
-
return;
|
5287
|
-
}
|
5288
|
-
const scripts = document.getElementsByTagName('script');
|
5289
|
-
// This will always be the current script because browsers load and execute scripts in order.
|
5290
|
-
// Whenever a script is executing for the first time it will be the last script in this array.
|
5291
|
-
const currentScriptSrc = scripts && scripts[scripts.length - 1] && scripts[scripts.length - 1].src;
|
5292
|
-
const scriptUsageWarning = 'Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues';
|
5293
|
-
if (!currentScriptSrc || currentScriptSrc.length === 0) {
|
5294
|
-
appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);
|
5295
|
-
}
|
5296
|
-
else {
|
5297
|
-
appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);
|
5298
|
-
}
|
5661
|
+
if (!isStringWithinAppIdLengthLimits(potentialAppId)) {
|
5662
|
+
throw new Error(`Potential app id (${potentialAppId}) is invalid; its length ${potentialAppId.length} is not within the length limits (${minimumValidAppIdLength}-${maximumValidAppIdLength}).`);
|
5299
5663
|
}
|
5300
|
-
|
5301
|
-
|
5302
|
-
logWhereTeamsJsIsBeingUsed();
|
5303
|
-
/**
|
5304
|
-
* Initializes the library.
|
5305
|
-
*
|
5306
|
-
* @remarks
|
5307
|
-
* Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
|
5308
|
-
*
|
5309
|
-
* @param validMessageOrigins - Optionally specify a list of cross-frame message origins. This parameter is used if you know that your app
|
5310
|
-
* will be hosted on a custom domain (i.e., not a standard Microsoft 365 host like Teams, Outlook, etc.) Most apps will never need
|
5311
|
-
* to pass a value for this parameter.
|
5312
|
-
* Any domains passed in the array must have the https: protocol on the string otherwise they will be ignored. Example: https://www.example.com
|
5313
|
-
* @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
|
5314
|
-
*/
|
5315
|
-
function initialize(validMessageOrigins) {
|
5316
|
-
prefetchOriginsFromCDN();
|
5317
|
-
return appInitializeHelper(getApiVersionTag(appTelemetryVersionNumber, "app.initialize" /* ApiName.App_Initialize */), validMessageOrigins);
|
5664
|
+
if (doesStringContainNonPrintableCharacters(potentialAppId)) {
|
5665
|
+
throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains non-printable characters.`);
|
5318
5666
|
}
|
5319
|
-
|
5667
|
+
}
|
5668
|
+
const minimumValidAppIdLength = 4;
|
5669
|
+
const maximumValidAppIdLength = 256;
|
5670
|
+
function isStringWithinAppIdLengthLimits(potentialAppId) {
|
5671
|
+
return potentialAppId.length < maximumValidAppIdLength && potentialAppId.length > minimumValidAppIdLength;
|
5672
|
+
}
|
5673
|
+
function doesStringContainNonPrintableCharacters(str) {
|
5674
|
+
return [...str].some((char) => {
|
5675
|
+
const charCode = char.charCodeAt(0);
|
5676
|
+
return charCode < 32 || charCode > 126;
|
5677
|
+
});
|
5678
|
+
}
|
5679
|
+
|
5680
|
+
;// CONCATENATED MODULE: ./src/public/appId.ts
|
5681
|
+
|
5682
|
+
/**
|
5683
|
+
* A strongly-typed class used to represent a "valid" app id.
|
5684
|
+
*
|
5685
|
+
* Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:
|
5686
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id
|
5687
|
+
* However, there are some older internal/hard-coded apps which violate this schema and use names like
|
5688
|
+
* com.microsoft.teamspace.tab.youtube. For compatibility with these legacy apps, we unfortunately cannot
|
5689
|
+
* securely and completely validate app ids as UUIDs. Based on this, the validation is limited to checking
|
5690
|
+
* for script tags, length, and non-printable characters. Validation will be updated in the future to ensure
|
5691
|
+
* the app id is a valid UUID as legacy apps update.
|
5692
|
+
*/
|
5693
|
+
class AppId {
|
5320
5694
|
/**
|
5321
|
-
*
|
5322
|
-
* Undocumented function used to set a mock window for unit tests
|
5695
|
+
* Creates a strongly-typed AppId from a string
|
5323
5696
|
*
|
5324
|
-
* @
|
5325
|
-
*
|
5697
|
+
* @param appIdAsString An app id represented as a string
|
5698
|
+
* @throws Error with a message describing the exact validation violation
|
5326
5699
|
*/
|
5327
|
-
|
5328
|
-
|
5700
|
+
constructor(appIdAsString) {
|
5701
|
+
this.appIdAsString = appIdAsString;
|
5702
|
+
validateStringAsAppId(appIdAsString);
|
5329
5703
|
}
|
5330
|
-
app._initialize = _initialize;
|
5331
5704
|
/**
|
5332
5705
|
* @hidden
|
5333
|
-
* Undocumented function used to clear state between unit tests
|
5334
|
-
*
|
5335
5706
|
* @internal
|
5336
|
-
* Limited to Microsoft-internal use
|
5337
|
-
*/
|
5338
|
-
function _uninitialize() {
|
5339
|
-
if (!GlobalVars.initializeCalled) {
|
5340
|
-
return;
|
5341
|
-
}
|
5342
|
-
uninitializeHandlers();
|
5343
|
-
GlobalVars.initializeCalled = false;
|
5344
|
-
GlobalVars.initializeCompleted = false;
|
5345
|
-
GlobalVars.initializePromise = undefined;
|
5346
|
-
GlobalVars.additionalValidOrigins = [];
|
5347
|
-
GlobalVars.frameContext = undefined;
|
5348
|
-
GlobalVars.hostClientType = undefined;
|
5349
|
-
GlobalVars.isFramelessWindow = false;
|
5350
|
-
messageChannels.telemetry._clearTelemetryPort();
|
5351
|
-
messageChannels.dataLayer._clearDataLayerPort();
|
5352
|
-
uninitializeCommunication();
|
5353
|
-
}
|
5354
|
-
app._uninitialize = _uninitialize;
|
5355
|
-
/**
|
5356
|
-
* Retrieves the current context the frame is running in.
|
5357
|
-
*
|
5358
|
-
* @returns Promise that will resolve with the {@link app.Context} object.
|
5359
|
-
*/
|
5360
|
-
function getContext() {
|
5361
|
-
return new Promise((resolve) => {
|
5362
|
-
ensureInitializeCalled();
|
5363
|
-
resolve(sendAndUnwrap(getApiVersionTag(appTelemetryVersionNumber, "app.getContext" /* ApiName.App_GetContext */), 'getContext'));
|
5364
|
-
}).then((legacyContext) => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context
|
5365
|
-
}
|
5366
|
-
app.getContext = getContext;
|
5367
|
-
/**
|
5368
|
-
* Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
|
5369
|
-
*/
|
5370
|
-
function notifyAppLoaded() {
|
5371
|
-
ensureInitializeCalled();
|
5372
|
-
notifyAppLoadedHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyAppLoaded" /* ApiName.App_NotifyAppLoaded */));
|
5373
|
-
}
|
5374
|
-
app.notifyAppLoaded = notifyAppLoaded;
|
5375
|
-
/**
|
5376
|
-
* Notifies the frame that app initialization is successful and is ready for user interaction.
|
5377
|
-
*/
|
5378
|
-
function notifySuccess() {
|
5379
|
-
ensureInitializeCalled();
|
5380
|
-
notifySuccessHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifySuccess" /* ApiName.App_NotifySuccess */));
|
5381
|
-
}
|
5382
|
-
app.notifySuccess = notifySuccess;
|
5383
|
-
/**
|
5384
|
-
* Notifies the frame that app initialization has failed and to show an error page in its place.
|
5385
|
-
*
|
5386
|
-
* @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
|
5387
|
-
* during initialization as well as an optional message.
|
5388
|
-
*/
|
5389
|
-
function notifyFailure(appInitializationFailedRequest) {
|
5390
|
-
ensureInitializeCalled();
|
5391
|
-
notifyFailureHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyFailure" /* ApiName.App_NotifyFailure */), appInitializationFailedRequest);
|
5392
|
-
}
|
5393
|
-
app.notifyFailure = notifyFailure;
|
5394
|
-
/**
|
5395
|
-
* Notifies the frame that app initialized with some expected errors.
|
5396
|
-
*
|
5397
|
-
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
5398
|
-
*/
|
5399
|
-
function notifyExpectedFailure(expectedFailureRequest) {
|
5400
|
-
ensureInitializeCalled();
|
5401
|
-
notifyExpectedFailureHelper(getApiVersionTag(appTelemetryVersionNumber, "app.notifyExpectedFailure" /* ApiName.App_NotifyExpectedFailure */), expectedFailureRequest);
|
5402
|
-
}
|
5403
|
-
app.notifyExpectedFailure = notifyExpectedFailure;
|
5404
|
-
/**
|
5405
|
-
* Registers a handler for theme changes.
|
5406
5707
|
*
|
5407
|
-
* @
|
5408
|
-
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
|
5409
|
-
*
|
5410
|
-
* @param handler - The handler to invoke when the user changes their theme.
|
5708
|
+
* @returns A serializable representation of an AppId, used for passing AppIds to the host.
|
5411
5709
|
*/
|
5412
|
-
|
5413
|
-
|
5710
|
+
serialize() {
|
5711
|
+
return this.toString();
|
5414
5712
|
}
|
5415
|
-
app.registerOnThemeChangeHandler = registerOnThemeChangeHandler;
|
5416
5713
|
/**
|
5417
|
-
*
|
5418
|
-
* general-purpose links (to external websites). It should not be used for navigating to your
|
5419
|
-
* own or other apps.
|
5420
|
-
*
|
5421
|
-
* @remarks
|
5422
|
-
* If you need to navigate to your own or other apps, use:
|
5423
|
-
*
|
5424
|
-
* - {@link pages.currentApp.navigateToDefaultPage} for navigating to the default page of your own app
|
5425
|
-
* - {@link pages.currentApp.navigateTo} for navigating to a section of your own app
|
5426
|
-
* - {@link pages.navigateToApp} for navigating to other apps besides your own
|
5427
|
-
*
|
5428
|
-
* Many areas of functionality previously provided by deep links are now handled by strongly-typed functions in capabilities.
|
5429
|
-
* If your app is using a deep link to trigger these specific components, use the strongly-typed alternatives.
|
5430
|
-
* For example (this list is not exhaustive):
|
5431
|
-
* - To open an app installation dialog, use the {@link appInstallDialog} capability
|
5432
|
-
* - To start a call, use the {@link call} capability
|
5433
|
-
* - To open a chat, use the {@link chat} capability
|
5434
|
-
* - To open a dialog, use the {@link dialog} capability
|
5435
|
-
* - To create a new meeting, use the {@link calendar.composeMeeting} function
|
5436
|
-
* - To open a Stage View, use the {@link stageView} capability
|
5437
|
-
*
|
5438
|
-
* In each of these capabilities, you can use the `isSupported()` function to determine if the host supports that capability.
|
5439
|
-
* When using a deep link to trigger these components, there's no way to determine whether the host supports it.
|
5440
|
-
*
|
5441
|
-
* For more information on crafting deep links to the host, see [Configure deep links](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/deep-links)
|
5442
|
-
*
|
5443
|
-
* @param deepLink The host deep link or external web URL to which to navigate
|
5444
|
-
* @returns `Promise` that will be fulfilled when the navigation has initiated. A successful `Promise` resolution
|
5445
|
-
* does not necessarily indicate whether the target loaded successfully.
|
5714
|
+
* Returns the app id as a string
|
5446
5715
|
*/
|
5447
|
-
|
5448
|
-
return
|
5716
|
+
toString() {
|
5717
|
+
return this.appIdAsString;
|
5449
5718
|
}
|
5450
|
-
app.openLink = openLink;
|
5451
|
-
/**
|
5452
|
-
* A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
|
5453
|
-
* When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
|
5454
|
-
* When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
|
5455
|
-
* Please note that selecting suspension doesn't guarantee prevention of background termination.
|
5456
|
-
* The outcome is influenced by factors such as available memory and the number of suspended apps.
|
5457
|
-
*
|
5458
|
-
* @beta
|
5459
|
-
*/
|
5460
|
-
let lifecycle;
|
5461
|
-
(function (lifecycle) {
|
5462
|
-
/**
|
5463
|
-
* Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
|
5464
|
-
* the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
|
5465
|
-
*
|
5466
|
-
* @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
|
5467
|
-
* Upon returning, the app will be suspended or terminated.
|
5468
|
-
*
|
5469
|
-
*/
|
5470
|
-
function registerBeforeSuspendOrTerminateHandler(handler) {
|
5471
|
-
if (!handler) {
|
5472
|
-
throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');
|
5473
|
-
}
|
5474
|
-
ensureInitialized(runtime);
|
5475
|
-
handlers_registerBeforeSuspendOrTerminateHandler(handler);
|
5476
|
-
}
|
5477
|
-
lifecycle.registerBeforeSuspendOrTerminateHandler = registerBeforeSuspendOrTerminateHandler;
|
5478
|
-
/**
|
5479
|
-
* Registers a handler to be called when the page has been requested to resume from being suspended.
|
5480
|
-
*
|
5481
|
-
* @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
|
5482
|
-
* the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
|
5483
|
-
*
|
5484
|
-
* @beta
|
5485
|
-
*/
|
5486
|
-
function registerOnResumeHandler(handler) {
|
5487
|
-
if (!handler) {
|
5488
|
-
throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');
|
5489
|
-
}
|
5490
|
-
ensureInitialized(runtime);
|
5491
|
-
handlers_registerOnResumeHandler(handler);
|
5492
|
-
}
|
5493
|
-
lifecycle.registerOnResumeHandler = registerOnResumeHandler;
|
5494
|
-
})(lifecycle = app.lifecycle || (app.lifecycle = {}));
|
5495
|
-
})(app || (app = {}));
|
5496
|
-
/**
|
5497
|
-
* @hidden
|
5498
|
-
* Transforms the Legacy Context object received from Messages to the structured app.Context object
|
5499
|
-
*
|
5500
|
-
* @internal
|
5501
|
-
* Limited to Microsoft-internal use
|
5502
|
-
*/
|
5503
|
-
function transformLegacyContextToAppContext(legacyContext) {
|
5504
|
-
var _a;
|
5505
|
-
const context = {
|
5506
|
-
actionInfo: legacyContext.actionInfo,
|
5507
|
-
app: {
|
5508
|
-
locale: legacyContext.locale,
|
5509
|
-
sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',
|
5510
|
-
theme: legacyContext.theme ? legacyContext.theme : 'default',
|
5511
|
-
iconPositionVertical: legacyContext.appIconPosition,
|
5512
|
-
osLocaleInfo: legacyContext.osLocaleInfo,
|
5513
|
-
parentMessageId: legacyContext.parentMessageId,
|
5514
|
-
userClickTime: legacyContext.userClickTime,
|
5515
|
-
userFileOpenPreference: legacyContext.userFileOpenPreference,
|
5516
|
-
host: {
|
5517
|
-
name: legacyContext.hostName ? legacyContext.hostName : HostName.teams,
|
5518
|
-
clientType: legacyContext.hostClientType ? legacyContext.hostClientType : HostClientType.web,
|
5519
|
-
sessionId: legacyContext.sessionId ? legacyContext.sessionId : '',
|
5520
|
-
ringId: legacyContext.ringId,
|
5521
|
-
},
|
5522
|
-
appLaunchId: legacyContext.appLaunchId,
|
5523
|
-
},
|
5524
|
-
page: {
|
5525
|
-
id: legacyContext.entityId,
|
5526
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
5527
|
-
// @ts-ignore
|
5528
|
-
frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,
|
5529
|
-
subPageId: legacyContext.subEntityId,
|
5530
|
-
isFullScreen: legacyContext.isFullScreen,
|
5531
|
-
isMultiWindow: legacyContext.isMultiWindow,
|
5532
|
-
isBackgroundLoad: legacyContext.isBackgroundLoad,
|
5533
|
-
sourceOrigin: legacyContext.sourceOrigin,
|
5534
|
-
},
|
5535
|
-
user: {
|
5536
|
-
id: (_a = legacyContext.userObjectId) !== null && _a !== void 0 ? _a : '',
|
5537
|
-
displayName: legacyContext.userDisplayName,
|
5538
|
-
isCallingAllowed: legacyContext.isCallingAllowed,
|
5539
|
-
isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,
|
5540
|
-
licenseType: legacyContext.userLicenseType,
|
5541
|
-
loginHint: legacyContext.loginHint,
|
5542
|
-
userPrincipalName: legacyContext.userPrincipalName,
|
5543
|
-
tenant: legacyContext.tid
|
5544
|
-
? {
|
5545
|
-
id: legacyContext.tid,
|
5546
|
-
teamsSku: legacyContext.tenantSKU,
|
5547
|
-
}
|
5548
|
-
: undefined,
|
5549
|
-
},
|
5550
|
-
channel: legacyContext.channelId
|
5551
|
-
? {
|
5552
|
-
id: legacyContext.channelId,
|
5553
|
-
displayName: legacyContext.channelName,
|
5554
|
-
relativeUrl: legacyContext.channelRelativeUrl,
|
5555
|
-
membershipType: legacyContext.channelType,
|
5556
|
-
defaultOneNoteSectionId: legacyContext.defaultOneNoteSectionId,
|
5557
|
-
ownerGroupId: legacyContext.hostTeamGroupId,
|
5558
|
-
ownerTenantId: legacyContext.hostTeamTenantId,
|
5559
|
-
}
|
5560
|
-
: undefined,
|
5561
|
-
chat: legacyContext.chatId
|
5562
|
-
? {
|
5563
|
-
id: legacyContext.chatId,
|
5564
|
-
}
|
5565
|
-
: undefined,
|
5566
|
-
meeting: legacyContext.meetingId
|
5567
|
-
? {
|
5568
|
-
id: legacyContext.meetingId,
|
5569
|
-
}
|
5570
|
-
: undefined,
|
5571
|
-
sharepoint: legacyContext.sharepoint,
|
5572
|
-
team: legacyContext.teamId
|
5573
|
-
? {
|
5574
|
-
internalId: legacyContext.teamId,
|
5575
|
-
displayName: legacyContext.teamName,
|
5576
|
-
type: legacyContext.teamType,
|
5577
|
-
groupId: legacyContext.groupId,
|
5578
|
-
templateId: legacyContext.teamTemplateId,
|
5579
|
-
isArchived: legacyContext.isTeamArchived,
|
5580
|
-
userRole: legacyContext.userTeamRole,
|
5581
|
-
}
|
5582
|
-
: undefined,
|
5583
|
-
sharePointSite: legacyContext.teamSiteUrl ||
|
5584
|
-
legacyContext.teamSiteDomain ||
|
5585
|
-
legacyContext.teamSitePath ||
|
5586
|
-
legacyContext.mySitePath ||
|
5587
|
-
legacyContext.mySiteDomain
|
5588
|
-
? {
|
5589
|
-
teamSiteUrl: legacyContext.teamSiteUrl,
|
5590
|
-
teamSiteDomain: legacyContext.teamSiteDomain,
|
5591
|
-
teamSitePath: legacyContext.teamSitePath,
|
5592
|
-
teamSiteId: legacyContext.teamSiteId,
|
5593
|
-
mySitePath: legacyContext.mySitePath,
|
5594
|
-
mySiteDomain: legacyContext.mySiteDomain,
|
5595
|
-
}
|
5596
|
-
: undefined,
|
5597
|
-
dialogParameters: legacyContext.dialogParameters || {},
|
5598
|
-
};
|
5599
|
-
return context;
|
5600
5719
|
}
|
5601
5720
|
|
5602
5721
|
;// CONCATENATED MODULE: ./src/public/pages.ts
|
@@ -6611,7 +6730,7 @@ function registerHandlerHelper(apiVersionTag, name, handler, contexts, registrat
|
|
6611
6730
|
* @internal
|
6612
6731
|
* Limited to Microsoft-internal use
|
6613
6732
|
*/
|
6614
|
-
function
|
6733
|
+
function handlers_registerOnThemeChangeHandler(apiVersionTag, handler) {
|
6615
6734
|
HandlersPrivate.themeChangeHandler = handler;
|
6616
6735
|
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['themeChange']);
|
6617
6736
|
}
|
@@ -6887,6 +7006,8 @@ var communication_awaiter = (undefined && undefined.__awaiter) || function (this
|
|
6887
7006
|
|
6888
7007
|
|
6889
7008
|
|
7009
|
+
|
7010
|
+
|
6890
7011
|
const communicationLogger = getLogger('communication');
|
6891
7012
|
/**
|
6892
7013
|
* @internal
|
@@ -6981,6 +7102,7 @@ function uninitializeCommunication() {
|
|
6981
7102
|
CommunicationPrivate.legacyMessageIdsToUuidMap = {};
|
6982
7103
|
}
|
6983
7104
|
/**
|
7105
|
+
* @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
6984
7106
|
* @hidden
|
6985
7107
|
* Send a message to parent and then unwrap result. Uses nativeInterface on mobile to communicate with parent context
|
6986
7108
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
@@ -6993,6 +7115,7 @@ function sendAndUnwrap(apiVersionTag, actionName, ...args) {
|
|
6993
7115
|
return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([result]) => result);
|
6994
7116
|
}
|
6995
7117
|
/**
|
7118
|
+
* @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
6996
7119
|
* @hidden
|
6997
7120
|
* Send a message to parent and then handle status and reason. Uses nativeInterface on mobile to communicate with parent context
|
6998
7121
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
@@ -7006,6 +7129,7 @@ function sendAndHandleStatusAndReason(apiVersionTag, actionName, ...args) {
|
|
7006
7129
|
});
|
7007
7130
|
}
|
7008
7131
|
/**
|
7132
|
+
* @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
7009
7133
|
* @hidden
|
7010
7134
|
* Send a message to parent and then handle status and reason with default error. Uses nativeInterface on mobile to communicate with parent context
|
7011
7135
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
@@ -7022,6 +7146,7 @@ function sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, actionName,
|
|
7022
7146
|
});
|
7023
7147
|
}
|
7024
7148
|
/**
|
7149
|
+
* @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
7025
7150
|
* @hidden
|
7026
7151
|
* Send a message to parent and then handle SDK error. Uses nativeInterface on mobile to communicate with parent context
|
7027
7152
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
@@ -7039,6 +7164,7 @@ function sendAndHandleSdkError(apiVersionTag, actionName, ...args) {
|
|
7039
7164
|
});
|
7040
7165
|
}
|
7041
7166
|
/**
|
7167
|
+
* @deprecated This function will no longer be exported in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
7042
7168
|
* @hidden
|
7043
7169
|
* Send a message to parent asynchronously. Uses nativeInterface on mobile to communicate with parent context
|
7044
7170
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
@@ -7056,6 +7182,71 @@ function sendMessageToParentAsync(apiVersionTag, actionName, args = undefined) {
|
|
7056
7182
|
resolve(waitForResponse(request.uuid));
|
7057
7183
|
});
|
7058
7184
|
}
|
7185
|
+
function serializeItemArray(items) {
|
7186
|
+
return items.map((item) => {
|
7187
|
+
if (isSerializable(item)) {
|
7188
|
+
return item.serialize();
|
7189
|
+
}
|
7190
|
+
else {
|
7191
|
+
return item;
|
7192
|
+
}
|
7193
|
+
});
|
7194
|
+
}
|
7195
|
+
/**
|
7196
|
+
* Call a function in the host and receive a response. If the host returns an {@link SdkError} instead of a normal response, this function will throw a new Error containing the SdkError's information
|
7197
|
+
*
|
7198
|
+
* @param functionName The function name to call in the host.
|
7199
|
+
* @param args A collection of data to pass to the host. This data must be an array of either simple types or objects that implement {@link ISerializable}.
|
7200
|
+
* @param responseHandler When the host responds, this handler will validate and deserialize the response.
|
7201
|
+
* @param apiVersionTag A unique tag used to identify the API version for telemetry purposes. This should be set using {@link getApiVersionTag}, which should be passed a unique string identifying the function being called by the app developer as well as a version number that is incremented whenever meaningful changes are made to that function.
|
7202
|
+
* @param isResponseAReportableError This optional property can be used to override the default ErrorChecking this function uses to decide whether to throw the host response as a new Error. Specify this if your function needs to do any logic verifying that the object received is an error that goes beyond the logic found in {@link isSdkError}.
|
7203
|
+
*
|
7204
|
+
* @returns The response received from the host after deserialization.
|
7205
|
+
*
|
7206
|
+
* @throws An Error containing the SdkError information ({@link SdkError.errorCode} and {@link SdkError.message}) if the host returns an SdkError, or an Error if the response from the host is an unexpected format.
|
7207
|
+
*/
|
7208
|
+
function callFunctionInHostAndHandleResponse(functionName, args, responseHandler, apiVersionTag, isResponseAReportableError) {
|
7209
|
+
var _a;
|
7210
|
+
return communication_awaiter(this, void 0, void 0, function* () {
|
7211
|
+
const serializedArguments = serializeItemArray(args);
|
7212
|
+
const [response] = yield sendMessageToParentAsync(apiVersionTag, functionName, serializedArguments);
|
7213
|
+
if ((isResponseAReportableError && isResponseAReportableError(response)) ||
|
7214
|
+
(!isResponseAReportableError && isSdkError(response))) {
|
7215
|
+
throw new Error(`${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
7216
|
+
}
|
7217
|
+
else if (!responseHandler.validate(response)) {
|
7218
|
+
throw new Error(`${ErrorCode.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(response)}`);
|
7219
|
+
}
|
7220
|
+
else {
|
7221
|
+
return responseHandler.deserialize(response);
|
7222
|
+
}
|
7223
|
+
});
|
7224
|
+
}
|
7225
|
+
/**
|
7226
|
+
* Call a function in the host that receives either an {@link SdkError} or undefined as a response. If the host returns an {@link SdkError} this function will throw a new Error containing the SdkError's information.
|
7227
|
+
*
|
7228
|
+
* @param functionName The function name to call in the host.
|
7229
|
+
* @param args A collection of data to pass to the host. This data must be an array of either simple types or objects that implement {@link ISerializable}.
|
7230
|
+
* @param apiVersionTag A unique tag used to identify the API version for telemetry purposes. This should be set using {@link getApiVersionTag}, which should be passed a unique string identifying the function being called by the app developer as well as a version number that is incremented whenever meaningful changes are made to that function.
|
7231
|
+
* @param isResponseAReportableError This optional property can be used to override the default ErrorChecking this function uses to decide whether to throw the host response as a new Error. Specify this is your function needs to do any logic verifying that the object received is an error that goes beyond the logic found in {@link isSdkError}.
|
7232
|
+
*
|
7233
|
+
* @throws An Error containing the SdkError information ({@link SdkError.errorCode} and {@link SdkError.message}) if the host returns an SdkError, or an Error if the response from the host is an unexpected format.
|
7234
|
+
*/
|
7235
|
+
function callFunctionInHost(functionName, args, apiVersionTag, isResponseAReportableError) {
|
7236
|
+
var _a;
|
7237
|
+
return communication_awaiter(this, void 0, void 0, function* () {
|
7238
|
+
const serializedArguments = serializeItemArray(args);
|
7239
|
+
const [response] = yield sendMessageToParentAsync(apiVersionTag, functionName, serializedArguments);
|
7240
|
+
if ((isResponseAReportableError && isResponseAReportableError(response)) ||
|
7241
|
+
(!isResponseAReportableError && isSdkError(response))) {
|
7242
|
+
throw new Error(`${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
7243
|
+
}
|
7244
|
+
else if (response !== undefined) {
|
7245
|
+
// If we receive a response from the host that is not a recognized error type it is an invalid response
|
7246
|
+
throw new Error(`${ErrorCode.INTERNAL_ERROR}, message: Invalid response from host`);
|
7247
|
+
}
|
7248
|
+
});
|
7249
|
+
}
|
7059
7250
|
/**
|
7060
7251
|
* @hidden
|
7061
7252
|
* Send a message to parent requesting a MessageChannel Port.
|
@@ -7096,6 +7287,7 @@ function waitForResponse(requestUuid) {
|
|
7096
7287
|
});
|
7097
7288
|
}
|
7098
7289
|
/**
|
7290
|
+
* @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
7099
7291
|
* @hidden
|
7100
7292
|
* Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
|
7101
7293
|
* Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
|
@@ -8186,6 +8378,27 @@ var copilot;
|
|
8186
8378
|
})(eligibility = copilot.eligibility || (copilot.eligibility = {}));
|
8187
8379
|
})(copilot || (copilot = {}));
|
8188
8380
|
|
8381
|
+
;// CONCATENATED MODULE: ./src/internal/responseHandler.ts
|
8382
|
+
/**
|
8383
|
+
* This class is used for validating and deserializing the response from the host.
|
8384
|
+
*
|
8385
|
+
* @typeParam SerializedReturnValueFromHost The type of the response received from the host
|
8386
|
+
* @typeParam DeserializedReturnValueFromHost The type of the response after deserialization
|
8387
|
+
*/
|
8388
|
+
class ResponseHandler {
|
8389
|
+
}
|
8390
|
+
/**
|
8391
|
+
* This class is used for validating and deserializing boolean responses from the host.
|
8392
|
+
*/
|
8393
|
+
class SimpleTypeResponseHandler extends ResponseHandler {
|
8394
|
+
validate(_response) {
|
8395
|
+
return true;
|
8396
|
+
}
|
8397
|
+
deserialize(response) {
|
8398
|
+
return response;
|
8399
|
+
}
|
8400
|
+
}
|
8401
|
+
|
8189
8402
|
;// CONCATENATED MODULE: ./src/private/externalAppAuthentication.ts
|
8190
8403
|
|
8191
8404
|
|
@@ -8194,6 +8407,7 @@ var copilot;
|
|
8194
8407
|
|
8195
8408
|
|
8196
8409
|
|
8410
|
+
|
8197
8411
|
/**
|
8198
8412
|
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
8199
8413
|
*/
|
@@ -8206,6 +8420,20 @@ const externalAppAuthenticationTelemetryVersionNumber = "v2" /* ApiVersionNumber
|
|
8206
8420
|
*/
|
8207
8421
|
var externalAppAuthentication;
|
8208
8422
|
(function (externalAppAuthentication) {
|
8423
|
+
/**
|
8424
|
+
* @hidden
|
8425
|
+
* @internal
|
8426
|
+
* Limited to Microsoft-internal use
|
8427
|
+
*/
|
8428
|
+
class SerializableActionExecuteInvokeRequest {
|
8429
|
+
constructor(invokeRequest) {
|
8430
|
+
this.invokeRequest = invokeRequest;
|
8431
|
+
}
|
8432
|
+
serialize() {
|
8433
|
+
return this.invokeRequest;
|
8434
|
+
}
|
8435
|
+
}
|
8436
|
+
externalAppAuthentication.SerializableActionExecuteInvokeRequest = SerializableActionExecuteInvokeRequest;
|
8209
8437
|
/**
|
8210
8438
|
* @beta
|
8211
8439
|
* @hidden
|
@@ -8251,6 +8479,20 @@ var externalAppAuthentication;
|
|
8251
8479
|
InvokeResponseType["ActionExecuteInvokeResponse"] = "ActionExecuteInvokeResponse";
|
8252
8480
|
InvokeResponseType["QueryMessageExtensionResponse"] = "QueryMessageExtensionResponse";
|
8253
8481
|
})(InvokeResponseType = externalAppAuthentication.InvokeResponseType || (externalAppAuthentication.InvokeResponseType = {}));
|
8482
|
+
/**
|
8483
|
+
* @hidden
|
8484
|
+
* @internal
|
8485
|
+
* Limited to Microsoft-internal use
|
8486
|
+
*/
|
8487
|
+
class ActionExecuteResponseHandler extends ResponseHandler {
|
8488
|
+
validate(response) {
|
8489
|
+
return externalAppAuthentication.isActionExecuteResponse(response);
|
8490
|
+
}
|
8491
|
+
deserialize(response) {
|
8492
|
+
return response;
|
8493
|
+
}
|
8494
|
+
}
|
8495
|
+
externalAppAuthentication.ActionExecuteResponseHandler = ActionExecuteResponseHandler;
|
8254
8496
|
/**
|
8255
8497
|
* @beta
|
8256
8498
|
* @hidden
|
@@ -8527,10 +8769,7 @@ var externalAppAuthenticationForCEA;
|
|
8527
8769
|
throw errorNotSupportedOnPlatform;
|
8528
8770
|
}
|
8529
8771
|
validateId(conversationId, new Error('conversation id is not valid.'));
|
8530
|
-
|
8531
|
-
if (error) {
|
8532
|
-
throw error;
|
8533
|
-
}
|
8772
|
+
return callFunctionInHost("externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */, [appId, conversationId, authTokenRequest.claims, authTokenRequest.silent], getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */), externalAppAuthentication.isInvokeError);
|
8534
8773
|
});
|
8535
8774
|
}
|
8536
8775
|
externalAppAuthenticationForCEA.authenticateWithSSO = authenticateWithSSO;
|
@@ -8554,10 +8793,14 @@ var externalAppAuthenticationForCEA;
|
|
8554
8793
|
}
|
8555
8794
|
validateId(conversationId, new Error('conversation id is not valid.'));
|
8556
8795
|
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
8557
|
-
|
8558
|
-
|
8559
|
-
|
8560
|
-
|
8796
|
+
return callFunctionInHost("externalAppAuthenticationForCEA.authenticateWithOauth" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithOauth */, [
|
8797
|
+
appId,
|
8798
|
+
conversationId,
|
8799
|
+
authenticateParameters.url.href,
|
8800
|
+
authenticateParameters.width,
|
8801
|
+
authenticateParameters.height,
|
8802
|
+
authenticateParameters.isExternal,
|
8803
|
+
], getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithOauth" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithOauth */), externalAppAuthentication.isInvokeError);
|
8561
8804
|
});
|
8562
8805
|
}
|
8563
8806
|
externalAppAuthenticationForCEA.authenticateWithOauth = authenticateWithOauth;
|
@@ -8583,13 +8826,15 @@ var externalAppAuthenticationForCEA;
|
|
8583
8826
|
validateId(conversationId, new Error('conversation id is not valid.'));
|
8584
8827
|
validateOriginalRequestInfo(originalRequestInfo);
|
8585
8828
|
// Ask the parent window to open an authentication window with the parameters provided by the caller.
|
8586
|
-
|
8587
|
-
|
8588
|
-
|
8589
|
-
|
8590
|
-
|
8591
|
-
|
8592
|
-
|
8829
|
+
return callFunctionInHostAndHandleResponse("externalAppAuthenticationForCEA.authenticateAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateAndResendRequest */, [
|
8830
|
+
appId,
|
8831
|
+
conversationId,
|
8832
|
+
new externalAppAuthentication.SerializableActionExecuteInvokeRequest(originalRequestInfo),
|
8833
|
+
authenticateParameters.url.href,
|
8834
|
+
authenticateParameters.width,
|
8835
|
+
authenticateParameters.height,
|
8836
|
+
authenticateParameters.isExternal,
|
8837
|
+
], new externalAppAuthentication.ActionExecuteResponseHandler(), getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateAndResendRequest */), externalAppAuthentication.isInvokeError);
|
8593
8838
|
});
|
8594
8839
|
}
|
8595
8840
|
externalAppAuthenticationForCEA.authenticateAndResendRequest = authenticateAndResendRequest;
|
@@ -8614,13 +8859,13 @@ var externalAppAuthenticationForCEA;
|
|
8614
8859
|
}
|
8615
8860
|
validateId(conversationId, new Error('conversation id is not valid.'));
|
8616
8861
|
validateOriginalRequestInfo(originalRequestInfo);
|
8617
|
-
|
8618
|
-
|
8619
|
-
|
8620
|
-
|
8621
|
-
|
8622
|
-
|
8623
|
-
|
8862
|
+
return callFunctionInHostAndHandleResponse("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSOAndResendRequest */, [
|
8863
|
+
appId,
|
8864
|
+
conversationId,
|
8865
|
+
new externalAppAuthentication.SerializableActionExecuteInvokeRequest(originalRequestInfo),
|
8866
|
+
authTokenRequest.claims,
|
8867
|
+
authTokenRequest.silent,
|
8868
|
+
], new externalAppAuthentication.ActionExecuteResponseHandler(), getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSOAndResendRequest */), externalAppAuthentication.isInvokeError);
|
8624
8869
|
});
|
8625
8870
|
}
|
8626
8871
|
externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest = authenticateWithSSOAndResendRequest;
|
@@ -8652,16 +8897,6 @@ var externalAppAuthenticationForCEA;
|
|
8652
8897
|
throw error;
|
8653
8898
|
}
|
8654
8899
|
}
|
8655
|
-
/**
|
8656
|
-
* @hidden
|
8657
|
-
* @internal
|
8658
|
-
* Limited to Microsoft-internal use
|
8659
|
-
* @beta
|
8660
|
-
*/
|
8661
|
-
const defaultExternalAppError = {
|
8662
|
-
errorCode: externalAppAuthentication.InvokeErrorCode.INTERNAL_ERROR,
|
8663
|
-
message: 'No valid response received',
|
8664
|
-
};
|
8665
8900
|
})(externalAppAuthenticationForCEA || (externalAppAuthenticationForCEA = {}));
|
8666
8901
|
|
8667
8902
|
;// CONCATENATED MODULE: ./src/private/externalAppCardActions.ts
|
@@ -11509,6 +11744,14 @@ var hostEntity;
|
|
11509
11744
|
(function (AppTypes) {
|
11510
11745
|
AppTypes["edu"] = "EDU";
|
11511
11746
|
})(AppTypes = hostEntity.AppTypes || (hostEntity.AppTypes = {}));
|
11747
|
+
class SerializableHostEntityId {
|
11748
|
+
constructor(hostEntityId) {
|
11749
|
+
this.hostEntityId = hostEntityId;
|
11750
|
+
}
|
11751
|
+
serialize() {
|
11752
|
+
return this.hostEntityId;
|
11753
|
+
}
|
11754
|
+
}
|
11512
11755
|
/**
|
11513
11756
|
* @hidden
|
11514
11757
|
* @internal
|
@@ -11519,6 +11762,53 @@ var hostEntity;
|
|
11519
11762
|
*/
|
11520
11763
|
let tab;
|
11521
11764
|
(function (tab_1) {
|
11765
|
+
class ConfigurableTabInstanceResponseHandler extends ResponseHandler {
|
11766
|
+
validate(response) {
|
11767
|
+
return response.tabType === 'ConfigurableTab';
|
11768
|
+
}
|
11769
|
+
deserialize(response) {
|
11770
|
+
return response;
|
11771
|
+
}
|
11772
|
+
}
|
11773
|
+
class SerializableConfigurableTabInstance {
|
11774
|
+
constructor(configurableTabInstance) {
|
11775
|
+
this.configurableTabInstance = configurableTabInstance;
|
11776
|
+
}
|
11777
|
+
serialize() {
|
11778
|
+
return this.configurableTabInstance;
|
11779
|
+
}
|
11780
|
+
}
|
11781
|
+
class HostEntityTabInstanceResponseHandler extends ResponseHandler {
|
11782
|
+
validate(response) {
|
11783
|
+
return response.tabType === 'ConfigurableTab' || response.tabType === 'StaticTab';
|
11784
|
+
}
|
11785
|
+
deserialize(response) {
|
11786
|
+
return response;
|
11787
|
+
}
|
11788
|
+
}
|
11789
|
+
class SerializableHostEntityTabInstance {
|
11790
|
+
constructor(hostEntityTabInstance) {
|
11791
|
+
this.hostEntityTabInstance = hostEntityTabInstance;
|
11792
|
+
}
|
11793
|
+
serialize() {
|
11794
|
+
return this.hostEntityTabInstance;
|
11795
|
+
}
|
11796
|
+
}
|
11797
|
+
class HostEntityTabInstancesResponseHandler extends ResponseHandler {
|
11798
|
+
validate(response) {
|
11799
|
+
const instanceValidator = new HostEntityTabInstanceResponseHandler();
|
11800
|
+
let isValid = true;
|
11801
|
+
if (response.allTabs) {
|
11802
|
+
response.allTabs.forEach((tab) => {
|
11803
|
+
isValid || (isValid = instanceValidator.validate(tab));
|
11804
|
+
});
|
11805
|
+
}
|
11806
|
+
return isValid;
|
11807
|
+
}
|
11808
|
+
deserialize(response) {
|
11809
|
+
return response;
|
11810
|
+
}
|
11811
|
+
}
|
11522
11812
|
/**
|
11523
11813
|
* @hidden
|
11524
11814
|
* @internal
|
@@ -11547,13 +11837,7 @@ var hostEntity;
|
|
11547
11837
|
if (appTypes && appTypes.length === 0) {
|
11548
11838
|
throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);
|
11549
11839
|
}
|
11550
|
-
return
|
11551
|
-
var _a;
|
11552
|
-
if (isSdkError(response)) {
|
11553
|
-
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
11554
|
-
}
|
11555
|
-
return response;
|
11556
|
-
});
|
11840
|
+
return callFunctionInHostAndHandleResponse('hostEntity.tab.addAndConfigure', [new SerializableHostEntityId(hostEntityIds), appTypes], new HostEntityTabInstanceResponseHandler(), getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.addAndConfigure" /* ApiName.HostEntity_Tab_addAndConfigureApp */));
|
11557
11841
|
}
|
11558
11842
|
tab_1.addAndConfigure = addAndConfigure;
|
11559
11843
|
/**
|
@@ -11576,13 +11860,7 @@ var hostEntity;
|
|
11576
11860
|
throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);
|
11577
11861
|
}
|
11578
11862
|
validateThreadId(hostEntityIds.threadId);
|
11579
|
-
return
|
11580
|
-
var _a;
|
11581
|
-
if (isSdkError(response)) {
|
11582
|
-
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
11583
|
-
}
|
11584
|
-
return response;
|
11585
|
-
});
|
11863
|
+
return callFunctionInHostAndHandleResponse('hostEntity.tab.getAll', [new SerializableHostEntityId(hostEntityIds)], new HostEntityTabInstancesResponseHandler(), getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.getAll" /* ApiName.HostEntity_Tab_getAll */));
|
11586
11864
|
}
|
11587
11865
|
tab_1.getAll = getAll;
|
11588
11866
|
/**
|
@@ -11609,13 +11887,7 @@ var hostEntity;
|
|
11609
11887
|
}
|
11610
11888
|
validateTab(tab);
|
11611
11889
|
validateThreadId(hostEntityIds.threadId);
|
11612
|
-
return
|
11613
|
-
var _a;
|
11614
|
-
if (isSdkError(response)) {
|
11615
|
-
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
11616
|
-
}
|
11617
|
-
return response;
|
11618
|
-
});
|
11890
|
+
return callFunctionInHostAndHandleResponse('hostEntity.tab.reconfigure', [new SerializableConfigurableTabInstance(tab), new SerializableHostEntityId(hostEntityIds)], new ConfigurableTabInstanceResponseHandler(), getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.reconfigure" /* ApiName.HostEntity_Tab_reconfigure */));
|
11619
11891
|
}
|
11620
11892
|
tab_1.reconfigure = reconfigure;
|
11621
11893
|
/**
|
@@ -11642,13 +11914,7 @@ var hostEntity;
|
|
11642
11914
|
}
|
11643
11915
|
validateTab(tab);
|
11644
11916
|
validateThreadId(hostEntityIds.threadId);
|
11645
|
-
return
|
11646
|
-
var _a;
|
11647
|
-
if (isSdkError(response)) {
|
11648
|
-
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
11649
|
-
}
|
11650
|
-
return response;
|
11651
|
-
});
|
11917
|
+
return callFunctionInHostAndHandleResponse('hostEntity.tab.rename', [new SerializableConfigurableTabInstance(tab), new SerializableHostEntityId(hostEntityIds)], new ConfigurableTabInstanceResponseHandler(), getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.rename" /* ApiName.HostEntity_Tab_rename */));
|
11652
11918
|
}
|
11653
11919
|
tab_1.rename = rename;
|
11654
11920
|
/**
|
@@ -11675,13 +11941,7 @@ var hostEntity;
|
|
11675
11941
|
}
|
11676
11942
|
validateThreadId(hostEntityIds.threadId);
|
11677
11943
|
validateTab(tab);
|
11678
|
-
return
|
11679
|
-
var _a;
|
11680
|
-
if (isSdkError(response)) {
|
11681
|
-
throw new Error(`Error code: ${response.errorCode}, message: ${(_a = response.message) !== null && _a !== void 0 ? _a : 'None'}`);
|
11682
|
-
}
|
11683
|
-
return true;
|
11684
|
-
});
|
11944
|
+
return callFunctionInHostAndHandleResponse('hostEntity.tab.remove', [new SerializableHostEntityTabInstance(tab), new SerializableHostEntityId(hostEntityIds)], new SimpleTypeResponseHandler(), getApiVersionTag(hostEntityTelemetryVersionNumber, "hostEntity.tab.remove" /* ApiName.HostEntity_Tab_remove */));
|
11685
11945
|
}
|
11686
11946
|
tab_1.remove = remove;
|
11687
11947
|
/**
|
@@ -11874,41 +12134,36 @@ function createTeamsDeepLinkForAppInstallDialog(appId) {
|
|
11874
12134
|
* v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
|
11875
12135
|
*/
|
11876
12136
|
const appInstallDialogTelemetryVersionNumber = "v1" /* ApiVersionNumber.V_1 */;
|
11877
|
-
|
11878
|
-
|
11879
|
-
|
11880
|
-
|
11881
|
-
|
11882
|
-
|
11883
|
-
|
11884
|
-
|
11885
|
-
|
11886
|
-
|
11887
|
-
|
11888
|
-
|
11889
|
-
|
11890
|
-
|
11891
|
-
|
11892
|
-
|
11893
|
-
|
11894
|
-
|
11895
|
-
|
11896
|
-
|
11897
|
-
|
11898
|
-
|
11899
|
-
|
11900
|
-
|
11901
|
-
|
11902
|
-
|
11903
|
-
|
11904
|
-
|
11905
|
-
|
11906
|
-
|
11907
|
-
function isSupported() {
|
11908
|
-
return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;
|
11909
|
-
}
|
11910
|
-
appInstallDialog.isSupported = isSupported;
|
11911
|
-
})(appInstallDialog || (appInstallDialog = {}));
|
12137
|
+
/**
|
12138
|
+
* Displays a dialog box that allows users to install a specific app within the host environment.
|
12139
|
+
*
|
12140
|
+
* @param openAPPInstallDialogParams - See {@link OpenAppInstallDialogParams | OpenAppInstallDialogParams} for more information.
|
12141
|
+
*/
|
12142
|
+
function openAppInstallDialog(openAPPInstallDialogParams) {
|
12143
|
+
return new Promise((resolve) => {
|
12144
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
|
12145
|
+
if (!isSupported()) {
|
12146
|
+
throw new Error('Not supported');
|
12147
|
+
}
|
12148
|
+
const apiVersionTag = getApiVersionTag(appInstallDialogTelemetryVersionNumber, "appInstallDialog.openAppInstallDialog" /* ApiName.AppInstallDialog_OpenAppInstallDialog */);
|
12149
|
+
if (runtime.isLegacyTeams) {
|
12150
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId)));
|
12151
|
+
}
|
12152
|
+
else {
|
12153
|
+
sendMessageToParent(apiVersionTag, 'appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);
|
12154
|
+
resolve();
|
12155
|
+
}
|
12156
|
+
});
|
12157
|
+
}
|
12158
|
+
/**
|
12159
|
+
* Checks if the appInstallDialog capability is supported by the host
|
12160
|
+
* @returns boolean to represent whether the appInstallDialog capability is supported
|
12161
|
+
*
|
12162
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
12163
|
+
*/
|
12164
|
+
function isSupported() {
|
12165
|
+
return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;
|
12166
|
+
}
|
11912
12167
|
|
11913
12168
|
;// CONCATENATED MODULE: ./src/public/media.ts
|
11914
12169
|
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
@@ -12643,83 +12898,71 @@ function validatePeoplePickerInput(peoplePickerInputs) {
|
|
12643
12898
|
*/
|
12644
12899
|
const barCodeTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
12645
12900
|
/**
|
12646
|
-
*
|
12901
|
+
* Scan Barcode or QRcode using camera
|
12902
|
+
*
|
12903
|
+
* @param barCodeConfig - input configuration to customize the barcode scanning experience
|
12904
|
+
*
|
12905
|
+
* @returns a scanned code
|
12647
12906
|
*
|
12648
12907
|
* @beta
|
12649
12908
|
*/
|
12650
|
-
|
12651
|
-
|
12652
|
-
/**
|
12653
|
-
* Scan Barcode or QRcode using camera
|
12654
|
-
*
|
12655
|
-
* @param barCodeConfig - input configuration to customize the barcode scanning experience
|
12656
|
-
*
|
12657
|
-
* @returns a scanned code
|
12658
|
-
*
|
12659
|
-
* @beta
|
12660
|
-
*/
|
12661
|
-
function scanBarCode(barCodeConfig) {
|
12662
|
-
return new Promise((resolve) => {
|
12663
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12664
|
-
if (!isSupported()) {
|
12665
|
-
throw errorNotSupportedOnPlatform;
|
12666
|
-
}
|
12667
|
-
if (!validateScanBarCodeInput(barCodeConfig)) {
|
12668
|
-
throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
12669
|
-
}
|
12670
|
-
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, "barCode.scanBarCode" /* ApiName.BarCode_ScanBarCode */), 'media.scanBarCode', barCodeConfig));
|
12671
|
-
});
|
12672
|
-
}
|
12673
|
-
barCode.scanBarCode = scanBarCode;
|
12674
|
-
/**
|
12675
|
-
* Checks whether or not media has user permission
|
12676
|
-
*
|
12677
|
-
* @returns true if the user has granted the app permission to media information, false otherwise
|
12678
|
-
*
|
12679
|
-
* @beta
|
12680
|
-
*/
|
12681
|
-
function hasPermission() {
|
12909
|
+
function scanBarCode(barCodeConfig) {
|
12910
|
+
return new Promise((resolve) => {
|
12682
12911
|
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12683
|
-
if (!
|
12912
|
+
if (!barCode_isSupported()) {
|
12684
12913
|
throw errorNotSupportedOnPlatform;
|
12685
12914
|
}
|
12686
|
-
|
12687
|
-
|
12688
|
-
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, "barCode.hasPermission" /* ApiName.BarCode_HasPermission */), 'permissions.has', permissions));
|
12689
|
-
});
|
12690
|
-
}
|
12691
|
-
barCode.hasPermission = hasPermission;
|
12692
|
-
/**
|
12693
|
-
* Requests user permission for media
|
12694
|
-
*
|
12695
|
-
* @returns true if the user has granted the app permission to the media, false otherwise
|
12696
|
-
*
|
12697
|
-
* @beta
|
12698
|
-
*/
|
12699
|
-
function requestPermission() {
|
12700
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12701
|
-
if (!isSupported()) {
|
12702
|
-
throw errorNotSupportedOnPlatform;
|
12915
|
+
if (!validateScanBarCodeInput(barCodeConfig)) {
|
12916
|
+
throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
12703
12917
|
}
|
12704
|
-
|
12705
|
-
|
12706
|
-
|
12707
|
-
|
12918
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, "barCode.scanBarCode" /* ApiName.BarCode_ScanBarCode */), 'media.scanBarCode', barCodeConfig));
|
12919
|
+
});
|
12920
|
+
}
|
12921
|
+
/**
|
12922
|
+
* Checks whether or not media has user permission
|
12923
|
+
*
|
12924
|
+
* @returns true if the user has granted the app permission to media information, false otherwise
|
12925
|
+
*
|
12926
|
+
* @beta
|
12927
|
+
*/
|
12928
|
+
function hasPermission() {
|
12929
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12930
|
+
if (!barCode_isSupported()) {
|
12931
|
+
throw errorNotSupportedOnPlatform;
|
12708
12932
|
}
|
12709
|
-
|
12710
|
-
|
12711
|
-
|
12712
|
-
|
12713
|
-
|
12714
|
-
|
12715
|
-
|
12716
|
-
|
12717
|
-
|
12718
|
-
|
12719
|
-
|
12933
|
+
const permissions = DevicePermission.Media;
|
12934
|
+
return new Promise((resolve) => {
|
12935
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, "barCode.hasPermission" /* ApiName.BarCode_HasPermission */), 'permissions.has', permissions));
|
12936
|
+
});
|
12937
|
+
}
|
12938
|
+
/**
|
12939
|
+
* Requests user permission for media
|
12940
|
+
*
|
12941
|
+
* @returns true if the user has granted the app permission to the media, false otherwise
|
12942
|
+
*
|
12943
|
+
* @beta
|
12944
|
+
*/
|
12945
|
+
function requestPermission() {
|
12946
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
12947
|
+
if (!barCode_isSupported()) {
|
12948
|
+
throw errorNotSupportedOnPlatform;
|
12720
12949
|
}
|
12721
|
-
|
12722
|
-
|
12950
|
+
const permissions = DevicePermission.Media;
|
12951
|
+
return new Promise((resolve) => {
|
12952
|
+
resolve(sendAndHandleSdkError(getApiVersionTag(barCodeTelemetryVersionNumber, "barCode.requestPermission" /* ApiName.BarCode_RequestPermission */), 'permissions.request', permissions));
|
12953
|
+
});
|
12954
|
+
}
|
12955
|
+
/**
|
12956
|
+
* Checks if barCode capability is supported by the host
|
12957
|
+
* @returns boolean to represent whether the barCode capability is supported
|
12958
|
+
*
|
12959
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
12960
|
+
*
|
12961
|
+
* @beta
|
12962
|
+
*/
|
12963
|
+
function barCode_isSupported() {
|
12964
|
+
return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;
|
12965
|
+
}
|
12723
12966
|
|
12724
12967
|
;// CONCATENATED MODULE: ./src/public/chat.ts
|
12725
12968
|
|
@@ -12852,82 +13095,74 @@ const clipboardTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
|
12852
13095
|
*
|
12853
13096
|
* @beta
|
12854
13097
|
*/
|
12855
|
-
|
12856
|
-
|
12857
|
-
|
12858
|
-
|
12859
|
-
|
12860
|
-
|
12861
|
-
|
12862
|
-
|
12863
|
-
|
12864
|
-
|
12865
|
-
|
12866
|
-
|
12867
|
-
|
12868
|
-
|
12869
|
-
|
12870
|
-
|
12871
|
-
|
12872
|
-
|
12873
|
-
}
|
12874
|
-
|
12875
|
-
|
12876
|
-
|
12877
|
-
|
12878
|
-
|
12879
|
-
|
12880
|
-
|
12881
|
-
|
12882
|
-
|
12883
|
-
|
12884
|
-
|
12885
|
-
|
12886
|
-
|
12887
|
-
|
12888
|
-
|
12889
|
-
|
12890
|
-
|
12891
|
-
|
12892
|
-
|
12893
|
-
|
12894
|
-
|
12895
|
-
|
12896
|
-
|
12897
|
-
|
12898
|
-
|
12899
|
-
|
12900
|
-
|
12901
|
-
if (typeof response === 'string') {
|
12902
|
-
const data = JSON.parse(response);
|
12903
|
-
return base64ToBlob(data.mimeType, data.content);
|
12904
|
-
}
|
12905
|
-
else {
|
12906
|
-
return response;
|
12907
|
-
}
|
12908
|
-
});
|
12909
|
-
}
|
12910
|
-
clipboard.read = read;
|
12911
|
-
/**
|
12912
|
-
* Checks if clipboard capability is supported by the host
|
12913
|
-
* @returns boolean to represent whether the clipboard capability is supported
|
12914
|
-
*
|
12915
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
12916
|
-
*
|
12917
|
-
* @beta
|
12918
|
-
*/
|
12919
|
-
function isSupported() {
|
12920
|
-
if (GlobalVars.isFramelessWindow) {
|
12921
|
-
return ensureInitialized(runtime) && runtime.supports.clipboard ? true : false;
|
13098
|
+
/**
|
13099
|
+
* Function to copy data to clipboard.
|
13100
|
+
* @remarks
|
13101
|
+
* Note: clipboard.write only supports Text, HTML, PNG, and JPEG data format.
|
13102
|
+
* MIME type for Text -> `text/plain`, HTML -> `text/html`, PNG/JPEG -> `image/(png | jpeg)`
|
13103
|
+
* Also, JPEG will be converted to PNG image when copying to clipboard.
|
13104
|
+
*
|
13105
|
+
* @param blob - A Blob object representing the data to be copied to clipboard.
|
13106
|
+
* @returns A string promise which resolves to success message from the clipboard or
|
13107
|
+
* rejects with error stating the reason for failure.
|
13108
|
+
*/
|
13109
|
+
function write(blob) {
|
13110
|
+
return clipboard_awaiter(this, void 0, void 0, function* () {
|
13111
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
|
13112
|
+
if (!clipboard_isSupported()) {
|
13113
|
+
throw errorNotSupportedOnPlatform;
|
13114
|
+
}
|
13115
|
+
if (!(blob.type && Object.values(ClipboardSupportedMimeType).includes(blob.type))) {
|
13116
|
+
throw new Error(`Blob type ${blob.type} is not supported. Supported blob types are ${Object.values(ClipboardSupportedMimeType)}`);
|
13117
|
+
}
|
13118
|
+
const base64StringContent = yield getBase64StringFromBlob(blob);
|
13119
|
+
const writeParams = {
|
13120
|
+
mimeType: blob.type,
|
13121
|
+
content: base64StringContent,
|
13122
|
+
};
|
13123
|
+
return sendAndHandleSdkError(getApiVersionTag(clipboardTelemetryVersionNumber, "clipboard.write" /* ApiName.Clipboard_Write */), 'clipboard.writeToClipboard', writeParams);
|
13124
|
+
});
|
13125
|
+
}
|
13126
|
+
/**
|
13127
|
+
* Function to read data from clipboard.
|
13128
|
+
*
|
13129
|
+
* @returns A promise blob which resolves to the data read from the clipboard or
|
13130
|
+
* rejects stating the reason for failure.
|
13131
|
+
* Note: Returned blob type will contain one of the MIME type `image/png`, `text/plain` or `text/html`.
|
13132
|
+
*/
|
13133
|
+
function read() {
|
13134
|
+
return clipboard_awaiter(this, void 0, void 0, function* () {
|
13135
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
|
13136
|
+
const apiVersionTag = getApiVersionTag(clipboardTelemetryVersionNumber, "clipboard.read" /* ApiName.Clipboard_Read */);
|
13137
|
+
if (!clipboard_isSupported()) {
|
13138
|
+
throw errorNotSupportedOnPlatform;
|
13139
|
+
}
|
13140
|
+
const response = yield sendAndHandleSdkError(apiVersionTag, 'clipboard.readFromClipboard');
|
13141
|
+
if (typeof response === 'string') {
|
13142
|
+
const data = JSON.parse(response);
|
13143
|
+
return base64ToBlob(data.mimeType, data.content);
|
12922
13144
|
}
|
12923
13145
|
else {
|
12924
|
-
return
|
12925
|
-
? true
|
12926
|
-
: false;
|
13146
|
+
return response;
|
12927
13147
|
}
|
13148
|
+
});
|
13149
|
+
}
|
13150
|
+
/**
|
13151
|
+
* Checks if clipboard capability is supported by the host
|
13152
|
+
* @returns boolean to represent whether the clipboard capability is supported
|
13153
|
+
*
|
13154
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
13155
|
+
*
|
13156
|
+
* @beta
|
13157
|
+
*/
|
13158
|
+
function clipboard_isSupported() {
|
13159
|
+
if (GlobalVars.isFramelessWindow) {
|
13160
|
+
return ensureInitialized(runtime) && runtime.supports.clipboard ? true : false;
|
13161
|
+
}
|
13162
|
+
else {
|
13163
|
+
return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard ? true : false;
|
12928
13164
|
}
|
12929
|
-
|
12930
|
-
})(clipboard || (clipboard = {}));
|
13165
|
+
}
|
12931
13166
|
|
12932
13167
|
;// CONCATENATED MODULE: ./src/public/nestedAppAuth.ts
|
12933
13168
|
|
@@ -14155,58 +14390,52 @@ const calendarTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
|
14155
14390
|
/**
|
14156
14391
|
* Interact with the user's calendar, including opening calendar items and composing meetings.
|
14157
14392
|
*/
|
14158
|
-
|
14159
|
-
|
14160
|
-
|
14161
|
-
|
14162
|
-
|
14163
|
-
|
14164
|
-
|
14165
|
-
|
14166
|
-
|
14167
|
-
|
14168
|
-
|
14169
|
-
|
14170
|
-
|
14171
|
-
|
14172
|
-
|
14173
|
-
|
14174
|
-
|
14175
|
-
|
14176
|
-
|
14177
|
-
|
14178
|
-
|
14179
|
-
|
14180
|
-
|
14181
|
-
|
14182
|
-
|
14183
|
-
|
14184
|
-
|
14185
|
-
|
14186
|
-
|
14187
|
-
|
14188
|
-
|
14189
|
-
|
14190
|
-
|
14191
|
-
|
14192
|
-
|
14193
|
-
|
14194
|
-
|
14195
|
-
|
14196
|
-
|
14197
|
-
|
14198
|
-
|
14199
|
-
|
14200
|
-
|
14201
|
-
|
14202
|
-
|
14203
|
-
|
14204
|
-
*/
|
14205
|
-
function isSupported() {
|
14206
|
-
return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
|
14207
|
-
}
|
14208
|
-
calendar.isSupported = isSupported;
|
14209
|
-
})(calendar || (calendar = {}));
|
14393
|
+
/**
|
14394
|
+
* Opens a calendar item.
|
14395
|
+
*
|
14396
|
+
* @param openCalendarItemParams - object containing unique ID of the calendar item to be opened.
|
14397
|
+
*/
|
14398
|
+
function openCalendarItem(openCalendarItemParams) {
|
14399
|
+
return new Promise((resolve) => {
|
14400
|
+
ensureInitialized(runtime, FrameContexts.content);
|
14401
|
+
if (!calendar_isSupported()) {
|
14402
|
+
throw new Error('Not supported');
|
14403
|
+
}
|
14404
|
+
if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {
|
14405
|
+
throw new Error('Must supply an itemId to openCalendarItem');
|
14406
|
+
}
|
14407
|
+
resolve(sendAndHandleStatusAndReason(getApiVersionTag(calendarTelemetryVersionNumber, "calendar.openCalendarItem" /* ApiName.Calendar_OpenCalendarItem */), 'calendar.openCalendarItem', openCalendarItemParams));
|
14408
|
+
});
|
14409
|
+
}
|
14410
|
+
/**
|
14411
|
+
* Compose a new meeting in the user's calendar.
|
14412
|
+
*
|
14413
|
+
* @param composeMeetingParams - object containing various properties to set up the meeting details.
|
14414
|
+
*/
|
14415
|
+
function composeMeeting(composeMeetingParams) {
|
14416
|
+
return new Promise((resolve) => {
|
14417
|
+
ensureInitialized(runtime, FrameContexts.content);
|
14418
|
+
if (!calendar_isSupported()) {
|
14419
|
+
throw new Error('Not supported');
|
14420
|
+
}
|
14421
|
+
const apiVersionTag = getApiVersionTag(calendarTelemetryVersionNumber, "calendar.composeMeeting" /* ApiName.Calendar_ComposeMeeting */);
|
14422
|
+
if (runtime.isLegacyTeams) {
|
14423
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
|
14424
|
+
}
|
14425
|
+
else {
|
14426
|
+
resolve(sendAndHandleStatusAndReason(apiVersionTag, 'calendar.composeMeeting', composeMeetingParams));
|
14427
|
+
}
|
14428
|
+
});
|
14429
|
+
}
|
14430
|
+
/**
|
14431
|
+
* Checks if the calendar capability is supported by the host
|
14432
|
+
* @returns boolean to represent whether the calendar capability is supported
|
14433
|
+
*
|
14434
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
14435
|
+
*/
|
14436
|
+
function calendar_isSupported() {
|
14437
|
+
return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
|
14438
|
+
}
|
14210
14439
|
|
14211
14440
|
;// CONCATENATED MODULE: ./src/public/mail.ts
|
14212
14441
|
|
@@ -15276,7 +15505,7 @@ var webStorage;
|
|
15276
15505
|
function getHostName() {
|
15277
15506
|
return webStorage_awaiter(this, void 0, void 0, function* () {
|
15278
15507
|
if (cachedHostName === null) {
|
15279
|
-
cachedHostName = (yield
|
15508
|
+
cachedHostName = (yield getContext()).app.host.name;
|
15280
15509
|
}
|
15281
15510
|
return cachedHostName;
|
15282
15511
|
});
|
@@ -15316,68 +15545,64 @@ const callTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
|
15316
15545
|
/**
|
15317
15546
|
* Used to interact with call functionality, including starting calls with other users.
|
15318
15547
|
*/
|
15319
|
-
|
15320
|
-
|
15321
|
-
|
15322
|
-
|
15323
|
-
|
15324
|
-
|
15325
|
-
|
15326
|
-
|
15327
|
-
|
15328
|
-
|
15329
|
-
|
15330
|
-
|
15331
|
-
|
15332
|
-
|
15333
|
-
|
15334
|
-
|
15335
|
-
|
15336
|
-
|
15337
|
-
|
15338
|
-
|
15339
|
-
|
15340
|
-
|
15341
|
-
|
15342
|
-
|
15343
|
-
|
15344
|
-
|
15345
|
-
|
15346
|
-
|
15347
|
-
|
15348
|
-
|
15349
|
-
|
15350
|
-
|
15351
|
-
|
15352
|
-
|
15353
|
-
|
15354
|
-
|
15355
|
-
|
15356
|
-
|
15357
|
-
|
15358
|
-
|
15359
|
-
|
15360
|
-
|
15361
|
-
|
15362
|
-
|
15363
|
-
|
15364
|
-
|
15365
|
-
|
15366
|
-
|
15367
|
-
|
15368
|
-
|
15369
|
-
|
15370
|
-
|
15371
|
-
|
15372
|
-
function isSupported() {
|
15373
|
-
return ensureInitialized(runtime) && runtime.supports.call ? true : false;
|
15374
|
-
}
|
15375
|
-
call.isSupported = isSupported;
|
15376
|
-
})(call || (call = {}));
|
15548
|
+
/** Modalities that can be associated with a call. */
|
15549
|
+
var CallModalities;
|
15550
|
+
(function (CallModalities) {
|
15551
|
+
/** Indicates that the modality is unknown or undefined. */
|
15552
|
+
CallModalities["Unknown"] = "unknown";
|
15553
|
+
/** Indicates that the call includes audio. */
|
15554
|
+
CallModalities["Audio"] = "audio";
|
15555
|
+
/** Indicates that the call includes video. */
|
15556
|
+
CallModalities["Video"] = "video";
|
15557
|
+
/** Indicates that the call includes video-based screen sharing. */
|
15558
|
+
CallModalities["VideoBasedScreenSharing"] = "videoBasedScreenSharing";
|
15559
|
+
/** Indicates that the call includes data sharing or messaging. */
|
15560
|
+
CallModalities["Data"] = "data";
|
15561
|
+
})(CallModalities || (CallModalities = {}));
|
15562
|
+
/**
|
15563
|
+
* Starts a call with other users
|
15564
|
+
*
|
15565
|
+
* @param startCallParams - Parameters for the call
|
15566
|
+
*
|
15567
|
+
* @throws Error if call capability is not supported
|
15568
|
+
* @throws Error if host notifies of a failed start call attempt in a legacy Teams environment
|
15569
|
+
* @returns always true if the host notifies of a successful call inititation
|
15570
|
+
*/
|
15571
|
+
function startCall(startCallParams) {
|
15572
|
+
const apiVersionTag = getApiVersionTag(callTelemetryVersionNumber, "call.startCall" /* ApiName.Call_StartCall */);
|
15573
|
+
return new Promise((resolve) => {
|
15574
|
+
var _a;
|
15575
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
15576
|
+
if (!call_isSupported()) {
|
15577
|
+
throw errorNotSupportedOnPlatform;
|
15578
|
+
}
|
15579
|
+
if (runtime.isLegacyTeams) {
|
15580
|
+
resolve(sendAndUnwrap(apiVersionTag, 'executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then((result) => {
|
15581
|
+
if (!result) {
|
15582
|
+
throw new Error(errorCallNotStarted);
|
15583
|
+
}
|
15584
|
+
return result;
|
15585
|
+
}));
|
15586
|
+
}
|
15587
|
+
else {
|
15588
|
+
return sendMessageToParent(apiVersionTag, 'call.startCall', [startCallParams], resolve);
|
15589
|
+
}
|
15590
|
+
});
|
15591
|
+
}
|
15592
|
+
/**
|
15593
|
+
* Checks if the call capability is supported by the host
|
15594
|
+
* @returns boolean to represent whether the call capability is supported
|
15595
|
+
*
|
15596
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
15597
|
+
*/
|
15598
|
+
function call_isSupported() {
|
15599
|
+
return ensureInitialized(runtime) && runtime.supports.call ? true : false;
|
15600
|
+
}
|
15377
15601
|
|
15378
15602
|
;// CONCATENATED MODULE: ./src/public/appInitialization.ts
|
15379
15603
|
|
15380
15604
|
|
15605
|
+
|
15381
15606
|
/**
|
15382
15607
|
* @deprecated
|
15383
15608
|
* As of TeamsJS v2.0.0, please use {@link app} namespace instead.
|
@@ -15385,70 +15610,63 @@ var call;
|
|
15385
15610
|
* v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
|
15386
15611
|
*/
|
15387
15612
|
const appInitializationTelemetryVersionNumber = "v1" /* ApiVersionNumber.V_1 */;
|
15388
|
-
|
15389
|
-
|
15390
|
-
|
15391
|
-
|
15392
|
-
|
15393
|
-
|
15394
|
-
|
15395
|
-
|
15396
|
-
|
15397
|
-
|
15398
|
-
|
15399
|
-
|
15400
|
-
|
15401
|
-
|
15402
|
-
|
15403
|
-
|
15404
|
-
|
15405
|
-
|
15406
|
-
|
15407
|
-
|
15408
|
-
|
15409
|
-
|
15410
|
-
|
15411
|
-
|
15412
|
-
|
15413
|
-
|
15414
|
-
|
15415
|
-
|
15416
|
-
|
15417
|
-
|
15418
|
-
|
15419
|
-
|
15420
|
-
|
15421
|
-
|
15422
|
-
|
15423
|
-
|
15424
|
-
|
15425
|
-
|
15426
|
-
|
15427
|
-
|
15428
|
-
|
15429
|
-
|
15430
|
-
|
15431
|
-
|
15432
|
-
|
15433
|
-
|
15434
|
-
|
15435
|
-
|
15436
|
-
|
15437
|
-
|
15438
|
-
|
15439
|
-
|
15440
|
-
|
15441
|
-
|
15442
|
-
|
15443
|
-
|
15444
|
-
|
15445
|
-
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
15446
|
-
*/
|
15447
|
-
function notifyExpectedFailure(expectedFailureRequest) {
|
15448
|
-
notifyExpectedFailureHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, "appInitialization.notifyExpectedFailure" /* ApiName.AppInitialization_NotifyExpectedFailure */), expectedFailureRequest);
|
15449
|
-
}
|
15450
|
-
appInitialization.notifyExpectedFailure = notifyExpectedFailure;
|
15451
|
-
})(appInitialization || (appInitialization = {}));
|
15613
|
+
/**
|
15614
|
+
* @deprecated
|
15615
|
+
* As of TeamsJS v2.0.0, please use {@link app.Messages} instead.
|
15616
|
+
*/
|
15617
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
15618
|
+
|
15619
|
+
/**
|
15620
|
+
* @deprecated
|
15621
|
+
* As of TeamsJS v2.0.0, please use {@link app.FailedReason} instead.
|
15622
|
+
*/
|
15623
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
15624
|
+
|
15625
|
+
/**
|
15626
|
+
* @deprecated
|
15627
|
+
* As of TeamsJS v2.0.0, please use {@link app.ExpectedFailureReason} instead.
|
15628
|
+
*/
|
15629
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
15630
|
+
|
15631
|
+
/**
|
15632
|
+
* @deprecated
|
15633
|
+
* As of TeamsJS v2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.
|
15634
|
+
*
|
15635
|
+
* Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
|
15636
|
+
*/
|
15637
|
+
function appInitialization_notifyAppLoaded() {
|
15638
|
+
notifyAppLoadedHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, "appInitialization.notifyAppLoaded" /* ApiName.AppInitialization_NotifyAppLoaded */));
|
15639
|
+
}
|
15640
|
+
/**
|
15641
|
+
* @deprecated
|
15642
|
+
* As of TeamsJS v2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead.
|
15643
|
+
*
|
15644
|
+
* Notifies the frame that app initialization is successful and is ready for user interaction.
|
15645
|
+
*/
|
15646
|
+
function appInitialization_notifySuccess() {
|
15647
|
+
notifySuccessHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, "appInitialization.notifySuccess" /* ApiName.AppInitialization_NotifySuccess */));
|
15648
|
+
}
|
15649
|
+
/**
|
15650
|
+
* @deprecated
|
15651
|
+
* As of TeamsJS v2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.
|
15652
|
+
*
|
15653
|
+
* Notifies the frame that app initialization has failed and to show an error page in its place.
|
15654
|
+
* @param appInitializationFailedRequest - The failure request containing the reason for why the app failed
|
15655
|
+
* during initialization as well as an optional message.
|
15656
|
+
*/
|
15657
|
+
function appInitialization_notifyFailure(appInitializationFailedRequest) {
|
15658
|
+
notifyFailureHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, "appInitialization.notifyFailure" /* ApiName.AppInitialization_NotifyFailure */), appInitializationFailedRequest);
|
15659
|
+
}
|
15660
|
+
/**
|
15661
|
+
* @deprecated
|
15662
|
+
* As of TeamsJS v2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.
|
15663
|
+
*
|
15664
|
+
* Notifies the frame that app initialized with some expected errors.
|
15665
|
+
* @param expectedFailureRequest - The expected failure request containing the reason and an optional message
|
15666
|
+
*/
|
15667
|
+
function appInitialization_notifyExpectedFailure(expectedFailureRequest) {
|
15668
|
+
notifyExpectedFailureHelper(getApiVersionTag(appInitializationTelemetryVersionNumber, "appInitialization.notifyExpectedFailure" /* ApiName.AppInitialization_NotifyExpectedFailure */), expectedFailureRequest);
|
15669
|
+
}
|
15452
15670
|
|
15453
15671
|
;// CONCATENATED MODULE: ./src/public/thirdPartyCloudStorage.ts
|
15454
15672
|
|
@@ -15634,7 +15852,7 @@ const publicAPIsTelemetryVersionNumber = "v1" /* ApiVersionNumber.V_1 */;
|
|
15634
15852
|
* to pass a value for this parameter.
|
15635
15853
|
* Any domains passed in the array must have the https: protocol on the string otherwise they will be ignored. Example: https://www.example.com
|
15636
15854
|
*/
|
15637
|
-
function
|
15855
|
+
function publicAPIs_initialize(callback, validMessageOrigins) {
|
15638
15856
|
appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, "initialize" /* ApiName.PublicAPIs_Initialize */), validMessageOrigins).then(() => {
|
15639
15857
|
if (callback) {
|
15640
15858
|
callback();
|
@@ -15667,7 +15885,7 @@ function print() {
|
|
15667
15885
|
*
|
15668
15886
|
* @param callback - The callback to invoke when the {@link Context} object is retrieved.
|
15669
15887
|
*/
|
15670
|
-
function
|
15888
|
+
function publicAPIs_getContext(callback) {
|
15671
15889
|
ensureInitializeCalled();
|
15672
15890
|
sendMessageToParent(getApiVersionTag(publicAPIsTelemetryVersionNumber, "getContext" /* ApiName.PublicAPIs_GetContext */), 'getContext', (context) => {
|
15673
15891
|
if (!context.frameContext) {
|
@@ -15992,93 +16210,78 @@ function navigateBack(onComplete) {
|
|
15992
16210
|
const settingsTelemetryVersionNumber = "v1" /* ApiVersionNumber.V_1 */;
|
15993
16211
|
/**
|
15994
16212
|
* @deprecated
|
15995
|
-
* As of TeamsJS v2.0.0, please use {@link pages.config}
|
16213
|
+
* As of TeamsJS v2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead.
|
15996
16214
|
*
|
15997
|
-
*
|
15998
|
-
*
|
16215
|
+
* Sets the validity state for the settings.
|
16216
|
+
* The initial value is false, so the user cannot save the settings until this is called with true.
|
16217
|
+
*
|
16218
|
+
* @param validityState - Indicates whether the save or remove button is enabled for the user.
|
15999
16219
|
*/
|
16000
|
-
|
16001
|
-
(
|
16002
|
-
|
16003
|
-
|
16004
|
-
|
16005
|
-
|
16006
|
-
|
16007
|
-
|
16008
|
-
|
16009
|
-
|
16010
|
-
|
16011
|
-
|
16012
|
-
|
16013
|
-
|
16014
|
-
|
16015
|
-
|
16016
|
-
|
16017
|
-
|
16018
|
-
|
16019
|
-
|
16020
|
-
|
16021
|
-
|
16022
|
-
|
16023
|
-
|
16024
|
-
|
16025
|
-
|
16026
|
-
|
16027
|
-
|
16028
|
-
|
16029
|
-
settings.
|
16030
|
-
|
16031
|
-
|
16032
|
-
|
16033
|
-
|
16034
|
-
|
16035
|
-
|
16036
|
-
|
16037
|
-
|
16038
|
-
|
16039
|
-
|
16040
|
-
|
16041
|
-
|
16042
|
-
|
16043
|
-
|
16044
|
-
|
16045
|
-
|
16046
|
-
|
16047
|
-
|
16048
|
-
|
16049
|
-
|
16050
|
-
|
16051
|
-
|
16052
|
-
|
16053
|
-
|
16054
|
-
|
16055
|
-
|
16056
|
-
|
16057
|
-
|
16058
|
-
|
16059
|
-
|
16060
|
-
|
16061
|
-
|
16062
|
-
|
16063
|
-
|
16064
|
-
|
16065
|
-
settings.registerOnSaveHandler = registerOnSaveHandler;
|
16066
|
-
/**
|
16067
|
-
* @deprecated
|
16068
|
-
* As of TeamsJS v2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void} instead.
|
16069
|
-
*
|
16070
|
-
* Registers a handler for user attempts to remove content. This handler should be used
|
16071
|
-
* to remove the underlying resource powering the content.
|
16072
|
-
* The object passed to the handler must be used to indicate whether to proceed with the removal.
|
16073
|
-
* Only one handler may be registered at a time. Subsequent registrations will override the first.
|
16074
|
-
*
|
16075
|
-
* @param handler - The handler to invoke when the user selects the remove button.
|
16076
|
-
*/
|
16077
|
-
function registerOnRemoveHandler(handler) {
|
16078
|
-
pages.config.registerOnRemoveHandlerHelper(getApiVersionTag(settingsTelemetryVersionNumber, "settings.registerOnRemoveHandler" /* ApiName.Settings_RegisterOnRemoveHandler */), handler);
|
16079
|
-
}
|
16080
|
-
settings.registerOnRemoveHandler = registerOnRemoveHandler;
|
16081
|
-
})(settings || (settings = {}));
|
16220
|
+
function setValidityState(validityState) {
|
16221
|
+
configSetValidityStateHelper(getApiVersionTag(settingsTelemetryVersionNumber, "settings.setValidityState" /* ApiName.Settings_SetValidityState */), validityState);
|
16222
|
+
}
|
16223
|
+
/**
|
16224
|
+
* @deprecated
|
16225
|
+
* As of TeamsJS v2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\<InstanceConfig\>} instead.
|
16226
|
+
*
|
16227
|
+
* Gets the settings for the current instance.
|
16228
|
+
*
|
16229
|
+
* @param callback - The callback to invoke when the {@link Settings} object is retrieved.
|
16230
|
+
*/
|
16231
|
+
function getSettings(callback) {
|
16232
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
|
16233
|
+
getConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, "settings.getSettings" /* ApiName.Settings_GetSettings */)).then((config) => {
|
16234
|
+
callback(config);
|
16235
|
+
});
|
16236
|
+
}
|
16237
|
+
/**
|
16238
|
+
* @deprecated
|
16239
|
+
* As of TeamsJS v2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\<void\>} instead.
|
16240
|
+
*
|
16241
|
+
* Sets the settings for the current instance.
|
16242
|
+
* This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.
|
16243
|
+
*
|
16244
|
+
* @param - Set the desired settings for this instance.
|
16245
|
+
*/
|
16246
|
+
function setSettings(instanceSettings, onComplete) {
|
16247
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
|
16248
|
+
const completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
|
16249
|
+
configSetConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, "settings.setSettings" /* ApiName.Settings_SetSettings */), instanceSettings)
|
16250
|
+
.then(() => {
|
16251
|
+
completionHandler(true);
|
16252
|
+
})
|
16253
|
+
.catch((error) => {
|
16254
|
+
completionHandler(false, error.message);
|
16255
|
+
});
|
16256
|
+
}
|
16257
|
+
/**
|
16258
|
+
* @deprecated
|
16259
|
+
* As of TeamsJS v2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void} instead.
|
16260
|
+
*
|
16261
|
+
* Registers a handler for when the user attempts to save the settings. This handler should be used
|
16262
|
+
* to create or update the underlying resource powering the content.
|
16263
|
+
* The object passed to the handler must be used to notify whether to proceed with the save.
|
16264
|
+
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
|
16265
|
+
*
|
16266
|
+
* @param handler - The handler to invoke when the user selects the save button.
|
16267
|
+
*/
|
16268
|
+
function registerOnSaveHandler(handler) {
|
16269
|
+
pages.config.registerOnSaveHandlerHelper(getApiVersionTag(settingsTelemetryVersionNumber, "settings.registerOnSaveHandler" /* ApiName.Settings_RegisterOnSaveHandler */), handler);
|
16270
|
+
}
|
16271
|
+
/**
|
16272
|
+
* @deprecated
|
16273
|
+
* As of TeamsJS v2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void} instead.
|
16274
|
+
*
|
16275
|
+
* Registers a handler for user attempts to remove content. This handler should be used
|
16276
|
+
* to remove the underlying resource powering the content.
|
16277
|
+
* The object passed to the handler must be used to indicate whether to proceed with the removal.
|
16278
|
+
* Only one handler may be registered at a time. Subsequent registrations will override the first.
|
16279
|
+
*
|
16280
|
+
* @param handler - The handler to invoke when the user selects the remove button.
|
16281
|
+
*/
|
16282
|
+
function registerOnRemoveHandler(handler) {
|
16283
|
+
pages.config.registerOnRemoveHandlerHelper(getApiVersionTag(settingsTelemetryVersionNumber, "settings.registerOnRemoveHandler" /* ApiName.Settings_RegisterOnRemoveHandler */), handler);
|
16284
|
+
}
|
16082
16285
|
|
16083
16286
|
;// CONCATENATED MODULE: ./src/public/tasks.ts
|
16084
16287
|
/* eslint-disable @typescript-eslint/ban-types */
|
@@ -16194,8 +16397,8 @@ var tasks;
|
|
16194
16397
|
const urldialogInfo = {
|
16195
16398
|
url: taskInfo.url,
|
16196
16399
|
size: {
|
16197
|
-
height: taskInfo.height ? taskInfo.height :
|
16198
|
-
width: taskInfo.width ? taskInfo.width :
|
16400
|
+
height: taskInfo.height ? taskInfo.height : DialogDimension.Small,
|
16401
|
+
width: taskInfo.width ? taskInfo.width : DialogDimension.Small,
|
16199
16402
|
},
|
16200
16403
|
title: taskInfo.title,
|
16201
16404
|
fallbackUrl: taskInfo.fallbackUrl,
|
@@ -16214,8 +16417,8 @@ var tasks;
|
|
16214
16417
|
const botUrldialogInfo = {
|
16215
16418
|
url: taskInfo.url,
|
16216
16419
|
size: {
|
16217
|
-
height: taskInfo.height ? taskInfo.height :
|
16218
|
-
width: taskInfo.width ? taskInfo.width :
|
16420
|
+
height: taskInfo.height ? taskInfo.height : DialogDimension.Small,
|
16421
|
+
width: taskInfo.width ? taskInfo.width : DialogDimension.Small,
|
16219
16422
|
},
|
16220
16423
|
title: taskInfo.title,
|
16221
16424
|
fallbackUrl: taskInfo.fallbackUrl,
|
@@ -16230,8 +16433,8 @@ var tasks;
|
|
16230
16433
|
* @returns TaskInfo with height and width specified
|
16231
16434
|
*/
|
16232
16435
|
function getDefaultSizeIfNotProvided(taskInfo) {
|
16233
|
-
taskInfo.height = taskInfo.height ? taskInfo.height :
|
16234
|
-
taskInfo.width = taskInfo.width ? taskInfo.width :
|
16436
|
+
taskInfo.height = taskInfo.height ? taskInfo.height : DialogDimension.Small;
|
16437
|
+
taskInfo.width = taskInfo.width ? taskInfo.width : DialogDimension.Small;
|
16235
16438
|
return taskInfo;
|
16236
16439
|
}
|
16237
16440
|
tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
|
@@ -16873,6 +17076,15 @@ var marketplace;
|
|
16873
17076
|
|
16874
17077
|
|
16875
17078
|
|
17079
|
+
|
17080
|
+
|
17081
|
+
|
17082
|
+
|
17083
|
+
|
17084
|
+
|
17085
|
+
|
17086
|
+
|
17087
|
+
|
16876
17088
|
|
16877
17089
|
|
16878
17090
|
|