@microsoft/teams-js 2.41.0 → 2.43.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 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.41.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.43.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.41.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-foat9bCJflCyiUx3dfsImCX29CW3tNCWjj2SYbHfO8fhbVBR6Z/UsY6i2ihfwpvZ"
48
+ src="https://res.cdn.office.net/teams-js/2.43.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-0nHNpMJRciJQlpaCyCYK4yo0UU4tusQNisqsYd0ViC1d+tHWCoicv0wyyqSyV45f"
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.41.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.43.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -307,6 +307,9 @@ export declare const enum ApiName {
307
307
  Settings_SetValidityState = "settings.setValidityState",
308
308
  Sharing_History_GetContent = "sharing.history.getContent",
309
309
  Sharing_ShareWebContent = "sharing.shareWebContent",
310
+ ShortcutRelay_GetHostShortcuts = "shortcutRelay.getHostShortcuts",
311
+ ShortcutRelay_ForwardShortcutEvent = "shortcutRelay.forwardShortcutEvent",
312
+ ShortcutRelay_HostShortcutChanged = "shortcutRelay.hostShortcutChanged",
310
313
  StageView_Open = "stageView.open",
311
314
  StageView_Self_Close = "stageView.self.close",
312
315
  Store_OpenFullStore = "store.openFullStore",
@@ -1,5 +1,6 @@
1
1
  import { AdaptiveCardVersion, SdkError } from '../public/interfaces';
2
2
  import * as pages from '../public/pages/pages';
3
+ import { IBaseRuntime } from '../public/runtime';
3
4
  /**
4
5
  * @internal
5
6
  * Limited to Microsoft-internal use
@@ -217,3 +218,9 @@ export declare function getCurrentTimestamp(): number | undefined;
217
218
  *
218
219
  */
219
220
  export declare function isPrimitiveOrPlainObject(value: unknown, depth?: number): boolean;
221
+ /**
222
+ * Normalizes legacy ageGroup values for backward compatibility
223
+ * @param runtimeConfig - The runtime configuration object to normalize
224
+ * @returns A new IBaseRuntime object with normalized ageGroup values
225
+ */
226
+ export declare function normalizeAgeGroupValue(runtimeConfig: IBaseRuntime): IBaseRuntime;
@@ -130,6 +130,11 @@ export interface AppInfo {
130
130
  * For displaying the time when the user clicked on the app, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} as it uses the date.
131
131
  */
132
132
  userClickTimeV2?: number;
133
+ /**
134
+ * The ID of the message from which this task module was launched.
135
+ * This is only available in task modules launched from bot cards.
136
+ */
137
+ messageId?: string;
133
138
  /**
134
139
  * The ID of the parent message from which this task module was launched.
135
140
  * This is only available in task modules launched from bot cards.
@@ -47,3 +47,4 @@ export * as liveShare from './liveShareHost';
47
47
  export { LiveShareHost } from './liveShareHost';
48
48
  export * as marketplace from './marketplace';
49
49
  export { ISerializable } from './serializable.interface';
50
+ export * as shortcutRelay from './shortcutRelay';
@@ -540,6 +540,14 @@ export interface Context {
540
540
  * The license type for the current user.
541
541
  */
542
542
  userLicenseType?: string;
543
+ /**
544
+ * @deprecated
545
+ * As of TeamsJS v2.0.0, please use {@link app.AppInfo.messageId | app.Context.app.messageId} instead
546
+ *
547
+ * The ID of the message from which this task module was launched.
548
+ * This is only available in task modules launched from bot cards.
549
+ */
550
+ messageId?: string;
543
551
  /**
544
552
  * @deprecated
545
553
  * As of TeamsJS v2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead
@@ -1144,7 +1152,11 @@ export declare enum LegalAgeGroupClassification {
1144
1152
  * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
1145
1153
  * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
1146
1154
  */
1147
- NonAdult = "nonAdult"
1155
+ NotAdult = "notAdult",
1156
+ /**
1157
+ * @deprecated To provide back compatibility for the NonAdult enum value coming from the hubs
1158
+ */
1159
+ NonAdult = "notAdult"
1148
1160
  }
