Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add community icon url to notification schemas #10358

Closed
26 changes: 23 additions & 3 deletions libs/core/src/integration/notifications.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { z } from 'zod';

// TODO: make this stricter by adding max/min character length
export const CommentCreatedNotification = z.object({
community_id: z.string().max(255).describe('The id of the community'),
author: z
.string()
.describe('The profile name or first 8 characters of a users address'),
Expand All @@ -23,12 +24,15 @@ export const CommentCreatedNotification = z.object({
.describe('The user-friendly name of the community'),
comment_body: z
.string()
.max(255)
.describe('A truncated version of the comment body'),
comment_url: z.string().describe('The url of the comment'),
.describe('The first 100 characters of the comment body'),
comment_url: z.string().describe('The url to the comment'),
comment_created_event: events.CommentCreated.describe(
'The full comment record',
),
author_avatar_url: z
.string()
.nullish()
.describe('The URL of the author avatar'),
});

export const SnapshotProposalCreatedNotification = z.object({
Expand All @@ -44,6 +48,10 @@ export const SnapshotProposalCreatedNotification = z.object({
snapshot_proposal_url: z
.string()
.describe('The url to the snapshot proposal on Common'),
community_icon_url: z
.string()
.nullish()
.describe('The URL of the community icon'),
});

export const UserMentionedNotification = z.object({
Expand All @@ -63,6 +71,10 @@ export const UserMentionedNotification = z.object({
.max(255)
.describe('A truncated version of the comment body'),
object_url: z.string().describe('The url of the comment'),
author_avatar_url: z
.string()
.nullish()
.describe('The URL of the author avatar'),
});

export const CommunityStakeNotification = z.object({
Expand All @@ -75,6 +87,10 @@ export const CommunityStakeNotification = z.object({
.max(255)
.describe('The user-friendly name of the community'),
community_stakes_url: z.string().describe('The url to the community stakes'),
community_icon_url: z
.string()
.nullish()
.describe('The URL of the community icon'),
});

export const ChainProposalsNotification = z.object({
Expand All @@ -92,6 +108,10 @@ export const ChainProposalsNotification = z.object({
proposal_url: z
.string()
.describe('The url to the snapshot proposal on Common'),
community_icon_url: z
.string()
.nullish()
.describe('The URL of the community icon'),
});

export const BaseUpvoteNotification = z.object({
Expand Down
Loading