PrismaInvitationStore
The InvitationStore on the AuthInvitation table from prisma/auth.prisma.
Implements
Section titled “Implements”InvitationStore
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PrismaInvitationStore(
delegates):PrismaInvitationStore
Parameters
Section titled “Parameters”delegates
Section titled “delegates”Returns
Section titled “Returns”PrismaInvitationStore
Methods
Section titled “Methods”consume()
Section titled “consume()”consume(
hash):Promise<StoredInvitation|null>
Atomically removes and returns the invitation: of many concurrent callers exactly one gets it.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<StoredInvitation | null>
Implementation of
Section titled “Implementation of”InvitationStore.consume
create()
Section titled “create()”create(
invitation,now):Promise<boolean>
Stores the invitation unless a live one (expiring after now) exists for
the same scope and address: then false, and nothing written. An expired
one is replaced. Of many concurrent creates for one scope and address, at
most one gets true. The store may drop an invitation after expiresAt.
Parameters
Section titled “Parameters”invitation
Section titled “invitation”StoredInvitation
number
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”InvitationStore.create
deleteByInviter()
Section titled “deleteByInviter()”deleteByInviter(
inviterId,scope?):Promise<void>
Deletes every invitation inviterId sent, or with scope only those to that scope.
Parameters
Section titled “Parameters”inviterId
Section titled “inviterId”string
scope?
Section titled “scope?”string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”InvitationStore.deleteByInviter
findByHash()
Section titled “findByHash()”findByHash(
hash):Promise<StoredInvitation|null>
The invitation with this hash (expired or not: the caller checks).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<StoredInvitation | null>
Implementation of
Section titled “Implementation of”InvitationStore.findByHash
listByScope()
Section titled “listByScope()”listByScope(
scope,now):Promise<StoredInvitation[]>
The scope’s invitations that expire after now, in no particular order.
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<StoredInvitation[]>
Implementation of
Section titled “Implementation of”InvitationStore.listByScope
revoke()
Section titled “revoke()”revoke(
scope,id):Promise<boolean>
Deletes the invitation with this id if it belongs to scope; whether it did.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”InvitationStore.revoke