@atscript/db 0.1.128 → 0.1.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{db-error-DXwEzmYJ.cjs → db-error-C4JuLcvb.cjs} +27 -0
  2. package/dist/{db-error-BHPXOKzc.mjs → db-error-COrO58t5.mjs} +22 -1
  3. package/dist/{db-readable-CkbZn_z-.d.cts → db-readable-B7eYWS5q.d.cts} +10 -1
  4. package/dist/{db-readable-BTl4NzNN.d.mts → db-readable-Bn1bV_eC.d.mts} +10 -1
  5. package/dist/{db-space-BEB5Jl8M.d.mts → db-space-C2UCnGHd.d.cts} +28 -2
  6. package/dist/{db-space-BevOyVrC.d.cts → db-space-DdIPYD0Q.d.mts} +28 -2
  7. package/dist/{db-view-C8-MsjND.cjs → db-view-CRBgkEp0.cjs} +91 -4
  8. package/dist/{db-view-Ck0I-PMI.mjs → db-view-Dl0aDTiT.mjs} +91 -4
  9. package/dist/index.cjs +4 -3
  10. package/dist/index.d.cts +4 -4
  11. package/dist/index.d.mts +4 -4
  12. package/dist/index.mjs +4 -4
  13. package/dist/{nested-writer-DI-HeTky.mjs → nested-writer-CkDo-ZfH.mjs} +1 -1
  14. package/dist/{nested-writer-DoDhl3X3.cjs → nested-writer-DxPhmWFz.cjs} +1 -1
  15. package/dist/ops.cjs +1 -1
  16. package/dist/ops.mjs +1 -1
  17. package/dist/rel.cjs +2 -2
  18. package/dist/rel.d.cts +1 -1
  19. package/dist/rel.d.mts +1 -1
  20. package/dist/rel.mjs +2 -2
  21. package/dist/{relation-loader-BnUgJsUG.cjs → relation-loader-C8GOpNYJ.cjs} +1 -1
  22. package/dist/{relation-loader-BmeOMj0b.mjs → relation-loader-CUGcxJ18.mjs} +1 -1
  23. package/dist/sync.cjs +280 -143
  24. package/dist/sync.d.cts +24 -6
  25. package/dist/sync.d.mts +24 -6
  26. package/dist/sync.mjs +280 -143
  27. package/dist/{validator-eKYWf3xf.mjs → validator-CeD_fqyW.mjs} +1 -1
  28. package/dist/{validator-BNUHCXIE.cjs → validator-lkCJKuoo.cjs} +1 -1
  29. package/dist/{validator-DuAmWc8L.d.cts → validator-wBARmD68.d.cts} +21 -2
  30. package/dist/{validator-DuAmWc8L.d.mts → validator-wBARmD68.d.mts} +21 -2
  31. package/dist/validator.cjs +2 -2
  32. package/dist/validator.d.cts +1 -1
  33. package/dist/validator.d.mts +1 -1
  34. package/dist/validator.mjs +2 -2
  35. package/package.json +1 -1
@@ -50,6 +50,27 @@ var CasExhaustedError = class extends DbError {
50
50
  this.lastSeenVersion = lastSeenVersion;
51
51
  }
52
52
  };
53
+ /**
54
+ * Thrown by `AtscriptDbTable.touchMany` (`require: 'all'`, the default) when
55
+ * fewer rows than keys matched their expected version — at least one row is
56
+ * stale or missing. Nothing was written (the pre-count refused before the
57
+ * first statement, or the SQL transaction rolled every bump back). Surfaced
58
+ * as HTTP 409 by moost-db.
59
+ */
60
+ var CasMismatchError = class extends DbError {
61
+ matched;
62
+ expected;
63
+ name = "CasMismatchError";
64
+ constructor(matched, expected) {
65
+ const message = `touchMany: ${matched} of ${expected} rows matched — stale or missing rows`;
66
+ super("CAS_MISMATCH", [{
67
+ path: "$cas",
68
+ message
69
+ }], message);
70
+ this.matched = matched;
71
+ this.expected = expected;
72
+ }
73
+ };
53
74
  //#endregion
