@cosmicdrift/kumiko-bundled-features 0.412.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 (166) hide show
  1. package/dist/admin-shell/feature.d.ts +1 -1
  2. package/dist/agent-tools/api-docs/anchors.js +1 -1
  3. package/dist/auth-email-password/boot-rules.d.ts +7 -0
  4. package/dist/auth-email-password/boot-rules.js +7 -0
  5. package/dist/auth-email-password/feature.js +6 -13
  6. package/dist/auth-email-password/validate-options.d.ts +5 -0
  7. package/dist/auth-email-password/validate-options.js +15 -0
  8. package/dist/billing-foundation/boot-rules.d.ts +22 -0
  9. package/dist/billing-foundation/boot-rules.js +22 -0
  10. package/dist/billing-foundation/validate-options.js +56 -18
  11. package/dist/cap-overview/boot-rules.d.ts +12 -0
  12. package/dist/cap-overview/boot-rules.js +12 -0
  13. package/dist/cap-overview/feature.js +8 -3
  14. package/dist/documents/boot-rules.d.ts +12 -0
  15. package/dist/documents/boot-rules.js +12 -0
  16. package/dist/documents/feature.js +8 -3
  17. package/dist/file-derivatives/boot-rules.d.ts +7 -0
  18. package/dist/file-derivatives/boot-rules.js +7 -0
  19. package/dist/file-derivatives/feature.js +5 -2
  20. package/dist/folders/boot-rules.d.ts +7 -0
  21. package/dist/folders/boot-rules.js +7 -0
  22. package/dist/folders/feature.js +8 -5
  23. package/dist/helpdesk/boot-rules.d.ts +7 -0
  24. package/dist/helpdesk/boot-rules.js +7 -0
  25. package/dist/{contact → helpdesk}/challenge.js +2 -2
  26. package/dist/helpdesk/client/helpdesk-client-source.d.ts +1 -0
  27. package/dist/{contact/client/contact-client-source.js → helpdesk/client/helpdesk-client-source.js} +4 -4
  28. package/dist/helpdesk/client/helpdesk-website-client.d.ts +26 -0
  29. package/dist/helpdesk/client/index.d.ts +2 -0
  30. package/dist/helpdesk/client/index.js +1 -0
  31. package/dist/{contact → helpdesk}/entity.d.ts +6 -6
  32. package/dist/{contact → helpdesk}/entity.js +31 -27
  33. package/dist/helpdesk/feature.d.ts +3 -0
  34. package/dist/{contact → helpdesk}/feature.js +43 -39
  35. package/dist/{contact → helpdesk}/handlers/attempts.d.ts +2 -2
  36. package/dist/helpdesk/handlers/challenge.query.d.ts +9 -0
  37. package/dist/{contact → helpdesk}/handlers/challenge.query.js +5 -5
  38. package/dist/helpdesk/handlers/forward-request.write.d.ts +9 -0
  39. package/dist/{contact → helpdesk}/handlers/forward-request.write.js +17 -15
  40. package/dist/{contact → helpdesk}/handlers/mark-done.write.d.ts +2 -2
  41. package/dist/{contact → helpdesk}/handlers/mark-done.write.js +8 -8
  42. package/dist/{contact → helpdesk}/handlers/notify-reporter-in-app.write.d.ts +2 -2
  43. package/dist/{contact → helpdesk}/handlers/notify-reporter-in-app.write.js +11 -11
  44. package/dist/{contact → helpdesk}/handlers/open-count.js +2 -2
  45. package/dist/{contact → helpdesk}/handlers/open-count.query.js +4 -4
  46. package/dist/{contact → helpdesk}/handlers/replies.query.js +6 -6
  47. package/dist/{contact → helpdesk}/handlers/reply.write.d.ts +4 -4
  48. package/dist/{contact → helpdesk}/handlers/reply.write.js +16 -16
  49. package/dist/helpdesk/handlers/report.write.d.ts +16 -0
  50. package/dist/{contact → helpdesk}/handlers/report.write.js +17 -17
  51. package/dist/helpdesk/handlers/request-delivery.query.d.ts +16 -0
  52. package/dist/{contact → helpdesk}/handlers/request-delivery.query.js +24 -24
  53. package/dist/{contact → helpdesk}/handlers/request-detail.query.d.ts +3 -3
  54. package/dist/{contact → helpdesk}/handlers/request-detail.query.js +10 -10
  55. package/dist/{contact → helpdesk}/handlers/request-list.query.js +2 -2
  56. package/dist/helpdesk/handlers/send-reply-mail.write.d.ts +8 -0
  57. package/dist/{contact → helpdesk}/handlers/send-reply-mail.write.js +15 -15
  58. package/dist/helpdesk/handlers/send-test.write.d.ts +5 -0
  59. package/dist/{contact → helpdesk}/handlers/send-test.write.js +10 -10
  60. package/dist/{contact → helpdesk}/handlers/submit.write.d.ts +4 -4
  61. package/dist/{contact → helpdesk}/handlers/submit.write.js +17 -17
  62. package/dist/{contact → helpdesk}/handlers/take-over-uploads.js +5 -5
  63. package/dist/{contact → helpdesk}/i18n.d.ts +1 -1
  64. package/dist/{contact → helpdesk}/i18n.js +78 -75
  65. package/dist/helpdesk/index.d.ts +5 -0
  66. package/dist/helpdesk/index.js +4 -0
  67. package/dist/{contact → helpdesk}/lib.d.ts +5 -5
  68. package/dist/{contact → helpdesk}/lib.js +16 -16
  69. package/dist/{contact → helpdesk}/mail.d.ts +20 -20
  70. package/dist/{contact → helpdesk}/mail.js +47 -47
  71. package/dist/{contact → helpdesk}/options.d.ts +6 -6
  72. package/dist/helpdesk/options.js +36 -0
  73. package/dist/helpdesk/panels.d.ts +2 -0
  74. package/dist/helpdesk/panels.js +21 -0
  75. package/dist/{contact → helpdesk}/payloads.d.ts +11 -11
  76. package/dist/{contact → helpdesk}/payloads.js +28 -28
  77. package/dist/helpdesk/screens.d.ts +5 -0
  78. package/dist/{contact → helpdesk}/screens.js +87 -87
  79. package/dist/{contact → helpdesk}/subject.js +3 -3
  80. package/dist/helpdesk/user-data-hooks.d.ts +3 -0
  81. package/dist/{contact → helpdesk}/user-data-hooks.js +15 -15
  82. package/dist/helpdesk/web/constants.d.ts +127 -0
  83. package/dist/helpdesk/web/constants.js +126 -0
  84. package/dist/helpdesk/web/index.d.ts +1 -0
  85. package/dist/helpdesk/web/index.js +1 -0
  86. package/dist/host-routing/boot-rules.d.ts +22 -0
  87. package/dist/host-routing/boot-rules.js +22 -0
  88. package/dist/host-routing/validate-options.js +35 -11
  89. package/dist/jobs/boot-rules.d.ts +7 -0
  90. package/dist/jobs/boot-rules.js +7 -0
  91. package/dist/jobs/feature.js +5 -2
  92. package/dist/legal-pages/boot-rules.d.ts +17 -0
  93. package/dist/legal-pages/boot-rules.js +17 -0
  94. package/dist/legal-pages/feature.js +5 -2
  95. package/dist/legal-pages/lib/validate-routes.js +11 -3
  96. package/dist/metrics/boot-rules.d.ts +12 -0
  97. package/dist/metrics/boot-rules.js +12 -0
  98. package/dist/metrics/validate.js +8 -2
  99. package/dist/notes-history/boot-rules.d.ts +7 -0
  100. package/dist/notes-history/boot-rules.js +7 -0
  101. package/dist/notes-history/feature.js +7 -4
  102. package/dist/personal-access-tokens/boot-rules.d.ts +7 -0
  103. package/dist/personal-access-tokens/boot-rules.js +7 -0
  104. package/dist/personal-access-tokens/scope-events-check.js +7 -4
  105. package/dist/presence/boot-rules.d.ts +7 -0
  106. package/dist/presence/boot-rules.js +7 -0
  107. package/dist/presence/options.js +5 -1
  108. package/dist/readiness/boot-rules.d.ts +12 -0
  109. package/dist/readiness/boot-rules.js +12 -0
  110. package/dist/readiness/probe-boot-check.js +8 -3
  111. package/dist/shared/assert-no-where-rule-in-ownership-write.d.ts +1 -1
  112. package/dist/shared/assert-no-where-rule-in-ownership-write.js +11 -7
  113. package/dist/shared/boot-rules.d.ts +7 -0
  114. package/dist/shared/boot-rules.js +7 -0
  115. package/dist/subscription-mollie/boot-rules.d.ts +17 -0
  116. package/dist/subscription-mollie/boot-rules.js +17 -0
  117. package/dist/subscription-mollie/feature.js +13 -6
  118. package/dist/tags/boot-rules.d.ts +7 -0
  119. package/dist/tags/boot-rules.js +7 -0
  120. package/dist/tags/feature.js +8 -5
  121. package/dist/template-resolver/boot-rules.d.ts +17 -0
  122. package/dist/template-resolver/boot-rules.js +17 -0
  123. package/dist/template-resolver/feature.js +14 -5
  124. package/dist/tenant/boot-rules.d.ts +7 -0
  125. package/dist/tenant/boot-rules.js +7 -0
  126. package/dist/tenant/feature.js +5 -2
  127. package/kumiko-es-tables.json +4 -4
  128. package/package.json +29 -29
  129. package/src/{contact → helpdesk}/changes.json +6 -0
  130. package/dist/contact/client/contact-client-source.d.ts +0 -1
  131. package/dist/contact/client/contact-website-client.d.ts +0 -26
  132. package/dist/contact/client/index.d.ts +0 -2
  133. package/dist/contact/client/index.js +0 -1
  134. package/dist/contact/feature.d.ts +0 -3
  135. package/dist/contact/handlers/challenge.query.d.ts +0 -9
  136. package/dist/contact/handlers/forward-request.write.d.ts +0 -9
  137. package/dist/contact/handlers/report.write.d.ts +0 -16
  138. package/dist/contact/handlers/request-delivery.query.d.ts +0 -16
  139. package/dist/contact/handlers/send-reply-mail.write.d.ts +0 -8
  140. package/dist/contact/handlers/send-test.write.d.ts +0 -5
  141. package/dist/contact/index.d.ts +0 -5
  142. package/dist/contact/index.js +0 -4
  143. package/dist/contact/options.js +0 -32
  144. package/dist/contact/panels.d.ts +0 -2
  145. package/dist/contact/panels.js +0 -21
  146. package/dist/contact/screens.d.ts +0 -5
  147. package/dist/contact/user-data-hooks.d.ts +0 -3
  148. package/dist/contact/web/constants.d.ts +0 -127
  149. package/dist/contact/web/constants.js +0 -126
  150. package/dist/contact/web/index.d.ts +0 -1
  151. package/dist/contact/web/index.js +0 -1
  152. /package/dist/{contact → helpdesk}/challenge.d.ts +0 -0
  153. /package/dist/{contact/client/contact-website-client.js → helpdesk/client/helpdesk-website-client.js} +0 -0
  154. /package/dist/{contact → helpdesk}/handlers/access.d.ts +0 -0
  155. /package/dist/{contact → helpdesk}/handlers/access.js +0 -0
  156. /package/dist/{contact → helpdesk}/handlers/attempts.js +0 -0
  157. /package/dist/{contact → helpdesk}/handlers/open-count.d.ts +0 -0
  158. /package/dist/{contact → helpdesk}/handlers/open-count.query.d.ts +0 -0
  159. /package/dist/{contact → helpdesk}/handlers/replies.query.d.ts +0 -0
  160. /package/dist/{contact → helpdesk}/handlers/request-list.query.d.ts +0 -0
  161. /package/dist/{contact → helpdesk}/handlers/take-over-uploads.d.ts +0 -0
  162. /package/dist/{contact → helpdesk}/pow.d.ts +0 -0
  163. /package/dist/{contact → helpdesk}/pow.js +0 -0
  164. /package/dist/{contact → helpdesk}/subject.d.ts +0 -0
  165. /package/dist/{contact → helpdesk}/user-agent.d.ts +0 -0
  166. /package/dist/{contact → helpdesk}/user-agent.js +0 -0
