glitch-javascript-sdk 0.9.7 → 0.9.9
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 +31 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +18 -2
- package/dist/esm/index.js +31 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +18 -2
- package/package.json +1 -1
- package/src/api/Campaigns.ts +27 -4
- package/src/routes/CampaignsRoute.ts +4 -2
- package/src/routes/CommunitiesRoute.ts +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -2438,6 +2438,14 @@ declare class Campaigns {
|
|
|
2438
2438
|
* @returns promise
|
|
2439
2439
|
*/
|
|
2440
2440
|
static delete<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2441
|
+
/**
|
|
2442
|
+
* Get the ledger for this campaign.
|
|
2443
|
+
*
|
|
2444
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLedger
|
|
2445
|
+
*
|
|
2446
|
+
* @returns promise
|
|
2447
|
+
*/
|
|
2448
|
+
static getLedger<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2441
2449
|
/**
|
|
2442
2450
|
* List all the campaign links.
|
|
2443
2451
|
*
|
|
@@ -2446,6 +2454,14 @@ declare class Campaigns {
|
|
|
2446
2454
|
* @returns promise
|
|
2447
2455
|
*/
|
|
2448
2456
|
static listCampaignLinks<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2457
|
+
/**
|
|
2458
|
+
* List all the campaign links.
|
|
2459
|
+
*
|
|
2460
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLinks
|
|
2461
|
+
*
|
|
2462
|
+
* @returns promise
|
|
2463
|
+
*/
|
|
2464
|
+
static listCampaignLinkClicks<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2449
2465
|
/**
|
|
2450
2466
|
* Create a new campaign link.
|
|
2451
2467
|
*
|
|
@@ -2722,7 +2738,7 @@ declare class Campaigns {
|
|
|
2722
2738
|
*
|
|
2723
2739
|
* @returns promise
|
|
2724
2740
|
*/
|
|
2725
|
-
static
|
|
2741
|
+
static declineInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2726
2742
|
/**
|
|
2727
2743
|
* The route for an influencer to decline an invite.
|
|
2728
2744
|
*
|
|
@@ -2752,7 +2768,7 @@ declare class Campaigns {
|
|
|
2752
2768
|
*
|
|
2753
2769
|
* @returns promise
|
|
2754
2770
|
*/
|
|
2755
|
-
static
|
|
2771
|
+
static declineInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2756
2772
|
/**
|
|
2757
2773
|
* The route the route to mark the influencers request as in review.
|
|
2758
2774
|
*
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -72,6 +72,17 @@ class Campaigns {
|
|
|
72
72
|
return Requests.processRoute(CampaignsRoute.routes.deleteCampaign, {}, { campaign_id: campaign_id }, params);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Get the ledger for this campaign.
|
|
77
|
+
*
|
|
78
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLedger
|
|
79
|
+
*
|
|
80
|
+
* @returns promise
|
|
81
|
+
*/
|
|
82
|
+
public static getLedger<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
83
|
+
return Requests.processRoute(CampaignsRoute.routes.getLedger, undefined, undefined, params);
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
|
|
76
87
|
/**
|
|
77
88
|
* List all the campaign links.
|
|
@@ -84,6 +95,18 @@ class Campaigns {
|
|
|
84
95
|
return Requests.processRoute(CampaignsRoute.routes.listCampaignLinks, undefined, { campaign_id: campaign_id }, params);
|
|
85
96
|
}
|
|
86
97
|
|
|
98
|
+
/**
|
|
99
|
+
* List all the campaign links.
|
|
100
|
+
*
|
|
101
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLinks
|
|
102
|
+
*
|
|
103
|
+
* @returns promise
|
|
104
|
+
*/
|
|
105
|
+
public static listCampaignLinkClicks<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
106
|
+
return Requests.processRoute(CampaignsRoute.routes.listCampaignLinkClicks, undefined, { campaign_id: campaign_id }, params);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
87
110
|
/**
|
|
88
111
|
* Create a new campaign link.
|
|
89
112
|
*
|
|
@@ -473,9 +496,9 @@ class Campaigns {
|
|
|
473
496
|
*
|
|
474
497
|
* @returns promise
|
|
475
498
|
*/
|
|
476
|
-
public static
|
|
499
|
+
public static declineInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
477
500
|
|
|
478
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
501
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
479
502
|
}
|
|
480
503
|
|
|
481
504
|
/**
|
|
@@ -515,9 +538,9 @@ class Campaigns {
|
|
|
515
538
|
*
|
|
516
539
|
* @returns promise
|
|
517
540
|
*/
|
|
518
|
-
public static
|
|
541
|
+
public static declineInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
519
542
|
|
|
520
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
543
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencerRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
521
544
|
}
|
|
522
545
|
|
|
523
546
|
/**
|
|
@@ -9,6 +9,7 @@ class CampaignsRoute {
|
|
|
9
9
|
viewCampaign : { url: '/campaigns/{campaign_id}', method: HTTP_METHODS.GET },
|
|
10
10
|
updateCampaign :{ url: '/campaigns/{campaign_id}', method: HTTP_METHODS.PUT },
|
|
11
11
|
deleteCampaign :{ url: '/campaigns/{campaign_id}', method: HTTP_METHODS.DELETE },
|
|
12
|
+
getLedger : { url: '/campaigns/{campaign_id}/ledger', method: HTTP_METHODS.GET },
|
|
12
13
|
listCampaignLinks :{ url: '/campaigns/{campaign_id}/links', method: HTTP_METHODS.GET },
|
|
13
14
|
createCampaignLink :{ url: '/campaigns/{campaign_id}/links', method: HTTP_METHODS.POST },
|
|
14
15
|
getCampaignLink :{ url: '/campaigns/{campaign_id}/links/{link_id}', method: HTTP_METHODS.GET },
|
|
@@ -20,6 +21,7 @@ class CampaignsRoute {
|
|
|
20
21
|
markInfluencerCampaignComplete :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/setComplete', method: HTTP_METHODS.POST },
|
|
21
22
|
markInfluencerCampaignIncomplete :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/setIncomplete', method: HTTP_METHODS.POST },
|
|
22
23
|
listInfluencerCampaignLinks :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/links', method: HTTP_METHODS.GET },
|
|
24
|
+
listInfluencerCampaignLinkClicks :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/linkClicks', method: HTTP_METHODS.GET },
|
|
23
25
|
listCampaignMentions :{ url: '/campaigns/{campaign_id}/mentions', method: HTTP_METHODS.GET },
|
|
24
26
|
createCampaignMention :{ url: '/campaigns/{campaign_id}/mentions', method: HTTP_METHODS.POST },
|
|
25
27
|
getCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
@@ -38,10 +40,10 @@ class CampaignsRoute {
|
|
|
38
40
|
listInfluencerInvites : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.GET },
|
|
39
41
|
sendInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
40
42
|
acceptInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/accept', method: HTTP_METHODS.POST },
|
|
41
|
-
|
|
43
|
+
declineInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/decline', method: HTTP_METHODS.POST },
|
|
42
44
|
widthdrawInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/withdraw', method: HTTP_METHODS.POST },
|
|
43
45
|
acceptInfluencerRequest : { url: '/campaigns/{campaign_id}/influencers/{user_id}/accept', method: HTTP_METHODS.POST },
|
|
44
|
-
|
|
46
|
+
declineInfluencerRequest : { url: '/campaigns/{campaign_id}/influencers/{user_id}/deny', method: HTTP_METHODS.POST },
|
|
45
47
|
reviewInfluencerRequest : { url: '/campaigns/{campaign_id}/influencers/{user_id}/review', method: HTTP_METHODS.POST },
|
|
46
48
|
};
|
|
47
49
|
|
|
@@ -24,9 +24,9 @@ class CommunitiesRoute {
|
|
|
24
24
|
join : {url : '/communities/{community_id}/join', method : HTTP_METHODS.POST},
|
|
25
25
|
findByDomain : {url : '/communities/findByDomain/{domain}', method : HTTP_METHODS.GET},
|
|
26
26
|
addPaymentMethod : {url : '/communities/{community_id}/payment/methods', method : HTTP_METHODS.POST},
|
|
27
|
-
getPaymentMethods : {url : '/communities/{
|
|
28
|
-
setDefaultPaymentMethod : {url : '/communities/{
|
|
29
|
-
getLedger : {url : '/communities/{
|
|
27
|
+
getPaymentMethods : {url : '/communities/{community_id}/payment/methods', method : HTTP_METHODS.GET},
|
|
28
|
+
setDefaultPaymentMethod : {url : '/communities/{community_id}/payment/methods/default', method : HTTP_METHODS.POST},
|
|
29
|
+
getLedger : {url : '/communities/{community_id}/payment/ledger', method : HTTP_METHODS.GET},
|
|
30
30
|
|
|
31
31
|
};
|
|
32
32
|
|