basalt / teams/src / InvitationStore
Interface: InvitationStore
Defined in: teams/src/stores.ts:117
Methods
create()
> create(invitation): Promise<void>
Defined in: teams/src/stores.ts:118
Parameters
invitation
Returns
Promise<void>
findById()
> findById(id): Promise<Invitation | null>
Defined in: teams/src/stores.ts:120
Parameters
id
string
Returns
Promise<Invitation | null>
findByToken()
> findByToken(token): Promise<Invitation | null>
Defined in: teams/src/stores.ts:119
Parameters
token
string
Returns
Promise<Invitation | null>
findPending()
> findPending(tenantId, email): Promise<Invitation | null>
Defined in: teams/src/stores.ts:129
A pending invitation for this address. Compare canonicalInviteEmail forms on both sides — rows written before 4.0 may hold mixed case. (Teams itself supersedes invitations via listPending, so it also catches legacy duplicates on stores that don't.)
Parameters
tenantId
string
email
string
Returns
Promise<Invitation | null>
listPending()
> listPending(tenantId): Promise<Invitation[]>
Defined in: teams/src/stores.ts:122
Pending (not accepted, not revoked, not expired-at read time is caller's job).
Parameters
tenantId
string
Returns
Promise<Invitation[]>
markAccepted()
> markAccepted(id, at): Promise<boolean | void>
Defined in: teams/src/stores.ts:137
Atomically marks a PENDING invitation (not accepted, not revoked) accepted — a compare-and-set. Resolve true when this call flipped it and false when it was no longer pending (a concurrent accept/revoke won), so one token enrolls at most one account. Returning void is accepted for backwards compatibility but gives up that race guarantee.
Parameters
id
string
at
number
Returns
Promise<boolean | void>
revoke()
> revoke(id, at): Promise<void>
Defined in: teams/src/stores.ts:138
Parameters
id
string
at
number
Returns
Promise<void>