@mistriwork/engine 1.0.0-rc.64 → 1.0.0-rc.65
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 +8 -0
- package/dist/shared/frameworkWords.d.ts +26 -0
- package/dist/shared/frameworkWords.js +26 -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/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",
|
|
@@ -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",
|
|
@@ -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',
|
|
@@ -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.65",
|
|
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/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';
|