@open-pencil/cloud 0.17.0-beta.2 → 0.17.0-beta.5
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/README.md +3 -2
- package/dist/bin/server.mjs +1 -1
- package/dist/bin/server.mjs.map +1 -1
- package/dist/bin/{ai-relay.mjs → services.mjs} +9 -9
- package/dist/bin/services.mjs.map +1 -0
- package/dist/client.d.ts +525 -66
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1257 -654
- package/dist/client.js.map +1 -1
- package/dist/contract.d.ts +2 -2
- package/dist/contract.js +2 -2
- package/dist/contract2.js +1028 -481
- package/dist/contract2.js.map +1 -1
- package/dist/email.d.ts +1780 -31
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +3556 -325
- package/dist/email.js.map +1 -1
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +48 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +929 -72
- package/dist/index.d.ts.map +1 -1
- package/dist/index2.d.ts +35 -0
- package/dist/index2.d.ts.map +1 -0
- package/dist/listen.mjs +802 -927
- package/dist/listen.mjs.map +1 -1
- package/dist/runtime-cloudflare.d.ts +89 -0
- package/dist/runtime-cloudflare.d.ts.map +1 -0
- package/dist/runtime-cloudflare.js +15667 -0
- package/dist/runtime-cloudflare.js.map +1 -0
- package/dist/runtime-node.d.mts +7166 -3101
- package/dist/runtime-node.d.mts.map +1 -1
- package/dist/runtime-node.mjs +6 -5
- package/dist/runtime-node.mjs.map +1 -1
- package/dist/server.d.ts +6525 -2205
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +12500 -7613
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +8625 -2878
- package/dist/server.mjs.map +1 -1
- package/dist/server2.mjs +101 -79
- package/dist/server2.mjs.map +1 -1
- package/package.json +27 -9
- package/src/admin/api/routes.ts +59 -0
- package/src/admin/audit/service.ts +27 -8
- package/src/admin/documents/service.ts +431 -0
- package/src/admin/errors.ts +9 -1
- package/src/admin/index.ts +6 -0
- package/src/admin/operations/service.ts +7 -0
- package/src/admin/reports/service.ts +153 -0
- package/src/admin/schema.ts +6 -0
- package/src/client/api.ts +28 -461
- package/src/client/auth/client.ts +22 -3
- package/src/client/auth/navigation.ts +6 -5
- package/src/client/billing.ts +80 -0
- package/src/client/community.ts +40 -0
- package/src/client/discovery.ts +35 -9
- package/src/client/documents.ts +160 -0
- package/src/client/index.ts +14 -7
- package/src/client/portal/account.ts +79 -2
- package/src/client/portal/administration.ts +56 -0
- package/src/client/portal/request.ts +2 -0
- package/src/client/response.ts +21 -0
- package/src/client/schema.ts +8 -0
- package/src/client/services.ts +118 -0
- package/src/client/sharing.ts +262 -0
- package/src/client/versions.ts +104 -0
- package/src/contract/account.ts +108 -2
- package/src/contract/admin/index.ts +67 -3
- package/src/contract/billing.ts +166 -0
- package/src/contract/collaboration.ts +11 -1
- package/src/contract/community.ts +60 -0
- package/src/contract/discovery.ts +83 -4
- package/src/contract/documents.ts +27 -0
- package/src/contract/entitlements.ts +12 -2
- package/src/contract/index.ts +114 -39
- package/src/contract/links.ts +57 -4
- package/src/contract/locale.ts +27 -0
- package/src/contract/portal.ts +12 -1
- package/src/contract/relay.ts +6 -0
- package/src/contract/reports.ts +42 -0
- package/src/contract/routes.ts +10 -0
- package/src/contract/services.ts +235 -0
- package/src/contract/sharing.ts +3 -9
- package/src/email/i18n.ts +174 -0
- package/src/email/index.ts +13 -2
- package/src/email/locales/ar.json +141 -0
- package/src/email/locales/de.json +141 -0
- package/src/email/locales/es.json +141 -0
- package/src/email/locales/fr.json +141 -0
- package/src/email/locales/it.json +141 -0
- package/src/email/locales/ja.json +141 -0
- package/src/email/locales/pl.json +141 -0
- package/src/email/locales/pt-br.json +141 -0
- package/src/email/locales/ru.json +141 -0
- package/src/email/locales/zh-cn.json +141 -0
- package/src/email/messages.ts +200 -0
- package/src/email/render.ts +138 -246
- package/src/email/samples.ts +115 -0
- package/src/email/schema.ts +79 -5
- package/src/email/templates/BrandEmail.vue +54 -0
- package/src/email/templates/DocumentBlocked.vue +45 -0
- package/src/email/templates/DocumentInvitation.vue +24 -0
- package/src/email/templates/DocumentReport.vue +32 -0
- package/src/email/templates/DocumentReportDecided.vue +36 -0
- package/src/email/templates/DocumentReportReceived.vue +18 -0
- package/src/email/templates/DocumentRestored.vue +24 -0
- package/src/email/templates/EmailChangeRequested.vue +24 -0
- package/src/email/templates/EmailRoot.vue +19 -0
- package/src/email/templates/EmailText.vue +9 -0
- package/src/email/templates/EmailVerification.vue +38 -0
- package/src/email/templates/EnrollmentNotification.vue +24 -0
- package/src/email/templates/EnrollmentUpdate.vue +52 -0
- package/src/email/templates/NewSignIn.vue +37 -0
- package/src/email/templates/PasswordChanged.vue +22 -0
- package/src/email/templates/PasswordReset.vue +23 -0
- package/src/email/templates/StorageLimitReached.vue +28 -0
- package/src/email/templates/TwoStepChanged.vue +32 -0
- package/src/email/templates/WaitlistConfirmation.vue +29 -0
- package/src/email/templates/WorkspaceInvitation.vue +28 -0
- package/src/email/templates/brand.ts +9 -61
- package/src/email/templates/localization.ts +17 -0
- package/src/errors/index.ts +6 -0
- package/src/errors/posthog.ts +80 -0
- package/src/global.d.ts +7 -0
- package/src/runtime/cloudflare/environment.ts +22 -11
- package/src/runtime/cloudflare/index.ts +1 -1
- package/src/runtime/cloudflare/logging.ts +15 -0
- package/src/runtime/cloudflare/maintenance.ts +31 -0
- package/src/runtime/cloudflare/relay/index.ts +69 -15
- package/src/runtime/cloudflare/tsconfig.json +2 -1
- package/src/runtime/cloudflare/worker.ts +46 -13
- package/src/runtime/node/application.ts +5 -3
- package/src/runtime/node/bootstrap.ts +15 -4
- package/src/runtime/node/cleanup.ts +20 -3
- package/src/runtime/node/email/transport.ts +13 -10
- package/src/runtime/node/entitlements/main.ts +14 -11
- package/src/runtime/node/index.ts +1 -1
- package/src/runtime/node/main.ts +1 -1
- package/src/runtime/node/migrate.ts +5 -1
- package/src/runtime/node/relay.ts +8 -2
- package/src/runtime/node/request-id.ts +13 -0
- package/src/runtime/node/server.ts +50 -16
- package/src/runtime/node/{ai-relay → services}/main.ts +7 -7
- package/src/runtime/node/{ai-relay → services}/server.ts +18 -18
- package/src/runtime/postgres/database.ts +20 -1
- package/src/runtime/posthog/errors.ts +15 -30
- package/src/runtime/s3/objects.ts +41 -1
- package/src/runtime/site/community.ts +101 -0
- package/src/runtime/site/server.ts +49 -6
- package/src/server/account/actions.ts +5 -0
- package/src/server/account/deletion.ts +304 -0
- package/src/server/account/routes.ts +281 -206
- package/src/server/account/terms.ts +42 -0
- package/src/server/account/tokens.ts +57 -0
- package/src/server/api/router.ts +32 -5
- package/src/server/api/types.ts +2 -0
- package/src/server/app/checks.ts +84 -0
- package/src/server/app/editors.ts +20 -0
- package/src/server/app/index.ts +128 -0
- package/src/server/app/indexing.ts +40 -0
- package/src/server/app/limiters.ts +53 -0
- package/src/server/app/routes.ts +114 -0
- package/src/server/app/services.ts +185 -0
- package/src/server/auth/access-control.ts +63 -0
- package/src/server/auth/access-tokens.ts +62 -0
- package/src/server/auth/adapter.ts +32 -1
- package/src/server/auth/email.ts +4 -1
- package/src/server/auth/endpoints.ts +5 -1
- package/src/server/auth/enrollment.ts +116 -0
- package/src/server/auth/factory.ts +116 -132
- package/src/server/auth/index.ts +10 -1
- package/src/server/auth/logger.ts +23 -0
- package/src/server/auth/mfa-assurance.ts +51 -0
- package/src/server/auth/passwords.ts +43 -0
- package/src/server/auth/session.ts +2 -0
- package/src/server/billing/index.ts +6 -0
- package/src/server/billing/routes.ts +27 -0
- package/src/server/billing/tokens.ts +37 -0
- package/src/server/cleanup/configured.ts +27 -7
- package/src/server/cleanup/documents.ts +165 -71
- package/src/server/cleanup/revisions.ts +16 -5
- package/src/server/cleanup/uploads.ts +8 -2
- package/src/server/cleanup/worker.ts +15 -3
- package/src/server/collaboration/relay/connection.ts +4 -3
- package/src/server/collaboration/relay/documents.ts +13 -10
- package/src/server/collaboration/relay/hub.ts +77 -122
- package/src/server/collaboration/relay/log.ts +5 -2
- package/src/server/collaboration/relay/room.ts +154 -0
- package/src/server/collaboration/service.ts +48 -33
- package/src/server/community/index.ts +2 -0
- package/src/server/community/routes.ts +93 -0
- package/src/server/community/service.ts +134 -0
- package/src/server/config/deployment.ts +41 -9
- package/src/server/config/index.ts +1 -1
- package/src/server/config/public.ts +11 -4
- package/src/server/config/schema.ts +91 -277
- package/src/server/config/toml/schema.ts +307 -0
- package/src/server/db/expressions.ts +15 -1
- package/src/server/db/index.ts +1 -0
- package/src/server/db/migrate.ts +46 -116
- package/src/server/db/migrations/001_accounts.ts +79 -0
- package/src/server/db/migrations/002_workspaces.ts +48 -0
- package/src/server/db/migrations/003_storage.ts +44 -0
- package/src/server/db/migrations/004_documents.ts +193 -0
- package/src/server/db/migrations/005_sharing.ts +95 -0
- package/src/server/db/migrations/006_operations.ts +110 -0
- package/src/server/db/migrations/007_trash.ts +33 -0
- package/src/server/db/migrations/008_terms.ts +18 -0
- package/src/server/db/migrations/009_access_tokens.ts +47 -0
- package/src/server/db/migrations/010_storage_limit_notices.ts +50 -0
- package/src/server/db/migrations/011_account_ids.ts +30 -0
- package/src/server/db/migrations/012_email_locales.ts +34 -0
- package/src/server/db/migrations/013_document_block_emails.ts +40 -0
- package/src/server/db/migrations/014_report_replies.ts +28 -0
- package/src/server/db/migrations/schema.ts +96 -0
- package/src/server/db/tables.ts +82 -4
- package/src/server/db/users.ts +22 -0
- package/src/server/documents/access.ts +66 -55
- package/src/server/documents/errors.ts +7 -0
- package/src/server/documents/images.ts +2 -1
- package/src/server/documents/index.ts +1 -1
- package/src/server/documents/limits.ts +14 -8
- package/src/server/documents/purge.ts +75 -0
- package/src/server/documents/repository.ts +2 -0
- package/src/server/documents/routes.ts +26 -0
- package/src/server/documents/service.ts +30 -406
- package/src/server/documents/summary.ts +1 -0
- package/src/server/documents/trash.ts +203 -0
- package/src/server/documents/uploads.ts +450 -0
- package/src/server/documents/versions/checkpoint.ts +2 -1
- package/src/server/documents/versions/history.ts +11 -7
- package/src/server/documents/versions/service.ts +94 -28
- package/src/server/email/invitations.ts +1 -0
- package/src/server/email/service.ts +31 -4
- package/src/server/email/types.ts +12 -0
- package/src/server/errors/index.ts +51 -16
- package/src/server/index.ts +52 -16
- package/src/server/internal/index.ts +3 -3
- package/src/server/internal/routes.ts +7 -10
- package/src/server/internal/schema.ts +1 -1
- package/src/server/internal/service.ts +17 -23
- package/src/server/invitations/budget.ts +66 -0
- package/src/server/invitations/index.ts +1 -0
- package/src/server/invitations/types.ts +5 -1
- package/src/server/logging.ts +76 -0
- package/src/server/objects/types.ts +5 -0
- package/src/server/pictures/service.ts +2 -1
- package/src/server/policy/configured.ts +9 -3
- package/src/server/policy/database.ts +52 -27
- package/src/server/policy/index.ts +2 -1
- package/src/server/policy/keys.ts +5 -2
- package/src/server/policy/policy.ts +40 -12
- package/src/server/policy/schema.ts +2 -2
- package/src/server/policy/service.ts +78 -56
- package/src/server/policy/static.ts +5 -5
- package/src/server/policy/storage.ts +33 -0
- package/src/server/policy/workspace.ts +41 -0
- package/src/server/quota/index.ts +6 -0
- package/src/server/quota/notices.ts +121 -0
- package/src/server/quota/reconcile.ts +2 -0
- package/src/server/quota/storage.ts +74 -31
- package/src/server/rate-limit/cleanup.ts +17 -5
- package/src/server/rate-limit/middleware.ts +6 -2
- package/src/server/reports/index.ts +9 -0
- package/src/server/reports/replies.ts +55 -0
- package/src/server/reports/routes.ts +39 -0
- package/src/server/reports/service.ts +145 -0
- package/src/server/services/errors.ts +7 -0
- package/src/server/services/index.ts +8 -0
- package/src/server/{ai → services}/keys.ts +11 -11
- package/src/server/services/routes.ts +47 -0
- package/src/server/{ai/service.ts → services/tokens.ts} +23 -20
- package/src/server/sharing/capabilities/service.ts +68 -23
- package/src/server/sharing/grants/service.ts +11 -18
- package/src/server/sharing/http.ts +4 -0
- package/src/server/sharing/invitations/service.ts +35 -15
- package/src/server/sharing/policy.ts +9 -14
- package/src/server/sharing/routes.ts +0 -16
- package/src/server/sharing/service.ts +1 -17
- package/src/server/validation.ts +4 -0
- package/src/server/workspaces/index.ts +1 -0
- package/src/server/workspaces/members.ts +91 -52
- package/src/server/workspaces/repository.ts +2 -1
- package/src/server/workspaces/routes.ts +4 -0
- package/src/{ai-relay → services}/app.ts +46 -44
- package/src/{ai-relay → services}/config.ts +26 -19
- package/src/services/db/index.ts +10 -0
- package/src/services/db/migrate.ts +37 -0
- package/src/{ai-relay/db/migrations/001_usage.ts → services/db/migrations/001_baseline.ts} +18 -7
- package/src/services/db/schema.ts +22 -0
- package/src/services/index.ts +18 -0
- package/src/{ai-relay → services}/metering.ts +2 -2
- package/src/{ai-relay → services}/usage.ts +35 -19
- package/dist/bin/ai-relay.mjs.map +0 -1
- package/src/ai-relay/db/index.ts +0 -10
- package/src/ai-relay/db/migrate.ts +0 -32
- package/src/ai-relay/db/schema.ts +0 -20
- package/src/ai-relay/index.ts +0 -18
- package/src/client/ai.ts +0 -96
- package/src/contract/ai.ts +0 -150
- package/src/email/templates/document-invitation.ts +0 -35
- package/src/email/templates/enrollment.ts +0 -27
- package/src/email/templates/layout.ts +0 -18
- package/src/server/ai/errors.ts +0 -7
- package/src/server/ai/index.ts +0 -4
- package/src/server/ai/routes.ts +0 -43
- package/src/server/app.ts +0 -379
- package/src/server/auth/workspace-access.ts +0 -23
- package/src/server/db/migrations/001_foundation.ts +0 -164
- package/src/server/db/migrations/002_upload_cleanup_claims.ts +0 -34
- package/src/server/db/migrations/003_document_cleanup_claims.ts +0 -23
- package/src/server/db/migrations/004_document_sharing.ts +0 -82
- package/src/server/db/migrations/005_document_collaboration_epoch.ts +0 -13
- package/src/server/db/migrations/006_invitation_continuation.ts +0 -27
- package/src/server/db/migrations/007_collaboration_state.ts +0 -25
- package/src/server/db/migrations/008_storage_reservations.ts +0 -37
- package/src/server/db/migrations/009_workspace_entitlements.ts +0 -22
- package/src/server/db/migrations/010_upload_finalization.ts +0 -22
- package/src/server/db/migrations/011_upload_finalization_lease.ts +0 -12
- package/src/server/db/migrations/012_transactional_email.ts +0 -48
- package/src/server/db/migrations/013_admin_enrollment.ts +0 -54
- package/src/server/db/migrations/014_enrollment_email_kinds.ts +0 -30
- package/src/server/db/migrations/015_cloud_rate_limit.ts +0 -22
- package/src/server/db/migrations/016_auth_schema.ts +0 -16
- package/src/server/db/migrations/017_authentication_email_kinds.ts +0 -32
- package/src/server/db/migrations/018_authentication_mfa.ts +0 -78
- package/src/server/db/migrations/019_better_auth_account_issuer.ts +0 -42
- package/src/server/db/migrations/020_workspace_invitations.ts +0 -57
- package/src/server/db/migrations/021_document_versions.ts +0 -66
- package/src/server/db/migrations/022_entitlement_external_version.ts +0 -17
- package/src/server/db/migrations/023_document_images.ts +0 -61
- package/src/server/db/migrations/024_account_activity.ts +0 -66
- package/src/server/db/migrations/025_table_names.ts +0 -58
- package/src/server/db/migrations/026_user_picture.ts +0 -30
- package/src/server/db/migrations/027_document_kind.ts +0 -19
- package/src/server/db/migrations/028_collaboration_updates.ts +0 -84
- package/src/server/db/migrations/helpers.ts +0 -78
- /package/dist/bin/{ai-relay.d.mts → services.d.mts} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Body,
|
|
4
|
+
Button,
|
|
5
|
+
Container,
|
|
6
|
+
Head,
|
|
7
|
+
Heading,
|
|
8
|
+
// eslint-disable-next-line @open-pencil/structure/no-mixed-case-acronym-identifiers -- Upstream export spelling.
|
|
9
|
+
Html as HTML,
|
|
10
|
+
Img,
|
|
11
|
+
Link,
|
|
12
|
+
Preview,
|
|
13
|
+
Section,
|
|
14
|
+
Text
|
|
15
|
+
} from '@vue-email/components'
|
|
16
|
+
|
|
17
|
+
import { LOGO_URL, SITE_URL, styles } from './brand'
|
|
18
|
+
import { useEmailLocalization } from './localization'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The branded email every OpenPencil service sends, in its reader's language and direction: a
|
|
22
|
+
* heading, the paragraphs in the default slot, one button, and small print in `note`.
|
|
23
|
+
*/
|
|
24
|
+
const { preview, heading, action } = defineProps<{
|
|
25
|
+
/** The line mail clients show beside the subject. */
|
|
26
|
+
preview: string
|
|
27
|
+
heading: string
|
|
28
|
+
/** The one thing the email asks the reader to do, if there is one. */
|
|
29
|
+
action?: { label: string; url: string }
|
|
30
|
+
}>()
|
|
31
|
+
|
|
32
|
+
const { locale, dir, t } = useEmailLocalization()
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<HTML :lang="locale" :dir="dir">
|
|
37
|
+
<Head />
|
|
38
|
+
<Preview>{{ preview }}</Preview>
|
|
39
|
+
<Body :style="styles.body">
|
|
40
|
+
<Container :style="styles.card">
|
|
41
|
+
<Img :src="LOGO_URL" :width="44" :height="44" alt="OpenPencil" :style="styles.logo" />
|
|
42
|
+
<Heading as="h1" :style="styles.heading">{{ heading }}</Heading>
|
|
43
|
+
<slot />
|
|
44
|
+
<Section v-if="action" :style="styles.action">
|
|
45
|
+
<Button :href="action.url" :style="styles.button">{{ action.label }}</Button>
|
|
46
|
+
</Section>
|
|
47
|
+
<Text v-if="$slots.note" :style="styles.note"><slot name="note" /></Text>
|
|
48
|
+
</Container>
|
|
49
|
+
<Text :style="styles.footer">
|
|
50
|
+
{{ t.footer }} · <Link :href="SITE_URL" :style="styles.footerLink">openpencil.dev</Link>
|
|
51
|
+
</Text>
|
|
52
|
+
</Body>
|
|
53
|
+
</HTML>
|
|
54
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Link } from '@vue-email/components'
|
|
3
|
+
|
|
4
|
+
import type { DocumentBlockedPayload } from '../schema'
|
|
5
|
+
import { styles } from './brand'
|
|
6
|
+
import BrandEmail from './BrandEmail.vue'
|
|
7
|
+
import EmailText from './EmailText.vue'
|
|
8
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* To a workspace's owner: an administrator took one of its documents down. It says why, when the
|
|
12
|
+
* administrator gave a reason, and where to contest it.
|
|
13
|
+
*/
|
|
14
|
+
const { payload } = defineProps<{ payload: DocumentBlockedPayload }>()
|
|
15
|
+
|
|
16
|
+
const localization = useEmailLocalization()
|
|
17
|
+
const { t } = localization
|
|
18
|
+
const document = { document: payload.documentName }
|
|
19
|
+
// The translation places the address inside its sentence, where `{email}` is.
|
|
20
|
+
const [beforeEmail = '', afterEmail = ''] = t
|
|
21
|
+
.documentBlockedContest({ email: '{email}' })
|
|
22
|
+
.split('{email}')
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<BrandEmail
|
|
27
|
+
:preview="t.documentBlocked(document)"
|
|
28
|
+
:heading="t.documentBlockedHeading"
|
|
29
|
+
:action="{ label: t.openHome, url: payload.actionURL }"
|
|
30
|
+
>
|
|
31
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
32
|
+
<EmailText>{{ t.documentBlocked(document) }}</EmailText>
|
|
33
|
+
<EmailText v-if="payload.reason">
|
|
34
|
+
{{ t.documentBlockedReason({ reason: payload.reason }) }}
|
|
35
|
+
</EmailText>
|
|
36
|
+
<EmailText v-if="payload.contactEmail">
|
|
37
|
+
{{ beforeEmail
|
|
38
|
+
}}<Link :href="`mailto:${payload.contactEmail}`" :style="styles.link">{{
|
|
39
|
+
payload.contactEmail
|
|
40
|
+
}}</Link
|
|
41
|
+
>{{ afterEmail }}
|
|
42
|
+
</EmailText>
|
|
43
|
+
<EmailText v-else>{{ t.documentBlockedContestAdministrators }}</EmailText>
|
|
44
|
+
</BrandEmail>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DocumentInvitationEmailPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
const { payload } = defineProps<{ payload: DocumentInvitationEmailPayload }>()
|
|
8
|
+
|
|
9
|
+
const { t, dateTime } = useEmailLocalization()
|
|
10
|
+
const names = { inviter: payload.inviterName ?? t.someone, document: payload.documentName }
|
|
11
|
+
const message =
|
|
12
|
+
payload.permission === 'edit' ? t.documentInvitationEdit(names) : t.documentInvitationView(names)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<BrandEmail
|
|
17
|
+
:preview="message"
|
|
18
|
+
:heading="t.documentInvitationHeading"
|
|
19
|
+
:action="{ label: t.documentInvitationAction, url: payload.acceptanceURL }"
|
|
20
|
+
>
|
|
21
|
+
<EmailText>{{ message }}</EmailText>
|
|
22
|
+
<template #note>{{ t.invitationExpires({ date: dateTime(payload.expiresAt) }) }}</template>
|
|
23
|
+
</BrandEmail>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DocumentReportReason } from '#cloud/contract'
|
|
3
|
+
|
|
4
|
+
import type { DocumentReportPayload } from '../schema'
|
|
5
|
+
import BrandEmail from './BrandEmail.vue'
|
|
6
|
+
import EmailText from './EmailText.vue'
|
|
7
|
+
import { useEmailLocalization } from './localization'
|
|
8
|
+
|
|
9
|
+
/** To administrators: someone reported a shared document, in their own words. */
|
|
10
|
+
const { payload } = defineProps<{ payload: DocumentReportPayload }>()
|
|
11
|
+
|
|
12
|
+
const { t } = useEmailLocalization()
|
|
13
|
+
const reasons: Record<DocumentReportReason, string> = {
|
|
14
|
+
'spam-phishing': t.reportReasonSpamPhishing,
|
|
15
|
+
illegal: t.reportReasonIllegal,
|
|
16
|
+
copyright: t.reportReasonCopyright,
|
|
17
|
+
harassment: t.reportReasonHarassment,
|
|
18
|
+
other: t.reportReasonOther
|
|
19
|
+
}
|
|
20
|
+
const report = { document: payload.documentName, reason: reasons[payload.reason] }
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<BrandEmail
|
|
25
|
+
:preview="t.documentReportPreview(report)"
|
|
26
|
+
:heading="t.documentReportHeading"
|
|
27
|
+
:action="{ label: t.documentReportAction, url: payload.actionURL }"
|
|
28
|
+
>
|
|
29
|
+
<EmailText>{{ t.documentReport(report) }}</EmailText>
|
|
30
|
+
<EmailText>{{ payload.description }}</EmailText>
|
|
31
|
+
</BrandEmail>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Link } from '@vue-email/components'
|
|
3
|
+
|
|
4
|
+
import type { DocumentReportDecidedPayload } from '../schema'
|
|
5
|
+
import { styles } from './brand'
|
|
6
|
+
import BrandEmail from './BrandEmail.vue'
|
|
7
|
+
import EmailText from './EmailText.vue'
|
|
8
|
+
import { useEmailLocalization } from './localization'
|
|
9
|
+
|
|
10
|
+
/** To whoever reported a document: what the administrators decided, and where to disagree. */
|
|
11
|
+
const { payload } = defineProps<{ payload: DocumentReportDecidedPayload }>()
|
|
12
|
+
|
|
13
|
+
const { t } = useEmailLocalization()
|
|
14
|
+
const document = { document: payload.documentName }
|
|
15
|
+
const decision = {
|
|
16
|
+
blocked: { heading: t.reportBlockedHeading, message: t.reportBlocked(document) },
|
|
17
|
+
actioned: { heading: t.reportActionedHeading, message: t.reportActioned(document) },
|
|
18
|
+
dismissed: { heading: t.reportDismissedHeading, message: t.reportDismissed(document) }
|
|
19
|
+
}[payload.outcome]
|
|
20
|
+
// The translation places the address inside its sentence, where `{email}` is.
|
|
21
|
+
const [beforeEmail = '', afterEmail = ''] = t.reportDisagree({ email: '{email}' }).split('{email}')
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<BrandEmail :preview="decision.message" :heading="decision.heading">
|
|
26
|
+
<EmailText>{{ decision.message }}</EmailText>
|
|
27
|
+
<EmailText v-if="payload.contactEmail">
|
|
28
|
+
{{ beforeEmail
|
|
29
|
+
}}<Link :href="`mailto:${payload.contactEmail}`" :style="styles.link">{{
|
|
30
|
+
payload.contactEmail
|
|
31
|
+
}}</Link
|
|
32
|
+
>{{ afterEmail }}
|
|
33
|
+
</EmailText>
|
|
34
|
+
<EmailText v-else>{{ t.reportDisagreeAdministrators }}</EmailText>
|
|
35
|
+
</BrandEmail>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DocumentReportReceivedPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** To whoever reported a document: their report arrived, and they'll hear the decision. */
|
|
8
|
+
const { payload } = defineProps<{ payload: DocumentReportReceivedPayload }>()
|
|
9
|
+
|
|
10
|
+
const { t } = useEmailLocalization()
|
|
11
|
+
const document = { document: payload.documentName }
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<BrandEmail :preview="t.reportReceived(document)" :heading="t.reportReceivedHeading">
|
|
16
|
+
<EmailText>{{ t.reportReceived(document) }}</EmailText>
|
|
17
|
+
</BrandEmail>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DocumentRestoredPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** To a workspace's owner: a document an administrator took down is back. */
|
|
8
|
+
const { payload } = defineProps<{ payload: DocumentRestoredPayload }>()
|
|
9
|
+
|
|
10
|
+
const localization = useEmailLocalization()
|
|
11
|
+
const { t } = localization
|
|
12
|
+
const document = { document: payload.documentName }
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<BrandEmail
|
|
17
|
+
:preview="t.documentRestored(document)"
|
|
18
|
+
:heading="t.documentRestoredHeading"
|
|
19
|
+
:action="{ label: t.openHome, url: payload.actionURL }"
|
|
20
|
+
>
|
|
21
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
22
|
+
<EmailText>{{ t.documentRestored(document) }}</EmailText>
|
|
23
|
+
</BrandEmail>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { EmailChangeRequestedPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** To the address being replaced: which address is taking over, before it confirms. */
|
|
8
|
+
const { payload } = defineProps<{ payload: EmailChangeRequestedPayload }>()
|
|
9
|
+
|
|
10
|
+
const localization = useEmailLocalization()
|
|
11
|
+
const { t } = localization
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<BrandEmail
|
|
16
|
+
:preview="t.emailChangePreview({ email: payload.newEmail })"
|
|
17
|
+
:heading="t.emailChangeHeading"
|
|
18
|
+
:action="{ label: t.reviewAccount, url: payload.actionURL }"
|
|
19
|
+
>
|
|
20
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
21
|
+
<EmailText>{{ t.emailChange({ email: payload.newEmail }) }}</EmailText>
|
|
22
|
+
<EmailText>{{ t.emailChangeNotYou }}</EmailText>
|
|
23
|
+
</BrandEmail>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { provide, type Component } from 'vue'
|
|
3
|
+
|
|
4
|
+
import type { EmailLocalization } from '../i18n'
|
|
5
|
+
import { EMAIL_LOCALIZATION } from './localization'
|
|
6
|
+
|
|
7
|
+
/** Renders an email in its reader's language, which it and its layout read. */
|
|
8
|
+
const { email, props, localization } = defineProps<{
|
|
9
|
+
email: Component
|
|
10
|
+
props: Record<string, unknown>
|
|
11
|
+
localization: EmailLocalization
|
|
12
|
+
}>()
|
|
13
|
+
|
|
14
|
+
provide(EMAIL_LOCALIZATION, localization)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<component :is="email" v-bind="props" />
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AuthenticationEmailPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** Confirms the address a new account signed up with, or one an account is moving to. */
|
|
8
|
+
const { payload } = defineProps<{ payload: AuthenticationEmailPayload }>()
|
|
9
|
+
|
|
10
|
+
const localization = useEmailLocalization()
|
|
11
|
+
const { t } = localization
|
|
12
|
+
const copy =
|
|
13
|
+
payload.purpose === 'change'
|
|
14
|
+
? {
|
|
15
|
+
preview: t.verifyChangePreview,
|
|
16
|
+
heading: t.verifyChangeHeading,
|
|
17
|
+
message: t.verifyChange,
|
|
18
|
+
note: t.verifyChangeNote
|
|
19
|
+
}
|
|
20
|
+
: {
|
|
21
|
+
preview: t.verifyAccountPreview,
|
|
22
|
+
heading: t.verifyAccountHeading,
|
|
23
|
+
message: t.verifyAccount,
|
|
24
|
+
note: t.verifyAccountNote
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<BrandEmail
|
|
30
|
+
:preview="copy.preview"
|
|
31
|
+
:heading="copy.heading"
|
|
32
|
+
:action="{ label: t.verifyAction, url: payload.actionURL ?? '#' }"
|
|
33
|
+
>
|
|
34
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
35
|
+
<EmailText>{{ copy.message }}</EmailText>
|
|
36
|
+
<template #note>{{ copy.note }}</template>
|
|
37
|
+
</BrandEmail>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AdminEnrollmentNotificationPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** To administrators: someone asked for access, in their own words. */
|
|
8
|
+
const { payload } = defineProps<{ payload: AdminEnrollmentNotificationPayload }>()
|
|
9
|
+
|
|
10
|
+
const { t } = useEmailLocalization()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<BrandEmail
|
|
15
|
+
:preview="t.enrollmentNotificationPreview({ email: payload.requesterEmail })"
|
|
16
|
+
:heading="t.enrollmentNotificationHeading"
|
|
17
|
+
:action="{ label: t.enrollmentNotificationAction, url: payload.actionURL }"
|
|
18
|
+
>
|
|
19
|
+
<EmailText>
|
|
20
|
+
{{ t.enrollmentNotification({ name: payload.requesterName, email: payload.requesterEmail }) }}
|
|
21
|
+
</EmailText>
|
|
22
|
+
<EmailText>{{ payload.reason }}</EmailText>
|
|
23
|
+
</BrandEmail>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { EnrollmentEmailPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** Where an access request stands, to the person who made it. */
|
|
8
|
+
const { kind, payload } = defineProps<{
|
|
9
|
+
kind: 'requested' | 'approved' | 'rejected' | 'revoked'
|
|
10
|
+
payload: EnrollmentEmailPayload
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const localization = useEmailLocalization()
|
|
14
|
+
const { t } = localization
|
|
15
|
+
const copy = {
|
|
16
|
+
requested: {
|
|
17
|
+
preview: t.enrollmentRequestedPreview,
|
|
18
|
+
heading: t.enrollmentRequestedHeading,
|
|
19
|
+
message: t.enrollmentRequested,
|
|
20
|
+
action: t.openCloud
|
|
21
|
+
},
|
|
22
|
+
approved: {
|
|
23
|
+
preview: t.enrollmentApprovedPreview,
|
|
24
|
+
heading: t.enrollmentApprovedHeading,
|
|
25
|
+
message: t.enrollmentApproved,
|
|
26
|
+
action: t.enrollmentApprovedAction
|
|
27
|
+
},
|
|
28
|
+
rejected: {
|
|
29
|
+
preview: t.enrollmentRejectedPreview,
|
|
30
|
+
heading: t.enrollmentRejectedHeading,
|
|
31
|
+
message: t.enrollmentRejected,
|
|
32
|
+
action: t.enrollmentRejectedAction
|
|
33
|
+
},
|
|
34
|
+
revoked: {
|
|
35
|
+
preview: t.enrollmentRevokedPreview,
|
|
36
|
+
heading: t.enrollmentRevokedHeading,
|
|
37
|
+
message: t.enrollmentRevoked,
|
|
38
|
+
action: t.enrollmentRevokedAction
|
|
39
|
+
}
|
|
40
|
+
}[kind]
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<BrandEmail
|
|
45
|
+
:preview="copy.preview"
|
|
46
|
+
:heading="copy.heading"
|
|
47
|
+
:action="{ label: copy.action, url: payload.actionURL }"
|
|
48
|
+
>
|
|
49
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
50
|
+
<EmailText>{{ copy.message }}</EmailText>
|
|
51
|
+
</BrandEmail>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NewSignInPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** An account was signed in to from somewhere it never was before. */
|
|
8
|
+
const { payload } = defineProps<{ payload: NewSignInPayload }>()
|
|
9
|
+
|
|
10
|
+
const localization = useEmailLocalization()
|
|
11
|
+
const { t, dateTime } = localization
|
|
12
|
+
|
|
13
|
+
function signedInWith(): string {
|
|
14
|
+
if (payload.desktop) return t.newSignInApp
|
|
15
|
+
const { browser, system } = payload
|
|
16
|
+
if (browser && system) return t.newSignInBrowser({ browser, system })
|
|
17
|
+
return browser ?? system ?? t.newSignInUnknownBrowser
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const device = signedInWith()
|
|
21
|
+
const date = dateTime(payload.signedInAt)
|
|
22
|
+
const message = payload.ipAddress
|
|
23
|
+
? t.newSignInFrom({ device, address: payload.ipAddress, date })
|
|
24
|
+
: t.newSignIn({ device, date })
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<BrandEmail
|
|
29
|
+
:preview="t.newSignInPreview({ device })"
|
|
30
|
+
:heading="t.newSignInHeading"
|
|
31
|
+
:action="{ label: t.reviewSessions, url: payload.actionURL }"
|
|
32
|
+
>
|
|
33
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
34
|
+
<EmailText>{{ message }}</EmailText>
|
|
35
|
+
<EmailText>{{ t.newSignInNotYou }}</EmailText>
|
|
36
|
+
</BrandEmail>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AuthenticationEmailPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
const { payload } = defineProps<{ payload: AuthenticationEmailPayload }>()
|
|
8
|
+
|
|
9
|
+
const localization = useEmailLocalization()
|
|
10
|
+
const { t } = localization
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<BrandEmail
|
|
15
|
+
:preview="t.passwordChangedPreview"
|
|
16
|
+
:heading="t.passwordChangedHeading"
|
|
17
|
+
:action="{ label: t.openCloud, url: payload.actionURL ?? '#' }"
|
|
18
|
+
>
|
|
19
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
20
|
+
<EmailText>{{ t.passwordChanged }}</EmailText>
|
|
21
|
+
</BrandEmail>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AuthenticationEmailPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
const { payload } = defineProps<{ payload: AuthenticationEmailPayload }>()
|
|
8
|
+
|
|
9
|
+
const localization = useEmailLocalization()
|
|
10
|
+
const { t } = localization
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<BrandEmail
|
|
15
|
+
:preview="t.passwordResetPreview"
|
|
16
|
+
:heading="t.passwordResetHeading"
|
|
17
|
+
:action="{ label: t.passwordResetAction, url: payload.actionURL ?? '#' }"
|
|
18
|
+
>
|
|
19
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
20
|
+
<EmailText>{{ t.passwordReset }}</EmailText>
|
|
21
|
+
<template #note>{{ t.passwordResetNote }}</template>
|
|
22
|
+
</BrandEmail>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { StorageLimitReachedPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** The account holds all the storage its plan includes, so its workspaces are read-only. */
|
|
8
|
+
const { payload } = defineProps<{ payload: StorageLimitReachedPayload }>()
|
|
9
|
+
|
|
10
|
+
const localization = useEmailLocalization()
|
|
11
|
+
const { t, storage } = localization
|
|
12
|
+
const amounts = { used: storage(payload.usedBytes), limit: storage(payload.limitBytes) }
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<BrandEmail
|
|
17
|
+
:preview="t.storageFullPreview(amounts)"
|
|
18
|
+
:heading="t.storageFullHeading"
|
|
19
|
+
:action="{
|
|
20
|
+
label: payload.upgradable ? t.storageFullAction : t.openCloud,
|
|
21
|
+
url: payload.actionURL
|
|
22
|
+
}"
|
|
23
|
+
>
|
|
24
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
25
|
+
<EmailText>{{ t.storageFull(amounts) }}</EmailText>
|
|
26
|
+
<EmailText>{{ payload.upgradable ? t.storageFullUpgrade : t.storageFullFreeSpace }}</EmailText>
|
|
27
|
+
</BrandEmail>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TwoStepChange, TwoStepChangedPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { greeting, useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
/** How the account proves it's its owner's changed: an authenticator app or a passkey. */
|
|
8
|
+
const { payload } = defineProps<{ payload: TwoStepChangedPayload }>()
|
|
9
|
+
|
|
10
|
+
const localization = useEmailLocalization()
|
|
11
|
+
const { t } = localization
|
|
12
|
+
const changes: Record<TwoStepChange, { heading: string; message: string }> = {
|
|
13
|
+
'authenticator-on': { heading: t.authenticatorOnHeading, message: t.authenticatorOn },
|
|
14
|
+
'authenticator-off': { heading: t.authenticatorOffHeading, message: t.authenticatorOff },
|
|
15
|
+
'passkey-added': { heading: t.passkeyAddedHeading, message: t.passkeyAdded },
|
|
16
|
+
'passkey-removed': { heading: t.passkeyRemovedHeading, message: t.passkeyRemoved },
|
|
17
|
+
'reset-by-administrator': { heading: t.twoStepResetHeading, message: t.twoStepReset }
|
|
18
|
+
}
|
|
19
|
+
const change = changes[payload.change]
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<BrandEmail
|
|
24
|
+
:preview="change.message"
|
|
25
|
+
:heading="change.heading"
|
|
26
|
+
:action="{ label: t.reviewSecurity, url: payload.actionURL }"
|
|
27
|
+
>
|
|
28
|
+
<EmailText>{{ greeting(localization, payload.name) }}</EmailText>
|
|
29
|
+
<EmailText>{{ change.message }}</EmailText>
|
|
30
|
+
<EmailText>{{ t.twoStepNotYou }}</EmailText>
|
|
31
|
+
</BrandEmail>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Link } from '@vue-email/components'
|
|
3
|
+
|
|
4
|
+
import { styles } from './brand'
|
|
5
|
+
import BrandEmail from './BrandEmail.vue'
|
|
6
|
+
import EmailText from './EmailText.vue'
|
|
7
|
+
import { useEmailLocalization } from './localization'
|
|
8
|
+
|
|
9
|
+
/** Asks a waitlist sign-up to confirm its address; its links carry the sign-up's token only. */
|
|
10
|
+
const { confirmURL, leaveURL } = defineProps<{ confirmURL: string; leaveURL: string }>()
|
|
11
|
+
|
|
12
|
+
const { t } = useEmailLocalization()
|
|
13
|
+
// The translation places the link inside its sentence, where `{link}` is.
|
|
14
|
+
const [beforeLink = '', afterLink = ''] = t.waitlistNote.split('{link}')
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<BrandEmail
|
|
19
|
+
:preview="t.waitlistPreview"
|
|
20
|
+
:heading="t.waitlistHeading"
|
|
21
|
+
:action="{ label: t.waitlistAction, url: confirmURL }"
|
|
22
|
+
>
|
|
23
|
+
<EmailText>{{ t.waitlist }}</EmailText>
|
|
24
|
+
<template #note>
|
|
25
|
+
{{ beforeLink }}<Link :href="leaveURL" :style="styles.link">{{ t.waitlistLeave }}</Link
|
|
26
|
+
>{{ afterLink }}
|
|
27
|
+
</template>
|
|
28
|
+
</BrandEmail>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { WorkspaceInvitationEmailPayload } from '../schema'
|
|
3
|
+
import BrandEmail from './BrandEmail.vue'
|
|
4
|
+
import EmailText from './EmailText.vue'
|
|
5
|
+
import { useEmailLocalization } from './localization'
|
|
6
|
+
|
|
7
|
+
const { payload } = defineProps<{ payload: WorkspaceInvitationEmailPayload }>()
|
|
8
|
+
|
|
9
|
+
const { t, dateTime } = useEmailLocalization()
|
|
10
|
+
const names = { inviter: payload.inviterName ?? t.someone, workspace: payload.workspaceName }
|
|
11
|
+
const message = {
|
|
12
|
+
admin: t.workspaceInvitationAdmin,
|
|
13
|
+
editor: t.workspaceInvitationEditor,
|
|
14
|
+
viewer: t.workspaceInvitationViewer
|
|
15
|
+
}[payload.role](names)
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<BrandEmail
|
|
20
|
+
:preview="t.workspaceInvitationSubject(names)"
|
|
21
|
+
:heading="t.workspaceInvitationHeading(names)"
|
|
22
|
+
:action="{ label: t.workspaceInvitationAction, url: payload.acceptanceURL }"
|
|
23
|
+
>
|
|
24
|
+
<EmailText>{{ message }}</EmailText>
|
|
25
|
+
<EmailText>{{ t.workspaceInvitationHome }}</EmailText>
|
|
26
|
+
<template #note>{{ t.invitationExpires({ date: dateTime(payload.expiresAt) }) }}</template>
|
|
27
|
+
</BrandEmail>
|
|
28
|
+
</template>
|