From 5e8205d5f1aed45fca59af0774407c6e50a5187b Mon Sep 17 00:00:00 2001 From: chime3 Date: Sun, 1 Sep 2024 23:38:48 -0700 Subject: [PATCH 1/5] feat: added person, calendar, event schemas --- calendar/v0.1.0/schema.json | 64 ++++++++++++++ profile/person/v0.1.0/schema.json | 18 ++++ social/event/v0.1.0/schema.json | 138 ++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 calendar/v0.1.0/schema.json create mode 100644 profile/person/v0.1.0/schema.json create mode 100644 social/event/v0.1.0/schema.json diff --git a/calendar/v0.1.0/schema.json b/calendar/v0.1.0/schema.json new file mode 100644 index 0000000..9d3f53c --- /dev/null +++ b/calendar/v0.1.0/schema.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://common.schemas.example.com/calendar/v0.1.0/schema.json", + "title": "Calendar", + "titlePlural": "Calendars", + "description": "Calendar information", + "type": "object", + "appearance": { + "style": { + "color": "#42A5F5", + "icon": "./calendar-icon.svg" + } + }, + "database": { + "name": "calendar_data", + "indexes": { + "name": [ + "name" + ], + "insertedAt": [ + "insertedAt" + ], + "source": [ + "sourceApplication", + "sourceId" + ] + } + }, + "layouts": { + "create": [ + "name", + "location" + ], + "view": [ + "name", + "description", + "location", + "insertedAt" + ] + }, + "allOf": [ + { + "$ref": "https://core.schemas.verida.io/base/v0.1.0/schema.json" + }, + { + "properties": { + "description": { + "title": "Description", + "description": "Description of the calendar", + "type": "string" + }, + "location": { + "title": "Location", + "description": "Location associated with the calendar", + "type": "string" + } + }, + "required": [ + "name", + "location" + ] + } + ] +} \ No newline at end of file diff --git a/profile/person/v0.1.0/schema.json b/profile/person/v0.1.0/schema.json new file mode 100644 index 0000000..22625a8 --- /dev/null +++ b/profile/person/v0.1.0/schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://common.schemas.example.com/profile/person/v0.1.0/schema.json", + "title": "Person", + "description": "Schema representing a person", + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email", + "description": "Email address of the person" + }, + "displayName": { + "type": "string", + "description": "Display name of the person" + } + } +} diff --git a/social/event/v0.1.0/schema.json b/social/event/v0.1.0/schema.json new file mode 100644 index 0000000..9db861b --- /dev/null +++ b/social/event/v0.1.0/schema.json @@ -0,0 +1,138 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://common.schemas.verida.io/social/event/v0.1.0/schema.json", + "title": "Event", + "description": "Schema for a calendar event", + "type": "object", + "appearance": { + "style": { + "color": "#4285F4", + "icon": "./icon.svg" + } + }, + "database": { + "name": "social_event", + "indexes": { + "name": ["name"], + "startTime": ["start.dateTime", "start.date"], + "endTime": ["end.dateTime", "end.date"], + "source": ["sourceApplication", "sourceId"] + } + }, + "layouts": { + "create": ["name", "start", "end", "location"], + "view": ["name", "description", "start", "end", "location", "organizer", "attendees", "status"] + }, + "allOf": [ + { + "$ref": "https://core.schemas.verida.io/base/v0.1.0/schema.json" + }, + { + "properties": { + "status": { + "title": "Status", + "description": "Status of the event", + "type": "string", + "enum": ["confirmed", "tentative", "cancelled"] + }, + "description": { + "title": "Description", + "description": "Detailed description of the event", + "type": "string" + }, + "location": { + "title": "Location", + "description": "Location of the event", + "type": "string" + }, + "creator": { + "title": "Creator", + "description": "Details of the event creator", + "$ref": "https://common.schemas.example.com/profile/person/v0.1.0/schema.json" + }, + "organizer": { + "title": "Organizer", + "description": "Details of the event organizer", + "$ref": "https://common.schemas.example.com/profile/person/v0.1.0/schema.json" + }, + "start": { + "title": "Start", + "description": "Start time of the event", + "type": "object", + "properties": { + "dateTime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "timeZone": { + "type": "string" + } + } + }, + "end": { + "title": "End", + "description": "End time of the event", + "type": "object", + "properties": { + "dateTime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "timeZone": { + "type": "string" + } + } + }, + "attendees": { + "title": "Attendees", + "description": "List of attendees for the event", + "type": "array", + "items": { + "$ref": "https://common.schemas.example.com/person/v0.1.0/schema.json" + } + }, + "conferenceData": { + "title": "Conference Data", + "description": "Details about the conference associated with the event", + "type": "object" + }, + "attachments": { + "title": "Attachments", + "description": "Attachments for the event", + "type": "array", + "items": { + "type": "object", + "properties": { + "fileUrl": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "iconLink": { + "type": "string", + "format": "uri" + }, + "fileId": { + "type": "string" + } + } + } + } + }, + "required": ["name", "start", "end"] + } + ] +} From e84a171e909f8a4c4afefaaae687ad86560d6a0e Mon Sep 17 00:00:00 2001 From: chime3 Date: Mon, 2 Sep 2024 00:46:06 -0700 Subject: [PATCH 2/5] fix: added formats and description, modifed required fields --- calendar/v0.1.0/schema.json | 11 +++++++++-- social/event/v0.1.0/schema.json | 20 +++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/calendar/v0.1.0/schema.json b/calendar/v0.1.0/schema.json index 9d3f53c..dfe2571 100644 --- a/calendar/v0.1.0/schema.json +++ b/calendar/v0.1.0/schema.json @@ -29,6 +29,7 @@ "layouts": { "create": [ "name", + "timezone", "location" ], "view": [ @@ -49,15 +50,21 @@ "description": "Description of the calendar", "type": "string" }, + "timeZone": { + "type": "string", + "description": "UTC offset format", + "pattern": "^([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])$", + "example": "+02:30" + }, "location": { "title": "Location", - "description": "Location associated with the calendar", + "description": "Geographic location of the calendar as free-form text.", "type": "string" } }, "required": [ "name", - "location" + "timezone" ] } ] diff --git a/social/event/v0.1.0/schema.json b/social/event/v0.1.0/schema.json index 9db861b..c67b4e4 100644 --- a/social/event/v0.1.0/schema.json +++ b/social/event/v0.1.0/schema.json @@ -14,14 +14,14 @@ "name": "social_event", "indexes": { "name": ["name"], - "startTime": ["start.dateTime", "start.date"], - "endTime": ["end.dateTime", "end.date"], + "startTime": ["start.date"], + "endTime": ["end.date"], "source": ["sourceApplication", "sourceId"] } }, "layouts": { - "create": ["name", "start", "end", "location"], - "view": ["name", "description", "start", "end", "location", "organizer", "attendees", "status"] + "create": ["name", "start.date", "end.date", "location"], + "view": ["name", "description", "start.date", "end.date", "location", "organizer", "attendees", "status"] }, "allOf": [ { @@ -69,7 +69,10 @@ "format": "date" }, "timeZone": { - "type": "string" + "type": "string", + "description": "UTC offset format", + "pattern": "^([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])$", + "example": "+02:30" } } }, @@ -87,7 +90,10 @@ "format": "date" }, "timeZone": { - "type": "string" + "type": "string", + "description": "UTC offset format", + "pattern": "^([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])$", + "example": "+02:30" } } }, @@ -132,7 +138,7 @@ } } }, - "required": ["name", "start", "end"] + "required": ["name", "start.date", "end.date"] } ] } From fc2b0a5c0a050426b471ce288ba40c7030aace8f Mon Sep 17 00:00:00 2001 From: chime3 Date: Mon, 2 Sep 2024 00:55:58 -0700 Subject: [PATCH 3/5] feat: embed person schema in event schema --- profile/person/v0.1.0/schema.json | 18 ------------------ social/event/v0.1.0/schema.json | 31 +++++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 profile/person/v0.1.0/schema.json diff --git a/profile/person/v0.1.0/schema.json b/profile/person/v0.1.0/schema.json deleted file mode 100644 index 22625a8..0000000 --- a/profile/person/v0.1.0/schema.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://common.schemas.example.com/profile/person/v0.1.0/schema.json", - "title": "Person", - "description": "Schema representing a person", - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "email", - "description": "Email address of the person" - }, - "displayName": { - "type": "string", - "description": "Display name of the person" - } - } -} diff --git a/social/event/v0.1.0/schema.json b/social/event/v0.1.0/schema.json index c67b4e4..27349de 100644 --- a/social/event/v0.1.0/schema.json +++ b/social/event/v0.1.0/schema.json @@ -48,12 +48,12 @@ "creator": { "title": "Creator", "description": "Details of the event creator", - "$ref": "https://common.schemas.example.com/profile/person/v0.1.0/schema.json" + "$ref": "#/$defs/person" }, "organizer": { "title": "Organizer", "description": "Details of the event organizer", - "$ref": "https://common.schemas.example.com/profile/person/v0.1.0/schema.json" + "$ref": "#/$defs/person" }, "start": { "title": "Start", @@ -72,7 +72,7 @@ "type": "string", "description": "UTC offset format", "pattern": "^([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])$", - "example": "+02:30" + "example": "+02:30" } } }, @@ -93,7 +93,7 @@ "type": "string", "description": "UTC offset format", "pattern": "^([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])$", - "example": "+02:30" + "example": "+02:30" } } }, @@ -102,7 +102,7 @@ "description": "List of attendees for the event", "type": "array", "items": { - "$ref": "https://common.schemas.example.com/person/v0.1.0/schema.json" + "$ref": "#/$defs/person" } }, "conferenceData": { @@ -140,5 +140,24 @@ }, "required": ["name", "start.date", "end.date"] } - ] + ], + "$defs": { + "person": { + "type": "object", + "title": "Person", + "description": "Schema representing a person", + "properties": { + "email": { + "type": "string", + "format": "email", + "description": "Email address of the person" + }, + "displayName": { + "type": "string", + "description": "Display name of the person" + } + }, + "required": ["email"] + } + } } From c514943f6724183a90f3a7f2ec8d8277ede943b8 Mon Sep 17 00:00:00 2001 From: chime3 Date: Mon, 2 Sep 2024 17:55:59 -0700 Subject: [PATCH 4/5] feat: added calendarId --- {calendar => social/calendar}/v0.1.0/schema.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) rename {calendar => social/calendar}/v0.1.0/schema.json (85%) diff --git a/calendar/v0.1.0/schema.json b/social/calendar/v0.1.0/schema.json similarity index 85% rename from calendar/v0.1.0/schema.json rename to social/calendar/v0.1.0/schema.json index dfe2571..b97f4ba 100644 --- a/calendar/v0.1.0/schema.json +++ b/social/calendar/v0.1.0/schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://common.schemas.example.com/calendar/v0.1.0/schema.json", + "$id": "https://common.schemas.example.com/social/calendar/v0.1.0/schema.json", "title": "Calendar", "titlePlural": "Calendars", "description": "Calendar information", @@ -28,11 +28,13 @@ }, "layouts": { "create": [ + "calendarId", "name", "timezone", "location" ], "view": [ + "calendarId", "name", "description", "location", @@ -45,6 +47,10 @@ }, { "properties": { + "calendarId": { + "description": "Reference ID of the calendar object", + "type": "string" + }, "description": { "title": "Description", "description": "Description of the calendar", @@ -63,6 +69,7 @@ } }, "required": [ + "calendarId", "name", "timezone" ] From 131b1f4e3971ea478077a616a343c05341e19bb0 Mon Sep 17 00:00:00 2001 From: chime3 Date: Mon, 2 Sep 2024 18:39:58 -0700 Subject: [PATCH 5/5] feat: added calendar ID --- social/calendar/v0.1.0/schema.json | 11 ++--------- social/event/v0.1.0/schema.json | 10 +++++++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/social/calendar/v0.1.0/schema.json b/social/calendar/v0.1.0/schema.json index b97f4ba..f6ffde9 100644 --- a/social/calendar/v0.1.0/schema.json +++ b/social/calendar/v0.1.0/schema.json @@ -28,13 +28,11 @@ }, "layouts": { "create": [ - "calendarId", "name", "timezone", "location" ], - "view": [ - "calendarId", + "view": [ "name", "description", "location", @@ -46,11 +44,7 @@ "$ref": "https://core.schemas.verida.io/base/v0.1.0/schema.json" }, { - "properties": { - "calendarId": { - "description": "Reference ID of the calendar object", - "type": "string" - }, + "properties": { "description": { "title": "Description", "description": "Description of the calendar", @@ -69,7 +63,6 @@ } }, "required": [ - "calendarId", "name", "timezone" ] diff --git a/social/event/v0.1.0/schema.json b/social/event/v0.1.0/schema.json index 27349de..9eac457 100644 --- a/social/event/v0.1.0/schema.json +++ b/social/event/v0.1.0/schema.json @@ -20,8 +20,8 @@ } }, "layouts": { - "create": ["name", "start.date", "end.date", "location"], - "view": ["name", "description", "start.date", "end.date", "location", "organizer", "attendees", "status"] + "create": ["name", "calendarId", "start.date", "end.date", "location"], + "view": ["name", "description", "calendarId", "start.date", "end.date", "location", "organizer", "attendees", "status"] }, "allOf": [ { @@ -40,6 +40,10 @@ "description": "Detailed description of the event", "type": "string" }, + "calendarId": { + "description": "Reference ID for the calendar object", + "type": "string" + }, "location": { "title": "Location", "description": "Location of the event", @@ -138,7 +142,7 @@ } } }, - "required": ["name", "start.date", "end.date"] + "required": ["name", "calendarId", "start.date", "end.date"] } ], "$defs": {