Skip to content

Open source CapCut alternative.

TypeScript

refactor(site): hand email and background jobs to the back office

David Le38d35ad84df3
diff --git a/docs/guides/config-and-experiments.md b/docs/guides/config-and-experiments.md
index 79f089f4..a013c6d3 100644
--- a/docs/guides/config-and-experiments.md
+++ b/docs/guides/config-and-experiments.md
@@ -126,7 +126,7 @@ by variant as well.
## Promotions
A promotion is one email to an audience, minus anyone an earlier promotion reached; the Pro offers behind it (subscribe bonus, allowance multiplier) are settings. A copy sent to one person by hand carries the same per-person outbox key, so it counts in the promotion and a later segment send skips them.
-Every outbound email is a row in one outbox, sent by one drainer in priority order under the email plan's monthly allowance, shared by the whole site. A promotion is read from the accounts table a page at a time by a job, queues its most recently active recipients first, and stops at what the rest of the billing cycle is forecast to need for welcome and credit emails, and for mail sent by hand on the work days left, then picks up the slots that go unused as the cycle runs down. The allowance, the renewal day, the reserves and the work hours are the Email send budget setting, and the order between kinds is the Email priorities setting.
+Promotions, like every other email and background job, are written, queued and sent by the back office: a separate deployment that shares this database. This site holds the settings that shape the offers and the claim flow that lands them.
A credit promotion is a credit offer: one row that promises an account an
amount, the credit's life, and the window it can be claimed in, then records
@@ -155,5 +155,5 @@ The framework is the abexp package under the site's packages folder: registry
shape and resolution, audience, assignment, the experiment schema, and the
statistics and verdict, with no host code inside. The site binds it in its
config library, which holds the product's registry, collects the audience
-facts, and stores assignments; the results job sits with the other background
-jobs.
+facts, and stores assignments; the results job runs in the back office with
+the other background jobs.
diff --git a/site/.env.example b/site/.env.example
index a988856f..0fea43d5 100644
--- a/site/.env.example
+++ b/site/.env.example
@@ -47,26 +47,6 @@ STRIPE_WEBHOOK_SECRET="replace-with-stripe-webhook-signing-secret"
STRIPE_PRO_PRICE_ID="replace-with-stripe-pro-price-id"
STRIPE_PORTAL_CONFIGURATION_ID="replace-with-stripe-portal-configuration-id"
-# Resend (email sending). Unset in dev skips email work: signups log the skip
-# and provision everything else. RESEND_WEBHOOK_SECRET signs the
-# email.received webhook at /api/email/resend-webhook, from the endpoint's
-# page in the Resend dashboard.
-RESEND_API_KEY="replace-with-resend-api-key"
-RESEND_WEBHOOK_SECRET="replace-with-resend-webhook-signing-secret"
-# The sending identity, on the Resend-verified domain.
-RESEND_FROM_EMAIL="Sender Name <[email protected]>"
-# The sender for list mail — the welcome email and promotions — on a
-# Resend-verified subdomain. A mail provider keeps one reputation record per
-# signing domain, so bulk sends get their own and the apex above stays the
-# address a person writes from. Unset falls back to RESEND_FROM_EMAIL.
-RESEND_BULK_FROM_EMAIL="Sender Name <[email protected]>"
-# Where a reply to an outreach note is forwarded so it can be answered from a
-# normal inbox, with the user's own address as the reply-to. A bare address —
-# it is a recipient, not a sending identity. Unset skips the forward; the row
-# is still marked replied. Needs the reply subdomain set up as a Resend
-# receiving domain and email.received enabled on the webhook.
-RESEND_INBOX_EMAIL="[email protected]"
-
# PostHog analytics (client-side project key; public by design, inlined at build).
# Leave unset to disable tracking (e.g. local dev).
NEXT_PUBLIC_POSTHOG_KEY="replace-with-posthog-project-key"
diff --git a/site/.gitignore b/site/.gitignore
index 3bc6738d..e468de75 100644
--- a/site/.gitignore
+++ b/site/.gitignore
@@ -40,9 +40,6 @@ yarn-error.log*
# vercel
.vercel
-# react-email preview workspace (npm run email:dev)
-.react-email/
-
# typescript
*.tsbuildinfo
next-env.d.ts
diff --git a/site/package-lock.json b/site/package-lock.json
index c228f59f..06b8552f 100644
--- a/site/package-lock.json
+++ b/site/package-lock.json
@@ -110,15 +110,12 @@
"posthog-js": "^1.428.5",
"react": "19.2.4",
"react-dom": "19.2.4",
- "react-email": "^6.9.1",
"react-markdown": "^10.1.0",
"remark-gfm": "^4.0.1",
- "resend": "^6.18.1",
"shadcn": "^4.7.0",
"sharp": "^0.35.4",
"skia-canvas": "^3.0.8",
"stripe": "^22.2.0",
- "svix": "^1.99.1",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"zod": "^4.4.3",
@@ -126,7 +123,6 @@
},
"devDependencies": {
"@cloudflare/containers": "^0.3.7",
- "@react-email/ui": "^6.9.1",
"@tailwindcss/postcss": "^4",
"@types/node": "^24.13.3",
"@types/pg": "^8.20.0",
@@ -1952,884 +1948,468 @@
"tslib": "^2.4.0"
}
},
- "node_modules/@esbuild/aix-ppc64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
- "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
- "cpu": [
- "ppc64"
- ],
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.9.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
+ "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",
+ "dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "aix"
- ],
+ "dependencies": {
+ "eslint-visitor-keys": "^3.4.3"
+ },
"engines": {
- "node": ">=18"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
}
},
- "node_modules/@esbuild/android-arm": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
- "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
- "cpu": [
- "arm"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
+ "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "dev": true,
+ "license": "Apache-2.0",
"engines": {
- "node": ">=18"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/@esbuild/android-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
- "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
- "cpu": [
- "arm64"
- ],
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.12.2",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
+ "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
+ "dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
"engines": {
- "node": ">=18"
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
- "node_modules/@esbuild/android-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
- "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
+ "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/object-schema": "^2.1.7",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.5"
+ },
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@esbuild/darwin-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
- "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0"
+ },
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@esbuild/darwin-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
- "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
+ "node_modules/@eslint/core": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/json-schema": "^7.0.15"
+ },
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@esbuild/freebsd-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
- "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
- "cpu": [
- "arm64"
- ],
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.3.5",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz",
+ "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==",
+ "dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
+ "dependencies": {
+ "ajv": "^6.14.0",
+ "debug": "^4.3.2",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.1",
+ "minimatch": "^3.1.5",
+ "strip-json-comments": "^3.1.1"
+ },
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/@esbuild/freebsd-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
- "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
- "cpu": [
- "x64"
- ],
+ "node_modules/@eslint/js": {
+ "version": "9.39.4",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz",
+ "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==",
+ "dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
}
},
- "node_modules/@esbuild/linux-arm": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
- "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
- "cpu": [
- "arm"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
+ "dev": true,
+ "license": "Apache-2.0",
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@esbuild/linux-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
- "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0",
+ "levn": "^0.4.1"
+ },
"engines": {
- "node": ">=18"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@esbuild/linux-ia32": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
- "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
- "cpu": [
- "ia32"
- ],
+ "node_modules/@fidm/asn1": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@fidm/asn1/-/asn1-1.0.4.tgz",
+ "integrity": "sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==",
"license": "MIT",
"optional": true,
- "os": [
- "linux"
- ],
"engines": {
- "node": ">=18"
+ "node": ">= 8"
}
},
- "node_modules/@esbuild/linux-loong64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
- "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
- "cpu": [
- "loong64"
- ],
+ "node_modules/@fidm/x509": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@fidm/x509/-/x509-1.2.1.tgz",
+ "integrity": "sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==",
"license": "MIT",
"optional": true,
- "os": [
- "linux"
- ],
+ "dependencies": {
+ "@fidm/asn1": "^1.0.4",
+ "tweetnacl": "^1.0.1"
+ },
"engines": {
- "node": ">=18"
+ "node": ">= 8"
}
},
- "node_modules/@esbuild/linux-mips64el": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
- "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
- "cpu": [
- "mips64el"
- ],
+ "node_modules/@floating-ui/core": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
+ "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",
"license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
+ "dependencies": {
+ "@floating-ui/utils": "^0.2.12"
}
},
- "node_modules/@esbuild/linux-ppc64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
- "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
- "cpu": [
- "ppc64"
- ],
+ "node_modules/@floating-ui/dom": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz",
+ "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",
"license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
+ "dependencies": {
+ "@floating-ui/core": "^1.8.0",
+ "@floating-ui/utils": "^0.2.12"
}
},
- "node_modules/@esbuild/linux-riscv64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
- "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
- "cpu": [
- "riscv64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-s390x": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
- "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
- "cpu": [
- "s390x"
- ],
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz",
+ "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==",
"license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
+ "dependencies": {
+ "@floating-ui/dom": "^1.8.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
}
},
- "node_modules/@esbuild/linux-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
- "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@floating-ui/utils": {
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz",
+ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
+ "license": "MIT"
+ },
+ "node_modules/@fontsource/amatic-sc": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/amatic-sc/-/amatic-sc-5.3.0.tgz",
+ "integrity": "sha512-qGAftmq7o21ViixCApztfLOe6TP0VFp3x9ac5KVTwBqW6SU8YJeGWgcLHOfBkooAI+/411R/flMqXos8GseNkA==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/netbsd-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
- "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/anton": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/anton/-/anton-5.3.0.tgz",
+ "integrity": "sha512-OR1D5n124n2XRs66SbX7IjcOSptljEJE8FcDNnlni2y1/M6KpTx7cU2PIWzTSsBj4WFkHPw24On8qw3qkQZuTw==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/netbsd-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
- "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/archivo-black": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/archivo-black/-/archivo-black-5.3.0.tgz",
+ "integrity": "sha512-7EsTIQ+Blf96ktpzTUpI7msi+u9/AJxM/GZxOSkEubVd1jSTrFSTNxMgfpX/8rQsjZ+19a+qvRbtcTEp5J/72g==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/openbsd-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
- "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/bangers": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/bangers/-/bangers-5.3.0.tgz",
+ "integrity": "sha512-tSRpmWwkqrO9PCqo9wjA/99/5sLOIWm5cf51G3ooEHd8qZus8sVSSJoWp/7EvM5rIgZMjKRG6XtY9yeisKxE7g==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/openbsd-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
- "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/bebas-neue": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/bebas-neue/-/bebas-neue-5.3.0.tgz",
+ "integrity": "sha512-nCxMEb9Bg9sjNWm9TIOsvHKDMLRUfEZPWpLgYu6m9KavZZVSA/WoHzI5wROwqA+eNwEi/PNBAcB5Co7HA3S0Cw==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/openharmony-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
- "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "openharmony"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/caveat": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/caveat/-/caveat-5.3.0.tgz",
+ "integrity": "sha512-eHTfzQxFSW9ABERRLNruHoNJmKed2J7pqTUc5lp4a4POMgXGKpxmWj3d9Hz10kmAg6iuTTLe6UagbA4bnsmfQw==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/sunos-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
- "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "sunos"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/chewy": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/chewy/-/chewy-5.3.0.tgz",
+ "integrity": "sha512-9p1c7sTqudOEP3RFbcI0h4r3Mq5+Atr6VBF70LGFegU0FAOt63asVt5ufBlojPF5+YFbSqq5iXjRdNt+k2l+2A==",
+ "license": "Apache-2.0",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/win32-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
- "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/cinzel": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/cinzel/-/cinzel-5.3.0.tgz",
+ "integrity": "sha512-KEOYTsrRppW0uRIPWBDPrQgunCS6f8u4nzZxYRBfo9SCknKojLYjK7B0ZoVmJhyVLefz271ZQRF9EOpHZlfhRw==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/win32-ia32": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
- "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
- "cpu": [
- "ia32"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/dm-serif-display": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/dm-serif-display/-/dm-serif-display-5.3.0.tgz",
+ "integrity": "sha512-ecRclUcYeto9fB7ghkB36H4MtUoaUYFjjornWYYeLCMHzaWEDPk2kIWgZOq0mKBNRxclRSieKcFeLonlMYDTKg==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@esbuild/win32-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
- "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
+ "node_modules/@fontsource/dseg14-classic": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/dseg14-classic/-/dseg14-classic-5.3.0.tgz",
+ "integrity": "sha512-UTHoHDxGQfWijJo26Co5hxoJoJvCoqJGryMELi9wgJtephHwt+Nh2NQ6kyeXAC7hQIlxFLcMj7aiAtbdsa2sow==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.9.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
- "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "eslint-visitor-keys": "^3.4.3"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
+ "node_modules/@fontsource/freckle-face": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/freckle-face/-/freckle-face-5.3.0.tgz",
+ "integrity": "sha512-QfcMzGfaXBsGBxJr2C83EmRgmD16oAPJOM/U6HkoY8D/wmt5L5YE1lp+mxjZKEKx3ey/SNy0jItt/scr0AOGHQ==",
+ "license": "OFL-1.1",
"funding": {
- "url": "https://opencollective.com/eslint"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
- "dev": true,
- "license": "Apache-2.0",
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
+ "node_modules/@fontsource/fredoka": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/fredoka/-/fredoka-5.3.0.tgz",
+ "integrity": "sha512-s2IhjQ50wDnKkkaKmjhtL0rxQg6ITsVusiipM3m7zUwVZZbbCKsscNDkngwp28xVzfIt7neWrkgU1qKqyTycQg==",
+ "license": "OFL-1.1",
"funding": {
- "url": "https://opencollective.com/eslint"
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@eslint-community/regexpp": {
- "version": "4.12.2",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
- "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ "node_modules/@fontsource/gloria-hallelujah": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/gloria-hallelujah/-/gloria-hallelujah-5.3.0.tgz",
+ "integrity": "sha512-U4gt7qqWGn4bysvZZ9BBv8dlRzb11dFUMV8t7xQg26th2zPou/obRjR7MlxeTvVxYd1geWnvZAJprh/bQOG3dw==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@eslint/config-array": {
- "version": "0.21.2",
- "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
- "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@eslint/object-schema": "^2.1.7",
- "debug": "^4.3.1",
- "minimatch": "^3.1.5"
- },
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@eslint/config-helpers": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
- "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@eslint/core": "^0.17.0"
- },
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@eslint/core": {
- "version": "0.17.0",
- "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
- "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@types/json-schema": "^7.0.15"
- },
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@eslint/eslintrc": {
- "version": "3.3.5",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz",
- "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "ajv": "^6.14.0",
- "debug": "^4.3.2",
- "espree": "^10.0.1",
- "globals": "^14.0.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.1",
- "minimatch": "^3.1.5",
- "strip-json-comments": "^3.1.1"
- },
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/@eslint/js": {
- "version": "9.39.4",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz",
- "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- },
+ "node_modules/@fontsource/great-vibes": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/great-vibes/-/great-vibes-5.3.0.tgz",
+ "integrity": "sha512-1w60cXzXnC9V4y943po8044O1mqRQBiTTK75h7OpZE+1VQtx+KlAAzoIyEE5KNzu05gUpxaCQg7cbL7ITSwegQ==",
+ "license": "OFL-1.1",
"funding": {
- "url": "https://eslint.org/donate"
- }
- },
- "node_modules/@eslint/object-schema": {
- "version": "2.1.7",
- "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
- "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
- "dev": true,
- "license": "Apache-2.0",
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@eslint/plugin-kit": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
- "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@eslint/core": "^0.17.0",
- "levn": "^0.4.1"
- },
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@fidm/asn1": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@fidm/asn1/-/asn1-1.0.4.tgz",
- "integrity": "sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==",
- "license": "MIT",
- "optional": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@fidm/x509": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@fidm/x509/-/x509-1.2.1.tgz",
- "integrity": "sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@fidm/asn1": "^1.0.4",
- "tweetnacl": "^1.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@floating-ui/core": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
- "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/utils": "^0.2.12"
- }
- },
- "node_modules/@floating-ui/dom": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz",
- "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/core": "^1.8.0",
- "@floating-ui/utils": "^0.2.12"
- }
- },
- "node_modules/@floating-ui/react-dom": {
- "version": "2.1.9",
- "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz",
- "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/dom": "^1.8.0"
- },
- "peerDependencies": {
- "react": ">=16.8.0",
- "react-dom": ">=16.8.0"
+ "url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@floating-ui/utils": {
- "version": "0.2.12",
- "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz",
- "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
- "license": "MIT"
- },
- "node_modules/@fontsource/amatic-sc": {
+ "node_modules/@fontsource/inter": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/amatic-sc/-/amatic-sc-5.3.0.tgz",
- "integrity": "sha512-qGAftmq7o21ViixCApztfLOe6TP0VFp3x9ac5KVTwBqW6SU8YJeGWgcLHOfBkooAI+/411R/flMqXos8GseNkA==",
+ "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.3.0.tgz",
+ "integrity": "sha512-RofMylZmjlJEfELXeNHFWBRcSs75rGU/6bV2S2jfnvv/3rPXPGe0LgUJTklcHZ9lM4OZmAVFhcJPnACfb91A3g==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/anton": {
+ "node_modules/@fontsource/jost": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/anton/-/anton-5.3.0.tgz",
- "integrity": "sha512-OR1D5n124n2XRs66SbX7IjcOSptljEJE8FcDNnlni2y1/M6KpTx7cU2PIWzTSsBj4WFkHPw24On8qw3qkQZuTw==",
+ "resolved": "https://registry.npmjs.org/@fontsource/jost/-/jost-5.3.0.tgz",
+ "integrity": "sha512-lORv5y49hSoLVxjGb0qNuBzXvnaNYI3B94200uGPGJFei8fao6d6LLz2ziWbOZubGfZnibzuT6GVNX8fBw8WQQ==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/archivo-black": {
+ "node_modules/@fontsource/kaushan-script": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/archivo-black/-/archivo-black-5.3.0.tgz",
- "integrity": "sha512-7EsTIQ+Blf96ktpzTUpI7msi+u9/AJxM/GZxOSkEubVd1jSTrFSTNxMgfpX/8rQsjZ+19a+qvRbtcTEp5J/72g==",
+ "resolved": "https://registry.npmjs.org/@fontsource/kaushan-script/-/kaushan-script-5.3.0.tgz",
+ "integrity": "sha512-Kdcvr76wOGp2jgKkkmAOETmPcw/a34RU/qcGW2+gSKzkKyr03vEaLWSbSABoVKWuyuoqWoulcmC4571vq3BYvg==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/bangers": {
+ "node_modules/@fontsource/lobster": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/bangers/-/bangers-5.3.0.tgz",
- "integrity": "sha512-tSRpmWwkqrO9PCqo9wjA/99/5sLOIWm5cf51G3ooEHd8qZus8sVSSJoWp/7EvM5rIgZMjKRG6XtY9yeisKxE7g==",
+ "resolved": "https://registry.npmjs.org/@fontsource/lobster/-/lobster-5.3.0.tgz",
+ "integrity": "sha512-jt+RDk/8Sstl1Omhox62gTbvRSLbh06kn5BNfDFgf4rNuDPHF+19eWYFxzq5FsdkalbRJNtc5p5C3qE0+leNVg==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/bebas-neue": {
+ "node_modules/@fontsource/montserrat": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/bebas-neue/-/bebas-neue-5.3.0.tgz",
- "integrity": "sha512-nCxMEb9Bg9sjNWm9TIOsvHKDMLRUfEZPWpLgYu6m9KavZZVSA/WoHzI5wROwqA+eNwEi/PNBAcB5Co7HA3S0Cw==",
+ "resolved": "https://registry.npmjs.org/@fontsource/montserrat/-/montserrat-5.3.0.tgz",
+ "integrity": "sha512-iQPDtZOnmM5ih4JBGaMSXisRap0ixb9bAUw2hDtY7EjVfaqiiNlKtVuJl9XclxUwtwMMHNcWXfQR6zI9x05+Tg==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/caveat": {
+ "node_modules/@fontsource/noto-serif": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/caveat/-/caveat-5.3.0.tgz",
- "integrity": "sha512-eHTfzQxFSW9ABERRLNruHoNJmKed2J7pqTUc5lp4a4POMgXGKpxmWj3d9Hz10kmAg6iuTTLe6UagbA4bnsmfQw==",
+ "resolved": "https://registry.npmjs.org/@fontsource/noto-serif/-/noto-serif-5.3.0.tgz",
+ "integrity": "sha512-ZrMzjuQlBIcw+qma1slZQdU3YDJvrjLG+9CWU1bxSf3YTkucwqd3EYa/Kfo4Ts19w8IMTGAmtOE3d6wWlgnBtA==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/chewy": {
+ "node_modules/@fontsource/nunito": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/chewy/-/chewy-5.3.0.tgz",
- "integrity": "sha512-9p1c7sTqudOEP3RFbcI0h4r3Mq5+Atr6VBF70LGFegU0FAOt63asVt5ufBlojPF5+YFbSqq5iXjRdNt+k2l+2A==",
- "license": "Apache-2.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/nunito/-/nunito-5.3.0.tgz",
+ "integrity": "sha512-vw9TaTQJ/zpEpKrsODuPmOvaVjXgdda6B+xXA4YqjrdeJ62MLgVoDerdRXFQHyBnSCt2yQ2nHKCHPP/Pv7Xq4Q==",
+ "license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/cinzel": {
+ "node_modules/@fontsource/oranienbaum": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/cinzel/-/cinzel-5.3.0.tgz",
- "integrity": "sha512-KEOYTsrRppW0uRIPWBDPrQgunCS6f8u4nzZxYRBfo9SCknKojLYjK7B0ZoVmJhyVLefz271ZQRF9EOpHZlfhRw==",
+ "resolved": "https://registry.npmjs.org/@fontsource/oranienbaum/-/oranienbaum-5.3.0.tgz",
+ "integrity": "sha512-AB9D7JTbWUceEExPfGMn4gaJ3a9wb4F60ijNQIB2xPILgSjXlyonCHGqCmjfxRZmuK5yaF0blFmU3sNrIx82Qg==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/dm-serif-display": {
+ "node_modules/@fontsource/orbitron": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/dm-serif-display/-/dm-serif-display-5.3.0.tgz",
- "integrity": "sha512-ecRclUcYeto9fB7ghkB36H4MtUoaUYFjjornWYYeLCMHzaWEDPk2kIWgZOq0mKBNRxclRSieKcFeLonlMYDTKg==",
+ "resolved": "https://registry.npmjs.org/@fontsource/orbitron/-/orbitron-5.3.0.tgz",
+ "integrity": "sha512-+BhPsbUAo/AF7sRcf+TEexm+EWWkgTiR9Zwb7AhYIPkc5oplfvw0C45Oc2xlKPhwVEmxG8hHuA6/Ansbl+Bc6w==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/dseg14-classic": {
+ "node_modules/@fontsource/oswald": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/dseg14-classic/-/dseg14-classic-5.3.0.tgz",
- "integrity": "sha512-UTHoHDxGQfWijJo26Co5hxoJoJvCoqJGryMELi9wgJtephHwt+Nh2NQ6kyeXAC7hQIlxFLcMj7aiAtbdsa2sow==",
+ "resolved": "https://registry.npmjs.org/@fontsource/oswald/-/oswald-5.3.0.tgz",
+ "integrity": "sha512-16r2aHActe0pH+9FLdk/74/YxXM7HpGak05kAzx3RvSToiJwGvyhv6GvckPz+YuZmvL1nxWbEop2jAXRcXYPRg==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/freckle-face": {
+ "node_modules/@fontsource/outfit": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/freckle-face/-/freckle-face-5.3.0.tgz",
- "integrity": "sha512-QfcMzGfaXBsGBxJr2C83EmRgmD16oAPJOM/U6HkoY8D/wmt5L5YE1lp+mxjZKEKx3ey/SNy0jItt/scr0AOGHQ==",
+ "resolved": "https://registry.npmjs.org/@fontsource/outfit/-/outfit-5.3.0.tgz",
+ "integrity": "sha512-0AVHzTTVJSxWDOxPKSfMeHhZeBFDU3cmgrcOb76ZEyhGo0+xgyG3GsLF3h9+X8w0IX7G4jzjJgFQEBiWdX6VgA==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/fredoka": {
+ "node_modules/@fontsource/pacifico": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/fredoka/-/fredoka-5.3.0.tgz",
- "integrity": "sha512-s2IhjQ50wDnKkkaKmjhtL0rxQg6ITsVusiipM3m7zUwVZZbbCKsscNDkngwp28xVzfIt7neWrkgU1qKqyTycQg==",
+ "resolved": "https://registry.npmjs.org/@fontsource/pacifico/-/pacifico-5.3.0.tgz",
+ "integrity": "sha512-bWv0fHR1n36p7scRn+maaEaVeQCOq9yvfVfjyAeUzKrK4Y/3qiRAEj4hJgfxj/sjgZZGkeHyKPrbWdDaZtpCVw==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/gloria-hallelujah": {
+ "node_modules/@fontsource/permanent-marker": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/gloria-hallelujah/-/gloria-hallelujah-5.3.0.tgz",
- "integrity": "sha512-U4gt7qqWGn4bysvZZ9BBv8dlRzb11dFUMV8t7xQg26th2zPou/obRjR7MlxeTvVxYd1geWnvZAJprh/bQOG3dw==",
- "license": "OFL-1.1",
+ "resolved": "https://registry.npmjs.org/@fontsource/permanent-marker/-/permanent-marker-5.3.0.tgz",
+ "integrity": "sha512-ZO/NtYW4SCc/iY8N3dmjWyDITcXJ/vhWZFgnwRcvzwCKKnScMrM/a2/6VHlsjCVuIgmPzNrCFbedEYhv+/jJBg==",
+ "license": "Apache-2.0",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/great-vibes": {
+ "node_modules/@fontsource/playfair-display": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/great-vibes/-/great-vibes-5.3.0.tgz",
- "integrity": "sha512-1w60cXzXnC9V4y943po8044O1mqRQBiTTK75h7OpZE+1VQtx+KlAAzoIyEE5KNzu05gUpxaCQg7cbL7ITSwegQ==",
+ "resolved": "https://registry.npmjs.org/@fontsource/playfair-display/-/playfair-display-5.3.0.tgz",
+ "integrity": "sha512-uJSABalvdWc10fEPppQjQocamT21LEyRfzzWfRfqbkPz+sRv+kKpYDKyluBUskvJREkJTos9epj1WjQROGu99Q==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
- "node_modules/@fontsource/inter": {
+ "node_modules/@fontsource/poppins": {
"version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.3.0.tgz",
- "integrity": "sha512-RofMylZmjlJEfELXeNHFWBRcSs75rGU/6bV2S2jfnvv/3rPXPGe0LgUJTklcHZ9lM4OZmAVFhcJPnACfb91A3g==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/jost": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/jost/-/jost-5.3.0.tgz",
- "integrity": "sha512-lORv5y49hSoLVxjGb0qNuBzXvnaNYI3B94200uGPGJFei8fao6d6LLz2ziWbOZubGfZnibzuT6GVNX8fBw8WQQ==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/kaushan-script": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/kaushan-script/-/kaushan-script-5.3.0.tgz",
- "integrity": "sha512-Kdcvr76wOGp2jgKkkmAOETmPcw/a34RU/qcGW2+gSKzkKyr03vEaLWSbSABoVKWuyuoqWoulcmC4571vq3BYvg==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/lobster": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/lobster/-/lobster-5.3.0.tgz",
- "integrity": "sha512-jt+RDk/8Sstl1Omhox62gTbvRSLbh06kn5BNfDFgf4rNuDPHF+19eWYFxzq5FsdkalbRJNtc5p5C3qE0+leNVg==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/montserrat": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/montserrat/-/montserrat-5.3.0.tgz",
- "integrity": "sha512-iQPDtZOnmM5ih4JBGaMSXisRap0ixb9bAUw2hDtY7EjVfaqiiNlKtVuJl9XclxUwtwMMHNcWXfQR6zI9x05+Tg==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/noto-serif": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/noto-serif/-/noto-serif-5.3.0.tgz",
- "integrity": "sha512-ZrMzjuQlBIcw+qma1slZQdU3YDJvrjLG+9CWU1bxSf3YTkucwqd3EYa/Kfo4Ts19w8IMTGAmtOE3d6wWlgnBtA==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/nunito": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/nunito/-/nunito-5.3.0.tgz",
- "integrity": "sha512-vw9TaTQJ/zpEpKrsODuPmOvaVjXgdda6B+xXA4YqjrdeJ62MLgVoDerdRXFQHyBnSCt2yQ2nHKCHPP/Pv7Xq4Q==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/oranienbaum": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/oranienbaum/-/oranienbaum-5.3.0.tgz",
- "integrity": "sha512-AB9D7JTbWUceEExPfGMn4gaJ3a9wb4F60ijNQIB2xPILgSjXlyonCHGqCmjfxRZmuK5yaF0blFmU3sNrIx82Qg==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/orbitron": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/orbitron/-/orbitron-5.3.0.tgz",
- "integrity": "sha512-+BhPsbUAo/AF7sRcf+TEexm+EWWkgTiR9Zwb7AhYIPkc5oplfvw0C45Oc2xlKPhwVEmxG8hHuA6/Ansbl+Bc6w==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/oswald": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/oswald/-/oswald-5.3.0.tgz",
- "integrity": "sha512-16r2aHActe0pH+9FLdk/74/YxXM7HpGak05kAzx3RvSToiJwGvyhv6GvckPz+YuZmvL1nxWbEop2jAXRcXYPRg==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/outfit": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/outfit/-/outfit-5.3.0.tgz",
- "integrity": "sha512-0AVHzTTVJSxWDOxPKSfMeHhZeBFDU3cmgrcOb76ZEyhGo0+xgyG3GsLF3h9+X8w0IX7G4jzjJgFQEBiWdX6VgA==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/pacifico": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/pacifico/-/pacifico-5.3.0.tgz",
- "integrity": "sha512-bWv0fHR1n36p7scRn+maaEaVeQCOq9yvfVfjyAeUzKrK4Y/3qiRAEj4hJgfxj/sjgZZGkeHyKPrbWdDaZtpCVw==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/permanent-marker": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/permanent-marker/-/permanent-marker-5.3.0.tgz",
- "integrity": "sha512-ZO/NtYW4SCc/iY8N3dmjWyDITcXJ/vhWZFgnwRcvzwCKKnScMrM/a2/6VHlsjCVuIgmPzNrCFbedEYhv+/jJBg==",
- "license": "Apache-2.0",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/playfair-display": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/playfair-display/-/playfair-display-5.3.0.tgz",
- "integrity": "sha512-uJSABalvdWc10fEPppQjQocamT21LEyRfzzWfRfqbkPz+sRv+kKpYDKyluBUskvJREkJTos9epj1WjQROGu99Q==",
- "license": "OFL-1.1",
- "funding": {
- "url": "https://github.com/sponsors/ayuhito"
- }
- },
- "node_modules/@fontsource/poppins": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@fontsource/poppins/-/poppins-5.3.0.tgz",
- "integrity": "sha512-cms1nM7U6SN8epIV1WMVOV8VsA645aSm3wHfzIQnkk188U341ThbJGSl2Sv54V29gnDbT2arMPfLzvVIIVCceQ==",
+ "resolved": "https://registry.npmjs.org/@fontsource/poppins/-/poppins-5.3.0.tgz",
+ "integrity": "sha512-cms1nM7U6SN8epIV1WMVOV8VsA645aSm3wHfzIQnkk188U341ThbJGSl2Sv54V29gnDbT2arMPfLzvVIIVCceQ==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
@@ -5031,1059 +4611,193 @@
"node_modules/@protobufjs/eventemitter": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",
- "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/fetch": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",
- "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",
- "license": "BSD-3-Clause",
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1"
- }
- },
- "node_modules/@protobufjs/float": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/inquire": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz",
- "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/path": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/pool": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/utf8": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz",
- "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@radix-ui/primitive": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz",
- "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==",
- "devOptional": true,
- "license": "MIT"
- },
- "node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
- "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
- "devOptional": true,
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-primitive": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz",
- "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==",
- "devOptional": true,
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "devOptional": true,
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-toggle": {
- "version": "1.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz",
- "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==",
- "devOptional": true,
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz",
- "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==",
- "devOptional": true,
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-effect-event": "0.0.2",
- "@radix-ui/react-use-layout-effect": "1.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz",
- "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==",
- "devOptional": true,
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
- "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==",
- "devOptional": true,
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@react-email/render": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@react-email/render/-/render-2.1.0.tgz",
- "integrity": "sha512-F+zE3O6d6sW6Aj2UjvZAA17R7tJKM7kcq2mgV6k4HCT8jeLLFaVP2txMtH1lgqYFRMZ0Gxsd37q2PRyiXLXXxA==",
- "license": "MIT",
- "dependencies": {
- "entities": "^4.5.0",
- "html-to-text": "^9.0.5",
- "html5parser": "^3.0.0",
- "prettier": "^3.5.3"
- },
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/ui": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@react-email/ui/-/ui-6.9.1.tgz",
- "integrity": "sha512-zw7KvwMu3RU/fDC9TAkegg9/qNV9foJtd3QRoetdWVFe8aQC/NyXmWTrG9IrkzVLzn5otkkxu7e7B1QelcwdiQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "esbuild": "0.28.1",
- "next": "16.2.6"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-darwin-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
- "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-darwin-arm64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-darwin-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",
- "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-darwin-x64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-darwin-arm64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
- "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "darwin"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-darwin-x64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",
- "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "darwin"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linux-arm": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",
- "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linux-arm64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",
- "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linux-ppc64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",
- "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linux-riscv64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",
- "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linux-s390x": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",
- "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linux-x64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",
- "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linuxmusl-arm64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",
- "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "libc": [
- "musl"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-libvips-linuxmusl-x64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",
- "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "libc": [
- "musl"
- ],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linux-arm": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",
- "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-arm": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linux-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",
- "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-arm64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linux-ppc64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",
- "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-ppc64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linux-riscv64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",
- "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-riscv64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linux-s390x": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",
- "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-s390x": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linux-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",
- "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-x64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linuxmusl-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",
- "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "libc": [
- "musl"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-linuxmusl-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",
- "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "libc": [
- "musl"
- ],
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-x64": "1.2.4"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-wasm32": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",
- "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",
- "cpu": [
- "wasm32"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
- "optional": true,
- "dependencies": {
- "@emnapi/runtime": "^1.7.0"
- },
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-win32-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",
- "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-win32-ia32": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",
- "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@img/sharp-win32-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",
- "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@react-email/ui/node_modules/@next/env": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.6.tgz",
- "integrity": "sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@react-email/ui/node_modules/@next/swc-darwin-arm64": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.6.tgz",
- "integrity": "sha512-ZJGkkcNfYgrrMkqOdZ7zoLa1TOy0qpcMfk/z4Mh/FKUz40gVO+HNQWqmLxf67Z5WB64DRp0dhEbyHfel+6sJUg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@react-email/ui/node_modules/@next/swc-darwin-x64": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.6.tgz",
- "integrity": "sha512-v/YLBHIY132Ced3puBJ7YJKw1lqsCrgcNo2aRJlCEyQrrCeRJlvGlnmxhPxNQI3KE3N1DN5r9TPNPvka3nq5RQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@react-email/ui/node_modules/@next/swc-linux-arm64-gnu": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.6.tgz",
- "integrity": "sha512-RPOvqlYBbcQjkz9VQQDZ2T2bARIjXZV1KFlt+V2Mr6SW/e4I9fcKsaA0hdyf2FHoTlsV2xnBd5Y912rP/1Ce6w==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
+ "license": "BSD-3-Clause"
},
- "node_modules/@react-email/ui/node_modules/@next/swc-linux-arm64-musl": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.6.tgz",
- "integrity": "sha512-URUTu1+dMkxJsPFgm+OeEvq9wf5sujw0EvgYy80TDGHTSLTnIHeqb0Eu8A3sC95IRgjejQL+kC4mw+4yPxiAXA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "libc": [
- "musl"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
+ "node_modules/@protobufjs/fetch": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",
+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.1"
}
},
- "node_modules/@react-email/ui/node_modules/@next/swc-linux-x64-gnu": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.6.tgz",
- "integrity": "sha512-DOj182mPV8G3UkrayLoREM5YEYI+Dk5wv7Ox9xl1fFibAELEsFD0lDPfHIeILlutMMfdyhlzYPELG3peuKaurw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "libc": [
- "glibc"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
+ "node_modules/@protobufjs/float": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
+ "license": "BSD-3-Clause"
},
- "node_modules/@react-email/ui/node_modules/@next/swc-linux-x64-musl": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.6.tgz",
- "integrity": "sha512-HKQ5SP/V/ub73UvF7n/zeJlxk2kLmtL7Wzrg4WfmkjmNos5onJ2tKu7yZOPdL18A6Svfn3max29ym+ry7NkK4g==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "libc": [
- "musl"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
+ "node_modules/@protobufjs/inquire": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz",
+ "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==",
+ "license": "BSD-3-Clause"
},
- "node_modules/@react-email/ui/node_modules/@next/swc-win32-arm64-msvc": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.6.tgz",
- "integrity": "sha512-LZXpTlPyS5v7HhSmnvsLGP3iIYgYOBnc8r8ArlT55sGHV89bR2HlDdBjWQ+PY6SJMmk8TuVGFuxalnP3k/0Dwg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">= 10"
- }
+ "node_modules/@protobufjs/path": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
+ "license": "BSD-3-Clause"
},
- "node_modules/@react-email/ui/node_modules/@next/swc-win32-x64-msvc": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.6.tgz",
- "integrity": "sha512-F0+4i0h9J6C4eE3EAPWsoCk7UW/dbzOjyzxY0qnDUOYFu6FFmdZ6l97/XdV3/Nz3VYyO7UWjyEJUXkGqcoXfMA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
+ "node_modules/@protobufjs/pool": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/utf8": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz",
+ "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@radix-ui/primitive": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz",
+ "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
+ "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
+ "devOptional": true,
"license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">= 10"
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
}
},
- "node_modules/@react-email/ui/node_modules/@swc/helpers": {
- "version": "0.5.15",
- "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
- "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
- "dev": true,
- "license": "Apache-2.0",
+ "node_modules/@radix-ui/react-primitive": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz",
+ "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==",
+ "devOptional": true,
+ "license": "MIT",
"dependencies": {
- "tslib": "^2.8.0"
+ "@radix-ui/react-slot": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
}
},
- "node_modules/@react-email/ui/node_modules/next": {
- "version": "16.2.6",
- "resolved": "https://registry.npmjs.org/next/-/next-16.2.6.tgz",
- "integrity": "sha512-qOVgKJg1+At15NpeUP+eJgCHvTCgXsogweq87Ri/Ix7PkqQHg4sdaXmSFqKlgaIXE4kW0g25LE68W87UANlHtw==",
- "dev": true,
+ "node_modules/@radix-ui/react-slot": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
+ "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
- "@next/env": "16.2.6",
- "@swc/helpers": "0.5.15",
- "baseline-browser-mapping": "^2.9.19",
- "caniuse-lite": "^1.0.30001579",
- "postcss": "8.4.31",
- "styled-jsx": "5.1.6"
- },
- "bin": {
- "next": "dist/bin/next"
+ "@radix-ui/react-compose-refs": "1.1.2"
},
- "engines": {
- "node": ">=20.9.0"
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
- "optionalDependencies": {
- "@next/swc-darwin-arm64": "16.2.6",
- "@next/swc-darwin-x64": "16.2.6",
- "@next/swc-linux-arm64-gnu": "16.2.6",
- "@next/swc-linux-arm64-musl": "16.2.6",
- "@next/swc-linux-x64-gnu": "16.2.6",
- "@next/swc-linux-x64-musl": "16.2.6",
- "@next/swc-win32-arm64-msvc": "16.2.6",
- "@next/swc-win32-x64-msvc": "16.2.6",
- "sharp": "^0.34.5"
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toggle": {
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz",
+ "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
},
"peerDependencies": {
- "@opentelemetry/api": "^1.1.0",
- "@playwright/test": "^1.51.1",
- "babel-plugin-react-compiler": "*",
- "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
- "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
- "sass": "^1.3.0"
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
- "@opentelemetry/api": {
- "optional": true
- },
- "@playwright/test": {
- "optional": true
- },
- "babel-plugin-react-compiler": {
+ "@types/react": {
"optional": true
},
- "sass": {
+ "@types/react-dom": {
"optional": true
}
}
},
- "node_modules/@react-email/ui/node_modules/postcss": {
- "version": "8.4.31",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
- "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/postcss/"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/postcss"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
+ "node_modules/@radix-ui/react-use-controllable-state": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz",
+ "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
- "nanoid": "^3.3.6",
- "picocolors": "^1.0.0",
- "source-map-js": "^1.0.2"
+ "@radix-ui/react-use-effect-event": "0.0.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
},
- "engines": {
- "node": "^10 || ^12 || >=14"
- }
- },
- "node_modules/@react-email/ui/node_modules/semver": {
- "version": "7.8.5",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
- "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
- "dev": true,
- "license": "ISC",
- "optional": true,
- "bin": {
- "semver": "bin/semver.js"
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
- "engines": {
- "node": ">=10"
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
}
},
- "node_modules/@react-email/ui/node_modules/sharp": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",
- "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",
- "dev": true,
- "hasInstallScript": true,
- "license": "Apache-2.0",
- "optional": true,
+ "node_modules/@radix-ui/react-use-effect-event": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz",
+ "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==",
+ "devOptional": true,
+ "license": "MIT",
"dependencies": {
- "@img/colour": "^1.0.0",
- "detect-libc": "^2.1.2",
- "semver": "^7.7.3"
+ "@radix-ui/react-use-layout-effect": "1.1.1"
},
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-layout-effect": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
+ "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==",
+ "devOptional": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
- "optionalDependencies": {
- "@img/sharp-darwin-arm64": "0.34.5",
- "@img/sharp-darwin-x64": "0.34.5",
- "@img/sharp-libvips-darwin-arm64": "1.2.4",
- "@img/sharp-libvips-darwin-x64": "1.2.4",
- "@img/sharp-libvips-linux-arm": "1.2.4",
- "@img/sharp-libvips-linux-arm64": "1.2.4",
- "@img/sharp-libvips-linux-ppc64": "1.2.4",
- "@img/sharp-libvips-linux-riscv64": "1.2.4",
- "@img/sharp-libvips-linux-s390x": "1.2.4",
- "@img/sharp-libvips-linux-x64": "1.2.4",
- "@img/sharp-libvips-linuxmusl-arm64": "1.2.4",
- "@img/sharp-libvips-linuxmusl-x64": "1.2.4",
- "@img/sharp-linux-arm": "0.34.5",
- "@img/sharp-linux-arm64": "0.34.5",
- "@img/sharp-linux-ppc64": "0.34.5",
- "@img/sharp-linux-riscv64": "0.34.5",
- "@img/sharp-linux-s390x": "0.34.5",
- "@img/sharp-linux-x64": "0.34.5",
- "@img/sharp-linuxmusl-arm64": "0.34.5",
- "@img/sharp-linuxmusl-x64": "0.34.5",
- "@img/sharp-wasm32": "0.34.5",
- "@img/sharp-win32-arm64": "0.34.5",
- "@img/sharp-win32-ia32": "0.34.5",
- "@img/sharp-win32-x64": "0.34.5"
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
}
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
@@ -6112,19 +4826,6 @@
"integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
"license": "MIT"
},
- "node_modules/@selderee/plugin-htmlparser2": {
- "version": "0.11.0",
- "resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.11.0.tgz",
- "integrity": "sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==",
- "license": "MIT",
- "dependencies": {
- "domhandler": "^5.0.3",
- "selderee": "^0.11.0"
- },
- "funding": {
- "url": "https://ko-fi.com/killymxi"
- }
- },
"node_modules/@seydx/node-av-darwin-arm64": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@seydx/node-av-darwin-arm64/-/node-av-darwin-arm64-6.1.1.tgz",
@@ -6404,17 +5105,12 @@
"node": ">=14.0.0"
}
},
- "node_modules/@socket.io/component-emitter": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz",
- "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==",
- "license": "MIT"
- },
"node_modules/@stablelib/base64": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@stablelib/base64/-/base64-1.0.1.tgz",
"integrity": "sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ==",
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/@standard-schema/spec": {
"version": "1.1.0",
@@ -7419,15 +6115,6 @@
"tslib": "^2.4.0"
}
},
- "node_modules/@types/cors": {
- "version": "2.8.19",
- "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz",
- "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==",
- "license": "MIT",
- "dependencies": {
- "@types/node": "*"
- }
- },
"node_modules/@types/debug": {
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
@@ -7595,15 +6282,6 @@
"integrity": "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==",
"license": "MIT"
},
- "node_modules/@types/ws": {
- "version": "8.18.1",
- "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
- "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
- "license": "MIT",
- "dependencies": {
- "@types/node": "*"
- }
- },
"node_modules/@typesafe-ai/sdk": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@typesafe-ai/sdk/-/sdk-0.6.0.tgz",
@@ -8786,16 +7464,6 @@
"node": ">= 0.4"
}
},
- "node_modules/atomically": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/atomically/-/atomically-2.1.1.tgz",
- "integrity": "sha512-P4w9o2dqARji6P7MHprklbfiArZAWvo07yW7qs3pdljb3BWr12FIB7W+p0zJiuiVsUpRO0iZn1kFFcpPegg0tQ==",
- "license": "MIT",
- "dependencies": {
- "stubborn-fs": "^2.0.0",
- "when-exit": "^2.1.4"
- }
- },
"node_modules/available-typed-arrays": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
@@ -8879,15 +7547,6 @@
],
"license": "MIT"
},
- "node_modules/base64id": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
- "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==",
- "license": "MIT",
- "engines": {
- "node": "^4.5.0 || >= 5.9"
- }
- },
"node_modules/baseline-browser-mapping": {
"version": "2.10.30",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.30.tgz",
@@ -9509,12 +8168,6 @@
"node": ">=8"
}
},
- "node_modules/citty": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/citty/-/citty-0.2.2.tgz",
- "integrity": "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==",
- "license": "MIT"
- },
"node_modules/class-variance-authority": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz",
@@ -9711,63 +8364,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/conf": {
- "version": "15.1.0",
- "resolved": "https://registry.npmjs.org/conf/-/conf-15.1.0.tgz",
- "integrity": "sha512-Uy5YN9KEu0WWDaZAVJ5FAmZoaJt9rdK6kH+utItPyGsCqCgaTKkrmZx3zoE0/3q6S3bcp3Ihkk+ZqPxWxFK5og==",
- "license": "MIT",
- "dependencies": {
- "ajv": "^8.17.1",
- "ajv-formats": "^3.0.1",
- "atomically": "^2.0.3",
- "debounce-fn": "^6.0.0",
- "dot-prop": "^10.0.0",
- "env-paths": "^3.0.0",
- "json-schema-typed": "^8.0.1",
- "semver": "^7.7.2",
- "uint8array-extras": "^1.5.0"
- },
- "engines": {
- "node": ">=20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/conf/node_modules/ajv": {
- "version": "8.20.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
- "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
- "license": "MIT",
- "dependencies": {
- "fast-deep-equal": "^3.1.3",
- "fast-uri": "^3.0.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/conf/node_modules/json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "license": "MIT"
- },
- "node_modules/conf/node_modules/semver": {
- "version": "7.8.5",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
- "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/confbox": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz",
@@ -9920,19 +8516,6 @@
"url": "https://github.com/sponsors/fb55"
}
},
- "node_modules/css-tree": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
- "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
- "license": "MIT",
- "dependencies": {
- "mdn-data": "2.27.1",
- "source-map-js": "^1.2.1"
- },
- "engines": {
- "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
- }
- },
"node_modules/css-what": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz",
@@ -10039,33 +8622,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/debounce": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/debounce/-/debounce-2.2.0.tgz",
- "integrity": "sha512-Xks6RUDLZFdz8LIdR6q0MTH44k7FikOmnh5xkSjMig6ch45afc8sjTjRQf3P6ax8dMgcQrYO/AR2RGWURrruqw==",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/debounce-fn": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-6.0.0.tgz",
- "integrity": "sha512-rBMW+F2TXryBwB54Q0d8drNEI+TfoS9JpNTAoVpukbWEhjXQq4rySFYLaqXMFXwdv61Zb2OHtj5bviSoimqxRQ==",
- "license": "MIT",
- "dependencies": {
- "mimic-function": "^5.0.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/debug": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
@@ -10401,21 +8957,6 @@
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
- "node_modules/dot-prop": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-10.2.0.tgz",
- "integrity": "sha512-BTJ9aZYL3vCfZlZOBLy9v8TUqWGQ0pzFnygKwFZt5udj6viBoFIBviKPUoZLDCPn1FoXffv6McQFDenrm5Krfw==",
- "license": "MIT",
- "dependencies": {
- "type-fest": "^5.0.0"
- },
- "engines": {
- "node": ">=20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/dotenv": {
"version": "17.4.2",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
@@ -10571,79 +9112,6 @@
"node": ">= 0.8"
}
},
- "node_modules/engine.io": {
- "version": "6.6.9",
- "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.9.tgz",
- "integrity": "sha512-clKkw4C7nJ22mGgoVcCg6V/W/TxdNyIOTr89k2ONZu81qqkddPFDF0LXcbAwhzPD8DjkiRCjzuiO6Y+fkpD4vg==",
- "license": "MIT",
- "dependencies": {
- "@types/cors": "^2.8.12",
- "@types/node": ">=10.0.0",
- "@types/ws": "^8.5.12",
- "accepts": "~1.3.4",
- "base64id": "2.0.0",
- "cookie": "~0.7.2",
- "cors": "~2.8.5",
- "debug": "~4.4.1",
- "engine.io-parser": "~5.2.1",
- "ws": "~8.21.0"
- },
- "engines": {
- "node": ">=10.2.0"
- }
- },
- "node_modules/engine.io-parser": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz",
- "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==",
- "license": "MIT",
- "engines": {
- "node": ">=10.0.0"
- }
- },
- "node_modules/engine.io/node_modules/accepts": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
- "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
- "license": "MIT",
- "dependencies": {
- "mime-types": "~2.1.34",
- "negotiator": "0.6.3"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/engine.io/node_modules/mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/engine.io/node_modules/mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
- "license": "MIT",
- "dependencies": {
- "mime-db": "1.52.0"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/engine.io/node_modules/negotiator": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
- "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.6"
- }
- },
"node_modules/enhanced-resolve": {
"version": "5.21.3",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.3.tgz",
@@ -10674,6 +9142,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz",
"integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==",
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
@@ -10897,47 +9366,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/esbuild": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
- "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
- "hasInstallScript": true,
- "license": "MIT",
- "bin": {
- "esbuild": "bin/esbuild"
- },
- "engines": {
- "node": ">=18"
- },
- "optionalDependencies": {
- "@esbuild/aix-ppc64": "0.28.1",
- "@esbuild/android-arm": "0.28.1",
- "@esbuild/android-arm64": "0.28.1",
- "@esbuild/android-x64": "0.28.1",
- "@esbuild/darwin-arm64": "0.28.1",
- "@esbuild/darwin-x64": "0.28.1",
- "@esbuild/freebsd-arm64": "0.28.1",
- "@esbuild/freebsd-x64": "0.28.1",
- "@esbuild/linux-arm": "0.28.1",
- "@esbuild/linux-arm64": "0.28.1",
- "@esbuild/linux-ia32": "0.28.1",
- "@esbuild/linux-loong64": "0.28.1",
- "@esbuild/linux-mips64el": "0.28.1",
- "@esbuild/linux-ppc64": "0.28.1",
- "@esbuild/linux-riscv64": "0.28.1",
- "@esbuild/linux-s390x": "0.28.1",
- "@esbuild/linux-x64": "0.28.1",
- "@esbuild/netbsd-arm64": "0.28.1",
- "@esbuild/netbsd-x64": "0.28.1",
- "@esbuild/openbsd-arm64": "0.28.1",
- "@esbuild/openbsd-x64": "0.28.1",
- "@esbuild/openharmony-arm64": "0.28.1",
- "@esbuild/sunos-x64": "0.28.1",
- "@esbuild/win32-arm64": "0.28.1",
- "@esbuild/win32-ia32": "0.28.1",
- "@esbuild/win32-x64": "0.28.1"
- }
- },
"node_modules/escalade": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
@@ -11701,7 +10129,8 @@
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/fast-sha256/-/fast-sha256-1.3.0.tgz",
"integrity": "sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==",
- "license": "Unlicense"
+ "license": "Unlicense",
+ "peer": true
},
"node_modules/fast-string-truncated-width": {
"version": "3.0.3",
@@ -12254,23 +10683,6 @@
"giget": "dist/cli.mjs"
}
},
- "node_modules/glob": {
- "version": "13.0.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
- "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "minimatch": "^10.2.2",
- "minipass": "^7.1.3",
- "path-scurry": "^2.0.2"
- },
- "engines": {
- "node": "18 || 20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/glob-parent": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -12284,42 +10696,6 @@
"node": ">=10.13.0"
}
},
- "node_modules/glob/node_modules/balanced-match": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
- "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
- "license": "MIT",
- "engines": {
- "node": "18 || 20 || >=22"
- }
- },
- "node_modules/glob/node_modules/brace-expansion": {
- "version": "5.0.9",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
- "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^4.0.2"
- },
- "engines": {
- "node": "20 || >=22"
- }
- },
- "node_modules/glob/node_modules/minimatch": {
- "version": "10.2.6",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
- "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "brace-expansion": "^5.0.8"
- },
- "engines": {
- "node": "18 || 20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/globals": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
@@ -12627,44 +11003,9 @@
},
"node_modules/html-escaper": {
"version": "3.0.3",
- "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz",
- "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==",
- "license": "MIT"
- },
- "node_modules/html-to-text": {
- "version": "9.0.5",
- "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-9.0.5.tgz",
- "integrity": "sha512-qY60FjREgVZL03vJU6IfMV4GDjGBIoOyvuFdpBDIX9yTlDw0TjxVBQp+P8NvpdIXNJvfWBTNul7fsAQJq2FNpg==",
- "license": "MIT",
- "dependencies": {
- "@selderee/plugin-htmlparser2": "^0.11.0",
- "deepmerge": "^4.3.1",
- "dom-serializer": "^2.0.0",
- "htmlparser2": "^8.0.2",
- "selderee": "^0.11.0"
- },
- "engines": {
- "node": ">=14"
- }
- },
- "node_modules/html-to-text/node_modules/htmlparser2": {
- "version": "8.0.2",
- "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz",
- "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==",
- "funding": [
- "https://github.com/fb55/htmlparser2?sponsor=1",
- {
- "type": "github",
- "url": "https://github.com/sponsors/fb55"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "domelementtype": "^2.3.0",
- "domhandler": "^5.0.3",
- "domutils": "^3.0.1",
- "entities": "^4.4.0"
- }
+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz",
+ "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==",
+ "license": "MIT"
},
"node_modules/html-url-attributes": {
"version": "3.0.1",
@@ -12676,12 +11017,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/html5parser": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/html5parser/-/html5parser-3.0.0.tgz",
- "integrity": "sha512-iNpSopa+4YHX50UOk825tBy7MghmXHo/ZpLskBYN0kAr1xhH8GlIMk5bLRXcZlfP3AnLUcSuFMu8C4MdOUxA8A==",
- "license": "MIT"
- },
"node_modules/htmlparser2": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz",
@@ -13860,15 +12195,6 @@
"node": ">=0.10"
}
},
- "node_modules/leac": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",
- "integrity": "sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==",
- "license": "MIT",
- "funding": {
- "url": "https://ko-fi.com/killymxi"
- }
- },
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -14344,18 +12670,6 @@
"url": "https://github.com/sponsors/wooorm"
}
},
- "node_modules/marked": {
- "version": "15.0.12",
- "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz",
- "integrity": "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==",
- "license": "MIT",
- "bin": {
- "marked": "bin/marked.js"
- },
- "engines": {
- "node": ">= 18"
- }
- },
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -14674,12 +12988,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/mdn-data": {
- "version": "2.27.1",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",
- "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
- "license": "CC0-1.0"
- },
"node_modules/media-typer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
@@ -15532,15 +13840,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/minipass": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
- "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": ">=16 || 14 >=14.17"
- }
- },
"node_modules/mp4box": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/mp4box/-/mp4box-0.5.4.tgz",
@@ -15949,15 +14248,6 @@
"node": ">=20"
}
},
- "node_modules/normalize-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
- "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/npm-run-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
@@ -15998,23 +14288,6 @@
"url": "https://github.com/fb55/nth-check?sponsor=1"
}
},
- "node_modules/nypm": {
- "version": "0.6.6",
- "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.6.tgz",
- "integrity": "sha512-vRyr0r4cbBapw07Xw8xrj9Teq3o7MUD35rSaTcanDbW+aK2XHDgJFiU6ZTj2GBw7Q12ysdsyFss+Vdz4hQ0Y6Q==",
- "license": "MIT",
- "dependencies": {
- "citty": "^0.2.2",
- "pathe": "^2.0.3",
- "tinyexec": "^1.1.1"
- },
- "bin": {
- "nypm": "dist/cli.mjs"
- },
- "engines": {
- "node": ">=18"
- }
- },
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -16468,19 +14741,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/parseley": {
- "version": "0.12.1",
- "resolved": "https://registry.npmjs.org/parseley/-/parseley-0.12.1.tgz",
- "integrity": "sha512-e6qHKe3a9HWr0oMRVDTRhKce+bRO8VGQR3NyVwcjwrbhMmFCX9KszEV35+rn4AdilFAq9VPxP/Fe1wC9Qjd2lw==",
- "license": "MIT",
- "dependencies": {
- "leac": "^0.6.0",
- "peberminta": "^0.9.0"
- },
- "funding": {
- "url": "https://ko-fi.com/killymxi"
- }
- },
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -16632,31 +14892,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/path-scurry": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
- "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "lru-cache": "^11.0.0",
- "minipass": "^7.1.2"
- },
- "engines": {
- "node": "18 || 20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/path-scurry/node_modules/lru-cache": {
- "version": "11.5.2",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
- "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": "20 || >=22"
- }
- },
"node_modules/path-to-regexp": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
@@ -16667,17 +14902,9 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
"integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "devOptional": true,
"license": "MIT"
},
- "node_modules/peberminta": {
- "version": "0.9.0",
- "resolved": "https://registry.npmjs.org/peberminta/-/peberminta-0.9.0.tgz",
- "integrity": "sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==",
- "license": "MIT",
- "funding": {
- "url": "https://ko-fi.com/killymxi"
- }
- },
"node_modules/perfect-debounce": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-2.1.0.tgz",
@@ -16792,15 +15019,6 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
- "node_modules/picospinner": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/picospinner/-/picospinner-3.1.2.tgz",
- "integrity": "sha512-0Z++uU8mvB0EvCPAEUq9BGiPcSravzJ+RPdXfjYlzXffqsogisiKRQqI6ctrSSJ6n985vxrgKtQ5n4sRINcJZg==",
- "license": "MIT",
- "engines": {
- "node": ">=18.0.0"
- }
- },
"node_modules/pkce-challenge": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
@@ -16870,12 +15088,6 @@
"node": ">= 0.4"
}
},
- "node_modules/postal-mime": {
- "version": "2.7.5",
- "resolved": "https://registry.npmjs.org/postal-mime/-/postal-mime-2.7.5.tgz",
- "integrity": "sha512-GNEXKvWFQnbgO5NlrGzVa0FmWzBZ24PersAWErttSg1Hjpf0ATxTwS5DOMGaOpTG6bUh5cTr7xi0jAD942wCJA==",
- "license": "MIT-0"
- },
"node_modules/postcss": {
"version": "8.5.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz",
@@ -17040,21 +15252,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/prettier": {
- "version": "3.9.6",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz",
- "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==",
- "license": "MIT",
- "bin": {
- "prettier": "bin/prettier.cjs"
- },
- "engines": {
- "node": ">=14"
- },
- "funding": {
- "url": "https://github.com/prettier/prettier?sponsor=1"
- }
- },
"node_modules/pretty-ms": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz",
@@ -17104,15 +15301,6 @@
}
}
},
- "node_modules/prismjs": {
- "version": "1.30.0",
- "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz",
- "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -17502,137 +15690,6 @@
"react": "^19.2.4"
}
},
- "node_modules/react-email": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/react-email/-/react-email-6.9.1.tgz",
- "integrity": "sha512-uUDRgFukMUXRlrsCNGlA0PZuUlQ44faI9hT/D7uMjozdumLBdHjfQttQswRYLjyLW8fFtg2HBrxAESbFU4ZKKA==",
- "license": "MIT",
- "dependencies": {
- "@babel/parser": "7.29.2",
- "@babel/traverse": "7.29.0",
- "@react-email/render": ">=2.1.0",
- "chokidar": "^4.0.3",
- "commander": "^13.0.0",
- "conf": "^15.0.2",
- "css-tree": "3.2.1",
- "debounce": "^2.0.0",
- "esbuild": "^0.28.0",
- "glob": "^13.0.6",
- "jiti": "2.6.1",
- "log-symbols": "^7.0.0",
- "marked": "^15.0.12",
- "mime-types": "^3.0.0",
- "normalize-path": "^3.0.0",
- "nypm": "0.6.6",
- "picospinner": "^3.0.0",
- "prismjs": "^1.30.0",
- "prompts": "2.4.2",
- "socket.io": "^4.8.1",
- "tailwindcss": "^4.1.18",
- "tsconfig-paths": "4.2.0"
- },
- "bin": {
- "email": "dist/cli/index.mjs"
- },
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/react-email/node_modules/@babel/parser": {
- "version": "7.29.2",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz",
- "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==",
- "license": "MIT",
- "dependencies": {
- "@babel/types": "^7.29.0"
- },
- "bin": {
- "parser": "bin/babel-parser.js"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/react-email/node_modules/chokidar": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
- "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
- "license": "MIT",
- "dependencies": {
- "readdirp": "^4.0.1"
- },
- "engines": {
- "node": ">= 14.16.0"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/react-email/node_modules/commander": {
- "version": "13.1.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
- "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/react-email/node_modules/jiti": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz",
- "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==",
- "license": "MIT",
- "bin": {
- "jiti": "lib/jiti-cli.mjs"
- }
- },
- "node_modules/react-email/node_modules/log-symbols": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-7.0.1.tgz",
- "integrity": "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==",
- "license": "MIT",
- "dependencies": {
- "is-unicode-supported": "^2.0.0",
- "yoctocolors": "^2.1.1"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/react-email/node_modules/readdirp": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
- "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
- "license": "MIT",
- "engines": {
- "node": ">= 14.18.0"
- },
- "funding": {
- "type": "individual",
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/react-email/node_modules/tsconfig-paths": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
- "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",
- "license": "MIT",
- "dependencies": {
- "json5": "^2.2.2",
- "minimist": "^1.2.6",
- "strip-bom": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
@@ -17981,27 +16038,6 @@
"integrity": "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==",
"license": "MIT"
},
- "node_modules/resend": {
- "version": "6.18.1",
- "resolved": "https://registry.npmjs.org/resend/-/resend-6.18.1.tgz",
- "integrity": "sha512-XN8XIaDdKF+ziSQ3K23ndUcyhP7U3ze2gky6SPgYkuAOq54mH4Wdhwm7QylEQ3zlz0NzdX7/l1AgmJUZbdPI/Q==",
- "license": "MIT",
- "dependencies": {
- "postal-mime": "2.7.5",
- "standardwebhooks": "1.0.0"
- },
- "engines": {
- "node": ">=20"
- },
- "peerDependencies": {
- "@react-email/render": "*"
- },
- "peerDependenciesMeta": {
- "@react-email/render": {
- "optional": true
- }
- }
- },
"node_modules/resolve": {
"version": "2.0.0-next.7",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.7.tgz",
@@ -18247,18 +16283,6 @@
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
"license": "MIT"
},
- "node_modules/selderee": {
- "version": "0.11.0",
- "resolved": "https://registry.npmjs.org/selderee/-/selderee-0.11.0.tgz",
- "integrity": "sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==",
- "license": "MIT",
- "dependencies": {
- "parseley": "^0.12.0"
- },
- "funding": {
- "url": "https://ko-fi.com/killymxi"
- }
- },
"node_modules/semver": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
@@ -18671,90 +16695,6 @@
"node": ">=6"
}
},
- "node_modules/socket.io": {
- "version": "4.8.3",
- "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.3.tgz",
- "integrity": "sha512-2Dd78bqzzjE6KPkD5fHZmDAKRNe3J15q+YHDrIsy9WEkqttc7GY+kT9OBLSMaPbQaEd0x1BjcmtMtXkfpc+T5A==",
- "license": "MIT",
- "dependencies": {
- "accepts": "~1.3.4",
- "base64id": "~2.0.0",
- "cors": "~2.8.5",
- "debug": "~4.4.1",
- "engine.io": "~6.6.0",
- "socket.io-adapter": "~2.5.2",
- "socket.io-parser": "~4.2.4"
- },
- "engines": {
- "node": ">=10.2.0"
- }
- },
- "node_modules/socket.io-adapter": {
- "version": "2.5.8",
- "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.8.tgz",
- "integrity": "sha512-6Oy52pbg+kvdCVvjcN+FnY7BvxZ7cIHNScbvztT/It5d0vbwoJoVZmF2gjJmnV0/4WlXRfG15zc45ySk9Ah8bw==",
- "license": "MIT",
- "dependencies": {
- "debug": "~4.4.1",
- "ws": "~8.21.0"
- }
- },
- "node_modules/socket.io-parser": {
- "version": "4.2.7",
- "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.7.tgz",
- "integrity": "sha512-IH/iSeO9T6gz1KkFleGDWkG9N3dl4jXVYUtMhIqH10Md0ttMer8nUNWiP1DKuNrybD2xBrixLJdCC9J6ECoYkg==",
- "license": "MIT",
- "dependencies": {
- "@socket.io/component-emitter": "~3.1.0",
- "debug": "~4.4.1"
- },
- "engines": {
- "node": ">=10.0.0"
- }
- },
- "node_modules/socket.io/node_modules/accepts": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
- "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
- "license": "MIT",
- "dependencies": {
- "mime-types": "~2.1.34",
- "negotiator": "0.6.3"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/socket.io/node_modules/mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/socket.io/node_modules/mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
- "license": "MIT",
- "dependencies": {
- "mime-db": "1.52.0"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/socket.io/node_modules/negotiator": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
- "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.6"
- }
- },
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -18814,6 +16754,7 @@
"resolved": "https://registry.npmjs.org/standardwebhooks/-/standardwebhooks-1.0.0.tgz",
"integrity": "sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@stablelib/base64": "^1.0.0",
"fast-sha256": "^1.3.0"
@@ -19124,21 +17065,6 @@
}
}
},
- "node_modules/stubborn-fs": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/stubborn-fs/-/stubborn-fs-2.0.0.tgz",
- "integrity": "sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==",
- "license": "MIT",
- "dependencies": {
- "stubborn-utils": "^1.0.1"
- }
- },
- "node_modules/stubborn-utils": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/stubborn-utils/-/stubborn-utils-1.0.2.tgz",
- "integrity": "sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg==",
- "license": "MIT"
- },
"node_modules/style-to-js": {
"version": "1.1.21",
"resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz",
@@ -19206,15 +17132,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/svix": {
- "version": "1.99.1",
- "resolved": "https://registry.npmjs.org/svix/-/svix-1.99.1.tgz",
- "integrity": "sha512-JfpvbAg5iT5NagDAfOq3e6Ci6NbOMbMm6C3DnfDBB60m2JDK+Z2hXPE9XNAmutb53DCdPoih1V70IbklZnX09A==",
- "license": "MIT",
- "dependencies": {
- "standardwebhooks": "1.0.0"
- }
- },
"node_modules/swr": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/swr/-/swr-2.4.2.tgz",
@@ -19305,15 +17222,6 @@
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
"license": "MIT"
},
- "node_modules/tinyexec": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz",
- "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- }
- },
"node_modules/tinyglobby": {
"version": "0.2.16",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
@@ -19760,18 +17668,6 @@
"integrity": "sha512-qz3o9CHXmJJPGBdqzab7qAYuW8kQGKNEuoHFYrBwV6hWIMcpAmxDLXojcHfFr9US1Pe6zUswEIJIbLI610fuqA==",
"license": "ISC"
},
- "node_modules/uint8array-extras": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz",
- "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/unbox-primitive": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz",
@@ -20362,12 +18258,6 @@
"webidl-conversions": "^3.0.0"
}
},
- "node_modules/when-exit": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/when-exit/-/when-exit-2.1.5.tgz",
- "integrity": "sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg==",
- "license": "MIT"
- },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/site/package.json b/site/package.json
index 1b437ddb..23d984f6 100644
--- a/site/package.json
+++ b/site/package.json
@@ -34,7 +34,6 @@
"eval:cut-routing": "bun run scripts/eval-cut-routing.ts",
"eval:chatgpt-workflow": "bun run scripts/eval-chatgpt-workflow.ts",
"eval:cut-headless": "bun run scripts/eval-cut-headless.ts",
- "email:dev": "email dev --dir src/emails --port 3001",
"test": "bun test src packages/effects-kit/src packages/abexp/src scripts/lib/cut-eval",
"analytics:summary-fixture": "bun run scripts/analytics-summary-fixture.ts",
"test:genvideo": "bun run scripts/genvideo-selftest.ts",
@@ -152,15 +151,12 @@
"posthog-js": "^1.428.5",
"react": "19.2.4",
"react-dom": "19.2.4",
- "react-email": "^6.9.1",
"react-markdown": "^10.1.0",
"remark-gfm": "^4.0.1",
- "resend": "^6.18.1",
"shadcn": "^4.7.0",
"sharp": "^0.35.4",
"skia-canvas": "^3.0.8",
"stripe": "^22.2.0",
- "svix": "^1.99.1",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"zod": "^4.4.3",
@@ -168,7 +164,6 @@
},
"devDependencies": {
"@cloudflare/containers": "^0.3.7",
- "@react-email/ui": "^6.9.1",
"@tailwindcss/postcss": "^4",
"@types/node": "^24.13.3",
"@types/pg": "^8.20.0",
diff --git a/site/prisma/Email.prisma b/site/prisma/Email.prisma
index 8bab472e..19f10422 100644
--- a/site/prisma/Email.prisma
+++ b/site/prisma/Email.prisma
@@ -1,7 +1,7 @@
// Per-user email posture: whether the one-time welcome email has gone out, and
// whether the account has opted out of non-essential email. Transactional and
// security email ignores the opt-out; any other send must check it first
-// (src/lib/email/unsubscribe.ts).
+// (the back office, which sends all email).
model UserEmailSettings {
userId String @id
@@ -16,12 +16,12 @@ model UserEmailSettings {
}
// The outbox. Every email the site sends is a row here first; one drainer
-// sends rows in priority order under the plan's monthly budget
-// (src/lib/email/outbox.ts). The row is the send's record: a retried queue
+// in the back office sends rows in priority order under the plan's monthly
+// budget. The row is the send's record: a retried queue
// call adds nothing because the idempotency key is unique.
model EmailSend {
id String @id @default(cuid())
- // One of EMAIL_KIND_IDS (src/lib/email/kindIds.ts).
+ // One of the back office's email kinds.
kind String
// Higher goes first: the kind's priority when the row was queued.
priority Int
diff --git a/site/prisma/Jobs.prisma b/site/prisma/Jobs.prisma
index 37e87a0b..d81f6389 100644
--- a/site/prisma/Jobs.prisma
+++ b/site/prisma/Jobs.prisma
@@ -1,8 +1,8 @@
-// Generic deferred work the site runs off the request path. A request writes a
-// row and publishes its id to a Cloudflare Queue; the Cut worker's queue
-// consumer calls back into /api/jobs/worker one message at a time, and the
-// creator polls the row. Job kinds and their payload schemas live in code
-// (src/lib/jobs/registry.ts).
+// Deferred work the back office runs off the request path. A request there
+// writes a row and publishes its id to a Cloudflare Queue; its own queue
+// consumer (donkey-jobs-worker) calls its /api/jobs/worker one at a time,
+// and the creator polls the row. Job kinds and their payload schemas live in
+// its code.
model AsyncJob {
id String @id @default(cuid())
diff --git a/site/prisma/Marketing.prisma b/site/prisma/Marketing.prisma
index d423140a..f2ad92cd 100644
--- a/site/prisma/Marketing.prisma
+++ b/site/prisma/Marketing.prisma
@@ -1,5 +1,5 @@
// Founder outreach: one row per account per campaign, seeded by the nightly
-// outreach-scan job (src/lib/jobs/outreach-scan.ts) and worked by hand. The
+// outreach-scan job in the back office and worked by hand. The
// row is a marker, not a mailbox — it carries status, timestamps, and the
// scan's credit snapshot, never a subject or a message body. The conversation
// itself lives in the operator's inbox.
@@ -8,7 +8,7 @@ model UserOutreach {
id String @id @default(cuid())
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
- // Campaign ids live in code (src/lib/marketing/campaigns.ts).
+ // Campaign ids live in code (the back office's campaigns).
campaign String
// "todo" | "sent" | "replied" | "ignored". The scan creates and retires
// "todo" rows; every other status is set by a person or by an inbound reply.
@@ -28,7 +28,7 @@ model UserOutreach {
lastActiveAt DateTime?
// When the balance last reached zero; null for an account still in credit.
ranOutAt DateTime?
- // Why the scan listed the account (ids in src/lib/marketing/campaigns.ts).
+ // Why the scan listed the account (ids in the back office's campaigns).
reasons String[] @default([])
// The latest declined Stripe charge inside the payment window.
paymentFailedAt DateTime?
diff --git a/site/scripts/send-credits-expiring.ts b/site/scripts/send-credits-expiring.ts
deleted file mode 100644
index 314fd4f3..00000000
--- a/site/scripts/send-credits-expiring.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env bun
-/**
- * Runs the credit-expiry notice by hand. The daily job queues an email for
- * every account whose given credit expires inside the creditExpiryNotice
- * window and drains the outbox; this widens the window for a one-off, and
- * can send a single preview to an account's own address. Each grant is
- * queued once whichever path runs, so a run here and the job never
- * double-mail.
- *
- * Run from site/ with production credentials in the environment:
- * NODE_ENV=production bun run scripts/send-credits-expiring.ts # dry run
- * NODE_ENV=production bun run scripts/send-credits-expiring.ts --to [email protected] # one preview
- * NODE_ENV=production bun run scripts/send-credits-expiring.ts --apply --within 30
- */
-
-import { getGlobalSetting } from "../src/lib/config/effective";
-import { creditMicrosToString } from "../src/lib/credits/amounts";
-import { pendingCreditExpiryGrants } from "../src/lib/email/credit-expiry-due";
-import { queueDueCreditExpiryNotices } from "../src/lib/email/credit-expiry-notices";
-import { withEmailBudget } from "../src/lib/email/send-budget";
-import { drainOutbox } from "../src/lib/email/outbox";
-import { getResend } from "../src/lib/email/resend";
-import { buildCreditsExpiringEmail } from "../src/lib/email/send-credits-expiring";
-import { prisma } from "../src/lib/prisma";
-
-const args = process.argv.slice(2);
-const apply = args.includes("--apply");
-const preview = args.includes("--to") ? args[args.indexOf("--to") + 1] : null;
-if (args.includes("--to") && !preview) {
- console.error("--to needs an address");
- process.exit(1);
-}
-const withinDays = args.includes("--within")
- ? Number(args[args.indexOf("--within") + 1])
- : (await getGlobalSetting("creditExpiryNotice")).daysBefore;
-if (!Number.isInteger(withinDays) || withinDays < 1) {
- console.error("--within needs a whole number of days");
- process.exit(1);
-}
-
-const now = new Date();
-const { due, pending } = await pendingCreditExpiryGrants(now, withinDays);
-console.log(`${due} given grants expire within ${withinDays} days, ${pending.length} not yet notified`);
-
-if (preview) {
- const sample = pending[0];
- if (!sample?.expiresAt) {
- console.error("nothing to preview");
- process.exit(1);
- }
- // The footer's unsubscribe link is the previewer's own, never a customer's.
- // A preview is a hand-sent email: it spends the manual quota and touches
- // no grant.
- const previewer = await prisma.user.findUnique({ select: { id: true }, where: { email: preview } });
- if (!previewer) {
- console.error(`${preview} has no account; previews go to an account's address`);
- process.exit(1);
- }
- const message = buildCreditsExpiringEmail(
- { email: preview, id: previewer.id, name: "Ada" },
- creditMicrosToString(sample.remainingAmountMicros),
- sample.expiresAt,
- );
- const result = await withEmailBudget("manual", () =>
- // Every preview is its own send, whatever the copy did in between.
- getResend().emails.send(message, { idempotencyKey: `credits-expiring-preview:${preview}:${Date.now()}` }),
- );
- if (result?.error) throw new Error(`Resend send failed: ${result.error.name}: ${result.error.message}`);
- console.log(`preview sent to ${preview}`);
-} else if (apply) {
- const queued = await queueDueCreditExpiryNotices({ now, withinDays });
- const drained = await drainOutbox(10 * 60_000);
- console.log(`queued ${queued.queued} new, sent ${drained.sent}, failed ${drained.failed}, skipped ${drained.skipped}`);
- if (drained.retryAfterSeconds !== null) {
- console.log(`the outbox comes back for the rest in ${Math.ceil(drained.retryAfterSeconds / 60)} min`);
- }
-} else {
- console.log("dry run; pass --to <address> for one preview, --apply to send");
-}
-
-await prisma.$disconnect();
diff --git a/site/scripts/stripe-webhook-events.ts b/site/scripts/stripe-webhook-events.ts
index 8e3c4bb7..6b6f6334 100644
--- a/site/scripts/stripe-webhook-events.ts
+++ b/site/scripts/stripe-webhook-events.ts
@@ -1,8 +1,8 @@
#!/usr/bin/env bun
/**
* Points the Stripe webhook endpoint for donkeycut.com at the events the
- * handler and the analytics refresh listen for, so the endpoint in Stripe
- * matches the code. Idempotent: run it after changing the event lists.
+ * handler listens for, so the endpoint in Stripe
+ * matches the code. Idempotent: run it after changing the event list.
*
* Run from site/ with the production Stripe key in the environment:
* bun run scripts/stripe-webhook-events.ts
@@ -11,11 +11,11 @@
import type Stripe from "stripe";
import { getStripe } from "../src/lib/billing/stripe";
-import { ANALYTICS_BILLING_EVENTS } from "../src/lib/billing/webhook-events";
+import { STRIPE_WEBHOOK_EVENTS } from "../src/lib/billing/webhook-events";
const WEBHOOK_URL = "https://donkeycut.com/api/billing/webhook";
-const enabledEvents = [...ANALYTICS_BILLING_EVENTS].sort() as Stripe.WebhookEndpointUpdateParams.EnabledEvent[];
+const enabledEvents = [...STRIPE_WEBHOOK_EVENTS].sort() as Stripe.WebhookEndpointUpdateParams.EnabledEvent[];
const stripe = getStripe();
const endpoints = await stripe.webhookEndpoints.list({ limit: 100 });
diff --git a/site/src/app/api/analytics/run/route.ts b/site/src/app/api/analytics/run/route.ts
deleted file mode 100644
index e75220c6..00000000
--- a/site/src/app/api/analytics/run/route.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { NextRequest, NextResponse } from "next/server";
-
-import { isVercelCron, notFoundResponse } from "@/lib/donkey-api-auth";
-import { enqueueJob } from "@/lib/jobs/queue";
-
-// Without a queue configured (local dev) the job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-// The nightly analytics run. Vercel's cron authenticates with the CRON_SECRET
-// bearer token; a manual run enqueues the same job.
-export const GET = async (request: NextRequest) => {
- if (!(await isVercelCron(request))) return notFoundResponse();
- return NextResponse.json(await enqueueJob("analytics-daily", {}, "vercel-cron"));
-};
diff --git a/site/src/app/api/billing/webhook/route.ts b/site/src/app/api/billing/webhook/route.ts
index 7118ab97..bd7ae195 100644
--- a/site/src/app/api/billing/webhook/route.ts
+++ b/site/src/app/api/billing/webhook/route.ts
@@ -13,15 +13,6 @@ import {
} from "@/lib/billing/pro-subscription";
import { getStripe, stripeId } from "@/lib/billing/stripe";
import { notFoundResponse } from "@/lib/donkey-api-auth";
-import { ANALYTICS_BILLING_EVENTS } from "@/lib/billing/webhook-events";
-import { enqueueJob } from "@/lib/jobs/queue";
-import { prisma } from "@/lib/prisma";
-
-const analyticsBillingEvents = new Set<string>(ANALYTICS_BILLING_EVENTS);
-
-// Without a queue configured (local dev) a queued job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
// Pro is the only subscription product; ignore any other Stripe subscription
// that reaches these webhook events.
@@ -107,15 +98,5 @@ export async function POST(request: Request) {
break;
}
- // One checkout fans out into several of these within a second; a refresh
- // already waiting in the queue will read the state they all produced.
- if (analyticsBillingEvents.has(event.type)) {
- const waiting = await prisma.asyncJob.findFirst({
- select: { id: true },
- where: { kind: "billing-refresh", state: "queued" },
- });
- if (!waiting) await enqueueJob("billing-refresh", {}, "stripe-webhook");
- }
-
return NextResponse.json({ received: true });
}
diff --git a/site/src/app/api/credits/expire/route.ts b/site/src/app/api/credits/expire/route.ts
deleted file mode 100644
index d6d0b015..00000000
--- a/site/src/app/api/credits/expire/route.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { NextRequest, NextResponse } from "next/server";
-
-import { isVercelCron, notFoundResponse } from "@/lib/donkey-api-auth";
-import { enqueueJob } from "@/lib/jobs/queue";
-
-// Without a queue configured (local dev) the job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-// The nightly credit-expiry sweep. Vercel's cron authenticates with the
-// CRON_SECRET bearer token; a manual run enqueues the same job.
-export const GET = async (request: NextRequest) => {
- if (!(await isVercelCron(request))) return notFoundResponse();
- return NextResponse.json(await enqueueJob("credit-expiry", {}, "vercel-cron"));
-};
diff --git a/site/src/app/api/credits/expiry-notices/route.ts b/site/src/app/api/credits/expiry-notices/route.ts
deleted file mode 100644
index 82a51c07..00000000
--- a/site/src/app/api/credits/expiry-notices/route.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { NextRequest, NextResponse } from "next/server";
-
-import { isVercelCron, notFoundResponse } from "@/lib/donkey-api-auth";
-import { enqueueJob } from "@/lib/jobs/queue";
-
-// Without a queue configured (local dev) the job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-// The daily credit-expiry notice. Vercel's cron authenticates with the
-// CRON_SECRET bearer token; a manual run enqueues the same job.
-export const GET = async (request: NextRequest) => {
- if (!(await isVercelCron(request))) return notFoundResponse();
- return NextResponse.json(await enqueueJob("credit-expiry-notice", {}, "vercel-cron"));
-};
diff --git a/site/src/app/api/email/resend-webhook/route.ts b/site/src/app/api/email/resend-webhook/route.ts
deleted file mode 100644
index c71947ff..00000000
--- a/site/src/app/api/email/resend-webhook/route.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { NextResponse, type NextRequest } from "next/server";
-import { Webhook } from "svix";
-import { z } from "zod";
-
-import { unauthorizedResponse } from "@/lib/donkey-api-auth";
-import { forwardOutreachReply } from "@/lib/marketing/forward-reply";
-
-// One event this app consumes: a received email is a reply to an outreach
-// note, which files itself against its row and forwards on. Everything else
-// acknowledges as a no-op so enabling more events in the dashboard never
-// errors.
-const emailReceivedSchema = z.object({
- data: z.object({
- email_id: z.string(),
- from: z.string(),
- received_for: z.array(z.string()).default([]),
- subject: z.string().default(""),
- to: z.array(z.string()).default([]),
- }),
- type: z.literal("email.received"),
-});
-
-// Public exception to withDonkeyAuth (docs/guides/backend-apis.md): Resend
-// calls this endpoint directly. Every request is Svix-signature-verified
-// against RESEND_WEBHOOK_SECRET before it is read.
-export async function POST(request: NextRequest) {
- const secret = process.env.RESEND_WEBHOOK_SECRET;
- if (!secret) {
- return unauthorizedResponse();
- }
-
- const payload = await request.text();
- let event: unknown;
- try {
- event = new Webhook(secret).verify(payload, {
- "svix-id": request.headers.get("svix-id") ?? "",
- "svix-signature": request.headers.get("svix-signature") ?? "",
- "svix-timestamp": request.headers.get("svix-timestamp") ?? "",
- });
- } catch {
- return unauthorizedResponse();
- }
-
- const received = emailReceivedSchema.safeParse(event);
- if (received.success) {
- await forwardOutreachReply(received.data.data);
- }
- return NextResponse.json({ ok: true });
-}
diff --git a/site/src/app/api/experiments/results/route.ts b/site/src/app/api/experiments/results/route.ts
deleted file mode 100644
index 1fc21943..00000000
--- a/site/src/app/api/experiments/results/route.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { NextRequest, NextResponse } from "next/server";
-
-import { isVercelCron, notFoundResponse } from "@/lib/donkey-api-auth";
-import { enqueueJob } from "@/lib/jobs/queue";
-
-// Without a queue configured (local dev) the job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-// The nightly results run for every live experiment. Vercel's cron
-// authenticates with the CRON_SECRET bearer token; a run for one experiment
-// enqueues the same job with its id.
-export const GET = async (request: NextRequest) => {
- if (!(await isVercelCron(request))) return notFoundResponse();
- return NextResponse.json(await enqueueJob("experiment-results", {}, "vercel-cron"));
-};
diff --git a/site/src/app/api/jobs/worker/route.ts b/site/src/app/api/jobs/worker/route.ts
deleted file mode 100644
index 654908ea..00000000
--- a/site/src/app/api/jobs/worker/route.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { timingSafeEqual } from "node:crypto";
-
-import { executeJob } from "@/lib/jobs/queue";
-
-// Execution callback for queued async jobs: the Cut worker's Cloudflare Queue
-// consumer POSTs one job id at a time (see src/lib/jobs/queue.ts).
-// Deliberately not wrapped in withDonkeyAuth — the caller is a machine, not a
-// session — and gated by the shared secret instead, like the copy worker's
-// callback beside it.
-
-// A user delete can move a lot of R2 objects; give the function room to finish.
-export const maxDuration = 300;
-
-/** Constant-time bearer check: a byte-by-byte `!==` would leak the secret's
- * length and prefix through timing. */
-function authorized(header: string, secret: string): boolean {
- const expected = Buffer.from(`Bearer ${secret}`);
- const got = Buffer.from(header);
- return got.length === expected.length && timingSafeEqual(got, expected);
-}
-
-export async function POST(request: Request) {
- const secret = process.env.JOBS_EXECUTE_SECRET;
- const authz = request.headers.get("authorization") ?? "";
- if (!secret || !authorized(authz, secret)) {
- return new Response("Unauthorized", { status: 401 });
- }
- const body = (await request.json().catch(() => null)) as { jobId?: unknown } | null;
- if (typeof body?.jobId !== "string" || !body.jobId) {
- return new Response("Bad request", { status: 400 });
- }
- return executeJob(body.jobId);
-}
diff --git a/site/src/app/api/marketing/outreach/scan/route.ts b/site/src/app/api/marketing/outreach/scan/route.ts
deleted file mode 100644
index e22452bc..00000000
--- a/site/src/app/api/marketing/outreach/scan/route.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { NextRequest, NextResponse } from "next/server";
-
-import { isVercelCron, notFoundResponse } from "@/lib/donkey-api-auth";
-import { enqueueJob } from "@/lib/jobs/queue";
-
-// Without a queue configured (local dev) the job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-// The nightly outreach scan. Vercel's cron authenticates with the CRON_SECRET
-// bearer token; a manual scan enqueues the same job.
-export const GET = async (request: NextRequest) => {
- if (!(await isVercelCron(request))) return notFoundResponse();
- return NextResponse.json(await enqueueJob("outreach-scan", {}, "vercel-cron"));
-};
diff --git a/site/src/cut/worker/cf/worker.ts b/site/src/cut/worker/cf/worker.ts
index 9a45af96..6a8c4bc2 100644
--- a/site/src/cut/worker/cf/worker.ts
+++ b/site/src/cut/worker/cf/worker.ts
@@ -20,8 +20,6 @@ type WorkerEnv = MediaEnv & {
CUT_RUNNER_SECRET?: string;
CUT_COPY_EXECUTE_URL: string;
CUT_COPY_EXECUTE_SECRET: string;
- JOBS_EXECUTE_URL: string;
- JOBS_EXECUTE_SECRET: string;
CLOUDFLARE_KV_API_TOKEN: string;
};
@@ -112,16 +110,12 @@ export default {
return new Response("donkey-cut-worker", { status: 200 });
},
- // Queue consumer for both queues in wrangler.jsonc — share copies
- // (donkey-cut-copy) and the site's generic async jobs (donkey-jobs). Each
- // drains serially: one message per batch, one batch at a time. The work
- // itself runs on the hosted API — this handler only paces it and carries the
- // queue's retry semantics: 2xx acks, anything else redelivers after a delay.
+ // Queue consumer for share copies (donkey-cut-copy), drained serially: one
+ // message per batch, one batch at a time. The copy itself runs on the hosted
+ // API — this handler only paces it and carries the queue's retry semantics:
+ // 2xx acks, anything else redelivers after a delay.
async queue(batch: QueueBatch, env: WorkerEnv): Promise<void> {
- const target =
- batch.queue === "donkey-jobs"
- ? { url: env.JOBS_EXECUTE_URL, secret: env.JOBS_EXECUTE_SECRET }
- : { url: env.CUT_COPY_EXECUTE_URL, secret: env.CUT_COPY_EXECUTE_SECRET };
+ const target = { url: env.CUT_COPY_EXECUTE_URL, secret: env.CUT_COPY_EXECUTE_SECRET };
for (const message of batch.messages) {
const jobId = (message.body as { jobId?: unknown } | null)?.jobId;
if (typeof jobId !== "string" || !jobId) {
diff --git a/site/src/cut/worker/wrangler.jsonc b/site/src/cut/worker/wrangler.jsonc
index 85a9e189..ce359549 100644
--- a/site/src/cut/worker/wrangler.jsonc
+++ b/site/src/cut/worker/wrangler.jsonc
@@ -54,13 +54,9 @@
{ "pattern": "worker.donkeycut.com", "custom_domain": true }
],
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["CutRenderWorker"] }],
- // Share-copy jobs and the site's generic async jobs drain serially: one
- // message per batch, one batch in flight, so a burst can't stampede R2 or
- // the database. Create each queue once:
+ // Share-copy jobs drain serially: one message per batch, one batch in
+ // flight, so a burst can't stampede R2 or the database. Create the queue once:
// npx wrangler queues create donkey-cut-copy
- // npx wrangler queues create donkey-jobs
- // The jobs consumer needs JOBS_EXECUTE_URL and JOBS_EXECUTE_SECRET set with
- // `wrangler secret put`, mirroring the CUT_COPY_EXECUTE_* pair.
"queues": {
"consumers": [
{
@@ -69,13 +65,6 @@
"max_concurrency": 1,
"max_retries": 10,
"retry_delay": 30
- },
- {
- "queue": "donkey-jobs",
- "max_batch_size": 1,
- "max_concurrency": 1,
- "max_retries": 10,
- "retry_delay": 30
}
]
}
diff --git a/site/src/emails/_components/CommunityPs.tsx b/site/src/emails/_components/CommunityPs.tsx
deleted file mode 100644
index 5a124724..00000000
--- a/site/src/emails/_components/CommunityPs.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Link, Text } from "react-email";
-
-export const DISCORD_URL = "https://discord.gg/Xv6qGax7sT";
-export const GITHUB_URL = "https://github.com/DonkeyUseCorp/Donkey";
-
-// The community links as a P.S. under the sign-off of a personal note.
-export function CommunityPs() {
- return (
- <Text className="text-[15px] leading-relaxed">
- P.S.
- <br />
- Discord —{" "}
- <Link href={DISCORD_URL} className="text-[#0F0E0D] underline">
- {DISCORD_URL}
- </Link>
- <br />
- GitHub —{" "}
- <Link href={GITHUB_URL} className="text-[#0F0E0D] underline">
- {GITHUB_URL}
- </Link>
- </Text>
- );
-}
diff --git a/site/src/emails/_components/DonkeyMark.tsx b/site/src/emails/_components/DonkeyMark.tsx
deleted file mode 100644
index 79db60d4..00000000
--- a/site/src/emails/_components/DonkeyMark.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Img } from "react-email";
-
-import { DONKEY_LOGO_CID } from "./logo";
-
-// The Donkey Cut mark at the top of an email, referenced by Content-ID: the
-// sender attaches the bytes from logo.ts under this id, so the image travels
-// inside the message and no client fetches anything external. The preview
-// server has no attachment to resolve, so it shows the alt box there.
-export function DonkeyMark() {
- return (
- <Img
- src={`cid:${DONKEY_LOGO_CID}`}
- alt="Donkey Cut"
- width="48"
- height="48"
- className="mb-4"
- />
- );
-}
diff --git a/site/src/emails/_components/logo.ts b/site/src/emails/_components/logo.ts
deleted file mode 100644
index 6d5732dd..00000000
--- a/site/src/emails/_components/logo.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// The Donkey Cut mark, rasterized from public/donkey-logo.svg (96px — 2x the
-// 48px display size — alpha kept) and embedded as bytes so emails fetch
-// nothing external: senders attach it under DONKEY_LOGO_CID and templates
-// reference it as `cid:` (DonkeyMark).
-export const DONKEY_LOGO_PNG_BASE64 =
- "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAYKADAAQAAAABAAAAYAAAAACK+310AAATgklEQVR4Ae1dBXhURxAeSou7UzxYSyEkxZ1AQrAAwd3dgrsT3F1DCB7c3d2LuxVavAIVirTp/AvvuLu8uzw9JJnvS57tztudebs7O3bRwhhIJ5y7cJkqVm9EGdKnpWXzp1Oar1PpxBh5qkczggFFvP3pxKkzgmoeuXLQ4d3r6Msvv4w8VNTR0y901BVVZ89bbCE+bpw5f4mCF4bqRRtp6usaASdPn6XCpauEI5Z7zm/p5IHN4e5H3QhPAV0jYNfeQ+Ex8h2sCVev35R9FnXTlgKaGYC1O2TxCltsVlcbt+y0uoo6dUQBzQz48d7PdOPWHUd4advOfQ6fRT14TwHNDLjphPhAf+joSfrrr7/fvynqTJYCmhlw6/aPsgilm69fv6b9h45Jl1FHBxTQzIAbt5wzAO/bvH23g9dG3ZYooJkBEY0AvGDD5h1kwEZbautnedTMgJsRTEGg1v0Hj6KmoQg+G1MZgHePGDuV/vvvvwiaEXkfa2LAw0dP6MWLfxRRbfe+QzRw2DhFZSNjIU0MuHvvJ1W0gr4oCuQpoIkBGAFq4Lffn9Hff79QUyXSlNXEgN+fPVdNoKhpSJ5kmhjw6tUreWxO7k6aHkRHj592UiJyPtLEAIoWTRO1tuzYo6ne51xJEwNifPWVJprsPXBEU73PuZImBsSPH08TTY4cO0VXrkXZCayJp4kBSRMnssah6nxg4FhV5T/3wpoYkC5dGs10WbNhK23auktz/c+toiab8Js3byhRmu9IizQEAiZLmoSOsOcE3FgiO2gaAXA5yZkju2baPf3lV+FH9OTpL5pxfC4VNTEAnS+Qz1MXDa5ev0Vlq9QnMCMyg2YGlCxWSDfdzl+8QmUq1aXIPBI0rQGg/J9//kVfZ81D//zzUjcjMJ3t2LCUkiZJrBvXp4ZA8wiIFy8ulfUuaUh/L1y6SlVqN9O8qBvSiA+ERDMD0N6Gdasb1uxjJ36goaMmGYbvU0GkeQpCB//991/K4l6Ufr7/0JD+fsUqjvPHd5JbxvSG4PsUkOgaAdGjR6cOrZsY1k+4skS2nbKuEQDKYzHOnKsIwehiFBzds56+98hlFLqPGo+uEYCeYTHu3a29oZ2s17QD/XjX1ux5685dunTl+mdn4Nc9AkB5qCQ8C5el6zdvG8aIJKzwG9KvG6VMmZxGjJlCp89eELgTJ0pI336TlZ6xVQ6ROFPHD6OMn7BKwxAGgDJQNZcsV8PljlgpkiejwIE9qKZ/RYoTJ7ZhH4CrEOmegqSGFiqQhwb27ixduuz4+MlTatm+h5DGPkUtq2EjQKJ40zZdadGy1dKl5iM0pkUL5aNECRPQH7zQX756XawBzhBGY1Npt4BW1LNzW0qQIL6zoh/NM8MZAC+4Dt3605zgJZo6WbRwfhrEI6lYkQJsera1Pd/hhXnqzGCaPmcBQSXuCGLEiEEe7jkofdo0QuXt7+dL+fN6Oir+Qe8bzgCpNwuXrqKAHgOFmCrdc3b84osvaPyIAdS2ZSNnxcQz2JbLV23olAn2SAb16UJ9unewv/3Brw1bA+x70qBONTp9aKtitfXowL4W4sOjOnTVBvKtXI+SZ3CngiX96N5P9y2vgCa2WaPalmslJ4OGjxcfxMuX+pWHSt6ntIxpI0BqAETUhi060er1W6Rb4Y6FC+alvVvexptBrdGmU28RZ4y6e/YfIeyQPd2/oy4dW1Gtan6iPrzz8hYrT1iE1UB6Nqc2a1ib6tXyJ5x/cECgttnAhAwr7lst7KtEGWX/Nm/bLZrAm6+w7B7Fw3IX9AmLmcQtzLOwbxgzLixHHi9RL5Wbp01Tl65YJ4vP0Xus78dLmS1s2cr1Nvg+xIXpI0D6wi5fvUEehcqE2yckZGnlwc23HnOFvCrRWQ5xRZwxpCAstFiI06ZJTTv3HKDpE4aTX3kfgZKJRUV9qtoEiUvvUnOsVrk8eZcqJmwR2bNmpm+zZ1FTXXdZl+UTQMeKs2Sz7+BRm0bn5tQGsDHP55BXEB+AzVXFsqWpU89BhMW5S4eWdOX0PoobN454jnk8KGSZbuID2ap1m8WfQMz/MDXNmjySIEm5AlzGAHQGhLUHqBwAoSvXE9QMUOo94Xkdwd5QNSD5h2R/XrdpO82cu1BE3WBdMAMWh66hhLz3mDhqkBnow+E0TQqyfhPiiRu2CKAVazZa3xbnUGljOjly/BT5lfMW6gSMBOScgFYUxIdre90m7alG/Va0a+9BsSiHQ2TgjVlBi+iXX38zEKNjVC5hQDqewxPx1y23OwXxX758JYh8lK1i2PmWKV2cdm1cRilTJBdKN98q9Wjl2k2Oe2HwExiaTpw6azBWeXQuYUDMmDHFJqtL+xbhWhErVkzCH6xgmH46tmlK65cHi/keIqaPXx2CudJssE+vMzNoodNMAEa1xyVrQIVqjejoidP0xx9/hmv3d99mE/dgioRJUoIt2/eI/QAiLc0AjEbYtGtUqcDGn5yEjwRTHdqJHBjYCCLdgr9fWRrSvxtlcctoRjPIJWIovuBKNZvIWs3OHdtJ32TLLDqHjddG9hudwvqeQ0dOmNJhSDed2jWj7gGtxWLr6CWwP9Rq0JqQEyNlimR06uAWWSHCUX2l913CADQGO9wceb1soiuLsLZzz+blIrXNTF74lrAEYqRp054I+fN6UND0sQR5Xwlg9BXxriLaHtC2GY0Z1k9JNVVlTGcAtKP4mnsOGEFI8GQNXVm1cIOtaBAvzYbOvP4MY8ON/Vwf0XuxT6jTuB2lYsvcnUtHxb4kojpqnpvOAEgUDZoHuFSKsSYANm8hsyZQpQplrG8rPrd2vdmyZiGVLllUcV0lBU2XgiDnLwmeaqj7ipKOoQw2frt5itNKfOBA+wf37YpT4ThmtDbVVAYgnBUbKmhC7VUQokcm/oP+aO/WFUKLqvc1kJbg/3SYcyBhNBvJBFOnoMkz5lG3PkP19l91/dSpUjDxV1KmDOlEXXhQYJ2BK3z92lVtpBk8O8hr1LPnf1Ddmm8TECKyH2IqduaS/gmIEGqLeOfUKVOIkYX36AVTGYBdbr8ho2na7BCXRspjI1fWp6SFNgVKVKQfzl0U1yBsZV4PYrI4CpXHqR/OCV8jKdMjGJIik4dQj8DLAkyAccmnVHGhmf3p5wfUtnMfih0rFoUumGF5h9YTUxkgNWrBkpXUvF136dLUI3RHB7bbOgU0a9uNYCJ1BNgbbF+3mGAY6j90DI0aPz1c0WxZ3KgrG/wb8AiChtaH4xqgNdW7QTN1DZB6Ac2mKwAL5thh/cO9aho7b0HvLweYRraydAPiT5s1X5b4qHftxi2aNG2usO5hKhvKTmPQnOoFl6gipOGvt7HO6sNwM2XcUIvq2rosdE1L508TmlS4zEA7CzV4GZ5WGtevKeb5ISMnUmAE7vFtWzSilk3rCdSQsKbPCRHTF0aEVjB9CoLEkDxjbkMiaRx1EsSYN2Msa1FL2BSBFAarGqxrjgARPq0DetGS5WsdFbHcx8ZxxOBelusdu/fTTc6d17p5A8s9tSfaWafwTRA/jQhjcvQ6zM3H9m4IR3yUj8+Ow7UatRULrVx96HuK+fgrIj7q//DOP1XChYUZDG7B6xukva079kqPFB9NHwF+NRqbmsQVOaohwTiCEBYAWnXoSY1Ylq/DYiasXdc4QnPF6g20npMKqoHYsWPR49tnhOYUI/v16zfCOxznmAJLlK3B3h3LxXOleA1nANS46JxbpgzCymWmLj83E/6EgiTh3fsGChleKVGclYPoCRX1cu7j+MmzadPqBcKgD89wj0K+dPviYZt9hjNceGbYFAQzHha4PJ65xJc1kSUGM4mPxudXGKsMLSYW4ayZM6GaDUBshZ+QUoCqHPAnZwXGFFaEs8fDXdKvemNhKo0b563jgFJ8ho2AkeOmid1kHB6mc0OW0oOHj5W2QVM5mC6P7dto2e0qRYJsLfcfPKRYbID5hj014BaTnzdqiFlWCquXzBExCjnzlRZxclI9rAmbVoVIl4qOho2ArFkyCUsSdPw3zh0k6M/NAhB/69pFqomP9sD4U6pEESH3QxQNXrRcFfGBAwtuWvbYGMPulNYi6PBBPfFYFRg2ApDGMrtncVKb0E9Va98VllMLQ+1h702tBPd3eUtpiuwJHNCDenRuI4w1MGFCT/SIF2i1YMgIQKAeZOKlwdNIazInpQ3HfG2tk4e3BLsyUtwU2Sh/8Qpid6o0USzc3bWGVY2dNFPYuOG7BHEXljxoftWCIQxAoF7fwaOEwxRUtzFjmuNVhi+8V9d2lj5CxIS/ENweIY+DAE1adxFzupL0aL/oSBSCTd4KZj5GvqSSGMq7abVg2BSEl4+eOEPIwM9ZtWsGeBUvTNtYaQaAVhI2ZmebPIiLcHt3lJcISULSZc+vOfISYvAbtvhdvHxNtAkfyK/3LtiosMUDJ/8MGQHAj1DV6uziYRbx8Q5vr/fmwKmsOHNGfJRHdq5cBbyFjkeubPJkSakJ64K0AtTZEvGBA+uQWqcCzQyQCA1DO35DDMZueBxI3staO+WsnnvOHJbHa5m4SgCEh6LNnRmxduO2cFUmsA9oed9S4e5rvYHdshrQzADvirUJ0w5+qgRu4sj7417AR/xmgJoGqCmbJHFCUfzX334nBG6rASy4NdnPp5x/A5tfeIKmdO2yIOGNJ7dRU/OOimy8UZtyR/MagNBQuJS7EpBnLo+nu9iBImxJDUDvD7MjvN/ggdelQwvq060DWX+xWBPcchYWvqpKcUMAgdUMQYXQN1l79ynBoXkE9OsZINzJlbzEqDJSAvCXDpJE4euT2wvk4Mh6xBecPbJd7Hzh2g6rF8RXrBOYuwFYExImSKCqucMH9qSQ2ROpeaM6qomPF2lmAOKr4PLhTBOpqicKCv/0Li2O9e7TuhqCPebNGEe+3iXo7pXjIkgQ6uphTCR86enSfi3iwuAmM3VcID1i599aDdsQh0XR+Cmzhdo63rsgEGu8js6rVPTVZQsAXtUWMZjjYGOtWdVPhA7B42w453LQuqFx1Dm5+1eu3RC3MezlADoeRLicZEM7PNnwt35FsCX/EMeUsV9ocyGtof6z5895/zKasD70Ys89tdCMv3q9oHoEwLqEIYsND1zHcXQF8dFRSWH2deqUsv2+efuu2Bil4riC6eyJgcVaSv4ED7eDh48LDwepMhxvoVJ4cuesJURWeqbkiKlNL6hmAF44Y+IIlwez4b3ST+YilEkKbcJ9CTC34ydTqvtXoItXrlFttoYBIJu3ZKNMkwbvZX7EHsCcCH0OjDSB/d96bWCacjTFSe/BEYs6yuoFTQyA/uPgjjW6XTLUNv7R46d0+8d7ohpUyXIA95PMbAyCJwSmKowCMMzbqxiHHf1uqQK9fuCA964yYBymr5vnDwmx1FLQwQmM+UaAagZA54KsJF7la7okgsS+kztZ6QfI931u+0fiGmbGuzy1AJKxVBTEtglAnRqV6QRvGqE/gsYWBhWItBLg/ojBvcWlBweFS1CiaEHp1HJEms0endpYrvWcqGbA9l37hWeYq3x97DsnubLD7iAH+EAgFAD+fvFCBFhI5fqz6AzDejaPYlTBavcLJR7CaLFoAyRFHtKmIZ8pHL1aNatPNTgnEXT++9jt0dplUcKv5ahpIwYNYOos37vU3VDqHFQedy4doTixY1NKN0/ZiEnsBQ5sX0WZOO6sdUBvWjR3ss2Ga9zkWTRvQahwMYHqBEb7Uay0w1QFqF6vpTCrQrUCt0QzQfUIQGPwFUqbIjMbJ4cbXzicZzG/Q96XA0hpjVt1EWZHuJZXrdtCuJ5ACgLAv2cYf8nVOew1afpcwjk3+jvnKkTFbGH3Ekh7Ul4KuXcYdU/TCCjIKQVOnzlvVBtU48GXCrMnvJor12oq6kNysTfElCvjRasWz2bdzy2qwuXusQp748r5YkFGpdKszzrw7hdfYcPIy+vKI14fpN9JnjJ2qJh6VDdQRQXVIwDORx+S+OgbxEp4XMMDGllUAJPHDBFH63+ItITBBlIR/IeaNqglvnpoR/GL39aZGRGrjFAqifjwM+3YfYAQa61xGn2uagRg+OcpWk5YoIxuiFp88Ga4zqPgEhtD+rILPIL9oOlEJL09QF0CfQ1CYmE9G8y5g6Cath8xUj2IrAXzfy/sCNmzuhEiOeV0TFJ5PUdVDJgwdQ717D9cz/sMrStlwYJtAn7/MI7kY7swPhR7wBcNH06Ep2In/ejxE3Yg2yjU6chHBy+35MmTitiBdpy1q1XHXhZT4+5NoYRUamaAYgagcwW9/FSpas1osDVOOOXCE81aBYxfb3X2q32QopCJxb9SOXZPKSzSIVjjxM/0jmQc2BdIgMQdSlKpSeXVHBUxABHuxcpUjTBroZoXG1V2+cKZBK2kBJCAkNRDqd8nRkMqDjnCFANlnpxDmZmLcYSLMObJ+s07fpTEB9FXcxyvNYCQi4Km2LiuWD+3P4fYCaECoUpyxEd5Lx4pZoFTBuBrguUL0sTHCmib/ZwPM+O60CARkKe33VBhwKZgFjhkAIjfrks/WuAktsqsRqnBCzOjXAgs4r5gnBk3vL8adDZlkQ0Yml8zQZYBUOtCzz93/hIz360aNxZQaCwXzJkkNlRjmbjwzQleGCpwBS1YZvkxCYwK2KwRKqsWMILgZoPAPbPzUf8P1PEzrF1be/4AAAAASUVORK5CYII=";
-
-export const DONKEY_LOGO_CID = "donkey-logo";
diff --git a/site/src/emails/credits-expiring.tsx b/site/src/emails/credits-expiring.tsx
deleted file mode 100644
index 64c3e90c..00000000
--- a/site/src/emails/credits-expiring.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import {
- Body,
- Container,
- Head,
- Hr,
- Html,
- Link,
- Preview,
- Tailwind,
- Text,
- pixelBasedPreset,
-} from "react-email";
-
-import { DonkeyMark } from "./_components/DonkeyMark";
-
-// The one notice an account gets before its signup credits expire: a short
-// note from David naming what is left and the day it goes. Sent by
-// src/lib/email/send-credits-expiring.ts; preview with `npm run email:dev`.
-// This module stays pure — the react-email preview server bundles it on its
-// own, so everything it needs comes in as props and link URLs are absolute.
-
-type CreditsExpiringEmailProps = {
- name: string;
- // What is left of the grant, in credits ("2,570 credits").
- credits: string;
- // The day it expires, already worded ("September 14, 2026").
- expiresOn: string;
- editorUrl: string;
- unsubscribeUrl: string;
-};
-
-export default function CreditsExpiringEmail({
- name,
- credits,
- expiresOn,
- editorUrl,
- unsubscribeUrl,
-}: CreditsExpiringEmailProps) {
- return (
- <Html>
- <Head />
- <Preview>
- The {credits} on your Donkey Cut account expire on {expiresOn}.
- </Preview>
- <Tailwind config={{ presets: [pixelBasedPreset] }}>
- <Body className="bg-white font-sans text-[#0F0E0D]">
- <Container className="mx-auto max-w-[520px] px-6 py-12">
- <DonkeyMark />
- <Text className="text-[15px] leading-relaxed">Hey {name},</Text>
- <Text className="text-[15px] leading-relaxed">
- Just a quick heads up: the {credits} on your Donkey Cut account
- expire on {expiresOn}. Any unused credits will
- disappear after that.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- You can use them for Edit with Chat, or to generate videos,
- images, audio, and voice.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- <Link href={editorUrl} className="text-[#0F0E0D] underline">
- Open the editor
- </Link>{" "}
- and put them to use 🙂
- </Text>
- <Text className="text-[15px] leading-relaxed">
- If you have any questions, just reply to this email. It goes
- straight to my inbox.
- </Text>
- <Text className="text-[15px] leading-relaxed">David</Text>
- <Hr className="mt-6 border-[#0F0E0D]/15" />
- <Text className="text-[12px] leading-relaxed text-[#0F0E0D]/60">
- You&apos;re receiving this because you created a Donkey Cut
- account.{" "}
- <Link
- href={unsubscribeUrl}
- className="text-[#0F0E0D]/60 underline"
- >
- Unsubscribe
- </Link>{" "}
- from product emails.
- </Text>
- </Container>
- </Body>
- </Tailwind>
- </Html>
- );
-}
-
-CreditsExpiringEmail.PreviewProps = {
- name: "Ada",
- credits: "2,570 credits",
- expiresOn: "September 14, 2026",
- editorUrl: "https://donkeycut.com/app",
- unsubscribeUrl: "https://donkeycut.com/unsubscribe?token=preview",
-} satisfies CreditsExpiringEmailProps;
diff --git a/site/src/emails/credits-offered.tsx b/site/src/emails/credits-offered.tsx
deleted file mode 100644
index e0ce935e..00000000
--- a/site/src/emails/credits-offered.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import {
- Body,
- Button,
- Container,
- Head,
- Hr,
- Html,
- Link,
- Preview,
- Tailwind,
- Text,
- pixelBasedPreset,
-} from "react-email";
-
-import { DonkeyMark } from "./_components/DonkeyMark";
-
-// The email behind a credit offer: David added credit to the account, and
-// one button claims it. Sent by src/lib/email/send-credits-offered.ts;
-// preview with `npm run email:dev`. This module stays pure — the react-email
-// preview server bundles it on its own, so everything it needs comes in as
-// props and link URLs are absolute.
-
-type CreditsOfferedEmailProps = {
- name: string;
- // The offer, in credits ("25,000 credits").
- credits: string;
- // How long the credits live once claimed, already worded ("7 days"), or
- // null when they never expire.
- lifetime: string | null;
- // The last day the link works, already worded ("September 10, 2026").
- claimBy: string;
- claimUrl: string;
- unsubscribeUrl: string;
-};
-
-export default function CreditsOfferedEmail({
- name,
- credits,
- lifetime,
- claimBy,
- claimUrl,
- unsubscribeUrl,
-}: CreditsOfferedEmailProps) {
- return (
- <Html>
- <Head />
- <Preview>{credits} are waiting on your Donkey Cut account.</Preview>
- <Tailwind config={{ presets: [pixelBasedPreset] }}>
- <Body className="bg-white font-sans text-[#0F0E0D]">
- <Container className="mx-auto max-w-[520px] px-6 py-12">
- <DonkeyMark />
- <Text className="text-[15px] leading-relaxed">Hey {name},</Text>
- <Text className="text-[15px] leading-relaxed">
- I added {credits} to your Donkey Cut account. Click
- below to claim them.
- </Text>
- <Button
- href={claimUrl}
- className="rounded-lg bg-[#0F0E0D] px-6 py-3 text-[15px] font-semibold text-[#F5EFE0]"
- >
- Claim {credits}
- </Button>
- <Text className="text-[15px] leading-relaxed">
- The link works until {claimBy}.{" "}
- {lifetime !== null
- ? `Once claimed, they are good for ${lifetime}. `
- : ""}
- You can use them for Edit with Chat, or to generate videos,
- images, audio, and voice.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- If you have any questions, just reply to this email. It goes
- straight to my inbox.
- </Text>
- <Text className="text-[15px] leading-relaxed">David</Text>
- <Hr className="mt-6 border-[#0F0E0D]/15" />
- <Text className="text-[12px] leading-relaxed text-[#0F0E0D]/60">
- You&apos;re receiving this because you created a Donkey Cut
- account.{" "}
- <Link
- href={unsubscribeUrl}
- className="text-[#0F0E0D]/60 underline"
- >
- Unsubscribe
- </Link>{" "}
- from product emails.
- </Text>
- </Container>
- </Body>
- </Tailwind>
- </Html>
- );
-}
-
-CreditsOfferedEmail.PreviewProps = {
- name: "Ada",
- credits: "25,000 credits",
- lifetime: "7 days",
- claimBy: "September 10, 2026",
- claimUrl: "https://donkeycut.com/app?claim=preview",
- unsubscribeUrl: "https://donkeycut.com/unsubscribe?token=preview",
-} satisfies CreditsOfferedEmailProps;
diff --git a/site/src/emails/outreach.tsx b/site/src/emails/outreach.tsx
deleted file mode 100644
index 58698196..00000000
--- a/site/src/emails/outreach.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Fragment } from "react";
-import { Body, Button, Head, Html, Link, Text } from "react-email";
-
-type Props = {
- blocks: ({ kind: "text"; text: string } | { kind: "button" })[];
- cta: { label: string; url: string };
- unsubscribeUrl: string | null;
-};
-
-export default function OutreachEmail({ blocks, cta, unsubscribeUrl }: Props) {
- return (
- <Html>
- <Head />
- <Body style={{ fontFamily: "Arial, sans-serif", color: "#0F0E0D", backgroundColor: "#ffffff" }}>
- {blocks.map((block, index) => block.kind === "button" ? (
- <Button key={index} href={cta.url} style={{ backgroundColor: "#0F0E0D", color: "#ffffff", padding: "12px 24px", borderRadius: 8, fontSize: 15, fontWeight: 600 }}>
- {cta.label}
- </Button>
- ) : (
- <Text key={index} style={{ fontSize: 15, lineHeight: "24px", margin: "0 0 16px" }}>
- {block.text.split("\n").map((line, lineIndex) => (
- <Fragment key={lineIndex}>{lineIndex > 0 ? <br /> : null}{line}</Fragment>
- ))}
- </Text>
- ))}
- {unsubscribeUrl ? (
- <Text style={{ marginTop: 24, fontSize: 12, color: "#666666" }}>
- <Link href={unsubscribeUrl} style={{ color: "#666666" }}>Unsubscribe from product emails</Link>
- </Text>
- ) : null}
- </Body>
- </Html>
- );
-}
diff --git a/site/src/emails/promotion.tsx b/site/src/emails/promotion.tsx
deleted file mode 100644
index b134c857..00000000
--- a/site/src/emails/promotion.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import {
- Body,
- Button,
- Container,
- Head,
- Hr,
- Html,
- Link,
- Preview,
- Tailwind,
- Text,
- pixelBasedPreset,
-} from "react-email";
-import { Fragment } from "react";
-
-import { DonkeyMark } from "./_components/DonkeyMark";
-
-// A promotion: its paragraphs, an optional button, and the
-// opt-out footer. Sent by src/lib/marketing/promotions.ts; preview with
-// `npm run email:dev`. This module stays pure — the react-email preview server
-// bundles it on its own, so everything it needs comes in as props.
-
-type Block = { kind: "text"; text: string } | { kind: "button" };
-
-type PromotionEmailProps = {
- preview: string;
- blocks: Block[];
- cta: { label: string; url: string } | null;
- unsubscribeUrl: string;
-};
-
-function lines(text: string) {
- const parts = text.split("\n");
- return parts.map((line, i) => (
- <Fragment key={i}>
- {i > 0 ? <br /> : null}
- {line}
- </Fragment>
- ));
-}
-
-export default function PromotionEmail({
- preview,
- blocks,
- cta,
- unsubscribeUrl,
-}: PromotionEmailProps) {
- return (
- <Html>
- <Head />
- <Preview>{preview}</Preview>
- <Tailwind config={{ presets: [pixelBasedPreset] }}>
- <Body className="bg-white font-sans text-[#0F0E0D]">
- <Container className="mx-auto max-w-[520px] px-6 py-12">
- <DonkeyMark />
- {blocks.map((block, i) =>
- block.kind === "button" && cta ? (
- <Button
- key={i}
- href={cta.url}
- className="my-4 rounded-lg bg-[#0F0E0D] px-6 py-3 text-[15px] font-semibold text-[#F5EFE0]"
- >
- {cta.label}
- </Button>
- ) : block.kind === "text" ? (
- <Text key={i} className="text-[15px] leading-relaxed">
- {lines(block.text)}
- </Text>
- ) : null,
- )}
- <Hr className="mt-6 border-[#0F0E0D]/15" />
- <Text className="text-[12px] leading-relaxed text-[#0F0E0D]/60">
- You&apos;re receiving this because you created a Donkey Cut
- account.{" "}
- <Link
- href={unsubscribeUrl}
- className="text-[#0F0E0D]/60 underline"
- >
- Unsubscribe
- </Link>
- </Text>
- </Container>
- </Body>
- </Tailwind>
- </Html>
- );
-}
-
-PromotionEmail.PreviewProps = {
- preview: "Hey Ada,",
- blocks: [
- { kind: "text", text: "Hey Ada," },
- { kind: "text", text: "Get Pro before October 29 and every month that starts by then includes 100,000 AI credits, 5× the usual 20,000." },
- { kind: "button" },
- { kind: "text", text: "David" },
- ],
- cta: { label: "Get Pro", url: "https://donkeycut.com/app/settings" },
- unsubscribeUrl: "https://donkeycut.com/unsubscribe?token=preview",
-} satisfies PromotionEmailProps;
diff --git a/site/src/emails/welcome.tsx b/site/src/emails/welcome.tsx
deleted file mode 100644
index fd3f2846..00000000
--- a/site/src/emails/welcome.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import {
- Body,
- Container,
- Head,
- Hr,
- Html,
- Link,
- Preview,
- Tailwind,
- Text,
- pixelBasedPreset,
-} from "react-email";
-
-import { CommunityPs } from "./_components/CommunityPs";
-import { DonkeyMark } from "./_components/DonkeyMark";
-
-// The one email a new account gets: a personal note from David. Sent by
-// src/lib/email/send-welcome.ts; preview with `npm run email:dev`. The credit
-// amount arrives as a prop: it is whatever the signup grant landed, sized by
-// the signupCredits setting. This module stays pure — the react-email preview server bundles it
-// on its own, so everything it needs comes in as props and asset/link URLs are
-// absolute.
-
-type WelcomeEmailProps = {
- name: string;
- // The signup grant as people read it ("500 credits"); null when the
- // account received none.
- credits: string | null;
- unsubscribeUrl: string;
-};
-
-export default function WelcomeEmail({
- name,
- credits,
- unsubscribeUrl,
-}: WelcomeEmailProps) {
- return (
- <Html>
- <Head />
- <Preview>
- I built Donkey Cut because I wanted a video editor that was simple and
- open source.
- </Preview>
- <Tailwind config={{ presets: [pixelBasedPreset] }}>
- <Body className="bg-white font-sans text-[#0F0E0D]">
- <Container className="mx-auto max-w-[520px] px-6 py-12">
- <DonkeyMark />
- <Text className="text-[15px] leading-relaxed">Hey {name},</Text>
- <Text className="text-[15px] leading-relaxed">
- Thanks for signing up.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- I&apos;m David, and I built Donkey Cut because I wanted a video
- editor that was simple and open source.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- My favorite feature is Edit with Chat. Instead of clicking
- through menus, I can just tell the editor what I want, and it
- does it for me.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- The editor will always have a free version, and the entire
- project is open source.
- </Text>
- {credits !== null && (
- <Text className="text-[15px] leading-relaxed">
- I also added {credits} to your account so you
- can try AI Chat or generate videos, images, audio, and more.
- </Text>
- )}
- <Text className="text-[15px] leading-relaxed">
- If you enjoy using Donkey Cut, I&apos;d really appreciate a ⭐ on
- GitHub. If you have questions, feedback, or just want to say hi,
- join the Discord. I&apos;m there every day.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- This email goes straight to my personal inbox, so feel free to
- reply anytime. I read every email.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- Thanks again for giving Donkey Cut a try.
- </Text>
- <Text className="text-[15px] leading-relaxed">
- Have a great day!
- </Text>
- <Text className="text-[15px] leading-relaxed">David</Text>
- <CommunityPs />
- <Hr className="mt-6 border-[#0F0E0D]/15" />
- <Text className="text-[12px] leading-relaxed text-[#0F0E0D]/60">
- You&apos;re receiving this because you created a Donkey Cut
- account.{" "}
- <Link
- href={unsubscribeUrl}
- className="text-[#0F0E0D]/60 underline"
- >
- Unsubscribe
- </Link>{" "}
- from product emails.
- </Text>
- </Container>
- </Body>
- </Tailwind>
- </Html>
- );
-}
-
-WelcomeEmail.PreviewProps = {
- name: "Ada",
- credits: "500 credits",
- unsubscribeUrl: "https://donkeycut.com/unsubscribe?token=preview",
-} satisfies WelcomeEmailProps;
diff --git a/site/src/lib/auth.ts b/site/src/lib/auth.ts
index 28325715..ed022865 100644
--- a/site/src/lib/auth.ts
+++ b/site/src/lib/auth.ts
@@ -63,16 +63,15 @@ export const auth = betterAuth({
user: {
create: {
// Every new account is provisioned with its signup credit grant, its
- // starter project, the welcome email, and its Resend contact.
- // provisionSignupGrants is idempotent and
- // swallows its own errors, so it never blocks user creation. The
- // request's headers carry the network the signup came from.
+ // starter project, and its fonts folder. provisionSignupGrants is
+ // idempotent and swallows its own errors, so it never blocks user
+ // creation. The request's headers carry the network the signup came
+ // from.
after: async (user, context) => {
await provisionSignupGrants(
{
email: user.email,
id: user.id,
- name: user.name,
},
context?.headers ?? context?.request?.headers,
);
diff --git a/site/src/lib/billing/pro-subscription.ts b/site/src/lib/billing/pro-subscription.ts
index df2a2f07..47de324a 100644
--- a/site/src/lib/billing/pro-subscription.ts
+++ b/site/src/lib/billing/pro-subscription.ts
@@ -15,8 +15,8 @@ import { prisma } from "@/lib/prisma";
// Donkey Pro: the Mac app subscription.
export const proPlanKey = "pro";
-// Stripe subscription statuses that include the Pro allowance. Exported as a
-// list so a database filter can reuse it (src/lib/jobs/outreach-scan.ts).
+// Stripe subscription statuses that include the Pro allowance, as a list so a
+// database filter can reuse it.
export const ACTIVE_PRO_STATUSES = ["active", "trialing"] as const;
const activeStatuses = new Set<string>(ACTIVE_PRO_STATUSES);
diff --git a/site/src/lib/billing/webhook-events.ts b/site/src/lib/billing/webhook-events.ts
index bc203c3d..f32a5747 100644
--- a/site/src/lib/billing/webhook-events.ts
+++ b/site/src/lib/billing/webhook-events.ts
@@ -1,14 +1,7 @@
-// Stripe events that change what the analytics show: money moving
-// or failing to, a subscription changing state, a checkout walked away from.
-// The webhook queues a billing refresh for each; the ones without a handler
-// of their own exist only for that. This list, plus the handled events, is
-// what the endpoint in Stripe is subscribed to (scripts/stripe-webhook-events.ts).
-export const ANALYTICS_BILLING_EVENTS = [
- "charge.failed",
- "charge.refunded",
- "charge.succeeded",
+// The Stripe events the webhook handles: what the endpoint in Stripe is
+// subscribed to (scripts/stripe-webhook-events.ts).
+export const STRIPE_WEBHOOK_EVENTS = [
"checkout.session.completed",
- "checkout.session.expired",
"customer.subscription.created",
"customer.subscription.deleted",
"customer.subscription.updated",
@@ -16,5 +9,4 @@ export const ANALYTICS_BILLING_EVENTS = [
"invoice.payment_failed",
"payment_intent.payment_failed",
"payment_intent.succeeded",
- "refund.created",
] as const;
diff --git a/site/src/lib/config/registry.test.ts b/site/src/lib/config/registry.test.ts
index 0a3af21d..80b45157 100644
--- a/site/src/lib/config/registry.test.ts
+++ b/site/src/lib/config/registry.test.ts
@@ -1,4 +1,3 @@
-import { DEFAULT_THRESHOLDS } from "@donkeycut/abexp";
import { describe, expect, test } from "bun:test";
import { PUBLIC_SETTING_KEYS, SETTINGS, SETTING_KEYS, defaultSettings } from "./registry";
@@ -15,17 +14,10 @@ describe("the product's settings registry", () => {
expect(Object.keys(publicSubset(defaultSettings())).sort()).toEqual([...PUBLIC_SETTING_KEYS].sort());
});
- test("the verdict bars ship as the package's defaults", () => {
- const shipped = defaultSettings().experimentResults;
- expect(shipped.graceDays).toBe(30);
- expect(shipped.shipPValue).toBe(DEFAULT_THRESHOLDS.shipPValue);
- expect(shipped.minExposedPerVariant).toBe(DEFAULT_THRESHOLDS.minExposedPerVariant);
- });
-
test("a bad override is reported and the default stands", () => {
- const resolved = resolveSettings({ experimentResults: { graceDays: "soon" } }, []);
- expect(resolved.settings.experimentResults).toEqual(SETTINGS.experimentResults.default);
- expect(resolved.invalid).toEqual([{ key: "experimentResults", layer: "override" }]);
+ const resolved = resolveSettings({ databasePool: { maxConnections: "many" } }, []);
+ expect(resolved.settings.databasePool).toEqual(SETTINGS.databasePool.default);
+ expect(resolved.invalid).toEqual([{ key: "databasePool", layer: "override" }]);
});
test("the signup grant is set to the cent", () => {
@@ -39,9 +31,9 @@ describe("the product's settings registry", () => {
});
test("an override of one field replaces the whole value", () => {
- const value = { ...SETTINGS.experimentResults.default, shipPValue: 0.1 };
- const resolved = resolveSettings({ experimentResults: value }, []);
- expect(resolved.settings.experimentResults.shipPValue).toBe(0.1);
+ const value = { ...SETTINGS.databasePool.default, maxConnections: 5 };
+ const resolved = resolveSettings({ databasePool: value }, []);
+ expect(resolved.settings.databasePool.maxConnections).toBe(5);
expect(resolved.invalid).toEqual([]);
});
});
diff --git a/site/src/lib/config/registry.ts b/site/src/lib/config/registry.ts
index 2d925a8b..2afdf928 100644
--- a/site/src/lib/config/registry.ts
+++ b/site/src/lib/config/registry.ts
@@ -1,5 +1,4 @@
import {
- DEFAULT_THRESHOLDS,
defaultSettings as defaultsOf,
defineSettings,
publicSettingKeys,
@@ -9,8 +8,6 @@ import {
type SettingsOf,
} from "@donkeycut/abexp";
import { z } from "zod";
-import { creditOfferTermsSchema } from "@/lib/credits/offerTerms";
-import { DEFAULT_EMAIL_PRIORITIES, EMAIL_KIND_IDS } from "@/lib/email/kindIds";
import { maxCreditGrantDollars, maxCreditGrantExpiryDays } from "@/lib/credits/top-up";
@@ -21,15 +18,6 @@ import { maxCreditGrantDollars, maxCreditGrantExpiryDays } from "@/lib/credits/t
// same declarations the server validates against. A feature that people might
// tune ships its setting here in the same change.
-function validTimeZone(zone: string): boolean {
- try {
- new Intl.DateTimeFormat("en-US", { timeZone: zone });
- return true;
- } catch {
- return false;
- }
-}
-
export const SETTINGS = defineSettings({
databasePool: {
schema: z.object({
@@ -97,13 +85,6 @@ export const SETTINGS = defineSettings({
title: "Shared library",
description: "Folders, assets, and templates returned per shared library page.",
},
- promotionCreditOffer: {
- schema: creditOfferTermsSchema.extend({ minimumAccountAgeDays: z.number().int().min(1).max(36500) }).strict(),
- default: { dollars: 15, claimWindowDays: 3, expiresAfterDays: 28, claim: "link", minimumAccountAgeDays: 7 },
- public: false,
- title: "Promotion credit offer",
- description: "Default credit offer and minimum account age for new promotion drafts. Saved drafts keep their terms.",
- },
chatRuntime: {
schema: z.object({
syncIntervalMs: z.number().int().min(1000).max(30000),
@@ -508,39 +489,6 @@ export const SETTINGS = defineSettings({
description:
"The loudness each export target masters to (social, podcast, broadcast), the target an export starts on, and the true-peak ceiling a mastered mix is limited under.",
},
- experimentResults: {
- schema: z
- .object({
- // An ended experiment keeps getting a fresh read for this long, so
- // late conversions still land in it.
- graceDays: z.number().int().min(0).max(365),
- // The sample a positive result is believed on.
- minExposedPerVariant: z.number().int().min(1),
- minConversions: z.number().int().min(1),
- // The smaller sample a loss can be called on.
- earlyMinExposed: z.number().int().min(1),
- earlyMinConversions: z.number().int().min(1),
- shipPValue: z.number().min(0).max(1),
- stopProbability: z.number().min(0).max(1),
- // The lift the sample-size estimate plans for.
- plannedRelativeLift: z.number().min(0.01).max(10),
- })
- .strict(),
- default: {
- graceDays: 30,
- minExposedPerVariant: DEFAULT_THRESHOLDS.minExposedPerVariant,
- minConversions: DEFAULT_THRESHOLDS.minConversions,
- earlyMinExposed: DEFAULT_THRESHOLDS.earlyMinExposed,
- earlyMinConversions: DEFAULT_THRESHOLDS.earlyMinConversions,
- shipPValue: DEFAULT_THRESHOLDS.shipPValue,
- stopProbability: DEFAULT_THRESHOLDS.stopProbability,
- plannedRelativeLift: DEFAULT_THRESHOLDS.plannedRelativeLift,
- },
- public: false,
- title: "Experiment results",
- description:
- "The bars a verdict is called against, and how long an ended experiment keeps being recomputed.",
- },
signupCredits: {
schema: z
.object({
@@ -571,88 +519,6 @@ export const SETTINGS = defineSettings({
title: "Signup credits per network",
description: "How many new accounts from one network get the signup credits within the window; later accounts from it start with none.",
},
- emailSendBudget: {
- schema: z
- .object({
- // Emails the provider's plan includes per billing cycle.
- monthlyAllowance: z.number().int().min(1).max(10_000_000),
- // Day of the month the plan renews, at UTC midnight.
- renewalDay: z.number().int().min(1).max(31),
- // Slots kept free per work day for emails sent by hand, held for
- // every work day left in the cycle.
- manualReserve: z.number().int().min(0).max(100000),
- manualTimeZone: z.string().refine(validTimeZone, "Unknown IANA time zone"),
- // Work hours in that zone, start inclusive and end exclusive.
- manualStartHour: z.number().int().min(0).max(23),
- manualEndHour: z.number().int().min(1).max(24),
- manualWeekdaysOnly: z.boolean(),
- // Days of signup history the transactional forecast averages over.
- signupLookbackDays: z.number().int().min(1).max(90),
- // Slots kept free beyond the forecast for transactional email the
- // forecast cannot see, such as credit offers sent by hand.
- transactionalHeadroom: z.number().int().min(0).max(1_000_000),
- })
- .strict()
- .refine((v) => v.manualStartHour < v.manualEndHour, { message: "Work hours must end after they start." })
- // A cycle holds at most 31 work days, so this keeps every ceiling above zero.
- .refine((v) => v.manualReserve * 31 + v.transactionalHeadroom < v.monthlyAllowance, {
- message: "The reserves must leave room for bulk sends over a 31-day cycle.",
- }),
- default: {
- monthlyAllowance: 50000,
- renewalDay: 11,
- manualReserve: 10,
- manualTimeZone: "Asia/Seoul",
- manualStartHour: 9,
- manualEndHour: 18,
- manualWeekdaysOnly: true,
- signupLookbackDays: 7,
- transactionalHeadroom: 200,
- },
- public: false,
- title: "Email send budget",
- description:
- "The plan's monthly allowance and renewal day, the slots held per work day for emails sent by hand, and how the transactional forecast that holds slots ahead of promotions is sized.",
- },
- emailPriorities: {
- schema: z
- // A kind added after the override was saved reads its default, so the
- // saved order for the rest keeps holding.
- .object(
- Object.fromEntries(
- EMAIL_KIND_IDS.map((id) => [id, z.number().int().min(0).max(1000).default(DEFAULT_EMAIL_PRIORITIES[id])]),
- ),
- )
- .strict(),
- default: { ...DEFAULT_EMAIL_PRIORITIES },
- public: false,
- title: "Email priorities",
- description: "The order the outbox sends in when the budget is short: higher goes first. A change applies to emails queued from then on.",
- },
- creditExpiryNotice: {
- schema: z
- .object({
- // How many days before a given grant expires its account is emailed.
- daysBefore: z.number().int().min(1).max(maxCreditGrantExpiryDays),
- })
- .strict(),
- default: { daysBefore: 3 },
- public: false,
- title: "Credit expiry notice",
- description: "How many days before signup or manually granted credits expire the account is emailed.",
- },
- manualCreditOffer: {
- schema: z
- .object({
- // Days the emailed claim link stays open after it is sent.
- claimWindowDays: z.number().int().min(1).max(365),
- })
- .strict(),
- default: { claimWindowDays: 3 },
- public: false,
- title: "Manual credit offer",
- description: "How many days the claim link in a credit offer email stays open.",
- },
subscribeBonus: {
schema: z
.object({
diff --git a/site/src/lib/email/click.test.ts b/site/src/lib/email/click.test.ts
index a9582216..85ea05e8 100644
--- a/site/src/lib/email/click.test.ts
+++ b/site/src/lib/email/click.test.ts
@@ -1,25 +1,41 @@
import { describe, expect, test } from "bun:test";
-import { clickUrl, verifyClick } from "./click";
+import { verifyClick } from "./click";
+import { verifyUnsubscribeToken } from "./unsubscribe";
-process.env.BETTER_AUTH_SECRET ??= "test-secret";
+// The back office signs these links and this site checks them, so the token
+// format is a contract between two repos. The same vectors sit in the back
+// office's click.test.ts, which asserts it produces them: a change to the
+// domain, the message layout or the encoding on either side fails there or
+// here until both move.
+process.env.BETTER_AUTH_SECRET = "test-secret";
+
+const CLICK = {
+ sendId: "send_1",
+ url: "https://donkeycut.com/app?claim=abc",
+ token: "hnO3dPvX8ZIT34FfaT73cRkObMS2B7wQcKvVv3DE3dQ",
+};
+const UNSUBSCRIBE = { userId: "user_1", token: "user_1.DdhcnCkxaz6OeRbHqKZO6hgdhXMF-nNWJtRWiLm69l8" };
describe("click links", () => {
- test("a link verifies for its own row and destination", () => {
- const url = new URL(clickUrl("send_1", "https://donkeycut.com/app?claim=abc"));
- const s = url.searchParams.get("s")!;
- const u = url.searchParams.get("u")!;
- const t = url.searchParams.get("t")!;
- expect(s).toBe("send_1");
- expect(u).toBe("https://donkeycut.com/app?claim=abc");
- expect(verifyClick(s, u, t)).toBe(true);
+ test("the back office's token verifies for its row and destination", () => {
+ expect(verifyClick(CLICK.sendId, CLICK.url, CLICK.token)).toBe(true);
+ });
+
+ test("a changed row, destination or token fails", () => {
+ expect(verifyClick("send_2", CLICK.url, CLICK.token)).toBe(false);
+ expect(verifyClick(CLICK.sendId, "https://evil.example/", CLICK.token)).toBe(false);
+ expect(verifyClick(CLICK.sendId, CLICK.url, "nope")).toBe(false);
+ });
+});
+
+describe("unsubscribe links", () => {
+ test("the back office's token names its account", () => {
+ expect(verifyUnsubscribeToken(UNSUBSCRIBE.token)).toBe(UNSUBSCRIBE.userId);
});
- test("a changed row or destination fails", () => {
- const url = new URL(clickUrl("send_1", "https://donkeycut.com/app"));
- const t = url.searchParams.get("t")!;
- expect(verifyClick("send_2", "https://donkeycut.com/app", t)).toBe(false);
- expect(verifyClick("send_1", "https://evil.example/", t)).toBe(false);
- expect(verifyClick("send_1", "https://donkeycut.com/app", "nope")).toBe(false);
+ test("a token for another account or with no signature fails", () => {
+ expect(verifyUnsubscribeToken(UNSUBSCRIBE.token.replace("user_1.", "user_2."))).toBeNull();
+ expect(verifyUnsubscribeToken("user_1")).toBeNull();
});
});
diff --git a/site/src/lib/email/click.ts b/site/src/lib/email/click.ts
index bb62e2fe..6eebffae 100644
--- a/site/src/lib/email/click.ts
+++ b/site/src/lib/email/click.ts
@@ -1,6 +1,5 @@
import { createHmac, timingSafeEqual } from "node:crypto";
-import { DONKEYCUT_CANONICAL } from "@/cut/lib/hosts";
import { prisma } from "@/lib/prisma";
// A button in a promotion goes through this app first, so the send row learns
@@ -16,11 +15,6 @@ function signature(sendId: string, url: string): Buffer {
return createHmac("sha256", key).update(`${sendId}\n${url}`).digest();
}
-export function clickUrl(sendId: string, url: string): string {
- const params = new URLSearchParams({ s: sendId, u: url, t: signature(sendId, url).toString("base64url") });
- return `${DONKEYCUT_CANONICAL}/api/email/click?${params}`;
-}
-
export function verifyClick(sendId: string, url: string, token: string): boolean {
const expected = signature(sendId, url);
const given = Buffer.from(token, "base64url");
diff --git a/site/src/lib/email/credit-expiry-due.ts b/site/src/lib/email/credit-expiry-due.ts
deleted file mode 100644
index 660177dc..00000000
--- a/site/src/lib/email/credit-expiry-due.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import type { Prisma } from "@/generated/prisma/client";
-import { zeroCreditMicros } from "@/lib/credits/amounts";
-import { prisma } from "@/lib/prisma";
-
-// The grants an account is warned about: credit it was given. Purchased
-// credit never expires, and the Pro allowance turns over every month.
-export const NOTICED_GRANT_SOURCES = ["signup", "manual_dollar", "subscribe_bonus"] as const;
-
-const DAY_MS = 24 * 60 * 60 * 1000;
-
-export function metadataObject(metadata: Prisma.JsonValue | null): Prisma.JsonObject {
- return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata)
- ? metadata
- : {};
-}
-
-/** Whether the grant's account has already been told this grant expires. */
-export function expiryNoticed(metadata: Prisma.JsonValue | null): boolean {
- return typeof metadataObject(metadata).expiryNoticeSentAt === "string";
-}
-
-/** Grants still owed an expiry notice: expiring inside the window, holding
- * credit, and never noticed. */
-export async function pendingCreditExpiryGrants(now: Date, withinDays: number) {
- const grants = await prisma.userCreditGrant.findMany({
- orderBy: { expiresAt: "asc" },
- select: {
- id: true,
- expiresAt: true,
- metadata: true,
- remainingAmountMicros: true,
- user: { select: { email: true, id: true, name: true } },
- },
- where: {
- expiresAt: { gt: now, lte: new Date(now.getTime() + withinDays * DAY_MS) },
- remainingAmountMicros: { gt: zeroCreditMicros },
- source: { in: [...NOTICED_GRANT_SOURCES] },
- status: "active",
- },
- });
- return { due: grants.length, pending: grants.filter((g) => !expiryNoticed(g.metadata)) };
-}
diff --git a/site/src/lib/email/credit-expiry-notices.ts b/site/src/lib/email/credit-expiry-notices.ts
deleted file mode 100644
index 711ed6c6..00000000
--- a/site/src/lib/email/credit-expiry-notices.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { creditMicrosToString } from "@/lib/credits/amounts";
-import { metadataObject, pendingCreditExpiryGrants } from "@/lib/email/credit-expiry-due";
-import { queueEmails } from "@/lib/email/outbox";
-import { creditsExpiringIdempotencyKey } from "@/lib/email/send-credits-expiring";
-import { prisma } from "@/lib/prisma";
-
-// Queues one expiry notice for every account holding a given grant that
-// expires inside the window and has not been told. The outbox row is keyed
-// on the grant, so a run that overlaps the last one adds nothing; the send
-// is recorded on the grant's metadata once it goes out. Credit on the
-// account is account mail, so the marketing opt-out does not apply; the
-// footer still offers it.
-export async function queueDueCreditExpiryNotices(input: { now?: Date; withinDays: number }) {
- const now = input.now ?? new Date();
- const { due, pending } = await pendingCreditExpiryGrants(now, input.withinDays);
- const queued = await queueEmails(
- pending
- .filter((grant) => grant.expiresAt)
- .map((grant) => ({
- idempotencyKey: creditsExpiringIdempotencyKey(grant.id),
- kind: "credit-expiry",
- payload: { credits: creditMicrosToString(grant.remainingAmountMicros), grantId: grant.id },
- userId: grant.user.id,
- })),
- );
- return { due, pending: pending.length, queued };
-}
-
-export async function recordExpiryNoticeSent(grantId: string): Promise<void> {
- const grant = await prisma.userCreditGrant.findUnique({ select: { metadata: true }, where: { id: grantId } });
- if (!grant) return;
- await prisma.userCreditGrant.update({
- data: { metadata: { ...metadataObject(grant.metadata), expiryNoticeSentAt: new Date().toISOString() } },
- where: { id: grantId },
- });
-}
diff --git a/site/src/lib/email/errors.ts b/site/src/lib/email/errors.ts
deleted file mode 100644
index 5e976f76..00000000
--- a/site/src/lib/email/errors.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thrown by a builder when the email can never go out as queued: the row is
-// given up without a retry and the message lands on it.
-export class PermanentSendError extends Error {
- public constructor(message: string) {
- super(message);
- this.name = "PermanentSendError";
- }
-}
diff --git a/site/src/lib/email/fixtures/unsubscribed.ts b/site/src/lib/email/fixtures/unsubscribed.ts
deleted file mode 100644
index cdb35632..00000000
--- a/site/src/lib/email/fixtures/unsubscribed.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-import { mock } from "bun:test";
-import assert from "node:assert/strict";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { DEFAULT_EMAIL_PRIORITIES } from "@/lib/email/kindIds";
-import type { OutreachPayload } from "@/lib/marketing/send-outreach";
-
-let optedOut = true;
-let state = "queued";
-const now = new Date();
-const user = { id: "user", email: "[email protected]", name: "Reader" };
-const payload: OutreachPayload = {
- outreachId: "outreach", attempt: 1, actorUserId: "operator", subject: "Hello {{firstName}}",
- body: "A note", creditOffer: null, unsubscribeLink: false, trackReplies: false,
- vars: { balance: "0", email: user.email, firstName: user.name, name: user.name, spent: "0", storage: "0" },
-};
-const row = {
- id: "send", kind: "outreach", idempotencyKey: "outreach:outreach:1", payload, userId: user.id,
- promotionId: null, attempts: 0, error: null, priority: 80, rank: 0, notBefore: now, createdAt: now,
- updatedAt: now, sentAt: null, clickedAt: null,
-};
-const updates: Prisma.EmailSendUpdateManyArgs[] = [];
-const send = mock(() => { throw new Error("Unexpected provider send"); });
-const schedule = mock(() => { throw new Error("Unexpected retry job"); });
-mock.module("@/lib/prisma", () => ({ prisma: {
- user: { findUnique: async () => user },
- userEmailSettings: { findUnique: async () => ({ marketingUnsubscribedAt: optedOut ? now : null }) },
- emailSend: {
- createMany: async () => ({ count: 1 }),
- findUniqueOrThrow: async () => ({ ...row, state }),
- findMany: async () => [],
- findFirst: async () => null,
- groupBy: async () => [],
- update: async ({ data }: { data: { state: string; error: unknown } }) => {
- state = data.state;
- assert.equal(data.error, null);
- return { ...row, state };
- },
- updateMany: async (args: Prisma.EmailSendUpdateManyArgs) => {
- updates.push(args);
- if (args.where?.user) {
- assert.equal(args.where.state, "failed");
- assert.deepEqual(args.where.user, { emailSettings: { marketingUnsubscribedAt: { not: null } } });
- assert.deepEqual(args.data, { error: null, state: "skipped" });
- assert.deepEqual(args.where.kind, { in: ["outreach", "promotion-hand", "outreach-test", "promotion"] });
- if (state !== "failed" || !optedOut) return { count: 0 };
- state = "skipped";
- return { count: 1 };
- }
- if (args.where?.state === "failed" && state !== "failed") return { count: 0 };
- return { count: 1 };
- },
- },
- promotion: { findMany: async () => [] },
- asyncJob: { findMany: async () => [] },
-} }));
-mock.module("@/lib/config/effective", () => ({ getGlobalSetting: async () => DEFAULT_EMAIL_PRIORITIES }));
-mock.module("@/lib/email/resend", () => ({
- emailFrom: () => "Donkey <[email protected]>",
- bulkFrom: () => "Donkey <[email protected]>",
- isResendConfigured: () => true,
- getResend: () => ({ emails: { send } }),
- ResendNotConfiguredError: class extends Error {},
-}));
-mock.module("@/lib/email/send-budget", () => ({
- withEmailBudget: async (_kind: string, work: () => Promise<unknown>) => work(),
- emailBudgetStatus: async () => ({}),
- EmailBudgetError: class extends Error {},
-}));
-mock.module("@/lib/jobs/queue", () => ({ ensureJob: schedule }));
-
-const { deliverEmail, drainOutbox, outboxOverview, retryEmail } = await import("@/lib/email/outbox");
-const { buildOutreachEmail } = await import("@/lib/marketing/send-outreach");
-assert.equal(await buildOutreachEmail(payload, user), null);
-optedOut = false;
-assert.equal((await buildOutreachEmail(payload, user))?.subject, "Hello Reader");
-optedOut = true;
-assert.deepEqual(await deliverEmail({ kind: "outreach", payload, idempotencyKey: row.idempotencyKey, userId: user.id }), {
- id: row.id, state: "skipped", error: null,
-});
-assert.equal(send.mock.calls.length, 0);
-
-state = "failed";
-assert.equal(await retryEmail(row.id), false);
-assert.equal(updates.at(-2)?.where?.id, row.id);
-assert.equal(state, "skipped");
-assert.equal(schedule.mock.calls.length, 0);
-
-state = "failed";
-await outboxOverview();
-assert.equal(state, "skipped");
-state = "failed";
-await drainOutbox(1000);
-assert.equal(state, "skipped");
-
-optedOut = false;
-state = "failed";
-await outboxOverview();
-assert.equal(state, "failed");
diff --git a/site/src/lib/email/kindIds.ts b/site/src/lib/email/kindIds.ts
deleted file mode 100644
index d6ba316f..00000000
--- a/site/src/lib/email/kindIds.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// The kinds of email the site sends, and where each stands in the queue. The
-// server side of a kind (what it builds, whose quota it spends) is in
-// src/lib/email/kinds.ts; this file is client-safe so the settings registry
-// can declare the priorities.
-export const EMAIL_KIND_IDS = [
- "reply-forward",
- "credit-offer",
- "outreach",
- "promotion-hand",
- "outreach-test",
- "promotion-test",
- "welcome",
- "credit-expiry",
- "promotion",
-] as const;
-
-export type EmailKindId = (typeof EMAIL_KIND_IDS)[number];
-
-// Higher goes first. A reply from a user beats everything; a campaign yields
-// to every email a single account is waiting on, and a promotion sent by hand
-// to one person goes with the other mail sent by hand.
-export const DEFAULT_EMAIL_PRIORITIES: Record<EmailKindId, number> = {
- "reply-forward": 100,
- "credit-offer": 90,
- outreach: 80,
- "promotion-hand": 75,
- "outreach-test": 72,
- "promotion-test": 70,
- welcome: 60,
- "credit-expiry": 50,
- promotion: 10,
-};
diff --git a/site/src/lib/email/kinds.ts b/site/src/lib/email/kinds.ts
deleted file mode 100644
index ccb39731..00000000
--- a/site/src/lib/email/kinds.ts
+++ /dev/null
@@ -1,223 +0,0 @@
-import { z } from "zod";
-
-import { creditOfferClaimUrl, createTermsCreditOffer } from "@/lib/credits/offers";
-import { clickUrl } from "@/lib/email/click";
-import { recordExpiryNoticeSent } from "@/lib/email/credit-expiry-notices";
-import type { EmailSendKind } from "@/lib/email/send-budget";
-import { PermanentSendError } from "@/lib/email/errors";
-import type { EmailKindId } from "@/lib/email/kindIds";
-import type { EmailMessage, EmailUser } from "@/lib/email/resend";
-import { buildCreditsExpiringEmail } from "@/lib/email/send-credits-expiring";
-import { buildCreditsOfferedEmail } from "@/lib/email/send-credits-offered";
-import { buildWelcomeEmail, recordWelcomeSent } from "@/lib/email/send-welcome";
-import { isMarketingUnsubscribed } from "@/lib/email/unsubscribe";
-import { buildReplyForwardEmail, replyForwardPayloadSchema } from "@/lib/marketing/forward-reply";
-import { UnknownPlaceholderError } from "@/lib/marketing/placeholders";
-import { creditOfferTermsOf } from "@/lib/credits/offerTerms";
-import { buildPromotionEmail, promotionCopyOf } from "@/lib/marketing/promotions";
-import {
- buildOutreachEmail,
- outreachPayloadSchema,
- outreachTestOfferScope,
- recordOutreachSent,
-} from "@/lib/marketing/send-outreach";
-import { prisma } from "@/lib/prisma";
-
-// What each kind of email is on the server: whose quota it spends, what its
-// payload holds, how the message is built, and what to write down once it
-// went. A new kind is an entry here plus its id and priority in kindIds.ts.
-
-export type OutboxRow = {
- id: string;
- userId: string | null;
- promotionId: string | null;
- idempotencyKey: string;
-};
-
-export type EmailKind<P = unknown> = {
- quota: EmailSendKind;
- respectsMarketingOptOut?: boolean;
- payload: z.ZodType<P>;
- // The message for the provider, or null when nothing should go out any
- // more (the account is gone or opted out): the row is dropped as skipped.
- build: (payload: P, row: OutboxRow) => Promise<EmailMessage | null>;
- // Bookkeeping once the provider accepted the message.
- afterSend?: (payload: P, row: OutboxRow) => Promise<void>;
- // Bookkeeping when the row is given up for good.
- onAbandon?: (payload: P, row: OutboxRow, error: Error) => Promise<void>;
-};
-
-function define<P>(kind: EmailKind<P>): EmailKind<P> {
- return kind;
-}
-
-const USER_SELECT = { email: true, id: true, name: true } as const;
-
-async function userOf(row: OutboxRow): Promise<EmailUser | null> {
- if (!row.userId) throw new PermanentSendError("This email needs an account.");
- return prisma.user.findUnique({ select: USER_SELECT, where: { id: row.userId } });
-}
-
-const welcome = define({
- quota: "transactional",
- payload: z.object({ credits: z.string().nullable() }).strict(),
- build: async ({ credits }, row) => {
- const user = await userOf(row);
- return user ? buildWelcomeEmail(user, credits) : null;
- },
- afterSend: async (_payload, row) => recordWelcomeSent(row.userId!),
-});
-
-const creditExpiry = define({
- quota: "transactional",
- payload: z.object({ credits: z.string(), grantId: z.string().min(1) }).strict(),
- build: async ({ credits, grantId }, row) => {
- const [user, grant] = await Promise.all([
- userOf(row),
- prisma.userCreditGrant.findUnique({ select: { expiresAt: true, status: true }, where: { id: grantId } }),
- ]);
- if (!user || !grant?.expiresAt || grant.status !== "active") return null;
- return buildCreditsExpiringEmail(user, credits, grant.expiresAt);
- },
- afterSend: async ({ grantId }) => recordExpiryNoticeSent(grantId),
-});
-
-const creditOffer = define({
- quota: "manual",
- payload: z.object({ offerId: z.string().min(1) }).strict(),
- build: async ({ offerId }, row) => {
- const [user, offer] = await Promise.all([userOf(row), prisma.creditOffer.findUnique({ where: { id: offerId } })]);
- if (!user || !offer || offer.claimedAt || !offer.closesAt) return null;
- return buildCreditsOfferedEmail(user, {
- amountMicros: offer.amountMicros,
- claimUrl: creditOfferClaimUrl(offer.id),
- closesAt: offer.closesAt,
- expiresAfterDays: offer.expiresAfterDays,
- });
- },
- afterSend: async ({ offerId }) => {
- await prisma.creditOffer.update({ data: { emailSentAt: new Date() }, where: { id: offerId } });
- },
-});
-
-const outreach = define({
- quota: "manual",
- respectsMarketingOptOut: true,
- payload: outreachPayloadSchema,
- build: async (payload, row) => {
- const user = await userOf(row);
- return user ? buildOutreachEmail(payload, user) : null;
- },
- afterSend: async (payload) => recordOutreachSent(payload),
-});
-
-// The note as it stands, mailed to the operator with the row's values filled
-// in. A credit offer gives them their own working claim link; replies go to
-// the sending address, since the row's alias would file the row.
-const outreachTest = define({
- quota: "manual",
- respectsMarketingOptOut: true,
- payload: outreachPayloadSchema,
- build: async (payload, row) => {
- const user = await userOf(row);
- return user ? buildOutreachEmail({ ...payload, trackReplies: false }, user, outreachTestOfferScope(row.id)) : null;
- },
-});
-
-const replyForward = define({
- quota: "manual",
- payload: replyForwardPayloadSchema,
- build: (payload) => buildReplyForwardEmail(payload),
-});
-
-const promotionPayloadSchema = z.object({ promotionId: z.string().min(1) }).strict();
-
-async function promotionRowOf(promotionId: string) {
- const promotion = await prisma.promotion.findUnique({ where: { id: promotionId } });
- if (!promotion) throw new PermanentSendError("The promotion no longer exists.");
- return promotion;
-}
-
-// A copy error is permanent for the whole send: the draft comes back so the
-// operator can fix it, and the unsent rows go with it.
-async function abandonPromotion(promotionId: string, error: Error): Promise<void> {
- if (!(error instanceof PermanentSendError || error instanceof UnknownPlaceholderError)) return;
- await prisma.emailSend.deleteMany({ where: { promotionId, state: "queued" } });
- await prisma.promotion.update({ data: { status: "draft" }, where: { id: promotionId } });
-}
-
-// A promotion with a credit offer mails each person their own claim link and
-// the last day to use it, backed by an offer row that the real send and the
-// test send share. The real send's button is counted when followed.
-async function promotionEmailFor(
- promotion: Awaited<ReturnType<typeof promotionRowOf>>,
- user: EmailUser,
- trackClick?: (url: string) => string,
-) {
- const terms = creditOfferTermsOf(promotion.creditOffer);
- const offer = terms
- ? await createTermsCreditOffer({
- scope: promotion.id,
- userId: user.id,
- terms,
- offeredByUserId: promotion.actorUserId,
- })
- : null;
- return buildPromotionEmail(promotionCopyOf(promotion), user, offer?.vars, trackClick);
-}
-
-const promotion = define({
- quota: "bulk",
- respectsMarketingOptOut: true,
- payload: promotionPayloadSchema,
- build: async ({ promotionId }, row) => {
- const [user, promotion] = await Promise.all([userOf(row), promotionRowOf(promotionId)]);
- // The opt-out is read again right before the send, so someone who
- // unsubscribed after the segment was resolved is skipped.
- if (!user || (await isMarketingUnsubscribed(user.id))) return null;
- return promotionEmailFor(promotion, user, (url) => clickUrl(row.id, url));
- },
- onAbandon: async ({ promotionId }, _row, error) => abandonPromotion(promotionId, error),
-});
-
-// The saved copy mailed to the operator, placeholders filled with their own
-// account. A credit offer gives them their own working claim link.
-const promotionTest = define({
- quota: "manual",
- payload: promotionPayloadSchema,
- build: async ({ promotionId }, row) => {
- const [user, promotion] = await Promise.all([userOf(row), promotionRowOf(promotionId)]);
- if (!user) return null;
- return promotionEmailFor(promotion, user);
- },
-});
-
-// The same promotion email, sent to one person from their Outreach row. It
-// spends the manual quota so it goes now, and its outbox row is keyed like
-// the segment send's, so the promotion counts it and never mails the person
-// again. The row's outreach entry is filed as sent, like a note.
-const promotionHand = define({
- quota: "manual",
- respectsMarketingOptOut: true,
- payload: z
- .object({ promotionId: z.string().min(1), outreachId: z.string().min(1), actorUserId: z.string().min(1) })
- .strict(),
- build: async ({ promotionId }, row) => {
- const [user, promotion] = await Promise.all([userOf(row), promotionRowOf(promotionId)]);
- if (!user || (await isMarketingUnsubscribed(user.id))) return null;
- return promotionEmailFor(promotion, user, (url) => clickUrl(row.id, url));
- },
- afterSend: async ({ outreachId, actorUserId }) => recordOutreachSent({ outreachId, actorUserId }),
-});
-
-export const EMAIL_KINDS: Record<EmailKindId, EmailKind> = {
- "reply-forward": replyForward as EmailKind,
- "credit-offer": creditOffer as EmailKind,
- outreach: outreach as EmailKind,
- "outreach-test": outreachTest as EmailKind,
- "promotion-hand": promotionHand as EmailKind,
- "promotion-test": promotionTest as EmailKind,
- welcome: welcome as EmailKind,
- "credit-expiry": creditExpiry as EmailKind,
- promotion: promotion as EmailKind,
-};
diff --git a/site/src/lib/email/outbox.test.ts b/site/src/lib/email/outbox.test.ts
deleted file mode 100644
index 1123b77d..00000000
--- a/site/src/lib/email/outbox.test.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { expect, test } from "bun:test";
-import { execFile } from "node:child_process";
-import { fileURLToPath } from "node:url";
-import { promisify } from "node:util";
-
-test("unsubscribed email is skipped and existing failures settle without sending", async () => {
- // Isolate module mocks from the rest of the test suite.
- const { stdout, stderr } = await promisify(execFile)(process.execPath, [
- "run", fileURLToPath(new URL("./fixtures/unsubscribed.ts", import.meta.url)),
- ]);
- expect({ stdout, stderr }).toEqual({ stdout: "", stderr: "" });
-});
diff --git a/site/src/lib/email/outbox.ts b/site/src/lib/email/outbox.ts
deleted file mode 100644
index 197661e0..00000000
--- a/site/src/lib/email/outbox.ts
+++ /dev/null
@@ -1,436 +0,0 @@
-import type { Prisma } from "@/generated/prisma/client";
-import { getGlobalSetting } from "@/lib/config/effective";
-import {
- EmailBudgetError,
- emailBudgetStatus,
- type EmailBudgetStatus,
- type EmailSendKind,
- withEmailBudget,
-} from "@/lib/email/send-budget";
-import { PermanentSendError } from "@/lib/email/errors";
-import { EMAIL_KIND_IDS, type EmailKindId } from "@/lib/email/kindIds";
-import { EMAIL_KINDS, type OutboxRow } from "@/lib/email/kinds";
-import { getResend, isResendConfigured, ResendNotConfiguredError } from "@/lib/email/resend";
-import { UnknownPlaceholderError } from "@/lib/marketing/placeholders";
-import { prisma } from "@/lib/prisma";
-
-// The outbox. Every email is queued as a row and sent by the drainer in
-// priority order, each row under its kind's share of the cycle's budget. An
-// interactive send (an operator's note, a signup's welcome) is queued and
-// tried at once; when the budget refuses it, it waits its turn. The row is
-// the record: what went, what failed and why, and what is still owed.
-
-const PAGE = 50;
-// Provider rate limit: two requests a second.
-const PACE_MS = 550;
-const MAX_ATTEMPTS = 5;
-// A row claimed this long ago and never settled is a killed drainer's.
-const STALE_SENDING_MS = 15 * 60_000;
-
-const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
-
-export type QueueEmailInput = {
- kind: EmailKindId;
- payload: Prisma.InputJsonValue;
- idempotencyKey: string;
- userId?: string;
- promotionId?: string;
- rank?: number;
-};
-
-export type DeliverResult = { id: string; state: "sent" | "queued" | "failed" | "skipped"; error: string | null };
-
-type Outcome =
- | { outcome: "sent" | "failed" | "skipped" | "busy" }
- | { outcome: "refused" | "retried"; retryAfterSeconds: number };
-
-// A provider blip backs the row off, further each time, so a bad hour does
-// not burn its attempts.
-const backoffSeconds = (attempts: number) => attempts * 5 * 60;
-
-// Failed mail for an opted-out recipient is settled without another send.
-async function skipUnsubscribedFailures(id?: string): Promise<void> {
- await prisma.emailSend.updateMany({
- data: { error: null, state: "skipped" },
- where: {
- id,
- state: "failed",
- kind: { in: EMAIL_KIND_IDS.filter((kind) => EMAIL_KINDS[kind].respectsMarketingOptOut) },
- user: { emailSettings: { marketingUnsubscribedAt: { not: null } } },
- },
- });
-}
-
-function claimable(now: Date): Prisma.EmailSendWhereInput {
- return {
- OR: [{ state: "queued" }, { state: "sending", updatedAt: { lt: new Date(now.getTime() - STALE_SENDING_MS) } }],
- };
-}
-
-function isPermanent(error: unknown): boolean {
- return (
- error instanceof PermanentSendError ||
- error instanceof UnknownPlaceholderError ||
- error instanceof ResendNotConfiguredError
- );
-}
-
-function messageOf(error: unknown): string {
- return error instanceof Error ? error.message : String(error);
-}
-
-async function rowsOf(inputs: QueueEmailInput[]) {
- const priorities = await getGlobalSetting("emailPriorities");
- return inputs.map((input) => ({
- idempotencyKey: input.idempotencyKey,
- kind: input.kind,
- payload: input.payload,
- priority: priorities[input.kind],
- promotionId: input.promotionId,
- rank: input.rank ?? 0,
- userId: input.userId,
- }));
-}
-
-/** Queues many emails at once and sends for a drainer; rows already queued
- * under the same key are left as they are, and still get the drainer, so a
- * resumed promotion moves. Returns how many were new. */
-export async function queueEmails(inputs: QueueEmailInput[]): Promise<number> {
- if (inputs.length === 0) return 0;
- const { count } = await prisma.emailSend.createMany({ data: await rowsOf(inputs), skipDuplicates: true });
- await scheduleDrain(0);
- return count;
-}
-
-/** Queues one email and tries to send it now. When the budget refuses it, the
- * row waits for the drainer; a permanent failure is reported on the result. */
-export async function deliverEmail(input: QueueEmailInput): Promise<DeliverResult> {
- const [data] = await rowsOf([input]);
- await prisma.emailSend.createMany({ data: [data], skipDuplicates: true });
- const row = await prisma.emailSend.findUniqueOrThrow({ where: { idempotencyKey: input.idempotencyKey } });
- if (row.state === "queued") {
- const outcome = await sendRow(row, new Date());
- if (outcome.outcome === "refused" || outcome.outcome === "retried") await scheduleDrain(outcome.retryAfterSeconds);
- }
- const settled = await prisma.emailSend.findUniqueOrThrow({ select: { error: true, id: true, state: true }, where: { id: row.id } });
- const state = settled.state === "sending" ? "queued" : (settled.state as DeliverResult["state"]);
- return { error: settled.error, id: settled.id, state };
-}
-
-/** Makes sure a drainer is coming no later than the delay. One pending
- * drain job serves every caller; one held back for later is pulled forward. */
-export async function scheduleDrain(delaySeconds: number): Promise<void> {
- // Imported here because the job registry imports this module.
- const { ensureJob } = await import("@/lib/jobs/queue");
- await ensureJob("email-drain", {}, "system", { delaySeconds });
-}
-
-type DrainableRow = Awaited<ReturnType<typeof prisma.emailSend.findMany>>[number];
-
-async function sendRow(row: DrainableRow, now: Date): Promise<Outcome> {
- const claimed = await prisma.emailSend.updateMany({
- data: { state: "sending" },
- where: { id: row.id, ...claimable(now) },
- });
- if (claimed.count === 0) return { outcome: "busy" };
-
- const outboxRow: OutboxRow = { id: row.id, idempotencyKey: row.idempotencyKey, promotionId: row.promotionId, userId: row.userId };
- const kind = EMAIL_KINDS[row.kind as EmailKindId];
- const attempts = row.attempts + 1;
- const settle = (data: Prisma.EmailSendUpdateInput) => prisma.emailSend.update({ data, where: { id: row.id } });
-
- const giveUp = async (error: unknown, payload: unknown) => {
- await settle({ attempts, error: messageOf(error), state: "failed" });
- if (kind && payload !== undefined) await kind.onAbandon?.(payload, outboxRow, error instanceof Error ? error : new Error(messageOf(error)));
- return { outcome: "failed" } as const;
- };
-
- if (!kind) return giveUp(new PermanentSendError(`Unknown email kind "${row.kind}".`), undefined);
- const parsed = kind.payload.safeParse(row.payload);
- if (!parsed.success) return giveUp(new PermanentSendError("The stored payload is invalid."), undefined);
- const payload = parsed.data;
-
- try {
- if (!isResendConfigured()) throw new ResendNotConfiguredError();
- // The slot is held before the message is built, so anything the build
- // writes down (a claim window, say) dates from the send itself.
- const result = await withEmailBudget(kind.quota, async () => {
- const message = await kind.build(payload, outboxRow);
- return message ? getResend().emails.send(message, { idempotencyKey: row.idempotencyKey }) : null;
- });
- if (result === null) {
- await settle({ attempts, error: null, state: "skipped" });
- return { outcome: "skipped" };
- }
- if (result.error) throw new Error(`Resend send failed: ${result.error.name}: ${result.error.message}`);
- await settle({ attempts, error: null, sentAt: new Date(), state: "sent" });
- await kind.afterSend?.(payload, outboxRow);
- return { outcome: "sent" };
- } catch (error) {
- if (error instanceof EmailBudgetError) {
- await settle({ state: "queued" });
- return { outcome: "refused", retryAfterSeconds: error.retryAfterSeconds };
- }
- if (isPermanent(error) || attempts >= MAX_ATTEMPTS) return giveUp(error, payload);
- const retryAfterSeconds = backoffSeconds(attempts);
- await settle({
- attempts,
- error: messageOf(error),
- notBefore: new Date(now.getTime() + retryAfterSeconds * 1000),
- state: "queued",
- });
- return { outcome: "retried", retryAfterSeconds };
- }
-}
-
-export type DrainResult = {
- sent: number;
- failed: number;
- skipped: number;
- retried: number;
- // Seconds until the next thing worth coming back for: a refused budget
- // expected to open, or a backed-off row coming due. Null when nothing waits.
- retryAfterSeconds: number | null;
- // Whether the budget ran out with rows still owed.
- more: boolean;
-};
-
-/** Sends what the outbox holds, highest priority first, until the time or
- * the budget runs out. A refused budget class is left alone for the rest of
- * the run; the classes above it keep going. Given a kind, only that kind's
- * rows go. */
-export async function drainOutbox(budgetMs: number, kind?: EmailKindId): Promise<DrainResult> {
- const startedAt = Date.now();
- await skipUnsubscribedFailures();
- const result: DrainResult = { sent: 0, failed: 0, skipped: 0, retried: 0, retryAfterSeconds: null, more: false };
- const refused = new Map<EmailSendKind, number>();
- const touchedPromotions = new Set<string>();
-
- const refusedKinds = () =>
- (Object.keys(EMAIL_KINDS) as EmailKindId[]).filter((id) => refused.has(EMAIL_KINDS[id].quota));
-
- drain: for (;;) {
- const now = new Date();
- if (kind && refused.has(EMAIL_KINDS[kind].quota)) break;
- const rows = await prisma.emailSend.findMany({
- orderBy: [{ priority: "desc" }, { rank: "asc" }, { createdAt: "asc" }],
- take: PAGE,
- where: {
- AND: [
- claimable(now),
- { kind: kind ?? { notIn: refusedKinds() }, notBefore: { lte: now } },
- // A paused promotion's rows wait where they are.
- { OR: [{ promotionId: null }, { promotion: { status: { in: ["queuing", "sending"] } } }] },
- ],
- },
- });
- if (rows.length === 0) break;
- for (const row of rows) {
- if (Date.now() - startedAt > budgetMs) {
- result.more = true;
- break drain;
- }
- const quota = EMAIL_KINDS[row.kind as EmailKindId]?.quota;
- if (quota && refused.has(quota)) continue;
- const outcome = await sendRow(row, new Date());
- if (row.promotionId) touchedPromotions.add(row.promotionId);
- if (outcome.outcome === "refused") {
- if (quota) refused.set(quota, outcome.retryAfterSeconds);
- continue;
- }
- if (outcome.outcome !== "busy") result[outcome.outcome]++;
- if (outcome.outcome === "sent") await sleep(PACE_MS);
- }
- }
-
- await finishPromotions(touchedPromotions);
- const waits = [...refused.values()];
- const backedOff = await nextBackedOffRow(new Date(), kind);
- if (backedOff) waits.push(Math.max(1, Math.ceil((backedOff.getTime() - Date.now()) / 1000)));
- if (waits.length > 0) result.retryAfterSeconds = Math.min(...waits);
- return result;
-}
-
-// When the soonest row held back by a failed attempt comes due.
-async function nextBackedOffRow(now: Date, kind?: EmailKindId): Promise<Date | null> {
- const row = await prisma.emailSend.findFirst({
- orderBy: { notBefore: "asc" },
- select: { notBefore: true },
- where: {
- kind,
- notBefore: { gt: now },
- state: "queued",
- OR: [{ promotionId: null }, { promotion: { status: { in: ["queuing", "sending"] } } }],
- },
- });
- return row?.notBefore ?? null;
-}
-
-// A promotion with every recipient queued and nothing left to send is sent.
-// One still queuing is left to its job, which finishes it or hands it here.
-async function finishPromotions(promotionIds: Set<string>): Promise<void> {
- for (const promotionId of promotionIds) {
- const owed = await prisma.emailSend.count({ where: { promotionId, state: { in: ["queued", "sending"] } } });
- if (owed > 0) continue;
- await prisma.promotion.updateMany({
- data: { finishedAt: new Date(), status: "sent" },
- where: { id: promotionId, status: "sending" },
- });
- }
-}
-
-export type OutboxKindRow = {
- kind: EmailKindId;
- priority: number;
- quota: EmailSendKind;
- queued: number;
- sentToday: number;
- failed: number;
- // The drainer covering this kind: running or due now, or held back by a
- // quota wait until `resumesAt`; null when none is coming.
- drainer: { state: "running" } | { state: "held"; resumesAt: string } | null;
-};
-
-export type OutboxItem = {
- id: string;
- kind: string;
- state: string;
- priority: number;
- rank: number;
- email: string | null;
- promotionId: string | null;
- promotionName: string | null;
- attempts: number;
- error: string | null;
- notBefore: string;
- // Whether a failed attempt is holding the row back right now.
- backingOff: boolean;
- sentAt: string | null;
- createdAt: string;
-};
-
-// One promotion's standing across every row it ever queued, so a campaign
-// reads as one line with whole counts however many rows the lists show.
-export type OutboxCampaign = {
- id: string;
- name: string;
- queued: number;
- sent: number;
- skipped: number;
- failed: number;
-};
-
-export type OutboxOverview = {
- quota: EmailBudgetStatus;
- kinds: OutboxKindRow[];
- campaigns: OutboxCampaign[];
- // What is waiting, then what failed, then what went most recently.
- items: OutboxItem[];
-};
-
-const ITEMS = 60;
-
-/** The outbox at a glance: the cycle's budget, every kind's standing, and the
- * rows worth a look. */
-export async function outboxOverview(now = new Date()): Promise<OutboxOverview> {
- await skipUnsubscribedFailures();
- const dayStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()));
- const [quota, priorities, queued, sentToday, failed, byCampaign, waiting, broken, recent, drains] = await Promise.all([
- emailBudgetStatus(now),
- getGlobalSetting("emailPriorities"),
- prisma.emailSend.groupBy({ _count: true, by: ["kind"], where: { state: { in: ["queued", "sending"] } } }),
- prisma.emailSend.groupBy({ _count: true, by: ["kind"], where: { sentAt: { gte: dayStart }, state: "sent" } }),
- prisma.emailSend.groupBy({ _count: true, by: ["kind"], where: { state: "failed" } }),
- prisma.emailSend.groupBy({ _count: true, by: ["promotionId", "state"], where: { promotionId: { not: null } } }),
- prisma.emailSend.findMany({
- include: { promotion: { select: { name: true } }, user: { select: { email: true } } },
- orderBy: [{ priority: "desc" }, { rank: "asc" }, { createdAt: "asc" }],
- take: ITEMS,
- where: { state: { in: ["queued", "sending"] } },
- }),
- prisma.emailSend.findMany({
- include: { promotion: { select: { name: true } }, user: { select: { email: true } } },
- orderBy: { updatedAt: "desc" },
- take: ITEMS,
- where: { state: "failed" },
- }),
- prisma.emailSend.findMany({
- include: { promotion: { select: { name: true } }, user: { select: { email: true } } },
- orderBy: { updatedAt: "desc" },
- take: ITEMS,
- where: { state: { in: ["sent", "skipped"] } },
- }),
- prisma.asyncJob.findMany({
- select: { notBefore: true, payload: true },
- where: { kind: "email-drain", state: { in: ["queued", "running"] } },
- }),
- ]);
- // A drainer without a kind covers every kind. One running or due now is
- // draining; one held back for later is waiting on the budget, and the kind
- // reports the earliest of those.
- const drainers = drains.map((d) => ({
- kind: (d.payload as { kind?: EmailKindId } | null)?.kind ?? null,
- held: d.notBefore !== null && d.notBefore > now ? d.notBefore : null,
- }));
- const drainer = (kind: EmailKindId): OutboxKindRow["drainer"] => {
- const covering = drainers.filter((d) => d.kind === null || d.kind === kind);
- if (covering.some((d) => d.held === null)) return { state: "running" };
- const held = covering.map((d) => d.held).filter((t): t is Date => t !== null);
- if (held.length === 0) return null;
- return { state: "held", resumesAt: new Date(Math.min(...held.map((t) => t.getTime()))).toISOString() };
- };
- const countOf = (groups: { kind: string; _count: number }[], kind: string) =>
- groups.find((g) => g.kind === kind)?._count ?? 0;
- const kinds = EMAIL_KIND_IDS.map((kind) => ({
- kind,
- priority: priorities[kind],
- quota: EMAIL_KINDS[kind].quota,
- queued: countOf(queued, kind),
- sentToday: countOf(sentToday, kind),
- failed: countOf(failed, kind),
- drainer: drainer(kind),
- }));
- const campaignIds = [...new Set(byCampaign.map((g) => g.promotionId).filter((id): id is string => id !== null))];
- const names = await prisma.promotion.findMany({ select: { id: true, name: true }, where: { id: { in: campaignIds } } });
- const campaigns = names.map((p) => {
- const count = (states: string[]) =>
- byCampaign.filter((g) => g.promotionId === p.id && states.includes(g.state)).reduce((n, g) => n + g._count, 0);
- return {
- id: p.id,
- name: p.name,
- queued: count(["queued", "sending"]),
- sent: count(["sent"]),
- skipped: count(["skipped"]),
- failed: count(["failed"]),
- };
- });
- const items = [...waiting, ...broken, ...recent].map((row) => ({
- id: row.id,
- kind: row.kind,
- state: row.state,
- priority: row.priority,
- rank: row.rank,
- email: row.user?.email ?? null,
- promotionId: row.promotionId,
- promotionName: row.promotion?.name ?? null,
- attempts: row.attempts,
- error: row.error,
- notBefore: row.notBefore.toISOString(),
- backingOff: row.state === "queued" && row.notBefore.getTime() > now.getTime(),
- sentAt: row.sentAt?.toISOString() ?? null,
- createdAt: row.createdAt.toISOString(),
- }));
- return { quota, kinds, campaigns, items };
-}
-
-/** Puts a failed row back in the queue with a clean slate and sends for a
- * drainer. */
-export async function retryEmail(id: string): Promise<boolean> {
- await skipUnsubscribedFailures(id);
- const { count } = await prisma.emailSend.updateMany({
- data: { attempts: 0, error: null, notBefore: new Date(), state: "queued" },
- where: { id, state: "failed" },
- });
- if (count > 0) await scheduleDrain(0);
- return count > 0;
-}
diff --git a/site/src/lib/email/resend.ts b/site/src/lib/email/resend.ts
deleted file mode 100644
index 5b1ea66e..00000000
--- a/site/src/lib/email/resend.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Resend } from "resend";
-
-// The sending identity, in "Name <address@domain>" form. Env rather than code
-// so the open-source repo carries no personal address. Empty skips sends.
-export function emailFrom(): string {
- return process.env.RESEND_FROM_EMAIL ?? "";
-}
-
-// Who list mail comes from: the welcome email and promotions. A mail
-// provider keeps one reputation record per signing domain, so bulk sends get
-// a subdomain of their own and the apex in RESEND_FROM_EMAIL stays the
-// address a person writes from. Unset falls back to that shared sender, which
-// puts both streams on one domain.
-export function bulkFrom(): string {
- return process.env.RESEND_BULK_FROM_EMAIL || emailFrom();
-}
-
-// What every email path needs to know about an account.
-/** One message as the provider takes it. */
-export type EmailMessage = Parameters<Resend["emails"]["send"]>[0];
-
-export type EmailUser = {
- id: string;
- email: string;
- name: string;
-};
-
-export class ResendNotConfiguredError extends Error {
- public constructor() {
- super("RESEND_API_KEY is not configured.");
- this.name = "ResendNotConfiguredError";
- }
-}
-
-export function isResendConfigured(): boolean {
- return Boolean(process.env.RESEND_API_KEY);
-}
-
-let cachedResend: Resend | null = null;
-
-export function getResend(): Resend {
- const apiKey = process.env.RESEND_API_KEY;
- if (!apiKey) {
- throw new ResendNotConfiguredError();
- }
- cachedResend ??= new Resend(apiKey);
- return cachedResend;
-}
diff --git a/site/src/lib/email/send-budget.ts b/site/src/lib/email/send-budget.ts
deleted file mode 100644
index 796568a3..00000000
--- a/site/src/lib/email/send-budget.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-import { utcDayOf } from "@/lib/analytics/schema";
-import { getGlobalSetting } from "@/lib/config/effective";
-import {
- billingCycle,
- expectedTransactionalSends,
- workDaysRemaining,
- type BillingCycle,
- type TransactionalForecast,
-} from "@/lib/email/send-forecast";
-import { prisma } from "@/lib/prisma";
-
-// The plan's monthly allowance, spent across its billing cycle with three
-// ceilings on it. Manual sends run up to the allowance. Transactional sends
-// stop below the slots held for hand-sent mail on the work days left.
-// Bulk sends stop below what the rest of the cycle is forecast to need for
-// transactional email, so a campaign of any size goes out the day it is
-// sent and never blocks a welcome email, and takes the slots the forecast
-// releases as the cycle runs down. The count is kept per UTC day: a slot is
-// counted when it is reserved and given back when the send fails, so a
-// process that dies mid-send costs the cycle one slot.
-export type EmailSendKind = "manual" | "transactional" | "bulk";
-
-// How long a refused send waits before asking again. The reserves release
-// as work days and cycle days pass, the plan renews, and an operator can
-// raise the allowance at any time, so a held drainer looks again every hour
-// and never sleeps to a date computed under conditions that may change.
-const RETRY_SECONDS = 60 * 60;
-
-export class EmailBudgetError extends Error {
- public constructor(
- public readonly kind: EmailSendKind,
- public readonly limit: number,
- public readonly remaining: number,
- public readonly retryAfterSeconds: number,
- ) {
- super(`Email budget reached for ${kind} sends this cycle: ${remaining} of ${limit} available.`);
- this.name = "EmailBudgetError";
- }
-}
-
-function secondsUntil(date: Date, now: Date): number {
- return Math.max(1, Math.ceil((date.getTime() - now.getTime()) / 1000));
-}
-
-export type EmailBudgetStatus = {
- cycle: { start: string; end: string };
- // Sent this cycle, and the part of that sent today.
- sent: number;
- sentToday: number;
- allowance: number;
- // Slots held for hand-sent mail over the work days left in the cycle.
- manualReserve: number;
- forecast: TransactionalForecast;
- // How far each kind of send may go this cycle.
- ceilings: Record<EmailSendKind, number>;
- renewsInSeconds: number;
-};
-
-function cycleDays(cycle: BillingCycle) {
- return { gte: utcDayOf(cycle.start), lt: utcDayOf(cycle.end) };
-}
-
-/** Where the cycle stands: what went, and how far each kind of send can go. */
-export async function emailBudgetStatus(now = new Date()): Promise<EmailBudgetStatus> {
- const setting = await getGlobalSetting("emailSendBudget");
- const cycle = billingCycle(now, setting.renewalDay);
- const today = utcDayOf(now);
- const [total, todayRow] = await Promise.all([
- prisma.emailDailyQuota.aggregate({ _sum: { sent: true }, where: { day: cycleDays(cycle) } }),
- prisma.emailDailyQuota.findUnique({ select: { sent: true }, where: { day: today } }),
- ]);
- const manualReserve = setting.manualReserve * workDaysRemaining(now, cycle, setting);
- const forecast = await expectedTransactionalSends(now, cycle, setting);
- const transactional = setting.monthlyAllowance - manualReserve;
- return {
- cycle: { start: cycle.start.toISOString(), end: cycle.end.toISOString() },
- sent: total._sum.sent ?? 0,
- sentToday: todayRow?.sent ?? 0,
- allowance: setting.monthlyAllowance,
- manualReserve,
- forecast,
- ceilings: { manual: setting.monthlyAllowance, transactional, bulk: transactional - forecast.total },
- renewsInSeconds: secondsUntil(cycle.end, now),
- };
-}
-
-async function reserveSlot(day: string, kind: EmailSendKind, now: Date): Promise<void> {
- const status = await emailBudgetStatus(now);
- const limit = status.ceilings[kind];
- // Today's row may climb to the cycle ceiling less what earlier days spent.
- const todayLimit = limit - (status.sent - status.sentToday);
- await prisma.emailDailyQuota.createMany({ data: [{ day }], skipDuplicates: true });
- // One conditional increment: the row moves only while it is under the
- // ceiling, so two senders can never both take the last slot.
- const taken = await prisma.emailDailyQuota.updateMany({
- data: { sent: { increment: 1 } },
- where: { day, sent: { lt: todayLimit } },
- });
- if (taken.count > 0) return;
-
- const retryAfterSeconds = Math.min(RETRY_SECONDS, status.renewsInSeconds);
- throw new EmailBudgetError(kind, limit, Math.max(0, limit - status.sent), retryAfterSeconds);
-}
-
-async function releaseSlot(day: string): Promise<void> {
- await prisma.emailDailyQuota.updateMany({
- data: { sent: { decrement: 1 } },
- where: { day, sent: { gt: 0 } },
- });
-}
-
-/** Runs one provider send inside the cycle's budget, with the slot held
- * before the callback starts so what it builds goes out at once. The slot is
- * kept only when the provider accepted the email: a thrown error, a resolved
- * `{ error }`, or null (nothing to send) gives it back. */
-export async function withEmailBudget<T extends { error: unknown }>(
- kind: EmailSendKind,
- send: () => Promise<T | null>,
-): Promise<T | null> {
- const now = new Date();
- const day = utcDayOf(now);
- await reserveSlot(day, kind, now);
- const release = () =>
- releaseSlot(day).catch((releaseError) => {
- console.error("[email] failed to release an email budget slot", {
- day,
- error: releaseError instanceof Error ? releaseError.message : String(releaseError),
- });
- });
- let result: T | null;
- try {
- result = await send();
- } catch (error) {
- await release();
- throw error;
- }
- if (result === null || result.error) await release();
- return result;
-}
diff --git a/site/src/lib/email/send-credits-expiring.ts b/site/src/lib/email/send-credits-expiring.ts
deleted file mode 100644
index 56a70959..00000000
--- a/site/src/lib/email/send-credits-expiring.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { DONKEYCUT_CANONICAL } from "@/cut/lib/hosts";
-import { DONKEY_LOGO_CID, DONKEY_LOGO_PNG_BASE64 } from "@/emails/_components/logo";
-import CreditsExpiringEmail from "@/emails/credits-expiring";
-import { formatCredits } from "@/lib/credits/format-credits";
-import { formatCreditExpiry } from "@/lib/credits/top-up";
-import { bulkFrom, emailFrom, type EmailMessage, type EmailUser } from "@/lib/email/resend";
-import { unsubscribeActionUrl, unsubscribePageUrl } from "@/lib/email/unsubscribe";
-
-export function creditsExpiringIdempotencyKey(grantId: string): string {
- return `credits-expiring:${grantId}`;
-}
-
-// Tells one account what is left of a grant and the day it expires.
-// `credits` is the remaining amount as a decimal string.
-export function buildCreditsExpiringEmail(user: EmailUser, credits: string, expiresAt: Date): EmailMessage {
- const from = bulkFrom();
- if (!from) throw new Error("No bulk sender configured.");
- const firstName = user.name.trim().split(/\s+/)[0] || user.name;
- return {
- from,
- to: user.email,
- replyTo: emailFrom() || from,
- subject: `Your ${formatCredits(credits)} expire ${formatCreditExpiry(expiresAt)}`,
- react: CreditsExpiringEmail({
- credits: formatCredits(credits),
- editorUrl: `${DONKEYCUT_CANONICAL}/app`,
- expiresOn: formatCreditExpiry(expiresAt),
- name: firstName,
- unsubscribeUrl: unsubscribePageUrl(user.id),
- }),
- attachments: [
- {
- content: DONKEY_LOGO_PNG_BASE64,
- contentId: DONKEY_LOGO_CID,
- contentType: "image/png",
- filename: "donkey-cut.png",
- },
- ],
- headers: {
- "List-Unsubscribe": `<${unsubscribeActionUrl(user.id)}>`,
- "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
- },
- };
-}
diff --git a/site/src/lib/email/send-credits-offered.ts b/site/src/lib/email/send-credits-offered.ts
deleted file mode 100644
index 8cd34b89..00000000
--- a/site/src/lib/email/send-credits-offered.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { DONKEY_LOGO_CID, DONKEY_LOGO_PNG_BASE64 } from "@/emails/_components/logo";
-import CreditsOfferedEmail from "@/emails/credits-offered";
-import { creditMicrosToString } from "@/lib/credits/amounts";
-import { formatCredits } from "@/lib/credits/format-credits";
-import { formatCreditExpiry } from "@/lib/credits/top-up";
-import { bulkFrom, emailFrom, type EmailMessage, type EmailUser } from "@/lib/email/resend";
-import { unsubscribeActionUrl, unsubscribePageUrl } from "@/lib/email/unsubscribe";
-
-// How long a claimed offer lives, as people read it.
-export function describeCreditLifetime(days: number | null): string | null {
- if (days === null) return null;
- if (days % 365 === 0) return days === 365 ? "a year" : `${days / 365} years`;
- if (days % 30 === 0) return days === 30 ? "a month" : `${days / 30} months`;
- if (days % 7 === 0) return days === 7 ? "a week" : `${days / 7} weeks`;
- return days === 1 ? "a day" : `${days} days`;
-}
-
-// Tells the account credit is waiting and hands it the claim link. Credit
-// given by hand is account mail, so it goes whatever the marketing choice;
-// the footer still offers the opt-out.
-export function buildCreditsOfferedEmail(
- user: EmailUser,
- offer: { amountMicros: bigint; claimUrl: string; closesAt: Date; expiresAfterDays: number | null },
-): EmailMessage {
- const from = bulkFrom();
- if (!from) throw new Error("No bulk sender configured.");
- const credits = formatCredits(creditMicrosToString(offer.amountMicros));
- const firstName = user.name.trim().split(/\s+/)[0] || user.name;
- return {
- from,
- to: user.email,
- replyTo: emailFrom() || from,
- subject: `${credits} are waiting for you`,
- react: CreditsOfferedEmail({
- claimBy: formatCreditExpiry(offer.closesAt),
- claimUrl: offer.claimUrl,
- credits,
- lifetime: describeCreditLifetime(offer.expiresAfterDays),
- name: firstName,
- unsubscribeUrl: unsubscribePageUrl(user.id),
- }),
- attachments: [
- {
- content: DONKEY_LOGO_PNG_BASE64,
- contentId: DONKEY_LOGO_CID,
- contentType: "image/png",
- filename: "donkey-cut.png",
- },
- ],
- headers: {
- "List-Unsubscribe": `<${unsubscribeActionUrl(user.id)}>`,
- "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
- },
- };
-}
diff --git a/site/src/lib/email/send-forecast.ts b/site/src/lib/email/send-forecast.ts
deleted file mode 100644
index b922b3d0..00000000
--- a/site/src/lib/email/send-forecast.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-import { getGlobalSetting } from "@/lib/config/effective";
-import { pendingCreditExpiryGrants } from "@/lib/email/credit-expiry-due";
-import { prisma } from "@/lib/prisma";
-import type { Settings } from "@/lib/config/registry";
-
-// What the rest of the plan's billing cycle still needs from its allowance,
-// so bulk sends stop where transactional email and hand-sent mail begin and
-// take whatever those leave behind as the cycle runs down.
-
-export type EmailSendBudgetSetting = Settings["emailSendBudget"];
-
-const DAY_MS = 24 * 60 * 60 * 1000;
-const HOUR_MS = 60 * 60 * 1000;
-
-function msOfUtcDay(date: Date): number {
- return date.getTime() - Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
-}
-
-export function startOfUtcDay(date: Date): Date {
- return new Date(date.getTime() - msOfUtcDay(date));
-}
-
-export type BillingCycle = { start: Date; end: Date };
-
-// The plan renews on one day of the month, at UTC midnight here; a month
-// too short for that day renews on its last day.
-function renewalOn(year: number, monthIndex: number, renewalDay: number): Date {
- const lastDay = new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();
- return new Date(Date.UTC(year, monthIndex, Math.min(renewalDay, lastDay)));
-}
-
-/** The billing cycle `now` falls in: from the latest renewal to the next. */
-export function billingCycle(now: Date, renewalDay: number): BillingCycle {
- let start = renewalOn(now.getUTCFullYear(), now.getUTCMonth(), renewalDay);
- if (start > now) start = renewalOn(now.getUTCFullYear(), now.getUTCMonth() - 1, renewalDay);
- const end = renewalOn(start.getUTCFullYear(), start.getUTCMonth() + 1, renewalDay);
- return { start, end };
-}
-
-/** Days left in the cycle, today's remainder counted as a fraction. */
-export function daysRemaining(now: Date, cycle: BillingCycle): number {
- return Math.max(0, (cycle.end.getTime() - now.getTime()) / DAY_MS);
-}
-
-const formatters = new Map<string, Intl.DateTimeFormat>();
-
-function localParts(date: Date, timeZone: string): { day: string; hour: number; weekday: string } {
- let formatter = formatters.get(timeZone);
- if (!formatter) {
- formatter = new Intl.DateTimeFormat("en-US", {
- day: "2-digit",
- hour: "numeric",
- hour12: false,
- month: "2-digit",
- timeZone,
- weekday: "short",
- year: "numeric",
- });
- formatters.set(timeZone, formatter);
- }
- const parts = formatter.formatToParts(date);
- const part = (type: string) => parts.find((p) => p.type === type)?.value ?? "";
- return { day: `${part("year")}-${part("month")}-${part("day")}`, hour: Number(part("hour")) % 24, weekday: part("weekday") };
-}
-
-function inManualHours(local: { hour: number; weekday: string }, setting: EmailSendBudgetSetting): boolean {
- if (setting.manualWeekdaysOnly && (local.weekday === "Sat" || local.weekday === "Sun")) return false;
- return local.hour >= setting.manualStartHour && local.hour < setting.manualEndHour;
-}
-
-const workDaysCache = new Map<string, number>();
-
-/** Work days left before the renewal, in the work zone's own calendar: the
- * local dates with a work hour still ahead, sampled at `now` and at every
- * top of the hour until the cycle ends. The answer moves by the hour, so
- * one count serves an hour of sends. */
-export function workDaysRemaining(now: Date, cycle: BillingCycle, setting: EmailSendBudgetSetting): number {
- const hour = Math.floor(now.getTime() / HOUR_MS);
- const key = `${hour}:${cycle.end.getTime()}:${JSON.stringify(setting)}`;
- const cachedDays = workDaysCache.get(key);
- if (cachedDays !== undefined) return cachedDays;
- const days = new Set<string>();
- for (let t = now.getTime(); t < cycle.end.getTime(); t = Math.floor(t / HOUR_MS + 1) * HOUR_MS) {
- const local = localParts(new Date(t), setting.manualTimeZone);
- if (inManualHours(local, setting)) days.add(local.day);
- }
- workDaysCache.clear();
- workDaysCache.set(key, days.size);
- return days.size;
-}
-
-/** Signups a day, averaged over the lookback window of whole UTC days. */
-async function signupsPerDay(now: Date, lookbackDays: number): Promise<number> {
- const today = startOfUtcDay(now);
- const since = new Date(today.getTime() - lookbackDays * DAY_MS);
- const count = await prisma.user.count({ where: { createdAt: { gte: since, lt: today } } });
- return count / lookbackDays;
-}
-
-// A campaign asks once per email, every half second; the answer moves by the
-// hour, so one forecast serves a minute of sends.
-const FORECAST_TTL_MS = 60 * 1000;
-let cached: { at: number; value: Promise<TransactionalForecast> } | null = null;
-
-export type TransactionalForecast = {
- // Welcome emails for the signups expected before the renewal.
- signups: number;
- // Expiry notices owed and not yet sent.
- expiry: number;
- headroom: number;
- total: number;
-};
-
-/** Transactional sends the rest of the cycle is expected to need. */
-export function expectedTransactionalSends(
- now: Date,
- cycle: BillingCycle,
- setting: EmailSendBudgetSetting,
-): Promise<TransactionalForecast> {
- if (cached && now.getTime() - cached.at < FORECAST_TTL_MS) return cached.value;
- const value = forecast(now, cycle, setting);
- cached = { at: now.getTime(), value };
- value.catch(() => {
- cached = null;
- });
- return value;
-}
-
-async function forecast(now: Date, cycle: BillingCycle, setting: EmailSendBudgetSetting): Promise<TransactionalForecast> {
- const { daysBefore } = await getGlobalSetting("creditExpiryNotice");
- const [perDay, pending] = await Promise.all([
- signupsPerDay(now, setting.signupLookbackDays),
- pendingCreditExpiryGrants(now, daysBefore),
- ]);
- const signups = Math.ceil(perDay * daysRemaining(now, cycle));
- const expiry = pending.pending.length;
- const headroom = setting.transactionalHeadroom;
- return { signups, expiry, headroom, total: signups + expiry + headroom };
-}
diff --git a/site/src/lib/email/send-welcome.ts b/site/src/lib/email/send-welcome.ts
deleted file mode 100644
index f6aa040a..00000000
--- a/site/src/lib/email/send-welcome.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import { DONKEY_LOGO_CID, DONKEY_LOGO_PNG_BASE64 } from "@/emails/_components/logo";
-import WelcomeEmail from "@/emails/welcome";
-import { formatCredits } from "@/lib/credits/format-credits";
-import { bulkFrom, emailFrom, type EmailMessage, type EmailUser } from "@/lib/email/resend";
-import { unsubscribeActionUrl, unsubscribePageUrl } from "@/lib/email/unsubscribe";
-import { prisma } from "@/lib/prisma";
-
-// The one-time welcome email. The outbox row keyed on the account is what
-// keeps it single-send; the settings row records that it went.
-// `credits` is the amount the signup grant landed, or null when the address
-// had already received it on an earlier account; the email names it only
-// when it is there.
-export function welcomeIdempotencyKey(userId: string): string {
- return `welcome-email:${userId}`;
-}
-
-export function buildWelcomeEmail(user: EmailUser, credits: string | null): EmailMessage {
- const from = bulkFrom();
- if (!from) throw new Error("No bulk sender configured.");
- const firstName = user.name.trim().split(/\s+/)[0] || user.name;
- return {
- from,
- to: user.email,
- // The bulk subdomain sends but does not receive; a reply goes to the
- // apex address, where Google Workspace delivers it.
- replyTo: emailFrom() || from,
- subject: "Thanks for signing up ❤️",
- react: WelcomeEmail({
- credits: credits === null ? null : formatCredits(credits),
- name: firstName,
- unsubscribeUrl: unsubscribePageUrl(user.id),
- }),
- // The mark rides inside the message (Content-ID embed) so no client
- // fetches anything external; Gmail strips data URIs, so cid is the only
- // fetch-free form that renders everywhere.
- attachments: [
- {
- content: DONKEY_LOGO_PNG_BASE64,
- contentId: DONKEY_LOGO_CID,
- contentType: "image/png",
- filename: "donkey-cut.png",
- },
- ],
- // RFC 8058 one-click: mail providers POST here with no session; the
- // signed token in the URL is the authorization.
- headers: {
- "List-Unsubscribe": `<${unsubscribeActionUrl(user.id)}>`,
- "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
- },
- };
-}
-
-export async function recordWelcomeSent(userId: string): Promise<void> {
- await prisma.userEmailSettings.upsert({
- create: { userId, welcomeEmailSentAt: new Date() },
- update: { welcomeEmailSentAt: new Date() },
- where: { userId },
- });
-}
diff --git a/site/src/lib/email/unsubscribe.ts b/site/src/lib/email/unsubscribe.ts
index 6f6a6d44..31b86ac6 100644
--- a/site/src/lib/email/unsubscribe.ts
+++ b/site/src/lib/email/unsubscribe.ts
@@ -1,6 +1,5 @@
import { createHmac, timingSafeEqual } from "node:crypto";
-import { DONKEYCUT_CANONICAL } from "@/cut/lib/hosts";
import { prisma } from "@/lib/prisma";
// Unsubscribe links authenticate with an HMAC over the userId, keyed by a
@@ -18,11 +17,6 @@ function signature(userId: string): Buffer {
return createHmac("sha256", key).update(userId).digest();
}
-// Token format: `${userId}.${base64url(hmac(userId))}`.
-export function unsubscribeToken(userId: string): string {
- return `${userId}.${signature(userId).toString("base64url")}`;
-}
-
export function verifyUnsubscribeToken(token: string): string | null {
const dot = token.lastIndexOf(".");
if (dot <= 0) {
@@ -37,16 +31,6 @@ export function verifyUnsubscribeToken(token: string): string | null {
return userId;
}
-// The page a human opens from an email footer.
-export function unsubscribePageUrl(userId: string): string {
- return `${DONKEYCUT_CANONICAL}/unsubscribe?token=${unsubscribeToken(userId)}`;
-}
-
-// The endpoint mail providers POST to for RFC 8058 one-click unsubscribe.
-export function unsubscribeActionUrl(userId: string): string {
- return `${DONKEYCUT_CANONICAL}/api/email/unsubscribe?token=${unsubscribeToken(userId)}`;
-}
-
// The database row is the record every marketing send reads. A missing user
// (deleted account, dev-bypass caller) is a quiet no-op — unsubscribing is
// idempotent by contract.
diff --git a/site/src/lib/jobs/analytics-daily.ts b/site/src/lib/jobs/analytics-daily.ts
deleted file mode 100644
index e11636d5..00000000
--- a/site/src/lib/jobs/analytics-daily.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { z } from "zod";
-
-import { R2NotConfiguredError } from "@/cut/server/cloud/r2";
-import { InvalidDayError, runAnalyticsDaily } from "@/lib/analytics/pipeline";
-import { PosthogConfigError } from "@/lib/analytics/posthog";
-import { StripeListTooLongError, StripeNotConfiguredError } from "@/lib/billing/stripe";
-import { defineJob, JobFailure } from "@/lib/jobs/registry";
-
-// The nightly analytics run, also retriggerable by hand. An empty payload is
-// the regular run: yesterday plus any unfinished days in the window. A
-// specific day re-runs just that day; force re-extracts even final files.
-export const analyticsDailyJob = defineJob(
- z
- .object({
- day: z
- .string()
- .regex(/^\d{4}-\d{2}-\d{2}$/)
- .optional(),
- force: z.boolean().optional(),
- })
- .strict(),
- async (payload) => {
- try {
- return await runAnalyticsDaily(payload);
- } catch (e) {
- // All of these are permanent: retrying an unconfigured store or Stripe,
- // a bad PostHog project id, an impossible day, or a Stripe list past
- // the cap can never succeed.
- if (
- e instanceof R2NotConfiguredError ||
- e instanceof InvalidDayError ||
- e instanceof PosthogConfigError ||
- e instanceof StripeNotConfiguredError ||
- e instanceof StripeListTooLongError
- ) {
- throw new JobFailure(e.message);
- }
- throw e;
- }
- },
-);
diff --git a/site/src/lib/jobs/billing-refresh.ts b/site/src/lib/jobs/billing-refresh.ts
deleted file mode 100644
index ea8428da..00000000
--- a/site/src/lib/jobs/billing-refresh.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { z } from "zod";
-
-import { R2NotConfiguredError } from "@/cut/server/cloud/r2";
-import { refreshBilling } from "@/lib/analytics/pipeline";
-import { StripeListTooLongError, StripeNotConfiguredError } from "@/lib/billing/stripe";
-import { defineJob, JobFailure } from "@/lib/jobs/registry";
-
-// Re-reads the Stripe record into the analytics snapshot and rewrites the
-// rollup's billing section. Queued by the Stripe webhook on every billing
-// event, so the dashboard's money and subscription figures follow Stripe as
-// it happens; also retriggerable by hand.
-export const billingRefreshJob = defineJob(z.object({}).strict(), async () => {
- try {
- return await refreshBilling();
- } catch (e) {
- if (
- e instanceof R2NotConfiguredError ||
- e instanceof StripeNotConfiguredError ||
- e instanceof StripeListTooLongError
- ) {
- throw new JobFailure(e.message);
- }
- throw e;
- }
-});
diff --git a/site/src/lib/jobs/credit-expiry-notice.ts b/site/src/lib/jobs/credit-expiry-notice.ts
deleted file mode 100644
index 6adc425e..00000000
--- a/site/src/lib/jobs/credit-expiry-notice.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { z } from "zod";
-
-import { getGlobalSetting } from "@/lib/config/effective";
-import { queueDueCreditExpiryNotices } from "@/lib/email/credit-expiry-notices";
-import { drainAsJob } from "@/lib/jobs/email-drain";
-import { defineJob } from "@/lib/jobs/registry";
-
-// The daily credit-expiry notice. Every account holding signup or manually
-// granted credit that expires within the creditExpiryNotice window is queued
-// one email naming what is left and the day it goes, and the outbox is
-// drained. Runs from /api/credits/expiry-notices.
-export const creditExpiryNoticeJob = defineJob(z.object({}).strict(), async () => {
- const setting = await getGlobalSetting("creditExpiryNotice");
- const queued = await queueDueCreditExpiryNotices({ withinDays: setting.daysBefore });
- const drained = await drainAsJob();
- return { ...queued, drained };
-});
diff --git a/site/src/lib/jobs/credit-expiry.ts b/site/src/lib/jobs/credit-expiry.ts
deleted file mode 100644
index 69e13ab6..00000000
--- a/site/src/lib/jobs/credit-expiry.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { z } from "zod";
-
-import { expireAllCredits } from "@/lib/credits/inference";
-import { defineJob } from "@/lib/jobs/registry";
-
-// The nightly credit-expiry sweep. A grant past its expiry is normally settled
-// the next time its account is read or charged; this settles the accounts
-// nobody touched, so the stored balance the outreach scan reads is spendable
-// money. Runs from /api/credits/expire. The result names how many accounts
-// were settled, how many failed, and how many were left for the next run.
-export const creditExpiryJob = defineJob(z.object({}).strict(), async () =>
- expireAllCredits(),
-);
diff --git a/site/src/lib/jobs/delete-user.ts b/site/src/lib/jobs/delete-user.ts
deleted file mode 100644
index 3d4ccb5d..00000000
--- a/site/src/lib/jobs/delete-user.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import Stripe from "stripe";
-import { z } from "zod";
-
-import { deleteLibraryAssetCascade } from "@/cut/server/cloud/library";
-import { deleteProjectCascade } from "@/cut/server/cloud/projects";
-import { deletePrefix, INFERENCE_PREFIX, R2NotConfiguredError } from "@/cut/server/cloud/r2";
-import { getStripe, StripeNotConfiguredError } from "@/lib/billing/stripe";
-import { defineJob, JobFailure } from "@/lib/jobs/registry";
-import { deletedAccountKey } from "@/lib/onboarding/deleted-account";
-import { prisma } from "@/lib/prisma";
-
-// Deletes an account and everything it owns. Order matters: the Stripe
-// customer goes first (deleting it cancels any live subscription, so a crash
-// mid-job can never leave a paying customer with no account), then the Cut
-// cloud content — per-project and per-asset cascades,
-// which also clear R2 objects and HLS ladder records — then the user-keyed
-// rows that carry no foreign key, an R2 sweep of anything left under the
-// user's prefixes, then the record the address leaves behind so a second
-// signup under it gets no signup credits, and finally the user row, whose FK
-// cascades take sessions, accounts, credits, billing, onboarding, and email
-// settings. Every step is idempotent, so a queue redelivery resumes where the
-// last attempt stopped.
-export const deleteUserJob = defineJob(
- z.object({ email: z.string().trim().email() }),
- async ({ email }) => {
- const user = await prisma.user.findUnique({ where: { email } });
- if (!user) throw new JobFailure("No user with that email.");
- if (user.superUser) throw new JobFailure("Refusing to delete a super user.");
-
- if (user.stripeCustomerId) {
- try {
- await getStripe().customers.del(user.stripeCustomerId);
- } catch (e) {
- const alreadyGone =
- e instanceof Stripe.errors.StripeError && e.code === "resource_missing";
- if (!alreadyGone && !(e instanceof StripeNotConfiguredError)) throw e;
- }
- }
-
- const projects = await prisma.cutProject.findMany({
- where: { userId: user.id },
- select: { id: true },
- });
- for (const project of projects) {
- await deleteProjectCascade(user.id, project.id);
- }
- const assets = await prisma.cutLibraryAsset.findMany({
- where: { userId: user.id },
- select: { id: true },
- });
- for (const asset of assets) {
- await deleteLibraryAssetCascade(user.id, asset.id);
- }
-
- // What the cascades don't reach: renders and copies, media rows orphaned
- // from any project, shares of already-gone projects, templates, folders,
- // feature flags, the storage counter, and any waitlist entry under the
- // same address.
- await prisma.$transaction([
- prisma.cutRenderJob.deleteMany({ where: { userId: user.id } }),
- prisma.cutCopyJob.deleteMany({ where: { userId: user.id } }),
- prisma.cutChatThread.deleteMany({ where: { userId: user.id } }),
- prisma.cutMediaObject.deleteMany({ where: { userId: user.id } }),
- prisma.cutProjectShare.deleteMany({ where: { userId: user.id } }),
- prisma.cutLibraryAsset.deleteMany({ where: { userId: user.id } }),
- prisma.cutTemplate.deleteMany({ where: { userId: user.id } }),
- prisma.cutFolder.deleteMany({ where: { userId: user.id } }),
- prisma.cutStorageUsage.deleteMany({ where: { userId: user.id } }),
- prisma.userFeatureFlag.deleteMany({ where: { userId: user.id } }),
- prisma.waitlistEntry.deleteMany({ where: { email: user.email } }),
- ]);
-
- // Sweep whatever object the row-driven deletes missed — exports, previews,
- // cards, and the inference scratch that lives outside the user prefix.
- let r2Objects = 0;
- try {
- r2Objects += await deletePrefix(`cut/${user.id}/`);
- r2Objects += await deletePrefix(`${INFERENCE_PREFIX}${user.id}/`);
- } catch (e) {
- if (!(e instanceof R2NotConfiguredError)) throw e;
- }
-
- const credits = await prisma.userCreditAccount.findUnique({
- where: { userId: user.id },
- select: { lifetimeGrantedMicros: true, lifetimeChargedMicros: true },
- });
- const emailHash = deletedAccountKey(user.email);
- const record = {
- userId: user.id,
- signedUpAt: user.createdAt,
- grantedMicros: credits?.lifetimeGrantedMicros ?? BigInt(0),
- chargedMicros: credits?.lifetimeChargedMicros ?? BigInt(0),
- };
- await prisma.deletedAccount.upsert({
- where: { emailHash },
- create: { emailHash, ...record },
- update: record,
- });
-
- await prisma.user.delete({ where: { id: user.id } });
-
- return {
- email: user.email,
- userId: user.id,
- projects: projects.length,
- libraryAssets: assets.length,
- r2Objects,
- };
- },
-);
diff --git a/site/src/lib/jobs/email-drain.ts b/site/src/lib/jobs/email-drain.ts
deleted file mode 100644
index 0ff322fb..00000000
--- a/site/src/lib/jobs/email-drain.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { z } from "zod";
-
-import { EMAIL_KIND_IDS, type EmailKindId } from "@/lib/email/kindIds";
-import { drainOutbox, type DrainResult } from "@/lib/email/outbox";
-import { defineJob, JobDeferred } from "@/lib/jobs/registry";
-
-// Under the worker's 300 s maxDuration, with room for the continuation's
-// own writes.
-const BUDGET_MS = 200_000;
-
-/** Runs the drainer inside a job: a run that ran out of time queues its
- * continuation, and one that ran out of budget comes back when the budget is
- * expected to open. A run for one kind continues for that kind. */
-export async function drainAsJob(kind?: EmailKindId): Promise<DrainResult> {
- const result = await drainOutbox(BUDGET_MS, kind);
- if (result.more) {
- const { enqueueJob } = await import("@/lib/jobs/queue");
- await enqueueJob("email-drain", kind ? { kind } : {}, "system");
- return result;
- }
- if (result.retryAfterSeconds !== null) {
- throw new JobDeferred("Email budget reached; the outbox resumes when it opens.", result.retryAfterSeconds);
- }
- return result;
-}
-
-export const emailDrainJob = defineJob(
- z.object({ kind: z.enum(EMAIL_KIND_IDS).optional() }).strict(),
- async ({ kind }) => drainAsJob(kind),
-);
diff --git a/site/src/lib/jobs/experiment-results.ts b/site/src/lib/jobs/experiment-results.ts
deleted file mode 100644
index 016711f2..00000000
--- a/site/src/lib/jobs/experiment-results.ts
+++ /dev/null
@@ -1,128 +0,0 @@
-import { z } from "zod";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { fetchConvertedAfter, isPosthogQueryConfigured } from "@/lib/analytics/posthog";
-import { getGlobalSetting } from "@/lib/config/effective";
-import { parseVariants } from "@/lib/config/effective";
-import { metricSchema, type ExperimentMetric } from "@/lib/config/experiment";
-import { PURCHASE_SOURCES } from "@/lib/config/purchases";
-import { computeResults, type Thresholds, type VariantCount } from "@donkeycut/abexp";
-import { defineJob, JobFailure } from "@/lib/jobs/registry";
-import { prisma } from "@/lib/prisma";
-
-// Computes each experiment's read and stores it on the row: for every metric,
-// how many exposed accounts in each variant converted after their exposure,
-// and the verdict that follows. Runs nightly for every experiment that is
-// running, paused, or recently ended, and on demand for one.
-
-type Exposure = { userId: string; variant: string; exposedAt: Date };
-
-// Postgres binds every id in an IN list, so the accounts go in chunks.
-const USER_CHUNK = 500;
-
-/** The accounts that converted at or after their own exposure. A conversion
- * before an account was exposed is not this experiment's doing, and a later
- * one still counts — an account enrolled late has usually acted before. */
-async function convertedUsers(metric: ExperimentMetric, exposures: Exposure[]): Promise<Set<string>> {
- if (exposures.length === 0) return new Set();
- if (metric.source === "event") {
- return fetchConvertedAfter(
- metric.event!,
- exposures.map((e) => ({ distinctId: e.userId, since: e.exposedAt })),
- );
- }
- const exposedAt = new Map(exposures.map((e) => [e.userId, e.exposedAt]));
- const converted = new Set<string>();
- const ids = [...exposedAt.keys()];
- for (let i = 0; i < ids.length; i += USER_CHUNK) {
- const chunk = ids.slice(i, i + USER_CHUNK);
- const grants = await prisma.userCreditGrant.findMany({
- where: { userId: { in: chunk }, source: { in: [...PURCHASE_SOURCES] } },
- select: { userId: true, createdAt: true },
- });
- for (const grant of grants) {
- const since = exposedAt.get(grant.userId);
- if (since && grant.createdAt.getTime() >= since.getTime()) converted.add(grant.userId);
- }
- }
- return converted;
-}
-
-export async function computeExperimentResults(experimentId: string): Promise<{ key: string; verdict: string }> {
- const bars = await getGlobalSetting("experimentResults");
- const experiment = await prisma.experiment.findUnique({
- where: { id: experimentId },
- select: { id: true, key: true, variants: true, metrics: true },
- });
- if (!experiment) throw new JobFailure(`Experiment ${experimentId} does not exist.`);
- const variants = parseVariants(experiment.variants);
- const control = variants[0]?.key;
- if (!control) throw new JobFailure(`Experiment ${experiment.key} has no variants.`);
- const metrics = metricSchema.array().safeParse(experiment.metrics);
- if (!metrics.success) throw new JobFailure(`Experiment ${experiment.key} has metrics that no longer parse.`);
-
- // Only what the hash assigned and the app showed counts; a row written by
- // hand, a held-out account, and an unexposed assignment are left out.
- const [rows, holdouts] = await Promise.all([
- prisma.experimentAssignment.findMany({
- where: { experimentId, manual: false, variant: { not: null }, exposedAt: { not: null } },
- select: { userId: true, variant: true, exposedAt: true },
- }),
- prisma.experimentHoldout.findMany({ select: { userId: true } }),
- ]);
- const held = new Set(holdouts.map((h) => h.userId));
- const exposures: Exposure[] = rows
- .filter((r) => !held.has(r.userId))
- .map((r) => ({ userId: r.userId, variant: r.variant!, exposedAt: r.exposedAt! }));
- const notes: string[] = [];
- const measured: { metric: ExperimentMetric; counts: VariantCount[] }[] = [];
- for (const metric of metrics.data) {
- if (metric.source === "event" && !isPosthogQueryConfigured()) {
- notes.push(`${metric.name}: PostHog query access is not configured, so this event metric was skipped.`);
- continue;
- }
- const converted = await convertedUsers(metric, exposures);
- const counts: VariantCount[] = variants.map((v) => ({ key: v.key, exposed: 0, converted: 0 }));
- const byKey = new Map(counts.map((c) => [c.key, c]));
- for (const exposure of exposures) {
- const count = byKey.get(exposure.variant);
- if (!count) continue;
- count.exposed += 1;
- if (converted.has(exposure.userId)) count.converted += 1;
- }
- measured.push({ metric, counts });
- }
-
- const results = computeResults({
- computedAt: new Date(),
- control,
- metrics: measured,
- notes,
- thresholds: bars as Thresholds,
- });
- await prisma.experiment.update({
- where: { id: experimentId },
- data: { results: results as unknown as Prisma.InputJsonValue, resultsAt: new Date(results.computedAt) },
- });
- return { key: experiment.key, verdict: results.verdict.state };
-}
-
-export const experimentResultsJob = defineJob(
- z.object({ experimentId: z.string().min(1).optional() }).strict(),
- async (payload) => {
- if (payload.experimentId) {
- return { computed: [await computeExperimentResults(payload.experimentId)] };
- }
- const { graceDays } = await getGlobalSetting("experimentResults");
- const endedAfter = new Date(Date.now() - graceDays * 86_400_000);
- const rows = await prisma.experiment.findMany({
- where: {
- OR: [{ status: { in: ["running", "paused"] } }, { status: "ended", endedAt: { gte: endedAfter } }],
- },
- select: { id: true },
- });
- const computed = [];
- for (const row of rows) computed.push(await computeExperimentResults(row.id));
- return { computed };
- },
-);
diff --git a/site/src/lib/jobs/outreach-scan.ts b/site/src/lib/jobs/outreach-scan.ts
deleted file mode 100644
index f8e78421..00000000
--- a/site/src/lib/jobs/outreach-scan.ts
+++ /dev/null
@@ -1,321 +0,0 @@
-import { z } from "zod";
-
-import { cutLimitsForTier } from "@/cut/server/cloud/limits";
-import {
- ACTIVE_PRO_STATUSES,
- isActiveProStatus,
- subscriptionIsPro,
-} from "@/lib/billing/pro-subscription";
-import {
- drainStripe,
- getStripe,
- stripeId,
- StripeListTooLongError,
- StripeNotConfiguredError,
-} from "@/lib/billing/stripe";
-import { creditStringToMicros, zeroCreditMicros } from "@/lib/credits/amounts";
-import { defineJob, JobFailure } from "@/lib/jobs/registry";
-import {
- CREDIT_SPENDERS_CAMPAIGN,
- OUTREACH_ACTIVE_WINDOW_DAYS,
- OUTREACH_MIN_SPENT_CREDITS,
- OUTREACH_MIN_STORAGE_BYTES,
- OUTREACH_PAYMENT_WINDOW_DAYS,
- OUTREACH_RECONTACT_DAYS,
- OUTREACH_STORAGE_FULL_SHARE,
- type OutreachReason,
- PICKED_REASON,
-} from "@/lib/marketing/campaigns";
-import { lastActiveByUser } from "@/lib/marketing/lastActive";
-import { prisma } from "@/lib/prisma";
-
-const DAY_MS = 24 * 60 * 60 * 1000;
-// Upserts go out in batches so one scan is a handful of round trips.
-const BATCH = 50;
-
-function newest(...dates: (Date | null | undefined)[]): Date | null {
- let best: Date | null = null;
- for (const date of dates) {
- if (date && (!best || date > best)) best = date;
- }
- return best;
-}
-
-// Rolls product usage and billing state into the outreach list. Runs nightly
-// from /api/marketing/outreach/scan, or by hand as the same job. Everything
-// the list shows is written here or read alongside it, so a reader never
-// touches the credit tables.
-//
-// Two kinds of people make the list. Free accounts using the product well —
-// spending credits or holding media, and warm — are the ones worth a personal
-// note. And anyone who hit a wall: ran out of credits, filled their storage,
-// had a card declined, fell behind on Pro, or is leaving it. A wall counts
-// however long ago the account was last seen, because that is when the
-// person went quiet.
-export const outreachScanJob = defineJob(z.object({}).strict(), async () => {
- try {
- return await scan();
- } catch (e) {
- // Permanent: an unconfigured Stripe or a list past the cap never clears
- // on retry.
- if (e instanceof StripeNotConfiguredError || e instanceof StripeListTooLongError) {
- throw new JobFailure(e.message);
- }
- throw e;
- }
-});
-
-async function scan() {
- const startedAt = new Date();
- const since = new Date(startedAt.getTime() - OUTREACH_ACTIVE_WINDOW_DAYS * DAY_MS);
- const paymentSince = new Date(startedAt.getTime() - OUTREACH_PAYMENT_WINDOW_DAYS * DAY_MS);
- const recontactBefore = new Date(startedAt.getTime() - OUTREACH_RECONTACT_DAYS * DAY_MS);
- const campaign = CREDIT_SPENDERS_CAMPAIGN;
- const minSpentMicros = creditStringToMicros(OUTREACH_MIN_SPENT_CREDITS);
-
- // An account that has not opted out of marketing. No settings row means it
- // never opted out.
- const marketable = {
- OR: [
- { emailSettings: { is: null } },
- { emailSettings: { is: { marketingUnsubscribedAt: null } } },
- ],
- };
- // A free account: a Pro subscriber already pays, so use alone is no reason.
- const free = {
- ...marketable,
- NOT: { proSubscription: { is: { status: { in: [...ACTIVE_PRO_STATUSES] } } } },
- };
- const freeStorageBytes = cutLimitsForTier({ pro: false, superUser: false }).storageBytes ?? 0;
-
- // Declined charges and ended subscriptions come from Stripe; the customer
- // id on each is the one stored on the user at their first checkout. The
- // pull runs alongside the database reads.
- const failedAtByCustomer = new Map<string, Date>();
- const endedCustomerIds = new Set<string>();
- const [spenders, storage] = await Promise.all([
- // Free accounts that spent a real share of their credits and are still
- // warm. The floor is on what went out.
- prisma.userCreditAccount.findMany({
- select: { userId: true },
- where: {
- lifetimeChargedMicros: { gte: minSpentMicros },
- user: {
- ...free,
- inferenceUsageEvents: {
- some: { billingStatus: "charged", createdAt: { gte: since } },
- },
- },
- },
- }),
- // Accounts holding a real amount of media. Uploading costs no credits, so
- // these people are invisible to the spend query. Starter media is
- // quotaExempt and never counted, so it names nobody. The storage counter
- // has no relation to the user, so opt-out, Pro and the tier's quota are
- // settled below.
- prisma.cutStorageUsage.findMany({
- select: { bytes: true, userId: true },
- where: {
- bytes: {
- gte:
- OUTREACH_MIN_STORAGE_BYTES <
- BigInt(Math.floor(freeStorageBytes * OUTREACH_STORAGE_FULL_SHARE))
- ? OUTREACH_MIN_STORAGE_BYTES
- : BigInt(Math.floor(freeStorageBytes * OUTREACH_STORAGE_FULL_SHARE)),
- },
- },
- }),
- (async () => {
- const stripe = getStripe();
- // A subscription that ended inside the payment window, by the date it
- // ended; the row in our database carries no end date of its own.
- for (const sub of await drainStripe(
- stripe.subscriptions.list({ limit: 100, status: "canceled" }),
- )) {
- const endedAt = sub.ended_at ?? sub.canceled_at;
- const customerId = stripeId(sub.customer);
- if (!subscriptionIsPro(sub)) continue;
- if (customerId && endedAt !== null && endedAt * 1000 >= paymentSince.getTime()) {
- endedCustomerIds.add(customerId);
- }
- }
- for (const charge of await drainStripe(
- stripe.charges.list({
- created: { gte: Math.floor(paymentSince.getTime() / 1000) },
- limit: 100,
- }),
- )) {
- const customerId = stripeId(charge.customer);
- if (charge.status !== "failed" || !customerId) continue;
- const at = new Date(charge.created * 1000);
- failedAtByCustomer.set(customerId, newest(at, failedAtByCustomer.get(customerId))!);
- }
- })(),
- ]);
-
- const retire = async () => {
- // Anything this run did not touch no longer qualifies — unsubscribed,
- // went cold, cleared the wall, or never came back. Only untouched
- // candidates go; a contacted row is history and stays, and so does a
- // row a person added by hand.
- const { count } = await prisma.userOutreach.deleteMany({
- where: { campaign, scannedAt: { lt: startedAt }, status: "todo", NOT: { reasons: { has: PICKED_REASON } } },
- });
- return count;
- };
-
- const spenderIds = new Set(spenders.map((row) => row.userId));
- const heavyIds = new Set(
- storage.filter((row) => row.bytes >= OUTREACH_MIN_STORAGE_BYTES).map((row) => row.userId),
- );
- const stripeCustomerIds = [...new Set([...failedAtByCustomer.keys(), ...endedCustomerIds])];
-
- // One read names every candidate and carries what the reason pass needs:
- // the use-based ids from above, the walls found on the user's own rows —
- // credits used up, a Pro subscription behind or ending — and the Stripe
- // customers with a declined charge or an ended subscription. Opt-out comes
- // off here for all of them, so nothing further is read for an account
- // that can never be mailed.
- const users = await prisma.user.findMany({
- select: {
- creditAccount: { select: { balanceMicros: true, lifetimeChargedMicros: true } },
- id: true,
- proSubscription: { select: { cancelAtPeriodEnd: true, status: true } },
- stripeCustomerId: true,
- superUser: true,
- },
- where: {
- AND: [
- marketable,
- {
- OR: [
- { id: { in: [...new Set([...spenderIds, ...storage.map((row) => row.userId)])] } },
- {
- creditAccount: {
- is: {
- balanceMicros: { lte: zeroCreditMicros },
- lifetimeChargedMicros: { gte: minSpentMicros },
- },
- },
- },
- {
- proSubscription: {
- is: {
- OR: [
- { status: { in: ["past_due", "unpaid"] } },
- { cancelAtPeriodEnd: true, status: { in: [...ACTIVE_PRO_STATUSES] } },
- ],
- },
- },
- },
- ...(stripeCustomerIds.length > 0
- ? [{ stripeCustomerId: { in: stripeCustomerIds } }]
- : []),
- ],
- },
- ],
- },
- });
- const userIds = users.map((user) => user.id);
- if (userIds.length === 0) {
- return { added: 0, dropped: await retire(), scanned: 0 };
- }
-
- const [lastActiveBy, stored, ranOut, existing] = await Promise.all([
- lastActiveByUser(userIds),
- prisma.cutStorageUsage.findMany({
- select: { bytes: true, userId: true },
- where: { userId: { in: userIds } },
- }),
- // The moment the balance last hit zero. Absent for an account still in
- // credit, which is exactly what the list wants to show.
- prisma.userCreditLedgerEntry.groupBy({
- _max: { createdAt: true },
- by: ["userId"],
- where: { balanceAfterMicros: zeroCreditMicros, userId: { in: userIds } },
- }),
- prisma.userOutreach.findMany({
- select: { lastSentAt: true, status: true, userId: true },
- where: { campaign, userId: { in: userIds } },
- }),
- ]);
-
- const storedBy = new Map(stored.map((row) => [row.userId, row.bytes]));
- const ranOutBy = new Map(ranOut.map((row) => [row.userId, row._max.createdAt]));
- const existingBy = new Map(existing.map((row) => [row.userId, row]));
-
- const accounts = users.flatMap((user) => {
- const balanceMicros = user.creditAccount?.balanceMicros ?? zeroCreditMicros;
- const spentMicros = user.creditAccount?.lifetimeChargedMicros ?? zeroCreditMicros;
- const storageBytes = storedBy.get(user.id) ?? BigInt(0);
- const lastActiveAt = lastActiveBy.get(user.id) ?? null;
- const sub = user.proSubscription;
- const pro = sub !== null && isActiveProStatus(sub.status);
- const quota = cutLimitsForTier({ pro, superUser: user.superUser }).storageBytes;
- const paymentFailedAt = user.stripeCustomerId
- ? (failedAtByCustomer.get(user.stripeCustomerId) ?? null)
- : null;
-
- const reasons: OutreachReason[] = [];
- // Spenders billed a call inside the window, so they are warm by
- // construction. Holders have to be warm: something of theirs moved
- // inside the window.
- if (spenderIds.has(user.id)) reasons.push("spent");
- if (!pro && heavyIds.has(user.id) && lastActiveAt !== null && lastActiveAt >= since) {
- reasons.push("storage");
- }
- if (balanceMicros <= zeroCreditMicros && spentMicros >= minSpentMicros) {
- reasons.push("no_credits");
- }
- if (quota !== null && Number(storageBytes) >= quota * OUTREACH_STORAGE_FULL_SHARE) {
- reasons.push("storage_full");
- }
- if (paymentFailedAt) reasons.push("payment_failed");
- if (sub?.status === "past_due" || sub?.status === "unpaid") reasons.push("past_due");
- if (pro && sub.cancelAtPeriodEnd) reasons.push("canceling");
- // An ended subscription is a reason only while nothing replaced it.
- if (!pro && user.stripeCustomerId && endedCustomerIds.has(user.stripeCustomerId)) {
- reasons.push("canceled");
- }
- if (reasons.length === 0) return [];
-
- return [
- {
- snapshot: {
- balanceMicros,
- lastActiveAt,
- paymentFailedAt,
- ranOutAt: ranOutBy.get(user.id) ?? null,
- reasons,
- scannedAt: startedAt,
- spentMicros,
- storageBytes,
- },
- userId: user.id,
- },
- ];
- });
-
- const writes = accounts.map((account) => {
- const prior = existingBy.get(account.userId);
- // A contacted row rests for OUTREACH_RECONTACT_DAYS, then comes back
- // around. Replied and ignored stay put until a person clears them.
- const revive =
- prior?.status === "sent" && (!prior.lastSentAt || prior.lastSentAt < recontactBefore);
- return prisma.userOutreach.upsert({
- create: { campaign, status: "todo", userId: account.userId, ...account.snapshot },
- update: revive ? { status: "todo", ...account.snapshot } : account.snapshot,
- where: { userId_campaign: { campaign, userId: account.userId } },
- });
- });
-
- for (let i = 0; i < writes.length; i += BATCH) {
- await prisma.$transaction(writes.slice(i, i + BATCH));
- }
-
- return {
- added: accounts.filter((account) => !existingBy.has(account.userId)).length,
- dropped: await retire(),
- scanned: accounts.length,
- };
-}
diff --git a/site/src/lib/jobs/promotion-queue.ts b/site/src/lib/jobs/promotion-queue.ts
deleted file mode 100644
index 7a3ba8d6..00000000
--- a/site/src/lib/jobs/promotion-queue.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { z } from "zod";
-
-import { queueEmails, scheduleDrain } from "@/lib/email/outbox";
-import { defineJob, JobFailure } from "@/lib/jobs/registry";
-import { activityRank, lastActiveByUser } from "@/lib/marketing/lastActive";
-import { promotionAudienceOf, promotionIdempotencyKey, resolvePromotionSegment } from "@/lib/marketing/promotions";
-import { prisma } from "@/lib/prisma";
-
-// Turns a promotion's segment into outbox rows, a page of accounts at a
-// time: the audience is resolved for the page, the page is ranked by when
-// each person last used the product, and its rows are queued. The promotion
-// is queuing throughout, so the drainer can send rows as they land without
-// finishing it early; once the whole list is read it moves to sending, and
-// the drainer finishes it when the last row goes. A run that runs out of
-// time queues its continuation from the last account read; a promotion
-// paused meanwhile stops where it is and a later send resumes it, the rows
-// already queued left as they are. Under the worker's 300 s maxDuration,
-// with room for the continuation's own writes.
-const BUDGET_MS = 200_000;
-
-export const promotionQueueJob = defineJob(
- z.object({ promotionId: z.string().min(1), cursor: z.string().min(1).optional() }).strict(),
- async ({ promotionId, cursor }) => {
- const promotion = await prisma.promotion.findUnique({ where: { id: promotionId } });
- if (!promotion) throw new JobFailure("The promotion no longer exists.");
- if (promotion.status !== "queuing") return { queued: 0, stopped: true };
-
- const now = new Date();
- let queued = 0;
- const result = await resolvePromotionSegment(
- { audience: promotionAudienceOf(promotion.audience), excludePromotionIds: promotion.excludePromotionIds },
- {
- cursor,
- deadline: Date.now() + BUDGET_MS,
- now,
- onPage: async (users) => {
- const standing = await prisma.promotion.findUnique({ select: { status: true }, where: { id: promotionId } });
- if (standing?.status !== "queuing") return false;
- if (users.length === 0) return;
- const lastActiveBy = await lastActiveByUser(users.map((u) => u.id));
- queued += await queueEmails(
- users.map((user) => ({
- idempotencyKey: promotionIdempotencyKey(promotionId, user.id),
- kind: "promotion",
- payload: { promotionId },
- promotionId,
- rank: activityRank(now, lastActiveBy.get(user.id)),
- userId: user.id,
- })),
- );
- },
- },
- );
-
- if (result.cursor !== null) {
- const standing = await prisma.promotion.findUnique({ select: { status: true }, where: { id: promotionId } });
- if (standing?.status !== "queuing") return { queued, stopped: true };
- const { enqueueJob } = await import("@/lib/jobs/queue");
- await enqueueJob("promotion-queue", { promotionId, cursor: result.cursor }, "system");
- return { queued, continued: true };
- }
-
- // The whole list was read. Nothing outstanding — nobody was in the
- // segment, or the drainer kept up — finishes it here; otherwise it is
- // sending, and the drainer finishes it when the last row goes.
- const owed = await prisma.emailSend.count({ where: { promotionId, state: { in: ["queued", "sending"] } } });
- const moved = await prisma.promotion.updateMany({
- data: owed === 0 ? { finishedAt: new Date(), status: "sent" } : { status: "sending" },
- where: { id: promotionId, status: "queuing" },
- });
- if (moved.count === 0) return { queued, stopped: true };
- if (owed > 0) await scheduleDrain(0);
- return { queued };
- },
-);
diff --git a/site/src/lib/jobs/queue.ts b/site/src/lib/jobs/queue.ts
deleted file mode 100644
index 6d752a90..00000000
--- a/site/src/lib/jobs/queue.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-// The generic async-job queue: a request writes an AsyncJob row and publishes
-// its id to the Cloudflare Queue, the queue's serial consumer (the Cut
-// worker's queue handler) calls back into /api/jobs/worker one message at a
-// time, and the creator polls the row. Mirrors the share-copy queue
-// (src/cut/server/cloud/copyQueue.ts), which stays its own pipeline because it
-// ships inside the Cut engine.
-import { NextResponse } from "next/server";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { JobDeferred, JobFailure, jobKinds } from "@/lib/jobs/registry";
-import { prisma } from "@/lib/prisma";
-
-const JOBS_QUEUE_NAME = "donkey-jobs";
-// A running job untouched this long is a crashed or killed execution. The
-// claim treats such a row as reclaimable so a queue retry can run it again.
-const STALE_RUNNING_MS = 15 * 60_000;
-// The longest the queue will hold a message before delivery.
-const MAX_QUEUE_DELAY_S = 12 * 60 * 60;
-
-// --- Queue publish (Cloudflare Queues REST API; producers outside Workers
-// publish over HTTP). The queue id is looked up from the name once per
-// process. Missing credentials mean no queue (local dev): the request then
-// executes the job before returning.
-
-let cachedQueueId: string | null = null;
-
-async function queueId(accountId: string, token: string): Promise<string | null> {
- if (cachedQueueId) return cachedQueueId;
- const res = await fetch(`https://api.cloudflare.com/client/v4/accounts/${accountId}/queues`, {
- headers: { Authorization: `Bearer ${token}` },
- });
- if (!res.ok) return null;
- const body = (await res.json()) as {
- result?: { queue_id?: string; id?: string; queue_name?: string }[];
- };
- const q = body.result?.find((r) => r.queue_name === JOBS_QUEUE_NAME);
- cachedQueueId = q?.queue_id ?? q?.id ?? null;
- return cachedQueueId;
-}
-
-/** Publish one job id to the jobs queue, held back by the delay; false when
- * unconfigured or failed. */
-async function publishJob(jobId: string, delaySeconds = 0): Promise<boolean> {
- const accountId = process.env.R2_ACCOUNT_ID;
- const token = process.env.CLOUDFLARE_QUEUES_API_TOKEN;
- if (!accountId || !token) return false;
- try {
- const id = await queueId(accountId, token);
- if (!id) return false;
- const res = await fetch(
- `https://api.cloudflare.com/client/v4/accounts/${accountId}/queues/${id}/messages`,
- {
- method: "POST",
- headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
- body: JSON.stringify({
- body: { jobId },
- content_type: "json",
- delay_seconds: Math.min(delaySeconds, MAX_QUEUE_DELAY_S),
- }),
- },
- );
- return res.ok;
- } catch {
- return false;
- }
-}
-
-/** Queue the job, held back by the delay, and hand back its id; without a
- * queue (local dev) the job runs now, before responding — a serverless
- * response must not leave fire-and-forget work behind. */
-export async function enqueueJob(
- kind: string,
- payload: Prisma.InputJsonValue,
- createdBy: string,
- options: { delaySeconds?: number } = {},
-): Promise<{ jobId: string }> {
- const delaySeconds = options.delaySeconds ?? 0;
- const job = await prisma.asyncJob.create({
- data: { createdBy, kind, notBefore: delaySeconds > 0 ? dueAt(delaySeconds) : null, payload },
- });
- const queued = await publishJob(job.id, delaySeconds);
- if (!queued) await executeJob(job.id);
- return { jobId: job.id };
-}
-
-function dueAt(delaySeconds: number): Date {
- return new Date(Date.now() + delaySeconds * 1000);
-}
-
-/** One job of this kind on its way, no later than the delay. A pending job
- * that is due sooner is left alone; one held back for later is pulled
- * forward; none means a new one. Kinds whose work is shared, such as the
- * email drainer, are asked for this way so every caller feeds one run. */
-export async function ensureJob(
- kind: string,
- payload: Prisma.InputJsonValue,
- createdBy: string,
- options: { delaySeconds?: number } = {},
-): Promise<{ jobId: string }> {
- const delaySeconds = options.delaySeconds ?? 0;
- const pending = await prisma.asyncJob.findFirst({
- orderBy: { createdAt: "asc" },
- select: { id: true, notBefore: true, state: true },
- where: { kind, state: { in: ["queued", "running"] } },
- });
- if (!pending) return enqueueJob(kind, payload, createdBy, { delaySeconds });
- const due = dueAt(delaySeconds);
- if (pending.state === "queued" && pending.notBefore && pending.notBefore > due) {
- // The earlier message still arrives on its own schedule; by then the row
- // is settled and the claim turns that delivery away.
- await prisma.asyncJob.update({ data: { notBefore: delaySeconds > 0 ? due : null }, where: { id: pending.id } });
- await publishJob(pending.id, delaySeconds);
- }
- return { jobId: pending.id };
-}
-
-/** Execute one job (called by the queue consumer through /api/jobs/worker).
- * A 200 consumes the message (including permanent failures, which land on the
- * job row); a 500 releases the claim and lets the queue retry. A deferral
- * consumes the message too and publishes a fresh one held back by the job's
- * own delay, so waiting on a quota never spends the queue's retries. */
-export async function executeJob(jobId: string): Promise<Response> {
- // A stale running row is a killed execution, so the claim takes it too —
- // that way the queue's redelivery actually re-runs it instead of ack'ing.
- const claimed = await prisma.asyncJob.updateMany({
- where: {
- id: jobId,
- OR: [
- { state: "queued" },
- { state: "running", updatedAt: { lt: new Date(Date.now() - STALE_RUNNING_MS) } },
- ],
- },
- data: { state: "running" },
- });
- // Already running, settled, or unknown — double delivery lands here.
- if (claimed.count === 0) return NextResponse.json({ ok: true });
-
- const fail = async (message: string) => {
- await prisma.asyncJob.update({
- where: { id: jobId },
- data: { state: "error", error: message },
- });
- return NextResponse.json({ ok: true });
- };
-
- const job = await prisma.asyncJob.findUnique({ where: { id: jobId } });
- if (!job) return NextResponse.json({ ok: true });
- const kind = jobKinds[job.kind];
- if (!kind) return fail(`Unknown job kind "${job.kind}".`);
- if (!kind.payload.safeParse(job.payload).success) {
- return fail("The stored job payload is invalid.");
- }
-
- try {
- const result = await kind.run(job.payload);
- await prisma.asyncJob.update({
- where: { id: jobId },
- data: { state: "done", result },
- });
- return NextResponse.json({ ok: true });
- } catch (e) {
- if (e instanceof JobDeferred) {
- await prisma.asyncJob
- .updateMany({
- data: { notBefore: dueAt(e.retryAfterSeconds), state: "queued" },
- where: { id: jobId, state: "running" },
- })
- .catch(() => {});
- if (await publishJob(jobId, e.retryAfterSeconds)) return NextResponse.json({ ok: true });
- return NextResponse.json(
- { error: e.message },
- { headers: { "Retry-After": String(e.retryAfterSeconds) }, status: 503 },
- );
- }
- if (e instanceof JobFailure) return fail(e.message);
- // Transient failure: release the claim so the queue's retry can run the
- // job again from where its idempotent steps left off.
- await prisma.asyncJob
- .updateMany({ where: { id: jobId, state: "running" }, data: { state: "queued" } })
- .catch(() => {});
- return NextResponse.json(
- { error: e instanceof Error ? e.message : "Job failed." },
- { status: 500 },
- );
- }
-}
diff --git a/site/src/lib/jobs/registry.ts b/site/src/lib/jobs/registry.ts
deleted file mode 100644
index 6b1266ca..00000000
--- a/site/src/lib/jobs/registry.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { z } from "zod";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { analyticsDailyJob } from "@/lib/jobs/analytics-daily";
-import { billingRefreshJob } from "@/lib/jobs/billing-refresh";
-import { creditExpiryJob } from "@/lib/jobs/credit-expiry";
-import { creditExpiryNoticeJob } from "@/lib/jobs/credit-expiry-notice";
-import { deleteUserJob } from "@/lib/jobs/delete-user";
-import { experimentResultsJob } from "@/lib/jobs/experiment-results";
-import { outreachScanJob } from "@/lib/jobs/outreach-scan";
-import { emailDrainJob } from "@/lib/jobs/email-drain";
-import { promotionQueueJob } from "@/lib/jobs/promotion-queue";
-
-// Thrown by an executor when the job can never succeed — the message lands on
-// the job row as its error. Anything else thrown is transient: the claim is
-// released and the queue redelivers.
-export class JobFailure extends Error {}
-
-export class JobDeferred extends Error {
- public constructor(
- message: string,
- public readonly retryAfterSeconds: number,
- ) {
- super(message);
- this.name = "JobDeferred";
- }
-}
-
-export type JobKind = {
- // Validates a payload at creation time and again at execution time; a stored
- // payload that no longer parses is a permanent failure.
- payload: z.ZodType<unknown>;
- run: (payload: unknown) => Promise<Prisma.InputJsonValue>;
-};
-
-export function defineJob<S extends z.ZodType<unknown>>(
- payload: S,
- run: (payload: z.output<S>) => Promise<Prisma.InputJsonValue>,
-): JobKind {
- return { payload, run: (raw) => run(payload.parse(raw)) };
-}
-
-export const jobKinds: Record<string, JobKind> = {
- "analytics-daily": analyticsDailyJob,
- "billing-refresh": billingRefreshJob,
- "credit-expiry": creditExpiryJob,
- "credit-expiry-notice": creditExpiryNoticeJob,
- "delete-user": deleteUserJob,
- "email-drain": emailDrainJob,
- "experiment-results": experimentResultsJob,
- "outreach-scan": outreachScanJob,
- "promotion-queue": promotionQueueJob,
-};
diff --git a/site/src/lib/marketing/campaigns.ts b/site/src/lib/marketing/campaigns.ts
deleted file mode 100644
index 12f5e9e1..00000000
--- a/site/src/lib/marketing/campaigns.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-// The outreach campaigns the scan knows about. Ids are
-// code, not data: adding one here is what makes it scannable and listable.
-
-/** Free accounts that spent real credits recently, or that are holding a real
- * amount of media in the cloud. These are the people worth a
- * personal note. The id is the value written on every row
- * since the campaign began and stays as it is. */
-export const CREDIT_SPENDERS_CAMPAIGN = "credit_spenders";
-
-/** The least an account has to have spent, in credits, to make the list. A
- * third of the signup grant means several real model calls; a few cents is
- * one trial call. */
-export const OUTREACH_MIN_SPENT_CREDITS = "1";
-
-/** The least an account has to be holding in the cloud to make the list on
- * storage alone. Most of the free quota in use is a person keeping their work
- * here. */
-export const OUTREACH_MIN_STORAGE_BYTES = BigInt(200 * 1024 * 1024);
-
-/** How recently an account must have billed a model call, put media in the
- * cloud, or edited a cloud project to still count as warm. Past this it is a
- * cold list. */
-export const OUTREACH_ACTIVE_WINDOW_DAYS = 30;
-
-/** How long a contacted account rests before the scan offers it again. */
-export const OUTREACH_RECONTACT_DAYS = 60;
-
-/** How far back a declined charge or an ended subscription still counts as
- * a reason to reach out. */
-export const OUTREACH_PAYMENT_WINDOW_DAYS = 60;
-
-/** The share of the storage quota at which an account counts as full. */
-export const OUTREACH_STORAGE_FULL_SHARE = 0.9;
-
-/** The reason on a row a person added by email. The scan never retires such
- * a row; the next scan that lists the account replaces the reason with its own. */
-export const PICKED_REASON = "picked";
-
-/** Why an account is on the list. The first two are people using the product
- * well; the next are walls they hit — the moment a note can turn into a
- * top-up, an upgrade, or a saved subscription; the last is a person the
- * operator added by hand. An account can carry several. */
-export const OUTREACH_REASONS = [
- "spent",
- "storage",
- "no_credits",
- "storage_full",
- "payment_failed",
- "past_due",
- "canceling",
- "canceled",
- PICKED_REASON,
-] as const;
-
-export type OutreachReason = (typeof OUTREACH_REASONS)[number];
-
diff --git a/site/src/lib/marketing/forward-reply.ts b/site/src/lib/marketing/forward-reply.ts
deleted file mode 100644
index 1729bbb9..00000000
--- a/site/src/lib/marketing/forward-reply.ts
+++ /dev/null
@@ -1,117 +0,0 @@
-import { z } from "zod";
-
-import { deliverEmail } from "@/lib/email/outbox";
-import { emailFrom, getResend, isResendConfigured, type EmailMessage } from "@/lib/email/resend";
-import { outreachIdFromRecipients } from "@/lib/marketing/replyAddress";
-import { prisma } from "@/lib/prisma";
-
-// Where a reply is forwarded so it can be answered from a normal inbox. Env
-// rather than code for the same reason RESEND_FROM_EMAIL is: the open-source
-// repo carries no personal address.
-function outreachInbox(): string {
- return process.env.RESEND_INBOX_EMAIL ?? "";
-}
-
-// The banner names the account, and an account's display name is whatever
-// Google handed us — it reaches the operator's inbox as markup otherwise.
-function escapeHtml(value: string): string {
- return value
- .replace(/&/g, "&amp;")
- .replace(/</g, "&lt;")
- .replace(/>/g, "&gt;")
- .replace(/"/g, "&quot;");
-}
-
-type ReceivedEmail = {
- email_id: string;
- from: string;
- to: string[];
- received_for: string[];
- subject: string;
-};
-
-export const replyForwardPayloadSchema = z.object({ emailId: z.string().min(1), outreachId: z.string().min(1) }).strict();
-export type ReplyForwardPayload = z.output<typeof replyForwardPayloadSchema>;
-
-// Handles an inbound reply to a note that carried the signed reply alias —
-// one sent with reply tracking on. Flips the row to replied and queues the
-// forward so it can be answered from a normal inbox. The forward goes out as
-// a fresh send rather than Resend's own forward call because only a send
-// takes a reply-to — that is what makes hitting reply in the inbox address
-// the user instead of looping back into the reply domain.
-//
-// Nothing about the message is written down beyond its id. Body, subject, and
-// attachments travel from Resend through the builder to the inbox and stop
-// there.
-export async function forwardOutreachReply(email: ReceivedEmail): Promise<boolean> {
- const outreachId = outreachIdFromRecipients(email.received_for, email.to);
- if (!outreachId) return false;
- const outreach = await prisma.userOutreach.findUnique({
- select: { id: true, repliedAt: true },
- where: { id: outreachId },
- });
- if (!outreach) return false;
-
- // Keep the first reply's timestamp; a later one in the same thread only
- // confirms the status.
- await prisma.userOutreach.update({
- data: { repliedAt: outreach.repliedAt ?? new Date(), status: "replied" },
- where: { id: outreach.id },
- });
-
- if (!isResendConfigured() || !outreachInbox() || !emailFrom()) {
- console.warn("[outreach] reply not forwarded; inbox or sender unconfigured", { outreachId: outreach.id });
- return true;
- }
- await deliverEmail({
- // Resend's own dedupe is what keeps a redelivered webhook from forwarding
- // the same reply twice, and the outbox key mirrors it.
- idempotencyKey: `outreach-reply:${email.email_id}`,
- kind: "reply-forward",
- payload: { emailId: email.email_id, outreachId: outreach.id },
- });
- return true;
-}
-
-/** Fetches the reply from Resend and wraps it for the operator's inbox. */
-export async function buildReplyForwardEmail(payload: ReplyForwardPayload): Promise<EmailMessage> {
- const inbox = outreachInbox();
- const from = emailFrom();
- if (!inbox || !from) throw new Error("RESEND_INBOX_EMAIL or RESEND_FROM_EMAIL is not configured.");
- const outreach = await prisma.userOutreach.findUnique({
- select: { user: { select: { email: true, name: true } } },
- where: { id: payload.outreachId },
- });
- if (!outreach) throw new Error("The outreach row no longer exists.");
-
- const resend = getResend();
- const received = await resend.emails.receiving.get(payload.emailId);
- if (received.error || !received.data) {
- throw new Error(`Resend inbound fetch failed: ${received.error?.name}: ${received.error?.message}`);
- }
- const attachments = await Promise.all(
- received.data.attachments.map(async (attachment) => {
- const file = await resend.emails.receiving.attachments.get({ emailId: payload.emailId, id: attachment.id });
- if (file.error || !file.data) {
- throw new Error(`Resend attachment fetch failed: ${file.error?.name}: ${file.error?.message}`);
- }
- return {
- contentType: file.data.content_type,
- filename: file.data.filename ?? attachment.filename ?? attachment.id,
- path: file.data.download_url,
- };
- }),
- );
-
- const banner = `${outreach.user.name} <${outreach.user.email}> replied to your outreach note.`;
- const bannerHtml = escapeHtml(banner);
- return {
- from,
- to: inbox,
- replyTo: outreach.user.email,
- subject: received.data.subject || "Re: What are you making?",
- attachments: attachments.length > 0 ? attachments : undefined,
- html: received.data.html ? `<p><strong>${bannerHtml}</strong></p>${received.data.html}` : undefined,
- text: received.data.text ? `${banner}\n\n${received.data.text}` : banner,
- };
-}
diff --git a/site/src/lib/marketing/lastActive.ts b/site/src/lib/marketing/lastActive.ts
deleted file mode 100644
index 0ede1adb..00000000
--- a/site/src/lib/marketing/lastActive.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { prisma } from "@/lib/prisma";
-
-// When each account last used the product. Model work and cloud editing are
-// both use, so either one keeps an account looking as recent as it is.
-// Housekeeping writes the storage counter on its own — GC sweeps, copy jobs,
-// the render worker — so that timestamp says nothing about a person being
-// there and is left out.
-export async function lastActiveByUser(userIds: string[]): Promise<Map<string, Date>> {
- const lastActiveBy = new Map<string, Date>();
- if (userIds.length === 0) return lastActiveBy;
- const [billed, uploaded, edited] = await Promise.all([
- prisma.inferenceUsageEvent.groupBy({
- _max: { createdAt: true },
- by: ["userId"],
- where: { billingStatus: "charged", userId: { in: userIds } },
- }),
- prisma.cutMediaObject.groupBy({
- _max: { createdAt: true },
- by: ["userId"],
- where: { quotaExempt: false, uploadState: "complete", userId: { in: userIds } },
- }),
- prisma.cutProject.groupBy({
- _max: { updatedAt: true },
- by: ["userId"],
- where: { userId: { in: userIds } },
- }),
- ]);
- const touch = (userId: string, at: Date | null) => {
- const best = lastActiveBy.get(userId);
- if (at && (!best || at > best)) lastActiveBy.set(userId, at);
- };
- for (const row of billed) touch(row.userId, row._max.createdAt);
- for (const row of uploaded) touch(row.userId, row._max.createdAt);
- for (const row of edited) touch(row.userId, row._max.updatedAt);
- return lastActiveBy;
-}
-
-// The largest rank a row can hold: an account never seen using the product.
-const NEVER_ACTIVE_RANK = 2 ** 31 - 1;
-
-/** A promotion row's place in the queue: seconds since the account last used
- * the product, so the people most recently active go first however many
- * pages the segment was read in. */
-export function activityRank(now: Date, lastActiveAt: Date | undefined): number {
- if (!lastActiveAt) return NEVER_ACTIVE_RANK;
- return Math.min(NEVER_ACTIVE_RANK, Math.max(0, Math.floor((now.getTime() - lastActiveAt.getTime()) / 1000)));
-}
diff --git a/site/src/lib/marketing/outreachCopy.test.tsx b/site/src/lib/marketing/outreachCopy.test.tsx
deleted file mode 100644
index e00713bd..00000000
--- a/site/src/lib/marketing/outreachCopy.test.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import { describe, expect, test } from "bun:test";
-import { render } from "react-email";
-
-import OutreachEmail from "@/emails/outreach";
-import { type CreditOfferTerms } from "@/lib/credits/offerTerms";
-import { renderOutreachCopy } from "@/lib/marketing/outreachCopy";
-
-const vars = {
- balance: "0", email: "[email protected]", firstName: "Ada", name: "Ada Lovelace",
- spent: "2.4", storage: "120 MB", claimUrl: "https://example.com/app?claim=test&source=email", claimBy: "September 30",
-};
-const offer: CreditOfferTerms = { dollars: 60, claim: "subscribe", claimWindowDays: 3, expiresAfterDays: 30 };
-
-describe("outreach claim button", () => {
- test("accepts the note's button without a separate claimUrl placeholder", async () => {
- const copy = renderOutreachCopy("Low on credits?", "Hey {{firstName}},\n\nSubscribe for $60 in credits.\n\n{{button}}", vars, offer);
- expect(copy.cta).toEqual({ label: "Subscribe to Pro", url: vars.claimUrl });
- expect(copy.blocks.at(-1)).toEqual({ kind: "button" });
- expect(copy.text).toContain(`Subscribe to Pro: ${vars.claimUrl}`);
- expect(copy.text).not.toContain("{{");
- const html = await render(<OutreachEmail blocks={copy.blocks} cta={copy.cta!} unsubscribeUrl="https://example.com/unsubscribe" />);
- expect(html).toContain("Subscribe to Pro");
- expect(html).toContain('href="https://example.com/app?claim=test&amp;source=email"');
- expect(html).toContain("background-color:#0F0E0D");
- expect(html).toContain("Unsubscribe from product emails");
- });
-
- test("direct claims use their own label and repeated markers place one button", () => {
- const copy = renderOutreachCopy("Credits", "{{button}}\r\n\r\nThanks!\r\n\r\n{{button}}", vars, { ...offer, claim: "link" });
- expect(copy.cta?.label).toBe("Claim my AI credits");
- expect(copy.blocks.filter((block) => block.kind === "button")).toHaveLength(1);
- });
-
- test("requires an offer, a claim URL, and a standalone marker", () => {
- expect(() => renderOutreachCopy("Credits", "{{button}}", vars, null)).toThrow("Turn on the credit offer");
- expect(() => renderOutreachCopy("Credits", "{{button}}", { ...vars, claimUrl: undefined }, offer)).toThrow("Turn on the credit offer");
- expect(() => renderOutreachCopy("Credits", "Click {{button}}", vars, offer)).toThrow("own paragraph");
- expect(() => renderOutreachCopy("Credits", "Hello", vars, offer)).toThrow("needs {{button}} or {{claimUrl}}");
- expect(() => renderOutreachCopy("{{button}}", "{{claimUrl}}", vars, offer)).toThrow("Unknown placeholder");
- });
-
- test("keeps plain notes and URL placeholders as text", () => {
- const body = "Hey {{firstName}},\n\n\nClaim here: {{ claimUrl }}";
- const copy = renderOutreachCopy("Credits", body, vars, offer);
- expect(copy.cta).toBeNull();
- expect(copy.text).toBe(`Hey Ada,\n\n\nClaim here: ${vars.claimUrl}`);
- expect(renderOutreachCopy("Hello", "Plain note", vars, null).text).toBe("Plain note");
- });
-
- test("escapes recipient text and omits the disabled unsubscribe footer", async () => {
- const copy = renderOutreachCopy("Credits", "Hey {{name}},\nA second line.\n\n{{button}}", { ...vars, name: '<img src="x"> {{button}}' }, offer);
- const html = await render(<OutreachEmail blocks={copy.blocks} cta={copy.cta!} unsubscribeUrl={null} />);
- expect(html).toContain("&lt;img");
- expect(html).not.toContain('<img src="x">');
- expect(html).toContain("<br");
- expect(html).not.toContain("Unsubscribe");
- });
-});
diff --git a/site/src/lib/marketing/outreachCopy.ts b/site/src/lib/marketing/outreachCopy.ts
deleted file mode 100644
index b2994f27..00000000
--- a/site/src/lib/marketing/outreachCopy.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { OFFER_BUTTON_LABELS, type CreditOfferTerms } from "@/lib/credits/offerTerms";
-import { fillOutreachText, type OutreachVars } from "@/lib/marketing/placeholders";
-import { BUTTON_MARK, type PromotionBlock } from "@/lib/marketing/promotionCopy";
-
-export class OutreachCopyError extends Error {}
-
-/** Parse template syntax before inserting recipient values. */
-export function renderOutreachCopy(
- subject: string,
- body: string,
- vars: OutreachVars,
- offer: CreditOfferTerms | null,
-) {
- const blocks: PromotionBlock[] = [];
- let hasButton = false;
- for (const paragraph of body.replace(/\r\n/g, "\n").split(/\n[ \t]*\n/)) {
- const text = paragraph.trim();
- if (!text) continue;
- if (text === BUTTON_MARK) {
- if (!offer || typeof vars.claimUrl !== "string") {
- throw new OutreachCopyError("Turn on the credit offer to use {{button}}.");
- }
- if (!hasButton) blocks.push({ kind: "button" });
- hasButton = true;
- } else {
- if (text.includes(BUTTON_MARK)) {
- throw new OutreachCopyError("Put {{button}} in its own paragraph, with a blank line before and after it.");
- }
- blocks.push({ kind: "text", text: fillOutreachText(text, vars) });
- }
- }
- const filledSubject = fillOutreachText(subject, vars);
- if (offer && !hasButton && !/\{\{\s*claimUrl\s*\}\}/.test(`${subject}\n${body}`)) {
- throw new OutreachCopyError("A note with a credit offer needs {{button}} or {{claimUrl}} in it.");
- }
- const cta = hasButton && offer && typeof vars.claimUrl === "string"
- ? { label: OFFER_BUTTON_LABELS[offer.claim], url: vars.claimUrl }
- : null;
- const text = cta
- ? blocks.map((block) => block.kind === "text" ? block.text : `${cta.label}: ${cta.url}`).join("\n\n")
- : fillOutreachText(body, vars);
- return { subject: filledSubject, text, blocks, cta };
-}
diff --git a/site/src/lib/marketing/placeholders.test.ts b/site/src/lib/marketing/placeholders.test.ts
deleted file mode 100644
index 68f1e9cb..00000000
--- a/site/src/lib/marketing/placeholders.test.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { describe, expect, test } from "bun:test";
-
-import {
- fillOutreachText,
- OUTREACH_PLACEHOLDERS,
- UnknownPlaceholderError,
-} from "./placeholders";
-
-const vars = {
- balance: "0",
- email: "[email protected]",
- firstName: "Ada",
- name: "Ada Lovelace",
- spent: "2.4",
- storage: "120 MB",
-};
-
-function refusedPlaceholder(text: string): boolean {
- try {
- fillOutreachText(text, vars);
- return false;
- } catch (e) {
- return e instanceof UnknownPlaceholderError;
- }
-}
-
-describe("fillOutreachText", () => {
- test("a placeholder becomes the recipient's value", () => {
- expect(fillOutreachText("Hey {{firstName}}, you spent ${{spent}}.", vars)).toBe(
- "Hey Ada, you spent $2.4.",
- );
- });
-
- test("spacing inside the braces is allowed", () => {
- expect(fillOutreachText("{{ name }}", vars)).toBe("Ada Lovelace");
- });
-
- test("text with no placeholders is untouched", () => {
- expect(fillOutreachText("Plain words.", vars)).toBe("Plain words.");
- });
-
- test("a misspelled placeholder throws instead of mailing the braces", () => {
- expect(refusedPlaceholder("Hey {{frstName}}")).toBe(true);
- });
-
- // The button row offers every name in the list, so every one of them has to
- // resolve to a value; a name the send path forgets to supply would mail the
- // word "undefined" to a real person. The offer's names fill once a note
- // carries an offer, and are refused before that.
- test("every offered placeholder fills with the recipient's value", () => {
- const withOffer = { ...vars, claimBy: "September 30, 2026", claimUrl: "https://donkeycut.com/app?claim=t" };
- for (const name of OUTREACH_PLACEHOLDERS) {
- const filled = fillOutreachText(`{{${name}}}`, withOffer);
- expect(filled).not.toBe("");
- expect(filled).not.toContain("undefined");
- }
- });
-
- test("an offer placeholder in a note without an offer is refused", () => {
- expect(refusedPlaceholder("{{claimUrl}}")).toBe(true);
- expect(refusedPlaceholder("{{claimBy}}")).toBe(true);
- });
-});
-
diff --git a/site/src/lib/marketing/placeholders.ts b/site/src/lib/marketing/placeholders.ts
deleted file mode 100644
index 62e56e1b..00000000
--- a/site/src/lib/marketing/placeholders.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import { OFFER_PLACEHOLDERS, type OfferVars } from "@/lib/credits/offerTerms";
-
-// What a subject or body may name, and where each value comes from. Saved
-// templates and hand-typed notes go through the same fill, so a placeholder
-// means the same thing either way.
-
-/** The values a placeholder resolves to, for one recipient. */
-export type OutreachVars = {
- /** First word of the account name. */
- firstName: string;
- /** The account name as Google gave it. */
- name: string;
- email: string;
- /** USD spent on model work so far, as a plain number string. */
- spent: string;
- /** USD left on the account. */
- balance: string;
- /** Cloud media the account is holding, already in reading units ("120 MB"). */
- storage: string;
-} & Partial<OfferVars>;
-
-export const OUTREACH_PLACEHOLDERS = [
- "firstName",
- "name",
- "email",
- "spent",
- "balance",
- "storage",
- ...OFFER_PLACEHOLDERS,
-] as const satisfies readonly (keyof OutreachVars)[];
-
-/** What a promotion may name: the account itself, nothing that costs a query
- * per recipient, and the offer when it carries one. */
-export type PromotionVars = {
- firstName: string;
- name: string;
- email: string;
-} & Partial<OfferVars>;
-
-export const PROMOTION_PLACEHOLDERS = [
- "firstName",
- "name",
- "email",
- ...OFFER_PLACEHOLDERS,
-] as const satisfies readonly (keyof PromotionVars)[];
-
-const PLACEHOLDER = /\{\{\s*([a-zA-Z]+)\s*\}\}/g;
-
-export class UnknownPlaceholderError extends Error {
- public constructor(public readonly placeholder: string) {
- super(`Unknown placeholder {{${placeholder}}}.`);
- this.name = "UnknownPlaceholderError";
- }
-}
-
-/** First word of an account name, the way a note addresses someone. */
-export function firstNameOf(name: string): string {
- return name.trim().split(/\s+/)[0] || name;
-}
-
-function fill(text: string, vars: Record<string, unknown>, allowed: readonly string[]): string {
- return text.replace(PLACEHOLDER, (_match, key: string) => {
- if (!allowed.includes(key)) {
- throw new UnknownPlaceholderError(key);
- }
- const value = vars[key];
- if (typeof value !== "string") {
- throw new UnknownPlaceholderError(key);
- }
- return value;
- });
-}
-
-/** Fills a subject or body for one recipient. An unknown placeholder throws
- * rather than mailing the braces out, so a typo is caught before the send. */
-export function fillOutreachText(text: string, vars: OutreachVars): string {
- return fill(text, vars, OUTREACH_PLACEHOLDERS);
-}
-
-/** The promotion fill: the same rule over the smaller set. */
-export function fillPromotionText(text: string, vars: PromotionVars): string {
- return fill(text, vars, PROMOTION_PLACEHOLDERS);
-}
diff --git a/site/src/lib/marketing/promotionCopy.test.ts b/site/src/lib/marketing/promotionCopy.test.ts
deleted file mode 100644
index e3473fed..00000000
--- a/site/src/lib/marketing/promotionCopy.test.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { describe, expect, test } from "bun:test";
-
-import { UnknownPlaceholderError } from "./placeholders";
-import { promotionBlocks, renderPromotion, SAMPLE_RECIPIENT } from "./promotionCopy";
-
-const copy = {
- subject: "{{firstName}}, 5x AI on Pro",
- body: "Hey {{firstName}},\n\nGet Pro before October 29.\nEvery month includes $100 of AI.\n\n{{button}}\n\nDavid",
- ctaLabel: "Get Pro",
- ctaUrl: "https://donkeycut.com/app/settings",
- sender: "bulk" as const,
-};
-
-describe("promotionBlocks", () => {
- test("splits at blank lines and keeps a line break inside a paragraph", () => {
- expect(promotionBlocks("one\ntwo\n\n\nthree", false)).toEqual([
- { kind: "text", text: "one\ntwo" },
- { kind: "text", text: "three" },
- ]);
- });
-
- test("places the button where the mark is, once", () => {
- expect(promotionBlocks("a\n\n{{button}}\n\nb\n\n{{button}}", true)).toEqual([
- { kind: "text", text: "a" },
- { kind: "button" },
- { kind: "text", text: "b" },
- ]);
- });
-
- test("a credit offer fills its link and last day", () => {
- const rendered = renderPromotion(
- { ...copy, body: "Subscribe by {{claimBy}}.", ctaUrl: "{{claimUrl}}" },
- SAMPLE_RECIPIENT,
- { claimUrl: "https://donkeycut.com/app?claim=t", claimBy: "September 30, 2026" },
- );
- expect(rendered.blocks[0]).toEqual({ kind: "text", text: "Subscribe by September 30, 2026." });
- expect(rendered.cta?.url).toBe("https://donkeycut.com/app?claim=t");
- });
-
- test("a body without the mark gets the button last", () => {
- expect(promotionBlocks("a\n\nb", true)).toEqual([
- { kind: "text", text: "a" },
- { kind: "text", text: "b" },
- { kind: "button" },
- ]);
- });
-
- test("the mark is dropped when there is no button", () => {
- expect(promotionBlocks("a\n\n{{button}}", false)).toEqual([{ kind: "text", text: "a" }]);
- });
-});
-
-describe("renderPromotion", () => {
- test("fills the subject, body and button label for the recipient", () => {
- const rendered = renderPromotion(copy, SAMPLE_RECIPIENT);
- expect(rendered.subject).toBe("Ada, 5x AI on Pro");
- expect(rendered.blocks).toEqual([
- { kind: "text", text: "Hey Ada," },
- { kind: "text", text: "Get Pro before October 29.\nEvery month includes $100 of AI." },
- { kind: "button" },
- { kind: "text", text: "David" },
- ]);
- expect(rendered.cta).toEqual({ label: "Get Pro", url: copy.ctaUrl });
- expect(rendered.preview).toBe("Hey Ada,");
- });
-
- test("an unknown placeholder refuses the copy", () => {
- let refused = false;
- try {
- renderPromotion({ ...copy, body: "{{balance}}" }, SAMPLE_RECIPIENT);
- } catch (e) {
- refused = e instanceof UnknownPlaceholderError;
- }
- expect(refused).toBe(true);
- });
-
- test("no button leaves the body as paragraphs", () => {
- const rendered = renderPromotion({ ...copy, ctaLabel: null, ctaUrl: null }, SAMPLE_RECIPIENT);
- expect(rendered.cta).toBeNull();
- expect(rendered.blocks.some((b) => b.kind === "button")).toBe(false);
- });
-});
diff --git a/site/src/lib/marketing/promotionCopy.ts b/site/src/lib/marketing/promotionCopy.ts
deleted file mode 100644
index 46ecbaa1..00000000
--- a/site/src/lib/marketing/promotionCopy.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import type { EmailUser } from "@/lib/email/resend";
-import {
- fillPromotionText,
- firstNameOf,
- type PromotionVars,
-} from "@/lib/marketing/placeholders";
-import type { OfferVars } from "@/lib/credits/offerTerms";
-import type { PromotionSender } from "@/lib/marketing/promotionInput";
-
-// The words of a promotion, turned into what one recipient reads: the subject
-// and body with placeholders filled, the body cut into paragraphs, and the
-// button placed. Pure, so the send, the test send and the tests share it.
-
-export type PromotionCopy = {
- subject: string;
- body: string;
- ctaLabel: string | null;
- ctaUrl: string | null;
- sender: PromotionSender;
-};
-
-export type PromotionBlock = { kind: "text"; text: string } | { kind: "button" };
-
-/** A paragraph that is only this places the button there. */
-export const BUTTON_MARK = "{{button}}";
-
-/** Splits a body into paragraphs at blank lines. With a button, the first
- * paragraph reading `{{button}}` places it; without one it follows the last
- * paragraph. A line break inside a paragraph is kept. */
-export function promotionBlocks(body: string, hasButton: boolean): PromotionBlock[] {
- const blocks: PromotionBlock[] = [];
- let placed = false;
- for (const raw of body.replace(/\r\n/g, "\n").split(/\n[ \t]*\n/)) {
- const text = raw.trim();
- if (!text) continue;
- if (text === BUTTON_MARK) {
- if (hasButton && !placed) {
- blocks.push({ kind: "button" });
- placed = true;
- }
- continue;
- }
- blocks.push({ kind: "text", text });
- }
- if (hasButton && !placed) blocks.push({ kind: "button" });
- return blocks;
-}
-
-export function promotionVars(user: EmailUser): PromotionVars {
- return { firstName: firstNameOf(user.name), name: user.name, email: user.email };
-}
-
-export type RenderedPromotion = {
- subject: string;
- blocks: PromotionBlock[];
- cta: { label: string; url: string } | null;
- // The inbox preview line: the first line of the body.
- preview: string;
-};
-
-/** What one recipient reads. Throws UnknownPlaceholderError on a typo, so a
- * save or a send fails before any mail leaves. */
-export function renderPromotion(copy: PromotionCopy, user: EmailUser, offer?: OfferVars): RenderedPromotion {
- const vars = { ...promotionVars(user), ...offer };
- const subject = fillPromotionText(copy.subject, vars);
- const cta =
- copy.ctaLabel !== null && copy.ctaUrl !== null
- ? { label: fillPromotionText(copy.ctaLabel, vars), url: fillPromotionText(copy.ctaUrl, vars) }
- : null;
- const body = fillPromotionText(copy.body.replaceAll(BUTTON_MARK, "\u0000button\u0000"), vars).replaceAll(
- "\u0000button\u0000",
- BUTTON_MARK,
- );
- const blocks = promotionBlocks(body, cta !== null);
- const first = blocks.find((b): b is { kind: "text"; text: string } => b.kind === "text");
- return { subject, blocks, cta, preview: first ? first.text.split("\n")[0] : subject };
-}
-
-/** A stand-in recipient, for validating copy and for the test send. */
-export const SAMPLE_RECIPIENT: EmailUser = { id: "sample", email: "[email protected]", name: "Ada Lovelace" };
diff --git a/site/src/lib/marketing/promotionInput.ts b/site/src/lib/marketing/promotionInput.ts
deleted file mode 100644
index 17ac6ad6..00000000
--- a/site/src/lib/marketing/promotionInput.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-// The names a promotion row holds.
-
-export const PROMOTION_SENDERS = ["bulk", "personal"] as const;
-export type PromotionSender = (typeof PROMOTION_SENDERS)[number];
-
-// What a segment resolves to before anything is sent.
-export type SegmentCount = {
- recipients: number;
- unsubscribed: number;
- alreadyReceived: number;
- outsideAudience: number;
-};
diff --git a/site/src/lib/marketing/promotions.ts b/site/src/lib/marketing/promotions.ts
deleted file mode 100644
index 12c1fc3f..00000000
--- a/site/src/lib/marketing/promotions.ts
+++ /dev/null
@@ -1,176 +0,0 @@
-import { audienceNeeds, audienceSchema, matchesAudience, type Audience } from "@donkeycut/abexp";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { DONKEY_LOGO_CID, DONKEY_LOGO_PNG_BASE64 } from "@/emails/_components/logo";
-import PromotionEmail from "@/emails/promotion";
-import { collectFactsFor } from "@/lib/config/audienceFacts";
-import { bulkFrom, emailFrom, type EmailMessage, type EmailUser } from "@/lib/email/resend";
-import { PermanentSendError } from "@/lib/email/errors";
-import { unsubscribeActionUrl, unsubscribePageUrl } from "@/lib/email/unsubscribe";
-import { renderPromotion, type PromotionCopy } from "@/lib/marketing/promotionCopy";
-import {
- PROMOTION_SENDERS,
- type PromotionSender,
- type SegmentCount,
-} from "@/lib/marketing/promotionInput";
-import { prisma } from "@/lib/prisma";
-import type { OfferVars } from "@/lib/credits/offerTerms";
-
-// Promotions on the server: which address each sender is, who a segment
-// resolves to, and one send.
-
-/** The address each sender name stands for. Empty when unconfigured. */
-export function promotionSenders(): Record<PromotionSender, string> {
- return { bulk: bulkFrom(), personal: emailFrom() };
-}
-
-const isSender = (s: string): s is PromotionSender => (PROMOTION_SENDERS as readonly string[]).includes(s);
-
-function senderOf(value: string): PromotionSender {
- if (!isSender(value)) throw new Error(`Unknown promotion sender "${value}".`);
- return value;
-}
-
-export function promotionCopyOf(row: {
- subject: string;
- body: string;
- ctaLabel: string | null;
- ctaUrl: string | null;
- sender: string;
-}): PromotionCopy {
- return { subject: row.subject, body: row.body, ctaLabel: row.ctaLabel, ctaUrl: row.ctaUrl, sender: senderOf(row.sender) };
-}
-
-// A stored audience that no longer parses is an error: widening a send to
-// everyone is the one thing a bad row must never do.
-export function promotionAudienceOf(raw: Prisma.JsonValue): Audience {
- return audienceSchema.parse(raw);
-}
-
-/** One promotion email for one account. The idempotency key is the row's:
- * the outbox keys on the recipient so a retried run cannot mail anyone twice. */
-export function buildPromotionEmail(
- copy: PromotionCopy,
- user: EmailUser,
- offer: OfferVars | undefined,
- // Wraps the button's link so the follow is counted; the test send has none.
- trackClick?: (url: string) => string,
-): EmailMessage {
- const from = promotionSenders()[copy.sender];
- if (!from) throw new PermanentSendError(`The ${copy.sender} sender is not configured.`);
- const rendered = renderPromotion(copy, user, offer);
- const cta = rendered.cta && trackClick ? { ...rendered.cta, url: trackClick(rendered.cta.url) } : rendered.cta;
- return {
- from,
- to: user.email,
- replyTo: emailFrom() || from,
- subject: rendered.subject,
- react: PromotionEmail({
- blocks: rendered.blocks,
- cta,
- preview: rendered.preview,
- unsubscribeUrl: unsubscribePageUrl(user.id),
- }),
- attachments: [
- {
- content: DONKEY_LOGO_PNG_BASE64,
- contentId: DONKEY_LOGO_CID,
- contentType: "image/png",
- filename: "donkey-cut.png",
- },
- ],
- headers: {
- "List-Unsubscribe": `<${unsubscribeActionUrl(user.id)}>`,
- "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
- },
- };
-}
-
-export type PromotionSegment = { audience: Audience; excludePromotionIds: string[] };
-
-/** The outbox key for one person's copy of a promotion. The segment send and
- * a send by hand share it, so a person gets a promotion once. */
-export function promotionIdempotencyKey(promotionId: string, userId: string): string {
- return `promotion:${promotionId}:${userId}`;
-}
-
-export type SegmentResolution = SegmentCount & {
- // Where the walk stopped: the last account read when the deadline came,
- // null once the whole list was seen. A caller resumes by passing it back.
- cursor: string | null;
-};
-
-export type ResolveOptions = {
- now?: Date;
- // Resume from an earlier call's cursor.
- cursor?: string;
- // A time (ms since epoch) after which no further page is read.
- deadline?: number;
- // Receives each page of recipients as it is found. Returning false stops
- // the walk, leaving the cursor on that page.
- onPage?: (users: EmailUser[]) => Promise<boolean | void>;
-};
-
-const USER_PAGE = 500;
-
-/** Everyone a segment reaches: the accounts the audience rules admit, less
- * the unsubscribed, less the recipients of the excluded promotions. The list
- * is read a page at a time and every fact is one set query over the page,
- * so a segment of any size costs a handful of statements per page and holds
- * one page in memory. The counts describe the pages this call walked; those
- * left out are taken inside the audience, so they describe the segment.
- * Country is never known here, so a countries rule admits nobody. */
-export async function resolvePromotionSegment(
- segment: PromotionSegment,
- { now = new Date(), cursor, deadline, onPage }: ResolveOptions = {},
-): Promise<SegmentResolution> {
- const needs = audienceNeeds(segment.audience);
- const result: SegmentResolution = { cursor: null, recipients: 0, unsubscribed: 0, alreadyReceived: 0, outsideAudience: 0 };
- let last = cursor;
- for (;;) {
- const page = await prisma.user.findMany({
- orderBy: { id: "asc" },
- select: {
- createdAt: true,
- email: true,
- emailSettings: { select: { marketingUnsubscribedAt: true } },
- id: true,
- name: true,
- },
- take: USER_PAGE,
- ...(last ? { cursor: { id: last }, skip: 1 } : {}),
- });
- if (page.length === 0) break;
- const ids = page.map((u) => u.id);
- const [facts, receivedRows] = await Promise.all([
- collectFactsFor(page.map((u) => ({ id: u.id, country: null, createdAt: u.createdAt })), needs),
- segment.excludePromotionIds.length > 0
- ? prisma.emailSend.findMany({
- distinct: ["userId"],
- select: { userId: true },
- where: { promotionId: { in: segment.excludePromotionIds }, state: "sent", userId: { in: ids } },
- })
- : [],
- ]);
- const received = new Set(receivedRows.map((r) => r.userId));
- const users: EmailUser[] = [];
- for (const user of page) {
- if (!matchesAudience(segment.audience, facts.get(user.id)!, now)) result.outsideAudience++;
- else if (user.emailSettings?.marketingUnsubscribedAt) result.unsubscribed++;
- else if (received.has(user.id)) result.alreadyReceived++;
- else users.push({ email: user.email, id: user.id, name: user.name });
- }
- result.recipients += users.length;
- last = page[page.length - 1].id;
- if (onPage && (await onPage(users)) === false) {
- result.cursor = last;
- return result;
- }
- if (page.length < USER_PAGE) break;
- if (deadline !== undefined && Date.now() >= deadline) {
- result.cursor = last;
- return result;
- }
- }
- return result;
-}
diff --git a/site/src/lib/marketing/replyAddress.test.ts b/site/src/lib/marketing/replyAddress.test.ts
deleted file mode 100644
index 1d08aea9..00000000
--- a/site/src/lib/marketing/replyAddress.test.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { describe, expect, test } from "bun:test";
-
-process.env.BETTER_AUTH_SECRET ??= "test-secret";
-
-import {
- outreachIdFromReplyAddress,
- outreachIdFromRecipients,
- outreachReplyAddress,
-} from "./replyAddress";
-
-const id = "cmf0z8k9x0000abcdefghijkl";
-
-describe("outreachReplyAddress", () => {
- test("an address it signed reads back as its row id", () => {
- expect(outreachIdFromReplyAddress(outreachReplyAddress(id))).toBe(id);
- });
-
- test("the local part stays inside the 64-octet limit", () => {
- const local = outreachReplyAddress(id).split("@")[0];
- expect(local.length).toBeLessThanOrEqual(64);
- });
-
- test("a guessed row id without a signature is refused", () => {
- expect(outreachIdFromReplyAddress(`outreach+${id}[email protected]`)).toBeNull();
- });
-
- test("another row's signature does not carry over", () => {
- const sig = outreachReplyAddress("other-row").split("@")[0].split(".")[1];
- expect(outreachIdFromReplyAddress(`outreach+${id}.${sig}@reply.donkeycut.com`)).toBeNull();
- });
-
- test("an address on another host is not ours", () => {
- const local = outreachReplyAddress(id).split("@")[0];
- expect(outreachIdFromReplyAddress(`${local}@donkeycut.com`)).toBeNull();
- });
-
- test("recipients are searched past unrelated addresses and display names", () => {
- expect(
- outreachIdFromRecipients(
- [`Donkey <${outreachReplyAddress(id)}>`],
- ),
- ).toBe(id);
- });
-
- test("mail addressed to nobody we know reads as no row", () => {
- expect(outreachIdFromRecipients(["[email protected]"], [])).toBeNull();
- });
-});
diff --git a/site/src/lib/marketing/replyAddress.ts b/site/src/lib/marketing/replyAddress.ts
deleted file mode 100644
index cc9a0fdd..00000000
--- a/site/src/lib/marketing/replyAddress.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { createHmac, timingSafeEqual } from "node:crypto";
-
-import { OUTREACH_REPLY_HOST } from "@/cut/lib/hosts";
-
-// Every outreach email replies to its own address, so an inbound message finds
-// its row without matching on the sender — people answer from aliases, and
-// forwarded mail arrives from somewhere else entirely. The row id is signed the
-// same way unsubscribe tokens are (src/lib/email/unsubscribe.ts), under its own
-// domain string, so a stranger cannot post into a thread by guessing an id.
-const TOKEN_DOMAIN = "donkey-outreach-reply-v1";
-
-// Local-part shape: `outreach+${outreachId}.${signature}`. The signature is
-// truncated because a local part may be no longer than 64 octets and some
-// servers enforce it; 96 bits is far more than a forger gets attempts at.
-const LOCAL_PART = /^outreach\+([^.@]+)\.([A-Za-z0-9_-]+)$/;
-const SIGNATURE_BYTES = 12;
-
-function signature(outreachId: string): Buffer {
- const secret = process.env.BETTER_AUTH_SECRET;
- if (!secret) {
- throw new Error("BETTER_AUTH_SECRET is not set.");
- }
- const key = createHmac("sha256", secret).update(TOKEN_DOMAIN).digest();
- return createHmac("sha256", key).update(outreachId).digest().subarray(0, SIGNATURE_BYTES);
-}
-
-export function outreachReplyAddress(outreachId: string): string {
- const sig = signature(outreachId).toString("base64url");
- return `outreach+${outreachId}.${sig}@${OUTREACH_REPLY_HOST}`;
-}
-
-/** The row id an inbound address names, or null when it is not one of ours. */
-export function outreachIdFromReplyAddress(address: string): string | null {
- const at = address.lastIndexOf("@");
- if (at <= 0) {
- return null;
- }
- const host = address.slice(at + 1).toLowerCase();
- if (host !== OUTREACH_REPLY_HOST) {
- return null;
- }
- const match = LOCAL_PART.exec(address.slice(0, at));
- if (!match) {
- return null;
- }
- const [, outreachId, given] = match;
- const expected = signature(outreachId);
- const supplied = Buffer.from(given, "base64url");
- if (supplied.length !== expected.length || !timingSafeEqual(supplied, expected)) {
- return null;
- }
- return outreachId;
-}
-
-// Mail arrives addressed in more than one field: `received_for` carries the
-// envelope recipient, `to` what the sender typed. Take the first that verifies.
-export function outreachIdFromRecipients(
- ...groups: (string[] | null | undefined)[]
-): string | null {
- for (const group of groups) {
- for (const entry of group ?? []) {
- // Headers arrive as "Name <addr@host>" as often as a bare address.
- const angled = /<([^>]+)>/.exec(entry);
- const id = outreachIdFromReplyAddress((angled?.[1] ?? entry).trim());
- if (id) {
- return id;
- }
- }
- }
- return null;
-}
diff --git a/site/src/lib/marketing/send-outreach.ts b/site/src/lib/marketing/send-outreach.ts
deleted file mode 100644
index 55a51427..00000000
--- a/site/src/lib/marketing/send-outreach.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-import { z } from "zod";
-
-import OutreachEmail from "@/emails/outreach";
-import { createTermsCreditOffer } from "@/lib/credits/offers";
-import { creditOfferTermsSchema } from "@/lib/credits/offerTerms";
-import { PermanentSendError } from "@/lib/email/errors";
-import { emailFrom, type EmailMessage, type EmailUser } from "@/lib/email/resend";
-import { isMarketingUnsubscribed, unsubscribePageUrl } from "@/lib/email/unsubscribe";
-import { outreachReplyAddress } from "@/lib/marketing/replyAddress";
-import { type OutreachVars, UnknownPlaceholderError } from "@/lib/marketing/placeholders";
-import { OutreachCopyError, renderOutreachCopy } from "@/lib/marketing/outreachCopy";
-import { prisma } from "@/lib/prisma";
-
-export const outreachPayloadSchema = z
- .object({
- outreachId: z.string().min(1),
- // Which send this is for the row, so a retried click cannot double-send
- // and a deliberate second note still goes out.
- attempt: z.number().int().min(1),
- actorUserId: z.string().min(1),
- // The final words, from a template or typed in the dialog. Placeholders
- // are filled at send time so the operator edits `{{firstName}}` and the
- // recipient reads their name.
- subject: z.string().min(1),
- body: z.string().min(1),
- vars: z
- .object({ balance: z.string(), email: z.string(), firstName: z.string(), name: z.string(), spent: z.string(), storage: z.string() })
- .strict() satisfies z.ZodType<OutreachVars>,
- // The credit offer the note carries, if any. The offer row is made when
- // the note is built, and the words fill in its link and last day.
- creditOffer: creditOfferTermsSchema.nullable().default(null),
- // Whether the note carries the opt-out footer. The operator decides per
- // send; the unsubscribed check always runs.
- unsubscribeLink: z.boolean(),
- // Whether replies route through the row's signed alias, which forwards
- // them to the operator's inbox and marks the row replied. Off puts the
- // sending address itself on the wire, so the note reads like any personal
- // thread and the row is filed with the list's "Mark replied" button.
- trackReplies: z.boolean(),
- })
- .strict();
-
-export type OutreachPayload = z.output<typeof outreachPayloadSchema>;
-
-// Every note carries a plain-text version, including its optional opt-out footer.
-function outreachText(body: string, unsubscribeUrl: string | null): string {
- const trimmed = body.trim();
- if (!unsubscribeUrl) return `${trimmed}\n`;
- return `${trimmed}\n\n--\nUnsubscribe from product emails: ${unsubscribeUrl}\n`;
-}
-
-/** The scope of the offer one note makes: the row and the attempt, so a
- * deliberate second note makes a fresh offer and a retry reuses the first. */
-export function outreachOfferScope(outreachId: string, attempt: number): string {
- return `outreach:${outreachId}:${attempt}`;
-}
-
-/** The scope of the offer a test note makes: the outbox row that carries it,
- * so every test mints the operator a fresh link. */
-export function outreachTestOfferScope(outboxRowId: string): string {
- return `outreach-test:${outboxRowId}`;
-}
-
-// Builds one outreach note. The reply target is the operator's call per
-// send: the row's own signed alias, or the sending address itself.
-export async function buildOutreachEmail(
- payload: OutreachPayload,
- user: EmailUser,
- offerScope = outreachOfferScope(payload.outreachId, payload.attempt),
-): Promise<EmailMessage | null> {
- if (await isMarketingUnsubscribed(user.id)) return null;
- const from = emailFrom();
- if (!from) throw new PermanentSendError("RESEND_FROM_EMAIL is not configured.");
-
- const offer = payload.creditOffer
- ? await createTermsCreditOffer({
- scope: offerScope,
- userId: user.id,
- terms: payload.creditOffer,
- offeredByUserId: payload.actorUserId,
- })
- : null;
- const vars: OutreachVars = { ...payload.vars, ...offer?.vars };
- let copy: ReturnType<typeof renderOutreachCopy>;
- try {
- copy = renderOutreachCopy(payload.subject, payload.body, vars, payload.creditOffer);
- } catch (error) {
- if (error instanceof UnknownPlaceholderError || error instanceof OutreachCopyError) throw new PermanentSendError(error.message);
- throw error;
- }
- const unsubscribeUrl = payload.unsubscribeLink ? unsubscribePageUrl(user.id) : null;
- return {
- from,
- to: user.email,
- replyTo: payload.trackReplies ? outreachReplyAddress(payload.outreachId) : undefined,
- subject: copy.subject,
- text: outreachText(copy.text, unsubscribeUrl),
- ...(copy.cta ? { react: OutreachEmail({ blocks: copy.blocks, cta: copy.cta, unsubscribeUrl }) } : {}),
- };
-}
-
-export async function recordOutreachSent(payload: Pick<OutreachPayload, "outreachId" | "actorUserId">): Promise<void> {
- const now = new Date();
- const row = await prisma.userOutreach.findUnique({ select: { firstSentAt: true }, where: { id: payload.outreachId } });
- if (!row) return;
- await prisma.userOutreach.update({
- data: {
- actorUserId: payload.actorUserId,
- firstSentAt: row.firstSentAt ?? now,
- lastSentAt: now,
- sentCount: { increment: 1 },
- status: "sent",
- },
- where: { id: payload.outreachId },
- });
-}
diff --git a/site/src/lib/onboarding/signup-grants.ts b/site/src/lib/onboarding/signup-grants.ts
index 7ef10b73..25d4e9d7 100644
--- a/site/src/lib/onboarding/signup-grants.ts
+++ b/site/src/lib/onboarding/signup-grants.ts
@@ -4,23 +4,20 @@ import { getGlobalSetting } from "@/lib/config/effective";
import { creditStringToMicros } from "@/lib/credits/amounts";
import { grantCredits } from "@/lib/credits/inference";
import { creditGrantExpiry } from "@/lib/credits/top-up";
-import { type EmailUser } from "@/lib/email/resend";
-import { deliverEmail } from "@/lib/email/outbox";
-import { welcomeIdempotencyKey } from "@/lib/email/send-welcome";
import { isDeletedAddress } from "@/lib/onboarding/deleted-account";
import { claimSignupGrant, signupNetworkKey } from "@/lib/onboarding/signup-network";
+type SignupUser = { email: string; id: string };
+
// Single source of truth for what a new account starts with. All steps are
// idempotent and keyed to the user, so provisioning can run more than once
-// (e.g. a retried signup) without double-granting, double-seeding, or
-// double-sending. The grant amount and its lifetime are the signupCredits
-// setting; the welcome email names the amount that landed. `headers` are the
-// signup request's, which name the network the account came from.
-export async function provisionSignupGrants(user: EmailUser, headers: Headers | undefined): Promise<void> {
+// (e.g. a retried signup) without double-granting or double-seeding. The
+// grant amount and its lifetime are the signupCredits setting. `headers` are
+// the signup request's, which name the network the account came from.
+export async function provisionSignupGrants(user: SignupUser, headers: Headers | undefined): Promise<void> {
const setting = await getGlobalSetting("signupCredits");
// An address that was deleted already had its signup credits once. The
- // starter project, fonts and welcome still land; the credits do not, and
- // the welcome email leaves them out.
+ // starter project and fonts still land; the credits do not.
const returning = await isDeletedAddress(user.email);
if (returning) {
console.info("[signup-grants] address returned after deletion; signup credits withheld", {
@@ -38,7 +35,6 @@ export async function provisionSignupGrants(user: EmailUser, headers: Headers |
: grantSignupAppCredits(user.id, credits, expiresAt),
seedStarterProject(user.id),
seedFontsFolder(user.id),
- deliverEmail({ idempotencyKey: welcomeIdempotencyKey(user.id), kind: "welcome", payload: { credits }, userId: user.id }),
]);
for (const result of results) {
diff --git a/site/src/proxy.ts b/site/src/proxy.ts
index 7b262282..df4be265 100644
--- a/site/src/proxy.ts
+++ b/site/src/proxy.ts
@@ -59,7 +59,7 @@ const PASSTHROUGH = [
"/terms",
"/sign-in",
"/sign-up",
- // Email-footer unsubscribe page.
+ // Email-footer unsubscribe page; the back office's emails link here.
"/unsubscribe",
];
diff --git a/site/vercel.json b/site/vercel.json
index 0ca66e6a..04ccee3b 100644
--- a/site/vercel.json
+++ b/site/vercel.json
@@ -2,11 +2,6 @@
"git": { "deploymentEnabled": false },
"crons": [
{ "path": "/api/chatgpt/gc", "schedule": "15 4 * * *" },
- { "path": "/api/credits/expire", "schedule": "30 0 * * *" },
- { "path": "/api/credits/expiry-notices", "schedule": "0 16 * * *" },
- { "path": "/api/cut-cloud/gc", "schedule": "0 4 * * *" },
- { "path": "/api/analytics/run", "schedule": "0 1 * * *" },
- { "path": "/api/experiments/results", "schedule": "0 3 * * *" },
- { "path": "/api/marketing/outreach/scan", "schedule": "15 1 * * *" }
+ { "path": "/api/cut-cloud/gc", "schedule": "0 4 * * *" }
]
}