Skip to content
This repository was archived by the owner on Feb 8, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion broid-schemas/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ prepare:

%.json: %.yaml prepare
@echo Building $@
(echo "id: '$(BASE_URL)$(subst src/schemas/,,$@)'"; cat $<) | js-yaml | json-minify > lib/$(subst src/,,$@)
(echo "id: '$(BASE_URL)$(subst src/schemas/,,$@)'"; cat $<) | js-yaml | json-minify | js-beautify -s 2 -b end-expand > lib/$(subst src/,,$@)
60 changes: 59 additions & 1 deletion broid-schemas/lib/schemas/activity.json
Original file line number Diff line number Diff line change
@@ -1 +1,59 @@
{"id":"http://schemas.broid.ai/activity.json","type":"object","properties":{"@context":{"type":"string","enum":["https://www.w3.org/ns/activitystreams"]},"type":{"type":"string","enum":["Create","Update","Delete"]},"published":{"type":"number","pattern":"(\\d+(?:\\.\\d*)?|\\.\\d+)\\s+(\\S+)"},"generator":{"$ref":"http://schemas.broid.ai/embedded/generator.json"},"actor":{"$ref":"http://schemas.broid.ai/embedded/actor.json","required":["id","type"]},"target":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/actor.json","required":["id","type"]},{"$ref":"http://schemas.broid.ai/embedded/group.json","required":["id","type"]}]},"cc":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/actor.json","required":["id","type"]},{"$ref":"http://schemas.broid.ai/embedded/group.json","required":["id","type"]}]},"object":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/note.json","required":["type","id","content"]},{"$ref":"http://schemas.broid.ai/object/media.json","required":["type","id","url"]},{"$ref":"http://schemas.broid.ai/object/place.json","required":["type","id","latitude","longitude"]}]}},"required":["type","published","generator","actor","target","object"]}
{
"id": "http://schemas.broid.ai/activity.json",
"type": "object",
"properties": {
"@context": {
"type": "string",
"enum": ["https://www.w3.org/ns/activitystreams"]
},
"type": {
"type": "string",
"enum": ["Create", "Update", "Delete"]
},
"published": {
"type": "number",
"pattern": "(\\d+(?:\\.\\d*)?|\\.\\d+)\\s+(\\S+)"
},
"generator": {
"$ref": "http://schemas.broid.ai/embedded/generator.json"
},
"actor": {
"$ref": "http://schemas.broid.ai/embedded/actor.json",
"required": ["id", "type"]
},
"target": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/embedded/actor.json",
"required": ["id", "type"]
}, {
"$ref": "http://schemas.broid.ai/embedded/group.json",
"required": ["id", "type"]
}]
},
"cc": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/embedded/actor.json",
"required": ["id", "type"]
}, {
"$ref": "http://schemas.broid.ai/embedded/group.json",
"required": ["id", "type"]
}]
},
"object": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/object/note.json",
"required": ["type", "id", "content"]
}, {
"$ref": "http://schemas.broid.ai/object/media.json",
"required": ["type", "id", "url"]
}, {
"$ref": "http://schemas.broid.ai/object/place.json",
"required": ["type", "id", "latitude", "longitude"]
}, {
"$ref": "http://schemas.broid.ai/object/collection.json",
"required": ["type", "items"]
}]
}
},
"required": ["type", "published", "generator", "actor", "target", "object"]
}
18 changes: 17 additions & 1 deletion broid-schemas/lib/schemas/embedded/actor.json
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
{"id":"http://schemas.broid.ai/embedded/actor.json","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["Person","Bot","Application"]},"name":{"type":"string"}},"required":["type"]}
{
"id": "http://schemas.broid.ai/embedded/actor.json",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["Person", "Bot", "Application"]
},
"name": {
"type": "string"
}
},
"required": ["type"]
}
18 changes: 17 additions & 1 deletion broid-schemas/lib/schemas/embedded/generator.json
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
{"id":"http://schemas.broid.ai/embedded/generator.json","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["Service"]},"name":{"type":"string"}},"required":["id","type","name"]}
{
"id": "http://schemas.broid.ai/embedded/generator.json",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["Service"]
},
"name": {
"type": "string"
}
},
"required": ["id", "type", "name"]
}
18 changes: 17 additions & 1 deletion broid-schemas/lib/schemas/embedded/group.json
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
{"id":"http://schemas.broid.ai/embedded/group.json","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["Group"]},"name":{"type":"string"}},"required":["type"]}
{
"id": "http://schemas.broid.ai/embedded/group.json",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["Group"]
},
"name": {
"type": "string"
}
},
"required": ["type"]
}
18 changes: 17 additions & 1 deletion broid-schemas/lib/schemas/embedded/tag.json
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
{"id":"http://schemas.broid.ai/embedded/tag.json","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","type","name"]}
{
"id": "http://schemas.broid.ai/embedded/tag.json",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["Object"]
}
},
"required": ["id", "type", "name"]
}
1 change: 1 addition & 0 deletions broid-schemas/lib/schemas/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"embedded/group",
"embedded/tag",
"object/collection",
"object/context",
"object/media",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object need also to be in the list ;)

