@noy-db/hub 0.1.0-pre.9 → 0.2.0-pre.10

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 (305) hide show
  1. package/dist/aggregate/index.cjs +100 -36
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +16 -9
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/attestation/index.cjs +305 -0
  8. package/dist/attestation/index.cjs.map +1 -0
  9. package/dist/attestation/index.d.cts +52 -0
  10. package/dist/attestation/index.d.ts +52 -0
  11. package/dist/attestation/index.js +36 -0
  12. package/dist/attestation/index.js.map +1 -0
  13. package/dist/blobs/index.cjs.map +1 -1
  14. package/dist/blobs/index.d.cts +7 -6
  15. package/dist/blobs/index.d.ts +7 -6
  16. package/dist/blobs/index.js +10 -8
  17. package/dist/blobs/index.js.map +1 -1
  18. package/dist/bundle/index.cjs +19121 -60
  19. package/dist/bundle/index.cjs.map +1 -1
  20. package/dist/bundle/index.d.cts +175 -6
  21. package/dist/bundle/index.d.ts +175 -6
  22. package/dist/bundle/index.js +543 -4
  23. package/dist/bundle/index.js.map +1 -1
  24. package/dist/chunk-26NK23DZ.js +296 -0
  25. package/dist/chunk-26NK23DZ.js.map +1 -0
  26. package/dist/{chunk-TDR6T5CJ.js → chunk-2LPPNWF6.js} +91 -132
  27. package/dist/chunk-2LPPNWF6.js.map +1 -0
  28. package/dist/{chunk-PTVMYYON.js → chunk-2N62W5YP.js} +3 -3
  29. package/dist/{chunk-QGZRWRSL.js → chunk-3LPV6BXR.js} +4 -4
  30. package/dist/{chunk-QAVUREFT.js → chunk-4CLICFEY.js} +12 -6
  31. package/dist/chunk-4CLICFEY.js.map +1 -0
  32. package/dist/chunk-4USCAEDT.js +10529 -0
  33. package/dist/chunk-4USCAEDT.js.map +1 -0
  34. package/dist/chunk-5IXJGFF2.js +83 -0
  35. package/dist/chunk-5IXJGFF2.js.map +1 -0
  36. package/dist/chunk-5OEJ6GOT.js +124 -0
  37. package/dist/chunk-5OEJ6GOT.js.map +1 -0
  38. package/dist/{chunk-4PWAI7Q4.js → chunk-5OX6XVNS.js} +5 -5
  39. package/dist/{chunk-2CSJGFCB.js → chunk-6EOXTJS2.js} +6 -229
  40. package/dist/chunk-6EOXTJS2.js.map +1 -0
  41. package/dist/chunk-6T2UDBKG.js +53 -0
  42. package/dist/chunk-6T2UDBKG.js.map +1 -0
  43. package/dist/{chunk-GOUT6DND.js → chunk-6YLPHBKR.js} +382 -95
  44. package/dist/chunk-6YLPHBKR.js.map +1 -0
  45. package/dist/chunk-7CEGU63S.js +179 -0
  46. package/dist/chunk-7CEGU63S.js.map +1 -0
  47. package/dist/chunk-A3JMGXPG.js +125 -0
  48. package/dist/chunk-A3JMGXPG.js.map +1 -0
  49. package/dist/chunk-BB27JMWB.js +795 -0
  50. package/dist/chunk-BB27JMWB.js.map +1 -0
  51. package/dist/{chunk-SCZXXXU4.js → chunk-BDV7INMP.js} +7 -32
  52. package/dist/chunk-BDV7INMP.js.map +1 -0
  53. package/dist/chunk-C3WE6UJY.js +19 -0
  54. package/dist/chunk-C3WE6UJY.js.map +1 -0
  55. package/dist/chunk-CH22FZHT.js +96 -0
  56. package/dist/chunk-CH22FZHT.js.map +1 -0
  57. package/dist/chunk-CXFOITNS.js +34 -0
  58. package/dist/chunk-CXFOITNS.js.map +1 -0
  59. package/dist/chunk-CXJG63MA.js +109 -0
  60. package/dist/chunk-CXJG63MA.js.map +1 -0
  61. package/dist/chunk-DAP2XL7Q.js +51 -0
  62. package/dist/chunk-DAP2XL7Q.js.map +1 -0
  63. package/dist/{chunk-AVVPZ4BC.js → chunk-DJRWA3Q5.js} +4 -4
  64. package/dist/chunk-DRXIZOFV.js +233 -0
  65. package/dist/chunk-DRXIZOFV.js.map +1 -0
  66. package/dist/chunk-FO3UEG4S.js +313 -0
  67. package/dist/chunk-FO3UEG4S.js.map +1 -0
  68. package/dist/chunk-GAUEWM7D.js +147 -0
  69. package/dist/chunk-GAUEWM7D.js.map +1 -0
  70. package/dist/{chunk-MDDTIZUO.js → chunk-GNHAC43Q.js} +218 -119
  71. package/dist/chunk-GNHAC43Q.js.map +1 -0
  72. package/dist/chunk-HHOO7HGH.js +57 -0
  73. package/dist/chunk-HHOO7HGH.js.map +1 -0
  74. package/dist/{chunk-WDM5XGGS.js → chunk-HQSQC2XL.js} +182 -12
  75. package/dist/chunk-HQSQC2XL.js.map +1 -0
  76. package/dist/chunk-IMYKDWB4.js +139 -0
  77. package/dist/chunk-IMYKDWB4.js.map +1 -0
  78. package/dist/{chunk-M62XNWRA.js → chunk-LSTBFLL2.js} +2 -2
  79. package/dist/{chunk-ACLDOTNQ.js → chunk-O6EJ6WTI.js} +436 -3
  80. package/dist/chunk-O6EJ6WTI.js.map +1 -0
  81. package/dist/chunk-PC6ZEDRL.js +71 -0
  82. package/dist/chunk-PC6ZEDRL.js.map +1 -0
  83. package/dist/chunk-PM3QYWUU.js +251 -0
  84. package/dist/chunk-PM3QYWUU.js.map +1 -0
  85. package/dist/chunk-PVUUIWHY.js +73 -0
  86. package/dist/chunk-PVUUIWHY.js.map +1 -0
  87. package/dist/chunk-PXTQPZO4.js +830 -0
  88. package/dist/chunk-PXTQPZO4.js.map +1 -0
  89. package/dist/{chunk-ZFKD4QMV.js → chunk-QSOYKKMD.js} +4 -4
  90. package/dist/chunk-QSOYKKMD.js.map +1 -0
  91. package/dist/{chunk-MR4424N3.js → chunk-R233SLY3.js} +2 -2
  92. package/dist/chunk-RC6SU5NO.js +36 -0
  93. package/dist/chunk-RC6SU5NO.js.map +1 -0
  94. package/dist/{chunk-USKYUS74.js → chunk-RRNA5GKT.js} +2 -2
  95. package/dist/{chunk-R36SIKES.js → chunk-RYIL3PI2.js} +2 -2
  96. package/dist/chunk-STNPB3UM.js +9 -0
  97. package/dist/chunk-STNPB3UM.js.map +1 -0
  98. package/dist/{chunk-M5INGEFC.js → chunk-TV3YZ35S.js} +7 -1
  99. package/dist/chunk-TV3YZ35S.js.map +1 -0
  100. package/dist/chunk-TY32C732.js +59 -0
  101. package/dist/chunk-TY32C732.js.map +1 -0
  102. package/dist/chunk-UMLVJTYV.js +20 -0
  103. package/dist/chunk-UMLVJTYV.js.map +1 -0
  104. package/dist/{chunk-NPC4LFV5.js → chunk-WIBHRONM.js} +2 -2
  105. package/dist/chunk-WIBHRONM.js.map +1 -0
  106. package/dist/{chunk-RKJ6OL7K.js → chunk-WIRRPTFH.js} +1 -1
  107. package/dist/chunk-WIRRPTFH.js.map +1 -0
  108. package/dist/{chunk-VQBTTTUN.js → chunk-Y26YV5R3.js} +4 -4
  109. package/dist/{chunk-VQBTTTUN.js.map → chunk-Y26YV5R3.js.map} +1 -1
  110. package/dist/{chunk-NXFEYLVG.js → chunk-YM7LFCG7.js} +5 -4
  111. package/dist/{chunk-NXFEYLVG.js.map → chunk-YM7LFCG7.js.map} +1 -1
  112. package/dist/{chunk-CIMZBAZB.js → chunk-Z6FNBOTC.js} +1 -1
  113. package/dist/chunk-Z6FNBOTC.js.map +1 -0
  114. package/dist/chunk-ZROPXHJY.js +82 -0
  115. package/dist/chunk-ZROPXHJY.js.map +1 -0
  116. package/dist/consent/index.cjs.map +1 -1
  117. package/dist/consent/index.d.cts +7 -6
  118. package/dist/consent/index.d.ts +7 -6
  119. package/dist/consent/index.js +3 -3
  120. package/dist/{crypto-IVKU7YTT.js → crypto-2CRLG4F4.js} +3 -3
  121. package/dist/{delegation-2DBS2EOH.js → delegation-ZTRT2PRV.js} +5 -4
  122. package/dist/derivations/index.cjs +368 -0
  123. package/dist/derivations/index.cjs.map +1 -0
  124. package/dist/derivations/index.d.cts +72 -0
  125. package/dist/derivations/index.d.ts +72 -0
  126. package/dist/derivations/index.js +27 -0
  127. package/dist/{dev-unlock-Da1B0TIK.d.cts → dev-unlock-AglVnkPY.d.cts} +1 -1
  128. package/dist/{dev-unlock-BdPp68qn.d.ts → dev-unlock-BOEYl1xl.d.ts} +1 -1
  129. package/dist/discriminant-BN9REW3o.d.cts +60 -0
  130. package/dist/discriminant-BN9REW3o.d.ts +60 -0
  131. package/dist/executor-S76VN45G.js +8 -0
  132. package/dist/executor-UCXLIGLW.js +11 -0
  133. package/dist/executor-UCXLIGLW.js.map +1 -0
  134. package/dist/executor-ZCNZJMGR.js +8 -0
  135. package/dist/executor-ZCNZJMGR.js.map +1 -0
  136. package/dist/fanout-sidecar-OKPMMPLG.js +51 -0
  137. package/dist/fanout-sidecar-OKPMMPLG.js.map +1 -0
  138. package/dist/guards/index.cjs +322 -0
  139. package/dist/guards/index.cjs.map +1 -0
  140. package/dist/guards/index.d.cts +31 -0
  141. package/dist/guards/index.d.ts +31 -0
  142. package/dist/guards/index.js +29 -0
  143. package/dist/guards/index.js.map +1 -0
  144. package/dist/{hash-lsoL3eEW.d.ts → hash-B9m3_fhj.d.ts} +1 -1
  145. package/dist/{hash-BEfzPKwo.d.cts → hash-RVqz2zi8.d.cts} +1 -1
  146. package/dist/history/index.cjs +9 -2
  147. package/dist/history/index.cjs.map +1 -1
  148. package/dist/history/index.d.cts +8 -7
  149. package/dist/history/index.d.ts +8 -7
  150. package/dist/history/index.js +6 -6
  151. package/dist/i18n/index.cjs +368 -27
  152. package/dist/i18n/index.cjs.map +1 -1
  153. package/dist/i18n/index.d.cts +7 -6
  154. package/dist/i18n/index.d.ts +7 -6
  155. package/dist/i18n/index.js +34 -6
  156. package/dist/i18n/index.js.map +1 -1
  157. package/dist/{index-DJTf9yxn.d.ts → index-B8bjExET.d.cts} +508 -14
  158. package/dist/{index-6xNpPsxR.d.cts → index-DfUbNad8.d.ts} +508 -14
  159. package/dist/index.cjs +8779 -1260
  160. package/dist/index.cjs.map +1 -1
  161. package/dist/index.d.cts +231 -19
  162. package/dist/index.d.ts +231 -19
  163. package/dist/index.js +311 -7370
  164. package/dist/index.js.map +1 -1
  165. package/dist/indexing/index.cjs +7 -1
  166. package/dist/indexing/index.cjs.map +1 -1
  167. package/dist/indexing/index.d.cts +3 -3
  168. package/dist/indexing/index.d.ts +3 -3
  169. package/dist/indexing/index.js +4 -4
  170. package/dist/issue-3W6IVLKH.js +12 -0
  171. package/dist/issue-3W6IVLKH.js.map +1 -0
  172. package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Ci5_YG73.d.cts} +2 -2
  173. package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-D5GU14TS.d.ts} +2 -2
  174. package/dist/{ledger-QZTTHQAQ.js → ledger-O7FXOG3D.js} +6 -6
  175. package/dist/ledger-O7FXOG3D.js.map +1 -0
  176. package/dist/materialized-views/index.cjs +856 -0
  177. package/dist/materialized-views/index.cjs.map +1 -0
  178. package/dist/materialized-views/index.d.cts +186 -0
  179. package/dist/materialized-views/index.d.ts +186 -0
  180. package/dist/materialized-views/index.js +45 -0
  181. package/dist/materialized-views/index.js.map +1 -0
  182. package/dist/noydb-YAZNH5TI.js +34 -0
  183. package/dist/noydb-YAZNH5TI.js.map +1 -0
  184. package/dist/overlay-views/index.cjs +369 -0
  185. package/dist/overlay-views/index.cjs.map +1 -0
  186. package/dist/overlay-views/index.d.cts +82 -0
  187. package/dist/overlay-views/index.d.ts +82 -0
  188. package/dist/overlay-views/index.js +25 -0
  189. package/dist/overlay-views/index.js.map +1 -0
  190. package/dist/periods/index.cjs +7 -1
  191. package/dist/periods/index.cjs.map +1 -1
  192. package/dist/periods/index.d.cts +7 -6
  193. package/dist/periods/index.d.ts +7 -6
  194. package/dist/periods/index.js +6 -6
  195. package/dist/{predicate-SBHmi6D0.d.cts → predicate-Bt5ft-9c.d.cts} +51 -2
  196. package/dist/{predicate-SBHmi6D0.d.ts → predicate-Bt5ft-9c.d.ts} +51 -2
  197. package/dist/{public-envelope-6JTACYJV.js → public-envelope-HMYHZIRH.js} +4 -4
  198. package/dist/public-envelope-HMYHZIRH.js.map +1 -0
  199. package/dist/query/index.cjs +555 -128
  200. package/dist/query/index.cjs.map +1 -1
  201. package/dist/query/index.d.cts +3 -3
  202. package/dist/query/index.d.ts +3 -3
  203. package/dist/query/index.js +32 -11
  204. package/dist/read-only-facade-ITU6L7BL.js +7 -0
  205. package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
  206. package/dist/registry-DKEXOJVO.js +7 -0
  207. package/dist/registry-DKEXOJVO.js.map +1 -0
  208. package/dist/registry-ST2VNFZC.js +10 -0
  209. package/dist/registry-ST2VNFZC.js.map +1 -0
  210. package/dist/registry-UFIK7CSR.js +8 -0
  211. package/dist/registry-UFIK7CSR.js.map +1 -0
  212. package/dist/registry-ZGYYSM5I.js +8 -0
  213. package/dist/registry-ZGYYSM5I.js.map +1 -0
  214. package/dist/revoke-S6JMSLUN.js +17 -0
  215. package/dist/revoke-S6JMSLUN.js.map +1 -0
  216. package/dist/session/index.cjs +7 -1
  217. package/dist/session/index.cjs.map +1 -1
  218. package/dist/session/index.d.cts +8 -7
  219. package/dist/session/index.d.ts +8 -7
  220. package/dist/session/index.js +10 -3
  221. package/dist/session/index.js.map +1 -1
  222. package/dist/shadow/index.cjs.map +1 -1
  223. package/dist/shadow/index.d.cts +7 -6
  224. package/dist/shadow/index.d.ts +7 -6
  225. package/dist/shadow/index.js +2 -2
  226. package/dist/signer-7NPTB3SQ.js +18 -0
  227. package/dist/signer-7NPTB3SQ.js.map +1 -0
  228. package/dist/snapshots/index.cjs +937 -0
  229. package/dist/snapshots/index.cjs.map +1 -0
  230. package/dist/snapshots/index.d.cts +28 -0
  231. package/dist/snapshots/index.d.ts +28 -0
  232. package/dist/snapshots/index.js +152 -0
  233. package/dist/snapshots/index.js.map +1 -0
  234. package/dist/stale-VKXSXJF4.js +13 -0
  235. package/dist/stale-VKXSXJF4.js.map +1 -0
  236. package/dist/store/index.cjs +14 -0
  237. package/dist/store/index.cjs.map +1 -1
  238. package/dist/store/index.d.cts +7 -6
  239. package/dist/store/index.d.ts +7 -6
  240. package/dist/store/index.js +5 -2
  241. package/dist/{strategy-D-SrOLCl.d.ts → strategy-CT2LCKAX.d.cts} +84 -19
  242. package/dist/{strategy-D-SrOLCl.d.cts → strategy-CT2LCKAX.d.ts} +84 -19
  243. package/dist/sync/index.cjs.map +1 -1
  244. package/dist/sync/index.d.cts +6 -5
  245. package/dist/sync/index.d.ts +6 -5
  246. package/dist/sync/index.js +4 -4
  247. package/dist/team/index.cjs +1554 -2
  248. package/dist/team/index.cjs.map +1 -1
  249. package/dist/team/index.d.cts +7 -6
  250. package/dist/team/index.d.ts +7 -6
  251. package/dist/team/index.js +77 -8
  252. package/dist/tx/index.cjs +375 -43
  253. package/dist/tx/index.cjs.map +1 -1
  254. package/dist/tx/index.d.cts +8 -7
  255. package/dist/tx/index.d.ts +8 -7
  256. package/dist/tx/index.js +56 -3
  257. package/dist/tx/index.js.map +1 -1
  258. package/dist/{types-Bo7NSXJr.d.ts → types-CaNQm4i8.d.ts} +3902 -614
  259. package/dist/{types-Bnb82f5R.d.cts → types-n2_IfwlQ.d.cts} +3902 -614
  260. package/dist/{index-CywCC1qZ.d.cts → ulid-B9SMWj5i.d.ts} +216 -27
  261. package/dist/{index-8QDuznDr.d.ts → ulid-CLMjmyhG.d.cts} +216 -27
  262. package/dist/util/index.cjs +7 -0
  263. package/dist/util/index.cjs.map +1 -1
  264. package/dist/util/index.d.cts +2 -0
  265. package/dist/util/index.d.ts +2 -0
  266. package/dist/util/index.js +5 -1
  267. package/dist/util/index.js.map +1 -1
  268. package/dist/with-derivation-CVIOPTUf.d.ts +13 -0
  269. package/dist/with-derivation-aKrtS7Jj.d.cts +13 -0
  270. package/dist/with-guard-DZQbPzoP.d.cts +18 -0
  271. package/dist/with-guard-DseETUrF.d.ts +18 -0
  272. package/dist/with-materialized-view-C1eA1_T_.d.cts +27 -0
  273. package/dist/with-materialized-view-DaYaE8-Q.d.ts +27 -0
  274. package/dist/with-overlayed-view-DQsh2p8H.d.ts +13 -0
  275. package/dist/with-overlayed-view-DleJfKcV.d.cts +13 -0
  276. package/package.json +77 -3
  277. package/dist/chunk-2CSJGFCB.js.map +0 -1
  278. package/dist/chunk-ACLDOTNQ.js.map +0 -1
  279. package/dist/chunk-BTDCBVJW.js +0 -160
  280. package/dist/chunk-BTDCBVJW.js.map +0 -1
  281. package/dist/chunk-CIMZBAZB.js.map +0 -1
  282. package/dist/chunk-EXHNQEV4.js +0 -392
  283. package/dist/chunk-EXHNQEV4.js.map +0 -1
  284. package/dist/chunk-GOUT6DND.js.map +0 -1
  285. package/dist/chunk-M5INGEFC.js.map +0 -1
  286. package/dist/chunk-MDDTIZUO.js.map +0 -1
  287. package/dist/chunk-NPC4LFV5.js.map +0 -1
  288. package/dist/chunk-QAVUREFT.js.map +0 -1
  289. package/dist/chunk-RKJ6OL7K.js.map +0 -1
  290. package/dist/chunk-SCZXXXU4.js.map +0 -1
  291. package/dist/chunk-TDR6T5CJ.js.map +0 -1
  292. package/dist/chunk-WDM5XGGS.js.map +0 -1
  293. package/dist/chunk-ZFKD4QMV.js.map +0 -1
  294. /package/dist/{chunk-PTVMYYON.js.map → chunk-2N62W5YP.js.map} +0 -0
  295. /package/dist/{chunk-QGZRWRSL.js.map → chunk-3LPV6BXR.js.map} +0 -0
  296. /package/dist/{chunk-4PWAI7Q4.js.map → chunk-5OX6XVNS.js.map} +0 -0
  297. /package/dist/{chunk-AVVPZ4BC.js.map → chunk-DJRWA3Q5.js.map} +0 -0
  298. /package/dist/{chunk-M62XNWRA.js.map → chunk-LSTBFLL2.js.map} +0 -0
  299. /package/dist/{chunk-MR4424N3.js.map → chunk-R233SLY3.js.map} +0 -0
  300. /package/dist/{chunk-USKYUS74.js.map → chunk-RRNA5GKT.js.map} +0 -0
  301. /package/dist/{chunk-R36SIKES.js.map → chunk-RYIL3PI2.js.map} +0 -0
  302. /package/dist/{crypto-IVKU7YTT.js.map → crypto-2CRLG4F4.js.map} +0 -0
  303. /package/dist/{delegation-2DBS2EOH.js.map → delegation-ZTRT2PRV.js.map} +0 -0
  304. /package/dist/{ledger-QZTTHQAQ.js.map → derivations/index.js.map} +0 -0
  305. /package/dist/{public-envelope-6JTACYJV.js.map → executor-S76VN45G.js.map} +0 -0
