@noy-db/hub 0.2.0-pre.15 → 0.2.0-pre.16

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.
Files changed (197) hide show
  1. package/dist/aggregate/index.cjs +106 -10
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +1 -1
  6. package/dist/attestation/index.cjs.map +1 -1
  7. package/dist/attestation/index.d.cts +3 -3
  8. package/dist/attestation/index.d.ts +3 -3
  9. package/dist/attestation/index.js +4 -4
  10. package/dist/blobs/index.cjs.map +1 -1
  11. package/dist/blobs/index.d.cts +4 -4
  12. package/dist/blobs/index.d.ts +4 -4
  13. package/dist/blobs/index.js +3 -3
  14. package/dist/bundle/index.cjs +181 -46
  15. package/dist/bundle/index.cjs.map +1 -1
  16. package/dist/bundle/index.d.cts +5 -5
  17. package/dist/bundle/index.d.ts +5 -5
  18. package/dist/bundle/index.js +7 -7
  19. package/dist/{chunk-BIYRQQV6.js → chunk-3YWP3WBP.js} +3 -3
  20. package/dist/{chunk-VU7SWWT5.js → chunk-42FEUPZQ.js} +10 -6
  21. package/dist/chunk-42FEUPZQ.js.map +1 -0
  22. package/dist/{chunk-7EFFHEN5.js → chunk-667MB6AH.js} +118 -47
  23. package/dist/chunk-667MB6AH.js.map +1 -0
  24. package/dist/{chunk-A5ZOOZFB.js → chunk-6H2ZUNR7.js} +2 -2
  25. package/dist/{chunk-7HT2MEZ5.js → chunk-7BQ4QWYX.js} +3 -3
  26. package/dist/{chunk-DQU36Q7I.js → chunk-7Z7KSVA5.js} +13 -4
  27. package/dist/chunk-7Z7KSVA5.js.map +1 -0
  28. package/dist/{chunk-WBAYSNUQ.js → chunk-BI6ETQPF.js} +2 -2
  29. package/dist/{chunk-56DJ7JVK.js → chunk-BR3AMFGS.js} +2 -2
  30. package/dist/{chunk-COFPAMX6.js → chunk-DLZ2ONOD.js} +3 -3
  31. package/dist/{chunk-EYVQHAGH.js → chunk-DUREQF5W.js} +2 -2
  32. package/dist/{chunk-PE4AQGFH.js → chunk-E2CDVKMH.js} +3 -3
  33. package/dist/{chunk-GC4V7RU7.js → chunk-F3BPIPLS.js} +1 -1
  34. package/dist/{chunk-GC4V7RU7.js.map → chunk-F3BPIPLS.js.map} +1 -1
  35. package/dist/{chunk-L2FE64BU.js → chunk-FFXM3ZIF.js} +2 -2
  36. package/dist/{chunk-5LQG6ZO2.js → chunk-G4SCICH5.js} +8 -3
  37. package/dist/chunk-G4SCICH5.js.map +1 -0
  38. package/dist/{chunk-WGHU7BLI.js → chunk-GNI5STXQ.js} +2 -2
  39. package/dist/{chunk-C5T5AFWN.js → chunk-HBXJ37ZY.js} +11 -5
  40. package/dist/chunk-HBXJ37ZY.js.map +1 -0
  41. package/dist/{chunk-7PS7EOCF.js → chunk-IXBIFDEW.js} +2 -2
  42. package/dist/{chunk-LX3CB26H.js → chunk-KABJXG2F.js} +2 -2
  43. package/dist/{chunk-3EWXMOK3.js → chunk-L2BNJ6HM.js} +26 -11
  44. package/dist/chunk-L2BNJ6HM.js.map +1 -0
  45. package/dist/{chunk-DKO2QFSA.js → chunk-OB2ZJQ2D.js} +2 -2
  46. package/dist/{chunk-KIP6JLTF.js → chunk-OMAMZKKD.js} +2 -2
  47. package/dist/{chunk-EGD5DXFT.js → chunk-OQSRJG6A.js} +13 -1
  48. package/dist/chunk-OQSRJG6A.js.map +1 -0
  49. package/dist/{chunk-KI6HAJWL.js → chunk-QSUK7YWK.js} +2 -2
  50. package/dist/{chunk-YHPM5D7Y.js → chunk-QVIEAYTP.js} +61 -2
  51. package/dist/chunk-QVIEAYTP.js.map +1 -0
  52. package/dist/{chunk-NSCVNK5K.js → chunk-SCJPI4Z5.js} +3 -3
  53. package/dist/{chunk-NU6Q3FOR.js → chunk-TKIY625R.js} +11 -1
  54. package/dist/{chunk-NU6Q3FOR.js.map → chunk-TKIY625R.js.map} +1 -1
  55. package/dist/{chunk-OHVFWCJP.js → chunk-VLMPU56Q.js} +48 -18
  56. package/dist/chunk-VLMPU56Q.js.map +1 -0
  57. package/dist/{chunk-6AJBSQU4.js → chunk-XL35NSEN.js} +2 -2
  58. package/dist/consent/index.d.cts +4 -4
  59. package/dist/consent/index.d.ts +4 -4
  60. package/dist/derivations/index.cjs +24 -3
  61. package/dist/derivations/index.cjs.map +1 -1
  62. package/dist/derivations/index.d.cts +5 -5
  63. package/dist/derivations/index.d.ts +5 -5
  64. package/dist/derivations/index.js +2 -2
  65. package/dist/{dev-unlock-nVkuRLLe.d.cts → dev-unlock-8XzcD2Z4.d.cts} +1 -1
  66. package/dist/{dev-unlock-iAS8z9jc.d.ts → dev-unlock-DR3upLd1.d.ts} +1 -1
  67. package/dist/{executor-HSSRXDOB.js → executor-AZLS3KBK.js} +4 -4
  68. package/dist/{fanout-sidecar-N6OJX6QR.js → fanout-sidecar-67CMI3UT.js} +2 -2
  69. package/dist/guards/index.cjs +9 -5
  70. package/dist/guards/index.cjs.map +1 -1
  71. package/dist/guards/index.d.cts +5 -5
  72. package/dist/guards/index.d.ts +5 -5
  73. package/dist/guards/index.js +1 -1
  74. package/dist/{hash-DHOnRarj.d.ts → hash-CDjye9KV.d.ts} +1 -1
  75. package/dist/{hash-Cv6byZs7.d.cts → hash-DuQ88_5W.d.cts} +1 -1
  76. package/dist/history/index.cjs.map +1 -1
  77. package/dist/history/index.d.cts +5 -5
  78. package/dist/history/index.d.ts +5 -5
  79. package/dist/history/index.js +2 -2
  80. package/dist/i18n/index.cjs.map +1 -1
  81. package/dist/i18n/index.d.cts +4 -4
  82. package/dist/i18n/index.d.ts +4 -4
  83. package/dist/i18n/index.js +3 -3
  84. package/dist/{immutable-guard-yBEOYmif.d.cts → immutable-guard-CRPvu24K.d.cts} +16 -1
  85. package/dist/{immutable-guard-BehB1YGB.d.ts → immutable-guard-Dov3WvwF.d.ts} +16 -1
  86. package/dist/{index-D95VK1Qy.d.cts → index-C8Bk3-VF.d.cts} +1 -1
  87. package/dist/{index-XNB2r6bX.d.ts → index-nP99bXLg.d.ts} +1 -1
  88. package/dist/index.cjs +273 -52
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +13 -12
  91. package/dist/index.d.ts +13 -12
  92. package/dist/index.js +27 -25
  93. package/dist/index.js.map +1 -1
  94. package/dist/{issue-ADVS4OVP.js → issue-RZP3VI6O.js} +4 -4
  95. package/dist/{ledger-CWSE3BLF.js → ledger-A3LL253R.js} +3 -3
  96. package/dist/materialized-views/index.cjs +407 -5
  97. package/dist/materialized-views/index.cjs.map +1 -1
  98. package/dist/materialized-views/index.d.cts +5 -5
  99. package/dist/materialized-views/index.d.ts +5 -5
  100. package/dist/materialized-views/index.js +5 -5
  101. package/dist/noydb-WCMY2ZOW.js +35 -0
  102. package/dist/overlay-views/index.cjs +47 -17
  103. package/dist/overlay-views/index.cjs.map +1 -1
  104. package/dist/overlay-views/index.d.cts +26 -8
  105. package/dist/overlay-views/index.d.ts +26 -8
  106. package/dist/overlay-views/index.js +1 -1
  107. package/dist/periods/index.cjs.map +1 -1
  108. package/dist/periods/index.d.cts +4 -4
  109. package/dist/periods/index.d.ts +4 -4
  110. package/dist/periods/index.js +3 -3
  111. package/dist/{public-envelope-SYHEYQ3X.js → public-envelope-YP2UWMLG.js} +3 -3
  112. package/dist/query/index.cjs +24 -10
  113. package/dist/query/index.cjs.map +1 -1
  114. package/dist/query/index.d.cts +2 -2
  115. package/dist/query/index.d.ts +2 -2
  116. package/dist/query/index.js +2 -2
  117. package/dist/{registry-XGLNADIE.js → registry-EB6SISTA.js} +2 -2
  118. package/dist/{registry-DK5YWAAA.js → registry-UTA4CLQS.js} +2 -2
  119. package/dist/{revoke-ZDFKMR5E.js → revoke-HNMQZSCL.js} +4 -4
  120. package/dist/session/index.d.cts +5 -5
  121. package/dist/session/index.d.ts +5 -5
  122. package/dist/shadow/index.d.cts +4 -4
  123. package/dist/shadow/index.d.ts +4 -4
  124. package/dist/{signer-P5D7Y72U.js → signer-DCMNKXSF.js} +3 -3
  125. package/dist/snapshots/index.d.cts +4 -4
  126. package/dist/snapshots/index.d.ts +4 -4
  127. package/dist/snapshots/index.js +3 -3
  128. package/dist/{stale-JH67FU57.js → stale-W5PQTRYH.js} +2 -2
  129. package/dist/store/index.d.cts +4 -4
  130. package/dist/store/index.d.ts +4 -4
  131. package/dist/{strategy-CbneC7bS.d.ts → strategy-BtW8fAjz.d.cts} +1 -1
  132. package/dist/{strategy-CbneC7bS.d.cts → strategy-BtW8fAjz.d.ts} +1 -1
  133. package/dist/sync/index.cjs.map +1 -1
  134. package/dist/sync/index.d.cts +3 -3
  135. package/dist/sync/index.d.ts +3 -3
  136. package/dist/sync/index.js +2 -2
  137. package/dist/team/index.cjs.map +1 -1
  138. package/dist/team/index.d.cts +4 -4
  139. package/dist/team/index.d.ts +4 -4
  140. package/dist/team/index.js +5 -5
  141. package/dist/tx/index.cjs +66 -3
  142. package/dist/tx/index.cjs.map +1 -1
  143. package/dist/tx/index.d.cts +22 -6
  144. package/dist/tx/index.d.ts +22 -6
  145. package/dist/tx/index.js +7 -3
  146. package/dist/tx/index.js.map +1 -1
  147. package/dist/{types-BpPV5uyy.d.cts → types-Bze6vkwm.d.cts} +371 -139
  148. package/dist/{types-4t1-tWS4.d.ts → types-DrmBTscX.d.ts} +371 -139
  149. package/dist/{ulid-DAfenvFd.d.ts → ulid-DbBVrNSt.d.ts} +1 -1
  150. package/dist/{ulid-CiPrpGqm.d.cts → ulid-DfZlAh0u.d.cts} +1 -1
  151. package/dist/{vault-group-KOM7QRJG.js → vault-group-DX2HFQMX.js} +2 -2
  152. package/dist/{with-derivation-DBqJB3dQ.d.cts → with-derivation-CCqAchD5.d.cts} +1 -1
  153. package/dist/{with-derivation-OK9M2sJE.d.ts → with-derivation-_lySGdlm.d.ts} +1 -1
  154. package/dist/{with-materialized-view-NzuxYPDF.d.cts → with-materialized-view--4PsvMDu.d.cts} +1 -1
  155. package/dist/{with-materialized-view-Dt-ufPWQ.d.ts → with-materialized-view-QT1Tp7NO.d.ts} +1 -1
  156. package/dist/{with-overlayed-view-eDvMs6LO.d.ts → with-overlayed-view-BEXfpzSb.d.ts} +1 -1
  157. package/dist/{with-overlayed-view-CC0_ocy-.d.cts → with-overlayed-view-DlH5qmeB.d.cts} +1 -1
  158. package/package.json +3 -3
  159. package/dist/chunk-3EWXMOK3.js.map +0 -1
  160. package/dist/chunk-5LQG6ZO2.js.map +0 -1
  161. package/dist/chunk-7EFFHEN5.js.map +0 -1
  162. package/dist/chunk-C5T5AFWN.js.map +0 -1
  163. package/dist/chunk-DQU36Q7I.js.map +0 -1
  164. package/dist/chunk-EGD5DXFT.js.map +0 -1
  165. package/dist/chunk-OHVFWCJP.js.map +0 -1
  166. package/dist/chunk-VU7SWWT5.js.map +0 -1
  167. package/dist/chunk-YHPM5D7Y.js.map +0 -1
  168. package/dist/noydb-GZGFBA4E.js +0 -35
  169. /package/dist/{chunk-BIYRQQV6.js.map → chunk-3YWP3WBP.js.map} +0 -0
  170. /package/dist/{chunk-A5ZOOZFB.js.map → chunk-6H2ZUNR7.js.map} +0 -0
  171. /package/dist/{chunk-7HT2MEZ5.js.map → chunk-7BQ4QWYX.js.map} +0 -0
  172. /package/dist/{chunk-WBAYSNUQ.js.map → chunk-BI6ETQPF.js.map} +0 -0
  173. /package/dist/{chunk-56DJ7JVK.js.map → chunk-BR3AMFGS.js.map} +0 -0
  174. /package/dist/{chunk-COFPAMX6.js.map → chunk-DLZ2ONOD.js.map} +0 -0
  175. /package/dist/{chunk-EYVQHAGH.js.map → chunk-DUREQF5W.js.map} +0 -0
  176. /package/dist/{chunk-PE4AQGFH.js.map → chunk-E2CDVKMH.js.map} +0 -0
  177. /package/dist/{chunk-L2FE64BU.js.map → chunk-FFXM3ZIF.js.map} +0 -0
  178. /package/dist/{chunk-WGHU7BLI.js.map → chunk-GNI5STXQ.js.map} +0 -0
  179. /package/dist/{chunk-7PS7EOCF.js.map → chunk-IXBIFDEW.js.map} +0 -0
  180. /package/dist/{chunk-LX3CB26H.js.map → chunk-KABJXG2F.js.map} +0 -0
  181. /package/dist/{chunk-DKO2QFSA.js.map → chunk-OB2ZJQ2D.js.map} +0 -0
  182. /package/dist/{chunk-KIP6JLTF.js.map → chunk-OMAMZKKD.js.map} +0 -0
  183. /package/dist/{chunk-KI6HAJWL.js.map → chunk-QSUK7YWK.js.map} +0 -0
  184. /package/dist/{chunk-NSCVNK5K.js.map → chunk-SCJPI4Z5.js.map} +0 -0
  185. /package/dist/{chunk-6AJBSQU4.js.map → chunk-XL35NSEN.js.map} +0 -0
  186. /package/dist/{executor-HSSRXDOB.js.map → executor-AZLS3KBK.js.map} +0 -0
  187. /package/dist/{fanout-sidecar-N6OJX6QR.js.map → fanout-sidecar-67CMI3UT.js.map} +0 -0
  188. /package/dist/{issue-ADVS4OVP.js.map → issue-RZP3VI6O.js.map} +0 -0
  189. /package/dist/{ledger-CWSE3BLF.js.map → ledger-A3LL253R.js.map} +0 -0
  190. /package/dist/{noydb-GZGFBA4E.js.map → noydb-WCMY2ZOW.js.map} +0 -0
  191. /package/dist/{public-envelope-SYHEYQ3X.js.map → public-envelope-YP2UWMLG.js.map} +0 -0
  192. /package/dist/{registry-DK5YWAAA.js.map → registry-EB6SISTA.js.map} +0 -0
  193. /package/dist/{registry-XGLNADIE.js.map → registry-UTA4CLQS.js.map} +0 -0
  194. /package/dist/{revoke-ZDFKMR5E.js.map → revoke-HNMQZSCL.js.map} +0 -0
  195. /package/dist/{signer-P5D7Y72U.js.map → signer-DCMNKXSF.js.map} +0 -0
  196. /package/dist/{stale-JH67FU57.js.map → stale-W5PQTRYH.js.map} +0 -0
  197. /package/dist/{vault-group-KOM7QRJG.js.map → vault-group-DX2HFQMX.js.map} +0 -0
