UNPKG

@microsoft/teams-js

Version:

Microsoft Client SDK for building app for Microsoft hosts

2 lines (1 loc) 2.35 kB
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};