@noy-db/hub 0.2.0-pre.23 → 0.2.0-pre.24
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/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +3 -3
- package/dist/aggregate/index.d.ts +3 -3
- package/dist/aggregate/index.js +5 -5
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +4 -4
- package/dist/attestation/index.d.ts +4 -4
- package/dist/attestation/index.js +6 -6
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +6 -6
- package/dist/blobs/index.d.ts +6 -6
- package/dist/blobs/index.js +6 -6
- package/dist/bundle/index.cjs +617 -1202
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +15 -6
- package/dist/bundle/index.d.ts +15 -6
- package/dist/bundle/index.js +58 -193
- package/dist/bundle/index.js.map +1 -1
- package/dist/{chunk-CQYEDODS.js → chunk-35U5YNRR.js} +3 -3
- package/dist/{chunk-NV4IHBZS.js → chunk-3XJU3OHE.js} +5 -5
- package/dist/{chunk-OTWT6BAJ.js → chunk-4BB4T3O7.js} +12 -2
- package/dist/chunk-4BB4T3O7.js.map +1 -0
- package/dist/{chunk-IVZWHIEK.js → chunk-4HEGG5NJ.js} +5 -5
- package/dist/{chunk-WE2BUQD2.js → chunk-4TCMCCC3.js} +5 -3
- package/dist/{chunk-5YTXYPES.js → chunk-5A2FVGHT.js} +5 -5
- package/dist/{chunk-NSXNXLYM.js → chunk-5GZC2ZM3.js} +2 -2
- package/dist/{chunk-JYNH4FIM.js → chunk-77WF53XY.js} +4 -4
- package/dist/{chunk-O5XKZCUD.js → chunk-7X4EF35A.js} +5 -5
- package/dist/{chunk-SQKAECUL.js → chunk-7ZCTUI26.js} +2 -2
- package/dist/{chunk-J6RGRZOY.js → chunk-AO3QSMCU.js} +2 -2
- package/dist/{chunk-JDCPRJVS.js → chunk-AONK5GCC.js} +4 -4
- package/dist/{chunk-FRRJIUSI.js → chunk-B5CSNGSE.js} +17 -9
- package/dist/chunk-B5CSNGSE.js.map +1 -0
- package/dist/{chunk-IY24WS2P.js → chunk-BCMHJYVT.js} +4 -4
- package/dist/{chunk-IY24WS2P.js.map → chunk-BCMHJYVT.js.map} +1 -1
- package/dist/{chunk-TYMDCIQM.js → chunk-C472BRJ4.js} +4 -4
- package/dist/{chunk-MBXKRHSS.js → chunk-CCNRFAL3.js} +2 -2
- package/dist/{chunk-BZW5IL43.js → chunk-DCA2BDHA.js} +4 -4
- package/dist/{chunk-JBBWALNI.js → chunk-DCICHSRS.js} +2 -2
- package/dist/{chunk-2XA2ZML4.js → chunk-FG6IQ3ZL.js} +3 -3
- package/dist/{chunk-C2RJVZZL.js → chunk-G4GW5VOS.js} +2 -2
- package/dist/{chunk-U2XSUCDF.js → chunk-GEWIFM4J.js} +2 -2
- package/dist/{chunk-TNH5SLCD.js → chunk-HD4QCT2O.js} +2 -2
- package/dist/{chunk-I3IYTUUI.js → chunk-HHJ5DZCZ.js} +3 -3
- package/dist/{chunk-6QAZ5O6X.js → chunk-IEIADIPM.js} +2 -2
- package/dist/{chunk-YPIOFSN3.js → chunk-IHAISFXP.js} +2 -2
- package/dist/{chunk-GJTKMME7.js → chunk-JKM2AVVH.js} +2 -2
- package/dist/{chunk-EYK72OTL.js → chunk-JRMOSIH4.js} +5 -5
- package/dist/chunk-JRMOSIH4.js.map +1 -0
- package/dist/{chunk-S45MDEEF.js → chunk-LMWVNF6X.js} +2 -2
- package/dist/{chunk-TA6HPKWQ.js → chunk-LR7CODVN.js} +1 -1
- package/dist/chunk-LR7CODVN.js.map +1 -0
- package/dist/{chunk-TAMRU7A2.js → chunk-OKV7S356.js} +4 -4
- package/dist/{chunk-HYJMAV53.js → chunk-OWAMTSAI.js} +93 -93
- package/dist/chunk-OWAMTSAI.js.map +1 -0
- package/dist/{chunk-IW4L4X65.js → chunk-P5A4E53B.js} +2 -2
- package/dist/{chunk-JOK73NDT.js → chunk-P7OL22JP.js} +3 -3
- package/dist/{chunk-P65YMN5V.js → chunk-QOXZM3L2.js} +407 -162
- package/dist/chunk-QOXZM3L2.js.map +1 -0
- package/dist/chunk-R43KS34V.js +399 -0
- package/dist/chunk-R43KS34V.js.map +1 -0
- package/dist/{chunk-TGIJTNM3.js → chunk-R5ZECURV.js} +2 -2
- package/dist/{chunk-KOAJ3TZM.js → chunk-RFEXGW3L.js} +2 -2
- package/dist/{chunk-F5ILTHMU.js → chunk-RNQPDV75.js} +5 -5
- package/dist/{chunk-WWVJXBOT.js → chunk-SGM7CK7R.js} +5 -5
- package/dist/{chunk-7MRT7EPB.js → chunk-SOQE5DUV.js} +3 -3
- package/dist/{chunk-F5GWNSE2.js → chunk-TOMSCJRV.js} +3 -3
- package/dist/{chunk-F5GWNSE2.js.map → chunk-TOMSCJRV.js.map} +1 -1
- package/dist/{chunk-ZONKSLF2.js → chunk-TQMQZOMX.js} +2 -2
- package/dist/{chunk-3HNKR65T.js → chunk-U6LTLN7O.js} +3 -3
- package/dist/{chunk-UU6M64HI.js → chunk-UAK2AMO2.js} +4 -4
- package/dist/{chunk-37VGJM3T.js → chunk-WQ3KAGOV.js} +2 -2
- package/dist/{chunk-C6W5KVDV.js → chunk-XC32SZPW.js} +35 -35
- package/dist/chunk-XC32SZPW.js.map +1 -0
- package/dist/{chunk-AI4USDRI.js → chunk-XQO4TAJS.js} +4 -4
- package/dist/{chunk-SQOK5UM6.js → chunk-ZBENTRFS.js} +2 -2
- package/dist/{chunk-6QE4DUYC.js → chunk-ZDITTESU.js} +2 -2
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-456N7UVX.js → crypto-2LU6XUFF.js} +3 -3
- package/dist/{delegation-DP4COTXB.js → delegation-6ABSJGXV.js} +5 -5
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +6 -6
- package/dist/derivations/index.d.ts +6 -6
- package/dist/derivations/index.js +4 -4
- package/dist/{dev-unlock-DzDzLTdZ.d.ts → dev-unlock-BlhRHr6p.d.ts} +1 -1
- package/dist/{dev-unlock-Bw7iBD1D.d.cts → dev-unlock-DURe4IvF.d.cts} +1 -1
- package/dist/{errors-Dkc_fi-S.d.cts → errors-B2tUcRPg.d.cts} +19 -5
- package/dist/{errors-Dkc_fi-S.d.ts → errors-B2tUcRPg.d.ts} +19 -5
- package/dist/executor-JKMSEB34.js +8 -0
- package/dist/executor-UYXSQB4D.js +12 -0
- package/dist/executor-VJSCTBWY.js +8 -0
- package/dist/{fanout-sidecar-YXNAEZ33.js → fanout-sidecar-ZQT4Y7PF.js} +2 -2
- package/dist/forget/index.js +4 -4
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +6 -6
- package/dist/guards/index.d.ts +6 -6
- package/dist/guards/index.js +6 -6
- package/dist/{hash-C52X_-m5.d.cts → hash-CqRZfDZH.d.cts} +1 -1
- package/dist/{hash-DepR-xVc.d.ts → hash-cF4iWaBV.d.ts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +6 -6
- package/dist/history/index.d.ts +6 -6
- package/dist/history/index.js +5 -5
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +5 -5
- package/dist/i18n/index.d.ts +5 -5
- package/dist/i18n/index.js +6 -6
- package/dist/index-B8MoIS7B.d.ts +70 -0
- package/dist/{index-Bm9hIY7t.d.ts → index-BLff_E35.d.ts} +2 -2
- package/dist/{index-tZqVB9g5.d.cts → index-BthnP2MA.d.cts} +2 -2
- package/dist/index-da0M3NnR.d.cts +70 -0
- package/dist/index.cjs +25907 -25557
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +135 -80
- package/dist/index.d.ts +135 -80
- package/dist/index.js +78 -51
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.js +4 -4
- package/dist/issue-KLRMW5DH.js +12 -0
- package/dist/kernel/index.cjs +657 -0
- package/dist/kernel/index.cjs.map +1 -0
- package/dist/kernel/index.d.cts +11 -0
- package/dist/kernel/index.d.ts +11 -0
- package/dist/kernel/index.js +40 -0
- package/dist/{ledger-I7JUYP4L.js → ledger-VOS2X3WJ.js} +5 -5
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +6 -6
- package/dist/materialized-views/index.d.ts +6 -6
- package/dist/materialized-views/index.js +8 -8
- package/dist/{mime-magic-Dejetix_.d.ts → mime-magic-BswIvWkR.d.ts} +1 -1
- package/dist/{mime-magic-Cxf9B_Dm.d.cts → mime-magic-CCrP-iXJ.d.cts} +1 -1
- package/dist/{ulid-Bg-IBJyA.d.cts → multi-bundle-6s5nKAZX.d.ts} +114 -58
- package/dist/{ulid-Dwt3JEcy.d.ts → multi-bundle-WhYiJEgV.d.cts} +114 -58
- package/dist/noydb-2PI2ZBX6.js +38 -0
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +6 -6
- package/dist/overlay-views/index.d.ts +6 -6
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +5 -5
- package/dist/periods/index.d.ts +5 -5
- package/dist/periods/index.js +5 -5
- package/dist/{public-envelope-5XRTUNKF.js → public-envelope-IJJMWSTJ.js} +4 -4
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +7 -7
- package/dist/registry-GAIFVWXF.js +8 -0
- package/dist/registry-J77ZUQ7G.js +8 -0
- package/dist/{registry-NWHOLD5M.js → registry-JGEVJ6YC.js} +3 -3
- package/dist/{revoke-5IEK22KT.js → revoke-WUY4AYRJ.js} +6 -6
- package/dist/sealed-record/index.cjs.map +1 -1
- package/dist/sealed-record/index.d.cts +1 -1
- package/dist/sealed-record/index.d.ts +1 -1
- package/dist/sealed-record/index.js +2 -2
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +6 -6
- package/dist/session/index.d.ts +6 -6
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +5 -5
- package/dist/shadow/index.d.ts +5 -5
- package/dist/shadow/index.js +2 -2
- package/dist/{signer-I6YARZQA.js → signer-UJF3CFDC.js} +5 -5
- package/dist/snapshots/index.cjs.map +1 -1
- package/dist/snapshots/index.d.cts +5 -5
- package/dist/snapshots/index.d.ts +5 -5
- package/dist/snapshots/index.js +4 -4
- package/dist/{stale-CPESGAPL.js → stale-PW6VBGSP.js} +2 -2
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +5 -5
- package/dist/store/index.d.ts +5 -5
- package/dist/store/index.js +2 -2
- package/dist/{strategy-WtB-jXYv.d.cts → strategy-BWmgRPA2.d.cts} +1 -1
- package/dist/{strategy-54eIwox5.d.ts → strategy-D47TC5X6.d.ts} +1 -1
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +4 -4
- package/dist/sync/index.d.ts +4 -4
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +10 -3
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +5 -5
- package/dist/team/index.d.ts +5 -5
- package/dist/team/index.js +8 -8
- package/dist/{transition-guard-BcLyTGYq.d.cts → transition-guard-C3NxfVKk.d.cts} +1 -1
- package/dist/{transition-guard-Ctxapq1b.d.ts → transition-guard-CQH5263l.d.ts} +1 -1
- package/dist/tx/index.cjs +1 -1
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +5 -5
- package/dist/tx/index.d.ts +5 -5
- package/dist/tx/index.js +3 -3
- package/dist/{types-DONgts0n.d.ts → types-BGRX6sPT.d.ts} +288 -578
- package/dist/{types-Bhs2i_Ll.d.cts → types-COQ6qJZh.d.cts} +288 -578
- package/dist/ulid-DRH25k3y.d.cts +66 -0
- package/dist/ulid-DRH25k3y.d.ts +66 -0
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/{with-materialized-view-CyVLOr09.d.ts → with-materialized-view-Cj-6fuav.d.ts} +1 -1
- package/dist/{with-materialized-view-BYb3p9wT.d.cts → with-materialized-view-D4U-KrBH.d.cts} +1 -1
- package/dist/{with-overlayed-view-LGrQ984e.d.cts → with-overlayed-view-BKjdUPRx.d.cts} +1 -1
- package/dist/{with-overlayed-view-BhLRxqwI.d.ts → with-overlayed-view-COp_7EEy.d.ts} +1 -1
- package/dist/{with-rollup-CO8ibRcK.d.ts → with-rollup-B1_ZjG02.d.ts} +1 -1
- package/dist/{with-rollup-Bj8c7ttB.d.cts → with-rollup-C-Bok_o2.d.cts} +1 -1
- package/package.json +13 -3
- package/dist/chunk-C6W5KVDV.js.map +0 -1
- package/dist/chunk-EYK72OTL.js.map +0 -1
- package/dist/chunk-FRRJIUSI.js.map +0 -1
- package/dist/chunk-HYJMAV53.js.map +0 -1
- package/dist/chunk-JTI57WRT.js +0 -164
- package/dist/chunk-JTI57WRT.js.map +0 -1
- package/dist/chunk-OTWT6BAJ.js.map +0 -1
- package/dist/chunk-P65YMN5V.js.map +0 -1
- package/dist/chunk-TA6HPKWQ.js.map +0 -1
- package/dist/chunk-ZC7J6ZYV.js +0 -7
- package/dist/chunk-ZC7J6ZYV.js.map +0 -1
- package/dist/executor-4IEW4KG5.js +0 -8
- package/dist/executor-KYJCJCIN.js +0 -12
- package/dist/executor-W7VIBOBZ.js +0 -8
- package/dist/issue-JXC6T2QR.js +0 -12
- package/dist/noydb-VGR2HLDB.js +0 -39
- package/dist/registry-ATRHOG5B.js +0 -8
- package/dist/registry-LEHB26TY.js +0 -8
- package/dist/state-vault-JR3CFGNP.js +0 -14
- package/dist/vault-group-BB246VIM.js +0 -804
- package/dist/vault-group-BB246VIM.js.map +0 -1
- /package/dist/{chunk-CQYEDODS.js.map → chunk-35U5YNRR.js.map} +0 -0
- /package/dist/{chunk-NV4IHBZS.js.map → chunk-3XJU3OHE.js.map} +0 -0
- /package/dist/{chunk-IVZWHIEK.js.map → chunk-4HEGG5NJ.js.map} +0 -0
- /package/dist/{chunk-WE2BUQD2.js.map → chunk-4TCMCCC3.js.map} +0 -0
- /package/dist/{chunk-5YTXYPES.js.map → chunk-5A2FVGHT.js.map} +0 -0
- /package/dist/{chunk-NSXNXLYM.js.map → chunk-5GZC2ZM3.js.map} +0 -0
- /package/dist/{chunk-JYNH4FIM.js.map → chunk-77WF53XY.js.map} +0 -0
- /package/dist/{chunk-O5XKZCUD.js.map → chunk-7X4EF35A.js.map} +0 -0
- /package/dist/{chunk-SQKAECUL.js.map → chunk-7ZCTUI26.js.map} +0 -0
- /package/dist/{chunk-J6RGRZOY.js.map → chunk-AO3QSMCU.js.map} +0 -0
- /package/dist/{chunk-JDCPRJVS.js.map → chunk-AONK5GCC.js.map} +0 -0
- /package/dist/{chunk-TYMDCIQM.js.map → chunk-C472BRJ4.js.map} +0 -0
- /package/dist/{chunk-MBXKRHSS.js.map → chunk-CCNRFAL3.js.map} +0 -0
- /package/dist/{chunk-BZW5IL43.js.map → chunk-DCA2BDHA.js.map} +0 -0
- /package/dist/{chunk-JBBWALNI.js.map → chunk-DCICHSRS.js.map} +0 -0
- /package/dist/{chunk-2XA2ZML4.js.map → chunk-FG6IQ3ZL.js.map} +0 -0
- /package/dist/{chunk-C2RJVZZL.js.map → chunk-G4GW5VOS.js.map} +0 -0
- /package/dist/{chunk-U2XSUCDF.js.map → chunk-GEWIFM4J.js.map} +0 -0
- /package/dist/{chunk-TNH5SLCD.js.map → chunk-HD4QCT2O.js.map} +0 -0
- /package/dist/{chunk-I3IYTUUI.js.map → chunk-HHJ5DZCZ.js.map} +0 -0
- /package/dist/{chunk-6QAZ5O6X.js.map → chunk-IEIADIPM.js.map} +0 -0
- /package/dist/{chunk-YPIOFSN3.js.map → chunk-IHAISFXP.js.map} +0 -0
- /package/dist/{chunk-GJTKMME7.js.map → chunk-JKM2AVVH.js.map} +0 -0
- /package/dist/{chunk-S45MDEEF.js.map → chunk-LMWVNF6X.js.map} +0 -0
- /package/dist/{chunk-TAMRU7A2.js.map → chunk-OKV7S356.js.map} +0 -0
- /package/dist/{chunk-IW4L4X65.js.map → chunk-P5A4E53B.js.map} +0 -0
- /package/dist/{chunk-JOK73NDT.js.map → chunk-P7OL22JP.js.map} +0 -0
- /package/dist/{chunk-TGIJTNM3.js.map → chunk-R5ZECURV.js.map} +0 -0
- /package/dist/{chunk-KOAJ3TZM.js.map → chunk-RFEXGW3L.js.map} +0 -0
- /package/dist/{chunk-F5ILTHMU.js.map → chunk-RNQPDV75.js.map} +0 -0
- /package/dist/{chunk-WWVJXBOT.js.map → chunk-SGM7CK7R.js.map} +0 -0
- /package/dist/{chunk-7MRT7EPB.js.map → chunk-SOQE5DUV.js.map} +0 -0
- /package/dist/{chunk-ZONKSLF2.js.map → chunk-TQMQZOMX.js.map} +0 -0
- /package/dist/{chunk-3HNKR65T.js.map → chunk-U6LTLN7O.js.map} +0 -0
- /package/dist/{chunk-UU6M64HI.js.map → chunk-UAK2AMO2.js.map} +0 -0
- /package/dist/{chunk-37VGJM3T.js.map → chunk-WQ3KAGOV.js.map} +0 -0
- /package/dist/{chunk-AI4USDRI.js.map → chunk-XQO4TAJS.js.map} +0 -0
- /package/dist/{chunk-SQOK5UM6.js.map → chunk-ZBENTRFS.js.map} +0 -0
- /package/dist/{chunk-6QE4DUYC.js.map → chunk-ZDITTESU.js.map} +0 -0
- /package/dist/{crypto-456N7UVX.js.map → crypto-2LU6XUFF.js.map} +0 -0
- /package/dist/{delegation-DP4COTXB.js.map → delegation-6ABSJGXV.js.map} +0 -0
- /package/dist/{executor-4IEW4KG5.js.map → executor-JKMSEB34.js.map} +0 -0
- /package/dist/{executor-KYJCJCIN.js.map → executor-UYXSQB4D.js.map} +0 -0
- /package/dist/{executor-W7VIBOBZ.js.map → executor-VJSCTBWY.js.map} +0 -0
- /package/dist/{fanout-sidecar-YXNAEZ33.js.map → fanout-sidecar-ZQT4Y7PF.js.map} +0 -0
- /package/dist/{issue-JXC6T2QR.js.map → issue-KLRMW5DH.js.map} +0 -0
- /package/dist/{ledger-I7JUYP4L.js.map → kernel/index.js.map} +0 -0
- /package/dist/{noydb-VGR2HLDB.js.map → ledger-VOS2X3WJ.js.map} +0 -0
- /package/dist/{public-envelope-5XRTUNKF.js.map → noydb-2PI2ZBX6.js.map} +0 -0
- /package/dist/{registry-ATRHOG5B.js.map → public-envelope-IJJMWSTJ.js.map} +0 -0
- /package/dist/{registry-LEHB26TY.js.map → registry-GAIFVWXF.js.map} +0 -0
- /package/dist/{registry-NWHOLD5M.js.map → registry-J77ZUQ7G.js.map} +0 -0
- /package/dist/{revoke-5IEK22KT.js.map → registry-JGEVJ6YC.js.map} +0 -0
- /package/dist/{signer-I6YARZQA.js.map → revoke-WUY4AYRJ.js.map} +0 -0
- /package/dist/{stale-CPESGAPL.js.map → signer-UJF3CFDC.js.map} +0 -0
- /package/dist/{state-vault-JR3CFGNP.js.map → stale-PW6VBGSP.js.map} +0 -0
package/dist/bundle/index.d.cts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { T as TransferSealPayload } from '../
|
|
2
|
-
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { T as TransferSealPayload } from '../multi-bundle-WhYiJEgV.cjs';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompartmentManifest, d as CompressionAlgo, D as DecryptedRecord, F as FLAG_COMPRESSED, e as FLAG_HAS_INTEGRITY_HASH, M as MultiBundleManifest, f as MultiVaultCompartmentInput, N as NOYDB_BUNDLE_FORMAT_VERSION, g as NOYDB_BUNDLE_MAGIC, h as NOYDB_BUNDLE_PREFIX_BYTES, i as NOYDB_MULTI_BUNDLE_MAGIC, j as NOYDB_MULTI_BUNDLE_PREFIX_BYTES, k as NOYDB_MULTI_BUNDLE_VERSION, l as NoydbBundleHeader, m as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, n as decodeMultiBundle, o as decryptExtractedPartition, p as encodeBundleHeader, q as encodeMultiBundle, r as readMultiVaultBundleCompartment, s as readNoydbBundle, t as readNoydbBundleHeader, u as readNoydbBundleManifest, v as resetBrotliSupportCache, w as validateBundleHeader, x as writeMultiVaultBundle, y as writeNoydbBundle } from '../multi-bundle-WhYiJEgV.cjs';
|
|
3
|
+
export { g as generateULID, i as isULID } from '../ulid-DRH25k3y.cjs';
|
|
4
|
+
import { bc as Vault, aW as NoydbStore, bd as SealingKeyProvider, be as RecoveryEnrollmentInput, bf as ShamirRecoveryProvider } from '../types-COQ6qJZh.cjs';
|
|
5
|
+
export { t as AdoptionStateError, B as BackupCorruptedError, u as BackupLedgerError, v as BundleIntegrityError, w as BundleSealMismatchError, x as BundleVersionConflictError, P as PartitionExtractionError, y as TransferSealError } from '../errors-B2tUcRPg.cjs';
|
|
5
6
|
import '../lazy-builder-eYZzLEL1.cjs';
|
|
6
7
|
import '../predicate-BmhBSPCH.cjs';
|
|
7
|
-
import '../strategy-
|
|
8
|
+
import '../strategy-BWmgRPA2.cjs';
|
|
8
9
|
import '../strategy-BSxFXGzb.cjs';
|
|
9
10
|
import '../index-BMmajblo.cjs';
|
|
10
|
-
import '../index-
|
|
11
|
+
import '../index-BthnP2MA.cjs';
|
|
11
12
|
import '@noy-db/attestation';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -106,6 +107,14 @@ declare function extractPartition(vault: Vault, opts: WalkClosureOptions & {
|
|
|
106
107
|
readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none';
|
|
107
108
|
readonly carrySchemas?: boolean;
|
|
108
109
|
readonly carryLedger?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* FR-7 structural field projection: per-collection allow-list of fields
|
|
112
|
+
* to keep. Non-listed fields are dropped from each record BEFORE
|
|
113
|
+
* re-encryption (so they never travel in the bundle); `id` is always
|
|
114
|
+
* preserved. A projected collection's persisted schema is NOT carried.
|
|
115
|
+
* Absent/empty → un-projected behavior (byte-identical to today).
|
|
116
|
+
*/
|
|
117
|
+
readonly fieldProjection?: Record<string, readonly string[]>;
|
|
109
118
|
}): Promise<ExtractPartitionResult>;
|
|
110
119
|
|
|
111
120
|
/**
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { T as TransferSealPayload } from '../
|
|
2
|
-
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { T as TransferSealPayload } from '../multi-bundle-6s5nKAZX.js';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompartmentManifest, d as CompressionAlgo, D as DecryptedRecord, F as FLAG_COMPRESSED, e as FLAG_HAS_INTEGRITY_HASH, M as MultiBundleManifest, f as MultiVaultCompartmentInput, N as NOYDB_BUNDLE_FORMAT_VERSION, g as NOYDB_BUNDLE_MAGIC, h as NOYDB_BUNDLE_PREFIX_BYTES, i as NOYDB_MULTI_BUNDLE_MAGIC, j as NOYDB_MULTI_BUNDLE_PREFIX_BYTES, k as NOYDB_MULTI_BUNDLE_VERSION, l as NoydbBundleHeader, m as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, n as decodeMultiBundle, o as decryptExtractedPartition, p as encodeBundleHeader, q as encodeMultiBundle, r as readMultiVaultBundleCompartment, s as readNoydbBundle, t as readNoydbBundleHeader, u as readNoydbBundleManifest, v as resetBrotliSupportCache, w as validateBundleHeader, x as writeMultiVaultBundle, y as writeNoydbBundle } from '../multi-bundle-6s5nKAZX.js';
|
|
3
|
+
export { g as generateULID, i as isULID } from '../ulid-DRH25k3y.js';
|
|
4
|
+
import { bc as Vault, aW as NoydbStore, bd as SealingKeyProvider, be as RecoveryEnrollmentInput, bf as ShamirRecoveryProvider } from '../types-BGRX6sPT.js';
|
|
5
|
+
export { t as AdoptionStateError, B as BackupCorruptedError, u as BackupLedgerError, v as BundleIntegrityError, w as BundleSealMismatchError, x as BundleVersionConflictError, P as PartitionExtractionError, y as TransferSealError } from '../errors-B2tUcRPg.js';
|
|
5
6
|
import '../lazy-builder-ChSqcF5t.js';
|
|
6
7
|
import '../predicate-BmhBSPCH.js';
|
|
7
|
-
import '../strategy-
|
|
8
|
+
import '../strategy-D47TC5X6.js';
|
|
8
9
|
import '../strategy-BSxFXGzb.js';
|
|
9
10
|
import '../index-BMmajblo.js';
|
|
10
|
-
import '../index-
|
|
11
|
+
import '../index-BLff_E35.js';
|
|
11
12
|
import '@noy-db/attestation';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -106,6 +107,14 @@ declare function extractPartition(vault: Vault, opts: WalkClosureOptions & {
|
|
|
106
107
|
readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none';
|
|
107
108
|
readonly carrySchemas?: boolean;
|
|
108
109
|
readonly carryLedger?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* FR-7 structural field projection: per-collection allow-list of fields
|
|
112
|
+
* to keep. Non-listed fields are dropped from each record BEFORE
|
|
113
|
+
* re-encryption (so they never travel in the bundle); `id` is always
|
|
114
|
+
* preserved. A projected collection's persisted schema is NOT carried.
|
|
115
|
+
* Absent/empty → un-projected behavior (byte-identical to today).
|
|
116
|
+
*/
|
|
117
|
+
readonly fieldProjection?: Record<string, readonly string[]>;
|
|
109
118
|
}): Promise<ExtractPartitionResult>;
|
|
110
119
|
|
|
111
120
|
/**
|
package/dist/bundle/index.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
NOYDB_MULTI_BUNDLE_MAGIC,
|
|
3
|
+
NOYDB_MULTI_BUNDLE_PREFIX_BYTES,
|
|
4
|
+
NOYDB_MULTI_BUNDLE_VERSION,
|
|
5
|
+
adoptPartition,
|
|
6
|
+
createOwnerOnAdoptedPartition,
|
|
7
|
+
decodeMultiBundle,
|
|
8
|
+
decryptExtractedPartition,
|
|
9
|
+
encodeMultiBundle,
|
|
10
|
+
readMultiVaultBundleCompartment,
|
|
11
|
+
readNoydbBundleManifest,
|
|
12
|
+
unsealDeks,
|
|
13
|
+
writeMultiVaultBundle
|
|
14
|
+
} from "../chunk-R43KS34V.js";
|
|
15
|
+
import {
|
|
16
|
+
SCHEMAS_COLLECTION
|
|
17
|
+
} from "../chunk-XC32SZPW.js";
|
|
5
18
|
import {
|
|
6
19
|
COMPRESSION_BROTLI,
|
|
7
20
|
COMPRESSION_GZIP,
|
|
@@ -14,26 +27,22 @@ import {
|
|
|
14
27
|
assembleBundleContainer,
|
|
15
28
|
buildExtractedPartitionWrapper,
|
|
16
29
|
encodeBundleHeader,
|
|
17
|
-
parseExtractedPartitionBody,
|
|
18
30
|
readNoydbBundle,
|
|
19
31
|
readNoydbBundleHeader,
|
|
20
32
|
resetBrotliSupportCache,
|
|
21
33
|
validateBundleHeader,
|
|
22
34
|
writeNoydbBundle
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import
|
|
27
|
-
createOwnerKeyring
|
|
28
|
-
} from "../chunk-FRRJIUSI.js";
|
|
35
|
+
} from "../chunk-4TCMCCC3.js";
|
|
36
|
+
import "../chunk-P7OL22JP.js";
|
|
37
|
+
import "../chunk-DCA2BDHA.js";
|
|
38
|
+
import "../chunk-B5CSNGSE.js";
|
|
29
39
|
import {
|
|
30
40
|
generateULID,
|
|
31
41
|
isULID
|
|
32
42
|
} from "../chunk-FZU343FL.js";
|
|
33
43
|
import {
|
|
34
|
-
LEDGER_COLLECTION
|
|
35
|
-
|
|
36
|
-
} from "../chunk-JDCPRJVS.js";
|
|
44
|
+
LEDGER_COLLECTION
|
|
45
|
+
} from "../chunk-AONK5GCC.js";
|
|
37
46
|
import {
|
|
38
47
|
canonicalJson,
|
|
39
48
|
envelopePayloadHash,
|
|
@@ -42,17 +51,15 @@ import {
|
|
|
42
51
|
import {
|
|
43
52
|
NOYDB_BACKUP_VERSION,
|
|
44
53
|
NOYDB_FORMAT_VERSION
|
|
45
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-LR7CODVN.js";
|
|
46
55
|
import {
|
|
47
|
-
base64ToBuffer,
|
|
48
56
|
bufferToBase64,
|
|
49
57
|
decrypt,
|
|
50
58
|
encrypt,
|
|
51
59
|
generateDEK,
|
|
52
60
|
unwrapCek,
|
|
53
|
-
wrapCek
|
|
54
|
-
|
|
55
|
-
} from "../chunk-37VGJM3T.js";
|
|
61
|
+
wrapCek
|
|
62
|
+
} from "../chunk-WQ3KAGOV.js";
|
|
56
63
|
import {
|
|
57
64
|
AdoptionStateError,
|
|
58
65
|
BackupCorruptedError,
|
|
@@ -61,9 +68,8 @@ import {
|
|
|
61
68
|
BundleSealMismatchError,
|
|
62
69
|
BundleVersionConflictError,
|
|
63
70
|
PartitionExtractionError,
|
|
64
|
-
TransferSealError
|
|
65
|
-
|
|
66
|
-
} from "../chunk-OTWT6BAJ.js";
|
|
71
|
+
TransferSealError
|
|
72
|
+
} from "../chunk-4BB4T3O7.js";
|
|
67
73
|
|
|
68
74
|
// src/bundle/walk-closure.ts
|
|
69
75
|
async function walkClosure(vault, opts) {
|
|
@@ -208,7 +214,7 @@ async function describeExtraction(vault, opts) {
|
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
// src/bundle/extract-partition.ts
|
|
211
|
-
async function reKeyClosure(vault, closure) {
|
|
217
|
+
async function reKeyClosure(vault, closure, fieldProjection) {
|
|
212
218
|
const { name: vaultName, adapter, getDEK } = vault._introspectState();
|
|
213
219
|
const collections = {};
|
|
214
220
|
const deks = /* @__PURE__ */ new Map();
|
|
@@ -217,29 +223,40 @@ async function reKeyClosure(vault, closure) {
|
|
|
217
223
|
const destDek = await generateDEK();
|
|
218
224
|
deks.set(collectionName, destDek);
|
|
219
225
|
const out = {};
|
|
226
|
+
const projList = fieldProjection?.[collectionName];
|
|
227
|
+
const proj = projList ? new Set(projList) : void 0;
|
|
228
|
+
const project = (plaintext) => {
|
|
229
|
+
if (!proj) return plaintext;
|
|
230
|
+
const rec = JSON.parse(plaintext);
|
|
231
|
+
const kept = {};
|
|
232
|
+
if ("id" in rec) kept["id"] = rec["id"];
|
|
233
|
+
for (const f of proj) if (f in rec) kept[f] = rec[f];
|
|
234
|
+
return JSON.stringify(kept);
|
|
235
|
+
};
|
|
220
236
|
for (const id of ids) {
|
|
221
237
|
const env = await adapter.get(vaultName, collectionName, id);
|
|
222
238
|
if (!env) continue;
|
|
223
239
|
if (env._cek !== void 0) {
|
|
224
240
|
const cek = await unwrapCek(env._cek, srcDek);
|
|
225
241
|
const plaintext2 = await decrypt(env._iv, env._data, cek);
|
|
226
|
-
const { iv: iv2, data: data2 } = await encrypt(plaintext2, cek);
|
|
242
|
+
const { iv: iv2, data: data2 } = await encrypt(project(plaintext2), cek);
|
|
227
243
|
const wrapped = await wrapCek(cek, destDek);
|
|
228
244
|
out[id] = { ...env, _iv: iv2, _data: data2, _cek: wrapped };
|
|
229
245
|
continue;
|
|
230
246
|
}
|
|
231
247
|
const plaintext = await decrypt(env._iv, env._data, srcDek);
|
|
232
|
-
const { iv, data } = await encrypt(plaintext, destDek);
|
|
248
|
+
const { iv, data } = await encrypt(project(plaintext), destDek);
|
|
233
249
|
out[id] = { ...env, _iv: iv, _data: data };
|
|
234
250
|
}
|
|
235
251
|
collections[collectionName] = out;
|
|
236
252
|
}
|
|
237
253
|
return { collections, deks };
|
|
238
254
|
}
|
|
239
|
-
async function reKeySchemas(vault, closure, destDeks) {
|
|
255
|
+
async function reKeySchemas(vault, closure, destDeks, fieldProjection) {
|
|
240
256
|
const { name: vaultName, adapter, getDEK } = vault._introspectState();
|
|
241
257
|
const out = {};
|
|
242
258
|
for (const collectionName of closure.keys()) {
|
|
259
|
+
if (fieldProjection?.[collectionName]) continue;
|
|
243
260
|
const env = await adapter.get(vaultName, SCHEMAS_COLLECTION, collectionName);
|
|
244
261
|
if (!env) continue;
|
|
245
262
|
const destDek = destDeks.get(collectionName);
|
|
@@ -331,6 +348,11 @@ async function sealDeks(deks) {
|
|
|
331
348
|
};
|
|
332
349
|
}
|
|
333
350
|
async function extractPartition(vault, opts) {
|
|
351
|
+
if (vault.role === "custodian") {
|
|
352
|
+
throw new PartitionExtractionError(
|
|
353
|
+
"extractPartition is owner-only; a custodian cannot extract-and-sever (FR-6: producing a re-keyed standalone partition is an ownership operation; use the Deed owner)."
|
|
354
|
+
);
|
|
355
|
+
}
|
|
334
356
|
if (vault.role !== "owner") {
|
|
335
357
|
throw new PartitionExtractionError(
|
|
336
358
|
`extractPartition requires the 'owner' role on the source vault; caller is '${vault.role}'. Producing a re-keyed standalone partition is an ownership operation.`
|
|
@@ -338,7 +360,7 @@ async function extractPartition(vault, opts) {
|
|
|
338
360
|
}
|
|
339
361
|
if (opts.carrySchemas) await vault._drainPendingSchemaWrites();
|
|
340
362
|
const { closure } = await walkClosure(vault, opts);
|
|
341
|
-
const { collections, deks } = await reKeyClosure(vault, closure);
|
|
363
|
+
const { collections, deks } = await reKeyClosure(vault, closure, opts.fieldProjection);
|
|
342
364
|
let ledgerHead;
|
|
343
365
|
let ledgerEntries;
|
|
344
366
|
if (opts.carryLedger && vault._getLedgerOrNull() !== null) {
|
|
@@ -350,7 +372,7 @@ async function extractPartition(vault, opts) {
|
|
|
350
372
|
deks.set(LEDGER_COLLECTION, ledgerDek);
|
|
351
373
|
}
|
|
352
374
|
}
|
|
353
|
-
const internalSchemas = opts.carrySchemas ? await reKeySchemas(vault, closure, deks) : {};
|
|
375
|
+
const internalSchemas = opts.carrySchemas ? await reKeySchemas(vault, closure, deks, opts.fieldProjection) : {};
|
|
354
376
|
const internal = {};
|
|
355
377
|
if (Object.keys(internalSchemas).length > 0) internal[SCHEMAS_COLLECTION] = internalSchemas;
|
|
356
378
|
if (ledgerEntries) internal[LEDGER_COLLECTION] = ledgerEntries;
|
|
@@ -391,172 +413,6 @@ async function extractPartition(vault, opts) {
|
|
|
391
413
|
});
|
|
392
414
|
return { bundleBytes, transferKey, sealId: seal.sealId };
|
|
393
415
|
}
|
|
394
|
-
|
|
395
|
-
// src/bundle/adopt-partition.ts
|
|
396
|
-
async function unsealDeks(seal, transferKey) {
|
|
397
|
-
if (transferKey.byteLength !== 32) {
|
|
398
|
-
throw new TransferSealError(
|
|
399
|
-
`transfer key must be 32 bytes, got ${transferKey.byteLength}.`
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
const key = await crypto.subtle.importKey("raw", transferKey, "AES-GCM", false, ["decrypt"]);
|
|
403
|
-
const raw = base64ToBuffer(seal.payload);
|
|
404
|
-
let plaintext;
|
|
405
|
-
try {
|
|
406
|
-
plaintext = await crypto.subtle.decrypt(
|
|
407
|
-
{ name: "AES-GCM", iv: raw.slice(0, 12) },
|
|
408
|
-
key,
|
|
409
|
-
raw.slice(12)
|
|
410
|
-
);
|
|
411
|
-
} catch {
|
|
412
|
-
throw new TransferSealError(
|
|
413
|
-
"transfer seal could not be opened \u2014 wrong transfer key (AES-GCM authentication failed)."
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
let dekMap;
|
|
417
|
-
try {
|
|
418
|
-
dekMap = JSON.parse(new TextDecoder().decode(plaintext));
|
|
419
|
-
} catch {
|
|
420
|
-
throw new TransferSealError("transfer seal payload is not valid JSON after decryption.");
|
|
421
|
-
}
|
|
422
|
-
const deks = /* @__PURE__ */ new Map();
|
|
423
|
-
for (const [collection, b64] of Object.entries(dekMap)) {
|
|
424
|
-
const dek = await crypto.subtle.importKey("raw", base64ToBuffer(b64), "AES-GCM", true, ["encrypt", "decrypt"]);
|
|
425
|
-
deks.set(collection, dek);
|
|
426
|
-
}
|
|
427
|
-
return deks;
|
|
428
|
-
}
|
|
429
|
-
async function adoptPartition(bundleBytes, opts) {
|
|
430
|
-
const { transferKey, destinationStore, vaultName } = opts;
|
|
431
|
-
const header = readNoydbBundleHeader(bundleBytes);
|
|
432
|
-
if (header.bundleKind !== "extracted-partition" || header.transferSeal === void 0) {
|
|
433
|
-
throw new ValidationError(
|
|
434
|
-
"adoptPartition requires an extracted-partition bundle with a transfer seal. For ordinary backups use readNoydbBundle + vault.load."
|
|
435
|
-
);
|
|
436
|
-
}
|
|
437
|
-
const { dumpJson } = await readNoydbBundle(bundleBytes);
|
|
438
|
-
const { dump, seal } = parseExtractedPartitionBody(dumpJson);
|
|
439
|
-
await unsealDeks(seal, transferKey);
|
|
440
|
-
const existing = await destinationStore.get(vaultName, "_meta", "adoption");
|
|
441
|
-
if (existing) {
|
|
442
|
-
const prior = JSON.parse(existing._data);
|
|
443
|
-
if (prior.sealId === seal.sealId) {
|
|
444
|
-
throw new AdoptionStateError(
|
|
445
|
-
`partition (sealId ${seal.sealId}) is already adopted into vault "${vaultName}".`
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
throw new AdoptionStateError(
|
|
449
|
-
`vault "${vaultName}" already holds an adopted partition (sealId ${prior.sealId}); adopting a different partition (sealId ${seal.sealId}) here would overwrite it. Adopt into a fresh vaultName instead.`
|
|
450
|
-
);
|
|
451
|
-
}
|
|
452
|
-
const existingKeyring = await destinationStore.list(vaultName, "_keyring");
|
|
453
|
-
if (existingKeyring.length > 0) {
|
|
454
|
-
throw new AdoptionStateError(
|
|
455
|
-
`vault "${vaultName}" already holds a keyring (an unrelated owner exists at this slot); adoptPartition requires a fresh vaultName to avoid destructive saveAll on SQL adapters.`
|
|
456
|
-
);
|
|
457
|
-
}
|
|
458
|
-
const backup = JSON.parse(dump);
|
|
459
|
-
await destinationStore.saveAll(vaultName, backup.collections);
|
|
460
|
-
if (backup._internal) {
|
|
461
|
-
for (const [collection, records] of Object.entries(backup._internal)) {
|
|
462
|
-
for (const [id, envelope] of Object.entries(records)) {
|
|
463
|
-
await destinationStore.put(vaultName, collection, id, envelope);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
const adoptedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
468
|
-
const adoption = { sealId: seal.sealId, adoptedAt, needsOwner: true, transferSeal: seal };
|
|
469
|
-
await destinationStore.put(vaultName, "_meta", "adoption", {
|
|
470
|
-
_noydb: 1,
|
|
471
|
-
_v: 1,
|
|
472
|
-
_ts: adoptedAt,
|
|
473
|
-
_iv: "",
|
|
474
|
-
_data: JSON.stringify(adoption)
|
|
475
|
-
});
|
|
476
|
-
return { vaultName, needsOwner: true, sealId: seal.sealId };
|
|
477
|
-
}
|
|
478
|
-
function isManaged(o) {
|
|
479
|
-
return "passphraseMode" in o && o.passphraseMode === "managed";
|
|
480
|
-
}
|
|
481
|
-
async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
|
|
482
|
-
const { userId, transferKey } = opts;
|
|
483
|
-
if (isManaged(opts) && !opts.recovery.some((r) => r.profile === "shamir")) {
|
|
484
|
-
throw new AdoptionStateError(
|
|
485
|
-
"managed-mode adoption requires at least one strong (shamir) recovery profile in `recovery` \u2014 paper alone is not strong when there is no user passphrase to fall back on."
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
const adoptionEnv = await store.get(vaultName, "_meta", "adoption");
|
|
489
|
-
if (!adoptionEnv) {
|
|
490
|
-
throw new AdoptionStateError(
|
|
491
|
-
`vault "${vaultName}" is not an adopted partition (no _meta/adoption). createOwnerOnAdoptedPartition only applies to vaults created via adoptPartition.`
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
const adoption = JSON.parse(adoptionEnv._data);
|
|
495
|
-
if (adoption.consumedAt !== void 0 || adoption.transferSeal === void 0) {
|
|
496
|
-
throw new AdoptionStateError(
|
|
497
|
-
`vault "${vaultName}" already has an owner (transfer seal consumed at ${adoption.consumedAt}).`
|
|
498
|
-
);
|
|
499
|
-
}
|
|
500
|
-
const partitionDeks = await unsealDeks(adoption.transferSeal, transferKey);
|
|
501
|
-
const existingKeyring = await store.get(vaultName, "_keyring", userId);
|
|
502
|
-
const otherOwners = (await store.list(vaultName, "_keyring")).filter((u) => u !== userId);
|
|
503
|
-
if (otherOwners.length > 0) {
|
|
504
|
-
throw new AdoptionStateError(
|
|
505
|
-
`vault "${vaultName}" already has a keyring for a different owner; cannot create owner "${userId}".`
|
|
506
|
-
);
|
|
507
|
-
}
|
|
508
|
-
const partitionCollections = [...partitionDeks.keys()];
|
|
509
|
-
const priorDeks = existingKeyring ? JSON.parse(existingKeyring._data).deks : {};
|
|
510
|
-
const ownerMinted = existingKeyring !== null && partitionCollections.every((c) => c in priorDeks);
|
|
511
|
-
if (!ownerMinted) {
|
|
512
|
-
const passphrase = isManaged(opts) ? await resolveManagedSecret(store, vaultName, opts.sealingKey) : opts.passphrase;
|
|
513
|
-
const unlocked = await createOwnerKeyring(store, vaultName, userId, passphrase);
|
|
514
|
-
const env = await store.get(vaultName, "_keyring", userId);
|
|
515
|
-
if (!env) throw new AdoptionStateError(`keyring write for "${userId}" did not persist`);
|
|
516
|
-
const keyringFile = JSON.parse(env._data);
|
|
517
|
-
const kek = unlocked.kek;
|
|
518
|
-
if (!kek) throw new AdoptionStateError(`owner keyring for "${userId}" has no KEK to wrap partition DEKs under`);
|
|
519
|
-
const mergedDeks = { ...keyringFile.deks };
|
|
520
|
-
for (const [collection, dek] of partitionDeks) {
|
|
521
|
-
mergedDeks[collection] = await wrapKey(dek, kek);
|
|
522
|
-
}
|
|
523
|
-
const mergedFile = { ...keyringFile, deks: mergedDeks };
|
|
524
|
-
await store.put(vaultName, "_keyring", userId, { ...env, _data: JSON.stringify(mergedFile) });
|
|
525
|
-
}
|
|
526
|
-
const ledgerDek = partitionDeks.get(LEDGER_COLLECTION);
|
|
527
|
-
if (ledgerDek) {
|
|
528
|
-
const ledger = new LedgerStore({
|
|
529
|
-
adapter: store,
|
|
530
|
-
vault: vaultName,
|
|
531
|
-
encrypted: true,
|
|
532
|
-
getDEK: async () => ledgerDek,
|
|
533
|
-
actor: userId
|
|
534
|
-
});
|
|
535
|
-
const creationReason = `creation-of-new-owner:${userId}`;
|
|
536
|
-
const consumedReason = `transfer-seal-consumed:${adoption.sealId}`;
|
|
537
|
-
const recordedReasons = new Set((await ledger.loadAllEntries()).map((e) => e.reason));
|
|
538
|
-
if (!recordedReasons.has(creationReason)) {
|
|
539
|
-
await ledger.append({ op: "lifecycle", collection: "", id: "", version: 0, actor: "", payloadHash: "", reason: creationReason });
|
|
540
|
-
}
|
|
541
|
-
if (!recordedReasons.has(consumedReason)) {
|
|
542
|
-
await ledger.append({ op: "lifecycle", collection: "", id: "", version: 0, actor: "", payloadHash: "", reason: consumedReason });
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
if (isManaged(opts)) {
|
|
546
|
-
const { createNoydb } = await import("../noydb-VGR2HLDB.js");
|
|
547
|
-
const db = await createNoydb({
|
|
548
|
-
store,
|
|
549
|
-
user: userId,
|
|
550
|
-
passphraseMode: "managed",
|
|
551
|
-
sealingKey: opts.sealingKey,
|
|
552
|
-
shamirRecovery: opts.shamirRecovery
|
|
553
|
-
});
|
|
554
|
-
await db.openVaultAndEnrollRecovery(vaultName, { recovery: opts.recovery });
|
|
555
|
-
}
|
|
556
|
-
const consumed = { sealId: adoption.sealId, adoptedAt: adoption.adoptedAt, consumedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
557
|
-
await store.put(vaultName, "_meta", "adoption", { ...adoptionEnv, _data: JSON.stringify(consumed) });
|
|
558
|
-
return { vaultName, userId };
|
|
559
|
-
}
|
|
560
416
|
export {
|
|
561
417
|
AdoptionStateError,
|
|
562
418
|
BackupCorruptedError,
|
|
@@ -572,21 +428,30 @@ export {
|
|
|
572
428
|
NOYDB_BUNDLE_FORMAT_VERSION,
|
|
573
429
|
NOYDB_BUNDLE_MAGIC,
|
|
574
430
|
NOYDB_BUNDLE_PREFIX_BYTES,
|
|
431
|
+
NOYDB_MULTI_BUNDLE_MAGIC,
|
|
432
|
+
NOYDB_MULTI_BUNDLE_PREFIX_BYTES,
|
|
433
|
+
NOYDB_MULTI_BUNDLE_VERSION,
|
|
575
434
|
PartitionExtractionError,
|
|
576
435
|
TransferSealError,
|
|
577
436
|
adoptPartition,
|
|
578
437
|
createOwnerOnAdoptedPartition,
|
|
438
|
+
decodeMultiBundle,
|
|
439
|
+
decryptExtractedPartition,
|
|
579
440
|
describeExtraction,
|
|
580
441
|
encodeBundleHeader,
|
|
442
|
+
encodeMultiBundle,
|
|
581
443
|
extractPartition,
|
|
582
444
|
generateULID,
|
|
583
445
|
isULID,
|
|
446
|
+
readMultiVaultBundleCompartment,
|
|
584
447
|
readNoydbBundle,
|
|
585
448
|
readNoydbBundleHeader,
|
|
449
|
+
readNoydbBundleManifest,
|
|
586
450
|
resetBrotliSupportCache,
|
|
587
451
|
unsealDeks,
|
|
588
452
|
validateBundleHeader,
|
|
589
453
|
walkClosure,
|
|
454
|
+
writeMultiVaultBundle,
|
|
590
455
|
writeNoydbBundle
|
|
591
456
|
};
|
|
592
457
|
//# sourceMappingURL=index.js.map
|