@microsoft/teams-js 2.45.0 → 2.47.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/private/copilot/sidePanel.d.ts +2 -2
- package/dist/esm/packages/teams-js/dts/private/copilot/sidePanelInterfaces.d.ts +16 -1
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +14 -0
- package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +35 -3
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -53
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
|
24
24
|
|
|
25
25
|
### Production
|
|
26
26
|
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.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.
|
|
49
|
-
integrity="sha384-
|
|
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.
|
|
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",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import { SdkError } from '../../public/interfaces';
|
|
10
|
-
import { Content, ContentRequest, PreCheckContextResponse, SidePanelError, SidePanelErrorImpl } from './sidePanelInterfaces';
|
|
10
|
+
import { Content, ContentRequest, PreCheckContextResponse, SidePanelError, SidePanelErrorImpl, UserConsentRequest } from './sidePanelInterfaces';
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
* @internal
|
|
@@ -50,7 +50,7 @@ export declare function getContent(request?: ContentRequest): Promise<Content>;
|
|
|
50
50
|
* @internal
|
|
51
51
|
* Limited to Microsoft-internal use
|
|
52
52
|
*/
|
|
53
|
-
export declare function preCheckUserConsent(): Promise<PreCheckContextResponse>;
|
|
53
|
+
export declare function preCheckUserConsent(request?: UserConsentRequest): Promise<PreCheckContextResponse>;
|
|
54
54
|
/** Register user action content select handler function type */
|
|
55
55
|
export type userActionHandlerType = (selectedContent: Content) => void;
|
|
56
56
|
/**
|
|
@@ -431,7 +431,22 @@ export interface Content {
|
|
|
431
431
|
* Limited to Microsoft-internal use
|
|
432
432
|
*/
|
|
433
433
|
export interface ContentRequest {
|
|
434
|
-
|
|
434
|
+
/**
|
|
435
|
+
* @deprecated Use the index signature `[key: string]: unknown` instead to pass custom properties.
|
|
436
|
+
*/
|
|
437
|
+
localEndpointInfo?: string;
|
|
438
|
+
[key: string]: unknown;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* @hidden
|
|
442
|
+
*
|
|
443
|
+
* The UserConsentRequest interface represents the request params sent to the hub to get user consent.
|
|
444
|
+
*
|
|
445
|
+
* @internal
|
|
446
|
+
* Limited to Microsoft-internal use
|
|
447
|
+
*/
|
|
448
|
+
export interface UserConsentRequest {
|
|
449
|
+
[key: string]: unknown;
|
|
435
450
|
}
|
|
436
451
|
/**
|
|
437
452
|
* @hidden
|
|
@@ -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{__awaiter as e}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHostAndHandleResponse as t}from"../../internal/communication.js";import{registerHandlerHelper as n}from"../../internal/handlers.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{ResponseHandler as r}from"../../internal/responseHandler.js";import{getApiVersionTag as
|
|
1
|
+
import{__awaiter as e}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHostAndHandleResponse as t}from"../../internal/communication.js";import{registerHandlerHelper as n}from"../../internal/handlers.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{ResponseHandler as r}from"../../internal/responseHandler.js";import{getApiVersionTag as s}from"../../internal/telemetry.js";import{FrameContexts as i}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as c}from"../../public/runtime.js";import{SidePanelErrorCode as u,SidePanelErrorImpl as p}from"./sidePanelInterfaces.js";const a="v2";function d(){var e;return o(c)&&!!(null===(e=c.supports.copilot)||void 0===e?void 0:e.sidePanel)}function m(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(u).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)||l(e)}function f(n){return e(this,void 0,void 0,(function*(){o(c);const e=n?[new b(n)]:[];return t("copilot.sidePanel.getContent",e,new C,s(a,"copilot.sidePanel.getContent"),m)}))}function j(n){return e(this,void 0,void 0,(function*(){o(c);const e=n?[new g(n)]:[];return t("copilot.sidePanel.preCheckUserConsent",e,new P,s(a,"copilot.sidePanel.preCheckUserConsent"),m)}))}function h(e){n(s(a,"copilot.sidePanel.registerUserActionContentSelect"),"copilot.sidePanel.userActionContentSelect",e,[i.content],(()=>{if(!d())throw v}))}const v=new p(u.NotSupportedOnPlatform,"This API is not supported on the current platform.");class C extends r{validate(e){return null!==e&&"object"==typeof e}deserialize(e){return e}}class P extends r{validate(e){return null!==e&&"object"==typeof e}deserialize(e){return e}}class b{constructor(e){this.contentRequest=e}serialize(){return this.contentRequest}}class g{constructor(e){this.userConsentRequest=e}serialize(){return this.userConsentRequest}}export{v as copilotSidePanelNotSupportedOnPlatformError,f as getContent,m as isResponseAReportableError,d as isSupported,j as preCheckUserConsent,h as registerUserActionContentSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sendMessageToParentAsync as
|
|
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
|
|
1
|
+
const t="2.47.0-beta.0";export{t 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.
|
|
4653
|
+
const version = "2.47.0-beta.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.
|
|
@@ -9772,10 +9773,11 @@ function getContent(request) {
|
|
|
9772
9773
|
* @internal
|
|
9773
9774
|
* Limited to Microsoft-internal use
|
|
9774
9775
|
*/
|
|
9775
|
-
function preCheckUserConsent() {
|
|
9776
|
+
function preCheckUserConsent(request) {
|
|
9776
9777
|
return sidePanel_awaiter(this, void 0, void 0, function* () {
|
|
9777
9778
|
ensureInitialized(runtime);
|
|
9778
|
-
|
|
9779
|
+
const input = request ? [new SerializableUserConsentRequest(request)] : [];
|
|
9780
|
+
return callFunctionInHostAndHandleResponse("copilot.sidePanel.preCheckUserConsent" /* ApiName.Copilot_SidePanel_PreCheckUserConsent */, input, new PreCheckContextResponseHandler(), getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.preCheckUserConsent" /* ApiName.Copilot_SidePanel_PreCheckUserConsent */), isResponseAReportableError);
|
|
9779
9781
|
});
|
|
9780
9782
|
}
|
|
9781
9783
|
/**
|
|
@@ -9828,6 +9830,14 @@ class SerializableContentRequest {
|
|
|
9828
9830
|
return this.contentRequest;
|
|
9829
9831
|
}
|
|
9830
9832
|
}
|
|
9833
|
+
class SerializableUserConsentRequest {
|
|
9834
|
+
constructor(userConsentRequest) {
|
|
9835
|
+
this.userConsentRequest = userConsentRequest;
|
|
9836
|
+
}
|
|
9837
|
+
serialize() {
|
|
9838
|
+
return this.userConsentRequest;
|
|
9839
|
+
}
|
|
9840
|
+
}
|
|
9831
9841
|
|
|
9832
9842
|
;// ./src/private/copilot/view.ts
|
|
9833
9843
|
var view_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -10316,6 +10326,28 @@ function getUserAuthenticationStateForConnector(input) {
|
|
|
10316
10326
|
validateId(input.oAuthConfigId, new Error('oAuthConfigId is Invalid.'));
|
|
10317
10327
|
return callFunctionInHostAndHandleResponse("externalAppAuthentication.getUserAuthenticationStateForConnector" /* ApiName.ExternalAppAuthentication_GetUserAuthenticationStateForConnector */, [new SerializableConnectorParameters(input)], new UserAuthenticationStateResponseHandler(), getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthentication.getUserAuthenticationStateForConnector" /* ApiName.ExternalAppAuthentication_GetUserAuthenticationStateForConnector */), isInvokeError);
|
|
10318
10328
|
}
|
|
10329
|
+
/**
|
|
10330
|
+
* @beta
|
|
10331
|
+
* @hidden
|
|
10332
|
+
* Retrieves the authentication state for a user for a given federated connector.
|
|
10333
|
+
*
|
|
10334
|
+
* @internal
|
|
10335
|
+
* Limited to Microsoft-internal use
|
|
10336
|
+
*
|
|
10337
|
+
* @param connectorId - The unique identifier for the federated connector.
|
|
10338
|
+
* @param oauthConfigId - The OAuth configuration ID associated with the connector.
|
|
10339
|
+
* @returns A promise that resolves when the connector is successfully disconnected and rejects with InvokeError on failure.
|
|
10340
|
+
* @throws Error if the capability is not supported or if initialization has not completed.
|
|
10341
|
+
*/
|
|
10342
|
+
function disconnectConnector(input) {
|
|
10343
|
+
ensureInitialized(runtime, FrameContexts.content);
|
|
10344
|
+
if (!externalAppAuthentication_isSupported()) {
|
|
10345
|
+
throw errorNotSupportedOnPlatform;
|
|
10346
|
+
}
|
|
10347
|
+
validateId(input.connectorId, new Error('connectorId is Invalid.'));
|
|
10348
|
+
validateId(input.oAuthConfigId, new Error('oauthConfigId is Invalid.'));
|
|
10349
|
+
return callFunctionInHost("externalAppAuthentication.disconnectConnector" /* ApiName.ExternalAppAuthentication_DisconnectConnector */, [new SerializableConnectorParameters(input)], getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthentication.disconnectConnector" /* ApiName.ExternalAppAuthentication_DisconnectConnector */), isInvokeError);
|
|
10350
|
+
}
|
|
10319
10351
|
/**
|
|
10320
10352
|
* @hidden
|
|
10321
10353
|
* Checks if the externalAppAuthentication capability is supported by the host
|