/** * Orchestrate the structural walk of a Vault, producing a * {@link VaultSchemaSnapshot}. Called from `Vault.dumpSchema()`. * * @module */ import type { DumpSchemaOptions, VaultSchemaSnapshot } from './types.js'; import type { Collection } from '../../kernel/collection.js'; import type { NoydbStore } from '../../kernel/types.js'; import type { UnlockedKeyring } from '../../with-party/team/keyring.js'; import type { RefRegistry } from '../../kernel/refs.js'; import type { VaultMeta } from './meta.js'; import type { EnclaveKey } from '../../kernel/enclave/index.js'; /** * The minimal slice of Vault internal state the walker needs. * Exposed via `vault._introspectState()` to keep the public Vault * surface narrow. * * @internal */ export interface VaultIntrospectState { readonly name: string; readonly adapter: NoydbStore; readonly collectionCache: Map>; readonly refRegistry: RefRegistry; readonly getDEK: (collectionName: string) => Promise; /** The active unlocked keyring — role/permissions/userId for access-scoped ops. */ readonly keyring: UnlockedKeyring; readonly subsystems: Record; /** Vault-level descriptive metadata, when set via `openVault({meta})`. */ readonly vaultMeta?: VaultMeta; readonly mvRegistry: unknown; readonly overlayRegistry: unknown; readonly derivationRegistry: unknown; /** * Returns the registered schema-update strategy names for a collection, * or `undefined` when none are registered. Populated from * `vault.#schemaUpdateNames` in `_introspectState()`. */ readonly getCollectionSchemaUpdateNames?: (col: string) => readonly string[] | undefined; /** * Returns `true` when the collection has an archive policy registered * in `vault.archiveRegistry`, `false` otherwise. Populated from * `vault.archiveRegistry` in `_introspectState()`. */ readonly hasCollectionArchive?: (col: string) => boolean; } export declare function dumpVaultSchema(vault: { _introspectState(): VaultIntrospectState; }, opts: DumpSchemaOptions): Promise;