/** * **@noy-db/hub** — zero-knowledge, offline-first, encrypted document store. * * ## What it is * * A TypeScript library that encrypts every record with AES-256-GCM before it * reaches any storage backend. The store (file, DynamoDB, S3, IndexedDB, …) * only ever sees ciphertext — it has no way to read or tamper with your data * without the user's passphrase. * * ## Architecture in one diagram * * ``` * Passphrase * └─► PBKDF2-SHA256 (600K iterations) → KEK [memory only] * └─► AES-KW unwrap → DEK per collection [memory only] * └─► AES-256-GCM encrypt/decrypt * └─► NoydbStore [sees only ciphertext envelopes] * ``` * * ## Getting started * * ```ts * import { createNoydb } from '@noy-db/hub' * import { jsonFile } from '@noy-db/to-file' * * const db = await createNoydb({ store: jsonFile({ dir: './data' }) }) * const acme = await db.openVault('acme', { passphrase: 'hunter2' }) * const invoices = acme.collection('invoices') * * await invoices.put('inv-001', { amount: 1200, client: 'Acme Corp' }) * const all = await invoices.query().toArray() * ``` * * ## Key concepts * * | Concept | Type | Description | * |---------|------|-------------| * | Instance | {@link Noydb} | Top-level handle from {@link createNoydb} | * | Vault | {@link Vault} | Tenant namespace; has its own keyrings | * | Collection | {@link Collection} | Typed record set; has its own DEK | * | Store | {@link NoydbStore} | 6-method backend interface | * | Envelope | {@link EncryptedEnvelope} | What the store actually persists | * * ## Security invariants * * - **Zero crypto dependencies.** All cryptography uses `crypto.subtle` (Web * Crypto API). No npm crypto packages. * - **KEK never persisted.** The key-encryption key lives only in memory for * the duration of an open session. * - **Fresh IV per write.** Every `put()` generates a new random 12-byte IV. * - **Stores see only ciphertext.** Encryption happens in core before any * store method is called. * * ## Related packages * * | Package | Purpose | * |---------|---------| * | `@noy-db/to-file` | JSON file store (USB / local disk) | * | `@noy-db/to-browser-idb` | IndexedDB store (atomic CAS) | * | `@noy-db/to-memory` | In-memory store (testing) | * | `@noy-db/to-aws-dynamo` | DynamoDB single-table store *(noy-db-to)* | * | `@noy-db/to-aws-s3` | S3 object store *(noy-db-to)* | * | `@noy-db/to-postgres` | PostgreSQL store *(noy-db-to)* | * | `@noy-db/in-vue` | Vue 3 composables | * | `@noy-db/in-pinia` | Pinia store integration | * | `@noy-db/in-nuxt` | Nuxt 4 module | * | `@noy-db/on-webauthn` | Hardware-key / passkey unlock | * | `@noy-db/on-oidc` | OIDC / federated login unlock | * * @packageDocumentation */ import './kernel/env-check.js'; export type { Role, Permission, Permissions, EncryptedEnvelope, KeyringAuthenticator, KeyringAuthenticatorWrappingKEK, KeyringAuthenticatorWrappingDEKs, VaultPolicyOnDisk, VaultSnapshot, NoydbStore, ListPageResult, KeyringFile, VaultBackup, DirtyEntry, SyncMetadata, Conflict, ErasureEnforcement, ConflictStrategy, ConflictPolicy, CollectionConflictResolver, PushOptions, PullOptions, PushResult, PullResult, SyncTransactionResult, SyncStatus, ChangeEvent, NoydbEventMap, GrantOptions, RevokeOptions, UpdateUserOptions, UserInfo, NoydbOptions, HistoryConfig, HistoryOptions, HistoryEntry, PruneOptions, PutManyItemOptions, PutManyOptions, PutManyResult, DeleteManyResult, ExportStreamOptions, ExportChunk, AccessibleVault, ListAccessibleVaultsOptions, QueryAcrossOptions, QueryAcrossResult, SessionPolicy, ReAuthOperation, PlaintextTranslatorContext, PlaintextTranslatorFn, TranslatorAuditEntry, ExportCapability, ExportFormat, ImportCapability, } from './kernel/types.js'; export { NOYDB_FORMAT_VERSION, NOYDB_KEYRING_VERSION, NOYDB_BACKUP_VERSION, NOYDB_SYNC_VERSION, createStore, } from './kernel/types.js'; export type { StoreAuthKind, StoreAuth, StoreCapabilities, StoreCredentials, StoreCredentialSource, } from './kernel/types.js'; export type { NoydbPodStore, NoydbBundleStore, BlobObject, SlotRecord, SlotInfo, VersionRecord, BlobPutOptions, BlobResponseOptions, } from './kernel/types.js'; export { BlobSet } from './with-shape/blobs/blob-set.js'; export { memoryObjectProjection } from './with-shape/blobs/object-projection.js'; export type { ObjectProjection, ObjectMeta, ObjectListEntry, PutObjectOptions, ObjectUrlOptions, PutUrlOptions, } from './with-shape/blobs/object-projection.js'; export { importExternalObjects } from './with-shape/blobs/import-external.js'; export type { ImportableCollection, ImportExternalOptions, ImportExternalResult, } from './with-shape/blobs/import-external.js'; export { BLOB_COLLECTION, BLOB_INDEX_COLLECTION, BLOB_CHUNKS_COLLECTION, BLOB_SLOTS_PREFIX, BLOB_VERSIONS_PREFIX, DEFAULT_CHUNK_SIZE, } from './with-shape/blobs/blob-set.js'; export { detectMimeType, detectMagic, isPreCompressed } from './with-shape/blobs/mime-magic.js'; export { BLOB_INTENT_COLLECTION, getIntent, createIntent, deleteIntent, sweepBlobIntents, } from './with-shape/blobs/blob-intent.js'; export type { BlobIntent, BlobIntentHold, BlobIntentResume } from './with-shape/blobs/blob-intent.js'; export { BlobIntentPendingError } from './kernel/errors.js'; export { wrapPodStore, createPodStore, wrapBundleStore, createBundleStore } from './with-pod/pod-store.js'; export type { WrappedPodNoydbStore, WrapPodStoreOptions, WrappedBundleNoydbStore, WrapBundleStoreOptions, } from './with-pod/pod-store.js'; export { readPlaintextRecord } from './kernel/debug.js'; export type { WriteQueue } from './kernel/write-queue.js'; export type { WriteEvent, WriteHook } from './port/with/write-hooks.js'; export type { SchemaIntrospection } from './with-shape/introspection/types.js'; export type { FieldMeta, SemanticType } from './with-shape/introspection/field-meta.js'; export type { CollectionMeta, VaultMeta } from './with-shape/introspection/meta.js'; export type { CollectionDescription, DescribedField, DescribeOptions } from './with-shape/introspection/describe.js'; export { applyListProjection, type ListProjectionOptions } from './with-shape/introspection/projection.js'; export type { DryRunResult, AffectedDocument, GuardViolation } from './with-commit/tx/dry-run.js'; export type { TabRole, TabPresence, TabCoordinationOptions, TabLockManager, TabChannel } from './with-party/tab-coordination.js'; export type { WriteConflict } from './kernel/types.js'; export type { SchemaDelta, FieldChange, UpdateContext, UpdateDecision, SchemaUpdateStrategy, } from './with-shape/schema-update/index.js'; export { blindUpdate, additiveOnly, lockSchema, coordinatedCutover } from './with-shape/schema-update/index.js'; export type { FenceState, FenceDoc } from './with-shape/schema-update/fence.js'; export type { SyncPolicy, PushPolicy, PullPolicy, PushMode, PullMode, SyncSchedulerStatus } from './kernel/sync-policy.js'; export { SyncScheduler, INDEXED_STORE_POLICY, POD_STORE_POLICY, BUNDLE_STORE_POLICY } from './kernel/sync-policy.js'; export type { SyncTarget, SyncTargetRole } from './kernel/types.js'; export { memoryStore } from './kernel/memory-store.js'; export { routeStore } from './with-store/route-store.js'; export type { RouteStoreOptions, RoutedNoydbStore, BlobStoreRoute, AgeRoute, BlobLifecyclePolicy, OverrideTarget, OverrideOptions, SuspendOptions, RouteStatus, } from './with-store/route-store.js'; export { wrapStore, withRetry, withLogging, withMetrics, withCircuitBreaker, withCache, withHealthCheck } from './with-store/store-middleware.js'; export type { StoreMiddleware, RetryOptions, LoggingOptions, LogLevel, MetricsOptions, StoreOperation, CircuitBreakerOptions, StoreCacheOptions, HealthCheckOptions, } from './with-store/store-middleware.js'; export { NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, PermissionDeniedError, PrivilegeEscalationError, StoreCapabilityError, ConflictError, NetworkError, NotFoundError, ValidationError, SchemaValidationError, GroupCardinalityError, BackupLedgerError, BackupCorruptedError, JoinTooLargeError, CrossJoinTooLargeError, CrossJoinSourceUnknownError, DanglingReferenceError, FilenameSanitizationError, PathEscapeError, ElevationExpiredError, AlreadyElevatedError, LedgerContentionError, SequenceContentionError, SequenceOfflineError, SequenceNotEnabledError, BundleIntegrityError, BundleSealMismatchError, PodVersionConflictError, BundleVersionConflictError, SessionExpiredError, SessionNotFoundError, SessionPolicyError, ExportCapabilityError, ImportCapabilityError, KeyringExpiredError, ReadOnlyAtInstantError, ReadOnlyFrameError, RecordLockedError, FieldFrozenError, IllegalTransitionError, InvariantError, AmendmentForbiddenError, AttestationError, AttestationNotEnabledError, ClassifiedNotEnabledError, TiersNotEnabledError, PortabilityNotEnabledError, SchemaUpdateError, NonAdditiveSchemaChangeError, SchemaLockedError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, } from './kernel/errors.js'; export { SnapshotNotFoundError } from './kernel/errors.js'; export type { SnapshotMeta, RetentionPolicy } from './with-fork/snapshots/strategy.js'; export { withArchive } from './with-fork/archive/index.js'; export type { ArchiveStrategy, WithArchiveOptions, ArchivePolicy, ArchiveResult, ArchiveRunOptions, } from './with-fork/archive/index.js'; export { SequenceStore, resolveSequenceKey, compileSequenceFormat } from './with-commit/sequence/index.js'; export type { SequenceHandle, FormattedSequenceHandle, NextOptions, SequenceOptions, SequenceStoreOptions } from './with-commit/sequence/index.js'; export { withSequence, NO_SEQUENCE } from './with-commit/sequence/index.js'; export type { SequenceStrategy } from './with-commit/sequence/index.js'; export { withDeferredNumbering } from './with-commit/numbering/descriptor.js'; export type { DeferredNumberingConfig } from './with-commit/numbering/descriptor.js'; export type { Assignment as NumberingAssignment } from './with-commit/numbering/index.js'; export { NumberingUncertaintyError } from './kernel/errors.js'; export type { StoreTime } from './kernel/types.js'; export { STATE_VAULT_NAME } from './kernel/constants.js'; export { UnknownShardError, ShardProvisioningError, VaultTemplateNotFoundError, ReservedVaultNameError, DataResidencyError } from './kernel/errors.js'; export { ForgetStrategyNotConfiguredError } from './kernel/errors.js'; export { SealedRecordExpiredError, SealedRecordMismatchError, RecordCekNotFoundError, SealedRecordNotEnabledError } from './kernel/errors.js'; export { DebugPlaintextError, DebugReservedFieldError } from './kernel/errors.js'; export { writePod, readPod, readPodHeader, writeNoydbBundle, readNoydbBundle, readNoydbBundleHeader, resetBrotliSupportCache, } from './with-pod/bundle.js'; export { exportAccessibleData } from './with-audit/portability/export-accessible.js'; export type { ExportAccessibleOptions } from './with-audit/portability/export-accessible.js'; export { withdrawAccessibleData } from './with-audit/portability/withdraw-accessible.js'; export type { WithdrawAccessibleOptions, WithdrawResult, FrozenSnapshotRef } from './with-audit/portability/withdraw-accessible.js'; export { requestWithdrawal, listWithdrawalRequests, approveWithdrawal, rejectWithdrawal, WithdrawalRequestError, } from './with-audit/portability/request-withdrawal.js'; export type { RequestWithdrawalOptions, RequestWithdrawalResult, WithdrawalRequest, WithdrawalRequestStatus, ApproveWithdrawalOptions, RejectWithdrawalOptions, } from './with-audit/portability/request-withdrawal.js'; export type { NoydbPodHeader, NoydbBundleHeader, CompressionAlgo, } from './with-pod/format.js'; export type { WritePodOptions, WriteNoydbBundleOptions, ReadNoydbBundleOptions, NoydbBundleReadResult, AutoCredentialKind, AutoCredential, } from './with-pod/bundle.js'; export { NOYDB_BUNDLE_MAGIC, NOYDB_BUNDLE_PREFIX_BYTES, NOYDB_BUNDLE_FORMAT_VERSION, hasNoydbBundleMagic, } from './with-pod/format.js'; export { generateULID, isULID } from './with-pod/ulid.js'; export { decryptExtractedPartition } from './with-cargo/decrypt-partition.js'; export type { DecryptedRecord } from './with-cargo/decrypt-partition.js'; export type { StandardSchemaV1, StandardSchemaV1SyncResult, StandardSchemaV1Issue, InferOutput, } from './kernel/schema.js'; export { validateSchemaInput, validateSchemaOutput } from './kernel/schema.js'; export type { VaultSchemaSnapshot, DumpSchemaOptions, CollectionDescriptor, CollectionConfig, CollectionStats, FieldDescriptor, FieldSource, MaterializedViewDescriptor, OverlayViewDescriptor, DerivationDescriptor, InternalCollectionStats, } from './with-shape/introspection/index.js'; export type { PersistedSchemaEnvelope, PersistedSchemaKind, PersistSchemaResult, } from './with-shape/persisted-schemas/index.js'; export { SCHEMAS_COLLECTION, derivePersistedSchema, isZodSchema, loadPersistedSchema, savePersistedSchema, persistSchemaIfNeeded, } from './with-shape/persisted-schemas/index.js'; export { VaultInstant, CollectionInstant } from './with-commit/history/time-machine.js'; export type { VaultEngine } from './with-commit/history/time-machine.js'; export { VaultFrame, CollectionFrame } from './with-fork/shadow/vault-frame.js'; export { CONSENT_AUDIT_COLLECTION } from './with-audit/consent/consent.js'; export type { ConsentContext, ConsentOp, ConsentAuditEntry, ConsentAuditFilter, } from './with-audit/consent/consent.js'; export { LedgerStore, LEDGER_COLLECTION, LEDGER_DELTAS_COLLECTION, envelopePayloadHash, canonicalJson, sha256Hex, hashEntry, paddedIndex, parseIndex, computePatch, applyPatch, } from './with-commit/history/ledger/index.js'; export type { LedgerEntry, AppendInput, VerifyResult, JsonPatch, JsonPatchOp, } from './with-commit/history/ledger/index.js'; export { ref, refArray, isRefArray, RefRegistry, RefIntegrityError, RefScopeError, } from './kernel/refs.js'; export type { RefMode, RefDescriptor, RefViolation, } from './kernel/refs.js'; export { isLinkCollectionName, LinkEndpointError, LinkIntegrityError, } from './with-shape/links/link-set.js'; export type { LinkSpec, LinkRow, LinkOnDelete, LinkSetHandle, } from './with-shape/links/link-set.js'; export type { UnlockedKeyring } from './with-party/team/keyring.js'; export { enrollAuthenticator, removeAuthenticator, findAuthenticator, } from './with-party/team/authenticators.js'; export type { EnrollAuthenticatorOptions, EnrollAuthenticatorWrappingKEKOptions, EnrollAuthenticatorWrappingDEKsOptions, UpdateAuthenticatorOptions, } from './with-party/team/authenticators.js'; export { QuickUnlockStore } from './with-party/session/unlock-state.js'; export type { QuickUnlockState } from './with-party/session/unlock-state.js'; export { rotatePassphrase as keyringRotatePassphrase, recoverPassphrase as keyringRecoverPassphrase, } from './with-party/team/rotate-recover.js'; export type { RotatePassphraseInput, RecoverPassphraseInput, RecoverPassphraseResult, RecoveryProof, SlotRewrapContext, SlotRewrapCeremony, } from './with-party/team/rotate-recover.js'; export { loadPublicEnvelope, savePublicEnvelope, readPublicEnvelope, resolveSchema as resolvePublicEnvelopeSchema, validatePublicEnvelopeInput, isPublicEnvelope, PUBLIC_ENVELOPE_FIELDS, DEFAULT_PUBLIC_ENVELOPE_SCHEMA, PUBLIC_ENVELOPE_RECORD_ID, } from './with-party/directory/public-envelope/index.js'; export type { PublicEnvelope, PublicEnvelopeText, PublicEnvelopeSchema, PublicEnvelopeField, ResolvedPublicEnvelopeSchema, SetPublicEnvelopeInput, } from './with-party/directory/public-envelope/index.js'; export { readNoydbBundlePublicEnvelope } from './with-pod/bundle.js'; export { USER_ENVELOPE_COLLECTION, USER_ENVELOPE_MAX_BYTES, } from './kernel/constants.js'; export { UserEnvelopeOversizedError } from './kernel/errors.js'; export { loadUserEnvelope, saveUserEnvelope, deleteUserEnvelope, listUserEnvelopeIds, } from './with-party/directory/user-envelope/index.js'; export type { UserEnvelope, DeepPartial, DeepPartialOrNull, Unsubscribe, LiveUserEnvelope, UserEnvelopePresented, UserEnvelopeCheckGate, } from './kernel/types.js'; export { UserApi } from './with-party/directory/user-envelope/api.js'; export { CustodyApi } from './with-party/custody/index.js'; export type { GrantCustodianOptions } from './with-party/custody/index.js'; export { liberateVault } from './with-party/custody/liberate.js'; export type { LiberateOptions, LiberateResult } from './with-party/custody/liberate.js'; export { withCustody, NO_CUSTODY } from './with-party/custody/index.js'; export type { CustodyStrategy, CustodyHost } from './with-party/custody/index.js'; export { CustodyNotEnabledError } from './kernel/errors.js'; export { createDeedOwner, loadDeedMarker, isDeedVault, DEED_RECORD_ID } from './with-party/team/deed.js'; export type { DeedMarker } from './with-party/team/deed.js'; export { withTeam } from './with-party/team/active.js'; export { NO_TEAM } from './with-party/team/strategy.js'; export type { TeamStrategy } from './with-party/team/strategy.js'; export { TeamNotEnabledError } from './kernel/errors.js'; export { withLazy } from './with-store/lazy/active.js'; export type { LazyStrategy } from './with-store/lazy/strategy.js'; export { describeAuthConfig, diagramAuthConfig, describeUserAuth, describeAllUsersAuth, } from './with-party/auth-introspection/index.js'; export { loadPaperRecoveryEntries, savePaperRecoveryEntries, burnPaperRecoveryEntry, hasRecoveryEnrolled, mintPaperRecoveryEntry, unwrapDeksFromPaperEntry, loadShamirRecoveryEntries, saveShamirRecoveryEntries, mintShamirRecoveryEntry, unwrapDeksFromShamirEntry, } from './with-party/team/recovery.js'; export type { PaperRecoveryEntry, PaperRecoveryDoc, ShamirRecoveryEntry, ShamirRecoveryDoc, } from './with-party/team/recovery.js'; export type { EnrollRecoveryResult, RotateRecoveryOptions, RotateRecoveryResult, } from './with-party/team/rotate-recover.js'; export { mintWrappedDeksBlob, unwrapDeksFromBlob } from './with-party/team/wrapped-deks.js'; export type { WrappedDeksBlob } from './with-party/team/wrapped-deks.js'; export type { SealingKeyProvider, SealedPassphrase, SealedEnvelope, RecipientHint, RecipientSealer } from './with-party/team/managed-passphrase.js'; export type { ShamirRecoveryProvider } from './with-party/team/shamir-recovery-provider.js'; export { MemorySealingKeyProvider, MemoryRecipientSealer, sealRsaOaepTlv, parseRsaOaepTlv, aesGcmOpen, loadSealedPassphrase, saveSealedPassphrase, parseSealedEnvelope, SEALED_PASSPHRASE_RECORD_ID, } from './with-party/team/managed-passphrase.js'; export { recoverUser } from './with-party/team/peer-recover.js'; export type { RecoverUserOptions } from './with-party/team/peer-recover.js'; export { hasExportCapability, evaluateExportCapability } from './with-party/team/keyring.js'; export { hasImportCapability, evaluateImportCapability } from './with-party/team/keyring.js'; export type { BundleRecipient } from './with-party/team/keyring.js'; export { buildRecipientKeyringFile } from './with-party/team/keyring.js'; export { listUsers, listUsersWithEnvelopes } from './with-party/team/keyring.js'; export type { ListUsersOptions } from './with-party/team/keyring.js'; export { readDirectoryConfig, persistDirectoryConfig, readUserVisibility, persistUserVisibility, deleteUserVisibility, visibilityRecordId, DIRECTORY_RECORD_ID, VISIBILITY_RECORD_PREFIX, } from './with-party/directory/index.js'; export type { DirectoryConfig, UserVisibility } from './with-party/directory/index.js'; export { DirectoryDisabledError } from './kernel/errors.js'; export { Noydb, createNoydb } from './kernel/noydb.js'; export { Vault } from './kernel/vault.js'; export { ElevatedHandle, ELEVATION_AUDIT_COLLECTION } from './with-commit/tx/elevated-handle.js'; export { Collection } from './kernel/collection.js'; export type { CacheOptions, CacheStats, CollectionChangeEvent } from './kernel/collection.js'; export type { CrdtMode, CrdtState, LwwMapState, RgaState, YjsState } from './with-commit/crdt/crdt.js'; export { resolveCrdtSnapshot, mergeCrdtStates } from './with-commit/crdt/crdt.js'; export { PresenceHandle } from './with-party/team/presence.js'; export type { PresencePeer } from './kernel/types.js'; export { derivePresenceKey } from './kernel/enclave/index.js'; export { SyncEngine } from './with-party/team/sync.js'; export { SyncTransaction } from './with-party/team/sync-transaction.js'; export { TxContext, TxVault, TxCollection, runTransaction } from './with-commit/tx/transaction.js'; export type { TxOp } from './kernel/types.js'; export type { TransactionInvariant } from './with-commit/tx/invariants.js'; export type { TransactionStrategyOptions } from './with-commit/tx/active.js'; export { withGuard } from './with-audit/guards/index.js'; export { immutableGuard } from './with-audit/guards/index.js'; export type { ImmutableGuardConfig } from './with-audit/guards/index.js'; export { transitionGuard } from './with-audit/guards/index.js'; export type { TransitionGuardConfig } from './with-audit/guards/index.js'; export type { GuardStrategy, GuardStrategyHandle, GuardContext, GuardChange, } from './with-audit/guards/index.js'; export { withDerivation } from './with-formula/derivations/index.js'; export { withRollup } from './with-formula/derivations/index.js'; export type { DerivationStrategy, DerivationStrategyHandle, DerivedFromMeta, OutputSpec, RecordOutputSpec, ArrayOutputSpec, } from './with-formula/derivations/index.js'; export { DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, } from './kernel/errors.js'; export { withMaterializedView } from './with-formula/materialized-views/index.js'; export type { MaterializedViewStrategy, MaterializedViewStrategyHandle, MaterializedViewOutput, MaterializedFromMeta, UnionSource, UnionArmJoin, } from './with-formula/materialized-views/index.js'; export { MaterializedViewCycleError, MaterializedViewConfigError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, } from './kernel/errors.js'; export { withOverlayedView } from './with-formula/overlay-views/index.js'; export type { OverlayedViewStrategy, OverlayedViewStrategyHandle, OverlayFieldMergeRule, OverlayFieldMergeMode, } from './with-formula/overlay-views/index.js'; export { OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError, } from './kernel/errors.js'; export { PERIODS_COLLECTION } from './with-audit/periods/index.js'; export type { PeriodRecord, ClosePeriodOptions, OpenPeriodOptions, } from './with-audit/periods/index.js'; export { PeriodClosedError } from './kernel/errors.js'; export { Lru, parseBytes, estimateRecordBytes } from './kernel/cache/index.js'; export type { LruOptions, LruStats } from './kernel/cache/index.js'; export { dictKey, isDictKeyDescriptor, staticDict, isStaticDictDescriptor, isDictCollectionName, dictCollectionName, DictionaryHandle, DICT_COLLECTION_PREFIX, } from './via/i18n/dictionary.js'; export type { DictKeyDescriptor, StaticDictDescriptor, DictEntry, DictionaryOptions, } from './via/i18n/dictionary.js'; export { i18nText, isI18nTextDescriptor, validateI18nTextValue, resolveI18nText, applyI18nLocale, } from './via/i18n/core.js'; export type { I18nTextOptions, I18nTextDescriptor, ResolveI18nOptions, I18nMap } from './via/i18n/core.js'; export { money, isMoneyDescriptor, MoneyPrecisionError, MoneyCurrencyError, MoneyUnsupportedError, scaleForCurrency, mulRate, allocate, asMoney, isMoneyString, moneyNumber, } from './via/money/index.js'; export type { MoneyDescriptor, MoneyOptions, MoneyOptionsFixed, MoneyOptionsMulti, RoundingMode, FxRates, MulRateOptions, AllocateOptions, MoneyString, } from './via/money/index.js'; export { via, isViaFieldSpec } from './kernel/via/compose.js'; export type { ViaFieldSpec } from './kernel/via/compose.js'; export type { ViaPosture, ViaDescriptor } from './kernel/via/index.js'; export type { DerivationSkippedFrozen } from './kernel/via/dispatch.js'; export { classified, luhnCheck, isClassifiedFieldSpec, isClassifiedGroup, resolveClassifiedFields, ClassifiedConfigError, ClassifiedNeverStoredError, ClassifiedValidationError, ClassifiedRevealError, ClassifiedVerifyError, ClassifiedRotationError } from './via/classified/index.js'; export type { ClassifiedFieldSpec, ClassifiedGroup, ClassifiedEntry, ClassifiedList, ClassifiedStorage, ClassifiedVerdict } from './via/classified/index.js'; export { evalComputedFields, ComputedFieldError } from './with-formula/computed/index.js'; export type { ComputedFields, ComputedFn, ComputedFieldEntry } from './with-formula/computed/index.js'; export { computed, isComputedDescriptor } from './via/computed/descriptor.js'; export type { ComputedDescriptor } from './via/computed/descriptor.js'; export { resolvePolicy } from './via/i18n/policy.js'; export type { OnMissing, Layer, OnMissingPolicy } from './via/i18n/policy.js'; export { inferScripts, enforceScript } from './via/i18n/script.js'; export type { ScriptWarning } from './via/i18n/script.js'; export { ReservedCollectionNameError, DictKeyMissingError, DictKeyInUseError, MissingTranslationError, LocaleNotSpecifiedError, TranslatorNotConfiguredError, ScriptViolationError, StaticDictReadonlyError, UnknownDictCodeError, } from './kernel/errors.js'; export { lookup, dict, enumOf, enum } from './via/lookup/index.js'; export { UnknownLookupKeyError, RestrictRefUnresolvableError } from './kernel/errors.js'; export type { LookupDescriptor, Vocabulary, OnDelete } from './via/lookup/index.js'; export type { LocaleReadOptions } from './kernel/types.js'; export { putCredential, getCredential, deleteCredential, listCredentials, credentialStatus, SYNC_CREDENTIALS_COLLECTION, } from './with-party/team/sync-credentials.js'; export type { SyncCredential } from './with-party/team/sync-credentials.js'; export { PolicyEnforcer, createEnforcer, validateSessionPolicy } from './with-party/session/session-policy.js'; export { createSession, resolveSession, revokeSession, revokeAllSessions, isSessionAlive, activeSessionCount, } from './with-party/session/session.js'; export type { SessionToken, CreateSessionResult, CreateSessionOptions, } from './with-party/session/session.js'; export { enableDevUnlock, loadDevUnlock, clearDevUnlock, isDevUnlockActive, } from './with-party/session/dev-unlock.js'; export type { DevUnlockOptions } from './with-party/session/dev-unlock.js'; export { isDiscriminant } from './kernel/util/discriminant.js'; export { bufferToBase64, base64ToBuffer, encryptBytes, decryptBytes } from './kernel/enclave/index.js'; export { encryptDeterministic, decryptDeterministic } from './kernel/enclave/index.js'; export { EnclaveNotSupportedError } from './kernel/errors.js'; export type { GhostRecord, TierMode, CrossTierAccessEvent } from './kernel/types.js'; export { TierNotGrantedError, TierDemoteDeniedError, DelegationTargetMissingError, TierWriteRefusedError, UnsupportedTierCompositionError } from './kernel/errors.js'; export { IndexRequiredError, IndexWriteFailureError } from './kernel/errors.js'; export { FieldNotQueryableError } from './kernel/errors.js'; export { fuseRetrieval, type FuseOptions } from './with-lookup/search/fuse.js'; export { UniqueConstraintError, UnsupportedIndexOptionError } from './kernel/errors.js'; export { EmbeddingDimMismatchError, EmbeddingModelMismatchError } from './kernel/errors.js'; export type { EmbeddingDescriptor } from './with-lookup/embeddings/index.js'; export { dekKey, effectiveClearance, assertTierAccess } from './with-party/team/tiers.js'; export type { DelegationToken, IssueDelegationOptions } from './with-party/team/delegation.js'; export { DELEGATIONS_COLLECTION, issueDelegation, loadActiveDelegations, revokeDelegation } from './with-party/team/delegation.js'; export type { MagicLinkGrantPayload, MagicLinkGrantRecord, IssueMagicLinkGrantOptions, } from './with-party/team/magic-link-grant.js'; export { MAGIC_LINK_GRANTS_COLLECTION, MAGIC_LINK_CONTENT_INFO_PREFIX, MAGIC_LINK_KEK_INFO_PREFIX, deriveMagicLinkContentKey, writeMagicLinkGrant, readMagicLinkGrantRecord, listMagicLinkGrants, unwrapMagicLinkGrant, revokeMagicLinkGrant, magicLinkGrantRecordId, isMagicLinkGrantExpired, } from './with-party/team/magic-link-grant.js'; export { diff, formatDiff } from './with-commit/history/diff.js'; export type { DiffEntry, ChangeType } from './with-commit/history/diff.js'; export { diffVault } from './with-cargo/vault-diff.js'; export type { VaultDiff, VaultDiffEntry, VaultDiffModifiedEntry, DiffOptions, DiffCandidate, } from './with-cargo/vault-diff.js'; export { withCargo, NO_CARGO } from './with-cargo/index.js'; export type { CargoStrategy } from './with-cargo/index.js'; export { CargoNotEnabledError } from './kernel/errors.js'; export { PERSONAL_POLICY, STRICT_POLICY, mergePolicy, checkGate, describeGate, DEFAULT_FRESHNESS_MS, loadVaultPolicy, saveVaultPolicy, META_COLLECTION, POLICY_RECORD_ID, } from './with-party/policy/index.js'; export { PolicyDeniedError, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, ManagedRecoveryNotEnrolledError, } from './kernel/errors.js'; export type { VaultPolicy, GatePolicy, GateName, BuiltInGateName, FactorKind, FactorRequirement, FactorProof, FactorProofBundle, WarningRules, ActiveTier, } from './kernel/types.js'; export type { PolicyDenyReason } from './kernel/errors.js'; export type { CheckGateContext } from './with-party/policy/index.js'; export { validatePassphrase, assertStrongPassphrase, estimateEntropy, WeakPassphraseError, } from './kernel/validation.js'; export type { PassphrasePolicy, PassphraseValidationResult, WeakPassphraseReason, } from './kernel/validation.js'; export { Query, executePlan, evaluateClause, evaluateFieldClause, readPath, CollectionIndexes, applyJoins, DEFAULT_JOIN_MAX_ROWS, DEFAULT_CROSS_JOIN_MAX_ROWS, resetJoinWarnings, buildLiveQuery, count, sum, avg, min, max, moneySum, moneyMin, moneyMax, reducerBuilder, Aggregation, reduceRecords, GroupedQuery, GroupedQueryN, GroupedAggregation, groupAndReduce, GROUPBY_WARN_CARDINALITY, GROUPBY_MAX_CARDINALITY, ScanBuilder, } from './kernel/query/index.js'; export type { QueryPlan, QuerySource, OrderBy, Operator, Clause, FieldClause, FilterClause, GroupClause, IndexDef, HashIndex, JoinLeg, JoinContext, JoinableSource, JoinStrategy, LiveQuery, LiveUpstream, Reducer, ReducerOptions, ReducerBuilder, AggregateSpec, AggregateResult, AggregationUpstream, LiveAggregation, GroupedRow, GroupedRowN, ScanPageProvider, } from './kernel/query/index.js'; export type { QueryField, IndexFieldName } from './kernel/types.js'; export type { Sealed, SealedView } from './kernel/types.js'; export { SealedHandle } from './kernel/types.js'; export { tokenize } from './with-lookup/search/index.js'; export type { Tokenizer, SearchOptions, SearchResult, SearchEntry } from './with-lookup/search/index.js'; export type { RetrieveOptions, RetrieveHit } from './with-lookup/search/index.js'; export { withSearch, NO_SEARCH } from './with-lookup/search/index.js'; export type { SearchStrategy } from './with-lookup/search/index.js'; export { SearchNotEnabledError } from './kernel/errors.js'; export { PersistedIndexCompensationError } from './kernel/errors.js';