ensembledata 0.1.0 → 0.1.1

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/src/client.js CHANGED
@@ -17,7 +17,7 @@ class CustomerEndpoints {
17
17
 
18
18
  /**
19
19
  * @param {{ date: string }} params
20
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
20
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
21
21
  * @returns {Promise<EDResponse>}
22
22
  */
23
23
  getUsage({ date }, options = {}) {
@@ -26,13 +26,13 @@ class CustomerEndpoints {
26
26
  date,
27
27
  });
28
28
  return this.#requester.get("/customer/get-used-units", params, {
29
- timeoutSecs: options.timeoutSecs,
29
+ timeout: options.timeout,
30
30
  });
31
31
  }
32
32
 
33
33
  /**
34
34
  * @param {{ days: number }} params
35
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
35
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
36
36
  * @returns {Promise<EDResponse>}
37
37
  */
38
38
  getUsageHistory({ days }, options = {}) {
@@ -41,7 +41,7 @@ class CustomerEndpoints {
41
41
  days,
42
42
  });
43
43
  return this.#requester.get("/customer/get-history", params, {
44
- timeoutSecs: options.timeoutSecs,
44
+ timeout: options.timeout,
45
45
  });
46
46
  }
47
47
  }
@@ -60,7 +60,7 @@ class TiktokEndpoints {
60
60
 
61
61
  /**
62
62
  * @param {{ hashtag: string; cursor?: number }} params
63
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
63
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
64
64
  * @returns {Promise<EDResponse>}
65
65
  */
66
66
  hashtagSearch({ hashtag, cursor = undefined }, options = {}) {
@@ -70,7 +70,7 @@ class TiktokEndpoints {
70
70
  cursor,
71
71
  });
72
72
  return this.#requester.get("/tt/hashtag/posts", params, {
73
- timeoutSecs: options.timeoutSecs,
73
+ timeout: options.timeout,
74
74
  });
75
75
  }
76
76
 
@@ -81,7 +81,7 @@ class TiktokEndpoints {
81
81
  * remapOutput?: boolean;
82
82
  * maxCursor?: number;
83
83
  * }} params
84
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
84
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
85
85
  * @returns {Promise<EDResponse>}
86
86
  */
87
87
  fullHashtagSearch(
@@ -96,7 +96,7 @@ class TiktokEndpoints {
96
96
  max_cursor: maxCursor,
97
97
  });
98
98
  return this.#requester.get("/tt/hashtag/recent-posts", params, {
99
- timeoutSecs: options.timeoutSecs,
99
+ timeout: options.timeout,
100
100
  });
101
101
  }
102
102
 
@@ -110,7 +110,7 @@ class TiktokEndpoints {
110
110
  * matchExactly?: boolean;
111
111
  * getAuthorStats?: boolean;
112
112
  * }} params
113
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
113
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
114
114
  * @returns {Promise<EDResponse>}
115
115
  */
116
116
  keywordSearch(
@@ -136,7 +136,7 @@ class TiktokEndpoints {
136
136
  get_author_stats: getAuthorStats,
137
137
  });
138
138
  return this.#requester.get("/tt/keyword/search", params, {
139
- timeoutSecs: options.timeoutSecs,
139
+ timeout: options.timeout,
140
140
  });
141
141
  }
142
142
 
@@ -148,7 +148,7 @@ class TiktokEndpoints {
148
148
  * country?: string;
149
149
  * matchExactly?: boolean;
150
150
  * }} params
151
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
151
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
152
152
  * @returns {Promise<EDResponse>}
153
153
  */
154
154
  fullKeywordSearch(
@@ -170,7 +170,7 @@ class TiktokEndpoints {
170
170
  match_exactly: matchExactly,
171
171
  });
172
172
  return this.#requester.get("/tt/keyword/full-search", params, {
173
- timeoutSecs: options.timeoutSecs,
173
+ timeout: options.timeout,
174
174
  });
