@noy-db/hub 0.1.0-pre.5 → 0.1.0-pre.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +2 -2
- package/dist/blobs/index.d.ts +2 -2
- package/dist/blobs/index.js +2 -2
- package/dist/bundle/index.d.cts +2 -2
- package/dist/bundle/index.d.ts +2 -2
- package/dist/bundle/index.js +3 -3
- package/dist/{chunk-QUDXYI4W.js → chunk-3WCRU7TI.js} +2 -2
- package/dist/{chunk-6NPQTBZN.js → chunk-6IJQ27XN.js} +112 -4
- package/dist/chunk-6IJQ27XN.js.map +1 -0
- package/dist/{chunk-NXUVITPB.js → chunk-B6HF6NTZ.js} +1 -1
- package/dist/{chunk-NXUVITPB.js.map → chunk-B6HF6NTZ.js.map} +1 -1
- package/dist/{chunk-H3DV46AQ.js → chunk-CL37QSND.js} +2 -2
- package/dist/{chunk-LRN3PNI6.js → chunk-FAAWLVTF.js} +2 -2
- package/dist/{chunk-UQQ2XFXI.js → chunk-GILMPJXB.js} +2 -2
- package/dist/{chunk-MIRZMUSQ.js → chunk-INSJBB5W.js} +3 -3
- package/dist/{chunk-E4OOAPBZ.js → chunk-KPF2HHPI.js} +2 -2
- package/dist/{chunk-LMKOSLJY.js → chunk-N2LMZKLR.js} +2 -2
- package/dist/{chunk-QV4WLLKB.js → chunk-NZ4XCIKS.js} +3 -3
- package/dist/consent/index.d.cts +2 -2
- package/dist/consent/index.d.ts +2 -2
- package/dist/{dev-unlock-BgFqShBi.d.ts → dev-unlock-CcJ1qIi7.d.ts} +1 -1
- package/dist/{dev-unlock-qVMxG2Je.d.cts → dev-unlock-Dk14V6lX.d.cts} +1 -1
- package/dist/{hash-BhoL7iUE.d.ts → hash-1Xsqx1jl.d.ts} +1 -1
- package/dist/{hash-Bpvl2eSe.d.cts → hash-h_2U3TFb.d.cts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +3 -3
- package/dist/history/index.d.ts +3 -3
- package/dist/history/index.js +2 -2
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +3 -3
- package/dist/{index-DyRt_5vM.d.cts → index-Cvb0efA_.d.cts} +1 -1
- package/dist/{index-DhK_zqOO.d.ts → index-DZn6Yick.d.ts} +1 -1
- package/dist/index.cjs +505 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -6
- package/dist/index.d.ts +60 -6
- package/dist/index.js +409 -13
- package/dist/index.js.map +1 -1
- package/dist/{ledger-GA4DMJS6.js → ledger-5V67MAIL.js} +3 -3
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +2 -2
- package/dist/periods/index.d.ts +2 -2
- package/dist/periods/index.js +3 -3
- package/dist/{public-envelope-R4EIEQE6.js → public-envelope-DFJZHXVH.js} +3 -3
- package/dist/session/index.d.cts +3 -3
- package/dist/session/index.d.ts +3 -3
- package/dist/shadow/index.d.cts +2 -2
- package/dist/shadow/index.d.ts +2 -2
- package/dist/store/index.d.cts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +1 -1
- package/dist/sync/index.d.ts +1 -1
- package/dist/sync/index.js +2 -2
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +2 -2
- package/dist/team/index.d.ts +2 -2
- package/dist/team/index.js +4 -4
- package/dist/tx/index.d.cts +2 -2
- package/dist/tx/index.d.ts +2 -2
- package/dist/{types-Df72wWCC.d.ts → types-D-6bmD2c.d.ts} +378 -2
- package/dist/{types-BpyE4o_n.d.cts → types-D3QLmhlk.d.cts} +378 -2
- package/package.json +1 -1
- package/dist/chunk-6NPQTBZN.js.map +0 -1
- /package/dist/{chunk-QUDXYI4W.js.map → chunk-3WCRU7TI.js.map} +0 -0
- /package/dist/{chunk-H3DV46AQ.js.map → chunk-CL37QSND.js.map} +0 -0
- /package/dist/{chunk-LRN3PNI6.js.map → chunk-FAAWLVTF.js.map} +0 -0
- /package/dist/{chunk-UQQ2XFXI.js.map → chunk-GILMPJXB.js.map} +0 -0
- /package/dist/{chunk-MIRZMUSQ.js.map → chunk-INSJBB5W.js.map} +0 -0
- /package/dist/{chunk-E4OOAPBZ.js.map → chunk-KPF2HHPI.js.map} +0 -0
- /package/dist/{chunk-LMKOSLJY.js.map → chunk-N2LMZKLR.js.map} +0 -0
- /package/dist/{chunk-QV4WLLKB.js.map → chunk-NZ4XCIKS.js.map} +0 -0
- /package/dist/{ledger-GA4DMJS6.js.map → ledger-5V67MAIL.js.map} +0 -0
- /package/dist/{public-envelope-R4EIEQE6.js.map → public-envelope-DFJZHXVH.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,72 @@
|
|
|
1
|
-
import { at as NoydbStore, aR as
|
|
2
|
-
export {
|
|
1
|
+
import { at as NoydbStore, aR as UserEnvelope, aS as PublicEnvelope, aT as GateName, aU as GatePolicy, aV as VaultPolicy, aW as ActiveTier, aX as FactorProof, ar as UnlockedKeyring, aY as Vault, aA as DiffEntry } from './types-D3QLmhlk.cjs';
|
|
2
|
+
export { aZ as AccessibleVault, ax as AppendInput, p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, a_ as BUNDLE_STORE_POLICY, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, a$ as BuiltInGateName, b0 as BundleRecipient, _ as CONSENT_AUDIT_COLLECTION, b1 as CacheOptions, b2 as CacheStats, b3 as ChangeEvent, ay as ChangeType, a7 as ClosePeriodOptions, b4 as Collection, b5 as CollectionChangeEvent, b6 as CollectionConflictResolver, ai as CollectionFrame, az as CollectionInstant, b7 as Conflict, b8 as ConflictPolicy, b9 as ConflictStrategy, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, ba as CrossTierAccessEvent, L as DEFAULT_CHUNK_SIZE, bb as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, bc as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, bd as DeepPartial, be as DelegationToken, bf as DeleteManyResult, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, bg as DirtyEntry, bh as ELEVATION_AUDIT_COLLECTION, bi as ElevatedHandle, av as EncryptedEnvelope, bj as EnrollAuthenticatorOptions, bk as ExportCapability, bl as ExportChunk, bm as ExportFormat, bn as ExportStreamOptions, bo as FactorKind, bp as FactorRequirement, bq as GhostRecord, br as GrantOptions, bs as HistoryConfig, bt as HistoryEntry, au as HistoryOptions, e as I18nTextDescriptor, f as I18nTextOptions, bu as INDEXED_STORE_POLICY, bv as ImportCapability, bw as InferOutput, bx as IssueDelegationOptions, by as IssueMagicLinkGrantOptions, aB as JsonPatch, aC as JsonPatchOp, bz as KeyringAuthenticator, bA as KeyringFile, aD as LedgerEntry, aE as LedgerStore, bB as ListAccessibleVaultsOptions, bC as ListPageResult, bD as LiveUserEnvelope, bE as LocaleReadOptions, bF as Lru, bG as LruOptions, bH as LruStats, bI as MAGIC_LINK_CONTENT_INFO_PREFIX, bJ as MAGIC_LINK_GRANTS_COLLECTION, bK as MAGIC_LINK_KEK_INFO_PREFIX, bL as MagicLinkGrantPayload, bM as MagicLinkGrantRecord, bN as NOYDB_BACKUP_VERSION, bO as NOYDB_FORMAT_VERSION, bP as NOYDB_KEYRING_VERSION, bQ as NOYDB_SYNC_VERSION, bR as Noydb, bS as NoydbBundleStore, bT as NoydbEventMap, bU as NoydbOptions, a8 as OpenPeriodOptions, a9 as PERIODS_COLLECTION, bV as PUBLIC_ENVELOPE_FIELDS, bW as PaperRecoveryDoc, bX as PaperRecoveryEntry, bY as PassphrasePolicy, bZ as PassphraseValidationResult, aa as PeriodRecord, b_ as Permission, b$ as Permissions, c0 as PlaintextTranslatorContext, c1 as PlaintextTranslatorFn, P as PolicyEnforcer, c2 as PresenceHandle, c3 as PresencePeer, aw as PruneOptions, c4 as PublicEnvelopeField, c5 as PublicEnvelopeSchema, c6 as PublicEnvelopeText, c7 as PullMode, c8 as PullOptions, c9 as PullPolicy, ca as PullResult, cb as PushMode, cc as PushOptions, cd as PushPolicy, ce as PushResult, cf as PutManyItemOptions, cg as PutManyOptions, ch as PutManyResult, ci as QueryAcrossOptions, cj as QueryAcrossResult, ck as QuickUnlockState, cl as QuickUnlockStore, cm as ReAuthOperation, cn as RecoverPassphraseInput, co as RecoveryProof, cp as ResolvedPublicEnvelopeSchema, cq as RevokeOptions, aq as Role, cr as RotatePassphraseInput, cs as SessionPolicy, ct as SetPublicEnvelopeInput, U as SlotInfo, V as SlotRecord, cu as StandardSchemaV1, cv as StandardSchemaV1Issue, cw as StandardSchemaV1SyncResult, cx as StoreAuth, cy as StoreAuthKind, cz as StoreCapabilities, cA as SyncEngine, cB as SyncMetadata, cC as SyncPolicy, cD as SyncScheduler, cE as SyncSchedulerStatus, cF as SyncStatus, cG as SyncTarget, cH as SyncTargetRole, cI as SyncTransaction, cJ as SyncTransactionResult, cK as TierMode, cL as TranslatorAuditEntry, al as TxCollection, am as TxContext, cM as TxOp, an as TxVault, cN as USER_ENVELOPE_COLLECTION, cO as USER_ENVELOPE_MAX_BYTES, cP as Unsubscribe, cQ as UserApi, cR as UserEnvelopeCheckGate, cS as UserEnvelopeOversizedError, cT as UserEnvelopePresented, cU as UserInfo, cV as VaultBackup, aF as VaultEngine, aj as VaultFrame, aG as VaultInstant, cW as VaultPolicyOnDisk, cX as VaultSnapshot, aH as VerifyResult, W as VersionRecord, cY as WarningRules, cZ as WeakPassphraseError, c_ as WeakPassphraseReason, g as applyI18nLocale, aI as applyPatch, c$ as assertStrongPassphrase, d0 as buildRecipientKeyringFile, d1 as burnPaperRecoveryEntry, aJ as canonicalJson, aK as computePatch, n as createEnforcer, d2 as createNoydb, d3 as createStore, d4 as deriveMagicLinkContentKey, h as dictCollectionName, i as dictKey, aL as diff, d5 as enrollAuthenticator, d6 as estimateEntropy, d7 as evaluateExportCapability, d8 as evaluateImportCapability, d9 as findAuthenticator, aM as formatDiff, da as hasExportCapability, db as hasImportCapability, dc as hasRecoveryEnrolled, aN as hashEntry, j as i18nText, k as isDictCollectionName, l as isDictKeyDescriptor, m as isI18nTextDescriptor, dd as isMagicLinkGrantExpired, de as isPublicEnvelope, df as issueDelegation, dg as keyringRecoverPassphrase, dh as keyringRotatePassphrase, di as listMagicLinkGrants, dj as listUsers, dk as listUsersWithEnvelopes, dl as loadActiveDelegations, dm as loadPaperRecoveryEntries, dn as magicLinkGrantRecordId, aO as paddedIndex, aP as parseIndex, dp as readMagicLinkGrantRecord, dq as removeAuthenticator, r as resolveI18nText, dr as resolvePublicEnvelopeSchema, ds as revokeDelegation, dt as revokeMagicLinkGrant, ao as runTransaction, du as savePaperRecoveryEntries, aQ as sha256Hex, dv as unwrapMagicLinkGrant, v as validateI18nTextValue, dw as validatePassphrase, dx as validatePublicEnvelopeInput, dy as validateSchemaInput, dz as validateSchemaOutput, o as validateSessionPolicy, dA as writeMagicLinkGrant } from './types-D3QLmhlk.cjs';
|
|
3
3
|
export { d as detectMagic, a as detectMimeType, i as isPreCompressed } from './mime-magic-CBBSOkjm.cjs';
|
|
4
4
|
export { AgeRoute, BlobLifecyclePolicy, BlobStoreRoute, CircuitBreakerOptions, HealthCheckOptions, LogLevel, LoggingOptions, MetricsOptions, OverrideOptions, OverrideTarget, RetryOptions, RouteStatus, RouteStoreOptions, RoutedNoydbStore, StoreCacheOptions, StoreMiddleware, StoreOperation, SuspendOptions, WrapBundleStoreOptions, WrappedBundleNoydbStore, createBundleStore, routeStore, withCache, withCircuitBreaker, withHealthCheck, withLogging, withMetrics, withRetry, wrapBundleStore, wrapStore } from './store/index.cjs';
|
|
5
5
|
import { N as NoydbError } from './index-6xNpPsxR.cjs';
|
|
6
6
|
export { A as AlreadyElevatedError, B as BackupCorruptedError, a as BackupLedgerError, b as BundleIntegrityError, c as BundleVersionConflictError, C as ConflictError, D as DEFAULT_JOIN_MAX_ROWS, d as DanglingReferenceError, e as DecryptionError, f as DelegationTargetMissingError, g as DictKeyInUseError, h as DictKeyMissingError, E as ElevationExpiredError, i as ExportCapabilityError, F as FilenameSanitizationError, G as GroupCardinalityError, I as ImportCapabilityError, j as IndexRequiredError, k as IndexWriteFailureError, l as InvalidKeyError, J as JoinContext, m as JoinLeg, n as JoinStrategy, o as JoinTooLargeError, p as JoinableSource, K as KeyringExpiredError, L as LedgerContentionError, q as LiveQuery, r as LiveUpstream, s as LocaleNotSpecifiedError, M as MissingTranslationError, t as NetworkError, u as NoAccessError, v as NotFoundError, O as OrderBy, P as PathEscapeError, w as PeriodClosedError, x as PermissionDeniedError, y as PrivilegeEscalationError, Q as Query, z as QueryPlan, H as QuerySource, R as ReadOnlyAtInstantError, S as ReadOnlyError, T as ReadOnlyFrameError, U as RefDescriptor, V as RefIntegrityError, W as RefMode, X as RefRegistry, Y as RefScopeError, Z as RefViolation, _ as ReservedCollectionNameError, $ as ScanBuilder, a0 as ScanPageProvider, a1 as SchemaValidationError, a2 as SessionExpiredError, a3 as SessionNotFoundError, a4 as SessionPolicyError, a5 as StoreCapabilityError, a6 as TamperedError, a7 as TierDemoteDeniedError, a8 as TierNotGrantedError, a9 as TranslatorNotConfiguredError, aa as ValidationError, ab as applyJoins, ac as buildLiveQuery, ad as executePlan, ae as ref, af as resetJoinWarnings } from './index-6xNpPsxR.cjs';
|
|
7
|
-
export { C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, a as NOYDB_BUNDLE_MAGIC, b as NOYDB_BUNDLE_PREFIX_BYTES, c as NoydbBundleHeader, d as NoydbBundleReadResult, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, e as readNoydbBundleHeader, f as readNoydbBundlePublicEnvelope, j as resetBrotliSupportCache, w as writeNoydbBundle } from './index-
|
|
7
|
+
export { C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, a as NOYDB_BUNDLE_MAGIC, b as NOYDB_BUNDLE_PREFIX_BYTES, c as NoydbBundleHeader, d as NoydbBundleReadResult, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, e as readNoydbBundleHeader, f as readNoydbBundlePublicEnvelope, j as resetBrotliSupportCache, w as writeNoydbBundle } from './index-Cvb0efA_.cjs';
|
|
8
8
|
export { a as CrdtMode, b as CrdtState, L as LwwMapState, R as RgaState, Y as YjsState, m as mergeCrdtStates, r as resolveCrdtSnapshot } from './strategy-BSxFXGzb.cjs';
|
|
9
9
|
export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.cjs';
|
|
10
|
-
export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-
|
|
10
|
+
export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-Dk14V6lX.cjs';
|
|
11
11
|
export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from './predicate-SBHmi6D0.cjs';
|
|
12
12
|
export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedRow, L as LiveAggregation, R as Reducer, i as ReducerOptions, j as avg, l as count, m as groupAndReduce, n as max, o as min, r as reduceRecords, s as sum } from './strategy-D-SrOLCl.cjs';
|
|
13
|
-
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-
|
|
13
|
+
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-h_2U3TFb.cjs';
|
|
14
14
|
import './lazy-builder-CZVLKh0Z.cjs';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Persistence helpers for per-principal user envelopes stored at
|
|
18
|
+
* `_users/<keyringId>` (logically: `_meta/user/<keyringId>`).
|
|
19
|
+
*
|
|
20
|
+
* Unlike `_meta/policy` and `_meta/handle` which are plaintext, user
|
|
21
|
+
* envelopes carry user data and are encrypted with a dedicated
|
|
22
|
+
* {@link USER_ENVELOPE_COLLECTION} DEK (provisioned at vault open and
|
|
23
|
+
* propagated to every keyring via the system-collection DEK path in
|
|
24
|
+
* `team/keyring.ts`).
|
|
25
|
+
*
|
|
26
|
+
* This module is the **storage primitive** layer. The public API
|
|
27
|
+
* (`vault.user.*`) sits on top of this; permission gates, own-only
|
|
28
|
+
* write enforcement, and presence-channel propagation live there.
|
|
29
|
+
*
|
|
30
|
+
* @see docs/superpowers/specs/2026-05-05-user-envelope-design.md
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Read and decrypt the user envelope for `keyringId`. Returns `null`
|
|
37
|
+
* when no envelope has been persisted (either the principal has never
|
|
38
|
+
* called `updateMe`, or the keyring predates this feature).
|
|
39
|
+
*
|
|
40
|
+
* Decryption errors propagate — a tampered or wrong-keyed envelope
|
|
41
|
+
* surfaces as the underlying crypto error rather than masquerading as
|
|
42
|
+
* "not found".
|
|
43
|
+
*/
|
|
44
|
+
declare function loadUserEnvelope<T = unknown>(store: NoydbStore, vault: string, keyringId: string, dek: CryptoKey): Promise<UserEnvelope<T> | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Encrypt and persist the user envelope for `keyringId`. The new
|
|
47
|
+
* version is `(prior._v ?? 0) + 1`. Pass `expectedVersion` to enable
|
|
48
|
+
* optimistic-concurrency checks: a mismatch with the stored version
|
|
49
|
+
* throws {@link ConflictError} with the actual stored version.
|
|
50
|
+
*
|
|
51
|
+
* `expectedVersion: 0` means "expect no prior envelope"; the write
|
|
52
|
+
* succeeds only if no envelope exists yet.
|
|
53
|
+
*
|
|
54
|
+
* Soft-caps the JSON-serialized payload at {@link USER_ENVELOPE_MAX_BYTES};
|
|
55
|
+
* larger payloads throw {@link UserEnvelopeOversizedError}.
|
|
56
|
+
*/
|
|
57
|
+
declare function saveUserEnvelope<T>(store: NoydbStore, vault: string, keyringId: string, payload: T, dek: CryptoKey, expectedVersion?: number): Promise<UserEnvelope<T>>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete the user envelope for `keyringId`. Idempotent — no error if
|
|
60
|
+
* the envelope is already absent. Called from the keyring revoke path
|
|
61
|
+
* (cascade-delete) and is a no-op for keyrings that never wrote.
|
|
62
|
+
*/
|
|
63
|
+
declare function deleteUserEnvelope(store: NoydbStore, vault: string, keyringId: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* List the keyring ids that have a user envelope persisted in `vault`.
|
|
66
|
+
* Order is store-defined — callers that need a stable order should sort.
|
|
67
|
+
*/
|
|
68
|
+
declare function listUserEnvelopeIds(store: NoydbStore, vault: string): Promise<string[]>;
|
|
69
|
+
|
|
16
70
|
/**
|
|
17
71
|
* Cache policy helpers — parse human-friendly byte budgets into raw numbers.
|
|
18
72
|
*
|
|
@@ -508,4 +562,4 @@ type DiffCandidate<T = unknown> = Vault | Record<string, readonly T[]> | string;
|
|
|
508
562
|
*/
|
|
509
563
|
declare function diffVault<T = unknown>(vault: Vault, candidate: DiffCandidate<T>, options?: DiffOptions): Promise<VaultDiff<T>>;
|
|
510
564
|
|
|
511
|
-
export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, type DiffCandidate, DiffEntry, type DiffOptions, FactorProof, GateName, GatePolicy, META_COLLECTION, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, STRICT_POLICY, UnlockedKeyring, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, loadPublicEnvelope, loadVaultPolicy, mergePolicy, parseBytes, readPublicEnvelope, savePublicEnvelope, saveVaultPolicy };
|
|
565
|
+
export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, type DiffCandidate, DiffEntry, type DiffOptions, FactorProof, GateName, GatePolicy, META_COLLECTION, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, STRICT_POLICY, UnlockedKeyring, UserEnvelope, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, deleteUserEnvelope, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, listUserEnvelopeIds, loadPublicEnvelope, loadUserEnvelope, loadVaultPolicy, mergePolicy, parseBytes, readPublicEnvelope, savePublicEnvelope, saveUserEnvelope, saveVaultPolicy };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,72 @@
|
|
|
1
|
-
import { at as NoydbStore, aR as
|
|
2
|
-
export {
|
|
1
|
+
import { at as NoydbStore, aR as UserEnvelope, aS as PublicEnvelope, aT as GateName, aU as GatePolicy, aV as VaultPolicy, aW as ActiveTier, aX as FactorProof, ar as UnlockedKeyring, aY as Vault, aA as DiffEntry } from './types-D-6bmD2c.js';
|
|
2
|
+
export { aZ as AccessibleVault, ax as AppendInput, p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, a_ as BUNDLE_STORE_POLICY, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, a$ as BuiltInGateName, b0 as BundleRecipient, _ as CONSENT_AUDIT_COLLECTION, b1 as CacheOptions, b2 as CacheStats, b3 as ChangeEvent, ay as ChangeType, a7 as ClosePeriodOptions, b4 as Collection, b5 as CollectionChangeEvent, b6 as CollectionConflictResolver, ai as CollectionFrame, az as CollectionInstant, b7 as Conflict, b8 as ConflictPolicy, b9 as ConflictStrategy, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, ba as CrossTierAccessEvent, L as DEFAULT_CHUNK_SIZE, bb as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, bc as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, bd as DeepPartial, be as DelegationToken, bf as DeleteManyResult, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, bg as DirtyEntry, bh as ELEVATION_AUDIT_COLLECTION, bi as ElevatedHandle, av as EncryptedEnvelope, bj as EnrollAuthenticatorOptions, bk as ExportCapability, bl as ExportChunk, bm as ExportFormat, bn as ExportStreamOptions, bo as FactorKind, bp as FactorRequirement, bq as GhostRecord, br as GrantOptions, bs as HistoryConfig, bt as HistoryEntry, au as HistoryOptions, e as I18nTextDescriptor, f as I18nTextOptions, bu as INDEXED_STORE_POLICY, bv as ImportCapability, bw as InferOutput, bx as IssueDelegationOptions, by as IssueMagicLinkGrantOptions, aB as JsonPatch, aC as JsonPatchOp, bz as KeyringAuthenticator, bA as KeyringFile, aD as LedgerEntry, aE as LedgerStore, bB as ListAccessibleVaultsOptions, bC as ListPageResult, bD as LiveUserEnvelope, bE as LocaleReadOptions, bF as Lru, bG as LruOptions, bH as LruStats, bI as MAGIC_LINK_CONTENT_INFO_PREFIX, bJ as MAGIC_LINK_GRANTS_COLLECTION, bK as MAGIC_LINK_KEK_INFO_PREFIX, bL as MagicLinkGrantPayload, bM as MagicLinkGrantRecord, bN as NOYDB_BACKUP_VERSION, bO as NOYDB_FORMAT_VERSION, bP as NOYDB_KEYRING_VERSION, bQ as NOYDB_SYNC_VERSION, bR as Noydb, bS as NoydbBundleStore, bT as NoydbEventMap, bU as NoydbOptions, a8 as OpenPeriodOptions, a9 as PERIODS_COLLECTION, bV as PUBLIC_ENVELOPE_FIELDS, bW as PaperRecoveryDoc, bX as PaperRecoveryEntry, bY as PassphrasePolicy, bZ as PassphraseValidationResult, aa as PeriodRecord, b_ as Permission, b$ as Permissions, c0 as PlaintextTranslatorContext, c1 as PlaintextTranslatorFn, P as PolicyEnforcer, c2 as PresenceHandle, c3 as PresencePeer, aw as PruneOptions, c4 as PublicEnvelopeField, c5 as PublicEnvelopeSchema, c6 as PublicEnvelopeText, c7 as PullMode, c8 as PullOptions, c9 as PullPolicy, ca as PullResult, cb as PushMode, cc as PushOptions, cd as PushPolicy, ce as PushResult, cf as PutManyItemOptions, cg as PutManyOptions, ch as PutManyResult, ci as QueryAcrossOptions, cj as QueryAcrossResult, ck as QuickUnlockState, cl as QuickUnlockStore, cm as ReAuthOperation, cn as RecoverPassphraseInput, co as RecoveryProof, cp as ResolvedPublicEnvelopeSchema, cq as RevokeOptions, aq as Role, cr as RotatePassphraseInput, cs as SessionPolicy, ct as SetPublicEnvelopeInput, U as SlotInfo, V as SlotRecord, cu as StandardSchemaV1, cv as StandardSchemaV1Issue, cw as StandardSchemaV1SyncResult, cx as StoreAuth, cy as StoreAuthKind, cz as StoreCapabilities, cA as SyncEngine, cB as SyncMetadata, cC as SyncPolicy, cD as SyncScheduler, cE as SyncSchedulerStatus, cF as SyncStatus, cG as SyncTarget, cH as SyncTargetRole, cI as SyncTransaction, cJ as SyncTransactionResult, cK as TierMode, cL as TranslatorAuditEntry, al as TxCollection, am as TxContext, cM as TxOp, an as TxVault, cN as USER_ENVELOPE_COLLECTION, cO as USER_ENVELOPE_MAX_BYTES, cP as Unsubscribe, cQ as UserApi, cR as UserEnvelopeCheckGate, cS as UserEnvelopeOversizedError, cT as UserEnvelopePresented, cU as UserInfo, cV as VaultBackup, aF as VaultEngine, aj as VaultFrame, aG as VaultInstant, cW as VaultPolicyOnDisk, cX as VaultSnapshot, aH as VerifyResult, W as VersionRecord, cY as WarningRules, cZ as WeakPassphraseError, c_ as WeakPassphraseReason, g as applyI18nLocale, aI as applyPatch, c$ as assertStrongPassphrase, d0 as buildRecipientKeyringFile, d1 as burnPaperRecoveryEntry, aJ as canonicalJson, aK as computePatch, n as createEnforcer, d2 as createNoydb, d3 as createStore, d4 as deriveMagicLinkContentKey, h as dictCollectionName, i as dictKey, aL as diff, d5 as enrollAuthenticator, d6 as estimateEntropy, d7 as evaluateExportCapability, d8 as evaluateImportCapability, d9 as findAuthenticator, aM as formatDiff, da as hasExportCapability, db as hasImportCapability, dc as hasRecoveryEnrolled, aN as hashEntry, j as i18nText, k as isDictCollectionName, l as isDictKeyDescriptor, m as isI18nTextDescriptor, dd as isMagicLinkGrantExpired, de as isPublicEnvelope, df as issueDelegation, dg as keyringRecoverPassphrase, dh as keyringRotatePassphrase, di as listMagicLinkGrants, dj as listUsers, dk as listUsersWithEnvelopes, dl as loadActiveDelegations, dm as loadPaperRecoveryEntries, dn as magicLinkGrantRecordId, aO as paddedIndex, aP as parseIndex, dp as readMagicLinkGrantRecord, dq as removeAuthenticator, r as resolveI18nText, dr as resolvePublicEnvelopeSchema, ds as revokeDelegation, dt as revokeMagicLinkGrant, ao as runTransaction, du as savePaperRecoveryEntries, aQ as sha256Hex, dv as unwrapMagicLinkGrant, v as validateI18nTextValue, dw as validatePassphrase, dx as validatePublicEnvelopeInput, dy as validateSchemaInput, dz as validateSchemaOutput, o as validateSessionPolicy, dA as writeMagicLinkGrant } from './types-D-6bmD2c.js';
|
|
3
3
|
export { d as detectMagic, a as detectMimeType, i as isPreCompressed } from './mime-magic-CBBSOkjm.js';
|
|
4
4
|
export { AgeRoute, BlobLifecyclePolicy, BlobStoreRoute, CircuitBreakerOptions, HealthCheckOptions, LogLevel, LoggingOptions, MetricsOptions, OverrideOptions, OverrideTarget, RetryOptions, RouteStatus, RouteStoreOptions, RoutedNoydbStore, StoreCacheOptions, StoreMiddleware, StoreOperation, SuspendOptions, WrapBundleStoreOptions, WrappedBundleNoydbStore, createBundleStore, routeStore, withCache, withCircuitBreaker, withHealthCheck, withLogging, withMetrics, withRetry, wrapBundleStore, wrapStore } from './store/index.js';
|
|
5
5
|
import { N as NoydbError } from './index-DJTf9yxn.js';
|
|
6
6
|
export { A as AlreadyElevatedError, B as BackupCorruptedError, a as BackupLedgerError, b as BundleIntegrityError, c as BundleVersionConflictError, C as ConflictError, D as DEFAULT_JOIN_MAX_ROWS, d as DanglingReferenceError, e as DecryptionError, f as DelegationTargetMissingError, g as DictKeyInUseError, h as DictKeyMissingError, E as ElevationExpiredError, i as ExportCapabilityError, F as FilenameSanitizationError, G as GroupCardinalityError, I as ImportCapabilityError, j as IndexRequiredError, k as IndexWriteFailureError, l as InvalidKeyError, J as JoinContext, m as JoinLeg, n as JoinStrategy, o as JoinTooLargeError, p as JoinableSource, K as KeyringExpiredError, L as LedgerContentionError, q as LiveQuery, r as LiveUpstream, s as LocaleNotSpecifiedError, M as MissingTranslationError, t as NetworkError, u as NoAccessError, v as NotFoundError, O as OrderBy, P as PathEscapeError, w as PeriodClosedError, x as PermissionDeniedError, y as PrivilegeEscalationError, Q as Query, z as QueryPlan, H as QuerySource, R as ReadOnlyAtInstantError, S as ReadOnlyError, T as ReadOnlyFrameError, U as RefDescriptor, V as RefIntegrityError, W as RefMode, X as RefRegistry, Y as RefScopeError, Z as RefViolation, _ as ReservedCollectionNameError, $ as ScanBuilder, a0 as ScanPageProvider, a1 as SchemaValidationError, a2 as SessionExpiredError, a3 as SessionNotFoundError, a4 as SessionPolicyError, a5 as StoreCapabilityError, a6 as TamperedError, a7 as TierDemoteDeniedError, a8 as TierNotGrantedError, a9 as TranslatorNotConfiguredError, aa as ValidationError, ab as applyJoins, ac as buildLiveQuery, ad as executePlan, ae as ref, af as resetJoinWarnings } from './index-DJTf9yxn.js';
|
|
7
|
-
export { C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, a as NOYDB_BUNDLE_MAGIC, b as NOYDB_BUNDLE_PREFIX_BYTES, c as NoydbBundleHeader, d as NoydbBundleReadResult, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, e as readNoydbBundleHeader, f as readNoydbBundlePublicEnvelope, j as resetBrotliSupportCache, w as writeNoydbBundle } from './index-
|
|
7
|
+
export { C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, a as NOYDB_BUNDLE_MAGIC, b as NOYDB_BUNDLE_PREFIX_BYTES, c as NoydbBundleHeader, d as NoydbBundleReadResult, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, e as readNoydbBundleHeader, f as readNoydbBundlePublicEnvelope, j as resetBrotliSupportCache, w as writeNoydbBundle } from './index-DZn6Yick.js';
|
|
8
8
|
export { a as CrdtMode, b as CrdtState, L as LwwMapState, R as RgaState, Y as YjsState, m as mergeCrdtStates, r as resolveCrdtSnapshot } from './strategy-BSxFXGzb.js';
|
|
9
9
|
export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.js';
|
|
10
|
-
export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-
|
|
10
|
+
export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-CcJ1qIi7.js';
|
|
11
11
|
export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from './predicate-SBHmi6D0.js';
|
|
12
12
|
export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedRow, L as LiveAggregation, R as Reducer, i as ReducerOptions, j as avg, l as count, m as groupAndReduce, n as max, o as min, r as reduceRecords, s as sum } from './strategy-D-SrOLCl.js';
|
|
13
|
-
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-
|
|
13
|
+
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-1Xsqx1jl.js';
|
|
14
14
|
import './lazy-builder-BwEoBQZ9.js';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Persistence helpers for per-principal user envelopes stored at
|
|
18
|
+
* `_users/<keyringId>` (logically: `_meta/user/<keyringId>`).
|
|
19
|
+
*
|
|
20
|
+
* Unlike `_meta/policy` and `_meta/handle` which are plaintext, user
|
|
21
|
+
* envelopes carry user data and are encrypted with a dedicated
|
|
22
|
+
* {@link USER_ENVELOPE_COLLECTION} DEK (provisioned at vault open and
|
|
23
|
+
* propagated to every keyring via the system-collection DEK path in
|
|
24
|
+
* `team/keyring.ts`).
|
|
25
|
+
*
|
|
26
|
+
* This module is the **storage primitive** layer. The public API
|
|
27
|
+
* (`vault.user.*`) sits on top of this; permission gates, own-only
|
|
28
|
+
* write enforcement, and presence-channel propagation live there.
|
|
29
|
+
*
|
|
30
|
+
* @see docs/superpowers/specs/2026-05-05-user-envelope-design.md
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Read and decrypt the user envelope for `keyringId`. Returns `null`
|
|
37
|
+
* when no envelope has been persisted (either the principal has never
|
|
38
|
+
* called `updateMe`, or the keyring predates this feature).
|
|
39
|
+
*
|
|
40
|
+
* Decryption errors propagate — a tampered or wrong-keyed envelope
|
|
41
|
+
* surfaces as the underlying crypto error rather than masquerading as
|
|
42
|
+
* "not found".
|
|
43
|
+
*/
|
|
44
|
+
declare function loadUserEnvelope<T = unknown>(store: NoydbStore, vault: string, keyringId: string, dek: CryptoKey): Promise<UserEnvelope<T> | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Encrypt and persist the user envelope for `keyringId`. The new
|
|
47
|
+
* version is `(prior._v ?? 0) + 1`. Pass `expectedVersion` to enable
|
|
48
|
+
* optimistic-concurrency checks: a mismatch with the stored version
|
|
49
|
+
* throws {@link ConflictError} with the actual stored version.
|
|
50
|
+
*
|
|
51
|
+
* `expectedVersion: 0` means "expect no prior envelope"; the write
|
|
52
|
+
* succeeds only if no envelope exists yet.
|
|
53
|
+
*
|
|
54
|
+
* Soft-caps the JSON-serialized payload at {@link USER_ENVELOPE_MAX_BYTES};
|
|
55
|
+
* larger payloads throw {@link UserEnvelopeOversizedError}.
|
|
56
|
+
*/
|
|
57
|
+
declare function saveUserEnvelope<T>(store: NoydbStore, vault: string, keyringId: string, payload: T, dek: CryptoKey, expectedVersion?: number): Promise<UserEnvelope<T>>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete the user envelope for `keyringId`. Idempotent — no error if
|
|
60
|
+
* the envelope is already absent. Called from the keyring revoke path
|
|
61
|
+
* (cascade-delete) and is a no-op for keyrings that never wrote.
|
|
62
|
+
*/
|
|
63
|
+
declare function deleteUserEnvelope(store: NoydbStore, vault: string, keyringId: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* List the keyring ids that have a user envelope persisted in `vault`.
|
|
66
|
+
* Order is store-defined — callers that need a stable order should sort.
|
|
67
|
+
*/
|
|
68
|
+
declare function listUserEnvelopeIds(store: NoydbStore, vault: string): Promise<string[]>;
|
|
69
|
+
|
|
16
70
|
/**
|
|
17
71
|
* Cache policy helpers — parse human-friendly byte budgets into raw numbers.
|
|
18
72
|
*
|
|
@@ -508,4 +562,4 @@ type DiffCandidate<T = unknown> = Vault | Record<string, readonly T[]> | string;
|
|
|
508
562
|
*/
|
|
509
563
|
declare function diffVault<T = unknown>(vault: Vault, candidate: DiffCandidate<T>, options?: DiffOptions): Promise<VaultDiff<T>>;
|
|
510
564
|
|
|
511
|
-
export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, type DiffCandidate, DiffEntry, type DiffOptions, FactorProof, GateName, GatePolicy, META_COLLECTION, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, STRICT_POLICY, UnlockedKeyring, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, loadPublicEnvelope, loadVaultPolicy, mergePolicy, parseBytes, readPublicEnvelope, savePublicEnvelope, saveVaultPolicy };
|
|
565
|
+
export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, type DiffCandidate, DiffEntry, type DiffOptions, FactorProof, GateName, GatePolicy, META_COLLECTION, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, STRICT_POLICY, UnlockedKeyring, UserEnvelope, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, deleteUserEnvelope, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, listUserEnvelopeIds, loadPublicEnvelope, loadUserEnvelope, loadVaultPolicy, mergePolicy, parseBytes, readPublicEnvelope, savePublicEnvelope, saveUserEnvelope, saveVaultPolicy };
|