@cosmicdrift/kumiko-samples 0.411.0 → 0.413.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 (182) hide show
  1. package/package.json +1 -1
  2. package/packages/bundled-features/package.json +13 -13
  3. package/packages/bundled-features/src/admin-shell/feature.ts +1 -1
  4. package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +64 -3
  5. package/packages/bundled-features/src/agent-tools/agent-manifest.ts +13 -130
  6. package/packages/bundled-features/src/agent-tools/api-docs/anchors.ts +60 -0
  7. package/packages/bundled-features/src/agent-tools/api-docs/check.ts +25 -0
  8. package/packages/bundled-features/src/agent-tools/api-docs/collect-events.ts +140 -0
  9. package/packages/bundled-features/src/agent-tools/api-docs/collect.ts +175 -0
  10. package/packages/bundled-features/src/agent-tools/api-docs/curl.ts +28 -0
  11. package/packages/bundled-features/src/agent-tools/api-docs/error-table.ts +45 -0
  12. package/packages/bundled-features/src/agent-tools/api-docs/examples.ts +43 -0
  13. package/packages/bundled-features/src/agent-tools/api-docs/generate.ts +179 -0
  14. package/packages/bundled-features/src/agent-tools/api-docs/index-json.ts +29 -0
  15. package/packages/bundled-features/src/agent-tools/api-docs/index.ts +21 -0
  16. package/packages/bundled-features/src/agent-tools/api-docs/list-parameters.ts +38 -0
  17. package/packages/bundled-features/src/agent-tools/api-docs/markdown.ts +70 -0
  18. package/packages/bundled-features/src/agent-tools/api-docs/menu-path.ts +82 -0
  19. package/packages/bundled-features/src/agent-tools/api-docs/model.ts +83 -0
  20. package/packages/bundled-features/src/agent-tools/api-docs/problems.ts +58 -0
  21. package/packages/bundled-features/src/agent-tools/api-docs/render-events.ts +76 -0
  22. package/packages/bundled-features/src/agent-tools/api-docs/render-openapi.ts +216 -0
  23. package/packages/bundled-features/src/agent-tools/api-docs/render-overview.ts +86 -0
  24. package/packages/bundled-features/src/agent-tools/api-docs/render-reference.ts +79 -0
  25. package/packages/bundled-features/src/agent-tools/api-docs/render-tokens.ts +136 -0
  26. package/packages/bundled-features/src/agent-tools/api-docs/schema-fields.ts +167 -0
  27. package/packages/bundled-features/src/agent-tools/api-docs/section-ids.ts +28 -0
  28. package/packages/bundled-features/src/agent-tools/api-docs/system-only.ts +11 -0
  29. package/packages/bundled-features/src/agent-tools/api-docs/texts/de.ts +166 -0
  30. package/packages/bundled-features/src/agent-tools/api-docs/texts/en.ts +159 -0
  31. package/packages/bundled-features/src/agent-tools/api-docs/texts/es.ts +162 -0
  32. package/packages/bundled-features/src/agent-tools/api-docs/texts/fr.ts +169 -0
  33. package/packages/bundled-features/src/agent-tools/api-docs/texts/index.ts +67 -0
  34. package/packages/bundled-features/src/agent-tools/api-docs/texts/it.ts +165 -0
  35. package/packages/bundled-features/src/agent-tools/api-docs/texts/types.ts +130 -0
  36. package/packages/bundled-features/src/agent-tools/api-docs/ui-writes.ts +81 -0
  37. package/packages/bundled-features/src/agent-tools/changes.json +24 -0
  38. package/packages/bundled-features/src/agent-tools/handler-schema.ts +45 -0
  39. package/packages/bundled-features/src/agent-tools/index.ts +24 -0
  40. package/packages/bundled-features/src/agent-tools/labels.ts +181 -0
  41. package/packages/bundled-features/src/auth-email-password/boot-rules.ts +9 -0
  42. package/packages/bundled-features/src/auth-email-password/feature.ts +6 -19
  43. package/packages/bundled-features/src/auth-email-password/validate-options.ts +20 -0
  44. package/packages/bundled-features/src/billing-foundation/boot-rules.ts +26 -0
  45. package/packages/bundled-features/src/billing-foundation/validate-options.ts +59 -46
  46. package/packages/bundled-features/src/cap-overview/boot-rules.ts +14 -0
  47. package/packages/bundled-features/src/cap-overview/feature.ts +12 -5
  48. package/packages/bundled-features/src/documents/boot-rules.ts +14 -0
  49. package/packages/bundled-features/src/documents/feature.ts +8 -4
  50. package/packages/bundled-features/src/file-derivatives/boot-rules.ts +9 -0
  51. package/packages/bundled-features/src/file-derivatives/feature.ts +6 -3
  52. package/packages/bundled-features/src/folders/boot-rules.ts +9 -0
  53. package/packages/bundled-features/src/folders/feature.ts +6 -3
  54. package/packages/bundled-features/src/helpdesk/boot-rules.ts +9 -0
  55. package/packages/bundled-features/src/{contact → helpdesk}/challenge.ts +2 -2
  56. package/packages/bundled-features/src/{contact → helpdesk}/changes.json +6 -0
  57. package/packages/bundled-features/src/{contact/client/contact-client-source.ts → helpdesk/client/helpdesk-client-source.ts} +4 -4
  58. package/packages/bundled-features/src/helpdesk/client/helpdesk-website-client.ts +29 -0
  59. package/packages/bundled-features/src/helpdesk/client/index.ts +9 -0
  60. package/packages/bundled-features/src/{contact → helpdesk}/entity.ts +35 -31
  61. package/packages/bundled-features/src/{contact → helpdesk}/feature.ts +56 -52
  62. package/packages/bundled-features/src/{contact → helpdesk}/handlers/attempts.ts +3 -3
  63. package/packages/bundled-features/src/{contact → helpdesk}/handlers/challenge.query.ts +10 -10
  64. package/packages/bundled-features/src/{contact → helpdesk}/handlers/forward-request.write.ts +25 -23
  65. package/packages/bundled-features/src/{contact → helpdesk}/handlers/mark-done.write.ts +11 -11
  66. package/packages/bundled-features/src/{contact → helpdesk}/handlers/notify-reporter-in-app.write.ts +14 -14
  67. package/packages/bundled-features/src/{contact → helpdesk}/handlers/open-count.query.ts +4 -4
  68. package/packages/bundled-features/src/{contact → helpdesk}/handlers/open-count.ts +2 -2
  69. package/packages/bundled-features/src/{contact → helpdesk}/handlers/replies.query.ts +6 -6
  70. package/packages/bundled-features/src/{contact → helpdesk}/handlers/reply.write.ts +30 -30
  71. package/packages/bundled-features/src/{contact → helpdesk}/handlers/report.write.ts +29 -29
  72. package/packages/bundled-features/src/{contact → helpdesk}/handlers/request-delivery.query.ts +40 -40
  73. package/packages/bundled-features/src/{contact → helpdesk}/handlers/request-detail.query.ts +15 -15
  74. package/packages/bundled-features/src/{contact → helpdesk}/handlers/request-list.query.ts +2 -2
  75. package/packages/bundled-features/src/{contact → helpdesk}/handlers/send-reply-mail.write.ts +24 -24
  76. package/packages/bundled-features/src/{contact → helpdesk}/handlers/send-test.write.ts +18 -14
  77. package/packages/bundled-features/src/{contact → helpdesk}/handlers/submit.write.ts +32 -31
  78. package/packages/bundled-features/src/{contact → helpdesk}/handlers/take-over-uploads.ts +5 -5
  79. package/packages/bundled-features/src/{contact → helpdesk}/i18n.ts +78 -75
  80. package/packages/bundled-features/src/helpdesk/index.ts +29 -0
  81. package/packages/bundled-features/src/{contact → helpdesk}/lib.ts +32 -28
  82. package/packages/bundled-features/src/{contact → helpdesk}/mail.ts +56 -56
  83. package/packages/bundled-features/src/{contact → helpdesk}/options.ts +18 -16
  84. package/packages/bundled-features/src/helpdesk/panels.ts +28 -0
  85. package/packages/bundled-features/src/{contact → helpdesk}/payloads.ts +33 -33
  86. package/packages/bundled-features/src/{contact → helpdesk}/screens.ts +104 -104
  87. package/packages/bundled-features/src/{contact → helpdesk}/subject.ts +3 -3
  88. package/packages/bundled-features/src/{contact → helpdesk}/user-data-hooks.ts +17 -17
  89. package/packages/bundled-features/src/helpdesk/web/constants.ts +160 -0
  90. package/packages/bundled-features/src/helpdesk/web/index.ts +29 -0
  91. package/packages/bundled-features/src/host-routing/boot-rules.ts +27 -0
  92. package/packages/bundled-features/src/host-routing/validate-options.ts +36 -27
  93. package/packages/bundled-features/src/inbound-mail-foundation/changes.json +6 -0
  94. package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +99 -71
  95. package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +2 -2
  96. package/packages/bundled-features/src/jobs/boot-rules.ts +9 -0
  97. package/packages/bundled-features/src/jobs/feature.ts +9 -4
  98. package/packages/bundled-features/src/legal-pages/boot-rules.ts +19 -0
  99. package/packages/bundled-features/src/legal-pages/feature.ts +6 -3
  100. package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +11 -5
  101. package/packages/bundled-features/src/metrics/boot-rules.ts +15 -0
  102. package/packages/bundled-features/src/metrics/validate.ts +8 -2
  103. package/packages/bundled-features/src/notes-history/boot-rules.ts +9 -0
  104. package/packages/bundled-features/src/notes-history/feature.ts +6 -3
  105. package/packages/bundled-features/src/personal-access-tokens/boot-rules.ts +9 -0
  106. package/packages/bundled-features/src/personal-access-tokens/changes.json +6 -0
  107. package/packages/bundled-features/src/personal-access-tokens/feature.ts +5 -2
  108. package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +7 -2
  109. package/packages/bundled-features/src/personal-access-tokens/i18n.ts +6 -1
  110. package/packages/bundled-features/src/personal-access-tokens/index.ts +37 -2
  111. package/packages/bundled-features/src/personal-access-tokens/scope-events-check.ts +31 -0
  112. package/packages/bundled-features/src/personal-access-tokens/screens.ts +9 -1
  113. package/packages/bundled-features/src/personal-access-tokens/web/constants.ts +1 -0
  114. package/packages/bundled-features/src/personal-access-tokens/web/scopes.ts +14 -0
  115. package/packages/bundled-features/src/presence/boot-rules.ts +9 -0
  116. package/packages/bundled-features/src/presence/options.ts +5 -1
  117. package/packages/bundled-features/src/readiness/boot-rules.ts +14 -0
  118. package/packages/bundled-features/src/readiness/probe-boot-check.ts +8 -6
  119. package/packages/bundled-features/src/shared/assert-no-where-rule-in-ownership-write.ts +6 -4
  120. package/packages/bundled-features/src/shared/boot-rules.ts +9 -0
  121. package/packages/bundled-features/src/subscription-mollie/boot-rules.ts +19 -0
  122. package/packages/bundled-features/src/subscription-mollie/feature.ts +18 -10
  123. package/packages/bundled-features/src/tags/boot-rules.ts +9 -0
  124. package/packages/bundled-features/src/tags/feature.ts +6 -3
  125. package/packages/bundled-features/src/template-resolver/boot-rules.ts +19 -0
  126. package/packages/bundled-features/src/template-resolver/feature.ts +14 -10
  127. package/packages/bundled-features/src/tenant/boot-rules.ts +9 -0
  128. package/packages/bundled-features/src/tenant/feature.ts +5 -3
  129. package/samples/apps/marketing-demo/README.md +1 -1
  130. package/samples/apps/marketing-demo/playwright.config.ts +1 -1
  131. package/samples/apps/marketing-demo/src/app/client.tsx +3 -3
  132. package/samples/apps/marketing-demo/src/app/seed-data.ts +1 -1
  133. package/samples/apps/marketing-demo/src/app/seed.ts +4 -4
  134. package/samples/apps/marketing-demo/src/app/server.ts +3 -3
  135. package/samples/apps/marketing-demo/src/features/{helpdesk → ticketing}/feature.ts +15 -12
  136. package/samples/apps/marketing-demo/src/features/ticketing/i18n.ts +100 -0
  137. package/samples/apps/marketing-demo/src/features/{helpdesk → ticketing}/schema/ticket.ts +4 -4
  138. package/samples/apps/marketing-demo/src/features/ticketing/web/index.ts +7 -0
  139. package/samples/apps/use-all-bundled/feature-manifest.json +67 -67
  140. package/samples/apps/use-all-bundled/kumiko/migrations/0064_helpdesk-rename.rebuild.json +4 -0
  141. package/samples/apps/use-all-bundled/package.json +1 -1
  142. package/samples/apps/use-all-bundled/src/app/client.tsx +1 -1
  143. package/samples/apps/use-all-bundled/src/app/screens-feature.ts +10 -10
  144. package/samples/apps/use-all-bundled/src/run-config.ts +6 -6
  145. package/samples/recipes/api-docs/README.md +52 -0
  146. package/samples/recipes/api-docs/api-docs/de/events.md +62 -0
  147. package/samples/recipes/api-docs/api-docs/de/overview.md +100 -0
  148. package/samples/recipes/api-docs/api-docs/de/reference/tickets.md +305 -0
  149. package/samples/recipes/api-docs/api-docs/de/tokens.md +66 -0
  150. package/samples/recipes/api-docs/api-docs/en/events.md +62 -0
  151. package/samples/recipes/api-docs/api-docs/en/overview.md +100 -0
  152. package/samples/recipes/api-docs/api-docs/en/reference/tickets.md +305 -0
  153. package/samples/recipes/api-docs/api-docs/en/tokens.md +66 -0
  154. package/samples/recipes/api-docs/api-docs/index.json +371 -0
  155. package/samples/recipes/api-docs/api-docs/openapi.json +982 -0
  156. package/samples/recipes/api-docs/api-examples/ticket-close.json +21 -0
  157. package/samples/recipes/api-docs/api-examples/ticket-create.json +42 -0
  158. package/samples/recipes/api-docs/api-examples/ticket-detail.json +28 -0
  159. package/samples/recipes/api-docs/api-examples/ticket-list.json +31 -0
  160. package/samples/recipes/api-docs/api-examples/ticket-update.json +54 -0
  161. package/samples/recipes/api-docs/api-examples/webhooks/ticket-closed.json +8 -0
  162. package/samples/recipes/api-docs/api-examples/webhooks/ticket-created.json +10 -0
  163. package/samples/recipes/api-docs/kumiko.config.ts +33 -0
  164. package/samples/recipes/api-docs/package.json +14 -0
  165. package/samples/recipes/api-docs/src/feature.ts +218 -0
  166. package/samples/recipes/api-docs/tsconfig.json +22 -0
  167. package/samples/recipes/golden-path/src/feature.ts +1 -1
  168. package/samples/recipes/{contact → helpdesk}/README.md +16 -16
  169. package/samples/recipes/{contact → helpdesk}/package.json +2 -2
  170. package/samples/recipes/{contact → helpdesk}/src/feature.ts +6 -6
  171. package/packages/bundled-features/src/contact/client/contact-website-client.ts +0 -29
  172. package/packages/bundled-features/src/contact/client/index.ts +0 -9
  173. package/packages/bundled-features/src/contact/index.ts +0 -29
  174. package/packages/bundled-features/src/contact/panels.ts +0 -28
  175. package/packages/bundled-features/src/contact/web/constants.ts +0 -160
  176. package/packages/bundled-features/src/contact/web/index.ts +0 -29
  177. package/samples/apps/marketing-demo/src/features/helpdesk/i18n.ts +0 -100
  178. package/samples/apps/marketing-demo/src/features/helpdesk/web/index.ts +0 -7
  179. /package/packages/bundled-features/src/{contact → helpdesk}/handlers/access.ts +0 -0
  180. /package/packages/bundled-features/src/{contact → helpdesk}/pow.ts +0 -0
  181. /package/packages/bundled-features/src/{contact → helpdesk}/user-agent.ts +0 -0
  182. /package/samples/apps/marketing-demo/src/features/{helpdesk → ticketing}/schema/index.ts +0 -0