@@ -1,10 +1,10 @@
1
- import { b3 as NoydbStore, b1 as UnlockedKeyring } from '../types-BpPV5uyy.cjs';
2
- export { bt as BundleRecipient, cv as EnrollAuthenticatorOptions, cw as EnrollAuthenticatorWrappingDEKsOptions, cx as EnrollAuthenticatorWrappingKEKOptions, d2 as ListUsersOptions, du as PaperRecoveryEntry, dC as PresenceHandle, dX as RecoverPassphraseInput, dY as RecoverPassphraseResult, dZ as RecoverUserOptions, d_ as RecoveryProof, e1 as RotatePassphraseInput, el as SlotRewrapCeremony, em as SlotRewrapContext, ev as SyncEngine, eD as SyncTransaction, eQ as UpdateAuthenticatorOptions, f8 as WrappedDeksBlob, fe as buildRecipientKeyringFile, ff as burnPaperRecoveryEntry, g1 as changeSecret, g2 as createOwnerKeyring, fi as deriveMagicLinkContentKey, fj as enrollAuthenticator, g3 as ensureCollectionDEK, fm as evaluateExportCapability, fn as evaluateImportCapability, fo as findAuthenticator, g4 as grant, fp as hasExportCapability, fq as hasImportCapability, fs as isMagicLinkGrantExpired, fx as listMagicLinkGrants, fy as listUsers, fz as listUsersWithEnvelopes, g5 as loadKeyring, fB as loadPaperRecoveryEntries, fE as magicLinkGrantRecordId, fF as mintPaperRecoveryEntry, fH as mintWrappedDeksBlob, g6 as persistKeyring, fJ as readMagicLinkGrantRecord, fv as recoverPassphrase, fK as recoverUser, fL as removeAuthenticator, g7 as revoke, fO as revokeMagicLinkGrant, fw as rotatePassphrase, fP as savePaperRecoveryEntries, fS as unwrapDeksFromBlob, fT as unwrapDeksFromPaperEntry, fV as unwrapMagicLinkGrant, g8 as updateAuthenticator, g9 as updateKeyringIdentity, g0 as writeMagicLinkGrant } from '../types-BpPV5uyy.cjs';
1
+ import { a$ as NoydbStore, aZ as UnlockedKeyring } from '../types-Bze6vkwm.cjs';
2
+ export { bp as BundleRecipient, ct as EnrollAuthenticatorOptions, cu as EnrollAuthenticatorWrappingDEKsOptions, cv as EnrollAuthenticatorWrappingKEKOptions, d0 as ListUsersOptions, ds as PaperRecoveryEntry, dA as PresenceHandle, dV as RecoverPassphraseInput, dW as RecoverPassphraseResult, dX as RecoverUserOptions, dY as RecoveryProof, d$ as RotatePassphraseInput, ek as SlotRewrapCeremony, el as SlotRewrapContext, eu as SyncEngine, eC as SyncTransaction, eS as UpdateAuthenticatorOptions, fa as WrappedDeksBlob, fg as buildRecipientKeyringFile, fh as burnPaperRecoveryEntry, g5 as changeSecret, g6 as createOwnerKeyring, fk as deriveMagicLinkContentKey, fl as enrollAuthenticator, g7 as ensureCollectionDEK, fo as evaluateExportCapability, fp as evaluateImportCapability, fq as findAuthenticator, g8 as grant, fr as hasExportCapability, fs as hasImportCapability, fu as isMagicLinkGrantExpired, fz as listMagicLinkGrants, fA as listUsers, fB as listUsersWithEnvelopes, g9 as loadKeyring, fD as loadPaperRecoveryEntries, fG as magicLinkGrantRecordId, fH as mintPaperRecoveryEntry, fJ as mintWrappedDeksBlob, ga as persistKeyring, fL as readMagicLinkGrantRecord, fx as recoverPassphrase, fM as recoverUser, fN as removeAuthenticator, gb as revoke, fR as revokeMagicLinkGrant, fy as rotatePassphrase, fT as savePaperRecoveryEntries, fW as unwrapDeksFromBlob, fX as unwrapDeksFromPaperEntry, fZ as unwrapMagicLinkGrant, gc as updateAuthenticator, gd as updateKeyringIdentity, g4 as writeMagicLinkGrant } from '../types-Bze6vkwm.cjs';
3
3
  import '../lazy-builder-eYZzLEL1.cjs';
