ensembledata 0.1.7 → 0.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ensembledata",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Node.js bindings for the EnsembleData API",
5
5
  "author": "EnsembleData <hello@ensembledata.com>",
6
6
  "contributors": [
package/src/client.js CHANGED
@@ -181,6 +181,8 @@ class TiktokEndpoints {
181
181
  * cursor?: number;
182
182
  * oldestCreatetime?: number;
183
183
  * alternativeMethod?: boolean;
184
+ * newVersion?: boolean;
185
+ * downloadVideo?: boolean;
184
186
  * }} params
185
187
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
186
188
  * @returns {Promise<EDResponse>}
@@ -192,6 +194,8 @@ class TiktokEndpoints {
192
194
  cursor = undefined,
193
195
  oldestCreatetime = undefined,
194
196
  alternativeMethod = undefined,
197
+ newVersion = undefined,
198
+ downloadVideo = undefined,
195
199
  },
196
200
  options = {},
197
201
  ) {
@@ -202,6 +206,8 @@ class TiktokEndpoints {
202
206
  start_cursor: cursor,
203
207
  oldest_createtime: oldestCreatetime,
204
208
  alternative_method: alternativeMethod,
209
+ new_version: newVersion,
210
+ download_video: downloadVideo,
205
211
  });
206
212
  return this.#requester.get("/tt/user/posts", params, {
207
213
  timeout: options.timeout,
@@ -216,6 +222,8 @@ class TiktokEndpoints {
216
222
  * cursor?: number;
217
223
  * oldestCreatetime?: number;
218
224
  * alternativeMethod?: boolean;
225
+ * newVersion?: boolean;
226
+ * downloadVideo?: boolean;
219
227
  * }} params
220
228
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
221
229
  * @returns {Promise<EDResponse>}
@@ -227,6 +235,8 @@ class TiktokEndpoints {
227
235
  cursor = undefined,
228
236
  oldestCreatetime = undefined,
229
237
  alternativeMethod = undefined,
238
+ newVersion = undefined,
239
+ downloadVideo = undefined,
230
240
  },
231
241
  options = {},
232
242
  ) {
@@ -237,6 +247,8 @@ class TiktokEndpoints {
237
247
  start_cursor: cursor,
238
248
  oldest_createtime: oldestCreatetime,
239
249
  alternative_method: alternativeMethod,
250
+ new_version: newVersion,
251
+ download_video: downloadVideo,
240
252
  });
241
253
  return this.#requester.get("/tt/user/posts-from-secuid", params, {
242
254
  timeout: options.timeout,
@@ -260,18 +272,23 @@ class TiktokEndpoints {
260
272
  }
261
273
 
262
274
  /**
263
- * @param {{ secUid: string; alternativeMethod?: boolean }} params
275
+ * @param {{
276
+ * secUid: string;
277
+ * alternativeMethod?: boolean;
278
+ * newVersion?: boolean;
279
+ * }} params
264
280
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
265
281
  * @returns {Promise<EDResponse>}
266
282
  */