@@ -0,0 +1,160 @@
1
+ // Pure string constants, safe for browser code (see waitlist/web/constants.ts).
2
+ export const HELPDESK_FEATURE = "helpdesk" as const;
3
+
4
+ export const HELPDESK_KIND = {
5
+ Question: "question",
6
+ Contact: "contact",
7
+ Bug: "bug",
8
+ Wish: "wish",
9
+ } as const;
10
+ export type HelpdeskKind = (typeof HELPDESK_KIND)[keyof typeof HELPDESK_KIND];
11
+
12
+ export const HELPDESK_WEBSITE_KINDS = [
13
+ HELPDESK_KIND.Question,
14
+ HELPDESK_KIND.Contact,
15
+ HELPDESK_KIND.Bug,
16
+ ] as const;
17
+ export const HELPDESK_ADMIN_KINDS = [
18
+ HELPDESK_KIND.Question,
19
+ HELPDESK_KIND.Bug,
20
+ HELPDESK_KIND.Wish,
21
+ ] as const;
22
+
23
+ export const HELPDESK_STATUS = {
24
+ Open: "open",
25
+ Answered: "answered",
26
+ Done: "done",
27
+ } as const;
28
+ export type HelpdeskStatus = (typeof HELPDESK_STATUS)[keyof typeof HELPDESK_STATUS];
29
+
30
+ export const HELPDESK_SOURCE = {
31
+ Website: "website",
32
+ Admin: "admin",
33
+ } as const;
34
+ export type HelpdeskSource = (typeof HELPDESK_SOURCE)[keyof typeof HELPDESK_SOURCE];
35
+
36
+ export const HELPDESK_REPLY_CHANNELS = {
37
+ Email: "email",
38
+ EmailAndInApp: "email+inApp",
39
+ } as const;
40
+ export type HelpdeskReplyChannels =
41
+ (typeof HELPDESK_REPLY_CHANNELS)[keyof typeof HELPDESK_REPLY_CHANNELS];
42
+
43
+ export const HELPDESK_ORIGIN = {
44
+ Website: "website",
45
+ AdminReport: "admin-report",
46
+ } as const;
47
+ export type HelpdeskOrigin = (typeof HELPDESK_ORIGIN)[keyof typeof HELPDESK_ORIGIN];
48
+
49
+ export const HELPDESK_DELIVERY_CHANNEL = {
50
+ Email: "email",
51
+ Telegram: "telegram",
52
+ ReplyEmail: "reply-email",
53
+ ReplyInApp: "reply-in-app",
54
+ } as const;
55
+ export type HelpdeskDeliveryChannel =
56
+ (typeof HELPDESK_DELIVERY_CHANNEL)[keyof typeof HELPDESK_DELIVERY_CHANNEL];
57
+
58
+ export const HELPDESK_DELIVERY_STATUS = {
59
+ Pending: "pending",
60
+ Delivered: "delivered",
61
+ Failed: "failed",
62
+ Skipped: "skipped",
63
+ Read: "read",
64
+ } as const;
65
+ export type HelpdeskDeliveryStatus =
66
+ (typeof HELPDESK_DELIVERY_STATUS)[keyof typeof HELPDESK_DELIVERY_STATUS];
67
+
68
+ export type HelpdeskPhoneMode = "off" | "optional" | "required";
69
+
70
+ export const HelpdeskHandlers = {
71
+ submit: "helpdesk:write:submit",
72
+ report: "helpdesk:write:report",
73
+ reply: "helpdesk:write:reply",
74
+ markDone: "helpdesk:write:mark-done",
75
+ sendTest: "helpdesk:write:send-test",
76
+ forwardRequest: "helpdesk:write:forward-request",
77
+ sendReplyMail: "helpdesk:write:send-reply-mail",
78
+ notifyReporterInApp: "helpdesk:write:notify-reporter-in-app",
79
+ } as const;
80
+
81
+ export const HelpdeskQueries = {
82
+ challenge: "helpdesk:query:challenge",
83
+ openCount: "helpdesk:query:open-count",
84
+ requestDetail: "helpdesk:query:request-detail",
85
+ replies: "helpdesk:query:replies",
86
+ requestDelivery: "helpdesk:query:request-delivery",
87
+ // Entity-convention list QN: entityList screens resolve their query by this shape.
88
+ requestList: "helpdesk:query:helpdesk-request:list",
89
+ } as const;
90
+
91
+ export const HelpdeskScreens = {
92
+ requestList: "helpdesk:screen:request-list",
93
+ requestDetail: "helpdesk:screen:request-detail",
94
+ report: "helpdesk:screen:report",
95
+ reply: "helpdesk:screen:reply",
96
+ replyMail: "helpdesk:screen:reply-mail",
97
+ forwarding: "helpdesk:screen:forwarding",
98
+ } as const;
99
+
100
+ // Files field of both upload forms (report, reply); the uploads are pending under the screen QN.
101
+ export const HELPDESK_UPLOAD_FIELD = "fileIds" as const;
102
+
103
+ export const HelpdeskConfigKeys = {
104
+ replyTo: "helpdesk:config:reply-to",
105
+ telegramChat: "helpdesk:config:telegram-chat",
106
+ } as const;
107
+
108
+ export const HelpdeskErrors = {
109
+ telegramChatMissing: "telegram_chat_missing",
110
+ telegramTestFailed: "telegram_test_failed",
111
+ notFound: "helpdesk_request_not_found",
112
+ phoneNotAllowed: "helpdesk_phone_not_allowed",
113
+ phoneRequired: "helpdesk_phone_required",
114
+ reporterEmailMissing: "helpdesk_reporter_email_missing",
115
+ attachmentNotFound: "helpdesk_attachment_not_found",
116
+ } as const;
117
+
118
+ export const HELPDESK_NOTIFICATION_TYPES = {
119
+ newRequest: "helpdesk:notify:new-request",
120
+ confirmation: "helpdesk:notify:confirmation",
121
+ acknowledgement: "helpdesk:notify:acknowledgement",
122
+ reply: "helpdesk:notify:reply",
123
+ replyInApp: "helpdesk:notify:reply-in-app",
124
+ test: "helpdesk:notify:test",
125
+ } as const;
126
+
127
+ export const HELPDESK_CLIENT_PATH = "/helpdesk/client.js" as const;
128
+
129
+ export const HELPDESK_FIELD_LIMITS = {
130
+ name: 120,
131
+ email: 254,
132
+ phone: 40,
133
+ subject: 200,
134
+ message: 5000,
135
+ locale: 35,
136
+ honeypot: 500,
137
+ page: 300,
138
+ challenge: 64,
139
+ nonce: 32,
140
+ } as const;
141
+
142
+ export const HELPDESK_MAX_FILES = 5;
143
+
144
+ export const HELPDESK_SUBJECT_MAX_CHARS = 80;
145
+
146
+ export const HELPDESK_POW_BITS = { min: 8, max: 26, default: 19 } as const;
147
+ export const HELPDESK_DEFAULT_MIN_SUBMIT_SECONDS = 3;
148
+ export const HELPDESK_DEFAULT_CHALLENGE_TTL_MINUTES = 30;
149
+ export const HELPDESK_CHALLENGE_REDIS_PREFIX = "helpdesk:challenge:" as const;
150
+
151
+ export const HELPDESK_REQUEST_ENTITY = "helpdesk-request" as const;
152
+ export const HELPDESK_REPLY_ENTITY = "helpdesk-reply" as const;
153
+
154
+ export const helpdeskIdempotencyKeys = {
155
+ admins: (requestId: string) => `helpdesk:request:${requestId}:admins`,
156
+ telegram: (requestId: string) => `helpdesk:request:${requestId}:telegram`,
157
+ confirmation: (requestId: string) => `helpdesk:request:${requestId}:confirmation`,
158
+ reply: (replyId: string) => `helpdesk:reply:${replyId}`,
159
+ replyInApp: (replyId: string) => `helpdesk:reply:${replyId}:in-app`,
160
+ } as const;
@@ -0,0 +1,29 @@
1
+ export {
2
+ HELPDESK_ADMIN_KINDS,
3
+ HELPDESK_CLIENT_PATH,
4
+ HELPDESK_DELIVERY_CHANNEL,
5
+ HELPDESK_DELIVERY_STATUS,
6
+ HELPDESK_FEATURE,
7
+ HELPDESK_FIELD_LIMITS,
8
+ HELPDESK_KIND,
9
+ HELPDESK_NOTIFICATION_TYPES,
10
+ HELPDESK_ORIGIN,
11
+ HELPDESK_REPLY_CHANNELS,
12
+ HELPDESK_SOURCE,
13
+ HELPDESK_STATUS,
14
+ HELPDESK_SUBJECT_MAX_CHARS,
15
+ HELPDESK_WEBSITE_KINDS,
16
+ HelpdeskConfigKeys,
17
+ type HelpdeskDeliveryChannel,
18
+ type HelpdeskDeliveryStatus,
19
+ HelpdeskErrors,
20
+ HelpdeskHandlers,
21
+ type HelpdeskKind,
22
+ type HelpdeskOrigin,
23
+ type HelpdeskPhoneMode,
24
+ HelpdeskQueries,
25
+ type HelpdeskReplyChannels,
26
+ HelpdeskScreens,
27
+ type HelpdeskSource,
28
+ type HelpdeskStatus,
29
+ } from "./constants.ts";
@@ -0,0 +1,27 @@
1
+ import type { BootRuleTable } from "@cosmicdrift/kumiko-framework/engine";
2
+
3
+ export const HOST_ROUTING_BOOT_RULES = {
4
+ invalidRedirect: {
5
+ id: "host-routing/invalid-redirect",
6
+ summary:
7
+ "Redirect rules use a path as from, a same-origin path or https URL as to, and a lowercase hostname as host.",
8
+ fix: "Fix the redirect rule named in the error message.",
9
+ },
10
+ invalidApexAnonymousQueryAllowlist: {
11
+ id: "host-routing/invalid-apex-anonymous-query-allowlist",
12
+ summary:
13
+ "apexAnonymousQueryAllowlist keys are apex hostnames and the option is not combined with tenantBy path.",
14
+ fix: "Use apex or www.<apex> keys and drop the option in path mode.",
15
+ },
16
+ invalidDomainOrPrefix: {
17
+ id: "host-routing/invalid-domain-or-prefix",
18
+ summary:
19
+ "baseDomain and hosts keys are lowercase hostnames and tenantPathPrefix is a leading-slash path.",
20
+ fix: "Fix the domain or prefix named in the error message.",
21
+ },
22
+ invalidLocales: {
23
+ id: "host-routing/invalid-locales",
24
+ summary: "Locales look like de or de-at and the default locale is not in prefixed.",
25
+ fix: "Fix the locales option named in the error message.",
26
+ },
27
+ } as const satisfies BootRuleTable;
@@ -1,3 +1,5 @@
1
+ import { bootRuleError } from "@cosmicdrift/kumiko-framework/engine";
2
+ import { HOST_ROUTING_BOOT_RULES } from "./boot-rules.ts";
1
3
  import { isApexHostname } from "./host.ts";