175
175
  }
176
176
 
@@ -182,7 +182,7 @@ class TiktokEndpoints {
182
182
  * oldestCreatetime?: number;
183
183
  * alternativeMethod?: boolean;
184
184
  * }} params
185
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
185
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
186
186
  * @returns {Promise<EDResponse>}
187
187
  */
188
188
  userPostsFromUsername(
@@ -204,7 +204,7 @@ class TiktokEndpoints {
204
204
  alternative_method: alternativeMethod,
205
205
  });
206
206
  return this.#requester.get("/tt/user/posts", params, {
207
- timeoutSecs: options.timeoutSecs,
207
+ timeout: options.timeout,
208
208
  returnTopLevelData: true,
209
209
  });
210
210
  }
@@ -217,7 +217,7 @@ class TiktokEndpoints {
217
217
  * oldestCreatetime?: number;
218
218
  * alternativeMethod?: boolean;
219
219
  * }} params
220
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
220
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
221
221
  * @returns {Promise<EDResponse>}
222
222
  */
223
223
  userPostsFromSecuid(
@@ -239,14 +239,14 @@ class TiktokEndpoints {
239
239
  alternative_method: alternativeMethod,
240
240
  });
241
241
  return this.#requester.get("/tt/user/posts-from-secuid", params, {
242
- timeoutSecs: options.timeoutSecs,
242
+ timeout: options.timeout,
243
243
  returnTopLevelData: true,
244
244
  });
245
245
  }
246
246
 
247
247
  /**
248
248
  * @param {{ username: string }} params
249
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
249
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
250
250
  * @returns {Promise<EDResponse>}
251
251
  */
252
252
  userInfoFromUsername({ username }, options = {}) {
@@ -255,13 +255,13 @@ class TiktokEndpoints {
255
255
  username,
256
256
  });
257
257
  return this.#requester.get("/tt/user/info", params, {
258
- timeoutSecs: options.timeoutSecs,
258
+ timeout: options.timeout,
259
259
  });
260
260
  }
261
261
 
262
262
  /**
263
263
  * @param {{ secUid: string; alternativeMethod?: boolean }} params
264
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
264
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
265
265
  * @returns {Promise<EDResponse>}
266
266
  */
267
267
  userInfoFromSecuid(
@@ -274,13 +274,13 @@ class TiktokEndpoints {
274
274
  alternative_method: alternativeMethod,
275
275
  });
276
276
  return this.#requester.get("/tt/user/info-from-secuid", params, {
277
- timeoutSecs: options.timeoutSecs,
277
+ timeout: options.timeout,
278
278
  });
279
279
  }
280
280
 
281
281
  /**
282
282
  * @param {{ keyword: string; cursor?: number }} params
283
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
283
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
284
284
  * @returns {Promise<EDResponse>}
285
285
  */
286
286
  userSearch({ keyword, cursor = undefined }, options = {}) {
@@ -290,13 +290,13 @@ class TiktokEndpoints {
290
290
  cursor,
291
291
  });
292
292
  return this.#requester.get("/tt/user/search", params, {
293
- timeoutSecs: options.timeoutSecs,
293
+ timeout: options.timeout,
294
294
  });
295
295
  }
296
296
 
297
297
  /**
298
298
  * @param {{ url: string }} params
299
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
299
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
300
300
  * @returns {Promise<EDResponse>}
301
301
  */
302
302
  postInfo({ url }, options = {}) {
@@ -305,13 +305,13 @@ class TiktokEndpoints {
305
305
  url,
306
306
  });
307
307
  return this.#requester.get("/tt/post/info", params, {
308
- timeoutSecs: options.timeoutSecs,
308
+ timeout: options.timeout,
309
309
  });
310
310
  }
311
311
 
312
312
  /**
313
313
  * @param {{ awemeIds: string[] }} params
314
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
314
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
315
315
  * @returns {Promise<EDResponse>}
316
316
  */
