init: add contract definitions and database schema with migrations skeleton
This commit is contained in:
17
contract/api/common.schema.json
Normal file
17
contract/api/common.schema.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$id": "contract/api/common.schema.json",
|
||||
"type": "object", "required": ["ok"],
|
||||
"properties": {
|
||||
"ok": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"data": {},
|
||||
"error": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": { "type": "string" },
|
||||
"message": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
contract/api/device.schema.json
Normal file
0
contract/api/device.schema.json
Normal file
0
contract/api/stats.schema.json
Normal file
0
contract/api/stats.schema.json
Normal file
18
contract/api/timeseries.schema.json
Normal file
18
contract/api/timeseries.schema.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["points"],
|
||||
"properties": {
|
||||
"points": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["ts", "value"],
|
||||
"properties": {
|
||||
"ts": { "type": "integer" },
|
||||
"value": {}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user