glitch-javascript-sdk 0.5.9 → 0.6.1

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.
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class SocialRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default SocialRoute;
package/dist/index.d.ts CHANGED
@@ -1029,6 +1029,30 @@ declare class Users {
1029
1029
  * @returns promise
1030
1030
  */
1031
1031
  static clearYoutubeAuth<T>(): AxiosPromise<Response<T>>;
1032
+ /**
1033
+ * Clear Reddit authentication information from the current user.
1034
+ *
1035
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
1036
+ *
1037
+ * @returns promise
1038
+ */
1039
+ static clearRedditAuth<T>(): AxiosPromise<Response<T>>;
1040
+ /**
1041
+ * Clear Twitter authentication information from the current user.
1042
+ *
1043
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
1044
+ *
1045
+ * @returns promise
1046
+ */
1047
+ static clearTwitterAuth<T>(): AxiosPromise<Response<T>>;
1048
+ /**
1049
+ * Clear StreamElements authentication information from the current user.
1050
+ *
1051
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
1052
+ *
1053
+ * @returns promise
1054
+ */
1055
+ static clearStreamElementsAuth<T>(): AxiosPromise<Response<T>>;
1032
1056
  /**
1033
1057
  * Returns a list of tips received by the authenticated user for a given month and year
1034
1058
  *
@@ -1068,7 +1092,7 @@ declare class Users {
1068
1092
  *
1069
1093
  * @returns promise
1070
1094
  */
1071
- static getYoutubeChannels<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1095
+ static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1072
1096
  }
1073
1097
 
