@noy-db/hub 0.6.0-pre.2 → 0.6.0-pre.21
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/CHANGELOG.md +5234 -0
- package/codemods/0.4.0-pre.json +699 -0
- package/codemods/0.6.0-pre.json +211 -0
- package/dist/api-EYNT6KGS.js +20 -0
- package/dist/attestation/index.js +19 -19
- package/dist/{backup-YYBE5RPC.js → backup-FSC36VWC.js} +36 -18
- package/dist/backup-FSC36VWC.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-35EBKWQU.js → chunk-2LFOMUEA.js} +4 -4
- package/dist/{chunk-OF3L2SD6.js → chunk-32B7VCKU.js} +2 -2
- package/dist/{chunk-MSWYQLMQ.js → chunk-3B6S6RSI.js} +2 -2
- package/dist/{chunk-PJNTR2NV.js → chunk-3ENNPCIW.js} +7 -10
- package/dist/chunk-3ENNPCIW.js.map +1 -0
- package/dist/{chunk-7F4DBNSP.js → chunk-3O72ZD2E.js} +3 -3
- package/dist/{chunk-FNSMZQS4.js → chunk-3PMFMUFX.js} +2 -2
- package/dist/{chunk-WQDTCJ6W.js → chunk-45YHJ3GV.js} +11 -3
- package/dist/{chunk-WQDTCJ6W.js.map → chunk-45YHJ3GV.js.map} +1 -1
- package/dist/{chunk-NIVEDYJZ.js → chunk-4A34KWOU.js} +31 -49
- package/dist/chunk-4A34KWOU.js.map +1 -0
- package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
- package/dist/chunk-4AOERLTV.js.map +1 -0
- package/dist/{chunk-EDXAQ6JI.js → chunk-4N5Q23KV.js} +87 -34
- package/dist/chunk-4N5Q23KV.js.map +1 -0
- package/dist/{chunk-VV4NSB7P.js → chunk-4OQZNXQG.js} +15 -24
- package/dist/chunk-4OQZNXQG.js.map +1 -0
- package/dist/{chunk-FAXZQ5UF.js → chunk-4RAS6HN6.js} +2 -2
- package/dist/{chunk-C2OOEM57.js → chunk-4YL2LMXK.js} +92 -35
- package/dist/chunk-4YL2LMXK.js.map +1 -0
- package/dist/{chunk-EP7VPR7Y.js → chunk-5Q7AJ7DN.js} +11 -8
- package/dist/chunk-5Q7AJ7DN.js.map +1 -0
- package/dist/{chunk-VMCCGUQB.js → chunk-6JPGVL7X.js} +2 -2
- package/dist/{chunk-PRDRGL73.js → chunk-6KTVJ5ZZ.js} +17 -14
- package/dist/chunk-6KTVJ5ZZ.js.map +1 -0
- package/dist/{chunk-4MC5JRRX.js → chunk-6WO62AJW.js} +14 -15
- package/dist/chunk-6WO62AJW.js.map +1 -0
- package/dist/{chunk-WLYIROCJ.js → chunk-6YD5SYQS.js} +2 -2
- package/dist/{chunk-YAWK6AWF.js → chunk-7KAE7CQ2.js} +2 -2
- package/dist/{chunk-MWKDOHEF.js → chunk-7LNE2N2V.js} +17 -10
- package/dist/chunk-7LNE2N2V.js.map +1 -0
- package/dist/{chunk-5PR33AC4.js → chunk-7PJ3BKHS.js} +20 -17
- package/dist/chunk-7PJ3BKHS.js.map +1 -0
- package/dist/{chunk-JXIDGFKS.js → chunk-A4TOGAUW.js} +4 -2
- package/dist/chunk-A4TOGAUW.js.map +1 -0
- package/dist/{chunk-VCETL77O.js → chunk-AU3AUJIZ.js} +27 -7
- package/dist/chunk-AU3AUJIZ.js.map +1 -0
- package/dist/{chunk-NKH7GSIH.js → chunk-AUPSEJ7O.js} +4 -4
- package/dist/{chunk-CCZJJ4I2.js → chunk-B6IYATME.js} +4 -4
- package/dist/{chunk-WYZ5MYUA.js → chunk-BAHOV5I5.js} +44 -42
- package/dist/chunk-BAHOV5I5.js.map +1 -0
- package/dist/{chunk-G5APARUV.js → chunk-BEZDLIDG.js} +13 -15
- package/dist/chunk-BEZDLIDG.js.map +1 -0
- package/dist/{chunk-ERB6NDDW.js → chunk-CAGI4LLJ.js} +427 -72
- package/dist/chunk-CAGI4LLJ.js.map +1 -0
- package/dist/{chunk-4UVDI4XE.js → chunk-CLAHBPOI.js} +4 -4
- package/dist/{chunk-HNGSV2YC.js → chunk-CWM4GQD2.js} +39 -10
- package/dist/chunk-CWM4GQD2.js.map +1 -0
- package/dist/{chunk-HVQGCKY4.js → chunk-D3R7Q4QK.js} +2 -2
- package/dist/{chunk-I4F6PKUK.js → chunk-DIZ6HM7Q.js} +16 -17
- package/dist/chunk-DIZ6HM7Q.js.map +1 -0
- package/dist/{chunk-ZNACADFG.js → chunk-DVRZYAGT.js} +4 -4
- package/dist/chunk-DVRZYAGT.js.map +1 -0
- package/dist/{chunk-P7OG2ETF.js → chunk-DXKLLKME.js} +3 -3
- package/dist/{chunk-TDJPS3T2.js → chunk-E5SC6ENM.js} +24 -19
- package/dist/chunk-E5SC6ENM.js.map +1 -0
- package/dist/{chunk-26JMGSSC.js → chunk-EES37S2V.js} +4 -4
- package/dist/chunk-EES37S2V.js.map +1 -0
- package/dist/{chunk-JIUVJ4M7.js → chunk-EKEIEJL6.js} +2 -2
- package/dist/{chunk-GASWQ3XG.js → chunk-ESKIAXO2.js} +15 -16
- package/dist/chunk-ESKIAXO2.js.map +1 -0
- package/dist/{chunk-TOAIYQJR.js → chunk-FFSQFH6D.js} +7 -10
- package/dist/chunk-FFSQFH6D.js.map +1 -0
- package/dist/{chunk-DG27IUVI.js → chunk-FS7NTGCJ.js} +2 -2
- package/dist/{chunk-V5KYPBUR.js → chunk-FW7NGYLT.js} +11 -14
- package/dist/chunk-FW7NGYLT.js.map +1 -0
- package/dist/{chunk-52QYGZHH.js → chunk-GBBDFE6C.js} +2 -2
- package/dist/chunk-GBBDFE6C.js.map +1 -0
- package/dist/{chunk-HXGUIPQB.js → chunk-GQXFOAYZ.js} +3 -3
- package/dist/{chunk-BTVYJWSN.js → chunk-GTHVPVAR.js} +10 -10
- package/dist/{chunk-DMQCLZ4Z.js → chunk-GWO2IDAB.js} +2 -2
- package/dist/{chunk-6HFM7EIT.js → chunk-H3G4I3PN.js} +2 -2
- package/dist/chunk-HK67PX4J.js +27 -0
- package/dist/chunk-HK67PX4J.js.map +1 -0
- package/dist/{chunk-E7OBCBXS.js → chunk-HQSPF5IY.js} +22 -18
- package/dist/chunk-HQSPF5IY.js.map +1 -0
- package/dist/{chunk-VJFMXYKP.js → chunk-HR5R5JOM.js} +2 -2
- package/dist/{chunk-FDX7OWWI.js → chunk-HYYVT2KZ.js} +2 -2
- package/dist/{chunk-JRCYZEHU.js → chunk-I6QKB7MT.js} +2 -2
- package/dist/{chunk-MZ5ZFO2D.js → chunk-ICDHUUMQ.js} +84 -112
- package/dist/chunk-ICDHUUMQ.js.map +1 -0
- package/dist/{chunk-W5W6KHN2.js → chunk-IGNJOJEP.js} +1 -1
- package/dist/chunk-IGNJOJEP.js.map +1 -0
- package/dist/{chunk-KUDZVJKQ.js → chunk-IJ46VCWD.js} +2 -2
- package/dist/{chunk-4HDYQL3J.js → chunk-INMHEMXX.js} +2 -2
- package/dist/{chunk-66W5OOCX.js → chunk-JLYQQNY4.js} +52 -65
- package/dist/chunk-JLYQQNY4.js.map +1 -0
- package/dist/{chunk-UHXCLPGC.js → chunk-JNMTN5D5.js} +2 -2
- package/dist/chunk-JNMTN5D5.js.map +1 -0
- package/dist/{chunk-I4ZAO7F7.js → chunk-JWMBG5S3.js} +7 -11
- package/dist/chunk-JWMBG5S3.js.map +1 -0
- package/dist/chunk-KRVS7YWY.js +123 -0
- package/dist/chunk-KRVS7YWY.js.map +1 -0
- package/dist/{chunk-AR2JDFAE.js → chunk-KV6JM2IA.js} +2 -2
- package/dist/{chunk-PVU7LW5L.js → chunk-KX57HODD.js} +6 -6
- package/dist/{chunk-PY7CI6L5.js → chunk-LGFTOU27.js} +553 -275
- package/dist/chunk-LGFTOU27.js.map +1 -0
- package/dist/chunk-LN7P6MZB.js +190 -0
- package/dist/chunk-LN7P6MZB.js.map +1 -0
- package/dist/{chunk-UIBGXRDD.js → chunk-LX46B56Q.js} +25 -31
- package/dist/chunk-LX46B56Q.js.map +1 -0
- package/dist/{chunk-CEJWMBXO.js → chunk-LXECF2ZR.js} +2 -2
- package/dist/{chunk-7VHY5E3X.js → chunk-MSLPDFK2.js} +7 -7
- package/dist/{chunk-I6SDX7WX.js → chunk-MZTUTEHP.js} +16 -22
- package/dist/chunk-MZTUTEHP.js.map +1 -0
- package/dist/{chunk-VRA4Q7DA.js → chunk-NCCEDL2K.js} +55 -48
- package/dist/chunk-NCCEDL2K.js.map +1 -0
- package/dist/{chunk-HNHCQ556.js → chunk-NR2SUJ3H.js} +2 -2
- package/dist/{chunk-AHLJSVRL.js → chunk-NW4TY6VC.js} +5 -7
- package/dist/chunk-NW4TY6VC.js.map +1 -0
- package/dist/{chunk-RKKORO4M.js → chunk-O742QBZZ.js} +10 -10
- package/dist/chunk-O742QBZZ.js.map +1 -0
- package/dist/{chunk-VN45YLWM.js → chunk-OHOKBMTM.js} +343 -132
- package/dist/chunk-OHOKBMTM.js.map +1 -0
- package/dist/{chunk-W3TVWF6N.js → chunk-OIBEJN5H.js} +2 -2
- package/dist/{chunk-QD724WDJ.js → chunk-OMYCSTXL.js} +4 -4
- package/dist/{chunk-Z45YRGFO.js → chunk-ONVD6GBY.js} +2 -2
- package/dist/{chunk-TAGFGKHP.js → chunk-OTHHO3KI.js} +7 -10
- package/dist/chunk-OTHHO3KI.js.map +1 -0
- package/dist/{chunk-3737A6EA.js → chunk-P2MR5UNE.js} +75 -18
- package/dist/chunk-P2MR5UNE.js.map +1 -0
- package/dist/chunk-PENPHA45.js +66 -0
- package/dist/chunk-PENPHA45.js.map +1 -0
- package/dist/{chunk-3FSX6LDG.js → chunk-PPCOKVFA.js} +8 -3
- package/dist/{chunk-3FSX6LDG.js.map → chunk-PPCOKVFA.js.map} +1 -1
- package/dist/{chunk-VOQW5LAM.js → chunk-QSIEL6TL.js} +102 -71
- package/dist/chunk-QSIEL6TL.js.map +1 -0
- package/dist/chunk-RFO4UXKQ.js +201 -0
- package/dist/chunk-RFO4UXKQ.js.map +1 -0
- package/dist/{chunk-KCQX65FU.js → chunk-RKCRPPNB.js} +3 -3
- package/dist/{chunk-7TSYBD3E.js → chunk-RSXQNFGO.js} +2 -2
- package/dist/{chunk-SZ2K3MHL.js → chunk-S56VYR4Q.js} +8 -11
- package/dist/{chunk-SZ2K3MHL.js.map → chunk-S56VYR4Q.js.map} +1 -1
- package/dist/{chunk-7NXHMW6Y.js → chunk-SYS46BL7.js} +2 -2
- package/dist/{chunk-55LKVALY.js → chunk-T7IR4N2S.js} +1 -3
- package/dist/chunk-T7IR4N2S.js.map +1 -0
- package/dist/{chunk-A67356IR.js → chunk-T7JGWTES.js} +33 -8
- package/dist/chunk-T7JGWTES.js.map +1 -0
- package/dist/{chunk-WHJKIZS7.js → chunk-TDSN2O2V.js} +27 -149
- package/dist/chunk-TDSN2O2V.js.map +1 -0
- package/dist/{chunk-747LRSOO.js → chunk-TMBSPLUG.js} +2 -2
- package/dist/{chunk-LWSJG3LI.js → chunk-TQPASLY4.js} +7 -3
- package/dist/chunk-TQPASLY4.js.map +1 -0
- package/dist/{chunk-WKPJXWKR.js → chunk-TX5MKAHA.js} +3 -3
- package/dist/{chunk-HFQ6LGIO.js → chunk-U27Y4DJZ.js} +12 -10
- package/dist/{chunk-HFQ6LGIO.js.map → chunk-U27Y4DJZ.js.map} +1 -1
- package/dist/{chunk-E6427JU2.js → chunk-VVSOPRUE.js} +18 -2
- package/dist/chunk-VVSOPRUE.js.map +1 -0
- package/dist/{chunk-7G6VDWXB.js → chunk-WVE6YKMX.js} +3 -3
- package/dist/chunk-WVE6YKMX.js.map +1 -0
- package/dist/{chunk-GLKDWWNO.js → chunk-YALD3SST.js} +16 -14
- package/dist/chunk-YALD3SST.js.map +1 -0
- package/dist/{chunk-NJDQ4YSV.js → chunk-YKXZHUOW.js} +4 -4
- package/dist/{chunk-VW6ZZGCG.js → chunk-ZLHHE5XZ.js} +3 -3
- package/dist/{chunk-FUHKW252.js → chunk-ZZXLB6AS.js} +2 -2
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-FTOX7Q5L.js → classified-marker-NA6HUV33.js} +3 -3
- package/dist/collection-facade-VBM35WAH.js +45 -0
- package/dist/{computed-6G5M3UPH.js → computed-GSTLWSY5.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-UALP5DJX.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-SSEPLXXO.js → delegation-JLNXM7KH.js} +24 -23
- package/dist/delegation-JLNXM7KH.js.map +1 -0
- package/dist/derivations/index.js +12 -12
- package/dist/derive-YUO3TQYN.js +22 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-RE74SH6L.js → dispatch-4ZHLSFZQ.js} +5 -5
- package/dist/{dispatch-BDVGYC6X.js → dispatch-77CB75KB.js} +18 -18
- package/dist/{enclave-52VUXNRL.js → enclave-O4NOROCJ.js} +27 -9
- package/dist/executor-CZDXBXKE.js +29 -0
- package/dist/executor-DVJAWN3B.js +9 -0
- package/dist/executor-VRLG4TQJ.js +9 -0
- package/dist/export-accessible-UXSMG7AB.js +23 -0
- package/dist/extract-partition-TVY7AMKH.js +38 -0
- package/dist/{fanout-sidecar-DTBIDOWF.js → fanout-sidecar-NLQ7QAYW.js} +18 -27
- package/dist/fanout-sidecar-NLQ7QAYW.js.map +1 -0
- package/dist/find-WSARMJBW.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +7 -7
- 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 +33 -15
- package/dist/index.js +187 -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-3JNJNPT3.js +19 -0
- package/dist/kernel/constants.d.ts +18 -0
- package/dist/kernel/enclave/crypto.d.ts +24 -4
- package/dist/kernel/enclave/index.d.ts +9 -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-blob.d.ts +88 -0
- 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 +71 -12
- package/dist/kernel/merge-authority.d.ts +25 -0
- package/dist/kernel/noydb.d.ts +27 -4
- 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 +145 -12
- package/dist/kernel/vault.d.ts +22 -18
- package/dist/kernel/via/index.d.ts +11 -2
- package/dist/{ledger-4WJL66BW.js → ledger-MVPNG5OS.js} +11 -11
- package/dist/liberate-4LOJOLDT.js +24 -0
- package/dist/{link-set-N4ZPV6E6.js → link-set-3POMQR3I.js} +11 -11
- package/dist/{managed-secret-OTHS64IF.js → managed-secret-IARIJJ7Q.js} +11 -3
- package/dist/materialized-views/index.js +22 -21
- package/dist/migrate-cek-XM2ETTZW.js +19 -0
- package/dist/migrate-cek-XM2ETTZW.js.map +1 -0
- package/dist/money/index.js +12 -8
- package/dist/noydb-IRILUDED.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-MELERCKU.js +41 -0
- package/dist/pod-handle-MELERCKU.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/port/with/team-strategy.d.ts +5 -1
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-ZAG2CAIY.js → post-register-Z5T7FY45.js} +6 -6
- package/dist/query/index.js +3 -3
- package/dist/reduce/index.js +4 -4
- package/dist/register-UZ37QPDB.js +32 -0
- package/dist/registry-ETJNA7PO.js +9 -0
- package/dist/registry-F7U6KSLX.js +9 -0
- package/dist/registry-L4ELKX6C.js +18 -0
- package/dist/registry-SDT5LIGO.js +19 -0
- package/dist/request-withdrawal-PVFEYX57.js +31 -0
- package/dist/{reveal-CMOJY4VO.js → reveal-DQ2E3QAZ.js} +6 -6
- package/dist/revoke-YXY6SHUH.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-DZ4ORU5N.js} +19 -22
- package/dist/seed-DZ4ORU5N.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-Q7XQBMPA.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-ZWXSOWJI.js → stale-NI7SAXAZ.js} +10 -10
- package/dist/storage-3VNGSHXS.js +23 -0
- package/dist/{store-coordination-provider-PB6QZ57W.js → store-coordination-provider-TYKNR3OU.js} +18 -12
- package/dist/store-coordination-provider-TYKNR3OU.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-6J2YLKSO.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-WRA7RAPY.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 +149 -3
- package/dist/with-party/team/noydb-facade.d.ts +5 -1
- package/dist/with-party/team/roster-tag.d.ts +101 -0
- 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/blobs/blob-set.d.ts +2 -2
- 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-4JTDFRFZ.js +28 -0
- package/package.json +13 -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-EYNT6KGS.js.map} +0 -0
- /package/dist/{chunk-35EBKWQU.js.map → chunk-2LFOMUEA.js.map} +0 -0
- /package/dist/{chunk-OF3L2SD6.js.map → chunk-32B7VCKU.js.map} +0 -0
- /package/dist/{chunk-MSWYQLMQ.js.map → chunk-3B6S6RSI.js.map} +0 -0
- /package/dist/{chunk-7F4DBNSP.js.map → chunk-3O72ZD2E.js.map} +0 -0
- /package/dist/{chunk-FNSMZQS4.js.map → chunk-3PMFMUFX.js.map} +0 -0
- /package/dist/{chunk-FAXZQ5UF.js.map → chunk-4RAS6HN6.js.map} +0 -0
- /package/dist/{chunk-VMCCGUQB.js.map → chunk-6JPGVL7X.js.map} +0 -0
- /package/dist/{chunk-WLYIROCJ.js.map → chunk-6YD5SYQS.js.map} +0 -0
- /package/dist/{chunk-YAWK6AWF.js.map → chunk-7KAE7CQ2.js.map} +0 -0
- /package/dist/{chunk-NKH7GSIH.js.map → chunk-AUPSEJ7O.js.map} +0 -0
- /package/dist/{chunk-CCZJJ4I2.js.map → chunk-B6IYATME.js.map} +0 -0
- /package/dist/{chunk-4UVDI4XE.js.map → chunk-CLAHBPOI.js.map} +0 -0
- /package/dist/{chunk-HVQGCKY4.js.map → chunk-D3R7Q4QK.js.map} +0 -0
- /package/dist/{chunk-P7OG2ETF.js.map → chunk-DXKLLKME.js.map} +0 -0
- /package/dist/{chunk-JIUVJ4M7.js.map → chunk-EKEIEJL6.js.map} +0 -0
- /package/dist/{chunk-DG27IUVI.js.map → chunk-FS7NTGCJ.js.map} +0 -0
- /package/dist/{chunk-HXGUIPQB.js.map → chunk-GQXFOAYZ.js.map} +0 -0
- /package/dist/{chunk-BTVYJWSN.js.map → chunk-GTHVPVAR.js.map} +0 -0
- /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-GWO2IDAB.js.map} +0 -0
- /package/dist/{chunk-6HFM7EIT.js.map → chunk-H3G4I3PN.js.map} +0 -0
- /package/dist/{chunk-VJFMXYKP.js.map → chunk-HR5R5JOM.js.map} +0 -0
- /package/dist/{chunk-FDX7OWWI.js.map → chunk-HYYVT2KZ.js.map} +0 -0
- /package/dist/{chunk-JRCYZEHU.js.map → chunk-I6QKB7MT.js.map} +0 -0
- /package/dist/{chunk-KUDZVJKQ.js.map → chunk-IJ46VCWD.js.map} +0 -0
- /package/dist/{chunk-4HDYQL3J.js.map → chunk-INMHEMXX.js.map} +0 -0
- /package/dist/{chunk-AR2JDFAE.js.map → chunk-KV6JM2IA.js.map} +0 -0
- /package/dist/{chunk-PVU7LW5L.js.map → chunk-KX57HODD.js.map} +0 -0
- /package/dist/{chunk-CEJWMBXO.js.map → chunk-LXECF2ZR.js.map} +0 -0
- /package/dist/{chunk-7VHY5E3X.js.map → chunk-MSLPDFK2.js.map} +0 -0
- /package/dist/{chunk-HNHCQ556.js.map → chunk-NR2SUJ3H.js.map} +0 -0
- /package/dist/{chunk-W3TVWF6N.js.map → chunk-OIBEJN5H.js.map} +0 -0
- /package/dist/{chunk-QD724WDJ.js.map → chunk-OMYCSTXL.js.map} +0 -0
- /package/dist/{chunk-Z45YRGFO.js.map → chunk-ONVD6GBY.js.map} +0 -0
- /package/dist/{chunk-KCQX65FU.js.map → chunk-RKCRPPNB.js.map} +0 -0
- /package/dist/{chunk-7TSYBD3E.js.map → chunk-RSXQNFGO.js.map} +0 -0
- /package/dist/{chunk-7NXHMW6Y.js.map → chunk-SYS46BL7.js.map} +0 -0
- /package/dist/{chunk-747LRSOO.js.map → chunk-TMBSPLUG.js.map} +0 -0
- /package/dist/{chunk-WKPJXWKR.js.map → chunk-TX5MKAHA.js.map} +0 -0
- /package/dist/{chunk-NJDQ4YSV.js.map → chunk-YKXZHUOW.js.map} +0 -0
- /package/dist/{chunk-VW6ZZGCG.js.map → chunk-ZLHHE5XZ.js.map} +0 -0
- /package/dist/{chunk-FUHKW252.js.map → chunk-ZZXLB6AS.js.map} +0 -0
- /package/dist/{classified-marker-FTOX7Q5L.js.map → classified-marker-NA6HUV33.js.map} +0 -0
- /package/dist/{collection-facade-QN5ULWYC.js.map → collection-facade-VBM35WAH.js.map} +0 -0
- /package/dist/{computed-6G5M3UPH.js.map → computed-GSTLWSY5.js.map} +0 -0
- /package/dist/{dead-filter-ENRIOQIE.js.map → dead-filter-UALP5DJX.js.map} +0 -0
- /package/dist/{derive-6V3PIZF7.js.map → derive-YUO3TQYN.js.map} +0 -0
- /package/dist/{dispatch-RE74SH6L.js.map → dispatch-4ZHLSFZQ.js.map} +0 -0
- /package/dist/{dispatch-BDVGYC6X.js.map → dispatch-77CB75KB.js.map} +0 -0
- /package/dist/{enclave-52VUXNRL.js.map → enclave-O4NOROCJ.js.map} +0 -0
- /package/dist/{executor-CYJQLKKI.js.map → executor-CZDXBXKE.js.map} +0 -0
- /package/dist/{executor-FHHLXO4Y.js.map → executor-DVJAWN3B.js.map} +0 -0
- /package/dist/{executor-S4QIKEHW.js.map → executor-VRLG4TQJ.js.map} +0 -0
- /package/dist/{export-accessible-PE5AYKZR.js.map → export-accessible-UXSMG7AB.js.map} +0 -0
- /package/dist/{extract-partition-X2L26O6A.js.map → extract-partition-TVY7AMKH.js.map} +0 -0
- /package/dist/{find-RBBYKXI7.js.map → find-WSARMJBW.js.map} +0 -0
- /package/dist/{issue-RNU55YOF.js.map → issue-3JNJNPT3.js.map} +0 -0
- /package/dist/{ledger-4WJL66BW.js.map → ledger-MVPNG5OS.js.map} +0 -0
- /package/dist/{liberate-PX4CAT5V.js.map → liberate-4LOJOLDT.js.map} +0 -0
- /package/dist/{link-set-N4ZPV6E6.js.map → link-set-3POMQR3I.js.map} +0 -0
- /package/dist/{managed-secret-OTHS64IF.js.map → managed-secret-IARIJJ7Q.js.map} +0 -0
- /package/dist/{noydb-YPSEGK32.js.map → noydb-IRILUDED.js.map} +0 -0
- /package/dist/{post-register-ZAG2CAIY.js.map → post-register-Z5T7FY45.js.map} +0 -0
- /package/dist/{register-TMD6YRCX.js.map → register-UZ37QPDB.js.map} +0 -0
- /package/dist/{registry-CZVINVQH.js.map → registry-ETJNA7PO.js.map} +0 -0
- /package/dist/{registry-FVLDWQKT.js.map → registry-F7U6KSLX.js.map} +0 -0
- /package/dist/{registry-IKUR2MXD.js.map → registry-L4ELKX6C.js.map} +0 -0
- /package/dist/{registry-JET4HBLY.js.map → registry-SDT5LIGO.js.map} +0 -0
- /package/dist/{request-withdrawal-RH55LNZL.js.map → request-withdrawal-PVFEYX57.js.map} +0 -0
- /package/dist/{reveal-CMOJY4VO.js.map → reveal-DQ2E3QAZ.js.map} +0 -0
- /package/dist/{revoke-R5TBYVA6.js.map → revoke-YXY6SHUH.js.map} +0 -0
- /package/dist/{signer-AGALOXOO.js.map → signer-Q7XQBMPA.js.map} +0 -0
- /package/dist/{stale-ZWXSOWJI.js.map → stale-NI7SAXAZ.js.map} +0 -0
- /package/dist/{storage-N7LB275C.js.map → storage-3VNGSHXS.js.map} +0 -0
- /package/dist/{ulid-PTAIMDG4.js.map → ulid-VQW6ERQN.js.map} +0 -0
- /package/dist/{verify-RO5RTZOJ.js.map → verify-6J2YLKSO.js.map} +0 -0
- /package/dist/{walk-OCUHCYJ6.js.map → walk-WRA7RAPY.js.map} +0 -0
- /package/dist/{withdraw-accessible-QQNWM5BO.js.map → withdraw-accessible-4JTDFRFZ.js.map} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1096 — the authenticated half of a `_keyring` file's AUTHORITY.
|
|
3
|
+
*
|
|
4
|
+
* A `_keyring` file is stored plaintext (`_iv: ''`) so admins can edit a
|
|
5
|
+
* member's authority without holding that member's credential. That means
|
|
6
|
+
* `role`/`permissions` were authenticated by NOTHING — a hostile store could
|
|
7
|
+
* promote a viewer to admin by editing one word (proven in
|
|
8
|
+
* `__tests__/keyring-replay-escalation.test.ts`).
|
|
9
|
+
*
|
|
10
|
+
* The fix is a vault-wide ROSTER KEY, carried as a reserved DEK-map entry
|
|
11
|
+
* (`deks['_roster']`, see `ROSTER_KEY_ID`) so it reaches every member through
|
|
12
|
+
* the channels a DEK already travels — grant's `_`-prefix propagation,
|
|
13
|
+
* `persistKeyring`, the wrapped-DEKs recovery blob, `peer-recover`, pod
|
|
14
|
+
* recipient slots — and a `roster_tag`: AES-GCM of the canonical authority
|
|
15
|
+
* fields under that key. Every roster EDITOR holds the key (constraint:
|
|
16
|
+
* admins edit authority they don't hold the target's credential for) — which
|
|
17
|
+
* is what sets the bound below.
|
|
18
|
+
*
|
|
19
|
+
* `user_id` is inside the canonical string so a genuine tag cannot be
|
|
20
|
+
* transplanted onto another member's file.
|
|
21
|
+
*
|
|
22
|
+
* ## What "authority half" does NOT cover
|
|
23
|
+
*
|
|
24
|
+
* The canonical string is exactly {@link RosterAuthorityFields} — the fields a
|
|
25
|
+
* privilege decision reads. Other plaintext fields are deliberately excluded
|
|
26
|
+
* and REMAIN FORGEABLE by the store: `display_name` (cosmetic), `policy`
|
|
27
|
+
* (round-tripped, never enforced at v1.0), `echo` and `authenticators` (each
|
|
28
|
+
* authenticated by its own wrapped key material — a forged one fails to
|
|
29
|
+
* unlock rather than granting anything), plus `created_at` / `salt` /
|
|
30
|
+
* `_noydb_keyring`. Adding a field to the tag means adding it to
|
|
31
|
+
* `rosterCanonical`; nothing else here is a claim about it.
|
|
32
|
+
*
|
|
33
|
+
* ## The bound
|
|
34
|
+
*
|
|
35
|
+
* This stops the STORE, which holds no keys. It deliberately does NOT stop a
|
|
36
|
+
* malicious MEMBER: every roster editor must hold the roster key, so anyone
|
|
37
|
+
* who legitimately holds it can forge any authority field for any member.
|
|
38
|
+
* That bound must be stated in `SECURITY.md` (tracked as part of the #1096
|
|
39
|
+
* PR) — it is not written there yet.
|
|
40
|
+
*/
|
|
41
|
+
import type { KeyringFile } from '../../kernel/types.js';
|
|
42
|
+
import type { EnclaveKey } from '../../kernel/enclave/index.js';
|
|
43
|
+
export interface RosterTag {
|
|
44
|
+
readonly iv: string;
|
|
45
|
+
readonly data: string;
|
|
46
|
+
}
|
|
47
|
+
export type RosterAuthorityFields = Pick<KeyringFile, 'user_id' | 'role' | 'permissions' | 'granted_by' | 'expires_at' | 'export_capability' | 'import_capability'>;
|
|
48
|
+
export declare function rosterCanonical(file: RosterAuthorityFields): string;
|
|
49
|
+
export declare function mintRosterTag(file: RosterAuthorityFields, rosterKey: EnclaveKey): Promise<RosterTag>;
|
|
50
|
+
/**
|
|
51
|
+
* false on decrypt failure OR canonical mismatch — never throws.
|
|
52
|
+
*
|
|
53
|
+
* `null` is accepted alongside `undefined` because the tag arrives from
|
|
54
|
+
* JSON a store controls: `"roster_tag": null` is a shape the type system
|
|
55
|
+
* says is impossible and the wire permits.
|
|
56
|
+
*/
|
|
57
|
+
export declare function verifyRosterTag(file: RosterAuthorityFields, tag: RosterTag | undefined | null, rosterKey: EnclaveKey): Promise<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* #1096 — THE CHOKEPOINT. Verify a keyring file's plaintext AUTHORITY half
|
|
60
|
+
* against the roster key carried in its own, already-unwrapped, DEK set.
|
|
61
|
+
* Throws {@link KeyringTamperedError}; returns silently when the roster is
|
|
62
|
+
* authentic.
|
|
63
|
+
*
|
|
64
|
+
* **Every path that builds an `UnlockedKeyring` from a `KeyringFile` must call
|
|
65
|
+
* this — not just `loadKeyring`.** A tier-2 unlock that reconstructs
|
|
66
|
+
* `role`/`permissions` from the plaintext header without it accepts exactly
|
|
67
|
+
* the forgery tier-1 refuses, and the vault is only as strong as its weakest
|
|
68
|
+
* unlock path. That is not hypothetical: the wrap-DEKs password path shipped
|
|
69
|
+
* in this state until it was caught in review.
|
|
70
|
+
*
|
|
71
|
+
* Deliberately says nothing about the canary. The canary proves the KEK, and
|
|
72
|
+
* tier-2 paths have no KEK to prove — the roster key they hold comes from the
|
|
73
|
+
* slot's own wrapped-DEK blob, which is authenticated by its own AES-GCM tag.
|
|
74
|
+
* Callers that DO hold a KEK check the canary separately, before this.
|
|
75
|
+
*
|
|
76
|
+
* @param deks the caller's UNWRAPPED DEK set — a roster key here is proof of
|
|
77
|
+
* possession, so this must never be handed a map built from unverified input.
|
|
78
|
+
*/
|
|
79
|
+
export declare function assertRosterAuthenticated(file: KeyringFile, deks: ReadonlyMap<string, EnclaveKey>, userId: string): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* #1096 — VERIFY BEFORE YOU TRUST, and especially before you RESTAMP.
|
|
82
|
+
*
|
|
83
|
+
* The sibling of {@link assertRosterAuthenticated} for the other half of the
|
|
84
|
+
* problem. That one guards paths that *unlock* a keyring; this one guards paths
|
|
85
|
+
* that **read another member's file** — because the roster key is vault-wide, a
|
|
86
|
+
* caller holding it can verify any member's tag, not just their own.
|
|
87
|
+
*
|
|
88
|
+
* Every read-modify-write on a member's roster must call this **before** the
|
|
89
|
+
* modify. A flow that reads a forged file, edits one field and restamps does
|
|
90
|
+
* not merely tolerate the forgery — it **launders** it, converting a file
|
|
91
|
+
* `loadKeyring` refuses into one it accepts, under a genuine tag. `revoke`
|
|
92
|
+
* calls into such a flow unconditionally, so without this a single forged
|
|
93
|
+
* member plus any later revocation anywhere in the vault is a complete bypass.
|
|
94
|
+
*
|
|
95
|
+
* Fail-closed, deliberately: a forged member's file aborts the operation rather
|
|
96
|
+
* than being skipped. Skipping would complete the revoke while leaving the
|
|
97
|
+
* forgery in place, and an untrusted store can already refuse writes — so the
|
|
98
|
+
* availability it costs was never guaranteed, while the integrity it buys is
|
|
99
|
+
* the point of the mechanism.
|
|
100
|
+
*/
|
|
101
|
+
export declare function assertRosterTagValid(file: KeyringFile, rosterKey: EnclaveKey, userId: string): Promise<void>;
|
|
@@ -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
|
/**
|
|
@@ -13,7 +13,7 @@ export declare const BLOB_COLLECTION = "_blob";
|
|
|
13
13
|
/** Stores `BlobObject` metadata envelopes, keyed by eTag. */
|
|
14
14
|
export declare const BLOB_INDEX_COLLECTION = "_blob_index";
|
|
15
15
|
/**
|
|
16
|
-
* Stores encrypted chunk envelopes, keyed by `{eTag}
|
|
16
|
+
* Stores encrypted chunk envelopes, keyed by `{eTag}_{chunkIndex}`.
|
|
17
17
|
* NOT loaded into the in-memory query layer. Fetched on demand by
|
|
18
18
|
* `BlobSet.get()` / `BlobSet.response()`.
|
|
19
19
|
*/
|
|
@@ -39,7 +39,7 @@ export declare const DEFAULT_CHUNK_SIZE: number;
|
|
|
39
39
|
*
|
|
40
40
|
* ```
|
|
41
41
|
* _blob_index/{eTag} BlobObject metadata (vault-shared DEK)
|
|
42
|
-
* _blob_chunks/{eTag}
|
|
42
|
+
* _blob_chunks/{eTag}_{chunkIndex} Encrypted chunk data (vault-shared DEK + AAD)
|
|
43
43
|
* _blob_slots_{collection}/{recordId} Slot map (parent collection DEK)
|
|
44
44
|
* _blob_versions_{collection}/{recordId}/{slot}/{label} Published versions (parent collection DEK)
|
|
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
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FROZEN_SNAPSHOTS_COLLECTION,
|
|
3
|
+
freezeAndDeleteClosure,
|
|
4
|
+
freezeSnapshotOnly,
|
|
5
|
+
randomId,
|
|
6
|
+
withdrawAccessibleData
|
|
7
|
+
} from "./chunk-5Q7AJ7DN.js";
|
|
8
|
+
import "./chunk-GBBDFE6C.js";
|
|
9
|
+
import "./chunk-QSIEL6TL.js";
|
|
10
|
+
import "./chunk-S56VYR4Q.js";
|
|
11
|
+
import "./chunk-OHOKBMTM.js";
|
|
12
|
+
import "./chunk-PENPHA45.js";
|
|
13
|
+
import "./chunk-GQXFOAYZ.js";
|
|
14
|
+
import "./chunk-KV6JM2IA.js";
|
|
15
|
+
import "./chunk-TMBSPLUG.js";
|
|
16
|
+
import "./chunk-LP7BEXCT.js";
|
|
17
|
+
import "./chunk-AU3AUJIZ.js";
|
|
18
|
+
import "./chunk-IGNJOJEP.js";
|
|
19
|
+
import "./chunk-CWM4GQD2.js";
|
|
20
|
+
import "./chunk-PZ5AY32C.js";
|
|
21
|
+
export {
|
|
22
|
+
FROZEN_SNAPSHOTS_COLLECTION,
|
|
23
|
+
freezeAndDeleteClosure,
|
|
24
|
+
freezeSnapshotOnly,
|
|
25
|
+
randomId,
|
|
26
|
+
withdrawAccessibleData
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=withdraw-accessible-4JTDFRFZ.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noy-db/hub",
|
|
3
|
-
"version": "0.6.0-pre.
|
|
3
|
+
"version": "0.6.0-pre.21",
|
|
4
4
|
"description": "Zero-knowledge, offline-first, encrypted document store — core library with AES-256-GCM, PBKDF2, multi-user keyring, and sync engine",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "vLannaAi <vicio@lanna.ai>",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./codemods/0.4.0-pre.json": "./codemods/0.4.0-pre.json",
|
|
23
24
|
"./i18n": {
|
|
24
25
|
"types": "./dist/via/i18n/index.d.ts",
|
|
25
26
|
"default": "./dist/i18n/index.js"
|
|
@@ -36,6 +37,10 @@
|
|
|
36
37
|
"types": "./dist/with-party/session/index.d.ts",
|
|
37
38
|
"default": "./dist/session/index.js"
|
|
38
39
|
},
|
|
40
|
+
"./vault-head": {
|
|
41
|
+
"types": "./dist/with-commit/vault-head/index.d.ts",
|
|
42
|
+
"default": "./dist/vault-head/index.js"
|
|
43
|
+
},
|
|
39
44
|
"./history": {
|
|
40
45
|
"types": "./dist/with-commit/history/index.d.ts",
|
|
41
46
|
"default": "./dist/history/index.js"
|
|
@@ -195,27 +200,30 @@
|
|
|
195
200
|
"./reduce": {
|
|
196
201
|
"types": "./dist/with-lookup/reduce/index.d.ts",
|
|
197
202
|
"default": "./dist/reduce/index.js"
|
|
198
|
-
}
|
|
203
|
+
},
|
|
204
|
+
"./codemods/0.6.0-pre.json": "./codemods/0.6.0-pre.json"
|
|
199
205
|
},
|
|
200
206
|
"module": "./dist/index.js",
|
|
201
207
|
"types": "./dist/index.d.ts",
|
|
202
208
|
"files": [
|
|
203
209
|
"dist",
|
|
204
210
|
"README.md",
|
|
205
|
-
"
|
|
211
|
+
"CHANGELOG.md",
|
|
212
|
+
"LICENSE",
|
|
213
|
+
"codemods"
|
|
206
214
|
],
|
|
207
215
|
"engines": {
|
|
208
216
|
"node": ">=22.0.0"
|
|
209
217
|
},
|
|
210
218
|
"dependencies": {
|
|
211
|
-
"@noy-db/attestation": "0.6.0-pre.
|
|
219
|
+
"@noy-db/attestation": "0.6.0-pre.21"
|
|
212
220
|
},
|
|
213
221
|
"devDependencies": {
|
|
214
222
|
"@types/node": "^22.0.0",
|
|
215
223
|
"esbuild": "^0.25.0",
|
|
216
224
|
"zod": "^4.0.0",
|
|
217
225
|
"zod-to-json-schema": "^3.25.2",
|
|
218
|
-
"@noy-db/on-shamir": "0.6.0-pre.
|
|
226
|
+
"@noy-db/on-shamir": "0.6.0-pre.21"
|
|
219
227
|
},
|
|
220
228
|
"peerDependencies": {
|
|
221
229
|
"zod-to-json-schema": "^3.25.0"
|