pgkiln 0.31.0 → 0.35.0

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.
Files changed (107) hide show
  1. package/README.md +2 -2
  2. package/SECURITY.md +10 -0
  3. package/db/migrations/076_form_lost_update.sql +50 -0
  4. package/db/migrations/077_warn_unsaved.sql +41 -0
  5. package/db/migrations/078_url_region.sql +12 -0
  6. package/db/migrations/079_developer_toolbar.sql +53 -0
  7. package/db/migrations/080_search.sql +326 -0
  8. package/db/migrations/081_mail.sql +621 -0
  9. package/db/migrations/082_app_backups.sql +73 -0
  10. package/db/migrations/083_availability.sql +156 -0
  11. package/db/migrations/084_feedback.sql +46 -0
  12. package/db/migrations/085_page_behaviour.sql +65 -0
  13. package/db/migrations/086_data_settings.sql +599 -0
  14. package/docs/apex-feature-parity.md +55 -35
  15. package/docs/guide/01-installation.md +1 -0
  16. package/docs/guide/03-builder.md +118 -2
  17. package/docs/guide/04-pages-and-regions.md +115 -0
  18. package/docs/guide/05-items.md +47 -0
  19. package/docs/guide/06-processing.md +210 -2
  20. package/docs/guide/07-dynamic-actions.md +60 -2
  21. package/docs/guide/08-security.md +13 -2
  22. package/docs/guide/09-reference.md +21 -0
  23. package/docs/guide/11-from-apex.md +5 -1
  24. package/docs/guide/12-development.md +33 -1
  25. package/docs/guide/14-globalization.md +15 -0
  26. package/docs/guide/15-extensions.md +1 -1
  27. package/docs/guide/18-cli.md +30 -1
  28. package/docs/guide/20-ai-agents.md +3 -2
  29. package/examples/hr/hr_50_search.sql +47 -0
  30. package/examples/hr/hr_51_mail.sql +70 -0
  31. package/examples/hr/hr_52_feedback.sql +15 -0
  32. package/examples/hr/hr_53_data_settings.sql +108 -0
  33. package/package.json +3 -1
  34. package/public/app.css +62 -0
  35. package/public/app.js +408 -11
  36. package/public/builder.css +11 -0
  37. package/public/builder.js +27 -0
  38. package/src/app.ts +8 -0
  39. package/src/appfiles.ts +12 -0
  40. package/src/automations.ts +12 -0
  41. package/src/builder/advisor.ts +54 -14
  42. package/src/builder/arrange.ts +2 -2
  43. package/src/builder/availability.ts +74 -0
  44. package/src/builder/backups.ts +134 -0
  45. package/src/builder/components.ts +109 -15
  46. package/src/builder/designer.ts +8 -3
  47. package/src/builder/feedback.ts +82 -0
  48. package/src/builder/forms.ts +4 -1
  49. package/src/builder/home.ts +3 -0
  50. package/src/builder/locks.ts +15 -5
  51. package/src/builder/mail.ts +425 -0
  52. package/src/builder/newapp.ts +1 -1
  53. package/src/builder/region-help.ts +71 -0
  54. package/src/builder/routes.ts +44 -1
  55. package/src/builder/search.ts +4 -4
  56. package/src/builder/shared.ts +3 -2
  57. package/src/builder/ui.ts +7 -1
  58. package/src/cli/apps.ts +46 -5
  59. package/src/cli/main.ts +21 -5
  60. package/src/cli/mcp.ts +16 -4
  61. package/src/cli/replace.ts +36 -4
  62. package/src/geocode.ts +44 -0
  63. package/src/i18n/ar.ts +39 -0
  64. package/src/i18n/cs.ts +39 -0
  65. package/src/i18n/da.ts +39 -0
  66. package/src/i18n/de.ts +39 -0
  67. package/src/i18n/el.ts +39 -0
  68. package/src/i18n/es.ts +39 -0
  69. package/src/i18n/fi.ts +39 -0
  70. package/src/i18n/fr.ts +39 -0
  71. package/src/i18n/he.ts +39 -0
  72. package/src/i18n/it.ts +39 -0
  73. package/src/i18n/ja.ts +39 -0
  74. package/src/i18n/ko.ts +39 -0
  75. package/src/i18n/nb.ts +39 -0
  76. package/src/i18n/pl.ts +39 -0
  77. package/src/i18n/pt.ts +39 -0
  78. package/src/i18n/ru.ts +39 -0
  79. package/src/i18n/sv.ts +39 -0
  80. package/src/i18n/tr.ts +39 -0
  81. package/src/i18n/uk.ts +39 -0
  82. package/src/i18n/zh.ts +39 -0
  83. package/src/i18n.ts +78 -0
  84. package/src/mail/mail.ts +148 -0
  85. package/src/mail/providers.ts +444 -0
  86. package/src/metadata.ts +26 -8
  87. package/src/runtime/ajax.ts +97 -0
  88. package/src/runtime/authz.ts +1 -1
  89. package/src/runtime/availability.ts +37 -0
  90. package/src/runtime/context.ts +46 -6
  91. package/src/runtime/data-export.ts +94 -0
  92. package/src/runtime/data-items.ts +194 -0
  93. package/src/runtime/devbar.ts +182 -0
  94. package/src/runtime/engine.ts +26 -1
  95. package/src/runtime/feedback.ts +128 -0
  96. package/src/runtime/items.ts +8 -0
  97. package/src/runtime/processes.ts +83 -2
  98. package/src/runtime/regions.ts +8 -0
  99. package/src/runtime/render.ts +33 -7
  100. package/src/runtime/rest.ts +4 -0
  101. package/src/runtime/routes.ts +59 -5
  102. package/src/runtime/search.ts +252 -0
  103. package/src/runtime/url-region.ts +93 -0
  104. package/src/security.ts +11 -1
  105. package/src/server.ts +2 -0
  106. package/src/session.ts +8 -2
  107. package/src/workingcopy.ts +2 -2
@@ -1,3 +1,4 @@
1
+ import { advise } from './advisor.ts';
1
2
  import { appLocks, isAdmin, lockPanel, lockText } from './locks.ts';
2
3
  import { parseRoleList, validRoleName } from '../dbauth.ts';
3
4
  import { DEFAULT_HEADER, headerProxiesConfigured } from '../headerauth.ts';
@@ -21,6 +22,7 @@ import { saveTimeZoneSettings, timeZoneSettings } from './globalization.ts';
21
22
  import { WIZARD_KINDS, wizardRoutes, wizardTables } from './wizards.ts';
