@microsoft/teams-js 2.49.0-beta.0 → 2.50.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/urlPattern.d.ts +3 -0
- package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +24 -0
- package/dist/esm/packages/teams-js/src/internal/urlPattern.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActions.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -1
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +46 -25
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +53 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
|
24
24
|
|
|
25
25
|
### Production
|
|
26
26
|
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.50.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.50.0/js/MicrosoftTeams.min.js"
|
|
49
|
+
integrity="sha384-tAUmOW9DgkVVCWNQlKJzT9A3ykFmjwWrk8ClFaO1ozKKq44WzKpLyULQIrsovhwM"
|
|
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.50.0/dist/MicrosoftTeams.min.js"></script>
|
|
55
55
|
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
|
@@ -15,13 +15,16 @@ export interface URLVerifier {
|
|
|
15
15
|
test: (url: URL) => boolean;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
+
* Checks if the provided host matches the given pattern, which may include a single wildcard segment.
|
|
18
19
|
* @param pattern - reference pattern
|
|
19
20
|
* @param host - candidate string
|
|
20
21
|
* @returns returns true if host matches pre-know valid pattern
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
24
|
* validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
|
|
25
|
+
* validateHostAgainstPattern('test.*.teams.microsoft.com', 'test.subdomain.teams.microsoft.com') returns true
|
|
24
26
|
* validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
|
|
27
|
+
* validateHostAgainstPattern('*.*.microsoft.com', 'test.team.microsoft.com') returns false
|
|
25
28
|
*
|
|
26
29
|
* @internal
|
|
27
30
|
* Limited to Microsoft-internal use
|
|
@@ -211,6 +211,30 @@ export interface FilePreviewParameters {
|
|
|
211
211
|
* Limited to Microsoft-internal use
|
|
212
212
|
*/
|
|
213
213
|
conversationId?: string;
|
|
214
|
+
/**
|
|
215
|
+
* @hidden
|
|
216
|
+
* Optional; id of message where this file is shared (if applicable)
|
|
217
|
+
*
|
|
218
|
+
* @internal
|
|
219
|
+
* Limited to Microsoft-internal use
|
|
220
|
+
*/
|
|
221
|
+
messageId?: string;
|
|
222
|
+
/**
|
|
223
|
+
* @hidden
|
|
224
|
+
* Optional; used internally to differentiate different callers from within an app
|
|
225
|
+
*
|
|
226
|
+
* @internal
|
|
227
|
+
* Limited to Microsoft-internal use
|
|
228
|
+
*/
|
|
229
|
+
callerInfo?: string;
|
|
230
|
+
/**
|
|
231
|
+
* @hidden
|
|
232
|
+
* Optional; serialised string of atp data which the apps may pass to expediate safelink validations that run when a file is opened
|
|
233
|
+
*
|
|
234
|
+
* @internal
|
|
235
|
+
* Limited to Microsoft-internal use
|
|
236
|
+
*/
|
|
237
|
+
atpData?: string;
|
|
214
238
|
}
|
|
215
239
|
/**
|
|
216
240
|
* @hidden
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=/^[A-Za-z][A-Za-z\d+.-]*:\/\//;function
|
|
1
|
+
const t=/^[A-Za-z][A-Za-z\d+.-]*:\/\//;function e(t,e){const r=t.split("."),s=e.split(".");if(s.length!==r.length)return!1;let n=!1;for(let t=0;t<r.length;t++)if(r[t]!==s[t]){if("*"!==r[t])return!1;if(t===r.length-1||n)return!1;n=!0}return!0}class r{constructor(t,e,r){this.protocol=t,this.host=e,this.logger=r}static canUse(e){return t.test(e)}static create(t,e){const s=t.split("://");return new r(s[0],s[1],e.extend("InternalURLPattern"))}test(t){return this.logger("Testing URL %s against pattern protocol: %s, host: %s",t,this.protocol,this.host),t.protocol===`${this.protocol}:`&&(!t.host||e(this.host,t.host))}}function s(t){return r.canUse(t)}function n(t,e){if(r.canUse(t))return r.create(t,e);e("No URL verifier available for pattern: %s",t)}export{n as createURLVerifier,s as isValidPatternUrl,e as validateHostAgainstPattern};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sendMessageToParentAsync as
|
|
1
|
+
import{sendMessageToParentAsync as e,callFunctionInHost as t,callFunctionInHostAndHandleResponse as n}from"../internal/communication.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{ResponseHandler as o}from"../internal/responseHandler.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{isPrimitiveOrPlainObject as a,validateId as s,validateUrl as c}from"../internal/utils.js";import{FrameContexts as u,errorNotSupportedOnPlatform as l}from"../public/constants.js";import{runtime as h}from"../public/runtime.js";import{AppId as d}from"../public/appId.js";const p="v2";class f{constructor(e){this.invokeRequest=e}serialize(){return this.invokeRequest}}function m(e){const t=e;return t.responseType===w.ActionExecuteInvokeResponse&&void 0!==t.value&&void 0!==t.statusCode&&void 0!==t.type}const A="Action.Execute";var I,w,v,x;!function(e){e.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",e.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(I||(I={})),function(e){e.ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",e.QueryMessageExtensionResponse="QueryMessageExtensionResponse"}(w||(w={}));class g extends o{validate(e){return m(e)}deserialize(e){return e}}function R(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(v).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)}function E(e){e.requestType===I.ActionExecuteInvokeRequest?y(e):e.requestType===I.QueryMessageExtensionRequest&&function(e){if(e.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(e.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const t of e.parameters){if(t.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(t.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}(e)}function y(e){if(e.type!==A){throw{errorCode:v.INTERNAL_ERROR,message:`Invalid action type ${e.type}. Action type must be "${A}"`}}if(!a(e.data)){throw{errorCode:v.INTERNAL_ERROR,message:`Invalid data type ${typeof e.data}. Data must be a primitive or a plain object.`}}}function C(t,n,o){if(i(h,u.content,u.sidePanel),!z())throw l;const a=new d(t);return E(o),e(r(p,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[a.toString(),o,n.url.href,n.width,n.height,n.isExternal]).then(([e,t])=>{if(e&&null!=t.responseType)return t;throw t})}function q(t,n){if(i(h,u.content,u.sidePanel),!z())throw l;const o=new d(t);return e(r(p,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[o.toString(),n.claims,n.silent]).then(([e,t])=>{if(!e)throw t})}function P(t,n,o){if(i(h,u.content,u.sidePanel),!z())throw l;const a=new d(t);return E(o),e(r(p,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[a.toString(),o,n.claims,n.silent]).then(([e,t])=>{if(e&&null!=t.responseType)return t;throw t})}function S(t,n,o){if(i(h,u.content,u.sidePanel),!z())throw l;return s(t,new Error("titleId is Invalid.")),s(n,new Error("oauthConfigId is Invalid.")),e(r(p,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[t,n,o.width,o.height,o.isExternal]).then(([e,t])=>{if(!e)throw t})}function j(t,n,o){if(i(h,u.content,u.sidePanel),!z())throw l;return s(t,new Error("titleId is Invalid.")),n&&c(n),e(r(p,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[t,null==n?void 0:n.toString(),null==o?void 0:o.width,null==o?void 0:o.height,null==o?void 0:o.isExternal]).then(([e,t])=>{if(!e)throw t})}!function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(v||(v={}));class O{constructor(e){this.param=e}serialize(){var e,t,n;return{connectorId:this.param.connectorId,oAuthConfigId:this.param.oAuthConfigId,traceId:null!==(n=null===(t=null===(e=this.param.traceId)||void 0===e?void 0:e.toString)||void 0===t?void 0:t.call(e))&&void 0!==n?n:this.param.traceId,windowParameters:this.param.windowParameters?Object.assign({},this.param.windowParameters):void 0}}}function W(e){if(i(h,u.content,u.sidePanel),!z())throw l;return s(e.connectorId,new Error("connectorId is Invalid.")),s(e.oAuthConfigId,new Error("oauthConfigId is Invalid.")),t("externalAppAuthentication.authenticateWithConnector",[new O(e)],r(p,"externalAppAuthentication.authenticateWithConnector"),R)}!function(e){e.Invalid="Invalid",e.Valid="Valid",e.Expired="Expired"}(x||(x={}));class b extends o{validate(e){return"string"==typeof e&&e in x}deserialize(e){return e}}function T(e){if(i(h,u.content,u.sidePanel),!z())throw l;return s(e.connectorId,new Error("connectorId is Invalid.")),s(e.oAuthConfigId,new Error("oAuthConfigId is Invalid.")),n("externalAppAuthentication.getUserAuthenticationStateForConnector",[new O(e)],new b,r(p,"externalAppAuthentication.getUserAuthenticationStateForConnector"),R)}function k(e){if(i(h,u.content,u.sidePanel),!z())throw l;return s(e.connectorId,new Error("connectorId is Invalid.")),s(e.oAuthConfigId,new Error("oauthConfigId is Invalid.")),t("externalAppAuthentication.disconnectConnector",[new O(e)],r(p,"externalAppAuthentication.disconnectConnector"),R)}function z(){return!(!i(h)||!h.supports.externalAppAuthentication)}export{A as ActionExecuteInvokeRequestType,g as ActionExecuteResponseHandler,v as InvokeErrorCode,w as InvokeResponseType,I as OriginalRequestType,f as SerializableActionExecuteInvokeRequest,O as SerializableConnectorParameters,x as UserAuthenticationState,C as authenticateAndResendRequest,W as authenticateWithConnector,S as authenticateWithOauth2,j as authenticateWithPowerPlatformConnectorPlugins,q as authenticateWithSSO,P as authenticateWithSSOAndResendRequest,k as disconnectConnector,T as getUserAuthenticationStateForConnector,m as isActionExecuteResponse,R as isInvokeError,z as isSupported,y as validateActionExecuteInvokeRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as n,callFunctionInHostAndHandleResponse as e}from"../internal/communication.js";import{validateAppIdInstance as i}from"../internal/idValidation.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{validateId as a}from"../internal/utils.js";import{FrameContexts as u,errorNotSupportedOnPlatform as
|
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as n,callFunctionInHostAndHandleResponse as e}from"../internal/communication.js";import{validateAppIdInstance as i}from"../internal/idValidation.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{validateId as a}from"../internal/utils.js";import{FrameContexts as u,errorNotSupportedOnPlatform as s}from"../public/constants.js";import{runtime as c}from"../public/runtime.js";import{isInvokeError as h,validateActionExecuteInvokeRequest as l,ActionExecuteResponseHandler as p,SerializableActionExecuteInvokeRequest as A}from"./externalAppAuthentication.js";const d="v2";function m(e,i,a){return t(this,void 0,void 0,function*(){if(o(c,u.content,u.sidePanel),!v())throw s;return w(e,i),n("externalAppAuthenticationForCEA.authenticateWithSSO",[e,i,a.authId,a.connectionName,a.claims,a.silent],r(d,"externalAppAuthenticationForCEA.authenticateWithSSO"),h)})}function f(e,i,a){return t(this,void 0,void 0,function*(){if(o(c,u.content,u.sidePanel),!v())throw s;return w(e,i),n("externalAppAuthenticationForCEA.authenticateWithOauth",[e,i,a.url.href,a.width,a.height,a.isExternal],r(d,"externalAppAuthenticationForCEA.authenticateWithOauth"),h)})}function x(n,i,a,m){return t(this,void 0,void 0,function*(){if(o(c,u.content,u.sidePanel),!v())throw s;return w(n,i),l(m),e("externalAppAuthenticationForCEA.authenticateAndResendRequest",[n,i,new A(m),a.url.href,a.width,a.height,a.isExternal],new p,r(d,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),h)})}function E(n,i,a,m){return t(this,void 0,void 0,function*(){if(o(c,u.content,u.sidePanel),!v())throw s;return w(n,i),l(m),e("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[n,i,new A(m),a.authId,a.connectionName,a.claims,a.silent],new p,r(d,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),h)})}function v(){return!(!o(c)||!c.supports.externalAppAuthenticationForCEA)}function w(t,n){a(n,new Error("conversation id is not valid.")),i(t)}export{x as authenticateAndResendRequest,f as authenticateWithOauth,m as authenticateWithSSO,E as authenticateWithSSOAndResendRequest,v as isSupported,w as validateInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sendMessageToParentAsync as n}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{getApiVersionTag as e}from"../internal/telemetry.js";import{FrameContexts as r,errorNotSupportedOnPlatform as i}from"../public/constants.js";import{runtime as o}from"../public/runtime.js";import{AppId as p}from"../public/appId.js";var c,s;function a(c,s){if(t(o,r.content),!A())throw i;const a=new p(c);return n(e("v2","externalAppCardActions.processActionSubmit"),"externalAppCardActions.processActionSubmit",[a.toString(),s]).then(([n,t])=>{if(!n)throw t})}function l(c,s,a){if(t(o,r.content),!A())throw i;const l=new p(c);return n(e("v2","externalAppCardActions.processActionOpenUrl"),"externalAppCardActions.processActionOpenUrl",[l.toString(),s.href,a]).then(([n,t])=>{if(n)throw n;return t})}function A(){return!(!t(o)||!o.supports.externalAppCardActions)}!function(n){n.DeepLinkDialog="DeepLinkDialog",n.DeepLinkOther="DeepLinkOther",n.DeepLinkStageView="DeepLinkStageView",n.GenericUrl="GenericUrl"}(c||(c={})),function(n){n.INTERNAL_ERROR="INTERNAL_ERROR",n.INVALID_LINK="INVALID_LINK",n.NOT_SUPPORTED="NOT_SUPPORTED"}(s||(s={}));export{s as ActionOpenUrlErrorCode,c as ActionOpenUrlType,A as isSupported,l as processActionOpenUrl,a as processActionSubmit};
|
|
1
|
+
import{sendMessageToParentAsync as n}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{getApiVersionTag as e}from"../internal/telemetry.js";import{FrameContexts as r,errorNotSupportedOnPlatform as i}from"../public/constants.js";import{runtime as o}from"../public/runtime.js";import{AppId as p}from"../public/appId.js";var c,s;function a(c,s){if(t(o,r.content,r.sidePanel),!A())throw i;const a=new p(c);return n(e("v2","externalAppCardActions.processActionSubmit"),"externalAppCardActions.processActionSubmit",[a.toString(),s]).then(([n,t])=>{if(!n)throw t})}function l(c,s,a){if(t(o,r.content,r.sidePanel),!A())throw i;const l=new p(c);return n(e("v2","externalAppCardActions.processActionOpenUrl"),"externalAppCardActions.processActionOpenUrl",[l.toString(),s.href,a]).then(([n,t])=>{if(n)throw n;return t})}function A(){return!(!t(o)||!o.supports.externalAppCardActions)}!function(n){n.DeepLinkDialog="DeepLinkDialog",n.DeepLinkOther="DeepLinkOther",n.DeepLinkStageView="DeepLinkStageView",n.GenericUrl="GenericUrl"}(c||(c={})),function(n){n.INTERNAL_ERROR="INTERNAL_ERROR",n.INVALID_LINK="INVALID_LINK",n.NOT_SUPPORTED="NOT_SUPPORTED"}(s||(s={}));export{s as ActionOpenUrlErrorCode,c as ActionOpenUrlType,A as isSupported,l as processActionOpenUrl,a as processActionSubmit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParentAsync as o,sendAndUnwrap as r}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{FrameContexts as e,errorNotSupportedOnPlatform as p}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{validateInput as c}from"./externalAppAuthenticationForCEA.js";function l(r,l,m){return t(this,void 0,void 0,function*(){if(n(s,e.content),!A())throw p;c(r,l);const[t,u]=yield o(i("v2","externalAppCardActionsForCEA.processActionOpenUrl"),"externalAppCardActionsForCEA.processActionOpenUrl",[r.toString(),l,m.href]);if(t)throw t;return u})}function m(o,l,m){return t(this,void 0,void 0,function*(){if(n(s,e.content),!A())throw p;c(o,l);const t=yield r(i("v2","externalAppCardActionsForCEA.processActionSubmit"),"externalAppCardActionsForCEA.processActionSubmit",o.toString(),l,m);if(t)throw t})}function A(){return!(!n(s)||!s.supports.externalAppCardActionsForCEA)}export{A as isSupported,l as processActionOpenUrl,m as processActionSubmit};
|
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParentAsync as o,sendAndUnwrap as r}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{FrameContexts as e,errorNotSupportedOnPlatform as p}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{validateInput as c}from"./externalAppAuthenticationForCEA.js";function l(r,l,m){return t(this,void 0,void 0,function*(){if(n(s,e.content,e.sidePanel),!A())throw p;c(r,l);const[t,u]=yield o(i("v2","externalAppCardActionsForCEA.processActionOpenUrl"),"externalAppCardActionsForCEA.processActionOpenUrl",[r.toString(),l,m.href]);if(t)throw t;return u})}function m(o,l,m){return t(this,void 0,void 0,function*(){if(n(s,e.content,e.sidePanel),!A())throw p;c(o,l);const t=yield r(i("v2","externalAppCardActionsForCEA.processActionSubmit"),"externalAppCardActionsForCEA.processActionSubmit",o.toString(),l,m);if(t)throw t})}function A(){return!(!n(s)||!s.supports.externalAppCardActionsForCEA)}export{A as isSupported,l as processActionOpenUrl,m as processActionSubmit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as t}from"../internal/communication.js";import{validateAppIdInstance as i}from"../internal/idValidation.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{FrameContexts as e,errorNotSupportedOnPlatform as s}from"../public/constants.js";import{runtime as
|
|
1
|
+
import{__awaiter as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as t}from"../internal/communication.js";import{validateAppIdInstance as i}from"../internal/idValidation.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{FrameContexts as e,errorNotSupportedOnPlatform as s}from"../public/constants.js";import{runtime as l}from"../public/runtime.js";import{validateUuidInstance as p}from"../public/uuidObject.js";import{isExternalAppError as c}from"./externalAppErrorHandling.js";function m(m,f,d){return r(this,void 0,void 0,function*(){if(o(l,e.content,e.sidePanel),!u())throw s;return function(r,t){i(r),p(t)}(m,d),t("externalAppCardActionsForDA.processActionOpenUrlDialog",[m,new a(f),d],n("v2","externalAppCardActionsForDA.processActionOpenUrlDialog"),c)})}function u(){return!(!o(l)||!l.supports.externalAppCardActionsForDA)}class a{constructor(r){this.info=r}serialize(){const{url:r,title:t,size:i}=this.info;return{url:r.href,title:t,size:i}}}export{a as SerializableActionOpenUrlDialogInfo,u as isSupported,m as processActionOpenUrlDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParentAsync as o}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as i,errorNotSupportedOnPlatform as
|
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParentAsync as o}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as i,errorNotSupportedOnPlatform as e}from"../public/constants.js";import{runtime as p}from"../public/runtime.js";import{AppId as m}from"../public/appId.js";function s(s,c,u){return t(this,void 0,void 0,function*(){if(n(p,i.content,i.sidePanel),!l())throw e;const t=new m(s),[a,d]=yield o(r("v2","externalAppCommands.processActionCommand"),"externalAppCommands.processActionCommand",[t.toString(),c,u]);if(a)throw a;return d})}function l(){return!(!n(p)||!p.supports.externalAppCommands)}export{l as isSupported,s as processActionCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shouldEventBeRelayedToChild as e,sendMessageEventToChild as t}from"../internal/childCommunication.js";import{sendMessageToParent as n}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as s}from"../internal/utils.js";import{FrameContexts as l}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";const m="v1";function p(e,t){r(a),n(o(m,"uploadCustomApp"),"uploadCustomApp",[e],t||s())}function c(e,t,i){r(a),n(o(m,"sendCustomMessage"),e,t,i)}function
|
|
1
|
+
import{shouldEventBeRelayedToChild as e,sendMessageEventToChild as t}from"../internal/childCommunication.js";import{sendMessageToParent as n}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as s}from"../internal/utils.js";import{FrameContexts as l}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";const m="v1";function p(e,t){r(a),n(o(m,"uploadCustomApp"),"uploadCustomApp",[e],t||s())}function c(e,t,i){r(a),n(o(m,"sendCustomMessage"),e,t,i)}function d(n,i){if(r(a),!e())throw new Error("The child window has not yet been initialized or is not present");t(n,i)}function u(e,t){r(a),i(o(m,"registerCustomHandler"),e,(...e)=>t.apply(this,e))}function f(e,t){r(a),i(o(m,"registerUserSettingsChangeHandler"),"userSettingsChange",t,!0,[e])}function w(e){r(a,l.content,l.sidePanel,l.task);const t=[e.entityId,e.title,e.description,e.type,e.objectUrl,e.downloadUrl,e.webPreviewUrl,e.webEditUrl,e.baseUrl,e.editFile,e.subEntityId,e.viewerAction,e.fileOpenPreference,e.conversationId,e.sizeInBytes,e.messageId,e.callerInfo,e.atpData];n(o(m,"openFilePreview"),"openFilePreview",t)}export{w as openFilePreview,u as registerCustomHandler,f as registerUserSettingsChangeHandler,d as sendCustomEvent,c as sendCustomMessage,p as uploadCustomApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o="2.50.0";export{o as version};
|
|
@@ -4669,7 +4669,7 @@ function isSerializable(arg) {
|
|
|
4669
4669
|
* @hidden
|
|
4670
4670
|
* Package version.
|
|
4671
4671
|
*/
|
|
4672
|
-
const version = "2.
|
|
4672
|
+
const version = "2.50.0";
|
|
4673
4673
|
|
|
4674
4674
|
;// ./src/public/featureFlags.ts
|
|
4675
4675
|
// 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.
|
|
@@ -4808,24 +4808,42 @@ function flushMessageQueue(targetWindow, targetOrigin, targetMessageQueue, targe
|
|
|
4808
4808
|
*/
|
|
4809
4809
|
const userOriginUrlValidationRegExp = /^[A-Za-z][A-Za-z\d+.-]*:\/\//;
|
|
4810
4810
|
/**
|
|
4811
|
+
* Checks if the provided host matches the given pattern, which may include a single wildcard segment.
|
|
4811
4812
|
* @param pattern - reference pattern
|
|
4812
4813
|
* @param host - candidate string
|
|
4813
4814
|
* @returns returns true if host matches pre-know valid pattern
|
|
4814
4815
|
*
|
|
4815
4816
|
* @example
|
|
4816
4817
|
* validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
|
|
4818
|
+
* validateHostAgainstPattern('test.*.teams.microsoft.com', 'test.subdomain.teams.microsoft.com') returns true
|
|
4817
4819
|
* validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
|
|
4820
|
+
* validateHostAgainstPattern('*.*.microsoft.com', 'test.team.microsoft.com') returns false
|
|
4818
4821
|
*
|
|
4819
4822
|
* @internal
|
|
4820
4823
|
* Limited to Microsoft-internal use
|
|
4821
4824
|
*/
|
|
4822
4825
|
function validateHostAgainstPattern(pattern, host) {
|
|
4823
|
-
const
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4826
|
+
const patternSegments = pattern.split('.');
|
|
4827
|
+
const hostSegments = host.split('.');
|
|
4828
|
+
if (hostSegments.length !== patternSegments.length) {
|
|
4829
|
+
return false;
|
|
4830
|
+
}
|
|
4831
|
+
let hasUsedWildcard = false;
|
|
4832
|
+
for (let i = 0; i < patternSegments.length; i++) {
|
|
4833
|
+
if (patternSegments[i] === hostSegments[i]) {
|
|
4834
|
+
continue;
|
|
4835
|
+
}
|
|
4836
|
+
if (patternSegments[i] !== '*') {
|
|
4837
|
+
return false;
|
|
4838
|
+
}
|
|
4839
|
+
// Wildcard in the last segment (TLD position) is not allowed for security reasons. Additionally, only one wildcard segment is allowed to prevent overly permissive patterns.
|
|
4840
|
+
if (i === patternSegments.length - 1 || hasUsedWildcard) {
|
|
4841
|
+
return false;
|
|
4842
|
+
}
|
|
4843
|
+
hasUsedWildcard = true;
|
|
4844
|
+
continue;
|
|
4845
|
+
}
|
|
4846
|
+
return true;
|
|
4829
4847
|
}
|
|
4830
4848
|
/**
|
|
4831
4849
|
* @hidden
|
|
@@ -9374,6 +9392,9 @@ function openFilePreview(filePreviewParameters) {
|
|
|
9374
9392
|
filePreviewParameters.fileOpenPreference,
|
|
9375
9393
|
filePreviewParameters.conversationId,
|
|
9376
9394
|
filePreviewParameters.sizeInBytes,
|
|
9395
|
+
filePreviewParameters.messageId,
|
|
9396
|
+
filePreviewParameters.callerInfo,
|
|
9397
|
+
filePreviewParameters.atpData,
|
|
9377
9398
|
];
|
|
9378
9399
|
sendMessageToParent(getApiVersionTag(privateAPIsTelemetryVersionNumber, "openFilePreview" /* ApiName.PrivateAPIs_OpenFilePreview */), 'openFilePreview', params);
|
|
9379
9400
|
}
|
|
@@ -10226,7 +10247,7 @@ function validateQueryMessageExtensionRequest(originalRequestInfo) {
|
|
|
10226
10247
|
* @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
|
10227
10248
|
*/
|
|
10228
10249
|
function authenticateAndResendRequest(appId, authenticateParameters, originalRequestInfo) {
|
|
10229
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10250
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10230
10251
|
if (!externalAppAuthentication_isSupported()) {
|
|
10231
10252
|
throw errorNotSupportedOnPlatform;
|
|
10232
10253
|
}
|
|
@@ -10261,7 +10282,7 @@ function authenticateAndResendRequest(appId, authenticateParameters, originalReq
|
|
|
10261
10282
|
* @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
|
|
10262
10283
|
*/
|
|
10263
10284
|
function authenticateWithSSO(appId, authTokenRequest) {
|
|
10264
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10285
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10265
10286
|
if (!externalAppAuthentication_isSupported()) {
|
|
10266
10287
|
throw errorNotSupportedOnPlatform;
|
|
10267
10288
|
}
|
|
@@ -10284,7 +10305,7 @@ function authenticateWithSSO(appId, authTokenRequest) {
|
|
|
10284
10305
|
* @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
|
|
10285
10306
|
*/
|
|
10286
10307
|
function authenticateWithSSOAndResendRequest(appId, authTokenRequest, originalRequestInfo) {
|
|
10287
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10308
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10288
10309
|
if (!externalAppAuthentication_isSupported()) {
|
|
10289
10310
|
throw errorNotSupportedOnPlatform;
|
|
10290
10311
|
}
|
|
@@ -10312,7 +10333,7 @@ function authenticateWithSSOAndResendRequest(appId, authTokenRequest, originalRe
|
|
|
10312
10333
|
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure
|
|
10313
10334
|
*/
|
|
10314
10335
|
function authenticateWithOauth2(titleId, oauthConfigId, oauthWindowParameters) {
|
|
10315
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10336
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10316
10337
|
if (!externalAppAuthentication_isSupported()) {
|
|
10317
10338
|
throw errorNotSupportedOnPlatform;
|
|
10318
10339
|
}
|
|
@@ -10342,7 +10363,7 @@ function authenticateWithOauth2(titleId, oauthConfigId, oauthWindowParameters) {
|
|
|
10342
10363
|
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure
|
|
10343
10364
|
*/
|
|
10344
10365
|
function authenticateWithPowerPlatformConnectorPlugins(titleId, signInUrl, oauthWindowParameters) {
|
|
10345
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10366
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10346
10367
|
if (!externalAppAuthentication_isSupported()) {
|
|
10347
10368
|
throw errorNotSupportedOnPlatform;
|
|
10348
10369
|
}
|
|
@@ -10389,7 +10410,7 @@ class SerializableConnectorParameters {
|
|
|
10389
10410
|
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
|
10390
10411
|
*/
|
|
10391
10412
|
function authenticateWithConnector(input) {
|
|
10392
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10413
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10393
10414
|
if (!externalAppAuthentication_isSupported()) {
|
|
10394
10415
|
throw errorNotSupportedOnPlatform;
|
|
10395
10416
|
}
|
|
@@ -10457,7 +10478,7 @@ class UserAuthenticationStateResponseHandler extends ResponseHandler {
|
|
|
10457
10478
|
* @throws Error if the capability is not supported or if initialization has not completed.
|
|
10458
10479
|
*/
|
|
10459
10480
|
function getUserAuthenticationStateForConnector(input) {
|
|
10460
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10481
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10461
10482
|
if (!externalAppAuthentication_isSupported()) {
|
|
10462
10483
|
throw errorNotSupportedOnPlatform;
|
|
10463
10484
|
}
|
|
@@ -10479,7 +10500,7 @@ function getUserAuthenticationStateForConnector(input) {
|
|
|
10479
10500
|
* @throws Error if the capability is not supported or if initialization has not completed.
|
|
10480
10501
|
*/
|
|
10481
10502
|
function disconnectConnector(input) {
|
|
10482
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10503
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10483
10504
|
if (!externalAppAuthentication_isSupported()) {
|
|
10484
10505
|
throw errorNotSupportedOnPlatform;
|
|
10485
10506
|
}
|
|
@@ -10542,7 +10563,7 @@ const externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionN
|
|
|
10542
10563
|
*/
|
|
10543
10564
|
function externalAppAuthenticationForCEA_authenticateWithSSO(appId, conversationId, authTokenRequest) {
|
|
10544
10565
|
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
|
10545
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10566
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10546
10567
|
if (!externalAppAuthenticationForCEA_isSupported()) {
|
|
10547
10568
|
throw errorNotSupportedOnPlatform;
|
|
10548
10569
|
}
|
|
@@ -10571,7 +10592,7 @@ function externalAppAuthenticationForCEA_authenticateWithSSO(appId, conversation
|
|
|
10571
10592
|
*/
|
|
10572
10593
|
function authenticateWithOauth(appId, conversationId, authenticateParameters) {
|
|
10573
10594
|
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
|
10574
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10595
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10575
10596
|
if (!externalAppAuthenticationForCEA_isSupported()) {
|
|
10576
10597
|
throw errorNotSupportedOnPlatform;
|
|
10577
10598
|
}
|
|
@@ -10602,7 +10623,7 @@ function authenticateWithOauth(appId, conversationId, authenticateParameters) {
|
|
|
10602
10623
|
*/
|
|
10603
10624
|
function externalAppAuthenticationForCEA_authenticateAndResendRequest(appId, conversationId, authenticateParameters, originalRequestInfo) {
|
|
10604
10625
|
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
|
10605
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10626
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10606
10627
|
if (!externalAppAuthenticationForCEA_isSupported()) {
|
|
10607
10628
|
throw errorNotSupportedOnPlatform;
|
|
10608
10629
|
}
|
|
@@ -10635,7 +10656,7 @@ function externalAppAuthenticationForCEA_authenticateAndResendRequest(appId, con
|
|
|
10635
10656
|
*/
|
|
10636
10657
|
function externalAppAuthenticationForCEA_authenticateWithSSOAndResendRequest(appId, conversationId, authTokenRequest, originalRequestInfo) {
|
|
10637
10658
|
return externalAppAuthenticationForCEA_awaiter(this, void 0, void 0, function* () {
|
|
10638
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10659
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10639
10660
|
if (!externalAppAuthenticationForCEA_isSupported()) {
|
|
10640
10661
|
throw errorNotSupportedOnPlatform;
|
|
10641
10662
|
}
|
|
@@ -10737,7 +10758,7 @@ var ActionOpenUrlErrorCode;
|
|
|
10737
10758
|
* @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
|
|
10738
10759
|
*/
|
|
10739
10760
|
function processActionSubmit(appId, actionSubmitPayload) {
|
|
10740
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10761
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10741
10762
|
if (!externalAppCardActions_isSupported()) {
|
|
10742
10763
|
throw errorNotSupportedOnPlatform;
|
|
10743
10764
|
}
|
|
@@ -10762,7 +10783,7 @@ function processActionSubmit(appId, actionSubmitPayload) {
|
|
|
10762
10783
|
* @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails
|
|
10763
10784
|
*/
|
|
10764
10785
|
function processActionOpenUrl(appId, url, fromElement) {
|
|
10765
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10786
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10766
10787
|
if (!externalAppCardActions_isSupported()) {
|
|
10767
10788
|
throw errorNotSupportedOnPlatform;
|
|
10768
10789
|
}
|
|
@@ -10832,7 +10853,7 @@ const externalAppCardActionsForCEA_externalAppCardActionsTelemetryVersionNumber
|
|
|
10832
10853
|
*/
|
|
10833
10854
|
function externalAppCardActionsForCEA_processActionOpenUrl(appId, conversationId, url) {
|
|
10834
10855
|
return externalAppCardActionsForCEA_awaiter(this, void 0, void 0, function* () {
|
|
10835
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10856
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10836
10857
|
if (!externalAppCardActionsForCEA_isSupported()) {
|
|
10837
10858
|
throw errorNotSupportedOnPlatform;
|
|
10838
10859
|
}
|
|
@@ -10860,7 +10881,7 @@ function externalAppCardActionsForCEA_processActionOpenUrl(appId, conversationId
|
|
|
10860
10881
|
*/
|
|
10861
10882
|
function externalAppCardActionsForCEA_processActionSubmit(appId, conversationId, actionSubmitPayload) {
|
|
10862
10883
|
return externalAppCardActionsForCEA_awaiter(this, void 0, void 0, function* () {
|
|
10863
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10884
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10864
10885
|
if (!externalAppCardActionsForCEA_isSupported()) {
|
|
10865
10886
|
throw errorNotSupportedOnPlatform;
|
|
10866
10887
|
}
|
|
@@ -10959,7 +10980,7 @@ const externalAppCardActionsForDATelemetryVersionNumber = "v2" /* ApiVersionNumb
|
|
|
10959
10980
|
*/
|
|
10960
10981
|
function processActionOpenUrlDialog(appId, actionOpenUrlDialogInfo, traceId) {
|
|
10961
10982
|
return externalAppCardActionsForDA_awaiter(this, void 0, void 0, function* () {
|
|
10962
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
10983
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
10963
10984
|
if (!externalAppCardActionsForDA_isSupported()) {
|
|
10964
10985
|
throw errorNotSupportedOnPlatform;
|
|
10965
10986
|
}
|
|
@@ -11063,7 +11084,7 @@ const externalAppCommandsTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 *
|
|
|
11063
11084
|
*/
|
|
11064
11085
|
function processActionCommand(appId, commandId, extractedParameters) {
|
|
11065
11086
|
return externalAppCommands_awaiter(this, void 0, void 0, function* () {
|
|
11066
|
-
ensureInitialized(runtime, FrameContexts.content);
|
|
11087
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel);
|
|
11067
11088
|
if (!externalAppCommands_isSupported()) {
|
|
11068
11089
|
throw errorNotSupportedOnPlatform;
|
|
11069
11090
|
}
|