glitch-javascript-sdk 1.4.8 → 1.4.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/index.d.ts CHANGED
@@ -1532,6 +1532,31 @@ declare class Users {
1532
1532
  * @returns promise
1533
1533
  */
1534
1534
  static getInstagramAccounts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1535
+ /**
1536
+ * Gets the Facebook Pages associated with the user.
1537
+ *
1538
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getFacebookPages
1539
+ *
1540
+ * @returns Promise resolving to the list of Facebook Pages
1541
+ */
1542
+ static getFacebookPages<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1543
+ /**
1544
+ * Gets the subreddits the user is subscribed to.
1545
+ *
1546
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubreddits
1547
+ *
1548
+ * @returns Promise resolving to the list of subreddits
1549
+ */
1550
+ static getSubreddits<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1551
+ /**
1552
+ * Gets the flairs for a specific subreddit.
1553
+ *
1554
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditFlairs
1555
+ *
1556
+ * @param subreddit The name of the subreddit to get flairs for.
1557
+ * @returns Promise resolving to the list of flairs
1558
+ */
1559
+ static getSubredditFlairs<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1535
1560
  }
1536
1561
 
1537
1562
  declare class Events {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Users.ts CHANGED
@@ -157,7 +157,7 @@ class Users {
157
157
  *
158
158
  * @returns promise
159
159
  */
160
- public static uploadAvatarImageFile<T>(file : File, data? : object): AxiosPromise<Response<T>> {
160
+ public static uploadAvatarImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>> {
161
161
 
162
162
  return Requests.uploadFile(UserRoutes.routes.uploadAvatar.url, 'image', file, data);
163
163
  }
@@ -172,7 +172,7 @@ class Users {
172
172
  *
173
173
  * @returns promise
174
174
  */
175
- public static uploadAvatarImageBlob<T>(blob : Blob, data? : object): AxiosPromise<Response<T>> {
175
+ public static uploadAvatarImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>> {
176
176
 
177
177
  return Requests.uploadBlob(UserRoutes.routes.uploadAvatar.url, 'image', blob, data);
178
178
  }
@@ -187,7 +187,7 @@ class Users {
187
187
  *
188
188
  * @returns promise
189
189
  */
190
- public static uploadBannerImageFile<T>(file : File, data? : object): AxiosPromise<Response<T>> {
190
+ public static uploadBannerImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>> {
191
191
 
192
192
  return Requests.uploadFile(UserRoutes.routes.uploadBanner.url, 'image', file, data);
193
193
  }
@@ -202,7 +202,7 @@ class Users {
202
202
  *
203
203
  * @returns promise
204
204
  */
205
- public static uploadBannerImageBlob<T>(blob : Blob, data? : object): AxiosPromise<Response<T>> {
205
+ public static uploadBannerImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>> {
206
206
 
207
207
  return Requests.uploadBlob(UserRoutes.routes.uploadBanner.url, 'image', blob, data);
208
208
  }
@@ -220,14 +220,14 @@ class Users {
220
220
  return Requests.processRoute(UserRoutes.routes.createDonationPage, {});
221
221
  }
222
222
 
223
- /**
224
- * Clear Twitches authentication information from the current user.
225
- *
226
- * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
227
- *
228
- * @returns promise
229
- */
230
- public static clearTwitchAuth<T>(): AxiosPromise<Response<T>> {
223
+ /**
224
+ * Clear Twitches authentication information from the current user.
225
+ *
226
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
227
+ *
228
+ * @returns promise
229
+ */
230
+ public static clearTwitchAuth<T>(): AxiosPromise<Response<T>> {
231
231
 
232
232
  return Requests.processRoute(UserRoutes.routes.clearTwitchAuth, {});
233
233
  }
@@ -328,14 +328,14 @@ class Users {
328
328
  return Requests.processRoute(UserRoutes.routes.clearTwitterAuth, {});
329
329
  }
330
330
 
331
- /**
332
- * Clear StreamElements authentication information from the current user.
333
- *
334
- * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
335
- *
336
- * @returns promise
337
- */
338
- public static clearStreamElementsAuth<T>(): AxiosPromise<Response<T>> {
331
+ /**
332
+ * Clear StreamElements authentication information from the current user.
333
+ *
334
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
335
+ *
336
+ * @returns promise
337
+ */
338
+ public static clearStreamElementsAuth<T>(): AxiosPromise<Response<T>> {
339
339
 
340
340
  return Requests.processRoute(UserRoutes.routes.clearStreamElementsAuth, {});
341
341
  }
@@ -425,7 +425,7 @@ class Users {
425
425
  */
426
426
  public static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
427
427
 
428
- return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, {genre_id : genre_id}, params);
428
+ return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, { genre_id: genre_id }, params);
429
429
  }
430
430
 
431
431
  /**
@@ -453,19 +453,19 @@ class Users {
453
453
  */
454
454
  public static removeType<T>(type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
455
455
 
456
- return Requests.processRoute(UserRoutes.routes.removeType, undefined, {type_id : type_id}, params);
456
+ return Requests.processRoute(UserRoutes.routes.removeType, undefined, { type_id: type_id }, params);
457
457
  }
458
458
 
459
- /**
460
- * Verify a user's account to complete their sign-up process.
461
- *
462
- * @see https://api.glitch.fun/api/documentation#/Users%20Route/verifyAccount
463
- *
464
- * @param data The genre information to be passed to update the type information.
465
- *
466
- * @returns Promise
467
- */
468
- public static verifyAccount<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
459
+ /**
460
+ * Verify a user's account to complete their sign-up process.
461
+ *
462
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/verifyAccount
463
+ *
464
+ * @param data The genre information to be passed to update the type information.
465
+ *
466
+ * @returns Promise
467
+ */
468
+ public static verifyAccount<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
469
469
 
470
470
  return Requests.processRoute(UserRoutes.routes.verifyAccount, data, undefined, params);
471
471
  }
@@ -481,7 +481,41 @@ class Users {
481
481
 
482
482
  return Requests.processRoute(UserRoutes.routes.getInstagramAccounts, undefined, undefined, params);
483
483
  }
484
-
484
+
485
+ /**
486
+ * Gets the Facebook Pages associated with the user.
487
+ *
488
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getFacebookPages
489
+ *
490
+ * @returns Promise resolving to the list of Facebook Pages
491
+ */
492
+ public static getFacebookPages<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
493
+ return Requests.processRoute(UserRoutes.routes.getFacebookPages, undefined, undefined, params);
494
+ }
495
+
496
+ /**
497
+ * Gets the subreddits the user is subscribed to.
498
+ *
499
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubreddits
500
+ *
501
+ * @returns Promise resolving to the list of subreddits
502
+ */
503
+ public static getSubreddits<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
504
+ return Requests.processRoute(UserRoutes.routes.getSubreddits, undefined, undefined, params);
505
+ }
506
+
507
+ /**
508
+ * Gets the flairs for a specific subreddit.
509
+ *
510
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditFlairs
511
+ *
512
+ * @param subreddit The name of the subreddit to get flairs for.
513
+ * @returns Promise resolving to the list of flairs
514
+ */
515
+ public static getSubredditFlairs<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
516
+ return Requests.processRoute(UserRoutes.routes.getSubredditFlairs, undefined, { subreddit: subreddit }, params);
517
+ }
518
+
485
519
 
486
520
 
487
521
 
@@ -2,46 +2,50 @@ import Route from "./interface";
2
2
  import HTTP_METHODS from "../constants/HttpMethods";
3
3
 
4
4
  class UserRoutes {
5
-
6
- public static routes: { [key: string]: Route } = {
7
- list: { url: '/users', method: HTTP_METHODS.GET },
8
- update: { url: '/users', method: HTTP_METHODS.PUT },
9
- follow : { url: '/users/{user_id}/follow', method: HTTP_METHODS.POST },
10
- profile :{ url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
11
- me : { url: '/users/me', method: HTTP_METHODS.GET },
12
- syncInfluencer : { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
13
- generateInfluencerProfile : { url: '/users/generateInfluencerProfile', method: HTTP_METHODS.POST },
14
- oneTimeToken : { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
15
- uploadAvatar : { url: '/users/uploadAvatarImage', method: HTTP_METHODS.POST },
16
- uploadBanner : { url: '/users/uploadBannerImage', method: HTTP_METHODS.POST },
17
- createDonationPage : { url: '/users/createDonationPage', method: HTTP_METHODS.POST },
18
- clearTwitchAuth : { url: '/users/clearTwitchAuth', method: HTTP_METHODS.DELETE },
19
- clearFacebookAuth : { url: '/users/clearFacebookAuth', method: HTTP_METHODS.DELETE },
20
- clearGoogleAuth : { url: '/users/clearGoogleAuth', method: HTTP_METHODS.DELETE },
21
- clearStripeAuth : { url: '/users/clearStripeAuth', method: HTTP_METHODS.DELETE },
22
- clearTikTokAuth : { url: '/users/clearTikTokAuth', method: HTTP_METHODS.DELETE },
23
- clearYoutubeAuth : { url: '/users/clearYoutubeAuth', method: HTTP_METHODS.DELETE },
24
- clearRedditAuth : { url: '/users/clearRedditAuth', method: HTTP_METHODS.DELETE },
25
- clearTwitterAuth : { url: '/users/clearTwitterAuth', method: HTTP_METHODS.DELETE },
26
- clearDocusignAuth : { url: '/users/clearDocusignAuth', method: HTTP_METHODS.DELETE },
27
- clearStreamElementsAuth : { url: '/users/clearStreamElementsAuth', method: HTTP_METHODS.DELETE },
28
- getTipsReceivedForMonth : { url: '/users/getTipsReceivedForMonth', method: HTTP_METHODS.GET },
29
- getTipsGivenForMonth : { url: '/users/getTipsGivenForMonth', method: HTTP_METHODS.GET },
30
- aggregateMonthlyReceivedTips : { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
31
- aggregateMonthlyGivenTips : { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
32
- getYoutubeChannels : { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
33
- getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
34
- addGenre : { url: '/users/addGenre', method: HTTP_METHODS.POST },
35
- removeGenre : { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
36
- addType : { url: '/users/addType', method: HTTP_METHODS.POST },
37
- removeType : { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
38
- getCampaignInvites : { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
39
- getPayouts : { url: '/users/payouts', method: HTTP_METHODS.GET },
40
- verifyAccount : { url: '/users/verify', method: HTTP_METHODS.POST },
41
- getInstagramAccounts : { url: '/users/instagramAccounts', method: HTTP_METHODS.GET },
42
5
 
43
- };
6
+ public static routes: { [key: string]: Route } = {
7
+ list: { url: '/users', method: HTTP_METHODS.GET },
8
+ update: { url: '/users', method: HTTP_METHODS.PUT },
9
+ follow: { url: '/users/{user_id}/follow', method: HTTP_METHODS.POST },
10
+ profile: { url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
11
+ me: { url: '/users/me', method: HTTP_METHODS.GET },
12
+ syncInfluencer: { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
13
+ generateInfluencerProfile: { url: '/users/generateInfluencerProfile', method: HTTP_METHODS.POST },
14
+ oneTimeToken: { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
15
+ uploadAvatar: { url: '/users/uploadAvatarImage', method: HTTP_METHODS.POST },
16
+ uploadBanner: { url: '/users/uploadBannerImage', method: HTTP_METHODS.POST },
17
+ createDonationPage: { url: '/users/createDonationPage', method: HTTP_METHODS.POST },
18
+ clearTwitchAuth: { url: '/users/clearTwitchAuth', method: HTTP_METHODS.DELETE },
19
+ clearFacebookAuth: { url: '/users/clearFacebookAuth', method: HTTP_METHODS.DELETE },
20
+ clearGoogleAuth: { url: '/users/clearGoogleAuth', method: HTTP_METHODS.DELETE },
21
+ clearStripeAuth: { url: '/users/clearStripeAuth', method: HTTP_METHODS.DELETE },
22
+ clearTikTokAuth: { url: '/users/clearTikTokAuth', method: HTTP_METHODS.DELETE },
23
+ clearYoutubeAuth: { url: '/users/clearYoutubeAuth', method: HTTP_METHODS.DELETE },
24
+ clearRedditAuth: { url: '/users/clearRedditAuth', method: HTTP_METHODS.DELETE },
25
+ clearTwitterAuth: { url: '/users/clearTwitterAuth', method: HTTP_METHODS.DELETE },
26
+ clearDocusignAuth: { url: '/users/clearDocusignAuth', method: HTTP_METHODS.DELETE },
27
+ clearStreamElementsAuth: { url: '/users/clearStreamElementsAuth', method: HTTP_METHODS.DELETE },
28
+ getTipsReceivedForMonth: { url: '/users/getTipsReceivedForMonth', method: HTTP_METHODS.GET },
29
+ getTipsGivenForMonth: { url: '/users/getTipsGivenForMonth', method: HTTP_METHODS.GET },
30
+ aggregateMonthlyReceivedTips: { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
31
+ aggregateMonthlyGivenTips: { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
32
+ getYoutubeChannels: { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
33
+ getFacebookGroups: { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
34
+ addGenre: { url: '/users/addGenre', method: HTTP_METHODS.POST },
35
+ removeGenre: { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
36
+ addType: { url: '/users/addType', method: HTTP_METHODS.POST },
37
+ removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
38
+ getCampaignInvites: { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
39
+ getPayouts: { url: '/users/payouts', method: HTTP_METHODS.GET },
40
+ verifyAccount: { url: '/users/verify', method: HTTP_METHODS.POST },
41
+ getInstagramAccounts: { url: '/users/instagramAccounts', method: HTTP_METHODS.GET },
44
42
 
45
- }
43
+ getFacebookPages: { url: "/users/facebookPages", method: HTTP_METHODS.GET },
44
+ getSubreddits: { url: "/users/reddit/subreddits", method: HTTP_METHODS.GET },
45
+ getSubredditFlairs: { url: "/users/reddit/redditflairs/{subreddit}", method: HTTP_METHODS.GET },
46
46
 
47
- export default UserRoutes;
47
+ };
48
+
49
+ }
50
+
51
+ export default UserRoutes;