Events 3.2.0, contracts 1.10.0: the heartbeat says what's on now

stats.live (eventsNow: a session or a one-day event on now, +/- 30 min;
checkInsLastHour) so Hub 2.7.0 asks again before an emergency update takes
a site with an event on down. Decision 39: emergency updates can run as
soon as possible (decision 30 changed). Tests: liveNow, Events 776.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 22:03:32 +02:00
co-authored by Claude Opus 5.5
parent 88b3e1fb36
commit 621821f5c0
15 changed files with 160 additions and 20 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@crosscode/contracts",
"version": "1.9.0",
"version": "1.10.0",
"description": "The shared JSON formats used by every Cross Code product: zod schemas, JSON Schema, TypeScript types and sample payloads",
"license": "UNLICENSED",
"type": "commonjs",
@@ -5,22 +5,51 @@
"health": {
"uptimeSeconds": 86400,
"db": true,
"jobs": { "mode": "queue", "failedLast24h": 0 },
"jobs": {
"mode": "queue",
"failedLast24h": 0
},
"lastBackupAt": "2026-11-03T00:00:12.000Z",
"disk": { "freeBytes": 21474836480, "totalBytes": 53687091200 },
"disk": {
"freeBytes": 21474836480,
"totalBytes": 53687091200
},
"errorsLast24h": 0,
"pendingMigrations": 0
},
"stats": {
"users": 412,
"events": { "active": 3, "upcoming": 5, "total": 61 },
"registrations": { "last30d": 88, "total": 2310 },
"tickets": { "last30d": 140, "total": 3901 },
"checkIns": { "last30d": 96 },
"events": {
"active": 3,
"upcoming": 5,
"total": 61
},
"registrations": {
"last30d": 88,
"total": 2310
},
"tickets": {
"last30d": 140,
"total": 3901
},
"checkIns": {
"last30d": 96
},
"messages": null,
"paymentProviders": ["yoco", "payfast"],
"paymentProviders": [
"yoco",
"payfast"
],
"campuses": true,
"campusCount": 2,
"income": { "last30d": "R5 001–R20 000", "allTime": "R150 001–R250 000", "eventIncome12m": "R100 001–R150 000" }
"income": {
"last30d": "R5 001–R20 000",
"allTime": "R150 001–R250 000",
"eventIncome12m": "R100 001–R150 000"
},
"live": {
"eventsNow": 1,
"checkInsLastHour": 42
}
}
}
@@ -305,6 +305,25 @@
"allTime",
"eventIncome12m"
]
},
"live": {
"type": "object",
"properties": {
"eventsNow": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"checkInsLastHour": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"eventsNow",
"checkInsLastHour"
]
}
},
"required": [
+6
View File
@@ -190,6 +190,12 @@ export const eventsStatsSchema = z.object({
/** What the Events licence tier is billed on. */
eventIncome12m: incomeBandSchema,
}),
/**
* 1.10.0: what's happening now, so the Hub can warn before taking the site down (an emergency
* update "as soon as possible"): events with a session or a one-day event on now (give or take
* 30 minutes), and tickets checked in during the last hour. Optional: older installs don't send it.
*/
live: z.object({ eventsNow: count, checkInsLastHour: count }).optional(),
});
/** Church Website. `storage` is what the extra-storage add-on is billed on (ROADMAP-v3 §10). */