@ofauth/onlyfans-sdk 2.3.0 → 3.0.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/dist/index.mjs CHANGED
@@ -126,51 +126,46 @@ async function proxy(config, opts) {
126
126
  }
127
127
 
128
128
  // src/client.ts
129
- var AccessAnalyticsCampaignsNamespace = class {
129
+ var AccountConnectionsNamespace = class {
130
130
  constructor(config) {
131
131
  this._config = config;
132
132
  }
133
133
  /**
134
- * Campaigns chart
134
+ * Disconnect connection
135
135
  */
136
- getChart(params) {
136
+ delete(params) {
137
137
  return request(this._config, {
138
- path: "/v2/access/analytics/campaigns/chart",
139
- method: "GET",
140
- query: {
141
- "startDate": params.startDate,
142
- "endDate": params.endDate,
143
- "withTotal": params.withTotal
144
- }
138
+ path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}`,
139
+ method: "DELETE"
145
140
  });
146
141
  }
147
142
  /**
148
- * Top campaigns
143
+ * List connections
149
144
  */
150
- getTop(params) {
145
+ list(params) {
151
146
  return request(this._config, {
152
- path: "/v2/access/analytics/campaigns/top",
147
+ path: "/v2/account/connections",
153
148
  method: "GET",
154
149
  query: {
150
+ "status": params.status,
151
+ "imported": params.imported,
155
152
  "limit": params.limit,
156
- "offset": params.offset,
157
- "startDate": params.startDate,
158
- "endDate": params.endDate
153
+ "offset": params.offset
159
154
  }
160
155
  });
161
156
  }
162
157
  /**
163
- * Top campaigns
158
+ * List connections
164
159
  *
165
160
  * Returns an async iterator that automatically paginates through all results.
166
161
  */
167
- async *iterateTop(params) {
162
+ async *iterate(params) {
168
163
  let offset = 0;
169
164
  let fetched = 0;
170
165
  const limit = params?.pageSize ?? 20;
171
166
  const maxItems = params?.maxItems ?? Infinity;
172
167
  while (fetched < maxItems) {
173
- const response = await this.getTop({
168
+ const response = await this.list({
174
169
  ...params,
175
170
  limit: Math.min(limit, maxItems - fetched),
176
171
  offset
@@ -185,38 +180,142 @@ var AccessAnalyticsCampaignsNamespace = class {
185
180
  offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
186
181
  }
187
182
  }
183
+ /**
184
+ * Invalidate connection
185
+ */
186
+ invalidate(params) {
187
+ return request(this._config, {
188
+ path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}/invalidate`,
189
+ method: "POST"
190
+ });
191
+ }
192
+ /**
193
+ * Get connection settings
194
+ */
195
+ getSettings(params) {
196
+ return request(this._config, {
197
+ path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}/settings`,
198
+ method: "GET"
199
+ });
200
+ }
201
+ /**
202
+ * Update connection settings
203
+ */
204
+ updateSettings(params) {
205
+ return request(this._config, {
206
+ path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}/settings`,
207
+ method: "PATCH",
208
+ body: params.body
209
+ });
210
+ }
211
+ /**
212
+ * Import connection
213
+ */
214
+ createImport(params) {
215
+ return request(this._config, {
216
+ path: "/v2/account/connections/import",
217
+ method: "POST",
218
+ body: params.body
219
+ });
220
+ }
221
+ /**
222
+ * Update imported connection session
223
+ */
224
+ updateImport(params) {
225
+ return request(this._config, {
226
+ path: `/v2/account/connections/import/${encodeURIComponent(String(params.connectionId))}`,
227
+ method: "PATCH",
228
+ body: params.body
229
+ });
230
+ }
188
231
  };