4
4
  import '../predicate-BmhBSPCH.cjs';
5
- import '../strategy-CbneC7bS.cjs';
5
+ import '../strategy-BtW8fAjz.cjs';
6
6
  import '../strategy-BSxFXGzb.cjs';
7
- import '../index-D95VK1Qy.cjs';
7
+ import '../index-C8Bk3-VF.cjs';
8
8
  import '@noy-db/attestation';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
- import { b3 as NoydbStore, b1 as UnlockedKeyring } from '../types-4t1-tWS4.js';
2
- export { bt as BundleRecipient, cv as EnrollAuthenticatorOptions, cw as EnrollAuthenticatorWrappingDEKsOptions, cx as EnrollAuthenticatorWrappingKEKOptions, d2 as ListUsersOptions, du as PaperRecoveryEntry, dC as PresenceHandle, dX as RecoverPassphraseInput, dY as RecoverPassphraseResult, dZ as RecoverUserOptions, d_ as RecoveryProof, e1 as RotatePassphraseInput, el as SlotRewrapCeremony, em as SlotRewrapContext, ev as SyncEngine, eD as SyncTransaction, eQ as UpdateAuthenticatorOptions, f8 as WrappedDeksBlob, fe as buildRecipientKeyringFile, ff as burnPaperRecoveryEntry, g1 as changeSecret, g2 as createOwnerKeyring, fi as deriveMagicLinkContentKey, fj as enrollAuthenticator, g3 as ensureCollectionDEK, fm as evaluateExportCapability, fn as evaluateImportCapability, fo as findAuthenticator, g4 as grant, fp as hasExportCapability, fq as hasImportCapability, fs as isMagicLinkGrantExpired, fx as listMagicLinkGrants, fy as listUsers, fz as listUsersWithEnvelopes, g5 as loadKeyring, fB as loadPaperRecoveryEntries, fE as magicLinkGrantRecordId, fF as mintPaperRecoveryEntry, fH as mintWrappedDeksBlob, g6 as persistKeyring, fJ as readMagicLinkGrantRecord, fv as recoverPassphrase, fK as recoverUser, fL as removeAuthenticator, g7 as revoke, fO as revokeMagicLinkGrant, fw as rotatePassphrase, fP as savePaperRecoveryEntries, fS as unwrapDeksFromBlob, fT as unwrapDeksFromPaperEntry, fV as unwrapMagicLinkGrant, g8 as updateAuthenticator, g9 as updateKeyringIdentity, g0 as writeMagicLinkGrant } from '../types-4t1-tWS4.js';
1
+ import { a$ as NoydbStore, aZ as UnlockedKeyring } from '../types-DrmBTscX.js';
2
+ export { bp as BundleRecipient, ct as EnrollAuthenticatorOptions, cu as EnrollAuthenticatorWrappingDEKsOptions, cv as EnrollAuthenticatorWrappingKEKOptions, d0 as ListUsersOptions, ds as PaperRecoveryEntry, dA as PresenceHandle, dV as RecoverPassphraseInput, dW as RecoverPassphraseResult, dX as RecoverUserOptions, dY as RecoveryProof, d$ as RotatePassphraseInput, ek as SlotRewrapCeremony, el as SlotRewrapContext, eu as SyncEngine, eC as SyncTransaction, eS as UpdateAuthenticatorOptions, fa as WrappedDeksBlob, fg as buildRecipientKeyringFile, fh as burnPaperRecoveryEntry, g5 as changeSecret, g6 as createOwnerKeyring, fk as deriveMagicLinkContentKey, fl as enrollAuthenticator, g7 as ensureCollectionDEK, fo as evaluateExportCapability, fp as evaluateImportCapability, fq as findAuthenticator, g8 as grant, fr as hasExportCapability, fs as hasImportCapability, fu as isMagicLinkGrantExpired, fz as listMagicLinkGrants, fA as listUsers, fB as listUsersWithEnvelopes, g9 as loadKeyring, fD as loadPaperRecoveryEntries, fG as magicLinkGrantRecordId, fH as mintPaperRecoveryEntry, fJ as mintWrappedDeksBlob, ga as persistKeyring, fL as readMagicLinkGrantRecord, fx as recoverPassphrase, fM as recoverUser, fN as removeAuthenticator, gb as revoke, fR as revokeMagicLinkGrant, fy as rotatePassphrase, fT as savePaperRecoveryEntries, fW as unwrapDeksFromBlob, fX as unwrapDeksFromPaperEntry, fZ as unwrapMagicLinkGrant, gc as updateAuthenticator, gd as updateKeyringIdentity, g4 as writeMagicLinkGrant } from '../types-DrmBTscX.js';
3
3
  import '../lazy-builder-ChSqcF5t.js';
