@noy-db/hub 0.2.0-pre.6 → 0.2.0-pre.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.js +4 -4
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +4 -4
- package/dist/attestation/index.d.ts +4 -4
- package/dist/attestation/index.js +6 -6
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +5 -5
- package/dist/blobs/index.d.ts +5 -5
- package/dist/blobs/index.js +5 -5
- package/dist/bundle/index.cjs +420 -29
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +6 -6
- package/dist/bundle/index.d.ts +6 -6
- package/dist/bundle/index.js +12 -12
- package/dist/{chunk-JICBEFBT.js → chunk-22DWZL57.js} +63 -27
- package/dist/chunk-22DWZL57.js.map +1 -0
- package/dist/{chunk-XDW37COG.js → chunk-2GLDA55J.js} +212 -7
- package/dist/chunk-2GLDA55J.js.map +1 -0
- package/dist/{chunk-RIHZBSWJ.js → chunk-2WUSG3IT.js} +3 -3
- package/dist/{chunk-JSYTGEX4.js → chunk-3BFJOWSU.js} +3 -3
- package/dist/{chunk-Y3P5DEMZ.js → chunk-3YPCK6JX.js} +6 -6
- package/dist/{chunk-A4JNVBPF.js → chunk-53XBRIRT.js} +5 -5
- package/dist/{chunk-CKH247ZR.js → chunk-5T22KDPN.js} +4 -4
- package/dist/{chunk-PX3MJ6RB.js → chunk-5XHKQ56N.js} +3 -3
- package/dist/{chunk-W277AG6N.js → chunk-6774ZOQ7.js} +170 -57
- package/dist/chunk-6774ZOQ7.js.map +1 -0
- package/dist/chunk-6STK5TQP.js +139 -0
- package/dist/chunk-6STK5TQP.js.map +1 -0
- package/dist/{chunk-6HJ2ZALB.js → chunk-B6PB7JLN.js} +66 -2
- package/dist/chunk-B6PB7JLN.js.map +1 -0
- package/dist/{chunk-5QPF2MJ5.js → chunk-BVRYKATC.js} +3 -3
- package/dist/{chunk-UGVDIOY7.js → chunk-DE6GKS6G.js} +2 -2
- package/dist/{chunk-R4LTCI6O.js → chunk-DFMLEQZB.js} +2 -2
- package/dist/{chunk-34XGYMQT.js → chunk-DJHHA6XH.js} +2 -2
- package/dist/{chunk-OPD3PZOG.js → chunk-DL3HWOQ5.js} +4 -4
- package/dist/{chunk-DFCINPB5.js → chunk-DO7C2TOG.js} +2 -2
- package/dist/{chunk-T6MTNGBM.js → chunk-DONMZAD2.js} +4 -4
- package/dist/{chunk-ARZAHCCF.js → chunk-F3GDRNUT.js} +3 -3
- package/dist/{chunk-XVJFFGTG.js → chunk-H2X3ISXG.js} +3 -3
- package/dist/{chunk-R7JTYCRX.js → chunk-HNRHLRDC.js} +2 -2
- package/dist/{chunk-E225X5CQ.js → chunk-I5FOWO4J.js} +3 -3
- package/dist/{chunk-ZQMYB56Z.js → chunk-JWRVQKRZ.js} +3 -3
- package/dist/{chunk-LWFQYT4N.js → chunk-K3DK3NU5.js} +2 -2
- package/dist/{chunk-WEA4TDTJ.js → chunk-ML236QKC.js} +3 -3
- package/dist/{chunk-G26QAQNI.js → chunk-NONAAENK.js} +2 -2
- package/dist/{chunk-YEHUEUNP.js → chunk-O3VZPBZG.js} +4 -4
- package/dist/{chunk-HIELMTUK.js → chunk-OIF6LZUR.js} +2 -2
- package/dist/{chunk-ED3E3OLO.js → chunk-OQ6PIGHA.js} +2 -2
- package/dist/{chunk-6A4AMQ2H.js → chunk-PE2FR4J3.js} +4 -4
- package/dist/{chunk-EKTOYEZ3.js → chunk-PP6W64Y3.js} +2 -2
- package/dist/{chunk-SGSHQ4PH.js → chunk-PX35GA7L.js} +5 -5
- package/dist/{chunk-YJ46RFCD.js → chunk-QEILDE6R.js} +2 -2
- package/dist/{chunk-KGFV72WK.js → chunk-QODLLGQ7.js} +5 -5
- package/dist/{chunk-2GMRNNI3.js → chunk-RAZ4OVLL.js} +2 -2
- package/dist/{chunk-25WFLKOH.js → chunk-SYMWGEET.js} +2 -2
- package/dist/{chunk-7TX7HN42.js → chunk-T7JEBOGN.js} +20 -3
- package/dist/chunk-T7JEBOGN.js.map +1 -0
- package/dist/{chunk-LJO6Q3X6.js → chunk-TFBP23BX.js} +3 -3
- package/dist/{chunk-ICH4AIGL.js → chunk-TV3YZ35S.js} +5 -1
- package/dist/chunk-TV3YZ35S.js.map +1 -0
- package/dist/{chunk-TNBIWSQ7.js → chunk-U26HQ6KJ.js} +2 -2
- package/dist/{chunk-CGJFCT3X.js → chunk-VTKGMEPP.js} +2 -2
- package/dist/{chunk-5VMTAX4Y.js → chunk-W6EQLGMB.js} +2 -2
- package/dist/{chunk-5OVIFUQE.js → chunk-WIRRPTFH.js} +1 -1
- package/dist/chunk-WIRRPTFH.js.map +1 -0
- package/dist/{chunk-PS5G6A3Y.js → chunk-WPLVTJ5D.js} +4 -4
- package/dist/{chunk-MDIC4FAU.js → chunk-XJFLDA7A.js} +2 -2
- package/dist/{chunk-CCC25PA7.js → chunk-ZYWZWG6G.js} +5 -5
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-5UDZZL26.js → crypto-HTZ4FJOP.js} +3 -3
- package/dist/{delegation-42LO4WFO.js → delegation-RI54P6I5.js} +5 -5
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +6 -6
- package/dist/derivations/index.d.ts +6 -6
- package/dist/derivations/index.js +4 -4
- package/dist/{dev-unlock-Dy1qVpkL.d.cts → dev-unlock-M4VAWNq_.d.cts} +1 -1
- package/dist/{dev-unlock-Cvo-xCQC.d.ts → dev-unlock-p3ysikWP.d.ts} +1 -1
- package/dist/executor-5PNY7LGW.js +8 -0
- package/dist/executor-B4QIYGZX.js +8 -0
- package/dist/executor-BWXXDQ7K.js +11 -0
- package/dist/{fanout-sidecar-EVICRM46.js → fanout-sidecar-OKPMMPLG.js} +2 -2
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +6 -6
- package/dist/guards/index.d.ts +6 -6
- package/dist/guards/index.js +3 -3
- package/dist/{hash-BgEQklQc.d.cts → hash-BPsYPcv_.d.cts} +1 -1
- package/dist/{hash-BAlWR4WD.d.ts → hash-C1GtiOhR.d.ts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +6 -6
- package/dist/history/index.d.ts +6 -6
- package/dist/history/index.js +5 -5
- package/dist/i18n/index.cjs +217 -22
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +5 -5
- package/dist/i18n/index.d.ts +5 -5
- package/dist/i18n/index.js +16 -5
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-5I0MZ0jQ.d.cts → index-4fBVt8j9.d.cts} +104 -7
- package/dist/{index-fIPPh5dg.d.ts → index-D8I_pyJD.d.ts} +104 -7
- package/dist/index.cjs +625 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +70 -52
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +4 -0
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.d.cts +3 -3
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +4 -4
- package/dist/issue-VGDPP4B5.js +12 -0
- package/dist/{lazy-builder-D1MyR1qH.d.ts → lazy-builder-7tIpFyWN.d.ts} +1 -1
- package/dist/{lazy-builder-DXlSCNCJ.d.cts → lazy-builder-wY4pMCEe.d.cts} +1 -1
- package/dist/{ledger-UX4QIHWI.js → ledger-TMRZYNVJ.js} +5 -5
- package/dist/materialized-views/index.cjs +18 -1
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +10 -8
- package/dist/materialized-views/index.d.ts +10 -8
- package/dist/materialized-views/index.js +12 -12
- package/dist/noydb-LZBH3XDK.js +34 -0
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +6 -6
- package/dist/overlay-views/index.d.ts +6 -6
- package/dist/overlay-views/index.js +6 -6
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +5 -5
- package/dist/periods/index.d.ts +5 -5
- package/dist/periods/index.js +5 -5
- package/dist/{predicate-B0IKeBXx.d.cts → predicate-BSAGEyu5.d.cts} +26 -2
- package/dist/{predicate-B0IKeBXx.d.ts → predicate-BSAGEyu5.d.ts} +26 -2
- package/dist/{public-envelope-YKHKP74C.js → public-envelope-BW6OXORV.js} +4 -4
- package/dist/query/index.cjs +244 -4
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +12 -6
- package/dist/registry-3QP3YKQS.js +8 -0
- package/dist/{registry-4NEW7LQY.js → registry-OJIOSBV6.js} +3 -3
- package/dist/registry-USRVT6YF.js +8 -0
- package/dist/{revoke-R5NIQ74J.js → revoke-JCC7N56X.js} +6 -6
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +6 -6
- package/dist/session/index.d.ts +6 -6
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +5 -5
- package/dist/shadow/index.d.ts +5 -5
- package/dist/shadow/index.js +2 -2
- package/dist/{signer-WGDJNWSU.js → signer-72QAUSVW.js} +5 -5
- package/dist/snapshots/index.cjs +903 -0
- package/dist/snapshots/index.cjs.map +1 -0
- package/dist/snapshots/index.d.cts +21 -0
- package/dist/snapshots/index.d.ts +21 -0
- package/dist/snapshots/index.js +118 -0
- package/dist/snapshots/index.js.map +1 -0
- package/dist/{stale-74WGLVZ2.js → stale-6ZDBTQT7.js} +2 -2
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +5 -5
- package/dist/store/index.d.ts +5 -5
- package/dist/store/index.js +2 -2
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +4 -4
- package/dist/sync/index.d.ts +4 -4
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +5 -5
- package/dist/team/index.d.ts +5 -5
- package/dist/team/index.js +8 -8
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +5 -5
- package/dist/tx/index.d.ts +5 -5
- package/dist/tx/index.js +3 -3
- package/dist/{types-DlnZh1_i.d.ts → types-DGU60JDt.d.ts} +235 -7
- package/dist/{types-DVlvNn2c.d.cts → types-DjunxzJa.d.cts} +235 -7
- package/dist/{ulid-CzPONlhG.d.ts → ulid-BFJkYRRW.d.ts} +1 -1
- package/dist/{ulid-r98nkjVd.d.cts → ulid-DPeuPgi3.d.cts} +1 -1
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/{with-derivation-BMQ9pIHe.d.cts → with-derivation-Df0kMlED.d.cts} +1 -1
- package/dist/{with-derivation-B98shCV8.d.ts → with-derivation-DfOpKjFw.d.ts} +1 -1
- package/dist/{with-guard-DmT50nVG.d.ts → with-guard-0KksDtSR.d.ts} +1 -1
- package/dist/{with-guard-DUnC3JDN.d.cts → with-guard-C6W5RVrH.d.cts} +1 -1
- package/dist/{with-materialized-view-Bp_M3sNG.d.ts → with-materialized-view-BiasFcYx.d.ts} +1 -1
- package/dist/{with-materialized-view-eMTZ65_J.d.cts → with-materialized-view-BmDKyHrm.d.cts} +1 -1
- package/dist/{with-overlayed-view-BoY6PB3n.d.cts → with-overlayed-view-CA66vhHz.d.cts} +1 -1
- package/dist/{with-overlayed-view-zzSnRQmS.d.ts → with-overlayed-view-CQViuko_.d.ts} +1 -1
- package/package.json +15 -4
- package/dist/chunk-5OVIFUQE.js.map +0 -1
- package/dist/chunk-6HJ2ZALB.js.map +0 -1
- package/dist/chunk-7TX7HN42.js.map +0 -1
- package/dist/chunk-ICH4AIGL.js.map +0 -1
- package/dist/chunk-JICBEFBT.js.map +0 -1
- package/dist/chunk-W277AG6N.js.map +0 -1
- package/dist/chunk-XDW37COG.js.map +0 -1
- package/dist/executor-AWCHQ2KN.js +0 -8
- package/dist/executor-RWICJI7J.js +0 -11
- package/dist/executor-SOLEQVUB.js +0 -8
- package/dist/issue-IODMTPME.js +0 -12
- package/dist/noydb-FY2666NY.js +0 -34
- package/dist/registry-446I2NMN.js +0 -8
- package/dist/registry-524KJZG4.js +0 -8
- /package/dist/{chunk-RIHZBSWJ.js.map → chunk-2WUSG3IT.js.map} +0 -0
- /package/dist/{chunk-JSYTGEX4.js.map → chunk-3BFJOWSU.js.map} +0 -0
- /package/dist/{chunk-Y3P5DEMZ.js.map → chunk-3YPCK6JX.js.map} +0 -0
- /package/dist/{chunk-A4JNVBPF.js.map → chunk-53XBRIRT.js.map} +0 -0
- /package/dist/{chunk-CKH247ZR.js.map → chunk-5T22KDPN.js.map} +0 -0
- /package/dist/{chunk-PX3MJ6RB.js.map → chunk-5XHKQ56N.js.map} +0 -0
- /package/dist/{chunk-5QPF2MJ5.js.map → chunk-BVRYKATC.js.map} +0 -0
- /package/dist/{chunk-UGVDIOY7.js.map → chunk-DE6GKS6G.js.map} +0 -0
- /package/dist/{chunk-R4LTCI6O.js.map → chunk-DFMLEQZB.js.map} +0 -0
- /package/dist/{chunk-34XGYMQT.js.map → chunk-DJHHA6XH.js.map} +0 -0
- /package/dist/{chunk-OPD3PZOG.js.map → chunk-DL3HWOQ5.js.map} +0 -0
- /package/dist/{chunk-DFCINPB5.js.map → chunk-DO7C2TOG.js.map} +0 -0
- /package/dist/{chunk-T6MTNGBM.js.map → chunk-DONMZAD2.js.map} +0 -0
- /package/dist/{chunk-ARZAHCCF.js.map → chunk-F3GDRNUT.js.map} +0 -0
- /package/dist/{chunk-XVJFFGTG.js.map → chunk-H2X3ISXG.js.map} +0 -0
- /package/dist/{chunk-R7JTYCRX.js.map → chunk-HNRHLRDC.js.map} +0 -0
- /package/dist/{chunk-E225X5CQ.js.map → chunk-I5FOWO4J.js.map} +0 -0
- /package/dist/{chunk-ZQMYB56Z.js.map → chunk-JWRVQKRZ.js.map} +0 -0
- /package/dist/{chunk-LWFQYT4N.js.map → chunk-K3DK3NU5.js.map} +0 -0
- /package/dist/{chunk-WEA4TDTJ.js.map → chunk-ML236QKC.js.map} +0 -0
- /package/dist/{chunk-G26QAQNI.js.map → chunk-NONAAENK.js.map} +0 -0
- /package/dist/{chunk-YEHUEUNP.js.map → chunk-O3VZPBZG.js.map} +0 -0
- /package/dist/{chunk-HIELMTUK.js.map → chunk-OIF6LZUR.js.map} +0 -0
- /package/dist/{chunk-ED3E3OLO.js.map → chunk-OQ6PIGHA.js.map} +0 -0
- /package/dist/{chunk-6A4AMQ2H.js.map → chunk-PE2FR4J3.js.map} +0 -0
- /package/dist/{chunk-EKTOYEZ3.js.map → chunk-PP6W64Y3.js.map} +0 -0
- /package/dist/{chunk-SGSHQ4PH.js.map → chunk-PX35GA7L.js.map} +0 -0
- /package/dist/{chunk-YJ46RFCD.js.map → chunk-QEILDE6R.js.map} +0 -0
- /package/dist/{chunk-KGFV72WK.js.map → chunk-QODLLGQ7.js.map} +0 -0
- /package/dist/{chunk-2GMRNNI3.js.map → chunk-RAZ4OVLL.js.map} +0 -0
- /package/dist/{chunk-25WFLKOH.js.map → chunk-SYMWGEET.js.map} +0 -0
- /package/dist/{chunk-LJO6Q3X6.js.map → chunk-TFBP23BX.js.map} +0 -0
- /package/dist/{chunk-TNBIWSQ7.js.map → chunk-U26HQ6KJ.js.map} +0 -0
- /package/dist/{chunk-CGJFCT3X.js.map → chunk-VTKGMEPP.js.map} +0 -0
- /package/dist/{chunk-5VMTAX4Y.js.map → chunk-W6EQLGMB.js.map} +0 -0
- /package/dist/{chunk-PS5G6A3Y.js.map → chunk-WPLVTJ5D.js.map} +0 -0
- /package/dist/{chunk-MDIC4FAU.js.map → chunk-XJFLDA7A.js.map} +0 -0
- /package/dist/{chunk-CCC25PA7.js.map → chunk-ZYWZWG6G.js.map} +0 -0
- /package/dist/{crypto-5UDZZL26.js.map → crypto-HTZ4FJOP.js.map} +0 -0
- /package/dist/{delegation-42LO4WFO.js.map → delegation-RI54P6I5.js.map} +0 -0
- /package/dist/{executor-AWCHQ2KN.js.map → executor-5PNY7LGW.js.map} +0 -0
- /package/dist/{executor-RWICJI7J.js.map → executor-B4QIYGZX.js.map} +0 -0
- /package/dist/{executor-SOLEQVUB.js.map → executor-BWXXDQ7K.js.map} +0 -0
- /package/dist/{fanout-sidecar-EVICRM46.js.map → fanout-sidecar-OKPMMPLG.js.map} +0 -0
- /package/dist/{issue-IODMTPME.js.map → issue-VGDPP4B5.js.map} +0 -0
- /package/dist/{ledger-UX4QIHWI.js.map → ledger-TMRZYNVJ.js.map} +0 -0
- /package/dist/{noydb-FY2666NY.js.map → noydb-LZBH3XDK.js.map} +0 -0
- /package/dist/{public-envelope-YKHKP74C.js.map → public-envelope-BW6OXORV.js.map} +0 -0
- /package/dist/{registry-446I2NMN.js.map → registry-3QP3YKQS.js.map} +0 -0
- /package/dist/{registry-4NEW7LQY.js.map → registry-OJIOSBV6.js.map} +0 -0
- /package/dist/{registry-524KJZG4.js.map → registry-USRVT6YF.js.map} +0 -0
- /package/dist/{revoke-R5NIQ74J.js.map → revoke-JCC7N56X.js.map} +0 -0
- /package/dist/{signer-WGDJNWSU.js.map → signer-72QAUSVW.js.map} +0 -0
- /package/dist/{stale-74WGLVZ2.js.map → stale-6ZDBTQT7.js.map} +0 -0
package/dist/bundle/index.cjs
CHANGED
|
@@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
33
|
// src/errors.ts
|
|
34
|
-
var NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, PermissionDeniedError, ExportCapabilityError, KeyringExpiredError, ImportCapabilityError, StoreCapabilityError, PrivilegeEscalationError, FieldFrozenError, InvariantError, AmendmentForbiddenError, TierNotGrantedError, ElevationExpiredError, AlreadyElevatedError, TierDemoteDeniedError, DelegationTargetMissingError, ConflictError, LedgerContentionError, BundleVersionConflictError, ValidationError, SchemaValidationError, SchemaUpdateError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, GroupCardinalityError, IndexRequiredError, IndexWriteFailureError, BundleIntegrityError, BundleSealMismatchError, ReservedCollectionNameError, TranslatorNotConfiguredError, BackupLedgerError, BackupCorruptedError, PartitionExtractionError, TransferSealError, AdoptionStateError, AttestationError, JoinTooLargeError, DanglingReferenceError, DerivationCycleError, DerivationOutputShapeError, DerivationCapExceededError, MaterializedViewCycleError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError;
|
|
34
|
+
var NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, PermissionDeniedError, ExportCapabilityError, KeyringExpiredError, ImportCapabilityError, StoreCapabilityError, PrivilegeEscalationError, FieldFrozenError, InvariantError, AmendmentForbiddenError, TierNotGrantedError, ElevationExpiredError, AlreadyElevatedError, TierDemoteDeniedError, DelegationTargetMissingError, ConflictError, LedgerContentionError, BundleVersionConflictError, ValidationError, SchemaValidationError, SchemaUpdateError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, GroupCardinalityError, IndexRequiredError, IndexWriteFailureError, BundleIntegrityError, BundleSealMismatchError, ReservedCollectionNameError, LocaleNotSpecifiedError, TranslatorNotConfiguredError, BackupLedgerError, BackupCorruptedError, PartitionExtractionError, TransferSealError, AdoptionStateError, AttestationError, JoinTooLargeError, CrossJoinTooLargeError, CrossJoinSourceUnknownError, DanglingReferenceError, DerivationCycleError, DerivationOutputShapeError, DerivationCapExceededError, MaterializedViewCycleError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError;
|
|
35
35
|
var init_errors = __esm({
|
|
36
36
|
"src/errors.ts"() {
|
|
37
37
|
"use strict";
|
|
@@ -403,6 +403,18 @@ Resolutions:
|
|
|
403
403
|
this.collectionName = collectionName;
|
|
404
404
|
}
|
|
405
405
|
};
|
|
406
|
+
LocaleNotSpecifiedError = class extends NoydbError {
|
|
407
|
+
/** The field name that required a locale. */
|
|
408
|
+
field;
|
|
409
|
+
constructor(field, message) {
|
|
410
|
+
super(
|
|
411
|
+
"LOCALE_NOT_SPECIFIED",
|
|
412
|
+
message ?? `Cannot read i18nText field "${field}" without a locale. Pass { locale } to get()/list()/query() or set a default via openVault(name, { locale }).`
|
|
413
|
+
);
|
|
414
|
+
this.name = "LocaleNotSpecifiedError";
|
|
415
|
+
this.field = field;
|
|
416
|
+
}
|
|
417
|
+
};
|
|
406
418
|
TranslatorNotConfiguredError = class extends NoydbError {
|
|
407
419
|
/** The field that requested auto-translation. */
|
|
408
420
|
field;
|
|
@@ -476,6 +488,34 @@ Resolutions:
|
|
|
476
488
|
this.side = opts.side;
|
|
477
489
|
}
|
|
478
490
|
};
|
|
491
|
+
CrossJoinTooLargeError = class extends NoydbError {
|
|
492
|
+
target;
|
|
493
|
+
expected;
|
|
494
|
+
limit;
|
|
495
|
+
constructor(opts) {
|
|
496
|
+
super(
|
|
497
|
+
"CROSS_JOIN_TOO_LARGE",
|
|
498
|
+
`crossJoin("${opts.target}"): would produce ${opts.expected} rows, exceeding the limit of ${opts.limit}. Narrow the left side with .where() first, or raise the ceiling with crossJoin("${opts.target}", { ..., maxRows: ${opts.expected} }).`
|
|
499
|
+
);
|
|
500
|
+
this.name = "CrossJoinTooLargeError";
|
|
501
|
+
this.target = opts.target;
|
|
502
|
+
this.expected = opts.expected;
|
|
503
|
+
this.limit = opts.limit;
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
CrossJoinSourceUnknownError = class extends NoydbError {
|
|
507
|
+
target;
|
|
508
|
+
leftCollection;
|
|
509
|
+
constructor(target, leftCollection) {
|
|
510
|
+
super(
|
|
511
|
+
"CROSS_JOIN_SOURCE_UNKNOWN",
|
|
512
|
+
`crossJoin("${target}"): collection "${target}" is not known in the vault (cross-joining from "${leftCollection}"). Make sure "${target}" is open in the same vault before executing this query.`
|
|
513
|
+
);
|
|
514
|
+
this.name = "CrossJoinSourceUnknownError";
|
|
515
|
+
this.target = target;
|
|
516
|
+
this.leftCollection = leftCollection;
|
|
517
|
+
}
|
|
518
|
+
};
|
|
479
519
|
DanglingReferenceError = class extends NoydbError {
|
|
480
520
|
field;
|
|
481
521
|
target;
|
|
@@ -3471,6 +3511,19 @@ var init_strategy = __esm({
|
|
|
3471
3511
|
}
|
|
3472
3512
|
});
|
|
3473
3513
|
|
|
3514
|
+
// src/i18n/policy.ts
|
|
3515
|
+
function resolvePolicy(onMissing, layer) {
|
|
3516
|
+
const explicit = onMissing && typeof onMissing === "object" ? onMissing[layer] : void 0;
|
|
3517
|
+
const scalar = typeof onMissing === "string" ? onMissing : void 0;
|
|
3518
|
+
const layerDefault = layer === "guard" ? "substitute" : void 0;
|
|
3519
|
+
return explicit ?? layerDefault ?? scalar ?? "throw";
|
|
3520
|
+
}
|
|
3521
|
+
var init_policy = __esm({
|
|
3522
|
+
"src/i18n/policy.ts"() {
|
|
3523
|
+
"use strict";
|
|
3524
|
+
}
|
|
3525
|
+
});
|
|
3526
|
+
|
|
3474
3527
|
// src/i18n/core.ts
|
|
3475
3528
|
function getAtPath(obj, path) {
|
|
3476
3529
|
const arrayIdx = path.indexOf("[].");
|
|
@@ -3530,6 +3583,9 @@ var init_strategy2 = __esm({
|
|
|
3530
3583
|
validateI18nTextValue() {
|
|
3531
3584
|
throw notEnabled("i18nText field validation");
|
|
3532
3585
|
},
|
|
3586
|
+
enforceScript(value) {
|
|
3587
|
+
return { value, warnings: [] };
|
|
3588
|
+
},
|
|
3533
3589
|
buildDictionaryHandle() {
|
|
3534
3590
|
throw notEnabled("vault.dictionary()");
|
|
3535
3591
|
}
|
|
@@ -3709,6 +3765,10 @@ function evaluateClause(record, clause) {
|
|
|
3709
3765
|
return clause.fn(record);
|
|
3710
3766
|
case "wherePredicate":
|
|
3711
3767
|
return clause.fn(record, clause.ctx);
|
|
3768
|
+
case "crossJoin":
|
|
3769
|
+
throw new Error(
|
|
3770
|
+
`evaluateClause: 'crossJoin' clauses are expansion primitives and are not evaluated per-record. This is a query planner routing error \u2014 crossJoin clauses must be extracted from the clause list before calling evaluateClause or filterRecords.`
|
|
3771
|
+
);
|
|
3712
3772
|
case "group":
|
|
3713
3773
|
if (clause.op === "and") {
|
|
3714
3774
|
for (const child of clause.clauses) {
|
|
@@ -3991,9 +4051,20 @@ var init_strategy4 = __esm({
|
|
|
3991
4051
|
});
|
|
3992
4052
|
|
|
3993
4053
|
// src/query/builder.ts
|
|
3994
|
-
function executePlanWithSource(source, plan) {
|
|
3995
|
-
const
|
|
3996
|
-
let result
|
|
4054
|
+
function executePlanWithSource(source, plan, joinContext) {
|
|
4055
|
+
const hasCrossJoins = plan.clauses.some((c) => c.type === "crossJoin");
|
|
4056
|
+
let result;
|
|
4057
|
+
if (hasCrossJoins) {
|
|
4058
|
+
if (!joinContext) {
|
|
4059
|
+
throw new Error(
|
|
4060
|
+
`Query.toArray(): plan contains crossJoin clauses but no JoinContext is attached. Use collection.query() instead of new Query() for cross-join support.`
|
|
4061
|
+
);
|
|
4062
|
+
}
|
|
4063
|
+
result = executeClausePipeline(source, plan.clauses, joinContext);
|
|
4064
|
+
} else {
|
|
4065
|
+
const { candidates, remainingClauses } = candidateRecords(source, plan.clauses);
|
|
4066
|
+
result = remainingClauses.length === 0 ? [...candidates] : filterRecords(candidates, remainingClauses);
|
|
4067
|
+
}
|
|
3997
4068
|
if (plan.orderBy.length > 0) {
|
|
3998
4069
|
result = sortRecords(result, plan.orderBy);
|
|
3999
4070
|
}
|
|
@@ -4057,6 +4128,74 @@ function filterRecords(records, clauses) {
|
|
|
4057
4128
|
}
|
|
4058
4129
|
return out;
|
|
4059
4130
|
}
|
|
4131
|
+
function executeClausePipeline(source, clauses, joinContext) {
|
|
4132
|
+
let rel = [...source.snapshot()];
|
|
4133
|
+
let filterBatch = [];
|
|
4134
|
+
for (const clause of clauses) {
|
|
4135
|
+
if (clause.type === "crossJoin") {
|
|
4136
|
+
if (filterBatch.length > 0) {
|
|
4137
|
+
rel = filterRecords(rel, filterBatch);
|
|
4138
|
+
filterBatch = [];
|
|
4139
|
+
}
|
|
4140
|
+
const rightSource = joinContext.resolveSource(clause.target);
|
|
4141
|
+
if (!rightSource) {
|
|
4142
|
+
throw new CrossJoinSourceUnknownError(clause.target, joinContext.leftCollection);
|
|
4143
|
+
}
|
|
4144
|
+
rel = applyCrossJoin(rel, clause, rightSource);
|
|
4145
|
+
} else {
|
|
4146
|
+
filterBatch.push(clause);
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
if (filterBatch.length > 0) {
|
|
4150
|
+
rel = filterRecords(rel, filterBatch);
|
|
4151
|
+
}
|
|
4152
|
+
return rel;
|
|
4153
|
+
}
|
|
4154
|
+
function applyCrossJoin(leftRel, clause, rightSource) {
|
|
4155
|
+
const rightRows = rightSource.snapshot();
|
|
4156
|
+
const maxRows = clause.maxRows ?? DEFAULT_CROSS_JOIN_MAX_ROWS;
|
|
4157
|
+
const { as } = clause;
|
|
4158
|
+
if (!clause.on) {
|
|
4159
|
+
const product = leftRel.length * rightRows.length;
|
|
4160
|
+
if (product > maxRows) {
|
|
4161
|
+
throw new CrossJoinTooLargeError({ target: clause.target, expected: product, limit: maxRows });
|
|
4162
|
+
}
|
|
4163
|
+
const expanded2 = [];
|
|
4164
|
+
for (const left of leftRel) {
|
|
4165
|
+
const leftObj = left;
|
|
4166
|
+
for (const right of rightRows) {
|
|
4167
|
+
expanded2.push({ ...leftObj, [as]: right });
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
return expanded2;
|
|
4171
|
+
}
|
|
4172
|
+
const expanded = [];
|
|
4173
|
+
let cumulative = 0;
|
|
4174
|
+
for (const left of leftRel) {
|
|
4175
|
+
const callbackResult = clause.on(left);
|
|
4176
|
+
let filteredRight;
|
|
4177
|
+
if (Array.isArray(callbackResult)) {
|
|
4178
|
+
filteredRight = callbackResult;
|
|
4179
|
+
} else {
|
|
4180
|
+
filteredRight = rightRows.filter(
|
|
4181
|
+
callbackResult
|
|
4182
|
+
);
|
|
4183
|
+
}
|
|
4184
|
+
cumulative += filteredRight.length;
|
|
4185
|
+
if (cumulative > maxRows) {
|
|
4186
|
+
throw new CrossJoinTooLargeError({
|
|
4187
|
+
target: clause.target,
|
|
4188
|
+
expected: cumulative,
|
|
4189
|
+
limit: maxRows
|
|
4190
|
+
});
|
|
4191
|
+
}
|
|
4192
|
+
const leftObj = left;
|
|
4193
|
+
for (const right of filteredRight) {
|
|
4194
|
+
expanded.push({ ...leftObj, [as]: right });
|
|
4195
|
+
}
|
|
4196
|
+
}
|
|
4197
|
+
return expanded;
|
|
4198
|
+
}
|
|
4060
4199
|
function sortRecords(records, orderBy) {
|
|
4061
4200
|
return [...records].sort((a, b) => {
|
|
4062
4201
|
for (const { field, direction } of orderBy) {
|
|
@@ -4119,6 +4258,16 @@ function serializeClause(clause) {
|
|
|
4119
4258
|
clauses: clause.clauses.map(serializeClause)
|
|
4120
4259
|
};
|
|
4121
4260
|
}
|
|
4261
|
+
if (clause.type === "crossJoin") {
|
|
4262
|
+
return {
|
|
4263
|
+
type: "crossJoin",
|
|
4264
|
+
target: clause.target,
|
|
4265
|
+
as: clause.as,
|
|
4266
|
+
on: clause.on ? "[function]" : void 0,
|
|
4267
|
+
onPredicateName: clause.onPredicateName,
|
|
4268
|
+
maxRows: clause.maxRows
|
|
4269
|
+
};
|
|
4270
|
+
}
|
|
4122
4271
|
return clause;
|
|
4123
4272
|
}
|
|
4124
4273
|
function canonicalCtxHash(ctx) {
|
|
@@ -4168,12 +4317,13 @@ function buildDictLabelResolver(joinCtx, field) {
|
|
|
4168
4317
|
return void 0;
|
|
4169
4318
|
};
|
|
4170
4319
|
}
|
|
4171
|
-
var EMPTY_PLAN, Query;
|
|
4320
|
+
var EMPTY_PLAN, DEFAULT_CROSS_JOIN_MAX_ROWS, Query;
|
|
4172
4321
|
var init_builder = __esm({
|
|
4173
4322
|
"src/query/builder.ts"() {
|
|
4174
4323
|
"use strict";
|
|
4175
4324
|
init_predicate();
|
|
4176
4325
|
init_join();
|
|
4326
|
+
init_errors();
|
|
4177
4327
|
init_live();
|
|
4178
4328
|
init_strategy4();
|
|
4179
4329
|
EMPTY_PLAN = {
|
|
@@ -4183,6 +4333,7 @@ var init_builder = __esm({
|
|
|
4183
4333
|
offset: 0,
|
|
4184
4334
|
joins: []
|
|
4185
4335
|
};
|
|
4336
|
+
DEFAULT_CROSS_JOIN_MAX_ROWS = 5e4;
|
|
4186
4337
|
Query = class _Query {
|
|
4187
4338
|
source;
|
|
4188
4339
|
plan;
|
|
@@ -4464,6 +4615,78 @@ var init_builder = __esm({
|
|
|
4464
4615
|
this.predicates
|
|
4465
4616
|
);
|
|
4466
4617
|
}
|
|
4618
|
+
/**
|
|
4619
|
+
* Cartesian-product cross-join against `target` collection. Each result row
|
|
4620
|
+
* carries the original `T` fields plus `result[as]` populated from every
|
|
4621
|
+
* right-side row (or the filtered subset when `on:` is supplied).
|
|
4622
|
+
*
|
|
4623
|
+
* **Order matters:** `.where().crossJoin()` filters BEFORE expanding (cheaper);
|
|
4624
|
+
* `.crossJoin().where('alias.field', ...)` filters AFTER (required when the
|
|
4625
|
+
* where clause references the aliased fields).
|
|
4626
|
+
*
|
|
4627
|
+
* **Cost ceiling:** `CrossJoinTooLargeError` fires before allocation when
|
|
4628
|
+
* `leftRows × rightRows` (or the cumulative lateral count) exceeds the limit.
|
|
4629
|
+
* Default: 50,000 rows. Override per-clause with `{ maxRows: N }`.
|
|
4630
|
+
*
|
|
4631
|
+
* **`on:` shapes:**
|
|
4632
|
+
* - `on: (left) => TTarget[]` — subset form (most efficient)
|
|
4633
|
+
* - `on: (left) => (right) => boolean` — predicate form
|
|
4634
|
+
* - `on: { predicate: 'name' }` — MV-safe, hash-tracked form
|
|
4635
|
+
* (requires the Query to have been augmented via `_withPredicates`)
|
|
4636
|
+
*
|
|
4637
|
+
* Requires a JoinContext (constructed via `collection.query()`).
|
|
4638
|
+
*/
|
|
4639
|
+
crossJoin(target, opts) {
|
|
4640
|
+
if (!this.joinContext) {
|
|
4641
|
+
throw new Error(
|
|
4642
|
+
`Query.crossJoin("${target}"): requires a join context. Use collection.query() to construct a cross-join-capable Query instead of the Query constructor directly.`
|
|
4643
|
+
);
|
|
4644
|
+
}
|
|
4645
|
+
let onFn;
|
|
4646
|
+
let onPredicateName;
|
|
4647
|
+
if (opts.on !== void 0) {
|
|
4648
|
+
if (typeof opts.on === "function") {
|
|
4649
|
+
onFn = opts.on;
|
|
4650
|
+
if (this.predicates) {
|
|
4651
|
+
console.warn(
|
|
4652
|
+
`Query.crossJoin("${target}", { on: callback }): inline on: callback inside a withMaterializedView query() disables queryHash drift detection for this cross-join. Use on: { predicate: '<name>' } to enable it.`
|
|
4653
|
+
);
|
|
4654
|
+
}
|
|
4655
|
+
} else {
|
|
4656
|
+
const predName = opts.on.predicate;
|
|
4657
|
+
if (!this.predicates) {
|
|
4658
|
+
throw new Error(
|
|
4659
|
+
`Query.crossJoin("${target}", { on: { predicate: "${predName}" } }): the { predicate } form requires a predicates map. Use this form inside a withMaterializedView query() callback that declares predicates: { ${predName}: { hash, fn } }.`
|
|
4660
|
+
);
|
|
4661
|
+
}
|
|
4662
|
+
const decl = this.predicates.get(predName);
|
|
4663
|
+
if (!decl) {
|
|
4664
|
+
throw new Error(
|
|
4665
|
+
`Query.crossJoin("${target}"): predicate "${predName}" not registered. Available: ${[...this.predicates.keys()].join(", ") || "(none)"}.`
|
|
4666
|
+
);
|
|
4667
|
+
}
|
|
4668
|
+
const as = opts.as;
|
|
4669
|
+
const predicateFn = decl.fn;
|
|
4670
|
+
onFn = (_left) => (right) => predicateFn({ ..._left, [as]: right });
|
|
4671
|
+
onPredicateName = predName;
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
const clause = {
|
|
4675
|
+
type: "crossJoin",
|
|
4676
|
+
target,
|
|
4677
|
+
as: opts.as,
|
|
4678
|
+
...onFn !== void 0 && { on: onFn },
|
|
4679
|
+
...onPredicateName !== void 0 && { onPredicateName },
|
|
4680
|
+
...opts.maxRows !== void 0 && { maxRows: opts.maxRows }
|
|
4681
|
+
};
|
|
4682
|
+
return new _Query(
|
|
4683
|
+
this.source,
|
|
4684
|
+
{ ...this.plan, clauses: [...this.plan.clauses, clause] },
|
|
4685
|
+
this.joinContext,
|
|
4686
|
+
this.aggregateStrategy,
|
|
4687
|
+
this.predicates
|
|
4688
|
+
);
|
|
4689
|
+
}
|
|
4467
4690
|
/**
|
|
4468
4691
|
* Execute the plan and return the matching records. When the plan
|
|
4469
4692
|
* carries any join legs, they are applied after `where` / `orderBy`
|
|
@@ -4471,7 +4694,7 @@ var init_builder = __esm({
|
|
|
4471
4694
|
* for the ordering rationale.
|
|
4472
4695
|
*/
|
|
4473
4696
|
toArray() {
|
|
4474
|
-
const base = executePlanWithSource(this.source, this.plan);
|
|
4697
|
+
const base = executePlanWithSource(this.source, this.plan, this.joinContext);
|
|
4475
4698
|
if (this.plan.joins.length === 0) return base;
|
|
4476
4699
|
if (!this.joinContext) {
|
|
4477
4700
|
throw new Error(
|
|
@@ -4495,6 +4718,14 @@ var init_builder = __esm({
|
|
|
4495
4718
|
* intent is purely to count.
|
|
4496
4719
|
*/
|
|
4497
4720
|
count() {
|
|
4721
|
+
if (this.plan.clauses.some((c) => c.type === "crossJoin")) {
|
|
4722
|
+
if (!this.joinContext) {
|
|
4723
|
+
throw new Error(
|
|
4724
|
+
`Query.count(): plan contains crossJoin clauses but no JoinContext is attached.`
|
|
4725
|
+
);
|
|
4726
|
+
}
|
|
4727
|
+
return executeClausePipeline(this.source, this.plan.clauses, this.joinContext).length;
|
|
4728
|
+
}
|
|
4498
4729
|
const { candidates, remainingClauses } = candidateRecords(this.source, this.plan.clauses);
|
|
4499
4730
|
if (remainingClauses.length === 0) return candidates.length;
|
|
4500
4731
|
return filterRecords(candidates, remainingClauses).length;
|
|
@@ -4542,7 +4773,13 @@ var init_builder = __esm({
|
|
|
4542
4773
|
aggregate(spec) {
|
|
4543
4774
|
const source = this.source;
|
|
4544
4775
|
const clauses = this.plan.clauses;
|
|
4776
|
+
const joinCtx = this.joinContext;
|
|
4777
|
+
const hasCrossJoins = clauses.some((c) => c.type === "crossJoin");
|
|
4545
4778
|
const executeRecords = () => {
|
|
4779
|
+
if (hasCrossJoins) {
|
|
4780
|
+
if (!joinCtx) throw new Error("Query.aggregate(): crossJoin requires a join context");
|
|
4781
|
+
return executeClausePipeline(source, clauses, joinCtx);
|
|
4782
|
+
}
|
|
4546
4783
|
const { candidates, remainingClauses } = candidateRecords(source, clauses);
|
|
4547
4784
|
return remainingClauses.length === 0 ? candidates : filterRecords(candidates, remainingClauses);
|
|
4548
4785
|
};
|
|
@@ -4559,7 +4796,13 @@ var init_builder = __esm({
|
|
|
4559
4796
|
}
|
|
4560
4797
|
const source = this.source;
|
|
4561
4798
|
const clauses = this.plan.clauses;
|
|
4799
|
+
const joinCtx = this.joinContext;
|
|
4800
|
+
const hasCrossJoins = clauses.some((c) => c.type === "crossJoin");
|
|
4562
4801
|
const executeRecords = () => {
|
|
4802
|
+
if (hasCrossJoins) {
|
|
4803
|
+
if (!joinCtx) throw new Error("Query.groupBy(): crossJoin requires a join context");
|
|
4804
|
+
return executeClausePipeline(source, clauses, joinCtx);
|
|
4805
|
+
}
|
|
4563
4806
|
const { candidates, remainingClauses } = candidateRecords(source, clauses);
|
|
4564
4807
|
return remainingClauses.length === 0 ? candidates : filterRecords(candidates, remainingClauses);
|
|
4565
4808
|
};
|
|
@@ -4673,6 +4916,21 @@ var init_builder = __esm({
|
|
|
4673
4916
|
}
|
|
4674
4917
|
}
|
|
4675
4918
|
}
|
|
4919
|
+
if (this.joinContext) {
|
|
4920
|
+
const subscribedCross = /* @__PURE__ */ new Set();
|
|
4921
|
+
for (const clause of this.plan.clauses) {
|
|
4922
|
+
if (clause.type !== "crossJoin") continue;
|
|
4923
|
+
if (subscribedCross.has(clause.target)) continue;
|
|
4924
|
+
subscribedCross.add(clause.target);
|
|
4925
|
+
const rightSource = this.joinContext.resolveSource(clause.target);
|
|
4926
|
+
if (rightSource?.subscribe) {
|
|
4927
|
+
const rightSubscribe = rightSource.subscribe.bind(rightSource);
|
|
4928
|
+
upstreams.push({
|
|
4929
|
+
subscribe: (cb) => rightSubscribe(cb)
|
|
4930
|
+
});
|
|
4931
|
+
}
|
|
4932
|
+
}
|
|
4933
|
+
}
|
|
4676
4934
|
return buildLiveQuery(() => this.toArray(), upstreams);
|
|
4677
4935
|
}
|
|
4678
4936
|
/**
|
|
@@ -5560,7 +5818,7 @@ function estimateRecordBytes(record) {
|
|
|
5560
5818
|
}
|
|
5561
5819
|
}
|
|
5562
5820
|
var UNITS;
|
|
5563
|
-
var
|
|
5821
|
+
var init_policy2 = __esm({
|
|
5564
5822
|
"src/cache/policy.ts"() {
|
|
5565
5823
|
"use strict";
|
|
5566
5824
|
UNITS = {
|
|
@@ -5579,7 +5837,7 @@ var init_cache = __esm({
|
|
|
5579
5837
|
"src/cache/index.ts"() {
|
|
5580
5838
|
"use strict";
|
|
5581
5839
|
init_lru();
|
|
5582
|
-
|
|
5840
|
+
init_policy2();
|
|
5583
5841
|
}
|
|
5584
5842
|
});
|
|
5585
5843
|
|
|
@@ -5992,6 +6250,11 @@ function analyzeDependencies(query) {
|
|
|
5992
6250
|
for (const leg of plan.joins) {
|
|
5993
6251
|
deps.add(leg.target);
|
|
5994
6252
|
}
|
|
6253
|
+
for (const clause of plan.clauses) {
|
|
6254
|
+
if (clause.type === "crossJoin") {
|
|
6255
|
+
deps.add(clause.target);
|
|
6256
|
+
}
|
|
6257
|
+
}
|
|
5995
6258
|
walkClausesForJoins(plan, deps, ctx);
|
|
5996
6259
|
return deps;
|
|
5997
6260
|
}
|
|
@@ -6007,7 +6270,19 @@ function summarizeQueryPlan(query) {
|
|
|
6007
6270
|
const ctx = query._joinContext();
|
|
6008
6271
|
return JSON.stringify({
|
|
6009
6272
|
root: ctx?.leftCollection ?? null,
|
|
6010
|
-
clauses: plan.clauses
|
|
6273
|
+
clauses: plan.clauses.map((c) => {
|
|
6274
|
+
if (c.type === "crossJoin") {
|
|
6275
|
+
return {
|
|
6276
|
+
type: "crossJoin",
|
|
6277
|
+
target: c.target,
|
|
6278
|
+
as: c.as,
|
|
6279
|
+
// Inline on: callback: use sentinel — drift detection disabled for this MV
|
|
6280
|
+
onPredicateName: c.onPredicateName ?? (c.on ? "[inline]" : null),
|
|
6281
|
+
maxRows: c.maxRows ?? null
|
|
6282
|
+
};
|
|
6283
|
+
}
|
|
6284
|
+
return c;
|
|
6285
|
+
}),
|
|
6011
6286
|
orderBy: plan.orderBy,
|
|
6012
6287
|
limit: plan.limit ?? null,
|
|
6013
6288
|
offset: plan.offset,
|
|
@@ -6586,6 +6861,7 @@ var init_collection = __esm({
|
|
|
6586
6861
|
init_strategy();
|
|
6587
6862
|
init_core();
|
|
6588
6863
|
init_strategy2();
|
|
6864
|
+
init_policy();
|
|
6589
6865
|
init_crypto();
|
|
6590
6866
|
init_errors();
|
|
6591
6867
|
init_tiers();
|
|
@@ -7225,6 +7501,22 @@ var init_collection = __esm({
|
|
|
7225
7501
|
setAtPathInPlace(obj, field, translated);
|
|
7226
7502
|
}
|
|
7227
7503
|
}
|
|
7504
|
+
if (this.i18nFields) {
|
|
7505
|
+
const obj = record;
|
|
7506
|
+
for (const [field, descriptor] of Object.entries(this.i18nFields)) {
|
|
7507
|
+
if (!descriptor.options.script) continue;
|
|
7508
|
+
for (const leaf of getAtPath(obj, field)) {
|
|
7509
|
+
if (!leaf || typeof leaf !== "object" || Array.isArray(leaf)) continue;
|
|
7510
|
+
const leafMap = leaf;
|
|
7511
|
+
const { value: cleaned } = this.i18nStrategy.enforceScript(
|
|
7512
|
+
leafMap,
|
|
7513
|
+
field,
|
|
7514
|
+
descriptor
|
|
7515
|
+
);
|
|
7516
|
+
if (cleaned !== leafMap) Object.assign(leafMap, cleaned);
|
|
7517
|
+
}
|
|
7518
|
+
}
|
|
7519
|
+
}
|
|
7228
7520
|
if (this.i18nPutValidator !== void 0) {
|
|
7229
7521
|
this.i18nPutValidator(record);
|
|
7230
7522
|
}
|
|
@@ -8667,17 +8959,52 @@ var init_collection = __esm({
|
|
|
8667
8959
|
}
|
|
8668
8960
|
if (hasDict && this.dictKeyFields && this.dictLabelResolver && locale !== "raw") {
|
|
8669
8961
|
const withLabels = { ...result };
|
|
8962
|
+
const resolver = this.dictLabelResolver;
|
|
8670
8963
|
for (const [field, desc] of Object.entries(this.dictKeyFields)) {
|
|
8671
|
-
const
|
|
8672
|
-
|
|
8673
|
-
const
|
|
8674
|
-
desc.name,
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8964
|
+
const policy = desc.onMissing ? resolvePolicy(desc.onMissing, "read") : "null";
|
|
8965
|
+
const fallback = policy === "substitute" ? localeOpts?.fallback ?? desc.substitute : localeOpts?.fallback;
|
|
8966
|
+
const resolveKey = async (key) => {
|
|
8967
|
+
const label = await resolver(desc.name, key, locale, fallback);
|
|
8968
|
+
if (label === void 0) {
|
|
8969
|
+
if (policy === "throw") {
|
|
8970
|
+
throw new LocaleNotSpecifiedError(
|
|
8971
|
+
field,
|
|
8972
|
+
`dictKey "${field}": no label for key "${key}" in locale "${locale}".`
|
|
8973
|
+
);
|
|
8974
|
+
}
|
|
8975
|
+
return null;
|
|
8976
|
+
}
|
|
8977
|
+
return label;
|
|
8978
|
+
};
|
|
8979
|
+
if (field.includes("[].")) {
|
|
8980
|
+
const parts = field.split("[].");
|
|
8981
|
+
const arrayKey = parts[0];
|
|
8982
|
+
const leaf = parts[1];
|
|
8983
|
+
if (!leaf || leaf.includes(".")) continue;
|
|
8984
|
+
const arr = withLabels[arrayKey];
|
|
8985
|
+
if (!Array.isArray(arr)) continue;
|
|
8986
|
+
const labelKey = `${leaf}Label`;
|
|
8987
|
+
withLabels[arrayKey] = await Promise.all(
|
|
8988
|
+
arr.map(async (el) => {
|
|
8989
|
+
if (!el || typeof el !== "object" || Array.isArray(el)) return el;
|
|
8990
|
+
const k = el[leaf];
|
|
8991
|
+
if (typeof k !== "string") return el;
|
|
8992
|
+
return { ...el, [labelKey]: await resolveKey(k) };
|
|
8993
|
+
})
|
|
8994
|
+
);
|
|
8995
|
+
continue;
|
|
8996
|
+
}
|
|
8997
|
+
const val = result[field];
|
|
8998
|
+
if (Array.isArray(val)) {
|
|
8999
|
+
withLabels[`${field}Label`] = await Promise.all(
|
|
9000
|
+
val.map(async (k) => ({
|
|
9001
|
+
key: k,
|
|
9002
|
+
label: typeof k === "string" ? await resolveKey(k) : null
|
|
9003
|
+
}))
|
|
9004
|
+
);
|
|
9005
|
+
} else if (typeof val === "string") {
|
|
9006
|
+
const label = await resolveKey(val);
|
|
9007
|
+
if (label !== null) withLabels[`${field}Label`] = label;
|
|
8681
9008
|
}
|
|
8682
9009
|
}
|
|
8683
9010
|
result = withLabels;
|
|
@@ -14832,20 +15159,42 @@ var init_unlock_state = __esm({
|
|
|
14832
15159
|
}
|
|
14833
15160
|
});
|
|
14834
15161
|
|
|
14835
|
-
// src/
|
|
14836
|
-
var NOT_ENABLED5,
|
|
15162
|
+
// src/snapshots/strategy.ts
|
|
15163
|
+
var NOT_ENABLED5, NO_SNAPSHOTS;
|
|
14837
15164
|
var init_strategy10 = __esm({
|
|
14838
|
-
"src/
|
|
15165
|
+
"src/snapshots/strategy.ts"() {
|
|
14839
15166
|
"use strict";
|
|
14840
15167
|
NOT_ENABLED5 = new Error(
|
|
15168
|
+
'Snapshots require the snapshot strategy. Import `{ withSnapshots }` from "@noy-db/hub/snapshots" and pass it to `createNoydb({ snapshotStrategy: withSnapshots({ store }) })`.'
|
|
15169
|
+
);
|
|
15170
|
+
NO_SNAPSHOTS = {
|
|
15171
|
+
async snapshot() {
|
|
15172
|
+
throw NOT_ENABLED5;
|
|
15173
|
+
},
|
|
15174
|
+
async listSnapshots() {
|
|
15175
|
+
throw NOT_ENABLED5;
|
|
15176
|
+
},
|
|
15177
|
+
async restoreSnapshot() {
|
|
15178
|
+
throw NOT_ENABLED5;
|
|
15179
|
+
}
|
|
15180
|
+
};
|
|
15181
|
+
}
|
|
15182
|
+
});
|
|
15183
|
+
|
|
15184
|
+
// src/tx/strategy.ts
|
|
15185
|
+
var NOT_ENABLED6, NO_TX;
|
|
15186
|
+
var init_strategy11 = __esm({
|
|
15187
|
+
"src/tx/strategy.ts"() {
|
|
15188
|
+
"use strict";
|
|
15189
|
+
NOT_ENABLED6 = new Error(
|
|
14841
15190
|
'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/tx" and pass it to `createNoydb({ txStrategy: withTransactions() })`.'
|
|
14842
15191
|
);
|
|
14843
15192
|
NO_TX = {
|
|
14844
15193
|
async runTransaction() {
|
|
14845
|
-
throw
|
|
15194
|
+
throw NOT_ENABLED6;
|
|
14846
15195
|
},
|
|
14847
15196
|
async runDryRun() {
|
|
14848
|
-
throw
|
|
15197
|
+
throw NOT_ENABLED6;
|
|
14849
15198
|
}
|
|
14850
15199
|
};
|
|
14851
15200
|
}
|
|
@@ -14870,7 +15219,7 @@ function notEnabled4(op) {
|
|
|
14870
15219
|
);
|
|
14871
15220
|
}
|
|
14872
15221
|
var NO_SESSION;
|
|
14873
|
-
var
|
|
15222
|
+
var init_strategy12 = __esm({
|
|
14874
15223
|
"src/session/strategy.ts"() {
|
|
14875
15224
|
"use strict";
|
|
14876
15225
|
NO_SESSION = {
|
|
@@ -15143,7 +15492,7 @@ var init_engine = __esm({
|
|
|
15143
15492
|
});
|
|
15144
15493
|
|
|
15145
15494
|
// src/policy/index.ts
|
|
15146
|
-
var
|
|
15495
|
+
var init_policy3 = __esm({
|
|
15147
15496
|
"src/policy/index.ts"() {
|
|
15148
15497
|
"use strict";
|
|
15149
15498
|
init_presets();
|
|
@@ -15306,11 +15655,12 @@ var init_noydb = __esm({
|
|
|
15306
15655
|
init_authenticators();
|
|
15307
15656
|
init_unlock_state();
|
|
15308
15657
|
init_sync_strategy();
|
|
15309
|
-
init_transaction();
|
|
15310
15658
|
init_strategy10();
|
|
15311
|
-
|
|
15659
|
+
init_transaction();
|
|
15312
15660
|
init_strategy11();
|
|
15313
|
-
|
|
15661
|
+
init_sync_policy();
|
|
15662
|
+
init_strategy12();
|
|
15663
|
+
init_policy3();
|
|
15314
15664
|
ROLE_RANK = {
|
|
15315
15665
|
client: 1,
|
|
15316
15666
|
viewer: 2,
|
|
@@ -15366,6 +15716,7 @@ var init_noydb = __esm({
|
|
|
15366
15716
|
txStrategy;
|
|
15367
15717
|
sessionStrategy;
|
|
15368
15718
|
syncStrategy;
|
|
15719
|
+
snapshotStrategy;
|
|
15369
15720
|
/**
|
|
15370
15721
|
* Currently-running multi-record transaction, set by
|
|
15371
15722
|
* `runTransaction` at the start of Phase 2 (commit) and cleared in
|
|
@@ -15390,6 +15741,7 @@ var init_noydb = __esm({
|
|
|
15390
15741
|
this.txStrategy = options.txStrategy ?? NO_TX;
|
|
15391
15742
|
this.sessionStrategy = options.sessionStrategy ?? NO_SESSION;
|
|
15392
15743
|
this.syncStrategy = options.syncStrategy ?? NO_SYNC;
|
|
15744
|
+
this.snapshotStrategy = options.snapshotStrategy ?? NO_SNAPSHOTS;
|
|
15393
15745
|
this.publicEnvelopeSchema = resolveSchema(options.publicEnvelope);
|
|
15394
15746
|
if (options.sessionPolicy) {
|
|
15395
15747
|
this.sessionStrategy.validateSessionPolicy(options.sessionPolicy);
|
|
@@ -17376,6 +17728,45 @@ var init_noydb = __esm({
|
|
|
17376
17728
|
this.keyringCache.set(vault, keyring);
|
|
17377
17729
|
return keyring;
|
|
17378
17730
|
}
|
|
17731
|
+
/**
|
|
17732
|
+
* Take an on-demand checkpoint of the given vault.
|
|
17733
|
+
* Requires `snapshotStrategy: withSnapshots({ store })` in `createNoydb`.
|
|
17734
|
+
* @throws ValidationError when the vault is not open
|
|
17735
|
+
*/
|
|
17736
|
+
async snapshot(vault, opts) {
|
|
17737
|
+
if (this.closed) throw new ValidationError("Instance is closed");
|
|
17738
|
+
const v = this.vaultCache.get(vault);
|
|
17739
|
+
if (!v) {
|
|
17740
|
+
throw new ValidationError(
|
|
17741
|
+
`Vault "${vault}" is not open. Call openVault() first.`
|
|
17742
|
+
);
|
|
17743
|
+
}
|
|
17744
|
+
return this.snapshotStrategy.snapshot(v, this.options.user, opts);
|
|
17745
|
+
}
|
|
17746
|
+
/**
|
|
17747
|
+
* List all snapshots for the given vault, newest first.
|
|
17748
|
+
* Reads only the sidecar index — does not download snapshot bytes.
|
|
17749
|
+
*/
|
|
17750
|
+
async listSnapshots(vault) {
|
|
17751
|
+
if (this.closed) throw new ValidationError("Instance is closed");
|
|
17752
|
+
return this.snapshotStrategy.listSnapshots(vault);
|
|
17753
|
+
}
|
|
17754
|
+
/**
|
|
17755
|
+
* Restore the vault to a previously snapshotted state.
|
|
17756
|
+
* Runs `verifyBackupIntegrity()` automatically on restore.
|
|
17757
|
+
* @throws SnapshotNotFoundError when `version` doesn't exist in the store
|
|
17758
|
+
* @throws ValidationError when the vault is not open
|
|
17759
|
+
*/
|
|
17760
|
+
async restoreSnapshot(vault, version) {
|
|
17761
|
+
if (this.closed) throw new ValidationError("Instance is closed");
|
|
17762
|
+
const v = this.vaultCache.get(vault);
|
|
17763
|
+
if (!v) {
|
|
17764
|
+
throw new ValidationError(
|
|
17765
|
+
`Vault "${vault}" is not open. Call openVault() first.`
|
|
17766
|
+
);
|
|
17767
|
+
}
|
|
17768
|
+
return this.snapshotStrategy.restoreSnapshot(v, version);
|
|
17769
|
+
}
|
|
17379
17770
|
};
|
|
17380
17771
|
}
|
|
17381
17772
|
});
|