@cosmicdrift/kumiko-samples 0.405.0 → 0.409.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +26 -4
- package/packages/bundled-features/src/account-security/feature.ts +9 -1
- package/packages/bundled-features/src/admin-shell/changes.json +6 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +4 -1
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +1 -0
- package/packages/bundled-features/src/agent-tools/changes.json +6 -0
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +1 -0
- package/packages/bundled-features/src/agent-tools/types.ts +4 -0
- package/packages/bundled-features/src/audit/event-classification.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +18 -66
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +30 -64
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +20 -66
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/web/read-path-param.ts +8 -0
- package/packages/bundled-features/src/auth-email-password/web/return-path.ts +3 -2
- package/packages/bundled-features/src/auth-email-password/web/token-confirm-screen.tsx +97 -0
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +20 -68
- package/packages/bundled-features/src/auth-foundation/boot-checks.ts +22 -15
- package/packages/bundled-features/src/auth-foundation/boot-rules.ts +33 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +12 -42
- package/packages/bundled-features/src/auth-mfa/feature-exports.ts +6 -45
- package/packages/bundled-features/src/auth-mfa/feature.ts +8 -19
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +19 -33
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -0
- package/packages/bundled-features/src/billing-foundation/web/plan-price.ts +20 -7
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +1 -0
- package/packages/bundled-features/src/channel-in-app/changes.json +7 -0
- package/packages/bundled-features/src/channel-in-app/feature.ts +2 -0
- package/packages/bundled-features/src/channel-in-app/handlers/read-state-by-keys.query.ts +35 -0
- package/packages/bundled-features/src/channel-in-app/in-app-channel.ts +1 -0
- package/packages/bundled-features/src/channel-in-app/tables.ts +5 -1
- package/packages/bundled-features/src/contact/challenge.ts +41 -0
- package/packages/bundled-features/src/contact/changes.json +27 -0
- package/packages/bundled-features/src/contact/client/contact-client-source.ts +203 -0
- package/packages/bundled-features/src/contact/entity.ts +168 -0
- package/packages/bundled-features/src/contact/feature.ts +171 -0
- package/packages/bundled-features/src/contact/handlers/access.ts +17 -0
- package/packages/bundled-features/src/contact/handlers/attempts.ts +76 -0
- package/packages/bundled-features/src/contact/handlers/challenge.query.ts +44 -0
- package/packages/bundled-features/src/contact/handlers/forward-request.write.ts +98 -0
- package/packages/bundled-features/src/contact/handlers/mark-done.write.ts +40 -0
- package/packages/bundled-features/src/contact/handlers/notify-reporter-in-app.write.ts +48 -0
- package/packages/bundled-features/src/contact/handlers/open-count.query.ts +15 -0
- package/packages/bundled-features/src/contact/handlers/open-count.ts +17 -0
- package/packages/bundled-features/src/contact/handlers/replies.query.ts +29 -0
- package/packages/bundled-features/src/contact/handlers/reply.write.ts +197 -0
- package/packages/bundled-features/src/contact/handlers/report.write.ts +126 -0
- package/packages/bundled-features/src/contact/handlers/request-delivery.query.ts +143 -0
- package/packages/bundled-features/src/contact/handlers/request-detail.query.ts +50 -0
- package/packages/bundled-features/src/contact/handlers/request-list.query.ts +14 -0
- package/packages/bundled-features/src/contact/handlers/send-reply-mail.write.ts +124 -0
- package/packages/bundled-features/src/contact/handlers/send-test.write.ts +45 -0
- package/packages/bundled-features/src/contact/handlers/submit.write.ts +194 -0
- package/packages/bundled-features/src/contact/handlers/take-over-uploads.ts +47 -0
- package/packages/bundled-features/src/contact/i18n.ts +189 -0
- package/packages/bundled-features/src/contact/index.ts +29 -0
- package/packages/bundled-features/src/contact/lib.ts +176 -0
- package/packages/bundled-features/src/contact/mail.ts +401 -0
- package/packages/bundled-features/src/contact/options.ts +95 -0
- package/packages/bundled-features/src/contact/panels.ts +28 -0
- package/packages/bundled-features/src/contact/payloads.ts +106 -0
- package/packages/bundled-features/src/contact/pow.ts +22 -0
- package/packages/bundled-features/src/contact/screens.ts +506 -0
- package/packages/bundled-features/src/contact/subject.ts +13 -0
- package/packages/bundled-features/src/contact/user-agent.ts +39 -0
- package/packages/bundled-features/src/contact/user-data-hooks.ts +180 -0
- package/packages/bundled-features/src/contact/web/constants.ts +160 -0
- package/packages/bundled-features/src/contact/web/index.ts +29 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +5 -16
- package/packages/bundled-features/src/data-retention/changes.json +6 -0
- package/packages/bundled-features/src/data-retention/feature.ts +16 -2
- package/packages/bundled-features/src/data-retention/index.ts +5 -0
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +138 -41
- package/packages/bundled-features/src/data-retention/tenant-destruction-hold.ts +196 -0
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -0
- package/packages/bundled-features/src/delivery/changes.json +7 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +2 -0
- package/packages/bundled-features/src/delivery/delivery-service.ts +29 -5
- package/packages/bundled-features/src/delivery/events.ts +2 -0
- package/packages/bundled-features/src/delivery/feature.ts +3 -2
- package/packages/bundled-features/src/delivery/handlers/attempts-by-keys.query.ts +55 -0
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +1 -1
- package/packages/bundled-features/src/delivery/jobs.ts +5 -0
- package/packages/bundled-features/src/delivery/tables.ts +13 -2
- package/packages/bundled-features/src/delivery/types.ts +3 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +2 -0
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +3 -2
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/public-names.ts +1 -0
- package/packages/bundled-features/src/document-ingest-foundation/boot-checks.ts +14 -9
- package/packages/bundled-features/src/document-ingest-foundation/boot-rules.ts +22 -0
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +17 -0
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +39 -1
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +10 -0
- package/packages/bundled-features/src/document-ingest-foundation/report-ingest-progress.ts +43 -0
- package/packages/bundled-features/src/document-ingest-foundation/tables.ts +43 -0
- package/packages/bundled-features/src/files-tenant-data/changes.json +6 -0
- package/packages/bundled-features/src/files-tenant-data/hooks.ts +4 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +8 -9
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -1
- package/packages/bundled-features/src/form-draft-user-data/index.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +13 -0
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +6 -6
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/attach-message-content.write.ts +7 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-messages.query.ts +6 -2
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/message-content.query.ts +3 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/message-content.ts +19 -0
- package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/sanitize-inbound-html.ts +150 -0
- package/packages/bundled-features/src/inbound-mail-foundation/types.ts +1 -0
- package/packages/bundled-features/src/jobs/job-run-logger.ts +24 -25
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +46 -31
- package/packages/bundled-features/src/ledger/recurring.ts +1 -0
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +3 -1
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +9 -17
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +2 -7
- package/packages/bundled-features/src/secrets/changes.json +6 -0
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +8 -4
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +6 -3
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +9 -4
- package/packages/bundled-features/src/secrets/secret-scope.ts +33 -0
- package/packages/bundled-features/src/sessions/changes.json +6 -0
- package/packages/bundled-features/src/sessions/feature.ts +21 -18
- package/packages/bundled-features/src/sessions/handlers/last-activity-probe.query.ts +53 -0
- package/packages/bundled-features/src/sessions/handlers/last-activity-probe.route.ts +39 -0
- package/packages/bundled-features/src/sessions/screens.ts +1 -0
- package/packages/bundled-features/src/sessions/session-callbacks.ts +13 -12
- package/packages/bundled-features/src/sessions/web/i18n.ts +4 -1
- package/packages/bundled-features/src/shared/assert-billing-live.ts +14 -0
- package/packages/bundled-features/src/shared/collect-extension-options.ts +12 -0
- package/packages/bundled-features/src/shared/index.ts +16 -0
- package/packages/bundled-features/src/shared/late-bound-slot.ts +19 -0
- package/packages/bundled-features/src/shared/mail-locale-templates.ts +7 -1
- package/packages/bundled-features/src/shared/price-env-shape.ts +44 -0
- package/packages/bundled-features/src/shared/purge-row-file-refs.ts +1 -1
- package/packages/bundled-features/src/shared/read-feature-export-fn.ts +16 -0
- package/packages/bundled-features/src/shared/signup-handover.ts +3 -4
- package/packages/bundled-features/src/shared/tenant-destruction-hold.ts +49 -0
- package/packages/bundled-features/src/shared/unprocessable.ts +19 -0
- package/packages/bundled-features/src/shared/web/index.ts +3 -0
- package/packages/bundled-features/src/subscription-paddle/feature.ts +7 -15
- package/packages/bundled-features/src/subscription-paddle/runtime.ts +4 -7
- package/packages/bundled-features/src/subscription-stripe/feature.ts +7 -15
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +4 -7
- package/packages/bundled-features/src/tags/entity.ts +1 -0
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +14 -0
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +4 -5
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +1 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +3 -6
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +27 -15
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +11 -8
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +1 -0
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +1 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +3 -0
- package/packages/bundled-features/src/template-resolver/linked-resources.ts +11 -6
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +15 -12
- package/packages/bundled-features/src/template-resolver/web/document-images.ts +6 -6
- package/packages/bundled-features/src/template-resolver/web/document-insert-fields.tsx +41 -36
- package/packages/bundled-features/src/template-resolver/web/document-schema.ts +11 -12
- package/packages/bundled-features/src/template-resolver/web/tiptap-attribute-parse-rule.ts +19 -0
- package/packages/bundled-features/src/tenant/i18n.ts +3 -0
- package/packages/bundled-features/src/tenant/schema/tenant.ts +1 -0
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +1 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +1 -1
- package/packages/bundled-features/src/tenant-inactivity/changes.json +8 -0
- package/packages/bundled-features/src/tenant-inactivity/check-inactive-tenants.ts +260 -0
- package/packages/bundled-features/src/tenant-inactivity/constants.ts +12 -0
- package/packages/bundled-features/src/tenant-inactivity/email-templates.ts +24 -0
- package/packages/bundled-features/src/tenant-inactivity/feature.ts +66 -0
- package/packages/bundled-features/src/tenant-inactivity/handlers/inactivity-state.query.ts +49 -0
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +56 -0
- package/packages/bundled-features/src/tenant-inactivity/inactivity-plan.ts +187 -0
- package/packages/bundled-features/src/tenant-inactivity/index.ts +5 -0
- package/packages/bundled-features/src/tenant-inactivity/keep-token.ts +44 -0
- package/packages/bundled-features/src/tenant-inactivity/mail-notifications.ts +62 -0
- package/packages/bundled-features/src/tenant-inactivity/options.ts +38 -0
- package/packages/bundled-features/src/tenant-inactivity/remote-activity.ts +32 -0
- package/packages/bundled-features/src/tenant-inactivity/state-store.ts +71 -0
- package/packages/bundled-features/src/tenant-inactivity/state-table.ts +50 -0
- package/packages/bundled-features/src/tenant-lifecycle/boot-checks.ts +8 -6
- package/packages/bundled-features/src/tenant-lifecycle/boot-rules.ts +16 -0
- package/packages/bundled-features/src/tenant-lifecycle/changes.json +30 -0
- package/packages/bundled-features/src/tenant-lifecycle/constants.ts +6 -0
- package/packages/bundled-features/src/tenant-lifecycle/events.ts +2 -0
- package/packages/bundled-features/src/tenant-lifecycle/feature.ts +25 -2
- package/packages/bundled-features/src/tenant-lifecycle/handlers/request-destruction.write.ts +12 -87
- package/packages/bundled-features/src/tenant-lifecycle/index.ts +6 -0
- package/packages/bundled-features/src/tenant-lifecycle/request-tenant-destruction.ts +108 -0
- package/packages/bundled-features/src/tenant-lifecycle/retention-config-destroy-hooks.ts +62 -0
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +131 -11
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +39 -4
- package/packages/bundled-features/src/tenant-lifecycle/testing.ts +1 -1
- package/packages/bundled-features/src/tier-engine/caps-for-tier-from-map.ts +16 -0
- package/packages/bundled-features/src/tier-engine/changes.json +6 -0
- package/packages/bundled-features/src/tier-engine/compose-app.ts +21 -20
- package/packages/bundled-features/src/tier-engine/index.ts +1 -0
- package/packages/bundled-features/src/user-data-rights/feature.ts +2 -0
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +2 -0
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/zip-path.ts +1 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/config-value.userdata-hook.ts +8 -27
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +11 -8
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/forget-own-rows-delete-hook.ts +42 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +8 -27
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +2 -6
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/samples/apps/styleguide/src/features/widgets/i18n.ts +6 -0
- package/samples/apps/styleguide/src/features/widgets/web/InboxReaderExamples.tsx +158 -0
- package/samples/apps/styleguide/src/features/widgets/web/Widgets.tsx +2 -0
- package/samples/apps/styleguide/src/features/widgets/web/sample-pdf.ts +28 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +134 -2
- package/samples/apps/use-all-bundled/kumiko/migrations/0063_contact.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/package.json +1 -0
- package/samples/apps/use-all-bundled/playwright.config.ts +2 -0
- package/samples/apps/use-all-bundled/src/app/client.tsx +3 -0
- package/samples/apps/use-all-bundled/src/app/screens-feature.ts +46 -2
- package/samples/apps/use-all-bundled/src/run-config.ts +38 -4
- package/samples/recipes/contact/README.md +46 -0
- package/samples/recipes/contact/package.json +12 -0
- package/samples/recipes/contact/src/feature.ts +27 -0
- package/samples/recipes/delivery-notifications/src/feature.ts +3 -0
- package/samples/recipes/lane-routing/README.md +1 -0
- package/samples/recipes/lane-routing/src/feature.ts +8 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +9 -1
- package/samples/recipes/search/README.md +2 -0
- package/samples/recipes/search/src/feature.ts +27 -2
- package/samples/recipes/secrets-demo/README.md +1 -0
- package/samples/recipes/secrets-demo/src/feature.ts +56 -0
- package/samples/recipes/tenant-inactivity/README.md +21 -0
- package/samples/recipes/tenant-inactivity/package.json +12 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import {
|
|
3
|
+
InternalError,
|
|
4
|
+
UnprocessableError,
|
|
5
|
+
writeFailure,
|
|
6
|
+
} from "@cosmicdrift/kumiko-framework/errors";
|
|
7
|
+
import { adminAccess } from "../lib.ts";
|
|
8
|
+
import { contactTestVariables, resolveContactMailLocale } from "../mail.ts";
|
|
9
|
+
import type { ContactOptions } from "../options.ts";
|
|
10
|
+
import { ContactEmptySchema } from "../payloads.ts";
|
|
11
|
+
import { CONTACT_NOTIFICATION_TYPES, ContactConfigKeys, ContactErrors } from "../web/constants.ts";
|
|
12
|
+
|
|
13
|
+
export type ContactSendTestData = { readonly kind: "sent" };
|
|
14
|
+
|
|
15
|
+
export function createSendTestHandler(opts: ContactOptions) {
|
|
16
|
+
return defineWriteHandler<"send-test", typeof ContactEmptySchema, ContactSendTestData>({
|
|
17
|
+
name: "send-test",
|
|
18
|
+
schema: ContactEmptySchema,
|
|
19
|
+
access: adminAccess,
|
|
20
|
+
agent: { expose: false },
|
|
21
|
+
description:
|
|
22
|
+
"Sends a test message to the configured Telegram chat; fails with a typed error when no chat is configured or the provider does not accept the message, so a SystemAdmin can verify bot token and chat id.",
|
|
23
|
+
handler: async (event, ctx) => {
|
|
24
|
+
const chatId = await ctx.config?.(ContactConfigKeys.telegramChat);
|
|
25
|
+
if (typeof chatId !== "string" || chatId.trim() === "") {
|
|
26
|
+
return writeFailure(new UnprocessableError(ContactErrors.telegramChatMissing));
|
|
27
|
+
}
|
|
28
|
+
if (!ctx.notify) {
|
|
29
|
+
throw new InternalError({ message: "ctx.notify unavailable — mount the delivery feature" });
|
|
30
|
+
}
|
|
31
|
+
const locale = opts.adminLocale ?? "en";
|
|
32
|
+
const result = await ctx.notify(CONTACT_NOTIFICATION_TYPES.test, {
|
|
33
|
+
route: { telegram: chatId.trim() },
|
|
34
|
+
recipientId: event.user.id,
|
|
35
|
+
data: contactTestVariables({ appName: opts.appName, locale }),
|
|
36
|
+
immediate: true,
|
|
37
|
+
locale: resolveContactMailLocale(locale),
|
|
38
|
+
});
|
|
39
|
+
if (result.deliveries.some((d) => d.status === "failed")) {
|
|
40
|
+
return writeFailure(new UnprocessableError(ContactErrors.telegramTestFailed));
|
|
41
|
+
}
|
|
42
|
+
return { isSuccess: true, data: { kind: "sent" } };
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { requestContext } from "@cosmicdrift/kumiko-framework/api";
|
|
2
|
+
import {
|
|
3
|
+
defineWriteHandler,
|
|
4
|
+
type HandlerContext,
|
|
5
|
+
type WriteResult,
|
|
6
|
+
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
+
import {
|
|
8
|
+
InternalError,
|
|
9
|
+
isKumikoError,
|
|
10
|
+
UnprocessableError,
|
|
11
|
+
type WriteFailure,
|
|
12
|
+
writeFailure,
|
|
13
|
+
} from "@cosmicdrift/kumiko-framework/errors";
|
|
14
|
+
import { normalizePayloadBucketValue } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
15
|
+
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
16
|
+
import type { PayloadRateLimitOption } from "@cosmicdrift/kumiko-types/handlers";
|
|
17
|
+
import { consumeChallenge } from "../challenge.ts";
|
|
18
|
+
import {
|
|
19
|
+
contactDb,
|
|
20
|
+
normalizeEmail,
|
|
21
|
+
phoneProblem,
|
|
22
|
+
platformActor,
|
|
23
|
+
requestExecutor,
|
|
24
|
+
sendBestEffort,
|
|
25
|
+
} from "../lib.ts";
|
|
26
|
+
import { contactAcknowledgementVariables, resolveContactMailLocale } from "../mail.ts";
|
|
27
|
+
import {
|
|
28
|
+
type ContactOptions,
|
|
29
|
+
type ContactSettings,
|
|
30
|
+
DEFAULT_SUBMIT_EMAIL_RATE_LIMITS,
|
|
31
|
+
DEFAULT_SUBMIT_RATE_LIMIT,
|
|
32
|
+
} from "../options.ts";
|
|
33
|
+
import { type ContactSubmitInput, ContactSubmitSchema } from "../payloads.ts";
|
|
34
|
+
import { verifyProofOfWork } from "../pow.ts";
|
|
35
|
+
import { deriveSubjectFromMessage } from "../subject.ts";
|
|
36
|
+
import { summarizeUserAgent } from "../user-agent.ts";
|
|
37
|
+
import {
|
|
38
|
+
CONTACT_NOTIFICATION_TYPES,
|
|
39
|
+
CONTACT_SOURCE,
|
|
40
|
+
CONTACT_STATUS,
|
|
41
|
+
ContactHandlers,
|
|
42
|
+
contactIdempotencyKeys,
|
|
43
|
+
} from "../web/constants.ts";
|
|
44
|
+
import { SUBMIT_ROLES } from "./access.ts";
|
|
45
|
+
|
|
46
|
+
export type ContactSubmitData = { readonly kind: "submitted" };
|
|
47
|
+
|
|
48
|
+
// Identical body for stored and silently dropped submits, so a bot learns nothing from it.
|
|
49
|
+
const SUBMITTED: WriteResult<ContactSubmitData> = {
|
|
50
|
+
isSuccess: true,
|
|
51
|
+
data: { kind: "submitted" },
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
type DropReason = "honeypot" | "challenge" | "too_fast" | "proof_of_work";
|
|
55
|
+
|
|
56
|
+
// An explicitly bound `undefined` is an error for the postgres driver; a missing key is not.
|
|
57
|
+
function presentOptionalFields(payload: ContactSubmitInput) {
|
|
58
|
+
return {
|
|
59
|
+
...(payload.phone !== undefined && payload.phone !== "" && { phone: payload.phone }),
|
|
60
|
+
...(payload.page !== undefined && payload.page !== "" && { page: payload.page }),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function findDropReason(
|
|
65
|
+
payload: ContactSubmitInput,
|
|
66
|
+
ctx: HandlerContext,
|
|
67
|
+
settings: ContactSettings,
|
|
68
|
+
): Promise<DropReason | null> {
|
|
69
|
+
if (payload.website !== undefined && payload.website.trim() !== "") return "honeypot";
|
|
70
|
+
const redis = ctx.services.redis;
|
|
71
|
+
if (!redis) {
|
|
72
|
+
throw new InternalError({
|
|
73
|
+
message: "contact:submit requires ctx.services.redis for the challenge store",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const issued = await consumeChallenge(redis, payload.challenge);
|
|
77
|
+
if (!issued) return "challenge";
|
|
78
|
+
if (ctx.tz.now().epochMilliseconds - issued.issuedAtMs < settings.minSubmitMs) return "too_fast";
|
|
79
|
+
if (
|
|
80
|
+
!verifyProofOfWork({ challenge: payload.challenge, nonce: payload.nonce, bits: issued.bits })
|
|
81
|
+
) {
|
|
82
|
+
return "proof_of_work";
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Counted here instead of as a payload bucket in front of the handler: a bot that posts a victim's
|
|
88
|
+
// address without solving the challenge would otherwise exhaust that address's quota and lock the
|
|
89
|
+
// real owner out. Only submits that passed the spam checks count. An empty list disables the limit.
|
|
90
|
+
async function enforceEmailLimits(
|
|
91
|
+
ctx: HandlerContext,
|
|
92
|
+
payload: ContactSubmitInput,
|
|
93
|
+
limits: readonly PayloadRateLimitOption[],
|
|
94
|
+
): Promise<WriteFailure | null> {
|
|
95
|
+
if (limits.length === 0) return null;
|
|
96
|
+
const { rateLimit } = ctx.services;
|
|
97
|
+
if (!rateLimit || !ctx.rateLimitDigest) {
|
|
98
|
+
throw new InternalError({
|
|
99
|
+
message: "contact:submit declares an email rate limit but no rate limiter or digest is wired",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const requests = limits.map(({ per, limit, windowSeconds, cost, normalize }) => ({
|
|
103
|
+
bucket: `contact-submit:${per.payloadField}:${ctx.rateLimitDigest?.(
|
|
104
|
+
normalizePayloadBucketValue(payload.email, normalize),
|
|
105
|
+
)}`,
|
|
106
|
+
config: { limit, windowSeconds, ...(cost !== undefined && { cost }) },
|
|
107
|
+
}));
|
|
108
|
+
try {
|
|
109
|
+
await rateLimit.enforceAll(requests);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
if (isKumikoError(error)) return writeFailure(error);
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function createSubmitHandler(opts: ContactOptions, settings: ContactSettings) {
|
|
118
|
+
const emailRateLimits = opts.emailRateLimits ?? DEFAULT_SUBMIT_EMAIL_RATE_LIMITS;
|
|
119
|
+
return defineWriteHandler<"submit", typeof ContactSubmitSchema, ContactSubmitData>({
|
|
120
|
+
name: "submit",
|
|
121
|
+
schema: ContactSubmitSchema,
|
|
122
|
+
access: { roles: SUBMIT_ROLES, personalData: "public-intake" },
|
|
123
|
+
rateLimit: opts.rateLimit ?? DEFAULT_SUBMIT_RATE_LIMIT,
|
|
124
|
+
agent: { expose: false },
|
|
125
|
+
description:
|
|
126
|
+
"Public contact form: stores a question, contact request or problem report from a website visitor after a single-use proof-of-work challenge, forwards it to the SystemAdmins (mail, optional Telegram) and mails the sender a copy. Spam (honeypot, unknown or reused challenge, too fast, wrong proof of work) gets the same success body but nothing is stored or sent.",
|
|
127
|
+
handler: async (event, ctx) => {
|
|
128
|
+
const payload = event.payload;
|
|
129
|
+
const dropReason = await findDropReason(payload, ctx, settings);
|
|
130
|
+
if (dropReason !== null) {
|
|
131
|
+
ctx.obs.log?.info("[contact:submit] dropped", { reason: dropReason });
|
|
132
|
+
return SUBMITTED;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Before the email limit, so a mistyped phone number does not use up the sender's quota.
|
|
136
|
+
const phoneIssue = phoneProblem(settings.phone, payload.phone);
|
|
137
|
+
if (phoneIssue !== null) return writeFailure(new UnprocessableError(phoneIssue));
|
|
138
|
+
|
|
139
|
+
const limited = await enforceEmailLimits(ctx, payload, emailRateLimits);
|
|
140
|
+
if (limited !== null) return limited;
|
|
141
|
+
|
|
142
|
+
const email = normalizeEmail(payload.email);
|
|
143
|
+
const browser = summarizeUserAgent(requestContext.get()?.userAgent, payload.locale);
|
|
144
|
+
const requestId = generateId();
|
|
145
|
+
const created = await requestExecutor.create(
|
|
146
|
+
{
|
|
147
|
+
id: requestId,
|
|
148
|
+
kind: payload.kind,
|
|
149
|
+
status: CONTACT_STATUS.Open,
|
|
150
|
+
source: CONTACT_SOURCE.Website,
|
|
151
|
+
subject: deriveSubjectFromMessage(payload.message),
|
|
152
|
+
message: payload.message,
|
|
153
|
+
name: payload.name,
|
|
154
|
+
email,
|
|
155
|
+
locale: payload.locale,
|
|
156
|
+
...presentOptionalFields(payload),
|
|
157
|
+
...(opts.appVersion !== undefined && { appVersion: opts.appVersion }),
|
|
158
|
+
...(browser !== null && { browser }),
|
|
159
|
+
submittedAt: ctx.tz.now(),
|
|
160
|
+
fileCount: 0,
|
|
161
|
+
replyCount: 0,
|
|
162
|
+
},
|
|
163
|
+
platformActor(),
|
|
164
|
+
contactDb(ctx),
|
|
165
|
+
);
|
|
166
|
+
if (!created.isSuccess) return created;
|
|
167
|
+
|
|
168
|
+
await sendBestEffort(ctx, "forward request", async () => {
|
|
169
|
+
const forwarded = await ctx.dispatch.writeAs(
|
|
170
|
+
platformActor(),
|
|
171
|
+
ContactHandlers.forwardRequest,
|
|
172
|
+
{ requestId },
|
|
173
|
+
);
|
|
174
|
+
if (!forwarded.isSuccess) throw new Error(forwarded.error.message);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
await sendBestEffort(ctx, "confirmation mail", (notify) =>
|
|
178
|
+
notify(CONTACT_NOTIFICATION_TYPES.acknowledgement, {
|
|
179
|
+
route: { email },
|
|
180
|
+
recipientId: requestId,
|
|
181
|
+
data: contactAcknowledgementVariables({
|
|
182
|
+
appName: opts.appName,
|
|
183
|
+
locale: payload.locale,
|
|
184
|
+
}),
|
|
185
|
+
idempotencyKey: contactIdempotencyKeys.confirmation(requestId),
|
|
186
|
+
priority: "normal",
|
|
187
|
+
locale: resolveContactMailLocale(payload.locale),
|
|
188
|
+
}),
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
return SUBMITTED;
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type HandlerContext,
|
|
3
|
+
type SessionUser,
|
|
4
|
+
SYSTEM_TENANT_ID,
|
|
5
|
+
} from "@cosmicdrift/kumiko-framework/engine";
|
|
6
|
+
import { copyPendingFileRefsToTenant } from "@cosmicdrift/kumiko-framework/files";
|
|
7
|
+
import type { WriteResult } from "@cosmicdrift/kumiko-types/handlers";
|
|
8
|
+
import { fileContextForTenant } from "../../file-foundation/index.ts";
|
|
9
|
+
import { contactDb, platformActor } from "../lib.ts";
|
|
10
|
+
import { CONTACT_UPLOAD_FIELD } from "../web/constants.ts";
|
|
11
|
+
|
|
12
|
+
// The form uploads into the submitter's tenant; the request or reply lives in the system tenant.
|
|
13
|
+
export async function takeOverUploads(
|
|
14
|
+
ctx: HandlerContext,
|
|
15
|
+
args: {
|
|
16
|
+
readonly user: SessionUser;
|
|
17
|
+
readonly screen: string;
|
|
18
|
+
readonly entityType: string;
|
|
19
|
+
readonly entityId: string;
|
|
20
|
+
readonly fileIds: readonly string[];
|
|
21
|
+
},
|
|
22
|
+
): Promise<WriteResult<readonly string[]>> {
|
|
23
|
+
if (args.fileIds.length === 0) return { isSuccess: true, data: [] };
|
|
24
|
+
const db = contactDb(ctx);
|
|
25
|
+
const submitterTenantId = args.user.tenantId;
|
|
26
|
+
return copyPendingFileRefsToTenant({
|
|
27
|
+
source: {
|
|
28
|
+
db,
|
|
29
|
+
user: args.user,
|
|
30
|
+
files: fileContextForTenant(ctx, submitterTenantId, submitterTenantId),
|
|
31
|
+
entityType: args.screen,
|
|
32
|
+
fieldName: CONTACT_UPLOAD_FIELD,
|
|
33
|
+
},
|
|
34
|
+
target: {
|
|
35
|
+
db,
|
|
36
|
+
user: platformActor(),
|
|
37
|
+
registry: ctx.registry,
|
|
38
|
+
files: fileContextForTenant(ctx, submitterTenantId, SYSTEM_TENANT_ID),
|
|
39
|
+
attachTo: {
|
|
40
|
+
entityType: args.entityType,
|
|
41
|
+
fieldName: CONTACT_UPLOAD_FIELD,
|
|
42
|
+
entityId: args.entityId,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
fileIds: args.fileIds,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
type LocalizedString = { readonly en: string; readonly de: string };
|
|
2
|
+
|
|
3
|
+
const DELIVERY_FIELD = "contact:entity:contact-delivery:field";
|
|
4
|
+
const REQUEST_FIELD = "contact:entity:contact-request:field";
|
|
5
|
+
const REPLY_ENTITY_FIELD = "contact:entity:contact-reply:field";
|
|
6
|
+
// Option labels of an actionForm select resolve against the renderer's pseudo-entity, not a real one.
|
|
7
|
+
const FORM_FIELD = "contact:entity:__action-form__:field";
|
|
8
|
+
|
|
9
|
+
export function createContactI18n(): Readonly<Record<string, LocalizedString>> {
|
|
10
|
+
return {
|
|
11
|
+
"contact:feature.label": { en: "Contact", de: "Kontakt" },
|
|
12
|
+
"contact:notify.new-request.label": { en: "New contact request", de: "Neue Meldung" },
|
|
13
|
+
"contact:notify.confirmation.label": {
|
|
14
|
+
en: "Contact confirmation",
|
|
15
|
+
de: "Bestätigung der Meldung",
|
|
16
|
+
},
|
|
17
|
+
"contact:notify.acknowledgement.label": {
|
|
18
|
+
en: "Contact acknowledgement",
|
|
19
|
+
de: "Eingangsbestätigung der Meldung",
|
|
20
|
+
},
|
|
21
|
+
"contact:notify.reply.label": {
|
|
22
|
+
en: "Reply to a contact request",
|
|
23
|
+
de: "Antwort auf eine Meldung",
|
|
24
|
+
},
|
|
25
|
+
"contact:notify.reply-in-app.label": {
|
|
26
|
+
en: "Reply note in the app",
|
|
27
|
+
de: "Hinweis auf eine Antwort in der App",
|
|
28
|
+
},
|
|
29
|
+
"contact:notify.test.label": { en: "Contact test message", de: "Testnachricht Kontakt" },
|
|
30
|
+
"contact:report.submit": { en: "Send report", de: "Meldung senden" },
|
|
31
|
+
"contact:reply.submit": { en: "Send reply", de: "Antwort senden" },
|
|
32
|
+
"contact:overview.open": { en: "Open requests", de: "Offene Meldungen" },
|
|
33
|
+
"contact:filter.open": { en: "Open", de: "Offen" },
|
|
34
|
+
"contact:config.reply-to.label": { en: "Reply-To address", de: "Antwortadresse" },
|
|
35
|
+
"contact:config.telegram-chat.label": { en: "Chat id or @channel", de: "Chat-ID oder @Kanal" },
|
|
36
|
+
"contact:entity:contact-request:field:kind": { en: "Kind", de: "Art" },
|
|
37
|
+
"contact:entity:contact-request:field:status": { en: "Status", de: "Status" },
|
|
38
|
+
"contact:entity:contact-request:field:source": { en: "Source", de: "Quelle" },
|
|
39
|
+
"contact:entity:contact-request:field:subject": { en: "Subject", de: "Betreff" },
|
|
40
|
+
"contact:entity:contact-request:field:message": { en: "Message", de: "Nachricht" },
|
|
41
|
+
"contact:entity:contact-request:field:name": { en: "Name", de: "Name" },
|
|
42
|
+
"contact:entity:contact-request:field:email": { en: "Email", de: "E-Mail" },
|
|
43
|
+
"contact:entity:contact-request:field:phone": { en: "Phone", de: "Telefon" },
|
|
44
|
+
"contact:entity:contact-request:field:submittedAt": { en: "Received", de: "Eingang" },
|
|
45
|
+
"contact:entity:contact-request:field:answeredAt": { en: "Answered", de: "Beantwortet" },
|
|
46
|
+
"contact:entity:contact-request:field:closedAt": { en: "Closed", de: "Abgeschlossen" },
|
|
47
|
+
"contact:entity:contact-request:field:replyCount": { en: "Replies", de: "Antworten" },
|
|
48
|
+
"contact:report.hint": { en: "Goes straight to our team", de: "Geht direkt an unser Team" },
|
|
49
|
+
"contact:config.send-test.description": {
|
|
50
|
+
en: "Now sends a test message to the chat.",
|
|
51
|
+
de: "Schickt jetzt eine Testnachricht an den Chat.",
|
|
52
|
+
},
|
|
53
|
+
"screen:report.title": { en: "Report a problem", de: "Problem melden" },
|
|
54
|
+
"screen:request-list.title": { en: "Requests", de: "Meldungen" },
|
|
55
|
+
"screen:request-detail.title": { en: "Request", de: "Meldung" },
|
|
56
|
+
"screen:reply.title": { en: "Reply", de: "Antworten" },
|
|
57
|
+
"screen:reply-mail.title": { en: "Reply", de: "Antworten" },
|
|
58
|
+
"screen:forwarding.title": { en: "Forwarding of requests", de: "Weiterleitung von Meldungen" },
|
|
59
|
+
"contact:report.summary": {
|
|
60
|
+
en: "The answer comes by email to your account address, usually the same working day.",
|
|
61
|
+
de: "Die Antwort kommt per Mail an die Adresse deines Kontos, meist am selben Werktag.",
|
|
62
|
+
},
|
|
63
|
+
"contact:report.section": { en: "Your report", de: "Deine Meldung" },
|
|
64
|
+
"contact:report.section.description": {
|
|
65
|
+
en: "We attach account, tenant, app version and browser automatically.",
|
|
66
|
+
de: "Konto, Mandant, App-Version und Browser hängen wir automatisch an.",
|
|
67
|
+
},
|
|
68
|
+
"contact:report.success": {
|
|
69
|
+
en: "Thanks, your report has arrived. The answer comes by email.",
|
|
70
|
+
de: "Danke, deine Meldung ist angekommen. Die Antwort kommt per Mail.",
|
|
71
|
+
},
|
|
72
|
+
"contact:report.field.kind": { en: "Kind", de: "Art" },
|
|
73
|
+
"contact:report.field.phone": { en: "Phone", de: "Telefon" },
|
|
74
|
+
"contact:report.field.subject": { en: "Subject", de: "Betreff" },
|
|
75
|
+
"contact:report.field.message": { en: "What happened?", de: "Was ist passiert?" },
|
|
76
|
+
"contact:report.field.files": { en: "Files", de: "Dateien" },
|
|
77
|
+
[`${FORM_FIELD}:name`]: { en: "Reporter", de: "Absender" },
|
|
78
|
+
[`${FORM_FIELD}:email`]: { en: "Email", de: "E-Mail" },
|
|
79
|
+
[`${FORM_FIELD}:replyTo`]: { en: "Replies go to", de: "Rückantworten an" },
|
|
80
|
+
[`${FORM_FIELD}:requestId`]: { en: "Request", de: "Meldung" },
|
|
81
|
+
[`${FORM_FIELD}:kind:option:question`]: { en: "Question", de: "Frage" },
|
|
82
|
+
[`${FORM_FIELD}:kind:option:bug`]: { en: "Bug", de: "Fehler" },
|
|
83
|
+
[`${FORM_FIELD}:kind:option:wish`]: { en: "Wish", de: "Wunsch" },
|
|
84
|
+
"contact:reply.title": { en: "To {name}", de: "An {name}" },
|
|
85
|
+
"contact:reply.summary.in-app": {
|
|
86
|
+
en: "By email to {email} and in the app. Replies go to {replyTo}.",
|
|
87
|
+
de: "Per E-Mail an {email} und in der App. Rückantworten gehen an {replyTo}.",
|
|
88
|
+
},
|
|
89
|
+
"contact:reply.summary.mail": {
|
|
90
|
+
en: "By email to {email}. Replies go to {replyTo}.",
|
|
91
|
+
de: "Per E-Mail an {email}. Rückantworten gehen an {replyTo}.",
|
|
92
|
+
},
|
|
93
|
+
"contact:reply.section": { en: "Reply", de: "Antwort" },
|
|
94
|
+
"contact:reply.section.description": {
|
|
95
|
+
en: "The request is quoted below in the mail.",
|
|
96
|
+
de: "Die Meldung wird unten in der Mail zitiert.",
|
|
97
|
+
},
|
|
98
|
+
"contact:reply.field.message": { en: "Message", de: "Nachricht" },
|
|
99
|
+
"contact:reply.field.files": { en: "Files", de: "Dateien" },
|
|
100
|
+
"contact:reply.field.mark-done": {
|
|
101
|
+
en: "Mark the request as done afterwards",
|
|
102
|
+
de: "Meldung danach als erledigt markieren",
|
|
103
|
+
},
|
|
104
|
+
"contact:filter.all": { en: "All", de: "Alle" },
|
|
105
|
+
"contact:list.from": { en: "From", de: "Von" },
|
|
106
|
+
"contact:action.open": { en: "Open", de: "Öffnen" },
|
|
107
|
+
"contact:action.mark-done": { en: "Mark as done", de: "Als erledigt markieren" },
|
|
108
|
+
"contact:action.reply": { en: "Reply", de: "Antworten" },
|
|
109
|
+
"contact:detail.attachments": { en: "Attachments", de: "Anhänge" },
|
|
110
|
+
"contact:detail.section.message": { en: "Request", de: "Anliegen" },
|
|
111
|
+
"contact:detail.section.replies": { en: "Replies", de: "Antworten" },
|
|
112
|
+
"contact:detail.section.files": { en: "Files", de: "Dateien" },
|
|
113
|
+
"contact:detail.section.sender": { en: "Sender", de: "Absender" },
|
|
114
|
+
"contact:detail.section.origin": { en: "Origin", de: "Herkunft" },
|
|
115
|
+
"contact:detail.section.delivery": { en: "Delivery", de: "Zustellung" },
|
|
116
|
+
"contact:detail.delivery-log": { en: "Delivery log", de: "Zustellprotokoll" },
|
|
117
|
+
"contact:detail.section.notes": { en: "Notes", de: "Notizen" },
|
|
118
|
+
[`${REQUEST_FIELD}:reporterTenantName`]: { en: "Tenant", de: "Mandant" },
|
|
119
|
+
[`${REQUEST_FIELD}:reporterTenantPlan`]: { en: "Tenant plan", de: "Plan des Mandanten" },
|
|
120
|
+
[`${REQUEST_FIELD}:fileCount`]: { en: "Files", de: "Dateien" },
|
|
121
|
+
[`${REQUEST_FIELD}:origin`]: { en: "Source", de: "Quelle" },
|
|
122
|
+
[`${REQUEST_FIELD}:page`]: { en: "Page", de: "Seite" },
|
|
123
|
+
[`${REQUEST_FIELD}:versionLabel`]: { en: "Version", de: "Version" },
|
|
124
|
+
[`${REQUEST_FIELD}:browser`]: { en: "Browser", de: "Browser" },
|
|
125
|
+
[`${REQUEST_FIELD}:kind:option:question`]: { en: "Question", de: "Frage" },
|
|
126
|
+
[`${REQUEST_FIELD}:kind:option:contact`]: { en: "Contact", de: "Kontakt" },
|
|
127
|
+
[`${REQUEST_FIELD}:kind:option:bug`]: { en: "Bug", de: "Fehler" },
|
|
128
|
+
[`${REQUEST_FIELD}:kind:option:wish`]: { en: "Wish", de: "Wunsch" },
|
|
129
|
+
[`${REQUEST_FIELD}:source:option:website`]: { en: "Website", de: "Website" },
|
|
130
|
+
[`${REQUEST_FIELD}:source:option:admin`]: { en: "Admin", de: "Admin" },
|
|
131
|
+
[`${REQUEST_FIELD}:status:option:open`]: { en: "Open", de: "Offen" },
|
|
132
|
+
[`${REQUEST_FIELD}:status:option:answered`]: { en: "Answered", de: "Beantwortet" },
|
|
133
|
+
[`${REQUEST_FIELD}:status:option:done`]: { en: "Done", de: "Erledigt" },
|
|
134
|
+
[`${REPLY_ENTITY_FIELD}:sentAt`]: { en: "Sent", de: "Gesendet" },
|
|
135
|
+
[`${REPLY_ENTITY_FIELD}:authorName`]: { en: "From", de: "Von" },
|
|
136
|
+
[`${REPLY_ENTITY_FIELD}:message`]: { en: "Message", de: "Nachricht" },
|
|
137
|
+
"contact:forwarding.email": { en: "Email", de: "E-Mail" },
|
|
138
|
+
"contact:forwarding.email.description": {
|
|
139
|
+
en: "Every new request goes by email to all SystemAdmins of this app. Turning it off per person goes through delivery; there is no screen for that yet.",
|
|
140
|
+
de: "Jede neue Meldung geht per Mail an alle SystemAdmins dieser App. Abschalten pro Person geht über die Zustellung, eine Maske dafür gibt es noch nicht.",
|
|
141
|
+
},
|
|
142
|
+
"contact:forwarding.telegram": { en: "Telegram", de: "Telegram" },
|
|
143
|
+
"contact:forwarding.telegram.description": {
|
|
144
|
+
en: "Optional. Requests also go as a message to a Telegram chat or channel.",
|
|
145
|
+
de: "Optional. Meldungen gehen zusätzlich als Nachricht in einen Telegram-Chat oder Kanal.",
|
|
146
|
+
},
|
|
147
|
+
"contact:forwarding.submit": { en: "Save", de: "Speichern" },
|
|
148
|
+
"contact:config.reply-to.description": {
|
|
149
|
+
en: "Used as Reply-To in every answer. Empty means the address of the SystemAdmin who replies.",
|
|
150
|
+
de: "Steht als Reply-To in jeder Antwort. Leer heißt: Adresse des SystemAdmins, der antwortet.",
|
|
151
|
+
},
|
|
152
|
+
"contact:config.telegram-chat.description": {
|
|
153
|
+
en: "Leave empty to not use Telegram.",
|
|
154
|
+
de: "Leer lassen, um Telegram nicht zu nutzen.",
|
|
155
|
+
},
|
|
156
|
+
"contact:config.bot-token.label": { en: "Bot token", de: "Bot-Token" },
|
|
157
|
+
"contact:config.bot-token.description": {
|
|
158
|
+
en: "From @BotFather. Stored encrypted and never shown again.",
|
|
159
|
+
de: "Von @BotFather. Wird verschlüsselt gespeichert und nie wieder angezeigt.",
|
|
160
|
+
},
|
|
161
|
+
"contact:config.send-test.label": { en: "Test message", de: "Testnachricht" },
|
|
162
|
+
"contact:config.send-test.button": { en: "Send test message", de: "Testnachricht senden" },
|
|
163
|
+
"contact:config.send-test.success": { en: "Test message sent.", de: "Testnachricht gesendet." },
|
|
164
|
+
[`${REQUEST_FIELD}:origin:option:website`]: { en: "Website", de: "Website" },
|
|
165
|
+
[`${REQUEST_FIELD}:origin:option:admin-report`]: {
|
|
166
|
+
en: "Admin, report a problem",
|
|
167
|
+
de: "Admin, Problem melden",
|
|
168
|
+
},
|
|
169
|
+
[`${DELIVERY_FIELD}:channel`]: { en: "Channel", de: "Kanal" },
|
|
170
|
+
[`${DELIVERY_FIELD}:recipient`]: { en: "Recipient", de: "Empfänger" },
|
|
171
|
+
[`${DELIVERY_FIELD}:at`]: { en: "Time", de: "Zeit" },
|
|
172
|
+
[`${DELIVERY_FIELD}:status`]: { en: "Status", de: "Status" },
|
|
173
|
+
[`${DELIVERY_FIELD}:channel:option:email`]: { en: "Email", de: "E-Mail" },
|
|
174
|
+
[`${DELIVERY_FIELD}:channel:option:telegram`]: { en: "Telegram", de: "Telegram" },
|
|
175
|
+
[`${DELIVERY_FIELD}:channel:option:reply-email`]: {
|
|
176
|
+
en: "Reply, email",
|
|
177
|
+
de: "Antwort, E-Mail",
|
|
178
|
+
},
|
|
179
|
+
[`${DELIVERY_FIELD}:channel:option:reply-in-app`]: {
|
|
180
|
+
en: "Reply, in the app",
|
|
181
|
+
de: "Antwort, in der App",
|
|
182
|
+
},
|
|
183
|
+
[`${DELIVERY_FIELD}:status:option:pending`]: { en: "Pending", de: "Ausstehend" },
|
|
184
|
+
[`${DELIVERY_FIELD}:status:option:delivered`]: { en: "Delivered", de: "Zugestellt" },
|
|
185
|
+
[`${DELIVERY_FIELD}:status:option:failed`]: { en: "Failed", de: "Fehlgeschlagen" },
|
|
186
|
+
[`${DELIVERY_FIELD}:status:option:skipped`]: { en: "Skipped", de: "Übersprungen" },
|
|
187
|
+
[`${DELIVERY_FIELD}:status:option:read`]: { en: "Read", de: "Gelesen" },
|
|
188
|
+
};
|
|
189
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export {
|
|
2
|
+
contactReplyEntity,
|
|
3
|
+
contactReplyTable,
|
|
4
|
+
contactRequestEntity,
|
|
5
|
+
contactRequestTable,
|
|
6
|
+
} from "./entity.ts";
|
|
7
|
+
export { createContactFeature } from "./feature.ts";
|
|
8
|
+
export type { ContactOptions } from "./options.ts";
|
|
9
|
+
export { contactOpenRequestsPanels } from "./panels.ts";
|
|
10
|
+
export {
|
|
11
|
+
CONTACT_ADMIN_KINDS,
|
|
12
|
+
CONTACT_CLIENT_PATH,
|
|
13
|
+
CONTACT_DELIVERY_CHANNEL,
|
|
14
|
+
CONTACT_DELIVERY_STATUS,
|
|
15
|
+
CONTACT_FEATURE,
|
|
16
|
+
CONTACT_FIELD_LIMITS,
|
|
17
|
+
CONTACT_KIND,
|
|
18
|
+
CONTACT_NOTIFICATION_TYPES,
|
|
19
|
+
CONTACT_ORIGIN,
|
|
20
|
+
CONTACT_REPLY_CHANNELS,
|
|
21
|
+
CONTACT_SOURCE,
|
|
22
|
+
CONTACT_STATUS,
|
|
23
|
+
CONTACT_WEBSITE_KINDS,
|
|
24
|
+
ContactConfigKeys,
|
|
25
|
+
ContactErrors,
|
|
26
|
+
ContactHandlers,
|
|
27
|
+
ContactQueries,
|
|
28
|
+
ContactScreens,
|
|
29
|
+
} from "./web/constants.ts";
|