@cosmicdrift/kumiko-framework 0.418.0 → 0.420.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.
- package/agents/api/framework-engine.md +4 -0
- package/agents/api/framework-ui-types.md +18 -1
- package/agents/api/renderer-web.md +6 -0
- package/agents/api/types.md +10 -1
- package/agents/api.md +2 -2
- package/agents/boot-rules.md +10 -0
- package/agents/examples/pdf-letterhead.md +473 -0
- package/agents/examples.md +1 -0
- package/agents/features.md +11 -0
- package/agents/widgets.md +1 -0
- package/dist/crypto/subject-resolver.d.ts +1 -0
- package/dist/crypto/subject-resolver.js +8 -2
- package/dist/db/queries/backfill-pii.js +29 -3
- package/dist/engine/boot-validator/action-form-preview-rules.d.ts +5 -0
- package/dist/engine/boot-validator/action-form-preview-rules.js +5 -0
- package/dist/engine/boot-validator/action-form-preview.js +13 -0
- package/dist/engine/boot-validator/boot-phases-app.js +2 -0
- package/dist/engine/boot-validator/boot-rules.d.ts +26 -0
- package/dist/engine/boot-validator/boot-rules.js +2 -0
- package/dist/engine/boot-validator/page-help-rules.d.ts +17 -0
- package/dist/engine/boot-validator/page-help-rules.js +17 -0
- package/dist/engine/boot-validator/page-help.d.ts +2 -0
- package/dist/engine/boot-validator/page-help.js +109 -0
- package/dist/engine/boot-validator/screens-actions.d.ts +5 -0
- package/dist/engine/boot-validator/screens-actions.js +15 -6
- package/dist/engine/boot-validator/screens-forms-rules.d.ts +5 -0
- package/dist/engine/boot-validator/screens-forms-rules.js +5 -0
- package/dist/engine/boot-validator/screens-forms.js +13 -1
- package/dist/engine/boot-validator/url-prefill-fields.js +5 -11
- package/dist/engine/registry-ingest.js +11 -0
- package/dist/i18n/required-surface-keys.d.ts +2 -0
- package/dist/i18n/required-surface-keys.js +11 -1
- package/dist/migrations/pii-event-backfill.js +4 -1
- package/dist/ui-types/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/changes.json +18 -0
|
@@ -14,6 +14,7 @@ import { validateGlobalTenancyEntities } from "./global-tenancy.js";
|
|
|
14
14
|
import { validateFieldValueTranslations, validateI18nSurfaceKeys, validateRequiredLocales, validateTranslationLocaleConsistency, } from "./i18n-keys.js";
|
|
15
15
|
import { validateListSortAndSummary } from "./list-sort-summary.js";
|
|
16
16
|
import { validateNavCycles } from "./nav.js";
|
|
17
|
+
import { validatePageHelp } from "./page-help.js";
|
|
17
18
|
import { validateProjectionListScreens, validateRelatedListSectionQueries, } from "./projection-list-screens.js";
|
|
18
19
|
import { validateQueryOutputColumns } from "./query-output-columns.js";
|
|
19
20
|
import { validateExtensionSelectorPanels } from "./selector-owner-panels.js";
|
|
@@ -33,6 +34,7 @@ const APP_CHECKS_AFTER_I18N = [
|
|
|
33
34
|
run: (c) => validateFieldValueTranslations(c.features, c.options?.requireFieldValueTranslations),
|
|
34
35
|
},
|
|
35
36
|
{ check: "validateEntityListScreens", run: (c) => validateEntityListScreens(c.features) },
|
|
37
|
+
{ check: "validatePageHelp", run: (c) => validatePageHelp(c.features) },
|
|
36
38
|
{
|
|
37
39
|
check: "validateSubmitPrefilledHiddenFields",
|
|
38
40
|
run: (c) => validateSubmitPrefilledHiddenFields(c.features),
|
|
@@ -141,6 +141,22 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
|
|
|
141
141
|
readonly summary: "Every column without a label names an entity field, derived field or row-meta column.";
|
|
142
142
|
readonly fix: "Fix the column field name or give the column a label.";
|
|
143
143
|
};
|
|
144
|
+
}, {
|
|
145
|
+
readonly statusFieldInvalid: {
|
|
146
|
+
readonly id: "page-help/status-field-invalid";
|
|
147
|
+
readonly summary: "Every status section of a pageHelp names a select field of an existing entity, bare for the own feature or `<feature>:<entity>` for another one (entity is required on a projectionDetail; a relatedList defaults to its section entity).";
|
|
148
|
+
readonly fix: "Point the status section's field at a select field and its entity at an existing entity (`<feature>:<entity>` for a foreign one).";
|
|
149
|
+
};
|
|
150
|
+
readonly optionHelpMissing: {
|
|
151
|
+
readonly id: "page-help/option-help-missing";
|
|
152
|
+
readonly summary: "Every option of the pageHelp field has a `:help` translation, in the feature that owns the entity, in each locale its option label has.";
|
|
153
|
+
readonly fix: "Add `<option label key>:help` via r.translations(...) in the owning feature for the listed options and locales.";
|
|
154
|
+
};
|
|
155
|
+
readonly unsupportedSite: {
|
|
156
|
+
readonly id: "page-help/unsupported-site";
|
|
157
|
+
readonly summary: "A relatedList's pageHelp only joins the help of a projectionDetail; on a relatedList of an entityEdit it would be ignored.";
|
|
158
|
+
readonly fix: "Declare pageHelp on the projectionDetail or entityList instead.";
|
|
159
|
+
};
|
|
144
160
|
}, {
|
|
145
161
|
readonly projectionQueryAcceptsNamedFilter: {
|
|
146
162
|
readonly id: "named-filter/projection-query-accepts-named-filter";
|
|
@@ -961,6 +977,11 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
|
|
|
961
977
|
readonly summary: "actionForm fieldBadges keys name fields of the form.";
|
|
962
978
|
readonly fix: "Name a field of the form or remove the entry.";
|
|
963
979
|
};
|
|
980
|
+
readonly editorFieldType: {
|
|
981
|
+
readonly id: "form/editor-field-type";
|
|
982
|
+
readonly summary: "The editor option targets a longText field without fillAction or valueChips.";
|
|
983
|
+
readonly fix: "Remove editor, or use a longText field and drop fillAction and valueChips.";
|
|
984
|
+
};
|
|
964
985
|
readonly aiAssistContextFieldUnknown: {
|
|
965
986
|
readonly id: "form/ai-assist-context-field-unknown";
|
|
966
987
|
readonly summary: "aiAssist.contextFields names fields of the same form.";
|
|
@@ -2951,6 +2972,11 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
|
|
|
2951
2972
|
readonly summary: "preview.list names the result field of its rows and at least one column.";
|
|
2952
2973
|
readonly fix: "Set list.field to the array in the query result and list the columns to show.";
|
|
2953
2974
|
};
|
|
2975
|
+
readonly sectionUnknown: {
|
|
2976
|
+
readonly id: "action-form-preview/section-unknown";
|
|
2977
|
+
readonly summary: "preview.section names a fields section of the layout.";
|
|
2978
|
+
readonly fix: "Give a layout section that id, or drop section to show the preview below the form.";
|
|
2979
|
+
};
|
|
2954
2980
|
readonly empty: {
|
|
2955
2981
|
readonly id: "action-form-preview/empty";
|
|
2956
2982
|
readonly summary: "A preview shows facts or a list.";
|
|
@@ -37,6 +37,7 @@ import { LIST_TABLE_RULES } from "./list-table-rules.js";
|
|
|
37
37
|
import { NAMED_FILTER_RULES } from "./named-filter-rules.js";
|
|
38
38
|
import { NAV_RULES } from "./nav-rules.js";
|
|
39
39
|
import { OWNERSHIP_RULES } from "./ownership-rules.js";
|
|
40
|
+
import { PAGE_HELP_RULES } from "./page-help-rules.js";
|
|
40
41
|
import { PII_RULES } from "./pii-retention-rules.js";
|
|
41
42
|
import { QUERY_RULES } from "./query-rules.js";
|
|
42
43
|
import { SCREEN_ACTION_RULES } from "./screens-actions-rules.js";
|
|
@@ -51,6 +52,7 @@ import { SCREEN_RULES } from "./screens-rules.js";
|
|
|
51
52
|
export const FRAMEWORK_BOOT_RULE_TABLES = [
|
|
52
53
|
PII_RULES,
|
|
53
54
|
ENTITY_LIST_RULES,
|
|
55
|
+
PAGE_HELP_RULES,
|
|
54
56
|
NAMED_FILTER_RULES,
|
|
55
57
|
I18N_RULES,
|
|
56
58
|
CARD_META_OVERFLOW_RULES,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const PAGE_HELP_RULES: {
|
|
2
|
+
readonly statusFieldInvalid: {
|
|
3
|
+
readonly id: "page-help/status-field-invalid";
|
|
4
|
+
readonly summary: "Every status section of a pageHelp names a select field of an existing entity, bare for the own feature or `<feature>:<entity>` for another one (entity is required on a projectionDetail; a relatedList defaults to its section entity).";
|
|
5
|
+
readonly fix: "Point the status section's field at a select field and its entity at an existing entity (`<feature>:<entity>` for a foreign one).";
|
|
6
|
+
};
|
|
7
|
+
readonly optionHelpMissing: {
|
|
8
|
+
readonly id: "page-help/option-help-missing";
|
|
9
|
+
readonly summary: "Every option of the pageHelp field has a `:help` translation, in the feature that owns the entity, in each locale its option label has.";
|
|
10
|
+
readonly fix: "Add `<option label key>:help` via r.translations(...) in the owning feature for the listed options and locales.";
|
|
11
|
+
};
|
|
12
|
+
readonly unsupportedSite: {
|
|
13
|
+
readonly id: "page-help/unsupported-site";
|
|
14
|
+
readonly summary: "A relatedList's pageHelp only joins the help of a projectionDetail; on a relatedList of an entityEdit it would be ignored.";
|
|
15
|
+
readonly fix: "Declare pageHelp on the projectionDetail or entityList instead.";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const PAGE_HELP_RULES = {
|
|
2
|
+
statusFieldInvalid: {
|
|
3
|
+
id: "page-help/status-field-invalid",
|
|
4
|
+
summary: "Every status section of a pageHelp names a select field of an existing entity, bare for the own feature or `<feature>:<entity>` for another one (entity is required on a projectionDetail; a relatedList defaults to its section entity).",
|
|
5
|
+
fix: "Point the status section's field at a select field and its entity at an existing entity (`<feature>:<entity>` for a foreign one).",
|
|
6
|
+
},
|
|
7
|
+
optionHelpMissing: {
|
|
8
|
+
id: "page-help/option-help-missing",
|
|
9
|
+
summary: "Every option of the pageHelp field has a `:help` translation, in the feature that owns the entity, in each locale its option label has.",
|
|
10
|
+
fix: "Add `<option label key>:help` via r.translations(...) in the owning feature for the listed options and locales.",
|
|
11
|
+
},
|
|
12
|
+
unsupportedSite: {
|
|
13
|
+
id: "page-help/unsupported-site",
|
|
14
|
+
summary: "A relatedList's pageHelp only joins the help of a projectionDetail; on a relatedList of an entityEdit it would be ignored.",
|
|
15
|
+
fix: "Declare pageHelp on the projectionDetail or entityList instead.",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { hasLocaleValue, selectFacetOptionKey } from "../../i18n/required-surface-keys.js";
|
|
2
|
+
import { parseRefTarget } from "../parse-ref-target.js";
|
|
3
|
+
import { collectBootRuleViolations } from "./boot-report.js";
|
|
4
|
+
import { bootRuleError } from "./boot-rule.js";
|
|
5
|
+
import { PAGE_HELP_RULES } from "./page-help-rules.js";
|
|
6
|
+
function statusSitesOf(where, pageHelp, defaultEntity) {
|
|
7
|
+
const found = [];
|
|
8
|
+
for (const section of pageHelp?.sections ?? []) {
|
|
9
|
+
if (section.kind !== "status")
|
|
10
|
+
continue;
|
|
11
|
+
found.push({ where, section, ...(defaultEntity !== undefined && { defaultEntity }) });
|
|
12
|
+
}
|
|
13
|
+
return found;
|
|
14
|
+
}
|
|
15
|
+
function pageHelpSitesOf(feature) {
|
|
16
|
+
const found = [];
|
|
17
|
+
for (const screen of Object.values(feature.screens)) {
|
|
18
|
+
const where = `screen "${screen.id}"`;
|
|
19
|
+
if (screen.type === "entityList" || screen.type === "projectionDetail") {
|
|
20
|
+
found.push(...statusSitesOf(where, screen.pageHelp, screen.type === "entityList" ? screen.entity : undefined));
|
|
21
|
+
}
|
|
22
|
+
if (screen.type !== "projectionDetail")
|
|
23
|
+
continue;
|
|
24
|
+
for (const section of screen.layout.sections) {
|
|
25
|
+
if (!("kind" in section) || section.kind !== "relatedList")
|
|
26
|
+
continue;
|
|
27
|
+
found.push(...statusSitesOf(`${where} relatedList "${section.title}"`, section.pageHelp, section.entity));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return found;
|
|
31
|
+
}
|
|
32
|
+
/** Places a relatedList carries a pageHelp that no screen renders: only a projectionDetail shows it. */
|
|
33
|
+
function unsupportedSitesOf(feature) {
|
|
34
|
+
const found = [];
|
|
35
|
+
for (const screen of Object.values(feature.screens)) {
|
|
36
|
+
if (screen.type !== "entityEdit")
|
|
37
|
+
continue;
|
|
38
|
+
for (const section of screen.layout.sections) {
|
|
39
|
+
if (!("kind" in section) || section.kind !== "relatedList")
|
|
40
|
+
continue;
|
|
41
|
+
if (section.pageHelp !== undefined) {
|
|
42
|
+
found.push(`screen "${screen.id}" relatedList "${section.title}"`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return found;
|
|
47
|
+
}
|
|
48
|
+
function translationByLocale(owner, fullKey) {
|
|
49
|
+
const local = fullKey.slice(owner.name.length + 1);
|
|
50
|
+
return owner.translations?.[local] ?? owner.translations?.[fullKey];
|
|
51
|
+
}
|
|
52
|
+
function checkPageHelpSite(features, feature, site) {
|
|
53
|
+
const prefix = `[pageHelp] Feature "${feature.name}" ${site.where}`;
|
|
54
|
+
const statusField = site.section.field;
|
|
55
|
+
const rawEntity = site.section.entity ?? site.defaultEntity;
|
|
56
|
+
if (rawEntity === undefined) {
|
|
57
|
+
throw bootRuleError(PAGE_HELP_RULES.statusFieldInvalid, {
|
|
58
|
+
message: `${prefix}: pageHelp.entity is required on a projectionDetail.`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const target = parseRefTarget(rawEntity, feature.name);
|
|
62
|
+
const owner = features.find((candidate) => candidate.name === target.featureName);
|
|
63
|
+
if (owner === undefined) {
|
|
64
|
+
throw bootRuleError(PAGE_HELP_RULES.statusFieldInvalid, {
|
|
65
|
+
message: `${prefix}: pageHelp.entity "${rawEntity}" names unknown feature "${target.featureName}".`,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const entityName = target.entityName;
|
|
69
|
+
const entity = owner.entities?.[entityName];
|
|
70
|
+
if (entity === undefined) {
|
|
71
|
+
throw bootRuleError(PAGE_HELP_RULES.statusFieldInvalid, {
|
|
72
|
+
message: `${prefix}: pageHelp.entity "${rawEntity}" is not an entity of feature "${owner.name}".`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const field = entity.fields[statusField];
|
|
76
|
+
if (field === undefined || field.type !== "select") {
|
|
77
|
+
throw bootRuleError(PAGE_HELP_RULES.statusFieldInvalid, {
|
|
78
|
+
message: `${prefix}: pageHelp status field "${statusField}" is not a select field of entity "${entityName}".`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const missing = [];
|
|
82
|
+
for (const value of field.options) {
|
|
83
|
+
const labelKey = selectFacetOptionKey(owner.name, entityName, statusField, value);
|
|
84
|
+
const helpKey = `${labelKey}:help`;
|
|
85
|
+
const labelLocales = Object.keys(translationByLocale(owner, labelKey) ?? {});
|
|
86
|
+
const help = translationByLocale(owner, helpKey);
|
|
87
|
+
const gaps = labelLocales.filter((locale) => !hasLocaleValue(help?.[locale]));
|
|
88
|
+
if (help === undefined && labelLocales.length === 0)
|
|
89
|
+
missing.push(`${value} -> ${helpKey}`);
|
|
90
|
+
else if (gaps.length > 0)
|
|
91
|
+
missing.push(`${value} -> ${helpKey} (${gaps.join(", ")})`);
|
|
92
|
+
}
|
|
93
|
+
if (missing.length > 0) {
|
|
94
|
+
throw bootRuleError(PAGE_HELP_RULES.optionHelpMissing, {
|
|
95
|
+
message: `${prefix}: pageHelp field "${statusField}" lacks help text for option(s): ${missing.join("; ")}. Add them via r.translations(...) in feature "${owner.name}".`,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export function validatePageHelp(features) {
|
|
100
|
+
const checks = features.flatMap((feature) => [
|
|
101
|
+
...unsupportedSitesOf(feature).map((where) => () => {
|
|
102
|
+
throw bootRuleError(PAGE_HELP_RULES.unsupportedSite, {
|
|
103
|
+
message: `[pageHelp] Feature "${feature.name}" ${where}: pageHelp on a relatedList of an entityEdit is never shown.`,
|
|
104
|
+
});
|
|
105
|
+
}),
|
|
106
|
+
...pageHelpSitesOf(feature).map((site) => () => checkPageHelpSite(features, feature, site)),
|
|
107
|
+
]);
|
|
108
|
+
collectBootRuleViolations(checks, (check) => check());
|
|
109
|
+
}
|
|
@@ -20,6 +20,11 @@ export declare function validateScreenShortIdCollisions(screensByShortId: Readon
|
|
|
20
20
|
readonly screen: ScreenDefinition;
|
|
21
21
|
}>>): void;
|
|
22
22
|
export declare function resolveScreenTargetQn(featureName: string, target: string): string;
|
|
23
|
+
export declare function findScreenEntryForNavTarget<E extends {
|
|
24
|
+
readonly featureName: string;
|
|
25
|
+
}>(screensByShortId: ReadonlyMap<string, ReadonlyArray<E>>, target: string): (E & {
|
|
26
|
+
readonly shortId: string;
|
|
27
|
+
}) | undefined;
|
|
23
28
|
export declare function validateScreenNavTarget(featureName: string, screenId: string, screenKind: string, fieldName: string, value: string, allScreenQns: ReadonlySet<string>, screens: FeatureDefinition["screens"]): void;
|
|
24
29
|
export declare function validateDrawerTargetAction(featureName: string, screenId: string, screenKind: string, actionLabel: "toolbarAction" | "rowAction" | "emptyState action" | "action", action: {
|
|
25
30
|
readonly id: string;
|
|
@@ -2,7 +2,7 @@ import { resolveActionIcon } from "@cosmicdrift/kumiko-types/action-icon";
|
|
|
2
2
|
import { NAV_ICON_KEYS } from "@cosmicdrift/kumiko-types/nav-icon";
|
|
3
3
|
import { fallbackTargets, SCREEN_FALLBACK_REASONS, } from "@cosmicdrift/kumiko-types/screen";
|
|
4
4
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
5
|
-
import { isKebabSegment, isValidQn, qualifyEntityName } from "../qualified-name.js";
|
|
5
|
+
import { isKebabSegment, isValidQn, parseQn, qualifyEntityName } from "../qualified-name.js";
|
|
6
6
|
import { isFieldsEditSection, normalizeEditField, sectionFieldSpecs } from "../screen-helpers.js";
|
|
7
7
|
import { bootRuleError } from "./boot-rule.js";
|
|
8
8
|
import { SCREEN_ACTION_RULES } from "./screens-actions-rules.js";
|
|
@@ -215,6 +215,19 @@ export function validateScreenShortIdCollisions(screensByShortId) {
|
|
|
215
215
|
export function resolveScreenTargetQn(featureName, target) {
|
|
216
216
|
return isValidQn(target) ? target : qualifyEntityName(featureName, "screen", target);
|
|
217
217
|
}
|
|
218
|
+
// A navigate `screen` target is a short id (first feature registering it, like the
|
|
219
|
+
// router) or a screen QN (the entry of exactly that feature).
|
|
220
|
+
export function findScreenEntryForNavTarget(screensByShortId, target) {
|
|
221
|
+
if (!isValidQn(target)) {
|
|
222
|
+
const match = screensByShortId.get(target)?.[0];
|
|
223
|
+
return match === undefined ? undefined : { ...match, shortId: target };
|
|
224
|
+
}
|
|
225
|
+
const { scope, type, name } = parseQn(target);
|
|
226
|
+
if (type !== "screen")
|
|
227
|
+
return undefined;
|
|
228
|
+
const match = screensByShortId.get(name)?.find((entry) => entry.featureName === scope);
|
|
229
|
+
return match === undefined ? undefined : { ...match, shortId: name };
|
|
230
|
+
}
|
|
218
231
|
export function validateScreenNavTarget(featureName, screenId, screenKind, fieldName, value, allScreenQns, screens) {
|
|
219
232
|
const candidateQn = resolveScreenTargetQn(featureName, value);
|
|
220
233
|
if (!allScreenQns.has(candidateQn)) {
|
|
@@ -380,11 +393,7 @@ export function resolveRowActionNavigateTarget(featureName, screenId, screenType
|
|
|
380
393
|
`navigate-target "${action.screen}" does not resolve to a registered screen in any feature. Use "<feature>:screen:<id>" of an existing screen.`,
|
|
381
394
|
});
|
|
382
395
|
}
|
|
383
|
-
const
|
|
384
|
-
const screensWithShortId = screensByShortId.get(targetIsQn ? action.screen.slice(action.screen.lastIndexOf(":") + 1) : action.screen);
|
|
385
|
-
const target = targetIsQn
|
|
386
|
-
? screensWithShortId?.find((entry) => qualifyEntityName(entry.featureName, "screen", entry.screen.id) === candidateQn)
|
|
387
|
-
: screensWithShortId?.[0];
|
|
396
|
+
const target = findScreenEntryForNavTarget(screensByShortId, action.screen);
|
|
388
397
|
validateRowActionNavigateTab(featureName, screenId, screenType, actionLabel, action, target);
|
|
389
398
|
return target;
|
|
390
399
|
}
|
|
@@ -59,6 +59,11 @@ export declare const FORM_FIELD_RULES: {
|
|
|
59
59
|
readonly summary: "actionForm fieldBadges keys name fields of the form.";
|
|
60
60
|
readonly fix: "Name a field of the form or remove the entry.";
|
|
61
61
|
};
|
|
62
|
+
readonly editorFieldType: {
|
|
63
|
+
readonly id: "form/editor-field-type";
|
|
64
|
+
readonly summary: "The editor option targets a longText field without fillAction or valueChips.";
|
|
65
|
+
readonly fix: "Remove editor, or use a longText field and drop fillAction and valueChips.";
|
|
66
|
+
};
|
|
62
67
|
readonly aiAssistContextFieldUnknown: {
|
|
63
68
|
readonly id: "form/ai-assist-context-field-unknown";
|
|
64
69
|
readonly summary: "aiAssist.contextFields names fields of the same form.";
|
|
@@ -59,6 +59,11 @@ export const FORM_FIELD_RULES = {
|
|
|
59
59
|
summary: "actionForm fieldBadges keys name fields of the form.",
|
|
60
60
|
fix: "Name a field of the form or remove the entry.",
|
|
61
61
|
},
|
|
62
|
+
editorFieldType: {
|
|
63
|
+
id: "form/editor-field-type",
|
|
64
|
+
summary: "The editor option targets a longText field without fillAction or valueChips.",
|
|
65
|
+
fix: "Remove editor, or use a longText field and drop fillAction and valueChips.",
|
|
66
|
+
},
|
|
62
67
|
aiAssistContextFieldUnknown: {
|
|
63
68
|
id: "form/ai-assist-context-field-unknown",
|
|
64
69
|
summary: "aiAssist.contextFields names fields of the same form.",
|
|
@@ -126,7 +126,19 @@ function validateAssistTargets(where, fieldSpec, fieldDef) {
|
|
|
126
126
|
// skip: the field is unknown (reported elsewhere)
|
|
127
127
|
if (fieldDef === undefined)
|
|
128
128
|
return;
|
|
129
|
-
const { aiAssist, valueChips } = fieldSpec;
|
|
129
|
+
const { aiAssist, valueChips, editor } = fieldSpec;
|
|
130
|
+
if (editor !== undefined) {
|
|
131
|
+
if (fieldDef.type !== "longText") {
|
|
132
|
+
throw bootRuleError(FORM_FIELD_RULES.editorFieldType, {
|
|
133
|
+
message: `${where} editor "${editor}" needs a longText field, not "${fieldDef.type}".`,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (fieldSpec.fillAction !== undefined || valueChips !== undefined) {
|
|
137
|
+
throw bootRuleError(FORM_FIELD_RULES.editorFieldType, {
|
|
138
|
+
message: `${where} editor "${editor}" cannot be combined with fillAction or valueChips; they target a plain input.`,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
130
142
|
if (valueChips !== undefined && !VALUE_CHIPS_FIELD_TYPES.includes(fieldDef.type)) {
|
|
131
143
|
throw bootRuleError(FORM_FIELD_RULES.valueChipsFieldType, {
|
|
132
144
|
message: `${where} valueChips needs a ${VALUE_CHIPS_FIELD_TYPES.join(", ")} field, not "${fieldDef.type}".`,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qualifyEntityName } from "../qualified-name.js";
|
|
2
2
|
import { isFieldsEditSection, normalizeEditField, sectionFieldSpecs } from "../screen-helpers.js";
|
|
3
3
|
import { bootRuleError } from "./boot-rule.js";
|
|
4
4
|
import { collectScreensByShortId, readsNavigateParamsAsFormPrefill, rowFieldExtractorKeys, validateDrawerPrefillKeys, } from "./screens.js";
|
|
5
|
+
import { findScreenEntryForNavTarget } from "./screens-actions.js";
|
|
5
6
|
import { SCREEN_RULES } from "./screens-rules.js";
|
|
6
7
|
function isNavigateKind(action) {
|
|
7
8
|
return action.kind === undefined || action.kind === "navigate";
|
|
@@ -125,21 +126,14 @@ export function collectUrlPrefillFieldsByScreenQn(features) {
|
|
|
125
126
|
return result;
|
|
126
127
|
}
|
|
127
128
|
// Runtime resolution: a bare screen id matches the first feature registering
|
|
128
|
-
// it (create-app's router)
|
|
129
|
+
// it (create-app's router), a screen QN the screen of exactly that feature;
|
|
130
|
+
// an entity target opens its detailFor screen with an id.
|
|
129
131
|
function resolveTarget(source, screensByShortId, detailForByEntity) {
|
|
130
132
|
if (source.entity !== undefined)
|
|
131
133
|
return detailForByEntity.get(source.entity);
|
|
132
134
|
if (source.screen === undefined)
|
|
133
135
|
return undefined;
|
|
134
|
-
|
|
135
|
-
const { scope, type, name } = parseQn(source.screen);
|
|
136
|
-
if (type !== "screen")
|
|
137
|
-
return undefined;
|
|
138
|
-
const match = screensByShortId.get(name)?.find((entry) => entry.featureName === scope);
|
|
139
|
-
return match === undefined ? undefined : { ...match, shortId: name };
|
|
140
|
-
}
|
|
141
|
-
const match = screensByShortId.get(source.screen)?.[0];
|
|
142
|
-
return match === undefined ? undefined : { ...match, shortId: source.screen };
|
|
136
|
+
return findScreenEntryForNavTarget(screensByShortId, source.screen);
|
|
143
137
|
}
|
|
144
138
|
function assertHiddenRequiredFieldsSeeded(featureName, screenId, screen, seeded) {
|
|
145
139
|
for (const section of screen.layout.sections) {
|
|
@@ -103,6 +103,17 @@ const RESERVED_TEMPLATE_VARIABLE_NAMES = new Set([
|
|
|
103
103
|
"signature",
|
|
104
104
|
"imprint",
|
|
105
105
|
"unsubscribeUrl",
|
|
106
|
+
// Mirrors COMPANY_PLACEHOLDERS: the renderer fills them from the tenant's company data.
|
|
107
|
+
"companyAddress",
|
|
108
|
+
"companyPhone",
|
|
109
|
+
"companyEmail",
|
|
110
|
+
"companyWebsite",
|
|
111
|
+
"companyRegister",
|
|
112
|
+
"companyVatId",
|
|
113
|
+
"companyManagement",
|
|
114
|
+
"companyBank",
|
|
115
|
+
"companyIban",
|
|
116
|
+
"companyBic",
|
|
106
117
|
// Handlebars helpers of the mail renderer win over context values of the
|
|
107
118
|
// same name, so a variable called like a helper would never render.
|
|
108
119
|
"link",
|
|
@@ -2,6 +2,7 @@ import type { NavDefinition } from "@cosmicdrift/kumiko-types/nav";
|
|
|
2
2
|
import type { ScreenDefinition } from "@cosmicdrift/kumiko-types/screen";
|
|
3
3
|
import type { WorkspaceDefinition } from "@cosmicdrift/kumiko-types/workspace";
|
|
4
4
|
import type { FeatureDefinition } from "../engine/types/index.ts";
|
|
5
|
+
import type { TranslationValue } from "../ui-types/plural.ts";
|
|
5
6
|
/** Pseudo-entity for actionForm field labels (renderer action-form-shim). */
|
|
6
7
|
export declare const ACTION_FORM_ENTITY = "__action-form__";
|
|
7
8
|
/** Pseudo-entity for configEdit field labels (renderer config-edit-shim). */
|
|
@@ -38,6 +39,7 @@ export type TranslationLocaleGap = {
|
|
|
38
39
|
readonly key: string;
|
|
39
40
|
readonly missingLocales: readonly string[];
|
|
40
41
|
};
|
|
42
|
+
export declare function hasLocaleValue(value: TranslationValue | undefined): boolean;
|
|
41
43
|
/**
|
|
42
44
|
* Per feature, every translation key must carry every locale that any key of the
|
|
43
45
|
* same feature carries. A feature with a single locale across all keys is
|
|
@@ -223,6 +223,13 @@ function pushToolbarActionKeys(out, action) {
|
|
|
223
223
|
pushKey(out, action.subtitle);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
+
function pushPageHelpKeys(out, pageHelp) {
|
|
227
|
+
for (const section of pageHelp?.sections ?? []) {
|
|
228
|
+
pushKey(out, section.title);
|
|
229
|
+
if (section.kind === "text")
|
|
230
|
+
pushKey(out, section.text);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
226
233
|
function pushRelatedListSectionKeys(out, section) {
|
|
227
234
|
pushKey(out, section.title);
|
|
228
235
|
pushKey(out, section.description);
|
|
@@ -298,6 +305,7 @@ function collectEntityListKeys(ctx, list) {
|
|
|
298
305
|
}
|
|
299
306
|
}
|
|
300
307
|
pushListChromeKeys(ctx.out, list);
|
|
308
|
+
pushPageHelpKeys(ctx.out, list.pageHelp);
|
|
301
309
|
if (list.expandableRow !== undefined)
|
|
302
310
|
pushExpandableRowKeys(ctx.out, list.expandableRow);
|
|
303
311
|
}
|
|
@@ -430,6 +438,7 @@ function collectProjectionDetailKeys(ctx, detail) {
|
|
|
430
438
|
for (const metric of detail.metrics ?? [])
|
|
431
439
|
pushKey(ctx.out, metric.label);
|
|
432
440
|
pushKey(ctx.out, detail.header?.narrowTitle);
|
|
441
|
+
pushPageHelpKeys(ctx.out, detail.pageHelp);
|
|
433
442
|
for (const section of detail.layout.sections) {
|
|
434
443
|
pushKey(ctx.out, section.tabLabel);
|
|
435
444
|
if ("descriptionNarrow" in section)
|
|
@@ -443,6 +452,7 @@ function collectProjectionDetailKeys(ctx, detail) {
|
|
|
443
452
|
}
|
|
444
453
|
if (section.kind === "relatedList") {
|
|
445
454
|
pushRelatedListSectionKeys(ctx.out, section);
|
|
455
|
+
pushPageHelpKeys(ctx.out, section.pageHelp);
|
|
446
456
|
for (const bulk of section.bulkActions ?? [])
|
|
447
457
|
pushBulkActionKeys(ctx.out, bulk);
|
|
448
458
|
continue;
|
|
@@ -575,7 +585,7 @@ export function buildEffectiveTranslationKeys(features) {
|
|
|
575
585
|
}
|
|
576
586
|
return out;
|
|
577
587
|
}
|
|
578
|
-
function hasLocaleValue(value) {
|
|
588
|
+
export function hasLocaleValue(value) {
|
|
579
589
|
if (value === undefined)
|
|
580
590
|
return false;
|
|
581
591
|
const forms = typeof value === "string" ? [value] : Object.values(value);
|
|
@@ -80,7 +80,7 @@ export function piiAnnotationEntries(registry) {
|
|
|
80
80
|
// Bump when the backfill gains a transform stage: completed states keyed by the
|
|
81
81
|
// old fingerprint must run one more full pass. Kept out of piiAnnotationEntries,
|
|
82
82
|
// whose emptiness gates no_pii.
|
|
83
|
-
const PII_BACKFILL_TRANSFORM_VERSION = "
|
|
83
|
+
const PII_BACKFILL_TRANSFORM_VERSION = "self-owned-rekey-v4";
|
|
84
84
|
export function piiAnnotationFingerprint(registry) {
|
|
85
85
|
return createHash("sha256")
|
|
86
86
|
.update([...piiAnnotationEntries(registry), PII_BACKFILL_TRANSFORM_VERSION].join("\n"))
|
|
@@ -206,6 +206,9 @@ function reportRunOutcome(log, progress) {
|
|
|
206
206
|
"backfillEventPiiEncryption(..., { eraseUnresolvableSubjects: true })", {
|
|
207
207
|
failureCount: progress.failures.length,
|
|
208
208
|
eventIds: progress.failures.slice(0, MAX_LOGGED_FAILURE_IDS).map((f) => f.eventId),
|
|
209
|
+
failures: progress.failures
|
|
210
|
+
.slice(0, MAX_LOGGED_FAILURE_IDS)
|
|
211
|
+
.map((f) => ({ eventId: f.eventId, reason: f.reason })),
|
|
209
212
|
});
|
|
210
213
|
}
|
|
211
214
|
}
|
package/dist/ui-types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { EmbeddedDerivedCellDef, EntityDefinition, FieldDefinition, Options
|
|
|
11
11
|
export type { AccessRule } from "../engine/types/handlers.ts";
|
|
12
12
|
export { isOpenToAllGranted, isUiAccessGranted } from "../engine/types/handlers.ts";
|
|
13
13
|
export type { IconKey, NavDefinition, NavIconKey } from "../engine/types/nav.ts";
|
|
14
|
-
export type { ActionFormFooterAction, ActionFormLoad, ActionFormPreview, ActionFormPreviewList, ActionFormRedirect, ActionFormScreenDefinition, ActionFormSuccessFact, ActionFormSuccessItems, ActionFormSuccessLink, ActionFormValueType, ConfigEditAction, ConfigEditScreenDefinition, CustomScreenDefinition, DashboardChartMarkerKind, DashboardChartPanel, DashboardCurrencyFormat, DashboardCustomPanel, DashboardDateParam, DashboardFeedPanel, DashboardFilterDefinition, DashboardI18nText, DashboardLayout, DashboardListFooterLink, DashboardListNarrow, DashboardListPanel, DashboardListRowToneMarker, DashboardMoneyParam, DashboardPanelColumn, DashboardPanelDefinition, DashboardPanelEmptyState, DashboardPanelNarrow, DashboardPanelQueryOptions, DashboardPanelSpan, DashboardPanelVisibility, DashboardProgressListPanel, DashboardProgressTone, DashboardRefresh, DashboardRelativeTimeParam, DashboardScopeDefinition, DashboardScreenDefinition, DashboardScreenPanel, DashboardStatGroupLayout, DashboardStatGroupLink, DashboardStatGroupNarrow, DashboardStatGroupPanel, DashboardStatPanel, DashboardText, DashboardTextBlock, DashboardTextPanel, DashboardTextParam, DashboardTimeRangeDefinition, EditExtensionSection, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditStepListSection, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditScreenDefinition, EntityListFacetConfig, EntityListScreenDefinition, FieldAffix, FieldAiAssist, FieldAiAssistChip, FieldBadge, FieldCondition, FieldFillAction, FieldIconKey, FieldRenderer, FieldTextRef, FieldValueChips, FormWidth, ListBulkAction, ListColumnHint, ListColumnSpec, ListEmptyStateSpec, ListFacetSpec, ListRowDecoration, ListSortOption, ListSortSpec, ListTableOptions, ListTableSummaryRow, ListToolbarActionsPlacement, MetricNavigate, PlatformComponent, ProjectionDetailInitialTab, ProjectionDetailScreenDefinition, ProjectionListScreenDefinition, RecordBannerSpec, RecordBreadcrumbItem, RecordBreadcrumbSpec, RecordHeaderSubtitlePart, RecordNotice, RecordProgress, RecordProgressSpec, RecordProgressStep, RecordStep, RecordStepsSpec, RecordSummarySpec, RelatedListEmptyStateSpec, RelatedListEmptyStateVariant, RelatedListRowTone, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionWriteHandler, RowFieldExtractor, ScreenDefinition, ScreenFallback, ScreenFallbackByReason, ScreenFallbackReason, ScreenSlots, ScreenVisibility, SecretMintConfirmStep, SecretMintScreenDefinition, SecretsEditScreenDefinition, StepListItem, ToolbarAction, } from "../engine/types/screen.ts";
|
|
14
|
+
export type { ActionFormFooterAction, ActionFormLoad, ActionFormPreview, ActionFormPreviewList, ActionFormRedirect, ActionFormScreenDefinition, ActionFormSuccessFact, ActionFormSuccessItems, ActionFormSuccessLink, ActionFormValueType, ConfigEditAction, ConfigEditScreenDefinition, CustomScreenDefinition, DashboardChartMarkerKind, DashboardChartPanel, DashboardCurrencyFormat, DashboardCustomPanel, DashboardDateParam, DashboardFeedPanel, DashboardFilterDefinition, DashboardI18nText, DashboardLayout, DashboardListFooterLink, DashboardListNarrow, DashboardListPanel, DashboardListRowToneMarker, DashboardMoneyParam, DashboardPanelColumn, DashboardPanelDefinition, DashboardPanelEmptyState, DashboardPanelNarrow, DashboardPanelQueryOptions, DashboardPanelSpan, DashboardPanelVisibility, DashboardProgressListPanel, DashboardProgressTone, DashboardRefresh, DashboardRelativeTimeParam, DashboardScopeDefinition, DashboardScreenDefinition, DashboardScreenPanel, DashboardStatGroupLayout, DashboardStatGroupLink, DashboardStatGroupNarrow, DashboardStatGroupPanel, DashboardStatPanel, DashboardText, DashboardTextBlock, DashboardTextPanel, DashboardTextParam, DashboardTimeRangeDefinition, EditExtensionSection, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditStepListSection, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditScreenDefinition, EntityListFacetConfig, EntityListScreenDefinition, FieldAffix, FieldAiAssist, FieldAiAssistChip, FieldBadge, FieldCondition, FieldFillAction, FieldIconKey, FieldRenderer, FieldTextRef, FieldValueChips, FormWidth, ListBulkAction, ListColumnHint, ListColumnSpec, ListEmptyStateSpec, ListFacetSpec, ListRowDecoration, ListSortOption, ListSortSpec, ListTableOptions, ListTableSummaryRow, ListToolbarActionsPlacement, MetricNavigate, PageHelpSection, PageHelpSpec, PageHelpStatusSection, PageHelpTextSection, PlatformComponent, ProjectionDetailInitialTab, ProjectionDetailScreenDefinition, ProjectionListScreenDefinition, RecordBannerSpec, RecordBreadcrumbItem, RecordBreadcrumbSpec, RecordHeaderSubtitlePart, RecordNotice, RecordProgress, RecordProgressSpec, RecordProgressStep, RecordStep, RecordStepsSpec, RecordSummarySpec, RelatedListEmptyStateSpec, RelatedListEmptyStateVariant, RelatedListRowTone, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionWriteHandler, RowFieldExtractor, ScreenDefinition, ScreenFallback, ScreenFallbackByReason, ScreenFallbackReason, ScreenSlots, ScreenVisibility, SecretMintConfirmStep, SecretMintScreenDefinition, SecretsEditScreenDefinition, StepListItem, ToolbarAction, } from "../engine/types/screen.ts";
|
|
15
15
|
export { MAX_BULK_SELECTION } from "../engine/types/screen.ts";
|
|
16
16
|
export type { TargetRef } from "../engine/types/target-ref.ts";
|
|
17
17
|
export type { TreeAction } from "../engine/types/tree-node.ts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.420.0",
|
|
4
4
|
"description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
"./package.json": "./package.json"
|
|
205
205
|
},
|
|
206
206
|
"dependencies": {
|
|
207
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
207
|
+
"@cosmicdrift/kumiko-types": "0.420.0",
|
|
208
208
|
"bullmq": "^5.81.5",
|
|
209
209
|
"hono": "^4.13.14",
|
|
210
210
|
"i18next": "^26.5.12",
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
228
|
"devDependencies": {
|
|
229
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
229
|
+
"@cosmicdrift/kumiko-testing": "0.420.0",
|
|
230
230
|
"bun-types": "^1.4.4",
|
|
231
231
|
"fflate": "^0.8.3",
|
|
232
232
|
"meilisearch": "^0.62.0",
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.420.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "PII event backfill stops growing self-owned personal fields",
|
|
6
|
+
"detail": "A personal field that is its own owner (for example invitedBy) was re-keyed under its own ciphertext on every boot. The backfill now keys it under the decrypted user id, repairs values already keyed wrongly, and logs the failure reason per event."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.420.0",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "Navigate targets resolve through one shared boot-validator helper",
|
|
12
|
+
"detail": "Navigate targets given as a screen QN or a short id now resolve through one shared boot-validator helper."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.419.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "Modal size, labelled action menu and menu item descriptions",
|
|
18
|
+
"detail": "`Modal` takes `size: \"wide\"` for content with lists beside actions. The action menu accepts `triggerLabel` for a labelled button instead of the three-dots icon, and a `MenuItemDef` can carry a `description` line and its own `testId`."
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"version": "0.418.0",
|
|
4
22
|
"type": "improvement",
|