@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
|
@@ -0,0 +1,1467 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All NOYDB error classes — a single import surface for `catch` blocks and
|
|
3
|
+
* `instanceof` checks.
|
|
4
|
+
*
|
|
5
|
+
* ## Class hierarchy
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* Error
|
|
9
|
+
* └─ NoydbError (code: string)
|
|
10
|
+
* ├─ Crypto errors
|
|
11
|
+
* │ ├─ DecryptionError — AES-GCM tag failure
|
|
12
|
+
* │ ├─ TamperedError — ciphertext modified after write
|
|
13
|
+
* │ └─ InvalidKeyError — wrong passphrase / corrupt keyring
|
|
14
|
+
* ├─ Access errors
|
|
15
|
+
* │ ├─ NoAccessError — no DEK for this collection
|
|
16
|
+
* │ ├─ ReadOnlyError — ro permission, write attempted
|
|
17
|
+
* │ ├─ PermissionDeniedError — role too low for operation
|
|
18
|
+
* │ ├─ PrivilegeEscalationError — grant wider than grantor holds
|
|
19
|
+
* │ └─ StoreCapabilityError — optional store method missing
|
|
20
|
+
* ├─ Sync errors
|
|
21
|
+
* │ ├─ ConflictError — optimistic-lock version mismatch
|
|
22
|
+
* │ ├─ BundleVersionConflictError — bundle push rejected by remote
|
|
23
|
+
* │ └─ NetworkError — push/pull network failure
|
|
24
|
+
* ├─ Data errors
|
|
25
|
+
* │ ├─ NotFoundError — get(id) on missing record
|
|
26
|
+
* │ ├─ ValidationError — application-level guard failed
|
|
27
|
+
* │ └─ SchemaValidationError — Standard Schema v1 rejection
|
|
28
|
+
* ├─ Query errors
|
|
29
|
+
* │ ├─ JoinTooLargeError — join row ceiling exceeded
|
|
30
|
+
* │ ├─ CrossJoinTooLargeError — cross-join row ceiling exceeded
|
|
31
|
+
* │ ├─ CrossJoinSourceUnknownError — target collection not in vault
|
|
32
|
+
* │ ├─ DanglingReferenceError — strict ref() points at nothing
|
|
33
|
+
* │ ├─ GroupCardinalityError — groupBy bucket cap exceeded
|
|
34
|
+
* │ ├─ IndexRequiredError — lazy-mode query touches unindexed field
|
|
35
|
+
* │ ├─ IndexWriteFailureError — index side-car put/delete failed post-main
|
|
36
|
+
* │ ├─ UniqueConstraintError — duplicate value on unique index
|
|
37
|
+
* │ └─ UnsupportedIndexOptionError — unique+lazy or unique+crdt at registration
|
|
38
|
+
* ├─ i18n / Dictionary errors
|
|
39
|
+
* │ ├─ ReservedCollectionNameError
|
|
40
|
+
* │ ├─ DictKeyMissingError
|
|
41
|
+
* │ ├─ DictKeyInUseError
|
|
42
|
+
* │ ├─ MissingTranslationError
|
|
43
|
+
* │ ├─ LocaleNotSpecifiedError
|
|
44
|
+
* │ ├─ ScriptViolationError
|
|
45
|
+
* │ ├─ StaticDictReadonlyError
|
|
46
|
+
* │ ├─ UnknownDictCodeError
|
|
47
|
+
* │ └─ TranslatorNotConfiguredError
|
|
48
|
+
* ├─ Backup errors
|
|
49
|
+
* │ ├─ BackupLedgerError — hash-chain verification failed
|
|
50
|
+
* │ └─ BackupCorruptedError — envelope hash mismatch in dump
|
|
51
|
+
* ├─ Bundle errors
|
|
52
|
+
* │ └─ BundleIntegrityError — .noydb body sha256 mismatch
|
|
53
|
+
* ├─ Session errors
|
|
54
|
+
* │ ├─ SessionExpiredError
|
|
55
|
+
* │ ├─ SessionNotFoundError
|
|
56
|
+
* │ └─ SessionPolicyError
|
|
57
|
+
* ├─ Snapshot errors
|
|
58
|
+
* │ └─ SnapshotNotFoundError — snapshot key absent from snapshot store
|
|
59
|
+
* └─ Computed field errors
|
|
60
|
+
* └─ ComputedFieldError — computed function threw during a write
|
|
61
|
+
* └─ Erasure errors
|
|
62
|
+
* └─ ForgetStrategyNotConfiguredError — vault.forget() with no withForgetCascade
|
|
63
|
+
* └─ Sealed-record errors (record-scoped CEK sealing, #306)
|
|
64
|
+
* ├─ SealedRecordExpiredError — sealed CEK binding past expiresAt
|
|
65
|
+
* ├─ SealedRecordMismatchError — CEK sealed for record A used on record B
|
|
66
|
+
* └─ RecordCekNotFoundError — record missing or no per-record `_cek`
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* ## Catching all NOYDB errors
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { NoydbError, InvalidKeyError, ConflictError } from '@noy-db/hub'
|
|
73
|
+
*
|
|
74
|
+
* try {
|
|
75
|
+
* await vault.unlock(passphrase)
|
|
76
|
+
* } catch (e) {
|
|
77
|
+
* if (e instanceof InvalidKeyError) { showBadPassphraseUI(); return }
|
|
78
|
+
* if (e instanceof NoydbError) { logToSentry(e.code, e); return }
|
|
79
|
+
* throw e // unexpected — re-throw
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @module
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Base class for all NOYDB errors.
|
|
87
|
+
*
|
|
88
|
+
* Every error thrown by `@noy-db/hub` extends this class, so consumers can
|
|
89
|
+
* catch all NOYDB errors in a single `catch (e) { if (e instanceof NoydbError) ... }`
|
|
90
|
+
* block. The `code` field is a machine-readable string (e.g. `'DECRYPTION_FAILED'`)
|
|
91
|
+
* suitable for `switch` statements and logging pipelines.
|
|
92
|
+
*/
|
|
93
|
+
declare class NoydbError extends Error {
|
|
94
|
+
/** Machine-readable error code. Stable across library versions. */
|
|
95
|
+
readonly code: string;
|
|
96
|
+
constructor(code: string, message: string);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Thrown at construction when `debugPlaintext: true` is combined with
|
|
100
|
+
* encryption (`encrypt` not `false`). Debug-plaintext writes records in
|
|
101
|
+
* cleartext laid out for native store inspection; it is meaningless and
|
|
102
|
+
* unsafe under encryption, so the coupling is rejected loudly rather than
|
|
103
|
+
* silently ignored.
|
|
104
|
+
*/
|
|
105
|
+
declare class DebugPlaintextError extends NoydbError {
|
|
106
|
+
constructor(message?: string);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Thrown when a record written under `debugPlaintext` carries a top-level
|
|
110
|
+
* field whose name starts with `_`. Debug mode inlines record fields beside
|
|
111
|
+
* the reserved `_`-prefixed envelope metadata, so a `_`-prefixed record field
|
|
112
|
+
* would collide with metadata. The `_` namespace is reserved by NOYDB
|
|
113
|
+
* regardless; rename the field.
|
|
114
|
+
*/
|
|
115
|
+
declare class DebugReservedFieldError extends NoydbError {
|
|
116
|
+
constructor(collection: string, field: string);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Thrown when AES-GCM decryption fails.
|
|
120
|
+
*
|
|
121
|
+
* The most common cause is a wrong passphrase or a corrupted ciphertext.
|
|
122
|
+
* A `DecryptionError` at the wrong passphrase level is caught internally
|
|
123
|
+
* and re-thrown as `InvalidKeyError` — so in practice this surfaces for
|
|
124
|
+
* per-record corruption rather than authentication failures.
|
|
125
|
+
*/
|
|
126
|
+
declare class DecryptionError extends NoydbError {
|
|
127
|
+
constructor(message?: string);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Thrown when GCM tag verification fails, indicating the ciphertext was
|
|
131
|
+
* modified after encryption.
|
|
132
|
+
*
|
|
133
|
+
* AES-256-GCM is authenticated encryption — the tag over the ciphertext
|
|
134
|
+
* is checked on every decrypt. If any byte was flipped (accidental
|
|
135
|
+
* corruption or deliberate tampering), decryption throws this error.
|
|
136
|
+
* Treat it as a security alert: the stored bytes are not what NOYDB wrote.
|
|
137
|
+
*/
|
|
138
|
+
declare class TamperedError extends NoydbError {
|
|
139
|
+
constructor(message?: string);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Thrown when key unwrapping fails, typically because the passphrase is wrong
|
|
143
|
+
* or the keyring file is corrupted.
|
|
144
|
+
*
|
|
145
|
+
* NOYDB uses AES-KW (RFC 3394) to wrap DEKs with the KEK. If AES-KW
|
|
146
|
+
* unwrapping fails, it means either the KEK was derived from the wrong
|
|
147
|
+
* passphrase (PBKDF2 with 600K iterations) or the keyring bytes are
|
|
148
|
+
* corrupted. This is the error shown to the user on a failed unlock attempt.
|
|
149
|
+
*/
|
|
150
|
+
declare class InvalidKeyError extends NoydbError {
|
|
151
|
+
constructor(message?: string);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Thrown when a keyring's wrapped-DEK set unwraps partially — at least
|
|
155
|
+
* one DEK succeeds (proving the KEK is correct) but at least one fails.
|
|
156
|
+
* The passphrase is right; the failed entries are corrupted.
|
|
157
|
+
*
|
|
158
|
+
* This is distinct from {@link InvalidKeyError} so that
|
|
159
|
+
* `NoydbOptions.onInvalidKey: 'reset'` does NOT fire — resetting on
|
|
160
|
+
* partial corruption would destroy the still-valid DEKs and the data
|
|
161
|
+
* they protect, which is silent data loss in response to a feature
|
|
162
|
+
* designed for stale-credential recovery.
|
|
163
|
+
*/
|
|
164
|
+
declare class KeyringCorruptError extends NoydbError {
|
|
165
|
+
readonly failedCollections: readonly string[];
|
|
166
|
+
readonly intactCount: number;
|
|
167
|
+
constructor(opts: {
|
|
168
|
+
failedCollections: readonly string[];
|
|
169
|
+
intactCount: number;
|
|
170
|
+
message?: string;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Thrown when the authenticated user does not have a DEK for the requested
|
|
175
|
+
* collection — i.e. the collection is not in their keyring at all.
|
|
176
|
+
*
|
|
177
|
+
* This is the "no key for this door" error. It is different from
|
|
178
|
+
* `ReadOnlyError` (user has a key but it only grants ro) and from
|
|
179
|
+
* `PermissionDeniedError` (user's role doesn't allow the operation).
|
|
180
|
+
*/
|
|
181
|
+
declare class NoAccessError extends NoydbError {
|
|
182
|
+
constructor(message?: string);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Thrown when a user with read-only (`ro`) permission attempts a write
|
|
186
|
+
* operation (`put` or `delete`) on a collection.
|
|
187
|
+
*
|
|
188
|
+
* The user has a DEK for the collection (they can decrypt and read), but
|
|
189
|
+
* their keyring grants only `ro`. To fix: re-grant the user with `rw`
|
|
190
|
+
* permission, or do not attempt writes as a viewer/client role.
|
|
191
|
+
*/
|
|
192
|
+
declare class ReadOnlyError extends NoydbError {
|
|
193
|
+
constructor(message?: string);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Thrown when a write is attempted against a historical view produced
|
|
197
|
+
* by `vault.at(timestamp)`. Time-machine views are read-only by
|
|
198
|
+
* contract — mutating the past would require either the shadow-vault
|
|
199
|
+
* mechanism or a ledger-history rewrite (which breaks
|
|
200
|
+
* the tamper-evidence guarantee).
|
|
201
|
+
*
|
|
202
|
+
* Distinct from {@link ReadOnlyError} (keyring-level) and
|
|
203
|
+
* {@link PermissionDeniedError} (role-level): this error is about the
|
|
204
|
+
* *view* being historical, independent of the caller's permissions.
|
|
205
|
+
*/
|
|
206
|
+
declare class ReadOnlyAtInstantError extends NoydbError {
|
|
207
|
+
constructor(operation: string, timestamp: string);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Thrown when a write is attempted against a shadow-vault frame
|
|
211
|
+
* produced by `vault.frame()`. Frames are read-only by contract —
|
|
212
|
+
* the use case is screen-sharing / demos / compliance review where
|
|
213
|
+
* the operator wants to prevent accidental edits.
|
|
214
|
+
*
|
|
215
|
+
* Behavioural enforcement only — the underlying keyring still holds
|
|
216
|
+
* write-capable DEKs. See {@link VaultFrame} for the full caveat.
|
|
217
|
+
*/
|
|
218
|
+
declare class ReadOnlyFrameError extends NoydbError {
|
|
219
|
+
constructor(operation: string);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Thrown when the authenticated user's role does not permit the requested
|
|
223
|
+
* operation — e.g. a `viewer` calling `grantAccess()`, or an `operator`
|
|
224
|
+
* calling `rotateKeys()`.
|
|
225
|
+
*
|
|
226
|
+
* This is a role-level check (what the user's role allows), distinct from
|
|
227
|
+
* `NoAccessError` (collection not in keyring) and `ReadOnlyError` (in
|
|
228
|
+
* keyring, but write not allowed).
|
|
229
|
+
*/
|
|
230
|
+
declare class PermissionDeniedError extends NoydbError {
|
|
231
|
+
constructor(message?: string);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Thrown when an `@noy-db/as-*` export is attempted without the
|
|
235
|
+
* required capability bit on the invoking keyring.
|
|
236
|
+
*
|
|
237
|
+
* Two sub-cases discriminated by the `tier` field:
|
|
238
|
+
*
|
|
239
|
+
* - `tier: 'plaintext'` — a plaintext-tier export (`as-xlsx`,
|
|
240
|
+
* `as-csv`, `as-blob`, `as-zip`, …) was attempted but the
|
|
241
|
+
* keyring's `exportCapability.plaintext` does not include the
|
|
242
|
+
* requested `format` (nor the `'*'` wildcard). Default for every
|
|
243
|
+
* role is `plaintext: []` — the owner must positively grant.
|
|
244
|
+
* - `tier: 'bundle'` — an encrypted `as-noydb` bundle export was
|
|
245
|
+
* attempted but the keyring's `exportCapability.bundle` is
|
|
246
|
+
* `false`. Default for `owner`/`admin` is `true`; for
|
|
247
|
+
* `operator`/`viewer`/`client` it is `false`.
|
|
248
|
+
*
|
|
249
|
+
* Distinct from `PermissionDeniedError` (role-level check) and
|
|
250
|
+
* `NoAccessError` (collection not readable). Surfaces separately so
|
|
251
|
+
* UI layers can show a "request the export capability from your
|
|
252
|
+
* admin" flow rather than a generic permission error.
|
|
253
|
+
*/
|
|
254
|
+
declare class ExportCapabilityError extends NoydbError {
|
|
255
|
+
readonly tier: 'plaintext' | 'bundle';
|
|
256
|
+
readonly format?: string;
|
|
257
|
+
readonly userId: string;
|
|
258
|
+
constructor(opts: {
|
|
259
|
+
tier: 'plaintext' | 'bundle';
|
|
260
|
+
userId: string;
|
|
261
|
+
format?: string;
|
|
262
|
+
message?: string;
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Thrown when a keyring file's `expires_at` cutoff has passed.
|
|
267
|
+
* Surfaced by `loadKeyring` before any DEK unwrap is attempted —
|
|
268
|
+
* past the cutoff the slot refuses to open even with the right
|
|
269
|
+
* passphrase. Distinct from PBKDF2 / unwrap errors so consumer code
|
|
270
|
+
* can show a precise "this bundle slot has expired" message instead
|
|
271
|
+
* of the generic decryption-failure UX.
|
|
272
|
+
*
|
|
273
|
+
* Used predominantly on `BundleRecipient` slots produced by
|
|
274
|
+
* `writeNoydbBundle({ recipients: [...] })` to time-box audit access.
|
|
275
|
+
*/
|
|
276
|
+
declare class KeyringExpiredError extends NoydbError {
|
|
277
|
+
readonly userId: string;
|
|
278
|
+
readonly expiresAt: string;
|
|
279
|
+
constructor(opts: {
|
|
280
|
+
userId: string;
|
|
281
|
+
expiresAt: string;
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Thrown when an `@noy-db/as-*` import is attempted but the invoking
|
|
286
|
+
* keyring lacks the required import-capability bit.
|
|
287
|
+
*
|
|
288
|
+
* - `tier: 'plaintext'` — a plaintext-tier import (`as-csv`, `as-json`,
|
|
289
|
+
* `as-ndjson`, `as-zip`, …) was attempted but the keyring's
|
|
290
|
+
* `importCapability.plaintext` does not include the requested
|
|
291
|
+
* `format` (nor the `'*'` wildcard).
|
|
292
|
+
* - `tier: 'bundle'` — a `.noydb` bundle import was attempted but the
|
|
293
|
+
* keyring's `importCapability.bundle` is not `true`.
|
|
294
|
+
*
|
|
295
|
+
* Default for every role on every dimension is closed — owners and
|
|
296
|
+
* admins must positively grant the capability. Distinct from
|
|
297
|
+
* `PermissionDeniedError` and `NoAccessError` so UI layers can show a
|
|
298
|
+
* specific "request the import capability" flow.
|
|
299
|
+
*/
|
|
300
|
+
declare class ImportCapabilityError extends NoydbError {
|
|
301
|
+
readonly tier: 'plaintext' | 'bundle';
|
|
302
|
+
readonly format?: string;
|
|
303
|
+
readonly userId: string;
|
|
304
|
+
constructor(opts: {
|
|
305
|
+
tier: 'plaintext' | 'bundle';
|
|
306
|
+
userId: string;
|
|
307
|
+
format?: string;
|
|
308
|
+
message?: string;
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Thrown when a grant would give the grantee a permission the grantor
|
|
313
|
+
* does not themselves hold — the "admin cannot grant what admin cannot
|
|
314
|
+
* do" rule from the admin-delegation work.
|
|
315
|
+
*
|
|
316
|
+
* Distinct from `PermissionDeniedError` so callers can tell the two
|
|
317
|
+
* cases apart in logs and tests:
|
|
318
|
+
*
|
|
319
|
+
* - `PermissionDeniedError` — "you are not allowed to perform this
|
|
320
|
+
* operation at all" (wrong role).
|
|
321
|
+
* - `PrivilegeEscalationError` — "you are allowed to grant, but not
|
|
322
|
+
* with these specific permissions" (widening attempt).
|
|
323
|
+
*
|
|
324
|
+
* Under the admin model the grantee of an admin-grants-admin call
|
|
325
|
+
* inherits the caller's entire DEK set by construction, so this error
|
|
326
|
+
* is structurally unreachable in typical flows. The check and error
|
|
327
|
+
* class exist so that future per-collection admin scoping cannot
|
|
328
|
+
* accidentally bypass the subset rule — the guard is already wired in.
|
|
329
|
+
*
|
|
330
|
+
* `offendingCollection` carries the first collection name that failed
|
|
331
|
+
* the subset check, to make the violation actionable in error output.
|
|
332
|
+
*/
|
|
333
|
+
/**
|
|
334
|
+
* Thrown when a caller invokes an API that requires an optional
|
|
335
|
+
* store capability the active store does not implement.
|
|
336
|
+
*
|
|
337
|
+
* Today the only call site is `Noydb.listAccessibleVaults()`,
|
|
338
|
+
* which depends on the optional `NoydbStore.listVaults()`
|
|
339
|
+
* method. The error message names the missing method and the calling
|
|
340
|
+
* API so consumers know exactly which combination is unsupported,
|
|
341
|
+
* and the `capability` field is machine-readable so library code can
|
|
342
|
+
* pattern-match in catch blocks (e.g. fall back to a candidate-list
|
|
343
|
+
* shape).
|
|
344
|
+
*
|
|
345
|
+
* The class lives in `errors.ts` rather than as a generic
|
|
346
|
+
* `ValidationError` because the diagnostic shape is different: a
|
|
347
|
+
* `ValidationError` says "the inputs you passed are wrong"; this
|
|
348
|
+
* error says "the inputs are fine, but the store you wired up
|
|
349
|
+
* doesn't support what you're asking for." Different fix, different
|
|
350
|
+
* documentation.
|
|
351
|
+
*/
|
|
352
|
+
declare class StoreCapabilityError extends NoydbError {
|
|
353
|
+
/** The store method/capability that was missing. */
|
|
354
|
+
readonly capability: string;
|
|
355
|
+
constructor(capability: string, callerApi: string, storeName?: string);
|
|
356
|
+
}
|
|
357
|
+
declare class PrivilegeEscalationError extends NoydbError {
|
|
358
|
+
readonly offendingCollection: string;
|
|
359
|
+
constructor(offendingCollection: string, message?: string);
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Thrown when a reserved internal vault name (e.g. `__noydb_state__`) is used
|
|
363
|
+
* as a group name or partition key.
|
|
364
|
+
*
|
|
365
|
+
* Internal vault names are prefixed or surrounded with double-underscores to
|
|
366
|
+
* avoid collisions with user-defined vault names. Attempting to use one as a
|
|
367
|
+
* group name or partition key bypasses the naming policy and is rejected
|
|
368
|
+
* eagerly so the mis-configuration is surfaced immediately.
|
|
369
|
+
*/
|
|
370
|
+
declare class ReservedVaultNameError extends NoydbError {
|
|
371
|
+
/** The rejected vault name. */
|
|
372
|
+
readonly vaultName: string;
|
|
373
|
+
constructor(vaultName: string);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Thrown by `Collection.put` / `.delete` when the target record's
|
|
377
|
+
* envelope `_ts` falls within a closed accounting period.
|
|
378
|
+
*
|
|
379
|
+
* Distinct from `ReadOnlyError` (keyring-level), `ReadOnlyAtInstantError`
|
|
380
|
+
* (historical view), and `ReadOnlyFrameError` (shadow vault): this
|
|
381
|
+
* error is about the STORED RECORD being sealed by an operator call
|
|
382
|
+
* to `vault.closePeriod()`, independent of caller permissions or
|
|
383
|
+
* view type. The `periodName` and `endDate` fields name the sealing
|
|
384
|
+
* period so audit UIs can surface a "this record is locked in
|
|
385
|
+
* FY2026-Q1 (closed 2026-03-31)" message without parsing the error
|
|
386
|
+
* string.
|
|
387
|
+
*
|
|
388
|
+
* To apply a correction after close, book a compensating entry in a
|
|
389
|
+
* new period rather than unlocking the old one. Re-opening a closed
|
|
390
|
+
* period is deliberately unsupported.
|
|
391
|
+
*/
|
|
392
|
+
declare class PeriodClosedError extends NoydbError {
|
|
393
|
+
readonly periodName: string;
|
|
394
|
+
readonly endDate: string;
|
|
395
|
+
readonly recordTs: string;
|
|
396
|
+
constructor(periodName: string, endDate: string, recordTs: string);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Thrown when a `put()` or `delete()` is rejected by a guard's `check`
|
|
400
|
+
* function. The `reason` is the message the guard supplied — typically a
|
|
401
|
+
* short business description (e.g. "invoice is issued"). The full
|
|
402
|
+
* collection + id are surfaced so audit UIs can link back to the record.
|
|
403
|
+
*/
|
|
404
|
+
declare class RecordLockedError extends NoydbError {
|
|
405
|
+
readonly collection: string;
|
|
406
|
+
readonly id: string;
|
|
407
|
+
readonly reason: string;
|
|
408
|
+
constructor(collection: string, id: string, reason: string);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Thrown when a `put()` changes one or more fields that are frozen by a
|
|
412
|
+
* `frozenFields` guard. The `fields` list contains the specific paths
|
|
413
|
+
* that were detected as changed.
|
|
414
|
+
*/
|
|
415
|
+
declare class FieldFrozenError extends NoydbError {
|
|
416
|
+
readonly collection: string;
|
|
417
|
+
readonly id: string;
|
|
418
|
+
readonly fields: readonly string[];
|
|
419
|
+
constructor(collection: string, id: string, fields: readonly string[]);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Thrown by a `transitionGuard` when a write moves a state field along an
|
|
423
|
+
* arc that the declared transition graph does not allow — either an
|
|
424
|
+
* update `from → to` that is not a listed edge, or an insert whose
|
|
425
|
+
* initial state is not in the allowed `initial` set (reported with
|
|
426
|
+
* `from: '(none)'`). Override via an amendment transaction by an
|
|
427
|
+
* authorized role, like any guard.
|
|
428
|
+
*/
|
|
429
|
+
declare class IllegalTransitionError extends NoydbError {
|
|
430
|
+
readonly collection: string;
|
|
431
|
+
readonly id: string;
|
|
432
|
+
readonly from: string;
|
|
433
|
+
readonly to: string;
|
|
434
|
+
constructor(collection: string, id: string, from: string, to: string);
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Thrown by an amendment invariant when the proposed change-set violates
|
|
438
|
+
* the declared business rule (e.g. disbursement total not preserved).
|
|
439
|
+
* Triggers a full transaction rollback via the existing revert pass.
|
|
440
|
+
*/
|
|
441
|
+
declare class InvariantError extends NoydbError {
|
|
442
|
+
constructor(message: string);
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Thrown at `withTransactions({ amendment: true })` open if the caller's
|
|
446
|
+
* role is not in the guard's allowed amendment roles. Fail-fast: thrown
|
|
447
|
+
* before any writes are attempted.
|
|
448
|
+
*/
|
|
449
|
+
declare class AmendmentForbiddenError extends NoydbError {
|
|
450
|
+
readonly userId: string;
|
|
451
|
+
readonly role: string;
|
|
452
|
+
constructor(userId: string, role: string);
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Thrown by `listUsersWithEnvelopes` when the vault's user directory
|
|
456
|
+
* has been disabled (via `db.setDirectoryEnabled(vault, false)`) and
|
|
457
|
+
* the caller's role is neither `owner` nor `admin`. Owner/admin can
|
|
458
|
+
* still enumerate users — the toggle is a UX privacy switch, not a
|
|
459
|
+
* security boundary.
|
|
460
|
+
*
|
|
461
|
+
* Honest caveat: this is a UX flag, not a privacy guarantee. The
|
|
462
|
+
* envelope ciphertext is still in the store, the keyring file is
|
|
463
|
+
* still listed at `_keyring/*`, and anyone with direct store read
|
|
464
|
+
* access can count keyrings without going through the hub. See
|
|
465
|
+
* `docs/subsystems/user-envelope.md` → "Directory visibility".
|
|
466
|
+
*/
|
|
467
|
+
declare class DirectoryDisabledError extends NoydbError {
|
|
468
|
+
readonly vault: string;
|
|
469
|
+
constructor(vault: string);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Thrown when a user tries to act at a tier they are not cleared for.
|
|
473
|
+
*
|
|
474
|
+
* This is the umbrella error for tier write refusals:
|
|
475
|
+
* - `put({ tier: N })` when the user's keyring lacks tier-N DEK.
|
|
476
|
+
* - `elevate(id, N)` when the caller cannot reach tier N.
|
|
477
|
+
*
|
|
478
|
+
* Distinct from `TierAccessDeniedError` which covers *read* refusals on
|
|
479
|
+
* the invisibility/ghost path.
|
|
480
|
+
*/
|
|
481
|
+
declare class TierNotGrantedError extends NoydbError {
|
|
482
|
+
readonly tier: number;
|
|
483
|
+
readonly collection: string;
|
|
484
|
+
constructor(collection: string, tier: number);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Thrown when an elevated-handle operation runs after the elevation's
|
|
488
|
+
* TTL expired. Reads continue at the original tier; only writes
|
|
489
|
+
* through the scoped handle flip to throwing once expired.
|
|
490
|
+
*/
|
|
491
|
+
declare class ElevationExpiredError extends NoydbError {
|
|
492
|
+
readonly tier: number;
|
|
493
|
+
readonly expiresAt: number;
|
|
494
|
+
constructor(opts: {
|
|
495
|
+
tier: number;
|
|
496
|
+
expiresAt: number;
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Thrown by `vault.elevate(...)` when an elevation is already active
|
|
501
|
+
* on the vault. Adopters must `release()` the existing handle before
|
|
502
|
+
* starting a new elevation.
|
|
503
|
+
*/
|
|
504
|
+
declare class AlreadyElevatedError extends NoydbError {
|
|
505
|
+
readonly activeTier: number;
|
|
506
|
+
constructor(activeTier: number);
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Thrown when `demote()` is called by someone who is not the original
|
|
510
|
+
* elevator and not an owner.
|
|
511
|
+
*/
|
|
512
|
+
declare class TierDemoteDeniedError extends NoydbError {
|
|
513
|
+
constructor(id: string, tier: number);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Thrown when `db.delegate()` is called against a user that has no
|
|
517
|
+
* keyring in the target vault — the delegation token cannot be
|
|
518
|
+
* constructed without the target user's KEK wrap.
|
|
519
|
+
*/
|
|
520
|
+
declare class DelegationTargetMissingError extends NoydbError {
|
|
521
|
+
readonly toUser: string;
|
|
522
|
+
constructor(toUser: string);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Thrown when a `put()` detects an optimistic concurrency conflict.
|
|
526
|
+
*
|
|
527
|
+
* NOYDB uses version numbers (`_v`) for optimistic locking. If a `put()`
|
|
528
|
+
* is called with `expectedVersion: N` but the stored record is at version
|
|
529
|
+
* `M ≠ N`, the write is rejected and the caller must re-read, re-apply their
|
|
530
|
+
* change, and retry. The `version` field carries the actual stored version
|
|
531
|
+
* so callers can decide whether to retry or surface the conflict to the user.
|
|
532
|
+
*/
|
|
533
|
+
declare class ConflictError extends NoydbError {
|
|
534
|
+
/** The actual stored version at the time of conflict. */
|
|
535
|
+
readonly version: number;
|
|
536
|
+
constructor(version: number, message?: string);
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Thrown by `LedgerStore.append()` after exhausting its CAS retry
|
|
540
|
+
* budget under multi-writer contention. Two browser tabs, a
|
|
541
|
+
* web app + an offline mobile peer, or a server worker pool all
|
|
542
|
+
* producing ledger entries against the same vault can race on the
|
|
543
|
+
* "read head, write head+1" cycle; the optimistic-CAS retry loop
|
|
544
|
+
* resolves the race for `casAtomic: true` stores, but pathological
|
|
545
|
+
* contention (or a buggy peer) can still exhaust the budget. When
|
|
546
|
+
* that happens, the chain is intact — the failed writer simply
|
|
547
|
+
* couldn't claim a slot. Caller's choice whether to retry, queue,
|
|
548
|
+
* or surface the failure to the user.
|
|
549
|
+
*/
|
|
550
|
+
declare class LedgerContentionError extends NoydbError {
|
|
551
|
+
readonly attempts: number;
|
|
552
|
+
constructor(attempts: number);
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Thrown by `vault.sequence(name).next()` after exhausting its CAS retry
|
|
556
|
+
* budget under contention. The counter is intact; the caller may retry.
|
|
557
|
+
*/
|
|
558
|
+
declare class SequenceContentionError extends NoydbError {
|
|
559
|
+
readonly sequence: string;
|
|
560
|
+
readonly attempts: number;
|
|
561
|
+
constructor(sequence: string, attempts: number);
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Thrown by `vault.sequence(name).next()` when the backing store is not
|
|
565
|
+
* CAS-capable (`capabilities.casAtomic !== true`). Gap-free numbering
|
|
566
|
+
* requires single-authority serialization, which an offline / non-CAS
|
|
567
|
+
* store cannot provide — this is a deliberate online-only wall.
|
|
568
|
+
*/
|
|
569
|
+
declare class SequenceOfflineError extends NoydbError {
|
|
570
|
+
constructor();
|
|
571
|
+
}
|
|
572
|
+
/** Thrown by a deferred-numbering pass when the store clock is unavailable or its uncertainty cannot be resolved. */
|
|
573
|
+
declare class NumberingUncertaintyError extends NoydbError {
|
|
574
|
+
readonly series: string;
|
|
575
|
+
constructor(series: string);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Thrown when a bundle push is rejected because the remote has been updated
|
|
579
|
+
* since the local bundle was last pulled.
|
|
580
|
+
*
|
|
581
|
+
* Unlike `ConflictError` (per-record), this is a whole-bundle conflict —
|
|
582
|
+
* the remote's bundle handle has changed. The caller must pull the new
|
|
583
|
+
* bundle, merge, and re-push. `remoteVersion` is the handle of the newer
|
|
584
|
+
* remote bundle for use in diagnostics.
|
|
585
|
+
*/
|
|
586
|
+
declare class BundleVersionConflictError extends NoydbError {
|
|
587
|
+
/** The bundle handle of the newer remote version that rejected the push. */
|
|
588
|
+
readonly remoteVersion: string;
|
|
589
|
+
constructor(remoteVersion: string, message?: string);
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Thrown when a sync operation (push or pull) fails due to a network error.
|
|
593
|
+
*
|
|
594
|
+
* NOYDB's offline-first design means network errors are expected during sync.
|
|
595
|
+
* Callers should catch `NetworkError`, surface connectivity status in the UI,
|
|
596
|
+
* and rely on the `SyncScheduler` to retry when connectivity is restored.
|
|
597
|
+
*/
|
|
598
|
+
declare class NetworkError extends NoydbError {
|
|
599
|
+
constructor(message?: string);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Thrown when `collection.get(id)` is called with an ID that does not exist.
|
|
603
|
+
*
|
|
604
|
+
* NOYDB collections are memory-first, so this error is synchronous and cheap —
|
|
605
|
+
* it does not make a network round-trip. Callers that expect the record to be
|
|
606
|
+
* absent should use `collection.getOrNull(id)` instead.
|
|
607
|
+
*/
|
|
608
|
+
declare class NotFoundError extends NoydbError {
|
|
609
|
+
constructor(message?: string);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Thrown when application-level validation fails before encryption.
|
|
613
|
+
*
|
|
614
|
+
* Distinct from `SchemaValidationError` (Standard Schema v1 validator)
|
|
615
|
+
* and `MissingTranslationError` (i18nText). `ValidationError` is the
|
|
616
|
+
* general-purpose validation base — use it for custom guards in `put()`
|
|
617
|
+
* hooks or store middleware.
|
|
618
|
+
*/
|
|
619
|
+
declare class ValidationError extends NoydbError {
|
|
620
|
+
constructor(message?: string);
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Thrown when a Standard Schema v1 validator rejects a record on
|
|
624
|
+
* `put()` (input validation) or on read (output validation). Carries
|
|
625
|
+
* the raw issue list so callers can render field-level errors.
|
|
626
|
+
*
|
|
627
|
+
* `direction` distinguishes the two cases:
|
|
628
|
+
* - `'input'`: the user passed bad data into `put()`. This is a
|
|
629
|
+
* normal error case that application code should handle — typically
|
|
630
|
+
* by showing validation messages in the UI.
|
|
631
|
+
* - `'output'`: stored data does not match the current schema. This
|
|
632
|
+
* indicates a schema drift (the schema was changed without
|
|
633
|
+
* migrating the existing records) and should be treated as a bug
|
|
634
|
+
* — the application should not swallow it silently.
|
|
635
|
+
*
|
|
636
|
+
* The `issues` type is deliberately `readonly unknown[]` on this class
|
|
637
|
+
* so that `errors.ts` doesn't need to import from `schema.ts` (and
|
|
638
|
+
* create a dependency cycle). Callers who know they're holding a
|
|
639
|
+
* `SchemaValidationError` can cast to the more precise
|
|
640
|
+
* `readonly StandardSchemaV1Issue[]` from `schema.ts`.
|
|
641
|
+
*/
|
|
642
|
+
declare class SchemaValidationError extends NoydbError {
|
|
643
|
+
readonly issues: readonly unknown[];
|
|
644
|
+
readonly direction: 'input' | 'output';
|
|
645
|
+
constructor(message: string, issues: readonly unknown[], direction: 'input' | 'output');
|
|
646
|
+
}
|
|
647
|
+
/** Base for schema-evolution strategy rejections. */
|
|
648
|
+
declare class SchemaUpdateError extends NoydbError {
|
|
649
|
+
constructor(code: string, message: string);
|
|
650
|
+
}
|
|
651
|
+
/** A non-additive schema change was rejected by the `additiveOnly()` strategy. */
|
|
652
|
+
declare class NonAdditiveSchemaChangeError extends SchemaUpdateError {
|
|
653
|
+
constructor(message: string);
|
|
654
|
+
}
|
|
655
|
+
/** A schema change was rejected by the `lockSchema()` strategy. */
|
|
656
|
+
declare class SchemaLockedError extends SchemaUpdateError {
|
|
657
|
+
constructor(message: string);
|
|
658
|
+
}
|
|
659
|
+
/** Write attempted while a schema cutover fence is up (draining/migrating, or this collection has a pending cutover). */
|
|
660
|
+
declare class SchemaFenceError extends SchemaUpdateError {
|
|
661
|
+
constructor(message: string);
|
|
662
|
+
}
|
|
663
|
+
/** Write attempted by a client whose generation snapshot is behind the live fence — reload required. */
|
|
664
|
+
declare class MigrationRequiredError extends SchemaUpdateError {
|
|
665
|
+
constructor(message: string);
|
|
666
|
+
}
|
|
667
|
+
/** A coordinated cutover timed out waiting for active clients to quiesce. */
|
|
668
|
+
declare class QuiesceTimeoutError extends SchemaUpdateError {
|
|
669
|
+
constructor(message: string);
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Thrown when `.groupBy().aggregate()` produces more than the hard
|
|
673
|
+
* cardinality cap (default 100_000 groups)..
|
|
674
|
+
*
|
|
675
|
+
* The cap exists because `.groupBy()` materializes one bucket per
|
|
676
|
+
* distinct key value in memory, and runaway cardinality — a groupBy
|
|
677
|
+
* on a high-uniqueness field like `id` or `createdAt` — is almost
|
|
678
|
+
* always a query mistake rather than legitimate use. A hard error is
|
|
679
|
+
* better than silent OOM: the consumer sees an actionable message
|
|
680
|
+
* naming the field and the observed cardinality, with guidance to
|
|
681
|
+
* either narrow the query with `.where()` or accept the ceiling
|
|
682
|
+
* override.
|
|
683
|
+
*
|
|
684
|
+
* A separate one-shot warning fires at 10% of the cap (10_000
|
|
685
|
+
* groups) so consumers get a heads-up before the hard error — same
|
|
686
|
+
* pattern as `JoinTooLargeError` and the `.join()` row ceiling.
|
|
687
|
+
*
|
|
688
|
+
* **Not overridable in.** The 100k cap is a fixed constant so
|
|
689
|
+
* the failure mode is consistent across the codebase; a
|
|
690
|
+
* `{ maxGroups }` override can be added later without a break if a
|
|
691
|
+
* real consumer asks.
|
|
692
|
+
*/
|
|
693
|
+
declare class GroupCardinalityError extends NoydbError {
|
|
694
|
+
/** The field being grouped on. */
|
|
695
|
+
readonly field: string;
|
|
696
|
+
/** Observed number of distinct groups at the moment the cap tripped. */
|
|
697
|
+
readonly cardinality: number;
|
|
698
|
+
/** The cap that was exceeded. */
|
|
699
|
+
readonly maxGroups: number;
|
|
700
|
+
constructor(field: string, cardinality: number, maxGroups: number);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Thrown in lazy mode when a `.query()` / `.where()` / `.orderBy()` clause
|
|
704
|
+
* references a field that does not have a declared index.
|
|
705
|
+
*
|
|
706
|
+
* Lazy-mode queries only work when every touched field is indexed.
|
|
707
|
+
* This is deliberate — silent scan-fallback would hide the performance
|
|
708
|
+
* cliff that lazy-mode indexes exist to prevent.
|
|
709
|
+
*
|
|
710
|
+
* Payload:
|
|
711
|
+
* - `collection` — name of the collection queried
|
|
712
|
+
* - `touchedFields` — every field referenced by the query (filter + order)
|
|
713
|
+
* - `missingFields` — subset of `touchedFields` that have no declared index
|
|
714
|
+
*/
|
|
715
|
+
declare class IndexRequiredError extends NoydbError {
|
|
716
|
+
readonly collection: string;
|
|
717
|
+
readonly touchedFields: readonly string[];
|
|
718
|
+
readonly missingFields: readonly string[];
|
|
719
|
+
constructor(args: {
|
|
720
|
+
collection: string;
|
|
721
|
+
touchedFields: readonly string[];
|
|
722
|
+
missingFields: readonly string[];
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Thrown by `Collection.put()` when writing a record would violate a
|
|
727
|
+
* unique-index constraint — the same field value (or composite field
|
|
728
|
+
* tuple) is already held by a *different* record id in the collection.
|
|
729
|
+
*
|
|
730
|
+
* Properties:
|
|
731
|
+
* - `collection` — name of the collection the write was targeting
|
|
732
|
+
* - `recordId` — the id of the record being written (the would-be violator)
|
|
733
|
+
* - `fields` — the constrained field(s), e.g. `['taxId']` or `['workerId','employerEntityId']`
|
|
734
|
+
* - `conflictingId` — the id of the record already holding the value
|
|
735
|
+
*
|
|
736
|
+
* Null-distinct semantics: if any constrained field is `null`/`undefined`,
|
|
737
|
+
* the row is exempt (the constraint does not fire). This matches standard
|
|
738
|
+
* SQL NULL-distinct behavior.
|
|
739
|
+
*/
|
|
740
|
+
declare class UniqueConstraintError extends NoydbError {
|
|
741
|
+
readonly collection: string;
|
|
742
|
+
readonly recordId: string;
|
|
743
|
+
readonly fields: readonly string[];
|
|
744
|
+
readonly conflictingId: string;
|
|
745
|
+
constructor(collection: string, recordId: string, fields: readonly string[], conflictingId: string);
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Thrown at collection registration when an index option is declared that
|
|
749
|
+
* is incompatible with the collection's operating mode.
|
|
750
|
+
*
|
|
751
|
+
* Currently covers two cases:
|
|
752
|
+
* - `unique: true` on a lazy-mode (`prefetch: false`) collection — lazy mode
|
|
753
|
+
* does not pre-load all records, so an in-memory uniqueness map cannot be
|
|
754
|
+
* maintained reliably.
|
|
755
|
+
* - `unique: true` on a CRDT collection (`crdt: 'lww-map' | 'rga' | 'yjs'`) —
|
|
756
|
+
* CRDT put() short-circuits the unique-constraint check, so enforcement would
|
|
757
|
+
* silently not fire.
|
|
758
|
+
*
|
|
759
|
+
* Both cases are caught eagerly at `vault.collection()` time so the developer
|
|
760
|
+
* sees the incompatibility immediately rather than shipping silently-ignored
|
|
761
|
+
* constraints.
|
|
762
|
+
*
|
|
763
|
+
* The `option` field names the incompatible option (`'unique'`) so catch blocks
|
|
764
|
+
* can pattern-match without inspecting the error message.
|
|
765
|
+
*/
|
|
766
|
+
declare class UnsupportedIndexOptionError extends NoydbError {
|
|
767
|
+
readonly option: string;
|
|
768
|
+
constructor(option: string, message: string);
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Thrown (or surfaced via the `index:write-partial` event) when one or more
|
|
772
|
+
* per-indexed-field side-car writes fail after the main record write has
|
|
773
|
+
* already succeeded.
|
|
774
|
+
*
|
|
775
|
+
* Not thrown out of `.put()` / `.delete()` directly — those succeed when the
|
|
776
|
+
* main record succeeds. Instead, `IndexWriteFailureError` instances are collected
|
|
777
|
+
* into the session-scoped reconcile queue and emitted on the Collection
|
|
778
|
+
* emitter as `index:write-partial`.
|
|
779
|
+
*
|
|
780
|
+
* Payload:
|
|
781
|
+
* - `recordId` — the id of the main record whose side-car writes failed
|
|
782
|
+
* - `field` — the indexed field whose side-car write failed
|
|
783
|
+
* - `op` — `'put'` or `'delete'`, indicating which mutation was in flight
|
|
784
|
+
* - `cause` — the underlying error from the store
|
|
785
|
+
*/
|
|
786
|
+
declare class IndexWriteFailureError extends NoydbError {
|
|
787
|
+
readonly recordId: string;
|
|
788
|
+
readonly field: string;
|
|
789
|
+
readonly op: 'put' | 'delete';
|
|
790
|
+
readonly cause: unknown;
|
|
791
|
+
constructor(args: {
|
|
792
|
+
recordId: string;
|
|
793
|
+
field: string;
|
|
794
|
+
op: 'put' | 'delete';
|
|
795
|
+
cause: unknown;
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Thrown by `readNoydbBundle()` when the body bytes don't match
|
|
800
|
+
* the integrity hash declared in the bundle header — i.e. someone
|
|
801
|
+
* modified the bytes between write and read.
|
|
802
|
+
*
|
|
803
|
+
* Distinct from a generic `Error` (which would be thrown for
|
|
804
|
+
* format violations like a missing magic prefix or malformed
|
|
805
|
+
* header JSON) so consumers can pattern-match the corruption case
|
|
806
|
+
* and handle it differently from a producer bug. A
|
|
807
|
+
* `BundleIntegrityError` indicates "the bytes you got are not
|
|
808
|
+
* what was written"; a plain `Error` from `parsePrefixAndHeader`
|
|
809
|
+
* indicates "what was written wasn't a valid bundle in the first
|
|
810
|
+
* place."
|
|
811
|
+
*
|
|
812
|
+
* Also thrown when decompression fails after the integrity hash
|
|
813
|
+
* passed — that's a producer bug (the wrong algorithm byte was
|
|
814
|
+
* written) but it surfaces with the same error class because the
|
|
815
|
+
* end result is "the body cannot be turned back into a dump."
|
|
816
|
+
*/
|
|
817
|
+
declare class BundleIntegrityError extends NoydbError {
|
|
818
|
+
constructor(message: string);
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Thrown by `readNoydbBundle` when the bundle carries
|
|
822
|
+
* sealed per-user passphrases but no supplied `SealingKeyProvider`
|
|
823
|
+
* has a `.id` (= `pid`) matching the sealed entry's `pid`.
|
|
824
|
+
*
|
|
825
|
+
* Carries the failing pid + the user id so the recipient can
|
|
826
|
+
* surface an actionable prompt:
|
|
827
|
+
*
|
|
828
|
+
* ```
|
|
829
|
+
* BundleSealMismatchError: bundle carries sealed passphrase for user "alice"
|
|
830
|
+
* under provider "macos-keychain:com.acme.app/alice@acme.example",
|
|
831
|
+
* but no registered provider matches that pid.
|
|
832
|
+
* ```
|
|
833
|
+
*
|
|
834
|
+
* Three resolution paths the message names (per foundation §11.9.4):
|
|
835
|
+
*
|
|
836
|
+
* 1. Configure a provider matching the pid and retry import.
|
|
837
|
+
* 2. Pass `attemptUnsealAcrossProviders: true` to try each
|
|
838
|
+
* registered provider regardless of pid.
|
|
839
|
+
* 3. Inspect without unsealing — pass no `sealingProviders` to
|
|
840
|
+
* receive the sealed entries unmodified for offline analysis.
|
|
841
|
+
*/
|
|
842
|
+
declare class BundleSealMismatchError extends NoydbError {
|
|
843
|
+
readonly userId: string;
|
|
844
|
+
readonly pid: string;
|
|
845
|
+
constructor(userId: string, pid: string);
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Thrown when `vault.collection()` is called with a name that is
|
|
849
|
+
* reserved for NOYDB internal use (any name starting with `_dict_`).
|
|
850
|
+
*
|
|
851
|
+
* Dictionary collections are accessed exclusively via
|
|
852
|
+
* `vault.dictionary(name)` — attempting to open one as a regular
|
|
853
|
+
* collection would bypass the dictionary invariants (ACL, rename
|
|
854
|
+
* tracking, reserved-name policy).
|
|
855
|
+
*/
|
|
856
|
+
declare class ReservedCollectionNameError extends NoydbError {
|
|
857
|
+
/** The rejected collection name. */
|
|
858
|
+
readonly collectionName: string;
|
|
859
|
+
constructor(collectionName: string);
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Thrown by `DictionaryHandle.get()` and `DictionaryHandle.delete()` when
|
|
863
|
+
* the requested key does not exist in the dictionary.
|
|
864
|
+
*
|
|
865
|
+
* Distinct from `NotFoundError` (which is for data records) so callers
|
|
866
|
+
* can distinguish "data record missing" from "dictionary key missing"
|
|
867
|
+
* without inspecting error messages.
|
|
868
|
+
*/
|
|
869
|
+
declare class DictKeyMissingError extends NoydbError {
|
|
870
|
+
/** The dictionary name. */
|
|
871
|
+
readonly dictionaryName: string;
|
|
872
|
+
/** The key that was not found. */
|
|
873
|
+
readonly key: string;
|
|
874
|
+
constructor(dictionaryName: string, key: string);
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Thrown by `DictionaryHandle.delete()` in strict mode when the key to
|
|
878
|
+
* be deleted is still referenced by one or more records.
|
|
879
|
+
*
|
|
880
|
+
* The caller must either rename the key first (the only sanctioned
|
|
881
|
+
* mass-mutation path) or pass `{ mode: 'warn' }` to skip the check
|
|
882
|
+
* (development only).
|
|
883
|
+
*/
|
|
884
|
+
declare class DictKeyInUseError extends NoydbError {
|
|
885
|
+
/** The dictionary name. */
|
|
886
|
+
readonly dictionaryName: string;
|
|
887
|
+
/** The key that is still referenced. */
|
|
888
|
+
readonly key: string;
|
|
889
|
+
/** Name of the first collection found to reference this key. */
|
|
890
|
+
readonly usedBy: string;
|
|
891
|
+
/** Number of records in `usedBy` that reference this key. */
|
|
892
|
+
readonly count: number;
|
|
893
|
+
constructor(dictionaryName: string, key: string, usedBy: string, count: number);
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Thrown by `Collection.put()` when an `i18nText` field is missing one
|
|
897
|
+
* or more required translations.
|
|
898
|
+
*
|
|
899
|
+
* The `missing` array names each locale code that was absent from the
|
|
900
|
+
* field value. The `field` property names the field so callers can
|
|
901
|
+
* render a field-level error message without parsing the string.
|
|
902
|
+
*/
|
|
903
|
+
declare class MissingTranslationError extends NoydbError {
|
|
904
|
+
/** The field name whose translation(s) are missing. */
|
|
905
|
+
readonly field: string;
|
|
906
|
+
/** Locale codes that were required but absent. */
|
|
907
|
+
readonly missing: readonly string[];
|
|
908
|
+
constructor(field: string, missing: readonly string[], message?: string);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Thrown when reading an `i18nText` field without specifying a locale —
|
|
912
|
+
* either at the call site (`get(id, { locale })`) or on the vault
|
|
913
|
+
* (`openVault(name, { locale })`).
|
|
914
|
+
*
|
|
915
|
+
* Also thrown when `resolveI18nText()` exhausts the fallback chain and
|
|
916
|
+
* no translation is available for the requested locale.
|
|
917
|
+
*
|
|
918
|
+
* The `field` property names the field that triggered the error so the
|
|
919
|
+
* caller can surface it in the UI.
|
|
920
|
+
*/
|
|
921
|
+
declare class LocaleNotSpecifiedError extends NoydbError {
|
|
922
|
+
/** The field name that required a locale. */
|
|
923
|
+
readonly field: string;
|
|
924
|
+
constructor(field: string, message?: string);
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Thrown at write time when an `i18nText` slot's value contains
|
|
928
|
+
* characters outside the script set allowed for that locale, and the
|
|
929
|
+
* field's `onScriptViolation` policy is `'reject'` (the default).
|
|
930
|
+
*
|
|
931
|
+
* Distinct from {@link MissingTranslationError} (write-shape) and
|
|
932
|
+
* {@link LocaleNotSpecifiedError} (read-hole) so callers can tell a
|
|
933
|
+
* wrong-script value from a missing one.
|
|
934
|
+
*/
|
|
935
|
+
declare class ScriptViolationError extends NoydbError {
|
|
936
|
+
/** The field whose value violated its script constraint. */
|
|
937
|
+
readonly field: string;
|
|
938
|
+
/** The locale slot (e.g. `'en'`) that was checked. */
|
|
939
|
+
readonly locale: string;
|
|
940
|
+
/** The Unicode scripts allowed for this slot. */
|
|
941
|
+
readonly expected: readonly string[];
|
|
942
|
+
/** A short sample of the offending characters, for diagnostics. */
|
|
943
|
+
readonly sample: string;
|
|
944
|
+
constructor(field: string, locale: string, expected: readonly string[], sample: string, message?: string);
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Thrown when a mutation (`put`/`putAll`/`rename`/`delete`) is attempted
|
|
948
|
+
* against a dictionary name that is backed by a `staticDict()` descriptor.
|
|
949
|
+
*
|
|
950
|
+
* A static dict's labels are code constants with no per-vault storage and no
|
|
951
|
+
* mutation surface — a label change is a code deploy, not a runtime write.
|
|
952
|
+
* Distinct from the other dictionary errors so callers can tell a
|
|
953
|
+
* "this dict is read-only by construction" refusal from a missing-key or
|
|
954
|
+
* key-in-use failure. (#291)
|
|
955
|
+
*/
|
|
956
|
+
declare class StaticDictReadonlyError extends NoydbError {
|
|
957
|
+
/** The static dictionary name that was the target of the mutation. */
|
|
958
|
+
readonly dictionaryName: string;
|
|
959
|
+
constructor(dictionaryName: string);
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Thrown at put-time when a record stores a code for a `staticDict()` field
|
|
963
|
+
* that is not in the descriptor's declared `keys` (a typo or a stale code).
|
|
964
|
+
*
|
|
965
|
+
* Codes are closed by construction, so an unknown code is treated as a bug by
|
|
966
|
+
* default. Opt out per descriptor with `{ validateCodes: false }`.
|
|
967
|
+
*
|
|
968
|
+
* Distinct from {@link LocaleNotSpecifiedError} (a read-hole) — this is a
|
|
969
|
+
* write-shape error. (#291)
|
|
970
|
+
*/
|
|
971
|
+
declare class UnknownDictCodeError extends NoydbError {
|
|
972
|
+
/** The static dictionary name. */
|
|
973
|
+
readonly dictionaryName: string;
|
|
974
|
+
/** The field that carried the unknown code. */
|
|
975
|
+
readonly field: string;
|
|
976
|
+
/** The offending code value. */
|
|
977
|
+
readonly code: string;
|
|
978
|
+
constructor(dictionaryName: string, field: string, code: string);
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Thrown when a collection has an `i18nText` field with
|
|
982
|
+
* `autoTranslate: true` but no `plaintextTranslator` was configured
|
|
983
|
+
* on `createNoydb()`.
|
|
984
|
+
*
|
|
985
|
+
* The error is raised at `put()` time (not at schema construction) so
|
|
986
|
+
* the mis-configuration is surfaced by the first write rather than
|
|
987
|
+
* silently at startup.
|
|
988
|
+
*/
|
|
989
|
+
declare class TranslatorNotConfiguredError extends NoydbError {
|
|
990
|
+
/** The field that requested auto-translation. */
|
|
991
|
+
readonly field: string;
|
|
992
|
+
/** The collection the put was targeting. */
|
|
993
|
+
readonly collection: string;
|
|
994
|
+
constructor(field: string, collection: string);
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Thrown when `Vault.load()` finds that a backup's hash chain
|
|
998
|
+
* doesn't verify, or that its embedded `ledgerHead.hash` doesn't
|
|
999
|
+
* match the chain head reconstructed from the loaded entries.
|
|
1000
|
+
*
|
|
1001
|
+
* Distinct from `BackupCorruptedError` so callers can choose to
|
|
1002
|
+
* recover from one but not the other (e.g., a corrupted JSON file is
|
|
1003
|
+
* unrecoverable; a chain mismatch might mean the backup is from an
|
|
1004
|
+
* incompatible noy-db version).
|
|
1005
|
+
*/
|
|
1006
|
+
declare class BackupLedgerError extends NoydbError {
|
|
1007
|
+
/** First-broken-entry index, if known. */
|
|
1008
|
+
readonly divergedAt?: number;
|
|
1009
|
+
constructor(message: string, divergedAt?: number);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Thrown when `Vault.load()` finds that the backup's data
|
|
1013
|
+
* collection content doesn't match the ledger's recorded
|
|
1014
|
+
* `payloadHash`es. This is the "envelope was tampered with after
|
|
1015
|
+
* dump" detection — the chain itself can be intact, but if any
|
|
1016
|
+
* encrypted record bytes were swapped, this check catches it.
|
|
1017
|
+
*/
|
|
1018
|
+
declare class BackupCorruptedError extends NoydbError {
|
|
1019
|
+
/** The (collection, id) pair whose envelope failed the hash check. */
|
|
1020
|
+
readonly collection: string;
|
|
1021
|
+
readonly id: string;
|
|
1022
|
+
constructor(collection: string, id: string, message: string);
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Thrown by partition-extraction primitives when the
|
|
1026
|
+
* transitive-closure walk fails — e.g. the FK graph is deeper than
|
|
1027
|
+
* `maxDepth`, signalling a runaway or unexpectedly cyclic graph.
|
|
1028
|
+
*/
|
|
1029
|
+
declare class PartitionExtractionError extends NoydbError {
|
|
1030
|
+
constructor(message: string);
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Thrown by `adoptPartition` when the transfer seal can't be
|
|
1034
|
+
* opened — a wrong/short transfer key (AES-GCM auth-tag failure) or a
|
|
1035
|
+
* malformed sealed payload.
|
|
1036
|
+
*/
|
|
1037
|
+
declare class TransferSealError extends NoydbError {
|
|
1038
|
+
constructor(message: string);
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Thrown when an adoption-lifecycle precondition fails — re-adopting a
|
|
1042
|
+
* partition already consumed in this store, or owner-creation on a
|
|
1043
|
+
* vault that isn't in the adopted-unowned state.
|
|
1044
|
+
*/
|
|
1045
|
+
declare class AdoptionStateError extends NoydbError {
|
|
1046
|
+
constructor(message: string);
|
|
1047
|
+
}
|
|
1048
|
+
/** Document-attestation failures: undeclared field-schema, non-owner issue, missing field, signer failure. */
|
|
1049
|
+
declare class AttestationError extends NoydbError {
|
|
1050
|
+
constructor(message: string);
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Thrown by `resolveSession()` when the session token's `expiresAt`
|
|
1054
|
+
* timestamp is in the past. The session key is also removed from the
|
|
1055
|
+
* in-memory store when this is thrown, so retrying with the same sessionId
|
|
1056
|
+
* will produce `SessionNotFoundError`.
|
|
1057
|
+
*
|
|
1058
|
+
* Separate from `SessionNotFoundError` so callers can distinguish between
|
|
1059
|
+
* "session is gone" (key store cleared, tab reloaded) and "session is
|
|
1060
|
+
* still in the store but has exceeded its lifetime" (idle timeout, absolute
|
|
1061
|
+
* timeout, policy-driven expiry). The remediation differs: expired sessions
|
|
1062
|
+
* should prompt a fresh unlock; not-found sessions may indicate a bug or a
|
|
1063
|
+
* cross-tab scenario where the session was never established.
|
|
1064
|
+
*/
|
|
1065
|
+
declare class SessionExpiredError extends NoydbError {
|
|
1066
|
+
readonly sessionId: string;
|
|
1067
|
+
constructor(sessionId: string);
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Thrown by `resolveSession()` when the session key cannot be found in
|
|
1071
|
+
* the module-level store. This happens when:
|
|
1072
|
+
* - The session was explicitly revoked via `revokeSession()`.
|
|
1073
|
+
* - The JS context was reloaded (tab navigation, page refresh, worker restart).
|
|
1074
|
+
* - `Noydb.close()` was called (which calls `revokeAllSessions()`).
|
|
1075
|
+
* - The sessionId is wrong or was generated by a different JS context.
|
|
1076
|
+
*
|
|
1077
|
+
* The session token (if the caller holds it) is permanently useless after
|
|
1078
|
+
* this error — the key is gone and cannot be recovered.
|
|
1079
|
+
*/
|
|
1080
|
+
declare class SessionNotFoundError extends NoydbError {
|
|
1081
|
+
readonly sessionId: string;
|
|
1082
|
+
constructor(sessionId: string);
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Thrown when a session policy blocks an operation — for example,
|
|
1086
|
+
* `requireReAuthFor: ['export']` is set and the caller attempts to
|
|
1087
|
+
* call `exportStream()` without re-authenticating for this session.
|
|
1088
|
+
*
|
|
1089
|
+
* The `operation` field names the specific operation that was blocked
|
|
1090
|
+
* (e.g. `'export'`, `'grant'`, `'rotate'`) so the caller can surface
|
|
1091
|
+
* a targeted prompt ("Please re-enter your passphrase to export data").
|
|
1092
|
+
*/
|
|
1093
|
+
declare class SessionPolicyError extends NoydbError {
|
|
1094
|
+
readonly operation: string;
|
|
1095
|
+
constructor(operation: string, message?: string);
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Thrown when a `.join()` would exceed its configured row ceiling on
|
|
1099
|
+
* either side. The ceiling defaults to 50,000 per side and can be
|
|
1100
|
+
* overridden via the `{ maxRows }` option on `.join()`.
|
|
1101
|
+
*
|
|
1102
|
+
* Carries both row counts so the error message can show which side
|
|
1103
|
+
* tripped the limit (e.g. "left had 60,000 rows, right had 1,200,
|
|
1104
|
+
* max was 50,000"). The `side` field is machine-readable so test
|
|
1105
|
+
* code and devtools can match on it without regex-parsing the
|
|
1106
|
+
* message.
|
|
1107
|
+
*
|
|
1108
|
+
* The row ceiling exists because joins are bounded in-memory
|
|
1109
|
+
* operations over materialized record sets. Consumers whose
|
|
1110
|
+
* collections genuinely exceed the ceiling should track
|
|
1111
|
+
* (streaming joins over `scan()`) or filter the left side further
|
|
1112
|
+
* with `where()` / `limit()` before joining.
|
|
1113
|
+
*/
|
|
1114
|
+
declare class JoinTooLargeError extends NoydbError {
|
|
1115
|
+
readonly leftRows: number;
|
|
1116
|
+
readonly rightRows: number;
|
|
1117
|
+
readonly maxRows: number;
|
|
1118
|
+
readonly side: 'left' | 'right';
|
|
1119
|
+
constructor(opts: {
|
|
1120
|
+
leftRows: number;
|
|
1121
|
+
rightRows: number;
|
|
1122
|
+
maxRows: number;
|
|
1123
|
+
side: 'left' | 'right';
|
|
1124
|
+
message: string;
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Thrown by `.crossJoin()` when the cumulative cartesian product (or lateral
|
|
1129
|
+
* filtered count) exceeds the configured ceiling. Check before allocating.
|
|
1130
|
+
* Mirrors the pattern of `JoinTooLargeError` and the `.join()` row ceiling.
|
|
1131
|
+
*
|
|
1132
|
+
* @see CrossJoinClause.maxRows — per-clause override
|
|
1133
|
+
* @see DEFAULT_CROSS_JOIN_MAX_ROWS — package default (50_000)
|
|
1134
|
+
*/
|
|
1135
|
+
declare class CrossJoinTooLargeError extends NoydbError {
|
|
1136
|
+
readonly target: string;
|
|
1137
|
+
readonly expected: number;
|
|
1138
|
+
readonly limit: number;
|
|
1139
|
+
constructor(opts: {
|
|
1140
|
+
target: string;
|
|
1141
|
+
expected: number;
|
|
1142
|
+
limit: number;
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Thrown at cross-join execution time when the target collection is not
|
|
1147
|
+
* reachable from the current vault. The left collection is included in the
|
|
1148
|
+
* message for context.
|
|
1149
|
+
*/
|
|
1150
|
+
declare class CrossJoinSourceUnknownError extends NoydbError {
|
|
1151
|
+
readonly target: string;
|
|
1152
|
+
readonly leftCollection: string;
|
|
1153
|
+
constructor(target: string, leftCollection: string);
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Thrown by `.join()` in strict `ref()` mode when a left-side record
|
|
1157
|
+
* points at a right-side id that does not exist in the target
|
|
1158
|
+
* collection.
|
|
1159
|
+
*
|
|
1160
|
+
* Distinct from `RefIntegrityError` so test code can pattern-match
|
|
1161
|
+
* on the *read-time* dangling case without catching *write-time*
|
|
1162
|
+
* integrity violations. Both indicate "ref points at nothing" but
|
|
1163
|
+
* happen at different lifecycle phases and deserve different
|
|
1164
|
+
* remediation in documentation: a RefIntegrityError on `put()`
|
|
1165
|
+
* means the input is invalid; a DanglingReferenceError on `.join()`
|
|
1166
|
+
* means stored data has drifted and `vault.checkIntegrity()`
|
|
1167
|
+
* is the right tool to find the full set of orphans.
|
|
1168
|
+
*/
|
|
1169
|
+
declare class DanglingReferenceError extends NoydbError {
|
|
1170
|
+
readonly field: string;
|
|
1171
|
+
readonly target: string;
|
|
1172
|
+
readonly refId: string;
|
|
1173
|
+
constructor(opts: {
|
|
1174
|
+
field: string;
|
|
1175
|
+
target: string;
|
|
1176
|
+
refId: string;
|
|
1177
|
+
message: string;
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Thrown by {@link sanitizeFilename} when an input filename cannot be
|
|
1182
|
+
* made safe — NUL byte, empty after normalization, missing
|
|
1183
|
+
* `opaqueId` for the opaque profile, `..` segment, or a `maxBytes`
|
|
1184
|
+
* cap too small to hold a single code point.
|
|
1185
|
+
*/
|
|
1186
|
+
declare class FilenameSanitizationError extends NoydbError {
|
|
1187
|
+
constructor(message: string);
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Thrown when a write target resolves OUTSIDE the requested
|
|
1191
|
+
* directory after sanitization — the canonical Zip-Slip class. The
|
|
1192
|
+
* sanitizer's job is to strip path-traversal segments; this error
|
|
1193
|
+
* is the defense-in-depth fallback at the FS write site.
|
|
1194
|
+
*/
|
|
1195
|
+
declare class PathEscapeError extends NoydbError {
|
|
1196
|
+
readonly attempted: string;
|
|
1197
|
+
readonly targetDir: string;
|
|
1198
|
+
constructor(opts: {
|
|
1199
|
+
attempted: string;
|
|
1200
|
+
targetDir: string;
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Thrown at vault open if the derivation graph contains a cycle.
|
|
1205
|
+
* `path` is the offending chain (e.g. `['a', 'b', 'c', 'a']`).
|
|
1206
|
+
*/
|
|
1207
|
+
declare class DerivationCycleError extends NoydbError {
|
|
1208
|
+
readonly path: readonly string[];
|
|
1209
|
+
constructor(path: readonly string[]);
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Thrown when a cascade of source → output → source → … exceeds the
|
|
1213
|
+
* configured `maxDepth` (default 5).
|
|
1214
|
+
*/
|
|
1215
|
+
declare class DerivationDepthError extends NoydbError {
|
|
1216
|
+
readonly limit: number;
|
|
1217
|
+
readonly attempted: number;
|
|
1218
|
+
constructor(limit: number, attempted: number);
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Thrown at registration if a `withDerivation` strategy references an
|
|
1222
|
+
* output `collection` that isn't otherwise declared (no schema, no use
|
|
1223
|
+
* elsewhere). Surfacing this early catches typos in collection names.
|
|
1224
|
+
*/
|
|
1225
|
+
declare class DerivationOutputUnknownError extends NoydbError {
|
|
1226
|
+
readonly collection: string;
|
|
1227
|
+
constructor(collection: string);
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Thrown when the user's `derive` function returns a value that doesn't
|
|
1231
|
+
* match the declared output spec (e.g. wrong shape, wrong key set).
|
|
1232
|
+
*/
|
|
1233
|
+
declare class DerivationOutputShapeError extends NoydbError {
|
|
1234
|
+
readonly outputKey: string;
|
|
1235
|
+
constructor(outputKey: string, detail: string);
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Thrown by array-shape derivations when the `derive` function
|
|
1239
|
+
* returns more rows than the output's `maxFanout` cap. The cap exists
|
|
1240
|
+
* to keep dispatch cost bounded — without it a single source-row
|
|
1241
|
+
* update could fan out to thousands of derived rows, dominating the
|
|
1242
|
+
* write path.
|
|
1243
|
+
*
|
|
1244
|
+
* Defaults to `maxFanout: 64`. Raise on the output spec for
|
|
1245
|
+
* carry-forward expansion cases (e.g. monthly rows across multi-year
|
|
1246
|
+
* contracts).
|
|
1247
|
+
*/
|
|
1248
|
+
declare class DerivationCapExceededError extends NoydbError {
|
|
1249
|
+
readonly outputKey: string;
|
|
1250
|
+
readonly returned: number;
|
|
1251
|
+
readonly maxFanout: number;
|
|
1252
|
+
constructor(outputKey: string, returned: number, maxFanout: number);
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* Thrown at vault open if the materialized-view graph contains a
|
|
1256
|
+
* cycle. `path` is the offending chain (e.g. `['a-mv', 'b-mv', 'a-mv']`).
|
|
1257
|
+
* Detected by the same shared DFS that catches `DerivationCycleError`;
|
|
1258
|
+
* surfaces with a distinct error type so consumers can disambiguate.
|
|
1259
|
+
*/
|
|
1260
|
+
declare class MaterializedViewCycleError extends NoydbError {
|
|
1261
|
+
readonly path: readonly string[];
|
|
1262
|
+
constructor(path: readonly string[]);
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Thrown at MV registration if the query references a source
|
|
1266
|
+
* collection that isn't declared on the vault. Surfacing this early
|
|
1267
|
+
* catches typos in collection names.
|
|
1268
|
+
*/
|
|
1269
|
+
declare class MaterializedViewSourceUnknownError extends NoydbError {
|
|
1270
|
+
readonly mvName: string;
|
|
1271
|
+
readonly collection: string;
|
|
1272
|
+
constructor(mvName: string, collection: string);
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Thrown by the MV executor when a refresh produces more rows than
|
|
1276
|
+
* the configured ceiling. Default ceiling is 100k rows; override
|
|
1277
|
+
* per-MV via `maxRows`. Mirrors `JoinTooLargeError` /
|
|
1278
|
+
* `GroupCardinalityError` from the query DSL — the explosion is
|
|
1279
|
+
* detected BEFORE writes hit the store, so the source-write
|
|
1280
|
+
* transaction can roll back cleanly via strict-mode.
|
|
1281
|
+
*/
|
|
1282
|
+
declare class MaterializedViewTooLargeError extends NoydbError {
|
|
1283
|
+
readonly mvName: string;
|
|
1284
|
+
readonly expected: number;
|
|
1285
|
+
readonly limit: number;
|
|
1286
|
+
constructor(mvName: string, expected: number, limit: number);
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Thrown by `withMaterializedView()` at registration time when the
|
|
1290
|
+
* strategy is structurally malformed. Distinct from
|
|
1291
|
+
* `MaterializedViewSourceUnknownError` (the source list is well-formed
|
|
1292
|
+
* but names a collection the vault doesn't know) and
|
|
1293
|
+
* `MaterializedViewCycleError` (the source graph has a cycle): this
|
|
1294
|
+
* error fires before either check, at the moment the spec is being
|
|
1295
|
+
* normalized.
|
|
1296
|
+
*
|
|
1297
|
+
* Today the trigger cases are all about the `query` / `unionSources`
|
|
1298
|
+
* dichotomy:
|
|
1299
|
+
* - both `query` and `unionSources` were set (mutually exclusive),
|
|
1300
|
+
* - neither `query` nor `unionSources` was set,
|
|
1301
|
+
* - `unionSources` has fewer than 2 arms,
|
|
1302
|
+
* - two arms in `unionSources` reference the same `collection`.
|
|
1303
|
+
*
|
|
1304
|
+
* The error message is prefixed with `[noy-db] withMaterializedView:`
|
|
1305
|
+
* so it's grep-friendly in logs and looks consistent with the existing
|
|
1306
|
+
* `ValidationError` messages from the same factory.
|
|
1307
|
+
*/
|
|
1308
|
+
declare class MaterializedViewConfigError extends NoydbError {
|
|
1309
|
+
constructor(message: string);
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* Thrown at vault open when a `withOverlayedView` declaration uses
|
|
1313
|
+
* another virtual-overlay name as its `base`. Multi-overlay stacking
|
|
1314
|
+
* is a v2 non-goal — the shallow expansion in
|
|
1315
|
+
* `QueryDependencyAnalyzer` would truncate at the inner overlay
|
|
1316
|
+
* name, leaving downstream MVs silently stale.
|
|
1317
|
+
*/
|
|
1318
|
+
declare class OverlayBaseIsVirtualError extends NoydbError {
|
|
1319
|
+
readonly overlayName: string;
|
|
1320
|
+
readonly base: string;
|
|
1321
|
+
constructor(overlayName: string, base: string);
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Thrown at vault open when a `withOverlayedView`'s `overlay`
|
|
1325
|
+
* references an unknown collection or an MV-owned collection. The
|
|
1326
|
+
* overlay collection is user-writable; MV-owned collections aren't.
|
|
1327
|
+
*/
|
|
1328
|
+
declare class OverlayCollectionUnavailableError extends NoydbError {
|
|
1329
|
+
readonly overlayName: string;
|
|
1330
|
+
readonly overlay: string;
|
|
1331
|
+
constructor(overlayName: string, overlay: string);
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* Thrown at vault open when a `withOverlayedView`'s virtual `name`
|
|
1335
|
+
* collides with an MV output or a concrete source collection.
|
|
1336
|
+
*/
|
|
1337
|
+
declare class OverlayNameCollisionError extends NoydbError {
|
|
1338
|
+
readonly overlayName: string;
|
|
1339
|
+
constructor(overlayName: string);
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Thrown by the virtual overlay's `put(id, record)` when the
|
|
1343
|
+
* consumer-supplied `id` doesn't match `rowKey(record)`. Catches
|
|
1344
|
+
* fat-finger separator typos that would otherwise silently produce
|
|
1345
|
+
* orphaned overlay rows. Direct writes to the underlying overlay
|
|
1346
|
+
* collection (bypass the virtual layer) skip this validation.
|
|
1347
|
+
*/
|
|
1348
|
+
declare class OverlayIdMismatchError extends NoydbError {
|
|
1349
|
+
readonly actual: string;
|
|
1350
|
+
readonly expected: string;
|
|
1351
|
+
constructor(actual: string, expected: string);
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Thrown when a requested snapshot version does not exist in the
|
|
1355
|
+
* snapshot store — either it was never created, was pruned by the
|
|
1356
|
+
* retention policy, or was deleted manually.
|
|
1357
|
+
*
|
|
1358
|
+
* The `version` field carries the key that was looked up so callers
|
|
1359
|
+
* can surface an actionable "snapshot X not found" message without
|
|
1360
|
+
* parsing the error string.
|
|
1361
|
+
*/
|
|
1362
|
+
declare class SnapshotNotFoundError extends NoydbError {
|
|
1363
|
+
readonly version: string;
|
|
1364
|
+
constructor(version: string);
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Thrown when a write targets a partition key that has no shard and
|
|
1368
|
+
* `sharding.autoCreate` is disabled.
|
|
1369
|
+
*/
|
|
1370
|
+
declare class UnknownShardError extends NoydbError {
|
|
1371
|
+
readonly partitionKey: string;
|
|
1372
|
+
constructor(partitionKey: string, groupName: string);
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Thrown by `createShard` when the registry has a row for a partition
|
|
1376
|
+
* but the corresponding vault is not provisioned in the store —
|
|
1377
|
+
* a registry/store divergence. Refusing to recreate avoids masking
|
|
1378
|
+
* data loss.
|
|
1379
|
+
*/
|
|
1380
|
+
declare class ShardProvisioningError extends NoydbError {
|
|
1381
|
+
readonly vaultId: string;
|
|
1382
|
+
constructor(vaultId: string, partitionKey: string);
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Thrown by `VaultGroup.createShard` when `sharding.regionOf` resolves a
|
|
1386
|
+
* required region that doesn't match the placement backend's
|
|
1387
|
+
* `capabilities.region` — the shard would land on a non-compliant backend
|
|
1388
|
+
* (data-residency violation, #271). Raised BEFORE provisioning, so no
|
|
1389
|
+
* vault is created.
|
|
1390
|
+
*/
|
|
1391
|
+
declare class DataResidencyError extends NoydbError {
|
|
1392
|
+
readonly vaultId: string;
|
|
1393
|
+
readonly requiredRegion: string;
|
|
1394
|
+
readonly backendRegion: string | undefined;
|
|
1395
|
+
constructor(vaultId: string, requiredRegion: string, backendRegion: string | undefined);
|
|
1396
|
+
}
|
|
1397
|
+
/** Thrown when a VaultGroup references a template name that was never registered. */
|
|
1398
|
+
declare class VaultTemplateNotFoundError extends NoydbError {
|
|
1399
|
+
readonly templateName: string;
|
|
1400
|
+
constructor(templateName: string);
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Thrown when `vault.forget(subjectId)` is called on a vault whose
|
|
1404
|
+
* `createNoydb({ forgetStrategy })` declared no subject fields (the
|
|
1405
|
+
* default `NO_FORGET`). GDPR crypto-shred needs a declared subject →
|
|
1406
|
+
* record index to know which records belong to a data subject; without
|
|
1407
|
+
* one there is nothing to erase and a silent no-op would be a dangerous
|
|
1408
|
+
* false "erased" signal. Configure with
|
|
1409
|
+
* `forgetStrategy: withForgetCascade({ subjects: { invoices: 'buyerId' } })`.
|
|
1410
|
+
*/
|
|
1411
|
+
declare class ForgetStrategyNotConfiguredError extends NoydbError {
|
|
1412
|
+
constructor(message?: string);
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Thrown by `openSealedRecord()` when the sealed CEK's binding has passed its
|
|
1416
|
+
* `expiresAt`. Surfaced on two checks: a cheap fast-path check on the delivery
|
|
1417
|
+
* envelope's clear-text `expiresAt`, and the AUTHORITATIVE check on the
|
|
1418
|
+
* `expiresAt` inside the sealed binding (the latter cannot be forged by editing
|
|
1419
|
+
* the delivery envelope). Distinct from {@link KeyringExpiredError} (bundle-slot
|
|
1420
|
+
* expiry) so a host can tell "this single-record grant lapsed" from a keyring-
|
|
1421
|
+
* level expiry.
|
|
1422
|
+
*/
|
|
1423
|
+
declare class SealedRecordExpiredError extends NoydbError {
|
|
1424
|
+
readonly expiresAt: string;
|
|
1425
|
+
constructor(expiresAt: string);
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Thrown by `openSealedRecord()` when the sealed binding's
|
|
1429
|
+
* `{collection, id}` does not match the record envelope the host is trying to
|
|
1430
|
+
* decrypt. This is the host-denial boundary: a CEK sealed for record A cannot
|
|
1431
|
+
* be replayed against record B's envelope. (A CEK sealed for a PRE-rotation
|
|
1432
|
+
* version of a record, applied to the POST-rotation live envelope, is a
|
|
1433
|
+
* different failure — the binding still matches `{collection, id}` so it gets
|
|
1434
|
+
* past this check, and the AES-GCM auth-tag failure surfaces as
|
|
1435
|
+
* {@link TamperedError} instead.)
|
|
1436
|
+
*/
|
|
1437
|
+
declare class SealedRecordMismatchError extends NoydbError {
|
|
1438
|
+
readonly expected: {
|
|
1439
|
+
collection: string;
|
|
1440
|
+
id: string;
|
|
1441
|
+
};
|
|
1442
|
+
readonly actual: {
|
|
1443
|
+
collection: string;
|
|
1444
|
+
id: string;
|
|
1445
|
+
};
|
|
1446
|
+
constructor(expected: {
|
|
1447
|
+
collection: string;
|
|
1448
|
+
id: string;
|
|
1449
|
+
}, actual: {
|
|
1450
|
+
collection: string;
|
|
1451
|
+
id: string;
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Thrown by `vault.sealRecordToHost()` / `vault.rotateRecordCek()` when the
|
|
1456
|
+
* target record has no live envelope, or its live envelope carries no `_cek`
|
|
1457
|
+
* (a legacy / non-`perRecordKeys` collection has nothing record-scoped to
|
|
1458
|
+
* seal — its body is keyed off the shared collection DEK, which sealing
|
|
1459
|
+
* deliberately never exposes).
|
|
1460
|
+
*/
|
|
1461
|
+
declare class RecordCekNotFoundError extends NoydbError {
|
|
1462
|
+
readonly collection: string;
|
|
1463
|
+
readonly id: string;
|
|
1464
|
+
constructor(collection: string, id: string);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
export { DirectoryDisabledError as $, AmendmentForbiddenError as A, BackupCorruptedError as B, MaterializedViewCycleError as C, DictKeyInUseError as D, MaterializedViewSourceUnknownError as E, FieldFrozenError as F, MaterializedViewTooLargeError as G, AlreadyElevatedError as H, IllegalTransitionError as I, ConflictError as J, CrossJoinSourceUnknownError as K, LocaleNotSpecifiedError as L, MissingTranslationError as M, NoydbError as N, OverlayBaseIsVirtualError as O, PartitionExtractionError as P, CrossJoinTooLargeError as Q, ReservedCollectionNameError as R, ScriptViolationError as S, TranslatorNotConfiguredError as T, UnknownDictCodeError as U, DanglingReferenceError as V, DataResidencyError as W, DebugPlaintextError as X, DebugReservedFieldError as Y, DecryptionError as Z, DelegationTargetMissingError as _, DictKeyMissingError as a, ElevationExpiredError as a0, ExportCapabilityError as a1, FilenameSanitizationError as a2, ForgetStrategyNotConfiguredError as a3, GroupCardinalityError as a4, ImportCapabilityError as a5, IndexRequiredError as a6, IndexWriteFailureError as a7, InvalidKeyError as a8, JoinTooLargeError as a9, StoreCapabilityError as aA, TamperedError as aB, TierDemoteDeniedError as aC, TierNotGrantedError as aD, UniqueConstraintError as aE, UnknownShardError as aF, UnsupportedIndexOptionError as aG, ValidationError as aH, VaultTemplateNotFoundError as aI, KeyringCorruptError as aa, KeyringExpiredError as ab, LedgerContentionError as ac, MigrationRequiredError as ad, NetworkError as ae, NoAccessError as af, NonAdditiveSchemaChangeError as ag, NotFoundError as ah, NumberingUncertaintyError as ai, PathEscapeError as aj, PeriodClosedError as ak, PermissionDeniedError as al, PrivilegeEscalationError as am, QuiesceTimeoutError as an, ReadOnlyAtInstantError as ao, ReadOnlyError as ap, ReadOnlyFrameError as aq, RecordCekNotFoundError as ar, ReservedVaultNameError as as, SchemaFenceError as at, SchemaLockedError as au, SchemaUpdateError as av, SchemaValidationError as aw, SequenceContentionError as ax, SequenceOfflineError as ay, ShardProvisioningError as az, StaticDictReadonlyError as b, SessionExpiredError as c, SessionNotFoundError as d, SessionPolicyError as e, InvariantError as f, RecordLockedError as g, SnapshotNotFoundError as h, DerivationCapExceededError as i, DerivationCycleError as j, DerivationDepthError as k, DerivationOutputShapeError as l, DerivationOutputUnknownError as m, OverlayCollectionUnavailableError as n, OverlayIdMismatchError as o, OverlayNameCollisionError as p, SealedRecordExpiredError as q, SealedRecordMismatchError as r, AttestationError as s, AdoptionStateError as t, BackupLedgerError as u, BundleIntegrityError as v, BundleSealMismatchError as w, BundleVersionConflictError as x, TransferSealError as y, MaterializedViewConfigError as z };
|