@microsoft/teams-js 2.32.0 → 2.33.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js +1 -1
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js +1 -1
- package/dist/esm/packages/teams-js/dts/internal/hostToAppTelemetry.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +3 -2
- package/dist/esm/packages/teams-js/dts/private/copilot/copilot.d.ts +2 -1
- package/dist/esm/packages/teams-js/dts/private/copilot/customTelemetry.d.ts +23 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/public/uuidObject.d.ts +24 -0
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/telemetry.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/copilot.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/customTelemetry.js +1 -0
- package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -0
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +81 -8
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +0 -1
- package/dist/esm/_virtual/index.js +0 -1
- package/dist/esm/_virtual/node.js +0 -1
- package/dist/esm/_virtual/os.js +0 -1
- package/dist/esm/_virtual/tty.js +0 -1
- package/dist/esm/_virtual/util.js +0 -1
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/index.js +0 -1
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +0 -1
- package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +0 -1
- package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js +0 -1
- package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/os.js +0 -1
- package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/process-es6.js +0 -1
- package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/tty.js +0 -1
- package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/util.js +0 -1
- package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +0 -1
- package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +0 -11
- package/dist/esm/packages/teams-js/src/internal/uuidObject.js +0 -1
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.33.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.33.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-hCfPVLNt9JPTceReb/qZGZR7IbUaPeoExYnER2H//kiykKfhcVEMVQiCR0eAtCCs"
|
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.33.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
@@ -71,7 +71,7 @@ The [Teams Test App](https://aka.ms/teams-test-app) is used to validate the Team
|
|
71
71
|
|
72
72
|
## Troubleshooting
|
73
73
|
|
74
|
-
If the CDN hash value on the npm page is out of date please refer to [here]
|
74
|
+
If the CDN hash value on the npm page is out of date please refer to [here](https://github.com/OfficeDev/microsoft-teams-library-js/blob/main/packages/teams-js/README.md) for an up to date version. If you notice this problem, please report that issue to us in [GitHub Issues](https://github.com/OfficeDev/microsoft-teams-library-js/issues)
|
75
75
|
|
76
76
|
## Contributing
|
77
77
|
|
@@ -1 +1 @@
|
|
1
|
-
import{__module as e}from"../../../../../../_virtual/browser.js";import{
|
1
|
+
import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(n=t))})),o.splice(n,0,C)},C.save=function(e){try{e?C.storage.setItem("debug",e):C.storage.removeItem("debug")}catch(e){}},C.load=function(){let e;try{e=C.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},C.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},C.storage=function(){try{return localStorage}catch(e){}}(),C.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),C.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],C.log=console.debug||console.log||(()=>{}),e.exports=o(C);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(e,e.exports);var C=e.exports;export{C as b};
|
@@ -1 +1 @@
|
|
1
|
-
import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n
|
1
|
+
import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";a++;const o=t.formatters[s];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return l.namespace=e,l.useColors=t.useColors(),l.color=t.selectColor(e),l.extend=r,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(l),l}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=e(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach((e=>{t[e]=n[e]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};export{n as c};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Debugger } from 'debug';
|
2
|
+
import { UUID as MessageUUID } from '../public/uuidObject';
|
2
3
|
import { CallbackInformation } from './interfaces';
|
3
4
|
import { MessageRequest, MessageResponse } from './messageObjects';
|
4
|
-
import { UUID as MessageUUID } from './uuidObject';
|
5
5
|
/**
|
6
6
|
* @internal
|
7
7
|
* Limited to Microsoft-internal use
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Debugger } from 'debug';
|
2
|
-
import { UUID } from '
|
1
|
+
import { Debugger } from 'debug/src/browser';
|
2
|
+
import { UUID } from '../public/uuidObject';
|
3
3
|
export declare const teamsJsInstanceIdentifier: UUID;
|
4
4
|
/**
|
5
5
|
* @internal
|
@@ -82,6 +82,7 @@ export declare const enum ApiName {
|
|
82
82
|
Conversations_OpenConversation = "conversations.openConversation",
|
83
83
|
Conversations_RegisterCloseConversationHandler = "conversations.registerCloseConversationHandler",
|
84
84
|
Conversations_RegisterStartConversationHandler = "conversations.registerStartConversationHandler",
|
85
|
+
Copilot_CustomTelemetry_SendCustomTelemetryData = "copilot.customTelemetry.sendCustomTelemetryData",
|
85
86
|
Copilot_Eligibility_GetEligibilityInfo = "copilot.eligibility.getEligibilityInfo",
|
86
87
|
Dialog_AdaptiveCard_Bot_Open = "dialog.adaptiveCard.bot.open",
|
87
88
|
Dialog_AdaptiveCard_Open = "dialog.adaptiveCard.open",
|
@@ -0,0 +1,23 @@
|
|
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 { UUID } from '../../public/uuidObject';
|
10
|
+
/**
|
11
|
+
* Sends custom telemetry data to the host.
|
12
|
+
*
|
13
|
+
* @param { UUID } stageNameIdentifier - The stageName UUID identifier for the telemetry data.
|
14
|
+
* @param { number } [timestamp=getCurrentTimestamp() ?? Date.now()] - The timestamp of the telemetry data. Defaults to the current timestamp.
|
15
|
+
* @returns { Promise<void> } - promise resolves when the host SDK acknowledges that it has received the message.
|
16
|
+
* @throws { Error } - Throws an error if the app has not been successfully initialized or the host SDK returns an error as a response to this call
|
17
|
+
*
|
18
|
+
* @hidden
|
19
|
+
* @internal
|
20
|
+
* Limited to Microsoft-internal use
|
21
|
+
* @beta
|
22
|
+
*/
|
23
|
+
export declare function sendCustomTelemetryData(stageNameIdentifier: UUID, timestamp?: number): Promise<void>;
|
@@ -38,6 +38,7 @@ export * as appInitialization from './appInitialization';
|
|
38
38
|
export * as thirdPartyCloudStorage from './thirdPartyCloudStorage';
|
39
39
|
export { callbackFunctionType, enablePrintCapability, executeDeepLink, executeDeepLinkOnCompleteFunctionType, getContext, getContextCallbackFunctionType, getMruTabInstances, getTabInstances, getTabInstancesCallbackFunctionType, initialize, initializeWithFrameContext, print, registerAppButtonClickHandler, registerAppButtonHoverEnterHandler, registerAppButtonHoverLeaveHandler, registerBackButtonHandler, registerBackButtonHandlerFunctionType, registerBeforeUnloadHandler, registerChangeSettingsHandler, registerFocusEnterHandler, registerFullScreenHandler, registerFullScreenHandlerFunctionType, registerOnLoadHandler, registerOnThemeChangeHandler, registerOnThemeChangeHandlerFunctionType, setFrameContext, shareDeepLink, } from './publicAPIs';
|
40
40
|
export { navigateBack, navigateCrossDomain, navigateToTab, onCompleteHandlerFunctionType, returnFocus, } from './navigation';
|
41
|
+
export { UUID } from './uuidObject';
|
41
42
|
export * as settings from './settings';
|
42
43
|
export * as tasks from './tasks';
|
43
44
|
export * as liveShare from './liveShareHost';
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* @internal
|
3
|
+
* Limited to Microsoft-internal use
|
4
|
+
*
|
5
|
+
* Represents a UUID (Universally Unique Identifier) object.
|
6
|
+
* This class provides a way to generate, validate, and represent UUIDs as strings.
|
7
|
+
*/
|
8
|
+
export declare class UUID {
|
9
|
+
private readonly uuid;
|
10
|
+
/**
|
11
|
+
* Creates an instance of the UUID class.
|
12
|
+
* If no UUID string is provided, a new UUID is generated.
|
13
|
+
*
|
14
|
+
* @param {string} [uuid=generateGUID()] - The UUID string. Defaults to a newly generated UUID.
|
15
|
+
* @throws {Error} - Throws an error if the provided UUID is invalid.
|
16
|
+
*/
|
17
|
+
constructor(uuid?: string);
|
18
|
+
/**
|
19
|
+
* Returns the UUID as a string.
|
20
|
+
*
|
21
|
+
* @returns {string} - The UUID string.
|
22
|
+
*/
|
23
|
+
toString(): string;
|
24
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as r from"./private/logs.js";export{r as logs};import*as e from"./private/conversations.js";export{e as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as t from"./private/externalAppAuthentication.js";export{t 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 s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as a from"./private/externalAppCommands.js";export{a as externalAppCommands};import*as m from"./private/files.js";export{m as files};import*as n from"./private/meetingRoom.js";export{n as meetingRoom};import*as l from"./private/messageChannels/messageChannels.js";export{l as messageChannels};import*as c from"./private/notifications.js";export{c as notifications};import*as f from"./private/otherAppStateChange.js";export{f as otherAppStateChange};import*as x from"./private/remoteCamera.js";export{x as remoteCamera};import*as u from"./private/appEntity.js";export{u as appEntity};import*as j from"./private/teams/teams.js";export{j as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as d from"./private/hostEntity/hostEntity.js";export{d as hostEntity};import*as g from"./private/store.js";export{g as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,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{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.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";import*as v from"./public/liveShareHost.js";export{v as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as C from"./public/authentication.js";export{C as authentication};import*as A from"./public/app/app.js";export{A as app};import*as h from"./public/appInstallDialog.js";export{h as appInstallDialog};import*as H from"./public/barCode.js";export{H as barCode};import*as T from"./public/chat.js";export{T as chat};import*as y from"./public/clipboard.js";export{y as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as S from"./public/nestedAppAuth.js";export{S as nestedAppAuth};import*as
|
1
|
+
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as r from"./private/logs.js";export{r as logs};import*as e from"./private/conversations.js";export{e as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as t from"./private/externalAppAuthentication.js";export{t 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 s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as a from"./private/externalAppCommands.js";export{a as externalAppCommands};import*as m from"./private/files.js";export{m as files};import*as n from"./private/meetingRoom.js";export{n as meetingRoom};import*as l from"./private/messageChannels/messageChannels.js";export{l as messageChannels};import*as c from"./private/notifications.js";export{c as notifications};import*as f from"./private/otherAppStateChange.js";export{f as otherAppStateChange};import*as x from"./private/remoteCamera.js";export{x as remoteCamera};import*as u from"./private/appEntity.js";export{u as appEntity};import*as j from"./private/teams/teams.js";export{j as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as d from"./private/hostEntity/hostEntity.js";export{d as hostEntity};import*as g from"./private/store.js";export{g as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,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{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.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 v from"./public/liveShareHost.js";export{v as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as C from"./public/authentication.js";export{C as authentication};import*as A from"./public/app/app.js";export{A as app};import*as h from"./public/appInstallDialog.js";export{h as appInstallDialog};import*as H from"./public/barCode.js";export{H as barCode};import*as T from"./public/chat.js";export{T as chat};import*as y from"./public/clipboard.js";export{y as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as S from"./public/nestedAppAuth.js";export{S as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as D from"./public/pages/pages.js";export{D as pages};import*as F from"./public/menus.js";export{F as menus};import*as w from"./public/media.js";export{w as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as B from"./public/location.js";export{B as location};import*as P from"./public/meeting/meeting.js";export{P as meeting};import*as L from"./public/monetization.js";export{L as monetization};import*as M from"./public/calendar.js";export{M as calendar};import*as U from"./public/mail.js";export{U as mail};import*as O from"./public/teamsAPIs.js";export{O as teamsCore};import*as z from"./public/people.js";export{z as people};import*as V from"./public/profile.js";export{V as profile};import*as W from"./public/videoEffects.js";export{W as videoEffects};import*as N from"./public/search.js";export{N as search};import*as R from"./public/sharing/sharing.js";export{R as sharing};import*as q from"./public/stageView/stageView.js";export{q as stageView};import*as G from"./public/visualMedia/visualMedia.js";export{G as visualMedia};import*as J from"./public/webStorage.js";export{J as webStorage};import*as K from"./public/call.js";export{K as call};import*as Q from"./public/appInitialization.js";export{Q as appInitialization};import*as X from"./public/thirdPartyCloudStorage.js";export{X as thirdPartyCloudStorage};import*as Y from"./public/settings.js";export{Y as settings};import*as Z from"./public/tasks.js";export{Z as tasks};import*as $ from"./public/marketplace.js";export{$ as marketplace};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{version as d}from"../public/version.js";import{GlobalVars as c}from"./globalVars.js";import{callHandler as u}from"./handlers.js";import l from"./hostToAppTelemetry.js";import{serializeMessageRequest as g,deserializeMessageResponse as p,deserializeMessageRequest as f,serializeMessageResponse as m}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as w}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as h,ssrSafeWindow as W}from"./utils.js";import{UUID as v}from"./uuidObject.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return H(e,i).then((o=>{o?(function(e,n){c.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);te(y.parentWindow),te(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=f(e.data),[i,o]=u(n.func,n.args);i&&void 0!==o?(X("Returning message %s from child back to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(o)?o:[o])):(X("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),N(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(y.childWindow){const i=e.pop();X("Message from parent being relayed to child, id: %s",ae(n)),se(n.id,n.uuid,e,i)}})))}}(n)):_("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||W(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));c.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",S(i,"initialize",[d,r,n]).then((([e,n,i,t])=>(w(t,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},l.clearMessages()}function R(e,n,...i){return S(e,n,i).then((([e])=>e))}function E(e,n,...i){return S(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function j(e,n,...i){return S(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=L(e,n,t);var s;i((s=o.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function A(e){return e.map((e=>a(e)?e.serialize():e))}function P(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=A(i),[c]=yield S(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=A(i),[d]=yield S(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=L(e,n,t);return s=o.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);o&&k.callbacks.set(r.uuid,o)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,t=function(e){const n=k.nextMessageId++,i=new v;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:h(),args:[],data:e}}(e);return n("Message %s information: %o",ae(t),{actionName:t.func}),z(i,t)}const Q=b.extend("sendRequestToTargetWindowHelper");function z(e,n){const i=Q,t=ne(e),o=g(n);if(c.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(o),t),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",ae(o),t),Z(e).push(n))}return n}const F=b.extend("sendMessageToParentHelper");function L(e,n,i){const t=F,o=y.parentWindow,s=function(e,n,i){const t=k.nextMessageId++,o=new v;return k.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),monotonicTimestamp:h(),args:i||[],apiVersionTag:e}}(e,n,i);return l.storeCallbackInformation(s.uuid,{name:n,calledAt:s.timestamp}),t("Message %s information: %o",ae(s),{actionName:n,args:i}),z(o,s)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,t;const o=V;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?H(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),te(y.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const D=b.extend("shouldProcessIncomingMessage");function H(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return D("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return D("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||D("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=h();if("id"in e.data&&"number"==typeof e.data.id){const t=e.data,o=p(t),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const t=B(k.promiseCallbacks,n);if(t)return t;const o=B(k.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",ae(e))}(o);if(s){const t=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),l.handlePerformanceMetrics(s,o,n,i),t&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),o.args),t.apply(null,[...o.args,o.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(o,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),o.args),r(o.args),n("Removing registered promise callback for message %s",s.toString()),K(o,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),o.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,o.args),n("Removing registered port callback for message %s",s.toString()),K(o,k.portCallbacks)}o.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const t=e.data;l.handleOneWayPerformanceMetrics(t,n,i),n('Received a message from parent %s, action: "%s"',ae(t),t.func),u(t.func,t.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function te(e){const n=ee(e),i=Z(e),t=ne(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=g(o);ie("Flushing message %s from %s message queue via postMessage.",ae(i),t),e.postMessage(i,n)}}}function oe(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,t){const o=y.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=m(s),a=ee(o);o&&a&&o.postMessage(r,a)}function re(e,n){const i=y.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=ee(i);i&&o?i.postMessage(t,o):Z(i).push(t)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,P as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,j as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,S as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,oe as waitForMessageQueue};
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{UUID as d}from"../public/uuidObject.js";import{version as c}from"../public/version.js";import{GlobalVars as u}from"./globalVars.js";import{callHandler as l}from"./handlers.js";import g from"./hostToAppTelemetry.js";import{serializeMessageRequest as p,deserializeMessageResponse as f,deserializeMessageRequest as m,serializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as W,ssrSafeWindow as v}from"./utils.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return H(e,i).then((o=>{o?(function(e,n){u.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);te(y.parentWindow),te(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=m(e.data),[i,o]=l(n.func,n.args);i&&void 0!==o?(X("Returning message %s from child back to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(o)?o:[o])):(X("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),N(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(y.childWindow){const i=e.pop();X("Message from parent being relayed to child, id: %s",ae(n)),se(n.id,n.uuid,e,i)}})))}}(n)):_("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||v(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));u.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",S(i,"initialize",[c,r,n]).then((([e,n,i,t])=>(h(t,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},g.clearMessages()}function R(e,n,...i){return S(e,n,i).then((([e])=>e))}function E(e,n,...i){return S(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function j(e,n,...i){return S(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=L(e,n,t);var s;i((s=o.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function A(e){return e.map((e=>a(e)?e.serialize():e))}function P(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=A(i),[c]=yield S(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=A(i),[d]=yield S(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=L(e,n,t);return s=o.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);o&&k.callbacks.set(r.uuid,o)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,t=function(e){const n=k.nextMessageId++,i=new d;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",ae(t),{actionName:t.func}),z(i,t)}const Q=b.extend("sendRequestToTargetWindowHelper");function z(e,n){const i=Q,t=ne(e),o=p(n);if(u.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(o),t),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",ae(o),t),Z(e).push(n))}return n}const F=b.extend("sendMessageToParentHelper");function L(e,n,i){const t=F,o=y.parentWindow,s=function(e,n,i){const t=k.nextMessageId++,o=new d;return k.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e}}(e,n,i);return g.storeCallbackInformation(s.uuid,{name:n,calledAt:s.timestamp}),t("Message %s information: %o",ae(s),{actionName:n,args:i}),z(o,s)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,t;const o=V;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?H(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),te(y.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const D=b.extend("shouldProcessIncomingMessage");function H(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return D("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return D("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||D("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=W();if("id"in e.data&&"number"==typeof e.data.id){const t=e.data,o=f(t),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const t=B(k.promiseCallbacks,n);if(t)return t;const o=B(k.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",ae(e))}(o);if(s){const t=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),g.handlePerformanceMetrics(s,o,n,i),t&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),o.args),t.apply(null,[...o.args,o.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(o,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),o.args),r(o.args),n("Removing registered promise callback for message %s",s.toString()),K(o,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),o.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,o.args),n("Removing registered port callback for message %s",s.toString()),K(o,k.portCallbacks)}o.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const t=e.data;g.handleOneWayPerformanceMetrics(t,n,i),n('Received a message from parent %s, action: "%s"',ae(t),t.func),l(t.func,t.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function te(e){const n=ee(e),i=Z(e),t=ne(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=p(o);ie("Flushing message %s from %s message queue via postMessage.",ae(i),t),e.postMessage(i,n)}}}function oe(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,t){const o=y.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=w(s),a=ee(o);o&&a&&o.postMessage(r,a)}function re(e,n){const i=y.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=ee(i);i&&o?i.postMessage(t,o):Z(i).push(t)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,P as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,j as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,S as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,oe as waitForMessageQueue};
|
@@ -1 +1 @@
|
|
1
|
-
import{__rest 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{UUID as t}from"
|
1
|
+
import{__rest 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{UUID as t}from"../public/uuidObject.js";const u=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})},s=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},n=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},r=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})};export{s as deserializeMessageRequest,n as deserializeMessageResponse,u as serializeMessageRequest,r as serializeMessageResponse};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{b as t}from"../../../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js";import{UUID as e}from"../public/uuidObject.js";const n=new e,o=t.debug.formatArgs;t.debug.formatArgs=function(t){t[0]=`(${(new Date).toISOString()}): ${t[0]} [${n.toString()}]`,o.call(this,t)};const r=t.debug("teamsJs");function u(t){return r.extend(t)}function s(t,e){return`${t}_${e}`}function d(t){return/^v\d+_[\w.]+$/.test(t)}export{s as getApiVersionTag,u as getLogger,d as isFollowingApiVersionTagFormat,n as teamsJsInstanceIdentifier};
|
@@ -1 +1 @@
|
|
1
|
-
import*as
|
1
|
+
import*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{__awaiter as t}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as o}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as i}from"../../internal/telemetry.js";import{getCurrentTimestamp as m}from"../../internal/utils.js";import{runtime as n}from"../../public/runtime.js";const s=r("copilot");function l(r,l){var p;return void 0===l&&(l=null!==(p=m())&&void 0!==p?p:Date.now()),t(this,void 0,void 0,(function*(){return e(n),s("Sending custom telemetry data to host for stage: %s to record timestamp: %s",r,l),o("copilot.customTelemetry.sendCustomTelemetryData",[r.toString(),l],i("v2","copilot.customTelemetry.sendCustomTelemetryData"))}))}export{l as sendCustomTelemetryData};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{validateUuid as t,generateGUID as r}from"../internal/utils.js";class i{constructor(i=r()){this.uuid=i,t(i)}toString(){return this.uuid}}export{i as UUID};
|
@@ -1 +1 @@
|
|
1
|
-
const o="2.
|
1
|
+
const o="2.33.0";export{o as version};
|
@@ -1008,6 +1008,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1008
1008
|
SecondaryM365ContentIdName: () => (/* reexport */ SecondaryM365ContentIdName),
|
1009
1009
|
TaskModuleDimension: () => (/* reexport */ DialogDimension),
|
1010
1010
|
TeamType: () => (/* reexport */ TeamType),
|
1011
|
+
UUID: () => (/* reexport */ UUID),
|
1011
1012
|
UserSettingTypes: () => (/* reexport */ UserSettingTypes),
|
1012
1013
|
UserTeamRole: () => (/* reexport */ UserTeamRole),
|
1013
1014
|
ViewerActionTypes: () => (/* reexport */ ViewerActionTypes),
|
@@ -1348,6 +1349,13 @@ __webpack_require__.d(conversations_namespaceObject, {
|
|
1348
1349
|
openConversation: () => (openConversation)
|
1349
1350
|
});
|
1350
1351
|
|
1352
|
+
// NAMESPACE OBJECT: ./src/private/copilot/customTelemetry.ts
|
1353
|
+
var customTelemetry_namespaceObject = {};
|
1354
|
+
__webpack_require__.r(customTelemetry_namespaceObject);
|
1355
|
+
__webpack_require__.d(customTelemetry_namespaceObject, {
|
1356
|
+
sendCustomTelemetryData: () => (sendCustomTelemetryData)
|
1357
|
+
});
|
1358
|
+
|
1351
1359
|
// NAMESPACE OBJECT: ./src/private/copilot/eligibility.ts
|
1352
1360
|
var eligibility_namespaceObject = {};
|
1353
1361
|
__webpack_require__.r(eligibility_namespaceObject);
|
@@ -1360,6 +1368,7 @@ __webpack_require__.d(eligibility_namespaceObject, {
|
|
1360
1368
|
var copilot_namespaceObject = {};
|
1361
1369
|
__webpack_require__.r(copilot_namespaceObject);
|
1362
1370
|
__webpack_require__.d(copilot_namespaceObject, {
|
1371
|
+
customTelemetry: () => (customTelemetry_namespaceObject),
|
1363
1372
|
eligibility: () => (eligibility_namespaceObject)
|
1364
1373
|
});
|
1365
1374
|
|
@@ -3798,25 +3807,39 @@ function isPrimitiveOrPlainObject(value, depth = 0) {
|
|
3798
3807
|
return Object.keys(value).every((key) => isPrimitiveOrPlainObject(value[key], depth + 1));
|
3799
3808
|
}
|
3800
3809
|
|
3801
|
-
;// ./src/
|
3810
|
+
;// ./src/public/uuidObject.ts
|
3802
3811
|
|
3803
3812
|
/**
|
3804
3813
|
* @internal
|
3805
3814
|
* Limited to Microsoft-internal use
|
3806
3815
|
*
|
3807
|
-
* UUID object
|
3816
|
+
* Represents a UUID (Universally Unique Identifier) object.
|
3817
|
+
* This class provides a way to generate, validate, and represent UUIDs as strings.
|
3808
3818
|
*/
|
3809
3819
|
class UUID {
|
3820
|
+
/**
|
3821
|
+
* Creates an instance of the UUID class.
|
3822
|
+
* If no UUID string is provided, a new UUID is generated.
|
3823
|
+
*
|
3824
|
+
* @param {string} [uuid=generateGUID()] - The UUID string. Defaults to a newly generated UUID.
|
3825
|
+
* @throws {Error} - Throws an error if the provided UUID is invalid.
|
3826
|
+
*/
|
3810
3827
|
constructor(uuid = generateGUID()) {
|
3811
3828
|
this.uuid = uuid;
|
3812
3829
|
validateUuid(uuid);
|
3813
3830
|
}
|
3831
|
+
/**
|
3832
|
+
* Returns the UUID as a string.
|
3833
|
+
*
|
3834
|
+
* @returns {string} - The UUID string.
|
3835
|
+
*/
|
3814
3836
|
toString() {
|
3815
3837
|
return this.uuid;
|
3816
3838
|
}
|
3817
3839
|
}
|
3818
3840
|
|
3819
3841
|
;// ./src/internal/telemetry.ts
|
3842
|
+
// We are directly referencing the browser implementation of `debug` to resolve an issue with polyfilling. For a full write-up on the bug please see ADO Bug #9619161
|
3820
3843
|
|
3821
3844
|
|
3822
3845
|
// Each teamsjs instance gets a unique identifier that will be prepended to every log statement
|
@@ -4438,7 +4461,7 @@ function isSerializable(arg) {
|
|
4438
4461
|
* @hidden
|
4439
4462
|
* Package version.
|
4440
4463
|
*/
|
4441
|
-
const version = "2.
|
4464
|
+
const version = "2.33.0";
|
4442
4465
|
|
4443
4466
|
;// ./src/internal/internalAPIs.ts
|
4444
4467
|
|
@@ -9241,6 +9264,54 @@ function conversations_isSupported() {
|
|
9241
9264
|
return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;
|
9242
9265
|
}
|
9243
9266
|
|
9267
|
+
;// ./src/private/copilot/customTelemetry.ts
|
9268
|
+
/**
|
9269
|
+
* @beta
|
9270
|
+
* @hidden
|
9271
|
+
* User information required by specific apps
|
9272
|
+
* @internal
|
9273
|
+
* Limited to Microsoft-internal use
|
9274
|
+
* @module
|
9275
|
+
*/
|
9276
|
+
var customTelemetry_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
9277
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
9278
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
9279
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
9280
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
9281
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
9282
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9283
|
+
});
|
9284
|
+
};
|
9285
|
+
|
9286
|
+
|
9287
|
+
|
9288
|
+
|
9289
|
+
|
9290
|
+
const copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
9291
|
+
const copilotLogger = getLogger('copilot');
|
9292
|
+
/**
|
9293
|
+
* Sends custom telemetry data to the host.
|
9294
|
+
*
|
9295
|
+
* @param { UUID } stageNameIdentifier - The stageName UUID identifier for the telemetry data.
|
9296
|
+
* @param { number } [timestamp=getCurrentTimestamp() ?? Date.now()] - The timestamp of the telemetry data. Defaults to the current timestamp.
|
9297
|
+
* @returns { Promise<void> } - promise resolves when the host SDK acknowledges that it has received the message.
|
9298
|
+
* @throws { Error } - Throws an error if the app has not been successfully initialized or the host SDK returns an error as a response to this call
|
9299
|
+
*
|
9300
|
+
* @hidden
|
9301
|
+
* @internal
|
9302
|
+
* Limited to Microsoft-internal use
|
9303
|
+
* @beta
|
9304
|
+
*/
|
9305
|
+
function sendCustomTelemetryData(stageNameIdentifier, timestamp) {
|
9306
|
+
var _a;
|
9307
|
+
if (timestamp === void 0) { timestamp = (_a = getCurrentTimestamp()) !== null && _a !== void 0 ? _a : Date.now(); }
|
9308
|
+
return customTelemetry_awaiter(this, void 0, void 0, function* () {
|
9309
|
+
ensureInitialized(runtime);
|
9310
|
+
copilotLogger('Sending custom telemetry data to host for stage: %s to record timestamp: %s', stageNameIdentifier, timestamp);
|
9311
|
+
return callFunctionInHost("copilot.customTelemetry.sendCustomTelemetryData" /* ApiName.Copilot_CustomTelemetry_SendCustomTelemetryData */, [stageNameIdentifier.toString(), timestamp], getApiVersionTag(copilotTelemetryVersionNumber, "copilot.customTelemetry.sendCustomTelemetryData" /* ApiName.Copilot_CustomTelemetry_SendCustomTelemetryData */));
|
9312
|
+
});
|
9313
|
+
}
|
9314
|
+
|
9244
9315
|
;// ./src/private/copilot/eligibility.ts
|
9245
9316
|
/**
|
9246
9317
|
* @beta
|
@@ -9265,8 +9336,8 @@ var eligibility_awaiter = (undefined && undefined.__awaiter) || function (thisAr
|
|
9265
9336
|
|
9266
9337
|
|
9267
9338
|
|
9268
|
-
const
|
9269
|
-
const
|
9339
|
+
const eligibility_copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
|
9340
|
+
const eligibility_copilotLogger = getLogger('copilot');
|
9270
9341
|
/**
|
9271
9342
|
* @hidden
|
9272
9343
|
* @internal
|
@@ -9299,12 +9370,12 @@ function getEligibilityInfo() {
|
|
9299
9370
|
}
|
9300
9371
|
// Return the eligibility information if it is already available
|
9301
9372
|
if ((_a = runtime.hostVersionsInfo) === null || _a === void 0 ? void 0 : _a.appEligibilityInformation) {
|
9302
|
-
|
9373
|
+
eligibility_copilotLogger('Eligibility information is already available on runtime.');
|
9303
9374
|
return runtime.hostVersionsInfo.appEligibilityInformation;
|
9304
9375
|
}
|
9305
|
-
|
9376
|
+
eligibility_copilotLogger('Eligibility information is not available on runtime. Requesting from host.');
|
9306
9377
|
// Send message to host SDK to get eligibility information
|
9307
|
-
const response = yield sendAndUnwrap(getApiVersionTag(
|
9378
|
+
const response = yield sendAndUnwrap(getApiVersionTag(eligibility_copilotTelemetryVersionNumber, "copilot.eligibility.getEligibilityInfo" /* ApiName.Copilot_Eligibility_GetEligibilityInfo */), "copilot.eligibility.getEligibilityInfo" /* ApiName.Copilot_Eligibility_GetEligibilityInfo */);
|
9308
9379
|
if (isSdkError(response)) {
|
9309
9380
|
throw new Error(`Error code: ${response.errorCode}, message: ${(_b = response.message) !== null && _b !== void 0 ? _b : 'Failed to get eligibility information from the host.'}`);
|
9310
9381
|
}
|
@@ -9332,6 +9403,7 @@ function isEligibilityInfoValid(eligibilityInfo) {
|
|
9332
9403
|
;// ./src/private/copilot/copilot.ts
|
9333
9404
|
|
9334
9405
|
|
9406
|
+
|
9335
9407
|
|
9336
9408
|
;// ./src/private/externalAppAuthentication.ts
|
9337
9409
|
/**
|
@@ -18161,6 +18233,7 @@ function marketplace_isSupported() {
|
|
18161
18233
|
|
18162
18234
|
|
18163
18235
|
|
18236
|
+
|
18164
18237
|
|
18165
18238
|
|
18166
18239
|
//It is necessary to export the LiveShareHost class from liveShareHost.ts individually as well
|