{ "$id": "https://c-git.crosscode.co.za/joshua/crosscode-platform/raw/branch/main/packages/contracts/schemas/hub-heartbeat-request.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 2 }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" }, "health": { "type": "object", "properties": { "uptimeSeconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "db": { "type": "boolean" }, "jobs": { "type": "object", "properties": { "mode": { "type": "string" }, "failedLast24h": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "mode", "failedLast24h" ] }, "lastBackupAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "disk": { "anyOf": [ { "type": "object", "properties": { "freeBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "freeBytes", "totalBytes" ] }, { "type": "null" } ] }, "errorsLast24h": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] }, "pendingMigrations": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "uptimeSeconds", "db", "jobs", "lastBackupAt", "disk", "errorsLast24h", "pendingMigrations" ] }, "product": { "type": "string", "const": "events" }, "stats": { "type": "object", "properties": { "users": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "events": { "type": "object", "properties": { "active": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "upcoming": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "active", "upcoming", "total" ] }, "registrations": { "type": "object", "properties": { "last30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "last30d", "total" ] }, "tickets": { "type": "object", "properties": { "last30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "last30d", "total" ] }, "checkIns": { "type": "object", "properties": { "last30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "last30d" ] }, "messages": { "anyOf": [ { "type": "object", "properties": { "email30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "whatsapp30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "email30d", "whatsapp30d" ] }, { "type": "null" } ] }, "paymentProviders": { "type": "array", "items": { "type": "string" } }, "campuses": { "type": "boolean" }, "campusCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "income": { "type": "object", "properties": { "last30d": { "type": "string", "enum": [ "R0–R1 000", "R1 001–R5 000", "R5 001–R20 000", "R20 001–R50 000", "R50 001–R100 000", "R100 001–R150 000", "R150 001–R250 000", "R250 001–R400 000", "R400 001–R700 000", "R700 001–R1 000 000", "R1 000 001–R2 500 000", "R2 500 001–R5 000 000", "R5 000 001–R10 000 000", "over R10 000 000" ] }, "allTime": { "type": "string", "enum": [ "R0–R1 000", "R1 001–R5 000", "R5 001–R20 000", "R20 001–R50 000", "R50 001–R100 000", "R100 001–R150 000", "R150 001–R250 000", "R250 001–R400 000", "R400 001–R700 000", "R700 001–R1 000 000", "R1 000 001–R2 500 000", "R2 500 001–R5 000 000", "R5 000 001–R10 000 000", "over R10 000 000" ] }, "eventIncome12m": { "type": "string", "enum": [ "R0–R1 000", "R1 001–R5 000", "R5 001–R20 000", "R20 001–R50 000", "R50 001–R100 000", "R100 001–R150 000", "R150 001–R250 000", "R250 001–R400 000", "R400 001–R700 000", "R700 001–R1 000 000", "R1 000 001–R2 500 000", "R2 500 001–R5 000 000", "R5 000 001–R10 000 000", "over R10 000 000" ] } }, "required": [ "last30d", "allTime", "eventIncome12m" ] } }, "required": [ "users", "events", "registrations", "tickets", "checkIns", "messages", "paymentProviders", "campuses", "campusCount", "income" ] } }, "required": [ "protocolVersion", "version", "health", "product", "stats" ] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 2 }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" }, "health": { "type": "object", "properties": { "uptimeSeconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "db": { "type": "boolean" }, "jobs": { "type": "object", "properties": { "mode": { "type": "string" }, "failedLast24h": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "mode", "failedLast24h" ] }, "lastBackupAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "disk": { "anyOf": [ { "type": "object", "properties": { "freeBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "freeBytes", "totalBytes" ] }, { "type": "null" } ] }, "errorsLast24h": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] }, "pendingMigrations": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "uptimeSeconds", "db", "jobs", "lastBackupAt", "disk", "errorsLast24h", "pendingMigrations" ] }, "product": { "type": "string", "const": "website" }, "stats": { "type": "object", "properties": { "pages": { "type": "object", "properties": { "published": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "drafts": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "published", "drafts" ] }, "messages": { "type": "object", "properties": { "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "last30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "total", "last30d" ] }, "events": { "type": "object", "properties": { "upcomingSimple": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "imported": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "upcomingSimple", "imported" ] }, "editors": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "storage": { "type": "object", "properties": { "usedBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "includedBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "usedBytes", "includedBytes" ] } }, "required": [ "pages", "messages", "events", "editors", "storage" ] } }, "required": [ "protocolVersion", "version", "health", "product", "stats" ] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 2 }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" }, "health": { "type": "object", "properties": { "uptimeSeconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "db": { "type": "boolean" }, "jobs": { "type": "object", "properties": { "mode": { "type": "string" }, "failedLast24h": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "mode", "failedLast24h" ] }, "lastBackupAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "disk": { "anyOf": [ { "type": "object", "properties": { "freeBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "freeBytes", "totalBytes" ] }, { "type": "null" } ] }, "errorsLast24h": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] }, "pendingMigrations": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "uptimeSeconds", "db", "jobs", "lastBackupAt", "disk", "errorsLast24h", "pendingMigrations" ] }, "product": { "type": "string", "const": "app" }, "stats": { "type": "object", "properties": { "activeMembers90d": { "type": "string", "enum": [ "0–100", "101–300", "301–750", "751–2 000", "2 001–5 000", "over 5 000" ] }, "modules": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" } }, "prayer": { "type": "object", "properties": { "coverageLast7dPercent": { "type": "number", "minimum": 0, "maximum": 100 }, "activeCommitments": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "coverageLast7dPercent", "activeCommitments" ] }, "announcements": { "type": "object", "properties": { "last30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "last30d" ] }, "messages": { "type": "object", "properties": { "email30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "whatsapp30d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "email30d", "whatsapp30d" ] } }, "required": [ "activeMembers90d", "modules", "prayer", "announcements", "messages" ] } }, "required": [ "protocolVersion", "version", "health", "product", "stats" ] }, { "type": "object", "properties": { "protocolVersion": { "type": "number", "const": 2 }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" }, "health": { "type": "object", "properties": { "uptimeSeconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "db": { "type": "boolean" }, "jobs": { "type": "object", "properties": { "mode": { "type": "string" }, "failedLast24h": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "mode", "failedLast24h" ] }, "lastBackupAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "disk": { "anyOf": [ { "type": "object", "properties": { "freeBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "freeBytes", "totalBytes" ] }, { "type": "null" } ] }, "errorsLast24h": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] }, "pendingMigrations": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "uptimeSeconds", "db", "jobs", "lastBackupAt", "disk", "errorsLast24h", "pendingMigrations" ] }, "product": { "type": "string", "const": "accounts" }, "stats": { "type": "object", "properties": { "accounts": { "type": "object", "properties": { "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "active90d": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "total", "active90d" ] }, "twoFactor": { "type": "object", "properties": { "email": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "whatsapp": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "totp": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "off": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "email", "whatsapp", "totp", "off" ] }, "linkedProducts": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "accounts", "twoFactor", "linkedProducts" ] } }, "required": [ "protocolVersion", "version", "health", "product", "stats" ] } ] }