@ifunny/ifunny-api-types 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/payloads/activity.js +45 -18
- package/dist/payloads/activity.js.map +1 -1
- package/dist/payloads/comment.js +12 -0
- package/dist/payloads/comment.js.map +1 -1
- package/dist/payloads/content.js +138 -0
- package/dist/payloads/content.js.map +1 -0
- package/dist/payloads/index.js +3 -1
- package/dist/payloads/index.js.map +1 -1
- package/dist/payloads/post.js +26 -1
- package/dist/payloads/post.js.map +1 -1
- package/dist/payloads/user.js +34 -34
- package/dist/payloads/user.js.map +1 -1
- package/dist/rest/content.js +68 -0
- package/dist/rest/content.js.map +1 -0
- package/dist/rest/explore.js +2 -0
- package/dist/rest/explore.js.map +1 -1
- package/dist/rest/index.js +1 -0
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/oauth2.js +6 -6
- package/dist/rest/oauth2.js.map +1 -1
- package/dist/rest/post.js +4 -2
- package/dist/rest/post.js.map +1 -1
- package/dist/utils/errors.js +32 -0
- package/dist/utils/errors.js.map +1 -1
- package/package.json +1 -1
- package/types/payloads/activity.d.ts +73 -57
- package/types/payloads/activity.d.ts.map +1 -1
- package/types/payloads/comment.d.ts +51 -28
- package/types/payloads/comment.d.ts.map +1 -1
- package/types/payloads/content.d.ts +570 -0
- package/types/payloads/content.d.ts.map +1 -0
- package/types/payloads/index.d.ts +3 -1
- package/types/payloads/index.d.ts.map +1 -1
- package/types/payloads/post.d.ts +256 -199
- package/types/payloads/post.d.ts.map +1 -1
- package/types/payloads/user.d.ts +9 -9
- package/types/payloads/user.d.ts.map +1 -1
- package/types/rest/content.d.ts +63 -0
- package/types/rest/content.d.ts.map +1 -0
- package/types/rest/explore.d.ts +5 -3
- package/types/rest/explore.d.ts.map +1 -1
- package/types/rest/index.d.ts +1 -0
- package/types/rest/index.d.ts.map +1 -1
- package/types/rest/oauth2.d.ts +14 -7
- package/types/rest/oauth2.d.ts.map +1 -1
- package/types/rest/post.d.ts +2 -2
- package/types/rest/post.d.ts.map +1 -1
- package/types/utils/errors.d.ts +39 -48
- package/types/utils/errors.d.ts.map +1 -1
- package/types/utils/util.d.ts +23 -0
- package/types/utils/util.d.ts.map +1 -1
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import { APIUser, APIUserNums } from "./user";
|
|
2
|
+
import { HexCode, Size, Timestamp } from "../utils/util";
|
|
3
|
+
/**
|
|
4
|
+
* Content visibility types
|
|
5
|
+
*/
|
|
6
|
+
export declare enum CONTENT_VISIBILITY {
|
|
7
|
+
/**
|
|
8
|
+
* Anyone can see the post
|
|
9
|
+
*/
|
|
10
|
+
PUBLIC = "public",
|
|
11
|
+
/**
|
|
12
|
+
* Post is hidden from collective and explore
|
|
13
|
+
*/
|
|
14
|
+
SUBSCRIBERS = "subscribers",
|
|
15
|
+
/**
|
|
16
|
+
* Only the creator can see the post
|
|
17
|
+
*/
|
|
18
|
+
CLOSED = "closed"
|
|
19
|
+
}
|
|
20
|
+
export declare type APIContentVisibility = `${CONTENT_VISIBILITY}`;
|
|
21
|
+
/**
|
|
22
|
+
* Content shot status types
|
|
23
|
+
*/
|
|
24
|
+
export declare enum SHOT_STATUS {
|
|
25
|
+
/**
|
|
26
|
+
* The content was approved for upload and comment attachments are enabled
|
|
27
|
+
*/
|
|
28
|
+
APPROVED = "approved",
|
|
29
|
+
/**
|
|
30
|
+
* The content was deleted by the automoderation system
|
|
31
|
+
*/
|
|
32
|
+
HARD_SHOT = "hardShot",
|
|
33
|
+
/**
|
|
34
|
+
* Post was approved for upload, but can't be used in comments
|
|
35
|
+
*/
|
|
36
|
+
SHOT = "shot"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Possible shot statuses
|
|
40
|
+
*/
|
|
41
|
+
export declare type APIContentShotStatus = `${SHOT_STATUS}`;
|
|
42
|
+
/**
|
|
43
|
+
* All currently known post types
|
|
44
|
+
*/
|
|
45
|
+
export declare enum CONTENT_TYPE {
|
|
46
|
+
/**
|
|
47
|
+
* Most common video post type\
|
|
48
|
+
* Data key: `video_clip`
|
|
49
|
+
*/
|
|
50
|
+
VIDEO_CLIP = "video_clip",
|
|
51
|
+
/**
|
|
52
|
+
* A video uploaded from a url like YouTube\
|
|
53
|
+
* Data key: `video`
|
|
54
|
+
*/
|
|
55
|
+
VIDEO = "video",
|
|
56
|
+
/**
|
|
57
|
+
* A video uploaded from vine\
|
|
58
|
+
* Data key: `vine`
|
|
59
|
+
*/
|
|
60
|
+
VINE = "vine",
|
|
61
|
+
/**
|
|
62
|
+
* Video meme from {@link https://coub.com Coub}\
|
|
63
|
+
* Data key: `coub`
|
|
64
|
+
*/
|
|
65
|
+
COUB = "coub",
|
|
66
|
+
/**
|
|
67
|
+
* A Gif post\
|
|
68
|
+
* Data key: `gif`
|
|
69
|
+
*/
|
|
70
|
+
GIF = "gif",
|
|
71
|
+
/**
|
|
72
|
+
* A Gif post with a custom caption\
|
|
73
|
+
* Data key: `gif`
|
|
74
|
+
*/
|
|
75
|
+
GIF_CAPTION = "gif_caption",
|
|
76
|
+
/**
|
|
77
|
+
* An image meme with a custom caption\
|
|
78
|
+
* Data key: `caption`
|
|
79
|
+
*/
|
|
80
|
+
CAPTION = "caption",
|
|
81
|
+
/**
|
|
82
|
+
* An image meme\
|
|
83
|
+
* Data key: `pic`
|
|
84
|
+
*/
|
|
85
|
+
PIC = "pic",
|
|
86
|
+
/**
|
|
87
|
+
* Image uploaded from iFunny's old "Meme" creator.\
|
|
88
|
+
* Data key: `mem`
|
|
89
|
+
*/
|
|
90
|
+
MEME = "mem",
|
|
91
|
+
/**
|
|
92
|
+
* Image uploaded from iFunny's old "Comic" creator.\
|
|
93
|
+
* Data key: `comics`
|
|
94
|
+
*/
|
|
95
|
+
COMICS = "comics",
|
|
96
|
+
/**
|
|
97
|
+
* An interactive post from iFunny
|
|
98
|
+
* Data key: `app` (Unknown due to deprecation)
|
|
99
|
+
* @deprecated These posts have been removed from the database and will not be available
|
|
100
|
+
*/
|
|
101
|
+
APP = "app",
|
|
102
|
+
/**
|
|
103
|
+
* Unknown post type\
|
|
104
|
+
* Data key: `old` (Unknown due to deprecation)\
|
|
105
|
+
* TODO: Document what CONTENT_TYPE.OLD is
|
|
106
|
+
*/
|
|
107
|
+
OLD = "old",
|
|
108
|
+
/**
|
|
109
|
+
* Unknown post type\
|
|
110
|
+
* Data key: `dem` (Unknown due to deprecation)\
|
|
111
|
+
* TODO: Document what CONTENT_TYPE.DEM is
|
|
112
|
+
*/
|
|
113
|
+
DEM = "dem"
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Possible content types
|
|
117
|
+
*/
|
|
118
|
+
export declare type APIContentType = `${CONTENT_TYPE}`;
|
|
119
|
+
export declare enum CONTENT_STATE {
|
|
120
|
+
/**
|
|
121
|
+
* The post is published
|
|
122
|
+
*/
|
|
123
|
+
PUBLISHED = "published",
|
|
124
|
+
/**
|
|
125
|
+
* A post that was scheduled to be published later
|
|
126
|
+
*/
|
|
127
|
+
DELAYED = "delayed"
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Possible post states
|
|
131
|
+
*/
|
|
132
|
+
export declare type APIContentState = `${CONTENT_STATE}`;
|
|
133
|
+
/**
|
|
134
|
+
* Author of a Post\
|
|
135
|
+
* Only includes info also in the user object
|
|
136
|
+
*/
|
|
137
|
+
export declare type APIContentCreatorBase = Pick<APIUser, "id" | "nick" | "photo" | "is_verified" | "is_banned" | "is_deleted" | "is_in_subscriptions" | "is_in_subscribers" | "is_blocked" | "nick_color" | "original_nick">;
|
|
138
|
+
/**
|
|
139
|
+
* The creator object for a post
|
|
140
|
+
*/
|
|
141
|
+
export interface APIContentCreator extends APIContentCreatorBase {
|
|
142
|
+
/**
|
|
143
|
+
* Only includes subscription and subscriber count
|
|
144
|
+
*/
|
|
145
|
+
num: APIContentCreatorNum;
|
|
146
|
+
/**
|
|
147
|
+
* Total amount of posts the creator has. For some reason this is not in the nums object for creators
|
|
148
|
+
*/
|
|
149
|
+
total_posts: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Alias for {@link APIContentCreator}
|
|
153
|
+
*/
|
|
154
|
+
export declare type APIContentAuthor = APIContentCreator;
|
|
155
|
+
/**
|
|
156
|
+
* Num object for Post Creator.\
|
|
157
|
+
* total_posts is in the creator object for some reason
|
|
158
|
+
*/
|
|
159
|
+
export declare type APIContentCreatorNum = Pick<APIUserNums, "subscribers" | "subscriptions">;
|
|
160
|
+
/**
|
|
161
|
+
* Numbers attatched to a post
|
|
162
|
+
*/
|
|
163
|
+
export interface APIContentNums {
|
|
164
|
+
/**
|
|
165
|
+
* The amount of smiles the post has
|
|
166
|
+
*/
|
|
167
|
+
smiles: number;
|
|
168
|
+
/**
|
|
169
|
+
* The amount of unsmiles the post has
|
|
170
|
+
*/
|
|
171
|
+
unsmiles: number;
|
|
172
|
+
/**
|
|
173
|
+
* How many smiles came from users visiting the creators profile
|
|
174
|
+
*/
|
|
175
|
+
guest_smiles: number;
|
|
176
|
+
/**
|
|
177
|
+
* How many comments are on the post
|
|
178
|
+
*/
|
|
179
|
+
comments: number;
|
|
180
|
+
/**
|
|
181
|
+
* How many views the post has
|
|
182
|
+
*/
|
|
183
|
+
views: number;
|
|
184
|
+
/**
|
|
185
|
+
* How many republishes the post has
|
|
186
|
+
*/
|
|
187
|
+
republished: number;
|
|
188
|
+
/**
|
|
189
|
+
* How many shares the post has
|
|
190
|
+
*/
|
|
191
|
+
shares: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Copyright data for a post.
|
|
195
|
+
*/
|
|
196
|
+
export interface APIContentCopyright {
|
|
197
|
+
/**
|
|
198
|
+
* Note about the copyright
|
|
199
|
+
*/
|
|
200
|
+
note?: string;
|
|
201
|
+
/**
|
|
202
|
+
* URL of original source
|
|
203
|
+
*/
|
|
204
|
+
url?: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The Thumbnail object returned from the API\
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* APIContentThumbnail.url = `https://imageproxy.ifunny.co/${params}/images/${content_id}.jpg`
|
|
211
|
+
* APIContentThumbnail.webp_url = `https://imageproxy.ifunny.co/${params}/images/${content_id}.webp
|
|
212
|
+
* ```
|
|
213
|
+
* Content URL params:\
|
|
214
|
+
* `crop:x-{number}` crops `number` pixels from bottom of the image\
|
|
215
|
+
* `crop:x+{number}` leaves `number` pixels at the top, and crops the rest\
|
|
216
|
+
* `crop:square` makes the image a square aspect ratio\
|
|
217
|
+
* `resize:{number}` changes the size of the image\
|
|
218
|
+
* `quality:{number}` changes the image quality
|
|
219
|
+
*
|
|
220
|
+
*
|
|
221
|
+
* ? Bottom iFunny watermarks are 20 pixels tall\
|
|
222
|
+
* ? `crop:x-20` crops the watermark from an image
|
|
223
|
+
*/
|
|
224
|
+
export interface APIContentThumbnail {
|
|
225
|
+
/**
|
|
226
|
+
* crop:x-20,crop:square,resize:65x,quality:90x75\
|
|
227
|
+
* `jpg`
|
|
228
|
+
*/
|
|
229
|
+
small_url: string;
|
|
230
|
+
/**
|
|
231
|
+
* crop:x-20,crop:square,resize:160x,quality:90x75\
|
|
232
|
+
* `jpg`
|
|
233
|
+
*/
|
|
234
|
+
url: string;
|
|
235
|
+
/**
|
|
236
|
+
* crop:x-20,crop:square,resize:320x,quality:90x75\
|
|
237
|
+
* `jpg`
|
|
238
|
+
*/
|
|
239
|
+
large_url: string;
|
|
240
|
+
/**
|
|
241
|
+
* crop:x-20,resize:640x,quality:90x75\
|
|
242
|
+
* `jpg`
|
|
243
|
+
*/
|
|
244
|
+
x640_url: string;
|
|
245
|
+
/**
|
|
246
|
+
* crop:x-20,resize:640x,quality:90x75
|
|
247
|
+
*/
|
|
248
|
+
webp_url: string;
|
|
249
|
+
/**
|
|
250
|
+
* crop:x-20,crop:square,resize:320x,quality:90
|
|
251
|
+
*/
|
|
252
|
+
large_webp_url: string;
|
|
253
|
+
/**
|
|
254
|
+
* crop:x-20,resize:640x,quality:90
|
|
255
|
+
*/
|
|
256
|
+
x640_webp_url: string;
|
|
257
|
+
/**
|
|
258
|
+
* crop:x-20,resize:320x,crop:x800,quality:90x75
|
|
259
|
+
*/
|
|
260
|
+
proportional_url: string;
|
|
261
|
+
/**
|
|
262
|
+
* crop:x-20,resize:320x,crop:x800,quality:90
|
|
263
|
+
*/
|
|
264
|
+
proportional_webp_url: string;
|
|
265
|
+
/**
|
|
266
|
+
* The proportional size of the image
|
|
267
|
+
*/
|
|
268
|
+
proportional_size: Size;
|
|
269
|
+
}
|
|
270
|
+
interface WebP {
|
|
271
|
+
/**
|
|
272
|
+
* webp format url of the post
|
|
273
|
+
*/
|
|
274
|
+
webp_url: string;
|
|
275
|
+
}
|
|
276
|
+
export declare enum VIDEO_SOURCE {
|
|
277
|
+
USER = "user",
|
|
278
|
+
INSTAGRAM = "instagram"
|
|
279
|
+
}
|
|
280
|
+
export declare type APIVideoSourceType = `${VIDEO_SOURCE}`;
|
|
281
|
+
export interface APICoubContentData {
|
|
282
|
+
/**
|
|
283
|
+
* WebP thumbnail of the Coub
|
|
284
|
+
*/
|
|
285
|
+
screen_url: string;
|
|
286
|
+
bytes: number;
|
|
287
|
+
/**
|
|
288
|
+
* Original Coub source
|
|
289
|
+
*/
|
|
290
|
+
traceback_url: string;
|
|
291
|
+
/**
|
|
292
|
+
* Length in seconds
|
|
293
|
+
*/
|
|
294
|
+
duration: number;
|
|
295
|
+
}
|
|
296
|
+
export interface APIVideoContentData {
|
|
297
|
+
/**
|
|
298
|
+
* Url of original video
|
|
299
|
+
*/
|
|
300
|
+
url: string;
|
|
301
|
+
/**
|
|
302
|
+
* Length in seconds
|
|
303
|
+
*/
|
|
304
|
+
duration: number;
|
|
305
|
+
/**
|
|
306
|
+
* Length in seconds
|
|
307
|
+
*/
|
|
308
|
+
length: number;
|
|
309
|
+
}
|
|
310
|
+
export interface APIVideoClipContentData {
|
|
311
|
+
/**
|
|
312
|
+
* JPEG image of the video clip
|
|
313
|
+
*/
|
|
314
|
+
screen_url: string;
|
|
315
|
+
bytes: number;
|
|
316
|
+
source_type: APIVideoSourceType;
|
|
317
|
+
/**
|
|
318
|
+
* Logo url to the source if not 'user'
|
|
319
|
+
*/
|
|
320
|
+
logo_url?: string;
|
|
321
|
+
/**
|
|
322
|
+
* In seconds
|
|
323
|
+
*/
|
|
324
|
+
duration: Timestamp;
|
|
325
|
+
}
|
|
326
|
+
export interface APIVineContentData {
|
|
327
|
+
screen_url: string;
|
|
328
|
+
bytes: number;
|
|
329
|
+
}
|
|
330
|
+
export interface APICaptionContentData {
|
|
331
|
+
/**
|
|
332
|
+
* The caption of the post
|
|
333
|
+
*/
|
|
334
|
+
caption_text: string;
|
|
335
|
+
}
|
|
336
|
+
export declare type APIComicsContentData = WebP;
|
|
337
|
+
export declare type APIMemeContentData = WebP;
|
|
338
|
+
export declare type APIPicContentData = WebP;
|
|
339
|
+
export interface APIGifContentData {
|
|
340
|
+
/**
|
|
341
|
+
* JPEG url of the post
|
|
342
|
+
*/
|
|
343
|
+
screen_url: string;
|
|
344
|
+
/**
|
|
345
|
+
* How many bytes the post is
|
|
346
|
+
*/
|
|
347
|
+
bytes: number;
|
|
348
|
+
/**
|
|
349
|
+
* Url of the post in MP4 format
|
|
350
|
+
*/
|
|
351
|
+
mp4_url: string;
|
|
352
|
+
/**
|
|
353
|
+
* How many bytes the mp4 version is
|
|
354
|
+
*/
|
|
355
|
+
mp4_bytes: number;
|
|
356
|
+
}
|
|
357
|
+
export declare type APIGifCaptionContentData = APIGifContentData & APICaptionContentData;
|
|
358
|
+
export interface UnknownContentData extends JSON {
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* JSON data of an iFunny Post
|
|
362
|
+
*/
|
|
363
|
+
export interface APIContentBase {
|
|
364
|
+
/**
|
|
365
|
+
* Unique id of the post.\
|
|
366
|
+
* Typically 9 characters long
|
|
367
|
+
*/
|
|
368
|
+
id: string;
|
|
369
|
+
/**
|
|
370
|
+
* The type of the post.
|
|
371
|
+
*/
|
|
372
|
+
type: APIContentType;
|
|
373
|
+
/**
|
|
374
|
+
* Content url of the post.
|
|
375
|
+
*/
|
|
376
|
+
url: string;
|
|
377
|
+
/**
|
|
378
|
+
* If the post uses the old watermark or the new one
|
|
379
|
+
*/
|
|
380
|
+
old_watermark: boolean;
|
|
381
|
+
/**
|
|
382
|
+
* In-app share url.
|
|
383
|
+
* @example
|
|
384
|
+
* `https://ifunny.co/picture/${post.id}`
|
|
385
|
+
* `https://ifunny.co/video/${post.id}`
|
|
386
|
+
*/
|
|
387
|
+
link: string;
|
|
388
|
+
/**
|
|
389
|
+
* The title of the post
|
|
390
|
+
*/
|
|
391
|
+
title: string;
|
|
392
|
+
/**
|
|
393
|
+
* Fixed title of the post
|
|
394
|
+
* @example
|
|
395
|
+
* `Gif memes ${post.id} by ${post.creator.nick}`
|
|
396
|
+
* `Picture memes ${post.id} by ${post.creator.nick}: ${post.num.comments} comments`
|
|
397
|
+
*/
|
|
398
|
+
fixed_title: string;
|
|
399
|
+
/**
|
|
400
|
+
* Array of tags on the post
|
|
401
|
+
*/
|
|
402
|
+
tags: string[];
|
|
403
|
+
/**
|
|
404
|
+
* The publish state of the post
|
|
405
|
+
*/
|
|
406
|
+
state: APIContentState;
|
|
407
|
+
/**
|
|
408
|
+
* {@link Timestamp} of when the post was created
|
|
409
|
+
*/
|
|
410
|
+
date_create: Timestamp;
|
|
411
|
+
/**
|
|
412
|
+
* {@link Timestamp} of when the Post was published
|
|
413
|
+
*/
|
|
414
|
+
publish_at: Timestamp;
|
|
415
|
+
/**
|
|
416
|
+
* Is the post smiled by the Client
|
|
417
|
+
*/
|
|
418
|
+
is_smiled: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Is the post unsmiled by the Client
|
|
421
|
+
*/
|
|
422
|
+
is_unsmiled: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Is the post removed by iFunny
|
|
425
|
+
*/
|
|
426
|
+
is_abused: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Is the post featured by iFunny
|
|
429
|
+
*/
|
|
430
|
+
is_featured: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Is the post republished by the Client
|
|
433
|
+
*/
|
|
434
|
+
is_republished: boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Is the post pinned by the creator
|
|
437
|
+
*/
|
|
438
|
+
is_pinned: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Background color of the post.
|
|
441
|
+
*/
|
|
442
|
+
bg_color: HexCode;
|
|
443
|
+
/**
|
|
444
|
+
* The {@link APIContentThumbnail thumbnail} of the post
|
|
445
|
+
*/
|
|
446
|
+
thumb: APIContentThumbnail;
|
|
447
|
+
/**
|
|
448
|
+
* A post's {@link APIContentCopyright copyright} data
|
|
449
|
+
*/
|
|
450
|
+
copyright: APIContentCopyright;
|
|
451
|
+
/**
|
|
452
|
+
* The {@link APIContentNums numbers} on the post.
|
|
453
|
+
*/
|
|
454
|
+
num: APIContentNums;
|
|
455
|
+
/**
|
|
456
|
+
* The author of the post
|
|
457
|
+
*/
|
|
458
|
+
creator?: APIContentCreator;
|
|
459
|
+
/**
|
|
460
|
+
* Size of the post
|
|
461
|
+
*/
|
|
462
|
+
size: Size;
|
|
463
|
+
/**
|
|
464
|
+
* Url of the original source
|
|
465
|
+
*/
|
|
466
|
+
traceback_url?: string;
|
|
467
|
+
/**
|
|
468
|
+
* The post's visibility
|
|
469
|
+
*/
|
|
470
|
+
visibility: APIContentVisibility;
|
|
471
|
+
/**
|
|
472
|
+
* TODO: shot_status description
|
|
473
|
+
*/
|
|
474
|
+
shot_status: APIContentShotStatus;
|
|
475
|
+
/**
|
|
476
|
+
* TODO: fast_start description
|
|
477
|
+
*/
|
|
478
|
+
fast_start: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* The risk level of the post
|
|
481
|
+
*/
|
|
482
|
+
risk: number;
|
|
483
|
+
/**
|
|
484
|
+
* @example
|
|
485
|
+
* `https://ifunny.co/picture/${post.id}`
|
|
486
|
+
*/
|
|
487
|
+
canonical_url: string;
|
|
488
|
+
/**
|
|
489
|
+
* Text generated from iFunny's OCR
|
|
490
|
+
*/
|
|
491
|
+
ocr_text?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Can the post be boosted still
|
|
494
|
+
*/
|
|
495
|
+
can_be_boosted: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* The source of the post if it's a republish
|
|
498
|
+
*/
|
|
499
|
+
source?: APIContentSource;
|
|
500
|
+
}
|
|
501
|
+
export interface APICoubContent extends APIContentBase {
|
|
502
|
+
type: CONTENT_TYPE.COUB;
|
|
503
|
+
coub: APICoubContentData;
|
|
504
|
+
}
|
|
505
|
+
export interface APIVideoClipContent extends APIContentBase {
|
|
506
|
+
type: CONTENT_TYPE.VIDEO_CLIP;
|
|
507
|
+
video_clip: APIVideoClipContentData;
|
|
508
|
+
}
|
|
509
|
+
export interface APIVideoContent extends APIContentBase {
|
|
510
|
+
type: CONTENT_TYPE.VIDEO;
|
|
511
|
+
video: APIVideoContentData;
|
|
512
|
+
}
|
|
513
|
+
export interface APIVineContent extends APIContentBase {
|
|
514
|
+
type: CONTENT_TYPE.VINE;
|
|
515
|
+
vine: APIVineContentData;
|
|
516
|
+
}
|
|
517
|
+
export interface APICaptionContent extends APIContentBase {
|
|
518
|
+
type: CONTENT_TYPE.CAPTION;
|
|
519
|
+
caption: APICaptionContentData;
|
|
520
|
+
}
|
|
521
|
+
export interface APIComicsContent extends APIContentBase {
|
|
522
|
+
type: CONTENT_TYPE.COMICS;
|
|
523
|
+
comics: APIComicsContentData;
|
|
524
|
+
}
|
|
525
|
+
export interface APIMemeContent extends APIContentBase {
|
|
526
|
+
type: CONTENT_TYPE.MEME;
|
|
527
|
+
meme: APIMemeContentData;
|
|
528
|
+
}
|
|
529
|
+
export interface APIPicContent extends APIContentBase {
|
|
530
|
+
type: CONTENT_TYPE.PIC;
|
|
531
|
+
pic: APIPicContentData;
|
|
532
|
+
}
|
|
533
|
+
export interface APIGifContent extends APIContentBase {
|
|
534
|
+
type: CONTENT_TYPE.GIF;
|
|
535
|
+
gif: APIGifContentData;
|
|
536
|
+
}
|
|
537
|
+
export interface APIGifCaptionContent extends APIContentBase {
|
|
538
|
+
type: CONTENT_TYPE.GIF_CAPTION;
|
|
539
|
+
gif: APIGifCaptionContentData;
|
|
540
|
+
}
|
|
541
|
+
export interface APIUnknownContent extends APIContentBase {
|
|
542
|
+
type: CONTENT_TYPE.APP | CONTENT_TYPE.OLD | CONTENT_TYPE.DEM;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* The original source of the content
|
|
546
|
+
*/
|
|
547
|
+
export declare type APIContentSource = Partial<APIContent> & Pick<APIContent, "id" | "date_create">;
|
|
548
|
+
/**
|
|
549
|
+
* Any possible content type
|
|
550
|
+
*/
|
|
551
|
+
export declare type APIContent = APIContentVideo | APIContentPic | APIContentGif | APIContentSpecial;
|
|
552
|
+
/**
|
|
553
|
+
* All video/mp4 content types
|
|
554
|
+
*/
|
|
555
|
+
export declare type APIContentVideo = APICoubContent | APIVideoClipContent | APIVideoContent | APIVineContent;
|
|
556
|
+
/**
|
|
557
|
+
* All picture/jpg content types
|
|
558
|
+
*/
|
|
559
|
+
export declare type APIContentPic = APICaptionContent | APIPicContent | APIComicsContent | APIMemeContent;
|
|
560
|
+
/**
|
|
561
|
+
* All Gif content types
|
|
562
|
+
*/
|
|
563
|
+
export declare type APIContentGif = APIGifContent | APIGifCaptionContent;
|
|
564
|
+
/**
|
|
565
|
+
* All currently undocumented content types. Once documented, these may move into the appropriate content types above.\
|
|
566
|
+
* ? Currently: 'dem', 'old', 'app'
|
|
567
|
+
*/
|
|
568
|
+
export declare type APIContentSpecial = APIUnknownContent;
|
|
569
|
+
export {};
|
|
570
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"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],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/payloads/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|