@noy-db/hub 0.2.0-pre.30 → 0.2.0-pre.31
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/adapter/index.d.ts +9 -0
- package/dist/adapter/index.js +14 -0
- package/dist/attestation/index.d.ts +1 -1
- package/dist/attestation/index.js +3 -3
- package/dist/blobs/index.d.ts +3 -3
- package/dist/bundle/index.d.ts +3 -3
- package/dist/bundle/index.js +1 -1
- package/dist/{chunk-Y6YUWZTS.js → chunk-L5HHBOMS.js} +2 -2
- package/dist/{chunk-BVKLJBJJ.js → chunk-W5NVNJDX.js} +2 -1
- package/dist/{chunk-BVKLJBJJ.js.map → chunk-W5NVNJDX.js.map} +1 -1
- package/dist/consent/index.d.ts +2 -2
- package/dist/{decrypt-partition-Mhjh6nnG.d.ts → decrypt-partition-CXS5KopB.d.ts} +1 -1
- package/dist/derivations/index.d.ts +3 -3
- package/dist/{dev-unlock-DJ3IhgY9.d.ts → dev-unlock-CnHTTVea.d.ts} +1 -1
- package/dist/guards/index.d.ts +3 -3
- package/dist/{hash-DLwkYf1d.d.ts → hash-oc5paYl0.d.ts} +1 -1
- package/dist/history/index.d.ts +3 -3
- package/dist/i18n/index.d.ts +2 -2
- package/dist/{index-CMRIx_zx.d.ts → index-BmhGztUi.d.ts} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/kernel/index.d.ts +2 -2
- package/dist/materialized-views/index.d.ts +3 -3
- package/dist/{mime-magic-CacDBwYp.d.ts → mime-magic-JeLKHRng.d.ts} +1 -1
- package/dist/{noydb-5MIBD77B.js → noydb-NAU2DTFP.js} +2 -2
- package/dist/noydb-NAU2DTFP.js.map +1 -0
- package/dist/overlay-views/index.d.ts +3 -3
- package/dist/periods/index.d.ts +2 -2
- package/dist/session/index.d.ts +3 -3
- package/dist/shadow/index.d.ts +2 -2
- package/dist/snapshots/index.d.ts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/sync/index.d.ts +1 -1
- package/dist/team/index.d.ts +2 -2
- package/dist/{transition-guard-J04-jime.d.ts → transition-guard-Dy3NioQr.d.ts} +1 -1
- package/dist/tx/index.d.ts +2 -2
- package/dist/{with-materialized-view-DNfzC5lH.d.ts → with-materialized-view-DIVeez0W.d.ts} +1 -1
- package/dist/{with-overlayed-view-qk3lbhOd.d.ts → with-overlayed-view-DVZrc5Hb.d.ts} +1 -1
- package/dist/{with-rollup-Dd3_ZG4b.d.ts → with-rollup-CbU-O4wP.d.ts} +1 -1
- package/package.json +62 -221
- package/dist/aggregate/index.cjs +0 -1144
- package/dist/aggregate/index.cjs.map +0 -1
- package/dist/aggregate/index.d.cts +0 -39
- package/dist/attestation/index.cjs +0 -305
- package/dist/attestation/index.cjs.map +0 -1
- package/dist/attestation/index.d.cts +0 -54
- package/dist/blobs/index.cjs +0 -1967
- package/dist/blobs/index.cjs.map +0 -1
- package/dist/blobs/index.d.cts +0 -48
- package/dist/bundle/index.cjs +0 -41045
- package/dist/bundle/index.cjs.map +0 -1
- package/dist/bundle/index.d.cts +0 -187
- package/dist/consent/index.cjs +0 -204
- package/dist/consent/index.cjs.map +0 -1
- package/dist/consent/index.d.cts +0 -27
- package/dist/crdt/index.cjs +0 -152
- package/dist/crdt/index.cjs.map +0 -1
- package/dist/crdt/index.d.cts +0 -30
- package/dist/decrypt-partition-C0iDpbSd.d.cts +0 -558
- package/dist/derivations/index.cjs +0 -469
- package/dist/derivations/index.cjs.map +0 -1
- package/dist/derivations/index.d.cts +0 -74
- package/dist/dev-unlock-0Z6yxfS7.d.cts +0 -263
- package/dist/discriminant-BN9REW3o.d.cts +0 -60
- package/dist/errors-BAWO5Z5a.d.cts +0 -1500
- package/dist/forget/index.cjs +0 -43
- package/dist/forget/index.cjs.map +0 -1
- package/dist/forget/index.d.cts +0 -1
- package/dist/guards/index.cjs +0 -455
- package/dist/guards/index.cjs.map +0 -1
- package/dist/guards/index.d.cts +0 -39
- package/dist/hash-Db8ncXGr.d.cts +0 -63
- package/dist/history/index.cjs +0 -1245
- package/dist/history/index.cjs.map +0 -1
- package/dist/history/index.d.cts +0 -65
- package/dist/i18n/index.cjs +0 -1280
- package/dist/i18n/index.cjs.map +0 -1
- package/dist/i18n/index.d.cts +0 -41
- package/dist/index-BMmajblo.d.cts +0 -362
- package/dist/index-C1SC1EPe.d.cts +0 -1325
- package/dist/index-xJEPkvMb.d.cts +0 -93
- package/dist/index.cjs +0 -48100
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1050
- package/dist/indexing/index.cjs +0 -803
- package/dist/indexing/index.cjs.map +0 -1
- package/dist/indexing/index.d.cts +0 -36
- package/dist/kernel/index.cjs +0 -751
- package/dist/kernel/index.cjs.map +0 -1
- package/dist/kernel/index.d.cts +0 -11
- package/dist/lazy-builder-eYZzLEL1.d.cts +0 -304
- package/dist/materialized-views/index.cjs +0 -1518
- package/dist/materialized-views/index.cjs.map +0 -1
- package/dist/materialized-views/index.d.cts +0 -187
- package/dist/mime-magic-sdMzsfVK.d.cts +0 -103
- package/dist/overlay-views/index.cjs +0 -399
- package/dist/overlay-views/index.cjs.map +0 -1
- package/dist/overlay-views/index.d.cts +0 -102
- package/dist/periods/index.cjs +0 -1041
- package/dist/periods/index.cjs.map +0 -1
- package/dist/periods/index.d.cts +0 -24
- package/dist/predicate-BmhBSPCH.d.cts +0 -267
- package/dist/query/index.cjs +0 -3480
- package/dist/query/index.cjs.map +0 -1
- package/dist/query/index.d.cts +0 -4
- package/dist/sealed-record/index.cjs +0 -139
- package/dist/sealed-record/index.cjs.map +0 -1
- package/dist/sealed-record/index.d.cts +0 -123
- package/dist/session/index.cjs +0 -495
- package/dist/session/index.cjs.map +0 -1
- package/dist/session/index.d.cts +0 -48
- package/dist/shadow/index.cjs +0 -133
- package/dist/shadow/index.cjs.map +0 -1
- package/dist/shadow/index.d.cts +0 -19
- package/dist/snapshots/index.cjs +0 -937
- package/dist/snapshots/index.cjs.map +0 -1
- package/dist/snapshots/index.d.cts +0 -30
- package/dist/store/index.cjs +0 -1091
- package/dist/store/index.cjs.map +0 -1
- package/dist/store/index.d.cts +0 -501
- package/dist/strategy-BSxFXGzb.d.cts +0 -110
- package/dist/strategy-mJExw4LQ.d.cts +0 -1069
- package/dist/sync/index.cjs +0 -1062
- package/dist/sync/index.cjs.map +0 -1
- package/dist/sync/index.d.cts +0 -45
- package/dist/team/index.cjs +0 -2805
- package/dist/team/index.cjs.map +0 -1
- package/dist/team/index.d.cts +0 -120
- package/dist/transition-guard-tWZIsaXe.d.cts +0 -165
- package/dist/tx/index.cjs +0 -614
- package/dist/tx/index.cjs.map +0 -1
- package/dist/tx/index.d.cts +0 -39
- package/dist/types-CdVfiQgt.d.cts +0 -15275
- package/dist/ulid-DRH25k3y.d.cts +0 -66
- package/dist/util/index.cjs +0 -237
- package/dist/util/index.cjs.map +0 -1
- package/dist/util/index.d.cts +0 -79
- package/dist/with-materialized-view-DfgPcvi9.d.cts +0 -27
- package/dist/with-overlayed-view-Cvfkx1lg.d.cts +0 -13
- package/dist/with-rollup-nIxo7h9z.d.cts +0 -47
- /package/dist/{noydb-5MIBD77B.js.map → adapter/index.js.map} +0 -0
- /package/dist/{chunk-Y6YUWZTS.js.map → chunk-L5HHBOMS.js.map} +0 -0
- /package/dist/{types-DHn9lEP0.d.ts → index-DHn9lEP0.d.ts} +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import './predicate-BmhBSPCH.cjs';
|
|
2
|
-
import './strategy-mJExw4LQ.cjs';
|
|
3
|
-
import './ulid-DRH25k3y.cjs';
|
|
4
|
-
import { e1 as RetrieveHit } from './types-CdVfiQgt.cjs';
|
|
5
|
-
import './errors-BAWO5Z5a.cjs';
|
|
6
|
-
import './index-C1SC1EPe.cjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* #308 L3 — Reciprocal Rank Fusion. Merges N ranked `RetrieveHit` lists into
|
|
10
|
-
* one, scoring each id by Σ 1/(k + rank) across the lists it appears in. Pure,
|
|
11
|
-
* deterministic, no I/O — which is why it serves BOTH hybrid lexical⊕semantic
|
|
12
|
-
* fusion AND klum-db's cross-vault federation (the lists are per-vault). The
|
|
13
|
-
* fused `score` is the RRF score, NOT BM25 or cosine.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
interface FuseOptions {
|
|
17
|
-
/** Only 'rrf' in v1 (default). */
|
|
18
|
-
readonly strategy?: 'rrf';
|
|
19
|
-
/** RRF constant; larger flattens the rank weighting. Default 60. */
|
|
20
|
-
readonly k?: number;
|
|
21
|
-
/** Truncate the fused output to this many hits. */
|
|
22
|
-
readonly limit?: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Callers must supply hits with `rank >= 1` (the retrieve contract guarantees
|
|
26
|
-
* it; a federation caller passing `rank: 0` with `k: 0` would divide by zero).
|
|
27
|
-
* Doc-only note — no runtime guard; rank ≥ 1 is the retrieve contract.
|
|
28
|
-
*/
|
|
29
|
-
declare function fuseRetrieval<T>(lists: ReadonlyArray<ReadonlyArray<RetrieveHit<T>>>, opts?: FuseOptions): RetrieveHit<T>[];
|
|
30
|
-
|
|
31
|
-
interface EncryptResult {
|
|
32
|
-
iv: string;
|
|
33
|
-
data: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Encrypt raw bytes with AES-256-GCM using a fresh random IV.
|
|
37
|
-
* Used by the attachment store so binary blobs avoid double base64 encoding
|
|
38
|
-
* (the existing `encrypt()` function calls `TextEncoder` on a string — here
|
|
39
|
-
* we pass the `Uint8Array` directly to `subtle.encrypt`).
|
|
40
|
-
*/
|
|
41
|
-
declare function encryptBytes(data: Uint8Array, dek: CryptoKey): Promise<EncryptResult>;
|
|
42
|
-
/**
|
|
43
|
-
* Decrypt AES-256-GCM ciphertext back to raw bytes.
|
|
44
|
-
* Counterpart to `encryptBytes`. Throws `TamperedError` on auth-tag failure.
|
|
45
|
-
*/
|
|
46
|
-
declare function decryptBytes(ivBase64: string, dataBase64: string, dek: CryptoKey): Promise<Uint8Array>;
|
|
47
|
-
/**
|
|
48
|
-
* SHA-256 hex digest of raw bytes. Used to derive content-addressed
|
|
49
|
-
* eTags for blob deduplication. Computed on plaintext bytes
|
|
50
|
-
* before compression and encryption so the eTag identifies content, not
|
|
51
|
-
* ciphertext, and survives re-encryption (key rotation, re-upload).
|
|
52
|
-
*/
|
|
53
|
-
declare function sha256Hex(data: Uint8Array): Promise<string>;
|
|
54
|
-
/**
|
|
55
|
-
* Derive an AES-256-GCM presence key from a collection DEK using HKDF-SHA256.
|
|
56
|
-
*
|
|
57
|
-
* The presence key is domain-separated from the data DEK by the fixed salt
|
|
58
|
-
* `'noydb-presence'` and the `info` = collection name. This means:
|
|
59
|
-
* - The adapter never sees the presence key.
|
|
60
|
-
* - Presence payloads rotate automatically when the collection DEK is rotated.
|
|
61
|
-
* - Revoked users cannot derive the new presence key after a DEK rotation.
|
|
62
|
-
*
|
|
63
|
-
* @param dek The collection's AES-256-GCM DEK (extractable).
|
|
64
|
-
* @param collectionName Used as the HKDF `info` parameter for domain separation.
|
|
65
|
-
* @returns A non-extractable AES-256-GCM key suitable for presence payload encryption.
|
|
66
|
-
*/
|
|
67
|
-
declare function derivePresenceKey(dek: CryptoKey, collectionName: string): Promise<CryptoKey>;
|
|
68
|
-
/**
|
|
69
|
-
* Encrypt a plaintext string with AES-256-GCM and a deterministic,
|
|
70
|
-
* HKDF-derived IV.
|
|
71
|
-
*
|
|
72
|
-
* The same `{ dek, context, plaintext }` triple always produces the
|
|
73
|
-
* same `{ iv, data }` — call this twice and you can string-compare the
|
|
74
|
-
* ciphertexts to check equality of the inputs without decrypting them.
|
|
75
|
-
*
|
|
76
|
-
* @param context Domain-separation string — by convention
|
|
77
|
-
* `'<collection>/<field>'`. Different contexts encrypt
|
|
78
|
-
* the same plaintext to different ciphertexts, so
|
|
79
|
-
* `email` in collection `users` does not collide with
|
|
80
|
-
* `email` in collection `customers`.
|
|
81
|
-
*/
|
|
82
|
-
declare function encryptDeterministic(plaintext: string, dek: CryptoKey, context: string): Promise<EncryptResult>;
|
|
83
|
-
/**
|
|
84
|
-
* Counterpart to {@link encryptDeterministic}. The IV is stored
|
|
85
|
-
* alongside the ciphertext (exactly like the randomized path), so
|
|
86
|
-
* decrypt uses the stored IV and verifies the GCM auth tag — a tampered
|
|
87
|
-
* ciphertext throws `TamperedError` just like randomized AES-GCM.
|
|
88
|
-
*/
|
|
89
|
-
declare function decryptDeterministic(ivBase64: string, dataBase64: string, dek: CryptoKey): Promise<string>;
|
|
90
|
-
declare function bufferToBase64(buffer: ArrayBuffer | Uint8Array): string;
|
|
91
|
-
declare function base64ToBuffer(base64: string): Uint8Array<ArrayBuffer>;
|
|
92
|
-
|
|
93
|
-
export { type FuseOptions as F, bufferToBase64 as a, base64ToBuffer as b, decryptDeterministic as c, decryptBytes as d, derivePresenceKey as e, encryptBytes as f, encryptDeterministic as g, fuseRetrieval as h, sha256Hex as s };
|