@atscript/db 0.1.130 → 0.1.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agg.cjs +19 -5
- package/dist/agg.d.cts +3 -4
- package/dist/agg.d.mts +3 -4
- package/dist/agg.mjs +2 -5
- package/dist/{db-readable-B7eYWS5q.d.cts → buckets-BvoYYQ2Q.d.cts} +1348 -1142
- package/dist/{db-readable-Bn1bV_eC.d.mts → buckets-D2XPrwSC.d.mts} +1348 -1142
- package/dist/{db-error-COrO58t5.mjs → db-error-D5uilS_A.mjs} +13 -1
- package/dist/{db-error-C4JuLcvb.cjs → db-error-DTkkeu5b.cjs} +18 -0
- package/dist/{db-space-C2UCnGHd.d.cts → db-space-BQQEgB3d.d.mts} +2 -2
- package/dist/{db-space-DdIPYD0Q.d.mts → db-space-Cslq5Dux.d.cts} +2 -2
- package/dist/{db-view-hkwQ-fHJ.cjs → db-view-CuFAhzwF.cjs} +487 -123
- package/dist/{db-view-BkF2xEGd.mjs → db-view-DVGWWhA3.mjs} +439 -123
- package/dist/index.cjs +13 -4
- package/dist/index.d.cts +105 -38
- package/dist/index.d.mts +105 -38
- package/dist/index.mjs +5 -5
- package/dist/{nested-writer-CkDo-ZfH.mjs → nested-writer-CqL24ojl.mjs} +1 -1
- package/dist/{nested-writer-DxPhmWFz.cjs → nested-writer-wk1EFUNY.cjs} +1 -1
- package/dist/ops.cjs +1 -1
- package/dist/ops.mjs +1 -1
- package/dist/rel.cjs +2 -2
- package/dist/rel.d.cts +1 -1
- package/dist/rel.d.mts +1 -1
- package/dist/rel.mjs +2 -2
- package/dist/{relation-loader-CUGcxJ18.mjs → relation-loader-B68R1LET.mjs} +1 -1
- package/dist/{relation-loader-C8GOpNYJ.cjs → relation-loader-BD4xANQJ.cjs} +1 -1
- package/dist/sync.cjs +1 -1
- package/dist/sync.d.cts +2 -2
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +1 -1
- package/dist/{validator-lkCJKuoo.cjs → validator-BtZbcLN2.cjs} +1 -1
- package/dist/{validator-wBARmD68.d.cts → validator-CewfnGZj.d.cts} +9 -2
- package/dist/{validator-wBARmD68.d.mts → validator-CewfnGZj.d.mts} +9 -2
- package/dist/{validator-CeD_fqyW.mjs → validator-Ch7UIQl9.mjs} +1 -1
- package/dist/validator.cjs +2 -2
- package/dist/validator.d.cts +1 -1
- package/dist/validator.d.mts +1 -1
- package/dist/validator.mjs +2 -2
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as CasMismatchError, r as DbError, t as CasExhaustedError } from "./db-error-
|
|
2
|
-
import { A as
|
|
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-
|
|
1
|
+
import { a as bucketTimeZoneUnavailable, n as CasMismatchError, r as DbError, t as CasExhaustedError } from "./db-error-D5uilS_A.mjs";
|
|
2
|
+
import { A as FieldMappingStrategy, B as NoopLogger, C as guardPaths, D as unsupportedOperatorMessage, E as sortFieldNames, F as isGeoPointType, I as isBucketableField, L as isJsonValueField, M as TableMetadata, N as findAncestorInSet, O as RelationalFieldMapper, P as isGeoIndexableType, R as jsonValueAncestor, S as guardPath, T as narrowerFilterOps, _ as checkHavingKeys, a as decomposePatch, b as guardAggregate, c as BaseDbAdapter, d as NativeIntegrity, f as AtscriptDbReadable, g as canFilterLeaf, h as assertGeoPoint, i as assertNoVersionWrites, j as UniquSelect, k as DocumentFieldMapper, l as createFailureCollector, m as acceptedOperatorsHint, n as isAtscriptDbView, o as ApplicationIntegrity, p as resolveDesignType, r as AtscriptDbTable, s as ALL_BUCKET_UNITS, t as AtscriptDbView, u as IntegrityStrategy, v as classifyQueryPath, w as guardQuery, x as guardFilter, y as collectQueryPaths, z as resolveCalendarBuckets } from "./db-view-DVGWWhA3.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-Ch7UIQl9.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
|
-
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
7
6
|
import { computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
|
|
7
|
+
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
8
8
|
//#region src/encryption.ts
|
|
9
9
|
const ENVELOPE_VERSION = "aes1";
|
|
10
10
|
const ALGORITHM = "aes-256-gcm";
|
|
@@ -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, 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 };
|
|
375
|
+
export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, ALL_BUCKET_UNITS, ApplicationIntegrity, AtscriptDbReadable, AtscriptDbTable, AtscriptDbView, BaseDbAdapter, CasExhaustedError, CasMismatchError, DEFAULT_DB_SPACE, DbEncryption, DbError, DbSpace, DocumentFieldMapper, FieldMappingStrategy, IntegrityStrategy, NativeIntegrity, NoopLogger, RelationalFieldMapper, TableMetadata, UniquSelect, acceptedOperatorsHint, assertGeoPoint, assertNoVersionWrites, bucketTimeZoneUnavailable, buildDbValidator, buildValidationContext, canFilterLeaf, checkHavingKeys, classifyQueryPath, collectQueryPaths, computeInsights, createDbValidatorPlugin, createFailureCollector, decomposePatch, findAncestorInSet, forceNavNonOptional, getDbFieldOp, getKeyProps, guardAggregate, guardFilter, guardPath, guardPaths, guardQuery, isAtscriptDbView, isBucketableField, isDbFieldOp, isEmptyObject, isGeoIndexableType, isGeoPointType, isJsonValueField, isNavRelation, isPlainObject, isPrimitive, jsonValueAncestor, narrowerFilterOps, reconcileCas, resolveCalendarBuckets, resolveDesignType, separateCas, separateFieldOps, sortFieldNames, translateQueryTree, unsupportedOperatorMessage, walkFilter, withOptimisticRetry };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DepthLimitExceededError, r as DbError } from "./db-error-
|
|
1
|
+
import { i as DepthLimitExceededError, r as DbError } from "./db-error-D5uilS_A.mjs";
|
|
2
2
|
import { ValidatorError } from "@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-
|
|
2
|
+
const require_db_error = require("./db-error-DTkkeu5b.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
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-
|
|
3
|
-
const require_relation_loader = require("./relation-loader-
|
|
2
|
+
const require_nested_writer = require("./nested-writer-wk1EFUNY.cjs");
|
|
3
|
+
const require_relation_loader = require("./relation-loader-BD4xANQJ.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;
|
package/dist/rel.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as TableMetadata, K as TDbRelation, Mt as BaseDbAdapter, R as TDbForeignKey, St as TWriteTableResolver, Vt as TGenericLogger, vt as TTableResolver } from "./buckets-BvoYYQ2Q.cjs";
|
|
2
2
|
import { t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.cjs";
|
|
3
3
|
import { FilterExpr, WithRelation } from "@uniqu/core";
|
|
4
4
|
import { Validator } from "@atscript/typescript/utils";
|
package/dist/rel.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as TableMetadata, K as TDbRelation, Mt as BaseDbAdapter, R as TDbForeignKey, St as TWriteTableResolver, Vt as TGenericLogger, vt as TTableResolver } from "./buckets-D2XPrwSC.mjs";
|
|
2
2
|
import { t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.mjs";
|
|
3
3
|
import { Validator } from "@atscript/typescript/utils";
|
|
4
4
|
import { FilterExpr, WithRelation } from "@uniqu/core";
|
package/dist/rel.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as loadRelationsImpl } from "./relation-loader-
|
|
2
|
-
import { _ as resolveRelationTargetTable, a as batchPatchNestedTo, c as batchReplaceNestedTo, d as preValidateNestedFrom, f as validateBatch, g as findRemoteFK, h as findFKForRelation, i as batchPatchNestedFrom, l as batchReplaceNestedVia, n as batchInsertNestedTo, o as batchPatchNestedVia, r as batchInsertNestedVia, s as batchReplaceNestedFrom, t as batchInsertNestedFrom, u as checkDepthOverflow } from "./nested-writer-
|
|
1
|
+
import { t as loadRelationsImpl } from "./relation-loader-B68R1LET.mjs";
|
|
2
|
+
import { _ as resolveRelationTargetTable, a as batchPatchNestedTo, c as batchReplaceNestedTo, d as preValidateNestedFrom, f as validateBatch, g as findRemoteFK, h as findFKForRelation, i as batchPatchNestedFrom, l as batchReplaceNestedVia, n as batchInsertNestedTo, o as batchPatchNestedVia, r as batchInsertNestedVia, s as batchReplaceNestedFrom, t as batchInsertNestedFrom, u as checkDepthOverflow } from "./nested-writer-CqL24ojl.mjs";
|
|
3
3
|
export { batchInsertNestedFrom, batchInsertNestedTo, batchInsertNestedVia, batchPatchNestedFrom, batchPatchNestedTo, batchPatchNestedVia, batchReplaceNestedFrom, batchReplaceNestedTo, batchReplaceNestedVia, checkDepthOverflow, findFKForRelation, findRemoteFK, loadRelationsImpl, preValidateNestedFrom, resolveRelationTargetTable, validateBatch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as resolveRelationTargetTable, g as findRemoteFK, h as findFKForRelation } from "./nested-writer-
|
|
1
|
+
import { _ as resolveRelationTargetTable, g as findRemoteFK, h as findFKForRelation } from "./nested-writer-CqL24ojl.mjs";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_nested_writer = require("./nested-writer-
|
|
1
|
+
const require_nested_writer = require("./nested-writer-wk1EFUNY.cjs");
|
|
2
2
|
//#region src/rel/relation-loader.ts
|
|
3
3
|
var relation_loader_exports = /* @__PURE__ */ require("./plugin.cjs").__exportAll({
|
|
4
4
|
ensureSelectIncludesFields: () => ensureSelectIncludesFields,
|
package/dist/sync.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_db_view = require("./db-view-
|
|
2
|
+
const require_db_view = require("./db-view-CuFAhzwF.cjs");
|
|
3
3
|
//#region src/schema/schema-hash.ts
|
|
4
4
|
/** Extracts sorted field snapshots from a readable's field descriptors. */
|
|
5
5
|
function extractFieldSnapshots(fields, typeMapper) {
|
package/dist/sync.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as AtscriptQueryFieldRef$1, i as AtscriptDbView, l as AtscriptQueryNode$1, t as DbSpace } from "./db-space-
|
|
1
|
+
import { E as TColumnDiff, F as TDbDefaultValue, L as TDbFieldMeta, Nt as AtscriptDbReadable, R as TDbForeignKey, Vt as TGenericLogger, W as TDbObjectKind, Y as TDbStorageType, _t as TTableOptionDiff, ft as TPrimaryKeyChange, it as TExistingTableOption, nt as TExistingColumn, pt as TReferencingForeignKey, rt as TExistingForeignKey, tt as TEnsureTableOptions } from "./buckets-BvoYYQ2Q.cjs";
|
|
2
|
+
import { c as AtscriptQueryFieldRef$1, i as AtscriptDbView, l as AtscriptQueryNode$1, t as DbSpace } from "./db-space-Cslq5Dux.cjs";
|
|
3
3
|
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
4
4
|
|
|
5
5
|
//#region src/schema/sync-entry.d.ts
|
package/dist/sync.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as AtscriptQueryFieldRef$1, i as AtscriptDbView, l as AtscriptQueryNode$1, t as DbSpace } from "./db-space-
|
|
1
|
+
import { E as TColumnDiff, F as TDbDefaultValue, L as TDbFieldMeta, Nt as AtscriptDbReadable, R as TDbForeignKey, Vt as TGenericLogger, W as TDbObjectKind, Y as TDbStorageType, _t as TTableOptionDiff, ft as TPrimaryKeyChange, it as TExistingTableOption, nt as TExistingColumn, pt as TReferencingForeignKey, rt as TExistingForeignKey, tt as TEnsureTableOptions } from "./buckets-D2XPrwSC.mjs";
|
|
2
|
+
import { c as AtscriptQueryFieldRef$1, i as AtscriptDbView, l as AtscriptQueryNode$1, t as DbSpace } from "./db-space-BQQEgB3d.mjs";
|
|
3
3
|
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
4
4
|
|
|
5
5
|
//#region src/schema/sync-entry.d.ts
|
package/dist/sync.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as NoopLogger } from "./db-view-DVGWWhA3.mjs";
|
|
2
2
|
//#region src/schema/schema-hash.ts
|
|
3
3
|
/** Extracts sorted field snapshots from a readable's field descriptors. */
|
|
4
4
|
function extractFieldSnapshots(fields, typeMapper) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_db_error = require("./db-error-
|
|
1
|
+
const require_db_error = require("./db-error-DTkkeu5b.cjs");
|
|
2
2
|
const require_ops = require("./ops.cjs");
|
|
3
3
|
let _atscript_typescript_utils = require("@atscript/typescript/utils");
|
|
4
4
|
//#region src/shared/object.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TAtscriptAnnotatedType, TAtscriptTypeArray, TAtscriptTypeObject, TValidatorPlugin, Validator } from "@atscript/typescript/utils";
|
|
2
2
|
|
|
3
3
|
//#region src/db-error.d.ts
|
|
4
|
-
type DbErrorCode = "CONFLICT" | "FK_VIOLATION" | "NOT_FOUND" | "CASCADE_CYCLE" | "INVALID_QUERY" | "DEPTH_EXCEEDED" | "VERSION_COLUMN_WRITE" | "CAS_EXHAUSTED" | "CAS_MISMATCH" | "ENC_CONFIG_MISSING" | "ENC_KEY_INVALID" | "ENC_NOT_ENCRYPTED" | "ENC_DECRYPT_FAILED" | "ENC_FIELD_FILTER" | "ENC_FIELD_SORT" | "ENC_FIELD_AGG" | "ENC_FIELD_PATCH_OP" | "GEO_INDEX_MISSING" | "GEO_NOT_SUPPORTED" | "FILTER_TYPE_MISMATCH" | "TX_WAIT_TIMEOUT";
|
|
4
|
+
type DbErrorCode = "CONFLICT" | "FK_VIOLATION" | "NOT_FOUND" | "CASCADE_CYCLE" | "INVALID_QUERY" | "DEPTH_EXCEEDED" | "VERSION_COLUMN_WRITE" | "CAS_EXHAUSTED" | "CAS_MISMATCH" | "ENC_CONFIG_MISSING" | "ENC_KEY_INVALID" | "ENC_NOT_ENCRYPTED" | "ENC_DECRYPT_FAILED" | "ENC_FIELD_FILTER" | "ENC_FIELD_SORT" | "ENC_FIELD_AGG" | "ENC_FIELD_PATCH_OP" | "GEO_INDEX_MISSING" | "GEO_NOT_SUPPORTED" | "FILTER_TYPE_MISMATCH" /** The adapter's `calendarBucketUnits()` lacks the requested unit (moost-db: 400). */ | "BUCKET_NOT_SUPPORTED" /** The engine cannot resolve the bucket's time zone — a store-configuration condition (moost-db: 501). */ | "BUCKET_TZ_UNAVAILABLE" | "TX_WAIT_TIMEOUT";
|
|
5
5
|
declare class DbError extends Error {
|
|
6
6
|
readonly code: DbErrorCode;
|
|
7
7
|
readonly errors: Array<{
|
|
@@ -45,6 +45,13 @@ declare class CasMismatchError extends DbError {
|
|
|
45
45
|
|
|
46
46
|
expected: number);
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The engine cannot resolve a calendar bucket's time zone (`BUCKET_TZ_UNAVAILABLE`,
|
|
50
|
+
* `path` `$select`; moost-db: 501). The zone already passed the core's IANA
|
|
51
|
+
* validation, so this is a store-configuration condition — an outdated or
|
|
52
|
+
* missing server time zone database — never a malformed query. Since 0.1.132.
|
|
53
|
+
*/
|
|
54
|
+
declare function bucketTimeZoneUnavailable(message: string): DbError;
|
|
48
55
|
//#endregion
|
|
49
56
|
//#region src/patch/patch-types.d.ts
|
|
50
57
|
interface TArrayPatch<A extends readonly unknown[]> {
|
|
@@ -141,4 +148,4 @@ interface ValidationContext {
|
|
|
141
148
|
*/
|
|
142
149
|
declare function buildValidationContext(type: TAtscriptAnnotatedType<TAtscriptTypeObject>): ValidationContext;
|
|
143
150
|
//#endregion
|
|
144
|
-
export { DbErrorCode as _, buildValidationContext as a, isNavRelation as c, TArrayPatch as d, TDbPatch as f, DbError as g, CasMismatchError as h, buildPatchPartial as i, isEmptyObject as l, CasExhaustedError as m, ValidatorMode as n, dbPlugin as o, getKeyProps as p, buildDbValidator as r, forceNavNonOptional as s, ValidationContext as t, isPlainObject as u };
|
|
151
|
+
export { DbErrorCode as _, buildValidationContext as a, isNavRelation as c, TArrayPatch as d, TDbPatch as f, DbError as g, CasMismatchError as h, buildPatchPartial as i, isEmptyObject as l, CasExhaustedError as m, ValidatorMode as n, dbPlugin as o, getKeyProps as p, buildDbValidator as r, forceNavNonOptional as s, ValidationContext as t, isPlainObject as u, bucketTimeZoneUnavailable as v };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TAtscriptAnnotatedType, TAtscriptTypeArray, TAtscriptTypeObject, TValidatorPlugin, Validator } from "@atscript/typescript/utils";
|
|
2
2
|
|
|
3
3
|
//#region src/db-error.d.ts
|
|
4
|
-
type DbErrorCode = "CONFLICT" | "FK_VIOLATION" | "NOT_FOUND" | "CASCADE_CYCLE" | "INVALID_QUERY" | "DEPTH_EXCEEDED" | "VERSION_COLUMN_WRITE" | "CAS_EXHAUSTED" | "CAS_MISMATCH" | "ENC_CONFIG_MISSING" | "ENC_KEY_INVALID" | "ENC_NOT_ENCRYPTED" | "ENC_DECRYPT_FAILED" | "ENC_FIELD_FILTER" | "ENC_FIELD_SORT" | "ENC_FIELD_AGG" | "ENC_FIELD_PATCH_OP" | "GEO_INDEX_MISSING" | "GEO_NOT_SUPPORTED" | "FILTER_TYPE_MISMATCH" | "TX_WAIT_TIMEOUT";
|
|
4
|
+
type DbErrorCode = "CONFLICT" | "FK_VIOLATION" | "NOT_FOUND" | "CASCADE_CYCLE" | "INVALID_QUERY" | "DEPTH_EXCEEDED" | "VERSION_COLUMN_WRITE" | "CAS_EXHAUSTED" | "CAS_MISMATCH" | "ENC_CONFIG_MISSING" | "ENC_KEY_INVALID" | "ENC_NOT_ENCRYPTED" | "ENC_DECRYPT_FAILED" | "ENC_FIELD_FILTER" | "ENC_FIELD_SORT" | "ENC_FIELD_AGG" | "ENC_FIELD_PATCH_OP" | "GEO_INDEX_MISSING" | "GEO_NOT_SUPPORTED" | "FILTER_TYPE_MISMATCH" /** The adapter's `calendarBucketUnits()` lacks the requested unit (moost-db: 400). */ | "BUCKET_NOT_SUPPORTED" /** The engine cannot resolve the bucket's time zone — a store-configuration condition (moost-db: 501). */ | "BUCKET_TZ_UNAVAILABLE" | "TX_WAIT_TIMEOUT";
|
|
5
5
|
declare class DbError extends Error {
|
|
6
6
|
readonly code: DbErrorCode;
|
|
7
7
|
readonly errors: Array<{
|
|
@@ -45,6 +45,13 @@ declare class CasMismatchError extends DbError {
|
|
|
45
45
|
|
|
46
46
|
expected: number);
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The engine cannot resolve a calendar bucket's time zone (`BUCKET_TZ_UNAVAILABLE`,
|
|
50
|
+
* `path` `$select`; moost-db: 501). The zone already passed the core's IANA
|
|
51
|
+
* validation, so this is a store-configuration condition — an outdated or
|
|
52
|
+
* missing server time zone database — never a malformed query. Since 0.1.132.
|
|
53
|
+
*/
|
|
54
|
+
declare function bucketTimeZoneUnavailable(message: string): DbError;
|
|
48
55
|
//#endregion
|
|
49
56
|
//#region src/patch/patch-types.d.ts
|
|
50
57
|
interface TArrayPatch<A extends readonly unknown[]> {
|
|
@@ -141,4 +148,4 @@ interface ValidationContext {
|
|
|
141
148
|
*/
|
|
142
149
|
declare function buildValidationContext(type: TAtscriptAnnotatedType<TAtscriptTypeObject>): ValidationContext;
|
|
143
150
|
//#endregion
|
|
144
|
-
export { DbErrorCode as _, buildValidationContext as a, isNavRelation as c, TArrayPatch as d, TDbPatch as f, DbError as g, CasMismatchError as h, buildPatchPartial as i, isEmptyObject as l, CasExhaustedError as m, ValidatorMode as n, dbPlugin as o, getKeyProps as p, buildDbValidator as r, forceNavNonOptional as s, ValidationContext as t, isPlainObject as u };
|
|
151
|
+
export { DbErrorCode as _, buildValidationContext as a, isNavRelation as c, TArrayPatch as d, TDbPatch as f, DbError as g, CasMismatchError as h, buildPatchPartial as i, isEmptyObject as l, CasExhaustedError as m, ValidatorMode as n, dbPlugin as o, getKeyProps as p, buildDbValidator as r, forceNavNonOptional as s, ValidationContext as t, isPlainObject as u, bucketTimeZoneUnavailable as v };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DepthLimitExceededError } from "./db-error-
|
|
1
|
+
import { i as DepthLimitExceededError } from "./db-error-D5uilS_A.mjs";
|
|
2
2
|
import { isDbFieldOp } from "./ops.mjs";
|
|
3
3
|
import { flattenAnnotatedType } from "@atscript/typescript/utils";
|
|
4
4
|
//#region src/shared/object.ts
|
package/dist/validator.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_db_error = require("./db-error-
|
|
3
|
-
const require_validator = require("./validator-
|
|
2
|
+
const require_db_error = require("./db-error-DTkkeu5b.cjs");
|
|
3
|
+
const require_validator = require("./validator-BtZbcLN2.cjs");
|
|
4
4
|
const require_ops = require("./ops.cjs");
|
|
5
5
|
exports.$cas = require_ops.$cas;
|
|
6
6
|
exports.$dec = require_ops.$dec;
|
package/dist/validator.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as $mul, c as $update, d as TDbFieldOp, g as separateCas, h as reconcileCas, i as $insert, l as $upsert, m as isDbFieldOp, n as $dec, o as $remove, r as $inc, s as $replace, t as $cas, u as TDbCas } from "./ops-AqhV7s9o.cjs";
|
|
2
|
-
import { a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbError, i as buildPatchPartial, l as isEmptyObject, n as ValidatorMode, o as dbPlugin, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-
|
|
2
|
+
import { a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbError, i as buildPatchPartial, l as isEmptyObject, n as ValidatorMode, o as dbPlugin, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-CewfnGZj.cjs";
|
|
3
3
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.cjs";
|
|
4
4
|
export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, DbError, type DbValidationContext, type TArrayPatch, type TDbCas, type TDbFieldOp, type TDbPatch, ValidationContext, ValidatorMode, buildDbValidator, buildPatchPartial, buildValidationContext, createDbValidatorPlugin, dbPlugin, forceNavNonOptional, getKeyProps, isDbFieldOp, isEmptyObject, isNavRelation, isPlainObject, reconcileCas, separateCas };
|
package/dist/validator.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as $mul, c as $update, d as TDbFieldOp, g as separateCas, h as reconcileCas, i as $insert, l as $upsert, m as isDbFieldOp, n as $dec, o as $remove, r as $inc, s as $replace, t as $cas, u as TDbCas } from "./ops-AqhV7s9o.mjs";
|
|
2
|
-
import { a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbError, i as buildPatchPartial, l as isEmptyObject, n as ValidatorMode, o as dbPlugin, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-
|
|
2
|
+
import { a as buildValidationContext, c as isNavRelation, d as TArrayPatch, f as TDbPatch, g as DbError, i as buildPatchPartial, l as isEmptyObject, n as ValidatorMode, o as dbPlugin, p as getKeyProps, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as isPlainObject } from "./validator-CewfnGZj.mjs";
|
|
3
3
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.mjs";
|
|
4
4
|
export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, DbError, type DbValidationContext, type TArrayPatch, type TDbCas, type TDbFieldOp, type TDbPatch, ValidationContext, ValidatorMode, buildDbValidator, buildPatchPartial, buildValidationContext, createDbValidatorPlugin, dbPlugin, forceNavNonOptional, getKeyProps, isDbFieldOp, isEmptyObject, isNavRelation, isPlainObject, reconcileCas, separateCas };
|
package/dist/validator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as DbError } from "./db-error-
|
|
2
|
-
import { a as forceNavNonOptional, c as getKeyProps, i as dbPlugin, l as isEmptyObject, n as buildPatchPartial, o as isNavRelation, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator, u as isPlainObject } from "./validator-
|
|
1
|
+
import { r as DbError } from "./db-error-D5uilS_A.mjs";
|
|
2
|
+
import { a as forceNavNonOptional, c as getKeyProps, i as dbPlugin, l as isEmptyObject, n as buildPatchPartial, o as isNavRelation, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator, u as isPlainObject } from "./validator-Ch7UIQl9.mjs";
|
|
3
3
|
import { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, isDbFieldOp, reconcileCas, separateCas } from "./ops.mjs";
|
|
4
4
|
export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, DbError, buildDbValidator, buildPatchPartial, buildValidationContext, createDbValidatorPlugin, dbPlugin, forceNavNonOptional, getKeyProps, isDbFieldOp, isEmptyObject, isNavRelation, isPlainObject, reconcileCas, separateCas };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.132",
|
|
4
4
|
"description": "Database adapter utilities for atscript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@atscript/core": "^0.1.92",
|
|
75
75
|
"@atscript/typescript": "^0.1.92",
|
|
76
|
-
"@uniqu/core": "^0.1.
|
|
76
|
+
"@uniqu/core": "^0.1.9",
|
|
77
77
|
"unplugin-atscript": "^0.1.92"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@atscript/core": "^0.1.92",
|
|
81
81
|
"@atscript/typescript": "^0.1.92",
|
|
82
|
-
"@uniqu/core": "^0.1.
|
|
82
|
+
"@uniqu/core": "^0.1.9"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"postinstall": "asc -f dts",
|