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

type(bottender-facebook): add type details for feed events #808

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 77 additions & 7 deletions packages/bottender-facebook/src/FacebookTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,92 @@ export type FeedReaction = {

export type FeedEvent = {
item: 'event';
[key: string]: any; // FIXME
message?: string;
postId: string;
story?: string;
eventId: string;
verb: 'add';
createdTime: number;
};

export type FeedPhoto = {
item: 'photo';
[key: string]: any; // FIXME
from: {
id: string;
name?: string;
};
link?: string;
message?: string;
postId: string;
createdTime: number;
photoId: string;
published: 0 | 1;
verb: 'add' | 'edited';
};

export type FeedVideo = {
item: 'video';
[key: string]: any; // FIXME
};
export type FeedVideo =
| {
item: 'video';
from: {
id: string;
name?: string;
};
link?: string;
message?: string;
postId: string;
createdTime: number;
published: 0 | 1;
verb: 'add' | 'edited';
videoId: string;
}
| {
item: 'video';
from: {
id: string;
name?: string;
};
postId: string;
createdTime: number;
verb: 'remove';
recipientId: string;
}
| {
item: 'video';
link: string;
message?: string;
videoFlagReason: 1;
verb: 'mute';
videoId: string;
}
| {
Copy link
Collaborator

@chentsulin chentsulin Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"video_flag_reason" : 1,
"item" : "video",
"verb" : "block",
"video_id" : "6388823369xxxxx"
}

message?: string;

item: 'video';
message?: string;
videoFlagReason: 1;
verb: 'block';
videoId: string;
}
| {
item: 'video';
link: string;
message?: string;
videoFlagReason: 1;
verb: 'unblock';
videoId: string;
};

export type FeedShare = {
item: 'share';
[key: string]: any; // FIXME
from: {
id: string;
name?: string;
};
link?: string;
message?: string;
postId: string;
createdTime: number;
published: 0 | 1;
verb: 'add' | 'edited';
shareId: string;
};

export type FeedPageLike = {
Expand Down