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
package/dist/index.d.ts
CHANGED
|
@@ -900,6 +900,28 @@ declare class Users {
|
|
|
900
900
|
* @returns promise
|
|
901
901
|
*/
|
|
902
902
|
static me<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
903
|
+
/**
|
|
904
|
+
* Gets the campaigns the users has been invited too.
|
|
905
|
+
*
|
|
906
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
907
|
+
*
|
|
908
|
+
* @param user_id The id of the user to update.
|
|
909
|
+
* @param data The data to update.
|
|
910
|
+
*
|
|
911
|
+
* @returns promise
|
|
912
|
+
*/
|
|
913
|
+
static getCampaignInvites<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
914
|
+
/**
|
|
915
|
+
* Sync the current influencer's information.
|
|
916
|
+
*
|
|
917
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
918
|
+
*
|
|
919
|
+
* @param user_id The id of the user to update.
|
|
920
|
+
* @param data The data to update.
|
|
921
|
+
*
|
|
922
|
+
* @returns promise
|
|
923
|
+
*/
|
|
924
|
+
static syncInfluencer<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
903
925
|
/**
|
|
904
926
|
* 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.
|
|
905
927
|
*
|
|
@@ -2600,6 +2622,66 @@ declare class Campaigns {
|
|
|
2600
2622
|
* @returns Promise
|
|
2601
2623
|
*/
|
|
2602
2624
|
static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2625
|
+
/**
|
|
2626
|
+
* Get a list of influencer invites that have been sent for this campaign.
|
|
2627
|
+
*
|
|
2628
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvites
|
|
2629
|
+
*
|
|
2630
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2631
|
+
*
|
|
2632
|
+
* @returns promise
|
|
2633
|
+
*/
|
|
2634
|
+
static listInfluencerInvites<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2635
|
+
/**
|
|
2636
|
+
* Invites an influencer to join this campaign.
|
|
2637
|
+
*
|
|
2638
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/inviteInfluencer
|
|
2639
|
+
*
|
|
2640
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2641
|
+
*
|
|
2642
|
+
* @returns promise
|
|
2643
|
+
*/
|
|
2644
|
+
static sendInfluencerInvite<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2645
|
+
/**
|
|
2646
|
+
* Invites an influencer to join this campaign.
|
|
2647
|
+
*
|
|
2648
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvite
|
|
2649
|
+
*
|
|
2650
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2651
|
+
*
|
|
2652
|
+
* @returns promise
|
|
2653
|
+
*/
|
|
2654
|
+
static viewInfluencerInvite<T>(campaign_id: string, influencer_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2655
|
+
/**
|
|
2656
|
+
* The route for an influencer to accept an invite.
|
|
2657
|
+
*
|
|
2658
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencerInvite
|
|
2659
|
+
*
|
|
2660
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2661
|
+
*
|
|
2662
|
+
* @returns promise
|
|
2663
|
+
*/
|
|
2664
|
+
static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2665
|
+
/**
|
|
2666
|
+
* The route for an influencer to decline an invite.
|
|
2667
|
+
*
|
|
2668
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/delinceInfluencerInvite
|
|
2669
|
+
*
|
|
2670
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2671
|
+
*
|
|
2672
|
+
* @returns promise
|
|
2673
|
+
*/
|
|
2674
|
+
static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2675
|
+
/**
|
|
2676
|
+
* The route for an influencer to decline an invite.
|
|
2677
|
+
*
|
|
2678
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/withdrawInfluencerInvite
|
|
2679
|
+
*
|
|
2680
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2681
|
+
*
|
|
2682
|
+
* @returns promise
|
|
2683
|
+
*/
|
|
2684
|
+
static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2603
2685
|
}
|
|
2604
2686
|
|
|
2605
2687
|
declare class Subscriptions {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -80,7 +80,7 @@ class Campaigns {
|
|
|
80
80
|
*
|
|
81
81
|
* @returns promise
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
public static listCampaignLinks<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
84
84
|
return Requests.processRoute(CampaignsRoute.routes.listCampaignLinks, undefined, { campaign_id: campaign_id }, params);
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -124,17 +124,17 @@ class Campaigns {
|
|
|
124
124
|
*/
|
|
125
125
|
public static getCampaignLink<T>(campaign_id: string, link_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
126
126
|
|
|
127
|
-
return Requests.processRoute(CampaignsRoute.routes.getCampaignLink, {}, { campaign_id: campaign_id, link_id: link_id
|
|
127
|
+
return Requests.processRoute(CampaignsRoute.routes.getCampaignLink, {}, { campaign_id: campaign_id, link_id: link_id }, params);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
/**
|
|
131
|
+
* List all the influencers associated with a campaign.
|
|
132
|
+
*
|
|
133
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerCampaigns
|
|
134
|
+
*
|
|
135
|
+
* @returns promise
|
|
136
|
+
*/
|
|
137
|
+
public static listInfluencerCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
138
138
|
return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaigns, undefined, undefined, params);
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -148,20 +148,20 @@ class Campaigns {
|
|
|
148
148
|
* @returns Promise
|
|
149
149
|
*/
|
|
150
150
|
public static createInfluencerCampaign<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
151
|
-
return Requests.processRoute(CampaignsRoute.routes.createInfluencerCampaign
|
|
151
|
+
return Requests.processRoute(CampaignsRoute.routes.createInfluencerCampaign, data, { campaign_id: campaign_id }, params);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Update an influencer campaign.
|
|
156
|
+
*
|
|
157
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/updateInfluencerCampaign
|
|
158
|
+
*
|
|
159
|
+
* @param campaign_id The id of the campaign to update.
|
|
160
|
+
* @param data The data to update.
|
|
161
|
+
*
|
|
162
|
+
* @returns promise
|
|
163
|
+
*/
|
|
164
|
+
public static updateInfluencerCampaign<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
165
165
|
|
|
166
166
|
return Requests.processRoute(CampaignsRoute.routes.updateInfluencerCampaign, data, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
167
167
|
}
|
|
@@ -216,17 +216,17 @@ class Campaigns {
|
|
|
216
216
|
* @returns promise
|
|
217
217
|
*/
|
|
218
218
|
public static listInfluencerCampaignLinks<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
219
|
-
return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaignLinks
|
|
219
|
+
return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaignLinks, undefined, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
222
|
+
/**
|
|
223
|
+
* List all the campaign mentions.
|
|
224
|
+
*
|
|
225
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLinks
|
|
226
|
+
*
|
|
227
|
+
* @returns promise
|
|
228
|
+
*/
|
|
229
|
+
public static listCampaignMentions<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
230
230
|
return Requests.processRoute(CampaignsRoute.routes.listCampaignMentions, undefined, { campaign_id: campaign_id }, params);
|
|
231
231
|
}
|
|
232
232
|
|
|
@@ -270,21 +270,21 @@ class Campaigns {
|
|
|
270
270
|
*/
|
|
271
271
|
public static getCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
272
272
|
|
|
273
|
-
return Requests.processRoute(CampaignsRoute.routes.getCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id
|
|
273
|
+
return Requests.processRoute(CampaignsRoute.routes.getCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return Requests.processRoute(CampaignsRoute.routes.deleteCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id
|
|
276
|
+
/**
|
|
277
|
+
* Delete the information for a single campaign mention.
|
|
278
|
+
*
|
|
279
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLink
|
|
280
|
+
*
|
|
281
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
282
|
+
*
|
|
283
|
+
* @returns promise
|
|
284
|
+
*/
|
|
285
|
+
public static deleteCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
286
|
+
|
|
287
|
+
return Requests.processRoute(CampaignsRoute.routes.deleteCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
/**
|
|
@@ -298,7 +298,7 @@ class Campaigns {
|
|
|
298
298
|
*/
|
|
299
299
|
public static addCountry<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
300
300
|
|
|
301
|
-
return Requests.processRoute(CampaignsRoute.routes.addCountry, data, {campaign_id
|
|
301
|
+
return Requests.processRoute(CampaignsRoute.routes.addCountry, data, { campaign_id: campaign_id }, params);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
/**
|
|
@@ -312,7 +312,7 @@ class Campaigns {
|
|
|
312
312
|
*/
|
|
313
313
|
public static removeCountry<T>(campaign_id: string, country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
314
314
|
|
|
315
|
-
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, {campaign_id
|
|
315
|
+
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, { campaign_id: campaign_id, country_id: country_id }, params);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
/**
|
|
@@ -326,7 +326,7 @@ class Campaigns {
|
|
|
326
326
|
*/
|
|
327
327
|
public static addGender<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
328
328
|
|
|
329
|
-
return Requests.processRoute(CampaignsRoute.routes.addGender, data, {campaign_id
|
|
329
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, { campaign_id: campaign_id }, params);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/**
|
|
@@ -338,9 +338,9 @@ class Campaigns {
|
|
|
338
338
|
*
|
|
339
339
|
* @returns Promise
|
|
340
340
|
*/
|
|
341
|
-
public static removeGender<T>(campaign_id
|
|
341
|
+
public static removeGender<T>(campaign_id: string, gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
342
342
|
|
|
343
|
-
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, {campaign_id
|
|
343
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { campaign_id: campaign_id, gender_id: gender_id }, params);
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
/**
|
|
@@ -354,7 +354,7 @@ class Campaigns {
|
|
|
354
354
|
*/
|
|
355
355
|
public static addEthnicity<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
356
356
|
|
|
357
|
-
return Requests.processRoute(CampaignsRoute.routes.addEthnicity, data, {campaign_id
|
|
357
|
+
return Requests.processRoute(CampaignsRoute.routes.addEthnicity, data, { campaign_id: campaign_id }, params);
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
/**
|
|
@@ -368,35 +368,128 @@ class Campaigns {
|
|
|
368
368
|
*/
|
|
369
369
|
public static removeEthnicity<T>(campaign_id: string, ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
370
370
|
|
|
371
|
-
return Requests.processRoute(CampaignsRoute.routes.removeEthnicity, undefined, {campaign_id
|
|
371
|
+
return Requests.processRoute(CampaignsRoute.routes.removeEthnicity, undefined, { campaign_id: campaign_id, ethnicity_id: ethnicity_id }, params);
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
/**
|
|
375
|
+
* Associate a type with the campaign.
|
|
376
|
+
*
|
|
377
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
378
|
+
*
|
|
379
|
+
* @param data The type information to be passed to update the campaign information.
|
|
380
|
+
*
|
|
381
|
+
* @returns Promise
|
|
382
|
+
*/
|
|
383
|
+
public static addType<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
384
|
+
|
|
385
|
+
return Requests.processRoute(CampaignsRoute.routes.addType, data, { campaign_id: campaign_id }, params);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Remove an type
|
|
376
390
|
*
|
|
377
|
-
* @see https://api.glitch.fun/api/documentation#/Campaigns/
|
|
391
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
378
392
|
*
|
|
379
|
-
* @param
|
|
393
|
+
* @param type_id The id of the ethnicity to remove.
|
|
380
394
|
*
|
|
381
395
|
* @returns Promise
|
|
382
396
|
*/
|
|
383
|
-
|
|
397
|
+
public static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
384
398
|
|
|
385
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
399
|
+
return Requests.processRoute(CampaignsRoute.routes.removeType, undefined, { campaign_id: campaign_id, type_id: type_id }, params);
|
|
386
400
|
}
|
|
387
401
|
|
|
402
|
+
|
|
388
403
|
/**
|
|
389
|
-
*
|
|
404
|
+
* Get a list of influencer invites that have been sent for this campaign.
|
|
390
405
|
*
|
|
391
|
-
* @see https://api.glitch.fun/api/documentation#/Campaigns/
|
|
406
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvites
|
|
392
407
|
*
|
|
393
|
-
* @param
|
|
408
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
394
409
|
*
|
|
395
|
-
* @returns
|
|
410
|
+
* @returns promise
|
|
396
411
|
*/
|
|
397
|
-
public static
|
|
412
|
+
public static listInfluencerInvites<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
413
|
+
|
|
414
|
+
return Requests.processRoute(CampaignsRoute.routes.listInfluencerInvites, {}, { campaign_id: campaign_id }, params);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Invites an influencer to join this campaign.
|
|
419
|
+
*
|
|
420
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/inviteInfluencer
|
|
421
|
+
*
|
|
422
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
423
|
+
*
|
|
424
|
+
* @returns promise
|
|
425
|
+
*/
|
|
426
|
+
public static sendInfluencerInvite<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
427
|
+
|
|
428
|
+
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite, {}, { campaign_id: campaign_id }, params);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Invites an influencer to join this campaign.
|
|
433
|
+
*
|
|
434
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerInvite
|
|
435
|
+
*
|
|
436
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
437
|
+
*
|
|
438
|
+
* @returns promise
|
|
439
|
+
*/
|
|
440
|
+
public static viewInfluencerInvite<T>(campaign_id: string, influencer_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
441
|
+
|
|
442
|
+
// Ensure params is defined and includes the token
|
|
443
|
+
const updatedParams = { ...params, token };
|
|
444
|
+
|
|
445
|
+
return Requests.processRoute(
|
|
446
|
+
CampaignsRoute.routes.viewInfluencerInvite,
|
|
447
|
+
{},
|
|
448
|
+
{ campaign_id: campaign_id, influencer_id: influencer_id },
|
|
449
|
+
updatedParams
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* The route for an influencer to accept an invite.
|
|
455
|
+
*
|
|
456
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencerInvite
|
|
457
|
+
*
|
|
458
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
459
|
+
*
|
|
460
|
+
* @returns promise
|
|
461
|
+
*/
|
|
462
|
+
public static acceptInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
463
|
+
|
|
464
|
+
return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* The route for an influencer to decline an invite.
|
|
469
|
+
*
|
|
470
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/delinceInfluencerInvite
|
|
471
|
+
*
|
|
472
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
473
|
+
*
|
|
474
|
+
* @returns promise
|
|
475
|
+
*/
|
|
476
|
+
public static declineInfluencernInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
477
|
+
|
|
478
|
+
return Requests.processRoute(CampaignsRoute.routes.declineInfluencernInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* The route for an influencer to decline an invite.
|
|
483
|
+
*
|
|
484
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/withdrawInfluencerInvite
|
|
485
|
+
*
|
|
486
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
487
|
+
*
|
|
488
|
+
* @returns promise
|
|
489
|
+
*/
|
|
490
|
+
public static widthdrawInfluencerInvite<T>(campaign_id: string, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
398
491
|
|
|
399
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
492
|
+
return Requests.processRoute(CampaignsRoute.routes.widthdrawInfluencerInvite, {}, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
400
493
|
}
|
|
401
494
|
|
|
402
495
|
|
package/src/api/Users.ts
CHANGED
|
@@ -46,6 +46,36 @@ class Users {
|
|
|
46
46
|
return Requests.processRoute(UserRoutes.routes.me, {}, undefined, params);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Gets the campaigns the users has been invited too.
|
|
51
|
+
*
|
|
52
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
|
|
53
|
+
*
|
|
54
|
+
* @param user_id The id of the user to update.
|
|
55
|
+
* @param data The data to update.
|
|
56
|
+
*
|
|
57
|
+
* @returns promise
|
|
58
|
+
*/
|
|
59
|
+
public static getCampaignInvites<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
60
|
+
|
|
61
|
+
return Requests.processRoute(UserRoutes.routes.getCampaignInvites, {}, undefined, params);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sync the current influencer's information.
|
|
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 syncInfluencer<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
75
|
+
|
|
76
|
+
return Requests.processRoute(UserRoutes.routes.syncInfluencer, {}, undefined, params);
|
|
77
|
+
}
|
|
78
|
+
|
|
49
79
|
/**
|
|
50
80
|
* 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.
|
|
51
81
|
*
|
|
@@ -32,7 +32,14 @@ class CampaignsRoute {
|
|
|
32
32
|
addEthnicity : { url: '/campaigns/{campaign_id}/addEthnicity', method: HTTP_METHODS.POST },
|
|
33
33
|
removeEthnicity : { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
34
34
|
addType : { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
|
|
35
|
-
removeType : { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
35
|
+
removeType : { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
36
|
+
inviteInfluencer : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
37
|
+
viewInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}', method: HTTP_METHODS.GET },
|
|
38
|
+
listInfluencerInvites : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.GET },
|
|
39
|
+
sendInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
40
|
+
acceptInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/accept', method: HTTP_METHODS.POST },
|
|
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 },
|
|
36
43
|
};
|
|
37
44
|
|
|
38
45
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -9,6 +9,7 @@ class UserRoutes {
|
|
|
9
9
|
follow : { url: '/users/{user_id}/follow', method: HTTP_METHODS.POST },
|
|
10
10
|
profile :{ url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
|
|
11
11
|
me : { url: '/users/me', method: HTTP_METHODS.GET },
|
|
12
|
+
syncInfluencer : { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
|
|
12
13
|
oneTimeToken : { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
|
|
13
14
|
uploadAvatar : { url: '/users/uploadAvatarImage', method: HTTP_METHODS.POST },
|
|
14
15
|
uploadBanner : { url: '/users/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
@@ -32,6 +33,7 @@ class UserRoutes {
|
|
|
32
33
|
removeGenre : { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
|
|
33
34
|
addType : { url: '/users/addType', method: HTTP_METHODS.POST },
|
|
34
35
|
removeType : { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
36
|
+
getCampaignInvites : { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
}
|