1074
1098
  declare class Events {
@@ -1766,6 +1790,20 @@ declare class Posts {
1766
1790
  static toggleInteraction<T>(post_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1767
1791
  }
1768
1792
 
1793
+ declare class Social {
1794
+ /**
1795
+ * Give a tip to another user
1796
+ *
1797
+ * @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
1798
+ *
1799
+ * @returns A promise
1800
+ */
1801
+ static postVideoToTikTokFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1802
+ static postVideoToTikTokBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1803
+ static postVideoToFacebookGroupFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1804
+ static postVideoToFacebookGroupBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1805
+ }
1806
+
1769
1807
  declare class Templates {
1770
1808
  /**
1771
1809
  * List all the templates.
@@ -2321,6 +2359,7 @@ declare class Glitch {
2321
2359
  Waitlists: typeof Waitlists;
2322
2360
  Utility: typeof Utility;
2323
2361
  Tips: typeof Tips;
2362
+ Social: typeof Social;
2324
2363
  TipPackages: typeof TipPackages;
2325
2364
  TipEmojis: typeof TipEmojis;
2326
2365
  TipPackagePurchases: typeof TipPackagePurchases;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.5.9",
3
+ "version": "0.6.1",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,48 @@
1
+ import AuthRoutes from "../routes/AuthRoute";
2
+ import SocialRoute from "../routes/SocialRoute";
3
+ import Requests from "../util/Requests";
4
+ import Response from "../util/Response";
5
+ import { AxiosPromise } from "axios";
6
+
7
+ class Social {
8
+
9
+ /**
10
+ * Give a tip to another user
11
+ *
12
+ * @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
13
+ *
14
+ * @returns A promise
15
+ */
16
+ public static postVideoToTikTokFile<T>(file: File, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
17
+
18
+ let url = SocialRoute.routes.postVideoToTikTok.url;
19
+
20
+ return Requests.uploadFile(url, 'video', file, data);
21
+ }
22
+
23
+ public static postVideoToTikTokBlob<T>(blob: Blob, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
24
+
25
+ let url = SocialRoute.routes.postVideoToTikTok.url;
26
+
27
+ return Requests.uploadBlob(url, 'video', blob, data);
28
+ }
29
+
30
+ public static postVideoToFacebookGroupFile<T>(file: File, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
31
+
32
+ let url = SocialRoute.routes.postVideoToFacebookGroup.url;
33
+
34
+ return Requests.uploadFile(url, 'video', file, data);
35
+ }
36
+
37
+ public static postVideoToFacebookGroupBlob<T>(blob: Blob, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
38
+
39
+ let url = SocialRoute.routes.postVideoToFacebookGroup.url;
40
+
41
+ return Requests.uploadBlob(url, 'video', blob, data);
42
+ }
43
+
44
+
45
+
46
+ }
47
+
48
+ export default Social;
package/src/api/Users.ts CHANGED
@@ -231,6 +231,42 @@ class Users {
231
231
  return Requests.processRoute(UserRoutes.routes.clearYoutubeAuth, {});
232
232
  }
233
233
 
234
+ /**
235
+ * Clear Reddit authentication information from the current user.
236
+ *
237
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
238
+ *
239
+ * @returns promise
240
+ */
241
+ public static clearRedditAuth<T>(): AxiosPromise<Response<T>> {
242
+
243
+ return Requests.processRoute(UserRoutes.routes.clearRedditAuth, {});
244
+ }
245
+
246
+ /**
247
+ * Clear Twitter authentication information from the current user.
248
+ *
249
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
250
+ *
251
+ * @returns promise
252
+ */
253
+ public static clearTwitterAuth<T>(): AxiosPromise<Response<T>> {
254
+
255
+ return Requests.processRoute(UserRoutes.routes.clearTwitterAuth, {});
256
+ }
257
+
258
+ /**
259
+ * Clear StreamElements authentication information from the current user.
260
+ *
261
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
262
+ *
263
+ * @returns promise
264
+ */
265
+ public static clearStreamElementsAuth<T>(): AxiosPromise<Response<T>> {
266
+
267
+ return Requests.processRoute(UserRoutes.routes.clearStreamElementsAuth, {});
268
+ }
269
+
234
270
  /**
235
271
  * Returns a list of tips received by the authenticated user for a given month and year
236
272
  *
@@ -286,9 +322,9 @@ class Users {
286
322
  *
287
323
  * @returns promise
288
324
  */
289
- public static getYoutubeChannels<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
325
+ public static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
290
326
 
291
- return Requests.processRoute(UserRoutes.routes.getYoutubeChannels, undefined, undefined, params);
327
+ return Requests.processRoute(UserRoutes.routes.getFacebookGroups, undefined, undefined, params);
292
328
  }
293
329
 
294
330
 
package/src/api/index.ts CHANGED
@@ -6,6 +6,7 @@ import Events from "./Events";
6
6
  import Teams from "./Teams";
7
7
  import Waitlists from "./Waitlist";
8
8
  import Posts from "./Posts";
9
+ import Social from "./Social";
9
10
  import Templates from "./Templates";
10
11
  import Utility from "./Utility";
11
12
  import Tips from "./Tips";
@@ -21,6 +22,7 @@ export {Events};
21
22
  export {Teams};
22
23
  export {Waitlists};
23
24
  export {Posts};
25
+ export {Social};
24
26
  export {Templates};
25
27
  export {Utility};
26
28
  export {Tips};
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ import { Config } from "./config";
5
5
  //API
6
6
  import Auth from "./api/Auth";
7
7
  import Competitions from "./api/Competitions";
8
- import {Communities} from "./api";
8
+ import {Communities, Social} from "./api";
9
9
  import { Users } from "./api";
10
10
  import { Events } from "./api";
11
11
  import { Teams } from "./api";
@@ -58,6 +58,7 @@ class Glitch {
58
58
  Waitlists: Waitlists,
59
59
  Utility : Utility,
60
60
  Tips: Tips,
61
+ Social : Social,
61
62
  TipPackages : TipPackages,
62
63
  TipEmojis : TipEmojis ,
63
64
  TipPackagePurchases: TipPackagePurchases
@@ -0,0 +1,13 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class SocialRoute {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ postVideoToTikTok: { url: '/social/postVideoToTikTok', method: HTTP_METHODS.POST },
8
+ postVideoToFacebookGroup: { url: '/social/postVideoToFacebookGroup', method: HTTP_METHODS.POST },
9
+ };
10
+
11
+ }
12
+
13
+ export default SocialRoute;
@@ -19,12 +19,15 @@ 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
+ clearRedditAuth : { url: '/users/clearRedditAuth', method: HTTP_METHODS.DELETE },
23
+ clearTwitterAuth : { url: '/users/clearTwitterAuth', method: HTTP_METHODS.DELETE },
22
24
  clearStreamElementsAuth : { url: '/users/clearStreamElementsAuth', method: HTTP_METHODS.DELETE },
23
25
  getTipsReceivedForMonth : { url: '/users/getTipsReceivedForMonth', method: HTTP_METHODS.GET },
24
26
  getTipsGivenForMonth : { url: '/users/getTipsGivenForMonth', method: HTTP_METHODS.GET },
25
27
  aggregateMonthlyReceivedTips : { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
26
28
  aggregateMonthlyGivenTips : { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
27
29
  getYoutubeChannels : { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
30
+ getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
28
31
  };
29
32
 
30
33
  }