@cosmicdrift/kumiko-framework 0.406.0 → 0.409.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-db.md +1 -0
- package/agents/api/framework-engine.md +15 -2
- package/agents/api/framework-ui-types.md +15 -0
- package/agents/api/renderer-web.md +156 -2
- package/agents/api/types.md +113 -71
- package/agents/api.md +4 -4
- package/agents/boot-rules.md +743 -0
- package/agents/examples/contact.md +167 -0
- package/agents/examples/delivery-notifications.md +34 -1
- package/agents/examples/record-detail-layout.md +13 -2
- package/agents/examples/search.md +65 -3
- package/agents/examples/secrets-demo.md +96 -2
- package/agents/examples/tenant-inactivity.md +138 -0
- package/agents/examples.md +2 -0
- package/agents/features-index.md +4 -0
- package/agents/features.md +24 -1
- package/agents/widgets.md +12 -1
- package/dist/api/export/export-rows.js +1 -0
- package/dist/compliance/index.d.ts +1 -1
- package/dist/db/event-store-executor-read-where.js +15 -5
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.js +1 -1
- package/dist/db/migrate-generator.js +3 -1
- package/dist/db/queries/event-consumer.js +11 -7
- package/dist/db/queries/event-store.d.ts +2 -1
- package/dist/db/queries/event-store.js +25 -6
- package/dist/db/queries/rls-boot-catalog.js +3 -1
- package/dist/db/queries/session-advisory-lock.d.ts +7 -0
- package/dist/db/queries/session-advisory-lock.js +23 -0
- package/dist/db/query.js +7 -10
- package/dist/db/row-level-security-connection.js +4 -2
- package/dist/engine/active-membership.js +1 -0
- package/dist/engine/boot-validator/access-declarations.js +57 -33
- package/dist/engine/boot-validator/action-wiring.js +8 -6
- package/dist/engine/boot-validator/agent-effect-rules.d.ts +12 -0
- package/dist/engine/boot-validator/agent-effect-rules.js +12 -0
- package/dist/engine/boot-validator/agent-effect.d.ts +2 -0
- package/dist/engine/boot-validator/agent-effect.js +20 -0
- package/dist/engine/boot-validator/boot-context.js +5 -1
- package/dist/engine/boot-validator/boot-environment-rules.d.ts +12 -0
- package/dist/engine/boot-validator/boot-environment-rules.js +12 -0
- package/dist/engine/boot-validator/boot-phases-app.js +5 -1
- package/dist/engine/boot-validator/boot-phases.js +3 -1
- package/dist/engine/boot-validator/boot-rules.d.ts +2619 -0
- package/dist/engine/boot-validator/boot-rules.js +58 -0
- package/dist/engine/boot-validator/bundled-lists-table.js +23 -9
- package/dist/engine/boot-validator/config-deps.js +71 -23
- package/dist/engine/boot-validator/config-edit-action-rules.d.ts +17 -0
- package/dist/engine/boot-validator/config-edit-action-rules.js +17 -0
- package/dist/engine/boot-validator/config-key-rules.d.ts +117 -0
- package/dist/engine/boot-validator/config-key-rules.js +117 -0
- package/dist/engine/boot-validator/custom-screen-write-qns.js +6 -2
- package/dist/engine/boot-validator/derived-sql-fields-rules.d.ts +77 -0
- package/dist/engine/boot-validator/derived-sql-fields-rules.js +77 -0
- package/dist/engine/boot-validator/derived-sql-fields.js +53 -17
- package/dist/engine/boot-validator/detail-screens.js +10 -4
- package/dist/engine/boot-validator/entity-declaration-rules.d.ts +92 -0
- package/dist/engine/boot-validator/entity-declaration-rules.js +92 -0
- package/dist/engine/boot-validator/entity-handler-access-rules.d.ts +102 -0
- package/dist/engine/boot-validator/entity-handler-access-rules.js +102 -0
- package/dist/engine/boot-validator/entity-handler.d.ts +0 -7
- package/dist/engine/boot-validator/entity-handler.js +259 -355
- package/dist/engine/boot-validator/entity-image-variants.d.ts +2 -0
- package/dist/engine/boot-validator/entity-image-variants.js +91 -0
- package/dist/engine/boot-validator/entity-list-aggregate-options.js +8 -2
- package/dist/engine/boot-validator/entity-reference-embedded-rules.d.ts +117 -0
- package/dist/engine/boot-validator/entity-reference-embedded-rules.js +117 -0
- package/dist/engine/boot-validator/entity-select-image-rules.d.ts +122 -0
- package/dist/engine/boot-validator/entity-select-image-rules.js +122 -0
- package/dist/engine/boot-validator/entity-select.d.ts +8 -0
- package/dist/engine/boot-validator/entity-select.js +197 -0
- package/dist/engine/boot-validator/entity-structure-rules.d.ts +107 -0
- package/dist/engine/boot-validator/entity-structure-rules.js +107 -0
- package/dist/engine/boot-validator/field-conditions-rules.d.ts +92 -0
- package/dist/engine/boot-validator/field-conditions-rules.js +92 -0
- package/dist/engine/boot-validator/field-conditions.js +67 -22
- package/dist/engine/boot-validator/form-derivations-rules.d.ts +77 -0
- package/dist/engine/boot-validator/form-derivations-rules.js +77 -0
- package/dist/engine/boot-validator/form-derivations.js +52 -18
- package/dist/engine/boot-validator/global-tenancy.js +13 -7
- package/dist/engine/boot-validator/handler-declaration-rules.d.ts +72 -0
- package/dist/engine/boot-validator/handler-declaration-rules.js +72 -0
- package/dist/engine/boot-validator/handler-field-references-rules.d.ts +22 -0
- package/dist/engine/boot-validator/handler-field-references-rules.js +22 -0
- package/dist/engine/boot-validator/handler-field-references.js +14 -6
- package/dist/engine/boot-validator/list-bulk-actions-rules.d.ts +42 -0
- package/dist/engine/boot-validator/list-bulk-actions-rules.js +42 -0
- package/dist/engine/boot-validator/list-bulk-actions.js +29 -11
- package/dist/engine/boot-validator/list-column-layout.js +22 -10
- package/dist/engine/boot-validator/list-query-rules.d.ts +107 -0
- package/dist/engine/boot-validator/list-query-rules.js +107 -0
- package/dist/engine/boot-validator/list-table-aggregate-options.js +43 -15
- package/dist/engine/boot-validator/list-table-aggregate-query.js +7 -3
- package/dist/engine/boot-validator/list-table-aggregate-rules.d.ts +82 -0
- package/dist/engine/boot-validator/list-table-aggregate-rules.js +82 -0
- package/dist/engine/boot-validator/list-table-export-options.js +19 -7
- package/dist/engine/boot-validator/list-table-options.js +33 -13
- package/dist/engine/boot-validator/list-table-reject-unknown-keys.js +6 -2
- package/dist/engine/boot-validator/list-table-rules.d.ts +132 -0
- package/dist/engine/boot-validator/list-table-rules.js +132 -0
- package/dist/engine/boot-validator/nav-rules.d.ts +42 -0
- package/dist/engine/boot-validator/nav-rules.js +42 -0
- package/dist/engine/boot-validator/nav.js +29 -15
- package/dist/engine/boot-validator/ownership-rules.d.ts +27 -0
- package/dist/engine/boot-validator/ownership-rules.js +27 -0
- package/dist/engine/boot-validator/ownership.js +28 -12
- package/dist/engine/boot-validator/parent-ref.js +32 -20
- package/dist/engine/boot-validator/projection-list-screens.js +76 -35
- package/dist/engine/boot-validator/query-output-columns.js +9 -3
- package/dist/engine/boot-validator/query-refs.js +20 -10
- package/dist/engine/boot-validator/query-rules.d.ts +37 -0
- package/dist/engine/boot-validator/query-rules.js +37 -0
- package/dist/engine/boot-validator/read-gate.js +14 -10
- package/dist/engine/boot-validator/record-owned.js +5 -1
- package/dist/engine/boot-validator/related-list-table-rules.js +17 -7
- package/dist/engine/boot-validator/screens-actions-rules.d.ts +185 -0
- package/dist/engine/boot-validator/screens-actions-rules.js +185 -0
- package/dist/engine/boot-validator/screens-actions.js +169 -93
- package/dist/engine/boot-validator/screens-dashboard-chart-rules.d.ts +87 -0
- package/dist/engine/boot-validator/screens-dashboard-chart-rules.js +87 -0
- package/dist/engine/boot-validator/screens-dashboard-rules.d.ts +227 -0
- package/dist/engine/boot-validator/screens-dashboard-rules.js +227 -0
- package/dist/engine/boot-validator/screens-dashboard.js +222 -85
- package/dist/engine/boot-validator/screens-forms-layout-rules.d.ts +122 -0
- package/dist/engine/boot-validator/screens-forms-layout-rules.js +122 -0
- package/dist/engine/boot-validator/screens-forms-rules.d.ts +152 -0
- package/dist/engine/boot-validator/screens-forms-rules.js +152 -0
- package/dist/engine/boot-validator/screens-forms.js +240 -112
- package/dist/engine/boot-validator/screens-kind-config-edit.js +72 -16
- package/dist/engine/boot-validator/screens-kind-entity-edit.js +15 -7
- package/dist/engine/boot-validator/screens-kind-entity-list.js +57 -32
- package/dist/engine/boot-validator/screens-kind-projection-detail-rules.d.ts +92 -0
- package/dist/engine/boot-validator/screens-kind-projection-detail-rules.js +92 -0
- package/dist/engine/boot-validator/screens-kind-projection-detail.js +85 -47
- package/dist/engine/boot-validator/screens-kind-rules.d.ts +137 -0
- package/dist/engine/boot-validator/screens-kind-rules.js +137 -0
- package/dist/engine/boot-validator/screens-kind-secret-mint.js +18 -8
- package/dist/engine/boot-validator/screens-kind-shared.js +40 -22
- package/dist/engine/boot-validator/screens-lists-rules.d.ts +82 -0
- package/dist/engine/boot-validator/screens-lists-rules.js +82 -0
- package/dist/engine/boot-validator/screens-lists.js +90 -45
- package/dist/engine/boot-validator/screens-rules.d.ts +57 -0
- package/dist/engine/boot-validator/screens-rules.js +57 -0
- package/dist/engine/boot-validator/screens.js +17 -12
- package/dist/engine/boot-validator/transaction-phases.js +12 -4
- package/dist/engine/boot-validator/transfer-graph.js +17 -11
- package/dist/engine/boot-validator/url-prefill-fields.js +9 -5
- package/dist/engine/boot-validator/workspaces.js +11 -5
- package/dist/engine/boot-validator/zod-shape.js +6 -2
- package/dist/engine/entity-handlers.d.ts +1 -0
- package/dist/engine/entity-handlers.js +3 -0
- package/dist/engine/entity-list-runtime-options.js +23 -29
- package/dist/engine/extensions/tenant-data.d.ts +3 -0
- package/dist/engine/factories.d.ts +1 -1
- package/dist/engine/factories.js +4 -3
- package/dist/engine/index.d.ts +4 -2
- package/dist/engine/index.js +2 -0
- package/dist/engine/project-app-schema-for-roles.js +29 -14
- package/dist/engine/registry-facade.js +7 -8
- package/dist/engine/registry-validate.js +5 -1
- package/dist/engine/soft-delete-cleanup.d.ts +1 -0
- package/dist/engine/soft-delete-cleanup.js +5 -0
- package/dist/engine/steps/describe-workflow-step-error.js +1 -0
- package/dist/es-ops/operations-schema.d.ts +1 -1
- package/dist/event-store/ensure-dead-letter-table.d.ts +2 -0
- package/dist/event-store/ensure-dead-letter-table.js +10 -0
- package/dist/event-store/rebuild-dead-letter.js +2 -8
- package/dist/event-store/upcaster-dead-letter.js +2 -8
- package/dist/files/copy-pending-file-refs-to-tenant.d.ts +28 -0
- package/dist/files/copy-pending-file-refs-to-tenant.js +87 -0
- package/dist/files/file-routes.d.ts +1 -1
- package/dist/files/file-routes.js +21 -6
- package/dist/files/index.d.ts +2 -0
- package/dist/files/index.js +1 -0
- package/dist/i18n/required-surface-keys.js +1 -0
- package/dist/jobs/job-runner-helpers.js +1 -0
- package/dist/jobs/job-runner.js +7 -12
- package/dist/logging/utils.js +30 -60
- package/dist/observability/metrics-handle.js +10 -21
- package/dist/pipeline/cascade-handler.js +7 -6
- package/dist/pipeline/dispatch-query.js +18 -5
- package/dist/pipeline/dispatch-shared.d.ts +1 -0
- package/dist/pipeline/dispatch-shared.js +3 -1
- package/dist/pipeline/dispatch-write.js +10 -12
- package/dist/pipeline/dispatcher.js +12 -14
- package/dist/pipeline/event-dispatcher-admin.js +9 -8
- package/dist/pipeline/event-dispatcher-delivery.d.ts +19 -1
- package/dist/pipeline/event-dispatcher-delivery.js +121 -29
- package/dist/pipeline/event-dispatcher.d.ts +5 -1
- package/dist/pipeline/event-dispatcher.js +28 -21
- package/dist/pipeline/handler-context-phase-denials.js +2 -0
- package/dist/pipeline/multi-stream-apply-context.js +12 -20
- package/dist/pipeline/system-hooks.d.ts +4 -1
- package/dist/pipeline/system-hooks.js +79 -6
- package/dist/pipeline/system-identity-switch.js +10 -7
- package/dist/search/build-search-snippet.d.ts +9 -0
- package/dist/search/build-search-snippet.js +40 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/index.js +1 -0
- package/dist/search/meilisearch-adapter.d.ts +32 -0
- package/dist/search/meilisearch-adapter.js +153 -56
- package/dist/search/meilisearch-chunking.d.ts +21 -0
- package/dist/search/meilisearch-chunking.js +96 -0
- package/dist/search/reindex-entity.d.ts +1 -0
- package/dist/search/reindex-entity.js +97 -52
- package/dist/ui-types/index.d.ts +1 -1
- package/dist/upgrade-cli.js +3 -14
- package/package.json +3 -3
- package/src/changes.json +73 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export const LIST_TABLE_RULES = {
|
|
2
|
+
notObject: {
|
|
3
|
+
id: "list-table/not-object",
|
|
4
|
+
summary: "A list's table option is an object.",
|
|
5
|
+
fix: "Write table as an object such as { rememberState: true } using only the allowed keys.",
|
|
6
|
+
},
|
|
7
|
+
unknownKeys: {
|
|
8
|
+
id: "list-table/unknown-keys",
|
|
9
|
+
summary: "A table option block uses only the keys its schema allows.",
|
|
10
|
+
fix: "Remove the unknown keys or rename them to one of the allowed keys.",
|
|
11
|
+
},
|
|
12
|
+
optionNotBoolean: {
|
|
13
|
+
id: "list-table/option-not-boolean",
|
|
14
|
+
summary: "The boolean table switches (rememberState, columnPicker, pinning, ...) are booleans.",
|
|
15
|
+
fix: "Set the table option to true or false.",
|
|
16
|
+
},
|
|
17
|
+
densityNotObject: {
|
|
18
|
+
id: "list-table/density-not-object",
|
|
19
|
+
summary: "table.density is an object.",
|
|
20
|
+
fix: 'Write table.density as { default: "compact", userChoice: true }.',
|
|
21
|
+
},
|
|
22
|
+
densityEmpty: {
|
|
23
|
+
id: "list-table/density-empty",
|
|
24
|
+
summary: "table.density sets default and/or userChoice.",
|
|
25
|
+
fix: "Set default and/or userChoice, or remove table.density.",
|
|
26
|
+
},
|
|
27
|
+
densityDefaultInvalid: {
|
|
28
|
+
id: "list-table/density-default-invalid",
|
|
29
|
+
summary: "table.density.default is one of the known densities.",
|
|
30
|
+
fix: "Use one of the listed density values.",
|
|
31
|
+
},
|
|
32
|
+
densityUserChoiceNotBoolean: {
|
|
33
|
+
id: "list-table/density-user-choice-not-boolean",
|
|
34
|
+
summary: "table.density.userChoice is a boolean.",
|
|
35
|
+
fix: "Set userChoice to true or false.",
|
|
36
|
+
},
|
|
37
|
+
hiddenNotBoolean: {
|
|
38
|
+
id: "list-table/hidden-not-boolean",
|
|
39
|
+
summary: "A column's hidden flag is a boolean.",
|
|
40
|
+
fix: "Set hidden to true or remove it.",
|
|
41
|
+
},
|
|
42
|
+
hiddenWithoutColumnPicker: {
|
|
43
|
+
id: "list-table/hidden-without-column-picker",
|
|
44
|
+
summary: "Hidden columns need table.columnPicker, otherwise the user can never show them.",
|
|
45
|
+
fix: "Set table: { columnPicker: true } or remove hidden from the column.",
|
|
46
|
+
},
|
|
47
|
+
hidesEveryColumn: {
|
|
48
|
+
id: "list-table/hides-every-column",
|
|
49
|
+
summary: "At least one list column starts visible.",
|
|
50
|
+
fix: "Remove hidden from one column.",
|
|
51
|
+
},
|
|
52
|
+
exportNotAllowed: {
|
|
53
|
+
id: "list-table/export-not-allowed",
|
|
54
|
+
summary: "table.export is only declared on entityList and projectionList screens.",
|
|
55
|
+
fix: "Remove table.export from this screen or section.",
|
|
56
|
+
},
|
|
57
|
+
exportNotObject: {
|
|
58
|
+
id: "list-table/export-not-object",
|
|
59
|
+
summary: "table.export is an object.",
|
|
60
|
+
fix: "Write table.export as { xlsx: true, maxRows: 5000 }.",
|
|
61
|
+
},
|
|
62
|
+
exportXlsxNotTrue: {
|
|
63
|
+
id: "list-table/export-xlsx-not-true",
|
|
64
|
+
summary: "table.export.xlsx is true, the only export format.",
|
|
65
|
+
fix: "Set xlsx: true.",
|
|
66
|
+
},
|
|
67
|
+
exportMaxRowsInvalid: {
|
|
68
|
+
id: "list-table/export-max-rows-invalid",
|
|
69
|
+
summary: "table.export.maxRows is an integer of at least 1.",
|
|
70
|
+
fix: "Set a positive integer row limit or remove maxRows to use the default.",
|
|
71
|
+
},
|
|
72
|
+
exportMaxRowsTooLarge: {
|
|
73
|
+
id: "list-table/export-max-rows-too-large",
|
|
74
|
+
summary: "table.export.maxRows stays within the in-memory workbook limit.",
|
|
75
|
+
fix: "Lower maxRows to the allowed maximum.",
|
|
76
|
+
},
|
|
77
|
+
columnPinnedInvalid: {
|
|
78
|
+
id: "list-table/column-pinned-invalid",
|
|
79
|
+
summary: "A column's pinned value is one of the known pin sides.",
|
|
80
|
+
fix: "Use one of the listed pin values.",
|
|
81
|
+
},
|
|
82
|
+
columnPinnedWithoutPinning: {
|
|
83
|
+
id: "list-table/column-pinned-without-pinning",
|
|
84
|
+
summary: "A pinned column needs table.pinning, otherwise the pin has no effect.",
|
|
85
|
+
fix: "Set table: { pinning: true } or remove pinned from the column.",
|
|
86
|
+
},
|
|
87
|
+
columnWidthInvalid: {
|
|
88
|
+
id: "list-table/column-width-invalid",
|
|
89
|
+
summary: "A column's width and minWidth are finite pixel counts greater than 0.",
|
|
90
|
+
fix: "Set a positive finite number or remove the option.",
|
|
91
|
+
},
|
|
92
|
+
columnWidthWithoutResizing: {
|
|
93
|
+
id: "list-table/column-width-without-resizing",
|
|
94
|
+
summary: "A column's width or minWidth needs table.resizing, otherwise it has no effect.",
|
|
95
|
+
fix: "Set table: { resizing: true } or remove width and minWidth from the column.",
|
|
96
|
+
},
|
|
97
|
+
columnMinWidthExceedsWidth: {
|
|
98
|
+
id: "list-table/column-min-width-exceeds-width",
|
|
99
|
+
summary: "A column's minWidth is not greater than its width.",
|
|
100
|
+
fix: "Lower minWidth or raise width.",
|
|
101
|
+
},
|
|
102
|
+
bundledListsNotObject: {
|
|
103
|
+
id: "bundled-lists/not-object",
|
|
104
|
+
summary: "The bundledLists option is an object.",
|
|
105
|
+
fix: "Write bundledLists as an object such as { table: { columnPicker: true } }.",
|
|
106
|
+
},
|
|
107
|
+
bundledListsUnknownKey: {
|
|
108
|
+
id: "bundled-lists/unknown-key",
|
|
109
|
+
summary: "bundledLists uses only the allowed keys.",
|
|
110
|
+
fix: "Remove the unknown keys or rename them to one of the allowed keys.",
|
|
111
|
+
},
|
|
112
|
+
bundledListsTableNotObject: {
|
|
113
|
+
id: "bundled-lists/table-not-object",
|
|
114
|
+
summary: "bundledLists.table is an object.",
|
|
115
|
+
fix: "Write bundledLists.table as an object such as { columnPicker: true }.",
|
|
116
|
+
},
|
|
117
|
+
bundledListsScreenOnlyKey: {
|
|
118
|
+
id: "bundled-lists/screen-only-table-key",
|
|
119
|
+
summary: "bundledLists.table leaves out grouping and totals, which depend on one list's fields.",
|
|
120
|
+
fix: "Set grouping and totals in the table block of the individual screen.",
|
|
121
|
+
},
|
|
122
|
+
bundledListsPinFirstColumnNotBoolean: {
|
|
123
|
+
id: "bundled-lists/pin-first-column-not-boolean",
|
|
124
|
+
summary: "bundledLists.pinFirstColumn is a boolean.",
|
|
125
|
+
fix: "Set pinFirstColumn to true or false.",
|
|
126
|
+
},
|
|
127
|
+
bundledListsPinFirstColumnWithoutPinning: {
|
|
128
|
+
id: "bundled-lists/pin-first-column-without-pinning",
|
|
129
|
+
summary: "bundledLists.pinFirstColumn needs bundledLists.table.pinning.",
|
|
130
|
+
fix: "Set bundledLists.table.pinning: true or remove pinFirstColumn.",
|
|
131
|
+
},
|
|
132
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const NAV_RULES: {
|
|
2
|
+
readonly screenUnregistered: {
|
|
3
|
+
readonly id: "nav/screen-unregistered";
|
|
4
|
+
readonly summary: "A nav entry's screen is a registered screen qualified name.";
|
|
5
|
+
readonly fix: 'Use "<feature>:screen:<id>" pointing at an r.screen() declaration.';
|
|
6
|
+
};
|
|
7
|
+
readonly parentUnregistered: {
|
|
8
|
+
readonly id: "nav/parent-unregistered";
|
|
9
|
+
readonly summary: "A nav entry's parent is a registered nav entry qualified name.";
|
|
10
|
+
readonly fix: 'Use "<feature>:nav:<id>" pointing at a registered nav entry.';
|
|
11
|
+
};
|
|
12
|
+
readonly workspaceUnregistered: {
|
|
13
|
+
readonly id: "nav/workspace-unregistered";
|
|
14
|
+
readonly summary: "A nav entry self-assigns only to registered workspaces.";
|
|
15
|
+
readonly fix: 'Use "<feature>:workspace:<id>" pointing at an r.workspace() declaration.';
|
|
16
|
+
};
|
|
17
|
+
readonly createActionTargetCount: {
|
|
18
|
+
readonly id: "nav/create-action-target-count";
|
|
19
|
+
readonly summary: 'A nav createAction sets exactly one of "screen" and "target".';
|
|
20
|
+
readonly fix: 'Set either "screen" or "target" on the action.';
|
|
21
|
+
};
|
|
22
|
+
readonly createActionScreenUnregistered: {
|
|
23
|
+
readonly id: "nav/create-action-screen-unregistered";
|
|
24
|
+
readonly summary: "A nav createAction screen is a registered screen qualified name.";
|
|
25
|
+
readonly fix: 'Use "<feature>:screen:<id>" pointing at an r.screen() declaration.';
|
|
26
|
+
};
|
|
27
|
+
readonly parentCycle: {
|
|
28
|
+
readonly id: "nav/parent-cycle";
|
|
29
|
+
readonly summary: "Nav entry parents form no cycle.";
|
|
30
|
+
readonly fix: "Change or remove the parent of one entry in the cycle.";
|
|
31
|
+
};
|
|
32
|
+
readonly workspaceNavUnregistered: {
|
|
33
|
+
readonly id: "workspace/nav-unregistered";
|
|
34
|
+
readonly summary: "A workspace references only registered nav entries.";
|
|
35
|
+
readonly fix: 'Use "<feature>:nav:<id>" pointing at an r.nav() declaration.';
|
|
36
|
+
};
|
|
37
|
+
readonly multipleDefaultWorkspaces: {
|
|
38
|
+
readonly id: "workspace/multiple-defaults";
|
|
39
|
+
readonly summary: "At most one workspace per app declares default: true.";
|
|
40
|
+
readonly fix: "Remove default: true from all but one workspace.";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const NAV_RULES = {
|
|
2
|
+
screenUnregistered: {
|
|
3
|
+
id: "nav/screen-unregistered",
|
|
4
|
+
summary: "A nav entry's screen is a registered screen qualified name.",
|
|
5
|
+
fix: 'Use "<feature>:screen:<id>" pointing at an r.screen() declaration.',
|
|
6
|
+
},
|
|
7
|
+
parentUnregistered: {
|
|
8
|
+
id: "nav/parent-unregistered",
|
|
9
|
+
summary: "A nav entry's parent is a registered nav entry qualified name.",
|
|
10
|
+
fix: 'Use "<feature>:nav:<id>" pointing at a registered nav entry.',
|
|
11
|
+
},
|
|
12
|
+
workspaceUnregistered: {
|
|
13
|
+
id: "nav/workspace-unregistered",
|
|
14
|
+
summary: "A nav entry self-assigns only to registered workspaces.",
|
|
15
|
+
fix: 'Use "<feature>:workspace:<id>" pointing at an r.workspace() declaration.',
|
|
16
|
+
},
|
|
17
|
+
createActionTargetCount: {
|
|
18
|
+
id: "nav/create-action-target-count",
|
|
19
|
+
summary: 'A nav createAction sets exactly one of "screen" and "target".',
|
|
20
|
+
fix: 'Set either "screen" or "target" on the action.',
|
|
21
|
+
},
|
|
22
|
+
createActionScreenUnregistered: {
|
|
23
|
+
id: "nav/create-action-screen-unregistered",
|
|
24
|
+
summary: "A nav createAction screen is a registered screen qualified name.",
|
|
25
|
+
fix: 'Use "<feature>:screen:<id>" pointing at an r.screen() declaration.',
|
|
26
|
+
},
|
|
27
|
+
parentCycle: {
|
|
28
|
+
id: "nav/parent-cycle",
|
|
29
|
+
summary: "Nav entry parents form no cycle.",
|
|
30
|
+
fix: "Change or remove the parent of one entry in the cycle.",
|
|
31
|
+
},
|
|
32
|
+
workspaceNavUnregistered: {
|
|
33
|
+
id: "workspace/nav-unregistered",
|
|
34
|
+
summary: "A workspace references only registered nav entries.",
|
|
35
|
+
fix: 'Use "<feature>:nav:<id>" pointing at an r.nav() declaration.',
|
|
36
|
+
},
|
|
37
|
+
multipleDefaultWorkspaces: {
|
|
38
|
+
id: "workspace/multiple-defaults",
|
|
39
|
+
summary: "At most one workspace per app declares default: true.",
|
|
40
|
+
fix: "Remove default: true from all but one workspace.",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { isOpenToAllGranted } from "@cosmicdrift/kumiko-types/handlers";
|
|
5
5
|
import { createFallbackLogger } from "../../logging/utils.js";
|
|
6
6
|
import { qualifyEntityName } from "../qualified-name.js";
|
|
7
|
+
import { bootRuleError } from "./boot-rule.js";
|
|
8
|
+
import { NAV_RULES } from "./nav-rules.js";
|
|
7
9
|
const log = createFallbackLogger("kumiko:boot");
|
|
8
10
|
export function collectWriteHandlerQns(features) {
|
|
9
11
|
const set = new Set();
|
|
@@ -30,21 +32,27 @@ export function collectNavQns(features) {
|
|
|
30
32
|
export function validateNavs(feature, allScreenQns, allNavQns, allWorkspaceQns) {
|
|
31
33
|
for (const [navId, navDef] of Object.entries(feature.navs)) {
|
|
32
34
|
if (navDef.screen !== undefined && !allScreenQns.has(navDef.screen)) {
|
|
33
|
-
throw
|
|
34
|
-
`
|
|
35
|
-
|
|
35
|
+
throw bootRuleError(NAV_RULES.screenUnregistered, {
|
|
36
|
+
message: `[Feature ${feature.name}] Nav entry "${navId}" references screen "${navDef.screen}" ` +
|
|
37
|
+
`which is not registered. Expected a qualified name of the form ` +
|
|
38
|
+
`"<feature>:screen:<id>" pointing at an r.screen() declaration.`,
|
|
39
|
+
});
|
|
36
40
|
}
|
|
37
41
|
if (navDef.parent !== undefined && !allNavQns.has(navDef.parent)) {
|
|
38
|
-
throw
|
|
39
|
-
`
|
|
40
|
-
|
|
42
|
+
throw bootRuleError(NAV_RULES.parentUnregistered, {
|
|
43
|
+
message: `[Feature ${feature.name}] Nav entry "${navId}" references parent "${navDef.parent}" ` +
|
|
44
|
+
`which is not a registered nav entry. Expected a qualified name of the form ` +
|
|
45
|
+
`"<feature>:nav:<id>".`,
|
|
46
|
+
});
|
|
41
47
|
}
|
|
42
48
|
if (navDef.workspaces !== undefined) {
|
|
43
49
|
for (const wsQn of navDef.workspaces) {
|
|
44
50
|
if (!allWorkspaceQns.has(wsQn)) {
|
|
45
|
-
throw
|
|
46
|
-
`
|
|
47
|
-
|
|
51
|
+
throw bootRuleError(NAV_RULES.workspaceUnregistered, {
|
|
52
|
+
message: `[Feature ${feature.name}] Nav entry "${navId}" self-assigns to workspace "${wsQn}" ` +
|
|
53
|
+
`which is not registered. Expected a qualified name of the form ` +
|
|
54
|
+
`"<feature>:workspace:<id>" pointing at an r.workspace() declaration.`,
|
|
55
|
+
});
|
|
48
56
|
}
|
|
49
57
|
}
|
|
50
58
|
}
|
|
@@ -68,13 +76,17 @@ allScreenQns) {
|
|
|
68
76
|
const hasScreen = screen !== undefined;
|
|
69
77
|
const hasTarget = target !== undefined;
|
|
70
78
|
if (hasScreen === hasTarget) {
|
|
71
|
-
throw
|
|
72
|
-
`
|
|
79
|
+
throw bootRuleError(NAV_RULES.createActionTargetCount, {
|
|
80
|
+
message: `[Feature ${featureName}] Nav entry "${navId}" ${actionPath} must set exactly one of ` +
|
|
81
|
+
`"screen"/"target" (${hasScreen ? "both are set" : "neither is set"}).`,
|
|
82
|
+
});
|
|
73
83
|
}
|
|
74
84
|
if (screen !== undefined && !allScreenQns.has(screen)) {
|
|
75
|
-
throw
|
|
76
|
-
`
|
|
77
|
-
|
|
85
|
+
throw bootRuleError(NAV_RULES.createActionScreenUnregistered, {
|
|
86
|
+
message: `[Feature ${featureName}] Nav entry "${navId}" ${actionPath} references screen ` +
|
|
87
|
+
`"${screen}" which is not registered. Expected a qualified name of the form ` +
|
|
88
|
+
`"<feature>:screen:<id>" pointing at an r.screen() declaration.`,
|
|
89
|
+
});
|
|
78
90
|
}
|
|
79
91
|
}
|
|
80
92
|
// Walks parent-refs across ALL nav entries (cross-feature). A cycle here
|
|
@@ -85,7 +97,9 @@ export function validateNavCycles(allNavQns) {
|
|
|
85
97
|
const stack = new Set();
|
|
86
98
|
function visit(qualified, path) {
|
|
87
99
|
if (stack.has(qualified)) {
|
|
88
|
-
throw
|
|
100
|
+
throw bootRuleError(NAV_RULES.parentCycle, {
|
|
101
|
+
message: `[Kumiko Nav] Nav entry parent cycle detected: ${[...path, qualified].join(" → ")}. Change or remove the parent of one entry in the cycle.`,
|
|
102
|
+
});
|
|
89
103
|
}
|
|
90
104
|
// skip: already visited — cycle-detection only needs to traverse each
|
|
91
105
|
// node once, and the `stack` check above catches any actual cycles
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const OWNERSHIP_RULES: {
|
|
2
|
+
readonly unknownRole: {
|
|
3
|
+
readonly id: "ownership/unknown-role";
|
|
4
|
+
readonly summary: "An access map names only roles that some feature defines.";
|
|
5
|
+
readonly fix: "Use a defined role name or declare the role.";
|
|
6
|
+
};
|
|
7
|
+
readonly whereOnWritePath: {
|
|
8
|
+
readonly id: "ownership/where-on-write-path";
|
|
9
|
+
readonly summary: "A write access map uses from(...) rules, not where(...), because where is read-only SQL.";
|
|
10
|
+
readonly fix: "Replace the where rule with a from rule on the write path.";
|
|
11
|
+
};
|
|
12
|
+
readonly whereOnFieldRead: {
|
|
13
|
+
readonly id: "ownership/where-on-field-read";
|
|
14
|
+
readonly summary: "A field-level read access map uses from(...) rules, not where(...).";
|
|
15
|
+
readonly fix: "Replace the where rule with a from rule on the field read path.";
|
|
16
|
+
};
|
|
17
|
+
readonly unknownClaim: {
|
|
18
|
+
readonly id: "ownership/unknown-claim";
|
|
19
|
+
readonly summary: "A from(...) ownership rule references only claims declared via r.claimKey.";
|
|
20
|
+
readonly fix: 'Declare it via r.claimKey("...", { type: "..." }) in the owning feature.';
|
|
21
|
+
};
|
|
22
|
+
readonly unknownColumn: {
|
|
23
|
+
readonly id: "ownership/unknown-column";
|
|
24
|
+
readonly summary: "A from(...) ownership rule references only columns that exist on the entity.";
|
|
25
|
+
readonly fix: "Use one of the entity's columns.";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const OWNERSHIP_RULES = {
|
|
2
|
+
unknownRole: {
|
|
3
|
+
id: "ownership/unknown-role",
|
|
4
|
+
summary: "An access map names only roles that some feature defines.",
|
|
5
|
+
fix: "Use a defined role name or declare the role.",
|
|
6
|
+
},
|
|
7
|
+
whereOnWritePath: {
|
|
8
|
+
id: "ownership/where-on-write-path",
|
|
9
|
+
summary: "A write access map uses from(...) rules, not where(...), because where is read-only SQL.",
|
|
10
|
+
fix: "Replace the where rule with a from rule on the write path.",
|
|
11
|
+
},
|
|
12
|
+
whereOnFieldRead: {
|
|
13
|
+
id: "ownership/where-on-field-read",
|
|
14
|
+
summary: "A field-level read access map uses from(...) rules, not where(...).",
|
|
15
|
+
fix: "Replace the where rule with a from rule on the field read path.",
|
|
16
|
+
},
|
|
17
|
+
unknownClaim: {
|
|
18
|
+
id: "ownership/unknown-claim",
|
|
19
|
+
summary: "A from(...) ownership rule references only claims declared via r.claimKey.",
|
|
20
|
+
fix: 'Declare it via r.claimKey("...", { type: "..." }) in the owning feature.',
|
|
21
|
+
},
|
|
22
|
+
unknownColumn: {
|
|
23
|
+
id: "ownership/unknown-column",
|
|
24
|
+
summary: "A from(...) ownership rule references only columns that exist on the entity.",
|
|
25
|
+
fix: "Use one of the entity's columns.",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -3,6 +3,8 @@ import { tableNameOf, } from "../ownership.js";
|
|
|
3
3
|
import { SYSTEM_USER_ID } from "../system-user.js";
|
|
4
4
|
import { SYSTEM_TENANT_ID } from "../types/identifiers.js";
|
|
5
5
|
import { assertQualifiedWhereFragment, tableColumnSqlNames } from "../where-rule-lint.js";
|
|
6
|
+
import { bootRuleError } from "./boot-rule.js";
|
|
7
|
+
import { OWNERSHIP_RULES } from "./ownership-rules.js";
|
|
6
8
|
// --- Ownership rule validation ---
|
|
7
9
|
//
|
|
8
10
|
// Walks every entity.access and every field.access map, resolves each
|
|
@@ -164,7 +166,9 @@ export function checkLegacyRoleList(roles, knownRoles, scope, featureName) {
|
|
|
164
166
|
return;
|
|
165
167
|
for (const roleName of roles) {
|
|
166
168
|
if (!knownRoles.has(roleName)) {
|
|
167
|
-
throw
|
|
169
|
+
throw bootRuleError(OWNERSHIP_RULES.unknownRole, {
|
|
170
|
+
message: buildUnknownRoleMessage(roleName, knownRoles, scope, featureName),
|
|
171
|
+
});
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
}
|
|
@@ -188,7 +192,9 @@ export function checkOwnershipMap(args) {
|
|
|
188
192
|
// or other map mentions "Admi" would otherwise silently grant nothing.
|
|
189
193
|
// Cross-feature, so it needs a corpus that can answer the question.
|
|
190
194
|
if (canValidateRoles(args.knownRoles) && !args.knownRoles.has(roleName)) {
|
|
191
|
-
throw
|
|
195
|
+
throw bootRuleError(OWNERSHIP_RULES.unknownRole, {
|
|
196
|
+
message: buildUnknownRoleMessage(roleName, args.knownRoles, args.scope, args.featureName),
|
|
197
|
+
});
|
|
192
198
|
}
|
|
193
199
|
// @cast-boundary schema-walk — extracted from feature-config inspection
|
|
194
200
|
const rule = rawRule;
|
|
@@ -196,10 +202,14 @@ export function checkOwnershipMap(args) {
|
|
|
196
202
|
continue;
|
|
197
203
|
if (rule.kind === "where") {
|
|
198
204
|
if (args.path === "write") {
|
|
199
|
-
throw
|
|
205
|
+
throw bootRuleError(OWNERSHIP_RULES.whereOnWritePath, {
|
|
206
|
+
message: buildWhereOnWritePathMessage(roleName, args.scope, args.featureName),
|
|
207
|
+
});
|
|
200
208
|
}
|
|
201
209
|
if (args.path === "fieldRead") {
|
|
202
|
-
throw
|
|
210
|
+
throw bootRuleError(OWNERSHIP_RULES.whereOnFieldRead, {
|
|
211
|
+
message: buildWhereOnFieldReadMessage(roleName, args.scope, args.featureName),
|
|
212
|
+
});
|
|
203
213
|
}
|
|
204
214
|
probeWhereRule(rule, roleName, args.probe, args.scope, args.featureName);
|
|
205
215
|
continue; // escape hatch — feature author owns the SQL
|
|
@@ -212,10 +222,12 @@ export function checkOwnershipMap(args) {
|
|
|
212
222
|
const claim = args.allClaimKeys.get(rule.refPath);
|
|
213
223
|
if (!claim) {
|
|
214
224
|
const known = [...args.allClaimKeys.keys()].sort().join(", ") || "(none)";
|
|
215
|
-
throw
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
225
|
+
throw bootRuleError(OWNERSHIP_RULES.unknownClaim, {
|
|
226
|
+
message: `[Kumiko Ownership] ${args.scope} references unknown claim "${rule.refPath}" ` +
|
|
227
|
+
`(role: "${roleName}", feature: "${args.featureName}"). ` +
|
|
228
|
+
`Declare it via r.claimKey("...", { type: "..." }) in the owning feature. ` +
|
|
229
|
+
`Known claims: ${known}`,
|
|
230
|
+
});
|
|
219
231
|
}
|
|
220
232
|
// String-compatible columns accept string and string[] claims equally
|
|
221
233
|
// (array → inArray). For other claim types we rely on the author
|
|
@@ -224,9 +236,11 @@ export function checkOwnershipMap(args) {
|
|
|
224
236
|
}
|
|
225
237
|
if (!args.columnNames.has(rule.column)) {
|
|
226
238
|
const known = [...args.columnNames].sort().join(", ");
|
|
227
|
-
throw
|
|
228
|
-
`
|
|
229
|
-
|
|
239
|
+
throw bootRuleError(OWNERSHIP_RULES.unknownColumn, {
|
|
240
|
+
message: `[Kumiko Ownership] ${args.scope} references column "${rule.column}" ` +
|
|
241
|
+
`which does not exist on the entity (role: "${roleName}", feature: ` +
|
|
242
|
+
`"${args.featureName}"). Available columns: ${known}`,
|
|
243
|
+
});
|
|
230
244
|
}
|
|
231
245
|
}
|
|
232
246
|
}
|
|
@@ -270,7 +284,9 @@ function rejectWhereInEmbeddedRead(schema, parentScope, featureName) {
|
|
|
270
284
|
continue;
|
|
271
285
|
for (const [roleName, rule] of Object.entries(map)) {
|
|
272
286
|
if (rule !== "all" && rule.kind === "where") {
|
|
273
|
-
throw
|
|
287
|
+
throw bootRuleError(OWNERSHIP_RULES.whereOnFieldRead, {
|
|
288
|
+
message: buildWhereOnFieldReadMessage(roleName, `${parentScope}.${subName}.access.read`, featureName),
|
|
289
|
+
});
|
|
274
290
|
}
|
|
275
291
|
}
|
|
276
292
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ENTITY_CONVENTION_QUERY_BRAND } from "@cosmicdrift/kumiko-types/handlers";
|
|
2
2
|
import { findEntity } from "../find-entity.js";
|
|
3
|
+
import { bootRuleError } from "./boot-rule.js";
|
|
4
|
+
import { ENTITY_DECLARATION_RULES } from "./entity-declaration-rules.js";
|
|
3
5
|
// --- Parent-ref boot validation ---
|
|
4
6
|
//
|
|
5
7
|
// Join-row entities (EntityDefinition.parentRef) derive both the write-path
|
|
@@ -23,27 +25,35 @@ export function validateParentRefs(feature, featureMap) {
|
|
|
23
25
|
if (parentRef === undefined)
|
|
24
26
|
continue;
|
|
25
27
|
if (entity.fields[parentRef.entityTypeField] === undefined) {
|
|
26
|
-
throw
|
|
27
|
-
`
|
|
28
|
-
|
|
28
|
+
throw bootRuleError(ENTITY_DECLARATION_RULES.parentRefTypeFieldUnknown, {
|
|
29
|
+
message: `[Kumiko ParentRef] entity "${entityName}".parentRef.entityTypeField references ` +
|
|
30
|
+
`"${parentRef.entityTypeField}" — which is not a declared field on "${entityName}" ` +
|
|
31
|
+
`(feature: "${feature.name}"). Fix: point entityTypeField at a real field on the entity.`,
|
|
32
|
+
});
|
|
29
33
|
}
|
|
30
34
|
if (entity.fields[parentRef.entityIdField] === undefined) {
|
|
31
|
-
throw
|
|
32
|
-
`
|
|
33
|
-
|
|
35
|
+
throw bootRuleError(ENTITY_DECLARATION_RULES.parentRefIdFieldUnknown, {
|
|
36
|
+
message: `[Kumiko ParentRef] entity "${entityName}".parentRef.entityIdField references ` +
|
|
37
|
+
`"${parentRef.entityIdField}" — which is not a declared field on "${entityName}" ` +
|
|
38
|
+
`(feature: "${feature.name}"). Fix: point entityIdField at a real field on the entity.`,
|
|
39
|
+
});
|
|
34
40
|
}
|
|
35
41
|
for (const hostName of parentRef.allowedTypes ?? []) {
|
|
36
42
|
const host = findEntity(featureMap, hostName);
|
|
37
43
|
if (host === undefined) {
|
|
38
|
-
throw
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
throw bootRuleError(ENTITY_DECLARATION_RULES.parentRefAllowedTypeUnregistered, {
|
|
45
|
+
message: `[Kumiko ParentRef] entity "${entityName}".parentRef.allowedTypes names "${hostName}" ` +
|
|
46
|
+
`— no entity with that name is registered in this feature set (feature: ` +
|
|
47
|
+
`"${feature.name}"). Fix: remove "${hostName}" from allowedTypes, or register it.`,
|
|
48
|
+
});
|
|
41
49
|
}
|
|
42
50
|
if (host.parentRef !== undefined) {
|
|
43
|
-
throw
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
throw bootRuleError(ENTITY_DECLARATION_RULES.parentRefAllowedTypeHasParentRef, {
|
|
52
|
+
message: `[Kumiko ParentRef] entity "${entityName}".parentRef.allowedTypes names "${hostName}" ` +
|
|
53
|
+
`— which itself declares a parentRef (feature: "${feature.name}"). A join-row ` +
|
|
54
|
+
`entity can't act as a host for another join-row entity (no recursive gating). ` +
|
|
55
|
+
`Fix: remove "${hostName}" from allowedTypes, or drop its own parentRef.`,
|
|
56
|
+
});
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
59
|
for (const verb of ["list", "detail"]) {
|
|
@@ -53,13 +63,15 @@ export function validateParentRefs(feature, featureMap) {
|
|
|
53
63
|
if (handler === undefined)
|
|
54
64
|
continue;
|
|
55
65
|
if (handler[ENTITY_CONVENTION_QUERY_BRAND] !== true) {
|
|
56
|
-
throw
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
throw bootRuleError(ENTITY_DECLARATION_RULES.parentRefHandWrittenQuery, {
|
|
67
|
+
message: `[Kumiko ParentRef] query handler "${handlerName}" does not carry ` +
|
|
68
|
+
`ENTITY_CONVENTION_QUERY_BRAND, but entity "${entityName}" declares a parentRef ` +
|
|
69
|
+
`(feature: "${feature.name}"). A hand-written handler bypasses the parent-ref ` +
|
|
70
|
+
`read-gate unless it explicitly wires parentVisibility. Fix: register "${handlerName}" ` +
|
|
71
|
+
`via defineEntityListHandler/defineEntityDetailHandler (or defineEntityQueryHandler), ` +
|
|
72
|
+
`or pass { parentVisibility: { entities: ctx.registry.getAllEntities() } } to ` +
|
|
73
|
+
`executor.${verb} yourself.`,
|
|
74
|
+
});
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
77
|
}
|