@noy-db/hub 0.2.0-pre.3 → 0.2.0-pre.31
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/adapter/index.d.ts +9 -0
- package/dist/adapter/index.js +14 -0
- package/dist/aggregate/index.d.ts +3 -2
- package/dist/aggregate/index.js +10 -8
- package/dist/aggregate/index.js.map +1 -1
- package/dist/attestation/index.d.ts +7 -5
- package/dist/attestation/index.js +7 -6
- package/dist/attestation/index.js.map +1 -1
- package/dist/blobs/index.d.ts +9 -7
- package/dist/blobs/index.js +12 -6
- package/dist/blobs/index.js.map +1 -1
- package/dist/bundle/index.d.ts +29 -18
- package/dist/bundle/index.js +53 -192
- package/dist/bundle/index.js.map +1 -1
- package/dist/{chunk-75QDHSE4.js → chunk-2QDWRK3B.js} +5 -5
- package/dist/{chunk-74JEQFMT.js → chunk-2UT7HJJR.js} +5 -5
- package/dist/chunk-2UT7HJJR.js.map +1 -0
- package/dist/{chunk-FCDO7UAO.js → chunk-2ZYIN3BL.js} +2 -2
- package/dist/{chunk-BFI3RS42.js → chunk-33EQCZXE.js} +2 -2
- package/dist/chunk-33EQCZXE.js.map +1 -0
- package/dist/{chunk-WRLHNG6H.js → chunk-4K4QKYK4.js} +4 -4
- package/dist/chunk-4K4QKYK4.js.map +1 -0
- package/dist/{chunk-HGZ7DC5H.js → chunk-4L6N56B4.js} +2 -2
- package/dist/chunk-4L6N56B4.js.map +1 -0
- package/dist/{chunk-YMYK7US4.js → chunk-4YD7VZH4.js} +2 -2
- package/dist/chunk-4YD7VZH4.js.map +1 -0
- package/dist/{chunk-ZUMGGHRB.js → chunk-5PTX7PKD.js} +4 -4
- package/dist/{chunk-QAU5HM6Q.js → chunk-6EKRQ7QF.js} +3 -3
- package/dist/{chunk-ZC2AAE6J.js → chunk-7GPQPLGO.js} +19 -4
- package/dist/chunk-7GPQPLGO.js.map +1 -0
- package/dist/{chunk-EPK6A3WJ.js → chunk-A3JMGXPG.js} +2 -2
- package/dist/chunk-A3JMGXPG.js.map +1 -0
- package/dist/{chunk-FXQYZNOW.js → chunk-A7DNZVAV.js} +1 -1
- package/dist/chunk-A7DNZVAV.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-YL2DR3HY.js → chunk-ASIGWYRA.js} +2 -2
- package/dist/chunk-ASIGWYRA.js.map +1 -0
- package/dist/{chunk-2EYC3WDT.js → chunk-AWU4JF7C.js} +93 -93
- package/dist/chunk-AWU4JF7C.js.map +1 -0
- package/dist/chunk-BEZ2EV43.js +129 -0
- package/dist/chunk-BEZ2EV43.js.map +1 -0
- package/dist/{chunk-IS5HWQO7.js → chunk-CIZDUAHI.js} +30 -4
- package/dist/chunk-CIZDUAHI.js.map +1 -0
- package/dist/{chunk-4OQWR46B.js → chunk-CUPTCF4R.js} +5 -5
- package/dist/chunk-CUPTCF4R.js.map +1 -0
- package/dist/{chunk-5ZGZ6HIZ.js → chunk-DEE4CRYN.js} +30 -7
- package/dist/chunk-DEE4CRYN.js.map +1 -0
- package/dist/{chunk-UOF74WQY.js → chunk-E2MDPPOC.js} +37 -2
- package/dist/chunk-E2MDPPOC.js.map +1 -0
- package/dist/{chunk-SAVQ6E2O.js → chunk-FFKQ65YX.js} +10 -3
- package/dist/chunk-FFKQ65YX.js.map +1 -0
- package/dist/{chunk-2XLVPKXG.js → chunk-G7ALNCQH.js} +10 -2
- package/dist/chunk-G7ALNCQH.js.map +1 -0
- package/dist/chunk-GGXN73NM.js +252 -0
- package/dist/chunk-GGXN73NM.js.map +1 -0
- package/dist/{chunk-UVPGJXVO.js → chunk-JOJPBZSZ.js} +5 -5
- package/dist/{chunk-YDLAFP36.js → chunk-JZ5DS4DP.js} +346 -3
- package/dist/chunk-JZ5DS4DP.js.map +1 -0
- package/dist/{chunk-KMI2NBBF.js → chunk-K4JID2ZE.js} +44 -8
- package/dist/chunk-K4JID2ZE.js.map +1 -0
- package/dist/{aggregate/index.cjs → chunk-K6NVSHAH.js} +241 -210
- package/dist/chunk-K6NVSHAH.js.map +1 -0
- package/dist/chunk-KJ3K5VZM.js +524 -0
- package/dist/chunk-KJ3K5VZM.js.map +1 -0
- package/dist/chunk-L5HHBOMS.js +232 -0
- package/dist/chunk-L5HHBOMS.js.map +1 -0
- package/dist/{chunk-YK72A4IT.js → chunk-LBILABKZ.js} +4 -4
- package/dist/chunk-LXKBG52H.js +151 -0
- package/dist/chunk-LXKBG52H.js.map +1 -0
- package/dist/{chunk-NGSPBLLE.js → chunk-MPIZQGFA.js} +50 -20
- package/dist/chunk-MPIZQGFA.js.map +1 -0
- package/dist/{chunk-4X2S7PBF.js → chunk-MRJPSXPE.js} +84 -70
- package/dist/chunk-MRJPSXPE.js.map +1 -0
- package/dist/{chunk-6S3LLAQ5.js → chunk-MSMDDDDJ.js} +3 -3
- package/dist/{chunk-6S3LLAQ5.js.map → chunk-MSMDDDDJ.js.map} +1 -1
- package/dist/{chunk-GAUBWHAF.js → chunk-OCYFFBZS.js} +4 -4
- package/dist/{chunk-NCO2JGKK.js → chunk-PDVP3C2I.js} +1 -1
- package/dist/chunk-PDVP3C2I.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/{chunk-P6256WTJ.js → chunk-QBLPY44S.js} +3 -3
- package/dist/chunk-QBLPY44S.js.map +1 -0
- package/dist/{query/index.cjs → chunk-QGBBQKDS.js} +706 -831
- package/dist/chunk-QGBBQKDS.js.map +1 -0
- package/dist/{chunk-FS7A4XNF.js → chunk-QWJCNXH2.js} +3 -3
- package/dist/chunk-QXWJQ7UU.js +380 -0
- package/dist/chunk-QXWJQ7UU.js.map +1 -0
- package/dist/{chunk-GDTCGIPX.js → chunk-RCB6GWTC.js} +27 -5
- package/dist/chunk-RCB6GWTC.js.map +1 -0
- package/dist/{chunk-K5PVGKE4.js → chunk-SAAJYSVV.js} +2 -2
- package/dist/{chunk-G7PAZ3TD.js → chunk-SHJ3BRTZ.js} +46 -10
- package/dist/chunk-SHJ3BRTZ.js.map +1 -0
- package/dist/chunk-SQXTKZL7.js +125 -0
- package/dist/chunk-SQXTKZL7.js.map +1 -0
- package/dist/chunk-STNPB3UM.js +9 -0
- package/dist/chunk-STNPB3UM.js.map +1 -0
- package/dist/{chunk-NSLTPGEN.js → chunk-TMUMMAWV.js} +12 -2
- package/dist/{chunk-NSLTPGEN.js.map → chunk-TMUMMAWV.js.map} +1 -1
- package/dist/{chunk-LS3JLEIB.js → chunk-TZGWI5AX.js} +4 -4
- package/dist/{chunk-GD3BGKAR.js → chunk-UBF5JEOJ.js} +44 -5
- package/dist/chunk-UBF5JEOJ.js.map +1 -0
- package/dist/{chunk-T6HQMVML.js → chunk-W5NVNJDX.js} +5250 -801
- package/dist/chunk-W5NVNJDX.js.map +1 -0
- package/dist/chunk-XAYDHD2O.js +123 -0
- package/dist/chunk-XAYDHD2O.js.map +1 -0
- package/dist/{chunk-LOL725S4.js → chunk-XYW2CSCI.js} +31 -3
- package/dist/chunk-XYW2CSCI.js.map +1 -0
- package/dist/{chunk-TLFUDXVV.js → chunk-ZCMOS4H2.js} +31 -10
- package/dist/chunk-ZCMOS4H2.js.map +1 -0
- package/dist/{chunk-FBMXWVGP.js → chunk-ZK66B5EY.js} +450 -30
- package/dist/chunk-ZK66B5EY.js.map +1 -0
- package/dist/{chunk-GVXBHCZ2.js → chunk-ZPJSQPQH.js} +66 -7
- package/dist/chunk-ZPJSQPQH.js.map +1 -0
- package/dist/consent/index.d.ts +8 -6
- package/dist/consent/index.js +4 -3
- package/dist/consent/index.js.map +1 -1
- package/dist/crdt/index.js +1 -0
- package/dist/crdt/index.js.map +1 -1
- package/dist/{crypto-H2Y3DDFW.js → crypto-OSIV2IIW.js} +8 -3
- package/dist/{ulid-CiM2OAeM.d.ts → decrypt-partition-CXS5KopB.d.ts} +37 -82
- package/dist/{delegation-QSC7G5QC.js → delegation-BQTRJATI.js} +6 -5
- package/dist/derivations/index.d.ts +11 -9
- package/dist/derivations/index.js +9 -6
- package/dist/{dev-unlock-Cf2B7Kih.d.ts → dev-unlock-CnHTTVea.d.ts} +1 -1
- package/dist/discriminant-BN9REW3o.d.ts +60 -0
- package/dist/errors-BAWO5Z5a.d.ts +1500 -0
- package/dist/executor-KYSKFJ2R.js +9 -0
- package/dist/executor-M7W3NEKR.js +9 -0
- package/dist/executor-VDTDGWO6.js +13 -0
- package/dist/{fanout-sidecar-NRBWSLRK.js → fanout-sidecar-AZALISHB.js} +3 -2
- package/dist/fanout-sidecar-AZALISHB.js.map +1 -0
- package/dist/forget/index.d.ts +1 -0
- package/dist/forget/index.js +15 -0
- package/dist/guards/index.d.ts +16 -8
- package/dist/guards/index.js +12 -5
- package/dist/{hash-gVn_uKhp.d.ts → hash-oc5paYl0.d.ts} +1 -1
- package/dist/history/index.d.ts +9 -7
- package/dist/history/index.js +10 -7
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.d.ts +8 -6
- package/dist/i18n/index.js +116 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index-BMmajblo.d.ts +362 -0
- package/dist/index-BmhGztUi.d.ts +93 -0
- package/dist/{types-D9eB0Rvh.d.ts → index-DHn9lEP0.d.ts} +4305 -1523
- package/dist/{index-BF1B2HB9.d.ts → index-Ddm8D3Oo.d.ts} +186 -1151
- package/dist/index.d.ts +342 -70
- package/dist/index.js +420 -112
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +5 -4
- package/dist/indexing/index.js.map +1 -1
- package/dist/issue-DPHRF2TI.js +13 -0
- package/dist/kernel/index.d.ts +11 -0
- package/dist/kernel/index.js +50 -0
- package/dist/{lazy-builder-Rpd-V3jP.d.ts → lazy-builder-ChSqcF5t.d.ts} +2 -2
- package/dist/{ledger-WOEJUYTP.js → ledger-CI7GSMLB.js} +7 -6
- package/dist/materialized-views/index.d.ts +23 -20
- package/dist/materialized-views/index.js +9 -7
- package/dist/mime-magic-JeLKHRng.d.ts +103 -0
- package/dist/noydb-NAU2DTFP.js +40 -0
- package/dist/overlay-views/index.d.ts +32 -12
- package/dist/overlay-views/index.js +7 -6
- package/dist/periods/index.d.ts +8 -6
- package/dist/periods/index.js +7 -6
- package/dist/{predicate-Dnu81tsS.d.cts → predicate-BmhBSPCH.d.ts} +87 -5
- package/dist/{public-envelope-OHQ5UZFM.js → public-envelope-MFMBFJLZ.js} +5 -4
- package/dist/query/index.d.ts +4 -3
- package/dist/query/index.js +14 -6
- package/dist/read-only-facade-3OQRZ3VS.js +8 -0
- package/dist/registry-IX5WKK4F.js +8 -0
- package/dist/registry-LMHO5265.js +11 -0
- package/dist/registry-TXCKWH26.js +9 -0
- package/dist/registry-VFEDQSYV.js +9 -0
- package/dist/revoke-5PUOZPJJ.js +18 -0
- package/dist/revoke-5PUOZPJJ.js.map +1 -0
- package/dist/sealed-record/index.d.ts +123 -0
- package/dist/sealed-record/index.js +43 -0
- package/dist/sealed-record/index.js.map +1 -0
- package/dist/session/index.d.ts +9 -7
- package/dist/session/index.js +4 -3
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.d.ts +8 -6
- package/dist/shadow/index.js +3 -2
- package/dist/shadow/index.js.map +1 -1
- package/dist/{signer-M4K5HBLD.js → signer-UB5TQOZ6.js} +6 -5
- package/dist/signer-UB5TQOZ6.js.map +1 -0
- package/dist/snapshots/index.d.ts +30 -0
- package/dist/snapshots/index.js +153 -0
- package/dist/snapshots/index.js.map +1 -0
- package/dist/{stale-PAGCS4K5.js → stale-J3TUF5C5.js} +3 -2
- package/dist/stale-J3TUF5C5.js.map +1 -0
- package/dist/store/index.d.ts +15 -6
- package/dist/store/index.js +3 -2
- package/dist/{strategy-DSTrsZ8t.d.ts → strategy-8QGs5KQE.d.ts} +475 -7
- package/dist/sync/index.d.ts +7 -5
- package/dist/sync/index.js +5 -4
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.d.ts +8 -6
- package/dist/team/index.js +9 -8
- package/dist/transition-guard-Dy3NioQr.d.ts +165 -0
- package/dist/tx/index.d.ts +26 -8
- package/dist/tx/index.js +10 -5
- package/dist/tx/index.js.map +1 -1
- package/dist/ulid-DRH25k3y.d.ts +66 -0
- package/dist/{ulid-COREQ2RQ.js → ulid-KEPZMD2N.js} +2 -1
- package/dist/ulid-KEPZMD2N.js.map +1 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +6 -1
- package/dist/util/index.js.map +1 -1
- package/dist/{with-materialized-view-qtoJ3xKJ.d.ts → with-materialized-view-DIVeez0W.d.ts} +2 -2
- package/dist/{with-overlayed-view-DFaRfgMr.d.ts → with-overlayed-view-DVZrc5Hb.d.ts} +2 -2
- package/dist/with-rollup-CbU-O4wP.d.ts +47 -0
- package/dist/zod-HAJM7LMS.js +14763 -0
- package/dist/zod-HAJM7LMS.js.map +1 -0
- package/package.json +73 -191
- package/dist/aggregate/index.cjs.map +0 -1
- package/dist/aggregate/index.d.cts +0 -38
- package/dist/attestation/index.cjs +0 -305
- package/dist/attestation/index.cjs.map +0 -1
- package/dist/attestation/index.d.cts +0 -52
- package/dist/blobs/index.cjs +0 -1480
- package/dist/blobs/index.cjs.map +0 -1
- package/dist/blobs/index.d.cts +0 -46
- package/dist/bundle/index.cjs +0 -18561
- package/dist/bundle/index.cjs.map +0 -1
- package/dist/bundle/index.d.cts +0 -176
- package/dist/chunk-2EYC3WDT.js.map +0 -1
- package/dist/chunk-2XLVPKXG.js.map +0 -1
- package/dist/chunk-4OQWR46B.js.map +0 -1
- package/dist/chunk-4UBOTYP5.js +0 -1367
- package/dist/chunk-4UBOTYP5.js.map +0 -1
- package/dist/chunk-4X2S7PBF.js.map +0 -1
- package/dist/chunk-5YHWBPOT.js +0 -19
- package/dist/chunk-5YHWBPOT.js.map +0 -1
- package/dist/chunk-5ZGZ6HIZ.js.map +0 -1
- package/dist/chunk-74JEQFMT.js.map +0 -1
- package/dist/chunk-A6SWRXUQ.js +0 -118
- package/dist/chunk-A6SWRXUQ.js.map +0 -1
- package/dist/chunk-BFI3RS42.js.map +0 -1
- package/dist/chunk-EMEX37ZN.js +0 -51
- package/dist/chunk-EMEX37ZN.js.map +0 -1
- package/dist/chunk-EPK6A3WJ.js.map +0 -1
- package/dist/chunk-FBMXWVGP.js.map +0 -1
- package/dist/chunk-FXQYZNOW.js.map +0 -1
- package/dist/chunk-G7PAZ3TD.js.map +0 -1
- package/dist/chunk-GD3BGKAR.js.map +0 -1
- package/dist/chunk-GDTCGIPX.js.map +0 -1
- package/dist/chunk-GVXBHCZ2.js.map +0 -1
- package/dist/chunk-HGZ7DC5H.js.map +0 -1
- package/dist/chunk-IS5HWQO7.js.map +0 -1
- package/dist/chunk-KMI2NBBF.js.map +0 -1
- package/dist/chunk-KYKMKLJ6.js +0 -340
- package/dist/chunk-KYKMKLJ6.js.map +0 -1
- package/dist/chunk-LOL725S4.js.map +0 -1
- package/dist/chunk-MRIBLZL3.js +0 -86
- package/dist/chunk-MRIBLZL3.js.map +0 -1
- package/dist/chunk-NCO2JGKK.js.map +0 -1
- package/dist/chunk-NGSPBLLE.js.map +0 -1
- package/dist/chunk-P6256WTJ.js.map +0 -1
- package/dist/chunk-SAVQ6E2O.js.map +0 -1
- package/dist/chunk-T6HQMVML.js.map +0 -1
- package/dist/chunk-TLFUDXVV.js.map +0 -1
- package/dist/chunk-UMLVJTYV.js.map +0 -1
- package/dist/chunk-UOF74WQY.js.map +0 -1
- package/dist/chunk-WRLHNG6H.js.map +0 -1
- package/dist/chunk-YDLAFP36.js.map +0 -1
- package/dist/chunk-YL2DR3HY.js.map +0 -1
- package/dist/chunk-YMYK7US4.js.map +0 -1
- package/dist/chunk-ZC2AAE6J.js.map +0 -1
- package/dist/consent/index.cjs +0 -204
- package/dist/consent/index.cjs.map +0 -1
- package/dist/consent/index.d.cts +0 -25
- package/dist/crdt/index.cjs +0 -152
- package/dist/crdt/index.cjs.map +0 -1
- package/dist/crdt/index.d.cts +0 -30
- package/dist/derivations/index.cjs +0 -351
- package/dist/derivations/index.cjs.map +0 -1
- package/dist/derivations/index.d.cts +0 -72
- package/dist/dev-unlock-De3mjQWv.d.cts +0 -263
- package/dist/executor-BZKFZVRC.js +0 -8
- package/dist/executor-GFZFDQXV.js +0 -8
- package/dist/executor-KT2IOZVP.js +0 -11
- package/dist/fanout-sidecar-NRBWSLRK.js.map +0 -1
- package/dist/guards/index.cjs +0 -322
- package/dist/guards/index.cjs.map +0 -1
- package/dist/guards/index.d.cts +0 -31
- package/dist/hash-vBCB0-Ps.d.cts +0 -63
- package/dist/history/index.cjs +0 -1222
- package/dist/history/index.cjs.map +0 -1
- package/dist/history/index.d.cts +0 -63
- package/dist/i18n/index.cjs +0 -840
- package/dist/i18n/index.cjs.map +0 -1
- package/dist/i18n/index.d.cts +0 -39
- package/dist/index-DVkvrgpm.d.cts +0 -2290
- package/dist/index.cjs +0 -23590
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -778
- package/dist/indexing/index.cjs +0 -738
- package/dist/indexing/index.cjs.map +0 -1
- package/dist/indexing/index.d.cts +0 -36
- package/dist/issue-BAJ7ZB4S.js +0 -12
- package/dist/lazy-builder-C-rPfWG0.d.cts +0 -304
- package/dist/materialized-views/index.cjs +0 -837
- package/dist/materialized-views/index.cjs.map +0 -1
- package/dist/materialized-views/index.d.cts +0 -184
- package/dist/mime-magic-CBBSOkjm.d.cts +0 -50
- package/dist/mime-magic-CBBSOkjm.d.ts +0 -50
- package/dist/noydb-XNQSKXGO.js +0 -34
- package/dist/overlay-views/index.cjs +0 -359
- package/dist/overlay-views/index.cjs.map +0 -1
- package/dist/overlay-views/index.d.cts +0 -82
- package/dist/periods/index.cjs +0 -1041
- package/dist/periods/index.cjs.map +0 -1
- package/dist/periods/index.d.cts +0 -22
- package/dist/predicate-Dnu81tsS.d.ts +0 -185
- package/dist/query/index.cjs.map +0 -1
- package/dist/query/index.d.cts +0 -3
- package/dist/read-only-facade-ITU6L7BL.js +0 -7
- package/dist/registry-2IEARCGT.js +0 -7
- package/dist/registry-CDHASH73.js +0 -10
- package/dist/registry-EMGLZGR6.js +0 -8
- package/dist/registry-NQALYR77.js +0 -8
- package/dist/revoke-7JOVLZFD.js +0 -17
- package/dist/session/index.cjs +0 -495
- package/dist/session/index.cjs.map +0 -1
- package/dist/session/index.d.cts +0 -46
- package/dist/shadow/index.cjs +0 -133
- package/dist/shadow/index.cjs.map +0 -1
- package/dist/shadow/index.d.cts +0 -17
- package/dist/store/index.cjs +0 -1083
- package/dist/store/index.cjs.map +0 -1
- package/dist/store/index.d.cts +0 -492
- package/dist/strategy-BSxFXGzb.d.cts +0 -110
- package/dist/strategy-DSTrsZ8t.d.cts +0 -601
- package/dist/sync/index.cjs +0 -1062
- package/dist/sync/index.cjs.map +0 -1
- package/dist/sync/index.d.cts +0 -43
- package/dist/team/index.cjs +0 -2798
- package/dist/team/index.cjs.map +0 -1
- package/dist/team/index.d.cts +0 -118
- package/dist/tx/index.cjs +0 -544
- package/dist/tx/index.cjs.map +0 -1
- package/dist/tx/index.d.cts +0 -21
- package/dist/types-CSLcfytP.d.cts +0 -12493
- package/dist/ulid-CG2YvAbg.d.cts +0 -603
- package/dist/util/index.cjs +0 -230
- package/dist/util/index.cjs.map +0 -1
- package/dist/util/index.d.cts +0 -77
- package/dist/with-derivation-Bzpj6UTv.d.ts +0 -13
- package/dist/with-derivation-DWajFh4K.d.cts +0 -13
- package/dist/with-guard-DF_Ul3DT.d.cts +0 -18
- package/dist/with-guard-DR7U-l4v.d.ts +0 -18
- package/dist/with-materialized-view-_piodoIz.d.cts +0 -27
- package/dist/with-overlayed-view-DwzCKxn2.d.cts +0 -13
- /package/dist/{crypto-H2Y3DDFW.js.map → adapter/index.js.map} +0 -0
- /package/dist/{chunk-75QDHSE4.js.map → chunk-2QDWRK3B.js.map} +0 -0
- /package/dist/{chunk-FCDO7UAO.js.map → chunk-2ZYIN3BL.js.map} +0 -0
- /package/dist/{chunk-ZUMGGHRB.js.map → chunk-5PTX7PKD.js.map} +0 -0
- /package/dist/{chunk-QAU5HM6Q.js.map → chunk-6EKRQ7QF.js.map} +0 -0
- /package/dist/{chunk-UVPGJXVO.js.map → chunk-JOJPBZSZ.js.map} +0 -0
- /package/dist/{chunk-YK72A4IT.js.map → chunk-LBILABKZ.js.map} +0 -0
- /package/dist/{chunk-GAUBWHAF.js.map → chunk-OCYFFBZS.js.map} +0 -0
- /package/dist/{delegation-QSC7G5QC.js.map → chunk-PZ5AY32C.js.map} +0 -0
- /package/dist/{chunk-FS7A4XNF.js.map → chunk-QWJCNXH2.js.map} +0 -0
- /package/dist/{chunk-K5PVGKE4.js.map → chunk-SAAJYSVV.js.map} +0 -0
- /package/dist/{chunk-LS3JLEIB.js.map → chunk-TZGWI5AX.js.map} +0 -0
- /package/dist/{executor-BZKFZVRC.js.map → crypto-OSIV2IIW.js.map} +0 -0
- /package/dist/{executor-GFZFDQXV.js.map → delegation-BQTRJATI.js.map} +0 -0
- /package/dist/{executor-KT2IOZVP.js.map → executor-KYSKFJ2R.js.map} +0 -0
- /package/dist/{issue-BAJ7ZB4S.js.map → executor-M7W3NEKR.js.map} +0 -0
- /package/dist/{ledger-WOEJUYTP.js.map → executor-VDTDGWO6.js.map} +0 -0
- /package/dist/{noydb-XNQSKXGO.js.map → forget/index.js.map} +0 -0
- /package/dist/{public-envelope-OHQ5UZFM.js.map → issue-DPHRF2TI.js.map} +0 -0
- /package/dist/{read-only-facade-ITU6L7BL.js.map → kernel/index.js.map} +0 -0
- /package/dist/{registry-2IEARCGT.js.map → ledger-CI7GSMLB.js.map} +0 -0
- /package/dist/{registry-CDHASH73.js.map → noydb-NAU2DTFP.js.map} +0 -0
- /package/dist/{registry-EMGLZGR6.js.map → public-envelope-MFMBFJLZ.js.map} +0 -0
- /package/dist/{registry-NQALYR77.js.map → read-only-facade-3OQRZ3VS.js.map} +0 -0
- /package/dist/{revoke-7JOVLZFD.js.map → registry-IX5WKK4F.js.map} +0 -0
- /package/dist/{signer-M4K5HBLD.js.map → registry-LMHO5265.js.map} +0 -0
- /package/dist/{stale-PAGCS4K5.js.map → registry-TXCKWH26.js.map} +0 -0
- /package/dist/{ulid-COREQ2RQ.js.map → registry-VFEDQSYV.js.map} +0 -0
package/README.md
CHANGED
|
@@ -178,6 +178,132 @@ Core has zero `node:` imports — it runs unchanged in browsers, Node, Bun, Deno
|
|
|
178
178
|
|
|
179
179
|
CSV, XML, xlsx, and the rest of the plaintext tier — plus encrypted `.noydb` bundles under the `as-noydb` encrypted tier — all live in the [`@noy-db/as-*`](https://www.npmjs.com/search?q=%40noy-db%2Fas-) family. Every invocation is gated by the two-tier authorization model (`canExportPlaintext` default off, `canExportBundle` default on for owner/admin) and lands in the audit ledger.
|
|
180
180
|
|
|
181
|
+
## Money fields
|
|
182
|
+
|
|
183
|
+
`money()` is a schema-layer field descriptor (a sibling of `i18nText()` / `dictKey()`) for currency-safe, exact decimal values. Money is stored as a scaled integer encoded as a **digit string**, so it is exact for any magnitude — past `Number.MAX_SAFE_INTEGER` included (a JSON number would silently truncate at 2^53).
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
vault.collection('invoices', {
|
|
187
|
+
schema: z.object({ id: z.string(), total: z.union([z.number(), z.string()]) }),
|
|
188
|
+
moneyFields: { total: money({ currency: 'EUR', scale: 2 }) }, // scale optional — ISO-4217 default
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
await invoices.put('a', { id: 'a', total: '123.45' }) // stored as '12345'
|
|
192
|
+
const inv = await invoices.get('a', { locale: 'de-DE' })
|
|
193
|
+
// inv.total → '123.45' (exact decimal string)
|
|
194
|
+
// inv.totalFormatted → '123,45 €' (Intl, full precision)
|
|
195
|
+
// inv.totalNumber → 123.45 (convenience JS number; lossy past 2^53)
|
|
196
|
+
|
|
197
|
+
// Exact aggregation — sum/min/max run in BigInt, no float drift:
|
|
198
|
+
invoices.query().aggregate({ total: sum('total') }).run() // → '0.60', never 0.6000000000000001
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
- **Rounding:** excess precision is **rejected** by default; opt in per field with `money({ ..., rounding: 'half-even' })` (`half-up` / `half-even` / `half-down` / `up` / `down` / `ceil` / `floor`).
|
|
202
|
+
- **Multi-currency:** opt in with `money({ currencies: 'any' | ['EUR','USD'] })` — currency travels per record as `{ amount, currency }`; `sum` returns an exact per-currency map (`{ EUR: '15.50', USD: '3.00' }`), or one figure with `sum('total', { convertTo: 'EUR', fx })`.
|
|
203
|
+
- Money `sum`/`min`/`max` implement incremental `remove()`, so they stay exact under live aggregation and materialized-view maintenance.
|
|
204
|
+
|
|
205
|
+
## Computed fields
|
|
206
|
+
|
|
207
|
+
`computed` declares schema-owned scalar fields derived on write — keeping the arithmetic next to the schema instead of scattered across handlers. Each function is pure and synchronous; they run **first** in the write pipeline (before schema validation), in declaration order, so a later field can read an earlier one. The result is **materialized** on the record — stored, queryable, and `aggregate(sum())`-able like any field.
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
vault.collection('lines', {
|
|
211
|
+
schema: z.object({
|
|
212
|
+
id: z.string(), unitPrice: z.number(), qty: z.number(),
|
|
213
|
+
netAmount: z.number().optional(), taxAmount: z.number().optional(), total: z.number().optional(),
|
|
214
|
+
}),
|
|
215
|
+
computed: {
|
|
216
|
+
netAmount: (r) => r.unitPrice * r.qty,
|
|
217
|
+
taxAmount: (r) => r.netAmount * 0.22, // reads the field computed above
|
|
218
|
+
total: (r) => r.netAmount + r.taxAmount,
|
|
219
|
+
},
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
await lines.put('a', { id: 'a', unitPrice: 10, qty: 3 }) // computed fields not supplied
|
|
223
|
+
const line = await lines.get('a') // → { …, netAmount: 30, taxAmount: 6.6, total: 36.6 }
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
- A computed field **overwrites** any user-supplied value of the same name (the field is schema-owned); a throwing function rejects the write with `ComputedFieldError`.
|
|
227
|
+
- **Composes with `money()`** — declare a computed field as a money field too and it's quantized after evaluation, so `sum()` over it is exact.
|
|
228
|
+
|
|
229
|
+
## Immutable collections (WORM)
|
|
230
|
+
|
|
231
|
+
`immutableGuard` makes a collection write-once after a condition holds — issued invoices/DDTs that must never change. It's declarative sugar over `guards`: it generates the block-on-`check`/`onDelete` + ledgered admin-`amendment` strategy, so it reuses the whole guard machinery (and composes with `periods`/`history`).
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
import { createNoydb, immutableGuard } from '@noy-db/hub'
|
|
235
|
+
|
|
236
|
+
await createNoydb({
|
|
237
|
+
store, user, secret,
|
|
238
|
+
guardStrategies: [
|
|
239
|
+
immutableGuard({ collection: 'invoices', after: (r) => r.status === 'issued' }),
|
|
240
|
+
],
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
await invoices.put('a', { id: 'a', status: 'draft', total: 100 }) // ok
|
|
244
|
+
await invoices.put('a', { id: 'a', status: 'issued', total: 100 }) // ok — the transition write
|
|
245
|
+
await invoices.put('a', { id: 'a', status: 'issued', total: 999 }) // ✗ RecordLockedError
|
|
246
|
+
await invoices.delete('a') // ✗ RecordLockedError
|
|
247
|
+
|
|
248
|
+
// the sanctioned, ledgered override:
|
|
249
|
+
await db.transaction({ amendment: true, reason: 'correct issued total' }, async (tx) => {
|
|
250
|
+
tx.vault('books').collection('invoices').put('a', { id: 'a', status: 'issued', total: 110 })
|
|
251
|
+
})
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
- `after(record)` is evaluated on the **existing** record, so inserts and the write that *first* makes a record immutable are allowed; everything after is blocked.
|
|
255
|
+
- `appendOnly: true` is shorthand for `after: () => true` — immutable from creation.
|
|
256
|
+
- The admin/owner `amendment` path is the only way through, and every amendment is appended to the audit ledger.
|
|
257
|
+
|
|
258
|
+
## Retention, legal-hold & archival
|
|
259
|
+
|
|
260
|
+
For retention-bound data (e.g. 10-year fiscal records), two facilities share one rule — **a legal hold blocks eviction**.
|
|
261
|
+
|
|
262
|
+
**Blob retention** (`vault.compact()`) gains a hold and a period-bound floor:
|
|
263
|
+
|
|
264
|
+
```ts
|
|
265
|
+
vault.collection('invoices', {
|
|
266
|
+
blobFields: {
|
|
267
|
+
pdf: {
|
|
268
|
+
retainDays: 3650, // base TTL
|
|
269
|
+
legalHold: (r) => r.underLitigation === true, // never evict while held
|
|
270
|
+
retainUntil:(r) => r.fiscalYearEnd, // floor: keep until period obligation ends
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
})
|
|
274
|
+
const { evicted, held } = await vault.compact() // held = retained-by-hold count
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Record archival** (`withArchive`) relocates sealed records to a cold store — envelope-level, no re-encryption — and restores on demand:
|
|
278
|
+
|
|
279
|
+
```ts
|
|
280
|
+
import { createNoydb, withArchive } from '@noy-db/hub'
|
|
281
|
+
|
|
282
|
+
const db = await createNoydb({ store: primary, archiveStrategy: withArchive({ store: coldStore }) })
|
|
283
|
+
vault.collection('invoices', {
|
|
284
|
+
archive: { archiveWhen: (r) => r.fiscalYear <= thisYear - 1, legalHold: (r) => r.underHold },
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
await vault.archive() // → { archived, held, scanned }
|
|
288
|
+
await vault.listArchived('invoices') // → [{ collection, id }, …]
|
|
289
|
+
await vault.restore('invoices', 'inv-2020') // relocate back to primary (decryptable)
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Archival uses low-level relocation, so it **bypasses guards** (issued/immutable records over a sealed period can still be archived) and doesn't recompute finalized aggregates. Archived records read `null` from the primary store until restored; a `legalHold` predicate blocks archival entirely.
|
|
293
|
+
|
|
294
|
+
## Atomic sequences
|
|
295
|
+
|
|
296
|
+
`vault.sequence(name)` gives gap-free, exactly-once numbering — the primitive fiscal/ERP/ticketing apps need for invoice or DDT numbers — backed by an optimistic compare-and-swap counter.
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
const n = await vault.sequence('invoice-2026').next() // 1, then 2, 3, … no gaps, no duplicates
|
|
300
|
+
const cur = await vault.sequence('invoice-2026').peek() // read current value without allocating
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
- **Independent per name** — `sequence('invoice-2026')` and `sequence('ddt-2026')` are separate counters.
|
|
304
|
+
- **Concurrency-safe** — concurrent `next()` calls retry on CAS contention (jittered backoff); a genuine burst beyond the retry budget surfaces `SequenceContentionError` so the caller can retry or queue.
|
|
305
|
+
- **Online-only — by design.** Gap-free numbering needs single-authority serialization, which an offline writer can't provide. `next()` throws `SequenceOfflineError` unless the store advertises `capabilities.casAtomic`. This is the honest wall: assign each `next()` value to its record in the same operation (a discarded value is a gap in *usage*, not in the sequence).
|
|
306
|
+
|
|
181
307
|
## Status
|
|
182
308
|
|
|
183
309
|
**Pre-release** (`0.1.0-pre.1`). API may change before `1.0`. Install from the `next` dist-tag:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { aY as EncryptedEnvelope, d0 as ListPageResult, aw as NoydbBundleStore, aW as NoydbStore, eu as StoreCapabilities, ev as StoreTime, eP as TxOp, f4 as VaultSnapshot } from '../index-DHn9lEP0.js';
|
|
2
|
+
export { x as BundleVersionConflictError, J as ConflictError, ag as NetworkError, aC as StoreCapabilityError } from '../errors-BAWO5Z5a.js';
|
|
3
|
+
import '../lazy-builder-ChSqcF5t.js';
|
|
4
|
+
import '../predicate-BmhBSPCH.js';
|
|
5
|
+
import '../strategy-8QGs5KQE.js';
|
|
6
|
+
import '../strategy-BSxFXGzb.js';
|
|
7
|
+
import '../index-BMmajblo.js';
|
|
8
|
+
import '../index-Ddm8D3Oo.js';
|
|
9
|
+
import '@noy-db/attestation';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BundleVersionConflictError,
|
|
3
|
+
ConflictError,
|
|
4
|
+
NetworkError,
|
|
5
|
+
StoreCapabilityError
|
|
6
|
+
} from "../chunk-JZ5DS4DP.js";
|
|
7
|
+
import "../chunk-PZ5AY32C.js";
|
|
8
|
+
export {
|
|
9
|
+
BundleVersionConflictError,
|
|
10
|
+
ConflictError,
|
|
11
|
+
NetworkError,
|
|
12
|
+
StoreCapabilityError
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { A as AggregateStrategy } from '../strategy-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AggregateStrategy } from '../strategy-8QGs5KQE.js';
|
|
2
|
+
export { j as AggregateResult, k as AggregateSpec, l as Aggregation, m as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, n as GROUPBY_WARN_CARDINALITY, o as GroupedAggregation, p as GroupedQuery, q as GroupedQueryN, t as GroupedRow, u as GroupedRowN, w as LiveAggregation, x as Reducer, y as ReducerOptions, z as avg, B as buildLiveAggregation, C as count, D as groupAndReduce, E as max, F as min, H as reduceRecords, J as resetGroupByWarnings, K as sum } from '../strategy-8QGs5KQE.js';
|
|
3
|
+
import '../errors-BAWO5Z5a.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Active aggregate strategy factory. Calling `withAggregate()` returns
|
package/dist/aggregate/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
max,
|
|
5
5
|
min,
|
|
6
6
|
sum
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-DEE4CRYN.js";
|
|
8
8
|
import {
|
|
9
9
|
Aggregation,
|
|
10
10
|
GROUPBY_MAX_CARDINALITY,
|
|
@@ -16,9 +16,11 @@ import {
|
|
|
16
16
|
groupAndReduce,
|
|
17
17
|
reduceRecords,
|
|
18
18
|
resetGroupByWarnings
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-K6NVSHAH.js";
|
|
20
|
+
import "../chunk-KJ3K5VZM.js";
|
|
21
|
+
import "../chunk-QXWJQ7UU.js";
|
|
22
|
+
import "../chunk-JZ5DS4DP.js";
|
|
23
|
+
import "../chunk-PZ5AY32C.js";
|
|
22
24
|
|
|
23
25
|
// src/aggregate/active.ts
|
|
24
26
|
function withAggregate() {
|
|
@@ -26,11 +28,11 @@ function withAggregate() {
|
|
|
26
28
|
aggregate(executeRecords, spec, upstreams) {
|
|
27
29
|
return new Aggregation(executeRecords, spec, upstreams);
|
|
28
30
|
},
|
|
29
|
-
groupBy(executeRecords, field, upstreams, dictLabelResolver) {
|
|
30
|
-
return new GroupedQuery(executeRecords, field, upstreams, dictLabelResolver);
|
|
31
|
+
groupBy(executeRecords, field, upstreams, dictLabelResolver, moneyFields) {
|
|
32
|
+
return new GroupedQuery(executeRecords, field, upstreams, dictLabelResolver, moneyFields);
|
|
31
33
|
},
|
|
32
|
-
groupByN(executeRecords, fields, upstreams) {
|
|
33
|
-
return new GroupedQueryN(executeRecords, fields, upstreams);
|
|
34
|
+
groupByN(executeRecords, fields, upstreams, moneyFields) {
|
|
35
|
+
return new GroupedQueryN(executeRecords, fields, upstreams, void 0, moneyFields);
|
|
34
36
|
},
|
|
35
37
|
async scanAggregate(iter, spec) {
|
|
36
38
|
const collected = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/aggregate/active.ts"],"sourcesContent":["/**\n * Active aggregate strategy factory. Calling `withAggregate()` returns\n * an `AggregateStrategy` whose methods construct real `Aggregation` /\n * `GroupedQuery` instances and run the streaming reducer protocol.\n *\n * This module is only reachable through the `@noy-db/hub/aggregate`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { Aggregation, reduceRecords } from './aggregation.js'\nimport type { AggregateSpec, AggregateResult } from './aggregation.js'\nimport { GroupedQuery, GroupedQueryN } from './groupby.js'\nimport type { AggregateStrategy } from './strategy.js'\n\n/**\n * Build the default aggregate strategy. Pass into\n * `createNoydb({ aggregateStrategy: withAggregate() })` to light up\n * `.aggregate()` and `.groupBy()` on `Query` and `ScanBuilder`.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withAggregate, sum, count } from '@noy-db/hub/aggregate'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * aggregateStrategy: withAggregate(),\n * })\n *\n * const totals = invoices.query()\n * .where('status', '==', 'paid')\n * .groupBy('clientId')\n * .aggregate({ amount: sum('amount'), n: count() })\n * .run()\n * ```\n */\nexport function withAggregate(): AggregateStrategy {\n return {\n aggregate(executeRecords, spec, upstreams) {\n return new Aggregation(executeRecords, spec as unknown as AggregateSpec, upstreams) as unknown as Aggregation<AggregateResult<typeof spec>>\n },\n groupBy(executeRecords, field, upstreams, dictLabelResolver) {\n return new GroupedQuery(executeRecords, field, upstreams, dictLabelResolver)\n },\n groupByN(executeRecords, fields, upstreams) {\n return new GroupedQueryN(executeRecords, fields, upstreams)\n },\n async scanAggregate(iter, spec) {\n const collected: unknown[] = []\n for await (const record of iter) collected.push(record)\n return reduceRecords(collected, spec as unknown as AggregateSpec) as unknown as AggregateResult<typeof spec>\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/aggregate/active.ts"],"sourcesContent":["/**\n * Active aggregate strategy factory. Calling `withAggregate()` returns\n * an `AggregateStrategy` whose methods construct real `Aggregation` /\n * `GroupedQuery` instances and run the streaming reducer protocol.\n *\n * This module is only reachable through the `@noy-db/hub/aggregate`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { Aggregation, reduceRecords } from './aggregation.js'\nimport type { AggregateSpec, AggregateResult } from './aggregation.js'\nimport { GroupedQuery, GroupedQueryN } from './groupby.js'\nimport type { AggregateStrategy } from './strategy.js'\n\n/**\n * Build the default aggregate strategy. Pass into\n * `createNoydb({ aggregateStrategy: withAggregate() })` to light up\n * `.aggregate()` and `.groupBy()` on `Query` and `ScanBuilder`.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withAggregate, sum, count } from '@noy-db/hub/aggregate'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * aggregateStrategy: withAggregate(),\n * })\n *\n * const totals = invoices.query()\n * .where('status', '==', 'paid')\n * .groupBy('clientId')\n * .aggregate({ amount: sum('amount'), n: count() })\n * .run()\n * ```\n */\nexport function withAggregate(): AggregateStrategy {\n return {\n aggregate(executeRecords, spec, upstreams) {\n return new Aggregation(executeRecords, spec as unknown as AggregateSpec, upstreams) as unknown as Aggregation<AggregateResult<typeof spec>>\n },\n groupBy(executeRecords, field, upstreams, dictLabelResolver, moneyFields) {\n return new GroupedQuery(executeRecords, field, upstreams, dictLabelResolver, moneyFields)\n },\n groupByN(executeRecords, fields, upstreams, moneyFields) {\n return new GroupedQueryN(executeRecords, fields, upstreams, undefined, moneyFields)\n },\n async scanAggregate(iter, spec) {\n const collected: unknown[] = []\n for await (const record of iter) collected.push(record)\n return reduceRecords(collected, spec as unknown as AggregateSpec) as unknown as AggregateResult<typeof spec>\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,SAAS,gBAAmC;AACjD,SAAO;AAAA,IACL,UAAU,gBAAgB,MAAM,WAAW;AACzC,aAAO,IAAI,YAAY,gBAAgB,MAAkC,SAAS;AAAA,IACpF;AAAA,IACA,QAAQ,gBAAgB,OAAO,WAAW,mBAAmB,aAAa;AACxE,aAAO,IAAI,aAAa,gBAAgB,OAAO,WAAW,mBAAmB,WAAW;AAAA,IAC1F;AAAA,IACA,SAAS,gBAAgB,QAAQ,WAAW,aAAa;AACvD,aAAO,IAAI,cAAc,gBAAgB,QAAQ,WAAW,QAAW,WAAW;AAAA,IACpF;AAAA,IACA,MAAM,cAAc,MAAM,MAAM;AAC9B,YAAM,YAAuB,CAAC;AAC9B,uBAAiB,UAAU,KAAM,WAAU,KAAK,MAAM;AACtD,aAAO,cAAc,WAAW,IAAgC;AAAA,IAClE;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aW as NoydbStore } from '../index-DHn9lEP0.js';
|
|
2
2
|
import { AttestationFieldSchema, QrPayload, RevocationList } from '@noy-db/attestation';
|
|
3
3
|
export { AttestationFieldSchema, QrPayload, RevocationList, VerifyInput, VerifyResult, decodeQr, isRevoked, signRevocationList, verifyAttestation, verifyRevocationList } from '@noy-db/attestation';
|
|
4
|
-
export {
|
|
5
|
-
import '../lazy-builder-
|
|
6
|
-
import '../predicate-
|
|
7
|
-
import '../strategy-
|
|
4
|
+
export { s as AttestationError } from '../errors-BAWO5Z5a.js';
|
|
5
|
+
import '../lazy-builder-ChSqcF5t.js';
|
|
6
|
+
import '../predicate-BmhBSPCH.js';
|
|
7
|
+
import '../strategy-8QGs5KQE.js';
|
|
8
8
|
import '../strategy-BSxFXGzb.js';
|
|
9
|
+
import '../index-BMmajblo.js';
|
|
10
|
+
import '../index-Ddm8D3Oo.js';
|
|
9
11
|
|
|
10
12
|
/** Everything issueAttestationCore needs from the Vault, injected for testability. */
|
|
11
13
|
interface IssueContext {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
issueAttestationCore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-2QDWRK3B.js";
|
|
4
4
|
import {
|
|
5
5
|
getRevokedDocIdsCore,
|
|
6
6
|
publishRevocationListCore,
|
|
7
7
|
revokeDocCore,
|
|
8
8
|
unrevokeDocCore
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-JOJPBZSZ.js";
|
|
10
10
|
import {
|
|
11
11
|
ATTESTATIONS_COLLECTION
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-5PTX7PKD.js";
|
|
13
13
|
import "../chunk-FZU343FL.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-A7DNZVAV.js";
|
|
15
|
+
import "../chunk-E2MDPPOC.js";
|
|
16
16
|
import {
|
|
17
17
|
AttestationError
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-JZ5DS4DP.js";
|
|
19
|
+
import "../chunk-PZ5AY32C.js";
|
|
19
20
|
|
|
20
21
|
// src/attestation/index.ts
|
|
21
22
|
import { verifyAttestation, decodeQr, verifyRevocationList, isRevoked, signRevocationList } from "@noy-db/attestation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/attestation/index.ts"],"sourcesContent":["/**\n * @category capability\n * Document attestation — issue side. Mint a signed, per-field commitment\n * for a record and emit a QR credential verifiable offline via\n * `@noy-db/attestation`. See docs/superpowers/specs/2026-05-29-attestation-core-and-issue-design.md.\n */\nexport { issueAttestationCore } from './issue.js'\nexport type { IssueContext, IssueArgs, IssueResult } from './issue.js'\nexport { ATTESTATIONS_COLLECTION } from './signer.js'\nexport { revokeDocCore, unrevokeDocCore, getRevokedDocIdsCore, publishRevocationListCore } from './revoke.js'\nexport type { RevokeContext } from './revoke.js'\nexport { AttestationError } from '../errors.js'\n// Re-export the pure verifier surface so consumers can verify from one import:\nexport { verifyAttestation, decodeQr, verifyRevocationList, isRevoked, signRevocationList, type QrPayload, type AttestationFieldSchema, type VerifyResult, type VerifyInput, type RevocationList } from '@noy-db/attestation'\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/attestation/index.ts"],"sourcesContent":["/**\n * @category capability\n * Document attestation — issue side. Mint a signed, per-field commitment\n * for a record and emit a QR credential verifiable offline via\n * `@noy-db/attestation`. See docs/superpowers/specs/2026-05-29-attestation-core-and-issue-design.md.\n */\nexport { issueAttestationCore } from './issue.js'\nexport type { IssueContext, IssueArgs, IssueResult } from './issue.js'\nexport { ATTESTATIONS_COLLECTION } from './signer.js'\nexport { revokeDocCore, unrevokeDocCore, getRevokedDocIdsCore, publishRevocationListCore } from './revoke.js'\nexport type { RevokeContext } from './revoke.js'\nexport { AttestationError } from '../errors.js'\n// Re-export the pure verifier surface so consumers can verify from one import:\nexport { verifyAttestation, decodeQr, verifyRevocationList, isRevoked, signRevocationList, type QrPayload, type AttestationFieldSchema, type VerifyResult, type VerifyInput, type RevocationList } from '@noy-db/attestation'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaA,SAAS,mBAAmB,UAAU,sBAAsB,WAAW,0BAAiI;","names":[]}
|
package/dist/blobs/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { B as BlobStrategy } from '../
|
|
2
|
-
export {
|
|
3
|
-
export { d as detectMagic,
|
|
4
|
-
import '../lazy-builder-
|
|
5
|
-
import '../predicate-
|
|
6
|
-
import '../strategy-
|
|
1
|
+
import { B as BlobStrategy } from '../index-DHn9lEP0.js';
|
|
2
|
+
export { o as BLOB_CHUNKS_COLLECTION, p as BLOB_COLLECTION, q as BLOB_EVICTION_AUDIT_COLLECTION, r as BLOB_INDEX_COLLECTION, t as BLOB_SLOTS_PREFIX, u as BLOB_VERSIONS_PREFIX, w as BlobEvictionEntry, x as BlobFieldPolicy, y as BlobFieldsConfig, z as BlobObject, A as BlobPutOptions, C as BlobResponseOptions, E as BlobSet, F as BlobStrategyOpenArgs, G as CompactRunOptions, H as CompactionContext, J as CompactionResult, K as DEFAULT_CHUNK_SIZE, L as EXPORT_AUDIT_COLLECTION, M as ExportBlobsAbortedError, N as ExportBlobsAuditEntry, O as ExportBlobsHandle, Q as ExportBlobsOptions, R as ExportedBlob, T as ObjectListEntry, U as ObjectMeta, V as ObjectProjection, W as ObjectUrlOptions, X as PutObjectOptions, Y as PutUrlOptions, Z as SlotInfo, _ as SlotRecord, $ as VersionRecord, a0 as createExportBlobsHandle, a1 as memoryObjectProjection, a2 as runCompaction } from '../index-DHn9lEP0.js';
|
|
3
|
+
export { I as ImportExternalOptions, a as ImportExternalResult, b as ImportableCollection, d as detectMagic, c as detectMimeType, i as importExternalObjects, e as isPreCompressed } from '../mime-magic-JeLKHRng.js';
|
|
4
|
+
import '../lazy-builder-ChSqcF5t.js';
|
|
5
|
+
import '../predicate-BmhBSPCH.js';
|
|
6
|
+
import '../strategy-8QGs5KQE.js';
|
|
7
|
+
import '../errors-BAWO5Z5a.js';
|
|
7
8
|
import '../strategy-BSxFXGzb.js';
|
|
8
|
-
import '../index-
|
|
9
|
+
import '../index-BMmajblo.js';
|
|
10
|
+
import '../index-Ddm8D3Oo.js';
|
|
9
11
|
import '@noy-db/attestation';
|
|
10
12
|
|
|
11
13
|
/**
|
package/dist/blobs/index.js
CHANGED
|
@@ -8,18 +8,22 @@ import {
|
|
|
8
8
|
DEFAULT_CHUNK_SIZE,
|
|
9
9
|
detectMagic,
|
|
10
10
|
detectMimeType,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
importExternalObjects,
|
|
12
|
+
isPreCompressed,
|
|
13
|
+
memoryObjectProjection
|
|
14
|
+
} from "../chunk-ZK66B5EY.js";
|
|
13
15
|
import {
|
|
14
16
|
BLOB_EVICTION_AUDIT_COLLECTION,
|
|
15
17
|
EXPORT_AUDIT_COLLECTION,
|
|
16
18
|
ExportBlobsAbortedError,
|
|
17
19
|
createExportBlobsHandle,
|
|
18
20
|
runCompaction
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-XYW2CSCI.js";
|
|
22
|
+
import "../chunk-LXKBG52H.js";
|
|
23
|
+
import "../chunk-A7DNZVAV.js";
|
|
24
|
+
import "../chunk-E2MDPPOC.js";
|
|
25
|
+
import "../chunk-JZ5DS4DP.js";
|
|
26
|
+
import "../chunk-PZ5AY32C.js";
|
|
23
27
|
|
|
24
28
|
// src/blobs/active.ts
|
|
25
29
|
function withBlobs() {
|
|
@@ -43,7 +47,9 @@ export {
|
|
|
43
47
|
createExportBlobsHandle,
|
|
44
48
|
detectMagic,
|
|
45
49
|
detectMimeType,
|
|
50
|
+
importExternalObjects,
|
|
46
51
|
isPreCompressed,
|
|
52
|
+
memoryObjectProjection,
|
|
47
53
|
runCompaction,
|
|
48
54
|
withBlobs
|
|
49
55
|
};
|
package/dist/blobs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/blobs/active.ts"],"sourcesContent":["/**\n * Active blob strategy factory. Calling `blobs()` returns a\n * `BlobStrategy` whose `openSlot` constructs a real `BlobSet` bound\n * to the caller's record. The returned strategy is passed into\n * `createNoydb({ blobStrategy: blobs() })` to light up the\n * `collection.blob(id)` path.\n *\n * This module is only reachable through the `@noy-db/hub/blobs`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { BlobSet } from './blob-set.js'\nimport type { BlobStrategy } from './strategy.js'\n\n/**\n * Build a default `BlobStrategy` ready to pass into `createNoydb`.\n *\n * Named `withBlobs` (plugin-pattern canonical) rather than `blobs` to\n * avoid shadowing the very common local idiom\n * `const blobs = invoices.blob(id)` in user code.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withBlobs } from '@noy-db/hub/blobs'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * blobStrategy: withBlobs(),\n * })\n *\n * // Now live — delegates to BlobSet.\n * await db.vault('acme').collection('invoices').blob('inv-1').put('receipt.pdf', bytes)\n * ```\n */\nexport function withBlobs(): BlobStrategy {\n return {\n openSlot(args) {\n return new BlobSet(args)\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/blobs/active.ts"],"sourcesContent":["/**\n * Active blob strategy factory. Calling `blobs()` returns a\n * `BlobStrategy` whose `openSlot` constructs a real `BlobSet` bound\n * to the caller's record. The returned strategy is passed into\n * `createNoydb({ blobStrategy: blobs() })` to light up the\n * `collection.blob(id)` path.\n *\n * This module is only reachable through the `@noy-db/hub/blobs`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { BlobSet } from './blob-set.js'\nimport type { BlobStrategy } from './strategy.js'\n\n/**\n * Build a default `BlobStrategy` ready to pass into `createNoydb`.\n *\n * Named `withBlobs` (plugin-pattern canonical) rather than `blobs` to\n * avoid shadowing the very common local idiom\n * `const blobs = invoices.blob(id)` in user code.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withBlobs } from '@noy-db/hub/blobs'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * blobStrategy: withBlobs(),\n * })\n *\n * // Now live — delegates to BlobSet.\n * await db.vault('acme').collection('invoices').blob('inv-1').put('receipt.pdf', bytes)\n * ```\n */\nexport function withBlobs(): BlobStrategy {\n return {\n openSlot(args) {\n return new BlobSet(args)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,SAAS,YAA0B;AACxC,SAAO;AAAA,IACL,SAAS,MAAM;AACb,aAAO,IAAI,QAAQ,IAAI;AAAA,IACzB;AAAA,EACF;AACF;","names":[]}
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { T as TransferSealPayload } from '../
|
|
2
|
-
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import '../
|
|
7
|
-
import '../
|
|
1
|
+
import { T as TransferSealPayload } from '../decrypt-partition-CXS5KopB.js';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, D as DecryptedRecord, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as decryptExtractedPartition, j as encodeBundleHeader, r as readNoydbBundle, k as readNoydbBundleHeader, l as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../decrypt-partition-CXS5KopB.js';
|
|
3
|
+
export { g as generateULID, i as isULID } from '../ulid-DRH25k3y.js';
|
|
4
|
+
import { bh as Vault, aW as NoydbStore, bd as SealingKeyProvider, bi as RecoveryEnrollmentInput, bj as ShamirRecoveryProvider } from '../index-DHn9lEP0.js';
|
|
5
|
+
export { t as AdoptionStateError, B as BackupCorruptedError, u as BackupLedgerError, v as BundleIntegrityError, w as BundleSealMismatchError, x as BundleVersionConflictError, P as PartitionExtractionError, y as TransferSealError } from '../errors-BAWO5Z5a.js';
|
|
6
|
+
import '../lazy-builder-ChSqcF5t.js';
|
|
7
|
+
import '../predicate-BmhBSPCH.js';
|
|
8
|
+
import '../strategy-8QGs5KQE.js';
|
|
8
9
|
import '../strategy-BSxFXGzb.js';
|
|
10
|
+
import '../index-BMmajblo.js';
|
|
11
|
+
import '../index-Ddm8D3Oo.js';
|
|
9
12
|
import '@noy-db/attestation';
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
|
-
* Transitive-closure FK walker
|
|
15
|
+
* Transitive-closure FK walker. Computes the set of
|
|
13
16
|
* (collection, id) tuples reachable from seed predicates, so a
|
|
14
17
|
* partition extraction ships a referentially-complete subset.
|
|
15
18
|
*
|
|
@@ -48,7 +51,7 @@ interface ClosureResult {
|
|
|
48
51
|
declare function walkClosure(vault: Vault, opts: WalkClosureOptions): Promise<ClosureResult>;
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
|
-
* Partition-extraction dry-run
|
|
54
|
+
* Partition-extraction dry-run. Read-only preview of what an
|
|
52
55
|
* `extractPartition` would move: record counts, byte totals, and the
|
|
53
56
|
* timestamp span per collection — computed from raw encrypted
|
|
54
57
|
* envelopes WITHOUT decrypting them. Writes nothing, mutates nothing.
|
|
@@ -81,7 +84,7 @@ interface ExtractionPreview {
|
|
|
81
84
|
declare function describeExtraction(vault: Vault, opts: WalkClosureOptions): Promise<ExtractionPreview>;
|
|
82
85
|
|
|
83
86
|
/**
|
|
84
|
-
* Partition extraction
|
|
87
|
+
* Partition extraction. Walks the FK closure, re-encrypts
|
|
85
88
|
* the selected records under fresh per-collection DEKs, seals those DEKs
|
|
86
89
|
* under a one-time transfer key, and serializes an unowned
|
|
87
90
|
* `extracted-partition` bundle.
|
|
@@ -96,18 +99,26 @@ interface ExtractPartitionResult {
|
|
|
96
99
|
readonly sealId: string;
|
|
97
100
|
}
|
|
98
101
|
/**
|
|
99
|
-
* Extract a re-keyed, transfer-sealed partition
|
|
100
|
-
* (
|
|
102
|
+
* Extract a re-keyed, transfer-sealed partition. Owner-only
|
|
103
|
+
* (invariant 5): producing a standalone re-keyed vault is an
|
|
101
104
|
* ownership operation. Non-destructive on the source.
|
|
102
105
|
*/
|
|
103
106
|
declare function extractPartition(vault: Vault, opts: WalkClosureOptions & {
|
|
104
107
|
readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none';
|
|
105
108
|
readonly carrySchemas?: boolean;
|
|
106
109
|
readonly carryLedger?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* FR-7 structural field projection: per-collection allow-list of fields
|
|
112
|
+
* to keep. Non-listed fields are dropped from each record BEFORE
|
|
113
|
+
* re-encryption (so they never travel in the bundle); `id` is always
|
|
114
|
+
* preserved. A projected collection's persisted schema is NOT carried.
|
|
115
|
+
* Absent/empty → un-projected behavior (byte-identical to today).
|
|
116
|
+
*/
|
|
117
|
+
readonly fieldProjection?: Record<string, readonly string[]>;
|
|
107
118
|
}): Promise<ExtractPartitionResult>;
|
|
108
119
|
|
|
109
120
|
/**
|
|
110
|
-
* Reverse of `sealDeks
|
|
121
|
+
* Reverse of `sealDeks`. Imports the transfer key, decrypts the
|
|
111
122
|
* sealed `{ collection: base64(rawDEK) }` map (layout iv(12)‖ct‖tag), and
|
|
112
123
|
* re-imports each DEK as an AES-GCM key. Throws `TransferSealError` on a
|
|
113
124
|
* wrong key (AES-GCM auth-tag failure) or malformed payload.
|
|
@@ -135,10 +146,10 @@ interface CreateOwnerStandardOptions {
|
|
|
135
146
|
readonly transferKey: Uint8Array;
|
|
136
147
|
}
|
|
137
148
|
/**
|
|
138
|
-
* Managed-mode owner
|
|
149
|
+
* Managed-mode owner: the passphrase is minted + sealed under
|
|
139
150
|
* a `SealingKeyProvider` (e.g. an `at-*` OS keychain) so the partition
|
|
140
151
|
* auto-unlocks on the recipient's device. Managed mode mandates a strong
|
|
141
|
-
* (Shamir) recovery profile at creation
|
|
152
|
+
* (Shamir) recovery profile at creation, which needs the
|
|
142
153
|
* `shamirRecovery` provider injected.
|
|
143
154
|
*/
|
|
144
155
|
interface CreateOwnerManagedOptions {
|
|
@@ -151,12 +162,12 @@ interface CreateOwnerManagedOptions {
|
|
|
151
162
|
}
|
|
152
163
|
type CreateOwnerOptions = CreateOwnerStandardOptions | CreateOwnerManagedOptions;
|
|
153
164
|
/**
|
|
154
|
-
* Mint the first owner keyring on an adopted-but-unowned partition
|
|
155
|
-
* then destroy the transfer seal
|
|
165
|
+
* Mint the first owner keyring on an adopted-but-unowned partition,
|
|
166
|
+
* then destroy the transfer seal.
|
|
156
167
|
*
|
|
157
168
|
* Standard mode: the recipient supplies a passphrase. Managed mode: the
|
|
158
169
|
* passphrase is minted + sealed under a `SealingKeyProvider` and a strong
|
|
159
|
-
* (Shamir) recovery profile is enrolled
|
|
170
|
+
* (Shamir) recovery profile is enrolled — orchestrated via the existing
|
|
160
171
|
* `openVaultAndEnrollRecovery` ceremony.
|
|
161
172
|
*
|
|
162
173
|
* Either way, reuses `createOwnerKeyring` to derive the KEK + write the base
|