Module

Yoga.BetterAuth.Om

Package
purescript-yoga-better-auth
Repository
rowtype-yoga/purescript-yoga-better-auth

Re-exports from Yoga.BetterAuth.OmLayer

#DatabaseL Source

type DatabaseL :: Row Type -> Row Typetype DatabaseL r = (database :: Database | r)

#BetterAuthL Source

type BetterAuthL :: Row Type -> Row Typetype BetterAuthL r = (auth :: Auth | r)

#AuthClientL Source

type AuthClientL :: Row Type -> Row Typetype AuthClientL r = (authClient :: AuthClient | r)

#testStackLive Source

testStackLive :: forall opts opts_. Lacks "database" opts => Union opts opts_ BetterAuthOptionsImpl => { baseURL :: String, betterAuthConfig :: Record opts, connectionString :: String } -> OmLayer (scope :: Scope) () { auth :: Auth, authClient :: AuthClient, database :: Database }

#testClientLive' Source

testClientLive' :: forall r. String -> OmLayer (auth :: Auth | r) () { authClient :: AuthClient }

#testClientLive Source

testClientLive :: forall r. OmLayer (auth :: Auth, baseURL :: String | r) () { authClient :: AuthClient }

#migrationsLive Source

migrationsLive :: forall r. OmLayer (auth :: Auth | r) () (Record ())

#databaseLive' Source

databaseLive' :: String -> OmLayer (scope :: Scope) () { database :: Database }

#databaseLive Source

databaseLive :: forall r. OmLayer (connectionString :: String, scope :: Scope | r) () { database :: Database }

#browserClientLive Source

browserClientLive :: forall r. OmLayer (baseURL :: String | r) () { authClient :: AuthClient }

#betterAuthLive' Source

betterAuthLive' :: forall r opts opts_. Lacks "database" opts => Union opts opts_ BetterAuthOptionsImpl => Record opts -> OmLayer (database :: Database | r) () { auth :: Auth }

#betterAuthLive Source

betterAuthLive :: forall r opts opts_. Lacks "database" opts => Union opts opts_ BetterAuthOptionsImpl => OmLayer (betterAuthConfig :: Record opts, database :: Database | r) () { auth :: Auth }

#authFullLive Source

authFullLive :: forall opts opts_. Lacks "database" opts => Union opts opts_ BetterAuthOptionsImpl => { betterAuthConfig :: Record opts, connectionString :: String } -> OmLayer (scope :: Scope) () { auth :: Auth, database :: Database }

Re-exports from Yoga.BetterAuth.Types

#UserName Source

#UserId Source

newtype UserId

Constructors

Instances

#User Source

type User = { createdAt :: ISODateString, email :: Email, emailVerified :: Boolean, id :: UserId, image :: Maybe String, name :: UserName, updatedAt :: ISODateString }

#Token Source

newtype Token

Constructors

Instances

#SignUpResult Source

type SignUpResult = { token :: Token, user :: User }

#SignInResult Source

type SignInResult = { redirect :: Boolean, token :: Token, user :: User }

#SessionWithUser Source

type SessionWithUser = { session :: Session, user :: User }

#Session Source

type Session = { createdAt :: ISODateString, expiresAt :: ISODateString, id :: SessionId, ipAddress :: Maybe String, token :: Token, updatedAt :: ISODateString, userAgent :: Maybe String, userId :: UserId }

#Password Source

newtype Password

Constructors

Instances

#Email Source

newtype Email

Constructors

Instances

#ClientUser Source

type ClientUser = { createdAt :: JSDate, email :: Email, emailVerified :: Boolean, id :: UserId, image :: Maybe String, name :: UserName, updatedAt :: JSDate }

#ClientSignUpResult Source

type ClientSignUpResult = { token :: Maybe Token, user :: ClientUser }

#ClientSignInResult Source

type ClientSignInResult = { redirect :: Boolean, token :: Token, user :: ClientUser }

#ClientSessionWithUser Source

type ClientSessionWithUser = { session :: ClientSession, user :: ClientUser }

#ClientSession Source

type ClientSession = { createdAt :: JSDate, expiresAt :: JSDate, id :: SessionId, ipAddress :: Maybe String, token :: Token, updatedAt :: JSDate, userAgent :: Maybe String, userId :: UserId }

#ClientError Source

type ClientError = { message :: String, status :: Int, statusText :: String }

#AuthClient Source

#Auth Source

data Auth

#Account Source

type Account = { accessToken :: Maybe Token, accountId :: String, createdAt :: ISODateString, id :: String, idToken :: Maybe Token, providerId :: String, refreshToken :: Maybe Token, scope :: Maybe String, updatedAt :: ISODateString, userId :: UserId }

Re-exports from Yoga.Om.Layer

#Scope Source

newtype Scope

A first-class representation of resource lifetime and memoization. Finalizers are registered via acquireRelease and run in reverse order when the scope is closed. Layers are automatically memoized by identity within a scope — the same layer value builds only once.

Instances

#OmLayer Source

data OmLayer :: Row Type -> Row Type -> Type -> Typedata OmLayer req err a

A layer that requires dependencies (req), may fail with (err), and produces a value (typically Record prov). Each layer has a unique identity used for automatic memoization within a Scope.

Instances

#withScopedWith Source

withScopedWith :: forall prov a r rl err_ err. RowToList (exception :: Error -> Aff (Record prov) | r) rl => VariantMatchCases rl err_ (Aff (Record prov)) => Union err_ () (exception :: Error | err) => { exception :: Error -> Aff (Record prov) | r } -> OmLayer (scope :: Scope) err (Record prov) -> (Record prov -> Aff a) -> Aff a

Like withScoped but accepts error handlers for layers with typed errors.

#withScoped Source

withScoped :: forall prov a. OmLayer (scope :: Scope) () (Record prov) -> (Record prov -> Aff a) -> Aff a

Build a fully-provided scoped layer and pass the provisions to a callback. A fresh Scope is created and closed when the callback completes, running all finalizers in reverse order — whether by success, failure, or interruption. For layers with typed errors, use withScopedWith.

#wireLayers Source

wireLayers :: forall layers rl req err prov. RowToList layers rl => TopoWire rl layers (scope :: Scope) () () req err prov => Record layers -> OmLayer req err (Record prov)

#runScopedWith Source

runScopedWith :: forall prov r rl err_ err. RowToList (exception :: Error -> Aff (Record prov) | r) rl => VariantMatchCases rl err_ (Aff (Record prov)) => Union err_ () (exception :: Error | err) => { exception :: Error -> Aff (Record prov) | r } -> OmLayer (scope :: Scope) err (Record prov) -> Aff (Record prov)

Like runScoped but accepts error handlers for layers with typed errors.

#runScoped Source

runScoped :: forall prov. OmLayer (scope :: Scope) () (Record prov) -> Aff (Record prov)

Build a fully-provided scoped layer, return the provisions. All finalizers run after the provisions are returned. For layers with typed errors, use runScopedWith.

#(>->) Source

Operator alias for Yoga.Om.Layer.provide (left-associative / precedence 9)