diff options
author | Raphael Kabo <raphaelkabo@hey.com> | 2024-02-27 17:37:10 +0000 |
---|---|---|
committer | Raphael Kabo <raphaelkabo@hey.com> | 2024-02-27 17:37:10 +0000 |
commit | 35398241dea769bd7554eaca0a9045801c847340 (patch) | |
tree | 8793eca2c6bfd6aa630e29a175aba7dfa413a3bb /src | |
parent | ec0bf2d6a9e74fd68febe9c09ba1997858ec3d7f (diff) |
Update dependencies to latest versions
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/activitypub.ts | 5 | ||||
-rw-r--r-- | src/lib/activitypub/templates.ts | 2 | ||||
-rw-r--r-- | src/routes/frontend.ts | 14 | ||||
-rw-r--r-- | src/routes/group.ts | 7 | ||||
-rw-r--r-- | src/util/markdown.ts | 2 |
5 files changed, 19 insertions, 11 deletions
diff --git a/src/lib/activitypub.ts b/src/lib/activitypub.ts index a06991d..19aee08 100644 --- a/src/lib/activitypub.ts +++ b/src/lib/activitypub.ts @@ -142,7 +142,10 @@ export const handlePollResponse = async (req: Request, res: Response) => { if (!event.attendees?.some((el) => el.id === attributedTo)) { const attendeeName = apActor.preferredUsername || apActor.name || attributedTo; - const newAttendee: Partial<IAttendee> = { + const newAttendee: Pick< + IAttendee, + "name" | "status" | "id" | "number" | "visibility" + > = { name: attendeeName, status: "attending", id: attributedTo, diff --git a/src/lib/activitypub/templates.ts b/src/lib/activitypub/templates.ts index cab9ada..d0c8cc2 100644 --- a/src/lib/activitypub/templates.ts +++ b/src/lib/activitypub/templates.ts @@ -8,7 +8,7 @@ export const successfulRSVPResponse = ({ fullAttendee, }: { event: IEvent; - newAttendee: { id: string; name: string }; + newAttendee: { id?: string; name: string }; fullAttendee: { _id: string }; }) => `<span class="h-card"><a href="${newAttendee.id}" class="u-url mention">@<span>${newAttendee.name}</span></a></span> Thanks for RSVPing! You can remove yourself from the RSVP list by clicking <a href="https://${config.general.domain}/oneclickunattendevent/${event.id}/${fullAttendee._id}">here</a>.`; diff --git a/src/routes/frontend.ts b/src/routes/frontend.ts index 5317819..51c207a 100644 --- a/src/routes/frontend.ts +++ b/src/routes/frontend.ts @@ -293,8 +293,11 @@ router.get("/:eventID", async (req: Request, res: Response) => { } let metadata = { title: event.name, - description: marked - .parse(event.description, { renderer: renderPlain() }) + description: ( + marked.parse(event.description, { + renderer: renderPlain(), + }) as string + ) .split(" ") .splice(0, 40) .join(" ") @@ -455,10 +458,11 @@ router.get("/group/:eventGroupID", async (req: Request, res: Response) => { const metadata = { title: eventGroup.name, - description: marked - .parse(eventGroup.description, { + description: ( + marked.parse(eventGroup.description, { renderer: renderPlain(), - }) + }) as string + ) .split(" ") .splice(0, 40) .join(" ") diff --git a/src/routes/group.ts b/src/routes/group.ts index 8afd766..1bbf501 100644 --- a/src/routes/group.ts +++ b/src/routes/group.ts @@ -269,10 +269,11 @@ router.post("/known/groups", async (req: Request, res: Response) => { return { id: group.id, name: group.name, - description: marked - .parse(group.description, { + description: ( + marked.parse(group.description, { renderer: renderPlain(), - }) + }) as string + ) .split(" ") .splice(0, 40) .join(" ") diff --git a/src/util/markdown.ts b/src/util/markdown.ts index bab50bd..666ed73 100644 --- a/src/util/markdown.ts +++ b/src/util/markdown.ts @@ -46,7 +46,7 @@ export const renderPlain = () => { }; export const markdownToSanitizedHTML = (markdown: string) => { - const html = marked.parse(markdown); + const html = marked.parse(markdown) as string; const window = new JSDOM("").window; const purify = DOMPurify(window); const clean = purify.sanitize(html); |