54
75
  Object.defineProperty(exports, "CasExhaustedError", {
55
76
  enumerable: true,
@@ -57,6 +78,12 @@ Object.defineProperty(exports, "CasExhaustedError", {
57
78
  return CasExhaustedError;
58
79
  }
59
80
  });
81
+ Object.defineProperty(exports, "CasMismatchError", {
82
+ enumerable: true,
83
+ get: function() {
84
+ return CasMismatchError;
85
+ }
86
+ });
60
87
  Object.defineProperty(exports, "DbError", {
61
88
  enumerable: true,
62
89
  get: function() {
@@ -50,5 +50,26 @@ var CasExhaustedError = class extends DbError {
50
50
  this.lastSeenVersion = lastSeenVersion;
51
51
  }
52
52
  };
53
+ /**
54
+ * Thrown by `AtscriptDbTable.touchMany` (`require: 'all'`, the default) when
55
+ * fewer rows than keys matched their expected version — at least one row is
56
+ * stale or missing. Nothing was written (the pre-count refused before the
57
+ * first statement, or the SQL transaction rolled every bump back). Surfaced
58
+ * as HTTP 409 by moost-db.
59
+ */
60
+ var CasMismatchError = class extends DbError {
61
+ matched;
62
+ expected;
63
+ name = "CasMismatchError";
64
+ constructor(matched, expected) {
65
+ const message = `touchMany: ${matched} of ${expected} rows matched — stale or missing rows`;
66
+ super("CAS_MISMATCH", [{
67
+ path: "$cas",
68
+ message
69
+ }], message);
70
+ this.matched = matched;
71
+ this.expected = expected;
72
+ }
73
+ };
53
74
  //#endregion
54
- export { DbError as n, DepthLimitExceededError as r, CasExhaustedError as t };
75
+ export { DepthLimitExceededError as i, CasMismatchError as n, DbError as r, CasExhaustedError as t };
@@ -828,6 +828,15 @@ interface TDbRemoveGuardContext<Row = Record<string, unknown>> {
828
828
  type TDbWriteGuard<Row = Record<string, unknown>> = (ctx: TDbWriteGuardContext<Row>) => void | Promise<void>;
829
829
  /** A validated-stage delete guard — see {@link TDeleteOptions.guard}. */
830
830
  type TDbRemoveGuard<Row = Record<string, unknown>> = (ctx: TDbRemoveGuardContext<Row>) => void | Promise<void>;
831
+ /** Options of `AtscriptDbTable.touchMany` (since 0.1.129). */
832
+ interface TTouchManyOptions {
833
+ /**
834
+ * `'all'` (default): every key must match its stored version — a stale or
835
+ * missing row throws `DbError("CAS_MISMATCH")` and no version moves.
836
+ * `'any'`: bump whatever matches and report the honest counts.
837
+ */
838
+ require?: "all" | "any";
839
+ }
831
840
  /** Options of `insertOne/Many`, `replaceOne` / `bulkReplace`, `updateOne` / `bulkUpdate`. */
832
841
  interface TWriteOptions<Row = Record<string, unknown>> {
833
842
  /** Nested-relation write recursion limit (default 3). */
@@ -2006,4 +2015,4 @@ declare class AtscriptDbReadable<T extends TAtscriptAnnotatedType = TAtscriptAnn
2006
2015
  }, thisTableName: string, alias?: string): TDbForeignKey | undefined;
2007
2016
  }
2008
2017
  //#endregion
2009
- export { TDbWriteAction as $, TCrudPermissions as A, isGeoIndexableType as At, TDbForeignKey as B, NullableOptional as C, TWriteTableResolver as Ct, TCascadeTarget as D, WithRelation$1 as Dt, TCascadeResolver as E, UniqueryControls$1 as Et, TDbCollation as F, TDbInsertResult as G, TDbIndexField as H, TDbDefaultFn as I, TDbRelation as J, TDbObjectKind as K, TDbDefaultValue as L, TDbActionIntent as M, NoopLogger as Mt, TDbActionLevel as N, TGenericLogger as Nt, TColumnDiff as O, TableMetadata as Ot, TDbActionProcessor as P, UniquSelect as Pt, TDbUpdateResult as Q, TDbDeleteResult as R, NavPropsOf$1 as S, TWriteOptions as St, PrimaryKeyOf$1 as T, Uniquery$1 as Tt, TDbIndexType as U, TDbIndex as V, TDbInsertManyResult as W, TDbRemoveGuardContext as X, TDbRemoveGuard as Y, TDbStorageType as Z, DbQuery as _, TSearchIndexInfo as _t, TDbEncryptionOptions as a, TExistingForeignKey as at, FilterExpr$1 as b, TTableResolver as bt, BaseDbAdapter as c, TFkLookupResolver as ct, AggregateFn as d, TIdentification as dt, TDbWriteGuard as et, AggregateQuery$1 as f, TMetaResponse as ft, DbPatch as g, TRelationInfo as gt, DbControls as h, TReferencingForeignKey as ht, DbEncryption as i, TExistingColumn as it, TDbActionInfo as j, isGeoPointType as jt, TCrudOp as k, findAncestorInSet as kt, AggregateControls as l, TFkLookupTarget as lt, AtscriptDbWritable as m, TPrimaryKeyChange as mt, DbResponse as n, TDeleteOptions as nt, DocumentFieldMapper as o, TExistingTableOption as ot, AggregateResult as p, TMetadataOverrides as pt, TDbReferentialAction as q, resolveDesignType as r, TEnsureTableOptions as rt, FieldMappingStrategy as s, TFieldMeta as st, AtscriptDbReadable as t, TDbWriteGuardContext as tt, AggregateExpr$1 as u, TIdDescriptor as ut, DbRow as v, TSyncColumnResult as vt, OwnPropsOf$1 as w, TypedWithRelation as wt, FlatOf$1 as x, TValueFormatterPair as xt, FieldOpsFor as y, TTableOptionDiff as yt, TDbFieldMeta as z };
2018
+ export { TDbWriteAction as $, TCrudPermissions as A, findAncestorInSet as At, TDbForeignKey as B, NullableOptional as C, TWriteOptions as Ct, TCascadeTarget as D, UniqueryControls$1 as Dt, TCascadeResolver as E, Uniquery$1 as Et, TDbCollation as F, UniquSelect as Ft, TDbInsertResult as G, TDbIndexField as H, TDbDefaultFn as I, TDbRelation as J, TDbObjectKind as K, TDbDefaultValue as L, TDbActionIntent as M, isGeoPointType as Mt, TDbActionLevel as N, NoopLogger as Nt, TColumnDiff as O, WithRelation$1 as Ot, TDbActionProcessor as P, TGenericLogger as Pt, TDbUpdateResult as Q, TDbDeleteResult as R, NavPropsOf$1 as S, TValueFormatterPair as St, PrimaryKeyOf$1 as T, TypedWithRelation as Tt, TDbIndexType as U, TDbIndex as V, TDbInsertManyResult as W, TDbRemoveGuardContext as X, TDbRemoveGuard as Y, TDbStorageType as Z, DbQuery as _, TSearchIndexInfo as _t, TDbEncryptionOptions as a, TExistingForeignKey as at, FilterExpr$1 as b, TTableResolver as bt, BaseDbAdapter as c, TFkLookupResolver as ct, AggregateFn as d, TIdentification as dt, TDbWriteGuard as et, AggregateQuery$1 as f, TMetaResponse as ft, DbPatch as g, TRelationInfo as gt, DbControls as h, TReferencingForeignKey as ht, DbEncryption as i, TExistingColumn as it, TDbActionInfo as j, isGeoIndexableType as jt, TCrudOp as k, TableMetadata as kt, AggregateControls as l, TFkLookupTarget as lt, AtscriptDbWritable as m, TPrimaryKeyChange as mt, DbResponse as n, TDeleteOptions as nt, DocumentFieldMapper as o, TExistingTableOption as ot, AggregateResult as p, TMetadataOverrides as pt, TDbReferentialAction as q, resolveDesignType as r, TEnsureTableOptions as rt, FieldMappingStrategy as s, TFieldMeta as st, AtscriptDbReadable as t, TDbWriteGuardContext as tt, AggregateExpr$1 as u, TIdDescriptor as ut, DbRow as v, TSyncColumnResult as vt, OwnPropsOf$1 as w, TWriteTableResolver as wt, FlatOf$1 as x, TTouchManyOptions as xt, FieldOpsFor as y, TTableOptionDiff as yt, TDbFieldMeta as z };
@@ -828,6 +828,15 @@ interface TDbRemoveGuardContext<Row = Record<string, unknown>> {
828
828
  type TDbWriteGuard<Row = Record<string, unknown>> = (ctx: TDbWriteGuardContext<Row>) => void | Promise<void>;
829
829
  /** A validated-stage delete guard — see {@link TDeleteOptions.guard}. */
830
830
  type TDbRemoveGuard<Row = Record<string, unknown>> = (ctx: TDbRemoveGuardContext<Row>) => void | Promise<void>;
831
+ /** Options of `AtscriptDbTable.touchMany` (since 0.1.129). */
832
+ interface TTouchManyOptions {
833
+ /**
834
+ * `'all'` (default): every key must match its stored version — a stale or
835
+ * missing row throws `DbError("CAS_MISMATCH")` and no version moves.
836
+ * `'any'`: bump whatever matches and report the honest counts.
837
+ */
838
+ require?: "all" | "any";
839
+ }
831
840
  /** Options of `insertOne/Many`, `replaceOne` / `bulkReplace`, `updateOne` / `bulkUpdate`. */
832
841
  interface TWriteOptions<Row = Record<string, unknown>> {
833
842
  /** Nested-relation write recursion limit (default 3). */
@@ -2006,4 +2015,4 @@ declare class AtscriptDbReadable<T extends TAtscriptAnnotatedType = TAtscriptAnn
2006
2015
  }, thisTableName: string, alias?: string): TDbForeignKey | undefined;
2007
2016
  }
2008
2017
  //#endregion
2009
- export { TDbWriteAction as $, TCrudPermissions as A, isGeoIndexableType as At, TDbForeignKey as B, NullableOptional as C, TWriteTableResolver as Ct, TCascadeTarget as D, WithRelation$1 as Dt, TCascadeResolver as E, UniqueryControls$1 as Et, TDbCollation as F, TDbInsertResult as G, TDbIndexField as H, TDbDefaultFn as I, TDbRelation as J, TDbObjectKind as K, TDbDefaultValue as L, TDbActionIntent as M, NoopLogger as Mt, TDbActionLevel as N, TGenericLogger as Nt, TColumnDiff as O, TableMetadata as Ot, TDbActionProcessor as P, UniquSelect as Pt, TDbUpdateResult as Q, TDbDeleteResult as R, NavPropsOf$1 as S, TWriteOptions as St, PrimaryKeyOf$1 as T, Uniquery$1 as Tt, TDbIndexType as U, TDbIndex as V, TDbInsertManyResult as W, TDbRemoveGuardContext as X, TDbRemoveGuard as Y, TDbStorageType as Z, DbQuery as _, TSearchIndexInfo as _t, TDbEncryptionOptions as a, TExistingForeignKey as at, FilterExpr$1 as b, TTableResolver as bt, BaseDbAdapter as c, TFkLookupResolver as ct, AggregateFn as d, TIdentification as dt, TDbWriteGuard as et, AggregateQuery$1 as f, TMetaResponse as ft, DbPatch as g, TRelationInfo as gt, DbControls as h, TReferencingForeignKey as ht, DbEncryption as i, TExistingColumn as it, TDbActionInfo as j, isGeoPointType as jt, TCrudOp as k, findAncestorInSet as kt, AggregateControls as l, TFkLookupTarget as lt, AtscriptDbWritable as m, TPrimaryKeyChange as mt, DbResponse as n, TDeleteOptions as nt, DocumentFieldMapper as o, TExistingTableOption as ot, AggregateResult as p, TMetadataOverrides as pt, TDbReferentialAction as q, resolveDesignType as r, TEnsureTableOptions as rt, FieldMappingStrategy as s, TFieldMeta as st, AtscriptDbReadable as t, TDbWriteGuardContext as tt, AggregateExpr$1 as u, TIdDescriptor as ut, DbRow as v, TSyncColumnResult as vt, OwnPropsOf$1 as w, TypedWithRelation as wt, FlatOf$1 as x, TValueFormatterPair as xt, FieldOpsFor as y, TTableOptionDiff as yt, TDbFieldMeta as z };
2018
+ export { TDbWriteAction as $, TCrudPermissions as A, findAncestorInSet as At, TDbForeignKey as B, NullableOptional as C, TWriteOptions as Ct, TCascadeTarget as D, UniqueryControls$1 as Dt, TCascadeResolver as E, Uniquery$1 as Et, TDbCollation as F, UniquSelect as Ft, TDbInsertResult as G, TDbIndexField as H, TDbDefaultFn as I, TDbRelation as J, TDbObjectKind as K, TDbDefaultValue as L, TDbActionIntent as M, isGeoPointType as Mt, TDbActionLevel as N, NoopLogger as Nt, TColumnDiff as O, WithRelation$1 as Ot, TDbActionProcessor as P, TGenericLogger as Pt, TDbUpdateResult as Q, TDbDeleteResult as R, NavPropsOf$1 as S, TValueFormatterPair as St, PrimaryKeyOf$1 as T, TypedWithRelation as Tt, TDbIndexType as U, TDbIndex as V, TDbInsertManyResult as W, TDbRemoveGuardContext as X, TDbRemoveGuard as Y, TDbStorageType as Z, DbQuery as _, TSearchIndexInfo as _t, TDbEncryptionOptions as a, TExistingForeignKey as at, FilterExpr$1 as b, TTableResolver as bt, BaseDbAdapter as c, TFkLookupResolver as ct, AggregateFn as d, TIdentification as dt, TDbWriteGuard as et, AggregateQuery$1 as f, TMetaResponse as ft, DbPatch as g, TRelationInfo as gt, DbControls as h, TReferencingForeignKey as ht, DbEncryption as i, TExistingColumn as it, TDbActionInfo as j, isGeoIndexableType as jt, TCrudOp as k, TableMetadata as kt, AggregateControls as l, TFkLookupTarget as lt, AtscriptDbWritable as m, TPrimaryKeyChange as mt, DbResponse as n, TDeleteOptions as nt, DocumentFieldMapper as o, TExistingTableOption as ot, AggregateResult as p, TMetadataOverrides as pt, TDbReferentialAction as q, resolveDesignType as r, TEnsureTableOptions as rt, FieldMappingStrategy as s, TFieldMeta as st, AtscriptDbReadable as t, TDbWriteGuardContext as tt, AggregateExpr$1 as u, TIdDescriptor as ut, DbRow as v, TSyncColumnResult as vt, OwnPropsOf$1 as w, TWriteTableResolver as wt, FlatOf$1 as x, TTouchManyOptions as xt, FieldOpsFor as y, TTableOptionDiff as yt, TDbFieldMeta as z };
@@ -1,6 +1,6 @@
1
- import { C as NullableOptional, Ct as TWriteTableResolver, E as TCascadeResolver, G as TDbInsertResult, Nt as TGenericLogger, Ot as TableMetadata, Q as TDbUpdateResult, R as TDbDeleteResult, St as TWriteOptions, W as TDbInsertManyResult, a as TDbEncryptionOptions, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, g as DbPatch, ht as TReferencingForeignKey, i as DbEncryption, nt as TDeleteOptions, t as AtscriptDbReadable, v as DbRow } from "./db-readable-BTl4NzNN.mjs";
2
- import { AtscriptQueryComparison, AtscriptQueryFieldRef, AtscriptQueryFieldRef as AtscriptQueryFieldRef$1, AtscriptQueryNode, AtscriptQueryNode as AtscriptQueryNode$1, AtscriptRef, FlatOf, NavPropsOf, OwnPropsOf, PrimaryKeyOf, TAtscriptAnnotatedType, TAtscriptDataType, Validator } from "@atscript/typescript/utils";
1
+ import { C as NullableOptional, Ct as TWriteOptions, E as TCascadeResolver, G as TDbInsertResult, Pt as TGenericLogger, Q as TDbUpdateResult, R as TDbDeleteResult, W as TDbInsertManyResult, a as TDbEncryptionOptions, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, g as DbPatch, ht as TReferencingForeignKey, i as DbEncryption, kt as TableMetadata, nt as TDeleteOptions, t as AtscriptDbReadable, v as DbRow, wt as TWriteTableResolver, xt as TTouchManyOptions } from "./db-readable-B7eYWS5q.cjs";
3
2
  import { FilterExpr } from "@uniqu/core";
3
+ import { AtscriptQueryComparison, AtscriptQueryFieldRef, AtscriptQueryFieldRef as AtscriptQueryFieldRef$1, AtscriptQueryNode, AtscriptQueryNode as AtscriptQueryNode$1, AtscriptRef, FlatOf, NavPropsOf, OwnPropsOf, PrimaryKeyOf, TAtscriptAnnotatedType, TAtscriptDataType, Validator } from "@atscript/typescript/utils";
4
4
 
5
5
  //#region src/strategies/integrity.d.ts
6
6
  /**
@@ -103,6 +103,32 @@ declare class AtscriptDbTable<T extends TAtscriptAnnotatedType = TAtscriptAnnota
103
103
  * present, `$cas` removed) — see {@link TWriteOptions}.
104
104
  */
105
105
  bulkUpdate(payloads: Array<DbPatch<DataType>>, opts?: TWriteOptions<DataType>): Promise<TDbUpdateResult>;
106
+ /**
107
+ * Batch versioned touch (since 0.1.129): bumps the version of every listed
108
+ * row by exactly one, each row guarded by its own expected version. This is
109
+ * the batch fence `updateMany(orFilter, {})` used to be before 0.1.128 (an
110
+ * empty patch is a no-op since then and takes no lock).
111
+ *
112
+ * Each key carries the primary key field(s) (composite supported) plus the
113
+ * version column and NOTHING else — a touch has no payload. Unique indexes
114
+ * do not identify a touch key. `undefined`-valued properties are ignored,
115
+ * like in every write payload. Empty `keys` → `{ 0, 0 }` without a statement.
116
+ *
117
+ * `require: 'all'` (default): one count over the whole key set runs FIRST;
118
+ * a stale or missing row throws {@link CasMismatchError} before any write.
119
+ * The bumps then run as `updateMany(orFilter, {})` chunks of at most
120
+ * {@link TOUCH_MANY_CHUNK} keys inside one adapter transaction; a summed
121
+ * `matchedCount` short of `keys.length` (a row moved between the count and
122
+ * the bump) throws the same error — SQL engines roll every bump back. The
123
+ * pre-count is therefore a deliberate double check on SQL: it is what makes
124
+ * the guarantee hold on adapters whose `withTransaction` is a passthrough
125
+ * (the memory adapter, a Mongo standalone topology) — there it covers the
126
+ * common stale case and the residual race window is accepted.
127
+ * `require: 'any'`: no pre-count, the honest summed result is returned.
128
+ *
129
+ * No `guard`, no `onWrite`; not exposed over HTTP.
130
+ */
131
+ touchMany(keys: Array<DbPatch<DataType>>, opts?: TTouchManyOptions): Promise<TDbUpdateResult>;
106
132
  /**
107
133
  * Deletes a single record by any type-compatible identifier — primary key
108
134
  * or single-field unique index. Uses the same resolution logic as `findById`.
@@ -1,6 +1,6 @@
1
- import { C as NullableOptional, Ct as TWriteTableResolver, E as TCascadeResolver, G as TDbInsertResult, Nt as TGenericLogger, Ot as TableMetadata, Q as TDbUpdateResult, R as TDbDeleteResult, St as TWriteOptions, W as TDbInsertManyResult, a as TDbEncryptionOptions, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, g as DbPatch, ht as TReferencingForeignKey, i as DbEncryption, nt as TDeleteOptions, t as AtscriptDbReadable, v as DbRow } from "./db-readable-CkbZn_z-.cjs";
2
- import { FilterExpr } from "@uniqu/core";
1
+ import { C as NullableOptional, Ct as TWriteOptions, E as TCascadeResolver, G as TDbInsertResult, Pt as TGenericLogger, Q as TDbUpdateResult, R as TDbDeleteResult, W as TDbInsertManyResult, a as TDbEncryptionOptions, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, g as DbPatch, ht as TReferencingForeignKey, i as DbEncryption, kt as TableMetadata, nt as TDeleteOptions, t as AtscriptDbReadable, v as DbRow, wt as TWriteTableResolver, xt as TTouchManyOptions } from "./db-readable-Bn1bV_eC.mjs";
3
2
  import { AtscriptQueryComparison, AtscriptQueryFieldRef, AtscriptQueryFieldRef as AtscriptQueryFieldRef$1, AtscriptQueryNode, AtscriptQueryNode as AtscriptQueryNode$1, AtscriptRef, FlatOf, NavPropsOf, OwnPropsOf, PrimaryKeyOf, TAtscriptAnnotatedType, TAtscriptDataType, Validator } from "@atscript/typescript/utils";
3
+ import { FilterExpr } from "@uniqu/core";
4
4
 
5
5
  //#region src/strategies/integrity.d.ts
6
6
  /**
@@ -103,6 +103,32 @@ declare class AtscriptDbTable<T extends TAtscriptAnnotatedType = TAtscriptAnnota
103
103
  * present, `$cas` removed) — see {@link TWriteOptions}.
104
104
  */
105
105
  bulkUpdate(payloads: Array<DbPatch<DataType>>, opts?: TWriteOptions<DataType>): Promise<TDbUpdateResult>;
106
+ /**
107
+ * Batch versioned touch (since 0.1.129): bumps the version of every listed
108
+ * row by exactly one, each row guarded by its own expected version. This is
109
+ * the batch fence `updateMany(orFilter, {})` used to be before 0.1.128 (an
110
+ * empty patch is a no-op since then and takes no lock).
111
+ *
112
+ * Each key carries the primary key field(s) (composite supported) plus the
113
+ * version column and NOTHING else — a touch has no payload. Unique indexes
114
+ * do not identify a touch key. `undefined`-valued properties are ignored,
115
+ * like in every write payload. Empty `keys` → `{ 0, 0 }` without a statement.
116
+ *
117
+ * `require: 'all'` (default): one count over the whole key set runs FIRST;
118
+ * a stale or missing row throws {@link CasMismatchError} before any write.
119
+ * The bumps then run as `updateMany(orFilter, {})` chunks of at most
120
+ * {@link TOUCH_MANY_CHUNK} keys inside one adapter transaction; a summed
121
+ * `matchedCount` short of `keys.length` (a row moved between the count and
122
+ * the bump) throws the same error — SQL engines roll every bump back. The
123
+ * pre-count is therefore a deliberate double check on SQL: it is what makes
124
+ * the guarantee hold on adapters whose `withTransaction` is a passthrough
125
+ * (the memory adapter, a Mongo standalone topology) — there it covers the
126
+ * common stale case and the residual race window is accepted.
127
+ * `require: 'any'`: no pre-count, the honest summed result is returned.
128
+ *
129
+ * No `guard`, no `onWrite`; not exposed over HTTP.
130
+ */
131
+ touchMany(keys: Array<DbPatch<DataType>>, opts?: TTouchManyOptions): Promise<TDbUpdateResult>;
106
132
  /**
107
133
  * Deletes a single record by any type-compatible identifier — primary key
108
134
  * or single-field unique index. Uses the same resolution logic as `findById`.
@@ -1,7 +1,7 @@
1
- const require_db_error = require("./db-error-DXwEzmYJ.cjs");
2
- const require_validator = require("./validator-BNUHCXIE.cjs");
1
+ const require_db_error = require("./db-error-C4JuLcvb.cjs");
2
+ const require_validator = require("./validator-lkCJKuoo.cjs");
3
3
  const require_agg = require("./agg.cjs");
4
- const require_nested_writer = require("./nested-writer-DoDhl3X3.cjs");
4
+ const require_nested_writer = require("./nested-writer-DxPhmWFz.cjs");
5
5
  const require_ops = require("./ops.cjs");
6
6
  let _atscript_typescript_utils = require("@atscript/typescript/utils");
7
7
  let node_async_hooks = require("node:async_hooks");
@@ -2345,7 +2345,7 @@ var AtscriptDbReadable = class {
2345
2345
  * Public entry point for relation loading. Used by adapters for nested $with delegation.
2346
2346
  */
2347
2347
  async loadRelations(rows, withRelations) {
2348
- const { loadRelationsImpl } = await Promise.resolve().then(() => require("./relation-loader-BnUgJsUG.cjs")).then((n) => n.relation_loader_exports);
2348
+ const { loadRelationsImpl } = await Promise.resolve().then(() => require("./relation-loader-C8GOpNYJ.cjs")).then((n) => n.relation_loader_exports);
2349
2349
  return loadRelationsImpl(rows, withRelations, this);
2350
2350
  }
2351
2351
  /**
@@ -3504,6 +3504,15 @@ function _translateOpsKeys(ops, meta) {
3504
3504
  mul: ops.mul ? _translateOpsRecord(ops.mul, meta) : void 0
3505
3505
  };
3506
3506
  }
3507
+ /** Upper bound of keys per `touchMany` UPDATE statement (parameter-count safety). */
3508
+ const TOUCH_MANY_CHUNK = 500;
3509
+ /** `touchMany` input rejection — always `INVALID_QUERY`, path names the key. */
3510
+ function invalidTouchKey(path, message) {
3511
+ return new require_db_error.DbError("INVALID_QUERY", [{
3512
+ path,
3513
+ message
3514
+ }]);
3515
+ }
3507
3516
  var AtscriptDbTable = class extends AtscriptDbReadable {
3508
3517
  _cascadeResolver;
3509
3518
  _fkLookupResolver;
@@ -3783,6 +3792,84 @@ var AtscriptDbTable = class extends AtscriptDbReadable {
3783
3792
  }));
