@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/team/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import '../lazy-builder-
|
|
4
|
-
import '../predicate-
|
|
5
|
-
import '../strategy-
|
|
1
|
+
import { aO as NoydbStore, aM as UnlockedKeyring } from '../types-C4lwMKKF.cjs';
|
|
2
|
+
export { bu as BundleRecipient, bR as EnrollAuthenticatorOptions, bS as EnrollAuthenticatorWrappingDEKsOptions, bT as EnrollAuthenticatorWrappingKEKOptions, ci as ListUsersOptions, cG as PaperRecoveryEntry, cO as PresenceHandle, d7 as RecoverPassphraseInput, d8 as RecoverPassphraseResult, d9 as RecoverUserOptions, da as RecoveryProof, dd as RotatePassphraseInput, dq as SlotRewrapCeremony, dr as SlotRewrapContext, dy as SyncEngine, dG as SyncTransaction, dO as UpdateAuthenticatorOptions, e0 as WrappedDeksBlob, e2 as buildRecipientKeyringFile, e3 as burnPaperRecoveryEntry, eO as changeSecret, eP as createOwnerKeyring, e6 as deriveMagicLinkContentKey, e7 as enrollAuthenticator, eQ as ensureCollectionDEK, e9 as evaluateExportCapability, ea as evaluateImportCapability, eb as findAuthenticator, eR as grant, ec as hasExportCapability, ed as hasImportCapability, ef as isMagicLinkGrantExpired, ek as listMagicLinkGrants, el as listUsers, em as listUsersWithEnvelopes, eS as loadKeyring, eo as loadPaperRecoveryEntries, er as magicLinkGrantRecordId, es as mintPaperRecoveryEntry, eu as mintWrappedDeksBlob, eT as persistKeyring, ew as readMagicLinkGrantRecord, ei as recoverPassphrase, ex as recoverUser, ey as removeAuthenticator, eU as revoke, eB as revokeMagicLinkGrant, ej as rotatePassphrase, eC as savePaperRecoveryEntries, eF as unwrapDeksFromBlob, eG as unwrapDeksFromPaperEntry, eI as unwrapMagicLinkGrant, eV as updateAuthenticator, eW as updateKeyringIdentity, eN as writeMagicLinkGrant } from '../types-C4lwMKKF.cjs';
|
|
3
|
+
import '../lazy-builder-C-rPfWG0.cjs';
|
|
4
|
+
import '../predicate-Dnu81tsS.cjs';
|
|
5
|
+
import '../strategy-DSTrsZ8t.cjs';
|
|
6
6
|
import '../strategy-BSxFXGzb.cjs';
|
|
7
|
-
import '../index-
|
|
7
|
+
import '../index-CmVgTkqk.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* _sync_credentials reserved collection —
|
package/dist/team/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import '../lazy-builder-
|
|
4
|
-
import '../predicate-
|
|
5
|
-
import '../strategy-
|
|
1
|
+
import { aO as NoydbStore, aM as UnlockedKeyring } from '../types-DW9RGSSs.js';
|
|
2
|
+
export { bu as BundleRecipient, bR as EnrollAuthenticatorOptions, bS as EnrollAuthenticatorWrappingDEKsOptions, bT as EnrollAuthenticatorWrappingKEKOptions, ci as ListUsersOptions, cG as PaperRecoveryEntry, cO as PresenceHandle, d7 as RecoverPassphraseInput, d8 as RecoverPassphraseResult, d9 as RecoverUserOptions, da as RecoveryProof, dd as RotatePassphraseInput, dq as SlotRewrapCeremony, dr as SlotRewrapContext, dy as SyncEngine, dG as SyncTransaction, dO as UpdateAuthenticatorOptions, e0 as WrappedDeksBlob, e2 as buildRecipientKeyringFile, e3 as burnPaperRecoveryEntry, eO as changeSecret, eP as createOwnerKeyring, e6 as deriveMagicLinkContentKey, e7 as enrollAuthenticator, eQ as ensureCollectionDEK, e9 as evaluateExportCapability, ea as evaluateImportCapability, eb as findAuthenticator, eR as grant, ec as hasExportCapability, ed as hasImportCapability, ef as isMagicLinkGrantExpired, ek as listMagicLinkGrants, el as listUsers, em as listUsersWithEnvelopes, eS as loadKeyring, eo as loadPaperRecoveryEntries, er as magicLinkGrantRecordId, es as mintPaperRecoveryEntry, eu as mintWrappedDeksBlob, eT as persistKeyring, ew as readMagicLinkGrantRecord, ei as recoverPassphrase, ex as recoverUser, ey as removeAuthenticator, eU as revoke, eB as revokeMagicLinkGrant, ej as rotatePassphrase, eC as savePaperRecoveryEntries, eF as unwrapDeksFromBlob, eG as unwrapDeksFromPaperEntry, eI as unwrapMagicLinkGrant, eV as updateAuthenticator, eW as updateKeyringIdentity, eN as writeMagicLinkGrant } from '../types-DW9RGSSs.js';
|
|
3
|
+
import '../lazy-builder-Rpd-V3jP.js';
|
|
4
|
+
import '../predicate-Dnu81tsS.js';
|
|
5
|
+
import '../strategy-DSTrsZ8t.js';
|
|
6
6
|
import '../strategy-BSxFXGzb.js';
|
|
7
|
-
import '../index-
|
|
7
|
+
import '../index-CNwA-B6-.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* _sync_credentials reserved collection —
|
package/dist/team/index.js
CHANGED
|
@@ -1,39 +1,106 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SYNC_CREDENTIALS_COLLECTION,
|
|
3
|
+
burnPaperRecoveryEntry,
|
|
3
4
|
credentialStatus,
|
|
4
5
|
deleteCredential,
|
|
6
|
+
deriveMagicLinkContentKey,
|
|
7
|
+
enrollAuthenticator,
|
|
8
|
+
findAuthenticator,
|
|
5
9
|
getCredential,
|
|
10
|
+
isMagicLinkGrantExpired,
|
|
6
11
|
listCredentials,
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
listMagicLinkGrants,
|
|
13
|
+
loadPaperRecoveryEntries,
|
|
14
|
+
magicLinkGrantRecordId,
|
|
15
|
+
mintPaperRecoveryEntry,
|
|
16
|
+
mintWrappedDeksBlob,
|
|
17
|
+
putCredential,
|
|
18
|
+
readMagicLinkGrantRecord,
|
|
19
|
+
recoverPassphrase,
|
|
20
|
+
recoverUser,
|
|
21
|
+
removeAuthenticator,
|
|
22
|
+
revokeMagicLinkGrant,
|
|
23
|
+
rotatePassphrase,
|
|
24
|
+
savePaperRecoveryEntries,
|
|
25
|
+
unwrapDeksFromBlob,
|
|
26
|
+
unwrapDeksFromPaperEntry,
|
|
27
|
+
unwrapMagicLinkGrant,
|
|
28
|
+
updateAuthenticator,
|
|
29
|
+
writeMagicLinkGrant
|
|
30
|
+
} from "../chunk-CBAHB2BF.js";
|
|
31
|
+
import "../chunk-DYBQG5PQ.js";
|
|
9
32
|
import {
|
|
10
33
|
PresenceHandle,
|
|
11
34
|
SyncEngine,
|
|
12
35
|
SyncTransaction
|
|
13
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-4TFSM22V.js";
|
|
14
37
|
import {
|
|
38
|
+
buildRecipientKeyringFile,
|
|
39
|
+
changeSecret,
|
|
40
|
+
createOwnerKeyring,
|
|
41
|
+
ensureCollectionDEK,
|
|
15
42
|
evaluateExportCapability,
|
|
16
43
|
evaluateImportCapability,
|
|
44
|
+
grant,
|
|
17
45
|
hasExportCapability,
|
|
18
|
-
hasImportCapability
|
|
19
|
-
|
|
46
|
+
hasImportCapability,
|
|
47
|
+
listUsers,
|
|
48
|
+
listUsersWithEnvelopes,
|
|
49
|
+
loadKeyring,
|
|
50
|
+
persistKeyring,
|
|
51
|
+
revoke,
|
|
52
|
+
updateKeyringIdentity
|
|
53
|
+
} from "../chunk-PA6R5ZCI.js";
|
|
20
54
|
import "../chunk-2QR2PQTT.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-YS3POABP.js";
|
|
56
|
+
import "../chunk-WCA2NROQ.js";
|
|
57
|
+
import "../chunk-ADQ5MQ54.js";
|
|
24
58
|
export {
|
|
25
59
|
PresenceHandle,
|
|
26
60
|
SYNC_CREDENTIALS_COLLECTION,
|
|
27
61
|
SyncEngine,
|
|
28
62
|
SyncTransaction,
|
|
63
|
+
buildRecipientKeyringFile,
|
|
64
|
+
burnPaperRecoveryEntry,
|
|
65
|
+
changeSecret,
|
|
66
|
+
createOwnerKeyring,
|
|
29
67
|
credentialStatus,
|
|
30
68
|
deleteCredential,
|
|
69
|
+
deriveMagicLinkContentKey,
|
|
70
|
+
enrollAuthenticator,
|
|
71
|
+
ensureCollectionDEK,
|
|
31
72
|
evaluateExportCapability,
|
|
32
73
|
evaluateImportCapability,
|
|
74
|
+
findAuthenticator,
|
|
33
75
|
getCredential,
|
|
76
|
+
grant,
|
|
34
77
|
hasExportCapability,
|
|
35
78
|
hasImportCapability,
|
|
79
|
+
isMagicLinkGrantExpired,
|
|
36
80
|
listCredentials,
|
|
37
|
-
|
|
81
|
+
listMagicLinkGrants,
|
|
82
|
+
listUsers,
|
|
83
|
+
listUsersWithEnvelopes,
|
|
84
|
+
loadKeyring,
|
|
85
|
+
loadPaperRecoveryEntries,
|
|
86
|
+
magicLinkGrantRecordId,
|
|
87
|
+
mintPaperRecoveryEntry,
|
|
88
|
+
mintWrappedDeksBlob,
|
|
89
|
+
persistKeyring,
|
|
90
|
+
putCredential,
|
|
91
|
+
readMagicLinkGrantRecord,
|
|
92
|
+
recoverPassphrase,
|
|
93
|
+
recoverUser,
|
|
94
|
+
removeAuthenticator,
|
|
95
|
+
revoke,
|
|
96
|
+
revokeMagicLinkGrant,
|
|
97
|
+
rotatePassphrase,
|
|
98
|
+
savePaperRecoveryEntries,
|
|
99
|
+
unwrapDeksFromBlob,
|
|
100
|
+
unwrapDeksFromPaperEntry,
|
|
101
|
+
unwrapMagicLinkGrant,
|
|
102
|
+
updateAuthenticator,
|
|
103
|
+
updateKeyringIdentity,
|
|
104
|
+
writeMagicLinkGrant
|
|
38
105
|
};
|
|
39
106
|
//# sourceMappingURL=index.js.map
|
package/dist/tx/index.cjs
CHANGED
|
@@ -3,6 +3,9 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __esm = (fn, res) => function __init() {
|
|
7
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
+
};
|
|
6
9
|
var __export = (target, all) => {
|
|
7
10
|
for (var name in all)
|
|
8
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,6 +20,147 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
20
|
};
|
|
18
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
22
|
|
|
23
|
+
// src/errors.ts
|
|
24
|
+
var NoydbError, FieldFrozenError, InvariantError, AmendmentForbiddenError, ConflictError, ValidationError;
|
|
25
|
+
var init_errors = __esm({
|
|
26
|
+
"src/errors.ts"() {
|
|
27
|
+
"use strict";
|
|
28
|
+
NoydbError = class extends Error {
|
|
29
|
+
/** Machine-readable error code. Stable across library versions. */
|
|
30
|
+
code;
|
|
31
|
+
constructor(code, message) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = "NoydbError";
|
|
34
|
+
this.code = code;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
FieldFrozenError = class extends NoydbError {
|
|
38
|
+
collection;
|
|
39
|
+
id;
|
|
40
|
+
fields;
|
|
41
|
+
constructor(collection, id, fields) {
|
|
42
|
+
super(
|
|
43
|
+
"FIELD_FROZEN",
|
|
44
|
+
`Cannot change frozen field(s) on ${collection}/${id}: ${fields.join(", ")}. Use withTransactions({ amendment: true, reason }) with admin/owner role to override.`
|
|
45
|
+
);
|
|
46
|
+
this.name = "FieldFrozenError";
|
|
47
|
+
this.collection = collection;
|
|
48
|
+
this.id = id;
|
|
49
|
+
this.fields = fields;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
InvariantError = class extends NoydbError {
|
|
53
|
+
constructor(message) {
|
|
54
|
+
super("INVARIANT_VIOLATED", message);
|
|
55
|
+
this.name = "InvariantError";
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
AmendmentForbiddenError = class extends NoydbError {
|
|
59
|
+
userId;
|
|
60
|
+
role;
|
|
61
|
+
constructor(userId, role) {
|
|
62
|
+
super(
|
|
63
|
+
"AMENDMENT_FORBIDDEN",
|
|
64
|
+
`User "${userId}" with role "${role}" cannot open an amendment transaction. Amendments require admin or owner role.`
|
|
65
|
+
);
|
|
66
|
+
this.name = "AmendmentForbiddenError";
|
|
67
|
+
this.userId = userId;
|
|
68
|
+
this.role = role;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
ConflictError = class extends NoydbError {
|
|
72
|
+
/** The actual stored version at the time of conflict. */
|
|
73
|
+
version;
|
|
74
|
+
constructor(version, message = "Version conflict") {
|
|
75
|
+
super("CONFLICT", message);
|
|
76
|
+
this.name = "ConflictError";
|
|
77
|
+
this.version = version;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
ValidationError = class extends NoydbError {
|
|
81
|
+
constructor(message = "Validation error") {
|
|
82
|
+
super("VALIDATION_ERROR", message);
|
|
83
|
+
this.name = "ValidationError";
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// src/guards/executor.ts
|
|
90
|
+
var executor_exports = {};
|
|
91
|
+
__export(executor_exports, {
|
|
92
|
+
GuardExecutor: () => GuardExecutor
|
|
93
|
+
});
|
|
94
|
+
function deepEqual(a, b) {
|
|
95
|
+
if (a === b) return true;
|
|
96
|
+
if (a === null || b === null) return a === b;
|
|
97
|
+
if (typeof a !== typeof b) return false;
|
|
98
|
+
if (typeof a !== "object") return a === b;
|
|
99
|
+
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
100
|
+
if (Array.isArray(a)) {
|
|
101
|
+
const aa = a;
|
|
102
|
+
const bb = b;
|
|
103
|
+
if (aa.length !== bb.length) return false;
|
|
104
|
+
for (let i = 0; i < aa.length; i++) if (!deepEqual(aa[i], bb[i])) return false;
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
const ao = a;
|
|
108
|
+
const bo = b;
|
|
109
|
+
const ak = Object.keys(ao);
|
|
110
|
+
const bk = Object.keys(bo);
|
|
111
|
+
if (ak.length !== bk.length) return false;
|
|
112
|
+
for (const k of ak) {
|
|
113
|
+
if (!Object.prototype.hasOwnProperty.call(bo, k)) return false;
|
|
114
|
+
if (!deepEqual(ao[k], bo[k])) return false;
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
var GuardExecutor;
|
|
119
|
+
var init_executor = __esm({
|
|
120
|
+
"src/guards/executor.ts"() {
|
|
121
|
+
"use strict";
|
|
122
|
+
init_errors();
|
|
123
|
+
GuardExecutor = {
|
|
124
|
+
/**
|
|
125
|
+
* Compare existing vs incoming for each `frozenFields.fields` entry
|
|
126
|
+
* when `frozenFields.when(existing)` is true. Throws
|
|
127
|
+
* `FieldFrozenError` listing every changed frozen field.
|
|
128
|
+
*/
|
|
129
|
+
async checkFrozenFields(guard, id, existing, incoming) {
|
|
130
|
+
const ff = guard.frozenFields;
|
|
131
|
+
if (!ff) return;
|
|
132
|
+
if (existing === null) return;
|
|
133
|
+
if (!ff.when(existing)) return;
|
|
134
|
+
const changed = [];
|
|
135
|
+
for (const f of ff.fields) {
|
|
136
|
+
if (existing[f] !== incoming[f]) {
|
|
137
|
+
if (!deepEqual(existing[f], incoming[f])) changed.push(String(f));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (changed.length > 0) {
|
|
141
|
+
throw new FieldFrozenError(guard.collection, id, changed);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Run a single guard's invariant over its slice of the change-set.
|
|
146
|
+
* Any throw is converted to `InvariantError` unless it already is one.
|
|
147
|
+
*/
|
|
148
|
+
async runInvariant(guard, changes, ctx) {
|
|
149
|
+
const amendment = guard.amendment;
|
|
150
|
+
if (!amendment) return;
|
|
151
|
+
try {
|
|
152
|
+
await amendment.invariant(changes, ctx);
|
|
153
|
+
} catch (err) {
|
|
154
|
+
if (err instanceof InvariantError) throw err;
|
|
155
|
+
throw new InvariantError(
|
|
156
|
+
err instanceof Error ? err.message : `invariant violated: ${String(err)}`
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
20
164
|
// src/tx/index.ts
|
|
21
165
|
var tx_exports = {};
|
|
22
166
|
__export(tx_exports, {
|
|
@@ -28,39 +172,52 @@ __export(tx_exports, {
|
|
|
28
172
|
});
|
|
29
173
|
module.exports = __toCommonJS(tx_exports);
|
|
30
174
|
|
|
31
|
-
// src/errors.ts
|
|
32
|
-
var NoydbError = class extends Error {
|
|
33
|
-
/** Machine-readable error code. Stable across library versions. */
|
|
34
|
-
code;
|
|
35
|
-
constructor(code, message) {
|
|
36
|
-
super(message);
|
|
37
|
-
this.name = "NoydbError";
|
|
38
|
-
this.code = code;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var ConflictError = class extends NoydbError {
|
|
42
|
-
/** The actual stored version at the time of conflict. */
|
|
43
|
-
version;
|
|
44
|
-
constructor(version, message = "Version conflict") {
|
|
45
|
-
super("CONFLICT", message);
|
|
46
|
-
this.name = "ConflictError";
|
|
47
|
-
this.version = version;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
175
|
// src/tx/transaction.ts
|
|
176
|
+
init_errors();
|
|
52
177
|
var TxContext = class {
|
|
53
178
|
/** @internal */
|
|
54
179
|
_ops = [];
|
|
180
|
+
/**
|
|
181
|
+
* @internal — write log built up in Phase 2. Each entry records the
|
|
182
|
+
* envelope captured BEFORE the write so a mid-batch failure can
|
|
183
|
+
* restore prior state via `revertExecuted`. Side-effect writes (e.g.
|
|
184
|
+
* recursive derivation outputs fired inside `Collection.put`) are
|
|
185
|
+
* appended here in execution order so they roll back alongside the
|
|
186
|
+
* main staged ops (#133).
|
|
187
|
+
*/
|
|
188
|
+
_executed = [];
|
|
55
189
|
/** @internal */
|
|
56
190
|
_db;
|
|
191
|
+
/**
|
|
192
|
+
* @internal — true when this TxContext was opened in amendment
|
|
193
|
+
* mode. Toggles the lazy-`beginAmendment` + role-check path on first
|
|
194
|
+
* `tx.vault(name)` and unlocks the post-Phase-2 invariant + audit run.
|
|
195
|
+
*/
|
|
196
|
+
_amendment;
|
|
197
|
+
/** @internal — vaults that have already had `beginAmendment` called. */
|
|
198
|
+
_amendmentVaults = /* @__PURE__ */ new Map();
|
|
57
199
|
/** @internal */
|
|
58
|
-
constructor(db) {
|
|
200
|
+
constructor(db, amendment = false) {
|
|
59
201
|
this._db = db;
|
|
202
|
+
this._amendment = amendment;
|
|
60
203
|
}
|
|
61
204
|
/** Scope subsequent `collection()` calls to the named vault. */
|
|
62
205
|
vault(name) {
|
|
63
206
|
const v = this._db.vault(name);
|
|
207
|
+
if (this._amendment && !this._amendmentVaults.has(name)) {
|
|
208
|
+
const role = v.role;
|
|
209
|
+
if (role !== "admin" && role !== "owner") {
|
|
210
|
+
throw new AmendmentForbiddenError(v.userId, role);
|
|
211
|
+
}
|
|
212
|
+
const reg = v._getGuardRegistry();
|
|
213
|
+
if (reg === null) {
|
|
214
|
+
throw new ValidationError(
|
|
215
|
+
`Vault "${name}": amendment mode requires at least one guardStrategy registered via createNoydb({ guardStrategies }). Open the vault with guardStrategies before calling db.transaction({ amendment: true }).`
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
reg.beginAmendment();
|
|
219
|
+
this._amendmentVaults.set(name, v);
|
|
220
|
+
}
|
|
64
221
|
return new TxVault(this, v);
|
|
65
222
|
}
|
|
66
223
|
};
|
|
@@ -124,6 +281,7 @@ var TxCollection = class {
|
|
|
124
281
|
record
|
|
125
282
|
};
|
|
126
283
|
if (options?.expectedVersion !== void 0) op.expectedVersion = options.expectedVersion;
|
|
284
|
+
if (options?.reason !== void 0) op.reason = options.reason;
|
|
127
285
|
this._ctx._ops.push(op);
|
|
128
286
|
}
|
|
129
287
|
/**
|
|
@@ -142,10 +300,28 @@ var TxCollection = class {
|
|
|
142
300
|
this._ctx._ops.push(op);
|
|
143
301
|
}
|
|
144
302
|
};
|
|
145
|
-
async function runTransaction(db, fn) {
|
|
146
|
-
|
|
303
|
+
async function runTransaction(db, fn, options) {
|
|
304
|
+
if (options?.amendment) {
|
|
305
|
+
if (typeof options.reason !== "string" || options.reason.trim().length === 0) {
|
|
306
|
+
throw new ValidationError(
|
|
307
|
+
"db.transaction({ amendment: true }) requires a non-empty `reason` string."
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
const ctx = new TxContext(db, options?.amendment === true);
|
|
147
312
|
const bodyResult = await fn(ctx);
|
|
148
|
-
if (ctx._ops.length === 0)
|
|
313
|
+
if (ctx._ops.length === 0) {
|
|
314
|
+
if (ctx._amendment) {
|
|
315
|
+
for (const v of ctx._amendmentVaults.values()) {
|
|
316
|
+
const reg = v._getGuardRegistry();
|
|
317
|
+
if (reg !== null) {
|
|
318
|
+
reg.consumeChanges();
|
|
319
|
+
reg.consumeMeta();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return bodyResult;
|
|
324
|
+
}
|
|
149
325
|
const priorEnvelopes = /* @__PURE__ */ new Map();
|
|
150
326
|
const store = db._store;
|
|
151
327
|
for (const op of ctx._ops) {
|
|
@@ -165,32 +341,108 @@ async function runTransaction(db, fn) {
|
|
|
165
341
|
}
|
|
166
342
|
}
|
|
167
343
|
}
|
|
168
|
-
|
|
344
|
+
db._setActiveTxContext(ctx);
|
|
169
345
|
try {
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
346
|
+
try {
|
|
347
|
+
for (const op of ctx._ops) {
|
|
348
|
+
const coll = db.vault(op.vaultName).collection(op.collectionName);
|
|
349
|
+
const key = keyOf(op);
|
|
350
|
+
const prior = priorEnvelopes.get(key) ?? null;
|
|
351
|
+
ctx._executed.push({ op, priorEnvelope: prior });
|
|
352
|
+
if (op.type === "put") {
|
|
353
|
+
await coll.put(op.id, op.record, op.reason !== void 0 ? { reason: op.reason } : void 0);
|
|
354
|
+
} else {
|
|
355
|
+
await coll.delete(op.id);
|
|
356
|
+
}
|
|
178
357
|
}
|
|
179
|
-
|
|
358
|
+
} catch (err) {
|
|
359
|
+
await revertExecuted(ctx._executed, store, db);
|
|
360
|
+
if (ctx._amendment) {
|
|
361
|
+
for (const v of ctx._amendmentVaults.values()) {
|
|
362
|
+
const reg = v._getGuardRegistry();
|
|
363
|
+
if (reg !== null) {
|
|
364
|
+
reg.consumeChanges();
|
|
365
|
+
reg.consumeMeta();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
throw err;
|
|
180
370
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
371
|
+
} finally {
|
|
372
|
+
db._clearActiveTxContext(ctx);
|
|
373
|
+
}
|
|
374
|
+
if (ctx._amendment) {
|
|
375
|
+
const { GuardExecutor: GuardExecutor2 } = await Promise.resolve().then(() => (init_executor(), executor_exports));
|
|
376
|
+
try {
|
|
377
|
+
for (const [vaultName, v] of ctx._amendmentVaults) {
|
|
378
|
+
const registry = v._getGuardRegistry();
|
|
379
|
+
if (registry === null) continue;
|
|
380
|
+
const changesByCollection = registry.consumeChanges();
|
|
381
|
+
const meta = registry.consumeMeta();
|
|
382
|
+
if (changesByCollection.size === 0) continue;
|
|
383
|
+
const readOnlyVault = v._getReadOnlyFacade();
|
|
384
|
+
if (readOnlyVault === null) continue;
|
|
385
|
+
const invariantsPassed = [];
|
|
386
|
+
for (const [collection, changes] of changesByCollection) {
|
|
387
|
+
const guards = registry.guardsFor(collection).filter((g) => g.amendment !== void 0);
|
|
388
|
+
for (const guard of guards) {
|
|
389
|
+
await GuardExecutor2.runInvariant(guard, changes, {
|
|
390
|
+
existing: null,
|
|
391
|
+
vault: readOnlyVault,
|
|
392
|
+
userId: v.userId,
|
|
393
|
+
role: v.role
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
if (guards.length > 0) invariantsPassed.push(collection);
|
|
397
|
+
}
|
|
398
|
+
const ledger = v._getLedgerOrNull();
|
|
399
|
+
if (ledger) {
|
|
400
|
+
const role = v.role;
|
|
401
|
+
const amendment = {
|
|
402
|
+
reason: options.reason,
|
|
403
|
+
role,
|
|
404
|
+
changes: meta,
|
|
405
|
+
invariantsPassed
|
|
406
|
+
};
|
|
407
|
+
await ledger.append({
|
|
408
|
+
op: "amendment",
|
|
409
|
+
collection: "",
|
|
410
|
+
id: "",
|
|
411
|
+
version: 0,
|
|
412
|
+
actor: v.userId,
|
|
413
|
+
// No payload to hash — the per-record entries already
|
|
414
|
+
// captured `payloadHash` at their own append time. We use
|
|
415
|
+
// a sha256 of the canonical reason string so the field is
|
|
416
|
+
// populated with something deterministic and non-empty.
|
|
417
|
+
payloadHash: "",
|
|
418
|
+
amendment
|
|
419
|
+
});
|
|
189
420
|
}
|
|
190
|
-
|
|
421
|
+
void vaultName;
|
|
422
|
+
}
|
|
423
|
+
} catch (err) {
|
|
424
|
+
await revertExecuted(ctx._executed, store, db);
|
|
425
|
+
throw err instanceof InvariantError ? err : new InvariantError(
|
|
426
|
+
err instanceof Error ? err.message : `invariant violated: ${String(err)}`
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return bodyResult;
|
|
431
|
+
}
|
|
432
|
+
async function revertExecuted(executed, store, db) {
|
|
433
|
+
for (const { op, priorEnvelope } of executed.slice().reverse()) {
|
|
434
|
+
try {
|
|
435
|
+
if (priorEnvelope) {
|
|
436
|
+
await store.put(op.vaultName, op.collectionName, op.id, priorEnvelope);
|
|
437
|
+
} else {
|
|
438
|
+
await store.delete(op.vaultName, op.collectionName, op.id);
|
|
439
|
+
}
|
|
440
|
+
if (db) {
|
|
441
|
+
const coll = db.vault(op.vaultName).collection(op.collectionName);
|
|
442
|
+
await coll._invalidateCacheEntry(op.id);
|
|
191
443
|
}
|
|
444
|
+
} catch {
|
|
192
445
|
}
|
|
193
|
-
throw err;
|
|
194
446
|
}
|
|
195
447
|
}
|
|
196
448
|
function keyOf(op) {
|