@@ -1,18 +1,18 @@
1
1
  import { access, createFilesField, createTextField } from "@cosmicdrift/kumiko-framework/engine";
2
2
  import { DELIVERY_LOG_SCREEN_ID } from "../delivery/index.js";
3
3
  import { REPORT_ACCESS } from "./handlers/access.js";
4
- import { CONTACT_ADMIN_KINDS, CONTACT_DELIVERY_STATUS, CONTACT_FEATURE, CONTACT_MAX_FILES, CONTACT_ORIGIN, CONTACT_REPLY_CHANNELS, CONTACT_STATUS, CONTACT_UPLOAD_FIELD, ContactConfigKeys, ContactHandlers, ContactQueries, } from "./web/constants.js";
4
+ import { HELPDESK_ADMIN_KINDS, HELPDESK_DELIVERY_STATUS, HELPDESK_FEATURE, HELPDESK_MAX_FILES, HELPDESK_ORIGIN, HELPDESK_REPLY_CHANNELS, HELPDESK_STATUS, HELPDESK_UPLOAD_FIELD, HelpdeskConfigKeys, HelpdeskHandlers, HelpdeskQueries, } from "./web/constants.js";
5
5
  const MAX_FILE_SIZE = "10MB";
6
- const REQUEST_FIELD = `${CONTACT_FEATURE}:entity:contact-request:field`;
7
- const DELIVERY_FIELD = `${CONTACT_FEATURE}:entity:contact-delivery:field`;
6
+ const REQUEST_FIELD = `${HELPDESK_FEATURE}:entity:helpdesk-request:field`;
7
+ const DELIVERY_FIELD = `${HELPDESK_FEATURE}:entity:helpdesk-delivery:field`;
8
8
  const TELEGRAM_BOT_TOKEN_SECRET = "channel-telegram:secret:bot-token";