3784
3793
  }
3785
3794
  /**
3795
+ * Batch versioned touch (since 0.1.129): bumps the version of every listed
3796
+ * row by exactly one, each row guarded by its own expected version. This is
3797
+ * the batch fence `updateMany(orFilter, {})` used to be before 0.1.128 (an
3798
+ * empty patch is a no-op since then and takes no lock).
3799
+ *
3800
+ * Each key carries the primary key field(s) (composite supported) plus the
3801
+ * version column and NOTHING else — a touch has no payload. Unique indexes
3802
+ * do not identify a touch key. `undefined`-valued properties are ignored,
3803
+ * like in every write payload. Empty `keys` → `{ 0, 0 }` without a statement.
3804
+ *
3805
+ * `require: 'all'` (default): one count over the whole key set runs FIRST;
3806
+ * a stale or missing row throws {@link CasMismatchError} before any write.
3807
+ * The bumps then run as `updateMany(orFilter, {})` chunks of at most
3808
+ * {@link TOUCH_MANY_CHUNK} keys inside one adapter transaction; a summed
3809
+ * `matchedCount` short of `keys.length` (a row moved between the count and
3810
+ * the bump) throws the same error — SQL engines roll every bump back. The
3811
+ * pre-count is therefore a deliberate double check on SQL: it is what makes
3812
+ * the guarantee hold on adapters whose `withTransaction` is a passthrough
3813
+ * (the memory adapter, a Mongo standalone topology) — there it covers the
3814
+ * common stale case and the residual race window is accepted.
3815
+ * `require: 'any'`: no pre-count, the honest summed result is returned.
3816
+ *
3817
+ * No `guard`, no `onWrite`; not exposed over HTTP.
3818
+ */
3819
+ async touchMany(keys, opts) {
3820
+ this._ensureBuilt();
3821
+ const versionField = this._meta.versionField;
3822
+ if (versionField === void 0) throw invalidTouchKey("", "touchMany requires @db.column.version");
3823
+ if (keys.length === 0) return {
3824
+ matchedCount: 0,
3825
+ modifiedCount: 0
3826
+ };
3827
+ const pkFields = this.primaryKeys;
3828
+ const seen = /* @__PURE__ */ new Set();
3829
+ const pairs = [];
3830
+ for (const [i, key] of keys.entries()) {
3831
+ const pair = {};
3832
+ for (const pk of pkFields) {
3833
+ if (key[pk] === void 0) throw invalidTouchKey(`[${i}].${pk}`, `touchMany: each key must carry its "${pk}"`);
3834
+ pair[pk] = key[pk];
3835
+ }
3836
+ const version = key[versionField];
3837
+ if (typeof version !== "number" || !Number.isFinite(version)) throw invalidTouchKey(`[${i}].${versionField}`, `touchMany: each key must carry its expected "${versionField}" (number)`);
3838
+ for (const [prop, value] of Object.entries(key)) if (value !== void 0 && prop !== versionField && !(prop in pair)) throw invalidTouchKey(`[${i}].${prop}`, `touchMany: a touch carries no payload — keys hold the primary key and "${versionField}" only, got "${prop}"`);
3839
+ const identity = JSON.stringify(pair);
3840
+ if (seen.has(identity)) throw invalidTouchKey(`[${i}]`, `touchMany: duplicate key ${identity}`);
3841
+ seen.add(identity);
3842
+ pair[versionField] = version;
3843
+ pairs.push(pair);
3844
+ }
3845
+ const orFilter = { $or: pairs };
3846
+ this._guardMutationFilter(orFilter);
3847
+ const translated = this._fieldMapper.translateFilter(orFilter, this._meta).$or;
3848
+ const requireAll = (opts?.require ?? "all") === "all";
3849
+ if (requireAll) {
3850
+ const matched = await this.adapter.count({
3851
+ filter: { $or: translated },
3852
+ controls: {}
3853
+ });
3854
+ if (matched < keys.length) throw new require_db_error.CasMismatchError(matched, keys.length);
3855
+ }
3856
+ return this.adapter.withTransaction(async () => {
3857
+ let matchedCount = 0;
3858
+ let modifiedCount = 0;
3859
+ for (let start = 0; start < translated.length; start += TOUCH_MANY_CHUNK) {
3860
+ const chunk = translated.slice(start, start + TOUCH_MANY_CHUNK);
3861
+ const result = await this.adapter.updateMany({ $or: chunk }, {}, void 0);
3862
+ matchedCount += result.matchedCount;
3863
+ modifiedCount += result.modifiedCount;
3864
+ }
3865
+ if (requireAll && matchedCount !== keys.length) throw new require_db_error.CasMismatchError(matchedCount, keys.length);
3866
+ return {
3867
+ matchedCount,
3868
+ modifiedCount
3869
+ };
3870
+ });
3871
+ }
3872
+ /**
3786
3873
  * Deletes a single record by any type-compatible identifier — primary key
3787
3874
  * or single-field unique index. Uses the same resolution logic as `findById`.
3788
3875
  *
@@ -1,7 +1,7 @@
1
- import { n as DbError } from "./db-error-BHPXOKzc.mjs";
2
- import { a as forceNavNonOptional, c as getKeyProps, i as dbPlugin, l as isEmptyObject, n as buildPatchPartial, t as buildDbValidator, u as isPlainObject } from "./validator-eKYWf3xf.mjs";
1
+ import { n as CasMismatchError, r as DbError } from "./db-error-COrO58t5.mjs";
2
+ import { a as forceNavNonOptional, c as getKeyProps, i as dbPlugin, l as isEmptyObject, n as buildPatchPartial, t as buildDbValidator, u as isPlainObject } from "./validator-CeD_fqyW.mjs";
3
3
  import { resolveAlias } from "./agg.mjs";
4
- import { a as batchPatchNestedTo, c as batchReplaceNestedTo, d as preValidateNestedFrom, f as validateBatch, g as findRemoteFK, h as findFKForRelation, i as batchPatchNestedFrom, l as batchReplaceNestedVia, m as remapDeleteFkViolation, n as batchInsertNestedTo, o as batchPatchNestedVia, p as enrichFkViolation, r as batchInsertNestedVia, s as batchReplaceNestedFrom, t as batchInsertNestedFrom, u as checkDepthOverflow } from "./nested-writer-DI-HeTky.mjs";
4
+ import { a as batchPatchNestedTo, c as batchReplaceNestedTo, d as preValidateNestedFrom, f as validateBatch, g as findRemoteFK, h as findFKForRelation, i as batchPatchNestedFrom, l as batchReplaceNestedVia, m as remapDeleteFkViolation, n as batchInsertNestedTo, o as batchPatchNestedVia, p as enrichFkViolation, r as batchInsertNestedVia, s as batchReplaceNestedFrom, t as batchInsertNestedFrom, u as checkDepthOverflow } from "./nested-writer-CkDo-ZfH.mjs";
5
5
  import { separateCas, separateFieldOps } from "./ops.mjs";
6
6
  import { flattenAnnotatedType, isAnnotatedType } from "@atscript/typescript/utils";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -2345,7 +2345,7 @@ var AtscriptDbReadable = class {
2345
2345
  * Public entry point for relation loading. Used by adapters for nested $with delegation.
2346
2346
  */
