@atscript/db 0.1.134 → 0.1.135
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-BtlGeRfj.d.mts +43 -0
- package/dist/agg-CvXDGnKi.mjs +61 -0
- package/dist/agg-DKuf_v2L.d.cts +43 -0
- package/dist/agg-EcIbAFnJ.cjs +78 -0
- package/dist/agg.cjs +3 -33
- package/dist/agg.d.cts +3 -35
- package/dist/agg.d.mts +3 -35
- package/dist/agg.mjs +2 -34
- package/dist/{buckets-Bo2IcPZ_.d.cts → buckets-D6PBXKRJ.d.cts} +4 -3
- package/dist/{buckets-Bys2QXyk.d.mts → buckets-GruoVxH5.d.mts} +4 -3
- package/dist/{db-space-DtGx5HIC.d.cts → db-space-9CH5neN7.d.mts} +2 -2
- package/dist/{db-space-grfuZcPR.d.mts → db-space-BdtBNTeH.d.cts} +2 -2
- package/dist/{db-view-pgm2dHIo.cjs → db-view-Dm7MpUGB.cjs} +4 -2
- package/dist/{db-view-B64IpZ2j.mjs → db-view-Doh8vPg3.mjs} +4 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/rel.d.cts +1 -1
- package/dist/rel.d.mts +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/package.json +3 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AggregateControls, AggregateExpr as AggregateExpr$1, AggregateFn, AggregateFn as AggregateFn$1, AggregateQuery as AggregateQuery$1, AggregateResult, BucketExpr, BucketUnit as BucketUnit$1, CalendarBucketLabel, ComputedExpr, ResolvedBucket as ResolvedBucket$1, WeekStart, isAggregateExpr as isAggregateExpr$1, isBucketExpr as isBucketExpr$1, resolveAlias } from "@uniqu/core";
|
|
2
|
+
|
|
3
|
+
//#region src/query/aggregate-fns.d.ts
|
|
4
|
+
/** The aggregate functions atscript-db adapters implement — uniqu's set minus `countDistinct`. */
|
|
5
|
+
type TDbAggregateFn = Exclude<AggregateFn, "countDistinct">;
|
|
6
|
+
/**
|
|
7
|
+
* Throws `DbError` `INVALID_QUERY` (uniqu's wording) unless `fn` is in
|
|
8
|
+
* `SUPPORTED_AGGREGATE_FNS` — for adapters to re-assert before rendering.
|
|
9
|
+
*/
|
|
10
|
+
declare function assertAggregateFn(fn: unknown, path?: string): asserts fn is TDbAggregateFn;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/agg.d.ts
|
|
13
|
+
/** The text-search request a grouped query carries, once normalised. */
|
|
14
|
+
interface TAggregateSearch {
|
|
15
|
+
/** Non-empty, trimmed search term. */
|
|
16
|
+
text: string;
|
|
17
|
+
/** Named search index to target, when the caller picked one. */
|
|
18
|
+
indexName?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
22
|
+
*
|
|
23
|
+
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
24
|
+
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
25
|
+
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
26
|
+
* describe rows that matched. An adapter that silently ignored the term would
|
|
27
|
+
* report totals for rows the same search excludes from the leaf list.
|
|
28
|
+
*
|
|
29
|
+
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
30
|
+
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
31
|
+
* of a group; after `$group` there is no per-row score left to sort on.
|
|
32
|
+
* Grouped results order by `$sort` or not at all.
|
|
33
|
+
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
34
|
+
* rows; applying that before `$group` would silently truncate group counts.
|
|
35
|
+
*
|
|
36
|
+
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
37
|
+
* straight through to the plain grouped path.
|
|
38
|
+
*/
|
|
39
|
+
declare function resolveAggregateSearch(controls: {
|
|
40
|
+
[key: `$${string}`]: unknown;
|
|
41
|
+
} | undefined): TAggregateSearch | undefined;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { assertAggregateFn as _, AggregateResult as a, CalendarBucketLabel as c, WeekStart as d, isAggregateExpr$1 as f, TDbAggregateFn as g, resolveAlias as h, AggregateQuery$1 as i, ComputedExpr as l, resolveAggregateSearch as m, AggregateExpr$1 as n, BucketExpr as o, isBucketExpr$1 as p, AggregateFn$1 as r, BucketUnit$1 as s, AggregateControls as t, ResolvedBucket$1 as u };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { r as DbError } from "./db-error-D5uilS_A.mjs";
|
|
2
|
+
import { isAggregateExpr as isAggregateExpr$1, isBucketExpr as isBucketExpr$1, resolveAlias } from "@uniqu/core";
|
|
3
|
+
//#region src/query/aggregate-fns.ts
|
|
4
|
+
/**
|
|
5
|
+
* The only `$fn` names a `$select` aggregate may use (since 0.1.135). Any
|
|
6
|
+
* other name is rejected with `INVALID_QUERY` (HTTP 400 through moost-db)
|
|
7
|
+
* before a query reaches an adapter, so no adapter ever renders an unchecked
|
|
8
|
+
* function name into SQL or a pipeline.
|
|
9
|
+
*/
|
|
10
|
+
const SUPPORTED_AGGREGATE_FNS = [
|
|
11
|
+
"sum",
|
|
12
|
+
"count",
|
|
13
|
+
"avg",
|
|
14
|
+
"min",
|
|
15
|
+
"max"
|
|
16
|
+
];
|
|
17
|
+
const SUPPORTED_LIST = `${SUPPORTED_AGGREGATE_FNS.slice(0, -1).join(", ")} or ${SUPPORTED_AGGREGATE_FNS.at(-1)}`;
|
|
18
|
+
/**
|
|
19
|
+
* Throws `DbError` `INVALID_QUERY` (uniqu's wording) unless `fn` is in
|
|
20
|
+
* `SUPPORTED_AGGREGATE_FNS` — for adapters to re-assert before rendering.
|
|
21
|
+
*/
|
|
22
|
+
function assertAggregateFn(fn, path = "$select") {
|
|
23
|
+
if (!SUPPORTED_AGGREGATE_FNS.includes(fn)) throw new DbError("INVALID_QUERY", [{
|
|
24
|
+
path,
|
|
25
|
+
message: `Unknown aggregate function "${String(fn)}" — use ${SUPPORTED_LIST}`
|
|
26
|
+
}]);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/agg.ts
|
|
30
|
+
/**
|
|
31
|
+
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
32
|
+
*
|
|
33
|
+
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
34
|
+
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
35
|
+
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
36
|
+
* describe rows that matched. An adapter that silently ignored the term would
|
|
37
|
+
* report totals for rows the same search excludes from the leaf list.
|
|
38
|
+
*
|
|
39
|
+
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
40
|
+
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
41
|
+
* of a group; after `$group` there is no per-row score left to sort on.
|
|
42
|
+
* Grouped results order by `$sort` or not at all.
|
|
43
|
+
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
44
|
+
* rows; applying that before `$group` would silently truncate group counts.
|
|
45
|
+
*
|
|
46
|
+
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
47
|
+
* straight through to the plain grouped path.
|
|
48
|
+
*/
|
|
49
|
+
function resolveAggregateSearch(controls) {
|
|
50
|
+
const raw = controls?.$search;
|
|
51
|
+
if (typeof raw !== "string") return;
|
|
52
|
+
const text = raw.trim();
|
|
53
|
+
if (!text) return;
|
|
54
|
+
const index = controls?.$index;
|
|
55
|
+
return {
|
|
56
|
+
text,
|
|
57
|
+
indexName: typeof index === "string" && index ? index : void 0
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { SUPPORTED_AGGREGATE_FNS as a, resolveAlias as i, isBucketExpr$1 as n, assertAggregateFn as o, resolveAggregateSearch as r, isAggregateExpr$1 as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AggregateControls, AggregateExpr as AggregateExpr$1, AggregateFn, AggregateFn as AggregateFn$1, AggregateQuery as AggregateQuery$1, AggregateResult, BucketExpr, BucketUnit as BucketUnit$1, CalendarBucketLabel, ComputedExpr, ResolvedBucket as ResolvedBucket$1, WeekStart, isAggregateExpr, isBucketExpr, resolveAlias } from "@uniqu/core";
|
|
2
|
+
|
|
3
|
+
//#region src/query/aggregate-fns.d.ts
|
|
4
|
+
/** The aggregate functions atscript-db adapters implement — uniqu's set minus `countDistinct`. */
|
|
5
|
+
type TDbAggregateFn = Exclude<AggregateFn, "countDistinct">;
|
|
6
|
+
/**
|
|
7
|
+
* Throws `DbError` `INVALID_QUERY` (uniqu's wording) unless `fn` is in
|
|
8
|
+
* `SUPPORTED_AGGREGATE_FNS` — for adapters to re-assert before rendering.
|
|
9
|
+
*/
|
|
10
|
+
declare function assertAggregateFn(fn: unknown, path?: string): asserts fn is TDbAggregateFn;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/agg.d.ts
|
|
13
|
+
/** The text-search request a grouped query carries, once normalised. */
|
|
14
|
+
interface TAggregateSearch {
|
|
15
|
+
/** Non-empty, trimmed search term. */
|
|
16
|
+
text: string;
|
|
17
|
+
/** Named search index to target, when the caller picked one. */
|
|
18
|
+
indexName?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
22
|
+
*
|
|
23
|
+
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
24
|
+
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
25
|
+
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
26
|
+
* describe rows that matched. An adapter that silently ignored the term would
|
|
27
|
+
* report totals for rows the same search excludes from the leaf list.
|
|
28
|
+
*
|
|
29
|
+
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
30
|
+
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
31
|
+
* of a group; after `$group` there is no per-row score left to sort on.
|
|
32
|
+
* Grouped results order by `$sort` or not at all.
|
|
33
|
+
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
34
|
+
* rows; applying that before `$group` would silently truncate group counts.
|
|
35
|
+
*
|
|
36
|
+
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
37
|
+
* straight through to the plain grouped path.
|
|
38
|
+
*/
|
|
39
|
+
declare function resolveAggregateSearch(controls: {
|
|
40
|
+
[key: `$${string}`]: unknown;
|
|
41
|
+
} | undefined): TAggregateSearch | undefined;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { assertAggregateFn as _, AggregateResult as a, CalendarBucketLabel as c, WeekStart as d, isAggregateExpr as f, TDbAggregateFn as g, resolveAlias as h, AggregateQuery$1 as i, ComputedExpr as l, resolveAggregateSearch as m, AggregateExpr$1 as n, BucketExpr as o, isBucketExpr as p, AggregateFn$1 as r, BucketUnit$1 as s, AggregateControls as t, ResolvedBucket$1 as u };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const require_db_error = require("./db-error-DTkkeu5b.cjs");
|
|
2
|
+
require("@uniqu/core");
|
|
3
|
+
//#region src/query/aggregate-fns.ts
|
|
4
|
+
/**
|
|
5
|
+
* The only `$fn` names a `$select` aggregate may use (since 0.1.135). Any
|
|
6
|
+
* other name is rejected with `INVALID_QUERY` (HTTP 400 through moost-db)
|
|
7
|
+
* before a query reaches an adapter, so no adapter ever renders an unchecked
|
|
8
|
+
* function name into SQL or a pipeline.
|
|
9
|
+
*/
|
|
10
|
+
const SUPPORTED_AGGREGATE_FNS = [
|
|
11
|
+
"sum",
|
|
12
|
+
"count",
|
|
13
|
+
"avg",
|
|
14
|
+
"min",
|
|
15
|
+
"max"
|
|
16
|
+
];
|
|
17
|
+
const SUPPORTED_LIST = `${SUPPORTED_AGGREGATE_FNS.slice(0, -1).join(", ")} or ${SUPPORTED_AGGREGATE_FNS.at(-1)}`;
|
|
18
|
+
/**
|
|
19
|
+
* Throws `DbError` `INVALID_QUERY` (uniqu's wording) unless `fn` is in
|
|
20
|
+
* `SUPPORTED_AGGREGATE_FNS` — for adapters to re-assert before rendering.
|
|
21
|
+
*/
|
|
22
|
+
function assertAggregateFn(fn, path = "$select") {
|
|
23
|
+
if (!SUPPORTED_AGGREGATE_FNS.includes(fn)) throw new require_db_error.DbError("INVALID_QUERY", [{
|
|
24
|
+
path,
|
|
25
|
+
message: `Unknown aggregate function "${String(fn)}" — use ${SUPPORTED_LIST}`
|
|
26
|
+
}]);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/agg.ts
|
|
30
|
+
/**
|
|
31
|
+
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
32
|
+
*
|
|
33
|
+
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
34
|
+
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
35
|
+
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
36
|
+
* describe rows that matched. An adapter that silently ignored the term would
|
|
37
|
+
* report totals for rows the same search excludes from the leaf list.
|
|
38
|
+
*
|
|
39
|
+
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
40
|
+
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
41
|
+
* of a group; after `$group` there is no per-row score left to sort on.
|
|
42
|
+
* Grouped results order by `$sort` or not at all.
|
|
43
|
+
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
44
|
+
* rows; applying that before `$group` would silently truncate group counts.
|
|
45
|
+
*
|
|
46
|
+
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
47
|
+
* straight through to the plain grouped path.
|
|
48
|
+
*/
|
|
49
|
+
function resolveAggregateSearch(controls) {
|
|
50
|
+
const raw = controls?.$search;
|
|
51
|
+
if (typeof raw !== "string") return;
|
|
52
|
+
const text = raw.trim();
|
|
53
|
+
if (!text) return;
|
|
54
|
+
const index = controls?.$index;
|
|
55
|
+
return {
|
|
56
|
+
text,
|
|
57
|
+
indexName: typeof index === "string" && index ? index : void 0
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
Object.defineProperty(exports, "SUPPORTED_AGGREGATE_FNS", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function() {
|
|
64
|
+
return SUPPORTED_AGGREGATE_FNS;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(exports, "assertAggregateFn", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function() {
|
|
70
|
+
return assertAggregateFn;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "resolveAggregateSearch", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function() {
|
|
76
|
+
return resolveAggregateSearch;
|
|
77
|
+
}
|
|
78
|
+
});
|
package/dist/agg.cjs
CHANGED
|
@@ -1,37 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_agg = require("./agg-EcIbAFnJ.cjs");
|
|
2
3
|
let _uniqu_core = require("@uniqu/core");
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
6
|
-
*
|
|
7
|
-
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
8
|
-
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
9
|
-
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
10
|
-
* describe rows that matched. An adapter that silently ignored the term would
|
|
11
|
-
* report totals for rows the same search excludes from the leaf list.
|
|
12
|
-
*
|
|
13
|
-
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
14
|
-
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
15
|
-
* of a group; after `$group` there is no per-row score left to sort on.
|
|
16
|
-
* Grouped results order by `$sort` or not at all.
|
|
17
|
-
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
18
|
-
* rows; applying that before `$group` would silently truncate group counts.
|
|
19
|
-
*
|
|
20
|
-
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
21
|
-
* straight through to the plain grouped path.
|
|
22
|
-
*/
|
|
23
|
-
function resolveAggregateSearch(controls) {
|
|
24
|
-
const raw = controls?.$search;
|
|
25
|
-
if (typeof raw !== "string") return;
|
|
26
|
-
const text = raw.trim();
|
|
27
|
-
if (!text) return;
|
|
28
|
-
const index = controls?.$index;
|
|
29
|
-
return {
|
|
30
|
-
text,
|
|
31
|
-
indexName: typeof index === "string" && index ? index : void 0
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
4
|
+
exports.assertAggregateFn = require_agg.assertAggregateFn;
|
|
35
5
|
Object.defineProperty(exports, "isAggregateExpr", {
|
|
36
6
|
enumerable: true,
|
|
37
7
|
get: function() {
|
|
@@ -44,7 +14,7 @@ Object.defineProperty(exports, "isBucketExpr", {
|
|
|
44
14
|
return _uniqu_core.isBucketExpr;
|
|
45
15
|
}
|
|
46
16
|
});
|
|
47
|
-
exports.resolveAggregateSearch = resolveAggregateSearch;
|
|
17
|
+
exports.resolveAggregateSearch = require_agg.resolveAggregateSearch;
|
|
48
18
|
Object.defineProperty(exports, "resolveAlias", {
|
|
49
19
|
enumerable: true,
|
|
50
20
|
get: function() {
|
package/dist/agg.d.cts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
import { n as TResolvedBucket } from "./buckets-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/agg.d.ts
|
|
5
|
-
/** The text-search request a grouped query carries, once normalised. */
|
|
6
|
-
interface TAggregateSearch {
|
|
7
|
-
/** Non-empty, trimmed search term. */
|
|
8
|
-
text: string;
|
|
9
|
-
/** Named search index to target, when the caller picked one. */
|
|
10
|
-
indexName?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
14
|
-
*
|
|
15
|
-
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
16
|
-
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
17
|
-
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
18
|
-
* describe rows that matched. An adapter that silently ignored the term would
|
|
19
|
-
* report totals for rows the same search excludes from the leaf list.
|
|
20
|
-
*
|
|
21
|
-
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
22
|
-
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
23
|
-
* of a group; after `$group` there is no per-row score left to sort on.
|
|
24
|
-
* Grouped results order by `$sort` or not at all.
|
|
25
|
-
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
26
|
-
* rows; applying that before `$group` would silently truncate group counts.
|
|
27
|
-
*
|
|
28
|
-
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
29
|
-
* straight through to the plain grouped path.
|
|
30
|
-
*/
|
|
31
|
-
declare function resolveAggregateSearch(controls: {
|
|
32
|
-
[key: `$${string}`]: unknown;
|
|
33
|
-
} | undefined): TAggregateSearch | undefined;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, type BucketExpr, type BucketUnit, type CalendarBucketLabel, type ComputedExpr, type ResolvedBucket, type TResolvedBucket, type WeekStart, isAggregateExpr, isBucketExpr, resolveAggregateSearch, resolveAlias };
|
|
1
|
+
import { n as TResolvedBucket } from "./buckets-D6PBXKRJ.cjs";
|
|
2
|
+
import { _ as assertAggregateFn, a as AggregateResult, c as CalendarBucketLabel, d as WeekStart, f as isAggregateExpr, g as TDbAggregateFn, h as resolveAlias, i as AggregateQuery, l as ComputedExpr, m as resolveAggregateSearch, n as AggregateExpr, o as BucketExpr, p as isBucketExpr, r as AggregateFn, s as BucketUnit, t as AggregateControls, u as ResolvedBucket } from "./agg-DKuf_v2L.cjs";
|
|
3
|
+
export { type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, type BucketExpr, type BucketUnit, type CalendarBucketLabel, type ComputedExpr, type ResolvedBucket, type TDbAggregateFn, type TResolvedBucket, type WeekStart, assertAggregateFn, isAggregateExpr, isBucketExpr, resolveAggregateSearch, resolveAlias };
|
package/dist/agg.d.mts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
import { n as TResolvedBucket } from "./buckets-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/agg.d.ts
|
|
5
|
-
/** The text-search request a grouped query carries, once normalised. */
|
|
6
|
-
interface TAggregateSearch {
|
|
7
|
-
/** Non-empty, trimmed search term. */
|
|
8
|
-
text: string;
|
|
9
|
-
/** Named search index to target, when the caller picked one. */
|
|
10
|
-
indexName?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
14
|
-
*
|
|
15
|
-
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
16
|
-
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
17
|
-
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
18
|
-
* describe rows that matched. An adapter that silently ignored the term would
|
|
19
|
-
* report totals for rows the same search excludes from the leaf list.
|
|
20
|
-
*
|
|
21
|
-
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
22
|
-
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
23
|
-
* of a group; after `$group` there is no per-row score left to sort on.
|
|
24
|
-
* Grouped results order by `$sort` or not at all.
|
|
25
|
-
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
26
|
-
* rows; applying that before `$group` would silently truncate group counts.
|
|
27
|
-
*
|
|
28
|
-
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
29
|
-
* straight through to the plain grouped path.
|
|
30
|
-
*/
|
|
31
|
-
declare function resolveAggregateSearch(controls: {
|
|
32
|
-
[key: `$${string}`]: unknown;
|
|
33
|
-
} | undefined): TAggregateSearch | undefined;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, type BucketExpr, type BucketUnit, type CalendarBucketLabel, type ComputedExpr, type ResolvedBucket, type TResolvedBucket, type WeekStart, isAggregateExpr, isBucketExpr, resolveAggregateSearch, resolveAlias };
|
|
1
|
+
import { n as TResolvedBucket } from "./buckets-GruoVxH5.mjs";
|
|
2
|
+
import { _ as assertAggregateFn, a as AggregateResult, c as CalendarBucketLabel, d as WeekStart, f as isAggregateExpr, g as TDbAggregateFn, h as resolveAlias, i as AggregateQuery, l as ComputedExpr, m as resolveAggregateSearch, n as AggregateExpr, o as BucketExpr, p as isBucketExpr, r as AggregateFn, s as BucketUnit, t as AggregateControls, u as ResolvedBucket } from "./agg-BtlGeRfj.mjs";
|
|
3
|
+
export { type AggregateControls, type AggregateExpr, type AggregateFn, type AggregateQuery, type AggregateResult, type BucketExpr, type BucketUnit, type CalendarBucketLabel, type ComputedExpr, type ResolvedBucket, type TDbAggregateFn, type TResolvedBucket, type WeekStart, assertAggregateFn, isAggregateExpr, isBucketExpr, resolveAggregateSearch, resolveAlias };
|
package/dist/agg.mjs
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reads the `$search` / `$index` controls of an aggregate query.
|
|
5
|
-
*
|
|
6
|
-
* Search and grouping are orthogonal: `$search` narrows the ROWS, `$groupBy`
|
|
7
|
-
* shapes what is left. Every adapter must therefore apply the search predicate
|
|
8
|
-
* BEFORE grouping, so the groups — and `$count`, which counts them — only ever
|
|
9
|
-
* describe rows that matched. An adapter that silently ignored the term would
|
|
10
|
-
* report totals for rows the same search excludes from the leaf list.
|
|
11
|
-
*
|
|
12
|
-
* Two rules the leaf search path applies and the grouped path must NOT:
|
|
13
|
-
* - **No implicit relevance ordering.** Relevance is a property of a row, not
|
|
14
|
-
* of a group; after `$group` there is no per-row score left to sort on.
|
|
15
|
-
* Grouped results order by `$sort` or not at all.
|
|
16
|
-
* - **No implicit row cap.** The leaf runners cap an unbounded search at 1000
|
|
17
|
-
* rows; applying that before `$group` would silently truncate group counts.
|
|
18
|
-
*
|
|
19
|
-
* Returns `undefined` when there is nothing to search for, so callers fall
|
|
20
|
-
* straight through to the plain grouped path.
|
|
21
|
-
*/
|
|
22
|
-
function resolveAggregateSearch(controls) {
|
|
23
|
-
const raw = controls?.$search;
|
|
24
|
-
if (typeof raw !== "string") return;
|
|
25
|
-
const text = raw.trim();
|
|
26
|
-
if (!text) return;
|
|
27
|
-
const index = controls?.$index;
|
|
28
|
-
return {
|
|
29
|
-
text,
|
|
30
|
-
indexName: typeof index === "string" && index ? index : void 0
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { isAggregateExpr, isBucketExpr, resolveAggregateSearch, resolveAlias };
|
|
1
|
+
import { i as resolveAlias, n as isBucketExpr, o as assertAggregateFn, r as resolveAggregateSearch, t as isAggregateExpr } from "./agg-CvXDGnKi.mjs";
|
|
2
|
+
export { assertAggregateFn, isAggregateExpr, isBucketExpr, resolveAggregateSearch, resolveAlias };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as TFieldOps } from "./ops-AqhV7s9o.cjs";
|
|
2
|
-
import { AggregateControls, AggregateExpr, AggregateExpr as AggregateExpr$1, AggregateFn, AggregateQuery, AggregateQuery as AggregateQuery$1, AggregateResult, BucketUnit, FieldOpsFor, FilterExpr, FilterExpr as FilterExpr$1, ResolvedBucket, TypedWithRelation, Uniquery, Uniquery as Uniquery$1, UniqueryControls, UniqueryControls as UniqueryControls$1, UniqueryInsights, WithRelation, WithRelation as WithRelation$1 } from "@uniqu/core";
|
|
2
|
+
import { AggregateControls, AggregateExpr, AggregateExpr as AggregateExpr$1, AggregateFn as AggregateFn$1, AggregateQuery, AggregateQuery as AggregateQuery$1, AggregateResult, BucketUnit, FieldOpsFor, FilterExpr, FilterExpr as FilterExpr$1, ResolvedBucket, TypedWithRelation, Uniquery, Uniquery as Uniquery$1, UniqueryControls, UniqueryControls as UniqueryControls$1, UniqueryInsights, WithRelation, WithRelation as WithRelation$1 } from "@uniqu/core";
|
|
3
3
|
import { FlatOf, FlatOf as FlatOf$1, NavPropsOf, NavPropsOf as NavPropsOf$1, OwnPropsOf, OwnPropsOf as OwnPropsOf$1, PrimaryKeyOf, PrimaryKeyOf as PrimaryKeyOf$1, TAtscriptAnnotatedType, TAtscriptDataType, TAtscriptTypeObject, TMetadataMap, TSerializedAnnotatedType, TValidatorOptions, TValidatorPlugin, Validator } from "@atscript/typescript/utils";
|
|
4
4
|
|
|
5
5
|
//#region src/query/uniqu-select.d.ts
|
|
@@ -2223,7 +2223,8 @@ interface TBucketFieldSource {
|
|
|
2223
2223
|
* appear in $groupBy", string `$groupBy` entries) with the table's names as
|
|
2224
2224
|
* the collision set: a bucket alias may not equal a logical path, a physical
|
|
2225
2225
|
* column or a navigation field, so a label is never reverse-mapped as a
|
|
2226
|
-
* column.
|
|
2226
|
+
* column. Aggregate entries are checked against `SUPPORTED_AGGREGATE_FNS`
|
|
2227
|
+
* (and `'*'` is `count`'s only).
|
|
2227
2228
|
*
|
|
2228
2229
|
* Which layer validates what:
|
|
2229
2230
|
* - **Shapes** (this normalizer) run FIRST at every entry point — the core's
|
|
@@ -2274,4 +2275,4 @@ declare function isJsonValueField(fd: TDbFieldMeta): boolean;
|
|
|
2274
2275
|
*/
|
|
2275
2276
|
declare function jsonValueAncestor(path: string, jsonValueParents: ReadonlySet<string>): string | undefined;
|
|
2276
2277
|
//#endregion
|
|
2277
|
-
export { TDbWriteGuardContext as $, TDbActionIntent as A, isGeoIndexableType as At, TDbIndexField as B, FieldMappingStrategy as Bt, PrimaryKeyOf$1 as C, TWriteTableResolver as Ct, TCrudOp as D, WithRelation$1 as Dt, TColumnDiff as E, UniqueryControls$1 as Et, TDbDefaultValue as F, DbResponse as Ft, TDbReferentialAction as G, TDbInsertManyResult as H, TGenericLogger as Ht, TDbDeleteResult as I, resolveDesignType as It, TDbRemoveGuardContext as J, TDbRelation as K, TDbFieldMeta as L, DbEncryption as Lt, TDbActionProcessor as M, ALL_BUCKET_UNITS as Mt, TDbCollation as N, BaseDbAdapter as Nt, TCrudPermissions as O, TableMetadata as Ot, TDbDefaultFn as P, AtscriptDbReadable as Pt, TDbWriteGuard as Q, TDbForeignKey as R, TDbEncryptionOptions as Rt, OwnPropsOf$1 as S, TWriteOptions as St, TCascadeTarget as T, Uniquery$1 as Tt, TDbInsertResult as U, UniquSelect as Ut, TDbIndexType as V, NoopLogger as Vt, TDbObjectKind as W, TDbUpdateResult as X, TDbStorageType as Y, TDbWriteAction as Z, FieldOpsFor as _, TSyncColumnResult as _t, jsonValueAncestor as a, TFieldMeta as at, NavPropsOf$1 as b, TTouchManyOptions as bt, AggregateExpr$1 as c, TIdDescriptor as ct, AggregateResult as d, TMetaResponse as dt, TDeleteOptions as et, AtscriptDbWritable as f, TMetadataOverrides as ft, DbRow as g, TSearchIndexInfo as gt, DbQuery as h, TRelationInfo as ht, isJsonValueField as i, TExistingTableOption as it, TDbActionLevel as j, isGeoPointType as jt, TDbActionInfo as k, findAncestorInSet as kt, AggregateFn as l, TIdResolveOptions as lt, DbPatch as m, TReferencingForeignKey as mt, TResolvedBucket as n, TExistingColumn as nt, resolveCalendarBuckets as o, TFkLookupResolver as ot, DbControls as p, TPrimaryKeyChange as pt, TDbRemoveGuard as q, isBucketableField as r, TExistingForeignKey as rt, AggregateControls as s, TFkLookupTarget as st, TBucketFieldSource as t, TEnsureTableOptions as tt, AggregateQuery$1 as u, TIdentification as ut, FilterExpr$1 as v, TTableOptionDiff as vt, TCascadeResolver as w, TypedWithRelation as wt, NullableOptional as x, TValueFormatterPair as xt, FlatOf$1 as y, TTableResolver as yt, TDbIndex as z, DocumentFieldMapper as zt };
|
|
2278
|
+
export { TDbWriteGuardContext as $, TDbActionIntent as A, isGeoIndexableType as At, TDbIndexField as B, FieldMappingStrategy as Bt, PrimaryKeyOf$1 as C, TWriteTableResolver as Ct, TCrudOp as D, WithRelation$1 as Dt, TColumnDiff as E, UniqueryControls$1 as Et, TDbDefaultValue as F, DbResponse as Ft, TDbReferentialAction as G, TDbInsertManyResult as H, TGenericLogger as Ht, TDbDeleteResult as I, resolveDesignType as It, TDbRemoveGuardContext as J, TDbRelation as K, TDbFieldMeta as L, DbEncryption as Lt, TDbActionProcessor as M, ALL_BUCKET_UNITS as Mt, TDbCollation as N, BaseDbAdapter as Nt, TCrudPermissions as O, TableMetadata as Ot, TDbDefaultFn as P, AtscriptDbReadable as Pt, TDbWriteGuard as Q, TDbForeignKey as R, TDbEncryptionOptions as Rt, OwnPropsOf$1 as S, TWriteOptions as St, TCascadeTarget as T, Uniquery$1 as Tt, TDbInsertResult as U, UniquSelect as Ut, TDbIndexType as V, NoopLogger as Vt, TDbObjectKind as W, TDbUpdateResult as X, TDbStorageType as Y, TDbWriteAction as Z, FieldOpsFor as _, TSyncColumnResult as _t, jsonValueAncestor as a, TFieldMeta as at, NavPropsOf$1 as b, TTouchManyOptions as bt, AggregateExpr$1 as c, TIdDescriptor as ct, AggregateResult as d, TMetaResponse as dt, TDeleteOptions as et, AtscriptDbWritable as f, TMetadataOverrides as ft, DbRow as g, TSearchIndexInfo as gt, DbQuery as h, TRelationInfo as ht, isJsonValueField as i, TExistingTableOption as it, TDbActionLevel as j, isGeoPointType as jt, TDbActionInfo as k, findAncestorInSet as kt, AggregateFn$1 as l, TIdResolveOptions as lt, DbPatch as m, TReferencingForeignKey as mt, TResolvedBucket as n, TExistingColumn as nt, resolveCalendarBuckets as o, TFkLookupResolver as ot, DbControls as p, TPrimaryKeyChange as pt, TDbRemoveGuard as q, isBucketableField as r, TExistingForeignKey as rt, AggregateControls as s, TFkLookupTarget as st, TBucketFieldSource as t, TEnsureTableOptions as tt, AggregateQuery$1 as u, TIdentification as ut, FilterExpr$1 as v, TTableOptionDiff as vt, TCascadeResolver as w, TypedWithRelation as wt, NullableOptional as x, TValueFormatterPair as xt, FlatOf$1 as y, TTableResolver as yt, TDbIndex as z, DocumentFieldMapper as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as TFieldOps } from "./ops-AqhV7s9o.mjs";
|
|
2
2
|
import { FlatOf, FlatOf as FlatOf$1, NavPropsOf, NavPropsOf as NavPropsOf$1, OwnPropsOf, OwnPropsOf as OwnPropsOf$1, PrimaryKeyOf, PrimaryKeyOf as PrimaryKeyOf$1, TAtscriptAnnotatedType, TAtscriptDataType, TAtscriptTypeObject, TMetadataMap, TSerializedAnnotatedType, TValidatorOptions, TValidatorPlugin, Validator } from "@atscript/typescript/utils";
|
|
3
|
-
import { AggregateControls, AggregateExpr, AggregateExpr as AggregateExpr$1, AggregateFn, AggregateQuery, AggregateQuery as AggregateQuery$1, AggregateResult, BucketUnit, FieldOpsFor, FilterExpr, FilterExpr as FilterExpr$1, ResolvedBucket, TypedWithRelation, Uniquery, Uniquery as Uniquery$1, UniqueryControls, UniqueryControls as UniqueryControls$1, UniqueryInsights, WithRelation, WithRelation as WithRelation$1 } from "@uniqu/core";
|
|
3
|
+
import { AggregateControls, AggregateExpr, AggregateExpr as AggregateExpr$1, AggregateFn as AggregateFn$1, AggregateQuery, AggregateQuery as AggregateQuery$1, AggregateResult, BucketUnit, FieldOpsFor, FilterExpr, FilterExpr as FilterExpr$1, ResolvedBucket, TypedWithRelation, Uniquery, Uniquery as Uniquery$1, UniqueryControls, UniqueryControls as UniqueryControls$1, UniqueryInsights, WithRelation, WithRelation as WithRelation$1 } from "@uniqu/core";
|
|
4
4
|
|
|
5
5
|
//#region src/query/uniqu-select.d.ts
|
|
6
6
|
/**
|
|
@@ -2223,7 +2223,8 @@ interface TBucketFieldSource {
|
|
|
2223
2223
|
* appear in $groupBy", string `$groupBy` entries) with the table's names as
|
|
2224
2224
|
* the collision set: a bucket alias may not equal a logical path, a physical
|
|
2225
2225
|
* column or a navigation field, so a label is never reverse-mapped as a
|
|
2226
|
-
* column.
|
|
2226
|
+
* column. Aggregate entries are checked against `SUPPORTED_AGGREGATE_FNS`
|
|
2227
|
+
* (and `'*'` is `count`'s only).
|
|
2227
2228
|
*
|
|
2228
2229
|
* Which layer validates what:
|
|
2229
2230
|
* - **Shapes** (this normalizer) run FIRST at every entry point — the core's
|
|
@@ -2274,4 +2275,4 @@ declare function isJsonValueField(fd: TDbFieldMeta): boolean;
|
|
|
2274
2275
|
*/
|
|
2275
2276
|
declare function jsonValueAncestor(path: string, jsonValueParents: ReadonlySet<string>): string | undefined;
|
|
2276
2277
|
//#endregion
|
|
2277
|
-
export { TDbWriteGuardContext as $, TDbActionIntent as A, isGeoIndexableType as At, TDbIndexField as B, FieldMappingStrategy as Bt, PrimaryKeyOf$1 as C, TWriteTableResolver as Ct, TCrudOp as D, WithRelation$1 as Dt, TColumnDiff as E, UniqueryControls$1 as Et, TDbDefaultValue as F, DbResponse as Ft, TDbReferentialAction as G, TDbInsertManyResult as H, TGenericLogger as Ht, TDbDeleteResult as I, resolveDesignType as It, TDbRemoveGuardContext as J, TDbRelation as K, TDbFieldMeta as L, DbEncryption as Lt, TDbActionProcessor as M, ALL_BUCKET_UNITS as Mt, TDbCollation as N, BaseDbAdapter as Nt, TCrudPermissions as O, TableMetadata as Ot, TDbDefaultFn as P, AtscriptDbReadable as Pt, TDbWriteGuard as Q, TDbForeignKey as R, TDbEncryptionOptions as Rt, OwnPropsOf$1 as S, TWriteOptions as St, TCascadeTarget as T, Uniquery$1 as Tt, TDbInsertResult as U, UniquSelect as Ut, TDbIndexType as V, NoopLogger as Vt, TDbObjectKind as W, TDbUpdateResult as X, TDbStorageType as Y, TDbWriteAction as Z, FieldOpsFor as _, TSyncColumnResult as _t, jsonValueAncestor as a, TFieldMeta as at, NavPropsOf$1 as b, TTouchManyOptions as bt, AggregateExpr$1 as c, TIdDescriptor as ct, AggregateResult as d, TMetaResponse as dt, TDeleteOptions as et, AtscriptDbWritable as f, TMetadataOverrides as ft, DbRow as g, TSearchIndexInfo as gt, DbQuery as h, TRelationInfo as ht, isJsonValueField as i, TExistingTableOption as it, TDbActionLevel as j, isGeoPointType as jt, TDbActionInfo as k, findAncestorInSet as kt, AggregateFn as l, TIdResolveOptions as lt, DbPatch as m, TReferencingForeignKey as mt, TResolvedBucket as n, TExistingColumn as nt, resolveCalendarBuckets as o, TFkLookupResolver as ot, DbControls as p, TPrimaryKeyChange as pt, TDbRemoveGuard as q, isBucketableField as r, TExistingForeignKey as rt, AggregateControls as s, TFkLookupTarget as st, TBucketFieldSource as t, TEnsureTableOptions as tt, AggregateQuery$1 as u, TIdentification as ut, FilterExpr$1 as v, TTableOptionDiff as vt, TCascadeResolver as w, TypedWithRelation as wt, NullableOptional as x, TValueFormatterPair as xt, FlatOf$1 as y, TTableResolver as yt, TDbIndex as z, DocumentFieldMapper as zt };
|
|
2278
|
+
export { TDbWriteGuardContext as $, TDbActionIntent as A, isGeoIndexableType as At, TDbIndexField as B, FieldMappingStrategy as Bt, PrimaryKeyOf$1 as C, TWriteTableResolver as Ct, TCrudOp as D, WithRelation$1 as Dt, TColumnDiff as E, UniqueryControls$1 as Et, TDbDefaultValue as F, DbResponse as Ft, TDbReferentialAction as G, TDbInsertManyResult as H, TGenericLogger as Ht, TDbDeleteResult as I, resolveDesignType as It, TDbRemoveGuardContext as J, TDbRelation as K, TDbFieldMeta as L, DbEncryption as Lt, TDbActionProcessor as M, ALL_BUCKET_UNITS as Mt, TDbCollation as N, BaseDbAdapter as Nt, TCrudPermissions as O, TableMetadata as Ot, TDbDefaultFn as P, AtscriptDbReadable as Pt, TDbWriteGuard as Q, TDbForeignKey as R, TDbEncryptionOptions as Rt, OwnPropsOf$1 as S, TWriteOptions as St, TCascadeTarget as T, Uniquery$1 as Tt, TDbInsertResult as U, UniquSelect as Ut, TDbIndexType as V, NoopLogger as Vt, TDbObjectKind as W, TDbUpdateResult as X, TDbStorageType as Y, TDbWriteAction as Z, FieldOpsFor as _, TSyncColumnResult as _t, jsonValueAncestor as a, TFieldMeta as at, NavPropsOf$1 as b, TTouchManyOptions as bt, AggregateExpr$1 as c, TIdDescriptor as ct, AggregateResult as d, TMetaResponse as dt, TDeleteOptions as et, AtscriptDbWritable as f, TMetadataOverrides as ft, DbRow as g, TSearchIndexInfo as gt, DbQuery as h, TRelationInfo as ht, isJsonValueField as i, TExistingTableOption as it, TDbActionLevel as j, isGeoPointType as jt, TDbActionInfo as k, findAncestorInSet as kt, AggregateFn$1 as l, TIdResolveOptions as lt, DbPatch as m, TReferencingForeignKey as mt, TResolvedBucket as n, TExistingColumn as nt, resolveCalendarBuckets as o, TFkLookupResolver as ot, DbControls as p, TPrimaryKeyChange as pt, TDbRemoveGuard as q, isBucketableField as r, TExistingForeignKey as rt, AggregateControls as s, TFkLookupTarget as st, TBucketFieldSource as t, TEnsureTableOptions as tt, AggregateQuery$1 as u, TIdentification as ut, FilterExpr$1 as v, TTableOptionDiff as vt, TCascadeResolver as w, TypedWithRelation as wt, NullableOptional as x, TValueFormatterPair as xt, FlatOf$1 as y, TTableResolver as yt, TDbIndex as z, DocumentFieldMapper as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ct as TWriteTableResolver, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, Lt as DbEncryption, Nt as BaseDbAdapter, Ot as TableMetadata, Pt as AtscriptDbReadable, Rt as TDbEncryptionOptions, St as TWriteOptions, U as TDbInsertResult, X as TDbUpdateResult, bt as TTouchManyOptions, et as TDeleteOptions, g as DbRow, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, ot as TFkLookupResolver, w as TCascadeResolver, x as NullableOptional, yt as TTableResolver } from "./buckets-
|
|
2
|
-
import { FilterExpr } from "@uniqu/core";
|
|
1
|
+
import { Ct as TWriteTableResolver, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, Lt as DbEncryption, Nt as BaseDbAdapter, Ot as TableMetadata, Pt as AtscriptDbReadable, Rt as TDbEncryptionOptions, St as TWriteOptions, U as TDbInsertResult, X as TDbUpdateResult, bt as TTouchManyOptions, et as TDeleteOptions, g as DbRow, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, ot as TFkLookupResolver, w as TCascadeResolver, x as NullableOptional, yt as TTableResolver } from "./buckets-GruoVxH5.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
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ct as TWriteTableResolver, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, Lt as DbEncryption, Nt as BaseDbAdapter, Ot as TableMetadata, Pt as AtscriptDbReadable, Rt as TDbEncryptionOptions, St as TWriteOptions, U as TDbInsertResult, X as TDbUpdateResult, bt as TTouchManyOptions, et as TDeleteOptions, g as DbRow, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, ot as TFkLookupResolver, w as TCascadeResolver, x as NullableOptional, yt as TTableResolver } from "./buckets-
|
|
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 { Ct as TWriteTableResolver, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, Lt as DbEncryption, Nt as BaseDbAdapter, Ot as TableMetadata, Pt as AtscriptDbReadable, Rt as TDbEncryptionOptions, St as TWriteOptions, U as TDbInsertResult, X as TDbUpdateResult, bt as TTouchManyOptions, et as TDeleteOptions, g as DbRow, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, ot as TFkLookupResolver, w as TCascadeResolver, x as NullableOptional, yt as TTableResolver } from "./buckets-D6PBXKRJ.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
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_db_error = require("./db-error-DTkkeu5b.cjs");
|
|
2
|
-
require("./agg.cjs");
|
|
2
|
+
const require_agg = require("./agg-EcIbAFnJ.cjs");
|
|
3
3
|
const require_validator = require("./validator-BtZbcLN2.cjs");
|
|
4
4
|
const require_nested_writer = require("./nested-writer-wk1EFUNY.cjs");
|
|
5
5
|
const require_ops = require("./ops.cjs");
|
|
@@ -23,7 +23,8 @@ const NoopLogger = {
|
|
|
23
23
|
* appear in $groupBy", string `$groupBy` entries) with the table's names as
|
|
24
24
|
* the collision set: a bucket alias may not equal a logical path, a physical
|
|
25
25
|
* column or a navigation field, so a label is never reverse-mapped as a
|
|
26
|
-
* column.
|
|
26
|
+
* column. Aggregate entries are checked against `SUPPORTED_AGGREGATE_FNS`
|
|
27
|
+
* (and `'*'` is `count`'s only).
|
|
27
28
|
*
|
|
28
29
|
* Which layer validates what:
|
|
29
30
|
* - **Shapes** (this normalizer) run FIRST at every entry point — the core's
|
|
@@ -48,6 +49,7 @@ const NoopLogger = {
|
|
|
48
49
|
function resolveCalendarBuckets(controls, fields, aggregate) {
|
|
49
50
|
const res = (0, _uniqu_core.resolveBuckets)(controls, {
|
|
50
51
|
aggregate,
|
|
52
|
+
fns: require_agg.SUPPORTED_AGGREGATE_FNS,
|
|
51
53
|
isField: (name) => fields.flatMap.has(name) || fields.navFields.has(name) || fields.physicalNames.has(name)
|
|
52
54
|
});
|
|
53
55
|
if (!res.ok) throw new require_db_error.DbError("INVALID_QUERY", res.issues);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as CasMismatchError, r as DbError } from "./db-error-D5uilS_A.mjs";
|
|
2
|
-
import { resolveAlias } from "./agg.mjs";
|
|
2
|
+
import { a as SUPPORTED_AGGREGATE_FNS, i as resolveAlias } from "./agg-CvXDGnKi.mjs";
|
|
3
3
|
import { a as forceNavNonOptional, c as getKeyProps, i as dbPlugin, l as isEmptyObject, n as buildPatchPartial, t as buildDbValidator, u as isPlainObject } from "./validator-Ch7UIQl9.mjs";
|
|
4
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-CqL24ojl.mjs";
|
|
5
5
|
import { separateCas, separateFieldOps } from "./ops.mjs";
|
|
@@ -23,7 +23,8 @@ const NoopLogger = {
|
|
|
23
23
|
* appear in $groupBy", string `$groupBy` entries) with the table's names as
|
|
24
24
|
* the collision set: a bucket alias may not equal a logical path, a physical
|
|
25
25
|
* column or a navigation field, so a label is never reverse-mapped as a
|
|
26
|
-
* column.
|
|
26
|
+
* column. Aggregate entries are checked against `SUPPORTED_AGGREGATE_FNS`
|
|
27
|
+
* (and `'*'` is `count`'s only).
|
|
27
28
|
*
|
|
28
29
|
* Which layer validates what:
|
|
29
30
|
* - **Shapes** (this normalizer) run FIRST at every entry point — the core's
|
|
@@ -48,6 +49,7 @@ const NoopLogger = {
|
|
|
48
49
|
function resolveCalendarBuckets(controls, fields, aggregate) {
|
|
49
50
|
const res = resolveBuckets(controls, {
|
|
50
51
|
aggregate,
|
|
52
|
+
fns: SUPPORTED_AGGREGATE_FNS,
|
|
51
53
|
isField: (name) => fields.flatMap.has(name) || fields.navFields.has(name) || fields.physicalNames.has(name)
|
|
52
54
|
});
|
|
53
55
|
if (!res.ok) throw new DbError("INVALID_QUERY", res.issues);
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_db_error = require("./db-error-DTkkeu5b.cjs");
|
|
3
|
-
const require_db_view = require("./db-view-
|
|
3
|
+
const require_db_view = require("./db-view-Dm7MpUGB.cjs");
|
|
4
4
|
const require_validator = require("./validator-BtZbcLN2.cjs");
|
|
5
5
|
const require_consts = require("./consts-BzRfCcH2.cjs");
|
|
6
6
|
const require_ops = require("./ops.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as TDbWriteGuardContext, A as TDbActionIntent, At as isGeoIndexableType, B as TDbIndexField, Bt as FieldMappingStrategy, C as PrimaryKeyOf, Ct as TWriteTableResolver, D as TCrudOp, Dt as WithRelation, E as TColumnDiff, Et as UniqueryControls, F as TDbDefaultValue, Ft as DbResponse, G as TDbReferentialAction, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, It as resolveDesignType, J as TDbRemoveGuardContext, K as TDbRelation, L as TDbFieldMeta, Lt as DbEncryption, M as TDbActionProcessor, Mt as ALL_BUCKET_UNITS, N as TDbCollation, Nt as BaseDbAdapter, O as TCrudPermissions, Ot as TableMetadata, P as TDbDefaultFn, Pt as AtscriptDbReadable, Q as TDbWriteGuard, R as TDbForeignKey, Rt as TDbEncryptionOptions, S as OwnPropsOf, St as TWriteOptions, T as TCascadeTarget, Tt as Uniquery, U as TDbInsertResult, Ut as UniquSelect, V as TDbIndexType, Vt as NoopLogger, W as TDbObjectKind, X as TDbUpdateResult, Y as TDbStorageType, Z as TDbWriteAction, _ as FieldOpsFor, _t as TSyncColumnResult, a as jsonValueAncestor, at as TFieldMeta, b as NavPropsOf, bt as TTouchManyOptions, c as AggregateExpr, ct as TIdDescriptor, d as AggregateResult, dt as TMetaResponse, et as TDeleteOptions, f as AtscriptDbWritable, ft as TMetadataOverrides, g as DbRow, gt as TSearchIndexInfo, h as DbQuery, ht as TRelationInfo, i as isJsonValueField, it as TExistingTableOption, j as TDbActionLevel, jt as isGeoPointType, k as TDbActionInfo, kt as findAncestorInSet, l as AggregateFn, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, n as TResolvedBucket, nt as TExistingColumn, o as resolveCalendarBuckets, ot as TFkLookupResolver, p as DbControls, pt as TPrimaryKeyChange, q as TDbRemoveGuard, r as isBucketableField, rt as TExistingForeignKey, s as AggregateControls, st as TFkLookupTarget, t as TBucketFieldSource, tt as TEnsureTableOptions, u as AggregateQuery, ut as TIdentification, v as FilterExpr, vt as TTableOptionDiff, w as TCascadeResolver, wt as TypedWithRelation, x as NullableOptional, xt as TValueFormatterPair, y as FlatOf, yt as TTableResolver, z as TDbIndex, zt as DocumentFieldMapper } from "./buckets-
|
|
1
|
+
import { $ as TDbWriteGuardContext, A as TDbActionIntent, At as isGeoIndexableType, B as TDbIndexField, Bt as FieldMappingStrategy, C as PrimaryKeyOf, Ct as TWriteTableResolver, D as TCrudOp, Dt as WithRelation, E as TColumnDiff, Et as UniqueryControls, F as TDbDefaultValue, Ft as DbResponse, G as TDbReferentialAction, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, It as resolveDesignType, J as TDbRemoveGuardContext, K as TDbRelation, L as TDbFieldMeta, Lt as DbEncryption, M as TDbActionProcessor, Mt as ALL_BUCKET_UNITS, N as TDbCollation, Nt as BaseDbAdapter, O as TCrudPermissions, Ot as TableMetadata, P as TDbDefaultFn, Pt as AtscriptDbReadable, Q as TDbWriteGuard, R as TDbForeignKey, Rt as TDbEncryptionOptions, S as OwnPropsOf, St as TWriteOptions, T as TCascadeTarget, Tt as Uniquery, U as TDbInsertResult, Ut as UniquSelect, V as TDbIndexType, Vt as NoopLogger, W as TDbObjectKind, X as TDbUpdateResult, Y as TDbStorageType, Z as TDbWriteAction, _ as FieldOpsFor, _t as TSyncColumnResult, a as jsonValueAncestor, at as TFieldMeta, b as NavPropsOf, bt as TTouchManyOptions, c as AggregateExpr, ct as TIdDescriptor, d as AggregateResult, dt as TMetaResponse, et as TDeleteOptions, f as AtscriptDbWritable, ft as TMetadataOverrides, g as DbRow, gt as TSearchIndexInfo, h as DbQuery, ht as TRelationInfo, i as isJsonValueField, it as TExistingTableOption, j as TDbActionLevel, jt as isGeoPointType, k as TDbActionInfo, kt as findAncestorInSet, l as AggregateFn, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, n as TResolvedBucket, nt as TExistingColumn, o as resolveCalendarBuckets, ot as TFkLookupResolver, p as DbControls, pt as TPrimaryKeyChange, q as TDbRemoveGuard, r as isBucketableField, rt as TExistingForeignKey, s as AggregateControls, st as TFkLookupTarget, t as TBucketFieldSource, tt as TEnsureTableOptions, u as AggregateQuery, ut as TIdentification, v as FilterExpr, vt as TTableOptionDiff, w as TCascadeResolver, wt as TypedWithRelation, x as NullableOptional, xt as TValueFormatterPair, y as FlatOf, yt as TTableResolver, z as TDbIndex, zt as DocumentFieldMapper } from "./buckets-D6PBXKRJ.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 {
|
|
4
|
-
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-
|
|
3
|
+
import { c as CalendarBucketLabel, d as WeekStart, l as ComputedExpr, o as BucketExpr, s as BucketUnit, u as ResolvedBucket } from "./agg-DKuf_v2L.cjs";
|
|
4
|
+
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-BdtBNTeH.cjs";
|
|
5
5
|
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, v as bucketTimeZoneUnavailable } from "./validator-CewfnGZj.cjs";
|
|
6
6
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.cjs";
|
|
7
7
|
import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, ResolvedBucket as ResolvedBucket$1, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as TDbWriteGuardContext, A as TDbActionIntent, At as isGeoIndexableType, B as TDbIndexField, Bt as FieldMappingStrategy, C as PrimaryKeyOf, Ct as TWriteTableResolver, D as TCrudOp, Dt as WithRelation, E as TColumnDiff, Et as UniqueryControls, F as TDbDefaultValue, Ft as DbResponse, G as TDbReferentialAction, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, It as resolveDesignType, J as TDbRemoveGuardContext, K as TDbRelation, L as TDbFieldMeta, Lt as DbEncryption, M as TDbActionProcessor, Mt as ALL_BUCKET_UNITS, N as TDbCollation, Nt as BaseDbAdapter, O as TCrudPermissions, Ot as TableMetadata, P as TDbDefaultFn, Pt as AtscriptDbReadable, Q as TDbWriteGuard, R as TDbForeignKey, Rt as TDbEncryptionOptions, S as OwnPropsOf, St as TWriteOptions, T as TCascadeTarget, Tt as Uniquery, U as TDbInsertResult, Ut as UniquSelect, V as TDbIndexType, Vt as NoopLogger, W as TDbObjectKind, X as TDbUpdateResult, Y as TDbStorageType, Z as TDbWriteAction, _ as FieldOpsFor, _t as TSyncColumnResult, a as jsonValueAncestor, at as TFieldMeta, b as NavPropsOf, bt as TTouchManyOptions, c as AggregateExpr, ct as TIdDescriptor, d as AggregateResult, dt as TMetaResponse, et as TDeleteOptions, f as AtscriptDbWritable, ft as TMetadataOverrides, g as DbRow, gt as TSearchIndexInfo, h as DbQuery, ht as TRelationInfo, i as isJsonValueField, it as TExistingTableOption, j as TDbActionLevel, jt as isGeoPointType, k as TDbActionInfo, kt as findAncestorInSet, l as AggregateFn, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, n as TResolvedBucket, nt as TExistingColumn, o as resolveCalendarBuckets, ot as TFkLookupResolver, p as DbControls, pt as TPrimaryKeyChange, q as TDbRemoveGuard, r as isBucketableField, rt as TExistingForeignKey, s as AggregateControls, st as TFkLookupTarget, t as TBucketFieldSource, tt as TEnsureTableOptions, u as AggregateQuery, ut as TIdentification, v as FilterExpr, vt as TTableOptionDiff, w as TCascadeResolver, wt as TypedWithRelation, x as NullableOptional, xt as TValueFormatterPair, y as FlatOf, yt as TTableResolver, z as TDbIndex, zt as DocumentFieldMapper } from "./buckets-
|
|
1
|
+
import { $ as TDbWriteGuardContext, A as TDbActionIntent, At as isGeoIndexableType, B as TDbIndexField, Bt as FieldMappingStrategy, C as PrimaryKeyOf, Ct as TWriteTableResolver, D as TCrudOp, Dt as WithRelation, E as TColumnDiff, Et as UniqueryControls, F as TDbDefaultValue, Ft as DbResponse, G as TDbReferentialAction, H as TDbInsertManyResult, Ht as TGenericLogger, I as TDbDeleteResult, It as resolveDesignType, J as TDbRemoveGuardContext, K as TDbRelation, L as TDbFieldMeta, Lt as DbEncryption, M as TDbActionProcessor, Mt as ALL_BUCKET_UNITS, N as TDbCollation, Nt as BaseDbAdapter, O as TCrudPermissions, Ot as TableMetadata, P as TDbDefaultFn, Pt as AtscriptDbReadable, Q as TDbWriteGuard, R as TDbForeignKey, Rt as TDbEncryptionOptions, S as OwnPropsOf, St as TWriteOptions, T as TCascadeTarget, Tt as Uniquery, U as TDbInsertResult, Ut as UniquSelect, V as TDbIndexType, Vt as NoopLogger, W as TDbObjectKind, X as TDbUpdateResult, Y as TDbStorageType, Z as TDbWriteAction, _ as FieldOpsFor, _t as TSyncColumnResult, a as jsonValueAncestor, at as TFieldMeta, b as NavPropsOf, bt as TTouchManyOptions, c as AggregateExpr, ct as TIdDescriptor, d as AggregateResult, dt as TMetaResponse, et as TDeleteOptions, f as AtscriptDbWritable, ft as TMetadataOverrides, g as DbRow, gt as TSearchIndexInfo, h as DbQuery, ht as TRelationInfo, i as isJsonValueField, it as TExistingTableOption, j as TDbActionLevel, jt as isGeoPointType, k as TDbActionInfo, kt as findAncestorInSet, l as AggregateFn, lt as TIdResolveOptions, m as DbPatch, mt as TReferencingForeignKey, n as TResolvedBucket, nt as TExistingColumn, o as resolveCalendarBuckets, ot as TFkLookupResolver, p as DbControls, pt as TPrimaryKeyChange, q as TDbRemoveGuard, r as isBucketableField, rt as TExistingForeignKey, s as AggregateControls, st as TFkLookupTarget, t as TBucketFieldSource, tt as TEnsureTableOptions, u as AggregateQuery, ut as TIdentification, v as FilterExpr, vt as TTableOptionDiff, w as TCascadeResolver, wt as TypedWithRelation, x as NullableOptional, xt as TValueFormatterPair, y as FlatOf, yt as TTableResolver, z as TDbIndex, zt as DocumentFieldMapper } from "./buckets-GruoVxH5.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 {
|
|
4
|
-
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-
|
|
3
|
+
import { c as CalendarBucketLabel, d as WeekStart, l as ComputedExpr, o as BucketExpr, s as BucketUnit, u as ResolvedBucket } from "./agg-BtlGeRfj.mjs";
|
|
4
|
+
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-9CH5neN7.mjs";
|
|
5
5
|
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, v as bucketTimeZoneUnavailable } from "./validator-CewfnGZj.mjs";
|
|
6
6
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.mjs";
|
|
7
7
|
import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, ResolvedBucket as ResolvedBucket$1, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as bucketTimeZoneUnavailable, n as CasMismatchError, r as DbError, t as CasExhaustedError } from "./db-error-D5uilS_A.mjs";
|
|
2
|
-
import { A as unsupportedOperatorMessage, B as isJsonValueField, C as guardAggregate, D as guardQuery, E as guardPaths, F as TableMetadata, H as resolveCalendarBuckets, I as findAncestorInSet, L as isGeoIndexableType, M as DocumentFieldMapper, N as FieldMappingStrategy, O as narrowerFilterOps, P as UniquSelect, R as isGeoPointType, S as collectQueryPaths, T as guardPath, U as NoopLogger, V as jsonValueAncestor, _ as assertGeoPoint, a as decomposePatch, b as checkHavingKeys, c as BaseDbAdapter, d as NativeIntegrity, f as AtscriptDbReadable, g as acceptedOperatorsHint, h as ENCRYPTED_REASON, i as assertNoVersionWrites, j as RelationalFieldMapper, k as sortFieldNames, l as createFailureCollector, m as ADAPTER_FILTER_REASON, 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 bucketSourceVerdict, w as guardFilter, x as classifyQueryPath, y as canFilterLeaf, z as isBucketableField } from "./db-view-
|
|
2
|
+
import { A as unsupportedOperatorMessage, B as isJsonValueField, C as guardAggregate, D as guardQuery, E as guardPaths, F as TableMetadata, H as resolveCalendarBuckets, I as findAncestorInSet, L as isGeoIndexableType, M as DocumentFieldMapper, N as FieldMappingStrategy, O as narrowerFilterOps, P as UniquSelect, R as isGeoPointType, S as collectQueryPaths, T as guardPath, U as NoopLogger, V as jsonValueAncestor, _ as assertGeoPoint, a as decomposePatch, b as checkHavingKeys, c as BaseDbAdapter, d as NativeIntegrity, f as AtscriptDbReadable, g as acceptedOperatorsHint, h as ENCRYPTED_REASON, i as assertNoVersionWrites, j as RelationalFieldMapper, k as sortFieldNames, l as createFailureCollector, m as ADAPTER_FILTER_REASON, 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 bucketSourceVerdict, w as guardFilter, x as classifyQueryPath, y as canFilterLeaf, z as isBucketableField } from "./db-view-Doh8vPg3.mjs";
|
|
3
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";
|
package/dist/rel.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as TWriteTableResolver, Ht as TGenericLogger, K as TDbRelation, Nt as BaseDbAdapter, Ot as TableMetadata, R as TDbForeignKey, yt as TTableResolver } from "./buckets-
|
|
1
|
+
import { Ct as TWriteTableResolver, Ht as TGenericLogger, K as TDbRelation, Nt as BaseDbAdapter, Ot as TableMetadata, R as TDbForeignKey, yt as TTableResolver } from "./buckets-D6PBXKRJ.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 { Ct as TWriteTableResolver, Ht as TGenericLogger, K as TDbRelation, Nt as BaseDbAdapter, Ot as TableMetadata, R as TDbForeignKey, yt as TTableResolver } from "./buckets-
|
|
1
|
+
import { Ct as TWriteTableResolver, Ht as TGenericLogger, K as TDbRelation, Nt as BaseDbAdapter, Ot as TableMetadata, R as TDbForeignKey, yt as TTableResolver } from "./buckets-GruoVxH5.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/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-Dm7MpUGB.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 { E as TColumnDiff, F as TDbDefaultValue, Ht as TGenericLogger, L as TDbFieldMeta, Pt as AtscriptDbReadable, R as TDbForeignKey, W as TDbObjectKind, Y as TDbStorageType, it as TExistingTableOption, mt as TReferencingForeignKey, nt as TExistingColumn, pt as TPrimaryKeyChange, rt as TExistingForeignKey, tt as TEnsureTableOptions, vt as TTableOptionDiff } from "./buckets-
|
|
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, Ht as TGenericLogger, L as TDbFieldMeta, Pt as AtscriptDbReadable, R as TDbForeignKey, W as TDbObjectKind, Y as TDbStorageType, it as TExistingTableOption, mt as TReferencingForeignKey, nt as TExistingColumn, pt as TPrimaryKeyChange, rt as TExistingForeignKey, tt as TEnsureTableOptions, vt as TTableOptionDiff } from "./buckets-D6PBXKRJ.cjs";
|
|
2
|
+
import { c as AtscriptQueryFieldRef$1, i as AtscriptDbView, l as AtscriptQueryNode$1, t as DbSpace } from "./db-space-BdtBNTeH.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 { E as TColumnDiff, F as TDbDefaultValue, Ht as TGenericLogger, L as TDbFieldMeta, Pt as AtscriptDbReadable, R as TDbForeignKey, W as TDbObjectKind, Y as TDbStorageType, it as TExistingTableOption, mt as TReferencingForeignKey, nt as TExistingColumn, pt as TPrimaryKeyChange, rt as TExistingForeignKey, tt as TEnsureTableOptions, vt as TTableOptionDiff } from "./buckets-
|
|
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, Ht as TGenericLogger, L as TDbFieldMeta, Pt as AtscriptDbReadable, R as TDbForeignKey, W as TDbObjectKind, Y as TDbStorageType, it as TExistingTableOption, mt as TReferencingForeignKey, nt as TExistingColumn, pt as TPrimaryKeyChange, rt as TExistingForeignKey, tt as TEnsureTableOptions, vt as TTableOptionDiff } from "./buckets-GruoVxH5.mjs";
|
|
2
|
+
import { c as AtscriptQueryFieldRef$1, i as AtscriptDbView, l as AtscriptQueryNode$1, t as DbSpace } from "./db-space-9CH5neN7.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 { U as NoopLogger } from "./db-view-
|
|
1
|
+
import { U as NoopLogger } from "./db-view-Doh8vPg3.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) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.135",
|
|
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.11",
|
|
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.11"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"postinstall": "asc -f dts",
|