WIP 2.0.0: v1 removed; Argon2id passwords; node-fetch gone

- /api (v1) answers 410 API_V1_REMOVED, except provider webhooks
  (/api/webhooks/*, /api/whatsapp/webhook) and links in sent messages
  (308s, one-click POST). 43 v1 route files and deprecation.ts removed;
  /docs redirects to /docs/v2; API_DOCUMENTATION.md points there.
- Read-only and impersonation lists name v2 paths only. The campus
  scope route test now runs over v2 routes (v2CampusScope.test.ts).
- Passwords hashed with Argon2id (@node-rs/argon2); bcrypt hashes still
  sign in and are re-hashed at the next sign-in.
- e2e on /api/v2 only (v2() helper); Playwright waits on /api/v2.
- MIGRATING-TO-2.md with the full v1 -> v2 table.
- Two documented response shapes corrected.

Backend 690 tests and e2e 102/102 (PayFast sandbox skipped) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 16:35:06 +02:00
co-authored by Claude Opus 5.5
parent 57b3c41067
commit 3f59164ab2
97 changed files with 1099 additions and 4398 deletions
@@ -3,7 +3,7 @@
"info": {
"title": "Cross Events API",
"version": "v2",
"description": "Version 2 of the Cross Events API. Every response is JSON:\n- a single item is `{ \"data\": { … } }`;\n- a list is `{ \"data\": [ … ], \"meta\": { \"page\", \"limit\", \"total\", \"pages\" } }`, paged with `?page=` and `?limit=` (at most 100);\n- an error is `{ \"error\": { \"code\", \"message\", \"fields\"? } }` with a stable `code`.\n\nDates are ISO 8601 in UTC; amounts are in rand. Sign in through the app and send the token as `Authorization: Bearer <token>`.\nVersion 1 (`/api/…`) keeps working while the app moves over; it will be removed in 2.0."
"description": "Version 2 of the Cross Events API. Every response is JSON:\n- a single item is `{ \"data\": { … } }`;\n- a list is `{ \"data\": [ … ], \"meta\": { \"page\", \"limit\", \"total\", \"pages\" } }`, paged with `?page=` and `?limit=` (at most 100);\n- an error is `{ \"error\": { \"code\", \"message\", \"fields\"? } }` with a stable `code`.\n\nDates are ISO 8601 in UTC; amounts are in rand. Sign in through the app and send the token as `Authorization: Bearer <token>`.\nVersion 1 (`/api/…`) was removed in 2.0: its addresses answer `410 Gone`. See the migration guide (MIGRATING-TO-2.md)."
},
"servers": [
{
@@ -21285,20 +21285,30 @@
]
},
"cashDenominations": {
"anyOf": [
{
"type": "object",
"properties": {},
"additionalProperties": {}
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "number",
"description": "The note or coin, in rand"
},
"count": {
"type": "number"
}
},
{
"type": "null"
}
]
"required": [
"value",
"count"
],
"additionalProperties": {}
},
"description": "Counted cash by note and coin"
}
},
"required": [
"rows"
"rows",
"cashDenominations"
],
"additionalProperties": {}
}
@@ -59217,10 +59227,14 @@
}
},
"actions": {
"type": "array",
"items": {
"type": "object",
"propertyNames": {
"type": "string"
}
},
"additionalProperties": {
"type": "string"
},
"description": "Every action, with its label"
},
"actors": {
"type": "array",