2347
2347
  async loadRelations(rows, withRelations) {
2348
- const { loadRelationsImpl } = await import("./relation-loader-BmeOMj0b.mjs").then((n) => n.n);
2348
+ const { loadRelationsImpl } = await import("./relation-loader-CUGcxJ18.mjs").then((n) => n.n);
2349
2349
  return loadRelationsImpl(rows, withRelations, this);
2350
2350
  }
2351
2351
  /**
@@ -3504,6 +3504,15 @@ function _translateOpsKeys(ops, meta) {
3504
3504
  mul: ops.mul ? _translateOpsRecord(ops.mul, meta) : void 0
3505
3505
  };
3506
3506
  }
3507
+ /** Upper bound of keys per `touchMany` UPDATE statement (parameter-count safety). */
3508
+ const TOUCH_MANY_CHUNK = 500;
3509
+ /** `touchMany` input rejection — always `INVALID_QUERY`, path names the key. */
3510
+ function invalidTouchKey(path, message) {
3511
+ return new DbError("INVALID_QUERY", [{
3512
+ path,
3513
+ message
3514
+ }]);
3515
+ }
3507
3516
  var AtscriptDbTable = class extends AtscriptDbReadable {
3508
3517
  _cascadeResolver;
3509
3518
  _fkLookupResolver;
@@ -3783,6 +3792,84 @@ var AtscriptDbTable = class extends AtscriptDbReadable {
3783
3792
  }));
