@microsoft/teams-js 2.38.0 → 2.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +4 -0
  3. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +7 -0
  4. package/dist/esm/packages/teams-js/dts/private/copilot/copilot.d.ts +2 -1
  5. package/dist/esm/packages/teams-js/dts/private/copilot/sidePanel.d.ts +75 -0
  6. package/dist/esm/packages/teams-js/dts/private/copilot/sidePanelInterfaces.d.ts +320 -0
  7. package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
  8. package/dist/esm/packages/teams-js/dts/private/nestedAppAuth/nestedAppAuthBridge.d.ts +1 -1
  9. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +6 -0
  10. package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
  11. package/dist/esm/packages/teams-js/src/index.js +1 -1
  12. package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
  13. package/dist/esm/packages/teams-js/src/private/copilot/copilot.js +1 -1
  14. package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -0
  15. package/dist/esm/packages/teams-js/src/private/copilot/sidePanelInterfaces.js +1 -0
  16. package/dist/esm/packages/teams-js/src/private/nestedAppAuth/nestedAppAuthBridge.js +1 -1
  17. package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
  18. package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
  19. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  20. package/dist/umd/MicrosoftTeams.js +328 -31
  21. package/dist/umd/MicrosoftTeams.js.map +1 -1
  22. package/dist/umd/MicrosoftTeams.min.js +1 -1
  23. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  24. package/package.json +1 -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.38.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.39.1/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.38.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-CSbYzgz9TIYoBSvbWOMnpXDQEcYTRLoQMPm/2pT3KHeLQnrZemnbTi/BUn1Gpa9c"