2
4
  import type { HostRoutingOptions } from "./options.ts";
3
5
 
@@ -14,22 +16,24 @@ const REDIRECT_TARGET_PATTERN =
14
16
  function validateRedirects(options: HostRoutingOptions): void {
15
17
  for (const rule of options.redirects ?? []) {
16
18
  if (!REDIRECT_PATH_PATTERN.test(rule.from)) {
17
- throw new Error(`host-routing: redirect from must be a path like "/old", got "${rule.from}"`);
19
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidRedirect, {
20
+ message: `host-routing: redirect from must be a path like "/old", got "${rule.from}"`,
21
+ });
18
22
  }
19
23
  if (rule.from === "/api" || rule.from.startsWith("/api/")) {
20
- throw new Error(
21
- `host-routing: redirect from must not be an /api path, it would never fire, got "${rule.from}"`,
22
- );
24
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidRedirect, {
25
+ message: `host-routing: redirect from must not be an /api path, it would never fire, got "${rule.from}"`,
26
+ });
23
27
  }
24
28
  if (!REDIRECT_TARGET_PATTERN.test(rule.to)) {
25
- throw new Error(
26
- `host-routing: redirect to must be a same-origin path or an https URL without query, got "${rule.to}"`,
27
- );
29
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidRedirect, {
30
+ message: `host-routing: redirect to must be a same-origin path or an https URL without query, got "${rule.to}"`,
31
+ });
28
32
  }
