Skip to content

basalt / tenancy/src / DomainStore

Interface: DomainStore ​

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

Methods ​

add() ​

> add(domain): Promise<void>

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

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

Parameters ​

domain ​

CustomDomain

Returns ​

Promise<void>


forTenant() ​

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

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

Parameters ​

tenantId ​

string

Returns ​

Promise<CustomDomain[]>


get() ​

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

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

Parameters ​

domain ​

string

Returns ​

Promise<CustomDomain | null>


listVerified()? ​

> optional listVerified(): Promise<CustomDomain[]>

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

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

Returns ​

Promise<CustomDomain[]>


markUnverified() ​

> markUnverified(domain): Promise<void>

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

Parameters ​

domain ​

string

Returns ​

Promise<void>


markVerified() ​

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

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

Parameters ​

domain ​

string

at ​

number

Returns ​

Promise<void>


remove() ​

> remove(domain): Promise<void>

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

Parameters ​

domain ​

string

Returns ​

Promise<void>


replace()? ​

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

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

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>

Released under the MIT License.