import type { BaseEvent } from '@credo-ts/core'; /** * Vault event types — spec § Messages control plane only. * * The legacy event types (VaultCreated, VaultShared, ShareRequested, * Storage* etc.) are gone alongside the legacy messages. Application * code subscribes to these to react to the 5 spec messages. */ export declare enum VaultEventTypes { ProposeReceived = "vaults/ProposeReceived", OfferReceived = "vaults/OfferReceived", AccessGranted = "vaults/AccessGranted", Sealed = "vaults/Sealed", Retired = "vaults/Retired", ProblemReport = "vaults/ProblemReport" } export interface ProposeReceivedEvent extends BaseEvent { type: typeof VaultEventTypes.ProposeReceived; payload: { purpose: string; participants: string[]; constraints?: unknown; backendPrefs: string[]; indexSchema: string[]; from?: string; threadId?: string; }; } export interface OfferReceivedEvent extends BaseEvent { type: typeof VaultEventTypes.OfferReceived; payload: { vaultDescriptor: Record; provisioner?: string; from?: string; threadId?: string; }; } export interface AccessGrantedEvent extends BaseEvent { type: typeof VaultEventTypes.AccessGranted; payload: { to: string; capability: Record; grantedBy?: string; receivedAt: string; }; } export interface SealedEvent extends BaseEvent { type: typeof VaultEventTypes.Sealed; payload: { vaultId: string; mode: string; from?: string; }; } export interface RetiredEvent extends BaseEvent { type: typeof VaultEventTypes.Retired; payload: { vaultId: string; strategy: 'delete' | 'destroy-keys'; evidenceDocId?: string; from?: string; }; } export interface ProblemReportReceivedEvent extends BaseEvent { type: typeof VaultEventTypes.ProblemReport; payload: { errorCode?: string; description?: string; vaultId?: string; threadId?: string; from?: string; }; } export type VaultEvent = ProposeReceivedEvent | OfferReceivedEvent | AccessGrantedEvent | SealedEvent | RetiredEvent | ProblemReportReceivedEvent;