189
- var AccessAnalyticsEarningsNamespace = class {
232
+ var AccountNamespace = class {
190
233
  constructor(config) {
191
234
  this._config = config;
235
+ this.connections = new AccountConnectionsNamespace(config);
192
236
  }
193
237
  /**
194
- * Chargebacks
238
+ * Whoami
195
239
  */
196
- listChargebacks(params) {
240
+ whoami() {
241
+ return request(this._config, {
242
+ path: "/v2/account/whoami",
243
+ method: "GET"
244
+ });
245
+ }
246
+ /**
247
+ * Get organization settings
248
+ */
249
+ getSettings() {
250
+ return request(this._config, {
251
+ path: "/v2/account/settings",
252
+ method: "GET"
253
+ });
254
+ }
255
+ /**
256
+ * Update organization settings
257
+ */
258
+ updateSettings(params) {
259
+ return request(this._config, {
260
+ path: "/v2/account/settings",
261
+ method: "PATCH",
262
+ body: params.body
263
+ });
264
+ }
265
+ };
266
+ var AccessSelfNamespace = class {
267
+ constructor(config) {
268
+ this._config = config;
269
+ }
270
+ /**
271
+ * Get current user
272
+ */
273
+ get() {
274
+ return request(this._config, {
275
+ path: "/v2/access/self",
276
+ method: "GET"
277
+ });
278
+ }
279
+ /**
280
+ * Update current user profile
281
+ */
282
+ update(params) {
197
283
  return request(this._config, {
198
- path: "/v2/access/analytics/earnings/chargebacks",
284
+ path: "/v2/access/self",
285
+ method: "PATCH",
286
+ body: params.body
287
+ });
288
+ }
289
+ /**
290
+ * List notifications
291
+ */
292
+ listNotifications(params) {
293
+ return request(this._config, {
294
+ path: "/v2/access/self/notifications",
199
295
  method: "GET",
200
296
  query: {
201
- "startDate": params.startDate,
202
- "endDate": params.endDate,
203
- "marker": params.marker
297
+ "limit": params.limit,
298
+ "offset": params.offset,
299
+ "type": params.type,
300
+ "relatedUsername": params.relatedUsername
204
301
  }
205
302
  });
206
303
  }
207
304
  /**
208
- * Chargebacks
305
+ * List notifications
209
306
  *
210
307
  * Returns an async iterator that automatically paginates through all results.
211
308
  */
212
- async *iterateChargebacks(params) {
213
- let marker;
309
+ async *iterateNotifications(params) {
310
+ let offset = 0;
214
311
  let fetched = 0;
312
+ const limit = params?.pageSize ?? 20;
215
313
  const maxItems = params?.maxItems ?? Infinity;
216
314
  while (fetched < maxItems) {
217
- const response = await this.listChargebacks({
315
+ const response = await this.listNotifications({
218
316
  ...params,
219
- marker
317
+ limit: Math.min(limit, maxItems - fetched),
318
+ offset
220
319
  });
221
320
  for (const item of response.list) {
222
321
  if (fetched >= maxItems) return;
@@ -224,53 +323,42 @@ var AccessAnalyticsEarningsNamespace = class {
224
323
  fetched++;
225
324
  }
226
325
  if (!response.hasMore) return;
227
- marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
326
+ const nextOffset = response.nextOffset;
327
+ offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
228
328
  }
229
329
  }
230
330
  /**
231
- * Earnings chart
232
- */
233
- getChart(params) {
234
- return request(this._config, {
235
- path: "/v2/access/analytics/earnings/chart",
236
- method: "GET",
237
- query: {
238
- "startDate": params.startDate,
239
- "endDate": params.endDate,
240
- "by": params.by,
241
- "withTotal": params.withTotal,
242
- "monthlyTotal": params.monthlyTotal
243
- }
244
- });
245
- }
246
- /**
247
- * Transactions
331
+ * List release forms
248
332
  */
249
- listTransactions(params) {
333
+ listReleaseForms(params) {
250
334
  return request(this._config, {
251
- path: "/v2/access/analytics/earnings/transactions",
335
+ path: "/v2/access/self/release-forms",
252
336
  method: "GET",
253
337
  query: {
254
- "startDate": params.startDate,
255
- "marker": params.marker,
256
- "type": params.type,
257
- "tipsSource": params.tipsSource
338
+ "limit": params.limit,
339
+ "offset": params.offset,
340
+ "filter": params.filter,
341
+ "sortBy": params.sortBy,
342
+ "sortDirection": params.sortDirection,
343
+ "search": params.search
258
344
  }
259
345
  });
260
346
  }
261
347
  /**
262
- * Transactions
348
+ * List release forms
263
349
  *
264
350
  * Returns an async iterator that automatically paginates through all results.
265
351
  */
266
- async *iterateTransactions(params) {
267
- let marker;
352
+ async *iterateReleaseForms(params) {
353
+ let offset = 0;
268
354
  let fetched = 0;
355
+ const limit = params?.pageSize ?? 20;
269
356
  const maxItems = params?.maxItems ?? Infinity;
270
357
  while (fetched < maxItems) {
271
- const response = await this.listTransactions({
358
+ const response = await this.listReleaseForms({
272
359
  ...params,
273
- marker
360
+ limit: Math.min(limit, maxItems - fetched),
361
+ offset
274
362
  });
275
363
  for (const item of response.list) {
276
364
  if (fetched >= maxItems) return;
@@ -278,41 +366,42 @@ var AccessAnalyticsEarningsNamespace = class {
278
366
  fetched++;
279
367
  }
280
368
  if (!response.hasMore) return;
281
- marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
369
+ const nextOffset = response.nextOffset;
370
+ offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
282
371
  }
283
372
  }
284
- };
285
- var AccessAnalyticsMassMessagesNamespace = class {
286
- constructor(config) {
287
- this._config = config;
288
- }
289
373
  /**
290
- * Mass message buyers
374
+ * List tagged friend users
291
375
  */
292
- listBuyers(params) {
376
+ listTaggedFriendUsers(params) {
293
377
  return request(this._config, {
294
- path: `/v2/access/analytics/mass-messages/${encodeURIComponent(String(params.massMessageId))}/buyers`,
378
+ path: "/v2/access/self/tagged-friend-users",
295
379
  method: "GET",
296
380
  query: {
297
381
  "limit": params.limit,
298
382
  "offset": params.offset,
299
- "marker": params.marker
383
+ "filter": params.filter,
384
+ "sortBy": params.sortBy,
385
+ "sortDirection": params.sortDirection,
386
+ "search": params.search
300
387
  }
301
388
  });
302
389
  }
303
390
  /**
304
- * Mass message buyers
391
+ * List tagged friend users
305
392
  *
306
393
  * Returns an async iterator that automatically paginates through all results.
307
394
  */
308
- async *iterateBuyers(params) {
309
- let marker;
395
+ async *iterateTaggedFriendUsers(params) {
396
+ let offset = 0;
310
397
  let fetched = 0;
398
+ const limit = params?.pageSize ?? 20;
311
399
  const maxItems = params?.maxItems ?? Infinity;
312
400
  while (fetched < maxItems) {
313
- const response = await this.listBuyers({
401
+ const response = await this.listTaggedFriendUsers({
314
402
  ...params,
315
- marker
403
+ limit: Math.min(limit, maxItems - fetched),
404
+ offset
316
405
  });
317
406
  for (const item of response.list) {
318
407
  if (fetched >= maxItems) return;
@@ -320,35 +409,105 @@ var AccessAnalyticsMassMessagesNamespace = class {
320
409
  fetched++;
321
410
  }
322
411
  if (!response.hasMore) return;
323
- marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
412
+ const nextOffset = response.nextOffset;
413
+ offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
324
414
  }
325
415
  }
416
+ };
417
+ var AccessEarningsNamespace = class {
418
+ constructor(config) {
419
+ this._config = config;
420
+ }
326
421
  /**
327
- * Mass messages chart
422
+ * Get earnings chart
328
423
  */
329
424
  getChart(params) {
330
425
  return request(this._config, {
331
- path: "/v2/access/analytics/mass-messages/chart",
426
+ path: "/v2/access/earnings/chart",
332
427
  method: "GET",
333
428
  query: {
334
429
  "startDate": params.startDate,
335
430
  "endDate": params.endDate,
336
- "withTotal": params.withTotal
431
+ "by": params.by,
432
+ "withTotal": params.withTotal,
433
+ "monthlyTotal": params.monthlyTotal
337
434
  }
338
435
  });
339
436
  }
340
437
  /**
341
- * Mass messages purchased
438
+ * List transactions
342
439
  */
343
- getPurchased(params) {
440
+ listTransactions(params) {
344
441
  return request(this._config, {
345
- path: "/v2/access/analytics/mass-messages/purchased",
442
+ path: "/v2/access/earnings/transactions",
346
443
  method: "GET",
347
444
  query: {
348
- "limit": params.limit,
349
- "offset": params.offset
350
- }
351
- });
445
+ "startDate": params.startDate,
446
+ "marker": params.marker,
447
+ "type": params.type,
448
+ "tipsSource": params.tipsSource
449
+ }
450
+ });
451
+ }
452
+ /**
453
+ * List transactions
454
+ *
455
+ * Returns an async iterator that automatically paginates through all results.
456
+ */
457
+ async *iterateTransactions(params) {
458
+ let marker;
459
+ let fetched = 0;
460
+ const maxItems = params?.maxItems ?? Infinity;
461
+ while (fetched < maxItems) {
462
+ const response = await this.listTransactions({
463
+ ...params,
464
+ marker
465
+ });
466
+ for (const item of response.list) {
467
+ if (fetched >= maxItems) return;
468
+ yield item;
469
+ fetched++;
470
+ }
471
+ if (!response.hasMore) return;
472
+ marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
473
+ }
474
+ }
475
+ /**
476
+ * List chargebacks
477
+ */
478
+ listChargebacks(params) {
479
+ return request(this._config, {
480
+ path: "/v2/access/earnings/chargebacks",
481
+ method: "GET",
482
+ query: {
483
+ "startDate": params.startDate,
484
+ "endDate": params.endDate,
485
+ "marker": params.marker
486
+ }
487
+ });
488
+ }
489
+ /**
490
+ * List chargebacks
491
+ *
492
+ * Returns an async iterator that automatically paginates through all results.
493
+ */
494
+ async *iterateChargebacks(params) {
495
+ let marker;
496
+ let fetched = 0;
497
+ const maxItems = params?.maxItems ?? Infinity;
498
+ while (fetched < maxItems) {
499
+ const response = await this.listChargebacks({
500
+ ...params,
501
+ marker
502
+ });
503
+ for (const item of response.list) {
504
+ if (fetched >= maxItems) return;
505
+ yield item;
506
+ fetched++;
507
+ }
508
+ if (!response.hasMore) return;
509
+ marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
510
+ }
352
511
  }
353
512
  };
354
513
  var AccessAnalyticsPostsNamespace = class {
@@ -396,36 +555,38 @@ var AccessAnalyticsPostsNamespace = class {
396
555
  });
397
556
  }
398
557
  };
399
- var AccessAnalyticsPromotionsNamespace = class {
558
+ var AccessAnalyticsStreamsNamespace = class {
400
559
  constructor(config) {
401
560
  this._config = config;
402
561
  }
403
562
  /**
404
- * Promotions chart
563
+ * Streams chart
405
564
  */
406
565
  getChart(params) {
407
566
  return request(this._config, {
408
- path: "/v2/access/analytics/promotions/chart",
567
+ path: "/v2/access/analytics/streams/chart",
409
568
  method: "GET",
410
569
  query: {
411
570
  "startDate": params.startDate,
412
571
  "endDate": params.endDate,
413
- "withTotal": params.withTotal
572
+ "withTotal": params.withTotal,
573
+ "by": params.by
414
574
  }
415
575
  });
416
576
  }
417
577
  /**
418
- * Top promotions
578
+ * Top streams
419
579
  */
420
580
  getTop(params) {
421
581
  return request(this._config, {
422
- path: "/v2/access/analytics/promotions/top",
582
+ path: "/v2/access/analytics/streams/top",
423
583
  method: "GET",
424
584
  query: {
425
- "limit": params.limit,
426
- "offset": params.offset,
585
+ "by": params.by,
427
586
  "startDate": params.startDate,
428
- "endDate": params.endDate
587
+ "endDate": params.endDate,
588
+ "limit": params.limit,
589
+ "offset": params.offset
429
590
  }
430
591
  });
431
592
  }
@@ -466,52 +627,99 @@ var AccessAnalyticsStoriesNamespace = class {
466
627
  });
467
628
  }
468
629
  };
469
- var AccessAnalyticsStreamsNamespace = class {
630
+ var AccessAnalyticsMassMessagesNamespace = class {
470
631
  constructor(config) {
471
632
  this._config = config;
472
633
  }
473
634
  /**
474
- * Streams chart
635
+ * Mass messages chart
475
636
  */
476
637
  getChart(params) {
477
638
  return request(this._config, {
478
- path: "/v2/access/analytics/streams/chart",
639
+ path: "/v2/access/analytics/mass-messages/chart",
479
640
  method: "GET",
480
641
  query: {
481
642
  "startDate": params.startDate,
482
643
  "endDate": params.endDate,
483
- "withTotal": params.withTotal,
484
- "by": params.by
644
+ "withTotal": params.withTotal
485
645
  }
486
646
  });
487
647
  }
488
648
  /**
489
- * Top streams
649
+ * Sent mass messages
490
650
  */
491
- getTop(params) {
651
+ getSent(params) {
492
652
  return request(this._config, {
493
- path: "/v2/access/analytics/streams/top",
653
+ path: "/v2/access/analytics/mass-messages/sent",
494
654
  method: "GET",
495
655
  query: {
496
- "by": params.by,
497
656
  "startDate": params.startDate,
498
657
  "endDate": params.endDate,
658
+ "limit": params.limit
659
+ }
660
+ });
661
+ }
662
+ /**
663
+ * Mass messages purchased
664
+ */
665
+ getPurchased(params) {
666
+ return request(this._config, {
667
+ path: "/v2/access/analytics/mass-messages/purchased",
668
+ method: "GET",
669
+ query: {
499
670
  "limit": params.limit,
500
671
  "offset": params.offset
501
672
  }
502
673
  });
503
674
  }
675
+ /**
676
+ * Mass message buyers
677
+ */
678
+ listBuyers(params) {
679
+ return request(this._config, {
680
+ path: `/v2/access/analytics/mass-messages/${encodeURIComponent(String(params.massMessageId))}/buyers`,
681
+ method: "GET",
682
+ query: {
683
+ "limit": params.limit,
684
+ "offset": params.offset,
685
+ "marker": params.marker
686
+ }
687
+ });
688
+ }
689
+ /**
690
+ * Mass message buyers
691
+ *
692
+ * Returns an async iterator that automatically paginates through all results.
693
+ */
694
+ async *iterateBuyers(params) {
695
+ let marker;
696
+ let fetched = 0;
697
+ const maxItems = params?.maxItems ?? Infinity;
698
+ while (fetched < maxItems) {
699
+ const response = await this.listBuyers({
700
+ ...params,
701
+ marker
702
+ });
703
+ for (const item of response.list) {
704
+ if (fetched >= maxItems) return;
705
+ yield item;
706
+ fetched++;
707
+ }
708
+ if (!response.hasMore) return;
709
+ marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
710
+ }
711
+ }
504
712
  };
505
- var AccessAnalyticsTrialsNamespace = class {
713
+ var AccessAnalyticsPromotionsNamespace = class {
506
714
  constructor(config) {
507
715
  this._config = config;
508
716
  }
509
717
  /**
510
- * Trials chart
718
+ * Promotions chart
511
719
  */
512
720
  getChart(params) {
513
721
  return request(this._config, {
514
- path: "/v2/access/analytics/trials/chart",
722
+ path: "/v2/access/analytics/promotions/chart",
515
723
  method: "GET",
516
724
  query: {
517
725
  "startDate": params.startDate,
@@ -521,11 +729,11 @@ var AccessAnalyticsTrialsNamespace = class {
521
729
  });
522
730
  }
523
731
  /**
524
- * Top trials
732
+ * Top promotions
525
733
  */
526
734
  getTop(params) {
527
735
  return request(this._config, {
528
- path: "/v2/access/analytics/trials/top",
736
+ path: "/v2/access/analytics/promotions/top",
529
737
  method: "GET",
530
738
  query: {
531
739
  "limit": params.limit,
@@ -536,129 +744,85 @@ var AccessAnalyticsTrialsNamespace = class {
536
744
  });
537
745
  }
538
746
  };
539
- var AccessAnalyticsVisitorCountriesNamespace = class {
747
+ var AccessAnalyticsTrialsNamespace = class {
540
748
  constructor(config) {
541
749
  this._config = config;
542
750
  }
543
751
  /**
544
- * Visitor countries chart
752
+ * Trials chart
545
753
  */
546
754
  getChart(params) {
547
755
  return request(this._config, {
548
- path: "/v2/access/analytics/visitor-countries/chart",
756
+ path: "/v2/access/analytics/trials/chart",
549
757
  method: "GET",
550
758
  query: {
551
759
  "startDate": params.startDate,
552
760
  "endDate": params.endDate,
553
- "by": params.by
761
+ "withTotal": params.withTotal
554
762
  }
555
763
  });
556
764
  }
557
765
  /**
558
- * Top visitor countries
766
+ * Top trials
559
767
  */
560
768
  getTop(params) {
561
769
  return request(this._config, {
562
- path: "/v2/access/analytics/visitor-countries/top",
770
+ path: "/v2/access/analytics/trials/top",
563
771
  method: "GET",
564
772
  query: {
773
+ "limit": params.limit,
774
+ "offset": params.offset,
565
775
  "startDate": params.startDate,
566
- "endDate": params.endDate,
567
- "by": params.by
776
+ "endDate": params.endDate
568
777
  }
569
778
  });
570
779
  }
571
780
  };
572
- var AccessAnalyticsNamespace = class {
573
- constructor(config) {
574
- this._config = config;
575
- this.campaigns = new AccessAnalyticsCampaignsNamespace(config);
576
- this.earnings = new AccessAnalyticsEarningsNamespace(config);
577
- this.massMessages = new AccessAnalyticsMassMessagesNamespace(config);
578
- this.posts = new AccessAnalyticsPostsNamespace(config);
579
- this.promotions = new AccessAnalyticsPromotionsNamespace(config);
580
- this.stories = new AccessAnalyticsStoriesNamespace(config);
581
- this.streams = new AccessAnalyticsStreamsNamespace(config);
582
- this.trials = new AccessAnalyticsTrialsNamespace(config);
583
- this.visitorCountries = new AccessAnalyticsVisitorCountriesNamespace(config);
584
- }
585
- };
586
- var AccessChatsNamespace = class {
781
+ var AccessAnalyticsCampaignsNamespace = class {
587
782
  constructor(config) {
588
783
  this._config = config;
589
784
  }
590
785
  /**
591
- * Chats list
786
+ * Campaigns chart
592
787
  */
593
- list(params) {
788
+ getChart(params) {
594
789
  return request(this._config, {
595
- path: "/v2/access/chats",
790
+ path: "/v2/access/analytics/campaigns/chart",
596
791
  method: "GET",
597
792
  query: {
598
- "limit": params.limit,
599
- "offset": params.offset,
600
- "order": params.order,
601
- "filter": params.filter,
602
- "query": params.query,
603
- "userListId": params.userListId
793
+ "startDate": params.startDate,
794
+ "endDate": params.endDate,
795
+ "withTotal": params.withTotal
604
796
  }
605
797
  });
606
798
  }
607
799
  /**
608
- * Chats list
609
- *
610
- * Returns an async iterator that automatically paginates through all results.
611
- */
612
- async *iterate(params) {
613
- let offset = 0;
614
- let fetched = 0;
615
- const limit = params?.pageSize ?? 20;
616
- const maxItems = params?.maxItems ?? Infinity;
617
- while (fetched < maxItems) {
618
- const response = await this.list({
619
- ...params,
620
- limit: Math.min(limit, maxItems - fetched),
621
- offset
622
- });
623
- for (const item of response.list) {
624
- if (fetched >= maxItems) return;
625
- yield item;
626
- fetched++;
627
- }
628
- if (!response.hasMore) return;
629
- const nextOffset = response.nextOffset;
630
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
631
- }
632
- }
633
- /**
634
- * Get chat media
800
+ * Top campaigns
635
801
  */
636
- listMedia(params) {
802
+ getTop(params) {
637
803
  return request(this._config, {
638
- path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/media`,
804
+ path: "/v2/access/analytics/campaigns/top",
639
805
  method: "GET",
640
806
  query: {
641
807
  "limit": params.limit,
642
808
  "offset": params.offset,
643
- "skip_users": params.skipUsers,
644
- "last_id": params.lastId,
645
- "opened": params.opened,
646
- "type": params.type
809
+ "startDate": params.startDate,
810
+ "endDate": params.endDate
647
811
  }
648
812
  });
649
813
  }
650
814
  /**
651
- * Get chat media
815
+ * Top campaigns
652
816
  *
653
817
  * Returns an async iterator that automatically paginates through all results.
654
818
  */
655
- async *iterateMedia(params) {
819
+ async *iterateTop(params) {
656
820
  let offset = 0;
657
821
  let fetched = 0;
658
822
  const limit = params?.pageSize ?? 20;
659
823
  const maxItems = params?.maxItems ?? Infinity;
660
824
  while (fetched < maxItems) {
661
- const response = await this.listMedia({
825
+ const response = await this.getTop({
662
826
  ...params,
663
827
  limit: Math.min(limit, maxItems - fetched),
664
828
  offset
@@ -673,188 +837,73 @@ var AccessChatsNamespace = class {
673
837
  offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
674
838
  }
675
839
  }
840
+ };
841
+ var AccessAnalyticsVisitorCountriesNamespace = class {
842
+ constructor(config) {
843
+ this._config = config;
844
+ }
676
845
  /**
677
- * Chat messages
678
- */
679
- listMessages(params) {
680
- return request(this._config, {
681
- path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/messages`,
682
- method: "GET",
683
- query: {
684
- "limit": params.limit,
685
- "offset": params.offset,
686
- "query": params.query,
687
- "id": params.id,
688
- "first_id": params.firstId
689
- }
690
- });
691
- }
692
- /**
693
- * Chat messages
694
- *
695
- * Returns an async iterator that automatically paginates through all results.
696
- */
697
- async *iterateMessages(params) {
698
- let offset = 0;
699
- let fetched = 0;
700
- const limit = params?.pageSize ?? 20;
701
- const maxItems = params?.maxItems ?? Infinity;
702
- while (fetched < maxItems) {
703
- const response = await this.listMessages({
704
- ...params,
705
- limit: Math.min(limit, maxItems - fetched),
706
- offset
707
- });
708
- for (const item of response.list) {
709
- if (fetched >= maxItems) return;
710
- yield item;
711
- fetched++;
712
- }
713
- if (!response.hasMore) return;
714
- const nextOffset = response.nextOffset;
715
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
716
- }
717
- }
718
- /**
719
- * Send chat message
720
- */
721
- createMessages(params) {
722
- return request(this._config, {
723
- path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/messages`,
724
- method: "POST",
725
- body: params.body
726
- });
727
- }
728
- /**
729
- * Unsend chat message
730
- */
731
- deleteMessages(params) {
732
- return request(this._config, {
733
- path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/messages/${encodeURIComponent(String(params.messageId))}`,
734
- method: "DELETE",
735
- body: params.body
736
- });
737
- }
738
- };
739
- var AccessEarningsNamespace = class {
740
- constructor(config) {
741
- this._config = config;
742
- }
743
- /**
744
- * List chargebacks
745
- */
746
- listChargebacks(params) {
747
- return request(this._config, {
748
- path: "/v2/access/earnings/chargebacks",
749
- method: "GET",
750
- query: {
751
- "startDate": params.startDate,
752
- "endDate": params.endDate,
753
- "marker": params.marker
754
- }
755
- });
756
- }
757
- /**
758
- * List chargebacks
759
- *
760
- * Returns an async iterator that automatically paginates through all results.
761
- */
762
- async *iterateChargebacks(params) {
763
- let marker;
764
- let fetched = 0;
765
- const maxItems = params?.maxItems ?? Infinity;
766
- while (fetched < maxItems) {
767
- const response = await this.listChargebacks({
768
- ...params,
769
- marker
770
- });
771
- for (const item of response.list) {
772
- if (fetched >= maxItems) return;
773
- yield item;
774
- fetched++;
775
- }
776
- if (!response.hasMore) return;
777
- marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
778
- }
779
- }
780
- /**
781
- * Get earnings chart
846
+ * Visitor countries chart
782
847
  */
783
848
  getChart(params) {
784
849
  return request(this._config, {
785
- path: "/v2/access/earnings/chart",
850
+ path: "/v2/access/analytics/visitor-countries/chart",
786
851
  method: "GET",
787
852
  query: {
788
853
  "startDate": params.startDate,
789
854
  "endDate": params.endDate,
790
- "by": params.by,
791
- "withTotal": params.withTotal,
792
- "monthlyTotal": params.monthlyTotal
855
+ "by": params.by
793
856
  }
794
857
  });
795
858
  }
796
859
  /**
797
- * List transactions
860
+ * Top visitor countries
798
861
  */
799
- listTransactions(params) {
862
+ getTop(params) {
800
863
  return request(this._config, {
801
- path: "/v2/access/earnings/transactions",
864
+ path: "/v2/access/analytics/visitor-countries/top",
802
865
  method: "GET",
803
866
  query: {
804
867
  "startDate": params.startDate,
805
- "marker": params.marker,
806
- "type": params.type,
807
- "tipsSource": params.tipsSource
868
+ "endDate": params.endDate,
869
+ "by": params.by
808
870
  }
809
871
  });
810
872
  }
811
- /**
812
- * List transactions
813
- *
814
- * Returns an async iterator that automatically paginates through all results.
815
- */
816
- async *iterateTransactions(params) {
817
- let marker;
818
- let fetched = 0;
819
- const maxItems = params?.maxItems ?? Infinity;
820
- while (fetched < maxItems) {
821
- const response = await this.listTransactions({
822
- ...params,
823
- marker
824
- });
825
- for (const item of response.list) {
826
- if (fetched >= maxItems) return;
827
- yield item;
828
- fetched++;
829
- }
830
- if (!response.hasMore) return;
831
- marker = response.nextMarker == null ? void 0 : String(response.nextMarker);
832
- }
873
+ };
874
+ var AccessAnalyticsNamespace = class {
875
+ constructor(config) {
876
+ this._config = config;
877
+ this.posts = new AccessAnalyticsPostsNamespace(config);
878
+ this.streams = new AccessAnalyticsStreamsNamespace(config);
879
+ this.stories = new AccessAnalyticsStoriesNamespace(config);
880
+ this.massMessages = new AccessAnalyticsMassMessagesNamespace(config);
881
+ this.promotions = new AccessAnalyticsPromotionsNamespace(config);
882
+ this.trials = new AccessAnalyticsTrialsNamespace(config);
883
+ this.campaigns = new AccessAnalyticsCampaignsNamespace(config);
884
+ this.visitorCountries = new AccessAnalyticsVisitorCountriesNamespace(config);
833
885
  }
834
886
  };
835
- var AccessPromotionsTrackingLinksNamespace = class {
887
+ var AccessUsersListsNamespace = class {
836
888
  constructor(config) {
837
889
  this._config = config;
838
890
  }
839
891
  /**
840
- * List tracking links
892
+ * List user lists
841
893
  */
842
894
  list(params) {
843
895
  return request(this._config, {
844
- path: "/v2/access/promotions/tracking-links",
896
+ path: "/v2/access/users/lists",
845
897
  method: "GET",
846
898
  query: {
847
899
  "limit": params.limit,
848
900
  "offset": params.offset,
849
- "pagination": params.pagination,
850
- "with_deleted": params.withDeleted,
851
- "sorting_deleted": params.sortingDeleted,
852
- "stats": params.stats
901
+ "query": params.query
853
902
  }
854
903
  });
855
904
  }
856
905
  /**
857
- * List tracking links
906
+ * List user lists
858
907
  *
859
908
  * Returns an async iterator that automatically paginates through all results.
860
909
  */
@@ -880,83 +929,59 @@ var AccessPromotionsTrackingLinksNamespace = class {
880
929
  }
881
930
  }
882
931
  /**
883
- * Create tracking link
932
+ * Create user list
884
933
  */
885
934
  create(params) {
886
935
  return request(this._config, {
887
- path: "/v2/access/promotions/tracking-links",
936
+ path: "/v2/access/users/lists",
888
937
  method: "POST",
889
938
  body: params.body
890
939
  });
891
940
  }
892
941
  /**
893
- * Get tracking link
942
+ * Get user list
894
943
  */
895
944
  get(params) {
896
945
  return request(this._config, {
897
- path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}`,
946
+ path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}`,
898
947
  method: "GET"
899
948
  });
900
949
  }
901
950
  /**
902
- * Update tracking link
951
+ * Update user list
903
952
  */
904
- replace(params) {
953
+ update(params) {
905
954
  return request(this._config, {
906
- path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}`,
907
- method: "PUT",
955
+ path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}`,
956
+ method: "PATCH",
908
957
  body: params.body
909
958
  });
910
959
  }
911
960
  /**
912
- * Delete tracking link
961
+ * Delete user list
913
962
  */
914
963
  delete(params) {
915
964
  return request(this._config, {
916
- path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}`,
965
+ path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}`,
917
966
  method: "DELETE"
918
967
  });
919
968
  }
920
969
  /**
921
- * Get tracking link claimers
922
- */
923
- listClaimers(params) {
924
- return request(this._config, {
925
- path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}/claimers`,
926
- method: "GET"
927
- });
928
- }
929
- /**
930
- * Share tracking link access
970
+ * Add user to multiple lists
931
971
  */
932
- createShareAccess(params) {
972
+ create2(params) {
933
973
  return request(this._config, {
934
- path: "/v2/access/promotions/tracking-links/share-access",
974
+ path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/lists`,
935
975
  method: "POST",
936
976
  body: params.body
937
977
  });
938
978
  }
939
979
  /**
940
- * Revoke tracking link access
941
- */
942
- deleteShareAccess(params) {
943
- return request(this._config, {
944
- path: "/v2/access/promotions/tracking-links/share-access",
945
- method: "DELETE",
946
- body: params.body
947
- });
948
- }
949
- };
950
- var AccessPromotionsTrialLinksNamespace = class {
951
- constructor(config) {
952
- this._config = config;
953
- }
954
- /**
955
- * List trial links
980
+ * List users in user list
956
981
  */
957
- list(params) {
982
+ listUsers(params) {
958
983
  return request(this._config, {
959
- path: "/v2/access/promotions/trial-links",
984
+ path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}/users`,
960
985
  method: "GET",
961
986
  query: {
962
987
  "limit": params.limit,
@@ -965,76 +990,87 @@ var AccessPromotionsTrialLinksNamespace = class {
965
990
  });
966
991
  }
967
992
  /**
968
- * Create trial link
969
- */
970
- create(params) {
971
- return request(this._config, {
972
- path: "/v2/access/promotions/trial-links",
973
- method: "POST",
974
- body: params.body
975
- });
976
- }
977
- /**
978
- * Get trial link
979
- */
980
- get(params) {
981
- return request(this._config, {
982
- path: `/v2/access/promotions/trial-links/${encodeURIComponent(String(params.trialLinkId))}`,
983
- method: "GET"
984
- });
993
+ * List users in user list
994
+ *
995
+ * Returns an async iterator that automatically paginates through all results.
996
+ */
997
+ async *iterateUsers(params) {
998
+ let offset = 0;
999
+ let fetched = 0;
1000
+ const limit = params?.pageSize ?? 20;
1001
+ const maxItems = params?.maxItems ?? Infinity;
1002
+ while (fetched < maxItems) {
1003
+ const response = await this.listUsers({
1004
+ ...params,
1005
+ limit: Math.min(limit, maxItems - fetched),
1006
+ offset
1007
+ });
1008
+ for (const item of response.list) {
1009
+ if (fetched >= maxItems) return;
1010
+ yield item;
1011
+ fetched++;
1012
+ }
1013
+ if (!response.hasMore) return;
1014
+ const nextOffset = response.nextOffset;
1015
+ offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1016
+ }
985
1017
  }
986
1018
  /**
987
- * Update trial link
1019
+ * Add user to list
988
1020
  */
989
- replace(params) {
1021
+ createUsers(params) {
990
1022
  return request(this._config, {
991
- path: `/v2/access/promotions/trial-links/${encodeURIComponent(String(params.trialLinkId))}`,
992
- method: "PUT",
993
- body: params.body
1023
+ path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}/users/${encodeURIComponent(String(params.userId))}`,
1024
+ method: "POST"
994
1025
  });
995
1026
  }
996
1027
  /**
997
- * Delete trial link
1028
+ * Remove user from user list
998
1029
  */
999
- delete(params) {
1030
+ deleteUsers(params) {
1000
1031
  return request(this._config, {
1001
- path: `/v2/access/promotions/trial-links/${encodeURIComponent(String(params.trialLinkId))}`,
1032
+ path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}/users/${encodeURIComponent(String(params.userId))}`,
1002
1033
  method: "DELETE"
1003
1034
  });
1004
1035
  }
1036
+ };
1037
+ var AccessUsersNamespace = class {
1038
+ constructor(config) {
1039
+ this._config = config;
1040
+ this.lists = new AccessUsersListsNamespace(config);
1041
+ }
1005
1042
  /**
1006
- * Share trial link access
1043
+ * Get user
1007
1044
  */
1008
- createShareAccess(params) {
1045
+ get(params) {
1009
1046
  return request(this._config, {
1010
- path: "/v2/access/promotions/trial-links/share-access",
1011
- method: "POST",
1012
- body: params.body
1047
+ path: `/v2/access/users/${encodeURIComponent(String(params.userId))}`,
1048
+ method: "GET"
1013
1049
  });
1014
1050
  }
1015
1051
  /**
1016
- * Revoke trial link access
1052
+ * List user posts
1017
1053
  */
1018
- deleteShareAccess(params) {
1054
+ listPosts(params) {
1019
1055
  return request(this._config, {
1020
- path: "/v2/access/promotions/trial-links/share-access",
1021
- method: "DELETE",
1022
- body: params.body
1056
+ path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/posts`,
1057
+ method: "GET",
1058
+ query: {
1059
+ "limit": params.limit,
1060
+ "sortBy": params.sortBy,
1061
+ "sortDirection": params.sortDirection,
1062
+ "pinned": params.pinned,
1063
+ "includePostCounts": params.includePostCounts,
1064
+ "beforePublishTime": params.beforePublishTime
1065
+ }
1023
1066
  });
1024
1067
  }
1025
- };
1026
- var AccessPromotionsNamespace = class {
1027
- constructor(config) {
1028
- this._config = config;
1029
- this.trackingLinks = new AccessPromotionsTrackingLinksNamespace(config);
1030
- this.trialLinks = new AccessPromotionsTrialLinksNamespace(config);
1031
- }
1032
1068
  /**
1033
- * List promotions
1069
+ * List restricted users
1034
1070
  */
1035
- list(params) {
1071
+ getRestrict(params) {
1036
1072
  return request(this._config, {
1037
- path: "/v2/access/promotions",
1073
+ path: "/v2/access/users/restrict",
1038
1074
  method: "GET",
1039
1075
  query: {
1040
1076
  "limit": params.limit,
@@ -1043,49 +1079,55 @@ var AccessPromotionsNamespace = class {
1043
1079
  });
1044
1080
  }
1045
1081
  /**
1046
- * Create promotion
1047
- */
1048
- create(params) {
1049
- return request(this._config, {
1050
- path: "/v2/access/promotions",
1051
- method: "POST",
1052
- body: params.body
1053
- });
1082
+ * List restricted users
1083
+ *
1084
+ * Returns an async iterator that automatically paginates through all results.
1085
+ */
1086
+ async *iterateRestrict(params) {
1087
+ let offset = 0;
1088
+ let fetched = 0;
1089
+ const limit = params?.pageSize ?? 20;
1090
+ const maxItems = params?.maxItems ?? Infinity;
1091
+ while (fetched < maxItems) {
1092
+ const response = await this.getRestrict({
1093
+ ...params,
1094
+ limit: Math.min(limit, maxItems - fetched),
1095
+ offset
1096
+ });
1097
+ for (const item of response.list) {
1098
+ if (fetched >= maxItems) return;
1099
+ yield item;
1100
+ fetched++;
1101
+ }
1102
+ if (!response.hasMore) return;
1103
+ const nextOffset = response.nextOffset;
1104
+ offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1105
+ }
1054
1106
  }
1055
1107
  /**
1056
- * Update promotion
1108
+ * Restrict user
1057
1109
  */
1058
- replace(params) {
1110
+ restrict(params) {
1059
1111
  return request(this._config, {
1060
- path: `/v2/access/promotions/${encodeURIComponent(String(params.promotionId))}`,
1061
- method: "PUT",
1062
- body: params.body
1112
+ path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/restrict`,
1113
+ method: "POST"
1063
1114
  });
1064
1115
  }
1065
1116
  /**
1066
- * Delete promotion
1117
+ * Unrestrict user
1067
1118
  */
1068
- delete(params) {
1119
+ restrict2(params) {
1069
1120
  return request(this._config, {
1070
- path: `/v2/access/promotions/${encodeURIComponent(String(params.promotionId))}`,
1121
+ path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/restrict`,
1071
1122
  method: "DELETE"
1072
1123
  });
1073
1124
  }
1074
1125
  /**
1075
- * Stop promotion
1076
- */
1077
- createStop(params) {
1078
- return request(this._config, {
1079
- path: `/v2/access/promotions/${encodeURIComponent(String(params.promotionId))}/stop`,
1080
- method: "POST"
1081
- });
1082
- }
1083
- /**
1084
- * List bundles
1126
+ * List blocked users
1085
1127
  */
1086
- listBundles(params) {
1128
+ getBlocked(params) {
1087
1129
  return request(this._config, {
1088
- path: "/v2/access/promotions/bundles",
1130
+ path: "/v2/access/users/blocked",
1089
1131
  method: "GET",
1090
1132
  query: {
1091
1133
  "limit": params.limit,
@@ -1094,94 +1136,91 @@ var AccessPromotionsNamespace = class {
1094
1136
  });
1095
1137
  }
1096
1138
  /**
1097
- * Create bundle
1098
- */
1099
- createBundles(params) {
1100
- return request(this._config, {
1101
- path: "/v2/access/promotions/bundles",
1102
- method: "POST",
1103
- body: params.body
1104
- });
1105
- }
1106
- /**
1107
- * Get bundle
1108
- */
1109
- getBundles(params) {
1110
- return request(this._config, {
1111
- path: `/v2/access/promotions/bundles/${encodeURIComponent(String(params.bundleId))}`,
1112
- method: "GET"
1113
- });
1139
+ * List blocked users
1140
+ *
1141
+ * Returns an async iterator that automatically paginates through all results.
1142
+ */
1143
+ async *iterateBlocked(params) {
1144
+ let offset = 0;
1145
+ let fetched = 0;
1146
+ const limit = params?.pageSize ?? 20;
1147
+ const maxItems = params?.maxItems ?? Infinity;
1148
+ while (fetched < maxItems) {
1149
+ const response = await this.getBlocked({
1150
+ ...params,
1151
+ limit: Math.min(limit, maxItems - fetched),
1152
+ offset
1153
+ });
1154
+ for (const item of response.list) {
1155
+ if (fetched >= maxItems) return;
1156
+ yield item;
1157
+ fetched++;
1158
+ }
1159
+ if (!response.hasMore) return;
1160
+ const nextOffset = response.nextOffset;
1161
+ offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1162
+ }
1114
1163
  }
1115
1164
  /**
1116
- * Update bundle
1165
+ * List users by IDs
1117
1166
  */
1118
- replaceBundles(params) {
1167
+ getList(params) {
1119
1168
  return request(this._config, {
1120
- path: `/v2/access/promotions/bundles/${encodeURIComponent(String(params.bundleId))}`,
1121
- method: "PUT",
1122
- body: params.body
1169
+ path: "/v2/access/users/list",
1170
+ method: "GET",
1171
+ query: {
1172
+ "userIds": params.userIds
1173
+ }
1123
1174
  });
1124
1175
  }
1125
1176
  /**
1126
- * Delete bundle
1177
+ * Search performers
1127
1178
  */
1128
- deleteBundles(params) {
1179
+ search(params) {
1129
1180
  return request(this._config, {
1130
- path: `/v2/access/promotions/bundles/${encodeURIComponent(String(params.bundleId))}`,
1131
- method: "DELETE"
1181
+ path: "/v2/access/users/search",
1182
+ method: "GET",
1183
+ query: {
1184
+ "limit": params.limit,
1185
+ "offset": params.offset,
1186
+ "query": params.query
1187
+ }
1132
1188
  });
1133
1189
  }
1134
1190
  };
1135
- var AccessSelfNamespace = class {
1191
+ var AccessChatsNamespace = class {
1136
1192
  constructor(config) {
1137
1193
  this._config = config;
1138
1194
  }
1139
1195
  /**
1140
- * Get current user
1141
- */
1142
- get() {
1143
- return request(this._config, {
1144
- path: "/v2/access/self",
1145
- method: "GET"
1146
- });
1147
- }
1148
- /**
1149
- * Update current user profile
1150
- */
1151
- update(params) {
1152
- return request(this._config, {
1153
- path: "/v2/access/self",
1154
- method: "PATCH",
1155
- body: params.body
1156
- });
1157
- }
1158
- /**
1159
- * List notifications
1196
+ * Chats list
1160
1197
  */
1161
- listNotifications(params) {
1198
+ list(params) {
1162
1199
  return request(this._config, {
1163
- path: "/v2/access/self/notifications",
1200
+ path: "/v2/access/chats",
1164
1201
  method: "GET",
1165
1202
  query: {
1166
1203
  "limit": params.limit,
1167
1204
  "offset": params.offset,
1168
- "type": params.type,
1169
- "relatedUsername": params.relatedUsername
1205
+ "order": params.order,
1206
+ "filter": params.filter,
1207
+ "query": params.query,
1208
+ "userListId": params.userListId
1170
1209
  }
1171
1210
  });
1172
1211
  }
1173
1212
  /**
1174
- * List notifications
1213
+ * Chats list
1175
1214
  *
1176
1215
  * Returns an async iterator that automatically paginates through all results.
1177
1216
  */
1178
- async *iterateNotifications(params) {
1217
+ async *iterate(params) {
1179
1218
  let offset = 0;
1180
1219
  let fetched = 0;
1181
1220
  const limit = params?.pageSize ?? 20;
1182
1221
  const maxItems = params?.maxItems ?? Infinity;
1183
1222
  while (fetched < maxItems) {
1184
- const response = await this.listNotifications({
1223
+ const response = await this.list({
1185
1224
  ...params,
1186
1225
  limit: Math.min(limit, maxItems - fetched),
1187
1226
  offset
@@ -1197,34 +1236,34 @@ var AccessSelfNamespace = class {
1197
1236
  }
1198
1237
  }
1199
1238
  /**
1200
- * List release forms
1239
+ * Chat messages
1201
1240
  */
1202
- listReleaseForms(params) {
1241
+ listMessages(params) {
1203
1242
  return request(this._config, {
1204
- path: "/v2/access/self/release-forms",
1243
+ path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/messages`,
1205
1244
  method: "GET",
1206
1245
  query: {
1207
1246
  "limit": params.limit,
1208
1247
  "offset": params.offset,
1209
- "filter": params.filter,
1210
- "sortBy": params.sortBy,
1211
- "sortDirection": params.sortDirection,
1212
- "search": params.search
1248
+ "query": params.query,
1249
+ "last_id": params.lastId,
1250
+ "first_id": params.firstId,
1251
+ "include_users": params.includeUsers
1213
1252
  }
1214
1253
  });
1215
1254
  }
1216
1255
  /**
1217
- * List release forms
1256
+ * Chat messages
1218
1257
  *
1219
1258
  * Returns an async iterator that automatically paginates through all results.
1220
1259
  */
1221
- async *iterateReleaseForms(params) {
1260
+ async *iterateMessages(params) {
1222
1261
  let offset = 0;
1223
1262
  let fetched = 0;
1224
1263
  const limit = params?.pageSize ?? 20;
1225
1264
  const maxItems = params?.maxItems ?? Infinity;
1226
1265
  while (fetched < maxItems) {
1227
- const response = await this.listReleaseForms({
1266
+ const response = await this.listMessages({
1228
1267
  ...params,
1229
1268
  limit: Math.min(limit, maxItems - fetched),
1230
1269
  offset
@@ -1240,34 +1279,54 @@ var AccessSelfNamespace = class {
1240
1279
  }
1241
1280
  }
1242
1281
  /**
1243
- * List tagged friend users
1282
+ * Send chat message
1244
1283
  */
1245
- listTaggedFriendUsers(params) {
1284
+ createMessages(params) {
1246
1285
  return request(this._config, {
1247
- path: "/v2/access/self/tagged-friend-users",
1286
+ path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/messages`,
1287
+ method: "POST",
1288
+ body: params.body
1289
+ });
1290
+ }
1291
+ /**
1292
+ * Unsend chat message
1293
+ */
1294
+ deleteMessages(params) {
1295
+ return request(this._config, {
1296
+ path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/messages/${encodeURIComponent(String(params.messageId))}`,
1297
+ method: "DELETE",
1298
+ body: params.body
1299
+ });
1300
+ }
1301
+ /**
1302
+ * Get chat media
1303
+ */
1304
+ listMedia(params) {
1305
+ return request(this._config, {
1306
+ path: `/v2/access/chats/${encodeURIComponent(String(params.userId))}/media`,
1248
1307
  method: "GET",
1249
1308
  query: {
1250
1309
  "limit": params.limit,
1251
1310
  "offset": params.offset,
1252
- "filter": params.filter,
1253
- "sortBy": params.sortBy,
1254
- "sortDirection": params.sortDirection,
1255
- "search": params.search
1311
+ "skip_users": params.skipUsers,
1312
+ "last_id": params.lastId,
1313
+ "opened": params.opened,
1314
+ "type": params.type
1256
1315
  }
1257
1316
  });
1258
1317
  }
1259
1318
  /**
1260
- * List tagged friend users
1319
+ * Get chat media
1261
1320
  *
1262
1321
  * Returns an async iterator that automatically paginates through all results.
1263
1322
  */
1264
- async *iterateTaggedFriendUsers(params) {
1323
+ async *iterateMedia(params) {
1265
1324
  let offset = 0;
1266
1325
  let fetched = 0;
1267
1326
  const limit = params?.pageSize ?? 20;
1268
1327
  const maxItems = params?.maxItems ?? Infinity;
1269
1328
  while (fetched < maxItems) {
1270
- const response = await this.listTaggedFriendUsers({
1329
+ const response = await this.listMedia({
1271
1330
  ...params,
1272
1331
  limit: Math.min(limit, maxItems - fetched),
1273
1332
  offset
@@ -1333,11 +1392,11 @@ var AccessSubscribersNamespace = class {
1333
1392
  }
1334
1393
  }
1335
1394
  /**
1336
- * Set custom name for subscriber
1395
+ * Update subscriber note
1337
1396
  */
1338
- setCustomName(params) {
1397
+ setNote(params) {
1339
1398
  return request(this._config, {
1340
- path: `/v2/access/subscribers/${encodeURIComponent(String(params.userId))}/custom-name`,
1399
+ path: `/v2/access/subscribers/${encodeURIComponent(String(params.userId))}/note`,
1341
1400
  method: "PUT",
1342
1401
  body: params.body
1343
1402
  });
@@ -1353,11 +1412,11 @@ var AccessSubscribersNamespace = class {
1353
1412
  });
1354
1413
  }
1355
1414
  /**
1356
- * Update subscriber note
1415
+ * Set custom name for subscriber
1357
1416
  */
1358
- setNote(params) {
1417
+ setCustomName(params) {
1359
1418
  return request(this._config, {
1360
- path: `/v2/access/subscribers/${encodeURIComponent(String(params.userId))}/note`,
1419
+ path: `/v2/access/subscribers/${encodeURIComponent(String(params.userId))}/custom-name`,
1361
1420
  method: "PUT",
1362
1421
  body: params.body
1363
1422
  });
@@ -1409,18 +1468,6 @@ var AccessSubscriptionsNamespace = class {
1409
1468
  offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1410
1469
  }
1411
1470
  }
1412
- /**
1413
- * Get subscription history
1414
- */
1415
- getHistory(params) {
1416
- return request(this._config, {
1417
- path: `/v2/access/subscriptions/${encodeURIComponent(String(params.subscriptionId))}/history`,
1418
- method: "GET",
1419
- query: {
1420
- "all": params.all
1421
- }
1422
- });
1423
- }
1424
1471
  /**
1425
1472
  * Get subscription counts
1426
1473
  */
@@ -1430,90 +1477,42 @@ var AccessSubscriptionsNamespace = class {
1430
1477
  method: "GET"
1431
1478
  });
1432
1479
  }
1433
- };
1434
- var AccessUploadsNamespace = class {
1435
- constructor(config) {
1436
- this._config = config;
1437
- }
1438
- /**
1439
- * Upload single-part media and finalize (No need to call /complete after upload if using this endpoint)
1440
- */
1441
- replace(params) {
1442
- return request(this._config, {
1443
- path: `/v2/access/uploads/${encodeURIComponent(String(params.mediaUploadId))}`,
1444
- method: "PUT"
1445
- });
1446
- }
1447
1480
  /**
1448
- * Upload chunk to managed media upload
1449
- */
1450
- replaceParts(params) {
1451
- return request(this._config, {
1452
- path: `/v2/access/uploads/${encodeURIComponent(String(params.mediaUploadId))}/parts/${encodeURIComponent(String(params.partNumber))}`,
1453
- method: "PUT"
1454
- });
1455
- }
1456
- /**
1457
- * Check if media already exists in vault
1458
- */
1459
- check(params) {
1460
- return request(this._config, {
1461
- path: "/v2/access/uploads/check",
1462
- method: "POST",
1463
- body: params.body
1464
- });
1465
- }
1466
- /**
1467
- * Finalize media upload
1468
- */
1469
- complete(params) {
1470
- return request(this._config, {
1471
- path: "/v2/access/uploads/complete",
1472
- method: "POST",
1473
- body: params.body
1474
- });
1475
- }
1476
- /**
1477
- * Initialize media upload
1481
+ * Get subscription history
1478
1482
  */
1479
- init(params) {
1483
+ getHistory(params) {
1480
1484
  return request(this._config, {
1481
- path: "/v2/access/uploads/init",
1482
- method: "POST",
1483
- body: params.body
1485
+ path: `/v2/access/subscriptions/${encodeURIComponent(String(params.subscriptionId))}/history`,
1486
+ method: "GET",
1487
+ query: {
1488
+ "all": params.all
1489
+ }
1484
1490
  });
1485
1491
  }
1486
1492
  };
1487
- var AccessUsersListsNamespace = class {
1493
+ var AccessPromotionsTrackingLinksNamespace = class {
1488
1494
  constructor(config) {
1489
1495
  this._config = config;
1490
1496
  }
1491
1497
  /**
1492
- * Add user to multiple lists
1493
- */
1494
- create(params) {
1495
- return request(this._config, {
1496
- path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/lists`,
1497
- method: "POST",
1498
- body: params.body
1499
- });
1500
- }
1501
- /**
1502
- * List user lists
1498
+ * List tracking links
1503
1499
  */
1504
1500
  list(params) {
1505
1501
  return request(this._config, {
1506
- path: "/v2/access/users/lists",
1502
+ path: "/v2/access/promotions/tracking-links",
1507
1503
  method: "GET",
1508
1504
  query: {
1509
1505
  "limit": params.limit,
1510
1506
  "offset": params.offset,
1511
- "query": params.query
1507
+ "pagination": params.pagination,
1508
+ "with_deleted": params.withDeleted,
1509
+ "sorting_deleted": params.sortingDeleted,
1510
+ "stats": params.stats
1512
1511
  }
1513
1512
  });
1514
1513
  }
1515
1514
  /**
1516
- * List user lists
1515
+ * List tracking links
1517
1516
  *
1518
1517
  * Returns an async iterator that automatically paginates through all results.
1519
1518
  */
@@ -1539,49 +1538,83 @@ var AccessUsersListsNamespace = class {
1539
1538
  }
1540
1539
  }
1541
1540
  /**
1542
- * Create user list
1541
+ * Create tracking link
1543
1542
  */
1544
- create2(params) {
1543
+ create(params) {
1545
1544
  return request(this._config, {
1546
- path: "/v2/access/users/lists",
1545
+ path: "/v2/access/promotions/tracking-links",
1547
1546
  method: "POST",
1548
1547
  body: params.body
1549
1548
  });
1550
1549
  }
1551
1550
  /**
1552
- * Get user list
1551
+ * Get tracking link
1553
1552
  */
1554
1553
  get(params) {
1555
1554
  return request(this._config, {
1556
- path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}`,
1555
+ path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}`,
1557
1556
  method: "GET"
1558
1557
  });
1559
1558
  }
1560
1559
  /**
1561
- * Update user list
1560
+ * Update tracking link
1562
1561
  */
1563
- update(params) {
1562
+ replace(params) {
1564
1563
  return request(this._config, {
1565
- path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}`,
1566
- method: "PATCH",
1564
+ path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}`,
1565
+ method: "PUT",
1567
1566
  body: params.body
1568
1567
  });
1569
1568
  }
1570
1569
  /**
1571
- * Delete user list
1570
+ * Delete tracking link
1572
1571
  */
1573
1572
  delete(params) {
1574
1573
  return request(this._config, {
1575
- path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}`,
1574
+ path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}`,
1576
1575
  method: "DELETE"
1577
1576
  });
1578
1577
  }
1579
1578
  /**
1580
- * List users in user list
1579
+ * Share tracking link access
1581
1580
  */
1582
- listUsers(params) {
1581
+ createShareAccess(params) {
1583
1582
  return request(this._config, {
1584
- path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}/users`,
1583
+ path: "/v2/access/promotions/tracking-links/share-access",
1584
+ method: "POST",
1585
+ body: params.body
1586
+ });
1587
+ }
1588
+ /**
1589
+ * Revoke tracking link access
1590
+ */
1591
+ deleteShareAccess(params) {
1592
+ return request(this._config, {
1593
+ path: "/v2/access/promotions/tracking-links/share-access",
1594
+ method: "DELETE",
1595
+ body: params.body
1596
+ });
1597
+ }
1598
+ /**
1599
+ * Get tracking link claimers
1600
+ */
1601
+ listClaimers(params) {
1602
+ return request(this._config, {
1603
+ path: `/v2/access/promotions/tracking-links/${encodeURIComponent(String(params.trackingLinkId))}/claimers`,
1604
+ method: "GET"
1605
+ });
1606
+ }
1607
+ };
1608
+ var AccessPromotionsTrialLinksNamespace = class {
1609
+ constructor(config) {
1610
+ this._config = config;
1611
+ }
1612
+ /**
1613
+ * List trial links
1614
+ */
1615
+ list(params) {
1616
+ return request(this._config, {
1617
+ path: "/v2/access/promotions/trial-links",
1585
1618
  method: "GET",
1586
1619
  query: {
1587
1620
  "limit": params.limit,
@@ -1590,105 +1623,118 @@ var AccessUsersListsNamespace = class {
1590
1623
  });
1591
1624
  }
1592
1625
  /**
1593
- * List users in user list
1594
- *
1595
- * Returns an async iterator that automatically paginates through all results.
1596
- */
1597
- async *iterateUsers(params) {
1598
- let offset = 0;
1599
- let fetched = 0;
1600
- const limit = params?.pageSize ?? 20;
1601
- const maxItems = params?.maxItems ?? Infinity;
1602
- while (fetched < maxItems) {
1603
- const response = await this.listUsers({
1604
- ...params,
1605
- limit: Math.min(limit, maxItems - fetched),
1606
- offset
1607
- });
1608
- for (const item of response.list) {
1609
- if (fetched >= maxItems) return;
1610
- yield item;
1611
- fetched++;
1612
- }
1613
- if (!response.hasMore) return;
1614
- const nextOffset = response.nextOffset;
1615
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1616
- }
1626
+ * Create trial link
1627
+ */
1628
+ create(params) {
1629
+ return request(this._config, {
1630
+ path: "/v2/access/promotions/trial-links",
1631
+ method: "POST",
1632
+ body: params.body
1633
+ });
1634
+ }
1635
+ /**
1636
+ * Get trial link
1637
+ */
1638
+ get(params) {
1639
+ return request(this._config, {
1640
+ path: `/v2/access/promotions/trial-links/${encodeURIComponent(String(params.trialLinkId))}`,
1641
+ method: "GET"
1642
+ });
1617
1643
  }
1618
1644
  /**
1619
- * Add user to list
1645
+ * Update trial link
1620
1646
  */
1621
- createUsers(params) {
1647
+ replace(params) {
1622
1648
  return request(this._config, {
1623
- path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}/users/${encodeURIComponent(String(params.userId))}`,
1624
- method: "POST"
1649
+ path: `/v2/access/promotions/trial-links/${encodeURIComponent(String(params.trialLinkId))}`,
1650
+ method: "PUT",
1651
+ body: params.body
1625
1652
  });
1626
1653
  }
1627
1654
  /**
1628
- * Remove user from user list
1655
+ * Delete trial link
1629
1656
  */
1630
- deleteUsers(params) {
1657
+ delete(params) {
1631
1658
  return request(this._config, {
1632
- path: `/v2/access/users/lists/${encodeURIComponent(String(params.listId))}/users/${encodeURIComponent(String(params.userId))}`,
1659
+ path: `/v2/access/promotions/trial-links/${encodeURIComponent(String(params.trialLinkId))}`,
1633
1660
  method: "DELETE"
1634
1661
  });
1635
1662
  }
1636
- };
1637
- var AccessUsersNamespace = class {
1638
- constructor(config) {
1639
- this._config = config;
1640
- this.lists = new AccessUsersListsNamespace(config);
1663
+ /**
1664
+ * Share trial link access
1665
+ */
1666
+ createShareAccess(params) {
1667
+ return request(this._config, {
1668
+ path: "/v2/access/promotions/trial-links/share-access",
1669
+ method: "POST",
1670
+ body: params.body
1671
+ });
1641
1672
  }
1642
1673
  /**
1643
- * Get user
1674
+ * Revoke trial link access
1644
1675
  */
1645
- get(params) {
1676
+ deleteShareAccess(params) {
1646
1677
  return request(this._config, {
1647
- path: `/v2/access/users/${encodeURIComponent(String(params.userId))}`,
1648
- method: "GET"
1678
+ path: "/v2/access/promotions/trial-links/share-access",
1679
+ method: "DELETE",
1680
+ body: params.body
1649
1681
  });
1650
1682
  }
1683
+ };
1684
+ var AccessPromotionsNamespace = class {
1685
+ constructor(config) {
1686
+ this._config = config;
1687
+ this.trackingLinks = new AccessPromotionsTrackingLinksNamespace(config);
1688
+ this.trialLinks = new AccessPromotionsTrialLinksNamespace(config);
1689
+ }
1651
1690
  /**
1652
- * List user posts
1691
+ * List promotions
1653
1692
  */
1654
- listPosts(params) {
1693
+ list(params) {
1655
1694
  return request(this._config, {
1656
- path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/posts`,
1695
+ path: "/v2/access/promotions",
1657
1696
  method: "GET",
1658
1697
  query: {
1659
1698
  "limit": params.limit,
1660
- "sortBy": params.sortBy,
1661
- "sortDirection": params.sortDirection,
1662
- "pinned": params.pinned,
1663
- "includePostCounts": params.includePostCounts,
1664
- "beforePublishTime": params.beforePublishTime
1699
+ "offset": params.offset
1665
1700
  }
1666
1701
  });
1667
1702
  }
1668
1703
  /**
1669
- * Restrict user
1704
+ * Create promotion
1670
1705
  */
1671
- restrict(params) {
1706
+ create(params) {
1672
1707
  return request(this._config, {
1673
- path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/restrict`,
1674
- method: "POST"
1708
+ path: "/v2/access/promotions",
1709
+ method: "POST",
1710
+ body: params.body
1675
1711
  });
1676
1712
  }
1677
1713
  /**
1678
- * Unrestrict user
1714
+ * Update promotion
1679
1715
  */
1680
- restrict2(params) {
1716
+ replace(params) {
1681
1717
  return request(this._config, {
1682
- path: `/v2/access/users/${encodeURIComponent(String(params.userId))}/restrict`,
1718
+ path: `/v2/access/promotions/${encodeURIComponent(String(params.promotionId))}`,
1719
+ method: "PUT",
1720
+ body: params.body
1721
+ });
1722
+ }
1723
+ /**
1724
+ * Delete promotion
1725
+ */
1726
+ delete(params) {
1727
+ return request(this._config, {
1728
+ path: `/v2/access/promotions/${encodeURIComponent(String(params.promotionId))}`,
1683
1729
  method: "DELETE"
1684
1730
  });
1685
1731
  }
1686
1732
  /**
1687
- * List restricted users
1733
+ * List bundles
1688
1734
  */
1689
- getRestrict(params) {
1735
+ listBundles(params) {
1690
1736
  return request(this._config, {
1691
- path: "/v2/access/users/restrict",
1737
+ path: "/v2/access/promotions/bundles",
1692
1738
  method: "GET",
1693
1739
  query: {
1694
1740
  "limit": params.limit,
@@ -1697,94 +1743,50 @@ var AccessUsersNamespace = class {
1697
1743
  });
1698
1744
  }
1699
1745
  /**
1700
- * List restricted users
1701
- *
1702
- * Returns an async iterator that automatically paginates through all results.
1703
- */
1704
- async *iterateRestrict(params) {
1705
- let offset = 0;
1706
- let fetched = 0;
1707
- const limit = params?.pageSize ?? 20;
1708
- const maxItems = params?.maxItems ?? Infinity;
1709
- while (fetched < maxItems) {
1710
- const response = await this.getRestrict({
1711
- ...params,
1712
- limit: Math.min(limit, maxItems - fetched),
1713
- offset
1714
- });
1715
- for (const item of response.list) {
1716
- if (fetched >= maxItems) return;
1717
- yield item;
1718
- fetched++;
1719
- }
1720
- if (!response.hasMore) return;
1721
- const nextOffset = response.nextOffset;
1722
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1723
- }
1746
+ * Create bundle
1747
+ */
1748
+ createBundles(params) {
1749
+ return request(this._config, {
1750
+ path: "/v2/access/promotions/bundles",
1751
+ method: "POST",
1752
+ body: params.body
1753
+ });
1724
1754
  }
1725
1755
  /**
1726
- * List blocked users
1756
+ * Get bundle
1727
1757
  */
1728
- getBlocked(params) {
1758
+ getBundles(params) {
1729
1759
  return request(this._config, {
1730
- path: "/v2/access/users/blocked",
1731
- method: "GET",
1732
- query: {
1733
- "limit": params.limit,
1734
- "offset": params.offset
1735
- }
1760
+ path: `/v2/access/promotions/bundles/${encodeURIComponent(String(params.bundleId))}`,
1761
+ method: "GET"
1736
1762
  });
1737
1763
  }
1738
1764
  /**
1739
- * List blocked users
1740
- *
1741
- * Returns an async iterator that automatically paginates through all results.
1742
- */
1743
- async *iterateBlocked(params) {
1744
- let offset = 0;
1745
- let fetched = 0;
1746
- const limit = params?.pageSize ?? 20;
1747
- const maxItems = params?.maxItems ?? Infinity;
1748
- while (fetched < maxItems) {
1749
- const response = await this.getBlocked({
1750
- ...params,
1751
- limit: Math.min(limit, maxItems - fetched),
1752
- offset
1753
- });
1754
- for (const item of response.list) {
1755
- if (fetched >= maxItems) return;
1756
- yield item;
1757
- fetched++;
1758
- }
1759
- if (!response.hasMore) return;
1760
- const nextOffset = response.nextOffset;
1761
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1762
- }
1765
+ * Update bundle
1766
+ */
1767
+ replaceBundles(params) {
1768
+ return request(this._config, {
1769
+ path: `/v2/access/promotions/bundles/${encodeURIComponent(String(params.bundleId))}`,
1770
+ method: "PUT",
1771
+ body: params.body
1772
+ });
1763
1773
  }
1764
1774
  /**
1765
- * List users by IDs
1775
+ * Delete bundle
1766
1776
  */
1767
- getList(params) {
1777
+ deleteBundles(params) {
1768
1778
  return request(this._config, {
1769
- path: "/v2/access/users/list",
1770
- method: "GET",
1771
- query: {
1772
- "userIds": params.userIds
1773
- }
1779
+ path: `/v2/access/promotions/bundles/${encodeURIComponent(String(params.bundleId))}`,
1780
+ method: "DELETE"
1774
1781
  });
1775
1782
  }
1776
1783
  /**
1777
- * Search performers
1784
+ * Stop promotion
1778
1785
  */
1779
- search(params) {
1786
+ createStop(params) {
1780
1787
  return request(this._config, {
1781
- path: "/v2/access/users/search",
1782
- method: "GET",
1783
- query: {
1784
- "limit": params.limit,
1785
- "offset": params.offset,
1786
- "query": params.query
1787
- }
1788
+ path: `/v2/access/promotions/${encodeURIComponent(String(params.promotionId))}/stop`,
1789
+ method: "POST"
1788
1790
  });
1789
1791
  }
1790
1792
  };
@@ -1917,94 +1919,39 @@ var AccessVaultListsNamespace = class {
1917
1919
  };
1918
1920
  var AccessVaultNamespace = class {
1919
1921
  constructor(config) {
1920
- this._config = config;
1921
- this.lists = new AccessVaultListsNamespace(config);
1922
- }
1923
- /**
1924
- * List vault media
1925
- */
1926
- listMedia(params) {
1927
- return request(this._config, {
1928
- path: "/v2/access/vault/media",
1929
- method: "GET",
1930
- query: {
1931
- "limit": params.limit,
1932
- "offset": params.offset,
1933
- "sortBy": params.sortBy,
1934
- "sortDirection": params.sortDirection,
1935
- "listId": params.listId,
1936
- "query": params.query,
1937
- "mediaType": params.mediaType
1938
- }
1939
- });
1940
- }
1941
- /**
1942
- * List vault media
1943
- *
1944
- * Returns an async iterator that automatically paginates through all results.
1945
- */
1946
- async *iterateMedia(params) {
1947
- let offset = 0;
1948
- let fetched = 0;
1949
- const limit = params?.pageSize ?? 20;
1950
- const maxItems = params?.maxItems ?? Infinity;
1951
- while (fetched < maxItems) {
1952
- const response = await this.listMedia({
1953
- ...params,
1954
- limit: Math.min(limit, maxItems - fetched),
1955
- offset
1956
- });
1957
- for (const item of response.list) {
1958
- if (fetched >= maxItems) return;
1959
- yield item;
1960
- fetched++;
1961
- }
1962
- if (!response.hasMore) return;
1963
- const nextOffset = response.nextOffset;
1964
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
1965
- }
1966
- }
1967
- };
1968
- var AccessNamespace = class {
1969
- constructor(config) {
1970
- this._config = config;
1971
- this.analytics = new AccessAnalyticsNamespace(config);
1972
- this.chats = new AccessChatsNamespace(config);
1973
- this.earnings = new AccessEarningsNamespace(config);
1974
- this.promotions = new AccessPromotionsNamespace(config);
1975
- this.self = new AccessSelfNamespace(config);
1976
- this.subscribers = new AccessSubscribersNamespace(config);
1977
- this.subscriptions = new AccessSubscriptionsNamespace(config);
1978
- this.uploads = new AccessUploadsNamespace(config);
1979
- this.users = new AccessUsersNamespace(config);
1980
- this.vault = new AccessVaultNamespace(config);
1922
+ this._config = config;
1923
+ this.lists = new AccessVaultListsNamespace(config);
1981
1924
  }
1982
1925
  /**
1983
- * List mass messages
1926
+ * List vault media
1984
1927
  */
1985
- listMassMessages(params) {
1928
+ listMedia(params) {
1986
1929
  return request(this._config, {
1987
- path: "/v2/access/mass-messages",
1930
+ path: "/v2/access/vault/media",
1988
1931
  method: "GET",
1989
1932
  query: {
1990
1933
  "limit": params.limit,
1991
1934
  "offset": params.offset,
1992
- "type": params.type
1935
+ "sortBy": params.sortBy,
1936
+ "sortDirection": params.sortDirection,
1937
+ "listId": params.listId,
1938
+ "query": params.query,
1939
+ "mediaType": params.mediaType
1993
1940
  }
1994
1941
  });
1995
1942
  }
1996
1943
  /**
1997
- * List mass messages
1944
+ * List vault media
1998
1945
  *
1999
1946
  * Returns an async iterator that automatically paginates through all results.
2000
1947
  */
2001
- async *iterateMassMessages(params) {
1948
+ async *iterateMedia(params) {
2002
1949
  let offset = 0;
2003
1950
  let fetched = 0;
2004
1951
  const limit = params?.pageSize ?? 20;
2005
1952
  const maxItems = params?.maxItems ?? Infinity;
2006
1953
  while (fetched < maxItems) {
2007
- const response = await this.listMassMessages({
1954
+ const response = await this.listMedia({
2008
1955
  ...params,
2009
1956
  limit: Math.min(limit, maxItems - fetched),
2010
1957
  offset
@@ -2019,44 +1966,74 @@ var AccessNamespace = class {
2019
1966
  offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
2020
1967
  }
2021
1968
  }
1969
+ };
1970
+ var AccessUploadsNamespace = class {
1971
+ constructor(config) {
1972
+ this._config = config;
1973
+ }
2022
1974
  /**
2023
- * Create mass message
1975
+ * Upload single-part media and finalize (No need to call /complete after upload if using this endpoint)
2024
1976
  */
2025
- createMassMessages(params) {
1977
+ replace(params) {
2026
1978
  return request(this._config, {
2027
- path: "/v2/access/mass-messages",
1979
+ path: `/v2/access/uploads/${encodeURIComponent(String(params.mediaUploadId))}`,
1980
+ method: "PUT"
1981
+ });
1982
+ }
1983
+ /**
1984
+ * Check if media already exists in vault
1985
+ */
1986
+ check(params) {
1987
+ return request(this._config, {
1988
+ path: "/v2/access/uploads/check",
2028
1989
  method: "POST",
2029
1990
  body: params.body
2030
1991
  });
2031
1992
  }
2032
1993
  /**
2033
- * Get mass message
1994
+ * Initialize media upload
2034
1995
  */
2035
- getMassMessages(params) {
1996
+ init(params) {
2036
1997
  return request(this._config, {
2037
- path: `/v2/access/mass-messages/${encodeURIComponent(String(params.massMessageId))}`,
2038
- method: "GET"
1998
+ path: "/v2/access/uploads/init",
1999
+ method: "POST",
2000
+ body: params.body
2039
2001
  });
2040
2002
  }
2041
2003
  /**
2042
- * Update mass message
2004
+ * Upload chunk to managed media upload
2043
2005
  */
2044
- replaceMassMessages(params) {
2006
+ replaceParts(params) {
2045
2007
  return request(this._config, {
2046
- path: `/v2/access/mass-messages/${encodeURIComponent(String(params.massMessageId))}`,
2047
- method: "PUT",
2048
- body: params.body
2008
+ path: `/v2/access/uploads/${encodeURIComponent(String(params.mediaUploadId))}/parts/${encodeURIComponent(String(params.partNumber))}`,
2009
+ method: "PUT"
2049
2010
  });
2050
2011
  }
2051
2012
  /**
2052
- * Delete mass message
2013
+ * Finalize media upload
2053
2014
  */
2054
- deleteMassMessages(params) {
2015
+ complete(params) {
2055
2016
  return request(this._config, {
2056
- path: `/v2/access/mass-messages/${encodeURIComponent(String(params.massMessageId))}`,
2057
- method: "DELETE"
2017
+ path: "/v2/access/uploads/complete",
2018
+ method: "POST",
2019
+ body: params.body
2058
2020
  });
2059
2021
  }
2022
+ };
2023
+ var AccessNamespace = class {
2024
+ constructor(config) {
2025
+ this._config = config;
2026
+ this.self = new AccessSelfNamespace(config);
2027
+ this.earnings = new AccessEarningsNamespace(config);
2028
+ this.analytics = new AccessAnalyticsNamespace(config);
2029
+ this.users = new AccessUsersNamespace(config);
2030
+ this.chats = new AccessChatsNamespace(config);
2031
+ this.subscribers = new AccessSubscribersNamespace(config);
2032
+ this.subscriptions = new AccessSubscriptionsNamespace(config);
2033
+ this.promotions = new AccessPromotionsNamespace(config);
2034
+ this.vault = new AccessVaultNamespace(config);
2035
+ this.uploads = new AccessUploadsNamespace(config);
2036
+ }
2060
2037
  /**
2061
2038
  * List own posts
2062
2039
  */
@@ -2112,141 +2089,75 @@ var AccessNamespace = class {
2112
2089
  method: "DELETE"
2113
2090
  });
2114
2091
  }
2115
- };
2116
- var AccountConnectionsNamespace = class {
2117
- constructor(config) {
2118
- this._config = config;
2119
- }
2120
- /**
2121
- * List connections
2122
- */
2123
- list(params) {
2124
- return request(this._config, {
2125
- path: "/v2/account/connections",
2126
- method: "GET",
2127
- query: {
2128
- "status": params.status,
2129
- "imported": params.imported,
2130
- "limit": params.limit,
2131
- "offset": params.offset
2132
- }
2133
- });
2134
- }
2135
- /**
2136
- * List connections
2137
- *
2138
- * Returns an async iterator that automatically paginates through all results.
2139
- */
2140
- async *iterate(params) {
2141
- let offset = 0;
2142
- let fetched = 0;
2143
- const limit = params?.pageSize ?? 20;
2144
- const maxItems = params?.maxItems ?? Infinity;
2145
- while (fetched < maxItems) {
2146
- const response = await this.list({
2147
- ...params,
2148
- limit: Math.min(limit, maxItems - fetched),
2149
- offset
2150
- });
2151
- for (const item of response.list) {
2152
- if (fetched >= maxItems) return;
2153
- yield item;
2154
- fetched++;
2155
- }
2156
- if (!response.hasMore) return;
2157
- const nextOffset = response.nextOffset;
2158
- offset = typeof nextOffset === "number" ? nextOffset : typeof nextOffset === "string" && nextOffset.trim() !== "" && Number.isFinite(Number(nextOffset)) ? Number(nextOffset) : offset + response.list.length;
2159
- }
2160
- }
2161
- /**
2162
- * Disconnect connection
2163
- */
2164
- delete(params) {
2165
- return request(this._config, {
2166
- path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}`,
2167
- method: "DELETE"
2168
- });
2169
- }
2170
2092
  /**
2171
- * Import connection
2093
+ * Create mass message
2172
2094
  */
2173
- createImport(params) {
2095
+ createMassMessages(params) {
2174
2096
  return request(this._config, {
2175
- path: "/v2/account/connections/import",
2097
+ path: "/v2/access/mass-messages",
2176
2098
  method: "POST",
2177
2099
  body: params.body
2178
2100
  });
2179
2101
  }
2180
2102
  /**
2181
- * Update imported connection session
2182
- */
2183
- updateImport(params) {
2184
- return request(this._config, {
2185
- path: `/v2/account/connections/import/${encodeURIComponent(String(params.connectionId))}`,
2186
- method: "PATCH",
2187
- body: params.body
2188
- });
2189
- }
2190
- /**
2191
- * Invalidate connection
2103
+ * Get mass message
2192
2104
  */
2193
- invalidate(params) {
2105
+ getMassMessages(params) {
2194
2106
  return request(this._config, {
2195
- path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}/invalidate`,
2196
- method: "POST"
2107
+ path: `/v2/access/mass-messages/${encodeURIComponent(String(params.massMessageId))}`,
2108
+ method: "GET"
2197
2109
  });
2198
2110
  }
2199
2111
  /**
2200
- * Get connection settings
2112
+ * Update mass message
2201
2113
  */
2202
- getSettings(params) {
2114
+ replaceMassMessages(params) {
2203
2115
  return request(this._config, {
2204
- path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}/settings`,
2205
- method: "GET"
2116
+ path: `/v2/access/mass-messages/${encodeURIComponent(String(params.massMessageId))}`,
2117
+ method: "PUT",
2118
+ body: params.body
2206
2119
  });
2207
2120
  }
2208
2121
  /**
2209
- * Update connection settings
2122
+ * Delete mass message
2210
2123
  */
2211
- updateSettings(params) {
2124
+ deleteMassMessages(params) {
2212
2125
  return request(this._config, {
2213
- path: `/v2/account/connections/${encodeURIComponent(String(params.connectionId))}/settings`,
2214
- method: "PATCH",
2215
- body: params.body
2126
+ path: `/v2/access/mass-messages/${encodeURIComponent(String(params.massMessageId))}`,
2127
+ method: "DELETE"
2216
2128
  });
2217
2129
  }
2218
2130
  };
2219
- var AccountNamespace = class {
2131
+ var LinkNamespace = class {
2220
2132
  constructor(config) {
2221
2133
  this._config = config;
2222
- this.connections = new AccountConnectionsNamespace(config);
2223
2134
  }
2224
2135
  /**
2225
- * Get organization settings
2136
+ * Get login status
2226
2137
  */
2227
- getSettings() {
2138
+ get(params) {
2228
2139
  return request(this._config, {
2229
- path: "/v2/account/settings",
2140
+ path: `/v2/link/${encodeURIComponent(String(params.clientSecret))}`,
2230
2141
  method: "GET"
2231
2142
  });
2232
2143
  }
2233
2144
  /**
2234
- * Update organization settings
2145
+ * Delete login session
2235
2146
  */
2236
- updateSettings(params) {
2147
+ delete(params) {
2237
2148
  return request(this._config, {
2238
- path: "/v2/account/settings",
2239
- method: "PATCH",
2240
- body: params.body
2149
+ path: `/v2/link/${encodeURIComponent(String(params.clientSecret))}`,
2150
+ method: "DELETE"
2241
2151
  });
2242
2152
  }
2243
2153
  /**
2244
- * Whoami
2154
+ * Initialize a Link session
2245
2155
  */
2246
- whoami() {
2156
+ init(params) {
2247
2157
  return request(this._config, {
2248
- path: "/v2/account/whoami",
2249
- method: "GET"
2158
+ path: "/v2/link/init",
2159
+ method: "POST",
2160
+ body: params.body
2250
2161
  });
2251
2162
  }
2252
2163
  };
@@ -2283,39 +2194,6 @@ var DynamicRulesNamespace = class {
2283
2194
  });
2284
2195
  }
2285
2196
  };
2286
- var LinkNamespace = class {
2287
- constructor(config) {
2288
- this._config = config;
2289
- }
2290
- /**
2291
- * Get login status
2292
- */
2293
- get(params) {
2294
- return request(this._config, {
2295
- path: `/v2/link/${encodeURIComponent(String(params.clientSecret))}`,
2296
- method: "GET"
2297
- });
2298
- }
2299
- /**
2300
- * Delete login session
2301
- */
2302
- delete(params) {
2303
- return request(this._config, {
2304
- path: `/v2/link/${encodeURIComponent(String(params.clientSecret))}`,
2305
- method: "DELETE"
2306
- });
2307
- }
2308
- /**
2309
- * Initialize a Link session
2310
- */
2311
- init(params) {
2312
- return request(this._config, {
2313
- path: "/v2/link/init",
2314
- method: "POST",
2315
- body: params.body
2316
- });
2317
- }
2318
- };
2319
2197
  var VaultPlusStoreNamespace = class {
2320
2198
  constructor(config) {
2321
2199
  this._config = config;
@@ -2330,15 +2208,6 @@ var VaultPlusStoreNamespace = class {
2330
2208
  connectionId: params.connectionId
2331
2209
  });
2332
2210
  }
2333
- /**
2334
- * Get organization vault stats
2335
- */
2336
- getStats() {
2337
- return request(this._config, {
2338
- path: "/v2/vault-plus/store/stats",
2339
- method: "GET"
2340
- });
2341
- }
2342
2211
  /**
2343
2212
  * Get storage status for a connection
2344
2213
  */
@@ -2349,6 +2218,15 @@ var VaultPlusStoreNamespace = class {
2349
2218
  connectionId: params.connectionId
2350
2219
  });
2351
2220
  }
2221
+ /**
2222
+ * Get organization vault stats
2223
+ */
2224
+ getStats() {
2225
+ return request(this._config, {
2226
+ path: "/v2/vault-plus/store/stats",
2227
+ method: "GET"
2228
+ });
2229
+ }
2352
2230
  };
2353
2231
  var VaultPlusNamespace = class {
2354
2232
  constructor(config) {
@@ -2417,10 +2295,10 @@ var VaultPlusNamespace = class {
2417
2295
  var OFAuthClient = class {
2418
2296
  constructor(config) {
2419
2297
  this._config = config;
2420
- this.access = new AccessNamespace(config);
2421
2298
  this.account = new AccountNamespace(config);
2422
- this.dynamicRules = new DynamicRulesNamespace(config);
2299
+ this.access = new AccessNamespace(config);
2423
2300
  this.link = new LinkNamespace(config);
2301
+ this.dynamicRules = new DynamicRulesNamespace(config);
2424
2302
  this.vaultPlus = new VaultPlusNamespace(config);
2425
2303
  }
2426
2304
  /**