317
317
  multiPostInfo({ awemeIds }, options = {}) {
@@ -320,13 +320,13 @@ class TiktokEndpoints {
320
320
  ids: awemeIds.join(";"),
321
321
  });
322
322
  return this.#requester.get("/tt/post/multi-info", params, {
323
- timeoutSecs: options.timeoutSecs,
323
+ timeout: options.timeout,
324
324
  });
325
325
  }
326
326
 
327
327
  /**
328
328
  * @param {{ awemeId: string; cursor?: number }} params
329
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
329
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
330
330
  * @returns {Promise<EDResponse>}
331
331
  */
332
332
  postComments({ awemeId, cursor = undefined }, options = {}) {
@@ -336,13 +336,13 @@ class TiktokEndpoints {
336
336
  cursor,
337
337
  });
338
338
  return this.#requester.get("/tt/post/comments", params, {
339
- timeoutSecs: options.timeoutSecs,
339
+ timeout: options.timeout,
340
340
  });
341
341
  }
342
342
 
343
343
  /**
344
344
  * @param {{ awemeId: string; commentId: string; cursor?: number }} params
345
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
345
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
346
346
  * @returns {Promise<EDResponse>}
347
347
  */
348
348
  postCommentReplies(
@@ -356,7 +356,7 @@ class TiktokEndpoints {
356
356
  cursor,
357
357
  });
358
358
  return this.#requester.get("/tt/post/comments-replies", params, {
359
- timeoutSecs: options.timeoutSecs,
359
+ timeout: options.timeout,
360
360
  });
361
361
  }
362
362
 
@@ -367,7 +367,7 @@ class TiktokEndpoints {
367
367
  * sorting?: "0" | "1" | "2" | "3" | "4";
368
368
  * filterBy?: "0" | "1" | "2";
369
369
  * }} params
370
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
370
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
371
371
  * @returns {Promise<EDResponse>}
372
372
  */
373
373
  musicSearch(
@@ -387,13 +387,13 @@ class TiktokEndpoints {
387
387
  filter_by: filterBy,
388
388
  });
389
389
  return this.#requester.get("/tt/music/info", params, {
390
- timeoutSecs: options.timeoutSecs,
390
+ timeout: options.timeout,
391
391
  });
392
392
  }
393
393
 
394
394
  /**
395
395
  * @param {{ musicId: string; cursor?: number }} params
396
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
396
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
397
397
  * @returns {Promise<EDResponse>}
398
398
  */
399
399
  musicPosts({ musicId, cursor = undefined }, options = {}) {
@@ -403,13 +403,13 @@ class TiktokEndpoints {
403
403
  cursor,
404
404
  });
405
405
  return this.#requester.get("/tt/music/posts", params, {
406
- timeoutSecs: options.timeoutSecs,
406
+ timeout: options.timeout,
407
407
  });
408
408
  }
409
409
 
410
410
  /**
411
411
  * @param {{ musicId: string }} params
412
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
412
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
413
413
  * @returns {Promise<EDResponse>}
414
414
  */
415
415
  musicDetails({ musicId }, options = {}) {
@@ -418,13 +418,13 @@ class TiktokEndpoints {
418
418
  id: musicId,
419
419
  });
420
420
  return this.#requester.get("/tt/music/details", params, {
421
- timeoutSecs: options.timeoutSecs,
421
+ timeout: options.timeout,
422
422
  });
423
423
  }
424
424
 
425
425
  /**
426
426
  * @param {{ id: string; secUid: string; cursor?: number }} params
427
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
427
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
428
428
  * @returns {Promise<EDResponse>}
429
429
  */
430
430
  userFollowers({ id, secUid, cursor = undefined }, options = {}) {
@@ -435,7 +435,7 @@ class TiktokEndpoints {
435
435
  cursor,
436
436
  });
437
437
  return this.#requester.get("/tt/user/followers", params, {
