@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.
- package/dist/admin-shell/feature.d.ts +1 -1
- package/dist/agent-tools/api-docs/anchors.js +1 -1
- package/dist/auth-email-password/boot-rules.d.ts +7 -0
- package/dist/auth-email-password/boot-rules.js +7 -0
- package/dist/auth-email-password/feature.js +6 -13
- package/dist/auth-email-password/validate-options.d.ts +5 -0
- package/dist/auth-email-password/validate-options.js +15 -0
- package/dist/billing-foundation/boot-rules.d.ts +22 -0
- package/dist/billing-foundation/boot-rules.js +22 -0
- package/dist/billing-foundation/validate-options.js +56 -18
- package/dist/cap-overview/boot-rules.d.ts +12 -0
- package/dist/cap-overview/boot-rules.js +12 -0
- package/dist/cap-overview/feature.js +8 -3
- package/dist/documents/boot-rules.d.ts +12 -0
- package/dist/documents/boot-rules.js +12 -0
- package/dist/documents/feature.js +8 -3
- package/dist/file-derivatives/boot-rules.d.ts +7 -0
- package/dist/file-derivatives/boot-rules.js +7 -0
- package/dist/file-derivatives/feature.js +5 -2
- package/dist/folders/boot-rules.d.ts +7 -0
- package/dist/folders/boot-rules.js +7 -0
- package/dist/folders/feature.js +8 -5
- package/dist/helpdesk/boot-rules.d.ts +7 -0
- package/dist/helpdesk/boot-rules.js +7 -0
- package/dist/{contact → helpdesk}/challenge.js +2 -2
- package/dist/helpdesk/client/helpdesk-client-source.d.ts +1 -0
- package/dist/{contact/client/contact-client-source.js → helpdesk/client/helpdesk-client-source.js} +4 -4
- package/dist/helpdesk/client/helpdesk-website-client.d.ts +26 -0
- package/dist/helpdesk/client/index.d.ts +2 -0
- package/dist/helpdesk/client/index.js +1 -0
- package/dist/{contact → helpdesk}/entity.d.ts +6 -6
- package/dist/{contact → helpdesk}/entity.js +31 -27
- package/dist/helpdesk/feature.d.ts +3 -0
- package/dist/{contact → helpdesk}/feature.js +43 -39
- package/dist/{contact → helpdesk}/handlers/attempts.d.ts +2 -2
- package/dist/helpdesk/handlers/challenge.query.d.ts +9 -0
- package/dist/{contact → helpdesk}/handlers/challenge.query.js +5 -5
- package/dist/helpdesk/handlers/forward-request.write.d.ts +9 -0
- package/dist/{contact → helpdesk}/handlers/forward-request.write.js +17 -15
- package/dist/{contact → helpdesk}/handlers/mark-done.write.d.ts +2 -2
- package/dist/{contact → helpdesk}/handlers/mark-done.write.js +8 -8
- package/dist/{contact → helpdesk}/handlers/notify-reporter-in-app.write.d.ts +2 -2
- package/dist/{contact → helpdesk}/handlers/notify-reporter-in-app.write.js +11 -11
- package/dist/{contact → helpdesk}/handlers/open-count.js +2 -2
- package/dist/{contact → helpdesk}/handlers/open-count.query.js +4 -4
- package/dist/{contact → helpdesk}/handlers/replies.query.js +6 -6
- package/dist/{contact → helpdesk}/handlers/reply.write.d.ts +4 -4
- package/dist/{contact → helpdesk}/handlers/reply.write.js +16 -16
- package/dist/helpdesk/handlers/report.write.d.ts +16 -0
- package/dist/{contact → helpdesk}/handlers/report.write.js +17 -17
- package/dist/helpdesk/handlers/request-delivery.query.d.ts +16 -0
- package/dist/{contact → helpdesk}/handlers/request-delivery.query.js +24 -24
- package/dist/{contact → helpdesk}/handlers/request-detail.query.d.ts +3 -3
- package/dist/{contact → helpdesk}/handlers/request-detail.query.js +10 -10
- package/dist/{contact → helpdesk}/handlers/request-list.query.js +2 -2
- package/dist/helpdesk/handlers/send-reply-mail.write.d.ts +8 -0
- package/dist/{contact → helpdesk}/handlers/send-reply-mail.write.js +15 -15
- package/dist/helpdesk/handlers/send-test.write.d.ts +5 -0
- package/dist/{contact → helpdesk}/handlers/send-test.write.js +10 -10
- package/dist/{contact → helpdesk}/handlers/submit.write.d.ts +4 -4
- package/dist/{contact → helpdesk}/handlers/submit.write.js +17 -17
- package/dist/{contact → helpdesk}/handlers/take-over-uploads.js +5 -5
- package/dist/{contact → helpdesk}/i18n.d.ts +1 -1
- package/dist/{contact → helpdesk}/i18n.js +78 -75
- package/dist/helpdesk/index.d.ts +5 -0
- package/dist/helpdesk/index.js +4 -0
- package/dist/{contact → helpdesk}/lib.d.ts +5 -5
- package/dist/{contact → helpdesk}/lib.js +16 -16
- package/dist/{contact → helpdesk}/mail.d.ts +20 -20
- package/dist/{contact → helpdesk}/mail.js +47 -47
- package/dist/{contact → helpdesk}/options.d.ts +6 -6
- package/dist/helpdesk/options.js +36 -0
- package/dist/helpdesk/panels.d.ts +2 -0
- package/dist/helpdesk/panels.js +21 -0
- package/dist/{contact → helpdesk}/payloads.d.ts +11 -11
- package/dist/{contact → helpdesk}/payloads.js +28 -28
- package/dist/helpdesk/screens.d.ts +5 -0
- package/dist/{contact → helpdesk}/screens.js +87 -87
- package/dist/{contact → helpdesk}/subject.js +3 -3
- package/dist/helpdesk/user-data-hooks.d.ts +3 -0
- package/dist/{contact → helpdesk}/user-data-hooks.js +15 -15
- package/dist/helpdesk/web/constants.d.ts +127 -0
- package/dist/helpdesk/web/constants.js +126 -0
- package/dist/helpdesk/web/index.d.ts +1 -0
- package/dist/helpdesk/web/index.js +1 -0
- package/dist/host-routing/boot-rules.d.ts +22 -0
- package/dist/host-routing/boot-rules.js +22 -0
- package/dist/host-routing/validate-options.js +35 -11
- package/dist/jobs/boot-rules.d.ts +7 -0
- package/dist/jobs/boot-rules.js +7 -0
- package/dist/jobs/feature.js +5 -2
- package/dist/legal-pages/boot-rules.d.ts +17 -0
- package/dist/legal-pages/boot-rules.js +17 -0
- package/dist/legal-pages/feature.js +5 -2
- package/dist/legal-pages/lib/validate-routes.js +11 -3
- package/dist/metrics/boot-rules.d.ts +12 -0
- package/dist/metrics/boot-rules.js +12 -0
- package/dist/metrics/validate.js +8 -2
- package/dist/notes-history/boot-rules.d.ts +7 -0
- package/dist/notes-history/boot-rules.js +7 -0
- package/dist/notes-history/feature.js +7 -4
- package/dist/personal-access-tokens/boot-rules.d.ts +7 -0
- package/dist/personal-access-tokens/boot-rules.js +7 -0
- package/dist/personal-access-tokens/scope-events-check.js +7 -4
- package/dist/presence/boot-rules.d.ts +7 -0
- package/dist/presence/boot-rules.js +7 -0
- package/dist/presence/options.js +5 -1
- package/dist/readiness/boot-rules.d.ts +12 -0
- package/dist/readiness/boot-rules.js +12 -0
- package/dist/readiness/probe-boot-check.js +8 -3
- package/dist/shared/assert-no-where-rule-in-ownership-write.d.ts +1 -1
- package/dist/shared/assert-no-where-rule-in-ownership-write.js +11 -7
- package/dist/shared/boot-rules.d.ts +7 -0
- package/dist/shared/boot-rules.js +7 -0
- package/dist/subscription-mollie/boot-rules.d.ts +17 -0
- package/dist/subscription-mollie/boot-rules.js +17 -0
- package/dist/subscription-mollie/feature.js +13 -6
- package/dist/tags/boot-rules.d.ts +7 -0
- package/dist/tags/boot-rules.js +7 -0
- package/dist/tags/feature.js +8 -5
- package/dist/template-resolver/boot-rules.d.ts +17 -0
- package/dist/template-resolver/boot-rules.js +17 -0
- package/dist/template-resolver/feature.js +14 -5
- package/dist/tenant/boot-rules.d.ts +7 -0
- package/dist/tenant/boot-rules.js +7 -0
- package/dist/tenant/feature.js +5 -2
- package/kumiko-es-tables.json +4 -4
- package/package.json +29 -29
- package/src/{contact → helpdesk}/changes.json +6 -0
- package/dist/contact/client/contact-client-source.d.ts +0 -1
- package/dist/contact/client/contact-website-client.d.ts +0 -26
- package/dist/contact/client/index.d.ts +0 -2
- package/dist/contact/client/index.js +0 -1
- package/dist/contact/feature.d.ts +0 -3
- package/dist/contact/handlers/challenge.query.d.ts +0 -9
- package/dist/contact/handlers/forward-request.write.d.ts +0 -9
- package/dist/contact/handlers/report.write.d.ts +0 -16
- package/dist/contact/handlers/request-delivery.query.d.ts +0 -16
- package/dist/contact/handlers/send-reply-mail.write.d.ts +0 -8
- package/dist/contact/handlers/send-test.write.d.ts +0 -5
- package/dist/contact/index.d.ts +0 -5
- package/dist/contact/index.js +0 -4
- package/dist/contact/options.js +0 -32
- package/dist/contact/panels.d.ts +0 -2
- package/dist/contact/panels.js +0 -21
- package/dist/contact/screens.d.ts +0 -5
- package/dist/contact/user-data-hooks.d.ts +0 -3
- package/dist/contact/web/constants.d.ts +0 -127
- package/dist/contact/web/constants.js +0 -126
- package/dist/contact/web/index.d.ts +0 -1
- package/dist/contact/web/index.js +0 -1
- /package/dist/{contact → helpdesk}/challenge.d.ts +0 -0
- /package/dist/{contact/client/contact-website-client.js → helpdesk/client/helpdesk-website-client.js} +0 -0
- /package/dist/{contact → helpdesk}/handlers/access.d.ts +0 -0
- /package/dist/{contact → helpdesk}/handlers/access.js +0 -0
- /package/dist/{contact → helpdesk}/handlers/attempts.js +0 -0
- /package/dist/{contact → helpdesk}/handlers/open-count.d.ts +0 -0
- /package/dist/{contact → helpdesk}/handlers/open-count.query.d.ts +0 -0
- /package/dist/{contact → helpdesk}/handlers/replies.query.d.ts +0 -0
- /package/dist/{contact → helpdesk}/handlers/request-list.query.d.ts +0 -0
- /package/dist/{contact → helpdesk}/handlers/take-over-uploads.d.ts +0 -0
- /package/dist/{contact → helpdesk}/pow.d.ts +0 -0
- /package/dist/{contact → helpdesk}/pow.js +0 -0
- /package/dist/{contact → helpdesk}/subject.d.ts +0 -0
- /package/dist/{contact → helpdesk}/user-agent.d.ts +0 -0
- /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 {
|
|
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 = `${
|
|
7
|
-
const 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 = `${
|
|
10
|
-
export const REPLY_FIELD_LABEL = `${
|
|
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:
|
|
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:
|
|
28
|
+
handler: HelpdeskHandlers.report,
|
|
29
29
|
summary: {
|
|
30
|
-
title: `${
|
|
31
|
-
subtitle: `${
|
|
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:
|
|
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
|
-
[
|
|
41
|
+
[HELPDESK_UPLOAD_FIELD]: attachmentsField(),
|
|
42
42
|
},
|
|
43
43
|
layout: {
|
|
44
44
|
sections: [
|
|
45
45
|
{
|
|
46
|
-
title: `${
|
|
47
|
-
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
|
-
|
|
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
|
-
[
|
|
63
|
+
[HELPDESK_UPLOAD_FIELD]: `${REPORT_FIELD_LABEL}.files`,
|
|
64
64
|
},
|
|
65
|
-
submitLabel: `${
|
|
65
|
+
submitLabel: `${HELPDESK_FEATURE}:report.submit`,
|
|
66
66
|
...(opts.reportCancelTarget !== undefined && { cancelTarget: opts.reportCancelTarget }),
|
|
67
|
-
successMessage: `${
|
|
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:
|
|
79
|
-
summary: { title: `${
|
|
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
|
-
[
|
|
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: `${
|
|
93
|
-
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
|
-
|
|
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
|
-
[
|
|
108
|
+
[HELPDESK_UPLOAD_FIELD]: `${REPLY_FIELD_LABEL}.files`,
|
|
109
109
|
markDone: `${REPLY_FIELD_LABEL}.mark-done`,
|
|
110
110
|
},
|
|
111
|
-
submitLabel: `${
|
|
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: "
|
|
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: `${
|
|
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: `${
|
|
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: [
|
|
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: `${
|
|
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: `${
|
|
162
|
-
handler:
|
|
161
|
+
label: `${HELPDESK_FEATURE}:action.mark-done`,
|
|
162
|
+
handler: HelpdeskHandlers.markDone,
|
|
163
163
|
payload: { pick: ["id"] },
|
|
164
|
-
visible: { field: "status", ne:
|
|
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
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
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:
|
|
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
|
-
[
|
|
219
|
-
[
|
|
220
|
-
[
|
|
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: `${
|
|
228
|
-
handler:
|
|
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:
|
|
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: `${
|
|
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:
|
|
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: `${
|
|
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:
|
|
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: `${
|
|
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: `${
|
|
273
|
+
{ title: `${HELPDESK_FEATURE}:detail.section.message`, fields: ["message"] },
|
|
274
274
|
{
|
|
275
275
|
kind: "relatedList",
|
|
276
276
|
readOnly: true,
|
|
277
|
-
title: `${
|
|
278
|
-
query:
|
|
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: `${
|
|
283
|
+
label: `${HELPDESK_FEATURE}:entity:helpdesk-reply:field:sentAt`,
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
field: "authorName",
|
|
287
|
-
label: `${
|
|
287
|
+
label: `${HELPDESK_FEATURE}:entity:helpdesk-reply:field:authorName`,
|
|
288
288
|
},
|
|
289
|
-
{ field: "message", label: `${
|
|
289
|
+
{ field: "message", label: `${HELPDESK_FEATURE}:entity:helpdesk-reply:field:message` },
|
|
290
290
|
],
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
|
-
title: `${
|
|
293
|
+
title: `${HELPDESK_FEATURE}:detail.section.files`,
|
|
294
294
|
fields: [
|
|
295
295
|
{
|
|
296
|
-
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: `${
|
|
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: `${
|
|
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:
|
|
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: `${
|
|
335
|
-
query:
|
|
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: `${
|
|
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: `${
|
|
369
|
+
title: `${HELPDESK_FEATURE}:detail.section.notes`,
|
|
370
370
|
component: { react: { __component: "NotesSection" } },
|
|
371
|
-
entityName: "
|
|
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:
|
|
386
|
-
...(telegram && { 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: `${
|
|
415
|
-
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: `${
|
|
422
|
-
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: `${
|
|
431
|
-
telegramChat: `${
|
|
432
|
-
botToken: `${
|
|
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: `${
|
|
436
|
-
telegramChat: `${
|
|
437
|
-
botToken: `${
|
|
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: `${
|
|
439
|
+
submitLabel: `${HELPDESK_FEATURE}:forwarding.submit`,
|
|
440
440
|
...(telegram && {
|
|
441
441
|
actions: [
|
|
442
442
|
{
|
|
443
443
|
id: "send-test",
|
|
444
|
-
handler:
|
|
445
|
-
label: `${
|
|
446
|
-
description: `${
|
|
447
|
-
buttonLabel: `${
|
|
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: `${
|
|
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
|
|
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", `${
|
|
462
|
-
createReplyScreen("reply-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 {
|
|
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 <=
|
|
7
|
+
if (chars.length <= HELPDESK_SUBJECT_MAX_CHARS)
|
|
8
8
|
return trimmed;
|
|
9
9
|
return `${chars
|
|
10
|
-
.slice(0,
|
|
10
|
+
.slice(0, HELPDESK_SUBJECT_MAX_CHARS - 1)
|
|
11
11
|
.join("")
|
|
12
12
|
.trimEnd()}…`;
|
|
13
13
|
}
|
|
@@ -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 {
|
|
11
|
-
const PII_DECRYPT_REASON = "
|
|
12
|
-
const ERASE_REASON = "
|
|
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:
|
|
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: `[
|
|
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, "
|
|
63
|
+
const failed = await deleteStoredFileAndDerivatives(attachment.storageKey, provider, "helpdesk:user-data");
|
|
64
64
|
if (failed.length > 0) {
|
|
65
65
|
throw new InternalError({
|
|
66
|
-
message: `[
|
|
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
|
|
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,
|
|
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:
|
|
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
|
|
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,
|
|
123
|
-
await erase(
|
|
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,
|
|
126
|
-
await erase(
|
|
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
|
};
|