glitch-javascript-sdk 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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
package/src/api/Communities.ts
CHANGED
|
@@ -12,7 +12,7 @@ class Communities {
|
|
|
12
12
|
*
|
|
13
13
|
* @returns promise
|
|
14
14
|
*/
|
|
15
|
-
public static list<T>(params?: Record<string, any>)
|
|
15
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
16
16
|
return Requests.processRoute(CommunitiesRoute.routes.list, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -25,7 +25,7 @@ class Communities {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Promise
|
|
27
27
|
*/
|
|
28
|
-
public static create<T>(data
|
|
28
|
+
public static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
29
29
|
|
|
30
30
|
return Requests.processRoute(CommunitiesRoute.routes.create, data, undefined, params);
|
|
31
31
|
}
|
|
@@ -40,9 +40,9 @@ class Communities {
|
|
|
40
40
|
*
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
|
-
public static update<T>(community_id
|
|
43
|
+
public static update<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
44
44
|
|
|
45
|
-
return Requests.processRoute(CommunitiesRoute.routes.update, data, {community_id
|
|
45
|
+
return Requests.processRoute(CommunitiesRoute.routes.update, data, { community_id: community_id }, params);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -54,9 +54,9 @@ class Communities {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns promise
|
|
56
56
|
*/
|
|
57
|
-
public static view<T>(community_id
|
|
57
|
+
public static view<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
58
58
|
|
|
59
|
-
return Requests.processRoute(CommunitiesRoute.routes.view, {}, {community_id
|
|
59
|
+
return Requests.processRoute(CommunitiesRoute.routes.view, {}, { community_id: community_id }, params);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -67,9 +67,9 @@ class Communities {
|
|
|
67
67
|
* @param community_id The id of the community to delete.
|
|
68
68
|
* @returns promise
|
|
69
69
|
*/
|
|
70
|
-
public static delete<T>(community_id
|
|
70
|
+
public static delete<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
71
71
|
|
|
72
|
-
return Requests.processRoute(CommunitiesRoute.routes.delete, {}, {community_id
|
|
72
|
+
return Requests.processRoute(CommunitiesRoute.routes.delete, {}, { community_id: community_id });
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
@@ -82,7 +82,7 @@ class Communities {
|
|
|
82
82
|
*
|
|
83
83
|
* @returns promise
|
|
84
84
|
*/
|
|
85
|
-
public static uploadLogoFile<T>(community_id: string, file
|
|
85
|
+
public static uploadLogoFile<T>(community_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
86
86
|
|
|
87
87
|
let url = CommunitiesRoute.routes.uploadLogo.url.replace('{community_id}', community_id);
|
|
88
88
|
|
|
@@ -99,7 +99,7 @@ class Communities {
|
|
|
99
99
|
*
|
|
100
100
|
* @returns promise
|
|
101
101
|
*/
|
|
102
|
-
public static uploadLogoBlob<T>(community_id: string, blob
|
|
102
|
+
public static uploadLogoBlob<T>(community_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
103
103
|
|
|
104
104
|
let url = CommunitiesRoute.routes.uploadLogo.url.replace('{community_id}', community_id);
|
|
105
105
|
|
|
@@ -116,7 +116,7 @@ class Communities {
|
|
|
116
116
|
*
|
|
117
117
|
* @returns promise
|
|
118
118
|
*/
|
|
119
|
-
public static uploadBannerImageFile<T>(community_id: string, file
|
|
119
|
+
public static uploadBannerImageFile<T>(community_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
120
120
|
|
|
121
121
|
let url = CommunitiesRoute.routes.uploadBannerImage.url.replace('{community_id}', community_id);
|
|
122
122
|
|
|
@@ -133,24 +133,24 @@ class Communities {
|
|
|
133
133
|
*
|
|
134
134
|
* @returns promise
|
|
135
135
|
*/
|
|
136
|
-
public static uploadBannerImageBlob<T>(community_id: string, blob
|
|
136
|
+
public static uploadBannerImageBlob<T>(community_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
137
137
|
|
|
138
138
|
let url = CommunitiesRoute.routes.uploadBannerImage.url.replace('{community_id}', community_id);
|
|
139
139
|
|
|
140
140
|
return Requests.uploadBlob(url, 'image', blob, data, params);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Updates the banner image for the community using a File object.
|
|
145
|
+
*
|
|
146
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
147
|
+
*
|
|
148
|
+
* @param file The file object to upload.
|
|
149
|
+
* @param data Any additional data to pass along to the upload.
|
|
150
|
+
*
|
|
151
|
+
* @returns promise
|
|
152
|
+
*/
|
|
153
|
+
public static uploadVideoLogoFile<T>(community_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
154
154
|
|
|
155
155
|
let url = CommunitiesRoute.routes.uploadVideoLogo.url.replace('{community_id}', community_id);
|
|
156
156
|
|
|
@@ -167,7 +167,7 @@ class Communities {
|
|
|
167
167
|
*
|
|
168
168
|
* @returns promise
|
|
169
169
|
*/
|
|
170
|
-
public static uploadVideoLogoBlob<T>(community_id: string, blob
|
|
170
|
+
public static uploadVideoLogoBlob<T>(community_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
171
171
|
|
|
172
172
|
let url = CommunitiesRoute.routes.uploadVideoLogo.url.replace('{community_id}', community_id);
|
|
173
173
|
|
|
@@ -183,8 +183,8 @@ class Communities {
|
|
|
183
183
|
*
|
|
184
184
|
* @returns promise
|
|
185
185
|
*/
|
|
186
|
-
public static listInvites<T>(community_id
|
|
187
|
-
return Requests.processRoute(CommunitiesRoute.routes.listInvites, {}, {community_id
|
|
186
|
+
public static listInvites<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
187
|
+
return Requests.processRoute(CommunitiesRoute.routes.listInvites, {}, { community_id: community_id }, params);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
/**
|
|
@@ -197,8 +197,8 @@ class Communities {
|
|
|
197
197
|
*
|
|
198
198
|
* @returns promise
|
|
199
199
|
*/
|
|
200
|
-
public static sendInvite<T>(community_id
|
|
201
|
-
return Requests.processRoute(CommunitiesRoute.routes.sendInvite, data, {community_id
|
|
200
|
+
public static sendInvite<T>(community_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
201
|
+
return Requests.processRoute(CommunitiesRoute.routes.sendInvite, data, { community_id: community_id }, params);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/**
|
|
@@ -211,8 +211,8 @@ class Communities {
|
|
|
211
211
|
*
|
|
212
212
|
* @returns promise
|
|
213
213
|
*/
|
|
214
|
-
public static acceptInvite<T>(community_id
|
|
215
|
-
return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, {token
|
|
214
|
+
public static acceptInvite<T>(community_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
215
|
+
return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, { token: token }, { community_id: community_id }, params);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
/**
|
|
@@ -225,8 +225,8 @@ class Communities {
|
|
|
225
225
|
*
|
|
226
226
|
* @returns promise
|
|
227
227
|
*/
|
|
228
|
-
public static retrieveInvite<T>(community_id
|
|
229
|
-
return Requests.processRoute(CommunitiesRoute.routes.retrieveInvite, {}, {community_id
|
|
228
|
+
public static retrieveInvite<T>(community_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
229
|
+
return Requests.processRoute(CommunitiesRoute.routes.retrieveInvite, {}, { community_id: community_id, token: token }, params);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
/**
|
|
@@ -238,8 +238,8 @@ class Communities {
|
|
|
238
238
|
*
|
|
239
239
|
* @returns promise
|
|
240
240
|
*/
|
|
241
|
-
public static listUsers<T>(community_id
|
|
242
|
-
return Requests.processRoute(CommunitiesRoute.routes.listUsers, {}, {community_id
|
|
241
|
+
public static listUsers<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
242
|
+
return Requests.processRoute(CommunitiesRoute.routes.listUsers, {}, { community_id: community_id }, params);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/**
|
|
@@ -252,8 +252,8 @@ class Communities {
|
|
|
252
252
|
*
|
|
253
253
|
* @returns promise
|
|
254
254
|
*/
|
|
255
|
-
public static addUser<T>(community_id
|
|
256
|
-
return Requests.processRoute(CommunitiesRoute.routes.addUser, data, {community_id
|
|
255
|
+
public static addUser<T>(community_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
256
|
+
return Requests.processRoute(CommunitiesRoute.routes.addUser, data, { community_id: community_id }, params);
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
/**
|
|
@@ -266,8 +266,8 @@ class Communities {
|
|
|
266
266
|
*
|
|
267
267
|
* @returns promise
|
|
268
268
|
*/
|
|
269
|
-
public static getUser<T>(community_id
|
|
270
|
-
return Requests.processRoute(CommunitiesRoute.routes.showUser, {}, {community_id
|
|
269
|
+
public static getUser<T>(community_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
270
|
+
return Requests.processRoute(CommunitiesRoute.routes.showUser, {}, { community_id: community_id, user_id: user_id }, params);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
/**
|
|
@@ -278,8 +278,8 @@ class Communities {
|
|
|
278
278
|
*
|
|
279
279
|
* @returns promise
|
|
280
280
|
*/
|
|
281
|
-
public static updatetUser<T>(community_id
|
|
282
|
-
return Requests.processRoute(CommunitiesRoute.routes.updateUser, data, {community_id
|
|
281
|
+
public static updatetUser<T>(community_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
282
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateUser, data, { community_id: community_id, user_id: user_id }, params);
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
@@ -290,8 +290,8 @@ class Communities {
|
|
|
290
290
|
*
|
|
291
291
|
* @returns promise
|
|
292
292
|
*/
|
|
293
|
-
public static removetUser<T>(community_id
|
|
294
|
-
return Requests.processRoute(CommunitiesRoute.routes.removeUser, {}, {community_id
|
|
293
|
+
public static removetUser<T>(community_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
294
|
+
return Requests.processRoute(CommunitiesRoute.routes.removeUser, {}, { community_id: community_id, user_id: user_id }, params);
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
/**
|
|
@@ -301,8 +301,8 @@ class Communities {
|
|
|
301
301
|
*
|
|
302
302
|
* @returns promise
|
|
303
303
|
*/
|
|
304
|
-
public static findByDomain<T>(domain
|
|
305
|
-
return Requests.processRoute(CommunitiesRoute.routes.findByDomain, {}, {domain
|
|
304
|
+
public static findByDomain<T>(domain: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
305
|
+
return Requests.processRoute(CommunitiesRoute.routes.findByDomain, {}, { domain: domain }, params);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
/**
|
|
@@ -314,9 +314,9 @@ class Communities {
|
|
|
314
314
|
*
|
|
315
315
|
* @returns promise
|
|
316
316
|
*/
|
|
317
|
-
public static join<T>(community_id
|
|
317
|
+
public static join<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
318
318
|
|
|
319
|
-
return Requests.processRoute(CommunitiesRoute.routes.join, data, {community_id
|
|
319
|
+
return Requests.processRoute(CommunitiesRoute.routes.join, data, { community_id: community_id }, params);
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
/**
|
|
@@ -328,9 +328,9 @@ class Communities {
|
|
|
328
328
|
*
|
|
329
329
|
* @returns promise
|
|
330
330
|
*/
|
|
331
|
-
public static addPaymentMethod<T>(community_id
|
|
331
|
+
public static addPaymentMethod<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
332
332
|
|
|
333
|
-
return Requests.processRoute(CommunitiesRoute.routes.addPaymentMethod, data, {community_id
|
|
333
|
+
return Requests.processRoute(CommunitiesRoute.routes.addPaymentMethod, data, { community_id: community_id }, params);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
/**
|
|
@@ -342,9 +342,9 @@ class Communities {
|
|
|
342
342
|
*
|
|
343
343
|
* @returns promise
|
|
344
344
|
*/
|
|
345
|
-
public static setDefaultPaymentMethod<T>(community_id
|
|
345
|
+
public static setDefaultPaymentMethod<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
346
346
|
|
|
347
|
-
return Requests.processRoute(CommunitiesRoute.routes.setDefaultPaymentMethod, data, {community_id
|
|
347
|
+
return Requests.processRoute(CommunitiesRoute.routes.setDefaultPaymentMethod, data, { community_id: community_id }, params);
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
/**
|
|
@@ -356,8 +356,8 @@ class Communities {
|
|
|
356
356
|
*
|
|
357
357
|
* @returns promise
|
|
358
358
|
*/
|
|
359
|
-
public static getPaymentMethods<T>(community_id
|
|
360
|
-
return Requests.processRoute(CommunitiesRoute.routes.getPaymentMethods, {}, {community_id
|
|
359
|
+
public static getPaymentMethods<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
360
|
+
return Requests.processRoute(CommunitiesRoute.routes.getPaymentMethods, {}, { community_id: community_id }, params);
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
/**
|
|
@@ -369,8 +369,8 @@ class Communities {
|
|
|
369
369
|
*
|
|
370
370
|
* @returns promise
|
|
371
371
|
*/
|
|
372
|
-
public static getLedger<T>(community_id
|
|
373
|
-
return Requests.processRoute(CommunitiesRoute.routes.getLedger, {}, {community_id
|
|
372
|
+
public static getLedger<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
373
|
+
return Requests.processRoute(CommunitiesRoute.routes.getLedger, {}, { community_id: community_id }, params);
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
/**
|
|
@@ -380,9 +380,9 @@ class Communities {
|
|
|
380
380
|
*
|
|
381
381
|
* @returns promise
|
|
382
382
|
*/
|
|
383
|
-
public static clearDocusignAuth<T>(community_id
|
|
383
|
+
public static clearDocusignAuth<T>(community_id: string): AxiosPromise<Response<T>> {
|
|
384
384
|
|
|
385
|
-
return Requests.processRoute(CommunitiesRoute.routes.clearDocusignAuth, {}, {community_id
|
|
385
|
+
return Requests.processRoute(CommunitiesRoute.routes.clearDocusignAuth, {}, { community_id: community_id });
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
/**
|
|
@@ -392,9 +392,9 @@ class Communities {
|
|
|
392
392
|
*
|
|
393
393
|
* @returns promise
|
|
394
394
|
*/
|
|
395
|
-
public static clearSimplesignAuth<T>(community_id
|
|
395
|
+
public static clearSimplesignAuth<T>(community_id: string): AxiosPromise<Response<T>> {
|
|
396
396
|
|
|
397
|
-
return Requests.processRoute(CommunitiesRoute.routes.clearSimplesignAuth, {}, {community_id
|
|
397
|
+
return Requests.processRoute(CommunitiesRoute.routes.clearSimplesignAuth, {}, { community_id: community_id });
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
/**
|
|
@@ -404,9 +404,9 @@ class Communities {
|
|
|
404
404
|
*
|
|
405
405
|
* @returns promise
|
|
406
406
|
*/
|
|
407
|
-
public static clearHellosignAuth<T>(community_id
|
|
407
|
+
public static clearHellosignAuth<T>(community_id: string): AxiosPromise<Response<T>> {
|
|
408
408
|
|
|
409
|
-
return Requests.processRoute(CommunitiesRoute.routes.clearHellosignAuth, {}, {community_id
|
|
409
|
+
return Requests.processRoute(CommunitiesRoute.routes.clearHellosignAuth, {}, { community_id: community_id });
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
/**
|
|
@@ -416,8 +416,8 @@ class Communities {
|
|
|
416
416
|
*
|
|
417
417
|
* @returns promise
|
|
418
418
|
*/
|
|
419
|
-
public static listEmailTemplates<T>(community_id
|
|
420
|
-
return Requests.processRoute(CommunitiesRoute.routes.listEmailTemplates, undefined, {community_id
|
|
419
|
+
public static listEmailTemplates<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
420
|
+
return Requests.processRoute(CommunitiesRoute.routes.listEmailTemplates, undefined, { community_id: community_id }, params);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
/**
|
|
@@ -429,9 +429,9 @@ class Communities {
|
|
|
429
429
|
*
|
|
430
430
|
* @returns Promise
|
|
431
431
|
*/
|
|
432
|
-
public static createEmailTemplate<T>(community_id
|
|
432
|
+
public static createEmailTemplate<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
433
433
|
|
|
434
|
-
return Requests.processRoute(CommunitiesRoute.routes.createEmailTemplate, data, {community_id
|
|
434
|
+
return Requests.processRoute(CommunitiesRoute.routes.createEmailTemplate, data, { community_id: community_id }, params);
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
/**
|
|
@@ -444,9 +444,9 @@ class Communities {
|
|
|
444
444
|
*
|
|
445
445
|
* @returns promise
|
|
446
446
|
*/
|
|
447
|
-
public static updateEmailTemplate<T>(community_id
|
|
447
|
+
public static updateEmailTemplate<T>(community_id: string, template_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
448
448
|
|
|
449
|
-
return Requests.processRoute(CommunitiesRoute.routes.updateEmailTemplate, data, {community_id
|
|
449
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateEmailTemplate, data, { community_id: community_id, template_id: template_id }, params);
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
/**
|
|
@@ -458,9 +458,9 @@ class Communities {
|
|
|
458
458
|
*
|
|
459
459
|
* @returns promise
|
|
460
460
|
*/
|
|
461
|
-
public static viewEmailTemplate<T>(community_id
|
|
461
|
+
public static viewEmailTemplate<T>(community_id: string, template_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
462
462
|
|
|
463
|
-
return Requests.processRoute(CommunitiesRoute.routes.viewEmailTemplate, {}, {community_id
|
|
463
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewEmailTemplate, {}, { community_id: community_id, template_id: template_id }, params);
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
/**
|
|
@@ -471,9 +471,9 @@ class Communities {
|
|
|
471
471
|
* @param community_id The id of the community to delete.
|
|
472
472
|
* @returns promise
|
|
473
473
|
*/
|
|
474
|
-
public static deleteEmailTemplate<T>(community_id
|
|
474
|
+
public static deleteEmailTemplate<T>(community_id: string, template_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
475
475
|
|
|
476
|
-
return Requests.processRoute(CommunitiesRoute.routes.deleteEmailTemplate, {}, {community_id
|
|
476
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteEmailTemplate, {}, { community_id: community_id, template_id: template_id });
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
/**
|
|
@@ -485,13 +485,298 @@ class Communities {
|
|
|
485
485
|
*
|
|
486
486
|
* @returns Promise
|
|
487
487
|
*/
|
|
488
|
-
public static populateEmailTemplate<T>(community_id
|
|
488
|
+
public static populateEmailTemplate<T>(community_id: string, template_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
489
|
+
|
|
490
|
+
return Requests.processRoute(CommunitiesRoute.routes.populateEmailTemplate, data, { community_id: community_id, template_id: template_id }, params);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* List all newsletters for a community.
|
|
495
|
+
*
|
|
496
|
+
* @param community_id The ID of the community.
|
|
497
|
+
* @param params Query parameters.
|
|
498
|
+
* @returns Promise
|
|
499
|
+
*/
|
|
500
|
+
public static listNewsletters<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
501
|
+
return Requests.processRoute(CommunitiesRoute.routes.listNewsletters, undefined, { community_id }, params);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Create a new newsletter for a community.
|
|
506
|
+
*
|
|
507
|
+
* @param community_id The ID of the community.
|
|
508
|
+
* @param data The data for the new newsletter.
|
|
509
|
+
* @returns Promise
|
|
510
|
+
*/
|
|
511
|
+
public static createNewsletter<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
512
|
+
return Requests.processRoute(CommunitiesRoute.routes.createNewsletter, data, { community_id }, params);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Get a specific newsletter.
|
|
517
|
+
*
|
|
518
|
+
* @param community_id The ID of the community.
|
|
519
|
+
* @param newsletter_id The ID of the newsletter.
|
|
520
|
+
* @param params Query parameters.
|
|
521
|
+
* @returns Promise
|
|
522
|
+
*/
|
|
523
|
+
public static viewNewsletter<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
524
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewNewsletter, undefined, { community_id, newsletter_id }, params);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Update a specific newsletter.
|
|
529
|
+
*
|
|
530
|
+
* @param community_id The ID of the community.
|
|
531
|
+
* @param newsletter_id The ID of the newsletter.
|
|
532
|
+
* @param data The data to update.
|
|
533
|
+
* @returns Promise
|
|
534
|
+
*/
|
|
535
|
+
public static updateNewsletter<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
536
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateNewsletter, data, { community_id, newsletter_id }, params);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Delete a specific newsletter.
|
|
541
|
+
*
|
|
542
|
+
* @param community_id The ID of the community.
|
|
543
|
+
* @param newsletter_id The ID of the newsletter.
|
|
544
|
+
* @returns Promise
|
|
545
|
+
*/
|
|
546
|
+
public static deleteNewsletter<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
547
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteNewsletter, undefined, { community_id, newsletter_id }, params);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Import subscribers from a CSV or XLS file into a newsletter.
|
|
552
|
+
*
|
|
553
|
+
* @param community_id The ID of the community.
|
|
554
|
+
* @param newsletter_id The ID of the newsletter.
|
|
555
|
+
* @param file The CSV or XLS file.
|
|
556
|
+
* @param params Additional parameters.
|
|
557
|
+
* @returns Promise
|
|
558
|
+
*/
|
|
559
|
+
public static importNewsletterSubscribers<T>(community_id: string, newsletter_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
560
|
+
const url = CommunitiesRoute.routes.importNewsletterSubscribers.url
|
|
561
|
+
.replace('{community_id}', community_id)
|
|
562
|
+
.replace('{newsletter_id}', newsletter_id);
|
|
563
|
+
|
|
564
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Updates the banner image for the game show using a File object.
|
|
570
|
+
*
|
|
571
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
572
|
+
*
|
|
573
|
+
* @param file The file object to upload.
|
|
574
|
+
* @param data Any additional data to pass along to the upload.
|
|
575
|
+
*
|
|
576
|
+
* @returns promise
|
|
577
|
+
*/
|
|
578
|
+
public static uploadNewsletterBannerImageFile<T>(community_id: string, newsletter_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
579
|
+
|
|
580
|
+
const url = CommunitiesRoute.routes.uploadNewsletterBannerImage.url
|
|
581
|
+
.replace('{community_id}', community_id)
|
|
582
|
+
.replace('{newsletter_id}', newsletter_id);
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Updates the banner image for the game show using a Blob.
|
|
590
|
+
*
|
|
591
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
592
|
+
*
|
|
593
|
+
* @param blob The blob to upload.
|
|
594
|
+
* @param data Any additional data to pass along to the upload
|
|
595
|
+
*
|
|
596
|
+
* @returns promise
|
|
597
|
+
*/
|
|
598
|
+
public static uploadNewsletterBannerImageBlob<T>(community_id: string, newsletter_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
599
|
+
|
|
600
|
+
const url = CommunitiesRoute.routes.uploadNewsletterBannerImage.url
|
|
601
|
+
.replace('{community_id}', community_id)
|
|
602
|
+
.replace('{newsletter_id}', newsletter_id);
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// Campaigns
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* List all campaigns for a newsletter.
|
|
612
|
+
*
|
|
613
|
+
* @param community_id The ID of the community.
|
|
614
|
+
* @param newsletter_id The ID of the newsletter.
|
|
615
|
+
* @param params Query parameters.
|
|
616
|
+
* @returns Promise
|
|
617
|
+
*/
|
|
618
|
+
public static listCampaigns<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
619
|
+
return Requests.processRoute(CommunitiesRoute.routes.listCampaigns, undefined, { community_id, newsletter_id }, params);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Create a new campaign for a newsletter.
|
|
624
|
+
*
|
|
625
|
+
* @param community_id The ID of the community.
|
|
626
|
+
* @param newsletter_id The ID of the newsletter.
|
|
627
|
+
* @param data The data for the new campaign.
|
|
628
|
+
* @returns Promise
|
|
629
|
+
*/
|
|
630
|
+
public static createCampaign<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
631
|
+
return Requests.processRoute(CommunitiesRoute.routes.createCampaign, data, { community_id, newsletter_id }, params);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Get a specific campaign.
|
|
636
|
+
*
|
|
637
|
+
* @param community_id The ID of the community.
|
|
638
|
+
* @param newsletter_id The ID of the newsletter.
|
|
639
|
+
* @param campaign_id The ID of the campaign.
|
|
640
|
+
* @param params Query parameters.
|
|
641
|
+
* @returns Promise
|
|
642
|
+
*/
|
|
643
|
+
public static viewCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
644
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewCampaign, undefined, { community_id, newsletter_id, campaign_id }, params);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Update a specific campaign.
|
|
649
|
+
*
|
|
650
|
+
* @param community_id The ID of the community.
|
|
651
|
+
* @param newsletter_id The ID of the newsletter.
|
|
652
|
+
* @param campaign_id The ID of the campaign.
|
|
653
|
+
* @param data The data to update.
|
|
654
|
+
* @returns Promise
|
|
655
|
+
*/
|
|
656
|
+
public static updateCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
657
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateCampaign, data, { community_id, newsletter_id, campaign_id }, params);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Delete a specific campaign.
|
|
662
|
+
*
|
|
663
|
+
* @param community_id The ID of the community.
|
|
664
|
+
* @param newsletter_id The ID of the newsletter.
|
|
665
|
+
* @param campaign_id The ID of the campaign.
|
|
666
|
+
* @returns Promise
|
|
667
|
+
*/
|
|
668
|
+
public static deleteCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
669
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteCampaign, undefined, { community_id, newsletter_id, campaign_id }, params);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Send a campaign immediately.
|
|
674
|
+
*
|
|
675
|
+
* @param community_id The ID of the community.
|
|
676
|
+
* @param newsletter_id The ID of the newsletter.
|
|
677
|
+
* @param campaign_id The ID of the campaign.
|
|
678
|
+
* @returns Promise
|
|
679
|
+
*/
|
|
680
|
+
public static sendCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
681
|
+
return Requests.processRoute(CommunitiesRoute.routes.sendCampaign, undefined, { community_id, newsletter_id, campaign_id }, params);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Schedule a campaign to be sent later.
|
|
686
|
+
*
|
|
687
|
+
* @param community_id The ID of the community.
|
|
688
|
+
* @param newsletter_id The ID of the newsletter.
|
|
689
|
+
* @param campaign_id The ID of the campaign.
|
|
690
|
+
* @param data The scheduling data (e.g., scheduled_at).
|
|
691
|
+
* @returns Promise
|
|
692
|
+
*/
|
|
693
|
+
public static scheduleCampaign<T>(community_id: string, newsletter_id: string, campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
694
|
+
return Requests.processRoute(CommunitiesRoute.routes.scheduleCampaign, data, { community_id, newsletter_id, campaign_id }, params);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Emails
|
|
489
698
|
|
|
490
|
-
|
|
699
|
+
/**
|
|
700
|
+
* List all emails sent in a campaign.
|
|
701
|
+
*
|
|
702
|
+
* @param community_id The ID of the community.
|
|
703
|
+
* @param newsletter_id The ID of the newsletter.
|
|
704
|
+
* @param campaign_id The ID of the campaign.
|
|
705
|
+
* @param params Query parameters.
|
|
706
|
+
* @returns Promise
|
|
707
|
+
*/
|
|
708
|
+
public static listCampaignEmails<T>(community_id: string, newsletter_id: string, campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
709
|
+
return Requests.processRoute(CommunitiesRoute.routes.listCampaignEmails, undefined, { community_id, newsletter_id, campaign_id }, params);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// Subscribers (admin routes)
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* List all subscribers of a newsletter (admin only).
|
|
716
|
+
*
|
|
717
|
+
* @param community_id The ID of the community.
|
|
718
|
+
* @param newsletter_id The ID of the newsletter.
|
|
719
|
+
* @param params Query parameters.
|
|
720
|
+
* @returns Promise
|
|
721
|
+
*/
|
|
722
|
+
public static listNewsletterSubscribers<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
723
|
+
return Requests.processRoute(CommunitiesRoute.routes.listNewsletterSubscribers, undefined, { community_id, newsletter_id }, params);
|
|
491
724
|
}
|
|
492
|
-
|
|
493
725
|
|
|
494
|
-
|
|
726
|
+
/**
|
|
727
|
+
* Get a specific subscriber of a newsletter (admin only).
|
|
728
|
+
*
|
|
729
|
+
* @param community_id The ID of the community.
|
|
730
|
+
* @param newsletter_id The ID of the newsletter.
|
|
731
|
+
* @param subscriber_id The ID of the subscriber.
|
|
732
|
+
* @param params Query parameters.
|
|
733
|
+
* @returns Promise
|
|
734
|
+
*/
|
|
735
|
+
public static viewNewsletterSubscriber<T>(community_id: string, newsletter_id: string, subscriber_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
736
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewNewsletterSubscriber, undefined, { community_id, newsletter_id, subscriber_id }, params);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Update a specific subscriber of a newsletter (admin only).
|
|
741
|
+
*
|
|
742
|
+
* @param community_id The ID of the community.
|
|
743
|
+
* @param newsletter_id The ID of the newsletter.
|
|
744
|
+
* @param subscriber_id The ID of the subscriber.
|
|
745
|
+
* @param data The data to update.
|
|
746
|
+
* @returns Promise
|
|
747
|
+
*/
|
|
748
|
+
public static updateNewsletterSubscriber<T>(community_id: string, newsletter_id: string, subscriber_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
749
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateNewsletterSubscriber, data, { community_id, newsletter_id, subscriber_id }, params);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Delete a specific subscriber from a newsletter (admin only).
|
|
754
|
+
*
|
|
755
|
+
* @param community_id The ID of the community.
|
|
756
|
+
* @param newsletter_id The ID of the newsletter.
|
|
757
|
+
* @param subscriber_id The ID of the subscriber.
|
|
758
|
+
* @returns Promise
|
|
759
|
+
*/
|
|
760
|
+
public static deleteNewsletterSubscriber<T>(community_id: string, newsletter_id: string, subscriber_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
761
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteNewsletterSubscriber, undefined, { community_id, newsletter_id, subscriber_id }, params);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// Subscriber registration (open route)
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Register a new subscriber to a newsletter.
|
|
768
|
+
*
|
|
769
|
+
* @param community_id The ID of the community.
|
|
770
|
+
* @param newsletter_id The ID of the newsletter.
|
|
771
|
+
* @param data The subscriber data.
|
|
772
|
+
* @returns Promise
|
|
773
|
+
*/
|
|
774
|
+
public static registerNewsletterSubscriber<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
775
|
+
return Requests.processRoute(CommunitiesRoute.routes.registerNewsletterSubscriber, data, { community_id, newsletter_id }, params);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
495
780
|
|
|
496
781
|
}
|
|
497
782
|
|