@zveltio/sdk 3.0.0-beta.124 → 3.0.0-beta.133
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/LICENSE +21 -0
- package/dist/build/index.d.ts.map +1 -1
- package/dist/build/index.js +9 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -3
- package/dist/extension/index.d.ts +15 -3
- package/dist/extension/index.d.ts.map +1 -1
- package/dist/extension/reserved-paths.d.ts +5 -1
- package/dist/extension/reserved-paths.d.ts.map +1 -1
- package/dist/extension/reserved-paths.js +8 -1
- package/dist/sync-manager.d.ts +5 -0
- package/dist/sync-manager.d.ts.map +1 -1
- package/dist/sync-manager.js +23 -4
- package/dist/tests/client.test.js +19 -0
- package/dist/tests/reserved-paths.test.js +4 -1
- package/dist/tests/runtime-deps.test.d.ts +2 -0
- package/dist/tests/runtime-deps.test.d.ts.map +1 -0
- package/dist/tests/runtime-deps.test.js +41 -0
- package/dist/tests/sync-manager.test.js +42 -0
- package/dist/tests/validate-manifest-actions.test.js +12 -0
- package/dist/tests/validate-manifest-routes.test.js +5 -0
- package/dist/tests/validate-sdui-data-endpoints.test.js +19 -3
- package/dist/tests/view-runtime.test.js +36 -2
- package/dist/tests/view.test.js +122 -3
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +178 -6
- package/dist/view/index.d.ts +17 -0
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/index.js +110 -1
- package/dist/view/runtime.d.ts +26 -0
- package/dist/view/runtime.d.ts.map +1 -1
- package/dist/view/runtime.js +60 -6
- package/dist/view/schema.d.ts.map +1 -1
- package/dist/view/schema.js +29 -5
- package/dist/view/types.generated.d.ts +17 -3
- package/dist/view/types.generated.d.ts.map +1 -1
- package/package.json +7 -4
- package/schemas/extension-manifest.schema.json +588 -0
- package/schemas/view-2.schema.json +73 -3
package/dist/view/index.js
CHANGED
|
@@ -38,7 +38,8 @@ const CONDITION_LISTS = new Set(['filter', 'when', 'emphasisWhen', 'busyWhen']);
|
|
|
38
38
|
* - the data API takes one value per field and operator (`{"f":{"gt":1,"lt":9}}`),
|
|
39
39
|
* so a condition list that gives the same pair twice cannot be sent whole: one
|
|
40
40
|
* of the two would be dropped and the list would answer wider than written;
|
|
41
|
-
* - a button's `prompt` never names an input its
|
|
41
|
+
* - a button's `prompt` (and its `files.prompt`) never names an input its
|
|
42
|
+
* `input` already binds.
|
|
42
43
|
*/
|
|
43
44
|
function crossChecks(v, path, out) {
|
|
44
45
|
if (Array.isArray(v)) {
|
|
@@ -58,6 +59,50 @@ function crossChecks(v, path, out) {
|
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
}
|
|
62
|
+
// `pick` draws an input as a picker: on a button only an input it asks for, on neither one it sets.
|
|
63
|
+
if (isObj(v.pick)) {
|
|
64
|
+
const button = v.type !== 'form';
|
|
65
|
+
for (const name of Object.keys(v.pick)) {
|
|
66
|
+
if (isObj(v.input) && Object.hasOwn(v.input, name)) {
|
|
67
|
+
out.push({
|
|
68
|
+
path: `${path}/pick/${name}`,
|
|
69
|
+
message: 'names an input the button already sets',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else if (button && !(Array.isArray(v.prompt) && v.prompt.includes(name))) {
|
|
73
|
+
out.push({
|
|
74
|
+
path: `${path}/pick/${name}`,
|
|
75
|
+
message: 'names an input the button does not ask for (`prompt`)',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(v.facets)) {
|
|
81
|
+
const all = v.facets;
|
|
82
|
+
all.forEach((f, i) => {
|
|
83
|
+
if (all.indexOf(f) !== i)
|
|
84
|
+
out.push({ path: `${path}/facets/${i}`, message: 'repeats a field' });
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// A facet adds `field eq value`: on a field the view's `filter` already constrains it would contradict it.
|
|
88
|
+
if (Array.isArray(v.facets) && Array.isArray(v.filter)) {
|
|
89
|
+
const fixed = new Set(v.filter.map((c) => (isObj(c) ? c.field : undefined)));
|
|
90
|
+
v.facets.forEach((f, i) => {
|
|
91
|
+
if (fixed.has(f)) {
|
|
92
|
+
out.push({
|
|
93
|
+
path: `${path}/facets/${i}`,
|
|
94
|
+
message: "is a field the view's filter already constrains",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const filePrompt = isObj(v.files) && isObj(v.files.prompt) ? v.files.prompt.input : undefined;
|
|
100
|
+
if (typeof filePrompt === 'string' && isObj(v.input) && Object.hasOwn(v.input, filePrompt)) {
|
|
101
|
+
out.push({
|
|
102
|
+
path: `${path}/files/prompt/input`,
|
|
103
|
+
message: 'names an input the button already sets',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
61
106
|
for (const [k, x] of Object.entries(v)) {
|
|
62
107
|
if (CONDITION_LISTS.has(k) && Array.isArray(x)) {
|
|
63
108
|
const seen = new Set();
|
|
@@ -92,6 +137,9 @@ export function readActionResult(result) {
|
|
|
92
137
|
if (isObj(r) && 'reveal' in r && typeof r.reveal === 'string') {
|
|
93
138
|
return { kind: 'reveal', value: r.reveal };
|
|
94
139
|
}
|
|
140
|
+
if (isObj(r) && 'redirect' in r && typeof r.redirect === 'string') {
|
|
141
|
+
return { kind: 'redirect', url: r.redirect };
|
|
142
|
+
}
|
|
95
143
|
return { kind: 'values', values: result };
|
|
96
144
|
}
|
|
97
145
|
/** Keys that name one field of the bound collection, by view kind (`*`: any). */
|
|
@@ -120,6 +168,8 @@ function fieldRefs(v) {
|
|
|
120
168
|
add(`/${k}`, v[k]);
|
|
121
169
|
fieldList(v.fields, '/fields');
|
|
122
170
|
fieldList(v.card, '/card');
|
|
171
|
+
if (Array.isArray(v.facets))
|
|
172
|
+
v.facets.forEach((f, i) => add(`/facets/${i}`, f));
|
|
123
173
|
if (Array.isArray(v.sections)) {
|
|
124
174
|
v.sections.forEach((s, i) => isObj(s) && fieldList(s.fields, `/sections/${i}/fields`));
|
|
125
175
|
}
|
|
@@ -151,6 +201,7 @@ export function viewNameIssues(view, names) {
|
|
|
151
201
|
const views = names.views && new Set(names.views);
|
|
152
202
|
const keys = names.messageKeys && new Set(names.messageKeys);
|
|
153
203
|
const fields = names.fields && new Map([...names.fields].map(([c, f]) => [c, new Set(f)]));
|
|
204
|
+
const facetable = names.facetFields && new Map([...names.facetFields].map(([c, f]) => [c, new Set(f)]));
|
|
154
205
|
const ids = new Set();
|
|
155
206
|
const out = [];
|
|
156
207
|
const issue = (path, message) => out.push({ path, message });
|
|
@@ -180,8 +231,26 @@ export function viewNameIssues(view, names) {
|
|
|
180
231
|
issue(`${path}${at}`, `field "${f}" is not a field of "${v.collection}"`);
|
|
181
232
|
}
|
|
182
233
|
}
|
|
234
|
+
const facetOk = !valuesOnly && typeof v.collection === 'string' && facetable?.get(v.collection);
|
|
235
|
+
if (facetOk && Array.isArray(v.facets)) {
|
|
236
|
+
v.facets.forEach((f, i) => {
|
|
237
|
+
// A field the collection lacks is reported above, as every field reference.
|
|
238
|
+
if (typeof f === 'string' && known && known.has(f) && !facetOk.has(f)) {
|
|
239
|
+
issue(`${path}/facets/${i}`, `field "${f}" is neither a boolean nor a single-value field with declared choices`);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
183
243
|
for (const [k, x] of Object.entries(v)) {
|
|
184
244
|
const at = `${path}/${k}`;
|
|
245
|
+
if (k === 'pick' && !valuesOnly && isObj(x)) {
|
|
246
|
+
// Input names are the caller's; each value names a collection.
|
|
247
|
+
for (const [name, c] of Object.entries(x)) {
|
|
248
|
+
if (typeof c === 'string' && !collections.has(c)) {
|
|
249
|
+
issue(`${at}/${name}`, `collection "${c}" is not declared by this extension`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
185
254
|
if (k === '$selected') {
|
|
186
255
|
if (typeof x === 'string' && !panes.has(x)) {
|
|
187
256
|
issue(at, `"${x}" is not an earlier pane of an enclosing split`);
|
|
@@ -233,6 +302,46 @@ export function viewNameIssues(view, names) {
|
|
|
233
302
|
walk(view, '', new Set(), false);
|
|
234
303
|
return out;
|
|
235
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* A `pick` names an input the action declares as a plain string (the record's
|
|
307
|
+
* id is a string): not a number, a list, an object or a fixed set of choices.
|
|
308
|
+
* `inputs`: each own action's declared input JSON Schema, by name; an action
|
|
309
|
+
* absent from it (a dependency's, or one with no schema) is not checked.
|
|
310
|
+
*/
|
|
311
|
+
export function pickIssues(view, inputs) {
|
|
312
|
+
const out = [];
|
|
313
|
+
const walk = (v, path) => {
|
|
314
|
+
if (Array.isArray(v)) {
|
|
315
|
+
v.forEach((x, i) => walk(x, `${path}/${i}`));
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (!isObj(v))
|
|
319
|
+
return;
|
|
320
|
+
if (isObj(v.pick) && typeof v.action === 'string' && inputs.has(v.action)) {
|
|
321
|
+
const props = inputs.get(v.action)
|
|
322
|
+
?.properties;
|
|
323
|
+
for (const name of Object.keys(v.pick)) {
|
|
324
|
+
const p = props && Object.hasOwn(props, name) ? props[name] : undefined;
|
|
325
|
+
const t = isObj(p) ? p.type : undefined;
|
|
326
|
+
const text = t === 'string' ||
|
|
327
|
+
(Array.isArray(t) &&
|
|
328
|
+
t.length > 0 &&
|
|
329
|
+
t.every((x) => x === 'string' || x === 'null') &&
|
|
330
|
+
t.includes('string'));
|
|
331
|
+
if (!text || (isObj(p) && Array.isArray(p.enum))) {
|
|
332
|
+
out.push({
|
|
333
|
+
path: `${path}/pick/${name}`,
|
|
334
|
+
message: `is not a string input of action "${v.action}"`,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
for (const [k, x] of Object.entries(v))
|
|
340
|
+
walk(x, `${path}/${k}`);
|
|
341
|
+
};
|
|
342
|
+
walk(view, '');
|
|
343
|
+
return out;
|
|
344
|
+
}
|
|
236
345
|
/** Drops `undefined` keys (`sort: cond ? 'a' : undefined`) at every depth, as the file would. */
|
|
237
346
|
const clean = (v) => JSON.parse(JSON.stringify(v));
|
|
238
347
|
const kind = (type) => (props) => clean({ type, ...props });
|
package/dist/view/runtime.d.ts
CHANGED
|
@@ -91,4 +91,30 @@ export declare function viewFields(fields: Fields | undefined, schema: readonly
|
|
|
91
91
|
export declare function fallbackFor(view: View, drawn: ReadonlySet<string>): View | null;
|
|
92
92
|
/** The engine path that runs an action: its own extension's, or `<dependency>.<action>`. */
|
|
93
93
|
export declare function actionPath(extension: string, action: string): string;
|
|
94
|
+
/** The collection a relation field points at (`m2o`, `reference`); none for any other field. */
|
|
95
|
+
export declare function relatedOf(f: SchemaField | undefined): string | null;
|
|
96
|
+
/** A facet value as the choice declares it. */
|
|
97
|
+
export type FacetValue = string | number | boolean;
|
|
98
|
+
/**
|
|
99
|
+
* A field's declared choices, in order, each as the declaration gives it (a
|
|
100
|
+
* plain value or `{ value, label }`). The engine's `enum` declares them as
|
|
101
|
+
* `options.values`; a list in `options`, or `options.choices`, is read too.
|
|
102
|
+
* Nothing for a field that declares none.
|
|
103
|
+
*/
|
|
104
|
+
export declare function declaredChoices(f: SchemaField | undefined): unknown[];
|
|
105
|
+
/**
|
|
106
|
+
* What a list's `facets` entry offers for a field: its declared choices, or
|
|
107
|
+
* `true` and `false` for a boolean; nothing for any other field.
|
|
108
|
+
*/
|
|
109
|
+
export declare function facetOptions(f: SchemaField | undefined): {
|
|
110
|
+
value: FacetValue;
|
|
111
|
+
label: string;
|
|
112
|
+
}[];
|
|
113
|
+
/**
|
|
114
|
+
* A list's `filter` with the facet values picked (field → value) added as
|
|
115
|
+
* `field eq value`. A facet on a field the filter constrains is refused by
|
|
116
|
+
* `validateView`; one that slips through is dropped, so the view's own
|
|
117
|
+
* condition always stands.
|
|
118
|
+
*/
|
|
119
|
+
export declare function withFacets(filter: Conditions | undefined, picked: Readonly<Record<string, FacetValue | undefined>>): Conditions | undefined;
|
|
94
120
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/view/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,MAAM,EAEN,UAAU,EACV,KAAK,EACL,MAAM,EACN,WAAW,EACX,KAAK,EAGL,IAAI,EACJ,KAAK,EACL,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACtC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/view/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,MAAM,EAEN,UAAU,EACV,KAAK,EACL,MAAM,EACN,WAAW,EACX,KAAK,EAGL,IAAI,EACJ,KAAK,EACL,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,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MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAK/E;AAED,4FAA4F;AAC5F,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQpE;AAOD,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAMnE;AAED,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,EAAE,CAKrE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAc/F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,GACvD,UAAU,GAAG,SAAS,CAMxB"}
|
package/dist/view/runtime.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* the front end; the engine's rules decide every call.
|
|
11
11
|
*/
|
|
12
12
|
const isRef = (v) => typeof v === 'object' && v !== null && !Array.isArray(v) && Object.keys(v)[0]?.startsWith('$');
|
|
13
|
+
/** An own property only: `constructor` on a plain record is no field. */
|
|
14
|
+
const own = (o, k) => o && Object.hasOwn(o, k) ? o[k] : undefined;
|
|
13
15
|
function localToday() {
|
|
14
16
|
const d = new Date();
|
|
15
17
|
const p = (n) => String(n).padStart(2, '0');
|
|
@@ -24,13 +26,13 @@ export function resolveValue(v, s) {
|
|
|
24
26
|
if (!isRef(v))
|
|
25
27
|
return v;
|
|
26
28
|
if ('$record' in v)
|
|
27
|
-
return s.record
|
|
29
|
+
return own(s.record, v.$record);
|
|
28
30
|
if ('$selected' in v)
|
|
29
|
-
return s.selected
|
|
31
|
+
return own(s.selected, v.$selected);
|
|
30
32
|
if ('$selection' in v)
|
|
31
|
-
return s.selection?.map((r) => r
|
|
33
|
+
return s.selection?.map((r) => own(r, v.$selection));
|
|
32
34
|
if ('$param' in v)
|
|
33
|
-
return s.params
|
|
35
|
+
return own(s.params, v.$param);
|
|
34
36
|
if ('$user' in v)
|
|
35
37
|
return s.user;
|
|
36
38
|
return s.today ?? localToday();
|
|
@@ -115,7 +117,7 @@ export function toFilter(conds, s) {
|
|
|
115
117
|
return null;
|
|
116
118
|
}
|
|
117
119
|
// The data API takes one value per field and operator; `validateView` refuses the pair twice.
|
|
118
|
-
if (out
|
|
120
|
+
if (Object.hasOwn(out, c.field) && c.op in out[c.field]) {
|
|
119
121
|
throw new Error(`view/2: "${c.field}" ${c.op} is given twice in one condition list`);
|
|
120
122
|
}
|
|
121
123
|
out[c.field] = { ...out[c.field], [c.op]: value };
|
|
@@ -126,7 +128,7 @@ const cmp = (a, b) => typeof a === 'number' && typeof b === 'number'
|
|
|
126
128
|
? a - b
|
|
127
129
|
: String(a ?? '').localeCompare(String(b ?? ''));
|
|
128
130
|
function holds(c, row, s) {
|
|
129
|
-
const have = row
|
|
131
|
+
const have = own(row, c.field);
|
|
130
132
|
if (!('value' in c))
|
|
131
133
|
return c.op === 'null' ? have == null : have != null;
|
|
132
134
|
const want = resolveValue(c.value, s);
|
|
@@ -238,3 +240,55 @@ export function actionPath(extension, action) {
|
|
|
238
240
|
const EXTENSION_NAME = /^[a-z][a-z0-9-]*(\/[a-z][a-z0-9-]*)*$/;
|
|
239
241
|
/** An action name, as the manifest's `actions[].name`. */
|
|
240
242
|
const ACTION = /^[a-z][a-zA-Z0-9]*$/;
|
|
243
|
+
/** The collection a relation field points at (`m2o`, `reference`); none for any other field. */
|
|
244
|
+
export function relatedOf(f) {
|
|
245
|
+
const target = f?.options
|
|
246
|
+
?.related_collection;
|
|
247
|
+
return (f?.type === 'm2o' || f?.type === 'reference') && typeof target === 'string'
|
|
248
|
+
? target
|
|
249
|
+
: null;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* A field's declared choices, in order, each as the declaration gives it (a
|
|
253
|
+
* plain value or `{ value, label }`). The engine's `enum` declares them as
|
|
254
|
+
* `options.values`; a list in `options`, or `options.choices`, is read too.
|
|
255
|
+
* Nothing for a field that declares none.
|
|
256
|
+
*/
|
|
257
|
+
export function declaredChoices(f) {
|
|
258
|
+
const opts = f?.options;
|
|
259
|
+
if (Array.isArray(opts))
|
|
260
|
+
return opts;
|
|
261
|
+
const list = opts?.values ?? opts?.choices;
|
|
262
|
+
return Array.isArray(list) ? list : [];
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* What a list's `facets` entry offers for a field: its declared choices, or
|
|
266
|
+
* `true` and `false` for a boolean; nothing for any other field.
|
|
267
|
+
*/
|
|
268
|
+
export function facetOptions(f) {
|
|
269
|
+
if (f?.type === 'boolean') {
|
|
270
|
+
return [true, false].map((value) => ({ value, label: String(value) }));
|
|
271
|
+
}
|
|
272
|
+
// A multi-value field holds a list: `eq` on one value cannot select it.
|
|
273
|
+
if (f?.options?.multiple === true)
|
|
274
|
+
return [];
|
|
275
|
+
// The choice keeps its type (a number stays a number): the query compares it as declared.
|
|
276
|
+
const typed = (v) => typeof v === 'number' || typeof v === 'boolean' ? v : String(v);
|
|
277
|
+
return declaredChoices(f).map((c) => {
|
|
278
|
+
if (typeof c !== 'object' || c === null)
|
|
279
|
+
return { value: typed(c), label: String(c) };
|
|
280
|
+
const { value, label } = c;
|
|
281
|
+
return { value: typed(value), label: String(label ?? value) };
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* A list's `filter` with the facet values picked (field → value) added as
|
|
286
|
+
* `field eq value`. A facet on a field the filter constrains is refused by
|
|
287
|
+
* `validateView`; one that slips through is dropped, so the view's own
|
|
288
|
+
* condition always stands.
|
|
289
|
+
*/
|
|
290
|
+
export function withFacets(filter, picked) {
|
|
291
|
+
const own = new Set((filter ?? []).map((c) => c.field));
|
|
292
|
+
const added = Object.entries(picked).flatMap(([field, value]) => value === undefined || own.has(field) ? [] : [{ field, op: 'eq', value }]);
|
|
293
|
+
return added.length ? [...(filter ?? []), ...added] : filter;
|
|
294
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/view/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,SAAS,mBAAmB,CAAC;AA8B1C,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/view/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,SAAS,mBAAmB,CAAC;AA8B1C,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAqetC,eAAO,MAAM,WAAW,EAAE,MAQzB,CAAC"}
|
package/dist/view/schema.js
CHANGED
|
@@ -203,6 +203,11 @@ const defs = {
|
|
|
203
203
|
tone: ref('Tone'),
|
|
204
204
|
input: ref('Input'),
|
|
205
205
|
prompt: { ...arrayOf(ref('Name'), 1), description: 'Input fields to ask for.' },
|
|
206
|
+
pick: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
description: 'Inputs drawn as a picker of the records of a collection of the extension (`prompt` names each); the id is the value.',
|
|
209
|
+
additionalProperties: ref('Name'),
|
|
210
|
+
},
|
|
206
211
|
confirm: ref('Text'),
|
|
207
212
|
when: ref('Conditions'),
|
|
208
213
|
busyWhen: {
|
|
@@ -221,17 +226,22 @@ const defs = {
|
|
|
221
226
|
],
|
|
222
227
|
},
|
|
223
228
|
Buttons: arrayOf(ref('Button'), 1),
|
|
224
|
-
FileHandoff: closed(
|
|
229
|
+
FileHandoff: closed('Stored files the caller hands the action, or its job (`$files`, ADR 0032 and 0052).', {
|
|
225
230
|
read: {
|
|
226
231
|
...ref('Value'),
|
|
227
232
|
description: "File ids the job may read, or a `file` field's value (its files' ids).",
|
|
228
233
|
},
|
|
234
|
+
prompt: closed('Asks the caller for one file: the front end uploads it as the caller and hands its id with `read` and as the input `input`.', { input: ref('Name'), label: ref('Text') }, ['input']),
|
|
229
235
|
write: closed('The one file the job may store.', { name: ref('Value'), maxBytes: ref('Value') }, ['name']),
|
|
230
236
|
}),
|
|
231
237
|
ListView: kind('list', 'Rows of a collection.', {
|
|
232
238
|
collection: ref('Name'),
|
|
233
239
|
fields: ref('Fields'),
|
|
234
240
|
filter: ref('Conditions'),
|
|
241
|
+
facets: {
|
|
242
|
+
...arrayOf(ref('Name'), 1),
|
|
243
|
+
description: 'Fields drawn as quick filters: "all" and one per declared choice (true and false for a boolean), one value per field at a time. Not persisted.',
|
|
244
|
+
},
|
|
235
245
|
sort: ref('Sort'),
|
|
236
246
|
search: { type: 'boolean' },
|
|
237
247
|
present: { enum: ['table', 'cards', 'feed'] },
|
|
@@ -257,7 +267,15 @@ const defs = {
|
|
|
257
267
|
},
|
|
258
268
|
...formProps,
|
|
259
269
|
}, ['collection']),
|
|
260
|
-
kind('form', "Fill an action's input; submitting runs the action.", {
|
|
270
|
+
kind('form', "Fill an action's input; submitting runs the action.", {
|
|
271
|
+
action: ref('ActionName'),
|
|
272
|
+
pick: {
|
|
273
|
+
type: 'object',
|
|
274
|
+
description: 'Inputs drawn as a picker of the records of a collection of the extension; the id is the value.',
|
|
275
|
+
additionalProperties: ref('Name'),
|
|
276
|
+
},
|
|
277
|
+
...formProps,
|
|
278
|
+
}, ['action']),
|
|
261
279
|
],
|
|
262
280
|
},
|
|
263
281
|
DetailView: kind('detail', 'One record, in panels.', {
|
|
@@ -322,7 +340,7 @@ const defs = {
|
|
|
322
340
|
TabsView: kind('tabs', 'Views as tabs.', { items: arrayOf(ref('View'), 1) }, ['items']),
|
|
323
341
|
View: { anyOf: VIEW_KINDS.map(ref) },
|
|
324
342
|
ActionResult: {
|
|
325
|
-
description: 'What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file` or `
|
|
343
|
+
description: 'What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file`, `reveal` or `redirect` is one of the closed forms; anything else is values.',
|
|
326
344
|
anyOf: [
|
|
327
345
|
closed('Opens a view (a navigation).', {
|
|
328
346
|
view: ref('ViewId'),
|
|
@@ -337,17 +355,23 @@ const defs = {
|
|
|
337
355
|
'file',
|
|
338
356
|
]),
|
|
339
357
|
closed('Shows a value once (a key, a secret).', { reveal: { type: 'string', minLength: 1 } }, ['reveal']),
|
|
358
|
+
closed('Sends the browser, top-level, to an https URL on a host the operator named for the extension (ADR 0061); the engine refuses any other.', { redirect: { type: 'string', pattern: '^https://' } }, ['redirect']),
|
|
340
359
|
ref('ActionValues'),
|
|
341
360
|
],
|
|
342
361
|
},
|
|
343
362
|
ActionValues: {
|
|
344
|
-
description: 'Values: a scalar, a list, or an object without `view`, `file` or `
|
|
363
|
+
description: 'Values: a scalar, a list, or an object without `view`, `file`, `reveal` or `redirect` (a form `recalc` merges an object of them).',
|
|
345
364
|
anyOf: [
|
|
346
365
|
{ type: ['string', 'number', 'boolean', 'null'] },
|
|
347
366
|
{ type: 'array', items: {} },
|
|
348
367
|
{
|
|
349
368
|
type: 'object',
|
|
350
|
-
properties: {
|
|
369
|
+
properties: {
|
|
370
|
+
view: { not: {} },
|
|
371
|
+
file: { not: {} },
|
|
372
|
+
reveal: { not: {} },
|
|
373
|
+
redirect: { not: {} },
|
|
374
|
+
},
|
|
351
375
|
},
|
|
352
376
|
],
|
|
353
377
|
},
|
|
@@ -71,6 +71,8 @@ export type Button = {
|
|
|
71
71
|
input?: Input;
|
|
72
72
|
/** Input fields to ask for. */
|
|
73
73
|
prompt?: Name[];
|
|
74
|
+
/** Inputs drawn as a picker of the records of a collection of the extension (`prompt` names each); the id is the value. */
|
|
75
|
+
pick?: Record<string, Name>;
|
|
74
76
|
confirm?: Text;
|
|
75
77
|
when?: Conditions;
|
|
76
78
|
/** While the record meets these, the work the action started is under way: the button is busy, and the front end reads the record again until it no longer does. */
|
|
@@ -86,10 +88,15 @@ export type Button = {
|
|
|
86
88
|
label?: Text;
|
|
87
89
|
};
|
|
88
90
|
export type Buttons = Button[];
|
|
89
|
-
/** Stored files the caller hands the action
|
|
91
|
+
/** Stored files the caller hands the action, or its job (`$files`, ADR 0032 and 0052). */
|
|
90
92
|
export type FileHandoff = {
|
|
91
93
|
/** File ids the job may read, or a `file` field's value (its files' ids). */
|
|
92
94
|
read?: Value;
|
|
95
|
+
/** Asks the caller for one file: the front end uploads it as the caller and hands its id with `read` and as the input `input`. */
|
|
96
|
+
prompt?: {
|
|
97
|
+
input: Name;
|
|
98
|
+
label?: Text;
|
|
99
|
+
};
|
|
93
100
|
/** The one file the job may store. */
|
|
94
101
|
write?: {
|
|
95
102
|
name: Value;
|
|
@@ -108,6 +115,8 @@ export type ListView = {
|
|
|
108
115
|
collection: Name;
|
|
109
116
|
fields?: Fields;
|
|
110
117
|
filter?: Conditions;
|
|
118
|
+
/** Fields drawn as quick filters: "all" and one per declared choice (true and false for a boolean), one value per field at a time. Not persisted. */
|
|
119
|
+
facets?: Name[];
|
|
111
120
|
sort?: Sort;
|
|
112
121
|
search?: boolean;
|
|
113
122
|
present?: 'table' | 'cards' | 'feed';
|
|
@@ -163,6 +172,8 @@ export type FormView = {
|
|
|
163
172
|
/** What a front end that does not know this view kind draws instead. */
|
|
164
173
|
fallback?: View;
|
|
165
174
|
action: ActionName;
|
|
175
|
+
/** Inputs drawn as a picker of the records of a collection of the extension; the id is the value. */
|
|
176
|
+
pick?: Record<string, Name>;
|
|
166
177
|
fields?: Fields;
|
|
167
178
|
sections?: Array<{
|
|
168
179
|
title?: Text;
|
|
@@ -317,7 +328,7 @@ export type TabsView = {
|
|
|
317
328
|
items: View[];
|
|
318
329
|
};
|
|
319
330
|
export type View = ListView | FormView | DetailView | BoardView | TimelineView | TreeView | MatrixView | MapView | StatView | SplitView | TabsView;
|
|
320
|
-
/** What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file` or `
|
|
331
|
+
/** What an action returns, as a front end reads it (ADR 0042 decision 4). An object with `view`, `file`, `reveal` or `redirect` is one of the closed forms; anything else is values. */
|
|
321
332
|
export type ActionResult = {
|
|
322
333
|
view: ViewId;
|
|
323
334
|
/** The parameters it is opened with (`$param`). */
|
|
@@ -328,12 +339,15 @@ export type ActionResult = {
|
|
|
328
339
|
file: string;
|
|
329
340
|
} | {
|
|
330
341
|
reveal: string;
|
|
342
|
+
} | {
|
|
343
|
+
redirect: string;
|
|
331
344
|
} | ActionValues;
|
|
332
|
-
/** Values: a scalar, a list, or an object without `view`, `file` or `
|
|
345
|
+
/** Values: a scalar, a list, or an object without `view`, `file`, `reveal` or `redirect` (a form `recalc` merges an object of them). */
|
|
333
346
|
export type ActionValues = string | number | boolean | null | unknown[] | {
|
|
334
347
|
view?: never;
|
|
335
348
|
file?: never;
|
|
336
349
|
reveal?: never;
|
|
350
|
+
redirect?: never;
|
|
337
351
|
[key: string]: unknown;
|
|
338
352
|
};
|
|
339
353
|
//# sourceMappingURL=types.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.generated.d.ts","sourceRoot":"","sources":["../../src/view/types.generated.ts"],"names":[],"mappings":"AAEA,kCAAkC;AAClC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,iGAAiG;AACjG,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,6CAA6C;AAC7C,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,iEAAiE;AACjE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,uDAAuD;AACvD,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC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": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"import": "./dist/view/index.js"
|
|
51
52
|
},
|
|
52
53
|
"./view/schema.json": "./schemas/view-2.schema.json",
|
|
54
|
+
"./manifest/schema.json": "./schemas/extension-manifest.schema.json",
|
|
53
55
|
"./offline": {
|
|
54
56
|
"types": "./dist/offline/index.d.ts",
|
|
55
57
|
"import": "./dist/offline/index.js"
|
|
@@ -67,14 +69,15 @@
|
|
|
67
69
|
"test": "bun test --preload ./src/tests/setup.ts"
|
|
68
70
|
},
|
|
69
71
|
"dependencies": {
|
|
70
|
-
"
|
|
72
|
+
"hono": "^4.13.18",
|
|
73
|
+
"idb": "^8.0.3",
|
|
74
|
+
"kysely": "^0.29.9",
|
|
75
|
+
"zod": "^4.6.7"
|
|
71
76
|
},
|
|
72
77
|
"devDependencies": {
|
|
73
78
|
"@testcontainers/postgresql": "^11.14.0",
|
|
74
79
|
"@types/pg": "^8.23.1",
|
|
75
80
|
"fake-indexeddb": "^6.2.5",
|
|
76
|
-
"hono": "^4.13.18",
|
|
77
|
-
"kysely": "^0.29.9",
|
|
78
81
|
"pg": "^8.23.1",
|
|
79
82
|
"typescript": "^6.0.3"
|
|
80
83
|
},
|