22
23
  import { checkNewApp, createApp, createAppError, startFromBoilerplate } from './newapp.ts';
23
24
  import { appFromFileRoutes } from './appfromfile.ts';
25
+ import { clearDevbar } from '../runtime/devbar.ts';
24
26
 
25
27
  // Builder pages: sign-in, workspace and app home, settings, activity and
26
28
  // developers. Shared Components, the page designer and the SQL Workshop
@@ -96,7 +98,10 @@ export async function builderRoutes(app: FastifyInstance) {
96
98
 
97
99
  app.post(`${BASE}/logout`, async (req: Req, reply) => {
98
100
  const s = await getSession(req, reply, null, BASE);
99
- if (req.body?.__csrf === s.csrf_token) await destroySession(reply, s, BASE);
101
+ if (req.body?.__csrf === s.csrf_token) {
102
+ await destroySession(reply, s, BASE);
103
+ clearDevbar(reply);
104
+ }
100
105
  return reply.redirect(`${BASE}/login`, 303);
101
106
  });
102
107
 
@@ -162,6 +167,13 @@ export async function builderRoutes(app: FastifyInstance) {
162
167
  const r = await owner.tx(async (c) => {
163
168
  const made = (await c.query('select meta.import_app($1::jsonb, $2) as id', [JSON.stringify(doc), req.body?.alias?.trim() || null])).rows[0];
164
169
  await placeApp(c, made.id, ws);
170
+ // (sprint 51) the Advisor on the imported application, before the commit: errors refuse it
171
+ if (req.body?.check === 'true') {
172
+ const errors = (await advise(made.id, c)).findings.filter((f) => f.severity === 'error');
173
+ if (errors.length)
174
+ throw new Error(`the check found ${errors.length} error(s), nothing was imported: ${errors.slice(0, 5).map((f) =>
175
+ `${f.entry ? `${f.entry.pageNo !== null ? `page ${f.entry.pageNo}, ` : ''}${f.entry.label}` : 'database'} (${f.field}): ${f.message}`).join('; ')}${errors.length > 5 ? '; …' : ''}. Fix them, or import without the check.`);
176
+ }
165
177
  return made;
166
178
  });
167
179
  // supporting objects are never run on import: the developer reviews them and chooses
@@ -377,6 +389,14 @@ export async function builderRoutes(app: FastifyInstance) {
377
389
  <form method="post" action="${BASE}/apps/${a.id}/delete" class="danger-zone">${csrf(s)}
378
390
  <button class="btn btn-danger" data-confirm="Delete application ${a.name} and all its pages?">Delete application</button>
379
391
  </form>`)}
392
+ ${region('Errors and sessions', html`<form method="post" action="${BASE}/apps/${a.id}/settings/behaviour">${csrf(s)}
393
+ <div class="form-grid">
394
+ ${input('error_function', 'Error handling function', a.error_function ?? '', { placeholder: 'e.g. sales.error_message',
395
+ help: 'schema.function(jsonb) returns jsonb, run as the application\'s role: it receives the message and what is known of an error (code, constraint, table, column, component, page, user, internal, reference) and may return {"message": "…"} to show instead. Empty: none.' })}
396
+ ${input('session_warning_seconds', 'Session timeout warning (seconds)', a.session_warning_seconds ?? 120, { type: 'number',
397
+ help: 'Signed-in users are warned this long before their session ends and can stay signed in (0: no warning).' })}
398
+ </div>
399
+ <div class="buttons"><button class="btn">Save</button></div></form>`)}
380
400
  ${region('Progressive Web App', await pwaSection({ ...a, has_icon: !!(await owner.one('select pwa_icon is not null as h from meta.app where id = $1', [a.id]))?.h }, s))}
381
401
  ${region('Security checklist', html`<ul class="checklist">
382
402
  <li>${a.db_role ? '✓' : '✗'} Runs as a dedicated database role ${a.db_role ? html`(<code>${a.db_role}</code>)` : html`<b>(runs as the runtime connection)</b>`}</li>
@@ -394,6 +414,27 @@ export async function builderRoutes(app: FastifyInstance) {
394
414
  return send(reply, s, shell(s, `${a.name} settings`, [['App Builder', BASE], [a.name, `${BASE}/apps/${a.id}`], ['Settings']], main));
395
415
  });
396
416
 
417
+ // (085) error handling function and session timeout warning
418
+ app.post(`${BASE}/apps/:id/settings/behaviour`, async (req: Req, reply) => {
419
+ const s = await developer(req, reply);
420
+ if (!s) return;
421
+ const b = req.body ?? {};
422
+ const fn = String(b.error_function ?? '').trim();
423
+ const seconds = Number(b.session_warning_seconds ?? 120);
424
+ try {
425
+ if (fn && !/^[A-Za-z_][A-Za-z0-9_$]{0,62}\.[A-Za-z_][A-Za-z0-9_$]{0,62}$/.test(fn)) throw new Error('The error handling function is schema.function, e.g. sales.error_message.');
426
+ if (fn && !(await owner.one(`select 1 as ok from pg_proc p join pg_namespace n on n.oid = p.pronamespace
427
+ where n.nspname = $1 and p.proname = $2 and p.pronargs = 1 and p.proargtypes[0] = 'jsonb'::regtype and p.prorettype = 'jsonb'::regtype`, fn.split('.'))))
428
+ throw new Error(`There is no function ${fn}(jsonb) returning jsonb.`);
429
+ if (!Number.isInteger(seconds) || seconds < 0 || seconds > 3600) throw new Error('The session timeout warning is 0 to 3600 seconds.');
430
+ await owner.query('update meta.app set error_function = $2, session_warning_seconds = $3, updated_at = now() where id = $1', [req.params.id, fn || null, seconds]);
431
+ flash(s, 'Saved.');
432
+ } catch (e) {
433
+ flash(s, (e as Error).message, 'error');
434
+ }
435
+ return back(reply, s, `${BASE}/apps/${req.params.id}/settings`);
436
+ });
437
+
397
438
  app.post(`${BASE}/apps/:id/settings`, async (req: Req, reply) => {
398
439
  const s = await developer(req, reply);
399
440
  if (!s) return;
@@ -498,6 +539,8 @@ export async function builderRoutes(app: FastifyInstance) {
498
539
  <div class="columns">
499
540
  <p><a class="btn" href="${BASE}/apps/${a.id}/top-sql">${icon('database')} Top SQL</a> <span class="muted">the slowest statements of this application's database role</span></p>
500
541
  <p><a class="btn" href="${BASE}/apps/${a.id}/ai">${icon('bolt')} AI usage</a> <span class="muted">the AI services this application may use, and its requests</span></p>
542
+ <p><a class="btn" href="${BASE}/apps/${a.id}/feedback">${icon('chat')} Feedback</a> <span class="muted">what users sent from the application's Feedback link, and your answers</span></p>
543
+ <p><a class="btn" href="${BASE}/apps/${a.id}/mail">${icon('send')} Mail</a> <span class="muted">the mail this application queued and sent, with retry and cancel</span></p>
501
544
  <p><a class="btn" href="${BASE}/apps/${a.id}/debug">${icon('list')} Debug messages</a> <span class="muted">${a.debug_level ? `on (level ${a.debug_level}): ` : 'off: '}timed steps of each request and messages from <code>meta.debug()</code></span></p>
502
545
  ${region('Page views by page (7 days)', html`<div class="table-wrap"><table class="report"><thead><tr><th class="num">Page</th><th>Name</th><th class="num">Views</th><th class="num">Avg ms</th><th class="num">Max ms</th></tr></thead>
503
546
  <tbody>${byPage.rows.map((r) => html`<tr><td class="num">${r.page_no}</td><td>${r.name}</td><td class="num">${r.views}</td><td class="num">${r.avg_ms}</td><td class="num">${r.max_ms}</td></tr>`)}</tbody></table></div>`)}
@@ -41,8 +41,8 @@ const PAGE_FIELDS = [
41
41
  const asText = (v: unknown) => (v === null || v === undefined ? '' : Array.isArray(v) ? v.join(', ') : typeof v === 'object' ? JSON.stringify(v) : String(v));
42
42
 
43
43
  /** Every component of an application with its searchable fields. */
44
- export async function appEntries(appId: number): Promise<Entry[]> {
45
- const pages = (await owner.query('select * from meta.page where app_id = $1 order by page_no', [appId])).rows;
44
+ export async function appEntries(appId: number, query: (sql: string, params?: unknown[]) => Promise<{ rows: any[] }> = (sql, params) => owner.query(sql, params)): Promise<Entry[]> {
45
+ const pages = (await query('select * from meta.page where app_id = $1 order by page_no', [appId])).rows;
46
46
  const pageById = new Map(pages.map((p) => [p.id, p]));
47
47
  const out: Entry[] = pages.map((p) => ({
48
48
  kind: 'page', id: p.id, label: `Page ${p.page_no}: ${p.name}`, kindLabel: 'Page', icon: 'file', pageNo: p.page_no,
@@ -51,8 +51,8 @@ export async function appEntries(appId: number): Promise<Entry[]> {
51
51
  }));
52
52
  for (const [kind, spec] of Object.entries(COMPONENTS)) {
53
53
  const rows = spec.scope === 'page'
54
- ? (await owner.query(`select t.* from ${spec.table} t join meta.page p on p.id = t.page_id where p.app_id = $1 order by p.page_no, t.seq, t.id`, [appId])).rows
55
- : (await owner.query(`select * from ${spec.table} where app_id = $1 order by id`, [appId])).rows;
54
+ ? (await query(`select t.* from ${spec.table} t join meta.page p on p.id = t.page_id where p.app_id = $1 order by p.page_no, t.seq, t.id`, [appId])).rows
55
+ : (await query(`select * from ${spec.table} where app_id = $1 order by id`, [appId])).rows;
56
56
  for (const row of rows) {
57
57
  const page = spec.scope === 'page' ? pageById.get(row.page_id) : null;
58
58
  out.push({
@@ -33,9 +33,10 @@ function listExtras(appId: number, list: any, entries: any[]): Raw {
33
33
 
34
34
  export async function sharedRoutes(app: FastifyInstance) {
35
35
  // ---------------------------------------------------------------- shared components
36
- const SHARED = ['nav_entry', 'authz_scheme', 'build_option', 'lov', 'app_item', 'app_process', 'automation', 'automation_action', 'report_layout', 'document_template', 'task_definition', 'workflow_definition', 'rest_module', 'template_component', 'web_credential', 'rest_source', 'data_load_def', 'list', 'list_entry', 'supporting_script'];
36
+ const SHARED = ['nav_entry', 'authz_scheme', 'build_option', 'lov', 'app_item', 'app_process', 'automation', 'automation_action', 'report_layout', 'document_template', 'task_definition', 'workflow_definition', 'rest_module', 'template_component', 'web_credential', 'rest_source', 'data_load_def', 'list', 'list_entry', 'supporting_script', 'search_config', 'email_template', 'app_setting', 'dynamic_translation'];
37
37
 
38
38
  const ORDER: Record<string, string> = {
39
+ search_config: 'seq, name', dynamic_translation: 'language, source',
39
40
  nav_entry: 'parent_id nulls first, seq, id', app_process: 'seq, id', list_entry: 'list_name, parent_id nulls first, seq, id', automation_action: 'automation_name, seq, name', supporting_script: 'kind, seq, name',
40
41
  };
41
42
 
@@ -143,7 +144,7 @@ export async function sharedRoutes(app: FastifyInstance) {
143
144
  const spec = COMPONENTS[kind];
144
145
  return html`<li class="group">${spec.plural}<a href="?new=${kind}" aria-label="Add ${spec.label}">+ Add</a></li>
145
146
  ${rows[kind].map((r) => html`<li><a href="?c=${kind}-${r.id}"${selKind === kind && selId === String(r.id) ? raw(' aria-current="page"') : ''}>${icon(kind === 'nav_entry' ? (r.icon ?? 'chevron') : spec.icon)}<span>${r.parent_id ? '↳ ' : ''}${spec.summary(r)}</span>${
146
- kind === 'nav_entry' && r.target_page ? html`<span class="kind">p${r.target_page}</span>` : kind === 'authz_scheme' ? html`<span class="kind">${r.type}</span>` : kind === 'app_process' ? html`<span class="kind">${r.point}</span>` : kind === 'report_layout' ? html`<span class="kind">${r.paper}${r.is_default ? ' · default' : ''}</span>` : kind === 'automation' ? html`<span class="kind">${r.enabled ? (r.last_status === 'error' || r.last_status === 'warning' ? r.last_status : r.schedule) : 'off'}</span>` : kind === 'web_credential' ? html`<span class="kind">${r.type}${r.secret_enc || !needsSecret(r) ? '' : ' · no secret'}</span>` : kind === 'rest_source' ? html`<span class="kind">${r.method}${r.sync_table ? ' · sync' : ''}</span>` : kind === 'list' ? html`<span class="kind">${r.type}</span>` : kind === 'supporting_script' ? html`<span class="kind">${r.kind}</span>` : ''
147
+ kind === 'nav_entry' && r.target_page ? html`<span class="kind">p${r.target_page}</span>` : kind === 'authz_scheme' ? html`<span class="kind">${r.type}</span>` : kind === 'app_process' ? html`<span class="kind">${r.point}</span>` : kind === 'report_layout' ? html`<span class="kind">${r.paper}${r.is_default ? ' · default' : ''}</span>` : kind === 'automation' ? html`<span class="kind">${r.enabled ? (r.last_status === 'error' || r.last_status === 'warning' ? r.last_status : r.schedule) : 'off'}</span>` : kind === 'web_credential' ? html`<span class="kind">${r.type}${r.secret_enc || !needsSecret(r) ? '' : ' · no secret'}</span>` : kind === 'rest_source' ? html`<span class="kind">${r.method}${r.sync_table ? ' · sync' : ''}</span>` : kind === 'list' ? html`<span class="kind">${r.type}</span>` : kind === 'supporting_script' ? html`<span class="kind">${r.kind}</span>` : kind === 'search_config' ? html`<span class="kind">${r.source_type}</span>` : ''
147
148
  }</a></li>`)}${kind === 'supporting_script' ? html`<li><a href="${BASE}/apps/${a.id}/supporting-objects">${icon('play')}<span>Review and run…</span></a></li>` : ''}`;
148
149
  })}
149
150
  </ul>`;
package/src/builder/ui.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { availabilityBadge } from './availability.ts';
1
2
  import { appOfPath, blockingLock, isAdmin, refuseLocked } from './locks.ts';
2
3
  import { appAllowed, loadWorkspaces, workspaceMenu } from './workspaces.ts';
3
4
  import type { FastifyReply, FastifyRequest } from 'fastify';
@@ -6,6 +7,7 @@ import { html, raw, type Raw } from '../html.ts';
6
7
  import { icon } from '../icons.ts';
7
8
  import { documentShell } from '../layout.ts';
8
9
  import { getSession, saveState, takeFlash, type Session } from '../session.ts';
10
+ import { ensureDevbar } from '../runtime/devbar.ts';
9
11
 
10
12
  // Shared building blocks of the builder UI.
11
13
 
@@ -186,9 +188,11 @@ export const appHeader = (a: any, active: 'pages' | 'shared' | 'settings' | 'act
186
188
  return html`
187
189
  <div class="ide-head">
188
190
  <div class="ide-head-title"><span class="ide-app-icon" aria-hidden="true">${String(a.name ?? '?').slice(0, 1).toUpperCase()}</span>
189
- <div><h1>${a.name}</h1><span class="muted small">Application ${a.id} · /a/${a.alias}</span></div>
191
+ <div><h1>${a.name}</h1><span class="muted small">Application ${a.id} · /a/${a.alias}</span> ${availabilityBadge(a)}</div>
190
192
  <div class="buttons ide-head-actions">
191
193
  <a class="btn btn-sm" href="${BASE}/apps/${a.id}/working-copies">${icon('layers')} Working copies</a>
194
+ <a class="btn btn-sm" href="${BASE}/apps/${a.id}/backups">${icon('history')} Backups</a>
195
+ <a class="btn btn-sm" href="${BASE}/apps/${a.id}/availability">${icon('power')} Availability</a>
192
196
  <a class="btn btn-sm" href="${BASE}/apps/${a.id}/export">${icon('download')} Export</a>
193
197
  <a class="btn btn-sm btn-run" href="/a/${a.alias}" target="_blank" rel="noopener">${icon('play')} Run</a>
194
198
  </div></div>
@@ -242,6 +246,8 @@ export async function developer(req: Req, reply: FastifyReply) {
242
246
  reply.code(403).send('Invalid CSRF token; reload the page and try again.');
243
247
  return null;
244
248
  }
249
+ // (079) the developer toolbar on the applications' pages in this browser
250
+ await ensureDevbar(req, reply, s);
245
251
  // workspaces: an application outside the developer's workspaces doesn't exist for them
246
252
  await loadWorkspaces(s);
247
253
  const target = await appOfPath(req.url);
package/src/cli/apps.ts CHANGED
@@ -55,12 +55,30 @@ export async function readSource(path: string): Promise<{ doc: Doc; files?: File
55
55
  }
56
56
  }
57
57
 
58
+ /** One problem the Advisor found in an import (see src/builder/advisor.ts). */
59
+ export interface ImportFinding {
60
+ severity: 'error' | 'warning' | 'info';
61
+ where: string;
62
+ field: string;
63
+ message: string;
64
+ }
65
+
66
+ /**
67
+ * How an import checks the application before it commits (sprint 51):
68
+ * - off: no check;
69
+ * - check: the Advisor runs in the import's transaction; errors refuse the import (nothing changes);
70
+ * - force: the Advisor runs and reports, the import commits anyway;
71
+ * - dry-run: the Advisor runs and reports, the import is always rolled back.
72
+ */
73
+ export type ImportCheck = 'off' | 'check' | 'force' | 'dry-run';
74
+
58
75
  /**
59
76
  * Imports doc as alias in one transaction: a new application, or with replace
60
77
  * the existing one updated in place (see replace.ts). Returns its id, whether
61
- * it replaced one, and its number of supporting object scripts (never run).
78
+ * it replaced one, its number of supporting object scripts (never run), the
79
+ * Advisor's findings (with a check) and whether it was committed.
62
80
  */
63
- export async function importDoc(db: Db, doc: Doc, { alias, replace }: { alias: string; replace: boolean }) {
81
+ export async function importDoc(db: Db, doc: Doc, { alias, replace, check = 'off', by = null }: { alias: string; replace: boolean; check?: ImportCheck; by?: string | null }) {
64
82
  await db.query('begin');
65
83
  try {
66
84
  const exists = (await db.query('select id from meta.app where alias = $1', [alias])).rows[0];
@@ -68,13 +86,36 @@ export async function importDoc(db: Db, doc: Doc, { alias, replace }: { alias: s
68
86
  if (exists && !replace) throw new UsageError(`application ${alias} exists: use --replace to update it, or --alias for a copy`);
69
87
  if (exists) {
70
88
  const { replaceApp } = await import('./replace.ts');
71
- id = await replaceApp(db, doc, alias);
89
+ id = await replaceApp(db, doc, alias, { backup: { reason: 'import', user: by } });
72
90
  } else id = (await db.query('select meta.import_app($1::jsonb, $2) as id', [JSON.stringify(doc), alias])).rows[0].id;
73
- await db.query('commit');
74
91
  const scripts: number = (await db.query('select count(*)::int as n from meta.supporting_script where app_id = $1', [id])).rows[0].n;
75
- return { id, replaced: !!exists, scripts };
92
+ let findings: ImportFinding[] = [];
93
+ if (check !== 'off') {
94
+ // the application as imported, before anything is committed: SQL planned as its role, references
95
+ const { advise } = await import('../builder/advisor.ts');
96
+ findings = (await advise(id, db)).findings.map((f) => ({
97
+ severity: f.severity,
98
+ where: f.entry ? `${f.entry.pageNo !== null ? `page ${f.entry.pageNo}, ` : ''}${f.entry.kindLabel.toLowerCase()} ${f.entry.label}` : 'database',
99
+ field: f.field,
100
+ message: f.message,
101
+ }));
102
+ if (check === 'dry-run' || (check === 'check' && findings.some((f) => f.severity === 'error'))) {
103
+ await db.query('rollback');
104
+ return { id, replaced: !!exists, scripts, findings, committed: false };
105
+ }
106
+ }
107
+ await db.query('commit');
108
+ return { id, replaced: !!exists, scripts, findings, committed: true };
76
109
  } catch (e) {
77
110
  await db.query('rollback').catch(() => {});
78
111
  throw e;
79
112
  }
80
113
  }
114
+
115
+ /** The Advisor's findings of an import, one per line, errors first. */
116
+ export function formatFindings(findings: ImportFinding[]) {
117
+ if (!findings.length) return 'Check: no problems found.\n';
118
+ const count = (sev: ImportFinding['severity']) => findings.filter((f) => f.severity === sev).length;
119
+ return findings.map((f) => `${f.severity.toUpperCase()} ${f.where}${f.field ? ` (${f.field})` : ''}: ${f.message}\n`).join('') +
120
+ `Check: ${count('error')} error(s), ${count('warning')} warning(s), ${count('info')} note(s).\n`;
121
+ }
package/src/cli/main.ts CHANGED
@@ -6,10 +6,11 @@
6
6
  // Exit codes: 0 ok, 1 differences found (diff), 2 usage error, 3 failure.
7
7
  import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs';
8
8
  import { join, resolve } from 'node:path';
9
+ import { userInfo } from 'node:os';
9
10
  import { parseArgs, type ParseArgsConfig } from 'node:util';
10
11
  import { root } from '../env.ts';
11
12
  import { docToFiles, stableJson } from '../appfiles.ts';
12
- import { exportDoc, importDoc, readSource, UsageError, withDb } from './apps.ts';
13
+ import { exportDoc, formatFindings, importDoc, readSource, UsageError, withDb } from './apps.ts';
13
14
 
14
15
  export const EXIT = { ok: 0, differences: 1, usage: 2, failure: 3 } as const;
15
16
 
@@ -166,25 +167,40 @@ const COMMANDS: Record<string, Command> = {
166
167
  },
167
168
 
168
169
  import: {
169
- usage: 'pgkiln import <path> [--alias <alias>] [--replace]',
170
+ usage: 'pgkiln import <path> [--alias <alias>] [--replace] [--check [--force] | --dry-run]',
170
171
  summary: 'import a JSON export, an application directory or a .zip of one',
171
172
  details:
172
173
  'Without --replace the alias must be free. With --replace an existing application with that\n' +
173
174
  'alias is updated in place: it keeps its id, users and access, API clients, sessions, saved\n' +
174
175
  'reports, running tasks and workflows, and the on/off switch of its automations; its pages,\n' +
175
176
  'shared components and settings become those of the file. Without an existing application\n' +
176
- '--replace simply imports.',
177
- options: { alias: { type: 'string', short: 'a' }, replace: { type: 'boolean' } },
177
+ '--replace simply imports.\n\n' +
178
+ 'With --check the Advisor checks the imported application before anything is committed: every\n' +
179
+ 'SQL fragment is planned as the application\'s role (unknown tables, columns, functions, types and\n' +
180
+ 'grants), and references to pages, items, lists of values and schemes are checked. Errors refuse\n' +
181
+ 'the import (exit code 1, nothing changes); --force imports anyway. --dry-run checks and never commits.',
182
+ options: { alias: { type: 'string', short: 'a' }, replace: { type: 'boolean' }, check: { type: 'boolean' }, force: { type: 'boolean' }, 'dry-run': { type: 'boolean' } },
178
183
  optionHelp: [
179
184
  ['-a, --alias <alias>', 'alias of the application (default: the one in the export)'],
180
185
  ['--replace', 'update the application with that alias in place'],
186
+ ['--check', 'check the application\'s SQL and references first; errors refuse the import'],
187
+ ['--force', 'with --check: import even when the check finds errors'],
188
+ ['--dry-run', 'import, check and roll back: nothing changes'],
181
189
  ],
182
190
  positionals: [1, 1],
183
191
  async run(v, [path]) {
184
192
  const { doc } = await readSource(path);
185
193
  const alias = (v.alias as string) ?? doc?.app?.alias;
186
194
  if (!alias) throw new Error('the export has no alias: use --alias');
187
- const r = await withDb((db) => importDoc(db, doc, { alias, replace: !!v.replace }));
195
+ const check = v['dry-run'] ? 'dry-run' : v.check ? (v.force ? 'force' : 'check') : 'off';
196
+ const r = await withDb((db) => importDoc(db, doc, { alias, replace: !!v.replace, check, by: `pgkiln import (${userInfo().username})` }));
197
+ if (check !== 'off') out(formatFindings(r.findings));
198
+ if (!r.committed) {
199
+ out(check === 'dry-run'
200
+ ? `Dry run: nothing was imported.\n`
201
+ : `Not imported: the check found ${r.findings.filter((f) => f.severity === 'error').length} error(s). Fix them, or use --force.\n`);
202
+ return check === 'dry-run' && !r.findings.some((f) => f.severity === 'error') ? EXIT.ok : EXIT.differences;
203
+ }
188
204
  out(r.replaced
189
205
  ? `Replaced ${alias} (application ${r.id}).\n`
190
206
  : `Imported ${alias} (application ${r.id}). Check its database role and grant access in the builder.\n`);
package/src/cli/mcp.ts CHANGED
@@ -11,7 +11,7 @@ import { join, resolve } from 'node:path';
11
11
  import { createInterface } from 'node:readline';
12
12
  import { root } from '../env.ts';
13
13
  import { docToFiles, stableJson, type FileMap } from '../appfiles.ts';
14
- import { exportDoc, importDoc, readSource, withDb, type Db } from './apps.ts';
14
+ import { exportDoc, formatFindings, importDoc, readSource, withDb, type Db } from './apps.ts';
15
15
 
16
16
  const PROTOCOL_VERSIONS = ['2025-06-18', '2025-03-26', '2024-11-05'];
17
17
  /** Cap on the text one tool call returns, so a large application does not flood the agent's context. */
@@ -364,13 +364,19 @@ export const TOOLS: Tool[] = [
364
364
  'Imports an export directory, zip or JSON file. Without replace the alias must be free (a new application). ' +
365
365
  'With replace=true the application with that alias is updated in place in one transaction: its pages, shared components and settings ' +
366
366
  'become those of the files; its id, users and access, sessions, saved reports and running workflows are kept. ' +
367
- 'Supporting object scripts and plug-in install SQL are never run. Run diff_app first.',
367
+ 'Supporting object scripts and plug-in install SQL are never run. Run diff_app first. ' +
368
+ 'Before it commits, the Advisor checks the imported application (every SQL fragment planned as the application\'s role: ' +
369
+ 'unknown tables, columns, functions, types, grants; references to pages, items, lists of values): errors refuse the import ' +
370
+ 'and nothing changes. Fix the files (or the database objects, in a migration) and import again; force=true imports anyway, dry_run=true only checks.',
368
371
  inputSchema: {
369
372
  type: 'object',
370
373
  properties: {
371
374
  path: { type: 'string', description: 'the export directory, .zip or .json; default apps/<alias>' },
372
375
  alias: { type: 'string', description: 'the alias to import as (default: the one in the files)' },
373
376
  replace: { type: 'boolean', description: 'update the existing application with this alias' },
377
+ check: { type: 'boolean', description: 'check the application before committing (default true)' },
378
+ force: { type: 'boolean', description: 'import even when the check finds errors' },
379
+ dry_run: { type: 'boolean', description: 'only check: import, report and roll back' },
374
380
  },
375
381
  },
376
382
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
@@ -382,8 +388,14 @@ export const TOOLS: Tool[] = [
382
388
  const { doc } = await readSource(path);
383
389
  const alias = aliasArg ?? doc?.app?.alias;
384
390
  if (!alias) throw new ToolError('the export has no alias: give one');
385
- const r = await withDb((db) => importDoc(db, doc, { alias, replace: a.replace === true }));
386
- return (
391
+ const check = a.dry_run === true ? 'dry-run' : a.check === false ? 'off' : a.force === true ? 'force' : 'check';
392
+ const r = await withDb((db) => importDoc(db, doc, { alias, replace: a.replace === true, check, by: 'MCP import_app' }));
393
+ const report = check === 'off' ? '' : formatFindings(r.findings);
394
+ if (!r.committed)
395
+ return report + (check === 'dry-run'
396
+ ? 'Dry run: nothing was imported.\n'
397
+ : 'Not imported: fix the errors above (or import with force=true). Nothing changed.\n');
398
+ return report + (
387
399
  (r.replaced ? `Replaced ${alias} (application ${r.id}).\n` : `Imported ${alias} (application ${r.id}). Its database role and who may sign in are set in the builder.\n`) +
388
400
  (r.scripts ? `It has ${r.scripts} supporting object script(s); they were not run.\n` : '')
389
401
  );
@@ -22,6 +22,10 @@ export const REPLACED = [
22
22
  'list', 'list_entry', 'supporting_script',
23
23
  // (068) static application files, (069) plug-ins
24
24
  'static_file', 'plugin',
25
+ // (080) search configurations, (081) e-mail templates
26
+ 'search_config', 'email_template',
27
+ // (086) application settings (installed values kept, see below), dynamic translations
28
+ 'app_setting', 'dynamic_translation',
25
29
  ];
26
30
  /** Tables of an application that belong to the installation: kept. */
27
31
  export const KEPT = ['app_access', 'api_client', 'session', 'sso_pending', 'saved_report', 'persistent_login', 'task', 'workflow', 'process_job',
@@ -48,7 +52,13 @@ export const KEPT = ['app_access', 'api_client', 'session', 'sso_pending', 'save
48
52
  // (064) the workspace of the application
49
53
  'workspace_app',
50
54
  // (074) push notifications: the app's VAPID keys, users' devices, queued notifications
51
- 'push_key', 'push_subscription', 'push_message'];
55
+ 'push_key', 'push_subscription', 'push_message',
56
+ // (082) the application's backups, (084) users' feedback
57
+ 'app_backup', 'feedback',
58
+ // (081) the mail service an application sends through, and its queued and sent mail
59
+ 'app_mail_service', 'mail_queue',
60
+ // (086) users' preferences
61
+ 'user_preference'];
52
62
  /** Children of pages (replaced with their page). */
53
63
  const PAGE_CHILDREN = ['region', 'item', 'button', 'dynamic_action', 'validation', 'process', 'computation', 'branch'];
54
64
  /** References into replaced tables from kept data, repointed below: "table.column". */
@@ -85,12 +95,23 @@ export async function checkSchema(db: Db) {
85
95
  if (problems.length) throw new Error(`replace does not know these tables yet; update src/cli/replace.ts: ${problems.join(', ')}`);
86
96
  }
87
97
 
88
- /** Replace the components of application `alias` with those of doc. Returns the application id. */
89
- export async function replaceApp(db: Db, doc: unknown, alias: string): Promise<number> {
98
+ /** Why the replaced version is backed up (082); null: no backup (a new application). */
99
+ export interface ReplaceOptions {
100
+ backup?: { reason: 'import' | 'merge' | 'restore'; user?: string | null; note?: string | null } | null;
101
+ }
102
+
103
+ /**
104
+ * Replace the components of application `alias` with those of doc. Returns the
105
+ * application id. The version it replaces is backed up first (meta.backup_app,
106
+ * migration 082) unless opts.backup is null.
107
+ */
108
+ export async function replaceApp(db: Db, doc: unknown, alias: string, opts: ReplaceOptions = {}): Promise<number> {
90
109
  await checkSchema(db);
91
110
  const target = (await db.query<{ id: number }>('select id from meta.app where alias = $1 for update', [alias])).rows[0];
92
111
  if (!target) throw new Error(`application ${alias} not found`);
93
112
  const old = target.id;
113
+ const backup = opts.backup === undefined ? { reason: 'import' as const } : opts.backup;
114
+ if (backup) await db.query('select meta.backup_app($1, $2, $3, $4)', [old, backup.reason, backup.user ?? null, backup.note ?? null]);
94
115
  const tmpAlias = `pgkiln-replace-${randomBytes(6).toString('hex')}`;
95
116
  const neu = (await db.query<{ id: number }>('select meta.import_app($1::jsonb, $2) as id', [JSON.stringify(doc), tmpAlias])).rows[0].id;
96
117
 
@@ -131,6 +152,15 @@ export async function replaceApp(db: Db, doc: unknown, alias: string): Promise<n
131
152
  from meta.automation o where o.app_id = $1 and n.app_id = $2 and n.name = o.name`,
132
153
  [old, neu],
133
154
  );
155
+ // (086) application settings keep the installed value (keep_on_upgrade), when it is still valid
156
+ await db.query(
157
+ `update meta.app_setting n set value = o.value
158
+ from meta.app_setting o
159
+ where o.app_id = $1 and n.app_id = $2 and n.name = o.name and n.keep_on_upgrade
160
+ and (o.value is null or n.valid_values is null or o.value = any(n.valid_values))
161
+ and (not n.required or coalesce(o.value, '') <> '')`,
162
+ [old, neu],
163
+ );
134
164
  const regions = async (appId: number) => {
135
165
  const rows = (
136
166
  await db.query<{ id: number; page_no: number; title: string; type: string; static_id: string | null }>(
@@ -174,7 +204,9 @@ export async function replaceApp(db: Db, doc: unknown, alias: string): Promise<n
174
204
  const cols = (
175
205
  await db.query<{ c: string }>(
176
206
  `select quote_ident(column_name) as c from information_schema.columns
177
- where table_schema = 'meta' and table_name = 'app' and column_name not in ('id', 'alias', 'created_at', 'updated_at')
207
+ where table_schema = 'meta' and table_name = 'app'
208
+ -- (083) availability and build status belong to this installation
209
+ and column_name not in ('id', 'alias', 'created_at', 'updated_at', 'availability', 'availability_message', 'availability_users', 'build_status')
178
210
  order by ordinal_position`,
179
211
  )
180
212
  ).rows.map((r) => r.c);
package/src/geocode.ts ADDED
@@ -0,0 +1,44 @@
1
+ // Geocoding for address items (migration 086): the installation's geocoder,
2
+ // a Nominatim-compatible search API (GEOCODER_URL, e.g. your own Nominatim,
3
+ // https://nominatim.openstreetmap.org/search within its usage policy, or
4
+ // LocationIQ's https://eu1.locationiq.com/v1/search with GEOCODER_KEY).
5
+ // Without GEOCODER_URL address items are plain text items.
6
+
7
+ export const geocoderUrl = () => {
8
+ const u = process.env.GEOCODER_URL?.trim();
9
+ return u && /^https?:\/\//.test(u) ? u : null;
10
+ };
11
+
12
+ export interface Place {
13
+ label: string;
14
+ lat: number;
15
+ lon: number;
16
+ }
17
+
18
+ /** At most this many candidates come back. */
19
+ export const GEOCODE_MAX = 5;
20
+
21
+ /** The places that match an address (best first); throws when the geocoder can't be reached. */
22
+ export async function geocode(q: string, opts: { language?: string; country?: string | null } = {}): Promise<Place[]> {
23
+ const base = geocoderUrl();
24
+ if (!base) throw new Error('No geocoder: set GEOCODER_URL.');
25
+ const url = new URL(base);
26
+ url.searchParams.set('format', 'jsonv2');
27
+ url.searchParams.set('limit', String(GEOCODE_MAX));
28
+ url.searchParams.set('q', q);
29
+ if (opts.language) url.searchParams.set('accept-language', opts.language);
30
+ if (opts.country && /^[a-z]{2}(,[a-z]{2})*$/i.test(opts.country)) url.searchParams.set('countrycodes', opts.country.toLowerCase());
31
+ if (process.env.GEOCODER_KEY) url.searchParams.set('key', process.env.GEOCODER_KEY);
32
+ const res = await fetch(url, {
33
+ headers: { accept: 'application/json', 'user-agent': `pgkiln (${process.env.PUBLIC_URL ?? 'https://pgkiln.vargar.eu'})` },
34
+ signal: AbortSignal.timeout(8000),
35
+ redirect: 'error',
36
+ });
37
+ if (!res.ok) throw new Error(`geocoder answered ${res.status}`);
38
+ const rows = (await res.json()) as unknown;
39
+ if (!Array.isArray(rows)) return [];
40
+ return rows
41
+ .map((r: any) => ({ label: String(r?.display_name ?? '').slice(0, 300), lat: Number(r?.lat), lon: Number(r?.lon) }))
42
+ .filter((p) => p.label && Number.isFinite(p.lat) && Number.isFinite(p.lon) && Math.abs(p.lat) <= 90 && Math.abs(p.lon) <= 180)
43
+ .slice(0, GEOCODE_MAX);
44
+ }
package/src/i18n/ar.ts CHANGED
@@ -491,6 +491,45 @@ export const ar: Record<MessageKey, string> = {
491
491
  'form.saved': "تم حفظ التغييرات.",
492
492
  'form.no_record': "لم يُحدد أي سجل.",
493
493
  'form.changed': "لم يُعثر على السجل؛ ربما غيّره شخص آخر أو حذفه.",
494
+ 'item.check_address': 'التحقق من العنوان',
495
+ 'item.address_places': 'العناوين التي تم العثور عليها',
496
+ 'item.address_none': 'لم يتم العثور على عنوان. تحقق من الإملاء أو أضف المدينة.',
497
+ 'item.address_error': 'لا يمكن التحقق من العنوان الآن.',
498
+ 'session.warning': 'لم تكن نشطًا: تنتهي جلستك خلال {minutes} دقيقة.',
499
+ 'session.stay': 'البقاء مسجلاً للدخول',
500
+ 'session.max': 'تنتهي جلستك في {time}. احفظ عملك: بعد ذلك يلزمك تسجيل الدخول مرة أخرى.',
501
+ 'session.ended': 'انتهت جلستك. سجّل الدخول مرة أخرى للمتابعة.',
502
+ 'page.link_copied': 'تم نسخ رابط هذه الصفحة.',
503
+ 'feedback.link': 'ملاحظات',
504
+ 'feedback.title': 'ملاحظات',
505
+ 'feedback.intro': 'أخبر المطورين برأيك في «{page}» أو بفكرة أو بما لا يعمل.',
506
+ 'feedback.kind': 'النوع',
507
+ 'feedback.kind.comment': 'تعليق',
508
+ 'feedback.kind.idea': 'فكرة',
509
+ 'feedback.kind.problem': 'مشكلة',
510
+ 'feedback.rating': 'التقييم (اختياري)',
511
+ 'feedback.text': 'ملاحظاتك',
512
+ 'feedback.send': 'إرسال الملاحظات',
513
+ 'feedback.back': 'العودة إلى الصفحة',
514
+ 'feedback.mine': 'ملاحظاتك السابقة',
515
+ 'feedback.page': 'الصفحة {page}',
516
+ 'feedback.response': 'رد المطورين',
517
+ 'feedback.none': 'لم ترسل أي ملاحظات بعد.',
518
+ 'feedback.required': 'اكتب ملاحظاتك (4000 حرف على الأكثر).',
519
+ 'feedback.too_many': 'لقد أرسلت الكثير من الملاحظات خلال الساعة الماضية؛ يرجى المحاولة لاحقًا.',
520
+ 'feedback.thanks': 'شكرًا: تم إرسال ملاحظاتك إلى المطورين.',
521
+ 'feedback.status.open': 'مفتوح',
522
+ 'feedback.status.in_progress': 'قيد المعالجة',
523
+ 'feedback.status.done': 'تم',
524
+ 'feedback.status.declined': 'مرفوض',
525
+ 'app.unavailable_title': 'غير متاح',
526
+ 'app.unavailable': 'هذا التطبيق غير متاح حاليًا. يرجى المحاولة لاحقًا.',
527
+ 'app.developers_only': 'هذا التطبيق متاح حاليًا لمطوريه فقط.',
528
+ 'app.restricted': 'هذا التطبيق غير متاح لحسابك حاليًا.',
529
+ 'region.url_frame': 'صفحة مضمّنة',
530
+ 'region.url_open': 'فتح في علامة تبويب جديدة',
531
+ 'page.unsaved_changes': 'لديك تغييرات غير محفوظة. هل تريد مغادرة هذه الصفحة على أي حال؟',
532
+ 'form.lost_update': 'قام شخص آخر بتغيير هذا السجل بعد أن فتحته. أعد تحميل الصفحة لرؤية القيم الحالية، ثم أجرِ تغييراتك مرة أخرى.',
494
533
  'form.deleted': "تم حذف السجل.",
495
534
  'error.duplicate': "يوجد سجل بهذه القيم بالفعل{detail}.",
496
535
  'error.referenced': "لا تزال سجلات أخرى تشير إلى هذا السجل{detail}.",
package/src/i18n/cs.ts CHANGED
@@ -491,6 +491,45 @@ export const cs: Record<MessageKey, string> = {
491
491
  'form.saved': "Změny byly uloženy.",
492
492
  'form.no_record': "Není vybrán žádný záznam.",
493
493
  'form.changed': "Záznam nenalezen; mohl ho změnit nebo smazat někdo jiný.",
494
+ 'item.check_address': 'Ověřit adresu',
495
+ 'item.address_places': 'Nalezené adresy',
496
+ 'item.address_none': 'Adresa nebyla nalezena. Zkontrolujte pravopis nebo doplňte obec.',
497
+ 'item.address_error': 'Adresu teď nelze ověřit.',
498
+ 'session.warning': 'Byli jste nečinní: relace skončí za {minutes} min.',
499
+ 'session.stay': 'Zůstat přihlášen',
500
+ 'session.max': 'Relace skončí v {time}. Uložte svou práci: poté se budete muset znovu přihlásit.',
501
+ 'session.ended': 'Relace skončila. Pro pokračování se znovu přihlaste.',
502
+ 'page.link_copied': 'Odkaz na tuto stránku byl zkopírován.',
503
+ 'feedback.link': 'Zpětná vazba',
504
+ 'feedback.title': 'Zpětná vazba',
505
+ 'feedback.intro': 'Napište vývojářům, co si myslíte o „{page}“, nápad nebo co nefunguje.',
506
+ 'feedback.kind': 'Druh',
507
+ 'feedback.kind.comment': 'Komentář',
508
+ 'feedback.kind.idea': 'Nápad',
509
+ 'feedback.kind.problem': 'Problém',
510
+ 'feedback.rating': 'Hodnocení (nepovinné)',
511
+ 'feedback.text': 'Vaše zpětná vazba',
512
+ 'feedback.send': 'Odeslat zpětnou vazbu',
513
+ 'feedback.back': 'Zpět na stránku',
514
+ 'feedback.mine': 'Vaše dřívější zpětná vazba',
515
+ 'feedback.page': 'stránka {page}',
516
+ 'feedback.response': 'Odpověď vývojářů',
517
+ 'feedback.none': 'Zatím jste neodeslali žádnou zpětnou vazbu.',
518
+ 'feedback.required': 'Napište svou zpětnou vazbu (nejvýše 4000 znaků).',
519
+ 'feedback.too_many': 'Za poslední hodinu jste odeslali hodně zpětné vazby; zkuste to později.',
520
+ 'feedback.thanks': 'Děkujeme: vaše zpětná vazba byla odeslána vývojářům.',
521
+ 'feedback.status.open': 'Otevřené',
522
+ 'feedback.status.in_progress': 'Řeší se',
523
+ 'feedback.status.done': 'Vyřízeno',
524
+ 'feedback.status.declined': 'Zamítnuto',
525
+ 'app.unavailable_title': 'Nedostupné',
526
+ 'app.unavailable': 'Tato aplikace momentálně není dostupná. Zkuste to prosím později.',
527
+ 'app.developers_only': 'Tato aplikace je momentálně dostupná pouze svým vývojářům.',
528
+ 'app.restricted': 'Tato aplikace momentálně není dostupná pro váš účet.',
529
+ 'region.url_frame': 'Vložená stránka',
530
+ 'region.url_open': 'Otevřít na nové kartě',
531
+ 'page.unsaved_changes': 'Máte neuložené změny. Opravdu chcete stránku opustit?',
532
+ 'form.lost_update': 'Někdo jiný tento záznam změnil poté, co jste jej otevřeli. Načtěte stránku znovu, abyste viděli aktuální hodnoty, a pak proveďte změny znovu.',
494
533
  'form.deleted': "Záznam byl smazán.",
495
534
  'error.duplicate': "Záznam s těmito hodnotami už existuje{detail}.",
496
535
  'error.referenced': "Na tento záznam stále odkazují jiné záznamy{detail}.",