@noy-db/hub 0.2.0-pre.14 → 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 +160 -64
- 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 +3 -3
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +5 -5
- package/dist/attestation/index.d.ts +5 -5
- package/dist/attestation/index.js +4 -4
- 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 +3 -3
- package/dist/bundle/index.cjs +607 -114
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +7 -7
- package/dist/bundle/index.d.ts +7 -7
- 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-ACKFRSAH.js → chunk-667MB6AH.js} +132 -54
- 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-CJORTUJ2.js +524 -0
- package/dist/chunk-CJORTUJ2.js.map +1 -0
- package/dist/{chunk-YNTBADIY.js → chunk-CZI2A4MQ.js} +2 -2
- package/dist/{chunk-COFPAMX6.js → chunk-DLZ2ONOD.js} +3 -3
- package/dist/{chunk-KGCORI4L.js → chunk-DUREQF5W.js} +266 -66
- package/dist/chunk-DUREQF5W.js.map +1 -0
- 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-UWNYBOOO.js → chunk-HBXJ37ZY.js} +11 -5
- package/dist/chunk-HBXJ37ZY.js.map +1 -0
- package/dist/{chunk-NP6EZT44.js → chunk-IQLVUT37.js} +2 -2
- package/dist/{chunk-7PS7EOCF.js → chunk-IXBIFDEW.js} +2 -2
- package/dist/{chunk-LX3CB26H.js → chunk-KABJXG2F.js} +2 -2
- package/dist/{chunk-3EWA37FV.js → chunk-L2BNJ6HM.js} +32 -276
- package/dist/chunk-L2BNJ6HM.js.map +1 -0
- package/dist/{chunk-DKO2QFSA.js → chunk-OB2ZJQ2D.js} +2 -2
- package/dist/{chunk-4PEFEETV.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-ZWTNWAO4.js → chunk-TKIY625R.js} +13 -3
- package/dist/chunk-TKIY625R.js.map +1 -0
- 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/{chunk-WIBHRONM.js → chunk-XWH4MXIU.js} +2 -2
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/derivations/index.cjs +24 -3
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +7 -7
- package/dist/derivations/index.d.ts +7 -7
- package/dist/derivations/index.js +2 -2
- package/dist/{dev-unlock-BF4OSxRv.d.cts → dev-unlock-8XzcD2Z4.d.cts} +1 -1
- package/dist/{dev-unlock-DV7ujTCI.d.ts → dev-unlock-DR3upLd1.d.ts} +1 -1
- package/dist/executor-AZLS3KBK.js +11 -0
- 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 +7 -7
- package/dist/guards/index.d.ts +7 -7
- package/dist/guards/index.js +1 -1
- package/dist/{hash-DswxkLtW.d.ts → hash-CDjye9KV.d.ts} +1 -1
- package/dist/{hash-BcF5WQXl.d.cts → hash-DuQ88_5W.d.cts} +1 -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 +2 -2
- 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 +3 -3
- package/dist/{immutable-guard-7KqslW2K.d.cts → immutable-guard-CRPvu24K.d.cts} +16 -1
- package/dist/{immutable-guard-C8IYdzfu.d.ts → immutable-guard-Dov3WvwF.d.ts} +16 -1
- package/dist/{index-Cqzp4tt9.d.ts → index-C8Bk3-VF.d.cts} +11 -3
- package/dist/{index-CUVOMtgg.d.cts → index-nP99bXLg.d.ts} +11 -3
- package/dist/index.cjs +840 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +146 -15
- package/dist/index.d.ts +146 -15
- package/dist/index.js +153 -35
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +92 -31
- 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 +3 -3
- package/dist/{issue-ADVS4OVP.js → issue-RZP3VI6O.js} +4 -4
- package/dist/{lazy-builder-D5GU14TS.d.ts → lazy-builder-ChSqcF5t.d.ts} +1 -1
- package/dist/{lazy-builder-Ci5_YG73.d.cts → lazy-builder-eYZzLEL1.d.cts} +1 -1
- package/dist/{ledger-CWSE3BLF.js → ledger-A3LL253R.js} +3 -3
- package/dist/materialized-views/index.cjs +409 -7
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +7 -7
- package/dist/materialized-views/index.d.ts +7 -7
- package/dist/materialized-views/index.js +6 -6
- 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 +28 -10
- package/dist/overlay-views/index.d.ts +28 -10
- package/dist/overlay-views/index.js +1 -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 +3 -3
- package/dist/{predicate-Bt5ft-9c.d.cts → predicate-BmhBSPCH.d.cts} +59 -2
- package/dist/{predicate-Bt5ft-9c.d.ts → predicate-BmhBSPCH.d.ts} +59 -2
- package/dist/{public-envelope-SYHEYQ3X.js → public-envelope-YP2UWMLG.js} +3 -3
- package/dist/query/index.cjs +604 -205
- 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 +5 -5
- 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 +7 -7
- package/dist/session/index.d.ts +7 -7
- package/dist/shadow/index.d.cts +6 -6
- package/dist/shadow/index.d.ts +6 -6
- package/dist/{signer-P5D7Y72U.js → signer-DCMNKXSF.js} +3 -3
- package/dist/snapshots/index.d.cts +6 -6
- package/dist/snapshots/index.d.ts +6 -6
- package/dist/snapshots/index.js +3 -3
- package/dist/{stale-7FRJVHN6.js → stale-W5PQTRYH.js} +2 -2
- package/dist/store/index.d.cts +6 -6
- package/dist/store/index.d.ts +6 -6
- package/dist/{strategy-CrS7PnbE.d.cts → strategy-BtW8fAjz.d.cts} +2 -2
- package/dist/{strategy-CrS7PnbE.d.ts → strategy-BtW8fAjz.d.ts} +2 -2
- 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 +2 -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 +5 -5
- package/dist/tx/index.cjs +66 -3
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +24 -8
- package/dist/tx/index.d.ts +24 -8
- package/dist/tx/index.js +7 -3
- package/dist/tx/index.js.map +1 -1
- package/dist/{types-V5R2-pd4.d.cts → types-Bze6vkwm.d.cts} +391 -144
- package/dist/{types-BFHQUjdy.d.ts → types-DrmBTscX.d.ts} +391 -144
- package/dist/{ulid-p2nKiiKg.d.ts → ulid-DbBVrNSt.d.ts} +1 -1
- package/dist/{ulid-CwNf9e6-.d.cts → ulid-DfZlAh0u.d.cts} +1 -1
- package/dist/{vault-group-W7QC4UYW.js → vault-group-DX2HFQMX.js} +3 -3
- package/dist/{with-derivation-C9K43BOB.d.cts → with-derivation-CCqAchD5.d.cts} +1 -1
- package/dist/{with-derivation-Ds9yZgCj.d.ts → with-derivation-_lySGdlm.d.ts} +1 -1
- package/dist/{with-materialized-view-DgQcAjYv.d.cts → with-materialized-view--4PsvMDu.d.cts} +1 -1
- package/dist/{with-materialized-view-DwR4jkV5.d.ts → with-materialized-view-QT1Tp7NO.d.ts} +1 -1
- package/dist/{with-overlayed-view-ByyhHdVr.d.ts → with-overlayed-view-BEXfpzSb.d.ts} +1 -1
- package/dist/{with-overlayed-view-7-rUB3vD.d.cts → with-overlayed-view-DlH5qmeB.d.cts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-3EWA37FV.js.map +0 -1
- package/dist/chunk-5LQG6ZO2.js.map +0 -1
- package/dist/chunk-ACKFRSAH.js.map +0 -1
- package/dist/chunk-DQU36Q7I.js.map +0 -1
- package/dist/chunk-EGD5DXFT.js.map +0 -1
- package/dist/chunk-KGCORI4L.js.map +0 -1
- package/dist/chunk-OHVFWCJP.js.map +0 -1
- package/dist/chunk-TV3YZ35S.js +0 -90
- package/dist/chunk-TV3YZ35S.js.map +0 -1
- package/dist/chunk-UWNYBOOO.js.map +0 -1
- package/dist/chunk-VU7SWWT5.js.map +0 -1
- package/dist/chunk-YHPM5D7Y.js.map +0 -1
- package/dist/chunk-ZWTNWAO4.js.map +0 -1
- package/dist/executor-723ZP6TH.js +0 -11
- package/dist/noydb-VZ4JVW55.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-YNTBADIY.js.map → chunk-CZI2A4MQ.js.map} +0 -0
- /package/dist/{chunk-COFPAMX6.js.map → chunk-DLZ2ONOD.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-NP6EZT44.js.map → chunk-IQLVUT37.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-4PEFEETV.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/{chunk-WIBHRONM.js.map → chunk-XWH4MXIU.js.map} +0 -0
- /package/dist/{executor-723ZP6TH.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-VZ4JVW55.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-7FRJVHN6.js.map → stale-W5PQTRYH.js.map} +0 -0
- /package/dist/{vault-group-W7QC4UYW.js.map → vault-group-DX2HFQMX.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IndexStrategy, d as LazyQuery } from './lazy-builder-
|
|
2
|
-
import { a7 as NoydbError, o as LiveAggregation, f as AggregateSpec, e as AggregateResult,
|
|
1
|
+
import { I as IndexStrategy, d as LazyQuery } from './lazy-builder-ChSqcF5t.js';
|
|
2
|
+
import { a7 as NoydbError, o as LiveAggregation, f as AggregateSpec, e as AggregateResult, av as MoneyDescriptor, A as AggregateStrategy } from './strategy-BtW8fAjz.js';
|
|
3
3
|
import { C as CrdtStrategy, a as CrdtMode, b as CrdtState } from './strategy-BSxFXGzb.js';
|
|
4
|
-
import { L as LiveQuery, Q as Query, c as JoinStrategy, j as RefRegistry, R as RefDescriptor, d as JoinableSource, l as RefViolation, S as ScanBuilder } from './index-
|
|
5
|
-
import { I as IndexDef, O as Operator, F as FieldClause, C as CollectionIndexes } from './predicate-
|
|
4
|
+
import { L as LiveQuery, Q as Query, c as JoinStrategy, j as RefRegistry, R as RefDescriptor, d as JoinableSource, l as RefViolation, S as ScanBuilder } from './index-nP99bXLg.js';
|
|
5
|
+
import { I as IndexDef, O as Operator, F as FieldClause, C as CollectionIndexes } from './predicate-BmhBSPCH.js';
|
|
6
6
|
import { AttestationFieldSchema, RevocationList } from '@noy-db/attestation';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -2972,9 +2972,18 @@ interface GatePutEvent {
|
|
|
2972
2972
|
readonly vault: string;
|
|
2973
2973
|
readonly collection: string;
|
|
2974
2974
|
readonly docId: string;
|
|
2975
|
-
/**
|
|
2975
|
+
/**
|
|
2976
|
+
* The record about to be written (pre schema-validation). Money fields
|
|
2977
|
+
* are presented in their canonical decoded form (#332) — equal on both
|
|
2978
|
+
* sides for an unchanged value, regardless of how the caller wrote them.
|
|
2979
|
+
*/
|
|
2976
2980
|
readonly incoming: unknown;
|
|
2977
|
-
/**
|
|
2981
|
+
/**
|
|
2982
|
+
* Decrypted prior record, or null on create / when prior is unreadable.
|
|
2983
|
+
* Money fields are decoded to the canonical decimal `get()` shape, NOT
|
|
2984
|
+
* the stored scaled-int (#332) — `incoming[f] === existing[f]` holds
|
|
2985
|
+
* for an unchanged money field.
|
|
2986
|
+
*/
|
|
2978
2987
|
readonly existing: unknown;
|
|
2979
2988
|
/** Prior envelope version, or 0 when none. */
|
|
2980
2989
|
readonly existingVersion: number;
|
|
@@ -2998,6 +3007,7 @@ interface GateDeleteEvent {
|
|
|
2998
3007
|
readonly docId: string;
|
|
2999
3008
|
/** True for system-internal (housekeeping) deletes — handlers branch on this. */
|
|
3000
3009
|
readonly internal: boolean;
|
|
3010
|
+
/** Decrypted prior record; money fields decoded to the canonical `get()` shape (#332). */
|
|
3001
3011
|
readonly existing: unknown;
|
|
3002
3012
|
readonly existingVersion: number;
|
|
3003
3013
|
readonly existingTs: string | undefined;
|
|
@@ -4893,6 +4903,208 @@ interface SnapshotStrategy {
|
|
|
4893
4903
|
readonly policy?: SnapshotPolicy;
|
|
4894
4904
|
}
|
|
4895
4905
|
|
|
4906
|
+
/**
|
|
4907
|
+
* Minimum read surface exposed to guard `check` functions. Intentionally
|
|
4908
|
+
* narrow — guards can read other collections but never write.
|
|
4909
|
+
*
|
|
4910
|
+
* `query()` returns the same chainable builder used elsewhere. `Query<T>`
|
|
4911
|
+
* has no write terminals (no `.update()` / `.delete()`) so exposing it
|
|
4912
|
+
* here preserves the read-only contract while letting guards aggregate
|
|
4913
|
+
* with `.where().aggregate()` / `.groupBy()` / `.join()` instead of
|
|
4914
|
+
* decrypting every sibling row via `.list()`.
|
|
4915
|
+
*/
|
|
4916
|
+
interface ReadOnlyVaultFacade$1 {
|
|
4917
|
+
collection<T = unknown>(name: string): {
|
|
4918
|
+
get(id: string): Promise<T | null>;
|
|
4919
|
+
list(): Promise<T[]>;
|
|
4920
|
+
query(): Query<T>;
|
|
4921
|
+
};
|
|
4922
|
+
}
|
|
4923
|
+
/**
|
|
4924
|
+
* Runtime context passed to `check` and `invariant` callbacks.
|
|
4925
|
+
* `existing` is the currently-persisted record (null for inserts).
|
|
4926
|
+
*/
|
|
4927
|
+
interface GuardContext<T> {
|
|
4928
|
+
existing: T | null;
|
|
4929
|
+
vault: ReadOnlyVaultFacade$1;
|
|
4930
|
+
userId: string;
|
|
4931
|
+
role: Role;
|
|
4932
|
+
}
|
|
4933
|
+
/**
|
|
4934
|
+
* One {before, after} pair handed to an `invariant` function. `before`
|
|
4935
|
+
* is null for inserts; `after` reflects the proposed post-commit record.
|
|
4936
|
+
*/
|
|
4937
|
+
interface GuardChange<T> {
|
|
4938
|
+
before: T | null;
|
|
4939
|
+
after: T;
|
|
4940
|
+
}
|
|
4941
|
+
/** @internal — output of {@link withGuard}. */
|
|
4942
|
+
interface GuardStrategyHandle<T extends Record<string, unknown>> {
|
|
4943
|
+
readonly __noydb_strategy: 'guard';
|
|
4944
|
+
readonly spec: GuardStrategy<T>;
|
|
4945
|
+
}
|
|
4946
|
+
/**
|
|
4947
|
+
* Existential erasure of `GuardStrategyHandle<T>` — used as the
|
|
4948
|
+
* element type of `ReadonlyArray<>` fields where the per-handle T
|
|
4949
|
+
* differs (e.g. `guardStrategies: [invoiceGuard, disbursementGuard]`).
|
|
4950
|
+
*
|
|
4951
|
+
* Background: `GuardStrategyHandle<T>` is INVARIANT in T because T
|
|
4952
|
+
* appears in callback positions on the spec (`check(incoming: T, ctx)`,
|
|
4953
|
+
* `invariant(changes: ReadonlyArray<GuardChange<T>>, ctx)`). So
|
|
4954
|
+
* `Handle<Invoice>` is not assignable to `Handle<Record<string, unknown>>`.
|
|
4955
|
+
* A bounded existential ("there exists some T satisfying the constraint
|
|
4956
|
+
* such that this is a Handle<T>") is the right shape; TypeScript has
|
|
4957
|
+
* no first-class existentials, so we fake it with a structurally narrow
|
|
4958
|
+
* interface that ERASES T from both the discriminant and the spec.
|
|
4959
|
+
*
|
|
4960
|
+
* Consumers continue to construct typed handles via `withGuard<T>(...)`
|
|
4961
|
+
* which returns `GuardStrategyHandle<T>`. Both `Handle<Invoice>` and
|
|
4962
|
+
* `Handle<Disbursement>` structurally assign to `GuardStrategyHandleAny`,
|
|
4963
|
+
* so an array of them is `GuardStrategyHandleAny[]`.
|
|
4964
|
+
*
|
|
4965
|
+
* Internal code that needs T re-narrows via the runtime discriminant
|
|
4966
|
+
* (`__noydb_strategy === 'guard'`) plus per-handle type information
|
|
4967
|
+
* carried by the registry.
|
|
4968
|
+
*
|
|
4969
|
+
* NOT exported from the public barrel — keeping this internal
|
|
4970
|
+
* discourages consumers from constructing it directly. Used only as
|
|
4971
|
+
* the array-element type on `Vault` / `NoydbOptions.guardStrategies`.
|
|
4972
|
+
*
|
|
4973
|
+
* @internal
|
|
4974
|
+
*/
|
|
4975
|
+
interface GuardStrategyHandleAny {
|
|
4976
|
+
readonly __noydb_strategy: 'guard';
|
|
4977
|
+
readonly spec: GuardStrategy<any>;
|
|
4978
|
+
}
|
|
4979
|
+
/** Public registration shape. See `withGuard()`. */
|
|
4980
|
+
interface GuardStrategy<T extends Record<string, unknown>> {
|
|
4981
|
+
collection: string;
|
|
4982
|
+
/**
|
|
4983
|
+
* Fires on `Collection.put` (insert + update). The `incoming` argument
|
|
4984
|
+
* is the record being written. Throw to cancel the put.
|
|
4985
|
+
*
|
|
4986
|
+
* Does NOT fire on `Collection.delete` — use {@link onDelete} for
|
|
4987
|
+
* delete-time validation. Skipped during an amendment transaction
|
|
4988
|
+
* (`db.transaction({ amendment: true })`) — admin/owner override.
|
|
4989
|
+
*/
|
|
4990
|
+
check?: (incoming: T, ctx: GuardContext<T>) => Promise<void> | void;
|
|
4991
|
+
/**
|
|
4992
|
+
* Fires on user-initiated `Collection.delete` before the adapter
|
|
4993
|
+
* delete and before the ledger append. The `existing` argument is
|
|
4994
|
+
* the currently-persisted record. Throw to cancel the delete — no
|
|
4995
|
+
* partial state, no tombstone ledger entry.
|
|
4996
|
+
*
|
|
4997
|
+
* Skipped during an amendment transaction (admin/owner override) —
|
|
4998
|
+
* amendments are the unlock primitive. To make a delete TRULY
|
|
4999
|
+
* unconditional (e.g. legal-document immutability rules), pair
|
|
5000
|
+
* `onDelete` with an `amendment.invariant` that re-throws on any
|
|
5001
|
+
* `before !== null && after === null` change:
|
|
5002
|
+
*
|
|
5003
|
+
* ```ts
|
|
5004
|
+
* withGuard<Receipt>({
|
|
5005
|
+
* collection: 'receipts',
|
|
5006
|
+
* onDelete: () => { throw new RecordLockedError(...) },
|
|
5007
|
+
* amendment: {
|
|
5008
|
+
* roles: ['admin', 'owner'],
|
|
5009
|
+
* invariant: (changes) => {
|
|
5010
|
+
* for (const c of changes) {
|
|
5011
|
+
* if (c.before !== null && c.after === null) {
|
|
5012
|
+
* throw new RecordLockedError(...) // wrapped as InvariantError
|
|
5013
|
+
* }
|
|
5014
|
+
* }
|
|
5015
|
+
* },
|
|
5016
|
+
* },
|
|
5017
|
+
* })
|
|
5018
|
+
* ```
|
|
5019
|
+
*
|
|
5020
|
+
* Also skipped on system-internal deletes (derivation tombstones,
|
|
5021
|
+
* MV refresh from Dim 14 v2) — those use `_internalDelete`
|
|
5022
|
+
* which bypasses every user-facing delete hook. Housekeeping ops are
|
|
5023
|
+
* NOT user-initiated and should not trip user invariants.
|
|
5024
|
+
*
|
|
5025
|
+
* Delete of an absent record is a no-op and does not consult any
|
|
5026
|
+
* guard, matching the idempotent-delete contract.
|
|
5027
|
+
*/
|
|
5028
|
+
onDelete?: (existing: T, ctx: GuardContext<T>) => Promise<void> | void;
|
|
5029
|
+
frozenFields?: {
|
|
5030
|
+
when: (existing: T) => boolean;
|
|
5031
|
+
fields: ReadonlyArray<keyof T>;
|
|
5032
|
+
};
|
|
5033
|
+
amendment?: {
|
|
5034
|
+
roles: ReadonlyArray<'admin' | 'owner'>;
|
|
5035
|
+
invariant: (changes: ReadonlyArray<GuardChange<T>>, ctx: GuardContext<T>) => Promise<void> | void;
|
|
5036
|
+
};
|
|
5037
|
+
}
|
|
5038
|
+
|
|
5039
|
+
/**
|
|
5040
|
+
* Commit-time changeset invariants for ordinary transactions.
|
|
5041
|
+
*
|
|
5042
|
+
* Today the only set-level invariant hook is `amendment.invariant`, which
|
|
5043
|
+
* fires solely inside `db.transaction({ amendment: true }, …)` and requires
|
|
5044
|
+
* an admin/owner role plus a registered guard. That is the right shape for
|
|
5045
|
+
* the WORM-override path, but normal application transactions also need
|
|
5046
|
+
* cross-record invariants that hold on every commit — e.g. niwat's
|
|
5047
|
+
* `assertR1` ("every payment is 100% receipted").
|
|
5048
|
+
*
|
|
5049
|
+
* `withTransactions({ invariants: [...] })` registers such invariants. Each
|
|
5050
|
+
* one names a `scope` (a collection) and a `check(changes, ctx)` callback
|
|
5051
|
+
* that receives the commit's change-set for that collection.
|
|
5052
|
+
*
|
|
5053
|
+
* ## Semantics
|
|
5054
|
+
*
|
|
5055
|
+
* - **`scope`** is a collection name. An invariant fires only when the
|
|
5056
|
+
* committed transaction wrote at least one record in that collection.
|
|
5057
|
+
* - **When** — at commit, AFTER Phase 2 has executed all staged ops (so
|
|
5058
|
+
* `after` reflects the written record), and after the amendment commit
|
|
5059
|
+
* phase. It runs for BOTH ordinary and amendment transactions — an
|
|
5060
|
+
* amendment is still a commit and is still subject to these invariants.
|
|
5061
|
+
* - **`changes`** — one `{ before, after }` pair per touched id (deduped to
|
|
5062
|
+
* the last write per id, preserving write order). `before` is the
|
|
5063
|
+
* plaintext prior record (captured in Phase 1 before the overwrite),
|
|
5064
|
+
* `null` for an insert. `after` is the written record, `null` for a
|
|
5065
|
+
* delete.
|
|
5066
|
+
* - **Throw → revert.** A throw reverts every executed op (via the shared
|
|
5067
|
+
* `revertExecuted` unwind) and is surfaced as `InvariantError` (an
|
|
5068
|
+
* `InvariantError` thrown by the check passes through unwrapped).
|
|
5069
|
+
*
|
|
5070
|
+
* ```ts
|
|
5071
|
+
* createNoydb({ txStrategy: withTransactions({
|
|
5072
|
+
* invariants: [{
|
|
5073
|
+
* scope: 'payments',
|
|
5074
|
+
* check(changes) {
|
|
5075
|
+
* for (const { after } of changes) {
|
|
5076
|
+
* const p = after as Payment | null
|
|
5077
|
+
* if (p && p.receiptAmount !== p.amount) {
|
|
5078
|
+
* throw new InvariantError('R1: payment not fully receipted')
|
|
5079
|
+
* }
|
|
5080
|
+
* }
|
|
5081
|
+
* },
|
|
5082
|
+
* }],
|
|
5083
|
+
* }) })
|
|
5084
|
+
* ```
|
|
5085
|
+
*/
|
|
5086
|
+
|
|
5087
|
+
/**
|
|
5088
|
+
* A commit-time set-level invariant for ordinary (and amendment)
|
|
5089
|
+
* transactions. See module docs for full semantics.
|
|
5090
|
+
*/
|
|
5091
|
+
interface TransactionInvariant {
|
|
5092
|
+
/**
|
|
5093
|
+
* The collection this invariant watches. The `check` fires only when the
|
|
5094
|
+
* committed transaction wrote at least one record in this collection.
|
|
5095
|
+
*/
|
|
5096
|
+
readonly scope: string;
|
|
5097
|
+
/**
|
|
5098
|
+
* Validate the change-set for {@link scope}. `changes` carries one
|
|
5099
|
+
* `{ before, after }` pair per touched id (deduped to last-write,
|
|
5100
|
+
* write-order preserved); `before` is the plaintext prior record (null
|
|
5101
|
+
* on insert), `after` is the written record (null on delete). Throw to
|
|
5102
|
+
* revert the whole transaction — the throw is surfaced as
|
|
5103
|
+
* `InvariantError`.
|
|
5104
|
+
*/
|
|
5105
|
+
check: (changes: ReadonlyArray<GuardChange<unknown>>, ctx: GuardContext<unknown>) => Promise<void> | void;
|
|
5106
|
+
}
|
|
5107
|
+
|
|
4896
5108
|
/**
|
|
4897
5109
|
* Multi-record atomic transactions.
|
|
4898
5110
|
*
|
|
@@ -5078,7 +5290,7 @@ declare class TxCollection<T> {
|
|
|
5078
5290
|
* helper) so nested side-effect derivation writes get registered for
|
|
5079
5291
|
* revert alongside the bulk-put source ops.
|
|
5080
5292
|
*/
|
|
5081
|
-
declare function runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Promise<T> | T, options?: AmendmentTxOptions): Promise<T>;
|
|
5293
|
+
declare function runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Promise<T> | T, options?: AmendmentTxOptions, txInvariants?: ReadonlyArray<TransactionInvariant>): Promise<T>;
|
|
5082
5294
|
|
|
5083
5295
|
/**
|
|
5084
5296
|
* Dry-run transactions. Runs the tx body to STAGE ops, then builds
|
|
@@ -6643,139 +6855,6 @@ declare function loadActiveDelegations(store: NoydbStore, vault: string, user: U
|
|
|
6643
6855
|
*/
|
|
6644
6856
|
declare function revokeDelegation(store: NoydbStore, vault: string, id: string): Promise<void>;
|
|
6645
6857
|
|
|
6646
|
-
/**
|
|
6647
|
-
* Minimum read surface exposed to guard `check` functions. Intentionally
|
|
6648
|
-
* narrow — guards can read other collections but never write.
|
|
6649
|
-
*
|
|
6650
|
-
* `query()` returns the same chainable builder used elsewhere. `Query<T>`
|
|
6651
|
-
* has no write terminals (no `.update()` / `.delete()`) so exposing it
|
|
6652
|
-
* here preserves the read-only contract while letting guards aggregate
|
|
6653
|
-
* with `.where().aggregate()` / `.groupBy()` / `.join()` instead of
|
|
6654
|
-
* decrypting every sibling row via `.list()`.
|
|
6655
|
-
*/
|
|
6656
|
-
interface ReadOnlyVaultFacade$1 {
|
|
6657
|
-
collection<T = unknown>(name: string): {
|
|
6658
|
-
get(id: string): Promise<T | null>;
|
|
6659
|
-
list(): Promise<T[]>;
|
|
6660
|
-
query(): Query<T>;
|
|
6661
|
-
};
|
|
6662
|
-
}
|
|
6663
|
-
/**
|
|
6664
|
-
* Runtime context passed to `check` and `invariant` callbacks.
|
|
6665
|
-
* `existing` is the currently-persisted record (null for inserts).
|
|
6666
|
-
*/
|
|
6667
|
-
interface GuardContext<T> {
|
|
6668
|
-
existing: T | null;
|
|
6669
|
-
vault: ReadOnlyVaultFacade$1;
|
|
6670
|
-
userId: string;
|
|
6671
|
-
role: Role;
|
|
6672
|
-
}
|
|
6673
|
-
/**
|
|
6674
|
-
* One {before, after} pair handed to an `invariant` function. `before`
|
|
6675
|
-
* is null for inserts; `after` reflects the proposed post-commit record.
|
|
6676
|
-
*/
|
|
6677
|
-
interface GuardChange<T> {
|
|
6678
|
-
before: T | null;
|
|
6679
|
-
after: T;
|
|
6680
|
-
}
|
|
6681
|
-
/** @internal — output of {@link withGuard}. */
|
|
6682
|
-
interface GuardStrategyHandle<T extends Record<string, unknown>> {
|
|
6683
|
-
readonly __noydb_strategy: 'guard';
|
|
6684
|
-
readonly spec: GuardStrategy<T>;
|
|
6685
|
-
}
|
|
6686
|
-
/**
|
|
6687
|
-
* Existential erasure of `GuardStrategyHandle<T>` — used as the
|
|
6688
|
-
* element type of `ReadonlyArray<>` fields where the per-handle T
|
|
6689
|
-
* differs (e.g. `guardStrategies: [invoiceGuard, disbursementGuard]`).
|
|
6690
|
-
*
|
|
6691
|
-
* Background: `GuardStrategyHandle<T>` is INVARIANT in T because T
|
|
6692
|
-
* appears in callback positions on the spec (`check(incoming: T, ctx)`,
|
|
6693
|
-
* `invariant(changes: ReadonlyArray<GuardChange<T>>, ctx)`). So
|
|
6694
|
-
* `Handle<Invoice>` is not assignable to `Handle<Record<string, unknown>>`.
|
|
6695
|
-
* A bounded existential ("there exists some T satisfying the constraint
|
|
6696
|
-
* such that this is a Handle<T>") is the right shape; TypeScript has
|
|
6697
|
-
* no first-class existentials, so we fake it with a structurally narrow
|
|
6698
|
-
* interface that ERASES T from both the discriminant and the spec.
|
|
6699
|
-
*
|
|
6700
|
-
* Consumers continue to construct typed handles via `withGuard<T>(...)`
|
|
6701
|
-
* which returns `GuardStrategyHandle<T>`. Both `Handle<Invoice>` and
|
|
6702
|
-
* `Handle<Disbursement>` structurally assign to `GuardStrategyHandleAny`,
|
|
6703
|
-
* so an array of them is `GuardStrategyHandleAny[]`.
|
|
6704
|
-
*
|
|
6705
|
-
* Internal code that needs T re-narrows via the runtime discriminant
|
|
6706
|
-
* (`__noydb_strategy === 'guard'`) plus per-handle type information
|
|
6707
|
-
* carried by the registry.
|
|
6708
|
-
*
|
|
6709
|
-
* NOT exported from the public barrel — keeping this internal
|
|
6710
|
-
* discourages consumers from constructing it directly. Used only as
|
|
6711
|
-
* the array-element type on `Vault` / `NoydbOptions.guardStrategies`.
|
|
6712
|
-
*
|
|
6713
|
-
* @internal
|
|
6714
|
-
*/
|
|
6715
|
-
interface GuardStrategyHandleAny {
|
|
6716
|
-
readonly __noydb_strategy: 'guard';
|
|
6717
|
-
readonly spec: GuardStrategy<any>;
|
|
6718
|
-
}
|
|
6719
|
-
/** Public registration shape. See `withGuard()`. */
|
|
6720
|
-
interface GuardStrategy<T extends Record<string, unknown>> {
|
|
6721
|
-
collection: string;
|
|
6722
|
-
/**
|
|
6723
|
-
* Fires on `Collection.put` (insert + update). The `incoming` argument
|
|
6724
|
-
* is the record being written. Throw to cancel the put.
|
|
6725
|
-
*
|
|
6726
|
-
* Does NOT fire on `Collection.delete` — use {@link onDelete} for
|
|
6727
|
-
* delete-time validation. Skipped during an amendment transaction
|
|
6728
|
-
* (`db.transaction({ amendment: true })`) — admin/owner override.
|
|
6729
|
-
*/
|
|
6730
|
-
check?: (incoming: T, ctx: GuardContext<T>) => Promise<void> | void;
|
|
6731
|
-
/**
|
|
6732
|
-
* Fires on user-initiated `Collection.delete` before the adapter
|
|
6733
|
-
* delete and before the ledger append. The `existing` argument is
|
|
6734
|
-
* the currently-persisted record. Throw to cancel the delete — no
|
|
6735
|
-
* partial state, no tombstone ledger entry.
|
|
6736
|
-
*
|
|
6737
|
-
* Skipped during an amendment transaction (admin/owner override) —
|
|
6738
|
-
* amendments are the unlock primitive. To make a delete TRULY
|
|
6739
|
-
* unconditional (e.g. legal-document immutability rules), pair
|
|
6740
|
-
* `onDelete` with an `amendment.invariant` that re-throws on any
|
|
6741
|
-
* `before !== null && after === null` change:
|
|
6742
|
-
*
|
|
6743
|
-
* ```ts
|
|
6744
|
-
* withGuard<Receipt>({
|
|
6745
|
-
* collection: 'receipts',
|
|
6746
|
-
* onDelete: () => { throw new RecordLockedError(...) },
|
|
6747
|
-
* amendment: {
|
|
6748
|
-
* roles: ['admin', 'owner'],
|
|
6749
|
-
* invariant: (changes) => {
|
|
6750
|
-
* for (const c of changes) {
|
|
6751
|
-
* if (c.before !== null && c.after === null) {
|
|
6752
|
-
* throw new RecordLockedError(...) // wrapped as InvariantError
|
|
6753
|
-
* }
|
|
6754
|
-
* }
|
|
6755
|
-
* },
|
|
6756
|
-
* },
|
|
6757
|
-
* })
|
|
6758
|
-
* ```
|
|
6759
|
-
*
|
|
6760
|
-
* Also skipped on system-internal deletes (derivation tombstones,
|
|
6761
|
-
* MV refresh from Dim 14 v2) — those use `_internalDelete`
|
|
6762
|
-
* which bypasses every user-facing delete hook. Housekeeping ops are
|
|
6763
|
-
* NOT user-initiated and should not trip user invariants.
|
|
6764
|
-
*
|
|
6765
|
-
* Delete of an absent record is a no-op and does not consult any
|
|
6766
|
-
* guard, matching the idempotent-delete contract.
|
|
6767
|
-
*/
|
|
6768
|
-
onDelete?: (existing: T, ctx: GuardContext<T>) => Promise<void> | void;
|
|
6769
|
-
frozenFields?: {
|
|
6770
|
-
when: (existing: T) => boolean;
|
|
6771
|
-
fields: ReadonlyArray<keyof T>;
|
|
6772
|
-
};
|
|
6773
|
-
amendment?: {
|
|
6774
|
-
roles: ReadonlyArray<'admin' | 'owner'>;
|
|
6775
|
-
invariant: (changes: ReadonlyArray<GuardChange<T>>, ctx: GuardContext<T>) => Promise<void> | void;
|
|
6776
|
-
};
|
|
6777
|
-
}
|
|
6778
|
-
|
|
6779
6858
|
/**
|
|
6780
6859
|
* Runtime context handed to `derive(source, ctx)`. Mirrors `GuardContext`'s
|
|
6781
6860
|
* narrow shape: read-only vault access, no write capability, no
|
|
@@ -6876,6 +6955,32 @@ type OutputSpec = RecordOutputSpec | ArrayOutputSpec;
|
|
|
6876
6955
|
interface DerivationStrategy<TSource extends Record<string, unknown>, TOutputs extends Record<string, Record<string, unknown>>> {
|
|
6877
6956
|
/** Source collection name. */
|
|
6878
6957
|
source: string;
|
|
6958
|
+
/**
|
|
6959
|
+
* Additional collections whose writes ALSO re-fire this derivation
|
|
6960
|
+
* (issue #344). By default only writes to the single declared
|
|
6961
|
+
* `source` re-trigger a derivation; a `derive` that reads sibling
|
|
6962
|
+
* collections via `ctx.vault` therefore goes stale when those
|
|
6963
|
+
* siblings change. Declare those sibling collections here to wire
|
|
6964
|
+
* them as extra triggers.
|
|
6965
|
+
*
|
|
6966
|
+
* **SAME-ID assumption (load-bearing):** when a write lands on one of
|
|
6967
|
+
* these declared collections, the derivation re-fires with the
|
|
6968
|
+
* PRIMARY `source` record read at the SAME id as the written record
|
|
6969
|
+
* — NOT the written sibling record itself. If no primary `source`
|
|
6970
|
+
* record exists at that id, the re-fire is a silent no-op (no throw,
|
|
6971
|
+
* no output mutation). Model your collections so the sibling and the
|
|
6972
|
+
* primary share an id (the common money/accounting case: an
|
|
6973
|
+
* `allocations` row and its `payments`/`bills` keyed by the same id),
|
|
6974
|
+
* or trigger off a collection you control the id-space of.
|
|
6975
|
+
*
|
|
6976
|
+
* Declared collections participate in cycle detection and are indexed
|
|
6977
|
+
* in the registry's `_bySource` exactly like `source`, so a sibling
|
|
6978
|
+
* that is also a derivation output forms a detectable cycle.
|
|
6979
|
+
*
|
|
6980
|
+
* Each entry must be a non-empty string and must not equal `source`
|
|
6981
|
+
* (validated at `withDerivation()` construction time).
|
|
6982
|
+
*/
|
|
6983
|
+
sources?: ReadonlyArray<string>;
|
|
6879
6984
|
/** v1: only deterministic derivations supported. */
|
|
6880
6985
|
deterministic: true;
|
|
6881
6986
|
/**
|
|
@@ -7043,8 +7148,39 @@ interface UnionSource<TRow extends Record<string, unknown>> {
|
|
|
7043
7148
|
* unified stream and never reaches `groupBy` / `aggregate`. This
|
|
7044
7149
|
* removes the need for sentinel rows (e.g. `{ amount: 0 }`) whose
|
|
7045
7150
|
* sole purpose is to be aggregated away (#297).
|
|
7151
|
+
*
|
|
7152
|
+
* When this arm declares {@link join}, the aliased right-side
|
|
7153
|
+
* record(s) are attached to the source row under each leg's `as`
|
|
7154
|
+
* BEFORE `map` runs, so `map` can read `sourceRow[leg.as]`.
|
|
7046
7155
|
*/
|
|
7047
7156
|
readonly map: (sourceRow: Record<string, unknown>) => TRow | null | undefined;
|
|
7157
|
+
/**
|
|
7158
|
+
* Optional FK joins to apply to this arm's rows before {@link map}.
|
|
7159
|
+
* Each leg resolves a `ref()`-declared foreign key on the arm's
|
|
7160
|
+
* source collection into an attached right-side record under
|
|
7161
|
+
* `as` — the same machinery as the query-form `Query.join()`.
|
|
7162
|
+
*
|
|
7163
|
+
* The right-side collections must be listed in the strategy's
|
|
7164
|
+
* {@link MaterializedViewStrategy.sources} so writes to them trigger
|
|
7165
|
+
* MV refresh — registration throws `MaterializedViewConfigError`
|
|
7166
|
+
* otherwise (the union dependency set comes from arm `collection`s
|
|
7167
|
+
* alone, which would not include join targets).
|
|
7168
|
+
*/
|
|
7169
|
+
readonly join?: ReadonlyArray<UnionArmJoin>;
|
|
7170
|
+
}
|
|
7171
|
+
/**
|
|
7172
|
+
* One FK join leg on a UNION arm. Mirrors the option shape of the
|
|
7173
|
+
* query-form `Query.join(field, { as, maxRows?, strategy? })`.
|
|
7174
|
+
*/
|
|
7175
|
+
interface UnionArmJoin {
|
|
7176
|
+
/** FK field on the arm's source collection (must have a `ref()` declared). */
|
|
7177
|
+
readonly field: string;
|
|
7178
|
+
/** Alias under which the resolved right-side record attaches on the source row. */
|
|
7179
|
+
readonly as: string;
|
|
7180
|
+
/** Per-side row ceiling override. `undefined` → the join default. */
|
|
7181
|
+
readonly maxRows?: number;
|
|
7182
|
+
/** Planner strategy override. `undefined` → auto-select. */
|
|
7183
|
+
readonly strategy?: JoinStrategy;
|
|
7048
7184
|
}
|
|
7049
7185
|
/**
|
|
7050
7186
|
* Registration shape passed to `withMaterializedView()`.
|
|
@@ -7083,7 +7219,12 @@ interface MaterializedViewStrategy<TRow extends Record<string, unknown>> {
|
|
|
7083
7219
|
*
|
|
7084
7220
|
* Mutually exclusive with {@link query}. Registration throws
|
|
7085
7221
|
* `MaterializedViewConfigError` if both are set, if `unionSources`
|
|
7086
|
-
*
|
|
7222
|
+
* is empty, or if two arms name the same `collection`.
|
|
7223
|
+
*
|
|
7224
|
+
* A SINGLE arm is valid (#331): it expresses map→group→aggregate
|
|
7225
|
+
* over one collection with a COMPUTED bucket key (e.g. a month
|
|
7226
|
+
* sliced from a date field). The query form's `.groupBy()` accepts
|
|
7227
|
+
* stored field names only, so a derived key needs the arm's `map`.
|
|
7087
7228
|
*
|
|
7088
7229
|
* UNION mode replaces the dependency-analyzer path: the source
|
|
7089
7230
|
* collections come directly from `unionSources[].collection`, and
|
|
@@ -7111,6 +7252,25 @@ interface MaterializedViewStrategy<TRow extends Record<string, unknown>> {
|
|
|
7111
7252
|
* UNION-mode only. Ignored if {@link query} is set.
|
|
7112
7253
|
*/
|
|
7113
7254
|
aggregate?: AggregateSpec;
|
|
7255
|
+
/**
|
|
7256
|
+
* Money descriptors for the UNION-mode aggregate, keyed by the
|
|
7257
|
+
* OUTPUT/intermediate field name as it appears in the mapped row and
|
|
7258
|
+
* in {@link aggregate} (NOT the source collection's field name). When
|
|
7259
|
+
* declared, any `sum` / `min` / `max` over a keyed field is rewritten
|
|
7260
|
+
* into an exact per-currency BigInt reducer — without this, money
|
|
7261
|
+
* aggregation in UNION mode silently runs in float (since the
|
|
7262
|
+
* concatenated mapped stream is a plain array with no collection
|
|
7263
|
+
* money context to inherit).
|
|
7264
|
+
*
|
|
7265
|
+
* UNION-mode only — the query form inherits its money descriptors
|
|
7266
|
+
* from the source collection automatically. The descriptor's
|
|
7267
|
+
* currency/scale must match what the arms' `map()` emits for that
|
|
7268
|
+
* field (each arm maps into the same unified shape, so one descriptor
|
|
7269
|
+
* per output field covers all arms). Meaningless without
|
|
7270
|
+
* {@link aggregate}; registration throws `MaterializedViewConfigError`
|
|
7271
|
+
* if declared alone.
|
|
7272
|
+
*/
|
|
7273
|
+
moneyFields?: Record<string, MoneyDescriptor>;
|
|
7114
7274
|
/**
|
|
7115
7275
|
* Pure function from a materialized row → stable id used in the
|
|
7116
7276
|
* output collection. Required — explicit always beats default-with-pitfalls
|
|
@@ -7307,6 +7467,50 @@ interface OverlayedViewStrategy {
|
|
|
7307
7467
|
*/
|
|
7308
7468
|
shadowField: string;
|
|
7309
7469
|
shadowValue: unknown;
|
|
7470
|
+
/**
|
|
7471
|
+
* Optional field-level merge mode (AU+032 / #348). When present, a
|
|
7472
|
+
* row whose `shadowField` does NOT equal `shadowValue` is no longer
|
|
7473
|
+
* forced all-base: the rules below let an intermediate status pull a
|
|
7474
|
+
* declared subset of fields from the overlay while every other field
|
|
7475
|
+
* still comes from the base row.
|
|
7476
|
+
*
|
|
7477
|
+
* Absent `mergeMode` preserves the original binary behaviour
|
|
7478
|
+
* exactly — overlay wins entirely iff `shadowField === shadowValue`,
|
|
7479
|
+
* otherwise base wins.
|
|
7480
|
+
*/
|
|
7481
|
+
mergeMode?: OverlayFieldMergeMode;
|
|
7482
|
+
}
|
|
7483
|
+
/**
|
|
7484
|
+
* One field-level merge rule. When the overlay row's `shadowField`
|
|
7485
|
+
* equals `whenStatus`, the merged row takes `overlayFields` from the
|
|
7486
|
+
* overlay and every other field from the base row.
|
|
7487
|
+
*
|
|
7488
|
+
* Always include `shadowField` in `overlayFields` so the status value
|
|
7489
|
+
* itself propagates to the merged read (otherwise the merged row would
|
|
7490
|
+
* carry the base's status, which is usually `undefined`).
|
|
7491
|
+
*/
|
|
7492
|
+
interface OverlayFieldMergeRule {
|
|
7493
|
+
/** The `overlay[shadowField]` value this rule matches. */
|
|
7494
|
+
readonly whenStatus: unknown;
|
|
7495
|
+
/**
|
|
7496
|
+
* Field names pulled from the overlay row when this rule matches.
|
|
7497
|
+
* Fields absent on the overlay row are skipped (base value kept).
|
|
7498
|
+
*/
|
|
7499
|
+
readonly overlayFields: readonly string[];
|
|
7500
|
+
}
|
|
7501
|
+
/**
|
|
7502
|
+
* Field-level merge configuration. `rules` are evaluated in
|
|
7503
|
+
* declaration order and the FIRST rule whose `whenStatus` matches the
|
|
7504
|
+
* overlay's `shadowField` wins; later rules are not consulted.
|
|
7505
|
+
*
|
|
7506
|
+
* The binary shadow check (`shadowField === shadowValue` → overlay
|
|
7507
|
+
* wins entirely) is always the implicit, highest-priority rule applied
|
|
7508
|
+
* BEFORE any `rules` entry, so adding `mergeMode` never changes the
|
|
7509
|
+
* full-override path.
|
|
7510
|
+
*/
|
|
7511
|
+
interface OverlayFieldMergeMode {
|
|
7512
|
+
readonly kind: 'field-merge';
|
|
7513
|
+
readonly rules: readonly OverlayFieldMergeRule[];
|
|
7310
7514
|
}
|
|
7311
7515
|
/** Returned by `withOverlayedView()` and consumed by `createNoydb`. */
|
|
7312
7516
|
interface OverlayedViewStrategyHandle {
|
|
@@ -7383,11 +7587,53 @@ interface NextOptions {
|
|
|
7383
7587
|
/** Deferred mode: reject after this many ms if still unsealed (reserved; not yet enforced in this slice). */
|
|
7384
7588
|
readonly timeoutMs?: number;
|
|
7385
7589
|
}
|
|
7590
|
+
/**
|
|
7591
|
+
* Partitioning for a CAS sequence (#345). A partitioned sequence is an
|
|
7592
|
+
* independent counter scoped to one tuple of values — e.g.
|
|
7593
|
+
* `sequence('invoice', { partition: [2026, 'EU'] })` numbers EU-2026 invoices
|
|
7594
|
+
* separately from `[2026, 'US']` and from the bare `invoice` series.
|
|
7595
|
+
*
|
|
7596
|
+
* Partition components are URI-encoded (so `/`, null bytes and other
|
|
7597
|
+
* separators in a value can never collide with the structural separators) and
|
|
7598
|
+
* `'/'`-joined, then appended to the series with a null-byte (`\x00`)
|
|
7599
|
+
* separator. The null byte is illegal in a plain series name, which guarantees
|
|
7600
|
+
* a partitioned key is always disjoint from any unpartitioned series.
|
|
7601
|
+
*/
|
|
7602
|
+
interface SequenceOptions {
|
|
7603
|
+
/** Partition tuple. Each component is URI-encoded and `'/'`-joined. */
|
|
7604
|
+
readonly partition?: readonly (string | number)[];
|
|
7605
|
+
}
|
|
7606
|
+
/**
|
|
7607
|
+
* Resolve the CAS storage key for a (series, partition) pair.
|
|
7608
|
+
*
|
|
7609
|
+
* With no partition the key is `series` verbatim. With a partition the key is
|
|
7610
|
+
* `${series}\x00${parts}` where `parts` is each component passed through
|
|
7611
|
+
* `encodeURIComponent(String(part))` and `'/'`-joined. The null-byte separator
|
|
7612
|
+
* is illegal in a plain series name, so partitioned keys never collide with
|
|
7613
|
+
* unpartitioned ones; URI-encoding keeps any component containing `/` distinct
|
|
7614
|
+
* from a multi-component partition.
|
|
7615
|
+
*
|
|
7616
|
+
* @throws {ValidationError} if any partition component is empty after `String()`
|
|
7617
|
+
* or is a non-finite number (`NaN`, `±Infinity`).
|
|
7618
|
+
*/
|
|
7619
|
+
declare function resolveSequenceKey(series: string, opts?: SequenceOptions): string;
|
|
7386
7620
|
interface SequenceHandle {
|
|
7387
7621
|
/** Atomically allocate and return the next value (1, 2, 3, …). Deferred series resolve at the next pass. */
|
|
7388
7622
|
next(opts?: NextOptions): Promise<number>;
|
|
7389
7623
|
/** Read the current value without allocating. Returns 0 if never used. */
|
|
7390
7624
|
peek(): Promise<number>;
|
|
7625
|
+
/**
|
|
7626
|
+
* Set-if-greater: advance the counter to at least `n`. A no-op if the
|
|
7627
|
+
* current value is already `>= n` (so it never rewinds), and `seedTo(0)` is
|
|
7628
|
+
* a no-op. Idempotent and CAS-safe under concurrent `next()` / `seedTo()`.
|
|
7629
|
+
*
|
|
7630
|
+
* Use after a bundle / CSV import to fast-forward the counter past the
|
|
7631
|
+
* highest imported serial, so subsequent `next()` calls cannot re-use a
|
|
7632
|
+
* number that is already on a record.
|
|
7633
|
+
*
|
|
7634
|
+
* Online-only: throws {@link SequenceOfflineError} on a non-CAS store.
|
|
7635
|
+
*/
|
|
7636
|
+
seedTo(n: number): Promise<void>;
|
|
7391
7637
|
}
|
|
7392
7638
|
declare class SequenceStore {
|
|
7393
7639
|
private readonly adapter;
|
|
@@ -7418,6 +7664,7 @@ declare class SequenceStore {
|
|
|
7418
7664
|
private encryptState;
|
|
7419
7665
|
peek(name: string): Promise<number>;
|
|
7420
7666
|
next(name: string): Promise<number>;
|
|
7667
|
+
seedTo(name: string, n: number): Promise<void>;
|
|
7421
7668
|
}
|
|
7422
7669
|
|
|
7423
7670
|
/**
|
|
@@ -8946,7 +9193,7 @@ declare class Vault {
|
|
|
8946
9193
|
* const cur = await vault.sequence('invoice-2026').peek() // current value, no allocation
|
|
8947
9194
|
* ```
|
|
8948
9195
|
*/
|
|
8949
|
-
sequence(
|
|
9196
|
+
sequence(series: string, opts?: SequenceOptions): SequenceHandle;
|
|
8950
9197
|
/** @internal — lazily build the deferred-numbering engine with a cache-coherent stamp. */
|
|
8951
9198
|
private deferred;
|
|
8952
9199
|
/**
|
|
@@ -11358,7 +11605,7 @@ interface ShadowStrategy {
|
|
|
11358
11605
|
* @internal
|
|
11359
11606
|
*/
|
|
11360
11607
|
interface TxStrategy {
|
|
11361
|
-
runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Promise<T> | T, options?: AmendmentTxOptions): Promise<T>;
|
|
11608
|
+
runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Promise<T> | T, options?: AmendmentTxOptions, txInvariants?: ReadonlyArray<TransactionInvariant>): Promise<T>;
|
|
11362
11609
|
runDryRun(db: Noydb, fn: (tx: TxContext) => unknown): Promise<DryRunResult>;
|
|
11363
11610
|
}
|
|
11364
11611
|
|
|
@@ -13627,4 +13874,4 @@ interface DeleteManyResult {
|
|
|
13627
13874
|
}>;
|
|
13628
13875
|
}
|
|
13629
13876
|
|
|
13630
|
-
export { type ExportBlobsAuditEntry as $, BLOB_COLLECTION as A, type BlobStrategy as B, BLOB_EVICTION_AUDIT_COLLECTION as C, DICT_COLLECTION_PREFIX as D, BLOB_INDEX_COLLECTION as E, BLOB_SLOTS_PREFIX as F, BLOB_VERSIONS_PREFIX as G, type BlobEvictionEntry as H, type I18nStrategy as I, type BlobFieldPolicy as J, type BlobFieldsConfig as K, type Layer as L, type BlobObject as M, type BlobPutOptions as N, type OnMissing as O, PolicyEnforcer as P, type BlobResponseOptions as Q, type ResolveI18nOptions as R, type ScriptWarning as S, BlobSet as T, type BlobStrategyOpenArgs as U, type CompactRunOptions as V, type CompactionContext as W, type CompactionResult as X, DEFAULT_CHUNK_SIZE as Y, EXPORT_AUDIT_COLLECTION as Z, ExportBlobsAbortedError as _, type DictEntry as a, type SyncStrategy as a$, type ExportBlobsHandle as a0, type ExportBlobsOptions as a1, type ExportedBlob as a2, type SlotInfo as a3, type SlotRecord as a4, type VersionRecord as a5, createExportBlobsHandle as a6, runCompaction as a7, type ConsentStrategy as a8, CONSENT_AUDIT_COLLECTION as a9, VaultFrame as aA, type NoydbBundleStore as aB, type RetentionPolicy as aC, type SnapshotPolicy as aD, type SnapshotStrategy as aE, type SnapshotMeta as aF, type SnapshotMode as aG, type TxStrategy as aH, type AmendmentTxOptions as aI, TxCollection as aJ, TxContext as aK, TxVault as aL, runTransaction as aM, type DerivationStrategy as aN, type DerivationContext as aO, type ArrayOutputSpec as aP, DerivationRegistry as aQ, type DerivationStrategyHandle as aR, type DerivedFromMeta as aS, type OutputSpec as aT, type RecordOutputSpec as aU, type MaterializedViewStrategy as aV, type MaterializedViewStrategyHandle as aW, type OverlayedViewStrategy as aX, Collection as aY, OverlayedViewRegistry as aZ, type OverlayedViewStrategyHandle as a_, type ConsentAuditEntry as aa, type ConsentAuditFilter as ab, type ConsentContext as ac, type ConsentOp as ad, loadConsentEntries as ae, writeConsentEntry as af, type PeriodsStrategy as ag, type CarryForwardContext as ah, type ClosePeriodOptions as ai, type OpenPeriodOptions as aj, PERIODS_COLLECTION as ak, type PeriodRecord as al, type ReadOnlyCollection as am, appendPeriodLedgerEntry as an, assertTsWritable as ao, chainAnchor as ap, loadPeriods as aq, validatePeriodName as ar, type GuardStrategy as as, type GuardChange as at, type GuardContext as au, GuardRegistry as av, type GuardStrategyHandle as aw, ReadOnlyVaultFacade as ax, type ShadowStrategy as ay, CollectionFrame as az, type DictKeyDescriptor as b, type CapturedBlueprint as b$, type Role as b0, type UnlockedKeyring as b1, type HistoryStrategy as b2, type NoydbStore as b3, type HistoryOptions as b4, type EncryptedEnvelope as b5, type PruneOptions as b6, type AppendInput as b7, type ChangeType as b8, CollectionInstant as b9, type RegisteredMV as bA, MaterializedViewRegistry as bB, type MaterializedFromMeta as bC, type MaterializedViewOutput as bD, type UnionSource as bE, type UserEnvelope as bF, type GateName as bG, type GatePolicy as bH, type VaultPolicy as bI, type ActiveTier as bJ, type FactorProof as bK, type SchemaUpdateStrategy as bL, type TransformFn as bM, type PersistedSchemaEnvelope as bN, type UpdateDecision as bO, type DirectoryConfig as bP, type UserVisibility as bQ, type AccessibleVault as bR, type AffectedDocument as bS, type ArchivePolicy as bT, type ArchiveResult as bU, type ArchiveRunOptions as bV, type ArchiveStrategy as bW, BUNDLE_STORE_POLICY as bX, type BuiltInGateName as bY, type CacheOptions as bZ, type CacheStats as b_, type DiffEntry as ba, type JsonPatch as bb, type JsonPatchOp as bc, type LedgerEntry as bd, LedgerStore as be, type VaultEngine as bf, VaultInstant as bg, type VerifyResult as bh, applyPatch as bi, canonicalJson as bj, computePatch as bk, diff as bl, formatDiff as bm, hashEntry as bn, paddedIndex as bo, parseIndex as bp, sha256Hex as bq, type PublicEnvelope as br, type SealingKeyProvider as bs, type BundleRecipient as bt, type RecipientSealer as bu, type RecipientHint as bv, Vault as bw, type RecoveryEnrollmentInput as bx, type ShamirRecoveryProvider as by, type MVQueryContext as bz, DictionaryHandle as c, type KeyringFile as c$, type ChangeEvent as c0, type CollectionChangeEvent as c1, type CollectionConflictResolver as c2, type CollectionDescriptor as c3, type CollectionStats as c4, ComputedFieldError as c5, type ComputedFields as c6, type ComputedFn as c7, type Conflict as c8, type ConflictPolicy as c9, type ExportChunk as cA, type ExportFormat as cB, type ExportStreamOptions as cC, type FactorKind as cD, type FactorProofBundle as cE, type FactorRequirement as cF, type FanoutQueryOptions as cG, type FanoutResult as cH, type FenceDoc as cI, type FenceState as cJ, type FieldChange as cK, type FieldDescriptor as cL, type FieldSource as cM, type GhostRecord as cN, type GrantOptions as cO, type GuardViolation as cP, type HistoryConfig as cQ, type HistoryEntry as cR, INDEXED_STORE_POLICY as cS, type ImportCapability as cT, type InferOutput as cU, type InternalCollectionStats as cV, type IssueDelegationOptions as cW, type IssueMagicLinkGrantOptions as cX, type KeyringAuthenticator as cY, type KeyringAuthenticatorWrappingDEKs as cZ, type KeyringAuthenticatorWrappingKEK as c_, type ConflictStrategy as ca, type CrossTierAccessEvent as cb, CrossVaultAggregation as cc, CrossVaultGroupedAggregation as cd, type GroupedRow as ce, type CrossVaultLiveAggregation as cf, type CrossVaultLiveQuery as cg, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as ch, DELEGATIONS_COLLECTION as ci, type DeepPartial as cj, type DeepPartialOrNull as ck, type DeferredNumberingConfig as cl, type DelegationToken as cm, type DeleteManyResult as cn, type DeploymentEvent as co, type DerivationDescriptor as cp, type DirtyEntry as cq, type DryRunResult as cr, type DumpSchemaOptions as cs, ELEVATION_AUDIT_COLLECTION as ct, ElevatedHandle as cu, type EnrollAuthenticatorOptions as cv, type EnrollAuthenticatorWrappingDEKsOptions as cw, type EnrollAuthenticatorWrappingKEKOptions as cx, type EnrollRecoveryResult as cy, type ExportCapability as cz, type DictionaryOptions as d, type ResolvedPublicEnvelopeSchema as d$, type ListAccessibleVaultsOptions as d0, type ListPageResult as d1, type ListUsersOptions as d2, type LiveQueryOptions as d3, type LiveUserEnvelope as d4, type LocaleReadOptions as d5, Lru as d6, type LruOptions as d7, type LruStats as d8, MAGIC_LINK_CONTENT_INFO_PREFIX as d9, type PlaintextTranslatorContext as dA, type PlaintextTranslatorFn as dB, PresenceHandle as dC, type PresencePeer as dD, type PublicEnvelopeField as dE, type PublicEnvelopeSchema as dF, type PublicEnvelopeText as dG, type PullMode as dH, type PullOptions as dI, type PullPolicy as dJ, type PullResult as dK, type PushMode as dL, type PushOptions as dM, type PushPolicy as dN, type PushResult as dO, type PutManyItemOptions as dP, type PutManyOptions as dQ, type PutManyResult as dR, type QueryAcrossOptions as dS, type QueryAcrossResult as dT, type QuickUnlockState as dU, QuickUnlockStore as dV, type ReAuthOperation as dW, type RecoverPassphraseInput as dX, type RecoverPassphraseResult as dY, type RecoverUserOptions as dZ, type RecoveryProof as d_, MAGIC_LINK_GRANTS_COLLECTION as da, MAGIC_LINK_KEK_INFO_PREFIX as db, type MagicLinkGrantPayload as dc, type MagicLinkGrantRecord as dd, type MaterializedViewDescriptor as de, MemoryRecipientSealer as df, MemorySealingKeyProvider as dg, NOYDB_BACKUP_VERSION as dh, NOYDB_FORMAT_VERSION as di, NOYDB_KEYRING_VERSION as dj, NOYDB_SYNC_VERSION as dk, type NextOptions as dl, Noydb as dm, type NoydbEventMap as dn, type NoydbOptions as dp, type Assignment as dq, type OverlayViewDescriptor as dr, PUBLIC_ENVELOPE_FIELDS as ds, type PaperRecoveryDoc as dt, type PaperRecoveryEntry as du, type PassphrasePolicy as dv, type PassphraseValidationResult as dw, type Permission as dx, type Permissions as dy, type PersistedSchemaKind as dz, type I18nMap as e, type VaultPolicyOnDisk as e$, type RevokeOptions as e0, type RotatePassphraseInput as e1, type RotateRecoveryOptions as e2, type RotateRecoveryResult as e3, SEALED_PASSPHRASE_RECORD_ID as e4, type SchemaDelta as e5, type SchemaIntrospection as e6, type SchemaManifestRow as e7, type SealedEnvelope as e8, type SealedPassphrase as e9, type SyncStatus as eA, type SyncTarget as eB, type SyncTargetRole as eC, SyncTransaction as eD, type SyncTransactionResult as eE, type TabChannel as eF, type TabCoordinationOptions as eG, type TabLockManager as eH, type TabPresence as eI, type TabRole as eJ, type TierMode as eK, type TranslatorAuditEntry as eL, type TxOp as eM, USER_ENVELOPE_COLLECTION as eN, USER_ENVELOPE_MAX_BYTES as eO, type Unsubscribe as eP, type UpdateAuthenticatorOptions as eQ, type UpdateContext as eR, type UpdateUserOptions as eS, UserApi as eT, type UserEnvelopeCheckGate as eU, UserEnvelopeOversizedError as eV, type UserEnvelopePresented as eW, type UserInfo as eX, type VaultBackup as eY, VaultGroup as eZ, type VaultGroupOptions as e_, type SequenceHandle as ea, SequenceStore as eb, type SessionPolicy as ec, type SetPublicEnvelopeInput as ed, type ShamirRecoveryDoc as ee, type ShamirRecoveryEntry as ef, ShardedCollection as eg, ShardedGroupedQuery as eh, ShardedQuery as ei, type ShardingConfig as ej, type SkippedVault as ek, type SlotRewrapCeremony as el, type SlotRewrapContext as em, type StandardSchemaV1 as en, type StandardSchemaV1Issue as eo, type StandardSchemaV1SyncResult as ep, StateManagementVault as eq, type StoreAuth as er, type StoreAuthKind as es, type StoreCapabilities as et, type StoreTime as eu, SyncEngine as ev, type SyncMetadata as ew, type SyncPolicy as ex, SyncScheduler as ey, type SyncSchedulerStatus as ez, type I18nTextDescriptor as f, withDeferredNumbering as f$, type VaultRegistryRow as f0, type VaultSchemaSnapshot as f1, type VaultSnapshot as f2, type VaultTemplate as f3, type WarningRules as f4, WeakPassphraseError as f5, type WeakPassphraseReason as f6, type WithArchiveOptions as f7, type WrappedDeksBlob as f8, type WriteConflict as f9, loadActiveDelegations as fA, loadPaperRecoveryEntries as fB, loadSealedPassphrase as fC, loadShamirRecoveryEntries as fD, magicLinkGrantRecordId as fE, mintPaperRecoveryEntry as fF, mintShamirRecoveryEntry as fG, mintWrappedDeksBlob as fH, parseSealedEnvelope as fI, readMagicLinkGrantRecord as fJ, recoverUser as fK, removeAuthenticator as fL, resolveSchema as fM, revokeDelegation as fN, revokeMagicLinkGrant as fO, savePaperRecoveryEntries as fP, saveSealedPassphrase as fQ, saveShamirRecoveryEntries as fR, unwrapDeksFromBlob as fS, unwrapDeksFromPaperEntry as fT, unwrapDeksFromShamirEntry as fU, unwrapMagicLinkGrant as fV, validatePassphrase as fW, validatePublicEnvelopeInput as fX, validateSchemaInput as fY, validateSchemaOutput as fZ, withArchive as f_, type WriteEvent as fa, type WriteHook as fb, type WriteQueue as fc, assertStrongPassphrase as fd, buildRecipientKeyringFile as fe, burnPaperRecoveryEntry as ff, createNoydb as fg, createStore as fh, deriveMagicLinkContentKey as fi, enrollAuthenticator as fj, estimateEntropy as fk, evalComputedFields as fl, evaluateExportCapability as fm, evaluateImportCapability as fn, findAuthenticator as fo, hasExportCapability as fp, hasImportCapability as fq, hasRecoveryEnrolled as fr, isMagicLinkGrantExpired as fs, isPublicEnvelope as ft, issueDelegation as fu, recoverPassphrase as fv, rotatePassphrase as fw, listMagicLinkGrants as fx, listUsers as fy, listUsersWithEnvelopes as fz, type I18nTextOptions as g, writeMagicLinkGrant as g0, changeSecret as g1, createOwnerKeyring as g2, ensureCollectionDEK as g3, grant as g4, loadKeyring as g5, persistKeyring as g6, revoke as g7, updateAuthenticator as g8, updateKeyringIdentity as g9, type OnMissingPolicy as h, applyI18nLocale as i, dictCollectionName as j, dictKey as k, enforceScript as l, getAtPath as m, i18nText as n, inferScripts as o, isDictCollectionName as p, isDictKeyDescriptor as q, isI18nTextDescriptor as r, resolveI18nText as s, resolvePolicy as t, setAtPathInPlace as u, validateI18nTextValue as v, type SessionStrategy as w, createEnforcer as x, validateSessionPolicy as y, BLOB_CHUNKS_COLLECTION as z };
|
|
13877
|
+
export { type ExportBlobsAuditEntry as $, BLOB_COLLECTION as A, type BlobStrategy as B, BLOB_EVICTION_AUDIT_COLLECTION as C, DICT_COLLECTION_PREFIX as D, BLOB_INDEX_COLLECTION as E, BLOB_SLOTS_PREFIX as F, BLOB_VERSIONS_PREFIX as G, type BlobEvictionEntry as H, type I18nStrategy as I, type BlobFieldPolicy as J, type BlobFieldsConfig as K, type Layer as L, type BlobObject as M, type BlobPutOptions as N, type OnMissing as O, PolicyEnforcer as P, type BlobResponseOptions as Q, type ResolveI18nOptions as R, type ScriptWarning as S, BlobSet as T, type BlobStrategyOpenArgs as U, type CompactRunOptions as V, type CompactionContext as W, type CompactionResult as X, DEFAULT_CHUNK_SIZE as Y, EXPORT_AUDIT_COLLECTION as Z, ExportBlobsAbortedError as _, type DictEntry as a, type NoydbStore as a$, type ExportBlobsHandle as a0, type ExportBlobsOptions as a1, type ExportedBlob as a2, type SlotInfo as a3, type SlotRecord as a4, type VersionRecord as a5, createExportBlobsHandle as a6, runCompaction as a7, type ConsentStrategy as a8, CONSENT_AUDIT_COLLECTION as a9, VaultFrame as aA, type NoydbBundleStore as aB, type RetentionPolicy as aC, type SnapshotPolicy as aD, type SnapshotStrategy as aE, type SnapshotMeta as aF, type SnapshotMode as aG, type DerivationStrategy as aH, type DerivationContext as aI, type ArrayOutputSpec as aJ, DerivationRegistry as aK, type DerivationStrategyHandle as aL, type DerivedFromMeta as aM, type OutputSpec as aN, type RecordOutputSpec as aO, type MaterializedViewStrategy as aP, type MaterializedViewStrategyHandle as aQ, type OverlayedViewStrategy as aR, Collection as aS, type OverlayFieldMergeMode as aT, type OverlayFieldMergeRule as aU, OverlayedViewRegistry as aV, type OverlayedViewStrategyHandle as aW, type SyncStrategy as aX, type Role as aY, type UnlockedKeyring as aZ, type HistoryStrategy as a_, type ConsentAuditEntry as aa, type ConsentAuditFilter as ab, type ConsentContext as ac, type ConsentOp as ad, loadConsentEntries as ae, writeConsentEntry as af, type PeriodsStrategy as ag, type CarryForwardContext as ah, type ClosePeriodOptions as ai, type OpenPeriodOptions as aj, PERIODS_COLLECTION as ak, type PeriodRecord as al, type ReadOnlyCollection as am, appendPeriodLedgerEntry as an, assertTsWritable as ao, chainAnchor as ap, loadPeriods as aq, validatePeriodName as ar, type GuardStrategy as as, type GuardChange as at, type GuardContext as au, GuardRegistry as av, type GuardStrategyHandle as aw, ReadOnlyVaultFacade as ax, type ShadowStrategy as ay, CollectionFrame as az, type DictKeyDescriptor as b, type CollectionChangeEvent as b$, type HistoryOptions as b0, type EncryptedEnvelope as b1, type PruneOptions as b2, type AppendInput as b3, type ChangeType as b4, CollectionInstant as b5, type DiffEntry as b6, type JsonPatch as b7, type JsonPatchOp as b8, type LedgerEntry as b9, type MaterializedViewOutput as bA, type UnionArmJoin as bB, type UnionSource as bC, type UserEnvelope as bD, type GateName as bE, type GatePolicy as bF, type VaultPolicy as bG, type ActiveTier as bH, type FactorProof as bI, type SchemaUpdateStrategy as bJ, type TransformFn as bK, type PersistedSchemaEnvelope as bL, type UpdateDecision as bM, type DirectoryConfig as bN, type UserVisibility as bO, type AccessibleVault as bP, type AffectedDocument as bQ, type ArchivePolicy as bR, type ArchiveResult as bS, type ArchiveRunOptions as bT, type ArchiveStrategy as bU, BUNDLE_STORE_POLICY as bV, type BuiltInGateName as bW, type CacheOptions as bX, type CacheStats as bY, type CapturedBlueprint as bZ, type ChangeEvent as b_, LedgerStore as ba, type VaultEngine as bb, VaultInstant as bc, type VerifyResult as bd, applyPatch as be, canonicalJson as bf, computePatch as bg, diff as bh, formatDiff as bi, hashEntry as bj, paddedIndex as bk, parseIndex as bl, sha256Hex as bm, type PublicEnvelope as bn, type SealingKeyProvider as bo, type BundleRecipient as bp, type RecipientSealer as bq, type RecipientHint as br, Vault as bs, type RecoveryEnrollmentInput as bt, type ShamirRecoveryProvider as bu, TxContext as bv, type MVQueryContext as bw, type RegisteredMV as bx, MaterializedViewRegistry as by, type MaterializedFromMeta as bz, DictionaryHandle as c, type ListPageResult as c$, type CollectionConflictResolver as c0, type CollectionDescriptor as c1, type CollectionStats as c2, ComputedFieldError as c3, type ComputedFields as c4, type ComputedFn as c5, type Conflict as c6, type ConflictPolicy as c7, type ConflictStrategy as c8, type CrossTierAccessEvent as c9, type ExportStreamOptions as cA, type FactorKind as cB, type FactorProofBundle as cC, type FactorRequirement as cD, type FanoutQueryOptions as cE, type FanoutResult as cF, type FenceDoc as cG, type FenceState as cH, type FieldChange as cI, type FieldDescriptor as cJ, type FieldSource as cK, type GhostRecord as cL, type GrantOptions as cM, type GuardViolation as cN, type HistoryConfig as cO, type HistoryEntry as cP, INDEXED_STORE_POLICY as cQ, type ImportCapability as cR, type InferOutput as cS, type InternalCollectionStats as cT, type IssueDelegationOptions as cU, type IssueMagicLinkGrantOptions as cV, type KeyringAuthenticator as cW, type KeyringAuthenticatorWrappingDEKs as cX, type KeyringAuthenticatorWrappingKEK as cY, type KeyringFile as cZ, type ListAccessibleVaultsOptions as c_, CrossVaultAggregation as ca, CrossVaultGroupedAggregation as cb, type GroupedRow as cc, type CrossVaultLiveAggregation as cd, type CrossVaultLiveQuery as ce, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as cf, DELEGATIONS_COLLECTION as cg, type DeepPartial as ch, type DeepPartialOrNull as ci, type DeferredNumberingConfig as cj, type DelegationToken as ck, type DeleteManyResult as cl, type DeploymentEvent as cm, type DerivationDescriptor as cn, type DirtyEntry as co, type DryRunResult as cp, type DumpSchemaOptions as cq, ELEVATION_AUDIT_COLLECTION as cr, ElevatedHandle as cs, type EnrollAuthenticatorOptions as ct, type EnrollAuthenticatorWrappingDEKsOptions as cu, type EnrollAuthenticatorWrappingKEKOptions as cv, type EnrollRecoveryResult as cw, type ExportCapability as cx, type ExportChunk as cy, type ExportFormat as cz, type DictionaryOptions as d, type RotatePassphraseInput as d$, type ListUsersOptions as d0, type LiveQueryOptions as d1, type LiveUserEnvelope as d2, type LocaleReadOptions as d3, Lru as d4, type LruOptions as d5, type LruStats as d6, MAGIC_LINK_CONTENT_INFO_PREFIX as d7, MAGIC_LINK_GRANTS_COLLECTION as d8, MAGIC_LINK_KEK_INFO_PREFIX as d9, PresenceHandle as dA, type PresencePeer as dB, type PublicEnvelopeField as dC, type PublicEnvelopeSchema as dD, type PublicEnvelopeText as dE, type PullMode as dF, type PullOptions as dG, type PullPolicy as dH, type PullResult as dI, type PushMode as dJ, type PushOptions as dK, type PushPolicy as dL, type PushResult as dM, type PutManyItemOptions as dN, type PutManyOptions as dO, type PutManyResult as dP, type QueryAcrossOptions as dQ, type QueryAcrossResult as dR, type QuickUnlockState as dS, QuickUnlockStore as dT, type ReAuthOperation as dU, type RecoverPassphraseInput as dV, type RecoverPassphraseResult as dW, type RecoverUserOptions as dX, type RecoveryProof as dY, type ResolvedPublicEnvelopeSchema as dZ, type RevokeOptions as d_, type MagicLinkGrantPayload as da, type MagicLinkGrantRecord as db, type MaterializedViewDescriptor as dc, MemoryRecipientSealer as dd, MemorySealingKeyProvider as de, NOYDB_BACKUP_VERSION as df, NOYDB_FORMAT_VERSION as dg, NOYDB_KEYRING_VERSION as dh, NOYDB_SYNC_VERSION as di, type NextOptions as dj, Noydb as dk, type NoydbEventMap as dl, type NoydbOptions as dm, type Assignment as dn, type OverlayViewDescriptor as dp, PUBLIC_ENVELOPE_FIELDS as dq, type PaperRecoveryDoc as dr, type PaperRecoveryEntry as ds, type PassphrasePolicy as dt, type PassphraseValidationResult as du, type Permission as dv, type Permissions as dw, type PersistedSchemaKind as dx, type PlaintextTranslatorContext as dy, type PlaintextTranslatorFn as dz, type I18nMap as e, VaultGroup as e$, type RotateRecoveryOptions as e0, type RotateRecoveryResult as e1, SEALED_PASSPHRASE_RECORD_ID as e2, type SchemaDelta as e3, type SchemaIntrospection as e4, type SchemaManifestRow as e5, type SealedEnvelope as e6, type SealedPassphrase as e7, type SequenceHandle as e8, type SequenceOptions as e9, type SyncTarget as eA, type SyncTargetRole as eB, SyncTransaction as eC, type SyncTransactionResult as eD, type TabChannel as eE, type TabCoordinationOptions as eF, type TabLockManager as eG, type TabPresence as eH, type TabRole as eI, type TierMode as eJ, type TransactionInvariant as eK, type TranslatorAuditEntry as eL, TxCollection as eM, type TxOp as eN, TxVault as eO, USER_ENVELOPE_COLLECTION as eP, USER_ENVELOPE_MAX_BYTES as eQ, type Unsubscribe as eR, type UpdateAuthenticatorOptions as eS, type UpdateContext as eT, type UpdateUserOptions as eU, UserApi as eV, type UserEnvelopeCheckGate as eW, UserEnvelopeOversizedError as eX, type UserEnvelopePresented as eY, type UserInfo as eZ, type VaultBackup as e_, SequenceStore as ea, type SessionPolicy as eb, type SetPublicEnvelopeInput as ec, type ShamirRecoveryDoc as ed, type ShamirRecoveryEntry as ee, ShardedCollection as ef, ShardedGroupedQuery as eg, ShardedQuery as eh, type ShardingConfig as ei, type SkippedVault as ej, type SlotRewrapCeremony as ek, type SlotRewrapContext as el, type StandardSchemaV1 as em, type StandardSchemaV1Issue as en, type StandardSchemaV1SyncResult as eo, StateManagementVault as ep, type StoreAuth as eq, type StoreAuthKind as er, type StoreCapabilities as es, type StoreTime as et, SyncEngine as eu, type SyncMetadata as ev, type SyncPolicy as ew, SyncScheduler as ex, type SyncSchedulerStatus as ey, type SyncStatus as ez, type I18nTextDescriptor as f, validatePublicEnvelopeInput as f$, type VaultGroupOptions as f0, type VaultPolicyOnDisk as f1, type VaultRegistryRow as f2, type VaultSchemaSnapshot as f3, type VaultSnapshot as f4, type VaultTemplate as f5, type WarningRules as f6, WeakPassphraseError as f7, type WeakPassphraseReason as f8, type WithArchiveOptions as f9, listUsers as fA, listUsersWithEnvelopes as fB, loadActiveDelegations as fC, loadPaperRecoveryEntries as fD, loadSealedPassphrase as fE, loadShamirRecoveryEntries as fF, magicLinkGrantRecordId as fG, mintPaperRecoveryEntry as fH, mintShamirRecoveryEntry as fI, mintWrappedDeksBlob as fJ, parseSealedEnvelope as fK, readMagicLinkGrantRecord as fL, recoverUser as fM, removeAuthenticator as fN, resolveSchema as fO, resolveSequenceKey as fP, revokeDelegation as fQ, revokeMagicLinkGrant as fR, runTransaction as fS, savePaperRecoveryEntries as fT, saveSealedPassphrase as fU, saveShamirRecoveryEntries as fV, unwrapDeksFromBlob as fW, unwrapDeksFromPaperEntry as fX, unwrapDeksFromShamirEntry as fY, unwrapMagicLinkGrant as fZ, validatePassphrase as f_, type WrappedDeksBlob as fa, type WriteConflict as fb, type WriteEvent as fc, type WriteHook as fd, type WriteQueue as fe, assertStrongPassphrase as ff, buildRecipientKeyringFile as fg, burnPaperRecoveryEntry as fh, createNoydb as fi, createStore as fj, deriveMagicLinkContentKey as fk, enrollAuthenticator as fl, estimateEntropy as fm, evalComputedFields as fn, evaluateExportCapability as fo, evaluateImportCapability as fp, findAuthenticator as fq, hasExportCapability as fr, hasImportCapability as fs, hasRecoveryEnrolled as ft, isMagicLinkGrantExpired as fu, isPublicEnvelope as fv, issueDelegation as fw, recoverPassphrase as fx, rotatePassphrase as fy, listMagicLinkGrants as fz, type I18nTextOptions as g, validateSchemaInput as g0, validateSchemaOutput as g1, withArchive as g2, withDeferredNumbering as g3, writeMagicLinkGrant as g4, changeSecret as g5, createOwnerKeyring as g6, ensureCollectionDEK as g7, grant as g8, loadKeyring as g9, persistKeyring as ga, revoke as gb, updateAuthenticator as gc, updateKeyringIdentity as gd, type TxStrategy as ge, type AmendmentTxOptions as gf, type OnMissingPolicy as h, applyI18nLocale as i, dictCollectionName as j, dictKey as k, enforceScript as l, getAtPath as m, i18nText as n, inferScripts as o, isDictCollectionName as p, isDictKeyDescriptor as q, isI18nTextDescriptor as r, resolveI18nText as s, resolvePolicy as t, setAtPathInPlace as u, validateI18nTextValue as v, type SessionStrategy as w, createEnforcer as x, validateSessionPolicy as y, BLOB_CHUNKS_COLLECTION as z };
|