@mistriwork/engine 1.0.0-rc.67 → 1.0.0-rc.69

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.
@@ -163,7 +163,11 @@ export async function pageRoutes(post, hooks) {
163
163
  Read through the same scoped adapter, so a value the reader may not
164
164
  read is refused like any other read of it. */
165
165
  const likeColumns = [
166
- ...new Set(page.sections.flatMap((s) => (s.kind === 'list' && s.similar ? [...s.similar.same, ...Object.keys(s.similar.near ?? {})] : []))),
166
+ ...new Set(page.sections.flatMap((s) => s.kind === 'list' && s.similar
167
+ ? [...s.similar.same, ...Object.keys(s.similar.near ?? {})]
168
+ : s.kind === 'custom'
169
+ ? Object.values(s.reads ?? {}).flatMap((read) => read.similar?.same ?? [])
170
+ : [])),
167
171
  ];
168
172
  let rootValues;
169
173
  if (likeColumns.length) {
@@ -41,7 +41,7 @@ export declare const MAX_CUSTOM_READS = 8;
41
41
  */
42
42
  export declare const MAX_CUSTOM_FIGURES = 8;
43
43
  /** The keys a declared read of rows takes, on a page and on a dashboard. */
44
- export declare const PAGE_READ_KEYS: readonly ['from', 'whose', 'query', 'show', 'sort', 'limit'];
44
+ export declare const PAGE_READ_KEYS: readonly ['from', 'whose', 'same', 'query', 'show', 'sort', 'limit'];
45
45
  export declare const DASH_READ_KEYS: readonly ['from', 'query', 'show', 'sort', 'limit', 'over'];
46
46
  /**
47
47
  * What a total measures: the breakdown grammar's aggregates over one column of the resource (count takes none, and
@@ -69,6 +69,10 @@ export interface PageCustomRead {
69
69
  from: string;
70
70
  /** Config `whose`: the path from `from` back to the page's record. Absent, the rows are not tied to it. */
71
71
  path?: string;
72
+ /** Config `same`: the rows that share these columns' values with the record (as a related list's `same`), the record left out. */
73
+ similar?: {
74
+ same: string[];
75
+ };
72
76
  filter?: string;
73
77
  columns: string[];
74
78
  /** Query-bar text, as authored; `orderBy` is what the planner runs. */
@@ -46,7 +46,7 @@ const MAX_CUSTOM_LIST_SHOW = 32;
46
46
  */
47
47
  export const MAX_CUSTOM_FIGURES = 8;
48
48
  /** The keys a declared read of rows takes, on a page and on a dashboard. */
49
- export const PAGE_READ_KEYS = ['from', 'whose', 'query', 'show', 'sort', 'limit'];
49
+ export const PAGE_READ_KEYS = ['from', 'whose', 'same', 'query', 'show', 'sort', 'limit'];
50
50
  export const DASH_READ_KEYS = ['from', 'query', 'show', 'sort', 'limit', 'over'];
51
51
  /** The keys a declared aggregate read takes, on a page and on a dashboard. */
52
52
  const PAGE_TOTAL_KEYS = ['from', 'measure', 'by', 'whose', 'query', 'limit'];
@@ -245,9 +245,23 @@ function reads(raw, at, one, { key = 'rows', most = MAX_CUSTOM_READS, noun = 're
245
245
  export function parsePageReads(raw, at) {
246
246
  return reads(raw, at, (entry, here) => {
247
247
  const r = readShape(entry, here, PAGE_READ_KEYS);
248
+ let similar;
249
+ if (r.same !== undefined) {
250
+ if (r.whose !== undefined)
251
+ throw new Error(`${here} has "whose" beside "same": its rows share the record's values rather than point at it.`);
252
+ const same = r.same;
253
+ if (!Array.isArray(same) ||
254
+ !same.length ||
255
+ same.length > 4 ||
256
+ same.some((column) => typeof column !== 'string' || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(column)) ||
257
+ new Set(same).size !== same.length)
258
+ throw new Error(`${here}: "same" must be one to 4 different columns a row shares with the record, e.g. ['body_type'].`);
259
+ similar = { same: [...same] };
260
+ }
248
261
  return {
249
262
  from: r.from.trim(),
250
263
  ...(r.whose === undefined ? {} : { path: r.whose.trim() }),
264
+ ...(similar ? { similar } : {}),
251
265
  ...(r.query === undefined ? {} : { filter: r.query.trim() }),
252
266
  columns: r.show.map((path) => path.trim()),
253
267
  ...(r.sort === undefined ? {} : { sort: r.sort.trim() }),
@@ -361,8 +375,8 @@ export function parseCustomList(raw, at) {
361
375
  throw new Error(`${at} names one column twice in "show".`);
362
376
  return { kind: 'custom', component, show: columns, props: componentPropValues(component, raw.props, at) };
363
377
  }
364
- /** The most address parameters one page keeps, and the most loaders it names. */
365
- const MAX_PAGE_PARAMS = 8;
378
+ /** The most address parameters one page keeps, and the most loaders it names. A filter bar of a dozen fields is a real page; the address stays well inside a URL's length at 24 short names. */
379
+ const MAX_PAGE_PARAMS = 24;
366
380
  const MAX_PAGE_LOADERS = 8;
367
381
  const PARAM = /^[a-z][a-z0-9_]{0,31}$/;
368
382
  const LOADER = /^[A-Za-z][A-Za-z0-9_]{0,63}$/;
@@ -10,7 +10,6 @@ import { nearest } from './suggest.js';
10
10
  const AREA_NAME = /^[a-z][a-z0-9-]{0,23}$/;
11
11
  /** Words CSS reads before an area name: `grid-area: span` or `auto` is not a name. */
12
12
  const CSS_WORDS = new Set(['auto', 'span', 'initial', 'inherit', 'unset', 'revert', 'default']);
13
- const LAYOUT_MAX_ROWS = 8;
14
13
  const LAYOUT_MAX_COLUMNS = 4;
15
14
  /** The cell that holds no area. */
16
15
  const EMPTY_CELL = '.';
@@ -64,8 +63,6 @@ export function layoutProblems(layout, at) {
64
63
  return [`${here} is not a list of rows, each a string of area names: ['kpis kpis', 'trend side'].`];
65
64
  }
66
65
  const problems = [];
67
- if (layout.length > LAYOUT_MAX_ROWS)
68
- problems.push(`${here} has ${layout.length} rows. At most ${LAYOUT_MAX_ROWS}.`);
69
66
  const grid = layoutGrid(layout);
70
67
  const widest = Math.max(...grid.map((row) => row.length));
71
68
  if (grid.some((row) => !row.length))
@@ -1,11 +1,13 @@
1
1
  /**
2
- * The fixed words the platform says on an App's command and public forms, which the App's own catalog may say instead
2
+ * The fixed words the platform says on an App's command and public forms, its status check and a capability link's
3
+ * page, which the App's own catalog may say instead
3
4
  * (`messages/<locale>.ts`, a `mistri.*` key). Without them an App translated into Spanish still said "Step 2 of 3",
4
5
  * "Back" and "(optional)" in English around its own words. Each key's English is what the platform says when the
5
6
  * App's catalog has no word for it in the reader's language, so a key is opt-in and an App without one changes
6
7
  * nothing. The server checks an App's `mistri.*` keys against this table (server/app/appMessages.ts readCatalogs)
7
8
  * and serves the ones it has, in the reader's words, as plain `{name}` templates (`words`); the client says them in
8
- * place of its own (`appWord`, kit client/messages.ts).
9
+ * place of its own (`appWord`, kit client/messages.ts); the link page is drawn on the server from the same words.
10
+ * The platform says each in Spanish too (frameworkWordsEs.ts).
9
11
  */
10
12
  export declare const FRAMEWORK_WORDS: {
11
13
  readonly 'mistri.form.step': 'Step {step} of {count}';
@@ -53,6 +55,68 @@ export declare const FRAMEWORK_WORDS: {
53
55
  readonly 'mistri.status.sentText': 'We sent a code by text message.';
54
56
  readonly 'mistri.status.codeEmail': 'Code from the email';
55
57
  readonly 'mistri.status.codeText': 'Code from the message';
58
+ readonly 'mistri.status.sendAnother': 'Send another code';
59
+ readonly 'mistri.status.signIn': 'Sign in';
60
+ readonly 'mistri.status.moreDetails': 'More details';
61
+ readonly 'mistri.status.showDetails': 'Show details';
62
+ readonly 'mistri.status.confirmAccountEmail': 'Confirm your account’s email with the link we sent you, and applications submitted with it are found here.';
63
+ readonly 'mistri.status.added': 'Added to your account, submitted with your email: {linked}.';
64
+ readonly 'mistri.status.foundOne': 'We found 1 application submitted with this email — is this yours?';
65
+ readonly 'mistri.status.foundMany': 'We found {openCount} applications submitted with this email — are these yours?';
66
+ readonly 'mistri.status.sayYesToOne': 'Say yes only to one you made: it is added to your account, where its status is shown.';
67
+ readonly 'mistri.status.mine': 'Yes, it’s mine';
68
+ readonly 'mistri.status.reference': 'Reference';
69
+ readonly 'mistri.status.enter': 'Enter your {label}.';
70
+ readonly 'mistri.status.nowInAccount': '{reference} is now in your account.';
71
+ readonly 'mistri.status.title': 'Check your application';
72
+ readonly 'mistri.status.lead': '{label}: enter the reference you were given and the details below. Only its status is shown.';
73
+ readonly 'mistri.status.yours': 'Your applications';
74
+ readonly 'mistri.status.check': 'Check status';
75
+ readonly 'mistri.status.signInToFollow': 'Sign in to add it to your account and follow it there.';
76
+ readonly 'mistri.status.addToAccount': 'Add to my account';
77
+ readonly 'mistri.saved.notShown': 'Saved — not shown for your privacy';
78
+ readonly 'mistri.saved.restarted': 'This application can no longer be continued, so it has been started again from the first step.';
79
+ readonly 'mistri.saved.confirmEmail': 'Confirm your email';
80
+ readonly 'mistri.saved.emailConfirmed': '{email} is confirmed. An account with this email will find your application.';
81
+ readonly 'mistri.saved.confirmEmailOffer': 'Optional. We email a code to your address; confirming it lets an account with this email find the application straight away.';
82
+ readonly 'mistri.saved.confirm': 'Confirm';
83
+ readonly 'mistri.saved.saveStepFirst': 'Save this step before you submit.';
84
+ readonly 'mistri.saved.follow': 'Follow it in an account';
85
+ readonly 'mistri.saved.claimClosed': 'This browser can no longer add the application to an account.';
86
+ readonly 'mistri.saved.claimWindow': 'For the next 30 minutes, this browser can add the application to an account, where its status is shown.';
87
+ readonly 'mistri.saved.createAccount': 'Create an account to track this';
88
+ readonly 'mistri.saved.signInToAdd': 'Sign in to add it';
89
+ readonly 'mistri.saved.sharedDevice': 'This is a shared device';
90
+ readonly 'mistri.saved.checkStatus': 'Check its status';
91
+ readonly 'mistri.saved.anyTime': 'any time with your reference.';
92
+ readonly 'mistri.saved.notSaved': 'Not saved yet';
93
+ readonly 'mistri.saved.resumed': 'Your application is saved. Carry on where you left off; what you saved is not shown again.';
94
+ readonly 'mistri.saved.eachStep': 'Each step is saved as you go. We don’t show your details back to you; keep this tab open to review them before you submit.';
95
+ readonly 'mistri.saved.startOver': 'Start over';
96
+ readonly 'mistri.saved.notSettled': 'Your submission was sent and its result is not known yet. Submit again to find out how it ended.';
97
+ readonly 'mistri.saved.draftShort': 'Your draft is saved.';
98
+ readonly 'mistri.saved.draft': 'Your draft is saved. Carry on where you left off, or start over.';
99
+ readonly 'mistri.saved.earlier': 'Saved earlier';
100
+ readonly 'mistri.saved.changedElsewhere': 'This draft changed somewhere else. Review it again before you submit.';
101
+ readonly 'mistri.saved.reviewNotRead': 'Your answers could not be read back for review. Submit again in a moment.';
102
+ readonly 'mistri.saved.reviewNotReady': 'Your answers are still being read back for review. Submit again in a moment.';
103
+ readonly 'mistri.saved.checking': 'Checking for an application in progress…';
104
+ readonly 'mistri.link.miss': 'This link opens nothing.';
105
+ readonly 'mistri.link.confirmLead': 'To see this, first confirm a detail only you would know.';
106
+ readonly 'mistri.link.continue': 'Continue';
107
+ readonly 'mistri.link.offerEmail': 'To see this, we email a code to the address on file.';
108
+ readonly 'mistri.link.offerText': 'To see this, we send a code to the number on file.';
109
+ readonly 'mistri.link.askEmail': 'Email me a code';
110
+ readonly 'mistri.link.askText': 'Send me a code';
111
+ readonly 'mistri.link.sentEmail': 'If the address on file takes mail, a code is on its way. It works for ten minutes.';
112
+ readonly 'mistri.link.sentText': 'If the number on file takes messages, a code is on its way. It works for ten minutes.';
113
+ readonly 'mistri.link.code': 'Code';
114
+ readonly 'mistri.link.choose': 'Choose…';
115
+ readonly 'mistri.link.failed': 'That did not work. Try again.';
116
+ readonly 'mistri.link.notNow': 'This cannot be done now.';
117
+ readonly 'mistri.link.loading': 'This page is still loading. Try again in a moment.';
118
+ readonly 'mistri.link.done': 'Done.';
119
+ readonly 'mistri.language': 'Language';
56
120
  };
57
121
  export type FrameworkWordKey = keyof typeof FRAMEWORK_WORDS;
58
122
  /** A catalog key the platform reserves: an App's catalog may say it only as one of FRAMEWORK_WORDS. */
@@ -1,11 +1,13 @@
1
1
  /**
2
- * The fixed words the platform says on an App's command and public forms, which the App's own catalog may say instead
2
+ * The fixed words the platform says on an App's command and public forms, its status check and a capability link's
3
+ * page, which the App's own catalog may say instead
3
4
  * (`messages/<locale>.ts`, a `mistri.*` key). Without them an App translated into Spanish still said "Step 2 of 3",
4
5
  * "Back" and "(optional)" in English around its own words. Each key's English is what the platform says when the
5
6
  * App's catalog has no word for it in the reader's language, so a key is opt-in and an App without one changes
6
7
  * nothing. The server checks an App's `mistri.*` keys against this table (server/app/appMessages.ts readCatalogs)
7
8
  * and serves the ones it has, in the reader's words, as plain `{name}` templates (`words`); the client says them in
8
- * place of its own (`appWord`, kit client/messages.ts).
9
+ * place of its own (`appWord`, kit client/messages.ts); the link page is drawn on the server from the same words.
10
+ * The platform says each in Spanish too (frameworkWordsEs.ts).
9
11
  */
10
12
  export const FRAMEWORK_WORDS = {
11
13
  'mistri.form.step': 'Step {step} of {count}',
@@ -53,6 +55,68 @@ export const FRAMEWORK_WORDS = {
53
55
  'mistri.status.sentText': 'We sent a code by text message.',
54
56
  'mistri.status.codeEmail': 'Code from the email',
55
57
  'mistri.status.codeText': 'Code from the message',
58
+ 'mistri.status.sendAnother': 'Send another code',
59
+ 'mistri.status.signIn': 'Sign in',
60
+ 'mistri.status.moreDetails': 'More details',
61
+ 'mistri.status.showDetails': 'Show details',
62
+ 'mistri.status.confirmAccountEmail': 'Confirm your account’s email with the link we sent you, and applications submitted with it are found here.',
63
+ 'mistri.status.added': 'Added to your account, submitted with your email: {linked}.',
64
+ 'mistri.status.foundOne': 'We found 1 application submitted with this email — is this yours?',
65
+ 'mistri.status.foundMany': 'We found {openCount} applications submitted with this email — are these yours?',
66
+ 'mistri.status.sayYesToOne': 'Say yes only to one you made: it is added to your account, where its status is shown.',
67
+ 'mistri.status.mine': 'Yes, it’s mine',
68
+ 'mistri.status.reference': 'Reference',
69
+ 'mistri.status.enter': 'Enter your {label}.',
70
+ 'mistri.status.nowInAccount': '{reference} is now in your account.',
71
+ 'mistri.status.title': 'Check your application',
72
+ 'mistri.status.lead': '{label}: enter the reference you were given and the details below. Only its status is shown.',
73
+ 'mistri.status.yours': 'Your applications',
74
+ 'mistri.status.check': 'Check status',
75
+ 'mistri.status.signInToFollow': 'Sign in to add it to your account and follow it there.',
76
+ 'mistri.status.addToAccount': 'Add to my account',
77
+ 'mistri.saved.notShown': 'Saved — not shown for your privacy',
78
+ 'mistri.saved.restarted': 'This application can no longer be continued, so it has been started again from the first step.',
79
+ 'mistri.saved.confirmEmail': 'Confirm your email',
80
+ 'mistri.saved.emailConfirmed': '{email} is confirmed. An account with this email will find your application.',
81
+ 'mistri.saved.confirmEmailOffer': 'Optional. We email a code to your address; confirming it lets an account with this email find the application straight away.',
82
+ 'mistri.saved.confirm': 'Confirm',
83
+ 'mistri.saved.saveStepFirst': 'Save this step before you submit.',
84
+ 'mistri.saved.follow': 'Follow it in an account',
85
+ 'mistri.saved.claimClosed': 'This browser can no longer add the application to an account.',
86
+ 'mistri.saved.claimWindow': 'For the next 30 minutes, this browser can add the application to an account, where its status is shown.',
87
+ 'mistri.saved.createAccount': 'Create an account to track this',
88
+ 'mistri.saved.signInToAdd': 'Sign in to add it',
89
+ 'mistri.saved.sharedDevice': 'This is a shared device',
90
+ 'mistri.saved.checkStatus': 'Check its status',
91
+ 'mistri.saved.anyTime': 'any time with your reference.',
92
+ 'mistri.saved.notSaved': 'Not saved yet',
93
+ 'mistri.saved.resumed': 'Your application is saved. Carry on where you left off; what you saved is not shown again.',
94
+ 'mistri.saved.eachStep': 'Each step is saved as you go. We don’t show your details back to you; keep this tab open to review them before you submit.',
95
+ 'mistri.saved.startOver': 'Start over',
96
+ 'mistri.saved.notSettled': 'Your submission was sent and its result is not known yet. Submit again to find out how it ended.',
97
+ 'mistri.saved.draftShort': 'Your draft is saved.',
98
+ 'mistri.saved.draft': 'Your draft is saved. Carry on where you left off, or start over.',
99
+ 'mistri.saved.earlier': 'Saved earlier',
100
+ 'mistri.saved.changedElsewhere': 'This draft changed somewhere else. Review it again before you submit.',
101
+ 'mistri.saved.reviewNotRead': 'Your answers could not be read back for review. Submit again in a moment.',
102
+ 'mistri.saved.reviewNotReady': 'Your answers are still being read back for review. Submit again in a moment.',
103
+ 'mistri.saved.checking': 'Checking for an application in progress…',
104
+ 'mistri.link.miss': 'This link opens nothing.',
105
+ 'mistri.link.confirmLead': 'To see this, first confirm a detail only you would know.',
106
+ 'mistri.link.continue': 'Continue',
107
+ 'mistri.link.offerEmail': 'To see this, we email a code to the address on file.',
108
+ 'mistri.link.offerText': 'To see this, we send a code to the number on file.',
109
+ 'mistri.link.askEmail': 'Email me a code',
110
+ 'mistri.link.askText': 'Send me a code',
111
+ 'mistri.link.sentEmail': 'If the address on file takes mail, a code is on its way. It works for ten minutes.',
112
+ 'mistri.link.sentText': 'If the number on file takes messages, a code is on its way. It works for ten minutes.',
113
+ 'mistri.link.code': 'Code',
114
+ 'mistri.link.choose': 'Choose…',
115
+ 'mistri.link.failed': 'That did not work. Try again.',
116
+ 'mistri.link.notNow': 'This cannot be done now.',
117
+ 'mistri.link.loading': 'This page is still loading. Try again in a moment.',
118
+ 'mistri.link.done': 'Done.',
119
+ 'mistri.language': 'Language',
56
120
  };
57
121
  /** A catalog key the platform reserves: an App's catalog may say it only as one of FRAMEWORK_WORDS. */
58
122
  export const isFrameworkWordKey = (key) => key.startsWith('mistri.');
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The platform's own Spanish for its framework words (frameworkWords.ts). An App with a Spanish catalog is said in
3
+ * Spanish around its own words without writing any `mistri.*` key: the server fills each word the catalog leaves out
4
+ * from here (server/app/appMessages.ts frameworkWords), and an App's own word still wins. Server-side only, so no
5
+ * page carries the table; the browser is served the words it draws, as it is the App's. Complete by type, so a word
6
+ * added in English cannot ship without its Spanish.
7
+ */
8
+ import type { FrameworkWordKey } from './frameworkWords.js';
9
+ export declare const FRAMEWORK_WORDS_ES: Readonly<Record<FrameworkWordKey, string>>;
@@ -0,0 +1,109 @@
1
+ export const FRAMEWORK_WORDS_ES = Object.freeze({
2
+ 'mistri.form.step': 'Paso {step} de {count}',
3
+ 'mistri.form.stepNamed': 'Paso {step} de {count}: {label}',
4
+ 'mistri.form.back': 'Atrás',
5
+ 'mistri.form.optional': '(opcional)',
6
+ 'mistri.form.required': '(obligatorio)',
7
+ 'mistri.form.reference': 'Tu referencia',
8
+ 'mistri.form.signAgain': 'Firmar de nuevo',
9
+ 'mistri.form.yes': 'Sí',
10
+ 'mistri.form.no': 'No',
11
+ 'mistri.form.monthHint': 'MM/AAAA',
12
+ 'mistri.form.timeHint': 'HH:MM',
13
+ 'mistri.form.review': 'Revisar',
14
+ 'mistri.form.reviewTitle': 'Revisa tus respuestas',
15
+ 'mistri.form.reviewLead': 'Revisa cada sección. Cambia lo que no esté bien.',
16
+ 'mistri.form.change': 'Cambiar',
17
+ 'mistri.form.changeNamed': 'Cambiar {label}',
18
+ 'mistri.form.submit': 'Enviar',
19
+ 'mistri.form.checkBox': 'Marca esta casilla para continuar.',
20
+ 'mistri.form.notAccepted': 'Esta respuesta no se aceptó. Revísala e inténtalo de nuevo.',
21
+ 'mistri.receipt.received': 'Recibido',
22
+ 'mistri.receipt.keepReference': 'Guarda esta referencia.',
23
+ 'mistri.receipt.another': 'Llenar otro',
24
+ 'mistri.receipt.backTo': 'Volver a {name}',
25
+ 'mistri.refusal.unreachable': 'No se pudo enviar el formulario. Revisa tu conexión e inténtalo de nuevo.',
26
+ 'mistri.refusal.failed': 'No se pudo enviar el formulario ({status}).',
27
+ 'mistri.refusal.tooMany': 'Demasiados envíos desde esta dirección. Inténtalo de nuevo en {retryAfter} segundos.',
28
+ 'mistri.refusal.invalidInput': 'Algunas respuestas necesitan otra revisión.',
29
+ 'mistri.refusal.version': 'Este formulario cambió desde que se abrió la página. Vuelve a cargar la página para continuar.',
30
+ 'mistri.refusal.notFound': 'Aquello de lo que trataba este formulario ya no está. Vuelve a cargar la página para continuar.',
31
+ 'mistri.refusal.ineligible': 'No se puede enviar tal como está. Revisa tus respuestas e inténtalo de nuevo.',
32
+ 'mistri.refusal.forbidden': 'Este formulario no se puede enviar desde esta página. Vuelve a cargarla e inténtalo de nuevo.',
33
+ 'mistri.refusal.keyReused': 'Esto ya se envió con otras respuestas. Vuelve a cargar la página para empezar de nuevo.',
34
+ 'mistri.refusal.duplicate': 'Ya existe algo con estos datos.',
35
+ 'mistri.refusal.stale': 'Algo cambió mientras lo llenabas. Vuelve a cargar la página e inténtalo de nuevo.',
36
+ 'mistri.refusal.cancelled': 'No se envió.',
37
+ 'mistri.refusal.unavailable': 'No se pudo enviar en este momento. Inténtalo de nuevo en un momento; no se enviará dos veces.',
38
+ 'mistri.refusal.locked': 'Otra persona está cambiando este registro ahora. No se envió nada; inténtalo de nuevo en un momento.',
39
+ 'mistri.status.offerEmail': 'Podemos enviar un código por correo a la dirección de esta solicitud. Abre sus detalles una vez, durante 10 minutos.',
40
+ 'mistri.status.offerText': 'Podemos enviar un código al teléfono de esta solicitud. Abre sus detalles una vez, durante 10 minutos.',
41
+ 'mistri.status.askEmail': 'Envíame un código por correo',
42
+ 'mistri.status.askText': 'Envíame un código',
43
+ 'mistri.status.sentEmail': 'Enviamos un código a tu correo.',
44
+ 'mistri.status.sentText': 'Enviamos un código por mensaje de texto.',
45
+ 'mistri.status.codeEmail': 'Código del correo',
46
+ 'mistri.status.codeText': 'Código del mensaje',
47
+ 'mistri.status.sendAnother': 'Enviar otro código',
48
+ 'mistri.status.signIn': 'Iniciar sesión',
49
+ 'mistri.status.moreDetails': 'Más detalles',
50
+ 'mistri.status.showDetails': 'Mostrar detalles',
51
+ 'mistri.status.confirmAccountEmail': 'Confirma el correo de tu cuenta con el enlace que te enviamos, y aquí aparecerán las solicitudes enviadas con él.',
52
+ 'mistri.status.added': 'Se agregó a tu cuenta, enviada con tu correo: {linked}.',
53
+ 'mistri.status.foundOne': 'Encontramos 1 solicitud enviada con este correo. ¿Es tuya?',
54
+ 'mistri.status.foundMany': 'Encontramos {openCount} solicitudes enviadas con este correo. ¿Son tuyas?',
55
+ 'mistri.status.sayYesToOne': 'Di que sí solo a una que hayas hecho: se agrega a tu cuenta, donde se muestra su estado.',
56
+ 'mistri.status.mine': 'Sí, es mía',
57
+ 'mistri.status.reference': 'Referencia',
58
+ 'mistri.status.enter': 'Escribe tu {label}.',
59
+ 'mistri.status.nowInAccount': '{reference} ya está en tu cuenta.',
60
+ 'mistri.status.title': 'Consulta tu solicitud',
61
+ 'mistri.status.lead': '{label}: escribe la referencia que te dieron y los datos de abajo. Solo se muestra su estado.',
62
+ 'mistri.status.yours': 'Tus solicitudes',
63
+ 'mistri.status.check': 'Consultar estado',
64
+ 'mistri.status.signInToFollow': 'Inicia sesión para agregarla a tu cuenta y seguirla ahí.',
65
+ 'mistri.status.addToAccount': 'Agregar a mi cuenta',
66
+ 'mistri.saved.notShown': 'Guardado; no se muestra por tu privacidad',
67
+ 'mistri.saved.restarted': 'Esta solicitud ya no se puede continuar, así que empezó de nuevo desde el primer paso.',
68
+ 'mistri.saved.confirmEmail': 'Confirma tu correo',
69
+ 'mistri.saved.emailConfirmed': '{email} está confirmado. Una cuenta con este correo encontrará tu solicitud.',
70
+ 'mistri.saved.confirmEmailOffer': 'Opcional. Te enviamos un código por correo; al confirmarlo, una cuenta con este correo encuentra la solicitud de inmediato.',
71
+ 'mistri.saved.confirm': 'Confirmar',
72
+ 'mistri.saved.saveStepFirst': 'Guarda este paso antes de enviar.',
73
+ 'mistri.saved.follow': 'Síguela en una cuenta',
74
+ 'mistri.saved.claimClosed': 'Este navegador ya no puede agregar la solicitud a una cuenta.',
75
+ 'mistri.saved.claimWindow': 'Durante los próximos 30 minutos, este navegador puede agregar la solicitud a una cuenta, donde se muestra su estado.',
76
+ 'mistri.saved.createAccount': 'Crea una cuenta para seguirla',
77
+ 'mistri.saved.signInToAdd': 'Inicia sesión para agregarla',
78
+ 'mistri.saved.sharedDevice': 'Este es un dispositivo compartido',
79
+ 'mistri.saved.checkStatus': 'Consulta su estado',
80
+ 'mistri.saved.anyTime': 'en cualquier momento con tu referencia.',
81
+ 'mistri.saved.notSaved': 'Aún no se guarda',
82
+ 'mistri.saved.resumed': 'Tu solicitud está guardada. Continúa donde la dejaste; lo que guardaste no se vuelve a mostrar.',
83
+ 'mistri.saved.eachStep': 'Cada paso se guarda sobre la marcha. No te volvemos a mostrar tus datos; deja esta pestaña abierta para revisarlos antes de enviar.',
84
+ 'mistri.saved.startOver': 'Empezar de nuevo',
85
+ 'mistri.saved.notSettled': 'Tu envío se mandó y aún no se sabe su resultado. Envía de nuevo para saber cómo terminó.',
86
+ 'mistri.saved.draftShort': 'Tu borrador está guardado.',
87
+ 'mistri.saved.draft': 'Tu borrador está guardado. Continúa donde lo dejaste o empieza de nuevo.',
88
+ 'mistri.saved.earlier': 'Guardado antes',
89
+ 'mistri.saved.changedElsewhere': 'Este borrador cambió en otro lugar. Revísalo de nuevo antes de enviar.',
90
+ 'mistri.saved.reviewNotRead': 'No se pudieron leer tus respuestas para revisarlas. Envía de nuevo en un momento.',
91
+ 'mistri.saved.reviewNotReady': 'Tus respuestas aún se están leyendo para revisarlas. Envía de nuevo en un momento.',
92
+ 'mistri.saved.checking': 'Buscando una solicitud en curso…',
93
+ 'mistri.link.miss': 'Este enlace no abre nada.',
94
+ 'mistri.link.confirmLead': 'Para ver esto, primero confirma un dato que solo tú sabrías.',
95
+ 'mistri.link.continue': 'Continuar',
96
+ 'mistri.link.offerEmail': 'Para ver esto, enviamos un código por correo a la dirección registrada.',
97
+ 'mistri.link.offerText': 'Para ver esto, enviamos un código al número registrado.',
98
+ 'mistri.link.askEmail': 'Envíame un código por correo',
99
+ 'mistri.link.askText': 'Envíame un código',
100
+ 'mistri.link.sentEmail': 'Si la dirección registrada recibe correo, va un código en camino. Funciona durante diez minutos.',
101
+ 'mistri.link.sentText': 'Si el número registrado recibe mensajes, va un código en camino. Funciona durante diez minutos.',
102
+ 'mistri.link.code': 'Código',
103
+ 'mistri.link.choose': 'Elige…',
104
+ 'mistri.link.failed': 'No funcionó. Inténtalo de nuevo.',
105
+ 'mistri.link.notNow': 'Esto no se puede hacer ahora.',
106
+ 'mistri.link.loading': 'Esta página aún se está cargando. Inténtalo de nuevo en un momento.',
107
+ 'mistri.link.done': 'Listo.',
108
+ 'mistri.language': 'Idioma',
109
+ });
@@ -155,7 +155,7 @@ export declare function defaultColumns(table: TableMeta, path: string, resolved?
155
155
  * dashboard's rows section, on a page. Either way the result is a view the
156
156
  * server compiles and authorizes on every run, like any section's.
157
157
  */
158
- export declare function customReadView(schema: DatabaseSchema, page: PageDef, name: string, read: PageCustomRead, key: Record<string, string | number>, index: number, now?: Date): {
158
+ export declare function customReadView(schema: DatabaseSchema, page: PageDef, name: string, read: PageCustomRead, key: Record<string, string | number>, index: number, now?: Date, rootValues?: RootValues): {
159
159
  view?: ViewDef;
160
160
  empty?: boolean;
161
161
  error?: string;
@@ -763,7 +763,21 @@ export function defaultColumns(table, path, resolved) {
763
763
  * dashboard's rows section, on a page. Either way the result is a view the
764
764
  * server compiles and authorizes on every run, like any section's.
765
765
  */
766
- export function customReadView(schema, page, name, read, key, index, now) {
766
+ export function customReadView(schema, page, name, read, key, index, now, rootValues) {
767
+ if (read.similar) {
768
+ /* Rows that share the record's values: planned as a related list's `same` is, from values read off the record's row. */
769
+ const built = similarView(schema, page, {
770
+ kind: 'list',
771
+ from: read.from,
772
+ path: '',
773
+ columns: read.columns,
774
+ filter: read.filter,
775
+ orderBy: read.orderBy,
776
+ limit: read.limit ?? DEFAULT_PAGE_LIST_LIMIT,
777
+ similar: read.similar,
778
+ }, key, index, now, rootValues);
779
+ return built.view ? { ...built, view: { ...built.view, id: `page:${page.id}:${index}:${name}` } } : built;
780
+ }
767
781
  if (read.path) {
768
782
  const built = listView(schema, page, {
769
783
  kind: 'list',
@@ -822,6 +836,11 @@ export function customProblem(schema, page, section, index) {
822
836
  const table = findTable(schema, read.from);
823
837
  if (!table)
824
838
  return `${here}: "${read.from}" is not a table on this connection.`;
839
+ if (read.similar) {
840
+ const problem = similarProblem(schema, page, { from: read.from, similar: read.similar });
841
+ if (problem)
842
+ return `${here}: ${problem}`;
843
+ }
825
844
  if (read.path) {
826
845
  const resolved = resolvePath(schema, read.from, read.path);
827
846
  if (resolved.error)
@@ -75,7 +75,10 @@ export function planPageSections(schema, page, key, ofKeys, now = new Date(), ro
75
75
  return {
76
76
  index,
77
77
  kind: section.kind,
78
- reads: Object.fromEntries(Object.entries(section.reads ?? {}).map(([name, read]) => [name, customReadView(schema, page, name, read, key, index, now)])),
78
+ reads: Object.fromEntries(Object.entries(section.reads ?? {}).map(([name, read]) => [
79
+ name,
80
+ customReadView(schema, page, name, read, key, index, now, rootValues),
81
+ ])),
79
82
  aggregates: Object.fromEntries(Object.entries(section.aggregates ?? {}).map(([name, total]) => {
80
83
  const built = customTotalPlan(schema, page, name, total, key, index, now);
81
84
  return [name, { breakdown: built.def, empty: built.empty, error: built.error }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/engine",
3
- "version": "1.0.0-rc.67",
3
+ "version": "1.0.0-rc.69",
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": {
@@ -190,6 +190,7 @@
190
190
  "./shared/form.js": "./dist/shared/form.js",
191
191
  "./shared/formValues.js": "./dist/shared/formValues.js",
192
192
  "./shared/frameworkWords.js": "./dist/shared/frameworkWords.js",
193
+ "./shared/frameworkWordsEs.js": "./dist/shared/frameworkWordsEs.js",
193
194
  "./shared/funnel.js": "./dist/shared/funnel.js",
194
195
  "./shared/httpOperations.js": "./dist/shared/httpOperations.js",
195
196
  "./shared/iconGlyphs.js": "./dist/shared/iconGlyphs.js",
package/schema/model.d.ts CHANGED
@@ -312,8 +312,10 @@ export interface CommandActionBase<Label extends string | AppMessageRef> {
312
312
  * Offered for a queue selection only when the command declares
313
313
  * `targets: 'many'`: one request names every selected record, and the
314
314
  * handler applies all of them in one transaction or none.
315
+ * `'each'` offers a command that names one record, and asks nothing, for a selection too: it runs once per selected
316
+ * record, each in its own transaction and each answered on its own, as a fixed action's bulk does.
315
317
  */
316
- bulk?: boolean;
318
+ bulk?: boolean | 'each';
317
319
  /**
318
320
  * `false` keeps the button out of the record's action bar and its menu, for
319
321
  * a verb the App runs from its own place — a custom component through