@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.
Files changed (143) hide show
  1. package/dist/adapter/index.d.ts +9 -0
  2. package/dist/adapter/index.js +14 -0
  3. package/dist/attestation/index.d.ts +1 -1
  4. package/dist/attestation/index.js +3 -3
  5. package/dist/blobs/index.d.ts +3 -3
  6. package/dist/bundle/index.d.ts +3 -3
  7. package/dist/bundle/index.js +1 -1
  8. package/dist/{chunk-Y6YUWZTS.js → chunk-L5HHBOMS.js} +2 -2
  9. package/dist/{chunk-BVKLJBJJ.js → chunk-W5NVNJDX.js} +2 -1
  10. package/dist/{chunk-BVKLJBJJ.js.map → chunk-W5NVNJDX.js.map} +1 -1
  11. package/dist/consent/index.d.ts +2 -2
  12. package/dist/{decrypt-partition-Mhjh6nnG.d.ts → decrypt-partition-CXS5KopB.d.ts} +1 -1
  13. package/dist/derivations/index.d.ts +3 -3
  14. package/dist/{dev-unlock-DJ3IhgY9.d.ts → dev-unlock-CnHTTVea.d.ts} +1 -1
  15. package/dist/guards/index.d.ts +3 -3
  16. package/dist/{hash-DLwkYf1d.d.ts → hash-oc5paYl0.d.ts} +1 -1
  17. package/dist/history/index.d.ts +3 -3
  18. package/dist/i18n/index.d.ts +2 -2
  19. package/dist/{index-CMRIx_zx.d.ts → index-BmhGztUi.d.ts} +1 -1
  20. package/dist/index.d.ts +11 -11
  21. package/dist/index.js +2 -2
  22. package/dist/kernel/index.d.ts +2 -2
  23. package/dist/materialized-views/index.d.ts +3 -3
  24. package/dist/{mime-magic-CacDBwYp.d.ts → mime-magic-JeLKHRng.d.ts} +1 -1
  25. package/dist/{noydb-5MIBD77B.js → noydb-NAU2DTFP.js} +2 -2
  26. package/dist/noydb-NAU2DTFP.js.map +1 -0
  27. package/dist/overlay-views/index.d.ts +3 -3
  28. package/dist/periods/index.d.ts +2 -2
  29. package/dist/session/index.d.ts +3 -3
  30. package/dist/shadow/index.d.ts +2 -2
  31. package/dist/snapshots/index.d.ts +2 -2
  32. package/dist/store/index.d.ts +2 -2
  33. package/dist/sync/index.d.ts +1 -1
  34. package/dist/team/index.d.ts +2 -2
  35. package/dist/{transition-guard-J04-jime.d.ts → transition-guard-Dy3NioQr.d.ts} +1 -1
  36. package/dist/tx/index.d.ts +2 -2
  37. package/dist/{with-materialized-view-DNfzC5lH.d.ts → with-materialized-view-DIVeez0W.d.ts} +1 -1
  38. package/dist/{with-overlayed-view-qk3lbhOd.d.ts → with-overlayed-view-DVZrc5Hb.d.ts} +1 -1
  39. package/dist/{with-rollup-Dd3_ZG4b.d.ts → with-rollup-CbU-O4wP.d.ts} +1 -1
  40. package/package.json +62 -221
  41. package/dist/aggregate/index.cjs +0 -1144
  42. package/dist/aggregate/index.cjs.map +0 -1
  43. package/dist/aggregate/index.d.cts +0 -39
  44. package/dist/attestation/index.cjs +0 -305
  45. package/dist/attestation/index.cjs.map +0 -1
  46. package/dist/attestation/index.d.cts +0 -54
  47. package/dist/blobs/index.cjs +0 -1967
  48. package/dist/blobs/index.cjs.map +0 -1
  49. package/dist/blobs/index.d.cts +0 -48
  50. package/dist/bundle/index.cjs +0 -41045
  51. package/dist/bundle/index.cjs.map +0 -1
  52. package/dist/bundle/index.d.cts +0 -187
  53. package/dist/consent/index.cjs +0 -204
  54. package/dist/consent/index.cjs.map +0 -1
  55. package/dist/consent/index.d.cts +0 -27
  56. package/dist/crdt/index.cjs +0 -152
  57. package/dist/crdt/index.cjs.map +0 -1
  58. package/dist/crdt/index.d.cts +0 -30
  59. package/dist/decrypt-partition-C0iDpbSd.d.cts +0 -558
  60. package/dist/derivations/index.cjs +0 -469
  61. package/dist/derivations/index.cjs.map +0 -1
  62. package/dist/derivations/index.d.cts +0 -74
  63. package/dist/dev-unlock-0Z6yxfS7.d.cts +0 -263
  64. package/dist/discriminant-BN9REW3o.d.cts +0 -60
  65. package/dist/errors-BAWO5Z5a.d.cts +0 -1500
  66. package/dist/forget/index.cjs +0 -43
  67. package/dist/forget/index.cjs.map +0 -1
  68. package/dist/forget/index.d.cts +0 -1
  69. package/dist/guards/index.cjs +0 -455
  70. package/dist/guards/index.cjs.map +0 -1
  71. package/dist/guards/index.d.cts +0 -39
  72. package/dist/hash-Db8ncXGr.d.cts +0 -63
  73. package/dist/history/index.cjs +0 -1245
  74. package/dist/history/index.cjs.map +0 -1
  75. package/dist/history/index.d.cts +0 -65
  76. package/dist/i18n/index.cjs +0 -1280
  77. package/dist/i18n/index.cjs.map +0 -1
  78. package/dist/i18n/index.d.cts +0 -41
  79. package/dist/index-BMmajblo.d.cts +0 -362
  80. package/dist/index-C1SC1EPe.d.cts +0 -1325
  81. package/dist/index-xJEPkvMb.d.cts +0 -93
  82. package/dist/index.cjs +0 -48100
  83. package/dist/index.cjs.map +0 -1
  84. package/dist/index.d.cts +0 -1050
  85. package/dist/indexing/index.cjs +0 -803
  86. package/dist/indexing/index.cjs.map +0 -1
  87. package/dist/indexing/index.d.cts +0 -36
  88. package/dist/kernel/index.cjs +0 -751
  89. package/dist/kernel/index.cjs.map +0 -1
  90. package/dist/kernel/index.d.cts +0 -11
  91. package/dist/lazy-builder-eYZzLEL1.d.cts +0 -304
  92. package/dist/materialized-views/index.cjs +0 -1518
  93. package/dist/materialized-views/index.cjs.map +0 -1
  94. package/dist/materialized-views/index.d.cts +0 -187
  95. package/dist/mime-magic-sdMzsfVK.d.cts +0 -103
  96. package/dist/overlay-views/index.cjs +0 -399
  97. package/dist/overlay-views/index.cjs.map +0 -1
  98. package/dist/overlay-views/index.d.cts +0 -102
  99. package/dist/periods/index.cjs +0 -1041
  100. package/dist/periods/index.cjs.map +0 -1
  101. package/dist/periods/index.d.cts +0 -24
  102. package/dist/predicate-BmhBSPCH.d.cts +0 -267
  103. package/dist/query/index.cjs +0 -3480
  104. package/dist/query/index.cjs.map +0 -1
  105. package/dist/query/index.d.cts +0 -4
  106. package/dist/sealed-record/index.cjs +0 -139
  107. package/dist/sealed-record/index.cjs.map +0 -1
  108. package/dist/sealed-record/index.d.cts +0 -123
  109. package/dist/session/index.cjs +0 -495
  110. package/dist/session/index.cjs.map +0 -1
  111. package/dist/session/index.d.cts +0 -48
  112. package/dist/shadow/index.cjs +0 -133
  113. package/dist/shadow/index.cjs.map +0 -1
  114. package/dist/shadow/index.d.cts +0 -19
  115. package/dist/snapshots/index.cjs +0 -937
  116. package/dist/snapshots/index.cjs.map +0 -1
  117. package/dist/snapshots/index.d.cts +0 -30
  118. package/dist/store/index.cjs +0 -1091
  119. package/dist/store/index.cjs.map +0 -1
  120. package/dist/store/index.d.cts +0 -501
  121. package/dist/strategy-BSxFXGzb.d.cts +0 -110
  122. package/dist/strategy-mJExw4LQ.d.cts +0 -1069
  123. package/dist/sync/index.cjs +0 -1062
  124. package/dist/sync/index.cjs.map +0 -1
  125. package/dist/sync/index.d.cts +0 -45
  126. package/dist/team/index.cjs +0 -2805
  127. package/dist/team/index.cjs.map +0 -1
  128. package/dist/team/index.d.cts +0 -120
  129. package/dist/transition-guard-tWZIsaXe.d.cts +0 -165
  130. package/dist/tx/index.cjs +0 -614
  131. package/dist/tx/index.cjs.map +0 -1
  132. package/dist/tx/index.d.cts +0 -39
  133. package/dist/types-CdVfiQgt.d.cts +0 -15275
  134. package/dist/ulid-DRH25k3y.d.cts +0 -66
  135. package/dist/util/index.cjs +0 -237
  136. package/dist/util/index.cjs.map +0 -1
  137. package/dist/util/index.d.cts +0 -79
  138. package/dist/with-materialized-view-DfgPcvi9.d.cts +0 -27
  139. package/dist/with-overlayed-view-Cvfkx1lg.d.cts +0 -13
  140. package/dist/with-rollup-nIxo7h9z.d.cts +0 -47
  141. /package/dist/{noydb-5MIBD77B.js.map → adapter/index.js.map} +0 -0
  142. /package/dist/{chunk-Y6YUWZTS.js.map → chunk-L5HHBOMS.js.map} +0 -0
  143. /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 };