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
|
@@ -303,7 +303,7 @@ declare class Campaigns {
|
|
|
303
303
|
*
|
|
304
304
|
* @returns promise
|
|
305
305
|
*/
|
|
306
|
-
static sendInfluencerInvite<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
306
|
+
static sendInfluencerInvite<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
307
307
|
/**
|
|
308
308
|
* Invites an influencer to join this campaign.
|
|
309
309
|
*
|
|
@@ -323,7 +323,7 @@ declare class Campaigns {
|
|
|
323
323
|
*
|
|
324
324
|
* @returns promise
|
|
325
325
|
*/
|
|
326
|
-
static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
326
|
+
static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
327
327
|
/**
|
|
328
328
|
* The route for an influencer to decline an invite.
|
|
329
329
|
*
|
|
@@ -333,7 +333,7 @@ declare class Campaigns {
|
|
|
333
333
|
*
|
|
334
334
|
* @returns promise
|
|
335
335
|
*/
|
|
336
|
-
static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
336
|
+
static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
337
337
|
/**
|
|
338
338
|
* The route for an influencer to decline an invite.
|
|
339
339
|
*
|
|
@@ -343,6 +343,36 @@ declare class Campaigns {
|
|
|
343
343
|
*
|
|
344
344
|
* @returns promise
|
|
345
345
|
*/
|
|
346
|
-
static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
346
|
+
static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
347
|
+
/**
|
|
348
|
+
* The route to accept an influnecers request to join the campaign.
|
|
349
|
+
*
|
|
350
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencer
|
|
351
|
+
*
|
|
352
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
353
|
+
*
|
|
354
|
+
* @returns promise
|
|
355
|
+
*/
|
|
356
|
+
static acceptInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
357
|
+
/**
|
|
358
|
+
* The route to deny an influencer request to join the campaign.
|
|
359
|
+
*
|
|
360
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/denyInfluencer
|
|
361
|
+
*
|
|
362
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
363
|
+
*
|
|
364
|
+
* @returns promise
|
|
365
|
+
*/
|
|
366
|
+
static declineInfluencernRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
367
|
+
/**
|
|
368
|
+
* The route the route to mark the influencers request as in review.
|
|
369
|
+
*
|
|
370
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/reviewInfluencer
|
|
371
|
+
*
|
|
372
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
373
|
+
*
|
|
374
|
+
* @returns promise
|
|
375
|
+
*/
|
|
376
|
+
static reviewInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
347
377
|
}
|
|
348
378
|
export default Campaigns;
|
|
@@ -226,5 +226,45 @@ declare class Communities {
|
|
|
226
226
|
* @returns promise
|
|
227
227
|
*/
|
|
228
228
|
static join<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
229
|
+
/**
|
|
230
|
+
* Add a payment method to the community.
|
|
231
|
+
*
|
|
232
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/51802cc0cb758850807345918130cf3e
|
|
233
|
+
*
|
|
234
|
+
* @param community_id The id of the community to update.
|
|
235
|
+
*
|
|
236
|
+
* @returns promise
|
|
237
|
+
*/
|
|
238
|
+
static addPaymentMethod<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
239
|
+
/**
|
|
240
|
+
* Sets the default payment method for the community.
|
|
241
|
+
*
|
|
242
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/dd743e8a7da3b2bebe557cbc6675380d
|
|
243
|
+
*
|
|
244
|
+
* @param community_id The id of the community to update.
|
|
245
|
+
*
|
|
246
|
+
* @returns promise
|
|
247
|
+
*/
|
|
248
|
+
static setDefaultPaymentMethod<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
249
|
+
/**
|
|
250
|
+
* Get the available payment methods.
|
|
251
|
+
*
|
|
252
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
253
|
+
*
|
|
254
|
+
* @param community_id The id of the community
|
|
255
|
+
*
|
|
256
|
+
* @returns promise
|
|
257
|
+
*/
|
|
258
|
+
static getPaymentMethods<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
259
|
+
/**
|
|
260
|
+
* Get the ledger for all transactions from the community.
|
|
261
|
+
*
|
|
262
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
263
|
+
*
|
|
264
|
+
* @param community_id The id of the community
|
|
265
|
+
*
|
|
266
|
+
* @returns promise
|
|
267
|
+
*/
|
|
268
|
+
static getLedger<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
229
269
|
}
|
|
230
270
|
export default Communities;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -41,6 +41,17 @@ declare class Users {
|
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
43
|
static getCampaignInvites<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
44
|
+
/**
|
|
45
|
+
* Gets payouts from past campaings
|
|
46
|
+
*
|
|
47
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
48
|
+
*
|
|
49
|
+
* @param user_id The id of the user to update.
|
|
50
|
+
* @param data The data to update.
|
|
51
|
+
*
|
|
52
|
+
* @returns promise
|
|
53
|
+
*/
|
|
54
|
+
static getPayouts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
44
55
|
/**
|
|
45
56
|
* Sync the current influencer's information.
|
|
46
57
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -6564,7 +6564,11 @@ var CommunitiesRoute = /** @class */ (function () {
|
|
|
6564
6564
|
updateUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.PUT },
|
|
6565
6565
|
removeUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.DELETE },
|
|
6566
6566
|
join: { url: '/communities/{community_id}/join', method: HTTP_METHODS.POST },
|
|
6567
|
-
findByDomain: { url: '/communities/findByDomain/{domain}', method: HTTP_METHODS.GET }
|
|
6567
|
+
findByDomain: { url: '/communities/findByDomain/{domain}', method: HTTP_METHODS.GET },
|
|
6568
|
+
addPaymentMethod: { url: '/communities/{community_id}/payment/methods', method: HTTP_METHODS.POST },
|
|
6569
|
+
getPaymentMethods: { url: '/communities/{community_i}/payment/methods', method: HTTP_METHODS.GET },
|
|
6570
|
+
setDefaultPaymentMethod: { url: '/communities/{community_i}/payment/methods/default', method: HTTP_METHODS.POST },
|
|
6571
|
+
getLedger: { url: '/communities/{community_i}/payment/ledger', method: HTTP_METHODS.GET },
|
|
6568
6572
|
};
|
|
6569
6573
|
return CommunitiesRoute;
|
|
6570
6574
|
}());
|
|
@@ -6847,6 +6851,54 @@ var Communities = /** @class */ (function () {
|
|
|
6847
6851
|
Communities.join = function (community_id, data, params) {
|
|
6848
6852
|
return Requests.processRoute(CommunitiesRoute.routes.join, data, { community_id: community_id }, params);
|
|
6849
6853
|
};
|
|
6854
|
+
/**
|
|
6855
|
+
* Add a payment method to the community.
|
|
6856
|
+
*
|
|
6857
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/51802cc0cb758850807345918130cf3e
|
|
6858
|
+
*
|
|
6859
|
+
* @param community_id The id of the community to update.
|
|
6860
|
+
*
|
|
6861
|
+
* @returns promise
|
|
6862
|
+
*/
|
|
6863
|
+
Communities.addPaymentMethod = function (community_id, data, params) {
|
|
6864
|
+
return Requests.processRoute(CommunitiesRoute.routes.addPaymentMethod, data, { community_id: community_id }, params);
|
|
6865
|
+
};
|
|
6866
|
+
/**
|
|
6867
|
+
* Sets the default payment method for the community.
|
|
6868
|
+
*
|
|
6869
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/dd743e8a7da3b2bebe557cbc6675380d
|
|
6870
|
+
*
|
|
6871
|
+
* @param community_id The id of the community to update.
|
|
6872
|
+
*
|
|
6873
|
+
* @returns promise
|
|
6874
|
+
*/
|
|
6875
|
+
Communities.setDefaultPaymentMethod = function (community_id, data, params) {
|
|
6876
|
+
return Requests.processRoute(CommunitiesRoute.routes.setDefaultPaymentMethod, data, { community_id: community_id }, params);
|
|
6877
|
+
};
|
|
6878
|
+
/**
|
|
6879
|
+
* Get the available payment methods.
|
|
6880
|
+
*
|
|
6881
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
6882
|
+
*
|
|
6883
|
+
* @param community_id The id of the community
|
|
6884
|
+
*
|
|
6885
|
+
* @returns promise
|
|
6886
|
+
*/
|
|
6887
|
+
Communities.getPaymentMethods = function (community_id, params) {
|
|
6888
|
+
return Requests.processRoute(CommunitiesRoute.routes.getPaymentMethods, {}, { community_id: community_id }, params);
|
|
6889
|
+
};
|
|
6890
|
+
/**
|
|
6891
|
+
* Get the ledger for all transactions from the community.
|
|
6892
|
+
*
|
|
6893
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
6894
|
+
*
|
|
6895
|
+
* @param community_id The id of the community
|
|
6896
|
+
*
|
|
6897
|
+
* @returns promise
|
|
6898
|
+
*/
|
|
6899
|
+
Communities.getLedger = function (community_id, params) {
|
|
6900
|
+
return Requests.processRoute(CommunitiesRoute.routes.getLedger, {}, { community_id: community_id }, params);
|
|
6901
|
+
};
|
|
6850
6902
|
return Communities;
|
|
6851
6903
|
}());
|
|
6852
6904
|
|
|
@@ -6884,6 +6936,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
6884
6936
|
addType: { url: '/users/addType', method: HTTP_METHODS.POST },
|
|
6885
6937
|
removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
6886
6938
|
getCampaignInvites: { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
|
|
6939
|
+
getPayouts: { url: '/users/payouts', method: HTTP_METHODS.GET },
|
|
6887
6940
|
};
|
|
6888
6941
|
return UserRoutes;
|
|
6889
6942
|
}());
|
|
@@ -6939,6 +6992,19 @@ var Users = /** @class */ (function () {
|
|
|
6939
6992
|
Users.getCampaignInvites = function (params) {
|
|
6940
6993
|
return Requests.processRoute(UserRoutes.routes.getCampaignInvites, {}, undefined, params);
|
|
6941
6994
|
};
|
|
6995
|
+
/**
|
|
6996
|
+
* Gets payouts from past campaings
|
|
6997
|
+
*
|
|
6998
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
6999
|
+
*
|
|
7000
|
+
* @param user_id The id of the user to update.
|
|
7001
|
+
* @param data The data to update.
|
|
7002
|
+
*
|
|
7003
|
+
* @returns promise
|
|
7004
|
+
*/
|
|
7005
|
+
Users.getPayouts = function (params) {
|
|
7006
|
+
return Requests.processRoute(UserRoutes.routes.getPayouts, {}, undefined, params);
|
|
7007
|
+
};
|
|
6942
7008
|
/**
|
|
6943
7009
|
* Sync the current influencer's information.
|
|
6944
7010
|
*
|
|
@@ -9017,6 +9083,9 @@ var CampaignsRoute = /** @class */ (function () {
|
|
|
9017
9083
|
acceptInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/accept', method: HTTP_METHODS.POST },
|
|
9018
9084
|
declineInfluencernInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/decline', method: HTTP_METHODS.POST },
|
|
9019
9085
|
widthdrawInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/withdraw', method: HTTP_METHODS.POST },
|
|
9086
|
+
acceptInfluencerRequest: { url: '/campaigns/{campaign_id}/influencers/{user_id}/accept', method: HTTP_METHODS.POST },
|
|
9087
|
+
declineInfluencernRequest: { url: '/campaigns/{campaign_id}/influencers/{user_id}/deny', method: HTTP_METHODS.POST },
|
|
9088
|
+
reviewInfluencerRequest: { url: '/campaigns/{campaign_id}/influencers/{user_id}/review', method: HTTP_METHODS.POST },
|
|
9020
9089
|
};
|
|
9021
9090
|
return CampaignsRoute;
|
|
9022
9091
|
}());
|
|
@@ -9386,8 +9455,8 @@ var Campaigns = /** @class */ (function () {
|
|
|
9386
9455
|
*
|
|
9387
9456
|
* @returns promise
|
|
9388
9457
|
*/
|
|
9389
|
-
Campaigns.sendInfluencerInvite = function (campaign_id, params) {
|
|
9390
|
-
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite,
|
|
9458
|
+
Campaigns.sendInfluencerInvite = function (campaign_id, data, params) {
|
|
9459
|
+
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite, data, { campaign_id: campaign_id }, params);
|
|
9391
9460
|
};
|
|
9392
9461
|
/**
|
|
9393
9462
|
* Invites an influencer to join this campaign.
|
|
@@ -9412,8 +9481,8 @@ var Campaigns = /** @class */ (function () {
|
|
|
9412
9481
|
*
|
|
9413
9482
|
* @returns promise
|
|
9414
9483
|
*/
|
|
9415
|
-
Campaigns.acceptInfluencerInvite = function (campaign_id, influencer_id, params) {
|
|
9416
|
-
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerInvite,
|
|
9484
|
+
Campaigns.acceptInfluencerInvite = function (campaign_id, influencer_id, data, params) {
|
|
9485
|
+
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
9417
9486
|
};
|
|
9418
9487
|
/**
|
|
9419
9488
|
* The route for an influencer to decline an invite.
|
|
@@ -9424,8 +9493,8 @@ var Campaigns = /** @class */ (function () {
|
|
|
9424
9493
|
*
|
|
9425
9494
|
* @returns promise
|
|
9426
9495
|
*/
|
|
9427
|
-
Campaigns.declineInfluencernInvite = function (campaign_id, influencer_id, params) {
|
|
9428
|
-
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernInvite,
|
|
9496
|
+
Campaigns.declineInfluencernInvite = function (campaign_id, influencer_id, data, params) {
|
|
9497
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
9429
9498
|
};
|
|
9430
9499
|
/**
|
|
9431
9500
|
* The route for an influencer to decline an invite.
|
|
@@ -9436,8 +9505,44 @@ var Campaigns = /** @class */ (function () {
|
|
|
9436
9505
|
*
|
|
9437
9506
|
* @returns promise
|
|
9438
9507
|
*/
|
|
9439
|
-
Campaigns.widthdrawInfluencerInvite = function (campaign_id, influencer_id, params) {
|
|
9440
|
-
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite,
|
|
9508
|
+
Campaigns.widthdrawInfluencerInvite = function (campaign_id, influencer_id, data, params) {
|
|
9509
|
+
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
9510
|
+
};
|
|
9511
|
+
/**
|
|
9512
|
+
* The route to accept an influnecers request to join the campaign.
|
|
9513
|
+
*
|
|
9514
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencer
|
|
9515
|
+
*
|
|
9516
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9517
|
+
*
|
|
9518
|
+
* @returns promise
|
|
9519
|
+
*/
|
|
9520
|
+
Campaigns.acceptInfluencerRequest = function (campaign_id, user_id, data, params) {
|
|
9521
|
+
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
9522
|
+
};
|
|
9523
|
+
/**
|
|
9524
|
+
* The route to deny an influencer request to join the campaign.
|
|
9525
|
+
*
|
|
9526
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/denyInfluencer
|
|
9527
|
+
*
|
|
9528
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9529
|
+
*
|
|
9530
|
+
* @returns promise
|
|
9531
|
+
*/
|
|
9532
|
+
Campaigns.declineInfluencernRequest = function (campaign_id, user_id, data, params) {
|
|
9533
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
9534
|
+
};
|
|
9535
|
+
/**
|
|
9536
|
+
* The route the route to mark the influencers request as in review.
|
|
9537
|
+
*
|
|
9538
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/reviewInfluencer
|
|
9539
|
+
*
|
|
9540
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9541
|
+
*
|
|
9542
|
+
* @returns promise
|
|
9543
|
+
*/
|
|
9544
|
+
Campaigns.reviewInfluencerRequest = function (campaign_id, user_id, data, params) {
|
|
9545
|
+
return Requests.processRoute(CampaignsRoute.routes.reviewInfluencerRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
9441
9546
|
};
|
|
9442
9547
|
return Campaigns;
|
|
9443
9548
|
}());
|