9
- export const REPORT_FIELD_LABEL = `${CONTACT_FEATURE}:report.field`;
10
- export const REPLY_FIELD_LABEL = `${CONTACT_FEATURE}:reply.field`;
9
+ export const REPORT_FIELD_LABEL = `${HELPDESK_FEATURE}:report.field`;
10
+ export const REPLY_FIELD_LABEL = `${HELPDESK_FEATURE}:reply.field`;
11
11
  function attachmentsField() {
12
12
  return createFilesField({
13
13
  personal: false,
14
14
  reason: "is_business_data",
15
- maxCount: CONTACT_MAX_FILES,
15
+ maxCount: HELPDESK_MAX_FILES,
16
16
  maxSize: MAX_FILE_SIZE,
17
17
  display: "dropzone",
18
18
  });
@@ -25,32 +25,32 @@ function createReportScreen(opts, settings) {
25
25
  id: "report",
26
26
  type: "actionForm",
27
27
  dormant: true,
28
- handler: ContactHandlers.report,
28
+ handler: HelpdeskHandlers.report,
29
29
  summary: {
30
- title: `${CONTACT_FEATURE}:report.hint`,
31
- subtitle: `${CONTACT_FEATURE}:report.summary`,
30
+ title: `${HELPDESK_FEATURE}:report.hint`,
31
+ subtitle: `${HELPDESK_FEATURE}:report.summary`,
32
32
  params: { appName: opts.appName },
33
33
  },
34
34
  fields: {
35
- kind: { type: "select", options: CONTACT_ADMIN_KINDS, required: true, display: "radio" },
35
+ kind: { type: "select", options: HELPDESK_ADMIN_KINDS, required: true, display: "radio" },
36
36
  ...(withPhone && {
37
37
  phone: { type: "text", format: "phone", required: settings.phone === "required" },
38
38
  }),
39
39
  subject: { type: "text", required: true },
40
40
  message: { type: "longText", required: true },
41
- [CONTACT_UPLOAD_FIELD]: attachmentsField(),
41
+ [HELPDESK_UPLOAD_FIELD]: attachmentsField(),
42
42
  },
43
43
  layout: {
44
44
  sections: [
45
45
  {
46
- title: `${CONTACT_FEATURE}:report.section`,
47
- description: `${CONTACT_FEATURE}:report.section.description`,
46
+ title: `${HELPDESK_FEATURE}:report.section`,
47
+ description: `${HELPDESK_FEATURE}:report.section.description`,
48
48
  fields: [
49
49
  "kind",
50
50
  ...(withPhone ? ["phone"] : []),
51
51
  { field: "subject", span: 2 },
52
52
  "message",
53
- CONTACT_UPLOAD_FIELD,
53
+ HELPDESK_UPLOAD_FIELD,
54
54
  ],
55
55
  },
56
56
  ],
@@ -60,11 +60,11 @@ function createReportScreen(opts, settings) {
60
60
  phone: `${REPORT_FIELD_LABEL}.phone`,
61
61
  subject: `${REPORT_FIELD_LABEL}.subject`,
62
62
  message: `${REPORT_FIELD_LABEL}.message`,
63
- [CONTACT_UPLOAD_FIELD]: `${REPORT_FIELD_LABEL}.files`,
63
+ [HELPDESK_UPLOAD_FIELD]: `${REPORT_FIELD_LABEL}.files`,
64
64
  },
65
- submitLabel: `${CONTACT_FEATURE}:report.submit`,
65
+ submitLabel: `${HELPDESK_FEATURE}:report.submit`,
66
66
  ...(opts.reportCancelTarget !== undefined && { cancelTarget: opts.reportCancelTarget }),
67
- successMessage: `${CONTACT_FEATURE}:report.success`,
67
+ successMessage: `${HELPDESK_FEATURE}:report.success`,
68
68
  access: REPORT_ACCESS,
69
69
  };
70
70
  }
@@ -75,12 +75,12 @@ function createReplyScreen(id, summarySubtitle) {
75
75
  id,
76
76
  type: "actionForm",
77
77
  dormant: true,
78
- handler: ContactHandlers.reply,
79
- summary: { title: `${CONTACT_FEATURE}:reply.title`, subtitle: summarySubtitle },
78
+ handler: HelpdeskHandlers.reply,
79
+ summary: { title: `${HELPDESK_FEATURE}:reply.title`, subtitle: summarySubtitle },
80
80
  fields: {
81
81
  requestId: { type: "text", required: true },
82
82
  message: { type: "longText", required: true },
83
- [CONTACT_UPLOAD_FIELD]: attachmentsField(),
83
+ [HELPDESK_UPLOAD_FIELD]: attachmentsField(),
84
84
  markDone: { type: "boolean" },
85
85
  name: { type: "text" },
86
86
  email: { type: "text" },
@@ -89,15 +89,15 @@ function createReplyScreen(id, summarySubtitle) {
89
89
  layout: {
90
90
  sections: [
91
91
  {
92
- title: `${CONTACT_FEATURE}:reply.section`,
93
- description: `${CONTACT_FEATURE}:reply.section.description`,
92
+ title: `${HELPDESK_FEATURE}:reply.section`,
93
+ description: `${HELPDESK_FEATURE}:reply.section.description`,
94
94
  fields: [
95
95
  { field: "requestId", visible: false },
96
96
  { field: "name", visible: false },
97
97
  { field: "email", visible: false },
98
98
  { field: "replyTo", visible: false },
99
99
  "message",
100
- CONTACT_UPLOAD_FIELD,
100
+ HELPDESK_UPLOAD_FIELD,
101
101
  "markDone",
102
102
  ],
103
103
  },
@@ -105,24 +105,24 @@ function createReplyScreen(id, summarySubtitle) {
105
105
  },
106
106
  fieldLabels: {
107
107
  message: `${REPLY_FIELD_LABEL}.message`,
108
- [CONTACT_UPLOAD_FIELD]: `${REPLY_FIELD_LABEL}.files`,
108
+ [HELPDESK_UPLOAD_FIELD]: `${REPLY_FIELD_LABEL}.files`,
109
109
  markDone: `${REPLY_FIELD_LABEL}.mark-done`,
110
110
  },
111
- submitLabel: `${CONTACT_FEATURE}:reply.submit`,
111
+ submitLabel: `${HELPDESK_FEATURE}:reply.submit`,
112
112
  access: { roles: access.systemAdmin },
113
113
  };
114
114
  }
115
115
  const requestListScreen = {
116
116
  id: "request-list",
117
117
  type: "entityList",
118
- entity: "contact-request",
118
+ entity: "helpdesk-request",
119
119
  dormant: true,
120
120
  allowCreate: false,
121
121
  searchable: true,
122
122
  columns: [
123
123
  { field: "submittedAt", display: "datetime" },
124
124
  "kind",
125
- { field: "name", label: `${CONTACT_FEATURE}:list.from` },
125
+ { field: "name", label: `${HELPDESK_FEATURE}:list.from` },
126
126
  { field: "reporterTenantName", label: `${REQUEST_FIELD}:reporterTenantName` },
127
127
  { field: "subject", hideOnNarrow: true },
128
128
  {
@@ -138,19 +138,19 @@ const requestListScreen = {
138
138
  display: "chips",
139
139
  showCounts: true,
140
140
  extraOptions: [
141
- { id: "all", label: `${CONTACT_FEATURE}:filter.all`, values: [], position: "start" },
141
+ { id: "all", label: `${HELPDESK_FEATURE}:filter.all`, values: [], position: "start" },
142
142
  ],
143
143
  },
144
144
  kind: { display: "select" },
145
145
  source: { display: "select" },
146
146
  },
147
- defaultFilters: { status: [CONTACT_STATUS.Open] },
147
+ defaultFilters: { status: [HELPDESK_STATUS.Open] },
148
148
  defaultSort: { field: "submittedAt", dir: "desc" },
149
149
  rowActions: [
150
150
  {
151
151
  kind: "navigate",
152
152
  id: "open",
153
- label: `${CONTACT_FEATURE}:action.open`,
153
+ label: `${HELPDESK_FEATURE}:action.open`,
154
154
  screen: "request-detail",
155
155
  entityId: "id",
156
156
  rowClick: true,
@@ -158,21 +158,21 @@ const requestListScreen = {
158
158
  {
159
159
  kind: "writeHandler",
160
160
  id: "mark-done",
161
- label: `${CONTACT_FEATURE}:action.mark-done`,
162
- handler: ContactHandlers.markDone,
161
+ label: `${HELPDESK_FEATURE}:action.mark-done`,
162
+ handler: HelpdeskHandlers.markDone,
163
163
  payload: { pick: ["id"] },
164
- visible: { field: "status", ne: CONTACT_STATUS.Done },
164
+ visible: { field: "status", ne: HELPDESK_STATUS.Done },
165
165
  },
166
166
  ],
167
167
  bulkActions: [{ id: "mark-done", rowAction: "mark-done" }],
168
168
  access: { roles: access.systemAdmin },
169
169
  };
170
170
  const deliveryStatusTones = {
171
- [CONTACT_DELIVERY_STATUS.Pending]: "warn",
172
- [CONTACT_DELIVERY_STATUS.Delivered]: "ok",
173
- [CONTACT_DELIVERY_STATUS.Failed]: "bad",
174
- [CONTACT_DELIVERY_STATUS.Skipped]: "neutral",
175
- [CONTACT_DELIVERY_STATUS.Read]: "accent",
171
+ [HELPDESK_DELIVERY_STATUS.Pending]: "warn",
172
+ [HELPDESK_DELIVERY_STATUS.Delivered]: "ok",
173
+ [HELPDESK_DELIVERY_STATUS.Failed]: "bad",
174
+ [HELPDESK_DELIVERY_STATUS.Skipped]: "neutral",
175
+ [HELPDESK_DELIVERY_STATUS.Read]: "accent",
176
176
  };
177
177
  function detailLinkTarget(link, defaultScreen) {
178
178
  if (link === false)
@@ -186,7 +186,7 @@ function createRequestDetailScreen(opts, settings) {
186
186
  id: "request-detail",
187
187
  type: "projectionDetail",
188
188
  dormant: true,
189
- query: ContactQueries.requestDetail,
189
+ query: HelpdeskQueries.requestDetail,
190
190
  listScreenId: "request-list",
191
191
  header: {
192
192
  title: "subject",
@@ -215,50 +215,50 @@ function createRequestDetailScreen(opts, settings) {
215
215
  status: "status",
216
216
  statusFormat: { format: "enumOption", keyPrefix: `${REQUEST_FIELD}:status:option:` },
217
217
  statusTones: {
218
- [CONTACT_STATUS.Open]: "warn",
219
- [CONTACT_STATUS.Answered]: "accent",
220
- [CONTACT_STATUS.Done]: "ok",
218
+ [HELPDESK_STATUS.Open]: "warn",
219
+ [HELPDESK_STATUS.Answered]: "accent",
220
+ [HELPDESK_STATUS.Done]: "ok",
221
221
  },
222
222
  },
223
223
  actions: [
224
224
  {
225
225
  kind: "writeHandler",
226
226
  id: "mark-done",
227
- label: `${CONTACT_FEATURE}:action.mark-done`,
228
- handler: ContactHandlers.markDone,
227
+ label: `${HELPDESK_FEATURE}:action.mark-done`,
228
+ handler: HelpdeskHandlers.markDone,
229
229
  icon: "check-circle",
230
230
  style: "secondary",
231
231
  payload: { pick: ["id"] },
232
- visible: { field: "status", ne: CONTACT_STATUS.Done },
232
+ visible: { field: "status", ne: HELPDESK_STATUS.Done },
233
233
  },
234
234
  {
235
235
  kind: "drawer",
236
236
  id: "reply",
237
237
  icon: "mail",
238
238
  style: "primary",
239
- label: `${CONTACT_FEATURE}:action.reply`,
239
+ label: `${HELPDESK_FEATURE}:action.reply`,
240
240
  screen: "reply",
241
241
  params: { map: { requestId: "id", name: "name", email: "email", replyTo: "replyTo" } },
242
242
  title: "screen:reply.title",
243
- visible: { field: "replyChannels", eq: CONTACT_REPLY_CHANNELS.EmailAndInApp },
243
+ visible: { field: "replyChannels", eq: HELPDESK_REPLY_CHANNELS.EmailAndInApp },
244
244
  },
245
245
  {
246
246
  kind: "drawer",
247
247
  id: "reply-mail",
248
248
  icon: "mail",
249
249
  style: "primary",
250
- label: `${CONTACT_FEATURE}:action.reply`,
250
+ label: `${HELPDESK_FEATURE}:action.reply`,
251
251
  screen: "reply-mail",
252
252
  params: { map: { requestId: "id", name: "name", email: "email", replyTo: "replyTo" } },
253
253
  title: "screen:reply-mail.title",
254
- visible: { field: "replyChannels", eq: CONTACT_REPLY_CHANNELS.Email },
254
+ visible: { field: "replyChannels", eq: HELPDESK_REPLY_CHANNELS.Email },
255
255
  },
256
256
  ],
257
257
  primaryAction: "reply",
258
258
  inlineActions: ["mark-done"],
259
259
  fieldLabels: {
260
260
  message: `${REQUEST_FIELD}:message`,
261
- fileIds: `${CONTACT_FEATURE}:detail.attachments`,
261
+ fileIds: `${HELPDESK_FEATURE}:detail.attachments`,
262
262
  name: `${REQUEST_FIELD}:name`,
263
263
  email: `${REQUEST_FIELD}:email`,
264
264
  phone: `${REQUEST_FIELD}:phone`,
@@ -270,37 +270,37 @@ function createRequestDetailScreen(opts, settings) {
270
270
  },
271
271
  layout: {
272
272
  sections: [
273
- { title: `${CONTACT_FEATURE}:detail.section.message`, fields: ["message"] },
273
+ { title: `${HELPDESK_FEATURE}:detail.section.message`, fields: ["message"] },
274
274
  {
275
275
  kind: "relatedList",
276
276
  readOnly: true,
277
- title: `${CONTACT_FEATURE}:detail.section.replies`,
278
- query: ContactQueries.replies,
277
+ title: `${HELPDESK_FEATURE}:detail.section.replies`,
278
+ query: HelpdeskQueries.replies,
279
279
  columns: [
280
280
  {
281
281
  field: "sentAt",
282
282
  renderer: { format: "timestamp", dateStyle: "medium", timeStyle: "short" },
283
- label: `${CONTACT_FEATURE}:entity:contact-reply:field:sentAt`,
283
+ label: `${HELPDESK_FEATURE}:entity:helpdesk-reply:field:sentAt`,
284
284
  },
285
285
  {
286
286
  field: "authorName",
287
- label: `${CONTACT_FEATURE}:entity:contact-reply:field:authorName`,
287
+ label: `${HELPDESK_FEATURE}:entity:helpdesk-reply:field:authorName`,
288
288
  },
289
- { field: "message", label: `${CONTACT_FEATURE}:entity:contact-reply:field:message` },
289
+ { field: "message", label: `${HELPDESK_FEATURE}:entity:helpdesk-reply:field:message` },
290
290
  ],
291
291
  },
292
292
  {
293
- title: `${CONTACT_FEATURE}:detail.section.files`,
293
+ title: `${HELPDESK_FEATURE}:detail.section.files`,
294
294
  fields: [
295
295
  {
296
- field: CONTACT_UPLOAD_FIELD,
296
+ field: HELPDESK_UPLOAD_FIELD,
297
297
  renderer: { format: "file" },
298
298
  visible: { field: "fileCount", ne: 0 },
299
299
  },
300
300
  ],
301
301
  },
302
302
  {
303
- title: `${CONTACT_FEATURE}:detail.section.sender`,
303
+ title: `${HELPDESK_FEATURE}:detail.section.sender`,
304
304
  fields: [
305
305
  "name",
306
306
  { field: "email", format: "email" },
@@ -317,13 +317,13 @@ function createRequestDetailScreen(opts, settings) {
317
317
  ],
318
318
  },
319
319
  {
320
- title: `${CONTACT_FEATURE}:detail.section.origin`,
320
+ title: `${HELPDESK_FEATURE}:detail.section.origin`,
321
321
  fields: [
322
322
  {
323
323
  field: "origin",
324
324
  renderer: { format: "enumOption", keyPrefix: `${REQUEST_FIELD}:origin:option:` },
325
325
  },
326
- { field: "page", visible: { field: "origin", eq: CONTACT_ORIGIN.Website } },
326
+ { field: "page", visible: { field: "origin", eq: HELPDESK_ORIGIN.Website } },
327
327
  "versionLabel",
328
328
  "browser",
329
329
  ],
@@ -331,13 +331,13 @@ function createRequestDetailScreen(opts, settings) {
331
331
  {
332
332
  kind: "relatedList",
333
333
  readOnly: true,
334
- title: `${CONTACT_FEATURE}:detail.section.delivery`,
335
- query: ContactQueries.requestDelivery,
334
+ title: `${HELPDESK_FEATURE}:detail.section.delivery`,
335
+ query: HelpdeskQueries.requestDelivery,
336
336
  toolbarActions: [
337
337
  {
338
338
  kind: "navigate",
339
339
  id: "delivery-log",
340
- label: `${CONTACT_FEATURE}:detail.delivery-log`,
340
+ label: `${HELPDESK_FEATURE}:detail.delivery-log`,
341
341
  screen: DELIVERY_LOG_SCREEN_ID,
342
342
  },
343
343
  ],
@@ -366,9 +366,9 @@ function createRequestDetailScreen(opts, settings) {
366
366
  },
367
367
  {
368
368
  kind: "extension",
369
- title: `${CONTACT_FEATURE}:detail.section.notes`,
369
+ title: `${HELPDESK_FEATURE}:detail.section.notes`,
370
370
  component: { react: { __component: "NotesSection" } },
371
- entityName: "contact-request",
371
+ entityName: "helpdesk-request",
372
372
  },
373
373
  ],
374
374
  },
@@ -382,8 +382,8 @@ function createForwardingScreen(telegram) {
382
382
  dormant: true,
383
383
  scope: "system",
384
384
  configKeys: {
385
- replyTo: ContactConfigKeys.replyTo,
386
- ...(telegram && { telegramChat: ContactConfigKeys.telegramChat }),
385
+ replyTo: HelpdeskConfigKeys.replyTo,
386
+ ...(telegram && { telegramChat: HelpdeskConfigKeys.telegramChat }),
387
387
  },
388
388
  ...(telegram && { secretKeys: { botToken: TELEGRAM_BOT_TOKEN_SECRET } }),
389
389
  fields: {
@@ -411,15 +411,15 @@ function createForwardingScreen(telegram) {
411
411
  variant: "settings-list",
412
412
  sections: [
413
413
  {
414
- title: `${CONTACT_FEATURE}:forwarding.email`,
415
- description: `${CONTACT_FEATURE}:forwarding.email.description`,
414
+ title: `${HELPDESK_FEATURE}:forwarding.email`,
415
+ description: `${HELPDESK_FEATURE}:forwarding.email.description`,
416
416
  fields: ["replyTo"],
417
417
  },
418
418
  ...(telegram
419
419
  ? [
420
420
  {
421
- title: `${CONTACT_FEATURE}:forwarding.telegram`,
422
- description: `${CONTACT_FEATURE}:forwarding.telegram.description`,
421
+ title: `${HELPDESK_FEATURE}:forwarding.telegram`,
422
+ description: `${HELPDESK_FEATURE}:forwarding.telegram.description`,
423
423
  fields: ["telegramChat", "botToken"],
424
424
  },
425
425
  ]
@@ -427,39 +427,39 @@ function createForwardingScreen(telegram) {
427
427
  ],
428
428
  },
429
429
  fieldLabels: {
430
- replyTo: `${CONTACT_FEATURE}:config.reply-to.label`,
431
- telegramChat: `${CONTACT_FEATURE}:config.telegram-chat.label`,
432
- botToken: `${CONTACT_FEATURE}:config.bot-token.label`,
430
+ replyTo: `${HELPDESK_FEATURE}:config.reply-to.label`,
431
+ telegramChat: `${HELPDESK_FEATURE}:config.telegram-chat.label`,
432
+ botToken: `${HELPDESK_FEATURE}:config.bot-token.label`,
433
433
  },
434
434
  fieldDescriptions: {
435
- replyTo: `${CONTACT_FEATURE}:config.reply-to.description`,
436
- telegramChat: `${CONTACT_FEATURE}:config.telegram-chat.description`,
437
- botToken: `${CONTACT_FEATURE}:config.bot-token.description`,
435
+ replyTo: `${HELPDESK_FEATURE}:config.reply-to.description`,
436
+ telegramChat: `${HELPDESK_FEATURE}:config.telegram-chat.description`,
437
+ botToken: `${HELPDESK_FEATURE}:config.bot-token.description`,
438
438
  },
439
- submitLabel: `${CONTACT_FEATURE}:forwarding.submit`,
439
+ submitLabel: `${HELPDESK_FEATURE}:forwarding.submit`,
440
440
  ...(telegram && {
441
441
  actions: [
442
442
  {
443
443
  id: "send-test",
444
- handler: ContactHandlers.sendTest,
445
- label: `${CONTACT_FEATURE}:config.send-test.label`,
446
- description: `${CONTACT_FEATURE}:config.send-test.description`,
447
- buttonLabel: `${CONTACT_FEATURE}:config.send-test.button`,
444
+ handler: HelpdeskHandlers.sendTest,
445
+ label: `${HELPDESK_FEATURE}:config.send-test.label`,
446
+ description: `${HELPDESK_FEATURE}:config.send-test.description`,
447
+ buttonLabel: `${HELPDESK_FEATURE}:config.send-test.button`,
448
448
  afterField: "botToken",
449
- successMessage: `${CONTACT_FEATURE}:config.send-test.success`,
449
+ successMessage: `${HELPDESK_FEATURE}:config.send-test.success`,
450
450
  },
451
451
  ],
452
452
  }),
453
453
  access: { roles: access.systemAdmin },
454
454
  };
455
455
  }
456
- export function createContactScreens(opts, settings) {
456
+ export function createHelpdeskScreens(opts, settings) {
457
457
  return [
458
458
  createReportScreen(opts, settings),
459
459
  requestListScreen,
460
460
  createRequestDetailScreen(opts, settings),
461
- createReplyScreen("reply", `${CONTACT_FEATURE}:reply.summary.in-app`),
462
- createReplyScreen("reply-mail", `${CONTACT_FEATURE}:reply.summary.mail`),
461
+ createReplyScreen("reply", `${HELPDESK_FEATURE}:reply.summary.in-app`),
462
+ createReplyScreen("reply-mail", `${HELPDESK_FEATURE}:reply.summary.mail`),
463
463
  createForwardingScreen(opts.telegram === true),
464
464
  ];
465
465
  }
@@ -1,13 +1,13 @@
1
- import { CONTACT_SUBJECT_MAX_CHARS } from "./web/constants.js";
1
+ import { HELPDESK_SUBJECT_MAX_CHARS } from "./web/constants.js";
2
2
  // The website form has no subject field; the first non-empty line of the message stands in for it.
3
3
  export function deriveSubjectFromMessage(message) {
4
4
  const firstLine = message.split(/[\r\n]/).find((line) => line.trim() !== "") ?? "";
5
5
  const trimmed = firstLine.trim();
6
6
  const chars = [...trimmed];
7
- if (chars.length <= CONTACT_SUBJECT_MAX_CHARS)
7
+ if (chars.length <= HELPDESK_SUBJECT_MAX_CHARS)
8
8
  return trimmed;
9
9
  return `${chars
10
- .slice(0, CONTACT_SUBJECT_MAX_CHARS - 1)
10
+ .slice(0, HELPDESK_SUBJECT_MAX_CHARS - 1)
11
11
  .join("")
12
12
  .trimEnd()}…`;
13
13
  }
@@ -0,0 +1,3 @@
1
+ import type { UserDataDeleteHook, UserDataExportHook } from "@cosmicdrift/kumiko-framework/engine";
2
+ export declare const helpdeskExportHook: UserDataExportHook;
3
+ export declare const helpdeskDeleteHook: UserDataDeleteHook;
@@ -7,9 +7,9 @@ import { fileRefEntity, fileRefsTable } from "@cosmicdrift/kumiko-framework/file
7
7
  import { collectErasureFailure, decryptStoredPii, throwIfErasureFailed } from "../shared/index.js";
8
8
  import { userTable } from "../user/index.js";
9
9
  import { normalizeEmail, platformActor, replyExecutor, requestExecutor } from "./lib.js";
10
- import { CONTACT_REPLY_ENTITY, CONTACT_REQUEST_ENTITY, CONTACT_UPLOAD_FIELD, } from "./web/constants.js";
11
- const PII_DECRYPT_REASON = "contact:user-data";
12
- const ERASE_REASON = "contact:user-data-forget";
10
+ import { HELPDESK_REPLY_ENTITY, HELPDESK_REQUEST_ENTITY, HELPDESK_UPLOAD_FIELD, } from "./web/constants.js";
11
+ const PII_DECRYPT_REASON = "helpdesk:user-data";
12
+ const ERASE_REASON = "helpdesk:user-data-forget";
13
13
  const LOOKUP_LIMIT = 200;
14
14
  // Anonymous requests are matched by email, so the user must have proven they own it: otherwise
15
15
  // registering with someone else's address would expose or erase that person's requests.
@@ -43,7 +43,7 @@ async function findAttachments(ctx, entity, id) {
43
43
  tenantId: SYSTEM_TENANT_ID,
44
44
  entityType: entity,
45
45
  entityId: id,
46
- fieldName: CONTACT_UPLOAD_FIELD,
46
+ fieldName: HELPDESK_UPLOAD_FIELD,
47
47
  });
48
48
  }
49
49
  // Bytes first, then the fileRef row: a crash in between leaves a row whose delete converges on the
@@ -56,14 +56,14 @@ async function purgeAttachments(ctx, entity, id) {
56
56
  const provider = await ctx.buildStorageProvider?.(SYSTEM_TENANT_ID);
57
57
  if (!provider) {
58
58
  throw new InternalError({
59
- message: `[contact:user-data] no file storage resolvable, attachments of ${entity} ${id} cannot be erased`,
59
+ message: `[helpdesk:user-data] no file storage resolvable, attachments of ${entity} ${id} cannot be erased`,
60
60
  });
61
61
  }
62
62
  for (const attachment of attachments) {
63
- const failed = await deleteStoredFileAndDerivatives(attachment.storageKey, provider, "contact:user-data");
63
+ const failed = await deleteStoredFileAndDerivatives(attachment.storageKey, provider, "helpdesk:user-data");
64
64
  if (failed.length > 0) {
65
65
  throw new InternalError({
66
- message: `[contact:user-data] ${failed.length} attachment byte delete(s) failed for ${entity} ${id}`,
66
+ message: `[helpdesk:user-data] ${failed.length} attachment byte delete(s) failed for ${entity} ${id}`,
67
67
  });
68
68
  }
69
69
  }
@@ -77,7 +77,7 @@ async function findReplies(ctx, requestId) {
77
77
  const found = await replyExecutor.list({ filter: { field: "requestId", op: "eq", value: requestId }, limit: LOOKUP_LIMIT }, platformActor(), ctx.db);
78
78
  return found.rows;
79
79
  }
80
- export const contactExportHook = async (ctx) => {
80
+ export const helpdeskExportHook = async (ctx) => {
81
81
  const requests = await findRequests(ctx);
82
82
  if (requests.length === 0)
83
83
  return null;
@@ -95,7 +95,7 @@ export const contactExportHook = async (ctx) => {
95
95
  phone: request.phone,
96
96
  page: request.page,
97
97
  submittedAt: String(request.submittedAt),
98
- attachments: (await findAttachments(ctx, CONTACT_REQUEST_ENTITY, request.id)).map((file) => file.fileName),
98
+ attachments: (await findAttachments(ctx, HELPDESK_REQUEST_ENTITY, request.id)).map((file) => file.fileName),
99
99
  replies: replies.map((reply) => ({
100
100
  message: reply.message,
101
101
  authorName: reply.authorName,
@@ -103,12 +103,12 @@ export const contactExportHook = async (ctx) => {
103
103
  })),
104
104
  });
105
105
  }
106
- return { entity: CONTACT_REQUEST_ENTITY, rows };
106
+ return { entity: HELPDESK_REQUEST_ENTITY, rows };
107
107
  };
108
108
  // Requests and replies carry no statutory retention duty, so both strategies erase: rows are
109
109
  // purged through the executor (replays on rebuild) and the record subject keys are shredded so
110
110
  // the event log's ciphertext becomes unreadable. Replies go with their request.
111
- export const contactDeleteHook = async (ctx) => {
111
+ export const helpdeskDeleteHook = async (ctx) => {
112
112
  const kms = configuredPiiSubjectKms();
113
113
  const failures = [];
114
114
  const erase = async (entity, id, forgotten) => {
@@ -119,11 +119,11 @@ export const contactDeleteHook = async (ctx) => {
119
119
  };
120
120
  for (const request of await findRequests(ctx)) {
121
121
  for (const reply of await findReplies(ctx, request.id)) {
122
- await purgeAttachments(ctx, CONTACT_REPLY_ENTITY, reply.id);
123
- await erase(CONTACT_REPLY_ENTITY, reply.id, await replyExecutor.forget({ id: reply.id }, platformActor(), ctx.db));
122
+ await purgeAttachments(ctx, HELPDESK_REPLY_ENTITY, reply.id);
123
+ await erase(HELPDESK_REPLY_ENTITY, reply.id, await replyExecutor.forget({ id: reply.id }, platformActor(), ctx.db));
124
124
  }
125
- await purgeAttachments(ctx, CONTACT_REQUEST_ENTITY, request.id);
126
- await erase(CONTACT_REQUEST_ENTITY, request.id, await requestExecutor.forget({ id: request.id }, platformActor(), ctx.db));
125
+ await purgeAttachments(ctx, HELPDESK_REQUEST_ENTITY, request.id);
126
+ await erase(HELPDESK_REQUEST_ENTITY, request.id, await requestExecutor.forget({ id: request.id }, platformActor(), ctx.db));
127
127
  }
128
128
  throwIfErasureFailed(failures);
129
129
  };