@microsoft/teams-js 2.31.0-beta.1 → 2.31.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +11 -1
- package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +10 -0
- package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +11 -1
- package/dist/esm/packages/teams-js/dts/internal/hostToAppTelemetry.d.ts +51 -0
- package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +11 -0
- package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +5 -0
- package/dist/esm/packages/teams-js/dts/internal/pagesHelpers.d.ts +24 -0
- package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +23 -1
- package/dist/esm/packages/teams-js/dts/internal/uint8array-extras/uint8array-extras.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +20 -1
- package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +2 -2
- package/dist/esm/packages/teams-js/dts/internal/visualMediaHelpers.d.ts +14 -0
- package/dist/esm/packages/teams-js/dts/internal/webStorageHelpers.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +61 -61
- package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +48 -48
- package/dist/esm/packages/teams-js/dts/private/copilot/copilot.d.ts +2 -0
- package/dist/esm/packages/teams-js/dts/private/copilot/eligibility.d.ts +29 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +355 -349
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +70 -68
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +104 -105
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +41 -42
- package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +113 -114
- package/dist/esm/packages/teams-js/dts/private/files.d.ts +590 -582
- package/dist/esm/packages/teams-js/dts/private/hostEntity/hostEntity.d.ts +42 -0
- package/dist/esm/packages/teams-js/dts/private/hostEntity/tab.d.ts +134 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +19 -18
- package/dist/esm/packages/teams-js/dts/private/logs.d.ts +31 -25
- package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +147 -142
- package/dist/esm/packages/teams-js/dts/private/messageChannels/dataLayer.d.ts +39 -0
- package/dist/esm/packages/teams-js/dts/private/messageChannels/messageChannels.d.ts +28 -0
- package/dist/esm/packages/teams-js/dts/private/messageChannels/telemetry.d.ts +39 -0
- package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +31 -25
- package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +69 -70
- package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +219 -214
- package/dist/esm/packages/teams-js/dts/private/teams/fullTrust/fullTrust.d.ts +31 -0
- package/dist/esm/packages/teams-js/dts/private/teams/fullTrust/joinedTeams.d.ts +30 -0
- package/dist/esm/packages/teams-js/dts/private/teams/teams.d.ts +63 -0
- package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +192 -186
- package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +21 -2
- package/dist/esm/packages/teams-js/dts/public/app/lifecycle.d.ts +3 -2
- package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +2 -1
- package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/call.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/chat.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/adaptiveCard/adaptiveCard.d.ts +0 -4
- package/dist/esm/packages/teams-js/dts/public/dialog/adaptiveCard/bot.d.ts +3 -2
- package/dist/esm/packages/teams-js/dts/public/dialog/dialog.d.ts +0 -13
- package/dist/esm/packages/teams-js/dts/public/dialog/update.d.ts +2 -1
- package/dist/esm/packages/teams-js/dts/public/dialog/url/bot.d.ts +3 -2
- package/dist/esm/packages/teams-js/dts/public/dialog/url/parentCommunication.d.ts +2 -1
- package/dist/esm/packages/teams-js/dts/public/geoLocation/geoLocation.d.ts +3 -2
- package/dist/esm/packages/teams-js/dts/public/geoLocation/map.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +9 -9
- package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +11 -0
- package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/location.d.ts +4 -3
- package/dist/esm/packages/teams-js/dts/public/mail.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/media.d.ts +0 -3
- package/dist/esm/packages/teams-js/dts/public/meeting/appShareButton.d.ts +51 -0
- package/dist/esm/packages/teams-js/dts/public/meeting/meeting.d.ts +854 -0
- package/dist/esm/packages/teams-js/dts/public/menus.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +8 -0
- package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +2 -1
- package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/pages/appButton.d.ts +30 -0
- package/dist/esm/packages/teams-js/dts/public/pages/backStack.d.ts +44 -0
- package/dist/esm/packages/teams-js/dts/public/pages/config.d.ts +123 -0
- package/dist/esm/packages/teams-js/dts/public/pages/currentApp.d.ts +46 -0
- package/dist/esm/packages/teams-js/dts/public/pages/fullTrust.d.ts +33 -0
- package/dist/esm/packages/teams-js/dts/public/pages/pages.d.ts +253 -0
- package/dist/esm/packages/teams-js/dts/public/pages/tabs.d.ts +32 -0
- package/dist/esm/packages/teams-js/dts/public/profile.d.ts +81 -103
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +3 -0
- package/dist/esm/packages/teams-js/dts/public/search.d.ts +9 -0
- package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/settings.d.ts +4 -3
- package/dist/esm/packages/teams-js/dts/public/sharing/history.d.ts +47 -0
- package/dist/esm/packages/teams-js/dts/public/sharing/sharing.d.ts +76 -0
- package/dist/esm/packages/teams-js/dts/public/stageView/self.d.ts +23 -0
- package/dist/esm/packages/teams-js/dts/public/stageView/stageView.d.ts +81 -0
- package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +0 -8
- package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +2 -1
- package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +209 -210
- package/dist/esm/packages/teams-js/dts/public/visualMedia/image.d.ts +64 -0
- package/dist/esm/packages/teams-js/dts/public/visualMedia/visualMedia.d.ts +116 -0
- package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +20 -22
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appIdValidation.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/hostToAppTelemetry.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/uint8array-extras/uint8array-extras.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoEffectsUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/visualMediaHelpers.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/webStorageHelpers.js +1 -0
- package/dist/esm/packages/teams-js/src/private/appEntity.js +1 -1
- package/dist/esm/packages/teams-js/src/private/conversations.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/copilot.js +1 -0
- package/dist/esm/packages/teams-js/src/private/copilot/eligibility.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/externalAppCardActions.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -1
- package/dist/esm/packages/teams-js/src/private/files.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity/hostEntity.js +1 -0
- package/dist/esm/packages/teams-js/src/private/hostEntity/tab.js +1 -0
- package/dist/esm/packages/teams-js/src/private/logs.js +1 -1
- package/dist/esm/packages/teams-js/src/private/meetingRoom.js +1 -1
- package/dist/esm/packages/teams-js/src/private/messageChannels/dataLayer.js +1 -0
- package/dist/esm/packages/teams-js/src/private/messageChannels/messageChannels.js +1 -0
- package/dist/esm/packages/teams-js/src/private/messageChannels/telemetry.js +1 -0
- package/dist/esm/packages/teams-js/src/private/notifications.js +1 -1
- package/dist/esm/packages/teams-js/src/private/otherAppStateChange.js +1 -1
- package/dist/esm/packages/teams-js/src/private/remoteCamera.js +1 -1
- package/dist/esm/packages/teams-js/src/private/teams/fullTrust/fullTrust.js +1 -0
- package/dist/esm/packages/teams-js/src/private/teams/fullTrust/joinedTeams.js +1 -0
- package/dist/esm/packages/teams-js/src/private/teams/teams.js +1 -0
- package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/meeting/appShareButton.js +1 -0
- package/dist/esm/packages/teams-js/src/public/meeting/meeting.js +1 -0
- package/dist/esm/packages/teams-js/src/public/navigation.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/appButton.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages/currentApp.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages/fullTrust.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages/pages.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages/tabs.js +1 -0
- package/dist/esm/packages/teams-js/src/public/profile.js +1 -1
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
- package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
- package/dist/esm/packages/teams-js/src/public/sharing/history.js +1 -0
- package/dist/esm/packages/teams-js/src/public/sharing/sharing.js +1 -0
- package/dist/esm/packages/teams-js/src/public/stageView/self.js +1 -0
- package/dist/esm/packages/teams-js/src/public/stageView/stageView.js +1 -0
- 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/videoEffects.js +1 -1
- package/dist/esm/packages/teams-js/src/public/visualMedia/image.js +1 -0
- package/dist/esm/packages/teams-js/src/public/visualMedia/visualMedia.js +1 -0
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.d.ts +5755 -5161
- package/dist/umd/MicrosoftTeams.js +6258 -6439
- 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 +50 -1
- package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +0 -39
- package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +0 -176
- package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +0 -107
- package/dist/esm/packages/teams-js/dts/private/teams.d.ts +0 -116
- package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +0 -906
- package/dist/esm/packages/teams-js/dts/public/pages.d.ts +0 -574
- package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +0 -124
- package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +0 -104
- package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +0 -192
- package/dist/esm/packages/teams-js/src/private/copilot.js +0 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity.js +0 -1
- package/dist/esm/packages/teams-js/src/private/messageChannels.js +0 -1
- package/dist/esm/packages/teams-js/src/private/teams.js +0 -1
- package/dist/esm/packages/teams-js/src/public/meeting.js +0 -1
- package/dist/esm/packages/teams-js/src/public/pages.js +0 -1
- package/dist/esm/packages/teams-js/src/public/sharing.js +0 -1
- package/dist/esm/packages/teams-js/src/public/stageView.js +0 -1
- package/dist/esm/packages/teams-js/src/public/visualMedia.js +0 -1
- /package/dist/esm/node_modules/.pnpm/{@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5 → @rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5}/node_modules/tslib/tslib.es6.js +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as
|
1
|
+
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as e,sendAndHandleStatusAndReason as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,initializeHandlers as p}from"./handlers.js";import{ensureInitializeCalled as u,ensureInitialized as m,processAdditionalValidOrigins as c}from"./internalAPIs.js";import{getLogger as f}from"./telemetry.js";import{isNullOrUndefined as d}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as g,runWithTimeout as h,compareSDKVersions as j}from"./utils.js";import{Messages as S}from"../public/app/app.js";import{initialize as v}from"../public/authentication.js";import{FrameContexts as w}from"../public/constants.js";import{initialize as y}from"../public/dialog/dialog.js";import{initialize as z}from"../public/menus.js";import{runtime as b,applyRuntimeConfig as P,generateVersionBasedTeamsRuntimeConfig as C,mapTeamsVersionToSupportedCapabilities as x,versionAndPlatformAgnosticTeamsRuntimeConfig as D}from"../public/runtime.js";import{version as E}from"../public/version.js";import{SimpleTypeResponseHandler as V}from"./responseHandler.js";import{initialize as K}from"../public/pages/config.js";const _=f("app");function k(i,e){if(g()){return _.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return h((()=>function(i,e){return new Promise((t=>{l.initializeCalled||(l.initializeCalled=!0,p(),l.initializePromise=o(e,i).then((({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{J("Parsing %s",t);const i=JSON.parse(t);if(J("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");t&&P(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{J("Attempting to parse %s as an SDK version",t),isNaN(j(t,s))||(l.clientSupportedSDKVersion=t);const i=JSON.parse(n);if(J("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");P(i)}catch(i){if(!(i instanceof SyntaxError))throw i;P(C(l.clientSupportedSDKVersion,D,x))}}l.initializeCompleted=!0})),v(),z(),K(),y()),Array.isArray(e)&&c(e),void 0!==l.initializePromise?t(l.initializePromise):J("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),6e4,new Error("SDK initialization timed out."))}function A(i){e(i,S.AppLoaded,[E])}function F(i,t){e(i,S.ExpectedFailure,[t.reason,t.message])}function N(i,t){e(i,S.Failure,[t.reason,t.message])}function R(e){return i(this,void 0,void 0,(function*(){if(l.initializeCompleted)return H(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then((()=>H(e)))}))}function H(t){return i(this,void 0,void 0,(function*(){return m(b)&&(null===(i=b.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(S.Success,[E],new V,t).then((()=>({hasFinishedSuccessfully:!0}))):(e(t,S.Success,[E]),{hasFinishedSuccessfully:"unknown"});var i}))}const J=_.extend("initializeHelper");function L(i,e){!d(e)&&u(),a(i,e)}function O(i,e){return new Promise((n=>{m(b,w.content,w.sidePanel,w.settings,w.task,w.stage,w.meetingStage),n(t(i,"executeDeepLink",e))}))}export{k as appInitializeHelper,H as callNotifySuccessInHost,A as notifyAppLoadedHelper,F as notifyExpectedFailureHelper,N as notifyFailureHelper,R as notifySuccessHelper,O as openLinkHelper,L as registerOnThemeChangeHandlerHelper};
|
@@ -1 +1 @@
|
|
1
|
-
import{hasScriptTags as t}from"./utils.js";function
|
1
|
+
import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(!a(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${o}-${r}).`);if(e(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const o=4,r=256;function a(i){return i.length<r&&i.length>o}function e(i){return[...i].some((i=>{const t=i.charCodeAt(0);return t<32||t>126}))}function s(t){if(!(t instanceof i))throw new Error(`Potential app id (${t}) is invalid; it is not an instance of AppId class.`)}export{e as doesStringContainNonPrintableCharacters,a as isStringWithinAppIdLengthLimits,r as maximumValidAppIdLength,o as minimumValidAppIdLength,s as validateAppIdInstance,n as validateStringAsAppId};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{version as d}from"../public/version.js";import{GlobalVars as c}from"./globalVars.js";import{callHandler as u}from"./handlers.js";import{serializeMessageRequest as l,deserializeMessageResponse as g,deserializeMessageRequest as p,serializeMessageResponse as f}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as w}from"./nestedAppAuthUtils.js";import{ssrSafeWindow as m}from"./utils.js";import{UUID as h}from"./uuidObject.js";import{validateOrigin as W}from"./validOrigins.js";const v=n("communication");class M{}class b{}function y(n,i){if(b.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void F("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return q(e,i).then((o=>{o?(function(e,n){c.isFramelessWindow||M.parentWindow&&!M.parentWindow.closed&&e!==M.parentWindow?M.childWindow&&!M.childWindow.closed&&e!==M.childWindow||(M.childWindow=e,M.childOrigin=n):(M.parentWindow=e,M.parentOrigin=n);M.parentWindow&&M.parentWindow.closed&&(M.parentWindow=null,M.parentOrigin=null);M.childWindow&&M.childWindow.closed&&(M.childWindow=null,M.childOrigin=null);ne(M.parentWindow),ne(M.childWindow)}(e,i),e===M.parentWindow?B(n):e===M.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=p(e.data),[i,o]=u(n.func,n.args);i&&void 0!==o?(K("Returning message %s from child back to child, action: %s.",se(n),n.func),te(n.id,n.uuid,Array.isArray(o)?o:[o])):(K("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",se(n),n.func),C(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(M.childWindow){const i=e.pop();K("Message from parent being relayed to child, id: %s",se(n)),te(n.id,n.uuid,e,i)}})))}}(n)):F("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",n,e,i)}))}))}(n),M.currentWindow=M.currentWindow||m(),M.parentWindow=M.currentWindow.parent!==M.currentWindow.self?M.currentWindow.parent:M.currentWindow.opener,M.topWindow=M.currentWindow.top,(M.parentWindow||n)&&M.currentWindow.addEventListener("message",b.messageListener,!1),!M.parentWindow){const e=M.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));c.isFramelessWindow=!0,e.onNativeMessage=B}try{return M.parentOrigin="*",T(i,"initialize",[d,r,n]).then((([e,n,i,t])=>(w(t,M.currentWindow,{onMessage:_,sendPostMessage:N}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{M.parentOrigin=null}}function k(){M.currentWindow&&M.currentWindow.removeEventListener("message",b.messageListener,!1),M.currentWindow=null,M.parentWindow=null,M.parentOrigin=null,M.childWindow=null,M.childOrigin=null,b.parentMessageQueue=[],b.childMessageQueue=[],b.nextMessageId=0,b.callbacks.clear(),b.promiseCallbacks.clear(),b.portCallbacks.clear(),b.legacyMessageIdsToUuidMap={}}function I(e,n,...i){return T(e,n,i).then((([e])=>e))}function R(e,n,...i){return T(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function E(e,n,i,...t){return T(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function O(e,n,...i){return T(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function T(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=z(e,n,t);var s;i((s=o.uuid,new Promise((e=>{b.promiseCallbacks.set(s,e)}))))}))}function S(e){return e.map((e=>a(e)?e.serialize():e))}function j(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=S(i),[c]=yield T(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function x(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=S(i),[d]=yield T(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function A(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=z(e,n,t);return s=o.uuid,new Promise(((e,n)=>{b.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function C(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=z(e,n,s);o&&b.callbacks.set(r.uuid,o)}b.parentMessageQueue=[],b.childMessageQueue=[],b.topMessageQueue=[],b.nextMessageId=0,b.callbacks=new Map,b.promiseCallbacks=new Map,b.portCallbacks=new Map,b.legacyMessageIdsToUuidMap={};const P=v.extend("sendNestedAuthRequestToTopWindow");function N(e){const n=P,i=M.topWindow,t=function(e){const n=b.nextMessageId++,i=new h;return b.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),args:[],data:e}}(e);return n("Message %s information: %o",se(t),{actionName:t.func}),U(i,t)}const $=v.extend("sendRequestToTargetWindowHelper");function U(e,n){const i=$,t=Z(e),o=l(n);if(c.isFramelessWindow)M.currentWindow&&M.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",se(o),t),M.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=Y(e);e&&s?(i("Sending message %s to %s via postMessage",se(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",se(o),t),X(e).push(n))}return n}const Q=v.extend("sendMessageToParentHelper");function z(e,n,i){const t=Q,o=M.parentWindow,s=function(e,n,i){const t=b.nextMessageId++,o=new h;return b.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),args:i||[],apiVersionTag:e}}(e,n,i);return t("Message %s information: %o",se(s),{actionName:n,args:i}),U(o,s)}const F=v.extend("processIncomingMessage");const L=v.extend("processAuthBridgeMessage");function _(e,n){var i,t;const o=L;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?q(d,c)?(M.topWindow&&!M.topWindow.closed&&d!==M.topWindow||(M.topWindow=d,M.topOrigin=c),M.topWindow&&M.topWindow.closed&&(M.topWindow=null,M.topOrigin=null),ne(M.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const V=v.extend("shouldProcessIncomingMessage");function q(n,i){return e(this,void 0,void 0,(function*(){if(M.currentWindow&&n===M.currentWindow)return V("Should not process message because it is coming from the current window"),!1;if(M.currentWindow&&M.currentWindow.location&&i&&i===M.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return V("Message has an invalid origin of %s",i),!1}const n=yield W(e);return n||V("Message has an invalid origin of %s",i),n}}))}const D=v.extend("handleIncomingMessageFromParent");function H(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function J(e,n){const i=H(n,e.uuid);i&&n.delete(i),e.uuid?b.legacyMessageIdsToUuidMap={}:delete b.legacyMessageIdsToUuidMap[e.id]}function B(e){const n=D;if("id"in e.data&&"number"==typeof e.data.id){const i=e.data,t=g(i),o=function(e){const n=D;if(!e.uuid)return b.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=H(b.callbacks,n);if(i)return i;const t=H(b.promiseCallbacks,n);if(t)return t;const o=H(b.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",se(e))}(t);if(o){const i=b.callbacks.get(o);n("Received a response from parent for message %s",o.toString()),i&&(n("Invoking the registered callback for message %s with arguments %o",o.toString(),t.args),i.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",o.toString()),J(t,b.callbacks)));const s=b.promiseCallbacks.get(o);s&&(n("Invoking the registered promise callback for message %s with arguments %o",o.toString(),t.args),s(t.args),n("Removing registered promise callback for message %s",o.toString()),J(t,b.promiseCallbacks));const r=b.portCallbacks.get(o);if(r){let i;n("Invoking the registered port callback for message %s with arguments %o",o.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),r(i,t.args),n("Removing registered port callback for message %s",o.toString()),J(t,b.portCallbacks)}t.uuid&&(b.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const i=e.data;n('Received a message from parent %s, action: "%s"',se(i),i.func),u(i.func,i.args)}else n("Received an unknown message: %O",e)}const K=v.extend("handleIncomingMessageFromChild");function G(){return M.topWindow!==M.parentWindow}function X(e){return e===M.topWindow&&G()?b.topMessageQueue:e===M.parentWindow?b.parentMessageQueue:e===M.childWindow?b.childMessageQueue:[]}function Y(e){return e===M.topWindow&&G()?M.topOrigin:e===M.parentWindow?M.parentOrigin:e===M.childWindow?M.childOrigin:null}function Z(e){return e===M.topWindow&&G()?"top":e===M.parentWindow?"parent":e===M.childWindow?"child":null}const ee=v.extend("flushMessageQueue");function ne(e){const n=Y(e),i=X(e),t=Z(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=l(o);ee("Flushing message %s from %s message queue via postMessage.",se(i),t),e.postMessage(i,n)}}}function ie(e,n){let i;i=M.currentWindow.setInterval((()=>{0===X(e).length&&(clearInterval(i),n())}),100)}function te(e,n,i,t){const o=M.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=f(s),a=Y(o);o&&a&&o.postMessage(r,a)}function oe(e,n){const i=M.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=Y(i);i&&o?i.postMessage(t,o):X(i).push(t)}function se(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{M as Communication,x as callFunctionInHost,j as callFunctionInHostAndHandleResponse,y as initializeCommunication,A as requestPortFromParentWithVersion,O as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,E as sendAndHandleStatusAndReasonWithDefaultError,I as sendAndUnwrap,oe as sendMessageEventToChild,C as sendMessageToParent,T as sendMessageToParentAsync,N as sendNestedAuthRequestToTopWindow,k as uninitializeCommunication,ie as waitForMessageQueue};
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{version as d}from"../public/version.js";import{GlobalVars as c}from"./globalVars.js";import{callHandler as u}from"./handlers.js";import l from"./hostToAppTelemetry.js";import{serializeMessageRequest as g,deserializeMessageResponse as p,deserializeMessageRequest as f,serializeMessageResponse as m}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as w}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as h,ssrSafeWindow as W}from"./utils.js";import{UUID as v}from"./uuidObject.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return H(e,i).then((o=>{o?(function(e,n){c.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);te(y.parentWindow),te(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=f(e.data),[i,o]=u(n.func,n.args);i&&void 0!==o?(X("Returning message %s from child back to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(o)?o:[o])):(X("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),N(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(y.childWindow){const i=e.pop();X("Message from parent being relayed to child, id: %s",ae(n)),se(n.id,n.uuid,e,i)}})))}}(n)):_("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",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||W(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));c.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",S(i,"initialize",[d,r,n]).then((([e,n,i,t])=>(w(t,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},l.clearMessages()}function R(e,n,...i){return S(e,n,i).then((([e])=>e))}function E(e,n,...i){return S(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function j(e,n,...i){return S(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=L(e,n,t);var s;i((s=o.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function A(e){return e.map((e=>a(e)?e.serialize():e))}function P(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=A(i),[c]=yield S(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=A(i),[d]=yield S(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=L(e,n,t);return s=o.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);o&&k.callbacks.set(r.uuid,o)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,t=function(e){const n=k.nextMessageId++,i=new v;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:h(),args:[],data:e}}(e);return n("Message %s information: %o",ae(t),{actionName:t.func}),z(i,t)}const Q=b.extend("sendRequestToTargetWindowHelper");function z(e,n){const i=Q,t=ne(e),o=g(n);if(c.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(o),t),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",ae(o),t),Z(e).push(n))}return n}const F=b.extend("sendMessageToParentHelper");function L(e,n,i){const t=F,o=y.parentWindow,s=function(e,n,i){const t=k.nextMessageId++,o=new v;return k.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),monotonicTimestamp:h(),args:i||[],apiVersionTag:e}}(e,n,i);return l.storeCallbackInformation(s.uuid,{name:n,calledAt:s.timestamp}),t("Message %s information: %o",ae(s),{actionName:n,args:i}),z(o,s)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,t;const o=V;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?H(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),te(y.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const D=b.extend("shouldProcessIncomingMessage");function H(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return D("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return D("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||D("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=h();if("id"in e.data&&"number"==typeof e.data.id){const t=e.data,o=p(t),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const t=B(k.promiseCallbacks,n);if(t)return t;const o=B(k.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",ae(e))}(o);if(s){const t=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),l.handlePerformanceMetrics(s,o,n,i),t&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),o.args),t.apply(null,[...o.args,o.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(o,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),o.args),r(o.args),n("Removing registered promise callback for message %s",s.toString()),K(o,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),o.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,o.args),n("Removing registered port callback for message %s",s.toString()),K(o,k.portCallbacks)}o.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const t=e.data;l.handleOneWayPerformanceMetrics(t,n,i),n('Received a message from parent %s, action: "%s"',ae(t),t.func),u(t.func,t.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function te(e){const n=ee(e),i=Z(e),t=ne(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=g(o);ie("Flushing message %s from %s message queue via postMessage.",ae(i),t),e.postMessage(i,n)}}}function oe(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,t){const o=y.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=m(s),a=ee(o);o&&a&&o.postMessage(r,a)}function re(e,n){const i=y.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=ee(i);i&&o?i.postMessage(t,o):Z(i).push(t)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,P as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,j as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,S as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,oe as waitForMessageQueue};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,getApiVersionTag as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{sendMessageToParent as o,Communication as a,sendMessageEventToChild as d}from"./communication.js";import{ensureInitialized as t}from"./internalAPIs.js";import{isNullOrUndefined as i}from"./typeCheckUtilities.js";import{_initialize as s}from"../public/pages/backStack.js";const u=n("handlers");class c{static initializeHandlers(){c.handlers.themeChange=v,c.handlers.load=j,c.handlers.beforeUnload=S,s()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null;const h=u.extend("callHandler");function H(e,n){const r=c.handlers[e];if(r){h("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a.childWindow?(d(e,n),[!1,void 0]):(h("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...a])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function U(e,n,r,o,a){r&&t(l,...o),a&&a(),p(e,n,r)}function T(e,n){c.themeChangeHandler=n,!i(n)&&o(e,"registerHandler",["themeChange"])}function v(e){c.themeChangeHandler&&c.themeChangeHandler(e),a.childWindow&&d("themeChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function C(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function w(e,n){c.loadHandler=n,!i(n)&&o(e,"registerHandler",["load"])}function j(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),a.childWindow&&d("load",[n])):c.loadHandler&&(c.loadHandler(e),a.childWindow&&d("load",[e]))}function O(e,n){c.beforeUnloadHandler=n,!i(n)&&o(e,"registerHandler",["beforeUnload"])}function S(){return e(this,void 0,void 0,(function*(){const e=()=>{o(r("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),a.childWindow?d("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(a.childWindow?d("beforeUnload"):e())}))}function W(e){c.beforeSuspendOrTerminateHandler=e,!i(e)&&o(r("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function _(e){c.resumeHandler=e,!i(e)&&o(r("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{H as callHandler,b as doesHandlerExist,C as handleHostToAppPerformanceMetrics,v as handleThemeChange,f as initializeHandlers,W as registerBeforeSuspendOrTerminateHandler,O as registerBeforeUnloadHandler,p as registerHandler,U as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,w as registerOnLoadHandler,_ as registerOnResumeHandler,T as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{handleHostToAppPerformanceMetrics as e}from"./handlers.js";class a{static storeCallbackInformation(e,t){a.callbackInformation.set(e,t)}static clearMessages(){a.callbackInformation.clear()}static deleteMessageInformation(e){a.callbackInformation.delete(e)}static handleOneWayPerformanceMetrics(a,t,n){const o=a.monotonicTimestamp;o&&n?e({actionName:a.func,messageDelay:n-o,requestStartedAt:o}):t("Unable to send performance metrics for event %s",a.func)}static handlePerformanceMetrics(t,n,o,s){const c=a.callbackInformation.get(t);c&&n.monotonicTimestamp&&s?(e({actionName:c.name,messageDelay:s-n.monotonicTimestamp,requestStartedAt:c.calledAt}),a.deleteMessageInformation(t)):o("Unable to send performance metrics for callback %s with arguments %o",t.toString(),n.args)}}a.callbackInformation=new Map;export{a as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{CartStatus as e}from"../public/marketplace.js";import t from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(r){try{return r.cartItems=s(r.cartItems),r}catch(r){throw new Error("Error deserializing cart")}}function s(r){return r.map((r=>{if(r.imageURL){const e=new URL(r.imageURL);r.imageURL=e}return r.accessories&&(r.accessories=s(r.accessories)),r}))}const i=e=>{try{return e.map((e=>{const{imageURL:t,accessories:o}=e,s=r(e,["imageURL","accessories"]),n=Object.assign({},s);return t&&(n.imageURL=t.href),o&&(n.accessories=i(o)),n}))}catch(r){throw new Error("Error serializing cart items")}};function n(r){if(!Array.isArray(r)||0===r.length)throw new Error("cartItems must be a non-empty array");for(const e of r)c(e),a(e.accessories)}function a(r){if(null!=r){if(!Array.isArray(r)||0===r.length)throw new Error("CartItem.accessories must be a non-empty array");for(const e of r){if(e.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");c(e)}}}function c(r){if(!r.id)throw new Error("cartItem.id must not be empty");if(!r.name)throw new Error("cartItem.name must not be empty");u(r.price),f(r.quantity)}function m(r){if(null!=r){if(!r)throw new Error("id must not be empty");if(!1===t(r))throw new Error("id must be a valid UUID")}}function u(r){if("number"!=typeof r||r<0)throw new Error(`price ${r} must be a number not less than 0`);if(parseFloat(r.toFixed(3))!==r)throw new Error(`price ${r} must have at most 3 decimal places`)}function f(r){if("number"!=typeof r||r<=0||parseInt(r.toString())!==r)throw new Error(`quantity ${r} must be an integer greater than 0`)}function p(r){if(!Object.values(e).includes(r))throw new Error(`cartStatus ${r} is not valid`)}export{o as deserializeCart,s as deserializeCartItems,i as serializeCartItems,a as validateAccessoryItems,c as validateBasicCartItem,n as validateCartItems,p as validateCartStatus,u as validatePrice,f as validateQuantity,m as validateUuid};
|
@@ -1 +1 @@
|
|
1
|
-
import{__rest as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__rest as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{UUID as t}from"./uuidObject.js";const s=t=>{const{uuid:s}=t,u=i(t,["uuid"]),n=null==s?void 0:s.toString();return Object.assign(Object.assign({},u),{uuidAsString:n})},u=s=>{const{uuidAsString:u}=s,n=i(s,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:u?new t(u):void 0})},n=s=>{const{uuidAsString:u}=s,n=i(s,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:u?new t(u):void 0})},r=t=>{const{uuid:s}=t,u=i(t,["uuid"]),n=null==s?void 0:s.toString();return Object.assign(Object.assign({},u),{uuidAsString:n})};export{u as deserializeMessageRequest,n as deserializeMessageResponse,s as serializeMessageRequest,r as serializeMessageResponse};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{AppId as t}from"../public/appId.js";import{FrameContexts as e,errorNotSupportedOnPlatform as n}from"../public/constants.js";import{isSupported as i}from"../public/pages/pages.js";import{runtime as r}from"../public/runtime.js";import{sendAndHandleStatusAndReasonWithDefaultError as o,sendMessageToParent as s,sendAndUnwrap as a,sendAndHandleStatusAndReason as c}from"./communication.js";import{ensureInitialized as p}from"./internalAPIs.js";import{isSupported as u}from"../public/pages/backStack.js";import{isSupported as g}from"../public/pages/tabs.js";import{isSupported as f}from"../public/pages/config.js";const m="v2";function b(t,s){return new Promise((a=>{if(p(r,e.content,e.sidePanel,e.settings,e.remove,e.task,e.stage,e.meetingStage),!i())throw n;a(o(t,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",s))}))}function w(t){return new Promise((e=>{if(p(r),!u())throw n;e(o(t,"navigateBack","Back navigation is not supported in the current client or context."))}))}function d(t,e){return new Promise((i=>{if(p(r),!g())throw n;i(o(t,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",e))}))}function l(t,e){if(p(r),!i())throw n;s(t,"returnFocus",[e])}function h(t,e){return new Promise((i=>{if(p(r),!g())throw n;i(a(t,"getTabInstances",e))}))}function P(t,e){return new Promise((i=>{if(p(r),!g())throw n;i(a(t,"getMruTabInstances",e))}))}function I(t,o){if(p(r,e.content,e.sidePanel,e.meetingStage),!i())throw n;s(t,"shareDeepLink",[o.subPageId,o.subPageLabel,o.subPageWebUrl])}function j(t,o){if(p(r,e.content),!i())throw n;s(t,"setFrameContext",[o])}function v(t,i){if(p(r,e.settings,e.remove),!f())throw n;s(t,"settings.setValidityState",[i])}function S(t){return new Promise((o=>{if(p(r,e.content,e.settings,e.remove,e.sidePanel),!i())throw n;o(a(t,"settings.getSettings"))}))}function U(t,i){return new Promise((o=>{if(p(r,e.content,e.settings,e.sidePanel),!f())throw n;o(c(t,"settings.setSettings",i))}))}function k(e){return e.appId instanceof t}function T(e){return Object.assign(Object.assign({},e),{appId:new t(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function L(t){return Object.assign(Object.assign({},t),{appId:t.appId.toString(),webUrl:t.webUrl?t.webUrl.toString():void 0})}export{w as backStackNavigateBackHelper,U as configSetConfigHelper,v as configSetValidityStateHelper,L as convertAppNavigationParametersToNavigateToAppParams,T as convertNavigateToAppParamsToAppNavigationParameters,S as getConfigHelper,P as getMruTabInstancesHelper,h as getTabInstancesHelper,k as isAppNavigationParametersObject,b as navigateCrossDomainHelper,m as pagesTelemetryVersionNumber,l as returnFocusHelper,j as setCurrentFrameHelper,I as shareDeepLinkHelper,d as tabsNavigateToTabHelper};
|
@@ -0,0 +1 @@
|
|
1
|
+
const r=Object.prototype.toString,t="[object Uint8Array]",e="[object ArrayBuffer]",n={utf8:new globalThis.TextDecoder("utf8")};function o(t,e,n){return!!t&&(t.constructor===e||r.call(t)===n)}function c(r){return o(r,Uint8Array,t)}function i(r){if("string"!=typeof r)throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}function u(r){return i(r),Uint8Array.from(globalThis.atob(r.replaceAll("-","+").replaceAll("_","/")),(r=>{const t=r.codePointAt(0);if(void 0===t)throw new Error("Invalid character encountered");return t}))}function f(r,t="utf8"){var e;return l(r),null!==(e=n[t])&&void 0!==e||(n[t]=new globalThis.TextDecoder(t)),n[t].decode(r)}function a(r){return i(r),f(u(r))}function l(r){if(!function(r){return c(r)||function(r){return o(r,ArrayBuffer,e)}(r)}(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}export{l as assertUint8ArrayOrArrayBuffer,a as base64ToString,u as base64ToUint8Array,c as isUint8Array,f as uint8ArrayToString};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{minAdaptiveCardVersion as t}from"../public/constants.js";import{base64ToString as e}from"./uint8array-extras/uint8array-extras.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import n from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(t){return(t,e)=>{if(!t)throw new Error(e)}}function i(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const r=t.split("."),n=e.split(".");function o(t){return/^\d+$/.test(t)}if(!r.every(o)||!n.every(o))return NaN;for(;r.length<n.length;)r.push("0");for(;n.length<r.length;)n.push("0");for(let t=0;t<r.length;++t)if(Number(r[t])!=Number(n[t]))return Number(r[t])>Number(n[t])?1:-1;return 0}function c(){return r()}function u(t){return Object.keys(t).forEach((e=>{null!==t[e]&&void 0!==t[e]&&"object"==typeof t[e]&&u(t[e])})),Object.freeze(t)}function s(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(void 0,t)})).catch((t=>{e&&e(t)})),n}function a(t,e,...r){const n=t(...r);return n.then((()=>{e&&e(null)})).catch((t=>{e&&e(t)})),n}function f(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(null,t)})).catch((t=>{e&&e(t,null)})),n}function l(t,e,r){return new Promise(((n,o)=>{const i=setTimeout(o,e,r);t().then((t=>{clearTimeout(i),n(t)})).catch((t=>{clearTimeout(i),o(t)}))}))}function p(t){const e=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(t.appId.toString())+"/"+encodeURIComponent(t.pageId));return t.webUrl&&e.searchParams.append("webUrl",t.webUrl.toString()),(t.chatId||t.channelId||t.subPageId)&&e.searchParams.append("context",JSON.stringify({chatId:t.chatId,channelId:t.channelId,subEntityId:t.subPageId})),e.toString()}function d(e){return!(i(`${e.majorVersion}.${e.minorVersion}`,`${t.majorVersion}.${t.minorVersion}`)>=0)}function m(t){return"https:"===t.protocol}function h(t,r){return new Promise(((n,o)=>{if(t||o("MimeType cannot be null or empty."),r||o("Base64 string cannot be null or empty."),t.startsWith("image/")){const o=e(r),i=new Uint8Array(o.length);for(let t=0;t<o.length;t++)i[t]=o.charCodeAt(t);n(new Blob([i],{type:t}))}const i=e(r);n(new Blob([i],{type:t}))}))}function w(t){return new Promise(((e,r)=>{0===t.size&&r(new Error("Blob cannot be empty."));const n=new FileReader;n.onloadend=()=>{n.result?e(n.result.toString().split(",")[1]):r(new Error("Failed to read the blob"))},n.onerror=()=>{r(n.error)},n.readAsDataURL(t)}))}function b(){if(g())throw new Error("window object undefined at SSR check");return window}function g(){return"undefined"==typeof window}function y(t,e){if(I(t)||!function(t){return t.length<256&&t.length>4}(t)||!function(t){for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<32||r>126)return!1}return!0}(t))throw e||new Error("id is not valid.")}function j(t,e){const r=t.toString().toLocaleLowerCase();if(I(r))throw new Error("Invalid Url");if(r.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!m(t))throw new Error("Url should be a valid https url")}function E(t){const e=document.createElement("a");return e.href=t,new URL(e.href)}function I(t){return new RegExp(`${/<script[^>]*>|<script[^&]*>|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|<\/script[^&]*>|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function v(t){if(!t)throw new Error("id must not be empty");if(!1===n(t))throw new Error("id must be a valid UUID")}const U=!!performance&&"now"in performance;function O(){return U?performance.now()+performance.timeOrigin:void 0}function N(t,e=0){if(e>1e3)return!1;if(void 0===t||"boolean"==typeof t||"number"==typeof t||"bigint"==typeof t||"string"==typeof t||null===t)return!0;if(Array.isArray(t))return t.every((t=>N(t,e+1)));return!("object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t)||Object.getPrototypeOf(t)!==Object.prototype&&null!==Object.getPrototypeOf(t))&&Object.keys(t).every((r=>N(t[r],e+1)))}export{h as base64ToBlob,s as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,f as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,a as callCallbackWithSdkErrorFromPromiseAndReturnPromise,i as compareSDKVersions,p as createTeamsAppLink,u as deepFreeze,E as fullyQualifyUrlString,c as generateGUID,w as getBase64StringFromBlob,O as getCurrentTimestamp,o as getGenericOnCompleteHandler,I as hasScriptTags,g as inServerSideRenderingEnvironment,d as isHostAdaptiveCardSchemaVersionUnsupported,N as isPrimitiveOrPlainObject,m as isValidHttpsURL,l as runWithTimeout,b as ssrSafeWindow,y as validateId,j as validateUrl,v as validateUuid};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{validOriginsCdnEndpoint as t,validOriginsFallback as r}from"./constants.js";import{GlobalVars as n}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{inServerSideRenderingEnvironment as o,isValidHttpsURL as e}from"./utils.js";let l=[];const a=s("validateOrigin");function u(){return i(this,void 0,void 0,(function*(){yield d()}))}function d(){return i(this,void 0,void 0,(function*(){return 0!==l.length?l:o()?(l=r,r):fetch(t).then((i=>{if(!i.ok)throw new Error("Invalid Response from Fetch Call");return i.json().then((i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return a("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return l=i.validOrigins,l;throw new Error("Valid Origins List Is Invalid")}))})).catch((i=>(a("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),l=r,l)))}))}function c(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function f(i){return d().then((t=>{if(!e(i))return a("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some((i=>c(i,r))))return!0;for(const i of n.additionalValidOrigins){if(c("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return a("Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o",i,t,n.additionalValidOrigins),!1}))}export{u as prefetchOriginsFromCDN,f as validateOrigin};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{errorNotSupportedOnPlatform as t}from"../public/constants.js";import{EffectFailureReason as r}from"../public/videoEffects.js";import{sendMessageToParent as i}from"./communication.js";import{registerHandler as o}from"./handlers.js";import{getApiVersionTag as a}from"./telemetry.js";import{inServerSideRenderingEnvironment as n,ssrSafeWindow as s}from"./utils.js";const d="v2";function h(t,r,i,o){var a,s;return e(this,void 0,void 0,(function*(){const e=f();!n()&&(null===(s=null===(a=window.chrome)||void 0===a?void 0:a.webview)||void 0===s||s.registerTextureStream(t,e)),l(yield u(t,i,o),new m(i,r),e.writable)}))}function c(t,r,i,o){var a,s;return e(this,void 0,void 0,(function*(){const e=f();!n()&&(null===(s=null===(a=window.chrome)||void 0===a?void 0:a.webview)||void 0===s||s.registerTextureStream(t,e)),l(yield u(t,i,o),new v(i,r),e.writable)}))}function u(r,i,o){return e(this,void 0,void 0,(function*(){if(n())throw t;const e=s().chrome;try{null==o||o.reportGettingTextureStream(r);const t=(yield e.webview.getTextureStream(r)).getVideoTracks();if(0===t.length)throw new Error(`No video track in stream ${r}`);return null==o||o.reportTextureStreamAcquired(),t[0]}catch(e){throw i(`Failed to get video track from stream ${r}, error: ${e}`),new Error(`Internal error: can't get video track from stream ${r}`)}}))}function f(){if(n())throw t;const e=window.MediaStreamTrackGenerator;if(!e)throw t;return new e({kind:"video"})}function l(e,t,r){new(0,s().MediaStreamTrackProcessor)({track:e}).readable.pipeThrough(new TransformStream(t)).pipeTo(r)}class m{constructor(t,r){this.notifyError=t,this.videoFrameHandler=r,this.transform=(t,r)=>e(this,void 0,void 0,(function*(){const e=t.timestamp;if(null!==e)try{const i=yield this.videoFrameHandler({videoFrame:t}),o=new VideoFrame(i,{timestamp:e});r.enqueue(o),t.close(),i.close()}catch(e){t.close(),this.notifyError(e)}else this.notifyError("timestamp of the original video frame is null")}))}}class w{constructor(e,t){if(this.headerBuffer=e,this.notifyError=t,this.ONE_TEXTURE_INPUT_ID=1869900081,this.INVALID_HEADER_ERROR="Invalid video frame header",this.UNSUPPORTED_LAYOUT_ERROR="Unsupported texture layout",this.headerDataView=new Uint32Array(e),this.headerDataView.length<8)throw this.notifyError(this.INVALID_HEADER_ERROR),new Error(this.INVALID_HEADER_ERROR);if(this.headerDataView[0]!==this.ONE_TEXTURE_INPUT_ID)throw this.notifyError(this.UNSUPPORTED_LAYOUT_ERROR),new Error(this.UNSUPPORTED_LAYOUT_ERROR)}get oneTextureLayoutId(){return this.headerDataView[0]}get version(){return this.headerDataView[1]}get frameRowOffset(){return this.headerDataView[2]}get frameFormat(){return this.headerDataView[3]}get frameWidth(){return this.headerDataView[4]}get frameHeight(){return this.headerDataView[5]}get multiStreamHeaderRowOffset(){return this.headerDataView[6]}get multiStreamCount(){return this.headerDataView[7]}}class E{constructor(e,t){this.metadataMap=new Map,this.AUDIO_INFERENCE_RESULT_STREAM_ID=828664161,this.ATTRIBUTE_ID_MAP_STREAM_ID=1296320833;const r=new Uint32Array(e);for(let i=0,o=0;i<t;i++){const t=r[o++],i=r[o++],a=r[o++],n=new Uint8Array(e,i,a);this.metadataMap.set(t,n)}}get audioInferenceResult(){return this.metadataMap.get(this.AUDIO_INFERENCE_RESULT_STREAM_ID)}get attributes(){const e=this.metadataMap.get(this.ATTRIBUTE_ID_MAP_STREAM_ID);if(void 0===e)return;const t=new Map,r=new TextDecoder("utf-8");let i=0;const o=e[i]+(e[++i]<<8)+(e[++i]<<16)+(e[++i]<<24);for(let a=0;a<o&&i<e.length-1;a++){const o=e[++i]+(e[++i]<<8)+(e[++i]<<16)+(e[++i]<<24),a=e.findIndex(((e,t,r)=>0==e&&t>i)),n=r.decode(e.slice(++i,a)),s=this.metadataMap.get(o);void 0!==s&&t.set(n,s);i=a+(4-(a-i)%4-1)}return t}}class v{constructor(r,i){this.notifyError=r,this.videoFrameHandler=i,this.shouldDiscardAudioInferenceResult=!1,this.transform=(t,r)=>e(this,void 0,void 0,(function*(){const e=t.timestamp;if(null!==e)try{const{videoFrame:i,metadata:{audioInferenceResult:o,attributes:a}={}}=yield this.extractVideoFrameAndMetadata(t),n=yield this.videoFrameHandler({videoFrame:i,audioInferenceResult:o,attributes:a}),s=new VideoFrame(n,{timestamp:e});r.enqueue(s),i.close(),t.close(),n.close()}catch(e){t.close(),this.notifyError(e)}else this.notifyError("timestamp of the original video frame is null")})),this.extractVideoFrameAndMetadata=r=>e(this,void 0,void 0,(function*(){if(n())throw t;if("NV12"!==r.format)throw this.notifyError("Unsupported video frame pixel format"),new Error("Unsupported video frame pixel format");const e={x:0,y:0,width:r.codedWidth,height:2},i=new ArrayBuffer(e.width*e.height*3/2);yield r.copyTo(i,{rect:e});const o=new w(i,this.notifyError),a={x:0,y:o.multiStreamHeaderRowOffset,width:r.codedWidth,height:r.codedHeight-o.multiStreamHeaderRowOffset},s=new ArrayBuffer(a.width*a.height*3/2);yield r.copyTo(s,{rect:a});const d=new E(s,o.multiStreamCount);return{videoFrame:new VideoFrame(r,{timestamp:r.timestamp,visibleRect:{x:0,y:o.frameRowOffset,width:o.frameWidth,height:o.frameHeight}}),metadata:{audioInferenceResult:this.shouldDiscardAudioInferenceResult?void 0:d.audioInferenceResult,attributes:d.attributes}}})),o(a(d,"videoEffectsUtils.transformerWithMetadata.constructor"),"video.mediaStream.audioInferenceDiscardStatusChange",(({discardAudioInferenceResult:e})=>{this.shouldDiscardAudioInferenceResult=e}))}}function p(e,t){return(o,n)=>{null==t||t.reportApplyingVideoEffect(o||"",n),e(o,n).then((()=>{null==t||t.reportVideoEffectChanged(o||"",n),i(a(d,"videoEffectsUtils.reportVideoEffectChanged"),"video.videoEffectReadiness",[!0,o,void 0,n])})).catch((e=>{const t=e in r?e:r.InitializationFailure;i(a(d,"videoEffectsUtils.effectFailure"),"video.videoEffectReadiness",[!1,o,t,n])}))}}export{p as createEffectParameterChangeCallback,h as processMediaStream,c as processMediaStreamWithMetadata};
|
@@ -0,0 +1 @@
|
|
1
|
+
const o=10;export{o as maxVisualMediaSelectionLimit};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{__awaiter as p}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getContext as l}from"../public/app/app.js";let t=null;function o(){return p(this,void 0,void 0,(function*(){return null===t&&(t=(yield l()).app.host.name),t}))}export{t as cachedHostName,o as getCachedHostName};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as t}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as
|
1
|
+
import{sendMessageToParent as t}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as p,errorNotSupportedOnPlatform as i}from"../public/constants.js";import{runtime as e}from"../public/runtime.js";function o(o,a,m,c){if(n(e,p.content),!l())throw i;if(!o||0==o.length)throw new Error("[appEntity.selectAppEntity] threadId name cannot be null or empty");if(!c)throw new Error("[appEntity.selectAppEntity] Callback cannot be null");t(r("v1","appEntity.selectAppEntity"),"appEntity.selectAppEntity",[o,a,m],c)}function l(){return!(!n(e)||!e.supports.appEntity)}export{l as isSupported,o as selectAppEntity};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendAndHandleStatusAndReason as n,sendMessageToParent as o,sendAndUnwrap as t}from"../internal/communication.js";import{registerHandler as e,removeHandler as r}from"../internal/handlers.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as s}from"../internal/telemetry.js";import{FrameContexts as a,errorNotSupportedOnPlatform as c}from"../public/constants.js";import{runtime as v}from"../public/runtime.js";const l="v1";
|
1
|
+
import{sendAndHandleStatusAndReason as n,sendMessageToParent as o,sendAndUnwrap as t}from"../internal/communication.js";import{registerHandler as e,removeHandler as r}from"../internal/handlers.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as s}from"../internal/telemetry.js";import{FrameContexts as a,errorNotSupportedOnPlatform as c}from"../public/constants.js";import{runtime as v}from"../public/runtime.js";const l="v1";function d(o){return new Promise((t=>{if(i(v,a.content),!C())throw c;const r=n(s(l,"conversations.openConversation"),"conversations.openConversation",{title:o.title,subEntityId:o.subEntityId,conversationId:o.conversationId,channelId:o.channelId,entityId:o.entityId});o.onStartConversation&&e(s(l,"conversations.registerStartConversationHandler"),"startConversation",((n,t,e,r)=>{var i;return null===(i=o.onStartConversation)||void 0===i?void 0:i.call(o,{subEntityId:n,conversationId:t,channelId:e,entityId:r})})),o.onCloseConversation&&e(s(l,"conversations.registerCloseConversationHandler"),"closeConversation",((n,t,e,r)=>{var i;return null===(i=o.onCloseConversation)||void 0===i?void 0:i.call(o,{subEntityId:n,conversationId:t,channelId:e,entityId:r})})),t(r)}))}function m(){if(i(v,a.content),!C())throw c;o(s(l,"conversations.closeConversation"),"conversations.closeConversation"),r("startConversation"),r("closeConversation")}function u(){return new Promise((n=>{if(i(v),!C())throw c;n(t(s(l,"conversations.getChatMember"),"getChatMembers"))}))}function C(){return!(!i(v)||!v.supports.conversations)}export{m as closeConversation,u as getChatMembers,C as isSupported,d as openConversation};
|
@@ -0,0 +1 @@
|
|
1
|
+
import*as i from"./eligibility.js";export{i as eligibility};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{__awaiter as i}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndUnwrap as o}from"../../internal/communication.js";import{ensureInitialized as r}from"../../internal/internalAPIs.js";import{getLogger as t,getApiVersionTag as n}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as e}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as s}from"../../public/runtime.js";const p=t("copilot");function a(){var i,o;return r(s)&&(!!(null===(i=s.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation)||!!(null===(o=s.supports.copilot)||void 0===o?void 0:o.eligibility))}function m(){var t,m;return i(this,void 0,void 0,(function*(){if(r(s),!a())throw new Error(`Error code: ${e.errorCode}, message: Not supported on platform`);if(null===(t=s.hostVersionsInfo)||void 0===t?void 0:t.appEligibilityInformation)return p("Eligibility information is already available on runtime."),s.hostVersionsInfo.appEligibilityInformation;p("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(n("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo");if(l(i))throw new Error(`Error code: ${i.errorCode}, message: ${null!==(m=i.message)&&void 0!==m?m:"Failed to get eligibility information from the host."}`);if(!function(i){if(void 0===i.ageGroup||void 0===i.cohort||void 0===i.userClassification||void 0===i.isCopilotEligible||void 0===i.isCopilotEnabledRegion||void 0===i.isOptedOutByAdmin)return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return i}))}export{m as getEligibilityInfo,a as isSupported};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{ResponseHandler as n}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{validateId as o,validateUrl as
|
1
|
+
import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{ResponseHandler as n}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{isPrimitiveOrPlainObject as r,validateId as o,validateUrl as s}from"../internal/utils.js";import{FrameContexts as a,errorNotSupportedOnPlatform as u}from"../public/constants.js";import{runtime as c}from"../public/runtime.js";import{AppId as h}from"../public/appId.js";const l="v2";class p{constructor(e){this.invokeRequest=e}serialize(){return this.invokeRequest}}function f(e){const t=e;return t.responseType===R.ActionExecuteInvokeResponse&&void 0!==t.value&&void 0!==t.statusCode&&void 0!==t.type}const m="Action.Execute";var d,R,A;!function(e){e.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",e.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(d||(d={})),function(e){e.ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",e.QueryMessageExtensionResponse="QueryMessageExtensionResponse"}(R||(R={}));class x extends n{validate(e){return f(e)}deserialize(e){return e}}function w(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(A).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)}function E(e){e.requestType===d.ActionExecuteInvokeRequest?v(e):e.requestType===d.QueryMessageExtensionRequest&&function(e){if(e.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(e.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const t of e.parameters){if(t.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(t.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}(e)}function v(e){if(e.type!==m){throw{errorCode:A.INTERNAL_ERROR,message:`Invalid action type ${e.type}. Action type must be "${m}"`}}if(!r(e.data)){throw{errorCode:A.INTERNAL_ERROR,message:`Invalid data type ${typeof e.data}. Data must be a primitive or a plain object.`}}}function g(n,r,o){if(t(c,a.content),!j())throw u;const s=new h(n);return E(o),e(i(l,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[s.toString(),o,r.url.href,r.width,r.height,r.isExternal]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))}function I(n,r){if(t(c,a.content),!j())throw u;const o=new h(n);return e(i(l,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[o.toString(),r.claims,r.silent]).then((([e,t])=>{if(!e)throw t}))}function y(n,r,o){if(t(c,a.content),!j())throw u;const s=new h(n);return E(o),e(i(l,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[s.toString(),o,r.claims,r.silent]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))}function q(n,r,s){if(t(c,a.content),!j())throw u;return o(n,new Error("titleId is Invalid.")),o(r,new Error("oauthConfigId is Invalid.")),e(i(l,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[n,r,s.width,s.height,s.isExternal]).then((([e,t])=>{if(!e)throw t}))}function S(n,r,h){if(t(c,a.content),!j())throw u;return o(n,new Error("titleId is Invalid.")),r&&s(r),e(i(l,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[n,null==r?void 0:r.toString(),null==h?void 0:h.width,null==h?void 0:h.height,null==h?void 0:h.isExternal]).then((([e,t])=>{if(!e)throw t}))}function j(){return!(!t(c)||!c.supports.externalAppAuthentication)}!function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(A||(A={}));export{m as ActionExecuteInvokeRequestType,x as ActionExecuteResponseHandler,A as InvokeErrorCode,R as InvokeResponseType,d as OriginalRequestType,p as SerializableActionExecuteInvokeRequest,g as authenticateAndResendRequest,q as authenticateWithOauth2,S as authenticateWithPowerPlatformConnectorPlugins,I as authenticateWithSSO,y as authenticateWithSSOAndResendRequest,f as isActionExecuteResponse,w as isInvokeError,j as isSupported,v as validateActionExecuteInvokeRequest};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{validateAppIdInstance as n}from"../internal/appIdValidation.js";import{callFunctionInHost as e,callFunctionInHostAndHandleResponse as i}from"../internal/communication.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{validateId as u}from"../internal/utils.js";import{FrameContexts as a,errorNotSupportedOnPlatform as p}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{validateActionExecuteInvokeRequest as c,ActionExecuteResponseHandler as h,SerializableActionExecuteInvokeRequest as l,isInvokeError as A}from"./externalAppAuthentication.js";const m="v2";function d(n,i,u){return t(this,void 0,void 0,(function*(){if(r(s,a.content),!v())throw p;return w(n,i),e("externalAppAuthenticationForCEA.authenticateWithSSO",[n,i,u.claims,u.silent],o(m,"externalAppAuthenticationForCEA.authenticateWithSSO"),A)}))}function f(n,i,u){return t(this,void 0,void 0,(function*(){if(r(s,a.content),!v())throw p;return w(n,i),e("externalAppAuthenticationForCEA.authenticateWithOauth",[n,i,u.url.href,u.width,u.height,u.isExternal],o(m,"externalAppAuthenticationForCEA.authenticateWithOauth"),A)}))}function x(n,e,u,d){return t(this,void 0,void 0,(function*(){if(r(s,a.content),!v())throw p;return w(n,e),c(d),i("externalAppAuthenticationForCEA.authenticateAndResendRequest",[n,e,new l(d),u.url.href,u.width,u.height,u.isExternal],new h,o(m,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),A)}))}function E(n,e,u,d){return t(this,void 0,void 0,(function*(){if(r(s,a.content),!v())throw p;return w(n,e),c(d),i("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[n,e,new l(d),u.claims,u.silent],new h,o(m,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),A)}))}function v(){return!(!r(s)||!s.supports.externalAppAuthenticationForCEA)}function w(t,e){u(e,new Error("conversation id is not valid.")),n(t)}export{x as authenticateAndResendRequest,f as authenticateWithOauth,d as authenticateWithSSO,E as authenticateWithSSOAndResendRequest,v as isSupported,w as validateInput};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParentAsync as
|
1
|
+
import{sendMessageToParentAsync as n}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{getApiVersionTag as e}from"../internal/telemetry.js";import{FrameContexts as r,errorNotSupportedOnPlatform as i}from"../public/constants.js";import{runtime as o}from"../public/runtime.js";import{AppId as p}from"../public/appId.js";var c,s;function a(c,s){if(t(o,r.content),!A())throw i;const a=new p(c);return n(e("v2","externalAppCardActions.processActionSubmit"),"externalAppCardActions.processActionSubmit",[a.toString(),s]).then((([n,t])=>{if(!n)throw t}))}function l(c,s,a){if(t(o,r.content),!A())throw i;const l=new p(c);return n(e("v2","externalAppCardActions.processActionOpenUrl"),"externalAppCardActions.processActionOpenUrl",[l.toString(),s.href,a]).then((([n,t])=>{if(n)throw n;return t}))}function A(){return!(!t(o)||!o.supports.externalAppCardActions)}!function(n){n.DeepLinkDialog="DeepLinkDialog",n.DeepLinkOther="DeepLinkOther",n.DeepLinkStageView="DeepLinkStageView",n.GenericUrl="GenericUrl"}(c||(c={})),function(n){n.INTERNAL_ERROR="INTERNAL_ERROR",n.INVALID_LINK="INVALID_LINK",n.NOT_SUPPORTED="NOT_SUPPORTED"}(s||(s={}));export{s as ActionOpenUrlErrorCode,c as ActionOpenUrlType,A as isSupported,l as processActionOpenUrl,a as processActionSubmit};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParentAsync as o,sendAndUnwrap as r}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{FrameContexts as e,errorNotSupportedOnPlatform as p}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{validateInput as c}from"./externalAppAuthenticationForCEA.js";function l(r,l,m){return t(this,void 0,void 0,(function*(){if(n(s,e.content),!A())throw p;c(r,l);const[t,u]=yield o(i("v2","externalAppCardActionsForCEA.processActionOpenUrl"),"externalAppCardActionsForCEA.processActionOpenUrl",[r.toString(),l,m.href]);if(t)throw t;return u}))}function m(o,l,m){return t(this,void 0,void 0,(function*(){if(n(s,e.content),!A())throw p;c(o,l);const t=yield r(i("v2","externalAppCardActionsForCEA.processActionSubmit"),"externalAppCardActionsForCEA.processActionSubmit",o.toString(),l,m);if(t)throw t}))}function A(){return!(!n(s)||!s.supports.externalAppCardActionsForCEA)}export{A as isSupported,l as processActionOpenUrl,m as processActionSubmit};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParentAsync as o}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as i,errorNotSupportedOnPlatform as p}from"../public/constants.js";import{runtime as m}from"../public/runtime.js";import{AppId as e}from"../public/appId.js";function s(s,c,u){return t(this,void 0,void 0,(function*(){if(n(m,i.content),!l())throw p;const t=new e(s),[a,d]=yield o(r("v2","externalAppCommands.processActionCommand"),"externalAppCommands.processActionCommand",[t.toString(),c,u]);if(a)throw a;return d}))}function l(){return!(!n(m)||!m.supports.externalAppCommands)}export{l as isSupported,s as processActionCommand};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as e}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as l}from"../internal/telemetry.js";import{FrameContexts as t}from"../public/constants.js";import{ErrorCode as n}from"../public/interfaces.js";import{runtime as i}from"../public/runtime.js";const d="v1";var a
|
1
|
+
import{sendMessageToParent as e}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as l}from"../internal/telemetry.js";import{FrameContexts as t}from"../public/constants.js";import{ErrorCode as n}from"../public/interfaces.js";import{runtime as i}from"../public/runtime.js";const d="v1";var a,s,c,f,u,g;function S(o,n){if(r(i,t.content),!o||0===o.length)throw new Error("[files.getCloudStorageFolders] channelId name cannot be null or empty");if(!n)throw new Error("[files.getCloudStorageFolders] Callback cannot be null");e(l(d,"files.getCloudStorageFolders"),"files.getCloudStorageFolders",[o],n)}function C(o,n){if(r(i,t.content),!o||0===o.length)throw new Error("[files.addCloudStorageFolder] channelId name cannot be null or empty");if(!n)throw new Error("[files.addCloudStorageFolder] Callback cannot be null");e(l(d,"files.addCloudStorageFolder"),"files.addCloudStorageFolder",[o],n)}function w(o,n,a){if(r(i,t.content),!o)throw new Error("[files.deleteCloudStorageFolder] channelId name cannot be null or empty");if(!n)throw new Error("[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty");if(!a)throw new Error("[files.deleteCloudStorageFolder] Callback cannot be null");e(l(d,"files.deleteCloudStorageFolder"),"files.deleteCloudStorageFolder",[o,n],a)}function v(o,n,a){if(r(i,t.content),!o||!n)throw new Error("[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty");if(!a)throw new Error("[files.getCloudStorageFolderContents] Callback cannot be null");if("isSubdirectory"in o&&!o.isSubdirectory)throw new Error("[files.getCloudStorageFolderContents] provided folder is not a subDirectory");e(l(d,"files.getCloudStorageFolderContents"),"files.getCloudStorageFolderContents",[o,n],a)}function F(o,n,a){if(r(i,t.content),!o||!n)throw new Error("[files.openCloudStorageFile] file/providerCode cannot be null or empty");if(o.isSubdirectory)throw new Error("[files.openCloudStorageFile] provided file is a subDirectory");e(l(d,"files.openCloudStorageFile"),"files.openCloudStorageFile",[o,n,a])}function h(o=!1,n){if(r(i,t.content),!n)throw new Error("[files.getExternalProviders] Callback cannot be null");e(l(d,"files.getExternalProviders"),"files.getExternalProviders",[o],n)}function p(o,n,a,s,c=!1,f){if(r(i,t.content),!o||0===o.length)throw new Error("[files.copyMoveFiles] selectedFiles cannot be null or empty");if(!n)throw new Error("[files.copyMoveFiles] providerCode cannot be null or empty");if(!a)throw new Error("[files.copyMoveFiles] destinationFolder cannot be null or empty");if(!s)throw new Error("[files.copyMoveFiles] destinationProviderCode cannot be null or empty");if(!f)throw new Error("[files.copyMoveFiles] callback cannot be null");e(l(d,"files.copyMoveFiles"),"files.copyMoveFiles",[o,n,a,s,c],f)}function m(o){if(r(i,t.content),!o)throw new Error("[files.getFileDownloads] Callback cannot be null");e(l(d,"files.getFileDownloads"),"files.getFileDownloads",[],o)}function b(o=void 0,n){if(r(i,t.content),!n)throw new Error("[files.openDownloadFolder] Callback cannot be null");e(l(d,"files.openDownloadFolder"),"files.openDownloadFolder",[o],n)}function E(o){if(r(i,t.content),!o)throw G(n.INVALID_ARGUMENTS,"[files.addCloudStorageProvider] callback cannot be null");e(l(d,"files.addCloudStorageProvider"),"files.addCloudStorageProvider",[],o)}function P(o,a){if(r(i,t.content),!a)throw G(n.INVALID_ARGUMENTS,"[files.removeCloudStorageProvider] callback cannot be null");if(!o||!o.content)throw G(n.INVALID_ARGUMENTS,"[files.removeCloudStorageProvider] 3P cloud storage provider request content is missing");e(l(d,"files.removeCloudStorageProvider"),"files.removeCloudStorageProvider",[o],a)}function D(o,a){if(r(i,t.content),!a)throw G(n.INVALID_ARGUMENTS,"[files.addCloudStorageProviderFile] callback cannot be null");if(!o||!o.content)throw G(n.INVALID_ARGUMENTS,"[files.addCloudStorageProviderFile] 3P cloud storage provider request content is missing");e(l(d,"files.addCloudStorageProviderFile"),"files.addCloudStorageProviderFile",[o],a)}function I(o,a){if(r(i,t.content),!a)throw G(n.INVALID_ARGUMENTS,"[files.renameCloudStorageProviderFile] callback cannot be null");if(!o||!o.content)throw G(n.INVALID_ARGUMENTS,"[files.renameCloudStorageProviderFile] 3P cloud storage provider request content is missing");e(l(d,"files.renameCloudStorageProviderFile"),"files.renameCloudStorageProviderFile",[o],a)}function A(o,a){if(r(i,t.content),!a)throw G(n.INVALID_ARGUMENTS,"[files.deleteCloudStorageProviderFile] callback cannot be null");if(!(o&&o.content&&o.content.itemList&&o.content.itemList.length>0))throw G(n.INVALID_ARGUMENTS,"[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing");e(l(d,"files.deleteCloudStorageProviderFile"),"files.deleteCloudStorageProviderFile",[o],a)}function N(o,a){if(r(i,t.content),!a)throw G(n.INVALID_ARGUMENTS,"[files.downloadCloudStorageProviderFile] callback cannot be null");if(!(o&&o.content&&o.content.itemList&&o.content.itemList.length>0))throw G(n.INVALID_ARGUMENTS,"[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing");e(l(d,"files.downloadCloudStorageProviderFile"),"files.downloadCloudStorageProviderFile",[o],a)}function y(o,a){if(r(i,t.content),!a)throw G(n.INVALID_ARGUMENTS,"[files.uploadCloudStorageProviderFile] callback cannot be null");if(!(o&&o.content&&o.content.itemList&&o.content.itemList.length>0))throw G(n.INVALID_ARGUMENTS,"[files.uploadCloudStorageProviderFile] 3P cloud storage provider request content details are missing");if(!o.content.destinationFolder)throw G(n.INVALID_ARGUMENTS,"[files.uploadCloudStorageProviderFile] Invalid destination folder details");e(l(d,"files.uploadCloudStorageProviderFile"),"files.uploadCloudStorageProviderFile",[o],a)}function L(e){if(r(i),!e)throw new Error("[registerCloudStorageProviderListChangeHandler] Handler cannot be null");o(l(d,"files.registerCloudStorageProviderListChangeHandler"),"files.cloudStorageProviderListChange",e)}function M(e){if(r(i),!e)throw new Error("[registerCloudStorageProviderContentChangeHandler] Handler cannot be null");o(l(d,"files.registerCloudStorageProviderContentChangeHandler"),"files.cloudStorageProviderContentChange",e)}function G(e,o){return{errorCode:e,message:o}}!function(e){e.Dropbox="DROPBOX",e.Box="BOX",e.Sharefile="SHAREFILE",e.GoogleDrive="GOOGLEDRIVE",e.Egnyte="EGNYTE",e.SharePoint="SharePoint"}(a||(a={})),function(e){e[e.Sharepoint=0]="Sharepoint",e[e.WopiIntegration=1]="WopiIntegration",e[e.Google=2]="Google",e[e.OneDrive=3]="OneDrive",e[e.Recent=4]="Recent",e[e.Aggregate=5]="Aggregate",e[e.FileSystem=6]="FileSystem",e[e.Search=7]="Search",e[e.AllFiles=8]="AllFiles",e[e.SharedWithMe=9]="SharedWithMe"}(s||(s={})),function(e){e.ClassMaterials="classMaterials"}(c||(c={})),function(e){e.Readonly="readonly"}(f||(f={})),function(e){e.Downloaded="Downloaded",e.Downloading="Downloading",e.Failed="Failed"}(u||(u={})),function(e){e.Download="DOWNLOAD",e.Upload="UPLOAD",e.Delete="DELETE"}(g||(g={}));export{a as CloudStorageProvider,g as CloudStorageProviderFileAction,s as CloudStorageProviderType,f as DocumentLibraryAccessType,u as FileDownloadStatus,c as SpecialDocumentLibraryType,C as addCloudStorageFolder,E as addCloudStorageProvider,D as addCloudStorageProviderFile,p as copyMoveFiles,w as deleteCloudStorageFolder,A as deleteCloudStorageProviderFile,N as downloadCloudStorageProviderFile,v as getCloudStorageFolderContents,S as getCloudStorageFolders,h as getExternalProviders,m as getFileDownloads,F as openCloudStorageFile,b as openDownloadFolder,M as registerCloudStorageProviderContentChangeHandler,L as registerCloudStorageProviderListChangeHandler,P as removeCloudStorageProvider,I as renameCloudStorageProviderFile,y as uploadCloudStorageProviderFile};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{ensureInitialized as t}from"../../internal/internalAPIs.js";import{runtime as r}from"../../public/runtime.js";import*as o from"./tab.js";export{o as tab};var n;function i(){return!(!t(r)||!r.supports.hostEntity)}!function(t){t.edu="EDU"}(n||(n={}));export{n as AppTypes,i as isSupported};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{callFunctionInHostAndHandleResponse as t}from"../../internal/communication.js";import{ensureInitialized as r}from"../../internal/internalAPIs.js";import{SimpleTypeResponseHandler as e,ResponseHandler as n}from"../../internal/responseHandler.js";import{getApiVersionTag as o}from"../../internal/telemetry.js";import{runtime as a}from"../../public/runtime.js";import{isSupported as s}from"./hostEntity.js";import{ErrorCode as i}from"../../public/interfaces.js";const l="v2";class d extends n{validate(t){return"ConfigurableTab"===t.tabType}deserialize(t){return t}}class c{constructor(t){this.configurableTabInstance=t}serialize(){return this.configurableTabInstance}}class u{constructor(t){this.hostEntityId=t}serialize(){return this.hostEntityId}}class E extends n{validate(t){return"ConfigurableTab"===t.tabType||"StaticTab"===t.tabType}deserialize(t){return t}}class h{constructor(t){this.hostEntityTabInstance=t}serialize(){return this.hostEntityTabInstance}}class p extends n{validate(t){return t.allTabs&&t.allTabs.forEach((t=>{})),!0}deserialize(t){return t}}function f(e,n){if(r(a),!y())throw new Error(`Error code: ${i.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);if(I(e.threadId),n&&0===n.length)throw new Error(`Error code: ${i.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);return t("hostEntity.tab.addAndConfigure",[new u(e),n],new E,o(l,"hostEntity.tab.addAndConfigure"))}function m(e){if(r(a),!y())throw new Error(`Error code: ${i.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return I(e.threadId),t("hostEntity.tab.getAll",[new u(e)],new p,o(l,"hostEntity.tab.getAll"))}function b(e,n){if(r(a),!y())throw new Error(`Error code: ${i.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return g(e),I(n.threadId),t("hostEntity.tab.reconfigure",[new c(e),new u(n)],new d,o(l,"hostEntity.tab.reconfigure"))}function T(e,n){if(r(a),!y())throw new Error(`Error code: ${i.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return g(e),I(n.threadId),t("hostEntity.tab.rename",[new c(e),new u(n)],new d,o(l,"hostEntity.tab.rename"))}function w(n,s){if(r(a),!y())throw new Error(`Error code: ${i.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return I(s.threadId),g(n),t("hostEntity.tab.remove",[new h(n),new u(s)],new e,o(l,"hostEntity.tab.remove"))}function y(){var t;return!!(r(a)&&s()&&(null===(t=a.supports.hostEntity)||void 0===t?void 0:t.tab))}function I(t){if(!t||0==t.length)throw new Error(`Error code: ${i.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`)}function g(t){if(!(null==t?void 0:t.internalTabInstanceId)||0===t.internalTabInstanceId.length)throw new Error(`Error code: ${i.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`)}export{f as addAndConfigure,m as getAll,y as isSupported,b as reconfigure,w as remove,T as rename};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as t,removeHandler as
|
1
|
+
import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as t,removeHandler as o}from"../internal/handlers.js";import{ensureInitialized as e}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{isNullOrUndefined as n}from"../internal/typeCheckUtilities.js";import{errorNotSupportedOnPlatform as s}from"../public/constants.js";import{runtime as m}from"../public/runtime.js";function l(l){if(!n(l)&&e(m),!n(l)&&!p())throw s;l?t(i("v1","log.request"),"log.request",(()=>{const t=l();r(i("v1","log.receive"),"log.receive",[t])})):o("log.request")}function p(){return!(!e(m)||!m.supports.logs)}export{p as isSupported,l as registerGetLogHandler};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendAndHandleSdkError as e}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as
|
1
|
+
import{sendAndHandleSdkError as e}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as t}from"../internal/telemetry.js";import{errorNotSupportedOnPlatform as i}from"../public/constants.js";import{runtime as r}from"../public/runtime.js";const m="v1";function a(){return new Promise((o=>{if(n(r),!l())throw i;o(e(t(m,"meetingRoom.getPairedMeetingRoomInfo"),"meetingRoom.getPairedMeetingRoomInfo"))}))}function g(o){return new Promise((a=>{if(!o||0==o.length)throw new Error("[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty");if(n(r),!l())throw i;a(e(t(m,"meetingRoom.sendCommandToPairedMeetingRoom"),"meetingRoom.sendCommandToPairedMeetingRoom",o))}))}function s(e){if(!e)throw new Error("[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null");if(n(r),!l())throw i;o(t(m,"meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler"),"meetingRoom.meetingRoomCapabilitiesUpdate",(o=>{n(r),e(o)}))}function d(e){if(!e)throw new Error("[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null");if(n(r),!l())throw i;o(t(m,"meetingRoom.registerMeetingRoomStatesUpdateHandler"),"meetingRoom.meetingRoomStatesUpdate",(o=>{n(r),e(o)}))}function l(){return!(!n(r)||!r.supports.meetingRoom)}export{a as getPairedMeetingRoomInfo,l as isSupported,s as registerMeetingRoomCapabilitiesUpdateHandler,d as registerMeetingRoomStatesUpdateHandler,g as sendCommandToPairedMeetingRoom};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{__awaiter as t}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{requestPortFromParentWithVersion as r}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getLogger as n,getApiVersionTag as o}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as a}from"../../public/constants.js";import{runtime as i}from"../../public/runtime.js";let s;const l=n("messageChannels.dataLayer");function m(){return t(this,void 0,void 0,(function*(){if(s)return l("Returning dataLayer port from cache"),s;if(!p())throw a;return s=yield r(o("v1","messageChannels.dataLayer.getDataLayerPort"),"messageChannels.dataLayer.getDataLayerPort"),s}))}function p(){var t;return!(!e(i)||!(null===(t=i.supports.messageChannels)||void 0===t?void 0:t.dataLayer))}function u(){s=void 0}export{u as _clearDataLayerPort,m as getDataLayerPort,p as isSupported};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{ensureInitialized as r}from"../../internal/internalAPIs.js";import{runtime as t}from"../../public/runtime.js";import*as e from"./dataLayer.js";export{e as dataLayer};import*as o from"./telemetry.js";export{o as telemetry};function s(){return!(!r(t)||!t.supports.messageChannels)}export{s as isSupported};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{__awaiter as e}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{requestPortFromParentWithVersion as t}from"../../internal/communication.js";import{ensureInitialized as r}from"../../internal/internalAPIs.js";import{getLogger as n,getApiVersionTag as o}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as i}from"../../public/constants.js";import{runtime as s}from"../../public/runtime.js";let l;const m=n("messageChannels.telemetry");function p(){return e(this,void 0,void 0,(function*(){if(l)return m("Returning telemetry port from cache"),l;if(!u())throw i;return l=yield t(o("v1","messageChannels.telemetry.getTelemetryPort"),"messageChannels.telemetry.getTelemetryPort"),l}))}function u(){var e;return!(!r(s)||!(null===(e=s.supports.messageChannels)||void 0===e?void 0:e.telemetry))}function a(){l=void 0}export{a as _clearTelemetryPort,p as getTelemetryPort,u as isSupported};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as
|
1
|
+
import{sendMessageToParent as t}from"../internal/communication.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{FrameContexts as n,errorNotSupportedOnPlatform as r}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";function m(m){if(i(s,n.content),!c())throw r;t(o("v1","notifications.showNotification"),"notifications.showNotification",[m])}function c(){return!(!i(s)||!s.supports.notifications)}export{c as isSupported,m as showNotification};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as t,removeHandler as n}from"../internal/handlers.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as
|
1
|
+
import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as t,removeHandler as n}from"../internal/handlers.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{isNullOrUndefined as e}from"../internal/typeCheckUtilities.js";import{ErrorCode as p}from"../public/interfaces.js";import{runtime as l}from"../public/runtime.js";function s(r){if(!a())throw new Error(p.NOT_SUPPORTED_ON_PLATFORM.toString());if(e(r))throw new Error(p.INVALID_ARGUMENTS.toString());t(o("v2","otherApp.install"),"otherApp.install",r)}function m(){if(!a())throw new Error(p.NOT_SUPPORTED_ON_PLATFORM.toString());r(o("v2","otherApp.unregisterInstall"),"otherApp.unregisterInstall"),n("otherApp.install")}function a(){return!(!i(l)||!l.supports.otherAppStateChange)}export{a as isSupported,s as registerAppInstallationHandler,m as unregisterAppInstallationHandler};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as e}from"../internal/handlers.js";import{ensureInitialized as
|
1
|
+
import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as e}from"../internal/handlers.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{FrameContexts as t,errorNotSupportedOnPlatform as a}from"../public/constants.js";import{runtime as m}from"../public/runtime.js";const l="v1";var i,C,s;function d(e){if(!e)throw new Error("[remoteCamera.getCapableParticipants] Callback cannot be null");if(o(m,t.sidePanel),!b())throw a;r(n(l,"remoteCamera.getCapableParticipants"),"remoteCamera.getCapableParticipants",e)}function c(e,i){if(!e)throw new Error("[remoteCamera.requestControl] Participant cannot be null");if(!i)throw new Error("[remoteCamera.requestControl] Callback cannot be null");if(o(m,t.sidePanel),!b())throw a;r(n(l,"remoteCamera.requestControl"),"remoteCamera.requestControl",[e],i)}function u(e,i){if(!e)throw new Error("[remoteCamera.sendControlCommand] ControlCommand cannot be null");if(!i)throw new Error("[remoteCamera.sendControlCommand] Callback cannot be null");if(o(m,t.sidePanel),!b())throw a;r(n(l,"remoteCamera.sendControlCommand"),"remoteCamera.sendControlCommand",[e],i)}function f(e){if(!e)throw new Error("[remoteCamera.terminateSession] Callback cannot be null");if(o(m,t.sidePanel),!b())throw a;r(n(l,"remoteCamera.terminateSession"),"remoteCamera.terminateSession",e)}function h(r){if(!r)throw new Error("[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null");if(o(m,t.sidePanel),!b())throw a;e(n(l,"remoteCamera.registerOnCapableParticipantsChangeHandler"),"remoteCamera.capableParticipantsChange",r)}function w(r){if(!r)throw new Error("[remoteCamera.registerOnErrorHandler] Handler cannot be null");if(o(m,t.sidePanel),!b())throw a;e(n(l,"remoteCamera.registerOnErrorHandler"),"remoteCamera.handlerError",r)}function E(r){if(!r)throw new Error("[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null");if(o(m,t.sidePanel),!b())throw a;e(n(l,"remoteCamera.registerOnDeviceStateChangeHandler"),"remoteCamera.deviceStateChange",r)}function p(r){if(!r)throw new Error("[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null");if(o(m,t.sidePanel),!b())throw a;e(n(l,"remoteCamera.registerOnSessionStatusChangeHandler"),"remoteCamera.sessionStatusChange",r)}function b(){return!(!o(m)||!m.supports.remoteCamera)}!function(r){r.Reset="Reset",r.ZoomIn="ZoomIn",r.ZoomOut="ZoomOut",r.PanLeft="PanLeft",r.PanRight="PanRight",r.TiltUp="TiltUp",r.TiltDown="TiltDown"}(i||(i={})),function(r){r[r.CommandResetError=0]="CommandResetError",r[r.CommandZoomInError=1]="CommandZoomInError",r[r.CommandZoomOutError=2]="CommandZoomOutError",r[r.CommandPanLeftError=3]="CommandPanLeftError",r[r.CommandPanRightError=4]="CommandPanRightError",r[r.CommandTiltUpError=5]="CommandTiltUpError",r[r.CommandTiltDownError=6]="CommandTiltDownError",r[r.SendDataError=7]="SendDataError"}(C||(C={})),function(r){r[r.None=0]="None",r[r.ControlDenied=1]="ControlDenied",r[r.ControlNoResponse=2]="ControlNoResponse",r[r.ControlBusy=3]="ControlBusy",r[r.AckTimeout=4]="AckTimeout",r[r.ControlTerminated=5]="ControlTerminated",r[r.ControllerTerminated=6]="ControllerTerminated",r[r.DataChannelError=7]="DataChannelError",r[r.ControllerCancelled=8]="ControllerCancelled",r[r.ControlDisabled=9]="ControlDisabled",r[r.ControlTerminatedToAllowOtherController=10]="ControlTerminatedToAllowOtherController"}(s||(s={}));export{i as ControlCommand,C as ErrorReason,s as SessionTerminatedReason,d as getCapableParticipants,b as isSupported,h as registerOnCapableParticipantsChangeHandler,E as registerOnDeviceStateChangeHandler,w as registerOnErrorHandler,p as registerOnSessionStatusChangeHandler,c as requestControl,u as sendControlCommand,f as terminateSession};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{sendAndUnwrap as t}from"../../../internal/communication.js";import{ensureInitialized as r}from"../../../internal/internalAPIs.js";import{getApiVersionTag as o}from"../../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../../public/constants.js";import{runtime as i}from"../../../public/runtime.js";import*as e from"./joinedTeams.js";export{e as joinedTeams};function m(e){return new Promise((m=>{if(r(i),!s())throw n;m(t(o("v1","teams.fullTrust.getConfigSetting"),"getConfigSetting",e))}))}function s(){return!(!r(i)||!i.supports.teams)&&!!i.supports.teams.fullTrust}export{m as getConfigSetting,s as isSupported};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{sendAndUnwrap as t}from"../../../internal/communication.js";import{getUserJoinedTeamsSupportedAndroidClientVersion as r}from"../../../internal/constants.js";import{GlobalVars as e}from"../../../internal/globalVars.js";import{ensureInitialized as s,isCurrentSDKVersionAtLeast as o}from"../../../internal/internalAPIs.js";import{getApiVersionTag as n}from"../../../internal/telemetry.js";import{errorNotSupportedOnPlatform as i,HostClientType as m}from"../../../public/constants.js";import{ErrorCode as a}from"../../../public/interfaces.js";import{runtime as l}from"../../../public/runtime.js";function p(p){return new Promise((f=>{if(s(l),!u())throw i;if((e.hostClientType===m.android||e.hostClientType===m.teamsRoomsAndroid||e.hostClientType===m.teamsPhones||e.hostClientType===m.teamsDisplays)&&!o(r)){const t={errorCode:a.OLD_PLATFORM};throw new Error(JSON.stringify(t))}f(t(n("v1","teams.fullTrust.joinedTeams.getUserJoinedTeams"),"getUserJoinedTeams",p))}))}function u(){return!(!s(l)||!l.supports.teams)&&(!!l.supports.teams.fullTrust&&!!l.supports.teams.fullTrust.joinedTeams)}export{p as getUserJoinedTeams,u as isSupported};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{sendMessageToParent as r}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{FrameContexts as n,errorNotSupportedOnPlatform as a}from"../../public/constants.js";import{runtime as o}from"../../public/runtime.js";import*as l from"./fullTrust/fullTrust.js";export{l as fullTrust};var i;function m(l,i){if(e(o,n.content),!f())throw a;if(!l)throw new Error("[teams.getTeamChannels] groupId cannot be null or empty");if(!i)throw new Error("[teams.getTeamChannels] Callback cannot be null");r(t("v1","teams.getTeamChannels"),"teams.getTeamChannels",[l],i)}function s(n,l){if(e(o),!f())throw a;if(!n)throw new Error("[teams.refreshSiteUrl] threadId cannot be null or empty");if(!l)throw new Error("[teams.refreshSiteUrl] Callback cannot be null");r(t("v1","teams.refreshSiteUrl"),"teams.refreshSiteUrl",[n],l)}function f(){return!(!e(o)||!o.supports.teams)}!function(r){r[r.Regular=0]="Regular",r[r.Private=1]="Private",r[r.Shared=2]="Shared"}(i||(i={}));export{i as ChannelType,m as getTeamChannels,f as isSupported,s as refreshSiteUrl};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as t}from"../internal/telemetry.js";import{inServerSideRenderingEnvironment as n}from"../internal/utils.js";import{createEffectParameterChangeCallback as d,processMediaStreamWithMetadata as s,processMediaStream as a}from"../internal/videoEffectsUtils.js";import{VideoPerformanceMonitor as f}from"../internal/videoPerformanceMonitor.js";import{errorNotSupportedOnPlatform as m,FrameContexts as c}from"../public/constants.js";import{runtime as l}from"../public/runtime.js";import{isSupported as v}from"../public/videoEffects.js";const u="v2",p=2e3,E=n()?void 0:new f(r);var F;function g(n){var d,f;if(!x())throw m;if(!n.videoFrameHandler||!n.videoBufferHandler)throw new Error("Both videoFrameHandler and videoBufferHandler must be provided");if(o(l,c.sidePanel)){if(i(t(u,"videoEffectsEX.registerSetFrameProcessTimeLimitHandler"),"video.setFrameProcessTimeLimit",(e=>null==E?void 0:E.setFrameProcessTimeLimit(e)),!1),null===(d=l.supports.video)||void 0===d?void 0:d.mediaStream)i(t(u,"videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler"),"video.startVideoExtensibilityVideoStream",(r=>e(this,void 0,void 0,(function*(){const{streamId:i,metadataInTexture:o}=r,t=E?function(r,i){return o=>e(this,void 0,void 0,(function*(){const e=o.videoFrame;i.reportStartFrameProcessing(e.codedWidth,e.codedHeight);const t=h(),n=yield r(o);return t(),i.reportFrameProcessed(),n}))}(n.videoFrameHandler,E):n.videoFrameHandler;o?yield s(i,t,y,E):yield a(i,t,y,E)}))),!1),r(t(u,"videoEffectsEX.mediaStream.registerForVideoFrame"),"video.mediaStream.registerForVideoFrame",[n.config]);else{if(!(null===(f=l.supports.video)||void 0===f?void 0:f.sharedFrame))throw m;i(t(u,"videoEffectsEx.registerNewVideoFrameHandler"),"video.newVideoFrame",(e=>{if(e){null==E||E.reportStartFrameProcessing(e.width,e.height);const i=h(),o=e.timestamp;n.videoBufferHandler(function(e){return e.videoFrameBuffer=e.videoFrameBuffer||e.data,delete e.data,e}(e),(()=>{i(),null==E||E.reportFrameProcessed(),function(e){r(t(u,"videoEffectsEx.notifyVideoFrameProcessed"),"video.videoFrameProcessed",[e])}(o)}),y)}}),!1),r(t(u,"videoEffectsEx.registerForVideoFrame"),"video.registerForVideoFrame",[n.config])}null==E||E.startMonitorSlowFrameProcessing()}}function h(){const e=setTimeout((()=>{y(`Frame not processed in ${p}ms`,F.Warn)}),p);return function(){clearTimeout(e)}}function P(e,i,n){if(o(l,c.sidePanel),!x())throw m;r(t(u,"videoEffectsEx.notifySelectedVideoEffectChanged"),"video.videoEffectChanged",[e,i,n])}function w(e){if(o(l,c.sidePanel),!x())throw m;i(t(u,"videoEffectsEx.registerEffectParamterChangeHandler"),"video.effectParameterChange",d(e,E),!1),r(t(u,"videoEffectsEx.registerForVideoEffect"),"video.registerForVideoEffect")}function V(e){if(o(l,c.sidePanel),!v())throw m;r(t(u,"videoEffectsEx.updatePersonalizedEffects"),"video.personalizedEffectsChanged",[e])}function x(){return o(l),v()}function y(e,i=F.Warn){r(t(u,"videoEffectsEx.notifyError"),"video.notifyError",[e,i])}function H(e){if(o(l),!v())throw m;y(e,F.Fatal)}!function(e){e.Fatal="fatal",e.Warn="warn"}(F||(F={}));export{F as ErrorLevel,p as frameProcessingTimeoutInMs,x as isSupported,H as notifyFatalError,P as notifySelectedVideoEffectChanged,w as registerForVideoEffect,g as registerForVideoFrame,V as updatePersonalizedEffects};
|