@noy-db/hub 0.2.0-pre.7 → 0.2.0-pre.9
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 +2 -2
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +2 -2
- package/dist/attestation/index.d.ts +2 -2
- package/dist/attestation/index.js +5 -5
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +3 -3
- package/dist/blobs/index.d.ts +3 -3
- package/dist/blobs/index.js +4 -4
- package/dist/bundle/index.cjs +255 -15
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +4 -4
- package/dist/bundle/index.d.ts +4 -4
- package/dist/bundle/index.js +8 -8
- package/dist/{chunk-AYRTGXF3.js → chunk-22DWZL57.js} +62 -26
- package/dist/chunk-22DWZL57.js.map +1 -0
- package/dist/{chunk-4EOVWJL6.js → chunk-2GLDA55J.js} +2 -2
- package/dist/{chunk-CBHPW77B.js → chunk-2WUSG3IT.js} +2 -2
- package/dist/{chunk-WBUG3324.js → chunk-3BFJOWSU.js} +2 -2
- package/dist/{chunk-7IH5FDXD.js → chunk-3YPCK6JX.js} +5 -5
- package/dist/{chunk-SYOSRZN4.js → chunk-53XBRIRT.js} +4 -4
- package/dist/{chunk-UPBZ7NVY.js → chunk-5T22KDPN.js} +4 -4
- package/dist/{chunk-KK44CQ5B.js → chunk-5XHKQ56N.js} +2 -2
- package/dist/{chunk-3O5FNO5O.js → chunk-6CME4UEK.js} +259 -50
- package/dist/chunk-6CME4UEK.js.map +1 -0
- package/dist/chunk-6STK5TQP.js +139 -0
- package/dist/chunk-6STK5TQP.js.map +1 -0
- package/dist/{chunk-REQJJIPP.js → chunk-B6PB7JLN.js} +23 -1
- package/dist/{chunk-REQJJIPP.js.map → chunk-B6PB7JLN.js.map} +1 -1
- package/dist/{chunk-2TXMTYWZ.js → chunk-BVRYKATC.js} +3 -3
- package/dist/{chunk-6ILPGZXZ.js → chunk-DE6GKS6G.js} +2 -2
- package/dist/{chunk-TS4FQPDD.js → chunk-DFMLEQZB.js} +2 -2
- package/dist/{chunk-3XCXUJTM.js → chunk-DJHHA6XH.js} +2 -2
- package/dist/{chunk-LSY46G55.js → chunk-DL3HWOQ5.js} +3 -3
- package/dist/{chunk-6MXGU2PW.js → chunk-DO7C2TOG.js} +2 -2
- package/dist/{chunk-N4CDTRDH.js → chunk-DONMZAD2.js} +3 -3
- package/dist/{chunk-HNC55FLJ.js → chunk-F3GDRNUT.js} +3 -3
- package/dist/{chunk-VZOZ3DBN.js → chunk-H2X3ISXG.js} +3 -3
- package/dist/{chunk-XZCBBZLS.js → chunk-HNRHLRDC.js} +2 -2
- package/dist/{chunk-22ESLVUM.js → chunk-I5FOWO4J.js} +2 -2
- package/dist/{chunk-O3JCRQT3.js → chunk-JWRVQKRZ.js} +3 -3
- package/dist/{chunk-CSHY53CZ.js → chunk-K3DK3NU5.js} +2 -2
- package/dist/{chunk-BNUCCUES.js → chunk-ML236QKC.js} +2 -2
- package/dist/{chunk-GZIDTXC4.js → chunk-NONAAENK.js} +2 -2
- package/dist/{chunk-JZDA2SRB.js → chunk-O3VZPBZG.js} +4 -4
- package/dist/{chunk-PJKGXUMG.js → chunk-OQ6PIGHA.js} +2 -2
- package/dist/{chunk-QYO6I7KK.js → chunk-PE2FR4J3.js} +3 -3
- package/dist/{chunk-YAMTXW77.js → chunk-PP6W64Y3.js} +2 -2
- package/dist/{chunk-HNFXKQD7.js → chunk-PX35GA7L.js} +4 -4
- package/dist/{chunk-OXCFFRF3.js → chunk-QEILDE6R.js} +2 -2
- package/dist/{chunk-4YVVF6JN.js → chunk-QODLLGQ7.js} +4 -4
- package/dist/{chunk-ASFE2X62.js → chunk-RAZ4OVLL.js} +2 -2
- package/dist/{chunk-WM5GFORS.js → chunk-SYMWGEET.js} +2 -2
- package/dist/{chunk-SLJQIBT7.js → chunk-T7JEBOGN.js} +2 -2
- package/dist/{chunk-OA6HE2RW.js → chunk-TFBP23BX.js} +3 -3
- package/dist/{chunk-GI6S5ZF2.js → chunk-U26HQ6KJ.js} +2 -2
- package/dist/{chunk-WMKCAN4H.js → chunk-VTKGMEPP.js} +2 -2
- package/dist/{chunk-BRZFN354.js → chunk-WPLVTJ5D.js} +3 -3
- package/dist/{chunk-DCP4L4SH.js → chunk-XJFLDA7A.js} +2 -2
- package/dist/{chunk-BE5ZALMB.js → chunk-ZYWZWG6G.js} +4 -4
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +3 -3
- package/dist/consent/index.d.ts +3 -3
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-TRZ5BJMY.js → crypto-HTZ4FJOP.js} +3 -3
- package/dist/{delegation-TLZTK2XW.js → delegation-RI54P6I5.js} +5 -5
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +4 -4
- package/dist/derivations/index.d.ts +4 -4
- package/dist/derivations/index.js +4 -4
- package/dist/{dev-unlock-ClAEZQC4.d.ts → dev-unlock-B4kDxep_.d.ts} +1 -1
- package/dist/{dev-unlock-L3z34v0J.d.cts → dev-unlock-BIoEFbwm.d.cts} +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/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +4 -4
- package/dist/guards/index.d.ts +4 -4
- package/dist/guards/index.js +3 -3
- package/dist/{hash-M6-JI3Yu.d.cts → hash-DdpVypUp.d.cts} +1 -1
- package/dist/{hash-B3lV6lw3.d.ts → hash-HJqD14vS.d.ts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +4 -4
- package/dist/history/index.d.ts +4 -4
- package/dist/history/index.js +4 -4
- package/dist/i18n/index.cjs +217 -22
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.js +15 -4
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-vB43MAt4.d.cts → index-4fBVt8j9.d.cts} +21 -1
- package/dist/{index-CmWQyC4e.d.ts → index-D8I_pyJD.d.ts} +21 -1
- package/dist/index.cjs +439 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +48 -38
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.js +2 -2
- package/dist/issue-VGDPP4B5.js +12 -0
- package/dist/{ledger-SQVVE2DR.js → ledger-TMRZYNVJ.js} +4 -4
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +5 -5
- package/dist/materialized-views/index.d.ts +5 -5
- package/dist/materialized-views/index.js +6 -6
- package/dist/noydb-G725ZSZG.js +34 -0
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +4 -4
- package/dist/overlay-views/index.d.ts +4 -4
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +3 -3
- package/dist/periods/index.d.ts +3 -3
- package/dist/periods/index.js +4 -4
- package/dist/{public-envelope-BXPXMN3U.js → public-envelope-BW6OXORV.js} +3 -3
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/query/index.js +3 -3
- package/dist/registry-3QP3YKQS.js +8 -0
- package/dist/{registry-4R4IURUM.js → registry-OJIOSBV6.js} +3 -3
- package/dist/registry-USRVT6YF.js +8 -0
- package/dist/{revoke-Y7UDOXGH.js → revoke-JCC7N56X.js} +5 -5
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +4 -4
- package/dist/session/index.d.ts +4 -4
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +3 -3
- package/dist/shadow/index.d.ts +3 -3
- package/dist/shadow/index.js +2 -2
- package/dist/{signer-UD2ZSVDJ.js → signer-72QAUSVW.js} +4 -4
- package/dist/snapshots/index.cjs +37 -3
- package/dist/snapshots/index.cjs.map +1 -1
- package/dist/snapshots/index.d.cts +13 -6
- package/dist/snapshots/index.d.ts +13 -6
- package/dist/snapshots/index.js +40 -6
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-F4V5E7ZK.js → stale-6ZDBTQT7.js} +2 -2
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +3 -3
- package/dist/store/index.d.ts +3 -3
- package/dist/store/index.js +2 -2
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +2 -2
- package/dist/sync/index.d.ts +2 -2
- package/dist/sync/index.js +3 -3
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +3 -3
- package/dist/team/index.d.ts +3 -3
- package/dist/team/index.js +7 -7
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +3 -3
- package/dist/tx/index.d.ts +3 -3
- package/dist/tx/index.js +3 -3
- package/dist/{types-DT7cXRHq.d.ts → types-Df28QFKb.d.ts} +216 -5
- package/dist/{types-r-y7TIqj.d.cts → types-DyXYr8rE.d.cts} +216 -5
- package/dist/{ulid-Dt55yn4s.d.ts → ulid-CJ8RzRrm.d.ts} +1 -1
- package/dist/{ulid-BkW3mLlz.d.cts → ulid-Drr7ykr6.d.cts} +1 -1
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/{with-derivation-D_Ids_H6.d.ts → with-derivation-DFnFByiQ.d.ts} +1 -1
- package/dist/{with-derivation-DB63Po2m.d.cts → with-derivation-DU3Sjazm.d.cts} +1 -1
- package/dist/{with-guard-BHThLppa.d.cts → with-guard-ByyxmEe7.d.cts} +1 -1
- package/dist/{with-guard-BJwdc0s6.d.ts → with-guard-qube6BMI.d.ts} +1 -1
- package/dist/{with-materialized-view-D-CRVSDX.d.ts → with-materialized-view-BLkQxoQN.d.ts} +1 -1
- package/dist/{with-materialized-view-BJmJ-FrO.d.cts → with-materialized-view-BmEToIR1.d.cts} +1 -1
- package/dist/{with-overlayed-view-zePNtUSq.d.cts → with-overlayed-view-BMsQQbWm.d.cts} +1 -1
- package/dist/{with-overlayed-view-CNf6GbDG.d.ts → with-overlayed-view-CRsSEwHR.d.ts} +1 -1
- package/package.json +5 -4
- package/dist/chunk-3O5FNO5O.js.map +0 -1
- package/dist/chunk-AYRTGXF3.js.map +0 -1
- package/dist/executor-HAVRTQN4.js +0 -11
- package/dist/executor-V3DKOADS.js +0 -8
- package/dist/executor-XO4M4243.js +0 -8
- package/dist/issue-EJKUQ6FA.js +0 -12
- package/dist/noydb-MK4UQ626.js +0 -34
- package/dist/registry-GPBLCHG7.js +0 -8
- package/dist/registry-ZON5HNIV.js +0 -8
- /package/dist/{chunk-4EOVWJL6.js.map → chunk-2GLDA55J.js.map} +0 -0
- /package/dist/{chunk-CBHPW77B.js.map → chunk-2WUSG3IT.js.map} +0 -0
- /package/dist/{chunk-WBUG3324.js.map → chunk-3BFJOWSU.js.map} +0 -0
- /package/dist/{chunk-7IH5FDXD.js.map → chunk-3YPCK6JX.js.map} +0 -0
- /package/dist/{chunk-SYOSRZN4.js.map → chunk-53XBRIRT.js.map} +0 -0
- /package/dist/{chunk-UPBZ7NVY.js.map → chunk-5T22KDPN.js.map} +0 -0
- /package/dist/{chunk-KK44CQ5B.js.map → chunk-5XHKQ56N.js.map} +0 -0
- /package/dist/{chunk-2TXMTYWZ.js.map → chunk-BVRYKATC.js.map} +0 -0
- /package/dist/{chunk-6ILPGZXZ.js.map → chunk-DE6GKS6G.js.map} +0 -0
- /package/dist/{chunk-TS4FQPDD.js.map → chunk-DFMLEQZB.js.map} +0 -0
- /package/dist/{chunk-3XCXUJTM.js.map → chunk-DJHHA6XH.js.map} +0 -0
- /package/dist/{chunk-LSY46G55.js.map → chunk-DL3HWOQ5.js.map} +0 -0
- /package/dist/{chunk-6MXGU2PW.js.map → chunk-DO7C2TOG.js.map} +0 -0
- /package/dist/{chunk-N4CDTRDH.js.map → chunk-DONMZAD2.js.map} +0 -0
- /package/dist/{chunk-HNC55FLJ.js.map → chunk-F3GDRNUT.js.map} +0 -0
- /package/dist/{chunk-VZOZ3DBN.js.map → chunk-H2X3ISXG.js.map} +0 -0
- /package/dist/{chunk-XZCBBZLS.js.map → chunk-HNRHLRDC.js.map} +0 -0
- /package/dist/{chunk-22ESLVUM.js.map → chunk-I5FOWO4J.js.map} +0 -0
- /package/dist/{chunk-O3JCRQT3.js.map → chunk-JWRVQKRZ.js.map} +0 -0
- /package/dist/{chunk-CSHY53CZ.js.map → chunk-K3DK3NU5.js.map} +0 -0
- /package/dist/{chunk-BNUCCUES.js.map → chunk-ML236QKC.js.map} +0 -0
- /package/dist/{chunk-GZIDTXC4.js.map → chunk-NONAAENK.js.map} +0 -0
- /package/dist/{chunk-JZDA2SRB.js.map → chunk-O3VZPBZG.js.map} +0 -0
- /package/dist/{chunk-PJKGXUMG.js.map → chunk-OQ6PIGHA.js.map} +0 -0
- /package/dist/{chunk-QYO6I7KK.js.map → chunk-PE2FR4J3.js.map} +0 -0
- /package/dist/{chunk-YAMTXW77.js.map → chunk-PP6W64Y3.js.map} +0 -0
- /package/dist/{chunk-HNFXKQD7.js.map → chunk-PX35GA7L.js.map} +0 -0
- /package/dist/{chunk-OXCFFRF3.js.map → chunk-QEILDE6R.js.map} +0 -0
- /package/dist/{chunk-4YVVF6JN.js.map → chunk-QODLLGQ7.js.map} +0 -0
- /package/dist/{chunk-ASFE2X62.js.map → chunk-RAZ4OVLL.js.map} +0 -0
- /package/dist/{chunk-WM5GFORS.js.map → chunk-SYMWGEET.js.map} +0 -0
- /package/dist/{chunk-SLJQIBT7.js.map → chunk-T7JEBOGN.js.map} +0 -0
- /package/dist/{chunk-OA6HE2RW.js.map → chunk-TFBP23BX.js.map} +0 -0
- /package/dist/{chunk-GI6S5ZF2.js.map → chunk-U26HQ6KJ.js.map} +0 -0
- /package/dist/{chunk-WMKCAN4H.js.map → chunk-VTKGMEPP.js.map} +0 -0
- /package/dist/{chunk-BRZFN354.js.map → chunk-WPLVTJ5D.js.map} +0 -0
- /package/dist/{chunk-DCP4L4SH.js.map → chunk-XJFLDA7A.js.map} +0 -0
- /package/dist/{chunk-BE5ZALMB.js.map → chunk-ZYWZWG6G.js.map} +0 -0
- /package/dist/{crypto-TRZ5BJMY.js.map → crypto-HTZ4FJOP.js.map} +0 -0
- /package/dist/{delegation-TLZTK2XW.js.map → delegation-RI54P6I5.js.map} +0 -0
- /package/dist/{executor-HAVRTQN4.js.map → executor-5PNY7LGW.js.map} +0 -0
- /package/dist/{executor-V3DKOADS.js.map → executor-B4QIYGZX.js.map} +0 -0
- /package/dist/{executor-XO4M4243.js.map → executor-BWXXDQ7K.js.map} +0 -0
- /package/dist/{issue-EJKUQ6FA.js.map → issue-VGDPP4B5.js.map} +0 -0
- /package/dist/{ledger-SQVVE2DR.js.map → ledger-TMRZYNVJ.js.map} +0 -0
- /package/dist/{noydb-MK4UQ626.js.map → noydb-G725ZSZG.js.map} +0 -0
- /package/dist/{public-envelope-BXPXMN3U.js.map → public-envelope-BW6OXORV.js.map} +0 -0
- /package/dist/{registry-4R4IURUM.js.map → registry-3QP3YKQS.js.map} +0 -0
- /package/dist/{registry-GPBLCHG7.js.map → registry-OJIOSBV6.js.map} +0 -0
- /package/dist/{registry-ZON5HNIV.js.map → registry-USRVT6YF.js.map} +0 -0
- /package/dist/{revoke-Y7UDOXGH.js.map → revoke-JCC7N56X.js.map} +0 -0
- /package/dist/{signer-UD2ZSVDJ.js.map → signer-72QAUSVW.js.map} +0 -0
- /package/dist/{stale-F4V5E7ZK.js.map → stale-6ZDBTQT7.js.map} +0 -0
|
@@ -4,36 +4,37 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
TxContext,
|
|
6
6
|
revertExecuted
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TFBP23BX.js";
|
|
8
8
|
import {
|
|
9
9
|
OverlayedCollection
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DJHHA6XH.js";
|
|
11
11
|
import {
|
|
12
12
|
LazyQuery,
|
|
13
13
|
decodeIdxId,
|
|
14
14
|
encodeIdxId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2WUSG3IT.js";
|
|
16
16
|
import {
|
|
17
17
|
SCHEMAS_COLLECTION,
|
|
18
18
|
loadPersistedSchema,
|
|
19
19
|
resolveManagedSecret,
|
|
20
20
|
savePersistedSchema,
|
|
21
21
|
saveSealedPassphrase
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-I5FOWO4J.js";
|
|
23
23
|
import {
|
|
24
24
|
loadPublicEnvelope,
|
|
25
25
|
readPublicEnvelope,
|
|
26
26
|
savePublicEnvelope,
|
|
27
27
|
validatePublicEnvelopeInput
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-ML236QKC.js";
|
|
29
29
|
import {
|
|
30
30
|
PERIODS_COLLECTION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JWRVQKRZ.js";
|
|
32
32
|
import {
|
|
33
33
|
getAtPath,
|
|
34
34
|
isDictCollectionName,
|
|
35
|
+
resolvePolicy,
|
|
35
36
|
setAtPathInPlace
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-22DWZL57.js";
|
|
37
38
|
import {
|
|
38
39
|
ManagedRecoveryNotEnrolledError,
|
|
39
40
|
PolicyDeniedError,
|
|
@@ -55,11 +56,11 @@ import {
|
|
|
55
56
|
saveShamirRecoveryEntries,
|
|
56
57
|
updateAuthenticator,
|
|
57
58
|
writeMagicLinkGrant
|
|
58
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-3YPCK6JX.js";
|
|
59
60
|
import {
|
|
60
61
|
assertTierAccess,
|
|
61
62
|
dekKey
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-U26HQ6KJ.js";
|
|
63
64
|
import {
|
|
64
65
|
USER_ENVELOPE_COLLECTION,
|
|
65
66
|
buildRecipientKeyringFile,
|
|
@@ -83,7 +84,7 @@ import {
|
|
|
83
84
|
rotateKeys,
|
|
84
85
|
saveUserEnvelope,
|
|
85
86
|
updateKeyringIdentity
|
|
86
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-DONMZAD2.js";
|
|
87
88
|
import {
|
|
88
89
|
INDEXED_STORE_POLICY
|
|
89
90
|
} from "./chunk-2QR2PQTT.js";
|
|
@@ -93,7 +94,7 @@ import {
|
|
|
93
94
|
import {
|
|
94
95
|
LEDGER_COLLECTION,
|
|
95
96
|
LEDGER_DELTAS_COLLECTION
|
|
96
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-PE2FR4J3.js";
|
|
97
98
|
import {
|
|
98
99
|
sha256Hex as sha256Hex2
|
|
99
100
|
} from "./chunk-Z6FNBOTC.js";
|
|
@@ -101,12 +102,12 @@ import {
|
|
|
101
102
|
NO_AGGREGATE,
|
|
102
103
|
Query,
|
|
103
104
|
ScanBuilder
|
|
104
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-2GLDA55J.js";
|
|
105
106
|
import {
|
|
106
107
|
EXPORT_AUDIT_COLLECTION,
|
|
107
108
|
createExportBlobsHandle,
|
|
108
109
|
runCompaction
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-3BFJOWSU.js";
|
|
110
111
|
import {
|
|
111
112
|
NOYDB_BACKUP_VERSION,
|
|
112
113
|
NOYDB_FORMAT_VERSION
|
|
@@ -116,7 +117,7 @@ import {
|
|
|
116
117
|
encrypt,
|
|
117
118
|
encryptDeterministic,
|
|
118
119
|
sha256Hex
|
|
119
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-PP6W64Y3.js";
|
|
120
121
|
import {
|
|
121
122
|
AlreadyElevatedError,
|
|
122
123
|
AttestationError,
|
|
@@ -129,6 +130,7 @@ import {
|
|
|
129
130
|
IndexWriteFailureError,
|
|
130
131
|
InvalidKeyError,
|
|
131
132
|
KeyringCorruptError,
|
|
133
|
+
LocaleNotSpecifiedError,
|
|
132
134
|
MigrationRequiredError,
|
|
133
135
|
NoAccessError,
|
|
134
136
|
NoydbError,
|
|
@@ -143,7 +145,7 @@ import {
|
|
|
143
145
|
TierNotGrantedError,
|
|
144
146
|
TranslatorNotConfiguredError,
|
|
145
147
|
ValidationError
|
|
146
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-B6PB7JLN.js";
|
|
147
149
|
|
|
148
150
|
// src/policy/storage.ts
|
|
149
151
|
var META_COLLECTION = "_meta";
|
|
@@ -331,6 +333,9 @@ var NO_I18N = {
|
|
|
331
333
|
validateI18nTextValue() {
|
|
332
334
|
throw notEnabled("i18nText field validation");
|
|
333
335
|
},
|
|
336
|
+
enforceScript(value) {
|
|
337
|
+
return { value, warnings: [] };
|
|
338
|
+
},
|
|
334
339
|
buildDictionaryHandle() {
|
|
335
340
|
throw notEnabled("vault.dictionary()");
|
|
336
341
|
}
|
|
@@ -646,7 +651,7 @@ async function resolveStaleOnRead(accessor, outputCollection, id) {
|
|
|
646
651
|
}
|
|
647
652
|
const sourceWithId = { ...source, id };
|
|
648
653
|
if (DerivationExecutor === null) {
|
|
649
|
-
({ DerivationExecutor } = await import("./executor-
|
|
654
|
+
({ DerivationExecutor } = await import("./executor-B4QIYGZX.js"));
|
|
650
655
|
}
|
|
651
656
|
const ctx = { vault: accessor.getReadOnlyFacade() };
|
|
652
657
|
const result = await DerivationExecutor.run(spec, sourceWithId, 0, strategyHash, ctx);
|
|
@@ -1114,7 +1119,7 @@ var Collection = class {
|
|
|
1114
1119
|
}
|
|
1115
1120
|
}
|
|
1116
1121
|
if (this.materializedViewSource !== void 0) {
|
|
1117
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
1122
|
+
const { resolveStaleMVOnRead } = await import("./stale-6ZDBTQT7.js");
|
|
1118
1123
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name);
|
|
1119
1124
|
}
|
|
1120
1125
|
let record;
|
|
@@ -1313,6 +1318,22 @@ var Collection = class {
|
|
|
1313
1318
|
setAtPathInPlace(obj, field, translated);
|
|
1314
1319
|
}
|
|
1315
1320
|
}
|
|
1321
|
+
if (this.i18nFields) {
|
|
1322
|
+
const obj = record;
|
|
1323
|
+
for (const [field, descriptor] of Object.entries(this.i18nFields)) {
|
|
1324
|
+
if (!descriptor.options.script) continue;
|
|
1325
|
+
for (const leaf of getAtPath(obj, field)) {
|
|
1326
|
+
if (!leaf || typeof leaf !== "object" || Array.isArray(leaf)) continue;
|
|
1327
|
+
const leafMap = leaf;
|
|
1328
|
+
const { value: cleaned } = this.i18nStrategy.enforceScript(
|
|
1329
|
+
leafMap,
|
|
1330
|
+
field,
|
|
1331
|
+
descriptor
|
|
1332
|
+
);
|
|
1333
|
+
if (cleaned !== leafMap) Object.assign(leafMap, cleaned);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1316
1337
|
if (this.i18nPutValidator !== void 0) {
|
|
1317
1338
|
this.i18nPutValidator(record);
|
|
1318
1339
|
}
|
|
@@ -1485,7 +1506,7 @@ var Collection = class {
|
|
|
1485
1506
|
if (mode === "eager") {
|
|
1486
1507
|
if (executor === null) {
|
|
1487
1508
|
;
|
|
1488
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-
|
|
1509
|
+
({ MaterializedViewExecutor: executor } = await import("./executor-BWXXDQ7K.js"));
|
|
1489
1510
|
}
|
|
1490
1511
|
await executor.refresh(reg, {
|
|
1491
1512
|
getCollection: (name) => this.materializedViewSource.getCollection(name),
|
|
@@ -1494,7 +1515,7 @@ var Collection = class {
|
|
|
1494
1515
|
});
|
|
1495
1516
|
} else if (mode === "lazy") {
|
|
1496
1517
|
if (staleHelpers === null) {
|
|
1497
|
-
staleHelpers = await import("./stale-
|
|
1518
|
+
staleHelpers = await import("./stale-6ZDBTQT7.js");
|
|
1498
1519
|
}
|
|
1499
1520
|
staleHelpers.markMVStale(registry, reg.spec.name);
|
|
1500
1521
|
}
|
|
@@ -1523,7 +1544,7 @@ var Collection = class {
|
|
|
1523
1544
|
const mode = typeof spec.lifecycle === "string" ? spec.lifecycle : spec.lifecycle.mode;
|
|
1524
1545
|
if (mode === "eager") {
|
|
1525
1546
|
if (DerivationExecutor === null) {
|
|
1526
|
-
({ DerivationExecutor } = await import("./executor-
|
|
1547
|
+
({ DerivationExecutor } = await import("./executor-B4QIYGZX.js"));
|
|
1527
1548
|
}
|
|
1528
1549
|
const sourceWithId = { ...incoming, id };
|
|
1529
1550
|
const ctx = { vault: this.derivationSource.getReadOnlyFacade() };
|
|
@@ -1874,7 +1895,7 @@ var Collection = class {
|
|
|
1874
1895
|
if (mode === "eager") {
|
|
1875
1896
|
if (executor === null) {
|
|
1876
1897
|
;
|
|
1877
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-
|
|
1898
|
+
({ MaterializedViewExecutor: executor } = await import("./executor-BWXXDQ7K.js"));
|
|
1878
1899
|
}
|
|
1879
1900
|
await executor.refresh(reg, {
|
|
1880
1901
|
getCollection: (name) => this.materializedViewSource.getCollection(name),
|
|
@@ -1883,7 +1904,7 @@ var Collection = class {
|
|
|
1883
1904
|
});
|
|
1884
1905
|
} else if (mode === "lazy") {
|
|
1885
1906
|
if (staleHelpers === null) {
|
|
1886
|
-
staleHelpers = await import("./stale-
|
|
1907
|
+
staleHelpers = await import("./stale-6ZDBTQT7.js");
|
|
1887
1908
|
}
|
|
1888
1909
|
staleHelpers.markMVStale(registry, reg.spec.name);
|
|
1889
1910
|
}
|
|
@@ -1906,7 +1927,7 @@ var Collection = class {
|
|
|
1906
1927
|
);
|
|
1907
1928
|
}
|
|
1908
1929
|
if (this.materializedViewSource !== void 0) {
|
|
1909
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
1930
|
+
const { resolveStaleMVOnRead } = await import("./stale-6ZDBTQT7.js");
|
|
1910
1931
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name);
|
|
1911
1932
|
}
|
|
1912
1933
|
await this.ensureHydrated();
|
|
@@ -2755,17 +2776,52 @@ var Collection = class {
|
|
|
2755
2776
|
}
|
|
2756
2777
|
if (hasDict && this.dictKeyFields && this.dictLabelResolver && locale !== "raw") {
|
|
2757
2778
|
const withLabels = { ...result };
|
|
2779
|
+
const resolver = this.dictLabelResolver;
|
|
2758
2780
|
for (const [field, desc] of Object.entries(this.dictKeyFields)) {
|
|
2759
|
-
const
|
|
2760
|
-
|
|
2761
|
-
const
|
|
2762
|
-
desc.name,
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2781
|
+
const policy = desc.onMissing ? resolvePolicy(desc.onMissing, "read") : "null";
|
|
2782
|
+
const fallback = policy === "substitute" ? localeOpts?.fallback ?? desc.substitute : localeOpts?.fallback;
|
|
2783
|
+
const resolveKey = async (key) => {
|
|
2784
|
+
const label = await resolver(desc.name, key, locale, fallback);
|
|
2785
|
+
if (label === void 0) {
|
|
2786
|
+
if (policy === "throw") {
|
|
2787
|
+
throw new LocaleNotSpecifiedError(
|
|
2788
|
+
field,
|
|
2789
|
+
`dictKey "${field}": no label for key "${key}" in locale "${locale}".`
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
return null;
|
|
2793
|
+
}
|
|
2794
|
+
return label;
|
|
2795
|
+
};
|
|
2796
|
+
if (field.includes("[].")) {
|
|
2797
|
+
const parts = field.split("[].");
|
|
2798
|
+
const arrayKey = parts[0];
|
|
2799
|
+
const leaf = parts[1];
|
|
2800
|
+
if (!leaf || leaf.includes(".")) continue;
|
|
2801
|
+
const arr = withLabels[arrayKey];
|
|
2802
|
+
if (!Array.isArray(arr)) continue;
|
|
2803
|
+
const labelKey = `${leaf}Label`;
|
|
2804
|
+
withLabels[arrayKey] = await Promise.all(
|
|
2805
|
+
arr.map(async (el) => {
|
|
2806
|
+
if (!el || typeof el !== "object" || Array.isArray(el)) return el;
|
|
2807
|
+
const k = el[leaf];
|
|
2808
|
+
if (typeof k !== "string") return el;
|
|
2809
|
+
return { ...el, [labelKey]: await resolveKey(k) };
|
|
2810
|
+
})
|
|
2811
|
+
);
|
|
2812
|
+
continue;
|
|
2813
|
+
}
|
|
2814
|
+
const val = result[field];
|
|
2815
|
+
if (Array.isArray(val)) {
|
|
2816
|
+
withLabels[`${field}Label`] = await Promise.all(
|
|
2817
|
+
val.map(async (k) => ({
|
|
2818
|
+
key: k,
|
|
2819
|
+
label: typeof k === "string" ? await resolveKey(k) : null
|
|
2820
|
+
}))
|
|
2821
|
+
);
|
|
2822
|
+
} else if (typeof val === "string") {
|
|
2823
|
+
const label = await resolveKey(val);
|
|
2824
|
+
if (label !== null) withLabels[`${field}Label`] = label;
|
|
2769
2825
|
}
|
|
2770
2826
|
}
|
|
2771
2827
|
result = withLabels;
|
|
@@ -5339,12 +5395,12 @@ var Vault = class {
|
|
|
5339
5395
|
if (!fieldSchema) {
|
|
5340
5396
|
throw new AttestationError(`issueAttestation: collection '${collectionName}' has no attestation field-schema. Declare it via vault.collection('${collectionName}', { attestation: { fields: [...] } }).`);
|
|
5341
5397
|
}
|
|
5342
|
-
const { issueAttestationCore } = await import("./issue-
|
|
5398
|
+
const { issueAttestationCore } = await import("./issue-VGDPP4B5.js");
|
|
5343
5399
|
const out = await issueAttestationCore(this.makeIssueContext(), { collection: collectionName, id, fieldSchema });
|
|
5344
5400
|
return { docId: out.docId, qr: out.qr, keyId: out.keyId, publicKeyB64: out.publicKeyB64 };
|
|
5345
5401
|
}
|
|
5346
5402
|
async getDocumentSigningPublicKey() {
|
|
5347
|
-
const { loadSigner, loadOrCreateSigner } = await import("./signer-
|
|
5403
|
+
const { loadSigner, loadOrCreateSigner } = await import("./signer-72QAUSVW.js");
|
|
5348
5404
|
const existing = await loadSigner(this.adapter, this.name, this.getDEK);
|
|
5349
5405
|
if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
|
|
5350
5406
|
if (this.keyring.role !== "owner") {
|
|
@@ -5370,19 +5426,19 @@ var Vault = class {
|
|
|
5370
5426
|
};
|
|
5371
5427
|
}
|
|
5372
5428
|
async revokeAttestation(docId) {
|
|
5373
|
-
const { revokeDocCore } = await import("./revoke-
|
|
5429
|
+
const { revokeDocCore } = await import("./revoke-JCC7N56X.js");
|
|
5374
5430
|
await revokeDocCore(this.makeRevokeContext(), docId);
|
|
5375
5431
|
}
|
|
5376
5432
|
async unrevokeAttestation(docId) {
|
|
5377
|
-
const { unrevokeDocCore } = await import("./revoke-
|
|
5433
|
+
const { unrevokeDocCore } = await import("./revoke-JCC7N56X.js");
|
|
5378
5434
|
await unrevokeDocCore(this.makeRevokeContext(), docId);
|
|
5379
5435
|
}
|
|
5380
5436
|
async getRevokedDocIds() {
|
|
5381
|
-
const { getRevokedDocIdsCore } = await import("./revoke-
|
|
5437
|
+
const { getRevokedDocIdsCore } = await import("./revoke-JCC7N56X.js");
|
|
5382
5438
|
return getRevokedDocIdsCore(this.makeRevokeContext());
|
|
5383
5439
|
}
|
|
5384
5440
|
async publishRevocationList() {
|
|
5385
|
-
const { publishRevocationListCore } = await import("./revoke-
|
|
5441
|
+
const { publishRevocationListCore } = await import("./revoke-JCC7N56X.js");
|
|
5386
5442
|
return publishRevocationListCore(this.makeRevokeContext());
|
|
5387
5443
|
}
|
|
5388
5444
|
makeRevokeContext() {
|
|
@@ -5699,7 +5755,7 @@ var Vault = class {
|
|
|
5699
5755
|
async _initDerivations(handles) {
|
|
5700
5756
|
if (handles.length === 0) return;
|
|
5701
5757
|
const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
|
|
5702
|
-
import("./registry-
|
|
5758
|
+
import("./registry-3QP3YKQS.js"),
|
|
5703
5759
|
import("./read-only-facade-ITU6L7BL.js")
|
|
5704
5760
|
]);
|
|
5705
5761
|
const registry = new DerivationRegistry();
|
|
@@ -5730,7 +5786,7 @@ var Vault = class {
|
|
|
5730
5786
|
*/
|
|
5731
5787
|
async _initMaterializedViews(handles) {
|
|
5732
5788
|
if (handles.length === 0) return;
|
|
5733
|
-
const { MaterializedViewRegistry } = await import("./registry-
|
|
5789
|
+
const { MaterializedViewRegistry } = await import("./registry-OJIOSBV6.js");
|
|
5734
5790
|
const registry = new MaterializedViewRegistry();
|
|
5735
5791
|
this.materializedViewRegistry = registry;
|
|
5736
5792
|
const db = this;
|
|
@@ -5754,7 +5810,7 @@ var Vault = class {
|
|
|
5754
5810
|
*/
|
|
5755
5811
|
async _initOverlayedViews(handles) {
|
|
5756
5812
|
if (handles.length === 0) return;
|
|
5757
|
-
const { OverlayedViewRegistry } = await import("./registry-
|
|
5813
|
+
const { OverlayedViewRegistry } = await import("./registry-USRVT6YF.js");
|
|
5758
5814
|
const registry = new OverlayedViewRegistry();
|
|
5759
5815
|
const mvRegistry = this.materializedViewRegistry;
|
|
5760
5816
|
const overlayNames = /* @__PURE__ */ new Set();
|
|
@@ -5801,13 +5857,13 @@ var Vault = class {
|
|
|
5801
5857
|
if (!reg) {
|
|
5802
5858
|
throw new Error(`refreshView: no MV registered with name "${name}"`);
|
|
5803
5859
|
}
|
|
5804
|
-
const { MaterializedViewExecutor } = await import("./executor-
|
|
5860
|
+
const { MaterializedViewExecutor } = await import("./executor-BWXXDQ7K.js");
|
|
5805
5861
|
const result = await MaterializedViewExecutor.refresh(reg, {
|
|
5806
5862
|
getCollection: (n) => this.collection(n),
|
|
5807
5863
|
getActiveTxContext: () => this.noydb._activeTxContextOrNull,
|
|
5808
5864
|
getQueryContext: () => this
|
|
5809
5865
|
});
|
|
5810
|
-
const { clearMVStale } = await import("./stale-
|
|
5866
|
+
const { clearMVStale } = await import("./stale-6ZDBTQT7.js");
|
|
5811
5867
|
clearMVStale(registry, name);
|
|
5812
5868
|
return result;
|
|
5813
5869
|
}
|
|
@@ -5823,7 +5879,7 @@ var Vault = class {
|
|
|
5823
5879
|
if (registry === null) return { derived: 0, failed: 0 };
|
|
5824
5880
|
const strategies = registry.strategiesForSource(sourceCollection);
|
|
5825
5881
|
if (strategies.length === 0) return { derived: 0, failed: 0 };
|
|
5826
|
-
const { DerivationExecutor } = await import("./executor-
|
|
5882
|
+
const { DerivationExecutor } = await import("./executor-B4QIYGZX.js");
|
|
5827
5883
|
const sourceColl = this.collection(sourceCollection);
|
|
5828
5884
|
const records = await sourceColl.list();
|
|
5829
5885
|
const ctx = { vault: this.readOnlyFacade ?? new (await import("./read-only-facade-ITU6L7BL.js")).ReadOnlyVaultFacade(this) };
|
|
@@ -6069,7 +6125,7 @@ var Vault = class {
|
|
|
6069
6125
|
* collection.
|
|
6070
6126
|
*/
|
|
6071
6127
|
async delegate(opts) {
|
|
6072
|
-
const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-
|
|
6128
|
+
const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-RI54P6I5.js");
|
|
6073
6129
|
if (!this.keyring.kek) {
|
|
6074
6130
|
throw new ValidationError(
|
|
6075
6131
|
"issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (passphrase) first."
|
|
@@ -6091,7 +6147,7 @@ var Vault = class {
|
|
|
6091
6147
|
* if the id does not exist.
|
|
6092
6148
|
*/
|
|
6093
6149
|
async revokeDelegation(id) {
|
|
6094
|
-
const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-
|
|
6150
|
+
const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-RI54P6I5.js");
|
|
6095
6151
|
await revokeDelegation(this.adapter, this.name, id);
|
|
6096
6152
|
void DELEGATIONS_COLLECTION;
|
|
6097
6153
|
}
|
|
@@ -6560,7 +6616,7 @@ var Vault = class {
|
|
|
6560
6616
|
* @see docs/subsystems/public-envelope.md
|
|
6561
6617
|
*/
|
|
6562
6618
|
async getPublicEnvelope(opts = {}) {
|
|
6563
|
-
const { readPublicEnvelope: readPublicEnvelope2 } = await import("./public-envelope-
|
|
6619
|
+
const { readPublicEnvelope: readPublicEnvelope2 } = await import("./public-envelope-BW6OXORV.js");
|
|
6564
6620
|
return readPublicEnvelope2(this.adapter, this.name, opts);
|
|
6565
6621
|
}
|
|
6566
6622
|
/**
|
|
@@ -7637,6 +7693,119 @@ var NO_SNAPSHOTS = {
|
|
|
7637
7693
|
},
|
|
7638
7694
|
async restoreSnapshot() {
|
|
7639
7695
|
throw NOT_ENABLED4;
|
|
7696
|
+
},
|
|
7697
|
+
async autoSnapshot() {
|
|
7698
|
+
throw NOT_ENABLED4;
|
|
7699
|
+
}
|
|
7700
|
+
};
|
|
7701
|
+
|
|
7702
|
+
// src/snapshots/scheduler.ts
|
|
7703
|
+
var SnapshotScheduler = class {
|
|
7704
|
+
policy;
|
|
7705
|
+
callbacks;
|
|
7706
|
+
debounceTimer = null;
|
|
7707
|
+
intervalTimer = null;
|
|
7708
|
+
lastFireTime = 0;
|
|
7709
|
+
firing = false;
|
|
7710
|
+
started = false;
|
|
7711
|
+
boundVisibility = null;
|
|
7712
|
+
boundUnload = null;
|
|
7713
|
+
constructor(policy, callbacks) {
|
|
7714
|
+
this.policy = policy;
|
|
7715
|
+
this.callbacks = callbacks;
|
|
7716
|
+
if (this.shouldRegisterUnload()) {
|
|
7717
|
+
this.boundVisibility = this.handleVisibility.bind(this);
|
|
7718
|
+
this.boundUnload = this.handleUnload.bind(this);
|
|
7719
|
+
}
|
|
7720
|
+
}
|
|
7721
|
+
start() {
|
|
7722
|
+
if (this.started) return;
|
|
7723
|
+
this.started = true;
|
|
7724
|
+
if (this.policy.mode === "interval") {
|
|
7725
|
+
const ms = this.policy.intervalMs ?? 3e5;
|
|
7726
|
+
this.intervalTimer = setInterval(() => {
|
|
7727
|
+
void this.execFire();
|
|
7728
|
+
}, ms);
|
|
7729
|
+
}
|
|
7730
|
+
if (this.boundVisibility && this.boundUnload) {
|
|
7731
|
+
if (typeof document !== "undefined") {
|
|
7732
|
+
document.addEventListener("visibilitychange", this.boundVisibility);
|
|
7733
|
+
}
|
|
7734
|
+
if (typeof globalThis.addEventListener === "function") {
|
|
7735
|
+
globalThis.addEventListener("pagehide", this.boundUnload);
|
|
7736
|
+
}
|
|
7737
|
+
if (typeof process !== "undefined" && typeof process.on === "function") {
|
|
7738
|
+
process.on("beforeExit", this.boundUnload);
|
|
7739
|
+
}
|
|
7740
|
+
}
|
|
7741
|
+
}
|
|
7742
|
+
stop() {
|
|
7743
|
+
if (!this.started) return;
|
|
7744
|
+
this.started = false;
|
|
7745
|
+
if (this.debounceTimer) {
|
|
7746
|
+
clearTimeout(this.debounceTimer);
|
|
7747
|
+
this.debounceTimer = null;
|
|
7748
|
+
}
|
|
7749
|
+
if (this.intervalTimer) {
|
|
7750
|
+
clearInterval(this.intervalTimer);
|
|
7751
|
+
this.intervalTimer = null;
|
|
7752
|
+
}
|
|
7753
|
+
if (this.boundVisibility && this.boundUnload) {
|
|
7754
|
+
if (typeof document !== "undefined") {
|
|
7755
|
+
document.removeEventListener("visibilitychange", this.boundVisibility);
|
|
7756
|
+
}
|
|
7757
|
+
if (typeof globalThis.removeEventListener === "function") {
|
|
7758
|
+
globalThis.removeEventListener("pagehide", this.boundUnload);
|
|
7759
|
+
}
|
|
7760
|
+
if (typeof process !== "undefined" && typeof process.removeListener === "function") {
|
|
7761
|
+
process.removeListener("beforeExit", this.boundUnload);
|
|
7762
|
+
}
|
|
7763
|
+
}
|
|
7764
|
+
}
|
|
7765
|
+
notifyChange() {
|
|
7766
|
+
if (!this.started) return;
|
|
7767
|
+
if (this.policy.mode === "debounce") this.resetDebounce();
|
|
7768
|
+
}
|
|
7769
|
+
resetDebounce() {
|
|
7770
|
+
if (this.debounceTimer) clearTimeout(this.debounceTimer);
|
|
7771
|
+
const ms = this.policy.debounceMs ?? 3e4;
|
|
7772
|
+
this.debounceTimer = setTimeout(() => {
|
|
7773
|
+
this.debounceTimer = null;
|
|
7774
|
+
void this.execFire();
|
|
7775
|
+
}, ms);
|
|
7776
|
+
}
|
|
7777
|
+
async execFire() {
|
|
7778
|
+
if (this.firing) return;
|
|
7779
|
+
const minInterval = this.policy.minIntervalMs ?? 0;
|
|
7780
|
+
if (minInterval > 0 && Date.now() - this.lastFireTime < minInterval) {
|
|
7781
|
+
if (this.policy.mode === "debounce") this.resetDebounce();
|
|
7782
|
+
return;
|
|
7783
|
+
}
|
|
7784
|
+
if (this.callbacks.pendingCount() === 0) return;
|
|
7785
|
+
this.firing = true;
|
|
7786
|
+
try {
|
|
7787
|
+
await this.callbacks.fire();
|
|
7788
|
+
this.lastFireTime = Date.now();
|
|
7789
|
+
} catch {
|
|
7790
|
+
} finally {
|
|
7791
|
+
this.firing = false;
|
|
7792
|
+
}
|
|
7793
|
+
}
|
|
7794
|
+
handleVisibility() {
|
|
7795
|
+
if (typeof document !== "undefined" && document.visibilityState === "hidden") {
|
|
7796
|
+
this.flush();
|
|
7797
|
+
}
|
|
7798
|
+
}
|
|
7799
|
+
handleUnload() {
|
|
7800
|
+
this.flush();
|
|
7801
|
+
}
|
|
7802
|
+
flush() {
|
|
7803
|
+
if (this.callbacks.pendingCount() === 0) return;
|
|
7804
|
+
void this.callbacks.fire().catch(() => {
|
|
7805
|
+
});
|
|
7806
|
+
}
|
|
7807
|
+
shouldRegisterUnload() {
|
|
7808
|
+
return this.policy.onUnload ?? this.policy.mode !== "manual";
|
|
7640
7809
|
}
|
|
7641
7810
|
};
|
|
7642
7811
|
|
|
@@ -7993,6 +8162,8 @@ var Noydb = class {
|
|
|
7993
8162
|
sessionStrategy;
|
|
7994
8163
|
syncStrategy;
|
|
7995
8164
|
snapshotStrategy;
|
|
8165
|
+
snapshotScheduler = null;
|
|
8166
|
+
dirtySnapshotVaults = /* @__PURE__ */ new Set();
|
|
7996
8167
|
/**
|
|
7997
8168
|
* Currently-running multi-record transaction, set by
|
|
7998
8169
|
* `runTransaction` at the start of Phase 2 (commit) and cleared in
|
|
@@ -8018,6 +8189,7 @@ var Noydb = class {
|
|
|
8018
8189
|
this.sessionStrategy = options.sessionStrategy ?? NO_SESSION;
|
|
8019
8190
|
this.syncStrategy = options.syncStrategy ?? NO_SYNC;
|
|
8020
8191
|
this.snapshotStrategy = options.snapshotStrategy ?? NO_SNAPSHOTS;
|
|
8192
|
+
this.initSnapshotCadence();
|
|
8021
8193
|
this.publicEnvelopeSchema = resolveSchema(options.publicEnvelope);
|
|
8022
8194
|
if (options.sessionPolicy) {
|
|
8023
8195
|
this.sessionStrategy.validateSessionPolicy(options.sessionPolicy);
|
|
@@ -8053,7 +8225,7 @@ var Noydb = class {
|
|
|
8053
8225
|
if (!facade) return;
|
|
8054
8226
|
const ctx = { existing, vault: facade, userId: e.userId, role: e.role };
|
|
8055
8227
|
await registry.runChecks(e.collection, incoming, ctx);
|
|
8056
|
-
const { GuardExecutor } = await import("./executor-
|
|
8228
|
+
const { GuardExecutor } = await import("./executor-5PNY7LGW.js");
|
|
8057
8229
|
for (const g of guards) {
|
|
8058
8230
|
await GuardExecutor.checkFrozenFields(g, e.docId, existing, incoming);
|
|
8059
8231
|
}
|
|
@@ -8974,6 +9146,8 @@ var Noydb = class {
|
|
|
8974
9146
|
}
|
|
8975
9147
|
close() {
|
|
8976
9148
|
this.closed = true;
|
|
9149
|
+
this.snapshotScheduler?.stop();
|
|
9150
|
+
this.snapshotScheduler = null;
|
|
8977
9151
|
if (this.sessionTimer) {
|
|
8978
9152
|
clearTimeout(this.sessionTimer);
|
|
8979
9153
|
this.sessionTimer = null;
|
|
@@ -10019,6 +10193,41 @@ var Noydb = class {
|
|
|
10019
10193
|
}
|
|
10020
10194
|
return this.snapshotStrategy.snapshot(v, this.options.user, opts);
|
|
10021
10195
|
}
|
|
10196
|
+
/**
|
|
10197
|
+
* Wire the automatic-snapshot cadence when a non-manual `snapshotPolicy` is
|
|
10198
|
+
* configured. Subscribes to `onAfterWrite` to mark the written vault dirty and
|
|
10199
|
+
* nudge the scheduler; the scheduler fires `autoSnapshot()` per dirty vault.
|
|
10200
|
+
* No-op for `mode:'manual'` or no policy.
|
|
10201
|
+
*/
|
|
10202
|
+
initSnapshotCadence() {
|
|
10203
|
+
const policy = this.snapshotStrategy.policy;
|
|
10204
|
+
if (!policy || !policy.mode || policy.mode === "manual") return;
|
|
10205
|
+
const scheduler = new SnapshotScheduler(policy, {
|
|
10206
|
+
fire: async () => {
|
|
10207
|
+
const names = [...this.dirtySnapshotVaults];
|
|
10208
|
+
this.dirtySnapshotVaults.clear();
|
|
10209
|
+
for (const name of names) {
|
|
10210
|
+
const v = this.vaultCache.get(name);
|
|
10211
|
+
if (!v) continue;
|
|
10212
|
+
try {
|
|
10213
|
+
await this.snapshotStrategy.autoSnapshot(v, this.options.user);
|
|
10214
|
+
} catch (err) {
|
|
10215
|
+
this.dirtySnapshotVaults.add(name);
|
|
10216
|
+
console.warn(
|
|
10217
|
+
`[noy-db] auto-snapshot failed for vault "${name}": ` + (err instanceof Error ? err.message : String(err))
|
|
10218
|
+
);
|
|
10219
|
+
}
|
|
10220
|
+
}
|
|
10221
|
+
},
|
|
10222
|
+
pendingCount: () => this.dirtySnapshotVaults.size
|
|
10223
|
+
});
|
|
10224
|
+
this.onAfterWrite((event) => {
|
|
10225
|
+
this.dirtySnapshotVaults.add(event.vault);
|
|
10226
|
+
scheduler.notifyChange();
|
|
10227
|
+
});
|
|
10228
|
+
scheduler.start();
|
|
10229
|
+
this.snapshotScheduler = scheduler;
|
|
10230
|
+
}
|
|
10022
10231
|
/**
|
|
10023
10232
|
* List all snapshots for the given vault, newest first.
|
|
10024
10233
|
* Reads only the sidecar index — does not download snapshot bytes.
|
|
@@ -10117,4 +10326,4 @@ export {
|
|
|
10117
10326
|
Noydb,
|
|
10118
10327
|
createNoydb
|
|
10119
10328
|
};
|
|
10120
|
-
//# sourceMappingURL=chunk-
|
|
10329
|
+
//# sourceMappingURL=chunk-6CME4UEK.js.map
|