@noy-db/hub 0.6.0-pre.1 → 0.6.0-pre.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codemods/0.4.0-pre.json +699 -0
- package/dist/{api-67SBPMMH.js → api-RXUMEKT3.js} +6 -6
- package/dist/attestation/index.js +12 -12
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-GAYWQAFN.js → backup-AVAGHAJE.js} +25 -6
- package/dist/backup-AVAGHAJE.js.map +1 -0
- package/dist/blobs/index.js +5 -5
- package/dist/broker/index.js +6 -6
- package/dist/{bundle-handle-5OUAI7CV.js → bundle-handle-GFNHT52M.js} +2 -2
- package/dist/cargo/index.js +18 -18
- package/dist/{chunk-CYQOUTMY.js → chunk-2BMRJ6LQ.js} +2 -2
- package/dist/{chunk-HS7HNYBD.js → chunk-2DHSSLOD.js} +6 -6
- package/dist/{chunk-JH3OHQM4.js → chunk-2Z3NCLNX.js} +6 -6
- package/dist/{chunk-NVU7ZMPN.js → chunk-3IXIU6FP.js} +2 -2
- package/dist/{chunk-XBLKM73C.js → chunk-3JVXVJ7L.js} +8 -8
- package/dist/{chunk-FY343IZR.js → chunk-3URQC7EH.js} +3 -3
- package/dist/{chunk-BPTZ4K5L.js → chunk-4GZ6XOVW.js} +7 -7
- package/dist/{chunk-ROWL352P.js → chunk-4I72F5DF.js} +4 -4
- package/dist/{chunk-EK7DT5BT.js → chunk-4VUPLMZ6.js} +39 -3
- package/dist/chunk-4VUPLMZ6.js.map +1 -0
- package/dist/{chunk-LBGPO5RL.js → chunk-52JPHN5N.js} +4 -4
- package/dist/{chunk-27TCYH6G.js → chunk-5JY5TSVY.js} +3 -3
- package/dist/{chunk-27TCYH6G.js.map → chunk-5JY5TSVY.js.map} +1 -1
- package/dist/chunk-5O5HRRTV.js +201 -0
- package/dist/chunk-5O5HRRTV.js.map +1 -0
- package/dist/{chunk-ZXJXDHNK.js → chunk-5ZKS6ZE2.js} +2 -2
- package/dist/{chunk-ZXJXDHNK.js.map → chunk-5ZKS6ZE2.js.map} +1 -1
- package/dist/{chunk-MVOWXQHN.js → chunk-6BU3L4UE.js} +2 -2
- package/dist/{chunk-3IIPWA75.js → chunk-6BVER473.js} +28 -3
- package/dist/chunk-6BVER473.js.map +1 -0
- package/dist/{chunk-OSFPNKY4.js → chunk-6FJWSWFT.js} +2 -2
- package/dist/chunk-6FJWSWFT.js.map +1 -0
- package/dist/{chunk-CJ73OLMW.js → chunk-6HFM7EIT.js} +1 -1
- package/dist/chunk-6HFM7EIT.js.map +1 -0
- package/dist/{chunk-PGAPBZEK.js → chunk-6NVPFKN3.js} +4 -4
- package/dist/{chunk-24UICKTB.js → chunk-6SAFL5YE.js} +2 -2
- package/dist/chunk-6SAFL5YE.js.map +1 -0
- package/dist/{chunk-NQRJ5AJO.js → chunk-7H73RIE3.js} +2 -2
- package/dist/{chunk-NQCNSVGI.js → chunk-7MNBICB5.js} +3 -3
- package/dist/{chunk-T4GPR2IR.js → chunk-7TSYBD3E.js} +1 -1
- package/dist/chunk-7TSYBD3E.js.map +1 -0
- package/dist/{chunk-TLNNHG3A.js → chunk-ADW22QSB.js} +3 -3
- package/dist/{chunk-TLNNHG3A.js.map → chunk-ADW22QSB.js.map} +1 -1
- package/dist/{chunk-3737A6EA.js → chunk-BGQ63MCT.js} +74 -17
- package/dist/chunk-BGQ63MCT.js.map +1 -0
- package/dist/{chunk-TFZ7LLOQ.js → chunk-BRVW2GS5.js} +5 -5
- package/dist/{chunk-3UK6STWO.js → chunk-CBXHHCZT.js} +3 -3
- package/dist/{chunk-MXZ5TSTR.js → chunk-CCVYQFLU.js} +6 -6
- package/dist/{chunk-V5C5NNBR.js → chunk-CDB2HVQW.js} +3 -3
- package/dist/{chunk-3HYWYLXL.js → chunk-CEJWMBXO.js} +1 -1
- package/dist/chunk-CEJWMBXO.js.map +1 -0
- package/dist/{chunk-2KIV7BEK.js → chunk-FDX7OWWI.js} +1 -1
- package/dist/chunk-FDX7OWWI.js.map +1 -0
- package/dist/{chunk-4MQDV3HZ.js → chunk-FFDNKRCY.js} +2 -2
- package/dist/{chunk-PP5CO2PR.js → chunk-FMQJZH4R.js} +2 -2
- package/dist/{chunk-JSRU5W2M.js → chunk-FZ6NYJ7L.js} +3 -3
- package/dist/{chunk-ZGGVOADG.js → chunk-G6S5VVHP.js} +2 -2
- package/dist/{chunk-OMSAULZM.js → chunk-GU7A7MQA.js} +9 -9
- package/dist/{chunk-E6427JU2.js → chunk-H4YQSDOI.js} +17 -1
- package/dist/chunk-H4YQSDOI.js.map +1 -0
- package/dist/{chunk-JXIDGFKS.js → chunk-HPLWFNG4.js} +3 -1
- package/dist/chunk-HPLWFNG4.js.map +1 -0
- package/dist/{chunk-ZWMO5GL5.js → chunk-JJNOLSG5.js} +3 -3
- package/dist/{chunk-RLWY6Z44.js → chunk-JRKZTEZZ.js} +62 -6
- package/dist/chunk-JRKZTEZZ.js.map +1 -0
- package/dist/chunk-N35NC4JH.js +123 -0
- package/dist/chunk-N35NC4JH.js.map +1 -0
- package/dist/{chunk-SRGJET2F.js → chunk-NJDQ4YSV.js} +2 -2
- package/dist/{chunk-JEM2IGS3.js → chunk-NPP5R7FF.js} +5 -5
- package/dist/{chunk-DPJTDNUF.js → chunk-O2ERS4UJ.js} +5 -5
- package/dist/{chunk-F3GVO44K.js → chunk-PDLLCOGD.js} +3 -3
- package/dist/{chunk-VBY6ZLJT.js → chunk-PL2GHSCM.js} +3 -3
- package/dist/{chunk-DCMQR46R.js → chunk-PNKHAKQ7.js} +3 -3
- package/dist/{chunk-ZK4CO2KZ.js → chunk-Q6TEJXBX.js} +4 -4
- package/dist/{chunk-GS5RT2KK.js → chunk-QULVCV3M.js} +2 -2
- package/dist/chunk-QULVCV3M.js.map +1 -0
- package/dist/{chunk-KZ3KMDN3.js → chunk-RTAMLDWP.js} +6 -2
- package/dist/chunk-RTAMLDWP.js.map +1 -0
- package/dist/{chunk-MZ5ZFO2D.js → chunk-RXYYFSBB.js} +82 -110
- package/dist/chunk-RXYYFSBB.js.map +1 -0
- package/dist/{chunk-4VCWI42L.js → chunk-SUFG5E73.js} +2 -2
- package/dist/{chunk-SKONR2OL.js → chunk-U5O6GIWZ.js} +2 -2
- package/dist/{chunk-3CLZY46Y.js → chunk-UV4O7FAL.js} +296 -110
- package/dist/chunk-UV4O7FAL.js.map +1 -0
- package/dist/{chunk-HFKGIBMD.js → chunk-VZ3XFUQ7.js} +2 -2
- package/dist/{chunk-3EO7RZLJ.js → chunk-W77KZHCW.js} +4 -4
- package/dist/{chunk-P7NGLLUF.js → chunk-WASHZV34.js} +2 -2
- package/dist/{chunk-XB7LUDKM.js → chunk-WFUIE565.js} +3 -3
- package/dist/{chunk-RPXL6KSX.js → chunk-WLZ47GSL.js} +3 -3
- package/dist/{chunk-MJWCLSQL.js → chunk-X56RTUK3.js} +3 -3
- package/dist/{chunk-MC2LFTQM.js → chunk-XWX7GL56.js} +2 -2
- package/dist/{chunk-46V67XP5.js → chunk-YJ6IONGA.js} +2 -2
- package/dist/chunk-YJ6IONGA.js.map +1 -0
- package/dist/{chunk-24ZLWWEO.js → chunk-YPYHVOXP.js} +1 -1
- package/dist/chunk-YPYHVOXP.js.map +1 -0
- package/dist/{chunk-2LGDCNFJ.js → chunk-Z45YRGFO.js} +1 -1
- package/dist/chunk-Z45YRGFO.js.map +1 -0
- package/dist/classified/index.js +3 -3
- package/dist/{classified-marker-MH3ON5OL.js → classified-marker-2KJAXRRO.js} +3 -3
- package/dist/{collection-facade-AHT7FATG.js → collection-facade-QEJIM6BC.js} +8 -8
- package/dist/consent/index.js +4 -4
- package/dist/cover/index.js +2 -2
- package/dist/custody/index.js +6 -6
- package/dist/{dead-filter-U575NGSH.js → dead-filter-DCB62VWW.js} +2 -2
- package/dist/{delegation-PDYL6RWT.js → delegation-MO7YZYJS.js} +4 -4
- package/dist/derivations/index.js +6 -6
- package/dist/{derive-AKT4KU36.js → derive-IUA6JFLB.js} +5 -5
- package/dist/directory/index.js +5 -5
- package/dist/{dispatch-4XIJSFTT.js → dispatch-23SKSHPD.js} +5 -5
- package/dist/{dispatch-N5HGVUGU.js → dispatch-MJ6SHB3Y.js} +9 -9
- package/dist/{enclave-OPK24QDR.js → enclave-JU4YIEPB.js} +4 -4
- package/dist/{executor-3JZ4POTW.js → executor-FKZURXVV.js} +10 -9
- package/dist/{export-accessible-CPTP5STN.js → export-accessible-4S36PQNR.js} +7 -7
- package/dist/{extract-partition-TWXPHVU7.js → extract-partition-IO7FDZ2P.js} +10 -10
- package/dist/{fanout-sidecar-T2ZGLQFE.js → fanout-sidecar-NNAJQXMX.js} +4 -4
- package/dist/forget/index.js +4 -4
- package/dist/guards/index.js +1 -1
- package/dist/history/index.js +6 -6
- package/dist/i18n/index.js +6 -6
- package/dist/index.d.ts +3 -2
- package/dist/index.js +71 -65
- package/dist/index.js.map +1 -1
- package/dist/introspection/index.js +6 -6
- package/dist/{issue-N74C55X6.js → issue-RIVHSY2S.js} +6 -6
- package/dist/kernel/query/builder.d.ts +15 -2
- package/dist/kernel/query/join.d.ts +27 -0
- package/dist/kernel/secret-mode.d.ts +1 -1
- package/dist/kernel/types.d.ts +41 -6
- package/dist/kernel/vault.d.ts +19 -15
- package/dist/{ledger-DONWFC5M.js → ledger-AETNF4OM.js} +6 -6
- package/dist/liberate-GFN4C7RR.js +24 -0
- package/dist/{link-set-2TTP4VLO.js → link-set-E5HNY67I.js} +5 -5
- package/dist/{managed-secret-EAOYWRYF.js → managed-secret-CWQ6PND5.js} +3 -3
- package/dist/materialized-views/index.js +11 -10
- package/dist/money/index.js +10 -6
- package/dist/{noydb-6W2XGQCS.js → noydb-FYTCH2GD.js} +30 -30
- package/dist/overlay-views/index.js +1 -1
- package/dist/periods/index.js +17 -7
- package/dist/pod/index.js +33 -33
- package/dist/policy/index.js +3 -3
- package/dist/port/to/index.d.ts +2 -2
- package/dist/port/to/locator.d.ts +54 -8
- package/dist/port/with/collection-options.d.ts +1 -1
- package/dist/portability/index.js +6 -6
- package/dist/{post-register-ORQOQJCS.js → post-register-2XSSMGEQ.js} +4 -4
- package/dist/query/index.js +2 -2
- package/dist/{register-LHETZRJM.js → register-4EFJCVYD.js} +11 -11
- package/dist/{registry-JRIN447B.js → registry-4SDHHOJ7.js} +6 -6
- package/dist/{registry-AMAZ6QRZ.js → registry-OYTFGWVK.js} +4 -4
- package/dist/{request-withdrawal-2DN2RGCO.js → request-withdrawal-KGXGDPVQ.js} +9 -9
- package/dist/{reveal-AG4SCHUQ.js → reveal-BW36KCOQ.js} +3 -3
- package/dist/{revoke-ZX4NM2CJ.js → revoke-JFN773KF.js} +6 -6
- package/dist/sealed-record/index.js +6 -6
- package/dist/search/index.js +1 -1
- package/dist/{seed-IRCDGIRK.js → seed-GDV5PT4R.js} +6 -6
- package/dist/sequence/index.js +4 -4
- package/dist/session/index.js +3 -3
- package/dist/{signer-7KHD4OL2.js → signer-TA55QB6R.js} +5 -5
- package/dist/snapshots/index.js +5 -5
- package/dist/{stale-K734VACF.js → stale-4PUTWI2H.js} +5 -5
- package/dist/{storage-4H2GF6RQ.js → storage-V7MTFAQJ.js} +5 -5
- package/dist/{store-coordination-provider-4SKLSFUG.js → store-coordination-provider-GFCUOBR6.js} +3 -3
- package/dist/sync/index.js +5 -5
- package/dist/team/index.js +8 -8
- package/dist/tiers/index.js +4 -4
- package/dist/to/index.js +16 -6
- package/dist/to/index.js.map +1 -1
- package/dist/via/classified/descriptor.d.ts +1 -1
- package/dist/via/money/exact.d.ts +44 -0
- package/dist/via/money/index.d.ts +2 -0
- package/dist/via/money/normalize.d.ts +20 -0
- package/dist/{walk-MQHYNDLZ.js → walk-3ZECBFDA.js} +7 -7
- package/dist/with-audit/attestation/index.d.ts +1 -1
- package/dist/with-audit/guards/immutable-guard.d.ts +14 -0
- package/dist/with-audit/guards/with-guard.d.ts +1 -1
- package/dist/with-audit/periods/active.d.ts +28 -1
- package/dist/with-audit/periods/index.d.ts +4 -2
- package/dist/with-audit/periods/periods.d.ts +160 -5
- package/dist/with-audit/periods/strategy.d.ts +13 -4
- package/dist/with-audit/periods/vault-facade.d.ts +89 -10
- package/dist/with-audit/periods/window.d.ts +10 -0
- package/dist/with-cargo/index.d.ts +2 -2
- package/dist/with-commit/history/ledger/entry.d.ts +1 -1
- package/dist/with-commit/numbering/descriptor.d.ts +1 -1
- package/dist/with-formula/derivations/with-derivation.d.ts +1 -1
- package/dist/with-formula/materialized-views/types.d.ts +52 -0
- package/dist/with-formula/materialized-views/with-materialized-view.d.ts +3 -3
- package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +1 -1
- package/dist/with-party/custody/index.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/index.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
- package/dist/with-party/team/echo-ceremony.d.ts +3 -3
- package/dist/with-party/team/echo-secret.d.ts +2 -2
- package/dist/with-party/team/keyring.d.ts +10 -1
- package/dist/with-pod/bundle.d.ts +15 -0
- package/dist/with-shape/introspection/index.d.ts +2 -1
- package/dist/with-shape/introspection/types.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/derive.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/index.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/types.d.ts +1 -1
- package/dist/{withdraw-accessible-JSDQHXHE.js → withdraw-accessible-7PG4DYQK.js} +8 -8
- package/package.json +6 -4
- package/dist/backup-GAYWQAFN.js.map +0 -1
- package/dist/chunk-24UICKTB.js.map +0 -1
- package/dist/chunk-24ZLWWEO.js.map +0 -1
- package/dist/chunk-2KIV7BEK.js.map +0 -1
- package/dist/chunk-2LGDCNFJ.js.map +0 -1
- package/dist/chunk-3737A6EA.js.map +0 -1
- package/dist/chunk-3CLZY46Y.js.map +0 -1
- package/dist/chunk-3HYWYLXL.js.map +0 -1
- package/dist/chunk-3IIPWA75.js.map +0 -1
- package/dist/chunk-46V67XP5.js.map +0 -1
- package/dist/chunk-CJ73OLMW.js.map +0 -1
- package/dist/chunk-E6427JU2.js.map +0 -1
- package/dist/chunk-EK7DT5BT.js.map +0 -1
- package/dist/chunk-GS5RT2KK.js.map +0 -1
- package/dist/chunk-JXIDGFKS.js.map +0 -1
- package/dist/chunk-KZ3KMDN3.js.map +0 -1
- package/dist/chunk-LTU4FLHG.js +0 -131
- package/dist/chunk-LTU4FLHG.js.map +0 -1
- package/dist/chunk-MZ5ZFO2D.js.map +0 -1
- package/dist/chunk-OSFPNKY4.js.map +0 -1
- package/dist/chunk-RLWY6Z44.js.map +0 -1
- package/dist/chunk-T4GPR2IR.js.map +0 -1
- package/dist/liberate-KICI7AJN.js +0 -24
- /package/dist/{api-67SBPMMH.js.map → api-RXUMEKT3.js.map} +0 -0
- /package/dist/{bundle-handle-5OUAI7CV.js.map → bundle-handle-GFNHT52M.js.map} +0 -0
- /package/dist/{chunk-CYQOUTMY.js.map → chunk-2BMRJ6LQ.js.map} +0 -0
- /package/dist/{chunk-HS7HNYBD.js.map → chunk-2DHSSLOD.js.map} +0 -0
- /package/dist/{chunk-JH3OHQM4.js.map → chunk-2Z3NCLNX.js.map} +0 -0
- /package/dist/{chunk-NVU7ZMPN.js.map → chunk-3IXIU6FP.js.map} +0 -0
- /package/dist/{chunk-XBLKM73C.js.map → chunk-3JVXVJ7L.js.map} +0 -0
- /package/dist/{chunk-FY343IZR.js.map → chunk-3URQC7EH.js.map} +0 -0
- /package/dist/{chunk-BPTZ4K5L.js.map → chunk-4GZ6XOVW.js.map} +0 -0
- /package/dist/{chunk-ROWL352P.js.map → chunk-4I72F5DF.js.map} +0 -0
- /package/dist/{chunk-LBGPO5RL.js.map → chunk-52JPHN5N.js.map} +0 -0
- /package/dist/{chunk-MVOWXQHN.js.map → chunk-6BU3L4UE.js.map} +0 -0
- /package/dist/{chunk-PGAPBZEK.js.map → chunk-6NVPFKN3.js.map} +0 -0
- /package/dist/{chunk-NQRJ5AJO.js.map → chunk-7H73RIE3.js.map} +0 -0
- /package/dist/{chunk-NQCNSVGI.js.map → chunk-7MNBICB5.js.map} +0 -0
- /package/dist/{chunk-TFZ7LLOQ.js.map → chunk-BRVW2GS5.js.map} +0 -0
- /package/dist/{chunk-3UK6STWO.js.map → chunk-CBXHHCZT.js.map} +0 -0
- /package/dist/{chunk-MXZ5TSTR.js.map → chunk-CCVYQFLU.js.map} +0 -0
- /package/dist/{chunk-V5C5NNBR.js.map → chunk-CDB2HVQW.js.map} +0 -0
- /package/dist/{chunk-4MQDV3HZ.js.map → chunk-FFDNKRCY.js.map} +0 -0
- /package/dist/{chunk-PP5CO2PR.js.map → chunk-FMQJZH4R.js.map} +0 -0
- /package/dist/{chunk-JSRU5W2M.js.map → chunk-FZ6NYJ7L.js.map} +0 -0
- /package/dist/{chunk-ZGGVOADG.js.map → chunk-G6S5VVHP.js.map} +0 -0
- /package/dist/{chunk-OMSAULZM.js.map → chunk-GU7A7MQA.js.map} +0 -0
- /package/dist/{chunk-ZWMO5GL5.js.map → chunk-JJNOLSG5.js.map} +0 -0
- /package/dist/{chunk-SRGJET2F.js.map → chunk-NJDQ4YSV.js.map} +0 -0
- /package/dist/{chunk-JEM2IGS3.js.map → chunk-NPP5R7FF.js.map} +0 -0
- /package/dist/{chunk-DPJTDNUF.js.map → chunk-O2ERS4UJ.js.map} +0 -0
- /package/dist/{chunk-F3GVO44K.js.map → chunk-PDLLCOGD.js.map} +0 -0
- /package/dist/{chunk-VBY6ZLJT.js.map → chunk-PL2GHSCM.js.map} +0 -0
- /package/dist/{chunk-DCMQR46R.js.map → chunk-PNKHAKQ7.js.map} +0 -0
- /package/dist/{chunk-ZK4CO2KZ.js.map → chunk-Q6TEJXBX.js.map} +0 -0
- /package/dist/{chunk-4VCWI42L.js.map → chunk-SUFG5E73.js.map} +0 -0
- /package/dist/{chunk-SKONR2OL.js.map → chunk-U5O6GIWZ.js.map} +0 -0
- /package/dist/{chunk-HFKGIBMD.js.map → chunk-VZ3XFUQ7.js.map} +0 -0
- /package/dist/{chunk-3EO7RZLJ.js.map → chunk-W77KZHCW.js.map} +0 -0
- /package/dist/{chunk-P7NGLLUF.js.map → chunk-WASHZV34.js.map} +0 -0
- /package/dist/{chunk-XB7LUDKM.js.map → chunk-WFUIE565.js.map} +0 -0
- /package/dist/{chunk-RPXL6KSX.js.map → chunk-WLZ47GSL.js.map} +0 -0
- /package/dist/{chunk-MJWCLSQL.js.map → chunk-X56RTUK3.js.map} +0 -0
- /package/dist/{chunk-MC2LFTQM.js.map → chunk-XWX7GL56.js.map} +0 -0
- /package/dist/{classified-marker-MH3ON5OL.js.map → classified-marker-2KJAXRRO.js.map} +0 -0
- /package/dist/{collection-facade-AHT7FATG.js.map → collection-facade-QEJIM6BC.js.map} +0 -0
- /package/dist/{dead-filter-U575NGSH.js.map → dead-filter-DCB62VWW.js.map} +0 -0
- /package/dist/{delegation-PDYL6RWT.js.map → delegation-MO7YZYJS.js.map} +0 -0
- /package/dist/{derive-AKT4KU36.js.map → derive-IUA6JFLB.js.map} +0 -0
- /package/dist/{dispatch-4XIJSFTT.js.map → dispatch-23SKSHPD.js.map} +0 -0
- /package/dist/{dispatch-N5HGVUGU.js.map → dispatch-MJ6SHB3Y.js.map} +0 -0
- /package/dist/{enclave-OPK24QDR.js.map → enclave-JU4YIEPB.js.map} +0 -0
- /package/dist/{executor-3JZ4POTW.js.map → executor-FKZURXVV.js.map} +0 -0
- /package/dist/{export-accessible-CPTP5STN.js.map → export-accessible-4S36PQNR.js.map} +0 -0
- /package/dist/{extract-partition-TWXPHVU7.js.map → extract-partition-IO7FDZ2P.js.map} +0 -0
- /package/dist/{fanout-sidecar-T2ZGLQFE.js.map → fanout-sidecar-NNAJQXMX.js.map} +0 -0
- /package/dist/{issue-N74C55X6.js.map → issue-RIVHSY2S.js.map} +0 -0
- /package/dist/{ledger-DONWFC5M.js.map → ledger-AETNF4OM.js.map} +0 -0
- /package/dist/{liberate-KICI7AJN.js.map → liberate-GFN4C7RR.js.map} +0 -0
- /package/dist/{link-set-2TTP4VLO.js.map → link-set-E5HNY67I.js.map} +0 -0
- /package/dist/{managed-secret-EAOYWRYF.js.map → managed-secret-CWQ6PND5.js.map} +0 -0
- /package/dist/{noydb-6W2XGQCS.js.map → noydb-FYTCH2GD.js.map} +0 -0
- /package/dist/{post-register-ORQOQJCS.js.map → post-register-2XSSMGEQ.js.map} +0 -0
- /package/dist/{register-LHETZRJM.js.map → register-4EFJCVYD.js.map} +0 -0
- /package/dist/{registry-AMAZ6QRZ.js.map → registry-4SDHHOJ7.js.map} +0 -0
- /package/dist/{registry-JRIN447B.js.map → registry-OYTFGWVK.js.map} +0 -0
- /package/dist/{request-withdrawal-2DN2RGCO.js.map → request-withdrawal-KGXGDPVQ.js.map} +0 -0
- /package/dist/{reveal-AG4SCHUQ.js.map → reveal-BW36KCOQ.js.map} +0 -0
- /package/dist/{revoke-ZX4NM2CJ.js.map → revoke-JFN773KF.js.map} +0 -0
- /package/dist/{seed-IRCDGIRK.js.map → seed-GDV5PT4R.js.map} +0 -0
- /package/dist/{signer-7KHD4OL2.js.map → signer-TA55QB6R.js.map} +0 -0
- /package/dist/{stale-K734VACF.js.map → stale-4PUTWI2H.js.map} +0 -0
- /package/dist/{storage-4H2GF6RQ.js.map → storage-V7MTFAQJ.js.map} +0 -0
- /package/dist/{store-coordination-provider-4SKLSFUG.js.map → store-coordination-provider-GFCUOBR6.js.map} +0 -0
- /package/dist/{walk-MQHYNDLZ.js.map → walk-3ZECBFDA.js.map} +0 -0
- /package/dist/{withdraw-accessible-JSDQHXHE.js.map → withdraw-accessible-7PG4DYQK.js.map} +0 -0
package/dist/team/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
MemoryDeviceSealProvider,
|
|
3
3
|
beginEchoUnlock,
|
|
4
4
|
withTeam
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-YJ6IONGA.js";
|
|
6
6
|
import {
|
|
7
7
|
NO_TEAM,
|
|
8
8
|
burnPaperRecoveryEntry,
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
unwrapMagicLinkGrant,
|
|
32
32
|
updateAuthenticator,
|
|
33
33
|
writeMagicLinkGrant
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-O2ERS4UJ.js";
|
|
35
|
+
import "../chunk-3IXIU6FP.js";
|
|
36
36
|
import {
|
|
37
37
|
buildEchoBlock,
|
|
38
38
|
buildRecipientKeyringFile,
|
|
@@ -53,17 +53,17 @@ import {
|
|
|
53
53
|
updateKeyringIdentity,
|
|
54
54
|
verifyPrompt,
|
|
55
55
|
verifyTypedEcho
|
|
56
|
-
} from "../chunk-
|
|
57
|
-
import "../chunk-
|
|
56
|
+
} from "../chunk-JRKZTEZZ.js";
|
|
57
|
+
import "../chunk-5JY5TSVY.js";
|
|
58
58
|
import "../chunk-AHLJSVRL.js";
|
|
59
|
-
import "../chunk-
|
|
60
|
-
import "../chunk-
|
|
59
|
+
import "../chunk-3URQC7EH.js";
|
|
60
|
+
import "../chunk-7H73RIE3.js";
|
|
61
61
|
import "../chunk-HXGUIPQB.js";
|
|
62
62
|
import "../chunk-AR2JDFAE.js";
|
|
63
63
|
import "../chunk-747LRSOO.js";
|
|
64
64
|
import "../chunk-LP7BEXCT.js";
|
|
65
65
|
import "../chunk-VCETL77O.js";
|
|
66
|
-
import "../chunk-
|
|
66
|
+
import "../chunk-YPYHVOXP.js";
|
|
67
67
|
import {
|
|
68
68
|
TeamNotEnabledError
|
|
69
69
|
} from "../chunk-HNGSV2YC.js";
|
package/dist/tiers/index.js
CHANGED
|
@@ -11,16 +11,16 @@ import {
|
|
|
11
11
|
putAtTier,
|
|
12
12
|
syncDerivedOutputs,
|
|
13
13
|
withTiers
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-6NVPFKN3.js";
|
|
15
15
|
import "../chunk-AHLJSVRL.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-3URQC7EH.js";
|
|
17
|
+
import "../chunk-7H73RIE3.js";
|
|
18
18
|
import "../chunk-HXGUIPQB.js";
|
|
19
19
|
import "../chunk-AR2JDFAE.js";
|
|
20
20
|
import "../chunk-747LRSOO.js";
|
|
21
21
|
import "../chunk-LP7BEXCT.js";
|
|
22
22
|
import "../chunk-VCETL77O.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-YPYHVOXP.js";
|
|
24
24
|
import {
|
|
25
25
|
TiersNotEnabledError
|
|
26
26
|
} from "../chunk-HNGSV2YC.js";
|
package/dist/to/index.js
CHANGED
|
@@ -10,8 +10,18 @@ import {
|
|
|
10
10
|
import "../chunk-PZ5AY32C.js";
|
|
11
11
|
|
|
12
12
|
// src/port/to/locator.ts
|
|
13
|
+
function isPodStore(store) {
|
|
14
|
+
return store.kind === "bundle";
|
|
15
|
+
}
|
|
13
16
|
function createStoreLocator() {
|
|
14
17
|
const factories = /* @__PURE__ */ new Map();
|
|
18
|
+
function lookup(kind) {
|
|
19
|
+
const factory = factories.get(kind);
|
|
20
|
+
if (!factory) {
|
|
21
|
+
throw new UnknownStoreKindError(kind, [...factories.keys()].sort());
|
|
22
|
+
}
|
|
23
|
+
return factory;
|
|
24
|
+
}
|
|
15
25
|
return {
|
|
16
26
|
register(kind, factory) {
|
|
17
27
|
if (factories.has(kind)) {
|
|
@@ -20,11 +30,10 @@ function createStoreLocator() {
|
|
|
20
30
|
factories.set(kind, factory);
|
|
21
31
|
},
|
|
22
32
|
resolve(descriptor, opts = {}) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return factory(descriptor, opts);
|
|
33
|
+
return lookup(descriptor.kind)(descriptor, opts);
|
|
34
|
+
},
|
|
35
|
+
resolveAny(descriptor, opts = {}) {
|
|
36
|
+
return lookup(descriptor.kind)(descriptor, opts);
|
|
28
37
|
}
|
|
29
38
|
};
|
|
30
39
|
}
|
|
@@ -36,6 +45,7 @@ export {
|
|
|
36
45
|
PodVersionConflictError,
|
|
37
46
|
StoreCapabilityError,
|
|
38
47
|
UnknownStoreKindError,
|
|
39
|
-
createStoreLocator
|
|
48
|
+
createStoreLocator,
|
|
49
|
+
isPodStore
|
|
40
50
|
};
|
|
41
51
|
//# sourceMappingURL=index.js.map
|
package/dist/to/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/port/to/locator.ts"],"sourcesContent":["/**\n * The Locator seam (#945 Task 1): a serializable, CREDENTIALLESS store\n * descriptor plus a factory registry that reconstructs a `NoydbStore` from\n * data.\n *\n * A `StoreDescriptor` is the pod-portable \"what store and where\" — kind,\n * broad topology class, and a kind-specific serializable address/options\n * bag. It is deliberately dumb data: no field on it is ever typed as a\n * function, a `StoreCredentialSource`, or a `StoreCredentials` value, so a\n * descriptor can be written into a pod / manifest / sync payload without an\n * audit for leaked secrets. Anything that must resolve device-side or\n * user-side — a short-lived credential, a device-local directory override,\n * a mounted drive handle — travels out-of-band via `resolve()`'s `opts`,\n * never through the descriptor itself.\n *\n * This module is pure TypeScript: no imports beyond the kernel's own types\n * and errors, no Node built-ins, no crypto. It adds zero runtime\n * dependencies to `@noy-db/hub/to`.\n */\nimport type { NoydbStore, StoreCredentialSource } from '../../kernel/types.js'\nimport { DuplicateStoreKindError, UnknownStoreKindError } from '../../kernel/errors.js'\n\n/**\n * The broad topology bucket a store descriptor's kind falls into —\n * used by callers/UI to group or filter descriptors without knowing every\n * concrete `kind` string.\n */\nexport type StoreClass = 'local' | 'browser' | 'lan' | 'cloud'\n\n/**\n * A serializable, CREDENTIALLESS description of a store instance: enough\n * data to reconstruct a `NoydbStore` via a registered `StoreFactory`, and\n * safe to persist or transmit as-is.\n *\n * CREDENTIALLESS BY CONSTRUCTION: no field here may be typed as a function,\n * a `StoreCredentialSource`, or a `StoreCredentials` value. Credentials\n * NEVER ride the descriptor — they are supplied separately (as a\n * `StoreCredentialSource`) to `StoreLocator.resolve()` at resolve time.\n */\nexport interface StoreDescriptor {\n /** The registered factory key (e.g. `'file'`, `'aws-s3'`, `'webdav'`). */\n readonly kind: string\n /** The broad topology bucket this kind falls into. */\n readonly class: StoreClass\n /** Kind-specific serializable location (e.g. `{ dir }`, `{ bucket, region }`). */\n readonly address: unknown\n /** Kind-specific serializable tuning options. */\n readonly options?: unknown\n}\n\n/**\n * A kind-specific, device-local supplement to a `StoreDescriptor` — a\n * directory override, a mount point, a drive handle — that is resolved\n * device-side and never carried inside a pod alongside the descriptor.\n */\nexport type StoreBinding = unknown\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/port/to/locator.ts"],"sourcesContent":["/**\n * The Locator seam (#945 Task 1): a serializable, CREDENTIALLESS store\n * descriptor plus a factory registry that reconstructs a `NoydbStore` from\n * data.\n *\n * A `StoreDescriptor` is the pod-portable \"what store and where\" — kind,\n * broad topology class, and a kind-specific serializable address/options\n * bag. It is deliberately dumb data: no field on it is ever typed as a\n * function, a `StoreCredentialSource`, or a `StoreCredentials` value, so a\n * descriptor can be written into a pod / manifest / sync payload without an\n * audit for leaked secrets. Anything that must resolve device-side or\n * user-side — a short-lived credential, a device-local directory override,\n * a mounted drive handle — travels out-of-band via `resolve()`'s `opts`,\n * never through the descriptor itself.\n *\n * This module is pure TypeScript: no imports beyond the kernel's own types\n * and errors, no Node built-ins, no crypto. It adds zero runtime\n * dependencies to `@noy-db/hub/to`.\n */\nimport type { NoydbStore, NoydbPodStore, StoreCredentialSource } from '../../kernel/types.js'\nimport { DuplicateStoreKindError, UnknownStoreKindError } from '../../kernel/errors.js'\n\n/**\n * The broad topology bucket a store descriptor's kind falls into —\n * used by callers/UI to group or filter descriptors without knowing every\n * concrete `kind` string.\n */\nexport type StoreClass = 'local' | 'browser' | 'lan' | 'cloud'\n\n/**\n * A serializable, CREDENTIALLESS description of a store instance: enough\n * data to reconstruct a `NoydbStore` via a registered `StoreFactory`, and\n * safe to persist or transmit as-is.\n *\n * CREDENTIALLESS BY CONSTRUCTION: no field here may be typed as a function,\n * a `StoreCredentialSource`, or a `StoreCredentials` value. Credentials\n * NEVER ride the descriptor — they are supplied separately (as a\n * `StoreCredentialSource`) to `StoreLocator.resolve()` at resolve time.\n */\nexport interface StoreDescriptor {\n /** The registered factory key (e.g. `'file'`, `'aws-s3'`, `'webdav'`). */\n readonly kind: string\n /** The broad topology bucket this kind falls into. */\n readonly class: StoreClass\n /** Kind-specific serializable location (e.g. `{ dir }`, `{ bucket, region }`). */\n readonly address: unknown\n /** Kind-specific serializable tuning options. */\n readonly options?: unknown\n}\n\n/**\n * A kind-specific, device-local supplement to a `StoreDescriptor` — a\n * directory override, a mount point, a drive handle — that is resolved\n * device-side and never carried inside a pod alongside the descriptor.\n */\nexport type StoreBinding = unknown\n\n/**\n * Either store shape a factory may produce: the 6-method KV `NoydbStore`, or\n * the whole-vault `NoydbPodStore` implemented by `to-drive` / `to-icloud`.\n *\n * The two are DISJOINT, not sub/supertypes — a pod store has none of the six\n * KV methods — which is why moving between them needs a double cast and why\n * `isPodStore()` exists to narrow instead.\n */\nexport type AnyNoydbStore = NoydbStore | NoydbPodStore\n\n/**\n * Narrow an `AnyNoydbStore` to the pod shape. Discriminates on the\n * `kind: 'bundle'` tag `NoydbPodStore` carries for exactly this purpose; a\n * `NoydbStore` has no `kind` field at all.\n *\n * Use this at a `resolve()` boundary instead of casting — a store resolved\n * from a descriptor read out of a pod is only known to be one of the two\n * shapes at runtime.\n */\nexport function isPodStore(store: AnyNoydbStore): store is NoydbPodStore {\n return (store as NoydbPodStore).kind === 'bundle'\n}\n\n/**\n * Reconstructs a live store from a `StoreDescriptor`. Registered against a\n * `StoreLocator` under the descriptor's `kind`.\n *\n * The type parameter says WHICH shape this factory builds. It defaults to\n * `NoydbStore`, so a bare `StoreFactory` means exactly what it always has;\n * a pod-store factory declares `StoreFactory<NoydbPodStore>` and registers\n * without a cast (#988).\n */\nexport type StoreFactory<S extends AnyNoydbStore = NoydbStore> = (\n descriptor: StoreDescriptor,\n opts: { binding?: StoreBinding; credentials?: StoreCredentialSource },\n) => S | Promise<S>\n\n/** A registry of `StoreFactory`s, keyed by `StoreDescriptor.kind`. */\nexport interface StoreLocator {\n /**\n * Register a factory for `kind`. Throws if `kind` is already registered.\n *\n * Accepts a factory building EITHER store shape — `S` is inferred from the\n * factory's own return type, so a `NoydbPodStore` factory needs no cast.\n */\n register<S extends AnyNoydbStore>(kind: string, factory: StoreFactory<S>): void\n /**\n * Resolve `descriptor` to a live store via its kind's registered factory.\n *\n * Returns `NoydbStore`. If the `kind` was registered with a pod-store\n * factory, the resolved value is really a `NoydbPodStore`: this signature\n * is the seam's remaining unsoundness, kept because widening it to\n * `AnyNoydbStore` would break every existing caller. Where the descriptor's\n * kind is not statically known, prefer `resolveAny()` and `isPodStore()`.\n */\n resolve(\n descriptor: StoreDescriptor,\n opts?: { binding?: StoreBinding; credentials?: StoreCredentialSource },\n ): NoydbStore | Promise<NoydbStore>\n /**\n * As `resolve()`, but typed honestly: the registry is keyed by a runtime\n * `kind` string, so which of the two shapes comes back is not knowable\n * statically. Narrow the result with `isPodStore()`.\n */\n resolveAny(\n descriptor: StoreDescriptor,\n opts?: { binding?: StoreBinding; credentials?: StoreCredentialSource },\n ): AnyNoydbStore | Promise<AnyNoydbStore>\n}\n\n/**\n * Creates a fresh, empty `StoreLocator`.\n *\n * DUPLICATE REGISTRATION: `register()` throws if `kind` is already\n * registered, rather than silently overwriting it (last-wins). A\n * composition root that registers the same kind twice is almost always a\n * mistake — a copy-pasted setup block, two satellite packages fighting\n * over the same kind string — and last-wins would hide it behind whichever\n * registration happened to run last. This mirrors the\n * `DuplicateBehaviorNameError` philosophy (#947): fail loudly at the\n * mistake's source instead of silently at some unrelated `resolve()` call\n * later.\n */\nexport function createStoreLocator(): StoreLocator {\n const factories = new Map<string, StoreFactory<AnyNoydbStore>>()\n\n function lookup(kind: string): StoreFactory<AnyNoydbStore> {\n const factory = factories.get(kind)\n if (!factory) {\n throw new UnknownStoreKindError(kind, [...factories.keys()].sort())\n }\n return factory\n }\n\n return {\n register(kind, factory) {\n if (factories.has(kind)) {\n throw new DuplicateStoreKindError(kind)\n }\n factories.set(kind, factory)\n },\n resolve(descriptor, opts = {}) {\n // The one place the seam's `resolve(): NoydbStore` signature is paid\n // for. A pod-store `kind` really returns a `NoydbPodStore`; the registry\n // is keyed by a runtime string so nothing here can prove otherwise.\n // Concentrated in the module that owns the invariant rather than\n // duplicated as `as unknown as StoreFactory` in every pod-store package\n // (#988). `resolveAny()` is the honest signature over the same call.\n return lookup(descriptor.kind)(descriptor, opts) as NoydbStore | Promise<NoydbStore>\n },\n resolveAny(descriptor, opts = {}) {\n return lookup(descriptor.kind)(descriptor, opts)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4EO,SAAS,WAAW,OAA8C;AACvE,SAAQ,MAAwB,SAAS;AAC3C;AA8DO,SAAS,qBAAmC;AACjD,QAAM,YAAY,oBAAI,IAAyC;AAE/D,WAAS,OAAO,MAA2C;AACzD,UAAM,UAAU,UAAU,IAAI,IAAI;AAClC,QAAI,CAAC,SAAS;AACZ,YAAM,IAAI,sBAAsB,MAAM,CAAC,GAAG,UAAU,KAAK,CAAC,EAAE,KAAK,CAAC;AAAA,IACpE;AACA,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,SAAS,MAAM,SAAS;AACtB,UAAI,UAAU,IAAI,IAAI,GAAG;AACvB,cAAM,IAAI,wBAAwB,IAAI;AAAA,MACxC;AACA,gBAAU,IAAI,MAAM,OAAO;AAAA,IAC7B;AAAA,IACA,QAAQ,YAAY,OAAO,CAAC,GAAG;AAO7B,aAAO,OAAO,WAAW,IAAI,EAAE,YAAY,IAAI;AAAA,IACjD;AAAA,IACA,WAAW,YAAY,OAAO,CAAC,GAAG;AAChC,aAAO,OAAO,WAAW,IAAI,EAAE,YAAY,IAAI;AAAA,IACjD;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Classified fields — behavioral sensitive-field descriptors (stage 1).
|
|
3
|
-
* Design:
|
|
3
|
+
* Design: design-history/2026-07-04-classified-fields-design.md
|
|
4
4
|
* Law: open on write, declarative on read — read-side behavior is this
|
|
5
5
|
* closed vocabulary; there are no read-side callbacks.
|
|
6
6
|
* @module
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact decimal arithmetic for post-aggregate row math (#1007).
|
|
3
|
+
*
|
|
4
|
+
* Money leaves a reducer as a `MoneyString` — a decimal string, exact by
|
|
5
|
+
* construction. Doing `Number(a) - Number(b)` on two of those re-introduces
|
|
6
|
+
* binary floating point at the one step the money type exists to protect:
|
|
7
|
+
* `10.05 - 0.10` becomes `9.950000000000001`, which `quantizeMoneyFields`
|
|
8
|
+
* then correctly REFUSES rather than silently storing drift.
|
|
9
|
+
*
|
|
10
|
+
* So `derive` is handed these instead. Everything runs in scaled BigInt at the
|
|
11
|
+
* widest scale of its inputs and formats back to a decimal string, which means
|
|
12
|
+
* no operation here can introduce a representation error. Deliberately just
|
|
13
|
+
* the additive set — `add` / `sub` / `neg` / `min` / `max` / `cmp`. Anything
|
|
14
|
+
* needing multiplication or division needs a rounding policy, and a rounding
|
|
15
|
+
* policy is a decision the caller must make explicitly, not one this module
|
|
16
|
+
* should guess.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
/** A value these helpers accept: a decimal string, a number, or a bigint of whole units. */
|
|
21
|
+
export type ExactOperand = string | number | bigint;
|
|
22
|
+
/**
|
|
23
|
+
* Exact decimal helpers handed to an MV `derive` as its second argument.
|
|
24
|
+
*
|
|
25
|
+
* Every result is a decimal string, so results compose without ever passing
|
|
26
|
+
* through a float. Declare the derived field in the MV's `moneyFields` and the
|
|
27
|
+
* final value is quantised to that descriptor's scale on the way to storage.
|
|
28
|
+
*/
|
|
29
|
+
export interface ExactMath {
|
|
30
|
+
/** `a + b`, exact. */
|
|
31
|
+
add(a: ExactOperand, b: ExactOperand): string;
|
|
32
|
+
/** `a - b`, exact. */
|
|
33
|
+
sub(a: ExactOperand, b: ExactOperand): string;
|
|
34
|
+
/** `-a`, exact. */
|
|
35
|
+
neg(a: ExactOperand): string;
|
|
36
|
+
/** The larger of `a` and `b`. */
|
|
37
|
+
max(a: ExactOperand, b: ExactOperand): string;
|
|
38
|
+
/** The smaller of `a` and `b`. */
|
|
39
|
+
min(a: ExactOperand, b: ExactOperand): string;
|
|
40
|
+
/** `-1` when `a < b`, `0` when equal, `1` when `a > b`. */
|
|
41
|
+
cmp(a: ExactOperand, b: ExactOperand): -1 | 0 | 1;
|
|
42
|
+
}
|
|
43
|
+
/** The singleton passed to `derive` — stateless, so there is nothing to construct per row. */
|
|
44
|
+
export declare const exactMath: ExactMath;
|
|
@@ -13,3 +13,5 @@ export { mulRate, allocate } from './arith.js';
|
|
|
13
13
|
export type { MulRateOptions, AllocateOptions } from './arith.js';
|
|
14
14
|
export { asMoney, isMoneyString, moneyNumber } from './branded.js';
|
|
15
15
|
export type { MoneyString } from './branded.js';
|
|
16
|
+
export { exactMath } from './exact.js';
|
|
17
|
+
export type { ExactMath, ExactOperand } from './exact.js';
|
|
@@ -40,6 +40,26 @@ export declare function canonicalizeStoredMoney(record: unknown, moneyFields: Re
|
|
|
40
40
|
* `MoneyPrecisionError`/`TypeError`.
|
|
41
41
|
*/
|
|
42
42
|
export declare function canonicalizeIncomingMoney(record: unknown, moneyFields: Record<string, MoneyDescriptor> | undefined): unknown;
|
|
43
|
+
/**
|
|
44
|
+
* Canonicalize money values for a MATERIALIZED-VIEW row (#1018).
|
|
45
|
+
*
|
|
46
|
+
* A money field in an MV row is NOT in the scaled-integer storage form a
|
|
47
|
+
* collection uses — the money-aware reducers emit `formatScaledInt(...)`, an
|
|
48
|
+
* exact decimal string, and that is what lands in the output collection. So a
|
|
49
|
+
* derived money field has to be canonicalized into the same shape as the
|
|
50
|
+
* aggregated ones beside it.
|
|
51
|
+
*
|
|
52
|
+
* Quantizing it into storage form instead is what #1018 reported: `toPay` came
|
|
53
|
+
* back as `"1000000"` where `netTotal` in the SAME row read `"10000.00"` —
|
|
54
|
+
* 100× the true value, and a string that looks like a plausible amount rather
|
|
55
|
+
* than an obvious error.
|
|
56
|
+
*
|
|
57
|
+
* Precision handling is identical to {@link quantizeMoneyFields} — the same
|
|
58
|
+
* `parseToScaledInt` and the same `MoneyPrecisionError` — so a value that
|
|
59
|
+
* cannot be represented at the declared scale is still refused rather than
|
|
60
|
+
* silently rounded. Only the OUTPUT shape differs: decimal, not scaled.
|
|
61
|
+
*/
|
|
62
|
+
export declare function canonicalizeMoneyFieldsAsDecimal<T extends Record<string, unknown>>(record: T, moneyFields: Record<string, MoneyDescriptor>): T;
|
|
43
63
|
/**
|
|
44
64
|
* Convert money fields in `record` from user input to their canonical
|
|
45
65
|
* stored form. Returns a shallow clone (deep along declared nested
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dumpVaultSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X56RTUK3.js";
|
|
4
4
|
import "./chunk-KHKKD62N.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-Z45YRGFO.js";
|
|
6
6
|
import "./chunk-Y2NBBT6K.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-CDB2HVQW.js";
|
|
8
|
+
import "./chunk-3URQC7EH.js";
|
|
9
|
+
import "./chunk-7H73RIE3.js";
|
|
10
10
|
import "./chunk-HXGUIPQB.js";
|
|
11
11
|
import "./chunk-AR2JDFAE.js";
|
|
12
12
|
import "./chunk-747LRSOO.js";
|
|
13
13
|
import "./chunk-LP7BEXCT.js";
|
|
14
14
|
import "./chunk-VCETL77O.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-YPYHVOXP.js";
|
|
16
16
|
import "./chunk-HNGSV2YC.js";
|
|
17
17
|
import "./chunk-PZ5AY32C.js";
|
|
18
18
|
export {
|
|
19
19
|
dumpVaultSchema
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=walk-
|
|
21
|
+
//# sourceMappingURL=walk-3ZECBFDA.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @category capability
|
|
3
3
|
* Document attestation — issue side. Mint a signed, per-field commitment
|
|
4
4
|
* for a record and emit a QR credential verifiable offline via
|
|
5
|
-
* `@noy-db/attestation`. See
|
|
5
|
+
* `@noy-db/attestation`. See design-history/2026-05-29-attestation-core-and-issue-design.md.
|
|
6
6
|
*/
|
|
7
7
|
export { withAttestation } from './active.js';
|
|
8
8
|
export { NO_ATTESTATION, type AttestationStrategy } from './strategy.js';
|
|
@@ -29,6 +29,20 @@ import type { GuardStrategy, GuardContext, GuardChange } from './types.js';
|
|
|
29
29
|
export interface ImmutableGuardConfig<T extends Record<string, unknown>> {
|
|
30
30
|
/** The collection to make WORM. */
|
|
31
31
|
collection: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional stable per-vault identifier, forwarded verbatim to the
|
|
34
|
+
* underlying {@link GuardSpec.name} — `immutableGuard` is a wrapper
|
|
35
|
+
* around `withGuard` and grants the same identity affordance (#1006).
|
|
36
|
+
*
|
|
37
|
+
* Omit and `vault.listBehaviors()` falls back to a POSITIONAL
|
|
38
|
+
* `${collection}#${occurrence}` key, which renumbers when another
|
|
39
|
+
* guard on the same collection is registered ahead of this one. Pass
|
|
40
|
+
* a name whenever something joins to the behavior manifest by key —
|
|
41
|
+
* a generated rulebook, a diff between two vault versions, an audit
|
|
42
|
+
* report — so the identifier tracks the rule rather than its
|
|
43
|
+
* registration order.
|
|
44
|
+
*/
|
|
45
|
+
readonly name?: string;
|
|
32
46
|
/**
|
|
33
47
|
* A record becomes immutable once this predicate holds. Evaluated on
|
|
34
48
|
* the *existing* (already-persisted) record, so the write that first
|
|
@@ -10,6 +10,6 @@ import type { GuardSpec, GuardStrategy } from './types.js';
|
|
|
10
10
|
*
|
|
11
11
|
* Pass the returned handle to `createNoydb({ strategies: [...] })`.
|
|
12
12
|
*
|
|
13
|
-
* @see
|
|
13
|
+
* @see design-history/2026-05-18-guards-design.md
|
|
14
14
|
*/
|
|
15
15
|
export declare function withGuard<T extends Record<string, unknown>>(strategy: GuardSpec<T>): GuardStrategy<T>;
|
|
@@ -2,10 +2,37 @@
|
|
|
2
2
|
* Active periods strategy factory. Only reachable through the
|
|
3
3
|
* `@noy-db/hub/periods` subpath.
|
|
4
4
|
*/
|
|
5
|
+
import type { PeriodPartition } from './periods.js';
|
|
5
6
|
import type { PeriodsStrategy } from './strategy.js';
|
|
7
|
+
/** Options for {@link withPeriods}. */
|
|
8
|
+
export interface WithPeriodsOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Maps a collection to the timeline each of its records belongs to (#1005) —
|
|
11
|
+
* the answer to "which close calendar governs THIS record".
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* withPeriods({
|
|
15
|
+
* subjects: { receipts: (r) => [r.clientId, layerOf(r)] },
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Same shape as `withForget({ subjects })`, which answers the same question
|
|
20
|
+
* for erasure. A collection with no entry — and every collection when
|
|
21
|
+
* `subjects` is omitted entirely — stays on the vault-wide timeline, so an
|
|
22
|
+
* existing vault behaves exactly as it did before partitions existed.
|
|
23
|
+
*
|
|
24
|
+
* Return `undefined` from a mapper to put an individual record back on the
|
|
25
|
+
* vault-wide timeline (e.g. a record that predates the field the mapping
|
|
26
|
+
* reads).
|
|
27
|
+
*/
|
|
28
|
+
readonly subjects?: Readonly<Record<string, (record: Record<string, unknown>) => PeriodPartition | undefined>>;
|
|
29
|
+
}
|
|
6
30
|
/**
|
|
7
31
|
* Build the default periods strategy. Pass into
|
|
8
32
|
* `createNoydb({ periodsStrategy: withPeriods() })` to enable
|
|
9
33
|
* `vault.closePeriod()` / `vault.openPeriod()` / write-guards.
|
|
34
|
+
*
|
|
35
|
+
* Pass `subjects` to run more than one close calendar in a single vault — see
|
|
36
|
+
* {@link WithPeriodsOptions.subjects}.
|
|
10
37
|
*/
|
|
11
|
-
export declare function withPeriods(): PeriodsStrategy;
|
|
38
|
+
export declare function withPeriods(options?: WithPeriodsOptions): PeriodsStrategy;
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* Vault can call them without TypeScript barrel gymnastics.
|
|
14
14
|
*/
|
|
15
15
|
export { withPeriods } from './active.js';
|
|
16
|
+
export type { WithPeriodsOptions } from './active.js';
|
|
16
17
|
export type { PeriodsStrategy } from './strategy.js';
|
|
17
|
-
export {
|
|
18
|
-
export
|
|
18
|
+
export type { PeriodScope, PeriodScopeWithReason, ReopenPeriodOptions } from './vault-facade.js';
|
|
19
|
+
export { PERIODS_COLLECTION, PERIOD_FREEZES_COLLECTION, PERIOD_ARCHIVES_COLLECTION, PERIOD_TARGET_PURGES_COLLECTION, PERIOD_REOPENS_COLLECTION, periodExclusiveUpperBound, resolvePeriodKey, samePartition, resolveReopenState, isEffectivelyReopened, loadPeriods, chainAnchor, assertTsWritable, validatePeriodName, appendPeriodLedgerEntry, purgeMarkersOn, } from './periods.js';
|
|
20
|
+
export type { PeriodPartition, PartitionResolver, PeriodReopenEvent, PeriodReopenRecord, PeriodRecord, PeriodFreezeRecord, PeriodArchiveRecord, PeriodTargetPurgeRecord, TargetPurgeCount, ClosePeriodOptions, OpenPeriodOptions, CarryForwardContext, ReadOnlyCollection, } from './periods.js';
|
|
19
21
|
/** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
|
|
20
22
|
export { NO_PERIODS } from './strategy.js';
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
*/
|
|
147
147
|
import type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js';
|
|
148
148
|
import type { LedgerStore } from '../../with-commit/history/ledger/index.js';
|
|
149
|
-
export { PERIODS_COLLECTION, PERIOD_FREEZES_COLLECTION, PERIOD_ARCHIVES_COLLECTION, PERIOD_TARGET_PURGES_COLLECTION, periodExclusiveUpperBound, } from './window.js';
|
|
149
|
+
export { PERIODS_COLLECTION, PERIOD_FREEZES_COLLECTION, PERIOD_ARCHIVES_COLLECTION, PERIOD_TARGET_PURGES_COLLECTION, PERIOD_REOPENS_COLLECTION, periodExclusiveUpperBound, } from './window.js';
|
|
150
150
|
/**
|
|
151
151
|
* Companion record recording that a closed period was frozen (its delete
|
|
152
152
|
* markers physically purged). Stored in {@link PERIOD_FREEZES_COLLECTION},
|
|
@@ -177,6 +177,73 @@ export interface TargetPurgeCount {
|
|
|
177
177
|
readonly role: 'backup' | 'archive';
|
|
178
178
|
readonly purgedCount: number;
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* One entry in a period's append-only reopen/reclose log (#1022).
|
|
182
|
+
*
|
|
183
|
+
* Real accounting close is a three-state lifecycle — open / closed / reopened
|
|
184
|
+
* — not a one-way door. A month gets closed, a missing invoice arrives or a
|
|
185
|
+
* filing is rejected, the month is reopened, corrected, and reclosed. The audit
|
|
186
|
+
* value is not the ability to write again; it is the chain being able to say
|
|
187
|
+
* *closed at T1, reopened at T2 by U, reclosed at T3*.
|
|
188
|
+
*/
|
|
189
|
+
export interface PeriodReopenEvent {
|
|
190
|
+
readonly op: 'reopen' | 'reclose';
|
|
191
|
+
/** ISO timestamp the event was recorded. */
|
|
192
|
+
readonly at: string;
|
|
193
|
+
/** userId of the keyring that performed it. */
|
|
194
|
+
readonly by: string;
|
|
195
|
+
/**
|
|
196
|
+
* `reopen` only — ISO instant after which the period re-seals on its own,
|
|
197
|
+
* with nobody acting. Absent means the window stays open until an explicit
|
|
198
|
+
* `reclosePeriod`.
|
|
199
|
+
*/
|
|
200
|
+
readonly until?: string;
|
|
201
|
+
/** Free-text justification, carried verbatim into the audit trail. */
|
|
202
|
+
readonly reason?: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Companion holding a period's reopen/reclose history (#1022). Stored in
|
|
206
|
+
* {@link PERIOD_REOPENS_COLLECTION}, keyed by the period's storage key — kept
|
|
207
|
+
* OFF the hash-chained `_periods/<name>` record for the same reason freeze and
|
|
208
|
+
* archive are: reopening must never rewrite the close, or the chain that proves
|
|
209
|
+
* the close happened is the very thing the reopen destroys.
|
|
210
|
+
*
|
|
211
|
+
* `events` is APPEND-ONLY. Where the other companions are single-shot and
|
|
212
|
+
* idempotent, this one accumulates, because the cycle repeats.
|
|
213
|
+
*/
|
|
214
|
+
export interface PeriodReopenRecord {
|
|
215
|
+
readonly period: string;
|
|
216
|
+
readonly partition?: PeriodPartition;
|
|
217
|
+
readonly events: readonly PeriodReopenEvent[];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Collapse an append-only reopen log into the return-only fields merged onto a
|
|
221
|
+
* {@link PeriodRecord} on read.
|
|
222
|
+
*
|
|
223
|
+
* Expiry is deliberately NOT resolved here: `reopenedUntil` is carried through
|
|
224
|
+
* verbatim and compared against the clock at write-guard time, so a bounded
|
|
225
|
+
* window re-seals on its own without anything having to run.
|
|
226
|
+
*
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
export declare function resolveReopenState(events: readonly PeriodReopenEvent[]): {
|
|
230
|
+
reopenedAt?: string;
|
|
231
|
+
reopenedBy?: string;
|
|
232
|
+
reopenedUntil?: string;
|
|
233
|
+
reopenReason?: string;
|
|
234
|
+
reclosedAt?: string;
|
|
235
|
+
reopenCount: number;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Is this period writable right now on account of a reopen? (#1022)
|
|
239
|
+
*
|
|
240
|
+
* Three ways to be sealed again: never reopened, explicitly reclosed after the
|
|
241
|
+
* last reopen, or a bounded window that has elapsed. The clock is read by the
|
|
242
|
+
* caller and passed in, so the guard and any diagnostic agree on one instant.
|
|
243
|
+
*
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
export declare function isEffectivelyReopened(period: PeriodRecord, nowIso: string): boolean;
|
|
180
247
|
/**
|
|
181
248
|
* Companion record noting that a closed+frozen period's delete markers were
|
|
182
249
|
* swept off the vault's push-only sync targets (#615). Stored in
|
|
@@ -189,6 +256,46 @@ export interface PeriodTargetPurgeRecord {
|
|
|
189
256
|
readonly purgedBy: string;
|
|
190
257
|
readonly targets: readonly TargetPurgeCount[];
|
|
191
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Scope tuple for a period timeline (#1005).
|
|
261
|
+
*
|
|
262
|
+
* Identical in shape and semantics to `SequenceOptions.partition`: a
|
|
263
|
+
* partitioned timeline is always disjoint from any unpartitioned one, and from
|
|
264
|
+
* every other tuple. `['acme', 'vat']` and `['acme', 'wht']` are two
|
|
265
|
+
* independent close calendars for the same subject — which is the whole point,
|
|
266
|
+
* since sub-ledgers for one legal entity and one month routinely close on
|
|
267
|
+
* different statutory deadlines.
|
|
268
|
+
*/
|
|
269
|
+
export type PeriodPartition = readonly (string | number)[];
|
|
270
|
+
/**
|
|
271
|
+
* Resolve the `_periods` storage key for a (name, partition) pair.
|
|
272
|
+
*
|
|
273
|
+
* Deliberately the same encoding as `resolveSequenceKey`: `name` verbatim when
|
|
274
|
+
* unpartitioned, else `${name}\x00${parts}` with each component
|
|
275
|
+
* `encodeURIComponent`d and `'/'`-joined. The null-byte separator cannot occur
|
|
276
|
+
* in a period name, so a partitioned key never collides with an unpartitioned
|
|
277
|
+
* one; URI-encoding keeps `['a/b']` distinct from `['a','b']`.
|
|
278
|
+
*
|
|
279
|
+
* @throws {ValidationError} on an empty component or a non-finite number.
|
|
280
|
+
* @internal
|
|
281
|
+
*/
|
|
282
|
+
export declare function resolvePeriodKey(name: string, partition?: PeriodPartition): string;
|
|
283
|
+
/**
|
|
284
|
+
* Do two partitions denote the same timeline? Absent and empty both mean "the
|
|
285
|
+
* unpartitioned timeline", so they compare equal.
|
|
286
|
+
*
|
|
287
|
+
* @internal
|
|
288
|
+
*/
|
|
289
|
+
export declare function samePartition(a?: PeriodPartition, b?: PeriodPartition): boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Resolves a record to the timeline that governs it. Supplied by
|
|
292
|
+
* `withPeriods({ subjects })`; returns `undefined` for any collection with no
|
|
293
|
+
* mapping, which is what keeps an unconfigured vault on the single vault-wide
|
|
294
|
+
* timeline it has always had.
|
|
295
|
+
*
|
|
296
|
+
* @internal
|
|
297
|
+
*/
|
|
298
|
+
export type PartitionResolver = (collection: string, record: Record<string, unknown>) => PeriodPartition | undefined;
|
|
192
299
|
/**
|
|
193
300
|
* Stored record for one closed or opened accounting period. One entry
|
|
194
301
|
* per period, keyed by `name` in the reserved `_periods` collection.
|
|
@@ -199,8 +306,19 @@ export interface PeriodTargetPurgeRecord {
|
|
|
199
306
|
* into the next one, the same way the ledger's `prevHash` works.
|
|
200
307
|
*/
|
|
201
308
|
export interface PeriodRecord {
|
|
202
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* Human-readable name (e.g., `'FY2026-Q1'`). Unique per PARTITION — two
|
|
311
|
+
* timelines may each carry a `'2026-06'`, which is the normal case when one
|
|
312
|
+
* vault serves several subjects (#1005). Unique per vault when unpartitioned.
|
|
313
|
+
*/
|
|
203
314
|
readonly name: string;
|
|
315
|
+
/**
|
|
316
|
+
* The timeline this period belongs to. Absent = the vault-wide timeline.
|
|
317
|
+
* Two periods with the same `name` and different `partition` are unrelated:
|
|
318
|
+
* separate hash chains, separate close state, and the write guard applies
|
|
319
|
+
* each only to records that resolve to its own tuple.
|
|
320
|
+
*/
|
|
321
|
+
readonly partition?: PeriodPartition;
|
|
204
322
|
/**
|
|
205
323
|
* Role discriminator. A period is `'closed'` from the moment its
|
|
206
324
|
* `closedAt` is recorded; `'opened'` marks a period whose opening
|
|
@@ -261,6 +379,19 @@ export interface PeriodRecord {
|
|
|
261
379
|
readonly targetsPurgedAt?: string;
|
|
262
380
|
readonly targetsPurgedBy?: string;
|
|
263
381
|
readonly targetsPurged?: readonly TargetPurgeCount[];
|
|
382
|
+
/** #1022 return-only — collapsed from the `_period_reopens/<key>` append-only
|
|
383
|
+
* log on read; NEVER written into the stored `_periods/<name>` record, so a
|
|
384
|
+
* reopen cannot disturb the inter-period hash chain. Absent = never reopened.
|
|
385
|
+
* `reclosedAt` present (and >= `reopenedAt`) means the window was closed
|
|
386
|
+
* again explicitly; `reopenedUntil` in the past means it lapsed on its own.
|
|
387
|
+
* Use {@link isEffectivelyReopened} rather than reading these directly. */
|
|
388
|
+
readonly reopenedAt?: string;
|
|
389
|
+
readonly reopenedBy?: string;
|
|
390
|
+
readonly reopenedUntil?: string;
|
|
391
|
+
readonly reopenReason?: string;
|
|
392
|
+
readonly reclosedAt?: string;
|
|
393
|
+
/** How many times this period has been reopened, ever. */
|
|
394
|
+
readonly reopenCount?: number;
|
|
264
395
|
}
|
|
265
396
|
/** Options for `vault.closePeriod()`. */
|
|
266
397
|
export interface ClosePeriodOptions {
|
|
@@ -283,11 +414,32 @@ export interface ClosePeriodOptions {
|
|
|
283
414
|
* an explicit `dateField`.
|
|
284
415
|
*/
|
|
285
416
|
readonly dateField?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Close only this timeline (#1005). Omit for the vault-wide timeline.
|
|
419
|
+
*
|
|
420
|
+
* ```ts
|
|
421
|
+
* vault.closePeriod({
|
|
422
|
+
* name: '2026-06', endDate: '2026-06-30', dateField: 'issuedAt',
|
|
423
|
+
* partition: [clientId, 'vat'],
|
|
424
|
+
* })
|
|
425
|
+
* ```
|
|
426
|
+
*
|
|
427
|
+
* Which records the resulting seal applies to is decided by the
|
|
428
|
+
* `subjects` map passed to `withPeriods()` — without one, no record ever
|
|
429
|
+
* resolves to a partition and a partitioned close seals nothing.
|
|
430
|
+
*/
|
|
431
|
+
readonly partition?: PeriodPartition;
|
|
286
432
|
}
|
|
287
433
|
/** Options for `vault.openPeriod()`. */
|
|
288
434
|
export interface OpenPeriodOptions<TCollections = Record<string, Record<string, unknown>>> {
|
|
289
435
|
/** Human-readable name for the new period. Must be unique. */
|
|
290
436
|
readonly name: string;
|
|
437
|
+
/**
|
|
438
|
+
* The timeline to open in. Must match the partition of `fromPeriod` — a
|
|
439
|
+
* period cannot chain across timelines, since each carries its own hash
|
|
440
|
+
* chain (#1005).
|
|
441
|
+
*/
|
|
442
|
+
readonly partition?: PeriodPartition;
|
|
291
443
|
/** ISO lower bound of the new period (usually prior `endDate + 1 day`). */
|
|
292
444
|
readonly startDate: string;
|
|
293
445
|
/**
|
|
@@ -357,7 +509,7 @@ export declare function loadPeriods(adapter: NoydbStore, vault: string, decrypt:
|
|
|
357
509
|
*
|
|
358
510
|
* @internal
|
|
359
511
|
*/
|
|
360
|
-
export declare function chainAnchor(records: readonly PeriodRecord[]): Promise<{
|
|
512
|
+
export declare function chainAnchor(records: readonly PeriodRecord[], partition?: PeriodPartition): Promise<{
|
|
361
513
|
priorPeriodName?: string;
|
|
362
514
|
priorPeriodHash: string;
|
|
363
515
|
}>;
|
|
@@ -382,7 +534,10 @@ export declare function chainAnchor(records: readonly PeriodRecord[]): Promise<{
|
|
|
382
534
|
export declare function assertTsWritable(existing: {
|
|
383
535
|
ts: string | null;
|
|
384
536
|
record: Record<string, unknown> | null;
|
|
385
|
-
} | null, incomingRecord: Record<string, unknown> | null, closedPeriods: readonly PeriodRecord[]
|
|
537
|
+
} | null, incomingRecord: Record<string, unknown> | null, closedPeriods: readonly PeriodRecord[], scope?: {
|
|
538
|
+
collection: string;
|
|
539
|
+
resolve?: PartitionResolver;
|
|
540
|
+
}): void;
|
|
386
541
|
/**
|
|
387
542
|
* Sanity-check a proposed period name + endDate against existing
|
|
388
543
|
* records. Shared by closePeriod / openPeriod so the two pathways
|
|
@@ -390,7 +545,7 @@ export declare function assertTsWritable(existing: {
|
|
|
390
545
|
*
|
|
391
546
|
* @internal
|
|
392
547
|
*/
|
|
393
|
-
export declare function validatePeriodName(name: string, existing: readonly PeriodRecord[]): void;
|
|
548
|
+
export declare function validatePeriodName(name: string, existing: readonly PeriodRecord[], partition?: PeriodPartition): void;
|
|
394
549
|
/**
|
|
395
550
|
* Wire a reserved-collection ledger append for a period record. The
|
|
396
551
|
* period itself is stored via the adapter as an encrypted envelope;
|
|
@@ -12,21 +12,30 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { EncryptedEnvelope, NoydbStore } from '../../kernel/types.js';
|
|
14
14
|
import type { LedgerStore } from '../../with-commit/history/ledger/store.js';
|
|
15
|
-
import type { PeriodRecord } from './periods.js';
|
|
15
|
+
import type { PeriodRecord, PeriodPartition, PartitionResolver } from './periods.js';
|
|
16
16
|
/**
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
19
|
export interface PeriodsStrategy {
|
|
20
20
|
loadPeriods(adapter: NoydbStore, vault: string, decrypt: (envelope: EncryptedEnvelope) => Promise<PeriodRecord>): Promise<PeriodRecord[]>;
|
|
21
|
-
chainAnchor(records: readonly PeriodRecord[]): Promise<{
|
|
21
|
+
chainAnchor(records: readonly PeriodRecord[], partition?: PeriodPartition): Promise<{
|
|
22
22
|
priorPeriodName?: string;
|
|
23
23
|
priorPeriodHash: string;
|
|
24
24
|
}>;
|
|
25
25
|
assertTsWritable(existing: {
|
|
26
26
|
ts: string | null;
|
|
27
27
|
record: Record<string, unknown> | null;
|
|
28
|
-
} | null, incoming: Record<string, unknown> | null, periods: readonly PeriodRecord[]
|
|
29
|
-
|
|
28
|
+
} | null, incoming: Record<string, unknown> | null, periods: readonly PeriodRecord[], scope?: {
|
|
29
|
+
collection: string;
|
|
30
|
+
resolve?: PartitionResolver;
|
|
31
|
+
}): void;
|
|
32
|
+
validatePeriodName(name: string, existing: readonly PeriodRecord[], partition?: PeriodPartition): void;
|
|
33
|
+
/**
|
|
34
|
+
* Record → timeline resolver built from `withPeriods({ subjects })` (#1005).
|
|
35
|
+
* `undefined` when the caller configured no subjects, which keeps every
|
|
36
|
+
* record on the vault-wide timeline.
|
|
37
|
+
*/
|
|
38
|
+
readonly partitionOf?: PartitionResolver;
|
|
30
39
|
appendPeriodLedgerEntry(ledger: LedgerStore | null, actor: string, envelope: EncryptedEnvelope, periodName: string, collection?: string): Promise<void>;
|
|
31
40
|
}
|
|
32
41
|
export declare const NO_PERIODS: PeriodsStrategy;
|