"object/note",
"object/object",
Expand Down
27 changes: 26 additions & 1 deletion broid-schemas/lib/schemas/object/collection.json
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
{"id":"http://schemas.broid.ai/object/collection.json","type":"object","properties":{"type":{"type":"string","enum":["Collection"]},"name":{"type":"string"},"content":{"type":"string"},"totalItems":{"type":"number"},"items":{"type":"array","items":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/note.json","required":["type","content"]},{"$ref":"http://schemas.broid.ai/object/media.json","required":["type","url"]},{"$ref":"http://schemas.broid.ai/object/place.json","required":["type","latitude","longitude"]}]}}},"required":["type","items"]}
{
"id": "http://schemas.broid.ai/object/collection.json",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["Collection"]
},
"name": {
"type": "string"
},
"content": {
"type": "string"
},
"totalItems": {
"type": "number"
},
"items": {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/object/media.json"
}
}
},
"required": ["type", "items"]
}
20 changes: 20 additions & 0 deletions broid-schemas/lib/schemas/object/context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"id": "http://schemas.broid.ai/object/context.json",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["Object"]
},
"name": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": ["type", "content"]
}
52 changes: 51 additions & 1 deletion broid-schemas/lib/schemas/object/media.json
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
{"id":"http://schemas.broid.ai/object/media.json","type":"object","properties":{"type":{"type":"string","enum":["Audio","Image","Video"]},"id":{"type":"string"},"name":{"type":"string"},"content":{"type":"string"},"url":{"type":"string","format":"uri"},"preview":{"type":"string","format":"uri"},"mediaType":{"type":"string"},"context":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/object.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/object/object.json"}}]},"tag":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/tag.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/embedded/tag.json"}}]}},"required":["type","url"]}
{
"id": "http://schemas.broid.ai/object/media.json",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["Audio", "Image", "Video", "Document"]
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"content": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"preview": {
"type": "string",
"format": "uri"
},
"mediaType": {
"type": "string"
},
"context": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/object/context.json"
}, {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/object/context.json"
}
}]
},
"tag": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/embedded/tag.json"
}, {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/embedded/tag.json"
}
}]
}
},
"required": ["type", "url"]
}
41 changes: 40 additions & 1 deletion broid-schemas/lib/schemas/object/note.json
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
{"id":"http://schemas.broid.ai/object/note.json","type":"object","properties":{"type":{"type":"string","enum":["Note"]},"id":{"type":"string"},"name":{"type":"string"},"content":{"type":"string"},"context":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/object.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/object/object.json"}}]},"tag":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/tag.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/embedded/tag.json"}}]}},"required":["type","content"]}
{
"id": "http://schemas.broid.ai/object/note.json",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["Note"]
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"content": {
"type": "string"
},
"context": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/object/context.json"
}, {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/object/context.json"
}
}]
},
"tag": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/embedded/tag.json"
}, {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/embedded/tag.json"
}
}]
}
},
"required": ["type", "content"]
}
15 changes: 14 additions & 1 deletion broid-schemas/lib/schemas/object/object.json
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{"id":"http://schemas.broid.ai/object/object.json","type":"object","properties":{"type":{"type":"string","enum":["Object"]},"name":{"type":"string"},"content":{"type":"string"}},"required":["type","content"]}
{
"id": "http://schemas.broid.ai/object/object.json",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["Note", "Image", "Video", "Audio", "Place", "Document"]
}
},
"required": ["id", "type"]
}
47 changes: 46 additions & 1 deletion broid-schemas/lib/schemas/object/place.json
Original file line number Diff line number Diff line change
@@ -1 +1,46 @@
{"id":"http://schemas.broid.ai/object/place.json","type":"object","properties":{"type":{"type":"string","enum":["Place"]},"id":{"type":"string"},"name":{"type":"string"},"content":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"context":{"oneOf":[{"$ref":"http://schemas.broid.ai/object/object.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/object/object.json"}}]},"tag":{"oneOf":[{"$ref":"http://schemas.broid.ai/embedded/tag.json"},{"type":"array","items":{"$ref":"http://schemas.broid.ai/embedded/tag.json"}}]}},"required":["type","latitude","longitude"]}
{
"id": "http://schemas.broid.ai/object/place.json",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["Place"]
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"content": {
"type": "string"
},
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
},
"context": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/object/context.json"
}, {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/object/context.json"
}
}]
},
"tag": {
"oneOf": [{
"$ref": "http://schemas.broid.ai/embedded/tag.json"
}, {
"type": "array",
"items": {
"$ref": "http://schemas.broid.ai/embedded/tag.json"
}
}]
}
},
"required": ["type", "latitude", "longitude"]
}
Loading