438
- timeoutSecs: options.timeoutSecs,
438
+ timeout: options.timeout,
439
439
  });
440
440
  }
441
441
 
@@ -446,7 +446,7 @@ class TiktokEndpoints {
446
446
  * cursor?: number;
447
447
  * pageToken?: string;
448
448
  * }} params
449
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
449
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
450
450
  * @returns {Promise<EDResponse>}
451
451
  */
452
452
  userFollowings(
@@ -461,13 +461,13 @@ class TiktokEndpoints {
461
461
  page_token: pageToken,
462
462
  });
463
463
  return this.#requester.get("/tt/user/followings", params, {
464
- timeoutSecs: options.timeoutSecs,
464
+ timeout: options.timeout,
465
465
  });
466
466
  }
467
467
 
468
468
  /**
469
469
  * @param {{ secUid: string; cursor?: number }} params
470
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
470
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
471
471
  * @returns {Promise<EDResponse>}
472
472
  */
473
473
  userLikedPosts({ secUid, cursor = undefined }, options = {}) {
@@ -477,7 +477,7 @@ class TiktokEndpoints {
477
477
  cursor,
478
478
  });
479
479
  return this.#requester.get("/tt/user/liked-posts", params, {
480
- timeoutSecs: options.timeoutSecs,
480
+ timeout: options.timeout,
481
481
  });
482
482
  }
483
483
  }
@@ -503,7 +503,7 @@ class YoutubeEndpoints {
503
503
  * sorting?: "relevance" | "time" | "views" | "rating";
504
504
  * getAdditionalInfo?: boolean;
505
505
  * }} params
506
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
506
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
507
507
  * @returns {Promise<EDResponse>}
508
508
  */
509
509
  keywordSearch(
@@ -527,13 +527,13 @@ class YoutubeEndpoints {
527
527
  get_additional_info: getAdditionalInfo,
528
528
  });
529
529
  return this.#requester.get("/youtube/search", params, {
530
- timeoutSecs: options.timeoutSecs,
530
+ timeout: options.timeout,
531
531
  });
532
532
  }
533
533
 
534
534
  /**
535
535
  * @param {{ keyword: string }} params
536
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
536
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
537
537
  * @returns {Promise<EDResponse>}
538
538
  */
539
539
  featuredCategoriesSearch({ keyword }, options = {}) {
@@ -544,13 +544,13 @@ class YoutubeEndpoints {
544
544
  return this.#requester.get(
545
545
  "/youtube/search/featured-categories",
546
546
  params,
547
- { timeoutSecs: options.timeoutSecs },
547
+ { timeout: options.timeout },
548
548
  );
549
549
  }
550
550
 
551
551
  /**
552
552
  * @param {{ hashtag: string; depth: number; onlyShorts?: boolean }} params
553
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
553
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
554
554
  * @returns {Promise<EDResponse>}
555
555
  */
556
556
  hashtagSearch({ hashtag, depth, onlyShorts = undefined }, options = {}) {
@@ -561,13 +561,13 @@ class YoutubeEndpoints {
561
561
  only_shorts: onlyShorts,
562
562
  });
563
563
  return this.#requester.get("/youtube/hashtag/search", params, {
564
- timeoutSecs: options.timeoutSecs,
564
+ timeout: options.timeout,
565
565
  });
566
566
  }
567
567
 
568
568
  /**
569
569
  * @param {{ channelId: string; fromUrl?: boolean }} params
570
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
570
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
571
571
  * @returns {Promise<EDResponse>}
572
572
  */
573
573
  channelDetailedInfo({ channelId, fromUrl = undefined }, options = {}) {
@@ -577,13 +577,13 @@ class YoutubeEndpoints {
577
577
  from_url: fromUrl,
578
578
  });
579
579
  return this.#requester.get("/youtube/channel/detailed-info", params, {
