@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TierWriteRefusedError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CWM4GQD2.js";
|
|
4
4
|
|
|
5
5
|
// src/kernel/tier-visibility.ts
|
|
6
6
|
async function peekLiveTier(adapter, vault, name, id) {
|
|
@@ -27,11 +27,16 @@ async function assertCutoverTierSafe(adapter, vault, name, tiersEnabled) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
function dekKey(collection, tier) {
|
|
31
|
+
if (tier <= 0) return collection;
|
|
32
|
+
return `${collection}#${tier}`;
|
|
33
|
+
}
|
|
30
34
|
|
|
31
35
|
export {
|
|
32
36
|
liveRecordIsElevated,
|
|
33
37
|
liveRecordTier,
|
|
34
38
|
assertTierWritable,
|
|
35
|
-
assertCutoverTierSafe
|
|
39
|
+
assertCutoverTierSafe,
|
|
40
|
+
dekKey
|
|
36
41
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-PPCOKVFA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/kernel/tier-visibility.ts"],"sourcesContent":["/**\n * Tier visibility helper (#712/#707): a tier-0 code path treats an elevated\n * (_tier > 0) record as invisible. History reads gate on the LIVE record's\n * tier — history snapshots keep their tier-0-wrapped CEKs and carry no _tier\n * of their own, so an elevated record's prior versions would otherwise stay\n * tier-0-decryptable (the read-gate closes the API surface; #712's at-rest\n * arc rewraps the snapshot keys). Envelope inspection only — no decryption.\n *\n * #715/#716: the write ring. Invisibility on the read side is exactly what\n * makes a tier-0 write path treat an elevated record as absent — a put()\n * believes it's a create (demotion) and a delete() writes a marker with no\n * _tier (erasing the elevation signal). `assertTierWritable` closes that by\n * refusing the write outright. Both helpers share a single envelope peek\n * (`peekLiveTier`) — no duplicated `adapter.get` per write.\n */\nimport type { NoydbStore } from './types.js'\nimport { TierWriteRefusedError } from './errors.js'\n\nasync function peekLiveTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n const env = await adapter.get(vault, name, id)\n return env?._tier ?? 0\n}\n\nexport async function liveRecordIsElevated(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<boolean> {\n return (await peekLiveTier(adapter, vault, name, id)) > 0\n}\n\n/**\n * The tier a record's LIVE envelope currently carries (0 if untiered or\n * never moved). #724 Task 4: `BlobSet.loadSlots`/`saveSlots` use this to\n * resolve the per-record slot map's collection DEK at the record's current\n * tier by default, so the slot map's physical location follows the record\n * after `rehomeForTier` re-keys it.\n */\nexport async function liveRecordTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n return peekLiveTier(adapter, vault, name, id)\n}\n\n/**\n * Refuses a tier-0 `put()`/`delete()` targeting an elevated record.\n * No-op when `tiersEnabled` is false (the cost gate — collections that\n * never declare tiers pay nothing). Throws `TierWriteRefusedError` with\n * the record's ACTUAL live tier when elevated — holders included, since\n * `put()`/`delete()` are the tier-0 APIs and `putAtTier`/`elevate`/`demote`\n * are the sanctioned tier-aware paths.\n */\nexport async function assertTierWritable(\n adapter: NoydbStore, vault: string, name: string, id: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) throw new TierWriteRefusedError(name, tier)\n}\n\n/**\n * #708: ALL-OR-NOTHING pre-check for a coordinated-cutover bulk-rewrite —\n * scans every id's live tier BEFORE any record is transformed and refuses\n * on the first elevated one found. `_applyCutoverTransform` re-encrypts at\n * tier 0 with no gate of its own; without this, it would silently demote\n * an elevated record. Same cost gate as `assertTierWritable` (no-op, no\n * adapter call, when `tiersEnabled` is false).\n *\n * This pre-check guards against an ordinary `put()`/`delete()` racing the\n * cutover, because those go through the schema fence (`SchemaFenceController`\n * blocks concurrent writes during a coordinated cutover). It does NOT guard\n * against `elevate()`/`demote()`/`putAtTier()` — those tier-move paths bypass\n * the fence, so a tier move landing between this scan and the rewrite it\n * gates is not excluded. Cutover callers are expected to hold the vault\n * quiescent for tier moves on this collection for the duration of the call,\n * the same tier-quiescence assumption the documented CAS-less caller\n * (`with-shape/satellites/migrate-cek.ts`'s \"No-quiesce precondition\") makes\n * explicit for concurrent writes generally.\n */\nexport async function assertCutoverTierSafe(\n adapter: NoydbStore, vault: string, name: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n for (const id of await adapter.list(vault, name)) {\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) {\n throw new TierWriteRefusedError(name, tier, `Coordinated cutover on collection \"${name}\" refused — record \"${id}\" is elevated to tier ${tier}. Demote it before a coordinated cutover.`)\n }\n }\n}\n"],"mappings":";;;;;AAkBA,eAAe,aACb,SAAqB,OAAe,MAAc,IACjC;AACjB,QAAM,MAAM,MAAM,QAAQ,IAAI,OAAO,MAAM,EAAE;AAC7C,SAAO,KAAK,SAAS;AACvB;AAEA,eAAsB,qBACpB,SAAqB,OAAe,MAAc,IAChC;AAClB,SAAQ,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE,IAAK;AAC1D;AASA,eAAsB,eACpB,SAAqB,OAAe,MAAc,IACjC;AACjB,SAAO,aAAa,SAAS,OAAO,MAAM,EAAE;AAC9C;AAUA,eAAsB,mBACpB,SAAqB,OAAe,MAAc,IAAY,cAC/C;AACf,MAAI,CAAC,aAAc;AACnB,QAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,MAAI,OAAO,EAAG,OAAM,IAAI,sBAAsB,MAAM,IAAI;AAC1D;AAqBA,eAAsB,sBACpB,SAAqB,OAAe,MAAc,cACnC;AACf,MAAI,CAAC,aAAc;AACnB,aAAW,MAAM,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;AAChD,UAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,QAAI,OAAO,GAAG;AACZ,YAAM,IAAI,sBAAsB,MAAM,MAAM,sCAAsC,IAAI,4BAAuB,EAAE,yBAAyB,IAAI,2CAA2C;AAAA,IACzL;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/kernel/tier-visibility.ts"],"sourcesContent":["/**\n * Tier visibility helper (#712/#707): a tier-0 code path treats an elevated\n * (_tier > 0) record as invisible. History reads gate on the LIVE record's\n * tier — history snapshots keep their tier-0-wrapped CEKs and carry no _tier\n * of their own, so an elevated record's prior versions would otherwise stay\n * tier-0-decryptable (the read-gate closes the API surface; #712's at-rest\n * arc rewraps the snapshot keys). Envelope inspection only — no decryption.\n *\n * #715/#716: the write ring. Invisibility on the read side is exactly what\n * makes a tier-0 write path treat an elevated record as absent — a put()\n * believes it's a create (demotion) and a delete() writes a marker with no\n * _tier (erasing the elevation signal). `assertTierWritable` closes that by\n * refusing the write outright. Both helpers share a single envelope peek\n * (`peekLiveTier`) — no duplicated `adapter.get` per write.\n */\nimport type { NoydbStore } from './types.js'\nimport { TierWriteRefusedError } from './errors.js'\n\nasync function peekLiveTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n const env = await adapter.get(vault, name, id)\n return env?._tier ?? 0\n}\n\nexport async function liveRecordIsElevated(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<boolean> {\n return (await peekLiveTier(adapter, vault, name, id)) > 0\n}\n\n/**\n * The tier a record's LIVE envelope currently carries (0 if untiered or\n * never moved). #724 Task 4: `BlobSet.loadSlots`/`saveSlots` use this to\n * resolve the per-record slot map's collection DEK at the record's current\n * tier by default, so the slot map's physical location follows the record\n * after `rehomeForTier` re-keys it.\n */\nexport async function liveRecordTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n return peekLiveTier(adapter, vault, name, id)\n}\n\n/**\n * Refuses a tier-0 `put()`/`delete()` targeting an elevated record.\n * No-op when `tiersEnabled` is false (the cost gate — collections that\n * never declare tiers pay nothing). Throws `TierWriteRefusedError` with\n * the record's ACTUAL live tier when elevated — holders included, since\n * `put()`/`delete()` are the tier-0 APIs and `putAtTier`/`elevate`/`demote`\n * are the sanctioned tier-aware paths.\n */\nexport async function assertTierWritable(\n adapter: NoydbStore, vault: string, name: string, id: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) throw new TierWriteRefusedError(name, tier)\n}\n\n/**\n * #708: ALL-OR-NOTHING pre-check for a coordinated-cutover bulk-rewrite —\n * scans every id's live tier BEFORE any record is transformed and refuses\n * on the first elevated one found. `_applyCutoverTransform` re-encrypts at\n * tier 0 with no gate of its own; without this, it would silently demote\n * an elevated record. Same cost gate as `assertTierWritable` (no-op, no\n * adapter call, when `tiersEnabled` is false).\n *\n * This pre-check guards against an ordinary `put()`/`delete()` racing the\n * cutover, because those go through the schema fence (`SchemaFenceController`\n * blocks concurrent writes during a coordinated cutover). It does NOT guard\n * against `elevate()`/`demote()`/`putAtTier()` — those tier-move paths bypass\n * the fence, so a tier move landing between this scan and the rewrite it\n * gates is not excluded. Cutover callers are expected to hold the vault\n * quiescent for tier moves on this collection for the duration of the call,\n * the same tier-quiescence assumption the documented CAS-less caller\n * (`with-shape/satellites/migrate-cek.ts`'s \"No-quiesce precondition\") makes\n * explicit for concurrent writes generally.\n */\nexport async function assertCutoverTierSafe(\n adapter: NoydbStore, vault: string, name: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n for (const id of await adapter.list(vault, name)) {\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) {\n throw new TierWriteRefusedError(name, tier, `Coordinated cutover on collection \"${name}\" refused — record \"${id}\" is elevated to tier ${tier}. Demote it before a coordinated cutover.`)\n }\n }\n}\n\n/**\n * The key a collection's DEK is stored under in `UnlockedKeyring.deks` for a\n * given tier: `collection` at tier 0, `collection#N` above it.\n *\n * Lives in the kernel because the `deks` map is a kernel type and the kernel\n * reads it — `noydb.ts` needs this to resolve the right DEK when verifying a\n * pulled envelope (#1042). `with-party/team/tiers.ts` re-exports it, so every\n * existing importer is unchanged; the definition simply moved to the layer that\n * owns the map rather than one that happens to use it.\n *\n * This move was forced by `port-layering`, and rightly: the alternative was the\n * kernel spine statically importing a `with-*` service, or duplicating the\n * naming convention in two places where it could drift.\n */\nexport function dekKey(collection: string, tier: number): string {\n if (tier <= 0) return collection\n return `${collection}#${tier}`\n}\n"],"mappings":";;;;;AAkBA,eAAe,aACb,SAAqB,OAAe,MAAc,IACjC;AACjB,QAAM,MAAM,MAAM,QAAQ,IAAI,OAAO,MAAM,EAAE;AAC7C,SAAO,KAAK,SAAS;AACvB;AAEA,eAAsB,qBACpB,SAAqB,OAAe,MAAc,IAChC;AAClB,SAAQ,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE,IAAK;AAC1D;AASA,eAAsB,eACpB,SAAqB,OAAe,MAAc,IACjC;AACjB,SAAO,aAAa,SAAS,OAAO,MAAM,EAAE;AAC9C;AAUA,eAAsB,mBACpB,SAAqB,OAAe,MAAc,IAAY,cAC/C;AACf,MAAI,CAAC,aAAc;AACnB,QAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,MAAI,OAAO,EAAG,OAAM,IAAI,sBAAsB,MAAM,IAAI;AAC1D;AAqBA,eAAsB,sBACpB,SAAqB,OAAe,MAAc,cACnC;AACf,MAAI,CAAC,aAAc;AACnB,aAAW,MAAM,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;AAChD,UAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,QAAI,OAAO,GAAG;AACZ,YAAM,IAAI,sBAAsB,MAAM,MAAM,sCAAsC,IAAI,4BAAuB,EAAE,yBAAyB,IAAI,2CAA2C;AAAA,IACzL;AAAA,EACF;AACF;AAgBO,SAAS,OAAO,YAAoB,MAAsB;AAC/D,MAAI,QAAQ,EAAG,QAAO;AACtB,SAAO,GAAG,UAAU,IAAI,IAAI;AAC9B;","names":[]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pickLocale
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S56VYR4Q.js";
|
|
4
4
|
import {
|
|
5
5
|
sha256Hex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AU3AUJIZ.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
PodIntegrityError,
|
|
9
|
+
PodSealMismatchError,
|
|
10
10
|
ValidationError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CWM4GQD2.js";
|
|
12
12
|
|
|
13
13
|
// src/with-pod/format.ts
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
14
|
+
var NOYDB_POD_MAGIC = new Uint8Array([78, 68, 66, 49]);
|
|
15
|
+
var NOYDB_POD_PREFIX_BYTES = 10;
|
|
16
|
+
var NOYDB_POD_FORMAT_VERSION = 1;
|
|
17
|
+
var NOYDB_POD_FORMAT_VERSION_SIGNED = 2;
|
|
18
18
|
var FLAG_COMPRESSED = 1;
|
|
19
19
|
var FLAG_HAS_INTEGRITY_HASH = 2;
|
|
20
20
|
var COMPRESSION_NONE = 0;
|
|
@@ -63,7 +63,7 @@ var REDIRECT_REASONS = /* @__PURE__ */ new Set([
|
|
|
63
63
|
"tombstone",
|
|
64
64
|
"repoint"
|
|
65
65
|
]);
|
|
66
|
-
function
|
|
66
|
+
function validatePodHeaderFields(parsed) {
|
|
67
67
|
if (parsed === null || typeof parsed !== "object") {
|
|
68
68
|
throw new Error(
|
|
69
69
|
`.noydb bundle header must be a JSON object, got ${parsed === null ? "null" : typeof parsed}`
|
|
@@ -77,9 +77,9 @@ function validateBundleHeader(parsed) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
const h = parsed;
|
|
80
|
-
if (typeof h["formatVersion"] !== "number" || h["formatVersion"] !==
|
|
80
|
+
if (typeof h["formatVersion"] !== "number" || h["formatVersion"] !== NOYDB_POD_FORMAT_VERSION && h["formatVersion"] !== NOYDB_POD_FORMAT_VERSION_SIGNED) {
|
|
81
81
|
throw new Error(
|
|
82
|
-
`.noydb bundle header.formatVersion must be ${
|
|
82
|
+
`.noydb bundle header.formatVersion must be ${NOYDB_POD_FORMAT_VERSION} or ${NOYDB_POD_FORMAT_VERSION_SIGNED}, got ${String(h["formatVersion"])}. The reader does not support forward-compat versions; upgrade the reader to handle newer bundles.`
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
if (typeof h["handle"] !== "string" || !/^[0-9A-HJKMNP-TV-Z]{26}$/.test(h["handle"])) {
|
|
@@ -264,14 +264,14 @@ function validateBundleHeader(parsed) {
|
|
|
264
264
|
`.noydb bundle header.sig, .keyId, and .sigAlg must be present together or not at all (got ${sigFieldsPresent} of 3).`
|
|
265
265
|
);
|
|
266
266
|
}
|
|
267
|
-
if (sigFieldsPresent === 3 && h["formatVersion"] !==
|
|
267
|
+
if (sigFieldsPresent === 3 && h["formatVersion"] !== NOYDB_POD_FORMAT_VERSION_SIGNED) {
|
|
268
268
|
throw new Error(
|
|
269
|
-
`.noydb bundle header with sig/keyId/sigAlg must have formatVersion === ${
|
|
269
|
+
`.noydb bundle header with sig/keyId/sigAlg must have formatVersion === ${NOYDB_POD_FORMAT_VERSION_SIGNED}, got ${String(h["formatVersion"])}.`
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
273
|
+
function encodePodHeader(header) {
|
|
274
|
+
validatePodHeaderFields(header);
|
|
275
275
|
const json = JSON.stringify({
|
|
276
276
|
formatVersion: header.formatVersion,
|
|
277
277
|
handle: header.handle,
|
|
@@ -297,7 +297,7 @@ function encodeBundleHeader(header) {
|
|
|
297
297
|
});
|
|
298
298
|
return new TextEncoder().encode(json);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function decodePodHeader(bytes) {
|
|
301
301
|
const json = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
302
302
|
let parsed;
|
|
303
303
|
try {
|
|
@@ -307,7 +307,7 @@ function decodeBundleHeader(bytes) {
|
|
|
307
307
|
`.noydb bundle header is not valid JSON: ${err.message}`
|
|
308
308
|
);
|
|
309
309
|
}
|
|
310
|
-
|
|
310
|
+
validatePodHeaderFields(parsed);
|
|
311
311
|
return parsed;
|
|
312
312
|
}
|
|
313
313
|
function readUint32BE(bytes, offset) {
|
|
@@ -319,10 +319,10 @@ function writeUint32BE(bytes, offset, value) {
|
|
|
319
319
|
bytes[offset + 2] = value >>> 8 & 255;
|
|
320
320
|
bytes[offset + 3] = value & 255;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
if (bytes.length <
|
|
324
|
-
for (let i = 0; i <
|
|
325
|
-
if (bytes[i] !==
|
|
322
|
+
function hasNoydbPodMagic(bytes) {
|
|
323
|
+
if (bytes.length < NOYDB_POD_MAGIC.length) return false;
|
|
324
|
+
for (let i = 0; i < NOYDB_POD_MAGIC.length; i++) {
|
|
325
|
+
if (bytes[i] !== NOYDB_POD_MAGIC[i]) return false;
|
|
326
326
|
}
|
|
327
327
|
return true;
|
|
328
328
|
}
|
|
@@ -340,7 +340,42 @@ async function verifyRecord(publicKeyB64, sig, payload) {
|
|
|
340
340
|
return ed25519Verify(publicKeyB64, sig, signedBytes(payload));
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
// src/with-pod/
|
|
343
|
+
// src/with-pod/pod.ts
|
|
344
|
+
var WRITE_POD_OPTION_KEYS = [
|
|
345
|
+
"compression",
|
|
346
|
+
"collections",
|
|
347
|
+
"since",
|
|
348
|
+
"where",
|
|
349
|
+
"tierAtMost",
|
|
350
|
+
"exportSecret",
|
|
351
|
+
"recipients",
|
|
352
|
+
"autoCredentials",
|
|
353
|
+
"sealedCredentials",
|
|
354
|
+
"autoSecrets",
|
|
355
|
+
"sealedSecrets",
|
|
356
|
+
"sign",
|
|
357
|
+
"engineRange",
|
|
358
|
+
"unlockMethods",
|
|
359
|
+
"hasApp",
|
|
360
|
+
"species",
|
|
361
|
+
"pointerMode",
|
|
362
|
+
"redirect"
|
|
363
|
+
];
|
|
364
|
+
var RETIRED_WRITE_POD_OPTIONS = {
|
|
365
|
+
autoPassphrases: "autoCredentials",
|
|
366
|
+
sealedPassphrases: "sealedCredentials",
|
|
367
|
+
exportPassphrase: "exportSecret"
|
|
368
|
+
};
|
|
369
|
+
function assertKnownWritePodOptions(opts) {
|
|
370
|
+
const known = new Set(WRITE_POD_OPTION_KEYS);
|
|
371
|
+
for (const [key, value] of Object.entries(opts)) {
|
|
372
|
+
if (value === void 0 || known.has(key)) continue;
|
|
373
|
+
const replacement = RETIRED_WRITE_POD_OPTIONS[key];
|
|
374
|
+
throw new Error(
|
|
375
|
+
replacement !== void 0 ? `writePod: \`${key}\` was renamed to \`${replacement}\`. Passing the old key would have written a pod without that slot \u2014 see the 0.4.0-pre migration note.` : `writePod: unknown option \`${key}\`. Options are not ignored \u2014 a dropped write option produces a pod that is silently missing something. Known keys: ${WRITE_POD_OPTION_KEYS.join(", ")}.`
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
344
379
|
function toAutoCredentials(m) {
|
|
345
380
|
return Object.fromEntries(
|
|
346
381
|
Object.entries(m).map(([u, value]) => [u, { kind: "secret", value }])
|
|
@@ -527,30 +562,30 @@ function parseAutoUnlockBody(bodyString) {
|
|
|
527
562
|
try {
|
|
528
563
|
parsed = JSON.parse(bodyString);
|
|
529
564
|
} catch (err) {
|
|
530
|
-
throw new
|
|
565
|
+
throw new PodIntegrityError(
|
|
531
566
|
"header declared autoUnlock but body could not be parsed as JSON wrapper: " + (err instanceof Error ? err.message : String(err))
|
|
532
567
|
);
|
|
533
568
|
}
|
|
534
569
|
if (typeof parsed !== "object" || parsed === null) {
|
|
535
|
-
throw new
|
|
570
|
+
throw new PodIntegrityError("autoUnlock body is not a JSON object");
|
|
536
571
|
}
|
|
537
572
|
const obj = parsed;
|
|
538
573
|
if (obj["_noydb_bundle_body"] !== 1) {
|
|
539
|
-
throw new
|
|
574
|
+
throw new PodIntegrityError(
|
|
540
575
|
"autoUnlock body missing `_noydb_bundle_body: 1` discriminator"
|
|
541
576
|
);
|
|
542
577
|
}
|
|
543
578
|
if (typeof obj["dump"] !== "string") {
|
|
544
|
-
throw new
|
|
579
|
+
throw new PodIntegrityError("autoUnlock body must carry a string `dump` field");
|
|
545
580
|
}
|
|
546
581
|
const blob = obj["_autoUnlock"];
|
|
547
582
|
if (typeof blob !== "object" || blob === null) {
|
|
548
|
-
throw new
|
|
583
|
+
throw new PodIntegrityError("autoUnlock body missing `_autoUnlock` blob");
|
|
549
584
|
}
|
|
550
585
|
const blobObj = blob;
|
|
551
586
|
const kind = blobObj["kind"];
|
|
552
587
|
if (kind !== "unsealed" && kind !== "sealed") {
|
|
553
|
-
throw new
|
|
588
|
+
throw new PodIntegrityError(
|
|
554
589
|
`autoUnlock blob has invalid kind ${String(kind)}; expected 'unsealed' or 'sealed'`
|
|
555
590
|
);
|
|
556
591
|
}
|
|
@@ -567,29 +602,29 @@ function parseExtractedPartitionBody(bodyString) {
|
|
|
567
602
|
try {
|
|
568
603
|
parsed = JSON.parse(bodyString);
|
|
569
604
|
} catch (err) {
|
|
570
|
-
throw new
|
|
605
|
+
throw new PodIntegrityError(
|
|
571
606
|
"header declared extracted-partition but body could not be parsed as JSON wrapper: " + (err instanceof Error ? err.message : String(err))
|
|
572
607
|
);
|
|
573
608
|
}
|
|
574
609
|
if (typeof parsed !== "object" || parsed === null) {
|
|
575
|
-
throw new
|
|
610
|
+
throw new PodIntegrityError("extracted-partition body is not a JSON object");
|
|
576
611
|
}
|
|
577
612
|
const obj = parsed;
|
|
578
613
|
if (obj["_noydb_bundle_body"] !== 1) {
|
|
579
|
-
throw new
|
|
614
|
+
throw new PodIntegrityError(
|
|
580
615
|
"extracted-partition body missing `_noydb_bundle_body: 1` discriminator"
|
|
581
616
|
);
|
|
582
617
|
}
|
|
583
618
|
if (typeof obj["dump"] !== "string") {
|
|
584
|
-
throw new
|
|
619
|
+
throw new PodIntegrityError("extracted-partition body must carry a string `dump` field");
|
|
585
620
|
}
|
|
586
621
|
const seal = obj["_transferSeal"];
|
|
587
622
|
if (typeof seal !== "object" || seal === null) {
|
|
588
|
-
throw new
|
|
623
|
+
throw new PodIntegrityError("extracted-partition body missing `_transferSeal` blob");
|
|
589
624
|
}
|
|
590
625
|
const s = seal;
|
|
591
626
|
if (s["v"] !== 1 || s["alg"] !== "aes-256-gcm-pre-shared" || typeof s["sealId"] !== "string" || typeof s["payload"] !== "string") {
|
|
592
|
-
throw new
|
|
627
|
+
throw new PodIntegrityError("extracted-partition `_transferSeal` blob is malformed");
|
|
593
628
|
}
|
|
594
629
|
return { dump: obj["dump"], seal };
|
|
595
630
|
}
|
|
@@ -635,7 +670,7 @@ async function resolveAutoUnlock(blob, opts) {
|
|
|
635
670
|
unsealedMap[userId] = { kind: credKind, value: entry.sealed };
|
|
636
671
|
continue;
|
|
637
672
|
}
|
|
638
|
-
throw new
|
|
673
|
+
throw new PodSealMismatchError(userId, entry.pid);
|
|
639
674
|
}
|
|
640
675
|
unsealedMap[userId] = { kind: credKind, value: opened };
|
|
641
676
|
continue;
|
|
@@ -644,7 +679,7 @@ async function resolveAutoUnlock(blob, opts) {
|
|
|
644
679
|
unsealedMap[userId] = { kind: credKind, value: entry.sealed };
|
|
645
680
|
continue;
|
|
646
681
|
}
|
|
647
|
-
throw new
|
|
682
|
+
throw new PodSealMismatchError(userId, entry.pid);
|
|
648
683
|
}
|
|
649
684
|
const plaintextBytes = await provider.unseal(base64ToBytes(entry.sealed));
|
|
650
685
|
unsealedMap[userId] = { kind: credKind, value: decoder.decode(plaintextBytes) };
|
|
@@ -777,7 +812,7 @@ async function applySatelliteLivenessFilter(vault, dumpJson) {
|
|
|
777
812
|
if (!backup.collections || typeof backup.collections !== "object") return dumpJson;
|
|
778
813
|
if (typeof vault._introspectState !== "function") return dumpJson;
|
|
779
814
|
const { adapter, name, getDEK } = vault._introspectState();
|
|
780
|
-
const { liveBaseIdSetsForBundle } = await import("./dead-filter-
|
|
815
|
+
const { liveBaseIdSetsForBundle } = await import("./dead-filter-UALP5DJX.js");
|
|
781
816
|
const satLive = await liveBaseIdSetsForBundle(adapter, name, Object.keys(backup.collections), getDEK);
|
|
782
817
|
if (satLive.size === 0) return dumpJson;
|
|
783
818
|
const next = {};
|
|
@@ -817,7 +852,8 @@ async function applyPlaintextFilters(vault, dumpJson, opts) {
|
|
|
817
852
|
if (where !== void 0) {
|
|
818
853
|
const record = await vault._decryptEnvelopeForBundleFilter(
|
|
819
854
|
env,
|
|
820
|
-
collName
|
|
855
|
+
collName,
|
|
856
|
+
id
|
|
821
857
|
);
|
|
822
858
|
const ok = await where(record, { collection: collName, id });
|
|
823
859
|
if (!ok) continue;
|
|
@@ -829,13 +865,13 @@ async function applyPlaintextFilters(vault, dumpJson, opts) {
|
|
|
829
865
|
backup.collections = next;
|
|
830
866
|
return JSON.stringify(backup);
|
|
831
867
|
}
|
|
832
|
-
async function
|
|
868
|
+
async function assemblePodContainer(opts) {
|
|
833
869
|
const dumpBytes = new TextEncoder().encode(opts.bodyJsonStr);
|
|
834
870
|
const { format, streamFormat } = selectCompression(opts.compression);
|
|
835
871
|
const body = streamFormat === null ? dumpBytes : await pumpThroughStream(dumpBytes, new CompressionStream(streamFormat));
|
|
836
872
|
const bodySha256 = await sha256Hex2(body);
|
|
837
873
|
const header = {
|
|
838
|
-
formatVersion:
|
|
874
|
+
formatVersion: NOYDB_POD_FORMAT_VERSION,
|
|
839
875
|
handle: opts.handle,
|
|
840
876
|
bodyBytes: body.length,
|
|
841
877
|
bodySha256,
|
|
@@ -851,19 +887,20 @@ async function assembleBundleContainer(opts) {
|
|
|
851
887
|
...opts.headerExtras?.redirect !== void 0 ? { redirect: opts.headerExtras.redirect } : {}
|
|
852
888
|
};
|
|
853
889
|
const signed = opts.signer === void 0 ? header : await (async (s) => {
|
|
854
|
-
const toSign = { ...header, formatVersion:
|
|
890
|
+
const toSign = { ...header, formatVersion: NOYDB_POD_FORMAT_VERSION_SIGNED, keyId: s.keyId, sigAlg: "ed25519" };
|
|
855
891
|
const sig = await signRecord(s.privateKeyPkcs8B64, toSign);
|
|
856
892
|
return { ...toSign, sig };
|
|
857
893
|
})(opts.signer);
|
|
858
|
-
const headerBytes =
|
|
859
|
-
const prefix = new Uint8Array(
|
|
860
|
-
prefix.set(
|
|
894
|
+
const headerBytes = encodePodHeader(signed);
|
|
895
|
+
const prefix = new Uint8Array(NOYDB_POD_PREFIX_BYTES);
|
|
896
|
+
prefix.set(NOYDB_POD_MAGIC, 0);
|
|
861
897
|
prefix[4] = (streamFormat === null ? 0 : FLAG_COMPRESSED) | FLAG_HAS_INTEGRITY_HASH;
|
|
862
898
|
prefix[5] = format;
|
|
863
899
|
writeUint32BE(prefix, 6, headerBytes.length);
|
|
864
900
|
return concatBytes([prefix, headerBytes, body]);
|
|
865
901
|
}
|
|
866
902
|
async function writePod(vault, opts = {}) {
|
|
903
|
+
assertKnownWritePodOptions(opts);
|
|
867
904
|
if (opts.exportSecret !== void 0 && opts.recipients !== void 0) {
|
|
868
905
|
throw new Error(
|
|
869
906
|
"writePod: pass either exportSecret or recipients, not both"
|
|
@@ -871,7 +908,7 @@ async function writePod(vault, opts = {}) {
|
|
|
871
908
|
}
|
|
872
909
|
const normalizedAutoUnlock = normalizeAutoUnlock(opts);
|
|
873
910
|
const autoUnlockMode = validateAutoUnlockOptions(opts, normalizedAutoUnlock);
|
|
874
|
-
const handle = await vault.
|
|
911
|
+
const handle = await vault.getPodHandle();
|
|
875
912
|
const dumpJson = await vault.dump();
|
|
876
913
|
const satelliteFiltered = await applySatelliteLivenessFilter(vault, dumpJson);
|
|
877
914
|
const rekeyed = await applyRecipientRewrap(vault, satelliteFiltered, opts);
|
|
@@ -880,7 +917,7 @@ async function writePod(vault, opts = {}) {
|
|
|
880
917
|
const bodyJsonStr = normalizedAutoUnlock === null ? filtered : JSON.stringify(await buildAutoUnlockWrapper(filtered, normalizedAutoUnlock));
|
|
881
918
|
const cover = await vault.getCover();
|
|
882
919
|
const signer = opts.sign === false ? void 0 : opts.sign !== void 0 ? opts.sign : await vault._loadPodSigner() ?? void 0;
|
|
883
|
-
return
|
|
920
|
+
return assemblePodContainer({
|
|
884
921
|
handle,
|
|
885
922
|
bodyJsonStr,
|
|
886
923
|
compression: opts.compression,
|
|
@@ -899,16 +936,15 @@ async function writePod(vault, opts = {}) {
|
|
|
899
936
|
...signer !== void 0 ? { signer } : {}
|
|
900
937
|
});
|
|
901
938
|
}
|
|
902
|
-
var writeNoydbBundle = writePod;
|
|
903
939
|
function parsePrefixAndHeader(bytes) {
|
|
904
|
-
if (!
|
|
940
|
+
if (!hasNoydbPodMagic(bytes)) {
|
|
905
941
|
throw new Error(
|
|
906
942
|
`Not a .noydb bundle: missing 'NDB1' magic prefix. The first 4 bytes are ${[...bytes.slice(0, 4)].map((b) => b.toString(16).padStart(2, "0")).join(" ")}.`
|
|
907
943
|
);
|
|
908
944
|
}
|
|
909
|
-
if (bytes.length <
|
|
945
|
+
if (bytes.length < NOYDB_POD_PREFIX_BYTES) {
|
|
910
946
|
throw new Error(
|
|
911
|
-
`Truncated .noydb bundle: file is only ${bytes.length} bytes, which is less than the ${
|
|
947
|
+
`Truncated .noydb bundle: file is only ${bytes.length} bytes, which is less than the ${NOYDB_POD_PREFIX_BYTES}-byte fixed prefix.`
|
|
912
948
|
);
|
|
913
949
|
}
|
|
914
950
|
const flags = bytes[4];
|
|
@@ -919,20 +955,19 @@ function parsePrefixAndHeader(bytes) {
|
|
|
919
955
|
);
|
|
920
956
|
}
|
|
921
957
|
const headerLength = readUint32BE(bytes, 6);
|
|
922
|
-
const bodyOffset =
|
|
958
|
+
const bodyOffset = NOYDB_POD_PREFIX_BYTES + headerLength;
|
|
923
959
|
if (bodyOffset > bytes.length) {
|
|
924
960
|
throw new Error(
|
|
925
961
|
`Truncated .noydb bundle: declared header length ${headerLength} would extend past end of file (${bytes.length} bytes).`
|
|
926
962
|
);
|
|
927
963
|
}
|
|
928
|
-
const headerBytes = bytes.slice(
|
|
929
|
-
const header =
|
|
964
|
+
const headerBytes = bytes.slice(NOYDB_POD_PREFIX_BYTES, bodyOffset);
|
|
965
|
+
const header = decodePodHeader(headerBytes);
|
|
930
966
|
return { header, bodyOffset, algo, flags };
|
|
931
967
|
}
|
|
932
968
|
function readPodHeader(bytes) {
|
|
933
969
|
return parsePrefixAndHeader(bytes).header;
|
|
934
970
|
}
|
|
935
|
-
var readNoydbBundleHeader = readPodHeader;
|
|
936
971
|
async function verifyPodHeader(bytes, trustedKeys) {
|
|
937
972
|
const { header } = parsePrefixAndHeader(bytes);
|
|
938
973
|
if (header.sig === void 0 || header.keyId === void 0 || header.sigAlg === void 0) {
|
|
@@ -965,13 +1000,13 @@ async function readPod(bytes, opts = {}) {
|
|
|
965
1000
|
const { header, bodyOffset, algo } = parsePrefixAndHeader(bytes);
|
|
966
1001
|
const body = bytes.slice(bodyOffset);
|
|
967
1002
|
if (body.length !== header.bodyBytes) {
|
|
968
|
-
throw new
|
|
1003
|
+
throw new PodIntegrityError(
|
|
969
1004
|
`body length ${body.length} does not match header.bodyBytes ${header.bodyBytes}. The bundle was truncated or padded between write and read.`
|
|
970
1005
|
);
|
|
971
1006
|
}
|
|
972
1007
|
const actualSha = await sha256Hex2(body);
|
|
973
1008
|
if (actualSha !== header.bodySha256) {
|
|
974
|
-
throw new
|
|
1009
|
+
throw new PodIntegrityError(
|
|
975
1010
|
`body sha256 ${actualSha} does not match header.bodySha256 ${header.bodySha256}. The bundle bytes were modified between write and read \u2014 refuse to decompress.`
|
|
976
1011
|
);
|
|
977
1012
|
}
|
|
@@ -983,7 +1018,7 @@ async function readPod(bytes, opts = {}) {
|
|
|
983
1018
|
try {
|
|
984
1019
|
dumpBytes = await pumpThroughStream(body, new DecompressionStream(streamFormat));
|
|
985
1020
|
} catch (err) {
|
|
986
|
-
throw new
|
|
1021
|
+
throw new PodIntegrityError(
|
|
987
1022
|
`decompression failed: ${err.message}. The bundle passed the integrity hash but the body is not valid ${streamFormat} data \u2014 likely a producer bug.`
|
|
988
1023
|
);
|
|
989
1024
|
}
|
|
@@ -996,20 +1031,19 @@ async function readPod(bytes, opts = {}) {
|
|
|
996
1031
|
const autoUnlock = await resolveAutoUnlock(blob, opts);
|
|
997
1032
|
return { header, dumpJson: dump, autoUnlock };
|
|
998
1033
|
}
|
|
999
|
-
var readNoydbBundle = readPod;
|
|
1000
1034
|
|
|
1001
1035
|
export {
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1036
|
+
NOYDB_POD_MAGIC,
|
|
1037
|
+
NOYDB_POD_PREFIX_BYTES,
|
|
1038
|
+
NOYDB_POD_FORMAT_VERSION,
|
|
1005
1039
|
FLAG_COMPRESSED,
|
|
1006
1040
|
FLAG_HAS_INTEGRITY_HASH,
|
|
1007
1041
|
COMPRESSION_NONE,
|
|
1008
1042
|
COMPRESSION_GZIP,
|
|
1009
1043
|
COMPRESSION_BROTLI,
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1044
|
+
validatePodHeaderFields,
|
|
1045
|
+
encodePodHeader,
|
|
1046
|
+
hasNoydbPodMagic,
|
|
1013
1047
|
POD_SIG_ALG,
|
|
1014
1048
|
signedBytes,
|
|
1015
1049
|
signRecord,
|
|
@@ -1017,15 +1051,12 @@ export {
|
|
|
1017
1051
|
buildExtractedPartitionWrapper,
|
|
1018
1052
|
parseExtractedPartitionBody,
|
|
1019
1053
|
resetBrotliSupportCache,
|
|
1020
|
-
|
|
1054
|
+
assemblePodContainer,
|
|
1021
1055
|
writePod,
|
|
1022
|
-
writeNoydbBundle,
|
|
1023
1056
|
readPodHeader,
|
|
1024
|
-
readNoydbBundleHeader,
|
|
1025
1057
|
verifyPodHeader,
|
|
1026
1058
|
readPodCover,
|
|
1027
1059
|
readPodRedirect,
|
|
1028
|
-
readPod
|
|
1029
|
-
readNoydbBundle
|
|
1060
|
+
readPod
|
|
1030
1061
|
};
|
|
1031
|
-
//# sourceMappingURL=chunk-
|
|
1062
|
+
//# sourceMappingURL=chunk-QSIEL6TL.js.map
|