From edd18f1b71d22b6b897904bd6715bb52983a82fa Mon Sep 17 00:00:00 2001 From: ssmucny Date: Tue, 23 May 2023 21:51:41 -0400 Subject: [PATCH] update APEventService with new metadata schema --- .../src/core/activitypub/models/ApEventService.ts | 11 ++++++++++- packages/backend/src/models/entities/Event.ts | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/activitypub/models/ApEventService.ts b/packages/backend/src/core/activitypub/models/ApEventService.ts index b525f09ae0..50cbbe14ca 100644 --- a/packages/backend/src/core/activitypub/models/ApEventService.ts +++ b/packages/backend/src/core/activitypub/models/ApEventService.ts @@ -50,7 +50,16 @@ export class ApEventService { title, start, end, - metadata: {}, + metadata: { + '@context': 'https://schema.org', + '@type': 'Event', + name: note.name, + url: note.href, + startDate: note.startTime.toISOString(), + endDate: note.endTime?.toISOString(), + description: note.summary, + identifier: note.id, + }, }; } else { throw new Error('Invalid event properties'); diff --git a/packages/backend/src/models/entities/Event.ts b/packages/backend/src/models/entities/Event.ts index bad8b5d8ac..db48bda7b4 100644 --- a/packages/backend/src/models/entities/Event.ts +++ b/packages/backend/src/models/entities/Event.ts @@ -109,6 +109,7 @@ export type EventSchema = { sameAs?: string; // ie. URL to website/social }[]; typicalAgeRange?: string; + identifier?: string; } export type IEvent = {