ensembledata 0.1.7 → 0.1.8

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.8",
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,23 @@ 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
+ * }} params
299
320
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
300
321
  * @returns {Promise<EDResponse>}
301
322
  */
302
- postInfo({ url }, options = {}) {
323
+ postInfo(
324
+ { url, newVersion = undefined, downloadVideo = undefined },
325
+ options = {},
326
+ ) {
303
327
  const params = filterUndefinedValues({
304
328
  ...options.extraParams,
305
329
  url,
330
+ new_version: newVersion,
331
+ download_video: downloadVideo,
306
332
  });
307
333
  return this.#requester.get("/tt/post/info", params, {
308
334
  timeout: options.timeout,
@@ -310,14 +336,23 @@ class TiktokEndpoints {
310
336
  }
311
337
 
312
338
  /**
313
- * @param {{ awemeIds: string[] }} params
339
+ * @param {{
340
+ * awemeIds: string[];
341
+ * newVersion?: boolean;
342
+ * downloadVideo?: boolean;
343
+ * }} params
314
344
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
315
345
  * @returns {Promise<EDResponse>}
316
346
  */
317
- multiPostInfo({ awemeIds }, options = {}) {
347
+ multiPostInfo(
348
+ { awemeIds, newVersion = undefined, downloadVideo = undefined },
349
+ options = {},
350
+ ) {
318
351
  const params = filterUndefinedValues({
319
352
  ...options.extraParams,
320
353
  ids: awemeIds.join(";"),
354
+ new_version: newVersion,
355
+ download_video: downloadVideo,
321
356
  });
322
357
  return this.#requester.get("/tt/post/multi-info", params, {
323
358
  timeout: options.timeout,
@@ -325,15 +360,19 @@ class TiktokEndpoints {
325
360
  }
326
361
 
327
362
  /**
328
- * @param {{ awemeId: string; cursor?: number }} params
363
+ * @param {{ awemeId: string; cursor?: number; newVersion?: boolean }} params
329
364
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
330
365
  * @returns {Promise<EDResponse>}
331
366
  */
332
- postComments({ awemeId, cursor = undefined }, options = {}) {
367
+ postComments(
368
+ { awemeId, cursor = undefined, newVersion = undefined },
369
+ options = {},
370
+ ) {
333
371
  const params = filterUndefinedValues({
334
372
  ...options.extraParams,
335
373
  aweme_id: awemeId,
336
374
  cursor,
375
+ new_version: newVersion,
337
376
  });
338
377
  return this.#requester.get("/tt/post/comments", params, {
339
378
  timeout: options.timeout,
@@ -408,14 +447,15 @@ class TiktokEndpoints {
408
447
  }
409
448
 
410
449
  /**
411
- * @param {{ musicId: string }} params
450
+ * @param {{ musicId: string; newVersion?: boolean }} params
412
451
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
413
452
  * @returns {Promise<EDResponse>}
414
453
  */
415
- musicDetails({ musicId }, options = {}) {
454
+ musicDetails({ musicId, newVersion = undefined }, options = {}) {
416
455
  const params = filterUndefinedValues({
417
456
  ...options.extraParams,
418
457
  id: musicId,
458
+ new_version: newVersion,
419
459
  });
420
460
  return this.#requester.get("/tt/music/details", params, {
421
461
  timeout: options.timeout,
@@ -423,16 +463,25 @@ class TiktokEndpoints {
423
463
  }
424
464
 
425
465
  /**
426
- * @param {{ id: string; secUid: string; cursor?: number }} params
466
+ * @param {{
467
+ * id: string;
468
+ * secUid: string;
469
+ * cursor?: number;
470
+ * newVersion?: boolean;
471
+ * }} params
427
472
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
428
473
  * @returns {Promise<EDResponse>}
429
474
  */
430
- userFollowers({ id, secUid, cursor = undefined }, options = {}) {
475
+ userFollowers(
476
+ { id, secUid, cursor = undefined, newVersion = undefined },
477
+ options = {},
478
+ ) {
431
479
  const params = filterUndefinedValues({
432
480
  ...options.extraParams,
433
481
  id,
434
482
  secUid,
435
483
  cursor,
484
+ new_version: newVersion,
436
485
  });
437
486
  return this.#requester.get("/tt/user/followers", params, {
438
487
  timeout: options.timeout,
@@ -445,12 +494,19 @@ class TiktokEndpoints {
445
494
  * secUid: string;
446
495
  * cursor?: number;
447
496
  * pageToken?: string;
497
+ * newVersion?: boolean;
448
498
  * }} params
449
499
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
450
500
  * @returns {Promise<EDResponse>}
451
501
  */
452
502
  userFollowings(
453
- { id, secUid, cursor = undefined, pageToken = undefined },
503
+ {
504
+ id,
505
+ secUid,
506
+ cursor = undefined,
507
+ pageToken = undefined,
508
+ newVersion = undefined,
509
+ },
454
510
  options = {},
455
511
  ) {
456
512
  const params = filterUndefinedValues({
@@ -459,6 +515,7 @@ class TiktokEndpoints {
459
515
  secUid,
460
516
  cursor,
461
517
  page_token: pageToken,
518
+ new_version: newVersion,
462
519
  });
463
520
  return this.#requester.get("/tt/user/followings", params, {
464
521
  timeout: options.timeout,
@@ -941,6 +998,27 @@ class InstagramEndpoints {
941
998
  });
942
999
  }
943
1000
 
1001
+ /**
1002
+ * @param {{
1003
+ * mediaId: number;
1004
+ * cursor: string;
1005
+ * sorting: "popular" | "recent";
1006
+ * }} params
1007
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1008
+ * @returns {Promise<EDResponse>}
1009
+ */
1010
+ postComments({ mediaId, cursor, sorting }, options = {}) {
1011
+ const params = filterUndefinedValues({
1012
+ ...options.extraParams,
1013
+ media_id: mediaId,
1014
+ cursor,
1015
+ sorting,
1016
+ });
1017
+ return this.#requester.get("/instagram/post/comments", params, {
1018
+ timeout: options.timeout,
1019
+ });
1020
+ }
1021
+
944
1022
  /**
945
1023
  * @param {{ musicId: string; cursor?: string }} params
946
1024
  * @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.8";