glitch-javascript-sdk 1.2.4 → 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 +66 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +20 -0
- 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 +66 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/PublicationsRoutes.d.ts +7 -0
- package/dist/index.d.ts +42 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +28 -0
- package/src/api/Publications.ts +38 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/CampaignsRoute.ts +2 -1
- package/src/routes/PublicationsRoutes.ts +13 -0
package/dist/index.d.ts
CHANGED
|
@@ -3062,6 +3062,26 @@ declare class Campaigns {
|
|
|
3062
3062
|
* @returns promise
|
|
3063
3063
|
*/
|
|
3064
3064
|
static listPayouts<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3065
|
+
/**
|
|
3066
|
+
* Generate a contract for the influencer based on the values in the campaign.
|
|
3067
|
+
*
|
|
3068
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/generateCampaignContract
|
|
3069
|
+
*
|
|
3070
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
3071
|
+
*
|
|
3072
|
+
* @returns promise
|
|
3073
|
+
*/
|
|
3074
|
+
static generateCampaignContract<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3075
|
+
/**
|
|
3076
|
+
* Send a contract with Docusign.
|
|
3077
|
+
*
|
|
3078
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/sendCampaignContractWithDocusign
|
|
3079
|
+
*
|
|
3080
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
3081
|
+
*
|
|
3082
|
+
* @returns promise
|
|
3083
|
+
*/
|
|
3084
|
+
static sendCampaignContractWithDocusign<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3065
3085
|
}
|
|
3066
3086
|
|
|
3067
3087
|
declare class Subscriptions {
|
|
@@ -3342,6 +3362,27 @@ declare class Games {
|
|
|
3342
3362
|
static createCampaignData<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3343
3363
|
}
|
|
3344
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
|
+
|
|
3345
3386
|
interface Route {
|
|
3346
3387
|
url: string;
|
|
3347
3388
|
method: string;
|
|
@@ -3664,6 +3705,7 @@ declare class Glitch {
|
|
|
3664
3705
|
TipPackages: typeof TipPackages;
|
|
3665
3706
|
TipEmojis: typeof TipEmojis;
|
|
3666
3707
|
TipPackagePurchases: typeof TipPackagePurchases;
|
|
3708
|
+
Publications: typeof Publications;
|
|
3667
3709
|
};
|
|
3668
3710
|
static util: {
|
|
3669
3711
|
Requests: typeof Requests;
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -737,6 +737,34 @@ class Campaigns {
|
|
|
737
737
|
return Requests.processRoute(CampaignsRoute.routes.getLedger, undefined, { campaign_id: campaign_id }, params);
|
|
738
738
|
}
|
|
739
739
|
|
|
740
|
+
/**
|
|
741
|
+
* Generate a contract for the influencer based on the values in the campaign.
|
|
742
|
+
*
|
|
743
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/generateCampaignContract
|
|
744
|
+
*
|
|
745
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
746
|
+
*
|
|
747
|
+
* @returns promise
|
|
748
|
+
*/
|
|
749
|
+
public static generateCampaignContract<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
750
|
+
|
|
751
|
+
return Requests.processRoute(CampaignsRoute.routes.generateCampaignContract, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Send a contract with Docusign.
|
|
756
|
+
*
|
|
757
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/sendCampaignContractWithDocusign
|
|
758
|
+
*
|
|
759
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
760
|
+
*
|
|
761
|
+
* @returns promise
|
|
762
|
+
*/
|
|
763
|
+
public static sendCampaignContractWithDocusign<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
764
|
+
|
|
765
|
+
return Requests.processRoute(CampaignsRoute.routes.sendCampaignContractWithDocusign, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
766
|
+
}
|
|
767
|
+
|
|
740
768
|
|
|
741
769
|
}
|
|
742
770
|
|
|
@@ -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 = {
|
|
@@ -59,7 +59,8 @@ class CampaignsRoute {
|
|
|
59
59
|
resendAcceptanceEmail : { url: '/campaigns/{campaign_id}/influencers/{user_id}/resendInvite', method: HTTP_METHODS.POST },
|
|
60
60
|
payInfluencer : { url: '/campaigns/{campaign_id}/influencers/{user_id}/payInfluencer', method: HTTP_METHODS.POST },
|
|
61
61
|
listPayouts :{ url: '/campaigns/{campaign_id}/payouts', method: HTTP_METHODS.GET },
|
|
62
|
-
|
|
62
|
+
generateCampaignContract : { url: '/campaigns/{campaign_id}/influencers/{user_id}/contract', method: HTTP_METHODS.POST },
|
|
63
|
+
sendCampaignContractWithDocusign : { url: '/campaigns/{campaign_id}/influencers/{user_id}/docusign', method: HTTP_METHODS.POST },
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
};
|
|
@@ -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;
|