glitch-javascript-sdk 0.9.4 → 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 +114 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +34 -4
- package/dist/esm/api/Communities.d.ts +40 -0
- package/dist/esm/api/Users.d.ts +11 -0
- package/dist/esm/index.js +114 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +85 -4
- package/package.json +1 -1
- package/src/api/Campaigns.ts +50 -8
- 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
|
*
|
|
@@ -2641,7 +2692,7 @@ declare class Campaigns {
|
|
|
2641
2692
|
*
|
|
2642
2693
|
* @returns promise
|
|
2643
2694
|
*/
|
|
2644
|
-
static sendInfluencerInvite<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2695
|
+
static sendInfluencerInvite<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2645
2696
|
/**
|
|
2646
2697
|
* Invites an influencer to join this campaign.
|
|
2647
2698
|
*
|
|
@@ -2661,7 +2712,7 @@ declare class Campaigns {
|
|
|
2661
2712
|
*
|
|
2662
2713
|
* @returns promise
|
|
2663
2714
|
*/
|
|
2664
|
-
static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2715
|
+
static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2665
2716
|
/**
|
|
2666
2717
|
* The route for an influencer to decline an invite.
|
|
2667
2718
|
*
|
|
@@ -2671,7 +2722,7 @@ declare class Campaigns {
|
|
|
2671
2722
|
*
|
|
2672
2723
|
* @returns promise
|
|
2673
2724
|
*/
|
|
2674
|
-
static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2725
|
+
static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2675
2726
|
/**
|
|
2676
2727
|
* The route for an influencer to decline an invite.
|
|
2677
2728
|
*
|
|
@@ -2681,7 +2732,37 @@ declare class Campaigns {
|
|
|
2681
2732
|
*
|
|
2682
2733
|
* @returns promise
|
|
2683
2734
|
*/
|
|
2684
|
-
static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
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
|
@@ -423,9 +423,9 @@ class Campaigns {
|
|
|
423
423
|
*
|
|
424
424
|
* @returns promise
|
|
425
425
|
*/
|
|
426
|
-
public static sendInfluencerInvite<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
426
|
+
public static sendInfluencerInvite<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
427
427
|
|
|
428
|
-
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite,
|
|
428
|
+
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite, data, { campaign_id: campaign_id }, params);
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
/**
|
|
@@ -459,9 +459,9 @@ class Campaigns {
|
|
|
459
459
|
*
|
|
460
460
|
* @returns promise
|
|
461
461
|
*/
|
|
462
|
-
public static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
462
|
+
public static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
463
463
|
|
|
464
|
-
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerInvite,
|
|
464
|
+
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
/**
|
|
@@ -473,9 +473,9 @@ class Campaigns {
|
|
|
473
473
|
*
|
|
474
474
|
* @returns promise
|
|
475
475
|
*/
|
|
476
|
-
public static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
476
|
+
public static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
477
477
|
|
|
478
|
-
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernInvite,
|
|
478
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
/**
|
|
@@ -487,9 +487,51 @@ class Campaigns {
|
|
|
487
487
|
*
|
|
488
488
|
* @returns promise
|
|
489
489
|
*/
|
|
490
|
-
public static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
490
|
+
public static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
491
491
|
|
|
492
|
-
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite,
|
|
492
|
+
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
493
|
+
}
|
|
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);
|
|
493
535
|
}
|
|
494
536
|
|
|
495
537
|
|
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
|
}
|