@noy-db/hub 0.2.0-pre.16 → 0.2.0-pre.18

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 (306) hide show
  1. package/dist/aggregate/index.cjs.map +1 -1
  2. package/dist/aggregate/index.d.cts +3 -2
  3. package/dist/aggregate/index.d.ts +3 -2
  4. package/dist/aggregate/index.js +4 -4
  5. package/dist/attestation/index.cjs.map +1 -1
  6. package/dist/attestation/index.d.cts +5 -3
  7. package/dist/attestation/index.d.ts +5 -3
  8. package/dist/attestation/index.js +6 -6
  9. package/dist/blobs/index.cjs +226 -11
  10. package/dist/blobs/index.cjs.map +1 -1
  11. package/dist/blobs/index.d.cts +6 -4
  12. package/dist/blobs/index.d.ts +6 -4
  13. package/dist/blobs/index.js +6 -5
  14. package/dist/blobs/index.js.map +1 -1
  15. package/dist/bundle/index.cjs +2065 -352
  16. package/dist/bundle/index.cjs.map +1 -1
  17. package/dist/bundle/index.d.cts +7 -5
  18. package/dist/bundle/index.d.ts +7 -5
  19. package/dist/bundle/index.js +21 -10
  20. package/dist/bundle/index.js.map +1 -1
  21. package/dist/{chunk-6RR3MNMG.js → chunk-2U226RDC.js} +3 -3
  22. package/dist/{chunk-L2BNJ6HM.js → chunk-32XVU2LT.js} +3 -3
  23. package/dist/{chunk-X73VS74Y.js → chunk-33DAO2XG.js} +2 -2
  24. package/dist/chunk-45643PAU.js +151 -0
  25. package/dist/chunk-45643PAU.js.map +1 -0
  26. package/dist/{chunk-QSUK7YWK.js → chunk-4UI5T3K7.js} +4 -4
  27. package/dist/{chunk-G4SCICH5.js → chunk-5KKNBDCT.js} +2 -2
  28. package/dist/{chunk-DUREQF5W.js → chunk-647TFNYL.js} +34 -8
  29. package/dist/chunk-647TFNYL.js.map +1 -0
  30. package/dist/{chunk-E2CDVKMH.js → chunk-6FHCU3QO.js} +5 -5
  31. package/dist/{chunk-F4OJZIWQ.js → chunk-6Q5XRLKG.js} +4 -4
  32. package/dist/{chunk-HOR4R722.js → chunk-6XEGHIBA.js} +30 -4
  33. package/dist/chunk-6XEGHIBA.js.map +1 -0
  34. package/dist/{chunk-4TBBMHVC.js → chunk-6YEC7LLO.js} +2 -2
  35. package/dist/{chunk-ZNQYHJXX.js → chunk-AB7JF2KF.js} +2 -2
  36. package/dist/{chunk-UMLVJTYV.js → chunk-ADB7GPM3.js} +7 -4
  37. package/dist/chunk-ADB7GPM3.js.map +1 -0
  38. package/dist/{chunk-XL35NSEN.js → chunk-BUBJYIZ7.js} +3 -3
  39. package/dist/chunk-C2OYWD5S.js +125 -0
  40. package/dist/chunk-C2OYWD5S.js.map +1 -0
  41. package/dist/{chunk-KABJXG2F.js → chunk-CMISAJAE.js} +195 -17
  42. package/dist/chunk-CMISAJAE.js.map +1 -0
  43. package/dist/{chunk-3YWP3WBP.js → chunk-DKMPR76W.js} +5 -5
  44. package/dist/{chunk-BI6ETQPF.js → chunk-DR5I7Q6N.js} +4 -4
  45. package/dist/{chunk-667MB6AH.js → chunk-F2IJ2HGD.js} +1370 -232
  46. package/dist/chunk-F2IJ2HGD.js.map +1 -0
  47. package/dist/{chunk-6H2ZUNR7.js → chunk-FQRAYDS4.js} +4 -4
  48. package/dist/{chunk-535SSHBS.js → chunk-HMFC6M2G.js} +99 -2
  49. package/dist/chunk-HMFC6M2G.js.map +1 -0
  50. package/dist/{chunk-TS26M2SB.js → chunk-HOO5I3VG.js} +2 -2
  51. package/dist/{chunk-OMAMZKKD.js → chunk-HWK75CYX.js} +2 -2
  52. package/dist/{chunk-TKIY625R.js → chunk-HZOEBM67.js} +2 -2
  53. package/dist/{chunk-DLZ2ONOD.js → chunk-IQ4GMEYZ.js} +6 -6
  54. package/dist/{chunk-XWH4MXIU.js → chunk-K3NYRK7U.js} +2 -2
  55. package/dist/{chunk-7BQ4QWYX.js → chunk-KOURQXIU.js} +23 -6
  56. package/dist/chunk-KOURQXIU.js.map +1 -0
  57. package/dist/{chunk-7Z7KSVA5.js → chunk-KQ523X3A.js} +15 -2
  58. package/dist/chunk-KQ523X3A.js.map +1 -0
  59. package/dist/{chunk-JD3OZAI4.js → chunk-KTZ2MHQK.js} +2 -2
  60. package/dist/{chunk-F3BPIPLS.js → chunk-LGPSCKWZ.js} +1 -1
  61. package/dist/chunk-LGPSCKWZ.js.map +1 -0
  62. package/dist/{chunk-SCJPI4Z5.js → chunk-LQ3GD5LL.js} +5 -5
  63. package/dist/{chunk-AAVWKNZW.js → chunk-M3H7VSRV.js} +2 -2
  64. package/dist/{chunk-BR3AMFGS.js → chunk-MGB67HKX.js} +5 -5
  65. package/dist/{chunk-GNI5STXQ.js → chunk-P57D4KBG.js} +52 -38
  66. package/dist/chunk-P57D4KBG.js.map +1 -0
  67. package/dist/{chunk-Z6FNBOTC.js → chunk-PDVP3C2I.js} +1 -1
  68. package/dist/{chunk-Z6FNBOTC.js.map → chunk-PDVP3C2I.js.map} +1 -1
  69. package/dist/{chunk-OB2ZJQ2D.js → chunk-PGVEL5IZ.js} +3 -3
  70. package/dist/{chunk-YULZKK4F.js → chunk-QJKZ5WUP.js} +37 -2
  71. package/dist/chunk-QJKZ5WUP.js.map +1 -0
  72. package/dist/{chunk-BQ65SS5A.js → chunk-QPJ7Z4L3.js} +2 -2
  73. package/dist/{chunk-CZI2A4MQ.js → chunk-RQFG2YSV.js} +3 -3
  74. package/dist/{chunk-CJORTUJ2.js → chunk-RZWQNMMP.js} +2 -2
  75. package/dist/{chunk-FFXM3ZIF.js → chunk-T4T5I5L6.js} +3 -3
  76. package/dist/{chunk-QVIEAYTP.js → chunk-TFAN3NFD.js} +3 -3
  77. package/dist/{chunk-Z4DO7YSI.js → chunk-TPOHMOGX.js} +2 -2
  78. package/dist/{chunk-VLMPU56Q.js → chunk-TTS3RWL5.js} +2 -2
  79. package/dist/{chunk-IXBIFDEW.js → chunk-VVDSDOVV.js} +4 -4
  80. package/dist/{chunk-FWPKCXTN.js → chunk-WZCG3EZ6.js} +2 -2
  81. package/dist/{chunk-HBXJ37ZY.js → chunk-Y5XVB75E.js} +4 -4
  82. package/dist/chunk-YWYW2YNO.js +129 -0
  83. package/dist/chunk-YWYW2YNO.js.map +1 -0
  84. package/dist/{chunk-IQLVUT37.js → chunk-Z3BE5BRK.js} +2 -2
  85. package/dist/{chunk-42FEUPZQ.js → chunk-Z3I2WNGF.js} +58 -3
  86. package/dist/chunk-Z3I2WNGF.js.map +1 -0
  87. package/dist/{state-vault-TMXZRTY5.js → chunk-ZJ67TB4S.js} +24 -7
  88. package/dist/chunk-ZJ67TB4S.js.map +1 -0
  89. package/dist/consent/index.cjs.map +1 -1
  90. package/dist/consent/index.d.cts +6 -4
  91. package/dist/consent/index.d.ts +6 -4
  92. package/dist/consent/index.js +3 -3
  93. package/dist/{crypto-QXQOHMHF.js → crypto-FNK3XPCS.js} +7 -3
  94. package/dist/{delegation-NIQ43IPU.js → delegation-FMXNUWE6.js} +5 -5
  95. package/dist/derivations/index.cjs +82 -2
  96. package/dist/derivations/index.cjs.map +1 -1
  97. package/dist/derivations/index.d.cts +7 -5
  98. package/dist/derivations/index.d.ts +7 -5
  99. package/dist/derivations/index.js +8 -6
  100. package/dist/{dev-unlock-8XzcD2Z4.d.cts → dev-unlock-3_2b_vo6.d.cts} +1 -1
  101. package/dist/{dev-unlock-DR3upLd1.d.ts → dev-unlock-BMvwPr_E.d.ts} +1 -1
  102. package/dist/{strategy-BtW8fAjz.d.cts → errors-DUTlAt3Y.d.cts} +113 -727
  103. package/dist/{strategy-BtW8fAjz.d.ts → errors-DUTlAt3Y.d.ts} +113 -727
  104. package/dist/executor-IZ2NVXCY.js +11 -0
  105. package/dist/executor-THSEYEJG.js +8 -0
  106. package/dist/executor-WLFDUTOM.js +8 -0
  107. package/dist/{fanout-sidecar-67CMI3UT.js → fanout-sidecar-JGHXAJO5.js} +2 -2
  108. package/dist/forget/index.cjs +43 -0
  109. package/dist/forget/index.cjs.map +1 -0
  110. package/dist/forget/index.d.cts +1 -0
  111. package/dist/forget/index.d.ts +1 -0
  112. package/dist/forget/index.js +14 -0
  113. package/dist/guards/index.cjs +80 -3
  114. package/dist/guards/index.cjs.map +1 -1
  115. package/dist/guards/index.d.cts +7 -5
  116. package/dist/guards/index.d.ts +7 -5
  117. package/dist/guards/index.js +10 -6
  118. package/dist/{hash-CDjye9KV.d.ts → hash-BThBJFO1.d.ts} +1 -1
  119. package/dist/{hash-DuQ88_5W.d.cts → hash-BnWnL9bQ.d.cts} +1 -1
  120. package/dist/history/index.cjs +27 -4
  121. package/dist/history/index.cjs.map +1 -1
  122. package/dist/history/index.d.cts +7 -5
  123. package/dist/history/index.d.ts +7 -5
  124. package/dist/history/index.js +9 -7
  125. package/dist/history/index.js.map +1 -1
  126. package/dist/i18n/index.cjs +53 -0
  127. package/dist/i18n/index.cjs.map +1 -1
  128. package/dist/i18n/index.d.cts +6 -4
  129. package/dist/i18n/index.d.ts +6 -4
  130. package/dist/i18n/index.js +16 -8
  131. package/dist/i18n/index.js.map +1 -1
  132. package/dist/index-C-SSRIxP.d.cts +348 -0
  133. package/dist/index-C-SSRIxP.d.ts +348 -0
  134. package/dist/{index-C8Bk3-VF.d.cts → index-C6lgoUhK.d.cts} +47 -2
  135. package/dist/{index-nP99bXLg.d.ts → index-DP1JTWHZ.d.ts} +47 -2
  136. package/dist/index.cjs +3280 -1208
  137. package/dist/index.cjs.map +1 -1
  138. package/dist/index.d.cts +15 -12
  139. package/dist/index.d.ts +15 -12
  140. package/dist/index.js +149 -107
  141. package/dist/index.js.map +1 -1
  142. package/dist/indexing/index.cjs.map +1 -1
  143. package/dist/indexing/index.js +4 -4
  144. package/dist/issue-R2MWQO6K.js +12 -0
  145. package/dist/{ledger-A3LL253R.js → ledger-GXC2YA3A.js} +6 -6
  146. package/dist/materialized-views/index.cjs.map +1 -1
  147. package/dist/materialized-views/index.d.cts +7 -5
  148. package/dist/materialized-views/index.d.ts +7 -5
  149. package/dist/materialized-views/index.js +12 -12
  150. package/dist/noydb-RJL6FQ4B.js +37 -0
  151. package/dist/overlay-views/index.cjs.map +1 -1
  152. package/dist/overlay-views/index.d.cts +7 -5
  153. package/dist/overlay-views/index.d.ts +7 -5
  154. package/dist/overlay-views/index.js +4 -4
  155. package/dist/periods/index.cjs.map +1 -1
  156. package/dist/periods/index.d.cts +6 -4
  157. package/dist/periods/index.d.ts +6 -4
  158. package/dist/periods/index.js +6 -6
  159. package/dist/{public-envelope-YP2UWMLG.js → public-envelope-HXOFHY4N.js} +4 -4
  160. package/dist/query/index.cjs +30 -4
  161. package/dist/query/index.cjs.map +1 -1
  162. package/dist/query/index.d.cts +3 -2
  163. package/dist/query/index.d.ts +3 -2
  164. package/dist/query/index.js +6 -6
  165. package/dist/read-only-facade-EX6WZZBP.js +7 -0
  166. package/dist/registry-3T2RZC5A.js +8 -0
  167. package/dist/registry-DMS7OKBM.js +8 -0
  168. package/dist/{registry-UTA4CLQS.js → registry-WVXO6NH5.js} +3 -3
  169. package/dist/{revoke-HNMQZSCL.js → revoke-7LCWE2AH.js} +6 -6
  170. package/dist/sealed-record/index.cjs +139 -0
  171. package/dist/sealed-record/index.cjs.map +1 -0
  172. package/dist/sealed-record/index.d.cts +123 -0
  173. package/dist/sealed-record/index.d.ts +123 -0
  174. package/dist/sealed-record/index.js +42 -0
  175. package/dist/sealed-record/index.js.map +1 -0
  176. package/dist/session/index.cjs.map +1 -1
  177. package/dist/session/index.d.cts +7 -5
  178. package/dist/session/index.d.ts +7 -5
  179. package/dist/session/index.js +3 -3
  180. package/dist/shadow/index.cjs.map +1 -1
  181. package/dist/shadow/index.d.cts +6 -4
  182. package/dist/shadow/index.d.ts +6 -4
  183. package/dist/shadow/index.js +2 -2
  184. package/dist/{signer-DCMNKXSF.js → signer-HAVDLGOK.js} +5 -5
  185. package/dist/snapshots/index.cjs.map +1 -1
  186. package/dist/snapshots/index.d.cts +6 -4
  187. package/dist/snapshots/index.d.ts +6 -4
  188. package/dist/snapshots/index.js +4 -4
  189. package/dist/{stale-W5PQTRYH.js → stale-PGTEGJDI.js} +2 -2
  190. package/dist/stale-PGTEGJDI.js.map +1 -0
  191. package/dist/state-vault-QKQKN3H3.js +14 -0
  192. package/dist/state-vault-QKQKN3H3.js.map +1 -0
  193. package/dist/store/index.cjs.map +1 -1
  194. package/dist/store/index.d.cts +6 -4
  195. package/dist/store/index.d.ts +6 -4
  196. package/dist/store/index.js +2 -2
  197. package/dist/strategy-Diwh5lzS.d.ts +739 -0
  198. package/dist/strategy-nuyN8K5N.d.cts +739 -0
  199. package/dist/sync/index.cjs.map +1 -1
  200. package/dist/sync/index.d.cts +5 -3
  201. package/dist/sync/index.d.ts +5 -3
  202. package/dist/sync/index.js +4 -4
  203. package/dist/team/index.cjs.map +1 -1
  204. package/dist/team/index.d.cts +6 -4
  205. package/dist/team/index.d.ts +6 -4
  206. package/dist/team/index.js +8 -8
  207. package/dist/transition-guard--t3exQHF.d.cts +165 -0
  208. package/dist/transition-guard-BlI9Oy5K.d.ts +165 -0
  209. package/dist/tx/index.cjs.map +1 -1
  210. package/dist/tx/index.d.cts +6 -4
  211. package/dist/tx/index.d.ts +6 -4
  212. package/dist/tx/index.js +3 -3
  213. package/dist/{types-Bze6vkwm.d.cts → types-BpLPqyaO.d.cts} +1264 -513
  214. package/dist/{types-DrmBTscX.d.ts → types-Diqc2caK.d.ts} +1264 -513
  215. package/dist/{ulid-DbBVrNSt.d.ts → ulid-B1zNV8r9.d.ts} +1 -1
  216. package/dist/{ulid-DfZlAh0u.d.cts → ulid-DNiRB4Mx.d.cts} +1 -1
  217. package/dist/util/index.cjs.map +1 -1
  218. package/dist/util/index.js +1 -1
  219. package/dist/{vault-group-DX2HFQMX.js → vault-group-DPZVFRI5.js} +182 -6
  220. package/dist/vault-group-DPZVFRI5.js.map +1 -0
  221. package/dist/{with-materialized-view--4PsvMDu.d.cts → with-materialized-view-BdH_A_r6.d.cts} +1 -1
  222. package/dist/{with-materialized-view-QT1Tp7NO.d.ts → with-materialized-view-CzAgp_HJ.d.ts} +1 -1
  223. package/dist/{with-overlayed-view-BEXfpzSb.d.ts → with-overlayed-view-BJbqQnsR.d.ts} +1 -1
  224. package/dist/{with-overlayed-view-DlH5qmeB.d.cts → with-overlayed-view-C40rDPlu.d.cts} +1 -1
  225. package/dist/with-rollup-Bopu5UDZ.d.cts +47 -0
  226. package/dist/with-rollup-DrlGkxiE.d.ts +47 -0
  227. package/package.json +23 -3
  228. package/dist/chunk-42FEUPZQ.js.map +0 -1
  229. package/dist/chunk-535SSHBS.js.map +0 -1
  230. package/dist/chunk-667MB6AH.js.map +0 -1
  231. package/dist/chunk-7BQ4QWYX.js.map +0 -1
  232. package/dist/chunk-7Z7KSVA5.js.map +0 -1
  233. package/dist/chunk-DUREQF5W.js.map +0 -1
  234. package/dist/chunk-F3BPIPLS.js.map +0 -1
  235. package/dist/chunk-GNI5STXQ.js.map +0 -1
  236. package/dist/chunk-HOR4R722.js.map +0 -1
  237. package/dist/chunk-KABJXG2F.js.map +0 -1
  238. package/dist/chunk-OQSRJG6A.js +0 -63
  239. package/dist/chunk-OQSRJG6A.js.map +0 -1
  240. package/dist/chunk-UMLVJTYV.js.map +0 -1
  241. package/dist/chunk-YULZKK4F.js.map +0 -1
  242. package/dist/executor-6ZDSDZ6V.js +0 -8
  243. package/dist/executor-AZLS3KBK.js +0 -11
  244. package/dist/executor-IDZDAFNH.js +0 -8
  245. package/dist/immutable-guard-CRPvu24K.d.cts +0 -82
  246. package/dist/immutable-guard-Dov3WvwF.d.ts +0 -82
  247. package/dist/issue-RZP3VI6O.js +0 -12
  248. package/dist/noydb-WCMY2ZOW.js +0 -35
  249. package/dist/read-only-facade-ITU6L7BL.js +0 -7
  250. package/dist/registry-EB6SISTA.js +0 -8
  251. package/dist/registry-IUZQVVBB.js +0 -8
  252. package/dist/state-vault-TMXZRTY5.js.map +0 -1
  253. package/dist/vault-group-DX2HFQMX.js.map +0 -1
  254. package/dist/with-derivation-CCqAchD5.d.cts +0 -13
  255. package/dist/with-derivation-_lySGdlm.d.ts +0 -13
  256. /package/dist/{chunk-6RR3MNMG.js.map → chunk-2U226RDC.js.map} +0 -0
  257. /package/dist/{chunk-L2BNJ6HM.js.map → chunk-32XVU2LT.js.map} +0 -0
  258. /package/dist/{chunk-X73VS74Y.js.map → chunk-33DAO2XG.js.map} +0 -0
  259. /package/dist/{chunk-QSUK7YWK.js.map → chunk-4UI5T3K7.js.map} +0 -0
  260. /package/dist/{chunk-G4SCICH5.js.map → chunk-5KKNBDCT.js.map} +0 -0
  261. /package/dist/{chunk-E2CDVKMH.js.map → chunk-6FHCU3QO.js.map} +0 -0
  262. /package/dist/{chunk-F4OJZIWQ.js.map → chunk-6Q5XRLKG.js.map} +0 -0
  263. /package/dist/{chunk-4TBBMHVC.js.map → chunk-6YEC7LLO.js.map} +0 -0
  264. /package/dist/{chunk-ZNQYHJXX.js.map → chunk-AB7JF2KF.js.map} +0 -0
  265. /package/dist/{chunk-XL35NSEN.js.map → chunk-BUBJYIZ7.js.map} +0 -0
  266. /package/dist/{chunk-3YWP3WBP.js.map → chunk-DKMPR76W.js.map} +0 -0
  267. /package/dist/{chunk-BI6ETQPF.js.map → chunk-DR5I7Q6N.js.map} +0 -0
  268. /package/dist/{chunk-6H2ZUNR7.js.map → chunk-FQRAYDS4.js.map} +0 -0
  269. /package/dist/{chunk-TS26M2SB.js.map → chunk-HOO5I3VG.js.map} +0 -0
  270. /package/dist/{chunk-OMAMZKKD.js.map → chunk-HWK75CYX.js.map} +0 -0
  271. /package/dist/{chunk-TKIY625R.js.map → chunk-HZOEBM67.js.map} +0 -0
  272. /package/dist/{chunk-DLZ2ONOD.js.map → chunk-IQ4GMEYZ.js.map} +0 -0
  273. /package/dist/{chunk-XWH4MXIU.js.map → chunk-K3NYRK7U.js.map} +0 -0
  274. /package/dist/{chunk-JD3OZAI4.js.map → chunk-KTZ2MHQK.js.map} +0 -0
  275. /package/dist/{chunk-SCJPI4Z5.js.map → chunk-LQ3GD5LL.js.map} +0 -0
  276. /package/dist/{chunk-AAVWKNZW.js.map → chunk-M3H7VSRV.js.map} +0 -0
  277. /package/dist/{chunk-BR3AMFGS.js.map → chunk-MGB67HKX.js.map} +0 -0
  278. /package/dist/{chunk-OB2ZJQ2D.js.map → chunk-PGVEL5IZ.js.map} +0 -0
  279. /package/dist/{chunk-BQ65SS5A.js.map → chunk-QPJ7Z4L3.js.map} +0 -0
  280. /package/dist/{chunk-CZI2A4MQ.js.map → chunk-RQFG2YSV.js.map} +0 -0
  281. /package/dist/{chunk-CJORTUJ2.js.map → chunk-RZWQNMMP.js.map} +0 -0
  282. /package/dist/{chunk-FFXM3ZIF.js.map → chunk-T4T5I5L6.js.map} +0 -0
  283. /package/dist/{chunk-QVIEAYTP.js.map → chunk-TFAN3NFD.js.map} +0 -0
  284. /package/dist/{chunk-Z4DO7YSI.js.map → chunk-TPOHMOGX.js.map} +0 -0
  285. /package/dist/{chunk-VLMPU56Q.js.map → chunk-TTS3RWL5.js.map} +0 -0
  286. /package/dist/{chunk-IXBIFDEW.js.map → chunk-VVDSDOVV.js.map} +0 -0
  287. /package/dist/{chunk-FWPKCXTN.js.map → chunk-WZCG3EZ6.js.map} +0 -0
  288. /package/dist/{chunk-HBXJ37ZY.js.map → chunk-Y5XVB75E.js.map} +0 -0
  289. /package/dist/{chunk-IQLVUT37.js.map → chunk-Z3BE5BRK.js.map} +0 -0
  290. /package/dist/{crypto-QXQOHMHF.js.map → crypto-FNK3XPCS.js.map} +0 -0
  291. /package/dist/{delegation-NIQ43IPU.js.map → delegation-FMXNUWE6.js.map} +0 -0
  292. /package/dist/{executor-6ZDSDZ6V.js.map → executor-IZ2NVXCY.js.map} +0 -0
  293. /package/dist/{executor-AZLS3KBK.js.map → executor-THSEYEJG.js.map} +0 -0
  294. /package/dist/{executor-IDZDAFNH.js.map → executor-WLFDUTOM.js.map} +0 -0
  295. /package/dist/{fanout-sidecar-67CMI3UT.js.map → fanout-sidecar-JGHXAJO5.js.map} +0 -0
  296. /package/dist/{issue-RZP3VI6O.js.map → forget/index.js.map} +0 -0
  297. /package/dist/{ledger-A3LL253R.js.map → issue-R2MWQO6K.js.map} +0 -0
  298. /package/dist/{noydb-WCMY2ZOW.js.map → ledger-GXC2YA3A.js.map} +0 -0
  299. /package/dist/{public-envelope-YP2UWMLG.js.map → noydb-RJL6FQ4B.js.map} +0 -0
  300. /package/dist/{read-only-facade-ITU6L7BL.js.map → public-envelope-HXOFHY4N.js.map} +0 -0
  301. /package/dist/{registry-EB6SISTA.js.map → read-only-facade-EX6WZZBP.js.map} +0 -0
  302. /package/dist/{registry-IUZQVVBB.js.map → registry-3T2RZC5A.js.map} +0 -0
  303. /package/dist/{registry-UTA4CLQS.js.map → registry-DMS7OKBM.js.map} +0 -0
  304. /package/dist/{revoke-HNMQZSCL.js.map → registry-WVXO6NH5.js.map} +0 -0
  305. /package/dist/{signer-DCMNKXSF.js.map → revoke-7LCWE2AH.js.map} +0 -0
  306. /package/dist/{stale-W5PQTRYH.js.map → signer-HAVDLGOK.js.map} +0 -0
