@noy-db/hub 0.1.0-pre.9 → 0.2.0-pre.1
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 +91 -36
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +2 -2
- package/dist/aggregate/index.d.ts +2 -2
- package/dist/aggregate/index.js +16 -9
- package/dist/aggregate/index.js.map +1 -1
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +6 -6
- package/dist/blobs/index.d.ts +6 -6
- package/dist/blobs/index.js +4 -4
- package/dist/bundle/index.cjs +298 -7
- 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 +15 -4
- package/dist/{chunk-GOUT6DND.js → chunk-23TTQXVO.js} +173 -91
- package/dist/chunk-23TTQXVO.js.map +1 -0
- package/dist/{chunk-CIMZBAZB.js → chunk-2AXFIYHT.js} +1 -1
- package/dist/chunk-2AXFIYHT.js.map +1 -0
- package/dist/chunk-34YSDCDP.js +73 -0
- package/dist/chunk-34YSDCDP.js.map +1 -0
- package/dist/{chunk-AVVPZ4BC.js → chunk-4TFSM22V.js} +4 -4
- package/dist/{chunk-QGZRWRSL.js → chunk-537VFZTR.js} +4 -4
- package/dist/{chunk-M62XNWRA.js → chunk-5DWL3JBF.js} +2 -2
- package/dist/{chunk-PTVMYYON.js → chunk-5SCJ5UEF.js} +3 -3
- package/dist/chunk-5ZGZ6HIZ.js +100 -0
- package/dist/chunk-5ZGZ6HIZ.js.map +1 -0
- package/dist/chunk-6HPZY4ON.js +291 -0
- package/dist/chunk-6HPZY4ON.js.map +1 -0
- package/dist/{chunk-EXHNQEV4.js → chunk-7H6DOO3E.js} +239 -11
- package/dist/chunk-7H6DOO3E.js.map +1 -0
- package/dist/{chunk-ACLDOTNQ.js → chunk-ADQ5MQ54.js} +275 -3
- package/dist/chunk-ADQ5MQ54.js.map +1 -0
- package/dist/chunk-CBAHB2BF.js +893 -0
- package/dist/chunk-CBAHB2BF.js.map +1 -0
- package/dist/chunk-DPMFBCV6.js +296 -0
- package/dist/chunk-DPMFBCV6.js.map +1 -0
- package/dist/chunk-DYBQG5PQ.js +34 -0
- package/dist/chunk-DYBQG5PQ.js.map +1 -0
- package/dist/{chunk-ZFKD4QMV.js → chunk-DYECX3IX.js} +3 -3
- package/dist/chunk-EGQYGYIU.js +51 -0
- package/dist/chunk-EGQYGYIU.js.map +1 -0
- package/dist/chunk-FCXOFQAJ.js +79 -0
- package/dist/chunk-FCXOFQAJ.js.map +1 -0
- package/dist/chunk-HB3Z2GCR.js +124 -0
- package/dist/chunk-HB3Z2GCR.js.map +1 -0
- package/dist/{chunk-SCZXXXU4.js → chunk-I6MX32UC.js} +7 -32
- package/dist/chunk-I6MX32UC.js.map +1 -0
- package/dist/{chunk-VQBTTTUN.js → chunk-KESP7GOK.js} +4 -4
- package/dist/{chunk-VQBTTTUN.js.map → chunk-KESP7GOK.js.map} +1 -1
- package/dist/{chunk-NXFEYLVG.js → chunk-MIQHZESA.js} +4 -3
- package/dist/{chunk-NXFEYLVG.js.map → chunk-MIQHZESA.js.map} +1 -1
- package/dist/chunk-MKSA2V7A.js +19 -0
- package/dist/chunk-MKSA2V7A.js.map +1 -0
- package/dist/{chunk-M5INGEFC.js → chunk-MRIBLZL3.js} +3 -1
- package/dist/chunk-MRIBLZL3.js.map +1 -0
- package/dist/{chunk-MDDTIZUO.js → chunk-NIOHFJPJ.js} +6 -6
- package/dist/chunk-OMLIZL2P.js +61 -0
- package/dist/chunk-OMLIZL2P.js.map +1 -0
- package/dist/{chunk-USKYUS74.js → chunk-P7EQ2S5O.js} +2 -2
- package/dist/{chunk-WDM5XGGS.js → chunk-PA6R5ZCI.js} +181 -11
- package/dist/chunk-PA6R5ZCI.js.map +1 -0
- package/dist/chunk-PEULZC6M.js +118 -0
- package/dist/chunk-PEULZC6M.js.map +1 -0
- package/dist/chunk-RD5LYKD6.js +82 -0
- package/dist/chunk-RD5LYKD6.js.map +1 -0
- package/dist/chunk-SIZWEV2Y.js +145 -0
- package/dist/chunk-SIZWEV2Y.js.map +1 -0
- package/dist/{chunk-QAVUREFT.js → chunk-UA4RI7OT.js} +12 -6
- package/dist/chunk-UA4RI7OT.js.map +1 -0
- package/dist/chunk-UMLVJTYV.js +20 -0
- package/dist/chunk-UMLVJTYV.js.map +1 -0
- package/dist/chunk-UZXLQCHP.js +53 -0
- package/dist/chunk-UZXLQCHP.js.map +1 -0
- package/dist/{chunk-2CSJGFCB.js → chunk-VMIO4IXG.js} +5 -5
- package/dist/{chunk-MR4424N3.js → chunk-WCA2NROQ.js} +2 -2
- package/dist/{chunk-TDR6T5CJ.js → chunk-XGSOTWYX.js} +91 -132
- package/dist/chunk-XGSOTWYX.js.map +1 -0
- package/dist/{chunk-NPC4LFV5.js → chunk-YMYK7US4.js} +2 -2
- package/dist/{chunk-RKJ6OL7K.js → chunk-YS3POABP.js} +1 -1
- package/dist/chunk-YS3POABP.js.map +1 -0
- package/dist/chunk-Z72JH4KG.js +209 -0
- package/dist/chunk-Z72JH4KG.js.map +1 -0
- package/dist/{chunk-R36SIKES.js → chunk-ZNOEIM6Y.js} +2 -2
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-IVKU7YTT.js → crypto-A7FRXYHC.js} +3 -3
- package/dist/{delegation-2DBS2EOH.js → delegation-YBA4X4JN.js} +5 -4
- package/dist/derivations/index.cjs +351 -0
- package/dist/derivations/index.cjs.map +1 -0
- package/dist/derivations/index.d.cts +71 -0
- package/dist/derivations/index.d.ts +71 -0
- package/dist/derivations/index.js +27 -0
- package/dist/{dev-unlock-BdPp68qn.d.ts → dev-unlock-D9s-loPr.d.ts} +1 -1
- package/dist/{dev-unlock-Da1B0TIK.d.cts → dev-unlock-DRwVSy2S.d.cts} +1 -1
- package/dist/executor-7E3VFGW7.js +11 -0
- package/dist/executor-CEWX2FQI.js +8 -0
- package/dist/executor-CEWX2FQI.js.map +1 -0
- package/dist/executor-X4SQ3ZLC.js +8 -0
- package/dist/executor-X4SQ3ZLC.js.map +1 -0
- package/dist/fanout-sidecar-VJ52RIEY.js +51 -0
- package/dist/fanout-sidecar-VJ52RIEY.js.map +1 -0
- package/dist/guards/index.cjs +315 -0
- package/dist/guards/index.cjs.map +1 -0
- package/dist/guards/index.d.cts +30 -0
- package/dist/guards/index.d.ts +30 -0
- package/dist/guards/index.js +29 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/{hash-lsoL3eEW.d.ts → hash-DXXXusyk.d.ts} +1 -1
- package/dist/{hash-BEfzPKwo.d.cts → hash-DtRih9MQ.d.cts} +1 -1
- package/dist/history/index.cjs +8 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +7 -7
- package/dist/history/index.d.ts +7 -7
- package/dist/history/index.js +6 -6
- package/dist/i18n/index.cjs +81 -0
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +6 -6
- package/dist/i18n/index.d.ts +6 -6
- package/dist/i18n/index.js +19 -6
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-8QDuznDr.d.ts → index-4agOpzqd.d.ts} +174 -3
- package/dist/{index-6xNpPsxR.d.cts → index-CNwA-B6-.d.ts} +303 -5
- package/dist/{index-DJTf9yxn.d.ts → index-CmVgTkqk.d.cts} +303 -5
- package/dist/{index-CywCC1qZ.d.cts → index-hdFvZkBP.d.cts} +174 -3
- package/dist/index.cjs +5615 -979
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +207 -16
- package/dist/index.d.ts +207 -16
- package/dist/index.js +2302 -741
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +2 -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/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-C-rPfWG0.d.cts} +1 -1
- package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Rpd-V3jP.d.ts} +1 -1
- package/dist/{ledger-QZTTHQAQ.js → ledger-3TXNP47J.js} +6 -6
- package/dist/ledger-3TXNP47J.js.map +1 -0
- package/dist/materialized-views/index.cjs +837 -0
- package/dist/materialized-views/index.cjs.map +1 -0
- package/dist/materialized-views/index.d.cts +183 -0
- package/dist/materialized-views/index.d.ts +183 -0
- package/dist/materialized-views/index.js +45 -0
- package/dist/materialized-views/index.js.map +1 -0
- package/dist/overlay-views/index.cjs +359 -0
- package/dist/overlay-views/index.cjs.map +1 -0
- package/dist/overlay-views/index.d.cts +81 -0
- package/dist/overlay-views/index.d.ts +81 -0
- package/dist/overlay-views/index.js +23 -0
- package/dist/overlay-views/index.js.map +1 -0
- package/dist/periods/index.cjs +7 -1
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +6 -6
- package/dist/periods/index.d.ts +6 -6
- package/dist/periods/index.js +6 -6
- package/dist/{predicate-SBHmi6D0.d.cts → predicate-Dnu81tsS.d.cts} +25 -1
- package/dist/{predicate-SBHmi6D0.d.ts → predicate-Dnu81tsS.d.ts} +25 -1
- package/dist/{public-envelope-6JTACYJV.js → public-envelope-PY6NKFLI.js} +4 -4
- package/dist/public-envelope-PY6NKFLI.js.map +1 -0
- package/dist/query/index.cjs +302 -124
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +26 -11
- package/dist/read-only-facade-ITU6L7BL.js +7 -0
- package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
- package/dist/registry-3L3N3PTG.js +10 -0
- package/dist/registry-3L3N3PTG.js.map +1 -0
- package/dist/registry-O47PUPSY.js +8 -0
- package/dist/registry-O47PUPSY.js.map +1 -0
- package/dist/registry-RFGGMVNJ.js +7 -0
- package/dist/registry-RFGGMVNJ.js.map +1 -0
- package/dist/registry-WLLMODKN.js +8 -0
- package/dist/registry-WLLMODKN.js.map +1 -0
- package/dist/session/index.cjs +7 -1
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +7 -7
- package/dist/session/index.d.ts +7 -7
- package/dist/session/index.js +10 -3
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +6 -6
- package/dist/shadow/index.d.ts +6 -6
- package/dist/shadow/index.js +2 -2
- package/dist/stale-HSC5YO2O.js +13 -0
- package/dist/stale-HSC5YO2O.js.map +1 -0
- package/dist/store/index.cjs +14 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +6 -6
- package/dist/store/index.d.ts +6 -6
- package/dist/store/index.js +5 -2
- package/dist/{strategy-D-SrOLCl.d.cts → strategy-DSTrsZ8t.d.cts} +72 -19
- package/dist/{strategy-D-SrOLCl.d.ts → strategy-DSTrsZ8t.d.ts} +72 -19
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +5 -5
- package/dist/sync/index.d.ts +5 -5
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +1554 -2
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +6 -6
- package/dist/team/index.d.ts +6 -6
- package/dist/team/index.js +76 -9
- package/dist/tx/index.cjs +296 -44
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +6 -6
- package/dist/tx/index.d.ts +6 -6
- package/dist/tx/index.js +2 -2
- package/dist/{types-Bnb82f5R.d.cts → types-C4lwMKKF.d.cts} +2605 -328
- package/dist/{types-Bo7NSXJr.d.ts → types-DW9RGSSs.d.ts} +2605 -328
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/with-derivation-C8LDlV7t.d.cts +13 -0
- package/dist/with-derivation-g-pGoMzL.d.ts +13 -0
- package/dist/with-guard-DWOCK4Ca.d.ts +18 -0
- package/dist/with-guard-jI1x9Z3k.d.cts +18 -0
- package/dist/with-materialized-view-DaKR-N6J.d.ts +27 -0
- package/dist/with-materialized-view-DcTx4H3j.d.cts +27 -0
- package/dist/with-overlayed-view-D-6oWAgM.d.cts +13 -0
- package/dist/with-overlayed-view-N7jYuNOS.d.ts +13 -0
- package/package.json +53 -2
- package/dist/chunk-4PWAI7Q4.js +0 -79
- package/dist/chunk-4PWAI7Q4.js.map +0 -1
- package/dist/chunk-ACLDOTNQ.js.map +0 -1
- package/dist/chunk-BTDCBVJW.js +0 -160
- package/dist/chunk-BTDCBVJW.js.map +0 -1
- package/dist/chunk-CIMZBAZB.js.map +0 -1
- package/dist/chunk-EXHNQEV4.js.map +0 -1
- package/dist/chunk-GOUT6DND.js.map +0 -1
- package/dist/chunk-M5INGEFC.js.map +0 -1
- package/dist/chunk-QAVUREFT.js.map +0 -1
- package/dist/chunk-RKJ6OL7K.js.map +0 -1
- package/dist/chunk-SCZXXXU4.js.map +0 -1
- package/dist/chunk-TDR6T5CJ.js.map +0 -1
- package/dist/chunk-WDM5XGGS.js.map +0 -1
- /package/dist/{chunk-AVVPZ4BC.js.map → chunk-4TFSM22V.js.map} +0 -0
- /package/dist/{chunk-QGZRWRSL.js.map → chunk-537VFZTR.js.map} +0 -0
- /package/dist/{chunk-M62XNWRA.js.map → chunk-5DWL3JBF.js.map} +0 -0
- /package/dist/{chunk-PTVMYYON.js.map → chunk-5SCJ5UEF.js.map} +0 -0
- /package/dist/{chunk-ZFKD4QMV.js.map → chunk-DYECX3IX.js.map} +0 -0
- /package/dist/{chunk-MDDTIZUO.js.map → chunk-NIOHFJPJ.js.map} +0 -0
- /package/dist/{chunk-USKYUS74.js.map → chunk-P7EQ2S5O.js.map} +0 -0
- /package/dist/{chunk-2CSJGFCB.js.map → chunk-VMIO4IXG.js.map} +0 -0
- /package/dist/{chunk-MR4424N3.js.map → chunk-WCA2NROQ.js.map} +0 -0
- /package/dist/{chunk-NPC4LFV5.js.map → chunk-YMYK7US4.js.map} +0 -0
- /package/dist/{chunk-R36SIKES.js.map → chunk-ZNOEIM6Y.js.map} +0 -0
- /package/dist/{crypto-IVKU7YTT.js.map → crypto-A7FRXYHC.js.map} +0 -0
- /package/dist/{delegation-2DBS2EOH.js.map → delegation-YBA4X4JN.js.map} +0 -0
- /package/dist/{ledger-QZTTHQAQ.js.map → derivations/index.js.map} +0 -0
- /package/dist/{public-envelope-6JTACYJV.js.map → executor-7E3VFGW7.js.map} +0 -0
package/dist/history/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-
|
|
4
|
-
import '../lazy-builder-
|
|
5
|
-
import '../predicate-
|
|
6
|
-
import '../strategy-
|
|
1
|
+
import { aN as HistoryStrategy, aO as NoydbStore, aP as HistoryOptions, aQ as EncryptedEnvelope, aR as PruneOptions } from '../types-C4lwMKKF.cjs';
|
|
2
|
+
export { aS as AppendInput, aT as ChangeType, aU as CollectionInstant, aV as DiffEntry, aW as JsonPatch, aX as JsonPatchOp, aY as LedgerEntry, aZ as LedgerStore, a_ as VaultEngine, a$ as VaultInstant, b0 as VerifyResult, b1 as applyPatch, b2 as canonicalJson, b3 as computePatch, b4 as diff, b5 as formatDiff, b6 as hashEntry, b7 as paddedIndex, b8 as parseIndex, b9 as sha256Hex } from '../types-C4lwMKKF.cjs';
|
|
3
|
+
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-DtRih9MQ.cjs';
|
|
4
|
+
import '../lazy-builder-C-rPfWG0.cjs';
|
|
5
|
+
import '../predicate-Dnu81tsS.cjs';
|
|
6
|
+
import '../strategy-DSTrsZ8t.cjs';
|
|
7
7
|
import '../strategy-BSxFXGzb.cjs';
|
|
8
|
-
import '../index-
|
|
8
|
+
import '../index-CmVgTkqk.cjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Active history strategy — `withHistory()` returns the real
|
package/dist/history/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-
|
|
4
|
-
import '../lazy-builder-
|
|
5
|
-
import '../predicate-
|
|
6
|
-
import '../strategy-
|
|
1
|
+
import { aN as HistoryStrategy, aO as NoydbStore, aP as HistoryOptions, aQ as EncryptedEnvelope, aR as PruneOptions } from '../types-DW9RGSSs.js';
|
|
2
|
+
export { aS as AppendInput, aT as ChangeType, aU as CollectionInstant, aV as DiffEntry, aW as JsonPatch, aX as JsonPatchOp, aY as LedgerEntry, aZ as LedgerStore, a_ as VaultEngine, a$ as VaultInstant, b0 as VerifyResult, b1 as applyPatch, b2 as canonicalJson, b3 as computePatch, b4 as diff, b5 as formatDiff, b6 as hashEntry, b7 as paddedIndex, b8 as parseIndex, b9 as sha256Hex } from '../types-DW9RGSSs.js';
|
|
3
|
+
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-DXXXusyk.js';
|
|
4
|
+
import '../lazy-builder-Rpd-V3jP.js';
|
|
5
|
+
import '../predicate-Dnu81tsS.js';
|
|
6
|
+
import '../strategy-DSTrsZ8t.js';
|
|
7
7
|
import '../strategy-BSxFXGzb.js';
|
|
8
|
-
import '../index-
|
|
8
|
+
import '../index-CNwA-B6-.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Active history strategy — `withHistory()` returns the real
|
package/dist/history/index.js
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
getVersionEnvelope,
|
|
9
9
|
pruneHistory,
|
|
10
10
|
saveHistory
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-MIQHZESA.js";
|
|
12
12
|
import {
|
|
13
13
|
LEDGER_COLLECTION,
|
|
14
14
|
LEDGER_DELTAS_COLLECTION,
|
|
15
15
|
LedgerStore,
|
|
16
16
|
applyPatch,
|
|
17
17
|
computePatch
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-UA4RI7OT.js";
|
|
19
19
|
import {
|
|
20
20
|
canonicalJson,
|
|
21
21
|
envelopePayloadHash,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
paddedIndex,
|
|
24
24
|
parseIndex,
|
|
25
25
|
sha256Hex
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
26
|
+
} from "../chunk-2AXFIYHT.js";
|
|
27
|
+
import "../chunk-YS3POABP.js";
|
|
28
|
+
import "../chunk-WCA2NROQ.js";
|
|
29
|
+
import "../chunk-ADQ5MQ54.js";
|
|
30
30
|
|
|
31
31
|
// src/history/active.ts
|
|
32
32
|
function withHistory() {
|
package/dist/i18n/index.cjs
CHANGED
|
@@ -21,7 +21,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var i18n_exports = {};
|
|
22
22
|
__export(i18n_exports, {
|
|
23
23
|
DICT_COLLECTION_PREFIX: () => DICT_COLLECTION_PREFIX,
|
|
24
|
+
DictKeyInUseError: () => DictKeyInUseError,
|
|
25
|
+
DictKeyMissingError: () => DictKeyMissingError,
|
|
24
26
|
DictionaryHandle: () => DictionaryHandle,
|
|
27
|
+
LocaleNotSpecifiedError: () => LocaleNotSpecifiedError,
|
|
28
|
+
MissingTranslationError: () => MissingTranslationError,
|
|
29
|
+
ReservedCollectionNameError: () => ReservedCollectionNameError,
|
|
30
|
+
TranslatorNotConfiguredError: () => TranslatorNotConfiguredError,
|
|
25
31
|
applyI18nLocale: () => applyI18nLocale,
|
|
26
32
|
dictCollectionName: () => dictCollectionName,
|
|
27
33
|
dictKey: () => dictKey,
|
|
@@ -69,6 +75,18 @@ var ValidationError = class extends NoydbError {
|
|
|
69
75
|
this.name = "ValidationError";
|
|
70
76
|
}
|
|
71
77
|
};
|
|
78
|
+
var ReservedCollectionNameError = class extends NoydbError {
|
|
79
|
+
/** The rejected collection name. */
|
|
80
|
+
collectionName;
|
|
81
|
+
constructor(collectionName) {
|
|
82
|
+
super(
|
|
83
|
+
"RESERVED_COLLECTION_NAME",
|
|
84
|
+
`"${collectionName}" is a reserved collection name. Use vault.dictionary("${collectionName.replace(/^_dict_/, "")}") to access dictionary collections.`
|
|
85
|
+
);
|
|
86
|
+
this.name = "ReservedCollectionNameError";
|
|
87
|
+
this.collectionName = collectionName;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
72
90
|
var DictKeyMissingError = class extends NoydbError {
|
|
73
91
|
/** The dictionary name. */
|
|
74
92
|
dictionaryName;
|
|
@@ -84,6 +102,27 @@ var DictKeyMissingError = class extends NoydbError {
|
|
|
84
102
|
this.key = key;
|
|
85
103
|
}
|
|
86
104
|
};
|
|
105
|
+
var DictKeyInUseError = class extends NoydbError {
|
|
106
|
+
/** The dictionary name. */
|
|
107
|
+
dictionaryName;
|
|
108
|
+
/** The key that is still referenced. */
|
|
109
|
+
key;
|
|
110
|
+
/** Name of the first collection found to reference this key. */
|
|
111
|
+
usedBy;
|
|
112
|
+
/** Number of records in `usedBy` that reference this key. */
|
|
113
|
+
count;
|
|
114
|
+
constructor(dictionaryName, key, usedBy, count) {
|
|
115
|
+
super(
|
|
116
|
+
"DICT_KEY_IN_USE",
|
|
117
|
+
`Cannot delete key "${key}" from dictionary "${dictionaryName}": ${count} record(s) in "${usedBy}" still reference it. Use dictionary.rename("${key}", newKey) to rewrite references first.`
|
|
118
|
+
);
|
|
119
|
+
this.name = "DictKeyInUseError";
|
|
120
|
+
this.dictionaryName = dictionaryName;
|
|
121
|
+
this.key = key;
|
|
122
|
+
this.usedBy = usedBy;
|
|
123
|
+
this.count = count;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
87
126
|
var MissingTranslationError = class extends NoydbError {
|
|
88
127
|
/** The field name whose translation(s) are missing. */
|
|
89
128
|
field;
|
|
@@ -111,6 +150,21 @@ var LocaleNotSpecifiedError = class extends NoydbError {
|
|
|
111
150
|
this.field = field;
|
|
112
151
|
}
|
|
113
152
|
};
|
|
153
|
+
var TranslatorNotConfiguredError = class extends NoydbError {
|
|
154
|
+
/** The field that requested auto-translation. */
|
|
155
|
+
field;
|
|
156
|
+
/** The collection the put was targeting. */
|
|
157
|
+
collection;
|
|
158
|
+
constructor(field, collection) {
|
|
159
|
+
super(
|
|
160
|
+
"TRANSLATOR_NOT_CONFIGURED",
|
|
161
|
+
`Field "${field}" in collection "${collection}" has autoTranslate: true, but no plaintextTranslator was configured on createNoydb(). Either configure a plaintextTranslator or remove autoTranslate from the schema.`
|
|
162
|
+
);
|
|
163
|
+
this.name = "TranslatorNotConfiguredError";
|
|
164
|
+
this.field = field;
|
|
165
|
+
this.collection = collection;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
114
168
|
|
|
115
169
|
// src/i18n/core.ts
|
|
116
170
|
function i18nText(options) {
|
|
@@ -290,6 +344,25 @@ function base64ToBuffer(base64) {
|
|
|
290
344
|
}
|
|
291
345
|
|
|
292
346
|
// src/team/keyring.ts
|
|
347
|
+
var CANARY_PLAINTEXT_BYTES = new Uint8Array(32);
|
|
348
|
+
var canaryKeyPromise = null;
|
|
349
|
+
function getCanaryKey() {
|
|
350
|
+
if (canaryKeyPromise === null) {
|
|
351
|
+
canaryKeyPromise = globalThis.crypto.subtle.importKey(
|
|
352
|
+
"raw",
|
|
353
|
+
CANARY_PLAINTEXT_BYTES,
|
|
354
|
+
{ name: "AES-GCM", length: 256 },
|
|
355
|
+
true,
|
|
356
|
+
// extractable so AES-KW can wrap it
|
|
357
|
+
["encrypt", "decrypt"]
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
return canaryKeyPromise;
|
|
361
|
+
}
|
|
362
|
+
async function mintKeyringCanary(kek) {
|
|
363
|
+
const canaryKey = await getCanaryKey();
|
|
364
|
+
return wrapKey(canaryKey, kek);
|
|
365
|
+
}
|
|
293
366
|
async function ensureCollectionDEK(adapter, vault, keyring) {
|
|
294
367
|
const inFlight = /* @__PURE__ */ new Map();
|
|
295
368
|
return async (collectionName) => {
|
|
@@ -321,6 +394,7 @@ async function persistKeyring(adapter, vault, keyring) {
|
|
|
321
394
|
for (const [collName, dek] of keyring.deks) {
|
|
322
395
|
wrappedDeks[collName] = await wrapKey(dek, keyring.kek);
|
|
323
396
|
}
|
|
397
|
+
const canary = await mintKeyringCanary(keyring.kek);
|
|
324
398
|
const keyringFile = {
|
|
325
399
|
_noydb_keyring: NOYDB_KEYRING_VERSION,
|
|
326
400
|
user_id: keyring.userId,
|
|
@@ -331,6 +405,7 @@ async function persistKeyring(adapter, vault, keyring) {
|
|
|
331
405
|
salt: bufferToBase64(keyring.salt),
|
|
332
406
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
333
407
|
granted_by: keyring.userId,
|
|
408
|
+
canary,
|
|
334
409
|
...keyring.exportCapability !== void 0 && { export_capability: keyring.exportCapability },
|
|
335
410
|
...keyring.importCapability !== void 0 && { import_capability: keyring.importCapability },
|
|
336
411
|
...keyring.authenticators.length > 0 && { authenticators: keyring.authenticators },
|
|
@@ -744,7 +819,13 @@ function withI18n() {
|
|
|
744
819
|
// Annotate the CommonJS export names for ESM import in node:
|
|
745
820
|
0 && (module.exports = {
|
|
746
821
|
DICT_COLLECTION_PREFIX,
|
|
822
|
+
DictKeyInUseError,
|
|
823
|
+
DictKeyMissingError,
|
|
747
824
|
DictionaryHandle,
|
|
825
|
+
LocaleNotSpecifiedError,
|
|
826
|
+
MissingTranslationError,
|
|
827
|
+
ReservedCollectionNameError,
|
|
828
|
+
TranslatorNotConfiguredError,
|
|
748
829
|
applyI18nLocale,
|
|
749
830
|
dictCollectionName,
|
|
750
831
|
dictKey,
|