From 3740ff13906b1f91573b1ebee79d498a7bc4cc0f Mon Sep 17 00:00:00 2001 From: Nick Gerakines <12125+ngerakines@users.noreply.github.com> Date: Mon, 3 Feb 2025 08:54:33 -0500 Subject: [PATCH] Calendar and Location types (#23) Signed-off-by: Nick Gerakines <12125+ngerakines@users.noreply.github.com> --- community/lexicon/calendar/event.json | 146 ++++++++++++++++++++++++ community/lexicon/calendar/rsvp.json | 45 ++++++++ community/lexicon/location/address.json | 41 +++++++ community/lexicon/location/fsq.json | 29 +++++ community/lexicon/location/geo.json | 29 +++++ community/lexicon/location/h3.json | 23 ++++ 6 files changed, 313 insertions(+) create mode 100644 community/lexicon/calendar/event.json create mode 100644 community/lexicon/calendar/rsvp.json create mode 100644 community/lexicon/location/address.json create mode 100644 community/lexicon/location/fsq.json create mode 100644 community/lexicon/location/geo.json create mode 100644 community/lexicon/location/h3.json diff --git a/community/lexicon/calendar/event.json b/community/lexicon/calendar/event.json new file mode 100644 index 0000000..9f9b895 --- /dev/null +++ b/community/lexicon/calendar/event.json @@ -0,0 +1,146 @@ +{ + "lexicon": 1, + "id": "community.lexicon.calendar.event", + "defs": { + "main": { + "type": "record", + "description": "A calendar event.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "createdAt", + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the event." + }, + "description": { + "type": "string", + "description": "The description of the event." + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "Client-declared timestamp when the event was created." + }, + "startsAt": { + "type": "string", + "format": "datetime", + "description": "Client-declared timestamp when the event starts." + }, + "endsAt": { + "type": "string", + "format": "datetime", + "description": "Client-declared timestamp when the event ends." + }, + "mode": { + "type": "ref", + "ref": "community.lexicon.calendar.event#mode", + "description": "The attendance mode of the event." + }, + "status": { + "type": "ref", + "ref": "community.lexicon.calendar.event#status", + "description": "The status of the event." + }, + "locations": { + "type": "array", + "description": "The locations where the event takes place.", + "items": { + "type": "union", + "refs": [ + "community.lexicon.calendar.event#uri", + "community.lexicon.location.address", + "community.lexicon.location.fsq", + "community.lexicon.location.geo", + "community.lexicon.location.h3" + ] + } + }, + "uris": { + "type": "array", + "description": "URIs associated with the event.", + "items": { + "type": "ref", + "ref": "community.lexicon.calendar.event#uri" + } + } + } + } + }, + "mode": { + "type": "string", + "description": "The mode of the event.", + "default": "community.lexicon.calendar.event#inperson", + "knownValues": [ + "community.lexicon.calendar.event#hybrid", + "community.lexicon.calendar.event#inperson", + "community.lexicon.calendar.event#virtual" + ] + }, + "virtual": { + "type": "token", + "description": "A virtual event that takes place online." + }, + "inperson": { + "type": "token", + "description": "An in-person event that takes place offline." + }, + "hybrid": { + "type": "token", + "description": "A hybrid event that takes place both online and offline." + }, + "status": { + "type": "string", + "description": "The status of the event.", + "default": "community.lexicon.calendar.event#scheduled", + "knownValues": [ + "community.lexicon.calendar.event#cancelled", + "community.lexicon.calendar.event#planned", + "community.lexicon.calendar.event#postponed", + "community.lexicon.calendar.event#rescheduled", + "community.lexicon.calendar.event#scheduled" + ] + }, + "planned": { + "type": "token", + "description": "The event has been created, but not finalized." + }, + "scheduled": { + "type": "token", + "description": "The event has been created and scheduled." + }, + "rescheduled": { + "type": "token", + "description": "The event has been rescheduled." + }, + "cancelled": { + "type": "token", + "description": "The event has been cancelled." + }, + "postponed": { + "type": "token", + "description": "The event has been postponed and a new start date has not been set." + }, + "uri": { + "type": "object", + "description": "A URI associated with the event.", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "uri" + }, + "name": { + "type": "string", + "description": "The display name of the URI." + } + } + } + } +} \ No newline at end of file diff --git a/community/lexicon/calendar/rsvp.json b/community/lexicon/calendar/rsvp.json new file mode 100644 index 0000000..e58a59a --- /dev/null +++ b/community/lexicon/calendar/rsvp.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "community.lexicon.calendar.rsvp", + "defs": { + "main": { + "type": "record", + "description": "An RSVP for an event.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "status" + ], + "properties": { + "subject": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "status": { + "type": "string", + "default": "community.lexicon.calendar.rsvp#going", + "knownValues": [ + "community.lexicon.calendar.rsvp#interested", + "community.lexicon.calendar.rsvp#going", + "community.lexicon.calendar.rsvp#notgoing" + ] + } + } + } + }, + "interested": { + "type": "token", + "description": "Interested in the event" + }, + "going": { + "type": "token", + "description": "Going to the event" + }, + "notgoing": { + "type": "token", + "description": "Not going to the event" + } + } +} \ No newline at end of file diff --git a/community/lexicon/location/address.json b/community/lexicon/location/address.json new file mode 100644 index 0000000..751cb46 --- /dev/null +++ b/community/lexicon/location/address.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "community.lexicon.location.address", + "defs": { + "main": { + "type": "object", + "description": "A physical location in the form of a street address.", + "required": [ + "country" + ], + "properties": { + "country": { + "type": "string", + "description": "The ISO 3166 country code. Preferably the 2-letter code.", + "minLength": 2, + "maxLength": 10 + }, + "postalCode": { + "type": "string", + "description": "The postal code of the location." + }, + "region": { + "type": "string", + "description": "The administrative region of the country. For example, a state in the USA." + }, + "locality": { + "type": "string", + "description": "The locality of the region. For example, a city in the USA." + }, + "street": { + "type": "string", + "description": "The street address." + }, + "name": { + "type": "string", + "description": "The name of the location." + } + } + } + } +} \ No newline at end of file diff --git a/community/lexicon/location/fsq.json b/community/lexicon/location/fsq.json new file mode 100644 index 0000000..f47f82f --- /dev/null +++ b/community/lexicon/location/fsq.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "community.lexicon.location.fsq", + "defs": { + "main": { + "type": "object", + "description": "A physical location contained in the Foursquare Open Source Places dataset.", + "required": [ + "fsq_place_id" + ], + "properties": { + "fsq_place_id": { + "type": "string", + "description": "The unique identifier of a Foursquare POI." + }, + "latitude": { + "type": "string" + }, + "longitude": { + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the location." + } + } + } + } +} \ No newline at end of file diff --git a/community/lexicon/location/geo.json b/community/lexicon/location/geo.json new file mode 100644 index 0000000..ecd6200 --- /dev/null +++ b/community/lexicon/location/geo.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "community.lexicon.location.geo", + "defs": { + "main": { + "type": "object", + "description": "A physical location in the form of a WGS84 coordinate.", + "required": [ + "latitude", + "longitude" + ], + "properties": { + "latitude": { + "type": "string" + }, + "longitude": { + "type": "string" + }, + "altitude": { + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the location." + } + } + } + } +} \ No newline at end of file diff --git a/community/lexicon/location/h3.json b/community/lexicon/location/h3.json new file mode 100644 index 0000000..84929dc --- /dev/null +++ b/community/lexicon/location/h3.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "community.lexicon.location.h3", + "defs": { + "main": { + "type": "object", + "description": "A physical location in the form of a H3 encoded location.", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The h3 encoded location." + }, + "name": { + "type": "string", + "description": "The name of the location." + } + } + } + } +} \ No newline at end of file