@@ -1,10 +1,12 @@
1
- import { a$ as NoydbStore, aZ as UnlockedKeyring } from '../types-Bze6vkwm.cjs';
2
- export { bp as BundleRecipient, ct as EnrollAuthenticatorOptions, cu as EnrollAuthenticatorWrappingDEKsOptions, cv as EnrollAuthenticatorWrappingKEKOptions, d0 as ListUsersOptions, ds as PaperRecoveryEntry, dA as PresenceHandle, dV as RecoverPassphraseInput, dW as RecoverPassphraseResult, dX as RecoverUserOptions, dY as RecoveryProof, d$ as RotatePassphraseInput, ek as SlotRewrapCeremony, el as SlotRewrapContext, eu as SyncEngine, eC as SyncTransaction, eS as UpdateAuthenticatorOptions, fa as WrappedDeksBlob, fg as buildRecipientKeyringFile, fh as burnPaperRecoveryEntry, g5 as changeSecret, g6 as createOwnerKeyring, fk as deriveMagicLinkContentKey, fl as enrollAuthenticator, g7 as ensureCollectionDEK, fo as evaluateExportCapability, fp as evaluateImportCapability, fq as findAuthenticator, g8 as grant, fr as hasExportCapability, fs as hasImportCapability, fu as isMagicLinkGrantExpired, fz as listMagicLinkGrants, fA as listUsers, fB as listUsersWithEnvelopes, g9 as loadKeyring, fD as loadPaperRecoveryEntries, fG as magicLinkGrantRecordId, fH as mintPaperRecoveryEntry, fJ as mintWrappedDeksBlob, ga as persistKeyring, fL as readMagicLinkGrantRecord, fx as recoverPassphrase, fM as recoverUser, fN as removeAuthenticator, gb as revoke, fR as revokeMagicLinkGrant, fy as rotatePassphrase, fT as savePaperRecoveryEntries, fW as unwrapDeksFromBlob, fX as unwrapDeksFromPaperEntry, fZ as unwrapMagicLinkGrant, gc as updateAuthenticator, gd as updateKeyringIdentity, g4 as writeMagicLinkGrant } from '../types-Bze6vkwm.cjs';
1
+ import { b2 as NoydbStore, b0 as UnlockedKeyring } from '../types-BpLPqyaO.cjs';
2
+ export { bm as BundleRecipient, cs as EnrollAuthenticatorOptions, ct as EnrollAuthenticatorWrappingDEKsOptions, cu as EnrollAuthenticatorWrappingKEKOptions, d7 as ListUsersOptions, dA as PaperRecoveryEntry, dI as PresenceHandle, e1 as RecoverPassphraseInput, e2 as RecoverPassphraseResult, e3 as RecoverUserOptions, e4 as RecoveryProof, e8 as RotatePassphraseInput, et as SlotRewrapCeremony, eu as SlotRewrapContext, eD as SyncEngine, eL as SyncTransaction, e$ as UpdateAuthenticatorOptions, fj as WrappedDeksBlob, fq as buildRecipientKeyringFile, fr as burnPaperRecoveryEntry, gj as changeSecret, gk as createOwnerKeyring, fv as deriveMagicLinkContentKey, fw as enrollAuthenticator, gl as ensureCollectionDEK, fz as evaluateExportCapability, fA as evaluateImportCapability, fB as findAuthenticator, gm as grant, fC as hasExportCapability, fD as hasImportCapability, fG as isMagicLinkGrantExpired, fL as listMagicLinkGrants, fM as listUsers, fN as listUsersWithEnvelopes, gn as loadKeyring, fP as loadPaperRecoveryEntries, fS as magicLinkGrantRecordId, fT as mintPaperRecoveryEntry, fV as mintWrappedDeksBlob, go as persistKeyring, fY as readMagicLinkGrantRecord, fJ as recoverPassphrase, fZ as recoverUser, f_ as removeAuthenticator, gp as revoke, g2 as revokeMagicLinkGrant, fK as rotatePassphrase, g4 as savePaperRecoveryEntries, g8 as unwrapDeksFromBlob, g9 as unwrapDeksFromPaperEntry, gb as unwrapMagicLinkGrant, gq as updateAuthenticator, gr as updateKeyringIdentity, gi as writeMagicLinkGrant } from '../types-BpLPqyaO.cjs';
3
3
  import '../lazy-builder-eYZzLEL1.cjs';
