You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[ ]**Pages** (user prefs + CRUD) and **groups** CRUD / privacy / passwords per map.
51
55
-[ ]**Realtime / collab** (new or adapted protocols; no key rotation).
52
-
-[ ]**Stripe:**`POST /api/webhooks/stripe`, checkout/portal (no RevenueCat).
56
+
-[ ]**Stripe:**`POST /api/webhooks/stripe`, checkout/portal (no RevenueCat); wire **`deleteStripeCustomer`** from account delete when keys exist.
53
57
54
58
---
55
59
56
60
## Phase 4 checklist (client MVP)
57
61
58
-
-[]**Tooling:** Vitest + `jsdom` or `happy-dom` + `@vue/test-utils`; `@vitejs/plugin-vue` in Vitest config (same as [Frontend / UI track](#frontend--ui-track)).
62
+
-[x]**Tooling (bootstrap):** Vitest + **happy-dom** + `@vue/test-utils` in `@deepnotes/web` (minimal `App` test); same Vite 6 pipeline via `vitest/config``defineConfig` (RESTART_PLAN §5.8).
59
63
-[ ]**API client:** consume **OpenAPI** (generated types + `fetch`, or hey-api) from `@deepnotes/api` / published spec—**no** workspace dependency on Worker or DB packages from web source.
60
64
-[ ]**Routing + auth UI:** login / refresh / logout / 2FA flows aligned with [docs/AUTH_AND_CORS.md](./docs/AUTH_AND_CORS.md); composable or component tests + **E2E smoke** for cookie session.
61
65
-[ ]**Pages:** list → open editor shell → integrate **Yjs** / collab when API is ready.
@@ -72,7 +76,7 @@ Living checklist for the greenfield work described in [docs/RESTART_PLAN.md](../
72
76
-[x] Document **Pages** / preview vs production env vars; optional deploy job to CF preview → [docs/DEPLOY_CLOUDFLARE.md](./docs/DEPLOY_CLOUDFLARE.md).
73
77
-[x] CI: lint, typecheck, tests, `drizzle-kit check`, build (Postgres service present for future migrate/tests).
74
78
-[x] CI: Postgres role with **CREATEDB** + **template DB** integration tests (RESTART_PLAN §5.7) — `DATABASE_ADMIN_URL` + `src/template-db.test.ts`.
75
-
-[]**Web package tests are real:**`apps/web`currently uses a **no-op**`test` script; replace with **Vitest** + `jsdom` or `happy-dom` + `@vue/test-utils` and wire into root `pnpm test` / CI (RESTART_PLAN §5.8).
@@ -88,7 +92,7 @@ Cross-cutting work so the new SPA does not repeat **legacy `apps/client`** patte
88
92
89
93
### Testing (see RESTART_PLAN §5.8)
90
94
91
-
-[]**Vitest** in `apps/web` with DOM environment and `@vitejs/plugin-vue` aligned with Vite 6.
95
+
-[x]**Vitest** in `apps/web` with DOM environment (`happy-dom`) and `@vue/test-utils` aligned with Vite 6.
92
96
-[ ]**Component or composable tests** for the first **auth** / session flows (forms, validation, error mapping from API).
93
97
-[ ]**Contract tests** for the fetch wrapper (MSW or recorded OpenAPI fixtures)—optional until multiple features consume the API.
94
98
-[ ]**E2E smoke** (Playwright recommended): login or session refresh with **httpOnly cookies** against **local compose** or **Cloudflare preview**—add CI job when stable enough (can start `manual`/`workflow_dispatch` if cost is a concern).
@@ -97,9 +101,9 @@ Cross-cutting work so the new SPA does not repeat **legacy `apps/client`** patte
97
101
98
102
| Legacy (`apps/client`) | New (`new-deepnotes/apps/web`) |
| Quasar + Vite 2, 4GB heap builds | Vite 6 + Vue 3.5, minimal app shell today|
104
+
| Quasar + Vite 2, 4GB heap builds | Vite 6 + Vue 3.5, Vitest + happy-dom in CI|
101
105
| Imports `AppRouter`, server websocket paths | Must use **OpenAPI** + documented WS only |
102
-
| No automated UI tests |**To do:** real `test` script + CI|
106
+
| No automated UI tests |**Done:** real `test` script + one component test|
103
107
104
108
---
105
109
@@ -114,14 +118,16 @@ Cross-cutting work so the new SPA does not repeat **legacy `apps/client`** patte
114
118
-[x] No tRPC / superjson / RevenueCat / key-rotation in **this** tree (keep absent); product sign-off for IAP/Stripe when billing ships.
115
119
-[x] Client: zero undocumented forks, or a short owned exception list — see [docs/CLIENT_FORKS.md](./docs/CLIENT_FORKS.md).
116
120
-[ ] Cloudflare: deploy runbook; Hyperdrive + Postgres + Redis proven in staging; collab/realtime topology chosen and load-tested.
117
-
-[ ] Web: Vitest + DOM env in CI; no server/db imports from web source; E2E smoke for session cookies (RESTART_PLAN §8 extended items).
121
+
-[x] Web: Vitest + DOM env in CI (happy-dom + `@vue/test-utils` on `App.vue`).
122
+
-[ ] Web: enforce **no** server/db imports from web source (ESLint `import/no-restricted-paths` or README when features land); **E2E** smoke for session cookies (RESTART_PLAN §8).
| 2026-04-26 | Phase 3: email verification `POST /api/users/email-verification/resend` and `…/confirm`; `performResendEmailVerification` / `performConfirmEmailVerification`; Resend in `sendRegistrationEmail`; `RESEND_API_KEY` + `PUBLIC_APP_URL`; first mail on register + re-send on duplicate unverified; OpenAPI 502 on register if provider fails; `c.env?.HYPERDRIVE` on confirm for Vitest. |
126
132
| 2026-04-26 | Phase 3: **`POST /api/users`** (`performUserRegister`), `encryptUserRehashedLoginHash`, `addHours`, OpenAPI 201/400/401/409; optional **`SEND_EMAILS`** on session env (auto-verify when `false`); group password on register still rejected (same as demo). |
|`users.account.delete`|`DELETE /api/users/me`(JSON body `{ "loginHash" }` base64; clears cookies on 204; optional `deleteStripeCustomer` in worker when billing is wired) |
Copy file name to clipboardExpand all lines: new-deepnotes/packages/api/src/openapi.ts
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ import {
19
19
import{
20
20
emailVerificationConfirmRequestSchema,
21
21
emailVerificationResendRequestSchema,
22
+
userAccountDeleteRequestSchema,
22
23
userMeResponseSchema,
23
24
userRegisterResponseSchema,
24
25
}from"./schemas/users.js";
@@ -184,6 +185,40 @@ registry.registerPath({
184
185
},
185
186
});
186
187
188
+
registry.registerPath({
189
+
method: "delete",
190
+
path: "/api/users/me",
191
+
summary: "Delete current account (password confirmation)",
192
+
description:
193
+
"Replaces legacy `users.account.delete`. Requires `accessToken` cookie and correct `loginHash` in the JSON body. Clears session cookies on success. Optional Stripe customer deletion is handled by the deployment (not part of OpenAPI).",
194
+
request: {
195
+
body: {
196
+
content: {
197
+
"application/json": {
198
+
schema: userAccountDeleteRequestSchema,
199
+
},
200
+
},
201
+
},
202
+
},
203
+
responses: {
204
+
204: {
205
+
description:
206
+
"Account removed; session cookies cleared (same names as login).",
207
+
},
208
+
400: {
209
+
description: "Wrong password, ownership constraint, or validation error.",
0 commit comments