267
283
  userInfoFromSecuid(
268
- { secUid, alternativeMethod = undefined },
284
+ { secUid, alternativeMethod = undefined, newVersion = undefined },
269
285
  options = {},
270
286
  ) {
271
287
  const params = filterUndefinedValues({
272
288
  ...options.extraParams,
273
289
  secUid,
274
290
  alternative_method: alternativeMethod,
291
+ new_version: newVersion,
275
292
  });
276
293
  return this.#requester.get("/tt/user/info-from-secuid", params, {
277
294
  timeout: options.timeout,
@@ -295,14 +312,30 @@ class TiktokEndpoints {
295
312
  }
296
313
 
297
314
  /**
298
- * @param {{ url: string }} params
315
+ * @param {{
316
+ * url: string;
317
+ * newVersion?: boolean;
318
+ * downloadVideo?: boolean;
319
+ * alternativeMethod?: boolean;
320
+ * }} params
299
321
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
300
322
  * @returns {Promise<EDResponse>}
301
323
  */
302
- postInfo({ url }, options = {}) {
324
+ postInfo(
325
+ {
326
+ url,
327
+ newVersion = undefined,
328
+ downloadVideo = undefined,
329
+ alternativeMethod = undefined,
330
+ },
331
+ options = {},
332
+ ) {
303
333
  const params = filterUndefinedValues({
304
334
  ...options.extraParams,
305
335
  url,
336
+ new_version: newVersion,
337
+ download_video: downloadVideo,
338
+ alternative_method: alternativeMethod,
306
339
  });
307
340
  return this.#requester.get("/tt/post/info", params, {
308
341
  timeout: options.timeout,
@@ -310,14 +343,30 @@ class TiktokEndpoints {
310
343
  }
311
344
 
312
345
  /**
313
- * @param {{ awemeIds: string[] }} params
346
+ * @param {{
347
+ * awemeIds: string[];
348
+ * newVersion?: boolean;
349
+ * downloadVideo?: boolean;
350
+ * alternativeMethod?: boolean;
351
+ * }} params
314
352
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
315
353
  * @returns {Promise<EDResponse>}
316
354
  */
317
- multiPostInfo({ awemeIds }, options = {}) {
355
+ multiPostInfo(
356
+ {
357
+ awemeIds,
358
+ newVersion = undefined,
359
+ downloadVideo = undefined,
360
+ alternativeMethod = undefined,
361
+ },
362
+ options = {},
363
+ ) {
318
364
  const params = filterUndefinedValues({
319
365
  ...options.extraParams,
320
366
  ids: awemeIds.join(";"),
367
+ new_version: newVersion,
368
+ download_video: downloadVideo,
369
+ alternative_method: alternativeMethod,
321
370
  });
322
371
  return this.#requester.get("/tt/post/multi-info", params, {
323
372
  timeout: options.timeout,
@@ -325,15 +374,19 @@ class TiktokEndpoints {
325
374
  }
326
375
 
327
376
  /**
328
- * @param {{ awemeId: string; cursor?: number }} params
377
+ * @param {{ awemeId: string; cursor?: number; newVersion?: boolean }} params
329
378
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
330
379
  * @returns {Promise<EDResponse>}
331
380
  */
332
- postComments({ awemeId, cursor = undefined }, options = {}) {
381
+ postComments(
382
+ { awemeId, cursor = undefined, newVersion = undefined },
383
+ options = {},
384
+ ) {
333
385
  const params = filterUndefinedValues({
334
386
  ...options.extraParams,
335
387
  aweme_id: awemeId,
336
388
  cursor,
389
+ new_version: newVersion,
337
390
  });
338
391
  return this.#requester.get("/tt/post/comments", params, {
339
392
  timeout: options.timeout,
@@ -408,14 +461,15 @@ class TiktokEndpoints {
408
461
  }
409
462
 
410
463
  /**
411
- * @param {{ musicId: string }} params
464
+ * @param {{ musicId: string; newVersion?: boolean }} params
412
465
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
413
466
  * @returns {Promise<EDResponse>}
414
467
  */
415
- musicDetails({ musicId }, options = {}) {
468
+ musicDetails({ musicId, newVersion = undefined }, options = {}) {
416
469
  const params = filterUndefinedValues({
417
470
  ...options.extraParams,
418
471
  id: musicId,
472
+ new_version: newVersion,
419
473
  });
420
474
  return this.#requester.get("/tt/music/details", params, {
421
475
  timeout: options.timeout,
@@ -423,16 +477,25 @@ class TiktokEndpoints {
423
477
  }
424
478
 
425
479
  /**
426
- * @param {{ id: string; secUid: string; cursor?: number }} params
480
+ * @param {{
481
+ * id: string;
482
+ * secUid: string;
483
+ * cursor?: number;
484
+ * newVersion?: boolean;
485
+ * }} params
427
486
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
428
487
  * @returns {Promise<EDResponse>}
429
488
  */
430
- userFollowers({ id, secUid, cursor = undefined }, options = {}) {
489
+ userFollowers(
490
+ { id, secUid, cursor = undefined, newVersion = undefined },
491
+ options = {},
492
+ ) {
431
493
  const params = filterUndefinedValues({
432
494
  ...options.extraParams,
433
495
  id,
434
496
  secUid,
435
497
  cursor,
498
+ new_version: newVersion,
436
499
  });
437
500
  return this.#requester.get("/tt/user/followers", params, {
438
501
  timeout: options.timeout,
@@ -445,12 +508,19 @@ class TiktokEndpoints {
445
508
  * secUid: string;
446
509
  * cursor?: number;
447
510
  * pageToken?: string;
511
+ * newVersion?: boolean;
448
512
  * }} params
449
513
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
450
514
  * @returns {Promise<EDResponse>}
451
515
  */
452
516
  userFollowings(
453
- { id, secUid, cursor = undefined, pageToken = undefined },
517
+ {
518
+ id,
519
+ secUid,
520
+ cursor = undefined,
521
+ pageToken = undefined,
522
+ newVersion = undefined,
523
+ },
454
524
  options = {},
455
525
  ) {
456
526
  const params = filterUndefinedValues({
@@ -459,6 +529,7 @@ class TiktokEndpoints {
459
529
  secUid,
460
530
  cursor,
461
531
  page_token: pageToken,
532
+ new_version: newVersion,
462
533
  });
463
534
  return this.#requester.get("/tt/user/followings", params, {
464
535
  timeout: options.timeout,
@@ -941,6 +1012,27 @@ class InstagramEndpoints {
941
1012
  });
942
1013
  }
943
1014
 
1015
+ /**
1016
+ * @param {{
1017
+ * mediaId: number;
1018
+ * cursor: string;
1019
+ * sorting: "popular" | "recent";
1020
+ * }} params
1021
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1022
+ * @returns {Promise<EDResponse>}
1023
+ */
1024
+ postComments({ mediaId, cursor, sorting }, options = {}) {
1025
+ const params = filterUndefinedValues({
1026
+ ...options.extraParams,
1027
+ media_id: mediaId,
1028
+ cursor,
1029
+ sorting,
1030
+ });
1031
+ return this.#requester.get("/instagram/post/comments", params, {
1032
+ timeout: options.timeout,
1033
+ });
1034
+ }
1035
+
944
1036
  /**
945
1037
  * @param {{ musicId: string; cursor?: string }} params
946
1038
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.7";
1
+ export const VERSION = "0.1.9";