glitch-javascript-sdk 0.9.0 → 0.9.2

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
@@ -2762,6 +2762,25 @@ declare class Feedback {
2762
2762
  static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2763
2763
  }
2764
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>(influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2782
+ }
2783
+
2765
2784
  interface Route {
2766
2785
  url: string;
2767
2786
  method: string;
@@ -3068,6 +3087,7 @@ declare class Glitch {
3068
3087
  Users: typeof Users;
3069
3088
  Events: typeof Events;
3070
3089
  Feedback: typeof Feedback;
3090
+ Influencers: typeof Influencers;
3071
3091
  Teams: typeof Teams;
3072
3092
  Posts: typeof Posts;
3073
3093
  Messages: typeof Messages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
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>(influencer_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
27
+ return Requests.processRoute(InfluencerRoutes.routes.viewInfluencer, undefined, {influencer_id : influencer_id}, params);
28
+ }
29
+
30
+ }
31
+
32
+ export default Influencers;
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;