29
33
  if (rule.host !== undefined && !DOMAIN_PATTERN.test(rule.host)) {
30
- throw new Error(
31
- `host-routing: redirect host must be a lowercase hostname, got "${rule.host}"`,
32
- );
34
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidRedirect, {
35
+ message: `host-routing: redirect host must be a lowercase hostname, got "${rule.host}"`,
36
+ });
33
37
  }
34
38
  }
35
39
  }
@@ -38,15 +42,16 @@ function validateAnonymousQueryAllowlist(options: HostRoutingOptions): void {
38
42
  if (options.apexAnonymousQueryAllowlist !== undefined && options.tenantBy === "path") {
39
43
  // Path mode resolves as fallback-only: a client-sent X-Tenant or cookie wins
40
44
  // before the resolver runs, so the allowlist could never hold.
41
- throw new Error(
42
- 'host-routing: apexAnonymousQueryAllowlist cannot be used with tenantBy "path", because the client names its tenant there and bypasses the allowlist',
43
- );
45
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidApexAnonymousQueryAllowlist, {
46
+ message:
47
+ 'host-routing: apexAnonymousQueryAllowlist cannot be used with tenantBy "path", because the client names its tenant there and bypasses the allowlist',
48
+ });
44
49
  }
45
50
  for (const host of Object.keys(options.apexAnonymousQueryAllowlist ?? {})) {
46
51
  if (!isApexHostname(host, options.baseDomain)) {
47
- throw new Error(
48
- `host-routing: apexAnonymousQueryAllowlist key must be the apex or www.<apex> hostname, got "${host}"`,
49
- );
52
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidApexAnonymousQueryAllowlist, {
53
+ message: `host-routing: apexAnonymousQueryAllowlist key must be the apex or www.<apex> hostname, got "${host}"`,
54
+ });
50
55
  }
