glitch-javascript-sdk 1.4.7 → 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.
@@ -333,5 +333,30 @@ declare class Users {
333
333
  * @returns promise
334
334
  */
335
335
  static getInstagramAccounts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
336
+ /**
337
+ * Gets the Facebook Pages associated with the user.
338
+ *
339
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getFacebookPages
340
+ *
341
+ * @returns Promise resolving to the list of Facebook Pages
342
+ */
343
+ static getFacebookPages<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
344
+ /**
345
+ * Gets the subreddits the user is subscribed to.
346
+ *
347
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubreddits
348
+ *
349
+ * @returns Promise resolving to the list of subreddits
350
+ */
351
+ static getSubreddits<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
352
+ /**
353
+ * Gets the flairs for a specific subreddit.
354
+ *
355
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditFlairs
356
+ *
357
+ * @param subreddit The name of the subreddit to get flairs for.
358
+ * @returns Promise resolving to the list of flairs
359
+ */
360
+ static getSubredditFlairs<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
336
361
  }
337
362
  export default Users;
package/dist/esm/index.js CHANGED
@@ -5467,15 +5467,12 @@ var Requests = /** @class */ (function () {
5467
5467
  formData.append(key, data[key]);
5468
5468
  }
5469
5469
  // Prepare headers
5470
- var headers = {
5471
- 'Content-Type': 'multipart/form-data',
5472
- };
5470
+ var headers = {};
5473
5471
  if (Requests.authToken) {
5474
5472
  headers['Authorization'] = "Bearer ".concat(Requests.authToken);
5475
5473
  }
5476
- // Format URL
5477
- url = url.replace(/\/\//g, '/');
5478
- var uri = "".concat(Requests.baseUrl).concat(url).replace(/\/\//g, '/');
5474
+ // Format URL correctly
5475
+ var uri = Requests.baseUrl.replace(/\/+$/, '') + '/' + url.replace(/^\/+/, '');
5479
5476
  // Make the request
5480
5477
  return axios$1({
5481
5478
  method: 'POST',
@@ -7379,6 +7376,9 @@ var UserRoutes = /** @class */ (function () {
7379
7376
  getPayouts: { url: '/users/payouts', method: HTTP_METHODS.GET },
7380
7377
  verifyAccount: { url: '/users/verify', method: HTTP_METHODS.POST },
7381
7378
  getInstagramAccounts: { url: '/users/instagramAccounts', method: HTTP_METHODS.GET },
7379
+ getFacebookPages: { url: "/users/facebookPages", method: HTTP_METHODS.GET },
7380
+ getSubreddits: { url: "/users/reddit/subreddits", method: HTTP_METHODS.GET },
7381
+ getSubredditFlairs: { url: "/users/reddit/redditflairs/{subreddit}", method: HTTP_METHODS.GET },
7382
7382
  };
7383
7383
  return UserRoutes;
7384
7384
  }());
@@ -7790,6 +7790,37 @@ var Users = /** @class */ (function () {
7790
7790
  Users.getInstagramAccounts = function (params) {
7791
7791
  return Requests.processRoute(UserRoutes.routes.getInstagramAccounts, undefined, undefined, params);
7792
7792
  };
7793
+ /**
7794
+ * Gets the Facebook Pages associated with the user.
7795
+ *
7796
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getFacebookPages
7797
+ *
7798
+ * @returns Promise resolving to the list of Facebook Pages
7799
+ */
7800
+ Users.getFacebookPages = function (params) {
7801
+ return Requests.processRoute(UserRoutes.routes.getFacebookPages, undefined, undefined, params);
7802
+ };
7803
+ /**
7804
+ * Gets the subreddits the user is subscribed to.
7805
+ *
7806
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubreddits
7807
+ *
7808
+ * @returns Promise resolving to the list of subreddits
7809
+ */
7810
+ Users.getSubreddits = function (params) {
7811
+ return Requests.processRoute(UserRoutes.routes.getSubreddits, undefined, undefined, params);
7812
+ };
7813
+ /**
7814
+ * Gets the flairs for a specific subreddit.
7815
+ *
7816
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditFlairs
7817
+ *
7818
+ * @param subreddit The name of the subreddit to get flairs for.
7819
+ * @returns Promise resolving to the list of flairs
7820
+ */
7821
+ Users.getSubredditFlairs = function (subreddit, params) {
7822
+ return Requests.processRoute(UserRoutes.routes.getSubredditFlairs, undefined, { subreddit: subreddit }, params);
7823
+ };
7793
7824
  return Users;
7794
7825
  }());
7795
7826