@microsoft/teams-js 2.55.1-beta.0 → 2.56.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/README.md +4 -4
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +7 -0
- package/dist/esm/packages/teams-js/dts/private/contextualSearch.d.ts +99 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/featureFlags.d.ts +9 -0
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/search.d.ts +40 -40
- package/dist/esm/packages/teams-js/dts/public/uuidObject.d.ts +2 -2
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/private/contextualSearch.js +1 -0
- package/dist/esm/packages/teams-js/src/public/featureFlags.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +191 -47
- 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 +53 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
|
24
24
|
|
|
25
25
|
### Production
|
|
26
26
|
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.56.0/js/MicrosoftTeams.min.js) or point your package manager at them.
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
|
|
|
45
45
|
```html
|
|
46
46
|
<!-- Microsoft Teams JavaScript API (via CDN) -->
|
|
47
47
|
<script
|
|
48
|
-
src="https://res.cdn.office.net/teams-js/2.
|
|
49
|
-
integrity="sha384-
|
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.56.0/js/MicrosoftTeams.min.js"
|
|
49
|
+
integrity="sha384-ftygCQXhLMbuUBdLMhfAnIFTGb2SAYYAPD9iyq2LRkbWpKkEifAGD+qPVcPgthO2"
|
|
50
50
|
crossorigin="anonymous"
|
|
51
51
|
></script>
|
|
52
52
|
|
|
53
53
|
<!-- Microsoft Teams JavaScript API (via npm) -->
|
|
54
|
-
<script src="node_modules/@microsoft/teams-js@2.
|
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.56.0/dist/MicrosoftTeams.min.js"></script>
|
|
55
55
|
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
|
@@ -80,6 +80,10 @@ export declare const enum ApiName {
|
|
|
80
80
|
Chat_OpenGroupChat = "chat.openGroupChat",
|
|
81
81
|
Clipboard_Read = "clipboard.read",
|
|
82
82
|
Clipboard_Write = "clipboard.write",
|
|
83
|
+
ContextualSearch_CloseContextualSearch = "contextualSearch.closeContextualSearch",
|
|
84
|
+
ContextualSearch_OpenContextualSearch = "contextualSearch.openContextualSearch",
|
|
85
|
+
ContextualSearch_RegisterCloseContextualSearchHandler = "contextualSearch.registerCloseContextualSearchHandler",
|
|
86
|
+
ContextualSearch_RegisterOpenContextualSearchHandler = "contextualSearch.registerOpenContextualSearchHandler",
|
|
83
87
|
Conversations_CloseConversation = "conversations.closeConversation",
|
|
84
88
|
Conversations_GetChatMember = "conversations.getChatMember",
|
|
85
89
|
Conversations_OpenConversation = "conversations.openConversation",
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export declare function prefetchOriginsFromCDN(): Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Limited to Microsoft-internal use
|
|
5
|
+
*
|
|
6
|
+
* Exported so the JSON validation can be unit tested directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isValidOriginsJSONValid(validOriginsJSON: string): boolean;
|
|
2
9
|
/**
|
|
3
10
|
* @internal
|
|
4
11
|
* Limited to Microsoft-internal use
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* Module to interact with the Teams Contextual Search pane.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
* Limited to Microsoft-internal use
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Parameters used when opening the contextual search pane.
|
|
12
|
+
*
|
|
13
|
+
* @hidden
|
|
14
|
+
* @internal
|
|
15
|
+
* Limited to Microsoft-internal use
|
|
16
|
+
*/
|
|
17
|
+
export interface OpenContextualSearchRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Identifies the entry point that triggered contextual search.
|
|
20
|
+
* This value may be used by the host for telemetry.
|
|
21
|
+
*/
|
|
22
|
+
triggerSource?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Handler invoked when the contextual search pane becomes visible.
|
|
26
|
+
*
|
|
27
|
+
* @hidden
|
|
28
|
+
* @internal
|
|
29
|
+
* Limited to Microsoft-internal use
|
|
30
|
+
*/
|
|
31
|
+
export type ContextualSearchOpenedHandler = () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Handler invoked when the contextual search pane is closed.
|
|
34
|
+
*
|
|
35
|
+
* @hidden
|
|
36
|
+
* @internal
|
|
37
|
+
* Limited to Microsoft-internal use
|
|
38
|
+
*/
|
|
39
|
+
export type ContextualSearchClosedHandler = () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Opens the contextual search pane.
|
|
42
|
+
*
|
|
43
|
+
* The returned promise resolves when the host has processed the request.
|
|
44
|
+
*
|
|
45
|
+
* @param request - Optional parameters for opening contextual search.
|
|
46
|
+
* @returns Promise resolved when the host processes the request.
|
|
47
|
+
*
|
|
48
|
+
* @hidden
|
|
49
|
+
* @internal
|
|
50
|
+
* Limited to Microsoft-internal use
|
|
51
|
+
*/
|
|
52
|
+
export declare function openContextualSearch(request?: OpenContextualSearchRequest): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Closes the contextual search pane.
|
|
55
|
+
*
|
|
56
|
+
* The returned promise resolves when the host has processed the request.
|
|
57
|
+
*
|
|
58
|
+
* @returns Promise resolved when the host processes the request.
|
|
59
|
+
*
|
|
60
|
+
* @hidden
|
|
61
|
+
* @internal
|
|
62
|
+
* Limited to Microsoft-internal use
|
|
63
|
+
*/
|
|
64
|
+
export declare function closeContextualSearch(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Registers a handler invoked when the contextual search pane becomes visible.
|
|
67
|
+
*
|
|
68
|
+
* This includes pane visibility changes initiated by host entry points such as
|
|
69
|
+
* keyboard shortcuts or autosuggest.
|
|
70
|
+
*
|
|
71
|
+
* @param handler - Handler invoked when contextual search becomes visible.
|
|
72
|
+
*
|
|
73
|
+
* @hidden
|
|
74
|
+
* @internal
|
|
75
|
+
* Limited to Microsoft-internal use
|
|
76
|
+
*/
|
|
77
|
+
export declare function registerOnContextualSearchOpenedHandler(handler: ContextualSearchOpenedHandler): void;
|
|
78
|
+
/**
|
|
79
|
+
* Registers a handler invoked when the contextual search pane is closed.
|
|
80
|
+
*
|
|
81
|
+
* @param handler - Handler invoked when contextual search is closed.
|
|
82
|
+
*
|
|
83
|
+
* @hidden
|
|
84
|
+
* @internal
|
|
85
|
+
* Limited to Microsoft-internal use
|
|
86
|
+
*/
|
|
87
|
+
export declare function registerOnContextualSearchClosedHandler(handler: ContextualSearchClosedHandler): void;
|
|
88
|
+
/**
|
|
89
|
+
* Checks whether the contextual search capability is supported by the host.
|
|
90
|
+
*
|
|
91
|
+
* @returns Whether contextual search is supported.
|
|
92
|
+
*
|
|
93
|
+
* @throws Error if {@linkcode app.initialize} has not completed successfully.
|
|
94
|
+
*
|
|
95
|
+
* @hidden
|
|
96
|
+
* @internal
|
|
97
|
+
* Limited to Microsoft-internal use
|
|
98
|
+
*/
|
|
99
|
+
export declare function isSupported(): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as logs from './logs';
|
|
2
2
|
export { ChatMembersInformation, FilePreviewParameters, NotificationTypes, ShowNotificationParameters, TeamInstanceParameters, ThreadMember, UserJoinedTeamsInformation, ViewerActionTypes, UserSettingTypes, } from './interfaces';
|
|
3
3
|
export { sendCustomMessage, sendCustomEvent, registerCustomHandler, uploadCustomApp, registerUserSettingsChangeHandler, openFilePreview, } from './privateAPIs';
|
|
4
|
+
export * as contextualSearch from './contextualSearch';
|
|
4
5
|
export * as conversations from './conversations';
|
|
5
6
|
export { ConversationResponse, OpenConversationRequest } from './conversations';
|
|
6
7
|
export * as copilot from './copilot/copilot';
|
|
@@ -42,3 +42,12 @@ export declare function setFeatureFlagsState(featureFlags: RuntimeFeatureFlags):
|
|
|
42
42
|
* @returns The current state of the runtime feature flags.
|
|
43
43
|
*/
|
|
44
44
|
export declare function overwriteFeatureFlagsState(newFeatureFlags: Partial<RuntimeFeatureFlags>): RuntimeFeatureFlags;
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
* @internal
|
|
48
|
+
* Limited to Microsoft-internal use.
|
|
49
|
+
*
|
|
50
|
+
* Restores the runtime feature flags to their default values. This mirrors {@link resetBuildFeatureFlags}
|
|
51
|
+
* and is intended for test teardown so that a flag set by one test cannot leak into later ones.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resetFeatureFlagsState(): void;
|
|
@@ -25,46 +25,46 @@ export interface SearchQuery {
|
|
|
25
25
|
*/
|
|
26
26
|
export type SearchQueryHandler = (query: SearchQuery) => void;
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
28
|
+
* Allows the caller to register for various events fired by the host search experience.
|
|
29
|
+
* Calling this function indicates that your application intends to plug into the host's search box and handle search events,
|
|
30
|
+
* when the user is actively using your page/tab.
|
|
31
|
+
*
|
|
32
|
+
* The host may visually update its search box, e.g. with the name or icon of your application.
|
|
33
|
+
*
|
|
34
|
+
* Your application should *not* re-render inside of these callbacks, there may be a large number
|
|
35
|
+
* of onChangeHandler calls if the user is typing rapidly in the search box.
|
|
36
|
+
*
|
|
37
|
+
* @param onClosedHandler - This handler will be called when the user exits or cancels their search.
|
|
38
|
+
* Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm}
|
|
39
|
+
* will be whatever the last query was before ending search.
|
|
40
|
+
*
|
|
41
|
+
* @param onExecuteHandler - The handler will be called when the user executes their
|
|
42
|
+
* search (by pressing Enter for example). Should be used to display the full list of search results.
|
|
43
|
+
* The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.
|
|
44
|
+
*
|
|
45
|
+
* @param onChangeHandler - This optional handler will be called when the user first starts using the
|
|
46
|
+
* host's search box and as the user types their query. Can be used to put your application into a
|
|
47
|
+
* word-wheeling state or to display suggestions as the user is typing.
|
|
48
|
+
*
|
|
49
|
+
* This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,
|
|
50
|
+
* with the current contents of the search box.
|
|
51
|
+
* @example
|
|
52
|
+
* ``` ts
|
|
53
|
+
* search.registerHandlers(
|
|
54
|
+
* query => {
|
|
55
|
+
* console.log(`Update your application to handle the search experience being closed. Last query: ${query.searchTerm}`);
|
|
56
|
+
* },
|
|
57
|
+
* query => {
|
|
58
|
+
* console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);
|
|
59
|
+
* },
|
|
60
|
+
* query => {
|
|
61
|
+
* console.log(`Update your application with the changed search query: ${query.searchTerm}`);
|
|
62
|
+
* },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @beta
|
|
67
|
+
*/
|
|
68
68
|
export declare function registerHandlers(onClosedHandler: SearchQueryHandler, onExecuteHandler: SearchQueryHandler, onChangeHandler?: SearchQueryHandler): void;
|
|
69
69
|
/**
|
|
70
70
|
* Allows the caller to unregister for all events fired by the host search experience. Calling
|
|
@@ -29,8 +29,8 @@ export declare class UUID implements ISerializable {
|
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* @hidden
|
|
32
|
-
* Checks if the incoming id is an instance of
|
|
33
|
-
* @param id An object to check if it's an instance of
|
|
32
|
+
* Checks if the incoming id is an instance of UUID
|
|
33
|
+
* @param id An object to check if it's an instance of UUID
|
|
34
34
|
* @throws Error with a message describing the violation
|
|
35
35
|
* @internal
|
|
36
36
|
* Limited to Microsoft-internal use
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/
|
|
1
|
+
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/contextualSearch.js";export{t as contextualSearch};import*as o from"./private/conversations.js";export{o as conversations};import*as p from"./private/copilot/copilot.js";export{p as copilot};import*as i from"./private/copilot/sidePanelInterfaces.js";export{i as sidePanelInterfaces};import*as a from"./private/externalAppAuthenticationForCEA.js";export{a as externalAppAuthenticationForCEA};import*as s from"./private/externalAppCardActions.js";export{s as externalAppCardActions};import*as m from"./private/externalAppCardActionsForCEA.js";export{m as externalAppCardActionsForCEA};import*as n from"./private/externalAppCardActionsForDA.js";export{n as externalAppCardActionsForDA};import*as l from"./private/externalAppCommands.js";export{l as externalAppCommands};import*as c from"./private/files.js";export{c as files};import*as f from"./private/meetingRoom.js";export{f as meetingRoom};import*as u from"./private/messageChannels/messageChannels.js";export{u as messageChannels};import*as x from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{x as nestedAppAuthBridge};import*as j from"./private/notifications.js";export{j as notifications};import*as d from"./private/otherAppStateChange.js";export{d as otherAppStateChange};import*as g from"./private/plugins.js";export{g as plugins};import*as b from"./private/remoteCamera.js";export{b as remoteCamera};import*as v from"./private/appEntity.js";export{v as appEntity};import*as A from"./private/teams/teams.js";export{A as teams};import*as C from"./private/videoEffectsEx.js";export{C as videoEffectsEx};import*as h from"./private/hostEntity/hostEntity.js";export{h as hostEntity};import*as S from"./private/store.js";export{S as store};import*as H from"./private/widgetHosting/widgetHosting.js";export{H as widgetHosting};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,RenderingSurfaces,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as y from"./public/liveShareHost.js";export{y as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as F from"./public/authentication.js";export{F as authentication};import*as T from"./public/app/app.js";export{T as app};import*as E from"./public/appPerformanceMetrics.js";export{E as appPerformanceMetrics};import*as w from"./public/appInstallDialog.js";export{w as appInstallDialog};import*as I from"./public/barCode.js";export{I as barCode};import*as D from"./public/chat.js";export{D as chat};import*as P from"./public/clipboard.js";export{P as clipboard};import*as B from"./public/dialog/dialog.js";export{B as dialog};import*as k from"./public/nestedAppAuth.js";export{k as nestedAppAuth};import*as L from"./public/geoLocation/geoLocation.js";export{L as geoLocation};import*as M from"./public/pages/pages.js";export{M as pages};import*as U from"./public/menus.js";export{U as menus};import*as O from"./public/media.js";export{O as media};import*as R from"./public/secondaryBrowser.js";export{R as secondaryBrowser};import*as V from"./public/location.js";export{V as location};import*as z from"./public/meeting/meeting.js";export{z as meeting};import*as W from"./public/monetization.js";export{W as monetization};import*as N from"./public/calendar.js";export{N as calendar};import*as q from"./public/mail/mail.js";export{q as mail};import*as G from"./public/teamsAPIs.js";export{G as teamsCore};import*as J from"./public/people.js";export{J as people};import*as K from"./public/profile.js";export{K as profile};import*as Q from"./public/videoEffects.js";export{Q as videoEffects};import*as X from"./public/search.js";export{X as search};import*as Y from"./public/sharing/sharing.js";export{Y as sharing};import*as Z from"./public/stageView/stageView.js";export{Z as stageView};import*as $ from"./public/visualMedia/visualMedia.js";export{$ as visualMedia};import*as _ from"./public/webStorage.js";export{_ as webStorage};import*as ee from"./public/call.js";export{ee as call};import*as re from"./public/appInitialization.js";export{re as appInitialization};import*as te from"./public/thirdPartyCloudStorage.js";export{te as thirdPartyCloudStorage};import*as oe from"./public/settings.js";export{oe as settings};import*as pe from"./public/tasks.js";export{pe as tasks};import*as ie from"./public/marketplace.js";export{ie as marketplace};import*as ae from"./public/mouseRelay.js";export{ae as mouseRelay};import*as se from"./public/shortcutRelay.js";export{se as shortcutRelay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as o}from"./globalVars.js";import{getLogger as e}from"./telemetry.js";import{validateHostAgainstPattern as l,createURLVerifier as s}from"./urlPattern.js";import{inServerSideRenderingEnvironment as a,isValidHttpsURL as c}from"./utils.js";let u=[];const
|
|
1
|
+
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as o}from"./globalVars.js";import{getLogger as e}from"./telemetry.js";import{validateHostAgainstPattern as l,createURLVerifier as s}from"./urlPattern.js";import{inServerSideRenderingEnvironment as a,isValidHttpsURL as c}from"./utils.js";let u=[];const f=e("validateOrigin");let d;function g(){return i(this,void 0,void 0,function*(){d||(yield m())})}function p(){return 0===u.length}function m(o=!1){return i(this,void 0,void 0,function*(){if(!p()&&!o)return u;if(d)return d;if(a())return u=n,n;{f("Initiating fetch call to acquire valid origins list from CDN");const i=new AbortController,o=setTimeout(()=>i.abort(),t);return d=fetch(r,{signal:i.signal}).then(i=>{if(clearTimeout(o),!i.ok)throw new Error("Invalid Response from Fetch Call");return f("Fetch call completed and retrieved valid origins list from CDN"),i.json().then(i=>{if(h(JSON.stringify(i)))return u=i.validOrigins,u;throw new Error("Valid origins list retrieved from CDN is invalid")})}).catch(i=>("AbortError"===i.name?f(`validOrigins fetch call to CDN failed due to Timeout of ${t} ms. Defaulting to fallback list`):f("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),u=n,u)),d}})}function h(i){let t;try{t=JSON.parse(i)}catch(i){return!1}if(!t||!Array.isArray(t.validOrigins))return!1;for(const i of t.validOrigins){if("string"!=typeof i)return!1;try{new URL("https://"+i)}catch(t){return f("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}}return!0}function v(i,t){let r;try{const t=s(i,f);if(!t)return!1;r=t}catch(i){return!1}return r.test(t)}function b(i,t){const r=p()?n:u;return O(i,r)?Promise.resolve(!0):(f("Origin %s is not in the local valid origins list, fetching from CDN",i),m(t).then(t=>O(i,t)))}function O(i,t){for(const t of o.additionalValidOrigins)if(v(t,i))return!0;const r=i.host;return c(i)?!!t.some(i=>l(i,r))||(f("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,o.additionalValidOrigins),!1):(f("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1)}g();export{h as isValidOriginsJSONValid,g as prefetchOriginsFromCDN,b as validateOrigin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{callFunctionInHost as t}from"../internal/communication.js";import{registerHandlerHelper as e}from"../internal/handlers.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as o,errorNotSupportedOnPlatform as c}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";const l="v1";function u(e){if(n(a,o.content),!m())throw c;const u=[null==e?void 0:e.triggerSource];return t("contextualSearch.openContextualSearch",u,r(l,"contextualSearch.openContextualSearch"))}function i(){if(n(a,o.content),!m())throw c;return t("contextualSearch.closeContextualSearch",[],r(l,"contextualSearch.closeContextualSearch"))}function h(t){e(r(l,"contextualSearch.registerOpenContextualSearchHandler"),"contextualSearchOpened",t,[o.content],()=>{if(!m())throw c})}function s(t){e(r(l,"contextualSearch.registerCloseContextualSearchHandler"),"contextualSearchClosed",t,[o.content],()=>{if(!m())throw c})}function m(){return n(a)&&!!a.supports.contextualSearch}export{i as closeContextualSearch,m as isSupported,u as openContextualSearch,s as registerOnContextualSearchClosedHandler,h as registerOnContextualSearchOpenedHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const n={childProxyingCommunication:!1};function i(){n.childProxyingCommunication=!0}function o(){return n.childProxyingCommunication}let t={disableEnforceOriginMatchForChildResponses:!1};function c(){return t}function r(n){t=n}function e(n){return r(Object.assign(Object.assign({},t),n)),c()}export{i as activateChildProxyingCommunication,c as getCurrentFeatureFlagsState,o as isChildProxyingEnabled,e as overwriteFeatureFlagsState,r as setFeatureFlagsState};
|
|
1
|
+
const n={childProxyingCommunication:!1};function i(){n.childProxyingCommunication=!0}function o(){return n.childProxyingCommunication}let t=Object.assign({},{disableEnforceOriginMatchForChildResponses:!1});function c(){return t}function r(n){t=n}function e(n){return r(Object.assign(Object.assign({},t),n)),c()}export{i as activateChildProxyingCommunication,c as getCurrentFeatureFlagsState,o as isChildProxyingEnabled,e as overwriteFeatureFlagsState,r as setFeatureFlagsState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o="2.56.0";export{o as version};
|