pl-api: support streaming emoji reactions
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -4,6 +4,7 @@ import { announcementSchema } from './announcement';
|
|||||||
import { announcementReactionSchema } from './announcement-reaction';
|
import { announcementReactionSchema } from './announcement-reaction';
|
||||||
import { chatSchema } from './chat';
|
import { chatSchema } from './chat';
|
||||||
import { conversationSchema } from './conversation';
|
import { conversationSchema } from './conversation';
|
||||||
|
import { emojiReactionSchema } from './emoji-reaction';
|
||||||
import { markersSchema } from './marker';
|
import { markersSchema } from './marker';
|
||||||
import { notificationSchema } from './notification';
|
import { notificationSchema } from './notification';
|
||||||
import { statusSchema } from './status';
|
import { statusSchema } from './status';
|
||||||
@ -107,6 +108,11 @@ const notificationsMergedEventSchema = v.object({
|
|||||||
event: v.literal('notifications_merged'),
|
event: v.literal('notifications_merged'),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emojiReactionStreamingEventSchema = v.object({
|
||||||
|
...baseStreamingEventSchema.entries,
|
||||||
|
payload: v.pipe(v.any(), v.transform((payload: any) => JSON.parse(payload)), emojiReactionSchema),
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @category Schemas
|
* @category Schemas
|
||||||
* @see {@link https://docs.joinmastodon.org/methods/streaming/#events}
|
* @see {@link https://docs.joinmastodon.org/methods/streaming/#events}
|
||||||
@ -130,6 +136,7 @@ const streamingEventSchema: v.BaseSchema<any, StreamingEvent, v.BaseIssue<unknow
|
|||||||
respondStreamingEventSchema,
|
respondStreamingEventSchema,
|
||||||
markerStreamingEventSchema,
|
markerStreamingEventSchema,
|
||||||
notificationsMergedEventSchema,
|
notificationsMergedEventSchema,
|
||||||
|
emojiReactionStreamingEventSchema,
|
||||||
]),
|
]),
|
||||||
) as any;
|
) as any;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user