Files
sync-protocol/schema/sync-request.schema.json
T
2026-08-15 14:50:38 +03:30

29 lines
1.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sadtech.ir/schemas/sync-request.schema.json",
"title": "SyncRequest",
"description": "A sync request is a request sent by a device to the server to synchronize its local database with the server's database.",
"type": "object",
"properties": {
"device_id": {
"description": "The unique identifier of the device that is sending the sync request.",
"type": "string"
},
"cursor": {
"description": "The cursor is a string that represents the last known state of the database on the device. It is used to determine which operations need to be sent to the device.",
"type": "integer"
},
"operations": {
"description": "The operations are the changes that have been made to the database on the device since the last sync. They are sent to the server to be applied to the server's database.",
"type": "array",
"items": {
"$ref": "operation.schema.json"
}
}
},
"required": [
"device_id",
"cursor",
"operations"
]
}