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