@noy-db/hub 0.2.0-pre.2 → 0.2.0-pre.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -0
- package/dist/aggregate/index.cjs +643 -37
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +3 -2
- package/dist/aggregate/index.d.ts +3 -2
- package/dist/aggregate/index.js +9 -8
- package/dist/aggregate/index.js.map +1 -1
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +7 -5
- package/dist/attestation/index.d.ts +7 -5
- package/dist/attestation/index.js +6 -6
- package/dist/blobs/index.cjs +509 -22
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +9 -7
- package/dist/blobs/index.d.ts +9 -7
- package/dist/blobs/index.js +11 -6
- package/dist/blobs/index.js.map +1 -1
- package/dist/bundle/index.cjs +7886 -841
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +20 -18
- package/dist/bundle/index.d.ts +20 -18
- package/dist/bundle/index.js +24 -13
- package/dist/bundle/index.js.map +1 -1
- package/dist/{chunk-PFSNOPBQ.js → chunk-2XA2ZML4.js} +31 -3
- package/dist/chunk-2XA2ZML4.js.map +1 -0
- package/dist/{chunk-2PAQNPE3.js → chunk-37VGJM3T.js} +37 -2
- package/dist/chunk-37VGJM3T.js.map +1 -0
- package/dist/{chunk-7BRE6EUA.js → chunk-3HNKR65T.js} +4 -4
- package/dist/chunk-3HNKR65T.js.map +1 -0
- package/dist/{chunk-Y2RKOPNC.js → chunk-5YTXYPES.js} +46 -10
- package/dist/chunk-5YTXYPES.js.map +1 -0
- package/dist/{chunk-OVZDFEOR.js → chunk-6QAZ5O6X.js} +2 -2
- package/dist/chunk-6QAZ5O6X.js.map +1 -0
- package/dist/{chunk-RTZVQAJ7.js → chunk-6QE4DUYC.js} +19 -4
- package/dist/chunk-6QE4DUYC.js.map +1 -0
- package/dist/{chunk-7Q5PLD5C.js → chunk-7MRT7EPB.js} +3 -3
- package/dist/{chunk-E535SAN4.js → chunk-7PH4OPBZ.js} +4258 -520
- package/dist/chunk-7PH4OPBZ.js.map +1 -0
- package/dist/{chunk-PEULZC6M.js → chunk-A3JMGXPG.js} +8 -1
- package/dist/chunk-A3JMGXPG.js.map +1 -0
- package/dist/{chunk-UMLVJTYV.js → chunk-ADB7GPM3.js} +7 -4
- package/dist/chunk-ADB7GPM3.js.map +1 -0
- package/dist/{chunk-G6FRSBKK.js → chunk-AI4USDRI.js} +4 -4
- package/dist/chunk-BZW5IL43.js +151 -0
- package/dist/chunk-BZW5IL43.js.map +1 -0
- package/dist/chunk-C2RJVZZL.js +123 -0
- package/dist/chunk-C2RJVZZL.js.map +1 -0
- package/dist/{chunk-UND4XIB6.js → chunk-C6W5KVDV.js} +52 -38
- package/dist/chunk-C6W5KVDV.js.map +1 -0
- package/dist/chunk-CQYEDODS.js +125 -0
- package/dist/chunk-CQYEDODS.js.map +1 -0
- package/dist/{chunk-NWZ3I6R6.js → chunk-EYK72OTL.js} +5 -5
- package/dist/{chunk-7BUTTVMR.js → chunk-F5GWNSE2.js} +2 -2
- package/dist/{chunk-AHPFONIL.js → chunk-F5ILTHMU.js} +5 -5
- package/dist/{chunk-Q6W2CMEJ.js → chunk-FRRJIUSI.js} +18 -5
- package/dist/chunk-FRRJIUSI.js.map +1 -0
- package/dist/{chunk-YMYK7US4.js → chunk-GJTKMME7.js} +2 -2
- package/dist/chunk-GJTKMME7.js.map +1 -0
- package/dist/{chunk-EUYOGYGV.js → chunk-HYJMAV53.js} +6 -6
- package/dist/chunk-HYJMAV53.js.map +1 -0
- package/dist/{chunk-QPEXPHJR.js → chunk-I3IYTUUI.js} +4 -4
- package/dist/{chunk-3QAKZ37R.js → chunk-IVZWHIEK.js} +5 -5
- package/dist/{chunk-PLI5TV7N.js → chunk-IW4L4X65.js} +2 -2
- package/dist/chunk-IW4L4X65.js.map +1 -0
- package/dist/{chunk-3Z2TPHC4.js → chunk-IY24WS2P.js} +69 -5
- package/dist/chunk-IY24WS2P.js.map +1 -0
- package/dist/{chunk-HXJXPZRE.js → chunk-J6RGRZOY.js} +10 -3
- package/dist/chunk-J6RGRZOY.js.map +1 -0
- package/dist/{chunk-3S4BJX25.js → chunk-JBBWALNI.js} +2 -2
- package/dist/chunk-JBBWALNI.js.map +1 -0
- package/dist/{chunk-7Z23ZFLV.js → chunk-JDCPRJVS.js} +5 -5
- package/dist/chunk-JDCPRJVS.js.map +1 -0
- package/dist/{chunk-243PNUA6.js → chunk-JOK73NDT.js} +3 -3
- package/dist/chunk-JTI57WRT.js +164 -0
- package/dist/chunk-JTI57WRT.js.map +1 -0
- package/dist/{chunk-VRBCTEKQ.js → chunk-JYNH4FIM.js} +233 -11
- package/dist/chunk-JYNH4FIM.js.map +1 -0
- package/dist/{chunk-TBKOGSYR.js → chunk-KOAJ3TZM.js} +27 -5
- package/dist/chunk-KOAJ3TZM.js.map +1 -0
- package/dist/{chunk-YTXSFG3C.js → chunk-MBXKRHSS.js} +50 -20
- package/dist/chunk-MBXKRHSS.js.map +1 -0
- package/dist/{chunk-MUWOSVEP.js → chunk-NSXNXLYM.js} +10 -2
- package/dist/chunk-NSXNXLYM.js.map +1 -0
- package/dist/{chunk-J4KLMEUL.js → chunk-NV4IHBZS.js} +664 -51
- package/dist/chunk-NV4IHBZS.js.map +1 -0
- package/dist/{chunk-LRAZDV5X.js → chunk-O5XKZCUD.js} +31 -8
- package/dist/chunk-O5XKZCUD.js.map +1 -0
- package/dist/{chunk-W3XXT26A.js → chunk-OTWT6BAJ.js} +358 -3
- package/dist/chunk-OTWT6BAJ.js.map +1 -0
- package/dist/{chunk-XG3PTSCD.js → chunk-PDVP3C2I.js} +1 -1
- package/dist/chunk-PDVP3C2I.js.map +1 -0
- package/dist/{chunk-GIV6DWBG.js → chunk-S45MDEEF.js} +44 -5
- package/dist/chunk-S45MDEEF.js.map +1 -0
- package/dist/{chunk-VK5EER6C.js → chunk-SQKAECUL.js} +2 -2
- package/dist/{chunk-FAQVNJD4.js → chunk-SQOK5UM6.js} +12 -2
- package/dist/{chunk-FAQVNJD4.js.map → chunk-SQOK5UM6.js.map} +1 -1
- package/dist/chunk-STNPB3UM.js +9 -0
- package/dist/chunk-STNPB3UM.js.map +1 -0
- package/dist/{chunk-YS3POABP.js → chunk-TA6HPKWQ.js} +1 -1
- package/dist/chunk-TA6HPKWQ.js.map +1 -0
- package/dist/{chunk-4HIL6AHQ.js → chunk-TAMRU7A2.js} +4 -4
- package/dist/{chunk-QXQRKXCU.js → chunk-TGIJTNM3.js} +2 -2
- package/dist/chunk-TNH5SLCD.js +361 -0
- package/dist/chunk-TNH5SLCD.js.map +1 -0
- package/dist/{chunk-VPSUZLOJ.js → chunk-TYMDCIQM.js} +31 -5
- package/dist/chunk-TYMDCIQM.js.map +1 -0
- package/dist/chunk-U2XSUCDF.js +524 -0
- package/dist/chunk-U2XSUCDF.js.map +1 -0
- package/dist/{chunk-3Y53S2SA.js → chunk-UU6M64HI.js} +4 -4
- package/dist/{chunk-VCGTOS2A.js → chunk-WE2BUQD2.js} +3 -3
- package/dist/chunk-WE2BUQD2.js.map +1 -0
- package/dist/{chunk-JYQTXEIO.js → chunk-WWVJXBOT.js} +449 -29
- package/dist/chunk-WWVJXBOT.js.map +1 -0
- package/dist/chunk-YPIOFSN3.js +129 -0
- package/dist/chunk-YPIOFSN3.js.map +1 -0
- package/dist/chunk-ZC7J6ZYV.js +7 -0
- package/dist/chunk-ZC7J6ZYV.js.map +1 -0
- package/dist/{chunk-5ZGZ6HIZ.js → chunk-ZONKSLF2.js} +30 -7
- package/dist/chunk-ZONKSLF2.js.map +1 -0
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +8 -6
- package/dist/consent/index.d.ts +8 -6
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-5ZDIY3NG.js → crypto-456N7UVX.js} +7 -3
- package/dist/{delegation-QYXZW25W.js → delegation-DP4COTXB.js} +5 -5
- package/dist/derivations/index.cjs +124 -6
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +11 -9
- package/dist/derivations/index.d.ts +11 -9
- package/dist/derivations/index.js +8 -6
- package/dist/{dev-unlock-DQCNDfFp.d.cts → dev-unlock-CY0HIZA0.d.cts} +1 -1
- package/dist/{dev-unlock-utkybTKb.d.ts → dev-unlock-CpKSkl2c.d.ts} +1 -1
- package/dist/discriminant-BN9REW3o.d.cts +60 -0
- package/dist/discriminant-BN9REW3o.d.ts +60 -0
- package/dist/errors-Dkc_fi-S.d.cts +1467 -0
- package/dist/errors-Dkc_fi-S.d.ts +1467 -0
- package/dist/executor-4IEW4KG5.js +8 -0
- package/dist/executor-KYJCJCIN.js +12 -0
- package/dist/executor-W7VIBOBZ.js +8 -0
- package/dist/{fanout-sidecar-VJ52RIEY.js → fanout-sidecar-YXNAEZ33.js} +2 -2
- package/dist/fanout-sidecar-YXNAEZ33.js.map +1 -0
- package/dist/forget/index.cjs +43 -0
- package/dist/forget/index.cjs.map +1 -0
- package/dist/forget/index.d.cts +1 -0
- package/dist/forget/index.d.ts +1 -0
- package/dist/forget/index.js +14 -0
- package/dist/guards/index.cjs +144 -4
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +16 -8
- package/dist/guards/index.d.ts +16 -8
- package/dist/guards/index.js +13 -7
- package/dist/{hash-jDowCrK2.d.cts → hash-BSd0-_L8.d.cts} +1 -1
- package/dist/{hash-DcoYWfJ_.d.ts → hash-BnBQx39y.d.ts} +1 -1
- package/dist/history/index.cjs +28 -5
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +9 -7
- package/dist/history/index.d.ts +9 -7
- package/dist/history/index.js +9 -7
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.cjs +356 -26
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +8 -6
- package/dist/i18n/index.d.ts +8 -6
- package/dist/i18n/index.js +36 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index-BMmajblo.d.cts +362 -0
- package/dist/index-BMmajblo.d.ts +362 -0
- package/dist/{index-BCKdioeh.d.ts → index-Bm9hIY7t.d.ts} +169 -1127
- package/dist/{index-BMjrzNZr.d.cts → index-tZqVB9g5.d.cts} +169 -1127
- package/dist/index.cjs +10286 -2168
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +258 -23
- package/dist/index.d.ts +258 -23
- package/dist/index.js +443 -110
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +97 -32
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.d.cts +3 -3
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +4 -4
- package/dist/issue-JXC6T2QR.js +12 -0
- package/dist/{lazy-builder-Rpd-V3jP.d.ts → lazy-builder-ChSqcF5t.d.ts} +2 -2
- package/dist/{lazy-builder-C-rPfWG0.d.cts → lazy-builder-eYZzLEL1.d.cts} +2 -2
- package/dist/{ledger-3IU5GMXA.js → ledger-I7JUYP4L.js} +6 -6
- package/dist/materialized-views/index.cjs +687 -13
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +23 -20
- package/dist/materialized-views/index.d.ts +23 -20
- package/dist/materialized-views/index.js +8 -7
- package/dist/mime-magic-BnJCGJzB.d.cts +103 -0
- package/dist/mime-magic-CjSyakO4.d.ts +103 -0
- package/dist/noydb-ZZCRF6TE.js +38 -0
- package/dist/overlay-views/index.cjs +58 -18
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +32 -12
- package/dist/overlay-views/index.d.ts +32 -12
- package/dist/overlay-views/index.js +6 -6
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +8 -6
- package/dist/periods/index.d.ts +8 -6
- package/dist/periods/index.js +6 -6
- package/dist/{predicate-Dnu81tsS.d.cts → predicate-BmhBSPCH.d.cts} +87 -5
- package/dist/{predicate-Dnu81tsS.d.ts → predicate-BmhBSPCH.d.ts} +87 -5
- package/dist/{public-envelope-U3CMEOMV.js → public-envelope-5XRTUNKF.js} +4 -4
- package/dist/query/index.cjs +1438 -130
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +4 -3
- package/dist/query/index.d.ts +4 -3
- package/dist/query/index.js +13 -6
- package/dist/read-only-facade-EX6WZZBP.js +7 -0
- package/dist/registry-ATRHOG5B.js +8 -0
- package/dist/registry-DKEXOJVO.js +7 -0
- package/dist/registry-LEHB26TY.js +8 -0
- package/dist/{registry-3ALP62P6.js → registry-NWHOLD5M.js} +3 -3
- package/dist/{revoke-KY2GB4KP.js → revoke-5IEK22KT.js} +6 -6
- package/dist/sealed-record/index.cjs +139 -0
- package/dist/sealed-record/index.cjs.map +1 -0
- package/dist/sealed-record/index.d.cts +123 -0
- package/dist/sealed-record/index.d.ts +123 -0
- package/dist/sealed-record/index.js +42 -0
- package/dist/sealed-record/index.js.map +1 -0
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +9 -7
- package/dist/session/index.d.ts +9 -7
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +8 -6
- package/dist/shadow/index.d.ts +8 -6
- package/dist/shadow/index.js +2 -2
- package/dist/{signer-GRI5TZKH.js → signer-I6YARZQA.js} +5 -5
- package/dist/snapshots/index.cjs +937 -0
- package/dist/snapshots/index.cjs.map +1 -0
- package/dist/snapshots/index.d.cts +30 -0
- package/dist/snapshots/index.d.ts +30 -0
- package/dist/snapshots/index.js +152 -0
- package/dist/snapshots/index.js.map +1 -0
- package/dist/{stale-OTOF3FH7.js → stale-CPESGAPL.js} +2 -2
- package/dist/stale-CPESGAPL.js.map +1 -0
- package/dist/state-vault-JR3CFGNP.js +14 -0
- package/dist/state-vault-JR3CFGNP.js.map +1 -0
- package/dist/store/index.cjs +8 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +15 -6
- package/dist/store/index.d.ts +15 -6
- package/dist/store/index.js +2 -2
- package/dist/{strategy-DSTrsZ8t.d.ts → strategy-54eIwox5.d.ts} +456 -7
- package/dist/{strategy-DSTrsZ8t.d.cts → strategy-WtB-jXYv.d.cts} +456 -7
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +7 -5
- package/dist/sync/index.d.ts +7 -5
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +1 -1
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +8 -6
- package/dist/team/index.d.ts +8 -6
- package/dist/team/index.js +8 -8
- package/dist/transition-guard-D4bfIAiW.d.ts +165 -0
- package/dist/transition-guard-Dmpqzg-_.d.cts +165 -0
- package/dist/tx/index.cjs +155 -5
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +27 -9
- package/dist/tx/index.d.ts +27 -9
- package/dist/tx/index.js +61 -4
- package/dist/tx/index.js.map +1 -1
- package/dist/{types-BoFFiskX.d.ts → types-DLfWFr6U.d.ts} +3997 -1262
- package/dist/{types-DJG8HG6F.d.cts → types-DyOI6XZ_.d.cts} +3997 -1262
- package/dist/{ulid-BmBgooGm.d.ts → ulid-B2L_aqVA.d.ts} +19 -19
- package/dist/{ulid-C7ms9oli.d.cts → ulid-LaxfH2tK.d.cts} +19 -19
- package/dist/util/index.cjs +7 -0
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.d.cts +2 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +5 -1
- package/dist/util/index.js.map +1 -1
- package/dist/vault-group-BB246VIM.js +804 -0
- package/dist/vault-group-BB246VIM.js.map +1 -0
- package/dist/{with-materialized-view-CqnRwI2S.d.ts → with-materialized-view-CeZYGJVf.d.cts} +2 -2
- package/dist/{with-materialized-view-BbEPFIIJ.d.cts → with-materialized-view-DNULSxoP.d.ts} +2 -2
- package/dist/{with-overlayed-view-Ct1fSJt-.d.ts → with-overlayed-view-C9joG7UZ.d.ts} +2 -2
- package/dist/{with-overlayed-view-bwlmmFjx.d.cts → with-overlayed-view-kdcPGHih.d.cts} +2 -2
- package/dist/with-rollup-DJDbrxjf.d.ts +47 -0
- package/dist/with-rollup-s58XAeWO.d.cts +47 -0
- package/package.json +35 -4
- package/dist/chunk-2PAQNPE3.js.map +0 -1
- package/dist/chunk-3S4BJX25.js.map +0 -1
- package/dist/chunk-3XHOCQK4.js +0 -118
- package/dist/chunk-3XHOCQK4.js.map +0 -1
- package/dist/chunk-3Z2TPHC4.js.map +0 -1
- package/dist/chunk-5ZGZ6HIZ.js.map +0 -1
- package/dist/chunk-7BRE6EUA.js.map +0 -1
- package/dist/chunk-7Z23ZFLV.js.map +0 -1
- package/dist/chunk-CXSCDO5T.js +0 -51
- package/dist/chunk-CXSCDO5T.js.map +0 -1
- package/dist/chunk-E535SAN4.js.map +0 -1
- package/dist/chunk-EUYOGYGV.js.map +0 -1
- package/dist/chunk-GIV6DWBG.js.map +0 -1
- package/dist/chunk-HXJXPZRE.js.map +0 -1
- package/dist/chunk-J4KLMEUL.js.map +0 -1
- package/dist/chunk-JYQTXEIO.js.map +0 -1
- package/dist/chunk-LRAZDV5X.js.map +0 -1
- package/dist/chunk-MRIBLZL3.js +0 -86
- package/dist/chunk-MRIBLZL3.js.map +0 -1
- package/dist/chunk-MUWOSVEP.js.map +0 -1
- package/dist/chunk-OVZDFEOR.js.map +0 -1
- package/dist/chunk-PEULZC6M.js.map +0 -1
- package/dist/chunk-PFSNOPBQ.js.map +0 -1
- package/dist/chunk-PLI5TV7N.js.map +0 -1
- package/dist/chunk-Q6W2CMEJ.js.map +0 -1
- package/dist/chunk-RTZVQAJ7.js.map +0 -1
- package/dist/chunk-TBKOGSYR.js.map +0 -1
- package/dist/chunk-UMLVJTYV.js.map +0 -1
- package/dist/chunk-UND4XIB6.js.map +0 -1
- package/dist/chunk-VCGTOS2A.js.map +0 -1
- package/dist/chunk-VE6YVP32.js +0 -19
- package/dist/chunk-VE6YVP32.js.map +0 -1
- package/dist/chunk-VPSUZLOJ.js.map +0 -1
- package/dist/chunk-VRBCTEKQ.js.map +0 -1
- package/dist/chunk-W3XXT26A.js.map +0 -1
- package/dist/chunk-XG3PTSCD.js.map +0 -1
- package/dist/chunk-Y2RKOPNC.js.map +0 -1
- package/dist/chunk-YMYK7US4.js.map +0 -1
- package/dist/chunk-YS3POABP.js.map +0 -1
- package/dist/chunk-YTXSFG3C.js.map +0 -1
- package/dist/executor-AS2IDHKZ.js +0 -11
- package/dist/executor-HLXFXNFM.js +0 -8
- package/dist/executor-HN6YBHZ5.js +0 -8
- package/dist/fanout-sidecar-VJ52RIEY.js.map +0 -1
- package/dist/issue-ORP37MVW.js +0 -12
- package/dist/mime-magic-CBBSOkjm.d.cts +0 -50
- package/dist/mime-magic-CBBSOkjm.d.ts +0 -50
- package/dist/noydb-5H3C24GG.js +0 -34
- package/dist/read-only-facade-ITU6L7BL.js +0 -7
- package/dist/registry-7HE6VJGC.js +0 -8
- package/dist/registry-PSIPG2QR.js +0 -8
- package/dist/registry-RFGGMVNJ.js +0 -7
- package/dist/with-derivation-BKXXa8Vt.d.ts +0 -13
- package/dist/with-derivation-BjQ7q4NE.d.cts +0 -13
- package/dist/with-guard-C25yNjzd.d.ts +0 -18
- package/dist/with-guard-DQme5DKE.d.cts +0 -18
- /package/dist/{chunk-7Q5PLD5C.js.map → chunk-7MRT7EPB.js.map} +0 -0
- /package/dist/{chunk-G6FRSBKK.js.map → chunk-AI4USDRI.js.map} +0 -0
- /package/dist/{chunk-NWZ3I6R6.js.map → chunk-EYK72OTL.js.map} +0 -0
- /package/dist/{chunk-7BUTTVMR.js.map → chunk-F5GWNSE2.js.map} +0 -0
- /package/dist/{chunk-AHPFONIL.js.map → chunk-F5ILTHMU.js.map} +0 -0
- /package/dist/{chunk-QPEXPHJR.js.map → chunk-I3IYTUUI.js.map} +0 -0
- /package/dist/{chunk-3QAKZ37R.js.map → chunk-IVZWHIEK.js.map} +0 -0
- /package/dist/{chunk-243PNUA6.js.map → chunk-JOK73NDT.js.map} +0 -0
- /package/dist/{chunk-VK5EER6C.js.map → chunk-SQKAECUL.js.map} +0 -0
- /package/dist/{chunk-4HIL6AHQ.js.map → chunk-TAMRU7A2.js.map} +0 -0
- /package/dist/{chunk-QXQRKXCU.js.map → chunk-TGIJTNM3.js.map} +0 -0
- /package/dist/{chunk-3Y53S2SA.js.map → chunk-UU6M64HI.js.map} +0 -0
- /package/dist/{crypto-5ZDIY3NG.js.map → crypto-456N7UVX.js.map} +0 -0
- /package/dist/{delegation-QYXZW25W.js.map → delegation-DP4COTXB.js.map} +0 -0
- /package/dist/{executor-AS2IDHKZ.js.map → executor-4IEW4KG5.js.map} +0 -0
- /package/dist/{executor-HLXFXNFM.js.map → executor-KYJCJCIN.js.map} +0 -0
- /package/dist/{executor-HN6YBHZ5.js.map → executor-W7VIBOBZ.js.map} +0 -0
- /package/dist/{issue-ORP37MVW.js.map → forget/index.js.map} +0 -0
- /package/dist/{ledger-3IU5GMXA.js.map → issue-JXC6T2QR.js.map} +0 -0
- /package/dist/{noydb-5H3C24GG.js.map → ledger-I7JUYP4L.js.map} +0 -0
- /package/dist/{public-envelope-U3CMEOMV.js.map → noydb-ZZCRF6TE.js.map} +0 -0
- /package/dist/{read-only-facade-ITU6L7BL.js.map → public-envelope-5XRTUNKF.js.map} +0 -0
- /package/dist/{registry-3ALP62P6.js.map → read-only-facade-EX6WZZBP.js.map} +0 -0
- /package/dist/{registry-7HE6VJGC.js.map → registry-ATRHOG5B.js.map} +0 -0
- /package/dist/{registry-PSIPG2QR.js.map → registry-DKEXOJVO.js.map} +0 -0
- /package/dist/{registry-RFGGMVNJ.js.map → registry-LEHB26TY.js.map} +0 -0
- /package/dist/{revoke-KY2GB4KP.js.map → registry-NWHOLD5M.js.map} +0 -0
- /package/dist/{signer-GRI5TZKH.js.map → revoke-5IEK22KT.js.map} +0 -0
- /package/dist/{stale-OTOF3FH7.js.map → signer-I6YARZQA.js.map} +0 -0
package/dist/i18n/index.d.cts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { D as
|
|
4
|
-
|
|
5
|
-
import '../
|
|
6
|
-
import '../
|
|
1
|
+
export { I as I18nMap, a as I18nTextDescriptor, b as I18nTextOptions, L as Layer, O as OnMissing, c as OnMissingPolicy, R as ResolveI18nOptions, d as applyI18nLocale, g as getAtPath, i as i18nText, e as isI18nTextDescriptor, r as resolveI18nText, f as resolvePolicy, s as setAtPathInPlace, v as validateI18nTextValue } from '../strategy-WtB-jXYv.cjs';
|
|
2
|
+
import { I as I18nStrategy } from '../types-DyOI6XZ_.cjs';
|
|
3
|
+
export { D as DICT_COLLECTION_PREFIX, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, S as ScriptWarning, e as StaticDictDescriptor, f as dictCollectionName, g as dictKey, h as enforceScript, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, l as isStaticDictDescriptor, s as staticDict } from '../types-DyOI6XZ_.cjs';
|
|
4
|
+
export { D as DictKeyInUseError, a as DictKeyMissingError, L as LocaleNotSpecifiedError, M as MissingTranslationError, R as ReservedCollectionNameError, S as ScriptViolationError, b as StaticDictReadonlyError, T as TranslatorNotConfiguredError, U as UnknownDictCodeError } from '../errors-Dkc_fi-S.cjs';
|
|
5
|
+
import '../lazy-builder-eYZzLEL1.cjs';
|
|
6
|
+
import '../predicate-BmhBSPCH.cjs';
|
|
7
7
|
import '../strategy-BSxFXGzb.cjs';
|
|
8
|
+
import '../index-BMmajblo.cjs';
|
|
9
|
+
import '../index-tZqVB9g5.cjs';
|
|
8
10
|
import '@noy-db/attestation';
|
|
9
11
|
|
|
10
12
|
/**
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { D as
|
|
4
|
-
|
|
5
|
-
import '../
|
|
6
|
-
import '../
|
|
1
|
+
export { I as I18nMap, a as I18nTextDescriptor, b as I18nTextOptions, L as Layer, O as OnMissing, c as OnMissingPolicy, R as ResolveI18nOptions, d as applyI18nLocale, g as getAtPath, i as i18nText, e as isI18nTextDescriptor, r as resolveI18nText, f as resolvePolicy, s as setAtPathInPlace, v as validateI18nTextValue } from '../strategy-54eIwox5.js';
|
|
2
|
+
import { I as I18nStrategy } from '../types-DLfWFr6U.js';
|
|
3
|
+
export { D as DICT_COLLECTION_PREFIX, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, S as ScriptWarning, e as StaticDictDescriptor, f as dictCollectionName, g as dictKey, h as enforceScript, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, l as isStaticDictDescriptor, s as staticDict } from '../types-DLfWFr6U.js';
|
|
4
|
+
export { D as DictKeyInUseError, a as DictKeyMissingError, L as LocaleNotSpecifiedError, M as MissingTranslationError, R as ReservedCollectionNameError, S as ScriptViolationError, b as StaticDictReadonlyError, T as TranslatorNotConfiguredError, U as UnknownDictCodeError } from '../errors-Dkc_fi-S.js';
|
|
5
|
+
import '../lazy-builder-ChSqcF5t.js';
|
|
6
|
+
import '../predicate-BmhBSPCH.js';
|
|
7
7
|
import '../strategy-BSxFXGzb.js';
|
|
8
|
+
import '../index-BMmajblo.js';
|
|
9
|
+
import '../index-Bm9hIY7t.js';
|
|
8
10
|
import '@noy-db/attestation';
|
|
9
11
|
|
|
10
12
|
/**
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,36 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyI18nLocale,
|
|
3
|
-
i18nText,
|
|
4
|
-
isI18nTextDescriptor,
|
|
5
|
-
resolveI18nText,
|
|
6
|
-
validateI18nTextValue
|
|
7
|
-
} from "../chunk-3XHOCQK4.js";
|
|
8
1
|
import {
|
|
9
2
|
DICT_COLLECTION_PREFIX,
|
|
10
3
|
DictionaryHandle,
|
|
11
4
|
dictCollectionName,
|
|
12
5
|
dictKey,
|
|
13
6
|
isDictCollectionName,
|
|
14
|
-
isDictKeyDescriptor
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import
|
|
19
|
-
|
|
7
|
+
isDictKeyDescriptor,
|
|
8
|
+
isStaticDictDescriptor,
|
|
9
|
+
staticDict
|
|
10
|
+
} from "../chunk-O5XKZCUD.js";
|
|
11
|
+
import {
|
|
12
|
+
applyI18nLocale,
|
|
13
|
+
enforceScript,
|
|
14
|
+
getAtPath,
|
|
15
|
+
i18nText,
|
|
16
|
+
inferScripts,
|
|
17
|
+
isI18nTextDescriptor,
|
|
18
|
+
resolveI18nText,
|
|
19
|
+
resolvePolicy,
|
|
20
|
+
setAtPathInPlace,
|
|
21
|
+
validateI18nTextValue
|
|
22
|
+
} from "../chunk-TNH5SLCD.js";
|
|
23
|
+
import "../chunk-FRRJIUSI.js";
|
|
24
|
+
import "../chunk-PDVP3C2I.js";
|
|
25
|
+
import "../chunk-TA6HPKWQ.js";
|
|
26
|
+
import "../chunk-37VGJM3T.js";
|
|
20
27
|
import {
|
|
21
28
|
DictKeyInUseError,
|
|
22
29
|
DictKeyMissingError,
|
|
23
30
|
LocaleNotSpecifiedError,
|
|
24
31
|
MissingTranslationError,
|
|
25
32
|
ReservedCollectionNameError,
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
ScriptViolationError,
|
|
34
|
+
StaticDictReadonlyError,
|
|
35
|
+
TranslatorNotConfiguredError,
|
|
36
|
+
UnknownDictCodeError
|
|
37
|
+
} from "../chunk-OTWT6BAJ.js";
|
|
28
38
|
|
|
29
39
|
// src/i18n/active.ts
|
|
30
40
|
function withI18n() {
|
|
31
41
|
return {
|
|
32
42
|
applyI18nLocale,
|
|
33
43
|
validateI18nTextValue,
|
|
44
|
+
enforceScript,
|
|
34
45
|
buildDictionaryHandle(opts) {
|
|
35
46
|
return new DictionaryHandle(
|
|
36
47
|
opts.adapter,
|
|
@@ -55,15 +66,25 @@ export {
|
|
|
55
66
|
LocaleNotSpecifiedError,
|
|
56
67
|
MissingTranslationError,
|
|
57
68
|
ReservedCollectionNameError,
|
|
69
|
+
ScriptViolationError,
|
|
70
|
+
StaticDictReadonlyError,
|
|
58
71
|
TranslatorNotConfiguredError,
|
|
72
|
+
UnknownDictCodeError,
|
|
59
73
|
applyI18nLocale,
|
|
60
74
|
dictCollectionName,
|
|
61
75
|
dictKey,
|
|
76
|
+
enforceScript,
|
|
77
|
+
getAtPath,
|
|
62
78
|
i18nText,
|
|
79
|
+
inferScripts,
|
|
63
80
|
isDictCollectionName,
|
|
64
81
|
isDictKeyDescriptor,
|
|
65
82
|
isI18nTextDescriptor,
|
|
83
|
+
isStaticDictDescriptor,
|
|
66
84
|
resolveI18nText,
|
|
85
|
+
resolvePolicy,
|
|
86
|
+
setAtPathInPlace,
|
|
87
|
+
staticDict,
|
|
67
88
|
validateI18nTextValue,
|
|
68
89
|
withI18n
|
|
69
90
|
};
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i18n/active.ts"],"sourcesContent":["/**\n * Active i18n strategy — `withI18n()` returns the real implementation\n * that wires multi-locale resolution, i18nText validation, and the\n * `DictionaryHandle` for `dictKey` fields into the core read/write\n * paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withI18n } from '@noy-db/hub/i18n'\n *\n * const db = await createNoydb({\n * store: ...,\n * user: ...,\n * i18nStrategy: withI18n(),\n * })\n * ```\n *\n * The factory delegates to the existing `core.ts` and `dictionary.ts`\n * modules. Splitting the import chain through this file is what lets\n * tsup tree-shake the `~854 LOC` of dictionary + locale resolution\n * out of the default bundle when no `withI18n()` import is present.\n *\n * @public\n */\n\nimport type { I18nStrategy, BuildDictionaryHandleOptions } from './strategy.js'\nimport { applyI18nLocale, validateI18nTextValue } from './core.js'\nimport { DictionaryHandle } from './dictionary.js'\n\nexport function withI18n(): I18nStrategy {\n return {\n applyI18nLocale,\n validateI18nTextValue,\n buildDictionaryHandle<Keys extends string = string>(\n opts: BuildDictionaryHandleOptions<Keys>,\n ): DictionaryHandle<Keys> {\n return new DictionaryHandle<Keys>(\n opts.adapter,\n opts.compartmentName,\n opts.dictionaryName,\n opts.keyring,\n opts.getDEK,\n opts.encrypted,\n opts.ledger,\n opts.options,\n opts.findAndUpdateReferences,\n opts.emitter,\n )\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/i18n/active.ts"],"sourcesContent":["/**\n * Active i18n strategy — `withI18n()` returns the real implementation\n * that wires multi-locale resolution, i18nText validation, and the\n * `DictionaryHandle` for `dictKey` fields into the core read/write\n * paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withI18n } from '@noy-db/hub/i18n'\n *\n * const db = await createNoydb({\n * store: ...,\n * user: ...,\n * i18nStrategy: withI18n(),\n * })\n * ```\n *\n * The factory delegates to the existing `core.ts` and `dictionary.ts`\n * modules. Splitting the import chain through this file is what lets\n * tsup tree-shake the `~854 LOC` of dictionary + locale resolution\n * out of the default bundle when no `withI18n()` import is present.\n *\n * @public\n */\n\nimport type { I18nStrategy, BuildDictionaryHandleOptions } from './strategy.js'\nimport { applyI18nLocale, validateI18nTextValue } from './core.js'\nimport { enforceScript } from './script.js'\nimport { DictionaryHandle } from './dictionary.js'\n\nexport function withI18n(): I18nStrategy {\n return {\n applyI18nLocale,\n validateI18nTextValue,\n enforceScript,\n buildDictionaryHandle<Keys extends string = string>(\n opts: BuildDictionaryHandleOptions<Keys>,\n ): DictionaryHandle<Keys> {\n return new DictionaryHandle<Keys>(\n opts.adapter,\n opts.compartmentName,\n opts.dictionaryName,\n opts.keyring,\n opts.getDEK,\n opts.encrypted,\n opts.ledger,\n opts.options,\n opts.findAndUpdateReferences,\n opts.emitter,\n )\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBACE,MACwB;AACxB,aAAO,IAAI;AAAA,QACT,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ledger entry shape + canonical JSON + sha256 helpers.
|
|
3
|
+
*
|
|
4
|
+
* This file holds the PURE primitives used by the hash-chained ledger:
|
|
5
|
+
* the entry type, the deterministic (sort-stable) JSON encoder, and
|
|
6
|
+
* the sha256 hasher that produces `prevHash` and `ledger.head()`.
|
|
7
|
+
*
|
|
8
|
+
* Everything here is validator-free and side-effect free — the only
|
|
9
|
+
* runtime dep is Web Crypto's `subtle.digest` for the sha256 call,
|
|
10
|
+
* which we already use for every other hashing operation in the core.
|
|
11
|
+
*
|
|
12
|
+
* The hash chain property works like this:
|
|
13
|
+
*
|
|
14
|
+
* hash(entry[i]) = sha256(canonicalJSON(entry[i]))
|
|
15
|
+
* entry[i+1].prevHash = hash(entry[i])
|
|
16
|
+
*
|
|
17
|
+
* Any modification to `entry[i]` (field values, field order, whitespace)
|
|
18
|
+
* produces a different `hash(entry[i])`, which means `entry[i+1]`'s
|
|
19
|
+
* stored `prevHash` no longer matches the recomputed hash, which means
|
|
20
|
+
* `verify()` returns `{ ok: false, divergedAt: i + 1 }`. The chain is
|
|
21
|
+
* append-only and tamper-evident without external anchoring.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* A single ledger entry in its plaintext form — what gets serialized,
|
|
25
|
+
* hashed, and then encrypted with the ledger DEK before being written
|
|
26
|
+
* to the `_ledger/` adapter collection.
|
|
27
|
+
*
|
|
28
|
+
* ## Why hash the ciphertext, not the plaintext?
|
|
29
|
+
*
|
|
30
|
+
* `payloadHash` is the sha256 of the record's ENCRYPTED envelope bytes,
|
|
31
|
+
* not its plaintext. This matters:
|
|
32
|
+
*
|
|
33
|
+
* 1. **Zero-knowledge preserved.** A user (or a third party) can
|
|
34
|
+
* verify the ledger against the stored envelopes without any
|
|
35
|
+
* decryption keys. The adapter layer already holds only
|
|
36
|
+
* ciphertext, so hashing the ciphertext keeps the ledger at the
|
|
37
|
+
* same privacy level as the adapter.
|
|
38
|
+
*
|
|
39
|
+
* 2. **Determinism.** Plaintext → ciphertext is randomized by the
|
|
40
|
+
* fresh per-write IV, so `hash(plaintext)` would need extra
|
|
41
|
+
* normalization. `hash(ciphertext)` is already deterministic and
|
|
42
|
+
* unique per write.
|
|
43
|
+
*
|
|
44
|
+
* 3. **Detection property.** If an attacker modifies even one byte of
|
|
45
|
+
* the stored ciphertext (trying to flip a record), the hash
|
|
46
|
+
* changes, the ledger's recorded `payloadHash` no longer matches,
|
|
47
|
+
* and a data-integrity check fails. We don't do that check in
|
|
48
|
+
* `verify()` today, but the
|
|
49
|
+
* hook is there for a future `verifyIntegrity()` follow-up.
|
|
50
|
+
*
|
|
51
|
+
* Fields marked `op`, `collection`, `id`, `version`, `ts`, `actor` are
|
|
52
|
+
* plaintext METADATA about the operation — NOT the record itself. The
|
|
53
|
+
* entry is still encrypted at rest via the ledger DEK, but adapters
|
|
54
|
+
* could theoretically infer operation patterns from the sizes and
|
|
55
|
+
* timestamps. This is an accepted trade-off for the tamper-evidence
|
|
56
|
+
* property; full ORAM-level privacy is out of scope for noy-db.
|
|
57
|
+
*/
|
|
58
|
+
interface LedgerEntry {
|
|
59
|
+
/**
|
|
60
|
+
* Zero-based sequential position of this entry in the chain. The
|
|
61
|
+
* canonical adapter key is this number zero-padded to 10 digits
|
|
62
|
+
* (`"0000000001"`) so lexicographic ordering matches numeric order.
|
|
63
|
+
*/
|
|
64
|
+
readonly index: number;
|
|
65
|
+
/**
|
|
66
|
+
* Hex-encoded sha256 of the canonical JSON of the PREVIOUS entry.
|
|
67
|
+
* The genesis entry (index 0) has `prevHash === ''` — the first
|
|
68
|
+
* entry in a fresh vault has nothing to point back to.
|
|
69
|
+
*/
|
|
70
|
+
readonly prevHash: string;
|
|
71
|
+
/**
|
|
72
|
+
* Which kind of mutation this entry records. only supports
|
|
73
|
+
* data operations (`put`, `delete`, `amendment`). Access-control
|
|
74
|
+
* operations (`grant`, `revoke`, `rotate`) will be added in a
|
|
75
|
+
* follow-up once the keyring write path is instrumented — that's
|
|
76
|
+
* tracked in the epic issue.
|
|
77
|
+
*
|
|
78
|
+
* `'amendment'` is the multi-record audit entry written by the
|
|
79
|
+
* guards subsystem when an admin/owner uses `withTransactions(...)`
|
|
80
|
+
* to repair a constraint-violating state. See `amendment` field
|
|
81
|
+
* below for the structured payload.
|
|
82
|
+
*
|
|
83
|
+
* `'lifecycle'` records a non-data audit event (e.g. partition
|
|
84
|
+
* handover) — `collection`/`id` are empty and the event detail
|
|
85
|
+
* lives in `reason` (e.g. `'partition-handed-over:<sealId>'`). Like
|
|
86
|
+
* `amendment`, it carries no data envelope, so `verifyBackupIntegrity`
|
|
87
|
+
* skips it in the data cross-check (it still participates in the
|
|
88
|
+
* tamper-evident chain).
|
|
89
|
+
*
|
|
90
|
+
* `'forget'` is the single summary entry written by `vault.forget()`
|
|
91
|
+
* (#304 GDPR crypto-shred). `collection`/`id` are empty and `version`
|
|
92
|
+
* is 0 — a forget is not scoped to one record. `payloadHash` carries
|
|
93
|
+
* `sha256Hex(subjectId)` so the ledger PROVES "subject X existed and
|
|
94
|
+
* was erased on date D" without retaining the subject id or any
|
|
95
|
+
* plaintext; `reason` holds a JSON summary of the shred counts. Like
|
|
96
|
+
* `amendment`/`lifecycle` it carries no data envelope and is skipped
|
|
97
|
+
* by the reconstruct walker (it still participates in the chain, so
|
|
98
|
+
* `verify()` passes after a shred).
|
|
99
|
+
*/
|
|
100
|
+
readonly op: 'put' | 'delete' | 'amendment' | 'lifecycle' | 'migration' | 'forget';
|
|
101
|
+
/** The collection the mutation targeted. */
|
|
102
|
+
readonly collection: string;
|
|
103
|
+
/** The record id the mutation targeted. */
|
|
104
|
+
readonly id: string;
|
|
105
|
+
/**
|
|
106
|
+
* The record version AFTER this mutation. For `put` this is the
|
|
107
|
+
* newly assigned version; for `delete` this is the version that
|
|
108
|
+
* was deleted (the last version visible to reads).
|
|
109
|
+
*/
|
|
110
|
+
readonly version: number;
|
|
111
|
+
/** ISO timestamp of the mutation. */
|
|
112
|
+
readonly ts: string;
|
|
113
|
+
/** User id of the actor who performed the mutation. */
|
|
114
|
+
readonly actor: string;
|
|
115
|
+
/**
|
|
116
|
+
* Hex-encoded sha256 of the encrypted envelope's `_data` field.
|
|
117
|
+
* For `put`, this is the hash of the new ciphertext. For `delete`,
|
|
118
|
+
* it's the hash of the last visible ciphertext at deletion time,
|
|
119
|
+
* or the empty string if nothing was there to delete. Hashing the
|
|
120
|
+
* ciphertext (not the plaintext) preserves zero-knowledge — see
|
|
121
|
+
* the file docstring.
|
|
122
|
+
*/
|
|
123
|
+
readonly payloadHash: string;
|
|
124
|
+
/**
|
|
125
|
+
* Optional human-readable tag describing why this mutation happened.
|
|
126
|
+
* Threaded through `collection.put(_, _, { reason })`. Common
|
|
127
|
+
* values include `'import:csv'`, `'import:json'`, `'import:xlsx'` from
|
|
128
|
+
* `as-*` ImportPlan.apply(), but consumers can use any string for
|
|
129
|
+
* domain-specific audit filtering. Auto-strip via `canonicalJson` —
|
|
130
|
+
* absent on the wire, never serialized as `null`.
|
|
131
|
+
*
|
|
132
|
+
* Audit consumers filter: `entries.filter(e => e.reason?.startsWith('import:'))`.
|
|
133
|
+
*/
|
|
134
|
+
readonly reason?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Optional hex-encoded sha256 of the encrypted JSON Patch delta
|
|
137
|
+
* blob stored alongside this entry in `_ledger_deltas/`. Present
|
|
138
|
+
* only for `put` operations that had a previous version — the
|
|
139
|
+
* genesis put of a new record, and every `delete`, leave this
|
|
140
|
+
* field undefined.
|
|
141
|
+
*
|
|
142
|
+
* The delta payload itself lives in a sibling internal collection
|
|
143
|
+
* (`_ledger_deltas/<paddedIndex>`) and is encrypted with the
|
|
144
|
+
* ledger DEK. Callers use `ledger.loadDelta(index)` to decrypt and
|
|
145
|
+
* deserialize it when reconstructing a historical version.
|
|
146
|
+
*
|
|
147
|
+
* Why optional instead of always-present: the first put of a
|
|
148
|
+
* record has no previous version to diff against, so storing an
|
|
149
|
+
* empty patch would be noise. For deletes there's no "next" state
|
|
150
|
+
* to describe with a delta. Both cases set this field to undefined.
|
|
151
|
+
*
|
|
152
|
+
* Note: the canonical-JSON hasher treats `undefined` as invalid
|
|
153
|
+
* (it's one of the guard rails), so on the wire this field is
|
|
154
|
+
* either `{ deltaHash: '<hex>' }` or absent from the JSON
|
|
155
|
+
* entirely — never `{ deltaHash: undefined }`.
|
|
156
|
+
*/
|
|
157
|
+
readonly deltaHash?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Present only when `op === 'amendment'`. Records the human reason,
|
|
160
|
+
* the role of the actor, the (collection, id, vBefore, vAfter) tuple
|
|
161
|
+
* for every record touched, and which guard invariants passed.
|
|
162
|
+
*
|
|
163
|
+
* See docs/superpowers/specs/2026-05-18-guards-design.md.
|
|
164
|
+
*/
|
|
165
|
+
readonly amendment?: {
|
|
166
|
+
readonly reason: string;
|
|
167
|
+
readonly role: 'admin' | 'owner';
|
|
168
|
+
readonly changes: ReadonlyArray<{
|
|
169
|
+
readonly collection: string;
|
|
170
|
+
readonly id: string;
|
|
171
|
+
readonly vBefore: number;
|
|
172
|
+
readonly vAfter: number;
|
|
173
|
+
}>;
|
|
174
|
+
readonly invariantsPassed: ReadonlyArray<string>;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Canonical (sort-stable) JSON encoder.
|
|
179
|
+
*
|
|
180
|
+
* This function is the load-bearing primitive of the hash chain:
|
|
181
|
+
* `sha256(canonicalJSON(entry))` must produce the same hex string
|
|
182
|
+
* every time, on every machine, for the same logical entry — otherwise
|
|
183
|
+
* `verify()` would return `{ ok: false }` on cross-platform reads.
|
|
184
|
+
*
|
|
185
|
+
* JavaScript's `JSON.stringify` is almost canonical, but NOT quite:
|
|
186
|
+
* it preserves the insertion order of object keys, which means
|
|
187
|
+
* `{a:1,b:2}` and `{b:2,a:1}` serialize differently. We fix this by
|
|
188
|
+
* recursively walking objects and sorting their keys before
|
|
189
|
+
* concatenation.
|
|
190
|
+
*
|
|
191
|
+
* Arrays keep their original order (reordering them would change
|
|
192
|
+
* semantics). Numbers, strings, booleans, and `null` use the default
|
|
193
|
+
* JSON encoding. `undefined` and functions are rejected — ledger
|
|
194
|
+
* entries are plain data, and silently dropping `undefined` would
|
|
195
|
+
* break the "same input → same hash" property if a caller forgot to
|
|
196
|
+
* omit a field.
|
|
197
|
+
*
|
|
198
|
+
* Performance: one pass per nesting level; O(n log n) for key sorting
|
|
199
|
+
* at each object. Entries are small (< 1 KB) so this is negligible
|
|
200
|
+
* compared to the sha256 call.
|
|
201
|
+
*/
|
|
202
|
+
declare function canonicalJson(value: unknown): string;
|
|
203
|
+
/**
|
|
204
|
+
* Compute a hex-encoded sha256 of a string via Web Crypto's subtle API.
|
|
205
|
+
*
|
|
206
|
+
* We use hex (not base64) for hashes because hex is case-insensitive,
|
|
207
|
+
* fixed-length (64 chars), and easier to compare visually in debug
|
|
208
|
+
* output. Base64 would save a few bytes in storage but every encrypted
|
|
209
|
+
* ledger entry is already much larger than the hash itself.
|
|
210
|
+
*/
|
|
211
|
+
declare function sha256Hex(input: string): Promise<string>;
|
|
212
|
+
/**
|
|
213
|
+
* Compute the canonical hash of a ledger entry. Short wrapper around
|
|
214
|
+
* `canonicalJson` + `sha256Hex`; callers use this instead of composing
|
|
215
|
+
* the two functions every time, so any future change to the hashing
|
|
216
|
+
* pipeline (e.g., adding a domain-separation prefix) lives in one place.
|
|
217
|
+
*/
|
|
218
|
+
declare function hashEntry(entry: LedgerEntry): Promise<string>;
|
|
219
|
+
/**
|
|
220
|
+
* Pad an index to the canonical 10-digit form used as the adapter key.
|
|
221
|
+
* Ten digits is enough for ~10 billion ledger entries per vault
|
|
222
|
+
* — far beyond any realistic use case, but cheap enough that the extra
|
|
223
|
+
* digits don't hurt storage.
|
|
224
|
+
*/
|
|
225
|
+
declare function paddedIndex(index: number): string;
|
|
226
|
+
/** Parse a padded adapter key back into a number. Returns NaN on malformed input. */
|
|
227
|
+
declare function parseIndex(key: string): number;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* `withForgetCascade` — declaration surface for GDPR right-to-erasure via
|
|
231
|
+
* per-record CEK crypto-shred (#304, step 2 of the CEK security epic).
|
|
232
|
+
*
|
|
233
|
+
* This file holds only the *declaration* shape and the disabled sentinel.
|
|
234
|
+
* The actual erasure machinery lives in:
|
|
235
|
+
* - `subject-index.ts` — the encrypted `_subject_index` reserved collection
|
|
236
|
+
* - `vault.ts` `forget()` — the per-record tombstone + ledger flow
|
|
237
|
+
* - `collection.ts` `_writeTombstone` — the envelope rewrite
|
|
238
|
+
*
|
|
239
|
+
* A `ForgetStrategy` declares which collections carry erasable subject data
|
|
240
|
+
* and the (dotted-path) field on each record that names the data subject.
|
|
241
|
+
* Declaring a collection here ALSO forces `perRecordKeys: true` for it (a
|
|
242
|
+
* shred can only erase a record whose body is keyed off a per-record CEK),
|
|
243
|
+
* so adopters opt into the CEK foundation transitively.
|
|
244
|
+
*
|
|
245
|
+
* @module
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* User-supplied declaration passed to {@link withForgetCascade}. Maps a
|
|
250
|
+
* collection name to the record field (dotted path supported, e.g.
|
|
251
|
+
* `'billing.buyerId'`) that identifies the data subject for erasure.
|
|
252
|
+
*
|
|
253
|
+
* ```ts
|
|
254
|
+
* withForgetCascade({ subjects: { invoices: 'buyerId', contacts: 'id' } })
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
interface SubjectDeclaration {
|
|
258
|
+
readonly subjects: Record<string, string>;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Resolved forget strategy threaded through Noydb → every Vault. Carries
|
|
262
|
+
* the same `subjects` map the user declared. `NO_FORGET` (empty map) is the
|
|
263
|
+
* off-by-default sentinel; `vault.forget()` throws
|
|
264
|
+
* `ForgetStrategyNotConfiguredError` when the map is empty.
|
|
265
|
+
*/
|
|
266
|
+
interface ForgetStrategy {
|
|
267
|
+
/** Collection → subject-field (dotted path). Empty under `NO_FORGET`. */
|
|
268
|
+
readonly subjects: Readonly<Record<string, string>>;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Disabled sentinel — no collections declare a subject field. `vault.forget()`
|
|
272
|
+
* refuses with `ForgetStrategyNotConfiguredError`; no write hooks register; no
|
|
273
|
+
* collection is forced into `perRecordKeys`. Non-adopters pay nothing.
|
|
274
|
+
*/
|
|
275
|
+
declare const NO_FORGET: ForgetStrategy;
|
|
276
|
+
/**
|
|
277
|
+
* Declare GDPR crypto-shred for one or more collections.
|
|
278
|
+
*
|
|
279
|
+
* Each declared collection is forced to `perRecordKeys: true` (a shred can
|
|
280
|
+
* only guarantee erasure of a record whose body is keyed off a per-record
|
|
281
|
+
* CEK). On write, Noydb extracts `record[subjectField]` and maintains an
|
|
282
|
+
* encrypted `_subject_index` mapping `subject → [{collection, id}]`, so
|
|
283
|
+
* `vault.forget(subjectId)` can find every record for a subject and rewrite
|
|
284
|
+
* each to a tombstone (body + history permanently undecryptable) while the
|
|
285
|
+
* collection DEK and every other record stay intact.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* createNoydb({
|
|
290
|
+
* secret, user,
|
|
291
|
+
* forgetStrategy: withForgetCascade({ subjects: { invoices: 'buyerId' } }),
|
|
292
|
+
* })
|
|
293
|
+
* const result = await vault.forget('buyer-123')
|
|
294
|
+
* // → { subject, recordsShredded, historyVersionsShredded, collections, … }
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
declare function withForgetCascade(opts: SubjectDeclaration): ForgetStrategy;
|
|
298
|
+
/**
|
|
299
|
+
* The outcome of a `vault.forget(subjectId)` call.
|
|
300
|
+
*
|
|
301
|
+
* `unmigratedRecords` lists `collection:id` pairs that were tombstoned but
|
|
302
|
+
* whose body had NOT been migrated to a per-record CEK at shred time (legacy
|
|
303
|
+
* body still under the shared collection DEK). Those records are tombstoned
|
|
304
|
+
* (live envelope + history stripped) but their pre-shred ciphertext, if it
|
|
305
|
+
* leaked into a backup before migration, remains decryptable under the
|
|
306
|
+
* collection DEK — so erasure-completeness is NOT guaranteed for them. Run
|
|
307
|
+
* the per-record-CEK migration pass, then re-forget, to close the gap.
|
|
308
|
+
*
|
|
309
|
+
* Blob attachments (#365): a shredded record's **erasable** blobs (on a
|
|
310
|
+
* `perRecordKeys` collection) are crypto-shredded inline — `blobsShredded`
|
|
311
|
+
* counts those taken to refCount 0 (BlobObject deleted → chunks permanently
|
|
312
|
+
* undecryptable), `blobsRetainedShared` counts those still referenced by
|
|
313
|
+
* another record (shared content legitimately persists for its other owner).
|
|
314
|
+
* `blobResidueCollections` now lists only collections with blobs that could
|
|
315
|
+
* NOT be crypto-shredded: **legacy** blobs (no per-blob `_cek`, chunks under
|
|
316
|
+
* the shared `_blob` DEK — migrate them), or a session without the blob
|
|
317
|
+
* subsystem loaded. An all-erasable subject yields an empty residue list.
|
|
318
|
+
*/
|
|
319
|
+
interface ForgetResult {
|
|
320
|
+
/** The subject id passed to `forget()`. Echoed for caller convenience. */
|
|
321
|
+
readonly subject: string;
|
|
322
|
+
/** Count of live records rewritten to a tombstone. */
|
|
323
|
+
readonly recordsShredded: number;
|
|
324
|
+
/** Count of `_history` envelopes tombstoned across all shredded records. */
|
|
325
|
+
readonly historyVersionsShredded: number;
|
|
326
|
+
/** Distinct collections that had at least one record shredded. */
|
|
327
|
+
readonly collections: readonly string[];
|
|
328
|
+
/** `collection:id` pairs shredded while still un-migrated (see type docs). */
|
|
329
|
+
readonly unmigratedRecords: readonly string[];
|
|
330
|
+
/** Count of erasable blobs crypto-shredded (refCount → 0, BlobObject deleted). */
|
|
331
|
+
readonly blobsShredded: number;
|
|
332
|
+
/** Count of erasable blobs retained because still referenced elsewhere (shared). */
|
|
333
|
+
readonly blobsRetainedShared: number;
|
|
334
|
+
/** Collections with blobs that could NOT be crypto-shredded — legacy (no `_cek`) or blobs disabled (see type docs). */
|
|
335
|
+
readonly blobResidueCollections: readonly string[];
|
|
336
|
+
/**
|
|
337
|
+
* Count of persisted `_idx/<field>/<recordId>` index side-cars hard-deleted
|
|
338
|
+
* across the shredded records (#401). These live under the retained
|
|
339
|
+
* collection DEK, so crypto-shred alone would leave the indexed field VALUES
|
|
340
|
+
* readable — `forget()` must delete them.
|
|
341
|
+
*/
|
|
342
|
+
readonly indexPostingsPurged: number;
|
|
343
|
+
/**
|
|
344
|
+
* `collection:id:field` entries whose persisted `_idx` side-car could NOT be
|
|
345
|
+
* deleted (#401) — index residue that still leaks the indexed value under the
|
|
346
|
+
* retained collection DEK. Non-empty means erasure is INCOMPLETE: retry, or
|
|
347
|
+
* purge the side-car out of band.
|
|
348
|
+
*/
|
|
349
|
+
readonly indexResidue: readonly string[];
|
|
350
|
+
/** The single `op:'forget'` ledger entry appended for this erasure. */
|
|
351
|
+
readonly ledgerEntry: LedgerEntry;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Reserved collection holding the encrypted subject → records index. */
|
|
355
|
+
declare const SUBJECT_INDEX_COLLECTION = "_subject_index";
|
|
356
|
+
/** A single record reference held in a subject's index entry. */
|
|
357
|
+
interface SubjectRef {
|
|
358
|
+
readonly collection: string;
|
|
359
|
+
readonly id: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export { type ForgetStrategy as F, type LedgerEntry as L, NO_FORGET as N, type SubjectRef as S, parseIndex as a, type ForgetResult as b, canonicalJson as c, SUBJECT_INDEX_COLLECTION as d, type SubjectDeclaration as e, hashEntry as h, paddedIndex as p, sha256Hex as s, withForgetCascade as w };
|