Product -> Accounts requests at /api/accounts/v1/requests, signed with the link secret: import.begin/batch/finish/abort for moving a product's users in (EVENTS-3.0-PLAN §4), people.* for product admins (§8). sealLinkValue / openLinkValue seal password hashes and TOTP secrets with a key derived from the link secret; importIdsHash for the final check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
239 lines
6.2 KiB
JSON
239 lines
6.2 KiB
JSON
{
|
|
"$id": "https://c-git.crosscode.co.za/joshua/crosscode-platform/raw/branch/main/packages/contracts/schemas/import-person.json",
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 200
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"maxLength": 254,
|
|
"format": "email",
|
|
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
},
|
|
"emailVerified": {
|
|
"type": "boolean"
|
|
},
|
|
"phone": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^\\+[1-9]\\d{6,14}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"passwordHash": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"maxLength": 4096,
|
|
"pattern": "^sealed1\\.[A-Za-z0-9_-]{40,}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"twoFactor": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"enum": [
|
|
"email",
|
|
"whatsapp",
|
|
"totp"
|
|
]
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"totpSecret": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"maxLength": 4096,
|
|
"pattern": "^sealed1\\.[A-Za-z0-9_-]{40,}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"totpLastStep": {
|
|
"anyOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"failedSignIns": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 1000
|
|
},
|
|
"lockedUntil": {
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
"news": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "boolean"
|
|
},
|
|
"whatsapp": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"email",
|
|
"whatsapp"
|
|
]
|
|
},
|
|
"newsAskedAt": {
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
"noticeVersionAccepted": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"noticeAcceptances": {
|
|
"maxItems": 100,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"version": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"acceptedAt": {
|
|
"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))$"
|
|
}
|
|
},
|
|
"required": [
|
|
"version",
|
|
"acceptedAt"
|
|
]
|
|
}
|
|
},
|
|
"consentChanges": {
|
|
"maxItems": 500,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel": {
|
|
"type": "string",
|
|
"enum": [
|
|
"email",
|
|
"whatsapp"
|
|
]
|
|
},
|
|
"granted": {
|
|
"type": "boolean"
|
|
},
|
|
"at": {
|
|
"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))$"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel",
|
|
"granted",
|
|
"at"
|
|
]
|
|
}
|
|
},
|
|
"lastSignInAt": {
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"enum": [
|
|
"active",
|
|
"deactivated"
|
|
]
|
|
},
|
|
"admin": {
|
|
"type": "boolean"
|
|
},
|
|
"createdAt": {
|
|
"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))$"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"email",
|
|
"emailVerified",
|
|
"phone",
|
|
"passwordHash",
|
|
"twoFactor",
|
|
"totpSecret",
|
|
"totpLastStep",
|
|
"failedSignIns",
|
|
"lockedUntil",
|
|
"news",
|
|
"newsAskedAt",
|
|
"noticeVersionAccepted",
|
|
"noticeAcceptances",
|
|
"consentChanges",
|
|
"lastSignInAt",
|
|
"status",
|
|
"admin",
|
|
"createdAt"
|
|
]
|
|
}
|