@noy-db/hub 0.4.0-pre.0 → 0.4.0-pre.10
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 +3 -4
- package/dist/api-ZDKTWNBB.js +20 -0
- package/dist/attestation/index.js +18 -18
- package/dist/{backup-YPUEKIJC.js → backup-2UX7PRM5.js} +13 -13
- package/dist/blobs/index.js +30 -15
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -12
- package/dist/broker/index.js.map +1 -1
- package/dist/cargo/index.js +58 -29
- package/dist/{chunk-IY23KFNZ.js → chunk-35NMVJ7I.js} +3 -3
- package/dist/{chunk-S3BFKGET.js → chunk-3HUYRN24.js} +4 -4
- package/dist/chunk-3HUYRN24.js.map +1 -0
- package/dist/{walk-IPLXE36W.js → chunk-3V3XR4S4.js} +4 -13
- package/dist/{walk-IPLXE36W.js.map → chunk-3V3XR4S4.js.map} +1 -1
- package/dist/{chunk-RTEK4C4I.js → chunk-4JQK3L4V.js} +2 -2
- package/dist/{chunk-3ELCWU56.js → chunk-4ZKNC6A6.js} +2 -2
- package/dist/{chunk-VQNJ7UZL.js → chunk-55LKVALY.js} +106 -10
- package/dist/chunk-55LKVALY.js.map +1 -0
- package/dist/{chunk-VAIS3SOM.js → chunk-55LX6FSX.js} +2 -2
- package/dist/chunk-5D2ALSM5.js +19 -0
- package/dist/chunk-5D2ALSM5.js.map +1 -0
- package/dist/{chunk-6HPG2YNX.js → chunk-5DRROK5W.js} +2 -2
- package/dist/{chunk-S6Q37VGE.js → chunk-5GQEU4DN.js} +2 -2
- package/dist/chunk-5JOFWL4G.js +25 -0
- package/dist/chunk-5JOFWL4G.js.map +1 -0
- package/dist/{chunk-ZXEZCY6F.js → chunk-63FE525P.js} +6 -6
- package/dist/chunk-6LJY7X5A.js +18 -0
- package/dist/chunk-6LJY7X5A.js.map +1 -0
- package/dist/{chunk-JVBO4SZL.js → chunk-6UBZ6I5Z.js} +2 -2
- package/dist/{chunk-BOKIKJJB.js → chunk-6ZNSB3H6.js} +5 -17
- package/dist/chunk-6ZNSB3H6.js.map +1 -0
- package/dist/{chunk-IK43HLDQ.js → chunk-7YVBQJ7K.js} +13 -355
- package/dist/chunk-7YVBQJ7K.js.map +1 -0
- package/dist/{chunk-VRBTNCM4.js → chunk-ABS7FMMD.js} +6 -6
- package/dist/chunk-AFHQATY4.js +47 -0
- package/dist/chunk-AFHQATY4.js.map +1 -0
- package/dist/{chunk-HOONYZY2.js → chunk-AKKRXT23.js} +7 -7
- package/dist/chunk-AKKRXT23.js.map +1 -0
- package/dist/{chunk-DDHM2TLX.js → chunk-AT2JJEKJ.js} +4 -4
- package/dist/chunk-AT2JJEKJ.js.map +1 -0
- package/dist/{chunk-M75ZZHSR.js → chunk-BLBAQRBM.js} +2 -2
- package/dist/{chunk-554KLAAN.js → chunk-BLCWSJLN.js} +88 -81
- package/dist/chunk-BLCWSJLN.js.map +1 -0
- package/dist/chunk-CADUYBQD.js +151 -0
- package/dist/chunk-CADUYBQD.js.map +1 -0
- package/dist/{chunk-WOM2HTML.js → chunk-CI32CAFS.js} +5 -5
- package/dist/{chunk-FH52K7EG.js → chunk-CUZLNGD5.js} +2 -6
- package/dist/{chunk-FH52K7EG.js.map → chunk-CUZLNGD5.js.map} +1 -1
- package/dist/{chunk-U6JMEH2P.js → chunk-CXQW2NWO.js} +145 -3
- package/dist/chunk-CXQW2NWO.js.map +1 -0
- package/dist/{chunk-EO43ANYJ.js → chunk-DABACXEF.js} +3 -3
- package/dist/{chunk-CJ5KKU6X.js → chunk-DMH3VZU5.js} +4 -4
- package/dist/chunk-DSDXAKIP.js +50 -0
- package/dist/chunk-DSDXAKIP.js.map +1 -0
- package/dist/{chunk-WZSHL6DQ.js → chunk-DZ2JXHWK.js} +5 -5
- package/dist/chunk-DZFQVICS.js +23 -0
- package/dist/chunk-DZFQVICS.js.map +1 -0
- package/dist/chunk-E23UGFVC.js +63 -0
- package/dist/chunk-E23UGFVC.js.map +1 -0
- package/dist/{chunk-Z4PD65VQ.js → chunk-EE7UHLKH.js} +4 -4
- package/dist/chunk-EIPVYUEP.js +654 -0
- package/dist/chunk-EIPVYUEP.js.map +1 -0
- package/dist/{chunk-RNG4VRP4.js → chunk-EKRSCRNM.js} +3 -3
- package/dist/{chunk-YMUGBZN2.js → chunk-FQ5CHJR7.js} +1 -1
- package/dist/chunk-FQ5CHJR7.js.map +1 -0
- package/dist/{chunk-RFI7GGFO.js → chunk-FQZ6XTQ7.js} +17 -20
- package/dist/chunk-FQZ6XTQ7.js.map +1 -0
- package/dist/{chunk-MT62YSPZ.js → chunk-FRMPM7WG.js} +4 -4
- package/dist/{chunk-W4TCUGQR.js → chunk-G2JUIDFA.js} +13 -9
- package/dist/{chunk-W4TCUGQR.js.map → chunk-G2JUIDFA.js.map} +1 -1
- package/dist/{chunk-T3GY65MA.js → chunk-G6WWZNJP.js} +13 -13
- package/dist/chunk-G6WWZNJP.js.map +1 -0
- package/dist/chunk-GJW4HX2O.js +1 -0
- package/dist/{chunk-KS6SAVCZ.js → chunk-GU3IP74F.js} +6 -6
- package/dist/{chunk-UHNGNKLV.js → chunk-GWWOGNBK.js} +308 -18
- package/dist/chunk-GWWOGNBK.js.map +1 -0
- package/dist/{chunk-5PFOMHTB.js → chunk-H2GPHUZD.js} +12 -13
- package/dist/chunk-H2GPHUZD.js.map +1 -0
- package/dist/{chunk-H2KSZMIX.js → chunk-HMU5P6RL.js} +5 -5
- package/dist/chunk-HMU5P6RL.js.map +1 -0
- package/dist/{chunk-JFCV5QIK.js → chunk-I5GEJX3R.js} +5 -5
- package/dist/chunk-I5GEJX3R.js.map +1 -0
- package/dist/{chunk-GWKAVKHI.js → chunk-IG6KUWBX.js} +2 -2
- package/dist/chunk-IG6KUWBX.js.map +1 -0
- package/dist/{chunk-LVGTA624.js → chunk-IPUG56GJ.js} +15 -5
- package/dist/{chunk-LVGTA624.js.map → chunk-IPUG56GJ.js.map} +1 -1
- package/dist/{chunk-SMIRGMS7.js → chunk-IXNCZTWA.js} +2 -2
- package/dist/{chunk-WQIYTNJV.js → chunk-IXTSNGYY.js} +3 -3
- package/dist/{chunk-WHXXI3W5.js → chunk-IYZISPGD.js} +7 -5
- package/dist/chunk-IYZISPGD.js.map +1 -0
- package/dist/{chunk-HQBM64EE.js → chunk-JDOMW53O.js} +145 -16
- package/dist/chunk-JDOMW53O.js.map +1 -0
- package/dist/{chunk-NCCBLYEB.js → chunk-JJZGIE4U.js} +6 -5
- package/dist/{chunk-DRWBEDYO.js → chunk-JYJFGD2H.js} +2 -2
- package/dist/{chunk-TAGR72IR.js → chunk-KRCBZYTZ.js} +26 -177
- package/dist/chunk-KRCBZYTZ.js.map +1 -0
- package/dist/{chunk-DSBQODMZ.js → chunk-L2DGWBCT.js} +14 -14
- package/dist/chunk-L2DGWBCT.js.map +1 -0
- package/dist/{chunk-VEALDPHW.js → chunk-L3YYLT4E.js} +15 -2
- package/dist/chunk-L3YYLT4E.js.map +1 -0
- package/dist/{chunk-FXZDAV62.js → chunk-LNPUSMZL.js} +29 -31
- package/dist/chunk-LNPUSMZL.js.map +1 -0
- package/dist/{chunk-XJMBYYQK.js → chunk-LNZKOUJR.js} +2 -2
- package/dist/{chunk-R3BLCFD2.js → chunk-MBKVNOJS.js} +6 -6
- package/dist/chunk-MCHBCNCE.js +367 -0
- package/dist/chunk-MCHBCNCE.js.map +1 -0
- package/dist/{chunk-VCBHAE4R.js → chunk-MHMLXJ3I.js} +2 -2
- package/dist/chunk-MHMLXJ3I.js.map +1 -0
- package/dist/{chunk-WNGGJWF7.js → chunk-MSMJJB4J.js} +2 -2
- package/dist/chunk-MSMJJB4J.js.map +1 -0
- package/dist/{chunk-T36RFODW.js → chunk-MXUT7FTE.js} +2 -2
- package/dist/chunk-MXUT7FTE.js.map +1 -0
- package/dist/{chunk-WG4QBZDN.js → chunk-N4BBNYIB.js} +11 -9
- package/dist/chunk-N4BBNYIB.js.map +1 -0
- package/dist/{chunk-PK6JIDQ4.js → chunk-NFIBXF4V.js} +1084 -1583
- package/dist/chunk-NFIBXF4V.js.map +1 -0
- package/dist/{chunk-VKCADNMR.js → chunk-NFNJLRY7.js} +368 -52
- package/dist/chunk-NFNJLRY7.js.map +1 -0
- package/dist/{chunk-N6WF5PKC.js → chunk-NFZGZ4AK.js} +2 -2
- package/dist/{chunk-JRBNCUNT.js → chunk-NGSJZFGL.js} +21 -4
- package/dist/chunk-NGSJZFGL.js.map +1 -0
- package/dist/chunk-NJ4DYYO5.js +81 -0
- package/dist/chunk-NJ4DYYO5.js.map +1 -0
- package/dist/chunk-NM5UYF6Q.js +24 -0
- package/dist/chunk-NM5UYF6Q.js.map +1 -0
- package/dist/{chunk-JBBSYJHP.js → chunk-NYEFP7DY.js} +4 -4
- package/dist/chunk-NYEFP7DY.js.map +1 -0
- package/dist/{chunk-GDG5VVYG.js → chunk-NZ24MX4J.js} +8 -46
- package/dist/chunk-NZ24MX4J.js.map +1 -0
- package/dist/{chunk-IFJTPAQQ.js → chunk-OLEPKFTW.js} +4 -4
- package/dist/chunk-OLEPKFTW.js.map +1 -0
- package/dist/{chunk-THVIPWRF.js → chunk-PEATRIYJ.js} +9 -9
- package/dist/chunk-PEOZ34EM.js +13 -0
- package/dist/chunk-PEOZ34EM.js.map +1 -0
- package/dist/{chunk-UC2ETWF3.js → chunk-PTHKZWEH.js} +2 -14
- package/dist/{chunk-UC2ETWF3.js.map → chunk-PTHKZWEH.js.map} +1 -1
- package/dist/chunk-PVEWA2DU.js +23 -0
- package/dist/chunk-PVEWA2DU.js.map +1 -0
- package/dist/{chunk-VCTXU4AT.js → chunk-QBAC3GXA.js} +1 -1
- package/dist/chunk-QBAC3GXA.js.map +1 -0
- package/dist/{chunk-RDXW3OBQ.js → chunk-QD46HPZG.js} +2 -2
- package/dist/chunk-QD46HPZG.js.map +1 -0
- package/dist/{chunk-YZQOGE2L.js → chunk-QDIH2744.js} +2 -2
- package/dist/{chunk-6HY2X62D.js → chunk-QJNCB5SK.js} +2 -2
- package/dist/{chunk-IAO54J4R.js → chunk-QX76XVQH.js} +6 -6
- package/dist/chunk-QX76XVQH.js.map +1 -0
- package/dist/{chunk-W2OG6JOL.js → chunk-QZWTRENR.js} +24 -7
- package/dist/chunk-QZWTRENR.js.map +1 -0
- package/dist/{chunk-6NQMXTYC.js → chunk-RO5NM6UI.js} +2 -2
- package/dist/chunk-RO5NM6UI.js.map +1 -0
- package/dist/chunk-SGDPRCC4.js +1075 -0
- package/dist/chunk-SGDPRCC4.js.map +1 -0
- package/dist/{chunk-2PCAVW2I.js → chunk-SHEEBRZ4.js} +2 -2
- package/dist/chunk-SMY5X46Z.js +14 -0
- package/dist/chunk-SMY5X46Z.js.map +1 -0
- package/dist/{chunk-ISMV2QVG.js → chunk-TG634KCO.js} +11 -2
- package/dist/chunk-TG634KCO.js.map +1 -0
- package/dist/{chunk-XUW3PXHU.js → chunk-TUXQSFHZ.js} +4 -16
- package/dist/{chunk-XUW3PXHU.js.map → chunk-TUXQSFHZ.js.map} +1 -1
- package/dist/{chunk-GULTLPFB.js → chunk-UADPR6F4.js} +3 -3
- package/dist/{chunk-GULTLPFB.js.map → chunk-UADPR6F4.js.map} +1 -1
- package/dist/{chunk-XTHCN77N.js → chunk-UDHBXYGG.js} +29 -19
- package/dist/chunk-UDHBXYGG.js.map +1 -0
- package/dist/{chunk-RA5VTXXG.js → chunk-V6UQZA2H.js} +2 -2
- package/dist/chunk-VG2ZSFYD.js +32 -0
- package/dist/chunk-VG2ZSFYD.js.map +1 -0
- package/dist/chunk-VKQCVU2Z.js +21 -0
- package/dist/chunk-VKQCVU2Z.js.map +1 -0
- package/dist/{chunk-QDPZWTN2.js → chunk-W3G5REIU.js} +2 -2
- package/dist/{chunk-A4FXFAKF.js → chunk-W3L64Y3J.js} +2 -2
- package/dist/{chunk-ONTBCHCP.js → chunk-W66AM5IB.js} +2 -2
- package/dist/chunk-W66AM5IB.js.map +1 -0
- package/dist/{chunk-A5BDDEXK.js → chunk-WBKZUO5V.js} +26 -43
- package/dist/chunk-WBKZUO5V.js.map +1 -0
- package/dist/{chunk-XDIAFPUM.js → chunk-WLXMTYGO.js} +2 -2
- package/dist/{chunk-RJ6K6K5M.js → chunk-X3F5YJG2.js} +2 -2
- package/dist/{chunk-WKGF2TJR.js → chunk-X45JYIAY.js} +3 -3
- package/dist/chunk-X45JYIAY.js.map +1 -0
- package/dist/{chunk-6XE5TMPR.js → chunk-X4MVWPHV.js} +3 -3
- package/dist/chunk-X4MVWPHV.js.map +1 -0
- package/dist/chunk-XZHEOSQ2.js +16 -0
- package/dist/chunk-XZHEOSQ2.js.map +1 -0
- package/dist/chunk-Y2NBBT6K.js +18 -0
- package/dist/chunk-Y2NBBT6K.js.map +1 -0
- package/dist/{chunk-CZTLE22N.js → chunk-Y2NJBNX3.js} +8 -8
- package/dist/{chunk-CZTLE22N.js.map → chunk-Y2NJBNX3.js.map} +1 -1
- package/dist/{chunk-YTGDPCPW.js → chunk-Y6B6HVKC.js} +2 -2
- package/dist/chunk-YMUFFJCO.js +23 -0
- package/dist/chunk-YMUFFJCO.js.map +1 -0
- package/dist/{chunk-SV6EAJEP.js → chunk-YWWQM7KP.js} +5 -14
- package/dist/chunk-YWWQM7KP.js.map +1 -0
- package/dist/{chunk-UDSR4X4L.js → chunk-YZJSJOUI.js} +239 -16
- package/dist/chunk-YZJSJOUI.js.map +1 -0
- package/dist/{chunk-5WZXVULX.js → chunk-ZTLOXFPB.js} +2 -2
- package/dist/chunk-ZTLOXFPB.js.map +1 -0
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-QWMASIT7.js → classified-marker-7PKJBFCG.js} +3 -3
- package/dist/collection-facade-6I5K5IOD.js +45 -0
- package/dist/{computed-DSMPXG2Y.js → computed-AB45PS4V.js} +3 -3
- package/dist/consent/index.js +13 -9
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +37 -0
- package/dist/crdt/index.js +4 -0
- package/dist/crdt/index.js.map +1 -1
- package/dist/custody/index.js +26 -0
- package/dist/{dead-filter-66VGI6JV.js → dead-filter-FL3WIUZS.js} +2 -2
- package/dist/{chunk-OCVM6KDH.js → delegation-QXZ4MPPH.js} +12 -6
- package/dist/{chunk-OCVM6KDH.js.map → delegation-QXZ4MPPH.js.map} +1 -1
- package/dist/derivations/index.js +12 -12
- package/dist/derive-VGS7FKE3.js +22 -0
- package/dist/directory/index.js +46 -0
- package/dist/dispatch-EGGC7UD7.js +72 -0
- package/dist/dispatch-EGGC7UD7.js.map +1 -0
- package/dist/dispatch-GDSTUTVP.js +194 -0
- package/dist/dispatch-GDSTUTVP.js.map +1 -0
- package/dist/{enclave-TKPN2G2U.js → enclave-SPEEDYZ4.js} +13 -11
- package/dist/executor-IEBLTBCW.js +9 -0
- package/dist/executor-OTF556PL.js +28 -0
- package/dist/executor-RM7XWQDU.js +9 -0
- package/dist/export-accessible-P42BQ4PB.js +23 -0
- package/dist/extract-partition-TCYXRWBN.js +38 -0
- package/dist/{fanout-sidecar-B5LVUMQX.js → fanout-sidecar-SSMRSC2L.js} +9 -9
- package/dist/find-OZMTRIK3.js +11 -0
- package/dist/forget/index.js +11 -11
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +16 -12
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +16 -14
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +42 -42
- package/dist/index.js +332 -2106
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +4 -2
- package/dist/indexing/index.js.map +1 -1
- package/dist/introspection/index.js +28 -0
- package/dist/issue-FCKN5O6C.js +19 -0
- package/dist/kernel/best-effort-revert.d.ts +9 -1
- package/dist/kernel/collection-config.d.ts +12 -70
- package/dist/kernel/collection.d.ts +11 -23
- package/dist/kernel/enclave/crypto.d.ts +8 -8
- package/dist/kernel/enclave/index.d.ts +4 -4
- package/dist/kernel/enclave/record-keys/envelope-body.d.ts +8 -0
- package/dist/kernel/errors.d.ts +41 -22
- package/dist/kernel/lazy.d.ts +30 -0
- package/dist/kernel/noydb.d.ts +81 -124
- package/dist/kernel/query/builder.d.ts +10 -10
- package/dist/kernel/query/index.d.ts +0 -6
- package/dist/kernel/query/scan-builder.d.ts +4 -4
- package/dist/kernel/sync-policy.d.ts +76 -4
- package/dist/kernel/types.d.ts +187 -86
- package/dist/kernel/validation.d.ts +33 -33
- package/dist/kernel/vault.d.ts +41 -229
- package/dist/kernel/via/dispatch.d.ts +7 -0
- package/dist/{ledger-PTK7XZYT.js → ledger-6XBEVWYP.js} +11 -11
- package/dist/liberate-CYUOS4NC.js +24 -0
- package/dist/{link-set-SLJHDNRB.js → link-set-NK6L2A5S.js} +11 -11
- package/dist/materialized-views/index.js +22 -19
- package/dist/money/index.js +31 -0
- package/dist/noydb-FZZIMLCI.js +81 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +21 -17
- package/dist/pod/index.js +26 -12
- package/dist/{policy-YDLCOX4P.js → policy/index.js} +6 -6
- package/dist/port/with/archive-strategy.d.ts +31 -0
- package/dist/port/with/blob-strategy.d.ts +15 -5
- package/dist/port/with/collection-options.d.ts +171 -0
- package/dist/port/with/collection-registries.d.ts +62 -0
- package/dist/port/with/strategies.d.ts +134 -0
- package/dist/port/with/team-strategy.d.ts +3 -2
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-2YHSADFI.js → post-register-VFIYISUK.js} +6 -6
- package/dist/query/index.js +6 -46
- package/dist/{aggregate → reduce}/index.js +24 -17
- package/dist/reduce/index.js.map +1 -0
- package/dist/register-UKU2J6MN.js +25 -0
- package/dist/registry-2VCWVHZS.js +19 -0
- package/dist/registry-7Y5WF7GS.js +9 -0
- package/dist/{registry-VW6P6A3J.js → registry-BWD2ED52.js} +2 -2
- package/dist/registry-DTWRJLSF.js +18 -0
- package/dist/request-withdrawal-JYDZ5XY2.js +31 -0
- package/dist/{reveal-HWO4YMTJ.js → reveal-CL2BCW6A.js} +6 -6
- package/dist/revoke-2TSAD2T4.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +26 -0
- package/dist/sealed-record/index.js +12 -12
- package/dist/search/index.js +36 -0
- package/dist/{seed-3ZMF5EQA.js → seed-NUVJEL7T.js} +12 -12
- package/dist/seed-NUVJEL7T.js.map +1 -0
- package/dist/sequence/index.js +30 -0
- package/dist/session/index.js +13 -9
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +6 -2
- package/dist/shadow/index.js.map +1 -1
- package/dist/share-link/index.d.ts +19 -0
- package/dist/share-link/index.js +201 -0
- package/dist/share-link/index.js.map +1 -0
- package/dist/share-link/share-link.d.ts +123 -0
- package/dist/signer-K7Z2EOMG.js +25 -0
- package/dist/snapshots/index.js +14 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-VZL4OGUB.js → stale-A4J26OIC.js} +11 -10
- package/dist/storage-YVHZUISN.js +23 -0
- package/dist/store/index.js +22 -0
- package/dist/{store-coordination-provider-FKX3F6TQ.js → store-coordination-provider-EWRZL7XF.js} +3 -3
- package/dist/sync/index.js +15 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +33 -47
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +1 -1
- package/dist/{tx → transactions}/index.js +7 -3
- package/dist/transactions/index.js.map +1 -0
- package/dist/util/index.js +1 -1
- package/dist/{verify-26Y5GNMK.js → verify-7XWHJWUN.js} +5 -5
- package/dist/via/blob/active.d.ts +23 -7
- package/dist/via/blob/binding.d.ts +1 -1
- package/dist/via/blob/index.d.ts +7 -1
- package/dist/via/i18n/core.d.ts +1 -1
- package/dist/via/i18n/index.d.ts +2 -0
- package/dist/via/money/money-reducer.d.ts +2 -2
- package/dist/walk-P5D6CF4V.js +21 -0
- package/dist/with-audit/consent/index.d.ts +2 -0
- package/dist/with-audit/forget/active.d.ts +3 -3
- package/dist/with-audit/forget/index.d.ts +6 -5
- package/dist/with-audit/forget/strategy.d.ts +3 -3
- package/dist/with-audit/guards/executor.d.ts +4 -4
- package/dist/with-audit/guards/immutable-guard.d.ts +3 -3
- package/dist/with-audit/guards/index.d.ts +1 -1
- package/dist/with-audit/guards/registry.d.ts +3 -3
- package/dist/with-audit/guards/transition-guard.d.ts +3 -3
- package/dist/with-audit/guards/types.d.ts +10 -10
- package/dist/with-audit/guards/with-guard.d.ts +2 -2
- package/dist/with-audit/periods/index.d.ts +2 -0
- package/dist/with-audit/periods/periods.d.ts +1 -16
- package/dist/with-audit/periods/vault-facade.d.ts +6 -0
- package/dist/with-audit/periods/window.d.ts +16 -0
- package/dist/with-audit/portability/export-accessible.d.ts +4 -4
- package/dist/with-audit/portability/request-withdrawal.d.ts +3 -3
- package/dist/with-audit/portability/withdraw-accessible.d.ts +2 -2
- package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
- package/dist/with-audit/tiers/index.d.ts +1 -0
- package/dist/with-cargo/adopt-partition.d.ts +7 -7
- package/dist/{legacy/kernel.d.ts → with-cargo/floor.d.ts} +4 -4
- package/dist/with-cargo/index.d.ts +15 -2
- package/dist/with-commit/crdt/index.d.ts +2 -0
- package/dist/with-commit/history/index.d.ts +2 -0
- package/dist/with-commit/history/time-machine.d.ts +2 -2
- package/dist/with-commit/numbering/descriptor.d.ts +16 -6
- package/dist/with-commit/tx/active.d.ts +5 -5
- package/dist/with-commit/tx/index.d.ts +2 -2
- package/dist/with-commit/tx/invariants.d.ts +1 -1
- package/dist/with-commit/tx/strategy.d.ts +3 -3
- package/dist/with-fork/shadow/index.d.ts +2 -0
- package/dist/with-fork/snapshots/active.d.ts +2 -2
- package/dist/with-fork/snapshots/index.d.ts +3 -1
- package/dist/with-fork/snapshots/noydb-facade.d.ts +3 -3
- package/dist/with-fork/snapshots/strategy.d.ts +2 -2
- package/dist/with-formula/derivations/dispatch.d.ts +98 -0
- package/dist/with-formula/derivations/executor.d.ts +2 -2
- package/dist/with-formula/derivations/index.d.ts +4 -1
- package/dist/with-formula/derivations/registry.d.ts +3 -3
- package/dist/with-formula/derivations/stale.d.ts +2 -2
- package/dist/with-formula/derivations/types.d.ts +3 -3
- package/dist/with-formula/derivations/with-derivation.d.ts +2 -2
- package/dist/with-formula/derivations/with-rollup.d.ts +15 -8
- package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +3 -3
- package/dist/with-formula/materialized-views/dispatch.d.ts +75 -0
- package/dist/with-formula/materialized-views/index.d.ts +2 -1
- package/dist/with-formula/materialized-views/registry.d.ts +4 -4
- package/dist/with-formula/materialized-views/types.d.ts +11 -11
- package/dist/with-formula/materialized-views/with-materialized-view.d.ts +2 -2
- package/dist/with-formula/overlay-views/index.d.ts +1 -1
- package/dist/with-formula/overlay-views/registry.d.ts +4 -4
- package/dist/with-formula/overlay-views/types.d.ts +3 -3
- package/dist/with-formula/overlay-views/virtual-collection.d.ts +2 -2
- package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +2 -2
- package/dist/with-lookup/indexing/active.d.ts +5 -5
- package/dist/with-lookup/indexing/index.d.ts +3 -1
- package/dist/with-lookup/indexing/strategy.d.ts +3 -3
- package/dist/with-lookup/{aggregate → reduce}/active.d.ts +8 -8
- package/dist/with-lookup/{aggregate → reduce}/groupby.d.ts +21 -21
- package/dist/with-lookup/reduce/index.d.ts +34 -0
- package/dist/with-lookup/{aggregate → reduce}/reducers.d.ts +11 -12
- package/dist/with-lookup/{aggregate/aggregation.d.ts → reduce/reduction.d.ts} +21 -21
- package/dist/with-lookup/{aggregate → reduce}/strategy.d.ts +15 -15
- package/dist/with-lookup/search/build-docs.d.ts +7 -2
- package/dist/with-lookup/search/index.d.ts +1 -1
- package/dist/with-party/broker/index.d.ts +1 -0
- package/dist/with-party/broker/seed.d.ts +1 -1
- package/dist/with-party/custody/liberate.d.ts +3 -3
- package/dist/with-party/directory/cover/index.d.ts +1 -5
- package/dist/with-party/directory/cover/schema.d.ts +0 -6
- package/dist/with-party/directory/cover/storage.d.ts +0 -8
- package/dist/with-party/directory/cover/types.d.ts +0 -21
- package/dist/with-party/directory/index.d.ts +2 -0
- package/dist/with-party/session/dev-unlock.d.ts +2 -2
- package/dist/with-party/session/index.d.ts +2 -0
- package/dist/with-party/session/session.d.ts +2 -2
- package/dist/with-party/team/deed.d.ts +8 -8
- package/dist/with-party/team/index.d.ts +4 -7
- package/dist/with-party/team/keyring.d.ts +83 -35
- package/dist/with-party/team/{managed-passphrase.d.ts → managed-secret.d.ts} +27 -27
- package/dist/with-party/team/noydb-facade.d.ts +43 -42
- package/dist/with-party/team/peer-recover.d.ts +13 -13
- package/dist/with-party/team/recovery.d.ts +5 -5
- package/dist/with-party/team/rotate-recover.d.ts +30 -30
- package/dist/with-pod/bundle.d.ts +30 -32
- package/dist/with-pod/format.d.ts +2 -2
- package/dist/with-pod/index.d.ts +2 -1
- package/dist/with-shape/blobs/blob-compaction.d.ts +43 -3
- package/dist/with-shape/blobs/blob-pinning.d.ts +112 -0
- package/dist/with-shape/blobs/blob-set.d.ts +86 -2
- package/dist/with-shape/introspection/index.d.ts +6 -0
- package/dist/with-shape/schema-update/index.d.ts +1 -0
- package/dist/with-store/index.d.ts +3 -2
- package/dist/with-store/route-store.d.ts +1 -1
- package/dist/{with-party/team/sync-active.d.ts → with-sync/active.d.ts} +1 -1
- package/dist/{with-party/team/sync-credentials.d.ts → with-sync/credentials.d.ts} +3 -3
- package/dist/{with-party/team/sync.d.ts → with-sync/engine.d.ts} +17 -4
- package/dist/{with-party/sync → with-sync}/index.d.ts +4 -2
- package/dist/with-sync/period-scope.d.ts +78 -0
- package/dist/{with-party/team → with-sync}/presence.d.ts +2 -2
- package/dist/{with-party/team/sync-strategy.d.ts → with-sync/strategy.d.ts} +6 -6
- package/dist/{with-party/team/sync-transaction.d.ts → with-sync/transaction.d.ts} +3 -3
- package/dist/withdraw-accessible-A2PWF5MZ.js +28 -0
- package/dist/withdraw-accessible-A2PWF5MZ.js.map +1 -0
- package/package.json +49 -36
- package/dist/aggregate/index.js.map +0 -1
- package/dist/api-3A3S4SHH.js +0 -20
- package/dist/as/index.js +0 -30
- package/dist/at/index.js +0 -1
- package/dist/bundle/index.js +0 -153
- package/dist/bundle/index.js.map +0 -1
- package/dist/by/index.js +0 -11
- package/dist/chunk-554KLAAN.js.map +0 -1
- package/dist/chunk-5PFOMHTB.js.map +0 -1
- package/dist/chunk-5WZXVULX.js.map +0 -1
- package/dist/chunk-6NQMXTYC.js.map +0 -1
- package/dist/chunk-6XE5TMPR.js.map +0 -1
- package/dist/chunk-A5BDDEXK.js.map +0 -1
- package/dist/chunk-ANATMTOA.js +0 -205
- package/dist/chunk-ANATMTOA.js.map +0 -1
- package/dist/chunk-BOKIKJJB.js.map +0 -1
- package/dist/chunk-CHFZDSE4.js +0 -1
- package/dist/chunk-DDHM2TLX.js.map +0 -1
- package/dist/chunk-DSBQODMZ.js.map +0 -1
- package/dist/chunk-EWPOHMN2.js +0 -255
- package/dist/chunk-EWPOHMN2.js.map +0 -1
- package/dist/chunk-FXZDAV62.js.map +0 -1
- package/dist/chunk-GDG5VVYG.js.map +0 -1
- package/dist/chunk-GWKAVKHI.js.map +0 -1
- package/dist/chunk-H2KSZMIX.js.map +0 -1
- package/dist/chunk-HOONYZY2.js.map +0 -1
- package/dist/chunk-HQBM64EE.js.map +0 -1
- package/dist/chunk-IAO54J4R.js.map +0 -1
- package/dist/chunk-IFJTPAQQ.js.map +0 -1
- package/dist/chunk-IK43HLDQ.js.map +0 -1
- package/dist/chunk-ISMV2QVG.js.map +0 -1
- package/dist/chunk-JBBSYJHP.js.map +0 -1
- package/dist/chunk-JFCV5QIK.js.map +0 -1
- package/dist/chunk-JRBNCUNT.js.map +0 -1
- package/dist/chunk-LB7FD65R.js +0 -163
- package/dist/chunk-LB7FD65R.js.map +0 -1
- package/dist/chunk-ONTBCHCP.js.map +0 -1
- package/dist/chunk-PK6JIDQ4.js.map +0 -1
- package/dist/chunk-RDXW3OBQ.js.map +0 -1
- package/dist/chunk-RFI7GGFO.js.map +0 -1
- package/dist/chunk-S3BFKGET.js.map +0 -1
- package/dist/chunk-SV6EAJEP.js.map +0 -1
- package/dist/chunk-T36RFODW.js.map +0 -1
- package/dist/chunk-T3GY65MA.js.map +0 -1
- package/dist/chunk-TAGR72IR.js.map +0 -1
- package/dist/chunk-TIGPQDYP.js +0 -14
- package/dist/chunk-TIGPQDYP.js.map +0 -1
- package/dist/chunk-U6JMEH2P.js.map +0 -1
- package/dist/chunk-UDSR4X4L.js.map +0 -1
- package/dist/chunk-UHNGNKLV.js.map +0 -1
- package/dist/chunk-VCBHAE4R.js.map +0 -1
- package/dist/chunk-VCTXU4AT.js.map +0 -1
- package/dist/chunk-VEALDPHW.js.map +0 -1
- package/dist/chunk-VKCADNMR.js.map +0 -1
- package/dist/chunk-VQNJ7UZL.js.map +0 -1
- package/dist/chunk-W2OG6JOL.js.map +0 -1
- package/dist/chunk-WG4QBZDN.js.map +0 -1
- package/dist/chunk-WHXXI3W5.js.map +0 -1
- package/dist/chunk-WKGF2TJR.js.map +0 -1
- package/dist/chunk-WNGGJWF7.js.map +0 -1
- package/dist/chunk-XTHCN77N.js.map +0 -1
- package/dist/chunk-YCH5GBN6.js +0 -99
- package/dist/chunk-YCH5GBN6.js.map +0 -1
- package/dist/chunk-YMUGBZN2.js.map +0 -1
- package/dist/collection-facade-KMBWNCYP.js +0 -44
- package/dist/cover-QJRXINN5.js +0 -52
- package/dist/delegation-SU6CV3W7.js +0 -25
- package/dist/derive-6RWU4EOA.js +0 -21
- package/dist/executor-KGNLJD6M.js +0 -9
- package/dist/executor-UX4FASYZ.js +0 -26
- package/dist/executor-XGIS6CR7.js +0 -9
- package/dist/export-accessible-LKW3QV22.js +0 -23
- package/dist/extract-partition-UP2ARO75.js +0 -38
- package/dist/find-YS6XWB46.js +0 -11
- package/dist/in/index.js +0 -1
- package/dist/issue-3ACYX7LO.js +0 -19
- package/dist/legacy/bundle.d.ts +0 -30
- package/dist/liberate-MQQXBUCY.js +0 -24
- package/dist/noydb-ANIW5FLE.js +0 -69
- package/dist/on/index.js +0 -17
- package/dist/port/as/index.d.ts +0 -26
- package/dist/port/at/index.d.ts +0 -18
- package/dist/port/in/index.d.ts +0 -21
- package/dist/port/on/index.d.ts +0 -27
- package/dist/port/ui/index.d.ts +0 -21
- package/dist/port/with/index.d.ts +0 -18
- package/dist/register-PAM3ASRZ.js +0 -23
- package/dist/registry-4S2U2TR4.js +0 -19
- package/dist/registry-NPOWJHC4.js +0 -9
- package/dist/registry-VZ3CCI2R.js +0 -18
- package/dist/request-withdrawal-DI3H5WUI.js +0 -31
- package/dist/revoke-R5CZSVUT.js +0 -24
- package/dist/seed-3ZMF5EQA.js.map +0 -1
- package/dist/signer-MBVHW4WE.js +0 -25
- package/dist/storage-3MEJUENZ.js +0 -23
- package/dist/tx/index.js.map +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/with/index.js +0 -31
- package/dist/with-lookup/aggregate/index.d.ts +0 -23
- package/dist/withdraw-accessible-TZDATQVR.js +0 -28
- /package/dist/{api-3A3S4SHH.js.map → api-ZDKTWNBB.js.map} +0 -0
- /package/dist/{backup-YPUEKIJC.js.map → backup-2UX7PRM5.js.map} +0 -0
- /package/dist/{chunk-IY23KFNZ.js.map → chunk-35NMVJ7I.js.map} +0 -0
- /package/dist/{chunk-RTEK4C4I.js.map → chunk-4JQK3L4V.js.map} +0 -0
- /package/dist/{chunk-3ELCWU56.js.map → chunk-4ZKNC6A6.js.map} +0 -0
- /package/dist/{chunk-VAIS3SOM.js.map → chunk-55LX6FSX.js.map} +0 -0
- /package/dist/{chunk-6HPG2YNX.js.map → chunk-5DRROK5W.js.map} +0 -0
- /package/dist/{chunk-S6Q37VGE.js.map → chunk-5GQEU4DN.js.map} +0 -0
- /package/dist/{chunk-ZXEZCY6F.js.map → chunk-63FE525P.js.map} +0 -0
- /package/dist/{chunk-JVBO4SZL.js.map → chunk-6UBZ6I5Z.js.map} +0 -0
- /package/dist/{chunk-VRBTNCM4.js.map → chunk-ABS7FMMD.js.map} +0 -0
- /package/dist/{chunk-M75ZZHSR.js.map → chunk-BLBAQRBM.js.map} +0 -0
- /package/dist/{chunk-WOM2HTML.js.map → chunk-CI32CAFS.js.map} +0 -0
- /package/dist/{chunk-EO43ANYJ.js.map → chunk-DABACXEF.js.map} +0 -0
- /package/dist/{chunk-CJ5KKU6X.js.map → chunk-DMH3VZU5.js.map} +0 -0
- /package/dist/{chunk-WZSHL6DQ.js.map → chunk-DZ2JXHWK.js.map} +0 -0
- /package/dist/{chunk-Z4PD65VQ.js.map → chunk-EE7UHLKH.js.map} +0 -0
- /package/dist/{chunk-RNG4VRP4.js.map → chunk-EKRSCRNM.js.map} +0 -0
- /package/dist/{chunk-MT62YSPZ.js.map → chunk-FRMPM7WG.js.map} +0 -0
- /package/dist/{as/index.js.map → chunk-GJW4HX2O.js.map} +0 -0
- /package/dist/{chunk-KS6SAVCZ.js.map → chunk-GU3IP74F.js.map} +0 -0
- /package/dist/{chunk-SMIRGMS7.js.map → chunk-IXNCZTWA.js.map} +0 -0
- /package/dist/{chunk-WQIYTNJV.js.map → chunk-IXTSNGYY.js.map} +0 -0
- /package/dist/{chunk-NCCBLYEB.js.map → chunk-JJZGIE4U.js.map} +0 -0
- /package/dist/{chunk-DRWBEDYO.js.map → chunk-JYJFGD2H.js.map} +0 -0
- /package/dist/{chunk-XJMBYYQK.js.map → chunk-LNZKOUJR.js.map} +0 -0
- /package/dist/{chunk-R3BLCFD2.js.map → chunk-MBKVNOJS.js.map} +0 -0
- /package/dist/{chunk-N6WF5PKC.js.map → chunk-NFZGZ4AK.js.map} +0 -0
- /package/dist/{chunk-THVIPWRF.js.map → chunk-PEATRIYJ.js.map} +0 -0
- /package/dist/{chunk-YZQOGE2L.js.map → chunk-QDIH2744.js.map} +0 -0
- /package/dist/{chunk-6HY2X62D.js.map → chunk-QJNCB5SK.js.map} +0 -0
- /package/dist/{chunk-2PCAVW2I.js.map → chunk-SHEEBRZ4.js.map} +0 -0
- /package/dist/{chunk-RA5VTXXG.js.map → chunk-V6UQZA2H.js.map} +0 -0
- /package/dist/{chunk-QDPZWTN2.js.map → chunk-W3G5REIU.js.map} +0 -0
- /package/dist/{chunk-A4FXFAKF.js.map → chunk-W3L64Y3J.js.map} +0 -0
- /package/dist/{chunk-XDIAFPUM.js.map → chunk-WLXMTYGO.js.map} +0 -0
- /package/dist/{chunk-RJ6K6K5M.js.map → chunk-X3F5YJG2.js.map} +0 -0
- /package/dist/{chunk-YTGDPCPW.js.map → chunk-Y6B6HVKC.js.map} +0 -0
- /package/dist/{classified-marker-QWMASIT7.js.map → classified-marker-7PKJBFCG.js.map} +0 -0
- /package/dist/{at/index.js.map → collection-facade-6I5K5IOD.js.map} +0 -0
- /package/dist/{by/index.js.map → computed-AB45PS4V.js.map} +0 -0
- /package/dist/{in → cover}/index.js.map +0 -0
- /package/dist/{on → custody}/index.js.map +0 -0
- /package/dist/{dead-filter-66VGI6JV.js.map → dead-filter-FL3WIUZS.js.map} +0 -0
- /package/dist/{chunk-CHFZDSE4.js.map → derive-VGS7FKE3.js.map} +0 -0
- /package/dist/{ui → directory}/index.js.map +0 -0
- /package/dist/{collection-facade-KMBWNCYP.js.map → enclave-SPEEDYZ4.js.map} +0 -0
- /package/dist/{computed-DSMPXG2Y.js.map → executor-IEBLTBCW.js.map} +0 -0
- /package/dist/{cover-QJRXINN5.js.map → executor-OTF556PL.js.map} +0 -0
- /package/dist/{delegation-SU6CV3W7.js.map → executor-RM7XWQDU.js.map} +0 -0
- /package/dist/{derive-6RWU4EOA.js.map → export-accessible-P42BQ4PB.js.map} +0 -0
- /package/dist/{enclave-TKPN2G2U.js.map → extract-partition-TCYXRWBN.js.map} +0 -0
- /package/dist/{fanout-sidecar-B5LVUMQX.js.map → fanout-sidecar-SSMRSC2L.js.map} +0 -0
- /package/dist/{executor-KGNLJD6M.js.map → find-OZMTRIK3.js.map} +0 -0
- /package/dist/{with → introspection}/index.js.map +0 -0
- /package/dist/{executor-UX4FASYZ.js.map → issue-FCKN5O6C.js.map} +0 -0
- /package/dist/{executor-XGIS6CR7.js.map → ledger-6XBEVWYP.js.map} +0 -0
- /package/dist/{export-accessible-LKW3QV22.js.map → liberate-CYUOS4NC.js.map} +0 -0
- /package/dist/{extract-partition-UP2ARO75.js.map → link-set-NK6L2A5S.js.map} +0 -0
- /package/dist/{find-YS6XWB46.js.map → money/index.js.map} +0 -0
- /package/dist/{issue-3ACYX7LO.js.map → noydb-FZZIMLCI.js.map} +0 -0
- /package/dist/{ledger-PTK7XZYT.js.map → policy/index.js.map} +0 -0
- /package/dist/{post-register-2YHSADFI.js.map → post-register-VFIYISUK.js.map} +0 -0
- /package/dist/{liberate-MQQXBUCY.js.map → register-UKU2J6MN.js.map} +0 -0
- /package/dist/{link-set-SLJHDNRB.js.map → registry-2VCWVHZS.js.map} +0 -0
- /package/dist/{noydb-ANIW5FLE.js.map → registry-7Y5WF7GS.js.map} +0 -0
- /package/dist/{policy-YDLCOX4P.js.map → registry-BWD2ED52.js.map} +0 -0
- /package/dist/{register-PAM3ASRZ.js.map → registry-DTWRJLSF.js.map} +0 -0
- /package/dist/{registry-4S2U2TR4.js.map → request-withdrawal-JYDZ5XY2.js.map} +0 -0
- /package/dist/{reveal-HWO4YMTJ.js.map → reveal-CL2BCW6A.js.map} +0 -0
- /package/dist/{registry-NPOWJHC4.js.map → revoke-2TSAD2T4.js.map} +0 -0
- /package/dist/{registry-VW6P6A3J.js.map → schema-update/index.js.map} +0 -0
- /package/dist/{registry-VZ3CCI2R.js.map → search/index.js.map} +0 -0
- /package/dist/{request-withdrawal-DI3H5WUI.js.map → sequence/index.js.map} +0 -0
- /package/dist/{revoke-R5CZSVUT.js.map → signer-K7Z2EOMG.js.map} +0 -0
- /package/dist/{signer-MBVHW4WE.js.map → stale-A4J26OIC.js.map} +0 -0
- /package/dist/{stale-VZL4OGUB.js.map → storage-YVHZUISN.js.map} +0 -0
- /package/dist/{storage-3MEJUENZ.js.map → store/index.js.map} +0 -0
- /package/dist/{store-coordination-provider-FKX3F6TQ.js.map → store-coordination-provider-EWRZL7XF.js.map} +0 -0
- /package/dist/{verify-26Y5GNMK.js.map → verify-7XWHJWUN.js.map} +0 -0
- /package/dist/{withdraw-accessible-TZDATQVR.js.map → walk-P5D6CF4V.js.map} +0 -0
- /package/dist/with-lookup/{aggregate → reduce}/canonical-key.d.ts +0 -0
- /package/dist/{with-party → with-sync}/tab-coordination.d.ts +0 -0
- /package/dist/{with-party → with-sync}/tab-write-relay.d.ts +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portal share-link grammar + parse/build helper (#806).
|
|
3
|
+
*
|
|
4
|
+
* ONE canonical link grammar addresses `vault / period / collection /
|
|
5
|
+
* record` across all three portal surfaces — the LIFF permalink path
|
|
6
|
+
* (`https://liff.line.me/{liffId}/r/…`), the installed-PWA same-origin
|
|
7
|
+
* path (`https://{portal-origin}/r/…`), and the vendor backend console.
|
|
8
|
+
* The link SHAPE is identical everywhere; only the origin prefix
|
|
9
|
+
* differs, and callers own the prefix.
|
|
10
|
+
*
|
|
11
|
+
* ## Grammar (frozen — see `__tests__/share-link-surface.golden.json`)
|
|
12
|
+
*
|
|
13
|
+
* ```
|
|
14
|
+
* share-link = [ base ] "/r/" vault "/" collection "/" record
|
|
15
|
+
* [ "?" query ] [ "#" fragment ]
|
|
16
|
+
* vault = ULID ; 26 uppercase Crockford base32 chars
|
|
17
|
+
* collection = segment ; opaque, non-empty after decode
|
|
18
|
+
* record = segment ; opaque, non-empty after decode
|
|
19
|
+
* query = pair *( "&" pair ) ; keys unique; ONLY these two keys
|
|
20
|
+
* pair = "period=" component ; opaque period id
|
|
21
|
+
* / "v=" version ; record version
|
|
22
|
+
* version = "0" / %x31-39 *DIGIT ; base-10 integer, ≤ 2^53 − 1
|
|
23
|
+
* fragment = "g=" component ; single-use grant token (opaque)
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* `segment` / `component` are strict-canonical `encodeURIComponent`
|
|
27
|
+
* output: decoding then re-encoding MUST reproduce the raw text exactly
|
|
28
|
+
* (uppercase-hex escapes, `+` is a literal plus never a space, `%2F`
|
|
29
|
+
* inside a segment never creates an extra segment). Path segments
|
|
30
|
+
* additionally may not decode to `.` or `..`. Links produced by
|
|
31
|
+
* {@link buildShareLink} always satisfy this; hand-written links using
|
|
32
|
+
* only unreserved characters (`inv-001`, ULIDs, …) do too.
|
|
33
|
+
*
|
|
34
|
+
* ## Transport rule for the grant token
|
|
35
|
+
*
|
|
36
|
+
* The optional single-use grant token travels ONLY in the URL fragment
|
|
37
|
+
* (`#g={token}`) — never in the path or query — because fragments are
|
|
38
|
+
* not sent to servers, so the token never reaches server logs, CDNs, or
|
|
39
|
+
* LINE's infrastructure. Same rule `on-magic-link` follows. The token is
|
|
40
|
+
* fully OPAQUE here: no validation beyond non-empty, no decoding of its
|
|
41
|
+
* semantics — grant semantics live in `on-magic-link` (not imported).
|
|
42
|
+
*
|
|
43
|
+
* ## Fail closed
|
|
44
|
+
*
|
|
45
|
+
* {@link parseShareLink} throws a typed {@link ShareLinkParseError} for
|
|
46
|
+
* ANYTHING that is not exactly the grammar above — unknown prefix,
|
|
47
|
+
* missing/extra/empty/malformed segments, a non-ULID vault handle,
|
|
48
|
+
* duplicate or unknown query keys, malformed fragments. There is never a
|
|
49
|
+
* default-vault (or any other) fallback; the app maps the error to a 404.
|
|
50
|
+
*
|
|
51
|
+
* Zero dependencies on the hub floor: pure string/`URL` code, no crypto,
|
|
52
|
+
* no store — LIFF shells, PWAs, and klum-db can import this subpath
|
|
53
|
+
* without dragging anything else. (The one internal import is the pure,
|
|
54
|
+
* leaf ULID shape check shared with the pod format.)
|
|
55
|
+
*/
|
|
56
|
+
/** Machine-readable {@link ShareLinkParseError} discriminant. */
|
|
57
|
+
export type ShareLinkErrorCode = 'MALFORMED_URL' | 'UNKNOWN_PREFIX' | 'MALFORMED_PATH' | 'MALFORMED_SEGMENT' | 'INVALID_VAULT_HANDLE' | 'MALFORMED_QUERY' | 'DUPLICATE_QUERY_KEY' | 'UNKNOWN_QUERY_KEY' | 'INVALID_VERSION' | 'MALFORMED_FRAGMENT' | 'INVALID_PARTS';
|
|
58
|
+
/**
|
|
59
|
+
* Typed failure for the share-link grammar. Thrown by
|
|
60
|
+
* {@link parseShareLink} for any input outside the grammar (fail closed —
|
|
61
|
+
* map to an app-level 404, never a default-vault fallback), and by
|
|
62
|
+
* {@link buildShareLink} with code `'INVALID_PARTS'` when the caller
|
|
63
|
+
* hands it parts that could not round-trip.
|
|
64
|
+
*
|
|
65
|
+
* Standalone (`extends Error`, not `NoydbError`) so this subpath stays
|
|
66
|
+
* import-light; the `code` field follows the same machine-readable
|
|
67
|
+
* convention as the kernel error classes.
|
|
68
|
+
*/
|
|
69
|
+
export declare class ShareLinkParseError extends Error {
|
|
70
|
+
/** Machine-readable error code. Stable across library versions. */
|
|
71
|
+
readonly code: ShareLinkErrorCode;
|
|
72
|
+
constructor(code: ShareLinkErrorCode, message: string);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The logical address a share link carries. Input to
|
|
76
|
+
* {@link buildShareLink}; {@link parseShareLink} returns the same shape
|
|
77
|
+
* (as the readonly {@link ShareLink} alias) with optional fields OMITTED
|
|
78
|
+
* (not `undefined`) when absent from the link.
|
|
79
|
+
*/
|
|
80
|
+
export interface ShareLinkParts {
|
|
81
|
+
/** Vault handle — a 26-character uppercase Crockford-base32 ULID. */
|
|
82
|
+
vaultHandle: string;
|
|
83
|
+
/** Collection name — opaque, non-empty. */
|
|
84
|
+
collection: string;
|
|
85
|
+
/** Record id — opaque, non-empty. */
|
|
86
|
+
recordId: string;
|
|
87
|
+
/** Optional period id (`?period=`) — opaque, non-empty. */
|
|
88
|
+
period?: string;
|
|
89
|
+
/** Optional record version (`?v=`) — non-negative safe integer. */
|
|
90
|
+
version?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Optional single-use grant token (`#g=`) — opaque, non-empty. Carried
|
|
93
|
+
* ONLY in the URL fragment; semantics belong to `on-magic-link`.
|
|
94
|
+
*/
|
|
95
|
+
grantToken?: string;
|
|
96
|
+
}
|
|
97
|
+
/** A successfully parsed share link. See {@link ShareLinkParts}. */
|
|
98
|
+
export type ShareLink = Readonly<ShareLinkParts>;
|
|
99
|
+
/**
|
|
100
|
+
* Parse a share link — full URL, `URL` instance, or bare `/r/…` path.
|
|
101
|
+
*
|
|
102
|
+
* A LIFF permalink prefix is tolerated: when the path does not start
|
|
103
|
+
* with `/r/` directly, the share path is taken from the FIRST `/r/`
|
|
104
|
+
* segment boundary (`https://liff.line.me/{liffId}/r/…` → `/r/…`). No
|
|
105
|
+
* fuzzy matching beyond that single rule.
|
|
106
|
+
*
|
|
107
|
+
* Fail closed: anything outside the grammar throws
|
|
108
|
+
* {@link ShareLinkParseError}. Never a default-vault fallback.
|
|
109
|
+
*/
|
|
110
|
+
export declare function parseShareLink(input: string | URL): ShareLink;
|
|
111
|
+
/**
|
|
112
|
+
* Build a RELATIVE share link (`/r/…`) from typed parts. Callers prefix
|
|
113
|
+
* their surface origin — the LIFF permalink base, the PWA origin, or the
|
|
114
|
+
* vendor console — either themselves or via `base`, which is prepended
|
|
115
|
+
* VERBATIM (no validation, no joining logic; pass it without a trailing
|
|
116
|
+
* slash, e.g. `https://liff.line.me/{liffId}`).
|
|
117
|
+
*
|
|
118
|
+
* The grant token, when present, is emitted ONLY as the `#g=` fragment.
|
|
119
|
+
* Invalid parts throw {@link ShareLinkParseError} with code
|
|
120
|
+
* `'INVALID_PARTS'` — every built link is guaranteed to round-trip
|
|
121
|
+
* through {@link parseShareLink}.
|
|
122
|
+
*/
|
|
123
|
+
export declare function buildShareLink(parts: ShareLinkParts, base?: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATTESTATIONS_COLLECTION,
|
|
3
|
+
REVOKED_RECORD_ID,
|
|
4
|
+
SIGNER_RECORD_ID,
|
|
5
|
+
loadOrCreateSigner,
|
|
6
|
+
loadSigner
|
|
7
|
+
} from "./chunk-CI32CAFS.js";
|
|
8
|
+
import "./chunk-G2JUIDFA.js";
|
|
9
|
+
import "./chunk-W3L64Y3J.js";
|
|
10
|
+
import "./chunk-35NMVJ7I.js";
|
|
11
|
+
import "./chunk-NFZGZ4AK.js";
|
|
12
|
+
import "./chunk-QJNCB5SK.js";
|
|
13
|
+
import "./chunk-LP7BEXCT.js";
|
|
14
|
+
import "./chunk-AKKRXT23.js";
|
|
15
|
+
import "./chunk-QBAC3GXA.js";
|
|
16
|
+
import "./chunk-QZWTRENR.js";
|
|
17
|
+
import "./chunk-PZ5AY32C.js";
|
|
18
|
+
export {
|
|
19
|
+
ATTESTATIONS_COLLECTION,
|
|
20
|
+
REVOKED_RECORD_ID,
|
|
21
|
+
SIGNER_RECORD_ID,
|
|
22
|
+
loadOrCreateSigner,
|
|
23
|
+
loadSigner
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=signer-K7Z2EOMG.js.map
|
package/dist/snapshots/index.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NO_SNAPSHOTS
|
|
3
|
+
} from "../chunk-DZFQVICS.js";
|
|
1
4
|
import {
|
|
2
5
|
readPod,
|
|
3
6
|
writePod
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-LNPUSMZL.js";
|
|
8
|
+
import "../chunk-TUXQSFHZ.js";
|
|
9
|
+
import "../chunk-G2JUIDFA.js";
|
|
10
|
+
import "../chunk-W3L64Y3J.js";
|
|
11
|
+
import "../chunk-35NMVJ7I.js";
|
|
12
|
+
import "../chunk-NFZGZ4AK.js";
|
|
13
|
+
import "../chunk-QJNCB5SK.js";
|
|
11
14
|
import "../chunk-LP7BEXCT.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-AKKRXT23.js";
|
|
16
|
+
import "../chunk-QBAC3GXA.js";
|
|
14
17
|
import {
|
|
15
18
|
SnapshotNotFoundError
|
|
16
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-QZWTRENR.js";
|
|
17
20
|
import "../chunk-PZ5AY32C.js";
|
|
18
21
|
|
|
19
22
|
// src/with-fork/snapshots/engine.ts
|
|
@@ -154,6 +157,7 @@ function withSnapshots(opts) {
|
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
159
|
export {
|
|
160
|
+
NO_SNAPSHOTS,
|
|
157
161
|
SnapshotNotFoundError,
|
|
158
162
|
withSnapshots
|
|
159
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/with-fork/snapshots/engine.ts","../../src/with-fork/snapshots/active.ts"],"sourcesContent":["import { writePod, readPod } from '../../with-pod/bundle.js'\nimport { SnapshotNotFoundError } from '../../kernel/errors.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { SnapshotMeta, RetentionPolicy, SnapshotIndex } from './strategy.js'\n\nexport class SnapshotEngine {\n constructor(\n private readonly store: NoydbPodStore,\n private readonly retention: RetentionPolicy,\n ) {}\n\n private indexKey(vaultName: string): string {\n return `${vaultName}__index`\n }\n\n private snapKey(vaultName: string, n: number): string {\n return `${vaultName}__snap_${n.toString().padStart(6, '0')}`\n }\n\n private autoKey(vaultName: string): string {\n return `${vaultName}__auto`\n }\n\n private async readIndex(\n vaultName: string,\n ): Promise<{ index: SnapshotIndex; indexVersion: string | null }> {\n const result = await this.store.readBundle(this.indexKey(vaultName))\n if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null }\n const text = new TextDecoder().decode(result.bytes)\n return { index: JSON.parse(text) as SnapshotIndex, indexVersion: result.version }\n }\n\n private async writeIndex(\n vaultName: string,\n index: SnapshotIndex,\n expectedVersion: string | null,\n ): Promise<void> {\n const bytes = new TextEncoder().encode(JSON.stringify(index))\n await this.store.writeBundle(this.indexKey(vaultName), bytes, expectedVersion)\n }\n\n async snapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.snapKey(vault.name, index.nextCounter)\n\n // Write blob first. If the subsequent index write fails, the next snapshot()\n // call will re-derive the same key (counter not persisted) and overwrite this blob.\n // This is an accepted v1 trade-off: failure window is narrow and requires a store\n // error between the two writes. A retry produces a fresh snapshot at the same key.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n ...(opts?.label !== undefined ? { label: opts.label } : {}),\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n }\n\n const newIndex: SnapshotIndex = {\n snapshots: [...index.snapshots, meta],\n nextCounter: index.nextCounter + 1,\n // Preserve the rolling auto slot — on-demand snapshots never touch it.\n ...(index.auto ? { auto: index.auto } : {}),\n }\n const toDelete = this.applyRetention(newIndex)\n await this.writeIndex(vault.name, newIndex, indexVersion)\n\n for (const k of toDelete) {\n await this.store.deleteBundle(k)\n }\n\n return meta\n }\n\n /**\n * Rolling auto-snapshot. Overwrites the single fixed `<vault>__auto` key and\n * stores its meta in `index.auto`, separate from the immutable `snapshots`\n * pool — retention never prunes it. Used by the cadence scheduler.\n */\n async autoSnapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.autoKey(vault.name)\n\n // Unconditional overwrite of the rolling slot.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n label: opts?.label ?? 'auto',\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n auto: true,\n }\n\n index.auto = meta\n await this.writeIndex(vault.name, index, indexVersion)\n return meta\n }\n\n async listSnapshots(vaultId: string): Promise<SnapshotMeta[]> {\n const { index } = await this.readIndex(vaultId)\n const immutable = [...index.snapshots].reverse()\n return index.auto ? [index.auto, ...immutable] : immutable\n }\n\n async restoreSnapshot(vault: Vault, version: string): Promise<void> {\n if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version)\n const result = await this.store.readBundle(version)\n if (!result) throw new SnapshotNotFoundError(version)\n const { dumpJson } = await readPod(result.bytes)\n await vault.load(dumpJson)\n }\n\n /**\n * Applies the configured retention policy to `index`, mutating `index.snapshots`\n * in place and returning the blob keys that should be deleted from the store.\n * Called by `snapshot()` before the index is written.\n *\n * @internal — public for direct testing only\n */\n applyRetention(index: SnapshotIndex): string[] {\n const prune = this.retention.prune ?? true\n if (!prune) return []\n\n const toDelete: string[] = []\n let remaining = index.snapshots.slice()\n\n if (this.retention.keepLast !== undefined && remaining.length > this.retention.keepLast) {\n const excess = remaining.splice(0, remaining.length - this.retention.keepLast)\n toDelete.push(...excess.map(m => m.version))\n }\n\n if (this.retention.maxAgeDays !== undefined) {\n const cutoffMs = this.retention.maxAgeDays * 86_400_000\n const now = Date.now()\n const fresh = remaining.filter(m => now - new Date(m.exportedAt).getTime() <= cutoffMs)\n toDelete.push(...remaining.filter(m => !fresh.includes(m)).map(m => m.version))\n remaining = fresh\n }\n\n index.snapshots = remaining\n return toDelete\n }\n}\n","import { SnapshotEngine } from './engine.js'\nimport type { SnapshotStrategy, RetentionPolicy } from './strategy.js'\nimport type { SnapshotPolicy } from './policy.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\n\nexport interface WithSnapshotsOptions {\n /** Bundle store where snapshot blobs and the sidecar index are written. */\n store: NoydbPodStore\n /**\n * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.\n * Defaults to no retention (all on-demand snapshots kept forever). Never affects\n * the rolling auto-snapshot.\n */\n retention?: RetentionPolicy\n /**\n * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots\n * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots\n * to the rolling `<vault>__auto` key.\n */\n snapshotPolicy?: SnapshotPolicy\n}\n\nexport function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy {\n const engine = new SnapshotEngine(opts.store, opts.retention ?? {})\n return {\n snapshot(vault, by, snapOpts) {\n return engine.snapshot(vault as Vault, by, snapOpts)\n },\n listSnapshots(vaultId) {\n return engine.listSnapshots(vaultId)\n },\n restoreSnapshot(vault, version) {\n return engine.restoreSnapshot(vault as Vault, version)\n },\n autoSnapshot(vault, by, snapOpts) {\n return engine.autoSnapshot(vault as Vault, by, snapOpts)\n },\n ...(opts.snapshotPolicy ? { policy: opts.snapshotPolicy } : {}),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMO,IAAM,iBAAN,MAAqB;AAAA,EAC1B,YACmB,OACA,WACjB;AAFiB;AACA;AAAA,EAChB;AAAA,EAFgB;AAAA,EACA;AAAA,EAGX,SAAS,WAA2B;AAC1C,WAAO,GAAG,SAAS;AAAA,EACrB;AAAA,EAEQ,QAAQ,WAAmB,GAAmB;AACpD,WAAO,GAAG,SAAS,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;AAAA,EAC5D;AAAA,EAEQ,QAAQ,WAA2B;AACzC,WAAO,GAAG,SAAS;AAAA,EACrB;AAAA,EAEA,MAAc,UACZ,WACgE;AAChE,UAAM,SAAS,MAAM,KAAK,MAAM,WAAW,KAAK,SAAS,SAAS,CAAC;AACnE,QAAI,CAAC,OAAQ,QAAO,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,aAAa,EAAE,GAAG,cAAc,KAAK;AACnF,UAAM,OAAO,IAAI,YAAY,EAAE,OAAO,OAAO,KAAK;AAClD,WAAO,EAAE,OAAO,KAAK,MAAM,IAAI,GAAoB,cAAc,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../src/with-fork/snapshots/active.ts"],"sourcesContent":["import { writePod, readPod } from '../../with-pod/bundle.js'\nimport { SnapshotNotFoundError } from '../../kernel/errors.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { SnapshotMeta, RetentionPolicy, SnapshotIndex } from './strategy.js'\n\nexport class SnapshotEngine {\n constructor(\n private readonly store: NoydbPodStore,\n private readonly retention: RetentionPolicy,\n ) {}\n\n private indexKey(vaultName: string): string {\n return `${vaultName}__index`\n }\n\n private snapKey(vaultName: string, n: number): string {\n return `${vaultName}__snap_${n.toString().padStart(6, '0')}`\n }\n\n private autoKey(vaultName: string): string {\n return `${vaultName}__auto`\n }\n\n private async readIndex(\n vaultName: string,\n ): Promise<{ index: SnapshotIndex; indexVersion: string | null }> {\n const result = await this.store.readBundle(this.indexKey(vaultName))\n if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null }\n const text = new TextDecoder().decode(result.bytes)\n return { index: JSON.parse(text) as SnapshotIndex, indexVersion: result.version }\n }\n\n private async writeIndex(\n vaultName: string,\n index: SnapshotIndex,\n expectedVersion: string | null,\n ): Promise<void> {\n const bytes = new TextEncoder().encode(JSON.stringify(index))\n await this.store.writeBundle(this.indexKey(vaultName), bytes, expectedVersion)\n }\n\n async snapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.snapKey(vault.name, index.nextCounter)\n\n // Write blob first. If the subsequent index write fails, the next snapshot()\n // call will re-derive the same key (counter not persisted) and overwrite this blob.\n // This is an accepted v1 trade-off: failure window is narrow and requires a store\n // error between the two writes. A retry produces a fresh snapshot at the same key.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n ...(opts?.label !== undefined ? { label: opts.label } : {}),\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n }\n\n const newIndex: SnapshotIndex = {\n snapshots: [...index.snapshots, meta],\n nextCounter: index.nextCounter + 1,\n // Preserve the rolling auto slot — on-demand snapshots never touch it.\n ...(index.auto ? { auto: index.auto } : {}),\n }\n const toDelete = this.applyRetention(newIndex)\n await this.writeIndex(vault.name, newIndex, indexVersion)\n\n for (const k of toDelete) {\n await this.store.deleteBundle(k)\n }\n\n return meta\n }\n\n /**\n * Rolling auto-snapshot. Overwrites the single fixed `<vault>__auto` key and\n * stores its meta in `index.auto`, separate from the immutable `snapshots`\n * pool — retention never prunes it. Used by the cadence scheduler.\n */\n async autoSnapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writePod(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.autoKey(vault.name)\n\n // Unconditional overwrite of the rolling slot.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n label: opts?.label ?? 'auto',\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n auto: true,\n }\n\n index.auto = meta\n await this.writeIndex(vault.name, index, indexVersion)\n return meta\n }\n\n async listSnapshots(vaultId: string): Promise<SnapshotMeta[]> {\n const { index } = await this.readIndex(vaultId)\n const immutable = [...index.snapshots].reverse()\n return index.auto ? [index.auto, ...immutable] : immutable\n }\n\n async restoreSnapshot(vault: Vault, version: string): Promise<void> {\n if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version)\n const result = await this.store.readBundle(version)\n if (!result) throw new SnapshotNotFoundError(version)\n const { dumpJson } = await readPod(result.bytes)\n await vault.load(dumpJson)\n }\n\n /**\n * Applies the configured retention policy to `index`, mutating `index.snapshots`\n * in place and returning the blob keys that should be deleted from the store.\n * Called by `snapshot()` before the index is written.\n *\n * @internal — public for direct testing only\n */\n applyRetention(index: SnapshotIndex): string[] {\n const prune = this.retention.prune ?? true\n if (!prune) return []\n\n const toDelete: string[] = []\n let remaining = index.snapshots.slice()\n\n if (this.retention.keepLast !== undefined && remaining.length > this.retention.keepLast) {\n const excess = remaining.splice(0, remaining.length - this.retention.keepLast)\n toDelete.push(...excess.map(m => m.version))\n }\n\n if (this.retention.maxAgeDays !== undefined) {\n const cutoffMs = this.retention.maxAgeDays * 86_400_000\n const now = Date.now()\n const fresh = remaining.filter(m => now - new Date(m.exportedAt).getTime() <= cutoffMs)\n toDelete.push(...remaining.filter(m => !fresh.includes(m)).map(m => m.version))\n remaining = fresh\n }\n\n index.snapshots = remaining\n return toDelete\n }\n}\n","import { SnapshotEngine } from './engine.js'\nimport type { SnapshotsStrategy, RetentionPolicy } from './strategy.js'\nimport type { SnapshotPolicy } from './policy.js'\nimport type { NoydbPodStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\n\nexport interface WithSnapshotsOptions {\n /** Bundle store where snapshot blobs and the sidecar index are written. */\n store: NoydbPodStore\n /**\n * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.\n * Defaults to no retention (all on-demand snapshots kept forever). Never affects\n * the rolling auto-snapshot.\n */\n retention?: RetentionPolicy\n /**\n * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots\n * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots\n * to the rolling `<vault>__auto` key.\n */\n snapshotPolicy?: SnapshotPolicy\n}\n\nexport function withSnapshots(opts: WithSnapshotsOptions): SnapshotsStrategy {\n const engine = new SnapshotEngine(opts.store, opts.retention ?? {})\n return {\n snapshot(vault, by, snapOpts) {\n return engine.snapshot(vault as Vault, by, snapOpts)\n },\n listSnapshots(vaultId) {\n return engine.listSnapshots(vaultId)\n },\n restoreSnapshot(vault, version) {\n return engine.restoreSnapshot(vault as Vault, version)\n },\n autoSnapshot(vault, by, snapOpts) {\n return engine.autoSnap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Q;AACtF,eAAS,KAAK,GAAG,UAAU,OAAO,OAAK,CAAC,MAAM,SAAS,CAAC,CAAC,EAAE,IAAI,OAAK,EAAE,OAAO,CAAC;AAC9E,kBAAY;AAAA,IACd;AAEA,UAAM,YAAY;AAClB,WAAO;AAAA,EACT;AACF;;;ACzIO,SAAS,cAAc,MAA+C;AAC3E,QAAM,SAAS,IAAI,eAAe,KAAK,OAAO,KAAK,aAAa,CAAC,CAAC;AAClE,SAAO;AAAA,IACL,SAAS,OAAO,IAAI,UAAU;AAC5B,aAAO,OAAO,SAAS,OAAgB,IAAI,QAAQ;AAAA,IACrD;AAAA,IACA,cAAc,SAAS;AACrB,aAAO,OAAO,cAAc,OAAO;AAAA,IACrC;AAAA,IACA,gBAAgB,OAAO,SAAS;AAC9B,aAAO,OAAO,gBAAgB,OAAgB,OAAO;AAAA,IACvD;AAAA,IACA,aAAa,OAAO,IAAI,UAAU;AAChC,aAAO,OAAO,aAAa,OAAgB,IAAI,QAAQ;AAAA,IACzD;AAAA,IACA,GAAI,KAAK,iBAAiB,EAAE,QAAQ,KAAK,eAAe,IAAI,CAAC;AAAA,EAC/D;AACF;","names":[]}
|
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
isMVStale,
|
|
7
7
|
markMVStale,
|
|
8
8
|
resolveStaleMVOnRead
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-IYZISPGD.js";
|
|
10
|
+
import "./chunk-5D2ALSM5.js";
|
|
11
|
+
import "./chunk-G2JUIDFA.js";
|
|
12
|
+
import "./chunk-W3L64Y3J.js";
|
|
13
|
+
import "./chunk-35NMVJ7I.js";
|
|
14
|
+
import "./chunk-NFZGZ4AK.js";
|
|
15
|
+
import "./chunk-QJNCB5SK.js";
|
|
15
16
|
import "./chunk-LP7BEXCT.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-AKKRXT23.js";
|
|
18
|
+
import "./chunk-QBAC3GXA.js";
|
|
19
|
+
import "./chunk-QZWTRENR.js";
|
|
19
20
|
import "./chunk-PZ5AY32C.js";
|
|
20
21
|
export {
|
|
21
22
|
MV_STALE_COLLECTION,
|
|
@@ -26,4 +27,4 @@ export {
|
|
|
26
27
|
markMVStale,
|
|
27
28
|
resolveStaleMVOnRead
|
|
28
29
|
};
|
|
29
|
-
//# sourceMappingURL=stale-
|
|
30
|
+
//# sourceMappingURL=stale-A4J26OIC.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SCHEMAS_COLLECTION,
|
|
3
|
+
loadPersistedSchema,
|
|
4
|
+
loadPersistedSchemaEntry,
|
|
5
|
+
savePersistedSchema
|
|
6
|
+
} from "./chunk-DMH3VZU5.js";
|
|
7
|
+
import "./chunk-G2JUIDFA.js";
|
|
8
|
+
import "./chunk-W3L64Y3J.js";
|
|
9
|
+
import "./chunk-35NMVJ7I.js";
|
|
10
|
+
import "./chunk-NFZGZ4AK.js";
|
|
11
|
+
import "./chunk-QJNCB5SK.js";
|
|
12
|
+
import "./chunk-LP7BEXCT.js";
|
|
13
|
+
import "./chunk-AKKRXT23.js";
|
|
14
|
+
import "./chunk-QBAC3GXA.js";
|
|
15
|
+
import "./chunk-QZWTRENR.js";
|
|
16
|
+
import "./chunk-PZ5AY32C.js";
|
|
17
|
+
export {
|
|
18
|
+
SCHEMAS_COLLECTION,
|
|
19
|
+
loadPersistedSchema,
|
|
20
|
+
loadPersistedSchemaEntry,
|
|
21
|
+
savePersistedSchema
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=storage-YVHZUISN.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
routeStore,
|
|
3
|
+
withCache,
|
|
4
|
+
withCircuitBreaker,
|
|
5
|
+
withHealthCheck,
|
|
6
|
+
withLogging,
|
|
7
|
+
withMetrics,
|
|
8
|
+
withRetry,
|
|
9
|
+
wrapStore
|
|
10
|
+
} from "../chunk-EIPVYUEP.js";
|
|
11
|
+
import "../chunk-PZ5AY32C.js";
|
|
12
|
+
export {
|
|
13
|
+
routeStore,
|
|
14
|
+
withCache,
|
|
15
|
+
withCircuitBreaker,
|
|
16
|
+
withHealthCheck,
|
|
17
|
+
withLogging,
|
|
18
|
+
withMetrics,
|
|
19
|
+
withRetry,
|
|
20
|
+
wrapStore
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/dist/{store-coordination-provider-FKX3F6TQ.js → store-coordination-provider-EWRZL7XF.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadFence,
|
|
3
3
|
saveFence
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LNZKOUJR.js";
|
|
5
5
|
import {
|
|
6
6
|
NOYDB_FORMAT_VERSION
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QBAC3GXA.js";
|
|
8
8
|
import "./chunk-PZ5AY32C.js";
|
|
9
9
|
|
|
10
10
|
// src/with-shape/schema-update/client-registry.ts
|
|
@@ -139,4 +139,4 @@ function unref(timer) {
|
|
|
139
139
|
export {
|
|
140
140
|
StoreCoordinationProvider
|
|
141
141
|
};
|
|
142
|
-
//# sourceMappingURL=store-coordination-provider-
|
|
142
|
+
//# sourceMappingURL=store-coordination-provider-EWRZL7XF.js.map
|
package/dist/sync/index.js
CHANGED
|
@@ -2,20 +2,23 @@ import {
|
|
|
2
2
|
PresenceHandle,
|
|
3
3
|
SyncEngine,
|
|
4
4
|
SyncTransaction
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-JDOMW53O.js";
|
|
6
|
+
import {
|
|
7
|
+
NO_SYNC
|
|
8
|
+
} from "../chunk-55LKVALY.js";
|
|
9
|
+
import "../chunk-NM5UYF6Q.js";
|
|
10
|
+
import "../chunk-G2JUIDFA.js";
|
|
11
|
+
import "../chunk-W3L64Y3J.js";
|
|
12
|
+
import "../chunk-35NMVJ7I.js";
|
|
13
|
+
import "../chunk-NFZGZ4AK.js";
|
|
14
|
+
import "../chunk-QJNCB5SK.js";
|
|
12
15
|
import "../chunk-LP7BEXCT.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-AKKRXT23.js";
|
|
17
|
+
import "../chunk-QBAC3GXA.js";
|
|
18
|
+
import "../chunk-QZWTRENR.js";
|
|
16
19
|
import "../chunk-PZ5AY32C.js";
|
|
17
20
|
|
|
18
|
-
// src/with-
|
|
21
|
+
// src/with-sync/active.ts
|
|
19
22
|
function withSync() {
|
|
20
23
|
return {
|
|
21
24
|
buildSyncEngine(opts) {
|
|
@@ -30,6 +33,7 @@ function withSync() {
|
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
export {
|
|
36
|
+
NO_SYNC,
|
|
33
37
|
withSync
|
|
34
38
|
};
|
|
35
39
|
//# sourceMappingURL=index.js.map
|
package/dist/sync/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/with-
|
|
1
|
+
{"version":3,"sources":["../../src/with-sync/active.ts"],"sourcesContent":["/**\n * Active sync strategy — `withSync()` returns the real implementation\n * that wires the `SyncEngine`, `SyncTransaction`, and `PresenceHandle`\n * constructors into the Noydb / Vault / Collection hot paths.\n *\n * Consumers opt in by:\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withSync } from '@noy-db/hub/sync'\n *\n * const db = await createNoydb({\n * store: localStore,\n * sync: remoteStore,\n * user: ...,\n * syncStrategy: withSync(),\n * })\n * ```\n *\n * The factory delegates to the existing `sync.ts`,\n * `sync-transaction.ts`, and `presence.ts` modules. Splitting the\n * import chain through this file is what lets tsup tree-shake the\n * ~856 LOC of replication + presence machinery out of the default\n * bundle when no `withSync()` import is present.\n *\n * Keyring + grant/revoke/magic-link/delegation stay in the always-on\n * core (or tree-shake via direct named imports) — those are required\n * for any multi-user vault, even purely local ones.\n *\n * @public\n */\n\nimport type { SyncStrategy, BuildSyncEngineOptions } from './strategy.js'\nimport type { PresenceHandleOpts } from './presence.js'\nimport type { Vault } from '../kernel/vault.js'\nimport { SyncEngine } from './engine.js'\nimport { SyncTransaction } from './transaction.js'\nimport { PresenceHandle } from './presence.js'\n\nexport function withSync(): SyncStrategy {\n return {\n buildSyncEngine(opts: BuildSyncEngineOptions): SyncEngine {\n return new SyncEngine(opts)\n },\n buildSyncTransaction(vault: Vault, engine: SyncEngine): SyncTransaction {\n return new SyncTransaction(vault, engine)\n },\n buildPresence<P>(opts: PresenceHandleOpts): PresenceHandle<P> {\n return new PresenceHandle<P>(opts)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL,gBAAgB,MAA0C;AACxD,aAAO,IAAI,WAAW,IAAI;AAAA,IAC5B;AAAA,IACA,qBAAqB,OAAc,QAAqC;AACtE,aAAO,IAAI,gBAAgB,OAAO,MAAM;AAAA,IAC1C;AAAA,IACA,cAAiB,MAA6C;AAC5D,aAAO,IAAI,eAAkB,IAAI;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
|
package/dist/team/index.js
CHANGED
|
@@ -1,46 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
|
-
credentialStatus,
|
|
3
|
-
deleteCredential,
|
|
4
|
-
getCredential,
|
|
5
|
-
listCredentials,
|
|
6
|
-
putCredential,
|
|
7
2
|
withTeam
|
|
8
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-5JOFWL4G.js";
|
|
9
4
|
import {
|
|
10
5
|
NO_TEAM,
|
|
6
|
+
burnPaperRecoveryEntry,
|
|
11
7
|
deriveMagicLinkContentKey,
|
|
8
|
+
describeAllUsersAuth,
|
|
9
|
+
describeAuthConfig,
|
|
10
|
+
describeUserAuth,
|
|
11
|
+
diagramAuthConfig,
|
|
12
12
|
enrollAuthenticator,
|
|
13
13
|
findAuthenticator,
|
|
14
14
|
isMagicLinkGrantExpired,
|
|
15
15
|
listMagicLinkGrants,
|
|
16
|
+
loadPaperRecoveryEntries,
|
|
16
17
|
magicLinkGrantRecordId,
|
|
18
|
+
mintPaperRecoveryEntry,
|
|
19
|
+
mintWrappedDeksBlob,
|
|
17
20
|
readMagicLinkGrantRecord,
|
|
18
|
-
|
|
21
|
+
recoverSecret,
|
|
19
22
|
recoverUser,
|
|
20
23
|
removeAuthenticator,
|
|
21
24
|
revokeMagicLinkGrant,
|
|
22
|
-
|
|
25
|
+
rotateSecret,
|
|
26
|
+
savePaperRecoveryEntries,
|
|
27
|
+
unwrapDeksFromBlob,
|
|
28
|
+
unwrapDeksFromPaperEntry,
|
|
23
29
|
unwrapMagicLinkGrant,
|
|
24
30
|
updateAuthenticator,
|
|
25
31
|
writeMagicLinkGrant
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import
|
|
28
|
-
burnPaperRecoveryEntry,
|
|
29
|
-
loadPaperRecoveryEntries,
|
|
30
|
-
mintPaperRecoveryEntry,
|
|
31
|
-
mintWrappedDeksBlob,
|
|
32
|
-
savePaperRecoveryEntries,
|
|
33
|
-
unwrapDeksFromBlob,
|
|
34
|
-
unwrapDeksFromPaperEntry
|
|
35
|
-
} from "../chunk-ANATMTOA.js";
|
|
36
|
-
import {
|
|
37
|
-
PresenceHandle,
|
|
38
|
-
SyncEngine,
|
|
39
|
-
SyncTransaction
|
|
40
|
-
} from "../chunk-HQBM64EE.js";
|
|
41
|
-
import "../chunk-VQNJ7UZL.js";
|
|
32
|
+
} from "../chunk-NFNJLRY7.js";
|
|
33
|
+
import "../chunk-WLXMTYGO.js";
|
|
42
34
|
import {
|
|
43
|
-
SYNC_CREDENTIALS_COLLECTION,
|
|
44
35
|
buildRecipientKeyringFile,
|
|
45
36
|
changeSecret,
|
|
46
37
|
createOwnerKeyring,
|
|
@@ -56,46 +47,42 @@ import {
|
|
|
56
47
|
persistKeyring,
|
|
57
48
|
revoke,
|
|
58
49
|
updateKeyringIdentity
|
|
59
|
-
} from "../chunk-
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-
|
|
62
|
-
import "../chunk-
|
|
63
|
-
import "../chunk-
|
|
64
|
-
import "../chunk-
|
|
65
|
-
import "../chunk-
|
|
66
|
-
import "../chunk-
|
|
50
|
+
} from "../chunk-BLCWSJLN.js";
|
|
51
|
+
import "../chunk-JJZGIE4U.js";
|
|
52
|
+
import "../chunk-PTHKZWEH.js";
|
|
53
|
+
import "../chunk-G2JUIDFA.js";
|
|
54
|
+
import "../chunk-W3L64Y3J.js";
|
|
55
|
+
import "../chunk-35NMVJ7I.js";
|
|
56
|
+
import "../chunk-NFZGZ4AK.js";
|
|
57
|
+
import "../chunk-QJNCB5SK.js";
|
|
67
58
|
import "../chunk-LP7BEXCT.js";
|
|
68
|
-
import "../chunk-
|
|
69
|
-
import "../chunk-
|
|
59
|
+
import "../chunk-AKKRXT23.js";
|
|
60
|
+
import "../chunk-QBAC3GXA.js";
|
|
70
61
|
import {
|
|
71
62
|
TeamNotEnabledError
|
|
72
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-QZWTRENR.js";
|
|
73
64
|
import "../chunk-PZ5AY32C.js";
|
|
74
65
|
export {
|
|
75
66
|
NO_TEAM,
|
|
76
|
-
PresenceHandle,
|
|
77
|
-
SYNC_CREDENTIALS_COLLECTION,
|
|
78
|
-
SyncEngine,
|
|
79
|
-
SyncTransaction,
|
|
80
67
|
TeamNotEnabledError,
|
|
81
68
|
buildRecipientKeyringFile,
|
|
82
69
|
burnPaperRecoveryEntry,
|
|
83
70
|
changeSecret,
|
|
84
71
|
createOwnerKeyring,
|
|
85
|
-
credentialStatus,
|
|
86
|
-
deleteCredential,
|
|
87
72
|
deriveMagicLinkContentKey,
|
|
73
|
+
describeAllUsersAuth,
|
|
74
|
+
describeAuthConfig,
|
|
75
|
+
describeUserAuth,
|
|
76
|
+
diagramAuthConfig,
|
|
88
77
|
enrollAuthenticator,
|
|
89
78
|
ensureCollectionDEK,
|
|
90
79
|
evaluateExportCapability,
|
|
91
80
|
evaluateImportCapability,
|
|
92
81
|
findAuthenticator,
|
|
93
|
-
getCredential,
|
|
94
82
|
grant,
|
|
95
83
|
hasExportCapability,
|
|
96
84
|
hasImportCapability,
|
|
97
85
|
isMagicLinkGrantExpired,
|
|
98
|
-
listCredentials,
|
|
99
86
|
listMagicLinkGrants,
|
|
100
87
|
listUsers,
|
|
101
88
|
listUsersWithEnvelopes,
|
|
@@ -105,14 +92,13 @@ export {
|
|
|
105
92
|
mintPaperRecoveryEntry,
|
|
106
93
|
mintWrappedDeksBlob,
|
|
107
94
|
persistKeyring,
|
|
108
|
-
putCredential,
|
|
109
95
|
readMagicLinkGrantRecord,
|
|
110
|
-
|
|
96
|
+
recoverSecret,
|
|
111
97
|
recoverUser,
|
|
112
98
|
removeAuthenticator,
|
|
113
99
|
revoke,
|
|
114
100
|
revokeMagicLinkGrant,
|
|
115
|
-
|
|
101
|
+
rotateSecret,
|
|
116
102
|
savePaperRecoveryEntries,
|
|
117
103
|
unwrapDeksFromBlob,
|
|
118
104
|
unwrapDeksFromPaperEntry,
|
package/dist/tiers/index.js
CHANGED
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
putAtTier,
|
|
12
12
|
syncDerivedOutputs,
|
|
13
13
|
withTiers
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-Y2NJBNX3.js";
|
|
15
|
+
import "../chunk-PTHKZWEH.js";
|
|
16
|
+
import "../chunk-G2JUIDFA.js";
|
|
17
|
+
import "../chunk-W3L64Y3J.js";
|
|
18
|
+
import "../chunk-35NMVJ7I.js";
|
|
19
|
+
import "../chunk-NFZGZ4AK.js";
|
|
20
|
+
import "../chunk-QJNCB5SK.js";
|
|
21
21
|
import "../chunk-LP7BEXCT.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-AKKRXT23.js";
|
|
23
|
+
import "../chunk-QBAC3GXA.js";
|
|
24
24
|
import {
|
|
25
25
|
TiersNotEnabledError
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-QZWTRENR.js";
|
|
27
27
|
import "../chunk-PZ5AY32C.js";
|
|
28
28
|
export {
|
|
29
29
|
NO_TIERS,
|
package/dist/to/index.js
CHANGED
|
@@ -3,12 +3,16 @@ import {
|
|
|
3
3
|
TxContext,
|
|
4
4
|
TxVault,
|
|
5
5
|
runTransaction
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-NGSJZFGL.js";
|
|
7
|
+
import {
|
|
8
|
+
lazy
|
|
9
|
+
} from "../chunk-5D2ALSM5.js";
|
|
7
10
|
import "../chunk-ZJADGNYF.js";
|
|
8
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-QZWTRENR.js";
|
|
9
12
|
import "../chunk-PZ5AY32C.js";
|
|
10
13
|
|
|
11
14
|
// src/with-commit/tx/dry-run.ts
|
|
15
|
+
var loadGuardExecutor = lazy(() => import("../executor-RM7XWQDU.js"));
|
|
12
16
|
var SEP = " ";
|
|
13
17
|
var keyOf = (op) => `${op.vaultName}${SEP}${op.collectionName}${SEP}${op.id}`;
|
|
14
18
|
async function runDryRun(db, fn) {
|
|
@@ -44,7 +48,7 @@ async function runDryRun(db, fn) {
|
|
|
44
48
|
const gctx = { existing: before, vault: facade, userId: v.userId, role: v.role };
|
|
45
49
|
try {
|
|
46
50
|
await registry.runChecks(op.collectionName, after, gctx);
|
|
47
|
-
const { GuardExecutor } = await
|
|
51
|
+
const { GuardExecutor } = await loadGuardExecutor();
|
|
48
52
|
for (const g of guards) {
|
|
49
53
|
await GuardExecutor.checkFrozenFields(g, op.id, before, after);
|
|
50
54
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/with-commit/tx/dry-run.ts","../../src/with-commit/tx/active.ts"],"sourcesContent":["/**\n * Dry-run transactions. Runs the tx body to STAGE ops, then builds\n * the directly-affected diff (before = current committed via collection.get,\n * after = staged record) and collects guard violations — without executing\n * phase 2. No adapter writes, no write-hooks, no commit. MV/derivation\n * cascade is NOT simulated (v2). Mirrors the guard loop in\n * `Collection._putInternal` — keep the two in sync.\n */\nimport type { Noydb } from '../../kernel/noydb.js'\nimport { TxContext, type StagedOp } from './transaction.js'\n\nimport { lazy } from '../../kernel/lazy.js'\n\n/** #846c — one memoized binding instead of a cast at the call site. */\nconst loadGuardExecutor = lazy(() => import('../../with-audit/guards/executor.js'))\n\nexport interface AffectedDocument {\n readonly vault: string\n readonly op: 'create' | 'update' | 'delete'\n readonly collection: string\n readonly docId: string\n readonly before: unknown // current committed record; null when creating\n readonly after: unknown // staged record; null when deleting\n}\n\nexport interface GuardViolation {\n readonly vault: string\n readonly collection: string\n readonly docId: string\n readonly message: string\n}\n\nexport interface DryRunResult {\n readonly affected: ReadonlyArray<AffectedDocument>\n readonly guardViolations: ReadonlyArray<GuardViolation>\n}\n\nconst SEP = ' '\nconst keyOf = (op: StagedOp) => `${op.vaultName}${SEP}${op.collectionName}${SEP}${op.id}`\n\nexport async function runDryRun(\n db: Noydb,\n fn: (tx: TxContext) => unknown,\n): Promise<DryRunResult> {\n const ctx = new TxContext(db)\n await fn(ctx) // stage ops (reads see staged writes via TxCollection); nothing committed\n\n // Dedup by (vault, collection, id) — last staged op wins.\n const lastOp = new Map<string, StagedOp>()\n for (const op of ctx._ops) lastOp.set(keyOf(op), op)\n\n const affected: AffectedDocument[] = []\n const guardViolations: GuardViolation[] = []\n\n for (const op of lastOp.values()) {\n const v = db.vault(op.vaultName)\n const coll = v.collection(op.collectionName)\n const before = await coll.get(op.id)\n\n if (op.type === 'delete') {\n affected.push({ vault: op.vaultName, op: 'delete', collection: op.collectionName, docId: op.id, before, after: null })\n continue\n }\n\n const after = op.record ?? null\n affected.push({\n vault: op.vaultName,\n op: before === null ? 'create' : 'update',\n collection: op.collectionName,\n docId: op.id,\n before,\n after,\n })\n\n // Guard violations — run the SAME checks Collection._putInternal does,\n // with the SAME ctx (existing + read-only facade + userId + role), but\n // collect the first thrown error instead of aborting.\n const registry = v._getGuardRegistry()\n if (!registry) continue\n const guards = registry.guardsFor(op.collectionName)\n if (guards.length === 0) continue\n const facade = v._getReadOnlyFacade()\n if (!facade) continue\n const gctx = { existing: before as Record<string, unknown> | null, vault: facade, userId: v.userId, role: v.role }\n try {\n await registry.runChecks(op.collectionName, after as Record<string, unknown>, gctx)\n const { GuardExecutor } = await loadGuardExecutor()\n for (const g of guards) {\n await GuardExecutor.checkFrozenFields(g, op.id, before as Record<string, unknown> | null, after as Record<string, unknown>)\n }\n } catch (err) {\n guardViolations.push({\n vault: op.vaultName,\n collection: op.collectionName,\n docId: op.id,\n message: err instanceof Error ? err.message : String(err),\n })\n }\n }\n\n return { affected, guardViolations }\n}\n","/**\n * Active transactions strategy. Only reachable via `@noy-db/hub/transactions`.\n */\n\nimport { runTransaction } from './transaction.js'\nimport { runDryRun } from './dry-run.js'\nimport type { TransactionsStrategy } from './strategy.js'\nimport type { TransactionInvariant } from './invariants.js'\n\n/**\n * Options for {@link withTransactions}. Currently only commit-time\n * changeset `invariants` (see {@link TransactionInvariant}).\n */\nexport interface WithTransactionsOptions {\n /**\n * Commit-time set-level invariants run over the changeset on every\n * commit (ordinary AND amendment). See {@link TransactionInvariant}.\n */\n invariants?: ReadonlyArray<TransactionInvariant>\n}\n\n/**\n * Build the default transactions strategy. Pass into\n * `createNoydb({ transactionsStrategy: withTransactions() })` to enable\n * `db.transaction(fn)` (and `db.transaction({ dryRun: true }, fn)`).\n *\n * Supply `{ invariants }` to register commit-time changeset invariants —\n * set-level constraints that fire after the writes commit and revert the\n * transaction on a throw. Unlike `amendment.invariant`, these run for\n * ordinary `db.transaction(fn)` calls (and amendments) with no role gate.\n */\nexport function withTransactions(opts?: WithTransactionsOptions): TransactionsStrategy {\n const invariants = opts?.invariants ?? []\n return {\n runTransaction: (db, fn, options) => runTransaction(db, fn, options, invariants),\n runDryRun,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,oBAAoB,KAAK,MAAM,OAAO,yBAAqC,CAAC;AAuBlF,IAAM,MAAM;AACZ,IAAM,QAAQ,CAAC,OAAiB,GAAG,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,GAAG,EAAE;AAEvF,eAAsB,UACpB,IACA,IACuB;AACvB,QAAM,MAAM,IAAI,UAAU,EAAE;AAC5B,QAAM,GAAG,GAAG;AAGZ,QAAM,SAAS,oBAAI,IAAsB;AACzC,aAAW,MAAM,IAAI,KAAM,QAAO,IAAI,MAAM,EAAE,GAAG,EAAE;AAEnD,QAAM,WAA+B,CAAC;AACtC,QAAM,kBAAoC,CAAC;AAE3C,aAAW,MAAM,OAAO,OAAO,GAAG;AAChC,UAAM,IAAI,GAAG,MAAM,GAAG,SAAS;AAC/B,UAAM,OAAO,EAAE,WAAW,GAAG,cAAc;AAC3C,UAAM,SAAS,MAAM,KAAK,IAAI,GAAG,EAAE;AAEnC,QAAI,GAAG,SAAS,UAAU;AACxB,eAAS,KAAK,EAAE,OAAO,GAAG,WAAW,IAAI,UAAU,YAAY,GAAG,gBAAgB,OAAO,GAAG,IAAI,QAAQ,OAAO,KAAK,CAAC;AACrH;AAAA,IACF;AAEA,UAAM,QAAQ,GAAG,UAAU;AAC3B,aAAS,KAAK;AAAA,MACZ,OAAO,GAAG;AAAA,MACV,IAAI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