glitch-javascript-sdk 0.9.5 → 0.9.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 +106 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +30 -0
- package/dist/esm/api/Communities.d.ts +40 -0
- package/dist/esm/api/Users.d.ts +11 -0
- package/dist/esm/index.js +106 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +81 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +42 -0
- package/src/api/Communities.ts +52 -0
- package/src/api/Users.ts +15 -0
- package/src/routes/CampaignsRoute.ts +4 -1
- package/src/routes/CommunitiesRoute.ts +6 -1
- package/src/routes/UserRoutes.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -868,6 +868,46 @@ declare class Communities {
|
|
|
868
868
|
* @returns promise
|
|
869
869
|
*/
|
|
870
870
|
static join<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
871
|
+
/**
|
|
872
|
+
* Add a payment method to the community.
|
|
873
|
+
*
|
|
874
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/51802cc0cb758850807345918130cf3e
|
|
875
|
+
*
|
|
876
|
+
* @param community_id The id of the community to update.
|
|
877
|
+
*
|
|
878
|
+
* @returns promise
|
|
879
|
+
*/
|
|
880
|
+
static addPaymentMethod<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
881
|
+
/**
|
|
882
|
+
* Sets the default payment method for the community.
|
|
883
|
+
*
|
|
884
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/dd743e8a7da3b2bebe557cbc6675380d
|
|
885
|
+
*
|
|
886
|
+
* @param community_id The id of the community to update.
|
|
887
|
+
*
|
|
888
|
+
* @returns promise
|
|
889
|
+
*/
|
|
890
|
+
static setDefaultPaymentMethod<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
891
|
+
/**
|
|
892
|
+
* Get the available payment methods.
|
|
893
|
+
*
|
|
894
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
895
|
+
*
|
|
896
|
+
* @param community_id The id of the community
|
|
897
|
+
*
|
|
898
|
+
* @returns promise
|
|
899
|
+
*/
|
|
900
|
+
static getPaymentMethods<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
901
|
+
/**
|
|
902
|
+
* Get the ledger for all transactions from the community.
|
|
903
|
+
*
|
|
904
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
905
|
+
*
|
|
906
|
+
* @param community_id The id of the community
|
|
907
|
+
*
|
|
908
|
+
* @returns promise
|
|
909
|
+
*/
|
|
910
|
+
static getLedger<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
871
911
|
}
|
|
872
912
|
|
|
873
913
|
declare class Users {
|
|
@@ -911,6 +951,17 @@ declare class Users {
|
|
|
911
951
|
* @returns promise
|
|
912
952
|
*/
|
|
913
953
|
static getCampaignInvites<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
954
|
+
/**
|
|
955
|
+
* Gets payouts from past campaings
|
|
956
|
+
*
|
|
957
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
958
|
+
*
|
|
959
|
+
* @param user_id The id of the user to update.
|
|
960
|
+
* @param data The data to update.
|
|
961
|
+
*
|
|
962
|
+
* @returns promise
|
|
963
|
+
*/
|
|
964
|
+
static getPayouts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
914
965
|
/**
|
|
915
966
|
* Sync the current influencer's information.
|
|
916
967
|
*
|
|
@@ -2682,6 +2733,36 @@ declare class Campaigns {
|
|
|
2682
2733
|
* @returns promise
|
|
2683
2734
|
*/
|
|
2684
2735
|
static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2736
|
+
/**
|
|
2737
|
+
* The route to accept an influnecers request to join the campaign.
|
|
2738
|
+
*
|
|
2739
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencer
|
|
2740
|
+
*
|
|
2741
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2742
|
+
*
|
|
2743
|
+
* @returns promise
|
|
2744
|
+
*/
|
|
2745
|
+
static acceptInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2746
|
+
/**
|
|
2747
|
+
* The route to deny an influencer request to join the campaign.
|
|
2748
|
+
*
|
|
2749
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/denyInfluencer
|
|
2750
|
+
*
|
|
2751
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2752
|
+
*
|
|
2753
|
+
* @returns promise
|
|
2754
|
+
*/
|
|
2755
|
+
static declineInfluencernRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2756
|
+
/**
|
|
2757
|
+
* The route the route to mark the influencers request as in review.
|
|
2758
|
+
*
|
|
2759
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/reviewInfluencer
|
|
2760
|
+
*
|
|
2761
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2762
|
+
*
|
|
2763
|
+
* @returns promise
|
|
2764
|
+
*/
|
|
2765
|
+
static reviewInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2685
2766
|
}
|
|
2686
2767
|
|
|
2687
2768
|
declare class Subscriptions {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -492,6 +492,48 @@ class Campaigns {
|
|
|
492
492
|
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
+
/**
|
|
496
|
+
* The route to accept an influnecers request to join the campaign.
|
|
497
|
+
*
|
|
498
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencer
|
|
499
|
+
*
|
|
500
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
501
|
+
*
|
|
502
|
+
* @returns promise
|
|
503
|
+
*/
|
|
504
|
+
public static acceptInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
505
|
+
|
|
506
|
+
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* The route to deny an influencer request to join the campaign.
|
|
511
|
+
*
|
|
512
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/denyInfluencer
|
|
513
|
+
*
|
|
514
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
515
|
+
*
|
|
516
|
+
* @returns promise
|
|
517
|
+
*/
|
|
518
|
+
public static declineInfluencernRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
519
|
+
|
|
520
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* The route the route to mark the influencers request as in review.
|
|
525
|
+
*
|
|
526
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/reviewInfluencer
|
|
527
|
+
*
|
|
528
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
529
|
+
*
|
|
530
|
+
* @returns promise
|
|
531
|
+
*/
|
|
532
|
+
public static reviewInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
533
|
+
|
|
534
|
+
return Requests.processRoute(CampaignsRoute.routes.reviewInfluencerRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
535
|
+
}
|
|
536
|
+
|
|
495
537
|
|
|
496
538
|
}
|
|
497
539
|
|
package/src/api/Communities.ts
CHANGED
|
@@ -319,7 +319,59 @@ class Communities {
|
|
|
319
319
|
return Requests.processRoute(CommunitiesRoute.routes.join, data, {community_id : community_id}, params);
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Add a payment method to the community.
|
|
324
|
+
*
|
|
325
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/51802cc0cb758850807345918130cf3e
|
|
326
|
+
*
|
|
327
|
+
* @param community_id The id of the community to update.
|
|
328
|
+
*
|
|
329
|
+
* @returns promise
|
|
330
|
+
*/
|
|
331
|
+
public static addPaymentMethod<T>(community_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>>{
|
|
332
|
+
|
|
333
|
+
return Requests.processRoute(CommunitiesRoute.routes.addPaymentMethod, data, {community_id : community_id}, params);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Sets the default payment method for the community.
|
|
338
|
+
*
|
|
339
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/dd743e8a7da3b2bebe557cbc6675380d
|
|
340
|
+
*
|
|
341
|
+
* @param community_id The id of the community to update.
|
|
342
|
+
*
|
|
343
|
+
* @returns promise
|
|
344
|
+
*/
|
|
345
|
+
public static setDefaultPaymentMethod<T>(community_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>>{
|
|
346
|
+
|
|
347
|
+
return Requests.processRoute(CommunitiesRoute.routes.setDefaultPaymentMethod, data, {community_id : community_id}, params);
|
|
348
|
+
}
|
|
322
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Get the available payment methods.
|
|
352
|
+
*
|
|
353
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
354
|
+
*
|
|
355
|
+
* @param community_id The id of the community
|
|
356
|
+
*
|
|
357
|
+
* @returns promise
|
|
358
|
+
*/
|
|
359
|
+
public static getPaymentMethods<T>(community_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
360
|
+
return Requests.processRoute(CommunitiesRoute.routes.getPaymentMethods, {}, {community_id : community_id}, params);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Get the ledger for all transactions from the community.
|
|
365
|
+
*
|
|
366
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
367
|
+
*
|
|
368
|
+
* @param community_id The id of the community
|
|
369
|
+
*
|
|
370
|
+
* @returns promise
|
|
371
|
+
*/
|
|
372
|
+
public static getLedger<T>(community_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
373
|
+
return Requests.processRoute(CommunitiesRoute.routes.getLedger, {}, {community_id : community_id}, params);
|
|
374
|
+
}
|
|
323
375
|
|
|
324
376
|
|
|
325
377
|
|
package/src/api/Users.ts
CHANGED
|
@@ -61,6 +61,21 @@ class Users {
|
|
|
61
61
|
return Requests.processRoute(UserRoutes.routes.getCampaignInvites, {}, undefined, params);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Gets payouts from past campaings
|
|
66
|
+
*
|
|
67
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
68
|
+
*
|
|
69
|
+
* @param user_id The id of the user to update.
|
|
70
|
+
* @param data The data to update.
|
|
71
|
+
*
|
|
72
|
+
* @returns promise
|
|
73
|
+
*/
|
|
74
|
+
public static getPayouts<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
75
|
+
|
|
76
|
+
return Requests.processRoute(UserRoutes.routes.getPayouts, {}, undefined, params);
|
|
77
|
+
}
|
|
78
|
+
|
|
64
79
|
/**
|
|
65
80
|
* Sync the current influencer's information.
|
|
66
81
|
*
|
|
@@ -39,7 +39,10 @@ class CampaignsRoute {
|
|
|
39
39
|
sendInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
40
40
|
acceptInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/accept', method: HTTP_METHODS.POST },
|
|
41
41
|
declineInfluencernInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/decline', method: HTTP_METHODS.POST },
|
|
42
|
-
widthdrawInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/withdraw', method: HTTP_METHODS.POST },
|
|
42
|
+
widthdrawInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/withdraw', method: HTTP_METHODS.POST },
|
|
43
|
+
acceptInfluencerRequest : { url: '/campaigns/{campaign_id}/influencers/{user_id}/accept', method: HTTP_METHODS.POST },
|
|
44
|
+
declineInfluencernRequest : { url: '/campaigns/{campaign_id}/influencers/{user_id}/deny', method: HTTP_METHODS.POST },
|
|
45
|
+
reviewInfluencerRequest : { url: '/campaigns/{campaign_id}/influencers/{user_id}/review', method: HTTP_METHODS.POST },
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
}
|
|
@@ -22,7 +22,12 @@ class CommunitiesRoute {
|
|
|
22
22
|
updateUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.PUT},
|
|
23
23
|
removeUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.DELETE},
|
|
24
24
|
join : {url : '/communities/{community_id}/join', method : HTTP_METHODS.POST},
|
|
25
|
-
findByDomain : {url : '/communities/findByDomain/{domain}', method : HTTP_METHODS.GET}
|
|
25
|
+
findByDomain : {url : '/communities/findByDomain/{domain}', method : HTTP_METHODS.GET},
|
|
26
|
+
addPaymentMethod : {url : '/communities/{community_id}/payment/methods', method : HTTP_METHODS.POST},
|
|
27
|
+
getPaymentMethods : {url : '/communities/{community_i}/payment/methods', method : HTTP_METHODS.GET},
|
|
28
|
+
setDefaultPaymentMethod : {url : '/communities/{community_i}/payment/methods/default', method : HTTP_METHODS.POST},
|
|
29
|
+
getLedger : {url : '/communities/{community_i}/payment/ledger', method : HTTP_METHODS.GET},
|
|
30
|
+
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -34,6 +34,8 @@ class UserRoutes {
|
|
|
34
34
|
addType : { url: '/users/addType', method: HTTP_METHODS.POST },
|
|
35
35
|
removeType : { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
36
36
|
getCampaignInvites : { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
|
|
37
|
+
getPayouts : { url: '/users/payouts', method: HTTP_METHODS.GET },
|
|
38
|
+
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
}
|