@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.
- package/dist/aggregate/index.cjs +106 -10
- 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 +1 -1
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +3 -3
- package/dist/attestation/index.d.ts +3 -3
- package/dist/attestation/index.js +4 -4
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +4 -4
- package/dist/blobs/index.d.ts +4 -4
- package/dist/blobs/index.js +3 -3
- package/dist/bundle/index.cjs +181 -46
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +5 -5
- package/dist/bundle/index.d.ts +5 -5
- package/dist/bundle/index.js +7 -7
- package/dist/{chunk-BIYRQQV6.js → chunk-3YWP3WBP.js} +3 -3
- package/dist/{chunk-VU7SWWT5.js → chunk-42FEUPZQ.js} +10 -6
- package/dist/chunk-42FEUPZQ.js.map +1 -0
- package/dist/{chunk-7EFFHEN5.js → chunk-667MB6AH.js} +118 -47
- package/dist/chunk-667MB6AH.js.map +1 -0
- package/dist/{chunk-A5ZOOZFB.js → chunk-6H2ZUNR7.js} +2 -2
- package/dist/{chunk-7HT2MEZ5.js → chunk-7BQ4QWYX.js} +3 -3
- package/dist/{chunk-DQU36Q7I.js → chunk-7Z7KSVA5.js} +13 -4
- package/dist/chunk-7Z7KSVA5.js.map +1 -0
- package/dist/{chunk-WBAYSNUQ.js → chunk-BI6ETQPF.js} +2 -2
- package/dist/{chunk-56DJ7JVK.js → chunk-BR3AMFGS.js} +2 -2
- package/dist/{chunk-COFPAMX6.js → chunk-DLZ2ONOD.js} +3 -3
- package/dist/{chunk-EYVQHAGH.js → chunk-DUREQF5W.js} +2 -2
- package/dist/{chunk-PE4AQGFH.js → chunk-E2CDVKMH.js} +3 -3
- package/dist/{chunk-GC4V7RU7.js → chunk-F3BPIPLS.js} +1 -1
- package/dist/{chunk-GC4V7RU7.js.map → chunk-F3BPIPLS.js.map} +1 -1
- package/dist/{chunk-L2FE64BU.js → chunk-FFXM3ZIF.js} +2 -2
- package/dist/{chunk-5LQG6ZO2.js → chunk-G4SCICH5.js} +8 -3
- package/dist/chunk-G4SCICH5.js.map +1 -0
- package/dist/{chunk-WGHU7BLI.js → chunk-GNI5STXQ.js} +2 -2
- package/dist/{chunk-C5T5AFWN.js → chunk-HBXJ37ZY.js} +11 -5
- package/dist/chunk-HBXJ37ZY.js.map +1 -0
- package/dist/{chunk-7PS7EOCF.js → chunk-IXBIFDEW.js} +2 -2
- package/dist/{chunk-LX3CB26H.js → chunk-KABJXG2F.js} +2 -2
- package/dist/{chunk-3EWXMOK3.js → chunk-L2BNJ6HM.js} +26 -11
- package/dist/chunk-L2BNJ6HM.js.map +1 -0
- package/dist/{chunk-DKO2QFSA.js → chunk-OB2ZJQ2D.js} +2 -2
- package/dist/{chunk-KIP6JLTF.js → chunk-OMAMZKKD.js} +2 -2
- package/dist/{chunk-EGD5DXFT.js → chunk-OQSRJG6A.js} +13 -1
- package/dist/chunk-OQSRJG6A.js.map +1 -0
- package/dist/{chunk-KI6HAJWL.js → chunk-QSUK7YWK.js} +2 -2
- package/dist/{chunk-YHPM5D7Y.js → chunk-QVIEAYTP.js} +61 -2
- package/dist/chunk-QVIEAYTP.js.map +1 -0
- package/dist/{chunk-NSCVNK5K.js → chunk-SCJPI4Z5.js} +3 -3
- package/dist/{chunk-NU6Q3FOR.js → chunk-TKIY625R.js} +11 -1
- package/dist/{chunk-NU6Q3FOR.js.map → chunk-TKIY625R.js.map} +1 -1
- package/dist/{chunk-OHVFWCJP.js → chunk-VLMPU56Q.js} +48 -18
- package/dist/chunk-VLMPU56Q.js.map +1 -0
- package/dist/{chunk-6AJBSQU4.js → chunk-XL35NSEN.js} +2 -2
- package/dist/consent/index.d.cts +4 -4
- package/dist/consent/index.d.ts +4 -4
- package/dist/derivations/index.cjs +24 -3
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +5 -5
- package/dist/derivations/index.d.ts +5 -5
- package/dist/derivations/index.js +2 -2
- package/dist/{dev-unlock-nVkuRLLe.d.cts → dev-unlock-8XzcD2Z4.d.cts} +1 -1
- package/dist/{dev-unlock-iAS8z9jc.d.ts → dev-unlock-DR3upLd1.d.ts} +1 -1
- package/dist/{executor-HSSRXDOB.js → executor-AZLS3KBK.js} +4 -4
- package/dist/{fanout-sidecar-N6OJX6QR.js → fanout-sidecar-67CMI3UT.js} +2 -2
- package/dist/guards/index.cjs +9 -5
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +5 -5
- package/dist/guards/index.d.ts +5 -5
- package/dist/guards/index.js +1 -1
- package/dist/{hash-DHOnRarj.d.ts → hash-CDjye9KV.d.ts} +1 -1
- package/dist/{hash-Cv6byZs7.d.cts → hash-DuQ88_5W.d.cts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +5 -5
- package/dist/history/index.d.ts +5 -5
- package/dist/history/index.js +2 -2
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +4 -4
- package/dist/i18n/index.d.ts +4 -4
- package/dist/i18n/index.js +3 -3
- package/dist/{immutable-guard-yBEOYmif.d.cts → immutable-guard-CRPvu24K.d.cts} +16 -1
- package/dist/{immutable-guard-BehB1YGB.d.ts → immutable-guard-Dov3WvwF.d.ts} +16 -1
- package/dist/{index-D95VK1Qy.d.cts → index-C8Bk3-VF.d.cts} +1 -1
- package/dist/{index-XNB2r6bX.d.ts → index-nP99bXLg.d.ts} +1 -1
- package/dist/index.cjs +273 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -12
- package/dist/index.d.ts +13 -12
- package/dist/index.js +27 -25
- package/dist/index.js.map +1 -1
- package/dist/{issue-ADVS4OVP.js → issue-RZP3VI6O.js} +4 -4
- package/dist/{ledger-CWSE3BLF.js → ledger-A3LL253R.js} +3 -3
- package/dist/materialized-views/index.cjs +407 -5
- 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 +5 -5
- package/dist/noydb-WCMY2ZOW.js +35 -0
- package/dist/overlay-views/index.cjs +47 -17
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +26 -8
- package/dist/overlay-views/index.d.ts +26 -8
- package/dist/overlay-views/index.js +1 -1
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +4 -4
- package/dist/periods/index.d.ts +4 -4
- package/dist/periods/index.js +3 -3
- package/dist/{public-envelope-SYHEYQ3X.js → public-envelope-YP2UWMLG.js} +3 -3
- package/dist/query/index.cjs +24 -10
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +2 -2
- package/dist/{registry-XGLNADIE.js → registry-EB6SISTA.js} +2 -2
- package/dist/{registry-DK5YWAAA.js → registry-UTA4CLQS.js} +2 -2
- package/dist/{revoke-ZDFKMR5E.js → revoke-HNMQZSCL.js} +4 -4
- package/dist/session/index.d.cts +5 -5
- package/dist/session/index.d.ts +5 -5
- package/dist/shadow/index.d.cts +4 -4
- package/dist/shadow/index.d.ts +4 -4
- package/dist/{signer-P5D7Y72U.js → signer-DCMNKXSF.js} +3 -3
- package/dist/snapshots/index.d.cts +4 -4
- package/dist/snapshots/index.d.ts +4 -4
- package/dist/snapshots/index.js +3 -3
- package/dist/{stale-JH67FU57.js → stale-W5PQTRYH.js} +2 -2
- package/dist/store/index.d.cts +4 -4
- package/dist/store/index.d.ts +4 -4
- package/dist/{strategy-CbneC7bS.d.ts → strategy-BtW8fAjz.d.cts} +1 -1
- package/dist/{strategy-CbneC7bS.d.cts → strategy-BtW8fAjz.d.ts} +1 -1
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +3 -3
- package/dist/sync/index.d.ts +3 -3
- package/dist/sync/index.js +2 -2
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +4 -4
- package/dist/team/index.d.ts +4 -4
- package/dist/team/index.js +5 -5
- package/dist/tx/index.cjs +66 -3
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +22 -6
- package/dist/tx/index.d.ts +22 -6
- package/dist/tx/index.js +7 -3
- package/dist/tx/index.js.map +1 -1
- package/dist/{types-BpPV5uyy.d.cts → types-Bze6vkwm.d.cts} +371 -139
- package/dist/{types-4t1-tWS4.d.ts → types-DrmBTscX.d.ts} +371 -139
- package/dist/{ulid-DAfenvFd.d.ts → ulid-DbBVrNSt.d.ts} +1 -1
- package/dist/{ulid-CiPrpGqm.d.cts → ulid-DfZlAh0u.d.cts} +1 -1
- package/dist/{vault-group-KOM7QRJG.js → vault-group-DX2HFQMX.js} +2 -2
- package/dist/{with-derivation-DBqJB3dQ.d.cts → with-derivation-CCqAchD5.d.cts} +1 -1
- package/dist/{with-derivation-OK9M2sJE.d.ts → with-derivation-_lySGdlm.d.ts} +1 -1
- package/dist/{with-materialized-view-NzuxYPDF.d.cts → with-materialized-view--4PsvMDu.d.cts} +1 -1
- package/dist/{with-materialized-view-Dt-ufPWQ.d.ts → with-materialized-view-QT1Tp7NO.d.ts} +1 -1
- package/dist/{with-overlayed-view-eDvMs6LO.d.ts → with-overlayed-view-BEXfpzSb.d.ts} +1 -1
- package/dist/{with-overlayed-view-CC0_ocy-.d.cts → with-overlayed-view-DlH5qmeB.d.cts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-3EWXMOK3.js.map +0 -1
- package/dist/chunk-5LQG6ZO2.js.map +0 -1
- package/dist/chunk-7EFFHEN5.js.map +0 -1
- package/dist/chunk-C5T5AFWN.js.map +0 -1
- package/dist/chunk-DQU36Q7I.js.map +0 -1
- package/dist/chunk-EGD5DXFT.js.map +0 -1
- package/dist/chunk-OHVFWCJP.js.map +0 -1
- package/dist/chunk-VU7SWWT5.js.map +0 -1
- package/dist/chunk-YHPM5D7Y.js.map +0 -1
- package/dist/noydb-GZGFBA4E.js +0 -35
- /package/dist/{chunk-BIYRQQV6.js.map → chunk-3YWP3WBP.js.map} +0 -0
- /package/dist/{chunk-A5ZOOZFB.js.map → chunk-6H2ZUNR7.js.map} +0 -0
- /package/dist/{chunk-7HT2MEZ5.js.map → chunk-7BQ4QWYX.js.map} +0 -0
- /package/dist/{chunk-WBAYSNUQ.js.map → chunk-BI6ETQPF.js.map} +0 -0
- /package/dist/{chunk-56DJ7JVK.js.map → chunk-BR3AMFGS.js.map} +0 -0
- /package/dist/{chunk-COFPAMX6.js.map → chunk-DLZ2ONOD.js.map} +0 -0
- /package/dist/{chunk-EYVQHAGH.js.map → chunk-DUREQF5W.js.map} +0 -0
- /package/dist/{chunk-PE4AQGFH.js.map → chunk-E2CDVKMH.js.map} +0 -0
- /package/dist/{chunk-L2FE64BU.js.map → chunk-FFXM3ZIF.js.map} +0 -0
- /package/dist/{chunk-WGHU7BLI.js.map → chunk-GNI5STXQ.js.map} +0 -0
- /package/dist/{chunk-7PS7EOCF.js.map → chunk-IXBIFDEW.js.map} +0 -0
- /package/dist/{chunk-LX3CB26H.js.map → chunk-KABJXG2F.js.map} +0 -0
- /package/dist/{chunk-DKO2QFSA.js.map → chunk-OB2ZJQ2D.js.map} +0 -0
- /package/dist/{chunk-KIP6JLTF.js.map → chunk-OMAMZKKD.js.map} +0 -0
- /package/dist/{chunk-KI6HAJWL.js.map → chunk-QSUK7YWK.js.map} +0 -0
- /package/dist/{chunk-NSCVNK5K.js.map → chunk-SCJPI4Z5.js.map} +0 -0
- /package/dist/{chunk-6AJBSQU4.js.map → chunk-XL35NSEN.js.map} +0 -0
- /package/dist/{executor-HSSRXDOB.js.map → executor-AZLS3KBK.js.map} +0 -0
- /package/dist/{fanout-sidecar-N6OJX6QR.js.map → fanout-sidecar-67CMI3UT.js.map} +0 -0
- /package/dist/{issue-ADVS4OVP.js.map → issue-RZP3VI6O.js.map} +0 -0
- /package/dist/{ledger-CWSE3BLF.js.map → ledger-A3LL253R.js.map} +0 -0
- /package/dist/{noydb-GZGFBA4E.js.map → noydb-WCMY2ZOW.js.map} +0 -0
- /package/dist/{public-envelope-SYHEYQ3X.js.map → public-envelope-YP2UWMLG.js.map} +0 -0
- /package/dist/{registry-DK5YWAAA.js.map → registry-EB6SISTA.js.map} +0 -0
- /package/dist/{registry-XGLNADIE.js.map → registry-UTA4CLQS.js.map} +0 -0
- /package/dist/{revoke-ZDFKMR5E.js.map → revoke-HNMQZSCL.js.map} +0 -0
- /package/dist/{signer-P5D7Y72U.js.map → signer-DCMNKXSF.js.map} +0 -0
- /package/dist/{stale-JH67FU57.js.map → stale-W5PQTRYH.js.map} +0 -0
- /package/dist/{vault-group-KOM7QRJG.js.map → vault-group-DX2HFQMX.js.map} +0 -0
package/dist/bundle/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TransferSealPayload } from '../ulid-
|
|
2
|
-
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-
|
|
3
|
-
import {
|
|
4
|
-
export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-
|
|
1
|
+
import { T as TransferSealPayload } from '../ulid-DfZlAh0u.cjs';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-DfZlAh0u.cjs';
|
|
3
|
+
import { bs as Vault, a$ as NoydbStore, bo as SealingKeyProvider, bt as RecoveryEnrollmentInput, bu as ShamirRecoveryProvider } from '../types-Bze6vkwm.cjs';
|
|
4
|
+
export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-BtW8fAjz.cjs';
|
|
5
5
|
import '../lazy-builder-eYZzLEL1.cjs';
|
|
6
6
|
import '../predicate-BmhBSPCH.cjs';
|
|
7
7
|
import '../strategy-BSxFXGzb.cjs';
|
|
8
|
-
import '../index-
|
|
8
|
+
import '../index-C8Bk3-VF.cjs';
|
|
9
9
|
import '@noy-db/attestation';
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TransferSealPayload } from '../ulid-
|
|
2
|
-
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-
|
|
3
|
-
import {
|
|
4
|
-
export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-
|
|
1
|
+
import { T as TransferSealPayload } from '../ulid-DbBVrNSt.js';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-DbBVrNSt.js';
|
|
3
|
+
import { bs as Vault, a$ as NoydbStore, bo as SealingKeyProvider, bt as RecoveryEnrollmentInput, bu as ShamirRecoveryProvider } from '../types-DrmBTscX.js';
|
|
4
|
+
export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-BtW8fAjz.js';
|
|
5
5
|
import '../lazy-builder-ChSqcF5t.js';
|
|
6
6
|
import '../predicate-BmhBSPCH.js';
|
|
7
7
|
import '../strategy-BSxFXGzb.js';
|
|
8
|
-
import '../index-
|
|
8
|
+
import '../index-nP99bXLg.js';
|
|
9
9
|
import '@noy-db/attestation';
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/bundle/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SCHEMAS_COLLECTION,
|
|
3
3
|
resolveManagedSecret
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-GNI5STXQ.js";
|
|
5
5
|
import {
|
|
6
6
|
COMPRESSION_BROTLI,
|
|
7
7
|
COMPRESSION_GZIP,
|
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
resetBrotliSupportCache,
|
|
21
21
|
validateBundleHeader,
|
|
22
22
|
writeNoydbBundle
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
23
|
+
} from "../chunk-FFXM3ZIF.js";
|
|
24
|
+
import "../chunk-OB2ZJQ2D.js";
|
|
25
25
|
import {
|
|
26
26
|
createOwnerKeyring
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-6H2ZUNR7.js";
|
|
28
28
|
import {
|
|
29
29
|
generateULID,
|
|
30
30
|
isULID
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
LEDGER_COLLECTION,
|
|
34
34
|
LedgerStore
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-BR3AMFGS.js";
|
|
36
36
|
import {
|
|
37
37
|
canonicalJson,
|
|
38
38
|
envelopePayloadHash,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
NOYDB_BACKUP_VERSION,
|
|
43
43
|
NOYDB_FORMAT_VERSION
|
|
44
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-F3BPIPLS.js";
|
|
45
45
|
import {
|
|
46
46
|
base64ToBuffer,
|
|
47
47
|
bufferToBase64,
|
|
@@ -532,7 +532,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
if (isManaged(opts)) {
|
|
535
|
-
const { createNoydb } = await import("../noydb-
|
|
535
|
+
const { createNoydb } = await import("../noydb-WCMY2ZOW.js");
|
|
536
536
|
const db = await createNoydb({
|
|
537
537
|
store,
|
|
538
538
|
user: userId,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ATTESTATIONS_COLLECTION,
|
|
3
3
|
loadOrCreateSigner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IXBIFDEW.js";
|
|
5
5
|
import {
|
|
6
6
|
generateULID
|
|
7
7
|
} from "./chunk-FZU343FL.js";
|
|
8
8
|
import {
|
|
9
9
|
NOYDB_FORMAT_VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F3BPIPLS.js";
|
|
11
11
|
import {
|
|
12
12
|
encrypt
|
|
13
13
|
} from "./chunk-YULZKK4F.js";
|
|
@@ -56,4 +56,4 @@ async function issueAttestationCore(ctx, args) {
|
|
|
56
56
|
export {
|
|
57
57
|
issueAttestationCore
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-3YWP3WBP.js.map
|
|
@@ -20,7 +20,7 @@ function recordId(record) {
|
|
|
20
20
|
return typeof id === "string" ? id : "";
|
|
21
21
|
}
|
|
22
22
|
function immutableGuard(config) {
|
|
23
|
-
const { collection, after, appendOnly, amendmentRoles } = config;
|
|
23
|
+
const { collection, after, appendOnly, amendmentRoles, amendmentInvariant } = config;
|
|
24
24
|
if (appendOnly && after !== void 0) {
|
|
25
25
|
throw new ValidationError("immutableGuard: `after` and `appendOnly` are mutually exclusive");
|
|
26
26
|
}
|
|
@@ -46,12 +46,16 @@ function immutableGuard(config) {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
// The authorized override: inside an amendment transaction the
|
|
49
|
-
// check/onDelete are skipped and the change is ledgered.
|
|
50
|
-
// invariant — the amendment itself is the
|
|
49
|
+
// check/onDelete are skipped and the change is ledgered. By default
|
|
50
|
+
// there is no extra invariant — the amendment itself is the
|
|
51
|
+
// sanctioned exception. Callers may supply `amendmentInvariant` to
|
|
52
|
+
// keep a constraint inviolable even under amendment (e.g. forbid
|
|
53
|
+
// deletes, or preserve a cross-record sum); a throw reverts the
|
|
54
|
+
// amendment and surfaces as `InvariantError`.
|
|
51
55
|
amendment: {
|
|
52
56
|
roles: amendmentRoles ?? ["admin", "owner"],
|
|
53
|
-
invariant: () => {
|
|
54
|
-
}
|
|
57
|
+
invariant: amendmentInvariant ?? (() => {
|
|
58
|
+
})
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
61
|
return withGuard(spec);
|
|
@@ -61,4 +65,4 @@ export {
|
|
|
61
65
|
withGuard,
|
|
62
66
|
immutableGuard
|
|
63
67
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-42FEUPZQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/guards/with-guard.ts","../src/guards/immutable-guard.ts"],"sourcesContent":["import { ValidationError } from '../errors.js'\nimport type { GuardStrategy, GuardStrategyHandle } from './types.js'\n\n/**\n * Register a guard for a collection. Guards run on every `put()` /\n * `delete()` for the named collection (after permissions, before\n * encryption) and may:\n *\n * - `check` — block writes by throwing (typically `RecordLockedError`)\n * - `frozenFields` — freeze specific fields once a condition is true\n * - `amendment` — declare an authorized-override path with invariant\n *\n * Pass the returned handle to `createNoydb({ strategies: [...] })`.\n *\n * @see docs/superpowers/specs/2026-05-18-guards-design.md\n */\nexport function withGuard<T extends Record<string, unknown>>(\n strategy: GuardStrategy<T>,\n): GuardStrategyHandle<T> {\n if (!strategy.collection || strategy.collection.length === 0) {\n throw new ValidationError('withGuard: collection name is required')\n }\n return {\n __noydb_strategy: 'guard',\n spec: strategy,\n }\n}\n","/**\n * `immutableGuard` — declarative WORM / append-only sugar over the guard\n * subsystem.\n *\n * Issued fiscal documents (invoices, DDTs) must be immutable after issue.\n * That is expressible today with a hand-rolled `withGuard` (block on\n * `check`/`onDelete`, allow an admin `amendment`), but the boilerplate is\n * repetitive and easy to get subtly wrong. `immutableGuard` generates\n * exactly that guard from a declarative config, reusing the guard\n * machinery wholesale — `check`/`onDelete` rejection, the ledgered\n * `amendment` override, and composition with `periods`/`history`.\n *\n * ```ts\n * createNoydb({ guardStrategies: [\n * immutableGuard({\n * collection: 'invoices',\n * after: (r) => r.status === 'issued', // immutable once issued\n * }),\n * ] })\n * ```\n *\n * A record is mutable until `after(record)` holds; from then on, updates\n * and deletes throw `RecordLockedError` unless performed inside an\n * `amendment` transaction by an authorized role (the override is\n * ledgered by the guard amendment mechanism). `appendOnly: true` is\n * shorthand for `after: () => true` — immutable from creation.\n */\n\nimport { withGuard } from './with-guard.js'\nimport type { GuardStrategy, GuardStrategyHandle, GuardContext, GuardChange } from './types.js'\nimport { RecordLockedError, ValidationError } from '../errors.js'\n\nexport interface ImmutableGuardConfig<T extends Record<string, unknown>> {\n /** The collection to make WORM. */\n collection: string\n /**\n * A record becomes immutable once this predicate holds. Evaluated on\n * the *existing* (already-persisted) record, so the write that first\n * makes it true is still allowed; subsequent writes are blocked.\n * Mutually exclusive with `appendOnly`.\n */\n after?: (record: T) => boolean\n /** Shorthand for `after: () => true` — immutable from creation. */\n appendOnly?: boolean\n /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */\n amendmentRoles?: ReadonlyArray<'admin' | 'owner'>\n /**\n * Optional set-level invariant run over the amendment change-set after\n * the writes execute. Signature matches `GuardStrategy.amendment.invariant`\n * exactly: it receives every {before, after} pair touching this\n * collection in the amendment plus the guard context; throwing reverts\n * the whole amendment and surfaces as `InvariantError`.\n *\n * Use this to keep a constraint inviolable EVEN under amendment — e.g.\n * forbid deleting an issued document by re-throwing on any\n * `before !== null && after === null` change, or assert a cross-record\n * sum is preserved. When omitted the amendment is unconditionally\n * allowed (the amendment itself is the sanctioned, ledgered override) —\n * this is the backward-compatible default.\n */\n amendmentInvariant?: (\n changes: ReadonlyArray<GuardChange<T>>,\n ctx: GuardContext<T>,\n ) => Promise<void> | void\n}\n\nfunction recordId(record: Record<string, unknown> | null): string {\n const id = record?.id\n return typeof id === 'string' ? id : ''\n}\n\n/**\n * Build an immutability guard. Pass the returned handle to\n * `createNoydb({ guardStrategies: [...] })`.\n */\nexport function immutableGuard<T extends Record<string, unknown>>(\n config: ImmutableGuardConfig<T>,\n): GuardStrategyHandle<T> {\n const { collection, after, appendOnly, amendmentRoles, amendmentInvariant } = config\n if (appendOnly && after !== undefined) {\n throw new ValidationError('immutableGuard: `after` and `appendOnly` are mutually exclusive')\n }\n if (!appendOnly && after === undefined) {\n throw new ValidationError('immutableGuard: provide `after` or `appendOnly: true`')\n }\n\n const isImmutable: (record: T) => boolean = appendOnly ? () => true : after!\n const reason = appendOnly ? 'append-only collection' : 'record is immutable after issue'\n\n const spec: GuardStrategy<T> = {\n collection,\n // Block updates to an already-immutable record. Inserts (existing\n // null) and the transition write that first makes the record\n // immutable are allowed — `after` reads the prior state.\n check: (incoming: T, ctx: GuardContext<T>) => {\n if (ctx.existing !== null && isImmutable(ctx.existing)) {\n throw new RecordLockedError(collection, recordId(incoming as Record<string, unknown>), reason)\n }\n },\n // Block deletes of an immutable record.\n onDelete: (existing: T) => {\n if (isImmutable(existing)) {\n throw new RecordLockedError(collection, recordId(existing as Record<string, unknown>), reason)\n }\n },\n // The authorized override: inside an amendment transaction the\n // check/onDelete are skipped and the change is ledgered. By default\n // there is no extra invariant — the amendment itself is the\n // sanctioned exception. Callers may supply `amendmentInvariant` to\n // keep a constraint inviolable even under amendment (e.g. forbid\n // deletes, or preserve a cross-record sum); a throw reverts the\n // amendment and surfaces as `InvariantError`.\n amendment: {\n roles: amendmentRoles ?? ['admin', 'owner'],\n invariant: amendmentInvariant ?? (() => {\n /* allow — the amendment is the override, and is ledgered */\n }),\n },\n }\n\n return withGuard<T>(spec)\n}\n"],"mappings":";;;;;;AAgBO,SAAS,UACd,UACwB;AACxB,MAAI,CAAC,SAAS,cAAc,SAAS,WAAW,WAAW,GAAG;AAC5D,UAAM,IAAI,gBAAgB,wCAAwC;AAAA,EACpE;AACA,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,MAAM;AAAA,EACR;AACF;;;ACwCA,SAAS,SAAS,QAAgD;AAChE,QAAM,KAAK,QAAQ;AACnB,SAAO,OAAO,OAAO,WAAW,KAAK;AACvC;AAMO,SAAS,eACd,QACwB;AACxB,QAAM,EAAE,YAAY,OAAO,YAAY,gBAAgB,mBAAmB,IAAI;AAC9E,MAAI,cAAc,UAAU,QAAW;AACrC,UAAM,IAAI,gBAAgB,iEAAiE;AAAA,EAC7F;AACA,MAAI,CAAC,cAAc,UAAU,QAAW;AACtC,UAAM,IAAI,gBAAgB,uDAAuD;AAAA,EACnF;AAEA,QAAM,cAAsC,aAAa,MAAM,OAAO;AACtE,QAAM,SAAS,aAAa,2BAA2B;AAEvD,QAAM,OAAyB;AAAA,IAC7B;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,CAAC,UAAa,QAAyB;AAC5C,UAAI,IAAI,aAAa,QAAQ,YAAY,IAAI,QAAQ,GAAG;AACtD,cAAM,IAAI,kBAAkB,YAAY,SAAS,QAAmC,GAAG,MAAM;AAAA,MAC/F;AAAA,IACF;AAAA;AAAA,IAEA,UAAU,CAAC,aAAgB;AACzB,UAAI,YAAY,QAAQ,GAAG;AACzB,cAAM,IAAI,kBAAkB,YAAY,SAAS,QAAmC,GAAG,MAAM;AAAA,MAC/F;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,WAAW;AAAA,MACT,OAAO,kBAAkB,CAAC,SAAS,OAAO;AAAA,MAC1C,WAAW,uBAAuB,MAAM;AAAA,MAExC;AAAA,IACF;AAAA,EACF;AAEA,SAAO,UAAa,IAAI;AAC1B;","names":[]}
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
TxContext,
|
|
9
9
|
revertExecuted
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QVIEAYTP.js";
|
|
11
11
|
import {
|
|
12
12
|
OverlayedCollection
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VLMPU56Q.js";
|
|
14
14
|
import {
|
|
15
15
|
LazyQuery,
|
|
16
16
|
decodeIdxId,
|
|
@@ -22,22 +22,22 @@ import {
|
|
|
22
22
|
resolveManagedSecret,
|
|
23
23
|
savePersistedSchema,
|
|
24
24
|
saveSealedPassphrase
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GNI5STXQ.js";
|
|
26
26
|
import {
|
|
27
27
|
loadPublicEnvelope,
|
|
28
28
|
readPublicEnvelope,
|
|
29
29
|
savePublicEnvelope,
|
|
30
30
|
validatePublicEnvelopeInput
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-OB2ZJQ2D.js";
|
|
32
32
|
import {
|
|
33
33
|
PERIODS_COLLECTION
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QSUK7YWK.js";
|
|
35
35
|
import {
|
|
36
36
|
getAtPath,
|
|
37
37
|
isDictCollectionName,
|
|
38
38
|
resolvePolicy,
|
|
39
39
|
setAtPathInPlace
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-7BQ4QWYX.js";
|
|
41
41
|
import {
|
|
42
42
|
ManagedRecoveryNotEnrolledError,
|
|
43
43
|
PolicyDeniedError,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
saveShamirRecoveryEntries,
|
|
60
60
|
updateAuthenticator,
|
|
61
61
|
writeMagicLinkGrant
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-DLZ2ONOD.js";
|
|
63
63
|
import {
|
|
64
64
|
assertTierAccess,
|
|
65
65
|
dekKey
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
rotateKeys,
|
|
89
89
|
saveUserEnvelope,
|
|
90
90
|
updateKeyringIdentity
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-6H2ZUNR7.js";
|
|
92
92
|
import {
|
|
93
93
|
INDEXED_STORE_POLICY
|
|
94
94
|
} from "./chunk-2QR2PQTT.js";
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
import {
|
|
99
99
|
LEDGER_COLLECTION,
|
|
100
100
|
LEDGER_DELTAS_COLLECTION
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-BR3AMFGS.js";
|
|
102
102
|
import {
|
|
103
103
|
sha256Hex as sha256Hex2
|
|
104
104
|
} from "./chunk-Z6FNBOTC.js";
|
|
@@ -111,10 +111,10 @@ import {
|
|
|
111
111
|
decodeMoneyFields,
|
|
112
112
|
quantizeMoneyFields,
|
|
113
113
|
validateMoneyFieldPaths
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-DUREQF5W.js";
|
|
115
115
|
import {
|
|
116
116
|
canonicalGroupKey
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-L2BNJ6HM.js";
|
|
118
118
|
import {
|
|
119
119
|
readPath
|
|
120
120
|
} from "./chunk-CJORTUJ2.js";
|
|
@@ -122,11 +122,11 @@ import {
|
|
|
122
122
|
EXPORT_AUDIT_COLLECTION,
|
|
123
123
|
createExportBlobsHandle,
|
|
124
124
|
runCompaction
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-XL35NSEN.js";
|
|
126
126
|
import {
|
|
127
127
|
NOYDB_BACKUP_VERSION,
|
|
128
128
|
NOYDB_FORMAT_VERSION
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-F3BPIPLS.js";
|
|
130
130
|
import {
|
|
131
131
|
decrypt,
|
|
132
132
|
encrypt,
|
|
@@ -1319,7 +1319,7 @@ var Collection = class {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
if (this.materializedViewSource !== void 0) {
|
|
1322
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
1322
|
+
const { resolveStaleMVOnRead } = await import("./stale-W5PQTRYH.js");
|
|
1323
1323
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name);
|
|
1324
1324
|
}
|
|
1325
1325
|
let record;
|
|
@@ -1717,7 +1717,7 @@ var Collection = class {
|
|
|
1717
1717
|
if (mode === "eager") {
|
|
1718
1718
|
if (executor === null) {
|
|
1719
1719
|
;
|
|
1720
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-
|
|
1720
|
+
({ MaterializedViewExecutor: executor } = await import("./executor-AZLS3KBK.js"));
|
|
1721
1721
|
}
|
|
1722
1722
|
await executor.refresh(reg, {
|
|
1723
1723
|
getCollection: (name) => this.materializedViewSource.getCollection(name),
|
|
@@ -1726,7 +1726,7 @@ var Collection = class {
|
|
|
1726
1726
|
});
|
|
1727
1727
|
} else if (mode === "lazy") {
|
|
1728
1728
|
if (staleHelpers === null) {
|
|
1729
|
-
staleHelpers = await import("./stale-
|
|
1729
|
+
staleHelpers = await import("./stale-W5PQTRYH.js");
|
|
1730
1730
|
}
|
|
1731
1731
|
staleHelpers.markMVStale(registry, reg.spec.name);
|
|
1732
1732
|
}
|
|
@@ -1757,9 +1757,18 @@ var Collection = class {
|
|
|
1757
1757
|
if (DerivationExecutor === null) {
|
|
1758
1758
|
({ DerivationExecutor } = await import("./executor-6ZDSDZ6V.js"));
|
|
1759
1759
|
}
|
|
1760
|
-
|
|
1760
|
+
let sourceWithId;
|
|
1761
|
+
let sourceVersion = version;
|
|
1762
|
+
if (spec.source === this.name) {
|
|
1763
|
+
sourceWithId = { ...incoming, id };
|
|
1764
|
+
} else {
|
|
1765
|
+
const primary = await this.derivationSource.getCollection(spec.source).get(id);
|
|
1766
|
+
if (primary === null || primary === void 0) continue;
|
|
1767
|
+
sourceWithId = { ...primary, id };
|
|
1768
|
+
sourceVersion = 0;
|
|
1769
|
+
}
|
|
1761
1770
|
const ctx = { vault: this.derivationSource.getReadOnlyFacade() };
|
|
1762
|
-
const result = await DerivationExecutor.run(spec, sourceWithId,
|
|
1771
|
+
const result = await DerivationExecutor.run(spec, sourceWithId, sourceVersion, strategyHash, ctx);
|
|
1763
1772
|
for (const key of Object.keys(spec.outputs)) {
|
|
1764
1773
|
const out = result.outputs[key];
|
|
1765
1774
|
if (!out) continue;
|
|
@@ -1774,7 +1783,7 @@ var Collection = class {
|
|
|
1774
1783
|
const outputCollection = this.derivationSource.getCollection(outSpec.collection);
|
|
1775
1784
|
const txCtx = this.derivationSource.getActiveTxContext();
|
|
1776
1785
|
if (out.kind === "array") {
|
|
1777
|
-
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-
|
|
1786
|
+
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-67CMI3UT.js");
|
|
1778
1787
|
const prior = await loadFanoutSidecar(
|
|
1779
1788
|
this.adapter,
|
|
1780
1789
|
this.vault,
|
|
@@ -2067,7 +2076,7 @@ var Collection = class {
|
|
|
2067
2076
|
for (const [outputKey, outSpec] of Object.entries(spec.outputs)) {
|
|
2068
2077
|
if (outSpec.shape !== "array") continue;
|
|
2069
2078
|
if (helpers === null) {
|
|
2070
|
-
helpers = await import("./fanout-sidecar-
|
|
2079
|
+
helpers = await import("./fanout-sidecar-67CMI3UT.js");
|
|
2071
2080
|
}
|
|
2072
2081
|
const sidecar = await helpers.loadFanoutSidecar(
|
|
2073
2082
|
this.adapter,
|
|
@@ -2107,7 +2116,7 @@ var Collection = class {
|
|
|
2107
2116
|
if (mode === "eager") {
|
|
2108
2117
|
if (executor === null) {
|
|
2109
2118
|
;
|
|
2110
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-
|
|
2119
|
+
({ MaterializedViewExecutor: executor } = await import("./executor-AZLS3KBK.js"));
|
|
2111
2120
|
}
|
|
2112
2121
|
await executor.refresh(reg, {
|
|
2113
2122
|
getCollection: (name) => this.materializedViewSource.getCollection(name),
|
|
@@ -2116,7 +2125,7 @@ var Collection = class {
|
|
|
2116
2125
|
});
|
|
2117
2126
|
} else if (mode === "lazy") {
|
|
2118
2127
|
if (staleHelpers === null) {
|
|
2119
|
-
staleHelpers = await import("./stale-
|
|
2128
|
+
staleHelpers = await import("./stale-W5PQTRYH.js");
|
|
2120
2129
|
}
|
|
2121
2130
|
staleHelpers.markMVStale(registry, reg.spec.name);
|
|
2122
2131
|
}
|
|
@@ -2139,7 +2148,7 @@ var Collection = class {
|
|
|
2139
2148
|
);
|
|
2140
2149
|
}
|
|
2141
2150
|
if (this.materializedViewSource !== void 0) {
|
|
2142
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
2151
|
+
const { resolveStaleMVOnRead } = await import("./stale-W5PQTRYH.js");
|
|
2143
2152
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name);
|
|
2144
2153
|
}
|
|
2145
2154
|
await this.ensureHydrated();
|
|
@@ -3784,6 +3793,21 @@ function withArchive(opts) {
|
|
|
3784
3793
|
// src/sequence/index.ts
|
|
3785
3794
|
var SEQUENCE_COLLECTION = "_sequences";
|
|
3786
3795
|
var MAX_NEXT_ATTEMPTS = 16;
|
|
3796
|
+
function resolveSequenceKey(series, opts) {
|
|
3797
|
+
const partition = opts?.partition;
|
|
3798
|
+
if (!partition || partition.length === 0) return series;
|
|
3799
|
+
const parts = partition.map((p) => {
|
|
3800
|
+
if (typeof p === "number" && !Number.isFinite(p)) {
|
|
3801
|
+
throw new ValidationError(`sequence partition component must be a finite number, got ${p}`);
|
|
3802
|
+
}
|
|
3803
|
+
const s = String(p);
|
|
3804
|
+
if (s === "") {
|
|
3805
|
+
throw new ValidationError("sequence partition component must not be empty");
|
|
3806
|
+
}
|
|
3807
|
+
return encodeURIComponent(s);
|
|
3808
|
+
});
|
|
3809
|
+
return `${series}\0${parts.join("/")}`;
|
|
3810
|
+
}
|
|
3787
3811
|
async function sleepBackoff(attempt) {
|
|
3788
3812
|
const ceil = Math.min(2 ** attempt, 32);
|
|
3789
3813
|
const ms = Math.floor(Math.random() * ceil);
|
|
@@ -3814,7 +3838,8 @@ var SequenceStore = class {
|
|
|
3814
3838
|
handle(name) {
|
|
3815
3839
|
return {
|
|
3816
3840
|
next: () => this.next(name),
|
|
3817
|
-
peek: () => this.peek(name)
|
|
3841
|
+
peek: () => this.peek(name),
|
|
3842
|
+
seedTo: (n) => this.seedTo(name, n)
|
|
3818
3843
|
};
|
|
3819
3844
|
}
|
|
3820
3845
|
assertOnline() {
|
|
@@ -3867,6 +3892,30 @@ var SequenceStore = class {
|
|
|
3867
3892
|
void lastConflict;
|
|
3868
3893
|
throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS);
|
|
3869
3894
|
}
|
|
3895
|
+
async seedTo(name, n) {
|
|
3896
|
+
this.assertOnline();
|
|
3897
|
+
if (n <= 0) return;
|
|
3898
|
+
let lastConflict;
|
|
3899
|
+
for (let attempt = 0; attempt < MAX_NEXT_ATTEMPTS; attempt++) {
|
|
3900
|
+
const { env, value } = await this.read(name);
|
|
3901
|
+
if (value >= n) return;
|
|
3902
|
+
const expectedVersion = env?._v ?? 0;
|
|
3903
|
+
const envelope = await this.encryptState({ value: n }, expectedVersion + 1);
|
|
3904
|
+
try {
|
|
3905
|
+
await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion);
|
|
3906
|
+
return;
|
|
3907
|
+
} catch (err) {
|
|
3908
|
+
if (err instanceof ConflictError) {
|
|
3909
|
+
lastConflict = err;
|
|
3910
|
+
if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt);
|
|
3911
|
+
continue;
|
|
3912
|
+
}
|
|
3913
|
+
throw err;
|
|
3914
|
+
}
|
|
3915
|
+
}
|
|
3916
|
+
void lastConflict;
|
|
3917
|
+
throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS);
|
|
3918
|
+
}
|
|
3870
3919
|
};
|
|
3871
3920
|
|
|
3872
3921
|
// src/numbering/index.ts
|
|
@@ -6005,17 +6054,23 @@ var Vault = class {
|
|
|
6005
6054
|
* const cur = await vault.sequence('invoice-2026').peek() // current value, no allocation
|
|
6006
6055
|
* ```
|
|
6007
6056
|
*/
|
|
6008
|
-
sequence(
|
|
6009
|
-
if (
|
|
6057
|
+
sequence(series, opts) {
|
|
6058
|
+
if (series.includes("\0")) {
|
|
6059
|
+
throw new ValidationError(`sequence("${series}"): series name must not contain a null byte (\\x00).`);
|
|
6060
|
+
}
|
|
6061
|
+
if (this.numberingConfigs.has(series)) {
|
|
6010
6062
|
const eng = this.deferred();
|
|
6011
6063
|
return {
|
|
6012
|
-
next: async (
|
|
6013
|
-
if (!
|
|
6014
|
-
throw new ValidationError(`sequence("${
|
|
6064
|
+
next: async (nextOpts) => {
|
|
6065
|
+
if (!nextOpts?.for) {
|
|
6066
|
+
throw new ValidationError(`sequence("${series}") is a deferred-numbering series; call next({ for: recordId }).`);
|
|
6015
6067
|
}
|
|
6016
|
-
return (await eng.enqueue(
|
|
6068
|
+
return (await eng.enqueue(series, nextOpts.for)).assigned;
|
|
6017
6069
|
},
|
|
6018
|
-
peek: () => eng.peek(
|
|
6070
|
+
peek: () => eng.peek(series),
|
|
6071
|
+
seedTo: () => {
|
|
6072
|
+
throw new ValidationError(`sequence("${series}") is a deferred-numbering series; seedTo is CAS-only.`);
|
|
6073
|
+
}
|
|
6019
6074
|
};
|
|
6020
6075
|
}
|
|
6021
6076
|
if (!this.sequenceStore) {
|
|
@@ -6027,7 +6082,7 @@ var Vault = class {
|
|
|
6027
6082
|
actor: this.keyring.userId
|
|
6028
6083
|
});
|
|
6029
6084
|
}
|
|
6030
|
-
return this.sequenceStore.handle(
|
|
6085
|
+
return this.sequenceStore.handle(resolveSequenceKey(series, opts));
|
|
6031
6086
|
}
|
|
6032
6087
|
/** @internal — lazily build the deferred-numbering engine with a cache-coherent stamp. */
|
|
6033
6088
|
deferred() {
|
|
@@ -6142,12 +6197,12 @@ var Vault = class {
|
|
|
6142
6197
|
if (!fieldSchema) {
|
|
6143
6198
|
throw new AttestationError(`issueAttestation: collection '${collectionName}' has no attestation field-schema. Declare it via vault.collection('${collectionName}', { attestation: { fields: [...] } }).`);
|
|
6144
6199
|
}
|
|
6145
|
-
const { issueAttestationCore } = await import("./issue-
|
|
6200
|
+
const { issueAttestationCore } = await import("./issue-RZP3VI6O.js");
|
|
6146
6201
|
const out = await issueAttestationCore(this.makeIssueContext(), { collection: collectionName, id, fieldSchema });
|
|
6147
6202
|
return { docId: out.docId, qr: out.qr, keyId: out.keyId, publicKeyB64: out.publicKeyB64 };
|
|
6148
6203
|
}
|
|
6149
6204
|
async getDocumentSigningPublicKey() {
|
|
6150
|
-
const { loadSigner, loadOrCreateSigner } = await import("./signer-
|
|
6205
|
+
const { loadSigner, loadOrCreateSigner } = await import("./signer-DCMNKXSF.js");
|
|
6151
6206
|
const existing = await loadSigner(this.adapter, this.name, this.getDEK);
|
|
6152
6207
|
if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
|
|
6153
6208
|
if (this.keyring.role !== "owner") {
|
|
@@ -6173,19 +6228,19 @@ var Vault = class {
|
|
|
6173
6228
|
};
|
|
6174
6229
|
}
|
|
6175
6230
|
async revokeAttestation(docId) {
|
|
6176
|
-
const { revokeDocCore } = await import("./revoke-
|
|
6231
|
+
const { revokeDocCore } = await import("./revoke-HNMQZSCL.js");
|
|
6177
6232
|
await revokeDocCore(this.makeRevokeContext(), docId);
|
|
6178
6233
|
}
|
|
6179
6234
|
async unrevokeAttestation(docId) {
|
|
6180
|
-
const { unrevokeDocCore } = await import("./revoke-
|
|
6235
|
+
const { unrevokeDocCore } = await import("./revoke-HNMQZSCL.js");
|
|
6181
6236
|
await unrevokeDocCore(this.makeRevokeContext(), docId);
|
|
6182
6237
|
}
|
|
6183
6238
|
async getRevokedDocIds() {
|
|
6184
|
-
const { getRevokedDocIdsCore } = await import("./revoke-
|
|
6239
|
+
const { getRevokedDocIdsCore } = await import("./revoke-HNMQZSCL.js");
|
|
6185
6240
|
return getRevokedDocIdsCore(this.makeRevokeContext());
|
|
6186
6241
|
}
|
|
6187
6242
|
async publishRevocationList() {
|
|
6188
|
-
const { publishRevocationListCore } = await import("./revoke-
|
|
6243
|
+
const { publishRevocationListCore } = await import("./revoke-HNMQZSCL.js");
|
|
6189
6244
|
return publishRevocationListCore(this.makeRevokeContext());
|
|
6190
6245
|
}
|
|
6191
6246
|
makeRevokeContext() {
|
|
@@ -6319,9 +6374,24 @@ var Vault = class {
|
|
|
6319
6374
|
});
|
|
6320
6375
|
}
|
|
6321
6376
|
if (rule.mode === "cascade") {
|
|
6377
|
+
const txCtx = this.noydb._activeTxContextOrNull;
|
|
6322
6378
|
for (const match of matches) {
|
|
6323
6379
|
const matchId = match["id"] ?? null;
|
|
6324
6380
|
if (matchId === null) continue;
|
|
6381
|
+
if (txCtx !== null) {
|
|
6382
|
+
const prior = await this.adapter.get(this.name, rule.collection, matchId);
|
|
6383
|
+
if (prior !== null) {
|
|
6384
|
+
txCtx._executed.push({
|
|
6385
|
+
op: {
|
|
6386
|
+
type: "delete",
|
|
6387
|
+
vaultName: this.name,
|
|
6388
|
+
collectionName: rule.collection,
|
|
6389
|
+
id: matchId
|
|
6390
|
+
},
|
|
6391
|
+
priorEnvelope: prior
|
|
6392
|
+
});
|
|
6393
|
+
}
|
|
6394
|
+
}
|
|
6325
6395
|
await fromCollection.delete(matchId);
|
|
6326
6396
|
}
|
|
6327
6397
|
}
|
|
@@ -6502,7 +6572,7 @@ var Vault = class {
|
|
|
6502
6572
|
async _initDerivations(handles) {
|
|
6503
6573
|
if (handles.length === 0) return;
|
|
6504
6574
|
const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
|
|
6505
|
-
import("./registry-
|
|
6575
|
+
import("./registry-EB6SISTA.js"),
|
|
6506
6576
|
import("./read-only-facade-ITU6L7BL.js")
|
|
6507
6577
|
]);
|
|
6508
6578
|
const registry = new DerivationRegistry();
|
|
@@ -6533,7 +6603,7 @@ var Vault = class {
|
|
|
6533
6603
|
*/
|
|
6534
6604
|
async _initMaterializedViews(handles) {
|
|
6535
6605
|
if (handles.length === 0) return;
|
|
6536
|
-
const { MaterializedViewRegistry } = await import("./registry-
|
|
6606
|
+
const { MaterializedViewRegistry } = await import("./registry-UTA4CLQS.js");
|
|
6537
6607
|
const registry = new MaterializedViewRegistry();
|
|
6538
6608
|
this.materializedViewRegistry = registry;
|
|
6539
6609
|
const db = this;
|
|
@@ -6604,13 +6674,13 @@ var Vault = class {
|
|
|
6604
6674
|
if (!reg) {
|
|
6605
6675
|
throw new Error(`refreshView: no MV registered with name "${name}"`);
|
|
6606
6676
|
}
|
|
6607
|
-
const { MaterializedViewExecutor } = await import("./executor-
|
|
6677
|
+
const { MaterializedViewExecutor } = await import("./executor-AZLS3KBK.js");
|
|
6608
6678
|
const result = await MaterializedViewExecutor.refresh(reg, {
|
|
6609
6679
|
getCollection: (n) => this.collection(n),
|
|
6610
6680
|
getActiveTxContext: () => this.noydb._activeTxContextOrNull,
|
|
6611
6681
|
getQueryContext: () => this
|
|
6612
6682
|
});
|
|
6613
|
-
const { clearMVStale } = await import("./stale-
|
|
6683
|
+
const { clearMVStale } = await import("./stale-W5PQTRYH.js");
|
|
6614
6684
|
clearMVStale(registry, name);
|
|
6615
6685
|
return result;
|
|
6616
6686
|
}
|
|
@@ -6651,7 +6721,7 @@ var Vault = class {
|
|
|
6651
6721
|
if (!outSpec) continue;
|
|
6652
6722
|
const outputColl = this.collection(outSpec.collection);
|
|
6653
6723
|
if (out.kind === "array") {
|
|
6654
|
-
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-
|
|
6724
|
+
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-67CMI3UT.js");
|
|
6655
6725
|
const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key);
|
|
6656
6726
|
const prevKeys = new Set(prior?.keys ?? []);
|
|
6657
6727
|
const newKeysList = out.entries.map((e) => e.key);
|
|
@@ -7363,7 +7433,7 @@ var Vault = class {
|
|
|
7363
7433
|
* @see docs/subsystems/public-envelope.md
|
|
7364
7434
|
*/
|
|
7365
7435
|
async getPublicEnvelope(opts = {}) {
|
|
7366
|
-
const { readPublicEnvelope: readPublicEnvelope2 } = await import("./public-envelope-
|
|
7436
|
+
const { readPublicEnvelope: readPublicEnvelope2 } = await import("./public-envelope-YP2UWMLG.js");
|
|
7367
7437
|
return readPublicEnvelope2(this.adapter, this.name, opts);
|
|
7368
7438
|
}
|
|
7369
7439
|
/**
|
|
@@ -8561,7 +8631,7 @@ var NOT_ENABLED5 = new Error(
|
|
|
8561
8631
|
'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/tx" and pass it to `createNoydb({ txStrategy: withTransactions() })`.'
|
|
8562
8632
|
);
|
|
8563
8633
|
var NO_TX = {
|
|
8564
|
-
async runTransaction() {
|
|
8634
|
+
async runTransaction(_db, _fn, _options, _txInvariants) {
|
|
8565
8635
|
throw NOT_ENABLED5;
|
|
8566
8636
|
},
|
|
8567
8637
|
async runDryRun() {
|
|
@@ -9572,7 +9642,7 @@ var Noydb = class {
|
|
|
9572
9642
|
if (name === STATE_VAULT_NAME) throw new ReservedVaultNameError(name);
|
|
9573
9643
|
const template = this.vaultTemplates.get(opts.sharding.vaultTemplate);
|
|
9574
9644
|
if (!template) throw new VaultTemplateNotFoundError(opts.sharding.vaultTemplate);
|
|
9575
|
-
const { VaultGroup } = await import("./vault-group-
|
|
9645
|
+
const { VaultGroup } = await import("./vault-group-DX2HFQMX.js");
|
|
9576
9646
|
const { StateManagementVault } = await import("./state-vault-TMXZRTY5.js");
|
|
9577
9647
|
const stateVault = opts.registry ? void 0 : await StateManagementVault.open(this);
|
|
9578
9648
|
const registry = opts.registry ?? stateVault.registry;
|
|
@@ -11102,6 +11172,7 @@ function normalizeSyncTargets(sync) {
|
|
|
11102
11172
|
|
|
11103
11173
|
export {
|
|
11104
11174
|
withArchive,
|
|
11175
|
+
resolveSequenceKey,
|
|
11105
11176
|
SequenceStore,
|
|
11106
11177
|
validateSchemaInput,
|
|
11107
11178
|
validateSchemaOutput,
|
|
@@ -11140,4 +11211,4 @@ export {
|
|
|
11140
11211
|
Noydb,
|
|
11141
11212
|
createNoydb
|
|
11142
11213
|
};
|
|
11143
|
-
//# sourceMappingURL=chunk-
|
|
11214
|
+
//# sourceMappingURL=chunk-667MB6AH.js.map
|