51
56
  }
52
57
  }
@@ -55,22 +60,24 @@ function validateAnonymousQueryAllowlist(options: HostRoutingOptions): void {
55
60
  // the boot instead of routing every request to a 404.
56
61
  export function validateHostRoutingOptions(options: HostRoutingOptions): void {
57
62
  if (!DOMAIN_PATTERN.test(options.baseDomain)) {
58
- throw new Error(
59
- `host-routing: baseDomain must be a lowercase hostname without port, got "${options.baseDomain}"`,
60
- );
63
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidDomainOrPrefix, {
64
+ message: `host-routing: baseDomain must be a lowercase hostname without port, got "${options.baseDomain}"`,
65
+ });
61
66
  }
62
67
  for (const host of Object.keys(options.hosts ?? {})) {
63
68
  if (!DOMAIN_PATTERN.test(host)) {
64
- throw new Error(`host-routing: hosts key must be a lowercase hostname, got "${host}"`);
69
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidDomainOrPrefix, {
70
+ message: `host-routing: hosts key must be a lowercase hostname, got "${host}"`,
71
+ });
65
72
  }
66
73
  }
67
74
  if (
68
75
  options.tenantPathPrefix !== undefined &&
69
76
  !PATH_PREFIX_PATTERN.test(options.tenantPathPrefix)
70
77
  ) {
71
- throw new Error(
72
- `host-routing: tenantPathPrefix must look like "/app" (leading slash, no trailing slash), got "${options.tenantPathPrefix}"`,
73
- );
78
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidDomainOrPrefix, {
79
+ message: `host-routing: tenantPathPrefix must look like "/app" (leading slash, no trailing slash), got "${options.tenantPathPrefix}"`,
80
+ });
74
81
  }