580
- timeoutSecs: options.timeoutSecs,
580
+ timeout: options.timeout,
581
581
  });
582
582
  }
583
583
 
584
584
  /**
585
585
  * @param {{ channelId: string; depth: number }} params
586
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
586
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
587
587
  * @returns {Promise<EDResponse>}
588
588
  */
589
589
  channelVideos({ channelId, depth }, options = {}) {
@@ -593,13 +593,13 @@ class YoutubeEndpoints {
593
593
  depth,
594
594
  });
595
595
  return this.#requester.get("/youtube/channel/videos", params, {
596
- timeoutSecs: options.timeoutSecs,
596
+ timeout: options.timeout,
597
597
  });
598
598
  }
599
599
 
600
600
  /**
601
601
  * @param {{ channelId: string; depth: number }} params
602
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
602
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
603
603
  * @returns {Promise<EDResponse>}
604
604
  */
605
605
  channelShorts({ channelId, depth }, options = {}) {
@@ -609,7 +609,7 @@ class YoutubeEndpoints {
609
609
  depth,
610
610
  });
611
611
  return this.#requester.get("/youtube/channel/shorts", params, {
612
- timeoutSecs: options.timeoutSecs,
612
+ timeout: options.timeout,
613
613
  });
614
614
  }
615
615
 
@@ -619,7 +619,7 @@ class YoutubeEndpoints {
619
619
  * alternativeMethod?: boolean;
620
620
  * getSubscribersCount?: boolean;
621
621
  * }} params
622
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
622
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
623
623
  * @returns {Promise<EDResponse>}
624
624
  */
625
625
  videoDetails(
@@ -633,13 +633,13 @@ class YoutubeEndpoints {
633
633
  get_subscribers_count: getSubscribersCount,
634
634
  });
635
635
  return this.#requester.get("/youtube/channel/get-short-stats", params, {
636
- timeoutSecs: options.timeoutSecs,
636
+ timeout: options.timeout,
637
637
  });
638
638
  }
639
639
 
640
640
  /**
641
641
  * @param {{ channelId: string }} params
642
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
642
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
643
643
  * @returns {Promise<EDResponse>}
644
644
  */
645
645
  channelSubscribers({ channelId }, options = {}) {
@@ -648,13 +648,13 @@ class YoutubeEndpoints {
648
648
  browseId: channelId,
649
649
  });
650
650
  return this.#requester.get("/youtube/channel/followers", params, {
651
- timeoutSecs: options.timeoutSecs,
651
+ timeout: options.timeout,
652
652
  });
653
653
  }
654
654
 
655
655
  /**
656
656
  * @param {{ username: string }} params
657
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
657
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
658
658
  * @returns {Promise<EDResponse>}
659
659
  */
660
660
  channelUsernameToId({ username }, options = {}) {
@@ -663,13 +663,13 @@ class YoutubeEndpoints {
663
663
  name: username,
664
664
  });
665
665
  return this.#requester.get("/youtube/channel/name-to-id", params, {
666
- timeoutSecs: options.timeoutSecs,
666
+ timeout: options.timeout,
667
667
  });
668
668
  }
669
669
 
670
670
  /**
671
671
  * @param {{ channelId: string }} params
672
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
672
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
673
673
  * @returns {Promise<EDResponse>}
674
674
  */
675
675
  channelIdToUsername({ channelId }, options = {}) {
@@ -678,13 +678,13 @@ class YoutubeEndpoints {
678
678
  browseId: channelId,
679
679
  });
680
680
  return this.#requester.get("/youtube/channel/id-to-name", params, {
681
- timeoutSecs: options.timeoutSecs,
681
+ timeout: options.timeout,
682
682
  });
683
683
  }
684
684
 
685
685
  /**
686
686
  * @param {{ musicId: string; depth?: number }} params
687
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
687
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
688
688
  * @returns {Promise<EDResponse>}
689
689
  */