4
4
  import '../predicate-BmhBSPCH.cjs';
5
- import '../strategy-BtW8fAjz.cjs';
5
+ import '../strategy-nuyN8K5N.cjs';
6
+ import '../errors-DUTlAt3Y.cjs';
6
7
  import '../strategy-BSxFXGzb.cjs';
7
- import '../index-C8Bk3-VF.cjs';
8
+ import '../index-C-SSRIxP.cjs';
9
+ import '../index-C6lgoUhK.cjs';
8
10
  import '@noy-db/attestation';
9
11
 
10
12
  /**
@@ -1,10 +1,12 @@
1
- import { a$ as NoydbStore, aZ as UnlockedKeyring } from '../types-DrmBTscX.js';
2
- export { bp as BundleRecipient, ct as EnrollAuthenticatorOptions, cu as EnrollAuthenticatorWrappingDEKsOptions, cv as EnrollAuthenticatorWrappingKEKOptions, d0 as ListUsersOptions, ds as PaperRecoveryEntry, dA as PresenceHandle, dV as RecoverPassphraseInput, dW as RecoverPassphraseResult, dX as RecoverUserOptions, dY as RecoveryProof, d$ as RotatePassphraseInput, ek as SlotRewrapCeremony, el as SlotRewrapContext, eu as SyncEngine, eC as SyncTransaction, eS as UpdateAuthenticatorOptions, fa as WrappedDeksBlob, fg as buildRecipientKeyringFile, fh as burnPaperRecoveryEntry, g5 as changeSecret, g6 as createOwnerKeyring, fk as deriveMagicLinkContentKey, fl as enrollAuthenticator, g7 as ensureCollectionDEK, fo as evaluateExportCapability, fp as evaluateImportCapability, fq as findAuthenticator, g8 as grant, fr as hasExportCapability, fs as hasImportCapability, fu as isMagicLinkGrantExpired, fz as listMagicLinkGrants, fA as listUsers, fB as listUsersWithEnvelopes, g9 as loadKeyring, fD as loadPaperRecoveryEntries, fG as magicLinkGrantRecordId, fH as mintPaperRecoveryEntry, fJ as mintWrappedDeksBlob, ga as persistKeyring, fL as readMagicLinkGrantRecord, fx as recoverPassphrase, fM as recoverUser, fN as removeAuthenticator, gb as revoke, fR as revokeMagicLinkGrant, fy as rotatePassphrase, fT as savePaperRecoveryEntries, fW as unwrapDeksFromBlob, fX as unwrapDeksFromPaperEntry, fZ as unwrapMagicLinkGrant, gc as updateAuthenticator, gd as updateKeyringIdentity, g4 as writeMagicLinkGrant } from '../types-DrmBTscX.js';
1
+ import { b2 as NoydbStore, b0 as UnlockedKeyring } from '../types-Diqc2caK.js';
2
+ export { bm as BundleRecipient, cs as EnrollAuthenticatorOptions, ct as EnrollAuthenticatorWrappingDEKsOptions, cu as EnrollAuthenticatorWrappingKEKOptions, d7 as ListUsersOptions, dA as PaperRecoveryEntry, dI as PresenceHandle, e1 as RecoverPassphraseInput, e2 as RecoverPassphraseResult, e3 as RecoverUserOptions, e4 as RecoveryProof, e8 as RotatePassphraseInput, et as SlotRewrapCeremony, eu as SlotRewrapContext, eD as SyncEngine, eL as SyncTransaction, e$ as UpdateAuthenticatorOptions, fj as WrappedDeksBlob, fq as buildRecipientKeyringFile, fr as burnPaperRecoveryEntry, gj as changeSecret, gk as createOwnerKeyring, fv as deriveMagicLinkContentKey, fw as enrollAuthenticator, gl as ensureCollectionDEK, fz as evaluateExportCapability, fA as evaluateImportCapability, fB as findAuthenticator, gm as grant, fC as hasExportCapability, fD as hasImportCapability, fG as isMagicLinkGrantExpired, fL as listMagicLinkGrants, fM as listUsers, fN as listUsersWithEnvelopes, gn as loadKeyring, fP as loadPaperRecoveryEntries, fS as magicLinkGrantRecordId, fT as mintPaperRecoveryEntry, fV as mintWrappedDeksBlob, go as persistKeyring, fY as readMagicLinkGrantRecord, fJ as recoverPassphrase, fZ as recoverUser, f_ as removeAuthenticator, gp as revoke, g2 as revokeMagicLinkGrant, fK as rotatePassphrase, g4 as savePaperRecoveryEntries, g8 as unwrapDeksFromBlob, g9 as unwrapDeksFromPaperEntry, gb as unwrapMagicLinkGrant, gq as updateAuthenticator, gr as updateKeyringIdentity, gi as writeMagicLinkGrant } from '../types-Diqc2caK.js';
3
3
  import '../lazy-builder-ChSqcF5t.js';
4
4
  import '../predicate-BmhBSPCH.js';
5
- import '../strategy-BtW8fAjz.js';
5
+ import '../strategy-Diwh5lzS.js';
6
+ import '../errors-DUTlAt3Y.js';
6
7
  import '../strategy-BSxFXGzb.js';
7
- import '../index-nP99bXLg.js';
8
+ import '../index-C-SSRIxP.js';
9
+ import '../index-DP1JTWHZ.js';
8
10
  import '@noy-db/attestation';
9
11
 
10
12
  /**
@@ -5,7 +5,7 @@ import {
5
5
  getCredential,
6
6
  listCredentials,
7
7
  putCredential
8
- } from "../chunk-SCJPI4Z5.js";
8
+ } from "../chunk-LQ3GD5LL.js";
9
9
  import {
10
10
  burnPaperRecoveryEntry,
11
11
  deriveMagicLinkContentKey,
@@ -29,13 +29,13 @@ import {
29
29
  unwrapMagicLinkGrant,
30
30
  updateAuthenticator,
31
31
  writeMagicLinkGrant
32
- } from "../chunk-DLZ2ONOD.js";
33
- import "../chunk-4TBBMHVC.js";
32
+ } from "../chunk-IQ4GMEYZ.js";
33
+ import "../chunk-6YEC7LLO.js";
34
34
  import {
35
35
  PresenceHandle,
36
36
  SyncEngine,
37
37
  SyncTransaction
38
- } from "../chunk-BI6ETQPF.js";
38
+ } from "../chunk-DR5I7Q6N.js";
39
39
  import {
40
40
  buildRecipientKeyringFile,
41
41
  changeSecret,
@@ -52,11 +52,11 @@ import {
52
52
  persistKeyring,
53
53
  revoke,
54
54
  updateKeyringIdentity
55
- } from "../chunk-6H2ZUNR7.js";
55
+ } from "../chunk-FQRAYDS4.js";
56
56
  import "../chunk-2QR2PQTT.js";
57
- import "../chunk-F3BPIPLS.js";
58
- import "../chunk-YULZKK4F.js";
59
- import "../chunk-535SSHBS.js";
57
+ import "../chunk-LGPSCKWZ.js";
58
+ import "../chunk-QJKZ5WUP.js";
59
+ import "../chunk-HMFC6M2G.js";
60
60
  export {
61
61
  PresenceHandle,
62
62
  SYNC_CREDENTIALS_COLLECTION,
@@ -0,0 +1,165 @@
1
+ import { av as GuardStrategy, az as GuardStrategyHandle, aw as GuardChange, ax as GuardContext } from './types-BpLPqyaO.cjs';
2
+
3
+ /**
4
+ * Register a guard for a collection. Guards run on every `put()` /
5
+ * `delete()` for the named collection (after permissions, before
6
+ * encryption) and may:
7
+ *
8
+ * - `check` — block writes by throwing (typically `RecordLockedError`)
9
+ * - `frozenFields` — freeze specific fields once a condition is true
10
+ * - `amendment` — declare an authorized-override path with invariant
11
+ *
12
+ * Pass the returned handle to `createNoydb({ strategies: [...] })`.
13
+ *
14
+ * @see docs/superpowers/specs/2026-05-18-guards-design.md
15
+ */
16
+ declare function withGuard<T extends Record<string, unknown>>(strategy: GuardStrategy<T>): GuardStrategyHandle<T>;
17
+
18
+ /**
19
+ * `immutableGuard` — declarative WORM / append-only sugar over the guard
20
+ * subsystem.
21
+ *
22
+ * Issued fiscal documents (invoices, DDTs) must be immutable after issue.
23
+ * That is expressible today with a hand-rolled `withGuard` (block on
24
+ * `check`/`onDelete`, allow an admin `amendment`), but the boilerplate is
25
+ * repetitive and easy to get subtly wrong. `immutableGuard` generates
26
+ * exactly that guard from a declarative config, reusing the guard
27
+ * machinery wholesale — `check`/`onDelete` rejection, the ledgered
28
+ * `amendment` override, and composition with `periods`/`history`.
29
+ *
30
+ * ```ts
31
+ * createNoydb({ guardStrategies: [
32
+ * immutableGuard({
33
+ * collection: 'invoices',
34
+ * after: (r) => r.status === 'issued', // immutable once issued
35
+ * }),
36
+ * ] })
37
+ * ```
38
+ *
39
+ * A record is mutable until `after(record)` holds; from then on, updates
40
+ * and deletes throw `RecordLockedError` unless performed inside an
41
+ * `amendment` transaction by an authorized role (the override is
42
+ * ledgered by the guard amendment mechanism). `appendOnly: true` is
43
+ * shorthand for `after: () => true` — immutable from creation.
44
+ */
45
+
46
+ interface ImmutableGuardConfig<T extends Record<string, unknown>> {
47
+ /** The collection to make WORM. */
48
+ collection: string;
49
+ /**
50
+ * A record becomes immutable once this predicate holds. Evaluated on
51
+ * the *existing* (already-persisted) record, so the write that first
52
+ * makes it true is still allowed; subsequent writes are blocked.
53
+ * Mutually exclusive with `appendOnly`.
54
+ */
55
+ after?: (record: T) => boolean;
56
+ /** Shorthand for `after: () => true` — immutable from creation. */
57
+ appendOnly?: boolean;
58
+ /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */
59
+ amendmentRoles?: ReadonlyArray<'admin' | 'owner'>;
60
+ /**
61
+ * Optional set-level invariant run over the amendment change-set after
62
+ * the writes execute. Signature matches `GuardStrategy.amendment.invariant`
63
+ * exactly: it receives every {before, after} pair touching this
64
+ * collection in the amendment plus the guard context; throwing reverts
65
+ * the whole amendment and surfaces as `InvariantError`.
66
+ *
67
+ * Use this to keep a constraint inviolable EVEN under amendment — e.g.
68
+ * forbid deleting an issued document by re-throwing on any
69
+ * `before !== null && after === null` change, or assert a cross-record
70
+ * sum is preserved. When omitted the amendment is unconditionally
71
+ * allowed (the amendment itself is the sanctioned, ledgered override) —
72
+ * this is the backward-compatible default.
73
+ */
74
+ amendmentInvariant?: (changes: ReadonlyArray<GuardChange<T>>, ctx: GuardContext<T>) => Promise<void> | void;
75
+ }
76
+ /**
77
+ * Build an immutability guard. Pass the returned handle to
78
+ * `createNoydb({ guardStrategies: [...] })`.
79
+ */
80
+ declare function immutableGuard<T extends Record<string, unknown>>(config: ImmutableGuardConfig<T>): GuardStrategyHandle<T>;
81
+
82
+ /**
83
+ * `transitionGuard` — declarative state-machine sugar over the guard
84
+ * subsystem.
85
+ *
86
+ * Any record with a lifecycle field (invoice `status`, order state,
87
+ * ticket workflow, subscription phase) needs transition validation: a
88
+ * write may only move the field along a declared arc. That is expressible
89
+ * with a hand-rolled `withGuard({ check })`, but every consumer
90
+ * re-implements the same graph lookup + error. `transitionGuard`
91
+ * generates exactly that guard from a state graph, reusing the guard
92
+ * machinery wholesale — `check` rejection, the ledgered `amendment`
93
+ * override, and composition with `periods`/`history`.
94
+ *
95
+ * It generalizes {@link immutableGuard}: WORM is the special case "every
96
+ * state has no outgoing arcs", i.e. `transitions` mapping each state to `[]`.
97
+ *
98
+ * ```ts
99
+ * createNoydb({ guardStrategies: [
100
+ * transitionGuard<Sale>({
101
+ * collection: 'sales', field: 'status',
102
+ * transitions: { // absence of an arc = forbidden
103
+ * draft: ['to_verify', 'cancelled'],
104
+ * to_verify: ['proforma', 'draft', 'cancelled'],
105
+ * proforma: ['invoiced', 'cancelled'],
106
+ * invoiced: ['paid'], paid: [], cancelled: [],
107
+ * },
108
+ * initial: ['draft', 'to_verify'], // allowed status on insert
109
+ * }),
110
+ * ] })
111
+ * ```
112
+ *
113
+ * Semantics:
114
+ * - **Insert** (`ctx.existing === null`): `incoming[field]` must be in
115
+ * `initial`. When `initial` is omitted, any value is allowed on insert.
116
+ * - **Update**: the arc `(existing[field] → incoming[field])` must be
117
+ * listed in `transitions[from]`, else `IllegalTransitionError`. A
118
+ * same-value write (`from === to`) is allowed when `allowIdempotent`
119
+ * (default `true`) — so writes that touch other fields without moving
120
+ * state pass.
121
+ * - **Override**: inside an `amendment` transaction by an authorized role
122
+ * the check is skipped and the change is ledgered (mirrors every guard).
123
+ *
124
+ * The status graph is caller-supplied data — no UI, no domain logic.
125
+ */
126
+
127
+ interface TransitionGuardConfig<T extends Record<string, unknown>> {
128
+ /** The collection whose state field is governed. */
129
+ collection: string;
130
+ /** The state field on the record (e.g. `'status'`). */
131
+ field: keyof T & string;
132
+ /**
133
+ * The transition graph: each state maps to the states it may move to.
134
+ * A state absent from the map (or mapped to `[]`) is terminal — no
135
+ * outgoing arc, so any non-idempotent write from it is rejected.
136
+ */
137
+ transitions: Readonly<Record<string, readonly string[]>>;
138
+ /**
139
+ * States allowed as the initial value on insert (`existing === null`).
140
+ * Omit to allow any value on insert.
141
+ */
142
+ initial?: readonly string[];
143
+ /**
144
+ * Allow a same-value write (`from === to`) on update. Default `true` —
145
+ * lets a put that changes other fields, but not the state, through.
146
+ */
147
+ allowIdempotent?: boolean;
148
+ /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */
149
+ amendmentRoles?: ReadonlyArray<'admin' | 'owner'>;
150
+ /**
151
+ * Optional set-level invariant run over the amendment change-set after
152
+ * the writes execute. Signature matches `GuardStrategy.amendment.invariant`
153
+ * exactly. When omitted the amendment is unconditionally allowed (the
154
+ * amendment itself is the sanctioned, ledgered override) — the
155
+ * backward-compatible default. Mirrors {@link immutableGuard}.
156
+ */
157
+ amendmentInvariant?: (changes: ReadonlyArray<GuardChange<T>>, ctx: GuardContext<T>) => Promise<void> | void;
158
+ }
159
+ /**
160
+ * Build a state-machine transition guard. Pass the returned handle to
161
+ * `createNoydb({ guardStrategies: [...] })`.
162
+ */
163
+ declare function transitionGuard<T extends Record<string, unknown>>(config: TransitionGuardConfig<T>): GuardStrategyHandle<T>;
164
+
165
+ export { type ImmutableGuardConfig as I, type TransitionGuardConfig as T, immutableGuard as i, transitionGuard as t, withGuard as w };
@@ -0,0 +1,165 @@
1
+ import { av as GuardStrategy, az as GuardStrategyHandle, aw as GuardChange, ax as GuardContext } from './types-Diqc2caK.js';
2
+
3
+ /**
4
+ * Register a guard for a collection. Guards run on every `put()` /
5
+ * `delete()` for the named collection (after permissions, before
6
+ * encryption) and may:
7
+ *
8
+ * - `check` — block writes by throwing (typically `RecordLockedError`)
9
+ * - `frozenFields` — freeze specific fields once a condition is true
10
+ * - `amendment` — declare an authorized-override path with invariant
11
+ *
12
+ * Pass the returned handle to `createNoydb({ strategies: [...] })`.
13
+ *
14
+ * @see docs/superpowers/specs/2026-05-18-guards-design.md
15
+ */
16
+ declare function withGuard<T extends Record<string, unknown>>(strategy: GuardStrategy<T>): GuardStrategyHandle<T>;
17
+
18
+ /**
19
+ * `immutableGuard` — declarative WORM / append-only sugar over the guard
20
+ * subsystem.
21
+ *
22
+ * Issued fiscal documents (invoices, DDTs) must be immutable after issue.
23
+ * That is expressible today with a hand-rolled `withGuard` (block on
24
+ * `check`/`onDelete`, allow an admin `amendment`), but the boilerplate is
25
+ * repetitive and easy to get subtly wrong. `immutableGuard` generates
26
+ * exactly that guard from a declarative config, reusing the guard
27
+ * machinery wholesale — `check`/`onDelete` rejection, the ledgered
28
+ * `amendment` override, and composition with `periods`/`history`.
29
+ *
30
+ * ```ts
31
+ * createNoydb({ guardStrategies: [
32
+ * immutableGuard({
33
+ * collection: 'invoices',
34
+ * after: (r) => r.status === 'issued', // immutable once issued
35
+ * }),
36
+ * ] })
37
+ * ```
38
+ *
39
+ * A record is mutable until `after(record)` holds; from then on, updates
40
+ * and deletes throw `RecordLockedError` unless performed inside an
41
+ * `amendment` transaction by an authorized role (the override is
42
+ * ledgered by the guard amendment mechanism). `appendOnly: true` is
43
+ * shorthand for `after: () => true` — immutable from creation.
44
+ */
45
+
46
+ interface ImmutableGuardConfig<T extends Record<string, unknown>> {
47
+ /** The collection to make WORM. */
48
+ collection: string;
49
+ /**
50
+ * A record becomes immutable once this predicate holds. Evaluated on
51
+ * the *existing* (already-persisted) record, so the write that first
52
+ * makes it true is still allowed; subsequent writes are blocked.
53
+ * Mutually exclusive with `appendOnly`.
54
+ */
55
+ after?: (record: T) => boolean;
56
+ /** Shorthand for `after: () => true` — immutable from creation. */
57
+ appendOnly?: boolean;
58
+ /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */
59
+ amendmentRoles?: ReadonlyArray<'admin' | 'owner'>;
60
+ /**
61
+ * Optional set-level invariant run over the amendment change-set after
62
+ * the writes execute. Signature matches `GuardStrategy.amendment.invariant`
63
+ * exactly: it receives every {before, after} pair touching this
64
+ * collection in the amendment plus the guard context; throwing reverts
65
+ * the whole amendment and surfaces as `InvariantError`.
66
+ *
67
+ * Use this to keep a constraint inviolable EVEN under amendment — e.g.
68
+ * forbid deleting an issued document by re-throwing on any
69
+ * `before !== null && after === null` change, or assert a cross-record
70
+ * sum is preserved. When omitted the amendment is unconditionally
71
+ * allowed (the amendment itself is the sanctioned, ledgered override) —
72
+ * this is the backward-compatible default.
73
+ */
74
+ amendmentInvariant?: (changes: ReadonlyArray<GuardChange<T>>, ctx: GuardContext<T>) => Promise<void> | void;
75
+ }
76
+ /**
77
+ * Build an immutability guard. Pass the returned handle to
78
+ * `createNoydb({ guardStrategies: [...] })`.
79
+ */
80
+ declare function immutableGuard<T extends Record<string, unknown>>(config: ImmutableGuardConfig<T>): GuardStrategyHandle<T>;
81
+
82
+ /**
83
+ * `transitionGuard` — declarative state-machine sugar over the guard
84
+ * subsystem.
85
+ *
86
+ * Any record with a lifecycle field (invoice `status`, order state,
87
+ * ticket workflow, subscription phase) needs transition validation: a
88
+ * write may only move the field along a declared arc. That is expressible
89
+ * with a hand-rolled `withGuard({ check })`, but every consumer
90
+ * re-implements the same graph lookup + error. `transitionGuard`
91
+ * generates exactly that guard from a state graph, reusing the guard
92
+ * machinery wholesale — `check` rejection, the ledgered `amendment`
93
+ * override, and composition with `periods`/`history`.
94
+ *
95
+ * It generalizes {@link immutableGuard}: WORM is the special case "every
96
+ * state has no outgoing arcs", i.e. `transitions` mapping each state to `[]`.
97
+ *
98
+ * ```ts
99
+ * createNoydb({ guardStrategies: [
100
+ * transitionGuard<Sale>({
101
+ * collection: 'sales', field: 'status',
102
+ * transitions: { // absence of an arc = forbidden
103
+ * draft: ['to_verify', 'cancelled'],
104
+ * to_verify: ['proforma', 'draft', 'cancelled'],
105
+ * proforma: ['invoiced', 'cancelled'],
106
+ * invoiced: ['paid'], paid: [], cancelled: [],
107
+ * },
108
+ * initial: ['draft', 'to_verify'], // allowed status on insert
109
+ * }),
110
+ * ] })
111
+ * ```
112
+ *
113
+ * Semantics:
114
+ * - **Insert** (`ctx.existing === null`): `incoming[field]` must be in
115
+ * `initial`. When `initial` is omitted, any value is allowed on insert.
116
+ * - **Update**: the arc `(existing[field] → incoming[field])` must be
117
+ * listed in `transitions[from]`, else `IllegalTransitionError`. A
118
+ * same-value write (`from === to`) is allowed when `allowIdempotent`
119
+ * (default `true`) — so writes that touch other fields without moving
120
+ * state pass.
121
+ * - **Override**: inside an `amendment` transaction by an authorized role
122
+ * the check is skipped and the change is ledgered (mirrors every guard).
123
+ *
124
+ * The status graph is caller-supplied data — no UI, no domain logic.
125
+ */
126
+
127
+ interface TransitionGuardConfig<T extends Record<string, unknown>> {
128
+ /** The collection whose state field is governed. */
129
+ collection: string;
130
+ /** The state field on the record (e.g. `'status'`). */
131
+ field: keyof T & string;
132
+ /**
133
+ * The transition graph: each state maps to the states it may move to.
134
+ * A state absent from the map (or mapped to `[]`) is terminal — no
135
+ * outgoing arc, so any non-idempotent write from it is rejected.
136
+ */
137
+ transitions: Readonly<Record<string, readonly string[]>>;
138
+ /**
139
+ * States allowed as the initial value on insert (`existing === null`).
140
+ * Omit to allow any value on insert.
141
+ */
142
+ initial?: readonly string[];
143
+ /**
144
+ * Allow a same-value write (`from === to`) on update. Default `true` —
145
+ * lets a put that changes other fields, but not the state, through.
146
+ */
147
+ allowIdempotent?: boolean;
148
+ /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */
149
+ amendmentRoles?: ReadonlyArray<'admin' | 'owner'>;
150
+ /**
151
+ * Optional set-level invariant run over the amendment change-set after
152
+ * the writes execute. Signature matches `GuardStrategy.amendment.invariant`
153
+ * exactly. When omitted the amendment is unconditionally allowed (the
154
+ * amendment itself is the sanctioned, ledgered override) — the
155
+ * backward-compatible default. Mirrors {@link immutableGuard}.
156
+ */
157
+ amendmentInvariant?: (changes: ReadonlyArray<GuardChange<T>>, ctx: GuardContext<T>) => Promise<void> | void;
158
+ }
159
+ /**
160
+ * Build a state-machine transition guard. Pass the returned handle to
161
+ * `createNoydb({ guardStrategies: [...] })`.
162
+ */
163
+ declare function transitionGuard<T extends Record<string, unknown>>(config: TransitionGuardConfig<T>): GuardStrategyHandle<T>;
164
+
165
+ export { type ImmutableGuardConfig as I, type TransitionGuardConfig as T, immutableGuard as i, transitionGuard as t, withGuard as w };