@noy-db/hub 0.4.0 → 0.6.0-pre.0
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/dist/api-67SBPMMH.js +20 -0
- package/dist/attestation/index.js +18 -18
- package/dist/{backup-X7F3TCFV.js → backup-GAYWQAFN.js} +16 -11
- package/dist/backup-GAYWQAFN.js.map +1 -0
- package/dist/blobs/index.js +20 -20
- package/dist/broker/index.js +12 -12
- package/dist/bundle-handle-5OUAI7CV.js +36 -0
- package/dist/bundle-handle-5OUAI7CV.js.map +1 -0
- package/dist/cargo/index.js +36 -36
- package/dist/{chunk-DQZXPGGZ.js → chunk-24UICKTB.js} +3 -3
- package/dist/{chunk-77AEMXFA.js → chunk-24ZLWWEO.js} +1 -1
- package/dist/chunk-24ZLWWEO.js.map +1 -0
- package/dist/{chunk-2BET5QTS.js → chunk-27TCYH6G.js} +5 -5
- package/dist/{chunk-MSMJJB4J.js → chunk-2KIV7BEK.js} +2 -2
- package/dist/{chunk-6ZNSB3H6.js → chunk-2LGDCNFJ.js} +2 -2
- package/dist/{chunk-GTYFIVIZ.js → chunk-35EBKWQU.js} +5 -5
- package/dist/chunk-35EBKWQU.js.map +1 -0
- package/dist/{chunk-WBKZUO5V.js → chunk-3737A6EA.js} +3 -3
- package/dist/{chunk-ZBYFMI6D.js → chunk-3CLZY46Y.js} +638 -300
- package/dist/chunk-3CLZY46Y.js.map +1 -0
- package/dist/{chunk-HLKXPJ4V.js → chunk-3EO7RZLJ.js} +6 -6
- package/dist/{chunk-JYJFGD2H.js → chunk-3FSX6LDG.js} +2 -2
- package/dist/{chunk-MXUT7FTE.js → chunk-3HYWYLXL.js} +2 -2
- package/dist/{chunk-IVYQAVWO.js → chunk-3IIPWA75.js} +11 -11
- package/dist/{chunk-7H3WWH6J.js → chunk-3UK6STWO.js} +3 -3
- package/dist/chunk-46V67XP5.js +117 -0
- package/dist/chunk-46V67XP5.js.map +1 -0
- package/dist/{chunk-NJ4DYYO5.js → chunk-4HDYQL3J.js} +2 -2
- package/dist/{chunk-P4JO3H6R.js → chunk-4MQDV3HZ.js} +2 -2
- package/dist/{chunk-X4MVWPHV.js → chunk-4UVDI4XE.js} +3 -3
- package/dist/{chunk-LXRTP3AQ.js → chunk-4VCWI42L.js} +2 -2
- package/dist/{chunk-QJNCB5SK.js → chunk-747LRSOO.js} +2 -2
- package/dist/{chunk-3HUYRN24.js → chunk-7F4DBNSP.js} +3 -3
- package/dist/{chunk-UADPR6F4.js → chunk-7G6VDWXB.js} +3 -3
- package/dist/{chunk-PTHKZWEH.js → chunk-AHLJSVRL.js} +2 -2
- package/dist/{chunk-NFZGZ4AK.js → chunk-AR2JDFAE.js} +2 -2
- package/dist/{chunk-3ECU57YH.js → chunk-BPTZ4K5L.js} +11 -11
- package/dist/{chunk-KRCBZYTZ.js → chunk-CCZJJ4I2.js} +4 -4
- package/dist/{chunk-NYEFP7DY.js → chunk-CJ73OLMW.js} +2 -2
- package/dist/{chunk-Q36YXK77.js → chunk-CYQOUTMY.js} +3 -3
- package/dist/{chunk-RBTVFPHF.js → chunk-DCMQR46R.js} +5 -5
- package/dist/{chunk-TG634KCO.js → chunk-DG27IUVI.js} +2 -2
- package/dist/{chunk-E23UGFVC.js → chunk-DMQCLZ4Z.js} +8 -6
- package/dist/chunk-DMQCLZ4Z.js.map +1 -0
- package/dist/{chunk-ZNWSG7XC.js → chunk-DPJTDNUF.js} +68 -34
- package/dist/chunk-DPJTDNUF.js.map +1 -0
- package/dist/{chunk-V6UQZA2H.js → chunk-E6427JU2.js} +2 -2
- package/dist/{chunk-JEI6JJNI.js → chunk-EK7DT5BT.js} +220 -13
- package/dist/chunk-EK7DT5BT.js.map +1 -0
- package/dist/chunk-EPFF7LOX.js +14 -0
- package/dist/chunk-EPFF7LOX.js.map +1 -0
- package/dist/{chunk-TWPK7KUJ.js → chunk-F3GVO44K.js} +6 -6
- package/dist/{chunk-QD46HPZG.js → chunk-FAXZQ5UF.js} +2 -2
- package/dist/{chunk-IG6KUWBX.js → chunk-FNSMZQS4.js} +2 -2
- package/dist/{chunk-BLBAQRBM.js → chunk-FUHKW252.js} +2 -2
- package/dist/{chunk-SU6SGWXM.js → chunk-FY343IZR.js} +8 -8
- package/dist/{chunk-KPZS5QAQ.js → chunk-GQ3BX5EA.js} +9 -1
- package/dist/chunk-GQ3BX5EA.js.map +1 -0
- package/dist/{chunk-DAFBJS4Y.js → chunk-GS5RT2KK.js} +4 -4
- package/dist/{chunk-5UQ7Y6SQ.js → chunk-HFKGIBMD.js} +3 -3
- package/dist/{chunk-QZWTRENR.js → chunk-HNGSV2YC.js} +133 -1
- package/dist/chunk-HNGSV2YC.js.map +1 -0
- package/dist/chunk-HNHCQ556.js +63 -0
- package/dist/chunk-HNHCQ556.js.map +1 -0
- package/dist/chunk-HS7HNYBD.js +91 -0
- package/dist/chunk-HS7HNYBD.js.map +1 -0
- package/dist/{chunk-SHEEBRZ4.js → chunk-HVQGCKY4.js} +2 -2
- package/dist/{chunk-35NMVJ7I.js → chunk-HXGUIPQB.js} +3 -3
- package/dist/{chunk-ERGECZEI.js → chunk-JEM2IGS3.js} +9 -9
- package/dist/chunk-JH3OHQM4.js +260 -0
- package/dist/chunk-JH3OHQM4.js.map +1 -0
- package/dist/{chunk-L3YYLT4E.js → chunk-JIUVJ4M7.js} +2 -2
- package/dist/{chunk-55LX6FSX.js → chunk-JRCYZEHU.js} +2 -2
- package/dist/{chunk-SFBYQMZM.js → chunk-JSRU5W2M.js} +5 -5
- package/dist/{chunk-NM5UYF6Q.js → chunk-JXIDGFKS.js} +2 -2
- package/dist/{chunk-VYYM3MEN.js → chunk-KHKKD62N.js} +16 -2
- package/dist/chunk-KHKKD62N.js.map +1 -0
- package/dist/{chunk-FQ5CHJR7.js → chunk-KUDZVJKQ.js} +21 -2
- package/dist/chunk-KUDZVJKQ.js.map +1 -0
- package/dist/{chunk-RO5NM6UI.js → chunk-KZ3KMDN3.js} +2 -2
- package/dist/{chunk-HZZP2ZIG.js → chunk-LBGPO5RL.js} +6 -6
- package/dist/{chunk-ZFG5EBI3.js → chunk-LTU4FLHG.js} +57 -27
- package/dist/chunk-LTU4FLHG.js.map +1 -0
- package/dist/{chunk-CLE3TMIS.js → chunk-MC2LFTQM.js} +5 -2
- package/dist/{chunk-467SWYT5.js → chunk-MJWCLSQL.js} +17 -8
- package/dist/chunk-MJWCLSQL.js.map +1 -0
- package/dist/{chunk-W3G5REIU.js → chunk-MSWYQLMQ.js} +2 -2
- package/dist/{chunk-WK7ULBTP.js → chunk-MVOWXQHN.js} +5 -3
- package/dist/chunk-MVOWXQHN.js.map +1 -0
- package/dist/{chunk-2J6UEN2V.js → chunk-MXZ5TSTR.js} +118 -4
- package/dist/chunk-MXZ5TSTR.js.map +1 -0
- package/dist/{chunk-SGDPRCC4.js → chunk-MZ5ZFO2D.js} +3 -3
- package/dist/{chunk-NBXFCQX4.js → chunk-NQCNSVGI.js} +9 -9
- package/dist/chunk-NQCNSVGI.js.map +1 -0
- package/dist/{chunk-EFJAAFBW.js → chunk-NQRJ5AJO.js} +2 -2
- package/dist/{chunk-Q2SEJMP2.js → chunk-NVU7ZMPN.js} +2 -2
- package/dist/{chunk-ZTLOXFPB.js → chunk-OF3L2SD6.js} +2 -2
- package/dist/{chunk-LLYIMSQQ.js → chunk-OMSAULZM.js} +11 -11
- package/dist/{chunk-SF2ZIRD6.js → chunk-OSFPNKY4.js} +3 -3
- package/dist/{chunk-WUHEP3HH.js → chunk-P7NGLLUF.js} +5 -5
- package/dist/{chunk-RQ4ZI4ZI.js → chunk-PGAPBZEK.js} +7 -7
- package/dist/{chunk-T2MOJF76.js → chunk-PP5CO2PR.js} +6 -6
- package/dist/{chunk-Q5YJCVJY.js → chunk-RLWY6Z44.js} +227 -41
- package/dist/chunk-RLWY6Z44.js.map +1 -0
- package/dist/{chunk-QGIBI6GL.js → chunk-ROWL352P.js} +5 -5
- package/dist/{chunk-ZHDSUZQU.js → chunk-RPXL6KSX.js} +4 -4
- package/dist/{chunk-DTFA5DO4.js → chunk-SKONR2OL.js} +3 -3
- package/dist/{chunk-AT2JJEKJ.js → chunk-SRGJET2F.js} +16 -5
- package/dist/chunk-SRGJET2F.js.map +1 -0
- package/dist/{chunk-4ZKNC6A6.js → chunk-T4GPR2IR.js} +2 -2
- package/dist/{chunk-NLYALJMY.js → chunk-TFZ7LLOQ.js} +113 -36
- package/dist/chunk-TFZ7LLOQ.js.map +1 -0
- package/dist/{chunk-TS5XLBZR.js → chunk-TLNNHG3A.js} +4 -4
- package/dist/{chunk-6UBZ6I5Z.js → chunk-UHXCLPGC.js} +2 -2
- package/dist/{chunk-KD4HGBJV.js → chunk-V5C5NNBR.js} +4 -4
- package/dist/{chunk-WYUAEZSC.js → chunk-VBY6ZLJT.js} +15 -14
- package/dist/chunk-VBY6ZLJT.js.map +1 -0
- package/dist/{chunk-AKKRXT23.js → chunk-VCETL77O.js} +34 -16
- package/dist/chunk-VCETL77O.js.map +1 -0
- package/dist/{chunk-5GQEU4DN.js → chunk-VJFMXYKP.js} +2 -2
- package/dist/{chunk-5DRROK5W.js → chunk-VMCCGUQB.js} +2 -2
- package/dist/{chunk-IXNCZTWA.js → chunk-W3TVWF6N.js} +2 -2
- package/dist/{chunk-W66AM5IB.js → chunk-WLYIROCJ.js} +2 -2
- package/dist/{chunk-OWHP3H5C.js → chunk-XB7LUDKM.js} +4 -4
- package/dist/{chunk-KYRDJI5O.js → chunk-XBLKM73C.js} +10 -10
- package/dist/{chunk-MHMLXJ3I.js → chunk-YAWK6AWF.js} +2 -2
- package/dist/{chunk-PWPYO73B.js → chunk-ZGGVOADG.js} +5 -5
- package/dist/{chunk-YGK2HMLR.js → chunk-ZK4CO2KZ.js} +9 -9
- package/dist/chunk-ZK4CO2KZ.js.map +1 -0
- package/dist/{chunk-DSDXAKIP.js → chunk-ZVF37PKE.js} +34 -5
- package/dist/chunk-ZVF37PKE.js.map +1 -0
- package/dist/{chunk-IFOH7RBI.js → chunk-ZWMO5GL5.js} +5 -5
- package/dist/{chunk-LRRX57UA.js → chunk-ZXJXDHNK.js} +4 -4
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-LE54HWSX.js → classified-marker-MH3ON5OL.js} +3 -3
- package/dist/collection-facade-AHT7FATG.js +45 -0
- package/dist/{computed-AB45PS4V.js → computed-6G5M3UPH.js} +3 -3
- package/dist/consent/index.js +9 -9
- package/dist/cover/index.js +3 -3
- package/dist/custody/index.js +11 -11
- package/dist/{dead-filter-V3LVWYEJ.js → dead-filter-U575NGSH.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-JDUMAF6L.js → delegation-PDYL6RWT.js} +10 -10
- package/dist/derivations/index.js +12 -12
- package/dist/derive-AKT4KU36.js +22 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-6TV3DGO6.js → dispatch-4XIJSFTT.js} +5 -5
- package/dist/{dispatch-W7NWQ637.js → dispatch-N5HGVUGU.js} +18 -18
- package/dist/{enclave-YFCLPIDR.js → enclave-OPK24QDR.js} +13 -9
- package/dist/executor-3JZ4POTW.js +28 -0
- package/dist/executor-CYJQLKKI.js +9 -0
- package/dist/executor-S4QIKEHW.js +9 -0
- package/dist/export-accessible-CPTP5STN.js +23 -0
- package/dist/extract-partition-TWXPHVU7.js +38 -0
- package/dist/{fanout-sidecar-273RDMYS.js → fanout-sidecar-T2ZGLQFE.js} +9 -9
- package/dist/find-RBBYKXI7.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +6 -6
- package/dist/history/index.js +15 -15
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +35 -7
- package/dist/index.js +279 -202
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +3 -3
- package/dist/introspection/index.js +12 -12
- package/dist/issue-N74C55X6.js +19 -0
- package/dist/kernel/collection-config.d.ts +4 -0
- package/dist/kernel/collection.d.ts +34 -8
- package/dist/kernel/cutover-transform.d.ts +64 -0
- package/dist/kernel/enclave/crypto.d.ts +24 -0
- package/dist/kernel/enclave/index.d.ts +2 -1
- package/dist/kernel/errors.d.ts +138 -0
- package/dist/kernel/noydb.d.ts +10 -1
- package/dist/kernel/put-many-atomic.d.ts +45 -0
- package/dist/kernel/secret-mode.d.ts +59 -0
- package/dist/kernel/types.d.ts +98 -7
- package/dist/kernel/validation.d.ts +33 -0
- package/dist/kernel/vault.d.ts +32 -6
- package/dist/{ledger-XE7JF2I2.js → ledger-DONWFC5M.js} +11 -11
- package/dist/liberate-KICI7AJN.js +24 -0
- package/dist/{link-set-CGYC3OH5.js → link-set-2TTP4VLO.js} +11 -11
- package/dist/managed-secret-EAOYWRYF.js +27 -0
- package/dist/materialized-views/index.js +19 -19
- package/dist/money/index.js +3 -3
- package/dist/noydb-6W2XGQCS.js +83 -0
- package/dist/overlay-views/index.js +6 -6
- package/dist/periods/index.js +16 -16
- package/dist/pod/index.js +121 -12
- package/dist/policy/index.js +4 -4
- package/dist/port/to/index.d.ts +3 -1
- package/dist/port/to/locator.d.ts +84 -0
- package/dist/port/with/device-seal-strategy.d.ts +16 -0
- package/dist/port/with/strategies.d.ts +2 -0
- package/dist/port/with/write-hooks.d.ts +6 -0
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-LY35EDTJ.js → post-register-ORQOQJCS.js} +6 -6
- package/dist/query/index.js +4 -4
- package/dist/reduce/index.js +4 -4
- package/dist/register-LHETZRJM.js +32 -0
- package/dist/registry-AMAZ6QRZ.js +19 -0
- package/dist/registry-CZVINVQH.js +9 -0
- package/dist/registry-IKUR2MXD.js +9 -0
- package/dist/registry-JRIN447B.js +18 -0
- package/dist/request-withdrawal-2DN2RGCO.js +31 -0
- package/dist/{reveal-T34ADTPY.js → reveal-AG4SCHUQ.js} +6 -6
- package/dist/revoke-ZX4NM2CJ.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +6 -6
- package/dist/sealed-record/index.js +12 -12
- package/dist/search/index.js +4 -4
- package/dist/{seed-JOV54PB3.js → seed-IRCDGIRK.js} +15 -15
- package/dist/seed-IRCDGIRK.js.map +1 -0
- package/dist/sequence/index.js +9 -9
- package/dist/session/index.js +9 -9
- package/dist/shadow/index.js +2 -2
- package/dist/signer-7KHD4OL2.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/{stale-T3V7XEOB.js → stale-K734VACF.js} +10 -10
- package/dist/storage-4H2GF6RQ.js +23 -0
- package/dist/{store-coordination-provider-AHGFEMFA.js → store-coordination-provider-4SKLSFUG.js} +3 -3
- package/dist/sync/index.js +10 -10
- package/dist/team/index.js +27 -15
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +28 -3
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/{verify-7XWHJWUN.js → verify-RO5RTZOJ.js} +5 -5
- package/dist/walk-MQHYNDLZ.js +21 -0
- package/dist/with-audit/guards/registry.d.ts +8 -1
- package/dist/with-audit/guards/types.d.ts +5 -0
- package/dist/with-audit/periods/index.d.ts +1 -1
- package/dist/with-audit/periods/periods.d.ts +7 -0
- package/dist/with-commit/tx/atomic-eligibility.d.ts +13 -11
- package/dist/with-formula/derivations/registry.d.ts +6 -0
- package/dist/with-formula/derivations/types.d.ts +5 -0
- package/dist/with-lookup/indexing/eager-indexes.d.ts +10 -0
- package/dist/with-party/team/device-seal.d.ts +25 -0
- package/dist/with-party/team/echo-ceremony.d.ts +74 -0
- package/dist/with-party/team/echo-secret.d.ts +56 -0
- package/dist/with-party/team/index.d.ts +8 -0
- package/dist/with-party/team/keyring.d.ts +71 -9
- package/dist/with-party/team/rotate-recover.d.ts +99 -5
- package/dist/with-pod/bundle-handle.d.ts +9 -0
- package/dist/with-pod/bundle.d.ts +100 -2
- package/dist/with-pod/format.d.ts +92 -1
- package/dist/with-pod/index.d.ts +22 -1
- package/dist/with-pod/open.d.ts +117 -0
- package/dist/with-pod/redirect.d.ts +78 -0
- package/dist/with-pod/signature.d.ts +13 -0
- package/dist/with-shape/introspection/behaviors.d.ts +100 -0
- package/dist/with-shape/introspection/derivation-key.d.ts +17 -0
- package/dist/with-shape/introspection/describe.d.ts +36 -0
- package/dist/with-shape/introspection/index.d.ts +1 -0
- package/dist/with-shape/introspection/subsystem-matrix.d.ts +22 -0
- package/dist/with-shape/introspection/types.d.ts +2 -1
- package/dist/with-shape/links/names.d.ts +14 -0
- package/dist/with-shape/manifest/derive.d.ts +86 -0
- package/dist/with-shape/manifest/reserved-collections.d.ts +27 -0
- package/dist/with-shape/manifest/storage.d.ts +62 -0
- package/dist/with-shape/manifest/sync.d.ts +135 -0
- package/dist/with-shape/manifest/types.d.ts +49 -0
- package/dist/with-shape/manifest/writer.d.ts +32 -0
- package/dist/with-shape/persisted-schemas/field-ids.d.ts +29 -0
- package/dist/with-shape/persisted-schemas/register.d.ts +3 -0
- package/dist/with-shape/persisted-schemas/types.d.ts +17 -0
- package/dist/with-shape/schema-update/fence-controller.d.ts +34 -0
- package/dist/with-shape/schema-update/fence.d.ts +9 -0
- package/dist/with-shape/schema-update/strategies.d.ts +18 -2
- package/dist/with-shape/schema-update/types.d.ts +11 -0
- package/dist/with-sync/engine.d.ts +17 -0
- package/dist/with-sync/presence.d.ts +31 -1
- package/dist/withdraw-accessible-JSDQHXHE.js +28 -0
- package/dist/withdraw-accessible-JSDQHXHE.js.map +1 -0
- package/package.json +3 -3
- package/dist/api-SI2IVBQO.js +0 -20
- package/dist/backup-X7F3TCFV.js.map +0 -1
- package/dist/chunk-2J6UEN2V.js.map +0 -1
- package/dist/chunk-467SWYT5.js.map +0 -1
- package/dist/chunk-4JQK3L4V.js +0 -41
- package/dist/chunk-4JQK3L4V.js.map +0 -1
- package/dist/chunk-77AEMXFA.js.map +0 -1
- package/dist/chunk-AKKRXT23.js.map +0 -1
- package/dist/chunk-AT2JJEKJ.js.map +0 -1
- package/dist/chunk-DSDXAKIP.js.map +0 -1
- package/dist/chunk-E23UGFVC.js.map +0 -1
- package/dist/chunk-FQ5CHJR7.js.map +0 -1
- package/dist/chunk-GTYFIVIZ.js.map +0 -1
- package/dist/chunk-JEI6JJNI.js.map +0 -1
- package/dist/chunk-JQ2AX4T5.js +0 -23
- package/dist/chunk-JQ2AX4T5.js.map +0 -1
- package/dist/chunk-KPZS5QAQ.js.map +0 -1
- package/dist/chunk-NBXFCQX4.js.map +0 -1
- package/dist/chunk-NLYALJMY.js.map +0 -1
- package/dist/chunk-Q5YJCVJY.js.map +0 -1
- package/dist/chunk-QZWTRENR.js.map +0 -1
- package/dist/chunk-S7GIXBXV.js +0 -129
- package/dist/chunk-S7GIXBXV.js.map +0 -1
- package/dist/chunk-SBHN6QUT.js +0 -25
- package/dist/chunk-SBHN6QUT.js.map +0 -1
- package/dist/chunk-VYYM3MEN.js.map +0 -1
- package/dist/chunk-WK7ULBTP.js.map +0 -1
- package/dist/chunk-WYUAEZSC.js.map +0 -1
- package/dist/chunk-YGK2HMLR.js.map +0 -1
- package/dist/chunk-ZBYFMI6D.js.map +0 -1
- package/dist/chunk-ZFG5EBI3.js.map +0 -1
- package/dist/chunk-ZNWSG7XC.js.map +0 -1
- package/dist/collection-facade-DO2AABZT.js +0 -45
- package/dist/derive-ZPGVLE2Q.js +0 -22
- package/dist/executor-FPHKWDWT.js +0 -28
- package/dist/executor-IEBLTBCW.js +0 -9
- package/dist/executor-RM7XWQDU.js +0 -9
- package/dist/export-accessible-EKM3HGB2.js +0 -23
- package/dist/extract-partition-LS4ET5A6.js +0 -38
- package/dist/find-OZMTRIK3.js +0 -11
- package/dist/issue-LIA7FXBJ.js +0 -19
- package/dist/liberate-WZ3RHVKW.js +0 -24
- package/dist/noydb-ZLPVCDES.js +0 -81
- package/dist/register-6RIBIT3I.js +0 -25
- package/dist/registry-7Y5WF7GS.js +0 -9
- package/dist/registry-BWD2ED52.js +0 -8
- package/dist/registry-MUSL4AW6.js +0 -19
- package/dist/registry-RON4WHAP.js +0 -18
- package/dist/request-withdrawal-FT3ORAWN.js +0 -31
- package/dist/revoke-HC7WG3HE.js +0 -24
- package/dist/seed-JOV54PB3.js.map +0 -1
- package/dist/signer-CTWOH6KT.js +0 -25
- package/dist/storage-LLNLPWWB.js +0 -23
- package/dist/walk-G3NFEP5L.js +0 -21
- package/dist/withdraw-accessible-ANSVG6XG.js +0 -28
- /package/dist/{api-SI2IVBQO.js.map → api-67SBPMMH.js.map} +0 -0
- /package/dist/{chunk-DQZXPGGZ.js.map → chunk-24UICKTB.js.map} +0 -0
- /package/dist/{chunk-2BET5QTS.js.map → chunk-27TCYH6G.js.map} +0 -0
- /package/dist/{chunk-MSMJJB4J.js.map → chunk-2KIV7BEK.js.map} +0 -0
- /package/dist/{chunk-6ZNSB3H6.js.map → chunk-2LGDCNFJ.js.map} +0 -0
- /package/dist/{chunk-WBKZUO5V.js.map → chunk-3737A6EA.js.map} +0 -0
- /package/dist/{chunk-HLKXPJ4V.js.map → chunk-3EO7RZLJ.js.map} +0 -0
- /package/dist/{chunk-JYJFGD2H.js.map → chunk-3FSX6LDG.js.map} +0 -0
- /package/dist/{chunk-MXUT7FTE.js.map → chunk-3HYWYLXL.js.map} +0 -0
- /package/dist/{chunk-IVYQAVWO.js.map → chunk-3IIPWA75.js.map} +0 -0
- /package/dist/{chunk-7H3WWH6J.js.map → chunk-3UK6STWO.js.map} +0 -0
- /package/dist/{chunk-NJ4DYYO5.js.map → chunk-4HDYQL3J.js.map} +0 -0
- /package/dist/{chunk-P4JO3H6R.js.map → chunk-4MQDV3HZ.js.map} +0 -0
- /package/dist/{chunk-X4MVWPHV.js.map → chunk-4UVDI4XE.js.map} +0 -0
- /package/dist/{chunk-LXRTP3AQ.js.map → chunk-4VCWI42L.js.map} +0 -0
- /package/dist/{chunk-QJNCB5SK.js.map → chunk-747LRSOO.js.map} +0 -0
- /package/dist/{chunk-3HUYRN24.js.map → chunk-7F4DBNSP.js.map} +0 -0
- /package/dist/{chunk-UADPR6F4.js.map → chunk-7G6VDWXB.js.map} +0 -0
- /package/dist/{chunk-PTHKZWEH.js.map → chunk-AHLJSVRL.js.map} +0 -0
- /package/dist/{chunk-NFZGZ4AK.js.map → chunk-AR2JDFAE.js.map} +0 -0
- /package/dist/{chunk-3ECU57YH.js.map → chunk-BPTZ4K5L.js.map} +0 -0
- /package/dist/{chunk-KRCBZYTZ.js.map → chunk-CCZJJ4I2.js.map} +0 -0
- /package/dist/{chunk-NYEFP7DY.js.map → chunk-CJ73OLMW.js.map} +0 -0
- /package/dist/{chunk-Q36YXK77.js.map → chunk-CYQOUTMY.js.map} +0 -0
- /package/dist/{chunk-RBTVFPHF.js.map → chunk-DCMQR46R.js.map} +0 -0
- /package/dist/{chunk-TG634KCO.js.map → chunk-DG27IUVI.js.map} +0 -0
- /package/dist/{chunk-V6UQZA2H.js.map → chunk-E6427JU2.js.map} +0 -0
- /package/dist/{chunk-TWPK7KUJ.js.map → chunk-F3GVO44K.js.map} +0 -0
- /package/dist/{chunk-QD46HPZG.js.map → chunk-FAXZQ5UF.js.map} +0 -0
- /package/dist/{chunk-IG6KUWBX.js.map → chunk-FNSMZQS4.js.map} +0 -0
- /package/dist/{chunk-BLBAQRBM.js.map → chunk-FUHKW252.js.map} +0 -0
- /package/dist/{chunk-SU6SGWXM.js.map → chunk-FY343IZR.js.map} +0 -0
- /package/dist/{chunk-DAFBJS4Y.js.map → chunk-GS5RT2KK.js.map} +0 -0
- /package/dist/{chunk-5UQ7Y6SQ.js.map → chunk-HFKGIBMD.js.map} +0 -0
- /package/dist/{chunk-SHEEBRZ4.js.map → chunk-HVQGCKY4.js.map} +0 -0
- /package/dist/{chunk-35NMVJ7I.js.map → chunk-HXGUIPQB.js.map} +0 -0
- /package/dist/{chunk-ERGECZEI.js.map → chunk-JEM2IGS3.js.map} +0 -0
- /package/dist/{chunk-L3YYLT4E.js.map → chunk-JIUVJ4M7.js.map} +0 -0
- /package/dist/{chunk-55LX6FSX.js.map → chunk-JRCYZEHU.js.map} +0 -0
- /package/dist/{chunk-SFBYQMZM.js.map → chunk-JSRU5W2M.js.map} +0 -0
- /package/dist/{chunk-NM5UYF6Q.js.map → chunk-JXIDGFKS.js.map} +0 -0
- /package/dist/{chunk-RO5NM6UI.js.map → chunk-KZ3KMDN3.js.map} +0 -0
- /package/dist/{chunk-HZZP2ZIG.js.map → chunk-LBGPO5RL.js.map} +0 -0
- /package/dist/{chunk-CLE3TMIS.js.map → chunk-MC2LFTQM.js.map} +0 -0
- /package/dist/{chunk-W3G5REIU.js.map → chunk-MSWYQLMQ.js.map} +0 -0
- /package/dist/{chunk-SGDPRCC4.js.map → chunk-MZ5ZFO2D.js.map} +0 -0
- /package/dist/{chunk-EFJAAFBW.js.map → chunk-NQRJ5AJO.js.map} +0 -0
- /package/dist/{chunk-Q2SEJMP2.js.map → chunk-NVU7ZMPN.js.map} +0 -0
- /package/dist/{chunk-ZTLOXFPB.js.map → chunk-OF3L2SD6.js.map} +0 -0
- /package/dist/{chunk-LLYIMSQQ.js.map → chunk-OMSAULZM.js.map} +0 -0
- /package/dist/{chunk-SF2ZIRD6.js.map → chunk-OSFPNKY4.js.map} +0 -0
- /package/dist/{chunk-WUHEP3HH.js.map → chunk-P7NGLLUF.js.map} +0 -0
- /package/dist/{chunk-RQ4ZI4ZI.js.map → chunk-PGAPBZEK.js.map} +0 -0
- /package/dist/{chunk-T2MOJF76.js.map → chunk-PP5CO2PR.js.map} +0 -0
- /package/dist/{chunk-QGIBI6GL.js.map → chunk-ROWL352P.js.map} +0 -0
- /package/dist/{chunk-ZHDSUZQU.js.map → chunk-RPXL6KSX.js.map} +0 -0
- /package/dist/{chunk-DTFA5DO4.js.map → chunk-SKONR2OL.js.map} +0 -0
- /package/dist/{chunk-4ZKNC6A6.js.map → chunk-T4GPR2IR.js.map} +0 -0
- /package/dist/{chunk-TS5XLBZR.js.map → chunk-TLNNHG3A.js.map} +0 -0
- /package/dist/{chunk-6UBZ6I5Z.js.map → chunk-UHXCLPGC.js.map} +0 -0
- /package/dist/{chunk-KD4HGBJV.js.map → chunk-V5C5NNBR.js.map} +0 -0
- /package/dist/{chunk-5GQEU4DN.js.map → chunk-VJFMXYKP.js.map} +0 -0
- /package/dist/{chunk-5DRROK5W.js.map → chunk-VMCCGUQB.js.map} +0 -0
- /package/dist/{chunk-IXNCZTWA.js.map → chunk-W3TVWF6N.js.map} +0 -0
- /package/dist/{chunk-W66AM5IB.js.map → chunk-WLYIROCJ.js.map} +0 -0
- /package/dist/{chunk-OWHP3H5C.js.map → chunk-XB7LUDKM.js.map} +0 -0
- /package/dist/{chunk-KYRDJI5O.js.map → chunk-XBLKM73C.js.map} +0 -0
- /package/dist/{chunk-MHMLXJ3I.js.map → chunk-YAWK6AWF.js.map} +0 -0
- /package/dist/{chunk-PWPYO73B.js.map → chunk-ZGGVOADG.js.map} +0 -0
- /package/dist/{chunk-IFOH7RBI.js.map → chunk-ZWMO5GL5.js.map} +0 -0
- /package/dist/{chunk-LRRX57UA.js.map → chunk-ZXJXDHNK.js.map} +0 -0
- /package/dist/{classified-marker-LE54HWSX.js.map → classified-marker-MH3ON5OL.js.map} +0 -0
- /package/dist/{collection-facade-DO2AABZT.js.map → collection-facade-AHT7FATG.js.map} +0 -0
- /package/dist/{computed-AB45PS4V.js.map → computed-6G5M3UPH.js.map} +0 -0
- /package/dist/{dead-filter-V3LVWYEJ.js.map → dead-filter-U575NGSH.js.map} +0 -0
- /package/dist/{delegation-JDUMAF6L.js.map → delegation-PDYL6RWT.js.map} +0 -0
- /package/dist/{derive-ZPGVLE2Q.js.map → derive-AKT4KU36.js.map} +0 -0
- /package/dist/{dispatch-6TV3DGO6.js.map → dispatch-4XIJSFTT.js.map} +0 -0
- /package/dist/{dispatch-W7NWQ637.js.map → dispatch-N5HGVUGU.js.map} +0 -0
- /package/dist/{enclave-YFCLPIDR.js.map → enclave-OPK24QDR.js.map} +0 -0
- /package/dist/{executor-FPHKWDWT.js.map → executor-3JZ4POTW.js.map} +0 -0
- /package/dist/{executor-IEBLTBCW.js.map → executor-CYJQLKKI.js.map} +0 -0
- /package/dist/{executor-RM7XWQDU.js.map → executor-S4QIKEHW.js.map} +0 -0
- /package/dist/{export-accessible-EKM3HGB2.js.map → export-accessible-CPTP5STN.js.map} +0 -0
- /package/dist/{extract-partition-LS4ET5A6.js.map → extract-partition-TWXPHVU7.js.map} +0 -0
- /package/dist/{fanout-sidecar-273RDMYS.js.map → fanout-sidecar-T2ZGLQFE.js.map} +0 -0
- /package/dist/{find-OZMTRIK3.js.map → find-RBBYKXI7.js.map} +0 -0
- /package/dist/{issue-LIA7FXBJ.js.map → issue-N74C55X6.js.map} +0 -0
- /package/dist/{ledger-XE7JF2I2.js.map → ledger-DONWFC5M.js.map} +0 -0
- /package/dist/{liberate-WZ3RHVKW.js.map → liberate-KICI7AJN.js.map} +0 -0
- /package/dist/{link-set-CGYC3OH5.js.map → link-set-2TTP4VLO.js.map} +0 -0
- /package/dist/{noydb-ZLPVCDES.js.map → managed-secret-EAOYWRYF.js.map} +0 -0
- /package/dist/{register-6RIBIT3I.js.map → noydb-6W2XGQCS.js.map} +0 -0
- /package/dist/{post-register-LY35EDTJ.js.map → post-register-ORQOQJCS.js.map} +0 -0
- /package/dist/{registry-7Y5WF7GS.js.map → register-LHETZRJM.js.map} +0 -0
- /package/dist/{registry-BWD2ED52.js.map → registry-AMAZ6QRZ.js.map} +0 -0
- /package/dist/{registry-MUSL4AW6.js.map → registry-CZVINVQH.js.map} +0 -0
- /package/dist/{registry-RON4WHAP.js.map → registry-IKUR2MXD.js.map} +0 -0
- /package/dist/{request-withdrawal-FT3ORAWN.js.map → registry-JRIN447B.js.map} +0 -0
- /package/dist/{revoke-HC7WG3HE.js.map → request-withdrawal-2DN2RGCO.js.map} +0 -0
- /package/dist/{reveal-T34ADTPY.js.map → reveal-AG4SCHUQ.js.map} +0 -0
- /package/dist/{signer-CTWOH6KT.js.map → revoke-ZX4NM2CJ.js.map} +0 -0
- /package/dist/{stale-T3V7XEOB.js.map → signer-7KHD4OL2.js.map} +0 -0
- /package/dist/{storage-LLNLPWWB.js.map → stale-K734VACF.js.map} +0 -0
- /package/dist/{walk-G3NFEP5L.js.map → storage-4H2GF6RQ.js.map} +0 -0
- /package/dist/{store-coordination-provider-AHGFEMFA.js.map → store-coordination-provider-4SKLSFUG.js.map} +0 -0
- /package/dist/{verify-7XWHJWUN.js.map → verify-RO5RTZOJ.js.map} +0 -0
- /package/dist/{withdraw-accessible-ANSVG6XG.js.map → walk-MQHYNDLZ.js.map} +0 -0
|
@@ -1,7 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createNoydb
|
|
3
|
+
} from "./chunk-3CLZY46Y.js";
|
|
4
|
+
import {
|
|
5
|
+
deriveSchemaManifest
|
|
6
|
+
} from "./chunk-HS7HNYBD.js";
|
|
7
|
+
import {
|
|
8
|
+
loadFence
|
|
9
|
+
} from "./chunk-MVOWXQHN.js";
|
|
10
|
+
import {
|
|
11
|
+
readPod,
|
|
12
|
+
readPodRedirect,
|
|
13
|
+
signRecord,
|
|
14
|
+
verifyPodHeader,
|
|
15
|
+
verifyRecord
|
|
16
|
+
} from "./chunk-EK7DT5BT.js";
|
|
17
|
+
import {
|
|
18
|
+
loadKeyring
|
|
19
|
+
} from "./chunk-RLWY6Z44.js";
|
|
1
20
|
import {
|
|
2
21
|
ConflictError,
|
|
3
|
-
|
|
4
|
-
|
|
22
|
+
MigrationRequiredError,
|
|
23
|
+
PodHeaderVerificationError,
|
|
24
|
+
PodVersionConflictError,
|
|
25
|
+
RedirectBadSignatureError,
|
|
26
|
+
RedirectDepthExceededError,
|
|
27
|
+
RedirectLoopError,
|
|
28
|
+
RedirectUnreachableError
|
|
29
|
+
} from "./chunk-HNGSV2YC.js";
|
|
5
30
|
|
|
6
31
|
// src/with-pod/pod-store.ts
|
|
7
32
|
var BUNDLE_STORE_VERSION = 1;
|
|
@@ -170,10 +195,99 @@ function createPodStore(factory) {
|
|
|
170
195
|
var wrapBundleStore = wrapPodStore;
|
|
171
196
|
var createBundleStore = createPodStore;
|
|
172
197
|
|
|
198
|
+
// src/with-pod/redirect.ts
|
|
199
|
+
async function signRedirect(signer, fields) {
|
|
200
|
+
const record = {
|
|
201
|
+
v: 1,
|
|
202
|
+
target: fields.target,
|
|
203
|
+
reason: fields.reason,
|
|
204
|
+
issuedBy: signer.keyId
|
|
205
|
+
};
|
|
206
|
+
const sig = await signRecord(signer.privateKeyPkcs8B64, record);
|
|
207
|
+
return { ...record, sig };
|
|
208
|
+
}
|
|
209
|
+
async function verifyRedirect(record, trustedKeys) {
|
|
210
|
+
const publicKeyB64 = trustedKeys[record.issuedBy];
|
|
211
|
+
if (publicKeyB64 === void 0) return false;
|
|
212
|
+
const payload = { v: record.v, target: record.target, reason: record.reason, issuedBy: record.issuedBy };
|
|
213
|
+
return verifyRecord(publicKeyB64, record.sig, payload);
|
|
214
|
+
}
|
|
215
|
+
async function followRedirects(start, fetcher, opts) {
|
|
216
|
+
const maxDepth = opts.maxDepth ?? 8;
|
|
217
|
+
let current = start;
|
|
218
|
+
const hops = [];
|
|
219
|
+
const visited = /* @__PURE__ */ new Set();
|
|
220
|
+
for (; ; ) {
|
|
221
|
+
const rec = readPodRedirect(current);
|
|
222
|
+
if (rec === void 0) return { terminal: current, hops };
|
|
223
|
+
if (!await verifyRedirect(rec, opts.trustedKeys)) {
|
|
224
|
+
throw new RedirectBadSignatureError(rec.target);
|
|
225
|
+
}
|
|
226
|
+
if (visited.has(rec.target)) {
|
|
227
|
+
throw new RedirectLoopError(rec.target);
|
|
228
|
+
}
|
|
229
|
+
visited.add(rec.target);
|
|
230
|
+
hops.push({ target: rec.target, reason: rec.reason, issuedBy: rec.issuedBy });
|
|
231
|
+
if (hops.length > maxDepth) {
|
|
232
|
+
throw new RedirectDepthExceededError(maxDepth);
|
|
233
|
+
}
|
|
234
|
+
let next;
|
|
235
|
+
try {
|
|
236
|
+
next = await fetcher(rec.target);
|
|
237
|
+
} catch (cause) {
|
|
238
|
+
throw new RedirectUnreachableError(rec.target, cause);
|
|
239
|
+
}
|
|
240
|
+
if (next === null) {
|
|
241
|
+
throw new RedirectUnreachableError(rec.target);
|
|
242
|
+
}
|
|
243
|
+
current = next;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// src/with-pod/open.ts
|
|
248
|
+
async function open(podFileOrBytes, opts) {
|
|
249
|
+
const { header, dumpJson } = await readPod(podFileOrBytes);
|
|
250
|
+
let verification;
|
|
251
|
+
if (opts.trustedKeys !== void 0) {
|
|
252
|
+
verification = await verifyPodHeader(podFileOrBytes, opts.trustedKeys);
|
|
253
|
+
if (verification.status === "untrusted" || verification.status === "tampered") {
|
|
254
|
+
throw new PodHeaderVerificationError(verification.status, verification.keyId);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const readerGeneration = (await loadFence(opts.store, opts.vault)).currentSchemaVersion;
|
|
258
|
+
const db = await createNoydb({ ...opts.noydbOptions, store: opts.store, user: opts.user, secret: opts.secret });
|
|
259
|
+
const vault = await db.openVault(opts.vault);
|
|
260
|
+
await vault.load(dumpJson);
|
|
261
|
+
const keyring = await loadKeyring(opts.store, opts.vault, { userId: opts.user, secret: opts.secret });
|
|
262
|
+
const lookupDEK = async (name) => keyring.deks.get(name);
|
|
263
|
+
const { manifest, undecodableCollections } = await deriveSchemaManifest(opts.store, opts.vault, lookupDEK);
|
|
264
|
+
void undecodableCollections;
|
|
265
|
+
const podGeneration = Object.values(manifest.collections).reduce((max, entry) => Math.max(max, entry.generation), 0);
|
|
266
|
+
if (podGeneration > readerGeneration) {
|
|
267
|
+
if (!opts.allowGenerationAhead) {
|
|
268
|
+
throw new MigrationRequiredError(
|
|
269
|
+
`open(): pod's schema generation (${podGeneration}) is ahead of vault "${opts.vault}"'s local generation (${readerGeneration}). Pass \`allowGenerationAhead: true\` to open anyway, or reconcile the schema first.`
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
console.warn(
|
|
273
|
+
`[noy-db] open(): vault "${opts.vault}" opened with allowGenerationAhead \u2014 pod schema generation ${podGeneration} is ahead of the local generation ${readerGeneration}.`
|
|
274
|
+
);
|
|
275
|
+
} else if (podGeneration < readerGeneration) {
|
|
276
|
+
console.warn(
|
|
277
|
+
`[noy-db] open(): vault "${opts.vault}"'s local schema generation (${readerGeneration}) is ahead of the pod's (${podGeneration}) \u2014 the pod reflects an earlier schema than this reader.`
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
return { db, vault, header, manifest, ...verification !== void 0 ? { verification } : {} };
|
|
281
|
+
}
|
|
282
|
+
|
|
173
283
|
export {
|
|
174
284
|
wrapPodStore,
|
|
175
285
|
createPodStore,
|
|
176
286
|
wrapBundleStore,
|
|
177
|
-
createBundleStore
|
|
287
|
+
createBundleStore,
|
|
288
|
+
signRedirect,
|
|
289
|
+
verifyRedirect,
|
|
290
|
+
followRedirects,
|
|
291
|
+
open
|
|
178
292
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
293
|
+
//# sourceMappingURL=chunk-MXZ5TSTR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-pod/pod-store.ts","../src/with-pod/redirect.ts","../src/with-pod/open.ts"],"sourcesContent":["import type { NoydbStore, NoydbPodStore, VaultSnapshot, EncryptedEnvelope } from '../kernel/types.js'\nimport { ConflictError, PodVersionConflictError } from '../kernel/errors.js'\n\n// ─── Bundle format ─────────────────────────────────────────────────────\n\nconst BUNDLE_STORE_VERSION = 1 as const\n\n/**\n * Wire format written by `wrapPodStore`. A JSON-serialised object that\n * contains the entire `VaultSnapshot` (all encrypted envelopes) plus a small\n * header for integrity checking. The envelopes inside are already AES-GCM\n * encrypted by core — the bundle bytes themselves are not additionally\n * encrypted, but they are safe to store on untrusted blob hosts because\n * every record inside is already ciphertext.\n *\n * @internal\n */\ninterface BundleStoreData {\n readonly _noydb_bundle_store: typeof BUNDLE_STORE_VERSION\n readonly vault: string\n readonly ts: string\n readonly data: VaultSnapshot\n}\n\n// ─── Options ───────────────────────────────────────────────────────────\n\nexport interface WrapPodStoreOptions {\n /**\n * When `true` (default), every `put()` and `delete()` flushes the full\n * vault snapshot to the bundle backend. Set to `false` for bulk operations\n * and call `store.flush(vaultId)` manually.\n */\n autoFlush?: boolean\n}\n\n// ─── Extended NoydbStore with flush/batch ───────────────────────────────\n\nexport interface WrappedPodNoydbStore extends NoydbStore {\n /** Manually flush the in-memory snapshot to the bundle backend. */\n flush(vaultId: string): Promise<void>\n /**\n * Run a batch of mutations without flushing until the callback completes.\n * A single flush is performed at the end.\n */\n batch(vaultId: string, fn: () => Promise<void>): Promise<void>\n}\n\n// ─── wrapPodStore ───────────────────────────────────────────────────\n\nconst MAX_CONFLICT_RETRIES = 3\n\n/**\n * Convert a `NoydbPodStore` (blob-oriented read/write with OCC) into the\n * standard six-method `NoydbStore` interface expected by `createNoydb({ store })`.\n *\n * Bundle stores operate on the entire vault as a single serialised unit —\n * ideal for backends like Google Drive, WebDAV, or iCloud Drive that work\n * best with whole-file I/O rather than per-record KV operations.\n *\n * ## Optimistic concurrency\n *\n * The wrapper tracks the `version` token from the last `readBundle` and\n * passes it as `expectedVersion` on every flush. On\n * `PodVersionConflictError`, it re-reads, merges the remote snapshot\n * (last-write-wins per record key), and retries (max 3 attempts).\n *\n * ## Flush modes\n *\n * By default, flushes on every mutation (O(vault size) per write). Options:\n * - `autoFlush: false` + explicit `store.flush(vaultId)` calls\n * - `store.batch(vaultId, async () => { ... })` — defers flush until end\n * - Pair with `syncPolicy: { push: { mode: 'debounce' } }` from \n */\nexport function wrapPodStore(\n bundle: NoydbPodStore,\n options?: WrapPodStoreOptions,\n): WrappedPodNoydbStore {\n const autoFlush = options?.autoFlush !== false\n\n // Per-vault state\n const snapshots = new Map<string, VaultSnapshot>()\n const versions = new Map<string, string | null>()\n const loaded = new Set<string>()\n\n // Batch mode: when > 0, suppress auto-flush\n let batchDepth = 0\n\n // #908 — in-flight loads, keyed by vault. Without this, every concurrent\n // caller issued its own `readBundle` and then REPLACED `snapshots` with a\n // freshly parsed object — orphaning the mutations earlier callers had\n // already made to the object they were handed. 100 racing puts kept 1.\n const loading = new Map<string, Promise<VaultSnapshot>>()\n\n async function load(vault: string): Promise<VaultSnapshot> {\n if (loaded.has(vault)) return snapshots.get(vault)!\n\n const inFlight = loading.get(vault)\n if (inFlight) return inFlight\n\n const pending = (async () => {\n const result = await bundle.readBundle(vault)\n if (result) {\n const text = new TextDecoder().decode(result.bytes)\n const format = JSON.parse(text) as BundleStoreData\n snapshots.set(vault, format.data)\n versions.set(vault, result.version)\n } else {\n snapshots.set(vault, {})\n versions.set(vault, null)\n }\n\n loaded.add(vault)\n return snapshots.get(vault)!\n })()\n\n loading.set(vault, pending)\n try {\n return await pending\n } finally {\n // Clear on failure too, so a transient read error does not poison\n // every later load of this vault with a rejected promise.\n loading.delete(vault)\n }\n }\n\n async function flush(vault: string): Promise<void> {\n const snapshot = snapshots.get(vault) ?? {}\n const format: BundleStoreData = {\n _noydb_bundle_store: BUNDLE_STORE_VERSION,\n vault,\n ts: new Date().toISOString(),\n data: snapshot,\n }\n const bytes = new TextEncoder().encode(JSON.stringify(format))\n const expectedVersion = versions.get(vault) ?? null\n\n for (let attempt = 0; attempt < MAX_CONFLICT_RETRIES; attempt++) {\n try {\n const { version: newVersion } = await bundle.writeBundle(vault, bytes, expectedVersion)\n versions.set(vault, newVersion)\n return\n } catch (err) {\n if (err instanceof PodVersionConflictError && attempt < MAX_CONFLICT_RETRIES - 1) {\n // Pull remote, merge (last-write-wins by record key), retry\n const remote = await bundle.readBundle(vault)\n if (remote) {\n const remoteText = new TextDecoder().decode(remote.bytes)\n const remoteFormat = JSON.parse(remoteText) as BundleStoreData\n const localSnap = snapshots.get(vault) ?? {}\n const mergedSnap = mergeSnapshots(remoteFormat.data, localSnap)\n snapshots.set(vault, mergedSnap)\n versions.set(vault, remote.version)\n }\n // Re-encode with merged data for the retry\n continue\n }\n throw err\n }\n }\n }\n\n // #908 — one flush at a time per vault. `flush` reads and writes the vault's\n // version token, so concurrent flushes race: each sends the same\n // `expectedVersion`, the losers take the conflict/merge path, and with enough\n // of them the retry budget is exhausted and the error surfaces to a caller\n // whose write was perfectly valid. Serialising makes every flush see the\n // token its predecessor produced.\n const flushChain = new Map<string, Promise<void>>()\n\n function serialFlush(vault: string): Promise<void> {\n const prev = flushChain.get(vault) ?? Promise.resolve()\n // Chain past a rejection as well — one failed flush must not wedge every\n // subsequent write to this vault.\n const next = prev.then(() => flush(vault), () => flush(vault))\n flushChain.set(vault, next)\n return next\n }\n\n async function maybeFlush(vault: string): Promise<void> {\n if (autoFlush && batchDepth === 0) {\n await serialFlush(vault)\n }\n }\n\n const store: WrappedPodNoydbStore = {\n name: bundle.name ?? 'bundle',\n\n async flush(vaultId: string): Promise<void> {\n await serialFlush(vaultId)\n },\n\n async batch(vaultId: string, fn: () => Promise<void>): Promise<void> {\n await load(vaultId) // ensure loaded before batch\n batchDepth++\n try {\n await fn()\n } finally {\n batchDepth--\n }\n await serialFlush(vaultId)\n },\n\n async get(vault: string, collection: string, id: string): Promise<EncryptedEnvelope | null> {\n const snap = await load(vault)\n return snap[collection]?.[id] ?? null\n },\n\n async put(\n vault: string,\n collection: string,\n id: string,\n envelope: EncryptedEnvelope,\n expectedVersion?: number,\n ): Promise<void> {\n const snap = await load(vault)\n\n if (expectedVersion !== undefined) {\n const current = snap[collection]?.[id]\n const currentVersion = current?._v ?? 0\n if (currentVersion !== expectedVersion) {\n throw new ConflictError(\n currentVersion,\n `Expected version ${expectedVersion} but found ${currentVersion} on ${collection}/${id}`,\n )\n }\n }\n\n snap[collection] ??= {}\n snap[collection][id] = envelope\n await maybeFlush(vault)\n },\n\n async delete(vault: string, collection: string, id: string): Promise<void> {\n const snap = await load(vault)\n if (snap[collection]) {\n delete snap[collection][id]\n await maybeFlush(vault)\n }\n },\n\n async list(vault: string, collection: string): Promise<string[]> {\n const snap = await load(vault)\n return Object.keys(snap[collection] ?? {})\n },\n\n async loadAll(vault: string): Promise<VaultSnapshot> {\n const snap = await load(vault)\n // #908 — two contract fixes in one place:\n // 1. internal collections (`_keyring`, `_sync`) are the vault's own\n // bookkeeping and must not appear in a snapshot — `@noy-db/to-file`\n // sets the reference behaviour with this same `_`-prefix rule;\n // 2. copy rather than hand out the live cache, which let a caller\n // mutating the result silently rewrite the wrapper's own state.\n // `get()`/`list()` still serve internal collections; this is about what\n // a *snapshot* claims, not about hiding data.\n const out: VaultSnapshot = {}\n for (const [collection, records] of Object.entries(snap)) {\n if (collection.startsWith('_')) continue\n out[collection] = { ...records }\n }\n return out\n },\n\n async saveAll(vault: string, data: VaultSnapshot): Promise<void> {\n snapshots.set(vault, data)\n loaded.add(vault)\n await serialFlush(vault)\n },\n }\n\n return store\n}\n\n// ─── Snapshot merge (last-write-wins per record) ────────────────────────\n\nfunction mergeSnapshots(remote: VaultSnapshot, local: VaultSnapshot): VaultSnapshot {\n const merged: VaultSnapshot = {}\n\n // Start with all remote collections\n for (const [coll, records] of Object.entries(remote)) {\n merged[coll] = { ...records }\n }\n\n // Overlay local collections — LWW by _ts per record\n for (const [coll, records] of Object.entries(local)) {\n if (!merged[coll]) {\n merged[coll] = { ...records }\n continue\n }\n for (const [id, envelope] of Object.entries(records)) {\n const existing = merged[coll][id]\n if (!existing || envelope._ts >= existing._ts) {\n merged[coll][id] = envelope\n }\n }\n }\n\n return merged\n}\n\n// ─── Factory helper ─────────────────────────────────────────────────────\n\n/**\n * Type-safe factory helper for `NoydbPodStore` implementations,\n * analogous to `createStore` for KV stores.\n */\nexport function createPodStore<TOptions>(\n factory: (options: TOptions) => NoydbPodStore,\n): (options: TOptions) => NoydbPodStore {\n return factory\n}\n\n// ─── Deprecated aliases (pre-rename compatibility) ──────────────────────\n\n/** @deprecated Use wrapPodStore. */\nexport const wrapBundleStore = wrapPodStore\n/** @deprecated Use createPodStore. */\nexport const createBundleStore = createPodStore\n/** @deprecated Use WrappedPodNoydbStore. */\nexport type WrappedBundleNoydbStore = WrappedPodNoydbStore\n/** @deprecated Use WrapPodStoreOptions. */\nexport type WrapBundleStoreOptions = WrapPodStoreOptions\n","/**\n * Redirect record (#944) — a signed \"this moved, go there\" pointer carried\n * in the pod's PLAINTEXT header (`NoydbPodHeader.redirect`, see\n * `format.ts`) so a dispatcher can follow it pre-auth: no secret, no\n * decompression.\n *\n * The record carries its OWN inner `sig` (via `signRecord`/`verifyRecord`\n * from `signature.ts`) — independent from, and in addition to, the #943\n * pod-header signature. A Redirect is REQUIRED to be signed: there is no\n * legacy unsigned install base for this new record type, so an absent or\n * invalid signature is invalid for following, not merely \"unverified\".\n *\n * Minimum-disclosure: the record is kept to exactly\n * `{ v, target, reason, issuedBy, sig }` — no timestamps, no identities\n * beyond the signer's `keyId` fingerprint.\n */\n\nimport type { DocSigner } from '../with-audit/attestation/signer.js'\nimport { signRecord, verifyRecord } from './signature.js'\nimport { readPodRedirect } from './bundle.js'\nimport {\n RedirectBadSignatureError,\n RedirectDepthExceededError,\n RedirectLoopError,\n RedirectUnreachableError,\n} from '../kernel/errors.js'\n\n/**\n * A signed pointer to another pod. `target` is a locator string or URL —\n * the forthcoming #945 `Locator` type isn't built yet, so `target` stays a\n * plain string for now (forward-seam noted, not blurred: a Redirect says\n * \"go elsewhere once\"; a Locator will say \"where cargo lives\").\n */\nexport interface Redirect {\n readonly v: 1\n readonly target: string\n readonly reason: 'moved' | 'release' | 'tombstone' | 'repoint'\n readonly issuedBy: string\n readonly sig: string\n}\n\n/**\n * Sign a new Redirect record with `signer`. Builds the record minus `sig`,\n * signs it via the #943 `signRecord` convention, and returns the complete\n * signed record.\n */\nexport async function signRedirect(\n signer: DocSigner,\n fields: { readonly target: string; readonly reason: Redirect['reason'] },\n): Promise<Redirect> {\n const record = {\n v: 1 as const,\n target: fields.target,\n reason: fields.reason,\n issuedBy: signer.keyId,\n }\n const sig = await signRecord(signer.privateKeyPkcs8B64, record)\n return { ...record, sig }\n}\n\n/**\n * Verify a Redirect record's signature against `trustedKeys`\n * (`keyId → publicKeyB64`). Fails closed: an `issuedBy` not present in\n * `trustedKeys` is untrusted/unverifiable and returns `false`, same as a\n * tampered or forged signature.\n */\nexport async function verifyRedirect(\n record: Redirect,\n trustedKeys: Readonly<Record<string, string>>,\n): Promise<boolean> {\n const publicKeyB64 = trustedKeys[record.issuedBy]\n if (publicKeyB64 === undefined) return false\n const payload = { v: record.v, target: record.target, reason: record.reason, issuedBy: record.issuedBy }\n return verifyRecord(publicKeyB64, record.sig, payload)\n}\n\n/** One followed hop's provenance — surfaced so a UI can show \"moved from X via Y\". */\nexport interface RedirectHop {\n readonly target: string\n readonly reason: Redirect['reason']\n readonly issuedBy: string\n}\n\n/** Result of {@link followRedirects}: the terminal (non-redirect) pod's bytes, plus the ordered hop list that led there. */\nexport interface FollowRedirectsResult {\n readonly terminal: Uint8Array\n readonly hops: readonly RedirectHop[]\n}\n\n/**\n * Follow a chain of Redirect records starting from `start`'s pod bytes,\n * fetching each hop's target via `fetcher`, until a pod with no `redirect`\n * header field (the terminal) is reached.\n *\n * HTTP-redirect discipline: each hop's Redirect is verified against\n * `opts.trustedKeys` BEFORE it is followed (fail closed — an untrusted or\n * forged hop never advances the walk), loops are detected on the target\n * about to be followed, and the hop count is capped at `opts.maxDepth`\n * (default 8). `fetcher` throwing or returning `null` for a target means\n * that hop is unreachable.\n *\n * @throws {RedirectBadSignatureError} a hop's Redirect fails verification.\n * @throws {RedirectLoopError} a hop's target was already followed in this chain.\n * @throws {RedirectDepthExceededError} more than `maxDepth` hops were followed.\n * @throws {RedirectUnreachableError} `fetcher` threw or returned `null` for a target.\n */\nexport async function followRedirects(\n start: Uint8Array,\n fetcher: (target: string) => Promise<Uint8Array | null>,\n opts: { readonly trustedKeys: Readonly<Record<string, string>>; readonly maxDepth?: number },\n): Promise<FollowRedirectsResult> {\n const maxDepth = opts.maxDepth ?? 8\n let current = start\n const hops: RedirectHop[] = []\n const visited = new Set<string>()\n\n for (;;) {\n const rec = readPodRedirect(current)\n if (rec === undefined) return { terminal: current, hops }\n\n if (!(await verifyRedirect(rec, opts.trustedKeys))) {\n throw new RedirectBadSignatureError(rec.target)\n }\n if (visited.has(rec.target)) {\n throw new RedirectLoopError(rec.target)\n }\n visited.add(rec.target)\n\n hops.push({ target: rec.target, reason: rec.reason, issuedBy: rec.issuedBy })\n if (hops.length > maxDepth) {\n throw new RedirectDepthExceededError(maxDepth)\n }\n\n let next: Uint8Array | null\n try {\n next = await fetcher(rec.target)\n } catch (cause) {\n throw new RedirectUnreachableError(rec.target, cause)\n }\n if (next === null) {\n throw new RedirectUnreachableError(rec.target)\n }\n current = next\n }\n}\n","/**\n * `open(podBytesOrFile)` — the pod READ-path orchestrator (#941 Task 4).\n *\n * A free function (never a `Vault` method — `kernel/vault.ts` is at its\n * line ceiling and open() needs no vault-internal state that isn't already\n * reachable through published seams). Composes, in order:\n *\n * 1. `readPod` — parse + integrity-check the container (throws\n * `BundleIntegrityError` on a corrupted/truncated pod).\n * 2. `verifyPodHeader` — only when `opts.trustedKeys` is supplied.\n * `'unsigned'` is benign (legacy pod, or `writePod({ sign: false })`)\n * and open() proceeds; `'untrusted'` / `'tampered'` are fail-closed —\n * `PodHeaderVerificationError` — mirroring `followRedirects`'s\n * `RedirectBadSignatureError` posture: once a caller opts into\n * verification, an unverifiable header is a hard stop.\n * 3. `createNoydb` + `openVault` + `vault.load(dumpJson)` — the exact\n * unlock+restore sequence `bundle-roundtrip.test.ts` drives by hand.\n * The pod header carries no vault name (minimum-disclosure —\n * `format.ts`'s forbidden-fields list), so the caller names the\n * target vault via `opts.vault`.\n * 4. Re-derive the `SchemaManifest` from the just-restored `_schemas/*`\n * (the source of truth — Task 3's `deriveSchemaManifest`), via a\n * NON-MINTING `LookupDEK` built from `loadKeyring`'s already-unwrapped\n * `UnlockedKeyring.deks` map directly (`with-party/team/keyring.js`).\n * **Not** `ensureCollectionDEK` (#941 review fix — Important 2): that\n * helper mints+persists a fresh DEK into `_keyring/<user>` for any\n * collection absent from the keyring, which is correct for a WRITE\n * path but wrong here — `deriveSchemaManifest` only ever reads\n * collections that already have a `_schemas` envelope, so an absent\n * DEK means \"this principal can't decrypt this sibling\" (e.g. a\n * collection-scoped grantee), never \"new collection.\" The old\n * minting call polluted a scoped principal's freshly-restored keyring\n * with garbage sibling DEKs on every `open()`. The returned\n * `manifest` is that principal's own visible slice — see\n * `derive.ts`'s `LookupDEK` doc and `sync.ts`'s module doc for the\n * full rationale (the same distinction governs why the sync path\n * must SKIP rather than write a partial manifest).\n * 5. Generation check (AC #4 coexistence): compare the HIGHEST\n * per-collection generation stamp carried by the restored manifest\n * against THIS store's schema-fence generation as it stood\n * immediately before the restore (0 for a brand-new vault; whatever a\n * coexisting local vault already had). If the pod is ahead and\n * `!opts.allowGenerationAhead`, throw `MigrationRequiredError` (the\n * same class `SchemaFenceController`'s write-path gate throws) — the\n * reader hasn't reconciled schema changes that happened elsewhere.\n * `allowGenerationAhead: true` is the documented dev override: open\n * proceeds, with a console warning. Divergence in the OTHER direction\n * (reader ahead of the pod) is non-fatal but also warned (#941\n * review, Important 3 — AC #4 coexistence divergence must be\n * observable in either direction, not just the bypass case).\n *\n * NOTE: this deliberately reads per-collection entries, not\n * `manifest.generation` itself. `_meta/schema-fence` is local\n * session-coordination state and does NOT travel in a pod dump\n * (`with-pod/backup.ts`'s reserved-collection list carries `_schemas`\n * and `_manifest` but not `_meta`) — a fresh re-derive's top-level\n * `generation` is always driven by the (untouched-by-restore) target\n * store's own fence, not the pod's. Each `_schemas/<collection>`\n * envelope's own `generation` field DOES travel (it's stamped at\n * declare-time from the writer's real fence), so per-collection\n * entries are the only signal that survives a restore intact.\n *\n * @module\n */\n\nimport { readPod, verifyPodHeader } from './bundle.js'\nimport type { NoydbPodHeader } from './format.js'\nimport type { PodVerifyResult } from './bundle.js'\nimport { createNoydb } from '../kernel/noydb.js'\nimport type { Noydb } from '../kernel/noydb.js'\nimport type { Vault } from '../kernel/vault.js'\nimport type { NoydbOptions, NoydbStore, EchoSecretParts } from '../kernel/types.js'\nimport { MigrationRequiredError, PodHeaderVerificationError } from '../kernel/errors.js'\nimport { loadKeyring } from '../with-party/team/keyring.js'\nimport { loadFence } from '../with-shape/schema-update/fence.js'\nimport { deriveSchemaManifest, type LookupDEK } from '../with-shape/manifest/derive.js'\nimport type { SchemaManifest } from '../with-shape/manifest/types.js'\n\nexport interface OpenPodOptions {\n /** The ciphertext store to restore into (and where the opened `Vault` lives). */\n readonly store: NoydbStore\n /**\n * The target vault name. The pod header deliberately carries no vault\n * name (minimum-disclosure — `NoydbPodHeader`'s forbidden-fields list),\n * so the caller names the vault to restore into/open.\n */\n readonly vault: string\n /** User identifier — passed through to `createNoydb`. */\n readonly user: string\n /** That user's secret — passed through to `createNoydb` / `loadKeyring`. */\n readonly secret: string | EchoSecretParts\n /**\n * Trusted signing keys (`keyId → publicKeyB64`). When supplied,\n * `verifyPodHeader` runs and its result is returned as `verification`.\n * Omitted → no verification attempted, `verification` is absent.\n */\n readonly trustedKeys?: Readonly<Record<string, string>>\n /**\n * Passthrough to `createNoydb` for every option beyond `store`/`user`/\n * `secret` (history/indexing/blobs/… strategies, `secretMode`, etc.).\n */\n readonly noydbOptions?: Omit<NoydbOptions, 'store' | 'user' | 'secret'>\n /**\n * Dev override for the generation-ahead fence (AC #4). Default `false`:\n * a pod whose schema manifest generation is ahead of this store's\n * pre-restore fence generation throws `MigrationRequiredError`. `true`\n * opens anyway, logging a console warning.\n */\n readonly allowGenerationAhead?: boolean\n}\n\nexport interface OpenPodResult {\n readonly db: Noydb\n readonly vault: Vault\n readonly header: NoydbPodHeader\n /** Present iff `opts.trustedKeys` was supplied. */\n readonly verification?: PodVerifyResult\n /** The pod's schema manifest, re-derived from the just-restored `_schemas/*`. */\n readonly manifest?: SchemaManifest\n}\n\n/**\n * Open a `.noydb` pod: verify its integrity (and, opt-in, its signature),\n * unlock + restore it into `opts.vault`, and re-derive its schema manifest.\n * See the module doc for the full flow and the errors each step can throw.\n */\nexport async function open(podFileOrBytes: Uint8Array, opts: OpenPodOptions): Promise<OpenPodResult> {\n const { header, dumpJson } = await readPod(podFileOrBytes)\n\n let verification: PodVerifyResult | undefined\n if (opts.trustedKeys !== undefined) {\n verification = await verifyPodHeader(podFileOrBytes, opts.trustedKeys)\n if (verification.status === 'untrusted' || verification.status === 'tampered') {\n throw new PodHeaderVerificationError(verification.status, verification.keyId)\n }\n }\n\n // Reader's pre-restore generation snapshot (see module doc, step 5) —\n // must be read from the raw store BEFORE vault.load() overwrites it.\n const readerGeneration = (await loadFence(opts.store, opts.vault)).currentSchemaVersion\n\n const db = await createNoydb({ ...opts.noydbOptions, store: opts.store, user: opts.user, secret: opts.secret })\n const vault = await db.openVault(opts.vault)\n await vault.load(dumpJson)\n\n // #941 review fix: a NON-MINTING lookup, not `ensureCollectionDEK` (which\n // mints+persists a fresh DEK for any collection absent from the keyring).\n // open() is a READ path — deriveSchemaManifest only ever iterates\n // collections that already have a `_schemas` envelope, so an absent DEK\n // here means \"this principal cannot decrypt this sibling,\" never \"new\n // collection.\" The old minting call polluted a scoped principal's just-\n // restored `_keyring/<user>` file with garbage sibling DEKs on every\n // open(). See `derive.ts`'s `LookupDEK` doc for the full rationale.\n const keyring = await loadKeyring(opts.store, opts.vault, { userId: opts.user, secret: opts.secret })\n const lookupDEK: LookupDEK = async (name) => keyring.deks.get(name)\n const { manifest, undecodableCollections } = await deriveSchemaManifest(opts.store, opts.vault, lookupDEK)\n\n // A scoped principal's `manifest` is legitimately their own visible\n // slice (see `sync.ts`'s module doc) — `open()` is a per-principal read,\n // not an assertion of pod-wide completeness. `undecodableCollections` is\n // intentionally not surfaced on `OpenPodResult` (out of this fix's\n // scope); callers that need it can call `deriveSchemaManifest` directly.\n void undecodableCollections\n\n // See module doc, step 5 — the pod's generation signal is the highest\n // per-collection stamp, not the (locally re-derived, fence-driven)\n // top-level `manifest.generation`.\n const podGeneration = Object.values(manifest.collections)\n .reduce((max, entry) => Math.max(max, entry.generation), 0)\n\n if (podGeneration > readerGeneration) {\n if (!opts.allowGenerationAhead) {\n throw new MigrationRequiredError(\n `open(): pod's schema generation (${podGeneration}) is ahead of vault ` +\n `\"${opts.vault}\"'s local generation (${readerGeneration}). Pass ` +\n `\\`allowGenerationAhead: true\\` to open anyway, or reconcile the schema first.`,\n )\n }\n console.warn(\n `[noy-db] open(): vault \"${opts.vault}\" opened with allowGenerationAhead — pod schema ` +\n `generation ${podGeneration} is ahead of the local generation ${readerGeneration}.`,\n )\n } else if (podGeneration < readerGeneration) {\n // #941 review (Important 3, AC #4): divergence in EITHER direction\n // should be observable, not just the ahead-bypass case above. The\n // reader being ahead of the pod is non-fatal (the pod is simply older\n // content) but silent coexistence divergence is exactly what AC #4\n // asks to surface — same `[noy-db]`-prefixed console.warn facility as\n // `sync.ts`'s cap-exhaustion warning.\n console.warn(\n `[noy-db] open(): vault \"${opts.vault}\"'s local schema generation (${readerGeneration}) is ` +\n `ahead of the pod's (${podGeneration}) — the pod reflects an earlier schema than this reader.`,\n )\n }\n\n return { db, vault, header, manifest, ...(verification !== undefined ? { verification } : {}) }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,uBAAuB;AA4C7B,IAAM,uBAAuB;AAwBtB,SAAS,aACd,QACA,SACsB;AACtB,QAAM,YAAY,SAAS,cAAc;AAGzC,QAAM,YAAY,oBAAI,IAA2B;AACjD,QAAM,WAAW,oBAAI,IAA2B;AAChD,QAAM,SAAS,oBAAI,IAAY;AAG/B,MAAI,aAAa;AAMjB,QAAM,UAAU,oBAAI,IAAoC;AAExD,iBAAe,KAAK,OAAuC;AACzD,QAAI,OAAO,IAAI,KAAK,EAAG,QAAO,UAAU,IAAI,KAAK;AAEjD,UAAM,WAAW,QAAQ,IAAI,KAAK;AAClC,QAAI,SAAU,QAAO;AAErB,UAAM,WAAW,YAAY;AAC3B,YAAM,SAAS,MAAM,OAAO,WAAW,KAAK;AAC5C,UAAI,QAAQ;AACV,cAAM,OAAO,IAAI,YAAY,EAAE,OAAO,OAAO,KAAK;AAClD,cAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,kBAAU,IAAI,O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,QAAM,gBAAgB,OAAO,OAAO,SAAS,WAAW,EACrD,OAAO,CAAC,KAAK,UAAU,KAAK,IAAI,KAAK,MAAM,UAAU,GAAG,CAAC;AAE5D,MAAI,gBAAgB,kBAAkB;AACpC,QAAI,CAAC,KAAK,sBAAsB;AAC9B,YAAM,IAAI;AAAA,QACR,oCAAoC,aAAa,wBAC3C,KAAK,KAAK,yBAAyB,gBAAgB;AAAA,MAE3D;AAAA,IACF;AACA,YAAQ;AAAA,MACN,2BAA2B,KAAK,KAAK,mEACrB,aAAa,qCAAqC,gBAAgB;AAAA,IACpF;AAAA,EACF,WAAW,gBAAgB,kBAAkB;AAO3C,YAAQ;AAAA,MACN,2BAA2B,KAAK,KAAK,gCAAgC,gBAAgB,4BAC5D,aAAa;AAAA,IACxC;AAAA,EACF;AAEA,SAAO,EAAE,IAAI,OAAO,QAAQ,UAAU,GAAI,iBAAiB,SAAY,EAAE,aAAa,IAAI,CAAC,EAAG;AAChG;","names":[]}
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-IGJCYUT5.js";
|
|
4
4
|
import {
|
|
5
5
|
installViaBinder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UHXCLPGC.js";
|
|
7
7
|
import {
|
|
8
8
|
NoydbError,
|
|
9
9
|
ValidationError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HNGSV2YC.js";
|
|
11
11
|
|
|
12
12
|
// src/via/money/iso4217.ts
|
|
13
13
|
var MINOR_UNITS = {
|
|
@@ -1072,4 +1072,4 @@ export {
|
|
|
1072
1072
|
isMoneyString,
|
|
1073
1073
|
moneyNumber
|
|
1074
1074
|
};
|
|
1075
|
-
//# sourceMappingURL=chunk-
|
|
1075
|
+
//# sourceMappingURL=chunk-MZ5ZFO2D.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FY343IZR.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VCETL77O.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-24ZLWWEO.js";
|
|
10
10
|
import {
|
|
11
|
-
ConflictError,
|
|
12
11
|
SequenceContentionError,
|
|
13
12
|
SequenceNotEnabledError,
|
|
14
13
|
SequenceOfflineError,
|
|
15
|
-
ValidationError
|
|
16
|
-
|
|
14
|
+
ValidationError,
|
|
15
|
+
isConflictError
|
|
16
|
+
} from "./chunk-HNGSV2YC.js";
|
|
17
17
|
|
|
18
18
|
// src/with-commit/sequence/active.ts
|
|
19
19
|
function withSequence() {
|
|
@@ -154,7 +154,7 @@ var SequenceStore = class {
|
|
|
154
154
|
await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion);
|
|
155
155
|
return nextValue;
|
|
156
156
|
} catch (err) {
|
|
157
|
-
if (err
|
|
157
|
+
if (isConflictError(err)) {
|
|
158
158
|
lastConflict = err;
|
|
159
159
|
if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt);
|
|
160
160
|
continue;
|
|
@@ -178,7 +178,7 @@ var SequenceStore = class {
|
|
|
178
178
|
await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion);
|
|
179
179
|
return;
|
|
180
180
|
} catch (err) {
|
|
181
|
-
if (err
|
|
181
|
+
if (isConflictError(err)) {
|
|
182
182
|
lastConflict = err;
|
|
183
183
|
if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt);
|
|
184
184
|
continue;
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
resolveSequenceKey,
|
|
200
200
|
SequenceStore
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-NQCNSVGI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-commit/sequence/active.ts","../src/with-commit/sequence/strategy.ts","../src/with-commit/sequence/index.ts"],"sourcesContent":["/**\n * Enable the atomic-sequence capability.\n * Pass to `createNoydb({ sequenceStrategy: withSequence() })` to make\n * `vault.sequence('name').next()` / `.peek()` / `.seedTo()` live. The\n * {@link SequenceStore} CAS engine is statically imported here, so it is pulled\n * into the bundle only when `withSequence()` is referenced (the floor never\n * imports it).\n */\nimport type { SequenceStrategy } from './strategy.js'\nimport { SequenceStore } from './index.js'\n\nexport function withSequence(): SequenceStrategy {\n return {\n createStore(opts) {\n return new SequenceStore(opts)\n },\n }\n}\n","/**\n * Sequence capability strategy — the single on-demand factory the vault routes\n * `vault.sequence()` through to build its atomic-CAS {@link SequenceStore}. The\n * active engine ({@link withSequence}) constructs the real store (kept out of\n * the floor bundle — the store class is reached only via the opt-in\n * `active.ts` chunk); {@link NO_SEQUENCE} throws. The vault always assembles the\n * per-call {@link SequenceStoreOptions} and delegates here, so an un-opted-in\n * caller hits `NO_SEQUENCE`'s throw at `vault.sequence()`.\n *\n * Note: `vault.sequence()` is synchronous, so the factory is a plain (sync)\n * constructor — the engine is tree-shaken by reachability (only `withSequence()`\n * pulls `active.ts`, which statically imports the store), not by a dynamic\n * import. Deferred-numbering series (`withDeferredNumbering`) are a distinct\n * capability and are NOT routed through this strategy.\n * @internal\n */\nimport type { SequenceStore, SequenceStoreOptions } from './index.js'\nimport { SequenceNotEnabledError } from '../../kernel/errors.js'\n\nexport interface SequenceStrategy {\n createStore(opts: SequenceStoreOptions): SequenceStore\n}\n\n/**\n * No-op stub — the floor default. The capability factory throws\n * {@link SequenceNotEnabledError}; opt in with `sequenceStrategy: withSequence()`\n * in createNoydb. @internal\n */\nexport const NO_SEQUENCE: SequenceStrategy = {\n createStore(): SequenceStore {\n throw new SequenceNotEnabledError()\n },\n}\n","/**\n * Atomic sequence primitive — online-coordinated gap-free numbering.\n *\n * `vault.sequence('invoice-2026').next()` returns 1, 2, 3, … with no\n * gaps and no duplicates, even under concurrent callers. Each named\n * sequence is an independent counter record at `_sequences/<name>`,\n * incremented with an optimistic compare-and-swap retry loop — the same\n * proven pattern as the ledger head (`history/ledger/store.ts`).\n *\n * **Explicitly online-only.** Gap-free numbering requires single-authority\n * serialization, which an offline / non-CAS store cannot provide. `next()`\n * throws {@link SequenceOfflineError} unless the backing store advertises\n * `capabilities.casAtomic`. This is a deliberate, honest wall — an offline\n * writer cannot safely allocate a global sequence number.\n *\n * Note on \"gap-free\": the *sequence* is gap-free (each `next()` yields a\n * unique, +1 value). If a caller discards a value without using it, that\n * is a gap in *usage*, not in the sequence — assign each `next()` result\n * to its record in the same operation.\n */\n\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport { encrypt, openEnvelopeJson, type EnclaveKey } from '../../kernel/enclave/index.js'\nimport type { ConflictError} from '../../kernel/errors.js';\nimport { isConflictError, SequenceContentionError, SequenceOfflineError, ValidationError } from '../../kernel/errors.js'\n\n// Capability opt-in seam (S4): `vault.sequence()` builds its CAS store through\n// the sequenceStrategy, so it throws SequenceNotEnabledError unless opted in.\nexport { withSequence } from './active.js'\nexport { NO_SEQUENCE, type SequenceStrategy } from './strategy.js'\nexport { SequenceNotEnabledError } from '../../kernel/errors.js'\n\nexport const SEQUENCE_COLLECTION = '_sequences'\n// A sequence is a single hot CAS row — higher contention than a ledger\n// append. A larger budget + jittered backoff absorbs moderate concurrency;\n// a genuine burst beyond this surfaces SequenceContentionError so the\n// caller can retry / queue (the honest online-only contract).\nconst MAX_NEXT_ATTEMPTS = 16\n\ninterface SequenceState {\n value: number\n}\n\n/** Options for `SequenceHandle.next`. Deferred-numbering series use `for`; the CAS counter ignores all of these. */\nexport interface NextOptions {\n /** Deferred mode: the record id to number. Ignored by the CAS counter. */\n readonly for?: string\n /** Deferred mode: reject after this many ms if still unsealed (reserved; not yet enforced in this slice). */\n readonly timeoutMs?: number\n}\n\n/**\n * Partitioning for a CAS sequence. A partitioned sequence is an\n * independent counter scoped to one tuple of values — e.g.\n * `sequence('invoice', { partition: [2026, 'EU'] })` numbers EU-2026 invoices\n * separately from `[2026, 'US']` and from the bare `invoice` series.\n *\n * Partition components are URI-encoded (so `/`, null bytes and other\n * separators in a value can never collide with the structural separators) and\n * `'/'`-joined, then appended to the series with a null-byte (`\\x00`)\n * separator. The null byte is illegal in a plain series name, which guarantees\n * a partitioned key is always disjoint from any unpartitioned series.\n */\nexport interface SequenceOptions {\n /** Partition tuple. Each component is URI-encoded and `'/'`-joined. */\n readonly partition?: readonly (string | number)[]\n /**\n * Render template for the serial string. When set, `vault.sequence`\n * returns a {@link FormattedSequenceHandle} whose `next()` resolves to\n * `{ serial, formatted }`. Tokens:\n * - `{seq}` — the allocated integer\n * - `{seq:0N}` — zero-padded to width N (e.g. `{seq:04}` → `0001`)\n * - `{partition.i}` — the i-th `partition` component (original value)\n *\n * Any other token, or a `{partition.i}` index beyond the supplied\n * `partition`, throws `ValidationError` at `vault.sequence()` construction.\n * Per-partition reset is inherent: a new partition tuple starts at 1.\n */\n readonly format?: string\n}\n\n/**\n * A formatted sequence handle. Identical to {@link SequenceHandle}\n * except `next()` also returns the rendered `formatted` string. `peek()` /\n * `seedTo()` operate on the underlying integer counter, unchanged.\n */\nexport interface FormattedSequenceHandle {\n /** Allocate the next value and return it with its rendered serial string. */\n next(opts?: NextOptions): Promise<{ serial: number; formatted: string }>\n /** Read the current integer value without allocating. Returns 0 if never used. */\n peek(): Promise<number>\n /** Set-if-greater on the underlying integer counter. See {@link SequenceHandle.seedTo}. */\n seedTo(n: number): Promise<void>\n}\n\n// Matches a single `{...}` token with no nested braces.\nconst SEQ_FORMAT_TOKEN = /\\{([^{}]*)\\}/g\nconst SEQ_PAD_TOKEN = /^seq:0(\\d+)$/\nconst SEQ_PARTITION_TOKEN = /^partition\\.(\\d+)$/\n\n/**\n * Validate a sequence `format` against the supplied partition and return a\n * pure `(serial) => string` renderer. Eager validation: every token is\n * checked now, so a bad pattern throws `ValidationError` at construction —\n * never at `next()` time.\n */\nexport function compileSequenceFormat(\n format: string,\n series: string,\n partition: readonly (string | number)[] | undefined,\n): (serial: number) => string {\n const parts = partition ?? []\n for (const m of format.matchAll(SEQ_FORMAT_TOKEN)) {\n const token = m[1] ?? ''\n if (token === 'seq') continue\n if (SEQ_PAD_TOKEN.test(token)) continue\n const partMatch = SEQ_PARTITION_TOKEN.exec(token)\n if (partMatch) {\n const idx = Number(partMatch[1])\n if (idx >= parts.length) {\n throw new ValidationError(\n `sequence(\"${series}\"): format token \"{${token}}\" references partition index ${idx}, ` +\n `but only ${parts.length} partition component(s) were supplied.`,\n )\n }\n continue\n }\n throw new ValidationError(\n `sequence(\"${series}\"): format contains unknown token \"{${token}}\". ` +\n `Accepted tokens: {seq}, {seq:0N}, {partition.i}.`,\n )\n }\n return (serial: number): string =>\n format.replace(SEQ_FORMAT_TOKEN, (full, token: string) => {\n if (token === 'seq') return String(serial)\n const padMatch = SEQ_PAD_TOKEN.exec(token)\n if (padMatch) return String(serial).padStart(Number(padMatch[1]), '0')\n const partMatch = SEQ_PARTITION_TOKEN.exec(token)\n if (partMatch) return String(parts[Number(partMatch[1])])\n return full // unreachable — validated above\n })\n}\n\n/**\n * Resolve the CAS storage key for a (series, partition) pair.\n *\n * With no partition the key is `series` verbatim. With a partition the key is\n * `${series}\\x00${parts}` where `parts` is each component passed through\n * `encodeURIComponent(String(part))` and `'/'`-joined. The null-byte separator\n * is illegal in a plain series name, so partitioned keys never collide with\n * unpartitioned ones; URI-encoding keeps any component containing `/` distinct\n * from a multi-component partition.\n *\n * @throws {ValidationError} if any partition component is empty after `String()`\n * or is a non-finite number (`NaN`, `±Infinity`).\n */\nexport function resolveSequenceKey(series: string, opts?: SequenceOptions): string {\n const partition = opts?.partition\n if (!partition || partition.length === 0) return series\n const parts = partition.map((p) => {\n if (typeof p === 'number' && !Number.isFinite(p)) {\n throw new ValidationError(`sequence partition component must be a finite number, got ${p}`)\n }\n const s = String(p)\n if (s === '') {\n throw new ValidationError('sequence partition component must not be empty')\n }\n return encodeURIComponent(s)\n })\n return `${series}\\x00${parts.join('/')}`\n}\n\nexport interface SequenceHandle {\n /** Atomically allocate and return the next value (1, 2, 3, …). Deferred series resolve at the next pass. */\n next(opts?: NextOptions): Promise<number>\n /** Read the current value without allocating. Returns 0 if never used. */\n peek(): Promise<number>\n /**\n * Set-if-greater: advance the counter to at least `n`. A no-op if the\n * current value is already `>= n` (so it never rewinds), and `seedTo(0)` is\n * a no-op. Idempotent and CAS-safe under concurrent `next()` / `seedTo()`.\n *\n * Use after a bundle / CSV import to fast-forward the counter past the\n * highest imported serial, so subsequent `next()` calls cannot re-use a\n * number that is already on a record.\n *\n * Online-only: throws {@link SequenceOfflineError} on a non-CAS store.\n */\n seedTo(n: number): Promise<void>\n}\n\nasync function sleepBackoff(attempt: number): Promise<void> {\n // Exponential backoff with full jitter to break the thundering herd\n // when many writers contend on the same counter row.\n const ceil = Math.min(2 ** attempt, 32)\n const ms = Math.floor(Math.random() * ceil)\n await new Promise((r) => setTimeout(r, ms))\n}\n\n/** Per-call context the vault assembles to build a {@link SequenceStore}. */\nexport interface SequenceStoreOptions {\n adapter: NoydbStore\n vault: string\n encrypted: boolean\n getDEK: (collectionName: string) => Promise<EnclaveKey>\n actor: string\n}\n\nexport class SequenceStore {\n private readonly adapter: NoydbStore\n private readonly vault: string\n private readonly encrypted: boolean\n private readonly getDEK: (collectionName: string) => Promise<EnclaveKey>\n private readonly actor: string\n /**\n * Memoized DEK promise. The `_sequences` collection DEK is created on\n * first access; without sharing one promise, a burst of concurrent\n * `next()` calls would each trigger DEK creation and diverge (one\n * writer's ciphertext unreadable by another). One shared promise → one\n * DEK.\n */\n private dekPromise: Promise<EnclaveKey> | null = null\n\n constructor(opts: SequenceStoreOptions) {\n this.adapter = opts.adapter\n this.vault = opts.vault\n this.encrypted = opts.encrypted\n this.getDEK = opts.getDEK\n this.actor = opts.actor\n }\n\n /** A handle bound to one sequence name. */\n handle(name: string): SequenceHandle {\n return {\n next: () => this.next(name),\n peek: () => this.peek(name),\n seedTo: (n) => this.seedTo(name, n),\n }\n }\n\n private assertOnline(): void {\n if (this.adapter.capabilities?.casAtomic !== true) {\n throw new SequenceOfflineError()\n }\n }\n\n private dek(): Promise<EnclaveKey> {\n if (!this.dekPromise) this.dekPromise = this.getDEK(SEQUENCE_COLLECTION)\n return this.dekPromise\n }\n\n private async read(name: string): Promise<{ env: EncryptedEnvelope | null; value: number }> {\n const env = await this.adapter.get(this.vault, SEQUENCE_COLLECTION, name)\n if (!env) return { env: null, value: 0 }\n const json = this.encrypted ? await openEnvelopeJson(env, await this.dek()) : env._data\n const state = JSON.parse(json) as SequenceState\n return { env, value: state.value }\n }\n\n private async encryptState(state: SequenceState, version: number): Promise<EncryptedEnvelope> {\n const json = JSON.stringify(state)\n if (!this.encrypted) {\n return { _noydb: NOYDB_FORMAT_VERSION, _v: version, _ts: new Date().toISOString(), _iv: '', _data: json, _by: this.actor }\n }\n const { iv, data } = await encrypt(json, await this.dek())\n return { _noydb: NOYDB_FORMAT_VERSION, _v: version, _ts: new Date().toISOString(), _iv: iv, _data: data, _by: this.actor }\n }\n\n async peek(name: string): Promise<number> {\n return (await this.read(name)).value\n }\n\n async next(name: string): Promise<number> {\n this.assertOnline()\n let lastConflict: ConflictError | undefined\n for (let attempt = 0; attempt < MAX_NEXT_ATTEMPTS; attempt++) {\n const { env, value } = await this.read(name)\n const nextValue = value + 1\n const expectedVersion = env?._v ?? 0 // 0 ≡ \"must not yet exist\" (create)\n const envelope = await this.encryptState({ value: nextValue }, expectedVersion + 1)\n try {\n await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion)\n return nextValue\n } catch (err) {\n if (isConflictError(err)) {\n lastConflict = err\n if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt)\n continue\n }\n throw err\n }\n }\n void lastConflict\n throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS)\n }\n\n async seedTo(name: string, n: number): Promise<void> {\n this.assertOnline()\n if (n <= 0) return // set-if-greater: 0 (and any non-positive seed) is a no-op\n let lastConflict: ConflictError | undefined\n for (let attempt = 0; attempt < MAX_NEXT_ATTEMPTS; attempt++) {\n const { env, value } = await this.read(name)\n if (value >= n) return // already at or past the floor — no write, idempotent\n const expectedVersion = env?._v ?? 0 // 0 ≡ \"must not yet exist\" (create)\n const envelope = await this.encryptState({ value: n }, expectedVersion + 1)\n try {\n await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion)\n return\n } catch (err) {\n if (isConflictError(err)) {\n lastConflict = err\n if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt)\n continue\n }\n throw err\n }\n }\n void lastConflict\n throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAWO,SAAS,eAAiC;AAC/C,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,aAAO,IAAI,cAAc,IAAI;AAAA,IAC/B;AAAA,EACF;AACF;;;ACWO,IAAM,cAAgC;AAAA,EAC3C,cAA6B;AAC3B,UAAM,IAAI,wBAAwB;AAAA,EACpC;AACF;;;ACCO,IAAM,sBAAsB;AAKnC,IAAM,oBAAoB;AA2D1B,IAAM,mBAAmB;AACzB,IAAM,gBAAgB;AACtB,IAAM,sBAAsB;AAQrB,SAAS,sBACd,QACA,QACA,WAC4B;AAC5B,QAAM,QAAQ,aAAa,CAAC;AAC5B,aAAW,KAAK,OAAO,SAAS,gBAAgB,GAAG;AACjD,UAAM,QAAQ,EAAE,CAAC,KAAK;AACtB,QAAI,UAAU,MAAO;AACrB,QAAI,cAAc,KAAK,KAAK,EAAG;AAC/B,UAAM,YAAY,oBAAoB,KAAK,KAAK;AAChD,QAAI,WAAW;AACb,YAAM,MAAM,OAAO,UAA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M,EAAE,KAAK,MAAM,IAAI,MAAM,KAAK,KAAK,IAAI;AAC3C,UAAI,SAAS,EAAG;AAChB,YAAM,kBAAkB,KAAK,MAAM;AACnC,YAAM,WAAW,MAAM,KAAK,aAAa,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC;AAC1E,UAAI;AACF,cAAM,KAAK,QAAQ,IAAI,KAAK,OAAO,qBAAqB,MAAM,UAAU,eAAe;AACvF;AAAA,MACF,SAAS,KAAK;AACZ,YAAI,gBAAgB,GAAG,GAAG;AACxB,yBAAe;AACf,cAAI,UAAU,oBAAoB,EAAG,OAAM,aAAa,OAAO;AAC/D;AAAA,QACF;AACA,cAAM;AAAA,MACR;AAAA,IACF;AACA,SAAK;AACL,UAAM,IAAI,wBAAwB,MAAM,iBAAiB;AAAA,EAC3D;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-24ZLWWEO.js";
|
|
4
4
|
|
|
5
5
|
// src/kernel/enclave/record-keys/tombstone.ts
|
|
6
6
|
function isTombstoneShape(envelope) {
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
isDeleteMarker,
|
|
43
43
|
buildDeleteMarker
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-NQRJ5AJO.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-24ZLWWEO.js";
|
|
4
4
|
|
|
5
5
|
// src/with-party/policy/storage.ts
|
|
6
6
|
var META_COLLECTION = "_meta";
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
loadVaultPolicy,
|
|
40
40
|
saveVaultPolicy
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-NVU7ZMPN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OverlayIdMismatchError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HNGSV2YC.js";
|
|
4
4
|
|
|
5
5
|
// src/with-formula/overlay-views/virtual-collection.ts
|
|
6
6
|
var OverlayedCollection = class {
|
|
@@ -206,4 +206,4 @@ var OverlayedCollection = class {
|
|
|
206
206
|
export {
|
|
207
207
|
OverlayedCollection
|
|
208
208
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
209
|
+
//# sourceMappingURL=chunk-OF3L2SD6.js.map
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
walkClosure
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BPTZ4K5L.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveManagedSecret
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MC2LFTQM.js";
|
|
7
7
|
import {
|
|
8
8
|
parseExtractedPartitionBody,
|
|
9
9
|
readPod,
|
|
10
10
|
readPodHeader
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EK7DT5BT.js";
|
|
12
12
|
import {
|
|
13
13
|
createOwnerKeyring
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RLWY6Z44.js";
|
|
15
15
|
import {
|
|
16
16
|
diff
|
|
17
17
|
} from "./chunk-SVLR4POP.js";
|
|
18
18
|
import {
|
|
19
19
|
LedgerStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZK4CO2KZ.js";
|
|
21
21
|
import {
|
|
22
22
|
LEDGER_COLLECTION
|
|
23
23
|
} from "./chunk-I7FD46FF.js";
|
|
24
24
|
import {
|
|
25
25
|
openEnvelopeJson
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FY343IZR.js";
|
|
27
27
|
import {
|
|
28
28
|
base64ToBuffer,
|
|
29
29
|
wrapKey
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VCETL77O.js";
|
|
31
31
|
import {
|
|
32
32
|
AdoptionStateError,
|
|
33
33
|
TransferSealError,
|
|
34
34
|
ValidationError
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-HNGSV2YC.js";
|
|
36
36
|
|
|
37
37
|
// src/with-cargo/vault-diff.ts
|
|
38
38
|
async function diffVault(vault, candidate, options = {}) {
|
|
@@ -193,7 +193,7 @@ function shortJSON(value) {
|
|
|
193
193
|
function withCargo() {
|
|
194
194
|
return {
|
|
195
195
|
async extractPartition(vault, opts) {
|
|
196
|
-
const { extractPartitionCore } = await import("./extract-partition-
|
|
196
|
+
const { extractPartitionCore } = await import("./extract-partition-TWXPHVU7.js");
|
|
197
197
|
return extractPartitionCore(vault, opts);
|
|
198
198
|
}
|
|
199
199
|
};
|
|
@@ -399,7 +399,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
if (isManaged(opts)) {
|
|
402
|
-
const { createNoydb } = await import("./noydb-
|
|
402
|
+
const { createNoydb } = await import("./noydb-6W2XGQCS.js");
|
|
403
403
|
const db = await createNoydb({
|
|
404
404
|
store,
|
|
405
405
|
user: userId,
|
|
@@ -455,4 +455,4 @@ export {
|
|
|
455
455
|
withCargo,
|
|
456
456
|
describeExtraction
|
|
457
457
|
};
|
|
458
|
-
//# sourceMappingURL=chunk-
|
|
458
|
+
//# sourceMappingURL=chunk-OMSAULZM.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
persistUserVisibility,
|
|
5
5
|
readUserVisibility,
|
|
6
6
|
saveUserEnvelope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-27TCYH6G.js";
|
|
8
8
|
import {
|
|
9
9
|
PolicyDeniedError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HNGSV2YC.js";
|
|
11
11
|
|
|
12
12
|
// src/with-party/directory/user-envelope/api.ts
|
|
13
13
|
var UserApi = class {
|
|
@@ -379,4 +379,4 @@ export {
|
|
|
379
379
|
UserApi,
|
|
380
380
|
createUserApi
|
|
381
381
|
};
|
|
382
|
-
//# sourceMappingURL=chunk-
|
|
382
|
+
//# sourceMappingURL=chunk-OSFPNKY4.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installViaBinder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UHXCLPGC.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VCETL77O.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-24ZLWWEO.js";
|
|
10
10
|
import {
|
|
11
11
|
ValidationError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HNGSV2YC.js";
|
|
13
13
|
|
|
14
14
|
// src/via/blob/binding.ts
|
|
15
15
|
async function eraseBlobs(ctx, cfg) {
|
|
@@ -400,4 +400,4 @@ export {
|
|
|
400
400
|
BLOB_EVICTION_AUDIT_COLLECTION,
|
|
401
401
|
runCompaction
|
|
402
402
|
};
|
|
403
|
-
//# sourceMappingURL=chunk-
|
|
403
|
+
//# sourceMappingURL=chunk-P7NGLLUF.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertTierAccess,
|
|
3
3
|
dekKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AHLJSVRL.js";
|
|
5
5
|
import {
|
|
6
6
|
applyRewrappedBody,
|
|
7
7
|
rewrapBodyToDek
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FY343IZR.js";
|
|
9
9
|
import {
|
|
10
10
|
isDeleteMarker,
|
|
11
11
|
isTombstoneShape
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NQRJ5AJO.js";
|
|
13
13
|
import {
|
|
14
14
|
decrypt,
|
|
15
15
|
encrypt,
|
|
16
16
|
unwrapCek
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VCETL77O.js";
|
|
18
18
|
import {
|
|
19
19
|
NOYDB_FORMAT_VERSION
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-24ZLWWEO.js";
|
|
21
21
|
import {
|
|
22
22
|
PersistedIndexCompensationError,
|
|
23
23
|
TierDemoteDeniedError,
|
|
24
24
|
TiersNotEnabledError,
|
|
25
25
|
UnsupportedTierCompositionError
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HNGSV2YC.js";
|
|
27
27
|
|
|
28
28
|
// src/with-audit/tiers/active.ts
|
|
29
29
|
function withTiers() {
|
|
@@ -378,4 +378,4 @@ export {
|
|
|
378
378
|
demote,
|
|
379
379
|
classifySealedShred
|
|
380
380
|
};
|
|
381
|
-
//# sourceMappingURL=chunk-
|
|
381
|
+
//# sourceMappingURL=chunk-PGAPBZEK.js.map
|
|
@@ -201,7 +201,7 @@ var engineCtx = (ctx) => ({
|
|
|
201
201
|
function withClassified() {
|
|
202
202
|
return {
|
|
203
203
|
async reveal(ctx, id, field) {
|
|
204
|
-
const { revealSealedField } = await import("./reveal-
|
|
204
|
+
const { revealSealedField } = await import("./reveal-AG4SCHUQ.js");
|
|
205
205
|
const value = await revealSealedField({
|
|
206
206
|
collection: ctx.collection,
|
|
207
207
|
encrypted: ctx.encrypted,
|
|
@@ -213,26 +213,26 @@ function withClassified() {
|
|
|
213
213
|
return value;
|
|
214
214
|
},
|
|
215
215
|
async verify(ctx, id, field, candidate) {
|
|
216
|
-
const { verifyDigestField } = await import("./verify-
|
|
216
|
+
const { verifyDigestField } = await import("./verify-RO5RTZOJ.js");
|
|
217
217
|
const verdict = await verifyDigestField(engineCtx(ctx), id, field, candidate, policyOf(ctx.spec));
|
|
218
218
|
await ctx.onAccess?.("verify", id);
|
|
219
219
|
return verdict;
|
|
220
220
|
},
|
|
221
221
|
async verifyText(ctx, id, field, candidate) {
|
|
222
|
-
const { verifyTextField } = await import("./verify-
|
|
222
|
+
const { verifyTextField } = await import("./verify-RO5RTZOJ.js");
|
|
223
223
|
const verdict = await verifyTextField(engineCtx(ctx), id, field, candidate, ctx.spec.verifyNormalize ?? "password");
|
|
224
224
|
await ctx.onAccess?.("verify", id);
|
|
225
225
|
return verdict;
|
|
226
226
|
},
|
|
227
227
|
async matchGroup(ctx, id, answers, opts) {
|
|
228
|
-
const { matchGroupFields } = await import("./verify-
|
|
228
|
+
const { matchGroupFields } = await import("./verify-RO5RTZOJ.js");
|
|
229
229
|
const members = (ctx.groupMembers ?? []).map((m) => ({ field: m.field, policy: policyOf(m.spec) }));
|
|
230
230
|
const result = await matchGroupFields(engineCtx(ctx), id, answers, members, opts);
|
|
231
231
|
await ctx.onAccess?.("verify", id);
|
|
232
232
|
return result;
|
|
233
233
|
},
|
|
234
234
|
async computeTarget(ctx, field, candidate, costByte) {
|
|
235
|
-
const { computeBidxTarget } = await import("./find-
|
|
235
|
+
const { computeBidxTarget } = await import("./find-RBBYKXI7.js");
|
|
236
236
|
const dek = await ctx.getDEK();
|
|
237
237
|
return computeBidxTarget(candidate, policyOf(ctx.spec).normalize, dek, ctx.collection, field, costByte);
|
|
238
238
|
}
|
|
@@ -244,4 +244,4 @@ export {
|
|
|
244
244
|
classified,
|
|
245
245
|
withClassified
|
|
246
246
|
};
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
247
|
+
//# sourceMappingURL=chunk-PP5CO2PR.js.map
|