import type { Dialect } from '@enbox/dwn-sql-store'; import type { TenantQuota } from '../admin/types.js'; /** * The RegistrationStore is responsible for storing and retrieving tenant registration information. */ export declare class RegistrationStore { private static readonly registeredTenantTableName; private static readonly tenantQuotasTableName; private readonly db; private constructor(); /** * Creates a new RegistrationStore instance. */ static create(sqlDialect: Dialect): Promise; /** * Verifies that the required tables exist. Throws a clear error directing * the caller to run server migrations first. */ private initialize; /** * Inserts or updates the tenant registration information. */ insertOrUpdateTenantRegistration(registrationData: { did: string; termsOfServiceHash?: string; accountId?: string; registrationType?: string; metadata?: string; }): Promise; /** * Retrieves the tenant registration information. */ getTenantRegistration(tenantDid: string): Promise; /** * Returns a paginated list of registered tenants with optional search and status filtering. * * @see https://github.com/enboxorg/enbox/issues/390 */ listTenants(options?: { cursor?: string; limit?: number; search?: string; status?: 'active' | 'suspended'; }): Promise<{ tenants: RegisteredTenantRow[]; cursor?: string; }>; /** * Returns the total count of registered tenants matching optional filters. */ getTenantCount(options?: { search?: string; status?: 'active' | 'suspended'; }): Promise; /** * Inserts a new tenant registration. Returns `false` if the tenant already exists. * * @see https://github.com/enboxorg/enbox/issues/393 */ createTenant(did: string): Promise; /** * Suspends a tenant. Returns `true` if the tenant was found and suspended. */ suspendTenant(did: string): Promise; /** * Unsuspends a tenant. Returns `true` if the tenant was found and unsuspended. */ unsuspendTenant(did: string): Promise; /** * Deletes a tenant registration. Returns `true` if the tenant was found and deleted. */ deleteTenant(did: string): Promise; /** * Returns all tenant registrations associated with the given account ID. * * @see https://github.com/enboxorg/enbox/issues/404 */ getTenantsForAccount(accountId: string): Promise; /** * Returns the count of suspended tenants. */ getSuspendedCount(): Promise; /** * Returns the quota for a tenant, or `undefined` if no per-tenant quota is set. */ getQuota(did: string): Promise; /** * Sets (inserts or updates) the quota for a tenant. */ setQuota(quota: TenantQuota): Promise; /** * Deletes the per-tenant quota. Returns `true` if a quota existed and was deleted. */ deleteQuota(did: string): Promise; } /** * A row in the `registeredTenants` table. */ export interface RegisteredTenantRow { did: string; termsOfServiceHash: string; suspended?: number; accountId?: string; registrationType?: string; registeredAt?: string; metadata?: string; } //# sourceMappingURL=registration-store.d.ts.map