4
4
  import '../predicate-BmhBSPCH.js';
5
- import '../strategy-CbneC7bS.js';
5
+ import '../strategy-BtW8fAjz.js';
6
6
  import '../strategy-BSxFXGzb.js';
7
- import '../index-XNB2r6bX.js';
7
+ import '../index-nP99bXLg.js';
8
8
  import '@noy-db/attestation';
9
9
 
10
10
  /**
@@ -5,7 +5,7 @@ import {
5
5
  getCredential,
6
6
  listCredentials,
7
7
  putCredential
8
- } from "../chunk-NSCVNK5K.js";
8
+ } from "../chunk-SCJPI4Z5.js";
9
9
  import {
10
10
  burnPaperRecoveryEntry,
11
11
  deriveMagicLinkContentKey,
@@ -29,13 +29,13 @@ import {
29
29
  unwrapMagicLinkGrant,
30
30
  updateAuthenticator,
31
31
  writeMagicLinkGrant
32
- } from "../chunk-COFPAMX6.js";
32
+ } from "../chunk-DLZ2ONOD.js";
33
33
  import "../chunk-4TBBMHVC.js";
34
34
  import {
35
35
  PresenceHandle,
36
36
  SyncEngine,
37
37
  SyncTransaction
38
- } from "../chunk-WBAYSNUQ.js";
38
+ } from "../chunk-BI6ETQPF.js";
39
39
  import {
40
40
  buildRecipientKeyringFile,
41
41
  changeSecret,
@@ -52,9 +52,9 @@ import {
52
52
  persistKeyring,
53
53
  revoke,
54
54
  updateKeyringIdentity
55
- } from "../chunk-A5ZOOZFB.js";
55
+ } from "../chunk-6H2ZUNR7.js";
56
56
  import "../chunk-2QR2PQTT.js";
57
- import "../chunk-GC4V7RU7.js";
57
+ import "../chunk-F3BPIPLS.js";
58
58
  import "../chunk-YULZKK4F.js";
59
59
  import "../chunk-535SSHBS.js";
60
60
  export {
package/dist/tx/index.cjs CHANGED
@@ -335,7 +335,7 @@ var TxCollection = class {
335
335
  this._ctx._ops.push(op);
336
336
  }
337
337
  };
338
- async function runTransaction(db, fn, options) {
338
+ async function runTransaction(db, fn, options, txInvariants) {
339
339
  if (options?.amendment) {
340
340
  if (typeof options.reason !== "string" || options.reason.trim().length === 0) {
341
341
  throw new ValidationError(
@@ -359,12 +359,19 @@ async function runTransaction(db, fn, options) {
359
359
  }
360
360
  const priorEnvelopes = /* @__PURE__ */ new Map();
