@authowl/core 0.16.1 → 0.17.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/dist/chunk-55HRM7WA.js +1 -0
- package/dist/{client-FwJ8dBsF.d.ts → client-BkPncYVH.d.ts} +71 -1
- package/dist/{client-BebgV6Rp.d.cts → client-CEqVpSLs.d.cts} +71 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/messages.cjs +1 -1
- package/dist/messages.d.cts +16 -0
- package/dist/messages.d.ts +16 -0
- package/dist/messages.js +1 -1
- package/dist/native.cjs +2 -2
- package/dist/native.d.cts +2 -2
- package/dist/native.d.ts +2 -2
- package/dist/native.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ULB5QRXB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {p,o,i,z,s,q as q$1,y,r,w,B,E as E$1,x,t,A,v,u}from'./chunk-V3MSLXXB.js';import {a}from'./chunk-T5SH3ZZP.js';function Ui(e){let t=e?.enabledMethods??["password"],n=t.includes("password"),i=t.includes("passkey"),o=e?.authentication,a=e?.mfa;return {emailSignUp:o?.email.signUp??t.some(l=>l==="password"||l==="magic_link"||l==="email_otp"),passwordSignUp:o?.password.signUp??n,phoneSignUp:o?.phone.signUp??t.includes("phone_otp"),passwordSignIn:o?.email.signIn.includes("password")??n,passwordMinLength:o?.password.minLength??8,passwordMaxLength:o?.password.maxLength??128,magicLinkSignIn:o?.email.signIn.includes("magic_link")??t.includes("magic_link"),emailOtpSignIn:o?.email.signIn.includes("email_otp")??t.includes("email_otp"),phoneSignIn:o?.phone.signIn??t.includes("phone_otp"),usernameSignIn:o?.username.signIn??false,collectUsername:o?.username.collectOnSignUp??false,passkeySignIn:o?.passkey.signIn??i,passkeyAdd:o?.passkey.add??i,firstLastName:e?.userModel?.firstLastName??false,emailChange:e===null?false:e.userModel?.emailChange??true,accountDeletion:e?.userModel?.accountDeletion??e?.accountDeletion??false,emailVerificationRequired:e?.emailVerification?.required??e?.requireEmailVerification??false,emailVerificationMethod:e?.emailVerification?.method??"link",totp:a?.totp??e?.twoFactor??false,mfaRequired:a?.required??e?.mfaRequired??false,backupCodes:a?.backupCodes??e?.twoFactor??false,legacyNameField:e?.authentication===void 0}}var ue=class extends Error{status;requestId;constructor(t,n,i){super(`${t} request failed with status ${n.status}.`),this.name="AuthOwlHttpError",this.status=n.status,this.requestId=i;}};function Q(e,t,n={}){let i=new Headers(n.init?.headers);return i.set("x-publishable-key",e.publishableKey),p({fetchImpl:e.fetch,url:t,init:{...n.init,headers:i},allowHttpLoopback:e.decoded.env==="test",...n.timeoutMs===void 0?{}:{timeoutMs:n.timeoutMs},...n.maxResponseBytes===void 0?{}:{maxResponseBytes:n.maxResponseBytes},...n.decode===void 0?{}:{decode:n.decode}})}function _e(e,t){if(!e.response.ok)throw new ue(t,e.response,e.requestId);return e.data}var fn="x-authowl-turnstile-token",hn=1e4,An=32,On=2e4;function L(e,t){return {post:(n,i,o,a)=>e.request(n,{method:"POST",body:i,fetchOptions:o,decode:a}),mutation:async(n,i)=>{let o=await n;return o.error===null&&(i===void 0||o.data!==null&&i(o.data))&&t(),o}}}function pe(e,t=e.projectBaseURL){return {async request(n,i$1={}){let o$1=wn(t,n,i$1.query),a=i$1.method??(i$1.body===void 0?"GET":"POST"),l=new Headers(i$1.fetchOptions?.headers);i$1.fetchOptions?.authChallengeToken&&l.set(fn,i$1.fetchOptions.authChallengeToken),i$1.body!==void 0&&l.set("content-type","application/json");let f={method:a,headers:l,credentials:i$1.credentials??"include",...i$1.body===void 0?{}:{body:JSON.stringify(i$1.body)}},p=Object.freeze({method:a,path:n});await i$1.fetchOptions?.onRequest?.(p);let A=bn(a,i$1.fetchOptions),r;try{r=await yn(e,o$1,{...f,signal:i$1.fetchOptions?.signal},A);}catch(h){let R=Fe(h);return await i$1.fetchOptions?.onError?.(ce(p,R,Sn(h))),{data:null,error:R}}let{response:u,requestId:g}=r,y=Pn(n,r.data),s=y;if(u.ok)try{s=le(y),i$1.decode&&(s=i$1.decode(s));}catch{let h=Fe(new o("invalid_response",g));return await i$1.fetchOptions?.onError?.(ce(p,h,"invalid_response")),{data:null,error:h}}let d=Object.freeze({...p,status:u.status,...g===void 0?{}:{requestId:g}});if(await i$1.fetchOptions?.onResponse?.(d),!u.ok){let h=kn(u,y,g);return h.code===i&&e.session.tokens.dropChallenge(),await i$1.fetchOptions?.onError?.(ce(p,h,"api")),{data:null,error:h}}return await i$1.fetchOptions?.onSuccess?.(d),{data:s,error:null}}}}async function yn(e,t,n,i){let o$1=Date.now()+hn;for(let a=0;a<i;a+=1){let l=o$1-Date.now();if(l<=0)throw new o("timeout");try{let f=await Q(e,t,{init:n,timeoutMs:Math.max(1,Math.ceil(l))});if(f.response.status<500||a===i-1)return f}catch(f){if(a===i-1||!(f instanceof o)||f.kind!=="network")throw f}await In(50*2**a,n.signal,o$1);}throw new o("network")}function bn(e,t){if(e!=="GET"||t?.authChallengeToken)return 1;let n=t?.retry;return typeof n!="number"||!Number.isFinite(n)?1:Math.min(Math.max(Math.trunc(n),0),3)+1}function wn(e,t,n){let i=new URL(`${e}${t.startsWith("/")?t:`/${t}`}`);for(let[o,a]of Object.entries(n??{}))a!==void 0&&i.searchParams.set(o,String(a));return i.toString()}function kn(e,t,n){let i=K(t)?t:{},o=Rn(i,e.headers);return {status:e.status,statusText:e.statusText,code:typeof i.code=="string"?i.code:void 0,...n===void 0?{}:{requestId:n},...typeof i.current_version=="number"?{currentVersion:i.current_version}:{},...o!==void 0?{retryAfterSeconds:o}:{},message:typeof i.message=="string"?i.message:typeof i.error=="string"?i.error:typeof i.detail=="string"?i.detail:e.statusText||"Request failed"}}function Rn(e,t){let n=(typeof e.retryAfterSeconds=="number"&&Number.isFinite(e.retryAfterSeconds)?e.retryAfterSeconds:void 0)??Le(t.get("retry-after"))??Le(t.get("x-retry-after"));if(n!==void 0)return Math.min(Math.max(Math.trunc(n),1),86400)}function Le(e){if(!e)return;let t=e.trim();if(!/^\d+$/.test(t))return;let n=Number(t);return Number.isFinite(n)?n:void 0}function Fe(e){let t=e instanceof o?e.kind:"network";return {status:0,...{aborted:{statusText:"ABORTED",code:"REQUEST_ABORTED",message:"The request was cancelled."},timeout:{statusText:"TIMEOUT",code:"REQUEST_TIMEOUT",message:"The request timed out."},response_too_large:{statusText:"INVALID_RESPONSE",code:"RESPONSE_TOO_LARGE",message:"The service response was too large."},invalid_response:{statusText:"INVALID_RESPONSE",code:"INVALID_RESPONSE",message:"The service returned an invalid response."},network:{statusText:"FETCH_ERROR",code:"FETCH_ERROR",message:"Network request failed."}}[t],...e instanceof o&&e.requestId?{requestId:e.requestId}:{}}}function ce(e,t,n){return Object.freeze({...e,status:t.status??0,...t.requestId===void 0?{}:{requestId:t.requestId},failure:n})}function Sn(e){return e instanceof o?e.kind:"network"}function In(e,t,n){return new Promise((i,o$1)=>{if(t?.aborted){o$1(new o("aborted"));return}let a=n-Date.now();if(a<=0){o$1(new o("timeout"));return}let l=Math.min(e,a),f=()=>{clearTimeout(p),o$1(new o("aborted"));},p=setTimeout(()=>{t?.removeEventListener("abort",f),Date.now()>=n?o$1(new o("timeout")):i();},l);t?.addEventListener("abort",f,{once:true}),t?.aborted&&f();})}function le(e,t="",n=0,i={nodes:0}){if(i.nodes+=1,n>An||i.nodes>On)throw new Error("response traversal limit exceeded");if(typeof e=="string"&&/^(?:createdAt|updatedAt|expiresAt)$/.test(t)){let o=new Date(e);return Number.isNaN(o.getTime())?e:o}return Array.isArray(e)?e.map(o=>le(o,"",n+1,i)):K(e)?Object.fromEntries(Object.entries(e).map(([o,a])=>[o,Tn(o)?a:le(a,o,n+1,i)])):e}function Tn(e){return e==="metadata"||e==="public_metadata"||e==="unsafe_metadata"||e==="private_metadata"||e==="publicMetadata"||e==="unsafeMetadata"||e==="privateMetadata"}function Pn(e,t){if(e==="/list-sessions"&&Array.isArray(t))return t.map(o=>K(o)?de(o):o);if(!K(t))return t;let i=e==="/change-password"||e==="/passkey/verify-authentication"||e==="/phone-otp/verify"||e==="/sign-up/email"||e.startsWith("/sign-in/")||e.startsWith("/two-factor/verify-")?de(t):t;return e==="/sign-up/email"&&!("sessionCreated"in i)&&(i={...i,sessionCreated:typeof t.token=="string"&&t.token.length>0}),(e==="/get-session"||e==="/passkey/verify-authentication")&&K(i.session)&&(i={...i,session:de(i.session)}),i}function de(e){if(!Object.hasOwn(e,"token"))return e;let t={...e};return delete t.token,t}function K(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function qe(){let e=globalThis.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return `${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Ve({http:e,probe:t,tokens:n,channelName:i}){let o=new Set,a=null,l=null,f=null,p=null,A=null,r=null,u,g=O=>{d(O);};u={data:null,isPending:true,isRefetching:false,error:null,refetch:g};function y(O){u=O;for(let S of o)S();}async function s(O){return e.request("/get-session",{query:O?.query,decode:ge})}function d(O){if(O?.query?.disableCookieCache===true)return R(O);if(p)return p;if(A)return A;let S=R(O).finally(()=>{A===S&&(A=null);});return A=S,S}function h(){if(p)return p;let O=R({query:{disableCookieCache:true}}).finally(()=>{p===O&&(p=null);});return p=O,O}async function R(O){f?.abort();let S=new AbortController;f=S,y({...u,isPending:u.data===null&&u.error===null,isRefetching:u.data!==null});let B=n.beginRead(),$=await e.request("/get-session",{query:O?.query,fetchOptions:{signal:S.signal},decode:ge});if(f===S&&(f=null,y({data:$.data,error:$.error,isPending:false,isRefetching:false,refetch:g}),$.error===null)){if($.data===null){B.endIfDead();return}await x(B);}}async function x(O){if(n.needsProbe()){if(!O.carriedToken){O.recordCookieVerdict(true);return}return r||ze(O)}}function ze(O){let S=t.request("/get-session",{query:{disableCookieCache:true},decode:ge}).then(B=>{r===S&&B.error===null&&O.recordCookieVerdict(B.data!==null);}).finally(()=>{r===S&&(r=null);});return r=S,S}function Ce(){a?.postMessage({type:"session-changed"});}function gn(){if(typeof window>"u"||l)return;let O=()=>{d();},S=()=>{document.visibilityState==="visible"&&d();};window.addEventListener("focus",O),document.addEventListener("visibilitychange",S),typeof BroadcastChannel<"u"&&(a=new BroadcastChannel(i),a.addEventListener("message",O)),l=()=>{window.removeEventListener("focus",O),document.removeEventListener("visibilitychange",S),a?.close(),a=null,l=null;};}function mn(O){return o.add(O),o.size===1&&(gn(),d()),()=>{if(o.delete(O),o.size===0){let S=f;f=null,A=null,p=null,S?.abort(),l?.();}}}return n.measureWith(()=>{n.needsProbe()&&ze(n.beginRead());}),{store:{subscribe:mn,getSnapshot:()=>u,refresh:h},getSession:s,notifyMutation(){Ce(),r&&r.catch(()=>{}).then(()=>{!n.needsProbe()&&n.hasToken()&&Ce();}),o.size>0&&d({query:{disableCookieCache:true}});}}}function ge(e){if(e===null)return null;let t=q$1(e);return (t.session===void 0||t.user===void 0)&&y(),{session:x(t.session),user:w(t.user)}}async function He(e,t){return e.request("/user/metadata",{fetchOptions:t,decode:Ke})}async function Be(e,t,n){return e.request("/user/metadata",{method:"PATCH",body:{expected_version:t.expectedVersion,unsafe_metadata:t.unsafeMetadata},fetchOptions:n,decode:Ke})}function Ke(e){let t=q$1(e),n=z(t.public_metadata),i=z(t.unsafe_metadata);if(!Number.isSafeInteger(t.metadata_version)||t.metadata_version<0)throw new TypeError("Invalid AuthOwl metadata response");return {publicMetadata:n,unsafeMetadata:i,metadataVersion:t.metadata_version}}function Je(e,t){let{post:n,mutation:i}=L(e,t);return {getMetadata:o=>He(e,o),updateUnsafeMetadata:(o,a)=>Be(e,o,a),updateProfile:(o,a)=>i(n("/update-user",o,a,j)),changeEmail:(o,a)=>i(n("/change-email",o,a,j)),changePassword:(o,a)=>i(n("/change-password",o,a,vn)),listSessions:o=>e.request("/list-sessions",{fetchOptions:o,decode:zn}),revokeSession:({sessionId:o},a)=>i(n("/revoke-session",{sessionId:o},a,j)),revokeOtherSessions:o=>i(n("/revoke-other-sessions",{},o,j)),listSocialAccounts:async o=>{let a=await e.request("/list-accounts",{fetchOptions:o,decode:Cn});if(!a.data)return {data:null,error:a.error};let l=a.data.length>1;return {...a,data:a.data.filter(f=>f.providerId!=="credential").map(f=>({...f,canUnlink:l}))}},linkSocial:(o,a)=>n("/link-social",o,a,Dn),unlinkSocial:(o,a)=>i(n("/unlink-account",o,a,j)),delete:(o={},a)=>i(n("/delete-user",o,a,xn))}}function j(e){let t=q$1(e);return {status:s(t.status)}}function vn(e){let t=q$1(e);return {user:w(t.user)}}function zn(e){return Array.isArray(e)||y(),e.map(t$1=>{let n=q$1(t$1);return {id:r(n.id),userId:r(n.userId),createdAt:t(n.createdAt),updatedAt:t(n.updatedAt),expiresAt:t(n.expiresAt),...je("ipAddress",v(n,"ipAddress")),...je("userAgent",v(n,"userAgent"))}})}function Cn(e){return Array.isArray(e)||y(),e.map(t$1=>{let n=q$1(t$1);return {id:r(n.id),userId:r(n.userId),providerId:r(n.providerId),accountId:r(n.accountId),scopes:u(n.scopes),createdAt:t(n.createdAt),updatedAt:t(n.updatedAt)}})}function Dn(e){let t=q$1(e);return {url:r(t.url),redirect:s(t.redirect)}}function xn(e){let t=q$1(e);return {success:s(t.success),message:r(t.message)}}function je(e,t){return t===void 0?{}:{[e]:t}}var En=new Set(["pending","accepted","rejected","canceled"]),me=1e4;function F(e,t$1,n){let i=q$1(e),o={id:b(i.id),name:b(i.name),slug:b(i.slug),createdAt:t(i.createdAt),...Z("logo",v(i,"logo")),...Z("metadata",i.metadata===void 0?void 0:A(i.metadata))};return E(o.id,t$1),E(o.slug,n),o}function Ge(e){return U(e,F)}function fe(e,t,n){return e===null?null:(t===null&&y(),F(e,t,n))}function We(e,t,n){if(e===null)return null;let i=q$1(e),o=F(i,t,n);return {...o,members:U(i.members,a=>at(a,o.id)),invitations:U(i.invitations,a=>M(a,void 0,o.id))}}function he(e,t,n=false){let i=U(e,o=>J(o));return n||W(i.map(o=>o.organizationId),t),i}function Xe(e,t){let n=U(e,i=>Ae(i));return W(n.map(i=>i.teamId),t),n}function Ae(e,t$1,n){let i=q$1(e),o={id:b(i.id),teamId:b(i.teamId),userId:b(i.userId),createdAt:t(i.createdAt)};return E(o.teamId,t$1),E(o.userId,n),o}function $e(e,t,n){return e===null?null:(t===null&&y(),J(e,t,n))}function Ye(e,t){let n=q$1(e);return (!Number.isSafeInteger(n.total)||n.total<0)&&y(),{members:Nn(n.members,t),total:n.total}}function M(e,t$1,n){let i=q$1(e),o=b(i.status);En.has(o)||y();let a={id:b(i.id),organizationId:b(i.organizationId),email:G(i.email),role:b(i.role),status:o,inviterId:b(i.inviterId),expiresAt:t(i.expiresAt),createdAt:t(i.createdAt)};return E(a.id,t$1),E(a.organizationId,n),a}function Qe(e,t){let n=U(e,i=>M(i));return W(n.map(i=>i.organizationId),t),n}function Ze(e){return U(e,t=>{let n=q$1(t);return {...M(n),organizationName:G(n.organizationName)}})}function et(e,t){let n=q$1(e);return {...M(n,t),organizationName:b(n.organizationName),organizationSlug:b(n.organizationSlug),inviterEmail:st(n.inviterEmail)}}function tt(e,t){let n=q$1(e),i=M(n.invitation,t);return {invitation:i,member:q(n.member,void 0,i.organizationId)}}function nt(e,t){let n=q$1(e);return n.member!==null&&y(),{invitation:n.invitation===null?null:M(n.invitation,t),member:null}}function it(e,t){return e===null?null:M(e,t)}function ot(e,t,n){let i=q$1(e);return {member:q(i.member,n,t)}}function q(e,t$1,n){let i=q$1(e),o={id:b(i.id),organizationId:b(i.organizationId),userId:b(i.userId),role:b(i.role),createdAt:t(i.createdAt),...i.user===void 0?{}:{user:ut(i.user)}};return E(o.id,t$1),E(o.organizationId,n),o}function rt(e,t){let n=U(e,i=>{let o=q$1(i);return {organizationId:b(o.organizationId),data:{role:b(o.role),...Z("permission",o.permission===void 0?void 0:Un(o.permission))}}});return W(n.map(i=>i.organizationId),t),n.map(i=>i.data)}function J(e,t$1,n){let i=q$1(e),o=i.updatedAt,a={id:b(i.id),name:G(i.name),organizationId:b(i.organizationId),createdAt:t(i.createdAt),...o===void 0?{}:{updatedAt:t(o)}};return E(a.id,t$1),E(a.organizationId,n),a}function Oe(e){let t=q$1(e);return {message:G(t.message)}}function at(e,t){let n=q$1(e);return {...q(n,void 0,t),user:ut(n.user)}}function Nn(e,t){let n=U(e,i=>at(i));return W(n.map(i=>i.organizationId),t),n}function Un(e){let t=q$1(e),n={};for(let[i,o]of Object.entries(t))(i==="__proto__"||i==="constructor"||i==="prototype"||i.length===0||i.length>me||!Array.isArray(o))&&y(),n[i]=o.map(a=>b(a));return n}function b(e){let t=r(e);return (t.length===0||t.length>me)&&y(),t}function G(e){if(e==null)return "";let t=r(e);return t.length>me&&y(),t}function st(e){return e===null?null:b(e)}function E(e,t){t!==void 0&&e!==t&&y();}function W(e,t){let n=t??e[0];n!==void 0&&e.some(i=>i!==n)&&y();}function ut(e){let t=q$1(e);return {id:b(t.id),name:G(t.name),email:st(t.email),...Z("image",v(t,"image"))}}function U(e,t){return Array.isArray(e)||y(),e.map(n=>t(n))}function Z(e,t){return t===void 0?{}:{[e]:t}}function ct(e,t,n=()=>null){let{post:i,mutation:o}=L(e,t),a=new Set,l=()=>{for(let r of a)try{r();}catch{}},f=new Map,p=(r,u,g,y)=>{if(g)return e.request(r,{query:u,fetchOptions:g,decode:y});let s=`${r}\0${JSON.stringify(u??null)}`,d=f.get(s);if(d)return d;let h=e.request(r,{query:u,decode:y}).finally(()=>{f.delete(s);});return f.set(s,h),h},A=async r=>{let u=await o(r).finally(()=>f.clear());return u.error===null&&l(),u};return {subscribe(r){return a.add(r),()=>a.delete(r)},create:(r,u)=>A(i("/organization/create",r,u,F)),list:r=>p("/organization/list",void 0,r,Ge),get:(r={},u)=>p("/organization/get-full-organization",{organizationId:r.organizationId,organizationSlug:r.organizationSlug,membersLimit:r.membersLimit},u,g=>We(g,r.organizationId,r.organizationSlug)),setActive:(r,u)=>A(i("/organization/set-active",r,u,g=>fe(g,r.organizationId,r.organizationSlug))),createTeam:(r,u)=>A(i("/organization/create-team",r,u,g=>J(g,void 0,r.organizationId))),listTeams:(r={},u)=>p("/organization/list-teams",{organizationId:r.organizationId},u,g=>he(g,r.organizationId)),updateTeam:(r,u)=>A(i("/organization/update-team",r,u,g=>J(g,r.teamId,r.data.organizationId))),removeTeam:(r,u)=>A(i("/organization/remove-team",r,u,Oe)),listUserTeams:r=>p("/organization/list-user-teams",void 0,r,u=>he(u,void 0,true)),listTeamMembers:(r={},u)=>p("/organization/list-team-members",{teamId:r.teamId},u,g=>Xe(g,r.teamId)),addTeamMember:(r,u)=>A(i("/organization/add-team-member",r,u,g=>Ae(g,r.teamId,r.userId))),removeTeamMember:(r,u)=>A(i("/organization/remove-team-member",r,u,Oe)),setActiveTeam:(r,u)=>A(i("/organization/set-active-team",r,u,g=>$e(g,r.teamId))),update:(r,u)=>A(i("/organization/update",r,u,g=>fe(g,r.organizationId))),delete:(r,u)=>A(i("/organization/delete",r,u,g=>F(g,r.organizationId))),listMembers:(r={},u)=>p("/organization/list-members",{organizationId:r.organizationId,organizationSlug:r.organizationSlug,limit:r.limit,offset:r.offset,sortBy:r.sortBy,sortDirection:r.sortDirection,filterField:r.filterField,filterValue:r.filterValue,filterOperator:r.filterOperator},u,g=>Ye(g,r.organizationId)),inviteMember:(r,u)=>A(i("/organization/invite-member",r,u,g=>M(g,void 0,r.organizationId))),listInvitations:(r={},u)=>p("/organization/list-invitations",{organizationId:r.organizationId},u,g=>Qe(g,r.organizationId)),listUserInvitations:r=>p("/organization/list-user-invitations",void 0,r,Ze),getInvitation:(r,u)=>p("/organization/get-invitation",{id:r.id},u,g=>et(g,r.id)),acceptInvitation:(r,u)=>A(i("/organization/accept-invitation",r,u,g=>tt(g,r.invitationId))),rejectInvitation:(r,u)=>A(i("/organization/reject-invitation",r,u,g=>nt(g,r.invitationId))),cancelInvitation:(r,u)=>A(i("/organization/cancel-invitation",r,u,g=>it(g,r.invitationId))),removeMember:(r,u)=>A(i("/organization/remove-member",r,u,g=>ot(g,r.organizationId,r.memberIdOrEmail.includes("@")?void 0:r.memberIdOrEmail))),updateMemberRole:(r,u)=>A(i("/organization/update-member-role",r,u,g=>q(g,r.memberId,r.organizationId))),leave:(r,u)=>A(i("/organization/leave",r,u,g=>q(g,void 0,r.organizationId))),listRoles:(r={},u)=>p("/organization/list-roles",{organizationId:r.organizationId},u,g=>rt(g,r.organizationId)),has:r=>E$1(n(),r),hasPermission:r=>B(n(),r.permission)}}var dt=4096,Mn=4096,_n=100,Ln=256,Fn=16,qn=64,Vn=12;function be(e){let t=q$1(e);return t.twoFactorRedirect===true?((t.user!==void 0||t.redirect!==void 0||t.url!==void 0)&&y(),{twoFactorRedirect:true,...t.twoFactorMethods===void 0?{}:{twoFactorMethods:vt(t.twoFactorMethods,Fn,qn)}}):(t.twoFactorRedirect!==void 0&&y(),{redirect:s(t.redirect),...Jn(t,"url"),user:w(t.user)})}function lt(e){let t=q$1(e);return {user:w(t.user)}}function pt(e){let t=q$1(e);return {sessionCreated:s(t.sessionCreated),user:w(t.user)}}function gt(e,t){let n=q$1(e),i=s(n.redirect);n.user===null&&y();let o=n.user!==void 0&&n.user!==null,a=n.url!==void 0&&n.url!==null;return i?((o||!a)&&y(),{redirect:true,url:ye(n.url,t)}):(o===a&&y(),o?{redirect:false,user:w(n.user)}:{redirect:false,url:ye(n.url,t)})}function mt(e,t){let n=q$1(e);return (n.redirect!==true||n.user!==void 0)&&y(),{redirect:true,url:ye(n.url,t)}}function ft(e){return {status:s(q$1(e).status)}}function ht(e){return {success:s(q$1(e).success)}}function At(e){return q$1(e).status!=="pending"&&y(),{status:"pending"}}function Ot(e){let t=q$1(e);if(t.kind==="authowl_turnstile")return {kind:"authowl_turnstile"};t.kind!=="akedly_shield_v1_2"&&y();let n=q$1(t.turnstile),i=n.siteKey===null?null:r(n.siteKey);return {kind:"akedly_shield_v1_2",connectionId:r(t.connectionId),challenge:r(t.challenge),difficulty:Hn(t.difficulty),challengeToken:r(t.challengeToken),challengeRequired:s(t.challengeRequired),turnstile:{required:s(n.required),siteKey:i}}}function Hn(e){return (!Number.isSafeInteger(e)||Number(e)<0||Number(e)>Vn)&&y(),Number(e)}function yt(e){let t=q$1(e);return (t.status!==true||t.sessionCreated!==true)&&y(),{status:true,sessionCreated:true,user:Bn(t.user)}}function we(e){return {status:s(q$1(e).status)}}function bt(e){return {status:s(q$1(e).status)}}function wt(e){let t=q$1(e);return {status:s(t.status),user:w(t.user)}}function kt(e){return {success:s(q$1(e).success)}}function Rt(e){let t=q$1(e);return {totpURI:jn(t.totpURI),backupCodes:Pt(t.backupCodes)}}function St(e){return {status:s(q$1(e).status)}}function ee(e){return q$1(e).status!==true&&y(),{status:true}}function It(e){return {status:s(q$1(e).status)}}function Tt(e){let t=q$1(e);return t.status!==void 0&&t.status!==true&&y(),{backupCodes:Pt(t.backupCodes)}}function Bn(e){let t$1=q$1(e);return {id:V(t$1.id,512),...Gn(t$1,"name",1024),phoneNumber:V(t$1.phoneNumber,64),phoneNumberVerified:s(t$1.phoneNumberVerified),...t$1.createdAt===void 0?{}:{createdAt:t(t$1.createdAt)},...t$1.updatedAt===void 0?{}:{updatedAt:t(t$1.updatedAt)}}}function ye(e,t){let n=V(e,dt);/[\u0000-\u0020\u007f]/u.test(n)&&y();let i;try{i=new URL(n);}catch{return y()}return (i.username||i.password)&&y(),i.protocol==="https:"||t&&i.protocol==="http:"&&Kn(i.hostname)?i.href:y()}function Kn(e){let t=e.toLowerCase();return t==="localhost"||t==="127.0.0.1"||t==="[::1]"}function jn(e){let t=V(e,Mn),n;try{n=new URL(t);}catch{return y()}let i=n.searchParams.get("secret");return (n.protocol!=="otpauth:"||n.hostname.toLowerCase()!=="totp"||n.username||n.password||n.hash||i===null||i.length===0||i.length>512||/\s/u.test(i))&&y(),t}function Pt(e){return vt(e,_n,Ln)}function vt(e,t,n){(!Array.isArray(e)||e.length===0||e.length>t)&&y();let i=e.map(o=>V(o,n));return i.some(o=>o.trim().length===0)&&y(),new Set(i).size!==i.length&&y(),i}function V(e,t){let n=r(e);return (n.length===0||n.length>t)&&y(),n}function Jn(e,t){let n=e[t];return n==null?{}:{[t]:V(n,dt)}}function Gn(e,t,n){let i=v(e,t);return i===void 0?{}:(i!==null&&i.length>n&&y(),{[t]:i})}var zt=new Set([1564,8206,8207,8234,8235,8236,8237,8238,8294,8295,8296,8297]),te=new Set([9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279]);function ne(e){if(e===void 0)return {valid:true,value:void 0};for(let n of e){let i=n.codePointAt(0);if(i===void 0||Dt(n,i)||Ct(i)||zt.has(i))return {valid:false}}let t=Wn(e);return ke(t)?{valid:true,value:t}:{valid:false}}function ke(e){let t=0,n,i;for(let o of e){if(t+=1,t>256)return false;let a=o.codePointAt(0);if(a===void 0||Dt(o,a)||Ct(a)||zt.has(a))return false;n??=a,i=a;}return t>0&&n!==void 0&&i!==void 0&&!te.has(n)&&!te.has(i)}function ie(){return {data:null,error:{status:400,statusText:"BAD_REQUEST",code:"INVALID_PASSKEY_NAME",message:"Passkey names must contain 1 to 256 safe Unicode characters."}}}function Wn(e){let t=0,n=e.length;for(;t<n;){let i=e.codePointAt(t);if(i===void 0||!te.has(i))break;t+=i>65535?2:1;}for(;n>t;){let i=e.codePointAt(n-1);if(i===void 0)break;let a=i>=56320&&i<=57343?n-2:n-1,l=e.codePointAt(a);if(l===void 0||!te.has(l))break;n=a;}return e.slice(t,n)}function Ct(e){return e>=0&&e<=31||e>=127&&e<=159}function Dt(e,t){return e.length===1&&t>=55296&&t<=57343}var Nt=12,Ut=5e3,Xn=8,$n=1e3,Yn=16,xt=512,Mt=100,_t=8192,Qn=32768,Re=1024,Et=256,Ie=64,Zn=6e5,ei=/^[A-Za-z0-9_-]+$/u,ti=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u,ni=/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/u,ii=/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$/u,oi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,Lt=new Set(["discouraged","preferred","required"]),ri=new Set(["singleDevice","multiDevice"]),Ft=new Set(["ble","cable","hybrid","internal","nfc","smart-card","usb"]),qt=new Set(["hybrid","security-key","client-device"]),ai=new Set(["none","indirect","direct","enterprise"]),si=new Set(["fido-u2f","packed","android-safetynet","android-key","tpm","apple","none"]),ui=new Set(["platform","cross-platform"]),ci=new Set(["discouraged","preferred","required"]),di=new Set([-8,-7,-257]);function Vt(e){let t=z(e,Nt,Ut);return {challenge:Yt(t.challenge),...T("timeout",Xt(t.timeout)),...T("rpId",Qt(t.rpId)),...T("allowCredentials",Wt(t.allowCredentials)),...T("userVerification",X(t.userVerification,Lt)),...T("hints",oe(t.hints,qt)),...T("extensions",$t(t.extensions))}}function Ht(e){let t=z(e,Nt,Ut);return {challenge:Yt(t.challenge),rp:li(t.rp),user:pi(t.user),pubKeyCredParams:gi(t.pubKeyCredParams),...T("timeout",Xt(t.timeout)),...T("excludeCredentials",Wt(t.excludeCredentials)),...T("authenticatorSelection",mi(t.authenticatorSelection)),...T("attestation",X(t.attestation,ai)),...T("attestationFormats",oe(t.attestationFormats,si)),...T("hints",oe(t.hints,qt)),...T("extensions",$t(t.extensions))}}function Bt(e){let t=q$1(e),n=x(t.session),i=w(t.user);return n.userId!==i.id&&y(),{session:n,user:i}}function Te(e){let t$1=q$1(e),n=t$1.counter;(!Number.isSafeInteger(n)||n<0)&&y();let i=Pe(t$1.deviceType,ri),o=s(t$1.backedUp);return o&&i!=="multiDevice"&&y(),{id:H(t$1.id,Et),...Ai(t$1),publicKey:fi(t$1.publicKey,Qn),userId:H(t$1.userId,Et),credentialID:ae(t$1.credentialID,_t),counter:n,deviceType:i,backedUp:o,...Oi(t$1),createdAt:t(t$1.createdAt),...yi(t$1)}}function Kt(e,t,n){let i=Te(e);return (i.credentialID!==t||(n===void 0?i.name!==void 0&&i.name!==null:i.name!==n))&&y(),i}function jt(e){(!Array.isArray(e)||e.length>Mt)&&y();let t=e.map(Te);return re(t.map(n=>n.id)),re(t.map(n=>n.credentialID)),t.length>1&&t.some(n=>n.userId!==t[0]?.userId)&&y(),t}function Jt(e,t,n){let i=q$1(e),o=Te(i.passkey);return (o.id!==t||o.name!==n)&&y(),{passkey:o}}function Gt(e){return q$1(e).status!==true&&y(),{status:true}}function li(e){let t=q$1(e);return {name:Se(t.name,Re),...T("id",Qt(t.id))}}function pi(e){let t=q$1(e);return {id:ae(t.id,128,1,64),name:Se(t.name,Re),displayName:Se(t.displayName,Re)}}function gi(e){(!Array.isArray(e)||e.length===0||e.length>Ie)&&y();let t=e.map(n=>{let i=q$1(n);return (i.type!=="public-key"||!Number.isSafeInteger(i.alg)||!di.has(i.alg))&&y(),{type:"public-key",alg:i.alg}});return bi(t.map(n=>n.alg)),t}function Wt(e){if(e===void 0)return;(!Array.isArray(e)||e.length>Mt)&&y();let t=e.map(n=>{let i=q$1(n);return i.type!=="public-key"&&y(),{type:"public-key",id:ae(i.id,_t),...T("transports",oe(i.transports,Ft))}});return re(t.map(n=>n.id)),t}function mi(e){if(e===void 0)return;let t=q$1(e);t.requireResidentKey!==void 0&&typeof t.requireResidentKey!="boolean"&&y();let n=X(t.residentKey,ci);return t.requireResidentKey!==void 0&&n!==void 0&&t.requireResidentKey!==(n==="required")&&y(),{...T("authenticatorAttachment",X(t.authenticatorAttachment,ui)),...T("residentKey",n),...T("requireResidentKey",t.requireResidentKey),...T("userVerification",X(t.userVerification,Lt))}}function Xt(e){return e!==void 0&&(typeof e!="number"||!Number.isFinite(e)||e<0||e>Zn)&&y(),e}function $t(e){return e===void 0?void 0:z(e,Xn,$n)}function oe(e,t){if(e===void 0)return;(!Array.isArray(e)||e.length>Ie)&&y();let n=e.map(i=>Pe(i,t));return re(n),n}function X(e,t){if(e!==void 0)return Pe(e,t)}function Yt(e){return ae(e,Math.ceil(xt*4/3),Yn,xt)}function ae(e,t,n=1,i=Number.POSITIVE_INFINITY){let o=H(e,t),a=o.length%4,l=hi(o.at(-1)??""),f=Math.floor(o.length*3/4);return (!ei.test(o)||a===1||a===2&&(l&15)!==0||a===3&&(l&3)!==0||f<n||f>i)&&y(),o}function H(e,t){let n=r(e);return (n.length===0||n.length>t)&&y(),n}function Se(e,t){let n=H(e,t);return ni.test(n)&&y(),n}function Qt(e){if(e===void 0)return;let t=H(e,253);return t!=="localhost"&&(t.endsWith(".")||!t.includes(".")||t.split(".").some(n=>!ii.test(n)))&&y(),t}function fi(e,t){let n=H(e,t),i=n.endsWith("=="),o=!i&&n.endsWith("="),a=n.at(i?-3:o?-2:-1)??"",l=Zt(a);return (n.length%4!==0||!ti.test(n)||i&&(l&15)!==0||o&&(l&3)!==0)&&y(),n}function hi(e){return Zt(e,true)}function Zt(e,t=false){return (t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").indexOf(e)}function Ai(e){let t=v(e,"name");return t===void 0?{}:(t!==null&&!ke(t)&&y(),{name:t})}function Oi(e){let t=v(e,"transports");if(t==null||t==="")return t===void 0?{}:{transports:t};let n=t.split(",");return (n.length>Ie||n.some(i=>!Ft.has(i))||new Set(n).size!==n.length)&&y(),{transports:t}}function yi(e){let t=v(e,"aaguid");return t==null?t===void 0?{}:{aaguid:null}:(oi.test(t)||y(),{aaguid:t})}function Pe(e,t){let n=r(e);return t.has(n)||y(),n}function T(e,t){return t===void 0?{}:{[e]:t}}function re(e){new Set(e).size!==e.length&&y();}function bi(e){new Set(e).size!==e.length&&y();}function wi(e,t){if(!t)return e;let n=t.catch(()=>{});return n.then(()=>{n=null;}),{async request(i,o){return n&&await n,e.request(i,o)}}}var en=new Map;function ki(e,t,n){let i=en.get(n);if(!i){let o=new URLSearchParams(window.location.hash.slice(1)).get("authowl_code");if(!o)return;i=import('./session-handoff-6FBH3GFJ.js').then(a=>a.completeCrossSiteSignIn(e,t,o)),en.set(n,i);}return i}function tn(e){return !a()||e.idToken||e.disableRedirect?"legacy":"first-party"}function Ri(e,t=()=>{},n=Ti){let i=pe(e),o=e.session.tokens,a$1=a()?ki(i,o,e.decoded.projectId):void 0,l=wi(i,a$1),f=Ve({http:l,probe:pe({...e,fetch:e.session.probe}),tokens:o,channelName:`authowl:${e.decoded.projectId}`}),p=n(l,f.notifyMutation),A=()=>{f.notifyMutation(),t();},{post:r,mutation:u}=L(l,A),g=e.decoded.env==="test",y=s=>{o.beginSession({remember:s?.rememberMe!==false});};return {sessionStore:f.store,getSession:f.getSession,account:Je(l,A),organization:ct(l,A,()=>f.store.getSnapshot().data?.session.membership??null),signIn:{email:(s,d)=>(y(s),u(r("/sign-in/email",s,d,be),h=>!("twoFactorRedirect"in h))),username:(s,d)=>(y(s),u(r("/sign-in/username",s,d,be),h=>!("twoFactorRedirect"in h))),social:async(s,d)=>{if(y(),tn(s)==="first-party"){let{beginCrossSiteSignIn:R}=await import('./session-handoff-6FBH3GFJ.js'),x=await R(e,{kind:"social",provider:s.provider,callbackURL:s.callbackURL,errorCallbackURL:s.errorCallbackURL,newUserCallbackURL:s.newUserCallbackURL,scopes:s.scopes,loginHint:s.loginHint,requestSignUp:s.requestSignUp});if(x)return window.location.assign(x),{data:{redirect:true,url:x},error:null}}let h=await u(r("/sign-in/social",s,d,R=>gt(R,g)),R=>"user"in R);return h.error!==null||h.data===null||"url"in h.data&&h.data.redirect&&!s.disableRedirect&&typeof window<"u"&&window.location.assign(h.data.url),h},sso:async(s,d)=>{if(tn(s)==="first-party"){let{beginCrossSiteSignIn:R}=await import('./session-handoff-6FBH3GFJ.js'),x=await R(e,{kind:"sso",email:s.email,providerId:s.providerId,domain:s.domain,organizationSlug:s.organizationSlug,callbackURL:s.callbackURL,errorCallbackURL:s.errorCallbackURL,newUserCallbackURL:s.newUserCallbackURL});if(x)return window.location.assign(x),{data:{url:x,redirect:true},error:null}}let h=await r("/sign-in/sso",s,d,R=>mt(R,g));return h.error!==null||h.data===null||typeof window<"u"&&window.location.assign(h.data.url),h},magicLink:(s,d)=>r("/sign-in/magic-link",s,d,ft),emailOtp:(s,d)=>(y(),u(r("/sign-in/email-otp",s,d,lt))),passkey:(s,d)=>(y(),p.signIn(s,d))},signUp:{email:(s,d)=>(y(),u(r("/sign-up/email",s,d,pt),h=>h.sessionCreated))},emailOtp:{sendVerificationOtp:(s,d)=>r("/email-otp/send-verification-otp",s,d,ht),verifyEmail:(s,d)=>(y(),u(r("/email-otp/verify-email",s,d,wt)))},phoneOtp:{prepare:s=>r("/phone-otp/challenge",{},s,Ot),start:(s,d)=>r("/phone-otp/start",{...s,idempotencyKey:s.idempotencyKey??qe()},d,At),verify:(s,d)=>(y(),u(r("/phone-otp/verify",s,d,yt)))},requestPasswordReset:(s,d)=>r("/request-password-reset",s,d,we),resetPassword:(s,d)=>r("/reset-password",s,d,we),sendVerificationEmail:(s,d)=>r("/send-verification-email",s,d,bt),passkey:{addPasskey:(s,d)=>p.add(s,d),listUserPasskeys:()=>l.request("/passkey/list-user-passkeys",{decode:jt}),updatePasskey:async(s,d)=>{let h=ne(s.name);if(!h.valid||h.value===void 0)return ie();let R=h.value;return r("/passkey/update-passkey",{...s,name:R},d,x=>Jt(x,s.id,R))},deletePasskey:(s,d)=>r("/passkey/delete-passkey",s,d,Gt)},twoFactor:{enable:(s,d)=>r("/two-factor/enable",s,d,Rt),disable:(s,d)=>u(r("/two-factor/disable",s,d,St),h=>h.status),verifyTotp:(s,d)=>u(r("/two-factor/verify-totp",s,d,ee)),verifyBackupCode:(s,d)=>u(r("/two-factor/verify-backup-code",s,d,ee)),sendOtp:(s={},d)=>r("/two-factor/send-otp",s,d,It),verifyOtp:(s,d)=>u(r("/two-factor/verify-otp",s,d,ee)),generateBackupCodes:(s,d)=>r("/two-factor/generate-backup-codes",s,d,Tt)},signOut:s=>u(l.request("/sign-out",{method:"POST",body:{},fetchOptions:s,decode:kt}).then(d=>(o.endSession(),d)),d=>d.success)}}function bo(e,t=()=>{},n){let i=Ri(e,t,n);return n?{...i,signIn:{email:i.signIn.email,username:i.signIn.username,social:nn(i),magicLink:i.signIn.magicLink,emailOtp:i.signIn.emailOtp,passkey:i.signIn.passkey},passkey:{listUserPasskeys:i.passkey.listUserPasskeys,updatePasskey:i.passkey.updatePasskey,deletePasskey:i.passkey.deletePasskey,addPasskey:i.passkey.addPasskey}}:{...i,signIn:{email:i.signIn.email,username:i.signIn.username,social:nn(i),magicLink:i.signIn.magicLink,emailOtp:i.signIn.emailOtp},passkey:{listUserPasskeys:i.passkey.listUserPasskeys,updatePasskey:i.passkey.updatePasskey,deletePasskey:i.passkey.deletePasskey}}}function nn(e){return async(t,n)=>{if(!t?.idToken||typeof t.idToken.token!="string"||t.idToken.token==="")return Si();let i=await e.signIn.social({...t,disableRedirect:true},n);return i.data!==null&&"url"in i.data?Ii():i}}function Si(){return Promise.resolve({data:null,error:{status:400,statusText:"BAD_REQUEST",code:"NATIVE_SOCIAL_ID_TOKEN_REQUIRED",message:"Native social sign-in requires a provider ID token."}})}function Ii(){return Promise.resolve({data:null,error:{status:502,statusText:"BAD_GATEWAY",code:"INVALID_NATIVE_SOCIAL_RESPONSE",message:"The server returned a redirect for native ID-token sign-in."}})}function Ti(){return {signIn:()=>on(),add:()=>on()}}function on(){return Promise.resolve({data:null,error:{status:400,statusText:"BAD_REQUEST",code:"PASSKEY_BROWSER_REQUIRED",message:"This passkey ceremony requires a browser with WebAuthn."}})}function So(e,t,n){let i=new Map;return {async signIn(o={},a){let l=await e.request("/passkey/generate-authenticate-options");if(!l.data)return sn(l.error);let f;try{f=Vt(l.data);}catch{return rn()}let p;try{p=await n.authenticate({optionsJSON:f,useBrowserAutofill:o.autoFill});}catch(y){return un(n,y,"AUTH_CANCELLED","Passkey authentication was cancelled.")}if(!Pi(p))return an();let{clientExtensionResults:A,...r}=p,u=i.get(p.id);if(u)return u;let g=(async()=>{let y=await e.request("/passkey/verify-authentication",{method:"POST",body:{response:r},fetchOptions:a,decode:Bt});return y.data&&t(),y})();i.set(p.id,g);try{return await g}finally{i.get(p.id)===g&&i.delete(p.id);}},async add(o={},a){let l=ne(o.name);if(!l.valid)return ie();let f=await e.request("/passkey/generate-register-options",{query:{name:l.value,authenticatorAttachment:o.authenticatorAttachment}});if(!f.data)return sn(f.error);let p;try{p=Ht(f.data);}catch{return rn()}let A;try{A=await n.register({optionsJSON:p});}catch(y){return un(n,y,"REGISTRATION_CANCELLED","Passkey registration was cancelled.")}if(!vi(A))return an();let{clientExtensionResults:r,...u}=A,g=await e.request("/passkey/verify-registration",{method:"POST",body:{response:u,name:l.value},fetchOptions:a,decode:y=>Kt(y,A.id,l.value)});return g.data&&t(),g}}}function rn(){return {data:null,error:{status:502,statusText:"BAD_GATEWAY",code:"INVALID_WEBAUTHN_OPTIONS",message:"The server returned invalid WebAuthn options."}}}function an(){return {data:null,error:{status:400,statusText:"BAD_REQUEST",code:"INVALID_WEBAUTHN_RESPONSE",message:"The platform returned an invalid passkey response."}}}function dn(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.rawId=="string"&&t.rawId.length>0&&t.type==="public-key"&&!!t.response&&typeof t.response=="object"}function Pi(e){if(!dn(e))return false;let t=e.response;return typeof t.clientDataJSON=="string"&&typeof t.authenticatorData=="string"&&typeof t.signature=="string"&&(t.userHandle===void 0||typeof t.userHandle=="string")}function vi(e){if(!dn(e))return false;let t=e.response;return typeof t.clientDataJSON=="string"&&typeof t.attestationObject=="string"}function sn(e){return {data:null,error:e??{status:502,statusText:"BAD_GATEWAY",code:"INVALID_WEBAUTHN_OPTIONS",message:"The server returned no WebAuthn options."}}}function un(e,t,n,i){let o=Ci(t,"page does not have focus"),a=e.errorCode?.(t),l=a!==void 0?a==="ERROR_CEREMONY_ABORTED":cn(t)==="AbortError",f=n!=="AUTH_CANCELLED",p=zi(a,cn(t),f);return {data:null,error:{status:400,statusText:"BAD_REQUEST",code:o?"PASSKEY_PAGE_NOT_FOCUSED":l?n:a??"PASSKEY_BROWSER_ERROR",message:o?"Keep this page focused while completing the passkey prompt.":l?i:p}}}function zi(e,t,n){switch(e){case "ERROR_INVALID_DOMAIN":case "ERROR_INVALID_RP_ID":return "Passkeys are not set up for this site\u2019s domain.";case "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED":return "This device already has a passkey for this account.";case "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEY_ALGS":case "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT":case "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT":return "This device cannot create a passkey for this site.";}return t==="NotAllowedError"?n?"No passkey was created. The prompt was dismissed or timed out.":"No passkey was used. This device may not have one saved for this site yet, or the prompt was dismissed.":t==="SecurityError"?"Passkeys are not set up for this site\u2019s domain.":n?"Passkey registration did not complete.":"Passkey sign-in did not complete."}function cn(e){return e&&typeof e=="object"&&"name"in e&&typeof e.name=="string"?e.name:void 0}function Ci(e,t){let n=t.toLowerCase(),i=new Set,o=e;for(;o&&typeof o=="object"&&!i.has(o);){if(i.add(o),"message"in o&&typeof o.message=="string"&&o.message.toLowerCase().includes(n))return true;o="cause"in o?o.cause:void 0;}return false}async function vo(e){let n=`${new URL(e.apiUrl).origin}/api/projects/${e.decoded.projectId}/public-config`;return _e(await Q(e,n,{init:{method:"GET",credentials:"omit"},maxResponseBytes:256*1024,decode:i=>Di(i,e)}),"public-config")}function Di(e,t){let n=z(e),i=n.environmentId,o=n.environmentType,a=`${new URL(t.apiUrl).origin}/api/projects/${t.decoded.projectId}/auth`;if(typeof n.applicationId!="string"||!xi(n.applicationId)||i!==t.decoded.projectId||o!=="development"&&o!=="production"||n.authBaseUrl!==a)throw D();let l=P(n.branding),f=P(n.legal);if(!ve(n.enabledMethods,64)||!ve(n.socialProviders,64)||!pn(l,["appName","logoUrl","primaryColor"])||l.showAppName!==void 0&&typeof l.showAppName!="boolean"||l.alignment!==void 0&&l.alignment!=="left"&&l.alignment!=="center"&&l.alignment!=="right"||l.theme!==void 0&&l.theme!=="light"&&l.theme!=="dark"&&l.theme!=="system"||!pn(f,["termsUrl","privacyUrl"])||!Number.isSafeInteger(f.version)||f.version<0||typeof f.required!="boolean")throw D();if(n.socialProviderClientIds!==void 0){let p=P(n.socialProviderClientIds);if(Object.keys(p).length>64||Object.values(p).some(A=>typeof A!="string"||A.length>2048))throw D()}if(!_(n,["requireEmailVerification","twoFactor","mfaRequired","accountDeletion","organizations","sso","badge"])||!ln(n.turnstileSiteKey)||!ln(n.authTurnstileSiteKey)||typeof n.locale!="string"||n.locale.length===0||n.locale.length>64||!Number.isSafeInteger(n.configVersion)||n.configVersion<0)throw D();if(n.jwtIssuer!==null){let p=P(n.jwtIssuer);if(p.issuer!==a||p.jwksUrl!==`${a}/jwks`||p.aud!==t.decoded.projectId)throw D()}if(n.signUp!==void 0){let p=P(n.signUp).mode;if(typeof p!="string"||!["open","restricted","allowlist","waitlist"].includes(p))throw D()}if(n.authentication!==void 0&&Ei(n.authentication),n.emailVerification!==void 0){let p=P(n.emailVerification);if(!_(p,["required"])||p.method!=="link"&&p.method!=="code")throw D()}if(n.userModel!==void 0&&!_(P(n.userModel),["requireEmail","firstLastName","emailChange","accountDeletion"]))throw D();if(n.mfa!==void 0){let p=P(n.mfa);if(!_(p,["totp","required","backupCodes"])||(p.required===true||p.backupCodes===true)&&p.totp!==true)throw D()}return n}function xi(e){return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function D(){return new TypeError("public-config returned an invalid response")}function P(e){if(!e||typeof e!="object"||Array.isArray(e))throw D();return e}function ln(e){return e===null||typeof e=="string"&&e.length<=4096}function Ei(e){let t=P(e),n=P(t.email),i=P(t.password),o=i.minLength!==void 0||i.maxLength!==void 0;if(!_(n,["signUp"])||!ve(n.signIn,3)||n.signIn.some(a=>a!=="password"&&a!=="magic_link"&&a!=="email_otp")||!_(P(t.phone),["signUp","signIn"])||!_(i,["signUp","add"])||o&&(!Number.isSafeInteger(i.minLength)||!Number.isSafeInteger(i.maxLength)||i.minLength<1||i.maxLength>4096||i.minLength>i.maxLength)||!_(P(t.passkey),["signIn","add"])||!Ni(P(t.passkey).relyingPartyId)||!_(P(t.username),["collectOnSignUp","signIn"]))throw D()}function Ni(e){return e==null||typeof e=="string"}function _(e,t){return t.every(n=>typeof e[n]=="boolean")}function pn(e,t){return t.every(n=>e[n]===void 0||typeof e[n]=="string"&&e[n].length<=4096)}function ve(e,t){return Array.isArray(e)&&e.length<=t&&e.every(n=>typeof n=="string"&&n.length<=128)&&new Set(e).size===e.length}export{Ui as a,ue as b,Q as c,_e as d,fn as e,pe as f,qe as g,Ri as h,bo as i,So as j,vo as k};
|
|
@@ -489,10 +489,59 @@ interface OrganizationTeam {
|
|
|
489
489
|
createdAt: Date;
|
|
490
490
|
updatedAt?: Date;
|
|
491
491
|
}
|
|
492
|
+
/** A user's membership in a team. Teams group organization members; they grant no authority. */
|
|
493
|
+
interface OrganizationTeamMember {
|
|
494
|
+
id: string;
|
|
495
|
+
teamId: string;
|
|
496
|
+
userId: string;
|
|
497
|
+
createdAt: Date;
|
|
498
|
+
}
|
|
499
|
+
interface CreateOrganizationTeamOptions {
|
|
500
|
+
/** The team name shown to organization members. */
|
|
501
|
+
name: string;
|
|
502
|
+
/** Defaults to the caller's active organization. */
|
|
503
|
+
organizationId?: string;
|
|
504
|
+
}
|
|
492
505
|
interface ListOrganizationTeamsOptions {
|
|
493
506
|
/** Defaults to the caller's active organization. */
|
|
494
507
|
organizationId?: string;
|
|
495
508
|
}
|
|
509
|
+
interface UpdateOrganizationTeamOptions {
|
|
510
|
+
teamId: string;
|
|
511
|
+
data: {
|
|
512
|
+
/** The new team name. */
|
|
513
|
+
name?: string;
|
|
514
|
+
/** Defaults to the caller's active organization. */
|
|
515
|
+
organizationId?: string;
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
interface RemoveOrganizationTeamOptions {
|
|
519
|
+
teamId: string;
|
|
520
|
+
/** Defaults to the caller's active organization. */
|
|
521
|
+
organizationId?: string;
|
|
522
|
+
}
|
|
523
|
+
interface RemoveOrganizationTeamData {
|
|
524
|
+
message: string;
|
|
525
|
+
}
|
|
526
|
+
interface ListOrganizationTeamMembersOptions {
|
|
527
|
+
/** Defaults to the caller's active team. */
|
|
528
|
+
teamId?: string;
|
|
529
|
+
}
|
|
530
|
+
interface AddOrganizationTeamMemberOptions {
|
|
531
|
+
teamId: string;
|
|
532
|
+
userId: string;
|
|
533
|
+
/** Defaults to the caller's active organization. */
|
|
534
|
+
organizationId?: string;
|
|
535
|
+
}
|
|
536
|
+
interface RemoveOrganizationTeamMemberOptions {
|
|
537
|
+
teamId: string;
|
|
538
|
+
userId: string;
|
|
539
|
+
/** Defaults to the caller's active organization. */
|
|
540
|
+
organizationId?: string;
|
|
541
|
+
}
|
|
542
|
+
interface RemoveOrganizationTeamMemberData {
|
|
543
|
+
message: string;
|
|
544
|
+
}
|
|
496
545
|
interface SetActiveTeamOptions {
|
|
497
546
|
/** The team to make active, or null to clear it. Must be a team the caller is on. */
|
|
498
547
|
teamId: string | null;
|
|
@@ -577,15 +626,31 @@ interface OrganizationRoleSummary {
|
|
|
577
626
|
permission?: unknown;
|
|
578
627
|
}
|
|
579
628
|
interface OrganizationClient {
|
|
629
|
+
/** @internal Subscribe to successful organization mutations. Used by framework bindings. */
|
|
630
|
+
subscribe(listener: () => void): () => void;
|
|
580
631
|
create(params: CreateOrganizationOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<Organization>>;
|
|
581
632
|
list(fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<Organization[]>>;
|
|
582
633
|
get(params?: GetOrganizationOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationDetails | null>>;
|
|
583
634
|
setActive(params: SetActiveOrganizationOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<Organization | null>>;
|
|
635
|
+
/** Create a named grouping of members inside an organization. A team grants no authority. */
|
|
636
|
+
createTeam(params: CreateOrganizationTeamOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam>>;
|
|
584
637
|
/**
|
|
585
638
|
* The teams of an organization, for resolving the team ids carried in the
|
|
586
639
|
* membership claim to names. Requires membership of that organization.
|
|
587
640
|
*/
|
|
588
641
|
listTeams(params?: ListOrganizationTeamsOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam[]>>;
|
|
642
|
+
/** Rename a team. Team membership remains grouping-only and grants no authority. */
|
|
643
|
+
updateTeam(params: UpdateOrganizationTeamOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam>>;
|
|
644
|
+
/** Remove a team and its grouping memberships from an organization. */
|
|
645
|
+
removeTeam(params: RemoveOrganizationTeamOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<RemoveOrganizationTeamData>>;
|
|
646
|
+
/** List every team the signed-in user belongs to across their organizations. */
|
|
647
|
+
listUserTeams(fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam[]>>;
|
|
648
|
+
/** List the grouping memberships for a team, defaulting to the active team. */
|
|
649
|
+
listTeamMembers(params?: ListOrganizationTeamMembersOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeamMember[]>>;
|
|
650
|
+
/** Add an existing organization member to a team. This grants no authority. */
|
|
651
|
+
addTeamMember(params: AddOrganizationTeamMemberOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeamMember>>;
|
|
652
|
+
/** Remove an organization member from a team without changing their organization role. */
|
|
653
|
+
removeTeamMember(params: RemoveOrganizationTeamMemberOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<RemoveOrganizationTeamMemberData>>;
|
|
589
654
|
/**
|
|
590
655
|
* Select the caller's active team, which surfaces as `activeTeamId` on the session
|
|
591
656
|
* and `team_id` in the project token. Only a team the caller is on can be made
|
|
@@ -769,6 +834,11 @@ interface SessionState {
|
|
|
769
834
|
interface SessionStore {
|
|
770
835
|
subscribe(listener: () => void): () => void;
|
|
771
836
|
getSnapshot(): SessionState;
|
|
837
|
+
/**
|
|
838
|
+
* Re-read the session from the server, bypassing the cookie cache, and publish
|
|
839
|
+
* the resulting snapshot to subscribers. Concurrent calls share one request.
|
|
840
|
+
*/
|
|
841
|
+
refresh(): Promise<void>;
|
|
772
842
|
}
|
|
773
843
|
/** Standard `{ data, error }` envelope returned by the client's auth actions. */
|
|
774
844
|
interface AuthActionResult<T = Record<string, unknown>> {
|
|
@@ -1342,4 +1412,4 @@ interface AuthOwlClient {
|
|
|
1342
1412
|
*/
|
|
1343
1413
|
declare function createAuthOwlClient(config: ResolvedAuthConfig): AuthOwlClient;
|
|
1344
1414
|
|
|
1345
|
-
export { type
|
|
1415
|
+
export { type LinkSocialOptions as $, type AkedlyShieldStartProof as A, type DeletePasskeyData as B, type ChangeEmailOptions as C, type DeleteAccountData as D, type DeletePasskeyOptions as E, type DisableTwoFactorOptions as F, type EmailAuthData as G, type EmailOtpAuthData as H, type EmailOtpSignInOptions as I, type EmailOtpType as J, type EmailSignInOptions as K, type EmailSignUpData as L, type EmailSignUpOptions as M, type EnableTwoFactorOptions as N, type EnvironmentType as O, type PhoneOtpChallengeData as P, type GenerateBackupCodesOptions as Q, type GetOrganizationInvitationOptions as R, type GetOrganizationOptions as S, type GetToken as T, type GetTokenOptions as U, type InviteOrganizationMemberOptions as V, type JsonObject as W, type JsonPrimitive as X, type JsonValue as Y, type LeaveOrganizationOptions as Z, type LinkSocialData as _, AUTH_CHALLENGE_HEADER as a, type UnlinkSocialOptions as a$, type ListOrganizationInvitationsOptions as a0, type ListOrganizationMembersOptions as a1, type ListOrganizationRolesOptions as a2, type ListOrganizationTeamMembersOptions as a3, type ListOrganizationTeamsOptions as a4, type MagicLinkData as a5, type MagicLinkSignInOptions as a6, type Organization as a7, type OrganizationClient as a8, type OrganizationDetails as a9, type RemoveOrganizationMemberOptions as aA, type RemoveOrganizationTeamData as aB, type RemoveOrganizationTeamMemberData as aC, type RemoveOrganizationTeamMemberOptions as aD, type RemoveOrganizationTeamOptions as aE, type RequestPasswordResetOptions as aF, type ResetPasswordOptions as aG, type RevokeSessionOptions as aH, type SendOtpData as aI, type SendTwoFactorOtpData as aJ, type SendTwoFactorOtpOptions as aK, type SendVerificationOtpOptions as aL, type SessionState as aM, type SessionStore as aN, type SetActiveOrganizationOptions as aO, type SetActiveTeamOptions as aP, type SignOutData as aQ, type SocialAccount as aR, type SocialAuthData as aS, type SocialIdTokenOptions as aT, type SocialSignInOptions as aU, type TokenClient as aV, type TwoFactorBackupCodesData as aW, type TwoFactorEnableData as aX, type TwoFactorRedirectData as aY, type TwoFactorStatusData as aZ, type TwoFactorVerifyData as a_, type OrganizationFilterOperator as aa, type OrganizationInvitation as ab, type OrganizationInvitationActionOptions as ac, type OrganizationInvitationDetails as ad, type OrganizationInvitationStatus as ae, type OrganizationMember as af, type OrganizationMemberUser as ag, type OrganizationMemberWithUser as ah, type OrganizationMembersData as ai, type OrganizationRoleSummary as aj, type OrganizationSelector as ak, type OrganizationTeam as al, type OrganizationTeamMember as am, type OrganizationUserInvitation as an, type PasskeyAuthData as ao, type PasskeySignInOptions as ap, type PasswordResetData as aq, type PhoneAuthUser as ar, type PhoneOtpStartData as as, type PhoneOtpStartOptions as at, type PhoneOtpVerifyData as au, type PhoneOtpVerifyOptions as av, type ProjectCapabilities as aw, type PublicConfig as ax, type RejectOrganizationInvitationData as ay, type RemoveOrganizationMemberData as az, type AcceptOrganizationInvitationData as b, type UpdateOrganizationMemberRoleOptions as b0, type UpdateOrganizationOptions as b1, type UpdateOrganizationTeamOptions as b2, type UpdatePasskeyData as b3, type UpdatePasskeyOptions as b4, type UpdateProfileOptions as b5, type UpdateUnsafeMetadataOptions as b6, type UserMetadata as b7, type UsernameSignInOptions as b8, type VerifyBackupCodeOptions as b9, type VerifyEmailOtpData as ba, type VerifyEmailOtpOptions as bb, type VerifyTotpOptions as bc, type VerifyTwoFactorOtpOptions as bd, type WaitlistJoinData as be, type WaitlistJoinOptions as bf, acceptConsent as bg, createAuthOwlClient as bh, createTokenClient as bi, getConsentStatus as bj, getPublicConfig as bk, resolveProjectCapabilities as bl, createAuthHttpClient as bm, type AuthHttpClient as bn, type AccountClient as c, type AccountSession as d, type AccountStatusData as e, type ActionFetchOptions as f, type AddOrganizationTeamMemberOptions as g, type AddPasskeyOptions as h, type AuthActionResult as i, type AuthClientError as j, type AuthErrorContext as k, type AuthOwlClient as l, type AuthOwlErrorCode as m, type AuthPasskey as n, type AuthRequestContext as o, type AuthResponseContext as p, type AuthSession as q, type AuthUser as r, type ChangePasswordData as s, type ChangePasswordOptions as t, type ConsentAcceptResult as u, type ConsentStatus as v, type CreateOrganizationOptions as w, type CreateOrganizationTeamOptions as x, type DeleteAccountOptions as y, type DeleteOrganizationOptions as z };
|
|
@@ -489,10 +489,59 @@ interface OrganizationTeam {
|
|
|
489
489
|
createdAt: Date;
|
|
490
490
|
updatedAt?: Date;
|
|
491
491
|
}
|
|
492
|
+
/** A user's membership in a team. Teams group organization members; they grant no authority. */
|
|
493
|
+
interface OrganizationTeamMember {
|
|
494
|
+
id: string;
|
|
495
|
+
teamId: string;
|
|
496
|
+
userId: string;
|
|
497
|
+
createdAt: Date;
|
|
498
|
+
}
|
|
499
|
+
interface CreateOrganizationTeamOptions {
|
|
500
|
+
/** The team name shown to organization members. */
|
|
501
|
+
name: string;
|
|
502
|
+
/** Defaults to the caller's active organization. */
|
|
503
|
+
organizationId?: string;
|
|
504
|
+
}
|
|
492
505
|
interface ListOrganizationTeamsOptions {
|
|
493
506
|
/** Defaults to the caller's active organization. */
|
|
494
507
|
organizationId?: string;
|
|
495
508
|
}
|
|
509
|
+
interface UpdateOrganizationTeamOptions {
|
|
510
|
+
teamId: string;
|
|
511
|
+
data: {
|
|
512
|
+
/** The new team name. */
|
|
513
|
+
name?: string;
|
|
514
|
+
/** Defaults to the caller's active organization. */
|
|
515
|
+
organizationId?: string;
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
interface RemoveOrganizationTeamOptions {
|
|
519
|
+
teamId: string;
|
|
520
|
+
/** Defaults to the caller's active organization. */
|
|
521
|
+
organizationId?: string;
|
|
522
|
+
}
|
|
523
|
+
interface RemoveOrganizationTeamData {
|
|
524
|
+
message: string;
|
|
525
|
+
}
|
|
526
|
+
interface ListOrganizationTeamMembersOptions {
|
|
527
|
+
/** Defaults to the caller's active team. */
|
|
528
|
+
teamId?: string;
|
|
529
|
+
}
|
|
530
|
+
interface AddOrganizationTeamMemberOptions {
|
|
531
|
+
teamId: string;
|
|
532
|
+
userId: string;
|
|
533
|
+
/** Defaults to the caller's active organization. */
|
|
534
|
+
organizationId?: string;
|
|
535
|
+
}
|
|
536
|
+
interface RemoveOrganizationTeamMemberOptions {
|
|
537
|
+
teamId: string;
|
|
538
|
+
userId: string;
|
|
539
|
+
/** Defaults to the caller's active organization. */
|
|
540
|
+
organizationId?: string;
|
|
541
|
+
}
|
|
542
|
+
interface RemoveOrganizationTeamMemberData {
|
|
543
|
+
message: string;
|
|
544
|
+
}
|
|
496
545
|
interface SetActiveTeamOptions {
|
|
497
546
|
/** The team to make active, or null to clear it. Must be a team the caller is on. */
|
|
498
547
|
teamId: string | null;
|
|
@@ -577,15 +626,31 @@ interface OrganizationRoleSummary {
|
|
|
577
626
|
permission?: unknown;
|
|
578
627
|
}
|
|
579
628
|
interface OrganizationClient {
|
|
629
|
+
/** @internal Subscribe to successful organization mutations. Used by framework bindings. */
|
|
630
|
+
subscribe(listener: () => void): () => void;
|
|
580
631
|
create(params: CreateOrganizationOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<Organization>>;
|
|
581
632
|
list(fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<Organization[]>>;
|
|
582
633
|
get(params?: GetOrganizationOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationDetails | null>>;
|
|
583
634
|
setActive(params: SetActiveOrganizationOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<Organization | null>>;
|
|
635
|
+
/** Create a named grouping of members inside an organization. A team grants no authority. */
|
|
636
|
+
createTeam(params: CreateOrganizationTeamOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam>>;
|
|
584
637
|
/**
|
|
585
638
|
* The teams of an organization, for resolving the team ids carried in the
|
|
586
639
|
* membership claim to names. Requires membership of that organization.
|
|
587
640
|
*/
|
|
588
641
|
listTeams(params?: ListOrganizationTeamsOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam[]>>;
|
|
642
|
+
/** Rename a team. Team membership remains grouping-only and grants no authority. */
|
|
643
|
+
updateTeam(params: UpdateOrganizationTeamOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam>>;
|
|
644
|
+
/** Remove a team and its grouping memberships from an organization. */
|
|
645
|
+
removeTeam(params: RemoveOrganizationTeamOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<RemoveOrganizationTeamData>>;
|
|
646
|
+
/** List every team the signed-in user belongs to across their organizations. */
|
|
647
|
+
listUserTeams(fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeam[]>>;
|
|
648
|
+
/** List the grouping memberships for a team, defaulting to the active team. */
|
|
649
|
+
listTeamMembers(params?: ListOrganizationTeamMembersOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeamMember[]>>;
|
|
650
|
+
/** Add an existing organization member to a team. This grants no authority. */
|
|
651
|
+
addTeamMember(params: AddOrganizationTeamMemberOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<OrganizationTeamMember>>;
|
|
652
|
+
/** Remove an organization member from a team without changing their organization role. */
|
|
653
|
+
removeTeamMember(params: RemoveOrganizationTeamMemberOptions, fetchOptions?: ActionFetchOptions): Promise<AuthActionResult<RemoveOrganizationTeamMemberData>>;
|
|
589
654
|
/**
|
|
590
655
|
* Select the caller's active team, which surfaces as `activeTeamId` on the session
|
|
591
656
|
* and `team_id` in the project token. Only a team the caller is on can be made
|
|
@@ -769,6 +834,11 @@ interface SessionState {
|
|
|
769
834
|
interface SessionStore {
|
|
770
835
|
subscribe(listener: () => void): () => void;
|
|
771
836
|
getSnapshot(): SessionState;
|
|
837
|
+
/**
|
|
838
|
+
* Re-read the session from the server, bypassing the cookie cache, and publish
|
|
839
|
+
* the resulting snapshot to subscribers. Concurrent calls share one request.
|
|
840
|
+
*/
|
|
841
|
+
refresh(): Promise<void>;
|
|
772
842
|
}
|
|
773
843
|
/** Standard `{ data, error }` envelope returned by the client's auth actions. */
|
|
774
844
|
interface AuthActionResult<T = Record<string, unknown>> {
|
|
@@ -1342,4 +1412,4 @@ interface AuthOwlClient {
|
|
|
1342
1412
|
*/
|
|
1343
1413
|
declare function createAuthOwlClient(config: ResolvedAuthConfig): AuthOwlClient;
|
|
1344
1414
|
|
|
1345
|
-
export { type
|
|
1415
|
+
export { type LinkSocialOptions as $, type AkedlyShieldStartProof as A, type DeletePasskeyData as B, type ChangeEmailOptions as C, type DeleteAccountData as D, type DeletePasskeyOptions as E, type DisableTwoFactorOptions as F, type EmailAuthData as G, type EmailOtpAuthData as H, type EmailOtpSignInOptions as I, type EmailOtpType as J, type EmailSignInOptions as K, type EmailSignUpData as L, type EmailSignUpOptions as M, type EnableTwoFactorOptions as N, type EnvironmentType as O, type PhoneOtpChallengeData as P, type GenerateBackupCodesOptions as Q, type GetOrganizationInvitationOptions as R, type GetOrganizationOptions as S, type GetToken as T, type GetTokenOptions as U, type InviteOrganizationMemberOptions as V, type JsonObject as W, type JsonPrimitive as X, type JsonValue as Y, type LeaveOrganizationOptions as Z, type LinkSocialData as _, AUTH_CHALLENGE_HEADER as a, type UnlinkSocialOptions as a$, type ListOrganizationInvitationsOptions as a0, type ListOrganizationMembersOptions as a1, type ListOrganizationRolesOptions as a2, type ListOrganizationTeamMembersOptions as a3, type ListOrganizationTeamsOptions as a4, type MagicLinkData as a5, type MagicLinkSignInOptions as a6, type Organization as a7, type OrganizationClient as a8, type OrganizationDetails as a9, type RemoveOrganizationMemberOptions as aA, type RemoveOrganizationTeamData as aB, type RemoveOrganizationTeamMemberData as aC, type RemoveOrganizationTeamMemberOptions as aD, type RemoveOrganizationTeamOptions as aE, type RequestPasswordResetOptions as aF, type ResetPasswordOptions as aG, type RevokeSessionOptions as aH, type SendOtpData as aI, type SendTwoFactorOtpData as aJ, type SendTwoFactorOtpOptions as aK, type SendVerificationOtpOptions as aL, type SessionState as aM, type SessionStore as aN, type SetActiveOrganizationOptions as aO, type SetActiveTeamOptions as aP, type SignOutData as aQ, type SocialAccount as aR, type SocialAuthData as aS, type SocialIdTokenOptions as aT, type SocialSignInOptions as aU, type TokenClient as aV, type TwoFactorBackupCodesData as aW, type TwoFactorEnableData as aX, type TwoFactorRedirectData as aY, type TwoFactorStatusData as aZ, type TwoFactorVerifyData as a_, type OrganizationFilterOperator as aa, type OrganizationInvitation as ab, type OrganizationInvitationActionOptions as ac, type OrganizationInvitationDetails as ad, type OrganizationInvitationStatus as ae, type OrganizationMember as af, type OrganizationMemberUser as ag, type OrganizationMemberWithUser as ah, type OrganizationMembersData as ai, type OrganizationRoleSummary as aj, type OrganizationSelector as ak, type OrganizationTeam as al, type OrganizationTeamMember as am, type OrganizationUserInvitation as an, type PasskeyAuthData as ao, type PasskeySignInOptions as ap, type PasswordResetData as aq, type PhoneAuthUser as ar, type PhoneOtpStartData as as, type PhoneOtpStartOptions as at, type PhoneOtpVerifyData as au, type PhoneOtpVerifyOptions as av, type ProjectCapabilities as aw, type PublicConfig as ax, type RejectOrganizationInvitationData as ay, type RemoveOrganizationMemberData as az, type AcceptOrganizationInvitationData as b, type UpdateOrganizationMemberRoleOptions as b0, type UpdateOrganizationOptions as b1, type UpdateOrganizationTeamOptions as b2, type UpdatePasskeyData as b3, type UpdatePasskeyOptions as b4, type UpdateProfileOptions as b5, type UpdateUnsafeMetadataOptions as b6, type UserMetadata as b7, type UsernameSignInOptions as b8, type VerifyBackupCodeOptions as b9, type VerifyEmailOtpData as ba, type VerifyEmailOtpOptions as bb, type VerifyTotpOptions as bc, type VerifyTwoFactorOtpOptions as bd, type WaitlistJoinData as be, type WaitlistJoinOptions as bf, acceptConsent as bg, createAuthOwlClient as bh, createTokenClient as bi, getConsentStatus as bj, getPublicConfig as bk, resolveProjectCapabilities as bl, createAuthHttpClient as bm, type AuthHttpClient as bn, type AccountClient as c, type AccountSession as d, type AccountStatusData as e, type ActionFetchOptions as f, type AddOrganizationTeamMemberOptions as g, type AddPasskeyOptions as h, type AuthActionResult as i, type AuthClientError as j, type AuthErrorContext as k, type AuthOwlClient as l, type AuthOwlErrorCode as m, type AuthPasskey as n, type AuthRequestContext as o, type AuthResponseContext as p, type AuthSession as q, type AuthUser as r, type ChangePasswordData as s, type ChangePasswordOptions as t, type ConsentAcceptResult as u, type ConsentStatus as v, type CreateOrganizationOptions as w, type CreateOrganizationTeamOptions as x, type DeleteAccountOptions as y, type DeleteOrganizationOptions as z };
|