@noy-db/hub 0.3.0-pre.7 → 0.3.0-pre.8

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 (240) hide show
  1. package/dist/adapter/index.d.ts +1 -1
  2. package/dist/aggregate/index.d.ts +2 -2
  3. package/dist/{api-Z66JMGOU.js → api-JDWL67WL.js} +6 -6
  4. package/dist/as/index.d.ts +3 -3
  5. package/dist/as/index.js +5 -5
  6. package/dist/at/index.d.ts +1 -1
  7. package/dist/attestation/index.d.ts +2 -2
  8. package/dist/attestation/index.js +12 -12
  9. package/dist/{backup-7PX6NDKT.js → backup-WRGNTGJF.js} +6 -6
  10. package/dist/blobs/index.d.ts +3 -3
  11. package/dist/blobs/index.js +5 -5
  12. package/dist/bundle/index.d.ts +4 -4
  13. package/dist/bundle/index.js +14 -14
  14. package/dist/{bundle-BN_VSq5L.d.ts → bundle-DzWtVw7w.d.ts} +1 -1
  15. package/dist/cargo/index.d.ts +3 -3
  16. package/dist/cargo/index.js +13 -13
  17. package/dist/{chunk-2L7PPF2C.js → chunk-25G7PUTA.js} +7 -7
  18. package/dist/{chunk-7AERMJP6.js → chunk-2PJB6H3H.js} +2 -2
  19. package/dist/{chunk-YSU2E4GZ.js → chunk-37JZR7CY.js} +18 -5
  20. package/dist/chunk-37JZR7CY.js.map +1 -0
  21. package/dist/{chunk-DJ4TNF4N.js → chunk-3KBK5LU4.js} +3 -3
  22. package/dist/{chunk-62TTFKU4.js → chunk-3YKBGS3I.js} +4 -4
  23. package/dist/{chunk-YSJG4L4A.js → chunk-44DV37ZV.js} +2 -2
  24. package/dist/{chunk-E3LURVGQ.js → chunk-4VDFUBTS.js} +3 -3
  25. package/dist/{chunk-5K7KZMXG.js → chunk-56JB2BGI.js} +355 -74
  26. package/dist/chunk-56JB2BGI.js.map +1 -0
  27. package/dist/{chunk-IEKK2XI4.js → chunk-5HRJQSKN.js} +3 -3
  28. package/dist/{chunk-PE25C4QL.js → chunk-5YBUFCFF.js} +5 -5
  29. package/dist/{chunk-J54DC5IC.js → chunk-62APEMF3.js} +3 -3
  30. package/dist/{chunk-RUWEHFRB.js → chunk-723XB5NX.js} +3 -3
  31. package/dist/{chunk-JIW3Q5JN.js → chunk-7TAV3BFQ.js} +3 -3
  32. package/dist/{chunk-CND5WQLO.js → chunk-BJ2XF2RC.js} +3 -3
  33. package/dist/{chunk-H3MPSYCH.js → chunk-BM6E4MUT.js} +3 -3
  34. package/dist/{chunk-NO53W6O5.js → chunk-BTFTHF6Q.js} +2 -2
  35. package/dist/{chunk-DKGZIX6S.js → chunk-DCVVCJVB.js} +2 -2
  36. package/dist/{chunk-AG2PLGQ2.js → chunk-F3EKFGUS.js} +4 -4
  37. package/dist/{chunk-VUHXLL32.js → chunk-FWART3VA.js} +2 -2
  38. package/dist/{chunk-3CHNKEFI.js → chunk-FZK3JJJK.js} +3 -3
  39. package/dist/{chunk-VFG5YXWM.js → chunk-GDOOG5YQ.js} +2 -2
  40. package/dist/{chunk-T4NQMPBN.js → chunk-GLVXQU3E.js} +2 -2
  41. package/dist/{chunk-RHB7BOEO.js → chunk-I6URUNTD.js} +3 -3
  42. package/dist/{chunk-K6WHZBCO.js → chunk-IARAK3PK.js} +2 -2
  43. package/dist/{chunk-OFYY5Q4R.js → chunk-J5YUA6JB.js} +2 -2
  44. package/dist/{chunk-7F2P2NHX.js → chunk-J7OH6R4K.js} +3 -3
  45. package/dist/{chunk-WRLPV6SI.js → chunk-L6Q5NA22.js} +2 -2
  46. package/dist/{chunk-7L6EH6S7.js → chunk-M3OYTM5Z.js} +4 -4
  47. package/dist/{chunk-WGH3YV6Y.js → chunk-NTPWQH4S.js} +5 -5
  48. package/dist/{chunk-H7WQMGXH.js → chunk-P2PEPSPK.js} +2 -2
  49. package/dist/{chunk-J5YDMJHG.js → chunk-P6TZ3IVN.js} +7 -7
  50. package/dist/{chunk-WFBZRXS5.js → chunk-PMMV5SQC.js} +5 -5
  51. package/dist/{chunk-I6Q7YECW.js → chunk-PPPZIBKY.js} +2 -2
  52. package/dist/{chunk-HGQ6UNHE.js → chunk-PVC2FBCQ.js} +2 -2
  53. package/dist/{chunk-HBVEGUON.js → chunk-QABECTNN.js} +2 -2
  54. package/dist/{chunk-HV3VNAYI.js → chunk-QYMMMKOO.js} +4 -4
  55. package/dist/{chunk-AZPGB4OD.js → chunk-R4IVPJHN.js} +3 -3
  56. package/dist/{chunk-HCK2DFEK.js → chunk-REWTMYSF.js} +1 -1
  57. package/dist/{chunk-HCK2DFEK.js.map → chunk-REWTMYSF.js.map} +1 -1
  58. package/dist/{chunk-UJJJPKJO.js → chunk-TCGVRKOS.js} +2 -2
  59. package/dist/{chunk-U5IJHUHZ.js → chunk-TIAYXOEI.js} +2 -2
  60. package/dist/{chunk-GMZFHDSG.js → chunk-TUL5YQWF.js} +3 -3
  61. package/dist/{chunk-G5CFMITA.js → chunk-UMH35AQV.js} +2 -2
  62. package/dist/{chunk-VMRXI3IF.js → chunk-VVLOWY74.js} +3 -3
  63. package/dist/{chunk-WJEMUO32.js → chunk-W3JABOVB.js} +2 -2
  64. package/dist/{chunk-QAVFI23O.js → chunk-WPNP3NF5.js} +4 -4
  65. package/dist/{chunk-JT4A6OAJ.js → chunk-X5QZAJDB.js} +3 -3
  66. package/dist/{chunk-QYNBPDGO.js → chunk-X6VNIRHS.js} +2 -2
  67. package/dist/{chunk-CP3GUIAN.js → chunk-XBPUVQDO.js} +8 -8
  68. package/dist/classified/index.d.ts +3 -3
  69. package/dist/classified/index.js +1 -1
  70. package/dist/{collection-facade-JP6N7USE.js → collection-facade-EJVIN2BY.js} +9 -9
  71. package/dist/{config-drift-LRKCC3VZ.js → config-drift-RFEVGBKR.js} +3 -3
  72. package/dist/consent/index.d.ts +2 -2
  73. package/dist/consent/index.js +4 -4
  74. package/dist/crdt/index.d.ts +2 -2
  75. package/dist/{dead-filter-NZORV45S.js → dead-filter-RHMNYOXP.js} +2 -2
  76. package/dist/{delegation-FDOXXHNG.js → delegation-IHXOASHV.js} +5 -5
  77. package/dist/derivations/index.d.ts +3 -3
  78. package/dist/derivations/index.js +3 -3
  79. package/dist/{derive-JR2C5JFG.js → derive-CD3ZVIXK.js} +4 -4
  80. package/dist/{dev-unlock-CsOqX7O2.d.ts → dev-unlock-wgQ7Ci5I.d.ts} +1 -1
  81. package/dist/{enclave-7X5BUAMS.js → enclave-KGEUW2GL.js} +4 -4
  82. package/dist/{executor-6LHOV7MN.js → executor-MHUM2VZK.js} +4 -4
  83. package/dist/{export-accessible-7XLSZBGJ.js → export-accessible-Z3NSZZHN.js} +7 -7
  84. package/dist/{extract-partition-RM6EROS5.js → extract-partition-VSKT35JG.js} +10 -10
  85. package/dist/{fanout-sidecar-BDKLP5GG.js → fanout-sidecar-NBDKKCHT.js} +4 -4
  86. package/dist/forget/index.js +4 -4
  87. package/dist/guards/index.d.ts +3 -3
  88. package/dist/{hash-BPzm02Za.d.ts → hash-CwHnoKyW.d.ts} +1 -1
  89. package/dist/history/index.d.ts +3 -3
  90. package/dist/history/index.js +6 -6
  91. package/dist/i18n/index.d.ts +2 -2
  92. package/dist/i18n/index.js +7 -7
  93. package/dist/in/index.d.ts +1 -1
  94. package/dist/{index-CLucFLeN.d.ts → index-CTvUp94-.d.ts} +2 -2
  95. package/dist/{index-BJ3L-XcV.d.ts → index-Dn5GzPg_.d.ts} +243 -9
  96. package/dist/index.d.ts +26 -19
  97. package/dist/index.js +52 -51
  98. package/dist/index.js.map +1 -1
  99. package/dist/indexing/index.d.ts +2 -2
  100. package/dist/{issue-FJE2IHUI.js → issue-AEOL6RXA.js} +6 -6
  101. package/dist/kernel/index.d.ts +2 -2
  102. package/dist/kernel/index.js +3 -3
  103. package/dist/lazy/index.d.ts +2 -2
  104. package/dist/{ledger-EMDHRJJN.js → ledger-3LR3YO2W.js} +6 -6
  105. package/dist/liberate-XSEPRWEA.js +24 -0
  106. package/dist/{link-set-62Y36TOG.js → link-set-NSUIX6BR.js} +5 -5
  107. package/dist/materialized-views/index.d.ts +3 -3
  108. package/dist/materialized-views/index.js +4 -4
  109. package/dist/{mime-magic-BlE9fzn2.d.ts → mime-magic-CYbFNQ4h.d.ts} +1 -1
  110. package/dist/{noydb-4ZASGII5.js → noydb-POVTIVQ6.js} +23 -23
  111. package/dist/on/index.d.ts +1 -1
  112. package/dist/on/index.js +4 -4
  113. package/dist/overlay-views/index.d.ts +3 -3
  114. package/dist/periods/index.d.ts +2 -2
  115. package/dist/periods/index.js +15 -7
  116. package/dist/pod/index.d.ts +2 -2
  117. package/dist/pod/index.js +5 -5
  118. package/dist/{policy-SXPLTQS4.js → policy-Y7HL2KGA.js} +4 -4
  119. package/dist/portability/index.d.ts +2 -2
  120. package/dist/portability/index.js +6 -6
  121. package/dist/{post-register-DCJ2SRVG.js → post-register-KOFRTCDD.js} +4 -4
  122. package/dist/{public-envelope-CBRIJORQ.js → public-envelope-NC7SPNMV.js} +3 -3
  123. package/dist/query/index.d.ts +1 -1
  124. package/dist/{register-5NRE7HBZ.js → register-3D6R2MKN.js} +6 -6
  125. package/dist/{registry-DYTNLOJC.js → registry-AI4E46PD.js} +4 -4
  126. package/dist/{registry-5QLETK3Q.js → registry-WIX6QCV5.js} +4 -4
  127. package/dist/{request-withdrawal-5APB7RKN.js → request-withdrawal-GU4XS2R5.js} +9 -9
  128. package/dist/{reveal-R5N7JKA5.js → reveal-5Y777N5Q.js} +3 -3
  129. package/dist/{revoke-VELFCK7S.js → revoke-ZFETCLYV.js} +6 -6
  130. package/dist/satellites/index.d.ts +1 -1
  131. package/dist/sealed-record/index.d.ts +2 -2
  132. package/dist/sealed-record/index.js +6 -6
  133. package/dist/session/index.d.ts +3 -3
  134. package/dist/session/index.js +3 -3
  135. package/dist/shadow/index.d.ts +2 -2
  136. package/dist/{signer-IVU3B6DP.js → signer-GAIMQQ2J.js} +5 -5
  137. package/dist/snapshots/index.d.ts +2 -2
  138. package/dist/snapshots/index.js +5 -5
  139. package/dist/{stale-DP66HFT3.js → stale-77LP2EEF.js} +2 -2
  140. package/dist/{storage-RH5VBLLL.js → storage-KEXIXLGM.js} +5 -5
  141. package/dist/{store-coordination-provider-F5N5ASDF.js → store-coordination-provider-NJDDZ264.js} +3 -3
  142. package/dist/sync/index.d.ts +1 -1
  143. package/dist/sync/index.js +4 -4
  144. package/dist/team/index.d.ts +2 -2
  145. package/dist/team/index.js +9 -9
  146. package/dist/tiers/index.d.ts +1 -1
  147. package/dist/tiers/index.js +4 -4
  148. package/dist/to/index.d.ts +1 -1
  149. package/dist/{transition-guard-BzsAQEd-.d.ts → transition-guard-D5RLJv8S.d.ts} +1 -1
  150. package/dist/tx/index.d.ts +2 -2
  151. package/dist/{validators-DGmYFP51.d.ts → validators-C3lrVF-c.d.ts} +1 -1
  152. package/dist/{vault-diff-DmBBatkx.d.ts → vault-diff-_LSIcOMv.d.ts} +1 -1
  153. package/dist/{walk-3SB25HF2.js → walk-SMAE4IEI.js} +5 -5
  154. package/dist/with/index.d.ts +2 -2
  155. package/dist/with/index.js +6 -6
  156. package/dist/{with-materialized-view-DPEVoGoB.d.ts → with-materialized-view-Xv1-9Bh0.d.ts} +1 -1
  157. package/dist/{with-overlayed-view-DGpKFSv1.d.ts → with-overlayed-view-CuWhq_-C.d.ts} +1 -1
  158. package/dist/{with-rollup-B2RwnTq0.d.ts → with-rollup-K_iwal4b.d.ts} +1 -1
  159. package/dist/{withdraw-accessible-LN4AOJDD.js → withdraw-accessible-Q7BULAN5.js} +8 -8
  160. package/package.json +3 -3
  161. package/dist/chunk-5K7KZMXG.js.map +0 -1
  162. package/dist/chunk-YSU2E4GZ.js.map +0 -1
  163. package/dist/liberate-HFIPHJGR.js +0 -24
  164. /package/dist/{api-Z66JMGOU.js.map → api-JDWL67WL.js.map} +0 -0
  165. /package/dist/{backup-7PX6NDKT.js.map → backup-WRGNTGJF.js.map} +0 -0
  166. /package/dist/{chunk-2L7PPF2C.js.map → chunk-25G7PUTA.js.map} +0 -0
  167. /package/dist/{chunk-7AERMJP6.js.map → chunk-2PJB6H3H.js.map} +0 -0
  168. /package/dist/{chunk-DJ4TNF4N.js.map → chunk-3KBK5LU4.js.map} +0 -0
  169. /package/dist/{chunk-62TTFKU4.js.map → chunk-3YKBGS3I.js.map} +0 -0
  170. /package/dist/{chunk-YSJG4L4A.js.map → chunk-44DV37ZV.js.map} +0 -0
  171. /package/dist/{chunk-E3LURVGQ.js.map → chunk-4VDFUBTS.js.map} +0 -0
  172. /package/dist/{chunk-IEKK2XI4.js.map → chunk-5HRJQSKN.js.map} +0 -0
  173. /package/dist/{chunk-PE25C4QL.js.map → chunk-5YBUFCFF.js.map} +0 -0
  174. /package/dist/{chunk-J54DC5IC.js.map → chunk-62APEMF3.js.map} +0 -0
  175. /package/dist/{chunk-RUWEHFRB.js.map → chunk-723XB5NX.js.map} +0 -0
  176. /package/dist/{chunk-JIW3Q5JN.js.map → chunk-7TAV3BFQ.js.map} +0 -0
  177. /package/dist/{chunk-CND5WQLO.js.map → chunk-BJ2XF2RC.js.map} +0 -0
  178. /package/dist/{chunk-H3MPSYCH.js.map → chunk-BM6E4MUT.js.map} +0 -0
  179. /package/dist/{chunk-NO53W6O5.js.map → chunk-BTFTHF6Q.js.map} +0 -0
  180. /package/dist/{chunk-DKGZIX6S.js.map → chunk-DCVVCJVB.js.map} +0 -0
  181. /package/dist/{chunk-AG2PLGQ2.js.map → chunk-F3EKFGUS.js.map} +0 -0
  182. /package/dist/{chunk-VUHXLL32.js.map → chunk-FWART3VA.js.map} +0 -0
  183. /package/dist/{chunk-3CHNKEFI.js.map → chunk-FZK3JJJK.js.map} +0 -0
  184. /package/dist/{chunk-VFG5YXWM.js.map → chunk-GDOOG5YQ.js.map} +0 -0
  185. /package/dist/{chunk-T4NQMPBN.js.map → chunk-GLVXQU3E.js.map} +0 -0
  186. /package/dist/{chunk-RHB7BOEO.js.map → chunk-I6URUNTD.js.map} +0 -0
  187. /package/dist/{chunk-K6WHZBCO.js.map → chunk-IARAK3PK.js.map} +0 -0
  188. /package/dist/{chunk-OFYY5Q4R.js.map → chunk-J5YUA6JB.js.map} +0 -0
  189. /package/dist/{chunk-7F2P2NHX.js.map → chunk-J7OH6R4K.js.map} +0 -0
  190. /package/dist/{chunk-WRLPV6SI.js.map → chunk-L6Q5NA22.js.map} +0 -0
  191. /package/dist/{chunk-7L6EH6S7.js.map → chunk-M3OYTM5Z.js.map} +0 -0
  192. /package/dist/{chunk-WGH3YV6Y.js.map → chunk-NTPWQH4S.js.map} +0 -0
  193. /package/dist/{chunk-H7WQMGXH.js.map → chunk-P2PEPSPK.js.map} +0 -0
  194. /package/dist/{chunk-J5YDMJHG.js.map → chunk-P6TZ3IVN.js.map} +0 -0
  195. /package/dist/{chunk-WFBZRXS5.js.map → chunk-PMMV5SQC.js.map} +0 -0
  196. /package/dist/{chunk-I6Q7YECW.js.map → chunk-PPPZIBKY.js.map} +0 -0
  197. /package/dist/{chunk-HGQ6UNHE.js.map → chunk-PVC2FBCQ.js.map} +0 -0
  198. /package/dist/{chunk-HBVEGUON.js.map → chunk-QABECTNN.js.map} +0 -0
  199. /package/dist/{chunk-HV3VNAYI.js.map → chunk-QYMMMKOO.js.map} +0 -0
  200. /package/dist/{chunk-AZPGB4OD.js.map → chunk-R4IVPJHN.js.map} +0 -0
  201. /package/dist/{chunk-UJJJPKJO.js.map → chunk-TCGVRKOS.js.map} +0 -0
  202. /package/dist/{chunk-U5IJHUHZ.js.map → chunk-TIAYXOEI.js.map} +0 -0
  203. /package/dist/{chunk-GMZFHDSG.js.map → chunk-TUL5YQWF.js.map} +0 -0
  204. /package/dist/{chunk-G5CFMITA.js.map → chunk-UMH35AQV.js.map} +0 -0
  205. /package/dist/{chunk-VMRXI3IF.js.map → chunk-VVLOWY74.js.map} +0 -0
  206. /package/dist/{chunk-WJEMUO32.js.map → chunk-W3JABOVB.js.map} +0 -0
  207. /package/dist/{chunk-QAVFI23O.js.map → chunk-WPNP3NF5.js.map} +0 -0
  208. /package/dist/{chunk-JT4A6OAJ.js.map → chunk-X5QZAJDB.js.map} +0 -0
  209. /package/dist/{chunk-QYNBPDGO.js.map → chunk-X6VNIRHS.js.map} +0 -0
  210. /package/dist/{chunk-CP3GUIAN.js.map → chunk-XBPUVQDO.js.map} +0 -0
  211. /package/dist/{collection-facade-JP6N7USE.js.map → collection-facade-EJVIN2BY.js.map} +0 -0
  212. /package/dist/{config-drift-LRKCC3VZ.js.map → config-drift-RFEVGBKR.js.map} +0 -0
  213. /package/dist/{dead-filter-NZORV45S.js.map → dead-filter-RHMNYOXP.js.map} +0 -0
  214. /package/dist/{delegation-FDOXXHNG.js.map → delegation-IHXOASHV.js.map} +0 -0
  215. /package/dist/{derive-JR2C5JFG.js.map → derive-CD3ZVIXK.js.map} +0 -0
  216. /package/dist/{enclave-7X5BUAMS.js.map → enclave-KGEUW2GL.js.map} +0 -0
  217. /package/dist/{executor-6LHOV7MN.js.map → executor-MHUM2VZK.js.map} +0 -0
  218. /package/dist/{export-accessible-7XLSZBGJ.js.map → export-accessible-Z3NSZZHN.js.map} +0 -0
  219. /package/dist/{extract-partition-RM6EROS5.js.map → extract-partition-VSKT35JG.js.map} +0 -0
  220. /package/dist/{fanout-sidecar-BDKLP5GG.js.map → fanout-sidecar-NBDKKCHT.js.map} +0 -0
  221. /package/dist/{issue-FJE2IHUI.js.map → issue-AEOL6RXA.js.map} +0 -0
  222. /package/dist/{ledger-EMDHRJJN.js.map → ledger-3LR3YO2W.js.map} +0 -0
  223. /package/dist/{liberate-HFIPHJGR.js.map → liberate-XSEPRWEA.js.map} +0 -0
  224. /package/dist/{link-set-62Y36TOG.js.map → link-set-NSUIX6BR.js.map} +0 -0
  225. /package/dist/{noydb-4ZASGII5.js.map → noydb-POVTIVQ6.js.map} +0 -0
  226. /package/dist/{policy-SXPLTQS4.js.map → policy-Y7HL2KGA.js.map} +0 -0
  227. /package/dist/{post-register-DCJ2SRVG.js.map → post-register-KOFRTCDD.js.map} +0 -0
  228. /package/dist/{public-envelope-CBRIJORQ.js.map → public-envelope-NC7SPNMV.js.map} +0 -0
  229. /package/dist/{register-5NRE7HBZ.js.map → register-3D6R2MKN.js.map} +0 -0
  230. /package/dist/{registry-5QLETK3Q.js.map → registry-AI4E46PD.js.map} +0 -0
  231. /package/dist/{registry-DYTNLOJC.js.map → registry-WIX6QCV5.js.map} +0 -0
  232. /package/dist/{request-withdrawal-5APB7RKN.js.map → request-withdrawal-GU4XS2R5.js.map} +0 -0
  233. /package/dist/{reveal-R5N7JKA5.js.map → reveal-5Y777N5Q.js.map} +0 -0
  234. /package/dist/{revoke-VELFCK7S.js.map → revoke-ZFETCLYV.js.map} +0 -0
  235. /package/dist/{signer-IVU3B6DP.js.map → signer-GAIMQQ2J.js.map} +0 -0
  236. /package/dist/{stale-DP66HFT3.js.map → stale-77LP2EEF.js.map} +0 -0
  237. /package/dist/{storage-RH5VBLLL.js.map → storage-KEXIXLGM.js.map} +0 -0
  238. /package/dist/{store-coordination-provider-F5N5ASDF.js.map → store-coordination-provider-NJDDZ264.js.map} +0 -0
  239. /package/dist/{walk-3SB25HF2.js.map → walk-SMAE4IEI.js.map} +0 -0
  240. /package/dist/{withdraw-accessible-LN4AOJDD.js.map → withdraw-accessible-Q7BULAN5.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/with-audit/periods/periods.ts"],"sourcesContent":["/**\n * Accounting-period closure + opening.\n *\n * A closed period seals every record whose envelope `_ts` is at or\n * before the period's `endDate`: further writes (`put` / `delete`)\n * against such records throw {@link PeriodClosedError}. The period\n * itself is stored as a record in the reserved `_periods` collection\n * and written through the normal ledger-instrumented path, so every\n * closure appends a tamper-evident entry to the vault's hash chain.\n *\n * ## Closure model\n *\n * ```\n * vault.closePeriod({ name: 'FY2026-Q1', endDate: '2026-03-31' })\n * └─► PeriodRecord written to _periods/<name>\n * ├─ priorPeriodName / priorPeriodHash — chain to last close\n * ├─ closedAt / closedBy — provenance\n * └─ normal ledger append fires (LedgerStore.append)\n * ```\n *\n * Enforcement (`assertTsWritable`) is vault-local: the Vault caches\n * the list of closed periods on first read and consults that cache in\n * the `Collection.put` / `.delete` path via the `periodGuard` hook.\n *\n * ## Opening model\n *\n * ```\n * vault.openPeriod({\n * name: 'FY2026-Q2',\n * startDate: '2026-04-01',\n * fromPeriod: 'FY2026-Q1',\n * carryForward: async (priorView) => Record<string, Record<string, unknown>>,\n * })\n * ```\n *\n * `carryForward` receives a read-only `VaultInstant` anchored at the\n * prior period's `endDate` (built via `vault.at(endDate)`) so the\n * callback can compute closing aggregates from the sealed state. The\n * returned `{ [collectionName]: { [id]: record } }` map is written\n * before the new `PeriodRecord` lands — opening balances materialise\n * as normal records with fresh timestamps that fall outside every\n * closed period.\n *\n * ## Not covered\n *\n * - Partial re-opening of a closed period. If an auditor needs to\n * make a correction inside a sealed period, the sanctioned path is\n * a compensating entry in the NEW period, not an unlock of the\n * old one.\n * - Automatic period rollover. `closePeriod` / `openPeriod` are\n * deliberately explicit operator calls so the caller decides when\n * the boundary lands.\n *\n * @module\n */\n\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport type { LedgerStore } from '../../with-commit/history/ledger/index.js'\nimport { sha256Hex, canonicalJson } from '../../with-commit/history/ledger/index.js'\nimport { PeriodClosedError, ValidationError } from '../../kernel/errors.js'\n\n/** The reserved collection name holding closed-period metadata. */\nexport const PERIODS_COLLECTION = '_periods'\n\n/**\n * Stored record for one closed or opened accounting period. One entry\n * per period, keyed by `name` in the reserved `_periods` collection.\n *\n * The hash chain between periods is computed at read time by\n * `loadPeriods()` — each record carries the name + hash of its\n * predecessor so a tamper with any period's record breaks the chain\n * into the next one, the same way the ledger's `prevHash` works.\n */\nexport interface PeriodRecord {\n /** Human-readable name (e.g., `'FY2026-Q1'`). Unique per vault. */\n readonly name: string\n /**\n * Role discriminator. A period is `'closed'` from the moment its\n * `closedAt` is recorded; `'opened'` marks a period whose opening\n * entries have been carried forward via {@link openPeriod}. Many\n * workflows will produce one opened period per closed period (the\n * opened one is the SUCCESSOR — its `startDate` equals the prior\n * `endDate + 1 day`).\n */\n readonly kind: 'closed' | 'opened'\n /** ISO date — inclusive upper bound for records belonging to this period. */\n readonly endDate: string\n /** ISO date — lower bound (present on opened periods only). */\n readonly startDate?: string\n /**\n * Record field carrying the business date (e.g. `'date'` on an\n * invoice, `'paidAt'` on a payment). The guard compares\n * `record[dateField]` against `endDate` — NOT the envelope `_ts`.\n * Accounting entries booked late (business date `2026-01-15`,\n * write-time `2026-04-22`) still get sealed when Q1 closes at\n * `2026-03-31` because the comparison uses the business date.\n *\n * Optional for backwards compat. When absent, the guard falls back\n * to envelope `_ts` — that's a write-time seal, appropriate for\n * content that doesn't carry a logical business date (e.g. system\n * settings) but almost never right for accounting ledgers.\n */\n readonly dateField?: string\n /** ISO timestamp recorded at `closePeriod()` / `openPeriod()` call time. */\n readonly closedAt: string\n /** userId of the keyring that invoked the close/open. */\n readonly closedBy: string\n /** Name of the prior period this one chains to, if any. */\n readonly priorPeriodName?: string\n /** sha256(canonicalJson(priorPeriod)) — empty for the first period. */\n readonly priorPeriodHash: string\n /**\n * Opened periods only — the names of the collections whose\n * carry-forward aggregates were written by {@link openPeriod}.\n * Recorded for auditability so a future `verifyPeriodChain()` can\n * cross-check the opening balances against the closing snapshot.\n */\n readonly openingCollections?: readonly string[]\n}\n\n/** Options for `vault.closePeriod()`. */\nexport interface ClosePeriodOptions {\n /** Human-readable name. Must not collide with an existing period. */\n readonly name: string\n /**\n * Inclusive upper cutoff. A record is sealed when its\n * `record[dateField]` (or, if absent, the envelope `_ts`) is at or\n * before this ISO timestamp.\n */\n readonly endDate: string\n /**\n * Record field carrying the business date used for period\n * membership. Recommended for accounting workflows — e.g. an\n * invoice booked late (write-time after close) is still sealed\n * when its `invoice.date` falls inside the closed period.\n *\n * Omit to use envelope `_ts` (write-time seal). This fallback\n * rarely matches real-world accounting semantics; prefer passing\n * an explicit `dateField`.\n */\n readonly dateField?: string\n}\n\n/** Options for `vault.openPeriod()`. */\nexport interface OpenPeriodOptions<TCollections = Record<string, Record<string, unknown>>> {\n /** Human-readable name for the new period. Must be unique. */\n readonly name: string\n /** ISO lower bound of the new period (usually prior `endDate + 1 day`). */\n readonly startDate: string\n /**\n * Name of the prior CLOSED period this one chains from. The prior\n * period's record is verified to exist and to be `kind: 'closed'`;\n * its `endDate` is made available to the `carryForward` callback.\n */\n readonly fromPeriod: string\n /**\n * Receives a read-only facade over the vault's CURRENT state,\n * plus the prior period's `endDate`. Accounting semantics: after\n * a period closes, records with `record[dateField] <= endDate`\n * are frozen — current state equals closing state, so a caller\n * can compute closing balances by querying the live collection\n * with a `where('date', '<=', priorEndDate)` filter.\n *\n * Returns opening-balance records keyed by collection name.\n * Example:\n *\n * ```ts\n * carryForward: async (ctx) => {\n * const closing = await ctx.collection<Journal>('journal')\n * .query().where('date', '<=', ctx.priorEndDate).toArray()\n * const opening: Record<string, Journal> = {}\n * for (const entry of closing) {\n * opening[`OB-${entry.id}`] = { ...entry, date: '2026-04-01' }\n * }\n * return { journal: opening }\n * }\n * ```\n */\n readonly carryForward: (\n ctx: CarryForwardContext,\n ) => Promise<TCollections> | TCollections\n}\n\n/**\n * Context passed to `OpenPeriodOptions.carryForward`. Exposes a\n * read-only subset of the live vault (`collection(name).get/list`)\n * plus the prior period's `endDate` so business-date filters can\n * be built by the caller.\n *\n * Writes go via the return value, not via the facade — the\n * `collection()` here is deliberately restricted to reads.\n */\nexport interface CarryForwardContext {\n /** The prior period's `endDate` — the boundary of the closing snapshot. */\n readonly priorEndDate: string\n /** Read-only collection facade over current vault state. */\n collection<T = unknown>(name: string): ReadOnlyCollection<T>\n}\n\n/** Minimum read surface exposed to `carryForward`. */\nexport interface ReadOnlyCollection<T> {\n get(id: string): Promise<T | null>\n list(): Promise<T[]>\n}\n\n/**\n * Load every period record currently stored on the adapter.\n * Decrypting is the caller's responsibility (we return plain records\n * so the vault can use its own `_periods` DEK).\n *\n * @internal — called by Vault methods that need the closed-period\n * cache. Not part of the public API surface.\n */\nexport async function loadPeriods(\n adapter: NoydbStore,\n vault: string,\n decrypt: (envelope: EncryptedEnvelope) => Promise<PeriodRecord>,\n): Promise<PeriodRecord[]> {\n const ids = await adapter.list(vault, PERIODS_COLLECTION)\n const records: PeriodRecord[] = []\n for (const id of ids) {\n const env = await adapter.get(vault, PERIODS_COLLECTION, id)\n if (env) records.push(await decrypt(env))\n }\n // Stable order by closedAt so chain verification is reproducible.\n records.sort((a, b) => a.closedAt.localeCompare(b.closedAt))\n return records\n}\n\n/**\n * Given the current ordered period list, pick the last entry that\n * belongs to the hash chain — used as the `priorPeriodHash` anchor\n * for the next closure/opening.\n *\n * @internal\n */\nexport async function chainAnchor(\n records: readonly PeriodRecord[],\n): Promise<{ priorPeriodName?: string; priorPeriodHash: string }> {\n const last = records[records.length - 1]\n if (!last) return { priorPeriodHash: '' }\n const hash = await sha256Hex(canonicalJson(last as unknown as Record<string, unknown>))\n return { priorPeriodName: last.name, priorPeriodHash: hash }\n}\n\n/**\n * Throw `PeriodClosedError` if the record being touched falls within\n * any closed period.\n *\n * Three signals, evaluated per period:\n *\n * 1. If the period declares a `dateField`, the guard reads\n * `record[dateField]` on BOTH the existing (prior) record AND the\n * incoming (new) record. Either comparing `<= endDate` triggers\n * the error — callers cannot slide a record into a closed period\n * by editing its date field.\n * 2. If the period has no `dateField`, the guard falls back to the\n * envelope `_ts` of the existing record. Fresh inserts (no\n * existing envelope) pass.\n * 3. For a delete, only the existing side is checked.\n *\n * @internal\n */\nexport function assertTsWritable(\n existing: { ts: string | null; record: Record<string, unknown> | null } | null,\n incomingRecord: Record<string, unknown> | null,\n closedPeriods: readonly PeriodRecord[],\n): void {\n for (const p of closedPeriods) {\n if (p.kind !== 'closed') continue\n if (p.dateField) {\n const checkRecord = (label: string, r: Record<string, unknown> | null): void => {\n if (!r) return\n const v = r[p.dateField!]\n if (typeof v === 'string' && v <= p.endDate) {\n throw new PeriodClosedError(p.name, p.endDate, `${label}[${p.dateField}]=${v}`)\n }\n }\n checkRecord('existing', existing?.record ?? null)\n checkRecord('incoming', incomingRecord)\n continue\n }\n // Fallback: write-time seal via envelope _ts.\n const existingTs = existing?.ts ?? null\n if (existingTs !== null && existingTs <= p.endDate) {\n throw new PeriodClosedError(p.name, p.endDate, existingTs)\n }\n }\n}\n\n/**\n * Sanity-check a proposed period name + endDate against existing\n * records. Shared by closePeriod / openPeriod so the two pathways\n * produce identical diagnostics.\n *\n * @internal\n */\nexport function validatePeriodName(\n name: string,\n existing: readonly PeriodRecord[],\n): void {\n if (name.length === 0) {\n throw new ValidationError('Period name cannot be empty.')\n }\n if (existing.some((p) => p.name === name)) {\n throw new ValidationError(`Period \"${name}\" already exists.`)\n }\n}\n\n/**\n * Wire a reserved-collection ledger append for a period record. The\n * period itself is stored via the adapter as an encrypted envelope;\n * the ledger entry is a normal `put` with the period's payloadHash,\n * so period closures inherit the chain's tamper-evidence.\n *\n * @internal\n */\nexport async function appendPeriodLedgerEntry(\n ledger: LedgerStore | null,\n actor: string,\n envelope: EncryptedEnvelope,\n name: string,\n): Promise<void> {\n if (!ledger) return\n const { envelopePayloadHash } = await import('../../with-commit/history/ledger/index.js')\n await ledger.append({\n op: 'put',\n collection: PERIODS_COLLECTION,\n id: name,\n version: envelope._v,\n actor,\n payloadHash: await envelopePayloadHash(envelope),\n })\n}\n"],"mappings":";;;;;;;;;;AA8DO,IAAM,qBAAqB;AAuJlC,eAAsB,YACpB,SACA,OACA,SACyB;AACzB,QAAM,MAAM,MAAM,QAAQ,KAAK,OAAO,kBAAkB;AACxD,QAAM,UAA0B,CAAC;AACjC,aAAW,MAAM,KAAK;AACpB,UAAM,MAAM,MAAM,QAAQ,IAAI,OAAO,oBAAoB,EAAE;AAC3D,QAAI,IAAK,SAAQ,KAAK,MAAM,QAAQ,GAAG,CAAC;AAAA,EAC1C;AAEA,UAAQ,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,cAAc,EAAE,QAAQ,CAAC;AAC3D,SAAO;AACT;AASA,eAAsB,YACpB,SACgE;AAChE,QAAM,OAAO,QAAQ,QAAQ,SAAS,CAAC;AACvC,MAAI,CAAC,KAAM,QAAO,EAAE,iBAAiB,GAAG;AACxC,QAAM,OAAO,MAAM,UAAU,cAAc,IAA0C,CAAC;AACtF,SAAO,EAAE,iBAAiB,KAAK,MAAM,iBAAiB,KAAK;AAC7D;AAoBO,SAAS,iBACd,UACA,gBACA,eACM;AACN,aAAW,KAAK,eAAe;AAC7B,QAAI,EAAE,SAAS,SAAU;AACzB,QAAI,EAAE,WAAW;AACf,YAAM,cAAc,CAAC,OAAe,MAA4C;AAC9E,YAAI,CAAC,EAAG;AACR,cAAM,IAAI,EAAE,EAAE,SAAU;AACxB,YAAI,OAAO,MAAM,YAAY,KAAK,EAAE,SAAS;AAC3C,gBAAM,IAAI,kBAAkB,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,IAAI,EAAE,SAAS,KAAK,CAAC,EAAE;AAAA,QAChF;AAAA,MACF;AACA,kBAAY,YAAY,UAAU,UAAU,IAAI;AAChD,kBAAY,YAAY,cAAc;AACtC;AAAA,IACF;AAEA,UAAM,aAAa,UAAU,MAAM;AACnC,QAAI,eAAe,QAAQ,cAAc,EAAE,SAAS;AAClD,YAAM,IAAI,kBAAkB,EAAE,MAAM,EAAE,SAAS,UAAU;AAAA,IAC3D;AAAA,EACF;AACF;AASO,SAAS,mBACd,MACA,UACM;AACN,MAAI,KAAK,WAAW,GAAG;AACrB,UAAM,IAAI,gBAAgB,8BAA8B;AAAA,EAC1D;AACA,MAAI,SAAS,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,GAAG;AACzC,UAAM,IAAI,gBAAgB,WAAW,IAAI,mBAAmB;AAAA,EAC9D;AACF;AAUA,eAAsB,wBACpB,QACA,OACA,UACA,MACe;AACf,MAAI,CAAC,OAAQ;AACb,QAAM,EAAE,oBAAoB,IAAI,MAAM,OAAO,sBAA2C;AACxF,QAAM,OAAO,OAAO;AAAA,IAClB,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,IAAI;AAAA,IACJ,SAAS,SAAS;AAAA,IAClB;AAAA,IACA,aAAa,MAAM,oBAAoB,QAAQ;AAAA,EACjD,CAAC;AACH;","names":[]}
@@ -1,24 +0,0 @@
1
- import {
2
- liberateVault
3
- } from "./chunk-PE25C4QL.js";
4
- import "./chunk-DJ4TNF4N.js";
5
- import "./chunk-DKGZIX6S.js";
6
- import "./chunk-H7WQMGXH.js";
7
- import "./chunk-CND5WQLO.js";
8
- import "./chunk-T4NQMPBN.js";
9
- import "./chunk-GMZFHDSG.js";
10
- import "./chunk-3CHNKEFI.js";
11
- import "./chunk-JIW3Q5JN.js";
12
- import "./chunk-HGQ6UNHE.js";
13
- import "./chunk-5UOPIPZC.js";
14
- import "./chunk-UWZ7O4NR.js";
15
- import "./chunk-HCK2DFEK.js";
16
- import "./chunk-VFQOE76I.js";
17
- import "./chunk-LP7BEXCT.js";
18
- import "./chunk-5HZULLHE.js";
19
- import "./chunk-OJ64XMPJ.js";
20
- import "./chunk-PZ5AY32C.js";
21
- export {
22
- liberateVault
23
- };
24
- //# sourceMappingURL=liberate-HFIPHJGR.js.map