361
361
  const store = db._store;
362
+ const invariants = txInvariants ?? [];
363
+ const watchedScopes = new Set(invariants.map((i) => i.scope));
364
+ const plainBefore = /* @__PURE__ */ new Map();
362
365
  for (const op of ctx._ops) {
363
366
  const key = keyOf(op);
364
367
  if (!priorEnvelopes.has(key)) {
365
368
  const env = await store.get(op.vaultName, op.collectionName, op.id);
366
369
  priorEnvelopes.set(key, env);
367
370
  }
371
+ if (watchedScopes.has(op.collectionName) && !plainBefore.has(key)) {
372
+ const prior = await db.vault(op.vaultName).collection(op.collectionName).get(op.id);
373
+ plainBefore.set(key, prior ?? null);
374
+ }
368
375
  if (op.expectedVersion !== void 0) {
369
376
  const env = priorEnvelopes.get(key) ?? null;
370
377
  const actual = env?._v ?? 0;
@@ -462,6 +469,58 @@ async function runTransaction(db, fn, options) {
462
469
  );
463
470
  }
464
471
  }
472
+ if (invariants.length > 0) {
473
+ const lastOp = /* @__PURE__ */ new Map();
474
+ const order = [];
475
+ for (const op of ctx._ops) {
476
+ const key = keyOf(op);
477
+ if (!lastOp.has(key)) order.push(key);
478
+ lastOp.set(key, op);
479
+ }
480
+ const changesByScope = /* @__PURE__ */ new Map();
481
+ const scopeVault = /* @__PURE__ */ new Map();
482
+ for (const key of order) {
483
+ const op = lastOp.get(key);
484
+ if (!watchedScopes.has(op.collectionName)) continue;
485
+ const before = plainBefore.get(key) ?? null;
486
+ const after = op.type === "delete" ? null : op.record ?? null;
487
+ const change = { before, after };
488
+ const arr = changesByScope.get(op.collectionName);
489
+ if (arr) arr.push(change);
490
+ else changesByScope.set(op.collectionName, [change]);
491
+ scopeVault.set(op.collectionName, op.vaultName);
492
+ }
493
+ try {
494
+ for (const inv of invariants) {
495
+ const changes = changesByScope.get(inv.scope);
496
+ if (changes === void 0 || changes.length === 0) continue;
497
+ const vaultName = scopeVault.get(inv.scope);
498
+ const v = db.vault(vaultName);
499
+ const facade = v._getReadOnlyFacade() ?? {
500
+ collection(name) {
501
+ const c = v.collection(name);
502
+ return {
503
+ get: (id) => c.get(id),
504
+ list: () => c.list(),
505
+ query: () => c.query()
506
+ };
507
+ }
508
+ };
509
+ const ctxForInv = {
510
+ existing: null,
511
+ vault: facade,
512
+ userId: v.userId,
513
+ role: v.role
514
+ };
515
+ await inv.check(changes, ctxForInv);
516
+ }
517
+ } catch (err) {
518
+ await revertExecuted(ctx._executed, store, db);
519
+ throw err instanceof InvariantError ? err : new InvariantError(
520
+ err instanceof Error ? err.message : `invariant violated: ${String(err)}`
521
+ );
522
+ }
523
+ }
465
524
  return bodyResult;
466
525
  }
467
526
  async function revertExecuted(executed, store, db) {
@@ -537,8 +596,12 @@ async function runDryRun(db, fn) {
537
596
  }
538
597
 
539
598
  // src/tx/active.ts
540
- function withTransactions() {
541
- return { runTransaction, runDryRun };
599
+ function withTransactions(opts) {
600
+ const invariants = opts?.invariants ?? [];
601
+ return {
602
+ runTransaction: (db, fn, options) => runTransaction(db, fn, options, invariants),
603
+ runDryRun
604
+ };
542
605
  }
543
606
  // Annotate the CommonJS export names for ESM import in node:
544
607
  0 && (module.exports = {