690
690
  musicIdToShorts({ musicId, depth = undefined }, options = {}) {
@@ -694,13 +694,13 @@ class YoutubeEndpoints {
694
694
  depth,
695
695
  });
696
696
  return this.#requester.get("/youtube/music/id-to-shorts", params, {
697
- timeoutSecs: options.timeoutSecs,
697
+ timeout: options.timeout,
698
698
  });
699
699
  }
700
700
 
701
701
  /**
702
702
  * @param {{ id: string; cursor?: string }} params
703
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
703
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
704
704
  * @returns {Promise<EDResponse>}
705
705
  */
706
706
  videoComments({ id, cursor = undefined }, options = {}) {
@@ -710,7 +710,7 @@ class YoutubeEndpoints {
710
710
  cursor,
711
711
  });
712
712
  return this.#requester.get("/youtube/video/comments", params, {
713
- timeoutSecs: options.timeoutSecs,
713
+ timeout: options.timeout,
714
714
  });
715
715
  }
716
716
  }
@@ -736,7 +736,7 @@ class InstagramEndpoints {
736
736
  * cursor?: string;
737
737
  * alternativeMethod?: boolean;
738
738
  * }} params
739
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
739
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
740
740
  * @returns {Promise<EDResponse>}
741
741
  */
742
742
  userPosts(
@@ -760,13 +760,13 @@ class InstagramEndpoints {
760
760
  alternative_method: alternativeMethod,
761
761
  });
762
762
  return this.#requester.get("/instagram/user/posts", params, {
763
- timeoutSecs: options.timeoutSecs,
763
+ timeout: options.timeout,
764
764
  });
765
765
  }
766
766
 
767
767
  /**
768
768
  * @param {{ userId: number }} params
769
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
769
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
770
770
  * @returns {Promise<EDResponse>}
771
771
  */
772
772
  userBasicStats({ userId }, options = {}) {
@@ -775,13 +775,13 @@ class InstagramEndpoints {
775
775
  user_id: userId,
776
776
  });
777
777
  return this.#requester.get("/instagram/user/basic-info", params, {
778
- timeoutSecs: options.timeoutSecs,
778
+ timeout: options.timeout,
779
779
  });
780
780
  }
781
781
 
782
782
  /**
783
783
  * @param {{ username: string }} params
784
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
784
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
785
785
  * @returns {Promise<EDResponse>}
786
786
  */
787
787
  userInfo({ username }, options = {}) {
@@ -790,13 +790,13 @@ class InstagramEndpoints {
790
790
  username,
791
791
  });
792
792
  return this.#requester.get("/instagram/user/info", params, {
793
- timeoutSecs: options.timeoutSecs,
793
+ timeout: options.timeout,
794
794
  });
795
795
  }
796
796
 
797
797
  /**
798
798
  * @param {{ username: string }} params
799
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
799
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
800
800
  * @returns {Promise<EDResponse>}
801
801
  */
802
802
  userDetailedInfo({ username }, options = {}) {
@@ -805,13 +805,13 @@ class InstagramEndpoints {
805
805
  username,
806
806
  });
807
807
  return this.#requester.get("/instagram/user/detailed-info", params, {
808
- timeoutSecs: options.timeoutSecs,
808
+ timeout: options.timeout,
809
809
  });
810
810
  }
811
811
 
812
812
  /**
813
813
  * @param {{ userId: number }} params
814
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
814
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
815
815
  * @returns {Promise<EDResponse>}
816
816
  */
817
817
  userFollowers({ userId }, options = {}) {
@@ -820,7 +820,7 @@ class InstagramEndpoints {
820
820
  user_id: userId,
821
821
  });
822
822
  return this.#requester.get("/instagram/user/followers", params, {
823
- timeoutSecs: options.timeoutSecs,
823
+ timeout: options.timeout,
824
824
  });
825
825
  }
826
826
 