75
82
  validateRedirects(options);
76
83
  validateAnonymousQueryAllowlist(options);
@@ -78,13 +85,15 @@ export function validateHostRoutingOptions(options: HostRoutingOptions): void {
78
85
  if (locales !== undefined) {
79
86
  for (const locale of [locales.default, ...locales.prefixed]) {
80
87
  if (!LOCALE_PATTERN.test(locale)) {
81
- throw new Error(`host-routing: locale must look like "de" or "de-at", got "${locale}"`);
88
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidLocales, {
89
+ message: `host-routing: locale must look like "de" or "de-at", got "${locale}"`,
90
+ });
82
91
  }
83
92
  }
84
93
  if (locales.prefixed.includes(locales.default)) {
85
- throw new Error(
86
- `host-routing: default locale "${locales.default}" is served unprefixed and must not be in prefixed`,
87
- );
94
+ throw bootRuleError(HOST_ROUTING_BOOT_RULES.invalidLocales, {
95
+ message: `host-routing: default locale "${locales.default}" is served unprefixed and must not be in prefixed`,
96
+ });
88
97
  }
89
98
  }
90
99
  }
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.412.0",
4
+ "type": "fix",
5
+ "title": "documents filed from a mail attachment are visible to whoever may read the mail",
6
+ "detail": "The `inbound-message` read model now declares `access.read` for the member roles: shared mailboxes are readable by every member, a personal mailbox only by its owner, admins included. `createInboundMessageEntity(memberRoles)` builds the entity for the configured roles; `inboundMessageEntity` stays exported with the default roles. The message queries filter rows as before and do not use this rule."
7
+ },
2
8
  {
3
9
  "version": "0.409.0",
4
10
  "type": "fix",
@@ -1,5 +1,5 @@
1
1
  import { collectPiiSubjectFields } from "@cosmicdrift/kumiko-framework/crypto";
2
- import { deriveEntityTableMeta } from "@cosmicdrift/kumiko-framework/db";
2
+ import { deriveEntityTableMeta, physicalColumnName } from "@cosmicdrift/kumiko-framework/db";
3
3
  import {
4
4
  access,
5
5
  createBooleanField,
@@ -10,6 +10,8 @@ import {
10
10
  createTextField,
11
11
  createTimestampField,
12
12
  } from "@cosmicdrift/kumiko-framework/engine";
13
+ import type { OwnershipMap, OwnershipRule } from "@cosmicdrift/kumiko-types/ownership";
14
+ import { DEFAULT_INBOUND_MAIL_ADMIN_ROLES, DEFAULT_INBOUND_MAIL_USER_ROLES } from "./mail-roles.ts";
13
15
 
14
16
  // ============================================================================
15
17
  // Read models for the three event-sourced aggregates
@@ -80,79 +82,105 @@ export const mailAccountEntity = createEntity({
80
82
  },
81
83
  });
82
84
 
85
+ // Mirrors isVisibleToCaller (handlers/scope-visibility.ts) for the roles of the detail query:
86
+ // shared rows and the caller's own personal mailbox, no admin exception. The read gate of other
87
+ // entities (readGate.fileOwner) reads it; the hand-written message queries do not apply it.
88
+ function ownMailboxOrSharedRead(memberRoles: readonly string[]): OwnershipMap {
89
+ const rule: OwnershipRule = {
90
+ kind: "where",
91
+ where: (user, ctx) => {
92
+ const owner = `"${ctx.tableName}"."${physicalColumnName(ctx.table, "ownerUserId")}"`;
93
+ return {
94
+ sqlText: `(${owner} IS NULL OR ${owner} = '' OR ${owner} = $${ctx.paramStart})`,
95
+ params: [user.id],
96
+ };
97
+ },
98
+ };
99
+ return Object.fromEntries(memberRoles.map((role) => [role, rule]));
100
+ }
101
+
83
102
  /** An incoming mail (envelope + snippet, NO body — bodyRef
84
103
  * points to file-foundation). PK = aggregateId =
85
104
  * inboundMessageAggregateId(accountId, providerMessageId). */
86
- export const inboundMessageEntity = createEntity({
87
- table: "read_inbound_messages",
88
- fields: {
89
- accountId: createTextField({
90
- required: true,
91
- maxLength: 36,
92
- personal: false,
93
- reason: "technical_reference",
94
- }),
95
- // Scope is inherited from the account at ingest time: messages from a
96
- // personal mailbox are visible only to the owner, without joining read_mail_accounts.
97
- ownerUserId: createTextField({ maxLength: 36, personal: false, reason: "pseudonymous_fk" }),
98
- messageIdHeader: createTextField({
99
- required: true,
100
- maxLength: 500,
101
- personal: false,
102
- reason: "technical_reference",
103
- }),
104
- threadKey: createTextField({
105
- required: true,
106
- maxLength: 500,
107
- personal: false,
108
- reason: "technical_reference",
109
- }),
110
- from: createTextField({ required: true, maxLength: 2000, personal: "tenant", find: "none" }),
111
- // JSON-stringified string[] — als Ganzes encrypted.
112
- to: createTextField({ maxLength: 8000, personal: "tenant", find: "none" }),
113
- cc: createTextField({ maxLength: 8000, personal: "tenant", find: "none" }),
114
- subject: createTextField({ maxLength: 4000, personal: "tenant", find: "none" }),
115
- snippet: createTextField({ maxLength: 4000, personal: "tenant", find: "none" }),
116
- receivedAt: createTimestampField({ required: true }),
117
- bodyRef: createTextField({ maxLength: 500, personal: false, reason: "technical_reference" }),
118
- scope: createTextField({ maxLength: 200, personal: false, reason: "technical_reference" }),
119
- // Full plaintext, capped at 32_000 characters before encryption (ciphertext is ~2.3x plus envelope).
120
- // Null on rows from before the column; list-messages never selects it.
121
- bodyText: createLongTextField({ maxLength: 200_000, personal: "tenant", find: "none" }),
122
- bodyTextTruncated: createBooleanField(),
123
- // Sanitized HTML of the mail (sanitizeInboundHtml), null when the mail has none or it was too large.
124
- bodyHtml: createLongTextField({ maxLength: 500_000, personal: "tenant", find: "none" }),
125
- // Bound to the message (entityType = the aggregate type), so the file guard answers with the
126
- // mail's visibility. The fileRefs are bound at ingest, the projection copies the ids.
127
- attachmentFileIds: createFilesField({ personal: false, reason: "technical_reference" }),
128
- // JSON-stringified SkippedInboundAttachment[]: nullable JSON stays a text column
129
- // (jsonb fields are NOT NULL), like to/cc.
130
- skippedAttachments: createTextField({
131
- maxLength: 20_000,
132
- personal: false,
133
- reason: "technical_reference",
134
- }),
135
- // JSON-stringified SenderAuthentication or "null"; a SQL null (rows from before the column) reads as null.
136
- senderAuthentication: createTextField({
137
- maxLength: 4000,
138
- personal: false,
139
- reason: "technical_reference",
140
- }),
141
- // "complete" | "snippet" | "unavailable"; null counts as "snippet".
142
- contentState: createTextField({
143
- maxLength: 20,
144
- personal: false,
145
- reason: "technical_reference",
146
- }),
147
- // One of INBOUND_CONTENT_UNAVAILABLE_REASONS; null while the content is there or not yet missing.
148
- contentUnavailableReason: createTextField({
149
- maxLength: 30,
150
- personal: false,
151
- reason: "technical_reference",
152
- }),
153
- },
154
- attachedFileAccess: "record-only",
155
- });
105
+ export function createInboundMessageEntity(memberRoles: readonly string[]) {
106
+ return createEntity({
107
+ access: { read: ownMailboxOrSharedRead(memberRoles) },
108
+ table: "read_inbound_messages",
109
+ fields: {
110
+ accountId: createTextField({
111
+ required: true,
112
+ maxLength: 36,
113
+ personal: false,
114
+ reason: "technical_reference",
115
+ }),
116
+ // Scope is inherited from the account at ingest time: messages from a
117
+ // personal mailbox are visible only to the owner, without joining read_mail_accounts.
118
+ ownerUserId: createTextField({ maxLength: 36, personal: false, reason: "pseudonymous_fk" }),
119
+ messageIdHeader: createTextField({
120
+ required: true,
121
+ maxLength: 500,
122
+ personal: false,
123
+ reason: "technical_reference",
124
+ }),
125
+ threadKey: createTextField({
126
+ required: true,
127
+ maxLength: 500,
128
+ personal: false,
129
+ reason: "technical_reference",
130
+ }),
131
+ from: createTextField({ required: true, maxLength: 2000, personal: "tenant", find: "none" }),
132
+ // JSON-stringified string[] — als Ganzes encrypted.
133
+ to: createTextField({ maxLength: 8000, personal: "tenant", find: "none" }),
134
+ cc: createTextField({ maxLength: 8000, personal: "tenant", find: "none" }),
135
+ subject: createTextField({ maxLength: 4000, personal: "tenant", find: "none" }),
136
+ snippet: createTextField({ maxLength: 4000, personal: "tenant", find: "none" }),
137
+ receivedAt: createTimestampField({ required: true }),
138
+ bodyRef: createTextField({ maxLength: 500, personal: false, reason: "technical_reference" }),
139
+ scope: createTextField({ maxLength: 200, personal: false, reason: "technical_reference" }),
140
+ // Full plaintext, capped at 32_000 characters before encryption (ciphertext is ~2.3x plus envelope).
141
+ // Null on rows from before the column; list-messages never selects it.
142
+ bodyText: createLongTextField({ maxLength: 200_000, personal: "tenant", find: "none" }),
143
+ bodyTextTruncated: createBooleanField(),
144
+ // Sanitized HTML of the mail (sanitizeInboundHtml), null when the mail has none or it was too large.
145
+ bodyHtml: createLongTextField({ maxLength: 500_000, personal: "tenant", find: "none" }),
146
+ // Bound to the message (entityType = the aggregate type), so the file guard answers with the
147
+ // mail's visibility. The fileRefs are bound at ingest, the projection copies the ids.
148
+ attachmentFileIds: createFilesField({ personal: false, reason: "technical_reference" }),
149
+ // JSON-stringified SkippedInboundAttachment[]: nullable JSON stays a text column
150
+ // (jsonb fields are NOT NULL), like to/cc.
151
+ skippedAttachments: createTextField({
152
+ maxLength: 20_000,
153
+ personal: false,
154
+ reason: "technical_reference",
155
+ }),
156
+ // JSON-stringified SenderAuthentication or "null"; a SQL null (rows from before the column) reads as null.
157
+ senderAuthentication: createTextField({
158
+ maxLength: 4000,
159
+ personal: false,
160
+ reason: "technical_reference",
161
+ }),
162
+ // "complete" | "snippet" | "unavailable"; null counts as "snippet".
163
+ contentState: createTextField({
164
+ maxLength: 20,
165
+ personal: false,
166
+ reason: "technical_reference",
167
+ }),
168
+ // One of INBOUND_CONTENT_UNAVAILABLE_REASONS; null while the content is there or not yet missing.
169
+ contentUnavailableReason: createTextField({
170
+ maxLength: 30,
171
+ personal: false,
172
+ reason: "technical_reference",
173
+ }),
174
+ },
175
+ attachedFileAccess: "record-only",
176
+ });
177
+ }
178
+
179
+ // Same fields for every role set; table and PII lists do not depend on the roles.
180
+ export const inboundMessageEntity = createInboundMessageEntity([
181
+ ...DEFAULT_INBOUND_MAIL_ADMIN_ROLES,
182
+ ...DEFAULT_INBOUND_MAIL_USER_ROLES,
183
+ ]);
156
184
 
157
185
  /** Thread-Rollup. PK = aggregateId = mailThreadAggregateId(tenantId,
158
186
  * threadKey). */
@@ -24,7 +24,7 @@
24
24
  import { defineFeature, EXT_TENANT_DATA } from "@cosmicdrift/kumiko-framework/engine";
25
25
  import { INBOUND_MAIL_FOUNDATION_FEATURE, INBOUND_MAIL_PROVIDER_EXTENSION } from "./constants.ts";
26
26
  import {
27
- inboundMessageEntity,
27
+ createInboundMessageEntity,
28
28
  mailAccountEntity,
29
29
  mailThreadEntity,
30
30
  seenMessageTable,
@@ -208,7 +208,7 @@ export function createInboundMailFoundationFeature(options: InboundMailRoleOptio
208
208
  name: "inbound-message",
209
209
  source: INBOUND_MESSAGE_AGGREGATE_TYPE,
210
210
  table: inboundMessagesProjectionTable,
211
- entity: inboundMessageEntity,
211
+ entity: createInboundMessageEntity(roles.memberRoles),
212
212
  apply: {
213
213
  [INBOUND_MESSAGE_RECEIVED_EVENT_QN]: applyInboundMessageReceived,
214
214
  [INBOUND_MESSAGE_CONTENT_FETCHED_EVENT_QN]: applyInboundMessageContentFetched,
@@ -0,0 +1,9 @@
1
+ import type { BootRuleTable } from "@cosmicdrift/kumiko-framework/engine";
2
+
3
+ export const JOBS_BOOT_RULES = {
4
+ anonymousReadRole: {
5
+ id: "jobs/anonymous-read-role",
6
+ summary: "The jobs readRoles option does not contain anonymous.",
7
+ fix: "Remove anonymous from readRoles.",
8
+ },
9
+ } as const satisfies BootRuleTable;
@@ -1,4 +1,9 @@
1
- import { defineFeature, type FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
1
+ import {
2
+ bootRuleError,
3
+ defineFeature,
4
+ type FeatureDefinition,
5
+ } from "@cosmicdrift/kumiko-framework/engine";
6
+ import { JOBS_BOOT_RULES } from "./boot-rules.ts";
2
7
  import { catalogQuery } from "./handlers/catalog.query.ts";
3
8
  import {
4
9
  consumerDisableWrite,
@@ -60,9 +65,9 @@ export function createJobsFeature(options: JobsFeatureOptions = {}): FeatureDefi
60
65
  const staleRunTimeoutHours = options.staleRunTimeoutHours ?? DEFAULT_JOB_RUN_STALE_TIMEOUT_HOURS;
61
66
  const readRoles = options.readRoles ?? [];
62
67
  if (readRoles.includes("anonymous")) {
63
- throw new Error(
64
- `createJobsFeature: readRoles must not contain "anonymous" — job status and failures are only readable by members of the tenant.`,
65
- );
68
+ throw bootRuleError(JOBS_BOOT_RULES.anonymousReadRole, {
69
+ message: `createJobsFeature: readRoles must not contain "anonymous" — job status and failures are only readable by members of the tenant.`,
70
+ });
66
71
  }
67
72
  return defineFeature("jobs", (r) => {
68
73
  r.adoptsBundledLists();
@@ -0,0 +1,19 @@
1
+ import type { BootRuleTable } from "@cosmicdrift/kumiko-framework/engine";
2
+
3
+ export const LEGAL_PAGES_BOOT_RULES = {
4
+ invalidRoute: {
5
+ id: "legal-pages/invalid-route",
6
+ summary: "Legal page routes declare path, slug and lang, and the path starts with a slash.",
7
+ fix: "Fix the route named in the error message.",
8
+ },
9
+ duplicateRoutePath: {
10
+ id: "legal-pages/duplicate-route-path",
11
+ summary: "Legal page route paths are unique.",
12
+ fix: "Remove or rename the duplicate route.",
13
+ },
14
+ routesWithoutRequiredBlocks: {
15
+ id: "legal-pages/routes-without-required-blocks",
16
+ summary: "Custom routes that miss the default required blocks pass requiredBlocks explicitly.",
17
+ fix: "Pass requiredBlocks (or an empty array) alongside custom routes.",
18
+ },
19
+ } as const satisfies BootRuleTable;
@@ -1,5 +1,6 @@
1
1
  import { computeRevisionEtag, etagMatches } from "@cosmicdrift/kumiko-framework/api";
2
2
  import {
3
+ bootRuleError,
3
4
  defineFeature,
4
5
  type FeatureDefinition,
5
6
  SYSTEM_TENANT_ID,
@@ -11,6 +12,7 @@ import {
11
12
  redirectToCanonicalPath,
12
13
  slashVariantOf,
13
14
  } from "../page-render/index.ts";
15
+ import { LEGAL_PAGES_BOOT_RULES } from "./boot-rules.ts";
14
16
  import { runLegalPagesBootCheck } from "./lib/boot-check.ts";
15
17
  import { validateRoutes } from "./lib/validate-routes.ts";
16
18
  import { renderMarkdownToHtml, wrapInLayout } from "./markdown.ts";
@@ -113,9 +115,10 @@ export function createLegalPagesFeature(opts: LegalPagesOptions = {}): FeatureDe
113
115
  opts.routes?.some((route) => route.slug === block.slug && route.lang === block.lang),
114
116
  );
115
117
  if (!coversDefaultBlock) {
116
- throw new Error(
117
- "legal-pages: custom `routes` without `requiredBlocks` — pass `requiredBlocks` explicitly (or `[]`)",
118
- );
118
+ throw bootRuleError(LEGAL_PAGES_BOOT_RULES.routesWithoutRequiredBlocks, {
119
+ message:
120
+ "legal-pages: custom `routes` without `requiredBlocks` — pass `requiredBlocks` explicitly (or `[]`)",
121
+ });
119
122
  }
120
123
  }
121
124
  const alternatesBySlug = alternatesBySlugOf(routes);