48
+ src="https://res.cdn.office.net/teams-js/2.39.1/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-DCaADE5ucxq02uymDGfLHqBklxuM03ZONTCmqdwEFNouwR1kHsPHVT1UYOyb3X72"
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.38.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.39.1/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -84,6 +84,10 @@ export declare const enum ApiName {
84
84
  Conversations_RegisterStartConversationHandler = "conversations.registerStartConversationHandler",
85
85
  Copilot_CustomTelemetry_SendCustomTelemetryData = "copilot.customTelemetry.sendCustomTelemetryData",
86
86
  Copilot_Eligibility_GetEligibilityInfo = "copilot.eligibility.getEligibilityInfo",
87
+ Copilot_SidePanel_RegisterUserActionContentSelect = "copilot.sidePanel.registerUserActionContentSelect",
88
+ Copilot_SidePanel_RegisterOnUserConsentChange = "copilot.sidePanel.registerOnUserConsentChange",
89
+ Copilot_SidePanel_GetContent = "copilot.sidePanel.getContent",
90
+ Copilot_SidePanel_PreCheckUserConsent = "copilot.sidePanel.preCheckUserConsent",
87
91
  Dialog_AdaptiveCard_Bot_Open = "dialog.adaptiveCard.bot.open",
88
92
  Dialog_AdaptiveCard_Open = "dialog.adaptiveCard.open",
89
93
  Dialog_RegisterMessageForChildHandler = "dialog.registerMessageForChildHandler",
@@ -4,3 +4,10 @@ export declare function prefetchOriginsFromCDN(): Promise<void>;
4
4
  * Limited to Microsoft-internal use
5
5
  */
6
6
  export declare function validateOrigin(messageOrigin: URL, disableCache?: boolean): Promise<boolean>;
7
+ /**
8
+ * @internal
9
+ * Limited to Microsoft-internal use
10
+ *
11
+ * This function is only used for testing to reset the valid origins cache and ignore prefetched values.
12
+ */
13
+ export declare function resetValidOriginsCache(): void;
@@ -1,3 +1,4 @@
1
1
  import * as customTelemetry from './customTelemetry';
2
2
  import * as eligibility from './eligibility';
3
- export { customTelemetry, eligibility };
3
+ import * as sidePanel from './sidePanel';
4
+ export { customTelemetry, eligibility, sidePanel };
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @beta
3
+ * @hidden
4
+ * User information required by specific apps
5
+ * @internal
6
+ * Limited to Microsoft-internal use
7
+ * @module
8
+ */
9
+ import { SdkError } from '../../public/interfaces';
10
+ import { Content, ContentRequest, PreCheckContextResponse, SidePanelError, SidePanelErrorImpl } from './sidePanelInterfaces';
11
+ /**
12
+ * @hidden
13
+ * @internal
14
+ * Limited to Microsoft-internal use
15
+ * @beta
16
+ * @returns boolean to represent whether copilot.sidePanel capability is supported
17
+ *
18
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
19
+ */
20
+ export declare function isSupported(): boolean;
21
+ /**
22
+ * @beta
23
+ * @hidden
24
+ * Determines if the provided error object is an instance of SidePanelError or SdkError.
25
+ * @internal
26
+ * Limited to Microsoft-internal use
27
+ * @param err The error object to check whether it is of SidePanelError type
28
+ */
29
+ export declare function isResponseAReportableError(err: unknown): err is SidePanelError | SdkError;
30
+ /**
31
+ * Get user content data from the hub to send to copilot app.
32
+ *
33
+ * @returns { Promise<Content> } - promise resolves with a content object containing user content data
34
+ * @throws { SidePanelError | SdkError } - Throws a SidePanelError or SdkError if host SDK returns an error as a response to this call
35
+ *
36
+ * @hidden
37
+ * @beta
38
+ * @internal
39
+ * Limited to Microsoft-internal use
40
+ */
41
+ export declare function getContent(request?: ContentRequest): Promise<Content>;
42
+ /**
43
+ * When the copilot detects a contextual query it gets the user consent status before making the getContent call.
44
+ *
45
+ * @returns { Promise<PreCheckContextResponse> } - promise resolves with a content object containing user content data
46
+ * @throws { SidePanelError | SdkError } - Throws a SidePanelError or SdkError if host SDK returns an error as a response to this call
47
+ *
48
+ * @hidden
49
+ * @beta
50
+ * @internal
51
+ * Limited to Microsoft-internal use
52
+ */
53
+ export declare function preCheckUserConsent(): Promise<PreCheckContextResponse>;
54
+ /** Register user action content select handler function type */
55
+ export type userActionHandlerType = (selectedContent: Content) => void;
56
+ /**
57
+ * @hidden
58
+ * @beta
59
+ * Registers a handler to get updated content data from the hub to send to copilot app.
60
+ * This handler will be called when the user selects content in the application.
61
+ * @param handler - The handler for getting user action content select.
62
+ *
63
+ * @internal
64
+ * Limited to Microsoft-internal use
65
+ */
66
+ export declare function registerUserActionContentSelect(handler: userActionHandlerType): void;
67
+ /**
68
+ * @hidden
69
+ * @beta
70
+ * @internal
71
+ * Limited to Microsoft-internal use
72
+ *
73
+ * Error thrown when the copilot side panel API is not supported on the current platform.
74
+ */
75
+ export declare const copilotSidePanelNotSupportedOnPlatformError: SidePanelErrorImpl;
@@ -0,0 +1,320 @@
1
+ /**
2
+ * @hidden
3
+ *
4
+ * Interface for content data
5
+ *
6
+ * @internal
7
+ * Limited to Microsoft-internal use
8
+ */
9
+ export declare enum ContentItemType {
10
+ EMAIL = "email",
11
+ TEXT = "text",
12
+ MEDIA = "media",
13
+ CALENDAR_INVITE = "calendarInvite",
14
+ WEB_PAGE = "webPage",
15
+ MIXED = "mixed"
16
+ }
17
+ /**
18
+ * @hidden
19
+ *
20
+ * Common properties for all email content types
21
+ *
22
+ * @internal
23
+ * Limited to Microsoft-internal use
24
+ */
25
+ export interface BaseEmailContent {
26
+ subject?: string;
27
+ body?: string;
28
+ sender?: string;
29
+ recipients?: string[];
30
+ cc?: string[];
31
+ bcc?: string[];
32
+ attachments?: string[];
33
+ renderedHtml?: string;
34
+ }
35
+ /**
36
+ * @hidden
37
+ *
38
+ * Interface for server email content (must have id, receivedTime, sentTime)
39
+ *
40
+ * @internal
41
+ * Limited to Microsoft-internal use
42
+ */
43
+ export interface ServerEmailContent extends BaseEmailContent {
44
+ id: string;
45
+ receivedTime?: Date;
46
+ sentTime?: Date;
47
+ }
48
+ /**
49
+ * @hidden
50
+ *
51
+ * Interface for draft email content (no id, times optional)
52
+ *
53
+ * @internal
54
+ * Limited to Microsoft-internal use
55
+ */
56
+ export interface DraftEmailContent extends BaseEmailContent {
57
+ responseToEmailId?: string;
58
+ savedTime?: Date;
59
+ }
60
+ /**
61
+ * @hidden
62
+ *
63
+ * Interface for draft email content (no id, times optional)
64
+ *
65
+ * @internal
66
+ * Limited to Microsoft-internal use
67
+ */
68
+ export type EmailContent = ServerEmailContent | DraftEmailContent;
69
+ /**
70
+ * @hidden
71
+ *
72
+ * Interface for email content data
73
+ *
74
+ * @internal
75
+ * Limited to Microsoft-internal use
76
+ */
77
+ export interface CalendarInviteContent {
78
+ id: string;
79
+ title?: string;
80
+ startTime?: Date;
81
+ endTime?: Date;
82
+ location?: string;
83
+ meetingParameters?: string;
84
+ attendees?: string[];
85
+ organizer?: string;
86
+ body?: string;
87
+ attachments?: string[];
88
+ }
89
+ /**
90
+ * @hidden
91
+ *
92
+ * Interface for web page content data
93
+ *
94
+ * @internal
95
+ * Limited to Microsoft-internal use
96
+ */
97
+ export interface WebPageContent {
98
+ id?: string;
99
+ url: string;
100
+ title?: string;
101
+ data?: string;
102
+ description_for_model?: string;
103
+ description?: string;
104
+ faviconUrl?: string;
105
+ }
106
+ /**
107
+ * @hidden
108
+ *
109
+ * Interface for user selected content data
110
+ *
111
+ * @internal
112
+ * Limited to Microsoft-internal use
113
+ */
114
+ export interface TextSelection {
115
+ content: string;
116
+ source?: EmailContent | WebPageContent | CalendarInviteContent;
117
+ }
118
+ /**
119
+ * @hidden
120
+ *
121
+ * Interface for image media content
122
+ *
123
+ * @internal
124
+ * Limited to Microsoft-internal use
125
+ */
126
+ export interface ImageContent {
127
+ url: string;
128
+ width?: number;
129
+ height?: number;
130
+ fileSize?: number;
131
+ format?: string;
132
+ thumbnailUrl?: string;
133
+ }
134
+ /**
135
+ * @hidden
136
+ *
137
+ * Interface for audio media content
138
+ *
139
+ * @internal
140
+ * Limited to Microsoft-internal use
141
+ */
142
+ export interface AudioContent {
143
+ url: string;
144
+ duration?: number;
145
+ fileSize?: number;
146
+ format?: string;
147
+ transcript?: string;
148
+ }
149
+ /**
150
+ * @hidden
151
+ *
152
+ * Interface for video media content
153
+ *
154
+ * @internal
155
+ * Limited to Microsoft-internal use
156
+ */
157
+ export interface VideoContent {
158
+ url: string;
159
+ width?: number;
160
+ height?: number;
161
+ duration?: number;
162
+ fileSize?: number;
163
+ format?: string;
164
+ thumbnailUrl?: string;
165
+ transcript?: string;
166
+ }
167
+ /**
168
+ * @hidden
169
+ *
170
+ * Enum for media selection types
171
+ *
172
+ * @internal
173
+ * Limited to Microsoft-internal use
174
+ */
175
+ export declare enum MediaSelectionType {
176
+ IMAGE = "image",
177
+ AUDIO = "audio",
178
+ VIDEO = "video"
179
+ }
180
+ /**
181
+ * @hidden
182
+ *
183
+ * Interface for media selection
184
+ *
185
+ * @internal
186
+ * Limited to Microsoft-internal use
187
+ */
188
+ export interface MediaSelection {
189
+ type: MediaSelectionType;
190
+ altText?: string;
191
+ content: ImageContent | AudioContent | VideoContent;
192
+ source?: EmailContent | WebPageContent | CalendarInviteContent;
193
+ }
194
+ /**
195
+ * @hidden
196
+ *
197
+ * Interface for a catch all type content data
198
+ *
199
+ * @internal
200
+ * Limited to Microsoft-internal use
201
+ */
202
+ export interface MixedContent {
203
+ emails?: EmailContent[];
204
+ texts?: TextSelection[];
205
+ media?: (ImageContent | AudioContent | VideoContent)[];
206
+ calendarInvites?: CalendarInviteContent[];
207
+ webPages?: WebPageContent[];
208
+ otherContent?: Array<Record<string, unknown>> | undefined;
209
+ }
210
+ /**
211
+ * @hidden
212
+ *
213
+ * Interface for content data we get from hub
214
+ *
215
+ * @internal
216
+ * Limited to Microsoft-internal use
217
+ */
218
+ export type ContentItem = EmailContent | TextSelection | MediaSelection | CalendarInviteContent | WebPageContent | MixedContent;
219
+ /**
220
+ * @hidden
221
+ *
222
+ * The Content interface represents the content data structure used in the side panel.
223
+ * It si the payload received by the copilot app from the hub.
224
+ *
225
+ * @internal
226
+ * Limited to Microsoft-internal use
227
+ */
228
+ export interface Content {
229
+ userAction?: string;
230
+ contentType: ContentItemType.CALENDAR_INVITE | ContentItemType.EMAIL | ContentItemType.MEDIA | ContentItemType.TEXT | ContentItemType.WEB_PAGE | ContentItemType.MIXED;
231
+ formCode?: string;
232
+ contentItems: ContentItem[];
233
+ metadata?: string;
234
+ description?: string;
235
+ error_code?: string;
236
+ status?: string;
237
+ }
238
+ /**
239
+ * @hidden
240
+ *
241
+ * The ContentRequest interface represents the request params sent to the hub to fetch content.
242
+ *
243
+ * @internal
244
+ * Limited to Microsoft-internal use
245
+ */
246
+ export interface ContentRequest {
247
+ localEndpointInfo: string;
248
+ }
249
+ /**
250
+ * @hidden
251
+ *
252
+ * Interface for the response context used during user consent pre-checks.
253
+ * Contains information about the user's consent status and whether to show the consent card.
254
+ *
255
+ * @internal
256
+ * Limited to Microsoft-internal use
257
+ */
258
+ export interface PreCheckContextResponse {
259
+ error_code?: string;
260
+ status?: string;
261
+ user_consent: UserConsent;
262
+ show_consent_card: boolean;
263
+ }
264
+ /**
265
+ * @hidden
266
+ *
267
+ * Enum representing possible user consent states.
268
+ *
269
+ * @internal
270
+ * Limited to Microsoft-internal use
271
+ */
272
+ export declare enum UserConsent {
273
+ Accepted = "accepted",
274
+ NotAccepted = "not_accepted"
275
+ }
276
+ /**
277
+ * @hidden
278
+ *
279
+ * Type for user action handler functions that receive content data.
280
+ *
281
+ * @internal
282
+ * Limited to Microsoft-internal use
283
+ */
284
+ export declare enum SidePanelErrorCode {
285
+ ConsentNotAccepted = "consent_not_accepted",
286
+ PageContentBlockedPolicy = "page_content_blocked_policy",
287
+ PageContentBlockedDlp = "page_content_blocked_dlp",
288
+ PageContentTypeNotSupportedYet = "page_content_type_not_supported_yet",
289
+ PageContentSizeNotSupported = "page_content_size_not_supported",
290
+ PageContextChanged = "page_context_changed",
291
+ PageContentExtractionFailed = "page_content_extraction_failed",
292
+ PageContentSizeNotSupportedPDF = "page_content_size_not_supported_pdf",
293
+ NotSupportedOnPlatform = "not_supported_on_platform",
294
+ OtherError = "other_error"
295
+ }
296
+ /**
297
+ * @hidden
298
+ *
299
+ * Interface for errors related to side panel operations.
300
+ * Contains an error code and an optional message.
301
+ *
302
+ * @internal
303
+ * Limited to Microsoft-internal use
304
+ */
305
+ export interface SidePanelError {
306
+ errorCode: SidePanelErrorCode;
307
+ message?: string;
308
+ }
309
+ /**
310
+ * @hidden
311
+ * @beta
312
+ * Implementation of the SidePanelError interface.
313
+ * This class extends the built-in Error class and includes an error code.
314
+ * It is used to represent errors that occur during side panel operations.
315
+ * The error code can be one of the SidePanelErrorCode values or a general ErrorCode.
316
+ */
317
+ export declare class SidePanelErrorImpl extends Error implements SidePanelError {
318
+ errorCode: SidePanelErrorCode;
319
+ constructor(errorCode: SidePanelErrorCode, message?: string);
320
+ }
@@ -4,6 +4,7 @@ export { sendCustomMessage, sendCustomEvent, registerCustomHandler, uploadCustom
4
4
  export * as conversations from './conversations';
5
5
  export { ConversationResponse, OpenConversationRequest } from './conversations';
6
6
  export * as copilot from './copilot/copilot';
7
+ export * as sidePanelInterfaces from './copilot/sidePanelInterfaces';
7
8
  export * as externalAppAuthentication from './externalAppAuthentication';
8
9
  export * as externalAppAuthenticationForCEA from './externalAppAuthenticationForCEA';
9
10
  export * as externalAppCardActions from './externalAppCardActions';
@@ -17,7 +17,7 @@
17
17
  * @internal
18
18
  * Limited to Microsoft-internal use
19
19
  */
20
- export declare const version = "1.0.0";
20
+ export declare const version = "1.0.1";
21
21
  /**
22
22
  * @beta
23
23
  * @hidden
@@ -33,6 +33,7 @@ interface IRuntimeV4 extends IBaseRuntime {
33
33
  readonly copilot?: {
34
34
  readonly customTelemetry?: {};
35
35
  readonly eligibility?: {};
36
+ readonly sidePanel?: {};
36
37
  };
37
38
  readonly dialog?: {
38
39
  readonly card?: {
@@ -185,6 +186,11 @@ export declare function fastForwardRuntime(outdatedRuntime: IBaseRuntime): Runti
185
186
  * Limited to Microsoft-internal use
186
187
  */
187
188
  export declare const upgradeChain: IRuntimeUpgrade[];
189
+ /**
190
+ * This version is for legacy Teams mobile clients that don’t pass a runtime object during initialization.
191
+ * It’s the minimum version required to support deeply nested app auth.
192
+ */
193
+ export declare const legacyTeamsMobileVersionForDeeplyNestedAuth = "2.1.2";
188
194
  /**
189
195
  * This structure is used for versions of Teams that don't pass a runtime object during initialization.
190
196
  * Please see the extensive comments in versionAndPlatformAgnosticTeamsRuntimeConfig for more information
@@ -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","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.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 +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/externalAppAuthentication.js";export{o as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as a from"./private/externalAppCardActionsForCEA.js";export{a as externalAppCardActionsForCEA};import*as s from"./private/externalAppCardActionsForDA.js";export{s as externalAppCardActionsForDA};import*as m from"./private/externalAppCommands.js";export{m as externalAppCommands};import*as n from"./private/files.js";export{n as files};import*as l from"./private/meetingRoom.js";export{l as meetingRoom};import*as c from"./private/messageChannels/messageChannels.js";export{c as messageChannels};import*as f from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{f as nestedAppAuthBridge};import*as u from"./private/notifications.js";export{u as notifications};import*as x from"./private/otherAppStateChange.js";export{x as otherAppStateChange};import*as j from"./private/remoteCamera.js";export{j as remoteCamera};import*as d from"./private/appEntity.js";export{d as appEntity};import*as g from"./private/teams/teams.js";export{g as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as v from"./private/hostEntity/hostEntity.js";export{v as hostEntity};import*as C from"./private/store.js";export{C 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 A from"./public/liveShareHost.js";export{A as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as h from"./public/authentication.js";export{h as authentication};import*as S from"./public/app/app.js";export{S as app};import*as H from"./public/appInstallDialog.js";export{H as appInstallDialog};import*as F from"./public/barCode.js";export{F as barCode};import*as y from"./public/chat.js";export{y as chat};import*as T from"./public/clipboard.js";export{T as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as w from"./public/pages/pages.js";export{w as pages};import*as B from"./public/menus.js";export{B as menus};import*as P from"./public/media.js";export{P as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as L from"./public/location.js";export{L as location};import*as M from"./public/meeting/meeting.js";export{M as meeting};import*as U from"./public/monetization.js";export{U as monetization};import*as O from"./public/calendar.js";export{O as calendar};import*as V from"./public/mail/mail.js";export{V as mail};import*as z from"./public/teamsAPIs.js";export{z 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 R from"./public/videoEffects.js";export{R as videoEffects};import*as q from"./public/search.js";export{q as search};import*as G from"./public/sharing/sharing.js";export{G as sharing};import*as J from"./public/stageView/stageView.js";export{J as stageView};import*as K from"./public/visualMedia/visualMedia.js";export{K as visualMedia};import*as Q from"./public/webStorage.js";export{Q as webStorage};import*as X from"./public/call.js";export{X as call};import*as Y from"./public/appInitialization.js";export{Y as appInitialization};import*as Z from"./public/thirdPartyCloudStorage.js";export{Z as thirdPartyCloudStorage};import*as $ from"./public/settings.js";export{$ as settings};import*as _ from"./public/tasks.js";export{_ as tasks};import*as ee from"./public/marketplace.js";export{ee 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 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 +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{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as e}from"./globalVars.js";import{getLogger as o}from"./telemetry.js";import{inServerSideRenderingEnvironment as l,isValidHttpsURL as s}from"./utils.js";let a=[];const u=o("validateOrigin");function c(){return i(this,void 0,void 0,(function*(){yield d()}))}function d(e=!1){return i(this,void 0,void 0,(function*(){if(0!==a.length&&!e)return a;if(l())return a=n,n;{u("Initiating fetch call to acquire valid origins list from CDN");const i=new AbortController,e=setTimeout((()=>i.abort()),t);return fetch(r,{signal:i.signal}).then((i=>{if(clearTimeout(e),!i.ok)throw new Error("Invalid Response from Fetch Call");return u("Fetch call completed and retrieved valid origins list from CDN"),i.json().then((i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return u("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return a=i.validOrigins,a;throw new Error("Valid origins list retrieved from CDN is invalid")}))})).catch((i=>("AbortError"===i.name?u(`validOrigins fetch call to CDN failed due to Timeout of ${t} ms. Defaulting to fallback list`):u("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),a=n,a)))}}))}function f(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function g(i,t){return d(t).then((t=>{if(!s(i))return u("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some((i=>f(i,r))))return!0;for(const i of e.additionalValidOrigins){if(f("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return u("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,e.additionalValidOrigins),!1}))}c();export{c as prefetchOriginsFromCDN,g as validateOrigin};
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{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as e}from"./globalVars.js";import{getLogger as o}from"./telemetry.js";import{inServerSideRenderingEnvironment as l,isValidHttpsURL as s}from"./utils.js";let a=[];const u=o("validateOrigin");let c;function f(){return i(this,void 0,void 0,(function*(){c||(yield g())}))}function d(){return 0===a.length}function g(e=!1){return i(this,void 0,void 0,(function*(){if(!d()&&!e)return a;if(c)return c;if(l())return a=n,n;{u("Initiating fetch call to acquire valid origins list from CDN");const i=new AbortController,e=setTimeout((()=>i.abort()),t);return c=fetch(r,{signal:i.signal}).then((i=>{if(clearTimeout(e),!i.ok)throw new Error("Invalid Response from Fetch Call");return u("Fetch call completed and retrieved valid origins list from CDN"),i.json().then((i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return u("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return a=i.validOrigins,a;throw new Error("Valid origins list retrieved from CDN is invalid")}))})).catch((i=>("AbortError"===i.name?u(`validOrigins fetch call to CDN failed due to Timeout of ${t} ms. Defaulting to fallback list`):u("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),a=n,a))),c}}))}function p(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function h(i,t){const r=d()?n:a;return m(i,r)?Promise.resolve(!0):(u("Origin %s is not in the local valid origins list, fetching from CDN",i),g(t).then((t=>m(i,t))))}function m(i,t){if(!s(i))return u("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some((i=>p(i,r))))return!0;for(const i of e.additionalValidOrigins){if(p("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return u("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,e.additionalValidOrigins),!1}f();export{f as prefetchOriginsFromCDN,h as validateOrigin};
@@ -1 +1 @@
1
- import*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};
1
+ import*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};import*as e from"./sidePanel.js";export{e as sidePanel};
@@ -0,0 +1 @@
1
+ import{__awaiter as e}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHostAndHandleResponse as t}from"../../internal/communication.js";import{registerHandlerHelper as n}from"../../internal/handlers.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{ResponseHandler as r}from"../../internal/responseHandler.js";import{getApiVersionTag as i}from"../../internal/telemetry.js";import{FrameContexts as s}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as c}from"../../public/runtime.js";import{SidePanelErrorCode as p,SidePanelErrorImpl as u}from"./sidePanelInterfaces.js";const a="v2";function d(){var e;return o(c)&&!!(null===(e=c.supports.copilot)||void 0===e?void 0:e.sidePanel)}function m(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(p).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)||l(e)}function f(n){return e(this,void 0,void 0,(function*(){o(c);const e=n?[new C(n)]:[];return t("copilot.sidePanel.getContent",e,new b,i(a,"copilot.sidePanel.getContent"),m)}))}function j(){return e(this,void 0,void 0,(function*(){return o(c),t("copilot.sidePanel.preCheckUserConsent",[],new h,i(a,"copilot.sidePanel.preCheckUserConsent"),m)}))}function v(e){n(i(a,"copilot.sidePanel.registerUserActionContentSelect"),"copilot.sidePanel.userActionContentSelect",e,[s.content],(()=>{if(!d())throw P}))}const P=new u(p.NotSupportedOnPlatform,"This API is not supported on the current platform.");class b extends r{validate(e){return null!==e&&"object"==typeof e}deserialize(e){return e}}class h extends r{validate(e){return null!==e&&"object"==typeof e}deserialize(e){return e}}class C{constructor(e){this.contentRequest=e}serialize(){return this.contentRequest}}export{P as copilotSidePanelNotSupportedOnPlatformError,f as getContent,m as isResponseAReportableError,d as isSupported,j as preCheckUserConsent,v as registerUserActionContentSelect};
@@ -0,0 +1 @@
1
+ var e,t,o,n;!function(e){e.EMAIL="email",e.TEXT="text",e.MEDIA="media",e.CALENDAR_INVITE="calendarInvite",e.WEB_PAGE="webPage",e.MIXED="mixed"}(e||(e={})),function(e){e.IMAGE="image",e.AUDIO="audio",e.VIDEO="video"}(t||(t={})),function(e){e.Accepted="accepted",e.NotAccepted="not_accepted"}(o||(o={})),function(e){e.ConsentNotAccepted="consent_not_accepted",e.PageContentBlockedPolicy="page_content_blocked_policy",e.PageContentBlockedDlp="page_content_blocked_dlp",e.PageContentTypeNotSupportedYet="page_content_type_not_supported_yet",e.PageContentSizeNotSupported="page_content_size_not_supported",e.PageContextChanged="page_context_changed",e.PageContentExtractionFailed="page_content_extraction_failed",e.PageContentSizeNotSupportedPDF="page_content_size_not_supported_pdf",e.NotSupportedOnPlatform="not_supported_on_platform",e.OtherError="other_error"}(n||(n={}));class p extends Error{constructor(e,t){super(t),this.errorCode=e,this.name="SidePanelError"}}export{e as ContentItemType,t as MediaSelectionType,n as SidePanelErrorCode,p as SidePanelErrorImpl,o as UserConsent};
@@ -1 +1 @@
1
- import e from"../../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";const t="1.0.0",o={onMessage:function(e,t){if(!e||!e.data||"object"!=typeof e.data||null===e.data)return void a("Invalid message format, ignoring. Message: %o",e);if(!function(e,t){if(e&&e!==window.top)return a("Should not process message because it is not coming from the top window"),!1;if(t===n)try{return"https:"===new URL(t).protocol}catch(e){return d("Invalid message origin URL:",e),!1}return!1}(e.source,e.origin))return void a("Message source/origin not allowed, ignoring.");const{args:o}=e.data,[,r]=null!=o?o:[],i=(()=>{try{return JSON.parse(r)}catch(e){return d("Failed to parse response message:",e),null}})();if(!i||"NestedAppAuthResponse"!==i.messageType)return void a("Invalid response format, ignoring. Message: %o",e);t(r)}};let n=null,r=!1;function i(t,i,p=!1){if(r=p,!t)throw new Error("Cannot polyfill nestedAppAuthBridge as the current window does not exist");if(!i)throw new Error("Top origin is required to initialize the Nested App Auth Bridge");try{const e=new URL(i);if("https:"!==e.protocol)throw new Error(`Invalid top origin: ${i}. Only HTTPS origins are allowed.`);n=e.origin}catch(e){throw new Error(`Failed to initialize bridge: invalid top origin: ${i}`)}const u=t;if(u.nestedAppAuthBridge)return void a("Nested App Auth Bridge is already present");const g=function(t){const r=new WeakMap,{onMessage:i}=o,p=e=>t=>i(t,e);return{addEventListener:(e,o)=>{if("message"===e){const n=p(o);r.set(o,n),t.addEventListener(e,n)}else a(`Event ${e} is not supported by nestedAppAuthBridge`)},postMessage:o=>{if(!t.top)throw new Error("window.top is not available for posting messages");try{const r=JSON.parse(o);if("object"==typeof r&&"NestedAppAuthRequest"===r.messageType){const r=function(t){const o=Date.now();return{id:s(),uuid:e(),func:"nestedAppAuth.execute",timestamp:o,apiVersionTag:"v2_nestedAppAuth.execute",monotonicTimestamp:o,args:[],data:t}}(o);if(t===t.top||!n)return void d("Not in an embedded iframe; skipping postMessage.");t.top.postMessage(r,n)}}catch(e){return void d("Failed to parse message:",e,"Original message:",o)}},removeEventListener:(e,o)=>{const n=r.get(o);n&&(t.removeEventListener(e,n),r.delete(o))}}}(u);g&&(u.nestedAppAuthBridge=g)}function s(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2,11)}function a(...e){r&&console.log(...e)}function d(...e){r&&console.error(...e)}export{i as initialize,t as version};
1
+ import e from"../../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";const t="1.0.1",n={onMessage:function(e,t){if(!e||!e.data||"object"!=typeof e.data||null===e.data)return void a("Invalid message format, ignoring. Message: %o",e);if(!function(e,t){if(t===o)try{return"https:"===new URL(t).protocol}catch(e){return d("Invalid message origin URL:",e),!1}return!1}(e.source,e.origin))return void a("Message source/origin not allowed, ignoring.");const{args:n}=e.data,[,r]=null!=n?n:[],i=(()=>{try{return JSON.parse(r)}catch(e){return d("Failed to parse response message:",e),null}})();if(!i||"NestedAppAuthResponse"!==i.messageType)return void a("Invalid response format, ignoring. Message: %o",e);t(r)}};let o=null,r=!1;function i(t,i,p=!1){if(r=p,!t)throw new Error("Cannot polyfill nestedAppAuthBridge as the current window does not exist");if(!i)throw new Error("Top origin is required to initialize the Nested App Auth Bridge");try{const e=new URL(i);if("https:"!==e.protocol)throw new Error(`Invalid top origin: ${i}. Only HTTPS origins are allowed.`);o=e.origin}catch(e){throw new Error(`Failed to initialize bridge: invalid top origin: ${i}`)}const u=t;if(u.nestedAppAuthBridge)return void a("Nested App Auth Bridge is already present");const g=function(t){const r=new WeakMap,{onMessage:i}=n,p=e=>t=>i(t,e);return{addEventListener:(e,n)=>{if("message"===e){const o=p(n);r.set(n,o),t.addEventListener(e,o)}else a(`Event ${e} is not supported by nestedAppAuthBridge`)},postMessage:n=>{if(!t.top)throw new Error("window.top is not available for posting messages");try{const r=JSON.parse(n);if("object"==typeof r&&"NestedAppAuthRequest"===r.messageType){const r=function(t){const n=Date.now();return{id:s(),uuid:e(),func:"nestedAppAuth.execute",timestamp:n,apiVersionTag:"v2_nestedAppAuth.execute",monotonicTimestamp:n,args:[],data:t}}(n);if(t===t.top||!o)return void d("Not in an embedded iframe; skipping postMessage.");t.top.postMessage(r,o)}}catch(e){return void d("Failed to parse message:",e,"Original message:",n)}},removeEventListener:(e,n)=>{const o=r.get(n);o&&(t.removeEventListener(e,o),r.delete(n))}}}(u);g&&(u.nestedAppAuthBridge=g)}function s(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2,11)}function a(...e){r&&console.log(...e)}function d(...e){r&&console.error(...e)}export{i as initialize,t as version};
@@ -1 +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{Communication as r,callFunctionInHostAndHandleResponse as t}from"../internal/communication.js";import{GlobalVars as i}from"../internal/globalVars.js";import{ensureInitialized as e}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{HostClientType as s,errorNotSupportedOnPlatform as a}from"./constants.js";import{runtime as p}from"./runtime.js";const u="v2",l={validate:n=>Array.isArray(n)||"object"==typeof n,deserialize:n=>n};var d;function c(){var n;return null!==(n=e(p)&&(p.isNAAChannelRecommended||!(!e(p)||i.hostClientType!==s.android&&i.hostClientType!==s.ios&&i.hostClientType!==s.ipados&&i.hostClientType!==s.visionOS||!p.isLegacyTeams||!p.supports.nestedAppAuth)))&&void 0!==n&&n}function m(){return e(p),r.parentOrigin}function h(){var n;return null!==(n=e(p)&&p.canParentManageNAATrustedOrigins)&&void 0!==n&&n}function f(){var n;return null!==(n=e(p)&&p.isDeeplyNestedAuthSupported)&&void 0!==n&&n}function A(r){return n(this,void 0,void 0,(function*(){if(!h())throw a;const n=r.map(g);return y(d.ADD,n)}))}function v(r){return n(this,void 0,void 0,(function*(){if(!h())throw a;const n=r.map(g);return y(d.DELETE,n)}))}function y(r,i){return n(this,void 0,void 0,(function*(){if(window.parent!==window.top)throw new Error("This API is only available in the top-level parent.");if(!Array.isArray(i)||0===i.length)throw new Error(`The '${i}' parameter is required and must be a non-empty array.`);const n=[new w(r,i)];return t("nestedAppAuth.manageNAATrustedOrigins",n,l,o(u,"nestedAppAuth.manageNAATrustedOrigins"))}))}function g(n){try{return new URL(n).origin.toLowerCase()}catch(r){throw new Error(`Invalid origin provided: ${n}`)}}!function(n){n.ADD="ADD",n.DELETE="DELETE"}(d||(d={}));class w{constructor(n,r){this.action=n,this.appOrigins=r}serialize(){return{action:this.action,appOrigins:this.appOrigins}}}export{A as addNAATrustedOrigins,h as canParentManageNAATrustedOrigins,v as deleteNAATrustedOrigins,m as getParentOrigin,f as isDeeplyNestedAuthSupported,c as isNAAChannelRecommended};
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{Communication as r,callFunctionInHostAndHandleResponse as t}from"../internal/communication.js";import{GlobalVars as i}from"../internal/globalVars.js";import{ensureInitialized as e,isCurrentSDKVersionAtLeast as o}from"../internal/internalAPIs.js";import{getApiVersionTag as s}from"../internal/telemetry.js";import{HostClientType as a,errorNotSupportedOnPlatform as p}from"./constants.js";import{runtime as u,legacyTeamsMobileVersionForDeeplyNestedAuth as l}from"./runtime.js";const c="v2",d={validate:n=>Array.isArray(n)||"object"==typeof n,deserialize:n=>n};var m;function h(){var n;return null!==(n=e(u)&&(u.isNAAChannelRecommended||!!(e(u)&&y()&&u.isLegacyTeams&&u.supports.nestedAppAuth)))&&void 0!==n&&n}function f(){return e(u),r.parentOrigin}function A(){var n;return null!==(n=e(u)&&u.canParentManageNAATrustedOrigins)&&void 0!==n&&n}function v(){var n;return null!==(n=e(u)&&(u.isDeeplyNestedAuthSupported||!!(e(u)&&y()&&u.isLegacyTeams&&o(l))))&&void 0!==n&&n}function y(){return i.hostClientType===a.android||i.hostClientType===a.ios||i.hostClientType===a.ipados||i.hostClientType===a.visionOS}function g(r){return n(this,void 0,void 0,(function*(){if(!A())throw p;const n=r.map(E);return T(m.ADD,n)}))}function w(r){return n(this,void 0,void 0,(function*(){if(!A())throw p;const n=r.map(E);return T(m.DELETE,n)}))}function T(r,i){return n(this,void 0,void 0,(function*(){if(window.parent!==window.top)throw new Error("This API is only available in the top-level parent.");if(!Array.isArray(i)||0===i.length)throw new Error(`The '${i}' parameter is required and must be a non-empty array.`);const n=[new D(r,i)];return t("nestedAppAuth.manageNAATrustedOrigins",n,d,s(c,"nestedAppAuth.manageNAATrustedOrigins"))}))}function E(n){try{return new URL(n).origin.toLowerCase()}catch(r){throw new Error(`Invalid origin provided: ${n}`)}}!function(n){n.ADD="ADD",n.DELETE="DELETE"}(m||(m={}));class D{constructor(n,r){this.action=n,this.appOrigins=r}serialize(){return{action:this.action,appOrigins:this.appOrigins}}}export{g as addNAATrustedOrigins,A as canParentManageNAATrustedOrigins,w as deleteNAATrustedOrigins,f as getParentOrigin,v as isDeeplyNestedAuthSupported,h as isNAAChannelRecommended};
@@ -1 +1 @@
1
- import{__rest as o}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{errorRuntimeNotInitialized as e,errorRuntimeNotSupported as s}from"../internal/constants.js";import{GlobalVars as i}from"../internal/globalVars.js";import{getLogger as t}from"../internal/telemetry.js";import{compareSDKVersions as n,deepFreeze as a}from"../internal/utils.js";import{HostClientType as r,teamsMinAdaptiveCardVersion as p}from"./constants.js";const l=t("runtime"),d=4;function u(o){return o.apiVersion===d}function c(o){if(u(o))return!0;throw-1===o.apiVersion?new Error(e):new Error(s)}let g={apiVersion:-1,supports:{}};const m={apiVersion:4,isNAAChannelRecommended:!1,isDeeplyNestedAuthSupported:!1,hostVersionsInfo:p,isLegacyTeams:!0,supports:{appInstallDialog:{},appEntity:{},call:{},chat:{},conversations:{},dialog:{card:{bot:{}},url:{bot:{},parentCommunication:{}},update:{}},interactive:{},logs:{},meetingRoom:{},menus:{},monetization:{},notifications:{},pages:{config:{},backStack:{},fullTrust:{}},remoteCamera:{},teams:{fullTrust:{}},teamsCore:{},video:{sharedFrame:{}}}},y=[r.desktop,r.web,r.rigel,r.surfaceHub,r.teamsRoomsWindows,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays],b=[r.android,r.ios,r.ipados,r.visionOS],f=[...y,...b];function h(o){let e=o;if(e.apiVersion<d&&v.forEach((o=>{e.apiVersion===o.versionToUpgradeFrom&&(e=o.upgradeToNextVersion(e))})),u(e))return e;throw new Error("Received a runtime that could not be upgraded to the latest version")}const v=[{versionToUpgradeFrom:1,upgradeToNextVersion:o=>{var e;return{apiVersion:2,hostVersionsInfo:void 0,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:void 0,url:o.supports.dialog,update:null===(e=o.supports.dialog)||void 0===e?void 0:e.update}:void 0})}}},{versionToUpgradeFrom:2,upgradeToNextVersion:e=>{const s=e.supports,i=o(s,["appNotification"]);return Object.assign(Object.assign({},e),{apiVersion:3,supports:i})}},{versionToUpgradeFrom:3,upgradeToNextVersion:o=>{var e,s,i,t,n;return{apiVersion:4,hostVersionsInfo:o.hostVersionsInfo,isNAAChannelRecommended:o.isNAAChannelRecommended,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:null===(e=o.supports.dialog)||void 0===e?void 0:e.card,url:{bot:null===(i=null===(s=o.supports.dialog)||void 0===s?void 0:s.url)||void 0===i?void 0:i.bot,parentCommunication:(null===(t=o.supports.dialog)||void 0===t?void 0:t.url)?{}:void 0},update:null===(n=o.supports.dialog)||void 0===n?void 0:n.update}:void 0})}}}],T={"1.0.0":[{capability:{pages:{appButton:{},tabs:{}},stageView:{}},hostClientTypes:y}],"1.9.0":[{capability:{location:{}},hostClientTypes:f}],"2.0.0":[{capability:{people:{}},hostClientTypes:f},{capability:{sharing:{}},hostClientTypes:[r.desktop,r.web]}],"2.0.1":[{capability:{teams:{fullTrust:{joinedTeams:{}}}},hostClientTypes:[r.android,r.desktop,r.ios,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays,r.web]},{capability:{webStorage:{}},hostClientTypes:[r.desktop]}],"2.0.5":[{capability:{webStorage:{}},hostClientTypes:[r.android,r.ios]}],"2.0.8":[{capability:{sharing:{}},hostClientTypes:[r.android,r.ios]}],"2.1.1":[{capability:{nestedAppAuth:{}},hostClientTypes:[r.android,r.ios,r.ipados,r.visionOS]}]},V=l.extend("generateBackCompatRuntimeConfig");function C(o,e){const s=Object.assign({},o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&("object"!=typeof e[i]||Array.isArray(e[i])?i in o||(s[i]=e[i]):s[i]=C(o[i]||{},e[i]));return s}function j(o,e,s){V("generating back compat runtime config for %s",o);let t=Object.assign({},e.supports);V("Supported capabilities in config before updating based on highestSupportedVersion: %o",t),Object.keys(s).forEach((e=>{n(o,e)>=0&&s[e].forEach((o=>{void 0!==i.hostClientType&&o.hostClientTypes.includes(i.hostClientType)&&(t=C(t,o.capability))}))}));const a={apiVersion:d,hostVersionsInfo:p,isLegacyTeams:!0,supports:t};return V("Runtime config after updating based on highestSupportedVersion: %o",a),a}const w=l.extend("applyRuntimeConfig");function O(o){"string"==typeof o.apiVersion&&(w("Trying to apply runtime with string apiVersion, processing as v1: %o",o),o=Object.assign(Object.assign({},o),{apiVersion:1})),w("Fast-forwarding runtime %o",o);const e=h(o);w("Applying runtime %o",e),g=a(e)}export{O as applyRuntimeConfig,h as fastForwardRuntime,j as generateVersionBasedTeamsRuntimeConfig,c as isRuntimeInitialized,d as latestRuntimeApiVersion,T as mapTeamsVersionToSupportedCapabilities,g as runtime,v as upgradeChain,f as v1HostClientTypes,b as v1MobileHostClientTypes,m as versionAndPlatformAgnosticTeamsRuntimeConfig};
1
+ import{__rest as o}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{errorRuntimeNotInitialized as e,errorRuntimeNotSupported as s}from"../internal/constants.js";import{GlobalVars as i}from"../internal/globalVars.js";import{getLogger as t}from"../internal/telemetry.js";import{compareSDKVersions as n,deepFreeze as a}from"../internal/utils.js";import{HostClientType as r,teamsMinAdaptiveCardVersion as p}from"./constants.js";const l=t("runtime"),d=4;function u(o){return o.apiVersion===d}function c(o){if(u(o))return!0;throw-1===o.apiVersion?new Error(e):new Error(s)}let g={apiVersion:-1,supports:{}};const m={apiVersion:4,isNAAChannelRecommended:!1,isDeeplyNestedAuthSupported:!1,hostVersionsInfo:p,isLegacyTeams:!0,supports:{appInstallDialog:{},appEntity:{},call:{},chat:{},conversations:{},dialog:{card:{bot:{}},url:{bot:{},parentCommunication:{}},update:{}},interactive:{},logs:{},meetingRoom:{},menus:{},monetization:{},notifications:{},pages:{config:{},backStack:{},fullTrust:{}},remoteCamera:{},teams:{fullTrust:{}},teamsCore:{},video:{sharedFrame:{}}}},y=[r.desktop,r.web,r.rigel,r.surfaceHub,r.teamsRoomsWindows,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays],b=[r.android,r.ios,r.ipados,r.visionOS],f=[...y,...b];function h(o){let e=o;if(e.apiVersion<d&&v.forEach((o=>{e.apiVersion===o.versionToUpgradeFrom&&(e=o.upgradeToNextVersion(e))})),u(e))return e;throw new Error("Received a runtime that could not be upgraded to the latest version")}const v=[{versionToUpgradeFrom:1,upgradeToNextVersion:o=>{var e;return{apiVersion:2,hostVersionsInfo:void 0,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:void 0,url:o.supports.dialog,update:null===(e=o.supports.dialog)||void 0===e?void 0:e.update}:void 0})}}},{versionToUpgradeFrom:2,upgradeToNextVersion:e=>{const s=e.supports,i=o(s,["appNotification"]);return Object.assign(Object.assign({},e),{apiVersion:3,supports:i})}},{versionToUpgradeFrom:3,upgradeToNextVersion:o=>{var e,s,i,t,n;return{apiVersion:4,hostVersionsInfo:o.hostVersionsInfo,isNAAChannelRecommended:o.isNAAChannelRecommended,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:null===(e=o.supports.dialog)||void 0===e?void 0:e.card,url:{bot:null===(i=null===(s=o.supports.dialog)||void 0===s?void 0:s.url)||void 0===i?void 0:i.bot,parentCommunication:(null===(t=o.supports.dialog)||void 0===t?void 0:t.url)?{}:void 0},update:null===(n=o.supports.dialog)||void 0===n?void 0:n.update}:void 0})}}}],T="2.1.2",V={"1.0.0":[{capability:{pages:{appButton:{},tabs:{}},stageView:{}},hostClientTypes:y}],"1.9.0":[{capability:{location:{}},hostClientTypes:f}],"2.0.0":[{capability:{people:{}},hostClientTypes:f},{capability:{sharing:{}},hostClientTypes:[r.desktop,r.web]}],"2.0.1":[{capability:{teams:{fullTrust:{joinedTeams:{}}}},hostClientTypes:[r.android,r.desktop,r.ios,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays,r.web]},{capability:{webStorage:{}},hostClientTypes:[r.desktop]}],"2.0.5":[{capability:{webStorage:{}},hostClientTypes:[r.android,r.ios]}],"2.0.8":[{capability:{sharing:{}},hostClientTypes:[r.android,r.ios]}],"2.1.1":[{capability:{nestedAppAuth:{}},hostClientTypes:[r.android,r.ios,r.ipados,r.visionOS]}],"2.1.2":[]},C=l.extend("generateBackCompatRuntimeConfig");function j(o,e){const s=Object.assign({},o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&("object"!=typeof e[i]||Array.isArray(e[i])?i in o||(s[i]=e[i]):s[i]=j(o[i]||{},e[i]));return s}function w(o,e,s){C("generating back compat runtime config for %s",o);let t=Object.assign({},e.supports);C("Supported capabilities in config before updating based on highestSupportedVersion: %o",t),Object.keys(s).forEach((e=>{n(o,e)>=0&&s[e].forEach((o=>{void 0!==i.hostClientType&&o.hostClientTypes.includes(i.hostClientType)&&(t=j(t,o.capability))}))}));const a={apiVersion:d,hostVersionsInfo:p,isLegacyTeams:!0,supports:t};return C("Runtime config after updating based on highestSupportedVersion: %o",a),a}const O=l.extend("applyRuntimeConfig");function A(o){"string"==typeof o.apiVersion&&(O("Trying to apply runtime with string apiVersion, processing as v1: %o",o),o=Object.assign(Object.assign({},o),{apiVersion:1})),O("Fast-forwarding runtime %o",o);const e=h(o);O("Applying runtime %o",e),g=a(e)}export{A as applyRuntimeConfig,h as fastForwardRuntime,w as generateVersionBasedTeamsRuntimeConfig,c as isRuntimeInitialized,d as latestRuntimeApiVersion,T as legacyTeamsMobileVersionForDeeplyNestedAuth,V as mapTeamsVersionToSupportedCapabilities,g as runtime,v as upgradeChain,f as v1HostClientTypes,b as v1MobileHostClientTypes,m as versionAndPlatformAgnosticTeamsRuntimeConfig};
@@ -1 +1 @@
1
- const o="2.38.0";export{o as version};
1
+ const o="2.39.1";export{o as version};