@noy-db/hub 0.6.0-pre.2 → 0.6.0-pre.20
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/codemods/0.6.0-pre.json +211 -0
- package/dist/api-Z5VHH24A.js +20 -0
- package/dist/attestation/index.js +19 -19
- package/dist/{backup-YYBE5RPC.js → backup-K62BFMYK.js} +36 -18
- package/dist/backup-K62BFMYK.js.map +1 -0
- package/dist/blobs/index.js +13 -13
- package/dist/broker/index.js +12 -12
- package/dist/cargo/index.js +33 -33
- package/dist/{chunk-FDX7OWWI.js → chunk-2E2MKBMI.js} +2 -2
- package/dist/{chunk-VOQW5LAM.js → chunk-2IK6AC6A.js} +102 -71
- package/dist/chunk-2IK6AC6A.js.map +1 -0
- package/dist/{chunk-EDXAQ6JI.js → chunk-32O2N2CH.js} +87 -34
- package/dist/chunk-32O2N2CH.js.map +1 -0
- package/dist/{chunk-W5W6KHN2.js → chunk-3Y4OFWQJ.js} +1 -1
- package/dist/chunk-3Y4OFWQJ.js.map +1 -0
- package/dist/{chunk-7G6VDWXB.js → chunk-437FDIHO.js} +3 -3
- package/dist/chunk-437FDIHO.js.map +1 -0
- package/dist/{chunk-3FSX6LDG.js → chunk-47ZFULEZ.js} +8 -3
- package/dist/{chunk-3FSX6LDG.js.map → chunk-47ZFULEZ.js.map} +1 -1
- package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
- package/dist/chunk-4AOERLTV.js.map +1 -0
- package/dist/{chunk-MWKDOHEF.js → chunk-4HVTRHSA.js} +17 -10
- package/dist/chunk-4HVTRHSA.js.map +1 -0
- package/dist/{chunk-V5KYPBUR.js → chunk-5BS6IQZZ.js} +11 -14
- package/dist/chunk-5BS6IQZZ.js.map +1 -0
- package/dist/{chunk-LWSJG3LI.js → chunk-5EJQNA26.js} +7 -3
- package/dist/chunk-5EJQNA26.js.map +1 -0
- package/dist/{chunk-7F4DBNSP.js → chunk-5J5TTSGW.js} +3 -3
- package/dist/{chunk-BTVYJWSN.js → chunk-5JT4Y5UE.js} +10 -10
- package/dist/{chunk-C2OOEM57.js → chunk-6S466CMQ.js} +92 -35
- package/dist/chunk-6S466CMQ.js.map +1 -0
- package/dist/{chunk-PY7CI6L5.js → chunk-6TXUVKPG.js} +516 -263
- package/dist/chunk-6TXUVKPG.js.map +1 -0
- package/dist/{chunk-7NXHMW6Y.js → chunk-7RCZ436O.js} +2 -2
- package/dist/{chunk-DG27IUVI.js → chunk-A3NTKHDB.js} +2 -2
- package/dist/{chunk-CCZJJ4I2.js → chunk-A4K5GLE6.js} +4 -4
- package/dist/{chunk-CEJWMBXO.js → chunk-APV42WPR.js} +2 -2
- package/dist/{chunk-4HDYQL3J.js → chunk-AQF7JSQR.js} +2 -2
- package/dist/{chunk-KUDZVJKQ.js → chunk-BP4I7IBK.js} +2 -2
- package/dist/{chunk-4UVDI4XE.js → chunk-BTNKPDZM.js} +4 -4
- package/dist/{chunk-HVQGCKY4.js → chunk-C7WJNVJG.js} +2 -2
- package/dist/{chunk-WYZ5MYUA.js → chunk-CV7WXCZD.js} +44 -42
- package/dist/chunk-CV7WXCZD.js.map +1 -0
- package/dist/{chunk-KCQX65FU.js → chunk-CVYXIN5B.js} +3 -3
- package/dist/{chunk-VN45YLWM.js → chunk-D5UDZANO.js} +255 -132
- package/dist/chunk-D5UDZANO.js.map +1 -0
- package/dist/{chunk-AR2JDFAE.js → chunk-DJ23QZIN.js} +2 -2
- package/dist/{chunk-PJNTR2NV.js → chunk-DKYEVHZH.js} +7 -10
- package/dist/chunk-DKYEVHZH.js.map +1 -0
- package/dist/{chunk-SZ2K3MHL.js → chunk-DYASJSKI.js} +8 -11
- package/dist/{chunk-SZ2K3MHL.js.map → chunk-DYASJSKI.js.map} +1 -1
- package/dist/{chunk-G5APARUV.js → chunk-E6VDPBE3.js} +13 -15
- package/dist/chunk-E6VDPBE3.js.map +1 -0
- package/dist/{chunk-A67356IR.js → chunk-EG6AQBYW.js} +33 -8
- package/dist/chunk-EG6AQBYW.js.map +1 -0
- package/dist/{chunk-PVU7LW5L.js → chunk-EJIVFOOQ.js} +6 -6
- package/dist/{chunk-VRA4Q7DA.js → chunk-F5AJZC3U.js} +35 -47
- package/dist/chunk-F5AJZC3U.js.map +1 -0
- package/dist/{chunk-VMCCGUQB.js → chunk-GDGTIWB4.js} +2 -2
- package/dist/{chunk-FUHKW252.js → chunk-GILI76SU.js} +2 -2
- package/dist/{chunk-35EBKWQU.js → chunk-GT72D4FO.js} +4 -4
- package/dist/{chunk-PRDRGL73.js → chunk-GYUCRDAU.js} +17 -14
- package/dist/chunk-GYUCRDAU.js.map +1 -0
- package/dist/{chunk-JRCYZEHU.js → chunk-HGJC7I5F.js} +2 -2
- package/dist/{chunk-TOAIYQJR.js → chunk-HJRTFXAA.js} +7 -10
- package/dist/chunk-HJRTFXAA.js.map +1 -0
- package/dist/chunk-HK67PX4J.js +27 -0
- package/dist/chunk-HK67PX4J.js.map +1 -0
- package/dist/{chunk-JXIDGFKS.js → chunk-HTHRCGWP.js} +4 -2
- package/dist/chunk-HTHRCGWP.js.map +1 -0
- package/dist/{chunk-AHLJSVRL.js → chunk-HTMQBBF3.js} +5 -7
- package/dist/chunk-HTMQBBF3.js.map +1 -0
- package/dist/{chunk-ZNACADFG.js → chunk-ICCRAPWD.js} +4 -4
- package/dist/chunk-ICCRAPWD.js.map +1 -0
- package/dist/{chunk-66W5OOCX.js → chunk-IOURTXTM.js} +52 -65
- package/dist/chunk-IOURTXTM.js.map +1 -0
- package/dist/{chunk-MZ5ZFO2D.js → chunk-IPDS2TYW.js} +84 -112
- package/dist/chunk-IPDS2TYW.js.map +1 -0
- package/dist/{chunk-UIBGXRDD.js → chunk-JHO6FGZX.js} +25 -31
- package/dist/chunk-JHO6FGZX.js.map +1 -0
- package/dist/{chunk-YAWK6AWF.js → chunk-JIF3IBRK.js} +2 -2
- package/dist/{chunk-HNHCQ556.js → chunk-KBOPY6W2.js} +2 -2
- package/dist/{chunk-UHXCLPGC.js → chunk-KDX6VEYV.js} +2 -2
- package/dist/chunk-KDX6VEYV.js.map +1 -0
- package/dist/{chunk-W3TVWF6N.js → chunk-KM6YR5XF.js} +2 -2
- package/dist/{chunk-3737A6EA.js → chunk-KUXTWVAR.js} +75 -18
- package/dist/chunk-KUXTWVAR.js.map +1 -0
- package/dist/chunk-L2XQ776M.js +123 -0
- package/dist/chunk-L2XQ776M.js.map +1 -0
- package/dist/{chunk-E6427JU2.js → chunk-L6FSZFG7.js} +18 -2
- package/dist/chunk-L6FSZFG7.js.map +1 -0
- package/dist/{chunk-5PR33AC4.js → chunk-M4IKEOJS.js} +20 -17
- package/dist/chunk-M4IKEOJS.js.map +1 -0
- package/dist/{chunk-6HFM7EIT.js → chunk-MNMYHZVU.js} +2 -2
- package/dist/{chunk-NIVEDYJZ.js → chunk-MNUTPZRQ.js} +31 -49
- package/dist/chunk-MNUTPZRQ.js.map +1 -0
- package/dist/{chunk-VV4NSB7P.js → chunk-MQXYR65M.js} +15 -24
- package/dist/chunk-MQXYR65M.js.map +1 -0
- package/dist/{chunk-QD724WDJ.js → chunk-N2HKBESK.js} +4 -4
- package/dist/{chunk-Z45YRGFO.js → chunk-N7YAQKAO.js} +2 -2
- package/dist/{chunk-DMQCLZ4Z.js → chunk-NH2MST6J.js} +2 -2
- package/dist/{chunk-TAGFGKHP.js → chunk-NRNTXBHT.js} +7 -10
- package/dist/chunk-NRNTXBHT.js.map +1 -0
- package/dist/{chunk-I6SDX7WX.js → chunk-NYSD43OE.js} +16 -22
- package/dist/chunk-NYSD43OE.js.map +1 -0
- package/dist/{chunk-I4F6PKUK.js → chunk-ODVIFBAQ.js} +16 -17
- package/dist/chunk-ODVIFBAQ.js.map +1 -0
- package/dist/{chunk-26JMGSSC.js → chunk-OIIAXFKM.js} +4 -4
- package/dist/chunk-OIIAXFKM.js.map +1 -0
- package/dist/{chunk-HXGUIPQB.js → chunk-OQLYMBJI.js} +3 -3
- package/dist/{chunk-RKKORO4M.js → chunk-OWGEHDT2.js} +10 -10
- package/dist/chunk-OWGEHDT2.js.map +1 -0
- package/dist/{chunk-HNGSV2YC.js → chunk-P7L3OQLL.js} +25 -10
- package/dist/chunk-P7L3OQLL.js.map +1 -0
- package/dist/{chunk-MSWYQLMQ.js → chunk-PG6PFMDC.js} +2 -2
- package/dist/{chunk-E7OBCBXS.js → chunk-PNAIDIP7.js} +13 -16
- package/dist/chunk-PNAIDIP7.js.map +1 -0
- package/dist/{chunk-GLKDWWNO.js → chunk-PZSS7MUM.js} +16 -14
- package/dist/chunk-PZSS7MUM.js.map +1 -0
- package/dist/{chunk-WKPJXWKR.js → chunk-QPIUFRUC.js} +3 -3
- package/dist/{chunk-JIUVJ4M7.js → chunk-REL4OLWW.js} +2 -2
- package/dist/{chunk-ERB6NDDW.js → chunk-RKDH6L53.js} +134 -33
- package/dist/chunk-RKDH6L53.js.map +1 -0
- package/dist/{chunk-VW6ZZGCG.js → chunk-RNSC2ARR.js} +3 -3
- package/dist/{chunk-WLYIROCJ.js → chunk-RORE2GX2.js} +2 -2
- package/dist/{chunk-TDJPS3T2.js → chunk-RQY5UWEL.js} +24 -19
- package/dist/chunk-RQY5UWEL.js.map +1 -0
- package/dist/{chunk-7TSYBD3E.js → chunk-RSFG7XHM.js} +2 -2
- package/dist/{chunk-FAXZQ5UF.js → chunk-S55DBWRC.js} +2 -2
- package/dist/{chunk-WHJKIZS7.js → chunk-SA77BQ7F.js} +27 -149
- package/dist/chunk-SA77BQ7F.js.map +1 -0
- package/dist/{chunk-747LRSOO.js → chunk-SFD2LL7G.js} +2 -2
- package/dist/{chunk-P7OG2ETF.js → chunk-SG3OQCRG.js} +3 -3
- package/dist/{chunk-55LKVALY.js → chunk-T7IR4N2S.js} +1 -3
- package/dist/chunk-T7IR4N2S.js.map +1 -0
- package/dist/{chunk-EP7VPR7Y.js → chunk-TC6MBEGH.js} +11 -8
- package/dist/chunk-TC6MBEGH.js.map +1 -0
- package/dist/{chunk-HFQ6LGIO.js → chunk-TENLCGYD.js} +12 -10
- package/dist/{chunk-HFQ6LGIO.js.map → chunk-TENLCGYD.js.map} +1 -1
- package/dist/{chunk-WQDTCJ6W.js → chunk-VEX2BQVX.js} +3 -3
- package/dist/{chunk-7VHY5E3X.js → chunk-VH2W6BOG.js} +7 -7
- package/dist/chunk-VHVMJWM6.js +201 -0
- package/dist/chunk-VHVMJWM6.js.map +1 -0
- package/dist/{chunk-VCETL77O.js → chunk-VJ4B3ZXY.js} +27 -7
- package/dist/chunk-VJ4B3ZXY.js.map +1 -0
- package/dist/{chunk-OF3L2SD6.js → chunk-W6NFONOV.js} +2 -2
- package/dist/{chunk-NJDQ4YSV.js → chunk-WBNXZU42.js} +4 -4
- package/dist/{chunk-FNSMZQS4.js → chunk-WKD5ESK4.js} +2 -2
- package/dist/{chunk-NKH7GSIH.js → chunk-XGQGWZ6D.js} +4 -4
- package/dist/chunk-YOT7D63X.js +190 -0
- package/dist/chunk-YOT7D63X.js.map +1 -0
- package/dist/{chunk-4MC5JRRX.js → chunk-YVTADFTC.js} +14 -15
- package/dist/chunk-YVTADFTC.js.map +1 -0
- package/dist/{chunk-GASWQ3XG.js → chunk-ZBDWKPBW.js} +15 -16
- package/dist/chunk-ZBDWKPBW.js.map +1 -0
- package/dist/{chunk-52QYGZHH.js → chunk-ZPMXYPBR.js} +2 -2
- package/dist/chunk-ZPMXYPBR.js.map +1 -0
- package/dist/chunk-ZVAFJQZB.js +66 -0
- package/dist/chunk-ZVAFJQZB.js.map +1 -0
- package/dist/{chunk-VJFMXYKP.js → chunk-ZWKF3CD3.js} +2 -2
- package/dist/{chunk-I4ZAO7F7.js → chunk-ZXW3X3DQ.js} +7 -11
- package/dist/chunk-ZXW3X3DQ.js.map +1 -0
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-FTOX7Q5L.js → classified-marker-PMDG3O36.js} +3 -3
- package/dist/collection-facade-ZJK5EB33.js +45 -0
- package/dist/{computed-6G5M3UPH.js → computed-UHCBRILW.js} +3 -3
- package/dist/consent/index.js +10 -10
- package/dist/cover/index.js +10 -3
- package/dist/custody/index.js +11 -11
- package/dist/{dead-filter-ENRIOQIE.js → dead-filter-777VWDER.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-SSEPLXXO.js → delegation-4R5DU23X.js} +24 -23
- package/dist/delegation-4R5DU23X.js.map +1 -0
- package/dist/derivations/index.js +12 -12
- package/dist/derive-3WAS2G5T.js +22 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-BDVGYC6X.js → dispatch-3EN6YCCS.js} +18 -18
- package/dist/{dispatch-RE74SH6L.js → dispatch-ASL257KG.js} +5 -5
- package/dist/{enclave-52VUXNRL.js → enclave-ZJS5R5RH.js} +25 -9
- package/dist/executor-GPM6DNWV.js +9 -0
- package/dist/executor-LJSMZ4IB.js +9 -0
- package/dist/executor-SHUVRZUJ.js +29 -0
- package/dist/export-accessible-GNY6DC6U.js +23 -0
- package/dist/extract-partition-BG3AF4NZ.js +38 -0
- package/dist/{fanout-sidecar-DTBIDOWF.js → fanout-sidecar-TFPWDOME.js} +18 -27
- package/dist/fanout-sidecar-TFPWDOME.js.map +1 -0
- package/dist/find-KX6OKHDP.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +23 -20
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +32 -15
- package/dist/index.js +183 -191
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +2 -2
- package/dist/introspection/index.js +11 -11
- package/dist/issue-PAUM7NCX.js +19 -0
- package/dist/kernel/enclave/crypto.d.ts +24 -4
- package/dist/kernel/enclave/index.d.ts +8 -2
- package/dist/kernel/enclave/record-aad.d.ts +131 -0
- package/dist/kernel/enclave/record-envelope.d.ts +76 -0
- package/dist/kernel/enclave/record-keys/envelope-body.d.ts +34 -2
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +22 -5
- package/dist/kernel/enclave/record-keys/record-codec.d.ts +47 -14
- package/dist/kernel/enclave/record-keys/rekey.d.ts +68 -0
- package/dist/kernel/enclave/record-keys/tombstone.d.ts +3 -2
- package/dist/kernel/errors.d.ts +23 -11
- package/dist/kernel/merge-authority.d.ts +25 -0
- package/dist/kernel/noydb.d.ts +9 -3
- package/dist/kernel/query/builder.d.ts +15 -2
- package/dist/kernel/query/join.d.ts +27 -0
- package/dist/kernel/sync-policy.d.ts +0 -2
- package/dist/kernel/tier-visibility.d.ts +15 -0
- package/dist/kernel/types.d.ts +125 -6
- package/dist/kernel/vault.d.ts +21 -17
- package/dist/kernel/via/index.d.ts +11 -2
- package/dist/{ledger-4WJL66BW.js → ledger-62CEPRPX.js} +11 -11
- package/dist/liberate-I6AOLWXW.js +24 -0
- package/dist/{link-set-N4ZPV6E6.js → link-set-ZRYNUHN3.js} +11 -11
- package/dist/{managed-secret-OTHS64IF.js → managed-secret-T2WB4O47.js} +11 -3
- package/dist/materialized-views/index.js +22 -21
- package/dist/money/index.js +12 -8
- package/dist/noydb-SS6EN7TK.js +84 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +22 -12
- package/dist/pod/index.js +75 -86
- package/dist/pod-handle-UPLXOGIK.js +41 -0
- package/dist/pod-handle-UPLXOGIK.js.map +1 -0
- package/dist/policy/index.js +11 -4
- package/dist/port/to/index.d.ts +4 -4
- package/dist/port/to/locator.d.ts +54 -8
- package/dist/port/with/i18n-strategy.d.ts +4 -1
- package/dist/port/with/lookup-strategy.d.ts +4 -1
- package/dist/port/with/merge-authority.d.ts +52 -0
- package/dist/port/with/service-bus.d.ts +0 -4
- package/dist/port/with/strategies.d.ts +2 -0
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-ZAG2CAIY.js → post-register-J4DEVNXK.js} +6 -6
- package/dist/query/index.js +3 -3
- package/dist/reduce/index.js +4 -4
- package/dist/register-UPD4GKBC.js +32 -0
- package/dist/registry-7KX2HWFS.js +18 -0
- package/dist/registry-PKYYEHEW.js +9 -0
- package/dist/registry-XHCYMD34.js +19 -0
- package/dist/registry-XIRTZHPC.js +9 -0
- package/dist/request-withdrawal-XZSESWZV.js +31 -0
- package/dist/{reveal-CMOJY4VO.js → reveal-525XWQU2.js} +6 -6
- package/dist/revoke-QI7YHQ2B.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +20 -13
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{seed-UK4QRIUN.js → seed-SGIF3EN4.js} +19 -22
- package/dist/seed-SGIF3EN4.js.map +1 -0
- package/dist/sequence/index.js +9 -9
- package/dist/session/index.js +10 -10
- package/dist/shadow/index.js +2 -2
- package/dist/share-link/index.js +1 -1
- package/dist/signer-BZWDPGGN.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-ZWXSOWJI.js → stale-PQYPVCER.js} +10 -10
- package/dist/storage-MJHKNQRO.js +23 -0
- package/dist/{store-coordination-provider-PB6QZ57W.js → store-coordination-provider-TFHZLKHG.js} +18 -12
- package/dist/store-coordination-provider-TFHZLKHG.js.map +1 -0
- package/dist/sync/index.js +11 -11
- package/dist/team/index.js +15 -14
- package/dist/tiers/index.js +11 -10
- package/dist/to/index.js +17 -9
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +4 -4
- package/dist/{ulid-PTAIMDG4.js → ulid-VQW6ERQN.js} +2 -2
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +115 -0
- package/dist/vault-head/index.js.map +1 -0
- package/dist/{verify-RO5RTZOJ.js → verify-J6DEOXP3.js} +5 -5
- package/dist/via/lookup/handle.d.ts +4 -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-BX4NSB5L.js +21 -0
- package/dist/with-audit/guards/immutable-guard.d.ts +14 -0
- 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 +161 -6
- package/dist/with-audit/periods/strategy.d.ts +14 -5
- package/dist/with-audit/periods/vault-facade.d.ts +89 -10
- package/dist/with-audit/periods/window.d.ts +10 -0
- package/dist/with-audit/sealed-record/index.d.ts +13 -0
- package/dist/with-audit/tiers/index.d.ts +17 -2
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/index.d.ts +2 -2
- package/dist/with-commit/history/history.d.ts +26 -0
- package/dist/with-commit/history/index.d.ts +2 -1
- package/dist/with-commit/history/ledger/store.d.ts +7 -1
- package/dist/with-commit/history/strategy.d.ts +11 -1
- package/dist/with-commit/numbering/index.d.ts +0 -5
- package/dist/with-commit/vault-head/active.d.ts +2 -0
- package/dist/with-commit/vault-head/head.d.ts +28 -0
- package/dist/with-commit/vault-head/index.d.ts +10 -0
- package/dist/with-commit/vault-head/strategy.d.ts +127 -0
- package/dist/with-commit/vault-head/verify.d.ts +90 -0
- package/dist/with-formula/materialized-views/types.d.ts +52 -0
- package/dist/with-party/directory/cover/storage.d.ts +0 -8
- package/dist/with-party/directory/storage.d.ts +0 -11
- package/dist/with-party/directory/visibility.d.ts +0 -21
- package/dist/with-party/policy/storage.d.ts +0 -10
- package/dist/with-party/team/index.d.ts +1 -1
- package/dist/with-party/team/keyring.d.ts +17 -3
- package/dist/with-party/team/tiers.d.ts +2 -1
- package/dist/with-pod/format.d.ts +10 -12
- package/dist/with-pod/index.d.ts +10 -10
- package/dist/with-pod/open.d.ts +2 -2
- package/dist/with-pod/pod-handle.d.ts +19 -0
- package/dist/with-pod/pod-store.d.ts +0 -8
- package/dist/with-pod/{bundle.d.ts → pod.d.ts} +26 -19
- package/dist/with-pod/ulid.d.ts +1 -1
- package/dist/with-shape/introspection/index.d.ts +1 -0
- package/dist/with-sync/engine.d.ts +54 -5
- package/dist/with-sync/strategy.d.ts +3 -0
- package/dist/withdraw-accessible-K4CPMH4C.js +28 -0
- package/package.json +12 -5
- package/dist/api-WVY3H3YH.js +0 -20
- package/dist/backup-YYBE5RPC.js.map +0 -1
- package/dist/bundle-handle-JEUWU2SJ.js +0 -36
- package/dist/bundle-handle-JEUWU2SJ.js.map +0 -1
- package/dist/chunk-26JMGSSC.js.map +0 -1
- package/dist/chunk-3737A6EA.js.map +0 -1
- package/dist/chunk-4MC5JRRX.js.map +0 -1
- package/dist/chunk-52QYGZHH.js.map +0 -1
- package/dist/chunk-55LKVALY.js.map +0 -1
- package/dist/chunk-5PR33AC4.js.map +0 -1
- package/dist/chunk-66W5OOCX.js.map +0 -1
- package/dist/chunk-7G6VDWXB.js.map +0 -1
- package/dist/chunk-A67356IR.js.map +0 -1
- package/dist/chunk-AFHQATY4.js +0 -47
- package/dist/chunk-AFHQATY4.js.map +0 -1
- package/dist/chunk-AHLJSVRL.js.map +0 -1
- package/dist/chunk-C2OOEM57.js.map +0 -1
- package/dist/chunk-DIMKRG2E.js +0 -131
- package/dist/chunk-DIMKRG2E.js.map +0 -1
- package/dist/chunk-E6427JU2.js.map +0 -1
- package/dist/chunk-E7OBCBXS.js.map +0 -1
- package/dist/chunk-EDXAQ6JI.js.map +0 -1
- package/dist/chunk-EP7VPR7Y.js.map +0 -1
- package/dist/chunk-ERB6NDDW.js.map +0 -1
- package/dist/chunk-G5APARUV.js.map +0 -1
- package/dist/chunk-GASWQ3XG.js.map +0 -1
- package/dist/chunk-GLKDWWNO.js.map +0 -1
- package/dist/chunk-HNGSV2YC.js.map +0 -1
- package/dist/chunk-I4F6PKUK.js.map +0 -1
- package/dist/chunk-I4ZAO7F7.js.map +0 -1
- package/dist/chunk-I6SDX7WX.js.map +0 -1
- package/dist/chunk-JXIDGFKS.js.map +0 -1
- package/dist/chunk-LWSJG3LI.js.map +0 -1
- package/dist/chunk-MWKDOHEF.js.map +0 -1
- package/dist/chunk-MZ5ZFO2D.js.map +0 -1
- package/dist/chunk-NIVEDYJZ.js.map +0 -1
- package/dist/chunk-NWCGDAV6.js +0 -45
- package/dist/chunk-NWCGDAV6.js.map +0 -1
- package/dist/chunk-PJNTR2NV.js.map +0 -1
- package/dist/chunk-PRDRGL73.js.map +0 -1
- package/dist/chunk-PY7CI6L5.js.map +0 -1
- package/dist/chunk-RKKORO4M.js.map +0 -1
- package/dist/chunk-TAGFGKHP.js.map +0 -1
- package/dist/chunk-TDJPS3T2.js.map +0 -1
- package/dist/chunk-TOAIYQJR.js.map +0 -1
- package/dist/chunk-UHXCLPGC.js.map +0 -1
- package/dist/chunk-UIBGXRDD.js.map +0 -1
- package/dist/chunk-V5KYPBUR.js.map +0 -1
- package/dist/chunk-VCETL77O.js.map +0 -1
- package/dist/chunk-VN45YLWM.js.map +0 -1
- package/dist/chunk-VOQW5LAM.js.map +0 -1
- package/dist/chunk-VRA4Q7DA.js.map +0 -1
- package/dist/chunk-VV4NSB7P.js.map +0 -1
- package/dist/chunk-W5W6KHN2.js.map +0 -1
- package/dist/chunk-WHJKIZS7.js.map +0 -1
- package/dist/chunk-WYZ5MYUA.js.map +0 -1
- package/dist/chunk-ZJADGNYF.js.map +0 -1
- package/dist/chunk-ZNACADFG.js.map +0 -1
- package/dist/collection-facade-QN5ULWYC.js +0 -45
- package/dist/delegation-SSEPLXXO.js.map +0 -1
- package/dist/derive-6V3PIZF7.js +0 -22
- package/dist/executor-CYJQLKKI.js +0 -9
- package/dist/executor-FHHLXO4Y.js +0 -28
- package/dist/executor-S4QIKEHW.js +0 -9
- package/dist/export-accessible-PE5AYKZR.js +0 -23
- package/dist/extract-partition-X2L26O6A.js +0 -38
- package/dist/fanout-sidecar-DTBIDOWF.js.map +0 -1
- package/dist/find-RBBYKXI7.js +0 -11
- package/dist/issue-RNU55YOF.js +0 -19
- package/dist/liberate-PX4CAT5V.js +0 -24
- package/dist/noydb-YPSEGK32.js +0 -83
- package/dist/register-TMD6YRCX.js +0 -32
- package/dist/registry-CZVINVQH.js +0 -9
- package/dist/registry-FVLDWQKT.js +0 -18
- package/dist/registry-IKUR2MXD.js +0 -9
- package/dist/registry-JET4HBLY.js +0 -19
- package/dist/request-withdrawal-RH55LNZL.js +0 -31
- package/dist/revoke-R5TBYVA6.js +0 -24
- package/dist/seed-UK4QRIUN.js.map +0 -1
- package/dist/signer-AGALOXOO.js +0 -25
- package/dist/storage-N7LB275C.js +0 -23
- package/dist/store-coordination-provider-PB6QZ57W.js.map +0 -1
- package/dist/walk-OCUHCYJ6.js +0 -21
- package/dist/with-pod/bundle-handle.d.ts +0 -9
- package/dist/withdraw-accessible-QQNWM5BO.js +0 -28
- /package/dist/{api-WVY3H3YH.js.map → api-Z5VHH24A.js.map} +0 -0
- /package/dist/{chunk-FDX7OWWI.js.map → chunk-2E2MKBMI.js.map} +0 -0
- /package/dist/{chunk-7F4DBNSP.js.map → chunk-5J5TTSGW.js.map} +0 -0
- /package/dist/{chunk-BTVYJWSN.js.map → chunk-5JT4Y5UE.js.map} +0 -0
- /package/dist/{chunk-7NXHMW6Y.js.map → chunk-7RCZ436O.js.map} +0 -0
- /package/dist/{chunk-DG27IUVI.js.map → chunk-A3NTKHDB.js.map} +0 -0
- /package/dist/{chunk-CCZJJ4I2.js.map → chunk-A4K5GLE6.js.map} +0 -0
- /package/dist/{chunk-CEJWMBXO.js.map → chunk-APV42WPR.js.map} +0 -0
- /package/dist/{chunk-4HDYQL3J.js.map → chunk-AQF7JSQR.js.map} +0 -0
- /package/dist/{chunk-KUDZVJKQ.js.map → chunk-BP4I7IBK.js.map} +0 -0
- /package/dist/{chunk-4UVDI4XE.js.map → chunk-BTNKPDZM.js.map} +0 -0
- /package/dist/{chunk-HVQGCKY4.js.map → chunk-C7WJNVJG.js.map} +0 -0
- /package/dist/{chunk-KCQX65FU.js.map → chunk-CVYXIN5B.js.map} +0 -0
- /package/dist/{chunk-AR2JDFAE.js.map → chunk-DJ23QZIN.js.map} +0 -0
- /package/dist/{chunk-PVU7LW5L.js.map → chunk-EJIVFOOQ.js.map} +0 -0
- /package/dist/{chunk-VMCCGUQB.js.map → chunk-GDGTIWB4.js.map} +0 -0
- /package/dist/{chunk-FUHKW252.js.map → chunk-GILI76SU.js.map} +0 -0
- /package/dist/{chunk-35EBKWQU.js.map → chunk-GT72D4FO.js.map} +0 -0
- /package/dist/{chunk-JRCYZEHU.js.map → chunk-HGJC7I5F.js.map} +0 -0
- /package/dist/{chunk-YAWK6AWF.js.map → chunk-JIF3IBRK.js.map} +0 -0
- /package/dist/{chunk-HNHCQ556.js.map → chunk-KBOPY6W2.js.map} +0 -0
- /package/dist/{chunk-W3TVWF6N.js.map → chunk-KM6YR5XF.js.map} +0 -0
- /package/dist/{chunk-6HFM7EIT.js.map → chunk-MNMYHZVU.js.map} +0 -0
- /package/dist/{chunk-QD724WDJ.js.map → chunk-N2HKBESK.js.map} +0 -0
- /package/dist/{chunk-Z45YRGFO.js.map → chunk-N7YAQKAO.js.map} +0 -0
- /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-NH2MST6J.js.map} +0 -0
- /package/dist/{chunk-HXGUIPQB.js.map → chunk-OQLYMBJI.js.map} +0 -0
- /package/dist/{chunk-MSWYQLMQ.js.map → chunk-PG6PFMDC.js.map} +0 -0
- /package/dist/{chunk-WKPJXWKR.js.map → chunk-QPIUFRUC.js.map} +0 -0
- /package/dist/{chunk-JIUVJ4M7.js.map → chunk-REL4OLWW.js.map} +0 -0
- /package/dist/{chunk-VW6ZZGCG.js.map → chunk-RNSC2ARR.js.map} +0 -0
- /package/dist/{chunk-WLYIROCJ.js.map → chunk-RORE2GX2.js.map} +0 -0
- /package/dist/{chunk-7TSYBD3E.js.map → chunk-RSFG7XHM.js.map} +0 -0
- /package/dist/{chunk-FAXZQ5UF.js.map → chunk-S55DBWRC.js.map} +0 -0
- /package/dist/{chunk-747LRSOO.js.map → chunk-SFD2LL7G.js.map} +0 -0
- /package/dist/{chunk-P7OG2ETF.js.map → chunk-SG3OQCRG.js.map} +0 -0
- /package/dist/{chunk-WQDTCJ6W.js.map → chunk-VEX2BQVX.js.map} +0 -0
- /package/dist/{chunk-7VHY5E3X.js.map → chunk-VH2W6BOG.js.map} +0 -0
- /package/dist/{chunk-OF3L2SD6.js.map → chunk-W6NFONOV.js.map} +0 -0
- /package/dist/{chunk-NJDQ4YSV.js.map → chunk-WBNXZU42.js.map} +0 -0
- /package/dist/{chunk-FNSMZQS4.js.map → chunk-WKD5ESK4.js.map} +0 -0
- /package/dist/{chunk-NKH7GSIH.js.map → chunk-XGQGWZ6D.js.map} +0 -0
- /package/dist/{chunk-VJFMXYKP.js.map → chunk-ZWKF3CD3.js.map} +0 -0
- /package/dist/{classified-marker-FTOX7Q5L.js.map → classified-marker-PMDG3O36.js.map} +0 -0
- /package/dist/{collection-facade-QN5ULWYC.js.map → collection-facade-ZJK5EB33.js.map} +0 -0
- /package/dist/{computed-6G5M3UPH.js.map → computed-UHCBRILW.js.map} +0 -0
- /package/dist/{dead-filter-ENRIOQIE.js.map → dead-filter-777VWDER.js.map} +0 -0
- /package/dist/{derive-6V3PIZF7.js.map → derive-3WAS2G5T.js.map} +0 -0
- /package/dist/{dispatch-BDVGYC6X.js.map → dispatch-3EN6YCCS.js.map} +0 -0
- /package/dist/{dispatch-RE74SH6L.js.map → dispatch-ASL257KG.js.map} +0 -0
- /package/dist/{enclave-52VUXNRL.js.map → enclave-ZJS5R5RH.js.map} +0 -0
- /package/dist/{executor-CYJQLKKI.js.map → executor-GPM6DNWV.js.map} +0 -0
- /package/dist/{executor-FHHLXO4Y.js.map → executor-LJSMZ4IB.js.map} +0 -0
- /package/dist/{executor-S4QIKEHW.js.map → executor-SHUVRZUJ.js.map} +0 -0
- /package/dist/{export-accessible-PE5AYKZR.js.map → export-accessible-GNY6DC6U.js.map} +0 -0
- /package/dist/{extract-partition-X2L26O6A.js.map → extract-partition-BG3AF4NZ.js.map} +0 -0
- /package/dist/{find-RBBYKXI7.js.map → find-KX6OKHDP.js.map} +0 -0
- /package/dist/{issue-RNU55YOF.js.map → issue-PAUM7NCX.js.map} +0 -0
- /package/dist/{ledger-4WJL66BW.js.map → ledger-62CEPRPX.js.map} +0 -0
- /package/dist/{liberate-PX4CAT5V.js.map → liberate-I6AOLWXW.js.map} +0 -0
- /package/dist/{link-set-N4ZPV6E6.js.map → link-set-ZRYNUHN3.js.map} +0 -0
- /package/dist/{managed-secret-OTHS64IF.js.map → managed-secret-T2WB4O47.js.map} +0 -0
- /package/dist/{noydb-YPSEGK32.js.map → noydb-SS6EN7TK.js.map} +0 -0
- /package/dist/{post-register-ZAG2CAIY.js.map → post-register-J4DEVNXK.js.map} +0 -0
- /package/dist/{register-TMD6YRCX.js.map → register-UPD4GKBC.js.map} +0 -0
- /package/dist/{registry-CZVINVQH.js.map → registry-7KX2HWFS.js.map} +0 -0
- /package/dist/{registry-FVLDWQKT.js.map → registry-PKYYEHEW.js.map} +0 -0
- /package/dist/{registry-IKUR2MXD.js.map → registry-XHCYMD34.js.map} +0 -0
- /package/dist/{registry-JET4HBLY.js.map → registry-XIRTZHPC.js.map} +0 -0
- /package/dist/{request-withdrawal-RH55LNZL.js.map → request-withdrawal-XZSESWZV.js.map} +0 -0
- /package/dist/{reveal-CMOJY4VO.js.map → reveal-525XWQU2.js.map} +0 -0
- /package/dist/{revoke-R5TBYVA6.js.map → revoke-QI7YHQ2B.js.map} +0 -0
- /package/dist/{signer-AGALOXOO.js.map → signer-BZWDPGGN.js.map} +0 -0
- /package/dist/{stale-ZWXSOWJI.js.map → stale-PQYPVCER.js.map} +0 -0
- /package/dist/{storage-N7LB275C.js.map → storage-MJHKNQRO.js.map} +0 -0
- /package/dist/{ulid-PTAIMDG4.js.map → ulid-VQW6ERQN.js.map} +0 -0
- /package/dist/{verify-RO5RTZOJ.js.map → verify-J6DEOXP3.js.map} +0 -0
- /package/dist/{walk-OCUHCYJ6.js.map → walk-BX4NSB5L.js.map} +0 -0
- /package/dist/{withdraw-accessible-QQNWM5BO.js.map → withdraw-accessible-K4CPMH4C.js.map} +0 -0
|
@@ -4,6 +4,7 @@ import type { ReduceSpec, Reduction } from '../../with-lookup/reduce/reduction.j
|
|
|
4
4
|
import type { GroupedReduction } from '../../with-lookup/reduce/groupby.js';
|
|
5
5
|
import type { JoinStrategy } from '../../kernel/query/join.js';
|
|
6
6
|
import type { MoneyDescriptor } from '../../via/money/descriptor.js';
|
|
7
|
+
import type { ExactMath } from '../../via/money/exact.js';
|
|
7
8
|
import type { I18nTextDescriptor } from '../../via/i18n/core.js';
|
|
8
9
|
/**
|
|
9
10
|
* Minimal vault-shaped accessor passed to the MV `query()` callback.
|
|
@@ -269,6 +270,57 @@ export interface MaterializedViewSpec<TRow extends Record<string, unknown>> {
|
|
|
269
270
|
* UNION-mode only. Ignored if {@link query} is set.
|
|
270
271
|
*/
|
|
271
272
|
aggregate?: ReduceSpec;
|
|
273
|
+
/**
|
|
274
|
+
* Post-aggregate projection over ONE finished row (#1007).
|
|
275
|
+
*
|
|
276
|
+
* `aggregate` accepts reducers only, so a row can carry every input a
|
|
277
|
+
* derived value needs and still not express it — `max(0, netTotal - paid)`
|
|
278
|
+
* is not a reduction. `derive` closes that gap: it receives the row the
|
|
279
|
+
* grouping/aggregation pipeline just produced and returns a patch merged
|
|
280
|
+
* onto it, immediately before materialisation.
|
|
281
|
+
*
|
|
282
|
+
* ```ts
|
|
283
|
+
* aggregate: { paid: sum('paid'), netTotal: sum('netTotal') },
|
|
284
|
+
* derive: (row) => ({ toPay: Math.max(0, row.netTotal - row.paid) }),
|
|
285
|
+
* ```
|
|
286
|
+
*
|
|
287
|
+
* Deliberately narrow, and the narrowness is what keeps it safe under
|
|
288
|
+
* incremental recompute: **pure, single-row, no cross-row access, no second
|
|
289
|
+
* aggregation pass.** It only ever sees the row the reducer just produced,
|
|
290
|
+
* so a refresh triggered by one source write recomputes it correctly without
|
|
291
|
+
* the engine needing to know anything about the function.
|
|
292
|
+
*
|
|
293
|
+
* Returning `null` / `undefined` leaves the row unchanged. Returned keys
|
|
294
|
+
* that collide with a {@link groupBy} field throw
|
|
295
|
+
* `MaterializedViewConfigError` — a group key is the row's identity and
|
|
296
|
+
* feeds {@link rowKey}, so rewriting it would silently re-home the row.
|
|
297
|
+
*
|
|
298
|
+
* **Money:** money leaves a reducer as an exact decimal string, and
|
|
299
|
+
* `Number(a) - Number(b)` would put it straight back through binary floating
|
|
300
|
+
* point — `10.05 - 0.10` becomes `9.950000000000001`, which the money
|
|
301
|
+
* quantiser then refuses rather than storing drift. So `derive` receives
|
|
302
|
+
* {@link ExactMath} as its second argument; it works in scaled BigInt and
|
|
303
|
+
* cannot introduce a representation error:
|
|
304
|
+
*
|
|
305
|
+
* ```ts
|
|
306
|
+
* moneyFields: { netTotal: THB, paid: THB, toPay: THB },
|
|
307
|
+
* derive: (row, exact) => ({ toPay: exact.max(0, exact.sub(row.netTotal, row.paid)) }),
|
|
308
|
+
* ```
|
|
309
|
+
*
|
|
310
|
+
* Declare the derived field in {@link moneyFields} and the result is
|
|
311
|
+
* quantised through that descriptor before storage, exact at its scale.
|
|
312
|
+
*
|
|
313
|
+
* Note the one place `TRow` under-describes what arrives: a field declared
|
|
314
|
+
* in {@link moneyFields} reaches `derive` DECODED — the decimal string a
|
|
315
|
+
* reader would see, not the scaled integer the reducer left behind — even
|
|
316
|
+
* where `TRow` types it as `number` (which is what the arms' `map` emits).
|
|
317
|
+
* `ExactMath` accepts both, which is why its operations are the right tool
|
|
318
|
+
* here and why no cast is needed.
|
|
319
|
+
*
|
|
320
|
+
* Applies to every MV form (union, projection, and query), always as the
|
|
321
|
+
* last step before rows are materialised.
|
|
322
|
+
*/
|
|
323
|
+
derive?: (row: TRow, exact: ExactMath) => Record<string, unknown> | null | undefined;
|
|
272
324
|
/**
|
|
273
325
|
* Money descriptors for the UNION-mode aggregate, keyed by the
|
|
274
326
|
* OUTPUT/intermediate field name as it appears in the mapped row and
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistence helpers for `_meta/public-envelope` — the cover's
|
|
3
|
-
* frozen wire location. Mirrors the bypass-AES pattern used by
|
|
4
|
-
* `_meta/handle` and `_meta/policy` — the document is plaintext
|
|
5
|
-
* JSON, the envelope's `_iv` field is left empty.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
1
|
import type { NoydbStore } from '../../../kernel/types.js';
|
|
10
2
|
import type { Cover } from './types.js';
|
|
11
3
|
/**
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistence helpers for the vault-level user-directory toggle
|
|
3
|
-
* (`_meta/directory`). Mirrors the bypass-AES pattern used by
|
|
4
|
-
* `_meta/policy` — the directory document is plain JSON, the
|
|
5
|
-
* envelope's `_iv` field is left empty.
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/user-envelope.md → Directory visibility
|
|
8
|
-
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/plaintext-bypass.md — every `_iv: ''` write site
|
|
9
|
-
*
|
|
10
|
-
* @module
|
|
11
|
-
*/
|
|
12
1
|
import type { NoydbStore } from '../../kernel/types.js';
|
|
13
2
|
import type { DirectoryConfig } from './types.js';
|
|
14
3
|
/** Reserved collection name for vault-level metadata documents. */
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistence helpers for the per-user visibility flag
|
|
3
|
-
* (`_meta/visibility/<keyringId>`). Mirrors the bypass-AES pattern used
|
|
4
|
-
* by `_meta/policy` — the visibility document is plain JSON, the
|
|
5
|
-
* envelope's `_iv` field is left empty.
|
|
6
|
-
*
|
|
7
|
-
* Stored alongside the keyring file rather than inside the encrypted
|
|
8
|
-
* user envelope (`_users/<keyringId>`) because:
|
|
9
|
-
*
|
|
10
|
-
* - `UserEnvelope<T>.data` is opaque-to-hub by contract — hub does not
|
|
11
|
-
* introspect or reserve any keys inside it. Adding `hidden` there
|
|
12
|
-
* would violate that contract.
|
|
13
|
-
* - `listUsersWithEnvelopes` filters by the flag, and the filter must
|
|
14
|
-
* work even when decryption fails (legacy keyrings predating the
|
|
15
|
-
* envelope feature, or a corrupted envelope).
|
|
16
|
-
*
|
|
17
|
-
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/user-envelope.md → Directory visibility
|
|
18
|
-
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/plaintext-bypass.md — every `_iv: ''` write site
|
|
19
|
-
*
|
|
20
|
-
* @module
|
|
21
|
-
*/
|
|
22
1
|
import type { NoydbStore } from '../../kernel/types.js';
|
|
23
2
|
import type { UserVisibility } from './types.js';
|
|
24
3
|
/** Prefix for per-user visibility records inside `_meta`. */
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistence helpers for the vault-level policy document
|
|
3
|
-
* (`_meta/policy`). Mirrors the bypass-AES pattern used by
|
|
4
|
-
* `_meta/handle` — the policy document is plain JSON, the envelope's
|
|
5
|
-
* `_iv` field is left empty.
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/session-tiers.md → Storage location
|
|
8
|
-
*
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
1
|
import type { NoydbStore, VaultPolicy } from '../../kernel/types.js';
|
|
12
2
|
/** Reserved collection name for vault-level metadata documents. */
|
|
13
3
|
export declare const META_COLLECTION = "_meta";
|
|
@@ -17,7 +17,7 @@ export { NO_TEAM, type TeamStrategy } from './strategy.js';
|
|
|
17
17
|
export { TeamNotEnabledError } from '../../kernel/errors.js';
|
|
18
18
|
export type { UnlockedKeyring } from './keyring.js';
|
|
19
19
|
export { loadKeyring, createOwnerKeyring, grant, revoke, changeSecret, listUsers, listUsersWithEnvelopes, ensureCollectionDEK, persistKeyring, updateKeyringIdentity, buildRecipientKeyringFile, } from './keyring.js';
|
|
20
|
-
export type {
|
|
20
|
+
export type { PodRecipient, ListUsersOptions } from './keyring.js';
|
|
21
21
|
export type { LoadKeyringOptions, CreateOwnerKeyringOptions, RotateKeysOptions, ChangeSecretOptions, } from './keyring.js';
|
|
22
22
|
export { enrollAuthenticator, removeAuthenticator, updateAuthenticator, findAuthenticator, } from './authenticators.js';
|
|
23
23
|
export type { EnrollAuthenticatorOptions, EnrollAuthenticatorWrappingKEKOptions, EnrollAuthenticatorWrappingDEKsOptions, UpdateAuthenticatorOptions, } from './authenticators.js';
|
|
@@ -9,6 +9,11 @@ export interface UnlockedKeyring {
|
|
|
9
9
|
readonly role: Role;
|
|
10
10
|
readonly permissions: Permissions;
|
|
11
11
|
readonly deks: Map<string, EnclaveKey>;
|
|
12
|
+
/**
|
|
13
|
+
* Unwrapped counterpart of {@link KeyringFile.pending_deks} — an
|
|
14
|
+
* uncommitted rotation (#1074). Empty in the normal state.
|
|
15
|
+
*/
|
|
16
|
+
readonly pendingDeks?: Map<string, EnclaveKey> | undefined;
|
|
12
17
|
/**
|
|
13
18
|
* The KEK, when this keyring was unlocked via tier 1 (secret) or
|
|
14
19
|
* a wrap-KEK tier-2 method (WebAuthn / OIDC). `null` when the
|
|
@@ -261,7 +266,7 @@ export interface EchoRecipientSecret extends EchoSecretParts {
|
|
|
261
266
|
*
|
|
262
267
|
* @public
|
|
263
268
|
*/
|
|
264
|
-
export interface
|
|
269
|
+
export interface PodRecipient {
|
|
265
270
|
/** User id stamped onto the keyring file in the bundle. */
|
|
266
271
|
readonly id: string;
|
|
267
272
|
/** Optional display name. Defaults to `id`. */
|
|
@@ -312,7 +317,7 @@ export interface BundleRecipient {
|
|
|
312
317
|
*
|
|
313
318
|
* @internal
|
|
314
319
|
*/
|
|
315
|
-
export declare function buildRecipientKeyringFile(callerKeyring: UnlockedKeyring, recipient:
|
|
320
|
+
export declare function buildRecipientKeyringFile(callerKeyring: UnlockedKeyring, recipient: PodRecipient): Promise<KeyringFile>;
|
|
316
321
|
/** List all users with access to a vault. */
|
|
317
322
|
export declare function listUsers(store: NoydbStore, vault: string): Promise<UserInfo[]>;
|
|
318
323
|
/**
|
|
@@ -368,8 +373,17 @@ export declare function listUsersWithEnvelopes<T = unknown>(store: NoydbStore, v
|
|
|
368
373
|
user: UserInfo;
|
|
369
374
|
envelope: UserEnvelope<T> | null;
|
|
370
375
|
}>>;
|
|
371
|
-
/** Ensure a DEK exists for a collection. Generates one if new. */
|
|
372
376
|
export declare function ensureCollectionDEK(store: NoydbStore, vault: string, keyring: UnlockedKeyring): Promise<(collectionName: string) => Promise<EnclaveKey>>;
|
|
377
|
+
/**
|
|
378
|
+
* The `Permissions` catch-all key (#1010). `Permissions` has always documented
|
|
379
|
+
* `'*'` as "the wildcard collection matching all collections in the vault", but
|
|
380
|
+
* nothing expanded it — a grantee handed the documented catch-all got no keys
|
|
381
|
+
* at all. It is honoured in three places, and they must agree: the DEK wrapping
|
|
382
|
+
* in `grant()`, and both permission checks below.
|
|
383
|
+
*/
|
|
384
|
+
export declare const PERMISSION_WILDCARD = "*";
|
|
385
|
+
/** Does this permission map hand over the whole vault? */
|
|
386
|
+
export declare function permissionsAreWildcard(permissions: Permissions | undefined): boolean;
|
|
373
387
|
/** Check if a user has write permission for a collection. */
|
|
374
388
|
export declare function hasWritePermission(keyring: UnlockedKeyring, collectionName: string): boolean;
|
|
375
389
|
/** Check if a user has any access to a collection. */
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import type { UnlockedKeyring } from './keyring.js';
|
|
20
20
|
/** Canonical DEK key for a given collection + tier. Tier 0 → bare name. */
|
|
21
|
-
|
|
21
|
+
import { dekKey } from '../../kernel/tier-visibility.js';
|
|
22
|
+
export { dekKey };
|
|
22
23
|
/**
|
|
23
24
|
* Returns the user's effective clearance for a given collection: the
|
|
24
25
|
* maximum tier for which their keyring holds a DEK. Falls back to 0
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
*/
|
|
48
48
|
import type { Cover } from '../with-party/directory/cover/types.js';
|
|
49
49
|
import type { Redirect } from './redirect.js';
|
|
50
|
-
/** Magic bytes 'NDB1' (ASCII)
|
|
51
|
-
export declare const
|
|
50
|
+
/** Magic bytes 'NDB1' (ASCII) — `NoyDB 1` — identifying a NOYDB pod (`.noydb` container). */
|
|
51
|
+
export declare const NOYDB_POD_MAGIC: Uint8Array<ArrayBuffer>;
|
|
52
52
|
/** Total fixed prefix before the header JSON: 4+1+1+4 bytes. */
|
|
53
|
-
export declare const
|
|
53
|
+
export declare const NOYDB_POD_PREFIX_BYTES = 10;
|
|
54
54
|
/** Current bundle format version. Bumped on layout changes. Default for unsigned pods. */
|
|
55
|
-
export declare const
|
|
55
|
+
export declare const NOYDB_POD_FORMAT_VERSION = 1;
|
|
56
56
|
/** Format version for pods carrying a header signature (`sig`/`keyId`/`sigAlg`). */
|
|
57
|
-
export declare const
|
|
57
|
+
export declare const NOYDB_POD_FORMAT_VERSION_SIGNED = 2;
|
|
58
58
|
/**
|
|
59
59
|
* Bitfield interpretation of the flags byte.
|
|
60
60
|
*
|
|
@@ -85,7 +85,7 @@ export type CompressionAlgo = 0 | 1 | 2;
|
|
|
85
85
|
*
|
|
86
86
|
* **Minimum-disclosure rules:** these are the ONLY allowed keys.
|
|
87
87
|
* Any other key in a parsed header causes
|
|
88
|
-
* `
|
|
88
|
+
* `validatePodHeaderFields` to throw. The set is kept short to
|
|
89
89
|
* minimize attack surface from cloud-storage metadata indexing —
|
|
90
90
|
* see the file-level doc comment for the rationale.
|
|
91
91
|
*
|
|
@@ -249,8 +249,6 @@ export interface NoydbPodHeader {
|
|
|
249
249
|
* family (see `unlockMethods` doc comment on `NoydbPodHeader`).
|
|
250
250
|
*/
|
|
251
251
|
export type UnlockMethod = 'password' | 'webauthn' | 'oidc' | 'totp' | 'email-otp' | 'magic-link' | 'pin' | 'recovery' | 'shamir';
|
|
252
|
-
/** @deprecated Use `NoydbPodHeader`. */
|
|
253
|
-
export type NoydbBundleHeader = NoydbPodHeader;
|
|
254
252
|
/**
|
|
255
253
|
* Validate a parsed bundle header. Throws on any deviation from
|
|
256
254
|
* the minimum-disclosure schema:
|
|
@@ -266,18 +264,18 @@ export type NoydbBundleHeader = NoydbPodHeader;
|
|
|
266
264
|
* The error messages name the offending field so consumers can
|
|
267
265
|
* fix the producer rather than the reader.
|
|
268
266
|
*/
|
|
269
|
-
export declare function
|
|
267
|
+
export declare function validatePodHeaderFields(parsed: unknown): asserts parsed is NoydbPodHeader;
|
|
270
268
|
/**
|
|
271
269
|
* Encode a header object to UTF-8 JSON bytes after validating
|
|
272
270
|
* minimum disclosure. Used by the writer to serialize the header
|
|
273
271
|
* region of the container.
|
|
274
272
|
*/
|
|
275
|
-
export declare function
|
|
273
|
+
export declare function encodePodHeader(header: NoydbPodHeader): Uint8Array;
|
|
276
274
|
/**
|
|
277
275
|
* Parse a bundle header from its UTF-8 JSON bytes. Throws on
|
|
278
276
|
* invalid JSON or any minimum-disclosure violation.
|
|
279
277
|
*/
|
|
280
|
-
export declare function
|
|
278
|
+
export declare function decodePodHeader(bytes: Uint8Array): NoydbPodHeader;
|
|
281
279
|
/**
|
|
282
280
|
* Read a uint32 from `bytes` at `offset` in big-endian byte order.
|
|
283
281
|
* No bounds check — callers must guarantee `offset + 4 <= bytes.length`.
|
|
@@ -295,4 +293,4 @@ export declare function writeUint32BE(bytes: Uint8Array, offset: number, value:
|
|
|
295
293
|
* 4 bytes match `NDB1`. Used by readers as a fast file-type check
|
|
296
294
|
* before any further parsing.
|
|
297
295
|
*/
|
|
298
|
-
export declare function
|
|
296
|
+
export declare function hasNoydbPodMagic(bytes: Uint8Array): boolean;
|
package/dist/with-pod/index.d.ts
CHANGED
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
* omit this subpath and save ~805 LOC of format code + Brotli/gzip
|
|
12
12
|
* wiring.
|
|
13
13
|
*/
|
|
14
|
-
export { writePod, readPod, readPodHeader, readPodCover,
|
|
14
|
+
export { writePod, readPod, readPodHeader, readPodCover, resetBrotliSupportCache, } from './pod.js';
|
|
15
15
|
export type { Cover } from '../with-party/directory/cover/types.js';
|
|
16
|
-
export type { WritePodOptions,
|
|
17
|
-
export { verifyPodHeader } from './
|
|
18
|
-
export type { PodVerifyResult } from './
|
|
16
|
+
export type { WritePodOptions, ReadPodOptions, PodReadResult, } from './pod.js';
|
|
17
|
+
export { verifyPodHeader } from './pod.js';
|
|
18
|
+
export type { PodVerifyResult } from './pod.js';
|
|
19
19
|
export { signRecord, verifyRecord, signedBytes, POD_SIG_ALG } from './signature.js';
|
|
20
|
-
export {
|
|
21
|
-
export type { CompressionAlgo, NoydbPodHeader,
|
|
20
|
+
export { NOYDB_POD_MAGIC, NOYDB_POD_PREFIX_BYTES, NOYDB_POD_FORMAT_VERSION, FLAG_COMPRESSED, FLAG_HAS_INTEGRITY_HASH, COMPRESSION_NONE, COMPRESSION_GZIP, COMPRESSION_BROTLI, validatePodHeaderFields, encodePodHeader, hasNoydbPodMagic, } from './format.js';
|
|
21
|
+
export type { CompressionAlgo, NoydbPodHeader, UnlockMethod, } from './format.js';
|
|
22
22
|
export { generateULID, isULID } from './ulid.js';
|
|
23
|
-
export { wrapPodStore, createPodStore
|
|
24
|
-
export type { WrappedPodNoydbStore, WrapPodStoreOptions,
|
|
25
|
-
export {
|
|
26
|
-
export { readPodRedirect } from './
|
|
23
|
+
export { wrapPodStore, createPodStore } from './pod-store.js';
|
|
24
|
+
export type { WrappedPodNoydbStore, WrapPodStoreOptions, } from './pod-store.js';
|
|
25
|
+
export { PodIntegrityError, PodSealMismatchError, PodVersionConflictError, BackupLedgerError, BackupCorruptedError, } from '../kernel/errors.js';
|
|
26
|
+
export { readPodRedirect } from './pod.js';
|
|
27
27
|
export { signRedirect, verifyRedirect, followRedirects } from './redirect.js';
|
|
28
28
|
export type { Redirect, RedirectHop, FollowRedirectsResult } from './redirect.js';
|
|
29
29
|
export type { DocSigner } from '../with-audit/attestation/signer.js';
|
package/dist/with-pod/open.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* reachable through published seams). Composes, in order:
|
|
7
7
|
*
|
|
8
8
|
* 1. `readPod` — parse + integrity-check the container (throws
|
|
9
|
-
* `
|
|
9
|
+
* `PodIntegrityError` on a corrupted/truncated pod).
|
|
10
10
|
* 2. `verifyPodHeader` — only when `opts.trustedKeys` is supplied.
|
|
11
11
|
* `'unsigned'` is benign (legacy pod, or `writePod({ sign: false })`)
|
|
12
12
|
* and open() proceeds; `'untrusted'` / `'tampered'` are fail-closed —
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* @module
|
|
64
64
|
*/
|
|
65
65
|
import type { NoydbPodHeader } from './format.js';
|
|
66
|
-
import type { PodVerifyResult } from './
|
|
66
|
+
import type { PodVerifyResult } from './pod.js';
|
|
67
67
|
import type { Noydb } from '../kernel/noydb.js';
|
|
68
68
|
import type { Vault } from '../kernel/vault.js';
|
|
69
69
|
import type { NoydbOptions, NoydbStore, EchoSecretParts } from '../kernel/types.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vault bundle handle — the stable opaque ULID identifying a vault
|
|
3
|
+
* across `.noydb` exports.
|
|
4
|
+
*
|
|
5
|
+
* Behaviour is byte-identical to the inline `Vault.getPodHandle`
|
|
6
|
+
* method this function replaced. `Vault` keeps the public method as
|
|
7
|
+
* a thin delegator.
|
|
8
|
+
*
|
|
9
|
+
* Internal — reached through `vault.getPodHandle()`.
|
|
10
|
+
*/
|
|
11
|
+
import type { NoydbStore } from '../kernel/types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Return the stable opaque bundle handle for the given vault adapter,
|
|
14
|
+
* generating and persisting a fresh ULID on first call.
|
|
15
|
+
*
|
|
16
|
+
* See {@link import('../kernel/vault.js').Vault.getPodHandle} for
|
|
17
|
+
* the full rationale and storage-path documentation.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildPodHandle(adapter: NoydbStore, name: string): Promise<string>;
|
|
@@ -44,11 +44,3 @@ export declare function wrapPodStore(bundle: NoydbPodStore, options?: WrapPodSto
|
|
|
44
44
|
* analogous to `createStore` for KV stores.
|
|
45
45
|
*/
|
|
46
46
|
export declare function createPodStore<TOptions>(factory: (options: TOptions) => NoydbPodStore): (options: TOptions) => NoydbPodStore;
|
|
47
|
-
/** @deprecated Use wrapPodStore. */
|
|
48
|
-
export declare const wrapBundleStore: typeof wrapPodStore;
|
|
49
|
-
/** @deprecated Use createPodStore. */
|
|
50
|
-
export declare const createBundleStore: typeof createPodStore;
|
|
51
|
-
/** @deprecated Use WrappedPodNoydbStore. */
|
|
52
|
-
export type WrappedBundleNoydbStore = WrappedPodNoydbStore;
|
|
53
|
-
/** @deprecated Use WrapPodStoreOptions. */
|
|
54
|
-
export type WrapBundleStoreOptions = WrapPodStoreOptions;
|
|
@@ -36,7 +36,7 @@ import { type NoydbPodHeader, type UnlockMethod } from './format.js';
|
|
|
36
36
|
import type { Redirect } from './redirect.js';
|
|
37
37
|
import type { DocSigner } from '../with-audit/attestation/signer.js';
|
|
38
38
|
import type { Vault } from '../kernel/vault.js';
|
|
39
|
-
import type {
|
|
39
|
+
import type { PodRecipient } from '../with-party/team/keyring.js';
|
|
40
40
|
import type { Cover } from '../with-party/directory/cover/types.js';
|
|
41
41
|
import type { SealingKeyProvider, RecipientSealer, RecipientHint } from '../with-party/team/managed-secret.js';
|
|
42
42
|
/**
|
|
@@ -128,7 +128,7 @@ export interface WritePodOptions {
|
|
|
128
128
|
* the bundle inherits the source keyring as-is (today's behaviour,
|
|
129
129
|
* suited to personal backup-and-restore).
|
|
130
130
|
*/
|
|
131
|
-
readonly recipients?: readonly
|
|
131
|
+
readonly recipients?: readonly PodRecipient[];
|
|
132
132
|
/**
|
|
133
133
|
* Auto-unlock — unsealed per-user credentials.
|
|
134
134
|
*
|
|
@@ -266,15 +266,28 @@ export interface WritePodOptions {
|
|
|
266
266
|
*/
|
|
267
267
|
readonly redirect?: Redirect;
|
|
268
268
|
}
|
|
269
|
-
/**
|
|
270
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Every key `writePod` reads, in declaration order (#991).
|
|
271
|
+
*
|
|
272
|
+
* A pod is a wire artifact, so an option this list doesn't name is refused
|
|
273
|
+
* rather than ignored: a dropped write option produces a structurally valid
|
|
274
|
+
* bundle that is missing something, and the defect surfaces later — in
|
|
275
|
+
* whoever imports it — with nothing left to trace it back to.
|
|
276
|
+
*
|
|
277
|
+
* `bundle-option-keys.test.ts` parses `WritePodOptions` out of this file and
|
|
278
|
+
* fails if the two ever drift, so adding an option is enough; you do not have
|
|
279
|
+
* to remember to update this list, only to keep the interface shape parseable.
|
|
280
|
+
*
|
|
281
|
+
* @internal
|
|
282
|
+
*/
|
|
283
|
+
export declare const WRITE_POD_OPTION_KEYS: readonly ["compression", "collections", "since", "where", "tierAtMost", "exportSecret", "recipients", "autoCredentials", "sealedCredentials", "autoSecrets", "sealedSecrets", "sign", "engineRange", "unlockMethods", "hasApp", "species", "pointerMode", "redirect"];
|
|
271
284
|
/**
|
|
272
285
|
* Result returned by `readPod`. The caller is expected to
|
|
273
286
|
* pass `dumpJson` into `vault.load(json, secret)` to
|
|
274
287
|
* actually restore a vault. Splitting the layers keeps the
|
|
275
288
|
* bundle module free of crypto concerns — see file-level docs.
|
|
276
289
|
*/
|
|
277
|
-
export interface
|
|
290
|
+
export interface PodReadResult {
|
|
278
291
|
readonly header: NoydbPodHeader;
|
|
279
292
|
readonly dumpJson: string;
|
|
280
293
|
/**
|
|
@@ -302,7 +315,7 @@ export interface NoydbBundleReadResult {
|
|
|
302
315
|
* auto-unlock paths. Without these the reader behaves exactly as before
|
|
303
316
|
* (header parsed; body returned as `dumpJson`).
|
|
304
317
|
*/
|
|
305
|
-
export interface
|
|
318
|
+
export interface ReadPodOptions {
|
|
306
319
|
/**
|
|
307
320
|
* Recipient-side sealing providers used to unseal entries from
|
|
308
321
|
* `sealedSecrets`. The reader picks the one whose `.id`
|
|
@@ -358,7 +371,7 @@ export declare function resetBrotliSupportCache(): void;
|
|
|
358
371
|
*
|
|
359
372
|
* Pipeline:
|
|
360
373
|
* 1. Resolve or create the compartment's stable bundle handle
|
|
361
|
-
* via `vault.
|
|
374
|
+
* via `vault.getPodHandle()` — same handle on
|
|
362
375
|
* every export from the same vault instance, so cloud
|
|
363
376
|
* adapters can use it as a primary key.
|
|
364
377
|
* 2. `vault.dump()` → JSON string with encrypted records
|
|
@@ -383,7 +396,7 @@ export declare function resetBrotliSupportCache(): void;
|
|
|
383
396
|
*
|
|
384
397
|
* @internal
|
|
385
398
|
*/
|
|
386
|
-
export declare function
|
|
399
|
+
export declare function assemblePodContainer(opts: {
|
|
387
400
|
handle: string;
|
|
388
401
|
bodyJsonStr: string;
|
|
389
402
|
compression: WritePodOptions['compression'];
|
|
@@ -398,8 +411,6 @@ export declare function assembleBundleContainer(opts: {
|
|
|
398
411
|
signer?: DocSigner;
|
|
399
412
|
}): Promise<Uint8Array>;
|
|
400
413
|
export declare function writePod(vault: Vault, opts?: WritePodOptions): Promise<Uint8Array>;
|
|
401
|
-
/** @deprecated Use `writePod`. */
|
|
402
|
-
export declare const writeNoydbBundle: typeof writePod;
|
|
403
414
|
/**
|
|
404
415
|
* Read just the bundle header — no body decompression, no
|
|
405
416
|
* integrity verification. Intended for cloud-listing UIs that want
|
|
@@ -415,8 +426,6 @@ export declare const writeNoydbBundle: typeof writePod;
|
|
|
415
426
|
* range requests against bundles that may carry icons.
|
|
416
427
|
*/
|
|
417
428
|
export declare function readPodHeader(bytes: Uint8Array): NoydbPodHeader;
|
|
418
|
-
/** @deprecated Use `readPodHeader`. */
|
|
419
|
-
export declare const readNoydbBundleHeader: typeof readPodHeader;
|
|
420
429
|
/**
|
|
421
430
|
* Outcome of {@link verifyPodHeader}.
|
|
422
431
|
*
|
|
@@ -442,7 +451,7 @@ export interface PodVerifyResult {
|
|
|
442
451
|
* (`keyId → publicKeyB64` the caller already trusts), it reports whether the
|
|
443
452
|
* header was signed by a trusted document signer.
|
|
444
453
|
*
|
|
445
|
-
* Pairs with the signing half in `
|
|
454
|
+
* Pairs with the signing half in `assemblePodContainer`/`writePod`: the
|
|
446
455
|
* signed payload is the final wire header with `sig` removed, so verification
|
|
447
456
|
* reconstructs it by stripping EXACTLY the `sig` field — `keyId`, `sigAlg`,
|
|
448
457
|
* and every other header field stay in the verified payload.
|
|
@@ -454,7 +463,7 @@ export interface PodVerifyResult {
|
|
|
454
463
|
* header (which includes the *claimed* `bodySha256`) is signed by a trusted
|
|
455
464
|
* key; it does NOT prove the body matches that hash. To trust the pod's
|
|
456
465
|
* BODY you MUST also confirm the body hashes to `header.bodySha256` — call
|
|
457
|
-
* `readPod`, which throws `
|
|
466
|
+
* `readPod`, which throws `PodIntegrityError` on mismatch. A `verified`
|
|
458
467
|
* header paired with a swapped body is caught only by that integrity check.
|
|
459
468
|
* This function stays body-free by design so a static page can authenticate a
|
|
460
469
|
* header without decompressing the body; composing the two checks is the
|
|
@@ -483,7 +492,7 @@ export declare function readPodCover(bytes: Uint8Array, opts?: {
|
|
|
483
492
|
* the header's `redirect` field or `undefined` if the bundle was written
|
|
484
493
|
* without one.
|
|
485
494
|
*
|
|
486
|
-
* The record is returned UNVERIFIED: `
|
|
495
|
+
* The record is returned UNVERIFIED: `validatePodHeaderFields` only checks
|
|
487
496
|
* its shape at parse time (a parser has no `trustedKeys`). Callers that
|
|
488
497
|
* intend to follow the redirect MUST separately call `verifyRedirect`
|
|
489
498
|
* (`redirect.js`) before trusting `target`.
|
|
@@ -495,7 +504,7 @@ export declare function readPodRedirect(bytes: Uint8Array): Redirect | undefined
|
|
|
495
504
|
* original `vault.dump()` JSON string ready to pass to
|
|
496
505
|
* `vault.load()`.
|
|
497
506
|
*
|
|
498
|
-
* Throws `
|
|
507
|
+
* Throws `PodIntegrityError` if the body's actual SHA-256 does
|
|
499
508
|
* not match the value declared in the header. Distinct from a
|
|
500
509
|
* format error so consumers can pattern-match in catch blocks
|
|
501
510
|
* (corrupted-in-transit vs malformed-by-producer).
|
|
@@ -507,6 +516,4 @@ export declare function readPodRedirect(bytes: Uint8Array): Redirect | undefined
|
|
|
507
516
|
* free of crypto concerns and lets the same code feed format
|
|
508
517
|
* inspectors that never decrypt anything.
|
|
509
518
|
*/
|
|
510
|
-
export declare function readPod(bytes: Uint8Array, opts?:
|
|
511
|
-
/** @deprecated Use `readPod`. */
|
|
512
|
-
export declare const readNoydbBundle: typeof readPod;
|
|
519
|
+
export declare function readPod(bytes: Uint8Array, opts?: ReadPodOptions): Promise<PodReadResult>;
|
package/dist/with-pod/ulid.d.ts
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
*
|
|
40
40
|
* If a future use case needs timestamp-free handles, a v2 of the
|
|
41
41
|
* format could specify "use the random portion only" without a
|
|
42
|
-
* format break — `
|
|
42
|
+
* format break — `validatePodHeaderFields` only checks the regex
|
|
43
43
|
* shape, not the encoded timestamp.
|
|
44
44
|
*/
|
|
45
45
|
/**
|
|
@@ -14,6 +14,7 @@ export { jsonSchemaToFields } from './fields.js';
|
|
|
14
14
|
export type { SchemaIntrospection } from './types.js';
|
|
15
15
|
export type { FieldMeta, SemanticType } from './field-meta.js';
|
|
16
16
|
export type { CollectionDescription, DescribedField, DescribeOptions } from './describe.js';
|
|
17
|
+
export type { StandardSchemaV1Issue } from '../../kernel/schema.js';
|
|
17
18
|
export { applyListProjection } from './projection.js';
|
|
18
19
|
export type { ListProjectionOptions } from './projection.js';
|
|
19
20
|
export type { BehaviorSummary, GuardBehaviorEntry, DerivationBehaviorEntry, DerivationOutputEntry, MaterializedViewBehaviorEntry, OverlayBehaviorEntry, SatelliteBehaviorEntry, } from './behaviors.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NoydbStore, DirtyEntry, ConflictStrategy, CollectionConflictResolver, PushOptions, PullOptions, PushResult, PullResult, SyncStatus, SyncTargetRole } from '../kernel/types.js';
|
|
2
|
+
import type { MergeAuthority } from '../port/with/merge-authority.js';
|
|
2
3
|
import { type PeriodPullSource } from './period-scope.js';
|
|
3
4
|
import type { NoydbEventEmitter } from '../kernel/events.js';
|
|
4
5
|
import type { SyncPolicy } from '../kernel/sync-policy.js';
|
|
@@ -12,6 +13,7 @@ export interface ReservedLookupSource {
|
|
|
12
13
|
}
|
|
13
14
|
/** Sync engine: dirty tracking, push, pull, conflict resolution, scheduling. */
|
|
14
15
|
export declare class SyncEngine {
|
|
16
|
+
private readonly mergeAuthority;
|
|
15
17
|
private readonly local;
|
|
16
18
|
private readonly remote;
|
|
17
19
|
private readonly strategy;
|
|
@@ -24,8 +26,17 @@ export declare class SyncEngine {
|
|
|
24
26
|
* into the scheduler below. */
|
|
25
27
|
readonly policy: SyncPolicy | undefined;
|
|
26
28
|
private dirty;
|
|
29
|
+
/** #1036 — last SUCCESSFUL push/pull. Never advanced by a failed attempt. */
|
|
27
30
|
private lastPush;
|
|
28
31
|
private lastPull;
|
|
32
|
+
/**
|
|
33
|
+
* #1036 — the failure that ended the most recent attempt, cleared by the next
|
|
34
|
+
* success. Live state only: deliberately NOT persisted in `_sync/meta`, since a
|
|
35
|
+
* reload cannot know whether the target is still failing. It exists so a poller
|
|
36
|
+
* can separate "never synced" (both null) from "synced a while ago, failing
|
|
37
|
+
* since" (`lastPush` set, `lastError` set).
|
|
38
|
+
*/
|
|
39
|
+
private lastError;
|
|
29
40
|
private loaded;
|
|
30
41
|
private autoSyncInterval;
|
|
31
42
|
private isOnline;
|
|
@@ -92,6 +103,15 @@ export declare class SyncEngine {
|
|
|
92
103
|
syncPolicy?: SyncPolicy;
|
|
93
104
|
role?: SyncTargetRole;
|
|
94
105
|
label?: string;
|
|
106
|
+
/**
|
|
107
|
+
* #1042 — the merge's verify/re-stamp capability. Optional so an engine
|
|
108
|
+
* built without one behaves exactly as before; the Vault supplies it.
|
|
109
|
+
*
|
|
110
|
+
* A closure, not an import: `with-sync` is DEK-free and
|
|
111
|
+
* `check:architecture` enforces that, so the capability arrives already
|
|
112
|
+
* bound to the keys rather than the engine reaching for them.
|
|
113
|
+
*/
|
|
114
|
+
mergeAuthority?: MergeAuthority;
|
|
95
115
|
});
|
|
96
116
|
/** Start the sync scheduler. Called after vault is fully opened. */
|
|
97
117
|
startScheduler(): void;
|
|
@@ -148,6 +168,18 @@ export declare class SyncEngine {
|
|
|
148
168
|
* are removed from the dirty log on success.
|
|
149
169
|
*/
|
|
150
170
|
pushFiltered(predicate: (entry: DirtyEntry) => boolean): Promise<PushResult>;
|
|
171
|
+
/**
|
|
172
|
+
* #1036 — close out a push/pull. `push()` and `pull()` collect per-record
|
|
173
|
+
* failures into their result's `errors` rather than throwing, and the clock used
|
|
174
|
+
* to be stamped regardless — so an unreachable store still reported a fresh
|
|
175
|
+
* `lastPush`, and a UI rendered "Last synced: just now" over a sync that moved
|
|
176
|
+
* nothing. An attempt only advances the clock when it had no errors.
|
|
177
|
+
*
|
|
178
|
+
* An empty dirty log is a success, not a failure: nothing to send is not the
|
|
179
|
+
* same as failing to send, and treating it otherwise would leave a quiet vault
|
|
180
|
+
* looking permanently unsynced.
|
|
181
|
+
*/
|
|
182
|
+
private recordOutcome;
|
|
151
183
|
/** Get current sync status. */
|
|
152
184
|
status(): SyncStatus;
|
|
153
185
|
/** Start auto-sync: listen for online/offline events, optional periodic sync. */
|
|
@@ -168,11 +200,28 @@ export declare class SyncEngine {
|
|
|
168
200
|
* the remote's (the same-`_v` push tie), re-stamp it at `remote._v + 1`.
|
|
169
201
|
* Without this the loser's next pull sees no delta (`_v`-based
|
|
170
202
|
* detection) and the peers stay silently diverged at the same version.
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
203
|
+
* ## Why this is async, and why it goes through `MergeAuthority` (#1093)
|
|
204
|
+
*
|
|
205
|
+
* It used to be `{ ...winner, _v: remote._v + 1 }` — a metadata restamp on
|
|
206
|
+
* ciphertext the engine cannot decrypt. That spread was the SOLE reason `_v`
|
|
207
|
+
* could not be bound into the AAD: a version rewritten onto a body sealed at
|
|
208
|
+
* a different one produces a record no reader can open.
|
|
209
|
+
*
|
|
210
|
+
* `with-sync` is DEK-free by design and `check:architecture` enforces it, so
|
|
211
|
+
* the re-seal cannot happen here. It happens in the injected authority, which
|
|
212
|
+
* holds the keys. The engine still decides WHICH version to advance to; it
|
|
213
|
+
* simply no longer pretends it can rewrite a sealed body.
|
|
214
|
+
*
|
|
215
|
+
* The authority is ALWAYS present in the product — `kernel/noydb.ts` builds
|
|
216
|
+
* one from the keyring and passes it at both engine-construction sites, and
|
|
217
|
+
* `with-sync/active.ts` is the only place an engine is constructed. The
|
|
218
|
+
* fallback below is reachable only by constructing `SyncEngine` directly,
|
|
219
|
+
* which tests do. It restamps, as before — and would produce an unreadable
|
|
220
|
+
* record if such a test ever held AEAD-sealed envelopes. None do; the
|
|
221
|
+
* fixtures that reach it build their own plaintext ones.
|
|
222
|
+
*
|
|
223
|
+
* The 'merged' branch needs none of this: resolver output is already stamped
|
|
224
|
+
* `max(local, remote) + 1` by whoever built it.
|
|
176
225
|
*/
|
|
177
226
|
private advancePastRemote;
|
|
178
227
|
private applyRemote;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
27
|
import type { NoydbStore, ConflictStrategy, SyncTargetRole } from '../kernel/types.js';
|
|
28
|
+
import type { MergeAuthority } from '../port/with/merge-authority.js';
|
|
28
29
|
import type { NoydbEventEmitter } from '../kernel/events.js';
|
|
29
30
|
import type { SyncPolicy } from '../kernel/sync-policy.js';
|
|
30
31
|
import type { SyncEngine } from './engine.js';
|
|
@@ -47,6 +48,8 @@ export interface BuildSyncEngineOptions {
|
|
|
47
48
|
syncPolicy?: SyncPolicy;
|
|
48
49
|
role?: SyncTargetRole;
|
|
49
50
|
label?: string;
|
|
51
|
+
/** #1042 — the merge's verify/re-stamp capability, bound to the keys by the caller. */
|
|
52
|
+
mergeAuthority?: MergeAuthority;
|
|
50
53
|
}
|
|
51
54
|
/**
|
|
52
55
|
* @internal
|