Skip to content

Commit 7ab63a3

Browse files
committed
added bucket and export schemas
1 parent 521772d commit 7ab63a3

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

aw_core/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# ignore: F401
2+
13
import logging
24

35
logger = logging.getLogger(__name__)
@@ -15,4 +17,6 @@
1517
from . import log
1618

1719
from . import models
20+
from .models import Event
21+
1822
from . import schema

aw_core/schemas/bucket.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"$id": "https://activitywatch.net/schemas/bucket.v0.json",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"title": "Bucket",
5+
"description": "The Bucket model that is used in ActivityWatch",
6+
"type": "object",
7+
"required": ["id", "type", "client", "hostname"],
8+
"properties": {
9+
"id": {
10+
"description": "The unique id for the bucket",
11+
"type": "string"
12+
},
13+
"name": {
14+
"description": "The readable and renameable name for the bucket",
15+
"type": "string"
16+
},
17+
"type": {
18+
"description": "The event type",
19+
"type": "string"
20+
},
21+
"client": {
22+
"description": "The name of the client that is reporting to the bucket",
23+
"type": "string"
24+
},
25+
"hostname": {
26+
"description": "The hostname of the machine on which the client is running",
27+
"type": "string"
28+
},
29+
"created": {
30+
"description": "The creation datetime of the bucket",
31+
"type": "string",
32+
"format": "date-time"
33+
},
34+
"data": {
35+
"description": "",
36+
"type": "object"
37+
},
38+
"events": {
39+
"type": "array",
40+
"items": {
41+
"$ref": "#/definitions/Event"
42+
}
43+
}
44+
}
45+
}

aw_core/schemas/export.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$id": "https://activitywatch.net/schemas/export.v0.json",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"title": "Export",
5+
"description": "The Export model that is used by ActivityWatch",
6+
"type": "object",
7+
"required": [],
8+
"properties": {
9+
"buckets": {
10+
"type": "array",
11+
"items": {
12+
"$ref": "#/definitions/Bucket"
13+
}
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)