@kronor/dtv 8.0.1 → 8.1.1
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/index.es.js +4120 -4097
- package/dist/types/dsl/filters.d.ts +0 -7
- package/docs/api/row-typed-views.md +9 -8
- package/docs/typegen.md +4 -3
- package/package.json +2 -2
|
@@ -79,10 +79,3 @@ export declare function filter<Row, const Expr extends FilterExpr>(args: {
|
|
|
79
79
|
expression: Expr & ValidateFilterExprForRow<Row, Expr>;
|
|
80
80
|
aiGenerated?: boolean;
|
|
81
81
|
}): FilterSchema;
|
|
82
|
-
export declare function filter(args: {
|
|
83
|
-
rowType?: never;
|
|
84
|
-
id: string;
|
|
85
|
-
label: string;
|
|
86
|
-
expression: FilterExpr;
|
|
87
|
-
aiGenerated?: boolean;
|
|
88
|
-
}): FilterSchema;
|
|
@@ -6,9 +6,10 @@ checked against that row: field paths have to exist, controls have to be able to
|
|
|
6
6
|
produce the type of the field they filter, and operators have to be ones Hasura
|
|
7
7
|
offers for that type.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
`filter()` requires `rowType`: a filter has to say which row it is built on.
|
|
10
|
+
Columns are still opt-in — a `column()` that passes no row type keeps working
|
|
11
|
+
exactly as before — and JSON views are unaffected (they are validated at
|
|
12
|
+
runtime by the view parser, not by these types).
|
|
12
13
|
|
|
13
14
|
## Getting the row type
|
|
14
15
|
|
|
@@ -227,7 +228,7 @@ with no `toQuery` at all is rejected too; it would do nothing at query time.
|
|
|
227
228
|
### Row-scoped builders
|
|
228
229
|
|
|
229
230
|
`FilterExpr` accepts any field name and is checked when the expression reaches
|
|
230
|
-
`filter(
|
|
231
|
+
`filter()`, which reports problems on the `expression` it was given. Scoping
|
|
231
232
|
the builder to the row instead gives the editor a row to work from:
|
|
232
233
|
|
|
233
234
|
```ts
|
|
@@ -239,10 +240,10 @@ F.like({ field: F.field.or('reference', 'customer.email'), control: FilterContro
|
|
|
239
240
|
```
|
|
240
241
|
|
|
241
242
|
Field names complete as they are typed, and each problem is reported on the
|
|
242
|
-
property that caused it — an unsupported operator on `field`, an unusable
|
|
243
|
-
control on `control
|
|
244
|
-
`filter(
|
|
245
|
-
errors appear, not about checking more.
|
|
243
|
+
leaf property that caused it — an unsupported operator on `field`, an unusable
|
|
244
|
+
control on `control` — rather than on the whole expression. The results are
|
|
245
|
+
ordinary `FilterExpr` values, so `filter()` still checks them; the row-scoped
|
|
246
|
+
builder is about where errors appear, not about checking more.
|
|
246
247
|
|
|
247
248
|
`hasuraDSLforRowType` and `queryForRowType` are the same idea for
|
|
248
249
|
condition-producing transforms and for nested selections:
|
package/docs/typegen.md
CHANGED
|
@@ -91,9 +91,10 @@ The generator also edits the view module itself, as a convenience: it imports
|
|
|
91
91
|
do not have one yet. Calls that already pass `rowType` are left alone, so
|
|
92
92
|
re-running the generator is safe.
|
|
93
93
|
|
|
94
|
-
Passing `rowType` is what turns on checking of a view's columns
|
|
95
|
-
|
|
96
|
-
where no call ends up
|
|
94
|
+
Passing `rowType` is what turns on checking of a view's columns against its
|
|
95
|
+
row, and `DSL.filter(...)` requires it — see
|
|
96
|
+
[api/row-typed-views.md](api/row-typed-views.md). A view where no call ends up
|
|
97
|
+
with a `rowType` gets no generated file.
|
|
97
98
|
|
|
98
99
|
## What the run reports
|
|
99
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronor/dtv",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"description": "Schema-driven, declarative table views with advanced filtering, data fetching and AI-assisted filter generation.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react-dom": "^19.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@kronor/hasura-graphql": "^0.1.
|
|
61
|
+
"@kronor/hasura-graphql": "^0.1.2",
|
|
62
62
|
"commander": "^14.0.0",
|
|
63
63
|
"fast-glob": "^3.3.3",
|
|
64
64
|
"graphql": "^16.14.2",
|