@atscript/db 0.1.141 → 0.1.143

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 (39) hide show
  1. package/dist/agg.d.cts +1 -1
  2. package/dist/agg.d.mts +1 -1
  3. package/dist/{buckets-Bv4pah66.d.cts → buckets-Ba5lP_o9.d.cts} +358 -17
  4. package/dist/{buckets-CjL7F-hp.d.mts → buckets-BlJ4cdlr.d.mts} +358 -17
  5. package/dist/{column-diff-DiBbXyLA.d.cts → column-diff-BlGxPobU.d.cts} +1 -1
  6. package/dist/{column-diff-CfPNcP6e.cjs → column-diff-D_Kyuh0S.cjs} +906 -209
  7. package/dist/{column-diff-n-k5KY0u.d.mts → column-diff-PqA_edXA.d.mts} +1 -1
  8. package/dist/{column-diff-CmFNXV8C.mjs → column-diff-e2oHc71_.mjs} +850 -177
  9. package/dist/index.cjs +16 -10
  10. package/dist/index.d.cts +30 -5
  11. package/dist/index.d.mts +30 -5
  12. package/dist/index.mjs +6 -5
  13. package/dist/nested-writer-CnOOAehr.mjs +880 -0
  14. package/dist/nested-writer-xfQwxplL.cjs +1029 -0
  15. package/dist/{object-DSN0h9lB.d.cts → object-CtPYTIvy.d.cts} +3 -1
  16. package/dist/{object-DSN0h9lB.d.mts → object-CtPYTIvy.d.mts} +3 -1
  17. package/dist/object-Djg28csK.cjs +101 -0
  18. package/dist/object-TkiJQ-Dp.mjs +66 -0
  19. package/dist/rel.cjs +5 -2
  20. package/dist/rel.d.cts +76 -10
  21. package/dist/rel.d.mts +76 -10
  22. package/dist/rel.mjs +3 -3
  23. package/dist/{relation-helpers-B59to_dG.d.mts → relation-helpers-JTEyZzVd.d.cts} +1 -1
  24. package/dist/{relation-helpers-DQ_nRsV9.d.cts → relation-helpers-MTwzaSGA.d.mts} +1 -1
  25. package/dist/{relation-loader-CgJ8bK6X.cjs → relation-loader-CBPY6kM7.cjs} +1 -1
  26. package/dist/{relation-loader-CuhEBzFU.mjs → relation-loader-D9XuXaMv.mjs} +1 -1
  27. package/dist/sync.cjs +1 -1
  28. package/dist/sync.d.cts +2 -2
  29. package/dist/sync.d.mts +2 -2
  30. package/dist/sync.mjs +1 -1
  31. package/dist/{validator-DASnXf1j.cjs → validator-CVS-onRg.cjs} +0 -101
  32. package/dist/{validator-D8bPsXPN.mjs → validator-Clu2q_7z.mjs} +1 -66
  33. package/dist/validator.cjs +4 -3
  34. package/dist/validator.d.cts +1 -1
  35. package/dist/validator.d.mts +1 -1
  36. package/dist/validator.mjs +2 -1
  37. package/package.json +1 -1
  38. package/dist/nested-writer-BO3vhbkP.mjs +0 -661
  39. package/dist/nested-writer-DYsRxZ5f.cjs +0 -768
package/dist/index.cjs CHANGED
@@ -1,12 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_db_error = require("./db-error-DTkkeu5b.cjs");
3
- const require_column_diff = require("./column-diff-CfPNcP6e.cjs");
3
+ const require_column_diff = require("./column-diff-D_Kyuh0S.cjs");
4
4
  const require_aggregate_fns = require("./aggregate-fns-CGBv3E8S.cjs");
5
- const require_nested_writer = require("./nested-writer-DYsRxZ5f.cjs");
5
+ const require_nested_writer = require("./nested-writer-xfQwxplL.cjs");
6
6
  const require_derived_rules = require("./derived-rules-YstgIxG-.cjs");
7
- const require_validator = require("./validator-DASnXf1j.cjs");
7
+ const require_object = require("./object-Djg28csK.cjs");
8
8
  const require_consts = require("./consts-BzRfCcH2.cjs");
9
9
  const require_ops = require("./ops.cjs");
10
+ const require_validator = require("./validator-CVS-onRg.cjs");
10
11
  let _atscript_typescript_utils = require("@atscript/typescript/utils");
11
12
  let _uniqu_core = require("@uniqu/core");
12
13
  let node_crypto = require("node:crypto");
@@ -188,7 +189,7 @@ async function withOptimisticRetry(table, filter, mutator, opts) {
188
189
  }]);
189
190
  lastSeenVersion = row[versionColumn];
190
191
  const patch = await mutator(row);