@@ -833,7 +833,7 @@ class InstagramEndpoints {
833
833
  * cursor?: string;
834
834
  * chunkSize?: number;
835
835
  * }} params
836
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
836
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
837
837
  * @returns {Promise<EDResponse>}
838
838
  */
839
839
  userReels(
@@ -857,13 +857,13 @@ class InstagramEndpoints {
857
857
  chunk_size: chunkSize,
858
858
  });
859
859
  return this.#requester.get("/instagram/user/reels", params, {
860
- timeoutSecs: options.timeoutSecs,
860
+ timeout: options.timeout,
861
861
  });
862
862
  }
863
863
 
864
864
  /**
865
865
  * @param {{ userId: number; cursor?: string; chunkSize?: number }} params
866
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
866
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
867
867
  * @returns {Promise<EDResponse>}
868
868
  */
869
869
  userTaggedPosts(
@@ -877,13 +877,13 @@ class InstagramEndpoints {
877
877
  chunk_size: chunkSize,
878
878
  });
879
879
  return this.#requester.get("/instagram/user/tagged-posts", params, {
880
- timeoutSecs: options.timeoutSecs,
880
+ timeout: options.timeout,
881
881
  });
882
882
  }
883
883
 
884
884
  /**
885
885
  * @param {{ code: string; numComments?: number }} params
886
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
886
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
887
887
  * @returns {Promise<EDResponse>}
888
888
  */
889
889
  postInfoAndComments({ code, numComments = undefined }, options = {}) {
@@ -893,7 +893,7 @@ class InstagramEndpoints {
893
893
  n_comments_to_fetch: numComments,
894
894
  });
895
895
  return this.#requester.get("/instagram/post/details", params, {
896
- timeoutSecs: options.timeoutSecs,
896
+ timeout: options.timeout,
897
897
  });
898
898
  }
899
899
 
@@ -905,7 +905,7 @@ class InstagramEndpoints {
905
905
  * getAuthorInfo?: boolean;
906
906
  * alternativeMethod?: boolean;
907
907
  * }} params
908
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
908
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
909
909
  * @returns {Promise<EDResponse>}
910
910
  */
911
911
  hashtagPosts(
@@ -927,13 +927,13 @@ class InstagramEndpoints {
927
927
  alternative_method: alternativeMethod,
928
928
  });
929
929
  return this.#requester.get("/instagram/hashtag/posts", params, {
930
- timeoutSecs: options.timeoutSecs,
930
+ timeout: options.timeout,
931
931
  });
932
932
  }
933
933
 
934
934
  /**
935
935
  * @param {{ musicId: string; cursor?: string }} params
936
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
936
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
937
937
  * @returns {Promise<EDResponse>}
938
938
  */
939
939
  musicPosts({ musicId, cursor = undefined }, options = {}) {
@@ -943,13 +943,13 @@ class InstagramEndpoints {
943
943
  cursor,
944
944
  });
945
945
  return this.#requester.get("/instagram/music/posts", params, {
946
- timeoutSecs: options.timeoutSecs,
946
+ timeout: options.timeout,
947
947
  });
948
948
  }
949
949
 
950
950
  /**
951
951
  * @param {{ text: string }} params
952
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
952
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
953
953
  * @returns {Promise<EDResponse>}
954
954
  */
955
955
  search({ text }, options = {}) {
@@ -958,7 +958,7 @@ class InstagramEndpoints {
958
958
  text,
959
959
  });
960
960
  return this.#requester.get("/instagram/search", params, {
961
- timeoutSecs: options.timeoutSecs,
961
+ timeout: options.timeout,
962
962
  });
963
963
  }
964
964
  }
@@ -981,7 +981,7 @@ class TwitchEndpoints {
981
981
  * depth: number;
982
982
  * type: "videos" | "channels" | "games";
983
983
  * }} params
984
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
984
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
985
985
  * @returns {Promise<EDResponse>}
986
986
  */
