mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-09 12:12:25 +09:00
Compare commits
49
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e614026d7 | ||
|
|
b38e7c6433 | ||
|
|
83c8e91955 | ||
|
|
0532dd0440 | ||
|
|
a08615e306 | ||
|
|
f4c5fee17e | ||
|
|
c5aaf65a10 | ||
|
|
951e39da3d | ||
|
|
b693d84d2b | ||
|
|
9bbf6c513b | ||
|
|
50cec92738 | ||
|
|
c212d315f4 | ||
|
|
1861432a53 | ||
|
|
d0c6146429 | ||
|
|
550e6b05a1 | ||
|
|
5b6949170f | ||
|
|
f32bc37794 | ||
|
|
8ee2279b4b | ||
|
|
6339c3b8ad | ||
|
|
7c9274847f | ||
|
|
5d1dddc093 | ||
|
|
04481d7235 | ||
|
|
a3d6cf37cb | ||
|
|
ed10f9d323 | ||
|
|
4b278a0da8 | ||
|
|
1281045648 | ||
|
|
69c42cff90 | ||
|
|
7d56481aba | ||
|
|
91a2604e9e | ||
|
|
a9dc74a520 | ||
|
|
a9cc04d277 | ||
|
|
8cb097f954 | ||
|
|
78f783f0c4 | ||
|
|
d14998ff69 | ||
|
|
ca7ddd9272 | ||
|
|
84dcf6b8a8 | ||
|
|
a59b80ce11 | ||
|
|
007f338823 | ||
|
|
7d34d25497 | ||
|
|
7375ac9d80 | ||
|
|
6af33c7188 | ||
|
|
33737e0f79 | ||
|
|
5afbf67a70 | ||
|
|
580401d2dc | ||
|
|
38b7c63431 | ||
|
|
57d08cd091 | ||
|
|
91e2d31614 | ||
|
|
d375dc7946 | ||
|
|
3fffce2a4a |
@@ -14,7 +14,7 @@
|
||||
"DOCKER_HOST": "unix:///var/run/docker.sock"
|
||||
},
|
||||
"runServices": ["workspace", "postgres", "valkey", "nats", "livekit", "meilisearch", "mailpit"],
|
||||
"forwardPorts": [3000, 8088, 8080, 8771, 8082, 8773, 3010, 3020, 8333],
|
||||
"forwardPorts": [3000, 8088, 8080, 8771, 8082, 8773, 3020, 8333],
|
||||
"portsAttributes": {
|
||||
"8088": {
|
||||
"label": "Fluxer dev proxy",
|
||||
|
||||
@@ -256,7 +256,6 @@ services:
|
||||
- "127.0.0.1:${FLUXER_DEV_GATEWAY_PORT:-8771}:8771"
|
||||
- "127.0.0.1:${FLUXER_DEV_MEDIA_PROXY_PORT:-8082}:8082"
|
||||
- "127.0.0.1:${FLUXER_DEV_APP_PROXY_PORT:-8773}:8773"
|
||||
- "127.0.0.1:${FLUXER_DEV_MARKETING_PORT:-3010}:3010"
|
||||
- "127.0.0.1:${FLUXER_DEV_ADMIN_PORT:-3020}:3020"
|
||||
- "127.0.0.1:${FLUXER_DEV_SEAWEEDFS_S3_PORT:-3900}:8333"
|
||||
depends_on:
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
**/.git/**
|
||||
/.github/
|
||||
/.pnpm-store/
|
||||
/fluxer_marketing
|
||||
|
||||
**/.env
|
||||
**/.env.*.local
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
/.github/CODEOWNERS @fluxerapp/developers
|
||||
/.github/workflows/ @fluxerapp/developers
|
||||
/fluxer_marketing @fluxerapp/developers
|
||||
/.gitmodules @fluxerapp/developers
|
||||
/.github/workflows/dispatch-private-marketing-build.yaml @fluxerapp/developers
|
||||
/packages/i18n/marketing/ @fluxerapp/developers
|
||||
/scripts/setup-private-marketing.sh @fluxerapp/developers
|
||||
|
||||
@@ -89,21 +89,3 @@ Submit translations through [Weblate](https://weblate.fluxer.tools), not through
|
||||
All repository activity is governed by the [Code of Conduct](https://github.com/fluxerapp/fluxer/blob/main/.github/CODE_OF_CONDUCT.md).
|
||||
|
||||
Fluxer is distributed under the [GNU Affero General Public License, version 3.0 or later](https://github.com/fluxerapp/fluxer/blob/main/LICENSE). By adding a DCO sign-off, you certify that you have the right to submit the contribution under that licence.
|
||||
|
||||
## Private marketing project
|
||||
|
||||
The marketing implementation is maintained in a private repository at the `fluxer_marketing` submodule path. The public workspace, bootstrap, checks, and development stack work without initializing it.
|
||||
|
||||
Authorized maintainers can initialize only that submodule and install its independent dependencies:
|
||||
|
||||
```sh
|
||||
./scripts/setup-private-marketing.sh
|
||||
pnpm --dir fluxer_marketing install --frozen-lockfile
|
||||
cargo metadata --locked --manifest-path fluxer_marketing/Cargo.toml
|
||||
```
|
||||
|
||||
To run the private marketing service in the local development stack and direct application links to it, add this override to the ignored `config/env/local.env` file:
|
||||
|
||||
```sh
|
||||
FLUXER_MARKETING_ENDPOINT=http://localhost:8088/marketing
|
||||
```
|
||||
|
||||
@@ -22,11 +22,6 @@ f:docs:
|
||||
f:gateway:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: fluxer_gateway/**/*
|
||||
f:marketing:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- fluxer_marketing
|
||||
- packages/i18n/marketing/**/*
|
||||
f:media_proxy:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: fluxer_media_proxy/**/*
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
name: Dispatch private marketing build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- fluxer_marketing
|
||||
- Cargo.toml
|
||||
- fluxer_common/**
|
||||
- packages/fonts/manifest.json
|
||||
- packages/fonts/NOTICE.md
|
||||
- packages/fonts/LICENSE-IBM-PLEX.txt
|
||||
- packages/fonts/css/locale-fallbacks.css
|
||||
- packages/fonts/files/FluxerSans/**
|
||||
- packages/fonts/files/FluxerMono/**
|
||||
- packages/fonts/marketing/**
|
||||
- packages/i18n/marketing/**
|
||||
- fluxer_static/marketing/branding/**
|
||||
- .github/workflows/dispatch-private-marketing-build.yaml
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: private-marketing-dispatch
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
metadata:
|
||||
name: resolve exact private build metadata
|
||||
if: github.repository == 'fluxerapp/fluxer'
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
parent_sha: ${{ steps.inputs.outputs.parent_sha }}
|
||||
gitlink_sha: ${{ steps.inputs.outputs.gitlink_sha }}
|
||||
build_version: ${{ steps.inputs.outputs.build_version }}
|
||||
correlation_id: ${{ steps.inputs.outputs.correlation_id }}
|
||||
steps:
|
||||
- name: Create token
|
||||
id: create-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1
|
||||
with:
|
||||
client-id: ${{ vars.FLUXER_CI_APP_ID }}
|
||||
private-key: ${{ secrets.FLUXER_CI_APP_KEY }}
|
||||
owner: fluxerapp
|
||||
repositories: fluxer
|
||||
permission-contents: read
|
||||
- name: Resolve trusted build inputs
|
||||
id: inputs
|
||||
env:
|
||||
EVENT_AFTER: ${{ github.event.after }}
|
||||
GH_TOKEN: ${{ steps.create-token.outputs.token }}
|
||||
PARENT_SHA: ${{ github.sha }}
|
||||
PUBLIC_REPOSITORY: ${{ github.repository }}
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
RUN_ATTEMPT: ${{ github.run_attempt }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
[[ "$GITHUB_EVENT_NAME" == "push" ]]
|
||||
[[ "$GITHUB_REF" == "refs/heads/main" ]]
|
||||
[[ "$PUBLIC_REPOSITORY" == "fluxerapp/fluxer" ]]
|
||||
[[ "$PARENT_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
[[ "$EVENT_AFTER" == "$PARENT_SHA" ]]
|
||||
[[ "$RUN_ID" =~ ^[1-9][0-9]*$ ]]
|
||||
[[ "$RUN_ATTEMPT" =~ ^[1-9][0-9]*$ ]]
|
||||
(( 10#$RUN_ATTEMPT <= 10 ))
|
||||
|
||||
main_sha="$(gh api "repos/$PUBLIC_REPOSITORY/git/ref/heads/main" --jq .object.sha)"
|
||||
[[ "$main_sha" =~ ^[0-9a-f]{40}$ ]]
|
||||
main_comparison="$(gh api "repos/$PUBLIC_REPOSITORY/compare/$PARENT_SHA...$main_sha")"
|
||||
main_status="$(jq -r .status <<<"$main_comparison")"
|
||||
[[ "$main_status" == "identical" || "$main_status" == "ahead" ]]
|
||||
[[ "$(jq -r .merge_base_commit.sha <<<"$main_comparison")" == "$PARENT_SHA" ]]
|
||||
|
||||
commit="$(gh api "repos/$PUBLIC_REPOSITORY/git/commits/$PARENT_SHA")"
|
||||
[[ "$(jq -r .sha <<<"$commit")" == "$PARENT_SHA" ]]
|
||||
tree_sha="$(jq -r .tree.sha <<<"$commit")"
|
||||
[[ "$tree_sha" =~ ^[0-9a-f]{40}$ ]]
|
||||
entry="$(
|
||||
gh api "repos/$PUBLIC_REPOSITORY/git/trees/$tree_sha" |
|
||||
jq -cer '[.tree[] | select(.path == "fluxer_marketing")] | if length == 1 then .[0] else error("expected exactly one marketing gitlink") end'
|
||||
)"
|
||||
mode="$(jq -r .mode <<<"$entry")"
|
||||
type="$(jq -r .type <<<"$entry")"
|
||||
gitlink_sha="$(jq -r .sha <<<"$entry")"
|
||||
path="$(jq -r .path <<<"$entry")"
|
||||
if [[ "$mode" != "160000" || "$type" != "commit" || "$path" != "fluxer_marketing" || ! "$gitlink_sha" =~ ^[0-9a-f]{40}$ ]]; then
|
||||
echo "::error::Public parent does not contain a valid fluxer_marketing gitlink."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run="$(gh api "repos/$PUBLIC_REPOSITORY/actions/runs/$RUN_ID")"
|
||||
[[ "$(jq -r .id <<<"$run")" == "$RUN_ID" ]]
|
||||
[[ "$(jq -r .run_attempt <<<"$run")" == "$RUN_ATTEMPT" ]]
|
||||
[[ "$(jq -r .event <<<"$run")" == "push" ]]
|
||||
[[ "$(jq -r .head_sha <<<"$run")" == "$PARENT_SHA" ]]
|
||||
run_created_at="$(jq -r .created_at <<<"$run")"
|
||||
[[ "$run_created_at" =~ ^[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ ]]
|
||||
run_created_epoch="$(date -u -d "$run_created_at" +%s)"
|
||||
[[ "$run_created_epoch" =~ ^[1-9][0-9]*$ ]]
|
||||
build_epoch=$((run_created_epoch + 10#$RUN_ATTEMPT - 1))
|
||||
read -r year month day time_segment <<<"$(date -u -d "@$build_epoch" '+%Y %m %d %H%M%S')"
|
||||
month="$((10#$month))"
|
||||
micro="$((10#$time_segment))"
|
||||
build_version="$year.$month$day.$micro"
|
||||
[[ "$build_version" =~ ^[1-9][0-9]{3}\.[1-9][0-9]{2,3}\.([0-9]|[1-9][0-9]{0,5})$ ]]
|
||||
correlation_id="public-${RUN_ID}-${RUN_ATTEMPT}"
|
||||
[[ "$correlation_id" =~ ^[A-Za-z0-9._:-]{1,64}$ ]]
|
||||
{
|
||||
echo "parent_sha=$PARENT_SHA"
|
||||
echo "gitlink_sha=$gitlink_sha"
|
||||
echo "build_version=$build_version"
|
||||
echo "correlation_id=$correlation_id"
|
||||
} >>"$GITHUB_OUTPUT"
|
||||
|
||||
dispatch:
|
||||
name: dispatch exact private build
|
||||
needs: metadata
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 65
|
||||
environment: private-marketing-dispatch
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Validate trusted build inputs
|
||||
env:
|
||||
DISPATCH_ENABLED: ${{ vars.MARKETING_DISPATCH_ENABLED }}
|
||||
EXPECTED_PARENT_SHA: ${{ github.sha }}
|
||||
EXPECTED_CORRELATION_ID: public-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
PARENT_SHA: ${{ needs.metadata.outputs.parent_sha }}
|
||||
GITLINK_SHA: ${{ needs.metadata.outputs.gitlink_sha }}
|
||||
BUILD_VERSION: ${{ needs.metadata.outputs.build_version }}
|
||||
CORRELATION_ID: ${{ needs.metadata.outputs.correlation_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
[[ "$GITHUB_EVENT_NAME" == "push" ]]
|
||||
[[ "$GITHUB_REF" == "refs/heads/main" ]]
|
||||
[[ "$GITHUB_REPOSITORY" == "fluxerapp/fluxer" ]]
|
||||
[[ "$PARENT_SHA" == "$EXPECTED_PARENT_SHA" ]]
|
||||
[[ "$PARENT_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
[[ "$GITLINK_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
[[ "$BUILD_VERSION" =~ ^[1-9][0-9]{3}\.[1-9][0-9]{2,3}\.([0-9]|[1-9][0-9]{0,5})$ ]]
|
||||
[[ "$CORRELATION_ID" == "$EXPECTED_CORRELATION_ID" ]]
|
||||
[[ "$CORRELATION_ID" =~ ^[A-Za-z0-9._:-]{1,64}$ ]]
|
||||
if [[ "$DISPATCH_ENABLED" != "true" ]]; then
|
||||
echo "::error::Private marketing dispatch is intentionally disabled until the package cutover guard completes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Create private dispatch token
|
||||
id: private-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1
|
||||
with:
|
||||
client-id: ${{ vars.FLUXER_CI_APP_ID }}
|
||||
private-key: ${{ secrets.FLUXER_CI_APP_KEY }}
|
||||
owner: fluxerapp
|
||||
repositories: marketing
|
||||
permission-actions: write
|
||||
|
||||
- name: Dispatch exact private build
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.private-token.outputs.token }}
|
||||
PARENT_SHA: ${{ needs.metadata.outputs.parent_sha }}
|
||||
GITLINK_SHA: ${{ needs.metadata.outputs.gitlink_sha }}
|
||||
BUILD_VERSION: ${{ needs.metadata.outputs.build_version }}
|
||||
CORRELATION_ID: ${{ needs.metadata.outputs.correlation_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
gh api --method POST repos/fluxerapp/marketing/actions/workflows/build-marketing.yaml/dispatches \
|
||||
--field ref=main \
|
||||
--field "inputs[parent_sha]=$PARENT_SHA" \
|
||||
--field "inputs[gitlink_sha]=$GITLINK_SHA" \
|
||||
--field "inputs[build_version]=$BUILD_VERSION" \
|
||||
--field "inputs[correlation_id]=$CORRELATION_ID"
|
||||
|
||||
- name: Wait for private build conclusion
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.private-token.outputs.token }}
|
||||
PARENT_SHA: ${{ needs.metadata.outputs.parent_sha }}
|
||||
GITLINK_SHA: ${{ needs.metadata.outputs.gitlink_sha }}
|
||||
BUILD_VERSION: ${{ needs.metadata.outputs.build_version }}
|
||||
CORRELATION_ID: ${{ needs.metadata.outputs.correlation_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
expected_title="marketing-build correlation=$CORRELATION_ID parent=$PARENT_SHA gitlink=$GITLINK_SHA version=$BUILD_VERSION"
|
||||
deadline=$((SECONDS + 3600))
|
||||
run_id=""
|
||||
while (( SECONDS < deadline )); do
|
||||
runs="$(gh api "repos/fluxerapp/marketing/actions/workflows/build-marketing.yaml/runs?event=workflow_dispatch&per_page=100" --jq '[.workflow_runs[] | {id, event, display_title, status, conclusion}]')"
|
||||
matches="$(jq --arg title "$expected_title" '[.[] | select(.event == "workflow_dispatch" and .display_title == $title)]' <<<"$runs")"
|
||||
count="$(jq 'length' <<<"$matches")"
|
||||
if [[ "$count" == "1" ]]; then
|
||||
run_id="$(jq -r '.[0].id' <<<"$matches")"
|
||||
break
|
||||
fi
|
||||
if [[ "$count" != "0" ]]; then
|
||||
echo "::error::Private build correlation matched multiple workflow runs."
|
||||
exit 1
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
if [[ -z "$run_id" ]]; then
|
||||
echo "::error::Timed out waiting for the private build dispatch to appear."
|
||||
exit 1
|
||||
fi
|
||||
while (( SECONDS < deadline )); do
|
||||
runs="$(gh api "repos/fluxerapp/marketing/actions/workflows/build-marketing.yaml/runs?event=workflow_dispatch&per_page=100" --jq '[.workflow_runs[] | {id, event, display_title, status, conclusion}]')"
|
||||
matches="$(jq --arg title "$expected_title" '[.[] | select(.event == "workflow_dispatch" and .display_title == $title)]' <<<"$runs")"
|
||||
if [[ "$(jq 'length' <<<"$matches")" != "1" || "$(jq -r '.[0].id' <<<"$matches")" != "$run_id" ]]; then
|
||||
echo "::error::Private build correlation is missing or ambiguous."
|
||||
exit 1
|
||||
fi
|
||||
run="$(jq '.[0]' <<<"$matches")"
|
||||
status="$(jq -r '.status' <<<"$run")"
|
||||
conclusion="$(jq -r '.conclusion // empty' <<<"$run")"
|
||||
if [[ "$status" == "completed" ]]; then
|
||||
if [[ "$conclusion" != "success" ]]; then
|
||||
echo "::error::Private marketing build concluded with $conclusion."
|
||||
exit 1
|
||||
fi
|
||||
echo "Private marketing build completed successfully."
|
||||
exit 0
|
||||
fi
|
||||
sleep 15
|
||||
done
|
||||
echo "::error::Timed out waiting for the private marketing build."
|
||||
exit 1
|
||||
@@ -77,14 +77,14 @@ jobs:
|
||||
GH_TOKEN: ${{ steps.create-token.outputs.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ -z "$(git status --porcelain -- fluxer_app/src/features/i18n/locales packages/i18n/marketing packages/errors/src/i18n fluxer_api/pkgs/email/src/email_i18n fluxer_api/src/api/content_i18n)" ]]; then
|
||||
if [[ -z "$(git status --porcelain -- fluxer_app/src/features/i18n/locales packages/errors/src/i18n fluxer_api/pkgs/email/src/email_i18n fluxer_api/src/api/content_i18n)" ]]; then
|
||||
echo "No generated catalog changes."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git config user.name "fluxer-ci[bot]"
|
||||
git config user.email "${{ vars.FLUXER_CI_APP_USER_ID }}+fluxer-ci[bot]@users.noreply.github.com"
|
||||
git add fluxer_app/src/features/i18n/locales packages/i18n/marketing packages/errors/src/i18n fluxer_api/pkgs/email/src/email_i18n fluxer_api/src/api/content_i18n
|
||||
git add fluxer_app/src/features/i18n/locales packages/errors/src/i18n fluxer_api/pkgs/email/src/email_i18n fluxer_api/src/api/content_i18n
|
||||
git commit -m "i18n: compile Weblate catalogs"
|
||||
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||
git push origin "HEAD:$WEBLATE_BRANCH"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[submodule "fluxer_marketing"]
|
||||
path = fluxer_marketing
|
||||
url = https://github.com/fluxerapp/marketing.git
|
||||
update = none
|
||||
Generated
+17
-13
@@ -266,9 +266,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-rs"
|
||||
version = "1.16.3"
|
||||
version = "1.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f"
|
||||
checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e"
|
||||
dependencies = [
|
||||
"aws-lc-sys",
|
||||
"zeroize",
|
||||
@@ -276,14 +276,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-sys"
|
||||
version = "0.40.0"
|
||||
version = "0.45.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7"
|
||||
checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cmake",
|
||||
"dunce",
|
||||
"fs_extra",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1622,7 +1623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1815,6 +1816,7 @@ dependencies = [
|
||||
"http 1.4.2",
|
||||
"http-body 1.0.1",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"libc",
|
||||
"moka",
|
||||
"parking_lot",
|
||||
@@ -2011,6 +2013,7 @@ dependencies = [
|
||||
"axum",
|
||||
"base64",
|
||||
"fluxer_common",
|
||||
"futures-util",
|
||||
"hex",
|
||||
"rand 0.10.1",
|
||||
"reqwest",
|
||||
@@ -2039,6 +2042,7 @@ dependencies = [
|
||||
"reqwest",
|
||||
"serde_json",
|
||||
"sha2 0.11.0",
|
||||
"tempfile",
|
||||
"thiserror",
|
||||
"time",
|
||||
"tracing",
|
||||
@@ -3985,14 +3989,14 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.40"
|
||||
version = "0.23.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b"
|
||||
checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"log",
|
||||
@@ -4044,7 +4048,7 @@ dependencies = [
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"webpki-root-certs",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4055,9 +4059,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.103.13"
|
||||
version = "0.103.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
|
||||
checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"ring",
|
||||
@@ -4668,7 +4672,7 @@ dependencies = [
|
||||
"getrandom 0.4.2",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5536,7 +5540,7 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -18,7 +18,6 @@ members = [
|
||||
"fluxer_recon",
|
||||
]
|
||||
exclude = [
|
||||
"fluxer_marketing",
|
||||
"packages/markdown_parser/rust/fuzz",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
Vendored
-4
@@ -95,10 +95,6 @@ FLUXER_ADMIN_BASE_PATH=/admin
|
||||
FLUXER_ADMIN_SECRET_KEY_BASE=dev-admin-secret-key-base
|
||||
FLUXER_ADMIN_OAUTH_CLIENT_SECRET=dev-admin-oauth-secret
|
||||
FLUXER_ADMIN_OAUTH_REDIRECT_URI=http://localhost:8088/admin/oauth2_callback
|
||||
FLUXER_MARKETING_PORT=3010
|
||||
FLUXER_MARKETING_HOST=0.0.0.0
|
||||
FLUXER_MARKETING_BASE_PATH=/marketing
|
||||
FLUXER_MARKETING_SECRET_KEY_BASE=dev-marketing-secret-key-base
|
||||
|
||||
FLUXER_SUDO_MODE_SECRET=dev-sudo-secret
|
||||
FLUXER_CONNECTION_INITIATION_SECRET=dev-connection-initiation-secret
|
||||
|
||||
@@ -365,8 +365,9 @@ FLUXER_DISCOVERY_ENABLED=true
|
||||
# messages, 320 for snowflakes and 64 elsewhere, and they govern every service
|
||||
# Compose does not forward this to. A router holds a slot for the whole round
|
||||
# trip to its shard, so this is a ceiling on requests in flight at once and not a
|
||||
# rate: too low a value does not slow requests down, it rejects them, and the api
|
||||
# turns that rejection into a 503.
|
||||
# rate: too low a value does not slow requests down, it rejects them. The api
|
||||
# turns that rejection into a 503 and logs "shard rejected the request because
|
||||
# it is at its concurrency limit".
|
||||
#FLUXER_SVC_MAX_CONCURRENT_REQUESTS=192
|
||||
|
||||
# The api and the Rust services name their fixed Postgres statement shapes so the
|
||||
|
||||
@@ -38,9 +38,16 @@ fn generate_admin_api(manifest_dir: &Path, out_dir: &Path) {
|
||||
let mut spec: openapiv3::OpenAPI =
|
||||
serde_json::from_str(&json_str).expect("failed to parse openapi-admin.json");
|
||||
adapt_progenitor_throttled_errors(&mut spec);
|
||||
relax_guild_audit_log_schemas(&mut spec);
|
||||
relax_progenitor_schema_strictness(&mut spec);
|
||||
|
||||
let mut settings = progenitor::GenerationSettings::new();
|
||||
settings.with_interface(progenitor::InterfaceStyle::Positional);
|
||||
settings.with_inner_type(
|
||||
"reqwest::header::HeaderMap"
|
||||
.parse()
|
||||
.expect("valid generated client header type"),
|
||||
);
|
||||
|
||||
let mut generator = progenitor::Generator::new(&settings);
|
||||
let tokens = generator
|
||||
@@ -136,6 +143,305 @@ fn adapt_progenitor_throttled_errors(spec: &mut openapiv3::OpenAPI) {
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_guild_audit_log_schemas(spec: &mut openapiv3::OpenAPI) {
|
||||
let components = spec.components.as_mut().expect("missing API components");
|
||||
|
||||
let entry = object_schema_mut(components, "GuildAuditLogEntryResponse");
|
||||
entry.additional_properties = None;
|
||||
let openapiv3::ReferenceOr::Item(options) = entry
|
||||
.properties
|
||||
.get_mut("options")
|
||||
.expect("GuildAuditLogEntryResponse has no options property")
|
||||
else {
|
||||
panic!("GuildAuditLogEntryResponse options must be an inline schema");
|
||||
};
|
||||
let openapiv3::SchemaKind::Type(openapiv3::Type::Object(options)) = &mut options.schema_kind
|
||||
else {
|
||||
panic!("GuildAuditLogEntryResponse options must be an object schema");
|
||||
};
|
||||
options.additional_properties = None;
|
||||
|
||||
let change = object_schema_mut(components, "AuditLogChangeSchema");
|
||||
change.additional_properties = None;
|
||||
for property in ["old_value", "new_value"] {
|
||||
change.properties.insert(
|
||||
property.to_string(),
|
||||
openapiv3::ReferenceOr::Item(Box::new(openapiv3::Schema {
|
||||
schema_data: openapiv3::SchemaData::default(),
|
||||
schema_kind: openapiv3::SchemaKind::Any(openapiv3::AnySchema::default()),
|
||||
})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn object_schema_mut<'a>(
|
||||
components: &'a mut openapiv3::Components,
|
||||
name: &str,
|
||||
) -> &'a mut openapiv3::ObjectType {
|
||||
let Some(openapiv3::ReferenceOr::Item(schema)) = components.schemas.get_mut(name) else {
|
||||
panic!("missing inline {name} schema");
|
||||
};
|
||||
let openapiv3::SchemaKind::Type(openapiv3::Type::Object(object)) = &mut schema.schema_kind
|
||||
else {
|
||||
panic!("{name} must be an object schema");
|
||||
};
|
||||
object
|
||||
}
|
||||
|
||||
const MAX_SCHEMA_REFERENCE_DEPTH: usize = 32;
|
||||
|
||||
fn relax_progenitor_schema_strictness(spec: &mut openapiv3::OpenAPI) {
|
||||
let registry = spec.components.clone().unwrap_or_default();
|
||||
|
||||
if let Some(components) = spec.components.as_mut() {
|
||||
for schema in components.schemas.values_mut() {
|
||||
relax_schema_reference(schema, ®istry);
|
||||
}
|
||||
for response in components.responses.values_mut() {
|
||||
if let openapiv3::ReferenceOr::Item(response) = response {
|
||||
relax_response(response, ®istry);
|
||||
}
|
||||
}
|
||||
for parameter in components.parameters.values_mut() {
|
||||
if let openapiv3::ReferenceOr::Item(parameter) = parameter {
|
||||
relax_parameter(parameter, ®istry);
|
||||
}
|
||||
}
|
||||
for request_body in components.request_bodies.values_mut() {
|
||||
if let openapiv3::ReferenceOr::Item(request_body) = request_body {
|
||||
relax_content(&mut request_body.content, ®istry);
|
||||
}
|
||||
}
|
||||
for header in components.headers.values_mut() {
|
||||
if let openapiv3::ReferenceOr::Item(header) = header {
|
||||
relax_parameter_format(&mut header.format, ®istry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for path in spec.paths.paths.values_mut() {
|
||||
let openapiv3::ReferenceOr::Item(path) = path else {
|
||||
continue;
|
||||
};
|
||||
for parameter in &mut path.parameters {
|
||||
if let openapiv3::ReferenceOr::Item(parameter) = parameter {
|
||||
relax_parameter(parameter, ®istry);
|
||||
}
|
||||
}
|
||||
for operation in [
|
||||
&mut path.get,
|
||||
&mut path.put,
|
||||
&mut path.post,
|
||||
&mut path.delete,
|
||||
&mut path.options,
|
||||
&mut path.head,
|
||||
&mut path.patch,
|
||||
&mut path.trace,
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
{
|
||||
for parameter in &mut operation.parameters {
|
||||
if let openapiv3::ReferenceOr::Item(parameter) = parameter {
|
||||
relax_parameter(parameter, ®istry);
|
||||
}
|
||||
}
|
||||
if let Some(openapiv3::ReferenceOr::Item(request_body)) =
|
||||
operation.request_body.as_mut()
|
||||
{
|
||||
relax_content(&mut request_body.content, ®istry);
|
||||
}
|
||||
for response in operation
|
||||
.responses
|
||||
.responses
|
||||
.values_mut()
|
||||
.chain(operation.responses.default.iter_mut())
|
||||
{
|
||||
if let openapiv3::ReferenceOr::Item(response) = response {
|
||||
relax_response(response, ®istry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_response(response: &mut openapiv3::Response, registry: &openapiv3::Components) {
|
||||
relax_content(&mut response.content, registry);
|
||||
for header in response.headers.values_mut() {
|
||||
if let openapiv3::ReferenceOr::Item(header) = header {
|
||||
relax_parameter_format(&mut header.format, registry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_content(content: &mut openapiv3::Content, registry: &openapiv3::Components) {
|
||||
for media_type in content.values_mut() {
|
||||
if let Some(schema) = media_type.schema.as_mut() {
|
||||
relax_schema_reference(schema, registry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_parameter(parameter: &mut openapiv3::Parameter, registry: &openapiv3::Components) {
|
||||
let format = match parameter {
|
||||
openapiv3::Parameter::Query { parameter_data, .. }
|
||||
| openapiv3::Parameter::Header { parameter_data, .. }
|
||||
| openapiv3::Parameter::Path { parameter_data, .. }
|
||||
| openapiv3::Parameter::Cookie { parameter_data, .. } => &mut parameter_data.format,
|
||||
};
|
||||
relax_parameter_format(format, registry);
|
||||
}
|
||||
|
||||
fn relax_parameter_format(
|
||||
format: &mut openapiv3::ParameterSchemaOrContent,
|
||||
registry: &openapiv3::Components,
|
||||
) {
|
||||
match format {
|
||||
openapiv3::ParameterSchemaOrContent::Schema(schema) => {
|
||||
relax_schema_reference(schema, registry)
|
||||
}
|
||||
openapiv3::ParameterSchemaOrContent::Content(content) => relax_content(content, registry),
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_schema_reference(
|
||||
schema: &mut openapiv3::ReferenceOr<openapiv3::Schema>,
|
||||
registry: &openapiv3::Components,
|
||||
) {
|
||||
if let openapiv3::ReferenceOr::Item(schema) = schema {
|
||||
relax_schema(schema, registry);
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_boxed_schema_reference(
|
||||
schema: &mut openapiv3::ReferenceOr<Box<openapiv3::Schema>>,
|
||||
registry: &openapiv3::Components,
|
||||
) {
|
||||
if let openapiv3::ReferenceOr::Item(schema) = schema {
|
||||
relax_schema(schema, registry);
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_schema(schema: &mut openapiv3::Schema, registry: &openapiv3::Components) {
|
||||
if flattens_objects_beside_scalars(&schema.schema_kind, registry) {
|
||||
schema.schema_kind = openapiv3::SchemaKind::Any(openapiv3::AnySchema::default());
|
||||
return;
|
||||
}
|
||||
match &mut schema.schema_kind {
|
||||
openapiv3::SchemaKind::Type(openapiv3::Type::Object(object)) => {
|
||||
relax_additional_properties(&mut object.additional_properties, registry);
|
||||
for property in object.properties.values_mut() {
|
||||
relax_boxed_schema_reference(property, registry);
|
||||
}
|
||||
}
|
||||
openapiv3::SchemaKind::Type(openapiv3::Type::Array(array)) => {
|
||||
if let Some(items) = array.items.as_mut() {
|
||||
relax_boxed_schema_reference(items, registry);
|
||||
}
|
||||
}
|
||||
openapiv3::SchemaKind::Type(_) => {}
|
||||
openapiv3::SchemaKind::OneOf { one_of: subschemas }
|
||||
| openapiv3::SchemaKind::AllOf { all_of: subschemas }
|
||||
| openapiv3::SchemaKind::AnyOf { any_of: subschemas } => {
|
||||
for subschema in subschemas {
|
||||
relax_schema_reference(subschema, registry);
|
||||
}
|
||||
}
|
||||
openapiv3::SchemaKind::Not { not } => relax_schema_reference(not, registry),
|
||||
openapiv3::SchemaKind::Any(any) => {
|
||||
relax_additional_properties(&mut any.additional_properties, registry);
|
||||
for property in any.properties.values_mut() {
|
||||
relax_boxed_schema_reference(property, registry);
|
||||
}
|
||||
if let Some(items) = any.items.as_mut() {
|
||||
relax_boxed_schema_reference(items, registry);
|
||||
}
|
||||
for subschema in any
|
||||
.one_of
|
||||
.iter_mut()
|
||||
.chain(any.all_of.iter_mut())
|
||||
.chain(any.any_of.iter_mut())
|
||||
{
|
||||
relax_schema_reference(subschema, registry);
|
||||
}
|
||||
if let Some(not) = any.not.as_mut() {
|
||||
relax_schema_reference(not, registry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn relax_additional_properties(
|
||||
additional_properties: &mut Option<openapiv3::AdditionalProperties>,
|
||||
registry: &openapiv3::Components,
|
||||
) {
|
||||
match additional_properties {
|
||||
Some(openapiv3::AdditionalProperties::Any(false)) => *additional_properties = None,
|
||||
Some(openapiv3::AdditionalProperties::Schema(schema)) => {
|
||||
relax_schema_reference(schema, registry)
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn flattens_objects_beside_scalars(
|
||||
schema_kind: &openapiv3::SchemaKind,
|
||||
registry: &openapiv3::Components,
|
||||
) -> bool {
|
||||
let subschemas = match schema_kind {
|
||||
openapiv3::SchemaKind::OneOf { one_of } => one_of,
|
||||
openapiv3::SchemaKind::AnyOf { any_of } => any_of,
|
||||
_ => return false,
|
||||
};
|
||||
let mut objects = false;
|
||||
let mut scalars = false;
|
||||
for subschema in subschemas {
|
||||
if resolves_to_object(subschema, registry, MAX_SCHEMA_REFERENCE_DEPTH) {
|
||||
objects = true;
|
||||
} else {
|
||||
scalars = true;
|
||||
}
|
||||
}
|
||||
objects && scalars
|
||||
}
|
||||
|
||||
fn resolves_to_object(
|
||||
schema: &openapiv3::ReferenceOr<openapiv3::Schema>,
|
||||
registry: &openapiv3::Components,
|
||||
depth: usize,
|
||||
) -> bool {
|
||||
let Some(depth) = depth.checked_sub(1) else {
|
||||
return false;
|
||||
};
|
||||
let schema = match schema {
|
||||
openapiv3::ReferenceOr::Reference { reference } => {
|
||||
let Some(target) = reference
|
||||
.strip_prefix("#/components/schemas/")
|
||||
.and_then(|name| registry.schemas.get(name))
|
||||
else {
|
||||
return false;
|
||||
};
|
||||
return resolves_to_object(target, registry, depth);
|
||||
}
|
||||
openapiv3::ReferenceOr::Item(schema) => schema,
|
||||
};
|
||||
match &schema.schema_kind {
|
||||
openapiv3::SchemaKind::Type(openapiv3::Type::Object(_)) => true,
|
||||
openapiv3::SchemaKind::Type(_) => false,
|
||||
openapiv3::SchemaKind::OneOf { one_of: subschemas }
|
||||
| openapiv3::SchemaKind::AllOf { all_of: subschemas }
|
||||
| openapiv3::SchemaKind::AnyOf { any_of: subschemas } => subschemas
|
||||
.iter()
|
||||
.any(|subschema| resolves_to_object(subschema, registry, depth)),
|
||||
openapiv3::SchemaKind::Not { .. } => false,
|
||||
openapiv3::SchemaKind::Any(any) => {
|
||||
any.typ.as_deref() == Some("object")
|
||||
|| !any.properties.is_empty()
|
||||
|| any.additional_properties.is_some()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Face {
|
||||
css_family: String,
|
||||
weight: u64,
|
||||
|
||||
@@ -1667,7 +1667,7 @@
|
||||
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
|
||||
}
|
||||
},
|
||||
"description": "Enqueue one background administrative job. The `task` discriminator selects both the body variant and the ACL evaluated for the request: `update_user_flags` needs bulk:update:user_flags, `update_suspicious_activity_flags` needs bulk:update:suspicious_activity, `update_guild_features` needs bulk:update:guild_features, `add_guild_members` needs bulk:add:guild_members, `schedule_user_deletion` needs bulk:delete:users, and `delete_user_messages` needs bulk:delete:user_messages. Returns a job_id immediately; observe progress at /admin/jobs/:job_id. Note: the schedule_user_deletion worker skips Stripe refunds, session termination, and identifier banning — apply those separately for high-risk accounts.",
|
||||
"description": "Enqueue one background administrative job. The `task` discriminator selects both the body variant and the ACL evaluated for the request: `update_user_flags` needs bulk:update:user_flags, `update_suspicious_activity_flags` needs bulk:update:suspicious_activity, `update_guild_features` needs bulk:update:guild_features, `add_guild_members` needs bulk:add:guild_members, `schedule_user_deletion` needs bulk:delete:users, and `delete_user_messages` needs bulk:delete:user_messages. Returns a job_id immediately; observe progress at /admin/jobs/:job_id.",
|
||||
"security": [{"adminApiKey": []}],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
@@ -10562,7 +10562,16 @@
|
||||
},
|
||||
"gateway_rollout": {"$ref": "#/components/schemas/GatewayRolloutConfigResponse"},
|
||||
"voice_noise_suppression": {"$ref": "#/components/schemas/VoiceNoiseSuppressionConfigResponse"},
|
||||
"guild_activity_log_presentation": {
|
||||
"$ref": "#/components/schemas/GuildActivityLogPresentationConfigResponse"
|
||||
},
|
||||
"experiment_delivery": {"$ref": "#/components/schemas/ExperimentDeliveryConfigResponse"},
|
||||
"message_hover_tracking": {"$ref": "#/components/schemas/MessageHoverTrackingConfigResponse"},
|
||||
"message_keyboard_focus": {"$ref": "#/components/schemas/MessageKeyboardFocusConfigResponse"},
|
||||
"blocked_message_groups": {"$ref": "#/components/schemas/BlockedMessageGroupsConfigResponse"},
|
||||
"expression_info_card": {"$ref": "#/components/schemas/ExpressionInfoCardConfigResponse"},
|
||||
"guild_header_collapse": {"$ref": "#/components/schemas/GuildHeaderCollapseConfigResponse"},
|
||||
"typing_indicator_rework": {"$ref": "#/components/schemas/TypingIndicatorReworkConfigResponse"},
|
||||
"registration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -10965,7 +10974,14 @@
|
||||
"sso",
|
||||
"gateway_rollout",
|
||||
"voice_noise_suppression",
|
||||
"guild_activity_log_presentation",
|
||||
"experiment_delivery",
|
||||
"message_hover_tracking",
|
||||
"message_keyboard_focus",
|
||||
"blocked_message_groups",
|
||||
"expression_info_card",
|
||||
"guild_header_collapse",
|
||||
"typing_indicator_rework",
|
||||
"registration",
|
||||
"self_hosted",
|
||||
"app_public",
|
||||
@@ -11099,10 +11115,38 @@
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/VoiceNoiseSuppressionConfigUpdateRequest"}]
|
||||
},
|
||||
"guild_activity_log_presentation": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/GuildActivityLogPresentationConfigUpdateRequest"}]
|
||||
},
|
||||
"experiment_delivery": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/ExperimentDeliveryConfigUpdateRequest"}]
|
||||
},
|
||||
"message_hover_tracking": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/MessageHoverTrackingConfigUpdateRequest"}]
|
||||
},
|
||||
"message_keyboard_focus": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/MessageKeyboardFocusConfigUpdateRequest"}]
|
||||
},
|
||||
"blocked_message_groups": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/BlockedMessageGroupsConfigUpdateRequest"}]
|
||||
},
|
||||
"expression_info_card": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/ExpressionInfoCardConfigUpdateRequest"}]
|
||||
},
|
||||
"guild_header_collapse": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/GuildHeaderCollapseConfigUpdateRequest"}]
|
||||
},
|
||||
"typing_indicator_rework": {
|
||||
"nullable": true,
|
||||
"allOf": [{"$ref": "#/components/schemas/TypingIndicatorReworkConfigUpdateRequest"}]
|
||||
},
|
||||
"registration": {
|
||||
"nullable": true,
|
||||
"type": "object",
|
||||
@@ -11859,7 +11903,39 @@
|
||||
},
|
||||
"process_count": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"process_limit": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"uptime_seconds": {"$ref": "#/components/schemas/Int32Type"}
|
||||
"uptime_seconds": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"cluster_metrics": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"gateway_cluster_member_count": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"gateway_cluster_discovery_resolve_failures_total": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"gateway_cluster_membership_transitions_total": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"up": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"down": {"$ref": "#/components/schemas/Int32Type"}
|
||||
},
|
||||
"required": ["up", "down"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"gateway_node_router_owner_resolutions_total": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"self": {"$ref": "#/components/schemas/Int32Type"},
|
||||
"peer": {"$ref": "#/components/schemas/Int32Type"}
|
||||
},
|
||||
"required": ["self", "peer"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"gateway_cluster_member_count",
|
||||
"gateway_cluster_discovery_resolve_failures_total",
|
||||
"gateway_cluster_membership_transitions_total",
|
||||
"gateway_node_router_owner_resolutions_total"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"node_id",
|
||||
@@ -14885,7 +14961,10 @@
|
||||
"nullable": true,
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {"description": "The reason provided for the action", "type": "string"},
|
||||
"reason": {
|
||||
"description": "The audit log reason. For bans and timeouts without an X-Audit-Log-Reason header this is the reason sent in the request body",
|
||||
"type": "string"
|
||||
},
|
||||
"options": {
|
||||
"description": "Additional options depending on action type",
|
||||
"type": "object",
|
||||
@@ -14893,15 +14972,22 @@
|
||||
"channel_id": {"description": "Channel ID for relevant actions", "type": "string"},
|
||||
"count": {"description": "Count of items affected", "type": "number"},
|
||||
"delete_member_days": {
|
||||
"description": "Number of days of messages to delete on member ban",
|
||||
"description": "Deprecated. Whole days of messages deleted, written only by bans recorded before delete_message_seconds",
|
||||
"type": "string"
|
||||
},
|
||||
"delete_message_seconds": {
|
||||
"description": "Seconds of the banned user's messages that the ban deleted, present only when positive",
|
||||
"type": "number"
|
||||
},
|
||||
"id": {"description": "ID of the affected entity", "type": "string"},
|
||||
"integration_type": {"description": "Type of integration", "type": "number"},
|
||||
"message_id": {"description": "Message ID for relevant actions", "type": "string"},
|
||||
"members_removed": {"description": "Number of members removed", "type": "number"},
|
||||
"role_name": {"description": "Name of the role", "type": "string"},
|
||||
"type": {"description": "Type identifier", "type": "number"},
|
||||
"role_name": {"description": "Name of the role when the entry was written", "type": "string"},
|
||||
"type": {
|
||||
"description": "Channel type for CHANNEL_CREATE, CHANNEL_UPDATE and CHANNEL_DELETE. Overwrite target type (0 role, 1 member) for CHANNEL_OVERWRITE_*",
|
||||
"type": "number"
|
||||
},
|
||||
"inviter_id": {"description": "ID of the user who created the invite", "type": "string"},
|
||||
"max_age": {"description": "Maximum age of the invite in seconds", "type": "number"},
|
||||
"max_uses": {"description": "Maximum number of uses for the invite", "type": "number"},
|
||||
@@ -15127,6 +15213,114 @@
|
||||
"enum": ["open", "approval", "closed"],
|
||||
"type": "string"
|
||||
},
|
||||
"TypingIndicatorReworkConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"GuildHeaderCollapseConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ExpressionInfoCardConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"BlockedMessageGroupsConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"MessageKeyboardFocusConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"MessageHoverTrackingConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ExperimentDeliveryConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -15134,6 +15328,24 @@
|
||||
"poll_jitter_percent": {"type": "integer", "minimum": 0, "maximum": 50}
|
||||
}
|
||||
},
|
||||
"GuildActivityLogPresentationConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean"},
|
||||
"rollout_basis_points": {"type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"VoiceNoiseSuppressionConfigUpdateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -15191,6 +15403,186 @@
|
||||
"type": "string",
|
||||
"enum": ["none", "standard", "gate", "speex", "rnnoise", "gtcrn", "deep_filter"]
|
||||
},
|
||||
"TypingIndicatorReworkConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"default": "typing-indicator-rework-v1", "type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"GuildHeaderCollapseConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"default": "guild-header-collapse-v1", "type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ExpressionInfoCardConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"default": "expression-info-card-v1", "type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"BlockedMessageGroupsConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"default": "blocked-message-groups-v1", "type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"MessageKeyboardFocusConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"default": "message-keyboard-focus-v1", "type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"MessageHoverTrackingConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {"default": "message-hover-tracking-v1", "type": "string", "minLength": 1, "maxLength": 64},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ExperimentDeliveryConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -15200,6 +15592,41 @@
|
||||
"required": ["poll_interval_seconds", "poll_jitter_percent"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"GuildActivityLogPresentationConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {"default": false, "type": "boolean"},
|
||||
"config_version": {"default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991},
|
||||
"rollout_basis_points": {"default": 0, "type": "integer", "minimum": 0, "maximum": 10000},
|
||||
"rollout_salt": {
|
||||
"default": "guild-activity-log-presentation-v1",
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 64
|
||||
},
|
||||
"included_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
},
|
||||
"excluded_user_ids": {
|
||||
"default": [],
|
||||
"maxItems": 1000,
|
||||
"type": "array",
|
||||
"items": {"type": "string", "pattern": "^\\d{1,20}$"}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled",
|
||||
"config_version",
|
||||
"rollout_basis_points",
|
||||
"rollout_salt",
|
||||
"included_user_ids",
|
||||
"excluded_user_ids"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"VoiceNoiseSuppressionConfigResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -13,7 +13,7 @@ pub struct SearchAuditLogsParams {
|
||||
pub sort_by: Option<String>,
|
||||
pub sort_order: Option<String>,
|
||||
pub limit: u32,
|
||||
pub offset: u32,
|
||||
pub offset: u64,
|
||||
}
|
||||
|
||||
impl AdminApiClient {
|
||||
|
||||
+104
-59
@@ -6,7 +6,7 @@ use super::client::{AdminApiClient, ApiError, ApiResult};
|
||||
use super::types::{BanAvatarResult, BanCheckResult, BulkBanResult};
|
||||
|
||||
impl AdminApiClient {
|
||||
pub async fn ban_email(&self, email: &str) -> ApiResult<()> {
|
||||
pub async fn ban_email(&self, email: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
"email",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
@@ -15,50 +15,63 @@ impl AdminApiClient {
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_email(&self, email: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("email", email, None).await
|
||||
pub async fn unban_email(&self, email: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("email", email, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn check_email_ban(&self, email: &str) -> ApiResult<BanCheckResult> {
|
||||
self.check_blocklist_entry("email", email, None).await
|
||||
}
|
||||
|
||||
pub async fn ban_ip(&self, ip: &str) -> ApiResult<()> {
|
||||
pub async fn ban_ip(&self, ip: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
"ip",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
subtype_0: Some(generated_types::BanIpRequest { ip: ip.to_owned() }),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_ip(&self, ip: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("ip", ip, None).await
|
||||
pub async fn unban_ip(&self, ip: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("ip", ip, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn check_ip_ban(&self, ip: &str) -> ApiResult<BanCheckResult> {
|
||||
self.check_blocklist_entry("ip", ip, None).await
|
||||
}
|
||||
|
||||
pub async fn add_suspicious_email_domain(&self, domain: &str) -> ApiResult<()> {
|
||||
pub async fn add_suspicious_email_domain(
|
||||
&self,
|
||||
domain: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
SUSPICIOUS_EMAIL_DOMAIN_LIST,
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
subtype_2: Some(suspicious_email_domain_request(domain)?),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn remove_suspicious_email_domain(&self, domain: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry(SUSPICIOUS_EMAIL_DOMAIN_LIST, domain, None)
|
||||
pub async fn remove_suspicious_email_domain(
|
||||
&self,
|
||||
domain: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry(SUSPICIOUS_EMAIL_DOMAIN_LIST, domain, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -67,7 +80,7 @@ impl AdminApiClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn ban_phrase(&self, phrase: &str) -> ApiResult<()> {
|
||||
pub async fn ban_phrase(&self, phrase: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
"phrase",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
@@ -76,19 +89,25 @@ impl AdminApiClient {
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_phrase(&self, phrase: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("phrase", phrase, None).await
|
||||
pub async fn unban_phrase(
|
||||
&self,
|
||||
phrase: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("phrase", phrase, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn check_phrase_ban(&self, phrase: &str) -> ApiResult<BanCheckResult> {
|
||||
self.check_blocklist_entry("phrase", phrase, None).await
|
||||
}
|
||||
|
||||
pub async fn ban_url(&self, url: &str) -> ApiResult<()> {
|
||||
pub async fn ban_url(&self, url: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
"url",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
@@ -101,19 +120,26 @@ impl AdminApiClient {
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_url(&self, url: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("url", url, None).await
|
||||
pub async fn unban_url(&self, url: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("url", url, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn check_url_ban(&self, url: &str) -> ApiResult<BanCheckResult> {
|
||||
self.check_blocklist_entry("url", url, None).await
|
||||
}
|
||||
|
||||
pub async fn ban_url_domain(&self, domain: &str, match_subdomains: bool) -> ApiResult<()> {
|
||||
pub async fn ban_url_domain(
|
||||
&self,
|
||||
domain: &str,
|
||||
match_subdomains: bool,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
"url-domain",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
@@ -127,12 +153,17 @@ impl AdminApiClient {
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_url_domain(&self, domain: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("url-domain", domain, None)
|
||||
pub async fn unban_url_domain(
|
||||
&self,
|
||||
domain: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("url-domain", domain, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -145,20 +176,19 @@ impl AdminApiClient {
|
||||
sha256_hex: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
let body = generated_types::AdminBlocklistEntryCreateRequest {
|
||||
subtype_6: Some(generated_types::BanFileShaRequest {
|
||||
category: None,
|
||||
content_type: None,
|
||||
notes: None,
|
||||
severity: None,
|
||||
sha256_hex: sha256_hex.to_owned(),
|
||||
source_url: None,
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
self.post_void_with_reason(
|
||||
"/admin/blocklists/file-sha/entries",
|
||||
Some(&serde_json::to_value(&body).map_err(|e| ApiError::Parse(e.to_string()))?),
|
||||
self.create_blocklist_entry(
|
||||
"file-sha",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
subtype_6: Some(generated_types::BanFileShaRequest {
|
||||
category: None,
|
||||
content_type: None,
|
||||
notes: None,
|
||||
severity: None,
|
||||
sha256_hex: sha256_hex.to_owned(),
|
||||
source_url: None,
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
@@ -169,12 +199,8 @@ impl AdminApiClient {
|
||||
sha256_hex: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.delete_void_with_reason(
|
||||
&blocklist_entry_path("file-sha", sha256_hex),
|
||||
None,
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
self.delete_blocklist_entry("file-sha", sha256_hex, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn check_file_sha_ban(&self, sha256_hex: &str) -> ApiResult<BanCheckResult> {
|
||||
@@ -198,7 +224,11 @@ impl AdminApiClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn ban_avatar_hash(&self, hash_short: &str) -> ApiResult<()> {
|
||||
pub async fn ban_avatar_hash(
|
||||
&self,
|
||||
hash_short: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
"avatar-hash",
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
@@ -212,12 +242,17 @@ impl AdminApiClient {
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_avatar_hash(&self, hash_short: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("avatar-hash", hash_short, None)
|
||||
pub async fn unban_avatar_hash(
|
||||
&self,
|
||||
hash_short: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry("avatar-hash", hash_short, None, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -236,20 +271,36 @@ impl AdminApiClient {
|
||||
self.generated_value(response.into_inner())
|
||||
}
|
||||
|
||||
pub async fn ban_profile_substring(&self, scope: &str, substring: &str) -> ApiResult<()> {
|
||||
pub async fn ban_profile_substring(
|
||||
&self,
|
||||
scope: &str,
|
||||
substring: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.create_blocklist_entry(
|
||||
PROFILE_SUBSTRING_LIST,
|
||||
generated_types::AdminBlocklistEntryCreateRequest {
|
||||
subtype_8: Some(profile_substring_request(scope, substring)?),
|
||||
..Default::default()
|
||||
},
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn unban_profile_substring(&self, scope: &str, substring: &str) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry(PROFILE_SUBSTRING_LIST, substring, Some(scope))
|
||||
.await
|
||||
pub async fn unban_profile_substring(
|
||||
&self,
|
||||
scope: &str,
|
||||
substring: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
self.delete_blocklist_entry(
|
||||
PROFILE_SUBSTRING_LIST,
|
||||
substring,
|
||||
Some(scope),
|
||||
audit_log_reason,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn check_profile_substring_ban(
|
||||
@@ -265,13 +316,14 @@ impl AdminApiClient {
|
||||
&self,
|
||||
list_type: &str,
|
||||
body: generated_types::AdminBlocklistEntryCreateRequest,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
let list_type = blocklist_list_type(list_type)?;
|
||||
self.generated()
|
||||
self.generated_with_reason(audit_log_reason)?
|
||||
.create_admin_blocklist_entry(list_type, &body)
|
||||
.await
|
||||
.map_err(|e| self.generated_error(e))?;
|
||||
Ok(())
|
||||
.map(drop)
|
||||
.map_err(|error| self.generated_error(error))
|
||||
}
|
||||
|
||||
async fn delete_blocklist_entry(
|
||||
@@ -279,14 +331,15 @@ impl AdminApiClient {
|
||||
list_type: &str,
|
||||
entry_value: &str,
|
||||
scope: Option<&str>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
let list_type = blocklist_list_type(list_type)?;
|
||||
let scope = scope.map(blocklist_delete_scope).transpose()?;
|
||||
self.generated()
|
||||
self.generated_with_reason(audit_log_reason)?
|
||||
.delete_admin_blocklist_entry(list_type, entry_value, scope)
|
||||
.await
|
||||
.map_err(|e| self.generated_error(e))?;
|
||||
Ok(())
|
||||
.map(drop)
|
||||
.map_err(|error| self.generated_error(error))
|
||||
}
|
||||
|
||||
async fn check_blocklist_entry(
|
||||
@@ -315,14 +368,6 @@ fn blocklist_list_type(list_type: &str) -> ApiResult<generated_types::AdminBlock
|
||||
.map_err(|e| ApiError::Parse(e.to_string()))
|
||||
}
|
||||
|
||||
fn blocklist_entry_path(list_type: &str, entry_value: &str) -> String {
|
||||
format!(
|
||||
"/admin/blocklists/{}/entries/{}",
|
||||
urlencoding::encode(list_type),
|
||||
urlencoding::encode(entry_value)
|
||||
)
|
||||
}
|
||||
|
||||
fn blocklist_get_scope(scope: &str) -> ApiResult<generated_types::GetAdminBlocklistEntryScope> {
|
||||
generated_types::GetAdminBlocklistEntryScope::try_from(scope)
|
||||
.map_err(|e| ApiError::Parse(e.to_string()))
|
||||
|
||||
+104
-89
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
use crate::api::generated::GeneratedClient;
|
||||
use crate::{config::AdminConfig, session::Session};
|
||||
use progenitor_client::ClientInfo;
|
||||
use reqwest::header::{AUTHORIZATION, HeaderMap, HeaderName, HeaderValue};
|
||||
use reqwest::{Method, RequestBuilder};
|
||||
use serde::Serialize;
|
||||
@@ -34,46 +36,39 @@ impl<T> ApiResultExt<T> for ApiResult<T> {
|
||||
}
|
||||
|
||||
pub struct AdminApiClient {
|
||||
http_client: reqwest::Client,
|
||||
generated: crate::api::generated::GeneratedClient,
|
||||
base_url: String,
|
||||
access_token: String,
|
||||
proxy_client_ip_headers: HeaderMap,
|
||||
generated: GeneratedClient,
|
||||
}
|
||||
|
||||
impl AdminApiClient {
|
||||
pub fn new(http_client: &reqwest::Client, config: &AdminConfig, session: &Session) -> Self {
|
||||
let generated_http_client = build_generated_http_client(config, session);
|
||||
let generated = crate::api::generated::GeneratedClient::new_with_client(
|
||||
let generated = GeneratedClient::new_with_client(
|
||||
&config.api_endpoint,
|
||||
generated_http_client,
|
||||
http_client.clone(),
|
||||
build_session_headers(config, session),
|
||||
);
|
||||
Self {
|
||||
http_client: http_client.clone(),
|
||||
generated,
|
||||
base_url: config.api_endpoint.clone(),
|
||||
access_token: session.access_token.clone(),
|
||||
proxy_client_ip_headers: build_proxy_client_ip_headers(config),
|
||||
}
|
||||
Self { generated }
|
||||
}
|
||||
|
||||
fn build_url(&self, path: &str, query_params: Option<&[(&str, &str)]>) -> String {
|
||||
let base = format!("{}{}", self.base_url, path);
|
||||
match query_params {
|
||||
None => base,
|
||||
Some(params) => {
|
||||
let filtered: Vec<_> = params.iter().filter(|(_, v)| !v.is_empty()).collect();
|
||||
if filtered.is_empty() {
|
||||
return base;
|
||||
}
|
||||
let query = filtered
|
||||
.iter()
|
||||
.map(|(k, v)| format!("{}={}", urlencoding::encode(k), urlencoding::encode(v)))
|
||||
.collect::<Vec<_>>()
|
||||
.join("&");
|
||||
format!("{base}?{query}")
|
||||
}
|
||||
let mut url = format!("{}{}", self.generated.baseurl(), path);
|
||||
let query = query_params
|
||||
.unwrap_or_default()
|
||||
.iter()
|
||||
.filter(|(_, value)| !value.is_empty())
|
||||
.map(|(key, value)| {
|
||||
format!(
|
||||
"{}={}",
|
||||
urlencoding::encode(key),
|
||||
urlencoding::encode(value)
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("&");
|
||||
if !query.is_empty() {
|
||||
url.push('?');
|
||||
url.push_str(&query);
|
||||
}
|
||||
url
|
||||
}
|
||||
|
||||
fn request(
|
||||
@@ -81,30 +76,26 @@ impl AdminApiClient {
|
||||
method: Method,
|
||||
path: &str,
|
||||
query_params: Option<&[(&str, &str)]>,
|
||||
) -> RequestBuilder {
|
||||
let url = self.build_url(path, query_params);
|
||||
self.http_client
|
||||
.request(method, &url)
|
||||
.header("Authorization", format!("Bearer {}", self.access_token))
|
||||
.header("Content-Type", "application/json")
|
||||
.headers(self.proxy_client_ip_headers.clone())
|
||||
}
|
||||
|
||||
fn with_audit_log_reason(
|
||||
builder: RequestBuilder,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> RequestBuilder {
|
||||
match audit_log_reason {
|
||||
Some(reason) => builder.header("X-Audit-Log-Reason", reason),
|
||||
None => builder,
|
||||
}
|
||||
) -> ApiResult<RequestBuilder> {
|
||||
let url = self.build_url(path, query_params);
|
||||
Ok(self
|
||||
.generated
|
||||
.client()
|
||||
.request(method, &url)
|
||||
.header("Content-Type", "application/json")
|
||||
.headers(self.headers_with_reason(audit_log_reason)?))
|
||||
}
|
||||
|
||||
fn with_json_body(builder: RequestBuilder, body: Option<&serde_json::Value>) -> RequestBuilder {
|
||||
match body {
|
||||
Some(body) => builder.json(body),
|
||||
None => builder,
|
||||
fn headers_with_reason(&self, audit_log_reason: Option<&str>) -> ApiResult<HeaderMap> {
|
||||
let mut headers = self.generated.inner().clone();
|
||||
if let Some(reason) = audit_log_reason {
|
||||
let mut value = HeaderValue::from_str(reason)
|
||||
.map_err(|_| ApiError::Parse("invalid audit log reason header".to_owned()))?;
|
||||
value.set_sensitive(true);
|
||||
headers.insert("x-audit-log-reason", value);
|
||||
}
|
||||
Ok(headers)
|
||||
}
|
||||
|
||||
async fn send_request(builder: RequestBuilder) -> ApiResult<reqwest::Response> {
|
||||
@@ -114,12 +105,28 @@ impl AdminApiClient {
|
||||
.map_err(|e| ApiError::Network(e.to_string()))
|
||||
}
|
||||
|
||||
async fn send_json<B: Serialize + ?Sized>(
|
||||
&self,
|
||||
method: Method,
|
||||
path: &str,
|
||||
body: Option<&B>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<reqwest::Response> {
|
||||
let builder = self.request(method, path, None, audit_log_reason)?;
|
||||
let builder = match body {
|
||||
Some(body) => builder.json(body),
|
||||
None => builder,
|
||||
};
|
||||
Self::send_request(builder).await
|
||||
}
|
||||
|
||||
pub async fn get<T: DeserializeOwned>(
|
||||
&self,
|
||||
path: &str,
|
||||
query_params: Option<&[(&str, &str)]>,
|
||||
) -> ApiResult<T> {
|
||||
let response = Self::send_request(self.request(Method::GET, path, query_params)).await?;
|
||||
let response =
|
||||
Self::send_request(self.request(Method::GET, path, query_params, None)?).await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -149,9 +156,9 @@ impl AdminApiClient {
|
||||
T: DeserializeOwned,
|
||||
B: Serialize + ?Sized,
|
||||
{
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::POST, path, None), audit_log_reason);
|
||||
let response = Self::send_request(builder.json(body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::POST, path, Some(body), audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -161,9 +168,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<T> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::POST, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::POST, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -177,9 +184,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::POST, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::POST, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_void_response(response).await
|
||||
}
|
||||
|
||||
@@ -197,9 +204,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<T> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::PATCH, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::PATCH, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -213,9 +220,9 @@ impl AdminApiClient {
|
||||
T: DeserializeOwned,
|
||||
B: Serialize + ?Sized,
|
||||
{
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::PATCH, path, None), audit_log_reason);
|
||||
let response = Self::send_request(builder.json(body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::PATCH, path, Some(body), audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -225,9 +232,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<T> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::PUT, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::PUT, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -241,9 +248,9 @@ impl AdminApiClient {
|
||||
T: DeserializeOwned,
|
||||
B: Serialize + ?Sized,
|
||||
{
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::PUT, path, None), audit_log_reason);
|
||||
let response = Self::send_request(builder.json(body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::PUT, path, Some(body), audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -253,9 +260,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::PUT, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::PUT, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_void_response(response).await
|
||||
}
|
||||
|
||||
@@ -269,9 +276,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<()> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::DELETE, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::DELETE, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_void_response(response).await
|
||||
}
|
||||
|
||||
@@ -281,9 +288,9 @@ impl AdminApiClient {
|
||||
body: Option<&serde_json::Value>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<T> {
|
||||
let builder =
|
||||
Self::with_audit_log_reason(self.request(Method::DELETE, path, None), audit_log_reason);
|
||||
let response = Self::send_request(Self::with_json_body(builder, body)).await?;
|
||||
let response = self
|
||||
.send_json(Method::DELETE, path, body, audit_log_reason)
|
||||
.await?;
|
||||
Self::parse_response(response).await
|
||||
}
|
||||
|
||||
@@ -302,10 +309,21 @@ impl AdminApiClient {
|
||||
Err(ApiError::Http { status, message })
|
||||
}
|
||||
|
||||
pub(crate) fn generated(&self) -> &crate::api::generated::GeneratedClient {
|
||||
pub(crate) fn generated(&self) -> &GeneratedClient {
|
||||
&self.generated
|
||||
}
|
||||
|
||||
pub(crate) fn generated_with_reason(
|
||||
&self,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<GeneratedClient> {
|
||||
Ok(GeneratedClient::new_with_client(
|
||||
self.generated.baseurl(),
|
||||
self.generated.client().clone(),
|
||||
self.headers_with_reason(audit_log_reason)?,
|
||||
))
|
||||
}
|
||||
|
||||
pub(crate) fn generated_value<T, U>(&self, value: U) -> ApiResult<T>
|
||||
where
|
||||
T: DeserializeOwned,
|
||||
@@ -346,17 +364,14 @@ impl AdminApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
fn build_generated_http_client(config: &AdminConfig, session: &Session) -> reqwest::Client {
|
||||
fn build_session_headers(config: &AdminConfig, session: &Session) -> HeaderMap {
|
||||
let mut headers = HeaderMap::new();
|
||||
let auth_value = HeaderValue::from_str(&format!("Bearer {}", session.access_token))
|
||||
let mut auth_value = HeaderValue::from_str(&format!("Bearer {}", session.access_token))
|
||||
.expect("failed to build generated API Authorization header");
|
||||
auth_value.set_sensitive(true);
|
||||
headers.insert(AUTHORIZATION, auth_value);
|
||||
headers.extend(build_proxy_client_ip_headers(config));
|
||||
reqwest::Client::builder()
|
||||
.user_agent(format!("FluxerAdmin/{} (Rust)", config.build_version))
|
||||
.default_headers(headers)
|
||||
.build()
|
||||
.expect("failed to create generated API HTTP client")
|
||||
headers
|
||||
}
|
||||
|
||||
pub(crate) fn with_proxy_client_ip_header(
|
||||
|
||||
@@ -9,7 +9,7 @@ impl AdminApiClient {
|
||||
pub async fn generate_gift_codes(
|
||||
&self,
|
||||
count: u32,
|
||||
duration_type: &str,
|
||||
duration_type: generated_types::GiftCodeDurationTypeSchema,
|
||||
duration_quantity: u32,
|
||||
) -> ApiResult<CodesResponse> {
|
||||
let body = generated_types::GenerateGiftCodesRequest {
|
||||
@@ -22,8 +22,7 @@ impl AdminApiClient {
|
||||
)
|
||||
.map_err(ApiError::Parse)?
|
||||
.into(),
|
||||
duration_type: generated_types::GiftCodeDurationTypeSchema::try_from(duration_type)
|
||||
.map_err(|e| ApiError::Parse(e.to_string()))?,
|
||||
duration_type,
|
||||
};
|
||||
let response = self
|
||||
.generated()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
use progenitor_client::{ClientHooks, ClientInfo, Error, OperationInfo};
|
||||
use reqwest::header::HeaderMap;
|
||||
|
||||
#[allow(
|
||||
clippy::all,
|
||||
unused_imports,
|
||||
@@ -16,6 +19,20 @@ pub use inner::types;
|
||||
|
||||
pub use inner::Client as GeneratedClient;
|
||||
|
||||
impl ClientHooks<HeaderMap> for GeneratedClient {
|
||||
async fn pre<E>(
|
||||
&self,
|
||||
request: &mut reqwest::Request,
|
||||
_info: &OperationInfo,
|
||||
) -> Result<(), Error<E>> {
|
||||
let headers = request.headers_mut();
|
||||
for (name, value) in self.inner() {
|
||||
headers.entry(name.clone()).or_insert_with(|| value.clone());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn snowflake(value: &str) -> types::SnowflakeType {
|
||||
types::SnowflakeType::Variant0(value.to_owned())
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ impl AdminApiClient {
|
||||
&self,
|
||||
query: &str,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
offset: u64,
|
||||
) -> ApiResult<SearchGuildsResponse> {
|
||||
let limit = limit.to_string();
|
||||
let offset = offset.to_string();
|
||||
@@ -97,7 +97,7 @@ impl AdminApiClient {
|
||||
&self,
|
||||
guild_id: &str,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
offset: u64,
|
||||
) -> ApiResult<ListGuildMembersResponse> {
|
||||
let limit = limit.to_string();
|
||||
let offset = offset.to_string();
|
||||
@@ -252,7 +252,7 @@ impl AdminApiClient {
|
||||
&self,
|
||||
guild_id: &str,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
offset: u64,
|
||||
) -> ApiResult<SearchReportsResponse> {
|
||||
self.search_reports(&SearchReportsParams {
|
||||
reported_guild_id: Some(guild_id),
|
||||
|
||||
@@ -24,9 +24,9 @@ impl AdminApiClient {
|
||||
let max_lookback_days = params.max_lookback_days.to_string();
|
||||
let query_params = [
|
||||
("limit", limit.as_str()),
|
||||
("cursor_bucket_day", cursor_bucket_day.as_str()),
|
||||
("cursor_created_at", cursor_created_at.as_str()),
|
||||
("cursor_job_id", cursor_job_id.as_str()),
|
||||
("cursor_bucket_day", cursor_bucket_day),
|
||||
("cursor_created_at", cursor_created_at),
|
||||
("cursor_job_id", cursor_job_id),
|
||||
("max_lookback_days", max_lookback_days.as_str()),
|
||||
("status", params.status.as_deref().unwrap_or_default()),
|
||||
("task_type", params.task_type.as_deref().unwrap_or_default()),
|
||||
@@ -70,10 +70,9 @@ impl AdminApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
fn cursor_field(cursor: Option<&serde_json::Value>, field: &str) -> String {
|
||||
fn cursor_field<'a>(cursor: Option<&'a serde_json::Value>, field: &str) -> &'a str {
|
||||
cursor
|
||||
.and_then(|cursor| cursor.get(field))
|
||||
.and_then(serde_json::Value::as_str)
|
||||
.unwrap_or_default()
|
||||
.to_owned()
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ pub struct SearchReportsParams<'a> {
|
||||
pub sort_by: Option<&'a str>,
|
||||
pub sort_order: Option<&'a str>,
|
||||
pub limit: u32,
|
||||
pub offset: u32,
|
||||
pub offset: u64,
|
||||
}
|
||||
|
||||
impl AdminApiClient {
|
||||
@@ -129,7 +129,7 @@ impl AdminApiClient {
|
||||
&self,
|
||||
reporter_id: &str,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
offset: u64,
|
||||
) -> ApiResult<SearchReportsResponse> {
|
||||
self.search_reports(&SearchReportsParams {
|
||||
reporter_id: Some(reporter_id),
|
||||
@@ -144,7 +144,7 @@ impl AdminApiClient {
|
||||
&self,
|
||||
reported_user_id: &str,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
offset: u64,
|
||||
) -> ApiResult<SearchReportsResponse> {
|
||||
self.search_reports(&SearchReportsParams {
|
||||
reported_user_id: Some(reported_user_id),
|
||||
|
||||
@@ -6,8 +6,14 @@ pub fn deserialize_discriminator<'de, D: Deserializer<'de>>(d: D) -> Result<Stri
|
||||
let v: serde_json::Value = Deserialize::deserialize(d)?;
|
||||
match v {
|
||||
serde_json::Value::String(s) => Ok(format!("{:0>4}", s)),
|
||||
serde_json::Value::Number(n) => Ok(format!("{:04}", n.as_u64().unwrap_or(0))),
|
||||
_ => Ok("0000".to_owned()),
|
||||
serde_json::Value::Number(n) => n
|
||||
.as_u64()
|
||||
.map(|value| format!("{value:04}"))
|
||||
.ok_or_else(|| serde::de::Error::custom("expected an unsigned integer discriminator")),
|
||||
serde_json::Value::Null => Ok("0000".to_owned()),
|
||||
_ => Err(serde::de::Error::custom(
|
||||
"expected string or unsigned integer discriminator",
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +21,9 @@ pub fn deserialize_string_or_u64<'de, D: Deserializer<'de>>(d: D) -> Result<u64,
|
||||
let v: serde_json::Value = Deserialize::deserialize(d)?;
|
||||
match v {
|
||||
serde_json::Value::String(s) => s.parse::<u64>().map_err(serde::de::Error::custom),
|
||||
serde_json::Value::Number(n) => Ok(n.as_u64().unwrap_or(0)),
|
||||
serde_json::Value::Number(n) => n
|
||||
.as_u64()
|
||||
.ok_or_else(|| serde::de::Error::custom("expected an unsigned 64-bit integer")),
|
||||
serde_json::Value::Null => Ok(0),
|
||||
_ => Err(serde::de::Error::custom("expected string or number")),
|
||||
}
|
||||
|
||||
@@ -24,6 +24,20 @@ pub struct InstanceConfigResponse {
|
||||
pub voice_noise_suppression: VoiceNoiseSuppressionConfigResponse,
|
||||
#[serde(default)]
|
||||
pub experiment_delivery: ExperimentDeliveryConfigResponse,
|
||||
#[serde(default)]
|
||||
pub message_hover_tracking: MessageHoverTrackingConfigResponse,
|
||||
#[serde(default)]
|
||||
pub message_keyboard_focus: MessageKeyboardFocusConfigResponse,
|
||||
#[serde(default)]
|
||||
pub blocked_message_groups: BlockedMessageGroupsConfigResponse,
|
||||
#[serde(default)]
|
||||
pub guild_activity_log_presentation: GuildActivityLogPresentationConfigResponse,
|
||||
#[serde(default)]
|
||||
pub expression_info_card: ExpressionInfoCardConfigResponse,
|
||||
#[serde(default)]
|
||||
pub guild_header_collapse: GuildHeaderCollapseConfigResponse,
|
||||
#[serde(default)]
|
||||
pub typing_indicator_rework: TypingIndicatorReworkConfigResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
@@ -537,6 +551,272 @@ pub struct VoiceNoiseSuppressionConfigUpdateRequest {
|
||||
pub suppression_strength: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct MessageHoverTrackingConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for MessageHoverTrackingConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "message-hover-tracking-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct MessageHoverTrackingConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct MessageKeyboardFocusConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for MessageKeyboardFocusConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "message-keyboard-focus-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct MessageKeyboardFocusConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct BlockedMessageGroupsConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for BlockedMessageGroupsConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "blocked-message-groups-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct BlockedMessageGroupsConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct GuildActivityLogPresentationConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for GuildActivityLogPresentationConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "guild-activity-log-presentation-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct GuildActivityLogPresentationConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct ExpressionInfoCardConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for ExpressionInfoCardConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "expression-info-card-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct ExpressionInfoCardConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct GuildHeaderCollapseConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for GuildHeaderCollapseConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "guild-header-collapse-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct GuildHeaderCollapseConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct TypingIndicatorReworkConfigResponse {
|
||||
pub enabled: bool,
|
||||
pub config_version: u64,
|
||||
pub rollout_basis_points: u32,
|
||||
pub rollout_salt: String,
|
||||
pub included_user_ids: Vec<String>,
|
||||
pub excluded_user_ids: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for TypingIndicatorReworkConfigResponse {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
config_version: 0,
|
||||
rollout_basis_points: 0,
|
||||
rollout_salt: "typing-indicator-rework-v1".to_owned(),
|
||||
included_user_ids: Vec::new(),
|
||||
excluded_user_ids: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct TypingIndicatorReworkConfigUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_basis_points: Option<u32>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rollout_salt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub included_user_ids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub excluded_user_ids: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct ExperimentDeliveryConfigResponse {
|
||||
@@ -654,6 +934,20 @@ pub struct InstanceConfigUpdateRequest {
|
||||
pub voice_noise_suppression: Option<VoiceNoiseSuppressionConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub experiment_delivery: Option<ExperimentDeliveryConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub message_hover_tracking: Option<MessageHoverTrackingConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub message_keyboard_focus: Option<MessageKeyboardFocusConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blocked_message_groups: Option<BlockedMessageGroupsConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub guild_activity_log_presentation: Option<GuildActivityLogPresentationConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub expression_info_card: Option<ExpressionInfoCardConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub guild_header_collapse: Option<GuildHeaderCollapseConfigUpdateRequest>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub typing_indicator_rework: Option<TypingIndicatorReworkConfigUpdateRequest>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
@@ -988,12 +1282,62 @@ mod tests {
|
||||
.expect("default noise config");
|
||||
let delivery = serde_json::from_value::<ExperimentDeliveryConfigResponse>(json!({}))
|
||||
.expect("default delivery config");
|
||||
let hover = serde_json::from_value::<MessageHoverTrackingConfigResponse>(json!({}))
|
||||
.expect("default message hover tracking config");
|
||||
let keyboard = serde_json::from_value::<MessageKeyboardFocusConfigResponse>(json!({}))
|
||||
.expect("default message keyboard focus config");
|
||||
let blocked = serde_json::from_value::<BlockedMessageGroupsConfigResponse>(json!({}))
|
||||
.expect("default blocked message groups config");
|
||||
let activity_log =
|
||||
serde_json::from_value::<GuildActivityLogPresentationConfigResponse>(json!({}))
|
||||
.expect("default guild activity log presentation config");
|
||||
let expression = serde_json::from_value::<ExpressionInfoCardConfigResponse>(json!({}))
|
||||
.expect("default expression info card config");
|
||||
let collapse = serde_json::from_value::<GuildHeaderCollapseConfigResponse>(json!({}))
|
||||
.expect("default guild header collapse config");
|
||||
let typing = serde_json::from_value::<TypingIndicatorReworkConfigResponse>(json!({}))
|
||||
.expect("default typing indicator rework config");
|
||||
let noise = serde_json::to_value(noise).expect("serializable noise config");
|
||||
let delivery = serde_json::to_value(delivery).expect("serializable delivery config");
|
||||
let hover =
|
||||
serde_json::to_value(hover).expect("serializable message hover tracking config");
|
||||
let keyboard =
|
||||
serde_json::to_value(keyboard).expect("serializable message keyboard focus config");
|
||||
let blocked =
|
||||
serde_json::to_value(blocked).expect("serializable blocked message groups config");
|
||||
let activity_log = serde_json::to_value(activity_log)
|
||||
.expect("serializable guild activity log presentation config");
|
||||
let expression =
|
||||
serde_json::to_value(expression).expect("serializable expression info card config");
|
||||
let collapse =
|
||||
serde_json::to_value(collapse).expect("serializable guild header collapse config");
|
||||
let typing =
|
||||
serde_json::to_value(typing).expect("serializable typing indicator rework config");
|
||||
let generated_noise: generated_types::VoiceNoiseSuppressionConfigResponse =
|
||||
serde_json::from_value(noise.clone()).expect("generated noise config contract");
|
||||
let generated_delivery: generated_types::ExperimentDeliveryConfigResponse =
|
||||
serde_json::from_value(delivery.clone()).expect("generated delivery config contract");
|
||||
let generated_hover: generated_types::MessageHoverTrackingConfigResponse =
|
||||
serde_json::from_value(hover.clone())
|
||||
.expect("generated message hover tracking config contract");
|
||||
let generated_keyboard: generated_types::MessageKeyboardFocusConfigResponse =
|
||||
serde_json::from_value(keyboard.clone())
|
||||
.expect("generated message keyboard focus config contract");
|
||||
let generated_blocked: generated_types::BlockedMessageGroupsConfigResponse =
|
||||
serde_json::from_value(blocked.clone())
|
||||
.expect("generated blocked message groups config contract");
|
||||
let generated_activity_log: generated_types::GuildActivityLogPresentationConfigResponse =
|
||||
serde_json::from_value(activity_log.clone())
|
||||
.expect("generated guild activity log presentation config contract");
|
||||
let generated_expression: generated_types::ExpressionInfoCardConfigResponse =
|
||||
serde_json::from_value(expression.clone())
|
||||
.expect("generated expression info card config contract");
|
||||
let generated_collapse: generated_types::GuildHeaderCollapseConfigResponse =
|
||||
serde_json::from_value(collapse.clone())
|
||||
.expect("generated guild header collapse config contract");
|
||||
let generated_typing: generated_types::TypingIndicatorReworkConfigResponse =
|
||||
serde_json::from_value(typing.clone())
|
||||
.expect("generated typing indicator rework config contract");
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_noise).expect("serializable generated noise config"),
|
||||
noise
|
||||
@@ -1003,9 +1347,51 @@ mod tests {
|
||||
.expect("serializable generated delivery config"),
|
||||
delivery
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_hover)
|
||||
.expect("serializable generated message hover tracking config"),
|
||||
hover
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_keyboard)
|
||||
.expect("serializable generated message keyboard focus config"),
|
||||
keyboard
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_blocked)
|
||||
.expect("serializable generated blocked message groups config"),
|
||||
blocked
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_activity_log)
|
||||
.expect("serializable generated guild activity log presentation config"),
|
||||
activity_log
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_expression)
|
||||
.expect("serializable generated expression info card config"),
|
||||
expression
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_collapse)
|
||||
.expect("serializable generated guild header collapse config"),
|
||||
collapse
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(generated_typing)
|
||||
.expect("serializable generated typing indicator rework config"),
|
||||
typing
|
||||
);
|
||||
for (name, value) in [
|
||||
("VoiceNoiseSuppressionConfigResponse", noise),
|
||||
("ExperimentDeliveryConfigResponse", delivery),
|
||||
("MessageHoverTrackingConfigResponse", hover),
|
||||
("MessageKeyboardFocusConfigResponse", keyboard),
|
||||
("BlockedMessageGroupsConfigResponse", blocked),
|
||||
("GuildActivityLogPresentationConfigResponse", activity_log),
|
||||
("ExpressionInfoCardConfigResponse", expression),
|
||||
("GuildHeaderCollapseConfigResponse", collapse),
|
||||
("TypingIndicatorReworkConfigResponse", typing),
|
||||
] {
|
||||
for (field, value) in value.as_object().expect("config object") {
|
||||
assert_eq!(
|
||||
@@ -1016,6 +1402,231 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_client_accepts_unknown_response_fields() {
|
||||
const GENERATED_CLIENT: &str =
|
||||
include_str!(concat!(env!("OUT_DIR"), "/admin_api_generated.rs"));
|
||||
assert!(
|
||||
!GENERATED_CLIENT.contains("deny_unknown_fields"),
|
||||
"fluxer_admin/build.rs must clear additionalProperties so a new API field cannot \
|
||||
blank an admin page"
|
||||
);
|
||||
let mut section = serde_json::to_value(ExpressionInfoCardConfigResponse::default())
|
||||
.expect("serializable expression info card config");
|
||||
section
|
||||
.as_object_mut()
|
||||
.expect("expression info card object")
|
||||
.insert("future_knob".to_owned(), json!(7));
|
||||
serde_json::from_value::<generated_types::ExpressionInfoCardConfigResponse>(section)
|
||||
.expect("generated instance config section tolerates unknown fields");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_audit_log_change_accepts_scalar_and_object_values() {
|
||||
for value in [json!("old"), json!(7), json!(true), json!(null)] {
|
||||
let change = serde_json::from_value::<generated_types::AuditLogChangeSchema>(
|
||||
json!({"key": "name", "old_value": value, "new_value": {"added": [], "removed": []}}),
|
||||
)
|
||||
.expect("generated audit log change tolerates scalar values");
|
||||
assert_eq!(change.key, "name");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn expression_info_card_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = ExpressionInfoCardConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::ExpressionInfoCardConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(ExpressionInfoCardConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guild_header_collapse_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = GuildHeaderCollapseConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::GuildHeaderCollapseConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(GuildHeaderCollapseConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guild_header_collapse_response_defaults_to_the_guild_header_collapse_v1_salt() {
|
||||
let config = GuildHeaderCollapseConfigResponse::default();
|
||||
assert!(!config.enabled);
|
||||
assert_eq!(config.config_version, 0);
|
||||
assert_eq!(config.rollout_basis_points, 0);
|
||||
assert_eq!(config.rollout_salt, "guild-header-collapse-v1");
|
||||
assert!(config.included_user_ids.is_empty());
|
||||
assert!(config.excluded_user_ids.is_empty());
|
||||
assert_eq!(
|
||||
serde_json::from_value::<GuildHeaderCollapseConfigResponse>(json!({}))
|
||||
.expect("default guild header collapse config")
|
||||
.rollout_salt,
|
||||
"guild-header-collapse-v1"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn typing_indicator_rework_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = TypingIndicatorReworkConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::TypingIndicatorReworkConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(TypingIndicatorReworkConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn typing_indicator_rework_response_defaults_to_the_typing_indicator_rework_v1_salt() {
|
||||
let config = TypingIndicatorReworkConfigResponse::default();
|
||||
assert!(!config.enabled);
|
||||
assert_eq!(config.config_version, 0);
|
||||
assert_eq!(config.rollout_basis_points, 0);
|
||||
assert_eq!(config.rollout_salt, "typing-indicator-rework-v1");
|
||||
assert!(config.included_user_ids.is_empty());
|
||||
assert!(config.excluded_user_ids.is_empty());
|
||||
assert_eq!(
|
||||
serde_json::from_value::<TypingIndicatorReworkConfigResponse>(json!({}))
|
||||
.expect("default typing indicator rework config")
|
||||
.rollout_salt,
|
||||
"typing-indicator-rework-v1"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn message_hover_tracking_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = MessageHoverTrackingConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::MessageHoverTrackingConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(MessageHoverTrackingConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn message_keyboard_focus_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = MessageKeyboardFocusConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::MessageKeyboardFocusConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(MessageKeyboardFocusConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blocked_message_groups_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = BlockedMessageGroupsConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::BlockedMessageGroupsConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(BlockedMessageGroupsConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guild_activity_log_presentation_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = GuildActivityLogPresentationConfigUpdateRequest {
|
||||
included_user_ids: Some(Vec::new()),
|
||||
excluded_user_ids: Some(Vec::new()),
|
||||
..Default::default()
|
||||
};
|
||||
let value = serde_json::to_value(update).expect("serializable update");
|
||||
serde_json::from_value::<generated_types::GuildActivityLogPresentationConfigUpdateRequest>(
|
||||
value.clone(),
|
||||
)
|
||||
.expect("generated update contract");
|
||||
assert_eq!(
|
||||
value,
|
||||
json!({"included_user_ids": [], "excluded_user_ids": []})
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(GuildActivityLogPresentationConfigUpdateRequest::default())
|
||||
.expect("serializable update"),
|
||||
json!({})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn noise_suppression_update_preserves_empty_lists_and_omitted_fields() {
|
||||
let update = VoiceNoiseSuppressionConfigUpdateRequest {
|
||||
|
||||
@@ -15,7 +15,7 @@ impl AdminApiClient {
|
||||
email: Option<&str>,
|
||||
last_active_ip: Option<&str>,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
offset: u64,
|
||||
) -> ApiResult<SearchUsersResponse> {
|
||||
let limit = limit.to_string();
|
||||
let offset = offset.to_string();
|
||||
@@ -35,7 +35,8 @@ impl AdminApiClient {
|
||||
let response = response.into_inner();
|
||||
Ok(SearchUsersResponse {
|
||||
users: self.generated_value(response.users)?,
|
||||
total: response.total as u64,
|
||||
total: crate::api::generated::number_to_u64(response.total, "total")
|
||||
.map_err(ApiError::Parse)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -426,6 +427,7 @@ impl AdminApiClient {
|
||||
reason_code: i32,
|
||||
public_reason: Option<&str>,
|
||||
days_until_deletion: u32,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> ApiResult<AdminUser> {
|
||||
let body = generated_types::AdminUserDeletionScheduleRequest {
|
||||
days_until_deletion: crate::api::generated::nonzero_u32(
|
||||
@@ -439,10 +441,10 @@ impl AdminApiClient {
|
||||
.map_err(ApiError::Parse)?,
|
||||
};
|
||||
let response = self
|
||||
.generated()
|
||||
.generated_with_reason(audit_log_reason)?
|
||||
.schedule_admin_user_deletion(&snowflake(user_id), &body)
|
||||
.await
|
||||
.map_err(|e| self.generated_error(e))?;
|
||||
.map_err(|error| self.generated_error(error))?;
|
||||
let resp: UserMutationResponse = self.generated_value(response.into_inner())?;
|
||||
Ok(resp.user)
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ async fn admin_api_keys_post(
|
||||
"create" => {
|
||||
let name = form.clean("name").unwrap_or_default();
|
||||
let acls = form.list_values_any(&["acls[]", "acls"]);
|
||||
return match client.create_api_key(&name, &acls).await {
|
||||
match client.create_api_key(&name, &acls).await {
|
||||
Ok(created) => {
|
||||
let keys = client
|
||||
.list_api_keys()
|
||||
@@ -107,29 +107,38 @@ async fn admin_api_keys_post(
|
||||
is_htmx,
|
||||
)
|
||||
}
|
||||
};
|
||||
}
|
||||
"revoke" => {
|
||||
if let Some(key_id) = form.clean("key_id") {
|
||||
let result = client.revoke_api_key(&key_id).await;
|
||||
let flash = match result.log_error("revoke API key") {
|
||||
Some(_) => FlashData::success("API key revoked."),
|
||||
None => FlashData::error("Failed to revoke API key"),
|
||||
};
|
||||
return flash::redirect_with_flash(
|
||||
&format!("{base}/admin-api-keys"),
|
||||
flash,
|
||||
config.secure_cookies(),
|
||||
);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
"revoke" => {
|
||||
let Some(key_id) = form.clean("key_id") else {
|
||||
return admin_api_key_flash_response(
|
||||
config,
|
||||
FlashData::error("API key ID is required"),
|
||||
is_htmx,
|
||||
);
|
||||
};
|
||||
let result = client.revoke_api_key(&key_id).await;
|
||||
let flash = match result.log_error("revoke API key") {
|
||||
Some(_) => FlashData::success("API key revoked."),
|
||||
None => FlashData::error("Failed to revoke API key"),
|
||||
};
|
||||
flash::redirect_with_flash(
|
||||
&format!("{base}/admin-api-keys"),
|
||||
flash,
|
||||
config.secure_cookies(),
|
||||
)
|
||||
}
|
||||
"" => admin_api_key_flash_response(
|
||||
config,
|
||||
FlashData::error("API key action is required"),
|
||||
is_htmx,
|
||||
),
|
||||
_ => admin_api_key_flash_response(
|
||||
config,
|
||||
FlashData::error("Unknown API key action"),
|
||||
is_htmx,
|
||||
),
|
||||
}
|
||||
flash::redirect_with_flash(
|
||||
&format!("{base}/admin-api-keys"),
|
||||
FlashData::success(format!("API key action '{action}' completed.")),
|
||||
config.secure_cookies(),
|
||||
)
|
||||
}
|
||||
|
||||
fn admin_api_key_flash_response(
|
||||
|
||||
@@ -16,7 +16,7 @@ use axum::{
|
||||
|
||||
use super::ActionQuery;
|
||||
use super::bans_actions::{
|
||||
BanFormData, custom_flash, execute_ban, extract_value, flash_response, htmx_flash,
|
||||
BanFormData, custom_flash, execute_ban, extract_value, flash_response, render_inline_flash,
|
||||
};
|
||||
|
||||
pub fn router() -> Router<AppState> {
|
||||
@@ -105,7 +105,7 @@ async fn generic_ban_post(
|
||||
form.audit_log_reason.as_deref(),
|
||||
)
|
||||
.await;
|
||||
flash_response(config, auth, is_htmx, &level, &msg, ban_cfg, csrf_token)
|
||||
flash_response(config, auth, is_htmx, level, &msg, ban_cfg, csrf_token)
|
||||
}
|
||||
|
||||
macro_rules! ban_post {
|
||||
@@ -171,19 +171,22 @@ async fn url_domain_bans_post(
|
||||
Query::try_from_uri(request.uri()).unwrap_or(Query(ActionQuery { action: None }));
|
||||
let form: BanFormData = match Form::from_request(request, &state).await {
|
||||
Ok(Form(f)) => f,
|
||||
Err(_) => return htmx_flash("error", "Invalid form data", &headers),
|
||||
Err(_) => return render_inline_flash("error", "Invalid form data"),
|
||||
};
|
||||
let is_htmx = htmx::is_htmx_request(&headers);
|
||||
let client = AdminApiClient::new(state.http_client(), config, &auth.0.session);
|
||||
let domain = form.domain.as_deref().unwrap_or("").trim().to_owned();
|
||||
if domain.is_empty() {
|
||||
return htmx_flash("error", "Domain is required", &headers);
|
||||
return render_inline_flash("error", "Domain is required");
|
||||
}
|
||||
let action = aq.action.as_deref().unwrap_or("");
|
||||
let (level, msg) = match action {
|
||||
"ban" => {
|
||||
let m_sub = form.match_subdomains.as_deref() == Some("true");
|
||||
match client.ban_url_domain(&domain, m_sub).await {
|
||||
match client
|
||||
.ban_url_domain(&domain, m_sub, form.audit_log_reason.as_deref())
|
||||
.await
|
||||
{
|
||||
Ok(()) => ("success", format!("Domain {domain} banned successfully")),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, domain, "admin API request failed: ban URL domain");
|
||||
@@ -191,7 +194,10 @@ async fn url_domain_bans_post(
|
||||
}
|
||||
}
|
||||
}
|
||||
"unban" => match client.unban_url_domain(&domain).await {
|
||||
"unban" => match client
|
||||
.unban_url_domain(&domain, form.audit_log_reason.as_deref())
|
||||
.await
|
||||
{
|
||||
Ok(()) => ("success", format!("Domain {domain} unbanned")),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, domain, "admin API request failed: unban URL domain");
|
||||
@@ -247,25 +253,31 @@ async fn profile_substring_bans_post(
|
||||
Query::try_from_uri(request.uri()).unwrap_or(Query(ActionQuery { action: None }));
|
||||
let form: BanFormData = match Form::from_request(request, &state).await {
|
||||
Ok(Form(f)) => f,
|
||||
Err(_) => return htmx_flash("error", "Invalid form data", &headers),
|
||||
Err(_) => return render_inline_flash("error", "Invalid form data"),
|
||||
};
|
||||
let is_htmx = htmx::is_htmx_request(&headers);
|
||||
let client = AdminApiClient::new(state.http_client(), config, &auth.0.session);
|
||||
let scope = form.scope.as_deref().unwrap_or("").trim().to_owned();
|
||||
let substring = form.substring.as_deref().unwrap_or("").trim().to_owned();
|
||||
if scope.is_empty() || substring.is_empty() {
|
||||
return htmx_flash("error", "Scope and substring required", &headers);
|
||||
return render_inline_flash("error", "Scope and substring required");
|
||||
}
|
||||
let action = aq.action.as_deref().unwrap_or("");
|
||||
let (level, msg) = match action {
|
||||
"ban" => match client.ban_profile_substring(&scope, &substring).await {
|
||||
"ban" => match client
|
||||
.ban_profile_substring(&scope, &substring, form.audit_log_reason.as_deref())
|
||||
.await
|
||||
{
|
||||
Ok(()) => ("success", format!("\"{substring}\" banned for {scope}")),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, scope, substring, "admin API request failed: ban profile substring");
|
||||
("error", format!("Failed to ban substring for {scope}"))
|
||||
}
|
||||
},
|
||||
"unban" => match client.unban_profile_substring(&scope, &substring).await {
|
||||
"unban" => match client
|
||||
.unban_profile_substring(&scope, &substring, form.audit_log_reason.as_deref())
|
||||
.await
|
||||
{
|
||||
Ok(()) => ("success", format!("\"{substring}\" unbanned for {scope}")),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, scope, substring, "admin API request failed: unban profile substring");
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
use crate::api::client::AdminApiClient;
|
||||
use crate::api::client::{AdminApiClient, ApiResult};
|
||||
use crate::api::types::{FlashLevel, FlashMessage};
|
||||
use crate::middleware::auth::AuthContext;
|
||||
use crate::templates;
|
||||
use axum::{
|
||||
http::HeaderMap,
|
||||
response::{Html, IntoResponse, Response},
|
||||
};
|
||||
use axum::response::{Html, IntoResponse, Response};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct BanFormData {
|
||||
#[serde(default)]
|
||||
pub ip: Option<String>,
|
||||
@@ -65,7 +61,7 @@ pub async fn execute_ban(
|
||||
bulk_hashes: Option<&str>,
|
||||
bulk_sha256_list: Option<&str>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> (String, String) {
|
||||
) -> (&'static str, String) {
|
||||
if (action == "bulk-ban" || action == "bulk-ban-files") && ban_type == "file-sha-bans" {
|
||||
let raw_hashes = if action == "bulk-ban-files" {
|
||||
bulk_sha256_list
|
||||
@@ -75,13 +71,13 @@ pub async fn execute_ban(
|
||||
return execute_bulk_ban(client, raw_hashes, audit_log_reason).await;
|
||||
}
|
||||
if value.is_empty() {
|
||||
return ("error".into(), "Value is required".into());
|
||||
return ("error", "Value is required".into());
|
||||
}
|
||||
match action {
|
||||
"ban" => execute_single_ban(client, ban_type, value, audit_log_reason).await,
|
||||
"unban" => execute_single_unban(client, ban_type, value, audit_log_reason).await,
|
||||
"check" => execute_check(client, ban_type, value).await,
|
||||
_ => ("error".into(), "Unknown action".into()),
|
||||
_ => ("error", "Unknown action".into()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +85,7 @@ async fn execute_bulk_ban(
|
||||
client: &AdminApiClient,
|
||||
bulk_hashes: Option<&str>,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> (String, String) {
|
||||
) -> (&'static str, String) {
|
||||
let hashes: Vec<String> = bulk_hashes
|
||||
.unwrap_or("")
|
||||
.split(|c: char| c.is_whitespace() || c == ',' || c == ';')
|
||||
@@ -98,18 +94,15 @@ async fn execute_bulk_ban(
|
||||
.collect();
|
||||
if hashes.is_empty() {
|
||||
return (
|
||||
"error".into(),
|
||||
"error",
|
||||
"No valid 64-character hex hashes found in input".into(),
|
||||
);
|
||||
}
|
||||
match client.bulk_ban_file_shas(&hashes, audit_log_reason).await {
|
||||
Ok(r) => (
|
||||
"success".into(),
|
||||
format!("Bulk ban job created: {}", r.job_id),
|
||||
),
|
||||
Ok(r) => ("success", format!("Bulk ban job created: {}", r.job_id)),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, "admin API request failed: bulk ban file SHAs");
|
||||
("error".into(), "Failed to enqueue bulk ban job".into())
|
||||
("error", "Failed to enqueue bulk ban job".into())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,29 +112,26 @@ async fn execute_single_ban(
|
||||
ban_type: &str,
|
||||
value: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> (String, String) {
|
||||
let success = format!("{value} banned successfully");
|
||||
let failure = format!("Failed to ban {value}");
|
||||
match ban_type {
|
||||
"ip-bans" => ban_action_result(client.ban_ip(value).await, success, failure),
|
||||
"email-bans" => ban_action_result(client.ban_email(value).await, success, failure),
|
||||
"suspicious-email-domains" => ban_action_result(
|
||||
client.add_suspicious_email_domain(value).await,
|
||||
success,
|
||||
failure,
|
||||
),
|
||||
"phrase-bans" => ban_action_result(client.ban_phrase(value).await, success, failure),
|
||||
"url-bans" => ban_action_result(client.ban_url(value).await, success, failure),
|
||||
"file-sha-bans" => ban_action_result(
|
||||
client.ban_file_sha(value, audit_log_reason).await,
|
||||
success,
|
||||
failure,
|
||||
),
|
||||
"avatar-hash-bans" => {
|
||||
ban_action_result(client.ban_avatar_hash(value).await, success, failure)
|
||||
) -> (&'static str, String) {
|
||||
let result = match ban_type {
|
||||
"ip-bans" => client.ban_ip(value, audit_log_reason).await,
|
||||
"email-bans" => client.ban_email(value, audit_log_reason).await,
|
||||
"suspicious-email-domains" => {
|
||||
client
|
||||
.add_suspicious_email_domain(value, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
_ => ("error".into(), "Unknown ban type".into()),
|
||||
}
|
||||
"phrase-bans" => client.ban_phrase(value, audit_log_reason).await,
|
||||
"url-bans" => client.ban_url(value, audit_log_reason).await,
|
||||
"file-sha-bans" => client.ban_file_sha(value, audit_log_reason).await,
|
||||
"avatar-hash-bans" => client.ban_avatar_hash(value, audit_log_reason).await,
|
||||
_ => return ("error", "Unknown ban type".into()),
|
||||
};
|
||||
ban_action_result(
|
||||
result,
|
||||
format!("{value} banned successfully"),
|
||||
format!("Failed to ban {value}"),
|
||||
)
|
||||
}
|
||||
|
||||
async fn execute_single_unban(
|
||||
@@ -149,32 +139,33 @@ async fn execute_single_unban(
|
||||
ban_type: &str,
|
||||
value: &str,
|
||||
audit_log_reason: Option<&str>,
|
||||
) -> (String, String) {
|
||||
let success = format!("{value} unbanned successfully");
|
||||
let failure = format!("Failed to unban {value}");
|
||||
match ban_type {
|
||||
"ip-bans" => ban_action_result(client.unban_ip(value).await, success, failure),
|
||||
"email-bans" => ban_action_result(client.unban_email(value).await, success, failure),
|
||||
"suspicious-email-domains" => ban_action_result(
|
||||
client.remove_suspicious_email_domain(value).await,
|
||||
success,
|
||||
failure,
|
||||
),
|
||||
"phrase-bans" => ban_action_result(client.unban_phrase(value).await, success, failure),
|
||||
"url-bans" => ban_action_result(client.unban_url(value).await, success, failure),
|
||||
"file-sha-bans" => ban_action_result(
|
||||
client.unban_file_sha(value, audit_log_reason).await,
|
||||
success,
|
||||
failure,
|
||||
),
|
||||
"avatar-hash-bans" => {
|
||||
ban_action_result(client.unban_avatar_hash(value).await, success, failure)
|
||||
) -> (&'static str, String) {
|
||||
let result = match ban_type {
|
||||
"ip-bans" => client.unban_ip(value, audit_log_reason).await,
|
||||
"email-bans" => client.unban_email(value, audit_log_reason).await,
|
||||
"suspicious-email-domains" => {
|
||||
client
|
||||
.remove_suspicious_email_domain(value, audit_log_reason)
|
||||
.await
|
||||
}
|
||||
_ => ("error".into(), "Unknown ban type".into()),
|
||||
}
|
||||
"phrase-bans" => client.unban_phrase(value, audit_log_reason).await,
|
||||
"url-bans" => client.unban_url(value, audit_log_reason).await,
|
||||
"file-sha-bans" => client.unban_file_sha(value, audit_log_reason).await,
|
||||
"avatar-hash-bans" => client.unban_avatar_hash(value, audit_log_reason).await,
|
||||
_ => return ("error", "Unknown ban type".into()),
|
||||
};
|
||||
ban_action_result(
|
||||
result,
|
||||
format!("{value} unbanned successfully"),
|
||||
format!("Failed to unban {value}"),
|
||||
)
|
||||
}
|
||||
|
||||
async fn execute_check(client: &AdminApiClient, ban_type: &str, value: &str) -> (String, String) {
|
||||
async fn execute_check(
|
||||
client: &AdminApiClient,
|
||||
ban_type: &str,
|
||||
value: &str,
|
||||
) -> (&'static str, String) {
|
||||
let result = match ban_type {
|
||||
"ip-bans" => client.check_ip_ban(value).await,
|
||||
"email-bans" => client.check_email_ban(value).await,
|
||||
@@ -183,28 +174,28 @@ async fn execute_check(client: &AdminApiClient, ban_type: &str, value: &str) ->
|
||||
"url-bans" => client.check_url_ban(value).await,
|
||||
"file-sha-bans" => client.check_file_sha_ban(value).await,
|
||||
"avatar-hash-bans" => client.check_avatar_hash_ban(value).await,
|
||||
_ => return ("error".into(), "Unknown ban type".into()),
|
||||
_ => return ("error", "Unknown ban type".into()),
|
||||
};
|
||||
match result {
|
||||
Ok(r) if r.banned => ("info".into(), format!("{value} is banned")),
|
||||
Ok(_) => ("info".into(), format!("{value} is NOT banned")),
|
||||
Ok(r) if r.banned => ("info", format!("{value} is banned")),
|
||||
Ok(_) => ("info", format!("{value} is NOT banned")),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, ban_type, value, "admin API request failed: check ban status");
|
||||
("error".into(), "Error checking ban status".into())
|
||||
("error", "Error checking ban status".into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn ban_action_result<T, E: std::fmt::Display>(
|
||||
result: Result<T, E>,
|
||||
fn ban_action_result(
|
||||
result: ApiResult<()>,
|
||||
success_message: String,
|
||||
error_message: String,
|
||||
) -> (String, String) {
|
||||
) -> (&'static str, String) {
|
||||
match result {
|
||||
Ok(_) => ("success".into(), success_message),
|
||||
Ok(()) => ("success", success_message),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, "admin API request failed: ban action");
|
||||
("error".into(), error_message)
|
||||
("error", error_message)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,11 +219,6 @@ pub fn flash_response(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn htmx_flash(level: &str, message: &str, headers: &HeaderMap) -> Response {
|
||||
let _ = headers;
|
||||
render_inline_flash(level, message)
|
||||
}
|
||||
|
||||
pub fn render_inline_flash(level: &str, message: &str) -> Response {
|
||||
let (border, bg, text) = match level {
|
||||
"success" => ("border-green-300", "bg-green-50", "text-green-800"),
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
use crate::{
|
||||
api::client::AdminApiClient,
|
||||
api::{client::AdminApiClient, generated::types::GiftCodeDurationTypeSchema},
|
||||
middleware::{
|
||||
auth::AuthContext,
|
||||
csrf::CsrfToken,
|
||||
flash::{self, FlashData},
|
||||
},
|
||||
state::AppState,
|
||||
templates,
|
||||
templates::{self, pages::gift_codes::MAX_GIFT_CODES},
|
||||
};
|
||||
use axum::{
|
||||
Form, Router,
|
||||
@@ -28,11 +28,11 @@ struct GiftCodesForm {
|
||||
#[serde(default)]
|
||||
_csrf: Option<String>,
|
||||
#[serde(default)]
|
||||
count: Option<String>,
|
||||
count: Option<u32>,
|
||||
#[serde(default)]
|
||||
duration_type: Option<String>,
|
||||
duration_type: Option<GiftCodeDurationTypeSchema>,
|
||||
#[serde(default)]
|
||||
duration_quantity: Option<String>,
|
||||
duration_quantity: Option<u32>,
|
||||
}
|
||||
|
||||
pub fn router() -> Router<AppState> {
|
||||
@@ -86,21 +86,17 @@ async fn gift_codes_post(
|
||||
);
|
||||
}
|
||||
};
|
||||
let count = form
|
||||
.count
|
||||
.as_deref()
|
||||
.and_then(|s| s.parse::<u32>().ok())
|
||||
.unwrap_or(1)
|
||||
.clamp(1, 100);
|
||||
let dur_type = form.duration_type.as_deref().unwrap_or("month");
|
||||
let dur_qty = form
|
||||
.duration_quantity
|
||||
.as_deref()
|
||||
.and_then(|s| s.parse::<u32>().ok())
|
||||
.unwrap_or(1);
|
||||
let count = form.count.unwrap_or(1).clamp(1, MAX_GIFT_CODES);
|
||||
let duration_type = form
|
||||
.duration_type
|
||||
.unwrap_or(GiftCodeDurationTypeSchema::Months);
|
||||
let duration_quantity = form.duration_quantity.unwrap_or(1);
|
||||
let client = AdminApiClient::new(state.http_client(), config, &auth.0.session);
|
||||
let secure_cookies = config.secure_cookies();
|
||||
match client.generate_gift_codes(count, dur_type, dur_qty).await {
|
||||
match client
|
||||
.generate_gift_codes(count, duration_type, duration_quantity)
|
||||
.await
|
||||
{
|
||||
Ok(result) => {
|
||||
let codes = result.codes.join(",");
|
||||
flash::redirect_with_flash(
|
||||
|
||||
@@ -43,7 +43,7 @@ pub async fn render(
|
||||
let page = query.members_page.unwrap_or(0);
|
||||
let limit: u32 = 50;
|
||||
let resp = client
|
||||
.list_guild_members(guild_id, limit, page * limit)
|
||||
.list_guild_members(guild_id, limit, u64::from(page) * u64::from(limit))
|
||||
.await
|
||||
.log_error("load guild members")?;
|
||||
Some(tabs::members::members_tab(
|
||||
@@ -57,7 +57,7 @@ pub async fn render(
|
||||
let page = query.reports_page.unwrap_or(0);
|
||||
let limit: u32 = 25;
|
||||
let resp = client
|
||||
.search_reports_by_guild(guild_id, limit, page * limit)
|
||||
.search_reports_by_guild(guild_id, limit, u64::from(page) * u64::from(limit))
|
||||
.await
|
||||
.log_error("load guild reports")?;
|
||||
Some(tabs::reports::reports_tab(
|
||||
|
||||
@@ -82,23 +82,19 @@ async fn guilds_list(
|
||||
}
|
||||
}
|
||||
}
|
||||
Some((guilds, Some(params.requested_ids.len() as u64), false))
|
||||
Some((guilds, params.requested_ids.len() as u64))
|
||||
} else if params.has_search() {
|
||||
let offset = params.page.saturating_mul(params.limit);
|
||||
let offset = u64::from(params.page) * u64::from(params.limit);
|
||||
client
|
||||
.search_guilds(params.search_query(), params.limit, offset)
|
||||
.await
|
||||
.log_error("search guilds")
|
||||
.map(|response| {
|
||||
let has_more = u64::from(offset) + (response.guilds.len() as u64) < response.total;
|
||||
(response.guilds, Some(response.total), has_more)
|
||||
})
|
||||
.map(|response| (response.guilds, response.total))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let result_guilds = results.as_ref().map(|result| result.0.as_slice());
|
||||
let total = results.as_ref().and_then(|result| result.1);
|
||||
let has_more = results.as_ref().is_some_and(|result| result.2);
|
||||
let total = results.as_ref().map(|result| result.1);
|
||||
|
||||
let markup = templates::pages::guilds_list::guilds_list_page(
|
||||
config,
|
||||
@@ -106,7 +102,6 @@ async fn guilds_list(
|
||||
¶ms,
|
||||
result_guilds,
|
||||
total,
|
||||
has_more,
|
||||
is_results_fragment,
|
||||
);
|
||||
Html(markup.into_string()).into_response()
|
||||
@@ -324,8 +319,12 @@ async fn dispatch_guild_action(
|
||||
"default_message_notifications",
|
||||
"disabled_operations",
|
||||
] {
|
||||
if let Some(v) = form.parse_i64(key) {
|
||||
settings.insert(key.to_string(), serde_json::json!(v));
|
||||
let value = match form.parse_value::<i64>(key) {
|
||||
Ok(value) => value,
|
||||
Err(_) => return FlashData::error(format!("Invalid {key} value")),
|
||||
};
|
||||
if let Some(value) = value {
|
||||
settings.insert(key.to_string(), serde_json::json!(value));
|
||||
}
|
||||
}
|
||||
if form.contains_key("nsfw_submitted") {
|
||||
@@ -356,11 +355,12 @@ async fn dispatch_guild_action(
|
||||
)
|
||||
}
|
||||
"update_disabled_operations" => {
|
||||
let disabled_operations = form
|
||||
.list_values_any(&["disabled_operations[]", "disabled_operations"])
|
||||
.iter()
|
||||
.filter_map(|value| value.parse::<i64>().ok())
|
||||
.fold(0_i64, |acc, value| acc | value);
|
||||
let Ok(operations) =
|
||||
form.parse_list_values::<i64>(&["disabled_operations[]", "disabled_operations"])
|
||||
else {
|
||||
return FlashData::error("Invalid disabled operation value");
|
||||
};
|
||||
let disabled_operations = operations.into_iter().fold(0_i64, |acc, value| acc | value);
|
||||
let settings = serde_json::json!({
|
||||
"disabled_operations": disabled_operations,
|
||||
});
|
||||
|
||||
@@ -21,7 +21,6 @@ use axum::{
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
struct JobsQuery {
|
||||
status: Option<String>,
|
||||
task_type: Option<String>,
|
||||
@@ -219,49 +218,36 @@ async fn job_detail_post(
|
||||
}
|
||||
|
||||
fn jobs_url(config: &crate::config::AdminConfig, query: &JobsQuery) -> String {
|
||||
let mut params = Vec::new();
|
||||
push_query(&mut params, "status", query.status.as_deref());
|
||||
push_query(&mut params, "task_type", query.task_type.as_deref());
|
||||
push_query(
|
||||
&mut params,
|
||||
"requested_by_user_id",
|
||||
query.requested_by_user_id.as_deref(),
|
||||
);
|
||||
push_query(
|
||||
&mut params,
|
||||
"max_lookback_days",
|
||||
query.max_lookback_days.as_deref(),
|
||||
);
|
||||
push_query(
|
||||
&mut params,
|
||||
"cursor_bucket_day",
|
||||
query.cursor_bucket_day.as_deref(),
|
||||
);
|
||||
push_query(
|
||||
&mut params,
|
||||
"cursor_created_at",
|
||||
query.cursor_created_at.as_deref(),
|
||||
);
|
||||
push_query(&mut params, "cursor_job_id", query.cursor_job_id.as_deref());
|
||||
if params.is_empty() {
|
||||
return format!("{}/jobs", config.base_path);
|
||||
}
|
||||
let query = params
|
||||
.iter()
|
||||
.map(|(key, value)| {
|
||||
format!(
|
||||
"{}={}",
|
||||
urlencoding::encode(key),
|
||||
urlencoding::encode(value)
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("&");
|
||||
format!("{}/jobs?{query}", config.base_path)
|
||||
}
|
||||
|
||||
fn push_query(params: &mut Vec<(String, String)>, key: &str, value: Option<&str>) {
|
||||
if let Some(value) = value.filter(|value| !value.is_empty()) {
|
||||
params.push((key.to_owned(), value.to_owned()));
|
||||
let query = [
|
||||
("status", query.status.as_deref()),
|
||||
("task_type", query.task_type.as_deref()),
|
||||
(
|
||||
"requested_by_user_id",
|
||||
query.requested_by_user_id.as_deref(),
|
||||
),
|
||||
("max_lookback_days", query.max_lookback_days.as_deref()),
|
||||
("cursor_bucket_day", query.cursor_bucket_day.as_deref()),
|
||||
("cursor_created_at", query.cursor_created_at.as_deref()),
|
||||
("cursor_job_id", query.cursor_job_id.as_deref()),
|
||||
]
|
||||
.into_iter()
|
||||
.filter_map(|(key, value)| {
|
||||
value
|
||||
.filter(|value| !value.is_empty())
|
||||
.map(|value| (key, value))
|
||||
})
|
||||
.map(|(key, value)| {
|
||||
format!(
|
||||
"{}={}",
|
||||
urlencoding::encode(key),
|
||||
urlencoding::encode(value)
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("&");
|
||||
if query.is_empty() {
|
||||
format!("{}/jobs", config.base_path)
|
||||
} else {
|
||||
format!("{}/jobs?{query}", config.base_path)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,53 +59,51 @@ pub(crate) async fn messages_post(
|
||||
match action {
|
||||
"lookup" => {
|
||||
let context_limit = parse_context_limit(form.first("context_limit"));
|
||||
return Redirect::to(&format!(
|
||||
Redirect::to(&format!(
|
||||
"{base}/messages?channel_id={}&message_id={}&context_limit={context_limit}",
|
||||
encode_opt(&channel_id),
|
||||
encode_opt(&message_id)
|
||||
))
|
||||
.into_response();
|
||||
.into_response()
|
||||
}
|
||||
"lookup-by-attachment" => {
|
||||
let attachment_id = form.clean("attachment_id");
|
||||
let filename = form.clean("filename");
|
||||
let context_limit = parse_context_limit(form.first("context_limit"));
|
||||
return Redirect::to(&format!(
|
||||
Redirect::to(&format!(
|
||||
"{base}/messages?channel_id={}&attachment_id={}&filename={}&context_limit={context_limit}",
|
||||
encode_opt(&channel_id),
|
||||
encode_opt(&attachment_id),
|
||||
encode_opt(&filename)
|
||||
))
|
||||
.into_response();
|
||||
}
|
||||
"browse" => {
|
||||
return Redirect::to(&format!(
|
||||
"{base}/messages?channel_id={}",
|
||||
encode_opt(&channel_id)
|
||||
))
|
||||
.into_response();
|
||||
.into_response()
|
||||
}
|
||||
"browse" => Redirect::to(&format!(
|
||||
"{base}/messages?channel_id={}",
|
||||
encode_opt(&channel_id)
|
||||
))
|
||||
.into_response(),
|
||||
"search" => {
|
||||
let search = form.clean("search");
|
||||
return Redirect::to(&format!(
|
||||
Redirect::to(&format!(
|
||||
"{base}/messages?channel_id={}&search={}",
|
||||
encode_opt(&channel_id),
|
||||
encode_opt(&search)
|
||||
))
|
||||
.into_response();
|
||||
.into_response()
|
||||
}
|
||||
"delete" => {
|
||||
let (Some(cid), Some(mid)) = (&channel_id, &message_id) else {
|
||||
return json_error(StatusCode::BAD_REQUEST, "Missing channel_id or message_id");
|
||||
};
|
||||
let audit_log_reason = form.clean("audit_log_reason");
|
||||
return match client
|
||||
match client
|
||||
.delete_message(cid, mid, audit_log_reason.as_deref())
|
||||
.await
|
||||
{
|
||||
Ok(()) => Json(serde_json::json!({"success": true})).into_response(),
|
||||
Err(e) => json_error(StatusCode::BAD_REQUEST, &format!("{e}")),
|
||||
};
|
||||
}
|
||||
}
|
||||
"report-to-ncmec" => {
|
||||
let attachment_id = form.clean("attachment_id");
|
||||
@@ -131,7 +129,7 @@ pub(crate) async fn messages_post(
|
||||
"Missing required NCMEC report fields",
|
||||
);
|
||||
}
|
||||
return match client
|
||||
match client
|
||||
.report_attachment_to_ncmec(
|
||||
cid,
|
||||
mid,
|
||||
@@ -144,11 +142,10 @@ pub(crate) async fn messages_post(
|
||||
{
|
||||
Ok(resp) => Json(resp.data).into_response(),
|
||||
Err(e) => json_error(StatusCode::BAD_REQUEST, &format!("{e}")),
|
||||
};
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
_ => Redirect::to(&format!("{base}/messages")).into_response(),
|
||||
}
|
||||
Redirect::to(&format!("{base}/messages")).into_response()
|
||||
}
|
||||
|
||||
pub(crate) async fn system_dms_post(
|
||||
@@ -253,14 +250,22 @@ pub(crate) async fn bulk_actions_post(
|
||||
}
|
||||
"bulk-schedule-user-deletion" | "bulk_delete_users" => {
|
||||
let user_ids = form.list_values_any(&["user_ids[]", "user_ids"]);
|
||||
let reason_code = form.parse_u32("reason_code").unwrap_or(2);
|
||||
let days = form.parse_u32("days_until_deletion").unwrap_or(14);
|
||||
let (Ok(reason_code), Ok(days)) = (
|
||||
form.parse_value::<u32>("reason_code"),
|
||||
form.parse_value::<u32>("days_until_deletion"),
|
||||
) else {
|
||||
return flash::redirect_with_flash(
|
||||
&format!("{base}/bulk-actions"),
|
||||
FlashData::error("Invalid deletion reason code or delay"),
|
||||
config.secure_cookies(),
|
||||
);
|
||||
};
|
||||
let public_reason = form.clean("public_reason");
|
||||
client
|
||||
.bulk_schedule_user_deletion(
|
||||
&user_ids,
|
||||
reason_code,
|
||||
days,
|
||||
reason_code.unwrap_or(2),
|
||||
days.unwrap_or(14),
|
||||
public_reason.as_deref(),
|
||||
audit_log_reason.as_deref(),
|
||||
)
|
||||
@@ -357,7 +362,7 @@ pub(crate) async fn messages_browse_fragment(
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_context_limit(value: Option<&str>) -> u32 {
|
||||
pub(super) fn parse_context_limit(value: Option<&str>) -> u32 {
|
||||
value
|
||||
.and_then(|s| s.parse::<u32>().ok())
|
||||
.filter(|n| *n > 0)
|
||||
|
||||
@@ -16,7 +16,6 @@ use axum::{
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
struct MessagesQuery {
|
||||
channel_id: Option<String>,
|
||||
message_id: Option<String>,
|
||||
@@ -82,13 +81,7 @@ async fn messages_page(
|
||||
let before = query.before.as_deref().filter(|s| !s.is_empty());
|
||||
let after = query.after.as_deref().filter(|s| !s.is_empty());
|
||||
let search = query.search.as_deref().filter(|s| !s.is_empty());
|
||||
let context_limit = query
|
||||
.context_limit
|
||||
.as_deref()
|
||||
.and_then(|s| s.parse::<u32>().ok())
|
||||
.filter(|n| *n > 0)
|
||||
.unwrap_or(50)
|
||||
.min(100);
|
||||
let context_limit = super::message_actions::parse_context_limit(query.context_limit.as_deref());
|
||||
let mut lookup_result = None;
|
||||
let mut browse_result = None;
|
||||
let mut search_result = None;
|
||||
|
||||
@@ -26,7 +26,7 @@ use axum::{
|
||||
};
|
||||
use serde::Deserialize;
|
||||
|
||||
const MAX_REPORT_OFFSET: u32 = 10_000;
|
||||
const MAX_REPORT_OFFSET: u64 = 10_000;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct ReportsQuery {
|
||||
@@ -75,7 +75,7 @@ async fn reports_list(
|
||||
let config = state.config();
|
||||
let page = query.page.unwrap_or(0);
|
||||
let limit = query.limit.unwrap_or(25).clamp(1, 200);
|
||||
let offset = page.saturating_mul(limit);
|
||||
let offset = u64::from(page) * u64::from(limit);
|
||||
if offset > MAX_REPORT_OFFSET {
|
||||
return reports_error_page(
|
||||
config,
|
||||
|
||||
@@ -17,14 +17,12 @@ use serde::Deserialize;
|
||||
use super::system_actions;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
struct GatewayQuery {
|
||||
leaderboard_limit: Option<String>,
|
||||
node_stats: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
struct AuditLogsQuery {
|
||||
q: Option<String>,
|
||||
admin_user_id: Option<String>,
|
||||
@@ -136,7 +134,7 @@ async fn audit_logs_page(
|
||||
sort_by: Some(params.sort_by.to_owned()),
|
||||
sort_order: Some(params.sort_order.to_owned()),
|
||||
limit,
|
||||
offset: current_page * limit,
|
||||
offset: u64::from(current_page) * u64::from(limit),
|
||||
};
|
||||
let result = client
|
||||
.search_audit_logs(&search_params)
|
||||
|
||||
@@ -6,20 +6,24 @@ use crate::{
|
||||
types::{
|
||||
AppBrandingConfigUpdateRequest, AppLegalConfigUpdateRequest,
|
||||
AppPublicConfigUpdateRequest, AppRegistrationConfigUpdateRequest,
|
||||
AppSetupConfigUpdateRequest, CreateRegistrationUrlRequest,
|
||||
DeferredPhoneGateUpdateRequest, ExperimentDeliveryConfigUpdateRequest,
|
||||
AppSetupConfigUpdateRequest, BlockedMessageGroupsConfigUpdateRequest,
|
||||
CreateRegistrationUrlRequest, DeferredPhoneGateUpdateRequest,
|
||||
ExperimentDeliveryConfigUpdateRequest, ExpressionInfoCardConfigUpdateRequest,
|
||||
GatewayRolloutConfigUpdateRequest, GatewayRolloutMode,
|
||||
InstanceAttachmentDecayUpdateRequest, InstanceBlueskyIntegrationUpdateRequest,
|
||||
InstanceBlueskyKeyIntegrationUpdateRequest, InstanceCaptchaIntegrationUpdateRequest,
|
||||
InstanceConfigUpdateRequest, InstanceEmailIntegrationUpdateRequest,
|
||||
InstanceEmailSmtpIntegrationUpdateRequest, InstanceEmailSmtpTestRequest,
|
||||
InstanceGifIntegrationUpdateRequest, InstanceIntegrationsUpdateRequest,
|
||||
InstanceMediaUpdateRequest, InstancePolicyUpdateRequest,
|
||||
InstanceRegistrationConfigUpdateRequest, InstanceServicesUpdateRequest,
|
||||
InstanceYoutubeIntegrationUpdateRequest, LimitConfigUpdateRequest, LimitRule,
|
||||
LimitRuleFilters, NoiseSuppressionBackend, PremiumMode, RegistrationMode,
|
||||
SsoConfigUpdateRequest, VOICE_NS_MAX_GUILD_OVERRIDES, VOICE_NS_MAX_TARGETED_USERS,
|
||||
VoiceE2eeScope, VoiceNoiseSuppressionConfigUpdateRequest,
|
||||
GuildActivityLogPresentationConfigUpdateRequest,
|
||||
GuildHeaderCollapseConfigUpdateRequest, InstanceAttachmentDecayUpdateRequest,
|
||||
InstanceBlueskyIntegrationUpdateRequest, InstanceBlueskyKeyIntegrationUpdateRequest,
|
||||
InstanceCaptchaIntegrationUpdateRequest, InstanceConfigUpdateRequest,
|
||||
InstanceEmailIntegrationUpdateRequest, InstanceEmailSmtpIntegrationUpdateRequest,
|
||||
InstanceEmailSmtpTestRequest, InstanceGifIntegrationUpdateRequest,
|
||||
InstanceIntegrationsUpdateRequest, InstanceMediaUpdateRequest,
|
||||
InstancePolicyUpdateRequest, InstanceRegistrationConfigUpdateRequest,
|
||||
InstanceServicesUpdateRequest, InstanceYoutubeIntegrationUpdateRequest,
|
||||
LimitConfigUpdateRequest, LimitRule, LimitRuleFilters,
|
||||
MessageHoverTrackingConfigUpdateRequest, MessageKeyboardFocusConfigUpdateRequest,
|
||||
NoiseSuppressionBackend, PremiumMode, RegistrationMode, SsoConfigUpdateRequest,
|
||||
TypingIndicatorReworkConfigUpdateRequest, VOICE_NS_MAX_GUILD_OVERRIDES,
|
||||
VOICE_NS_MAX_TARGETED_USERS, VoiceE2eeScope, VoiceNoiseSuppressionConfigUpdateRequest,
|
||||
VoiceNoiseSuppressionGuildOverride,
|
||||
},
|
||||
},
|
||||
@@ -207,6 +211,36 @@ pub async fn instance_config_post(
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_message_hover_tracking" => match build_message_hover_tracking_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_message_keyboard_focus" => match build_message_keyboard_focus_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_blocked_message_groups" => match build_blocked_message_groups_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_guild_activity_log_presentation" => {
|
||||
match build_guild_activity_log_presentation_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
}
|
||||
}
|
||||
"update_expression_info_card" => match build_expression_info_card_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_guild_header_collapse" => match build_guild_header_collapse_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_typing_indicator_rework" => match build_typing_indicator_rework_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
},
|
||||
"update_experiment_delivery" => match build_experiment_delivery_update(&form) {
|
||||
Ok(update) => instance_config_result(client.update_instance_config(&update).await),
|
||||
Err(message) => FlashData::error(message),
|
||||
@@ -447,10 +481,10 @@ fn build_gateway_rollout_update(form: &MultiValueForm) -> InstanceConfigUpdateRe
|
||||
}
|
||||
}
|
||||
|
||||
const VOICE_NS_ROLLOUT_BASIS_POINTS_MAX: u32 = 10_000;
|
||||
const EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX: u32 = 10_000;
|
||||
const VOICE_NS_SUPPRESSION_STRENGTH_MAX: u32 = 100;
|
||||
const VOICE_NS_MAX_ROLLOUT_SALT_CHARS: usize = 64;
|
||||
const VOICE_NS_MAX_SNOWFLAKE_LENGTH: usize = 20;
|
||||
const EXPERIMENT_MAX_ROLLOUT_SALT_CHARS: usize = 64;
|
||||
const EXPERIMENT_MAX_SNOWFLAKE_LENGTH: usize = 20;
|
||||
const EXPERIMENT_MIN_POLL_INTERVAL_SECONDS: u64 = 60;
|
||||
const EXPERIMENT_MAX_POLL_INTERVAL_SECONDS: u64 = 86_400;
|
||||
const EXPERIMENT_MAX_POLL_JITTER_PERCENT: u32 = 50;
|
||||
@@ -476,35 +510,36 @@ where
|
||||
Ok(Some(value))
|
||||
}
|
||||
|
||||
fn parse_voice_noise_suppression_rollout_salt(
|
||||
fn parse_experiment_rollout_salt(
|
||||
form: &MultiValueForm,
|
||||
key: &str,
|
||||
) -> Result<Option<String>, String> {
|
||||
let Some(raw) = form.first("voice_ns_rollout_salt") else {
|
||||
let Some(raw) = form.first(key) else {
|
||||
return Ok(None);
|
||||
};
|
||||
let salt = raw.trim();
|
||||
if salt.is_empty() || salt.encode_utf16().count() > VOICE_NS_MAX_ROLLOUT_SALT_CHARS {
|
||||
if salt.is_empty() || salt.encode_utf16().count() > EXPERIMENT_MAX_ROLLOUT_SALT_CHARS {
|
||||
return Err(format!(
|
||||
"Rollout salt must be between 1 and {VOICE_NS_MAX_ROLLOUT_SALT_CHARS} characters"
|
||||
"Rollout salt must be between 1 and {EXPERIMENT_MAX_ROLLOUT_SALT_CHARS} characters"
|
||||
));
|
||||
}
|
||||
Ok(Some(salt.to_owned()))
|
||||
}
|
||||
|
||||
fn is_voice_noise_suppression_snowflake(value: &str) -> bool {
|
||||
fn is_experiment_snowflake(value: &str) -> bool {
|
||||
!value.is_empty()
|
||||
&& value.len() <= VOICE_NS_MAX_SNOWFLAKE_LENGTH
|
||||
&& value.len() <= EXPERIMENT_MAX_SNOWFLAKE_LENGTH
|
||||
&& value.bytes().all(|byte| byte.is_ascii_digit())
|
||||
}
|
||||
|
||||
fn parse_voice_noise_suppression_user_ids(value: &str, label: &str) -> Result<Vec<String>, String> {
|
||||
fn parse_experiment_user_ids(value: &str, label: &str) -> Result<Vec<String>, String> {
|
||||
let mut ids: Vec<String> = Vec::new();
|
||||
for (index, candidate) in value.split([',', '\n', '\r']).enumerate() {
|
||||
let candidate = candidate.trim();
|
||||
if candidate.is_empty() {
|
||||
continue;
|
||||
}
|
||||
if !is_voice_noise_suppression_snowflake(candidate) {
|
||||
if !is_experiment_snowflake(candidate) {
|
||||
return Err(format!(
|
||||
"{label} entry {} must contain 1 to 20 decimal digits",
|
||||
index + 1
|
||||
@@ -536,7 +571,7 @@ fn parse_voice_noise_suppression_guild_overrides(
|
||||
format!("Guild overrides line {line_number} must use guild_id=backend")
|
||||
})?;
|
||||
let guild_id = guild_id.trim();
|
||||
if !is_voice_noise_suppression_snowflake(guild_id) {
|
||||
if !is_experiment_snowflake(guild_id) {
|
||||
return Err(format!(
|
||||
"Guild overrides line {line_number} must use a guild ID with 1 to 20 decimal digits"
|
||||
));
|
||||
@@ -602,14 +637,14 @@ fn build_voice_noise_suppression_update(
|
||||
"voice_ns_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
VOICE_NS_ROLLOUT_BASIS_POINTS_MAX,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_voice_noise_suppression_rollout_salt(form)?,
|
||||
included_user_ids: Some(parse_voice_noise_suppression_user_ids(
|
||||
rollout_salt: parse_experiment_rollout_salt(form, "voice_ns_rollout_salt")?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("voice_ns_included_user_ids").unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_voice_noise_suppression_user_ids(
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("voice_ns_excluded_user_ids").unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
@@ -629,6 +664,221 @@ fn build_voice_noise_suppression_update(
|
||||
})
|
||||
}
|
||||
|
||||
fn build_message_hover_tracking_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
message_hover_tracking: Some(MessageHoverTrackingConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("message_hover_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"message_hover_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(form, "message_hover_rollout_salt")?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("message_hover_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("message_hover_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_message_keyboard_focus_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
message_keyboard_focus: Some(MessageKeyboardFocusConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("message_keyboard_focus_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"message_keyboard_focus_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(
|
||||
form,
|
||||
"message_keyboard_focus_rollout_salt",
|
||||
)?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("message_keyboard_focus_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("message_keyboard_focus_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_blocked_message_groups_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
blocked_message_groups: Some(BlockedMessageGroupsConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("blocked_groups_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"blocked_groups_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(form, "blocked_groups_rollout_salt")?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("blocked_groups_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("blocked_groups_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_guild_activity_log_presentation_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
guild_activity_log_presentation: Some(GuildActivityLogPresentationConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("guild_activity_log_presentation_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"guild_activity_log_presentation_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(
|
||||
form,
|
||||
"guild_activity_log_presentation_rollout_salt",
|
||||
)?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("guild_activity_log_presentation_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("guild_activity_log_presentation_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_expression_info_card_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
expression_info_card: Some(ExpressionInfoCardConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("expression_card_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"expression_card_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(form, "expression_card_rollout_salt")?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("expression_card_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("expression_card_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_guild_header_collapse_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
guild_header_collapse: Some(GuildHeaderCollapseConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("guild_header_collapse_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"guild_header_collapse_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(
|
||||
form,
|
||||
"guild_header_collapse_rollout_salt",
|
||||
)?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("guild_header_collapse_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("guild_header_collapse_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_typing_indicator_rework_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
Ok(InstanceConfigUpdateRequest {
|
||||
typing_indicator_rework: Some(TypingIndicatorReworkConfigUpdateRequest {
|
||||
enabled: Some(form.bool_value("typing_indicator_rework_enabled")),
|
||||
rollout_basis_points: parse_form_number(
|
||||
form,
|
||||
"typing_indicator_rework_rollout_basis_points",
|
||||
"Rollout basis points",
|
||||
0,
|
||||
EXPERIMENT_ROLLOUT_BASIS_POINTS_MAX,
|
||||
)?,
|
||||
rollout_salt: parse_experiment_rollout_salt(
|
||||
form,
|
||||
"typing_indicator_rework_rollout_salt",
|
||||
)?,
|
||||
included_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("typing_indicator_rework_included_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Included user IDs",
|
||||
)?),
|
||||
excluded_user_ids: Some(parse_experiment_user_ids(
|
||||
form.first("typing_indicator_rework_excluded_user_ids")
|
||||
.unwrap_or_default(),
|
||||
"Excluded user IDs",
|
||||
)?),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn build_experiment_delivery_update(
|
||||
form: &MultiValueForm,
|
||||
) -> Result<InstanceConfigUpdateRequest, String> {
|
||||
@@ -1305,9 +1555,9 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_voice_noise_suppression_user_ids_splits_newlines_and_commas() {
|
||||
fn parse_experiment_user_ids_splits_newlines_and_commas() {
|
||||
assert_eq!(
|
||||
parse_voice_noise_suppression_user_ids(" 1 ,2\n3\r\n 4 ,, 5 ", "Included user IDs")
|
||||
parse_experiment_user_ids(" 1 ,2\n3\r\n 4 ,, 5 ", "Included user IDs")
|
||||
.expect("valid IDs"),
|
||||
vec![
|
||||
"1".to_owned(),
|
||||
@@ -1320,16 +1570,15 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_voice_noise_suppression_user_ids_dedupes_preserving_order() {
|
||||
fn parse_experiment_user_ids_dedupes_preserving_order() {
|
||||
assert_eq!(
|
||||
parse_voice_noise_suppression_user_ids("20,10,20,10,30", "Included user IDs")
|
||||
.expect("valid IDs"),
|
||||
parse_experiment_user_ids("20,10,20,10,30", "Included user IDs").expect("valid IDs"),
|
||||
vec!["20".to_owned(), "10".to_owned(), "30".to_owned()]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_voice_noise_suppression_user_ids_rejects_non_digit_and_overlong_values() {
|
||||
fn parse_experiment_user_ids_rejects_non_digit_and_overlong_values() {
|
||||
for value in [
|
||||
"abc",
|
||||
"12a",
|
||||
@@ -1339,11 +1588,8 @@ mod tests {
|
||||
"<script>",
|
||||
] {
|
||||
assert_eq!(
|
||||
parse_voice_noise_suppression_user_ids(
|
||||
&format!("123,{value}"),
|
||||
"Included user IDs"
|
||||
)
|
||||
.expect_err("invalid ID"),
|
||||
parse_experiment_user_ids(&format!("123,{value}"), "Included user IDs")
|
||||
.expect_err("invalid ID"),
|
||||
"Included user IDs entry 2 must contain 1 to 20 decimal digits",
|
||||
"{value}"
|
||||
);
|
||||
@@ -1351,18 +1597,17 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_voice_noise_suppression_user_ids_rejects_exceeding_the_cap() {
|
||||
fn parse_experiment_user_ids_rejects_exceeding_the_cap() {
|
||||
let value = (0..VOICE_NS_MAX_TARGETED_USERS)
|
||||
.map(|index| index.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
let ids =
|
||||
parse_voice_noise_suppression_user_ids(&format!("{value}\n999"), "Included user IDs")
|
||||
.expect("valid IDs at cap");
|
||||
let ids = parse_experiment_user_ids(&format!("{value}\n999"), "Included user IDs")
|
||||
.expect("valid IDs at cap");
|
||||
assert_eq!(ids.len(), VOICE_NS_MAX_TARGETED_USERS);
|
||||
assert_eq!(ids.last(), Some(&"999".to_owned()));
|
||||
assert_eq!(
|
||||
parse_voice_noise_suppression_user_ids(&format!("{value}\n1000"), "Included user IDs")
|
||||
parse_experiment_user_ids(&format!("{value}\n1000"), "Included user IDs")
|
||||
.expect_err("too many IDs"),
|
||||
"Included user IDs must contain at most 1000 unique IDs"
|
||||
);
|
||||
@@ -1555,6 +1800,152 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_guild_header_collapse_update_reads_the_whole_form() {
|
||||
let form = MultiValueForm::parse(
|
||||
b"guild_header_collapse_enabled=true&guild_header_collapse_rollout_basis_points=2500&guild_header_collapse_rollout_salt=%20guild-header-collapse-v2%20&guild_header_collapse_included_user_ids=1500000000000000001%0A1500000000000000001&guild_header_collapse_excluded_user_ids=1500000000000000002%2C%201500000000000000003",
|
||||
);
|
||||
let update = build_guild_header_collapse_update(&form)
|
||||
.expect("valid form")
|
||||
.guild_header_collapse
|
||||
.expect("guild header collapse update");
|
||||
assert_eq!(update.enabled, Some(true));
|
||||
assert_eq!(update.rollout_basis_points, Some(2_500));
|
||||
assert_eq!(
|
||||
update.rollout_salt,
|
||||
Some("guild-header-collapse-v2".to_owned())
|
||||
);
|
||||
assert_eq!(
|
||||
update.included_user_ids,
|
||||
Some(vec!["1500000000000000001".to_owned()])
|
||||
);
|
||||
assert_eq!(
|
||||
update.excluded_user_ids,
|
||||
Some(vec![
|
||||
"1500000000000000002".to_owned(),
|
||||
"1500000000000000003".to_owned()
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_guild_header_collapse_update_leaves_the_rollout_inert_when_nothing_is_submitted() {
|
||||
let form = MultiValueForm::parse(b"_csrf=token");
|
||||
let request = build_guild_header_collapse_update(&form).expect("valid form");
|
||||
assert_eq!(
|
||||
serde_json::to_value(request).expect("serializable update"),
|
||||
serde_json::json!({"guild_header_collapse": {
|
||||
"enabled": false,
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": [],
|
||||
}})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_guild_header_collapse_update_rejects_a_rollout_above_the_maximum() {
|
||||
let form = MultiValueForm::parse(b"guild_header_collapse_rollout_basis_points=10001");
|
||||
assert_eq!(
|
||||
build_guild_header_collapse_update(&form).expect_err("invalid rollout"),
|
||||
"Rollout basis points must be a whole number between 0 and 10000"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_guild_header_collapse_update_reads_only_its_own_prefix() {
|
||||
let form = MultiValueForm::parse(
|
||||
b"guild_header_collapse_enabled=true&guild_header_collapse_rollout_basis_points=2500&guild_header_collapse_rollout_salt=guild-header-collapse-v2&guild_header_collapse_included_user_ids=1500000000000000001&expression_card_rollout_basis_points=750&expression_card_rollout_salt=expression-info-card-v2&expression_card_excluded_user_ids=1500000000000000009",
|
||||
);
|
||||
let update = build_guild_header_collapse_update(&form)
|
||||
.expect("valid form")
|
||||
.guild_header_collapse
|
||||
.expect("guild header collapse update");
|
||||
assert_eq!(update.enabled, Some(true));
|
||||
assert_eq!(update.rollout_basis_points, Some(2_500));
|
||||
assert_eq!(
|
||||
update.rollout_salt,
|
||||
Some("guild-header-collapse-v2".to_owned())
|
||||
);
|
||||
assert_eq!(
|
||||
update.included_user_ids,
|
||||
Some(vec!["1500000000000000001".to_owned()])
|
||||
);
|
||||
assert_eq!(update.excluded_user_ids, Some(Vec::new()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_typing_indicator_rework_update_reads_the_whole_form() {
|
||||
let form = MultiValueForm::parse(
|
||||
b"typing_indicator_rework_enabled=true&typing_indicator_rework_rollout_basis_points=2500&typing_indicator_rework_rollout_salt=%20typing-indicator-rework-v2%20&typing_indicator_rework_included_user_ids=1500000000000000001%0A1500000000000000001&typing_indicator_rework_excluded_user_ids=1500000000000000002%2C%201500000000000000003",
|
||||
);
|
||||
let update = build_typing_indicator_rework_update(&form)
|
||||
.expect("valid form")
|
||||
.typing_indicator_rework
|
||||
.expect("typing indicator rework update");
|
||||
assert_eq!(update.enabled, Some(true));
|
||||
assert_eq!(update.rollout_basis_points, Some(2_500));
|
||||
assert_eq!(
|
||||
update.rollout_salt,
|
||||
Some("typing-indicator-rework-v2".to_owned())
|
||||
);
|
||||
assert_eq!(
|
||||
update.included_user_ids,
|
||||
Some(vec!["1500000000000000001".to_owned()])
|
||||
);
|
||||
assert_eq!(
|
||||
update.excluded_user_ids,
|
||||
Some(vec![
|
||||
"1500000000000000002".to_owned(),
|
||||
"1500000000000000003".to_owned()
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_typing_indicator_rework_update_leaves_the_rollout_inert_when_nothing_is_submitted() {
|
||||
let form = MultiValueForm::parse(b"_csrf=token");
|
||||
let request = build_typing_indicator_rework_update(&form).expect("valid form");
|
||||
assert_eq!(
|
||||
serde_json::to_value(request).expect("serializable update"),
|
||||
serde_json::json!({"typing_indicator_rework": {
|
||||
"enabled": false,
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": [],
|
||||
}})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_typing_indicator_rework_update_rejects_a_rollout_above_the_maximum() {
|
||||
let form = MultiValueForm::parse(b"typing_indicator_rework_rollout_basis_points=10001");
|
||||
assert_eq!(
|
||||
build_typing_indicator_rework_update(&form).expect_err("invalid rollout"),
|
||||
"Rollout basis points must be a whole number between 0 and 10000"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_typing_indicator_rework_update_reads_only_its_own_prefix() {
|
||||
let form = MultiValueForm::parse(
|
||||
b"expression_card_enabled=true&expression_card_rollout_basis_points=2500&expression_card_rollout_salt=expression-info-card-v2&expression_card_included_user_ids=1500000000000000001&typing_indicator_rework_rollout_basis_points=750&typing_indicator_rework_rollout_salt=typing-indicator-rework-v2&typing_indicator_rework_excluded_user_ids=1500000000000000009",
|
||||
);
|
||||
let update = build_typing_indicator_rework_update(&form)
|
||||
.expect("valid form")
|
||||
.typing_indicator_rework
|
||||
.expect("typing indicator rework update");
|
||||
assert_eq!(update.enabled, Some(false));
|
||||
assert_eq!(update.rollout_basis_points, Some(750));
|
||||
assert_eq!(
|
||||
update.rollout_salt,
|
||||
Some("typing-indicator-rework-v2".to_owned())
|
||||
);
|
||||
assert_eq!(update.included_user_ids, Some(Vec::new()));
|
||||
assert_eq!(
|
||||
update.excluded_user_ids,
|
||||
Some(vec!["1500000000000000009".to_owned()])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_experiment_delivery_update_leaves_both_fields_unchanged_when_absent() {
|
||||
let form = MultiValueForm::parse(b"_csrf=token");
|
||||
|
||||
@@ -60,7 +60,9 @@ pub async fn dispatch(
|
||||
"Failed to update user flags",
|
||||
);
|
||||
}
|
||||
let submitted = parse_u64_list(form, &["flags[]", "flags"]);
|
||||
let Ok(submitted) = form.parse_list_values::<u64>(&["flags[]", "flags"]) else {
|
||||
return DispatchOutcome::error("Invalid user flag value");
|
||||
};
|
||||
let selected = submitted.iter().copied().collect::<HashSet<_>>();
|
||||
let user = match client.get_user_by_id(user_id).await {
|
||||
Ok(user) => user,
|
||||
@@ -89,15 +91,22 @@ pub async fn dispatch(
|
||||
}
|
||||
"update_premium_flags" => {
|
||||
if has_legacy_flag_delta_fields(form) {
|
||||
let add = parse_i32_list(form, &["add_flags[]", "add_flags"]);
|
||||
let remove = parse_i32_list(form, &["remove_flags[]", "remove_flags"]);
|
||||
let Ok(add) = form.parse_list_values::<i32>(&["add_flags[]", "add_flags"]) else {
|
||||
return DispatchOutcome::error("Invalid premium flag value to add");
|
||||
};
|
||||
let Ok(remove) = form.parse_list_values::<i32>(&["remove_flags[]", "remove_flags"])
|
||||
else {
|
||||
return DispatchOutcome::error("Invalid premium flag value to remove");
|
||||
};
|
||||
return DispatchOutcome::from_result(
|
||||
client.update_premium_flags(user_id, &add, &remove).await,
|
||||
"Premium flags updated successfully",
|
||||
"Failed to update premium flags",
|
||||
);
|
||||
}
|
||||
let submitted = parse_i32_list(form, &["flags[]", "flags"]);
|
||||
let Ok(submitted) = form.parse_list_values::<i32>(&["flags[]", "flags"]) else {
|
||||
return DispatchOutcome::error("Invalid premium flag value");
|
||||
};
|
||||
let selected = submitted.iter().copied().collect::<HashSet<_>>();
|
||||
let user = match client.get_user_by_id(user_id).await {
|
||||
Ok(user) => user,
|
||||
@@ -124,9 +133,12 @@ pub async fn dispatch(
|
||||
)
|
||||
}
|
||||
"update_suspicious_flags" => {
|
||||
let flags = parse_i32_list(form, &["suspicious_flags[]", "suspicious_flags"])
|
||||
.into_iter()
|
||||
.fold(0, |acc, flag| acc | flag);
|
||||
let Ok(submitted) =
|
||||
form.parse_list_values::<i32>(&["suspicious_flags[]", "suspicious_flags"])
|
||||
else {
|
||||
return DispatchOutcome::error("Invalid suspicious activity flag value");
|
||||
};
|
||||
let flags = submitted.into_iter().fold(0, |acc, flag| acc | flag);
|
||||
DispatchOutcome::from_result(
|
||||
client.update_suspicious_flags(user_id, flags).await,
|
||||
"Suspicious activity flags updated successfully",
|
||||
@@ -225,15 +237,19 @@ pub async fn dispatch(
|
||||
)
|
||||
}
|
||||
"temp_ban" => {
|
||||
let dur = form
|
||||
.parse_u32("duration_hours")
|
||||
.or_else(|| form.parse_u32("duration"))
|
||||
.unwrap_or(24);
|
||||
let Ok(duration) = form.parse_value_any::<u32>(&["duration_hours", "duration"]) else {
|
||||
return DispatchOutcome::error("Invalid ban duration");
|
||||
};
|
||||
let reason = get("reason");
|
||||
let private = get("private_reason");
|
||||
DispatchOutcome::from_result(
|
||||
client
|
||||
.temp_ban_user(user_id, dur, reason.as_deref(), private.as_deref())
|
||||
.temp_ban_user(
|
||||
user_id,
|
||||
duration.unwrap_or(24),
|
||||
reason.as_deref(),
|
||||
private.as_deref(),
|
||||
)
|
||||
.await,
|
||||
"User temporarily banned successfully",
|
||||
"Failed to temporarily ban user",
|
||||
@@ -249,7 +265,7 @@ pub async fn dispatch(
|
||||
return DispatchOutcome::error("IP address is required");
|
||||
};
|
||||
DispatchOutcome::from_result(
|
||||
client.ban_ip(&ip).await,
|
||||
client.ban_ip(&ip, None).await,
|
||||
"IP banned successfully",
|
||||
"Failed to ban IP",
|
||||
)
|
||||
@@ -259,18 +275,29 @@ pub async fn dispatch(
|
||||
return DispatchOutcome::error("Avatar hash is required");
|
||||
};
|
||||
DispatchOutcome::from_result(
|
||||
client.ban_avatar_hash(&hash).await,
|
||||
client.ban_avatar_hash(&hash, None).await,
|
||||
"Avatar hash banned successfully",
|
||||
"Failed to ban avatar hash",
|
||||
)
|
||||
}
|
||||
"schedule_deletion" => {
|
||||
let reason_code = form.parse_i32("reason_code").unwrap_or(0);
|
||||
let Ok(reason_code) = form.parse_value::<i32>("reason_code") else {
|
||||
return DispatchOutcome::error("Invalid deletion reason code");
|
||||
};
|
||||
let public_reason = get("public_reason");
|
||||
let days = form.parse_u32("days_until_deletion").unwrap_or(60);
|
||||
let private_reason = get("private_reason");
|
||||
let Ok(days) = form.parse_value_any::<u32>(&["days_until_deletion", "days"]) else {
|
||||
return DispatchOutcome::error("Invalid deletion delay");
|
||||
};
|
||||
DispatchOutcome::from_result(
|
||||
client
|
||||
.schedule_deletion(user_id, reason_code, public_reason.as_deref(), days)
|
||||
.schedule_deletion(
|
||||
user_id,
|
||||
reason_code.unwrap_or(0),
|
||||
public_reason.as_deref(),
|
||||
days.unwrap_or(60),
|
||||
private_reason.as_deref(),
|
||||
)
|
||||
.await,
|
||||
"User deletion scheduled successfully",
|
||||
"Failed to schedule user deletion",
|
||||
@@ -441,20 +468,6 @@ fn is_relationship_category(category: &str) -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
fn parse_u64_list(form: &MultiValueForm, keys: &[&str]) -> Vec<u64> {
|
||||
form.list_values_any(keys)
|
||||
.iter()
|
||||
.filter_map(|value| value.parse().ok())
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn parse_i32_list(form: &MultiValueForm, keys: &[&str]) -> Vec<i32> {
|
||||
form.list_values_any(keys)
|
||||
.iter()
|
||||
.filter_map(|value| value.parse().ok())
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn parse_dry_run(value: Option<&str>) -> bool {
|
||||
!matches!(value.map(|value| value.trim().to_ascii_lowercase()), Some(value) if value == "false" || value == "0")
|
||||
}
|
||||
|
||||
@@ -164,25 +164,29 @@ pub async fn render(
|
||||
Some(tabs::guilds::guilds_tab(config, user_id, &g))
|
||||
}
|
||||
"reports" => {
|
||||
let lim = query.reports_limit.unwrap_or(25);
|
||||
let sp = query.reports_sent_page.unwrap_or(0);
|
||||
let rp = query.reports_received_page.unwrap_or(0);
|
||||
let limit = query.reports_limit.unwrap_or(25);
|
||||
let sent_page = query.reports_sent_page.unwrap_or(0);
|
||||
let received_page = query.reports_received_page.unwrap_or(0);
|
||||
let sent = client
|
||||
.search_reports_by_reporter(user_id, lim, sp * lim)
|
||||
.search_reports_by_reporter(user_id, limit, u64::from(sent_page) * u64::from(limit))
|
||||
.await
|
||||
.log_error("load reports sent by user");
|
||||
let recv = client
|
||||
.search_reports_by_reported_user(user_id, lim, rp * lim)
|
||||
let received = client
|
||||
.search_reports_by_reported_user(
|
||||
user_id,
|
||||
limit,
|
||||
u64::from(received_page) * u64::from(limit),
|
||||
)
|
||||
.await
|
||||
.log_error("load reports against user");
|
||||
Some(tabs::reports::reports_tab(
|
||||
config,
|
||||
user_id,
|
||||
sent.as_ref(),
|
||||
recv.as_ref(),
|
||||
sp,
|
||||
rp,
|
||||
lim,
|
||||
received.as_ref(),
|
||||
sent_page,
|
||||
received_page,
|
||||
limit,
|
||||
))
|
||||
}
|
||||
"relationships" => {
|
||||
@@ -240,11 +244,11 @@ pub async fn render(
|
||||
query: None,
|
||||
admin_user_id: None,
|
||||
target_id: Some(user_id.to_owned()),
|
||||
target_type: Some("user".to_owned()),
|
||||
target_type: None,
|
||||
sort_by: Some("created_at".to_owned()),
|
||||
sort_order: Some("desc".to_owned()),
|
||||
limit,
|
||||
offset: page * limit,
|
||||
offset: u64::from(page) * u64::from(limit),
|
||||
})
|
||||
.await
|
||||
.log_error("load user admin audit logs")?;
|
||||
|
||||
@@ -93,7 +93,7 @@ async fn users_list(
|
||||
.log_error("lookup users by ids")
|
||||
.map(|users| (users, false))
|
||||
} else if params.has_search() {
|
||||
let offset = params.page.saturating_mul(params.limit);
|
||||
let offset = u64::from(params.page) * u64::from(params.limit);
|
||||
client
|
||||
.search_users(
|
||||
params.search_query(),
|
||||
@@ -105,7 +105,7 @@ async fn users_list(
|
||||
.await
|
||||
.log_error("search users")
|
||||
.map(|r| {
|
||||
let has_more = u64::from(offset) + (r.users.len() as u64) < r.total;
|
||||
let has_more = (r.users.len() as u64) < r.total.saturating_sub(offset);
|
||||
(r.users, has_more)
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -41,17 +41,14 @@ pub fn archives_tab(
|
||||
}
|
||||
}
|
||||
|
||||
fn status_text(archive: &Archive) -> String {
|
||||
fn status_text(archive: &Archive) -> &str {
|
||||
if archive.failed_at.is_some() {
|
||||
return "Failed".to_owned();
|
||||
return "Failed";
|
||||
}
|
||||
if archive.completed_at.is_some() {
|
||||
return "Completed".to_owned();
|
||||
return "Completed";
|
||||
}
|
||||
archive
|
||||
.progress_step
|
||||
.clone()
|
||||
.unwrap_or_else(|| "In Progress".to_owned())
|
||||
archive.progress_step.as_deref().unwrap_or("In Progress")
|
||||
}
|
||||
|
||||
fn archives_table(base: &str, archives: &[Archive]) -> Markup {
|
||||
|
||||
@@ -66,9 +66,15 @@ pub fn audit_logs_for_target(
|
||||
) -> Markup {
|
||||
let has_previous = current_page > 0;
|
||||
let offset = (current_page as u64) * (PAGE_SIZE as u64);
|
||||
let has_next = offset + (entries.len() as u64) < total;
|
||||
let total_pages = ((total as f64) / (PAGE_SIZE as f64)).ceil().max(1.0) as u64;
|
||||
let all_logs_href = format!("{base_path}/audit-logs?target_id={target_id}");
|
||||
let next_page = current_page
|
||||
.checked_add(1)
|
||||
.filter(|_| offset + (entries.len() as u64) < total);
|
||||
let total_pages = total.div_ceil(u64::from(PAGE_SIZE)).max(1);
|
||||
let page_number = u64::from(current_page) + 1;
|
||||
let all_logs_href = format!(
|
||||
"{base_path}/audit-logs?target_id={}",
|
||||
urlencoding::encode(target_id)
|
||||
);
|
||||
|
||||
html! {
|
||||
div class="rounded-lg bg-white transition-all border border-neutral-200 p-6" {
|
||||
@@ -108,7 +114,7 @@ pub fn audit_logs_for_target(
|
||||
}))
|
||||
}))
|
||||
}
|
||||
@if has_previous || has_next {
|
||||
@if has_previous || next_page.is_some() {
|
||||
div class="flex items-center justify-center gap-2" {
|
||||
@if has_previous {
|
||||
a href={(tab_href_base) "&audit_logs_page=" (current_page - 1)}
|
||||
@@ -119,10 +125,10 @@ pub fn audit_logs_for_target(
|
||||
}
|
||||
}
|
||||
span class="text-sm text-neutral-500" {
|
||||
"Page " (current_page + 1) " of " (total_pages)
|
||||
"Page " (page_number) " of " (total_pages)
|
||||
}
|
||||
@if has_next {
|
||||
a href={(tab_href_base) "&audit_logs_page=" (current_page + 1)}
|
||||
@if let Some(page) = next_page {
|
||||
a href={(tab_href_base) "&audit_logs_page=" (page)}
|
||||
class="inline-flex items-center justify-center gap-2 font-medium \
|
||||
rounded-lg bg-neutral-50 text-neutral-700 border \
|
||||
border-neutral-300 px-3 py-1.5 text-sm" {
|
||||
|
||||
@@ -81,20 +81,15 @@ pub fn guild_asset_url(
|
||||
}
|
||||
|
||||
pub fn initials(name: &str) -> String {
|
||||
let parts = name
|
||||
.split_whitespace()
|
||||
.filter(|part| !part.is_empty())
|
||||
.collect::<Vec<_>>();
|
||||
match parts.as_slice() {
|
||||
[] => "?".to_owned(),
|
||||
[part] => part.chars().next().unwrap_or('?').to_uppercase().collect(),
|
||||
[first, .., last] => {
|
||||
let mut value = String::new();
|
||||
value.extend(first.chars().next().unwrap_or('?').to_uppercase());
|
||||
value.extend(last.chars().next().unwrap_or('?').to_uppercase());
|
||||
value
|
||||
}
|
||||
}
|
||||
let mut parts = name.split_whitespace();
|
||||
let Some(first) = parts.next() else {
|
||||
return "?".to_owned();
|
||||
};
|
||||
std::iter::once(first)
|
||||
.chain(parts.next_back())
|
||||
.flat_map(|part| part.chars().take(1))
|
||||
.flat_map(char::to_uppercase)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn media_asset_url(
|
||||
|
||||
@@ -45,8 +45,8 @@ fn ncmec_badge(att: &Attachment) -> Markup {
|
||||
}
|
||||
|
||||
fn render_image_attachments(msg: &Message, include_delete: bool) -> Markup {
|
||||
let images: Vec<&Attachment> = msg.attachments.iter().filter(|a| is_image(a)).collect();
|
||||
if images.is_empty() {
|
||||
let mut images = msg.attachments.iter().filter(|a| is_image(a)).peekable();
|
||||
if images.peek().is_none() {
|
||||
return html! {};
|
||||
}
|
||||
let spacer = if !msg.content.is_empty() {
|
||||
@@ -56,7 +56,7 @@ fn render_image_attachments(msg: &Message, include_delete: bool) -> Markup {
|
||||
};
|
||||
html! {
|
||||
div class=(spacer) {
|
||||
@for att in &images {
|
||||
@for att in images {
|
||||
div class="max-w-xl overflow-hidden rounded-xl border border-neutral-200 bg-neutral-50" {
|
||||
a href=(att.url) target="_blank" rel="noopener noreferrer"
|
||||
class="block overflow-hidden bg-neutral-100" {
|
||||
@@ -116,8 +116,8 @@ fn render_image_attachments(msg: &Message, include_delete: bool) -> Markup {
|
||||
}
|
||||
|
||||
fn render_other_attachments(msg: &Message, has_content_or_images: bool) -> Markup {
|
||||
let others: Vec<&Attachment> = msg.attachments.iter().filter(|a| !is_image(a)).collect();
|
||||
if others.is_empty() {
|
||||
let mut others = msg.attachments.iter().filter(|a| !is_image(a)).peekable();
|
||||
if others.peek().is_none() {
|
||||
return html! {};
|
||||
}
|
||||
let spacer = if has_content_or_images {
|
||||
@@ -127,7 +127,7 @@ fn render_other_attachments(msg: &Message, has_content_or_images: bool) -> Marku
|
||||
};
|
||||
html! {
|
||||
div class=(spacer) {
|
||||
@for att in &others {
|
||||
@for att in others {
|
||||
div class="flex flex-wrap items-center gap-2 text-xs" {
|
||||
(paperclip_icon("text-neutral-400"))
|
||||
a href=(att.url) target="_blank" rel="noopener noreferrer"
|
||||
|
||||
@@ -17,7 +17,6 @@ pub mod message_data;
|
||||
pub mod message_list;
|
||||
pub mod nsfw_indicators;
|
||||
pub mod page_container;
|
||||
pub mod pagination;
|
||||
pub mod resource_link;
|
||||
pub mod section_card;
|
||||
pub mod stack;
|
||||
|
||||
@@ -19,7 +19,7 @@ pub fn adult_content_badge(is_adult: bool, label: Option<&str>) -> Markup {
|
||||
}
|
||||
|
||||
fn truncate(text: &str, max: usize) -> String {
|
||||
if text.len() <= max {
|
||||
if text.chars().nth(max).is_none() {
|
||||
text.to_owned()
|
||||
} else {
|
||||
let boundary = max.saturating_sub(1);
|
||||
@@ -29,10 +29,7 @@ fn truncate(text: &str, max: usize) -> String {
|
||||
}
|
||||
|
||||
pub fn content_warning_badge(level: Option<i32>, text: Option<&str>, inline_text: bool) -> Markup {
|
||||
let Some(lvl) = level else {
|
||||
return html! {};
|
||||
};
|
||||
if lvl != CONTENT_WARNING_LEVEL {
|
||||
if level != Some(CONTENT_WARNING_LEVEL) {
|
||||
return html! {};
|
||||
}
|
||||
let default_text = "This contains sensitive content.";
|
||||
@@ -82,13 +79,8 @@ fn resolve_nsfw_source(
|
||||
|
||||
fn source_label(source: NsfwSource, explicit: Option<bool>) -> &'static str {
|
||||
match source {
|
||||
NsfwSource::Channel => {
|
||||
if explicit == Some(true) {
|
||||
"(override on)"
|
||||
} else {
|
||||
"(override off)"
|
||||
}
|
||||
}
|
||||
NsfwSource::Channel if explicit == Some(true) => "(override on)",
|
||||
NsfwSource::Channel => "(override off)",
|
||||
NsfwSource::Category => "(from category)",
|
||||
NsfwSource::Community => "(from community)",
|
||||
NsfwSource::None => "",
|
||||
@@ -110,11 +102,7 @@ pub fn channel_nsfw_state_badge(
|
||||
}
|
||||
let has_context =
|
||||
nsfw_override.is_some() || category_override.is_some() || guild_nsfw.is_some();
|
||||
let (source, explicit) = if has_context {
|
||||
resolve_nsfw_source(nsfw_override, category_override, guild_nsfw)
|
||||
} else {
|
||||
(NsfwSource::None, None)
|
||||
};
|
||||
let (source, explicit) = resolve_nsfw_source(nsfw_override, category_override, guild_nsfw);
|
||||
html! {
|
||||
span class="inline-flex flex-wrap items-center gap-1" {
|
||||
@if is_nsfw {
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
use maud::{Markup, PreEscaped, html};
|
||||
|
||||
pub fn pagination(base_url: &str, current_page: u32, has_more: bool, extra_params: &str) -> Markup {
|
||||
let sep = if base_url.contains('?') { "&" } else { "?" };
|
||||
let has_previous = current_page > 1;
|
||||
html! {
|
||||
div class="mt-4 flex items-center justify-between" {
|
||||
@if has_previous {
|
||||
p class="text-sm font-normal text-neutral-500" {
|
||||
a href={
|
||||
(base_url) (sep) "page=" (current_page - 1) (extra_params)
|
||||
} class="text-neutral-900 underline decoration-neutral-300 hover:text-neutral-600 hover:decoration-neutral-500 hover:text-neutral-900" {
|
||||
(PreEscaped("← Previous"))
|
||||
}
|
||||
}
|
||||
} @else {
|
||||
span {}
|
||||
}
|
||||
@if has_more {
|
||||
p class="text-sm font-normal text-neutral-500" {
|
||||
a href={
|
||||
(base_url) (sep) "page=" (current_page + 1) (extra_params)
|
||||
} class="text-neutral-900 underline decoration-neutral-300 hover:text-neutral-600 hover:decoration-neutral-500 hover:text-neutral-900" {
|
||||
(PreEscaped("Next →"))
|
||||
}
|
||||
}
|
||||
} @else {
|
||||
span {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,6 @@ const RESOURCE_LINK_CLASS: &str = "text-neutral-900 underline decoration-neutral
|
||||
hover:text-neutral-600 hover:decoration-neutral-500 text-sm";
|
||||
const NAV_LINK_CLASS: &str = "label rounded-lg border border-neutral-300 bg-white \
|
||||
px-3 py-2 text-neutral-700 transition-colors hover:bg-neutral-50";
|
||||
const TEXT_LINK_CLASS: &str = "text-neutral-900 underline decoration-neutral-300 \
|
||||
hover:text-neutral-600 hover:decoration-neutral-500";
|
||||
|
||||
impl ResourceType {
|
||||
fn path_segment(self) -> &'static str {
|
||||
@@ -91,18 +89,3 @@ pub fn nav_link(href: &str, content: Markup) -> Markup {
|
||||
a href=(href) class=(NAV_LINK_CLASS) { (content) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn text_link(href: &str, content: Markup, external: bool, _mono: bool) -> Markup {
|
||||
if external {
|
||||
html! {
|
||||
a href=(href) class=(TEXT_LINK_CLASS)
|
||||
target="_blank" rel="noopener noreferrer" {
|
||||
(content)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
html! {
|
||||
a href=(href) class=(TEXT_LINK_CLASS) { (content) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ pub const NAV_SECTIONS: &[NavSection] = &[
|
||||
"bulk-actions",
|
||||
[
|
||||
acl::BULK_UPDATE_USER_FLAGS,
|
||||
acl::BULK_UPDATE_SUSPICIOUS_ACTIVITY,
|
||||
acl::BULK_UPDATE_GUILD_FEATURES,
|
||||
acl::BULK_ADD_GUILD_MEMBERS,
|
||||
acl::BULK_DELETE_USERS,
|
||||
@@ -264,3 +265,27 @@ pub const NAV_SECTIONS: &[NavSection] = &[
|
||||
)],
|
||||
},
|
||||
];
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn bulk_actions_nav_covers_every_acl_the_page_renders_a_section_for() {
|
||||
let item = NAV_SECTIONS
|
||||
.iter()
|
||||
.flat_map(|section| section.items)
|
||||
.find(|item| item.active_key == "bulk-actions")
|
||||
.expect("bulk actions nav item");
|
||||
for required in [
|
||||
acl::BULK_UPDATE_USER_FLAGS,
|
||||
acl::BULK_UPDATE_SUSPICIOUS_ACTIVITY,
|
||||
acl::BULK_UPDATE_GUILD_FEATURES,
|
||||
acl::BULK_ADD_GUILD_MEMBERS,
|
||||
acl::BULK_DELETE_USERS,
|
||||
acl::BULK_DELETE_USER_MESSAGES,
|
||||
] {
|
||||
assert!(item.required_acls.contains(&required), "{required}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ fn filters_section(base: &str, params: &AuditLogsParams<'_>) -> Markup {
|
||||
("", "Any"),
|
||||
("user", "User"),
|
||||
("guild", "Guild"),
|
||||
("bulk_job", "Bulk job"),
|
||||
("email_domain", "Email domain"),
|
||||
("ip", "IP"),
|
||||
("phrase", "Phrase"),
|
||||
@@ -72,27 +73,22 @@ fn filters_section(base: &str, params: &AuditLogsParams<'_>) -> Markup {
|
||||
}
|
||||
|
||||
fn build_pagination_url(base: &str, page: u32, params: &AuditLogsParams<'_>) -> String {
|
||||
let mut url = format!("{base}/audit-logs?page={page}");
|
||||
if !params.query.is_empty() {
|
||||
url.push_str(&format!("&q={}", params.query));
|
||||
}
|
||||
if !params.admin_user_id.is_empty() {
|
||||
url.push_str(&format!("&admin_user_id={}", params.admin_user_id));
|
||||
}
|
||||
if !params.target_id.is_empty() {
|
||||
url.push_str(&format!("&target_id={}", params.target_id));
|
||||
}
|
||||
if !params.target_type.is_empty() {
|
||||
url.push_str(&format!("&target_type={}", params.target_type));
|
||||
}
|
||||
if !params.sort_by.is_empty() {
|
||||
url.push_str(&format!("&sort_by={}", params.sort_by));
|
||||
}
|
||||
if !params.sort_order.is_empty() {
|
||||
url.push_str(&format!("&sort_order={}", params.sort_order));
|
||||
}
|
||||
url.push_str(&format!("&limit={}", params.limit));
|
||||
url
|
||||
let mut query = url::form_urlencoded::Serializer::new(String::new());
|
||||
query.append_pair("page", &page.to_string());
|
||||
query.extend_pairs(
|
||||
[
|
||||
("q", params.query),
|
||||
("admin_user_id", params.admin_user_id),
|
||||
("target_id", params.target_id),
|
||||
("target_type", params.target_type),
|
||||
("sort_by", params.sort_by),
|
||||
("sort_order", params.sort_order),
|
||||
]
|
||||
.into_iter()
|
||||
.filter(|(_, value)| !value.is_empty()),
|
||||
);
|
||||
query.append_pair("limit", ¶ms.limit.to_string());
|
||||
format!("{base}/audit-logs?{}", query.finish())
|
||||
}
|
||||
|
||||
pub fn audit_logs_page(
|
||||
@@ -107,10 +103,15 @@ pub fn audit_logs_page(
|
||||
let total = data.total;
|
||||
let entries = &data.logs;
|
||||
let total_pages = if params.limit > 0 {
|
||||
((total as f64) / (params.limit as f64)).ceil().max(1.0) as u64
|
||||
total.div_ceil(u64::from(params.limit)).max(1)
|
||||
} else {
|
||||
1
|
||||
};
|
||||
let page_number = u64::from(params.current_page) + 1;
|
||||
let next_page = params
|
||||
.current_page
|
||||
.checked_add(1)
|
||||
.filter(|page| u64::from(*page) < total_pages);
|
||||
let showing = format!("Showing {} of {} entries", entries.len(), total);
|
||||
html! {
|
||||
(page_header_with_actions("Audit Logs", None, html! {
|
||||
@@ -134,10 +135,10 @@ pub fn audit_logs_page(
|
||||
}
|
||||
} @else { span {} }
|
||||
span class="text-sm text-neutral-500" {
|
||||
"Page " (params.current_page + 1) " of " (total_pages)
|
||||
"Page " (page_number) " of " (total_pages)
|
||||
}
|
||||
@if (params.current_page + 1) < total_pages as u32 {
|
||||
a href=(build_pagination_url(base, params.current_page + 1, params))
|
||||
@if let Some(page) = next_page {
|
||||
a href=(build_pagination_url(base, page, params))
|
||||
class="text-sm text-neutral-900 underline" {
|
||||
(PreEscaped("Next →"))
|
||||
}
|
||||
@@ -156,3 +157,24 @@ pub fn audit_logs_page(
|
||||
};
|
||||
admin_layout(config, auth, "Audit Logs", "audit-logs", None, content)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn target_type_filter_offers_bulk_jobs() {
|
||||
let params = AuditLogsParams {
|
||||
query: "",
|
||||
admin_user_id: "",
|
||||
target_id: "",
|
||||
target_type: "bulk_job",
|
||||
sort_by: "createdAt",
|
||||
sort_order: "desc",
|
||||
limit: 50,
|
||||
current_page: 0,
|
||||
};
|
||||
let markup = filters_section("/admin", ¶ms).into_string();
|
||||
assert!(markup.contains(r#"<option value="bulk_job" selected>Bulk job</option>"#));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,7 @@ use crate::{
|
||||
use maud::{Markup, html};
|
||||
|
||||
pub fn format_action(action: &str) -> String {
|
||||
let replaced = action.replace('_', " ");
|
||||
let mut chars = replaced.chars();
|
||||
match chars.next() {
|
||||
None => String::new(),
|
||||
Some(c) => c.to_uppercase().to_string() + chars.as_str(),
|
||||
}
|
||||
capitalise(&action.replace('_', " "))
|
||||
}
|
||||
|
||||
pub fn action_badge_variant(action: &str) -> BadgeVariant {
|
||||
@@ -92,10 +87,8 @@ pub fn admin_user_cell(base: &str, entry: &AuditLogEntry) -> Markup {
|
||||
}
|
||||
}
|
||||
|
||||
fn target_guild_label(guild: Option<&AuditLogGuildSummary>) -> String {
|
||||
guild
|
||||
.map(|guild| guild.name.clone())
|
||||
.unwrap_or_else(|| "Guild".to_owned())
|
||||
fn target_guild_label(guild: Option<&AuditLogGuildSummary>) -> &str {
|
||||
guild.map(|guild| guild.name.as_str()).unwrap_or("Guild")
|
||||
}
|
||||
|
||||
pub fn target_cell(base: &str, entry: &AuditLogEntry) -> Markup {
|
||||
@@ -133,6 +126,14 @@ pub fn target_cell(base: &str, entry: &AuditLogEntry) -> Markup {
|
||||
}
|
||||
}))
|
||||
},
|
||||
"bulk_job" => html! {
|
||||
(job_link(base, &entry.target_id, html! {
|
||||
div class="flex flex-col" {
|
||||
span class="text-sm font-medium" { "Bulk job" }
|
||||
span class="text-xs text-neutral-500 break-all" { "ID: " (&entry.target_id) }
|
||||
}
|
||||
}))
|
||||
},
|
||||
"message" => html! {
|
||||
div class="flex flex-col" {
|
||||
span class="text-sm font-medium" { "Message" }
|
||||
@@ -154,6 +155,15 @@ pub fn target_cell(base: &str, entry: &AuditLogEntry) -> Markup {
|
||||
}
|
||||
}
|
||||
|
||||
fn job_link(base: &str, job_id: &str, display: Markup) -> Markup {
|
||||
html! {
|
||||
a href={(base) "/jobs/" (job_id)} title={"Job " (job_id)}
|
||||
class="text-neutral-900 underline decoration-neutral-300 hover:text-neutral-600 hover:decoration-neutral-500 text-sm" {
|
||||
(display)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn channel_href(base: &str, channel_id: &str) -> String {
|
||||
format!(
|
||||
"{base}/messages?channel_id={}&context_limit=50",
|
||||
@@ -317,3 +327,36 @@ pub fn audit_log_table_body(base: &str, entries: &[AuditLogEntry]) -> Markup {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn entry(target_type: &str, target_id: &str) -> AuditLogEntry {
|
||||
serde_json::from_value(serde_json::json!({
|
||||
"log_id": "1900000000000000001",
|
||||
"admin_user_id": "1500000000000000001",
|
||||
"action": "bulk_schedule_deletion",
|
||||
"target_id": target_id,
|
||||
"target_type": target_type,
|
||||
"audit_log_reason": "Raid cleanup",
|
||||
"created_at": "2026-09-14T12:00:00.000Z"
|
||||
}))
|
||||
.expect("audit log fixture must deserialize")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bulk_job_targets_link_to_the_job_detail_page() {
|
||||
let markup = target_cell("/admin", &entry("bulk_job", "1900000000000000002")).into_string();
|
||||
assert!(markup.contains(r#"href="/admin/jobs/1900000000000000002""#));
|
||||
assert!(markup.contains("Bulk job"));
|
||||
assert!(!markup.contains("/admin/users/"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unknown_target_types_stay_unlinked() {
|
||||
let markup = target_cell("/admin", &entry("email_domain", "spam.example")).into_string();
|
||||
assert!(!markup.contains("<a "));
|
||||
assert!(markup.contains("Email domain"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ use crate::{
|
||||
templates::{
|
||||
components::{
|
||||
form::{
|
||||
checkbox, csrf_input, danger_button, form_actions, form_field_group, select_input,
|
||||
submit_button, text_input, textarea_input,
|
||||
FORM_SELECT_CLASS, checkbox, csrf_input, danger_button, form_actions,
|
||||
form_field_group, select_chevron, submit_button, text_input, textarea_input,
|
||||
},
|
||||
page_container::page_header,
|
||||
section_card::section_card_simple,
|
||||
@@ -395,16 +395,33 @@ fn bulk_schedule_deletion_section(base: &str, csrf_token: &str) -> Markup {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-4" {
|
||||
(textarea_input("user_ids", "User IDs (one per line)", "123456789\n987654321", "", 5, true))
|
||||
(select_input("reason_code", "Deletion Reason", DELETION_REASONS, "1"))
|
||||
(form_field_group("Deletion Reason", "reason_code", true, None,
|
||||
Some("User requested skips identifier bans and pending report resolution. Every other reason applies them."),
|
||||
html! {
|
||||
div class="relative" {
|
||||
select id="reason_code" name="reason_code" required
|
||||
class=(FORM_SELECT_CLASS) {
|
||||
option value="" selected { "Select a reason" }
|
||||
@for &(value, label) in DELETION_REASONS {
|
||||
option value=(value) { (label) }
|
||||
}
|
||||
}
|
||||
(select_chevron())
|
||||
}
|
||||
},
|
||||
))
|
||||
(text_input("public_reason", "Public Reason (optional)", "", "Terms of service violation"))
|
||||
(form_field_group("Days Until Deletion", "days_until_deletion", true, None, None, html! {
|
||||
input type="number" id="days_until_deletion" name="days_until_deletion"
|
||||
value="14" min="14" required
|
||||
class="w-full rounded-lg border border-neutral-300 bg-white \
|
||||
text-neutral-900 text-sm h-8 px-3 py-1.5 \
|
||||
focus:border-brand-primary focus:outline-none \
|
||||
focus:ring-2 focus:ring-brand-primary/20";
|
||||
}))
|
||||
(form_field_group("Days Until Deletion", "days_until_deletion", true, None,
|
||||
Some("Moderation reasons are held for at least 60 days. Only User requested allows 14."),
|
||||
html! {
|
||||
input type="number" id="days_until_deletion" name="days_until_deletion"
|
||||
value="60" min="14" max="365" required
|
||||
class="w-full rounded-lg border border-neutral-300 bg-white \
|
||||
text-neutral-900 text-sm h-8 px-3 py-1.5 \
|
||||
focus:border-brand-primary focus:outline-none \
|
||||
focus:ring-2 focus:ring-brand-primary/20";
|
||||
},
|
||||
))
|
||||
(text_input("audit_log_reason", "Audit Log Reason (optional)", "", "Reason for this bulk operation"))
|
||||
(form_actions(html! {
|
||||
(danger_button("Schedule Deletion"))
|
||||
@@ -449,6 +466,21 @@ mod tests {
|
||||
assert!(!markup.contains(r#"value="CLONE_STICKER_DISABLED""#));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deletion_form_has_no_preselected_reason() {
|
||||
let markup = bulk_schedule_deletion_section("/admin", "csrf").into_string();
|
||||
assert!(markup.contains(r#"<option value="" selected>Select a reason</option>"#));
|
||||
for (value, _) in DELETION_REASONS {
|
||||
assert!(!markup.contains(&format!(r#"<option value="{value}" selected>"#)));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deletion_form_defaults_to_the_moderation_retention_floor() {
|
||||
let markup = bulk_schedule_deletion_section("/admin", "csrf").into_string();
|
||||
assert!(markup.contains(r#"name="days_until_deletion" value="60" min="14" max="365""#));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn remove_grid_can_clear_the_deprecated_clone_features() {
|
||||
let markup = guild_feature_checkbox_grid("remove_features[]", true).into_string();
|
||||
|
||||
@@ -16,7 +16,7 @@ use crate::{
|
||||
};
|
||||
use maud::{Markup, html};
|
||||
|
||||
const MAX_GIFT_CODES: u32 = 100;
|
||||
pub const MAX_GIFT_CODES: u32 = 100;
|
||||
const DEFAULT_GIFT_COUNT: u32 = 10;
|
||||
|
||||
pub fn gift_codes_page(
|
||||
@@ -44,12 +44,12 @@ pub fn gift_codes_page(
|
||||
(csrf_input(csrf_token))
|
||||
div class="flex flex-col gap-4" {
|
||||
(form_field_group(
|
||||
"Number of codes", "gift-count-slider", false, None,
|
||||
"Number of codes", "gift-count-slider", true, None,
|
||||
Some(&format!("Range: 1-{MAX_GIFT_CODES}")),
|
||||
html! {
|
||||
input type="number" id="gift-count-slider" name="count"
|
||||
value=(DEFAULT_GIFT_COUNT) min="1"
|
||||
max=(MAX_GIFT_CODES)
|
||||
max=(MAX_GIFT_CODES) required
|
||||
class=(FORM_INPUT_CLASS);
|
||||
},
|
||||
))
|
||||
|
||||
@@ -25,7 +25,9 @@ pub fn members_tab(
|
||||
let total = response.total;
|
||||
let total_pages = if limit > 0 { total.div_ceil(limit) } else { 1 };
|
||||
let has_previous = page > 0;
|
||||
let has_next = (page as u64) < total_pages.saturating_sub(1);
|
||||
let next_page = page
|
||||
.checked_add(1)
|
||||
.filter(|page| u64::from(*page) < total_pages);
|
||||
|
||||
html! {
|
||||
div class="space-y-4" {
|
||||
@@ -34,12 +36,16 @@ pub fn members_tab(
|
||||
"Guild Members (" (total) ")"
|
||||
}
|
||||
p class="text-sm text-neutral-500" {
|
||||
@let start = response.offset + 1;
|
||||
@let end = std::cmp::min(
|
||||
response.offset + response.members.len() as u64,
|
||||
total,
|
||||
);
|
||||
"Showing " (start) "-" (end) " of " (total)
|
||||
@if response.members.is_empty() {
|
||||
"Showing 0 of " (total)
|
||||
} @else {
|
||||
@let start = u128::from(response.offset) + 1;
|
||||
@let end = std::cmp::min(
|
||||
u128::from(response.offset) + response.members.len() as u128,
|
||||
u128::from(total),
|
||||
);
|
||||
"Showing " (start) "-" (end) " of " (total)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,10 +76,10 @@ pub fn members_tab(
|
||||
}
|
||||
}
|
||||
p class="text-sm text-neutral-500" {
|
||||
"Page " (page + 1) " of " (total_pages)
|
||||
"Page " (u64::from(page) + 1) " of " (total_pages)
|
||||
}
|
||||
@if has_next {
|
||||
a href={(base) "/guilds/" (guild.id) "?tab=members&page=" (page + 1)}
|
||||
@if let Some(next_page) = next_page {
|
||||
a href={(base) "/guilds/" (guild.id) "?tab=members&page=" (next_page)}
|
||||
class="inline-flex items-center rounded-md bg-brand-primary px-3 \
|
||||
py-2 text-sm font-medium text-white hover:bg-brand-primary-dark" {
|
||||
"Next \u{2192}"
|
||||
|
||||
@@ -40,13 +40,13 @@ fn channel_type_label(channel_type: i32) -> &'static str {
|
||||
pub fn overview_tab(config: &AdminConfig, guild: &GuildDetailInfo, csrf_token: &str) -> Markup {
|
||||
let base = &config.base_path;
|
||||
|
||||
let mut sorted_channels = guild.channels.clone();
|
||||
let mut sorted_channels: Vec<_> = guild.channels.iter().collect();
|
||||
sorted_channels.sort_by_key(|c| c.position);
|
||||
|
||||
let channels_by_id: std::collections::HashMap<&str, &crate::api::types::GuildChannelSummary> =
|
||||
guild.channels.iter().map(|c| (c.id.as_str(), c)).collect();
|
||||
|
||||
let mut sorted_roles = guild.roles.clone();
|
||||
let mut sorted_roles: Vec<_> = guild.roles.iter().collect();
|
||||
sorted_roles.sort_by_key(|role| std::cmp::Reverse(role.position));
|
||||
|
||||
let icon_url = guild_icon_url(config, &guild.id, guild.icon.as_deref(), 256, true);
|
||||
@@ -102,16 +102,10 @@ pub fn overview_tab(config: &AdminConfig, guild: &GuildDetailInfo, csrf_token: &
|
||||
p class="text-sm font-semibold text-neutral-500" {
|
||||
"Custom warning text"
|
||||
}
|
||||
@if let Some(ref text) = guild.content_warning_text {
|
||||
@if !text.trim().is_empty() {
|
||||
blockquote class="border-amber-300 border-l-2 bg-amber-50 \
|
||||
px-3 py-2 text-neutral-800 text-sm italic" {
|
||||
(text)
|
||||
}
|
||||
} @else {
|
||||
p class="text-sm text-neutral-500" {
|
||||
"\u{2014} (default fallback shown to users)"
|
||||
}
|
||||
@if let Some(text) = guild.content_warning_text.as_deref().filter(|text| !text.trim().is_empty()) {
|
||||
blockquote class="border-amber-300 border-l-2 bg-amber-50 \
|
||||
px-3 py-2 text-neutral-800 text-sm italic" {
|
||||
(text)
|
||||
}
|
||||
} @else {
|
||||
p class="text-sm text-neutral-500" {
|
||||
|
||||
@@ -17,8 +17,9 @@ pub fn reports_tab(
|
||||
let base = &config.base_path;
|
||||
let page_size: u64 = 25;
|
||||
let has_previous = page > 0;
|
||||
let has_next = (page as u64) * page_size + reports.len() as u64 > 0
|
||||
&& (page as u64 + 1) * page_size < total;
|
||||
let next_page = page.checked_add(1).filter(|next_page| {
|
||||
(page > 0 || !reports.is_empty()) && u64::from(*next_page) * page_size < total
|
||||
});
|
||||
html! {
|
||||
div class="space-y-4" {
|
||||
div class="flex items-center justify-between" {
|
||||
@@ -48,7 +49,7 @@ pub fn reports_tab(
|
||||
))
|
||||
}
|
||||
|
||||
@if has_previous || has_next {
|
||||
@if has_previous || next_page.is_some() {
|
||||
div class="flex justify-center gap-2" {
|
||||
@if has_previous {
|
||||
a href={(base) "/guilds/" (guild.id) "?tab=reports&reports_page=" (page - 1)}
|
||||
@@ -58,8 +59,8 @@ pub fn reports_tab(
|
||||
"\u{2190} Newer"
|
||||
}
|
||||
}
|
||||
@if has_next {
|
||||
a href={(base) "/guilds/" (guild.id) "?tab=reports&reports_page=" (page + 1)}
|
||||
@if let Some(next_page) = next_page {
|
||||
a href={(base) "/guilds/" (guild.id) "?tab=reports&reports_page=" (next_page)}
|
||||
class="inline-flex items-center rounded-md border border-neutral-300 \
|
||||
bg-white px-3 py-2 text-sm font-medium text-neutral-700 \
|
||||
hover:bg-neutral-50" {
|
||||
|
||||
@@ -64,7 +64,6 @@ impl GuildsListParams {
|
||||
pub struct GuildsListResults<'a> {
|
||||
pub guilds: Option<&'a [GuildInfo]>,
|
||||
pub total: Option<u64>,
|
||||
pub has_more: bool,
|
||||
}
|
||||
|
||||
pub fn guilds_list_page(
|
||||
@@ -73,14 +72,12 @@ pub fn guilds_list_page(
|
||||
params: &GuildsListParams,
|
||||
results: Option<&[GuildInfo]>,
|
||||
total: Option<u64>,
|
||||
has_more: bool,
|
||||
is_htmx: bool,
|
||||
) -> Markup {
|
||||
let base = &config.base_path;
|
||||
let result_state = GuildsListResults {
|
||||
guilds: results,
|
||||
total,
|
||||
has_more,
|
||||
};
|
||||
let has_results = results.is_some_and(|guilds| !guilds.is_empty());
|
||||
let header = html! {
|
||||
@@ -164,7 +161,10 @@ fn render_results(
|
||||
fn pagination(config: &AdminConfig, params: &GuildsListParams, total: u64) -> Markup {
|
||||
let total_pages = total.div_ceil(u64::from(params.limit)).max(1);
|
||||
let has_previous = params.page > 0;
|
||||
let has_next = u64::from(params.page) < total_pages.saturating_sub(1);
|
||||
let next_page = params
|
||||
.page
|
||||
.checked_add(1)
|
||||
.filter(|page| u64::from(*page) < total_pages);
|
||||
html! {
|
||||
div class="mt-6 flex items-center justify-center gap-3" {
|
||||
@if has_previous {
|
||||
@@ -181,10 +181,10 @@ fn pagination(config: &AdminConfig, params: &GuildsListParams, total: u64) -> Ma
|
||||
}
|
||||
}
|
||||
span class="text-neutral-600 text-sm" {
|
||||
"Page " (params.page + 1) " of " (total_pages)
|
||||
"Page " (u64::from(params.page) + 1) " of " (total_pages)
|
||||
}
|
||||
@if has_next {
|
||||
a href=(pagination_url(&config.base_path, params, params.page + 1))
|
||||
@if let Some(next_page) = next_page {
|
||||
a href=(pagination_url(&config.base_path, params, next_page))
|
||||
class="rounded-lg bg-neutral-900 px-6 py-2 font-medium text-sm \
|
||||
text-white no-underline transition-colors hover:bg-neutral-800" {
|
||||
"Next \u{2192}"
|
||||
@@ -200,8 +200,7 @@ fn pagination(config: &AdminConfig, params: &GuildsListParams, total: u64) -> Ma
|
||||
}
|
||||
|
||||
fn pagination_url(base: &str, params: &GuildsListParams, page: u32) -> String {
|
||||
let mut parts = Vec::new();
|
||||
parts.push(format!("page={page}"));
|
||||
let mut parts = vec![format!("page={page}"), format!("limit={}", params.limit)];
|
||||
if !params.q.is_empty() {
|
||||
parts.push(format!("q={}", urlencoding::encode(¶ms.q)));
|
||||
}
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
|
||||
use crate::{
|
||||
api::types::{
|
||||
AppPublicConfigResponse, ExperimentDeliveryConfigResponse, GatewayRolloutConfigResponse,
|
||||
InstanceConfigResponse, InstanceIntegrationsResponse, InstanceMediaResponse,
|
||||
InstancePolicyResponse, InstanceRegistrationResponse, LimitConfigResponse,
|
||||
NoiseSuppressionBackend, PendingRegistrationResponse, RegistrationUrlResponse,
|
||||
SsoConfigResponse, VOICE_NS_MAX_GUILD_OVERRIDES, VOICE_NS_MAX_TARGETED_USERS,
|
||||
AppPublicConfigResponse, BlockedMessageGroupsConfigResponse,
|
||||
ExperimentDeliveryConfigResponse, ExpressionInfoCardConfigResponse,
|
||||
GatewayRolloutConfigResponse, GuildActivityLogPresentationConfigResponse,
|
||||
GuildHeaderCollapseConfigResponse, InstanceConfigResponse, InstanceIntegrationsResponse,
|
||||
InstanceMediaResponse, InstancePolicyResponse, InstanceRegistrationResponse,
|
||||
LimitConfigResponse, MessageHoverTrackingConfigResponse,
|
||||
MessageKeyboardFocusConfigResponse, NoiseSuppressionBackend, PendingRegistrationResponse,
|
||||
RegistrationUrlResponse, SsoConfigResponse, TypingIndicatorReworkConfigResponse,
|
||||
VOICE_NS_MAX_GUILD_OVERRIDES, VOICE_NS_MAX_TARGETED_USERS,
|
||||
VoiceNoiseSuppressionConfigResponse,
|
||||
},
|
||||
config::AdminConfig,
|
||||
@@ -148,6 +152,13 @@ pub fn instance_config_page(
|
||||
html! {
|
||||
(gateway_rollout_section(base, csrf_token, &instance_config.gateway_rollout))
|
||||
(voice_noise_suppression_section(base, csrf_token, &instance_config.voice_noise_suppression))
|
||||
(message_hover_tracking_section(base, csrf_token, &instance_config.message_hover_tracking))
|
||||
(message_keyboard_focus_section(base, csrf_token, &instance_config.message_keyboard_focus))
|
||||
(blocked_message_groups_section(base, csrf_token, &instance_config.blocked_message_groups))
|
||||
(guild_activity_log_presentation_section(base, csrf_token, &instance_config.guild_activity_log_presentation))
|
||||
(expression_info_card_section(base, csrf_token, &instance_config.expression_info_card))
|
||||
(guild_header_collapse_section(base, csrf_token, &instance_config.guild_header_collapse))
|
||||
(typing_indicator_rework_section(base, csrf_token, &instance_config.typing_indicator_rework))
|
||||
(experiment_delivery_section(base, csrf_token, &instance_config.experiment_delivery))
|
||||
@if let Some(limit_config) = limit_config {
|
||||
(limit_config_section(base, limit_config))
|
||||
@@ -1175,6 +1186,733 @@ fn voice_noise_suppression_section(
|
||||
)
|
||||
}
|
||||
|
||||
fn message_hover_tracking_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
message_hover_tracking: &MessageHoverTrackingConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if message_hover_tracking.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = message_hover_tracking.included_user_ids.join("\n");
|
||||
let excluded_user_ids = message_hover_tracking.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Message Hover Tracking",
|
||||
"Picks which message hover implementation targeted clients run in the message list. A \
|
||||
targeted client resolves the hovered message from one shared pointer oracle and drives \
|
||||
the message action bar from that state. While the master switch below is off every \
|
||||
client keeps the per-row implementation it ships with, whatever the rest of these \
|
||||
fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_message_hover_tracking"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (message_hover_tracking.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"message_hover_enabled",
|
||||
"true",
|
||||
"Serve message hover tracking assignments to clients",
|
||||
message_hover_tracking.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps its current hover behavior, so the rollout \
|
||||
and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"message_hover_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&message_hover_tracking.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"message_hover_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&message_hover_tracking.rollout_salt,
|
||||
"message-hover-tracking-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"message_hover_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save; blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"message_hover_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Message Hover Tracking Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn message_keyboard_focus_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
message_keyboard_focus: &MessageKeyboardFocusConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if message_keyboard_focus.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = message_keyboard_focus.included_user_ids.join("\n");
|
||||
let excluded_user_ids = message_keyboard_focus.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Message Keyboard Focus",
|
||||
"Picks whether targeted clients run the keyboard navigation rework in the message list. \
|
||||
A targeted client reaches the message list from the composer with one Tab, walks \
|
||||
messages with the arrow keys through revealed blocked groups, and draws the focus ring \
|
||||
inside each row. While the master switch below is off every client keeps the keyboard \
|
||||
navigation it ships with, whatever the rest of these fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_message_keyboard_focus"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (message_keyboard_focus.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"message_keyboard_focus_enabled",
|
||||
"true",
|
||||
"Serve message keyboard focus assignments to clients",
|
||||
message_keyboard_focus.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps its current keyboard navigation, so the rollout \
|
||||
and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"message_keyboard_focus_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&message_keyboard_focus.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"message_keyboard_focus_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&message_keyboard_focus.rollout_salt,
|
||||
"message-keyboard-focus-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"message_keyboard_focus_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save; blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"message_keyboard_focus_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Message Keyboard Focus Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn blocked_message_groups_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
blocked_message_groups: &BlockedMessageGroupsConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if blocked_message_groups.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = blocked_message_groups.included_user_ids.join("\n");
|
||||
let excluded_user_ids = blocked_message_groups.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Blocked Message Groups",
|
||||
"Picks how targeted clients render a revealed block of blocked or suspected spam \
|
||||
messages. A targeted client draws the block full width, spaces consecutive message \
|
||||
groups inside it, and keys an unread divider apart from the group below it. While the \
|
||||
master switch below is off every client keeps the rendering it ships with, whatever the \
|
||||
rest of these fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_blocked_message_groups"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (blocked_message_groups.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"blocked_groups_enabled",
|
||||
"true",
|
||||
"Serve blocked message groups assignments to clients",
|
||||
blocked_message_groups.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps its current rendering, so the rollout \
|
||||
and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"blocked_groups_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&blocked_message_groups.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"blocked_groups_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&blocked_message_groups.rollout_salt,
|
||||
"blocked-message-groups-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"blocked_groups_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save; blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"blocked_groups_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Blocked Message Groups Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn guild_activity_log_presentation_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
guild_activity_log_presentation: &GuildActivityLogPresentationConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if guild_activity_log_presentation.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = guild_activity_log_presentation.included_user_ids.join("\n");
|
||||
let excluded_user_ids = guild_activity_log_presentation.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Guild Activity Log Presentation",
|
||||
"Picks which activity log rendering targeted clients run in community settings. A \
|
||||
targeted client renders each activity log entry through the rewritten presenters. \
|
||||
While the master switch below is off every client keeps the previous activity log \
|
||||
rendering, whatever the rest of these fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_guild_activity_log_presentation"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (guild_activity_log_presentation.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"guild_activity_log_presentation_enabled",
|
||||
"true",
|
||||
"Serve guild activity log presentation assignments to clients",
|
||||
guild_activity_log_presentation.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps the previous activity log rendering, so the \
|
||||
rollout and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"guild_activity_log_presentation_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&guild_activity_log_presentation.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"guild_activity_log_presentation_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&guild_activity_log_presentation.rollout_salt,
|
||||
"guild-activity-log-presentation-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"guild_activity_log_presentation_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save. Blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"guild_activity_log_presentation_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Guild Activity Log Presentation Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn expression_info_card_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
expression_info_card: &ExpressionInfoCardConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if expression_info_card.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = expression_info_card.included_user_ids.join("\n");
|
||||
let excluded_user_ids = expression_info_card.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Expression Info Card",
|
||||
"Picks what a targeted client shows for an emoji or a sticker in a message. A targeted \
|
||||
client opens a click-triggered info card that names the expression, says where it comes \
|
||||
from, and offers a row for the source community the reader can open. While the master \
|
||||
switch below is off every client keeps the hover tooltip it ships with, whatever the \
|
||||
rest of these fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_expression_info_card"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (expression_info_card.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"expression_card_enabled",
|
||||
"true",
|
||||
"Serve expression info card assignments to clients",
|
||||
expression_info_card.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps its current tooltip, so the rollout \
|
||||
and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"expression_card_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&expression_info_card.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"expression_card_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&expression_info_card.rollout_salt,
|
||||
"expression-info-card-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"expression_card_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save; blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"expression_card_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Expression Info Card Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn guild_header_collapse_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
guild_header_collapse: &GuildHeaderCollapseConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if guild_header_collapse.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = guild_header_collapse.included_user_ids.join("\n");
|
||||
let excluded_user_ids = guild_header_collapse.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Guild Header Collapse",
|
||||
"Picks how a targeted client draws the guild banner above the channel list. A targeted \
|
||||
client reduces that banner to the height of the header as the channel list scrolls down \
|
||||
and returns it to full height as the list scrolls back up. While the master switch below \
|
||||
is off every client keeps the fixed banner height it ships with, whatever the rest of \
|
||||
these fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_guild_header_collapse"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (guild_header_collapse.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"guild_header_collapse_enabled",
|
||||
"true",
|
||||
"Serve guild header collapse assignments to clients",
|
||||
guild_header_collapse.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps its current banner height, so the rollout \
|
||||
and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"guild_header_collapse_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&guild_header_collapse.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"guild_header_collapse_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&guild_header_collapse.rollout_salt,
|
||||
"guild-header-collapse-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"guild_header_collapse_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save. Blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"guild_header_collapse_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Guild Header Collapse Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn typing_indicator_rework_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
typing_indicator_rework: &TypingIndicatorReworkConfigResponse,
|
||||
) -> Markup {
|
||||
let status = if typing_indicator_rework.enabled {
|
||||
("Live", BadgeVariant::Success)
|
||||
} else {
|
||||
("Inert", BadgeVariant::Default)
|
||||
};
|
||||
let included_user_ids = typing_indicator_rework.included_user_ids.join("\n");
|
||||
let excluded_user_ids = typing_indicator_rework.excluded_user_ids.join("\n");
|
||||
section_card_with_description(
|
||||
"Typing Indicator Rework",
|
||||
"Picks how a targeted client sends and shows typing indicators. A targeted client sends a \
|
||||
typing signal 1.5 seconds after someone starts typing and then at most once every 8 \
|
||||
seconds, names up to three typists, and announces those names to screen readers even \
|
||||
where the visible row collapses them. While the master switch below is off every client \
|
||||
keeps the typing behaviour it ships with, whatever the rest of these fields say.",
|
||||
html! {
|
||||
form method="post" action={(base) "/instance-config?action=update_typing_indicator_rework"} {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-6" {
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Master switch" }
|
||||
(badge(status.0, status.1))
|
||||
span class="text-xs text-neutral-500" {
|
||||
"Config version " (typing_indicator_rework.config_version)
|
||||
}
|
||||
}
|
||||
(checkbox(
|
||||
"typing_indicator_rework_enabled",
|
||||
"true",
|
||||
"Serve typing indicator rework assignments to clients",
|
||||
typing_indicator_rework.enabled,
|
||||
true,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Off is the safe state. With this unchecked every client is told the \
|
||||
rollout is inert and keeps its current typing behaviour, so the rollout \
|
||||
and targeting fields below have no effect at all."
|
||||
}
|
||||
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "Rollout" }
|
||||
(number_field(
|
||||
"typing_indicator_rework_rollout_basis_points",
|
||||
"Rollout (basis points)",
|
||||
&typing_indicator_rework.rollout_basis_points.to_string(),
|
||||
Some(0), Some(10000), "1",
|
||||
Some("Share of users bucketed into the canary, in basis points: 0 is nobody, 100 is 1%, 10000 is everybody."),
|
||||
))
|
||||
div class="flex flex-col gap-2" {
|
||||
(text_input(
|
||||
"typing_indicator_rework_rollout_salt",
|
||||
"Rollout Salt",
|
||||
&typing_indicator_rework.rollout_salt,
|
||||
"typing-indicator-rework-v1",
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Seeds the bucketing hash. Changing it reshuffles which users fall \
|
||||
inside the percentage above. Leave it alone to keep the current \
|
||||
cohort stable."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"typing_indicator_rework_included_user_ids",
|
||||
"Always-on User IDs",
|
||||
"1500000000000000001\n1500000000000000002",
|
||||
&included_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"One snowflake per line, or comma separated. These users are targeted \
|
||||
regardless of the percentage above. IDs must contain 1 to 20 decimal \
|
||||
digits. Invalid entries prevent the save. Blank entries and duplicate \
|
||||
IDs are ignored."
|
||||
}
|
||||
}
|
||||
div class="flex flex-col gap-2" {
|
||||
(textarea_input(
|
||||
"typing_indicator_rework_excluded_user_ids",
|
||||
"Never-on User IDs",
|
||||
"1500000000000000003\n1500000000000000004",
|
||||
&excluded_user_ids,
|
||||
4,
|
||||
false,
|
||||
))
|
||||
p class="text-xs text-neutral-500" {
|
||||
"Same format. Exclusion wins over both the always-on list and the \
|
||||
percentage, so this is the per-user kill switch."
|
||||
}
|
||||
}
|
||||
|
||||
(form_actions(html! {
|
||||
(submit_button("Save Typing Indicator Rework Configuration"))
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn experiment_delivery_section(
|
||||
base: &str,
|
||||
csrf_token: &str,
|
||||
@@ -1830,4 +2568,44 @@ mod tests {
|
||||
assert!(markup.contains("1000 of 1000 stored"));
|
||||
assert!(markup.contains("at the cap"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guild_header_collapse_section_posts_its_own_action_and_fields() {
|
||||
let guild_header_collapse = GuildHeaderCollapseConfigResponse {
|
||||
included_user_ids: vec!["1500000000000000001".to_owned()],
|
||||
excluded_user_ids: vec!["1500000000000000002".to_owned()],
|
||||
..GuildHeaderCollapseConfigResponse::default()
|
||||
};
|
||||
let markup =
|
||||
guild_header_collapse_section("/admin", "csrf", &guild_header_collapse).into_string();
|
||||
assert!(markup.contains("/instance-config?action=update_guild_header_collapse"));
|
||||
assert!(markup.contains("Guild Header Collapse"));
|
||||
assert!(markup.contains("guild-header-collapse-v1"));
|
||||
assert!(markup.contains("guild_header_collapse_enabled"));
|
||||
assert!(markup.contains("guild_header_collapse_rollout_basis_points"));
|
||||
assert!(markup.contains("guild_header_collapse_rollout_salt"));
|
||||
assert!(markup.contains("guild_header_collapse_included_user_ids"));
|
||||
assert!(markup.contains("guild_header_collapse_excluded_user_ids"));
|
||||
assert!(!markup.contains("expression_card_"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn typing_indicator_rework_section_posts_its_own_action_and_fields() {
|
||||
let typing_indicator_rework = TypingIndicatorReworkConfigResponse {
|
||||
included_user_ids: vec!["1500000000000000001".to_owned()],
|
||||
excluded_user_ids: vec!["1500000000000000002".to_owned()],
|
||||
..TypingIndicatorReworkConfigResponse::default()
|
||||
};
|
||||
let markup = typing_indicator_rework_section("/admin", "csrf", &typing_indicator_rework)
|
||||
.into_string();
|
||||
assert!(markup.contains("/instance-config?action=update_typing_indicator_rework"));
|
||||
assert!(markup.contains("Typing Indicator Rework"));
|
||||
assert!(markup.contains("typing-indicator-rework-v1"));
|
||||
assert!(markup.contains("typing_indicator_rework_enabled"));
|
||||
assert!(markup.contains("typing_indicator_rework_rollout_basis_points"));
|
||||
assert!(markup.contains("typing_indicator_rework_rollout_salt"));
|
||||
assert!(markup.contains("typing_indicator_rework_included_user_ids"));
|
||||
assert!(markup.contains("typing_indicator_rework_excluded_user_ids"));
|
||||
assert!(!markup.contains("expression_card_"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ use crate::{
|
||||
templates::{
|
||||
components::{
|
||||
auto_refresh::auto_refresh,
|
||||
badge::{BadgeVariant, badge},
|
||||
data_field::{data_field_mono, data_field_text, data_grid},
|
||||
form::{csrf_input, danger_button, form_field_group},
|
||||
page_container::{page_header_with_actions, page_header_with_back},
|
||||
@@ -18,17 +17,7 @@ use crate::{
|
||||
};
|
||||
use maud::{Markup, html};
|
||||
|
||||
fn status_badge(status: &str) -> Markup {
|
||||
let variant = match status {
|
||||
"queued" => BadgeVariant::Default,
|
||||
"running" => BadgeVariant::Info,
|
||||
"succeeded" => BadgeVariant::Success,
|
||||
"failed" | "deadletter" => BadgeVariant::Danger,
|
||||
"cancelled" => BadgeVariant::Warning,
|
||||
_ => BadgeVariant::Default,
|
||||
};
|
||||
badge(status, variant)
|
||||
}
|
||||
use super::jobs_list_helpers::status_badge;
|
||||
|
||||
fn val_str<'a>(job: &'a serde_json::Value, key: &str) -> &'a str {
|
||||
job.get(key).and_then(|v| v.as_str()).unwrap_or("")
|
||||
@@ -71,7 +60,7 @@ fn progress_bar(job: &serde_json::Value) -> Markup {
|
||||
}
|
||||
(cur, Some(tot)) => {
|
||||
let c = cur.unwrap_or(0);
|
||||
let pct = (c * 100 / tot).min(100);
|
||||
let pct = (u128::from(c) * 100 / u128::from(tot)).min(100);
|
||||
html! {
|
||||
div role="progressbar" aria-valuenow=(pct) aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
|
||||
@@ -33,25 +33,26 @@ pub(crate) fn format_progress(job: &serde_json::Value) -> String {
|
||||
(Some(cur), None | Some(0)) => format!("{cur}"),
|
||||
(cur, Some(tot)) => {
|
||||
let c = cur.unwrap_or(0);
|
||||
let pct = c.saturating_mul(100).checked_div(tot).unwrap_or(0);
|
||||
let pct = (u128::from(c) * 100)
|
||||
.checked_div(u128::from(tot))
|
||||
.unwrap_or(0);
|
||||
format!("{c} / {tot} ({pct}%)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn job_row(base: &str, job: &serde_json::Value) -> Markup {
|
||||
let job_id = job
|
||||
.get("job_id")
|
||||
.and_then(|v| v.as_str().or_else(|| v.as_u64().map(|_| "")))
|
||||
.unwrap_or("");
|
||||
let job_id_display = job
|
||||
fn job_id_text(value: &serde_json::Value) -> String {
|
||||
value
|
||||
.get("job_id")
|
||||
.map(|v| match v {
|
||||
serde_json::Value::String(s) => s.clone(),
|
||||
serde_json::Value::Number(n) => n.to_string(),
|
||||
_ => v.to_string(),
|
||||
})
|
||||
.unwrap_or_default();
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub(crate) fn job_row(base: &str, job: &serde_json::Value) -> Markup {
|
||||
let job_id = job_id_text(job);
|
||||
let task_type = job
|
||||
.get("task_type")
|
||||
.and_then(|v| v.as_str())
|
||||
@@ -79,23 +80,17 @@ pub(crate) fn job_row(base: &str, job: &serde_json::Value) -> Markup {
|
||||
.unwrap_or_else(|| "cron".to_owned());
|
||||
let progress = format_progress(job);
|
||||
|
||||
let link_id = if job_id.is_empty() {
|
||||
&job_id_display
|
||||
} else {
|
||||
job_id
|
||||
};
|
||||
|
||||
table_row(html! {
|
||||
(table_cell(true, html! {
|
||||
span class="whitespace-nowrap text-sm" { (created_at) }
|
||||
}))
|
||||
(table_cell(false, html! {
|
||||
a href={(base) "/jobs/" (link_id)}
|
||||
a href={(base) "/jobs/" (job_id)}
|
||||
hx-target="#main-content"
|
||||
hx-swap="innerHTML"
|
||||
hx-push-url="true"
|
||||
class="text-blue-600 text-sm hover:underline" {
|
||||
(job_id_display)
|
||||
(job_id)
|
||||
}
|
||||
}))
|
||||
(table_cell(false, html! {
|
||||
@@ -103,7 +98,7 @@ pub(crate) fn job_row(base: &str, job: &serde_json::Value) -> Markup {
|
||||
}))
|
||||
(table_cell(false, html! { (status_badge(status)) }))
|
||||
(table_cell(false, html! {
|
||||
span class="text-sm" data-job-progress=(link_id) { (progress) }
|
||||
span class="text-sm" data-job-progress=(job_id) { (progress) }
|
||||
}))
|
||||
(table_cell(true, html! {
|
||||
span class="text-sm" { (attempts) "/" (max_attempts) }
|
||||
@@ -112,7 +107,7 @@ pub(crate) fn job_row(base: &str, job: &serde_json::Value) -> Markup {
|
||||
span class="text-sm" { (requester) }
|
||||
}))
|
||||
(table_cell(false, html! {
|
||||
a href={(base) "/jobs/" (link_id)}
|
||||
a href={(base) "/jobs/" (job_id)}
|
||||
hx-target="#main-content"
|
||||
hx-swap="innerHTML"
|
||||
hx-push-url="true"
|
||||
@@ -159,14 +154,7 @@ pub(crate) fn next_page_link(
|
||||
.get("created_at")
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("");
|
||||
let job_id = cursor
|
||||
.get("job_id")
|
||||
.map(|v| match v {
|
||||
serde_json::Value::String(s) => s.clone(),
|
||||
serde_json::Value::Number(n) => n.to_string(),
|
||||
_ => v.to_string(),
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let job_id = job_id_text(cursor);
|
||||
|
||||
let mut params = vec![
|
||||
format!("cursor_bucket_day={bucket_day}"),
|
||||
|
||||
@@ -466,7 +466,10 @@ fn reports_pagination(
|
||||
limit: u32,
|
||||
total: u64,
|
||||
) -> Markup {
|
||||
let total_pages = ((total + u64::from(limit).saturating_sub(1)) / u64::from(limit)).max(1);
|
||||
let total_pages = total.div_ceil(u64::from(limit)).max(1);
|
||||
let next_page = page
|
||||
.checked_add(1)
|
||||
.filter(|page| u64::from(*page) < total_pages);
|
||||
html! {
|
||||
div class="mt-4 flex items-center justify-between" {
|
||||
@if page > 0 {
|
||||
@@ -478,10 +481,10 @@ fn reports_pagination(
|
||||
span {}
|
||||
}
|
||||
span class="text-neutral-500 text-sm" {
|
||||
"Page " (page + 1) " of " (total_pages)
|
||||
"Page " (u64::from(page) + 1) " of " (total_pages)
|
||||
}
|
||||
@if u64::from(page + 1) < total_pages {
|
||||
a href=(reports_url(config, filters, page + 1, limit))
|
||||
@if let Some(next_page) = next_page {
|
||||
a href=(reports_url(config, filters, next_page, limit))
|
||||
class="text-neutral-900 underline decoration-neutral-300 hover:text-neutral-600 hover:decoration-neutral-500" {
|
||||
(PreEscaped("Next →"))
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ fn status_section(base: &str, rs: &RefreshStatus) -> Markup {
|
||||
|
||||
@if is_in_progress {
|
||||
@if let (Some(idx), Some(tot)) = (rs.indexed, rs.total) {
|
||||
@let pct = idx.saturating_mul(100).checked_div(tot).unwrap_or(0);
|
||||
@let pct = (u128::from(idx) * 100).checked_div(u128::from(tot)).unwrap_or(0);
|
||||
div class="space-y-2" {
|
||||
div class="flex items-center justify-between" {
|
||||
p class="text-sm text-neutral-700" {
|
||||
|
||||
@@ -146,7 +146,7 @@ fn deletion_card(base: &str, user: &AdminUser, csrf_token: &str) -> Markup {
|
||||
(csrf_input(csrf_token))
|
||||
div class="space-y-3" {
|
||||
(form_label("Days until deletion"))
|
||||
input type="number" name="days" value="60"
|
||||
input type="number" name="days_until_deletion" value="60"
|
||||
min="60" max="365"
|
||||
class="block w-full rounded-md border border-neutral-300 \
|
||||
px-3 py-2 text-sm shadow-sm \
|
||||
@@ -322,9 +322,8 @@ fn message_shred_status_content(status: &serde_json::Value) -> Markup {
|
||||
let total = value_u64(status, "total").unwrap_or(0);
|
||||
let processed = value_u64(status, "processed").unwrap_or(0);
|
||||
let skipped = value_u64(status, "skipped").unwrap_or(0);
|
||||
let percentage = processed
|
||||
.saturating_mul(100)
|
||||
.checked_div(total)
|
||||
let percentage = (u128::from(processed) * 100)
|
||||
.checked_div(u128::from(total))
|
||||
.unwrap_or(0)
|
||||
.min(100);
|
||||
html! {
|
||||
|
||||
@@ -78,9 +78,11 @@ fn report_section(
|
||||
}
|
||||
};
|
||||
|
||||
let offset = current_page as u64 * limit as u64;
|
||||
let offset = u64::from(current_page) * u64::from(limit);
|
||||
let has_previous = current_page > 0;
|
||||
let has_next = offset + (reports.len() as u64) < total;
|
||||
let next_page = current_page
|
||||
.checked_add(1)
|
||||
.filter(|_| (reports.len() as u64) < total.saturating_sub(offset));
|
||||
|
||||
let (sent_page, received_page) = if kind == "sent" {
|
||||
(current_page, other_page)
|
||||
@@ -115,7 +117,7 @@ fn report_section(
|
||||
))
|
||||
}
|
||||
|
||||
@if has_previous || has_next {
|
||||
@if has_previous || next_page.is_some() {
|
||||
div class="flex justify-center gap-2" {
|
||||
@if has_previous {
|
||||
a href={(base) "/users/" (user_id) "?tab=reports&reports_limit=" (limit) "&reports_sent_page=" (if kind == "sent" { current_page - 1 } else { sent_page }) "&reports_received_page=" (if kind == "received" { current_page - 1 } else { received_page })}
|
||||
@@ -125,8 +127,8 @@ fn report_section(
|
||||
"Previous"
|
||||
}
|
||||
}
|
||||
@if has_next {
|
||||
a href={(base) "/users/" (user_id) "?tab=reports&reports_limit=" (limit) "&reports_sent_page=" (if kind == "sent" { current_page + 1 } else { sent_page }) "&reports_received_page=" (if kind == "received" { current_page + 1 } else { received_page })}
|
||||
@if let Some(next_page) = next_page {
|
||||
a href={(base) "/users/" (user_id) "?tab=reports&reports_limit=" (limit) "&reports_sent_page=" (if kind == "sent" { next_page } else { sent_page }) "&reports_received_page=" (if kind == "received" { next_page } else { received_page })}
|
||||
class="inline-flex items-center rounded-md border \
|
||||
border-neutral-300 bg-white px-3 py-2 text-sm \
|
||||
font-medium text-neutral-700 hover:bg-neutral-50" {
|
||||
|
||||
@@ -393,6 +393,7 @@ fn render_users_table(config: &AdminConfig, users: &[AdminUser], can_view_email:
|
||||
}
|
||||
|
||||
fn pagination_controls(base: &str, params: &UserListParams, has_more: bool) -> Markup {
|
||||
let next_page = params.page.checked_add(1).filter(|_| has_more);
|
||||
html! {
|
||||
div class="mt-4 flex items-center justify-between" {
|
||||
@if params.page > 0 {
|
||||
@@ -403,8 +404,8 @@ fn pagination_controls(base: &str, params: &UserListParams, has_more: bool) -> M
|
||||
} @else {
|
||||
span {}
|
||||
}
|
||||
@if has_more {
|
||||
a href=(users_url(base, params, params.page + 1))
|
||||
@if let Some(next_page) = next_page {
|
||||
a href=(users_url(base, params, next_page))
|
||||
class="text-neutral-900 underline decoration-neutral-300 hover:text-neutral-600 hover:decoration-neutral-500" {
|
||||
"Next >"
|
||||
}
|
||||
|
||||
@@ -17,11 +17,14 @@ pub fn clean_string(value: &str) -> Option<String> {
|
||||
}
|
||||
|
||||
pub fn parse_comma_separated(value: &str) -> Vec<String> {
|
||||
comma_separated_values(value).map(str::to_owned).collect()
|
||||
}
|
||||
|
||||
fn comma_separated_values(value: &str) -> impl Iterator<Item = &str> {
|
||||
value
|
||||
.split([',', '\n', '\r'])
|
||||
.map(|s| s.trim().to_owned())
|
||||
.filter(|s| !s.is_empty())
|
||||
.collect()
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
@@ -63,12 +66,18 @@ impl MultiValueForm {
|
||||
self.first(key).and_then(clean_string)
|
||||
}
|
||||
|
||||
pub fn parse_i32(&self, key: &str) -> Option<i32> {
|
||||
self.first(key).and_then(|value| value.parse().ok())
|
||||
pub fn parse_value<T: std::str::FromStr>(&self, key: &str) -> Result<Option<T>, T::Err> {
|
||||
self.parse_value_any(&[key])
|
||||
}
|
||||
|
||||
pub fn parse_i64(&self, key: &str) -> Option<i64> {
|
||||
self.first(key).and_then(|value| value.parse().ok())
|
||||
pub fn parse_value_any<T: std::str::FromStr>(
|
||||
&self,
|
||||
keys: &[&str],
|
||||
) -> Result<Option<T>, T::Err> {
|
||||
keys.iter()
|
||||
.find_map(|key| self.first(key))
|
||||
.map(str::parse)
|
||||
.transpose()
|
||||
}
|
||||
|
||||
pub fn parse_u32(&self, key: &str) -> Option<u32> {
|
||||
@@ -92,13 +101,21 @@ impl MultiValueForm {
|
||||
.get(key)
|
||||
.into_iter()
|
||||
.flat_map(|values| values.iter())
|
||||
.flat_map(|value| parse_comma_separated(value))
|
||||
.flat_map(|value| comma_separated_values(value))
|
||||
.map(str::to_owned)
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn list_values_any(&self, keys: &[&str]) -> Vec<String> {
|
||||
keys.iter().flat_map(|key| self.list_values(key)).collect()
|
||||
}
|
||||
|
||||
pub fn parse_list_values<T: std::str::FromStr>(&self, keys: &[&str]) -> Result<Vec<T>, T::Err> {
|
||||
self.list_values_any(keys)
|
||||
.iter()
|
||||
.map(|value| value.parse())
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_page(value: Option<&str>) -> u32 {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
use fluxer_admin::api::generated::types as generated_types;
|
||||
use fluxer_admin::api::types;
|
||||
|
||||
#[test]
|
||||
@@ -247,6 +248,399 @@ fn deserialize_audit_logs_response() {
|
||||
assert_eq!(resp.logs[0].metadata.get("session_count").unwrap(), "3");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deserialize_guild_audit_logs_with_unknown_keys() {
|
||||
let json = r#"{
|
||||
"audit_log_entries": [
|
||||
{
|
||||
"id": "1508822460457747581",
|
||||
"action_type": 22,
|
||||
"user_id": "1130650140672000000",
|
||||
"target_id": "1130958221824557056",
|
||||
"reason": "spam",
|
||||
"options": {
|
||||
"delete_message_seconds": 3600,
|
||||
"future_option": {"nested": true}
|
||||
},
|
||||
"changes": [
|
||||
{"key": "future_change", "future_field": 1}
|
||||
],
|
||||
"future_entry_field": "ignored"
|
||||
},
|
||||
{
|
||||
"id": "1508822460457747580",
|
||||
"action_type": 31,
|
||||
"user_id": "1130650140672000000",
|
||||
"target_id": "1130958221824557057",
|
||||
"options": {
|
||||
"id": "1130958221824557057",
|
||||
"type": 0,
|
||||
"channel_id": "1130958221824557058",
|
||||
"role_name": "Moderators"
|
||||
},
|
||||
"changes": [
|
||||
{"key": "permissions_diff", "new_value": {"added": ["SEND_MESSAGES"], "removed": []}}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1508822460457747579",
|
||||
"action_type": 11,
|
||||
"user_id": "1130650140672000000",
|
||||
"target_id": "1130958221824557059",
|
||||
"options": {"type": 998},
|
||||
"changes": [
|
||||
{"key": "name", "old_value": "old-name", "new_value": "new-name"},
|
||||
{"key": "position", "old_value": 3, "new_value": 4},
|
||||
{"key": "nsfw", "new_value": true},
|
||||
{"key": "roles", "new_value": ["1130958221824557060", "1130958221824557061"]}
|
||||
]
|
||||
}
|
||||
],
|
||||
"users": [],
|
||||
"webhooks": []
|
||||
}"#;
|
||||
|
||||
let resp: generated_types::ListGuildAuditLogsResponse = serde_json::from_str(json).unwrap();
|
||||
assert_eq!(resp.audit_log_entries.len(), 3);
|
||||
|
||||
let ban = &resp.audit_log_entries[0];
|
||||
assert_eq!(*ban.action_type, 22);
|
||||
assert_eq!(ban.reason.as_deref(), Some("spam"));
|
||||
assert!(ban.options.is_some());
|
||||
assert_eq!(ban.changes.len(), 1);
|
||||
assert_eq!(ban.changes[0].key, "future_change");
|
||||
assert!(ban.changes[0].new_value.is_none());
|
||||
|
||||
let role_update = &resp.audit_log_entries[1];
|
||||
let options = role_update.options.as_ref().unwrap();
|
||||
assert_eq!(options.role_name.as_deref(), Some("Moderators"));
|
||||
assert_eq!(options.channel_id.as_deref(), Some("1130958221824557058"));
|
||||
assert_eq!(options.type_, Some(0.0));
|
||||
assert_eq!(role_update.changes[0].key, "permissions_diff");
|
||||
assert!(role_update.changes[0].new_value.is_some());
|
||||
|
||||
let channel_update = &resp.audit_log_entries[2];
|
||||
assert_eq!(channel_update.changes.len(), 4);
|
||||
assert_eq!(
|
||||
channel_update.changes[0]
|
||||
.old_value
|
||||
.as_ref()
|
||||
.and_then(|value| value.as_str()),
|
||||
Some("old-name")
|
||||
);
|
||||
assert_eq!(
|
||||
channel_update.changes[0]
|
||||
.new_value
|
||||
.as_ref()
|
||||
.and_then(|value| value.as_str()),
|
||||
Some("new-name")
|
||||
);
|
||||
assert_eq!(
|
||||
channel_update.changes[1]
|
||||
.new_value
|
||||
.as_ref()
|
||||
.and_then(|value| value.as_i64()),
|
||||
Some(4)
|
||||
);
|
||||
assert_eq!(
|
||||
channel_update.changes[2]
|
||||
.new_value
|
||||
.as_ref()
|
||||
.and_then(|value| value.as_bool()),
|
||||
Some(true)
|
||||
);
|
||||
assert_eq!(
|
||||
channel_update.changes[3]
|
||||
.new_value
|
||||
.as_ref()
|
||||
.and_then(|value| value.as_array())
|
||||
.map(|value| value.len()),
|
||||
Some(2)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deserialize_instance_config_response_with_unknown_keys() {
|
||||
let json = r##"{
|
||||
"sso": {
|
||||
"enabled": true,
|
||||
"enforced": false,
|
||||
"display_name": "Fluxer SSO",
|
||||
"issuer": "https://id.example.com",
|
||||
"authorization_url": "https://id.example.com/authorize",
|
||||
"token_url": "https://id.example.com/token",
|
||||
"userinfo_url": "https://id.example.com/userinfo",
|
||||
"jwks_url": "https://id.example.com/jwks.json",
|
||||
"client_id": "fluxer-admin",
|
||||
"client_secret_set": true,
|
||||
"scope": "openid profile email",
|
||||
"allowed_domains": ["fluxer.com"],
|
||||
"auto_provision": true,
|
||||
"redirect_uri": "https://fluxer.com/sso/callback"
|
||||
},
|
||||
"gateway_rollout": {
|
||||
"session_rollout_percentage": 100,
|
||||
"session_rollout_mode": "modulo",
|
||||
"guild_rollout_percentage": 100,
|
||||
"rpc_request_timeout_ms": 10000,
|
||||
"max_concurrent_session_starts": 512,
|
||||
"max_concurrent_guild_starts": 256,
|
||||
"gateway_dispatch_relay_shards": 32,
|
||||
"gateway_dispatch_relay_max_queue": 50000,
|
||||
"voice_e2ee_scope": "guild_feature_only",
|
||||
"future_rollout_knob": 3
|
||||
},
|
||||
"voice_noise_suppression": {
|
||||
"enabled": true,
|
||||
"config_version": 4,
|
||||
"default_backend": "rnnoise",
|
||||
"enabled_backends": ["none", "standard", "rnnoise"],
|
||||
"allow_user_override": true,
|
||||
"rollout_basis_points": 10000,
|
||||
"rollout_salt": "voice-ns-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": [],
|
||||
"guild_overrides": [],
|
||||
"stereo_enabled": false,
|
||||
"suppression_strength": 80
|
||||
},
|
||||
"guild_activity_log_presentation": {
|
||||
"enabled": true,
|
||||
"config_version": 2,
|
||||
"rollout_basis_points": 5000,
|
||||
"rollout_salt": "guild-activity-log-presentation-v1",
|
||||
"included_user_ids": ["1130650140672000000"],
|
||||
"excluded_user_ids": [],
|
||||
"future_presentation_knob": "verbose"
|
||||
},
|
||||
"experiment_delivery": {"poll_interval_seconds": 300, "poll_jitter_percent": 15},
|
||||
"message_hover_tracking": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "message-hover-tracking-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"message_keyboard_focus": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "message-keyboard-focus-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"blocked_message_groups": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "blocked-message-groups-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"expression_info_card": {
|
||||
"enabled": true,
|
||||
"config_version": 3,
|
||||
"rollout_basis_points": 2500,
|
||||
"rollout_salt": "expression-info-card-v1",
|
||||
"included_user_ids": ["1130650140672000000"],
|
||||
"excluded_user_ids": ["1130958221824557056"],
|
||||
"future_knob": 7,
|
||||
"future_object_knob": {"nested": true},
|
||||
"future_list_knob": ["a", "b"]
|
||||
},
|
||||
"guild_header_collapse": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "guild-header-collapse-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"typing_indicator_rework": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "typing-indicator-rework-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"registration": {
|
||||
"mode": "open",
|
||||
"admin_registration_urls_enabled": false,
|
||||
"urls": [],
|
||||
"pending_registrations": []
|
||||
},
|
||||
"self_hosted": false,
|
||||
"app_public": {
|
||||
"branding": {
|
||||
"product_name": "Fluxer",
|
||||
"icon_url": "https://cdn.example.com/icon.png",
|
||||
"symbol_url": "https://cdn.example.com/symbol.svg",
|
||||
"logo_url": "https://cdn.example.com/logo.svg",
|
||||
"wordmark_url": "https://cdn.example.com/wordmark.svg",
|
||||
"favicon_url": "https://cdn.example.com/favicon.ico",
|
||||
"theme_color": "#5865f2",
|
||||
"future_asset_url": "https://cdn.example.com/future.png"
|
||||
},
|
||||
"setup": {"configured": true},
|
||||
"legal": {
|
||||
"terms_url": "https://fluxer.com/terms",
|
||||
"privacy_url": "https://fluxer.com/privacy"
|
||||
},
|
||||
"registration": {"collect_date_of_birth": true}
|
||||
},
|
||||
"policy": {
|
||||
"single_community_enabled": false,
|
||||
"single_community_guild_id": null,
|
||||
"direct_messages_disabled": false,
|
||||
"direct_messages_locked": false,
|
||||
"premium_mode": "mirror",
|
||||
"services": {
|
||||
"gif_enabled": true,
|
||||
"youtube_enabled": true,
|
||||
"bluesky_enabled": false,
|
||||
"future_service_enabled": true
|
||||
},
|
||||
"services_resolved": {
|
||||
"gif_enabled": true,
|
||||
"youtube_enabled": true,
|
||||
"bluesky_enabled": false
|
||||
},
|
||||
"services_available": {"gif": true, "youtube": true, "bluesky": false},
|
||||
"deferred_phone_gate": {
|
||||
"enabled": false,
|
||||
"window_hours": 24,
|
||||
"member_threshold": 100
|
||||
}
|
||||
},
|
||||
"integrations": {
|
||||
"gif": {"klipy_api_key_set": true, "effective_available": true},
|
||||
"youtube": {"api_key_set": true, "effective_available": true},
|
||||
"captcha": {
|
||||
"provider": "hcaptcha",
|
||||
"effective_provider": "hcaptcha",
|
||||
"hcaptcha_site_key": "site",
|
||||
"hcaptcha_secret_key_set": true,
|
||||
"turnstile_site_key": "",
|
||||
"turnstile_secret_key_set": false,
|
||||
"effective_enabled": true
|
||||
},
|
||||
"email": {
|
||||
"enabled": true,
|
||||
"effective_enabled": true,
|
||||
"provider": "smtp",
|
||||
"effective_provider": "smtp",
|
||||
"from_email": "[email protected]",
|
||||
"from_name": "Fluxer",
|
||||
"smtp": {
|
||||
"host": "smtp.example.com",
|
||||
"port": 587,
|
||||
"username": "fluxer",
|
||||
"password_set": true,
|
||||
"secure": true
|
||||
},
|
||||
"disable_new_ip_authorization": false,
|
||||
"effective_disable_new_ip_authorization": false
|
||||
},
|
||||
"bluesky": {
|
||||
"enabled": false,
|
||||
"effective_enabled": false,
|
||||
"client_name": "Fluxer",
|
||||
"client_uri": "https://fluxer.com",
|
||||
"logo_uri": "https://cdn.example.com/logo.svg",
|
||||
"tos_uri": "https://fluxer.com/terms",
|
||||
"policy_uri": "https://fluxer.com/privacy",
|
||||
"key_count": 0
|
||||
}
|
||||
},
|
||||
"media": {
|
||||
"attachment_decay": {
|
||||
"enabled": true,
|
||||
"min_size_mb": 10,
|
||||
"max_size_mb": 500,
|
||||
"max_eligible_size_mb": 500,
|
||||
"min_lifetime_days": 30,
|
||||
"max_lifetime_days": 365,
|
||||
"curve": 2,
|
||||
"renew_threshold_days": 7,
|
||||
"renew_window_days": 14,
|
||||
"effective": {
|
||||
"enabled": true,
|
||||
"min_size_mb": 10,
|
||||
"max_size_mb": 500,
|
||||
"max_eligible_size_mb": 500,
|
||||
"min_lifetime_days": 30,
|
||||
"max_lifetime_days": 365,
|
||||
"curve": 2,
|
||||
"renew_threshold_days": 7,
|
||||
"renew_window_days": 14,
|
||||
"future_curve": 1.5
|
||||
}
|
||||
}
|
||||
},
|
||||
"future_section": {"enabled": true, "rollout_basis_points": 10000},
|
||||
"future_flag": 3
|
||||
}"##;
|
||||
|
||||
let resp: generated_types::InstanceConfigResponse = serde_json::from_str(json).expect(
|
||||
"the build.rs relaxation must keep unknown response keys from failing the whole response",
|
||||
);
|
||||
|
||||
assert!(!resp.self_hosted);
|
||||
assert!(resp.expression_info_card.enabled);
|
||||
assert_eq!(resp.expression_info_card.config_version, 3);
|
||||
assert_eq!(resp.expression_info_card.rollout_basis_points, 2500);
|
||||
assert_eq!(
|
||||
*resp.expression_info_card.rollout_salt,
|
||||
"expression-info-card-v1"
|
||||
);
|
||||
assert_eq!(resp.expression_info_card.included_user_ids.len(), 1);
|
||||
assert_eq!(
|
||||
*resp.expression_info_card.excluded_user_ids[0],
|
||||
"1130958221824557056"
|
||||
);
|
||||
assert!(resp.guild_activity_log_presentation.enabled);
|
||||
assert_eq!(
|
||||
*resp.guild_activity_log_presentation.rollout_salt,
|
||||
"guild-activity-log-presentation-v1"
|
||||
);
|
||||
assert!(!resp.message_hover_tracking.enabled);
|
||||
assert!(!resp.message_keyboard_focus.enabled);
|
||||
assert!(!resp.blocked_message_groups.enabled);
|
||||
assert!(!resp.guild_header_collapse.enabled);
|
||||
assert!(!resp.typing_indicator_rework.enabled);
|
||||
assert_eq!(resp.experiment_delivery.poll_interval_seconds, 300);
|
||||
assert!(resp.policy.single_community_guild_id.is_none());
|
||||
assert_eq!(resp.policy.services.gif_enabled, Some(true));
|
||||
assert_eq!(resp.app_public.branding.product_name, "Fluxer");
|
||||
assert!(resp.media.attachment_decay.effective.enabled);
|
||||
|
||||
let without_unknown_keys = json
|
||||
.replace("\"future_rollout_knob\": 3,", "")
|
||||
.replace("\"future_presentation_knob\": \"verbose\",", "")
|
||||
.replace("\"future_knob\": 7,", "")
|
||||
.replace("\"future_object_knob\": {\"nested\": true},", "")
|
||||
.replace("\"future_list_knob\": [\"a\", \"b\"],", "")
|
||||
.replace(
|
||||
"\"future_asset_url\": \"https://cdn.example.com/future.png\",",
|
||||
"",
|
||||
)
|
||||
.replace("\"future_service_enabled\": true,", "")
|
||||
.replace("\"future_curve\": 1.5,", "")
|
||||
.replace(
|
||||
"\"future_section\": {\"enabled\": true, \"rollout_basis_points\": 10000},",
|
||||
"",
|
||||
)
|
||||
.replace("\"future_flag\": 3,", "");
|
||||
let baseline: generated_types::InstanceConfigResponse =
|
||||
serde_json::from_str(&without_unknown_keys).expect("known keys alone still deserialize");
|
||||
assert_eq!(
|
||||
serde_json::to_value(&baseline).unwrap(),
|
||||
serde_json::to_value(&resp).unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deserialize_search_reports_response() {
|
||||
let json = r#"{
|
||||
|
||||
@@ -432,6 +432,8 @@ async fn mutating_admin_pages_render_usable_csrf_tokens() {
|
||||
"/instance-config?action=update_gateway_rollout",
|
||||
"/instance-config?action=update_sso",
|
||||
"/instance-config?action=update_voice_noise_suppression",
|
||||
"/instance-config?action=update_guild_header_collapse",
|
||||
"/instance-config?action=update_typing_indicator_rework",
|
||||
"/instance-config?action=update_experiment_delivery",
|
||||
][..],
|
||||
),
|
||||
@@ -1097,6 +1099,22 @@ fn instance_config() -> Value {
|
||||
"max_concurrent_guild_starts": 16,
|
||||
"voice_e2ee_scope": "guild_feature_only"
|
||||
},
|
||||
"guild_header_collapse": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "guild-header-collapse-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"typing_indicator_rework": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
"rollout_basis_points": 0,
|
||||
"rollout_salt": "typing-indicator-rework-v1",
|
||||
"included_user_ids": [],
|
||||
"excluded_user_ids": []
|
||||
},
|
||||
"voice_noise_suppression": {
|
||||
"enabled": false,
|
||||
"config_version": 0,
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
"@pkgs/email": "workspace:*",
|
||||
"@pkgs/geoip": "workspace:*",
|
||||
"@pkgs/http_client": "workspace:*",
|
||||
"@pkgs/initialization": "workspace:*",
|
||||
"@pkgs/kv_client": "workspace:*",
|
||||
"@pkgs/locale": "workspace:*",
|
||||
"@pkgs/media_proxy_utils": "workspace:*",
|
||||
|
||||
+2
-6
@@ -6,12 +6,8 @@ import type {CacheLookupResult} from '@pkgs/cache/src/ICacheService';
|
||||
export function parseCachedValue<T>(value: string, logger?: CacheLogger): CacheLookupResult<T> {
|
||||
try {
|
||||
return {hit: true, value: JSON.parse(value)};
|
||||
} catch (error) {
|
||||
if (logger) {
|
||||
const truncatedValue = value.length > 200 ? `${value.substring(0, 200)}...` : value;
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
logger.error({errorMessage, value: truncatedValue}, '[CacheProvider] JSON parse error');
|
||||
}
|
||||
} catch {
|
||||
logger?.error({valueLength: value.length}, '[CacheProvider] JSON parse error');
|
||||
return {hit: false};
|
||||
}
|
||||
}
|
||||
|
||||
+103
-86
@@ -8,27 +8,34 @@ import {
|
||||
} from '@pkgs/cache/src/CacheLockValidation';
|
||||
import {type CacheLookupResult, ICacheService} from '@pkgs/cache/src/ICacheService';
|
||||
|
||||
interface CacheEntry<T> {
|
||||
value: T;
|
||||
interface CacheEntry {
|
||||
expiresAt?: number;
|
||||
}
|
||||
|
||||
interface CacheValueEntry extends CacheEntry {
|
||||
kind: 'value';
|
||||
value: unknown;
|
||||
}
|
||||
|
||||
interface CacheSetEntry extends CacheEntry {
|
||||
kind: 'set';
|
||||
value: Set<string>;
|
||||
}
|
||||
|
||||
interface CacheLockEntry extends CacheEntry {
|
||||
token: string;
|
||||
expiresAt: number;
|
||||
}
|
||||
|
||||
interface InMemoryProviderConfig {
|
||||
maxSize?: number;
|
||||
cleanupIntervalMs?: number;
|
||||
}
|
||||
|
||||
export class InMemoryProvider extends ICacheService {
|
||||
private cache = new Map<string, CacheEntry<unknown>>();
|
||||
private sets = new Map<string, Set<string>>();
|
||||
private locks = new Map<
|
||||
string,
|
||||
{
|
||||
token: string;
|
||||
expiresAt: number;
|
||||
}
|
||||
>();
|
||||
private maxSize: number;
|
||||
private readonly cache = new Map<string, CacheValueEntry | CacheSetEntry>();
|
||||
private readonly locks = new Map<string, CacheLockEntry>();
|
||||
private readonly maxSize: number;
|
||||
private cleanupInterval?: NodeJS.Timeout;
|
||||
|
||||
constructor(config: InMemoryProviderConfig = {}) {
|
||||
@@ -42,20 +49,53 @@ export class InMemoryProvider extends ICacheService {
|
||||
private cleanup(): void {
|
||||
const now = Date.now();
|
||||
for (const [key, entry] of this.cache.entries()) {
|
||||
if (entry.expiresAt && entry.expiresAt <= now) {
|
||||
if (this.isExpired(entry, now)) {
|
||||
this.cache.delete(key);
|
||||
}
|
||||
}
|
||||
for (const [key, lock] of this.locks.entries()) {
|
||||
if (lock.expiresAt <= now) {
|
||||
if (this.isExpired(lock, now)) {
|
||||
this.locks.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private isExpired(entry: CacheEntry<unknown>): boolean {
|
||||
if (!entry.expiresAt) return false;
|
||||
return Date.now() >= entry.expiresAt;
|
||||
private isExpired(entry: CacheEntry, now = Date.now()): boolean {
|
||||
return entry.expiresAt !== undefined && now >= entry.expiresAt;
|
||||
}
|
||||
|
||||
private getLiveEntry(key: string): CacheValueEntry | CacheSetEntry | undefined {
|
||||
const entry = this.cache.get(key);
|
||||
if (entry && this.isExpired(entry)) {
|
||||
this.cache.delete(key);
|
||||
return undefined;
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private getValueEntry(key: string): CacheValueEntry | undefined {
|
||||
const entry = this.getLiveEntry(key);
|
||||
if (entry && entry.kind !== 'value') {
|
||||
throw new Error('Cache key contains a set, not a value.');
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private getSetEntry(key: string): CacheSetEntry | undefined {
|
||||
const entry = this.getLiveEntry(key);
|
||||
if (entry && entry.kind !== 'set') {
|
||||
throw new Error('Cache key contains a value, not a set.');
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
private getLiveLock(key: string): CacheLockEntry | undefined {
|
||||
const lock = this.locks.get(key);
|
||||
if (lock && this.isExpired(lock)) {
|
||||
this.locks.delete(key);
|
||||
return undefined;
|
||||
}
|
||||
return lock;
|
||||
}
|
||||
|
||||
private evictIfNeeded(): void {
|
||||
@@ -68,18 +108,16 @@ export class InMemoryProvider extends ICacheService {
|
||||
}
|
||||
|
||||
async getEntry<T>(key: string): Promise<CacheLookupResult<T>> {
|
||||
const entry = this.cache.get(key) as CacheEntry<T> | undefined;
|
||||
if (!entry) return {hit: false};
|
||||
if (this.isExpired(entry)) {
|
||||
this.cache.delete(key);
|
||||
return {hit: false};
|
||||
}
|
||||
return {hit: true, value: entry.value};
|
||||
const entry = this.getValueEntry(key);
|
||||
return entry ? {hit: true, value: entry.value as T} : {hit: false};
|
||||
}
|
||||
|
||||
async set<T>(key: string, value: T, ttlSeconds?: number): Promise<void> {
|
||||
this.evictIfNeeded();
|
||||
const entry: CacheEntry<T> = {
|
||||
if (!this.cache.has(key)) {
|
||||
this.evictIfNeeded();
|
||||
}
|
||||
const entry: CacheValueEntry = {
|
||||
kind: 'value',
|
||||
value,
|
||||
expiresAt: ttlSeconds ? Date.now() + ttlSeconds * 1000 : undefined,
|
||||
};
|
||||
@@ -91,36 +129,28 @@ export class InMemoryProvider extends ICacheService {
|
||||
}
|
||||
|
||||
async getAndDelete<T>(key: string): Promise<T | null> {
|
||||
const value = await this.get<T>(key);
|
||||
if (value !== null) {
|
||||
this.cache.delete(key);
|
||||
}
|
||||
return value;
|
||||
const entry = this.getValueEntry(key);
|
||||
this.cache.delete(key);
|
||||
return entry ? (entry.value as T) : null;
|
||||
}
|
||||
|
||||
async exists(key: string): Promise<boolean> {
|
||||
const entry = this.cache.get(key);
|
||||
if (!entry) return false;
|
||||
if (this.isExpired(entry)) {
|
||||
this.cache.delete(key);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return this.getLiveEntry(key) !== undefined;
|
||||
}
|
||||
|
||||
async expire(key: string, ttlSeconds: number): Promise<void> {
|
||||
const entry = this.cache.get(key);
|
||||
if (entry && !this.isExpired(entry)) {
|
||||
const entry = this.getLiveEntry(key);
|
||||
if (entry) {
|
||||
entry.expiresAt = Date.now() + ttlSeconds * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
async ttl(key: string): Promise<number> {
|
||||
const entry = this.cache.get(key);
|
||||
if (!entry || this.isExpired(entry)) {
|
||||
const entry = this.getLiveEntry(key);
|
||||
if (!entry) {
|
||||
return -2;
|
||||
}
|
||||
if (!entry.expiresAt) {
|
||||
if (entry.expiresAt === undefined) {
|
||||
return -1;
|
||||
}
|
||||
const ttlMs = entry.expiresAt - Date.now();
|
||||
@@ -128,11 +158,10 @@ export class InMemoryProvider extends ICacheService {
|
||||
}
|
||||
|
||||
async mget<T>(keys: Array<string>): Promise<Array<T | null>> {
|
||||
const results: Array<T | null> = [];
|
||||
for (const key of keys) {
|
||||
results.push(await this.get<T>(key));
|
||||
}
|
||||
return results;
|
||||
return keys.map((key) => {
|
||||
const entry = this.getLiveEntry(key);
|
||||
return entry?.kind === 'value' ? (entry.value as T) : null;
|
||||
});
|
||||
}
|
||||
|
||||
async mset<T>(
|
||||
@@ -162,8 +191,7 @@ export class InMemoryProvider extends ICacheService {
|
||||
async acquireLock(key: string, ttlSeconds: number): Promise<string | null> {
|
||||
validateLockKey(key);
|
||||
const lockKey = formatLockKey(key);
|
||||
const existingLock = this.locks.get(lockKey);
|
||||
if (existingLock && existingLock.expiresAt > Date.now()) {
|
||||
if (this.getLiveLock(lockKey)) {
|
||||
return null;
|
||||
}
|
||||
const token = generateLockToken();
|
||||
@@ -178,7 +206,7 @@ export class InMemoryProvider extends ICacheService {
|
||||
validateLockKey(key);
|
||||
validateLockToken(token);
|
||||
const lockKey = formatLockKey(key);
|
||||
const lock = this.locks.get(lockKey);
|
||||
const lock = this.getLiveLock(lockKey);
|
||||
if (!lock || lock.token !== token) {
|
||||
return false;
|
||||
}
|
||||
@@ -190,23 +218,21 @@ export class InMemoryProvider extends ICacheService {
|
||||
validateLockKey(key);
|
||||
validateLockToken(token);
|
||||
const lockKey = formatLockKey(key);
|
||||
const lock = this.locks.get(lockKey);
|
||||
if (!lock || lock.token !== token || lock.expiresAt <= Date.now()) {
|
||||
const lock = this.getLiveLock(lockKey);
|
||||
if (!lock || lock.token !== token) {
|
||||
return false;
|
||||
}
|
||||
this.locks.set(lockKey, {
|
||||
token,
|
||||
expiresAt: Date.now() + ttlSeconds * 1000,
|
||||
});
|
||||
lock.expiresAt = Date.now() + ttlSeconds * 1000;
|
||||
return true;
|
||||
}
|
||||
|
||||
async getAndRenewTtl<T>(key: string, newTtlSeconds: number): Promise<T | null> {
|
||||
const value = await this.get<T>(key);
|
||||
if (value !== null) {
|
||||
await this.expire(key, newTtlSeconds);
|
||||
const entry = this.getValueEntry(key);
|
||||
if (!entry) {
|
||||
return null;
|
||||
}
|
||||
return value;
|
||||
entry.expiresAt = Date.now() + newTtlSeconds * 1000;
|
||||
return entry.value as T;
|
||||
}
|
||||
|
||||
async publish(_channel: string, _message: string): Promise<void> {
|
||||
@@ -214,43 +240,35 @@ export class InMemoryProvider extends ICacheService {
|
||||
}
|
||||
|
||||
async sadd(key: string, member: string, ttlSeconds?: number): Promise<void> {
|
||||
let set = this.sets.get(key);
|
||||
if (!set) {
|
||||
set = new Set<string>();
|
||||
this.sets.set(key, set);
|
||||
let entry = this.getSetEntry(key);
|
||||
if (!entry) {
|
||||
this.evictIfNeeded();
|
||||
entry = {kind: 'set', value: new Set<string>()};
|
||||
this.cache.set(key, entry);
|
||||
}
|
||||
set.add(member);
|
||||
entry.value.add(member);
|
||||
if (ttlSeconds) {
|
||||
await this.set(`${key}:expiry`, {}, ttlSeconds);
|
||||
entry.expiresAt = Date.now() + ttlSeconds * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
async srem(key: string, member: string): Promise<void> {
|
||||
const set = this.sets.get(key);
|
||||
if (set) {
|
||||
set.delete(member);
|
||||
if (set.size === 0) {
|
||||
this.sets.delete(key);
|
||||
}
|
||||
const entry = this.getSetEntry(key);
|
||||
if (!entry) {
|
||||
return;
|
||||
}
|
||||
entry.value.delete(member);
|
||||
if (entry.value.size === 0) {
|
||||
this.cache.delete(key);
|
||||
}
|
||||
}
|
||||
|
||||
async smembers(key: string): Promise<Set<string>> {
|
||||
const expiryExists = await this.exists(`${key}:expiry`);
|
||||
if (!expiryExists && this.sets.has(key)) {
|
||||
return new Set();
|
||||
}
|
||||
return this.sets.get(key) ?? new Set<string>();
|
||||
return new Set(this.getSetEntry(key)?.value);
|
||||
}
|
||||
|
||||
async sismember(key: string, member: string): Promise<boolean> {
|
||||
const set = this.sets.get(key);
|
||||
if (!set) return false;
|
||||
const expiryExists = await this.exists(`${key}:expiry`);
|
||||
if (!expiryExists) {
|
||||
return false;
|
||||
}
|
||||
return set.has(member);
|
||||
return this.getSetEntry(key)?.value.has(member) ?? false;
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
@@ -259,7 +277,6 @@ export class InMemoryProvider extends ICacheService {
|
||||
this.cleanupInterval = undefined;
|
||||
}
|
||||
this.cache.clear();
|
||||
this.sets.clear();
|
||||
this.locks.clear();
|
||||
}
|
||||
}
|
||||
|
||||
+11
-7
@@ -10,7 +10,7 @@ import {
|
||||
import type {CacheLogger, CacheTelemetry} from '@pkgs/cache/src/CacheProviderTypes';
|
||||
import {parseCachedValue, safeJsonParse, serializeValue} from '@pkgs/cache/src/CacheSerialization';
|
||||
import {type CacheLookupResult, ICacheService} from '@pkgs/cache/src/ICacheService';
|
||||
import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
|
||||
import type {IKVPipeline, IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
|
||||
import {runSlotBatches, splitIntoSlotBatches} from '@pkgs/kv_client/src/KVHashSlots';
|
||||
|
||||
interface KVCacheProviderConfig {
|
||||
@@ -70,6 +70,14 @@ export class KVCacheProvider extends ICacheService {
|
||||
}
|
||||
}
|
||||
|
||||
private async executePipeline(pipeline: IKVPipeline): Promise<void> {
|
||||
for (const [error] of await pipeline.exec()) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getEntry<T>(key: string): Promise<CacheLookupResult<T>> {
|
||||
return this.instrumented(
|
||||
'get',
|
||||
@@ -153,11 +161,7 @@ export class KVCacheProvider extends ICacheService {
|
||||
pipeline.set(entry.key, entry.value);
|
||||
}
|
||||
}
|
||||
for (const [error] of await pipeline.exec()) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
await this.executePipeline(pipeline);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -204,7 +208,7 @@ export class KVCacheProvider extends ICacheService {
|
||||
if (ttlSeconds) {
|
||||
pipeline.expire(key, ttlSeconds);
|
||||
}
|
||||
await pipeline.exec();
|
||||
await this.executePipeline(pipeline);
|
||||
}
|
||||
|
||||
async srem(key: string, member: string): Promise<void> {
|
||||
|
||||
@@ -20,6 +20,21 @@ interface CaptchaVerifyResponse {
|
||||
'error-codes'?: Array<string>;
|
||||
hostname?: string;
|
||||
challenge_ts?: string;
|
||||
score?: number;
|
||||
}
|
||||
|
||||
function isCaptchaVerifyResponse(value: unknown): value is CaptchaVerifyResponse {
|
||||
if (typeof value !== 'object' || value === null || Array.isArray(value)) return false;
|
||||
const data = value as Record<string, unknown>;
|
||||
const errorCodes = data['error-codes'];
|
||||
return (
|
||||
typeof data.success === 'boolean' &&
|
||||
(errorCodes === undefined || (Array.isArray(errorCodes) && errorCodes.every((code) => typeof code === 'string'))) &&
|
||||
(data.hostname === undefined || typeof data.hostname === 'string') &&
|
||||
(data.challenge_ts === undefined || typeof data.challenge_ts === 'string') &&
|
||||
(data.score === undefined ||
|
||||
(typeof data.score === 'number' && Number.isFinite(data.score) && data.score >= 0 && data.score <= 1))
|
||||
);
|
||||
}
|
||||
|
||||
export abstract class HttpCaptchaProvider implements ICaptchaProvider {
|
||||
@@ -58,10 +73,17 @@ export abstract class HttpCaptchaProvider implements ICaptchaProvider {
|
||||
signal: AbortSignal.timeout(this.timeoutMs),
|
||||
});
|
||||
if (!response.ok) {
|
||||
await response.body?.cancel().catch(() => {
|
||||
this.logger?.warn({status: response.status}, `${this.providerName} failed to cancel discarded response body`);
|
||||
});
|
||||
this.logger?.error({status: response.status}, `${this.providerName} verify request failed`);
|
||||
return false;
|
||||
}
|
||||
const data = (await response.json()) as CaptchaVerifyResponse;
|
||||
const data: unknown = await response.json();
|
||||
if (!isCaptchaVerifyResponse(data)) {
|
||||
this.logger?.error({}, `${this.providerName} returned an invalid verification response`);
|
||||
return false;
|
||||
}
|
||||
if (!data.success) {
|
||||
this.logger?.warn({errorCodes: data['error-codes']}, `${this.providerName} verification failed`);
|
||||
return false;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
import type {Client} from '@elastic/elasticsearch';
|
||||
import type {SortCombinations} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {AuditLogSearchFilters, SearchableAuditLog} from '@fluxer/schema/src/contracts/search/SearchDocumentTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import {compactFilters, esTermFilter} from '../ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchDistributedLock} from './ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from './ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchDistributedLock} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {compactFilters, esTermFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
function buildAuditLogFilters(filters: AuditLogSearchFilters): Array<ElasticsearchFilter | undefined> {
|
||||
const clauses: Array<ElasticsearchFilter | undefined> = [];
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
import type {Client} from '@elastic/elasticsearch';
|
||||
import type {SortCombinations} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {GuildSearchFilters, SearchableGuild} from '@fluxer/schema/src/contracts/search/SearchDocumentTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import {compactFilters, esAndTerms, esTermFilter} from '../ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchDistributedLock} from './ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from './ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchDistributedLock} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {compactFilters, esAndTerms, esTermFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
function buildGuildFilters(filters: GuildSearchFilters): Array<ElasticsearchFilter | undefined> {
|
||||
const clauses: Array<ElasticsearchFilter | undefined> = [];
|
||||
|
||||
+11
-5
@@ -6,11 +6,17 @@ import type {
|
||||
GuildMemberSearchFilters,
|
||||
SearchableGuildMember,
|
||||
} from '@fluxer/schema/src/contracts/search/SearchDocumentTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import {compactFilters, esAndTerms, esRangeFilter, esTermFilter, esTermsFilter} from '../ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchDistributedLock} from './ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from './ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchDistributedLock} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {
|
||||
compactFilters,
|
||||
esAndTerms,
|
||||
esRangeFilter,
|
||||
esTermFilter,
|
||||
esTermsFilter,
|
||||
} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
function buildGuildMemberFilters(filters: GuildMemberSearchFilters): Array<ElasticsearchFilter | undefined> {
|
||||
const clauses: Array<ElasticsearchFilter | undefined> = [];
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {Client} from '@elastic/elasticsearch';
|
||||
import type {SearchRequest, SortCombinations, SortResults} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {
|
||||
BulkOperationType,
|
||||
BulkResponse,
|
||||
DeleteByQueryResponse,
|
||||
ErrorCause,
|
||||
SearchRequest,
|
||||
SortCombinations,
|
||||
SortResults,
|
||||
} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {ISearchAdapter, SearchOptions, SearchResult} from '@fluxer/schema/src/contracts/search/SearchAdapterTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import {compactFilters} from '../ElasticsearchFilterUtils';
|
||||
import type {ElasticsearchIndexDefinition} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {compactFilters} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import type {ElasticsearchIndexDefinition} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
const ELASTICSEARCH_MAX_RESULT_WINDOW = 10000;
|
||||
const DEEP_PAGINATION_BATCH_SIZE = 1000;
|
||||
const MAX_SEARCH_LIMIT = 1000;
|
||||
const FACET_TERM_LIMIT = 200;
|
||||
const ERROR_TYPE_MAX_LENGTH = 128;
|
||||
|
||||
interface ElasticsearchSearchHit<TResult> {
|
||||
_source?: TResult;
|
||||
@@ -191,7 +200,8 @@ export class ElasticsearchIndexAdapter<
|
||||
}
|
||||
this.assertInitialised();
|
||||
const operations = docs.flatMap((doc) => [{index: {_index: this.indexDefinition.indexName, _id: doc.id}}, doc]);
|
||||
await this.client.bulk({operations, refresh: false});
|
||||
const response = await this.client.bulk({operations, refresh: false});
|
||||
this.assertBulkSucceeded(response, 'index');
|
||||
}
|
||||
|
||||
async updateDocument(doc: TResult): Promise<void> {
|
||||
@@ -205,12 +215,7 @@ export class ElasticsearchIndexAdapter<
|
||||
}
|
||||
|
||||
async bulkIndexDocuments(docs: Array<TResult>): Promise<void> {
|
||||
if (docs.length === 0) {
|
||||
return;
|
||||
}
|
||||
this.assertInitialised();
|
||||
const operations = docs.flatMap((doc) => [{index: {_index: this.indexDefinition.indexName, _id: doc.id}}, doc]);
|
||||
await this.client.bulk({operations, refresh: false});
|
||||
await this.indexDocuments(docs);
|
||||
}
|
||||
|
||||
async refreshIndex(): Promise<void> {
|
||||
@@ -228,25 +233,28 @@ export class ElasticsearchIndexAdapter<
|
||||
}
|
||||
this.assertInitialised();
|
||||
const operations = ids.map((id) => ({delete: {_index: this.indexDefinition.indexName, _id: id}}));
|
||||
await this.client.bulk({operations, refresh: false});
|
||||
const response = await this.client.bulk({operations, refresh: false});
|
||||
this.assertBulkSucceeded(response, 'delete');
|
||||
}
|
||||
|
||||
async deleteByQuery(query: Record<string, unknown>): Promise<void> {
|
||||
this.assertInitialised();
|
||||
await this.client.deleteByQuery({
|
||||
const response = await this.client.deleteByQuery({
|
||||
index: this.indexDefinition.indexName,
|
||||
query,
|
||||
refresh: false,
|
||||
});
|
||||
this.assertDeleteByQuerySucceeded(response);
|
||||
}
|
||||
|
||||
async deleteAllDocuments(): Promise<void> {
|
||||
this.assertInitialised();
|
||||
await this.client.deleteByQuery({
|
||||
const response = await this.client.deleteByQuery({
|
||||
index: this.indexDefinition.indexName,
|
||||
query: {match_all: {}},
|
||||
refresh: true,
|
||||
});
|
||||
this.assertDeleteByQuerySucceeded(response);
|
||||
}
|
||||
|
||||
async search(query: string, filters: TFilters, options?: SearchOptions): Promise<SearchResult<TResult>> {
|
||||
@@ -307,6 +315,29 @@ export class ElasticsearchIndexAdapter<
|
||||
}
|
||||
}
|
||||
|
||||
private assertBulkSucceeded(response: BulkResponse, operation: BulkOperationType): void {
|
||||
if (!response.errors) return;
|
||||
const context = `Elasticsearch bulk ${operation} failed for index ${this.indexDefinition.indexName}`;
|
||||
for (const item of response.items ?? []) {
|
||||
const failure = item[operation];
|
||||
if (failure?.error) {
|
||||
throw new Error(`${context}: ${summarizeOperationFailure(failure.status, failure.error)}`);
|
||||
}
|
||||
}
|
||||
throw new Error(`${context}: response reported errors without ${operation} item error details`);
|
||||
}
|
||||
|
||||
private assertDeleteByQuerySucceeded(response: DeleteByQueryResponse): void {
|
||||
const context = `Elasticsearch delete by query failed for index ${this.indexDefinition.indexName}`;
|
||||
if (response.timed_out) {
|
||||
throw new Error(`${context}: timed out`);
|
||||
}
|
||||
const failure = response.failures?.[0];
|
||||
if (failure) {
|
||||
throw new Error(`${context}: ${summarizeOperationFailure(failure.status, failure.cause)}`);
|
||||
}
|
||||
}
|
||||
|
||||
private async executeDeepPaginationSearch(
|
||||
searchParams: ElasticsearchBaseSearchRequest,
|
||||
offset: number,
|
||||
@@ -403,6 +434,12 @@ export class ElasticsearchIndexAdapter<
|
||||
}
|
||||
}
|
||||
|
||||
function summarizeOperationFailure(status: number, error: ErrorCause): string {
|
||||
const errorType =
|
||||
typeof error.type === 'string' ? JSON.stringify(error.type.slice(0, ERROR_TYPE_MAX_LENGTH)) : 'missing error type';
|
||||
return `HTTP ${status}, ${errorType}`;
|
||||
}
|
||||
|
||||
function isResourceAlreadyExistsError(error: unknown): boolean {
|
||||
if (error == null || typeof error !== 'object') {
|
||||
return false;
|
||||
|
||||
@@ -4,11 +4,17 @@ import type {Client} from '@elastic/elasticsearch';
|
||||
import type {SortCombinations} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {SearchOptions, SearchResult} from '@fluxer/schema/src/contracts/search/SearchAdapterTypes';
|
||||
import type {MessageSearchFilters, SearchableMessage} from '@fluxer/schema/src/contracts/search/SearchDocumentTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import {compactFilters, esAndTerms, esExcludeAny, esTermFilter, esTermsFilter} from '../ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchDistributedLock} from './ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from './ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchDistributedLock} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {
|
||||
compactFilters,
|
||||
esAndTerms,
|
||||
esExcludeAny,
|
||||
esTermFilter,
|
||||
esTermsFilter,
|
||||
} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
const HAS_FIELD_MAP: Record<string, string> = {
|
||||
image: 'hasImage',
|
||||
|
||||
@@ -3,11 +3,16 @@
|
||||
import type {Client} from '@elastic/elasticsearch';
|
||||
import type {SortCombinations} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {ReportSearchFilters, SearchableReport} from '@fluxer/schema/src/contracts/search/SearchDocumentTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import {compactFilters, esExistsFilter, esNotExistsFilter, esTermFilter} from '../ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchDistributedLock} from './ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from './ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchDistributedLock} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {
|
||||
compactFilters,
|
||||
esExistsFilter,
|
||||
esNotExistsFilter,
|
||||
esTermFilter,
|
||||
} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
function buildReportFilters(filters: ReportSearchFilters): Array<ElasticsearchFilter | undefined> {
|
||||
const clauses: Array<ElasticsearchFilter | undefined> = [];
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
import type {Client} from '@elastic/elasticsearch';
|
||||
import type {SortCombinations} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type {SearchableUser, UserSearchFilters} from '@fluxer/schema/src/contracts/search/SearchDocumentTypes';
|
||||
import type {ElasticsearchFilter} from '../ElasticsearchFilterUtils';
|
||||
import type {ElasticsearchDistributedLock} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from '@pkgs/elasticsearch_search/src/adapters/ElasticsearchIndexAdapter';
|
||||
import type {ElasticsearchFilter} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {
|
||||
compactFilters,
|
||||
esAndTerms,
|
||||
@@ -11,10 +13,8 @@ import {
|
||||
esNotExistsFilter,
|
||||
esRangeFilter,
|
||||
esTermFilter,
|
||||
} from '../ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '../ElasticsearchIndexDefinitions';
|
||||
import type {ElasticsearchDistributedLock} from './ElasticsearchIndexAdapter';
|
||||
import {ElasticsearchIndexAdapter} from './ElasticsearchIndexAdapter';
|
||||
} from '@pkgs/elasticsearch_search/src/ElasticsearchFilterUtils';
|
||||
import {ELASTICSEARCH_INDEX_DEFINITIONS} from '@pkgs/elasticsearch_search/src/ElasticsearchIndexDefinitions';
|
||||
|
||||
function buildUserFilters(filters: UserSearchFilters): Array<ElasticsearchFilter | undefined> {
|
||||
const clauses: Array<ElasticsearchFilter | undefined> = [];
|
||||
|
||||
@@ -9,6 +9,13 @@ import type {IEmailService} from '@pkgs/email/src/IEmailService';
|
||||
import {ms} from 'itty-time';
|
||||
|
||||
const logger = createLogger('email-service');
|
||||
const DEFAULT_LOCALE = 'en-US';
|
||||
|
||||
function formatMinorUnitAmount(amountMinor: number, currency: string, locale: string | null): string {
|
||||
const formatter = new Intl.NumberFormat(locale || DEFAULT_LOCALE, {style: 'currency', currency});
|
||||
const fractionDigits = formatter.resolvedOptions().maximumFractionDigits ?? 2;
|
||||
return formatter.format(amountMinor / 10 ** fractionDigits);
|
||||
}
|
||||
|
||||
export class EmailService implements IEmailService {
|
||||
private readonly config: EmailConfig;
|
||||
@@ -127,7 +134,7 @@ export class EmailService implements IEmailService {
|
||||
async sendUnbanNotification(
|
||||
email: string,
|
||||
username: string,
|
||||
reason: string,
|
||||
reason: string | null,
|
||||
locale: string | null = null,
|
||||
): Promise<boolean> {
|
||||
return this.sendTemplatedEmail(email, 'unban_notification', locale, {username, reason});
|
||||
@@ -301,7 +308,7 @@ export class EmailService implements IEmailService {
|
||||
locale: string | null = null,
|
||||
): Promise<boolean> {
|
||||
return this.sendTemplatedEmail(email, 'donation_confirmation', locale, {
|
||||
amount: (amountCents / 100).toFixed(2),
|
||||
amount: formatMinorUnitAmount(amountCents, currency, locale),
|
||||
currency: currency.toUpperCase(),
|
||||
interval,
|
||||
manageUrl,
|
||||
|
||||
@@ -43,7 +43,12 @@ export interface IEmailService {
|
||||
deletionDate: Date,
|
||||
locale?: string | null,
|
||||
): Promise<boolean>;
|
||||
sendUnbanNotification(email: string, username: string, reason: string, locale?: string | null): Promise<boolean>;
|
||||
sendUnbanNotification(
|
||||
email: string,
|
||||
username: string,
|
||||
reason: string | null,
|
||||
locale?: string | null,
|
||||
): Promise<boolean>;
|
||||
sendScheduledDeletionNotification(
|
||||
email: string,
|
||||
username: string,
|
||||
|
||||
@@ -126,11 +126,11 @@ export class TestEmailService implements ITestEmailService {
|
||||
async sendUnbanNotification(
|
||||
email: string,
|
||||
username: string,
|
||||
reason: string,
|
||||
reason: string | null,
|
||||
_locale?: string | null,
|
||||
): Promise<boolean> {
|
||||
this.logger.info(`Unban notification sent to ${email} for user ${username}, reason: ${reason}`);
|
||||
return this.record(email, 'unban_notification', {reason});
|
||||
this.logger.info(`Unban notification sent to ${email} for user ${username}, reason: ${reason ?? 'none'}`);
|
||||
return this.record(email, 'unban_notification', {reason: reason ?? ''});
|
||||
}
|
||||
|
||||
async sendScheduledDeletionNotification(
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {EmailTemplate, EmailTemplateKey} from '@pkgs/email/src/email_i18n/EmailI18nTypes.generated';
|
||||
import EMAIL_I18N_AR_MESSAGES from './locales/ar';
|
||||
import EMAIL_I18N_BG_MESSAGES from './locales/bg';
|
||||
import EMAIL_I18N_CS_MESSAGES from './locales/cs';
|
||||
import EMAIL_I18N_DA_MESSAGES from './locales/da';
|
||||
import EMAIL_I18N_DE_MESSAGES from './locales/de';
|
||||
import EMAIL_I18N_EL_MESSAGES from './locales/el';
|
||||
import EMAIL_I18N_EN_GB_MESSAGES from './locales/en-GB';
|
||||
import EMAIL_I18N_ES_419_MESSAGES from './locales/es-419';
|
||||
import EMAIL_I18N_ES_ES_MESSAGES from './locales/es-ES';
|
||||
import EMAIL_I18N_FI_MESSAGES from './locales/fi';
|
||||
import EMAIL_I18N_FR_MESSAGES from './locales/fr';
|
||||
import EMAIL_I18N_HE_MESSAGES from './locales/he';
|
||||
import EMAIL_I18N_HI_MESSAGES from './locales/hi';
|
||||
import EMAIL_I18N_HR_MESSAGES from './locales/hr';
|
||||
import EMAIL_I18N_HU_MESSAGES from './locales/hu';
|
||||
import EMAIL_I18N_ID_MESSAGES from './locales/id';
|
||||
import EMAIL_I18N_IT_MESSAGES from './locales/it';
|
||||
import EMAIL_I18N_JA_MESSAGES from './locales/ja';
|
||||
import EMAIL_I18N_KO_MESSAGES from './locales/ko';
|
||||
import EMAIL_I18N_LT_MESSAGES from './locales/lt';
|
||||
import EMAIL_I18N_NL_MESSAGES from './locales/nl';
|
||||
import EMAIL_I18N_NO_MESSAGES from './locales/no';
|
||||
import EMAIL_I18N_PL_MESSAGES from './locales/pl';
|
||||
import EMAIL_I18N_PT_BR_MESSAGES from './locales/pt-BR';
|
||||
import EMAIL_I18N_RO_MESSAGES from './locales/ro';
|
||||
import EMAIL_I18N_RU_MESSAGES from './locales/ru';
|
||||
import EMAIL_I18N_SV_SE_MESSAGES from './locales/sv-SE';
|
||||
import EMAIL_I18N_TH_MESSAGES from './locales/th';
|
||||
import EMAIL_I18N_TR_MESSAGES from './locales/tr';
|
||||
import EMAIL_I18N_UK_MESSAGES from './locales/uk';
|
||||
import EMAIL_I18N_VI_MESSAGES from './locales/vi';
|
||||
import EMAIL_I18N_ZH_CN_MESSAGES from './locales/zh-CN';
|
||||
import EMAIL_I18N_ZH_TW_MESSAGES from './locales/zh-TW';
|
||||
import EMAIL_I18N_AR_MESSAGES from '@pkgs/email/src/email_i18n/locales/ar';
|
||||
import EMAIL_I18N_BG_MESSAGES from '@pkgs/email/src/email_i18n/locales/bg';
|
||||
import EMAIL_I18N_CS_MESSAGES from '@pkgs/email/src/email_i18n/locales/cs';
|
||||
import EMAIL_I18N_DA_MESSAGES from '@pkgs/email/src/email_i18n/locales/da';
|
||||
import EMAIL_I18N_DE_MESSAGES from '@pkgs/email/src/email_i18n/locales/de';
|
||||
import EMAIL_I18N_EL_MESSAGES from '@pkgs/email/src/email_i18n/locales/el';
|
||||
import EMAIL_I18N_EN_GB_MESSAGES from '@pkgs/email/src/email_i18n/locales/en-GB';
|
||||
import EMAIL_I18N_ES_419_MESSAGES from '@pkgs/email/src/email_i18n/locales/es-419';
|
||||
import EMAIL_I18N_ES_ES_MESSAGES from '@pkgs/email/src/email_i18n/locales/es-ES';
|
||||
import EMAIL_I18N_FI_MESSAGES from '@pkgs/email/src/email_i18n/locales/fi';
|
||||
import EMAIL_I18N_FR_MESSAGES from '@pkgs/email/src/email_i18n/locales/fr';
|
||||
import EMAIL_I18N_HE_MESSAGES from '@pkgs/email/src/email_i18n/locales/he';
|
||||
import EMAIL_I18N_HI_MESSAGES from '@pkgs/email/src/email_i18n/locales/hi';
|
||||
import EMAIL_I18N_HR_MESSAGES from '@pkgs/email/src/email_i18n/locales/hr';
|
||||
import EMAIL_I18N_HU_MESSAGES from '@pkgs/email/src/email_i18n/locales/hu';
|
||||
import EMAIL_I18N_ID_MESSAGES from '@pkgs/email/src/email_i18n/locales/id';
|
||||
import EMAIL_I18N_IT_MESSAGES from '@pkgs/email/src/email_i18n/locales/it';
|
||||
import EMAIL_I18N_JA_MESSAGES from '@pkgs/email/src/email_i18n/locales/ja';
|
||||
import EMAIL_I18N_KO_MESSAGES from '@pkgs/email/src/email_i18n/locales/ko';
|
||||
import EMAIL_I18N_LT_MESSAGES from '@pkgs/email/src/email_i18n/locales/lt';
|
||||
import EMAIL_I18N_NL_MESSAGES from '@pkgs/email/src/email_i18n/locales/nl';
|
||||
import EMAIL_I18N_NO_MESSAGES from '@pkgs/email/src/email_i18n/locales/no';
|
||||
import EMAIL_I18N_PL_MESSAGES from '@pkgs/email/src/email_i18n/locales/pl';
|
||||
import EMAIL_I18N_PT_BR_MESSAGES from '@pkgs/email/src/email_i18n/locales/pt-BR';
|
||||
import EMAIL_I18N_RO_MESSAGES from '@pkgs/email/src/email_i18n/locales/ro';
|
||||
import EMAIL_I18N_RU_MESSAGES from '@pkgs/email/src/email_i18n/locales/ru';
|
||||
import EMAIL_I18N_SV_SE_MESSAGES from '@pkgs/email/src/email_i18n/locales/sv-SE';
|
||||
import EMAIL_I18N_TH_MESSAGES from '@pkgs/email/src/email_i18n/locales/th';
|
||||
import EMAIL_I18N_TR_MESSAGES from '@pkgs/email/src/email_i18n/locales/tr';
|
||||
import EMAIL_I18N_UK_MESSAGES from '@pkgs/email/src/email_i18n/locales/uk';
|
||||
import EMAIL_I18N_VI_MESSAGES from '@pkgs/email/src/email_i18n/locales/vi';
|
||||
import EMAIL_I18N_ZH_CN_MESSAGES from '@pkgs/email/src/email_i18n/locales/zh-CN';
|
||||
import EMAIL_I18N_ZH_TW_MESSAGES from '@pkgs/email/src/email_i18n/locales/zh-TW';
|
||||
|
||||
export const EMAIL_I18N_LOCALE_MESSAGES = {
|
||||
ar: EMAIL_I18N_AR_MESSAGES,
|
||||
|
||||
@@ -17,7 +17,7 @@ export const EMAIL_I18N_MESSAGES = {
|
||||
},
|
||||
donation_confirmation: {
|
||||
subject: 'Thank you for your {product_name} donation',
|
||||
body: 'Hello,\n\nThank you for your donation to {product_name}! Your {interval, select,\n month {recurring donation}\n year {recurring donation}\n other {one-time donation}\n} has been {interval, select,\n month {set up}\n year {set up}\n other {processed}\n} successfully.\n\nDonation details:\nAmount: {amount} {currency} {interval, select,\n month {per month}\n year {per year}\n other {}\n}\n\nStripe will email you a separate receipt with your invoice PDF shortly. This includes all payment details and can be used for tax purposes.\n\nYou can view your donation history, download invoices, {interval, select,\n month {and manage or cancel your subscription}\n year {and manage or cancel your subscription}\n other {and manage future donations}\n} at any time using this link:\n\n{manageUrl}\n\nYour support helps keep {product_name} running. Thank you!\n\n– {product_name} Team',
|
||||
body: 'Hello,\n\nThank you for your donation to {product_name}! Your {interval, select,\n month {recurring donation}\n year {recurring donation}\n other {one-time donation}\n} has been {interval, select,\n month {set up}\n year {set up}\n other {processed}\n} successfully.\n\nDonation details:\nAmount: {amount} {interval, select,\n month {per month}\n year {per year}\n other {}\n}\n\nStripe will email you a separate receipt with your invoice PDF shortly. This includes all payment details and can be used for tax purposes.\n\nYou can view your donation history, download invoices, {interval, select,\n month {and manage or cancel your subscription}\n year {and manage or cancel your subscription}\n other {and manage future donations}\n} at any time using this link:\n\n{manageUrl}\n\nYour support helps keep {product_name} running. Thank you!\n\n– {product_name} Team',
|
||||
},
|
||||
donation_magic_link: {
|
||||
subject: 'Manage your {product_name} donations',
|
||||
@@ -65,7 +65,7 @@ export const EMAIL_I18N_MESSAGES = {
|
||||
},
|
||||
password_change_verification: {
|
||||
subject: 'Confirm your {product_name} password change',
|
||||
body: "Hello {username},\n\nWe received a request to change the password on your {product_name} account.\n\nTo confirm this change, enter this code in the app:\n\n{code}\n\nThis code expires at {expiresAt}.\n\nIf you didn't request this, someone may have access to your account. Change your password immediately and enable two-factor authentication.\n\n– {product_name} Team",
|
||||
body: "Hello {username},\n\nWe received a request to change the password on your {product_name} account.\n\nTo confirm this change, enter this code in the app:\n\n{code}\n\nThis code expires on {expiresAt, date, full} at {expiresAt, time, short}.\n\nIf you didn't request this, someone may have access to your account. Change your password immediately and enable two-factor authentication.\n\n– {product_name} Team",
|
||||
},
|
||||
password_reset: {
|
||||
subject: 'Reset your {product_name} password',
|
||||
|
||||
@@ -111,6 +111,6 @@ export interface EmailTemplateVariables {
|
||||
};
|
||||
unban_notification: {
|
||||
username: string;
|
||||
reason: string;
|
||||
reason: string | null;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_AR_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "تم تعطيل حسابك في {product_name} مؤقتًا",
|
||||
"body": "مرحباً {username}،\n\nلقد قمنا بتعطيل حسابك في {product_name} مؤقتًا لأننا اكتشفنا نشاطًا مشبوهًا.\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nلاستعادة الوصول إلى حسابك، ستحتاج إلى إعادة تعيين كلمة المرور الخاصة بك:\n\n{forgotUrl}\n\nبعد إعادة تعيين كلمة المرور الخاصة بك، ستتمكن من تسجيل الدخول مرة أخرى.\n\nإذا كنت تعتقد أن هذا حدث عن طريق الخطأ، يرجى الاتصال بفريق الدعم لدينا.\n\n– فريق أمان {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلقد قمنا بتعطيل حسابك في {product_name} مؤقتًا لأننا اكتشفنا نشاطًا مشبوهًا.\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nلاستعادة الوصول إلى حسابك، ستحتاج إلى إعادة تعيين كلمة المرور الخاصة بك:\n\n{forgotUrl}\n\nبعد إعادة تعيين كلمة المرور الخاصة بك، ستتمكن من تسجيل الدخول مرة أخرى.\n\nإذا كنت تعتقد أن هذا حدث عن طريق الخطأ، يرجى الاتصال بفريق الدعم لدينا.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "سيتم حذف حسابك في {product_name} نهائيًا",
|
||||
"body": "مرحباً {username}،\n\nتم جدولة حسابك في {product_name} للحذف الدائم بسبب انتهاكات لشروط الخدمة أو إرشادات المجتمع الخاصة بنا.\n\nالحذف المجدول: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nهذا إجراء تنفيذي جاد. سيتم حذف بيانات حسابك نهائيًا في التاريخ المحدد.\n\nيرجى مراجعة:\n- شروط الخدمة: {termsUrl}\n- إرشادات المجتمع: {guidelinesUrl}\n\nعملية الاستئناف:\nإذا كنت تعتقد أن قرار التنفيذ هذا كان غير صحيح أو غير مبرر، لديك 60 يومًا لتقديم استئناف. أرسل بريدًا إلكترونيًا إلى {appeals_email} من عنوان البريد الإلكتروني هذا.\n\nفي استئنافك:\n- اشرح بوضوح لماذا تعتقد أن قرار التنفيذ كان غير صحيح أو غير مبرر\n- قدم أي دليل أو سياق ذي صلة\n\nسيقوم عضو من فريق أمان {product_name} بمراجعة استئنافك وقد يوقف الحذف المعلق حتى يتم التوصل إلى قرار نهائي.\n\n– فريق أمان {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nتمت جدولة حسابك في {product_name} للحذف الدائم بسبب انتهاكات لشروط الخدمة أو إرشادات المجتمع الخاصة بنا.\n\nالحذف المجدول: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nهذا إجراء إنفاذ جاد. سيتم حذف بيانات حسابك نهائيًا في التاريخ المحدد.\n\nيرجى مراجعة:\n- شروط الخدمة: {termsUrl}\n- إرشادات المجتمع: {guidelinesUrl}\n\nعملية الاستئناف:\nإذا كنت تعتقد أن قرار الإنفاذ هذا كان غير صحيح أو غير مبرر، لديك 60 يومًا لتقديم استئناف. أرسل بريدًا إلكترونيًا إلى {appeals_email} من عنوان البريد الإلكتروني هذا.\n\nفي استئنافك:\n- اشرح بوضوح سبب اعتقادك أن قرار الإنفاذ كان غير صحيح أو غير مبرر\n- قدم أي دليل أو سياق ذي صلة\n\nسيقوم عضو من فريق أمان {product_name} بمراجعة استئنافك وقد يوقف الحذف المعلق مؤقتًا إلى حين التوصل إلى قرار نهائي.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "تم تعليق حسابك في {product_name} مؤقتًا",
|
||||
"body": "مرحباً {username}،\n\nتم تعليق حسابك في {product_name} مؤقتًا لانتهاك شروط الخدمة أو إرشادات المجتمع الخاصة بنا.\n\nالمدة: {durationHours, plural,\n =1 {ساعة واحدة} zero {0 ساعات} two {ساعتان}\n few {ساعات} many {ساعة} other {# ساعة}\n}\nمعلق حتى: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nخلال هذه الفترة، لن تتمكن من الوصول إلى حسابك.\n\nيرجى مراجعة:\n- شروط الخدمة: {termsUrl}\n- إرشادات المجتمع: {guidelinesUrl}\n\nإذا كنت تعتقد أن قرار التنفيذ هذا كان غير صحيح أو غير مبرر، يمكنك تقديم استئناف. أرسل بريدًا إلكترونيًا إلى {appeals_email} من عنوان البريد الإلكتروني هذا واشرح بوضوح لماذا تعتقد أن القرار كان غير صحيح. سنراجع استئنافك ونرد بقرارنا.\n\n– فريق أمان {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nتم تعليق حسابك في {product_name} مؤقتًا لانتهاك شروط الخدمة أو إرشادات المجتمع الخاصة بنا.\n\nالمدة: {durationHours, plural,\n =1 {ساعة واحدة}\n zero {# ساعة}\n two {ساعتان}\n few {# ساعات}\n many {# ساعة}\n other {# ساعة}\n}\nمعلق حتى: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nخلال هذه الفترة، لن تتمكن من الوصول إلى حسابك.\n\nيرجى مراجعة:\n- شروط الخدمة: {termsUrl}\n- إرشادات المجتمع: {guidelinesUrl}\n\nإذا كنت تعتقد أن قرار الإنفاذ هذا كان غير صحيح أو غير مبرر، يمكنك تقديم استئناف. أرسل بريدًا إلكترونيًا إلى {appeals_email} من عنوان البريد الإلكتروني هذا واشرح بوضوح سبب اعتقادك أن القرار كان غير صحيح. سنراجع استئنافك ونرد بقرارنا.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "شكرًا لك على تبرعك لـ {product_name}",
|
||||
"body": "مرحباً،\n\nشكرًا لك على تبرعك لـ {product_name}! لقد تم {interval, select,\n month {إعداد تبرعك المتكرر}\n year {إعداد تبرعك المتكرر}\n other {معالجة تبرعك لمرة واحدة}\n} بنجاح.\n\nتفاصيل التبرع:\nالمبلغ: {amount} {currency} {interval, select,\n month {شهريًا}\n year {سنويًا}\n other {}\n}\n\nسترسل لك Stripe إيصالًا منفصلاً عبر البريد الإلكتروني مع فاتورتك بصيغة PDF قريبًا. يتضمن هذا جميع تفاصيل الدفع ويمكن استخدامه لأغراض ضريبية.\n\nيمكنك عرض سجل تبرعاتك، وتنزيل الفواتير، {interval, select,\n month {وإدارة أو إلغاء اشتراكك}\n year {وإدارة أو إلغاء اشتراكك}\n other {وإدارة التبرعات المستقبلية}\n} في أي وقت باستخدام هذا الرابط:\n\n{manageUrl}\n\nدعمك يساعد في استمرار {product_name}. شكرًا لك!\n\n– فريق {product_name}{interval, select,\n month {}\n year {}\n other {}\n}"
|
||||
"subject": "شكرًا لك على تبرعك لـ{product_name}",
|
||||
"body": "مرحبًا،\n\nشكرًا لك على تبرعك لـ{product_name}! لقد تم {interval, select,\n month {إعداد تبرعك المتكرر}\n year {إعداد تبرعك المتكرر}\n other {معالجة تبرعك لمرة واحدة}\n} بنجاح.\n\nتفاصيل التبرع:\nالمبلغ: {amount} {interval, select,\n month {شهريًا}\n year {سنويًا}\n other {}\n}\n\nسترسل لك Stripe إيصالًا منفصلًا عبر البريد الإلكتروني مع فاتورتك بصيغة PDF قريبًا. يتضمن هذا جميع تفاصيل الدفع ويمكن استخدامه لأغراض ضريبية.\n\nيمكنك عرض سجل تبرعاتك، وتنزيل الفواتير، {interval, select,\n month {وإدارة أو إلغاء اشتراكك}\n year {وإدارة أو إلغاء اشتراكك}\n other {وإدارة التبرعات المستقبلية}\n} في أي وقت باستخدام هذا الرابط:\n\n{manageUrl}\n\nدعمك يساعد على استمرار {product_name}. شكرًا لك!\n\n– فريق {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "إدارة تبرعات {product_name}",
|
||||
"body": "مرحباً،\n\nانقر على الرابط أدناه للوصول إلى بوابة المتبرعين الخاصة بك:\n\n{manageUrl}\n\nفي البوابة، يمكنك إدارة الاشتراكات، وتنزيل الفواتير، وعرض سجل تبرعاتك.\n\nينتهي صلاحية هذا الرابط في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا الرابط، يمكنك تجاهل هذا البريد الإلكتروني بأمان.\n\n– فريق {product_name}"
|
||||
"subject": "إدارة تبرعاتك لـ{product_name}",
|
||||
"body": "مرحبًا،\n\nانقر على الرابط أدناه للوصول إلى بوابة المتبرعين الخاصة بك:\n\n{manageUrl}\n\nفي البوابة، يمكنك إدارة الاشتراكات، وتنزيل الفواتير، وعرض سجل تبرعاتك.\n\nتنتهي صلاحية هذا الرابط في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا الرابط، يمكنك تجاهل هذا البريد الإلكتروني بأمان.\n\n– فريق {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "تحقق من بريدك الإلكتروني لتقديم تقرير DSA",
|
||||
"body": "مرحباً،\n\nاستخدم رمز التحقق أدناه لتقديم تقرير قانون الخدمات الرقمية الخاص بك على {product_name}:\n\n{code}\n\nينتهي هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، يمكنك تجاهل هذا البريد الإلكتروني.\n\n– فريق أمان {product_name}"
|
||||
"subject": "تحقق من بريدك الإلكتروني لتقديم بلاغ DSA",
|
||||
"body": "مرحبًا،\n\nاستخدم رمز التحقق أدناه لتقديم بلاغك بموجب قانون الخدمات الرقمية على {product_name}:\n\n{code}\n\nتنتهي صلاحية هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، يمكنك تجاهل هذا البريد الإلكتروني.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "تحقق من بريدك الإلكتروني الجديد في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nأدخل هذا الرمز في التطبيق للتحقق من بريدك الإلكتروني الجديد في {product_name}:\n\n{code}\n\nينتهي هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، يمكنك تجاهل هذا البريد الإلكتروني.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nأدخل هذا الرمز في التطبيق للتحقق من بريدك الإلكتروني الجديد في {product_name}:\n\n{code}\n\nتنتهي صلاحية هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، يمكنك تجاهل هذا البريد الإلكتروني.\n\n– فريق {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "تأكيد تغيير بريدك الإلكتروني في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nلقد تلقينا طلبًا لتغيير عنوان البريد الإلكتروني لحسابك في {product_name}.\n\nلتأكيد هذا التغيير، أدخل هذا الرمز في التطبيق:\n\n{code}\n\nينتهي هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، يرجى تأمين حسابك على الفور.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلقد تلقينا طلبًا لتغيير عنوان البريد الإلكتروني لحسابك في {product_name}.\n\nلتأكيد هذا التغيير، أدخل هذا الرمز في التطبيق:\n\n{code}\n\nتنتهي صلاحية هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، يرجى تأمين حسابك على الفور.\n\n– فريق {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "تم تغيير بريدك الإلكتروني في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nتم تغيير عنوان البريد الإلكتروني لحسابك في {product_name} إلى {newEmail}.\n\nإذا قمت بهذا التغيير، فلا داعي لاتخاذ أي إجراء. إذا لم تقم بذلك، يمكنك التراجع عن التغيير وتأمين حسابك باستخدام هذا الرابط:\n\n{revertUrl}\n\nسيؤدي هذا إلى استعادة بريدك الإلكتروني السابق، وتسجيل خروجك من جميع الأجهزة، وإزالة أرقام الهواتف المرتبطة، وتعطيل المصادقة متعددة العوامل، وسيطلب منك تعيين كلمة مرور جديدة.\n\n– فريق أمان {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nتم تغيير عنوان البريد الإلكتروني لحسابك في {product_name} إلى {newEmail}.\n\nإذا قمت بهذا التغيير، فلا داعي لاتخاذ أي إجراء. إذا لم تقم بذلك، يمكنك التراجع عن التغيير وتأمين حسابك باستخدام هذا الرابط:\n\n{revertUrl}\n\nسيؤدي هذا إلى استعادة بريدك الإلكتروني السابق، وتسجيل خروجك من جميع الأجهزة، وإزالة أرقام الهواتف المرتبطة، وتعطيل المصادقة متعددة العوامل، وسيُطلب منك تعيين كلمة مرور جديدة.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "تحقق من بريدك الإلكتروني في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nيرجى التحقق من عنوان البريد الإلكتروني لحسابك في {product_name} بالنقر على الرابط أدناه:\n\n{verifyUrl}\n\nإذا لم تقم بإنشاء حساب {product_name}، يمكنك تجاهل هذا البريد الإلكتروني بأمان.\n\nهذا الرابط صالح لمدة 24 ساعة.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nيرجى التحقق من عنوان البريد الإلكتروني لحسابك في {product_name} بالنقر على الرابط أدناه:\n\n{verifyUrl}\n\nإذا لم تقم بإنشاء حساب {product_name}، يمكنك تجاهل هذا البريد الإلكتروني بأمان.\n\nهذا الرابط صالح لمدة 24 ساعة.\n\n– فريق {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "تمت إزالة المزايا من هديتك",
|
||||
"body": "مرحباً {username}،\n\nرمز الهدية الذي استرددته تم دفعه في الأصل من قبل شخص آخر. وقد تم عكس هذا الدفع منذ ذلك الحين (استرداد المبلغ).\n\nبسبب هذا، قمنا بإزالة المزايا التي أضيفت إلى حسابك عندما استرددت الهدية.\n\nإذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بفريق الدعم لدينا وتضمين أي تفاصيل لديك حول رمز الهدية ومتى استرددته.\n\n– فريق {product_name}"
|
||||
"subject": "تمت إزالة مزايا الهدية التي استرددتها",
|
||||
"body": "مرحبًا {username}،\n\nدفع شخص آخر في الأصل ثمن رمز الهدية الذي استرددته، وقد تم التراجع عن تلك الدفعة لاحقًا (رد مبلغ مدفوع).\n\nولهذا السبب أزلنا المزايا التي أُضيفت إلى حسابك عند استرداد الهدية.\n\nإذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بفريق الدعم لدينا مع ذكر أي تفاصيل لديك عن رمز الهدية ووقت استردادك له.\n\n– فريق {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "تصدير بياناتك من {product_name} جاهز للتنزيل",
|
||||
"body": "مرحباً {username}،\n\nتصدير بياناتك جاهز.\n\nرابط التنزيل:\n{downloadUrl}\n\nالرسائل المتضمنة: {totalMessages, number}\nحجم الملف: {fileSizeMB, number} ميجابايت\n\nينتهي هذا الرابط في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا التصدير، يرجى تغيير كلمة المرور الخاصة بك على الفور والاتصال بفريق الدعم لدينا.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nتصدير بياناتك جاهز.\n\nرابط التنزيل:\n{downloadUrl}\n\nالرسائل المتضمنة: {totalMessages, number}\nحجم الملف: {fileSizeMB, number} ميجابايت\n\nتنتهي صلاحية هذا الرابط في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا التصدير، يرجى تغيير كلمة المرور الخاصة بك على الفور والاتصال بفريق الدعم لدينا.\n\n– فريق {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "سيتم حذف حسابك في {product_name} بسبب عدم النشاط",
|
||||
"body": "مرحباً {username}،\n\nلم نرَ أي نشاط على حسابك في {product_name} منذ {lastActiveDate, date, full}.\n\nإذا لم تسجل الدخول بحلول {deletionDate, date, full} الساعة {deletionDate, time, short}، فسيتم حذف حسابك نهائيًا بسبب عدم النشاط.\n\nسجل الدخول هنا:\n{loginUrl}\n\nإذا كنت قد استخدمت {product_name} مؤخرًا، يرجى الاتصال بفريق الدعم لدينا على الفور.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلم نرَ أي نشاط على حسابك في {product_name} منذ {lastActiveDate, date, full}.\n\nإذا لم تسجل الدخول بحلول {deletionDate, date, full} الساعة {deletionDate, time, short}، فسيتم حذف حسابك نهائيًا بسبب عدم النشاط.\n\nسجل الدخول هنا:\n{loginUrl}\n\nإذا كنت قد استخدمت {product_name} مؤخرًا، يرجى الاتصال بفريق الدعم لدينا على الفور.\n\n– فريق {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "السماح بتسجيل الدخول من عنوان IP جديد",
|
||||
"body": "مرحباً {username}،\n\nلقد اكتشفنا محاولة تسجيل دخول إلى حسابك في {product_name} من عنوان IP جديد:\n\nعنوان IP: {ipAddress}\nالموقع: {location}\n\nإذا كنت أنت من قام بذلك، يرجى تفويض عنوان IP هذا بالنقر على الرابط أدناه:\n\n{authUrl}\n\nإذا لم تحاول تسجيل الدخول، يرجى تغيير كلمة المرور الخاصة بك على الفور.\n\nهذا الرابط صالح لـ 30 دقيقة.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلقد اكتشفنا محاولة تسجيل دخول إلى حسابك في {product_name} من عنوان IP جديد:\n\nعنوان IP: {ipAddress}\nالموقع: {location}\n\nإذا كنت أنت من قام بذلك، يرجى السماح بعنوان IP هذا بالنقر على الرابط أدناه:\n\n{authUrl}\n\nإذا لم تحاول تسجيل الدخول، يرجى تغيير كلمة المرور الخاصة بك على الفور.\n\nهذا الرابط صالح لمدة 30 دقيقة.\n\n– فريق {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "تأكيد الوصول إلى الرموز الاحتياطية في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nلقد تلقينا طلبًا لعرض الرموز الاحتياطية لحسابك في {product_name}.\n\nلتأكيد هذا الطلب، أدخل هذا الرمز في التطبيق:\n\n{code}\n\nينتهي هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، فقد يكون شخص ما قد وصل إلى حسابك. قم بتغيير كلمة المرور الخاصة بك على الفور.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلقد تلقينا طلبًا لعرض الرموز الاحتياطية لحسابك في {product_name}.\n\nلتأكيد هذا الطلب، أدخل هذا الرمز في التطبيق:\n\n{code}\n\nتنتهي صلاحية هذا الرمز في {expiresAt, date, full} الساعة {expiresAt, time, short}.\n\nإذا لم تطلب هذا، فقد يكون شخص ما قادرًا على الوصول إلى حسابك. قم بتغيير كلمة المرور الخاصة بك على الفور.\n\n– فريق {product_name}"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "تأكيد تغيير كلمة المرور في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nلقد تلقينا طلبًا لتغيير كلمة المرور لحسابك في {product_name}.\n\nلتأكيد هذا التغيير، أدخل هذا الرمز في التطبيق:\n\n{code}\n\nينتهي هذا الرمز في {expiresAt}.\n\nإذا لم تطلب هذا، فقد يكون شخص ما قد وصل إلى حسابك. قم بتغيير كلمة المرور الخاصة بك على الفور وقم بتمكين المصادقة الثنائية.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلقد تلقينا طلبًا لتغيير كلمة المرور لحسابك في {product_name}.\n\nلتأكيد هذا التغيير، أدخل هذا الرمز في التطبيق:\n\n{code}\n\nتنتهي صلاحية هذا الرمز في {expiresAt}.\n\nإذا لم تطلب هذا، فقد يكون شخص ما قادرًا على الوصول إلى حسابك. قم بتغيير كلمة المرور الخاصة بك على الفور وقم بتمكين المصادقة الثنائية.\n\n– فريق {product_name}"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "إعادة تعيين كلمة المرور في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nلقد طلبت إعادة تعيين كلمة المرور الخاصة بك في {product_name}. استخدم الرابط أدناه لتعيين كلمة مرور جديدة:\n\n{resetUrl}\n\nإذا لم تطلب هذا، يمكنك تجاهل هذا البريد الإلكتروني بأمان.\n\nهذا الرابط صالح لساعة واحدة.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nلقد طلبت إعادة تعيين كلمة المرور الخاصة بك في {product_name}. استخدم الرابط أدناه لتعيين كلمة مرور جديدة:\n\n{resetUrl}\n\nإذا لم تطلب هذا، يمكنك تجاهل هذا البريد الإلكتروني بأمان.\n\nهذا الرابط صالح لمدة ساعة واحدة.\n\n– فريق {product_name}"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "تمت الموافقة على تسجيلك في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nأخبار سارة: تمت الموافقة على تسجيلك في {product_name}.\n\nيمكنك الآن تسجيل الدخول إلى تطبيق {product_name} من هنا:\n{channelsUrl}\n\nمرحباً بك في مجتمع {product_name}.\n\n– فريق {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nأخبار سارة: تمت الموافقة على تسجيلك في {product_name}.\n\nيمكنك الآن تسجيل الدخول إلى تطبيق {product_name} من هنا:\n{channelsUrl}\n\nمرحبًا بك في مجتمع {product_name}.\n\n– فريق {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "تمت مراجعة تقريرك في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nتمت مراجعة تقريرك (المعرف: {reportId}) من قبل فريق الأمان لدينا.{hasComment, select, yes {\n\nرد فريق الأمان:\n{publicComment}} other {}}\n\nشكرًا لمساعدتك في الحفاظ على {product_name} آمنًا للجميع. نحن نأخذ جميع التقارير على محمل الجد ونقدر مساهمتك في المجتمع.\n\nإذا كان لديك أي أسئلة أو مخاوف بشأن هذه النتيجة، يرجى الاتصال بـ {safety_email}.\n\n– فريق أمان {product_name}"
|
||||
"subject": "تمت مراجعة بلاغك في {product_name}",
|
||||
"body": "مرحبًا {username}،\n\nتمت مراجعة بلاغك (المعرف: {reportId}) من قبل فريق الأمان لدينا.{hasComment, select, yes {\n\nرد فريق الأمان:\n{publicComment}} other {}}\n\nشكرًا لمساعدتك في الحفاظ على {product_name} آمنًا للجميع. نحن نأخذ جميع البلاغات على محمل الجد ونقدر مساهمتك في المجتمع.\n\nإذا كان لديك أي أسئلة أو مخاوف بشأن هذه النتيجة، يرجى الاتصال بـ{safety_email}.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "سيتم حذف حسابك في {product_name} نهائيًا",
|
||||
"body": "مرحباً {username}،\n\nتم جدولة حسابك في {product_name} للحذف الدائم.\n\nالحذف المجدول: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nهذا إجراء تنفيذي جاد. سيتم حذف بيانات حسابك نهائيًا في التاريخ المحدد.\n\nإذا كنت تعتقد أن قرار التنفيذ هذا كان غير صحيح، يمكنك تقديم استئناف. أرسل بريدًا إلكترونيًا إلى {appeals_email} من عنوان البريد الإلكتروني هذا.\n\n– فريق أمان {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nتمت جدولة حسابك في {product_name} للحذف الدائم.\n\nالحذف المجدول: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nهذا إجراء إنفاذ جاد. سيتم حذف بيانات حسابك نهائيًا في التاريخ المحدد.\n\nإذا كنت تعتقد أن قرار الإنفاذ هذا كان غير صحيح، يمكنك تقديم استئناف. أرسل بريدًا إلكترونيًا إلى {appeals_email} من عنوان البريد الإلكتروني هذا.\n\n– فريق أمان {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "تم جدولة حذف حسابك في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nلقد طلبت حذف حسابك في {product_name}. تم جدولة حسابك للحذف الدائم في:\n\n{deletionDate, date, full} الساعة {deletionDate, time, short}\n\nإذا لم تطلب هذا، سجل الدخول إلى حسابك لإلغاء الحذف. نوصي أيضًا بتغيير كلمة المرور الخاصة بك لتأمين حسابك.\n\n– فريق {product_name}"
|
||||
"subject": "تمت جدولة حذف حسابك في {product_name}",
|
||||
"body": "مرحبًا {username}،\n\nلقد طلبت حذف حسابك في {product_name}. تمت جدولة حسابك للحذف الدائم في:\n\n{deletionDate, date, full} الساعة {deletionDate, time, short}\n\nإذا لم تطلب هذا، سجل الدخول إلى حسابك لإلغاء الحذف. نوصي أيضًا بتغيير كلمة المرور الخاصة بك لتأمين حسابك.\n\n– فريق {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "تم رفع تعليق حسابك في {product_name}",
|
||||
"body": "مرحباً {username}،\n\nأخبار سارة: تم رفع تعليق حسابك في {product_name}.\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nيمكنك الآن تسجيل الدخول مرة أخرى ومواصلة استخدام {product_name} كالمعتاد.\n\n– فريق أمان {product_name}"
|
||||
"body": "مرحبًا {username}،\n\nأخبار سارة: تم رفع تعليق حسابك في {product_name}.\n\n{reason, select,\n null {}\n other {السبب: {reason}}\n}\n\nيمكنك الآن تسجيل الدخول مرة أخرى ومواصلة استخدام {product_name} كالمعتاد.\n\n– فريق أمان {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_BG_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
@@ -9,23 +9,23 @@ const EMAIL_I18N_BG_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Акаунтът ти във {product_name} ще бъде изтрит за постоянно",
|
||||
"body": "Здравей, {username},\n\nАкаунтът ти във {product_name} е насрочен за постоянно изтриване поради нарушения на нашите Условия за ползване или Насоки на общността.\n\nНасрочено изтриване: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Причина: {reason}}\n}\n\nТова е сериозна мярка. Данните на акаунта ти ще бъдат изтрити за постоянно на насрочената дата.\n\nПрегледай:\n- Условия за ползване: {termsUrl}\n- Насоки на общността: {guidelinesUrl}\n\nПроцес на обжалване:\nАко смяташ, че това решение е неправилно или необосновано, имаш 60 дни да подадеш обжалване. Изпрати имейл на {appeals_email} от този имейл адрес.\n\nВ обжалването си:\n- Обясни ясно защо смяташ, че решението е неправилно или необосновано\n- Предостави всякакви релевантни доказателства или контекст\n\nЧлен на екипа за безопасност на {product_name} ще прегледа обжалването ти и може да спре предстоящото изтриване, докато не бъде взето окончателно решение.\n\n– Екип за безопасност на {product_name}"
|
||||
"body": "Здравей, {username},\n\nАкаунтът ти във {product_name} е насрочен за постоянно изтриване поради нарушения на нашите Общи условия или Насоки на общността.\n\nНасрочено изтриване: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Причина: {reason}}\n}\n\nТова е сериозна мярка. Данните на акаунта ти ще бъдат изтрити за постоянно на насрочената дата.\n\nПрегледай:\n- Общи условия: {termsUrl}\n- Насоки на общността: {guidelinesUrl}\n\nПроцес на обжалване:\nАко смяташ, че това решение е неправилно или необосновано, имаш 60 дни да подадеш обжалване. Изпрати имейл на {appeals_email} от този имейл адрес.\n\nВ обжалването си:\n- Обясни ясно защо смяташ, че решението е неправилно или необосновано\n- Приложи всички релевантни доказателства или контекст\n\nЧлен на екипа за безопасност на {product_name} ще прегледа обжалването ти и може да спре предстоящото изтриване, докато не бъде взето окончателно решение.\n\n– Екип за безопасност на {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Акаунтът ти във {product_name} е временно спрян",
|
||||
"body": "Здравей, {username},\n\nАкаунтът ти във {product_name} е временно спрян поради нарушаване на нашите Условия за ползване или Насоки на общността.\n\nПродължителност: {durationHours, plural,\n =1 {1 час}\n other {# часа}\n}\nСпрян до: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Причина: {reason}}\n}\n\nПрез това време няма да имаш достъп до акаунта си.\n\nПрегледай:\n- Условия за ползване: {termsUrl}\n- Насоки на общността: {guidelinesUrl}\n\nАко смяташ, че това решение е неправилно или необосновано, можеш да подадеш обжалване. Изпрати имейл на {appeals_email} от този имейл адрес и ясно обясни защо смяташ, че решението е неправилно. Ние ще прегледаме обжалването ти и ще отговорим с нашето решение.\n\n– Екип за безопасност на {product_name}"
|
||||
"body": "Здравей, {username},\n\nАкаунтът ти във {product_name} е временно спрян поради нарушаване на нашите Общи условия или Насоки на общността.\n\nПродължителност: {durationHours, plural,\n =1 {1 час}\n other {# часа}\n}\nСпрян до: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Причина: {reason}}\n}\n\nПрез това време няма да имаш достъп до акаунта си.\n\nПрегледай:\n- Общи условия: {termsUrl}\n- Насоки на общността: {guidelinesUrl}\n\nАко смяташ, че това решение е неправилно или необосновано, можеш да подадеш обжалване. Изпрати имейл на {appeals_email} от този имейл адрес и ясно обясни защо смяташ, че решението е неправилно. Ще прегледаме обжалването ти и ще ти отговорим с решението си.\n\n– Екип за безопасност на {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Благодарим ти за дарението за {product_name}",
|
||||
"body": "Здравей,\n\nБлагодарим ти за дарението за {product_name}! Твоето {interval, select,\n month {периодично дарение}\n year {периодично дарение}\n other {еднократно дарение}\n} беше {interval, select,\n month {настроено}\n year {настроено}\n other {обработено}\n} успешно.\n\nПодробности за дарението:\nСума: {amount} {currency} {interval, select,\n month {на месец}\n year {на година}\n other {}\n}\n\nStripe ще ти изпрати отделна разписка с PDF фактурата ти скоро. Тя включва всички данни за плащане и може да се използва за данъчни цели.\n\nМожеш да прегледаш историята на даренията си, да изтегляш фактури, {interval, select,\n month {и да управляваш или анулираш абонамента си}\n year {и да управляваш или анулираш абонамента си}\n other {и да управляваш бъдещи дарения}\n} по всяко време, като използваш този линк:\n\n{manageUrl}\n\nТвоята подкрепа помага на {product_name} да продължи да работи. Благодарим ти!\n\n– Екип на {product_name}"
|
||||
"subject": "Благодарим ти за дарението към {product_name}",
|
||||
"body": "Здравей,\n\nБлагодарим ти за дарението към {product_name}! Твоето {interval, select,\n month {периодично дарение}\n year {периодично дарение}\n other {еднократно дарение}\n} беше {interval, select,\n month {настроено}\n year {настроено}\n other {обработено}\n} успешно.\n\nПодробности за дарението:\nСума: {amount} {interval, select,\n month {на месец}\n year {на година}\n other {}\n}\n\nСкоро Stripe ще ти изпрати по имейл отделна разписка с PDF на фактурата ти. Тя включва всички данни за плащане и може да се използва за данъчни цели.\n\nМожеш да преглеждаш историята на даренията си, да изтегляш фактури {interval, select,\n month {и да управляваш или анулираш абонамента си}\n year {и да управляваш или анулираш абонамента си}\n other {и да управляваш бъдещи дарения}\n} по всяко време, като използваш този линк:\n\n{manageUrl}\n\nТвоята подкрепа помага на {product_name} да продължи да работи. Благодарим ти!\n\n– Екип на {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Управлявай даренията си за {product_name}",
|
||||
"body": "Здравей,\n\nКликни върху линка по-долу, за да получиш достъп до портала за дарители:\n\n{manageUrl}\n\nВ портала можеш да управляваш планове, да изтегляш фактури и да преглеждаш историята на даренията си.\n\nТози линк изтича на {expiresAt, date, full} в {expiresAt, time, short}.\n\nАко не си поискал този линк, можеш спокойно да игнорираш този имейл.\n\n– Екип на {product_name}"
|
||||
"body": "Здравей,\n\nКликни върху линка по-долу, за да получиш достъп до портала за дарители:\n\n{manageUrl}\n\nВ портала можеш да управляваш абонаменти, да изтегляш фактури и да преглеждаш историята на даренията си.\n\nТози линк изтича на {expiresAt, date, full} в {expiresAt, time, short}.\n\nАко не си поискал този линк, можеш спокойно да игнорираш този имейл.\n\n– Екип на {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Потвърди имейла си за DSA доклад",
|
||||
"body": "Здравей,\n\nИзползвай кода за потвърждение по-долу, за да подадеш своя доклад по Закона за цифровите услуги във {product_name}:\n\n{code}\n\nТози код изтича на {expiresAt, date, full} в {expiresAt, time, short}.\n\nАко не си го поискал, можеш да игнорираш този имейл.\n\n– Екип за безопасност на {product_name}"
|
||||
"subject": "Потвърди имейла си за сигнал по DSA",
|
||||
"body": "Здравей,\n\nИзползвай кода за потвърждение по-долу, за да подадеш сигнала си по Закона за цифровите услуги във {product_name}:\n\n{code}\n\nТози код изтича на {expiresAt, date, full} в {expiresAt, time, short}.\n\nАко не си го поискал, можеш да игнорираш този имейл.\n\n– Екип за безопасност на {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Потвърди новия си имейл във {product_name}",
|
||||
@@ -37,19 +37,19 @@ const EMAIL_I18N_BG_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Имейлът ти във {product_name} беше променен",
|
||||
"body": "Здравей, {username},\n\nИмейл адресът на акаунта ти във {product_name} беше променен на {newEmail}.\n\nАко ти си направил тази промяна, не е необходимо да предприемаш никакви действия. Ако не си, можеш да отмениш промяната и да защитиш акаунта си, като използваш този линк:\n\n{revertUrl}\n\nТова ще възстанови предишния ти имейл, ще те излезе от всички устройства, ще премахне свързаните телефонни номера, ще деактивира MFA и ще изисква да зададеш нова парола.\n\n– Екип за безопасност на {product_name}"
|
||||
"body": "Здравей, {username},\n\nИмейл адресът на акаунта ти във {product_name} беше променен на {newEmail}.\n\nАко ти си направил тази промяна, не е необходимо да предприемаш никакви действия. Ако не си, можеш да отмениш промяната и да защитиш акаунта си, като използваш този линк:\n\n{revertUrl}\n\nТова ще възстанови предишния ти имейл, ще прекрати всички активни сесии, ще премахне свързаните телефонни номера, ще деактивира MFA и ще изиска да зададеш нова парола.\n\n– Екип за безопасност на {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Потвърди имейл адреса си във {product_name}",
|
||||
"body": "Здравей, {username},\n\nПотвърди имейл адреса за акаунта си във {product_name}, като кликнеш върху линка по-долу:\n\n{verifyUrl}\n\nАко не си създал акаунт във {product_name}, можеш спокойно да игнорираш този имейл.\n\nТози линк е валиден 24 часа.\n\n– Екип на {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "Предимствата от активирания ти подарък са премахнати",
|
||||
"body": "Здравей, {username},\n\nКод за подарък, който си активирал, първоначално е бил платен от някой друг. Това плащане оттогава е отменено (chargeback).\n\nПоради това премахнахме предимствата, които бяха добавени към акаунта ти, когато активира подаръка.\n\nАко смяташ, че това е грешка, свържи се с нашия екип за поддръжка и включи всички подробности, които имаш относно кода за подарък и кога си го активирал.\n\n– Екип на {product_name}"
|
||||
"subject": "Предимствата от осребрения ти подарък са премахнати",
|
||||
"body": "Здравей, {username},\n\nКод за подарък, който си осребрил, първоначално е бил платен от някой друг. Оттогава плащането е върнато чрез оспорване на трансакция.\n\nПоради това премахнахме предимствата, които бяха добавени към акаунта ти, когато осребри подаръка.\n\nАко смяташ, че това е грешка, свържи се с нашия екип за поддръжка и посочи всички подробности, които имаш за кода за подарък и кога си го осребрил.\n\n– Екип на {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "Експортът на данните ти от {product_name} е готов за изтегляне",
|
||||
"body": "Здравей, {username},\n\nЕкспортът на данните ти е готов.\n\nЛинк за изтегляне:\n{downloadUrl}\n\nВключени съобщения: {totalMessages, number}\nРазмер на файла: {fileSizeMB, number} MB\n\nТози линк изтича на {expiresAt, date, full} в {expiresAt, time, short}.\n\nАко не си го поискал, смени паролата си незабавно и се свържи с нашия екип за поддръжка.\n\n– Екип на {product_name}"
|
||||
"body": "Здравей, {username},\n\nЕкспортът на данните ти е готов.\n\nЛинк за изтегляне:\n{downloadUrl}\n\nВключени съобщения: {totalMessages, number}\nРазмер на файла: {fileSizeMB, number} MB\n\nТози линк изтича на {expiresAt, date, full} в {expiresAt, time, short}.\n\nАко не си поискал този експорт, смени паролата си незабавно и се свържи с нашия екип за поддръжка.\n\n– Екип на {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "Акаунтът ти във {product_name} ще бъде изтрит поради неактивност",
|
||||
@@ -76,8 +76,8 @@ const EMAIL_I18N_BG_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"body": "Здравей, {username},\n\nДобра новина: регистрацията ти във {product_name} е одобрена.\n\nВече можеш да влезеш в приложението {product_name} тук:\n{channelsUrl}\n\nДобре дошъл в общността на {product_name}.\n\n– Екип на {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Докладът ти във {product_name} е прегледан",
|
||||
"body": "Здравей, {username},\n\nДокладът ти (ID: {reportId}) е прегледан от нашия екип за безопасност.{hasComment, select, yes {\n\nОтговор от екипа за безопасност:\n{publicComment}} other {}}\n\nБлагодарим ти, че помагаш {product_name} да остане безопасно място за всички. Ние приемаме всички доклади сериозно и ценим твоя принос към общността.\n\nАко имаш въпроси или притеснения относно този резултат, свържи се с {safety_email}.\n\n– Екип за безопасност на {product_name}"
|
||||
"subject": "Сигналът ти във {product_name} е прегледан",
|
||||
"body": "Здравей, {username},\n\nСигналът ти (ID: {reportId}) е прегледан от нашия екип за безопасност.{hasComment, select, yes {\n\nОтговор от екипа за безопасност:\n{publicComment}} other {}}\n\nБлагодарим ти, че помагаш на {product_name} да остане безопасно място за всички. Приемаме всички сигнали сериозно и ценим приноса ти към общността.\n\nАко имаш въпроси или притеснения относно този резултат, свържи се с {safety_email}.\n\n– Екип за безопасност на {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Акаунтът ти във {product_name} ще бъде изтрит за постоянно",
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_CS_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "Tvůj účet {product_name} byl dočasně deaktivován",
|
||||
"body": "Ahoj {username},\n\nDočasně jsme deaktivovali tvůj účet {product_name}, protože jsme zaznamenali podezřelou aktivitu.\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nPro opětovný přístup k účtu si budeš muset resetovat heslo:\n\n{forgotUrl}\n\nPo resetování hesla se budeš moci znovu přihlásit.\n\nPokud se domníváš, že se jedná o chybu, kontaktuj prosím náš tým podpory.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Váš účet {product_name} byl dočasně deaktivován",
|
||||
"body": "Dobrý den, {username},\n\nDočasně jsme deaktivovali váš účet {product_name}, protože jsme zaznamenali podezřelou aktivitu.\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nAbyste znovu získali přístup k účtu, musíte si nastavit nové heslo:\n\n{forgotUrl}\n\nPo změně hesla se budete moci znovu přihlásit.\n\nPokud se domníváte, že jde o chybu, kontaktujte náš tým podpory.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Tvůj účet {product_name} bude trvale smazán",
|
||||
"body": "Ahoj {username},\n\nTvůj účet {product_name} byl naplánován k trvalému smazání z důvodu porušení našich Podmínek služby nebo Pokynů komunity.\n\nNaplánované smazání: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nJedná se o závažné opatření. Tvá data účtu budou trvale smazána v naplánovaný den.\n\nZkontroluj prosím:\n- Podmínky služby: {termsUrl}\n- Pokyny komunity: {guidelinesUrl}\n\nProces odvolání:\nPokud se domníváš, že toto rozhodnutí o vynucení bylo nesprávné nebo neoprávněné, máš 60 dní na podání odvolání. Odešli e-mail na {appeals_email} z této e-mailové adresy.\n\nVe svém odvolání:\n- Jasně vysvětli, proč se domníváš, že rozhodnutí o vynucení bylo nesprávné nebo neoprávněné\n- Poskytni veškeré relevantní důkazy nebo kontext\n\nČlen bezpečnostního týmu {product_name} tvé odvolání přezkoumá a může pozastavit probíhající smazání, dokud nebude dosaženo konečného rozhodnutí.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Váš účet {product_name} bude trvale smazán",
|
||||
"body": "Dobrý den, {username},\n\nKvůli porušení našich podmínek služby nebo komunitních pravidel bylo naplánováno trvalé smazání vašeho účtu {product_name}.\n\nNaplánované smazání: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nJedná se o závažné opatření. Data vašeho účtu budou v naplánovaný den trvale smazána.\n\nPřečtěte si:\n- Podmínky služby: {termsUrl}\n- Komunitní pravidla: {guidelinesUrl}\n\nPostup odvolání:\nPokud se domníváte, že toto rozhodnutí bylo nesprávné nebo neopodstatněné, máte 60 dní na podání odvolání. Pošlete e-mail na {appeals_email} z této e-mailové adresy.\n\nV odvolání:\n- Jasně vysvětlete, proč se domníváte, že rozhodnutí bylo nesprávné nebo neopodstatněné\n- Uveďte všechny relevantní důkazy a souvislosti\n\nČlen bezpečnostního týmu {product_name} vaše odvolání přezkoumá a může pozastavit plánované smazání, dokud nepadne konečné rozhodnutí.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Tvůj účet {product_name} byl dočasně pozastaven",
|
||||
"body": "Ahoj {username},\n\nTvůj účet {product_name} byl dočasně pozastaven za porušení našich Podmínek služby nebo Pokynů komunity.\n\nDoba trvání: {durationHours, plural,\n one {1 hodina} few {hodiny}\n many {hodiny} other {# hodin}\n}\nPozastaveno do: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nBěhem této doby nebudeš mít přístup ke svému účtu.\n\nZkontroluj prosím:\n- Podmínky služby: {termsUrl}\n- Pokyny komunity: {guidelinesUrl}\n\nPokud se domníváš, že toto rozhodnutí o vynucení bylo nesprávné nebo neoprávněné, můžeš podat odvolání. Odešli e-mail na {appeals_email} z této e-mailové adresy a jasně vysvětli, proč se domníváš, že rozhodnutí bylo nesprávné. Tvé odvolání přezkoumáme a odpovíme ti s naším rozhodnutím.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Váš účet {product_name} byl dočasně pozastaven",
|
||||
"body": "Dobrý den, {username},\n\nVáš účet {product_name} byl dočasně pozastaven kvůli porušení našich podmínek služby nebo komunitních pravidel.\n\nDoba trvání: {durationHours, plural,\n one {# hodina}\n few {# hodiny}\n many {# hodiny}\n other {# hodin}\n}\nPozastaven do: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nBěhem této doby nebudete mít přístup ke svému účtu.\n\nPřečtěte si:\n- Podmínky služby: {termsUrl}\n- Komunitní pravidla: {guidelinesUrl}\n\nPokud se domníváte, že toto rozhodnutí bylo nesprávné nebo neopodstatněné, můžete podat odvolání. Pošlete e-mail na {appeals_email} z této e-mailové adresy a jasně vysvětlete, proč považujete rozhodnutí za nesprávné. Vaše odvolání přezkoumáme a sdělíme vám své rozhodnutí.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Děkujeme za tvůj dar na {product_name}",
|
||||
"body": "Ahoj,\n\nDěkujeme za tvůj dar pro {product_name}! Tvůj {interval, select,\n month {opakovaný dar}\n year {opakovaný dar}\n other {jednorázový dar}\n} byl {interval, select,\n month {nastaven}\n year {nastaven}\n other {zpracován}\n} úspěšně.\n\nPodrobnosti o daru:\nČástka: {amount} {currency} {interval, select,\n month {měsíčně}\n year {ročně}\n other {}\n}\n\nStripe ti brzy zašle samostatnou účtenku s PDF fakturou. Ta obsahuje všechny platební údaje a může být použita pro daňové účely.\n\nHistorii svých darů, stahování faktur {interval, select,\n month {a správu nebo zrušení předplatného}\n year {a správu nebo zrušení předplatného}\n other {a správu budoucích darů}\n} můžeš kdykoli zobrazit pomocí tohoto odkazu:\n\n{manageUrl}\n\nTvá podpora pomáhá udržovat {product_name} v chodu. Děkujeme!\n\n– Tým {product_name}"
|
||||
"subject": "Děkujeme za váš dar pro {product_name}",
|
||||
"body": "Dobrý den,\n\nDěkujeme za váš dar pro {product_name}! Váš {interval, select,\n month {opakovaný dar}\n year {opakovaný dar}\n other {jednorázový dar}\n} byl úspěšně {interval, select,\n month {nastaven}\n year {nastaven}\n other {zpracován}\n}.\n\nPodrobnosti o daru:\nČástka: {amount} {interval, select,\n month {měsíčně}\n year {ročně}\n other {}\n}\n\nStripe vám brzy pošle samostatné potvrzení platby s fakturou v PDF. Obsahuje všechny platební údaje a lze ho použít pro daňové účely.\n\nPomocí tohoto odkazu si můžete kdykoli prohlédnout historii svých darů, stáhnout faktury {interval, select,\n month {a spravovat nebo zrušit předplatné}\n year {a spravovat nebo zrušit předplatné}\n other {a spravovat budoucí dary}\n}:\n\n{manageUrl}\n\nVaše podpora pomáhá udržovat {product_name} v chodu. Děkujeme!\n\n– Tým {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Spravuj své dary pro {product_name}",
|
||||
"body": "Ahoj,\n\nKlikni na odkaz níže pro přístup k portálu pro dárce:\n\n{manageUrl}\n\nV portálu můžeš spravovat předplatná, stahovat faktury a prohlížet si historii svých darů.\n\nTento odkaz vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jsi tento odkaz nepožadoval, můžeš tento e-mail klidně ignorovat.\n\n– Tým {product_name}"
|
||||
"subject": "Spravujte své dary pro {product_name}",
|
||||
"body": "Dobrý den,\n\nKliknutím na odkaz níže otevřete portál pro dárce:\n\n{manageUrl}\n\nNa portálu můžete spravovat předplatná, stahovat faktury a prohlížet si historii svých darů.\n\nPlatnost tohoto odkazu vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jste si tento odkaz nevyžádali, můžete tento e-mail bez obav ignorovat.\n\n– Tým {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Ověř svůj e-mail pro nahlášení podle DSA",
|
||||
"body": "Ahoj,\n\nPoužij ověřovací kód níže k odeslání svého nahlášení podle zákona o digitálních službách na {product_name}:\n\n{code}\n\nTento kód vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jsi o to nežádal, můžeš tento e-mail ignorovat.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Ověřte svůj e-mail pro nahlášení podle DSA",
|
||||
"body": "Dobrý den,\n\nPomocí ověřovacího kódu níže odešlete své nahlášení podle nařízení o digitálních službách na {product_name}:\n\n{code}\n\nPlatnost tohoto kódu vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jste si tento kód nevyžádali, můžete tento e-mail ignorovat.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Ověř svůj nový e-mail pro {product_name}",
|
||||
"body": "Ahoj {username},\n\nZadej tento kód do aplikace pro ověření tvého nového e-mailu pro {product_name}:\n\n{code}\n\nTento kód vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jsi o to nežádal, můžeš tento e-mail ignorovat.\n\n– Tým {product_name}"
|
||||
"subject": "Ověřte svou novou e-mailovou adresu pro {product_name}",
|
||||
"body": "Dobrý den, {username},\n\nZadáním tohoto kódu v aplikaci ověříte svou novou e-mailovou adresu pro {product_name}:\n\n{code}\n\nPlatnost tohoto kódu vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jste si tento kód nevyžádali, můžete tento e-mail ignorovat.\n\n– Tým {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Potvrď změnu e-mailu pro {product_name}",
|
||||
"body": "Ahoj {username},\n\nObdrželi jsme požadavek na změnu e-mailové adresy tvého účtu {product_name}.\n\nPro potvrzení této změny zadej tento kód do aplikace:\n\n{code}\n\nTento kód vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jsi o to nežádal, zabezpeč si svůj účet ihned.\n\n– Tým {product_name}"
|
||||
"subject": "Potvrďte změnu e-mailové adresy pro {product_name}",
|
||||
"body": "Dobrý den, {username},\n\nObdrželi jsme žádost o změnu e-mailové adresy vašeho účtu {product_name}.\n\nZměnu potvrďte zadáním tohoto kódu v aplikaci:\n\n{code}\n\nPlatnost tohoto kódu vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jste o tuto změnu nežádali, ihned svůj účet zabezpečte.\n\n– Tým {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Tvůj e-mail pro {product_name} byl změněn",
|
||||
"body": "Ahoj {username},\n\nE-mailová adresa tvého účtu {product_name} byla změněna na {newEmail}.\n\nPokud jsi tuto změnu provedl ty, není potřeba žádná akce. Pokud ne, můžeš změnu vrátit zpět a zabezpečit svůj účet pomocí tohoto odkazu:\n\n{revertUrl}\n\nTím se obnoví tvůj předchozí e-mail, odhlásíš se všude, odstraní se propojená telefonní čísla, deaktivuje se MFA a budeš muset nastavit nové heslo.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Vaše e-mailová adresa pro {product_name} byla změněna",
|
||||
"body": "Dobrý den, {username},\n\nE-mailová adresa vašeho účtu {product_name} byla změněna na {newEmail}.\n\nPokud jste tuto změnu provedli vy, nemusíte nic dělat. Pokud ne, můžete ji vrátit zpět a zabezpečit svůj účet pomocí tohoto odkazu:\n\n{revertUrl}\n\nTím se obnoví vaše předchozí e-mailová adresa, budete odhlášeni ze všech zařízení, odstraní se propojená telefonní čísla, vypne se vícefaktorové ověřování a budete muset nastavit nové heslo.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Ověř svou e-mailovou adresu pro {product_name}",
|
||||
"body": "Ahoj {username},\n\nOvěř e-mailovou adresu svého účtu {product_name} kliknutím na odkaz níže:\n\n{verifyUrl}\n\nPokud jsi si účet {product_name} nevytvořil, můžeš tento e-mail klidně ignorovat.\n\nTento odkaz je platný 24 hodin.\n\n– Tým {product_name}"
|
||||
"subject": "Ověřte svou e-mailovou adresu pro {product_name}",
|
||||
"body": "Dobrý den, {username},\n\nKliknutím na odkaz níže ověřte e-mailovou adresu svého účtu {product_name}:\n\n{verifyUrl}\n\nPokud jste si účet {product_name} nevytvořili, můžete tento e-mail bez obav ignorovat.\n\nTento odkaz je platný 24 hodin.\n\n– Tým {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "Výhody z uplatněného dárku byly odstraněny",
|
||||
"body": "Ahoj {username},\n\nDárkový kód, který jsi uplatnil, byl původně zaplacen někým jiným. Tato platba byla mezitím zrušena (chargeback).\n\nZ tohoto důvodu jsme odstranili výhody, které byly přidány k tvému účtu, když jsi dárek uplatnil.\n\nPokud si myslíš, že se jedná o chybu, kontaktuj prosím náš tým podpory a uveď veškeré podrobnosti, které máš o dárkovém kódu a o tom, kdy jsi ho uplatnil.\n\n– Tým {product_name}"
|
||||
"body": "Dobrý den, {username},\n\nDárkový kód, který jste uplatnili, původně zaplatil někdo jiný. Tato platba byla následně vrácena na základě reklamace (chargeback).\n\nProto jsme odebrali výhody, které váš účet získal při uplatnění dárku.\n\nPokud se domníváte, že jde o chybu, kontaktujte náš tým podpory a uveďte všechny dostupné podrobnosti o dárkovém kódu a o tom, kdy jste ho uplatnili.\n\n– Tým {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "Export tvých dat z {product_name} je připraven ke stažení",
|
||||
"body": "Ahoj {username},\n\nTvůj export dat je připraven.\n\nOdkaz ke stažení:\n{downloadUrl}\n\nZahrnuté zprávy: {totalMessages, number}\nVelikost souboru: {fileSizeMB, number} MB\n\nTento odkaz vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jsi o tento export nežádal, okamžitě si změň heslo a kontaktuj náš tým podpory.\n\n– Tým {product_name}"
|
||||
"subject": "Export vašich dat z {product_name} je připraven ke stažení",
|
||||
"body": "Dobrý den, {username},\n\nExport vašich dat je připraven.\n\nOdkaz ke stažení:\n{downloadUrl}\n\nPočet zahrnutých zpráv: {totalMessages, number}\nVelikost souboru: {fileSizeMB, number} MB\n\nPlatnost tohoto odkazu vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jste si tento export nevyžádali, okamžitě si změňte heslo a kontaktujte náš tým podpory.\n\n– Tým {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "Tvůj účet {product_name} bude smazán kvůli neaktivitě",
|
||||
"body": "Ahoj {username},\n\nNezaznamenali jsme žádnou aktivitu na tvém účtu {product_name} od {lastActiveDate, date, full}.\n\nPokud se nepřihlásíš do {deletionDate, date, full} v {deletionDate, time, short}, tvůj účet bude trvale smazán kvůli neaktivitě.\n\nPřihlas se zde:\n{loginUrl}\n\nPokud jsi {product_name} nedávno používal, kontaktuj náš tým podpory ihned.\n\n– Tým {product_name}"
|
||||
"subject": "Váš účet {product_name} bude smazán kvůli neaktivitě",
|
||||
"body": "Dobrý den, {username},\n\nOd {lastActiveDate, date, full} jsme na vašem účtu {product_name} nezaznamenali žádnou aktivitu.\n\nPokud se nepřihlásíte do {deletionDate, date, full} v {deletionDate, time, short}, váš účet bude kvůli neaktivitě trvale smazán.\n\nPřihlaste se zde:\n{loginUrl}\n\nPokud jste {product_name} v poslední době používali, ihned kontaktujte náš tým podpory.\n\n– Tým {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Povolit přihlášení z nové IP adresy",
|
||||
"body": "Ahoj {username},\n\nZaznamenali jsme pokus o přihlášení k tvému účtu {product_name} z nové IP adresy:\n\nIP adresa: {ipAddress}\nPoloha: {location}\n\nPokud jsi to byl ty, autorizuj tuto IP adresu kliknutím na odkaz níže:\n\n{authUrl}\n\nPokud jsi se nepřihlašoval, okamžitě si změň heslo.\n\nTento odkaz je platný 30 minut.\n\n– Tým {product_name}"
|
||||
"body": "Dobrý den, {username},\n\nZaznamenali jsme pokus o přihlášení k vašemu účtu {product_name} z nové IP adresy:\n\nIP adresa: {ipAddress}\nPoloha: {location}\n\nPokud jste to byli vy, povolte tuto IP adresu kliknutím na odkaz níže:\n\n{authUrl}\n\nPokud jste se nepokoušeli přihlásit, ihned si změňte heslo.\n\nTento odkaz je platný 30 minut.\n\n– Tým {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Potvrď přístup k záložním kódům pro {product_name}",
|
||||
"body": "Ahoj {username},\n\nObdrželi jsme požadavek na zobrazení záložních kódů tvého účtu {product_name}.\n\nPro potvrzení tohoto požadavku zadej tento kód do aplikace:\n\n{code}\n\nTento kód vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jsi o to nežádal, někdo může mít přístup k tvému účtu. Okamžitě si změň heslo.\n\n– Tým {product_name}"
|
||||
"subject": "Potvrďte přístup k záložním kódům pro {product_name}",
|
||||
"body": "Dobrý den, {username},\n\nObdrželi jsme žádost o zobrazení záložních kódů vašeho účtu {product_name}.\n\nŽádost potvrďte zadáním tohoto kódu v aplikaci:\n\n{code}\n\nPlatnost tohoto kódu vyprší dne {expiresAt, date, full} v {expiresAt, time, short}.\n\nPokud jste o to nežádali, někdo může mít přístup k vašemu účtu. Okamžitě si změňte heslo.\n\n– Tým {product_name}"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Potvrď změnu hesla k {product_name}",
|
||||
"body": "Ahoj {username},\n\nObdrželi jsme požadavek na změnu hesla k tvému účtu pro {product_name}.\n\nPro potvrzení této změny zadej tento kód do aplikace:\n\n{code}\n\nTento kód vyprší v {expiresAt}.\n\nPokud jsi o to nežádal, někdo může mít přístup k tvému účtu. Okamžitě si změň heslo a povol dvoufaktorové ověřování.\n\n– Tým {product_name}"
|
||||
"subject": "Potvrďte změnu hesla k účtu {product_name}",
|
||||
"body": "Dobrý den, {username},\n\nObdrželi jsme žádost o změnu hesla k vašemu účtu {product_name}.\n\nZměnu potvrďte zadáním tohoto kódu v aplikaci:\n\n{code}\n\nPlatnost tohoto kódu vyprší v {expiresAt}.\n\nPokud jste o to nežádali, někdo může mít přístup k vašemu účtu. Okamžitě si změňte heslo a zapněte dvoufaktorové ověřování.\n\n– Tým {product_name}"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Obnov své heslo k {product_name}",
|
||||
"body": "Ahoj {username},\n\nPožádal jsi o reset hesla pro {product_name}. Použij odkaz níže pro nastavení nového hesla:\n\n{resetUrl}\n\nPokud jsi o to nežádal, můžeš tento e-mail klidně ignorovat.\n\nTento odkaz je platný 1 hodinu.\n\n– Tým {product_name}"
|
||||
"subject": "Obnovte své heslo k účtu {product_name}",
|
||||
"body": "Dobrý den, {username},\n\nPožádali jste o obnovení hesla k účtu {product_name}. Pomocí odkazu níže si nastavte nové heslo:\n\n{resetUrl}\n\nPokud jste o to nežádali, můžete tento e-mail bez obav ignorovat.\n\nTento odkaz je platný 1 hodinu.\n\n– Tým {product_name}"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "Tvá registrace k {product_name} byla schválena",
|
||||
"body": "Ahoj {username},\n\nDobré zprávy: tvá registrace do {product_name} byla schválena.\n\nNyní se můžeš přihlásit do aplikace {product_name} zde:\n{channelsUrl}\n\nVítej v komunitě {product_name}.\n\n– Tým {product_name}"
|
||||
"subject": "Vaše registrace do {product_name} byla schválena",
|
||||
"body": "Dobrý den, {username},\n\nDobrá zpráva: vaše registrace do {product_name} byla schválena.\n\nNyní se můžete přihlásit do aplikace {product_name} zde:\n{channelsUrl}\n\nVítejte v komunitě {product_name}.\n\n– Tým {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Tvé nahlášení pro {product_name} bylo zkontrolováno",
|
||||
"body": "Ahoj {username},\n\nTvé nahlášení (ID: {reportId}) bylo zkontrolováno naším bezpečnostním týmem.{hasComment, select, yes {\n\nOdpověď od bezpečnostního týmu:\n{publicComment}} other {}}\n\nDěkujeme, že pomáháš udržovat {product_name} bezpečný pro všechny. Všechna nahlášení bereme vážně a oceňujeme tvůj příspěvek komunitě.\n\nPokud máš jakékoli dotazy nebo obavy ohledně tohoto výsledku, kontaktuj {safety_email}.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Vaše nahlášení na {product_name} bylo přezkoumáno",
|
||||
"body": "Dobrý den, {username},\n\nNáš bezpečnostní tým přezkoumal vaše nahlášení (ID: {reportId}).{hasComment, select, yes {\n\nOdpověď bezpečnostního týmu:\n{publicComment}} other {}}\n\nDěkujeme, že pomáháte udržovat {product_name} bezpečný pro všechny. Všechna nahlášení bereme vážně a vážíme si vašeho přínosu komunitě.\n\nPokud máte k tomuto výsledku jakékoli dotazy nebo výhrady, kontaktujte {safety_email}.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Tvůj účet {product_name} bude trvale smazán",
|
||||
"body": "Ahoj {username},\n\nTvůj účet {product_name} byl naplánován k trvalému smazání.\n\nNaplánované smazání: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nJedná se o závažné opatření. Tvá data účtu budou trvale smazána v naplánovaný den.\n\nPokud se domníváš, že toto rozhodnutí o vynucení bylo nesprávné, můžeš podat odvolání. Odešli e-mail na {appeals_email} z této e-mailové adresy.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Váš účet {product_name} bude trvale smazán",
|
||||
"body": "Dobrý den, {username},\n\nBylo naplánováno trvalé smazání vašeho účtu {product_name}.\n\nNaplánované smazání: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nJedná se o závažné opatření. Data vašeho účtu budou v naplánovaný den trvale smazána.\n\nPokud se domníváte, že toto rozhodnutí bylo nesprávné, můžete podat odvolání. Pošlete e-mail na {appeals_email} z této e-mailové adresy.\n\n– Bezpečnostní tým {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "Smazání tvého účtu {product_name} je naplánováno",
|
||||
"body": "Ahoj {username},\n\nPožádal jsi o smazání svého účtu {product_name}. Tvůj účet je naplánován k trvalému smazání na:\n\n{deletionDate, date, full} v {deletionDate, time, short}\n\nPokud jsi to nepožadoval, přihlas se ke svému účtu a zruš smazání. Doporučujeme také změnit si heslo pro zabezpečení účtu.\n\n– Tým {product_name}"
|
||||
"subject": "Smazání vašeho účtu {product_name} je naplánováno",
|
||||
"body": "Dobrý den, {username},\n\nPožádali jste o smazání svého účtu {product_name}. Trvalé smazání je naplánováno na:\n\n{deletionDate, date, full} v {deletionDate, time, short}\n\nPokud jste o smazání nežádali, přihlaste se ke svému účtu a smazání zrušte. Doporučujeme také změnit heslo, abyste svůj účet zabezpečili.\n\n– Tým {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "Pozastavení tvého účtu {product_name} bylo zrušeno",
|
||||
"body": "Ahoj {username},\n\nDobré zprávy: pozastavení tvého účtu {product_name} bylo zrušeno.\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nNyní se můžeš znovu přihlásit a pokračovat v používání {product_name} jako obvykle.\n\n– Bezpečnostní tým {product_name}"
|
||||
"subject": "Pozastavení vašeho účtu {product_name} bylo zrušeno",
|
||||
"body": "Dobrý den, {username},\n\nDobrá zpráva: pozastavení vašeho účtu {product_name} bylo zrušeno.\n\n{reason, select,\n null {}\n other {Důvod: {reason}}\n}\n\nNyní se můžete znovu přihlásit a používat {product_name} jako obvykle.\n\n– Bezpečnostní tým {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_DA_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "Din {product_name}-konto er midlertidigt deaktiveret",
|
||||
"body": "Hej {username},\n\nVi har midlertidigt deaktiveret din {product_name}-konto, fordi vi har registreret mistænkelig aktivitet.\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nFor at få adgang til din konto igen skal du nulstille din adgangskode:\n\n{forgotUrl}\n\nNår du har nulstillet din adgangskode, kan du logge ind igen.\n\nHvis du mener, at dette er sket ved en fejl, kan du kontakte vores supportteam.\n\n– {product_name} Safety Team"
|
||||
"body": "Hej {username},\n\nVi har midlertidigt deaktiveret din {product_name}-konto, fordi vi har registreret mistænkelig aktivitet.\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nFor at få adgang til din konto igen skal du nulstille din adgangskode:\n\n{forgotUrl}\n\nNår du har nulstillet din adgangskode, kan du logge ind igen.\n\nHvis du mener, at dette er sket ved en fejl, kan du kontakte vores supportteam.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Din {product_name}-konto slettes permanent",
|
||||
"body": "Hej {username},\n\nDin {product_name}-konto er planlagt til permanent sletning på grund af overtrædelser af vores servicevilkår eller retningslinjer for community'et.\n\nPlanlagt sletning: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nDette er en alvorlig håndhævelseshandling. Dine kontodata bliver permanent slettet på den planlagte dato.\n\nGennemgå:\n- Servicevilkår: {termsUrl}\n- Retningslinjer for community'et: {guidelinesUrl}\n\nAnkeproces:\nHvis du mener, at denne håndhævelsesbeslutning var forkert eller uberettiget, har du 60 dage til at indsende en anke. Send en e-mail til {appeals_email} fra denne e-mailadresse.\n\nI din anke:\n- Forklar tydeligt, hvorfor du mener, at håndhævelsesbeslutningen var forkert eller uberettiget\n- Fremlæg relevant bevis eller kontekst\n\nEt medlem af {product_name} Safety Team vil gennemgå din anke og kan sætte den afventende sletning på pause, indtil en endelig beslutning er truffet.\n\n– {product_name} Safety Team"
|
||||
"body": "Hej {username},\n\nVi har planlagt at slette din {product_name}-konto permanent på grund af overtrædelser af vores servicevilkår eller retningslinjer for fællesskabet.\n\nPlanlagt sletning: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nDette er en alvorlig sanktion. Dine kontodata bliver permanent slettet på den planlagte dato.\n\nGennemgå:\n- Servicevilkår: {termsUrl}\n- Retningslinjer for fællesskabet: {guidelinesUrl}\n\nKlageproces:\nHvis du mener, at denne beslutning om sanktioner var forkert eller uberettiget, har du 60 dage til at indsende en klage. Send en e-mail til {appeals_email} fra denne e-mailadresse.\n\nI din klage:\n- Forklar tydeligt, hvorfor du mener, at beslutning om sanktioneren var forkert eller uberettiget\n- Fremlæg relevant dokumentation eller kontekst\n\nEt medlem af sikkerhedsteamet hos {product_name} vil gennemgå din klage og kan sætte den afventende sletning på pause, indtil en endelig beslutning er truffet.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Din {product_name}-konto er midlertidigt suspenderet",
|
||||
"body": "Hej {username},\n\nDin {product_name}-konto er midlertidigt suspenderet for at overtræde vores servicevilkår eller retningslinjer for community'et.\n\nVarighed: {durationHours, plural,\n =1 {1 time}\n other {# timer}\n}\nSuspenderet indtil: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nI denne periode vil du ikke kunne få adgang til din konto.\n\nGennemgå:\n- Servicevilkår: {termsUrl}\n- Retningslinjer for community'et: {guidelinesUrl}\n\nHvis du mener, at denne håndhævelsesbeslutning var forkert eller uberettiget, kan du indsende en anke. Send en e-mail til {appeals_email} fra denne e-mailadresse og forklar tydeligt, hvorfor du mener, at beslutningen var forkert. Vi vil gennemgå din anke og svare med vores beslutning.\n\n– {product_name} Safety Team"
|
||||
"body": "Hej {username},\n\nDin {product_name}-konto er midlertidigt suspenderet på grund af overtrædelser af vores servicevilkår eller retningslinjer for fællesskabet.\n\nVarighed: {durationHours, plural,\n =1 {1 time}\n other {# timer}\n}\nSuspenderet indtil: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nI denne periode vil du ikke kunne få adgang til din konto.\n\nGennemgå:\n- Servicevilkår: {termsUrl}\n- Retningslinjer for fællesskabet: {guidelinesUrl}\n\nHvis du mener, at denne beslutning om sanktioner var forkert eller uberettiget, kan du indsende en klage. Send en e-mail til {appeals_email} fra denne e-mailadresse og forklar tydeligt, hvorfor du mener, at beslutningen var forkert. Vi gennemgår din klage og giver dig besked om vores afgørelse.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Tak for din {product_name}-donation",
|
||||
"body": "Hej,\n\nTak for din donation til {product_name}! Din {interval, select,\n month {tilbagevendende donation}\n year {tilbagevendende donation}\n other {engangsdonation}\n} er blevet {interval, select,\n month {opsat}\n year {opsat}\n other {behandlet}\n} med succes.\n\nDonationsdetaljer:\nBeløb: {amount} {currency} {interval, select,\n month {pr. måned}\n year {pr. år}\n other {}\n}\n\nStripe sender dig en separat kvittering med din faktura-PDF inden længe. Denne inkluderer alle betalingsdetaljer og kan bruges til skatteformål.\n\nDu kan til enhver tid se din donationshistorik, downloade fakturaer, {interval, select,\n month {og administrere eller annullere dit abonnement}\n year {og administrere eller annullere dit abonnement}\n other {og administrere fremtidige donationer}\n} ved at bruge dette link:\n\n{manageUrl}\n\nDin støtte hjælper med at holde {product_name} kørende. Tak!\n\n– {product_name} Team"
|
||||
"body": "Hej,\n\nTak for din donation til {product_name}! Din {interval, select,\n month {løbende donation}\n year {løbende donation}\n other {engangsdonation}\n} er blevet {interval, select,\n month {oprettet}\n year {oprettet}\n other {gennemført}\n}.\n\nDonationsdetaljer:\nBeløb: {amount} {interval, select,\n month {pr. måned}\n year {pr. år}\n other {}\n}\n\nStripe sender dig en separat kvittering med din faktura som PDF inden længe. Kvitteringen indeholder alle betalingsdetaljer og kan bruges til skatteformål.\n\nDu kan til enhver tid se din donationshistorik, downloade fakturaer {interval, select,\n month {og administrere eller opsige dit abonnement}\n year {og administrere eller opsige dit abonnement}\n other {og administrere fremtidige donationer}\n} ved at bruge dette link:\n\n{manageUrl}\n\nDin støtte hjælper med at holde {product_name} kørende. Tak!\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Administrer dine {product_name}-donationer",
|
||||
"body": "Hej,\n\nKlik på linket nedenfor for at få adgang til din donorportal:\n\n{manageUrl}\n\nI portalen kan du administrere abonnementer, downloade fakturaer og se din donationshistorik.\n\nDette link udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette link, kan du trygt ignorere denne e-mail.\n\n– {product_name} Team"
|
||||
"body": "Hej,\n\nKlik på linket nedenfor for at få adgang til din donorportal:\n\n{manageUrl}\n\nI portalen kan du administrere abonnementer, downloade fakturaer og se din donationshistorik.\n\nDette link udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette link, kan du trygt ignorere denne e-mail.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Bekræft din e-mail til en DSA-rapport",
|
||||
"body": "Hej,\n\nBrug bekræftelseskoden nedenfor til at indsende din Digital Services Act-rapport for {product_name}:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, kan du ignorere denne e-mail.\n\n– {product_name} Safety Team"
|
||||
"subject": "Bekræft din e-mailadresse til en DSA-anmeldelse",
|
||||
"body": "Hej,\n\nBrug bekræftelseskoden nedenfor til at indsende din anmeldelse i henhold til Digital Services Act på {product_name}:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, kan du ignorere denne e-mail.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Bekræft din nye {product_name}-e-mail",
|
||||
"body": "Hej {username},\n\nIndtast denne kode i appen for at bekræfte din nye {product_name}-e-mail:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, kan du ignorere denne e-mail.\n\n– {product_name} Team"
|
||||
"subject": "Bekræft din nye e-mailadresse til {product_name}",
|
||||
"body": "Hej {username},\n\nIndtast denne kode i appen for at bekræfte din nye e-mailadresse til {product_name}:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, kan du ignorere denne e-mail.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Bekræft din {product_name}-e-mail-ændring",
|
||||
"body": "Hej {username},\n\nVi har modtaget en anmodning om at ændre e-mailadressen på din {product_name}-konto.\n\nFor at bekræfte denne ændring skal du indtaste denne kode i appen:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, skal du sikre din konto med det samme.\n\n– {product_name} Team"
|
||||
"subject": "Bekræft ændringen af din e-mailadresse til {product_name}",
|
||||
"body": "Hej {username},\n\nVi har modtaget en anmodning om at ændre e-mailadressen på din {product_name}-konto.\n\nFor at bekræfte denne ændring skal du indtaste denne kode i appen:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, skal du sikre din konto med det samme.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Din {product_name}-e-mail blev ændret",
|
||||
"body": "Hej {username},\n\nE-mailadressen på din {product_name}-konto blev ændret til {newEmail}.\n\nHvis du har foretaget denne ændring, er der ingen handling nødvendig. Hvis du ikke har, kan du fortryde ændringen og sikre din konto ved at bruge dette link:\n\n{revertUrl}\n\nDette vil gendanne din tidligere e-mail, logge dig ud overalt, fjerne tilknyttede telefonnumre, deaktivere MFA og kræve, at du indstiller en ny adgangskode.\n\n– {product_name} Safety Team"
|
||||
"subject": "Din e-mailadresse til {product_name} er ændret",
|
||||
"body": "Hej {username},\n\nE-mailadressen på din {product_name}-konto blev ændret til {newEmail}.\n\nHvis du selv har foretaget ændringen, behøver du ikke gøre noget. Ellers kan du fortryde ændringen og sikre din konto ved at bruge dette link:\n\n{revertUrl}\n\nDette vil gendanne din tidligere e-mailadresse, logge dig ud overalt, fjerne tilknyttede telefonnumre, slå multifaktorgodkendelse fra og kræve, at du vælger en ny adgangskode.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Bekræft din {product_name}-e-mailadresse",
|
||||
"body": "Hej {username},\n\nBekræft e-mailadressen for din {product_name}-konto ved at klikke på linket nedenfor:\n\n{verifyUrl}\n\nHvis du ikke har oprettet en {product_name}-konto, kan du trygt ignorere denne e-mail.\n\nDette link er gyldigt i 24 timer.\n\n– {product_name} Team"
|
||||
"body": "Hej {username},\n\nBekræft e-mailadressen for din {product_name}-konto ved at klikke på linket nedenfor:\n\n{verifyUrl}\n\nHvis du ikke har oprettet en {product_name}-konto, kan du trygt ignorere denne e-mail.\n\nDette link er gyldigt i 24 timer.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "Fordele fra din indløste gave er fjernet",
|
||||
"body": "Hej {username},\n\nEn gavekode, du indløste, blev oprindeligt betalt af en anden. Den betaling er siden annulleret (en tilbageførsel).\n\nDerfor har vi fjernet de fordele, der blev tilføjet din konto, da du indløste gaven.\n\nHvis du mener, at dette er en fejl, kan du kontakte vores supportteam og oplyse alle detaljer, du har om gavekoden, og hvornår du indløste den.\n\n– {product_name} Team"
|
||||
"body": "Hej {username},\n\nEn gavekode, du indløste, blev oprindeligt betalt af en anden. Den betaling er siden annulleret (en tilbageførsel).\n\nDerfor har vi fjernet de fordele, der blev tilføjet din konto, da du indløste gaven.\n\nHvis du mener, at dette er en fejl, kan du kontakte vores supportteam og oplyse alle detaljer, du har om gavekoden, og hvornår du indløste den.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "Din {product_name}-dataeksport er klar til at downloade",
|
||||
"body": "Hej {username},\n\nDin dataeksport er klar.\n\nDownload-link:\n{downloadUrl}\n\nAntal beskeder: {totalMessages, number}\nFilstørrelse: {fileSizeMB, number} MB\n\nDette link udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om denne eksport, skal du straks ændre din adgangskode og kontakte vores supportteam.\n\n– {product_name} Team"
|
||||
"subject": "Din dataeksport fra {product_name} er klar til download",
|
||||
"body": "Hej {username},\n\nDin dataeksport er klar.\n\nDownload-link:\n{downloadUrl}\n\nAntal beskeder: {totalMessages, number}\nFilstørrelse: {fileSizeMB, number} MB\n\nDette link udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om denne eksport, skal du straks ændre din adgangskode og kontakte vores supportteam.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "Din {product_name}-konto slettes på grund af inaktivitet",
|
||||
"body": "Hej {username},\n\nVi har ikke set nogen aktivitet på din {product_name}-konto siden {lastActiveDate, date, full}.\n\nHvis du ikke logger ind inden {deletionDate, date, full} kl. {deletionDate, time, short}, slettes din konto permanent på grund af inaktivitet.\n\nLog ind her:\n{loginUrl}\n\nHvis du har brugt {product_name} for nylig, skal du kontakte vores supportteam med det samme.\n\n– {product_name} Team"
|
||||
"body": "Hej {username},\n\nVi har ikke set nogen aktivitet på din {product_name}-konto siden {lastActiveDate, date, full}.\n\nHvis du ikke logger ind inden {deletionDate, date, full} kl. {deletionDate, time, short}, slettes din konto permanent på grund af inaktivitet.\n\nLog ind her:\n{loginUrl}\n\nHvis du har brugt {product_name} for nylig, skal du kontakte vores supportteam med det samme.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Godkend login fra en ny IP-adresse",
|
||||
"body": "Hej {username},\n\nVi har registreret et login-forsøg på din {product_name}-konto fra en ny IP-adresse:\n\nIP-adresse: {ipAddress}\nSted: {location}\n\nHvis dette var dig, skal du godkende denne IP-adresse ved at klikke på linket nedenfor:\n\n{authUrl}\n\nHvis du ikke har forsøgt at logge ind, skal du straks ændre din adgangskode.\n\nDette link er gyldigt i 30 minutter.\n\n– {product_name} Team"
|
||||
"body": "Hej {username},\n\nVi har registreret et loginforsøg på din {product_name}-konto fra en ny IP-adresse:\n\nIP-adresse: {ipAddress}\nSted: {location}\n\nHvis det var dig, skal du godkende denne IP-adresse ved at klikke på linket nedenfor:\n\n{authUrl}\n\nHvis du ikke har forsøgt at logge ind, skal du straks ændre din adgangskode.\n\nDette link er gyldigt i 30 minutter.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Bekræft adgang til dine {product_name}-backupkoder",
|
||||
"body": "Hej {username},\n\nVi har modtaget en anmodning om at se backupkoderne på din {product_name}-konto.\n\nFor at bekræfte denne anmodning skal du indtaste denne kode i appen:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, har nogen muligvis adgang til din konto. Skift din adgangskode med det samme.\n\n– {product_name} Team"
|
||||
"body": "Hej {username},\n\nVi har modtaget en anmodning om at se backupkoderne på din {product_name}-konto.\n\nFor at bekræfte denne anmodning skal du indtaste denne kode i appen:\n\n{code}\n\nDenne kode udløber den {expiresAt, date, full} kl. {expiresAt, time, short}.\n\nHvis du ikke har anmodet om dette, har nogen muligvis adgang til din konto. Skift din adgangskode med det samme.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Bekræft din {product_name}-adgangskodeændring",
|
||||
"body": "Hej {username},\n\nVi har modtaget en anmodning om at ændre adgangskoden på din {product_name}-konto.\n\nFor at bekræfte denne ændring skal du indtaste denne kode i appen:\n\n{code}\n\nDenne kode udløber kl. {expiresAt}.\n\nHvis du ikke har anmodet om dette, har nogen muligvis adgang til din konto. Skift din adgangskode med det samme, og aktiver totrinsgodkendelse.\n\n– {product_name} Team"
|
||||
"subject": "Bekræft ændringen af din adgangskode til {product_name}",
|
||||
"body": "Hej {username},\n\nVi har modtaget en anmodning om at ændre adgangskoden på din {product_name}-konto.\n\nFor at bekræfte denne ændring skal du indtaste denne kode i appen:\n\n{code}\n\nDenne kode udløber kl. {expiresAt}.\n\nHvis du ikke har anmodet om dette, har nogen muligvis adgang til din konto. Skift din adgangskode med det samme, og aktiver tofaktorgodkendelse.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Nulstil din {product_name}-adgangskode",
|
||||
"body": "Hej {username},\n\nDu har anmodet om at nulstille din {product_name}-adgangskode. Brug linket nedenfor til at indstille en ny adgangskode:\n\n{resetUrl}\n\nHvis du ikke har anmodet om dette, kan du trygt ignorere denne e-mail.\n\nDette link er gyldigt i 1 time.\n\n– {product_name} Team"
|
||||
"body": "Hej {username},\n\nDu har anmodet om at nulstille din {product_name}-adgangskode. Brug linket nedenfor til at vælge en ny adgangskode:\n\n{resetUrl}\n\nHvis du ikke har anmodet om dette, kan du trygt ignorere denne e-mail.\n\nDette link er gyldigt i 1 time.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "Din {product_name}-registrering er godkendt",
|
||||
"body": "Hej {username},\n\nGode nyheder: Din {product_name}-registrering er godkendt.\n\nDu kan nu logge ind på {product_name}-appen her:\n{channelsUrl}\n\nVelkommen til {product_name}-community'et.\n\n– {product_name} Team"
|
||||
"subject": "Din tilmelding til {product_name} er godkendt",
|
||||
"body": "Hej {username},\n\nGode nyheder: Din tilmelding til {product_name} er godkendt.\n\nDu kan nu logge ind på {product_name}-appen her:\n{channelsUrl}\n\nVelkommen til fællesskabet på {product_name}.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Din {product_name}-rapport er gennemgået",
|
||||
"body": "Hej {username},\n\nDin rapport (ID: {reportId}) er gennemgået af vores Safety Team.{hasComment, select, yes {\n\nSvar fra Safety Team:\n{publicComment}} other {}}\n\nTak for din hjælp til at holde {product_name} sikkert for alle. Vi tager alle rapporter alvorligt og værdsætter dit bidrag til community'et.\n\nHvis du har spørgsmål eller bekymringer vedrørende dette resultat, kan du kontakte {safety_email}.\n\n– {product_name} Safety Team"
|
||||
"subject": "Din anmeldelse på {product_name} er blevet behandlet",
|
||||
"body": "Hej {username},\n\nDin anmeldelse (ID: {reportId}) er blevet behandlet af vores sikkerhedsteam.{hasComment, select, yes {\n\nSvar fra sikkerhedsteamet:\n{publicComment}} other {}}\n\nTak for din hjælp til at holde {product_name} sikkert for alle. Vi tager alle anmeldelser alvorligt og værdsætter dit bidrag til fællesskabet.\n\nHvis du har spørgsmål eller bekymringer vedrørende dette resultat, kan du kontakte {safety_email}.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Din {product_name}-konto slettes permanent",
|
||||
"body": "Hej {username},\n\nDin {product_name}-konto er planlagt til permanent sletning.\n\nPlanlagt sletning: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nDette er en alvorlig håndhævelseshandling. Dine kontodata bliver permanent slettet på den planlagte dato.\n\nHvis du mener, at denne håndhævelsesbeslutning var forkert, kan du indsende en anke. Send en e-mail til {appeals_email} fra denne e-mailadresse.\n\n– {product_name} Safety Team"
|
||||
"body": "Hej {username},\n\nVi har planlagt at slette din {product_name}-konto permanent.\n\nPlanlagt sletning: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nDette er en alvorlig sanktion. Dine kontodata bliver permanent slettet på den planlagte dato.\n\nHvis du mener, at denne beslutning om sanktioner var forkert, kan du indsende en klage. Send en e-mail til {appeals_email} fra denne e-mailadresse.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "Din {product_name}-kontosletning er planlagt",
|
||||
"body": "Hej {username},\n\nDu har anmodet om at slette din {product_name}-konto. Din konto slettes permanent den:\n\n{deletionDate, date, full} kl. {deletionDate, time, short}\n\nHvis du ikke har anmodet om dette, skal du logge ind på din konto for at annullere sletningen. Vi anbefaler også, at du ændrer din adgangskode for at sikre din konto.\n\n– {product_name} Team"
|
||||
"subject": "Sletningen af din {product_name}-konto er planlagt",
|
||||
"body": "Hej {username},\n\nDu har anmodet om at slette din {product_name}-konto. Din konto slettes permanent den:\n\n{deletionDate, date, full} kl. {deletionDate, time, short}\n\nHvis du ikke har anmodet om dette, skal du logge ind på din konto for at annullere sletningen. Vi anbefaler også, at du ændrer din adgangskode for at sikre din konto.\n\n– Teamet bag {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "Din {product_name}-kontosuspension er ophævet",
|
||||
"body": "Hej {username},\n\nGode nyheder: Din {product_name}-kontosuspension er ophævet.\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nDu kan nu logge ind igen og fortsætte med at bruge {product_name} som normalt.\n\n– {product_name} Safety Team"
|
||||
"subject": "Suspensionen af din {product_name}-konto er ophævet",
|
||||
"body": "Hej {username},\n\nGode nyheder: Suspensionen af din {product_name}-konto er ophævet.\n\n{reason, select,\n null {}\n other {Årsag: {reason}}\n}\n\nDu kan nu logge ind igen og fortsætte med at bruge {product_name} som normalt.\n\n– Sikkerhedsteamet hos {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_DE_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
@@ -9,7 +9,7 @@ const EMAIL_I18N_DE_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Dein {product_name}-Account wird dauerhaft gelöscht",
|
||||
"body": "Hallo {username},\n\ndein {product_name}-Account wurde aufgrund von Verstößen gegen unsere Nutzungsbedingungen oder Community-Richtlinien zur dauerhaften Löschung vorgemerkt.\n\nGeplante Löschung: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Grund: {reason}}\n}\n\nDies ist eine ernsthafte Maßnahme. Deine Accountdaten werden am geplanten Datum dauerhaft gelöscht.\n\nBitte lies dir Folgendes durch:\n- Nutzungsbedingungen: {termsUrl}\n- Community-Richtlinien: {guidelinesUrl}\n\nEinspruchsverfahren:\nWenn du glaubst, dass diese Entscheidung falsch oder ungerechtfertigt war, hast du 60 Tage Zeit, Einspruch einzulegen. Sende eine E-Mail von dieser E-Mail-Adresse an {appeals_email}.\n\nIn deinem Einspruch:\n- Erkläre klar, warum du glaubst, dass die Entscheidung falsch oder ungerechtfertigt war\n- Füge alle relevanten Beweise oder Kontextinformationen bei\n\nEin Mitglied des {product_name}-Sicherheitsteams wird deinen Einspruch prüfen und die ausstehende Löschung möglicherweise pausieren, bis eine endgültige Entscheidung getroffen wurde.\n\n– {product_name}-Sicherheitsteam"
|
||||
"body": "Hallo {username},\n\ndein {product_name}-Account wurde aufgrund von Verstößen gegen unsere Nutzungsbedingungen oder Community-Richtlinien zur dauerhaften Löschung vorgemerkt.\n\nGeplante Löschung: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Grund: {reason}}\n}\n\nDies ist eine ernsthafte Maßnahme. Deine Accountdaten werden am geplanten Datum dauerhaft gelöscht.\n\nBitte lies dir Folgendes durch:\n- Nutzungsbedingungen: {termsUrl}\n- Community-Richtlinien: {guidelinesUrl}\n\nEinspruchsverfahren:\nWenn du glaubst, dass diese Entscheidung falsch oder ungerechtfertigt war, hast du 60 Tage Zeit, Einspruch einzulegen. Sende eine E-Mail von dieser E-Mail-Adresse an {appeals_email}.\n\nIn deinem Einspruch:\n- Erkläre klar, warum du glaubst, dass die Entscheidung falsch oder ungerechtfertigt war\n- Füge alle relevanten Beweise oder Kontextinformationen bei\n\nEin Mitglied des {product_name}-Sicherheitsteams wird deinen Einspruch prüfen und die geplante Löschung möglicherweise aussetzen, bis eine endgültige Entscheidung getroffen wurde.\n\n– {product_name}-Sicherheitsteam"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Dein {product_name}-Account wurde vorübergehend gesperrt",
|
||||
@@ -17,67 +17,67 @@ const EMAIL_I18N_DE_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Vielen Dank für deine {product_name}-Spende",
|
||||
"body": "Hallo,\n\nvielen Dank für deine Spende an {product_name}! Deine {interval, select,\n month {wiederkehrende Spende}\n year {wiederkehrende Spende}\n other {einmalige Spende}\n} wurde erfolgreich {interval, select,\n month {eingerichtet}\n year {eingerichtet}\n other {verarbeitet}\n}.\n\nDetails zur Spende:\nBetrag: {amount} {currency} {interval, select,\n month {pro Monat}\n year {pro Jahr}\n other {}\n}\n\nStripe sendet dir in Kürze eine separate Quittung mit deiner Rechnungs-PDF per E-Mail. Diese enthält alle Zahlungsdetails und kann für Steuerzwecke verwendet werden.\n\nDu kannst deine Spendenhistorie einsehen, Rechnungen herunterladen {interval, select,\n month {und dein Abonnement jederzeit über diesen Link verwalten oder kündigen}\n year {und dein Abonnement jederzeit über diesen Link verwalten oder kündigen}\n other {und zukünftige Spenden verwalten}\n}:\n\n{manageUrl}\n\nDeine Unterstützung hilft, {product_name} am Laufen zu halten. Vielen Dank!\n\n– {product_name} Team"
|
||||
"body": "Hallo,\n\nvielen Dank für deine Spende an {product_name}! Deine {interval, select,\n month {wiederkehrende Spende}\n year {wiederkehrende Spende}\n other {einmalige Spende}\n} wurde erfolgreich {interval, select,\n month {eingerichtet}\n year {eingerichtet}\n other {verarbeitet}\n}.\n\nDetails zur Spende:\nBetrag: {amount} {interval, select,\n month {pro Monat}\n year {pro Jahr}\n other {}\n}\n\nStripe sendet dir in Kürze eine separate Quittung mit deiner Rechnungs-PDF per E-Mail. Diese enthält alle Zahlungsdetails und kann für Steuerzwecke verwendet werden.\n\nÜber diesen Link kannst du jederzeit deine Spendenübersicht aufrufen, Rechnungen herunterladen {interval, select,\n month {und dein Abonnement verwalten oder kündigen}\n year {und dein Abonnement verwalten oder kündigen}\n other {und zukünftige Spenden verwalten}\n}:\n\n{manageUrl}\n\nDeine Unterstützung hilft, {product_name} am Laufen zu halten. Vielen Dank!\n\n– {product_name}-Team"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Verwalte deine {product_name}-Spenden",
|
||||
"body": "Hallo,\n\nklicke auf den Link unten, um auf dein Spenderportal zuzugreifen:\n\n{manageUrl}\n\nIm Portal kannst du Abonnements verwalten, Rechnungen herunterladen und deine Spendenhistorie einsehen.\n\nDieser Link läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du diesen Link nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\n– {product_name} Team"
|
||||
"body": "Hallo,\n\nklicke auf den Link unten, um auf dein Spendenportal zuzugreifen:\n\n{manageUrl}\n\nIm Portal kannst du Abonnements verwalten, Rechnungen herunterladen und deine Spendenübersicht einsehen.\n\nDieser Link läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du diesen Link nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\n– {product_name}-Team"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Bestätige deine E-Mail für einen DSA-Bericht",
|
||||
"body": "Hallo,\n\nverwende den untenstehenden Bestätigungscode, um deinen DSA-Bericht auf {product_name} einzureichen:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\n– {product_name}-Sicherheitsteam"
|
||||
"subject": "Bestätige deine E-Mail-Adresse für eine DSA-Meldung",
|
||||
"body": "Hallo,\n\nverwende den untenstehenden Bestätigungscode, um deine Meldung nach dem Digital Services Act (DSA) auf {product_name} einzureichen:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\n– {product_name}-Sicherheitsteam"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Bestätige deine neue {product_name}-E-Mail",
|
||||
"body": "Hallo {username},\n\ngib diesen Code in der App ein, um deine neue {product_name}-E-Mail zu bestätigen:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\n– {product_name} Team"
|
||||
"subject": "Bestätige deine neue {product_name}-E-Mail-Adresse",
|
||||
"body": "Hallo {username},\n\ngib diesen Code in der App ein, um deine neue {product_name}-E-Mail-Adresse zu bestätigen:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\n– {product_name}-Team"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Bestätige deine {product_name}-E-Mail-Änderung",
|
||||
"body": "Hallo {username},\n\nwir haben eine Anfrage zur Änderung der E-Mail-Adresse deines {product_name}-Accounts erhalten.\n\nUm diese Änderung zu bestätigen, gib diesen Code in der App ein:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du diese Änderung nicht angefordert hast, sichere deinen Account bitte sofort ab.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nwir haben eine Anfrage zur Änderung der E-Mail-Adresse deines {product_name}-Accounts erhalten.\n\nUm diese Änderung zu bestätigen, gib diesen Code in der App ein:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du diese Änderung nicht angefordert hast, sichere deinen Account bitte sofort ab.\n\n– {product_name}-Team"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Deine {product_name}-E-Mail wurde geändert",
|
||||
"body": "Hallo {username},\n\ndie E-Mail-Adresse deines {product_name}-Accounts wurde zu {newEmail} geändert.\n\nWenn du diese Änderung vorgenommen hast, ist keine weitere Aktion erforderlich. Wenn nicht, kannst du die Änderung rückgängig machen und deinen Account über diesen Link absichern:\n\n{revertUrl}\n\nDadurch wird deine vorherige E-Mail wiederhergestellt, du wirst überall abgemeldet, verknüpfte Telefonnummern werden entfernt, MFA wird deaktiviert und du musst ein neues Passwort festlegen.\n\n– {product_name}-Sicherheitsteam"
|
||||
"subject": "Deine {product_name}-E-Mail-Adresse wurde geändert",
|
||||
"body": "Hallo {username},\n\ndie E-Mail-Adresse deines {product_name}-Accounts wurde in {newEmail} geändert.\n\nWenn du diese Änderung vorgenommen hast, ist keine weitere Aktion erforderlich. Wenn nicht, kannst du die Änderung rückgängig machen und deinen Account über diesen Link absichern:\n\n{revertUrl}\n\nDadurch wird deine vorherige E-Mail-Adresse wiederhergestellt, du wirst überall abgemeldet, verknüpfte Telefonnummern werden entfernt, MFA wird deaktiviert und du musst ein neues Passwort festlegen.\n\n– {product_name}-Sicherheitsteam"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Bestätige deine {product_name}-E-Mail-Adresse",
|
||||
"body": "Hallo {username},\n\nbitte bestätige die E-Mail-Adresse für deinen {product_name}-Account, indem du auf den untenstehenden Link klickst:\n\n{verifyUrl}\n\nWenn du keinen {product_name}-Account erstellt hast, kannst du diese E-Mail ignorieren.\n\nDieser Link ist 24 Stunden gültig.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nbitte bestätige die E-Mail-Adresse für deinen {product_name}-Account, indem du auf den untenstehenden Link klickst:\n\n{verifyUrl}\n\nWenn du keinen {product_name}-Account erstellt hast, kannst du diese E-Mail ignorieren.\n\nDieser Link ist 24 Stunden gültig.\n\n– {product_name}-Team"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "Vorteile deines eingelösten Geschenks wurden entfernt",
|
||||
"body": "Hallo {username},\n\nein von dir eingelöster Geschenkcode wurde ursprünglich von jemand anderem bezahlt. Diese Zahlung wurde inzwischen rückgängig gemacht (eine Rückbuchung).\n\nAus diesem Grund haben wir die Vorteile entfernt, die deinem Account hinzugefügt wurden, als du das Geschenk eingelöst hast.\n\nWenn du glaubst, dass dies ein Fehler ist, kontaktiere bitte unser Support-Team und gib alle Details an, die du über den Geschenkcode und den Zeitpunkt der Einlösung hast.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nein von dir eingelöster Geschenkcode wurde ursprünglich von jemand anderem bezahlt. Diese Zahlung wurde inzwischen rückgängig gemacht (eine Rückbuchung).\n\nAus diesem Grund haben wir die Vorteile entfernt, die deinem Account hinzugefügt wurden, als du das Geschenk eingelöst hast.\n\nWenn du glaubst, dass dies ein Fehler ist, kontaktiere bitte unser Support-Team und gib alle Details an, die du über den Geschenkcode und den Zeitpunkt der Einlösung hast.\n\n– {product_name}-Team"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "Dein {product_name}-Datenexport steht zum Herunterladen bereit",
|
||||
"body": "Hallo {username},\n\ndein Datenexport ist bereit.\n\nDownload-Link:\n{downloadUrl}\n\nEnthaltene Nachrichten: {totalMessages, number}\nDateigröße: {fileSizeMB, number} MB\n\nDieser Link läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du diesen Export nicht angefordert hast, ändere bitte sofort dein Passwort und kontaktiere unser Support-Team.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\ndein Datenexport ist bereit.\n\nDownload-Link:\n{downloadUrl}\n\nEnthaltene Nachrichten: {totalMessages, number}\nDateigröße: {fileSizeMB, number} MB\n\nDieser Link läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du diesen Export nicht angefordert hast, ändere bitte sofort dein Passwort und kontaktiere unser Support-Team.\n\n– {product_name}-Team"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "Dein {product_name}-Account wird wegen Inaktivität gelöscht",
|
||||
"body": "Hallo {username},\n\nwir haben seit dem {lastActiveDate, date, full} keine Aktivität auf deinem {product_name}-Account festgestellt.\n\nWenn du dich nicht bis zum {deletionDate, date, full} um {deletionDate, time, short} anmeldest, wird dein Account aufgrund von Inaktivität dauerhaft gelöscht.\n\nMelde dich hier an:\n{loginUrl}\n\nWenn du {product_name} kürzlich genutzt hast, kontaktiere bitte sofort unser Support-Team.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nwir haben seit dem {lastActiveDate, date, full} keine Aktivität auf deinem {product_name}-Account festgestellt.\n\nWenn du dich nicht bis zum {deletionDate, date, full} um {deletionDate, time, short} anmeldest, wird dein Account aufgrund von Inaktivität dauerhaft gelöscht.\n\nMelde dich hier an:\n{loginUrl}\n\nWenn du {product_name} kürzlich genutzt hast, kontaktiere bitte sofort unser Support-Team.\n\n– {product_name}-Team"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Anmeldung von einer neuen IP-Adresse bestätigen",
|
||||
"body": "Hallo {username},\n\nwir haben einen Anmeldeversuch für deinen {product_name}-Account von einer neuen IP-Adresse festgestellt:\n\nIP-Adresse: {ipAddress}\nStandort: {location}\n\nWenn du das warst, bestätige diese IP-Adresse bitte, indem du auf den untenstehenden Link klickst:\n\n{authUrl}\n\nWenn du dich nicht anmelden wolltest, ändere bitte sofort dein Passwort.\n\nDieser Link ist 30 Minuten gültig.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nwir haben einen Anmeldeversuch für deinen {product_name}-Account von einer neuen IP-Adresse festgestellt:\n\nIP-Adresse: {ipAddress}\nStandort: {location}\n\nWenn du das warst, bestätige diese IP-Adresse bitte, indem du auf den untenstehenden Link klickst:\n\n{authUrl}\n\nWenn du nicht versucht hast, dich anzumelden, ändere bitte sofort dein Passwort.\n\nDieser Link ist 30 Minuten gültig.\n\n– {product_name}-Team"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Bestätige den Zugriff auf deine {product_name}-Backup-Codes",
|
||||
"body": "Hallo {username},\n\nwir haben eine Anfrage erhalten, die Backup-Codes deines {product_name}-Accounts anzusehen.\n\nUm diese Anfrage zu bestätigen, gib diesen Code in der App ein:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du dies nicht angefordert hast, könnte jemand Zugriff auf deinen Account haben. Ändere dein Passwort sofort.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nwir haben eine Anfrage erhalten, die Backup-Codes deines {product_name}-Accounts anzusehen.\n\nUm diese Anfrage zu bestätigen, gib diesen Code in der App ein:\n\n{code}\n\nDieser Code läuft am {expiresAt, date, full} um {expiresAt, time, short} ab.\n\nWenn du dies nicht angefordert hast, könnte jemand Zugriff auf deinen Account haben. Ändere dein Passwort sofort.\n\n– {product_name}-Team"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Bestätige deine {product_name}-Passwortänderung",
|
||||
"body": "Hallo {username},\n\nwir haben eine Anfrage zur Änderung des Passworts deines {product_name}-Accounts erhalten.\n\nUm diese Änderung zu bestätigen, gib diesen Code in der App ein:\n\n{code}\n\nDieser Code läuft um {expiresAt} ab.\n\nWenn du diese Änderung nicht angefordert hast, könnte jemand Zugriff auf deinen Account haben. Ändere dein Passwort sofort und aktiviere die Zwei-Faktor-Authentifizierung.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\nwir haben eine Anfrage zur Änderung des Passworts deines {product_name}-Accounts erhalten.\n\nUm diese Änderung zu bestätigen, gib diesen Code in der App ein:\n\n{code}\n\nDieser Code läuft um {expiresAt} ab.\n\nWenn du diese Änderung nicht angefordert hast, könnte jemand Zugriff auf deinen Account haben. Ändere dein Passwort sofort und aktiviere die Zwei-Faktor-Authentifizierung.\n\n– {product_name}-Team"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Setze dein {product_name}-Passwort zurück",
|
||||
"body": "Hallo {username},\n\ndu hast eine {product_name}-Passwortzurücksetzung angefordert. Verwende den untenstehenden Link, um ein neues Passwort festzulegen:\n\n{resetUrl}\n\nWenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\nDieser Link ist 1 Stunde gültig.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\ndu hast angefordert, dein {product_name}-Passwort zurückzusetzen. Verwende den untenstehenden Link, um ein neues Passwort festzulegen:\n\n{resetUrl}\n\nWenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n\nDieser Link ist 1 Stunde gültig.\n\n– {product_name}-Team"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "Deine {product_name}-Registrierung wurde genehmigt",
|
||||
"body": "Hallo {username},\n\ngute Nachrichten: Deine {product_name}-Registrierung wurde genehmigt.\n\nDu kannst dich jetzt hier in die {product_name}-App einloggen:\n{channelsUrl}\n\nWillkommen in der {product_name}-Community.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\ngute Nachrichten: Deine {product_name}-Registrierung wurde genehmigt.\n\nDu kannst dich jetzt hier in die {product_name}-App einloggen:\n{channelsUrl}\n\nWillkommen in der {product_name}-Community.\n\n– {product_name}-Team"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Dein {product_name}-Bericht wurde geprüft",
|
||||
"body": "Hallo {username},\n\ndein Bericht (ID: {reportId}) wurde von unserem Sicherheitsteam geprüft.{hasComment, select, yes {\n\nAntwort vom Sicherheitsteam:\n{publicComment}} other {}}\n\nDanke, dass du hilfst, {product_name} für alle sicher zu halten. Wir nehmen alle Berichte ernst und schätzen deinen Beitrag zur Community.\n\nWenn du Fragen oder Bedenken zu diesem Ergebnis hast, kontaktiere bitte {safety_email}.\n\n– {product_name}-Sicherheitsteam"
|
||||
"subject": "Deine {product_name}-Meldung wurde geprüft",
|
||||
"body": "Hallo {username},\n\ndeine Meldung (ID: {reportId}) wurde von unserem Sicherheitsteam geprüft.{hasComment, select, yes {\n\nAntwort vom Sicherheitsteam:\n{publicComment}} other {}}\n\nDanke, dass du hilfst, {product_name} für alle sicher zu halten. Wir nehmen alle Meldungen ernst und schätzen deinen Beitrag zur Community.\n\nWenn du Fragen oder Bedenken zu diesem Ergebnis hast, kontaktiere bitte {safety_email}.\n\n– {product_name}-Sicherheitsteam"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Dein {product_name}-Account wird dauerhaft gelöscht",
|
||||
@@ -85,7 +85,7 @@ const EMAIL_I18N_DE_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "Die Löschung deines {product_name}-Accounts ist geplant",
|
||||
"body": "Hallo {username},\n\ndu hast die Löschung deines {product_name}-Accounts beantragt. Dein Account ist zur dauerhaften Löschung vorgesehen am:\n\n{deletionDate, date, full} um {deletionDate, time, short}\n\nWenn du diese Löschung nicht beantragt hast, melde dich in deinem Account an, um die Löschung abzubrechen. Wir empfehlen außerdem, dein Passwort zu ändern, um deinen Account abzusichern.\n\n– {product_name} Team"
|
||||
"body": "Hallo {username},\n\ndu hast die Löschung deines {product_name}-Accounts beantragt. Dein Account wird an folgendem Termin dauerhaft gelöscht:\n\n{deletionDate, date, full} um {deletionDate, time, short}\n\nWenn du diese Löschung nicht beantragt hast, melde dich in deinem Account an, um die Löschung abzubrechen. Wir empfehlen außerdem, dein Passwort zu ändern, um deinen Account abzusichern.\n\n– {product_name}-Team"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "Die Sperrung deines {product_name}-Accounts wurde aufgehoben",
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_EL_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "Ο λογαριασμός σου στο {product_name} έχει απενεργοποιηθεί προσωρινά",
|
||||
"body": "Γεια σου {username},\n\nΑπενεργοποιήσαμε προσωρινά τον λογαριασμό σου στο {product_name} επειδή εντοπίσαμε ύποπτη δραστηριότητα.\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΓια να αποκτήσεις ξανά πρόσβαση στον λογαριασμό σου, θα πρέπει να επαναφέρεις τον κωδικό πρόσβασής σου:\n\n{forgotUrl}\n\nΑφού επαναφέρεις τον κωδικό πρόσβασής σου, θα μπορείς να συνδεθείς ξανά.\n\nΕάν πιστεύεις ότι αυτό έγινε κατά λάθος, επικοινώνησε με την ομάδα υποστήριξής μας.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΑπενεργοποιήσαμε προσωρινά τον λογαριασμό σου στο {product_name} επειδή εντοπίσαμε ύποπτη δραστηριότητα.\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΓια να αποκτήσεις ξανά πρόσβαση στον λογαριασμό σου, θα πρέπει να επαναφέρεις τον κωδικό πρόσβασής σου:\n\n{forgotUrl}\n\nΑφού επαναφέρεις τον κωδικό πρόσβασής σου, θα μπορείς να συνδεθείς ξανά.\n\nΕάν πιστεύεις ότι αυτό έγινε κατά λάθος, επικοινώνησε με την ομάδα υποστήριξής μας.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Ο λογαριασμός σου στο {product_name} θα διαγραφεί οριστικά",
|
||||
"body": "Γεια σου {username},\n\nΟ λογαριασμός σου στο {product_name} έχει προγραμματιστεί για οριστική διαγραφή λόγω παραβιάσεων των Όρων Παροχής Υπηρεσιών ή των Οδηγιών Κοινότητας.\n\nΠρογραμματισμένη διαγραφή: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΠρόκειται για ένα σοβαρό μέτρο. Τα δεδομένα του λογαριασμού σου θα διαγραφούν οριστικά την προγραμματισμένη ημερομηνία.\n\nΈλεγξε:\n- Όροι Παροχής Υπηρεσιών: {termsUrl}\n- Οδηγίες Κοινότητας: {guidelinesUrl}\n\nΔιαδικασία προσφυγής:\nΕάν πιστεύεις ότι αυτή η απόφαση ήταν λανθασμένη ή αδικαιολόγητη, έχεις 60 ημέρες για να υποβάλεις προσφυγή. Στείλε email στο {appeals_email} από αυτήν τη διεύθυνση email.\n\nΣτην προσφυγή σου:\n- Εξήγησε σαφώς γιατί πιστεύεις ότι η απόφαση ήταν λανθασμένη ή αδικαιολόγητη\n- Παράθεσε τυχόν σχετικά αποδεικτικά στοιχεία ή πλαίσιο\n\nΈνα μέλος της Ομάδας Ασφαλείας του {product_name} θα εξετάσει την προσφυγή σου και ενδέχεται να αναστείλει την εκκρεμή διαγραφή μέχρι να ληφθεί μια τελική απόφαση.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΟ λογαριασμός σου στο {product_name} έχει προγραμματιστεί για οριστική διαγραφή λόγω παραβιάσεων των Όρων παροχής υπηρεσιών ή των Οδηγιών κοινότητας.\n\nΠρογραμματισμένη διαγραφή: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΠρόκειται για σοβαρό μέτρο. Τα δεδομένα του λογαριασμού σου θα διαγραφούν οριστικά την προγραμματισμένη ημερομηνία.\n\nΈλεγξε:\n- Όροι παροχής υπηρεσιών: {termsUrl}\n- Οδηγίες κοινότητας: {guidelinesUrl}\n\nΔιαδικασία προσφυγής:\nΕάν πιστεύεις ότι αυτή η απόφαση ήταν λανθασμένη ή αδικαιολόγητη, έχεις 60 ημέρες για να υποβάλεις προσφυγή. Στείλε email στο {appeals_email} από αυτήν τη διεύθυνση email.\n\nΣτην προσφυγή σου:\n- Εξήγησε σαφώς γιατί πιστεύεις ότι η απόφαση ήταν λανθασμένη ή αδικαιολόγητη\n- Παράθεσε τυχόν σχετικά αποδεικτικά στοιχεία ή πλαίσιο\n\nΈνα μέλος της ομάδας ασφαλείας του {product_name} θα εξετάσει την προσφυγή σου και ενδέχεται να αναστείλει την εκκρεμή διαγραφή μέχρι να ληφθεί τελική απόφαση.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Ο λογαριασμός σου στο {product_name} έχει ανασταλεί προσωρινά",
|
||||
"body": "Γεια σου {username},\n\nΟ λογαριασμός σου στο {product_name} έχει ανασταλεί προσωρινά για παραβίαση των Όρων Παροχής Υπηρεσιών ή των Οδηγιών Κοινότητας.\n\nΔιάρκεια: {durationHours, plural,\n =1 {μία ώρα}\n other {# ώρες}\n}\nΑναστολή μέχρι: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΚατά τη διάρκεια αυτής της περιόδου, δεν θα μπορείς να έχεις πρόσβαση στον λογαριασμό σου.\n\nΈλεγξε:\n- Όροι Παροχής Υπηρεσιών: {termsUrl}\n- Οδηγίες Κοινότητας: {guidelinesUrl}\n\nΕάν πιστεύεις ότι αυτή η απόφαση ήταν λανθασμένη ή αδικαιολόγητη, μπορείς να υποβάλεις προσφυγή. Στείλε email στο {appeals_email} από αυτήν τη διεύθυνση email και εξήγησε σαφώς γιατί πιστεύεις ότι η απόφαση ήταν λανθασμένη. Θα εξετάσουμε την προσφυγή σου και θα απαντήσουμε με την απόφασή μας.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΟ λογαριασμός σου στο {product_name} έχει ανασταλεί προσωρινά για παραβίαση των Όρων παροχής υπηρεσιών ή των Οδηγιών κοινότητας.\n\nΔιάρκεια: {durationHours, plural,\n =1 {μία ώρα}\n other {# ώρες}\n}\nΑναστολή μέχρι: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΚατά τη διάρκεια αυτής της περιόδου, δεν θα έχεις πρόσβαση στον λογαριασμό σου.\n\nΈλεγξε:\n- Όροι παροχής υπηρεσιών: {termsUrl}\n- Οδηγίες κοινότητας: {guidelinesUrl}\n\nΕάν πιστεύεις ότι αυτή η απόφαση ήταν λανθασμένη ή αδικαιολόγητη, μπορείς να υποβάλεις προσφυγή. Στείλε email στο {appeals_email} από αυτήν τη διεύθυνση email και εξήγησε σαφώς γιατί πιστεύεις ότι η απόφαση ήταν λανθασμένη. Θα εξετάσουμε την προσφυγή σου και θα σου απαντήσουμε με την απόφασή μας.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Ευχαριστούμε για τη δωρεά σου στο {product_name}",
|
||||
"body": "Γεια σου,\n\nΕυχαριστούμε για τη δωρεά σου στο {product_name}! Η {interval, select,\n month {επαναλαμβανόμενη δωρεά}\n year {επαναλαμβανόμενη δωρεά}\n other {εφάπαξ δωρεά}\n} σου έχει {interval, select,\n month {ρυθμιστεί}\n year {ρυθμιστεί}\n other {επεξεργαστεί}\n} επιτυχώς.\n\nΛεπτομέρειες δωρεάς:\nΠοσό: {amount} {currency} {interval, select,\n month {ανά μήνα}\n year {ανά έτος}\n other {}\n}\n\nΗ Stripe θα σου στείλει σύντομα μια ξεχωριστή απόδειξη με το PDF του τιμολογίου σου. Αυτό περιλαμβάνει όλες τις λεπτομέρειες πληρωμής και μπορεί να χρησιμοποιηθεί για φορολογικούς σκοπούς.\n\nΜπορείς να δεις το ιστορικό των δωρεών σου, να κατεβάσεις τιμολόγια, {interval, select,\n month {και να διαχειριστείς ή να ακυρώσεις τη συνδρομή σου}\n year {και να διαχειριστείς ή να ακυρώσεις τη συνδρομή σου}\n other {και να διαχειριστείς μελλοντικές δωρεές}\n} ανά πάσα στιγμή χρησιμοποιώντας αυτόν τον σύνδεσμο:\n\n{manageUrl}\n\nΗ υποστήριξή σου βοηθάει το {product_name} να συνεχίσει να λειτουργεί. Ευχαριστούμε!\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου,\n\nΕυχαριστούμε για τη δωρεά σου στο {product_name}! Η {interval, select,\n month {επαναλαμβανόμενη δωρεά}\n year {επαναλαμβανόμενη δωρεά}\n other {εφάπαξ δωρεά}\n} σου έχει {interval, select,\n month {ρυθμιστεί}\n year {ρυθμιστεί}\n other {ολοκληρωθεί}\n} με επιτυχία.\n\nΛεπτομέρειες δωρεάς:\nΠοσό: {amount} {interval, select,\n month {ανά μήνα}\n year {ανά έτος}\n other {}\n}\n\nΗ Stripe θα σου στείλει σύντομα ξεχωριστή απόδειξη με το PDF του τιμολογίου σου. Περιλαμβάνει όλες τις λεπτομέρειες πληρωμής και μπορεί να χρησιμοποιηθεί για φορολογικούς σκοπούς.\n\nΜπορείς να δεις το ιστορικό των δωρεών σου, να κατεβάσεις τιμολόγια, {interval, select,\n month {και να διαχειριστείς ή να ακυρώσεις τη συνδρομή σου}\n year {και να διαχειριστείς ή να ακυρώσεις τη συνδρομή σου}\n other {και να διαχειριστείς μελλοντικές δωρεές}\n} ανά πάσα στιγμή χρησιμοποιώντας αυτόν τον σύνδεσμο:\n\n{manageUrl}\n\nΗ υποστήριξή σου βοηθάει το {product_name} να συνεχίσει να λειτουργεί. Ευχαριστούμε!\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Διαχείριση των δωρεών σου στο {product_name}",
|
||||
"body": "Γεια σου,\n\nΚάνε κλικ στον παρακάτω σύνδεσμο για να αποκτήσεις πρόσβαση στην πύλη δωρητών σου:\n\n{manageUrl}\n\nΣτην πύλη, μπορείς να διαχειριστείς τις συνδρομές, να κατεβάσεις τιμολόγια και να δεις το ιστορικό των δωρεών σου.\n\nΑυτός ο σύνδεσμος λήγει στις {expiresAt, date, full} στις {expiresAt, time, short}.\n\nΕάν δεν ζήτησες αυτόν τον σύνδεσμο, μπορείς να αγνοήσεις με ασφάλεια αυτό το email.\n\n– Ομάδα {product_name}"
|
||||
"subject": "Διαχειρίσου τις δωρεές σου στο {product_name}",
|
||||
"body": "Γεια σου,\n\nΚάνε κλικ στον παρακάτω σύνδεσμο για να αποκτήσεις πρόσβαση στην πύλη δωρητών σου:\n\n{manageUrl}\n\nΣτην πύλη μπορείς να διαχειριστείς τις συνδρομές, να κατεβάσεις τιμολόγια και να δεις το ιστορικό των δωρεών σου.\n\nΑυτός ο σύνδεσμος λήγει στις {expiresAt, date, full} και ώρα {expiresAt, time, short}.\n\nΕάν δεν ζήτησες αυτόν τον σύνδεσμο, μπορείς να αγνοήσεις με ασφάλεια αυτό το email.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Επαλήθευσε το email σου για μια αναφορά DSA",
|
||||
"body": "Γεια σου,\n\nΧρησιμοποίησε τον παρακάτω κωδικό επαλήθευσης για να υποβάλεις την αναφορά σου για τον Νόμο περί Ψηφιακών Υπηρεσιών στο {product_name}:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} στις {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, μπορείς να αγνοήσεις αυτό το email.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"subject": "Επαλήθευσε το email σου για αναφορά DSA",
|
||||
"body": "Γεια σου,\n\nΧρησιμοποίησε τον παρακάτω κωδικό επαλήθευσης για να υποβάλεις την αναφορά σου βάσει της Πράξης για τις ψηφιακές υπηρεσίες στο {product_name}:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} και ώρα {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, μπορείς να αγνοήσεις αυτό το email.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Επαλήθευσε το νέο σου email στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΕισήγαγε αυτόν τον κωδικό στην εφαρμογή για να επαληθεύσεις το νέο σου email στο {product_name}:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} στις {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, μπορείς να αγνοήσεις αυτό το email.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΠληκτρολόγησε αυτόν τον κωδικό στην εφαρμογή για να επαληθεύσεις το νέο σου email στο {product_name}:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} και ώρα {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, μπορείς να αγνοήσεις αυτό το email.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Επιβεβαίωσε την αλλαγή email στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΛάβαμε ένα αίτημα για αλλαγή της διεύθυνσης email στον λογαριασμό σου στο {product_name}.\n\nΓια να επιβεβαιώσεις αυτήν την αλλαγή, εισήγαγε αυτόν τον κωδικό στην εφαρμογή:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} στις {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, ασφάλισε αμέσως τον λογαριασμό σου.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΛάβαμε αίτημα για αλλαγή της διεύθυνσης email στον λογαριασμό σου στο {product_name}.\n\nΓια να επιβεβαιώσεις αυτήν την αλλαγή, πληκτρολόγησε αυτόν τον κωδικό στην εφαρμογή:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} και ώρα {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, ασφάλισε αμέσως τον λογαριασμό σου.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Το email στο {product_name} άλλαξε",
|
||||
"body": "Γεια σου {username},\n\nΗ διεύθυνση email του λογαριασμού σου στο {product_name} άλλαξε σε {newEmail}.\n\nΕάν έκανες αυτήν την αλλαγή, δεν απαιτείται καμία ενέργεια. Εάν όχι, μπορείς να αναιρέσεις την αλλαγή και να ασφαλίσεις τον λογαριασμό σου χρησιμοποιώντας αυτόν τον σύνδεσμο:\n\n{revertUrl}\n\nΑυτό θα επαναφέρει το προηγούμενο email σου, θα σε αποσυνδέσει από παντού, θα αφαιρέσει τους συνδεδεμένους αριθμούς τηλεφώνου, θα απενεργοποιήσει το MFA και θα απαιτήσει να ορίσεις έναν νέο κωδικό πρόσβασης.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"subject": "Το email σου στο {product_name} άλλαξε",
|
||||
"body": "Γεια σου {username},\n\nΗ διεύθυνση email του λογαριασμού σου στο {product_name} άλλαξε σε {newEmail}.\n\nΕάν έκανες εσύ αυτήν την αλλαγή, δεν χρειάζεται να κάνεις τίποτα. Εάν όχι, μπορείς να αναιρέσεις την αλλαγή και να ασφαλίσεις τον λογαριασμό σου με αυτόν τον σύνδεσμο:\n\n{revertUrl}\n\nΑυτό θα επαναφέρει το προηγούμενο email σου, θα σε αποσυνδέσει από παντού, θα αφαιρέσει τους συνδεδεμένους αριθμούς τηλεφώνου, θα απενεργοποιήσει το MFA και θα σου ζητήσει να ορίσεις νέο κωδικό πρόσβασης.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Επαλήθευσε τη διεύθυνση email σου στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΕπαλήθευσε τη διεύθυνση email για τον λογαριασμό σου στο {product_name} κάνοντας κλικ στον παρακάτω σύνδεσμο:\n\n{verifyUrl}\n\nΕάν δεν δημιούργησες λογαριασμό στο {product_name}, μπορείς να αγνοήσεις με ασφάλεια αυτό το email.\n\nΑυτός ο σύνδεσμος ισχύει για 24 ώρες.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΕπαλήθευσε τη διεύθυνση email για τον λογαριασμό σου στο {product_name} κάνοντας κλικ στον παρακάτω σύνδεσμο:\n\n{verifyUrl}\n\nΕάν δεν δημιούργησες λογαριασμό στο {product_name}, μπορείς να αγνοήσεις με ασφάλεια αυτό το email.\n\nΑυτός ο σύνδεσμος ισχύει για 24 ώρες.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "Τα προνόμια από το δώρο που εξαργύρωσες έχουν αφαιρεθεί",
|
||||
"body": "Γεια σου {username},\n\nΈνας κωδικός δώρου που εξαργύρωσες πληρώθηκε αρχικά από κάποιον άλλο. Αυτή η πληρωμή έχει έκτοτε αντιστραφεί (αμφισβήτηση χρέωσης).\n\nΛόγω αυτού, αφαιρέσαμε τα προνόμια που προστέθηκαν στον λογαριασμό σου όταν εξαργύρωσες το δώρο.\n\nΕάν πιστεύεις ότι πρόκειται για λάθος, επικοινώνησε με την ομάδα υποστήριξής μας και συμπερίλαβε τυχόν λεπτομέρειες που έχεις σχετικά με τον κωδικό δώρου και πότε τον εξαργύρωσες.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΈνας κωδικός δώρου που εξαργύρωσες πληρώθηκε αρχικά από κάποιον άλλο. Αυτή η πληρωμή έχει έκτοτε αντιστραφεί (αμφισβήτηση χρέωσης).\n\nΓι' αυτόν τον λόγο, αφαιρέσαμε τα προνόμια που προστέθηκαν στον λογαριασμό σου όταν εξαργύρωσες το δώρο.\n\nΕάν πιστεύεις ότι πρόκειται για λάθος, επικοινώνησε με την ομάδα υποστήριξής μας και ανάφερε όσες λεπτομέρειες έχεις σχετικά με τον κωδικό δώρου και το πότε τον εξαργύρωσες.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "Η εξαγωγή δεδομένων σου στο {product_name} είναι έτοιμη για λήψη",
|
||||
"body": "Γεια σου {username},\n\nΗ εξαγωγή δεδομένων σου είναι έτοιμη.\n\nΣύνδεσμος λήψης:\n{downloadUrl}\n\nΣυμπεριλαμβανόμενα μηνύματα: {totalMessages, number}\nΜέγεθος αρχείου: {fileSizeMB, number} MB\n\nΑυτός ο σύνδεσμος λήγει στις {expiresAt, date, full} στις {expiresAt, time, short}.\n\nΕάν δεν ζήτησες αυτήν την εξαγωγή, άλλαξε αμέσως τον κωδικό πρόσβασής σου και επικοινώνησε με την ομάδα υποστήριξής μας.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΗ εξαγωγή δεδομένων σου είναι έτοιμη.\n\nΣύνδεσμος λήψης:\n{downloadUrl}\n\nΜηνύματα που περιλαμβάνονται: {totalMessages, number}\nΜέγεθος αρχείου: {fileSizeMB, number} MB\n\nΑυτός ο σύνδεσμος λήγει στις {expiresAt, date, full} και ώρα {expiresAt, time, short}.\n\nΕάν δεν ζήτησες αυτήν την εξαγωγή, άλλαξε αμέσως τον κωδικό πρόσβασής σου και επικοινώνησε με την ομάδα υποστήριξής μας.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "Ο λογαριασμός σου στο {product_name} θα διαγραφεί λόγω αδράνειας",
|
||||
"body": "Γεια σου {username},\n\nΔεν έχουμε δει καμία δραστηριότητα στον λογαριασμό σου στο {product_name} από τις {lastActiveDate, date, full}.\n\nΕάν δεν συνδεθείς μέχρι τις {deletionDate, date, full} στις {deletionDate, time, short}, ο λογαριασμός σου θα διαγραφεί οριστικά λόγω αδράνειας.\n\nΣυνδέσου εδώ:\n{loginUrl}\n\nΕάν χρησιμοποίησες το {product_name} πρόσφατα, επικοινώνησε αμέσως με την ομάδα υποστήριξής μας.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΔεν έχουμε δει καμία δραστηριότητα στον λογαριασμό σου στο {product_name} από τις {lastActiveDate, date, full}.\n\nΕάν δεν συνδεθείς μέχρι τις {deletionDate, date, full} και ώρα {deletionDate, time, short}, ο λογαριασμός σου θα διαγραφεί οριστικά λόγω αδράνειας.\n\nΣυνδέσου εδώ:\n{loginUrl}\n\nΕάν χρησιμοποίησες το {product_name} πρόσφατα, επικοινώνησε αμέσως με την ομάδα υποστήριξής μας.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Εξουσιοδότησε τη σύνδεση από μια νέα διεύθυνση IP",
|
||||
"body": "Γεια σου {username},\n\nΕντοπίσαμε μια προσπάθεια σύνδεσης στον λογαριασμό σου στο {product_name} από μια νέα διεύθυνση IP:\n\nΔιεύθυνση IP: {ipAddress}\nΤοποθεσία: {location}\n\nΕάν ήσουν εσύ, εξουσιοδότησε αυτήν τη διεύθυνση IP κάνοντας κλικ στον παρακάτω σύνδεσμο:\n\n{authUrl}\n\nΕάν δεν προσπάθησες να συνδεθείς, άλλαξε αμέσως τον κωδικό πρόσβασής σου.\n\nΑυτός ο σύνδεσμος ισχύει για 30 λεπτά.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΕντοπίσαμε μια προσπάθεια σύνδεσης στον λογαριασμό σου στο {product_name} από νέα διεύθυνση IP:\n\nΔιεύθυνση IP: {ipAddress}\nΤοποθεσία: {location}\n\nΕάν ήσουν εσύ, εξουσιοδότησε αυτήν τη διεύθυνση IP κάνοντας κλικ στον παρακάτω σύνδεσμο:\n\n{authUrl}\n\nΕάν δεν προσπάθησες να συνδεθείς, άλλαξε αμέσως τον κωδικό πρόσβασής σου.\n\nΑυτός ο σύνδεσμος ισχύει για 30 λεπτά.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Επιβεβαίωσε την πρόσβαση στους εφεδρικούς κωδικούς σου στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΛάβαμε ένα αίτημα για προβολή των εφεδρικών κωδικών στον λογαριασμό σου στο {product_name}.\n\nΓια να επιβεβαιώσεις αυτό το αίτημα, εισήγαγε αυτόν τον κωδικό στην εφαρμογή:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} στις {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, κάποιος μπορεί να έχει πρόσβαση στον λογαριασμό σου. Άλλαξε αμέσως τον κωδικό πρόσβασής σου.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΛάβαμε αίτημα για προβολή των εφεδρικών κωδικών στον λογαριασμό σου στο {product_name}.\n\nΓια να επιβεβαιώσεις αυτό το αίτημα, πληκτρολόγησε αυτόν τον κωδικό στην εφαρμογή:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt, date, full} και ώρα {expiresAt, time, short}.\n\nΕάν δεν το ζήτησες, μπορεί κάποιος να έχει πρόσβαση στον λογαριασμό σου. Άλλαξε αμέσως τον κωδικό πρόσβασής σου.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Επιβεβαίωσε την αλλαγή κωδικού πρόσβασης στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΛάβαμε ένα αίτημα για αλλαγή του κωδικού πρόσβασης στον λογαριασμό σου στο {product_name}.\n\nΓια να επιβεβαιώσεις αυτήν την αλλαγή, εισήγαγε αυτόν τον κωδικό στην εφαρμογή:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt}.\n\nΕάν δεν το ζήτησες, κάποιος μπορεί να έχει πρόσβαση στον λογαριασμό σου. Άλλαξε αμέσως τον κωδικό πρόσβασής σου και ενεργοποίησε τον έλεγχο ταυτότητας δύο παραγόντων.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΛάβαμε αίτημα για αλλαγή του κωδικού πρόσβασης στον λογαριασμό σου στο {product_name}.\n\nΓια να επιβεβαιώσεις αυτήν την αλλαγή, πληκτρολόγησε αυτόν τον κωδικό στην εφαρμογή:\n\n{code}\n\nΑυτός ο κωδικός λήγει στις {expiresAt}.\n\nΕάν δεν το ζήτησες, μπορεί κάποιος να έχει πρόσβαση στον λογαριασμό σου. Άλλαξε αμέσως τον κωδικό πρόσβασής σου και ενεργοποίησε τον έλεγχο ταυτότητας δύο παραγόντων.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Επαναφορά του κωδικού πρόσβασής σου στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΖήτησες επαναφορά κωδικού πρόσβασης του {product_name}. Χρησιμοποίησε τον παρακάτω σύνδεσμο για να ορίσεις έναν νέο κωδικό πρόσβασης:\n\n{resetUrl}\n\nΕάν δεν το ζήτησες, μπορείς να αγνοήσεις με ασφάλεια αυτό το email.\n\nΑυτός ο σύνδεσμος ισχύει για 1 ώρα.\n\n– Ομάδα {product_name}"
|
||||
"subject": "Επανάφερε τον κωδικό πρόσβασής σου στο {product_name}",
|
||||
"body": "Γεια σου {username},\n\nΖήτησες επαναφορά του κωδικού πρόσβασής σου στο {product_name}. Χρησιμοποίησε τον παρακάτω σύνδεσμο για να ορίσεις νέο κωδικό πρόσβασης:\n\n{resetUrl}\n\nΕάν δεν το ζήτησες, μπορείς να αγνοήσεις με ασφάλεια αυτό το email.\n\nΑυτός ο σύνδεσμος ισχύει για 1 ώρα.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "Η εγγραφή σου στο {product_name} έχει εγκριθεί",
|
||||
"body": "Γεια σου {username},\n\nΚαλά νέα: η εγγραφή σου στο {product_name} έχει εγκριθεί.\n\nΜπορείς τώρα να συνδεθείς στην εφαρμογή του {product_name} εδώ:\n{channelsUrl}\n\nΚαλώς ήρθες στην κοινότητα του {product_name}.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΚαλά νέα: η εγγραφή σου στο {product_name} έχει εγκριθεί.\n\nΜπορείς τώρα να συνδεθείς στην εφαρμογή του {product_name} εδώ:\n{channelsUrl}\n\nΚαλώς ήρθες στην κοινότητα του {product_name}.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Η αναφορά σου στο {product_name} έχει εξεταστεί",
|
||||
"body": "Γεια σου {username},\n\nΗ αναφορά σου (ID: {reportId}) έχει εξεταστεί από την Ομάδα Ασφαλείας μας.{hasComment, select, yes {\n\nΑπάντηση από την Ομάδα Ασφαλείας:\n{publicComment}} other {}}\n\nΕυχαριστούμε που βοηθάς να διατηρήσουμε το {product_name} ασφαλές για όλους. Λαμβάνουμε όλες τις αναφορές σοβαρά υπόψη και εκτιμούμε τη συμβολή σου στην κοινότητα.\n\nΕάν έχεις οποιεσδήποτε ερωτήσεις ή ανησυχίες σχετικά με αυτό το αποτέλεσμα, επικοινώνησε με το {safety_email}.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΗ αναφορά σου (ID: {reportId}) εξετάστηκε από την ομάδα ασφαλείας μας.{hasComment, select, yes {\n\nΑπάντηση από την ομάδα ασφαλείας:\n{publicComment}} other {}}\n\nΕυχαριστούμε που βοηθάς να παραμείνει το {product_name} ασφαλές για όλους. Λαμβάνουμε σοβαρά υπόψη κάθε αναφορά και εκτιμούμε τη συμβολή σου στην κοινότητα.\n\nΕάν έχεις ερωτήσεις ή απορίες σχετικά με αυτό το αποτέλεσμα, στείλε email στο {safety_email}.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Ο λογαριασμός σου στο {product_name} θα διαγραφεί οριστικά",
|
||||
"body": "Γεια σου {username},\n\nΟ λογαριασμός σου στο {product_name} έχει προγραμματιστεί για οριστική διαγραφή.\n\nΠρογραμματισμένη διαγραφή: {deletionDate, date, full} στις {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΠρόκειται για ένα σοβαρό μέτρο. Τα δεδομένα του λογαριασμού σου θα διαγραφούν οριστικά την προγραμματισμένη ημερομηνία.\n\nΕάν πιστεύεις ότι αυτή η απόφαση ήταν λανθασμένη, μπορείς να υποβάλεις προσφυγή. Στείλε email στο {appeals_email} από αυτήν τη διεύθυνση email.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΟ λογαριασμός σου στο {product_name} έχει προγραμματιστεί για οριστική διαγραφή.\n\nΠρογραμματισμένη διαγραφή: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΠρόκειται για σοβαρό μέτρο. Τα δεδομένα του λογαριασμού σου θα διαγραφούν οριστικά την προγραμματισμένη ημερομηνία.\n\nΕάν πιστεύεις ότι αυτή η απόφαση ήταν λανθασμένη, μπορείς να υποβάλεις προσφυγή. Στείλε email στο {appeals_email} από αυτήν τη διεύθυνση email.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "Η διαγραφή του λογαριασμού σου στο {product_name} είναι προγραμματισμένη",
|
||||
"body": "Γεια σου {username},\n\nΖήτησες τη διαγραφή του λογαριασμού σου στο {product_name}. Ο λογαριασμός σου έχει προγραμματιστεί για οριστική διαγραφή στις:\n\n{deletionDate, date, full} στις {deletionDate, time, short}\n\nΕάν δεν το ζήτησες, συνδέσου στον λογαριασμό σου για να ακυρώσεις τη διαγραφή. Σου συνιστούμε επίσης να αλλάξεις τον κωδικό πρόσβασής σου και να ασφαλίσεις τον λογαριασμό σου.\n\n– Ομάδα {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΖήτησες τη διαγραφή του λογαριασμού σου στο {product_name}. Ο λογαριασμός σου έχει προγραμματιστεί για οριστική διαγραφή:\n\n{deletionDate, date, full} και ώρα {deletionDate, time, short}\n\nΕάν δεν το ζήτησες, συνδέσου στον λογαριασμό σου για να ακυρώσεις τη διαγραφή. Σου προτείνουμε επίσης να αλλάξεις τον κωδικό πρόσβασής σου για να ασφαλίσεις τον λογαριασμό σου.\n\n– Η ομάδα του {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "Η αναστολή του λογαριασμού σου στο {product_name} έχει αρθεί",
|
||||
"body": "Γεια σου {username},\n\nΚαλά νέα: η αναστολή του λογαριασμού σου στο {product_name} έχει αρθεί.\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΜπορείς τώρα να συνδεθείς ξανά και να συνεχίσεις να χρησιμοποιείς το {product_name} κανονικά.\n\n– Ομάδα Ασφαλείας {product_name}"
|
||||
"body": "Γεια σου {username},\n\nΚαλά νέα: η αναστολή του λογαριασμού σου στο {product_name} έχει αρθεί.\n\n{reason, select,\n null {}\n other {Λόγος: {reason}}\n}\n\nΜπορείς τώρα να συνδεθείς ξανά και να συνεχίσεις να χρησιμοποιείς το {product_name} κανονικά.\n\n– Η ομάδα ασφαλείας του {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_EN_GB_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
@@ -17,7 +17,7 @@ const EMAIL_I18N_EN_GB_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Thank you for your {product_name} donation",
|
||||
"body": "Hello,\n\nThank you for your donation to {product_name}! Your {interval, select,\n month {recurring donation}\n year {recurring donation}\n other {one-time donation}\n} has been {interval, select,\n month {set up}\n year {set up}\n other {processed}\n} successfully.\n\nDonation details:\nAmount: {amount} {currency} {interval, select,\n month {per month}\n year {per year}\n other {}\n}\n\nStripe will email you a separate receipt with your invoice PDF shortly. This includes all payment details and can be used for tax purposes.\n\nYou can view your donation history, download invoices, {interval, select,\n month {and manage or cancel your subscription}\n year {and manage or cancel your subscription}\n other {and manage future donations}\n} at any time using this link:\n\n{manageUrl}\n\nYour support helps keep {product_name} running. Thank you!\n\n– {product_name} Team"
|
||||
"body": "Hello,\n\nThank you for your donation to {product_name}! Your {interval, select,\n month {recurring donation}\n year {recurring donation}\n other {one-time donation}\n} has been {interval, select,\n month {set up}\n year {set up}\n other {processed}\n} successfully.\n\nDonation details:\nAmount: {amount} {interval, select,\n month {per month}\n year {per year}\n other {}\n}\n\nStripe will email you a separate receipt with your invoice PDF shortly. This includes all payment details and can be used for tax purposes.\n\nYou can view your donation history, download invoices, {interval, select,\n month {and manage or cancel your subscription}\n year {and manage or cancel your subscription}\n other {and manage future donations}\n} at any time using this link:\n\n{manageUrl}\n\nYour support helps keep {product_name} running. Thank you!\n\n– {product_name} Team"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Manage your {product_name} donations",
|
||||
@@ -56,8 +56,8 @@ const EMAIL_I18N_EN_GB_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"body": "Hello {username},\n\nWe haven't seen any activity on your {product_name} account since {lastActiveDate, date, full}.\n\nIf you don't log in by {deletionDate, date, full} at {deletionDate, time, short}, your account will be permanently deleted due to inactivity.\n\nLog in here:\n{loginUrl}\n\nIf you've used {product_name} recently, please contact our support team right away.\n\n– {product_name} Team"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Authorize login from a new IP address",
|
||||
"body": "Hello {username},\n\nWe detected a login attempt to your {product_name} account from a new IP address:\n\nIP address: {ipAddress}\nLocation: {location}\n\nIf this was you, please authorize this IP address by clicking the link below:\n\n{authUrl}\n\nIf you didn't attempt to log in, please change your password right away.\n\nThis link is valid for 30 minutes.\n\n– {product_name} Team"
|
||||
"subject": "Authorise login from a new IP address",
|
||||
"body": "Hello {username},\n\nWe detected a login attempt to your {product_name} account from a new IP address:\n\nIP address: {ipAddress}\nLocation: {location}\n\nIf this was you, please authorise this IP address by clicking the link below:\n\n{authUrl}\n\nIf you didn't attempt to log in, please change your password right away.\n\nThis link is valid for 30 minutes.\n\n– {product_name} Team"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Confirm access to your {product_name} backup codes",
|
||||
@@ -65,7 +65,7 @@ const EMAIL_I18N_EN_GB_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Confirm your {product_name} password change",
|
||||
"body": "Hello {username},\n\nWe received a request to change the password on your {product_name} account.\n\nTo confirm this change, enter this code in the app:\n\n{code}\n\nThis code expires at {expiresAt}.\n\nIf you didn't request this, someone may have access to your account. Change your password immediately and enable two-factor authentication.\n\n– {product_name} Team"
|
||||
"body": "Hello {username},\n\nWe received a request to change the password on your {product_name} account.\n\nTo confirm this change, enter this code in the app:\n\n{code}\n\nThis code expires on {expiresAt, date, full} at {expiresAt, time, short}.\n\nIf you didn't request this, someone may have access to your account. Change your password immediately and enable two-factor authentication.\n\n– {product_name} Team"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Reset your {product_name} password",
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_ES_419_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "Tu cuenta de {product_name} ha sido deshabilitada temporalmente",
|
||||
"body": "Hola {username}:\n\nDeshabilitamos temporalmente tu cuenta de {product_name} porque detectamos actividad sospechosa.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nPara recuperar el acceso a tu cuenta, deberás restablecer tu contraseña:\n\n{forgotUrl}\n\nDespués de restablecer tu contraseña, podrás iniciar sesión de nuevo.\n\nSi crees que esto fue un error, comunícate con nuestro equipo de soporte.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nDeshabilitamos temporalmente tu cuenta de {product_name} porque detectamos actividad sospechosa.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nPara recuperar el acceso a tu cuenta, deberás restablecer tu contraseña:\n\n{forgotUrl}\n\nDespués de restablecer tu contraseña, podrás iniciar sesión de nuevo.\n\nSi crees que esto fue un error, comunícate con nuestro equipo de soporte.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Tu cuenta de {product_name} será eliminada permanentemente",
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido programada para su eliminación permanente debido a infracciones de nuestros Términos de Servicio o Normas de la Comunidad.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nPor favor, revisa:\n- Términos de Servicio: {termsUrl}\n- Normas de la Comunidad: {guidelinesUrl}\n\nProceso de apelación:\nSi crees que esta decisión fue incorrecta o injustificada, tienes 60 días para presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\nEn tu apelación:\n- Explica claramente por qué crees que la decisión fue incorrecta o injustificada\n- Proporciona cualquier evidencia o contexto relevante\n\nUn miembro del Equipo de Seguridad de {product_name} revisará tu apelación y podrá pausar la eliminación pendiente hasta que se haya tomado una decisión final.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nSe ha programado la eliminación permanente de tu cuenta de {product_name} debido a infracciones de nuestros Términos del servicio o Normas de la comunidad.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nPor favor, revisa:\n- Términos del servicio: {termsUrl}\n- Normas de la comunidad: {guidelinesUrl}\n\nProceso de apelación:\nSi crees que esta decisión fue incorrecta o injustificada, tienes 60 días para presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\nEn tu apelación:\n- Explica claramente por qué crees que la decisión fue incorrecta o injustificada\n- Aporta las pruebas o el contexto que consideres relevantes\n\nUn miembro del Equipo de seguridad de {product_name} revisará tu apelación y podrá pausar la eliminación pendiente hasta que se haya tomado una decisión final.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Tu cuenta de {product_name} ha sido suspendida temporalmente",
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido suspendida temporalmente por violar nuestros Términos de Servicio o Normas de la Comunidad.\n\nDuración: {durationHours, plural,\n =1 {1 hora}\n other {# horas}\n}\nSuspendida hasta: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nDurante este tiempo, no podrás acceder a tu cuenta.\n\nPor favor, revisa:\n- Términos de Servicio: {termsUrl}\n- Normas de la Comunidad: {guidelinesUrl}\n\nSi crees que esta decisión fue incorrecta o injustificada, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico y explica claramente por qué crees que la decisión fue incorrecta. Revisaremos tu apelación y te responderemos con nuestra decisión.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido suspendida temporalmente por infringir nuestros Términos del servicio o Normas de la comunidad.\n\nDuración: {durationHours, plural,\n =1 {1 hora}\n other {# horas}\n}\nSuspendida hasta: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nDurante este tiempo, no podrás acceder a tu cuenta.\n\nPor favor, revisa:\n- Términos del servicio: {termsUrl}\n- Normas de la comunidad: {guidelinesUrl}\n\nSi crees que esta decisión fue incorrecta o injustificada, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico y explica claramente por qué crees que la decisión fue incorrecta. Revisaremos tu apelación y te responderemos con nuestra decisión.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Gracias por tu donación a {product_name}",
|
||||
"body": "Hola:\n\n¡Gracias por tu donación a {product_name}! Tu {interval, select,\n month {donación recurrente}\n year {donación recurrente}\n other {donación única}\n} ha sido {interval, select,\n month {configurada}\n year {configurada}\n other {procesada}\n} con éxito.\n\nDetalles de la donación:\nMonto: {amount} {currency} {interval, select,\n month {por mes}\n year {por año}\n other {}\n}\n\nStripe te enviará un recibo separado con tu factura en PDF en breve. Esto incluye todos los detalles de pago y se puede utilizar para fines fiscales.\n\nPuedes ver tu historial de donaciones, descargar facturas, {interval, select,\n month {y administrar o cancelar tu suscripción}\n year {y administrar o cancelar tu suscripción}\n other {y administrar futuras donaciones}\n} en cualquier momento usando este enlace:\n\n{manageUrl}\n\nTu apoyo ayuda a mantener {product_name} en funcionamiento. ¡Gracias!\n\n– Equipo de {product_name}"
|
||||
"body": "Hola:\n\n¡Gracias por tu donación a {product_name}! Tu {interval, select,\n month {donación recurrente}\n year {donación recurrente}\n other {donación única}\n} ha sido {interval, select,\n month {configurada}\n year {configurada}\n other {procesada}\n} con éxito.\n\nDetalles de la donación:\nMonto: {amount} {interval, select,\n month {por mes}\n year {por año}\n other {}\n}\n\nEn breve, Stripe te enviará por separado un correo electrónico con el recibo y la factura en PDF. Este recibo incluye todos los detalles de pago y se puede utilizar para fines fiscales.\n\nPuedes ver tu historial de donaciones, descargar facturas {interval, select,\n month {y administrar o cancelar tu suscripción}\n year {y administrar o cancelar tu suscripción}\n other {y administrar futuras donaciones}\n} en cualquier momento usando este enlace:\n\n{manageUrl}\n\nTu apoyo ayuda a mantener {product_name} en funcionamiento. ¡Gracias!\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Administra tus donaciones a {product_name}",
|
||||
"body": "Hola:\n\nHaz clic en el siguiente enlace para acceder a tu portal de donantes:\n\n{manageUrl}\n\nEn el portal, puedes administrar suscripciones, descargar facturas y ver tu historial de donaciones.\n\nEste enlace vence el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste este enlace, puedes ignorar este correo electrónico de forma segura.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Verifica tu correo electrónico para un informe de la Ley de Servicios Digitales",
|
||||
"body": "Hola:\n\nUsa el código de verificación a continuación para enviar tu informe de la Ley de Servicios Digitales en {product_name}:\n\n{code}\n\nEste código vence el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"subject": "Verifica tu correo electrónico para enviar un reporte conforme a la Ley de Servicios Digitales",
|
||||
"body": "Hola:\n\nUsa el código de verificación a continuación para enviar tu reporte conforme a la Ley de Servicios Digitales en {product_name}:\n\n{code}\n\nEste código vence el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Verifica tu nuevo correo electrónico de {product_name}",
|
||||
"body": "Hola {username}:\n\nIngresa este código en la aplicación para verificar tu nuevo correo electrónico de {product_name}:\n\n{code}\n\nEste código vence el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de {product_name}"
|
||||
"subject": "Verifica tu nuevo correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nIngresa este código en la aplicación para verificar tu nuevo correo electrónico en {product_name}:\n\n{code}\n\nEste código vence el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Confirma tu cambio de correo electrónico de {product_name}",
|
||||
"subject": "Confirma tu cambio de correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nRecibimos una solicitud para cambiar la dirección de correo electrónico de tu cuenta de {product_name}.\n\nPara confirmar este cambio, ingresa este código en la aplicación:\n\n{code}\n\nEste código vence el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, por favor, protege tu cuenta de inmediato.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Tu correo electrónico de {product_name} fue cambiado",
|
||||
"body": "Hola {username}:\n\nLa dirección de correo electrónico de tu cuenta de {product_name} se cambió a {newEmail}.\n\nSi realizaste este cambio, no es necesario que hagas nada. Si no lo hiciste, puedes revertir el cambio y proteger tu cuenta usando este enlace:\n\n{revertUrl}\n\nEsto restaurará tu correo electrónico anterior, cerrará tu sesión en todas partes, eliminará los números de teléfono vinculados, deshabilitará la autenticación multifactor y te pedirá que establezcas una nueva contraseña.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"subject": "Se cambió tu correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nLa dirección de correo electrónico de tu cuenta de {product_name} se cambió a {newEmail}.\n\nSi realizaste este cambio, no es necesario que hagas nada. Si no lo hiciste, puedes revertir el cambio y proteger tu cuenta usando este enlace:\n\n{revertUrl}\n\nEsto restaurará tu correo electrónico anterior, cerrará tu sesión en todas partes, eliminará los números de teléfono vinculados, deshabilitará la autenticación multifactor y te pedirá que establezcas una nueva contraseña.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Verifica tu dirección de correo electrónico de {product_name}",
|
||||
"subject": "Verifica tu dirección de correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nPor favor, verifica la dirección de correo electrónico de tu cuenta de {product_name} haciendo clic en el siguiente enlace:\n\n{verifyUrl}\n\nSi no creaste una cuenta de {product_name}, puedes ignorar este correo electrónico de forma segura.\n\nEste enlace es válido por 24 horas.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
@@ -76,20 +76,20 @@ const EMAIL_I18N_ES_419_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"body": "Hola {username}:\n\nBuenas noticias: tu registro en {product_name} ha sido aprobado.\n\nAhora puedes iniciar sesión en la aplicación de {product_name} aquí:\n{channelsUrl}\n\nBienvenido a la comunidad de {product_name}.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Tu informe de {product_name} ha sido revisado",
|
||||
"body": "Hola {username}:\n\nTu informe (ID: {reportId}) ha sido revisado por nuestro Equipo de Seguridad.{hasComment, select, yes {\n\nRespuesta del Equipo de Seguridad:\n{publicComment}} other {}}\n\nGracias por ayudar a mantener {product_name} seguro para todos. Nos tomamos todos los informes en serio y agradecemos tu contribución a la comunidad.\n\nSi tienes alguna pregunta o inquietud sobre este resultado, comunícate con {safety_email}.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"subject": "Se revisó tu reporte en {product_name}",
|
||||
"body": "Hola {username}:\n\nNuestro equipo de seguridad revisó tu reporte (ID: {reportId}).{hasComment, select, yes {\n\nRespuesta del equipo de seguridad:\n{publicComment}} other {}}\n\nGracias por ayudar a mantener {product_name} seguro para todos. Nos tomamos todos los reportes en serio y agradecemos tu contribución a la comunidad.\n\nSi tienes alguna pregunta o inquietud sobre este resultado, comunícate con {safety_email}.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Tu cuenta de {product_name} será eliminada permanentemente",
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido programada para su eliminación permanente.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nSi crees que esta decisión fue incorrecta, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nSe ha programado la eliminación permanente de tu cuenta de {product_name}.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nSi crees que esta decisión fue incorrecta, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "La eliminación de tu cuenta de {product_name} está programada",
|
||||
"body": "Hola {username}:\n\nSolicitaste eliminar tu cuenta de {product_name}. Tu cuenta está programada para su eliminación permanente el:\n\n{deletionDate, date, full} a las {deletionDate, time, short}\n\nSi no solicitaste esto, inicia sesión en tu cuenta para cancelar la eliminación. También te recomendamos cambiar tu contraseña para proteger tu cuenta.\n\n– Equipo de {product_name}"
|
||||
"body": "Hola {username}:\n\nSolicitaste eliminar tu cuenta de {product_name}. La eliminación permanente de tu cuenta está programada para el:\n\n{deletionDate, date, full} a las {deletionDate, time, short}\n\nSi no solicitaste esto, inicia sesión en tu cuenta para cancelar la eliminación. También te recomendamos cambiar tu contraseña para proteger tu cuenta.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "Se levantó la suspensión de tu cuenta de {product_name}",
|
||||
"body": "Hola {username}:\n\nBuenas noticias: se levantó la suspensión de tu cuenta de {product_name}.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nAhora puedes iniciar sesión de nuevo y seguir usando {product_name} con normalidad.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nBuenas noticias: se levantó la suspensión de tu cuenta de {product_name}.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nAhora puedes iniciar sesión de nuevo y seguir usando {product_name} con normalidad.\n\n– Equipo de seguridad de {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_ES_ES_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "Tu cuenta de {product_name} ha sido deshabilitada temporalmente",
|
||||
"body": "Hola {username}:\n\nHemos deshabilitado temporalmente tu cuenta de {product_name} porque hemos detectado actividad sospechosa.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nPara recuperar el acceso a tu cuenta, tendrás que restablecer tu contraseña:\n\n{forgotUrl}\n\nDespués de restablecer tu contraseña, podrás iniciar sesión de nuevo.\n\nSi crees que esto ha sido un error, ponte en contacto con nuestro equipo de soporte.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nHemos deshabilitado temporalmente tu cuenta de {product_name} porque hemos detectado actividad sospechosa.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nPara recuperar el acceso a tu cuenta, tendrás que restablecer tu contraseña:\n\n{forgotUrl}\n\nDespués de restablecer tu contraseña, podrás iniciar sesión de nuevo.\n\nSi crees que esto ha sido un error, ponte en contacto con nuestro equipo de soporte.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Tu cuenta de {product_name} será eliminada permanentemente",
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido programada para su eliminación permanente debido a infracciones de nuestros Términos de Servicio o Directrices de la Comunidad.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nPor favor, revisa:\n- Términos de Servicio: {termsUrl}\n- Directrices de la Comunidad: {guidelinesUrl}\n\nProceso de apelación:\nSi crees que esta decisión fue incorrecta o injustificada, tienes 60 días para presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\nEn tu apelación:\n- Explica claramente por qué crees que la decisión fue incorrecta o injustificada\n- Proporciona cualquier evidencia o contexto relevante\n\nUn miembro del Equipo de Seguridad de {product_name} revisará tu apelación y podrá pausar la eliminación pendiente hasta que se haya tomado una decisión final.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nSe ha programado la eliminación permanente de tu cuenta de {product_name} debido a infracciones de nuestras Condiciones del servicio o Normas de la comunidad.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nPor favor, revisa:\n- Condiciones del servicio: {termsUrl}\n- Normas de la comunidad: {guidelinesUrl}\n\nProceso de apelación:\nSi crees que esta decisión fue incorrecta o injustificada, tienes 60 días para presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\nEn tu apelación:\n- Explica claramente por qué crees que la decisión fue incorrecta o injustificada\n- Aporta las pruebas o el contexto que consideres relevantes\n\nUn miembro del Equipo de seguridad de {product_name} revisará tu apelación y podrá pausar la eliminación pendiente hasta que se haya tomado una decisión final.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Tu cuenta de {product_name} ha sido suspendida temporalmente",
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido suspendida temporalmente por violar nuestros Términos de Servicio o Directrices de la Comunidad.\n\nDuración: {durationHours, plural,\n =1 {1 hora}\n other {# horas}\n}\nSuspendida hasta: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nDurante este tiempo, no podrás acceder a tu cuenta.\n\nPor favor, revisa:\n- Términos de Servicio: {termsUrl}\n- Directrices de la Comunidad: {guidelinesUrl}\n\nSi crees que esta decisión fue incorrecta o injustificada, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico y explica claramente por qué crees que la decisión fue incorrecta. Revisaremos tu apelación y te responderemos con nuestra decisión.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido suspendida temporalmente por infringir nuestras Condiciones del servicio o Normas de la comunidad.\n\nDuración: {durationHours, plural,\n =1 {1 hora}\n other {# horas}\n}\nSuspendida hasta: {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nDurante este tiempo, no podrás acceder a tu cuenta.\n\nPor favor, revisa:\n- Condiciones del servicio: {termsUrl}\n- Normas de la comunidad: {guidelinesUrl}\n\nSi crees que esta decisión fue incorrecta o injustificada, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico y explica claramente por qué crees que la decisión fue incorrecta. Revisaremos tu apelación y te responderemos con nuestra decisión.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Gracias por tu donación a {product_name}",
|
||||
"body": "Hola:\n\n¡Gracias por tu donación a {product_name}! Tu {interval, select,\n month {donación recurrente}\n year {donación recurrente}\n other {donación única}\n} se ha {interval, select,\n month {configurado}\n year {configurado}\n other {procesado}\n} correctamente.\n\nDetalles de la donación:\nCantidad: {amount} {currency} {interval, select,\n month {al mes}\n year {al año}\n other {}\n}\n\nStripe te enviará un recibo separado con tu factura en PDF en breve. Este recibo incluye todos los detalles de pago y se puede utilizar para fines fiscales.\n\nPuedes ver tu historial de donaciones, descargar facturas {interval, select,\n month {y gestionar o cancelar tu suscripción}\n year {y gestionar o cancelar tu suscripción}\n other {y gestionar futuras donaciones}\n} en cualquier momento usando este enlace:\n\n{manageUrl}\n\nTu apoyo ayuda a mantener {product_name} en funcionamiento. ¡Gracias!\n\n– Equipo de {product_name}"
|
||||
"body": "Hola:\n\n¡Gracias por tu donación a {product_name}! Tu {interval, select,\n month {donación recurrente}\n year {donación recurrente}\n other {donación única}\n} se ha {interval, select,\n month {configurado}\n year {configurado}\n other {procesado}\n} correctamente.\n\nDetalles de la donación:\nImporte: {amount} {interval, select,\n month {al mes}\n year {al año}\n other {}\n}\n\nEn breve, Stripe te enviará por separado un correo electrónico con el recibo y la factura en PDF. Este recibo incluye todos los detalles de pago y se puede utilizar para fines fiscales.\n\nPuedes ver tu historial de donaciones, descargar facturas {interval, select,\n month {y gestionar o cancelar tu suscripción}\n year {y gestionar o cancelar tu suscripción}\n other {y gestionar futuras donaciones}\n} en cualquier momento usando este enlace:\n\n{manageUrl}\n\nTu apoyo ayuda a mantener {product_name} en funcionamiento. ¡Gracias!\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Gestiona tus donaciones de {product_name}",
|
||||
"subject": "Gestiona tus donaciones a {product_name}",
|
||||
"body": "Hola:\n\nHaz clic en el siguiente enlace para acceder a tu portal de donantes:\n\n{manageUrl}\n\nEn el portal, puedes gestionar suscripciones, descargar facturas y ver tu historial de donaciones.\n\nEste enlace caduca el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste este enlace, puedes ignorar este correo electrónico de forma segura.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Verifica tu correo electrónico para un informe de la DSA",
|
||||
"body": "Hola:\n\nUsa el siguiente código de verificación para enviar tu informe de la Ley de Servicios Digitales en {product_name}:\n\n{code}\n\nEste código caduca el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"subject": "Verifica tu correo electrónico para enviar una denuncia conforme a la Ley de Servicios Digitales",
|
||||
"body": "Hola:\n\nUsa el siguiente código de verificación para enviar tu denuncia conforme a la Ley de Servicios Digitales en {product_name}:\n\n{code}\n\nEste código caduca el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Verifica tu nuevo correo electrónico para {product_name}",
|
||||
"body": "Hola {username}:\n\nIntroduce este código en la aplicación para verificar tu nuevo correo electrónico para {product_name}:\n\n{code}\n\nEste código caduca el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de {product_name}"
|
||||
"subject": "Verifica tu nuevo correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nIntroduce este código en la aplicación para verificar tu nuevo correo electrónico en {product_name}:\n\n{code}\n\nEste código caduca el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, puedes ignorar este correo electrónico.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Confirma tu cambio de correo electrónico para {product_name}",
|
||||
"subject": "Confirma tu cambio de correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nHemos recibido una solicitud para cambiar la dirección de correo electrónico de tu cuenta de {product_name}.\n\nPara confirmar este cambio, introduce este código en la aplicación:\n\n{code}\n\nEste código caduca el {expiresAt, date, full} a las {expiresAt, time, short}.\n\nSi no solicitaste esto, protege tu cuenta de inmediato.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Tu correo electrónico para {product_name} ha sido cambiado",
|
||||
"body": "Hola {username}:\n\nLa dirección de correo electrónico de tu cuenta de {product_name} ha sido cambiada a {newEmail}.\n\nSi realizaste este cambio, no es necesario que hagas nada. Si no lo hiciste, puedes revertir el cambio y proteger tu cuenta usando este enlace:\n\n{revertUrl}\n\nEsto restaurará tu correo electrónico anterior, cerrará tu sesión en todas partes, eliminará los números de teléfono vinculados, deshabilitará la autenticación multifactor y te pedirá que establezcas una nueva contraseña.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"subject": "Se ha cambiado tu correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nLa dirección de correo electrónico de tu cuenta de {product_name} ha sido cambiada a {newEmail}.\n\nSi realizaste este cambio, no es necesario que hagas nada. Si no lo hiciste, puedes revertir el cambio y proteger tu cuenta usando este enlace:\n\n{revertUrl}\n\nEsto restaurará tu correo electrónico anterior, cerrará tu sesión en todas partes, eliminará los números de teléfono vinculados, deshabilitará la autenticación multifactor y te pedirá que establezcas una nueva contraseña.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Verifica tu dirección de correo electrónico para {product_name}",
|
||||
"subject": "Verifica tu dirección de correo electrónico en {product_name}",
|
||||
"body": "Hola {username}:\n\nVerifica la dirección de correo electrónico de tu cuenta de {product_name} haciendo clic en el siguiente enlace:\n\n{verifyUrl}\n\nSi no creaste una cuenta de {product_name}, puedes ignorar este correo electrónico.\n\nEste enlace es válido durante 24 horas.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
@@ -56,8 +56,8 @@ const EMAIL_I18N_ES_ES_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"body": "Hola {username}:\n\nNo hemos visto ninguna actividad en tu cuenta de {product_name} desde el {lastActiveDate, date, full}.\n\nSi no inicias sesión antes del {deletionDate, date, full} a las {deletionDate, time, short}, tu cuenta será eliminada permanentemente debido a la inactividad.\n\nInicia sesión aquí:\n{loginUrl}\n\nSi has usado {product_name} recientemente, ponte en contacto con nuestro equipo de soporte de inmediato.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Autorizar inicio de sesión desde una nueva dirección IP",
|
||||
"body": "Hola {username}:\n\nHemos detectado un intento de inicio de sesión en tu cuenta de {product_name} desde una nueva IP:\n\nDirección IP: {ipAddress}\nUbicación: {location}\n\nSi fuiste tú, autoriza esta dirección IP haciendo clic en el siguiente enlace:\n\n{authUrl}\n\nSi no intentaste iniciar sesión, cambia tu contraseña de inmediato.\n\nEste enlace es válido durante 30 minutos.\n\n– Equipo de {product_name}"
|
||||
"subject": "Autoriza el inicio de sesión desde una nueva dirección IP",
|
||||
"body": "Hola {username}:\n\nHemos detectado un intento de inicio de sesión en tu cuenta de {product_name} desde una nueva dirección IP:\n\nDirección IP: {ipAddress}\nUbicación: {location}\n\nSi fuiste tú, autoriza esta dirección IP haciendo clic en el siguiente enlace:\n\n{authUrl}\n\nSi no intentaste iniciar sesión, cambia tu contraseña de inmediato.\n\nEste enlace es válido durante 30 minutos.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Confirma el acceso a tus códigos de respaldo de {product_name}",
|
||||
@@ -76,20 +76,20 @@ const EMAIL_I18N_ES_ES_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"body": "Hola {username}:\n\nBuenas noticias: tu registro en {product_name} ha sido aprobado.\n\nAhora puedes iniciar sesión en la aplicación de {product_name} aquí:\n{channelsUrl}\n\nBienvenido a la comunidad de {product_name}.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Tu informe en {product_name} ha sido revisado",
|
||||
"body": "Hola {username}:\n\nTu informe (ID: {reportId}) ha sido revisado por nuestro Equipo de Seguridad.{hasComment, select, yes {\n\nRespuesta del Equipo de Seguridad:\n{publicComment}} other {}}\n\nGracias por ayudarnos a mantener {product_name} seguro para todos. Nos tomamos todos los informes en serio y agradecemos tu contribución a la comunidad.\n\nSi tienes alguna pregunta o inquietud sobre este resultado, ponte en contacto con {safety_email}.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"subject": "Se ha revisado tu denuncia en {product_name}",
|
||||
"body": "Hola {username}:\n\nNuestro equipo de seguridad ha revisado tu denuncia (ID: {reportId}).{hasComment, select, yes {\n\nRespuesta del equipo de seguridad:\n{publicComment}} other {}}\n\nGracias por ayudarnos a mantener {product_name} seguro para todos. Nos tomamos todas las denuncias en serio y agradecemos tu contribución a la comunidad.\n\nSi tienes alguna pregunta o inquietud sobre este resultado, ponte en contacto con {safety_email}.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Tu cuenta de {product_name} será eliminada permanentemente",
|
||||
"body": "Hola {username}:\n\nTu cuenta de {product_name} ha sido programada para su eliminación permanente.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nSi crees que esta decisión fue incorrecta, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nSe ha programado la eliminación permanente de tu cuenta de {product_name}.\n\nEliminación programada: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nEsta es una medida grave. Los datos de tu cuenta se eliminarán permanentemente en la fecha programada.\n\nSi crees que esta decisión fue incorrecta, puedes presentar una apelación. Envía un correo electrónico a {appeals_email} desde esta dirección de correo electrónico.\n\n– Equipo de seguridad de {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "La eliminación de tu cuenta de {product_name} está programada",
|
||||
"body": "Hola {username}:\n\nSolicitaste eliminar tu cuenta de {product_name}. Tu cuenta está programada para su eliminación permanente el:\n\n{deletionDate, date, full} a las {deletionDate, time, short}\n\nSi no solicitaste esto, inicia sesión en tu cuenta para cancelar la eliminación. También te recomendamos cambiar tu contraseña para proteger tu cuenta.\n\n– Equipo de {product_name}"
|
||||
"body": "Hola {username}:\n\nSolicitaste eliminar tu cuenta de {product_name}. La eliminación permanente de tu cuenta está programada para el:\n\n{deletionDate, date, full} a las {deletionDate, time, short}\n\nSi no solicitaste esto, inicia sesión en tu cuenta para cancelar la eliminación. También te recomendamos cambiar tu contraseña para proteger tu cuenta.\n\n– Equipo de {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "Se ha levantado la suspensión de tu cuenta de {product_name}",
|
||||
"body": "Hola {username}:\n\nBuenas noticias: se ha levantado la suspensión de tu cuenta de {product_name}.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nAhora puedes volver a iniciar sesión y seguir usando {product_name} con normalidad.\n\n– Equipo de Seguridad de {product_name}"
|
||||
"body": "Hola {username}:\n\nBuenas noticias: se ha levantado la suspensión de tu cuenta de {product_name}.\n\n{reason, select,\n null {}\n other {Motivo: {reason}}\n}\n\nAhora puedes volver a iniciar sesión y seguir usando {product_name} con normalidad.\n\n– Equipo de seguridad de {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_FI_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
@@ -9,23 +9,23 @@ const EMAIL_I18N_FI_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Käyttäjätilisi {product_name}-palvelussa poistetaan pysyvästi",
|
||||
"body": "Hei {username},\n\n{product_name}-käyttäjätilisi on ajoitettu poistettavaksi pysyvästi käyttöehtojemme tai yhteisön sääntöjemme rikkomusten vuoksi.\n\nAjoitettu poisto: {deletionDate, date, full} klo {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Syy: {reason}}\n}\n\nTämä on vakava toimenpide. Tilisi tiedot poistetaan pysyvästi ajoitettuna päivänä.\n\nTarkista:\n- Käyttöehdot: {termsUrl}\n- Yhteisön säännöt: {guidelinesUrl}\n\nValitusprosessi:\nJos uskot, että tämä päätös oli virheellinen tai perusteeton, sinulla on 60 päivää aikaa tehdä valitus. Lähetä sähköpostia osoitteeseen {appeals_email} tästä sähköpostiosoitteesta.\n\nValituksessasi:\n- Selitä selkeästi, miksi uskot päätöksen olleen virheellinen tai perusteeton\n- Anna kaikki asiaankuuluvat todisteet tai konteksti\n\n{product_name}-turvallisuustiimin jäsen tarkistaa valituksesi ja voi keskeyttää vireillä olevan poiston, kunnes lopullinen päätös on tehty.\n\n– {product_name}-turvallisuustiimi"
|
||||
"body": "Hei {username},\n\n{product_name}-käyttäjätilisi on ajoitettu poistettavaksi pysyvästi käyttöehtojemme tai yhteisösääntöjemme rikkomisen vuoksi.\n\nAjoitettu poisto: {deletionDate, date, full} klo {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Syy: {reason}}\n}\n\nTämä on vakava toimenpide. Tilisi tiedot poistetaan pysyvästi ajoitettuna päivänä.\n\nTutustu:\n- Käyttöehdot: {termsUrl}\n- Yhteisön säännöt: {guidelinesUrl}\n\nValitusprosessi:\nJos uskot, että tämä päätös oli virheellinen tai perusteeton, sinulla on 60 päivää aikaa tehdä valitus. Lähetä sähköpostia osoitteeseen {appeals_email} tästä sähköpostiosoitteesta.\n\nValituksessasi:\n- Selitä selkeästi, miksi uskot päätöksen olleen virheellinen tai perusteeton\n- Liitä mukaan asiaankuuluvat todisteet tai taustatiedot\n\n{product_name}-turvallisuustiimin jäsen käsittelee valituksesi ja voi keskeyttää vireillä olevan poiston, kunnes lopullinen päätös on tehty.\n\n– {product_name}-turvallisuustiimi"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Käyttäjätilisi {product_name}-palvelussa on tilapäisesti jäädytetty",
|
||||
"body": "Hei {username},\n\n{product_name}-käyttäjätilisi on jäädytetty tilapäisesti käyttöehtojemme tai yhteisön sääntöjemme rikkomisen vuoksi.\n\nKesto: {durationHours, plural,\n =1 {1 tunti}\n other {# tuntia}\n}\nJäädytettynä {bannedUntil, date, full} klo {bannedUntil, time, short} asti\n\n{reason, select,\n null {}\n other {Syy: {reason}}\n}\n\nTänä aikana et voi käyttää tiliäsi.\n\nTarkista:\n- Käyttöehdot: {termsUrl}\n- Yhteisön säännöt: {guidelinesUrl}\n\nJos uskot, että tämä päätös oli virheellinen tai perusteeton, voit tehdä valituksen. Lähetä sähköpostia osoitteeseen {appeals_email} tästä sähköpostiosoitteesta ja selitä selkeästi, miksi uskot päätöksen olleen virheellinen. Tarkistamme valituksesi ja vastaamme päätöksellämme.\n\n– {product_name}-turvallisuustiimi"
|
||||
"body": "Hei {username},\n\n{product_name}-käyttäjätilisi on jäädytetty tilapäisesti käyttöehtojemme tai yhteisösääntöjemme rikkomisen vuoksi.\n\nKesto: {durationHours, plural,\n =1 {1 tunti}\n other {# tuntia}\n}\nJäädytettynä {bannedUntil, date, full} klo {bannedUntil, time, short} asti\n\n{reason, select,\n null {}\n other {Syy: {reason}}\n}\n\nTänä aikana et voi käyttää tiliäsi.\n\nTutustu:\n- Käyttöehdot: {termsUrl}\n- Yhteisön säännöt: {guidelinesUrl}\n\nJos uskot, että tämä päätös oli virheellinen tai perusteeton, voit tehdä valituksen. Lähetä sähköpostia osoitteeseen {appeals_email} tästä sähköpostiosoitteesta ja selitä selkeästi, miksi uskot päätöksen olleen virheellinen. Käsittelemme valituksesi ja ilmoitamme sinulle päätöksemme.\n\n– {product_name}-turvallisuustiimi"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Kiitos {product_name}-lahjoituksestasi",
|
||||
"body": "Hei,\n\nKiitos {product_name}-lahjoituksestasi! {interval, select,\n month {Toistuva lahjoituksesi}\n year {Toistuva lahjoituksesi}\n other {Kertalahjoituksesi}\n} on {interval, select,\n month {asetettu}\n year {asetettu}\n other {käsitelty}\n} onnistuneesti.\n\nLahjoituksen tiedot:\nSumma: {amount} {currency} {interval, select,\n month {kuukaudessa}\n year {vuodessa}\n other {}\n}\n\nStripe lähettää sinulle erillisen kuitin PDF-laskun kanssa pian. Tämä sisältää kaikki maksutiedot ja sitä voidaan käyttää verotuksessa.\n\nVoit tarkastella lahjoitushistoriaasi, ladata laskuja {interval, select,\n month {ja hallinnoida tai peruuttaa tilaustasi}\n year {ja hallinnoida tai peruuttaa tilaustasi}\n other {ja hallita tulevia lahjoituksia}\n} milloin tahansa käyttämällä tätä linkkiä:\n\n{manageUrl}\n\nTukesi auttaa pitämään {product_name}-palvelun toiminnassa. Kiitos!\n\n– {product_name}-tiimi"
|
||||
"body": "Hei,\n\nKiitos {product_name}-lahjoituksestasi! {interval, select,\n month {Toistuva lahjoituksesi}\n year {Toistuva lahjoituksesi}\n other {Kertalahjoituksesi}\n} on {interval, select,\n month {käynnistetty}\n year {käynnistetty}\n other {käsitelty}\n} onnistuneesti.\n\nLahjoituksen tiedot:\nSumma: {amount} {interval, select,\n month {kuukaudessa}\n year {vuodessa}\n other {}\n}\n\nStripe lähettää sinulle pian sähköpostitse erillisen kuitin sekä PDF-laskun. Niissä ovat kaikki maksutiedot, ja niitä voi käyttää verotuksessa.\n\nVoit tarkastella lahjoitushistoriaasi, ladata laskuja {interval, select,\n month {ja hallinnoida tai peruuttaa tilaustasi}\n year {ja hallinnoida tai peruuttaa tilaustasi}\n other {ja hallita tulevia lahjoituksia}\n} milloin tahansa käyttämällä tätä linkkiä:\n\n{manageUrl}\n\nTukesi auttaa pitämään {product_name}-palvelun toiminnassa. Kiitos!\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Hallinnoi {product_name}-palvelun lahjoituksiasi",
|
||||
"subject": "Hallitse {product_name}-lahjoituksiasi",
|
||||
"body": "Hei,\n\nNapsauta alla olevaa linkkiä päästäksesi lahjoittajaportaaliisi:\n\n{manageUrl}\n\nPortaalissa voit hallinnoida tilauksia, ladata laskuja ja tarkastella lahjoitushistoriaasi.\n\nTämä linkki vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä linkkiä, voit jättää tämän sähköpostin turvallisesti huomiotta.\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Vahvista sähköpostiosoite DSA-raporttia varten",
|
||||
"body": "Hei,\n\nKäytä alla olevaa vahvistuskoodia lähettääksesi DSA-raporttisi {product_name}-palveluun:\n\n{code}\n\nTämä koodi vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä, voit jättää tämän sähköpostin huomiotta.\n\n– {product_name}-turvallisuustiimi"
|
||||
"subject": "Vahvista sähköpostiosoitteesi DSA-ilmoitusta varten",
|
||||
"body": "Hei,\n\nKäytä alla olevaa vahvistuskoodia lähettääksesi digipalvelusäädöksen mukaisen ilmoituksen {product_name}-palveluun:\n\n{code}\n\nTämä koodi vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä, voit jättää tämän sähköpostin huomiotta.\n\n– {product_name}-turvallisuustiimi"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Vahvista uusi sähköpostiosoitteesi {product_name}-tilillä",
|
||||
@@ -33,7 +33,7 @@ const EMAIL_I18N_FI_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Vahvista sähköpostiosoitteen muutos {product_name}-tilillä",
|
||||
"body": "Hei {username},\n\nSaimme pyynnön muuttaa sähköpostiosoitetta {product_name}-tililläsi.\n\nVahvistaaksesi tämän muutoksen, syötä tämä koodi sovellukseen:\n\n{code}\n\nTämä koodi vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä, turvaa tilisi välittömästi.\n\n– {product_name}-tiimi"
|
||||
"body": "Hei {username},\n\nSaimme pyynnön muuttaa sähköpostiosoitetta {product_name}-tililläsi.\n\nSyötä tämä koodi sovellukseen vahvistaaksesi muutoksen:\n\n{code}\n\nTämä koodi vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä, turvaa tilisi välittömästi.\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "{product_name}-tilisi sähköpostiosoite on vaihdettu",
|
||||
@@ -57,15 +57,15 @@ const EMAIL_I18N_FI_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Hyväksy kirjautuminen uudesta IP-osoitteesta",
|
||||
"body": "Hei {username},\n\nHavaitsimme kirjautumisyrityksen {product_name}-tilillesi uudesta IP-osoitteesta:\n\nIP-osoite: {ipAddress}\nSijainti: {location}\n\nJos tämä olit sinä, valtuuta tämä IP-osoite napsauttamalla alla olevaa linkkiä:\n\n{authUrl}\n\nJos et yrittänyt kirjautua sisään, vaihda salasanasi välittömästi.\n\nTämä linkki on voimassa 30 minuuttia.\n\n– {product_name}-tiimi"
|
||||
"body": "Hei {username},\n\nHavaitsimme kirjautumisyrityksen {product_name}-tilillesi uudesta IP-osoitteesta:\n\nIP-osoite: {ipAddress}\nSijainti: {location}\n\nJos yritit kirjautua sisään, hyväksy tämä IP-osoite napsauttamalla alla olevaa linkkiä:\n\n{authUrl}\n\nJos et yrittänyt kirjautua sisään, vaihda salasanasi välittömästi.\n\nTämä linkki on voimassa 30 minuuttia.\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Vahvista pääsy {product_name}-tilisi varmuuskoodeihin",
|
||||
"body": "Hei {username},\n\nSaimme pyynnön tarkastella varmuuskoodeja {product_name}-tililläsi.\n\nVahvistaaksesi tämän pyynnön, syötä tämä koodi sovellukseen:\n\n{code}\n\nTämä koodi vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä, joku saattaa päästä tilillesi. Vaihda salasanasi välittömästi.\n\n– {product_name}-tiimi"
|
||||
"subject": "Vahvista pääsy {product_name}-tilisi varakoodeihin",
|
||||
"body": "Hei {username},\n\nSaimme pyynnön tarkastella varakoodeja {product_name}-tililläsi.\n\nSyötä tämä koodi sovellukseen vahvistaaksesi pyynnön:\n\n{code}\n\nTämä koodi vanhenee {expiresAt, date, full} klo {expiresAt, time, short}.\n\nJos et pyytänyt tätä, joku saattaa päästä tilillesi. Vaihda salasanasi välittömästi.\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Vahvista salasanan muutos {product_name}-tilillä",
|
||||
"body": "Hei {username},\n\nSaimme pyynnön muuttaa salasanaa {product_name}-tililläsi.\n\nVahvistaaksesi tämän muutoksen, syötä tämä koodi sovellukseen:\n\n{code}\n\nTämä koodi vanhenee {expiresAt}.\n\nJos et pyytänyt tätä, joku saattaa päästä tilillesi. Vaihda salasanasi välittömästi ja ota käyttöön kaksivaiheinen todennus.\n\n– {product_name}-tiimi"
|
||||
"body": "Hei {username},\n\nSaimme pyynnön muuttaa salasanaa {product_name}-tililläsi.\n\nSyötä tämä koodi sovellukseen vahvistaaksesi muutoksen:\n\n{code}\n\nTämä koodi vanhenee {expiresAt}.\n\nJos et pyytänyt tätä, joku saattaa päästä tilillesi. Vaihda salasanasi välittömästi ja ota käyttöön kaksivaiheinen todennus.\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Nollaa {product_name}-salasanasi",
|
||||
@@ -76,8 +76,8 @@ const EMAIL_I18N_FI_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"body": "Hei {username},\n\nHyviä uutisia: {product_name}-rekisteröitymisesi on hyväksytty.\n\nVoit nyt kirjautua {product_name}-sovellukseen täältä:\n{channelsUrl}\n\nTervetuloa {product_name}-yhteisöön.\n\n– {product_name}-tiimi"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "{product_name}-raporttisi on tarkistettu",
|
||||
"body": "Hei {username},\n\nTurvallisuustiimimme on tarkistanut raporttisi (ID: {reportId}).{hasComment, select, yes {\n\nTurvallisuustiimin vastaus:\n{publicComment}} other {}}\n\nKiitos, että autat pitämään {product_name}-palvelun turvallisena kaikille. Otamme kaikki raportit vakavasti ja arvostamme panostasi yhteisöön.\n\nJos sinulla on kysyttävää tai huolenaiheita tästä tuloksesta, ota yhteyttä osoitteeseen {safety_email}.\n\n– {product_name}-turvallisuustiimi"
|
||||
"subject": "{product_name}-ilmoituksesi on käsitelty",
|
||||
"body": "Hei {username},\n\nTurvallisuustiimimme on käsitellyt ilmoituksesi (ID: {reportId}).{hasComment, select, yes {\n\nTurvallisuustiimin vastaus:\n{publicComment}} other {}}\n\nKiitos, että autat pitämään {product_name}-palvelun turvallisena kaikille. Otamme kaikki ilmoitukset vakavasti ja arvostamme panostasi yhteisöön.\n\nJos sinulla on kysyttävää tai huolenaiheita tästä päätöksestä, ota yhteyttä osoitteeseen {safety_email}.\n\n– {product_name}-turvallisuustiimi"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Käyttäjätilisi {product_name}-palvelussa poistetaan pysyvästi",
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_FR_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "Ton compte {product_name} a été temporairement désactivé",
|
||||
"body": "Bonjour {username},\n\nNous avons temporairement désactivé ton compte {product_name} car nous avons détecté une activité suspecte.\n\n{reason, select,\n null {}\n other {Raison : {reason}}\n}\n\nPour retrouver l'accès à ton compte, tu devras réinitialiser ton mot de passe :\n\n{forgotUrl}\n\nAprès avoir réinitialisé ton mot de passe, tu pourras te connecter à nouveau.\n\nSi tu penses qu'il s'agit d'une erreur, contacte notre équipe d'assistance.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Votre compte {product_name} a été temporairement désactivé",
|
||||
"body": "Bonjour {username},\n\nNous avons temporairement désactivé votre compte {product_name} après avoir détecté une activité suspecte.\n\n{reason, select, null {} other {Motif : {reason}}}\n\nPour retrouver l’accès à votre compte, réinitialisez votre mot de passe :\n\n{forgotUrl}\n\nVous pourrez ensuite vous connecter à nouveau.\n\nSi vous pensez qu’il s’agit d’une erreur, contactez notre équipe d’assistance.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "Ton compte {product_name} sera définitivement supprimé",
|
||||
"body": "Bonjour {username},\n\nLa suppression définitive de ton compte {product_name} a été programmée en raison de violations de nos Conditions d'utilisation ou de nos Règles de la communauté.\n\nSuppression programmée : {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Raison : {reason}}\n}\n\nIl s'agit d'une mesure sérieuse. Les données de ton compte seront définitivement supprimées à la date prévue.\n\nConsulte :\n- Conditions d'utilisation : {termsUrl}\n- Règles de la communauté : {guidelinesUrl}\n\nProcédure d'appel :\nSi tu penses que cette décision était incorrecte ou injustifiée, tu as 60 jours pour soumettre un appel. Envoie un e-mail à {appeals_email} depuis cette adresse e-mail.\n\nDans ton appel :\n- Explique clairement pourquoi tu penses que la décision était incorrecte ou injustifiée\n- Fournis toute preuve ou contexte pertinent\n\nUn membre de l'équipe de sécurité de {product_name} examinera ton appel et pourra suspendre la suppression en attente jusqu'à ce qu'une décision finale soit prise.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Votre compte {product_name} sera définitivement supprimé",
|
||||
"body": "Bonjour {username},\n\nLa suppression définitive de votre compte {product_name} a été programmée en raison de violations de nos conditions d’utilisation ou des règles de la communauté.\n\nSuppression prévue : {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select, null {} other {Motif : {reason}}}\n\nIl s’agit d’une sanction importante. Les données de votre compte seront définitivement supprimées à la date prévue.\n\nVeuillez consulter :\n- Conditions d’utilisation : {termsUrl}\n- Règles de la communauté : {guidelinesUrl}\n\nProcédure de recours :\nSi vous estimez que cette décision est incorrecte ou injustifiée, vous disposez de 60 jours pour déposer un recours. Écrivez à {appeals_email} depuis cette adresse e-mail.\n\nDans votre recours :\n- Expliquez clairement pourquoi vous estimez la décision incorrecte ou injustifiée\n- Fournissez tout élément de preuve ou de contexte pertinent\n\nUn membre de l’équipe de sécurité de {product_name} examinera votre recours et pourra suspendre la suppression prévue jusqu’à la décision finale.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "Ton compte {product_name} a été temporairement suspendu",
|
||||
"body": "Bonjour {username},\n\nTon compte {product_name} a été temporairement suspendu pour avoir enfreint nos Conditions d'utilisation ou nos Règles de la communauté.\n\nDurée : {durationHours, plural,\n =1 {1 heure}\n other {# heures}\n}\nSuspendu jusqu'au : {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {Raison : {reason}}\n}\n\nPendant cette période, tu ne pourras pas accéder à ton compte.\n\nConsulte :\n- Conditions d'utilisation : {termsUrl}\n- Règles de la communauté : {guidelinesUrl}\n\nSi tu penses que cette décision était incorrecte ou injustifiée, tu peux faire appel. Envoie un e-mail à {appeals_email} depuis cette adresse e-mail et explique clairement pourquoi tu penses que la décision était incorrecte. Nous examinerons ton appel et te répondrons avec notre décision.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Votre compte {product_name} a été temporairement suspendu",
|
||||
"body": "Bonjour {username},\n\nVotre compte {product_name} a été temporairement suspendu pour violation de nos conditions d’utilisation ou des règles de la communauté.\n\nDurée : {durationHours, plural, =1 {1 heure} other {# heures}}\nSuspension jusqu’au : {bannedUntil, date, full} {bannedUntil, time, short}\n\n{reason, select, null {} other {Motif : {reason}}}\n\nVous ne pourrez pas accéder à votre compte pendant cette période.\n\nVeuillez consulter :\n- Conditions d’utilisation : {termsUrl}\n- Règles de la communauté : {guidelinesUrl}\n\nSi vous estimez que cette décision est incorrecte ou injustifiée, vous pouvez déposer un recours. Écrivez à {appeals_email} depuis cette adresse e-mail et expliquez clairement pourquoi vous contestez cette décision. Nous examinerons votre recours et vous communiquerons notre décision.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "Merci pour ton don à {product_name}",
|
||||
"body": "Bonjour,\n\nMerci pour ton don à {product_name} ! Ton {interval, select,\n month {don récurrent}\n year {don récurrent}\n other {don unique}\n} a été {interval, select,\n month {mis en place}\n year {mis en place}\n other {traité}\n} avec succès.\n\nDétails du don :\nMontant : {amount} {currency} {interval, select,\n month {par mois}\n year {par an}\n other {}\n}\n\nStripe t'enverra sous peu un reçu séparé avec ta facture PDF. Cela inclut tous les détails de paiement et peut être utilisé à des fins fiscales.\n\nTu peux consulter l'historique de tes dons, télécharger des factures, {interval, select,\n month {et gérer ou annuler ton abonnement}\n year {et gérer ou annuler ton abonnement}\n other {et gérer les futurs dons}\n} à tout moment en utilisant ce lien :\n\n{manageUrl}\n\nTon soutien aide à maintenir {product_name} en fonctionnement. Merci !\n\n– L'équipe {product_name}"
|
||||
"subject": "Merci pour votre don à {product_name}",
|
||||
"body": "Bonjour,\n\nMerci pour votre don à {product_name} ! {interval, select, month {Votre don récurrent a bien été mis en place.} year {Votre don récurrent a bien été mis en place.} other {Votre don ponctuel a bien été traité.}}\n\nDétails du don :\nMontant : {amount} {interval, select, month {par mois} year {par an} other {}}\n\nStripe vous enverra bientôt un reçu séparé accompagné de votre facture PDF. Ce document contient tous les détails du paiement et peut servir de justificatif fiscal.\n\nVous pouvez consulter l’historique de vos dons, télécharger des factures {interval, select, month {et gérer ou résilier votre abonnement} year {et gérer ou résilier votre abonnement} other {et gérer vos futurs dons}} à tout moment avec ce lien :\n\n{manageUrl}\n\nVotre soutien contribue au fonctionnement de {product_name}. Merci !\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "Gérer tes dons {product_name}",
|
||||
"body": "Bonjour,\n\nClique sur le lien ci-dessous pour accéder à ton portail de donateur :\n\n{manageUrl}\n\nDans le portail, tu peux gérer tes abonnements, télécharger des factures et consulter l'historique de tes dons.\n\nCe lien expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi tu n'as pas demandé ce lien, tu peux ignorer cet e-mail en toute sécurité.\n\n– L'équipe {product_name}"
|
||||
"subject": "Gérer vos dons à {product_name}",
|
||||
"body": "Bonjour,\n\nCliquez sur le lien ci-dessous pour accéder à votre portail de donateur :\n\n{manageUrl}\n\nVous pouvez y gérer vos abonnements, télécharger des factures et consulter l’historique de vos dons.\n\nCe lien expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi vous n’avez pas demandé ce lien, vous pouvez ignorer cet e-mail.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "Vérifie ton e-mail pour un signalement DSA",
|
||||
"body": "Bonjour,\n\nUtilise le code de vérification ci-dessous pour soumettre ton signalement DSA sur {product_name} :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi tu n'as pas demandé cela, tu peux ignorer cet e-mail.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Vérifiez votre e-mail pour un signalement DSA",
|
||||
"body": "Bonjour,\n\nUtilisez le code ci-dessous pour envoyer votre signalement au titre du règlement sur les services numériques (DSA) sur {product_name} :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi vous n’êtes pas à l’origine de cette demande, vous pouvez ignorer cet e-mail.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "Vérifie ta nouvelle adresse e-mail {product_name}",
|
||||
"body": "Bonjour {username},\n\nSaisis ce code dans l'application pour vérifier ta nouvelle adresse e-mail {product_name} :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi tu n'as pas demandé cela, tu peux ignorer cet e-mail.\n\n– L'équipe {product_name}"
|
||||
"subject": "Vérifiez votre nouvelle adresse e-mail {product_name}",
|
||||
"body": "Bonjour {username},\n\nSaisissez ce code dans l’application pour vérifier votre nouvelle adresse e-mail {product_name} :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi vous n’êtes pas à l’origine de cette demande, vous pouvez ignorer cet e-mail.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "Confirme ton changement d'e-mail {product_name}",
|
||||
"body": "Bonjour {username},\n\nNous avons reçu une demande de modification de l'adresse e-mail de ton compte {product_name}.\n\nPour confirmer ce changement, saisis ce code dans l'application :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi tu n'as pas demandé cela, sécurise ton compte immédiatement.\n\n– L'équipe {product_name}"
|
||||
"subject": "Confirmez votre changement d’adresse e-mail {product_name}",
|
||||
"body": "Bonjour {username},\n\nNous avons reçu une demande de modification de l’adresse e-mail de votre compte {product_name}.\n\nPour confirmer ce changement, saisissez ce code dans l’application :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi vous n’êtes pas à l’origine de cette demande, sécurisez votre compte immédiatement.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "Ton e-mail {product_name} a été modifié",
|
||||
"body": "Bonjour {username},\n\nL'adresse e-mail de ton compte {product_name} a été modifiée pour {newEmail}.\n\nSi tu as effectué ce changement, aucune action n'est nécessaire. Si ce n'est pas le cas, tu peux annuler le changement et sécuriser ton compte en utilisant ce lien :\n\n{revertUrl}\n\nCela restaurera ton e-mail précédent, te déconnectera de toutes les sessions, supprimera les numéros de téléphone liés, désactivera l'authentification multifacteur et t'obligera à définir un nouveau mot de passe.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Votre adresse e-mail {product_name} a été modifiée",
|
||||
"body": "Bonjour {username},\n\nL’adresse e-mail de votre compte {product_name} a été remplacée par {newEmail}.\n\nSi vous avez effectué ce changement, vous n’avez rien à faire. Sinon, vous pouvez l’annuler et sécuriser votre compte avec ce lien :\n\n{revertUrl}\n\nVotre ancienne adresse e-mail sera rétablie, toutes vos sessions seront fermées, les numéros de téléphone associés seront supprimés et l’authentification multifacteur sera désactivée. Vous devrez aussi définir un nouveau mot de passe.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "Vérifie ton adresse e-mail {product_name}",
|
||||
"body": "Bonjour {username},\n\nVérifie l'adresse e-mail de ton compte {product_name} en cliquant sur le lien ci-dessous :\n\n{verifyUrl}\n\nSi tu n'as pas créé de compte {product_name}, tu peux ignorer cet e-mail en toute sécurité.\n\nCe lien est valide pendant 24 heures.\n\n– L'équipe {product_name}"
|
||||
"subject": "Vérifiez votre adresse e-mail {product_name}",
|
||||
"body": "Bonjour {username},\n\nVérifiez l’adresse e-mail de votre compte {product_name} en cliquant sur le lien ci-dessous :\n\n{verifyUrl}\n\nSi vous n’avez pas créé de compte {product_name}, vous pouvez ignorer cet e-mail.\n\nCe lien est valable pendant 24 heures.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "Les avantages de ton cadeau échangé ont été supprimés",
|
||||
"body": "Bonjour {username},\n\nUn code cadeau que tu as échangé a été initialement payé par quelqu'un d'autre. Ce paiement a depuis été annulé (une rétrofacturation).\n\nPour cette raison, nous avons supprimé les avantages qui ont été ajoutés à ton compte lorsque tu as échangé le cadeau.\n\nSi tu penses qu'il s'agit d'une erreur, contacte notre équipe d'assistance et inclus tous les détails que tu as concernant le code cadeau et le moment où tu l'as échangé.\n\n– L'équipe {product_name}"
|
||||
"subject": "Les avantages de votre cadeau activé ont été retirés",
|
||||
"body": "Bonjour {username},\n\nUn code cadeau que vous avez utilisé avait été payé par une autre personne. Ce paiement a depuis été annulé à la suite d’une contestation bancaire.\n\nNous avons donc retiré les avantages ajoutés à votre compte lors de l’activation du cadeau.\n\nSi vous pensez qu’il s’agit d’une erreur, contactez notre équipe d’assistance et indiquez les informations dont vous disposez sur le code cadeau et sa date d’utilisation.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "Ton export de données {product_name} est prêt à être téléchargé",
|
||||
"body": "Bonjour {username},\n\nTon export de données est prêt.\n\nLien de téléchargement :\n{downloadUrl}\n\nMessages inclus : {totalMessages, number}\nTaille du fichier : {fileSizeMB, number} Mo\n\nCe lien expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi tu n'as pas demandé cet export, change ton mot de passe immédiatement et contacte notre équipe d'assistance.\n\n– L'équipe {product_name}"
|
||||
"subject": "Votre export de données {product_name} est prêt à être téléchargé",
|
||||
"body": "Bonjour {username},\n\nVotre export de données est prêt.\n\nLien de téléchargement :\n{downloadUrl}\n\nMessages inclus : {totalMessages, number}\nTaille du fichier : {fileSizeMB, number} Mo\n\nCe lien expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi vous n’avez pas demandé cet export, changez immédiatement votre mot de passe et contactez notre équipe d’assistance.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "Ton compte {product_name} sera supprimé en raison d'inactivité",
|
||||
"body": "Bonjour {username},\n\nNous n'avons détecté aucune activité sur ton compte {product_name} depuis le {lastActiveDate, date, full}.\n\nSi tu ne te connectes pas avant le {deletionDate, date, full} à {deletionDate, time, short}, ton compte sera définitivement supprimé en raison d'inactivité.\n\nConnecte-toi ici :\n{loginUrl}\n\nSi tu as utilisé {product_name} récemment, contacte notre équipe d'assistance immédiatement.\n\n– L'équipe {product_name}"
|
||||
"subject": "Votre compte {product_name} sera supprimé pour inactivité",
|
||||
"body": "Bonjour {username},\n\nNous n’avons détecté aucune activité sur votre compte {product_name} depuis le {lastActiveDate, date, full}.\n\nSi vous ne vous connectez pas avant le {deletionDate, date, full} à {deletionDate, time, short}, votre compte sera définitivement supprimé pour inactivité.\n\nConnectez-vous ici :\n{loginUrl}\n\nSi vous avez utilisé {product_name} récemment, contactez immédiatement notre équipe d’assistance.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "Autoriser la connexion depuis une nouvelle adresse IP",
|
||||
"body": "Bonjour {username},\n\nNous avons détecté une tentative de connexion à ton compte {product_name} depuis une nouvelle adresse IP :\n\nAdresse IP : {ipAddress}\nLocalisation : {location}\n\nSi c'était toi, autorise cette adresse IP en cliquant sur le lien ci-dessous :\n\n{authUrl}\n\nSi tu n'as pas tenté de te connecter, change ton mot de passe immédiatement.\n\nCe lien est valide pendant 30 minutes.\n\n– L'équipe {product_name}"
|
||||
"body": "Bonjour {username},\n\nNous avons détecté une tentative de connexion à votre compte {product_name} depuis une nouvelle adresse IP :\n\nAdresse IP : {ipAddress}\nLocalisation : {location}\n\nSi vous êtes à l’origine de cette tentative, autorisez cette adresse IP en cliquant sur le lien ci-dessous :\n\n{authUrl}\n\nSinon, changez immédiatement votre mot de passe.\n\nCe lien est valable pendant 30 minutes.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "Confirme l'accès à tes codes de secours {product_name}",
|
||||
"body": "Bonjour {username},\n\nNous avons reçu une demande de consultation des codes de secours de ton compte {product_name}.\n\nPour confirmer cette demande, saisis ce code dans l'application :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi tu n'as pas demandé cela, quelqu'un a peut-être eu accès à ton compte. Change ton mot de passe immédiatement.\n\n– L'équipe {product_name}"
|
||||
"subject": "Confirmez l’accès à vos codes de secours {product_name}",
|
||||
"body": "Bonjour {username},\n\nNous avons reçu une demande de consultation des codes de secours de votre compte {product_name}.\n\nPour confirmer cette demande, saisissez ce code dans l’application :\n\n{code}\n\nCe code expire le {expiresAt, date, full} à {expiresAt, time, short}.\n\nSi vous n’êtes pas à l’origine de cette demande, quelqu’un a peut-être accès à votre compte. Changez immédiatement votre mot de passe.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "Confirme la modification de ton mot de passe {product_name}",
|
||||
"body": "Bonjour {username},\n\nNous avons reçu une demande de modification du mot de passe de ton compte {product_name}.\n\nPour confirmer cette modification, saisis ce code dans l'application :\n\n{code}\n\nCe code expire à {expiresAt}.\n\nSi tu n'as pas demandé cela, quelqu'un a peut-être eu accès à ton compte. Change ton mot de passe immédiatement et active l'authentification à deux facteurs.\n\n– L'équipe {product_name}"
|
||||
"subject": "Confirmez la modification de votre mot de passe {product_name}",
|
||||
"body": "Bonjour {username},\n\nNous avons reçu une demande de modification du mot de passe de votre compte {product_name}.\n\nPour confirmer ce changement, saisissez ce code dans l’application :\n\n{code}\n\nCe code expire à {expiresAt}.\n\nSi vous n’êtes pas à l’origine de cette demande, quelqu’un a peut-être accès à votre compte. Changez immédiatement votre mot de passe et activez l’authentification à deux facteurs.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "Réinitialiser ton mot de passe {product_name}",
|
||||
"body": "Bonjour {username},\n\nTu as demandé une réinitialisation de ton mot de passe {product_name}. Utilise le lien ci-dessous pour définir un nouveau mot de passe :\n\n{resetUrl}\n\nSi tu n'as pas demandé cela, tu peux ignorer cet e-mail en toute sécurité.\n\nCe lien est valide pendant 1 heure.\n\n– L'équipe {product_name}"
|
||||
"subject": "Réinitialiser votre mot de passe {product_name}",
|
||||
"body": "Bonjour {username},\n\nVous avez demandé la réinitialisation de votre mot de passe {product_name}. Utilisez le lien ci-dessous pour en définir un nouveau :\n\n{resetUrl}\n\nSi vous n’êtes pas à l’origine de cette demande, vous pouvez ignorer cet e-mail.\n\nCe lien est valable pendant 1 heure.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "Ton inscription {product_name} a été approuvée",
|
||||
"body": "Bonjour {username},\n\nBonne nouvelle : ton inscription {product_name} a été approuvée.\n\nTu peux maintenant te connecter à l'application {product_name} ici :\n{channelsUrl}\n\nBienvenue dans la communauté {product_name}.\n\n– L'équipe {product_name}"
|
||||
"subject": "Votre inscription à {product_name} a été approuvée",
|
||||
"body": "Bonjour {username},\n\nBonne nouvelle : votre inscription à {product_name} a été approuvée.\n\nVous pouvez maintenant vous connecter à l’application {product_name} ici :\n{channelsUrl}\n\nBienvenue dans la communauté {product_name}.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "Ton signalement {product_name} a été examiné",
|
||||
"body": "Bonjour {username},\n\nTon signalement (ID : {reportId}) a été examiné par notre équipe de sécurité.{hasComment, select, yes {\n\nRéponse de l'équipe de sécurité :\n{publicComment}} other {}}\n\nMerci de nous aider à préserver la sécurité de {product_name} pour tous. Nous prenons tous les signalements au sérieux et apprécions ta contribution à la communauté.\n\nSi tu as des questions ou des préoccupations concernant ce résultat, contacte {safety_email}.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Votre signalement sur {product_name} a été examiné",
|
||||
"body": "Bonjour {username},\n\nVotre signalement (ID : {reportId}) a été examiné par notre équipe de sécurité.{hasComment, select, yes {\n\nRéponse de l’équipe de sécurité :\n{publicComment}} other {}}\n\nMerci de nous aider à préserver la sécurité de {product_name} pour tous. Nous prenons tous les signalements au sérieux et apprécions votre contribution à la communauté.\n\nPour toute question ou préoccupation concernant cette décision, contactez {safety_email}.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "Ton compte {product_name} sera définitivement supprimé",
|
||||
"body": "Bonjour {username},\n\nLa suppression définitive de ton compte {product_name} a été programmée.\n\nSuppression programmée : {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {Raison : {reason}}\n}\n\nIl s'agit d'une mesure sérieuse. Les données de ton compte seront définitivement supprimées à la date prévue.\n\nSi tu penses que cette décision était incorrecte, tu peux soumettre un appel. Envoie un e-mail à {appeals_email} depuis cette adresse e-mail.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "Votre compte {product_name} sera définitivement supprimé",
|
||||
"body": "Bonjour {username},\n\nLa suppression définitive de votre compte {product_name} a été programmée.\n\nSuppression prévue : {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select, null {} other {Motif : {reason}}}\n\nIl s’agit d’une sanction importante. Les données de votre compte seront définitivement supprimées à la date prévue.\n\nSi vous estimez que cette décision est incorrecte, vous pouvez déposer un recours. Écrivez à {appeals_email} depuis cette adresse e-mail.\n\n– L’équipe de sécurité de {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "La suppression de ton compte {product_name} est programmée",
|
||||
"body": "Bonjour {username},\n\nTu as demandé la suppression de ton compte {product_name}. Ton compte est programmé pour une suppression définitive le :\n\n{deletionDate, date, full} à {deletionDate, time, short}\n\nSi tu n'as pas demandé cela, connecte-toi à ton compte pour annuler la suppression. Nous te recommandons également de changer ton mot de passe pour sécuriser ton compte.\n\n– L'équipe {product_name}"
|
||||
"subject": "La suppression de votre compte {product_name} est programmée",
|
||||
"body": "Bonjour {username},\n\nVous avez demandé la suppression de votre compte {product_name}. Sa suppression définitive est prévue le :\n\n{deletionDate, date, full} à {deletionDate, time, short}\n\nSi vous n’êtes pas à l’origine de cette demande, connectez-vous à votre compte pour annuler la suppression. Nous vous recommandons également de changer votre mot de passe pour sécuriser votre compte.\n\n– L’équipe {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "La suspension de ton compte {product_name} a été levée",
|
||||
"body": "Bonjour {username},\n\nBonne nouvelle : la suspension de ton compte {product_name} a été levée.\n\n{reason, select,\n null {}\n other {Raison : {reason}}\n}\n\nTu peux maintenant te reconnecter et continuer à utiliser {product_name} normalement.\n\n– Équipe de sécurité de {product_name}"
|
||||
"subject": "La suspension de votre compte {product_name} a été levée",
|
||||
"body": "Bonjour {username},\n\nBonne nouvelle : la suspension de votre compte {product_name} a été levée.\n\n{reason, select, null {} other {Motif : {reason}}}\n\nVous pouvez maintenant vous reconnecter et utiliser {product_name} normalement.\n\n– L’équipe de sécurité de {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_HE_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "חשבון ה-{product_name} שלך הושבת זמנית",
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלך הושבת זמנית עקב זיהוי פעילות חשודה.\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nכדי לקבל בחזרה גישה לחשבון, יש לאפס את הסיסמה:\n\n{forgotUrl}\n\nלאחר איפוס הסיסמה, ניתן יהיה להתחבר שוב.\n\nאם אתם חושבים שזו טעות, צרו קשר עם צוות התמיכה שלנו.\n\nצוות הבטיחות של {product_name}"
|
||||
"subject": "חשבון ה-{product_name} שלכם הושבת זמנית",
|
||||
"body": "שלום {username},\n\nהשבתנו זמנית את חשבון ה-{product_name} שלכם מכיוון שזיהינו פעילות חשודה.\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nכדי לשחזר את הגישה לחשבון, תצטרכו לאפס את הסיסמה:\n\n{forgotUrl}\n\nלאחר שתאפסו את הסיסמה, תוכלו להתחבר שוב.\n\nאם אתם חושבים שזו טעות, צרו קשר עם צוות התמיכה שלנו.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "חשבון ה-{product_name} שלכם יימחק לצמיתות",
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלך נקבע למחיקה לצמיתות עקב הפרות של תנאי השירות או הנחיות הקהילה שלנו.\n\nמחיקה מתוזמנת: {deletionDate, date, full} בשעה {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nזוהי פעולת אכיפה חמורה. נתוני החשבון שלך יימחקו לצמיתות בתאריך המתוכנן.\n\nאנא עיינו ב:\n- תנאי השירות: {termsUrl}\n- הנחיות הקהילה: {guidelinesUrl}\n\nתהליך ערעור:\nאם אתם חושבים שהחלטת אכיפה זו שגויה או בלתי מוצדקת, יש לכם 60 יום להגיש ערעור. שלחו דוא\"ל לכתובת {appeals_email} מכתובת דוא\"ל זו.\n\nבערעור:\n- הסבירו בבירור מדוע אתם חושבים שהחלטת האכיפה שגויה או בלתי מוצדקת\n- ספקו כל ראיה או הקשר רלוונטיים\n\nחבר בצוות הבטיחות של {product_name} יבדוק את ערעורכם ועשוי להשהות את המחיקה הממתינה עד לקבלת החלטה סופית.\n\nצוות הבטיחות של {product_name}"
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלכם נקבע למחיקה לצמיתות עקב הפרות של תנאי השירות או הנחיות הקהילה שלנו.\n\nמחיקה מתוזמנת: {deletionDate, date, full} בשעה {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nזוהי פעולת אכיפה חמורה. נתוני החשבון שלכם יימחקו לצמיתות בתאריך המתוכנן.\n\nאנא עיינו במסמכים הבאים:\n- תנאי השירות: {termsUrl}\n- הנחיות הקהילה: {guidelinesUrl}\n\nתהליך ערעור:\nאם אתם חושבים שהחלטת האכיפה שגויה או בלתי מוצדקת, יש לכם 60 יום להגיש ערעור. שלחו אימייל לכתובת {appeals_email} מכתובת האימייל הזו.\n\nבערעור:\n- הסבירו בבירור מדוע לדעתכם החלטת האכיפה שגויה או בלתי מוצדקת\n- צרפו כל ראיה או הקשר רלוונטיים\n\nחבר בצוות הבטיחות של {product_name} יבדוק את הערעור שלכם ועשוי להשהות את המחיקה הממתינה עד לקבלת החלטה סופית.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "חשבון ה-{product_name} שלך הושעה זמנית",
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלך הושעה זמנית עקב הפרה של תנאי השירות או הנחיות הקהילה שלנו.\n\nמשך ההשעיה: {durationHours, plural,\n =1 {שעה אחת}\n other {# שעות}\n}\nהושעה עד: {bannedUntil, date, full} בשעה {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nבמהלך תקופה זו, לא תהיה לכם גישה לחשבון.\n\nאנא עיינו ב:\n- תנאי השירות: {termsUrl}\n- הנחיות הקהילה: {guidelinesUrl}\n\nאם אתם חושבים שהחלטת אכיפה זו שגויה או בלתי מוצדקת, אתם יכולים להגיש ערעור. שלחו דוא\"ל לכתובת {appeals_email} מכתובת דוא\"ל זו והסבירו בבירור מדוע אתם חושבים שההחלטה שגויה. אנו נבדוק את ערעורכם ונשיב עם החלטתנו.\n\nצוות הבטיחות של {product_name}"
|
||||
"subject": "חשבון ה-{product_name} שלכם הושעה זמנית",
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלכם הושעה זמנית עקב הפרה של תנאי השירות או הנחיות הקהילה שלנו.\n\nמשך ההשעיה: {durationHours, plural,\n =1 {שעה אחת}\n other {# שעות}\n}\nמושעה עד: {bannedUntil, date, full} בשעה {bannedUntil, time, short}\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nבמהלך תקופה זו לא תהיה לכם גישה לחשבון.\n\nאנא עיינו במסמכים הבאים:\n- תנאי השירות: {termsUrl}\n- הנחיות הקהילה: {guidelinesUrl}\n\nאם אתם חושבים שהחלטת האכיפה שגויה או בלתי מוצדקת, תוכלו להגיש ערעור. שלחו אימייל לכתובת {appeals_email} מכתובת האימייל הזו והסבירו בבירור מדוע לדעתכם ההחלטה שגויה. נבדוק את הערעור ונעדכן אתכם בהחלטה שלנו.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "תודה על תרומתכם ל-{product_name}",
|
||||
"body": "שלום,\n\nתודה על תרומתכם ל-{product_name}! ה{interval, select,\n month {תרומה החוזרת}\n year {תרומה החוזרת}\n other {תרומה החד-פעמית}\n} שלכם {interval, select,\n month {הוגדרה}\n year {הוגדרה}\n other {עובדה}\n} בהצלחה.\n\nפרטי התרומה:\nסכום: {amount} {currency} {interval, select,\n month {לחודש}\n year {לשנה}\n other {}\n}\n\nStripe ישלח לכם בקרוב קבלה נפרדת עם קובץ PDF של החשבונית. הקבלה תכלול את כל פרטי התשלום וניתן יהיה להשתמש בה למטרות מס.\n\nאתם יכולים לצפות בהיסטוריית התרומות שלכם, להוריד חשבוניות, {interval, select,\n month {ולנהל או לבטל את המנוי}\n year {ולנהל או לבטל את המנוי}\n other {ולנהל תרומות עתידיות}\n} בכל עת באמצעות קישור זה:\n\n{manageUrl}\n\nהתמיכה שלכם עוזרת לשמור על פעילות {product_name}. תודה!\n\nצוות {product_name}"
|
||||
"body": "שלום,\n\nתודה על תרומתכם ל-{product_name}! ה{interval, select,\n month {תרומה החוזרת}\n year {תרומה החוזרת}\n other {תרומה החד-פעמית}\n} שלכם {interval, select,\n month {הוגדרה}\n year {הוגדרה}\n other {בוצעה}\n} בהצלחה.\n\nפרטי התרומה:\nסכום: {amount} {interval, select,\n month {לחודש}\n year {לשנה}\n other {}\n}\n\nStripe ישלח לכם בקרוב קבלה נפרדת עם קובץ PDF של החשבונית. הקבלה תכלול את כל פרטי התשלום וניתן יהיה להשתמש בה למטרות מס.\n\nאתם יכולים לצפות בהיסטוריית התרומות שלכם, להוריד חשבוניות, {interval, select,\n month {ולנהל או לבטל את המנוי}\n year {ולנהל או לבטל את המנוי}\n other {ולנהל תרומות עתידיות}\n} בכל עת באמצעות קישור זה:\n\n{manageUrl}\n\nהתמיכה שלכם עוזרת לשמור על פעילות {product_name}. תודה!\n\nצוות {product_name}"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "ניהול התרומות שלכם ל-{product_name}",
|
||||
"body": "שלום,\n\nלחצו על הקישור למטה כדי לגשת לפורטל התורמים שלכם:\n\n{manageUrl}\n\nבפורטל, אתם יכולים לנהל מנויים, להוריד חשבוניות ולצפות בהיסטוריית התרומות שלכם.\n\nקישור זה יפוג ב- {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם קישור זה, אתם יכולים להתעלם בבטחה מדוא\"ל זה.\n\nצוות {product_name}"
|
||||
"body": "שלום,\n\nלחצו על הקישור למטה כדי לגשת לפורטל התורמים שלכם:\n\n{manageUrl}\n\nבפורטל, אתם יכולים לנהל מנויים, להוריד חשבוניות ולצפות בהיסטוריית התרומות שלכם.\n\nקישור זה יפוג בתאריך {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם קישור זה, אתם יכולים להתעלם בבטחה מאימייל זה.\n\nצוות {product_name}"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "אימות האימייל שלכם עבור דוח DSA",
|
||||
"body": "שלום,\n\nהשתמשו בקוד האימות למטה כדי להגיש את דוח חוק השירותים הדיגיטליים ב-{product_name}:\n\n{code}\n\nקוד זה יפוג ב- {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, אתם יכולים להתעלם מדוא\"ל זה.\n\nצוות הבטיחות של {product_name}"
|
||||
"subject": "אימות האימייל שלכם לדיווח DSA",
|
||||
"body": "שלום,\n\nהשתמשו בקוד האימות למטה כדי להגיש את הדיווח שלכם לפי חוק השירותים הדיגיטליים ב-{product_name}:\n\n{code}\n\nקוד זה יפוג בתאריך {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, אתם יכולים להתעלם מאימייל זה.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "אימות האימייל החדש שלכם ל-{product_name}",
|
||||
"body": "שלום {username},\n\nהזינו קוד זה באפליקציה כדי לאמת את האימייל החדש שלכם ב-{product_name}:\n\n{code}\n\nקוד זה יפוג ב- {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, אתם יכולים להתעלם מדוא\"ל זה.\n\nצוות {product_name}"
|
||||
"subject": "אימות האימייל החדש שלכם ב-{product_name}",
|
||||
"body": "שלום {username},\n\nהזינו קוד זה באפליקציה כדי לאמת את האימייל החדש שלכם ב-{product_name}:\n\n{code}\n\nקוד זה יפוג בתאריך {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, אתם יכולים להתעלם מאימייל זה.\n\nצוות {product_name}"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "אישור שינוי האימייל שלכם ל-{product_name}",
|
||||
"body": "שלום {username},\n\nקיבלנו בקשה לשינוי כתובת האימייל בחשבון ה-{product_name} שלכם.\n\nכדי לאשר שינוי זה, הזינו קוד זה באפליקציה:\n\n{code}\n\nקוד זה יפוג ב- {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, אנא אבטחו את חשבונכם מיד.\n\nצוות {product_name}"
|
||||
"subject": "אישור שינוי האימייל שלכם ב-{product_name}",
|
||||
"body": "שלום {username},\n\nקיבלנו בקשה לשינוי כתובת האימייל בחשבון ה-{product_name} שלכם.\n\nכדי לאשר שינוי זה, הזינו קוד זה באפליקציה:\n\n{code}\n\nקוד זה יפוג בתאריך {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, אנא אבטחו את חשבונכם מיד.\n\nצוות {product_name}"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "האימייל שלכם ב-{product_name} שונה",
|
||||
"body": "שלום {username},\n\nכתובת האימייל בחשבון ה-{product_name} שלכם שונתה ל- {newEmail}.\n\nאם אתם ביצעתם שינוי זה, אין צורך בפעולה. אם לא, אתם יכולים לבטל את השינוי ולאבטח את חשבונכם באמצעות קישור זה:\n\n{revertUrl}\n\nפעולה זו תשחזר את האימייל הקודם שלכם, תנתק אתכם מכל המכשירים, תסיר מספרי טלפון מקושרים, תבטל אימות רב-שלבי (MFA), ותדרוש מכם להגדיר סיסמה חדשה.\n\nצוות הבטיחות של {product_name}"
|
||||
"body": "שלום {username},\n\nכתובת האימייל בחשבון ה-{product_name} שלכם שונתה ל-{newEmail}.\n\nאם אתם ביצעתם שינוי זה, אין צורך בפעולה. אם לא, אתם יכולים לבטל את השינוי ולאבטח את חשבונכם באמצעות קישור זה:\n\n{revertUrl}\n\nפעולה זו תשחזר את האימייל הקודם שלכם, תנתק אתכם מכל המכשירים, תסיר מספרי טלפון מקושרים, תבטל את האימות הרב-שלבי (MFA), ותדרוש מכם להגדיר סיסמה חדשה.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "אימות האימייל שלכם ב-{product_name}",
|
||||
"body": "שלום {username},\n\nאנא אמת/י את כתובת האימייל עבור חשבון ה-{product_name} שלך על ידי לחיצה על הקישור למטה:\n\n{verifyUrl}\n\nאם לא יצרתם חשבון {product_name}, אתם יכולים להתעלם בבטחה מדוא\"ל זה.\n\nקישור זה תקף למשך 24 שעות.\n\nצוות {product_name}"
|
||||
"body": "שלום {username},\n\nאנא אמתו את כתובת האימייל של חשבון ה-{product_name} שלכם באמצעות לחיצה על הקישור למטה:\n\n{verifyUrl}\n\nאם לא יצרתם חשבון {product_name}, אתם יכולים להתעלם בבטחה מאימייל זה.\n\nקישור זה תקף למשך 24 שעות.\n\nצוות {product_name}"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "הטבות מהמתנה שמימשתם הוסרו",
|
||||
"body": "שלום {username},\n\nקוד מתנה שמימשתם שולם במקור על ידי מישהו אחר. תשלום זה בוטל מאז (החזר חיוב).\n\nבשל כך, הסרנו את ההטבות שנוספו לחשבונכם כאשר מימשתם את המתנה.\n\nאם אתם חושבים שזו טעות, אנא צרו קשר עם צוות התמיכה שלנו וכללו כל פרט שיש לכם לגבי קוד המתנה ומתי מימשתם אותו.\n\nצוות {product_name}"
|
||||
"subject": "ההטבות מהמתנה שמימשתם הוסרו",
|
||||
"body": "שלום {username},\n\nקוד מתנה שמימשתם שולם במקור על ידי מישהו אחר. התשלום הזה בוטל מאז (החזר חיוב).\n\nבשל כך, הסרנו את ההטבות שנוספו לחשבונכם כאשר מימשתם את המתנה.\n\nאם אתם חושבים שזו טעות, אנא צרו קשר עם צוות התמיכה שלנו וצרפו כל פרט שידוע לכם לגבי קוד המתנה ומתי מימשתם אותו.\n\nצוות {product_name}"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "ייצוא הנתונים שלכם מ-{product_name} מוכן להורדה",
|
||||
"body": "שלום {username},\n\nייצוא הנתונים שלכם מוכן.\n\nקישור להורדה:\n{downloadUrl}\n\nהודעות כלולות: {totalMessages, number}\nגודל קובץ: {fileSizeMB, number} מגה-בייט\n\nקישור זה יפוג ב- {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם ייצוא זה, אנא שנו את הסיסמה שלכם מיד וצרו קשר עם צוות התמיכה שלנו.\n\nצוות {product_name}"
|
||||
"body": "שלום {username},\n\nייצוא הנתונים שלכם מוכן.\n\nקישור להורדה:\n{downloadUrl}\n\nהודעות כלולות: {totalMessages, number}\nגודל הקובץ: {fileSizeMB, number} מגה-בייט\n\nקישור זה יפוג בתאריך {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם ייצוא זה, אנא שנו את הסיסמה שלכם מיד וצרו קשר עם צוות התמיכה שלנו.\n\nצוות {product_name}"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "חשבון ה-{product_name} שלכם יימחק עקב חוסר פעילות",
|
||||
"body": "שלום {username},\n\nלא ראינו פעילות בחשבון ה-{product_name} שלכם מאז {lastActiveDate, date, full}.\n\nאם לא תתחברו עד {deletionDate, date, full} בשעה {deletionDate, time, short}, חשבונכם יימחק לצמיתות עקב חוסר פעילות.\n\nהתחברו כאן:\n{loginUrl}\n\nאם השתמשתם ב-{product_name} לאחרונה, אנא צרו קשר עם צוות התמיכה שלנו מיד.\n\nצוות {product_name}"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "אישור כניסה מכתובת IP חדשה",
|
||||
"subject": "אישור התחברות מכתובת IP חדשה",
|
||||
"body": "שלום {username},\n\nזיהינו ניסיון התחברות לחשבון ה-{product_name} שלכם מכתובת IP חדשה:\n\nכתובת IP: {ipAddress}\nמיקום: {location}\n\nאם זה הייתם אתם, אנא אשרו כתובת IP זו על ידי לחיצה על הקישור למטה:\n\n{authUrl}\n\nאם לא ניסיתם להתחבר, אנא שנו את הסיסמה שלכם מיד.\n\nקישור זה תקף למשך 30 דקות.\n\nצוות {product_name}"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "אישור גישה לקודי הגיבוי שלכם ב-{product_name}",
|
||||
"body": "שלום {username},\n\nקיבלנו בקשה לצפייה בקודי הגיבוי בחשבון ה-{product_name} שלכם.\n\nכדי לאשר בקשה זו, הזינו קוד זה באפליקציה:\n\n{code}\n\nקוד זה יפוג ב- {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, ייתכן שלמישהו יש גישה לחשבונכם. שנו את הסיסמה שלכם מיד.\n\nצוות {product_name}"
|
||||
"body": "שלום {username},\n\nקיבלנו בקשה לצפייה בקודי הגיבוי בחשבון ה-{product_name} שלכם.\n\nכדי לאשר בקשה זו, הזינו קוד זה באפליקציה:\n\n{code}\n\nקוד זה יפוג בתאריך {expiresAt, date, full} בשעה {expiresAt, time, short}.\n\nאם לא ביקשתם זאת, ייתכן שלמישהו יש גישה לחשבונכם. שנו את הסיסמה שלכם מיד.\n\nצוות {product_name}"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "אישור שינוי הסיסמה שלכם ב-{product_name}",
|
||||
"body": "שלום {username},\n\nקיבלנו בקשה לשינוי הסיסמה בחשבון ה-{product_name} שלכם.\n\nכדי לאשר שינוי זה, הזינו קוד זה באפליקציה:\n\n{code}\n\nקוד זה יפוג ב- {expiresAt}.\n\nאם לא ביקשתם זאת, ייתכן שלמישהו יש גישה לחשבונכם. שנו את הסיסמה שלכם מיד ואפשרו אימות דו-שלבי.\n\nצוות {product_name}"
|
||||
"body": "שלום {username},\n\nקיבלנו בקשה לשינוי הסיסמה בחשבון ה-{product_name} שלכם.\n\nכדי לאשר שינוי זה, הזינו קוד זה באפליקציה:\n\n{code}\n\nקוד זה יפוג ב-{expiresAt}.\n\nאם לא ביקשתם זאת, ייתכן שלמישהו יש גישה לחשבונכם. שנו את הסיסמה שלכם מיד והפעילו אימות דו-שלבי.\n\nצוות {product_name}"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "איפוס הסיסמה שלכם ל-{product_name}",
|
||||
"body": "שלום {username},\n\nביקשתם איפוס סיסמה ל-{product_name}. השתמשו בקישור למטה כדי להגדיר סיסמה חדשה:\n\n{resetUrl}\n\nאם לא ביקשתם זאת, אתם יכולים להתעלם בבטחה מדוא\"ל זה.\n\nקישור זה תקף למשך שעה אחת.\n\nצוות {product_name}"
|
||||
"subject": "איפוס הסיסמה שלכם ב-{product_name}",
|
||||
"body": "שלום {username},\n\nביקשתם איפוס סיסמה ל-{product_name}. השתמשו בקישור למטה כדי להגדיר סיסמה חדשה:\n\n{resetUrl}\n\nאם לא ביקשתם זאת, אתם יכולים להתעלם בבטחה מאימייל זה.\n\nקישור זה תקף למשך שעה אחת.\n\nצוות {product_name}"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "ההרשמה שלכם ל-{product_name} אושרה",
|
||||
"body": "שלום {username},\n\nחדשות טובות: ההרשמה שלכם ל-{product_name} אושרה.\n\nכעת אתם יכולים להתחבר לאפליקציית {product_name} כאן:\n{channelsUrl}\n\nברוכים הבאים לקהילת {product_name}.\n\nצוות {product_name}"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "הדוח שלכם ב-{product_name} נבדק",
|
||||
"body": "שלום {username},\n\nהדוח שלכם (מזהה: {reportId}) נבדק על ידי צוות הבטיחות שלנו.{hasComment, select, yes {\n\nתגובה מצוות הבטיחות:\n{publicComment}} other {}}\n\nתודה שעזרתם לשמור על {product_name} בטוחה לכולם. אנו מתייחסים לכל הדיווחים ברצינות ומעריכים את תרומתכם לקהילה.\n\nאם יש לכם שאלות או חששות לגבי תוצאה זו, אנא צרו קשר עם {safety_email}.\n\nצוות הבטיחות של {product_name}"
|
||||
"subject": "הדיווח שלכם ב-{product_name} נבדק",
|
||||
"body": "שלום {username},\n\nהדיווח שלכם (מזהה: {reportId}) נבדק על ידי צוות הבטיחות שלנו.{hasComment, select, yes {\n\nתגובה מצוות הבטיחות:\n{publicComment}} other {}}\n\nתודה שעזרתם לשמור על {product_name} כמקום בטוח לכולם. אנו מתייחסים לכל הדיווחים ברצינות ומעריכים את תרומתכם לקהילה.\n\nאם יש לכם שאלות או חששות לגבי תוצאה זו, אנא צרו קשר עם {safety_email}.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "חשבון ה-{product_name} שלכם יימחק לצמיתות",
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלכם נקבע למחיקה לצמיתות.\n\nמחיקה מתוזמנת: {deletionDate, date, full} בשעה {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nזוהי פעולת אכיפה חמורה. נתוני החשבון שלכם יימחקו לצמיתות בתאריך המתוכנן.\n\nאם אתם חושבים שהחלטת אכיפה זו שגויה, אתם יכולים להגיש ערעור. שלחו דוא\"ל לכתובת {appeals_email} מכתובת דוא\"ל זו.\n\nצוות הבטיחות של {product_name}"
|
||||
"body": "שלום {username},\n\nחשבון ה-{product_name} שלכם נקבע למחיקה לצמיתות.\n\nמחיקה מתוזמנת: {deletionDate, date, full} בשעה {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nזוהי פעולת אכיפה חמורה. נתוני החשבון שלכם יימחקו לצמיתות בתאריך המתוכנן.\n\nאם אתם חושבים שהחלטת אכיפה זו שגויה, אתם יכולים להגיש ערעור. שלחו אימייל לכתובת {appeals_email} מכתובת האימייל הזו.\n\nצוות הבטיחות של {product_name}"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "מחיקת חשבון ה-{product_name} שלכם מתוזמנת",
|
||||
"body": "שלום {username},\n\nביקשתם למחוק את חשבון ה-{product_name} שלכם. חשבונכם מתוזמן למחיקה לצמיתות ב:\n\n{deletionDate, date, full} בשעה {deletionDate, time, short}\n\nאם לא ביקשתם זאת, התחברו לחשבונכם כדי לבטל את המחיקה. אנו ממליצים גם לשנות את הסיסמה שלכם כדי לאבטח את החשבון.\n\nצוות {product_name}"
|
||||
"body": "שלום {username},\n\nביקשתם למחוק את חשבון ה-{product_name} שלכם. החשבון שלכם מתוכנן להימחק לצמיתות בתאריך:\n\n{deletionDate, date, full} בשעה {deletionDate, time, short}\n\nאם לא ביקשתם זאת, התחברו לחשבונכם כדי לבטל את המחיקה. אנו ממליצים גם לשנות את הסיסמה שלכם כדי לאבטח את החשבון.\n\nצוות {product_name}"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "השעיית חשבון ה-{product_name} שלכם הוסרה",
|
||||
"body": "שלום {username},\n\nחדשות טובות: השעיית חשבון ה-{product_name} שלכם הוסרה.\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nכעת אתם יכולים להתחבר שוב ולהמשיך להשתמש ב-{product_name} כרגיל.\n\nצוות הבטיחות של {product_name}"
|
||||
"subject": "השעיית חשבון ה-{product_name} שלכם בוטלה",
|
||||
"body": "שלום {username},\n\nחדשות טובות: השעיית חשבון ה-{product_name} שלכם בוטלה.\n\n{reason, select,\n null {}\n other {סיבה: {reason}}\n}\n\nכעת אתם יכולים להתחבר שוב ולהמשיך להשתמש ב-{product_name} כרגיל.\n\nצוות הבטיחות של {product_name}"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,91 +1,91 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {defineEmailI18nLocaleMessages} from '../EmailI18nMessages';
|
||||
import {defineEmailI18nLocaleMessages} from '@pkgs/email/src/email_i18n/EmailI18nMessages';
|
||||
|
||||
const EMAIL_I18N_HI_MESSAGES = defineEmailI18nLocaleMessages({
|
||||
"account_disabled_suspicious": {
|
||||
"subject": "आपका {product_name} अकाउंट अस्थायी रूप से डिसेबल कर दिया गया है",
|
||||
"body": "नमस्ते {username},\n\nहमने आपके {product_name} अकाउंट को अस्थायी रूप से डिसेबल कर दिया है क्योंकि हमें संदिग्ध एक्टिविटी देखी गई है।\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nअपने अकाउंट का एक्सेस फिर से पाने के लिए, आपको अपना पासवर्ड रीसेट करना होगा:\n\n{forgotUrl}\n\nअपना पासवर्ड रीसेट करने के बाद, आप फिर से लॉगिन कर पाएंगे।\n\nअगर आपको लगता है कि यह गलती से हुआ है, तो कृपया हमारी सपोर्ट टीम से संपर्क करें।\n\n– {product_name} सेफ्टी टीम"
|
||||
"body": "नमस्ते {username},\n\nहमने आपके {product_name} अकाउंट को अस्थायी रूप से डिसेबल कर दिया है क्योंकि हमने संदिग्ध एक्टिविटी देखी है।\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nअपने अकाउंट का एक्सेस फिर से पाने के लिए, आपको अपना पासवर्ड रीसेट करना होगा:\n\n{forgotUrl}\n\nअपना पासवर्ड रीसेट करने के बाद, आप फिर से लॉगिन कर पाएँगे।\n\nअगर आपको लगता है कि यह गलती से हुआ है, तो कृपया हमारी सपोर्ट टीम से संपर्क करें।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"account_scheduled_deletion": {
|
||||
"subject": "आपका {product_name} अकाउंट हमेशा के लिए डिलीट कर दिया जाएगा",
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट को हमारी सेवा की शर्तों या कम्युनिटी गाइडलाइंस के उल्लंघन के कारण हमेशा के लिए डिलीट करने के लिए शेड्यूल किया गया है।\n\nडिलीशन शेड्यूल: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nयह एक गंभीर कदम है। आपके अकाउंट का डेटा निर्धारित तारीख पर हमेशा के लिए डिलीट कर दिया जाएगा।\n\nकृपया देखें:\n- सेवा की शर्तें: {termsUrl}\n- कम्युनिटी गाइडलाइंस: {guidelinesUrl}\n\nअपील प्रक्रिया:\nअगर आपको लगता है कि यह निर्णय गलत या अनुचित था, तो आपके पास अपील सबमिट करने के लिए 60 दिन हैं। इस ईमेल एड्रेस से {appeals_email} पर ईमेल करें।\n\nअपनी अपील में:\n- साफ तौर पर बताएं कि आपको क्यों लगता है कि यह निर्णय गलत या अनुचित था\n- कोई भी प्रासंगिक सबूत या संदर्भ दें\n\n{product_name} सेफ्टी टीम का एक मेंबर आपकी अपील का रिव्यू करेगा और अंतिम फैसला आने तक डिलीट होने की प्रक्रिया को रोक सकता है।\n\n– {product_name} सेफ्टी टीम"
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट को हमारी सेवा की शर्तों या कम्युनिटी गाइडलाइंस के उल्लंघन के कारण हमेशा के लिए डिलीट करने के लिए शेड्यूल किया गया है।\n\nडिलीशन की निर्धारित तारीख: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nयह एक गंभीर कार्रवाई है। आपके अकाउंट का डेटा निर्धारित तारीख पर हमेशा के लिए डिलीट कर दिया जाएगा।\n\nकृपया देखें:\n- सेवा की शर्तें: {termsUrl}\n- कम्युनिटी गाइडलाइंस: {guidelinesUrl}\n\nअपील प्रक्रिया:\nअगर आपको लगता है कि यह फैसला गलत या अनुचित था, तो आपके पास अपील सबमिट करने के लिए 60 दिन हैं। इस ईमेल पते से {appeals_email} पर ईमेल करें।\n\nअपनी अपील में:\n- साफ़ तौर पर बताएं कि आपको क्यों लगता है कि यह फैसला गलत या अनुचित था\n- कोई भी प्रासंगिक सबूत या जानकारी दें\n\n{product_name} सेफ्टी टीम का एक सदस्य आपकी अपील का रिव्यू करेगा और अंतिम फैसला आने तक डिलीट होने की प्रक्रिया को रोक सकता है।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"account_temp_banned": {
|
||||
"subject": "आपका {product_name} अकाउंट अस्थायी रूप से सस्पेंड कर दिया गया है",
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट को हमारी सेवा की शर्तों या कम्युनिटी गाइडलाइंस का उल्लंघन करने के लिए अस्थायी रूप से सस्पेंड कर दिया गया है।\n\nअवधि: {durationHours, plural,\n =1 {1 घंटा}\n other {# घंटे}\n}\nसस्पेंड किया गया है: {bannedUntil, date, full} {bannedUntil, time, short} तक\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nइस दौरान, आप अपने अकाउंट को एक्सेस नहीं कर पाएंगे।\n\nकृपया देखें:\n- सेवा की शर्तें: {termsUrl}\n- कम्युनिटी गाइडलाइंस: {guidelinesUrl}\n\nअगर आपको लगता है कि यह निर्णय गलत या अनुचित था, तो आप अपील सबमिट कर सकते हैं। इस ईमेल एड्रेस से {appeals_email} पर ईमेल करें और साफ तौर पर बताएं कि आपको क्यों लगता है कि फैसला गलत था। हम आपकी अपील का रिव्यू करेंगे और अपने फैसले के साथ जवाब देंगे।\n\n– {product_name} सेफ्टी टीम"
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट को हमारी सेवा की शर्तों या कम्युनिटी गाइडलाइंस का उल्लंघन करने के लिए अस्थायी रूप से सस्पेंड कर दिया गया है।\n\nअवधि: {durationHours, plural,\n =1 {1 घंटा}\n other {# घंटे}\n}\nसस्पेंड रहेगा: {bannedUntil, date, full} {bannedUntil, time, short} तक\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nइस दौरान, आप अपने अकाउंट को एक्सेस नहीं कर पाएँगे।\n\nकृपया देखें:\n- सेवा की शर्तें: {termsUrl}\n- कम्युनिटी गाइडलाइंस: {guidelinesUrl}\n\nअगर आपको लगता है कि यह फैसला गलत या अनुचित था, तो आप अपील सबमिट कर सकते हैं। इस ईमेल पते से {appeals_email} पर ईमेल करें और साफ़ तौर पर बताएं कि आपको क्यों लगता है कि फैसला गलत था। हम आपकी अपील का रिव्यू करेंगे और अपने फैसले के साथ जवाब देंगे।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"donation_confirmation": {
|
||||
"subject": "आपके {product_name} डोनेशन के लिए धन्यवाद",
|
||||
"body": "नमस्ते,\n\n{product_name} को आपके डोनेशन के लिए धन्यवाद! आपका {interval, select,\n month {रिकरिंग डोनेशन}\n year {रिकरिंग डोनेशन}\n other {वन-टाइम डोनेशन}\n} सफलतापूर्वक {interval, select,\n month {सेट अप हो गया है}\n year {सेट अप हो गया है}\n other {प्रोसेस हो गया है}\n}।\n\nडोनेशन डिटेल्स:\nराशि: {amount} {currency} {interval, select,\n month {प्रति माह}\n year {प्रति वर्ष}\n other {}\n}\n\nStripe आपको जल्द ही आपके इनवॉइस PDF के साथ एक अलग रसीद ईमेल करेगा। इसमें सभी पेमेंट डिटेल्स शामिल हैं और इसे टैक्स के लिए इस्तेमाल किया जा सकता है।\n\nआप इस लिंक का उपयोग करके किसी भी समय अपने डोनेशन का इतिहास देख सकते हैं, इनवॉइस डाउनलोड कर सकते हैं, {interval, select,\n month {और अपनी सब्सक्रिप्शन मैनेज या कैंसल कर सकते हैं}\n year {और अपनी सब्सक्रिप्शन मैनेज या कैंसल कर सकते हैं}\n other {और भविष्य के डोनेशन मैनेज कर सकते हैं}\n}।\n\n{manageUrl}\n\nआपका सपोर्ट {product_name} को चालू रखने में मदद करता है। धन्यवाद!\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते,\n\n{product_name} को आपके डोनेशन के लिए धन्यवाद! आपका {interval, select,\n month {रिकरिंग डोनेशन}\n year {रिकरिंग डोनेशन}\n other {वन-टाइम डोनेशन}\n} सफलतापूर्वक {interval, select,\n month {सेट अप हो गया है}\n year {सेट अप हो गया है}\n other {प्रोसेस हो गया है}\n}।\n\nडोनेशन का विवरण:\nराशि: {amount} {interval, select,\n month {प्रति माह}\n year {प्रति वर्ष}\n other {}\n}\n\nStripe आपको जल्द ही आपके इनवॉइस PDF के साथ एक अलग रसीद ईमेल करेगा। इसमें पेमेंट की सारी जानकारी शामिल है और इसे टैक्स के लिए इस्तेमाल किया जा सकता है।\n\nआप इस लिंक से किसी भी समय अपने डोनेशन का इतिहास देख सकते हैं, इनवॉइस डाउनलोड कर सकते हैं, {interval, select,\n month {और अपना सब्सक्रिप्शन मैनेज या कैंसल कर सकते हैं}\n year {और अपना सब्सक्रिप्शन मैनेज या कैंसल कर सकते हैं}\n other {और आगे के डोनेशन मैनेज कर सकते हैं}\n}।\n\n{manageUrl}\n\nआपका सपोर्ट {product_name} को चालू रखने में मदद करता है। धन्यवाद!\n\n– {product_name} टीम"
|
||||
},
|
||||
"donation_magic_link": {
|
||||
"subject": "अपने {product_name} डोनेशन मैनेज करें",
|
||||
"body": "नमस्ते,\n\nअपने डोनर पोर्टल एक्सेस करने के लिए नीचे दिए गए लिंक पर क्लिक करें:\n\n{manageUrl}\n\nपोर्टल में, आप सब्सक्रिप्शन मैनेज कर सकते हैं, इनवॉइस डाउनलोड कर सकते हैं और अपने डोनेशन का इतिहास देख सकते हैं।\n\nयह लिंक {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इस लिंक का अनुरोध नहीं किया था, तो आप इस ईमेल को अनदेखा कर सकते हैं।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते,\n\nअपना डोनर पोर्टल एक्सेस करने के लिए नीचे दिए गए लिंक पर क्लिक करें:\n\n{manageUrl}\n\nपोर्टल में, आप सब्सक्रिप्शन मैनेज कर सकते हैं, इनवॉइस डाउनलोड कर सकते हैं और अपने डोनेशन का इतिहास देख सकते हैं।\n\nयह लिंक {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इस लिंक का अनुरोध नहीं किया था, तो आप इस ईमेल को बेझिझक अनदेखा कर सकते हैं।\n\n– {product_name} टीम"
|
||||
},
|
||||
"dsa_report_verification": {
|
||||
"subject": "DSA रिपोर्ट के लिए अपना ईमेल वेरिफाई करें",
|
||||
"body": "नमस्ते,\n\n{product_name} पर अपनी डिजिटल सर्विसेज एक्ट रिपोर्ट सबमिट करने के लिए नीचे दिए गए वेरिफिकेशन कोड का इस्तेमाल करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो आप इस ईमेल को अनदेखा कर सकते हैं।\n\n– {product_name} सेफ्टी टीम"
|
||||
"subject": "DSA रिपोर्ट के लिए अपना ईमेल वेरिफ़ाई करें",
|
||||
"body": "नमस्ते,\n\n{product_name} पर अपनी Digital Services Act रिपोर्ट सबमिट करने के लिए नीचे दिए गए वेरिफ़िकेशन कोड का इस्तेमाल करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसका अनुरोध नहीं किया था, तो आप इस ईमेल को अनदेखा कर सकते हैं।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"email_change_new": {
|
||||
"subject": "अपना नया {product_name} ईमेल वेरिफाई करें",
|
||||
"body": "नमस्ते {username},\n\nअपना नया {product_name} ईमेल वेरिफाई करने के लिए ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो आप इस ईमेल को अनदेखा कर सकते हैं।\n\n– {product_name} टीम"
|
||||
"subject": "अपना नया {product_name} ईमेल वेरिफ़ाई करें",
|
||||
"body": "नमस्ते {username},\n\nअपना नया {product_name} ईमेल वेरिफ़ाई करने के लिए ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसका अनुरोध नहीं किया था, तो आप इस ईमेल को अनदेखा कर सकते हैं।\n\n– {product_name} टीम"
|
||||
},
|
||||
"email_change_original": {
|
||||
"subject": "अपने {product_name} ईमेल चेंज की पुष्टि करें",
|
||||
"body": "नमस्ते {username},\n\nहमें आपके {product_name} अकाउंट पर ईमेल एड्रेस बदलने का अनुरोध मिला है।\n\nइस बदलाव की पुष्टि करने के लिए, ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो कृपया तुरंत अपना अकाउंट सुरक्षित करें।\n\n– {product_name} टीम"
|
||||
"subject": "अपने {product_name} ईमेल में बदलाव की पुष्टि करें",
|
||||
"body": "नमस्ते {username},\n\nहमें आपके {product_name} अकाउंट पर ईमेल पता बदलने का अनुरोध मिला है।\n\nइस बदलाव की पुष्टि करने के लिए, ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसका अनुरोध नहीं किया था, तो कृपया तुरंत अपना अकाउंट सुरक्षित करें।\n\n– {product_name} टीम"
|
||||
},
|
||||
"email_change_revert": {
|
||||
"subject": "आपका {product_name} ईमेल बदल दिया गया था",
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट पर ईमेल एड्रेस बदलकर {newEmail} कर दिया गया है।\n\nअगर आपने यह बदलाव किया है, तो किसी कार्रवाई की जरूरत नहीं है। अगर आपने नहीं किया है, तो आप इस लिंक का उपयोग करके बदलाव को वापस ले सकते हैं और अपना अकाउंट सुरक्षित कर सकते हैं:\n\n{revertUrl}\n\nयह आपके पिछले ईमेल को रीस्टोर करेगा, आपको हर जगह से साइन आउट करेगा, लिंक किए गए फोन नंबर हटाएगा, MFA को डिसेबल करेगा, और आपको एक नया पासवर्ड सेट करने की जरूरत होगी।\n\n– {product_name} सेफ्टी टीम"
|
||||
"subject": "आपका {product_name} ईमेल बदल दिया गया है",
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट पर ईमेल पता बदलकर {newEmail} कर दिया गया है।\n\nअगर आपने यह बदलाव किया है, तो किसी कार्रवाई की ज़रूरत नहीं है। अगर आपने नहीं किया है, तो आप इस लिंक का उपयोग करके बदलाव को वापस ले सकते हैं और अपना अकाउंट सुरक्षित कर सकते हैं:\n\n{revertUrl}\n\nयह आपके पिछले ईमेल को रीस्टोर करेगा, आपको हर जगह से साइन आउट करेगा, लिंक किए गए फ़ोन नंबर हटाएगा, MFA को डिसेबल करेगा, और आपको एक नया पासवर्ड सेट करने की ज़रूरत होगी।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"email_verification": {
|
||||
"subject": "अपना {product_name} ईमेल एड्रेस वेरिफाई करें",
|
||||
"body": "नमस्ते {username},\n\nकृपया नीचे दिए गए लिंक पर क्लिक करके अपने {product_name} अकाउंट के लिए ईमेल एड्रेस वेरिफाई करें:\n\n{verifyUrl}\n\nअगर आपने {product_name} अकाउंट नहीं बनाया है, तो आप इस ईमेल को बेझिझक अनदेखा कर सकते हैं।\n\nयह लिंक 24 घंटे के लिए वैलिड है।\n\n– {product_name} टीम"
|
||||
"subject": "अपना {product_name} ईमेल पता वेरिफ़ाई करें",
|
||||
"body": "नमस्ते {username},\n\nकृपया नीचे दिए गए लिंक पर क्लिक करके अपने {product_name} अकाउंट के लिए ईमेल पता वेरिफ़ाई करें:\n\n{verifyUrl}\n\nअगर आपने {product_name} अकाउंट नहीं बनाया है, तो आप इस ईमेल को बेझिझक अनदेखा कर सकते हैं।\n\nयह लिंक 24 घंटे तक मान्य है।\n\n– {product_name} टीम"
|
||||
},
|
||||
"gift_chargeback_notification": {
|
||||
"subject": "आपके रिडीम किए गए गिफ्ट से मिलने वाले पर्क हटा दिए गए हैं",
|
||||
"body": "नमस्ते {username},\n\nआपके द्वारा रिडीम किए गए एक गिफ्ट कोड का पेमेंट मूल रूप से किसी और ने किया था। वह पेमेंट तब से वापस ले लिया गया है (एक चार्जबैक)।\n\nइस वजह से, हमने वे पर्क हटा दिए हैं जो गिफ्ट रिडीम करते समय आपके अकाउंट में जोड़े गए थे।\n\nअगर आपको लगता है कि यह गलती है, तो कृपया हमारी सपोर्ट टीम से संपर्क करें और गिफ्ट कोड और उसे रिडीम करने की तारीख के बारे में जानकारी शेयर करें।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते {username},\n\nआपने जो गिफ्ट कोड रिडीम किया था, उसका पेमेंट मूल रूप से किसी और ने किया था। उस पेमेंट को बाद में वापस ले लिया गया (चार्जबैक)।\n\nइस वजह से, हमने वे पर्क हटा दिए हैं जो गिफ्ट रिडीम करते समय आपके अकाउंट में जोड़े गए थे।\n\nअगर आपको लगता है कि यह गलती है, तो कृपया हमारी सपोर्ट टीम से संपर्क करें और गिफ्ट कोड और उसे रिडीम करने के समय के बारे में आपके पास जो भी जानकारी है, वह शेयर करें।\n\n– {product_name} टीम"
|
||||
},
|
||||
"harvest_completed": {
|
||||
"subject": "आपका {product_name} डेटा एक्सपोर्ट डाउनलोड के लिए तैयार है",
|
||||
"body": "नमस्ते {username},\n\nआपका डेटा एक्सपोर्ट तैयार है।\n\nडाउनलोड लिंक:\n{downloadUrl}\n\nशामिल मैसेज: {totalMessages, number}\nफाइल साइज़: {fileSizeMB, number} MB\n\nयह लिंक {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इस एक्सपोर्ट की रिक्वेस्ट नहीं की थी, तो कृपया तुरंत अपना पासवर्ड बदलें और हमारी सपोर्ट टीम से संपर्क करें।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते {username},\n\nआपका डेटा एक्सपोर्ट तैयार है।\n\nडाउनलोड लिंक:\n{downloadUrl}\n\nशामिल मैसेज: {totalMessages, number}\nफ़ाइल साइज़: {fileSizeMB, number} MB\n\nयह लिंक {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इस एक्सपोर्ट का अनुरोध नहीं किया था, तो कृपया तुरंत अपना पासवर्ड बदलें और हमारी सपोर्ट टीम से संपर्क करें।\n\n– {product_name} टीम"
|
||||
},
|
||||
"inactivity_warning": {
|
||||
"subject": "आपका {product_name} अकाउंट इनएक्टिविटी के कारण डिलीट कर दिया जाएगा",
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट पर {lastActiveDate, date, full} के बाद से कोई एक्टिविटी नहीं हुई है।\n\nअगर आप {deletionDate, date, full} को {deletionDate, time, short} तक लॉगिन नहीं करते हैं, तो आपका अकाउंट इनएक्टिविटी के कारण हमेशा के लिए डिलीट कर दिया जाएगा।\n\nयहां लॉगिन करें:\n{loginUrl}\n\nअगर आपने हाल ही में {product_name} का इस्तेमाल किया है, तो कृपया तुरंत हमारी सपोर्ट टीम से संपर्क करें।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट पर {lastActiveDate, date, full} के बाद से कोई एक्टिविटी नहीं हुई है।\n\nअगर आप {deletionDate, date, full} को {deletionDate, time, short} तक लॉगिन नहीं करते हैं, तो आपका अकाउंट इनएक्टिविटी के कारण हमेशा के लिए डिलीट कर दिया जाएगा।\n\nयहाँ लॉगिन करें:\n{loginUrl}\n\nअगर आपने हाल ही में {product_name} का इस्तेमाल किया है, तो कृपया तुरंत हमारी सपोर्ट टीम से संपर्क करें।\n\n– {product_name} टीम"
|
||||
},
|
||||
"ip_authorization": {
|
||||
"subject": "एक नए IP एड्रेस से लॉगिन को ऑथराइज़ करें",
|
||||
"body": "नमस्ते {username},\n\nहमें एक नए IP एड्रेस से आपके {product_name} अकाउंट में लॉगिन करने का प्रयास किया गया है:\n\nIP एड्रेस: {ipAddress}\nलोकेशन: {location}\n\nअगर यह आपने ही किया था, तो कृपया नीचे दिए गए लिंक पर क्लिक करके इस IP एड्रेस को ऑथराइज़ करें:\n\n{authUrl}\n\nअगर आपने लॉगिन करने का प्रयास नहीं किया था, तो कृपया तुरंत अपना पासवर्ड बदलें।\n\nयह लिंक 30 मिनट के लिए वैलिड है।\n\n– {product_name} टीम"
|
||||
"subject": "नए IP एड्रेस से लॉगिन को ऑथराइज़ करें",
|
||||
"body": "नमस्ते {username},\n\nहमने आपके {product_name} अकाउंट में एक नए IP एड्रेस से लॉगिन का प्रयास देखा है:\n\nIP एड्रेस: {ipAddress}\nलोकेशन: {location}\n\nअगर यह आपने ही किया था, तो कृपया नीचे दिए गए लिंक पर क्लिक करके इस IP एड्रेस को ऑथराइज़ करें:\n\n{authUrl}\n\nअगर आपने लॉगिन करने का प्रयास नहीं किया था, तो कृपया तुरंत अपना पासवर्ड बदलें।\n\nयह लिंक 30 मिनट तक मान्य है।\n\n– {product_name} टीम"
|
||||
},
|
||||
"mfa_backup_codes_view": {
|
||||
"subject": "अपने {product_name} बैकअप कोड के एक्सेस की पुष्टि करें",
|
||||
"body": "नमस्ते {username},\n\nहमें आपके {product_name} अकाउंट के बैकअप कोड देखने का अनुरोध मिला है।\n\nइस अनुरोध की पुष्टि करने के लिए, ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो हो सकता है कि किसी और के पास आपके अकाउंट का एक्सेस हो। तुरंत अपना पासवर्ड बदलें।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते {username},\n\nहमें आपके {product_name} अकाउंट के बैकअप कोड देखने का अनुरोध मिला है।\n\nइस अनुरोध की पुष्टि करने के लिए, ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt, date, full} को {expiresAt, time, short} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसका अनुरोध नहीं किया था, तो हो सकता है कि किसी और के पास आपके अकाउंट का एक्सेस हो। तुरंत अपना पासवर्ड बदलें।\n\n– {product_name} टीम"
|
||||
},
|
||||
"password_change_verification": {
|
||||
"subject": "अपने {product_name} पासवर्ड चेंज की पुष्टि करें",
|
||||
"body": "नमस्ते {username},\n\nहमें आपके {product_name} अकाउंट पर पासवर्ड बदलने का अनुरोध मिला है।\n\nइस बदलाव की पुष्टि करने के लिए, ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो हो सकता है कि किसी और के पास आपके अकाउंट का एक्सेस हो। तुरंत अपना पासवर्ड बदलें और टू-फैक्टर ऑथेंटिकेशन इनेबल करें।\n\n– {product_name} टीम"
|
||||
"subject": "अपने {product_name} पासवर्ड में बदलाव की पुष्टि करें",
|
||||
"body": "नमस्ते {username},\n\nहमें आपके {product_name} अकाउंट पर पासवर्ड बदलने का अनुरोध मिला है।\n\nइस बदलाव की पुष्टि करने के लिए, ऐप में यह कोड एंटर करें:\n\n{code}\n\nयह कोड {expiresAt} पर एक्सपायर हो जाएगा।\n\nअगर आपने इसका अनुरोध नहीं किया था, तो हो सकता है कि किसी और के पास आपके अकाउंट का एक्सेस हो। तुरंत अपना पासवर्ड बदलें और टू-फ़ैक्टर ऑथेंटिकेशन इनेबल करें।\n\n– {product_name} टीम"
|
||||
},
|
||||
"password_reset": {
|
||||
"subject": "अपना {product_name} पासवर्ड रीसेट करें",
|
||||
"body": "नमस्ते {username},\n\nआपने {product_name} पासवर्ड रीसेट का अनुरोध किया है। नया पासवर्ड सेट करने के लिए नीचे दिए गए लिंक का उपयोग करें:\n\n{resetUrl}\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो आप इस ईमेल को बेझिझक अनदेखा कर सकते हैं।\n\nयह लिंक 1 घंटे के लिए वैलिड है।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते {username},\n\nआपने {product_name} पासवर्ड रीसेट का अनुरोध किया है। नया पासवर्ड सेट करने के लिए नीचे दिए गए लिंक का उपयोग करें:\n\n{resetUrl}\n\nअगर आपने इसका अनुरोध नहीं किया था, तो आप इस ईमेल को बेझिझक अनदेखा कर सकते हैं।\n\nयह लिंक 1 घंटे तक मान्य है।\n\n– {product_name} टीम"
|
||||
},
|
||||
"registration_approved": {
|
||||
"subject": "आपका {product_name} रजिस्ट्रेशन अप्रूव हो गया है",
|
||||
"body": "नमस्ते {username},\n\nअच्छी खबर: आपका {product_name} रजिस्ट्रेशन अप्रूव हो गया है।\n\nअब आप {product_name} ऐप में यहां लॉगिन कर सकते हैं:\n{channelsUrl}\n\n{product_name} कम्युनिटी में आपका स्वागत है।\n\n– {product_name} टीम"
|
||||
"body": "नमस्ते {username},\n\nअच्छी खबर: आपका {product_name} रजिस्ट्रेशन अप्रूव हो गया है।\n\nअब आप {product_name} ऐप में यहाँ लॉगिन कर सकते हैं:\n{channelsUrl}\n\n{product_name} कम्युनिटी में आपका स्वागत है।\n\n– {product_name} टीम"
|
||||
},
|
||||
"report_resolved": {
|
||||
"subject": "आपकी {product_name} रिपोर्ट का रिव्यू कर लिया गया है",
|
||||
"body": "नमस्ते {username},\n\nआपकी रिपोर्ट (ID: {reportId}) का हमारी सेफ्टी टीम ने रिव्यू कर लिया है।{hasComment, select, yes {\n\nसेफ्टी टीम का जवाब:\n{publicComment}} other {}}\n\n{product_name} को सभी के लिए सुरक्षित रखने में मदद करने के लिए धन्यवाद। हम सभी रिपोर्टों को गंभीरता से लेते हैं और कम्युनिटी में आपके योगदान के लिए आभार व्यक्त करते हैं।\n\nअगर आपको इस परिणाम के बारे में कोई प्रश्न या चिंता है, तो कृपया {safety_email} पर संपर्क करें।\n\n– {product_name} सेफ्टी टीम"
|
||||
"body": "नमस्ते {username},\n\nआपकी रिपोर्ट (ID: {reportId}) का हमारी सेफ्टी टीम ने रिव्यू कर लिया है।{hasComment, select, yes {\n\nसेफ्टी टीम का जवाब:\n{publicComment}} other {}}\n\n{product_name} को सभी के लिए सुरक्षित रखने में मदद करने के लिए धन्यवाद। हम हर रिपोर्ट को गंभीरता से लेते हैं और कम्युनिटी में आपके योगदान की सराहना करते हैं।\n\nअगर आपको इस नतीजे के बारे में कोई सवाल या चिंता है, तो कृपया {safety_email} पर संपर्क करें।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"scheduled_deletion_notification": {
|
||||
"subject": "आपका {product_name} अकाउंट हमेशा के लिए डिलीट कर दिया जाएगा",
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट को हमेशा के लिए डिलीट करने के लिए शेड्यूल किया गया है।\n\nडिलीशन शेड्यूल: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nयह एक गंभीर कदम है। आपके अकाउंट का डेटा निर्धारित तारीख पर हमेशा के लिए डिलीट कर दिया जाएगा।\n\nअगर आपको लगता है कि यह निर्णय गलत था, तो आप अपील सबमिट कर सकते हैं। इस ईमेल एड्रेस से {appeals_email} पर ईमेल करें।\n\n– {product_name} सेफ्टी टीम"
|
||||
"body": "नमस्ते {username},\n\nआपके {product_name} अकाउंट को हमेशा के लिए डिलीट करने के लिए शेड्यूल किया गया है।\n\nडिलीशन की निर्धारित तारीख: {deletionDate, date, full} {deletionDate, time, short}\n\n{reason, select,\n null {}\n other {वजह: {reason}}\n}\n\nयह एक गंभीर कार्रवाई है। आपके अकाउंट का डेटा निर्धारित तारीख पर हमेशा के लिए डिलीट कर दिया जाएगा।\n\nअगर आपको लगता है कि यह फैसला गलत था, तो आप अपील सबमिट कर सकते हैं। इस ईमेल पते से {appeals_email} पर ईमेल करें।\n\n– {product_name} सेफ्टी टीम"
|
||||
},
|
||||
"self_deletion_scheduled": {
|
||||
"subject": "आपके {product_name} अकाउंट डिलीशन को शेड्यूल किया गया है",
|
||||
"body": "नमस्ते {username},\n\nआपने अपना {product_name} अकाउंट डिलीट करने का अनुरोध किया है। आपका अकाउंट हमेशा के लिए डिलीट करने के लिए इस तारीख को शेड्यूल किया गया है:\n\n{deletionDate, date, full} को {deletionDate, time, short} पर\n\nअगर आपने इसकी रिक्वेस्ट नहीं की थी, तो डिलीशन रद्द करने के लिए अपने अकाउंट में साइन इन करें। हम आपके अकाउंट को सुरक्षित करने के लिए अपना पासवर्ड बदलने की भी सलाह देते हैं।\n\n– {product_name} टीम"
|
||||
"subject": "आपके {product_name} अकाउंट का डिलीशन शेड्यूल कर दिया गया है",
|
||||
"body": "नमस्ते {username},\n\nआपने अपना {product_name} अकाउंट डिलीट करने का अनुरोध किया है। आपके अकाउंट को हमेशा के लिए डिलीट करने के लिए शेड्यूल कर दिया गया है:\n\n{deletionDate, date, full} को {deletionDate, time, short} पर\n\nअगर आपने इसका अनुरोध नहीं किया था, तो डिलीशन रद्द करने के लिए अपने अकाउंट में साइन इन करें। हम आपके अकाउंट को सुरक्षित करने के लिए अपना पासवर्ड बदलने की भी सलाह देते हैं।\n\n– {product_name} टीम"
|
||||
},
|
||||
"unban_notification": {
|
||||
"subject": "आपके {product_name} अकाउंट का सस्पेंशन हटा दिया गया है",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user