glitch-javascript-sdk 1.2.8 → 1.3.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 NewslettersRoutes {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default NewslettersRoutes;
package/dist/index.d.ts CHANGED
@@ -997,7 +997,7 @@ declare class Communities {
997
997
  * @param params Query parameters.
998
998
  * @returns Promise
999
999
  */
1000
- static listNewsletters<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1000
+ static listNewsletters<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1001
1001
  /**
1002
1002
  * Create a new newsletter for a community.
1003
1003
  *
@@ -3707,6 +3707,19 @@ declare class GameShows {
3707
3707
  static deleteTitle<T>(show_id: string, title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3708
3708
  }
3709
3709
 
3710
+ declare class Newsletters {
3711
+ /**
3712
+ * Download the list of publictions, podcasts and blogs.
3713
+ *
3714
+ * @see https://api.glitch.fun/api/documentation#/Newsletters/downloadMarketingChecklists
3715
+ *
3716
+ * @param data The data to be passed when creating a team.
3717
+ *
3718
+ * @returns Promise
3719
+ */
3720
+ static downloadMarketingChecklist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
3721
+ }
3722
+
3710
3723
  interface Route {
3711
3724
  url: string;
3712
3725
  method: string;
@@ -4031,6 +4044,7 @@ declare class Glitch {
4031
4044
  TipEmojis: typeof TipEmojis;
4032
4045
  TipPackagePurchases: typeof TipPackagePurchases;
4033
4046
  Publications: typeof Publications;
4047
+ Newsletters: typeof Newsletters;
4034
4048
  };
4035
4049
  static util: {
4036
4050
  Requests: typeof Requests;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -497,8 +497,8 @@ class Communities {
497
497
  * @param params Query parameters.
498
498
  * @returns Promise
499
499
  */
500
- public static listNewsletters<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
501
- return Requests.processRoute(CommunitiesRoute.routes.listNewsletters, undefined, { community_id }, params);
500
+ public static listNewsletters<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
501
+ return Requests.processRoute(CommunitiesRoute.routes.listNewsletters, undefined, undefined, params);
502
502
  }
503
503
 
504
504
  /**
@@ -0,0 +1,28 @@
1
+ import NewslettersRoutes from "../routes/NewslettersRoutes";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class Newsletters {
7
+
8
+
9
+ /**
10
+ * Download the list of publictions, podcasts and blogs.
11
+ *
12
+ * @see https://api.glitch.fun/api/documentation#/Newsletters/downloadMarketingChecklists
13
+ *
14
+ * @param data The data to be passed when creating a team.
15
+ *
16
+ * @returns Promise
17
+ */
18
+ public static downloadMarketingChecklist<T>(data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
19
+
20
+ return Requests.processRoute(NewslettersRoutes.routes.downloadMarketingChecklist, data, undefined, params);
21
+ }
22
+
23
+
24
+
25
+
26
+ }
27
+
28
+ export default Newsletters;
package/src/api/index.ts CHANGED
@@ -23,6 +23,7 @@ import Influencers from "./Influencers";
23
23
  import Games from "./Games";
24
24
  import Publications from "./Publications";
25
25
  import GameShows from "./GameShows";
26
+ import Newsletters from "./Newsletters"
26
27
 
27
28
  export {Auth};
28
29
  export {Competitions};
@@ -48,4 +49,5 @@ export {Feedback};
48
49
  export {Influencers};
49
50
  export {Games};
50
51
  export {Publications};
51
- export {GameShows};
52
+ export {GameShows};
53
+ export {Newsletters};
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ import {Influencers} from "./api";
27
27
  import {Games} from "./api";
28
28
  import {Publications} from "./api";
29
29
  import {GameShows} from "./api";
30
+ import {Newsletters} from "./api";
30
31
 
31
32
 
32
33
 
@@ -84,7 +85,8 @@ class Glitch {
84
85
  TipPackages : TipPackages,
85
86
  TipEmojis : TipEmojis ,
86
87
  TipPackagePurchases: TipPackagePurchases,
87
- Publications : Publications
88
+ Publications : Publications,
89
+ Newsletters : Newsletters
88
90
  }
89
91
 
90
92
  public static util = {
@@ -38,7 +38,7 @@ class CommunitiesRoute {
38
38
  populateEmailTemplate: { url: '/communities/{community_id}/emails/templates/{template_id}/populate', method: HTTP_METHODS.POST },
39
39
 
40
40
  // Newsletters
41
- listNewsletters: { url: '/communities/{community_id}/newsletters', method: HTTP_METHODS.GET },
41
+ listNewsletters: { url: '/communities/newsletters', method: HTTP_METHODS.GET },
42
42
  createNewsletter: { url: '/communities/{community_id}/newsletters', method: HTTP_METHODS.POST },
43
43
  viewNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.GET },
44
44
  updateNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.PUT },
@@ -0,0 +1,12 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class NewslettersRoutes {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ downloadMarketingChecklist: { url: '/newsletters/downloadMarketingChecklist', method: HTTP_METHODS.POST },
8
+ };
9
+
10
+ }
11
+
12
+ export default NewslettersRoutes;