3784
3793
  }
3785
3794
  /**
3795
+ * Batch versioned touch (since 0.1.129): bumps the version of every listed
3796
+ * row by exactly one, each row guarded by its own expected version. This is
3797
+ * the batch fence `updateMany(orFilter, {})` used to be before 0.1.128 (an
3798
+ * empty patch is a no-op since then and takes no lock).
3799
+ *
3800
+ * Each key carries the primary key field(s) (composite supported) plus the
3801
+ * version column and NOTHING else — a touch has no payload. Unique indexes
3802
+ * do not identify a touch key. `undefined`-valued properties are ignored,
3803
+ * like in every write payload. Empty `keys` → `{ 0, 0 }` without a statement.
3804
+ *
3805
+ * `require: 'all'` (default): one count over the whole key set runs FIRST;
3806
+ * a stale or missing row throws {@link CasMismatchError} before any write.
3807
+ * The bumps then run as `updateMany(orFilter, {})` chunks of at most
3808
+ * {@link TOUCH_MANY_CHUNK} keys inside one adapter transaction; a summed
3809
+ * `matchedCount` short of `keys.length` (a row moved between the count and
3810
+ * the bump) throws the same error — SQL engines roll every bump back. The
3811
+ * pre-count is therefore a deliberate double check on SQL: it is what makes
3812
+ * the guarantee hold on adapters whose `withTransaction` is a passthrough
3813
+ * (the memory adapter, a Mongo standalone topology) — there it covers the
3814
+ * common stale case and the residual race window is accepted.
3815
+ * `require: 'any'`: no pre-count, the honest summed result is returned.
3816
+ *
3817
+ * No `guard`, no `onWrite`; not exposed over HTTP.
3818
+ */
3819
+ async touchMany(keys, opts) {
3820
+ this._ensureBuilt();
3821
+ const versionField = this._meta.versionField;
3822
+ if (versionField === void 0) throw invalidTouchKey("", "touchMany requires @db.column.version");
3823
+ if (keys.length === 0) return {
3824
+ matchedCount: 0,
3825
+ modifiedCount: 0
3826
+ };
3827
+ const pkFields = this.primaryKeys;
3828
+ const seen = /* @__PURE__ */ new Set();
3829
+ const pairs = [];
3830
+ for (const [i, key] of keys.entries()) {
3831
+ const pair = {};
3832
+ for (const pk of pkFields) {
3833
+ if (key[pk] === void 0) throw invalidTouchKey(`[${i}].${pk}`, `touchMany: each key must carry its "${pk}"`);
3834
+ pair[pk] = key[pk];
3835
+ }
3836
+ const version = key[versionField];
3837
+ if (typeof version !== "number" || !Number.isFinite(version)) throw invalidTouchKey(`[${i}].${versionField}`, `touchMany: each key must carry its expected "${versionField}" (number)`);
3838
+ for (const [prop, value] of Object.entries(key)) if (value !== void 0 && prop !== versionField && !(prop in pair)) throw invalidTouchKey(`[${i}].${prop}`, `touchMany: a touch carries no payload — keys hold the primary key and "${versionField}" only, got "${prop}"`);
3839
+ const identity = JSON.stringify(pair);
3840
+ if (seen.has(identity)) throw invalidTouchKey(`[${i}]`, `touchMany: duplicate key ${identity}`);
3841
+ seen.add(identity);
3842
+ pair[versionField] = version;
3843
+ pairs.push(pair);
3844
+ }
3845
+ const orFilter = { $or: pairs };
3846
+ this._guardMutationFilter(orFilter);
3847
+ const translated = this._fieldMapper.translateFilter(orFilter, this._meta).$or;
3848
+ const requireAll = (opts?.require ?? "all") === "all";
3849
+ if (requireAll) {
3850
+ const matched = await this.adapter.count({
3851
+ filter: { $or: translated },
3852
+ controls: {}
3853
+ });
3854
+ if (matched < keys.length) throw new CasMismatchError(matched, keys.length);
3855
+ }
3856
+ return this.adapter.withTransaction(async () => {
3857
+ let matchedCount = 0;
3858
+ let modifiedCount = 0;
3859
+ for (let start = 0; start < translated.length; start += TOUCH_MANY_CHUNK) {
3860
+ const chunk = translated.slice(start, start + TOUCH_MANY_CHUNK);
3861
+ const result = await this.adapter.updateMany({ $or: chunk }, {}, void 0);
3862
+ matchedCount += result.matchedCount;
3863
+ modifiedCount += result.modifiedCount;
3864
+ }
3865
+ if (requireAll && matchedCount !== keys.length) throw new CasMismatchError(matchedCount, keys.length);
3866
+ return {
3867
+ matchedCount,
3868
+ modifiedCount
3869
+ };
3870
+ });
3871
+ }
3872
+ /**
3786
3873
  * Deletes a single record by any type-compatible identifier — primary key
3787
3874
  * or single-field unique index. Uses the same resolution logic as `findById`.
3788
3875
  *
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_db_error = require("./db-error-DXwEzmYJ.cjs");
3
- const require_db_view = require("./db-view-C8-MsjND.cjs");
4
- const require_validator = require("./validator-BNUHCXIE.cjs");
2
+ const require_db_error = require("./db-error-C4JuLcvb.cjs");
3
+ const require_db_view = require("./db-view-CRBgkEp0.cjs");
4
+ const require_validator = require("./validator-lkCJKuoo.cjs");
5
5
  const require_consts = require("./consts-BzRfCcH2.cjs");
6
6
  const require_ops = require("./ops.cjs");
7
7
  let node_crypto = require("node:crypto");
@@ -388,6 +388,7 @@ exports.AtscriptDbTable = require_db_view.AtscriptDbTable;
388
388
  exports.AtscriptDbView = require_db_view.AtscriptDbView;
389
389
  exports.BaseDbAdapter = require_db_view.BaseDbAdapter;
390
390
  exports.CasExhaustedError = require_db_error.CasExhaustedError;
391
+ exports.CasMismatchError = require_db_error.CasMismatchError;
391
392
  exports.DEFAULT_DB_SPACE = require_consts.DEFAULT_DB_SPACE;
392
393
  exports.DbEncryption = DbEncryption;
393
394
  exports.DbError = require_db_error.DbError;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as TDbWriteAction, A as TCrudPermissions, At as isGeoIndexableType, B as TDbForeignKey, C as NullableOptional, Ct as TWriteTableResolver, D as TCascadeTarget, Dt as WithRelation, E as TCascadeResolver, Et as UniqueryControls, F as TDbCollation, G as TDbInsertResult, H as TDbIndexField, I as TDbDefaultFn, J as TDbRelation, K as TDbObjectKind, L as TDbDefaultValue, M as TDbActionIntent, Mt as NoopLogger, N as TDbActionLevel, Nt as TGenericLogger, O as TColumnDiff, Ot as TableMetadata, P as TDbActionProcessor, Pt as UniquSelect, Q as TDbUpdateResult, R as TDbDeleteResult, S as NavPropsOf, St as TWriteOptions, T as PrimaryKeyOf, Tt as Uniquery, U as TDbIndexType, V as TDbIndex, W as TDbInsertManyResult, X as TDbRemoveGuardContext, Y as TDbRemoveGuard, Z as TDbStorageType, _ as DbQuery, _t as TSearchIndexInfo, a as TDbEncryptionOptions, at as TExistingForeignKey, b as FilterExpr, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, d as AggregateFn, dt as TIdentification, et as TDbWriteGuard, f as AggregateQuery, ft as TMetaResponse, g as DbPatch, gt as TRelationInfo, h as DbControls, ht as TReferencingForeignKey, i as DbEncryption, it as TExistingColumn, j as TDbActionInfo, jt as isGeoPointType, k as TCrudOp, kt as findAncestorInSet, l as AggregateControls, lt as TFkLookupTarget, m as AtscriptDbWritable, mt as TPrimaryKeyChange, n as DbResponse, nt as TDeleteOptions, o as DocumentFieldMapper, ot as TExistingTableOption, p as AggregateResult, pt as TMetadataOverrides, q as TDbReferentialAction, r as resolveDesignType, rt as TEnsureTableOptions, s as FieldMappingStrategy, st as TFieldMeta, t as AtscriptDbReadable, tt as TDbWriteGuardContext, u as AggregateExpr, ut as TIdDescriptor, v as DbRow, vt as TSyncColumnResult, w as OwnPropsOf, wt as TypedWithRelation, x as FlatOf, xt as TValueFormatterPair, y as FieldOpsFor, yt as TTableOptionDiff, z as TDbFieldMeta } from "./db-readable-CkbZn_z-.cjs";
1
+ import { $ as TDbWriteAction, A as TCrudPermissions, At as findAncestorInSet, B as TDbForeignKey, C as NullableOptional, Ct as TWriteOptions, D as TCascadeTarget, Dt as UniqueryControls, E as TCascadeResolver, Et as Uniquery, F as TDbCollation, Ft as UniquSelect, G as TDbInsertResult, H as TDbIndexField, I as TDbDefaultFn, J as TDbRelation, K as TDbObjectKind, L as TDbDefaultValue, M as TDbActionIntent, Mt as isGeoPointType, N as TDbActionLevel, Nt as NoopLogger, O as TColumnDiff, Ot as WithRelation, P as TDbActionProcessor, Pt as TGenericLogger, Q as TDbUpdateResult, R as TDbDeleteResult, S as NavPropsOf, St as TValueFormatterPair, T as PrimaryKeyOf, Tt as TypedWithRelation, U as TDbIndexType, V as TDbIndex, W as TDbInsertManyResult, X as TDbRemoveGuardContext, Y as TDbRemoveGuard, Z as TDbStorageType, _ as DbQuery, _t as TSearchIndexInfo, a as TDbEncryptionOptions, at as TExistingForeignKey, b as FilterExpr, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, d as AggregateFn, dt as TIdentification, et as TDbWriteGuard, f as AggregateQuery, ft as TMetaResponse, g as DbPatch, gt as TRelationInfo, h as DbControls, ht as TReferencingForeignKey, i as DbEncryption, it as TExistingColumn, j as TDbActionInfo, jt as isGeoIndexableType, k as TCrudOp, kt as TableMetadata, l as AggregateControls, lt as TFkLookupTarget, m as AtscriptDbWritable, mt as TPrimaryKeyChange, n as DbResponse, nt as TDeleteOptions, o as DocumentFieldMapper, ot as TExistingTableOption, p as AggregateResult, pt as TMetadataOverrides, q as TDbReferentialAction, r as resolveDesignType, rt as TEnsureTableOptions, s as FieldMappingStrategy, st as TFieldMeta, t as AtscriptDbReadable, tt as TDbWriteGuardContext, u as AggregateExpr, ut as TIdDescriptor, v as DbRow, vt as TSyncColumnResult, w as OwnPropsOf, wt as TWriteTableResolver, x as FlatOf, xt as TTouchManyOptions, y as FieldOpsFor, yt as TTableOptionDiff, z as TDbFieldMeta } from "./db-readable-B7eYWS5q.cjs";
2
2
  import { _ as separateFieldOps, a as $mul, c as $update, d as TDbFieldOp, f as TFieldOps, g as separateCas, h as reconcileCas, i as $insert, l as $upsert, m as isDbFieldOp, n as $dec, o as $remove, p as getDbFieldOp, r as $inc, s as $replace, t as $cas, u as TDbCas } from "./ops-AqhV7s9o.cjs";
3
- import { a as TViewColumnMapping, c as AtscriptQueryFieldRef, d as TViewJoin, f as TViewPlan, g as NativeIntegrity, h as IntegrityStrategy, i as AtscriptDbView, l as AtscriptQueryNode, m as AtscriptDbTable, n as TAdapterFactory, o as isAtscriptDbView, p as translateQueryTree, r as TDbSpaceOptions, s as AtscriptQueryComparison, t as DbSpace, u as AtscriptRef } from "./db-space-BevOyVrC.cjs";
4
- import { a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbErrorCode, h as DbError, l as isEmptyObject, m as CasExhaustedError, n as ValidatorMode, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-DuAmWc8L.cjs";
3
+ import { a as TViewColumnMapping, c as AtscriptQueryFieldRef, d as TViewJoin, f as TViewPlan, g as NativeIntegrity, h as IntegrityStrategy, i as AtscriptDbView, l as AtscriptQueryNode, m as AtscriptDbTable, n as TAdapterFactory, o as isAtscriptDbView, p as translateQueryTree, r as TDbSpaceOptions, s as AtscriptQueryComparison, t as DbSpace, u as AtscriptRef } from "./db-space-C2UCnGHd.cjs";
4
+ import { _ as DbErrorCode, a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbError, h as CasMismatchError, l as isEmptyObject, m as CasExhaustedError, n as ValidatorMode, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-wBARmD68.cjs";
5
5
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.cjs";
6
6
  import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
7
7
 
@@ -362,4 +362,4 @@ declare function createFailureCollector(what: string): {
362
362
  throwIfAny: () => void;
363
363
  };
364
364
  //#endregion
365
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, type AtscriptDbWritable, type AtscriptQueryComparison, type AtscriptQueryFieldRef, type AtscriptQueryNode, type AtscriptRef, BaseDbAdapter, CasExhaustedError, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type TAdapterFactory, type TArrayPatch, type TCascadeResolver, type TCascadeTarget, type TColumnDiff, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TDbCas, type TDbCollation, type TDbDefaultFn, type TDbDefaultValue, type TDbDeleteResult, type TDbEncryptionOptions, type TDbFieldMeta, type TDbFieldOp, type TDbForeignKey, type TDbIndex, type TDbIndexField, type TDbIndexType, type TDbInsertManyResult, type TDbInsertResult, type TDbObjectKind, type TDbPatch, type TDbReferentialAction, type TDbRelation, type TDbRemoveGuard, type TDbRemoveGuardContext, type TDbSpaceOptions, type TDbStorageType, type TDbUpdateResult, type TDbWriteAction, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReferencingForeignKey, type TRelationInfo, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WithOptimisticRetryOptions, type WithRelation, assertGeoPoint, assertNoVersionWrites, buildDbValidator, buildValidationContext, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isNavRelation, isPlainObject, isPrimitive, reconcileCas, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
365
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, type AtscriptDbWritable, type AtscriptQueryComparison, type AtscriptQueryFieldRef, type AtscriptQueryNode, type AtscriptRef, BaseDbAdapter, CasExhaustedError, CasMismatchError, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type TAdapterFactory, type TArrayPatch, type TCascadeResolver, type TCascadeTarget, type TColumnDiff, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TDbCas, type TDbCollation, type TDbDefaultFn, type TDbDefaultValue, type TDbDeleteResult, type TDbEncryptionOptions, type TDbFieldMeta, type TDbFieldOp, type TDbForeignKey, type TDbIndex, type TDbIndexField, type TDbIndexType, type TDbInsertManyResult, type TDbInsertResult, type TDbObjectKind, type TDbPatch, type TDbReferentialAction, type TDbRelation, type TDbRemoveGuard, type TDbRemoveGuardContext, type TDbSpaceOptions, type TDbStorageType, type TDbUpdateResult, type TDbWriteAction, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReferencingForeignKey, type TRelationInfo, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WithOptimisticRetryOptions, type WithRelation, assertGeoPoint, assertNoVersionWrites, buildDbValidator, buildValidationContext, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isNavRelation, isPlainObject, isPrimitive, reconcileCas, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as TDbWriteAction, A as TCrudPermissions, At as isGeoIndexableType, B as TDbForeignKey, C as NullableOptional, Ct as TWriteTableResolver, D as TCascadeTarget, Dt as WithRelation, E as TCascadeResolver, Et as UniqueryControls, F as TDbCollation, G as TDbInsertResult, H as TDbIndexField, I as TDbDefaultFn, J as TDbRelation, K as TDbObjectKind, L as TDbDefaultValue, M as TDbActionIntent, Mt as NoopLogger, N as TDbActionLevel, Nt as TGenericLogger, O as TColumnDiff, Ot as TableMetadata, P as TDbActionProcessor, Pt as UniquSelect, Q as TDbUpdateResult, R as TDbDeleteResult, S as NavPropsOf, St as TWriteOptions, T as PrimaryKeyOf, Tt as Uniquery, U as TDbIndexType, V as TDbIndex, W as TDbInsertManyResult, X as TDbRemoveGuardContext, Y as TDbRemoveGuard, Z as TDbStorageType, _ as DbQuery, _t as TSearchIndexInfo, a as TDbEncryptionOptions, at as TExistingForeignKey, b as FilterExpr, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, d as AggregateFn, dt as TIdentification, et as TDbWriteGuard, f as AggregateQuery, ft as TMetaResponse, g as DbPatch, gt as TRelationInfo, h as DbControls, ht as TReferencingForeignKey, i as DbEncryption, it as TExistingColumn, j as TDbActionInfo, jt as isGeoPointType, k as TCrudOp, kt as findAncestorInSet, l as AggregateControls, lt as TFkLookupTarget, m as AtscriptDbWritable, mt as TPrimaryKeyChange, n as DbResponse, nt as TDeleteOptions, o as DocumentFieldMapper, ot as TExistingTableOption, p as AggregateResult, pt as TMetadataOverrides, q as TDbReferentialAction, r as resolveDesignType, rt as TEnsureTableOptions, s as FieldMappingStrategy, st as TFieldMeta, t as AtscriptDbReadable, tt as TDbWriteGuardContext, u as AggregateExpr, ut as TIdDescriptor, v as DbRow, vt as TSyncColumnResult, w as OwnPropsOf, wt as TypedWithRelation, x as FlatOf, xt as TValueFormatterPair, y as FieldOpsFor, yt as TTableOptionDiff, z as TDbFieldMeta } from "./db-readable-BTl4NzNN.mjs";
1
+ import { $ as TDbWriteAction, A as TCrudPermissions, At as findAncestorInSet, B as TDbForeignKey, C as NullableOptional, Ct as TWriteOptions, D as TCascadeTarget, Dt as UniqueryControls, E as TCascadeResolver, Et as Uniquery, F as TDbCollation, Ft as UniquSelect, G as TDbInsertResult, H as TDbIndexField, I as TDbDefaultFn, J as TDbRelation, K as TDbObjectKind, L as TDbDefaultValue, M as TDbActionIntent, Mt as isGeoPointType, N as TDbActionLevel, Nt as NoopLogger, O as TColumnDiff, Ot as WithRelation, P as TDbActionProcessor, Pt as TGenericLogger, Q as TDbUpdateResult, R as TDbDeleteResult, S as NavPropsOf, St as TValueFormatterPair, T as PrimaryKeyOf, Tt as TypedWithRelation, U as TDbIndexType, V as TDbIndex, W as TDbInsertManyResult, X as TDbRemoveGuardContext, Y as TDbRemoveGuard, Z as TDbStorageType, _ as DbQuery, _t as TSearchIndexInfo, a as TDbEncryptionOptions, at as TExistingForeignKey, b as FilterExpr, bt as TTableResolver, c as BaseDbAdapter, ct as TFkLookupResolver, d as AggregateFn, dt as TIdentification, et as TDbWriteGuard, f as AggregateQuery, ft as TMetaResponse, g as DbPatch, gt as TRelationInfo, h as DbControls, ht as TReferencingForeignKey, i as DbEncryption, it as TExistingColumn, j as TDbActionInfo, jt as isGeoIndexableType, k as TCrudOp, kt as TableMetadata, l as AggregateControls, lt as TFkLookupTarget, m as AtscriptDbWritable, mt as TPrimaryKeyChange, n as DbResponse, nt as TDeleteOptions, o as DocumentFieldMapper, ot as TExistingTableOption, p as AggregateResult, pt as TMetadataOverrides, q as TDbReferentialAction, r as resolveDesignType, rt as TEnsureTableOptions, s as FieldMappingStrategy, st as TFieldMeta, t as AtscriptDbReadable, tt as TDbWriteGuardContext, u as AggregateExpr, ut as TIdDescriptor, v as DbRow, vt as TSyncColumnResult, w as OwnPropsOf, wt as TWriteTableResolver, x as FlatOf, xt as TTouchManyOptions, y as FieldOpsFor, yt as TTableOptionDiff, z as TDbFieldMeta } from "./db-readable-Bn1bV_eC.mjs";
2
2
  import { _ as separateFieldOps, a as $mul, c as $update, d as TDbFieldOp, f as TFieldOps, g as separateCas, h as reconcileCas, i as $insert, l as $upsert, m as isDbFieldOp, n as $dec, o as $remove, p as getDbFieldOp, r as $inc, s as $replace, t as $cas, u as TDbCas } from "./ops-AqhV7s9o.mjs";
3
- import { a as TViewColumnMapping, c as AtscriptQueryFieldRef, d as TViewJoin, f as TViewPlan, g as NativeIntegrity, h as IntegrityStrategy, i as AtscriptDbView, l as AtscriptQueryNode, m as AtscriptDbTable, n as TAdapterFactory, o as isAtscriptDbView, p as translateQueryTree, r as TDbSpaceOptions, s as AtscriptQueryComparison, t as DbSpace, u as AtscriptRef } from "./db-space-BEB5Jl8M.mjs";
4
- import { a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbErrorCode, h as DbError, l as isEmptyObject, m as CasExhaustedError, n as ValidatorMode, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-DuAmWc8L.mjs";
3
+ import { a as TViewColumnMapping, c as AtscriptQueryFieldRef, d as TViewJoin, f as TViewPlan, g as NativeIntegrity, h as IntegrityStrategy, i as AtscriptDbView, l as AtscriptQueryNode, m as AtscriptDbTable, n as TAdapterFactory, o as isAtscriptDbView, p as translateQueryTree, r as TDbSpaceOptions, s as AtscriptQueryComparison, t as DbSpace, u as AtscriptRef } from "./db-space-DdIPYD0Q.mjs";
4
+ import { _ as DbErrorCode, a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbError, h as CasMismatchError, l as isEmptyObject, m as CasExhaustedError, n as ValidatorMode, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-wBARmD68.mjs";
5
5
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.mjs";
6
6
  import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
7
7
 
@@ -362,4 +362,4 @@ declare function createFailureCollector(what: string): {
362
362
  throwIfAny: () => void;
363
363
  };
364
364
  //#endregion
365
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, type AtscriptDbWritable, type AtscriptQueryComparison, type AtscriptQueryFieldRef, type AtscriptQueryNode, type AtscriptRef, BaseDbAdapter, CasExhaustedError, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type TAdapterFactory, type TArrayPatch, type TCascadeResolver, type TCascadeTarget, type TColumnDiff, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TDbCas, type TDbCollation, type TDbDefaultFn, type TDbDefaultValue, type TDbDeleteResult, type TDbEncryptionOptions, type TDbFieldMeta, type TDbFieldOp, type TDbForeignKey, type TDbIndex, type TDbIndexField, type TDbIndexType, type TDbInsertManyResult, type TDbInsertResult, type TDbObjectKind, type TDbPatch, type TDbReferentialAction, type TDbRelation, type TDbRemoveGuard, type TDbRemoveGuardContext, type TDbSpaceOptions, type TDbStorageType, type TDbUpdateResult, type TDbWriteAction, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReferencingForeignKey, type TRelationInfo, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WithOptimisticRetryOptions, type WithRelation, assertGeoPoint, assertNoVersionWrites, buildDbValidator, buildValidationContext, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isNavRelation, isPlainObject, isPrimitive, reconcileCas, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
365
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, type AtscriptDbWritable, type AtscriptQueryComparison, type AtscriptQueryFieldRef, type AtscriptQueryNode, type AtscriptRef, BaseDbAdapter, CasExhaustedError, CasMismatchError, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type TAdapterFactory, type TArrayPatch, type TCascadeResolver, type TCascadeTarget, type TColumnDiff, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TDbCas, type TDbCollation, type TDbDefaultFn, type TDbDefaultValue, type TDbDeleteResult, type TDbEncryptionOptions, type TDbFieldMeta, type TDbFieldOp, type TDbForeignKey, type TDbIndex, type TDbIndexField, type TDbIndexType, type TDbInsertManyResult, type TDbInsertResult, type TDbObjectKind, type TDbPatch, type TDbReferentialAction, type TDbRelation, type TDbRemoveGuard, type TDbRemoveGuardContext, type TDbSpaceOptions, type TDbStorageType, type TDbUpdateResult, type TDbWriteAction, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReferencingForeignKey, type TRelationInfo, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WithOptimisticRetryOptions, type WithRelation, assertGeoPoint, assertNoVersionWrites, buildDbValidator, buildValidationContext, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isNavRelation, isPlainObject, isPrimitive, reconcileCas, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { n as DbError, t as CasExhaustedError } from "./db-error-BHPXOKzc.mjs";
2
- import { A as isGeoIndexableType, C as unsupportedOperatorMessage, D as UniquSelect, E as FieldMappingStrategy, M as NoopLogger, O as TableMetadata, S as sortFieldNames, T as DocumentFieldMapper, _ as guardAggregate, a as decomposePatch, b as guardPaths, c as createFailureCollector, d as AtscriptDbReadable, f as resolveDesignType, g as collectQueryPaths, h as classifyQueryPath, i as assertNoVersionWrites, j as isGeoPointType, k as findAncestorInSet, l as IntegrityStrategy, m as checkHavingKeys, n as isAtscriptDbView, o as ApplicationIntegrity, p as assertGeoPoint, r as AtscriptDbTable, s as BaseDbAdapter, t as AtscriptDbView, u as NativeIntegrity, v as guardFilter, w as RelationalFieldMapper, x as guardQuery, y as guardPath } from "./db-view-Ck0I-PMI.mjs";
3
- import { a as forceNavNonOptional, c as getKeyProps, l as isEmptyObject, o as isNavRelation, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator, u as isPlainObject } from "./validator-eKYWf3xf.mjs";
1
+ import { n as CasMismatchError, r as DbError, t as CasExhaustedError } from "./db-error-COrO58t5.mjs";
2
+ import { A as isGeoIndexableType, C as unsupportedOperatorMessage, D as UniquSelect, E as FieldMappingStrategy, M as NoopLogger, O as TableMetadata, S as sortFieldNames, T as DocumentFieldMapper, _ as guardAggregate, a as decomposePatch, b as guardPaths, c as createFailureCollector, d as AtscriptDbReadable, f as resolveDesignType, g as collectQueryPaths, h as classifyQueryPath, i as assertNoVersionWrites, j as isGeoPointType, k as findAncestorInSet, l as IntegrityStrategy, m as checkHavingKeys, n as isAtscriptDbView, o as ApplicationIntegrity, p as assertGeoPoint, r as AtscriptDbTable, s as BaseDbAdapter, t as AtscriptDbView, u as NativeIntegrity, v as guardFilter, w as RelationalFieldMapper, x as guardQuery, y as guardPath } from "./db-view-Dl0aDTiT.mjs";
3
+ import { a as forceNavNonOptional, c as getKeyProps, l as isEmptyObject, o as isNavRelation, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator, u as isPlainObject } from "./validator-CeD_fqyW.mjs";
4
4
  import { t as DEFAULT_DB_SPACE } from "./consts-C_-5_pFq.mjs";
5
5
  import { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, getDbFieldOp, isDbFieldOp, reconcileCas, separateCas, separateFieldOps } from "./ops.mjs";
6
6
  import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
@@ -372,4 +372,4 @@ function translateQueryTree(node, resolveField) {
372
372
  return { [leftField]: { [comp.op]: comp.right } };
373
373
  }
374
374
  //#endregion
375
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, BaseDbAdapter, CasExhaustedError, DEFAULT_DB_SPACE, DbEncryption, DbError, DbSpace, DocumentFieldMapper, FieldMappingStrategy, IntegrityStrategy, NativeIntegrity, NoopLogger, RelationalFieldMapper, TableMetadata, UniquSelect, assertGeoPoint, assertNoVersionWrites, buildDbValidator, buildValidationContext, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isNavRelation, isPlainObject, isPrimitive, reconcileCas, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
375
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, BaseDbAdapter, CasExhaustedError, CasMismatchError, DEFAULT_DB_SPACE, DbEncryption, DbError, DbSpace, DocumentFieldMapper, FieldMappingStrategy, IntegrityStrategy, NativeIntegrity, NoopLogger, RelationalFieldMapper, TableMetadata, UniquSelect, assertGeoPoint, assertNoVersionWrites, buildDbValidator, buildValidationContext, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isNavRelation, isPlainObject, isPrimitive, reconcileCas, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
@@ -1,4 +1,4 @@
1
- import { n as DbError, r as DepthLimitExceededError } from "./db-error-BHPXOKzc.mjs";
1
+ import { i as DepthLimitExceededError, r as DbError } from "./db-error-COrO58t5.mjs";
2
2
  import { ValidatorError } from "@atscript/typescript/utils";
3
3
  //#region src/rel/relation-helpers.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_db_error = require("./db-error-DXwEzmYJ.cjs");
1
+ const require_db_error = require("./db-error-C4JuLcvb.cjs");
2
2
  let _atscript_typescript_utils = require("@atscript/typescript/utils");
3
3
  //#region src/rel/relation-helpers.ts
4
4
  /**
package/dist/ops.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_db_error = require("./db-error-DXwEzmYJ.cjs");
2
+ const require_db_error = require("./db-error-C4JuLcvb.cjs");
3
3
  //#region src/ops.ts
4
4
  /** Increment a numeric field by `value` (default 1). */
5
5
  function $inc(value = 1) {
package/dist/ops.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as DbError } from "./db-error-BHPXOKzc.mjs";
1
+ import { r as DbError } from "./db-error-COrO58t5.mjs";
2
2
  //#region src/ops.ts
3
3
  /** Increment a numeric field by `value` (default 1). */
4
4
  function $inc(value = 1) {
package/dist/rel.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_nested_writer = require("./nested-writer-DoDhl3X3.cjs");
3
- const require_relation_loader = require("./relation-loader-BnUgJsUG.cjs");
2
+ const require_nested_writer = require("./nested-writer-DxPhmWFz.cjs");
3
+ const require_relation_loader = require("./relation-loader-C8GOpNYJ.cjs");
4
4
  exports.batchInsertNestedFrom = require_nested_writer.batchInsertNestedFrom;
5
5
  exports.batchInsertNestedTo = require_nested_writer.batchInsertNestedTo;
6
6
  exports.batchInsertNestedVia = require_nested_writer.batchInsertNestedVia;