glitch-javascript-sdk 0.5.3 → 0.5.5
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 +267 -163
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +33 -0
- package/dist/esm/api/Users.d.ts +32 -0
- package/dist/esm/index.js +86 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +65 -0
- package/package.json +1 -1
- package/src/api/Events.ts +46 -0
- package/src/api/Users.ts +48 -0
- package/src/routes/EventsRoute.ts +3 -3
- package/src/routes/UserRoutes.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -1029,6 +1029,38 @@ declare class Users {
|
|
|
1029
1029
|
* @returns promise
|
|
1030
1030
|
*/
|
|
1031
1031
|
static clearYoutubeAuth<T>(): AxiosPromise<Response<T>>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Returns a list of tips received by the authenticated user for a given month and year
|
|
1034
|
+
*
|
|
1035
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
1036
|
+
*
|
|
1037
|
+
* @returns promise
|
|
1038
|
+
*/
|
|
1039
|
+
static getTipsReceivedForMonth<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Returns a list of tips given by the authenticated user for a given month and year.
|
|
1042
|
+
*
|
|
1043
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
1044
|
+
*
|
|
1045
|
+
* @returns promise
|
|
1046
|
+
*/
|
|
1047
|
+
static getTipsGivenForMonth<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Returns the aggregated monthly tips received by the authenticated user over a certain number of months. Defaults to 12 months if not provided.
|
|
1050
|
+
*
|
|
1051
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
1052
|
+
*
|
|
1053
|
+
* @returns promise
|
|
1054
|
+
*/
|
|
1055
|
+
static aggregateMonthlyReceivedTips<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Returns the aggregated monthly tips given by the authenticated user over a certain number of months. Defaults to 12 months if not provided.
|
|
1058
|
+
*
|
|
1059
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
1060
|
+
*
|
|
1061
|
+
* @returns promise
|
|
1062
|
+
*/
|
|
1063
|
+
static aggregateMonthlyGivenTips<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1032
1064
|
}
|
|
1033
1065
|
|
|
1034
1066
|
declare class Events {
|
|
@@ -1330,6 +1362,39 @@ declare class Events {
|
|
|
1330
1362
|
* @returns promise
|
|
1331
1363
|
*/
|
|
1332
1364
|
static updateRecording<T>(event_id: string, recording_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Enable a widget for the current event.
|
|
1367
|
+
*
|
|
1368
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
1369
|
+
*
|
|
1370
|
+
* @param event_id The id of the event to update.
|
|
1371
|
+
* @param widget_id The id of the widget to enable.
|
|
1372
|
+
* @param data The data, which should contain the roles.
|
|
1373
|
+
*
|
|
1374
|
+
* @returns promise
|
|
1375
|
+
*/
|
|
1376
|
+
static enableWidget<T>(event_id: string, widget_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1377
|
+
/**
|
|
1378
|
+
* Disable a widget for the current event.
|
|
1379
|
+
*
|
|
1380
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
1381
|
+
*
|
|
1382
|
+
* @param event_id The id of the event to update.
|
|
1383
|
+
* @param widget_id The id of the widget to disable.
|
|
1384
|
+
*
|
|
1385
|
+
* @returns promise
|
|
1386
|
+
*/
|
|
1387
|
+
static disableWidget<T>(event_id: string, widget_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Get all the tips associated with the current event.
|
|
1390
|
+
*
|
|
1391
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
1392
|
+
*
|
|
1393
|
+
* @param event_id The id of the event to update.
|
|
1394
|
+
*
|
|
1395
|
+
* @returns promise
|
|
1396
|
+
*/
|
|
1397
|
+
static getTips<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1333
1398
|
}
|
|
1334
1399
|
|
|
1335
1400
|
declare class Teams {
|
package/package.json
CHANGED
package/src/api/Events.ts
CHANGED
|
@@ -436,6 +436,52 @@ class Events {
|
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Enable a widget for the current event.
|
|
441
|
+
*
|
|
442
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
443
|
+
*
|
|
444
|
+
* @param event_id The id of the event to update.
|
|
445
|
+
* @param widget_id The id of the widget to enable.
|
|
446
|
+
* @param data The data, which should contain the roles.
|
|
447
|
+
*
|
|
448
|
+
* @returns promise
|
|
449
|
+
*/
|
|
450
|
+
public static enableWidget<T>(event_id: string, widget_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
451
|
+
|
|
452
|
+
return Requests.processRoute(EventsRoutes.routes.enableWidget, data, { event_id: event_id, widget_id : widget_id }, params);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Disable a widget for the current event.
|
|
457
|
+
*
|
|
458
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
459
|
+
*
|
|
460
|
+
* @param event_id The id of the event to update.
|
|
461
|
+
* @param widget_id The id of the widget to disable.
|
|
462
|
+
*
|
|
463
|
+
* @returns promise
|
|
464
|
+
*/
|
|
465
|
+
public static disableWidget<T>(event_id: string, widget_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
466
|
+
|
|
467
|
+
return Requests.processRoute(EventsRoutes.routes.disableWidget, data, { event_id: event_id, widget_id : widget_id }, params);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Get all the tips associated with the current event.
|
|
472
|
+
*
|
|
473
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
474
|
+
*
|
|
475
|
+
* @param event_id The id of the event to update.
|
|
476
|
+
*
|
|
477
|
+
* @returns promise
|
|
478
|
+
*/
|
|
479
|
+
public static getTips<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
480
|
+
|
|
481
|
+
return Requests.processRoute(EventsRoutes.routes.getTips, {}, { event_id: event_id }, params);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
|
|
439
485
|
}
|
|
440
486
|
|
|
441
487
|
export default Events;
|
package/src/api/Users.ts
CHANGED
|
@@ -231,6 +231,54 @@ class Users {
|
|
|
231
231
|
return Requests.processRoute(UserRoutes.routes.clearYoutubeAuth, {});
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Returns a list of tips received by the authenticated user for a given month and year
|
|
236
|
+
*
|
|
237
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
238
|
+
*
|
|
239
|
+
* @returns promise
|
|
240
|
+
*/
|
|
241
|
+
public static getTipsReceivedForMonth<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
242
|
+
|
|
243
|
+
return Requests.processRoute(UserRoutes.routes.getTipsReceivedForMonth, undefined, undefined, params);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Returns a list of tips given by the authenticated user for a given month and year.
|
|
248
|
+
*
|
|
249
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
250
|
+
*
|
|
251
|
+
* @returns promise
|
|
252
|
+
*/
|
|
253
|
+
public static getTipsGivenForMonth<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
254
|
+
|
|
255
|
+
return Requests.processRoute(UserRoutes.routes.getTipsGivenForMonth, undefined, undefined, params);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Returns the aggregated monthly tips received by the authenticated user over a certain number of months. Defaults to 12 months if not provided.
|
|
260
|
+
*
|
|
261
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
262
|
+
*
|
|
263
|
+
* @returns promise
|
|
264
|
+
*/
|
|
265
|
+
public static aggregateMonthlyReceivedTips<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
266
|
+
|
|
267
|
+
return Requests.processRoute(UserRoutes.routes.aggregateMonthlyReceivedTips, undefined, undefined, params);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Returns the aggregated monthly tips given by the authenticated user over a certain number of months. Defaults to 12 months if not provided.
|
|
272
|
+
*
|
|
273
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
274
|
+
*
|
|
275
|
+
* @returns promise
|
|
276
|
+
*/
|
|
277
|
+
public static aggregateMonthlyGivenTips<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
278
|
+
|
|
279
|
+
return Requests.processRoute(UserRoutes.routes.aggregateMonthlyGivenTips, undefined, undefined, params);
|
|
280
|
+
}
|
|
281
|
+
|
|
234
282
|
|
|
235
283
|
|
|
236
284
|
|
|
@@ -30,9 +30,9 @@ class EventsRoutes {
|
|
|
30
30
|
addTwitchMulticast : {url : '/events/{event_id}/addTwitchMulticast', method : HTTP_METHODS.POST},
|
|
31
31
|
addFacebookMulticast : {url : '/events/{event_id}/addFacebookMulticast', method : HTTP_METHODS.POST},
|
|
32
32
|
addYoutubeMulticast : {url : '/events/{event_id}/addYoutubeMulticast', method : HTTP_METHODS.POST},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
enableWidget : {url : '/events/{event_id}/enableWidget/{widget_id}', method : HTTP_METHODS.POST},
|
|
34
|
+
disableWidget : {url : '/events/{event_id}/disableWidget/{widget_id}', method : HTTP_METHODS.DELETE},
|
|
35
|
+
getTips : {url : '/events/{event_id}/tips', method : HTTP_METHODS.GET},
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -19,6 +19,10 @@ class UserRoutes {
|
|
|
19
19
|
clearStripeAuth : { url: '/users/clearStripeAuth', method: HTTP_METHODS.DELETE },
|
|
20
20
|
clearTikTokAuth : { url: '/users/clearTikTokAuth', method: HTTP_METHODS.DELETE },
|
|
21
21
|
clearYoutubeAuth : { url: '/users/clearYoutubeAuth', method: HTTP_METHODS.DELETE },
|
|
22
|
+
getTipsReceivedForMonth : { url: '/users/getTipsReceivedForMonth', method: HTTP_METHODS.GET },
|
|
23
|
+
getTipsGivenForMonth : { url: '/users/getTipsGivenForMonth', method: HTTP_METHODS.GET },
|
|
24
|
+
aggregateMonthlyReceivedTips : { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
|
|
25
|
+
aggregateMonthlyGivenTips : { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
}
|