import type { ProviderAuthPlugin } from './provider-auth-plugin.js'; import type { ActiveTenantCheckResult, TenantGate } from '@enbox/dwn-sdk-js'; import type { ProofOfWorkChallengeModel, RegistrationRequest } from '@enbox/dwn-clients'; import { RegistrationStore } from './registration-store.js'; /** * The RegistrationManager is responsible for managing the registration of tenants. * It handles tenant registration requests and provides the corresponding `TenantGate` implementation. */ export declare class RegistrationManager implements TenantGate { private proofOfWorkManager; private providerAuthPlugin?; private registrationStore; private termsOfServiceHash?; private termsOfService?; /** * The terms-of-service. */ getTermsOfService(): string | undefined; /** * The terms-of-service hash. */ getTermsOfServiceHash(): string | undefined; /** * Updates the terms-of-service. Exposed for testing purposes. */ updateTermsOfService(termsOfService: string): void; /** * Creates a new RegistrationManager instance. * @param input.registrationStoreUrl - The URL of the registration store. * Set to `undefined` or empty string if tenant registration is not required (ie. DWN is open for all). * */ static create(input: { registrationStoreUrl?: string; termsOfServiceFilePath?: string; proofOfWorkChallengeNonceSeed?: string; proofOfWorkInitialMaximumAllowedHash?: string; providerAuthPlugin?: ProviderAuthPlugin; }): Promise; /** * Gets the proof-of-work challenge. */ getProofOfWorkChallenge(): ProofOfWorkChallengeModel; /** * Handles a registration request by dispatching to the appropriate handler * based on the credentials provided. */ handleRegistrationRequest(registrationRequest: RegistrationRequest): Promise; /** * Handles a provider-auth registration request. */ private handleProviderAuthRegistration; /** * Handles a proof-of-work registration request. */ private handleProofOfWorkRegistration; /** * Records the given registration data in the database. * Exposed as a public method for testing purposes. */ recordTenantRegistration(registrationData: { did: string; termsOfServiceHash?: string; accountId?: string; registrationType?: string; metadata?: string; }): Promise; /** * The TenantGate implementation. */ isActiveTenant(tenant: string): Promise; /** * Returns the underlying RegistrationStore, if initialized. * Used by the admin API to access tenant data. */ getRegistrationStore(): RegistrationStore | undefined; } //# sourceMappingURL=registration-manager.d.ts.map