@microsoft/teams-js 2.39.0 → 2.40.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +7 -0
- package/dist/esm/packages/teams-js/dts/private/copilot/sidePanelInterfaces.d.ts +218 -5
- package/dist/esm/packages/teams-js/dts/private/nestedAppAuth/nestedAppAuthBridge.d.ts +1 -1
- package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/sidePanelInterfaces.js +1 -1
- package/dist/esm/packages/teams-js/src/private/nestedAppAuth/nestedAppAuthBridge.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +139 -27
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -53
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.40.0/js/MicrosoftTeams.min.js) or point your package manager at them.
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
|
|
45
45
|
```html
|
46
46
|
<!-- Microsoft Teams JavaScript API (via CDN) -->
|
47
47
|
<script
|
48
|
-
src="https://res.cdn.office.net/teams-js/2.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.40.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-QXdQxWIYy1PLsb9pdWIm5k6mjLxVKAF4ISp0BVCZZCiZNyaKXinYNAQVT8+8hEIf"
|
50
50
|
crossorigin="anonymous"
|
51
51
|
></script>
|
52
52
|
|
53
53
|
<!-- Microsoft Teams JavaScript API (via npm) -->
|
54
|
-
<script src="node_modules/@microsoft/teams-js@2.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.40.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
@@ -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;
|
@@ -12,7 +12,9 @@ export declare enum ContentItemType {
|
|
12
12
|
MEDIA = "media",
|
13
13
|
CALENDAR_INVITE = "calendarInvite",
|
14
14
|
WEB_PAGE = "webPage",
|
15
|
-
MIXED = "mixed"
|
15
|
+
MIXED = "mixed",
|
16
|
+
TEAMS = "teams",
|
17
|
+
FILE = "file"
|
16
18
|
}
|
17
19
|
/**
|
18
20
|
* @hidden
|
@@ -54,7 +56,9 @@ export interface ServerEmailContent extends BaseEmailContent {
|
|
54
56
|
* Limited to Microsoft-internal use
|
55
57
|
*/
|
56
58
|
export interface DraftEmailContent extends BaseEmailContent {
|
59
|
+
responseToEmailId?: string;
|
57
60
|
savedTime?: Date;
|
61
|
+
composeType?: 'new' | 'reply' | 'replyAll' | 'forward';
|
58
62
|
}
|
59
63
|
export type EmailContent = ServerEmailContent | DraftEmailContent;
|
60
64
|
/**
|
@@ -104,7 +108,7 @@ export interface WebPageContent {
|
|
104
108
|
*/
|
105
109
|
export interface TextSelection {
|
106
110
|
content: string;
|
107
|
-
source?: EmailContent | WebPageContent | CalendarInviteContent;
|
111
|
+
source?: EmailContent | WebPageContent | CalendarInviteContent | TeamsContent | FileContent;
|
108
112
|
}
|
109
113
|
/**
|
110
114
|
* @hidden
|
@@ -180,7 +184,198 @@ export interface MediaSelection {
|
|
180
184
|
type: MediaSelectionType;
|
181
185
|
altText?: string;
|
182
186
|
content: ImageContent | AudioContent | VideoContent;
|
183
|
-
source?: EmailContent | WebPageContent | CalendarInviteContent;
|
187
|
+
source?: EmailContent | WebPageContent | CalendarInviteContent | TeamsContent | FileContent;
|
188
|
+
}
|
189
|
+
/**
|
190
|
+
* @hidden
|
191
|
+
*
|
192
|
+
* Interface representing the context of a Microsoft Teams chat.
|
193
|
+
* Contains identifying information for a specific Teams chat session.
|
194
|
+
*
|
195
|
+
* @internal
|
196
|
+
* Limited to Microsoft-internal use
|
197
|
+
*/
|
198
|
+
export interface TeamsChatContext {
|
199
|
+
chatId: string;
|
200
|
+
}
|
201
|
+
/**
|
202
|
+
* @hidden
|
203
|
+
*
|
204
|
+
* Interface representing the context of a Microsoft Teams channel.
|
205
|
+
* Contains identifying information for a specific Teams channel and related content.
|
206
|
+
*
|
207
|
+
* @internal
|
208
|
+
* Limited to Microsoft-internal use
|
209
|
+
*/
|
210
|
+
export interface TeamsChannelContext {
|
211
|
+
channelId: string;
|
212
|
+
teamId: string;
|
213
|
+
channelName?: string;
|
214
|
+
postId?: string;
|
215
|
+
replyChainId?: string;
|
216
|
+
clientConversationId?: string;
|
217
|
+
}
|
218
|
+
/**
|
219
|
+
* @hidden
|
220
|
+
*
|
221
|
+
* Interface representing the context of a Microsoft Teams meeting.
|
222
|
+
* Contains configuration and identifying information for Teams meeting sessions including Copilot features.
|
223
|
+
*
|
224
|
+
* @internal
|
225
|
+
* Limited to Microsoft-internal use
|
226
|
+
*/
|
227
|
+
export interface TeamsMeetingContext {
|
228
|
+
callId: string;
|
229
|
+
threadId: string;
|
230
|
+
organizerId: string;
|
231
|
+
messageId?: string;
|
232
|
+
groupId?: string;
|
233
|
+
sessionType?: TeamsSessionType;
|
234
|
+
vroomId?: string;
|
235
|
+
iCalUid?: string;
|
236
|
+
conversationId?: string;
|
237
|
+
locale?: string;
|
238
|
+
disableHistory?: boolean;
|
239
|
+
Dimensions?: TeamsDimension[];
|
240
|
+
UtteranceInfo?: TeamsUtteranceInfo;
|
241
|
+
copilotMode?: CopilotMode;
|
242
|
+
transcriptState?: TranscriptState;
|
243
|
+
enableMeetingCopilotResponseHandoff?: boolean;
|
244
|
+
enableCopilotResponseCopyRestriction?: boolean;
|
245
|
+
enableMeetingCopilotVisualInsights?: boolean;
|
246
|
+
enableMeetingCopilotCitation?: boolean;
|
247
|
+
}
|
248
|
+
/**
|
249
|
+
* @hidden
|
250
|
+
*
|
251
|
+
* Enum representing different types of Teams session contexts.
|
252
|
+
* Defines the various meeting and chat session types within Microsoft Teams.
|
253
|
+
*
|
254
|
+
* @internal
|
255
|
+
* Limited to Microsoft-internal use
|
256
|
+
*/
|
257
|
+
export declare enum TeamsSessionType {
|
258
|
+
Private = "Private",
|
259
|
+
Shared = "Shared",
|
260
|
+
Recap = "Recap",
|
261
|
+
RecapCall = "RecapCall",
|
262
|
+
PrivateViewCall = "PrivateViewCall",
|
263
|
+
Chat = "Chat",
|
264
|
+
Compose = "Compose"
|
265
|
+
}
|
266
|
+
/**
|
267
|
+
* @hidden
|
268
|
+
*
|
269
|
+
* Interface for telemetry dimension data used in analytics and reporting.
|
270
|
+
* Contains dimension name-value pairs for categorizing telemetry data.
|
271
|
+
*
|
272
|
+
* @internal
|
273
|
+
* Limited to Microsoft-internal use
|
274
|
+
*/
|
275
|
+
export interface TeamsDimension {
|
276
|
+
DimensionName: TeamsDimensionName;
|
277
|
+
DimensionValue: string;
|
278
|
+
}
|
279
|
+
/**
|
280
|
+
* @hidden
|
281
|
+
*
|
282
|
+
* Enum defining telemetry dimension names for categorizing analytics data.
|
283
|
+
* Used to specify the type of dimension being tracked in telemetry systems.
|
284
|
+
*
|
285
|
+
* @internal
|
286
|
+
* Limited to Microsoft-internal use
|
287
|
+
*/
|
288
|
+
export declare enum TeamsDimensionName {
|
289
|
+
ClientDeviceType = "ClientDeviceType",
|
290
|
+
ClientRing = "ClientRing",
|
291
|
+
ClientScenarioName = "ClientScenarioName"
|
292
|
+
}
|
293
|
+
/**
|
294
|
+
* @hidden
|
295
|
+
*
|
296
|
+
* Interface for utterance identification information used in conversation tracking.
|
297
|
+
* Contains unique identifiers for individual utterances in chat or meeting contexts.
|
298
|
+
*
|
299
|
+
* @internal
|
300
|
+
* Limited to Microsoft-internal use
|
301
|
+
*/
|
302
|
+
export interface TeamsUtteranceInfo {
|
303
|
+
utteranceId?: string;
|
304
|
+
}
|
305
|
+
/**
|
306
|
+
* @hidden
|
307
|
+
*
|
308
|
+
* Enum defining different Copilot operational modes.
|
309
|
+
* Specifies whether Copilot is enabled and how it should function in Teams contexts.
|
310
|
+
*
|
311
|
+
* @internal
|
312
|
+
* Limited to Microsoft-internal use
|
313
|
+
*/
|
314
|
+
export declare enum CopilotMode {
|
315
|
+
Enabled = "enabled",
|
316
|
+
Disabled = "disabled",
|
317
|
+
EnabledWithTranscript = "enabledWithTranscript"
|
318
|
+
}
|
319
|
+
/**
|
320
|
+
* @hidden
|
321
|
+
*
|
322
|
+
* Enum defining different transcript states for meeting recordings.
|
323
|
+
* Indicates the current status of transcript generation and availability.
|
324
|
+
*
|
325
|
+
* @internal
|
326
|
+
* Limited to Microsoft-internal use
|
327
|
+
*/
|
328
|
+
export declare enum TranscriptState {
|
329
|
+
NotStarted = "notStarted",
|
330
|
+
Active = "active",
|
331
|
+
Inactive = "inactive",
|
332
|
+
UnknownFutureValue = "unknownFutureValue"
|
333
|
+
}
|
334
|
+
/**
|
335
|
+
* @hidden
|
336
|
+
*
|
337
|
+
* Enum defining the context types for Teams-related content.
|
338
|
+
* Specifies whether the content is from a chat, channel, meeting, or meeting chat.
|
339
|
+
*
|
340
|
+
* @internal
|
341
|
+
* Limited to Microsoft-internal use
|
342
|
+
*/
|
343
|
+
export declare enum TeamsContextType {
|
344
|
+
Chat = "Chat",
|
345
|
+
Channel = "Channel",
|
346
|
+
Meeting = "Meeting",
|
347
|
+
MeetingChat = "MeetingChat"
|
348
|
+
}
|
349
|
+
/**
|
350
|
+
* @hidden
|
351
|
+
*
|
352
|
+
* Interface for Teams-related content data including app information and context.
|
353
|
+
* Contains metadata about Teams applications and their execution contexts.
|
354
|
+
*
|
355
|
+
* @internal
|
356
|
+
* Limited to Microsoft-internal use
|
357
|
+
*/
|
358
|
+
export interface TeamsContent {
|
359
|
+
appName?: string;
|
360
|
+
appVersion?: string;
|
361
|
+
appPlatform?: string;
|
362
|
+
appRingInfo?: string;
|
363
|
+
contextType: TeamsContextType;
|
364
|
+
chatContext?: TeamsChatContext;
|
365
|
+
channelContext?: TeamsChannelContext;
|
366
|
+
meetingContext?: TeamsMeetingContext;
|
367
|
+
}
|
368
|
+
/**
|
369
|
+
* @hidden
|
370
|
+
*
|
371
|
+
* Interface for file content data including URLs and metadata.
|
372
|
+
* Represents file attachments and documents referenced in content.
|
373
|
+
*
|
374
|
+
* @internal
|
375
|
+
* Limited to Microsoft-internal use
|
376
|
+
*/
|
377
|
+
export interface FileContent {
|
378
|
+
fileUrl?: string;
|
184
379
|
}
|
185
380
|
/**
|
186
381
|
* @hidden
|
@@ -196,6 +391,7 @@ export interface MixedContent {
|
|
196
391
|
media?: (ImageContent | AudioContent | VideoContent)[];
|
197
392
|
calendarInvites?: CalendarInviteContent[];
|
198
393
|
webPages?: WebPageContent[];
|
394
|
+
files?: FileContent[];
|
199
395
|
otherContent?: Array<Record<string, unknown>> | undefined;
|
200
396
|
}
|
201
397
|
/**
|
@@ -206,10 +402,19 @@ export interface MixedContent {
|
|
206
402
|
* @internal
|
207
403
|
* Limited to Microsoft-internal use
|
208
404
|
*/
|
209
|
-
export type ContentItem = EmailContent | TextSelection | MediaSelection | CalendarInviteContent | WebPageContent | MixedContent;
|
405
|
+
export type ContentItem = EmailContent | TextSelection | MediaSelection | CalendarInviteContent | WebPageContent | TeamsContent | FileContent | MixedContent;
|
406
|
+
/**
|
407
|
+
* @hidden
|
408
|
+
*
|
409
|
+
* The Content interface represents the content data structure used in the side panel.
|
410
|
+
* It si the payload received by the copilot app from the hub.
|
411
|
+
*
|
412
|
+
* @internal
|
413
|
+
* Limited to Microsoft-internal use
|
414
|
+
*/
|
210
415
|
export interface Content {
|
211
416
|
userAction?: string;
|
212
|
-
contentType: ContentItemType.CALENDAR_INVITE | ContentItemType.EMAIL | ContentItemType.MEDIA | ContentItemType.TEXT | ContentItemType.WEB_PAGE | ContentItemType.MIXED;
|
417
|
+
contentType: ContentItemType.CALENDAR_INVITE | ContentItemType.EMAIL | ContentItemType.MEDIA | ContentItemType.TEXT | ContentItemType.TEAMS | ContentItemType.FILE | ContentItemType.WEB_PAGE | ContentItemType.MIXED;
|
213
418
|
formCode?: string;
|
214
419
|
contentItems: ContentItem[];
|
215
420
|
metadata?: string;
|
@@ -217,6 +422,14 @@ export interface Content {
|
|
217
422
|
error_code?: string;
|
218
423
|
status?: string;
|
219
424
|
}
|
425
|
+
/**
|
426
|
+
* @hidden
|
427
|
+
*
|
428
|
+
* The ContentRequest interface represents the request params sent to the hub to fetch content.
|
429
|
+
*
|
430
|
+
* @internal
|
431
|
+
* Limited to Microsoft-internal use
|
432
|
+
*/
|
220
433
|
export interface ContentRequest {
|
221
434
|
localEndpointInfo: string;
|
222
435
|
}
|
@@ -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
|
-
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
|
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
|
-
var e,t,o,
|
1
|
+
var e,t,n,a,o,i,c,r,p;!function(e){e.EMAIL="email",e.TEXT="text",e.MEDIA="media",e.CALENDAR_INVITE="calendarInvite",e.WEB_PAGE="webPage",e.MIXED="mixed",e.TEAMS="teams",e.FILE="file"}(e||(e={})),function(e){e.IMAGE="image",e.AUDIO="audio",e.VIDEO="video"}(t||(t={})),function(e){e.Private="Private",e.Shared="Shared",e.Recap="Recap",e.RecapCall="RecapCall",e.PrivateViewCall="PrivateViewCall",e.Chat="Chat",e.Compose="Compose"}(n||(n={})),function(e){e.ClientDeviceType="ClientDeviceType",e.ClientRing="ClientRing",e.ClientScenarioName="ClientScenarioName"}(a||(a={})),function(e){e.Enabled="enabled",e.Disabled="disabled",e.EnabledWithTranscript="enabledWithTranscript"}(o||(o={})),function(e){e.NotStarted="notStarted",e.Active="active",e.Inactive="inactive",e.UnknownFutureValue="unknownFutureValue"}(i||(i={})),function(e){e.Chat="Chat",e.Channel="Channel",e.Meeting="Meeting",e.MeetingChat="MeetingChat"}(c||(c={})),function(e){e.Accepted="accepted",e.NotAccepted="not_accepted"}(r||(r={})),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"}(p||(p={}));class d extends Error{constructor(e,t){super(t),this.errorCode=e,this.name="SidePanelError"}}export{e as ContentItemType,o as CopilotMode,t as MediaSelectionType,p as SidePanelErrorCode,d as SidePanelErrorImpl,c as TeamsContextType,a as TeamsDimensionName,n as TeamsSessionType,i as TranscriptState,r 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.
|
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
|
-
const
|
1
|
+
const t="2.40.0-beta.0";export{t as version};
|
@@ -1365,9 +1365,14 @@ var sidePanelInterfaces_namespaceObject = {};
|
|
1365
1365
|
__webpack_require__.r(sidePanelInterfaces_namespaceObject);
|
1366
1366
|
__webpack_require__.d(sidePanelInterfaces_namespaceObject, {
|
1367
1367
|
ContentItemType: () => (ContentItemType),
|
1368
|
+
CopilotMode: () => (CopilotMode),
|
1368
1369
|
MediaSelectionType: () => (MediaSelectionType),
|
1369
1370
|
SidePanelErrorCode: () => (SidePanelErrorCode),
|
1370
1371
|
SidePanelErrorImpl: () => (SidePanelErrorImpl),
|
1372
|
+
TeamsContextType: () => (TeamsContextType),
|
1373
|
+
TeamsDimensionName: () => (TeamsDimensionName),
|
1374
|
+
TeamsSessionType: () => (TeamsSessionType),
|
1375
|
+
TranscriptState: () => (TranscriptState),
|
1371
1376
|
UserConsent: () => (UserConsent)
|
1372
1377
|
});
|
1373
1378
|
|
@@ -2231,7 +2236,7 @@ var ClipboardSupportedMimeType;
|
|
2231
2236
|
})(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
|
2232
2237
|
|
2233
2238
|
;// ./src/artifactsForCDN/validDomains.json
|
2234
|
-
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["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"]}');
|
2239
|
+
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["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"]}');
|
2235
2240
|
var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
|
2236
2241
|
;// ./src/internal/constants.ts
|
2237
2242
|
|
@@ -4585,7 +4590,7 @@ function isSerializable(arg) {
|
|
4585
4590
|
* @hidden
|
4586
4591
|
* Package version.
|
4587
4592
|
*/
|
4588
|
-
const version = "2.
|
4593
|
+
const version = "2.40.0-beta.0";
|
4589
4594
|
|
4590
4595
|
;// ./src/public/featureFlags.ts
|
4591
4596
|
// All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
|
@@ -6641,9 +6646,12 @@ var validOrigins_awaiter = (undefined && undefined.__awaiter) || function (thisA
|
|
6641
6646
|
|
6642
6647
|
let validOriginsCache = [];
|
6643
6648
|
const validateOriginLogger = getLogger('validateOrigin');
|
6649
|
+
let validOriginsPromise;
|
6644
6650
|
function prefetchOriginsFromCDN() {
|
6645
6651
|
return validOrigins_awaiter(this, void 0, void 0, function* () {
|
6646
|
-
|
6652
|
+
if (!validOriginsPromise) {
|
6653
|
+
yield getValidOriginsListFromCDN();
|
6654
|
+
}
|
6647
6655
|
});
|
6648
6656
|
}
|
6649
6657
|
function isValidOriginsCacheEmpty() {
|
@@ -6654,11 +6662,15 @@ function getValidOriginsListFromCDN(shouldDisableCache = false) {
|
|
6654
6662
|
if (!isValidOriginsCacheEmpty() && !shouldDisableCache) {
|
6655
6663
|
return validOriginsCache;
|
6656
6664
|
}
|
6665
|
+
if (validOriginsPromise) {
|
6666
|
+
// Fetch has already been initiated, return the existing promise
|
6667
|
+
return validOriginsPromise;
|
6668
|
+
}
|
6657
6669
|
if (!inServerSideRenderingEnvironment()) {
|
6658
6670
|
validateOriginLogger('Initiating fetch call to acquire valid origins list from CDN');
|
6659
6671
|
const controller = new AbortController();
|
6660
6672
|
const timeoutId = setTimeout(() => controller.abort(), ORIGIN_LIST_FETCH_TIMEOUT_IN_MS);
|
6661
|
-
|
6673
|
+
validOriginsPromise = fetch(validOriginsCdnEndpoint, { signal: controller.signal })
|
6662
6674
|
.then((response) => {
|
6663
6675
|
clearTimeout(timeoutId);
|
6664
6676
|
if (!response.ok) {
|
@@ -6685,6 +6697,7 @@ function getValidOriginsListFromCDN(shouldDisableCache = false) {
|
|
6685
6697
|
validOriginsCache = validOriginsFallback;
|
6686
6698
|
return validOriginsCache;
|
6687
6699
|
});
|
6700
|
+
return validOriginsPromise;
|
6688
6701
|
}
|
6689
6702
|
else {
|
6690
6703
|
validOriginsCache = validOriginsFallback;
|
@@ -6745,25 +6758,46 @@ function validateHostAgainstPattern(pattern, host) {
|
|
6745
6758
|
* Limited to Microsoft-internal use
|
6746
6759
|
*/
|
6747
6760
|
function validateOrigin(messageOrigin, disableCache) {
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6751
|
-
|
6752
|
-
|
6753
|
-
|
6754
|
-
|
6755
|
-
|
6761
|
+
// Try origin against the cache or hardcoded fallback list first before fetching from CDN
|
6762
|
+
const localList = !disableCache && !isValidOriginsCacheEmpty() ? validOriginsCache : validOriginsFallback;
|
6763
|
+
if (validateOriginWithValidOriginsList(messageOrigin, localList)) {
|
6764
|
+
return Promise.resolve(true);
|
6765
|
+
}
|
6766
|
+
else {
|
6767
|
+
validateOriginLogger('Origin %s is not in the local valid origins list, fetching from CDN', messageOrigin);
|
6768
|
+
return getValidOriginsListFromCDN(disableCache).then((validOriginsList) => {
|
6769
|
+
return validateOriginWithValidOriginsList(messageOrigin, validOriginsList);
|
6770
|
+
});
|
6771
|
+
}
|
6772
|
+
}
|
6773
|
+
function validateOriginWithValidOriginsList(messageOrigin, validOriginsList) {
|
6774
|
+
// Check whether the url is in the pre-known allowlist or supplied by user
|
6775
|
+
if (!isValidHttpsURL(messageOrigin)) {
|
6776
|
+
validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
|
6777
|
+
return false;
|
6778
|
+
}
|
6779
|
+
const messageOriginHost = messageOrigin.host;
|
6780
|
+
if (validOriginsList.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {
|
6781
|
+
return true;
|
6782
|
+
}
|
6783
|
+
for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
|
6784
|
+
const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;
|
6785
|
+
if (validateHostAgainstPattern(pattern, messageOriginHost)) {
|
6756
6786
|
return true;
|
6757
6787
|
}
|
6758
|
-
|
6759
|
-
|
6760
|
-
|
6761
|
-
|
6762
|
-
|
6763
|
-
|
6764
|
-
|
6765
|
-
|
6766
|
-
|
6788
|
+
}
|
6789
|
+
validateOriginLogger('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', messageOrigin, validOriginsList, GlobalVars.additionalValidOrigins);
|
6790
|
+
return false;
|
6791
|
+
}
|
6792
|
+
/**
|
6793
|
+
* @internal
|
6794
|
+
* Limited to Microsoft-internal use
|
6795
|
+
*
|
6796
|
+
* This function is only used for testing to reset the valid origins cache and ignore prefetched values.
|
6797
|
+
*/
|
6798
|
+
function resetValidOriginsCache() {
|
6799
|
+
validOriginsCache = [];
|
6800
|
+
validOriginsPromise = undefined;
|
6767
6801
|
}
|
6768
6802
|
prefetchOriginsFromCDN();
|
6769
6803
|
|
@@ -9435,6 +9469,8 @@ var ContentItemType;
|
|
9435
9469
|
ContentItemType["CALENDAR_INVITE"] = "calendarInvite";
|
9436
9470
|
ContentItemType["WEB_PAGE"] = "webPage";
|
9437
9471
|
ContentItemType["MIXED"] = "mixed";
|
9472
|
+
ContentItemType["TEAMS"] = "teams";
|
9473
|
+
ContentItemType["FILE"] = "file";
|
9438
9474
|
})(ContentItemType || (ContentItemType = {}));
|
9439
9475
|
/**
|
9440
9476
|
* @hidden
|
@@ -9450,6 +9486,87 @@ var MediaSelectionType;
|
|
9450
9486
|
MediaSelectionType["AUDIO"] = "audio";
|
9451
9487
|
MediaSelectionType["VIDEO"] = "video";
|
9452
9488
|
})(MediaSelectionType || (MediaSelectionType = {}));
|
9489
|
+
/**
|
9490
|
+
* @hidden
|
9491
|
+
*
|
9492
|
+
* Enum representing different types of Teams session contexts.
|
9493
|
+
* Defines the various meeting and chat session types within Microsoft Teams.
|
9494
|
+
*
|
9495
|
+
* @internal
|
9496
|
+
* Limited to Microsoft-internal use
|
9497
|
+
*/
|
9498
|
+
var TeamsSessionType;
|
9499
|
+
(function (TeamsSessionType) {
|
9500
|
+
TeamsSessionType["Private"] = "Private";
|
9501
|
+
TeamsSessionType["Shared"] = "Shared";
|
9502
|
+
TeamsSessionType["Recap"] = "Recap";
|
9503
|
+
TeamsSessionType["RecapCall"] = "RecapCall";
|
9504
|
+
TeamsSessionType["PrivateViewCall"] = "PrivateViewCall";
|
9505
|
+
TeamsSessionType["Chat"] = "Chat";
|
9506
|
+
TeamsSessionType["Compose"] = "Compose";
|
9507
|
+
})(TeamsSessionType || (TeamsSessionType = {}));
|
9508
|
+
/**
|
9509
|
+
* @hidden
|
9510
|
+
*
|
9511
|
+
* Enum defining telemetry dimension names for categorizing analytics data.
|
9512
|
+
* Used to specify the type of dimension being tracked in telemetry systems.
|
9513
|
+
*
|
9514
|
+
* @internal
|
9515
|
+
* Limited to Microsoft-internal use
|
9516
|
+
*/
|
9517
|
+
var TeamsDimensionName;
|
9518
|
+
(function (TeamsDimensionName) {
|
9519
|
+
TeamsDimensionName["ClientDeviceType"] = "ClientDeviceType";
|
9520
|
+
TeamsDimensionName["ClientRing"] = "ClientRing";
|
9521
|
+
TeamsDimensionName["ClientScenarioName"] = "ClientScenarioName";
|
9522
|
+
})(TeamsDimensionName || (TeamsDimensionName = {}));
|
9523
|
+
/**
|
9524
|
+
* @hidden
|
9525
|
+
*
|
9526
|
+
* Enum defining different Copilot operational modes.
|
9527
|
+
* Specifies whether Copilot is enabled and how it should function in Teams contexts.
|
9528
|
+
*
|
9529
|
+
* @internal
|
9530
|
+
* Limited to Microsoft-internal use
|
9531
|
+
*/
|
9532
|
+
var CopilotMode;
|
9533
|
+
(function (CopilotMode) {
|
9534
|
+
CopilotMode["Enabled"] = "enabled";
|
9535
|
+
CopilotMode["Disabled"] = "disabled";
|
9536
|
+
CopilotMode["EnabledWithTranscript"] = "enabledWithTranscript";
|
9537
|
+
})(CopilotMode || (CopilotMode = {}));
|
9538
|
+
/**
|
9539
|
+
* @hidden
|
9540
|
+
*
|
9541
|
+
* Enum defining different transcript states for meeting recordings.
|
9542
|
+
* Indicates the current status of transcript generation and availability.
|
9543
|
+
*
|
9544
|
+
* @internal
|
9545
|
+
* Limited to Microsoft-internal use
|
9546
|
+
*/
|
9547
|
+
var TranscriptState;
|
9548
|
+
(function (TranscriptState) {
|
9549
|
+
TranscriptState["NotStarted"] = "notStarted";
|
9550
|
+
TranscriptState["Active"] = "active";
|
9551
|
+
TranscriptState["Inactive"] = "inactive";
|
9552
|
+
TranscriptState["UnknownFutureValue"] = "unknownFutureValue";
|
9553
|
+
})(TranscriptState || (TranscriptState = {}));
|
9554
|
+
/**
|
9555
|
+
* @hidden
|
9556
|
+
*
|
9557
|
+
* Enum defining the context types for Teams-related content.
|
9558
|
+
* Specifies whether the content is from a chat, channel, meeting, or meeting chat.
|
9559
|
+
*
|
9560
|
+
* @internal
|
9561
|
+
* Limited to Microsoft-internal use
|
9562
|
+
*/
|
9563
|
+
var TeamsContextType;
|
9564
|
+
(function (TeamsContextType) {
|
9565
|
+
TeamsContextType["Chat"] = "Chat";
|
9566
|
+
TeamsContextType["Channel"] = "Channel";
|
9567
|
+
TeamsContextType["Meeting"] = "Meeting";
|
9568
|
+
TeamsContextType["MeetingChat"] = "MeetingChat";
|
9569
|
+
})(TeamsContextType || (TeamsContextType = {}));
|
9453
9570
|
/**
|
9454
9571
|
* @hidden
|
9455
9572
|
*
|
@@ -11287,7 +11404,7 @@ function messageChannels_isSupported() {
|
|
11287
11404
|
* @internal
|
11288
11405
|
* Limited to Microsoft-internal use
|
11289
11406
|
*/
|
11290
|
-
const nestedAppAuthBridge_version = '1.0.
|
11407
|
+
const nestedAppAuthBridge_version = '1.0.1';
|
11291
11408
|
/**
|
11292
11409
|
* Bridge handlers used for processing messages.
|
11293
11410
|
*/
|
@@ -11433,11 +11550,6 @@ function nestedAppAuthBridge_processAuthBridgeMessage(evt, onMessageReceived) {
|
|
11433
11550
|
onMessageReceived(message);
|
11434
11551
|
}
|
11435
11552
|
function nestedAppAuthBridge_shouldProcessIncomingMessage(messageSource, messageOrigin) {
|
11436
|
-
// Reject messages if they are not from the top window
|
11437
|
-
if (messageSource && messageSource !== window.top) {
|
11438
|
-
log('Should not process message because it is not coming from the top window');
|
11439
|
-
return false;
|
11440
|
-
}
|
11441
11553
|
// Check if messageOrigin matches topOriginForNAA
|
11442
11554
|
if (messageOrigin === topOriginForNAA) {
|
11443
11555
|
try {
|