44 lines
2.2 KiB
JSON
44 lines
2.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "trainlog-ai-session-draft-v1.schema.json",
|
|
"title": "TRAINLOG_AI_SESSION_DRAFT_V1 source inbox",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["format", "version", "draft"],
|
|
"properties": {
|
|
"format": {"const": "TRAINLOG_AI_SESSION_DRAFT"},
|
|
"version": {"const": 1},
|
|
"draft": {"$ref": "#/$defs/draft"}
|
|
},
|
|
"$defs": {
|
|
"nullableText": {"type": ["string", "null"], "minLength": 1},
|
|
"entry": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["position", "exercise_id", "target_sets", "target_reps", "target_duration_seconds", "target_weight_kg", "rest_seconds"],
|
|
"properties": {
|
|
"position": {"type": "integer", "minimum": 0, "maximum": 63},
|
|
"exercise_id": {"type": "string", "pattern": "^ex_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},
|
|
"target_sets": {"type": "integer", "minimum": 1, "maximum": 99},
|
|
"target_reps": {"type": ["integer", "null"], "minimum": 1, "maximum": 999},
|
|
"target_duration_seconds": {"type": ["integer", "null"], "minimum": 1, "maximum": 86400},
|
|
"target_weight_kg": {"type": ["number", "null"], "exclusiveMinimum": 0, "maximum": 10000},
|
|
"rest_seconds": {"type": "integer", "minimum": 0, "maximum": 86400}
|
|
}
|
|
},
|
|
"draft": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["draft_id", "created_at", "planned_for", "session_type", "title", "notes", "entries"],
|
|
"properties": {
|
|
"draft_id": {"type": "string", "pattern": "^aid_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},
|
|
"created_at": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,6})?Z$"},
|
|
"planned_for": {"type": ["string", "null"], "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
|
|
"session_type": {"const": "training"},
|
|
"title": {"type": ["string", "null"], "minLength": 1, "maxLength": 120},
|
|
"notes": {"type": ["string", "null"], "minLength": 1, "maxLength": 2000},
|
|
"entries": {"type": "array", "minItems": 1, "maxItems": 64, "items": {"$ref": "#/$defs/entry"}}
|
|
}
|
|
}
|
|
}
|
|
}
|