From 69c9c200e69bff63ec311f6dcb566c5b9585f6d6 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 23 Aug 2024 11:23:02 +0930 Subject: [PATCH] Add file and data schemas --- data/base64/v0.1.0/schema.json | 36 ++++++++++++++++ file/v0.1.0/schema.json | 79 ++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 data/base64/v0.1.0/schema.json create mode 100644 file/v0.1.0/schema.json diff --git a/data/base64/v0.1.0/schema.json b/data/base64/v0.1.0/schema.json new file mode 100644 index 0000000..c13df53 --- /dev/null +++ b/data/base64/v0.1.0/schema.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://common.schemas.verida.io/data/base64/v0.1.0/schema.json", + "title": "Data", + "titlePlural": "Data", + "description": "Base64 encoded data", + "type": "object", + "appearance": { + "style": { + "color": "#FD4F64", + "icon": "./icon.svg" + } + }, + "database": { + "name": "data_base64", + "indexes": {} + }, + "layouts": { + "create": [ + "_id", + "data" + ], + "view": [ + "_id", + "data" + ] + }, + "properties": { + "data": { + "title": "Data", + "type": "string", + "description": "Base64 encoded data" + } + }, + "required": ["data"] + } \ No newline at end of file diff --git a/file/v0.1.0/schema.json b/file/v0.1.0/schema.json new file mode 100644 index 0000000..af2959e --- /dev/null +++ b/file/v0.1.0/schema.json @@ -0,0 +1,79 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://common.schemas.verida.io/file/v0.1.0/schema.json", + "title": "File", + "titlePlural": "Files", + "description": "A file", + "type": "object", + "appearance": { + "style": { + "color": "#FD4F64", + "icon": "./icon.svg" + } + }, + "database": { + "name": "file", + "indexes": { + "name": ["name", "type", "insertedAt"], + "insertedAt": ["insertedAt"], + "source": ["sourceApplication", "sourceId"] + } + }, + "layouts": { + "create": [ + "name", + "extension", + "mimeType", + "size", + "summary", + "uri" + ], + "view": [ + "name", + "extension", + "mimeType", + "size", + "fileDataId", + "uri", + "insertedAt" + ] + }, + "allOf": [ + {"$ref": "https://core.schemas.verida.io/base/v0.1.0/schema.json"}, + { + "properties": { + "extension": { + "title": "Extension", + "type": "string", + "description": "File extension of the document (ie: png)" + }, + "mimeType": { + "title": "MIME Type", + "type": "string", + "description": "MIME type of the file" + }, + "size": { + "title": "Size", + "type": "integer", + "description": "Size of the document in bytes" + }, + "contentText": { + "title": "Content (Text)", + "type": "string", + "description": "Text content of the file (if relevant)" + }, + "fileDataId": { + "title": "File Data ID", + "type": "string", + "description": "Reference to the base64 encoded content of the file (optional)" + }, + "uri": { + "title": "URI", + "type": "string", + "description": "External link to the document (optional)" + } + }, + "required": ["name", "extension", "mimeType", "size"] + } + ] + } \ No newline at end of file