191
- if (patch === void 0 || require_validator.isEmptyObject(patch)) return {
192
+ if (patch === void 0 || require_object.isEmptyObject(patch)) return {
192
193
  matchedCount: 1,
193
194
  modifiedCount: 0
194
195
  };
@@ -259,7 +260,7 @@ var DbSpace = class {
259
260
  * appropriate instance. Uses `@db.view` or `@db.view.for` presence to distinguish.
260
261
  */
261
262
  get(type, logger) {
262
- if (type.metadata.has("db.view") || type.metadata.has("db.view.for")) return this.getView(type, logger);
263
+ if (require_column_diff.isViewType(type)) return this.getView(type, logger);
263
264
  return this.getTable(type, logger);
264
265
  }
265
266
  /**
@@ -475,12 +476,13 @@ Object.defineProperty(exports, "computeInsights", {
475
476
  exports.createDbValidatorPlugin = require_validator.createDbValidatorPlugin;
476
477
  exports.createFailureCollector = require_column_diff.createFailureCollector;
477
478
  exports.decomposePatch = require_column_diff.decomposePatch;
478
- exports.deletePath = require_validator.deletePath;
479
- exports.findAncestorInSet = require_validator.findAncestorInSet;
479
+ exports.deletePath = require_object.deletePath;
480
+ exports.findAncestorInSet = require_object.findAncestorInSet;
480
481
  exports.forceNavNonOptional = require_validator.forceNavNonOptional;
482
+ exports.geoIndexNotFoundMessage = require_column_diff.geoIndexNotFoundMessage;
481
483
  exports.getDbFieldOp = require_ops.getDbFieldOp;
482
484
  exports.getKeyProps = require_validator.getKeyProps;
483
- exports.getPath = require_validator.getPath;
485
+ exports.getPath = require_object.getPath;
484
486
  exports.guardAggregate = require_column_diff.guardAggregate;
485
487
  exports.guardFilter = require_column_diff.guardFilter;
486
488
  exports.guardPath = require_column_diff.guardPath;
@@ -491,31 +493,35 @@ exports.isBucketableField = require_column_diff.isBucketableField;
491
493
  exports.isColumnTypeChanged = require_column_diff.isColumnTypeChanged;
492
494
  exports.isDbEntityType = isDbEntityType;
493
495
  exports.isDbFieldOp = require_ops.isDbFieldOp;
494
- exports.isEmptyObject = require_validator.isEmptyObject;
496
+ exports.isEmptyObject = require_object.isEmptyObject;
495
497
  exports.isFieldRef = isFieldRef;
496
498
  exports.isGeoIndexableType = require_column_diff.isGeoIndexableType;
497
499
  exports.isGeoPointType = require_column_diff.isGeoPointType;
498
500
  exports.isJsonValueField = require_column_diff.isJsonValueField;
499
501
  exports.isNavRelation = require_validator.isNavRelation;
500
- exports.isPlainObject = require_validator.isPlainObject;
502
+ exports.isPlainObject = require_object.isPlainObject;
501
503
  Object.defineProperty(exports, "isPrimitive", {
502
504
  enumerable: true,
503
505
  get: function() {
504
506
  return _uniqu_core.isPrimitive;
505
507
  }
506
508
  });
509
+ exports.isViewType = require_column_diff.isViewType;
507
510
  exports.jsonValueAncestor = require_column_diff.jsonValueAncestor;
508
511
  exports.narrowerFilterOps = require_column_diff.narrowerFilterOps;
509
512
  exports.normalizeComputedSelect = require_column_diff.normalizeComputedSelect;
510
513
  exports.reconcileCas = require_ops.reconcileCas;
511
514
  exports.resolveCalendarBuckets = require_column_diff.resolveCalendarBuckets;
512
515
  exports.resolveDesignType = require_column_diff.resolveDesignType;
516
+ exports.searchIndexNotFoundMessage = require_column_diff.searchIndexNotFoundMessage;
517
+ exports.selfOrAncestor = require_object.selfOrAncestor;
513
518
  exports.separateCas = require_ops.separateCas;
514
519
  exports.separateFieldOps = require_ops.separateFieldOps;
515
520
  exports.sortFieldNames = require_column_diff.sortFieldNames;
516
521
  exports.tableNameOf = require_nested_writer.tableNameOf;
517
522
  exports.translateQueryTree = translateQueryTree;
518
523
  exports.unsupportedOperatorMessage = require_column_diff.unsupportedOperatorMessage;
524
+ exports.vectorIndexNotFoundMessage = require_column_diff.vectorIndexNotFoundMessage;
519
525
  Object.defineProperty(exports, "walkFilter", {
520
526
  enumerable: true,
521
527
  get: function() {
package/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { $ as TDbWriteGuard, $t as IntegrityStrategy, A as TDbActionInfo, At as UniqueryControls, B as TDbIndex, Bt as AtscriptDbView, C as OwnPropsOf, Ct as TTouchManyOptions, D as TColumnDiff, Dt as TWriteTableResolver, E as TCascadeTarget, Et as TWriteOptions, F as TDbDefaultFn, Ft as ALL_BUCKET_UNITS, G as TDbObjectKind, Gt as AtscriptQueryFieldRef, H as TDbIndexType, Ht as isAtscriptDbView, I as TDbDefaultValue, It as BaseDbAdapter, J as TDbRemoveGuard, Jt as TViewJoin, K as TDbReferentialAction, Kt as AtscriptQueryNode, L as TDbDeleteResult, Lt as DbSpace, M as TDbActionLevel, Mt as TableMetadata, N as TDbActionProcessor, Nt as isGeoIndexableType, O as TCrudOp, Ot as TypedWithRelation, P as TDbCollation, Pt as isGeoPointType, Q as TDbWriteAction, Qt as AtscriptDbTable, R as TDbFieldMeta, Rt as TAdapterFactory, S as NullableOptional, St as TTableResolver, T as TCascadeResolver, Tt as TViewJsonType, U as TDbInsertManyResult, Ut as aliasTargetOf, V as TDbIndexField, Vt as TViewColumnMapping, W as TDbInsertResult, Wt as AtscriptQueryComparison, X as TDbStorageType, Xt as isFieldRef, Y as TDbRemoveGuardContext, Yt as TViewPlan, Z as TDbUpdateResult, Zt as translateQueryTree, _ as DbRow, _t as TReferencingForeignKey, a as jsonValueAncestor, an as TDbEncryptionOptions, at as TExistingColumn, b as FlatOf, bt as TSyncColumnResult, c as AggregateControls, cn as TReadControls, ct as TFieldMeta, d as AggregateQuery, dn as UniquSelect, dt as TIdDescriptor, en as NativeIntegrity, et as TDbWriteGuardContext, f as AggregateResult, ft as TIdResolveOptions, g as DbQuery, gt as TPrimaryKeyChange, h as DbPatch, ht as TMetadataOverrides, i as isJsonValueField, in as DbEncryption, it as TEnsureTableOptions, j as TDbActionIntent, jt as WithRelation, k as TCrudPermissions, kt as Uniquery, l as AggregateExpr, ln as NoopLogger, lt as TFkLookupResolver, m as DbControls, mt as TMetaResponse, n as TResolvedBucket, nn as DbResponse, nt as TDerivedChangeReason, o as normalizeComputedSelect, on as DocumentFieldMapper, ot as TExistingForeignKey, p as AtscriptDbWritable, pt as TIdentification, q as TDbRelation, qt as AtscriptRef, r as isBucketableField, rn as resolveDesignType, rt as TDerivedColumn, s as resolveCalendarBuckets, sn as FieldMappingStrategy, st as TExistingTableOption, t as TBucketFieldSource, tn as AtscriptDbReadable, tt as TDeleteOptions, u as AggregateFn, un as TGenericLogger, ut as TFkLookupTarget, v as FieldOpsFor, vt as TRelationInfo, w as PrimaryKeyOf, wt as TValueFormatterPair, x as NavPropsOf, xt as TTableOptionDiff, y as FilterExpr, yt as TSearchIndexInfo, z as TDbForeignKey, zt as TDbSpaceOptions } from "./buckets-Bv4pah66.cjs";
1
+ import { $ as TDbWriteAction, $t as TViewJoin, A as TCrudPermissions, At as TWriteOptions, B as TDbForeignKey, Bt as BaseDbAdapter, C as NullableOptional, Ct as TSearchIndexInfo, D as TCascadeTarget, Dt as TTouchManyOptions, E as TCascadeResolver, Et as TTableResolver, F as TDbCollation, Ft as WithRelation, G as TDbInsertResult, Gt as TViewColumnMapping, H as TDbIndexField, Ht as TAdapterFactory, I as TDbDefaultFn, It as TableMetadata, J as TDbRelation, Jt as aliasTargetOf, K as TDbObjectKind, Kt as isAtscriptDbView, L as TDbDefaultValue, Lt as isGeoIndexableType, M as TDbActionIntent, Mt as TypedWithRelation, N as TDbActionLevel, Nt as Uniquery, O as TColumnDiff, Ot as TValueFormatterPair, P as TDbActionProcessor, Pt as UniqueryControls, Q as TDbUpdateResult, Qt as AtscriptRef, R as TDbDeleteResult, Rt as isGeoPointType, S as NavPropsOf, St as TRowResolveOptions, T as PrimaryKeyOf, Tt as TTableOptionDiff, U as TDbIndexType, Ut as TDbSpaceOptions, V as TDbIndex, Vt as DbSpace, W as TDbInsertManyResult, Wt as AtscriptDbView, X as TDbRemoveGuardContext, Xt as AtscriptQueryFieldRef, Y as TDbRemoveGuard, Yt as AtscriptQueryComparison, Z as TDbStorageType, Zt as AtscriptQueryNode, _ as DbQuery, _t as TMetaResponse, a as jsonValueAncestor, an as NativeIntegrity, at as TDerivedChangeReason, b as FilterExpr, bt as TReferencingForeignKey, c as AggregateControls, cn as resolveDesignType, ct as TExistingColumn, d as AggregateQuery, dn as DocumentFieldMapper, dt as TFieldMeta, en as TViewPlan, et as TDbWriteCheck, f as AggregateResult, fn as FieldMappingStrategy, ft as TFkLookupResolver, g as DbPatch, gn as UniquSelect, gt as TIdentification, h as DbControls, hn as TGenericLogger, ht as TIdResolveOptions, i as isJsonValueField, in as IntegrityStrategy, it as TDeleteOptions, j as TDbActionInfo, jt as TWriteTableResolver, k as TCrudOp, kt as TViewJsonType, l as AggregateExpr, ln as DbEncryption, lt as TExistingForeignKey, m as AtscriptDbWritable, mn as NoopLogger, mt as TIdDescriptor, n as TResolvedBucket, nn as translateQueryTree, nt as TDbWriteGuard, o as normalizeComputedSelect, on as AtscriptDbReadable, ot as TDerivedColumn, pn as TReadControls, pt as TFkLookupTarget, q as TDbReferentialAction, qt as isViewType, r as isBucketableField, rn as AtscriptDbTable, rt as TDbWriteGuardContext, s as resolveCalendarBuckets, sn as DbResponse, st as TEnsureTableOptions, t as TBucketFieldSource, tn as isFieldRef, tt as TDbWriteCheckContext, u as AggregateFn, un as TDbEncryptionOptions, ut as TExistingTableOption, v as DbRow, vt as TMetadataOverrides, w as OwnPropsOf, wt as TSyncColumnResult, x as FlatOf, xt as TRelationInfo, y as FieldOpsFor, yt as TPrimaryKeyChange, z as TDbFieldMeta, zt as ALL_BUCKET_UNITS } from "./buckets-Ba5lP_o9.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 isPlainObject, i as isEmptyObject, n as findAncestorInSet, r as getPath, t as deletePath } from "./object-DSN0h9lB.cjs";
3
+ import { a as isPlainObject, i as isEmptyObject, n as findAncestorInSet, o as selfOrAncestor, r as getPath, t as deletePath } from "./object-CtPYTIvy.cjs";
4
4
  import { c as CalendarBucketLabel, d as WeekStart, g as ALL_AGGREGATE_FNS, l as ComputedExpr, o as BucketExpr, s as BucketUnit, u as ResolvedBucket } from "./agg-CV7y8nC6.cjs";
5
5
  import { a as buildValidationContext, c as isNavRelation, d as getKeyProps, f as CasExhaustedError, g as bucketTimeZoneUnavailable, h as DbErrorCode, l as TArrayPatch, m as DbError, n as ValidatorMode, p as CasMismatchError, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as TDbPatch } from "./validator-Bw6ks9Hy.cjs";
6
6
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.cjs";
7
- import { n as isColumnTypeChanged } from "./column-diff-DiBbXyLA.cjs";
8
- import { i as tableNameOf } from "./relation-helpers-DQ_nRsV9.cjs";
7
+ import { n as isColumnTypeChanged } from "./column-diff-BlGxPobU.cjs";
8
+ import { i as tableNameOf } from "./relation-helpers-JTEyZzVd.cjs";
9
9
  import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, ResolvedBucket as ResolvedBucket$1, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
10
10
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
11
11
 
@@ -433,6 +433,31 @@ interface WithOptimisticRetryOptions {
433
433
  */
434
434
  declare function withOptimisticRetry<TRow extends Record<string, unknown>>(table: AtscriptDbTable, filter: Record<string, unknown>, mutator: (row: TRow) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined, opts?: WithOptimisticRetryOptions): Promise<TDbUpdateResult>;
435
435
  //#endregion
436
+ //#region src/shared/index-messages.d.ts
437
+ /**
438
+ * Wording of the "index not found" errors — one source for the core, every
439
+ * adapter and the HTTP layer, so a request naming a hidden index reads
440
+ * exactly like one naming a nonexistent index.
441
+ */
442
+ /**
443
+ * `Search index "<name>" not found`, or — without a name — the "no default
444
+ * text index" message.
445
+ * @since 0.1.143
446
+ */
447
+ declare function searchIndexNotFoundMessage(indexName?: string): string;
448
+ /**
449
+ * `Vector index "<name>" not found`, or — without a name — the "no vector
450
+ * index" message.
451
+ * @since 0.1.143
452
+ */
453
+ declare function vectorIndexNotFoundMessage(indexName?: string): string;
454
+ /**
455
+ * `Geo index "<name>" not found on table "<table>"`, or — without a name —
456
+ * the "table declares no geo index" message.
457
+ * @since 0.1.143
458
+ */
459
+ declare function geoIndexNotFoundMessage(tableName: string, indexName?: string): string;
460
+ //#endregion
436
461
  //#region src/patch/patch-decomposer.d.ts
437
462
  /**
438
463
  * Decomposes a patch payload into a flat update object for adapters
@@ -506,4 +531,4 @@ declare function createFailureCollector(what: string): {
506
531
  throwIfAny: () => void;
507
532
  };
508
533
  //#endregion
509
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, 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, type BucketExpr, type BucketUnit, type CalendarBucketLabel, CasExhaustedError, CasMismatchError, type ComputedExpr, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type ResolvedBucket, type TAdapterFactory, type TArrayPatch, type TBucketFieldSource, type TBucketSourceTable, type TBucketSourceVerdict, 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 TDerivedChangeReason, type TDerivedColumn, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFilterPredicate, type TFilterRef, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdResolveOptions, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReadControls, type TReferencingForeignKey, type TRelationInfo, type TResolvedBucket, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewJsonType, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WeekStart, type WithOptimisticRetryOptions, type WithRelation, acceptedOperatorsHint, aliasTargetOf, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, resolveCalendarBuckets, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
534
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, 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, type BucketExpr, type BucketUnit, type CalendarBucketLabel, CasExhaustedError, CasMismatchError, type ComputedExpr, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type ResolvedBucket, type TAdapterFactory, type TArrayPatch, type TBucketFieldSource, type TBucketSourceTable, type TBucketSourceVerdict, 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 TDbWriteCheck, type TDbWriteCheckContext, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TDerivedChangeReason, type TDerivedColumn, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFilterPredicate, type TFilterRef, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdResolveOptions, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReadControls, type TReferencingForeignKey, type TRelationInfo, type TResolvedBucket, type TRowResolveOptions, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewJsonType, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WeekStart, type WithOptimisticRetryOptions, type WithRelation, acceptedOperatorsHint, aliasTargetOf, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, forceNavNonOptional, geoIndexNotFoundMessage, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, isViewType, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, resolveCalendarBuckets, resolveDesignType, searchIndexNotFoundMessage, selfOrAncestor, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, vectorIndexNotFoundMessage, walkFilter, withOptimisticRetry };
package/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
- import { $ as TDbWriteGuard, $t as IntegrityStrategy, A as TDbActionInfo, At as UniqueryControls, B as TDbIndex, Bt as AtscriptDbView, C as OwnPropsOf, Ct as TTouchManyOptions, D as TColumnDiff, Dt as TWriteTableResolver, E as TCascadeTarget, Et as TWriteOptions, F as TDbDefaultFn, Ft as ALL_BUCKET_UNITS, G as TDbObjectKind, Gt as AtscriptQueryFieldRef, H as TDbIndexType, Ht as isAtscriptDbView, I as TDbDefaultValue, It as BaseDbAdapter, J as TDbRemoveGuard, Jt as TViewJoin, K as TDbReferentialAction, Kt as AtscriptQueryNode, L as TDbDeleteResult, Lt as DbSpace, M as TDbActionLevel, Mt as TableMetadata, N as TDbActionProcessor, Nt as isGeoIndexableType, O as TCrudOp, Ot as TypedWithRelation, P as TDbCollation, Pt as isGeoPointType, Q as TDbWriteAction, Qt as AtscriptDbTable, R as TDbFieldMeta, Rt as TAdapterFactory, S as NullableOptional, St as TTableResolver, T as TCascadeResolver, Tt as TViewJsonType, U as TDbInsertManyResult, Ut as aliasTargetOf, V as TDbIndexField, Vt as TViewColumnMapping, W as TDbInsertResult, Wt as AtscriptQueryComparison, X as TDbStorageType, Xt as isFieldRef, Y as TDbRemoveGuardContext, Yt as TViewPlan, Z as TDbUpdateResult, Zt as translateQueryTree, _ as DbRow, _t as TReferencingForeignKey, a as jsonValueAncestor, an as TDbEncryptionOptions, at as TExistingColumn, b as FlatOf, bt as TSyncColumnResult, c as AggregateControls, cn as TReadControls, ct as TFieldMeta, d as AggregateQuery, dn as UniquSelect, dt as TIdDescriptor, en as NativeIntegrity, et as TDbWriteGuardContext, f as AggregateResult, ft as TIdResolveOptions, g as DbQuery, gt as TPrimaryKeyChange, h as DbPatch, ht as TMetadataOverrides, i as isJsonValueField, in as DbEncryption, it as TEnsureTableOptions, j as TDbActionIntent, jt as WithRelation, k as TCrudPermissions, kt as Uniquery, l as AggregateExpr, ln as NoopLogger, lt as TFkLookupResolver, m as DbControls, mt as TMetaResponse, n as TResolvedBucket, nn as DbResponse, nt as TDerivedChangeReason, o as normalizeComputedSelect, on as DocumentFieldMapper, ot as TExistingForeignKey, p as AtscriptDbWritable, pt as TIdentification, q as TDbRelation, qt as AtscriptRef, r as isBucketableField, rn as resolveDesignType, rt as TDerivedColumn, s as resolveCalendarBuckets, sn as FieldMappingStrategy, st as TExistingTableOption, t as TBucketFieldSource, tn as AtscriptDbReadable, tt as TDeleteOptions, u as AggregateFn, un as TGenericLogger, ut as TFkLookupTarget, v as FieldOpsFor, vt as TRelationInfo, w as PrimaryKeyOf, wt as TValueFormatterPair, x as NavPropsOf, xt as TTableOptionDiff, y as FilterExpr, yt as TSearchIndexInfo, z as TDbForeignKey, zt as TDbSpaceOptions } from "./buckets-CjL7F-hp.mjs";
1
+ import { $ as TDbWriteAction, $t as TViewJoin, A as TCrudPermissions, At as TWriteOptions, B as TDbForeignKey, Bt as BaseDbAdapter, C as NullableOptional, Ct as TSearchIndexInfo, D as TCascadeTarget, Dt as TTouchManyOptions, E as TCascadeResolver, Et as TTableResolver, F as TDbCollation, Ft as WithRelation, G as TDbInsertResult, Gt as TViewColumnMapping, H as TDbIndexField, Ht as TAdapterFactory, I as TDbDefaultFn, It as TableMetadata, J as TDbRelation, Jt as aliasTargetOf, K as TDbObjectKind, Kt as isAtscriptDbView, L as TDbDefaultValue, Lt as isGeoIndexableType, M as TDbActionIntent, Mt as TypedWithRelation, N as TDbActionLevel, Nt as Uniquery, O as TColumnDiff, Ot as TValueFormatterPair, P as TDbActionProcessor, Pt as UniqueryControls, Q as TDbUpdateResult, Qt as AtscriptRef, R as TDbDeleteResult, Rt as isGeoPointType, S as NavPropsOf, St as TRowResolveOptions, T as PrimaryKeyOf, Tt as TTableOptionDiff, U as TDbIndexType, Ut as TDbSpaceOptions, V as TDbIndex, Vt as DbSpace, W as TDbInsertManyResult, Wt as AtscriptDbView, X as TDbRemoveGuardContext, Xt as AtscriptQueryFieldRef, Y as TDbRemoveGuard, Yt as AtscriptQueryComparison, Z as TDbStorageType, Zt as AtscriptQueryNode, _ as DbQuery, _t as TMetaResponse, a as jsonValueAncestor, an as NativeIntegrity, at as TDerivedChangeReason, b as FilterExpr, bt as TReferencingForeignKey, c as AggregateControls, cn as resolveDesignType, ct as TExistingColumn, d as AggregateQuery, dn as DocumentFieldMapper, dt as TFieldMeta, en as TViewPlan, et as TDbWriteCheck, f as AggregateResult, fn as FieldMappingStrategy, ft as TFkLookupResolver, g as DbPatch, gn as UniquSelect, gt as TIdentification, h as DbControls, hn as TGenericLogger, ht as TIdResolveOptions, i as isJsonValueField, in as IntegrityStrategy, it as TDeleteOptions, j as TDbActionInfo, jt as TWriteTableResolver, k as TCrudOp, kt as TViewJsonType, l as AggregateExpr, ln as DbEncryption, lt as TExistingForeignKey, m as AtscriptDbWritable, mn as NoopLogger, mt as TIdDescriptor, n as TResolvedBucket, nn as translateQueryTree, nt as TDbWriteGuard, o as normalizeComputedSelect, on as AtscriptDbReadable, ot as TDerivedColumn, pn as TReadControls, pt as TFkLookupTarget, q as TDbReferentialAction, qt as isViewType, r as isBucketableField, rn as AtscriptDbTable, rt as TDbWriteGuardContext, s as resolveCalendarBuckets, sn as DbResponse, st as TEnsureTableOptions, t as TBucketFieldSource, tn as isFieldRef, tt as TDbWriteCheckContext, u as AggregateFn, un as TDbEncryptionOptions, ut as TExistingTableOption, v as DbRow, vt as TMetadataOverrides, w as OwnPropsOf, wt as TSyncColumnResult, x as FlatOf, xt as TRelationInfo, y as FieldOpsFor, yt as TPrimaryKeyChange, z as TDbFieldMeta, zt as ALL_BUCKET_UNITS } from "./buckets-BlJ4cdlr.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 isPlainObject, i as isEmptyObject, n as findAncestorInSet, r as getPath, t as deletePath } from "./object-DSN0h9lB.mjs";
3
+ import { a as isPlainObject, i as isEmptyObject, n as findAncestorInSet, o as selfOrAncestor, r as getPath, t as deletePath } from "./object-CtPYTIvy.mjs";
4
4
  import { c as CalendarBucketLabel, d as WeekStart, g as ALL_AGGREGATE_FNS, l as ComputedExpr, o as BucketExpr, s as BucketUnit, u as ResolvedBucket } from "./agg-D5DHsAby.mjs";
5
5
  import { a as buildValidationContext, c as isNavRelation, d as getKeyProps, f as CasExhaustedError, g as bucketTimeZoneUnavailable, h as DbErrorCode, l as TArrayPatch, m as DbError, n as ValidatorMode, p as CasMismatchError, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as TDbPatch } from "./validator-Bw6ks9Hy.mjs";
6
6
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.mjs";
7
- import { n as isColumnTypeChanged } from "./column-diff-n-k5KY0u.mjs";
8
- import { i as tableNameOf } from "./relation-helpers-B59to_dG.mjs";
7
+ import { n as isColumnTypeChanged } from "./column-diff-PqA_edXA.mjs";
8
+ import { i as tableNameOf } from "./relation-helpers-MTwzaSGA.mjs";
9
9
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
10
10
  import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, ResolvedBucket as ResolvedBucket$1, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
11
11
 
@@ -433,6 +433,31 @@ interface WithOptimisticRetryOptions {
433
433
  */
434
434
  declare function withOptimisticRetry<TRow extends Record<string, unknown>>(table: AtscriptDbTable, filter: Record<string, unknown>, mutator: (row: TRow) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined, opts?: WithOptimisticRetryOptions): Promise<TDbUpdateResult>;
435
435
  //#endregion
436
+ //#region src/shared/index-messages.d.ts
437
+ /**
438
+ * Wording of the "index not found" errors — one source for the core, every
439
+ * adapter and the HTTP layer, so a request naming a hidden index reads
440
+ * exactly like one naming a nonexistent index.
441
+ */
442
+ /**
443
+ * `Search index "<name>" not found`, or — without a name — the "no default
444
+ * text index" message.
445
+ * @since 0.1.143
446
+ */
447
+ declare function searchIndexNotFoundMessage(indexName?: string): string;
448
+ /**
449
+ * `Vector index "<name>" not found`, or — without a name — the "no vector
450
+ * index" message.
451
+ * @since 0.1.143
452
+ */
453
+ declare function vectorIndexNotFoundMessage(indexName?: string): string;
454
+ /**
455
+ * `Geo index "<name>" not found on table "<table>"`, or — without a name —
456
+ * the "table declares no geo index" message.
457
+ * @since 0.1.143
458
+ */
459
+ declare function geoIndexNotFoundMessage(tableName: string, indexName?: string): string;
460
+ //#endregion
436
461
  //#region src/patch/patch-decomposer.d.ts
437
462
  /**
438
463
  * Decomposes a patch payload into a flat update object for adapters
@@ -506,4 +531,4 @@ declare function createFailureCollector(what: string): {
506
531
  throwIfAny: () => void;
507
532
  };
508
533
  //#endregion
509
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, 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, type BucketExpr, type BucketUnit, type CalendarBucketLabel, CasExhaustedError, CasMismatchError, type ComputedExpr, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type ResolvedBucket, type TAdapterFactory, type TArrayPatch, type TBucketFieldSource, type TBucketSourceTable, type TBucketSourceVerdict, 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 TDerivedChangeReason, type TDerivedColumn, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFilterPredicate, type TFilterRef, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdResolveOptions, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReadControls, type TReferencingForeignKey, type TRelationInfo, type TResolvedBucket, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewJsonType, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WeekStart, type WithOptimisticRetryOptions, type WithRelation, acceptedOperatorsHint, aliasTargetOf, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, resolveCalendarBuckets, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
534
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, 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, type BucketExpr, type BucketUnit, type CalendarBucketLabel, CasExhaustedError, CasMismatchError, type ComputedExpr, DEFAULT_DB_SPACE, type DbControls, DbEncryption, DbError, type DbErrorCode, type DbPatch, type DbQuery, type DbResponse, type DbRow, DbSpace, type DbValidationContext, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, type FieldOpsFor, type FilterExpr, type FilterVisitor, type FlatOf, IntegrityStrategy, NativeIntegrity, type NavPropsOf, NoopLogger, type NullableOptional, type OwnPropsOf, type PrimaryKeyOf, RelationalFieldMapper, type ResolvedBucket, type TAdapterFactory, type TArrayPatch, type TBucketFieldSource, type TBucketSourceTable, type TBucketSourceVerdict, 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 TDbWriteCheck, type TDbWriteCheckContext, type TDbWriteGuard, type TDbWriteGuardContext, type TDeleteOptions, type TDerivedChangeReason, type TDerivedColumn, type TEnsureTableOptions, type TExistingColumn, type TExistingForeignKey, type TExistingTableOption, type TFieldMeta, type TFieldOps, type TFilterPredicate, type TFilterRef, type TFkLookupResolver, type TFkLookupTarget, type TGenericLogger, type TGuardedQuery, type TIdDescriptor, type TIdResolveOptions, type TIdentification, type TMetaResponse, type TMetadataOverrides, type TPrimaryKeyChange, type TQueryPathKind, type TQueryPathOp, type TQueryPathRefs, type TQueryPathSource, type TReadControls, type TReferencingForeignKey, type TRelationInfo, type TResolvedBucket, type TRowResolveOptions, type TSearchIndexInfo, type TSyncColumnResult, type TTableOptionDiff, type TTableResolver, type TTouchManyOptions, type TValueFormatterPair, type TViewColumnMapping, type TViewJoin, type TViewJsonType, type TViewPlan, type TWriteOptions, type TWriteTableResolver, TableMetadata, type TypedWithRelation, UniquSelect, type Uniquery, type UniqueryControls, type ValidationContext, type ValidatorMode, type WeekStart, type WithOptimisticRetryOptions, type WithRelation, acceptedOperatorsHint, aliasTargetOf, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, forceNavNonOptional, geoIndexNotFoundMessage, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, isViewType, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, resolveCalendarBuckets, resolveDesignType, searchIndexNotFoundMessage, selfOrAncestor, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, vectorIndexNotFoundMessage, walkFilter, withOptimisticRetry };
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  import { a as bucketTimeZoneUnavailable, n as CasMismatchError, r as DbError, t as CasExhaustedError } from "./db-error-D5uilS_A.mjs";
2
- import { $ as isJsonValueField, A as assertGeoPoint, B as guardQuery, C as IntegrityStrategy, D as ADAPTER_FILTER_REASON, E as resolveDesignType, F as collectQueryPaths, G as DocumentFieldMapper, H as sortFieldNames, I as guardAggregate, J as TableMetadata, K as FieldMappingStrategy, L as guardFilter, M as canFilterLeaf, N as checkHavingKeys, O as ENCRYPTED_REASON, P as classifyQueryPath, Q as isBucketableField, R as guardPath, S as createFailureCollector, T as AtscriptDbReadable, U as unsupportedOperatorMessage, V as narrowerFilterOps, W as RelationalFieldMapper, X as isGeoPointType, Y as isGeoIndexableType, Z as aliasTargetOf, _ as assertNoVersionWrites, b as ALL_BUCKET_UNITS, et as jsonValueAncestor, g as AtscriptDbTable, h as isAtscriptDbView, j as bucketSourceVerdict, k as acceptedOperatorsHint, m as AtscriptDbView, n as isColumnTypeChanged, nt as resolveCalendarBuckets, q as UniquSelect, rt as NoopLogger, tt as normalizeComputedSelect, v as decomposePatch, w as NativeIntegrity, x as BaseDbAdapter, y as ApplicationIntegrity, z as guardPaths } from "./column-diff-CmFNXV8C.mjs";
2
+ import { $ as isGeoIndexableType, A as vectorIndexNotFoundMessage, B as guardAggregate, C as createFailureCollector, D as resolveDesignType, E as AtscriptDbReadable, F as bucketSourceVerdict, G as narrowerFilterOps, H as guardPath, I as canFilterLeaf, J as RelationalFieldMapper, K as sortFieldNames, L as checkHavingKeys, M as ENCRYPTED_REASON, N as acceptedOperatorsHint, O as geoIndexNotFoundMessage, P as assertGeoPoint, Q as TableMetadata, R as classifyQueryPath, S as BaseDbAdapter, T as NativeIntegrity, U as guardPaths, V as guardFilter, W as guardQuery, X as FieldMappingStrategy, Y as DocumentFieldMapper, Z as UniquSelect, _ as AtscriptDbTable, at as normalizeComputedSelect, b as ApplicationIntegrity, et as isGeoPointType, g as isViewType, h as isAtscriptDbView, it as jsonValueAncestor, j as ADAPTER_FILTER_REASON, k as searchIndexNotFoundMessage, m as AtscriptDbView, n as isColumnTypeChanged, nt as isBucketableField, ot as resolveCalendarBuckets, q as unsupportedOperatorMessage, rt as isJsonValueField, st as NoopLogger, tt as aliasTargetOf, v as assertNoVersionWrites, w as IntegrityStrategy, x as ALL_BUCKET_UNITS, y as decomposePatch, z as collectQueryPaths } from "./column-diff-e2oHc71_.mjs";
3
3
  import { t as ALL_AGGREGATE_FNS } from "./aggregate-fns-CfsveE1w.mjs";
4
- import { v as tableNameOf } from "./nested-writer-BO3vhbkP.mjs";
4
+ import { T as tableNameOf } from "./nested-writer-CnOOAehr.mjs";
5
5
  import { t as DB_ENTITY_ANNOTATIONS } from "./derived-rules-0sKn4f5C.mjs";
6
- import { a as forceNavNonOptional, c as getKeyProps, d as getPath, f as isEmptyObject, l as deletePath, o as isNavRelation, p as isPlainObject, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator, u as findAncestorInSet } from "./validator-D8bPsXPN.mjs";
6
+ import { a as isPlainObject, i as isEmptyObject, n as findAncestorInSet, o as selfOrAncestor, r as getPath, t as deletePath } from "./object-TkiJQ-Dp.mjs";
7
7
  import { t as DEFAULT_DB_SPACE } from "./consts-C_-5_pFq.mjs";
8
8
  import { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, getDbFieldOp, isDbFieldOp, reconcileCas, separateCas, separateFieldOps } from "./ops.mjs";
9
+ import { a as forceNavNonOptional, c as getKeyProps, o as isNavRelation, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator } from "./validator-Clu2q_7z.mjs";
9
10
  import { isAnnotatedType } from "@atscript/typescript/utils";
10
11
  import { computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
11
12
  import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
@@ -258,7 +259,7 @@ var DbSpace = class {
258
259
  * appropriate instance. Uses `@db.view` or `@db.view.for` presence to distinguish.
259
260
  */
260
261
  get(type, logger) {
261
- if (type.metadata.has("db.view") || type.metadata.has("db.view.for")) return this.getView(type, logger);
262
+ if (isViewType(type)) return this.getView(type, logger);
262
263
  return this.getTable(type, logger);
263
264
  }
264
265
  /**
@@ -421,4 +422,4 @@ function isDbEntityType(value) {
421
422
  return DB_ENTITY_ANNOTATIONS.some((name) => value.metadata.has(name));
422
423
  }
423
424
  //#endregion
424
- export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, BaseDbAdapter, CasExhaustedError, CasMismatchError, DEFAULT_DB_SPACE, DbEncryption, DbError, DbSpace, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, IntegrityStrategy, NativeIntegrity, NoopLogger, RelationalFieldMapper, TableMetadata, UniquSelect, acceptedOperatorsHint, aliasTargetOf, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, resolveCalendarBuckets, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
425
+ export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ADAPTER_FILTER_REASON, ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, BaseDbAdapter, CasExhaustedError, CasMismatchError, DEFAULT_DB_SPACE, DbEncryption, DbError, DbSpace, DocumentFieldMapper, ENCRYPTED_REASON, FieldMappingStrategy, IntegrityStrategy, NativeIntegrity, NoopLogger, RelationalFieldMapper, TableMetadata, UniquSelect, acceptedOperatorsHint, aliasTargetOf, assertGeoPoint, assertNoVersionWrites, bucketSourceVerdict, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, deletePath, findAncestorInSet, forceNavNonOptional, geoIndexNotFoundMessage, getDbFieldOp, getKeyProps, getPath, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isColumnTypeChanged, isDbEntityType, isDbFieldOp, isEmptyObject, isFieldRef, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, isViewType, jsonValueAncestor, narrowerFilterOps, normalizeComputedSelect, reconcileCas, resolveCalendarBuckets, resolveDesignType, searchIndexNotFoundMessage, selfOrAncestor, separateCas, separateFieldOps, sortFieldNames, tableNameOf, translateQueryTree, unsupportedOperatorMessage, vectorIndexNotFoundMessage, walkFilter, withOptimisticRetry };