glitch-javascript-sdk 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +319 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +197 -0
- package/dist/esm/api/GameShows.d.ts +24 -0
- package/dist/esm/index.js +319 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +221 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +359 -74
- package/src/api/GameShows.ts +42 -0
- package/src/routes/CommunitiesRoute.ts +69 -39
- package/src/routes/GameShowsRoute.ts +6 -0
|
@@ -348,5 +348,202 @@ declare class Communities {
|
|
|
348
348
|
* @returns Promise
|
|
349
349
|
*/
|
|
350
350
|
static populateEmailTemplate<T>(community_id: string, template_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
351
|
+
/**
|
|
352
|
+
* List all newsletters for a community.
|
|
353
|
+
*
|
|
354
|
+
* @param community_id The ID of the community.
|
|
355
|
+
* @param params Query parameters.
|
|
356
|
+
* @returns Promise
|
|
357
|
+
*/
|
|
358
|
+
static listNewsletters<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
359
|
+
/**
|
|
360
|
+
* Create a new newsletter for a community.
|
|
361
|
+
*
|
|
362
|
+
* @param community_id The ID of the community.
|
|
363
|
+
* @param data The data for the new newsletter.
|
|
364
|
+
* @returns Promise
|
|
365
|
+
*/
|
|
366
|
+
static createNewsletter<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
367
|
+
/**
|
|
368
|
+
* Get a specific newsletter.
|
|
369
|
+
*
|
|
370
|
+
* @param community_id The ID of the community.
|
|
371
|
+
* @param newsletter_id The ID of the newsletter.
|
|
372
|
+
* @param params Query parameters.
|
|
373
|
+
* @returns Promise
|
|
374
|
+
*/
|
|
375
|
+
static viewNewsletter<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
376
|
+
/**
|
|
377
|
+
* Update a specific newsletter.
|
|
378
|
+
*
|
|
379
|
+
* @param community_id The ID of the community.
|
|
380
|
+
* @param newsletter_id The ID of the newsletter.
|
|
381
|
+
* @param data The data to update.
|
|
382
|
+
* @returns Promise
|
|
383
|
+
*/
|
|
384
|
+
static updateNewsletter<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
385
|
+
/**
|
|
386
|
+
* Delete a specific newsletter.
|
|
387
|
+
*
|
|
388
|
+
* @param community_id The ID of the community.
|
|
389
|
+
* @param newsletter_id The ID of the newsletter.
|
|
390
|
+
* @returns Promise
|
|
391
|
+
*/
|
|
392
|
+
static deleteNewsletter<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
393
|
+
/**
|
|
394
|
+
* Import subscribers from a CSV or XLS file into a newsletter.
|
|
395
|
+
*
|
|
396
|
+
* @param community_id The ID of the community.
|
|
397
|
+
* @param newsletter_id The ID of the newsletter.
|
|
398
|
+
* @param file The CSV or XLS file.
|
|
399
|
+
* @param params Additional parameters.
|
|
400
|
+
* @returns Promise
|
|
401
|
+
*/
|
|
402
|
+
static importNewsletterSubscribers<T>(community_id: string, newsletter_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
403
|
+
/**
|
|
404
|
+
* Updates the banner image for the game show using a File object.
|
|
405
|
+
*
|
|
406
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
407
|
+
*
|
|
408
|
+
* @param file The file object to upload.
|
|
409
|
+
* @param data Any additional data to pass along to the upload.
|
|
410
|
+
*
|
|
411
|
+
* @returns promise
|
|
412
|
+
*/
|
|
413
|
+
static uploadNewsletterBannerImageFile<T>(community_id: string, newsletter_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
414
|
+
/**
|
|
415
|
+
* Updates the banner image for the game show using a Blob.
|
|
416
|
+
*
|
|
417
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
418
|
+
*
|
|
419
|
+
* @param blob The blob to upload.
|
|
420
|
+
* @param data Any additional data to pass along to the upload
|
|
421
|
+
*
|
|
422
|
+
* @returns promise
|
|
423
|
+
*/
|
|
424
|
+
static uploadNewsletterBannerImageBlob<T>(community_id: string, newsletter_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
425
|
+
/**
|
|
426
|
+
* List all campaigns for a newsletter.
|
|
427
|
+
*
|
|
428
|
+
* @param community_id The ID of the community.
|
|
429
|
+
* @param newsletter_id The ID of the newsletter.
|
|
430
|
+
* @param params Query parameters.
|
|
431
|
+
* @returns Promise
|
|
432
|
+
*/
|
|
433
|
+
static listCampaigns<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
434
|
+
/**
|
|
435
|
+
* Create a new campaign for a newsletter.
|
|
436
|
+
*
|
|
437
|
+
* @param community_id The ID of the community.
|
|
438
|
+
* @param newsletter_id The ID of the newsletter.
|
|
439
|
+
* @param data The data for the new campaign.
|
|
440
|
+
* @returns Promise
|
|
441
|
+
*/
|
|
442
|
+
static createCampaign<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
443
|
+
/**
|
|
444
|
+
* Get a specific campaign.
|
|
445
|
+
*
|
|
446
|
+
* @param community_id The ID of the community.
|
|
447
|
+
* @param newsletter_id The ID of the newsletter.
|
|
448
|
+
* @param campaign_id The ID of the campaign.
|
|
449
|
+
* @param params Query parameters.
|
|
450
|
+
* @returns Promise
|
|
451
|
+
*/
|
|
452
|
+
static viewCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
453
|
+
/**
|
|
454
|
+
* Update a specific campaign.
|
|
455
|
+
*
|
|
456
|
+
* @param community_id The ID of the community.
|
|
457
|
+
* @param newsletter_id The ID of the newsletter.
|
|
458
|
+
* @param campaign_id The ID of the campaign.
|
|
459
|
+
* @param data The data to update.
|
|
460
|
+
* @returns Promise
|
|
461
|
+
*/
|
|
462
|
+
static updateCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
463
|
+
/**
|
|
464
|
+
* Delete a specific campaign.
|
|
465
|
+
*
|
|
466
|
+
* @param community_id The ID of the community.
|
|
467
|
+
* @param newsletter_id The ID of the newsletter.
|
|
468
|
+
* @param campaign_id The ID of the campaign.
|
|
469
|
+
* @returns Promise
|
|
470
|
+
*/
|
|
471
|
+
static deleteCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
472
|
+
/**
|
|
473
|
+
* Send a campaign immediately.
|
|
474
|
+
*
|
|
475
|
+
* @param community_id The ID of the community.
|
|
476
|
+
* @param newsletter_id The ID of the newsletter.
|
|
477
|
+
* @param campaign_id The ID of the campaign.
|
|
478
|
+
* @returns Promise
|
|
479
|
+
*/
|
|
480
|
+
static sendCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
481
|
+
/**
|
|
482
|
+
* Schedule a campaign to be sent later.
|
|
483
|
+
*
|
|
484
|
+
* @param community_id The ID of the community.
|
|
485
|
+
* @param newsletter_id The ID of the newsletter.
|
|
486
|
+
* @param campaign_id The ID of the campaign.
|
|
487
|
+
* @param data The scheduling data (e.g., scheduled_at).
|
|
488
|
+
* @returns Promise
|
|
489
|
+
*/
|
|
490
|
+
static scheduleCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
491
|
+
/**
|
|
492
|
+
* List all emails sent in a campaign.
|
|
493
|
+
*
|
|
494
|
+
* @param community_id The ID of the community.
|
|
495
|
+
* @param newsletter_id The ID of the newsletter.
|
|
496
|
+
* @param campaign_id The ID of the campaign.
|
|
497
|
+
* @param params Query parameters.
|
|
498
|
+
* @returns Promise
|
|
499
|
+
*/
|
|
500
|
+
static listCampaignEmails<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
501
|
+
/**
|
|
502
|
+
* List all subscribers of a newsletter (admin only).
|
|
503
|
+
*
|
|
504
|
+
* @param community_id The ID of the community.
|
|
505
|
+
* @param newsletter_id The ID of the newsletter.
|
|
506
|
+
* @param params Query parameters.
|
|
507
|
+
* @returns Promise
|
|
508
|
+
*/
|
|
509
|
+
static listNewsletterSubscribers<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
510
|
+
/**
|
|
511
|
+
* Get a specific subscriber of a newsletter (admin only).
|
|
512
|
+
*
|
|
513
|
+
* @param community_id The ID of the community.
|
|
514
|
+
* @param newsletter_id The ID of the newsletter.
|
|
515
|
+
* @param subscriber_id The ID of the subscriber.
|
|
516
|
+
* @param params Query parameters.
|
|
517
|
+
* @returns Promise
|
|
518
|
+
*/
|
|
519
|
+
static viewNewsletterSubscriber<T>(community_id: string, newsletter_id: string, subscriber_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
520
|
+
/**
|
|
521
|
+
* Update a specific subscriber of a newsletter (admin only).
|
|
522
|
+
*
|
|
523
|
+
* @param community_id The ID of the community.
|
|
524
|
+
* @param newsletter_id The ID of the newsletter.
|
|
525
|
+
* @param subscriber_id The ID of the subscriber.
|
|
526
|
+
* @param data The data to update.
|
|
527
|
+
* @returns Promise
|
|
528
|
+
*/
|
|
529
|
+
static updateNewsletterSubscriber<T>(community_id: string, newsletter_id: string, subscriber_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
530
|
+
/**
|
|
531
|
+
* Delete a specific subscriber from a newsletter (admin only).
|
|
532
|
+
*
|
|
533
|
+
* @param community_id The ID of the community.
|
|
534
|
+
* @param newsletter_id The ID of the newsletter.
|
|
535
|
+
* @param subscriber_id The ID of the subscriber.
|
|
536
|
+
* @returns Promise
|
|
537
|
+
*/
|
|
538
|
+
static deleteNewsletterSubscriber<T>(community_id: string, newsletter_id: string, subscriber_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
539
|
+
/**
|
|
540
|
+
* Register a new subscriber to a newsletter.
|
|
541
|
+
*
|
|
542
|
+
* @param community_id The ID of the community.
|
|
543
|
+
* @param newsletter_id The ID of the newsletter.
|
|
544
|
+
* @param data The subscriber data.
|
|
545
|
+
* @returns Promise
|
|
546
|
+
*/
|
|
547
|
+
static registerNewsletterSubscriber<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
351
548
|
}
|
|
352
549
|
export default Communities;
|
|
@@ -93,5 +93,29 @@ declare class GameShows {
|
|
|
93
93
|
* @returns promise
|
|
94
94
|
*/
|
|
95
95
|
static uploadBannerImageBlob<T>(show_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
96
|
+
/**
|
|
97
|
+
* Register a title to a game show.
|
|
98
|
+
*/
|
|
99
|
+
static registerTitle<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
100
|
+
/**
|
|
101
|
+
* Add a title to a game show by admin.
|
|
102
|
+
*/
|
|
103
|
+
static addTitle<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
104
|
+
/**
|
|
105
|
+
* List all titles for a game show.
|
|
106
|
+
*/
|
|
107
|
+
static listTitles<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
108
|
+
/**
|
|
109
|
+
* Get details of a specific title in a game show.
|
|
110
|
+
*/
|
|
111
|
+
static getTitle<T>(show_id: string, title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
112
|
+
/**
|
|
113
|
+
* Update a specific title in a game show.
|
|
114
|
+
*/
|
|
115
|
+
static updateTitle<T>(show_id: string, title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
116
|
+
/**
|
|
117
|
+
* Delete a specific title from a game show.
|
|
118
|
+
*/
|
|
119
|
+
static deleteTitle<T>(show_id: string, title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
96
120
|
}
|
|
97
121
|
export default GameShows;
|
package/dist/esm/index.js
CHANGED
|
@@ -6582,6 +6582,31 @@ var CommunitiesRoute = /** @class */ (function () {
|
|
|
6582
6582
|
updateEmailTemplate: { url: '/communities/{community_id}/emails/templates/{template_id}', method: HTTP_METHODS.PUT },
|
|
6583
6583
|
deleteEmailTemplate: { url: '/communities/{community_id}/emails/templates/{template_id}', method: HTTP_METHODS.DELETE },
|
|
6584
6584
|
populateEmailTemplate: { url: '/communities/{community_id}/emails/templates/{template_id}/populate', method: HTTP_METHODS.POST },
|
|
6585
|
+
// Newsletters
|
|
6586
|
+
listNewsletters: { url: '/communities/newsletters', method: HTTP_METHODS.GET },
|
|
6587
|
+
createNewsletter: { url: '/communities/{community_id}/newsletters', method: HTTP_METHODS.POST },
|
|
6588
|
+
viewNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.GET },
|
|
6589
|
+
updateNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.PUT },
|
|
6590
|
+
deleteNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.DELETE },
|
|
6591
|
+
importNewsletterSubscribers: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/import', method: HTTP_METHODS.POST },
|
|
6592
|
+
uploadNewsletterBannerImage: { url: '/communities/{community_id}/newsletters/{newsletter_id}/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
6593
|
+
// Campaigns
|
|
6594
|
+
listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
|
|
6595
|
+
createCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.POST },
|
|
6596
|
+
viewCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns/{campaign_id}', method: HTTP_METHODS.GET },
|
|
6597
|
+
updateCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns/{campaign_id}', method: HTTP_METHODS.PUT },
|
|
6598
|
+
deleteCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns/{campaign_id}', method: HTTP_METHODS.DELETE },
|
|
6599
|
+
sendCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns/{campaign_id}/send', method: HTTP_METHODS.POST },
|
|
6600
|
+
scheduleCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns/{campaign_id}/schedule', method: HTTP_METHODS.POST },
|
|
6601
|
+
// Emails
|
|
6602
|
+
listCampaignEmails: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns/{campaign_id}/emails', method: HTTP_METHODS.GET },
|
|
6603
|
+
// Subscribers (admin routes)
|
|
6604
|
+
listNewsletterSubscribers: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers', method: HTTP_METHODS.GET },
|
|
6605
|
+
viewNewsletterSubscriber: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/{subscriber_id}', method: HTTP_METHODS.GET },
|
|
6606
|
+
updateNewsletterSubscriber: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/{subscriber_id}', method: HTTP_METHODS.PUT },
|
|
6607
|
+
deleteNewsletterSubscriber: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/{subscriber_id}', method: HTTP_METHODS.DELETE },
|
|
6608
|
+
// Subscriber registration (open route)
|
|
6609
|
+
registerNewsletterSubscriber: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers', method: HTTP_METHODS.POST },
|
|
6585
6610
|
};
|
|
6586
6611
|
return CommunitiesRoute;
|
|
6587
6612
|
}());
|
|
@@ -7012,6 +7037,258 @@ var Communities = /** @class */ (function () {
|
|
|
7012
7037
|
Communities.populateEmailTemplate = function (community_id, template_id, data, params) {
|
|
7013
7038
|
return Requests.processRoute(CommunitiesRoute.routes.populateEmailTemplate, data, { community_id: community_id, template_id: template_id }, params);
|
|
7014
7039
|
};
|
|
7040
|
+
/**
|
|
7041
|
+
* List all newsletters for a community.
|
|
7042
|
+
*
|
|
7043
|
+
* @param community_id The ID of the community.
|
|
7044
|
+
* @param params Query parameters.
|
|
7045
|
+
* @returns Promise
|
|
7046
|
+
*/
|
|
7047
|
+
Communities.listNewsletters = function (params) {
|
|
7048
|
+
return Requests.processRoute(CommunitiesRoute.routes.listNewsletters, undefined, undefined, params);
|
|
7049
|
+
};
|
|
7050
|
+
/**
|
|
7051
|
+
* Create a new newsletter for a community.
|
|
7052
|
+
*
|
|
7053
|
+
* @param community_id The ID of the community.
|
|
7054
|
+
* @param data The data for the new newsletter.
|
|
7055
|
+
* @returns Promise
|
|
7056
|
+
*/
|
|
7057
|
+
Communities.createNewsletter = function (community_id, data, params) {
|
|
7058
|
+
return Requests.processRoute(CommunitiesRoute.routes.createNewsletter, data, { community_id: community_id }, params);
|
|
7059
|
+
};
|
|
7060
|
+
/**
|
|
7061
|
+
* Get a specific newsletter.
|
|
7062
|
+
*
|
|
7063
|
+
* @param community_id The ID of the community.
|
|
7064
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7065
|
+
* @param params Query parameters.
|
|
7066
|
+
* @returns Promise
|
|
7067
|
+
*/
|
|
7068
|
+
Communities.viewNewsletter = function (community_id, newsletter_id, params) {
|
|
7069
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewNewsletter, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7070
|
+
};
|
|
7071
|
+
/**
|
|
7072
|
+
* Update a specific newsletter.
|
|
7073
|
+
*
|
|
7074
|
+
* @param community_id The ID of the community.
|
|
7075
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7076
|
+
* @param data The data to update.
|
|
7077
|
+
* @returns Promise
|
|
7078
|
+
*/
|
|
7079
|
+
Communities.updateNewsletter = function (community_id, newsletter_id, data, params) {
|
|
7080
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateNewsletter, data, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7081
|
+
};
|
|
7082
|
+
/**
|
|
7083
|
+
* Delete a specific newsletter.
|
|
7084
|
+
*
|
|
7085
|
+
* @param community_id The ID of the community.
|
|
7086
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7087
|
+
* @returns Promise
|
|
7088
|
+
*/
|
|
7089
|
+
Communities.deleteNewsletter = function (community_id, newsletter_id, params) {
|
|
7090
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteNewsletter, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7091
|
+
};
|
|
7092
|
+
/**
|
|
7093
|
+
* Import subscribers from a CSV or XLS file into a newsletter.
|
|
7094
|
+
*
|
|
7095
|
+
* @param community_id The ID of the community.
|
|
7096
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7097
|
+
* @param file The CSV or XLS file.
|
|
7098
|
+
* @param params Additional parameters.
|
|
7099
|
+
* @returns Promise
|
|
7100
|
+
*/
|
|
7101
|
+
Communities.importNewsletterSubscribers = function (community_id, newsletter_id, file, data, params) {
|
|
7102
|
+
var url = CommunitiesRoute.routes.importNewsletterSubscribers.url
|
|
7103
|
+
.replace('{community_id}', community_id)
|
|
7104
|
+
.replace('{newsletter_id}', newsletter_id);
|
|
7105
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
7106
|
+
};
|
|
7107
|
+
/**
|
|
7108
|
+
* Updates the banner image for the game show using a File object.
|
|
7109
|
+
*
|
|
7110
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
7111
|
+
*
|
|
7112
|
+
* @param file The file object to upload.
|
|
7113
|
+
* @param data Any additional data to pass along to the upload.
|
|
7114
|
+
*
|
|
7115
|
+
* @returns promise
|
|
7116
|
+
*/
|
|
7117
|
+
Communities.uploadNewsletterBannerImageFile = function (community_id, newsletter_id, file, data, params) {
|
|
7118
|
+
var url = CommunitiesRoute.routes.uploadNewsletterBannerImage.url
|
|
7119
|
+
.replace('{community_id}', community_id)
|
|
7120
|
+
.replace('{newsletter_id}', newsletter_id);
|
|
7121
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
7122
|
+
};
|
|
7123
|
+
/**
|
|
7124
|
+
* Updates the banner image for the game show using a Blob.
|
|
7125
|
+
*
|
|
7126
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
7127
|
+
*
|
|
7128
|
+
* @param blob The blob to upload.
|
|
7129
|
+
* @param data Any additional data to pass along to the upload
|
|
7130
|
+
*
|
|
7131
|
+
* @returns promise
|
|
7132
|
+
*/
|
|
7133
|
+
Communities.uploadNewsletterBannerImageBlob = function (community_id, newsletter_id, blob, data, params) {
|
|
7134
|
+
var url = CommunitiesRoute.routes.uploadNewsletterBannerImage.url
|
|
7135
|
+
.replace('{community_id}', community_id)
|
|
7136
|
+
.replace('{newsletter_id}', newsletter_id);
|
|
7137
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
7138
|
+
};
|
|
7139
|
+
// Campaigns
|
|
7140
|
+
/**
|
|
7141
|
+
* List all campaigns for a newsletter.
|
|
7142
|
+
*
|
|
7143
|
+
* @param community_id The ID of the community.
|
|
7144
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7145
|
+
* @param params Query parameters.
|
|
7146
|
+
* @returns Promise
|
|
7147
|
+
*/
|
|
7148
|
+
Communities.listCampaigns = function (community_id, newsletter_id, params) {
|
|
7149
|
+
return Requests.processRoute(CommunitiesRoute.routes.listCampaigns, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7150
|
+
};
|
|
7151
|
+
/**
|
|
7152
|
+
* Create a new campaign for a newsletter.
|
|
7153
|
+
*
|
|
7154
|
+
* @param community_id The ID of the community.
|
|
7155
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7156
|
+
* @param data The data for the new campaign.
|
|
7157
|
+
* @returns Promise
|
|
7158
|
+
*/
|
|
7159
|
+
Communities.createCampaign = function (community_id, newsletter_id, data, params) {
|
|
7160
|
+
return Requests.processRoute(CommunitiesRoute.routes.createCampaign, data, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7161
|
+
};
|
|
7162
|
+
/**
|
|
7163
|
+
* Get a specific campaign.
|
|
7164
|
+
*
|
|
7165
|
+
* @param community_id The ID of the community.
|
|
7166
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7167
|
+
* @param campaign_id The ID of the campaign.
|
|
7168
|
+
* @param params Query parameters.
|
|
7169
|
+
* @returns Promise
|
|
7170
|
+
*/
|
|
7171
|
+
Communities.viewCampaign = function (community_id, newsletter_id, campaign_id, params) {
|
|
7172
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewCampaign, undefined, { community_id: community_id, newsletter_id: newsletter_id, campaign_id: campaign_id }, params);
|
|
7173
|
+
};
|
|
7174
|
+
/**
|
|
7175
|
+
* Update a specific campaign.
|
|
7176
|
+
*
|
|
7177
|
+
* @param community_id The ID of the community.
|
|
7178
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7179
|
+
* @param campaign_id The ID of the campaign.
|
|
7180
|
+
* @param data The data to update.
|
|
7181
|
+
* @returns Promise
|
|
7182
|
+
*/
|
|
7183
|
+
Communities.updateCampaign = function (community_id, newsletter_id, campaign_id, data, params) {
|
|
7184
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateCampaign, data, { community_id: community_id, newsletter_id: newsletter_id, campaign_id: campaign_id }, params);
|
|
7185
|
+
};
|
|
7186
|
+
/**
|
|
7187
|
+
* Delete a specific campaign.
|
|
7188
|
+
*
|
|
7189
|
+
* @param community_id The ID of the community.
|
|
7190
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7191
|
+
* @param campaign_id The ID of the campaign.
|
|
7192
|
+
* @returns Promise
|
|
7193
|
+
*/
|
|
7194
|
+
Communities.deleteCampaign = function (community_id, newsletter_id, campaign_id, params) {
|
|
7195
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteCampaign, undefined, { community_id: community_id, newsletter_id: newsletter_id, campaign_id: campaign_id }, params);
|
|
7196
|
+
};
|
|
7197
|
+
/**
|
|
7198
|
+
* Send a campaign immediately.
|
|
7199
|
+
*
|
|
7200
|
+
* @param community_id The ID of the community.
|
|
7201
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7202
|
+
* @param campaign_id The ID of the campaign.
|
|
7203
|
+
* @returns Promise
|
|
7204
|
+
*/
|
|
7205
|
+
Communities.sendCampaign = function (community_id, newsletter_id, campaign_id, params) {
|
|
7206
|
+
return Requests.processRoute(CommunitiesRoute.routes.sendCampaign, undefined, { community_id: community_id, newsletter_id: newsletter_id, campaign_id: campaign_id }, params);
|
|
7207
|
+
};
|
|
7208
|
+
/**
|
|
7209
|
+
* Schedule a campaign to be sent later.
|
|
7210
|
+
*
|
|
7211
|
+
* @param community_id The ID of the community.
|
|
7212
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7213
|
+
* @param campaign_id The ID of the campaign.
|
|
7214
|
+
* @param data The scheduling data (e.g., scheduled_at).
|
|
7215
|
+
* @returns Promise
|
|
7216
|
+
*/
|
|
7217
|
+
Communities.scheduleCampaign = function (community_id, newsletter_id, campaign_id, data, params) {
|
|
7218
|
+
return Requests.processRoute(CommunitiesRoute.routes.scheduleCampaign, data, { community_id: community_id, newsletter_id: newsletter_id, campaign_id: campaign_id }, params);
|
|
7219
|
+
};
|
|
7220
|
+
// Emails
|
|
7221
|
+
/**
|
|
7222
|
+
* List all emails sent in a campaign.
|
|
7223
|
+
*
|
|
7224
|
+
* @param community_id The ID of the community.
|
|
7225
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7226
|
+
* @param campaign_id The ID of the campaign.
|
|
7227
|
+
* @param params Query parameters.
|
|
7228
|
+
* @returns Promise
|
|
7229
|
+
*/
|
|
7230
|
+
Communities.listCampaignEmails = function (community_id, newsletter_id, campaign_id, params) {
|
|
7231
|
+
return Requests.processRoute(CommunitiesRoute.routes.listCampaignEmails, undefined, { community_id: community_id, newsletter_id: newsletter_id, campaign_id: campaign_id }, params);
|
|
7232
|
+
};
|
|
7233
|
+
// Subscribers (admin routes)
|
|
7234
|
+
/**
|
|
7235
|
+
* List all subscribers of a newsletter (admin only).
|
|
7236
|
+
*
|
|
7237
|
+
* @param community_id The ID of the community.
|
|
7238
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7239
|
+
* @param params Query parameters.
|
|
7240
|
+
* @returns Promise
|
|
7241
|
+
*/
|
|
7242
|
+
Communities.listNewsletterSubscribers = function (community_id, newsletter_id, params) {
|
|
7243
|
+
return Requests.processRoute(CommunitiesRoute.routes.listNewsletterSubscribers, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7244
|
+
};
|
|
7245
|
+
/**
|
|
7246
|
+
* Get a specific subscriber of a newsletter (admin only).
|
|
7247
|
+
*
|
|
7248
|
+
* @param community_id The ID of the community.
|
|
7249
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7250
|
+
* @param subscriber_id The ID of the subscriber.
|
|
7251
|
+
* @param params Query parameters.
|
|
7252
|
+
* @returns Promise
|
|
7253
|
+
*/
|
|
7254
|
+
Communities.viewNewsletterSubscriber = function (community_id, newsletter_id, subscriber_id, params) {
|
|
7255
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewNewsletterSubscriber, undefined, { community_id: community_id, newsletter_id: newsletter_id, subscriber_id: subscriber_id }, params);
|
|
7256
|
+
};
|
|
7257
|
+
/**
|
|
7258
|
+
* Update a specific subscriber of a newsletter (admin only).
|
|
7259
|
+
*
|
|
7260
|
+
* @param community_id The ID of the community.
|
|
7261
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7262
|
+
* @param subscriber_id The ID of the subscriber.
|
|
7263
|
+
* @param data The data to update.
|
|
7264
|
+
* @returns Promise
|
|
7265
|
+
*/
|
|
7266
|
+
Communities.updateNewsletterSubscriber = function (community_id, newsletter_id, subscriber_id, data, params) {
|
|
7267
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateNewsletterSubscriber, data, { community_id: community_id, newsletter_id: newsletter_id, subscriber_id: subscriber_id }, params);
|
|
7268
|
+
};
|
|
7269
|
+
/**
|
|
7270
|
+
* Delete a specific subscriber from a newsletter (admin only).
|
|
7271
|
+
*
|
|
7272
|
+
* @param community_id The ID of the community.
|
|
7273
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7274
|
+
* @param subscriber_id The ID of the subscriber.
|
|
7275
|
+
* @returns Promise
|
|
7276
|
+
*/
|
|
7277
|
+
Communities.deleteNewsletterSubscriber = function (community_id, newsletter_id, subscriber_id, params) {
|
|
7278
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteNewsletterSubscriber, undefined, { community_id: community_id, newsletter_id: newsletter_id, subscriber_id: subscriber_id }, params);
|
|
7279
|
+
};
|
|
7280
|
+
// Subscriber registration (open route)
|
|
7281
|
+
/**
|
|
7282
|
+
* Register a new subscriber to a newsletter.
|
|
7283
|
+
*
|
|
7284
|
+
* @param community_id The ID of the community.
|
|
7285
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7286
|
+
* @param data The subscriber data.
|
|
7287
|
+
* @returns Promise
|
|
7288
|
+
*/
|
|
7289
|
+
Communities.registerNewsletterSubscriber = function (community_id, newsletter_id, data, params) {
|
|
7290
|
+
return Requests.processRoute(CommunitiesRoute.routes.registerNewsletterSubscriber, data, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7291
|
+
};
|
|
7015
7292
|
return Communities;
|
|
7016
7293
|
}());
|
|
7017
7294
|
|
|
@@ -10464,6 +10741,12 @@ var GameShowsRoute = /** @class */ (function () {
|
|
|
10464
10741
|
delete: { url: '/gameshows/{show_id}', method: HTTP_METHODS.DELETE },
|
|
10465
10742
|
uploadLogo: { url: '/gameshows/{show_id}/uploadLogo', method: HTTP_METHODS.POST },
|
|
10466
10743
|
uploadBannerImage: { url: '/gameshows/{show_id}/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
10744
|
+
registerTitle: { url: '/gameshows/{show_id}/registerTitle', method: HTTP_METHODS.POST },
|
|
10745
|
+
listTitles: { url: '/gameshows/{show_id}/titles', method: HTTP_METHODS.GET },
|
|
10746
|
+
addTitle: { url: '/gameshows/{show_id}/addTitle', method: HTTP_METHODS.POST },
|
|
10747
|
+
viewTitle: { url: '/gameshows/{show_id}/titles/{title_id}', method: HTTP_METHODS.GET },
|
|
10748
|
+
updateTitle: { url: '/gameshows/{show_id}/titles/{title_id}', method: HTTP_METHODS.PUT },
|
|
10749
|
+
deleteTitle: { url: '/gameshows/{show_id}/titles/{title_id}', method: HTTP_METHODS.DELETE },
|
|
10467
10750
|
};
|
|
10468
10751
|
return GameShowsRoute;
|
|
10469
10752
|
}());
|
|
@@ -10585,6 +10868,42 @@ var GameShows = /** @class */ (function () {
|
|
|
10585
10868
|
var url = GameShowsRoute.routes.uploadBannerImage.url.replace('{show_id}', show_id);
|
|
10586
10869
|
return Requests.uploadBlob(url, 'image', blob, data);
|
|
10587
10870
|
};
|
|
10871
|
+
/**
|
|
10872
|
+
* Register a title to a game show.
|
|
10873
|
+
*/
|
|
10874
|
+
GameShows.registerTitle = function (show_id, data, params) {
|
|
10875
|
+
return Requests.processRoute(GameShowsRoute.routes.registerTitle, data, { show_id: show_id }, params);
|
|
10876
|
+
};
|
|
10877
|
+
/**
|
|
10878
|
+
* Add a title to a game show by admin.
|
|
10879
|
+
*/
|
|
10880
|
+
GameShows.addTitle = function (show_id, data, params) {
|
|
10881
|
+
return Requests.processRoute(GameShowsRoute.routes.addTitle, data, { show_id: show_id }, params);
|
|
10882
|
+
};
|
|
10883
|
+
/**
|
|
10884
|
+
* List all titles for a game show.
|
|
10885
|
+
*/
|
|
10886
|
+
GameShows.listTitles = function (show_id, params) {
|
|
10887
|
+
return Requests.processRoute(GameShowsRoute.routes.listTitles, {}, { show_id: show_id }, params);
|
|
10888
|
+
};
|
|
10889
|
+
/**
|
|
10890
|
+
* Get details of a specific title in a game show.
|
|
10891
|
+
*/
|
|
10892
|
+
GameShows.getTitle = function (show_id, title_id, params) {
|
|
10893
|
+
return Requests.processRoute(GameShowsRoute.routes.getTitle, {}, { show_id: show_id, title_id: title_id }, params);
|
|
10894
|
+
};
|
|
10895
|
+
/**
|
|
10896
|
+
* Update a specific title in a game show.
|
|
10897
|
+
*/
|
|
10898
|
+
GameShows.updateTitle = function (show_id, title_id, data, params) {
|
|
10899
|
+
return Requests.processRoute(GameShowsRoute.routes.updateTitle, data, { show_id: show_id, title_id: title_id }, params);
|
|
10900
|
+
};
|
|
10901
|
+
/**
|
|
10902
|
+
* Delete a specific title from a game show.
|
|
10903
|
+
*/
|
|
10904
|
+
GameShows.deleteTitle = function (show_id, title_id, params) {
|
|
10905
|
+
return Requests.processRoute(GameShowsRoute.routes.deleteTitle, {}, { show_id: show_id, title_id: title_id }, params);
|
|
10906
|
+
};
|
|
10588
10907
|
return GameShows;
|
|
10589
10908
|
}());
|
|
10590
10909
|
|