glitch-javascript-sdk 1.2.5 → 1.2.6
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.
- package/dist/cjs/index.js +40 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Publications.d.ts +23 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +40 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/PublicationsRoutes.d.ts +7 -0
- package/dist/index.d.ts +22 -0
- package/package.json +1 -1
- package/src/api/Publications.ts +38 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/PublicationsRoutes.ts +13 -0
package/dist/index.d.ts
CHANGED
|
@@ -3362,6 +3362,27 @@ declare class Games {
|
|
|
3362
3362
|
static createCampaignData<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3363
3363
|
}
|
|
3364
3364
|
|
|
3365
|
+
declare class Publications {
|
|
3366
|
+
/**
|
|
3367
|
+
* Get a list of all publictions, podcasts and blogs.
|
|
3368
|
+
*
|
|
3369
|
+
* @see https://api.glitch.fun/api/documentation#/Publications/getPublications
|
|
3370
|
+
*
|
|
3371
|
+
* @returns promise
|
|
3372
|
+
*/
|
|
3373
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3374
|
+
/**
|
|
3375
|
+
* Download the list of publictions, podcasts and blogs.
|
|
3376
|
+
*
|
|
3377
|
+
* @see https://api.glitch.fun/api/documentation#/Publications/downloadPublications
|
|
3378
|
+
*
|
|
3379
|
+
* @param data The data to be passed when creating a team.
|
|
3380
|
+
*
|
|
3381
|
+
* @returns Promise
|
|
3382
|
+
*/
|
|
3383
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3365
3386
|
interface Route {
|
|
3366
3387
|
url: string;
|
|
3367
3388
|
method: string;
|
|
@@ -3684,6 +3705,7 @@ declare class Glitch {
|
|
|
3684
3705
|
TipPackages: typeof TipPackages;
|
|
3685
3706
|
TipEmojis: typeof TipEmojis;
|
|
3686
3707
|
TipPackagePurchases: typeof TipPackagePurchases;
|
|
3708
|
+
Publications: typeof Publications;
|
|
3687
3709
|
};
|
|
3688
3710
|
static util: {
|
|
3689
3711
|
Requests: typeof Requests;
|
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import PublicationsRoutes from "../routes/PublicationsRoutes";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class Publications {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Get a list of all publictions, podcasts and blogs.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/Publications/getPublications
|
|
12
|
+
*
|
|
13
|
+
* @returns promise
|
|
14
|
+
*/
|
|
15
|
+
public static list<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(PublicationsRoutes.routes.list, undefined, undefined, params);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Download the list of publictions, podcasts and blogs.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/Publications/downloadPublications
|
|
23
|
+
*
|
|
24
|
+
* @param data The data to be passed when creating a team.
|
|
25
|
+
*
|
|
26
|
+
* @returns Promise
|
|
27
|
+
*/
|
|
28
|
+
public static create<T>(data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
29
|
+
|
|
30
|
+
return Requests.processRoute(PublicationsRoutes.routes.download, data, undefined, params);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default Publications;
|
package/src/api/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ import Messages from "./Messages";
|
|
|
21
21
|
import Feedback from "./Feedback";
|
|
22
22
|
import Influencers from "./Influencers";
|
|
23
23
|
import Games from "./Games";
|
|
24
|
+
import Publications from "./Publications";
|
|
24
25
|
|
|
25
26
|
export {Auth};
|
|
26
27
|
export {Competitions};
|
|
@@ -44,4 +45,5 @@ export {Subscriptions};
|
|
|
44
45
|
export {Messages};
|
|
45
46
|
export {Feedback};
|
|
46
47
|
export {Influencers};
|
|
47
|
-
export {Games};
|
|
48
|
+
export {Games};
|
|
49
|
+
export {Publications};
|
package/src/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {Messages} from "./api";
|
|
|
25
25
|
import {Feedback} from "./api";
|
|
26
26
|
import {Influencers} from "./api";
|
|
27
27
|
import {Games} from "./api";
|
|
28
|
+
import {Publications} from "./api";
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
@@ -80,7 +81,8 @@ class Glitch {
|
|
|
80
81
|
Subscriptions : Subscriptions,
|
|
81
82
|
TipPackages : TipPackages,
|
|
82
83
|
TipEmojis : TipEmojis ,
|
|
83
|
-
TipPackagePurchases: TipPackagePurchases
|
|
84
|
+
TipPackagePurchases: TipPackagePurchases,
|
|
85
|
+
Publications : Publications
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
public static util = {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class PublicationsRoutes {
|
|
5
|
+
|
|
6
|
+
public static routes: { [key: string]: Route } = {
|
|
7
|
+
list: { url: '/publications', method: HTTP_METHODS.GET },
|
|
8
|
+
download: { url: '/publications/download', method: HTTP_METHODS.POST },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default PublicationsRoutes;
|