@noy-db/hub 0.7.0-pre.12 → 0.7.0-pre.14
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/CHANGELOG.md +210 -0
- package/README.md +4 -3
- package/dist/{api-UE2XQKDN.js → api-JPZT6BDD.js} +1 -2
- package/dist/as/index.js +3 -4
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +0 -1
- package/dist/attestation/index.js +6 -7
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-R6A4VZRX.js → backup-AKWIMYWU.js} +1 -2
- package/dist/{backup-R6A4VZRX.js.map → backup-AKWIMYWU.js.map} +1 -1
- package/dist/blobs/index.js +0 -1
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +3 -4
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +0 -1
- package/dist/cargo/index.js +10 -11
- package/dist/{chunk-5FUULQ6F.js → chunk-2HVILGVR.js} +6 -6
- package/dist/{chunk-DJ3LNNZQ.js → chunk-3LK2XZCW.js} +2 -2
- package/dist/chunk-4SZMZAYN.js +1652 -0
- package/dist/chunk-4SZMZAYN.js.map +1 -0
- package/dist/chunk-66TQOPFM.js +37 -0
- package/dist/chunk-66TQOPFM.js.map +1 -0
- package/dist/{chunk-PQKG5AHH.js → chunk-6X6SEMEE.js} +4 -2
- package/dist/{chunk-PQKG5AHH.js.map → chunk-6X6SEMEE.js.map} +1 -1
- package/dist/{chunk-E3EBMC4G.js → chunk-AMODH7AU.js} +2 -2
- package/dist/{chunk-B2ZSGYSF.js → chunk-B2KCRDJM.js} +3 -3
- package/dist/{chunk-TO3EQ7HF.js → chunk-BLN54W3L.js} +2 -2
- package/dist/{chunk-WQF3QABE.js → chunk-BOBFL5TW.js} +9 -79
- package/dist/chunk-BOBFL5TW.js.map +1 -0
- package/dist/{chunk-XMF3GKUR.js → chunk-DRB6IHPS.js} +90 -910
- package/dist/chunk-DRB6IHPS.js.map +1 -0
- package/dist/{chunk-H7XCIM3Z.js → chunk-EKVNVJVV.js} +26 -16
- package/dist/chunk-EKVNVJVV.js.map +1 -0
- package/dist/{chunk-ZR2YMODS.js → chunk-EKZ6VZYF.js} +2 -2
- package/dist/{chunk-RTYJRFQO.js → chunk-EWPRPP3M.js} +1 -1
- package/dist/{chunk-JJR2JIN4.js → chunk-FFBYRWDJ.js} +2 -2
- package/dist/{chunk-VGICZPVE.js → chunk-FUJSIP4K.js} +2 -2
- package/dist/chunk-MGOXJIBV.js +176 -0
- package/dist/chunk-MGOXJIBV.js.map +1 -0
- package/dist/{chunk-PKJ43CMD.js → chunk-NLOLF6LD.js} +2 -2
- package/dist/{chunk-7NTBVFGD.js → chunk-NOSRK3ZZ.js} +5 -5
- package/dist/{chunk-HN4FNA4X.js → chunk-OMB2ZKIT.js} +8 -8
- package/dist/{chunk-Y4MJQ2UG.js → chunk-QQ2YMQZU.js} +2 -2
- package/dist/{chunk-URHRIAV6.js → chunk-REDOOY2Q.js} +2 -2
- package/dist/chunk-REDOOY2Q.js.map +1 -0
- package/dist/{chunk-YCXICMOY.js → chunk-RJ7NN2UR.js} +2 -2
- package/dist/chunk-RTBJ5IOO.js +87 -0
- package/dist/chunk-RTBJ5IOO.js.map +1 -0
- package/dist/{chunk-KL7AS3HV.js → chunk-SMH6SRX7.js} +6 -3
- package/dist/chunk-SMH6SRX7.js.map +1 -0
- package/dist/{chunk-QHW35ZON.js → chunk-TGPST6FK.js} +2 -2
- package/dist/{chunk-THNJ3IKU.js → chunk-ULUMAZ5S.js} +2 -2
- package/dist/{chunk-E5OHKSBD.js → chunk-V2PNPF6J.js} +3 -3
- package/dist/{chunk-NO272T7Q.js → chunk-V4PXLYWM.js} +2 -31
- package/dist/chunk-V4PXLYWM.js.map +1 -0
- package/dist/{chunk-BERJ4AWW.js → chunk-VGXZT72I.js} +2 -2
- package/dist/{chunk-2Z47NMFK.js → chunk-WZW37ZHL.js} +2 -2
- package/dist/{chunk-SWVNZQVR.js → chunk-YPXNAP72.js} +2 -169
- package/dist/chunk-YPXNAP72.js.map +1 -0
- package/dist/classified/index.js +1 -2
- package/dist/{classified-marker-67HBIJMZ.js → classified-marker-OO65UYXN.js} +3 -5
- package/dist/{classified-marker-67HBIJMZ.js.map → classified-marker-OO65UYXN.js.map} +1 -1
- package/dist/{collection-facade-MGGHQ3HU.js → collection-facade-VOWW732S.js} +4 -4
- package/dist/{computed-LSEZYRJS.js → computed-VPOKQK4N.js} +1 -2
- package/dist/consent/index.js +0 -1
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +0 -1
- package/dist/crdt/index.js +0 -1
- package/dist/crdt/index.js.map +1 -1
- package/dist/custody/index.js +1 -2
- package/dist/{dead-filter-M3NZUWBZ.js → dead-filter-OMMVBAKZ.js} +2 -3
- package/dist/{dead-filter-M3NZUWBZ.js.map → dead-filter-OMMVBAKZ.js.map} +1 -1
- package/dist/debug/index.js +0 -1
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-OLJUWTVA.js → delegation-VRYMQRCF.js} +1 -2
- package/dist/{delegation-OLJUWTVA.js.map → delegation-VRYMQRCF.js.map} +1 -1
- package/dist/derivations/index.js +7 -4
- package/dist/{derive-LY47HG7Q.js → derive-HHBRFS2U.js} +2 -3
- package/dist/directory/index.js +0 -1
- package/dist/{dispatch-XEBHUGBV.js → dispatch-DC3LQJ3S.js} +14 -10
- package/dist/dispatch-DC3LQJ3S.js.map +1 -0
- package/dist/{dispatch-44J4TL72.js → dispatch-GGFBWQU7.js} +5 -7
- package/dist/{dispatch-44J4TL72.js.map → dispatch-GGFBWQU7.js.map} +1 -1
- package/dist/{enclave-4YBQK77G.js → enclave-VM2YQONI.js} +1 -2
- package/dist/{executor-TOLPBHOC.js → executor-5NIMLSKZ.js} +1 -2
- package/dist/{executor-KSPGNVDO.js → executor-5XJNV5H5.js} +4 -4
- package/dist/{executor-MZJXBWNM.js → executor-AQVXV5GZ.js} +1 -2
- package/dist/{export-accessible-LGV6IAFX.js → export-accessible-2LOBM67T.js} +3 -4
- package/dist/{extract-partition-RYJZIKQZ.js → extract-partition-AZGSEMIF.js} +3 -4
- package/dist/{fanout-sidecar-TSFPXY5C.js → fanout-sidecar-HJIVUPTD.js} +1 -2
- package/dist/{fanout-sidecar-TSFPXY5C.js.map → fanout-sidecar-HJIVUPTD.js.map} +1 -1
- package/dist/{fence-watcher-ZVSMLKQD.js → fence-watcher-U2PW6JU5.js} +1 -3
- package/dist/{fence-watcher-ZVSMLKQD.js.map → fence-watcher-U2PW6JU5.js.map} +1 -1
- package/dist/{find-LC7P63MX.js → find-2ABFCZX4.js} +1 -2
- package/dist/forget/index.js +0 -1
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +0 -1
- package/dist/history/index.js +0 -1
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +0 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.js +43 -40
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +0 -1
- package/dist/indexing/index.js.map +1 -1
- package/dist/introspection/index.js +2 -3
- package/dist/{issue-IOXM3RSJ.js → issue-RH4H733Z.js} +1 -2
- package/dist/{json-schema-I22JCYCG.js → json-schema-V3M5MUCM.js} +1 -3
- package/dist/{json-schema-I22JCYCG.js.map → json-schema-V3M5MUCM.js.map} +1 -1
- package/dist/kernel/collection-config.d.ts +34 -0
- package/dist/lazy/index.js +3 -3
- package/dist/{ledger-HXHIOD36.js → ledger-454SU3VE.js} +1 -2
- package/dist/{liberate-4APIV7FR.js → liberate-AAZSP2BT.js} +5 -6
- package/dist/{link-set-6RAHEKZN.js → link-set-67CAMUAL.js} +1 -2
- package/dist/{managed-secret-P3JQ7ZG4.js → managed-secret-NHRYG7CD.js} +1 -2
- package/dist/materialized-views/index.js +5 -5
- package/dist/{migrate-cek-25KNTS5U.js → migrate-cek-5ENH64AA.js} +1 -2
- package/dist/{migrate-cek-25KNTS5U.js.map → migrate-cek-5ENH64AA.js.map} +1 -1
- package/dist/money/index.js +0 -1
- package/dist/{noydb-JJXPICIC.js → noydb-Y53CQHZK.js} +17 -15
- package/dist/overlay-views/index.js +0 -1
- package/dist/periods/index.js +1 -2
- package/dist/pod/index.js +18 -16
- package/dist/{pod-handle-6II7KFBR.js → pod-handle-S7AMCJIF.js} +2 -3
- package/dist/{pod-handle-6II7KFBR.js.map → pod-handle-S7AMCJIF.js.map} +1 -1
- package/dist/policy/index.js +0 -1
- package/dist/portability/index.js +6 -7
- package/dist/portability/index.js.map +1 -1
- package/dist/{post-register-BPJ36A6D.js → post-register-HIYY4Y5S.js} +4 -5
- package/dist/{post-register-BPJ36A6D.js.map → post-register-HIYY4Y5S.js.map} +1 -1
- package/dist/{purge-scope-FGNNLWHD.js → purge-scope-4HEFPDOW.js} +1 -3
- package/dist/{purge-scope-FGNNLWHD.js.map → purge-scope-4HEFPDOW.js.map} +1 -1
- package/dist/query/index.js +0 -1
- package/dist/{read-only-facade-CHCKSEPD.js → read-only-facade-BIGO37U3.js} +1 -2
- package/dist/reduce/index.js +0 -1
- package/dist/reduce/index.js.map +1 -1
- package/dist/{register-AEOOGKNO.js → register-7OJWAWT5.js} +3 -4
- package/dist/{registry-SKSOUXNF.js → registry-23WF3TGH.js} +1 -2
- package/dist/{registry-SHMGHEK4.js → registry-4AYVUNXK.js} +1 -2
- package/dist/{registry-I6FP4677.js → registry-5MVJGPXW.js} +1 -2
- package/dist/{registry-BZQIVNNO.js → registry-HDINK5QW.js} +8 -5
- package/dist/{request-withdrawal-6HJT4ODF.js → request-withdrawal-P5EQATZ7.js} +5 -6
- package/dist/{reveal-DDQBDWPM.js → reveal-IMGQ2EE5.js} +1 -2
- package/dist/{reveal-DDQBDWPM.js.map → reveal-IMGQ2EE5.js.map} +1 -1
- package/dist/{revoke-U7U3FMXU.js → revoke-POHP4GPB.js} +1 -2
- package/dist/satellites/index.js +0 -1
- package/dist/schema-update/index.js +0 -1
- package/dist/sealed-record/index.js +3 -4
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +1 -2
- package/dist/{seed-3RXT4VGN.js → seed-UYR6YG3V.js} +1 -2
- package/dist/{seed-3RXT4VGN.js.map → seed-UYR6YG3V.js.map} +1 -1
- package/dist/sequence/index.js +0 -1
- package/dist/session/index.js +0 -1
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +0 -1
- package/dist/shadow/index.js.map +1 -1
- package/dist/share-link/index.js +0 -1
- package/dist/share-link/index.js.map +1 -1
- package/dist/{signer-7NK7TMWU.js → signer-5K3WDHOC.js} +1 -2
- package/dist/snapshots/index.js +1 -2
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-KSPG6LFX.js → stale-AU74OPUW.js} +2 -3
- package/dist/{storage-WP4M7IFO.js → storage-AVJA5BTW.js} +1 -2
- package/dist/store/index.js +0 -1
- package/dist/{store-coordination-provider-O2VUEMJH.js → store-coordination-provider-RX2CGWXV.js} +1 -2
- package/dist/{store-coordination-provider-O2VUEMJH.js.map → store-coordination-provider-RX2CGWXV.js.map} +1 -1
- package/dist/sync/index.js +0 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +0 -1
- package/dist/tiers/index.js +1 -2
- package/dist/to/index.js +0 -1
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +2 -3
- package/dist/transactions/index.js.map +1 -1
- package/dist/{ulid-VQW6ERQN.js → ulid-4MKXG325.js} +1 -2
- package/dist/util/index.js +0 -1
- package/dist/util/index.js.map +1 -1
- package/dist/{vault-diff-FE5J35NJ.js → vault-diff-C6WUJFNP.js} +1 -2
- package/dist/vault-head/index.js +0 -1
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-JBXCAGDL.js → verify-KOV2G5D6.js} +1 -2
- package/dist/{verify-JBXCAGDL.js.map → verify-KOV2G5D6.js.map} +1 -1
- package/dist/{walk-P3E6QSNC.js → walk-ERAJ5RHO.js} +3 -4
- package/dist/with-formula/derivations/registry.d.ts +6 -1
- package/dist/with-shape/introspection/describe.d.ts +2 -33
- package/dist/with-shape/introspection/field-meta.d.ts +86 -0
- package/dist/{withdraw-accessible-6Q7NE4EY.js → withdraw-accessible-42D32Z7G.js} +4 -5
- package/package.json +7 -3
- package/dist/chunk-7BE7ZDVQ.js +0 -722
- package/dist/chunk-7BE7ZDVQ.js.map +0 -1
- package/dist/chunk-H7XCIM3Z.js.map +0 -1
- package/dist/chunk-KL7AS3HV.js.map +0 -1
- package/dist/chunk-NO272T7Q.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-SWVNZQVR.js.map +0 -1
- package/dist/chunk-URHRIAV6.js.map +0 -1
- package/dist/chunk-WQF3QABE.js.map +0 -1
- package/dist/chunk-XMF3GKUR.js.map +0 -1
- package/dist/dispatch-XEBHUGBV.js.map +0 -1
- package/dist/withdraw-accessible-6Q7NE4EY.js.map +0 -1
- package/dist/zod-HAJM7LMS.js +0 -14763
- package/dist/zod-HAJM7LMS.js.map +0 -1
- /package/dist/{api-UE2XQKDN.js.map → api-JPZT6BDD.js.map} +0 -0
- /package/dist/{chunk-5FUULQ6F.js.map → chunk-2HVILGVR.js.map} +0 -0
- /package/dist/{chunk-DJ3LNNZQ.js.map → chunk-3LK2XZCW.js.map} +0 -0
- /package/dist/{chunk-E3EBMC4G.js.map → chunk-AMODH7AU.js.map} +0 -0
- /package/dist/{chunk-B2ZSGYSF.js.map → chunk-B2KCRDJM.js.map} +0 -0
- /package/dist/{chunk-TO3EQ7HF.js.map → chunk-BLN54W3L.js.map} +0 -0
- /package/dist/{chunk-ZR2YMODS.js.map → chunk-EKZ6VZYF.js.map} +0 -0
- /package/dist/{chunk-RTYJRFQO.js.map → chunk-EWPRPP3M.js.map} +0 -0
- /package/dist/{chunk-JJR2JIN4.js.map → chunk-FFBYRWDJ.js.map} +0 -0
- /package/dist/{chunk-VGICZPVE.js.map → chunk-FUJSIP4K.js.map} +0 -0
- /package/dist/{chunk-PKJ43CMD.js.map → chunk-NLOLF6LD.js.map} +0 -0
- /package/dist/{chunk-7NTBVFGD.js.map → chunk-NOSRK3ZZ.js.map} +0 -0
- /package/dist/{chunk-HN4FNA4X.js.map → chunk-OMB2ZKIT.js.map} +0 -0
- /package/dist/{chunk-Y4MJQ2UG.js.map → chunk-QQ2YMQZU.js.map} +0 -0
- /package/dist/{chunk-YCXICMOY.js.map → chunk-RJ7NN2UR.js.map} +0 -0
- /package/dist/{chunk-QHW35ZON.js.map → chunk-TGPST6FK.js.map} +0 -0
- /package/dist/{chunk-THNJ3IKU.js.map → chunk-ULUMAZ5S.js.map} +0 -0
- /package/dist/{chunk-E5OHKSBD.js.map → chunk-V2PNPF6J.js.map} +0 -0
- /package/dist/{chunk-BERJ4AWW.js.map → chunk-VGXZT72I.js.map} +0 -0
- /package/dist/{chunk-2Z47NMFK.js.map → chunk-WZW37ZHL.js.map} +0 -0
- /package/dist/{chunk-PZ5AY32C.js.map → collection-facade-VOWW732S.js.map} +0 -0
- /package/dist/{collection-facade-MGGHQ3HU.js.map → computed-VPOKQK4N.js.map} +0 -0
- /package/dist/{computed-LSEZYRJS.js.map → derive-HHBRFS2U.js.map} +0 -0
- /package/dist/{derive-LY47HG7Q.js.map → enclave-VM2YQONI.js.map} +0 -0
- /package/dist/{enclave-4YBQK77G.js.map → executor-5NIMLSKZ.js.map} +0 -0
- /package/dist/{executor-KSPGNVDO.js.map → executor-5XJNV5H5.js.map} +0 -0
- /package/dist/{executor-MZJXBWNM.js.map → executor-AQVXV5GZ.js.map} +0 -0
- /package/dist/{executor-TOLPBHOC.js.map → export-accessible-2LOBM67T.js.map} +0 -0
- /package/dist/{export-accessible-LGV6IAFX.js.map → extract-partition-AZGSEMIF.js.map} +0 -0
- /package/dist/{extract-partition-RYJZIKQZ.js.map → find-2ABFCZX4.js.map} +0 -0
- /package/dist/{find-LC7P63MX.js.map → issue-RH4H733Z.js.map} +0 -0
- /package/dist/{issue-IOXM3RSJ.js.map → ledger-454SU3VE.js.map} +0 -0
- /package/dist/{ledger-HXHIOD36.js.map → liberate-AAZSP2BT.js.map} +0 -0
- /package/dist/{liberate-4APIV7FR.js.map → link-set-67CAMUAL.js.map} +0 -0
- /package/dist/{link-set-6RAHEKZN.js.map → managed-secret-NHRYG7CD.js.map} +0 -0
- /package/dist/{managed-secret-P3JQ7ZG4.js.map → noydb-Y53CQHZK.js.map} +0 -0
- /package/dist/{noydb-JJXPICIC.js.map → read-only-facade-BIGO37U3.js.map} +0 -0
- /package/dist/{read-only-facade-CHCKSEPD.js.map → register-7OJWAWT5.js.map} +0 -0
- /package/dist/{register-AEOOGKNO.js.map → registry-23WF3TGH.js.map} +0 -0
- /package/dist/{registry-BZQIVNNO.js.map → registry-4AYVUNXK.js.map} +0 -0
- /package/dist/{registry-I6FP4677.js.map → registry-5MVJGPXW.js.map} +0 -0
- /package/dist/{registry-SHMGHEK4.js.map → registry-HDINK5QW.js.map} +0 -0
- /package/dist/{registry-SKSOUXNF.js.map → request-withdrawal-P5EQATZ7.js.map} +0 -0
- /package/dist/{request-withdrawal-6HJT4ODF.js.map → revoke-POHP4GPB.js.map} +0 -0
- /package/dist/{revoke-U7U3FMXU.js.map → signer-5K3WDHOC.js.map} +0 -0
- /package/dist/{signer-7NK7TMWU.js.map → stale-AU74OPUW.js.map} +0 -0
- /package/dist/{stale-KSPG6LFX.js.map → storage-AVJA5BTW.js.map} +0 -0
- /package/dist/{storage-WP4M7IFO.js.map → ulid-4MKXG325.js.map} +0 -0
- /package/dist/{ulid-VQW6ERQN.js.map → vault-diff-C6WUJFNP.js.map} +0 -0
- /package/dist/{vault-diff-FE5J35NJ.js.map → walk-ERAJ5RHO.js.map} +0 -0
- /package/dist/{walk-P3E6QSNC.js.map → withdraw-accessible-42D32Z7G.js.map} +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveStaleOnRead
|
|
3
|
-
} from "./chunk-KL7AS3HV.js";
|
|
4
1
|
import {
|
|
5
2
|
isManifestReservedCollection
|
|
6
3
|
} from "./chunk-EPFF7LOX.js";
|
|
@@ -15,15 +12,16 @@ import {
|
|
|
15
12
|
hashFields,
|
|
16
13
|
validateSatelliteDeclaration
|
|
17
14
|
} from "./chunk-TUFM4UZP.js";
|
|
15
|
+
import {
|
|
16
|
+
resolveStaleOnRead
|
|
17
|
+
} from "./chunk-SMH6SRX7.js";
|
|
18
18
|
import {
|
|
19
19
|
loadFence
|
|
20
20
|
} from "./chunk-GM4IM7TC.js";
|
|
21
21
|
import {
|
|
22
|
-
VectorSet,
|
|
23
22
|
buildPersistedIndexCallbacks,
|
|
24
|
-
encodeVecId,
|
|
25
23
|
syncTierSearch
|
|
26
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BOBFL5TW.js";
|
|
27
25
|
import {
|
|
28
26
|
isBaseLive,
|
|
29
27
|
liveBaseIdSet
|
|
@@ -34,16 +32,11 @@ import {
|
|
|
34
32
|
import {
|
|
35
33
|
NO_ATTESTATION
|
|
36
34
|
} from "./chunk-Q7HZX3IF.js";
|
|
37
|
-
import {
|
|
38
|
-
NO_CLASSIFIED,
|
|
39
|
-
guardClassifiedCompat,
|
|
40
|
-
resolveClassifiedFields
|
|
41
|
-
} from "./chunk-KCUIMITG.js";
|
|
42
35
|
import {
|
|
43
36
|
NO_TIERS,
|
|
44
37
|
classifySealedShred,
|
|
45
38
|
syncDerivedOutputs
|
|
46
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-EWPRPP3M.js";
|
|
47
40
|
import {
|
|
48
41
|
NO_PORTABILITY
|
|
49
42
|
} from "./chunk-BZ3534YM.js";
|
|
@@ -68,20 +61,48 @@ import {
|
|
|
68
61
|
import {
|
|
69
62
|
CustodyApi,
|
|
70
63
|
NO_CUSTODY
|
|
71
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-QQ2YMQZU.js";
|
|
72
65
|
import {
|
|
73
66
|
DEFAULT_POSTURE,
|
|
67
|
+
EXPORT_REDACTION_MARKER,
|
|
74
68
|
ViaGraph,
|
|
69
|
+
ViaPipeline,
|
|
75
70
|
buildDescription,
|
|
71
|
+
collectKnownFieldNames,
|
|
72
|
+
computedEntryParts,
|
|
76
73
|
deriveZodFields,
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
exportRedact,
|
|
75
|
+
guardReconcileCollisions,
|
|
76
|
+
mergeViaFields,
|
|
77
|
+
resolveCollectionConfig,
|
|
78
|
+
resolveComputedEdges,
|
|
79
|
+
resolveDescribeFieldIds,
|
|
80
|
+
resolveVirtualMoneyFields
|
|
81
|
+
} from "./chunk-4SZMZAYN.js";
|
|
79
82
|
import {
|
|
80
83
|
findMatchingIdsByPairs
|
|
81
84
|
} from "./chunk-TFMM5DBB.js";
|
|
85
|
+
import {
|
|
86
|
+
encodeVecId
|
|
87
|
+
} from "./chunk-RTBJ5IOO.js";
|
|
88
|
+
import {
|
|
89
|
+
NO_CLASSIFIED,
|
|
90
|
+
guardClassifiedCompat,
|
|
91
|
+
resolveClassifiedFields
|
|
92
|
+
} from "./chunk-KCUIMITG.js";
|
|
82
93
|
import {
|
|
83
94
|
derivePersistedSchema
|
|
84
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-REDOOY2Q.js";
|
|
96
|
+
import {
|
|
97
|
+
findRollupSpecForIntent,
|
|
98
|
+
forgetDerivedFanout,
|
|
99
|
+
ledgerAuditHook,
|
|
100
|
+
putDerivedOutput,
|
|
101
|
+
resolveRollupDeleteIntents,
|
|
102
|
+
runGraphDispatchWave,
|
|
103
|
+
selfWriteFieldEqual,
|
|
104
|
+
touchFor
|
|
105
|
+
} from "./chunk-MGOXJIBV.js";
|
|
85
106
|
import {
|
|
86
107
|
buildLookupAltIndex,
|
|
87
108
|
buildLookupSnapshotRows,
|
|
@@ -90,22 +111,13 @@ import {
|
|
|
90
111
|
coerceLookupKey,
|
|
91
112
|
collectLookupDictCompat,
|
|
92
113
|
enforceStaticDictOnPut,
|
|
93
|
-
findRollupSpecForIntent,
|
|
94
|
-
forgetDerivedFanout,
|
|
95
|
-
isLookupDescriptor,
|
|
96
|
-
ledgerAuditHook,
|
|
97
114
|
matchesReferencingValue,
|
|
98
|
-
putDerivedOutput,
|
|
99
115
|
registerLookupRefEdges,
|
|
100
116
|
reservedDictDepsOf,
|
|
101
117
|
resolveDictSource,
|
|
102
118
|
resolveLabelFromMap,
|
|
103
|
-
resolveRollupDeleteIntents,
|
|
104
|
-
runGraphDispatchWave,
|
|
105
|
-
selfWriteFieldEqual,
|
|
106
|
-
touchFor,
|
|
107
119
|
updateReferencingRecords
|
|
108
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-YPXNAP72.js";
|
|
109
121
|
import {
|
|
110
122
|
OverlayedCollection
|
|
111
123
|
} from "./chunk-SKGMN35F.js";
|
|
@@ -123,7 +135,7 @@ import {
|
|
|
123
135
|
resolvePeriodKey,
|
|
124
136
|
resolveReopenState,
|
|
125
137
|
samePartition
|
|
126
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-VGXZT72I.js";
|
|
127
139
|
import {
|
|
128
140
|
PERIODS_COLLECTION,
|
|
129
141
|
PERIOD_ARCHIVES_COLLECTION,
|
|
@@ -141,7 +153,7 @@ import {
|
|
|
141
153
|
import {
|
|
142
154
|
TxContext,
|
|
143
155
|
bestEffortRevert
|
|
144
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-BLN54W3L.js";
|
|
145
157
|
import {
|
|
146
158
|
lazy
|
|
147
159
|
} from "./chunk-5D2ALSM5.js";
|
|
@@ -149,7 +161,7 @@ import {
|
|
|
149
161
|
InvertedIndex,
|
|
150
162
|
MemoryIndexStore,
|
|
151
163
|
NO_SEARCH
|
|
152
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-OMB2ZKIT.js";
|
|
153
165
|
import {
|
|
154
166
|
NO_SEALED_RECORD
|
|
155
167
|
} from "./chunk-6YXCPL4T.js";
|
|
@@ -173,10 +185,11 @@ import {
|
|
|
173
185
|
normalizeIndexDefs
|
|
174
186
|
} from "./chunk-I3ISCYT7.js";
|
|
175
187
|
import {
|
|
176
|
-
IMPLICIT_LAZY
|
|
177
|
-
|
|
188
|
+
IMPLICIT_LAZY
|
|
189
|
+
} from "./chunk-66TQOPFM.js";
|
|
190
|
+
import {
|
|
178
191
|
estimateRecordBytes
|
|
179
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-V4PXLYWM.js";
|
|
180
193
|
import {
|
|
181
194
|
canonicalGroupKey
|
|
182
195
|
} from "./chunk-XZHEOSQ2.js";
|
|
@@ -196,8 +209,6 @@ import {
|
|
|
196
209
|
NO_I18N,
|
|
197
210
|
getAtPath,
|
|
198
211
|
isDictCollectionName,
|
|
199
|
-
isDictKeyDescriptor,
|
|
200
|
-
isI18nTextDescriptor,
|
|
201
212
|
isStaticDictDescriptor
|
|
202
213
|
} from "./chunk-TRGTKX5E.js";
|
|
203
214
|
import {
|
|
@@ -321,7 +332,6 @@ import {
|
|
|
321
332
|
EchoCeremonyRequiredError,
|
|
322
333
|
ElevationExpiredError,
|
|
323
334
|
ExportCapabilityError,
|
|
324
|
-
FieldNotQueryableError,
|
|
325
335
|
ForgetStrategyNotConfiguredError,
|
|
326
336
|
ImportCapabilityError,
|
|
327
337
|
IndexWriteFailureError,
|
|
@@ -348,7 +358,6 @@ import {
|
|
|
348
358
|
USER_ENVELOPE_COLLECTION,
|
|
349
359
|
UniqueConstraintError,
|
|
350
360
|
UnsupportedIndexOptionError,
|
|
351
|
-
UnsupportedTierCompositionError,
|
|
352
361
|
ValidationError,
|
|
353
362
|
isConflictError
|
|
354
363
|
} from "./chunk-7O3Y4PPD.js";
|
|
@@ -531,7 +540,7 @@ function validateSecretModeOptions(options) {
|
|
|
531
540
|
}
|
|
532
541
|
async function resolveEffectiveSecret(options, store, vault) {
|
|
533
542
|
if (options.secretMode === "managed") {
|
|
534
|
-
const { resolveManagedSecret } = await import("./managed-secret-
|
|
543
|
+
const { resolveManagedSecret } = await import("./managed-secret-NHRYG7CD.js");
|
|
535
544
|
return resolveManagedSecret(store, vault, options.sealingKey);
|
|
536
545
|
}
|
|
537
546
|
return options.secret;
|
|
@@ -549,7 +558,7 @@ function ownerKeyringOptions(options, secret) {
|
|
|
549
558
|
|
|
550
559
|
// src/port/by/default-provider.ts
|
|
551
560
|
async function createDefaultMesh(store) {
|
|
552
|
-
const { StoreMesh } = await import("./store-coordination-provider-
|
|
561
|
+
const { StoreMesh } = await import("./store-coordination-provider-RX2CGWXV.js");
|
|
553
562
|
return new StoreMesh(store);
|
|
554
563
|
}
|
|
555
564
|
|
|
@@ -604,370 +613,6 @@ function populateCollectionRegistries(r, collectionName, options, effectiveViaFi
|
|
|
604
613
|
}
|
|
605
614
|
}
|
|
606
615
|
|
|
607
|
-
// src/kernel/via/pipeline.ts
|
|
608
|
-
var ViaPipeline = class _ViaPipeline {
|
|
609
|
-
constructor(bindings, taint) {
|
|
610
|
-
this.bindings = bindings;
|
|
611
|
-
this.taint = taint;
|
|
612
|
-
const moneyVias = bindings.filter((b) => b.brand === "money");
|
|
613
|
-
const computedVias = bindings.filter((b) => b.brand === "computed");
|
|
614
|
-
const restBindings = bindings.filter((b) => b.brand !== "money" && b.brand !== "computed");
|
|
615
|
-
this._presentOrder = [...moneyVias, ...computedVias, ...restBindings];
|
|
616
|
-
this._presentLateBoundary = moneyVias.length + computedVias.length;
|
|
617
|
-
}
|
|
618
|
-
bindings;
|
|
619
|
-
taint;
|
|
620
|
-
/**
|
|
621
|
-
* Present-phase-ONLY order (#665, corrected under #665 review) — a stable
|
|
622
|
-
* THREE-WAY partition of `bindings` computed once here at construction:
|
|
623
|
-
* every `'money'`-brand binding first (existing relative order), then
|
|
624
|
-
* every `'computed'`-brand binding (existing relative order), then
|
|
625
|
-
* everything else (existing relative order). `present()` folds over this
|
|
626
|
-
* instead of `bindings` so a `mode: 'virtual'` computed field's value
|
|
627
|
-
* exists before i18n/lookup's dressing `present()` hooks run on it
|
|
628
|
-
* (today's `compileVias` order is money→i18n→lookup→classified→
|
|
629
|
-
* blob→computed, `collection-config.ts:554`, so dressing unconditionally
|
|
630
|
-
* ran BEFORE the value it dresses existed). This reorder is binding-level,
|
|
631
|
-
* not conditioned on any particular field composition — it applies to
|
|
632
|
-
* EVERY collection that compiles a `'computed'` binding at all, not only
|
|
633
|
-
* ones stacking a dresser on the SAME field as a computed one. EVERY other
|
|
634
|
-
* phase (`ingest`/`encodeWrite`/`encodeAtRest`/`enforceWrite`/etc.) keeps
|
|
635
|
-
* folding over `bindings` unchanged — those write/query phases need
|
|
636
|
-
* money-first (`_applyMoneyFields` PREPENDS money, `_applyClassifiedFields`
|
|
637
|
-
* APPENDS classified to preserve it, `kernel/collection.ts:1275-1284,1364-
|
|
638
|
-
* 1368`).
|
|
639
|
-
*
|
|
640
|
-
* Money is deliberately carved OUT of the generic "everything else" slice
|
|
641
|
-
* and kept FIRST — the original two-way `[computed..., rest...]` partition
|
|
642
|
-
* regressed money's composed-field behavior from a benign missing-dressing
|
|
643
|
-
* gap into VALUE CORRUPTION: money's `present()` DECODES its input as a
|
|
644
|
-
* STORED SCALED-INT (and derives `<field>Formatted` from it) — it is not a
|
|
645
|
-
* pure dressing CONSUMER like i18n/lookup, which only ADD a `<field>Label`
|
|
646
|
-
* key and never rewrite the field's own value. Running money AFTER
|
|
647
|
-
* computed on a field composing `computed(virtual)` + `money(...)` on
|
|
648
|
-
* ITSELF means money's decode sees the virtual field's raw MAJOR-unit
|
|
649
|
-
* output (e.g. `21`) and misreads it as a scaled-int, producing a
|
|
650
|
-
* corrupted value (`'0.21'`) instead of the pre-#665 result (the raw `21`
|
|
651
|
-
* surviving untouched, with no `Formatted` key added — a benign
|
|
652
|
-
* missing-dressing gap, not a wrong value). Money-first restores money's
|
|
653
|
-
* exact pre-#665 present position — byte-identical money behavior; the
|
|
654
|
-
* materialized composition pins from the #631 work and the money suites
|
|
655
|
-
* all ran under money-first. i18n/lookup are genuine dressing consumers
|
|
656
|
-
* (they only ADD, never rewrite), so they stay after computed, which is
|
|
657
|
-
* the fix #665 intended. A `'taint'` binding (appended LAST by
|
|
658
|
-
* `via/graph-wiring.ts#applyTaintOverlay`) stays last here too (it's
|
|
659
|
-
* neither money nor computed, so it lands at the tail of the "everything
|
|
660
|
-
* else" slice), preserving its "runs after computed, redacts tainted
|
|
661
|
-
* virtual output" contract (`via/taint-binding.ts`'s `taintBinding` doc
|
|
662
|
-
* comment).
|
|
663
|
-
*
|
|
664
|
-
* Money-dressing a virtual computed field's OWN output (the composed
|
|
665
|
-
* `computed(virtual) + money` case) is NOT resolved by this partition
|
|
666
|
-
* alone — #669 resolves it with a separate mid-fold hook instead:
|
|
667
|
-
* `NoydbVia.presentLate` runs after every binding's `present()` in this
|
|
668
|
-
* money+computed segment, before the "everything else" segment below, so
|
|
669
|
-
* money can quantize/reinterpret a virtual field's fresh MAJOR-UNITS
|
|
670
|
-
* output as if it were a stored value, without perturbing this ordering
|
|
671
|
-
* or the #665 invariant above it (`_presentLateBoundary` below marks
|
|
672
|
-
* exactly where that mid-fold point sits within `_presentOrder`).
|
|
673
|
-
*/
|
|
674
|
-
_presentOrder;
|
|
675
|
-
/** #669 — index into `_presentOrder` where the money+computed segment ends and the
|
|
676
|
-
* "everything else" segment begins (`moneyVias.length + computedVias.length`);
|
|
677
|
-
* `present()` runs every binding's `presentLate` at exactly this boundary. */
|
|
678
|
-
_presentLateBoundary;
|
|
679
|
-
/** undefined when there is nothing to enforce — the zero-via fast path is
|
|
680
|
-
* `this.via === undefined` (#553: keeps an all-plain collection sync). A
|
|
681
|
-
* `'*'`-defaulted output collection (#642) counts as "something to enforce"
|
|
682
|
-
* even with zero field-specific postures and zero bindings. */
|
|
683
|
-
static build(bindings, taint) {
|
|
684
|
-
if (bindings.length === 0 && (!taint || taint.postures.size === 0 && taint.defaultPosture === void 0)) return void 0;
|
|
685
|
-
return new _ViaPipeline(bindings, taint);
|
|
686
|
-
}
|
|
687
|
-
/** Refuse a write before crypto runs: awaits each binding's `enforceWrite` in order — first throw wins. */
|
|
688
|
-
async enforceWrite(record, ctx) {
|
|
689
|
-
for (const b of this.bindings) if (b.enforceWrite) await b.enforceWrite(record, ctx);
|
|
690
|
-
}
|
|
691
|
-
ingest(record) {
|
|
692
|
-
let r = record;
|
|
693
|
-
for (const b of this.bindings) if (b.ingest) r = b.ingest(r);
|
|
694
|
-
return r;
|
|
695
|
-
}
|
|
696
|
-
canonicalizeStored(record) {
|
|
697
|
-
let r = record;
|
|
698
|
-
for (const b of this.bindings) if (b.canonicalizeStored) r = b.canonicalizeStored(r);
|
|
699
|
-
return r;
|
|
700
|
-
}
|
|
701
|
-
async encodeWrite(record, ctx) {
|
|
702
|
-
let r = record;
|
|
703
|
-
for (const b of this.bindings) if (b.encodeWrite) r = await b.encodeWrite(r, ctx);
|
|
704
|
-
return r;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* Final write-pipeline stage: folds each binding's `encodeAtRest` in
|
|
708
|
-
* order, threading the record and accumulating the sealed-slot map. A
|
|
709
|
-
* field belongs to exactly one via feature — two bindings sealing the
|
|
710
|
-
* same field is a brand-keyed collision and throws.
|
|
711
|
-
*/
|
|
712
|
-
async encodeAtRest(record, crypto) {
|
|
713
|
-
let r = record;
|
|
714
|
-
let sealed;
|
|
715
|
-
const sealedBy = /* @__PURE__ */ new Map();
|
|
716
|
-
for (const b of this.bindings) {
|
|
717
|
-
if (!b.encodeAtRest) continue;
|
|
718
|
-
const result = await b.encodeAtRest(r, crypto);
|
|
719
|
-
r = result.record;
|
|
720
|
-
if (!result.sealed) continue;
|
|
721
|
-
for (const [field, ref2] of Object.entries(result.sealed)) {
|
|
722
|
-
const priorBrand = sealedBy.get(field);
|
|
723
|
-
if (priorBrand !== void 0) {
|
|
724
|
-
throw new ValidationError(
|
|
725
|
-
`via encodeAtRest: field "${field}" sealed by binding "${priorBrand}" is also sealed by binding "${b.brand}"`
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
sealedBy.set(field, b.brand);
|
|
729
|
-
sealed ??= {};
|
|
730
|
-
sealed[field] = ref2;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
return sealed ? { record: r, sealed } : { record: r };
|
|
734
|
-
}
|
|
735
|
-
/** First read-pipeline stage: folds each binding's `decodeAtRest` in order. */
|
|
736
|
-
async decodeAtRest(record, sealed, crypto, opts) {
|
|
737
|
-
let r = record;
|
|
738
|
-
for (const b of this.bindings) if (b.decodeAtRest) r = await b.decodeAtRest(r, sealed, crypto, opts);
|
|
739
|
-
return r;
|
|
740
|
-
}
|
|
741
|
-
async present(record, ctx) {
|
|
742
|
-
let r = record;
|
|
743
|
-
for (let i = 0; i < this._presentLateBoundary; i++) {
|
|
744
|
-
const b = this._presentOrder[i];
|
|
745
|
-
if (b.present) r = await b.present(r, ctx);
|
|
746
|
-
}
|
|
747
|
-
for (const b of this.bindings) if (b.presentLate) r = await b.presentLate(r, ctx);
|
|
748
|
-
for (let i = this._presentLateBoundary; i < this._presentOrder.length; i++) {
|
|
749
|
-
const b = this._presentOrder[i];
|
|
750
|
-
if (b.present) r = await b.present(r, ctx);
|
|
751
|
-
}
|
|
752
|
-
return r;
|
|
753
|
-
}
|
|
754
|
-
buildClause(field, op, value) {
|
|
755
|
-
for (const b of this.bindings) {
|
|
756
|
-
const payload = b.buildClause?.(field, op, value);
|
|
757
|
-
if (payload !== void 0) return { brand: b.brand, payload };
|
|
758
|
-
}
|
|
759
|
-
return void 0;
|
|
760
|
-
}
|
|
761
|
-
evaluateClause(clause, actual, op) {
|
|
762
|
-
const b = this.bindings.find((x) => x.brand === clause.brand);
|
|
763
|
-
return b?.evaluateClause ? b.evaluateClause(actual, op, clause.payload) : false;
|
|
764
|
-
}
|
|
765
|
-
/**
|
|
766
|
-
* Resolve a `buildClause` payload to an index-probe operand (#625) —
|
|
767
|
-
* mirrors `evaluateClause`'s brand dispatch. `undefined` (a binding
|
|
768
|
-
* with no `indexProbe`, or one that declines to probe this op/payload)
|
|
769
|
-
* means the caller (`candidateRecords()`) must fall back to a scan.
|
|
770
|
-
*/
|
|
771
|
-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
772
|
-
indexProbe(clause, op) {
|
|
773
|
-
const b = this.bindings.find((x) => x.brand === clause.brand);
|
|
774
|
-
return b?.indexProbe ? b.indexProbe(op, clause.payload) : void 0;
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* Resolve a raw STORED field value to its canonical eager-index bucket
|
|
778
|
-
* key (#672) — folds every binding's `canonicalizeIndexKey`, first
|
|
779
|
-
* non-undefined wins (same fold discipline as `buildClause`). `undefined`
|
|
780
|
-
* means no binding claims `field` (or the value can't be canonicalized)
|
|
781
|
-
* — the caller buckets the raw stringified value, unchanged from before
|
|
782
|
-
* this hook existed.
|
|
783
|
-
*/
|
|
784
|
-
canonicalizeIndexKey(field, rawValue) {
|
|
785
|
-
for (const b of this.bindings) {
|
|
786
|
-
const key = b.canonicalizeIndexKey?.(field, rawValue);
|
|
787
|
-
if (key !== void 0) return key;
|
|
788
|
-
}
|
|
789
|
-
return void 0;
|
|
790
|
-
}
|
|
791
|
-
decodeResults(record) {
|
|
792
|
-
let r = record;
|
|
793
|
-
for (const b of this.bindings) if (b.decodeResults) r = b.decodeResults(r);
|
|
794
|
-
return r;
|
|
795
|
-
}
|
|
796
|
-
/** undefined = no binding covers the field → caller falls back to generic compare. */
|
|
797
|
-
compareForOrder(field, a, b) {
|
|
798
|
-
for (const bind of this.bindings) {
|
|
799
|
-
const c = bind.compareForOrder?.(field, a, b);
|
|
800
|
-
if (c !== void 0) return c;
|
|
801
|
-
}
|
|
802
|
-
return void 0;
|
|
803
|
-
}
|
|
804
|
-
/** undefined = no binding resolves an order-sort label for `key` at `field`/`locale` (#650 Task 7 —
|
|
805
|
-
* the `orderBy(..., {by:'label'})` per-call-locale channel `compareForOrder` above can't serve). */
|
|
806
|
-
resolveOrderLabel(field, key, locale) {
|
|
807
|
-
for (const bind of this.bindings) {
|
|
808
|
-
const label = bind.resolveOrderLabel?.(field, key, locale);
|
|
809
|
-
if (label !== void 0) return label;
|
|
810
|
-
}
|
|
811
|
-
return void 0;
|
|
812
|
-
}
|
|
813
|
-
/**
|
|
814
|
-
* Which posture governs `field`, if any binding covers it — `undefined`
|
|
815
|
-
* means no binding declares `field` (the generic, non-via query path
|
|
816
|
-
* applies). #629 Task 8's posture consumer: `.where()`/`.orderBy()`
|
|
817
|
-
* consult this before building/evaluating a clause, refusing fields whose
|
|
818
|
-
* posture is `queryable: 'none'` (e.g. blob); every other posture
|
|
819
|
-
* ('det-exact'/'ordered'/'full') is left to the existing per-binding
|
|
820
|
-
* buildClause/evaluateClause/compareForOrder machinery, unchanged.
|
|
821
|
-
*
|
|
822
|
-
* #638 Task 3: the graph-computed taint overlay is consulted FIRST — a
|
|
823
|
-
* derived field's assigned (most-restrictive-of-sources) posture wins over
|
|
824
|
-
* whatever a binding would otherwise report for that field name (no
|
|
825
|
-
* binding covers a computed/derived field today, so this never actually
|
|
826
|
-
* shadows one — see `via/taint-binding.ts`'s `taintBinding.covers`, which
|
|
827
|
-
* only claims the sealed subset for `encodeAtRest`/`decodeAtRest`, not for
|
|
828
|
-
* this lookup).
|
|
829
|
-
*/
|
|
830
|
-
postureFor(field) {
|
|
831
|
-
const t = this.taint?.postures.get(field);
|
|
832
|
-
if (t) return t;
|
|
833
|
-
for (const b of this.bindings) {
|
|
834
|
-
if (b.covers?.(field)) return b.posture;
|
|
835
|
-
}
|
|
836
|
-
return this.taint?.defaultPosture;
|
|
837
|
-
}
|
|
838
|
-
/**
|
|
839
|
-
* Refuse any field-based reducer over a `queryable: 'none'` field (blob) —
|
|
840
|
-
* metadata-only: walks each reducer's `.field` and checks posture, no
|
|
841
|
-
* rewriting. Reducers with no `.field` (e.g. `count()`) are skipped.
|
|
842
|
-
*
|
|
843
|
-
* Shared by `wrapReducers` below (which ALSO applies each binding's
|
|
844
|
-
* rewrite, e.g. money's exact-BigInt reducer swap) and by
|
|
845
|
-
* `ScanBuilder.aggregate()` (#629 Task 8 review fix wave 1), which must
|
|
846
|
-
* call THIS, not `wrapReducers` — wiring full `wrapReducers` into
|
|
847
|
-
* `ScanBuilder.aggregate()` would newly activate money/i18n reducer
|
|
848
|
-
* wrapping on a path that has never run it, a parity-breaking behavior
|
|
849
|
-
* change for existing brands.
|
|
850
|
-
*/
|
|
851
|
-
refuseUnqueryableReducers(spec) {
|
|
852
|
-
for (const reducer of Object.values(spec)) {
|
|
853
|
-
const field = reducer?.field;
|
|
854
|
-
if (field !== void 0 && this.postureFor(field)?.queryable === "none") {
|
|
855
|
-
throw new FieldNotQueryableError(field);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
/**
|
|
860
|
-
* Rewrite an aggregate spec (money exact reducers), then refuse any
|
|
861
|
-
* field-based reducer over a `queryable: 'none'` field (blob) — the same
|
|
862
|
-
* posture gate `.where()`/`.orderBy()` apply, extended to `.aggregate()`
|
|
863
|
-
* (both the bare-spec and builder forms funnel through here).
|
|
864
|
-
*/
|
|
865
|
-
wrapReducers(spec) {
|
|
866
|
-
this.refuseUnqueryableReducers(spec);
|
|
867
|
-
let s = spec;
|
|
868
|
-
for (const b of this.bindings) if (b.wrapReducers) s = b.wrapReducers(s);
|
|
869
|
-
return s;
|
|
870
|
-
}
|
|
871
|
-
/**
|
|
872
|
-
* Deliberate export-layer redaction (#629 Task 9's posture consumer):
|
|
873
|
-
* for every OWN field the decoded record carries, if the covering
|
|
874
|
-
* binding's posture declares `exportable: false` (classified today;
|
|
875
|
-
* money/i18n/blob are all `true`), replace the value with
|
|
876
|
-
* {@link EXPORT_REDACTION_MARKER} — the same `'[sealed]'` string
|
|
877
|
-
* `SealedHandle.toJSON()` (`kernel/types.ts`) already emits, so this is
|
|
878
|
-
* byte-parity with today's accidental redaction, now independent of the
|
|
879
|
-
* field's runtime shape. `SealedHandle.toJSON()` stays untouched as
|
|
880
|
-
* defense-in-depth: a record read via `collection.get()` and
|
|
881
|
-
* JSON.stringify'd outside `exportStream()` still gets the accident's
|
|
882
|
-
* redaction on its own. Never mutates the input; returns a new object
|
|
883
|
-
* only when a field was actually redacted.
|
|
884
|
-
*/
|
|
885
|
-
redactForExport(record) {
|
|
886
|
-
let out;
|
|
887
|
-
for (const field of Object.keys(record)) {
|
|
888
|
-
if (this.postureFor(field)?.exportable === false) {
|
|
889
|
-
out ??= { ...record };
|
|
890
|
-
out[field] = EXPORT_REDACTION_MARKER;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
return out ?? record;
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Shared fold over a subset of `this.bindings`: runs each binding's
|
|
897
|
-
* `erase`, concatenating shredded/retainedShared counts and residue.
|
|
898
|
-
* Consults `posture.forgettable` (#629 Task 10) — a binding declaring
|
|
899
|
-
* `forgettable: false` is skipped even if it defines `erase` (none does
|
|
900
|
-
* today; a future non-forgettable binding is supported without a brand check).
|
|
901
|
-
*/
|
|
902
|
-
async foldErase(ctx, bindings) {
|
|
903
|
-
let shredded = 0;
|
|
904
|
-
let retainedShared = 0;
|
|
905
|
-
const residue = [];
|
|
906
|
-
for (const b of bindings) {
|
|
907
|
-
if (!b.erase || b.posture.forgettable === false) continue;
|
|
908
|
-
const report = await b.erase(ctx);
|
|
909
|
-
shredded += report.shredded;
|
|
910
|
-
retainedShared += report.retainedShared ?? 0;
|
|
911
|
-
residue.push(...report.residue);
|
|
912
|
-
}
|
|
913
|
-
return retainedShared > 0 ? { shredded, residue, retainedShared } : { shredded, residue };
|
|
914
|
-
}
|
|
915
|
-
/** `forget()`'s per-ref erasure door: folds every binding's `erase`. */
|
|
916
|
-
async erase(ctx) {
|
|
917
|
-
return this.foldErase(ctx, this.bindings);
|
|
918
|
-
}
|
|
919
|
-
/**
|
|
920
|
-
* `forget()`'s SEALED-posture-only erase fold (#629 Task 10, `Collection._onViaErase`'s
|
|
921
|
-
* one caller) — classified today; metadata-filtered on
|
|
922
|
-
* `posture.encryptedAtRest`, not brand-checked. `undefined` when no
|
|
923
|
-
* sealed-posture binding is compiled in — `vault.ts` then falls back to
|
|
924
|
-
* its own bare-`sensitive` classification, which no via binding covers.
|
|
925
|
-
*/
|
|
926
|
-
async eraseSealed(ctx) {
|
|
927
|
-
const sealed = this.bindings.filter((b) => b.posture.encryptedAtRest === "sealed");
|
|
928
|
-
return sealed.length === 0 ? void 0 : this.foldErase(ctx, sealed);
|
|
929
|
-
}
|
|
930
|
-
/** True iff any binding implements decodeResults (query fast-path gating). */
|
|
931
|
-
get hasResultDecode() {
|
|
932
|
-
return this.bindings.some((b) => b.decodeResults !== void 0);
|
|
933
|
-
}
|
|
934
|
-
/**
|
|
935
|
-
* True iff any binding declares an at-rest hook (`encodeAtRest`/
|
|
936
|
-
* `decodeAtRest`) — the codec boundary's async-stack gate (#629 Task 3
|
|
937
|
-
* consults this to choose between the hook path and today's inline
|
|
938
|
-
* sealed-slot path; a stack with only sync hooks, e.g. money-only, stays
|
|
939
|
-
* `false`).
|
|
940
|
-
*/
|
|
941
|
-
get hasAtRestHooks() {
|
|
942
|
-
return this.bindings.some((b) => b.encodeAtRest !== void 0 || b.decodeAtRest !== void 0);
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* Fold every binding's `describeFragment()` into one `brand -> fragment`
|
|
946
|
-
* map (#650 Task 7 — the first-ever consumer; `describeFragment` was
|
|
947
|
-
* declared at `via/index.ts:136` since #623 with zero callers until this task).
|
|
948
|
-
* `undefined` when no compiled binding implements it. Consumed by
|
|
949
|
-
* `Collection.describe()`/`describeAsync()`, threaded to `buildDescription`
|
|
950
|
-
* as `BuildDescriptionInput.viaFragments`.
|
|
951
|
-
*/
|
|
952
|
-
describeFragments() {
|
|
953
|
-
let out;
|
|
954
|
-
for (const b of this.bindings) {
|
|
955
|
-
const f = b.describeFragment?.();
|
|
956
|
-
if (f !== void 0) {
|
|
957
|
-
out ??= {};
|
|
958
|
-
out[b.brand] = f;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
return out;
|
|
962
|
-
}
|
|
963
|
-
};
|
|
964
|
-
var EXPORT_REDACTION_MARKER = "[sealed]";
|
|
965
|
-
function exportRedact(coll, record) {
|
|
966
|
-
if (record === null || typeof record !== "object") return record;
|
|
967
|
-
const via2 = coll._via;
|
|
968
|
-
return via2 ? via2.redactForExport(record) : record;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
616
|
// src/kernel/lazy-count.ts
|
|
972
617
|
var COUNT_PAGE_SIZE = 1e3;
|
|
973
618
|
function isLive(env, storeCiphertext) {
|
|
@@ -1679,471 +1324,8 @@ async function commitSequentially(ctx, entries, priors) {
|
|
|
1679
1324
|
}
|
|
1680
1325
|
}
|
|
1681
1326
|
|
|
1682
|
-
// src/kernel/via/compose.ts
|
|
1683
|
-
function via(...descriptors) {
|
|
1684
|
-
if (descriptors.length === 0) {
|
|
1685
|
-
throw new ValidationError("via(): at least one descriptor is required, e.g. via(money({ currency: 'EUR' }))");
|
|
1686
|
-
}
|
|
1687
|
-
return { _noydbVia: true, descriptors };
|
|
1688
|
-
}
|
|
1689
|
-
function isViaFieldSpec(x) {
|
|
1690
|
-
return typeof x === "object" && x !== null && x._noydbVia === true;
|
|
1691
|
-
}
|
|
1692
|
-
function mergeViaFields(sources) {
|
|
1693
|
-
for (const field of Object.keys(sources.dictKeyFields ?? {})) {
|
|
1694
|
-
if (sources.lookupFields && field in sources.lookupFields) {
|
|
1695
|
-
throw new ValidationError(
|
|
1696
|
-
`mergeViaFields(): field "${field}" is declared in both \`dictKeyFields\` and \`lookupFields\` \u2014 declare it in one place only.`
|
|
1697
|
-
);
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
if (!sources.viaFields || Object.keys(sources.viaFields).length === 0) {
|
|
1701
|
-
return {
|
|
1702
|
-
moneyFields: sources.moneyFields,
|
|
1703
|
-
i18nFields: sources.i18nFields,
|
|
1704
|
-
dictKeyFields: sources.dictKeyFields,
|
|
1705
|
-
computedFields: void 0,
|
|
1706
|
-
lookupFields: sources.lookupFields
|
|
1707
|
-
};
|
|
1708
|
-
}
|
|
1709
|
-
const sugarFieldNames = /* @__PURE__ */ new Set([
|
|
1710
|
-
...Object.keys(sources.moneyFields ?? {}),
|
|
1711
|
-
...Object.keys(sources.i18nFields ?? {}),
|
|
1712
|
-
...Object.keys(sources.dictKeyFields ?? {}),
|
|
1713
|
-
...Object.keys(sources.lookupFields ?? {})
|
|
1714
|
-
]);
|
|
1715
|
-
const viaMoney = {};
|
|
1716
|
-
const viaI18nText = {};
|
|
1717
|
-
const viaDictKey = {};
|
|
1718
|
-
const viaComputed = {};
|
|
1719
|
-
const viaLookup = {};
|
|
1720
|
-
for (const [field, spec] of Object.entries(sources.viaFields)) {
|
|
1721
|
-
if (sugarFieldNames.has(field)) {
|
|
1722
|
-
throw new ValidationError(
|
|
1723
|
-
`via(): field "${field}" is declared via both a sugar key and \`viaFields\` \u2014 declare it in one place only.`
|
|
1724
|
-
);
|
|
1725
|
-
}
|
|
1726
|
-
for (const descriptor of spec.descriptors) {
|
|
1727
|
-
if (descriptor._viaBrand === "money") {
|
|
1728
|
-
viaMoney[field] = descriptor;
|
|
1729
|
-
} else if (descriptor._viaBrand === "i18n") {
|
|
1730
|
-
if (isI18nTextDescriptor(descriptor)) viaI18nText[field] = descriptor;
|
|
1731
|
-
else if (isDictKeyDescriptor(descriptor) || isStaticDictDescriptor(descriptor)) viaDictKey[field] = descriptor;
|
|
1732
|
-
} else if (descriptor._viaBrand === "computed") {
|
|
1733
|
-
viaComputed[field] = descriptor;
|
|
1734
|
-
} else if (descriptor._viaBrand === "lookup" && isLookupDescriptor(descriptor)) {
|
|
1735
|
-
viaLookup[field] = descriptor;
|
|
1736
|
-
} else {
|
|
1737
|
-
throw new ValidationError(`via(): field "${field}" has a descriptor with unrecognized _viaBrand "${descriptor._viaBrand}" \u2014 via() only supports money/i18n/computed/lookup descriptors today.`);
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
return {
|
|
1742
|
-
moneyFields: Object.keys(viaMoney).length > 0 ? { ...sources.moneyFields ?? {}, ...viaMoney } : sources.moneyFields,
|
|
1743
|
-
i18nFields: Object.keys(viaI18nText).length > 0 ? { ...sources.i18nFields ?? {}, ...viaI18nText } : sources.i18nFields,
|
|
1744
|
-
dictKeyFields: Object.keys(viaDictKey).length > 0 ? { ...sources.dictKeyFields ?? {}, ...viaDictKey } : sources.dictKeyFields,
|
|
1745
|
-
computedFields: Object.keys(viaComputed).length > 0 ? viaComputed : void 0,
|
|
1746
|
-
lookupFields: Object.keys(viaLookup).length > 0 ? { ...sources.lookupFields ?? {}, ...viaLookup } : sources.lookupFields
|
|
1747
|
-
};
|
|
1748
|
-
}
|
|
1749
|
-
var VIA_FIELD_MAP_FAMILY = {
|
|
1750
|
-
moneyFields: "money",
|
|
1751
|
-
i18nFields: "i18n",
|
|
1752
|
-
dictKeyFields: "i18n",
|
|
1753
|
-
lookupFields: "lookup",
|
|
1754
|
-
classifiedFields: "classified",
|
|
1755
|
-
blobFields: "blob",
|
|
1756
|
-
computed: "computed"
|
|
1757
|
-
};
|
|
1758
|
-
function guardCrossBindingFieldCollisions(fieldMaps, callerPrefix = "compileVias()") {
|
|
1759
|
-
const claimantsByField = /* @__PURE__ */ new Map();
|
|
1760
|
-
for (const [sourceKey, map] of Object.entries(fieldMaps)) {
|
|
1761
|
-
for (const field of Object.keys(map ?? {})) {
|
|
1762
|
-
const claimants = claimantsByField.get(field) ?? /* @__PURE__ */ new Set();
|
|
1763
|
-
claimants.add(sourceKey);
|
|
1764
|
-
claimantsByField.set(field, claimants);
|
|
1765
|
-
}
|
|
1766
|
-
}
|
|
1767
|
-
for (const [field, sourceKeys] of claimantsByField) {
|
|
1768
|
-
const families = new Set([...sourceKeys].map((key) => VIA_FIELD_MAP_FAMILY[key]));
|
|
1769
|
-
if (families.size < 2) continue;
|
|
1770
|
-
if (sourceKeys.size === 2 && families.has("computed")) {
|
|
1771
|
-
const other = [...families].find((f) => f !== "computed");
|
|
1772
|
-
if (other === "money" || other === "i18n" || other === "lookup") continue;
|
|
1773
|
-
}
|
|
1774
|
-
const keys = [...sourceKeys].sort().map((k) => `\`${k}\``);
|
|
1775
|
-
const joined = keys.length === 2 ? keys.join(" and ") : `${keys.slice(0, -1).join(", ")}, and ${keys[keys.length - 1]}`;
|
|
1776
|
-
throw new ValidationError(
|
|
1777
|
-
`${callerPrefix}: field "${field}" is declared in both ${joined} \u2014 a field cannot be claimed by two different via-binding families. Declare it in one place only.`
|
|
1778
|
-
);
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
|
-
function guardReconcileCollisions(existingVia, incomingFieldMaps) {
|
|
1782
|
-
guardCrossBindingFieldCollisions(incomingFieldMaps, "guardReconcileCollisions()");
|
|
1783
|
-
if (!existingVia) return;
|
|
1784
|
-
const existingBindings = existingVia.bindings.filter((b) => b.brand !== "taint");
|
|
1785
|
-
for (const [sourceKey, map] of Object.entries(incomingFieldMaps)) {
|
|
1786
|
-
const incomingFamily = VIA_FIELD_MAP_FAMILY[sourceKey];
|
|
1787
|
-
if (incomingFamily === void 0) continue;
|
|
1788
|
-
for (const field of Object.keys(map ?? {})) {
|
|
1789
|
-
const existingFamilies = new Set(
|
|
1790
|
-
existingBindings.filter((b) => b.covers?.(field)).map((b) => b.brand)
|
|
1791
|
-
);
|
|
1792
|
-
for (const existingFamily of existingFamilies) {
|
|
1793
|
-
if (existingFamily === incomingFamily) continue;
|
|
1794
|
-
const isExempt = existingFamily === "computed" && (incomingFamily === "money" || incomingFamily === "i18n" || incomingFamily === "lookup") || incomingFamily === "computed" && (existingFamily === "money" || existingFamily === "i18n" || existingFamily === "lookup");
|
|
1795
|
-
if (isExempt) continue;
|
|
1796
|
-
throw new ValidationError(
|
|
1797
|
-
`vault.collection(): field "${field}" is already bound by the "${existingFamily}" via family on this collection \u2014 an incoming \`${sourceKey}\` declaration cannot claim it for a different family ("${incomingFamily}"). Declare it in one place only.`
|
|
1798
|
-
);
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
// src/kernel/collection-config.ts
|
|
1805
|
-
function computedEntryParts(entry) {
|
|
1806
|
-
if (typeof entry === "function") return { fn: entry, mode: "materialized" };
|
|
1807
|
-
return { fn: entry.fn, ...entry.deps !== void 0 ? { deps: entry.deps } : {}, mode: entry.mode ?? "materialized" };
|
|
1808
|
-
}
|
|
1809
|
-
function unifyComputedFields(opts, viaComputedFields) {
|
|
1810
|
-
return { ...opts.computed ?? {}, ...viaComputedFields ?? {} };
|
|
1811
|
-
}
|
|
1812
|
-
function compileVias(opts, classifiedGuardCtx, eraseCfgOut) {
|
|
1813
|
-
const { moneyFields, i18nFields, dictKeyFields, computedFields, lookupFields } = mergeViaFields(opts);
|
|
1814
|
-
const allComputedFields = unifyComputedFields(opts, computedFields);
|
|
1815
|
-
guardCrossBindingFieldCollisions({
|
|
1816
|
-
moneyFields,
|
|
1817
|
-
i18nFields,
|
|
1818
|
-
dictKeyFields,
|
|
1819
|
-
lookupFields,
|
|
1820
|
-
classifiedFields: opts.classifiedFields !== void 0 ? resolveClassifiedFields(opts.name, opts.classifiedFields).byField : void 0,
|
|
1821
|
-
blobFields: opts.blobFields,
|
|
1822
|
-
computed: allComputedFields
|
|
1823
|
-
});
|
|
1824
|
-
const bindings = [];
|
|
1825
|
-
const virtualFields = /* @__PURE__ */ new Map();
|
|
1826
|
-
for (const [field, entry] of Object.entries(allComputedFields)) {
|
|
1827
|
-
const parts = computedEntryParts(entry);
|
|
1828
|
-
if (parts.mode === "virtual") {
|
|
1829
|
-
virtualFields.set(field, { _viaBrand: "computed", fn: parts.fn, mode: "virtual", ...parts.deps !== void 0 ? { deps: parts.deps } : {} });
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
if (moneyFields) {
|
|
1833
|
-
const virtualMoney = resolveVirtualMoneyFields(Object.keys(moneyFields), (f) => virtualFields.has(f));
|
|
1834
|
-
bindings.push(viaBinder("money")({ moneyFields, ...virtualMoney.size > 0 ? { virtualMoneyFields: virtualMoney } : {} }));
|
|
1835
|
-
}
|
|
1836
|
-
if (i18nFields || dictKeyFields) {
|
|
1837
|
-
const densify = i18nFields ? Object.fromEntries(
|
|
1838
|
-
Object.entries(i18nFields).filter(([, d]) => d.options.densifyOnWrite === true)
|
|
1839
|
-
) : {};
|
|
1840
|
-
const i18nDensifyFields = Object.keys(densify).length > 0 ? densify : void 0;
|
|
1841
|
-
bindings.push(viaBinder("i18n")({
|
|
1842
|
-
...i18nFields !== void 0 ? { i18nFields } : {},
|
|
1843
|
-
...dictKeyFields !== void 0 ? { dictKeyFields } : {},
|
|
1844
|
-
...i18nDensifyFields !== void 0 ? { i18nDensifyFields } : {},
|
|
1845
|
-
strategy: opts.strategies.i18n,
|
|
1846
|
-
...opts.defaultLocale !== void 0 ? { defaultLocale: opts.defaultLocale } : {},
|
|
1847
|
-
...opts.autoTranslateHook !== void 0 ? { autoTranslateHook: opts.autoTranslateHook } : {},
|
|
1848
|
-
...opts.dictLabelResolver !== void 0 ? { dictLabelResolver: opts.dictLabelResolver } : {},
|
|
1849
|
-
...opts.i18nPutValidator !== void 0 ? { i18nPutValidator: opts.i18nPutValidator } : {},
|
|
1850
|
-
collectionName: opts.name
|
|
1851
|
-
}));
|
|
1852
|
-
}
|
|
1853
|
-
if (lookupFields !== void 0) {
|
|
1854
|
-
bindings.push(viaBinder("lookup")({
|
|
1855
|
-
lookupFields,
|
|
1856
|
-
...opts.lookupLabelResolver !== void 0 ? { lookupLabelResolver: opts.lookupLabelResolver } : {},
|
|
1857
|
-
...opts.getLookupBacking !== void 0 ? { getLookupBacking: opts.getLookupBacking } : {},
|
|
1858
|
-
...opts.membership !== void 0 ? { membership: opts.membership } : {},
|
|
1859
|
-
...opts.getAltIndex !== void 0 ? { getAltIndex: opts.getAltIndex } : {},
|
|
1860
|
-
...opts.snapshotFor !== void 0 ? { snapshotFor: opts.snapshotFor } : {},
|
|
1861
|
-
collectionName: opts.name
|
|
1862
|
-
}));
|
|
1863
|
-
}
|
|
1864
|
-
if (opts.classifiedFields !== void 0) {
|
|
1865
|
-
const classifiedCfg = {
|
|
1866
|
-
entries: opts.classifiedFields,
|
|
1867
|
-
collectionName: opts.name,
|
|
1868
|
-
guardCtx: classifiedGuardCtx
|
|
1869
|
-
};
|
|
1870
|
-
if (eraseCfgOut) eraseCfgOut.classified = classifiedCfg;
|
|
1871
|
-
bindings.push(viaBinder("classified")(classifiedCfg));
|
|
1872
|
-
}
|
|
1873
|
-
if (opts.blobFields !== void 0) {
|
|
1874
|
-
bindings.push(viaBinder("blob")({
|
|
1875
|
-
fields: opts.blobFields,
|
|
1876
|
-
collectionName: opts.name
|
|
1877
|
-
}));
|
|
1878
|
-
}
|
|
1879
|
-
if (virtualFields.size > 0) {
|
|
1880
|
-
bindings.push(viaBinder("computed")({ virtualFields }));
|
|
1881
|
-
}
|
|
1882
|
-
return bindings;
|
|
1883
|
-
}
|
|
1884
|
-
function resolveVirtualMoneyFields(moneyFieldNames, isVirtual) {
|
|
1885
|
-
const out = /* @__PURE__ */ new Set();
|
|
1886
|
-
for (const field of moneyFieldNames) if (isVirtual(field)) out.add(field);
|
|
1887
|
-
return out;
|
|
1888
|
-
}
|
|
1889
|
-
function collectKnownFieldNames(parts) {
|
|
1890
|
-
return /* @__PURE__ */ new Set([
|
|
1891
|
-
...Object.keys(parts.moneyFields ?? {}),
|
|
1892
|
-
...Object.keys(parts.i18nFields ?? {}),
|
|
1893
|
-
...Object.keys(parts.dictKeyFields ?? {}),
|
|
1894
|
-
...Object.keys(parts.classifiedFields ?? {}),
|
|
1895
|
-
...Object.keys(parts.computed ?? {}),
|
|
1896
|
-
...Object.keys(parts.lookupFields ?? {})
|
|
1897
|
-
]);
|
|
1898
|
-
}
|
|
1899
|
-
var EMPTY_KNOWN_FIELDS = /* @__PURE__ */ new Set();
|
|
1900
|
-
function resolveComputedEdges(collectionName, computed, hasClassifiedFields, knownFields = EMPTY_KNOWN_FIELDS) {
|
|
1901
|
-
if (!computed) return [];
|
|
1902
|
-
const edges = [];
|
|
1903
|
-
for (const [field, entry] of Object.entries(computed)) {
|
|
1904
|
-
const parts = computedEntryParts(entry);
|
|
1905
|
-
const deps = parts.deps;
|
|
1906
|
-
if (deps === void 0) {
|
|
1907
|
-
if (hasClassifiedFields) {
|
|
1908
|
-
throw new ValidationError(
|
|
1909
|
-
`Collection "${collectionName}": computed field "${field}" has no declared \`deps\` and the collection declares classified fields \u2014 an opaque computed function could silently copy a classified field's plaintext into an ordinary, unredacted field. Declare \`deps\` naming the source fields it reads, e.g. computed: { ${field}: { fn, deps: [...] } } or via(computed(fn, { deps: [...] })).`
|
|
1910
|
-
);
|
|
1911
|
-
}
|
|
1912
|
-
continue;
|
|
1913
|
-
}
|
|
1914
|
-
if (deps.length === 0) {
|
|
1915
|
-
throw new ValidationError(`Collection "${collectionName}": computed field "${field}"'s \`deps\` must be non-empty.`);
|
|
1916
|
-
}
|
|
1917
|
-
for (const dep of deps) {
|
|
1918
|
-
if (typeof dep !== "string" || dep.length === 0) {
|
|
1919
|
-
throw new ValidationError(`Collection "${collectionName}": computed field "${field}"'s \`deps\` entries must be non-empty strings.`);
|
|
1920
|
-
}
|
|
1921
|
-
if (hasClassifiedFields && !knownFields.has(dep)) {
|
|
1922
|
-
throw new ValidationError(
|
|
1923
|
-
`Collection "${collectionName}": computed field "${field}"'s \`deps\` entry "${dep}" does not name a declared field, and the collection declares classified fields \u2014 an opaque computed function could silently copy a classified field's plaintext into an ordinary, unredacted field via a mistyped/unknown dep name. Declare \`deps\` naming only known fields (money/i18n/dictKey/classified/computed) \u2014 check "${dep}" for a typo.`
|
|
1924
|
-
);
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
edges.push({
|
|
1928
|
-
target: { collection: collectionName, field },
|
|
1929
|
-
sources: deps.map((d) => ({ collection: collectionName, field: d })),
|
|
1930
|
-
grain: parts.mode === "virtual" ? "virtual" : "record"
|
|
1931
|
-
});
|
|
1932
|
-
}
|
|
1933
|
-
return edges;
|
|
1934
|
-
}
|
|
1935
|
-
function resolveViaDepsEdges(collectionName, bindings, knownFields) {
|
|
1936
|
-
const edges = [];
|
|
1937
|
-
for (const binding of bindings) {
|
|
1938
|
-
if (!binding.deps || binding.deps.length === 0) continue;
|
|
1939
|
-
for (const dep of binding.deps) {
|
|
1940
|
-
if (!knownFields.has(dep)) {
|
|
1941
|
-
throw new ValidationError(
|
|
1942
|
-
`Collection "${collectionName}": via binding "${binding.brand}" deps references undeclared field "${dep}".`
|
|
1943
|
-
);
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
const sources = binding.deps.map((d) => ({ collection: collectionName, field: d }));
|
|
1947
|
-
for (const field of knownFields) {
|
|
1948
|
-
if (binding.covers?.(field)) edges.push({ target: { collection: collectionName, field }, sources });
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
return edges;
|
|
1952
|
-
}
|
|
1953
|
-
function resolveCollectionConfig(opts) {
|
|
1954
|
-
if (opts.embeddings && opts.crdt) {
|
|
1955
|
-
throw new Error(
|
|
1956
|
-
`Collection "${opts.name}": embeddings are not supported on CRDT collections (L2). Use a non-CRDT collection for semantic search.`
|
|
1957
|
-
);
|
|
1958
|
-
}
|
|
1959
|
-
if (opts.sensitive && opts.sensitive.length > 0 && opts.crdt) {
|
|
1960
|
-
throw new Error(
|
|
1961
|
-
`Collection "${opts.name}": sensitive (structural group-encryption) is not supported on CRDT collections \u2014 the CRDT write path bypasses per-field sealing, so the fields would be stored in the ordinary encrypted body with no \`_sealed\` slot and no per-field key. Use a non-CRDT collection for sealed fields.`
|
|
1962
|
-
);
|
|
1963
|
-
}
|
|
1964
|
-
if (opts.tiers && opts.tiers.length > 0 && opts.blobFields !== void 0 && Object.keys(opts.blobFields).length > 0 && opts.perRecordKeys !== true) {
|
|
1965
|
-
throw new UnsupportedTierCompositionError(
|
|
1966
|
-
"blobs",
|
|
1967
|
-
`Collection "${opts.name}": tiered collections that declare blobFields require \`perRecordKeys: true\` \u2014 legacy (non-perRecordKeys) blobs have no per-blob content CEK and cannot be tier-isolated on elevate/demote.`
|
|
1968
|
-
);
|
|
1969
|
-
}
|
|
1970
|
-
if (opts.tiers && opts.tiers.length > 0 && opts.blobFields !== void 0) {
|
|
1971
|
-
for (const [field, policy] of Object.entries(opts.blobFields)) {
|
|
1972
|
-
if (policy?.external && policy.public === true) {
|
|
1973
|
-
throw new UnsupportedTierCompositionError(
|
|
1974
|
-
"blobs",
|
|
1975
|
-
`Collection "${opts.name}": blob field "${field}" cannot be both \`external: true, public: true\` and declared on a tiered collection \u2014 the object key is deterministic and its bytes are world-readable by design, so tier-invisibility can never be enforced for it once elevated. Use a private/presigned external field (\`public\` omitted or \`false\`) or move this field to a non-tiered collection.`
|
|
1976
|
-
);
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
if (opts.tiers && opts.tiers.length > 0 && opts.encrypted === false) {
|
|
1981
|
-
throw new UnsupportedTierCompositionError(
|
|
1982
|
-
"plaintext",
|
|
1983
|
-
`Collection "${opts.name}": tiers are per-tier ENCRYPTION keys \u2014 a plaintext collection (\`encrypted: false\`) has nothing to re-key, so \`putAtTier\`/\`elevate\` would encrypt/decrypt incoherently. Use an encrypted collection.`
|
|
1984
|
-
);
|
|
1985
|
-
}
|
|
1986
|
-
if (opts.tiers && opts.tiers.length > 0 && opts.crdt !== void 0 && ((opts.derivationSource?.registry().strategiesForSource(opts.name).length ?? 0) > 0 || (opts.materializedViewSource?.registry().mvsForSource(opts.name).length ?? 0) > 0)) {
|
|
1987
|
-
throw new UnsupportedTierCompositionError(
|
|
1988
|
-
"crdt-derivation",
|
|
1989
|
-
`Collection "${opts.name}": tiers + crdt cannot be combined with this collection acting as a derivation/rollup source (#739) \u2014 the tier-aware pre-move decode \`syncDerived\` uses on elevate()/demote() does not resolve CRDT state, so a registered derivation/rollup reads raw CrdtState instead of the record and silently no-ops. Use a non-CRDT collection for a tiered derivation/rollup source, or move the derivation off this collection.`
|
|
1990
|
-
);
|
|
1991
|
-
}
|
|
1992
|
-
const effectiveViaFields = mergeViaFields(opts);
|
|
1993
|
-
const resolvedClassified = opts.classifiedFields !== void 0 ? resolveClassifiedFields(opts.name, opts.classifiedFields) : void 0;
|
|
1994
|
-
const allComputed = unifyComputedFields(opts, effectiveViaFields.computedFields);
|
|
1995
|
-
const materializedComputed = {};
|
|
1996
|
-
for (const [field, entry] of Object.entries(allComputed)) {
|
|
1997
|
-
if (computedEntryParts(entry).mode !== "virtual") materializedComputed[field] = entry;
|
|
1998
|
-
}
|
|
1999
|
-
let mergedComputed = Object.keys(materializedComputed).length > 0 ? materializedComputed : void 0;
|
|
2000
|
-
if (resolvedClassified !== void 0) {
|
|
2001
|
-
for (const key of Object.keys(allComputed)) {
|
|
2002
|
-
if (resolvedClassified.riderComputed[key] !== void 0) {
|
|
2003
|
-
throw new ClassifiedConfigError(opts.name, `computed field "${key}" collides with a rider companion`);
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
mergedComputed = { ...resolvedClassified.riderComputed, ...materializedComputed };
|
|
2007
|
-
}
|
|
2008
|
-
let deterministicFields;
|
|
2009
|
-
if (opts.deterministicFields && opts.deterministicFields.length > 0) {
|
|
2010
|
-
if (opts.acknowledgeDeterministicRisk !== true) {
|
|
2011
|
-
throw new Error(
|
|
2012
|
-
`Collection "${opts.name}": deterministicFields requires \`acknowledgeDeterministicRisk: true\`. Deterministic encryption leaks equality between records \u2014 two records with the same field value produce identical ciphertexts visible to anyone with store access. If that trade-off is acceptable for your threat model, set \`acknowledgeDeterministicRisk: true\` to enable.`
|
|
2013
|
-
);
|
|
2014
|
-
}
|
|
2015
|
-
deterministicFields = Object.freeze(new Set(opts.deterministicFields));
|
|
2016
|
-
} else {
|
|
2017
|
-
deterministicFields = null;
|
|
2018
|
-
}
|
|
2019
|
-
const guardIndexedFields = /* @__PURE__ */ new Set();
|
|
2020
|
-
for (const ix of opts.indexes ?? []) {
|
|
2021
|
-
if (typeof ix === "string") guardIndexedFields.add(ix);
|
|
2022
|
-
else if (Array.isArray(ix)) for (const f of ix) guardIndexedFields.add(f);
|
|
2023
|
-
else for (const f of ix.fields) guardIndexedFields.add(f);
|
|
2024
|
-
}
|
|
2025
|
-
const embeddingSources = opts.embeddings === void 0 ? [] : typeof opts.embeddings.source === "string" ? [opts.embeddings.source] : [...opts.embeddings.source];
|
|
2026
|
-
const classifiedGuardCtx = {
|
|
2027
|
-
perRecordKeys: opts.perRecordKeys === true,
|
|
2028
|
-
crdt: opts.crdt !== void 0,
|
|
2029
|
-
hasConflictPolicy: opts.conflictPolicy !== void 0,
|
|
2030
|
-
storeCiphertext: opts.encrypted,
|
|
2031
|
-
deterministicFields,
|
|
2032
|
-
indexedFields: guardIndexedFields,
|
|
2033
|
-
textIndexFields: new Set(opts.textIndexes ?? []),
|
|
2034
|
-
vectorSourceFields: new Set(embeddingSources),
|
|
2035
|
-
subjectKeyField: opts.subjectKeyField,
|
|
2036
|
-
bareSensitiveFields: new Set(opts.sensitive ?? []),
|
|
2037
|
-
acknowledgeEquatableRisk: opts.acknowledgeEquatableRisk === true
|
|
2038
|
-
};
|
|
2039
|
-
if (resolvedClassified !== void 0) {
|
|
2040
|
-
guardClassifiedCompat(opts.name, resolvedClassified.byField, classifiedGuardCtx);
|
|
2041
|
-
}
|
|
2042
|
-
const classifiedSensitive = resolvedClassified === void 0 ? [] : Object.entries(resolvedClassified.byField).filter(([, s]) => s.storage === "recoverable").map(([f]) => f);
|
|
2043
|
-
const sensitiveList = [...opts.sensitive ?? [], ...classifiedSensitive];
|
|
2044
|
-
const sensitiveFields = sensitiveList.length > 0 ? Object.freeze(new Set(sensitiveList)) : Object.freeze(/* @__PURE__ */ new Set());
|
|
2045
|
-
const vdigEntries = resolvedClassified === void 0 ? [] : Object.entries(resolvedClassified.byField).filter(([, s]) => s.storage === "digest-only").map(([f, s]) => [f, {
|
|
2046
|
-
normalize: s.verifyNormalize ?? "password",
|
|
2047
|
-
notLastN: s.notLastN ?? 0,
|
|
2048
|
-
equatable: s.equatable === true,
|
|
2049
|
-
...s.rotateDays !== void 0 ? { rotateDays: s.rotateDays } : {}
|
|
2050
|
-
}]);
|
|
2051
|
-
const vdigFields = vdigEntries.length > 0 ? new Map(vdigEntries) : null;
|
|
2052
|
-
const perRecordCek = opts.perRecordKeys === true;
|
|
2053
|
-
const cekCache = perRecordCek ? new Lru({ maxRecords: 4096 }) : null;
|
|
2054
|
-
const viaEraseCfgOut = {};
|
|
2055
|
-
const via2 = ViaPipeline.build(compileVias(opts, classifiedGuardCtx, viaEraseCfgOut));
|
|
2056
|
-
const knownFields = collectKnownFieldNames({
|
|
2057
|
-
moneyFields: effectiveViaFields.moneyFields,
|
|
2058
|
-
i18nFields: effectiveViaFields.i18nFields,
|
|
2059
|
-
dictKeyFields: effectiveViaFields.dictKeyFields,
|
|
2060
|
-
classifiedFields: resolvedClassified?.byField,
|
|
2061
|
-
computed: allComputed,
|
|
2062
|
-
lookupFields: effectiveViaFields.lookupFields
|
|
2063
|
-
});
|
|
2064
|
-
const computedEdges = resolveComputedEdges(opts.name, allComputed, resolvedClassified !== void 0, knownFields);
|
|
2065
|
-
const viaDepsEdges = resolveViaDepsEdges(opts.name, via2?.bindings ?? [], knownFields);
|
|
2066
|
-
return {
|
|
2067
|
-
adapter: opts.adapter,
|
|
2068
|
-
vault: opts.vault,
|
|
2069
|
-
name: opts.name,
|
|
2070
|
-
keyring: opts.keyring,
|
|
2071
|
-
storeCiphertext: opts.encrypted,
|
|
2072
|
-
ramCiphertext: opts.ramCiphertext ?? false,
|
|
2073
|
-
emitter: opts.emitter,
|
|
2074
|
-
writeQueue: opts.writeQueue,
|
|
2075
|
-
schemaUpdateGate: opts.schemaUpdateGate,
|
|
2076
|
-
schemaFence: opts.schemaFence,
|
|
2077
|
-
writeHooks: opts.writeHooks,
|
|
2078
|
-
subsystemBus: opts.subsystemBus,
|
|
2079
|
-
activeTxId: opts.activeTxId,
|
|
2080
|
-
strategies: opts.strategies,
|
|
2081
|
-
objectStore: opts.objectStore,
|
|
2082
|
-
blobFields: opts.blobFields,
|
|
2083
|
-
reconcileOnOpen: opts.reconcileOnOpen ?? "off",
|
|
2084
|
-
getDEK: opts.getDEK,
|
|
2085
|
-
onDirty: opts.onDirty,
|
|
2086
|
-
tabCoordinated: opts.tabCoordinated,
|
|
2087
|
-
historyConfig: opts.historyConfig ?? { enabled: true },
|
|
2088
|
-
historyConfigExplicit: opts.historyConfigExplicit ?? false,
|
|
2089
|
-
schema: opts.schema,
|
|
2090
|
-
ledger: opts.ledger,
|
|
2091
|
-
refEnforcer: opts.refEnforcer,
|
|
2092
|
-
joinResolver: opts.joinResolver,
|
|
2093
|
-
i18nFields: effectiveViaFields.i18nFields,
|
|
2094
|
-
textIndexes: opts.textIndexes,
|
|
2095
|
-
embeddings: opts.embeddings,
|
|
2096
|
-
vectorSet: opts.embeddings ? new VectorSet() : void 0,
|
|
2097
|
-
dictKeyFields: effectiveViaFields.dictKeyFields,
|
|
2098
|
-
lookupFields: effectiveViaFields.lookupFields,
|
|
2099
|
-
// #650 Task 6 — the sync join-dressing hook (#626 retirement, spec §5);
|
|
2100
|
-
// `undefined` when this collection declares neither i18nText nor lookup
|
|
2101
|
-
// fields, matching today's `i18nFields`-absent JoinableSource shape.
|
|
2102
|
-
presentForJoin: buildPresentForJoin(effectiveViaFields.i18nFields, effectiveViaFields.lookupFields, opts.snapshotFor),
|
|
2103
|
-
fieldMeta: opts.fieldMeta,
|
|
2104
|
-
meta: opts.meta,
|
|
2105
|
-
_refs: opts.declaredRefs ?? {},
|
|
2106
|
-
via: via2,
|
|
2107
|
-
classifiedEraseCfg: viaEraseCfgOut.classified,
|
|
2108
|
-
moneyFields: effectiveViaFields.moneyFields,
|
|
2109
|
-
classified: resolvedClassified,
|
|
2110
|
-
classifiedGuardCtx,
|
|
2111
|
-
computed: mergedComputed,
|
|
2112
|
-
computedEdges,
|
|
2113
|
-
viaDepsEdges,
|
|
2114
|
-
// #638 Task 7 — every declared computed field name (both modes, both surfaces); the
|
|
2115
|
-
// reconcile path's cross-call depsless-computed leak-guard memory
|
|
2116
|
-
// (`via/graph-wiring.ts#registerCollectionGraphSources`) reads this instead of
|
|
2117
|
-
// `Object.keys(opts.computed ?? {})` alone, so a via(computed(...))-declared field
|
|
2118
|
-
// participates in that guard identically to a sugar-declared one.
|
|
2119
|
-
computedFieldNames: Object.keys(allComputed),
|
|
2120
|
-
dictLabelResolver: opts.dictLabelResolver,
|
|
2121
|
-
getDictionary: opts.getDictionary,
|
|
2122
|
-
i18nPutValidator: opts.i18nPutValidator,
|
|
2123
|
-
autoTranslateHook: opts.autoTranslateHook,
|
|
2124
|
-
defaultLocale: opts.defaultLocale,
|
|
2125
|
-
crdtMode: opts.crdt,
|
|
2126
|
-
syncAdapter: opts.syncAdapter,
|
|
2127
|
-
onAccess: opts.onAccess,
|
|
2128
|
-
derivationSource: opts.derivationSource,
|
|
2129
|
-
materializedViewSource: opts.materializedViewSource,
|
|
2130
|
-
graphDispatch: opts.graphDispatch,
|
|
2131
|
-
tiers: opts.tiers && opts.tiers.length > 0 ? new Set(opts.tiers) : null,
|
|
2132
|
-
tierMode: opts.tierMode ?? "invisibility",
|
|
2133
|
-
blobTierPolicy: opts.blobTierPolicy ?? "isolate",
|
|
2134
|
-
onCrossTierAccess: opts.onCrossTierAccess,
|
|
2135
|
-
addSubjectRef: opts.addSubjectRef,
|
|
2136
|
-
deterministicFields,
|
|
2137
|
-
sensitiveFields,
|
|
2138
|
-
vdigFields,
|
|
2139
|
-
perRecordCek,
|
|
2140
|
-
cekCache,
|
|
2141
|
-
provenance: opts.provenance === true
|
|
2142
|
-
};
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
1327
|
// src/with-formula/computed/lazy.ts
|
|
2146
|
-
var loadComputed = lazy(() => import("./computed-
|
|
1328
|
+
var loadComputed = lazy(() => import("./computed-VPOKQK4N.js"));
|
|
2147
1329
|
async function loadEvalComputedFields() {
|
|
2148
1330
|
return (await loadComputed()).evalComputedFields;
|
|
2149
1331
|
}
|
|
@@ -2812,7 +1994,7 @@ var Collection = class {
|
|
|
2812
1994
|
}
|
|
2813
1995
|
/** JSON Schema for this collection with describe() metadata as x- extensions. */
|
|
2814
1996
|
async toJSONSchema() {
|
|
2815
|
-
const { buildJsonSchema } = await import("./json-schema-
|
|
1997
|
+
const { buildJsonSchema } = await import("./json-schema-V3M5MUCM.js");
|
|
2816
1998
|
const desc = await this.describe({});
|
|
2817
1999
|
let base = null;
|
|
2818
2000
|
if (this.schema !== void 0) {
|
|
@@ -2928,7 +2110,7 @@ var Collection = class {
|
|
|
2928
2110
|
}
|
|
2929
2111
|
await this.onAccess?.("find", "*");
|
|
2930
2112
|
if (hits.length === 0) return [];
|
|
2931
|
-
const { verifyDigestField } = await import("./verify-
|
|
2113
|
+
const { verifyDigestField } = await import("./verify-KOV2G5D6.js");
|
|
2932
2114
|
const policy = {
|
|
2933
2115
|
normalize: spec.verifyNormalize ?? "password",
|
|
2934
2116
|
notLastN: spec.notLastN ?? 0,
|
|
@@ -3140,7 +2322,7 @@ var Collection = class {
|
|
|
3140
2322
|
}
|
|
3141
2323
|
}
|
|
3142
2324
|
if (this.materializedViewSource !== void 0) {
|
|
3143
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
2325
|
+
const { resolveStaleMVOnRead } = await import("./stale-AU74OPUW.js");
|
|
3144
2326
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
|
|
3145
2327
|
}
|
|
3146
2328
|
let record;
|
|
@@ -3672,7 +2854,7 @@ var Collection = class {
|
|
|
3672
2854
|
*/
|
|
3673
2855
|
async dispatchMaterializedViews(id, record, wave) {
|
|
3674
2856
|
if (this.materializedViewSource === void 0) return;
|
|
3675
|
-
const { dispatchMaterializedViews } = await import("./dispatch-
|
|
2857
|
+
const { dispatchMaterializedViews } = await import("./dispatch-GGFBWQU7.js");
|
|
3676
2858
|
return dispatchMaterializedViews(this.#mvDispatchCtx(this.materializedViewSource), id, record, wave);
|
|
3677
2859
|
}
|
|
3678
2860
|
/**
|
|
@@ -3838,13 +3020,13 @@ var Collection = class {
|
|
|
3838
3020
|
* dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
|
|
3839
3021
|
async dispatchDerivations(id, record, version, wave, prior) {
|
|
3840
3022
|
if (this.derivationSource === void 0) return;
|
|
3841
|
-
const { dispatchDerivations } = await import("./dispatch-
|
|
3023
|
+
const { dispatchDerivations } = await import("./dispatch-DC3LQJ3S.js");
|
|
3842
3024
|
return dispatchDerivations(this.#derivationDispatchCtx(), id, record, version, wave, prior);
|
|
3843
3025
|
}
|
|
3844
3026
|
/** @internal — trigger fan-out for a deleted parent (#1249); see dispatch.ts. */
|
|
3845
3027
|
async dispatchTriggerDerivationsOnDelete(id, deleted) {
|
|
3846
3028
|
if (this.derivationSource === void 0) return;
|
|
3847
|
-
const { dispatchTriggerDerivationsOnDelete } = await import("./dispatch-
|
|
3029
|
+
const { dispatchTriggerDerivationsOnDelete } = await import("./dispatch-DC3LQJ3S.js");
|
|
3848
3030
|
return dispatchTriggerDerivationsOnDelete(this.#derivationDispatchCtx(), id, deleted);
|
|
3849
3031
|
}
|
|
3850
3032
|
/**
|
|
@@ -4156,7 +3338,7 @@ var Collection = class {
|
|
|
4156
3338
|
*/
|
|
4157
3339
|
async dispatchArrayDerivationsOnDelete(id, eraseRecordShapeToo = false) {
|
|
4158
3340
|
if (this.derivationSource === void 0) return 0;
|
|
4159
|
-
const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-
|
|
3341
|
+
const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-DC3LQJ3S.js");
|
|
4160
3342
|
return dispatchArrayDerivationsOnDelete(this.#derivationDeleteCtx(this.derivationSource), id, eraseRecordShapeToo);
|
|
4161
3343
|
}
|
|
4162
3344
|
/**
|
|
@@ -4170,7 +3352,7 @@ var Collection = class {
|
|
|
4170
3352
|
*/
|
|
4171
3353
|
async dispatchMaterializedViewsOnDelete(id) {
|
|
4172
3354
|
if (this.materializedViewSource === void 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
|
|
4173
|
-
const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-
|
|
3355
|
+
const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-GGFBWQU7.js");
|
|
4174
3356
|
return dispatchMaterializedViewsOnDelete(this.#mvDispatchCtx(this.materializedViewSource), id);
|
|
4175
3357
|
}
|
|
4176
3358
|
/**
|
|
@@ -4190,7 +3372,7 @@ var Collection = class {
|
|
|
4190
3372
|
);
|
|
4191
3373
|
}
|
|
4192
3374
|
if (this.materializedViewSource !== void 0) {
|
|
4193
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
3375
|
+
const { resolveStaleMVOnRead } = await import("./stale-AU74OPUW.js");
|
|
4194
3376
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
|
|
4195
3377
|
}
|
|
4196
3378
|
await this.ensureHydrated();
|
|
@@ -5300,14 +4482,14 @@ var Collection = class {
|
|
|
5300
4482
|
/** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
|
|
5301
4483
|
async _ensureClassifiedMarker() {
|
|
5302
4484
|
if (this._markerPersisted || this.vdigFields === null) return;
|
|
5303
|
-
const { persistClassifiedMarkerForFields } = await import("./classified-marker-
|
|
4485
|
+
const { persistClassifiedMarkerForFields } = await import("./classified-marker-OO65UYXN.js");
|
|
5304
4486
|
await persistClassifiedMarkerForFields(this.adapter, this.vault, this.name, this.vdigFields, await this.getDEK(this.name));
|
|
5305
4487
|
this._markerPersisted = true;
|
|
5306
4488
|
}
|
|
5307
4489
|
/** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
|
|
5308
4490
|
async _classifiedMarkerDigestOnly() {
|
|
5309
4491
|
if (this._markerDigestOnlyCache !== void 0) return this._markerDigestOnlyCache;
|
|
5310
|
-
const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-
|
|
4492
|
+
const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-OO65UYXN.js");
|
|
5311
4493
|
this._markerDigestOnlyCache = await readClassifiedMarkerDigestOnly(this.adapter, this.vault, this.name, await this.getDEK(this.name));
|
|
5312
4494
|
return this._markerDigestOnlyCache;
|
|
5313
4495
|
}
|
|
@@ -6933,7 +6115,7 @@ var VaultLinks = class {
|
|
|
6933
6115
|
// src/with-shape/links/lazy-handle.ts
|
|
6934
6116
|
function makeLazyLinkSetHandle(d) {
|
|
6935
6117
|
let engine = null;
|
|
6936
|
-
const load = () => engine ??= import("./link-set-
|
|
6118
|
+
const load = () => engine ??= import("./link-set-67CAMUAL.js").then(
|
|
6937
6119
|
({ LinkSet }) => new LinkSet(d.adapter, d.vault, d.name, d.spec, d.encrypted, d.getDEK, d.actor, d.emitter, d.endpointExists)
|
|
6938
6120
|
);
|
|
6939
6121
|
return {
|
|
@@ -7584,7 +6766,7 @@ function declareSatellite(ctx, collectionName, options, existingRegistry) {
|
|
|
7584
6766
|
ctx.forEachSyncEngine((e) => e.remirrorPairResolvers([spec.base, spec.satellite]));
|
|
7585
6767
|
const registry = reg;
|
|
7586
6768
|
const baseSchema = ctx.getBaseSchema(spec.base);
|
|
7587
|
-
void import("./post-register-
|
|
6769
|
+
void import("./post-register-HIYY4Y5S.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
|
|
7588
6770
|
});
|
|
7589
6771
|
return reg;
|
|
7590
6772
|
}
|
|
@@ -8559,7 +7741,7 @@ var Vault = class {
|
|
|
8559
7741
|
const strategies = options.schemaUpdate ?? [];
|
|
8560
7742
|
const work = (async () => {
|
|
8561
7743
|
const dek = await this.getDEK(collectionName);
|
|
8562
|
-
const { persistSchemaIfNeeded } = await import("./register-
|
|
7744
|
+
const { persistSchemaIfNeeded } = await import("./register-7OJWAWT5.js");
|
|
8563
7745
|
const result = await persistSchemaIfNeeded({
|
|
8564
7746
|
store: this.adapter,
|
|
8565
7747
|
vault: this.name,
|
|
@@ -8621,7 +7803,7 @@ var Vault = class {
|
|
|
8621
7803
|
// Vaults without derivations skip this so `Collection.put`'s
|
|
8622
7804
|
// `if (this.derivationSource)` branch no-ops without touching the
|
|
8623
7805
|
// derivation service code.
|
|
8624
|
-
...this.derivationRegistry !== null ? (this.derivationRegistry.validateFieldsFor(collectionName, options?.schema, Object.keys({ ...options?.fieldMeta, ...options?.moneyFields, ...options?.dictKeyFields, ...options?.refs, ...options?.computed, ...options?.i18nFields, ...options?.lookupFields, ...options?.blobFields, ...options?.classifiedFields })), {
|
|
7806
|
+
...this.derivationRegistry !== null ? (this.derivationRegistry.validateFieldsFor(collectionName, options?.schema, Object.keys({ ...options?.fieldMeta, ...options?.moneyFields, ...options?.dictKeyFields, ...options?.refs, ...options?.computed, ...options?.i18nFields, ...options?.lookupFields, ...options?.blobFields, ...options?.classifiedFields }), options), {
|
|
8625
7807
|
derivationSource: {
|
|
8626
7808
|
registry: () => this.derivationRegistry,
|
|
8627
7809
|
getCollection: (name) => this.collection(name),
|
|
@@ -8709,7 +7891,7 @@ var Vault = class {
|
|
|
8709
7891
|
const work = (async () => {
|
|
8710
7892
|
try {
|
|
8711
7893
|
const dek = await this.getDEK(collectionName);
|
|
8712
|
-
await (await import("./register-
|
|
7894
|
+
await (await import("./register-7OJWAWT5.js")).persistSchemaIfNeeded({
|
|
8713
7895
|
store: this.adapter,
|
|
8714
7896
|
vault: this.name,
|
|
8715
7897
|
collectionName,
|
|
@@ -8755,7 +7937,7 @@ var Vault = class {
|
|
|
8755
7937
|
* writes (unfenced walk — see `with-shape/satellites/migrate-cek.ts`); resumable.
|
|
8756
7938
|
*/
|
|
8757
7939
|
async migrateSatellitePerRecordKeys(satelliteName) {
|
|
8758
|
-
const { migrateSatelliteCek } = await import("./migrate-cek-
|
|
7940
|
+
const { migrateSatelliteCek } = await import("./migrate-cek-5ENH64AA.js");
|
|
8759
7941
|
return migrateSatelliteCek(satelliteName, this.collection(satelliteName, { perRecordKeys: true }));
|
|
8760
7942
|
}
|
|
8761
7943
|
/**
|
|
@@ -8937,7 +8119,7 @@ var Vault = class {
|
|
|
8937
8119
|
async _ensureFenceCoordination() {
|
|
8938
8120
|
if (this.#fenceCoordinationStarted) return;
|
|
8939
8121
|
this.#fenceCoordinationStarted = true;
|
|
8940
|
-
const { FenceWatcher } = await import("./fence-watcher-
|
|
8122
|
+
const { FenceWatcher } = await import("./fence-watcher-U2PW6JU5.js");
|
|
8941
8123
|
if (!this.#fenceCoordinationStarted) return;
|
|
8942
8124
|
this.#fenceWatcher = new FenceWatcher({
|
|
8943
8125
|
coordination: this.noydb.mesh,
|
|
@@ -9386,7 +8568,7 @@ var Vault = class {
|
|
|
9386
8568
|
*/
|
|
9387
8569
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
9388
8570
|
async _loadPodSigner() {
|
|
9389
|
-
const { loadSigner } = await import("./signer-
|
|
8571
|
+
const { loadSigner } = await import("./signer-5K3WDHOC.js");
|
|
9390
8572
|
return loadSigner(this.adapter, this.name, this.getDEK);
|
|
9391
8573
|
}
|
|
9392
8574
|
async writeExportAudit(entry) {
|
|
@@ -9615,7 +8797,7 @@ var Vault = class {
|
|
|
9615
8797
|
const blobsEnabled = this.strategies.blobs !== NO_BLOBS;
|
|
9616
8798
|
const actor = this.keyring.userId;
|
|
9617
8799
|
const fanoutStats = { recordsErased: 0, aggregatesRecomputed: 0, residueFrozen: [], lookupReferencesCascaded: 0, lookupReferencesNullified: 0, lookupReferencesResidue: [], derivedResidueUndecodable: [], derivedResidueDeclined: [] };
|
|
9618
|
-
const { partitionSealedCekKeys, shouldSkipBlobScan, bumpResidueCount, residueNoticesFromMap } = await import("./purge-scope-
|
|
8800
|
+
const { partitionSealedCekKeys, shouldSkipBlobScan, bumpResidueCount, residueNoticesFromMap } = await import("./purge-scope-4HEFPDOW.js");
|
|
9619
8801
|
const scopedPurge = this.strategies.forget.scopedPurge === true;
|
|
9620
8802
|
const sealedCekScopedSkipped = /* @__PURE__ */ new Map();
|
|
9621
8803
|
const blobScopedSkipped = /* @__PURE__ */ new Map();
|
|
@@ -9876,8 +9058,8 @@ var Vault = class {
|
|
|
9876
9058
|
async _initGuards(handles) {
|
|
9877
9059
|
if (handles.length === 0) return;
|
|
9878
9060
|
const [{ GuardRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
|
|
9879
|
-
import("./registry-
|
|
9880
|
-
import("./read-only-facade-
|
|
9061
|
+
import("./registry-4AYVUNXK.js"),
|
|
9062
|
+
import("./read-only-facade-BIGO37U3.js")
|
|
9881
9063
|
]);
|
|
9882
9064
|
const registry = new GuardRegistry();
|
|
9883
9065
|
for (const h of handles) registry.register(h.spec);
|
|
@@ -9904,8 +9086,8 @@ var Vault = class {
|
|
|
9904
9086
|
async _initDerivations(handles) {
|
|
9905
9087
|
if (handles.length === 0) return;
|
|
9906
9088
|
const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
|
|
9907
|
-
import("./registry-
|
|
9908
|
-
import("./read-only-facade-
|
|
9089
|
+
import("./registry-HDINK5QW.js"),
|
|
9090
|
+
import("./read-only-facade-BIGO37U3.js")
|
|
9909
9091
|
]);
|
|
9910
9092
|
const registry = new DerivationRegistry();
|
|
9911
9093
|
for (const h of handles) {
|
|
@@ -9936,7 +9118,7 @@ var Vault = class {
|
|
|
9936
9118
|
*/
|
|
9937
9119
|
async _initMaterializedViews(handles) {
|
|
9938
9120
|
if (handles.length === 0) return;
|
|
9939
|
-
const { MaterializedViewRegistry } = await import("./registry-
|
|
9121
|
+
const { MaterializedViewRegistry } = await import("./registry-5MVJGPXW.js");
|
|
9940
9122
|
const registry = new MaterializedViewRegistry();
|
|
9941
9123
|
this.materializedViewRegistry = registry;
|
|
9942
9124
|
const db = this;
|
|
@@ -9961,7 +9143,7 @@ var Vault = class {
|
|
|
9961
9143
|
*/
|
|
9962
9144
|
async _initOverlayedViews(handles) {
|
|
9963
9145
|
if (handles.length === 0) return;
|
|
9964
|
-
const { OverlayedViewRegistry } = await import("./registry-
|
|
9146
|
+
const { OverlayedViewRegistry } = await import("./registry-23WF3TGH.js");
|
|
9965
9147
|
const registry = new OverlayedViewRegistry();
|
|
9966
9148
|
const mvRegistry = this.materializedViewRegistry;
|
|
9967
9149
|
const overlayNames = /* @__PURE__ */ new Set();
|
|
@@ -10024,14 +9206,14 @@ var Vault = class {
|
|
|
10024
9206
|
if (!reg) {
|
|
10025
9207
|
throw new Error(`refreshView: no MV registered with name "${name}"`);
|
|
10026
9208
|
}
|
|
10027
|
-
const { MaterializedViewExecutor } = await import("./executor-
|
|
9209
|
+
const { MaterializedViewExecutor } = await import("./executor-5XJNV5H5.js");
|
|
10028
9210
|
const result = await MaterializedViewExecutor.refresh(reg, {
|
|
10029
9211
|
getCollection: (n) => this.collection(n),
|
|
10030
9212
|
getActiveTxContext: () => this.noydb._activeTxContextOrNull,
|
|
10031
9213
|
getQueryContext: () => this,
|
|
10032
9214
|
dispatchCtx: this._dispatchCtx({ collection: name, id: "refreshView" })
|
|
10033
9215
|
});
|
|
10034
|
-
const { clearMVStaleFully } = await import("./stale-
|
|
9216
|
+
const { clearMVStaleFully } = await import("./stale-AU74OPUW.js");
|
|
10035
9217
|
await clearMVStaleFully(this.adapter, this.name, registry, name);
|
|
10036
9218
|
return result;
|
|
10037
9219
|
}
|
|
@@ -10044,10 +9226,10 @@ var Vault = class {
|
|
|
10044
9226
|
if (registry === null) return { derived: 0, failed: 0, skippedFrozen: 0 };
|
|
10045
9227
|
const strategies = registry.strategiesForSource(sourceCollection);
|
|
10046
9228
|
if (strategies.length === 0) return { derived: 0, failed: 0, skippedFrozen: 0 };
|
|
10047
|
-
const { DerivationExecutor } = await import("./executor-
|
|
9229
|
+
const { DerivationExecutor } = await import("./executor-5NIMLSKZ.js");
|
|
10048
9230
|
const sourceColl = this.collection(sourceCollection);
|
|
10049
9231
|
const records = await sourceColl.list();
|
|
10050
|
-
const ctx = { vault: this.derivationFacade ?? new (await import("./read-only-facade-
|
|
9232
|
+
const ctx = { vault: this.derivationFacade ?? new (await import("./read-only-facade-BIGO37U3.js")).ReadOnlyVaultFacade(this, "derivation") };
|
|
10051
9233
|
let derived = 0;
|
|
10052
9234
|
let failed = 0;
|
|
10053
9235
|
let skippedFrozen = 0;
|
|
@@ -10071,7 +9253,7 @@ var Vault = class {
|
|
|
10071
9253
|
if (!outSpec) continue;
|
|
10072
9254
|
const outputColl = this.collection(outSpec.collection);
|
|
10073
9255
|
if (out.kind === "array") {
|
|
10074
|
-
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-
|
|
9256
|
+
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-HJIVUPTD.js");
|
|
10075
9257
|
const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key, this.getDEK, this.encrypted);
|
|
10076
9258
|
const prevKeys = new Set(prior?.keys ?? []);
|
|
10077
9259
|
const newKeysList = out.entries.map((e) => e.key);
|
|
@@ -10298,7 +9480,7 @@ var Vault = class {
|
|
|
10298
9480
|
* collection.
|
|
10299
9481
|
*/
|
|
10300
9482
|
async delegate(opts) {
|
|
10301
|
-
const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-
|
|
9483
|
+
const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-VRYMQRCF.js");
|
|
10302
9484
|
if (!this.keyring.kek) {
|
|
10303
9485
|
throw new ValidationError(
|
|
10304
9486
|
"issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (secret) first."
|
|
@@ -10320,7 +9502,7 @@ var Vault = class {
|
|
|
10320
9502
|
* if the id does not exist.
|
|
10321
9503
|
*/
|
|
10322
9504
|
async revokeDelegation(id) {
|
|
10323
|
-
const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-
|
|
9505
|
+
const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-VRYMQRCF.js");
|
|
10324
9506
|
await revokeDelegation(this.adapter, this.name, id);
|
|
10325
9507
|
void DELEGATIONS_COLLECTION;
|
|
10326
9508
|
}
|
|
@@ -10573,7 +9755,7 @@ var Vault = class {
|
|
|
10573
9755
|
* @see design-history/2026-05-22-schema-dump-design.md
|
|
10574
9756
|
*/
|
|
10575
9757
|
async dumpSchema(opts = {}) {
|
|
10576
|
-
const { dumpVaultSchema } = await import("./walk-
|
|
9758
|
+
const { dumpVaultSchema } = await import("./walk-ERAJ5RHO.js");
|
|
10577
9759
|
return dumpVaultSchema(this, opts);
|
|
10578
9760
|
}
|
|
10579
9761
|
/**
|
|
@@ -10669,7 +9851,7 @@ var Vault = class {
|
|
|
10669
9851
|
* separate vault instances now.
|
|
10670
9852
|
*/
|
|
10671
9853
|
async getPodHandle() {
|
|
10672
|
-
const { buildPodHandle } = await import("./pod-handle-
|
|
9854
|
+
const { buildPodHandle } = await import("./pod-handle-S7AMCJIF.js");
|
|
10673
9855
|
return buildPodHandle(this.adapter, this.name);
|
|
10674
9856
|
}
|
|
10675
9857
|
/**
|
|
@@ -10701,7 +9883,7 @@ var Vault = class {
|
|
|
10701
9883
|
* both modes round-trip cleanly.
|
|
10702
9884
|
*/
|
|
10703
9885
|
async dump() {
|
|
10704
|
-
const { dumpVault } = await import("./backup-
|
|
9886
|
+
const { dumpVault } = await import("./backup-AKWIMYWU.js");
|
|
10705
9887
|
return dumpVault(this.backupContext());
|
|
10706
9888
|
}
|
|
10707
9889
|
/**
|
|
@@ -10753,7 +9935,7 @@ var Vault = class {
|
|
|
10753
9935
|
* — there's no chain to verify against.
|
|
10754
9936
|
*/
|
|
10755
9937
|
async load(backupJson) {
|
|
10756
|
-
const { loadVault } = await import("./backup-
|
|
9938
|
+
const { loadVault } = await import("./backup-AKWIMYWU.js");
|
|
10757
9939
|
return loadVault(this.backupContext(), backupJson);
|
|
10758
9940
|
}
|
|
10759
9941
|
/**
|
|
@@ -10785,7 +9967,7 @@ var Vault = class {
|
|
|
10785
9967
|
* way to detect tampering of an in-place vault.
|
|
10786
9968
|
*/
|
|
10787
9969
|
async verifyBackupIntegrity() {
|
|
10788
|
-
const { verifyBackupIntegrity } = await import("./backup-
|
|
9970
|
+
const { verifyBackupIntegrity } = await import("./backup-AKWIMYWU.js");
|
|
10789
9971
|
return verifyBackupIntegrity(this.backupContext());
|
|
10790
9972
|
}
|
|
10791
9973
|
/**
|
|
@@ -11015,7 +10197,7 @@ var Vault = class {
|
|
|
11015
10197
|
* is the live validator object, not a serialization of it).
|
|
11016
10198
|
*/
|
|
11017
10199
|
async exportJSON(opts = {}) {
|
|
11018
|
-
const { exportVaultJSON } = await import("./backup-
|
|
10200
|
+
const { exportVaultJSON } = await import("./backup-AKWIMYWU.js");
|
|
11019
10201
|
return exportVaultJSON(this.backupContext(), opts);
|
|
11020
10202
|
}
|
|
11021
10203
|
};
|
|
@@ -12943,7 +12125,7 @@ var Noydb = class {
|
|
|
12943
12125
|
if (!facade) return;
|
|
12944
12126
|
const ctx = { existing, vault: facade, userId: e.userId, role: e.role };
|
|
12945
12127
|
await registry.runChecks(e.collection, incoming, ctx);
|
|
12946
|
-
const { GuardExecutor } = await import("./executor-
|
|
12128
|
+
const { GuardExecutor } = await import("./executor-AQVXV5GZ.js");
|
|
12947
12129
|
for (const g of guards) {
|
|
12948
12130
|
await GuardExecutor.checkFrozenFields(g, e.docId, existing, incoming, e.computedFieldNames);
|
|
12949
12131
|
}
|
|
@@ -14315,7 +13497,7 @@ async function createNoydb(options) {
|
|
|
14315
13497
|
if (!options.store) options = { ...options, store: memoryStore() };
|
|
14316
13498
|
validateSecretModeOptions(options);
|
|
14317
13499
|
if (!options.mesh) options = { ...options, mesh: await createDefaultMesh(options.store) };
|
|
14318
|
-
if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-
|
|
13500
|
+
if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-JPZT6BDD.js")).createUserApi };
|
|
14319
13501
|
if (!options.policyFactory) {
|
|
14320
13502
|
const policyModule = await import("./policy/index.js");
|
|
14321
13503
|
options = { ...options, policyFactory: policyModule.createNoydbPolicy, policyCheckGateFn: policyModule.checkGate };
|
|
@@ -14334,8 +13516,6 @@ function normalizeSyncTargets(sync) {
|
|
|
14334
13516
|
export {
|
|
14335
13517
|
memoryStore,
|
|
14336
13518
|
withArchive,
|
|
14337
|
-
via,
|
|
14338
|
-
isViaFieldSpec,
|
|
14339
13519
|
Collection,
|
|
14340
13520
|
ELEVATION_AUDIT_COLLECTION,
|
|
14341
13521
|
ElevatedHandle,
|
|
@@ -14350,4 +13530,4 @@ export {
|
|
|
14350
13530
|
Noydb,
|
|
14351
13531
|
createNoydb
|
|
14352
13532
|
};
|
|
14353
|
-
//# sourceMappingURL=chunk-
|
|
13533
|
+
//# sourceMappingURL=chunk-DRB6IHPS.js.map
|