glitch-javascript-sdk 0.8.9 → 0.9.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 InfluencerRoutes {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default InfluencerRoutes;
package/dist/index.d.ts CHANGED
@@ -2002,6 +2002,14 @@ declare class Utility {
2002
2002
  * @returns promise
2003
2003
  */
2004
2004
  static listEthnicities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2005
+ /**
2006
+ * Get all the game types available on the platform.
2007
+ *
2008
+ * @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilTypes
2009
+ *
2010
+ * @returns promise
2011
+ */
2012
+ static listTypes<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2005
2013
  }
2006
2014
 
2007
2015
  declare class Tips {
@@ -2754,6 +2762,25 @@ declare class Feedback {
2754
2762
  static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2755
2763
  }
2756
2764
 
2765
+ declare class Influencers {
2766
+ /**
2767
+ * Get a list of influencers available on he platform.
2768
+ *
2769
+ * @see https://api.glitch.fun/api/documentation#/Influencers/getInfluencers
2770
+ *
2771
+ * @returns promise
2772
+ */
2773
+ static listInfluencers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2774
+ /**
2775
+ * Retrieve information on a single influencer.
2776
+ *
2777
+ * @see https://api.glitch.fun/api/documentation#/Influencers/getInfluencerById
2778
+ *
2779
+ * @returns promise
2780
+ */
2781
+ static viewInfluencer<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2782
+ }
2783
+
2757
2784
  interface Route {
2758
2785
  url: string;
2759
2786
  method: string;
@@ -3060,6 +3087,7 @@ declare class Glitch {
3060
3087
  Users: typeof Users;
3061
3088
  Events: typeof Events;
3062
3089
  Feedback: typeof Feedback;
3090
+ Influencers: typeof Influencers;
3063
3091
  Teams: typeof Teams;
3064
3092
  Posts: typeof Posts;
3065
3093
  Messages: typeof Messages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.8.9",
3
+ "version": "0.9.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,32 @@
1
+ import InfluencerRoutes from "../routes/InfluencerRoutes";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class Influencers {
7
+
8
+ /**
9
+ * Get a list of influencers available on he platform.
10
+ *
11
+ * @see https://api.glitch.fun/api/documentation#/Influencers/getInfluencers
12
+ *
13
+ * @returns promise
14
+ */
15
+ public static listInfluencers<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
16
+ return Requests.processRoute(InfluencerRoutes.routes.listInfluencers, undefined, undefined, params);
17
+ }
18
+
19
+ /**
20
+ * Retrieve information on a single influencer.
21
+ *
22
+ * @see https://api.glitch.fun/api/documentation#/Influencers/getInfluencerById
23
+ *
24
+ * @returns promise
25
+ */
26
+ public static viewInfluencer<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
27
+ return Requests.processRoute(InfluencerRoutes.routes.viewInfluencer, undefined, undefined, params);
28
+ }
29
+
30
+ }
31
+
32
+ export default Influencers;
@@ -60,6 +60,17 @@ class Utility {
60
60
  return Requests.processRoute(UtilityRoutes.routes.ethnicities, undefined, undefined, params);
61
61
  }
62
62
 
63
+ /**
64
+ * Get all the game types available on the platform.
65
+ *
66
+ * @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilTypes
67
+ *
68
+ * @returns promise
69
+ */
70
+ public static listTypes<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
71
+ return Requests.processRoute(UtilityRoutes.routes.types, undefined, undefined, params);
72
+ }
73
+
63
74
  }
64
75
 
65
76
  export default Utility;
package/src/api/index.ts CHANGED
@@ -19,6 +19,7 @@ import Campaigns from "./Campaigns";
19
19
  import Subscriptions from "./Subscriptions";
20
20
  import Messages from "./Messages";
21
21
  import Feedback from "./Feedback";
22
+ import Influencers from "./Influencers";
22
23
 
23
24
  export {Auth};
24
25
  export {Competitions};
@@ -40,4 +41,5 @@ export {Titles};
40
41
  export {Campaigns};
41
42
  export {Subscriptions};
42
43
  export {Messages};
43
- export {Feedback};
44
+ export {Feedback};
45
+ export {Influencers};
package/src/index.ts CHANGED
@@ -23,6 +23,7 @@ import {Campaigns} from "./api";
23
23
  import {Subscriptions} from "./api";
24
24
  import {Messages} from "./api";
25
25
  import {Feedback} from "./api";
26
+ import {Influencers} from "./api";
26
27
 
27
28
 
28
29
 
@@ -63,6 +64,7 @@ class Glitch {
63
64
  Users: Users,
64
65
  Events: Events,
65
66
  Feedback : Feedback,
67
+ Influencers : Influencers,
66
68
  Teams: Teams,
67
69
  Posts: Posts,
68
70
  Messages : Messages,
@@ -0,0 +1,13 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class InfluencerRoutes {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ listInfluencers: { url: '/influencers', method: HTTP_METHODS.GET },
8
+ viewInfluencer: { url: '/influencers/{influencer_id}', method: HTTP_METHODS.GET },
9
+ };
10
+
11
+ }
12
+
13
+ export default InfluencerRoutes;
@@ -9,6 +9,7 @@ class UtilityRoutes {
9
9
  countries: { url: '/util/countries', method: HTTP_METHODS.GET },
10
10
  genders: { url: '/util/genders', method: HTTP_METHODS.GET },
11
11
  ethnicities : { url: '/util/ethnicities', method: HTTP_METHODS.GET },
12
+ types : { url: '/util/types', method: HTTP_METHODS.GET },
12
13
  };
13
14
 
14
15
  }