@microsoft/teams-js 2.44.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 +4 -4
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +3 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +88 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
- package/dist/esm/packages/teams-js/src/index.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/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +135 -2
- 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/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>
|
|
@@ -106,6 +106,9 @@ export declare const enum ApiName {
|
|
|
106
106
|
ExternalAppAuthentication_AuthenticateWithSSOAndResendRequest = "externalAppAuthentication.authenticateWithSSOAndResendRequest",
|
|
107
107
|
ExternalAppAuthentication_AuthenticateWithOauth2 = "externalAppAuthentication.authenticateWithOauth2",
|
|
108
108
|
ExternalAppAuthentication_AuthenticateWithPowerPlatformConnectorPlugins = "externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",
|
|
109
|
+
ExternalAppAuthentication_AuthenticateWithConnector = "externalAppAuthentication.authenticateWithConnector",
|
|
110
|
+
ExternalAppAuthentication_DisconnectConnector = "externalAppAuthentication.disconnectConnector",
|
|
111
|
+
ExternalAppAuthentication_GetUserAuthenticationStateForConnector = "externalAppAuthentication.getUserAuthenticationStateForConnector",
|
|
109
112
|
ExternalAppAuthenticationForCEA_AuthenticateWithOauth = "externalAppAuthenticationForCEA.authenticateWithOauth",
|
|
110
113
|
ExternalAppAuthenticationForCEA_AuthenticateWithSSO = "externalAppAuthenticationForCEA.authenticateWithSSO",
|
|
111
114
|
ExternalAppAuthenticationForCEA_AuthenticateAndResendRequest = "externalAppAuthenticationForCEA.authenticateAndResendRequest",
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { ResponseHandler } from '../internal/responseHandler';
|
|
9
|
+
import { UUID } from '../public';
|
|
9
10
|
import { ISerializable } from '../public/serializable.interface';
|
|
10
11
|
/*********** BEGIN REQUEST TYPE ************/
|
|
11
12
|
/**
|
|
@@ -371,6 +372,93 @@ export declare function authenticateWithOauth2(titleId: string, oauthConfigId: s
|
|
|
371
372
|
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure
|
|
372
373
|
*/
|
|
373
374
|
export declare function authenticateWithPowerPlatformConnectorPlugins(titleId: string, signInUrl?: URL, oauthWindowParameters?: OauthWindowProperties): Promise<void>;
|
|
375
|
+
/**
|
|
376
|
+
* Parameters required to authenticate with connectors.
|
|
377
|
+
*
|
|
378
|
+
* @beta
|
|
379
|
+
* @hidden
|
|
380
|
+
* @internal
|
|
381
|
+
* Limited to Microsoft-internal use
|
|
382
|
+
*
|
|
383
|
+
* @property connectorId - The unique identifier for the connector.
|
|
384
|
+
* @property oauthConfigId - The OAuth configuration ID associated with the connector.
|
|
385
|
+
* @property correlationVector - The correlation vector (UUID) for tracking the authentication request. If not provided, one will be generated.
|
|
386
|
+
*/
|
|
387
|
+
export interface ConnectorParameters {
|
|
388
|
+
/** The unique identifier for the connector. */
|
|
389
|
+
connectorId: string;
|
|
390
|
+
/** The OAuth configuration ID associated with the connector. */
|
|
391
|
+
oAuthConfigId: string;
|
|
392
|
+
/** The trace ID (UUID) for tracking the authentication request. */
|
|
393
|
+
traceId: UUID;
|
|
394
|
+
/** Optional parameters for the OAuth sign-in window. */
|
|
395
|
+
windowParameters?: OauthWindowProperties;
|
|
396
|
+
}
|
|
397
|
+
export declare class SerializableConnectorParameters implements ISerializable {
|
|
398
|
+
private param;
|
|
399
|
+
constructor(param: ConnectorParameters);
|
|
400
|
+
serialize(): object;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* @beta
|
|
404
|
+
* @hidden
|
|
405
|
+
* Signals to the host to perform authentication with connectors using the provided parameters.
|
|
406
|
+
*
|
|
407
|
+
* @internal
|
|
408
|
+
* Limited to Microsoft-internal use
|
|
409
|
+
*
|
|
410
|
+
* @param input - The parameters required for connectors authentication, including connectorId, oauthConfigId, and optional oauthWindowParameters.
|
|
411
|
+
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure.
|
|
412
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
|
413
|
+
*/
|
|
414
|
+
export declare function authenticateWithConnector(input: ConnectorParameters): Promise<void>;
|
|
415
|
+
/**
|
|
416
|
+
* @hidden
|
|
417
|
+
* Represents the possible authentication states for a user in the context of federated connectors.
|
|
418
|
+
*
|
|
419
|
+
* @enum {number}
|
|
420
|
+
* @property {number} Invalid - The authentication state is invalid or not established.
|
|
421
|
+
* @property {number} Valid - The authentication state is valid and the user is authenticated.
|
|
422
|
+
* @property {number} Expired - The authentication state has expired and re-authentication is required.
|
|
423
|
+
* @internal
|
|
424
|
+
* Limited to Microsoft-internal use
|
|
425
|
+
*/
|
|
426
|
+
export declare enum UserAuthenticationState {
|
|
427
|
+
/** The authentication state is invalid or not established. */
|
|
428
|
+
Invalid = "Invalid",
|
|
429
|
+
/** The authentication state is valid and the user is authenticated. */
|
|
430
|
+
Valid = "Valid",
|
|
431
|
+
/** The authentication state has expired and re-authentication is required. */
|
|
432
|
+
Expired = "Expired"
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* @beta
|
|
436
|
+
* @hidden
|
|
437
|
+
* Retrieves the authentication state for a user for a given federated connector.
|
|
438
|
+
*
|
|
439
|
+
* @internal
|
|
440
|
+
* Limited to Microsoft-internal use
|
|
441
|
+
*
|
|
442
|
+
* @param connectorId - The unique identifier for the federated connector.
|
|
443
|
+
* @param oauthConfigId - The OAuth configuration ID associated with the connector.
|
|
444
|
+
* @returns A promise that resolves to the user's authentication state for the federated connector.
|
|
445
|
+
* @throws Error if the capability is not supported or if initialization has not completed.
|
|
446
|
+
*/
|
|
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>;
|
|
374
462
|
/**
|
|
375
463
|
* @hidden
|
|
376
464
|
* Checks if the externalAppAuthentication capability is supported by the host
|
|
@@ -6,6 +6,7 @@ export { ConversationResponse, OpenConversationRequest } from './conversations';
|
|
|
6
6
|
export * as copilot from './copilot/copilot';
|
|
7
7
|
export * as sidePanelInterfaces from './copilot/sidePanelInterfaces';
|
|
8
8
|
export * as externalAppAuthentication from './externalAppAuthentication';
|
|
9
|
+
export { ConnectorParameters, UserAuthenticationState } from './externalAppAuthentication';
|
|
9
10
|
export * as externalAppAuthenticationForCEA from './externalAppAuthenticationForCEA';
|
|
10
11
|
export * as externalAppCardActions from './externalAppCardActions';
|
|
11
12
|
export * as externalAppCardActionsForCEA from './externalAppCardActionsForCEA';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/
|
|
1
|
+
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/conversations.js";export{t as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as p from"./private/copilot/sidePanelInterfaces.js";export{p as sidePanelInterfaces};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/remoteCamera.js";export{d as remoteCamera};import*as g from"./private/appEntity.js";export{g as appEntity};import*as b from"./private/teams/teams.js";export{b as teams};import*as v from"./private/videoEffectsEx.js";export{v as videoEffectsEx};import*as A from"./private/hostEntity/hostEntity.js";export{A as hostEntity};import*as C from"./private/store.js";export{C as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,RenderingSurfaces,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{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.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 h from"./public/liveShareHost.js";export{h as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as S from"./public/authentication.js";export{S as authentication};import*as H from"./public/app/app.js";export{H as app};import*as F from"./public/appInstallDialog.js";export{F as appInstallDialog};import*as y from"./public/barCode.js";export{y as barCode};import*as T from"./public/chat.js";export{T as chat};import*as E from"./public/clipboard.js";export{E as clipboard};import*as I from"./public/dialog/dialog.js";export{I as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as w from"./public/geoLocation/geoLocation.js";export{w as geoLocation};import*as P from"./public/pages/pages.js";export{P as pages};import*as B from"./public/menus.js";export{B as menus};import*as k from"./public/media.js";export{k as media};import*as L from"./public/secondaryBrowser.js";export{L as secondaryBrowser};import*as U from"./public/location.js";export{U as location};import*as M from"./public/meeting/meeting.js";export{M as meeting};import*as O from"./public/monetization.js";export{O as monetization};import*as V from"./public/calendar.js";export{V as calendar};import*as z from"./public/mail/mail.js";export{z as mail};import*as R from"./public/teamsAPIs.js";export{R as teamsCore};import*as W from"./public/people.js";export{W as people};import*as N from"./public/profile.js";export{N as profile};import*as q from"./public/videoEffects.js";export{q as videoEffects};import*as G from"./public/search.js";export{G as search};import*as J from"./public/sharing/sharing.js";export{J as sharing};import*as K from"./public/stageView/stageView.js";export{K as stageView};import*as Q from"./public/visualMedia/visualMedia.js";export{Q as visualMedia};import*as X from"./public/webStorage.js";export{X as webStorage};import*as Y from"./public/call.js";export{Y as call};import*as Z from"./public/appInitialization.js";export{Z as appInitialization};import*as $ from"./public/thirdPartyCloudStorage.js";export{$ as thirdPartyCloudStorage};import*as _ from"./public/settings.js";export{_ as settings};import*as ee from"./public/tasks.js";export{ee as tasks};import*as re from"./public/marketplace.js";export{re as marketplace};import*as te from"./public/shortcutRelay.js";export{te as shortcutRelay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized 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
|
-
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 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 c}from"../public/constants.js";import{runtime as h}from"../public/runtime.js";import{
|
|
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 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 c}from"../public/constants.js";import{runtime as h}from"../public/runtime.js";import{isInvokeError as s,validateActionExecuteInvokeRequest as p,ActionExecuteResponseHandler as l,SerializableActionExecuteInvokeRequest as A}from"./externalAppAuthentication.js";const m="v2";function d(e,i,a){return t(this,void 0,void 0,(function*(){if(o(h,u.content),!v())throw c;return w(e,i),n("externalAppAuthenticationForCEA.authenticateWithSSO",[e,i,a.authId,a.connectionName,a.claims,a.silent],r(m,"externalAppAuthenticationForCEA.authenticateWithSSO"),s)}))}function f(e,i,a){return t(this,void 0,void 0,(function*(){if(o(h,u.content),!v())throw c;return w(e,i),n("externalAppAuthenticationForCEA.authenticateWithOauth",[e,i,a.url.href,a.width,a.height,a.isExternal],r(m,"externalAppAuthenticationForCEA.authenticateWithOauth"),s)}))}function x(n,i,a,d){return t(this,void 0,void 0,(function*(){if(o(h,u.content),!v())throw c;return w(n,i),p(d),e("externalAppAuthenticationForCEA.authenticateAndResendRequest",[n,i,new A(d),a.url.href,a.width,a.height,a.isExternal],new l,r(m,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),s)}))}function E(n,i,a,d){return t(this,void 0,void 0,(function*(){if(o(h,u.content),!v())throw c;return w(n,i),p(d),e("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[n,i,new A(d),a.authId,a.connectionName,a.claims,a.silent],new l,r(m,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),s)}))}function v(){return!(!o(h)||!h.supports.externalAppAuthenticationForCEA)}function w(t,n){a(n,new Error("conversation id is not valid.")),i(t)}export{x as authenticateAndResendRequest,f as authenticateWithOauth,d as authenticateWithSSO,E as authenticateWithSSOAndResendRequest,v as isSupported,w as validateInput};
|
|
@@ -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
|
|
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 u(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 d(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];n(o(m,"openFilePreview"),"openFilePreview",t)}export{w as openFilePreview,d as registerCustomHandler,f as registerUserSettingsChangeHandler,u as sendCustomEvent,c as sendCustomMessage,p as uploadCustomApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.
|
|
1
|
+
const o="2.46.0";export{o as version};
|
|
@@ -1010,6 +1010,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1010
1010
|
TaskModuleDimension: () => (/* reexport */ DialogDimension),
|
|
1011
1011
|
TeamType: () => (/* reexport */ TeamType),
|
|
1012
1012
|
UUID: () => (/* reexport */ UUID),
|
|
1013
|
+
UserAuthenticationState: () => (/* reexport */ UserAuthenticationState),
|
|
1013
1014
|
UserSettingTypes: () => (/* reexport */ UserSettingTypes),
|
|
1014
1015
|
UserTeamRole: () => (/* reexport */ UserTeamRole),
|
|
1015
1016
|
ValidatedSafeString: () => (/* reexport */ validatedSafeString_ValidatedSafeString),
|
|
@@ -1417,11 +1418,16 @@ __webpack_require__.d(externalAppAuthentication_namespaceObject, {
|
|
|
1417
1418
|
InvokeResponseType: () => (InvokeResponseType),
|
|
1418
1419
|
OriginalRequestType: () => (OriginalRequestType),
|
|
1419
1420
|
SerializableActionExecuteInvokeRequest: () => (SerializableActionExecuteInvokeRequest),
|
|
1421
|
+
SerializableConnectorParameters: () => (SerializableConnectorParameters),
|
|
1422
|
+
UserAuthenticationState: () => (UserAuthenticationState),
|
|
1420
1423
|
authenticateAndResendRequest: () => (authenticateAndResendRequest),
|
|
1424
|
+
authenticateWithConnector: () => (authenticateWithConnector),
|
|
1421
1425
|
authenticateWithOauth2: () => (authenticateWithOauth2),
|
|
1422
1426
|
authenticateWithPowerPlatformConnectorPlugins: () => (authenticateWithPowerPlatformConnectorPlugins),
|
|
1423
1427
|
authenticateWithSSO: () => (authenticateWithSSO),
|
|
1424
1428
|
authenticateWithSSOAndResendRequest: () => (authenticateWithSSOAndResendRequest),
|
|
1429
|
+
disconnectConnector: () => (disconnectConnector),
|
|
1430
|
+
getUserAuthenticationStateForConnector: () => (getUserAuthenticationStateForConnector),
|
|
1425
1431
|
isActionExecuteResponse: () => (isActionExecuteResponse),
|
|
1426
1432
|
isInvokeError: () => (isInvokeError),
|
|
1427
1433
|
isSupported: () => (externalAppAuthentication_isSupported),
|
|
@@ -4644,7 +4650,7 @@ function isSerializable(arg) {
|
|
|
4644
4650
|
* @hidden
|
|
4645
4651
|
* Package version.
|
|
4646
4652
|
*/
|
|
4647
|
-
const version = "2.
|
|
4653
|
+
const version = "2.46.0";
|
|
4648
4654
|
|
|
4649
4655
|
;// ./src/public/featureFlags.ts
|
|
4650
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.
|
|
@@ -9212,7 +9218,7 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
|
|
|
9212
9218
|
* Limited to Microsoft-internal use
|
|
9213
9219
|
*/
|
|
9214
9220
|
function openFilePreview(filePreviewParameters) {
|
|
9215
|
-
ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
|
|
9221
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task);
|
|
9216
9222
|
const params = [
|
|
9217
9223
|
filePreviewParameters.entityId,
|
|
9218
9224
|
filePreviewParameters.title,
|
|
@@ -9901,6 +9907,7 @@ class CloseSidePanelResponseHandler extends ResponseHandler {
|
|
|
9901
9907
|
|
|
9902
9908
|
|
|
9903
9909
|
|
|
9910
|
+
|
|
9904
9911
|
/**
|
|
9905
9912
|
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
|
9906
9913
|
*/
|
|
@@ -10207,6 +10214,131 @@ function authenticateWithPowerPlatformConnectorPlugins(titleId, signInUrl, oauth
|
|
|
10207
10214
|
}
|
|
10208
10215
|
});
|
|
10209
10216
|
}
|
|
10217
|
+
class SerializableConnectorParameters {
|
|
10218
|
+
constructor(param) {
|
|
10219
|
+
this.param = param;
|
|
10220
|
+
}
|
|
10221
|
+
serialize() {
|
|
10222
|
+
var _a, _b, _c;
|
|
10223
|
+
return {
|
|
10224
|
+
connectorId: this.param.connectorId,
|
|
10225
|
+
oAuthConfigId: this.param.oAuthConfigId,
|
|
10226
|
+
traceId: (_c = (_b = (_a = this.param.traceId) === null || _a === void 0 ? void 0 : _a.toString) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : this.param.traceId,
|
|
10227
|
+
windowParameters: this.param.windowParameters ? Object.assign({}, this.param.windowParameters) : undefined,
|
|
10228
|
+
};
|
|
10229
|
+
}
|
|
10230
|
+
}
|
|
10231
|
+
/**
|
|
10232
|
+
* @beta
|
|
10233
|
+
* @hidden
|
|
10234
|
+
* Signals to the host to perform authentication with connectors using the provided parameters.
|
|
10235
|
+
*
|
|
10236
|
+
* @internal
|
|
10237
|
+
* Limited to Microsoft-internal use
|
|
10238
|
+
*
|
|
10239
|
+
* @param input - The parameters required for connectors authentication, including connectorId, oauthConfigId, and optional oauthWindowParameters.
|
|
10240
|
+
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure.
|
|
10241
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
|
10242
|
+
*/
|
|
10243
|
+
function authenticateWithConnector(input) {
|
|
10244
|
+
ensureInitialized(runtime, FrameContexts.content);
|
|
10245
|
+
if (!externalAppAuthentication_isSupported()) {
|
|
10246
|
+
throw errorNotSupportedOnPlatform;
|
|
10247
|
+
}
|
|
10248
|
+
validateId(input.connectorId, new Error('connectorId is Invalid.'));
|
|
10249
|
+
validateId(input.oAuthConfigId, new Error('oauthConfigId is Invalid.'));
|
|
10250
|
+
return callFunctionInHost("externalAppAuthentication.authenticateWithConnector" /* ApiName.ExternalAppAuthentication_AuthenticateWithConnector */, [new SerializableConnectorParameters(input)], getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthentication.authenticateWithConnector" /* ApiName.ExternalAppAuthentication_AuthenticateWithConnector */), isInvokeError);
|
|
10251
|
+
}
|
|
10252
|
+
/**
|
|
10253
|
+
* @hidden
|
|
10254
|
+
* Represents the possible authentication states for a user in the context of federated connectors.
|
|
10255
|
+
*
|
|
10256
|
+
* @enum {number}
|
|
10257
|
+
* @property {number} Invalid - The authentication state is invalid or not established.
|
|
10258
|
+
* @property {number} Valid - The authentication state is valid and the user is authenticated.
|
|
10259
|
+
* @property {number} Expired - The authentication state has expired and re-authentication is required.
|
|
10260
|
+
* @internal
|
|
10261
|
+
* Limited to Microsoft-internal use
|
|
10262
|
+
*/
|
|
10263
|
+
var UserAuthenticationState;
|
|
10264
|
+
(function (UserAuthenticationState) {
|
|
10265
|
+
/** The authentication state is invalid or not established. */
|
|
10266
|
+
UserAuthenticationState["Invalid"] = "Invalid";
|
|
10267
|
+
/** The authentication state is valid and the user is authenticated. */
|
|
10268
|
+
UserAuthenticationState["Valid"] = "Valid";
|
|
10269
|
+
/** The authentication state has expired and re-authentication is required. */
|
|
10270
|
+
UserAuthenticationState["Expired"] = "Expired";
|
|
10271
|
+
})(UserAuthenticationState || (UserAuthenticationState = {}));
|
|
10272
|
+
/**
|
|
10273
|
+
* @hidden
|
|
10274
|
+
* @internal
|
|
10275
|
+
* Limited to Microsoft-internal use
|
|
10276
|
+
*
|
|
10277
|
+
* Response handler for user authentication state for federated connectors.
|
|
10278
|
+
* Validates and deserializes the response from the host to ensure it matches the UserAuthenticationState enum.
|
|
10279
|
+
*/
|
|
10280
|
+
class UserAuthenticationStateResponseHandler extends ResponseHandler {
|
|
10281
|
+
/**
|
|
10282
|
+
* Validates if the response is a valid UserAuthenticationState value.
|
|
10283
|
+
* @param response - The response received from the host.
|
|
10284
|
+
* @returns True if the response is a valid UserAuthenticationState, false otherwise.
|
|
10285
|
+
*/
|
|
10286
|
+
validate(response) {
|
|
10287
|
+
return typeof response === 'string' && response in UserAuthenticationState;
|
|
10288
|
+
}
|
|
10289
|
+
/**
|
|
10290
|
+
* Deserializes the response to a UserAuthenticationState value.
|
|
10291
|
+
* @param response - The response received from the host.
|
|
10292
|
+
* @returns The response cast as UserAuthenticationState.
|
|
10293
|
+
*/
|
|
10294
|
+
deserialize(response) {
|
|
10295
|
+
return response;
|
|
10296
|
+
}
|
|
10297
|
+
}
|
|
10298
|
+
/**
|
|
10299
|
+
* @beta
|
|
10300
|
+
* @hidden
|
|
10301
|
+
* Retrieves the authentication state for a user for a given federated connector.
|
|
10302
|
+
*
|
|
10303
|
+
* @internal
|
|
10304
|
+
* Limited to Microsoft-internal use
|
|
10305
|
+
*
|
|
10306
|
+
* @param connectorId - The unique identifier for the federated connector.
|
|
10307
|
+
* @param oauthConfigId - The OAuth configuration ID associated with the connector.
|
|
10308
|
+
* @returns A promise that resolves to the user's authentication state for the federated connector.
|
|
10309
|
+
* @throws Error if the capability is not supported or if initialization has not completed.
|
|
10310
|
+
*/
|
|
10311
|
+
function getUserAuthenticationStateForConnector(input) {
|
|
10312
|
+
ensureInitialized(runtime, FrameContexts.content);
|
|
10313
|
+
if (!externalAppAuthentication_isSupported()) {
|
|
10314
|
+
throw errorNotSupportedOnPlatform;
|
|
10315
|
+
}
|
|
10316
|
+
validateId(input.connectorId, new Error('connectorId is Invalid.'));
|
|
10317
|
+
validateId(input.oAuthConfigId, new Error('oAuthConfigId is Invalid.'));
|
|
10318
|
+
return callFunctionInHostAndHandleResponse("externalAppAuthentication.getUserAuthenticationStateForConnector" /* ApiName.ExternalAppAuthentication_GetUserAuthenticationStateForConnector */, [new SerializableConnectorParameters(input)], new UserAuthenticationStateResponseHandler(), getApiVersionTag(externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthentication.getUserAuthenticationStateForConnector" /* ApiName.ExternalAppAuthentication_GetUserAuthenticationStateForConnector */), isInvokeError);
|
|
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
|
+
}
|
|
10210
10342
|
/**
|
|
10211
10343
|
* @hidden
|
|
10212
10344
|
* Checks if the externalAppAuthentication capability is supported by the host
|
|
@@ -14027,6 +14159,7 @@ function serializeValidSize(size) {
|
|
|
14027
14159
|
|
|
14028
14160
|
|
|
14029
14161
|
|
|
14162
|
+
|
|
14030
14163
|
|
|
14031
14164
|
|
|
14032
14165
|
|