@microsoft/teams-js 2.34.1-beta.0 → 2.35.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/packages/teams-js/dts/internal/childCommunication.d.ts +38 -0
- package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +0 -11
- package/dist/esm/packages/teams-js/dts/internal/communicationUtils.d.ts +20 -0
- package/dist/esm/packages/teams-js/dts/internal/pagesHelpers.d.ts +3 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +17 -1
- package/dist/esm/packages/teams-js/dts/private/hostEntity/hostEntity.d.ts +9 -1
- package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +1 -2
- package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communicationUtils.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity/hostEntity.js +1 -1
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +975 -887
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,38 @@
|
|
1
|
+
import { UUID as MessageUUID } from '../public/uuidObject';
|
2
|
+
import { DOMMessageEvent } from './interfaces';
|
3
|
+
import { MessageRequestWithRequiredProperties } from './messageObjects';
|
4
|
+
/**
|
5
|
+
* @internal
|
6
|
+
* Limited to Microsoft-internal use
|
7
|
+
*/
|
8
|
+
export declare function uninitializeChildCommunication(): void;
|
9
|
+
/**
|
10
|
+
* @hidden
|
11
|
+
* @internal
|
12
|
+
* Limited to Microsoft-internal use
|
13
|
+
*/
|
14
|
+
export declare function shouldEventBeRelayedToChild(): boolean;
|
15
|
+
type SendMessageToParentHelper = (apiVersionTag: string, func: string, args?: any[], isProxiedFromChild?: boolean) => MessageRequestWithRequiredProperties;
|
16
|
+
type SetCallbackForRequest = (uuid: MessageUUID, callback: Function) => void;
|
17
|
+
/**
|
18
|
+
* @hidden
|
19
|
+
* @internal
|
20
|
+
* Limited to Microsoft-internal use
|
21
|
+
*/
|
22
|
+
export declare function shouldProcessChildMessage(messageSource: Window, messageOrigin: string): boolean;
|
23
|
+
/**
|
24
|
+
* @hidden
|
25
|
+
* @internal
|
26
|
+
* Limited to Microsoft-internal use
|
27
|
+
*/
|
28
|
+
export declare function handleIncomingMessageFromChild(evt: DOMMessageEvent, messageSource: Window, sendMessageToParentHelper: SendMessageToParentHelper, setCallbackForRequest: SetCallbackForRequest): Promise<void>;
|
29
|
+
/**
|
30
|
+
* @hidden
|
31
|
+
* Send a custom message object that can be sent to child window,
|
32
|
+
* instead of a response message to a child
|
33
|
+
*
|
34
|
+
* @internal
|
35
|
+
* Limited to Microsoft-internal use
|
36
|
+
*/
|
37
|
+
export declare function sendMessageEventToChild(actionName: string, args?: any[]): void;
|
38
|
+
export {};
|
@@ -10,8 +10,6 @@ export declare class Communication {
|
|
10
10
|
static currentWindow: Window | any;
|
11
11
|
static parentOrigin: string | null;
|
12
12
|
static parentWindow: Window | any;
|
13
|
-
static childWindow: Window | null;
|
14
|
-
static childOrigin: string | null;
|
15
13
|
static topWindow: Window | any;
|
16
14
|
static topOrigin: string | null;
|
17
15
|
}
|
@@ -150,13 +148,4 @@ export declare function sendNestedAuthRequestToTopWindow(message: string): Neste
|
|
150
148
|
* Limited to Microsoft-internal use
|
151
149
|
*/
|
152
150
|
export declare function waitForMessageQueue(targetWindow: Window, callback: () => void): void;
|
153
|
-
/**
|
154
|
-
* @hidden
|
155
|
-
* Send a custom message object that can be sent to child window,
|
156
|
-
* instead of a response message to a child
|
157
|
-
*
|
158
|
-
* @internal
|
159
|
-
* Limited to Microsoft-internal use
|
160
|
-
*/
|
161
|
-
export declare function sendMessageEventToChild(actionName: string, args?: any[]): void;
|
162
151
|
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { UUID as MessageUUID } from '../public/uuidObject';
|
2
|
+
import { MessageRequest } from './messageObjects';
|
3
|
+
interface MessageWithUUIDOrID {
|
4
|
+
uuidAsString?: string;
|
5
|
+
uuid?: MessageUUID;
|
6
|
+
id?: number | undefined;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* @hidden
|
10
|
+
* @internal
|
11
|
+
* Limited to Microsoft-internal use
|
12
|
+
*/
|
13
|
+
export declare function getMessageIdsAsLogString(message: MessageWithUUIDOrID): string;
|
14
|
+
/**
|
15
|
+
* @hidden
|
16
|
+
* @internal
|
17
|
+
* Limited to Microsoft-internal use
|
18
|
+
*/
|
19
|
+
export declare function flushMessageQueue(targetWindow: Window | null, targetOrigin: string | null, targetMessageQueue: MessageRequest[], target: 'top' | 'parent' | 'child'): void;
|
20
|
+
export {};
|
@@ -22,3 +22,6 @@ export declare function configSetConfigHelper(apiVersionTag: string, instanceCon
|
|
22
22
|
export declare function isAppNavigationParametersObject(obj: pages.AppNavigationParameters | pages.NavigateToAppParams): obj is pages.AppNavigationParameters;
|
23
23
|
export declare function convertNavigateToAppParamsToAppNavigationParameters(params: pages.NavigateToAppParams): pages.AppNavigationParameters;
|
24
24
|
export declare function convertAppNavigationParametersToNavigateToAppParams(params: pages.AppNavigationParameters): pages.NavigateToAppParams;
|
25
|
+
export declare function getBackButtonPressHandler(): (() => boolean) | undefined;
|
26
|
+
export declare function setBackButtonPressHandler(handler: () => boolean): void;
|
27
|
+
export declare function initializeBackStackHelper(): void;
|
@@ -40,6 +40,22 @@ export declare function authenticateWithOauth(appId: AppId, conversationId: stri
|
|
40
40
|
* @returns A promise that resolves to the IActionExecuteResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
41
41
|
*/
|
42
42
|
export declare function authenticateAndResendRequest(appId: AppId, conversationId: string, authenticateParameters: externalAppAuthentication.AuthenticatePopUpParameters, originalRequestInfo: externalAppAuthentication.IActionExecuteInvokeRequest): Promise<externalAppAuthentication.IActionExecuteResponse>;
|
43
|
+
/**
|
44
|
+
* @hidden
|
45
|
+
* Parameters for SSO authentication. This interface is used exclusively with the externalAppAuthentication APIs
|
46
|
+
* @internal
|
47
|
+
* Limited to Microsoft-internal use
|
48
|
+
*/
|
49
|
+
export type AuthTokenRequestParametersForCEA = externalAppAuthentication.AuthTokenRequestParameters & {
|
50
|
+
/**
|
51
|
+
* Id to complete the request
|
52
|
+
*/
|
53
|
+
authId: string;
|
54
|
+
/**
|
55
|
+
* Connection name to complete the request
|
56
|
+
*/
|
57
|
+
connectionName: string;
|
58
|
+
};
|
43
59
|
/**
|
44
60
|
* @beta
|
45
61
|
* @hidden
|
@@ -53,7 +69,7 @@ export declare function authenticateAndResendRequest(appId: AppId, conversationI
|
|
53
69
|
* @throws InvokeError if the host encounters an error while authenticating or resending the request
|
54
70
|
* @returns A promise that resolves to the IActionExecuteResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
55
71
|
*/
|
56
|
-
export declare function authenticateWithSSOAndResendRequest(appId: AppId, conversationId: string, authTokenRequest:
|
72
|
+
export declare function authenticateWithSSOAndResendRequest(appId: AppId, conversationId: string, authTokenRequest: AuthTokenRequestParametersForCEA, originalRequestInfo: externalAppAuthentication.IActionExecuteInvokeRequest): Promise<externalAppAuthentication.IActionExecuteResponse>;
|
57
73
|
/**
|
58
74
|
* @beta
|
59
75
|
* @hidden
|
@@ -9,7 +9,15 @@
|
|
9
9
|
*/
|
10
10
|
import * as tab from './tab';
|
11
11
|
export declare enum AppTypes {
|
12
|
-
edu = "EDU"
|
12
|
+
edu = "EDU",
|
13
|
+
/**
|
14
|
+
* Enum to indicate apps should be filtered for base Townhall.
|
15
|
+
*/
|
16
|
+
baseTownhall = "BASE_TOWNHALL",
|
17
|
+
/**
|
18
|
+
* Enum to indicate apps should be filtered for streaming Townhall.
|
19
|
+
*/
|
20
|
+
streamingTownhall = "STREAMING_TOWNHALL"
|
13
21
|
}
|
14
22
|
/**
|
15
23
|
* Id of the teams entity like channel, chat
|
@@ -15,8 +15,7 @@ export declare function uploadCustomApp(manifestBlob: Blob, onComplete?: (status
|
|
15
15
|
export declare function sendCustomMessage(actionName: string, args?: any[], callback?: (...args: any[]) => void): void;
|
16
16
|
/**
|
17
17
|
* @hidden
|
18
|
-
* Sends a custom action MessageEvent to a child iframe/window
|
19
|
-
* Otherwise it will go to the auth popup (which becomes the child)
|
18
|
+
* Sends a custom action MessageEvent to a child iframe/window.
|
20
19
|
*
|
21
20
|
* @param actionName - Specifies name of the custom action to be sent
|
22
21
|
* @param args - Specifies additional arguments passed to the action
|
@@ -0,0 +1 @@
|
|
1
|
+
import{__awaiter as n}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{flushMessageQueue as i,getMessageIdsAsLogString as o}from"./communicationUtils.js";import{callHandler as s}from"./handlers.js";import{deserializeMessageRequest as e,serializeMessageResponse as r}from"./messageObjects.js";import{getLogger as t,getApiVersionTag as d}from"./telemetry.js";const u=t("childProxyingCommunication");class a{}function c(){a.window=null,a.origin=null,a.messageQueue=[]}function l(){return!!a.window}function g(n,i){return a.window&&!a.window.closed&&n!==a.window||(a.window=n,a.origin=i),a.window&&a.window.closed?(a.window=null,a.origin=null,!1):a.window===n}function m(r,t,u,c){return n(this,void 0,void 0,(function*(){a.window===t&&(i(a.window,a.origin,a.messageQueue,"child"),function(n,i,r){if(void 0===n.data.id||void 0===n.data.func)return;const t=e(n.data),[u,c]=s(t.func,t.args);if(u&&void 0!==c)return w("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",o(t),t.func),void f(t.id,t.uuid,Array.isArray(c)?c:[c]);w("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",o(t),t.func),function(n,i,s){const e=i(d("v2","tasks.startTask"),n.func,n.args,!0);s(e.uuid,((...i)=>{if(a.window){const s=i.pop();w("Message from parent being relayed to child, id: %s",o(n)),f(n.id,n.uuid,i,s)}}))}(t,i,r)}(r,u,c))}))}a.messageQueue=[];const w=u.extend("handleIncomingMessageFromChild");function f(n,i,s,e){const t=a.window,d=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,s,e),u=r(d),c=a.origin;t&&c&&(w("Sending message %s to %s via postMessage, args = %o",o(u),"child",u.args),t.postMessage(u,c))}function p(n,i){const o=a.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=a.origin;o&&e?o.postMessage(s,e):a.messageQueue.push(s)}export{m as handleIncomingMessageFromChild,p as sendMessageEventToChild,l as shouldEventBeRelayedToChild,g as shouldProcessChildMessage,c as uninitializeChildCommunication};
|
@@ -1 +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{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as o}from"./telemetry.js";import{isSdkError as t,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{UUID as d}from"../public/uuidObject.js";import{version as c}from"../public/version.js";import{GlobalVars as u}from"./globalVars.js";import{callHandler as l}from"./handlers.js";import g from"./hostToAppTelemetry.js";import{serializeMessageRequest as p,deserializeMessageResponse as f,deserializeMessageRequest as m,serializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as W,ssrSafeWindow as v}from"./utils.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 D(e,i).then((t=>{t?(function(e,n){u.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);oe(y.parentWindow),oe(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=m(e.data),[i,t]=l(n.func,n.args);i&&void 0!==t?(X("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(t)?t:[t])):(X("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),function(e){const n=L(o("v2","tasks.startTask"),e.func,e.args,!0);k.callbacks.set(n.uuid,((...n)=>{if(y.childWindow){const i=n.pop();X("Message from parent being relayed to child, id: %s",ae(e)),se(e.id,e.uuid,n,i)}}))}(n))}}(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||v(),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."));u.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",j(i,"initialize",[c,r,n]).then((([e,n,i,o])=>(h(o,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:o})))}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={},g.clearMessages()}function R(e,n,...i){return j(e,n,i).then((([e])=>e))}function E(e,n,...i){return j(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...o){return j(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function S(e,n,...i){return j(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function j(e,n,o=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 t=L(e,n,o);var s;i((s=t.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function P(e){return e.map((e=>a(e)?e.serialize():e))}function A(n,i,o,r,a){var d;return e(this,void 0,void 0,(function*(){const e=P(i),[c]=yield j(r,n,e);if(a&&a(c)||!a&&t(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(o.validate(c))return o.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,o,r){var a;return e(this,void 0,void 0,(function*(){const e=P(i),[d]=yield j(o,n,e);if(r&&r(d)||!r&&t(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,o=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 t=L(e,n,o);return s=t.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,o)=>{i instanceof MessagePort?e(i):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,o,t){let s;if(o instanceof Function?t=o:o instanceof Array&&(s=o),!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);t&&k.callbacks.set(r.uuid,t)}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,o=function(e){const n=k.nextMessageId++,i=new d;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",ae(o),{actionName:o.func}),Q(i,o)}const F=b.extend("sendRequestToTargetWindowHelper");function Q(e,n){const i=F,o=ne(e),t=p(n);if(u.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(t),o),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(t)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(t),o),e.postMessage(t,s)):(i("Adding message %s to %s message queue",ae(t),o),Z(e).push(n))}return n}const z=b.extend("sendMessageToParentHelper");function L(e,n,i,o){const t=z,s=y.parentWindow,r=function(e,n,i,o){const t=k.nextMessageId++,s=new d;return k.legacyMessageIdsToUuidMap[t]=s,{id:t,uuid:s,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o}}(e,n,i,o);return g.storeCallbackInformation(r.uuid,{name:n,calledAt:r.timestamp}),t("Message %s information: %o",ae(r),{actionName:n,args:i}),Q(s,r)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,o;const t=V;if(!e||!e.data||"object"!=typeof e.data)return void t("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 t("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===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);d?D(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),oe(y.topWindow),n(r)):t("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):t("Message being ignored by app because it is coming for a target that is null")}const H=b.extend("shouldProcessIncomingMessage");function D(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return H("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 H("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||H("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=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,t=f(o),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 o=B(k.promiseCallbacks,n);if(o)return o;const t=B(k.portCallbacks,n);if(t)return t}n("Received message %s that failed to produce a callbackId",ae(e))}(t);if(s){const o=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),g.handlePerformanceMetrics(s,t,n,i),o&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),t.args),o.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(t,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),t.args),r(t.args),n("Removing registered promise callback for message %s",s.toString()),K(t,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(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,t.args),n("Removing registered port callback for message %s",s.toString()),K(t,k.portCallbacks)}t.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;g.handleOneWayPerformanceMetrics(o,n,i),n('Received a message from parent %s, action: "%s"',ae(o),o.func),l(o.func,o.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 oe(e){const n=ee(e),i=Z(e),o=ne(e);for(;e&&n&&i.length>0;){const t=i.shift();if(t){const i=p(t);ie("Flushing message %s from %s message queue via postMessage.",ae(i),o),e.postMessage(i,n)}}}function te(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,o){const t=y.childWindow,s=function(e,n,i,o){return{id:e,uuid:n,args:i||[],isPartialResponse:o}}(e,n,i,o),r=w(s),a=ee(t);t&&a&&(X("Sending message %s to %s via postMessage, args = %o",ae(r),ne(t),r.args),t.postMessage(r,a))}function re(e,n){const i=y.childWindow,o=function(e,n){return{func:e,args:n||[]}}(e,n),t=ee(i);i&&t?i.postMessage(o,t):Z(i).push(o)}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,A as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,S as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,j as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,te 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{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getLogger as v,isFollowingApiVersionTagFormat as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=v("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void q("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then((o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,((e,n)=>T.callbacks.set(e,n))):Y(n)):q("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,t)}))}))}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then((([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:H,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o})))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then((([e])=>e))}function R(e,n,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n)}))}function C(e,n,t,...o){return S(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||t)}))}function P(e,n,...t){return S(e,n,t).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!b(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((o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise((e=>{T.promiseCallbacks.set(i,e)}))))}))}function x(e){return e.map((e=>r(e)?e.serialize():e))}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,(function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)}))}function A(o,r,i,s){var a;return e(this,void 0,void 0,(function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)}))}function U(e,n,t=void 0){if(!b(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=V(e,n,t);return r=o.uuid,new Promise(((e,n)=>{T.portCallbacks.set(r,((t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!b(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 i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e){const n=z,t=I.topWindow,o=function(e){const n=T.nextMessageId++,t=new i;return T.legacyMessageIdsToUuidMap[n]=t,{id:n,uuid:t,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",u(o),{actionName:o.func}),F(t,o)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o){const r=Q,s=I.parentWindow,a=function(e,n,t,o){const r=T.nextMessageId++,s=new i;return T.legacyMessageIdsToUuidMap[r]=s,{id:r,uuid:s,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o}}(e,n,t,o);return f.storeCallbackInformation(a.uuid,{name:n,calledAt:a.timestamp}),r("Message %s information: %o",u(a),{actionName:n,args:t}),F(s,a)}const q=k.extend("processIncomingMessage");const D=k.extend("processAuthBridgeMessage");function H(e,n){var t,o;const r=D;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const J=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,(function*(){if(I.currentWindow&&n===I.currentWindow)return J("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return J("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||J("Message has an invalid origin of %s",t),n}}))}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find((([e,t])=>e.toString()===n.toString()));if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval((()=>{0===ee(e).length&&(clearInterval(t),n())}),100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{serializeMessageRequest as e}from"./messageObjects.js";import{getLogger as s}from"./telemetry.js";function i(e){return void 0!==e.uuidAsString?`${e.uuidAsString} (legacy id: ${e.id})`:void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}const t=s("flushMessageQueue");function u(s,u,o,g){if(s&&u&&0!==o.length)for(;o.length>0;){const n=o.shift();if(n){const o=e(n);t("Flushing message %s from %s message queue via postMessage.",i(o),g),s.postMessage(o,u)}}}export{u as flushMessageQueue,i as getMessageIdsAsLogString};
|
@@ -1 +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{getLogger as n,getApiVersionTag as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{
|
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{shouldEventBeRelayedToChild as a,sendMessageEventToChild as o}from"./childCommunication.js";import{sendMessageToParent as t}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=n("handlers");class m{static initializeHandlers(){m.handlers.themeChange=C,m.handlers.load=O,m.handlers.beforeUnload=_,i()}static uninitializeHandlers(){m.handlers={},m.themeChangeHandler=null,m.loadHandler=null,m.beforeUnloadHandler=null,m.beforeSuspendOrTerminateHandler=null,m.resumeHandler=null}}function f(){m.initializeHandlers()}function c(){m.uninitializeHandlers()}m.handlers={},m.themeChangeHandler=null,m.loadHandler=null,m.beforeUnloadHandler=null,m.beforeSuspendOrTerminateHandler=null,m.resumeHandler=null,m.hostToAppPerformanceMetricsHandler=null;const H=u.extend("callHandler");function h(e,n){const r=m.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()?(o(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?(m.handlers[n]=r,l&&t(e,"registerHandler",[n,...a])):delete m.handlers[n]}function g(e){delete m.handlers[e]}function b(e){return null!=m.handlers[e]}function U(e,n,r,a,o){r&&d(l,...a),o&&o(),p(e,n,r)}function T(e,n){m.themeChangeHandler=n,!s(n)&&t(e,"registerHandler",["themeChange"])}function C(e){m.themeChangeHandler&&m.themeChangeHandler(e),a()&&o("themeChange",[e])}function v(e){m.hostToAppPerformanceMetricsHandler=e}function y(e){m.hostToAppPerformanceMetricsHandler&&m.hostToAppPerformanceMetricsHandler(e)}function j(e,n){m.loadHandler=n,!s(n)&&t(e,"registerHandler",["load"])}function O(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;m.resumeHandler?(m.resumeHandler(n),a()&&o("load",[n])):m.loadHandler&&(m.loadHandler(e),a()&&o("load",[e]))}function S(e,n){m.beforeUnloadHandler=n,!s(n)&&t(e,"registerHandler",["beforeUnload"])}function _(){return e(this,void 0,void 0,(function*(){const e=()=>{t(r("v2","handleBeforeUnload"),"readyToUnload",[])};m.beforeSuspendOrTerminateHandler?(yield m.beforeSuspendOrTerminateHandler(),a()?o("beforeUnload"):e()):m.beforeUnloadHandler&&m.beforeUnloadHandler(e)||(a()?o("beforeUnload"):e())}))}function A(e){m.beforeSuspendOrTerminateHandler=e,!s(e)&&t(r("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function P(e){m.resumeHandler=e,!s(e)&&t(r("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,y as handleHostToAppPerformanceMetrics,C as handleThemeChange,f as initializeHandlers,A as registerBeforeSuspendOrTerminateHandler,S as registerBeforeUnloadHandler,p as registerHandler,U as registerHandlerHelper,v as registerHostToAppPerformanceMetricsHandler,j as registerOnLoadHandler,P as registerOnResumeHandler,T as registerOnThemeChangeHandler,g as removeHandler,c as uninitializeHandlers};
|
@@ -1 +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{
|
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{shouldEventBeRelayedToChild as o,sendMessageEventToChild as s}from"./childCommunication.js";import{sendAndHandleStatusAndReasonWithDefaultError as a,sendAndUnwrap as c,sendMessageToParent as u,sendAndHandleStatusAndReason as p}from"./communication.js";import{registerHandler as m}from"./handlers.js";import{ensureInitialized as f}from"./internalAPIs.js";import{getApiVersionTag as g}from"./telemetry.js";import{isSupported as b,navigateBack as l}from"../public/pages/backStack.js";import{isSupported as d}from"../public/pages/tabs.js";import{isSupported as w}from"../public/pages/config.js";const h="v2";function P(t,o){return new Promise((s=>{if(f(r,e.content,e.sidePanel,e.settings,e.remove,e.task,e.stage,e.meetingStage),!i())throw n;s(a(t,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",o))}))}function j(t){return new Promise((e=>{if(f(r),!b())throw n;e(a(t,"navigateBack","Back navigation is not supported in the current client or context."))}))}function v(t,e){return new Promise((i=>{if(f(r),!d())throw n;i(a(t,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",e))}))}function I(t,e){if(f(r),!i())throw n;u(t,"returnFocus",[e])}function S(t,e){return new Promise((i=>{if(f(r),!d())throw n;i(c(t,"getTabInstances",e))}))}function k(t,e){return new Promise((i=>{if(f(r),!d())throw n;i(c(t,"getMruTabInstances",e))}))}function U(t,o){if(f(r,e.content,e.sidePanel,e.meetingStage),!i())throw n;u(t,"shareDeepLink",[o.subPageId,o.subPageLabel,o.subPageWebUrl])}function B(t,o){if(f(r,e.content),!i())throw n;u(t,"setFrameContext",[o])}function T(t,i){if(f(r,e.settings,e.remove),!w())throw n;u(t,"settings.setValidityState",[i])}function C(t){return new Promise((o=>{if(f(r,e.content,e.settings,e.remove,e.sidePanel),!i())throw n;o(c(t,"settings.getSettings"))}))}function L(t,i){return new Promise((o=>{if(f(r,e.content,e.settings,e.sidePanel),!w())throw n;o(p(t,"settings.setSettings",i))}))}function O(e){return e.appId instanceof t}function x(e){return Object.assign(Object.assign({},e),{appId:new t(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function y(t){return Object.assign(Object.assign({},t),{appId:t.appId.toString(),webUrl:t.webUrl?t.webUrl.toString():void 0})}let D;function F(t){D=t}function R(){m(g("v2","pages.backStack.registerBackButtonPressHandler"),"backButtonPress",A,!1)}function A(){D&&D()||(o()?s("backButtonPress",[]):l())}export{j as backStackNavigateBackHelper,L as configSetConfigHelper,T as configSetValidityStateHelper,y as convertAppNavigationParametersToNavigateToAppParams,x as convertNavigateToAppParamsToAppNavigationParameters,C as getConfigHelper,k as getMruTabInstancesHelper,S as getTabInstancesHelper,R as initializeBackStackHelper,O as isAppNavigationParametersObject,P as navigateCrossDomainHelper,h as pagesTelemetryVersionNumber,I as returnFocusHelper,F as setBackButtonPressHandler,B as setCurrentFrameHelper,U as shareDeepLinkHelper,v as tabsNavigateToTabHelper};
|
@@ -1 +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{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
|
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 a}from"../internal/utils.js";import{FrameContexts as u,errorNotSupportedOnPlatform as c}from"../public/constants.js";import{runtime as p}from"../public/runtime.js";import{validateActionExecuteInvokeRequest as s,ActionExecuteResponseHandler as h,SerializableActionExecuteInvokeRequest as l,isInvokeError as A}from"./externalAppAuthentication.js";const m="v2";function d(n,i,a){return t(this,void 0,void 0,(function*(){if(r(p,u.content),!v())throw c;return w(n,i),e("externalAppAuthenticationForCEA.authenticateWithSSO",[n,i,a.claims,a.silent],o(m,"externalAppAuthenticationForCEA.authenticateWithSSO"),A)}))}function f(n,i,a){return t(this,void 0,void 0,(function*(){if(r(p,u.content),!v())throw c;return w(n,i),e("externalAppAuthenticationForCEA.authenticateWithOauth",[n,i,a.url.href,a.width,a.height,a.isExternal],o(m,"externalAppAuthenticationForCEA.authenticateWithOauth"),A)}))}function x(n,e,a,d){return t(this,void 0,void 0,(function*(){if(r(p,u.content),!v())throw c;return w(n,e),s(d),i("externalAppAuthenticationForCEA.authenticateAndResendRequest",[n,e,new l(d),a.url.href,a.width,a.height,a.isExternal],new h,o(m,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),A)}))}function E(n,e,a,d){return t(this,void 0,void 0,(function*(){if(r(p,u.content),!v())throw c;return w(n,e),s(d),i("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[n,e,new l(d),a.authId,a.connectionName,a.claims,a.silent],new h,o(m,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),A)}))}function v(){return!(!r(p)||!p.supports.externalAppAuthenticationForCEA)}function w(t,e){a(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{ensureInitialized as t}from"../../internal/internalAPIs.js";import{runtime as r}from"../../public/runtime.js";import*as
|
1
|
+
import{ensureInitialized as t}from"../../internal/internalAPIs.js";import{runtime as r}from"../../public/runtime.js";import*as n from"./tab.js";export{n as tab};var o;function i(){return!(!t(r)||!r.supports.hostEntity)}!function(t){t.edu="EDU",t.baseTownhall="BASE_TOWNHALL",t.streamingTownhall="STREAMING_TOWNHALL"}(o||(o={}));export{o as AppTypes,i as isSupported};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{shouldEventBeRelayedToChild as e,sendMessageEventToChild as t}from"../internal/childCommunication.js";import{sendMessageToParent as n}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as s}from"../internal/utils.js";import{FrameContexts as l}from"../public/constants.js";import{runtime as m}from"../public/runtime.js";const a="v1";function p(e,t){r(m),n(o(a,"uploadCustomApp"),"uploadCustomApp",[e],t||s())}function c(e,t,i){r(m),n(o(a,"sendCustomMessage"),e,t,i)}function u(n,i){if(r(m),!e())throw new Error("The child window has not yet been initialized or is not present");t(n,i)}function d(e,t){r(m),i(o(a,"registerCustomHandler"),e,((...e)=>t.apply(this,e)))}function f(e,t){r(m),i(o(a,"registerUserSettingsChangeHandler"),"userSettingsChange",t,!0,[e])}function w(e){r(m,l.content,l.task);const t=[e.entityId,e.title,e.description,e.type,e.objectUrl,e.downloadUrl,e.webPreviewUrl,e.webEditUrl,e.baseUrl,e.editFile,e.subEntityId,e.viewerAction,e.fileOpenPreference,e.conversationId,e.sizeInBytes];n(o(a,"openFilePreview"),"openFilePreview",t)}export{w as openFilePreview,d as registerCustomHandler,f as registerUserSettingsChangeHandler,u as sendCustomEvent,c as sendCustomMessage,p as uploadCustomApp};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParent as t
|
1
|
+
import{sendMessageToParent as t}from"../../internal/communication.js";import{ensureInitialized as r}from"../../internal/internalAPIs.js";import{initializeBackStackHelper as n,backStackNavigateBackHelper as e,pagesTelemetryVersionNumber as i,setBackButtonPressHandler as o}from"../../internal/pagesHelpers.js";import{getApiVersionTag as a}from"../../internal/telemetry.js";import{isNullOrUndefined as s}from"../../internal/typeCheckUtilities.js";import{errorNotSupportedOnPlatform as p}from"../constants.js";import{runtime as c}from"../runtime.js";function m(){n()}function f(){return e(a(i,"pages.backStack.navigateBack"))}function u(t){l(a(i,"pages.backStack.registerBackButtonHandler"),t,(()=>{if(!s(t)&&!k())throw p}))}function l(n,e,i){!s(e)&&r(c),i&&i(),o(e),!s(e)&&t(n,"registerHandler",["backButton"])}function k(){return!(!r(c)||!c.supports.pages)&&!!c.supports.pages.backStack}export{m as _initialize,k as isSupported,f as navigateBack,u as registerBackButtonHandler,l as registerBackButtonHandlerHelper};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{shouldEventBeRelayedToChild as e,sendMessageEventToChild as t}from"../../internal/childCommunication.js";import{sendMessageToParent as i}from"../../internal/communication.js";import{registerHandler as n,registerHandlerHelper as s}from"../../internal/handlers.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{configSetValidityStateHelper as r,configSetConfigHelper as f,pagesTelemetryVersionNumber as a}from"../../internal/pagesHelpers.js";import{getApiVersionTag as c}from"../../internal/telemetry.js";import{isNullOrUndefined as g}from"../../internal/typeCheckUtilities.js";import{FrameContexts as u,errorNotSupportedOnPlatform as m}from"../constants.js";import{runtime as l}from"../runtime.js";let p,v;function h(){n(c(a,"pages.config.registerSettingsSaveHandler"),"settings.save",E,!1),n(c(a,"pages.config.registerSettingsRemoveHandler"),"settings.remove",F,!1)}function d(e){return r(c(a,"pages.config.setValidityState"),e)}function y(e){return f(c(a,"pages.config.setConfig"),e)}function S(e){N(c(a,"pages.config.registerOnSaveHandler"),e,(()=>{if(!g(e)&&!O())throw m}))}function N(e,t,n){!g(t)&&o(l,u.settings),n&&n(),p=t,!g(t)&&i(e,"registerHandler",["save"])}function j(e){w(c(a,"pages.config.registerOnRemoveHandler"),e,(()=>{if(!g(e)&&!O())throw m}))}function w(e,t,n){!g(t)&&o(l,u.remove,u.settings),n&&n(),v=t,!g(t)&&i(e,"registerHandler",["remove"])}function E(i){const n=new C(i);p?p(n):e()?t("settings.save",[i]):n.notifySuccess()}function H(e){s(c(a,"pages.config.registerChangeConfigHandler"),"changeSettings",e,[u.content],(()=>{if(!O())throw m}))}class C{constructor(e){this.notified=!1,this.result=e||{}}notifySuccess(){this.ensureNotNotified(),i(c(a,"pages.saveEvent.notifySuccess"),"settings.save.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),i(c(a,"pages.saveEvent.notifyFailure"),"settings.save.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")}}function F(){const i=new T;v?v(i):e()?t("settings.remove",[]):i.notifySuccess()}class T{constructor(){this.notified=!1}notifySuccess(){this.ensureNotNotified(),i(c(a,"pages.removeEvent.notifySuccess"),"settings.remove.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),i(c(a,"pages.removeEvent.notifyFailure"),"settings.remove.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The removeEventType may only notify success or failure once.")}}function O(){return!(!o(l)||!l.supports.pages)&&!!l.supports.pages.config}export{h as initialize,O as isSupported,H as registerChangeConfigHandler,j as registerOnRemoveHandler,w as registerOnRemoveHandlerHelper,S as registerOnSaveHandler,N as registerOnSaveHandlerHelper,y as setConfig,d as setValidityState};
|
@@ -1 +1 @@
|
|
1
|
-
const t="2.
|
1
|
+
const t="2.35.0-beta.0";export{t as version};
|