import { Result } from "@webiny/feature/api"; import type { IEventHandler, DomainEvent } from "../../../features/eventPublisher/index.js"; import type { Tenant, CreateTenantInput } from "../../../types/tenancy.js"; import type { TenantBeforeCreatePayload, TenantAfterCreatePayload } from "./events.js"; import { CreateTenantError } from "./errors.js"; /** * Errors */ export interface ICreateTenantErrors { base: CreateTenantError; } /** * Use Case */ export interface ICreateTenantUseCase { execute(data: CreateTenantInput): Promise>; } /** Create a new tenant. */ export declare const CreateTenantUseCase: import("@webiny/di").Abstraction; export declare namespace CreateTenantUseCase { type Interface = ICreateTenantUseCase; type Errors = ICreateTenantErrors[keyof ICreateTenantErrors]; } /** * Repository */ export interface ICreateTenantRepository { create(tenant: Tenant): Promise; } /** Persist a newly created tenant. */ export declare const CreateTenantRepository: import("@webiny/di").Abstraction; export declare namespace CreateTenantRepository { type Interface = ICreateTenantRepository; } /** * Gateway */ export interface ICreateTenantGateway { createTenant(data: Tenant): Promise; } /** Storage gateway for tenant creation. */ export declare const CreateTenantGateway: import("@webiny/di").Abstraction; export declare namespace CreateTenantGateway { type Interface = ICreateTenantGateway; } /** Hook into tenant lifecycle before a tenant is created. */ export declare const TenantBeforeCreateEventHandler: import("@webiny/di").Abstraction>>; export declare namespace TenantBeforeCreateEventHandler { type Interface = IEventHandler>; type Event = DomainEvent; } /** Hook into tenant lifecycle after a tenant is created. */ export declare const TenantAfterCreateEventHandler: import("@webiny/di").Abstraction>>; export declare namespace TenantAfterCreateEventHandler { type Interface = IEventHandler>; type Event = DomainEvent; }