glitch-javascript-sdk 0.5.9 → 0.6.0

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,14 @@ declare class Users {
1029
1029
  * @returns promise
1030
1030
  */
1031
1031
  static clearYoutubeAuth<T>(): AxiosPromise<Response<T>>;
1032
+ /**
1033
+ * Clear StreamElements 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 clearStreamElementsAuth<T>(): AxiosPromise<Response<T>>;
1032
1040
  /**
1033
1041
  * Returns a list of tips received by the authenticated user for a given month and year
1034
1042
  *
@@ -1068,7 +1076,7 @@ declare class Users {
1068
1076
  *
1069
1077
  * @returns promise
1070
1078
  */
1071
- static getYoutubeChannels<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1079
+ static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1072
1080
  }
1073
1081
 
1074
1082
  declare class Events {
@@ -1766,6 +1774,20 @@ declare class Posts {
1766
1774
  static toggleInteraction<T>(post_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1767
1775
  }
1768
1776
 
1777
+ declare class Social {
1778
+ /**
1779
+ * Give a tip to another user
1780
+ *
1781
+ * @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
1782
+ *
1783
+ * @returns A promise
1784
+ */
1785
+ static postVideoToTikTokFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1786
+ static postVideoToTikTokBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1787
+ static postVideoToFacebookGroupFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1788
+ static postVideoToFacebookGroupBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1789
+ }
1790
+
1769
1791
  declare class Templates {
1770
1792
  /**
1771
1793
  * List all the templates.
@@ -2321,6 +2343,7 @@ declare class Glitch {
2321
2343
  Waitlists: typeof Waitlists;
2322
2344
  Utility: typeof Utility;
2323
2345
  Tips: typeof Tips;
2346
+ Social: typeof Social;
2324
2347
  TipPackages: typeof TipPackages;
2325
2348
  TipEmojis: typeof TipEmojis;
2326
2349
  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.0",
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,18 @@ class Users {
231
231
  return Requests.processRoute(UserRoutes.routes.clearYoutubeAuth, {});
232
232
  }
233
233
 
234
+ /**
235
+ * Clear StreamElements 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 clearStreamElementsAuth<T>(): AxiosPromise<Response<T>> {
242
+
243
+ return Requests.processRoute(UserRoutes.routes.clearStreamElementsAuth, {});
244
+ }
245
+
234
246
  /**
235
247
  * Returns a list of tips received by the authenticated user for a given month and year
236
248
  *
@@ -286,9 +298,9 @@ class Users {
286
298
  *
287
299
  * @returns promise
288
300
  */
289
- public static getYoutubeChannels<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
301
+ public static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
290
302
 
291
- return Requests.processRoute(UserRoutes.routes.getYoutubeChannels, undefined, undefined, params);
303
+ return Requests.processRoute(UserRoutes.routes.getFacebookGroups, undefined, undefined, params);
292
304
  }
293
305
 
294
306
 
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;
@@ -25,6 +25,7 @@ class UserRoutes {
25
25
  aggregateMonthlyReceivedTips : { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
26
26
  aggregateMonthlyGivenTips : { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
27
27
  getYoutubeChannels : { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
28
+ getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
28
29
  };
29
30
 
30
31
  }