@mistriwork/engine 1.0.0-rc.64 → 1.0.0-rc.66
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/server/http/refusalReport.js +4 -1
- package/dist/server/migrate/cli.js +19 -0
- package/dist/shared/builtInThemes.js +10 -2
- package/dist/shared/form.d.ts +13 -0
- package/dist/shared/form.js +33 -1
- package/dist/shared/frameworkWords.d.ts +26 -0
- package/dist/shared/frameworkWords.js +26 -0
- package/dist/shared/lookPalettes.js +13 -4
- package/dist/shared/schema.d.ts +6 -0
- package/dist/shared/scopeCatalog.js +3 -0
- package/dist/shared/servedApp.d.ts +1 -0
- package/dist/shared/themeRecipeWords.d.ts +4 -0
- package/dist/shared/themeRecipeWords.js +4 -0
- package/dist/shared/themeRecipes.d.ts +4 -0
- package/dist/shared/themeRecipes.js +3 -0
- package/package.json +1 -1
- package/schema/model.d.ts +4 -0
- package/schema/theme.d.ts +4 -0
|
@@ -53,8 +53,11 @@ export function reportRefusal(req, status, code, heard, error, always = false) {
|
|
|
53
53
|
const span = currentSpan();
|
|
54
54
|
span?.setAttributes({ 'mistri.refusal.code': code ?? String(status), 'mistri.refusal.status': status });
|
|
55
55
|
span?.detail(() => ({ refusal: { status, ...(code ? { code } : {}), ...(heard ? { said: heard } : {}) }, because: reasons }));
|
|
56
|
+
/* The cause rides on the exported line as an attribute, beside the code: a deployment that reads its logs from a
|
|
57
|
+
collector, not a terminal, saw "Request refused (403)" and nothing of why (a field report). It is the innermost
|
|
58
|
+
reason, the one stderr leads with, already cut of link tokens; the full list stays in `detail`, local. */
|
|
56
59
|
log(status >= 500 ? 'error' : 'warn', 'refusal', `Request refused (${status}${code ? ` ${code}` : ''})`, {
|
|
57
|
-
attributes: { 'mistri.refusal.code': code, 'http.response.status_code': status },
|
|
60
|
+
attributes: { 'mistri.refusal.code': code, 'mistri.refusal.cause': reasons.at(-1), 'http.response.status_code': status },
|
|
58
61
|
detail: () => ({ said: heard, because: reasons }),
|
|
59
62
|
});
|
|
60
63
|
/* A refusal that said its rule (sayRefusal) is the operator's business too: a role or a policy that refuses
|
|
@@ -288,6 +288,25 @@ export async function runMigrate(argv, write = (line) => process.stdout.write(`$
|
|
|
288
288
|
write(`wrote ${shown(path)}`);
|
|
289
289
|
return EXIT.ok;
|
|
290
290
|
}
|
|
291
|
+
/* A database named on the command line beside one the run is bound to (--connection, or the connection the App
|
|
292
|
+
binds) was never the one migrated: the bound one wins, and a field report migrated its development database
|
|
293
|
+
twice while aiming at a copy. It is refused by name, rather than one of the two chosen quietly. */
|
|
294
|
+
const bound = connection ?? loaded?.binding?.connection;
|
|
295
|
+
if (argument !== undefined && !opts.targetFromEnvironment && bound !== undefined) {
|
|
296
|
+
const named = registry.configs().find((each) => each.id === bound || each.name === bound);
|
|
297
|
+
/* The same database written twice (the file the config names, or its URL) is one database, and runs. */
|
|
298
|
+
const file = named && registry.sqliteFile(named.id);
|
|
299
|
+
const same = named !== undefined &&
|
|
300
|
+
(named.id === argument ||
|
|
301
|
+
named.url === registry.configOf(argument)?.url ||
|
|
302
|
+
(file !== undefined && file === registry.sqliteFile(argument)));
|
|
303
|
+
if (!same) {
|
|
304
|
+
const by = connection !== undefined ? `--connection ${connection}` : `the App's connection "${bound}"`;
|
|
305
|
+
return fail(`${command} migrates one database and was given two: ${redact(opts.target)} and ${by}. ` +
|
|
306
|
+
`To migrate ${redact(opts.target)}, name it with --db alone (the migrations, no App) or in a --config's connection; ` +
|
|
307
|
+
`to migrate "${bound}", drop the path.`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
291
310
|
const target = await resolveTarget(registry, config, flags, appDir, loaded?.binding);
|
|
292
311
|
/* An App's own database is the App's to migrate (`--app`): the plan it carries out is the deployment, and the
|
|
293
312
|
connection is the one it binds. The database browser, and a run with no App, answer to the flag. */
|
|
@@ -125,6 +125,7 @@ export const THEME_PRESETS = [
|
|
|
125
125
|
"steps": "strip",
|
|
126
126
|
"lanes": "tag",
|
|
127
127
|
"header": "band",
|
|
128
|
+
"pane": "inset",
|
|
128
129
|
"filters": "solid",
|
|
129
130
|
"required": "star",
|
|
130
131
|
"formStep": "plain",
|
|
@@ -206,7 +207,7 @@ export const THEME_PRESETS = [
|
|
|
206
207
|
{
|
|
207
208
|
"id": "safety",
|
|
208
209
|
"label": "Safety orange",
|
|
209
|
-
"light": p("- - - - - - - - - #b33d0b #fdeee4 #
|
|
210
|
+
"light": p("- - - - - - - - - #b33d0b #fdeee4 #aa3600 #d4612a - - - - - #2d4fd6 - - - - #aa3600 - - #e8691f #2557e0 #9a6cf7 #0e9a6c #0e8fb0 #e0428a"),
|
|
210
211
|
"dark": p("- - - - - - - - - #ff9d66 #3b2112 #ffb88f #d8743a - - - - - #91a8ff - - - - #ffb88f - - #f07a32 #3559e6 - #12a678 #1597b9 #e0559b #c88317")
|
|
211
212
|
},
|
|
212
213
|
{
|
|
@@ -230,7 +231,7 @@ export const THEME_PRESETS = [
|
|
|
230
231
|
{
|
|
231
232
|
"id": "teal",
|
|
232
233
|
"label": "Teal",
|
|
233
|
-
"light": p("- - - - - - - - - #0b6f86 #e3f5f8 #
|
|
234
|
+
"light": p("- - - - - - - - - #0b6f86 #e3f5f8 #00687e #3c90a4 - - - - - #684fa2 - - - - #00687e - - #0e8fb0 #2557e0 #9a6cf7 #0e9a6c #d97706 #e0428a"),
|
|
234
235
|
"dark": p("- - - - - - - - - #4cc6db #0f3540 #79d6e6 #2a8a9c - - - - - #91a8ff - - - - #79d6e6 - - #0c8ab0 #3559e6 - #12a678 #c88317 #e0559b")
|
|
235
236
|
},
|
|
236
237
|
{
|
|
@@ -303,6 +304,7 @@ export const THEME_PRESETS = [
|
|
|
303
304
|
"steps": "strip",
|
|
304
305
|
"lanes": "tint",
|
|
305
306
|
"header": "plain",
|
|
307
|
+
"pane": "inset",
|
|
306
308
|
"filters": "quiet",
|
|
307
309
|
"required": "star",
|
|
308
310
|
"formStep": "plain",
|
|
@@ -443,6 +445,7 @@ export const THEME_PRESETS = [
|
|
|
443
445
|
"steps": "flat",
|
|
444
446
|
"lanes": "tint",
|
|
445
447
|
"header": "plain",
|
|
448
|
+
"pane": "inset",
|
|
446
449
|
"filters": "solid",
|
|
447
450
|
"required": "star",
|
|
448
451
|
"formStep": "plain",
|
|
@@ -584,6 +587,7 @@ export const THEME_PRESETS = [
|
|
|
584
587
|
"steps": "flat",
|
|
585
588
|
"lanes": "tint",
|
|
586
589
|
"header": "band",
|
|
590
|
+
"pane": "inset",
|
|
587
591
|
"filters": "solid",
|
|
588
592
|
"required": "star",
|
|
589
593
|
"formStep": "plain",
|
|
@@ -717,6 +721,7 @@ export const THEME_PRESETS = [
|
|
|
717
721
|
"steps": "strip",
|
|
718
722
|
"lanes": "plain",
|
|
719
723
|
"header": "plain",
|
|
724
|
+
"pane": "inset",
|
|
720
725
|
"filters": "solid",
|
|
721
726
|
"required": "star",
|
|
722
727
|
"formStep": "plain",
|
|
@@ -893,6 +898,7 @@ export const THEME_PRESETS = [
|
|
|
893
898
|
"steps": "strip",
|
|
894
899
|
"lanes": "plain",
|
|
895
900
|
"header": "plain",
|
|
901
|
+
"pane": "inset",
|
|
896
902
|
"filters": "quiet",
|
|
897
903
|
"required": "optional-word",
|
|
898
904
|
"formStep": "ruled",
|
|
@@ -1049,6 +1055,7 @@ export const THEME_PRESETS = [
|
|
|
1049
1055
|
"steps": "strip",
|
|
1050
1056
|
"lanes": "tag",
|
|
1051
1057
|
"header": "plain",
|
|
1058
|
+
"pane": "inset",
|
|
1052
1059
|
"filters": "solid",
|
|
1053
1060
|
"required": "star",
|
|
1054
1061
|
"formStep": "ruled",
|
|
@@ -1208,6 +1215,7 @@ export const THEME_PRESETS = [
|
|
|
1208
1215
|
"steps": "tinted",
|
|
1209
1216
|
"lanes": "tint",
|
|
1210
1217
|
"header": "plain",
|
|
1218
|
+
"pane": "inset",
|
|
1211
1219
|
"filters": "solid",
|
|
1212
1220
|
"required": "star",
|
|
1213
1221
|
"formStep": "plain",
|
package/dist/shared/form.d.ts
CHANGED
|
@@ -9,6 +9,19 @@ export declare function formShownFields(form: {
|
|
|
9
9
|
} | undefined): readonly string[] | undefined;
|
|
10
10
|
/** A single key that can be omitted because the catalog promises a value. */
|
|
11
11
|
export declare function autoKey(table: TableMeta): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* A single text key with nothing in the catalog to fill it — no identity, no default, no reference to another row —
|
|
14
|
+
* which a tenant App's store fills with a fresh UUID when a new row is given none (app/appAccess.ts), as the database
|
|
15
|
+
* fills an identity's: only where the table says so (`fillsKey`, set for a tenant-owned table whose key is not the
|
|
16
|
+
* natural key its `address` names, appKeyFill.ts). A tenant's opaque text key (tenantWriteSource.ts) is the common one:
|
|
17
|
+
* its New form never asks for it, since no person should invent a key, and before the store filled it the insert met
|
|
18
|
+
* NOT NULL (a field report). Anywhere else a key nothing fills is the form's to ask, and `mistri check` says so.
|
|
19
|
+
*/
|
|
20
|
+
export declare function filledKey(table: TableMeta): string | null;
|
|
21
|
+
/** The text key of a table nothing in the catalog fills: what `fillsKey` may be set on. */
|
|
22
|
+
export declare function fillableKey(table: TableMeta): string | null;
|
|
23
|
+
/** The key an App's New form leaves out: one the catalog promises (autoKey) or one its store fills (filledKey). */
|
|
24
|
+
export declare function appAssignedKey(table: TableMeta): string | null;
|
|
12
25
|
/** Omitting this column cannot rely on a database default or assigned key. */
|
|
13
26
|
export declare function isRequired(column: ColumnMeta, assigned: string | null): boolean;
|
|
14
27
|
/**
|
package/dist/shared/form.js
CHANGED
|
@@ -9,6 +9,37 @@ export function autoKey(table) {
|
|
|
9
9
|
const pk = table.columns.filter((c) => c.primaryKey);
|
|
10
10
|
return pk.length === 1 && (pk[0].identity || pk[0].default !== undefined || pk[0].hasDefault === true) ? pk[0].name : null;
|
|
11
11
|
}
|
|
12
|
+
/* Text a fresh UUID fits in: a bounded type only when it holds its 36 characters. */
|
|
13
|
+
const TEXT_KEY = /char|text|clob|string|uuid/i;
|
|
14
|
+
const fitsUuid = (type) => {
|
|
15
|
+
const bound = /\(\s*(\d+)\s*\)/.exec(type);
|
|
16
|
+
return !bound || Number(bound[1]) >= 36;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A single text key with nothing in the catalog to fill it — no identity, no default, no reference to another row —
|
|
20
|
+
* which a tenant App's store fills with a fresh UUID when a new row is given none (app/appAccess.ts), as the database
|
|
21
|
+
* fills an identity's: only where the table says so (`fillsKey`, set for a tenant-owned table whose key is not the
|
|
22
|
+
* natural key its `address` names, appKeyFill.ts). A tenant's opaque text key (tenantWriteSource.ts) is the common one:
|
|
23
|
+
* its New form never asks for it, since no person should invent a key, and before the store filled it the insert met
|
|
24
|
+
* NOT NULL (a field report). Anywhere else a key nothing fills is the form's to ask, and `mistri check` says so.
|
|
25
|
+
*/
|
|
26
|
+
export function filledKey(table) {
|
|
27
|
+
return table.fillsKey === true ? fillableKey(table) : null;
|
|
28
|
+
}
|
|
29
|
+
/** The text key of a table nothing in the catalog fills: what `fillsKey` may be set on. */
|
|
30
|
+
export function fillableKey(table) {
|
|
31
|
+
const pk = table.columns.filter((c) => c.primaryKey);
|
|
32
|
+
if (pk.length !== 1)
|
|
33
|
+
return null;
|
|
34
|
+
const [key] = pk;
|
|
35
|
+
const type = key.type ?? '';
|
|
36
|
+
const filled = !key.identity && key.default === undefined && key.hasDefault !== true && !key.references;
|
|
37
|
+
return filled && TEXT_KEY.test(type) && fitsUuid(type) ? key.name : null;
|
|
38
|
+
}
|
|
39
|
+
/** The key an App's New form leaves out: one the catalog promises (autoKey) or one its store fills (filledKey). */
|
|
40
|
+
export function appAssignedKey(table) {
|
|
41
|
+
return autoKey(table) ?? filledKey(table);
|
|
42
|
+
}
|
|
12
43
|
/** Omitting this column cannot rely on a database default or assigned key. */
|
|
13
44
|
export function isRequired(column, assigned) {
|
|
14
45
|
return !column.nullable && column.default === undefined && column.hasDefault !== true && !column.identity && column.name !== assigned;
|
|
@@ -21,7 +52,8 @@ export function isRequired(column, assigned) {
|
|
|
21
52
|
* cannot fill either.
|
|
22
53
|
*/
|
|
23
54
|
export function unformedColumns(table, writes) {
|
|
24
|
-
|
|
55
|
+
// Only an App's grants ask this, and an App's store fills a text key no grant writes (filledKey).
|
|
56
|
+
const assigned = appAssignedKey(table);
|
|
25
57
|
return table.columns.filter((column) => isRequired(column, assigned) && !writes(column.name)).map((column) => column.name);
|
|
26
58
|
}
|
|
27
59
|
/* Stamps of a row's own life, by their names: when it was entered, when it was last touched. */
|
|
@@ -19,6 +19,32 @@ export declare const FRAMEWORK_WORDS: {
|
|
|
19
19
|
readonly 'mistri.form.no': 'No';
|
|
20
20
|
readonly 'mistri.form.monthHint': 'MM/YYYY';
|
|
21
21
|
readonly 'mistri.form.timeHint': 'HH:MM';
|
|
22
|
+
readonly 'mistri.form.review': 'Review';
|
|
23
|
+
readonly 'mistri.form.reviewTitle': 'Review your answers';
|
|
24
|
+
readonly 'mistri.form.reviewLead': 'Check each section. Change anything that is not right.';
|
|
25
|
+
readonly 'mistri.form.change': 'Change';
|
|
26
|
+
readonly 'mistri.form.changeNamed': 'Change {label}';
|
|
27
|
+
readonly 'mistri.form.submit': 'Submit';
|
|
28
|
+
readonly 'mistri.form.checkBox': 'Check this box to continue.';
|
|
29
|
+
readonly 'mistri.form.notAccepted': 'This answer was not accepted. Check it and try again.';
|
|
30
|
+
readonly 'mistri.receipt.received': 'Received';
|
|
31
|
+
readonly 'mistri.receipt.keepReference': 'Keep this reference.';
|
|
32
|
+
readonly 'mistri.receipt.another': 'Fill in another';
|
|
33
|
+
readonly 'mistri.receipt.backTo': 'Back to {name}';
|
|
34
|
+
readonly 'mistri.refusal.unreachable': 'The form could not be sent. Check your connection and try again.';
|
|
35
|
+
readonly 'mistri.refusal.failed': 'The form could not be submitted ({status}).';
|
|
36
|
+
readonly 'mistri.refusal.tooMany': 'Too many submissions from this address. Try again in {retryAfter} seconds.';
|
|
37
|
+
readonly 'mistri.refusal.invalidInput': 'Some answers need another look.';
|
|
38
|
+
readonly 'mistri.refusal.version': 'This form has changed since the page was opened. Reload the page to continue.';
|
|
39
|
+
readonly 'mistri.refusal.notFound': 'What this form was about is no longer here. Reload the page to continue.';
|
|
40
|
+
readonly 'mistri.refusal.ineligible': 'This can’t be sent as it stands. Check your answers and try again.';
|
|
41
|
+
readonly 'mistri.refusal.forbidden': 'This form can’t be sent from this page. Reload it and try again.';
|
|
42
|
+
readonly 'mistri.refusal.keyReused': 'This was already sent with different answers. Reload the page to start again.';
|
|
43
|
+
readonly 'mistri.refusal.duplicate': 'Something with these details already exists.';
|
|
44
|
+
readonly 'mistri.refusal.stale': 'Something changed while you were filling this in. Reload the page and try again.';
|
|
45
|
+
readonly 'mistri.refusal.cancelled': 'It was not sent.';
|
|
46
|
+
readonly 'mistri.refusal.unavailable': 'It could not be sent just now. Try again in a moment; it will not be sent twice.';
|
|
47
|
+
readonly 'mistri.refusal.locked': 'Someone else is changing this record right now. Nothing was sent; try again in a moment.';
|
|
22
48
|
readonly 'mistri.status.offerEmail': 'We can email a code to the address on this application. It opens its details once, for 10 minutes.';
|
|
23
49
|
readonly 'mistri.status.offerText': 'We can send a code to the phone number on this application. It opens its details once, for 10 minutes.';
|
|
24
50
|
readonly 'mistri.status.askEmail': 'Email me a code';
|
|
@@ -19,6 +19,32 @@ export const FRAMEWORK_WORDS = {
|
|
|
19
19
|
'mistri.form.no': 'No',
|
|
20
20
|
'mistri.form.monthHint': 'MM/YYYY',
|
|
21
21
|
'mistri.form.timeHint': 'HH:MM',
|
|
22
|
+
'mistri.form.review': 'Review',
|
|
23
|
+
'mistri.form.reviewTitle': 'Review your answers',
|
|
24
|
+
'mistri.form.reviewLead': 'Check each section. Change anything that is not right.',
|
|
25
|
+
'mistri.form.change': 'Change',
|
|
26
|
+
'mistri.form.changeNamed': 'Change {label}',
|
|
27
|
+
'mistri.form.submit': 'Submit',
|
|
28
|
+
'mistri.form.checkBox': 'Check this box to continue.',
|
|
29
|
+
'mistri.form.notAccepted': 'This answer was not accepted. Check it and try again.',
|
|
30
|
+
'mistri.receipt.received': 'Received',
|
|
31
|
+
'mistri.receipt.keepReference': 'Keep this reference.',
|
|
32
|
+
'mistri.receipt.another': 'Fill in another',
|
|
33
|
+
'mistri.receipt.backTo': 'Back to {name}',
|
|
34
|
+
'mistri.refusal.unreachable': 'The form could not be sent. Check your connection and try again.',
|
|
35
|
+
'mistri.refusal.failed': 'The form could not be submitted ({status}).',
|
|
36
|
+
'mistri.refusal.tooMany': 'Too many submissions from this address. Try again in {retryAfter} seconds.',
|
|
37
|
+
'mistri.refusal.invalidInput': 'Some answers need another look.',
|
|
38
|
+
'mistri.refusal.version': 'This form has changed since the page was opened. Reload the page to continue.',
|
|
39
|
+
'mistri.refusal.notFound': 'What this form was about is no longer here. Reload the page to continue.',
|
|
40
|
+
'mistri.refusal.ineligible': 'This can’t be sent as it stands. Check your answers and try again.',
|
|
41
|
+
'mistri.refusal.forbidden': 'This form can’t be sent from this page. Reload it and try again.',
|
|
42
|
+
'mistri.refusal.keyReused': 'This was already sent with different answers. Reload the page to start again.',
|
|
43
|
+
'mistri.refusal.duplicate': 'Something with these details already exists.',
|
|
44
|
+
'mistri.refusal.stale': 'Something changed while you were filling this in. Reload the page and try again.',
|
|
45
|
+
'mistri.refusal.cancelled': 'It was not sent.',
|
|
46
|
+
'mistri.refusal.unavailable': 'It could not be sent just now. Try again in a moment; it will not be sent twice.',
|
|
47
|
+
'mistri.refusal.locked': 'Someone else is changing this record right now. Nothing was sent; try again in a moment.',
|
|
22
48
|
'mistri.status.offerEmail': 'We can email a code to the address on this application. It opens its details once, for 10 minutes.',
|
|
23
49
|
'mistri.status.offerText': 'We can send a code to the phone number on this application. It opens its details once, for 10 minutes.',
|
|
24
50
|
'mistri.status.askEmail': 'Email me a code',
|
|
@@ -30,8 +30,12 @@ export const LOOK_PALETTES = [
|
|
|
30
30
|
onSignal: '#15130f',
|
|
31
31
|
chart: '#f07a32',
|
|
32
32
|
},
|
|
33
|
-
/* Workshop's ring is its own deeper orange (a field report's theme, where the look began).
|
|
34
|
-
|
|
33
|
+
/* Workshop's ring is its own deeper orange (a field report's theme, where the look began). Lumen's pill menu
|
|
34
|
+
writes its current entry in the link on the hue's tint, 4.48:1 at the accent: its link is Workshop's. */
|
|
35
|
+
looks: {
|
|
36
|
+
workshop: { light: { accent: '#c9530b', link: '#aa3600' }, dark: { accent: '#e8742c' } },
|
|
37
|
+
lumen: { light: { link: '#aa3600' } },
|
|
38
|
+
},
|
|
35
39
|
},
|
|
36
40
|
{
|
|
37
41
|
id: 'amber',
|
|
@@ -99,8 +103,13 @@ export const LOOK_PALETTES = [
|
|
|
99
103
|
onSignal: '#15130f',
|
|
100
104
|
chart: '#0c8ab0',
|
|
101
105
|
},
|
|
102
|
-
/* A step deeper on Workshop's paper and on Atelier's, whose menu's hover is the warm ground a shade down
|
|
103
|
-
|
|
106
|
+
/* A step deeper on Workshop's paper and on Atelier's, whose menu's hover is the warm ground a shade down, and on
|
|
107
|
+
Lumen's, whose pill menu writes its current entry in the link on the hue's tint (4.43:1 at the accent). */
|
|
108
|
+
looks: {
|
|
109
|
+
workshop: { light: { link: '#00687e' } },
|
|
110
|
+
atelier: { light: { link: '#00687e' } },
|
|
111
|
+
lumen: { light: { link: '#00687e' } },
|
|
112
|
+
},
|
|
104
113
|
},
|
|
105
114
|
{
|
|
106
115
|
id: 'cobalt',
|
package/dist/shared/schema.d.ts
CHANGED
|
@@ -209,6 +209,12 @@ export interface TableMeta {
|
|
|
209
209
|
* new one. Absent elsewhere, AUTOINCREMENT and every other engine included.
|
|
210
210
|
*/
|
|
211
211
|
reusesKeys?: true;
|
|
212
|
+
/**
|
|
213
|
+
* Set on a tenant App's table (appKeyFill.ts) whose single text key the App's store fills with a fresh UUID when a new
|
|
214
|
+
* row is given none, as the database fills an identity's (filledKey in form.ts). Absent everywhere else: an App that
|
|
215
|
+
* is not tenant-owned, or a key a person types (its `address`), is never filled, and a form that leaves it off is refused.
|
|
216
|
+
*/
|
|
217
|
+
fillsKey?: true;
|
|
212
218
|
/** True for views — read-only, and worth saying so rather than surprising. */
|
|
213
219
|
isView: boolean;
|
|
214
220
|
/** An App's union (appUnions.ts): read by asking each branch it holds, never as a table. */
|
|
@@ -179,6 +179,7 @@ export function captureScopeCatalog(schema) {
|
|
|
179
179
|
'sortable',
|
|
180
180
|
'countable',
|
|
181
181
|
'reusesKeys',
|
|
182
|
+
'fillsKey',
|
|
182
183
|
]);
|
|
183
184
|
if (!identifier(table.id) ||
|
|
184
185
|
/* A catalog of several connections says which engine reads each table
|
|
@@ -259,6 +260,8 @@ export function captureScopeCatalog(schema) {
|
|
|
259
260
|
return refuse();
|
|
260
261
|
if (table.reusesKeys !== undefined && table.reusesKeys !== true)
|
|
261
262
|
return refuse();
|
|
263
|
+
if (table.fillsKey !== undefined && table.fillsKey !== true)
|
|
264
|
+
return refuse();
|
|
262
265
|
// Index advice, as `unique` is address evidence: only columns this table has.
|
|
263
266
|
if (table.trigram !== undefined &&
|
|
264
267
|
(!Array.isArray(table.trigram) ||
|
|
@@ -133,6 +133,10 @@ export declare const RECIPE_WORDS: {
|
|
|
133
133
|
readonly band: 'A record’s head and a list’s are one band of the raised ground from edge to edge: the trail, the title, its status, facts and verbs, a list’s tabs and filters; the contents keep their edge.';
|
|
134
134
|
readonly hero: 'A band, with the record’s avatar large beside its title (above it on a phone); a record without one, and a list, draw the band.';
|
|
135
135
|
};
|
|
136
|
+
readonly pane: {
|
|
137
|
+
readonly inset: 'A side-placed App’s room is a pane on the menu’s ground: inset from the window’s edge on the three sides the menu is not, a hairline round it and its corners rounded.';
|
|
138
|
+
readonly edge: 'A side-placed App’s room runs to the window’s right and bottom edges, square, with one hairline between it and the menu.';
|
|
139
|
+
};
|
|
136
140
|
readonly filters: {
|
|
137
141
|
readonly solid: 'A list’s filter not yet asked for is its name before a caret on a solid edge: a key, as the search beside it is.';
|
|
138
142
|
readonly dashed: 'The same key on a dashed hairline. No built-in look wears it: to people meeting a list it read as a place left empty.';
|
|
@@ -121,6 +121,10 @@ export const RECIPE_WORDS = {
|
|
|
121
121
|
band: 'A record’s head and a list’s are one band of the raised ground from edge to edge: the trail, the title, its status, facts and verbs, a list’s tabs and filters; the contents keep their edge.',
|
|
122
122
|
hero: 'A band, with the record’s avatar large beside its title (above it on a phone); a record without one, and a list, draw the band.',
|
|
123
123
|
},
|
|
124
|
+
pane: {
|
|
125
|
+
inset: 'A side-placed App’s room is a pane on the menu’s ground: inset from the window’s edge on the three sides the menu is not, a hairline round it and its corners rounded.',
|
|
126
|
+
edge: 'A side-placed App’s room runs to the window’s right and bottom edges, square, with one hairline between it and the menu.',
|
|
127
|
+
},
|
|
124
128
|
filters: {
|
|
125
129
|
solid: 'A list’s filter not yet asked for is its name before a caret on a solid edge: a key, as the search beside it is.',
|
|
126
130
|
dashed: 'The same key on a dashed hairline. No built-in look wears it: to people meeting a list it read as a place left empty.',
|
|
@@ -140,6 +140,10 @@ export declare const RECIPE_MENU: {
|
|
|
140
140
|
readonly band: null;
|
|
141
141
|
readonly hero: null;
|
|
142
142
|
};
|
|
143
|
+
readonly pane: {
|
|
144
|
+
readonly inset: null;
|
|
145
|
+
readonly edge: null;
|
|
146
|
+
};
|
|
143
147
|
readonly filters: {
|
|
144
148
|
readonly solid: null;
|
|
145
149
|
readonly dashed: null;
|
|
@@ -30,6 +30,9 @@ export const RECIPE_MENU = {
|
|
|
30
30
|
steps: { flat: null, tinted: 'lumen', strip: 'lumen' },
|
|
31
31
|
lanes: { tint: null, tag: 'brand', plain: 'brand' },
|
|
32
32
|
header: { plain: null, band: null, hero: null },
|
|
33
|
+
/* A side-placed App's room: a pane inset on the menu's ground, or running to the window's right and bottom edges.
|
|
34
|
+
Both are structure.css's, beside the pane they dress. */
|
|
35
|
+
pane: { inset: null, edge: null },
|
|
33
36
|
/* A list's filter not yet asked for: its own part, so a theme may keep its keyed or raised buttons and still pick the
|
|
34
37
|
adders' edge (Workshop keys them solid; Lumen's are quiet, as its raised buttons were). */
|
|
35
38
|
/* `solid` first: it is the default, drawn by the filter bar's own sheet. A dashed edge read as a place left empty. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistriwork/engine",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.66",
|
|
4
4
|
"description": "The engine both products stand on: the adapters (SQLite, Postgres), the catalog, the query language, keyset pages, the HTTP kit and the shared rules. No React.",
|
|
5
5
|
"homepage": "https://mistriwork.dev",
|
|
6
6
|
"bugs": {
|
package/schema/model.d.ts
CHANGED
|
@@ -79,6 +79,10 @@ export interface AppCommandChoice {
|
|
|
79
79
|
icon?: string;
|
|
80
80
|
/** A line under the label, on a card. */
|
|
81
81
|
help?: string;
|
|
82
|
+
/** Offered only where the tenant's profile holds this condition, as a field's `when` reads it:
|
|
83
|
+
`tenant.<column>` alone (`"tenant.country = 'IN'"`), shared through `auth.tenancy.shared`. Judged as the form
|
|
84
|
+
is prepared or a public form is served; a submitted withheld value is refused as no choice. */
|
|
85
|
+
when?: string;
|
|
82
86
|
/** Set by the server on a table's row it served (`source.served`): the columns its `where` compares, so the page
|
|
83
87
|
offers the rows the answers given match without a read of its own. Never written in an App. */
|
|
84
88
|
row?: Readonly<Record<string, string | number | boolean | null>>;
|
package/schema/theme.d.ts
CHANGED
|
@@ -339,6 +339,10 @@ export interface ThemeRecipes {
|
|
|
339
339
|
page's ground, on a band of the raised ground from edge to edge, or a band with the record's avatar large beside
|
|
340
340
|
its title. It paints the box the page placed: it never moves a region, adds to the head or reorders it. */
|
|
341
341
|
header?: 'plain' | 'band' | 'hero';
|
|
342
|
+
/** A side-placed App's room: a pane inset from the window's edge on the menu's ground, a hairline round it, or
|
|
343
|
+
running to the window's right and bottom edges with one hairline between it and the menu. A top-placed App's
|
|
344
|
+
room, a phone's and a bare page's already run to the edge. */
|
|
345
|
+
pane?: 'inset' | 'edge';
|
|
342
346
|
/** A list's filter not yet asked for ("+ Status"): on a dashed hairline, on a solid edge, or with no edge until a
|
|
343
347
|
pointer is over it. Its own part, so a theme picks it apart from its buttons. */
|
|
344
348
|
filters?: 'dashed' | 'solid' | 'quiet';
|