@@ -26,6 +26,19 @@ var InvalidKeyError = class extends NoydbError {
26
26
  this.name = "InvalidKeyError";
27
27
  }
28
28
  };
29
+ var KeyringCorruptError = class extends NoydbError {
30
+ failedCollections;
31
+ intactCount;
32
+ constructor(opts) {
33
+ super(
34
+ "KEYRING_CORRUPT",
35
+ opts.message ?? `Keyring has ${opts.failedCollections.length} corrupted wrapped DEK(s) (${opts.failedCollections.join(", ")}); ${opts.intactCount} other DEK(s) unwrapped successfully \u2014 the passphrase is correct, the entries are damaged. Do NOT use onInvalidKey: 'reset' here \u2014 that would destroy the intact DEKs.`
36
+ );
37
+ this.name = "KeyringCorruptError";
38
+ this.failedCollections = opts.failedCollections;
39
+ this.intactCount = opts.intactCount;
40
+ }
41
+ };
29
42
  var NoAccessError = class extends NoydbError {
30
43
  constructor(message = "No access \u2014 user does not have a key for this collection") {
31
44
  super("NO_ACCESS", message);
@@ -139,6 +152,66 @@ var PeriodClosedError = class extends NoydbError {
139
152
  this.recordTs = recordTs;
140
153
  }
141
154
  };
155
+ var RecordLockedError = class extends NoydbError {
156
+ collection;
157
+ id;
158
+ reason;
159
+ constructor(collection, id, reason) {
160
+ super(
161
+ "RECORD_LOCKED",
162
+ `Cannot modify ${collection}/${id} \u2014 locked by guard: ${reason}. Use withTransactions({ amendment: true, reason }) with admin/owner role to override.`
163
+ );
164
+ this.name = "RecordLockedError";
165
+ this.collection = collection;
166
+ this.id = id;
167
+ this.reason = reason;
168
+ }
169
+ };
170
+ var FieldFrozenError = class extends NoydbError {
171
+ collection;
172
+ id;
173
+ fields;
174
+ constructor(collection, id, fields) {
175
+ super(
176
+ "FIELD_FROZEN",
177
+ `Cannot change frozen field(s) on ${collection}/${id}: ${fields.join(", ")}. Use withTransactions({ amendment: true, reason }) with admin/owner role to override.`
178
+ );
179
+ this.name = "FieldFrozenError";
180
+ this.collection = collection;
181
+ this.id = id;
182
+ this.fields = fields;
183
+ }
184
+ };
185
+ var InvariantError = class extends NoydbError {
186
+ constructor(message) {
187
+ super("INVARIANT_VIOLATED", message);
188
+ this.name = "InvariantError";
189
+ }
190
+ };
191
+ var AmendmentForbiddenError = class extends NoydbError {
192
+ userId;
193
+ role;
194
+ constructor(userId, role) {
195
+ super(
196
+ "AMENDMENT_FORBIDDEN",
197
+ `User "${userId}" with role "${role}" cannot open an amendment transaction. Amendments require admin or owner role.`
198
+ );
199
+ this.name = "AmendmentForbiddenError";
200
+ this.userId = userId;
201
+ this.role = role;
202
+ }
203
+ };
204
+ var DirectoryDisabledError = class extends NoydbError {
205
+ vault;
206
+ constructor(vault) {
207
+ super(
208
+ "DIRECTORY_DISABLED",
209
+ `Vault "${vault}" has its user directory disabled. Only owners and admins can call listUsersWithEnvelopes() here. Use db.setDirectoryEnabled(vault, true) to re-enable.`
210
+ );
211
+ this.name = "DirectoryDisabledError";
212
+ this.vault = vault;
213
+ }
214
+ };
142
215
  var TierNotGrantedError = class extends NoydbError {
143
216
  tier;
144
217
  collection;
@@ -253,6 +326,42 @@ var SchemaValidationError = class extends NoydbError {
253
326
  this.direction = direction;
254
327
  }
255
328
  };
329
+ var SchemaUpdateError = class extends NoydbError {
330
+ constructor(code, message) {
331
+ super(code, message);
332
+ this.name = "SchemaUpdateError";
333
+ }
334
+ };
335
+ var NonAdditiveSchemaChangeError = class extends SchemaUpdateError {
336
+ constructor(message) {
337
+ super("NON_ADDITIVE_SCHEMA_CHANGE", message);
338
+ this.name = "NonAdditiveSchemaChangeError";
339
+ }
340
+ };
341
+ var SchemaLockedError = class extends SchemaUpdateError {
342
+ constructor(message) {
343
+ super("SCHEMA_LOCKED", message);
344
+ this.name = "SchemaLockedError";
345
+ }
346
+ };
347
+ var SchemaFenceError = class extends SchemaUpdateError {
348
+ constructor(message) {
349
+ super("SCHEMA_FENCE", message);
350
+ this.name = "SchemaFenceError";
351
+ }
352
+ };
353
+ var MigrationRequiredError = class extends SchemaUpdateError {
354
+ constructor(message) {
355
+ super("MIGRATION_REQUIRED", message);
356
+ this.name = "MigrationRequiredError";
357
+ }
358
+ };
359
+ var QuiesceTimeoutError = class extends SchemaUpdateError {
360
+ constructor(message) {
361
+ super("QUIESCE_TIMEOUT", message);
362
+ this.name = "QuiesceTimeoutError";
363
+ }
364
+ };
256
365
  var GroupCardinalityError = class extends NoydbError {
257
366
  /** The field being grouped on. */
258
367
  field;
@@ -286,6 +395,31 @@ var IndexRequiredError = class extends NoydbError {
286
395
  this.missingFields = [...args.missingFields];
287
396
  }
288
397
  };
398
+ var UniqueConstraintError = class extends NoydbError {
399
+ collection;
400
+ recordId;
401
+ fields;
402
+ conflictingId;
403
+ constructor(collection, recordId, fields, conflictingId) {
404
+ super(
405
+ "UNIQUE_CONSTRAINT",
406
+ `Unique constraint on ${collection}.[${fields.join(", ")}] violated: record "${recordId}" duplicates a value already held by "${conflictingId}".`
407
+ );
408
+ this.name = "UniqueConstraintError";
409
+ this.collection = collection;
410
+ this.recordId = recordId;
411
+ this.fields = fields;
412
+ this.conflictingId = conflictingId;
413
+ }
414
+ };
415
+ var UnsupportedIndexOptionError = class extends NoydbError {
416
+ option;
417
+ constructor(option, message) {
418
+ super("UNSUPPORTED_INDEX_OPTION", message);
419
+ this.name = "UnsupportedIndexOptionError";
420
+ this.option = option;
421
+ }
422
+ };
289
423
  var IndexWriteFailureError = class extends NoydbError {
290
424
  recordId;
291
425
  field;
@@ -309,6 +443,26 @@ var BundleIntegrityError = class extends NoydbError {
309
443
  this.name = "BundleIntegrityError";
310
444
  }
311
445
  };
446
+ var BundleSealMismatchError = class extends NoydbError {
447
+ userId;
448
+ pid;
449
+ constructor(userId, pid) {
450
+ super(
451
+ "BUNDLE_SEAL_MISMATCH",
452
+ `bundle carries sealed passphrase for user "${userId}" under provider "${pid}", but no registered provider matches that pid.
453
+
454
+ Resolutions:
455
+ 1. Configure a provider matching the pid and retry import.
456
+ 2. Pass \`attemptUnsealAcrossProviders: true\` to try each registered
457
+ provider regardless of pid (extra credential prompts may surface).
458
+ 3. Inspect the bundle without unsealing \u2014 pass no \`sealingProviders\`
459
+ to receive the sealed entries unmodified for offline analysis.`
460
+ );
461
+ this.name = "BundleSealMismatchError";
462
+ this.userId = userId;
463
+ this.pid = pid;
464
+ }
465
+ };
312
466
  var ReservedCollectionNameError = class extends NoydbError {
313
467
  /** The rejected collection name. */
314
468
  collectionName;
@@ -384,6 +538,27 @@ var LocaleNotSpecifiedError = class extends NoydbError {
384
538
  this.field = field;
385
539
  }
386
540
  };
541
+ var ScriptViolationError = class extends NoydbError {
542
+ /** The field whose value violated its script constraint. */
543
+ field;
544
+ /** The locale slot (e.g. `'en'`) that was checked. */
545
+ locale;
546
+ /** The Unicode scripts allowed for this slot. */
547
+ expected;
548
+ /** A short sample of the offending characters, for diagnostics. */
549
+ sample;
550
+ constructor(field, locale, expected, sample, message) {
551
+ super(
552
+ "SCRIPT_VIOLATION",
553
+ message ?? `Field "${field}" slot "${locale}" expects script(s) [${expected.join(", ")}] but contains disallowed character(s): "${sample}".`
554
+ );
555
+ this.name = "ScriptViolationError";
556
+ this.field = field;
557
+ this.locale = locale;
558
+ this.expected = expected;
559
+ this.sample = sample;
560
+ }
561
+ };
387
562
  var TranslatorNotConfiguredError = class extends NoydbError {
388
563
  /** The field that requested auto-translation. */
389
564
  field;
@@ -419,6 +594,30 @@ var BackupCorruptedError = class extends NoydbError {
419
594
  this.id = id;
420
595
  }
421
596
  };
597
+ var PartitionExtractionError = class extends NoydbError {
598
+ constructor(message) {
599
+ super("PARTITION_EXTRACTION", message);
600
+ this.name = "PartitionExtractionError";
601
+ }
602
+ };
603
+ var TransferSealError = class extends NoydbError {
604
+ constructor(message) {
605
+ super("TRANSFER_SEAL", message);
606
+ this.name = "TransferSealError";
607
+ }
608
+ };
609
+ var AdoptionStateError = class extends NoydbError {
610
+ constructor(message) {
611
+ super("ADOPTION_STATE", message);
612
+ this.name = "AdoptionStateError";
613
+ }
614
+ };
615
+ var AttestationError = class extends NoydbError {
616
+ constructor(message) {
617
+ super("ATTESTATION", message);
618
+ this.name = "AttestationError";
619
+ }
620
+ };
422
621
  var SessionExpiredError = class extends NoydbError {
423
622
  sessionId;
424
623
  constructor(sessionId) {
@@ -460,6 +659,34 @@ var JoinTooLargeError = class extends NoydbError {
460
659
  this.side = opts.side;
461
660
  }
462
661
  };
662
+ var CrossJoinTooLargeError = class extends NoydbError {
663
+ target;
664
+ expected;
665
+ limit;
666
+ constructor(opts) {
667
+ super(
668
+ "CROSS_JOIN_TOO_LARGE",
669
+ `crossJoin("${opts.target}"): would produce ${opts.expected} rows, exceeding the limit of ${opts.limit}. Narrow the left side with .where() first, or raise the ceiling with crossJoin("${opts.target}", { ..., maxRows: ${opts.expected} }).`
670
+ );
671
+ this.name = "CrossJoinTooLargeError";
672
+ this.target = opts.target;
673
+ this.expected = opts.expected;
674
+ this.limit = opts.limit;
675
+ }
676
+ };
677
+ var CrossJoinSourceUnknownError = class extends NoydbError {
678
+ target;
679
+ leftCollection;
680
+ constructor(target, leftCollection) {
681
+ super(
682
+ "CROSS_JOIN_SOURCE_UNKNOWN",
683
+ `crossJoin("${target}"): collection "${target}" is not known in the vault (cross-joining from "${leftCollection}"). Make sure "${target}" is open in the same vault before executing this query.`
684
+ );
685
+ this.name = "CrossJoinSourceUnknownError";
686
+ this.target = target;
687
+ this.leftCollection = leftCollection;
688
+ }
689
+ };
463
690
  var DanglingReferenceError = class extends NoydbError {
464
691
  field;
465
692
  target;
@@ -491,12 +718,183 @@ var PathEscapeError = class extends NoydbError {
491
718
  this.targetDir = opts.targetDir;
492
719
  }
493
720
  };
721
+ var DerivationCycleError = class extends NoydbError {
722
+ path;
723
+ constructor(path) {
724
+ super(
725
+ "DERIVATION_CYCLE",
726
+ `Derivation graph contains a cycle: ${path.join(" \u2192 ")}. Refusing to open vault \u2014 break the cycle before retrying.`
727
+ );
728
+ this.name = "DerivationCycleError";
729
+ this.path = path;
730
+ }
731
+ };
732
+ var DerivationDepthError = class extends NoydbError {
733
+ limit;
734
+ attempted;
735
+ constructor(limit, attempted) {
736
+ super(
737
+ "DERIVATION_DEPTH",
738
+ `Derivation cascade exceeded max depth ${limit} (attempted ${attempted}). Pass lifecycle: { maxDepth: N } to raise the limit if intentional.`
739
+ );
740
+ this.name = "DerivationDepthError";
741
+ this.limit = limit;
742
+ this.attempted = attempted;
743
+ }
744
+ };
745
+ var DerivationOutputUnknownError = class extends NoydbError {
746
+ collection;
747
+ constructor(collection) {
748
+ super(
749
+ "DERIVATION_OUTPUT_UNKNOWN",
750
+ `Derivation output collection "${collection}" is not declared on the vault. Register the collection (e.g. via schema) before registering a derivation that writes to it.`
751
+ );
752
+ this.name = "DerivationOutputUnknownError";
753
+ this.collection = collection;
754
+ }
755
+ };
756
+ var DerivationOutputShapeError = class extends NoydbError {
757
+ outputKey;
758
+ constructor(outputKey, detail) {
759
+ super(
760
+ "DERIVATION_OUTPUT_SHAPE",
761
+ `Derivation output "${outputKey}" has invalid shape: ${detail}.`
762
+ );
763
+ this.name = "DerivationOutputShapeError";
764
+ this.outputKey = outputKey;
765
+ }
766
+ };
767
+ var DerivationCapExceededError = class extends NoydbError {
768
+ outputKey;
769
+ returned;
770
+ maxFanout;
771
+ constructor(outputKey, returned, maxFanout) {
772
+ super(
773
+ "DERIVATION_CAP_EXCEEDED",
774
+ `Derivation array output "${outputKey}" returned ${returned} rows, exceeding maxFanout=${maxFanout}. Raise \`maxFanout\` on the OutputSpec if this fanout is intended (the cap exists to keep dispatch cost bounded).`
775
+ );
776
+ this.name = "DerivationCapExceededError";
777
+ this.outputKey = outputKey;
778
+ this.returned = returned;
779
+ this.maxFanout = maxFanout;
780
+ }
781
+ };
782
+ var MaterializedViewCycleError = class extends NoydbError {
783
+ path;
784
+ constructor(path) {
785
+ super(
786
+ "MATERIALIZED_VIEW_CYCLE",
787
+ `Materialized-view graph contains a cycle: ${path.join(" \u2192 ")}. Refusing to open vault \u2014 break the cycle before retrying.`
788
+ );
789
+ this.name = "MaterializedViewCycleError";
790
+ this.path = path;
791
+ }
792
+ };
793
+ var MaterializedViewSourceUnknownError = class extends NoydbError {
794
+ mvName;
795
+ collection;
796
+ constructor(mvName, collection) {
797
+ super(
798
+ "MATERIALIZED_VIEW_SOURCE_UNKNOWN",
799
+ `Materialized view "${mvName}" references unknown source collection "${collection}". Declare the collection (e.g. via schema or by writing to it once) before registering the MV.`
800
+ );
801
+ this.name = "MaterializedViewSourceUnknownError";
802
+ this.mvName = mvName;
803
+ this.collection = collection;
804
+ }
805
+ };
806
+ var MaterializedViewTooLargeError = class extends NoydbError {
807
+ mvName;
808
+ expected;
809
+ limit;
810
+ constructor(mvName, expected, limit) {
811
+ super(
812
+ "MATERIALIZED_VIEW_TOO_LARGE",
813
+ `Materialized view "${mvName}" would emit ${expected} rows, exceeding the configured limit of ${limit}. Override via { maxRows: N } on the MV strategy if intentional, or tighten the query's filter/groupBy.`
814
+ );
815
+ this.name = "MaterializedViewTooLargeError";
816
+ this.mvName = mvName;
817
+ this.expected = expected;
818
+ this.limit = limit;
819
+ }
820
+ };
821
+ var MaterializedViewConfigError = class extends NoydbError {
822
+ constructor(message) {
823
+ super(
824
+ "MATERIALIZED_VIEW_CONFIG",
825
+ `[noy-db] withMaterializedView: ${message}`
826
+ );
827
+ this.name = "MaterializedViewConfigError";
828
+ }
829
+ };
830
+ var OverlayBaseIsVirtualError = class extends NoydbError {
831
+ overlayName;
832
+ base;
833
+ constructor(overlayName, base) {
834
+ super(
835
+ "OVERLAY_BASE_IS_VIRTUAL",
836
+ `withOverlayedView "${overlayName}": base "${base}" is another overlay's virtual name. Multi-overlay stacking is a v3 feature; base must reference a concrete collection (a real source or an MV output).`
837
+ );
838
+ this.name = "OverlayBaseIsVirtualError";
839
+ this.overlayName = overlayName;
840
+ this.base = base;
841
+ }
842
+ };
843
+ var OverlayCollectionUnavailableError = class extends NoydbError {
844
+ overlayName;
845
+ overlay;
846
+ constructor(overlayName, overlay) {
847
+ super(
848
+ "OVERLAY_COLLECTION_UNAVAILABLE",
849
+ `withOverlayedView "${overlayName}": overlay collection "${overlay}" is unavailable. It must be a real vault-known collection that is NOT itself an MV output collection.`
850
+ );
851
+ this.name = "OverlayCollectionUnavailableError";
852
+ this.overlayName = overlayName;
853
+ this.overlay = overlay;
854
+ }
855
+ };
856
+ var OverlayNameCollisionError = class extends NoydbError {
857
+ overlayName;
858
+ constructor(overlayName) {
859
+ super(
860
+ "OVERLAY_NAME_COLLISION",
861
+ `withOverlayedView "${overlayName}": virtual name collides with an MV output or a concrete source collection. Pick a unique name for the virtual collection.`
862
+ );
863
+ this.name = "OverlayNameCollisionError";
864
+ this.overlayName = overlayName;
865
+ }
866
+ };
867
+ var OverlayIdMismatchError = class extends NoydbError {
868
+ actual;
869
+ expected;
870
+ constructor(actual, expected) {
871
+ super(
872
+ "OVERLAY_ID_MISMATCH",
873
+ `Overlay put(id, record): id "${actual}" does not match the base MV's rowKey(record) \u2192 "${expected}". Pass the row directly via .put(record) to derive the id, or fix the id to match the base MV's rowKey output.`
874
+ );
875
+ this.name = "OverlayIdMismatchError";
876
+ this.actual = actual;
877
+ this.expected = expected;
878
+ }
879
+ };
880
+ var SnapshotNotFoundError = class extends NoydbError {
881
+ version;
882
+ constructor(version) {
883
+ super(
884
+ "SNAPSHOT_NOT_FOUND",
885
+ `Snapshot not found: "${version}" does not exist in the snapshot store. It may have been pruned by the retention policy or deleted manually.`
886
+ );
887
+ this.name = "SnapshotNotFoundError";
888
+ this.version = version;
889
+ }
890
+ };
494
891
 
495
892
  export {
496
893
  NoydbError,
497
894
  DecryptionError,
498
895
  TamperedError,
499
896
  InvalidKeyError,
897
+ KeyringCorruptError,
500
898
  NoAccessError,
501
899
  ReadOnlyError,
502
900
  ReadOnlyAtInstantError,
@@ -508,6 +906,11 @@ export {
508
906
  StoreCapabilityError,
509
907
  PrivilegeEscalationError,
510
908
  PeriodClosedError,
909
+ RecordLockedError,
910
+ FieldFrozenError,
911
+ InvariantError,
912
+ AmendmentForbiddenError,
913
+ DirectoryDisabledError,
511
914
  TierNotGrantedError,
512
915
  ElevationExpiredError,
513
916
  AlreadyElevatedError,
@@ -520,24 +923,54 @@ export {
520
923
  NotFoundError,
521
924
  ValidationError,
522
925
  SchemaValidationError,
926
+ SchemaUpdateError,
927
+ NonAdditiveSchemaChangeError,
928
+ SchemaLockedError,
929
+ SchemaFenceError,
930
+ MigrationRequiredError,
931
+ QuiesceTimeoutError,
523
932
  GroupCardinalityError,
524
933
  IndexRequiredError,
934
+ UniqueConstraintError,
935
+ UnsupportedIndexOptionError,
525
936
  IndexWriteFailureError,
526
937
  BundleIntegrityError,
938
+ BundleSealMismatchError,
527
939
  ReservedCollectionNameError,
528
940
  DictKeyMissingError,
529
941
  DictKeyInUseError,
530
942
  MissingTranslationError,
531
943
  LocaleNotSpecifiedError,
944
+ ScriptViolationError,
532
945
  TranslatorNotConfiguredError,
533
946
  BackupLedgerError,
534
947
  BackupCorruptedError,
948
+ PartitionExtractionError,
949
+ TransferSealError,
950
+ AdoptionStateError,
951
+ AttestationError,
535
952
  SessionExpiredError,
536
953
  SessionNotFoundError,
537
954
  SessionPolicyError,
538
955
  JoinTooLargeError,
956
+ CrossJoinTooLargeError,
957
+ CrossJoinSourceUnknownError,
539
958
  DanglingReferenceError,
540
959
  FilenameSanitizationError,
541
- PathEscapeError
542
- };
543
- //# sourceMappingURL=chunk-ACLDOTNQ.js.map
960
+ PathEscapeError,
961
+ DerivationCycleError,
962
+ DerivationDepthError,
963
+ DerivationOutputUnknownError,
964
+ DerivationOutputShapeError,
965
+ DerivationCapExceededError,
966
+ MaterializedViewCycleError,
967
+ MaterializedViewSourceUnknownError,
968
+ MaterializedViewTooLargeError,
969
+ MaterializedViewConfigError,
970
+ OverlayBaseIsVirtualError,
971
+ OverlayCollectionUnavailableError,
972
+ OverlayNameCollisionError,
973
+ OverlayIdMismatchError,
974
+ SnapshotNotFoundError
975
+ };
976
+ //# sourceMappingURL=chunk-O6EJ6WTI.js.map