Skip to content

basalt / tenancy/src / MemoryDomainStore

Class: MemoryDomainStore ​

Defined in: tenancy/src/custom-domains.ts:114

Implements ​

Constructors ​

Constructor ​

> new MemoryDomainStore(): MemoryDomainStore

Returns ​

MemoryDomainStore

Methods ​

add() ​

> add(domain): Promise<void>

Defined in: tenancy/src/custom-domains.ts:116

Insert a NEW domain. Must reject (throw) if the domain already exists — the uniqueness gate.

Parameters ​

domain ​

CustomDomain

Returns ​

Promise<void>

Implementation of ​

DomainStore.add


forTenant() ​

> forTenant(tenantId): Promise<CustomDomain[]>

Defined in: tenancy/src/custom-domains.ts:127

Parameters ​

tenantId ​

string

Returns ​

Promise<CustomDomain[]>

Implementation of ​

DomainStore.forTenant


get() ​

> get(domain): Promise<CustomDomain | null>

Defined in: tenancy/src/custom-domains.ts:123

Parameters ​

domain ​

string

Returns ​

Promise<CustomDomain | null>

Implementation of ​

DomainStore.get


listVerified() ​

> listVerified(): Promise<CustomDomain[]>

Defined in: tenancy/src/custom-domains.ts:147

Every verified domain, for CustomDomains.reverifyAll. Optional: without it, pass the domains to reverifyAll({ domains }) yourself.

Returns ​

Promise<CustomDomain[]>

Implementation of ​

DomainStore.listVerified


markUnverified() ​

> markUnverified(domain): Promise<void>

Defined in: tenancy/src/custom-domains.ts:137

Parameters ​

domain ​

string

Returns ​

Promise<void>

Implementation of ​

DomainStore.markUnverified


markVerified() ​

> markVerified(domain, at): Promise<void>

Defined in: tenancy/src/custom-domains.ts:130

Parameters ​

domain ​

string

at ​

number

Returns ​

Promise<void>

Implementation of ​

DomainStore.markVerified


remove() ​

> remove(domain): Promise<void>

Defined in: tenancy/src/custom-domains.ts:144

Parameters ​

domain ​

string

Returns ​

Promise<void>

Implementation of ​

DomainStore.remove


replace() ​

> replace(expected, next): Promise<boolean>

Defined in: tenancy/src/custom-domains.ts:150

Atomically swap the record for expected.domain with next, but ONLY if the stored record is still expected (same tenant, token and verified flag). Returns false when the record changed underneath. Used to hand an expired or DNS-contested unverified claim to another tenant. Optional: without it the swap is a remove followed by an add, which a concurrent claim can race.

Parameters ​

expected ​

CustomDomain

next ​

CustomDomain

Returns ​

Promise<boolean>

Implementation of ​

DomainStore.replace

Released under the MIT License.