aboutsummaryrefslogtreecommitdiff
path: root/schemas_json
diff options
context:
space:
mode:
Diffstat (limited to 'schemas_json')
-rw-r--r--schemas_json/message.yaml114
1 files changed, 114 insertions, 0 deletions
diff --git a/schemas_json/message.yaml b/schemas_json/message.yaml
new file mode 100644
index 0000000..0c79507
--- /dev/null
+++ b/schemas_json/message.yaml
@@ -0,0 +1,114 @@
+---
+"$schema": "http://json-schema.org/schema#"
+id: "hatter://message.yaml#"
+title: Message
+description: Backend-frontend communication messages
+oneOf:
+ - "$ref": "hatter://message.yaml#/definitions/client_message"
+ - "$ref": "hatter://message.yaml#/definitions/server_message"
+definitions:
+ client_message:
+ title: Client message
+ description: Message sent by frontend
+ oneOf:
+ - title: Set log
+ type: object
+ required:
+ - type
+ - offset
+ - limit
+ properties:
+ type:
+ enum:
+ - set_log
+ offset:
+ type: integer
+ limit:
+ type: integer
+ - title: Add job
+ type: object
+ required:
+ - type
+ - repository
+ - commit
+ properties:
+ type:
+ enum:
+ - add_job
+ repository:
+ type: string
+ commit:
+ type: string
+ server_message:
+ title: Server message
+ description: Message sent by backend
+ oneOf:
+ - title: Active job
+ type: object
+ required:
+ - type
+ - job
+ properties:
+ type:
+ enum:
+ - active_job
+ job:
+ "$ref": "hatter://message.yaml#/definitions/job"
+ - title: Job queue
+ type: object
+ required:
+ - type
+ - jobs
+ properties:
+ type:
+ enum:
+ - job_queue
+ jobs:
+ type: array
+ items:
+ "$ref": "hatter://message.yaml#/definitions/job"
+ - title: Log entries
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ enum:
+ - log_entries
+ entries:
+ type: array
+ items:
+ "$ref": "hatter://message.yaml#/definitions/log_entry"
+ job:
+ type: object
+ required:
+ - id
+ - timestamp
+ - repository
+ - commit
+ properties:
+ id:
+ type: integer
+ timestamp:
+ type: integer
+ repository:
+ type: string
+ commit:
+ type: string
+ log_entry:
+ type: object
+ required:
+ - timestamp
+ - repository
+ - commit
+ - message
+ properties:
+ timestamp:
+ type: integer
+ repository:
+ type: string
+ commit:
+ type: string
+ message:
+ type: string
+...