Skip to content

Commit 3bbbaac

Browse files
gooosemanScriptSmith
authored andcommitted
add edge_sidecar_to_children property
* chore(typings): adds proper edge_sidecar_to_children typings * refactor(typigns): move typings to a separate EdgeSidecarToChildren type * fix(typings): adds video_url to EdgeSidecarToChildren * fix(typings): makes media_preview to be or null or string, adds fact_check_overall_rating * fix(typings): fixes all failing tests because of new EdgeSidecarToChildren typing
1 parent ae0eb36 commit 3bbbaac

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/api/types.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,29 @@ export const EdgeMediaToCaption = t.type({
6969
),
7070
});
7171

72+
const EdgeSidecarToChildren = t.type({
73+
edges: t.array(
74+
t.type({
75+
node: t.type({
76+
__typename: t.string,
77+
id: t.string,
78+
shortcode: t.union([t.string, t.undefined]),
79+
dimensions: Dimensions,
80+
gating_info: t.union([t.null, t.undefined]),
81+
fact_check_information: t.union([t.null, t.undefined]),
82+
media_preview: t.union([t.undefined, t.string, t.null]),
83+
display_url: t.string,
84+
display_resources: DisplayResources,
85+
accessibility_caption: t.union([t.string, t.undefined, t.null]),
86+
is_video: t.boolean,
87+
video_url: t.union([t.string, t.undefined]),
88+
tracking_token: t.string,
89+
edge_media_to_tagged_user: EdgeMediaToCaption,
90+
}),
91+
}),
92+
),
93+
});
94+
7295
export const EdgeMediaToComment = t.type({
7396
count: t.number,
7497
});
@@ -90,6 +113,7 @@ export const PostNode = t.type({
90113
edge_media_to_comment: EdgeMediaToComment,
91114
taken_at_timestamp: t.number,
92115
fact_check_information: t.union([t.null, t.undefined]),
116+
fact_check_overall_rating: t.union([t.undefined, t.null]),
93117
dimensions: Dimensions,
94118
display_url: t.string,
95119
edge_liked_by: t.union([EdgeMediaToComment, t.undefined]),
@@ -121,7 +145,7 @@ export const PostNode = t.type({
121145
viewer_has_saved_to_collection: t.union([t.boolean, t.undefined]),
122146
viewer_in_photo_of_you: t.union([t.boolean, t.undefined]),
123147
viewer_can_reshare: t.union([t.boolean, t.undefined]),
124-
edge_sidecar_to_children: t.union([EdgeMediaToCaption, t.undefined]),
148+
edge_sidecar_to_children: t.union([EdgeSidecarToChildren, t.undefined]),
125149
});
126150

127151
export const CommentNode = t.type({
@@ -181,7 +205,7 @@ export const ShortcodeMedia = t.type({
181205
dimensions: Dimensions,
182206
gating_info: t.union([GatingInfo, t.null, t.undefined]),
183207
fact_check_information: t.null,
184-
fact_check_overall_rating: t.null,
208+
fact_check_overall_rating: t.union([t.undefined, t.null]),
185209
media_preview: t.union([t.string, t.null]),
186210
display_url: t.string,
187211
display_resources: DisplayResources,
@@ -211,7 +235,7 @@ export const ShortcodeMedia = t.type({
211235
owner: ShortcodeMediaOwner,
212236
is_ad: t.boolean,
213237
edge_web_media_to_related_media: EdgeMediaToCaption,
214-
edge_sidecar_to_children: t.union([EdgeMediaToCaption, t.undefined]),
238+
edge_sidecar_to_children: t.union([EdgeSidecarToChildren, t.undefined]),
215239
dash_info: t.union([
216240
t.undefined,
217241
t.type({

0 commit comments

Comments
 (0)