@microsoft/teams-js 2.34.1-beta.1 → 2.35.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/packages/teams-js/dts/internal/childCommunication.d.ts +38 -0
- package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +0 -11
- package/dist/esm/packages/teams-js/dts/internal/communicationUtils.d.ts +20 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +18 -2
- package/dist/esm/packages/teams-js/dts/private/hostEntity/hostEntity.d.ts +9 -1
- package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +1 -2
- package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communicationUtils.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity/hostEntity.js +1 -1
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +887 -803
- 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 -1
@@ -1968,6 +1968,393 @@ __webpack_require__.d(marketplace_namespaceObject, {
|
|
1968
1968
|
updateCartStatus: () => (updateCartStatus)
|
1969
1969
|
});
|
1970
1970
|
|
1971
|
+
;// ./src/public/interfaces.ts
|
1972
|
+
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
1973
|
+
/**
|
1974
|
+
* Allowed user file open preferences
|
1975
|
+
*/
|
1976
|
+
var FileOpenPreference;
|
1977
|
+
(function (FileOpenPreference) {
|
1978
|
+
/** Indicates that the user should be prompted to open the file in inline. */
|
1979
|
+
FileOpenPreference["Inline"] = "inline";
|
1980
|
+
/** Indicates that the user should be prompted to open the file in the native desktop application associated with the file type. */
|
1981
|
+
FileOpenPreference["Desktop"] = "desktop";
|
1982
|
+
/** Indicates that the user should be prompted to open the file in a web browser. */
|
1983
|
+
FileOpenPreference["Web"] = "web";
|
1984
|
+
})(FileOpenPreference || (FileOpenPreference = {}));
|
1985
|
+
/**
|
1986
|
+
* Types of Action Objects
|
1987
|
+
*
|
1988
|
+
* @beta
|
1989
|
+
*/
|
1990
|
+
var ActionObjectType;
|
1991
|
+
(function (ActionObjectType) {
|
1992
|
+
/** Represents content within a Microsoft 365 application. */
|
1993
|
+
ActionObjectType["M365Content"] = "m365content";
|
1994
|
+
})(ActionObjectType || (ActionObjectType = {}));
|
1995
|
+
/**
|
1996
|
+
* These correspond with field names in the MSGraph.
|
1997
|
+
* See [commonly accessed resources](https://learn.microsoft.com/graph/api/resources/onedrive?view=graph-rest-1.0#commonly-accessed-resources).
|
1998
|
+
* @beta
|
1999
|
+
*/
|
2000
|
+
var SecondaryM365ContentIdName;
|
2001
|
+
(function (SecondaryM365ContentIdName) {
|
2002
|
+
/** OneDrive ID */
|
2003
|
+
SecondaryM365ContentIdName["DriveId"] = "driveId";
|
2004
|
+
/** Teams Group ID */
|
2005
|
+
SecondaryM365ContentIdName["GroupId"] = "groupId";
|
2006
|
+
/** SharePoint ID */
|
2007
|
+
SecondaryM365ContentIdName["SiteId"] = "siteId";
|
2008
|
+
/** User ID */
|
2009
|
+
SecondaryM365ContentIdName["UserId"] = "userId";
|
2010
|
+
})(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
|
2011
|
+
function isSdkError(err) {
|
2012
|
+
return (err === null || err === void 0 ? void 0 : err.errorCode) !== undefined;
|
2013
|
+
}
|
2014
|
+
/** Error codes used to identify different types of errors that can occur while developing apps. */
|
2015
|
+
var ErrorCode;
|
2016
|
+
(function (ErrorCode) {
|
2017
|
+
/**
|
2018
|
+
* API not supported in the current platform.
|
2019
|
+
*/
|
2020
|
+
ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
|
2021
|
+
/**
|
2022
|
+
* Internal error encountered while performing the required operation.
|
2023
|
+
*/
|
2024
|
+
ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
|
2025
|
+
/**
|
2026
|
+
* API is not supported in the current context
|
2027
|
+
*/
|
2028
|
+
ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
|
2029
|
+
/**
|
2030
|
+
Permissions denied by user
|
2031
|
+
*/
|
2032
|
+
ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
|
2033
|
+
/**
|
2034
|
+
* Network issue
|
2035
|
+
*/
|
2036
|
+
ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
|
2037
|
+
/**
|
2038
|
+
* Underlying hardware doesn't support the capability
|
2039
|
+
*/
|
2040
|
+
ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
|
2041
|
+
/**
|
2042
|
+
* One or more arguments are invalid
|
2043
|
+
*/
|
2044
|
+
ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
|
2045
|
+
/**
|
2046
|
+
* User is not authorized for this operation
|
2047
|
+
*/
|
2048
|
+
ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
|
2049
|
+
/**
|
2050
|
+
* Could not complete the operation due to insufficient resources
|
2051
|
+
*/
|
2052
|
+
ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
|
2053
|
+
/**
|
2054
|
+
* Platform throttled the request because of API was invoked too frequently
|
2055
|
+
*/
|
2056
|
+
ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
|
2057
|
+
/**
|
2058
|
+
* User aborted the operation
|
2059
|
+
*/
|
2060
|
+
ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
|
2061
|
+
/**
|
2062
|
+
* Could not complete the operation in the given time interval
|
2063
|
+
*/
|
2064
|
+
ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
|
2065
|
+
/**
|
2066
|
+
* Platform code is old and doesn't implement this API
|
2067
|
+
*/
|
2068
|
+
ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
|
2069
|
+
/**
|
2070
|
+
* The file specified was not found on the given location
|
2071
|
+
*/
|
2072
|
+
ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
|
2073
|
+
/**
|
2074
|
+
* The return value is too big and has exceeded our size boundries
|
2075
|
+
*/
|
2076
|
+
ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
|
2077
|
+
})(ErrorCode || (ErrorCode = {}));
|
2078
|
+
/** @hidden */
|
2079
|
+
var DevicePermission;
|
2080
|
+
(function (DevicePermission) {
|
2081
|
+
DevicePermission["GeoLocation"] = "geolocation";
|
2082
|
+
DevicePermission["Media"] = "media";
|
2083
|
+
})(DevicePermission || (DevicePermission = {}));
|
2084
|
+
/**
|
2085
|
+
* @hidden
|
2086
|
+
*
|
2087
|
+
* @beta
|
2088
|
+
*/
|
2089
|
+
var Cohort;
|
2090
|
+
(function (Cohort) {
|
2091
|
+
Cohort["BCAIS"] = "bcais";
|
2092
|
+
Cohort["BCWAF"] = "bcwaf";
|
2093
|
+
Cohort["BCWBF"] = "bcwbf";
|
2094
|
+
})(Cohort || (Cohort = {}));
|
2095
|
+
/**
|
2096
|
+
* @hidden
|
2097
|
+
*
|
2098
|
+
* @beta
|
2099
|
+
*/
|
2100
|
+
var Persona;
|
2101
|
+
(function (Persona) {
|
2102
|
+
/**
|
2103
|
+
* User has a faculty license
|
2104
|
+
*/
|
2105
|
+
Persona["Faculty"] = "faculty";
|
2106
|
+
/**
|
2107
|
+
* User has a student license
|
2108
|
+
*/
|
2109
|
+
Persona["Student"] = "student";
|
2110
|
+
/**
|
2111
|
+
* When user is not a faculty or student
|
2112
|
+
*/
|
2113
|
+
Persona["Other"] = "other";
|
2114
|
+
})(Persona || (Persona = {}));
|
2115
|
+
/**
|
2116
|
+
* @hidden
|
2117
|
+
*
|
2118
|
+
* @beta
|
2119
|
+
*/
|
2120
|
+
// https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#legalagegroupclassification-values
|
2121
|
+
var LegalAgeGroupClassification;
|
2122
|
+
(function (LegalAgeGroupClassification) {
|
2123
|
+
/**
|
2124
|
+
* The user is considered an adult based on the age-related regulations of their country or region.
|
2125
|
+
*/
|
2126
|
+
LegalAgeGroupClassification["Adult"] = "adult";
|
2127
|
+
/**
|
2128
|
+
* The user is a minor but is from a country or region that has no age-related regulations.
|
2129
|
+
*/
|
2130
|
+
LegalAgeGroupClassification["MinorNoParentalConsentRequired"] = "minorNoParentalConsentRequired";
|
2131
|
+
/**
|
2132
|
+
* Reserved for future use
|
2133
|
+
*/
|
2134
|
+
LegalAgeGroupClassification["MinorWithoutParentalConsent"] = "minorWithoutParentalConsent";
|
2135
|
+
/**
|
2136
|
+
* The user is considered a minor based on the age-related regulations of their country or region, and the administrator
|
2137
|
+
* of the account obtained appropriate consent from a parent or guardian.
|
2138
|
+
*/
|
2139
|
+
LegalAgeGroupClassification["MinorWithParentalConsent"] = "minorWithParentalConsent";
|
2140
|
+
/**
|
2141
|
+
* The user is from a country or region that has additional age-related regulations, such as the United States,
|
2142
|
+
* United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
|
2143
|
+
* (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
|
2144
|
+
*/
|
2145
|
+
LegalAgeGroupClassification["NonAdult"] = "nonAdult";
|
2146
|
+
})(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
|
2147
|
+
/**
|
2148
|
+
* @hidden
|
2149
|
+
*
|
2150
|
+
* @beta
|
2151
|
+
*/
|
2152
|
+
var EduType;
|
2153
|
+
(function (EduType) {
|
2154
|
+
/**
|
2155
|
+
* User is from a tenant labeled as “HigherEd”
|
2156
|
+
*/
|
2157
|
+
EduType["HigherEducation"] = "higherEducation";
|
2158
|
+
/**
|
2159
|
+
* User is from a tenant labeled as “K12”
|
2160
|
+
*/
|
2161
|
+
EduType["K12"] = "k12";
|
2162
|
+
/**
|
2163
|
+
* User is from a tenant labeled as “Others” (e.g. research institutions)
|
2164
|
+
*/
|
2165
|
+
EduType["Other"] = "other";
|
2166
|
+
})(EduType || (EduType = {}));
|
2167
|
+
/**
|
2168
|
+
* Currently supported Mime type
|
2169
|
+
*/
|
2170
|
+
var ClipboardSupportedMimeType;
|
2171
|
+
(function (ClipboardSupportedMimeType) {
|
2172
|
+
ClipboardSupportedMimeType["TextPlain"] = "text/plain";
|
2173
|
+
ClipboardSupportedMimeType["TextHtml"] = "text/html";
|
2174
|
+
ClipboardSupportedMimeType["ImagePNG"] = "image/png";
|
2175
|
+
ClipboardSupportedMimeType["ImageJPEG"] = "image/jpeg";
|
2176
|
+
})(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
|
2177
|
+
|
2178
|
+
;// ./src/artifactsForCDN/validDomains.json
|
2179
|
+
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
|
2180
|
+
var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
|
2181
|
+
;// ./src/internal/constants.ts
|
2182
|
+
|
2183
|
+
/**
|
2184
|
+
* @hidden
|
2185
|
+
* The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
|
2186
|
+
* Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.
|
2187
|
+
* Mobile clients are passing versions, hence will be applicable to web and desktop clients only.
|
2188
|
+
*
|
2189
|
+
* @internal
|
2190
|
+
* Limited to Microsoft-internal use
|
2191
|
+
*/
|
2192
|
+
const defaultSDKVersionForCompatCheck = '2.0.1';
|
2193
|
+
/**
|
2194
|
+
* @hidden
|
2195
|
+
* This is the client version when selectMedia API - VideoAndImage is supported on mobile.
|
2196
|
+
*
|
2197
|
+
* @internal
|
2198
|
+
* Limited to Microsoft-internal use
|
2199
|
+
*/
|
2200
|
+
const videoAndImageMediaAPISupportVersion = '2.0.2';
|
2201
|
+
/**
|
2202
|
+
* @hidden
|
2203
|
+
* This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.
|
2204
|
+
*
|
2205
|
+
* @internal
|
2206
|
+
* Limited to Microsoft-internal use
|
2207
|
+
*/
|
2208
|
+
const nonFullScreenVideoModeAPISupportVersion = '2.0.3';
|
2209
|
+
/**
|
2210
|
+
* @hidden
|
2211
|
+
* This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.
|
2212
|
+
*
|
2213
|
+
* @internal
|
2214
|
+
* Limited to Microsoft-internal use
|
2215
|
+
*/
|
2216
|
+
const imageOutputFormatsAPISupportVersion = '2.0.4';
|
2217
|
+
/**
|
2218
|
+
* @hidden
|
2219
|
+
* Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
|
2220
|
+
*
|
2221
|
+
* @internal
|
2222
|
+
* Limited to Microsoft-internal use
|
2223
|
+
*/
|
2224
|
+
const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';
|
2225
|
+
/**
|
2226
|
+
* @hidden
|
2227
|
+
* This is the client version when location APIs (getLocation and showLocation) are supported.
|
2228
|
+
*
|
2229
|
+
* @internal
|
2230
|
+
* Limited to Microsoft-internal use
|
2231
|
+
*/
|
2232
|
+
const locationAPIsRequiredVersion = '1.9.0';
|
2233
|
+
/**
|
2234
|
+
* @hidden
|
2235
|
+
* This is the client version when permisisons are supported
|
2236
|
+
*
|
2237
|
+
* @internal
|
2238
|
+
* Limited to Microsoft-internal use
|
2239
|
+
*/
|
2240
|
+
const permissionsAPIsRequiredVersion = '2.0.1';
|
2241
|
+
/**
|
2242
|
+
* @hidden
|
2243
|
+
* This is the client version when people picker API is supported on mobile.
|
2244
|
+
*
|
2245
|
+
* @internal
|
2246
|
+
* Limited to Microsoft-internal use
|
2247
|
+
*/
|
2248
|
+
const peoplePickerRequiredVersion = '2.0.0';
|
2249
|
+
/**
|
2250
|
+
* @hidden
|
2251
|
+
* This is the client version when captureImage API is supported on mobile.
|
2252
|
+
*
|
2253
|
+
* @internal
|
2254
|
+
* Limited to Microsoft-internal use
|
2255
|
+
*/
|
2256
|
+
const captureImageMobileSupportVersion = '1.7.0';
|
2257
|
+
/**
|
2258
|
+
* @hidden
|
2259
|
+
* This is the client version when media APIs are supported on all three platforms ios, android and web.
|
2260
|
+
*
|
2261
|
+
* @internal
|
2262
|
+
* Limited to Microsoft-internal use
|
2263
|
+
*/
|
2264
|
+
const mediaAPISupportVersion = '1.8.0';
|
2265
|
+
/**
|
2266
|
+
* @hidden
|
2267
|
+
* This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
|
2268
|
+
*
|
2269
|
+
* @internal
|
2270
|
+
* Limited to Microsoft-internal use
|
2271
|
+
*/
|
2272
|
+
const getMediaCallbackSupportVersion = '2.0.0';
|
2273
|
+
/**
|
2274
|
+
* @hidden
|
2275
|
+
* This is the client version when scanBarCode API is supported on mobile.
|
2276
|
+
*
|
2277
|
+
* @internal
|
2278
|
+
* Limited to Microsoft-internal use
|
2279
|
+
*/
|
2280
|
+
const scanBarCodeAPIMobileSupportVersion = '1.9.0';
|
2281
|
+
/**
|
2282
|
+
* @hidden
|
2283
|
+
* Fallback list of valid origins in JSON format
|
2284
|
+
*
|
2285
|
+
* @internal
|
2286
|
+
* Limited to Microsoft-internal use
|
2287
|
+
*/
|
2288
|
+
const validOriginsLocal = artifactsForCDN_validDomains_namespaceObject;
|
2289
|
+
/**
|
2290
|
+
* @hidden
|
2291
|
+
* Fallback list of valid origins
|
2292
|
+
*
|
2293
|
+
* @internal
|
2294
|
+
* Limited to Microsoft-internal use
|
2295
|
+
*/
|
2296
|
+
const validOriginsFallback = validOriginsLocal.validOrigins;
|
2297
|
+
/**
|
2298
|
+
* @hidden
|
2299
|
+
* Timeout length for Fetch Call for Valid Origins
|
2300
|
+
*
|
2301
|
+
* @internal
|
2302
|
+
* Limited to Microsoft-internal use
|
2303
|
+
*/
|
2304
|
+
const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS = 1500;
|
2305
|
+
/**
|
2306
|
+
* @hidden
|
2307
|
+
* CDN endpoint of the list of valid origins
|
2308
|
+
*
|
2309
|
+
* @internal
|
2310
|
+
* Limited to Microsoft-internal use
|
2311
|
+
*/
|
2312
|
+
const validOriginsCdnEndpoint = new URL('https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json');
|
2313
|
+
/**
|
2314
|
+
* @hidden
|
2315
|
+
* USer specified message origins should satisfy this test
|
2316
|
+
*
|
2317
|
+
* @internal
|
2318
|
+
* Limited to Microsoft-internal use
|
2319
|
+
*/
|
2320
|
+
const userOriginUrlValidationRegExp = /^https:\/\//;
|
2321
|
+
/**
|
2322
|
+
* @hidden
|
2323
|
+
* The protocol used for deep links into Teams
|
2324
|
+
*
|
2325
|
+
* @internal
|
2326
|
+
* Limited to Microsoft-internal use
|
2327
|
+
*/
|
2328
|
+
const teamsDeepLinkProtocol = 'https';
|
2329
|
+
/**
|
2330
|
+
* @hidden
|
2331
|
+
* The host used for deep links into Teams
|
2332
|
+
*
|
2333
|
+
* @internal
|
2334
|
+
* Limited to Microsoft-internal use
|
2335
|
+
*/
|
2336
|
+
const teamsDeepLinkHost = 'teams.microsoft.com';
|
2337
|
+
/** @hidden */
|
2338
|
+
const errorLibraryNotInitialized = 'The library has not yet been initialized';
|
2339
|
+
/** @hidden */
|
2340
|
+
const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';
|
2341
|
+
/** @hidden */
|
2342
|
+
const errorRuntimeNotSupported = 'The runtime version is not supported';
|
2343
|
+
/** @hidden */
|
2344
|
+
const errorCallNotStarted = 'The call was not properly started';
|
2345
|
+
|
2346
|
+
;// ./src/internal/globalVars.ts
|
2347
|
+
class GlobalVars {
|
2348
|
+
}
|
2349
|
+
GlobalVars.initializeCalled = false;
|
2350
|
+
GlobalVars.initializeCompleted = false;
|
2351
|
+
GlobalVars.additionalValidOrigins = [];
|
2352
|
+
GlobalVars.initializePromise = undefined;
|
2353
|
+
GlobalVars.isFramelessWindow = false;
|
2354
|
+
GlobalVars.frameContext = undefined;
|
2355
|
+
GlobalVars.hostClientType = undefined;
|
2356
|
+
GlobalVars.printCapabilityEnabled = false;
|
2357
|
+
|
1971
2358
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js
|
1972
2359
|
var browser = __webpack_require__(815);
|
1973
2360
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
|
@@ -2802,343 +3189,136 @@ const hexSliceLookupTable = (function () {
|
|
2802
3189
|
const table = new Array(256);
|
2803
3190
|
for (let i = 0; i < 16; ++i) {
|
2804
3191
|
const i16 = i * 16;
|
2805
|
-
for (let j = 0; j < 16; ++j) {
|
2806
|
-
table[i16 + j] = alphabet[i] + alphabet[j];
|
2807
|
-
}
|
2808
|
-
}
|
2809
|
-
return table;
|
2810
|
-
})();
|
2811
|
-
|
2812
|
-
function fromObject(obj) {
|
2813
|
-
if (Buffer.isBuffer(obj)) {
|
2814
|
-
const len = checked(obj.length) | 0;
|
2815
|
-
const buf = createBuffer(len);
|
2816
|
-
|
2817
|
-
if (buf.length === 0) {
|
2818
|
-
return buf;
|
2819
|
-
}
|
2820
|
-
|
2821
|
-
obj.copy(buf, 0, 0, len);
|
2822
|
-
return buf;
|
2823
|
-
}
|
2824
|
-
|
2825
|
-
if (obj.length !== undefined) {
|
2826
|
-
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
|
2827
|
-
return createBuffer(0);
|
2828
|
-
}
|
2829
|
-
return fromArrayLike(obj);
|
2830
|
-
}
|
2831
|
-
|
2832
|
-
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
|
2833
|
-
return fromArrayLike(obj.data);
|
2834
|
-
}
|
2835
|
-
}
|
2836
|
-
|
2837
|
-
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/native.js
|
2838
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
2839
|
-
/* harmony default export */ const esm_browser_native = ({
|
2840
|
-
randomUUID
|
2841
|
-
});
|
2842
|
-
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/rng.js
|
2843
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
2844
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
2845
|
-
// generators (like Math.random()).
|
2846
|
-
let getRandomValues;
|
2847
|
-
const rnds8 = new Uint8Array(16);
|
2848
|
-
function rng() {
|
2849
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
2850
|
-
if (!getRandomValues) {
|
2851
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
2852
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
2853
|
-
|
2854
|
-
if (!getRandomValues) {
|
2855
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
2856
|
-
}
|
2857
|
-
}
|
2858
|
-
|
2859
|
-
return getRandomValues(rnds8);
|
2860
|
-
}
|
2861
|
-
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js
|
2862
|
-
|
2863
|
-
/**
|
2864
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
2865
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
2866
|
-
*/
|
2867
|
-
|
2868
|
-
const byteToHex = [];
|
2869
|
-
|
2870
|
-
for (let i = 0; i < 256; ++i) {
|
2871
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
2872
|
-
}
|
2873
|
-
|
2874
|
-
function unsafeStringify(arr, offset = 0) {
|
2875
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
2876
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
2877
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
2878
|
-
}
|
2879
|
-
|
2880
|
-
function stringify(arr, offset = 0) {
|
2881
|
-
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
2882
|
-
// of the following:
|
2883
|
-
// - One or more input array values don't map to a hex octet (leading to
|
2884
|
-
// "undefined" in the uuid)
|
2885
|
-
// - Invalid input values for the RFC `version` or `variant` fields
|
2886
|
-
|
2887
|
-
if (!validate(uuid)) {
|
2888
|
-
throw TypeError('Stringified UUID is invalid');
|
2889
|
-
}
|
2890
|
-
|
2891
|
-
return uuid;
|
2892
|
-
}
|
2893
|
-
|
2894
|
-
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
|
2895
|
-
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js
|
2896
|
-
|
2897
|
-
|
2898
|
-
|
2899
|
-
|
2900
|
-
function v4(options, buf, offset) {
|
2901
|
-
if (esm_browser_native.randomUUID && !buf && !options) {
|
2902
|
-
return esm_browser_native.randomUUID();
|
3192
|
+
for (let j = 0; j < 16; ++j) {
|
3193
|
+
table[i16 + j] = alphabet[i] + alphabet[j];
|
3194
|
+
}
|
2903
3195
|
}
|
3196
|
+
return table;
|
3197
|
+
})();
|
2904
3198
|
|
2905
|
-
|
2906
|
-
|
2907
|
-
|
2908
|
-
|
2909
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
2910
|
-
|
2911
|
-
if (buf) {
|
2912
|
-
offset = offset || 0;
|
3199
|
+
function fromObject(obj) {
|
3200
|
+
if (Buffer.isBuffer(obj)) {
|
3201
|
+
const len = checked(obj.length) | 0;
|
3202
|
+
const buf = createBuffer(len);
|
2913
3203
|
|
2914
|
-
|
2915
|
-
buf
|
3204
|
+
if (buf.length === 0) {
|
3205
|
+
return buf;
|
2916
3206
|
}
|
2917
3207
|
|
3208
|
+
obj.copy(buf, 0, 0, len);
|
2918
3209
|
return buf;
|
2919
3210
|
}
|
2920
3211
|
|
2921
|
-
|
2922
|
-
|
2923
|
-
|
2924
|
-
|
2925
|
-
|
2926
|
-
|
2927
|
-
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js
|
2928
|
-
|
3212
|
+
if (obj.length !== undefined) {
|
3213
|
+
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
|
3214
|
+
return createBuffer(0);
|
3215
|
+
}
|
3216
|
+
return fromArrayLike(obj);
|
3217
|
+
}
|
2929
3218
|
|
2930
|
-
|
2931
|
-
|
3219
|
+
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
|
3220
|
+
return fromArrayLike(obj.data);
|
3221
|
+
}
|
2932
3222
|
}
|
2933
3223
|
|
2934
|
-
|
2935
|
-
|
2936
|
-
/*
|
2937
|
-
|
2938
|
-
|
2939
|
-
|
2940
|
-
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
2945
|
-
|
2946
|
-
|
2947
|
-
|
2948
|
-
|
2949
|
-
|
2950
|
-
|
2951
|
-
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2957
|
-
|
2958
|
-
|
2959
|
-
|
2960
|
-
|
2961
|
-
*
|
2962
|
-
*
|
2963
|
-
*/
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2967
|
-
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
2976
|
-
|
2977
|
-
|
2978
|
-
|
2979
|
-
|
2980
|
-
|
2981
|
-
|
2982
|
-
|
2983
|
-
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2997
|
-
|
2998
|
-
|
2999
|
-
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
* Platform code is old and doesn't implement this API
|
3031
|
-
*/
|
3032
|
-
ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
|
3033
|
-
/**
|
3034
|
-
* The file specified was not found on the given location
|
3035
|
-
*/
|
3036
|
-
ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
|
3037
|
-
/**
|
3038
|
-
* The return value is too big and has exceeded our size boundries
|
3039
|
-
*/
|
3040
|
-
ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
|
3041
|
-
})(ErrorCode || (ErrorCode = {}));
|
3042
|
-
/** @hidden */
|
3043
|
-
var DevicePermission;
|
3044
|
-
(function (DevicePermission) {
|
3045
|
-
DevicePermission["GeoLocation"] = "geolocation";
|
3046
|
-
DevicePermission["Media"] = "media";
|
3047
|
-
})(DevicePermission || (DevicePermission = {}));
|
3048
|
-
/**
|
3049
|
-
* @hidden
|
3050
|
-
*
|
3051
|
-
* @beta
|
3052
|
-
*/
|
3053
|
-
var Cohort;
|
3054
|
-
(function (Cohort) {
|
3055
|
-
Cohort["BCAIS"] = "bcais";
|
3056
|
-
Cohort["BCWAF"] = "bcwaf";
|
3057
|
-
Cohort["BCWBF"] = "bcwbf";
|
3058
|
-
})(Cohort || (Cohort = {}));
|
3059
|
-
/**
|
3060
|
-
* @hidden
|
3061
|
-
*
|
3062
|
-
* @beta
|
3063
|
-
*/
|
3064
|
-
var Persona;
|
3065
|
-
(function (Persona) {
|
3066
|
-
/**
|
3067
|
-
* User has a faculty license
|
3068
|
-
*/
|
3069
|
-
Persona["Faculty"] = "faculty";
|
3070
|
-
/**
|
3071
|
-
* User has a student license
|
3072
|
-
*/
|
3073
|
-
Persona["Student"] = "student";
|
3074
|
-
/**
|
3075
|
-
* When user is not a faculty or student
|
3076
|
-
*/
|
3077
|
-
Persona["Other"] = "other";
|
3078
|
-
})(Persona || (Persona = {}));
|
3079
|
-
/**
|
3080
|
-
* @hidden
|
3081
|
-
*
|
3082
|
-
* @beta
|
3083
|
-
*/
|
3084
|
-
// https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#legalagegroupclassification-values
|
3085
|
-
var LegalAgeGroupClassification;
|
3086
|
-
(function (LegalAgeGroupClassification) {
|
3087
|
-
/**
|
3088
|
-
* The user is considered an adult based on the age-related regulations of their country or region.
|
3089
|
-
*/
|
3090
|
-
LegalAgeGroupClassification["Adult"] = "adult";
|
3091
|
-
/**
|
3092
|
-
* The user is a minor but is from a country or region that has no age-related regulations.
|
3093
|
-
*/
|
3094
|
-
LegalAgeGroupClassification["MinorNoParentalConsentRequired"] = "minorNoParentalConsentRequired";
|
3095
|
-
/**
|
3096
|
-
* Reserved for future use
|
3097
|
-
*/
|
3098
|
-
LegalAgeGroupClassification["MinorWithoutParentalConsent"] = "minorWithoutParentalConsent";
|
3099
|
-
/**
|
3100
|
-
* The user is considered a minor based on the age-related regulations of their country or region, and the administrator
|
3101
|
-
* of the account obtained appropriate consent from a parent or guardian.
|
3102
|
-
*/
|
3103
|
-
LegalAgeGroupClassification["MinorWithParentalConsent"] = "minorWithParentalConsent";
|
3104
|
-
/**
|
3105
|
-
* The user is from a country or region that has additional age-related regulations, such as the United States,
|
3106
|
-
* United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
|
3107
|
-
* (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
|
3108
|
-
*/
|
3109
|
-
LegalAgeGroupClassification["NonAdult"] = "nonAdult";
|
3110
|
-
})(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
|
3111
|
-
/**
|
3112
|
-
* @hidden
|
3113
|
-
*
|
3114
|
-
* @beta
|
3115
|
-
*/
|
3116
|
-
var EduType;
|
3117
|
-
(function (EduType) {
|
3118
|
-
/**
|
3119
|
-
* User is from a tenant labeled as “HigherEd”
|
3120
|
-
*/
|
3121
|
-
EduType["HigherEducation"] = "higherEducation";
|
3122
|
-
/**
|
3123
|
-
* User is from a tenant labeled as “K12”
|
3124
|
-
*/
|
3125
|
-
EduType["K12"] = "k12";
|
3126
|
-
/**
|
3127
|
-
* User is from a tenant labeled as “Others” (e.g. research institutions)
|
3128
|
-
*/
|
3129
|
-
EduType["Other"] = "other";
|
3130
|
-
})(EduType || (EduType = {}));
|
3131
|
-
/**
|
3132
|
-
* Currently supported Mime type
|
3133
|
-
*/
|
3134
|
-
var ClipboardSupportedMimeType;
|
3135
|
-
(function (ClipboardSupportedMimeType) {
|
3136
|
-
ClipboardSupportedMimeType["TextPlain"] = "text/plain";
|
3137
|
-
ClipboardSupportedMimeType["TextHtml"] = "text/html";
|
3138
|
-
ClipboardSupportedMimeType["ImagePNG"] = "image/png";
|
3139
|
-
ClipboardSupportedMimeType["ImageJPEG"] = "image/jpeg";
|
3140
|
-
})(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
|
3224
|
+
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/native.js
|
3225
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
3226
|
+
/* harmony default export */ const esm_browser_native = ({
|
3227
|
+
randomUUID
|
3228
|
+
});
|
3229
|
+
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/rng.js
|
3230
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
3231
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
3232
|
+
// generators (like Math.random()).
|
3233
|
+
let getRandomValues;
|
3234
|
+
const rnds8 = new Uint8Array(16);
|
3235
|
+
function rng() {
|
3236
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
3237
|
+
if (!getRandomValues) {
|
3238
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
3239
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
3240
|
+
|
3241
|
+
if (!getRandomValues) {
|
3242
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
3243
|
+
}
|
3244
|
+
}
|
3245
|
+
|
3246
|
+
return getRandomValues(rnds8);
|
3247
|
+
}
|
3248
|
+
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js
|
3249
|
+
|
3250
|
+
/**
|
3251
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
3252
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
3253
|
+
*/
|
3254
|
+
|
3255
|
+
const byteToHex = [];
|
3256
|
+
|
3257
|
+
for (let i = 0; i < 256; ++i) {
|
3258
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
3259
|
+
}
|
3260
|
+
|
3261
|
+
function unsafeStringify(arr, offset = 0) {
|
3262
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
3263
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
3264
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
3265
|
+
}
|
3266
|
+
|
3267
|
+
function stringify(arr, offset = 0) {
|
3268
|
+
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
3269
|
+
// of the following:
|
3270
|
+
// - One or more input array values don't map to a hex octet (leading to
|
3271
|
+
// "undefined" in the uuid)
|
3272
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
3273
|
+
|
3274
|
+
if (!validate(uuid)) {
|
3275
|
+
throw TypeError('Stringified UUID is invalid');
|
3276
|
+
}
|
3277
|
+
|
3278
|
+
return uuid;
|
3279
|
+
}
|
3280
|
+
|
3281
|
+
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
|
3282
|
+
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js
|
3283
|
+
|
3284
|
+
|
3285
|
+
|
3286
|
+
|
3287
|
+
function v4(options, buf, offset) {
|
3288
|
+
if (esm_browser_native.randomUUID && !buf && !options) {
|
3289
|
+
return esm_browser_native.randomUUID();
|
3290
|
+
}
|
3291
|
+
|
3292
|
+
options = options || {};
|
3293
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
3294
|
+
|
3295
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
3296
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
3297
|
+
|
3298
|
+
if (buf) {
|
3299
|
+
offset = offset || 0;
|
3300
|
+
|
3301
|
+
for (let i = 0; i < 16; ++i) {
|
3302
|
+
buf[offset + i] = rnds[i];
|
3303
|
+
}
|
3304
|
+
|
3305
|
+
return buf;
|
3306
|
+
}
|
3307
|
+
|
3308
|
+
return unsafeStringify(rnds);
|
3309
|
+
}
|
3310
|
+
|
3311
|
+
/* harmony default export */ const esm_browser_v4 = (v4);
|
3312
|
+
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js
|
3313
|
+
/* harmony default export */ const regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
|
3314
|
+
;// ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js
|
3315
|
+
|
3316
|
+
|
3317
|
+
function validate_validate(uuid) {
|
3318
|
+
return typeof uuid === 'string' && regex.test(uuid);
|
3319
|
+
}
|
3141
3320
|
|
3321
|
+
/* harmony default export */ const esm_browser_validate = (validate_validate);
|
3142
3322
|
;// ./src/public/constants.ts
|
3143
3323
|
/** HostClientType represents the different client platforms on which host can be run. */
|
3144
3324
|
var HostClientType;
|
@@ -3855,225 +4035,45 @@ class UUID {
|
|
3855
4035
|
// Each teamsjs instance gets a unique identifier that will be prepended to every log statement
|
3856
4036
|
const teamsJsInstanceIdentifier = new UUID();
|
3857
4037
|
// Every log statement will get prepended with the teamsJsInstanceIdentifier and a timestamp
|
3858
|
-
const originalFormatArgsFunction = browser.debug.formatArgs;
|
3859
|
-
browser.debug.formatArgs = function (args) {
|
3860
|
-
args[0] = `(${new Date().toISOString()}): ${args[0]} [${teamsJsInstanceIdentifier.toString()}]`;
|
3861
|
-
originalFormatArgsFunction.call(this, args);
|
3862
|
-
};
|
3863
|
-
const topLevelLogger = (0,browser.debug)('teamsJs');
|
3864
|
-
/**
|
3865
|
-
* @internal
|
3866
|
-
* Limited to Microsoft-internal use
|
3867
|
-
*
|
3868
|
-
* Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
|
3869
|
-
*/
|
3870
|
-
function getLogger(namespace) {
|
3871
|
-
return topLevelLogger.extend(namespace);
|
3872
|
-
}
|
3873
|
-
/**
|
3874
|
-
* @hidden
|
3875
|
-
* Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request
|
3876
|
-
* sent to host(s).
|
3877
|
-
*
|
3878
|
-
* @internal
|
3879
|
-
* Limited to Microsoft-internal use
|
3880
|
-
*/
|
3881
|
-
function getApiVersionTag(apiVersionNumber, functionName) {
|
3882
|
-
return `${apiVersionNumber}_${functionName}`;
|
3883
|
-
}
|
3884
|
-
/**
|
3885
|
-
* @hidden
|
3886
|
-
* Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then
|
3887
|
-
* followed by one or more digits, then concatenated with underscore and some characters to indicate api name.
|
3888
|
-
* For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.
|
3889
|
-
*
|
3890
|
-
* @internal
|
3891
|
-
* Limited to Microsoft-internal use
|
3892
|
-
*/
|
3893
|
-
function isFollowingApiVersionTagFormat(apiVersionTag) {
|
3894
|
-
const pattern = /^v\d+_[\w.]+$/;
|
3895
|
-
return pattern.test(apiVersionTag);
|
3896
|
-
}
|
3897
|
-
|
3898
|
-
;// ./src/artifactsForCDN/validDomains.json
|
3899
|
-
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
|
3900
|
-
var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
|
3901
|
-
;// ./src/internal/constants.ts
|
3902
|
-
|
3903
|
-
/**
|
3904
|
-
* @hidden
|
3905
|
-
* The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
|
3906
|
-
* Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.
|
3907
|
-
* Mobile clients are passing versions, hence will be applicable to web and desktop clients only.
|
3908
|
-
*
|
3909
|
-
* @internal
|
3910
|
-
* Limited to Microsoft-internal use
|
3911
|
-
*/
|
3912
|
-
const defaultSDKVersionForCompatCheck = '2.0.1';
|
3913
|
-
/**
|
3914
|
-
* @hidden
|
3915
|
-
* This is the client version when selectMedia API - VideoAndImage is supported on mobile.
|
3916
|
-
*
|
3917
|
-
* @internal
|
3918
|
-
* Limited to Microsoft-internal use
|
3919
|
-
*/
|
3920
|
-
const videoAndImageMediaAPISupportVersion = '2.0.2';
|
3921
|
-
/**
|
3922
|
-
* @hidden
|
3923
|
-
* This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.
|
3924
|
-
*
|
3925
|
-
* @internal
|
3926
|
-
* Limited to Microsoft-internal use
|
3927
|
-
*/
|
3928
|
-
const nonFullScreenVideoModeAPISupportVersion = '2.0.3';
|
3929
|
-
/**
|
3930
|
-
* @hidden
|
3931
|
-
* This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.
|
3932
|
-
*
|
3933
|
-
* @internal
|
3934
|
-
* Limited to Microsoft-internal use
|
3935
|
-
*/
|
3936
|
-
const imageOutputFormatsAPISupportVersion = '2.0.4';
|
3937
|
-
/**
|
3938
|
-
* @hidden
|
3939
|
-
* Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
|
3940
|
-
*
|
3941
|
-
* @internal
|
3942
|
-
* Limited to Microsoft-internal use
|
3943
|
-
*/
|
3944
|
-
const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';
|
3945
|
-
/**
|
3946
|
-
* @hidden
|
3947
|
-
* This is the client version when location APIs (getLocation and showLocation) are supported.
|
3948
|
-
*
|
3949
|
-
* @internal
|
3950
|
-
* Limited to Microsoft-internal use
|
3951
|
-
*/
|
3952
|
-
const locationAPIsRequiredVersion = '1.9.0';
|
3953
|
-
/**
|
3954
|
-
* @hidden
|
3955
|
-
* This is the client version when permisisons are supported
|
3956
|
-
*
|
3957
|
-
* @internal
|
3958
|
-
* Limited to Microsoft-internal use
|
3959
|
-
*/
|
3960
|
-
const permissionsAPIsRequiredVersion = '2.0.1';
|
3961
|
-
/**
|
3962
|
-
* @hidden
|
3963
|
-
* This is the client version when people picker API is supported on mobile.
|
3964
|
-
*
|
3965
|
-
* @internal
|
3966
|
-
* Limited to Microsoft-internal use
|
3967
|
-
*/
|
3968
|
-
const peoplePickerRequiredVersion = '2.0.0';
|
3969
|
-
/**
|
3970
|
-
* @hidden
|
3971
|
-
* This is the client version when captureImage API is supported on mobile.
|
3972
|
-
*
|
3973
|
-
* @internal
|
3974
|
-
* Limited to Microsoft-internal use
|
3975
|
-
*/
|
3976
|
-
const captureImageMobileSupportVersion = '1.7.0';
|
3977
|
-
/**
|
3978
|
-
* @hidden
|
3979
|
-
* This is the client version when media APIs are supported on all three platforms ios, android and web.
|
3980
|
-
*
|
3981
|
-
* @internal
|
3982
|
-
* Limited to Microsoft-internal use
|
3983
|
-
*/
|
3984
|
-
const mediaAPISupportVersion = '1.8.0';
|
3985
|
-
/**
|
3986
|
-
* @hidden
|
3987
|
-
* This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
|
3988
|
-
*
|
3989
|
-
* @internal
|
3990
|
-
* Limited to Microsoft-internal use
|
3991
|
-
*/
|
3992
|
-
const getMediaCallbackSupportVersion = '2.0.0';
|
3993
|
-
/**
|
3994
|
-
* @hidden
|
3995
|
-
* This is the client version when scanBarCode API is supported on mobile.
|
3996
|
-
*
|
3997
|
-
* @internal
|
3998
|
-
* Limited to Microsoft-internal use
|
3999
|
-
*/
|
4000
|
-
const scanBarCodeAPIMobileSupportVersion = '1.9.0';
|
4001
|
-
/**
|
4002
|
-
* @hidden
|
4003
|
-
* Fallback list of valid origins in JSON format
|
4004
|
-
*
|
4005
|
-
* @internal
|
4006
|
-
* Limited to Microsoft-internal use
|
4007
|
-
*/
|
4008
|
-
const validOriginsLocal = artifactsForCDN_validDomains_namespaceObject;
|
4009
|
-
/**
|
4010
|
-
* @hidden
|
4011
|
-
* Fallback list of valid origins
|
4012
|
-
*
|
4013
|
-
* @internal
|
4014
|
-
* Limited to Microsoft-internal use
|
4015
|
-
*/
|
4016
|
-
const validOriginsFallback = validOriginsLocal.validOrigins;
|
4017
|
-
/**
|
4018
|
-
* @hidden
|
4019
|
-
* Timeout length for Fetch Call for Valid Origins
|
4020
|
-
*
|
4021
|
-
* @internal
|
4022
|
-
* Limited to Microsoft-internal use
|
4023
|
-
*/
|
4024
|
-
const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS = 1500;
|
4038
|
+
const originalFormatArgsFunction = browser.debug.formatArgs;
|
4039
|
+
browser.debug.formatArgs = function (args) {
|
4040
|
+
args[0] = `(${new Date().toISOString()}): ${args[0]} [${teamsJsInstanceIdentifier.toString()}]`;
|
4041
|
+
originalFormatArgsFunction.call(this, args);
|
4042
|
+
};
|
4043
|
+
const topLevelLogger = (0,browser.debug)('teamsJs');
|
4025
4044
|
/**
|
4026
|
-
* @hidden
|
4027
|
-
* CDN endpoint of the list of valid origins
|
4028
|
-
*
|
4029
4045
|
* @internal
|
4030
4046
|
* Limited to Microsoft-internal use
|
4031
|
-
*/
|
4032
|
-
const validOriginsCdnEndpoint = new URL('https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json');
|
4033
|
-
/**
|
4034
|
-
* @hidden
|
4035
|
-
* USer specified message origins should satisfy this test
|
4036
4047
|
*
|
4037
|
-
*
|
4038
|
-
* Limited to Microsoft-internal use
|
4048
|
+
* Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
|
4039
4049
|
*/
|
4040
|
-
|
4050
|
+
function getLogger(namespace) {
|
4051
|
+
return topLevelLogger.extend(namespace);
|
4052
|
+
}
|
4041
4053
|
/**
|
4042
4054
|
* @hidden
|
4043
|
-
*
|
4055
|
+
* Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request
|
4056
|
+
* sent to host(s).
|
4044
4057
|
*
|
4045
4058
|
* @internal
|
4046
4059
|
* Limited to Microsoft-internal use
|
4047
4060
|
*/
|
4048
|
-
|
4061
|
+
function getApiVersionTag(apiVersionNumber, functionName) {
|
4062
|
+
return `${apiVersionNumber}_${functionName}`;
|
4063
|
+
}
|
4049
4064
|
/**
|
4050
4065
|
* @hidden
|
4051
|
-
*
|
4066
|
+
* Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then
|
4067
|
+
* followed by one or more digits, then concatenated with underscore and some characters to indicate api name.
|
4068
|
+
* For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.
|
4052
4069
|
*
|
4053
4070
|
* @internal
|
4054
4071
|
* Limited to Microsoft-internal use
|
4055
4072
|
*/
|
4056
|
-
|
4057
|
-
|
4058
|
-
|
4059
|
-
/** @hidden */
|
4060
|
-
const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';
|
4061
|
-
/** @hidden */
|
4062
|
-
const errorRuntimeNotSupported = 'The runtime version is not supported';
|
4063
|
-
/** @hidden */
|
4064
|
-
const errorCallNotStarted = 'The call was not properly started';
|
4065
|
-
|
4066
|
-
;// ./src/internal/globalVars.ts
|
4067
|
-
class GlobalVars {
|
4073
|
+
function isFollowingApiVersionTagFormat(apiVersionTag) {
|
4074
|
+
const pattern = /^v\d+_[\w.]+$/;
|
4075
|
+
return pattern.test(apiVersionTag);
|
4068
4076
|
}
|
4069
|
-
GlobalVars.initializeCalled = false;
|
4070
|
-
GlobalVars.initializeCompleted = false;
|
4071
|
-
GlobalVars.additionalValidOrigins = [];
|
4072
|
-
GlobalVars.initializePromise = undefined;
|
4073
|
-
GlobalVars.isFramelessWindow = false;
|
4074
|
-
GlobalVars.frameContext = undefined;
|
4075
|
-
GlobalVars.hostClientType = undefined;
|
4076
|
-
GlobalVars.printCapabilityEnabled = false;
|
4077
4077
|
|
4078
4078
|
;// ./src/public/runtime.ts
|
4079
4079
|
/* eslint-disable @typescript-eslint/ban-types */
|
@@ -4484,7 +4484,80 @@ function isSerializable(arg) {
|
|
4484
4484
|
* @hidden
|
4485
4485
|
* Package version.
|
4486
4486
|
*/
|
4487
|
-
const version = "2.
|
4487
|
+
const version = "2.35.0-beta.1";
|
4488
|
+
|
4489
|
+
;// ./src/internal/messageObjects.ts
|
4490
|
+
var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
|
4491
|
+
var t = {};
|
4492
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4493
|
+
t[p] = s[p];
|
4494
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
4495
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
4496
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
4497
|
+
t[p[i]] = s[p[i]];
|
4498
|
+
}
|
4499
|
+
return t;
|
4500
|
+
};
|
4501
|
+
|
4502
|
+
const serializeMessageRequest = (message) => {
|
4503
|
+
const { uuid } = message, restOfMessage = messageObjects_rest(message, ["uuid"]);
|
4504
|
+
const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
|
4505
|
+
const request = Object.assign(Object.assign({}, restOfMessage), { uuidAsString: uuidAsString });
|
4506
|
+
return request;
|
4507
|
+
};
|
4508
|
+
const deserializeMessageRequest = (message) => {
|
4509
|
+
const { uuidAsString } = message, restOfMessage = messageObjects_rest(message, ["uuidAsString"]);
|
4510
|
+
const request = Object.assign(Object.assign({}, restOfMessage), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
|
4511
|
+
return request;
|
4512
|
+
};
|
4513
|
+
const deserializeMessageResponse = (serializedResponse) => {
|
4514
|
+
const { uuidAsString } = serializedResponse, restOfResponse = messageObjects_rest(serializedResponse, ["uuidAsString"]);
|
4515
|
+
const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
|
4516
|
+
return messageResponse;
|
4517
|
+
};
|
4518
|
+
const serializeMessageResponse = (response) => {
|
4519
|
+
const { uuid } = response, restOfResponse = messageObjects_rest(response, ["uuid"]);
|
4520
|
+
const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
|
4521
|
+
const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuidAsString: uuidAsString });
|
4522
|
+
return messageResponse;
|
4523
|
+
};
|
4524
|
+
|
4525
|
+
;// ./src/internal/communicationUtils.ts
|
4526
|
+
|
4527
|
+
|
4528
|
+
/**
|
4529
|
+
* @hidden
|
4530
|
+
* @internal
|
4531
|
+
* Limited to Microsoft-internal use
|
4532
|
+
*/
|
4533
|
+
function getMessageIdsAsLogString(message) {
|
4534
|
+
if (message.uuidAsString !== undefined) {
|
4535
|
+
return `${message.uuidAsString} (legacy id: ${message.id})`;
|
4536
|
+
}
|
4537
|
+
if (message.uuid !== undefined) {
|
4538
|
+
return `${message.uuid.toString()} (legacy id: ${message.id})`;
|
4539
|
+
}
|
4540
|
+
return `legacy id: ${message.id} (no uuid)`;
|
4541
|
+
}
|
4542
|
+
const flushMessageQueueLogger = getLogger('flushMessageQueue');
|
4543
|
+
/**
|
4544
|
+
* @hidden
|
4545
|
+
* @internal
|
4546
|
+
* Limited to Microsoft-internal use
|
4547
|
+
*/
|
4548
|
+
function flushMessageQueue(targetWindow, targetOrigin, targetMessageQueue, target) {
|
4549
|
+
if (!targetWindow || !targetOrigin || targetMessageQueue.length === 0) {
|
4550
|
+
return;
|
4551
|
+
}
|
4552
|
+
while (targetMessageQueue.length > 0) {
|
4553
|
+
const messageRequest = targetMessageQueue.shift();
|
4554
|
+
if (messageRequest) {
|
4555
|
+
const request = serializeMessageRequest(messageRequest);
|
4556
|
+
flushMessageQueueLogger('Flushing message %s from %s message queue via postMessage.', getMessageIdsAsLogString(request), target);
|
4557
|
+
targetWindow.postMessage(request, targetOrigin);
|
4558
|
+
}
|
4559
|
+
}
|
4560
|
+
}
|
4488
4561
|
|
4489
4562
|
;// ./src/internal/internalAPIs.ts
|
4490
4563
|
|
@@ -5931,6 +6004,7 @@ function menus_isSupported() {
|
|
5931
6004
|
|
5932
6005
|
|
5933
6006
|
|
6007
|
+
|
5934
6008
|
let saveHandler;
|
5935
6009
|
let removeHandler;
|
5936
6010
|
/**
|
@@ -6035,7 +6109,7 @@ function handleSave(result) {
|
|
6035
6109
|
if (saveHandler) {
|
6036
6110
|
saveHandler(saveEventType);
|
6037
6111
|
}
|
6038
|
-
else if (
|
6112
|
+
else if (shouldEventBeRelayedToChild()) {
|
6039
6113
|
sendMessageEventToChild('settings.save', [result]);
|
6040
6114
|
}
|
6041
6115
|
else {
|
@@ -6084,7 +6158,7 @@ function handleRemove() {
|
|
6084
6158
|
if (removeHandler) {
|
6085
6159
|
removeHandler(removeEventType);
|
6086
6160
|
}
|
6087
|
-
else if (
|
6161
|
+
else if (shouldEventBeRelayedToChild()) {
|
6088
6162
|
sendMessageEventToChild('settings.remove', []);
|
6089
6163
|
}
|
6090
6164
|
else {
|
@@ -7009,6 +7083,7 @@ function pages_isSupported() {
|
|
7009
7083
|
|
7010
7084
|
|
7011
7085
|
|
7086
|
+
|
7012
7087
|
/**
|
7013
7088
|
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
7014
7089
|
*/
|
@@ -7138,7 +7213,7 @@ function initializeBackStackHelper() {
|
|
7138
7213
|
}
|
7139
7214
|
function handleBackButtonPress() {
|
7140
7215
|
if (!backButtonPressHandler || !backButtonPressHandler()) {
|
7141
|
-
if (
|
7216
|
+
if (shouldEventBeRelayedToChild()) {
|
7142
7217
|
// If the current window did not handle it let the child window
|
7143
7218
|
sendMessageEventToChild('backButtonPress', []);
|
7144
7219
|
}
|
@@ -7166,6 +7241,7 @@ var handlers_awaiter = (undefined && undefined.__awaiter) || function (thisArg,
|
|
7166
7241
|
|
7167
7242
|
|
7168
7243
|
|
7244
|
+
|
7169
7245
|
const handlersLogger = getLogger('handlers');
|
7170
7246
|
/**
|
7171
7247
|
* @internal
|
@@ -7237,7 +7313,7 @@ function callHandler(name, args) {
|
|
7237
7313
|
const result = handler.apply(this, args);
|
7238
7314
|
return [true, result];
|
7239
7315
|
}
|
7240
|
-
else if (
|
7316
|
+
else if (shouldEventBeRelayedToChild()) {
|
7241
7317
|
sendMessageEventToChild(name, args);
|
7242
7318
|
return [false, undefined];
|
7243
7319
|
}
|
@@ -7310,7 +7386,7 @@ function handleThemeChange(theme) {
|
|
7310
7386
|
if (HandlersPrivate.themeChangeHandler) {
|
7311
7387
|
HandlersPrivate.themeChangeHandler(theme);
|
7312
7388
|
}
|
7313
|
-
if (
|
7389
|
+
if (shouldEventBeRelayedToChild()) {
|
7314
7390
|
sendMessageEventToChild('themeChange', [theme]);
|
7315
7391
|
}
|
7316
7392
|
}
|
@@ -7345,88 +7421,268 @@ function registerOnLoadHandler(apiVersionTag, handler) {
|
|
7345
7421
|
* @internal
|
7346
7422
|
* Limited to Microsoft-internal use
|
7347
7423
|
*/
|
7348
|
-
function handleLoad(loadContext) {
|
7349
|
-
const resumeContext = convertToResumeContext(loadContext);
|
7350
|
-
if (HandlersPrivate.resumeHandler) {
|
7351
|
-
HandlersPrivate.resumeHandler(resumeContext);
|
7352
|
-
if (
|
7353
|
-
sendMessageEventToChild('load', [resumeContext]);
|
7354
|
-
}
|
7424
|
+
function handleLoad(loadContext) {
|
7425
|
+
const resumeContext = convertToResumeContext(loadContext);
|
7426
|
+
if (HandlersPrivate.resumeHandler) {
|
7427
|
+
HandlersPrivate.resumeHandler(resumeContext);
|
7428
|
+
if (shouldEventBeRelayedToChild()) {
|
7429
|
+
sendMessageEventToChild('load', [resumeContext]);
|
7430
|
+
}
|
7431
|
+
}
|
7432
|
+
else if (HandlersPrivate.loadHandler) {
|
7433
|
+
HandlersPrivate.loadHandler(loadContext);
|
7434
|
+
if (shouldEventBeRelayedToChild()) {
|
7435
|
+
sendMessageEventToChild('load', [loadContext]);
|
7436
|
+
}
|
7437
|
+
}
|
7438
|
+
}
|
7439
|
+
/**
|
7440
|
+
* @internal
|
7441
|
+
* Limited to Microsoft-internal use
|
7442
|
+
*/
|
7443
|
+
function convertToResumeContext(context) {
|
7444
|
+
return {
|
7445
|
+
entityId: context.entityId,
|
7446
|
+
contentUrl: new URL(context.contentUrl),
|
7447
|
+
};
|
7448
|
+
}
|
7449
|
+
/**
|
7450
|
+
* @internal
|
7451
|
+
* Limited to Microsoft-internal use
|
7452
|
+
*
|
7453
|
+
* @deprecated
|
7454
|
+
*/
|
7455
|
+
function registerBeforeUnloadHandler(apiVersionTag, handler) {
|
7456
|
+
HandlersPrivate.beforeUnloadHandler = handler;
|
7457
|
+
!isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['beforeUnload']);
|
7458
|
+
}
|
7459
|
+
/**
|
7460
|
+
* @internal
|
7461
|
+
* Limited to Microsoft-internal use
|
7462
|
+
*/
|
7463
|
+
function handleBeforeUnload() {
|
7464
|
+
return handlers_awaiter(this, void 0, void 0, function* () {
|
7465
|
+
const readyToUnload = () => {
|
7466
|
+
sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "handleBeforeUnload" /* ApiName.HandleBeforeUnload */), 'readyToUnload', []);
|
7467
|
+
};
|
7468
|
+
if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
|
7469
|
+
yield HandlersPrivate.beforeSuspendOrTerminateHandler();
|
7470
|
+
if (shouldEventBeRelayedToChild()) {
|
7471
|
+
sendMessageEventToChild('beforeUnload');
|
7472
|
+
}
|
7473
|
+
else {
|
7474
|
+
readyToUnload();
|
7475
|
+
}
|
7476
|
+
}
|
7477
|
+
else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
|
7478
|
+
if (shouldEventBeRelayedToChild()) {
|
7479
|
+
sendMessageEventToChild('beforeUnload');
|
7480
|
+
}
|
7481
|
+
else {
|
7482
|
+
readyToUnload();
|
7483
|
+
}
|
7484
|
+
}
|
7485
|
+
});
|
7486
|
+
}
|
7487
|
+
/**
|
7488
|
+
* @internal
|
7489
|
+
* Limited to Microsoft-internal use
|
7490
|
+
*/
|
7491
|
+
function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
|
7492
|
+
HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
|
7493
|
+
!isNullOrUndefined(handler) &&
|
7494
|
+
sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "registerBeforeSuspendOrTerminateHandler" /* ApiName.RegisterBeforeSuspendOrTerminateHandler */), 'registerHandler', ['beforeUnload']);
|
7495
|
+
}
|
7496
|
+
/**
|
7497
|
+
* @internal
|
7498
|
+
* Limited to Microsoft-internal use
|
7499
|
+
*/
|
7500
|
+
function handlers_registerOnResumeHandler(handler) {
|
7501
|
+
HandlersPrivate.resumeHandler = handler;
|
7502
|
+
!isNullOrUndefined(handler) &&
|
7503
|
+
sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "registerOnResumeHandler" /* ApiName.RegisterOnResumeHandler */), 'registerHandler', [
|
7504
|
+
'load',
|
7505
|
+
]);
|
7506
|
+
}
|
7507
|
+
|
7508
|
+
;// ./src/internal/childCommunication.ts
|
7509
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
7510
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
7511
|
+
var childCommunication_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7512
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7513
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
7514
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
7515
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7516
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7517
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
7518
|
+
});
|
7519
|
+
};
|
7520
|
+
|
7521
|
+
|
7522
|
+
|
7523
|
+
|
7524
|
+
|
7525
|
+
const communicationLogger = getLogger('childProxyingCommunication');
|
7526
|
+
/**
|
7527
|
+
* @internal
|
7528
|
+
* Limited to Microsoft-internal use
|
7529
|
+
*/
|
7530
|
+
class ChildCommunication {
|
7531
|
+
}
|
7532
|
+
ChildCommunication.messageQueue = [];
|
7533
|
+
/**
|
7534
|
+
* @internal
|
7535
|
+
* Limited to Microsoft-internal use
|
7536
|
+
*/
|
7537
|
+
function uninitializeChildCommunication() {
|
7538
|
+
ChildCommunication.window = null;
|
7539
|
+
ChildCommunication.origin = null;
|
7540
|
+
ChildCommunication.messageQueue = [];
|
7541
|
+
}
|
7542
|
+
/**
|
7543
|
+
* @hidden
|
7544
|
+
* @internal
|
7545
|
+
* Limited to Microsoft-internal use
|
7546
|
+
*/
|
7547
|
+
function shouldEventBeRelayedToChild() {
|
7548
|
+
return !!ChildCommunication.window;
|
7549
|
+
}
|
7550
|
+
/**
|
7551
|
+
* @hidden
|
7552
|
+
* @internal
|
7553
|
+
* Limited to Microsoft-internal use
|
7554
|
+
*/
|
7555
|
+
function shouldProcessChildMessage(messageSource, messageOrigin) {
|
7556
|
+
if (!ChildCommunication.window || ChildCommunication.window.closed || messageSource === ChildCommunication.window) {
|
7557
|
+
ChildCommunication.window = messageSource;
|
7558
|
+
ChildCommunication.origin = messageOrigin;
|
7559
|
+
}
|
7560
|
+
// Clean up pointers to child windows
|
7561
|
+
if (ChildCommunication.window && ChildCommunication.window.closed) {
|
7562
|
+
ChildCommunication.window = null;
|
7563
|
+
ChildCommunication.origin = null;
|
7564
|
+
return false;
|
7565
|
+
}
|
7566
|
+
return ChildCommunication.window === messageSource;
|
7567
|
+
}
|
7568
|
+
/**
|
7569
|
+
* @hidden
|
7570
|
+
* @internal
|
7571
|
+
* Limited to Microsoft-internal use
|
7572
|
+
*/
|
7573
|
+
function handleIncomingMessageFromChild(evt, messageSource, sendMessageToParentHelper, setCallbackForRequest) {
|
7574
|
+
return childCommunication_awaiter(this, void 0, void 0, function* () {
|
7575
|
+
// Do not do anything if message source does not match child window
|
7576
|
+
if (ChildCommunication.window !== messageSource) {
|
7577
|
+
return;
|
7578
|
+
}
|
7579
|
+
// If we have any messages in our queue, send them now
|
7580
|
+
flushMessageQueue(ChildCommunication.window, ChildCommunication.origin, ChildCommunication.messageQueue, 'child');
|
7581
|
+
// Handle the message
|
7582
|
+
handleIncomingMessage(evt, sendMessageToParentHelper, setCallbackForRequest);
|
7583
|
+
});
|
7584
|
+
}
|
7585
|
+
const handleIncomingMessageFromChildLogger = communicationLogger.extend('handleIncomingMessageFromChild');
|
7586
|
+
/**
|
7587
|
+
* @internal
|
7588
|
+
* Limited to Microsoft-internal use
|
7589
|
+
*/
|
7590
|
+
function handleIncomingMessage(evt, sendMessageToParentHelper, setCallbackForRequest) {
|
7591
|
+
if (evt.data.id === undefined || evt.data.func === undefined) {
|
7592
|
+
return;
|
7355
7593
|
}
|
7356
|
-
|
7357
|
-
|
7358
|
-
|
7359
|
-
|
7360
|
-
|
7594
|
+
// Try to delegate the request to the proper handler, if defined
|
7595
|
+
const message = deserializeMessageRequest(evt.data);
|
7596
|
+
const [called, result] = callHandler(message.func, message.args);
|
7597
|
+
// If a handler was called and returned a value, send the response back to the child
|
7598
|
+
if (called && typeof result !== 'undefined') {
|
7599
|
+
handleIncomingMessageFromChildLogger('Handler called in response to message %s from child. Returning response from handler to child, action: %s.', getMessageIdsAsLogString(message), message.func);
|
7600
|
+
sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);
|
7601
|
+
return;
|
7361
7602
|
}
|
7603
|
+
// No handler, proxy to parent
|
7604
|
+
handleIncomingMessageFromChildLogger('No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.', getMessageIdsAsLogString(message), message.func);
|
7605
|
+
sendChildMessageToParent(message, sendMessageToParentHelper, setCallbackForRequest);
|
7362
7606
|
}
|
7363
7607
|
/**
|
7364
7608
|
* @internal
|
7365
7609
|
* Limited to Microsoft-internal use
|
7366
7610
|
*/
|
7367
|
-
function
|
7368
|
-
|
7369
|
-
|
7370
|
-
|
7371
|
-
|
7611
|
+
function sendChildMessageToParent(message, sendMessageToParentHelper, setCallbackForRequest) {
|
7612
|
+
const request = sendMessageToParentHelper(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "tasks.startTask" /* ApiName.Tasks_StartTask */), message.func, message.args, true);
|
7613
|
+
setCallbackForRequest(request.uuid, (...args) => {
|
7614
|
+
if (ChildCommunication.window) {
|
7615
|
+
const isPartialResponse = args.pop();
|
7616
|
+
handleIncomingMessageFromChildLogger('Message from parent being relayed to child, id: %s', getMessageIdsAsLogString(message));
|
7617
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
7618
|
+
// @ts-ignore
|
7619
|
+
sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
|
7620
|
+
}
|
7621
|
+
});
|
7372
7622
|
}
|
7373
7623
|
/**
|
7624
|
+
* @hidden
|
7625
|
+
* Send a response to child for a message request that was from child
|
7626
|
+
*
|
7374
7627
|
* @internal
|
7375
7628
|
* Limited to Microsoft-internal use
|
7376
|
-
*
|
7377
|
-
* @deprecated
|
7378
7629
|
*/
|
7379
|
-
function
|
7380
|
-
|
7381
|
-
|
7630
|
+
function sendMessageResponseToChild(id, uuid, args, isPartialResponse) {
|
7631
|
+
const targetWindow = ChildCommunication.window;
|
7632
|
+
const response = createMessageResponse(id, uuid, args, isPartialResponse);
|
7633
|
+
const serializedResponse = serializeMessageResponse(response);
|
7634
|
+
const targetOrigin = ChildCommunication.origin;
|
7635
|
+
if (targetWindow && targetOrigin) {
|
7636
|
+
handleIncomingMessageFromChildLogger('Sending message %s to %s via postMessage, args = %o', getMessageIdsAsLogString(serializedResponse), 'child', serializedResponse.args);
|
7637
|
+
targetWindow.postMessage(serializedResponse, targetOrigin);
|
7638
|
+
}
|
7382
7639
|
}
|
7383
7640
|
/**
|
7641
|
+
* @hidden
|
7642
|
+
* Send a custom message object that can be sent to child window,
|
7643
|
+
* instead of a response message to a child
|
7644
|
+
*
|
7384
7645
|
* @internal
|
7385
7646
|
* Limited to Microsoft-internal use
|
7386
7647
|
*/
|
7387
|
-
function
|
7388
|
-
|
7389
|
-
|
7390
|
-
|
7391
|
-
|
7392
|
-
|
7393
|
-
|
7394
|
-
|
7395
|
-
|
7396
|
-
|
7397
|
-
|
7398
|
-
|
7399
|
-
|
7400
|
-
}
|
7401
|
-
else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
|
7402
|
-
if (Communication.childWindow) {
|
7403
|
-
sendMessageEventToChild('beforeUnload');
|
7404
|
-
}
|
7405
|
-
else {
|
7406
|
-
readyToUnload();
|
7407
|
-
}
|
7408
|
-
}
|
7409
|
-
});
|
7648
|
+
function sendMessageEventToChild(actionName, args) {
|
7649
|
+
const targetWindow = ChildCommunication.window;
|
7650
|
+
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
7651
|
+
const customEvent = createMessageEvent(actionName, args);
|
7652
|
+
const targetOrigin = ChildCommunication.origin;
|
7653
|
+
// If the target window isn't closed and we already know its origin, send the message right away; otherwise,
|
7654
|
+
// queue the message and send it after the origin is established
|
7655
|
+
if (targetWindow && targetOrigin) {
|
7656
|
+
targetWindow.postMessage(customEvent, targetOrigin);
|
7657
|
+
}
|
7658
|
+
else {
|
7659
|
+
ChildCommunication.messageQueue.push(customEvent);
|
7660
|
+
}
|
7410
7661
|
}
|
7411
7662
|
/**
|
7412
7663
|
* @internal
|
7413
7664
|
* Limited to Microsoft-internal use
|
7414
7665
|
*/
|
7415
|
-
function
|
7416
|
-
|
7417
|
-
|
7418
|
-
|
7666
|
+
function createMessageResponse(id, uuid, args, isPartialResponse) {
|
7667
|
+
return {
|
7668
|
+
id: id,
|
7669
|
+
uuid: uuid,
|
7670
|
+
args: args || [],
|
7671
|
+
isPartialResponse,
|
7672
|
+
};
|
7419
7673
|
}
|
7420
7674
|
/**
|
7675
|
+
* @hidden
|
7676
|
+
* Creates a message object without any id and api version, used for custom actions being sent to child frame/window
|
7677
|
+
*
|
7421
7678
|
* @internal
|
7422
7679
|
* Limited to Microsoft-internal use
|
7423
7680
|
*/
|
7424
|
-
function
|
7425
|
-
|
7426
|
-
|
7427
|
-
|
7428
|
-
|
7429
|
-
]);
|
7681
|
+
function createMessageEvent(func, args) {
|
7682
|
+
return {
|
7683
|
+
func: func,
|
7684
|
+
args: args || [],
|
7685
|
+
};
|
7430
7686
|
}
|
7431
7687
|
|
7432
7688
|
;// ./src/internal/hostToAppTelemetry.ts
|
@@ -7508,42 +7764,6 @@ class HostToAppMessageDelayTelemetry {
|
|
7508
7764
|
}
|
7509
7765
|
HostToAppMessageDelayTelemetry.callbackInformation = new Map();
|
7510
7766
|
|
7511
|
-
;// ./src/internal/messageObjects.ts
|
7512
|
-
var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
|
7513
|
-
var t = {};
|
7514
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
7515
|
-
t[p] = s[p];
|
7516
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
7517
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7518
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
7519
|
-
t[p[i]] = s[p[i]];
|
7520
|
-
}
|
7521
|
-
return t;
|
7522
|
-
};
|
7523
|
-
|
7524
|
-
const serializeMessageRequest = (message) => {
|
7525
|
-
const { uuid } = message, restOfMessage = messageObjects_rest(message, ["uuid"]);
|
7526
|
-
const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
|
7527
|
-
const request = Object.assign(Object.assign({}, restOfMessage), { uuidAsString: uuidAsString });
|
7528
|
-
return request;
|
7529
|
-
};
|
7530
|
-
const deserializeMessageRequest = (message) => {
|
7531
|
-
const { uuidAsString } = message, restOfMessage = messageObjects_rest(message, ["uuidAsString"]);
|
7532
|
-
const request = Object.assign(Object.assign({}, restOfMessage), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
|
7533
|
-
return request;
|
7534
|
-
};
|
7535
|
-
const deserializeMessageResponse = (serializedResponse) => {
|
7536
|
-
const { uuidAsString } = serializedResponse, restOfResponse = messageObjects_rest(serializedResponse, ["uuidAsString"]);
|
7537
|
-
const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
|
7538
|
-
return messageResponse;
|
7539
|
-
};
|
7540
|
-
const serializeMessageResponse = (response) => {
|
7541
|
-
const { uuid } = response, restOfResponse = messageObjects_rest(response, ["uuid"]);
|
7542
|
-
const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
|
7543
|
-
const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuidAsString: uuidAsString });
|
7544
|
-
return messageResponse;
|
7545
|
-
};
|
7546
|
-
|
7547
7767
|
;// ./src/internal/nestedAppAuthUtils.ts
|
7548
7768
|
|
7549
7769
|
|
@@ -7673,7 +7893,8 @@ var communication_awaiter = (undefined && undefined.__awaiter) || function (this
|
|
7673
7893
|
|
7674
7894
|
|
7675
7895
|
|
7676
|
-
|
7896
|
+
|
7897
|
+
const communication_communicationLogger = getLogger('communication');
|
7677
7898
|
/**
|
7678
7899
|
* @internal
|
7679
7900
|
* Limited to Microsoft-internal use
|
@@ -7687,7 +7908,6 @@ class Communication {
|
|
7687
7908
|
class CommunicationPrivate {
|
7688
7909
|
}
|
7689
7910
|
CommunicationPrivate.parentMessageQueue = [];
|
7690
|
-
CommunicationPrivate.childMessageQueue = [];
|
7691
7911
|
CommunicationPrivate.topMessageQueue = [];
|
7692
7912
|
CommunicationPrivate.nextMessageId = 0;
|
7693
7913
|
CommunicationPrivate.callbacks = new Map();
|
@@ -7756,16 +7976,14 @@ function uninitializeCommunication() {
|
|
7756
7976
|
Communication.currentWindow = null;
|
7757
7977
|
Communication.parentWindow = null;
|
7758
7978
|
Communication.parentOrigin = null;
|
7759
|
-
Communication.childWindow = null;
|
7760
|
-
Communication.childOrigin = null;
|
7761
7979
|
CommunicationPrivate.parentMessageQueue = [];
|
7762
|
-
CommunicationPrivate.childMessageQueue = [];
|
7763
7980
|
CommunicationPrivate.nextMessageId = 0;
|
7764
7981
|
CommunicationPrivate.callbacks.clear();
|
7765
7982
|
CommunicationPrivate.promiseCallbacks.clear();
|
7766
7983
|
CommunicationPrivate.portCallbacks.clear();
|
7767
7984
|
CommunicationPrivate.legacyMessageIdsToUuidMap = {};
|
7768
7985
|
HostToAppMessageDelayTelemetry.clearMessages();
|
7986
|
+
uninitializeChildCommunication();
|
7769
7987
|
}
|
7770
7988
|
/**
|
7771
7989
|
* @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
|
@@ -7976,7 +8194,7 @@ function sendMessageToParent(apiVersionTag, actionName, argsOrCallback, callback
|
|
7976
8194
|
CommunicationPrivate.callbacks.set(request.uuid, callback);
|
7977
8195
|
}
|
7978
8196
|
}
|
7979
|
-
const sendNestedAuthRequestToTopWindowLogger =
|
8197
|
+
const sendNestedAuthRequestToTopWindowLogger = communication_communicationLogger.extend('sendNestedAuthRequestToTopWindow');
|
7980
8198
|
/**
|
7981
8199
|
* @internal
|
7982
8200
|
* Limited to Microsoft-internal use
|
@@ -7990,7 +8208,7 @@ function sendNestedAuthRequestToTopWindow(message) {
|
|
7990
8208
|
});
|
7991
8209
|
return sendRequestToTargetWindowHelper(targetWindow, request);
|
7992
8210
|
}
|
7993
|
-
const sendRequestToTargetWindowHelperLogger =
|
8211
|
+
const sendRequestToTargetWindowHelperLogger = communication_communicationLogger.extend('sendRequestToTargetWindowHelper');
|
7994
8212
|
/**
|
7995
8213
|
* @internal
|
7996
8214
|
* Limited to Microsoft-internal use
|
@@ -8020,7 +8238,7 @@ function sendRequestToTargetWindowHelper(targetWindow, messageRequest) {
|
|
8020
8238
|
}
|
8021
8239
|
return messageRequest;
|
8022
8240
|
}
|
8023
|
-
const sendMessageToParentHelperLogger =
|
8241
|
+
const sendMessageToParentHelperLogger = communication_communicationLogger.extend('sendMessageToParentHelper');
|
8024
8242
|
/**
|
8025
8243
|
* @internal
|
8026
8244
|
* Limited to Microsoft-internal use
|
@@ -8036,7 +8254,7 @@ function sendMessageToParentHelper(apiVersionTag, actionName, args, isProxiedFro
|
|
8036
8254
|
logger('Message %s information: %o', getMessageIdsAsLogString(request), { actionName, args });
|
8037
8255
|
return sendRequestToTargetWindowHelper(targetWindow, request);
|
8038
8256
|
}
|
8039
|
-
const processIncomingMessageLogger =
|
8257
|
+
const processIncomingMessageLogger = communication_communicationLogger.extend('processIncomingMessage');
|
8040
8258
|
/**
|
8041
8259
|
* @internal
|
8042
8260
|
* Limited to Microsoft-internal use
|
@@ -8058,19 +8276,21 @@ function processIncomingMessage(evt) {
|
|
8058
8276
|
processIncomingMessageLogger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o', evt, messageSource, messageOrigin);
|
8059
8277
|
return;
|
8060
8278
|
}
|
8061
|
-
// Update our parent
|
8279
|
+
// Update our parent relationship based on this message
|
8062
8280
|
updateRelationships(messageSource, messageOrigin);
|
8063
|
-
// Handle the message
|
8281
|
+
// Handle the message if the source is from the parent
|
8064
8282
|
if (messageSource === Communication.parentWindow) {
|
8065
8283
|
handleIncomingMessageFromParent(evt);
|
8284
|
+
return;
|
8066
8285
|
}
|
8067
|
-
|
8068
|
-
|
8286
|
+
// Message proxy from child to parent
|
8287
|
+
if (shouldProcessChildMessage(messageSource, messageOrigin)) {
|
8288
|
+
handleIncomingMessageFromChild(evt, messageSource, sendMessageToParentHelper, (uuid, callback) => CommunicationPrivate.callbacks.set(uuid, callback));
|
8069
8289
|
}
|
8070
8290
|
});
|
8071
8291
|
});
|
8072
8292
|
}
|
8073
|
-
const processAuthBridgeMessageLogger =
|
8293
|
+
const processAuthBridgeMessageLogger = communication_communicationLogger.extend('processAuthBridgeMessage');
|
8074
8294
|
/**
|
8075
8295
|
* @internal
|
8076
8296
|
* Limited to Microsoft-internal use
|
@@ -8124,16 +8344,16 @@ function processAuthBridgeMessage(evt, onMessageReceived) {
|
|
8124
8344
|
Communication.topWindow = messageSource;
|
8125
8345
|
Communication.topOrigin = messageOrigin;
|
8126
8346
|
}
|
8127
|
-
// Clean up pointers to closed parent
|
8347
|
+
// Clean up pointers to closed parent
|
8128
8348
|
if (Communication.topWindow && Communication.topWindow.closed) {
|
8129
8349
|
Communication.topWindow = null;
|
8130
8350
|
Communication.topOrigin = null;
|
8131
8351
|
}
|
8132
|
-
flushMessageQueue(Communication.topWindow);
|
8352
|
+
flushMessageQueue(Communication.topWindow, Communication.topOrigin, CommunicationPrivate.topMessageQueue, 'top');
|
8133
8353
|
// Return the response to the registered callback
|
8134
8354
|
onMessageReceived(message);
|
8135
8355
|
}
|
8136
|
-
const shouldProcessIncomingMessageLogger =
|
8356
|
+
const shouldProcessIncomingMessageLogger = communication_communicationLogger.extend('shouldProcessIncomingMessage');
|
8137
8357
|
/**
|
8138
8358
|
* @hidden
|
8139
8359
|
* Validates the message source and origin, if it should be processed
|
@@ -8177,34 +8397,23 @@ function shouldProcessIncomingMessage(messageSource, messageOrigin) {
|
|
8177
8397
|
* Limited to Microsoft-internal use
|
8178
8398
|
*/
|
8179
8399
|
function updateRelationships(messageSource, messageOrigin) {
|
8180
|
-
// Determine
|
8181
|
-
//
|
8182
|
-
// For frameless windows (i.e mobile), there is no parent frame
|
8400
|
+
// Determine if the source of the message is our parent and update our window and
|
8401
|
+
// origin pointer accordingly.
|
8402
|
+
// For frameless windows (i.e mobile), there is no parent frame
|
8183
8403
|
if (!GlobalVars.isFramelessWindow &&
|
8184
8404
|
(!Communication.parentWindow || Communication.parentWindow.closed || messageSource === Communication.parentWindow)) {
|
8185
8405
|
Communication.parentWindow = messageSource;
|
8186
8406
|
Communication.parentOrigin = messageOrigin;
|
8187
8407
|
}
|
8188
|
-
|
8189
|
-
Communication.childWindow.closed ||
|
8190
|
-
messageSource === Communication.childWindow) {
|
8191
|
-
Communication.childWindow = messageSource;
|
8192
|
-
Communication.childOrigin = messageOrigin;
|
8193
|
-
}
|
8194
|
-
// Clean up pointers to closed parent and child windows
|
8408
|
+
// Clean up pointers to closed parent windows
|
8195
8409
|
if (Communication.parentWindow && Communication.parentWindow.closed) {
|
8196
8410
|
Communication.parentWindow = null;
|
8197
8411
|
Communication.parentOrigin = null;
|
8198
8412
|
}
|
8199
|
-
if (Communication.childWindow && Communication.childWindow.closed) {
|
8200
|
-
Communication.childWindow = null;
|
8201
|
-
Communication.childOrigin = null;
|
8202
|
-
}
|
8203
8413
|
// If we have any messages in our queue, send them now
|
8204
|
-
flushMessageQueue(Communication.parentWindow);
|
8205
|
-
flushMessageQueue(Communication.childWindow);
|
8414
|
+
flushMessageQueue(Communication.parentWindow, Communication.parentOrigin, CommunicationPrivate.parentMessageQueue, 'parent');
|
8206
8415
|
}
|
8207
|
-
const handleIncomingMessageFromParentLogger =
|
8416
|
+
const handleIncomingMessageFromParentLogger = communication_communicationLogger.extend('handleIncomingMessageFromParent');
|
8208
8417
|
/**
|
8209
8418
|
* @internal
|
8210
8419
|
* Limited to Microsoft-internal use
|
@@ -8336,29 +8545,6 @@ function handleIncomingMessageFromParent(evt) {
|
|
8336
8545
|
function isPartialResponse(evt) {
|
8337
8546
|
return evt.data.isPartialResponse === true;
|
8338
8547
|
}
|
8339
|
-
const handleIncomingMessageFromChildLogger = communicationLogger.extend('handleIncomingMessageFromChild');
|
8340
|
-
/**
|
8341
|
-
* @internal
|
8342
|
-
* Limited to Microsoft-internal use
|
8343
|
-
*/
|
8344
|
-
function handleIncomingMessageFromChild(evt) {
|
8345
|
-
if ('id' in evt.data && 'func' in evt.data) {
|
8346
|
-
// Try to delegate the request to the proper handler, if defined
|
8347
|
-
const message = deserializeMessageRequest(evt.data);
|
8348
|
-
const [called, result] = callHandler(message.func, message.args);
|
8349
|
-
if (called && typeof result !== 'undefined') {
|
8350
|
-
handleIncomingMessageFromChildLogger('Handler called in response to message %s from child. Returning response from handler to child, action: %s.', getMessageIdsAsLogString(message), message.func);
|
8351
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
8352
|
-
// @ts-ignore
|
8353
|
-
sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);
|
8354
|
-
}
|
8355
|
-
else {
|
8356
|
-
// No handler, proxy to parent
|
8357
|
-
handleIncomingMessageFromChildLogger('No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.', getMessageIdsAsLogString(message), message.func);
|
8358
|
-
proxyChildMessageToParent(message);
|
8359
|
-
}
|
8360
|
-
}
|
8361
|
-
}
|
8362
8548
|
/**
|
8363
8549
|
* @internal
|
8364
8550
|
* Limited to Microsoft-internal use
|
@@ -8381,9 +8567,6 @@ function getTargetMessageQueue(targetWindow) {
|
|
8381
8567
|
else if (targetWindow === Communication.parentWindow) {
|
8382
8568
|
return CommunicationPrivate.parentMessageQueue;
|
8383
8569
|
}
|
8384
|
-
else if (targetWindow === Communication.childWindow) {
|
8385
|
-
return CommunicationPrivate.childMessageQueue;
|
8386
|
-
}
|
8387
8570
|
else {
|
8388
8571
|
return [];
|
8389
8572
|
}
|
@@ -8399,9 +8582,6 @@ function getTargetOrigin(targetWindow) {
|
|
8399
8582
|
else if (targetWindow === Communication.parentWindow) {
|
8400
8583
|
return Communication.parentOrigin;
|
8401
8584
|
}
|
8402
|
-
else if (targetWindow === Communication.childWindow) {
|
8403
|
-
return Communication.childOrigin;
|
8404
|
-
}
|
8405
8585
|
else {
|
8406
8586
|
return null;
|
8407
8587
|
}
|
@@ -8417,32 +8597,10 @@ function getTargetName(targetWindow) {
|
|
8417
8597
|
else if (targetWindow === Communication.parentWindow) {
|
8418
8598
|
return 'parent';
|
8419
8599
|
}
|
8420
|
-
else if (targetWindow === Communication.childWindow) {
|
8421
|
-
return 'child';
|
8422
|
-
}
|
8423
8600
|
else {
|
8424
8601
|
return null;
|
8425
8602
|
}
|
8426
8603
|
}
|
8427
|
-
const flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');
|
8428
|
-
/**
|
8429
|
-
* @internal
|
8430
|
-
* Limited to Microsoft-internal use
|
8431
|
-
*/
|
8432
|
-
function flushMessageQueue(targetWindow) {
|
8433
|
-
const targetOrigin = getTargetOrigin(targetWindow);
|
8434
|
-
const targetMessageQueue = getTargetMessageQueue(targetWindow);
|
8435
|
-
const target = getTargetName(targetWindow);
|
8436
|
-
while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
|
8437
|
-
const messageRequest = targetMessageQueue.shift();
|
8438
|
-
if (messageRequest) {
|
8439
|
-
const request = serializeMessageRequest(messageRequest);
|
8440
|
-
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
8441
|
-
flushMessageQueueLogger('Flushing message %s from %s message queue via postMessage.', getMessageIdsAsLogString(request), target);
|
8442
|
-
targetWindow.postMessage(request, targetOrigin);
|
8443
|
-
}
|
8444
|
-
}
|
8445
|
-
}
|
8446
8604
|
/**
|
8447
8605
|
* @internal
|
8448
8606
|
* Limited to Microsoft-internal use
|
@@ -8459,45 +8617,6 @@ function waitForMessageQueue(targetWindow, callback) {
|
|
8459
8617
|
}
|
8460
8618
|
}, 100);
|
8461
8619
|
}
|
8462
|
-
/**
|
8463
|
-
* @hidden
|
8464
|
-
* Send a response to child for a message request that was from child
|
8465
|
-
*
|
8466
|
-
* @internal
|
8467
|
-
* Limited to Microsoft-internal use
|
8468
|
-
*/
|
8469
|
-
function sendMessageResponseToChild(id, uuid, args, isPartialResponse) {
|
8470
|
-
const targetWindow = Communication.childWindow;
|
8471
|
-
const response = createMessageResponse(id, uuid, args, isPartialResponse);
|
8472
|
-
const serializedResponse = serializeMessageResponse(response);
|
8473
|
-
const targetOrigin = getTargetOrigin(targetWindow);
|
8474
|
-
if (targetWindow && targetOrigin) {
|
8475
|
-
handleIncomingMessageFromChildLogger('Sending message %s to %s via postMessage, args = %o', getMessageIdsAsLogString(serializedResponse), getTargetName(targetWindow), serializedResponse.args);
|
8476
|
-
targetWindow.postMessage(serializedResponse, targetOrigin);
|
8477
|
-
}
|
8478
|
-
}
|
8479
|
-
/**
|
8480
|
-
* @hidden
|
8481
|
-
* Send a custom message object that can be sent to child window,
|
8482
|
-
* instead of a response message to a child
|
8483
|
-
*
|
8484
|
-
* @internal
|
8485
|
-
* Limited to Microsoft-internal use
|
8486
|
-
*/
|
8487
|
-
function sendMessageEventToChild(actionName, args) {
|
8488
|
-
const targetWindow = Communication.childWindow;
|
8489
|
-
/* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
|
8490
|
-
const customEvent = createMessageEvent(actionName, args);
|
8491
|
-
const targetOrigin = getTargetOrigin(targetWindow);
|
8492
|
-
// If the target window isn't closed and we already know its origin, send the message right away; otherwise,
|
8493
|
-
// queue the message and send it after the origin is established
|
8494
|
-
if (targetWindow && targetOrigin) {
|
8495
|
-
targetWindow.postMessage(customEvent, targetOrigin);
|
8496
|
-
}
|
8497
|
-
else {
|
8498
|
-
getTargetMessageQueue(targetWindow).push(customEvent);
|
8499
|
-
}
|
8500
|
-
}
|
8501
8620
|
/**
|
8502
8621
|
* @internal
|
8503
8622
|
* Limited to Microsoft-internal use
|
@@ -8544,58 +8663,6 @@ function createNestedAppAuthRequest(message) {
|
|
8544
8663
|
data: message,
|
8545
8664
|
};
|
8546
8665
|
}
|
8547
|
-
/**
|
8548
|
-
* @internal
|
8549
|
-
* Limited to Microsoft-internal use
|
8550
|
-
*/
|
8551
|
-
function createMessageResponse(id, uuid, args, isPartialResponse) {
|
8552
|
-
return {
|
8553
|
-
id: id,
|
8554
|
-
uuid: uuid,
|
8555
|
-
args: args || [],
|
8556
|
-
isPartialResponse,
|
8557
|
-
};
|
8558
|
-
}
|
8559
|
-
/**
|
8560
|
-
* @hidden
|
8561
|
-
* Creates a message object without any id and api version, used for custom actions being sent to child frame/window
|
8562
|
-
*
|
8563
|
-
* @internal
|
8564
|
-
* Limited to Microsoft-internal use
|
8565
|
-
*/
|
8566
|
-
function createMessageEvent(func, args) {
|
8567
|
-
return {
|
8568
|
-
func: func,
|
8569
|
-
args: args || [],
|
8570
|
-
};
|
8571
|
-
}
|
8572
|
-
function getMessageIdsAsLogString(message) {
|
8573
|
-
if ('uuidAsString' in message) {
|
8574
|
-
return `${message.uuidAsString} (legacy id: ${message.id})`;
|
8575
|
-
}
|
8576
|
-
else if ('uuid' in message && message.uuid !== undefined) {
|
8577
|
-
return `${message.uuid.toString()} (legacy id: ${message.id})`;
|
8578
|
-
}
|
8579
|
-
else {
|
8580
|
-
return `legacy id: ${message.id} (no uuid)`;
|
8581
|
-
}
|
8582
|
-
}
|
8583
|
-
/**
|
8584
|
-
* @internal
|
8585
|
-
* Limited to Microsoft-internal use
|
8586
|
-
*/
|
8587
|
-
function proxyChildMessageToParent(message) {
|
8588
|
-
const request = sendMessageToParentHelper(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "tasks.startTask" /* ApiName.Tasks_StartTask */), message.func, message.args, true);
|
8589
|
-
CommunicationPrivate.callbacks.set(request.uuid, (...args) => {
|
8590
|
-
if (Communication.childWindow) {
|
8591
|
-
const isPartialResponse = args.pop();
|
8592
|
-
handleIncomingMessageFromChildLogger('Message from parent being relayed to child, id: %s', getMessageIdsAsLogString(message));
|
8593
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
8594
|
-
// @ts-ignore
|
8595
|
-
sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
|
8596
|
-
}
|
8597
|
-
});
|
8598
|
-
}
|
8599
8666
|
|
8600
8667
|
;// ./src/private/logs.ts
|
8601
8668
|
/**
|
@@ -8716,6 +8783,7 @@ var UserSettingTypes;
|
|
8716
8783
|
|
8717
8784
|
|
8718
8785
|
|
8786
|
+
|
8719
8787
|
/**
|
8720
8788
|
* @hidden
|
8721
8789
|
* Upload a custom App manifest directly to both team and personal scopes.
|
@@ -8749,8 +8817,7 @@ function sendCustomMessage(actionName, args, callback) {
|
|
8749
8817
|
}
|
8750
8818
|
/**
|
8751
8819
|
* @hidden
|
8752
|
-
* Sends a custom action MessageEvent to a child iframe/window
|
8753
|
-
* Otherwise it will go to the auth popup (which becomes the child)
|
8820
|
+
* Sends a custom action MessageEvent to a child iframe/window.
|
8754
8821
|
*
|
8755
8822
|
* @param actionName - Specifies name of the custom action to be sent
|
8756
8823
|
* @param args - Specifies additional arguments passed to the action
|
@@ -8762,7 +8829,7 @@ function sendCustomMessage(actionName, args, callback) {
|
|
8762
8829
|
function sendCustomEvent(actionName, args) {
|
8763
8830
|
ensureInitialized(runtime);
|
8764
8831
|
//validate childWindow
|
8765
|
-
if (!
|
8832
|
+
if (!shouldEventBeRelayedToChild()) {
|
8766
8833
|
throw new Error('The child window has not yet been initialized or is not present');
|
8767
8834
|
}
|
8768
8835
|
sendMessageEventToChild(actionName, args);
|
@@ -9490,7 +9557,14 @@ function externalAppAuthenticationForCEA_authenticateWithSSO(appId, conversation
|
|
9490
9557
|
throw errorNotSupportedOnPlatform;
|
9491
9558
|
}
|
9492
9559
|
validateInput(appId, conversationId);
|
9493
|
-
return callFunctionInHost("externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */, [
|
9560
|
+
return callFunctionInHost("externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */, [
|
9561
|
+
appId,
|
9562
|
+
conversationId,
|
9563
|
+
authTokenRequest.authId,
|
9564
|
+
authTokenRequest.connectionName,
|
9565
|
+
authTokenRequest.claims,
|
9566
|
+
authTokenRequest.silent,
|
9567
|
+
], getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSO" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSO */), isInvokeError);
|
9494
9568
|
});
|
9495
9569
|
}
|
9496
9570
|
/**
|
@@ -9581,6 +9655,8 @@ function externalAppAuthenticationForCEA_authenticateWithSSOAndResendRequest(app
|
|
9581
9655
|
appId,
|
9582
9656
|
conversationId,
|
9583
9657
|
new SerializableActionExecuteInvokeRequest(originalRequestInfo),
|
9658
|
+
authTokenRequest.authId,
|
9659
|
+
authTokenRequest.connectionName,
|
9584
9660
|
authTokenRequest.claims,
|
9585
9661
|
authTokenRequest.silent,
|
9586
9662
|
], new ActionExecuteResponseHandler(), getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSOAndResendRequest */), isInvokeError);
|
@@ -12693,6 +12769,14 @@ function validateTab(tab) {
|
|
12693
12769
|
var AppTypes;
|
12694
12770
|
(function (AppTypes) {
|
12695
12771
|
AppTypes["edu"] = "EDU";
|
12772
|
+
/**
|
12773
|
+
* Enum to indicate apps should be filtered for base Townhall.
|
12774
|
+
*/
|
12775
|
+
AppTypes["baseTownhall"] = "BASE_TOWNHALL";
|
12776
|
+
/**
|
12777
|
+
* Enum to indicate apps should be filtered for streaming Townhall.
|
12778
|
+
*/
|
12779
|
+
AppTypes["streamingTownhall"] = "STREAMING_TOWNHALL";
|
12696
12780
|
})(AppTypes || (AppTypes = {}));
|
12697
12781
|
/**
|
12698
12782
|
* @hidden
|