1149
1161
  /**
1150
1162
  * @hidden
@@ -92,6 +92,7 @@ interface IRuntimeV4 extends IBaseRuntime {
92
92
  readonly sharing?: {
93
93
  readonly history?: {};
94
94
  };
95
+ readonly shortcutRelay?: {};
95
96
  readonly stageView?: {
96
97
  readonly self?: {};
97
98
  };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Allows host shortcuts to function in your application by forwarding keyboard shortcuts to the host.
3
+ *
4
+ * This functionality is in Beta.
5
+ * @beta
6
+ * @module
7
+ */
8
+ /**
9
+ * Data passed to the overridable shortcut handler.
10
+ */
11
+ export type OverridableShortcutHandlerData = {
12
+ /**
13
+ * The matched shortcut that triggered the handler.
14
+ * This is a canonical form of the shortcut, e.g. "ctrl+shift+x".
15
+ */
16
+ matchedShortcut: string;
17
+ };
18
+ /**
19
+ * A handler must return `true` when it wants to **consume** the shortcut
20
+ * (i.e. prevent forwarding to host). Any other return value forwards it.
21
+ */
22
+ export type OverridableShortcutHandler = (event: KeyboardEvent, data: OverridableShortcutHandlerData) => boolean;
23
+ /**
24
+ * Replace the current overridable-shortcut handler.
25
+ *
26
+ * • Pass `undefined` to remove an existing handler.
27
+ * • Returns the previous handler so callers can restore it if needed.
28
+ *
29
+ * @beta
30
+ */
31
+ export declare function setOverridableShortcutHandler(handler: OverridableShortcutHandler | undefined): OverridableShortcutHandler | undefined;
32
+ /**
33
+ * Reset the state of the shortcut relay capability.
34
+ * This is useful for tests to ensure a clean state.
35
+ *
36
+ * @beta
37
+ */
38
+ export declare function resetIsShortcutRelayCapabilityEnabled(): void;
39
+ /**
40
+ * Enable capability to support host shortcuts.
41
+ *
42
+ * @beta
43
+ */
44
+ export declare function enableShortcutRelayCapability(): Promise<void>;
45
+ /**
46
+ * Checks if shortcutRelay capability is supported by the host
47
+ * @returns boolean to represent whether the shortcutRelay capability is supported
48
+ *
49
+ * @throws Error if {@link app.initialize} has not successfully completed
50
+ *
51
+ * @beta
52
+ */
53
+ export declare function isSupported(): boolean;
54
+ /**
55
+ * Allow apps to define zones where shortcuts should not be forwarded to the host.
56
+ * This is useful for input fields for password where shortcuts should not trigger host actions.
57
+ *
58
+ * @beta
59
+ */
60
+ export declare const DISABLE_SHORTCUT_FORWARDING_ATTRIBUTE = "data-disable-shortcuts-forwarding";
@@ -1 +1 @@
1
- var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"],c={validOrigins:o};export{c as default,o as validOrigins};
1
+ var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com"],c={validOrigins:o};export{c as default,o as validOrigins};
@@ -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/logs.js";export{e as logs};import*as r from"./private/conversations.js";export{r as conversations};import*as t from"./private/copilot/copilot.js";export{t as copilot};import*as o from"./private/copilot/sidePanelInterfaces.js";export{o as sidePanelInterfaces};import*as p from"./private/externalAppAuthentication.js";export{p as externalAppAuthentication};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/remoteCamera.js";export{d as remoteCamera};import*as g from"./private/appEntity.js";export{g as appEntity};import*as b from"./private/teams/teams.js";export{b as teams};import*as v from"./private/videoEffectsEx.js";export{v as videoEffectsEx};import*as C from"./private/hostEntity/hostEntity.js";export{C as hostEntity};import*as A from"./private/store.js";export{A as store};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 h from"./public/liveShareHost.js";export{h as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as S from"./public/authentication.js";export{S as authentication};import*as H from"./public/app/app.js";export{H as app};import*as F from"./public/appInstallDialog.js";export{F as appInstallDialog};import*as y from"./public/barCode.js";export{y as barCode};import*as T from"./public/chat.js";export{T as chat};import*as E from"./public/clipboard.js";export{E as clipboard};import*as I from"./public/dialog/dialog.js";export{I as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as w from"./public/geoLocation/geoLocation.js";export{w as geoLocation};import*as P from"./public/pages/pages.js";export{P as pages};import*as B from"./public/menus.js";export{B as menus};import*as k from"./public/media.js";export{k as media};import*as L from"./public/secondaryBrowser.js";export{L as secondaryBrowser};import*as M from"./public/location.js";export{M as location};import*as U from"./public/meeting/meeting.js";export{U as meeting};import*as O from"./public/monetization.js";export{O as monetization};import*as V from"./public/calendar.js";export{V as calendar};import*as z from"./public/mail/mail.js";export{z as mail};import*as W from"./public/teamsAPIs.js";export{W as teamsCore};import*as N from"./public/people.js";export{N as people};import*as R from"./public/profile.js";export{R as profile};import*as q from"./public/videoEffects.js";export{q as videoEffects};import*as G from"./public/search.js";export{G as search};import*as J from"./public/sharing/sharing.js";export{J as sharing};import*as K from"./public/stageView/stageView.js";export{K as stageView};import*as Q from"./public/visualMedia/visualMedia.js";export{Q as visualMedia};import*as X from"./public/webStorage.js";export{X as webStorage};import*as Y from"./public/call.js";export{Y as call};import*as Z from"./public/appInitialization.js";export{Z as appInitialization};import*as $ from"./public/thirdPartyCloudStorage.js";export{$ as thirdPartyCloudStorage};import*as _ from"./public/settings.js";export{_ as settings};import*as ee from"./public/tasks.js";export{ee as tasks};import*as re from"./public/marketplace.js";export{re as marketplace};
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/logs.js";export{e as logs};import*as r from"./private/conversations.js";export{r as conversations};import*as t from"./private/copilot/copilot.js";export{t as copilot};import*as o from"./private/copilot/sidePanelInterfaces.js";export{o as sidePanelInterfaces};import*as p from"./private/externalAppAuthentication.js";export{p as externalAppAuthentication};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/remoteCamera.js";export{d as remoteCamera};import*as g from"./private/appEntity.js";export{g as appEntity};import*as b from"./private/teams/teams.js";export{b as teams};import*as v from"./private/videoEffectsEx.js";export{v as videoEffectsEx};import*as C from"./private/hostEntity/hostEntity.js";export{C as hostEntity};import*as A from"./private/store.js";export{A as store};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 h from"./public/liveShareHost.js";export{h as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as S from"./public/authentication.js";export{S as authentication};import*as H from"./public/app/app.js";export{H as app};import*as F from"./public/appInstallDialog.js";export{F as appInstallDialog};import*as y from"./public/barCode.js";export{y as barCode};import*as T from"./public/chat.js";export{T as chat};import*as E from"./public/clipboard.js";export{E as clipboard};import*as I from"./public/dialog/dialog.js";export{I as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as w from"./public/geoLocation/geoLocation.js";export{w as geoLocation};import*as P from"./public/pages/pages.js";export{P as pages};import*as B from"./public/menus.js";export{B as menus};import*as k from"./public/media.js";export{k as media};import*as L from"./public/secondaryBrowser.js";export{L as secondaryBrowser};import*as M from"./public/location.js";export{M as location};import*as U from"./public/meeting/meeting.js";export{U as meeting};import*as O from"./public/monetization.js";export{O as monetization};import*as V from"./public/calendar.js";export{V as calendar};import*as z from"./public/mail/mail.js";export{z as mail};import*as R from"./public/teamsAPIs.js";export{R as teamsCore};import*as W from"./public/people.js";export{W as people};import*as N from"./public/profile.js";export{N as profile};import*as q from"./public/videoEffects.js";export{q as videoEffects};import*as G from"./public/search.js";export{G as search};import*as J from"./public/sharing/sharing.js";export{J as sharing};import*as K from"./public/stageView/stageView.js";export{K as stageView};import*as Q from"./public/visualMedia/visualMedia.js";export{Q as visualMedia};import*as X from"./public/webStorage.js";export{X as webStorage};import*as Y from"./public/call.js";export{Y as call};import*as Z from"./public/appInitialization.js";export{Z as appInitialization};import*as $ from"./public/thirdPartyCloudStorage.js";export{$ as thirdPartyCloudStorage};import*as _ from"./public/settings.js";export{_ as settings};import*as ee from"./public/tasks.js";export{ee as tasks};import*as re from"./public/marketplace.js";export{re as marketplace};import*as te from"./public/shortcutRelay.js";export{te as shortcutRelay};
@@ -1 +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{sendMessageToParent as e,sendAndHandleStatusAndReason as n,callFunctionInHostAndHandleResponse as t,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 S}from"./utils.js";import{Messages as j}from"../public/app/app.js";import{FrameContexts as v}from"../public/constants.js";import{initialize as w}from"../public/dialog/dialog.js";import{initialize as y}from"../public/menus.js";import{runtime as z,applyRuntimeConfig as b,generateVersionBasedTeamsRuntimeConfig as P,mapTeamsVersionToSupportedCapabilities as C,versionAndPlatformAgnosticTeamsRuntimeConfig as x}from"../public/runtime.js";import{version as D}from"../public/version.js";import{SimpleTypeResponseHandler as E}from"./responseHandler.js";import{initialize as V}from"../public/pages/config.js";const K=f("app");function _(i,e){if(g()){return K.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return h((()=>function(i,e){return new Promise((n=>{l.initializeCalled||(l.initializeCalled=!0,p(),l.initializePromise=o(e,i).then((({context:i,clientType:e,runtimeConfig:n,clientSupportedSDKVersion:t=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=t;try{H("Parsing %s",n);const i=JSON.parse(n);if(H("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");n&&b(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{H("Attempting to parse %s as an SDK version",n),isNaN(S(n,s))||(l.clientSupportedSDKVersion=n);const i=JSON.parse(t);if(H("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");b(i)}catch(i){if(!(i instanceof SyntaxError))throw i;b(P(l.clientSupportedSDKVersion,x,C))}}l.initializeCompleted=!0})),y(),V(),w()),Array.isArray(e)&&c(e),void 0!==l.initializePromise?n(l.initializePromise):H("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),6e4,new Error("SDK initialization timed out."))}function k(i){e(i,j.AppLoaded,[D])}function A(i,n){e(i,j.ExpectedFailure,[n.reason,n.message])}function F(i,n){e(i,j.Failure,[n.reason,n.message])}function N(e){return i(this,void 0,void 0,(function*(){if(l.initializeCompleted)return R(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then((()=>R(e)))}))}function R(n){return i(this,void 0,void 0,(function*(){return m(z)&&(null===(i=z.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?t(j.Success,[D],new E,n).then((()=>({hasFinishedSuccessfully:!0}))):(e(n,j.Success,[D]),{hasFinishedSuccessfully:"unknown"});var i}))}const H=K.extend("initializeHelper");function J(i,e){!d(e)&&u(),a(i,e)}function L(i,e){return new Promise((t=>{m(z,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),t(n(i,"executeDeepLink",e))}))}export{_ as appInitializeHelper,R as callNotifySuccessInHost,k as notifyAppLoadedHelper,A as notifyExpectedFailureHelper,F as notifyFailureHelper,N as notifySuccessHelper,L as openLinkHelper,J as registerOnThemeChangeHandlerHelper};
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,normalizeAgeGroupValue as S,compareSDKVersions as j}from"./utils.js";import{Messages as v}from"../public/app/app.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);let 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");i=S(i),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);let 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");i=S(i),P(i)}catch(i){if(!(i instanceof SyntaxError))throw i;P(C(l.clientSupportedSDKVersion,D,x))}}l.initializeCompleted=!0})),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,v.AppLoaded,[E])}function F(i,t){e(i,v.ExpectedFailure,[t.reason,t.message])}function N(i,t){e(i,v.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(v.Success,[E],new V,t).then((()=>({hasFinishedSuccessfully:!0}))):(e(t,v.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{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.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 f(t,e,...r){const n=t(...r);return n.then((()=>{e&&e(null)})).catch((t=>{e&&e(t)})),n}function l(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(null,t)})).catch((t=>{e&&e(t,null)})),n}function a(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(t){return!(i(`${t.majorVersion}.${t.minorVersion}`,`${e.majorVersion}.${e.minorVersion}`)>=0)}function m(t){return"https:"===t.protocol}function h(e,r){return new Promise(((n,o)=>{if(e||o("MimeType cannot be null or empty."),r||o("Base64 string cannot be null or empty."),e.startsWith("image/")){const t=atob(r),o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);n(new Blob([o],{type:e}))}const i=t.from(r,"base64").toString();n(new Blob([i],{type:e}))}))}function b(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 w(){if(g())throw new Error("window object undefined at SSR check");return window}function g(){return"undefined"==typeof window}function y(t,e){if(v(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(v(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 v(t){return new RegExp(`${/<script[^>]*>|&lt;script[^&]*&gt;|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|&lt;\/script[^&]*&gt;|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function I(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 S(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=>S(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=>S(t[r],e+1)))}export{h as base64ToBlob,s as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,l as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,f as callCallbackWithSdkErrorFromPromiseAndReturnPromise,i as compareSDKVersions,p as createTeamsAppLink,u as deepFreeze,E as fullyQualifyUrlString,c as generateGUID,b as getBase64StringFromBlob,O as getCurrentTimestamp,o as getGenericOnCompleteHandler,v as hasScriptTags,g as inServerSideRenderingEnvironment,d as isHostAdaptiveCardSchemaVersionUnsupported,S as isPrimitiveOrPlainObject,m as isValidHttpsURL,a as runWithTimeout,w as ssrSafeWindow,y as validateId,j as validateUrl,I as validateUuid};
1
+ import{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.js";import{LegalAgeGroupClassification as n}from"../public/interfaces.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import o from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function i(t){return(t,e)=>{if(!t)throw new Error(e)}}function s(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const n=t.split("."),r=e.split(".");function o(t){return/^\d+$/.test(t)}if(!n.every(o)||!r.every(o))return NaN;for(;n.length<r.length;)n.push("0");for(;r.length<n.length;)r.push("0");for(let t=0;t<n.length;++t)if(Number(n[t])!=Number(r[t]))return Number(n[t])>Number(r[t])?1:-1;return 0}function u(){return r()}function c(t){return Object.keys(t).forEach((e=>{null!==t[e]&&void 0!==t[e]&&"object"==typeof t[e]&&c(t[e])})),Object.freeze(t)}function a(t,e,...n){const r=t(...n);return r.then((t=>{e&&e(void 0,t)})).catch((t=>{e&&e(t)})),r}function l(t,e,...n){const r=t(...n);return r.then((()=>{e&&e(null)})).catch((t=>{e&&e(t)})),r}function f(t,e,...n){const r=t(...n);return r.then((t=>{e&&e(null,t)})).catch((t=>{e&&e(t,null)})),r}function p(t,e,n){return new Promise(((r,o)=>{const i=setTimeout(o,e,n);t().then((t=>{clearTimeout(i),r(t)})).catch((t=>{clearTimeout(i),o(t)}))}))}function d(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 m(t){return!(s(`${t.majorVersion}.${t.minorVersion}`,`${e.majorVersion}.${e.minorVersion}`)>=0)}function h(t){return"https:"===t.protocol}function b(e,n){return new Promise(((r,o)=>{if(e||o("MimeType cannot be null or empty."),n||o("Base64 string cannot be null or empty."),e.startsWith("image/")){const t=atob(n),o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);r(new Blob([o],{type:e}))}const i=t.from(n,"base64").toString();r(new Blob([i],{type:e}))}))}function g(t){return new Promise(((e,n)=>{0===t.size&&n(new Error("Blob cannot be empty."));const r=new FileReader;r.onloadend=()=>{r.result?e(r.result.toString().split(",")[1]):n(new Error("Failed to read the blob"))},r.onerror=()=>{n(r.error)},r.readAsDataURL(t)}))}function w(){if(y())throw new Error("window object undefined at SSR check");return window}function y(){return"undefined"==typeof window}function j(t,e){if(E(t)||!function(t){return t.length<256&&t.length>4}(t)||!function(t){for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<32||n>126)return!1}return!0}(t))throw e||new Error("id is not valid.")}function I(t,e){const n=t.toString().toLocaleLowerCase();if(E(n))throw new Error("Invalid Url");if(n.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!h(t))throw new Error("Url should be a valid https url")}function v(t){const e=document.createElement("a");return e.href=t,new URL(e.href)}function E(t){return new RegExp(`${/<script[^>]*>|&lt;script[^&]*&gt;|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|&lt;\/script[^&]*&gt;|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function O(t){if(!t)throw new Error("id must not be empty");if(!1===o(t))throw new Error("id must be a valid UUID")}const U=!!performance&&"now"in performance;function N(){return U?performance.now()+performance.timeOrigin:void 0}function S(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=>S(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((n=>S(t[n],e+1)))}function P(t){var e,r;if(!(null===(r=null===(e=t.hostVersionsInfo)||void 0===e?void 0:e.appEligibilityInformation)||void 0===r?void 0:r.ageGroup))return t;const o=t.hostVersionsInfo.appEligibilityInformation.ageGroup;return"nonadult"!==(null==o?void 0:o.toLowerCase())?t:Object.assign(Object.assign({},t),{hostVersionsInfo:Object.assign(Object.assign({},t.hostVersionsInfo),{appEligibilityInformation:Object.assign(Object.assign({},t.hostVersionsInfo.appEligibilityInformation),{ageGroup:n.NotAdult})})})}export{b as base64ToBlob,a as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,f as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,l as callCallbackWithSdkErrorFromPromiseAndReturnPromise,s as compareSDKVersions,d as createTeamsAppLink,c as deepFreeze,v as fullyQualifyUrlString,u as generateGUID,g as getBase64StringFromBlob,N as getCurrentTimestamp,i as getGenericOnCompleteHandler,E as hasScriptTags,y as inServerSideRenderingEnvironment,m as isHostAdaptiveCardSchemaVersionUnsupported,S as isPrimitiveOrPlainObject,h as isValidHttpsURL,P as normalizeAgeGroupValue,p as runWithTimeout,w as ssrSafeWindow,j as validateId,I as validateUrl,O as validateUuid};
@@ -1 +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 t}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as e}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as s}from"../../public/runtime.js";const a=r("copilot");function p(){var i,o;return t(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 u(r){var u,m;return i(this,void 0,void 0,(function*(){if(t(s),!p())throw new Error(`Error code: ${n.errorCode}, message: Not supported on platform`);if((null===(u=s.hostVersionsInfo)||void 0===u?void 0:u.appEligibilityInformation)&&!r)return a("Eligibility information is already available on runtime."),s.hostVersionsInfo.appEligibilityInformation;a("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(e("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo",r);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||i.featureSet&&(void 0===i.featureSet.serverFeatures||void 0===i.featureSet.uxFeatures))return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return i}))}export{u as getEligibilityInfo,p as isSupported};
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 t}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as e}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../public/constants.js";import{isSdkError as l,LegalAgeGroupClassification as s}from"../../public/interfaces.js";import{runtime as a}from"../../public/runtime.js";const u=r("copilot");function p(){var i,o;return t(a)&&(!!(null===(i=a.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation)||!!(null===(o=a.supports.copilot)||void 0===o?void 0:o.eligibility))}function d(r){var d,m,f;return i(this,void 0,void 0,(function*(){if(t(a),!p())throw new Error(`Error code: ${n.errorCode}, message: Not supported on platform`);if((null===(d=a.hostVersionsInfo)||void 0===d?void 0:d.appEligibilityInformation)&&!r)return u("Eligibility information is already available on runtime."),a.hostVersionsInfo.appEligibilityInformation;u("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(e("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo",r);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||i.featureSet&&(void 0===i.featureSet.serverFeatures||void 0===i.featureSet.uxFeatures))return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return"nonadult"===(null===(f=i.ageGroup)||void 0===f?void 0:f.toLowerCase())&&(i.ageGroup=s.NotAdult),i}))}export{d as getEligibilityInfo,p as isSupported};
@@ -1 +1 @@
1
- import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as r}from"../../internal/appHelpers.js";import{uninitializeCommunication as s,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as g}from"../../internal/utils.js";import{AppId as I}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),s())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new I(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,renderingSurface:e.renderingSurface?e.renderingSurface:void 0,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return r(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(g())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
1
+ import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as r,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as g}from"../../internal/utils.js";import{AppId as I}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),r())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,messageId:e.messageId,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new I(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,renderingSurface:e.renderingSurface?e.renderingSurface:void 0,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return s(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(g())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
@@ -1 +1 @@
1
- var n,e,t,E,O,R,o,T,N,_;function i(n){return void 0!==(null==n?void 0:n.errorCode)}!function(n){n.Inline="inline",n.Desktop="desktop",n.Web="web"}(n||(n={})),function(n){n.M365Content="m365content"}(e||(e={})),function(n){n.DriveId="driveId",n.GroupId="groupId",n.SiteId="siteId",n.UserId="userId"}(t||(t={})),function(n){n[n.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",n[n.INTERNAL_ERROR=500]="INTERNAL_ERROR",n[n.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",n[n.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",n[n.NETWORK_ERROR=2e3]="NETWORK_ERROR",n[n.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",n[n.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",n[n.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",n[n.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",n[n.THROTTLE=7e3]="THROTTLE",n[n.USER_ABORT=8e3]="USER_ABORT",n[n.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",n[n.OLD_PLATFORM=9e3]="OLD_PLATFORM",n[n.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",n[n.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED"}(E||(E={})),function(n){n.GeoLocation="geolocation",n.Media="media"}(O||(O={})),function(n){n.BCAIS="bcais",n.BCWAF="bcwaf",n.BCWBF="bcwbf"}(R||(R={})),function(n){n.Faculty="faculty",n.Student="student",n.Other="other"}(o||(o={})),function(n){n.Adult="adult",n.MinorNoParentalConsentRequired="minorNoParentalConsentRequired",n.MinorWithoutParentalConsent="minorWithoutParentalConsent",n.MinorWithParentalConsent="minorWithParentalConsent",n.NonAdult="nonAdult"}(T||(T={})),function(n){n.HigherEducation="higherEducation",n.K12="k12",n.Other="other"}(N||(N={})),function(n){n.TextPlain="text/plain",n.TextHtml="text/html",n.ImagePNG="image/png",n.ImageJPEG="image/jpeg"}(_||(_={}));export{e as ActionObjectType,_ as ClipboardSupportedMimeType,R as Cohort,O as DevicePermission,N as EduType,E as ErrorCode,n as FileOpenPreference,T as LegalAgeGroupClassification,o as Persona,t as SecondaryM365ContentIdName,i as isSdkError};
1
+ var t,n,e,E,O,R,o,T,N,_;function i(t){return void 0!==(null==t?void 0:t.errorCode)}!function(t){t.Inline="inline",t.Desktop="desktop",t.Web="web"}(t||(t={})),function(t){t.M365Content="m365content"}(n||(n={})),function(t){t.DriveId="driveId",t.GroupId="groupId",t.SiteId="siteId",t.UserId="userId"}(e||(e={})),function(t){t[t.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",t[t.INTERNAL_ERROR=500]="INTERNAL_ERROR",t[t.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",t[t.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",t[t.NETWORK_ERROR=2e3]="NETWORK_ERROR",t[t.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",t[t.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",t[t.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",t[t.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",t[t.THROTTLE=7e3]="THROTTLE",t[t.USER_ABORT=8e3]="USER_ABORT",t[t.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",t[t.OLD_PLATFORM=9e3]="OLD_PLATFORM",t[t.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",t[t.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED"}(E||(E={})),function(t){t.GeoLocation="geolocation",t.Media="media"}(O||(O={})),function(t){t.BCAIS="bcais",t.BCWAF="bcwaf",t.BCWBF="bcwbf"}(R||(R={})),function(t){t.Faculty="faculty",t.Student="student",t.Other="other"}(o||(o={})),function(t){t.Adult="adult",t.MinorNoParentalConsentRequired="minorNoParentalConsentRequired",t.MinorWithoutParentalConsent="minorWithoutParentalConsent",t.MinorWithParentalConsent="minorWithParentalConsent",t.NotAdult="notAdult",t.NonAdult="notAdult"}(T||(T={})),function(t){t.HigherEducation="higherEducation",t.K12="k12",t.Other="other"}(N||(N={})),function(t){t.TextPlain="text/plain",t.TextHtml="text/html",t.ImagePNG="image/png",t.ImageJPEG="image/jpeg"}(_||(_={}));export{n as ActionObjectType,_ as ClipboardSupportedMimeType,R as Cohort,O as DevicePermission,N as EduType,E as ErrorCode,t as FileOpenPreference,T as LegalAgeGroupClassification,o as Persona,e as SecondaryM365ContentIdName,i as isSdkError};
@@ -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{callFunctionInHost as e,callFunctionInHostAndHandleResponse as r}from"../internal/communication.js";import{registerHandler as o}from"../internal/handlers.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{ResponseHandler as s}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{errorNotSupportedOnPlatform as a}from"./constants.js";import{runtime as c}from"./runtime.js";class h{constructor(t){this.event=t}serialize(){return{altKey:this.event.altKey,bubbles:this.event.bubbles,cancelBubble:this.event.cancelBubble,charCode:this.event.charCode,code:this.event.code,composed:this.event.composed,ctrlKey:this.event.ctrlKey,defaultPrevented:this.event.defaultPrevented,detail:this.event.detail,eventPhase:this.event.eventPhase,isComposing:this.event.isComposing,isTrusted:this.event.isTrusted,key:this.event.key,keyCode:this.event.keyCode,location:this.event.location,metaKey:this.event.metaKey,repeat:this.event.repeat,returnValue:this.event.returnValue,shiftKey:this.event.shiftKey,timeStamp:this.event.timeStamp,type:this.event.type,which:this.event.which}}}function u(t){return t.toLowerCase().split("+").sort().join("+")}function l(t,e){if(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey||!!t.key&&"escape"===t.key.toLowerCase()}(e)){const r=function(t){return[t.ctrlKey&&"ctrl",t.shiftKey&&"shift",t.altKey&&"alt",t.metaKey&&"meta",t.key.toLowerCase()].filter(Boolean).sort().join("+")}(e);if(t.has(r))return{matchedShortcut:r,isOverridable:f.has(r)}}return{matchedShortcut:void 0,isOverridable:!1}}function d(t){y.clear(),t.shortcuts.forEach((t=>{y.add(u(t))})),f.clear(),t.overridableShortcuts.forEach((t=>{f.add(u(t))}))}class v extends s{validate(t){return t&&Array.isArray(t.shortcuts)&&Array.isArray(t.overridableShortcuts)}deserialize(t){return t}}function m(t){if(t.target.closest(`[${g}]`))return;const{matchedShortcut:r,isOverridable:o}=l(y,t);if(!r)return;if(o&&p){if(p(t,{matchedShortcut:r}))return}const n=new h(t);e("shortcutRelay.forwardShortcutEvent",[n],i("v2","shortcutRelay.forwardShortcutEvent")),t.preventDefault(),t.stopImmediatePropagation()}const f=new Set,y=new Set;let p,b=!1;function w(t){if(!C())throw a;const e=p;return p=t,e}function K(){if(!C())throw a;b=!1,y.clear(),f.clear(),p=void 0,document.removeEventListener("keydown",m,{capture:!0})}function S(){return t(this,void 0,void 0,(function*(){if(!C())throw a;var t;d(yield r("shortcutRelay.getHostShortcuts",[],new v,i("v2","shortcutRelay.getHostShortcuts"))),b||document.addEventListener("keydown",m,{capture:!0}),b=!0,t=t=>{d(t)},o(i("v2","shortcutRelay.hostShortcutChanged"),"shortcutRelay.hostShortcutChanged",t)}))}function C(){return!(!n(c)||!c.supports.shortcutRelay)}const g="data-disable-shortcuts-forwarding";export{g as DISABLE_SHORTCUT_FORWARDING_ATTRIBUTE,S as enableShortcutRelayCapability,C as isSupported,K as resetIsShortcutRelayCapabilityEnabled,w as setOverridableShortcutHandler};
@@ -1 +1 @@
1
- const o="2.41.0";export{o as version};
1
+ const o="2.43.0";export{o as version};