glitch-javascript-sdk 0.9.2 → 0.9.4
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 +109 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +60 -0
- package/dist/esm/api/Users.d.ts +22 -0
- package/dist/esm/index.js +109 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +82 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +156 -63
- package/src/api/Users.ts +30 -0
- package/src/routes/CampaignsRoute.ts +8 -1
- package/src/routes/UserRoutes.ts +2 -0
|
@@ -284,5 +284,65 @@ declare class Campaigns {
|
|
|
284
284
|
* @returns Promise
|
|
285
285
|
*/
|
|
286
286
|
static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
287
|
+
/**
|
|
288
|
+
* Get a list of influencer invites that have been sent for this campaign.
|
|
289
|
+
*
|
|
290
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvites
|
|
291
|
+
*
|
|
292
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
293
|
+
*
|
|
294
|
+
* @returns promise
|
|
295
|
+
*/
|
|
296
|
+
static listInfluencerInvites<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
297
|
+
/**
|
|
298
|
+
* Invites an influencer to join this campaign.
|
|
299
|
+
*
|
|
300
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/inviteInfluencer
|
|
301
|
+
*
|
|
302
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
303
|
+
*
|
|
304
|
+
* @returns promise
|
|
305
|
+
*/
|
|
306
|
+
static sendInfluencerInvite<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
307
|
+
/**
|
|
308
|
+
* Invites an influencer to join this campaign.
|
|
309
|
+
*
|
|
310
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvite
|
|
311
|
+
*
|
|
312
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
313
|
+
*
|
|
314
|
+
* @returns promise
|
|
315
|
+
*/
|
|
316
|
+
static viewInfluencerInvite<T>(campaign_id: string, influencer_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
317
|
+
/**
|
|
318
|
+
* The route for an influencer to accept an invite.
|
|
319
|
+
*
|
|
320
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencerInvite
|
|
321
|
+
*
|
|
322
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
323
|
+
*
|
|
324
|
+
* @returns promise
|
|
325
|
+
*/
|
|
326
|
+
static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
327
|
+
/**
|
|
328
|
+
* The route for an influencer to decline an invite.
|
|
329
|
+
*
|
|
330
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/delinceInfluencerInvite
|
|
331
|
+
*
|
|
332
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
333
|
+
*
|
|
334
|
+
* @returns promise
|
|
335
|
+
*/
|
|
336
|
+
static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
337
|
+
/**
|
|
338
|
+
* The route for an influencer to decline an invite.
|
|
339
|
+
*
|
|
340
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/withdrawInfluencerInvite
|
|
341
|
+
*
|
|
342
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
343
|
+
*
|
|
344
|
+
* @returns promise
|
|
345
|
+
*/
|
|
346
|
+
static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
287
347
|
}
|
|
288
348
|
export default Campaigns;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -30,6 +30,28 @@ declare class Users {
|
|
|
30
30
|
* @returns promise
|
|
31
31
|
*/
|
|
32
32
|
static me<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the campaigns the users has been invited too.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
37
|
+
*
|
|
38
|
+
* @param user_id The id of the user to update.
|
|
39
|
+
* @param data The data to update.
|
|
40
|
+
*
|
|
41
|
+
* @returns promise
|
|
42
|
+
*/
|
|
43
|
+
static getCampaignInvites<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
44
|
+
/**
|
|
45
|
+
* Sync the current influencer's information.
|
|
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 syncInfluencer<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
55
|
/**
|
|
34
56
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
35
57
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -6859,6 +6859,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
6859
6859
|
follow: { url: '/users/{user_id}/follow', method: HTTP_METHODS.POST },
|
|
6860
6860
|
profile: { url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
|
|
6861
6861
|
me: { url: '/users/me', method: HTTP_METHODS.GET },
|
|
6862
|
+
syncInfluencer: { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
|
|
6862
6863
|
oneTimeToken: { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
|
|
6863
6864
|
uploadAvatar: { url: '/users/uploadAvatarImage', method: HTTP_METHODS.POST },
|
|
6864
6865
|
uploadBanner: { url: '/users/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
@@ -6882,6 +6883,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
6882
6883
|
removeGenre: { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
|
|
6883
6884
|
addType: { url: '/users/addType', method: HTTP_METHODS.POST },
|
|
6884
6885
|
removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
6886
|
+
getCampaignInvites: { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
|
|
6885
6887
|
};
|
|
6886
6888
|
return UserRoutes;
|
|
6887
6889
|
}());
|
|
@@ -6924,6 +6926,32 @@ var Users = /** @class */ (function () {
|
|
|
6924
6926
|
Users.me = function (params) {
|
|
6925
6927
|
return Requests.processRoute(UserRoutes.routes.me, {}, undefined, params);
|
|
6926
6928
|
};
|
|
6929
|
+
/**
|
|
6930
|
+
* Gets the campaigns the users has been invited too.
|
|
6931
|
+
*
|
|
6932
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
6933
|
+
*
|
|
6934
|
+
* @param user_id The id of the user to update.
|
|
6935
|
+
* @param data The data to update.
|
|
6936
|
+
*
|
|
6937
|
+
* @returns promise
|
|
6938
|
+
*/
|
|
6939
|
+
Users.getCampaignInvites = function (params) {
|
|
6940
|
+
return Requests.processRoute(UserRoutes.routes.getCampaignInvites, {}, undefined, params);
|
|
6941
|
+
};
|
|
6942
|
+
/**
|
|
6943
|
+
* Sync the current influencer's information.
|
|
6944
|
+
*
|
|
6945
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
6946
|
+
*
|
|
6947
|
+
* @param user_id The id of the user to update.
|
|
6948
|
+
* @param data The data to update.
|
|
6949
|
+
*
|
|
6950
|
+
* @returns promise
|
|
6951
|
+
*/
|
|
6952
|
+
Users.syncInfluencer = function (params) {
|
|
6953
|
+
return Requests.processRoute(UserRoutes.routes.syncInfluencer, {}, undefined, params);
|
|
6954
|
+
};
|
|
6927
6955
|
/**
|
|
6928
6956
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
6929
6957
|
*
|
|
@@ -8982,6 +9010,13 @@ var CampaignsRoute = /** @class */ (function () {
|
|
|
8982
9010
|
removeEthnicity: { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
8983
9011
|
addType: { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
|
|
8984
9012
|
removeType: { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
9013
|
+
inviteInfluencer: { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
9014
|
+
viewInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}', method: HTTP_METHODS.GET },
|
|
9015
|
+
listInfluencerInvites: { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.GET },
|
|
9016
|
+
sendInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
9017
|
+
acceptInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/accept', method: HTTP_METHODS.POST },
|
|
9018
|
+
declineInfluencernInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/decline', method: HTTP_METHODS.POST },
|
|
9019
|
+
widthdrawInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/withdraw', method: HTTP_METHODS.POST },
|
|
8985
9020
|
};
|
|
8986
9021
|
return CampaignsRoute;
|
|
8987
9022
|
}());
|
|
@@ -9330,6 +9365,80 @@ var Campaigns = /** @class */ (function () {
|
|
|
9330
9365
|
Campaigns.removeType = function (campaign_id, type_id, params) {
|
|
9331
9366
|
return Requests.processRoute(CampaignsRoute.routes.removeType, undefined, { campaign_id: campaign_id, type_id: type_id }, params);
|
|
9332
9367
|
};
|
|
9368
|
+
/**
|
|
9369
|
+
* Get a list of influencer invites that have been sent for this campaign.
|
|
9370
|
+
*
|
|
9371
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvites
|
|
9372
|
+
*
|
|
9373
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9374
|
+
*
|
|
9375
|
+
* @returns promise
|
|
9376
|
+
*/
|
|
9377
|
+
Campaigns.listInfluencerInvites = function (campaign_id, params) {
|
|
9378
|
+
return Requests.processRoute(CampaignsRoute.routes.listInfluencerInvites, {}, { campaign_id: campaign_id }, params);
|
|
9379
|
+
};
|
|
9380
|
+
/**
|
|
9381
|
+
* Invites an influencer to join this campaign.
|
|
9382
|
+
*
|
|
9383
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/inviteInfluencer
|
|
9384
|
+
*
|
|
9385
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9386
|
+
*
|
|
9387
|
+
* @returns promise
|
|
9388
|
+
*/
|
|
9389
|
+
Campaigns.sendInfluencerInvite = function (campaign_id, params) {
|
|
9390
|
+
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite, {}, { campaign_id: campaign_id }, params);
|
|
9391
|
+
};
|
|
9392
|
+
/**
|
|
9393
|
+
* Invites an influencer to join this campaign.
|
|
9394
|
+
*
|
|
9395
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvite
|
|
9396
|
+
*
|
|
9397
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9398
|
+
*
|
|
9399
|
+
* @returns promise
|
|
9400
|
+
*/
|
|
9401
|
+
Campaigns.viewInfluencerInvite = function (campaign_id, influencer_id, token, params) {
|
|
9402
|
+
// Ensure params is defined and includes the token
|
|
9403
|
+
var updatedParams = __assign(__assign({}, params), { token: token });
|
|
9404
|
+
return Requests.processRoute(CampaignsRoute.routes.viewInfluencerInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, updatedParams);
|
|
9405
|
+
};
|
|
9406
|
+
/**
|
|
9407
|
+
* The route for an influencer to accept an invite.
|
|
9408
|
+
*
|
|
9409
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencerInvite
|
|
9410
|
+
*
|
|
9411
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9412
|
+
*
|
|
9413
|
+
* @returns promise
|
|
9414
|
+
*/
|
|
9415
|
+
Campaigns.acceptInfluencerInvite = function (campaign_id, influencer_id, params) {
|
|
9416
|
+
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
9417
|
+
};
|
|
9418
|
+
/**
|
|
9419
|
+
* The route for an influencer to decline an invite.
|
|
9420
|
+
*
|
|
9421
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/delinceInfluencerInvite
|
|
9422
|
+
*
|
|
9423
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9424
|
+
*
|
|
9425
|
+
* @returns promise
|
|
9426
|
+
*/
|
|
9427
|
+
Campaigns.declineInfluencernInvite = function (campaign_id, influencer_id, params) {
|
|
9428
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
9429
|
+
};
|
|
9430
|
+
/**
|
|
9431
|
+
* The route for an influencer to decline an invite.
|
|
9432
|
+
*
|
|
9433
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/withdrawInfluencerInvite
|
|
9434
|
+
*
|
|
9435
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
9436
|
+
*
|
|
9437
|
+
* @returns promise
|
|
9438
|
+
*/
|
|
9439
|
+
Campaigns.widthdrawInfluencerInvite = function (campaign_id, influencer_id, params) {
|
|
9440
|
+
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
9441
|
+
};
|
|
9333
9442
|
return Campaigns;
|
|
9334
9443
|
}());
|
|
9335
9444
|
|