987
987
  keywordSearch({ keyword, depth, type }, options = {}) {
@@ -992,13 +992,13 @@ class TwitchEndpoints {
992
992
  type,
993
993
  });
994
994
  return this.#requester.get("/twitch/search", params, {
995
- timeoutSecs: options.timeoutSecs,
995
+ timeout: options.timeout,
996
996
  });
997
997
  }
998
998
 
999
999
  /**
1000
1000
  * @param {{ username: string }} params
1001
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
1001
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1002
1002
  * @returns {Promise<EDResponse>}
1003
1003
  */
1004
1004
  userFollowers({ username }, options = {}) {
@@ -1007,7 +1007,7 @@ class TwitchEndpoints {
1007
1007
  username,
1008
1008
  });
1009
1009
  return this.#requester.get("/twitch/user/followers", params, {
1010
- timeoutSecs: options.timeoutSecs,
1010
+ timeout: options.timeout,
1011
1011
  });
1012
1012
  }
1013
1013
  }
@@ -1031,7 +1031,7 @@ class RedditEndpoints {
1031
1031
  * period: "hour" | "day" | "week" | "month" | "year" | "all";
1032
1032
  * cursor?: string;
1033
1033
  * }} params
1034
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
1034
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1035
1035
  * @returns {Promise<EDResponse>}
1036
1036
  */
1037
1037
  subredditPosts({ name, sort, period, cursor = undefined }, options = {}) {
@@ -1043,13 +1043,13 @@ class RedditEndpoints {
1043
1043
  cursor,
1044
1044
  });
1045
1045
  return this.#requester.get("/reddit/subreddit/posts", params, {
1046
- timeoutSecs: options.timeoutSecs,
1046
+ timeout: options.timeout,
1047
1047
  });
1048
1048
  }
1049
1049
 
1050
1050
  /**
1051
1051
  * @param {{ id: string; cursor?: string }} params
1052
- * @param {{ extraParams?: Record<string, any>; timeoutSecs?: number }} options
1052
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1053
1053
  * @returns {Promise<EDResponse>}
1054
1054
  */
1055
1055
  postComments({ id, cursor = undefined }, options = {}) {
@@ -1059,7 +1059,7 @@ class RedditEndpoints {
1059
1059
  cursor,
1060
1060
  });
1061
1061
  return this.#requester.get("/reddit/post/comments", params, {
1062
- timeoutSecs: options.timeoutSecs,
1062
+ timeout: options.timeout,
1063
1063
  });
1064
1064
  }
1065
1065
  }
@@ -1074,16 +1074,12 @@ export class EDClient {
1074
1074
  /**
1075
1075
  * @param {{
1076
1076
  * token: string;
1077
- * timeoutSecs?: number;
1077
+ * timeout?: number;
1078
1078
  * maxNetworkRetries?: number;
1079
1079
  * }} options
1080
1080
  */
1081
- constructor({ token, timeoutSecs = 600, maxNetworkRetries = 3 }) {
1082
- const requester = new Requester({
1083
- token,
1084
- timeoutSecs,
1085
- maxNetworkRetries,
1086
- });
1081
+ constructor({ token, timeout = 600, maxNetworkRetries = 3 }) {
1082
+ const requester = new Requester({ token, timeout, maxNetworkRetries });
1087
1083
  this.#requester = requester;
1088
1084
 
1089
1085
  /** @readonly */
@@ -1108,9 +1104,10 @@ export class EDClient {
1108
1104
  /**
1109
1105
  * @param {string} path
1110
1106
  * @param {Record<string, string>} params
1107
+ * @param {{ timeout?: number }} options
1111
1108
  * @returns {Promise<EDResponse>}
1112
1109
  */
1113
- async request(path, params) {
1114
- return this.#requester.get(path, params);
1110
+ async request(path, params, options = {}) {
1111
+ return this.#requester.get(path, params, { timeout: options.timeout });
1115
1112
  }
1116
1113
  }