/** * Reusable Convex runtime proof helpers. * This module must not import `convex-test` — apps inject the factory/harness. */ export interface ManifestIdentity { subject: string; role: string; tenantId: string; tokenIdentifier?: string; [key: string]: unknown; } export interface ManifestConvexDb { insert: (table: string, doc: Record) => Promise; get: (id: unknown) => Promise | null>; query: (table: string) => { collect: () => Promise[]>; withIndex?: (name: string, builder: (q: { eq: (field: string, value: unknown) => unknown; }) => unknown) => { collect: () => Promise[]>; }; }; patch: (id: unknown, value: Record) => Promise; } export interface ManifestConvexTestHarness { withIdentity: (identity: Record) => ManifestConvexTestHarness; mutation: (fn: unknown, args?: unknown) => Promise; query: (fn: unknown, args?: unknown) => Promise; run: (handler: (ctx: { db: ManifestConvexDb; auth: unknown; }) => Promise) => Promise; } export type ConvexTestFactory = (schema: unknown, modules?: Record Promise>) => ManifestConvexTestHarness; export interface CreateManifestTestContextOptions { /** Injected `convexTest` from the `convex-test` package. */ convexTest: ConvexTestFactory; schema: unknown; modules: Record Promise>; } export declare class ManifestConvexProofHarness { private readonly root; constructor(root: ManifestConvexTestHarness); asRole(identity: ManifestIdentity): ManifestConvexTestHarness; executeCommand(actor: ManifestConvexTestHarness, mutationRef: unknown, args: Record): Promise; seedEntity(actor: ManifestConvexTestHarness, table: string, doc: Record): Promise; expectEvent(actor: ManifestConvexTestHarness, options: { eventsTable?: string; type: string; tenantId?: string; predicate?: (payload: Record) => boolean; }): Promise>; expectDocuments(actor: ManifestConvexTestHarness, table: string, predicate: (doc: Record) => boolean): Promise[]>; expectTenantIsolation(otherTenantActor: ManifestConvexTestHarness, table: string, foreignTenantId: string): Promise; } export declare function createManifestTestContext(options: CreateManifestTestContextOptions): ManifestConvexProofHarness; //# sourceMappingURL=harness.d.ts.map