@noy-db/hub 0.4.0-pre.0 → 0.4.0-pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregate/index.js +4 -4
- package/dist/api-UPAT2O3M.js +20 -0
- package/dist/as/index.js +12 -12
- package/dist/attestation/index.js +18 -18
- package/dist/{backup-YPUEKIJC.js → backup-JL2GOTYQ.js} +11 -11
- package/dist/blobs/index.js +27 -15
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -12
- package/dist/by/index.js +2 -2
- package/dist/cargo/index.js +51 -22
- package/dist/{chunk-QDPZWTN2.js → chunk-25G7U6RD.js} +2 -2
- package/dist/{chunk-WKGF2TJR.js → chunk-25ZDB25Z.js} +2 -2
- package/dist/{chunk-5WZXVULX.js → chunk-2ITLQZV5.js} +2 -2
- package/dist/{chunk-WNGGJWF7.js → chunk-2JZ763FV.js} +2 -2
- package/dist/{chunk-U6JMEH2P.js → chunk-2KL6NDD4.js} +90 -3
- package/dist/chunk-2KL6NDD4.js.map +1 -0
- package/dist/{chunk-RJ6K6K5M.js → chunk-2RMDVWGB.js} +2 -2
- package/dist/{chunk-VAIS3SOM.js → chunk-2U7Y7BNJ.js} +2 -2
- package/dist/{chunk-WZSHL6DQ.js → chunk-2VUISNGP.js} +5 -5
- package/dist/chunk-2YELV6TV.js +1 -0
- package/dist/{chunk-ANATMTOA.js → chunk-3O62PVDW.js} +3 -3
- package/dist/{chunk-VKCADNMR.js → chunk-4JYYIFHW.js} +12 -12
- package/dist/{chunk-6HY2X62D.js → chunk-5BB3N4KU.js} +2 -2
- package/dist/{chunk-VCTXU4AT.js → chunk-5BHNQNBI.js} +1 -1
- package/dist/chunk-5BHNQNBI.js.map +1 -0
- package/dist/{chunk-6NQMXTYC.js → chunk-5OZCCLNC.js} +2 -2
- package/dist/{chunk-HOONYZY2.js → chunk-5P5AAXYA.js} +2 -2
- package/dist/{chunk-KS6SAVCZ.js → chunk-5SZ24DL5.js} +6 -6
- package/dist/{chunk-NCCBLYEB.js → chunk-7B4GPCX7.js} +5 -5
- package/dist/{chunk-SV6EAJEP.js → chunk-A64XXIIB.js} +4 -4
- package/dist/{chunk-WOM2HTML.js → chunk-AFBJHD55.js} +5 -5
- package/dist/{chunk-RFI7GGFO.js → chunk-BCOKZC4B.js} +2 -2
- package/dist/{chunk-XUW3PXHU.js → chunk-BVZGNMVM.js} +4 -16
- package/dist/{chunk-XUW3PXHU.js.map → chunk-BVZGNMVM.js.map} +1 -1
- package/dist/{chunk-MT62YSPZ.js → chunk-BZEPJJOK.js} +4 -4
- package/dist/{chunk-OCVM6KDH.js → chunk-BZK6JEX4.js} +5 -5
- package/dist/{chunk-H2KSZMIX.js → chunk-CCT4WZI6.js} +5 -5
- package/dist/{chunk-VEALDPHW.js → chunk-CGPO3ZYB.js} +2 -2
- package/dist/{chunk-S3BFKGET.js → chunk-DEQ2JTBR.js} +3 -3
- package/dist/{chunk-3ELCWU56.js → chunk-E2R5NRZD.js} +2 -2
- package/dist/{chunk-BOKIKJJB.js → chunk-EDC6MLXV.js} +2 -2
- package/dist/chunk-F4COUZLL.js +24 -0
- package/dist/chunk-F4COUZLL.js.map +1 -0
- package/dist/{chunk-JRBNCUNT.js → chunk-FLHOTGOO.js} +3 -3
- package/dist/{chunk-6XE5TMPR.js → chunk-GBEXTC6Z.js} +3 -3
- package/dist/{chunk-YZQOGE2L.js → chunk-GS3Q2KOZ.js} +2 -2
- package/dist/{chunk-M75ZZHSR.js → chunk-GYB2QK5H.js} +2 -2
- package/dist/{chunk-EO43ANYJ.js → chunk-GZ2GKOF6.js} +3 -3
- package/dist/{chunk-VCBHAE4R.js → chunk-H4SMS4O2.js} +2 -2
- package/dist/{chunk-LVGTA624.js → chunk-HGVFJL63.js} +4 -4
- package/dist/{chunk-554KLAAN.js → chunk-HVZT5T22.js} +5 -5
- package/dist/{chunk-CJ5KKU6X.js → chunk-IGAIOGCN.js} +4 -4
- package/dist/{chunk-W2OG6JOL.js → chunk-IGM563N5.js} +18 -1
- package/dist/chunk-IGM563N5.js.map +1 -0
- package/dist/{chunk-GWKAVKHI.js → chunk-ITI3SJRB.js} +2 -2
- package/dist/{chunk-CZTLE22N.js → chunk-IU22SQGU.js} +7 -7
- package/dist/{chunk-RTEK4C4I.js → chunk-IUIVDVXM.js} +2 -2
- package/dist/{chunk-Z4PD65VQ.js → chunk-IZX3WZBF.js} +4 -4
- package/dist/{chunk-RDXW3OBQ.js → chunk-J3VW4J4E.js} +2 -2
- package/dist/{chunk-IK43HLDQ.js → chunk-J6U4BOKP.js} +11 -11
- package/dist/{chunk-XJMBYYQK.js → chunk-JA5B3SLH.js} +2 -2
- package/dist/{chunk-IAO54J4R.js → chunk-JA5O7UEZ.js} +6 -6
- package/dist/{chunk-6HPG2YNX.js → chunk-JKWNG3TM.js} +2 -2
- package/dist/{chunk-WQIYTNJV.js → chunk-JLHKBAFY.js} +3 -3
- package/dist/{chunk-ISMV2QVG.js → chunk-KMONEHDJ.js} +2 -2
- package/dist/{chunk-XTHCN77N.js → chunk-KR5EGWI4.js} +7 -19
- package/dist/chunk-KR5EGWI4.js.map +1 -0
- package/dist/{chunk-JBBSYJHP.js → chunk-KVHWEPT2.js} +2 -2
- package/dist/{chunk-2PCAVW2I.js → chunk-L4OA7G5T.js} +2 -2
- package/dist/{chunk-IY23KFNZ.js → chunk-LLVW4V7R.js} +3 -3
- package/dist/{chunk-N6WF5PKC.js → chunk-M25ZIEB2.js} +2 -2
- package/dist/{chunk-FXZDAV62.js → chunk-MEKAMERX.js} +5 -7
- package/dist/{chunk-FXZDAV62.js.map → chunk-MEKAMERX.js.map} +1 -1
- package/dist/{chunk-UC2ETWF3.js → chunk-MSO2C3KG.js} +2 -2
- package/dist/{chunk-ONTBCHCP.js → chunk-N4FZ6ITM.js} +2 -2
- package/dist/{chunk-DRWBEDYO.js → chunk-NM4LVUXH.js} +2 -2
- package/dist/{chunk-DSBQODMZ.js → chunk-NOT7XA7Q.js} +5 -5
- package/dist/{chunk-RA5VTXXG.js → chunk-OGFPMCSP.js} +2 -2
- package/dist/{chunk-WHXXI3W5.js → chunk-OGY4ELVE.js} +3 -3
- package/dist/{chunk-T36RFODW.js → chunk-OOTTXUNV.js} +2 -2
- package/dist/{chunk-A5BDDEXK.js → chunk-OTU5ZI3U.js} +4 -4
- package/dist/{chunk-THVIPWRF.js → chunk-OVFCAS7U.js} +9 -9
- package/dist/{chunk-IFJTPAQQ.js → chunk-OWE4BNTM.js} +4 -4
- package/dist/{chunk-W4TCUGQR.js → chunk-PEY6ZTCF.js} +12 -8
- package/dist/{chunk-W4TCUGQR.js.map → chunk-PEY6ZTCF.js.map} +1 -1
- package/dist/{chunk-UDSR4X4L.js → chunk-PWZKD4HW.js} +74 -10
- package/dist/chunk-PWZKD4HW.js.map +1 -0
- package/dist/{chunk-HQBM64EE.js → chunk-QAFWRGVD.js} +127 -8
- package/dist/chunk-QAFWRGVD.js.map +1 -0
- package/dist/{chunk-ZXEZCY6F.js → chunk-QCUH2G77.js} +6 -6
- package/dist/{chunk-XDIAFPUM.js → chunk-QDNVHA2F.js} +2 -2
- package/dist/{chunk-FH52K7EG.js → chunk-QRHEAZ2Q.js} +2 -6
- package/dist/{chunk-FH52K7EG.js.map → chunk-QRHEAZ2Q.js.map} +1 -1
- package/dist/{chunk-A4FXFAKF.js → chunk-QXPOEAKR.js} +2 -2
- package/dist/{chunk-EWPOHMN2.js → chunk-RGL53NXZ.js} +3 -3
- package/dist/{chunk-TAGR72IR.js → chunk-RI3OKC3Y.js} +4 -4
- package/dist/{chunk-5PFOMHTB.js → chunk-S3OYXPSE.js} +9 -9
- package/dist/{chunk-JVBO4SZL.js → chunk-STR7WBOB.js} +2 -2
- package/dist/{chunk-DDHM2TLX.js → chunk-T7S4V52L.js} +4 -4
- package/dist/{chunk-WG4QBZDN.js → chunk-TYBXP6WE.js} +7 -7
- package/dist/{chunk-T3GY65MA.js → chunk-UEO5CHOP.js} +3 -3
- package/dist/{chunk-RNG4VRP4.js → chunk-V3YB7RGR.js} +3 -3
- package/dist/{chunk-R3BLCFD2.js → chunk-V7RGFJ3Z.js} +6 -6
- package/dist/{chunk-SMIRGMS7.js → chunk-VEX6G3YL.js} +2 -2
- package/dist/{chunk-PK6JIDQ4.js → chunk-VZELV7ZJ.js} +116 -119
- package/dist/chunk-VZELV7ZJ.js.map +1 -0
- package/dist/{chunk-GULTLPFB.js → chunk-XGVDLQJE.js} +3 -3
- package/dist/{chunk-JFCV5QIK.js → chunk-XULHFSHO.js} +5 -5
- package/dist/{chunk-S6Q37VGE.js → chunk-XW7NWO4A.js} +2 -2
- package/dist/{chunk-YCH5GBN6.js → chunk-Y5E6CH6S.js} +6 -6
- package/dist/{chunk-GDG5VVYG.js → chunk-YG2EG6CB.js} +4 -4
- package/dist/{chunk-UHNGNKLV.js → chunk-YGBIBOCR.js} +307 -17
- package/dist/chunk-YGBIBOCR.js.map +1 -0
- package/dist/{chunk-YTGDPCPW.js → chunk-YHPUDB7Q.js} +2 -2
- package/dist/{chunk-VRBTNCM4.js → chunk-ZJGZDOQO.js} +6 -6
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-QWMASIT7.js → classified-marker-7S5IEP6Q.js} +3 -3
- package/dist/collection-facade-ENLTJZBT.js +44 -0
- package/dist/{computed-DSMPXG2Y.js → computed-WZNKRLCY.js} +3 -3
- package/dist/consent/index.js +9 -9
- package/dist/cover-B5MY43CK.js +36 -0
- package/dist/{dead-filter-66VGI6JV.js → dead-filter-KRRD57MR.js} +2 -2
- package/dist/delegation-UT76AQIG.js +25 -0
- package/dist/derivations/index.js +12 -12
- package/dist/derive-SGRCCKVP.js +21 -0
- package/dist/{enclave-TKPN2G2U.js → enclave-YFKA3GJT.js} +11 -9
- package/dist/executor-TEZYRDN3.js +9 -0
- package/dist/executor-UF7LTX6O.js +26 -0
- package/dist/executor-WQQRU6DO.js +9 -0
- package/dist/export-accessible-HXMKW5LJ.js +23 -0
- package/dist/extract-partition-QGQ2R42J.js +38 -0
- package/dist/{fanout-sidecar-B5LVUMQX.js → fanout-sidecar-HJV3A7PM.js} +9 -9
- package/dist/find-VV6PBIHK.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +3 -3
- package/dist/history/index.js +12 -12
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +1 -4
- package/dist/index.js +151 -168
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +2 -2
- package/dist/issue-7JJ4Z7E2.js +19 -0
- package/dist/kernel/enclave/index.d.ts +1 -1
- package/dist/kernel/enclave/record-keys/envelope-body.d.ts +8 -0
- package/dist/kernel/errors.d.ts +19 -0
- package/dist/kernel/noydb.d.ts +0 -6
- package/dist/kernel/types.d.ts +61 -17
- package/dist/kernel/vault.d.ts +0 -4
- package/dist/{ledger-PTK7XZYT.js → ledger-SW6QQOAV.js} +11 -11
- package/dist/liberate-W5MDWYOV.js +24 -0
- package/dist/{link-set-SLJHDNRB.js → link-set-GNGGCFI4.js} +11 -11
- package/dist/materialized-views/index.js +19 -19
- package/dist/noydb-U63S3Z7F.js +70 -0
- package/dist/on/index.js +9 -9
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +19 -17
- package/dist/pod/index.js +27 -12
- package/dist/{policy-YDLCOX4P.js → policy-EAXSJNOT.js} +5 -5
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-2YHSADFI.js → post-register-A7HCFBP5.js} +6 -6
- package/dist/query/index.js +6 -6
- package/dist/register-YBMRLZLO.js +23 -0
- package/dist/registry-3LXKNXWI.js +9 -0
- package/dist/registry-4V4YQCXJ.js +19 -0
- package/dist/registry-ZULMLCJK.js +18 -0
- package/dist/request-withdrawal-SEVUEUDG.js +31 -0
- package/dist/{reveal-HWO4YMTJ.js → reveal-PB3YG544.js} +6 -6
- package/dist/revoke-5QULL5GT.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/sealed-record/index.js +12 -12
- package/dist/{seed-3ZMF5EQA.js → seed-6GTDHL4E.js} +11 -11
- package/dist/session/index.js +9 -9
- package/dist/shadow/index.js +2 -2
- 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-ZMH35FT4.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/{stale-VZL4OGUB.js → stale-NB5BGRVU.js} +10 -10
- package/dist/storage-QOZKQMID.js +23 -0
- package/dist/{store-coordination-provider-FKX3F6TQ.js → store-coordination-provider-3AELCZ4Y.js} +3 -3
- package/dist/sync/index.js +10 -9
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +29 -28
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +1 -1
- package/dist/tx/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/{verify-26Y5GNMK.js → verify-MXN66IIH.js} +5 -5
- package/dist/via/blob/active.d.ts +27 -1
- package/dist/via/blob/index.d.ts +4 -0
- package/dist/{walk-IPLXE36W.js → walk-H4YE52S2.js} +11 -11
- package/dist/with/index.js +11 -11
- 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/{legacy/kernel.d.ts → with-cargo/floor.d.ts} +1 -1
- package/dist/with-cargo/index.d.ts +12 -1
- package/dist/with-party/directory/cover/index.d.ts +0 -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/team/sync-period-scope.d.ts +78 -0
- package/dist/with-party/team/sync.d.ts +13 -0
- package/dist/with-pod/bundle.d.ts +0 -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 +85 -1
- package/dist/withdraw-accessible-HPOVNG2G.js +28 -0
- package/package.json +7 -7
- package/dist/api-3A3S4SHH.js +0 -20
- package/dist/bundle/index.js +0 -153
- package/dist/bundle/index.js.map +0 -1
- package/dist/chunk-CHFZDSE4.js +0 -1
- package/dist/chunk-HQBM64EE.js.map +0 -1
- package/dist/chunk-PK6JIDQ4.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-VCTXU4AT.js.map +0 -1
- package/dist/chunk-W2OG6JOL.js.map +0 -1
- package/dist/chunk-XTHCN77N.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/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/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/signer-MBVHW4WE.js +0 -25
- package/dist/storage-3MEJUENZ.js +0 -23
- package/dist/withdraw-accessible-TZDATQVR.js +0 -28
- /package/dist/{api-3A3S4SHH.js.map → api-UPAT2O3M.js.map} +0 -0
- /package/dist/{backup-YPUEKIJC.js.map → backup-JL2GOTYQ.js.map} +0 -0
- /package/dist/{chunk-QDPZWTN2.js.map → chunk-25G7U6RD.js.map} +0 -0
- /package/dist/{chunk-WKGF2TJR.js.map → chunk-25ZDB25Z.js.map} +0 -0
- /package/dist/{chunk-5WZXVULX.js.map → chunk-2ITLQZV5.js.map} +0 -0
- /package/dist/{chunk-WNGGJWF7.js.map → chunk-2JZ763FV.js.map} +0 -0
- /package/dist/{chunk-RJ6K6K5M.js.map → chunk-2RMDVWGB.js.map} +0 -0
- /package/dist/{chunk-VAIS3SOM.js.map → chunk-2U7Y7BNJ.js.map} +0 -0
- /package/dist/{chunk-WZSHL6DQ.js.map → chunk-2VUISNGP.js.map} +0 -0
- /package/dist/{chunk-CHFZDSE4.js.map → chunk-2YELV6TV.js.map} +0 -0
- /package/dist/{chunk-ANATMTOA.js.map → chunk-3O62PVDW.js.map} +0 -0
- /package/dist/{chunk-VKCADNMR.js.map → chunk-4JYYIFHW.js.map} +0 -0
- /package/dist/{chunk-6HY2X62D.js.map → chunk-5BB3N4KU.js.map} +0 -0
- /package/dist/{chunk-6NQMXTYC.js.map → chunk-5OZCCLNC.js.map} +0 -0
- /package/dist/{chunk-HOONYZY2.js.map → chunk-5P5AAXYA.js.map} +0 -0
- /package/dist/{chunk-KS6SAVCZ.js.map → chunk-5SZ24DL5.js.map} +0 -0
- /package/dist/{chunk-NCCBLYEB.js.map → chunk-7B4GPCX7.js.map} +0 -0
- /package/dist/{chunk-SV6EAJEP.js.map → chunk-A64XXIIB.js.map} +0 -0
- /package/dist/{chunk-WOM2HTML.js.map → chunk-AFBJHD55.js.map} +0 -0
- /package/dist/{chunk-RFI7GGFO.js.map → chunk-BCOKZC4B.js.map} +0 -0
- /package/dist/{chunk-MT62YSPZ.js.map → chunk-BZEPJJOK.js.map} +0 -0
- /package/dist/{chunk-OCVM6KDH.js.map → chunk-BZK6JEX4.js.map} +0 -0
- /package/dist/{chunk-H2KSZMIX.js.map → chunk-CCT4WZI6.js.map} +0 -0
- /package/dist/{chunk-VEALDPHW.js.map → chunk-CGPO3ZYB.js.map} +0 -0
- /package/dist/{chunk-S3BFKGET.js.map → chunk-DEQ2JTBR.js.map} +0 -0
- /package/dist/{chunk-3ELCWU56.js.map → chunk-E2R5NRZD.js.map} +0 -0
- /package/dist/{chunk-BOKIKJJB.js.map → chunk-EDC6MLXV.js.map} +0 -0
- /package/dist/{chunk-JRBNCUNT.js.map → chunk-FLHOTGOO.js.map} +0 -0
- /package/dist/{chunk-6XE5TMPR.js.map → chunk-GBEXTC6Z.js.map} +0 -0
- /package/dist/{chunk-YZQOGE2L.js.map → chunk-GS3Q2KOZ.js.map} +0 -0
- /package/dist/{chunk-M75ZZHSR.js.map → chunk-GYB2QK5H.js.map} +0 -0
- /package/dist/{chunk-EO43ANYJ.js.map → chunk-GZ2GKOF6.js.map} +0 -0
- /package/dist/{chunk-VCBHAE4R.js.map → chunk-H4SMS4O2.js.map} +0 -0
- /package/dist/{chunk-LVGTA624.js.map → chunk-HGVFJL63.js.map} +0 -0
- /package/dist/{chunk-554KLAAN.js.map → chunk-HVZT5T22.js.map} +0 -0
- /package/dist/{chunk-CJ5KKU6X.js.map → chunk-IGAIOGCN.js.map} +0 -0
- /package/dist/{chunk-GWKAVKHI.js.map → chunk-ITI3SJRB.js.map} +0 -0
- /package/dist/{chunk-CZTLE22N.js.map → chunk-IU22SQGU.js.map} +0 -0
- /package/dist/{chunk-RTEK4C4I.js.map → chunk-IUIVDVXM.js.map} +0 -0
- /package/dist/{chunk-Z4PD65VQ.js.map → chunk-IZX3WZBF.js.map} +0 -0
- /package/dist/{chunk-RDXW3OBQ.js.map → chunk-J3VW4J4E.js.map} +0 -0
- /package/dist/{chunk-IK43HLDQ.js.map → chunk-J6U4BOKP.js.map} +0 -0
- /package/dist/{chunk-XJMBYYQK.js.map → chunk-JA5B3SLH.js.map} +0 -0
- /package/dist/{chunk-IAO54J4R.js.map → chunk-JA5O7UEZ.js.map} +0 -0
- /package/dist/{chunk-6HPG2YNX.js.map → chunk-JKWNG3TM.js.map} +0 -0
- /package/dist/{chunk-WQIYTNJV.js.map → chunk-JLHKBAFY.js.map} +0 -0
- /package/dist/{chunk-ISMV2QVG.js.map → chunk-KMONEHDJ.js.map} +0 -0
- /package/dist/{chunk-JBBSYJHP.js.map → chunk-KVHWEPT2.js.map} +0 -0
- /package/dist/{chunk-2PCAVW2I.js.map → chunk-L4OA7G5T.js.map} +0 -0
- /package/dist/{chunk-IY23KFNZ.js.map → chunk-LLVW4V7R.js.map} +0 -0
- /package/dist/{chunk-N6WF5PKC.js.map → chunk-M25ZIEB2.js.map} +0 -0
- /package/dist/{chunk-UC2ETWF3.js.map → chunk-MSO2C3KG.js.map} +0 -0
- /package/dist/{chunk-ONTBCHCP.js.map → chunk-N4FZ6ITM.js.map} +0 -0
- /package/dist/{chunk-DRWBEDYO.js.map → chunk-NM4LVUXH.js.map} +0 -0
- /package/dist/{chunk-DSBQODMZ.js.map → chunk-NOT7XA7Q.js.map} +0 -0
- /package/dist/{chunk-RA5VTXXG.js.map → chunk-OGFPMCSP.js.map} +0 -0
- /package/dist/{chunk-WHXXI3W5.js.map → chunk-OGY4ELVE.js.map} +0 -0
- /package/dist/{chunk-T36RFODW.js.map → chunk-OOTTXUNV.js.map} +0 -0
- /package/dist/{chunk-A5BDDEXK.js.map → chunk-OTU5ZI3U.js.map} +0 -0
- /package/dist/{chunk-THVIPWRF.js.map → chunk-OVFCAS7U.js.map} +0 -0
- /package/dist/{chunk-IFJTPAQQ.js.map → chunk-OWE4BNTM.js.map} +0 -0
- /package/dist/{chunk-ZXEZCY6F.js.map → chunk-QCUH2G77.js.map} +0 -0
- /package/dist/{chunk-XDIAFPUM.js.map → chunk-QDNVHA2F.js.map} +0 -0
- /package/dist/{chunk-A4FXFAKF.js.map → chunk-QXPOEAKR.js.map} +0 -0
- /package/dist/{chunk-EWPOHMN2.js.map → chunk-RGL53NXZ.js.map} +0 -0
- /package/dist/{chunk-TAGR72IR.js.map → chunk-RI3OKC3Y.js.map} +0 -0
- /package/dist/{chunk-5PFOMHTB.js.map → chunk-S3OYXPSE.js.map} +0 -0
- /package/dist/{chunk-JVBO4SZL.js.map → chunk-STR7WBOB.js.map} +0 -0
- /package/dist/{chunk-DDHM2TLX.js.map → chunk-T7S4V52L.js.map} +0 -0
- /package/dist/{chunk-WG4QBZDN.js.map → chunk-TYBXP6WE.js.map} +0 -0
- /package/dist/{chunk-T3GY65MA.js.map → chunk-UEO5CHOP.js.map} +0 -0
- /package/dist/{chunk-RNG4VRP4.js.map → chunk-V3YB7RGR.js.map} +0 -0
- /package/dist/{chunk-R3BLCFD2.js.map → chunk-V7RGFJ3Z.js.map} +0 -0
- /package/dist/{chunk-SMIRGMS7.js.map → chunk-VEX6G3YL.js.map} +0 -0
- /package/dist/{chunk-GULTLPFB.js.map → chunk-XGVDLQJE.js.map} +0 -0
- /package/dist/{chunk-JFCV5QIK.js.map → chunk-XULHFSHO.js.map} +0 -0
- /package/dist/{chunk-S6Q37VGE.js.map → chunk-XW7NWO4A.js.map} +0 -0
- /package/dist/{chunk-YCH5GBN6.js.map → chunk-Y5E6CH6S.js.map} +0 -0
- /package/dist/{chunk-GDG5VVYG.js.map → chunk-YG2EG6CB.js.map} +0 -0
- /package/dist/{chunk-YTGDPCPW.js.map → chunk-YHPUDB7Q.js.map} +0 -0
- /package/dist/{chunk-VRBTNCM4.js.map → chunk-ZJGZDOQO.js.map} +0 -0
- /package/dist/{classified-marker-QWMASIT7.js.map → classified-marker-7S5IEP6Q.js.map} +0 -0
- /package/dist/{collection-facade-KMBWNCYP.js.map → collection-facade-ENLTJZBT.js.map} +0 -0
- /package/dist/{computed-DSMPXG2Y.js.map → computed-WZNKRLCY.js.map} +0 -0
- /package/dist/{cover-QJRXINN5.js.map → cover-B5MY43CK.js.map} +0 -0
- /package/dist/{dead-filter-66VGI6JV.js.map → dead-filter-KRRD57MR.js.map} +0 -0
- /package/dist/{delegation-SU6CV3W7.js.map → delegation-UT76AQIG.js.map} +0 -0
- /package/dist/{derive-6RWU4EOA.js.map → derive-SGRCCKVP.js.map} +0 -0
- /package/dist/{enclave-TKPN2G2U.js.map → enclave-YFKA3GJT.js.map} +0 -0
- /package/dist/{executor-KGNLJD6M.js.map → executor-TEZYRDN3.js.map} +0 -0
- /package/dist/{executor-UX4FASYZ.js.map → executor-UF7LTX6O.js.map} +0 -0
- /package/dist/{executor-XGIS6CR7.js.map → executor-WQQRU6DO.js.map} +0 -0
- /package/dist/{export-accessible-LKW3QV22.js.map → export-accessible-HXMKW5LJ.js.map} +0 -0
- /package/dist/{extract-partition-UP2ARO75.js.map → extract-partition-QGQ2R42J.js.map} +0 -0
- /package/dist/{fanout-sidecar-B5LVUMQX.js.map → fanout-sidecar-HJV3A7PM.js.map} +0 -0
- /package/dist/{find-YS6XWB46.js.map → find-VV6PBIHK.js.map} +0 -0
- /package/dist/{issue-3ACYX7LO.js.map → issue-7JJ4Z7E2.js.map} +0 -0
- /package/dist/{ledger-PTK7XZYT.js.map → ledger-SW6QQOAV.js.map} +0 -0
- /package/dist/{liberate-MQQXBUCY.js.map → liberate-W5MDWYOV.js.map} +0 -0
- /package/dist/{link-set-SLJHDNRB.js.map → link-set-GNGGCFI4.js.map} +0 -0
- /package/dist/{noydb-ANIW5FLE.js.map → noydb-U63S3Z7F.js.map} +0 -0
- /package/dist/{policy-YDLCOX4P.js.map → policy-EAXSJNOT.js.map} +0 -0
- /package/dist/{post-register-2YHSADFI.js.map → post-register-A7HCFBP5.js.map} +0 -0
- /package/dist/{register-PAM3ASRZ.js.map → register-YBMRLZLO.js.map} +0 -0
- /package/dist/{registry-4S2U2TR4.js.map → registry-3LXKNXWI.js.map} +0 -0
- /package/dist/{registry-NPOWJHC4.js.map → registry-4V4YQCXJ.js.map} +0 -0
- /package/dist/{registry-VZ3CCI2R.js.map → registry-ZULMLCJK.js.map} +0 -0
- /package/dist/{request-withdrawal-DI3H5WUI.js.map → request-withdrawal-SEVUEUDG.js.map} +0 -0
- /package/dist/{reveal-HWO4YMTJ.js.map → reveal-PB3YG544.js.map} +0 -0
- /package/dist/{revoke-R5CZSVUT.js.map → revoke-5QULL5GT.js.map} +0 -0
- /package/dist/{seed-3ZMF5EQA.js.map → seed-6GTDHL4E.js.map} +0 -0
- /package/dist/{signer-MBVHW4WE.js.map → signer-ZMH35FT4.js.map} +0 -0
- /package/dist/{stale-VZL4OGUB.js.map → stale-NB5BGRVU.js.map} +0 -0
- /package/dist/{storage-3MEJUENZ.js.map → storage-QOZKQMID.js.map} +0 -0
- /package/dist/{store-coordination-provider-FKX3F6TQ.js.map → store-coordination-provider-3AELCZ4Y.js.map} +0 -0
- /package/dist/{verify-26Y5GNMK.js.map → verify-MXN66IIH.js.map} +0 -0
- /package/dist/{walk-IPLXE36W.js.map → walk-H4YE52S2.js.map} +0 -0
- /package/dist/{withdraw-accessible-TZDATQVR.js.map → withdraw-accessible-HPOVNG2G.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5BHNQNBI.js";
|
|
4
4
|
import {
|
|
5
5
|
ValidationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IGM563N5.js";
|
|
7
7
|
|
|
8
8
|
// src/with-party/directory/cover/custom.ts
|
|
9
9
|
var CUSTOM_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)+$/i;
|
|
@@ -172,8 +172,6 @@ function isCover(x) {
|
|
|
172
172
|
const obj = x;
|
|
173
173
|
return obj["_noydb_public"] === 1 && typeof obj["version"] === "number";
|
|
174
174
|
}
|
|
175
|
-
var validatePublicEnvelopeInput = validateCoverInput;
|
|
176
|
-
var isPublicEnvelope = isCover;
|
|
177
175
|
|
|
178
176
|
// src/with-party/directory/cover/storage.ts
|
|
179
177
|
var COVER_RECORD_ID = "public-envelope";
|
|
@@ -222,27 +220,17 @@ function pickLocale(value, locale, defaultLocale) {
|
|
|
222
220
|
}
|
|
223
221
|
return "";
|
|
224
222
|
}
|
|
225
|
-
var PUBLIC_ENVELOPE_RECORD_ID = COVER_RECORD_ID;
|
|
226
|
-
var loadPublicEnvelope = loadCover;
|
|
227
|
-
var savePublicEnvelope = saveCover;
|
|
228
|
-
var readPublicEnvelope = readCover;
|
|
229
223
|
|
|
230
224
|
export {
|
|
231
225
|
mergeCustom,
|
|
232
226
|
validateCoverSize,
|
|
233
227
|
validateCoverInput,
|
|
234
228
|
isCover,
|
|
235
|
-
validatePublicEnvelopeInput,
|
|
236
|
-
isPublicEnvelope,
|
|
237
229
|
COVER_RECORD_ID,
|
|
238
230
|
loadCover,
|
|
239
231
|
saveCover,
|
|
240
232
|
readCover,
|
|
241
233
|
resolveLocale,
|
|
242
|
-
pickLocale
|
|
243
|
-
PUBLIC_ENVELOPE_RECORD_ID,
|
|
244
|
-
loadPublicEnvelope,
|
|
245
|
-
savePublicEnvelope,
|
|
246
|
-
readPublicEnvelope
|
|
234
|
+
pickLocale
|
|
247
235
|
};
|
|
248
|
-
//# sourceMappingURL=chunk-
|
|
236
|
+
//# sourceMappingURL=chunk-BVZGNMVM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-party/directory/cover/custom.ts","../src/with-party/directory/cover/schema.ts","../src/with-party/directory/cover/storage.ts"],"sourcesContent":["/**\n * The cover's namespaced `custom` extension slot (#800) — input\n * validation, the namespace-level patch merge, and the post-merge\n * size caps.\n *\n * Like everything on the cover, `custom` is plaintext, public by\n * design, and unauthenticated — payloads are hints (display defaults,\n * routing suggestions, registry pointers), never an input to\n * security, authorization, or data-integrity decisions.\n *\n * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport type { Cover, JsonValue, ResolvedCoverSchema } from './types.js'\n\n/**\n * Namespace keys must be reverse-DNS or package-style identifiers —\n * at least one dot/dash-separated segment (`noydb.viewer`,\n * `com.acme.registry` pass; a bare `config` fails), so two frameworks\n * can't collide on a bare word.\n */\nconst CUSTOM_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)+$/i\n\n/** Maximum nesting depth of a namespace payload (containers, not leaves). */\nconst MAX_CUSTOM_DEPTH = 8\n\n/**\n * Validate the owner-supplied `custom` input: the field must be a\n * plain object, every key must match {@link CUSTOM_KEY_PATTERN}, and\n * every value must be JSON-serializable (no functions, `undefined`,\n * symbols, bigints, or cycles) within the depth cap. `null` is\n * accepted — it is the delete-this-namespace directive and never\n * persists. Throws `ValidationError` on the first violation.\n */\nexport function validateCustomInput(custom: Record<string, JsonValue>): void {\n if (custom === null || typeof custom !== 'object' || Array.isArray(custom)) {\n throw new ValidationError(\n `setCover: custom must be a { [namespace]: value } object, got ${\n Array.isArray(custom) ? 'array' : typeof custom\n }.`,\n )\n }\n for (const [ns, value] of Object.entries(custom)) {\n if (!CUSTOM_KEY_PATTERN.test(ns)) {\n throw new ValidationError(\n `setCover: custom namespace \"${ns}\" is invalid. Keys must be ` +\n 'reverse-DNS or package-style identifiers with at least one ' +\n 'dot/dash-separated segment (e.g. \"noydb.viewer\", \"com.acme.registry\").',\n )\n }\n assertJsonValue(value, ns, 1, new Set())\n }\n}\n\nfunction assertJsonValue(\n value: unknown,\n ns: string,\n depth: number,\n seen: Set<object>,\n): void {\n if (value === null) return\n const t = typeof value\n if (t === 'string' || t === 'number' || t === 'boolean') return\n if (t !== 'object') {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a non-JSON value (${t}). ` +\n 'Only strings, numbers, booleans, null, arrays, and plain objects are allowed.',\n )\n }\n const container = value as object\n if (seen.has(container)) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a circular reference.`,\n )\n }\n if (depth > MAX_CUSTOM_DEPTH) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] nests deeper than the ${MAX_CUSTOM_DEPTH}-level cap.`,\n )\n }\n seen.add(container)\n const children = Array.isArray(container) ? container : Object.values(container)\n for (const child of children) {\n assertJsonValue(child, ns, depth + 1, seen)\n }\n seen.delete(container)\n}\n\n/**\n * Namespace-level patch merge for `setCover`: provided namespaces\n * replace their previous value, absent namespaces are preserved, and\n * an explicit `null` deletes that namespace (so `null` never persists\n * as a namespace value). A whole-`custom`-absent patch preserves the\n * previous custom, consistent with the other cover fields. Rationale:\n * framework A must never need read-modify-write of framework B's data.\n *\n * Returns a spreadable fragment — `{ custom }` when the merge leaves\n * at least one namespace, `{}` when it leaves none (the field is\n * dropped from the persisted document rather than stored empty).\n */\nexport function mergeCustom(\n existing: Record<string, JsonValue> | undefined,\n patch: Record<string, JsonValue> | undefined,\n): { custom: Record<string, JsonValue> } | Record<string, never> {\n if (patch === undefined) {\n return existing !== undefined ? { custom: existing } : {}\n }\n const merged: Record<string, JsonValue> = { ...existing }\n for (const [ns, value] of Object.entries(patch)) {\n if (value === null) {\n delete merged[ns]\n } else {\n merged[ns] = value\n }\n }\n return Object.keys(merged).length > 0 ? { custom: merged } : {}\n}\n\n/**\n * Post-merge size caps — validates the WOULD-BE-PERSISTED document\n * (after the namespace merge), so a small patch can't tip the stored\n * cover over a cap unnoticed. `maxCoverBytes` bounds the entire\n * serialized document, which also closes the unbounded locale-map\n * key-count hole for `name` / `description`. Sizes are measured as\n * `JSON.stringify` length. Throws `ValidationError` on violation.\n */\nexport function validateCoverSize(\n cover: Cover,\n schema: ResolvedCoverSchema,\n): void {\n if (cover.custom !== undefined) {\n const customSize = JSON.stringify(cover.custom).length\n if (customSize > schema.maxCustomBytes) {\n throw new ValidationError(\n `setCover: custom exceeds the ${schema.maxCustomBytes}-byte cap ` +\n `(got ${customSize} bytes serialized, after merging with the stored namespaces).`,\n )\n }\n }\n const totalSize = JSON.stringify(cover).length\n if (totalSize > schema.maxCoverBytes) {\n throw new ValidationError(\n `setCover: the cover document exceeds the ${schema.maxCoverBytes}-byte cap ` +\n `(got ${totalSize} bytes serialized).`,\n )\n }\n}\n","/**\n * Validate-on-write for the cover. Runs at every `setCover` call;\n * the developer's schema decides which fields are allowed and the\n * size caps that apply.\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport { validateCustomInput } from './custom.js'\nimport type {\n Cover,\n CoverText,\n JsonValue,\n ResolvedCoverSchema,\n CoverField,\n} from './types.js'\n\n/** Owner-supplied input — the subset of {@link Cover} the owner can set. */\nexport interface SetCoverInput {\n readonly name?: CoverText\n readonly description?: CoverText\n readonly icon?: string\n readonly defaultLocale?: string\n /**\n * Namespace-level patch for the cover's `custom` slot (#800):\n * provided namespaces replace their previous value, absent\n * namespaces are preserved, an explicit `null` deletes that\n * namespace. Requires `'custom'` in the schema's `fields` list —\n * the `cover: true` shorthand does NOT enable it.\n */\n readonly custom?: Record<string, JsonValue>\n}\n\nconst DATA_URL_PREFIX = /^data:([a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+);base64,/\n\n/**\n * Validate an owner-supplied cover input against the developer's\n * resolved schema. Throws `ValidationError` on the first violation;\n * returns void on success.\n *\n * The validator is deliberately strict: every fail mode is a hard\n * error rather than a silent drop, so the owner finds out immediately\n * which field they oversized rather than discovering a truncated\n * label months later.\n */\nexport function validateCoverInput(\n input: SetCoverInput,\n schema: ResolvedCoverSchema,\n): void {\n const allowed = new Set<CoverField>(schema.fields)\n\n // Reject any key not in the schema's allowed-field list.\n for (const key of Object.keys(input)) {\n const known: CoverField | undefined =\n key === 'name' || key === 'description' || key === 'icon' || key === 'defaultLocale' || key === 'custom'\n ? key\n : undefined\n if (!known) {\n throw new ValidationError(\n `setCover: unknown field \"${key}\". ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n if (!allowed.has(known)) {\n throw new ValidationError(\n `setCover: field \"${known}\" is not enabled in this vault's schema. ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n }\n\n if (input.name !== undefined) {\n validateText(input.name, 'name', schema.maxStringChars)\n }\n if (input.description !== undefined) {\n validateText(input.description, 'description', schema.maxStringChars)\n }\n if (input.icon !== undefined) {\n validateIcon(input.icon, schema)\n }\n if (input.defaultLocale !== undefined && typeof input.defaultLocale !== 'string') {\n throw new ValidationError(\n `setCover: defaultLocale must be a string (BCP-47), got ${typeof input.defaultLocale}.`,\n )\n }\n if (input.custom !== undefined) {\n validateCustomInput(input.custom)\n }\n}\n\nfunction validateText(\n value: CoverText,\n field: string,\n maxChars: number,\n): void {\n if (typeof value === 'string') {\n if (value.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field} exceeds the ${maxChars}-character cap (got ${value.length}).`,\n )\n }\n return\n }\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new ValidationError(\n `setCover: ${field} must be a string or { [locale]: string } map, got ${typeof value}.`,\n )\n }\n // Locale map. Each value must be a non-empty string within the cap.\n for (const [locale, str] of Object.entries(value)) {\n if (typeof str !== 'string') {\n throw new ValidationError(\n `setCover: ${field}[${locale}] must be a string, got ${typeof str}.`,\n )\n }\n if (str.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field}[${locale}] exceeds the ${maxChars}-character cap (got ${str.length}).`,\n )\n }\n }\n}\n\nfunction validateIcon(icon: string, schema: ResolvedCoverSchema): void {\n if (typeof icon !== 'string') {\n throw new ValidationError(\n `setCover: icon must be a data: URL string, got ${typeof icon}.`,\n )\n }\n if (icon.length > schema.maxIconBytes) {\n throw new ValidationError(\n `setCover: icon exceeds the ${schema.maxIconBytes}-byte cap (got ${icon.length}).`,\n )\n }\n const m = DATA_URL_PREFIX.exec(icon)\n if (!m) {\n throw new ValidationError(\n 'setCover: icon must be a base64 data URL ' +\n '(`data:image/png;base64,…` or `data:image/svg+xml;base64,…`). ' +\n 'External URLs are not supported in v1.',\n )\n }\n const mime = m[1]!\n if (!schema.iconMimeTypes.includes(mime)) {\n throw new ValidationError(\n `setCover: icon MIME type \"${mime}\" is not allowed. ` +\n `Permitted types: ${schema.iconMimeTypes.join(', ')}.`,\n )\n }\n}\n\n/**\n * Lightweight runtime predicate — used by the bundle header\n * validator to recognise a cover without requiring it. (The wire\n * discriminator keeps its frozen name: `_noydb_public: 1`.)\n */\nexport function isCover(x: unknown): x is Cover {\n if (x === null || typeof x !== 'object' || Array.isArray(x)) return false\n const obj = x as Record<string, unknown>\n return obj['_noydb_public'] === 1 && typeof obj['version'] === 'number'\n}\n\n// ─── Deprecated aliases (#799 public-envelope → cover; remove after one pre-release window) ───\n\n/** @deprecated Use {@link SetCoverInput}. */\nexport type SetPublicEnvelopeInput = SetCoverInput\n/** @deprecated Use {@link validateCoverInput}. */\nexport const validatePublicEnvelopeInput = validateCoverInput\n/** @deprecated Use {@link isCover}. */\nexport const isPublicEnvelope = isCover\n","/**\n * Persistence helpers for `_meta/public-envelope` — the cover's\n * frozen wire location. Mirrors the bypass-AES pattern used by\n * `_meta/handle` and `_meta/policy` — the document is plaintext\n * JSON, the envelope's `_iv` field is left empty.\n *\n * @module\n */\nimport type { NoydbStore, EncryptedEnvelope } from '../../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../../kernel/types.js'\nimport type { Cover } from './types.js'\nimport { isCover } from './schema.js'\n\n/**\n * Reserved id for the vault-level cover record. The VALUE is frozen\n * wire format — the record predates the #799 rename and stays at\n * `_meta/public-envelope` so existing vaults need no migration.\n */\nexport const COVER_RECORD_ID = 'public-envelope'\n\n/**\n * Read the cover from `_meta/public-envelope`. Returns `undefined`\n * when no cover has been persisted (fresh vault, or a vault written\n * before the feature was enabled). Tolerates corrupted documents —\n * a JSON parse failure surfaces as `undefined`, not a thrown error,\n * mirroring `_meta/handle`'s contract.\n */\nexport async function loadCover(\n store: NoydbStore,\n vault: string,\n): Promise<Cover | undefined> {\n const envelope = await store.get(vault, '_meta', COVER_RECORD_ID)\n if (!envelope) return undefined\n try {\n const parsed = JSON.parse(envelope._data) as unknown\n if (!isCover(parsed)) return undefined\n return parsed\n } catch {\n return undefined\n }\n}\n\n/** Persist the cover. Idempotent — overwrites any prior write. */\nexport async function saveCover(\n store: NoydbStore,\n vault: string,\n cover: Cover,\n): Promise<void> {\n const wireEnvelope: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: 1,\n _ts: new Date().toISOString(),\n _iv: '',\n _data: JSON.stringify(cover),\n }\n await store.put(vault, '_meta', COVER_RECORD_ID, wireEnvelope)\n}\n\n/**\n * Public, no-key reader. Plain function, not a method on `Noydb` —\n * the whole point is it works without an authenticated session, so\n * a UI can show \"Acme 2026 Tax Records\" before unlocking.\n *\n * Resolves any `name` / `description` locale map through the supplied\n * `locale` (when provided). Omitting `locale` returns the raw\n * cover, which a multilingual picker can render as it pleases.\n */\nexport async function readCover(\n store: NoydbStore,\n vault: string,\n opts: { readonly locale?: string } = {},\n): Promise<Cover | undefined> {\n const raw = await loadCover(store, vault)\n if (!raw) return undefined\n if (opts.locale === undefined) return raw\n return resolveLocale(raw, opts.locale)\n}\n\n/**\n * Resolve the locale-map fields (`name`, `description`) of a cover\n * to plain strings for the requested locale, falling back through\n * `defaultLocale` and then any available translation.\n *\n * @internal\n */\nexport function resolveLocale(\n cover: Cover,\n locale: string,\n): Cover {\n return {\n ...cover,\n ...(cover.name !== undefined ? { name: pickLocale(cover.name, locale, cover.defaultLocale) } : {}),\n ...(cover.description !== undefined ? { description: pickLocale(cover.description, locale, cover.defaultLocale) } : {}),\n }\n}\n\n/**\n * Resolve a `string | { [locale]: string }` value to a string for a\n * given locale. Exported so the bundle reader can reuse it without\n * duplicating the fallback chain.\n *\n * **Looser than `resolveI18nText`** — the hub's record-field resolver\n * throws `LocaleNotSpecifiedError` when no translation matches, but\n * label semantics deliberately prefer \"show *something*\" over\n * throwing. The fallback chain is:\n * 1. Exact `locale` match.\n * 2. `defaultLocale` (when supplied on the cover).\n * 3. First non-empty value in the map.\n * 4. Empty string (only if every translation is empty — pathological).\n *\n * This deviation is documented in `https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md`.\n */\nexport function pickLocale(\n value: string | Record<string, string>,\n locale: string,\n defaultLocale: string | undefined,\n): string {\n if (typeof value === 'string') return value\n if (value[locale] !== undefined && value[locale] !== '') return value[locale]\n if (defaultLocale && value[defaultLocale] !== undefined && value[defaultLocale] !== '') {\n return value[defaultLocale]\n }\n for (const v of Object.values(value)) {\n if (v !== '') return v\n }\n return ''\n}\n\n// ─── Deprecated aliases (#799 public-envelope → cover; remove after one pre-release window) ───\n\n/** @deprecated Use {@link COVER_RECORD_ID}. */\nexport const PUBLIC_ENVELOPE_RECORD_ID = COVER_RECORD_ID\n/** @deprecated Use {@link loadCover}. */\nexport const loadPublicEnvelope = loadCover\n/** @deprecated Use {@link saveCover}. */\nexport const savePublicEnvelope = saveCover\n/** @deprecated Use {@link readCover}. */\nexport const readPublicEnvelope = readCover\n"],"mappings":";;;;;;;;AAuBA,IAAM,qBAAqB;AAG3B,IAAM,mBAAmB;AAUlB,SAAS,oBAAoB,QAAyC;AAC3E,MAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GAAG;AAC1E,UAAM,IAAI;AAAA,MACR,iEACE,MAAM,QAAQ,MAAM,IAAI,UAAU,OAAO,MAC3C;AAAA,IACF;AAAA,EACF;AACA,aAAW,CAAC,IAAI,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAChD,QAAI,CAAC,mBAAmB,KAAK,EAAE,GAAG;AAChC,YAAM,IAAI;AAAA,QACR,+BAA+B,EAAE;AAAA,MAGnC;AAAA,IACF;AACA,oBAAgB,OAAO,IAAI,GAAG,oBAAI,IAAI,CAAC;AAAA,EACzC;AACF;AAEA,SAAS,gBACP,OACA,IACA,OACA,MACM;AACN,MAAI,UAAU,KAAM;AACpB,QAAM,IAAI,OAAO;AACjB,MAAI,MAAM,YAAY,MAAM,YAAY,MAAM,UAAW;AACzD,MAAI,MAAM,UAAU;AAClB,UAAM,IAAI;AAAA,MACR,qBAA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,MAAM,MAAM,GAAI,QAAO,MAAM,MAAM;AAC5E,MAAI,iBAAiB,MAAM,aAAa,MAAM,UAAa,MAAM,aAAa,MAAM,IAAI;AACtF,WAAO,MAAM,aAAa;AAAA,EAC5B;AACA,aAAW,KAAK,OAAO,OAAO,KAAK,GAAG;AACpC,QAAI,MAAM,GAAI,QAAO;AAAA,EACvB;AACA,SAAO;AACT;AAKO,IAAM,4BAA4B;AAElC,IAAM,qBAAqB;AAE3B,IAAM,qBAAqB;AAE3B,IAAM,qBAAqB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/with-party/directory/cover/custom.ts","../src/with-party/directory/cover/schema.ts","../src/with-party/directory/cover/storage.ts"],"sourcesContent":["/**\n * The cover's namespaced `custom` extension slot (#800) — input\n * validation, the namespace-level patch merge, and the post-merge\n * size caps.\n *\n * Like everything on the cover, `custom` is plaintext, public by\n * design, and unauthenticated — payloads are hints (display defaults,\n * routing suggestions, registry pointers), never an input to\n * security, authorization, or data-integrity decisions.\n *\n * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport type { Cover, JsonValue, ResolvedCoverSchema } from './types.js'\n\n/**\n * Namespace keys must be reverse-DNS or package-style identifiers —\n * at least one dot/dash-separated segment (`noydb.viewer`,\n * `com.acme.registry` pass; a bare `config` fails), so two frameworks\n * can't collide on a bare word.\n */\nconst CUSTOM_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)+$/i\n\n/** Maximum nesting depth of a namespace payload (containers, not leaves). */\nconst MAX_CUSTOM_DEPTH = 8\n\n/**\n * Validate the owner-supplied `custom` input: the field must be a\n * plain object, every key must match {@link CUSTOM_KEY_PATTERN}, and\n * every value must be JSON-serializable (no functions, `undefined`,\n * symbols, bigints, or cycles) within the depth cap. `null` is\n * accepted — it is the delete-this-namespace directive and never\n * persists. Throws `ValidationError` on the first violation.\n */\nexport function validateCustomInput(custom: Record<string, JsonValue>): void {\n if (custom === null || typeof custom !== 'object' || Array.isArray(custom)) {\n throw new ValidationError(\n `setCover: custom must be a { [namespace]: value } object, got ${\n Array.isArray(custom) ? 'array' : typeof custom\n }.`,\n )\n }\n for (const [ns, value] of Object.entries(custom)) {\n if (!CUSTOM_KEY_PATTERN.test(ns)) {\n throw new ValidationError(\n `setCover: custom namespace \"${ns}\" is invalid. Keys must be ` +\n 'reverse-DNS or package-style identifiers with at least one ' +\n 'dot/dash-separated segment (e.g. \"noydb.viewer\", \"com.acme.registry\").',\n )\n }\n assertJsonValue(value, ns, 1, new Set())\n }\n}\n\nfunction assertJsonValue(\n value: unknown,\n ns: string,\n depth: number,\n seen: Set<object>,\n): void {\n if (value === null) return\n const t = typeof value\n if (t === 'string' || t === 'number' || t === 'boolean') return\n if (t !== 'object') {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a non-JSON value (${t}). ` +\n 'Only strings, numbers, booleans, null, arrays, and plain objects are allowed.',\n )\n }\n const container = value as object\n if (seen.has(container)) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] contains a circular reference.`,\n )\n }\n if (depth > MAX_CUSTOM_DEPTH) {\n throw new ValidationError(\n `setCover: custom[\"${ns}\"] nests deeper than the ${MAX_CUSTOM_DEPTH}-level cap.`,\n )\n }\n seen.add(container)\n const children = Array.isArray(container) ? container : Object.values(container)\n for (const child of children) {\n assertJsonValue(child, ns, depth + 1, seen)\n }\n seen.delete(container)\n}\n\n/**\n * Namespace-level patch merge for `setCover`: provided namespaces\n * replace their previous value, absent namespaces are preserved, and\n * an explicit `null` deletes that namespace (so `null` never persists\n * as a namespace value). A whole-`custom`-absent patch preserves the\n * previous custom, consistent with the other cover fields. Rationale:\n * framework A must never need read-modify-write of framework B's data.\n *\n * Returns a spreadable fragment — `{ custom }` when the merge leaves\n * at least one namespace, `{}` when it leaves none (the field is\n * dropped from the persisted document rather than stored empty).\n */\nexport function mergeCustom(\n existing: Record<string, JsonValue> | undefined,\n patch: Record<string, JsonValue> | undefined,\n): { custom: Record<string, JsonValue> } | Record<string, never> {\n if (patch === undefined) {\n return existing !== undefined ? { custom: existing } : {}\n }\n const merged: Record<string, JsonValue> = { ...existing }\n for (const [ns, value] of Object.entries(patch)) {\n if (value === null) {\n delete merged[ns]\n } else {\n merged[ns] = value\n }\n }\n return Object.keys(merged).length > 0 ? { custom: merged } : {}\n}\n\n/**\n * Post-merge size caps — validates the WOULD-BE-PERSISTED document\n * (after the namespace merge), so a small patch can't tip the stored\n * cover over a cap unnoticed. `maxCoverBytes` bounds the entire\n * serialized document, which also closes the unbounded locale-map\n * key-count hole for `name` / `description`. Sizes are measured as\n * `JSON.stringify` length. Throws `ValidationError` on violation.\n */\nexport function validateCoverSize(\n cover: Cover,\n schema: ResolvedCoverSchema,\n): void {\n if (cover.custom !== undefined) {\n const customSize = JSON.stringify(cover.custom).length\n if (customSize > schema.maxCustomBytes) {\n throw new ValidationError(\n `setCover: custom exceeds the ${schema.maxCustomBytes}-byte cap ` +\n `(got ${customSize} bytes serialized, after merging with the stored namespaces).`,\n )\n }\n }\n const totalSize = JSON.stringify(cover).length\n if (totalSize > schema.maxCoverBytes) {\n throw new ValidationError(\n `setCover: the cover document exceeds the ${schema.maxCoverBytes}-byte cap ` +\n `(got ${totalSize} bytes serialized).`,\n )\n }\n}\n","/**\n * Validate-on-write for the cover. Runs at every `setCover` call;\n * the developer's schema decides which fields are allowed and the\n * size caps that apply.\n *\n * @module\n */\nimport { ValidationError } from '../../../kernel/errors.js'\nimport { validateCustomInput } from './custom.js'\nimport type {\n Cover,\n CoverText,\n JsonValue,\n ResolvedCoverSchema,\n CoverField,\n} from './types.js'\n\n/** Owner-supplied input — the subset of {@link Cover} the owner can set. */\nexport interface SetCoverInput {\n readonly name?: CoverText\n readonly description?: CoverText\n readonly icon?: string\n readonly defaultLocale?: string\n /**\n * Namespace-level patch for the cover's `custom` slot (#800):\n * provided namespaces replace their previous value, absent\n * namespaces are preserved, an explicit `null` deletes that\n * namespace. Requires `'custom'` in the schema's `fields` list —\n * the `cover: true` shorthand does NOT enable it.\n */\n readonly custom?: Record<string, JsonValue>\n}\n\nconst DATA_URL_PREFIX = /^data:([a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+);base64,/\n\n/**\n * Validate an owner-supplied cover input against the developer's\n * resolved schema. Throws `ValidationError` on the first violation;\n * returns void on success.\n *\n * The validator is deliberately strict: every fail mode is a hard\n * error rather than a silent drop, so the owner finds out immediately\n * which field they oversized rather than discovering a truncated\n * label months later.\n */\nexport function validateCoverInput(\n input: SetCoverInput,\n schema: ResolvedCoverSchema,\n): void {\n const allowed = new Set<CoverField>(schema.fields)\n\n // Reject any key not in the schema's allowed-field list.\n for (const key of Object.keys(input)) {\n const known: CoverField | undefined =\n key === 'name' || key === 'description' || key === 'icon' || key === 'defaultLocale' || key === 'custom'\n ? key\n : undefined\n if (!known) {\n throw new ValidationError(\n `setCover: unknown field \"${key}\". ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n if (!allowed.has(known)) {\n throw new ValidationError(\n `setCover: field \"${known}\" is not enabled in this vault's schema. ` +\n `Allowed fields: ${[...allowed].join(', ')}.`,\n )\n }\n }\n\n if (input.name !== undefined) {\n validateText(input.name, 'name', schema.maxStringChars)\n }\n if (input.description !== undefined) {\n validateText(input.description, 'description', schema.maxStringChars)\n }\n if (input.icon !== undefined) {\n validateIcon(input.icon, schema)\n }\n if (input.defaultLocale !== undefined && typeof input.defaultLocale !== 'string') {\n throw new ValidationError(\n `setCover: defaultLocale must be a string (BCP-47), got ${typeof input.defaultLocale}.`,\n )\n }\n if (input.custom !== undefined) {\n validateCustomInput(input.custom)\n }\n}\n\nfunction validateText(\n value: CoverText,\n field: string,\n maxChars: number,\n): void {\n if (typeof value === 'string') {\n if (value.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field} exceeds the ${maxChars}-character cap (got ${value.length}).`,\n )\n }\n return\n }\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new ValidationError(\n `setCover: ${field} must be a string or { [locale]: string } map, got ${typeof value}.`,\n )\n }\n // Locale map. Each value must be a non-empty string within the cap.\n for (const [locale, str] of Object.entries(value)) {\n if (typeof str !== 'string') {\n throw new ValidationError(\n `setCover: ${field}[${locale}] must be a string, got ${typeof str}.`,\n )\n }\n if (str.length > maxChars) {\n throw new ValidationError(\n `setCover: ${field}[${locale}] exceeds the ${maxChars}-character cap (got ${str.length}).`,\n )\n }\n }\n}\n\nfunction validateIcon(icon: string, schema: ResolvedCoverSchema): void {\n if (typeof icon !== 'string') {\n throw new ValidationError(\n `setCover: icon must be a data: URL string, got ${typeof icon}.`,\n )\n }\n if (icon.length > schema.maxIconBytes) {\n throw new ValidationError(\n `setCover: icon exceeds the ${schema.maxIconBytes}-byte cap (got ${icon.length}).`,\n )\n }\n const m = DATA_URL_PREFIX.exec(icon)\n if (!m) {\n throw new ValidationError(\n 'setCover: icon must be a base64 data URL ' +\n '(`data:image/png;base64,…` or `data:image/svg+xml;base64,…`). ' +\n 'External URLs are not supported in v1.',\n )\n }\n const mime = m[1]!\n if (!schema.iconMimeTypes.includes(mime)) {\n throw new ValidationError(\n `setCover: icon MIME type \"${mime}\" is not allowed. ` +\n `Permitted types: ${schema.iconMimeTypes.join(', ')}.`,\n )\n }\n}\n\n/**\n * Lightweight runtime predicate — used by the bundle header\n * validator to recognise a cover without requiring it. (The wire\n * discriminator keeps its frozen name: `_noydb_public: 1`.)\n */\nexport function isCover(x: unknown): x is Cover {\n if (x === null || typeof x !== 'object' || Array.isArray(x)) return false\n const obj = x as Record<string, unknown>\n return obj['_noydb_public'] === 1 && typeof obj['version'] === 'number'\n}\n","/**\n * Persistence helpers for `_meta/public-envelope` — the cover's\n * frozen wire location. Mirrors the bypass-AES pattern used by\n * `_meta/handle` and `_meta/policy` — the document is plaintext\n * JSON, the envelope's `_iv` field is left empty.\n *\n * @module\n */\nimport type { NoydbStore, EncryptedEnvelope } from '../../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../../kernel/types.js'\nimport type { Cover } from './types.js'\nimport { isCover } from './schema.js'\n\n/**\n * Reserved id for the vault-level cover record. The VALUE is frozen\n * wire format — the record predates the #799 rename and stays at\n * `_meta/public-envelope` so existing vaults need no migration.\n */\nexport const COVER_RECORD_ID = 'public-envelope'\n\n/**\n * Read the cover from `_meta/public-envelope`. Returns `undefined`\n * when no cover has been persisted (fresh vault, or a vault written\n * before the feature was enabled). Tolerates corrupted documents —\n * a JSON parse failure surfaces as `undefined`, not a thrown error,\n * mirroring `_meta/handle`'s contract.\n */\nexport async function loadCover(\n store: NoydbStore,\n vault: string,\n): Promise<Cover | undefined> {\n const envelope = await store.get(vault, '_meta', COVER_RECORD_ID)\n if (!envelope) return undefined\n try {\n const parsed = JSON.parse(envelope._data) as unknown\n if (!isCover(parsed)) return undefined\n return parsed\n } catch {\n return undefined\n }\n}\n\n/** Persist the cover. Idempotent — overwrites any prior write. */\nexport async function saveCover(\n store: NoydbStore,\n vault: string,\n cover: Cover,\n): Promise<void> {\n const wireEnvelope: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: 1,\n _ts: new Date().toISOString(),\n _iv: '',\n _data: JSON.stringify(cover),\n }\n await store.put(vault, '_meta', COVER_RECORD_ID, wireEnvelope)\n}\n\n/**\n * Public, no-key reader. Plain function, not a method on `Noydb` —\n * the whole point is it works without an authenticated session, so\n * a UI can show \"Acme 2026 Tax Records\" before unlocking.\n *\n * Resolves any `name` / `description` locale map through the supplied\n * `locale` (when provided). Omitting `locale` returns the raw\n * cover, which a multilingual picker can render as it pleases.\n */\nexport async function readCover(\n store: NoydbStore,\n vault: string,\n opts: { readonly locale?: string } = {},\n): Promise<Cover | undefined> {\n const raw = await loadCover(store, vault)\n if (!raw) return undefined\n if (opts.locale === undefined) return raw\n return resolveLocale(raw, opts.locale)\n}\n\n/**\n * Resolve the locale-map fields (`name`, `description`) of a cover\n * to plain strings for the requested locale, falling back through\n * `defaultLocale` and then any available translation.\n *\n * @internal\n */\nexport function resolveLocale(\n cover: Cover,\n locale: string,\n): Cover {\n return {\n ...cover,\n ...(cover.name !== undefined ? { name: pickLocale(cover.name, locale, cover.defaultLocale) } : {}),\n ...(cover.description !== undefined ? { description: pickLocale(cover.description, locale, cover.defaultLocale) } : {}),\n }\n}\n\n/**\n * Resolve a `string | { [locale]: string }` value to a string for a\n * given locale. Exported so the bundle reader can reuse it without\n * duplicating the fallback chain.\n *\n * **Looser than `resolveI18nText`** — the hub's record-field resolver\n * throws `LocaleNotSpecifiedError` when no translation matches, but\n * label semantics deliberately prefer \"show *something*\" over\n * throwing. The fallback chain is:\n * 1. Exact `locale` match.\n * 2. `defaultLocale` (when supplied on the cover).\n * 3. First non-empty value in the map.\n * 4. Empty string (only if every translation is empty — pathological).\n *\n * This deviation is documented in `https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md`.\n */\nexport function pickLocale(\n value: string | Record<string, string>,\n locale: string,\n defaultLocale: string | undefined,\n): string {\n if (typeof value === 'string') return value\n if (value[locale] !== undefined && value[locale] !== '') return value[locale]\n if (defaultLocale && value[defaultLocale] !== undefined && value[defaultLocale] !== '') {\n return value[defaultLocale]\n }\n for (const v of Object.values(value)) {\n if (v !== '') return v\n }\n return ''\n}\n"],"mappings":";;;;;;;;AAuBA,IAAM,qBAAqB;AAG3B,IAAM,mBAAmB;AAUlB,SAAS,oBAAoB,QAAyC;AAC3E,MAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GAAG;AAC1E,UAAM,IAAI;AAAA,MACR,iEACE,MAAM,QAAQ,MAAM,IAAI,UAAU,OAAO,MAC3C;AAAA,IACF;AAAA,EACF;AACA,aAAW,CAAC,IAAI,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAChD,QAAI,CAAC,mBAAmB,KAAK,EAAE,GAAG;AAChC,YAAM,IAAI;AAAA,QACR,+BAA+B,EAAE;AAAA,MAGnC;AAA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,GAAI,MAAM,gBAAgB,SAAY,EAAE,aAAa,WAAW,MAAM,aAAa,QAAQ,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EACvH;AACF;AAkBO,SAAS,WACd,OACA,QACA,eACQ;AACR,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,MAAM,MAAM,MAAM,UAAa,MAAM,MAAM,MAAM,GAAI,QAAO,MAAM,MAAM;AAC5E,MAAI,iBAAiB,MAAM,aAAa,MAAM,UAAa,MAAM,aAAa,MAAM,IAAI;AACtF,WAAO,MAAM,aAAa;AAAA,EAC5B;AACA,aAAW,KAAK,OAAO,OAAO,KAAK,GAAG;AACpC,QAAI,MAAM,GAAI,QAAO;AAAA,EACvB;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
envelopePayloadHash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JLHKBAFY.js";
|
|
4
4
|
import {
|
|
5
5
|
NOYDB_FORMAT_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5BHNQNBI.js";
|
|
7
7
|
import {
|
|
8
8
|
DictKeyMissingError,
|
|
9
9
|
PermissionDeniedError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IGM563N5.js";
|
|
11
11
|
|
|
12
12
|
// src/via/lookup/handle.ts
|
|
13
13
|
function isDeleteMarker(envelope) {
|
|
@@ -389,4 +389,4 @@ export {
|
|
|
389
389
|
dictCollectionName,
|
|
390
390
|
LookupHandle
|
|
391
391
|
};
|
|
392
|
-
//# sourceMappingURL=chunk-
|
|
392
|
+
//# sourceMappingURL=chunk-BZEPJJOK.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dekKey
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MSO2C3KG.js";
|
|
4
4
|
import {
|
|
5
5
|
generateULID
|
|
6
6
|
} from "./chunk-ZJADGNYF.js";
|
|
7
7
|
import {
|
|
8
8
|
openEnvelopeJson
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PEY6ZTCF.js";
|
|
10
10
|
import {
|
|
11
11
|
encrypt,
|
|
12
12
|
unwrapKey,
|
|
13
13
|
wrapKey
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5P5AAXYA.js";
|
|
15
15
|
import {
|
|
16
16
|
DelegationTargetMissingError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IGM563N5.js";
|
|
18
18
|
|
|
19
19
|
// src/with-party/team/delegation.ts
|
|
20
20
|
var DELEGATIONS_COLLECTION = "_delegations";
|
|
@@ -96,4 +96,4 @@ export {
|
|
|
96
96
|
loadActiveDelegations,
|
|
97
97
|
revokeDelegation
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-BZK6JEX4.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
freezeAndDeleteClosure,
|
|
3
3
|
randomId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XULHFSHO.js";
|
|
5
5
|
import {
|
|
6
6
|
buildAccessibleBundle,
|
|
7
7
|
resolveAccessibleCollections
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-25ZDB25Z.js";
|
|
9
9
|
import {
|
|
10
10
|
NOYDB_FORMAT_VERSION
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5BHNQNBI.js";
|
|
12
12
|
import {
|
|
13
13
|
NoydbError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IGM563N5.js";
|
|
15
15
|
|
|
16
16
|
// src/with-audit/portability/request-withdrawal.ts
|
|
17
17
|
var WITHDRAWAL_REQUESTS_COLLECTION = "_user_withdrawal_requests";
|
|
@@ -161,4 +161,4 @@ export {
|
|
|
161
161
|
approveWithdrawal,
|
|
162
162
|
rejectWithdrawal
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-CCT4WZI6.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
FieldNotQueryableError,
|
|
7
7
|
IndexRequiredError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IGM563N5.js";
|
|
9
9
|
|
|
10
10
|
// src/with-lookup/indexing/persisted-indexes.ts
|
|
11
11
|
var IDX_PREFIX = "_idx/";
|
|
@@ -521,4 +521,4 @@ export {
|
|
|
521
521
|
PersistedCollectionIndex,
|
|
522
522
|
LazyQuery
|
|
523
523
|
};
|
|
524
|
-
//# sourceMappingURL=chunk-
|
|
524
|
+
//# sourceMappingURL=chunk-CGPO3ZYB.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sha256Hex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5P5AAXYA.js";
|
|
4
4
|
import {
|
|
5
5
|
MaterializedViewSourceUnknownError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IGM563N5.js";
|
|
7
7
|
|
|
8
8
|
// src/with-formula/materialized-views/dependency-analyzer.ts
|
|
9
9
|
function analyzeDependencies(query) {
|
|
@@ -366,4 +366,4 @@ export {
|
|
|
366
366
|
MaterializedViewRegistry,
|
|
367
367
|
wrapDbWithPredicates
|
|
368
368
|
};
|
|
369
|
-
//# sourceMappingURL=chunk-
|
|
369
|
+
//# sourceMappingURL=chunk-DEQ2JTBR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DerivationCycleError,
|
|
3
3
|
MaterializedViewCycleError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IGM563N5.js";
|
|
5
5
|
|
|
6
6
|
// src/kernel/via/graph.ts
|
|
7
7
|
var DEFAULT_POSTURE = { encryptedAtRest: "envelope", queryable: "full", exportable: true, forgettable: false };
|
|
@@ -341,4 +341,4 @@ export {
|
|
|
341
341
|
DEFAULT_POSTURE,
|
|
342
342
|
ViaGraph
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-E2R5NRZD.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sha256Hex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5P5AAXYA.js";
|
|
4
4
|
|
|
5
5
|
// src/with-shape/persisted-schemas/canonicalize.ts
|
|
6
6
|
function canonicalize(value) {
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
isZod4Schema,
|
|
92
92
|
derivePersistedSchema
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-EDC6MLXV.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ValidationError
|
|
3
|
+
} from "./chunk-IGM563N5.js";
|
|
4
|
+
|
|
5
|
+
// src/with-audit/periods/window.ts
|
|
6
|
+
var PERIODS_COLLECTION = "_periods";
|
|
7
|
+
var PERIOD_FREEZES_COLLECTION = "_period_freezes";
|
|
8
|
+
var PERIOD_ARCHIVES_COLLECTION = "_period_archives";
|
|
9
|
+
var PERIOD_TARGET_PURGES_COLLECTION = "_period_target_purges";
|
|
10
|
+
function periodExclusiveUpperBound(endDate) {
|
|
11
|
+
const ms = Date.parse(endDate);
|
|
12
|
+
if (Number.isNaN(ms)) throw new ValidationError(`freezePeriod: unparseable period endDate "${endDate}".`);
|
|
13
|
+
const dateOnly = /^\d{4}-\d{2}-\d{2}$/.test(endDate);
|
|
14
|
+
return new Date(ms + (dateOnly ? 864e5 : 1)).toISOString();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
PERIODS_COLLECTION,
|
|
19
|
+
PERIOD_FREEZES_COLLECTION,
|
|
20
|
+
PERIOD_ARCHIVES_COLLECTION,
|
|
21
|
+
PERIOD_TARGET_PURGES_COLLECTION,
|
|
22
|
+
periodExclusiveUpperBound
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-F4COUZLL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-audit/periods/window.ts"],"sourcesContent":["/**\n * Pure period-window primitives — the reserved collection names and the\n * exclusive-upper-bound computation shared by freeze (#604), archive (#613),\n * target-purge (#615) and the period-scoped sync pull (#807).\n *\n * Deliberately dependency-light (kernel errors only): the sync engine\n * (`with-party/team/sync-period-scope.ts`) imports THIS module, not\n * `periods.ts`, so a period-scoped pull never drags the ledger hash-chain\n * machinery (`sha256Hex`/`canonicalJson`) into a bundle that opted out of\n * the periods service.\n */\nimport { ValidationError } from '../../kernel/errors.js'\n\n/** The reserved collection name holding closed-period metadata. */\nexport const PERIODS_COLLECTION = '_periods'\n\n/** Sibling of {@link PERIODS_COLLECTION} holding freeze companions (#604). */\nexport const PERIOD_FREEZES_COLLECTION = '_period_freezes'\n\n/** Sibling of {@link PERIODS_COLLECTION} holding archive companions (#613). */\nexport const PERIOD_ARCHIVES_COLLECTION = '_period_archives'\n\n/** Sibling of {@link PERIODS_COLLECTION} holding target-purge companions (#615). */\nexport const PERIOD_TARGET_PURGES_COLLECTION = '_period_target_purges'\n\n/**\n * Exclusive upper bound for a period's delete-marker purge window (#604).\n * Markers carry no business date (empty body), only write-time `_ts`, so freeze\n * purges markers with `_ts < bound`, `bound` being the instant just after the\n * period's inclusive `endDate`: a date-only `endDate` seals through end-of-day\n * → next midnight; a full-timestamp `endDate` seals through that instant → +1ms.\n */\nexport function periodExclusiveUpperBound(endDate: string): string {\n const ms = Date.parse(endDate)\n if (Number.isNaN(ms)) throw new ValidationError(`freezePeriod: unparseable period endDate \"${endDate}\".`)\n const dateOnly = /^\\d{4}-\\d{2}-\\d{2}$/.test(endDate)\n return new Date(ms + (dateOnly ? 86_400_000 : 1)).toISOString()\n}\n"],"mappings":";;;;;AAcO,IAAM,qBAAqB;AAG3B,IAAM,4BAA4B;AAGlC,IAAM,6BAA6B;AAGnC,IAAM,kCAAkC;AASxC,SAAS,0BAA0B,SAAyB;AACjE,QAAM,KAAK,KAAK,MAAM,OAAO;AAC7B,MAAI,OAAO,MAAM,EAAE,EAAG,OAAM,IAAI,gBAAgB,6CAA6C,OAAO,IAAI;AACxG,QAAM,WAAW,sBAAsB,KAAK,OAAO;AACnD,SAAO,IAAI,KAAK,MAAM,WAAW,QAAa,EAAE,EAAE,YAAY;AAChE;","names":[]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ConflictError,
|
|
7
7
|
InvariantError,
|
|
8
8
|
ValidationError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IGM563N5.js";
|
|
10
10
|
|
|
11
11
|
// src/kernel/best-effort-revert.ts
|
|
12
12
|
async function bestEffortRevert(executed, adapter, compensate) {
|
|
@@ -231,7 +231,7 @@ async function runTransaction(db, fn, options, txInvariants) {
|
|
|
231
231
|
db._clearActiveTxContext(ctx);
|
|
232
232
|
}
|
|
233
233
|
if (ctx._amendment) {
|
|
234
|
-
const { GuardExecutor } = await import("./executor-
|
|
234
|
+
const { GuardExecutor } = await import("./executor-WQQRU6DO.js");
|
|
235
235
|
try {
|
|
236
236
|
for (const [vaultName, v] of ctx._amendmentVaults) {
|
|
237
237
|
const registry = v._getGuardRegistry();
|
|
@@ -368,4 +368,4 @@ export {
|
|
|
368
368
|
runTransaction,
|
|
369
369
|
revertExecuted
|
|
370
370
|
};
|
|
371
|
-
//# sourceMappingURL=chunk-
|
|
371
|
+
//# sourceMappingURL=chunk-FLHOTGOO.js.map
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
base64ToBuffer,
|
|
6
6
|
bufferToBase64
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5P5AAXYA.js";
|
|
8
8
|
import {
|
|
9
9
|
SessionExpiredError,
|
|
10
10
|
SessionNotFoundError,
|
|
11
11
|
SessionPolicyError,
|
|
12
12
|
ValidationError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IGM563N5.js";
|
|
14
14
|
|
|
15
15
|
// src/with-party/session/session.ts
|
|
16
16
|
var subtle = globalThis.crypto.subtle;
|
|
@@ -364,4 +364,4 @@ export {
|
|
|
364
364
|
clearDevUnlock,
|
|
365
365
|
isDevUnlockActive
|
|
366
366
|
};
|
|
367
|
-
//# sourceMappingURL=chunk-
|
|
367
|
+
//# sourceMappingURL=chunk-GBEXTC6Z.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
chainAnchor,
|
|
5
5
|
loadPeriods,
|
|
6
6
|
validatePeriodName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KR5EGWI4.js";
|
|
8
8
|
|
|
9
9
|
// src/with-audit/periods/active.ts
|
|
10
10
|
function withPeriods() {
|
|
@@ -20,4 +20,4 @@ function withPeriods() {
|
|
|
20
20
|
export {
|
|
21
21
|
withPeriods
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-GS3Q2KOZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PortabilityNotEnabledError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IGM563N5.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/portability/strategy.ts
|
|
6
6
|
var NO_PORTABILITY = {
|
|
@@ -27,4 +27,4 @@ var NO_PORTABILITY = {
|
|
|
27
27
|
export {
|
|
28
28
|
NO_PORTABILITY
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-GYB2QK5H.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
persistUserVisibility,
|
|
5
5
|
readUserVisibility,
|
|
6
6
|
saveUserEnvelope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7B4GPCX7.js";
|
|
8
8
|
import {
|
|
9
9
|
PolicyDeniedError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IGM563N5.js";
|
|
11
11
|
|
|
12
12
|
// src/with-party/directory/user-envelope/api.ts
|
|
13
13
|
var UserApi = class {
|
|
@@ -379,4 +379,4 @@ export {
|
|
|
379
379
|
UserApi,
|
|
380
380
|
createUserApi
|
|
381
381
|
};
|
|
382
|
-
//# sourceMappingURL=chunk-
|
|
382
|
+
//# sourceMappingURL=chunk-GZ2GKOF6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DerivationCapExceededError,
|
|
3
3
|
DerivationOutputShapeError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IGM563N5.js";
|
|
5
5
|
|
|
6
6
|
// src/with-formula/derivations/executor.ts
|
|
7
7
|
var DerivationExecutor = {
|
|
@@ -121,4 +121,4 @@ var DerivationExecutor = {
|
|
|
121
121
|
export {
|
|
122
122
|
DerivationExecutor
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-H4SMS4O2.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dictCollectionName
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BZEPJJOK.js";
|
|
4
4
|
import {
|
|
5
5
|
getAtPath,
|
|
6
6
|
presentI18nForJoin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XGVDLQJE.js";
|
|
8
8
|
import {
|
|
9
9
|
PeriodClosedError,
|
|
10
10
|
UnknownDictCodeError,
|
|
11
11
|
ValidationError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IGM563N5.js";
|
|
13
13
|
|
|
14
14
|
// src/via/lookup/registry.ts
|
|
15
15
|
function enforceStaticDictOnPut(staticFields, record) {
|
|
@@ -477,4 +477,4 @@ export {
|
|
|
477
477
|
ledgerAuditHook,
|
|
478
478
|
forgetDerivedFanout
|
|
479
479
|
};
|
|
480
|
-
//# sourceMappingURL=chunk-
|
|
480
|
+
//# sourceMappingURL=chunk-HGVFJL63.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
readDirectoryConfig,
|
|
6
6
|
readUserVisibility,
|
|
7
7
|
saveUserEnvelope
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7B4GPCX7.js";
|
|
9
9
|
import {
|
|
10
10
|
base64ToBuffer,
|
|
11
11
|
bufferToBase64,
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
generateSalt,
|
|
17
17
|
unwrapKey,
|
|
18
18
|
wrapKey
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5P5AAXYA.js";
|
|
20
20
|
import {
|
|
21
21
|
NOYDB_FORMAT_VERSION,
|
|
22
22
|
NOYDB_KEYRING_VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5BHNQNBI.js";
|
|
24
24
|
import {
|
|
25
25
|
DirectoryDisabledError,
|
|
26
26
|
InvalidKeyError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
PrivilegeEscalationError,
|
|
33
33
|
USER_ENVELOPE_COLLECTION,
|
|
34
34
|
ValidationError
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-IGM563N5.js";
|
|
36
36
|
|
|
37
37
|
// src/kernel/validation.ts
|
|
38
38
|
var WeakPassphraseError = class extends NoydbError {
|
|
@@ -775,4 +775,4 @@ export {
|
|
|
775
775
|
hasImportCapability,
|
|
776
776
|
evaluateImportCapability
|
|
777
777
|
};
|
|
778
|
-
//# sourceMappingURL=chunk-
|
|
778
|
+
//# sourceMappingURL=chunk-HVZT5T22.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PEY6ZTCF.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5P5AAXYA.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5BHNQNBI.js";
|
|
10
10
|
|
|
11
11
|
// src/with-shape/persisted-schemas/storage.ts
|
|
12
12
|
var SCHEMAS_COLLECTION = "_schemas";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
loadPersistedSchema,
|
|
47
47
|
savePersistedSchema
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-IGAIOGCN.js.map
|
|
@@ -308,6 +308,22 @@ var BlobIntentPendingError = class extends NoydbError {
|
|
|
308
308
|
this.recordId = recordId;
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
+
var BlobOfflineError = class extends NoydbError {
|
|
312
|
+
collection;
|
|
313
|
+
recordId;
|
|
314
|
+
slotName;
|
|
315
|
+
constructor(collection, recordId, slotName, detail, cause) {
|
|
316
|
+
super(
|
|
317
|
+
"BLOB_OFFLINE",
|
|
318
|
+
`Blob content for ${slotName !== void 0 ? `slot "${slotName}" on ` : ""}record "${recordId}" (collection "${collection}") is not available locally: ${detail}`
|
|
319
|
+
);
|
|
320
|
+
this.name = "BlobOfflineError";
|
|
321
|
+
this.collection = collection;
|
|
322
|
+
this.recordId = recordId;
|
|
323
|
+
if (slotName !== void 0) this.slotName = slotName;
|
|
324
|
+
if (cause !== void 0) this.cause = cause;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
311
327
|
var ElevationExpiredError = class extends NoydbError {
|
|
312
328
|
tier;
|
|
313
329
|
expiresAt;
|
|
@@ -1445,6 +1461,7 @@ export {
|
|
|
1445
1461
|
TierWriteRefusedError,
|
|
1446
1462
|
UnsupportedTierCompositionError,
|
|
1447
1463
|
BlobIntentPendingError,
|
|
1464
|
+
BlobOfflineError,
|
|
1448
1465
|
ElevationExpiredError,
|
|
1449
1466
|
AlreadyElevatedError,
|
|
1450
1467
|
TierDemoteDeniedError,
|
|
@@ -1551,4 +1568,4 @@ export {
|
|
|
1551
1568
|
ClassifiedRotationError,
|
|
1552
1569
|
SatelliteConfigError
|
|
1553
1570
|
};
|
|
1554
|
-
//# sourceMappingURL=chunk-
|
|
1571
|
+
//# sourceMappingURL=chunk-IGM563N5.js.map
|