@microsoft/teams-js 2.45.0 → 2.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.45.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.46.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.45.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-1ul+vDBl1B71YBndX5+TpWnAkYZfjzoOgjg57X9Gq3SsDAnN4OLELHWv+hoS/zjU"
48
+ src="https://res.cdn.office.net/teams-js/2.46.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-g9Q+4HMPYpRKmQyg6p5+Wdzlbe75oN7wP0jNLpJRkKOqZpIN9pbxYEoZtubU/eZ5"
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.45.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.46.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -107,6 +107,7 @@ export declare const enum ApiName {
107
107
  ExternalAppAuthentication_AuthenticateWithOauth2 = "externalAppAuthentication.authenticateWithOauth2",
108
108
  ExternalAppAuthentication_AuthenticateWithPowerPlatformConnectorPlugins = "externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",
109
109
  ExternalAppAuthentication_AuthenticateWithConnector = "externalAppAuthentication.authenticateWithConnector",
110
+ ExternalAppAuthentication_DisconnectConnector = "externalAppAuthentication.disconnectConnector",
110
111
  ExternalAppAuthentication_GetUserAuthenticationStateForConnector = "externalAppAuthentication.getUserAuthenticationStateForConnector",
111
112
  ExternalAppAuthenticationForCEA_AuthenticateWithOauth = "externalAppAuthenticationForCEA.authenticateWithOauth",
112
113
  ExternalAppAuthenticationForCEA_AuthenticateWithSSO = "externalAppAuthenticationForCEA.authenticateWithSSO",
@@ -445,6 +445,20 @@ export declare enum UserAuthenticationState {
445
445
  * @throws Error if the capability is not supported or if initialization has not completed.
446
446
  */
447
447
  export declare function getUserAuthenticationStateForConnector(input: ConnectorParameters): Promise<UserAuthenticationState>;
448
+ /**
449
+ * @beta
450
+ * @hidden
451
+ * Retrieves the authentication state for a user for a given federated connector.
452
+ *
453
+ * @internal
454
+ * Limited to Microsoft-internal use
455
+ *
456
+ * @param connectorId - The unique identifier for the federated connector.
457
+ * @param oauthConfigId - The OAuth configuration ID associated with the connector.
458
+ * @returns A promise that resolves when the connector is successfully disconnected and rejects with InvokeError on failure.
459
+ * @throws Error if the capability is not supported or if initialization has not completed.
460
+ */
461
+ export declare function disconnectConnector(input: ConnectorParameters): Promise<void>;
448
462
  /**
449
463
  * @hidden
450
464
  * Checks if the externalAppAuthentication capability is supported by the host
@@ -1 +1 @@
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 r}from"../internal/responseHandler.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{isPrimitiveOrPlainObject as a,validateId as s,validateUrl as u}from"../internal/utils.js";import{FrameContexts as c,errorNotSupportedOnPlatform as h}from"../public/constants.js";import{runtime as l}from"../public/runtime.js";import{AppId as p}from"../public/appId.js";const d="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 R extends r{validate(e){return m(e)}deserialize(e){return e}}function g(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 q(t,n,r){if(i(l,c.content),!k())throw h;const a=new p(t);return E(r),e(o(d,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[a.toString(),r,n.url.href,n.width,n.height,n.isExternal]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))}function C(t,n){if(i(l,c.content),!k())throw h;const r=new p(t);return e(o(d,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[r.toString(),n.claims,n.silent]).then((([e,t])=>{if(!e)throw t}))}function S(t,n,r){if(i(l,c.content),!k())throw h;const a=new p(t);return E(r),e(o(d,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[a.toString(),r,n.claims,n.silent]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))}function j(t,n,r){if(i(l,c.content),!k())throw h;return s(t,new Error("titleId is Invalid.")),s(n,new Error("oauthConfigId is Invalid.")),e(o(d,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[t,n,r.width,r.height,r.isExternal]).then((([e,t])=>{if(!e)throw t}))}function O(t,n,r){if(i(l,c.content),!k())throw h;return s(t,new Error("titleId is Invalid.")),n&&u(n),e(o(d,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[t,null==n?void 0:n.toString(),null==r?void 0:r.width,null==r?void 0:r.height,null==r?void 0:r.isExternal]).then((([e,t])=>{if(!e)throw t}))}!function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(v||(v={}));class P{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(l,c.content),!k())throw h;return s(e.connectorId,new Error("connectorId is Invalid.")),s(e.oAuthConfigId,new Error("oauthConfigId is Invalid.")),t("externalAppAuthentication.authenticateWithConnector",[new P(e)],o(d,"externalAppAuthentication.authenticateWithConnector"),g)}!function(e){e.Invalid="Invalid",e.Valid="Valid",e.Expired="Expired"}(x||(x={}));class b extends r{validate(e){return"string"==typeof e&&e in x}deserialize(e){return e}}function T(e){if(i(l,c.content),!k())throw h;return s(e.connectorId,new Error("connectorId is Invalid.")),s(e.oAuthConfigId,new Error("oAuthConfigId is Invalid.")),n("externalAppAuthentication.getUserAuthenticationStateForConnector",[new P(e)],new b,o(d,"externalAppAuthentication.getUserAuthenticationStateForConnector"),g)}function k(){return!(!i(l)||!l.supports.externalAppAuthentication)}export{A as ActionExecuteInvokeRequestType,R as ActionExecuteResponseHandler,v as InvokeErrorCode,w as InvokeResponseType,I as OriginalRequestType,f as SerializableActionExecuteInvokeRequest,P as SerializableConnectorParameters,x as UserAuthenticationState,q as authenticateAndResendRequest,W as authenticateWithConnector,j as authenticateWithOauth2,O as authenticateWithPowerPlatformConnectorPlugins,C as authenticateWithSSO,S as authenticateWithSSOAndResendRequest,T as getUserAuthenticationStateForConnector,m as isActionExecuteResponse,g as isInvokeError,k as isSupported,y as validateActionExecuteInvokeRequest};
1
+ import{sendMessageToParentAsync as t,callFunctionInHost as e,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 h}from"../public/constants.js";import{runtime as l}from"../public/runtime.js";import{AppId as d}from"../public/appId.js";const p="v2";class f{constructor(t){this.invokeRequest=t}serialize(){return this.invokeRequest}}function m(t){const e=t;return e.responseType===w.ActionExecuteInvokeResponse&&void 0!==e.value&&void 0!==e.statusCode&&void 0!==e.type}const A="Action.Execute";var I,w,v,x;!function(t){t.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",t.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(I||(I={})),function(t){t.ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",t.QueryMessageExtensionResponse="QueryMessageExtensionResponse"}(w||(w={}));class g extends o{validate(t){return m(t)}deserialize(t){return t}}function R(t){if("object"!=typeof t||null===t)return!1;const e=t;return Object.values(v).includes(e.errorCode)&&(void 0===e.message||"string"==typeof e.message)}function E(t){t.requestType===I.ActionExecuteInvokeRequest?y(t):t.requestType===I.QueryMessageExtensionRequest&&function(t){if(t.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(t.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const e of t.parameters){if(e.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(e.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}(t)}function y(t){if(t.type!==A){throw{errorCode:v.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${A}"`}}if(!a(t.data)){throw{errorCode:v.INTERNAL_ERROR,message:`Invalid data type ${typeof t.data}. Data must be a primitive or a plain object.`}}}function C(e,n,o){if(i(l,u.content),!z())throw h;const a=new d(e);return E(o),t(r(p,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[a.toString(),o,n.url.href,n.width,n.height,n.isExternal]).then((([t,e])=>{if(t&&null!=e.responseType)return e;throw e}))}function q(e,n){if(i(l,u.content),!z())throw h;const o=new d(e);return t(r(p,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[o.toString(),n.claims,n.silent]).then((([t,e])=>{if(!t)throw e}))}function S(e,n,o){if(i(l,u.content),!z())throw h;const a=new d(e);return E(o),t(r(p,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[a.toString(),o,n.claims,n.silent]).then((([t,e])=>{if(t&&null!=e.responseType)return e;throw e}))}function j(e,n,o){if(i(l,u.content),!z())throw h;return s(e,new Error("titleId is Invalid.")),s(n,new Error("oauthConfigId is Invalid.")),t(r(p,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[e,n,o.width,o.height,o.isExternal]).then((([t,e])=>{if(!t)throw e}))}function O(e,n,o){if(i(l,u.content),!z())throw h;return s(e,new Error("titleId is Invalid.")),n&&c(n),t(r(p,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[e,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((([t,e])=>{if(!t)throw e}))}!function(t){t.INTERNAL_ERROR="INTERNAL_ERROR"}(v||(v={}));class P{constructor(t){this.param=t}serialize(){var t,e,n;return{connectorId:this.param.connectorId,oAuthConfigId:this.param.oAuthConfigId,traceId:null!==(n=null===(e=null===(t=this.param.traceId)||void 0===t?void 0:t.toString)||void 0===e?void 0:e.call(t))&&void 0!==n?n:this.param.traceId,windowParameters:this.param.windowParameters?Object.assign({},this.param.windowParameters):void 0}}}function W(t){if(i(l,u.content),!z())throw h;return s(t.connectorId,new Error("connectorId is Invalid.")),s(t.oAuthConfigId,new Error("oauthConfigId is Invalid.")),e("externalAppAuthentication.authenticateWithConnector",[new P(t)],r(p,"externalAppAuthentication.authenticateWithConnector"),R)}!function(t){t.Invalid="Invalid",t.Valid="Valid",t.Expired="Expired"}(x||(x={}));class b extends o{validate(t){return"string"==typeof t&&t in x}deserialize(t){return t}}function T(t){if(i(l,u.content),!z())throw h;return s(t.connectorId,new Error("connectorId is Invalid.")),s(t.oAuthConfigId,new Error("oAuthConfigId is Invalid.")),n("externalAppAuthentication.getUserAuthenticationStateForConnector",[new P(t)],new b,r(p,"externalAppAuthentication.getUserAuthenticationStateForConnector"),R)}function k(t){if(i(l,u.content),!z())throw h;return s(t.connectorId,new Error("connectorId is Invalid.")),s(t.oAuthConfigId,new Error("oauthConfigId is Invalid.")),e("externalAppAuthentication.disconnectConnector",[new P(t)],r(p,"externalAppAuthentication.disconnectConnector"),R)}function z(){return!(!i(l)||!l.supports.externalAppAuthentication)}export{A as ActionExecuteInvokeRequestType,g as ActionExecuteResponseHandler,v as InvokeErrorCode,w as InvokeResponseType,I as OriginalRequestType,f as SerializableActionExecuteInvokeRequest,P as SerializableConnectorParameters,x as UserAuthenticationState,C as authenticateAndResendRequest,W as authenticateWithConnector,j as authenticateWithOauth2,O as authenticateWithPowerPlatformConnectorPlugins,q as authenticateWithSSO,S as authenticateWithSSOAndResendRequest,k as disconnectConnector,T as getUserAuthenticationStateForConnector,m as isActionExecuteResponse,R as isInvokeError,z as isSupported,y as validateActionExecuteInvokeRequest};
@@ -1 +1 @@
1
- const o="2.45.0";export{o as version};
1
+ const o="2.46.0";export{o as version};
@@ -1426,6 +1426,7 @@ __webpack_require__.d(externalAppAuthentication_namespaceObject, {
1426
1426
  authenticateWithPowerPlatformConnectorPlugins: () => (authenticateWithPowerPlatformConnectorPlugins),
1427
1427
  authenticateWithSSO: () => (authenticateWithSSO),
1428
1428
  authenticateWithSSOAndResendRequest: () => (authenticateWithSSOAndResendRequest),
1429
+ disconnectConnector: () => (disconnectConnector),
1429
1430
  getUserAuthenticationStateForConnector: () => (getUserAuthenticationStateForConnector),
1430
1431
  isActionExecuteResponse: () => (isActionExecuteResponse),
1431
1432
  isInvokeError: () => (isInvokeError),
@@ -4649,7 +4650,7 @@ function isSerializable(arg) {
4649
4650
  * @hidden
4650
4651
  * Package version.
4651
4652
  */
4652
- const version = "2.45.0";
4653
+ const version = "2.46.0";
4653
4654
 
4654
4655
  ;// ./src/public/featureFlags.ts
4655
4656
  // 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.
@@ -10316,6 +10317,28 @@ function getUserAuthenticationStateForConnector(input) {
10316
10317
  validateId(input.oAuthConfigId, new Error('oAuthConfigId is Invalid.'));
10317
10318
  return callFunctionInHostAndHandleResponse("externalAppAuthentication.getUserAuthenticationStateForConnector" /* ApiName.ExternalAppAuthentication_GetUserAuthenticationStateForConnector */, [new SerializableConnectorParameters(input)], new UserAuthenticationStateResponseHandler(), getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthentication.getUserAuthenticationStateForConnector" /* ApiName.ExternalAppAuthentication_GetUserAuthenticationStateForConnector */), isInvokeError);
10318
10319
  }
10320
+ /**
10321
+ * @beta
10322
+ * @hidden
10323
+ * Retrieves the authentication state for a user for a given federated connector.
10324
+ *
10325
+ * @internal
10326
+ * Limited to Microsoft-internal use
10327
+ *
10328
+ * @param connectorId - The unique identifier for the federated connector.
10329
+ * @param oauthConfigId - The OAuth configuration ID associated with the connector.
10330
+ * @returns A promise that resolves when the connector is successfully disconnected and rejects with InvokeError on failure.
10331
+ * @throws Error if the capability is not supported or if initialization has not completed.
10332
+ */
10333
+ function disconnectConnector(input) {
10334
+ ensureInitialized(runtime, FrameContexts.content);
10335
+ if (!externalAppAuthentication_isSupported()) {
10336
+ throw errorNotSupportedOnPlatform;
10337
+ }
10338
+ validateId(input.connectorId, new Error('connectorId is Invalid.'));
10339
+ validateId(input.oAuthConfigId, new Error('oauthConfigId is Invalid.'));
10340
+ return callFunctionInHost("externalAppAuthentication.disconnectConnector" /* ApiName.ExternalAppAuthentication_DisconnectConnector */, [new SerializableConnectorParameters(input)], getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthentication.disconnectConnector" /* ApiName.ExternalAppAuthentication_DisconnectConnector */), isInvokeError);
10341
+ }
10319
10342
  /**
10320
10343
  * @hidden
10321
10344
  * Checks if the externalAppAuthentication capability is supported by the host