glitch-javascript-sdk 0.8.5 → 0.8.7
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 +148 -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 +20 -0
- package/dist/esm/api/Utility.d.ts +32 -0
- package/dist/esm/index.js +148 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +112 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +84 -0
- package/src/api/Users.ts +28 -0
- package/src/api/Utility.ts +44 -0
- package/src/routes/CampaignsRoute.ts +7 -1
- package/src/routes/UserRoutes.ts +2 -0
- package/src/routes/UtilityRoutes.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -1093,6 +1093,26 @@ declare class Users {
|
|
|
1093
1093
|
* @returns promise
|
|
1094
1094
|
*/
|
|
1095
1095
|
static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Add a genre to a user.
|
|
1098
|
+
*
|
|
1099
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
1100
|
+
*
|
|
1101
|
+
* @param data The genre information to be passed to update the genre information.
|
|
1102
|
+
*
|
|
1103
|
+
* @returns Promise
|
|
1104
|
+
*/
|
|
1105
|
+
static addGenre<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Remove a genre from a user.
|
|
1108
|
+
*
|
|
1109
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
1110
|
+
*
|
|
1111
|
+
* @param genre_id The id of the genre to remove.
|
|
1112
|
+
*
|
|
1113
|
+
* @returns Promise
|
|
1114
|
+
*/
|
|
1115
|
+
static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1096
1116
|
}
|
|
1097
1117
|
|
|
1098
1118
|
declare class Events {
|
|
@@ -1930,6 +1950,38 @@ declare class Utility {
|
|
|
1930
1950
|
* @returns promise
|
|
1931
1951
|
*/
|
|
1932
1952
|
static listSocialInteractions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1953
|
+
/**
|
|
1954
|
+
* Get all the genres available on the platform.
|
|
1955
|
+
*
|
|
1956
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
1957
|
+
*
|
|
1958
|
+
* @returns promise
|
|
1959
|
+
*/
|
|
1960
|
+
static listGenres<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1961
|
+
/**
|
|
1962
|
+
* Get all the genders available on the platform.
|
|
1963
|
+
*
|
|
1964
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenders
|
|
1965
|
+
*
|
|
1966
|
+
* @returns promise
|
|
1967
|
+
*/
|
|
1968
|
+
static listGenders<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1969
|
+
/**
|
|
1970
|
+
* Get all the countries available on the platform.
|
|
1971
|
+
*
|
|
1972
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
1973
|
+
*
|
|
1974
|
+
* @returns promise
|
|
1975
|
+
*/
|
|
1976
|
+
static listCountries<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1977
|
+
/**
|
|
1978
|
+
* Get all the ethnicities available on the platform.
|
|
1979
|
+
*
|
|
1980
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
1981
|
+
*
|
|
1982
|
+
* @returns promise
|
|
1983
|
+
*/
|
|
1984
|
+
static listEthnicities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1933
1985
|
}
|
|
1934
1986
|
|
|
1935
1987
|
declare class Tips {
|
|
@@ -2440,6 +2492,66 @@ declare class Campaigns {
|
|
|
2440
2492
|
* @returns promise
|
|
2441
2493
|
*/
|
|
2442
2494
|
static deleteCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2495
|
+
/**
|
|
2496
|
+
* Associate a country with the campaign.
|
|
2497
|
+
*
|
|
2498
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addCountryToCampaign
|
|
2499
|
+
*
|
|
2500
|
+
* @param data The country information to be passed to update the country campaigns information.
|
|
2501
|
+
*
|
|
2502
|
+
* @returns Promise
|
|
2503
|
+
*/
|
|
2504
|
+
static addCountry<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2505
|
+
/**
|
|
2506
|
+
* Remove a country
|
|
2507
|
+
*
|
|
2508
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeCountry
|
|
2509
|
+
*
|
|
2510
|
+
* @param country_id The id of the country to remove.
|
|
2511
|
+
*
|
|
2512
|
+
* @returns Promise
|
|
2513
|
+
*/
|
|
2514
|
+
static removeCountry<T>(country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2515
|
+
/**
|
|
2516
|
+
* Associate a gender with the campaign.
|
|
2517
|
+
*
|
|
2518
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
2519
|
+
*
|
|
2520
|
+
* @param data The gener information to be passed to update the gender information.
|
|
2521
|
+
*
|
|
2522
|
+
* @returns Promise
|
|
2523
|
+
*/
|
|
2524
|
+
static addGender<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2525
|
+
/**
|
|
2526
|
+
* Remove a gender
|
|
2527
|
+
*
|
|
2528
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
2529
|
+
*
|
|
2530
|
+
* @param gender_id The id of the gender to remove.
|
|
2531
|
+
*
|
|
2532
|
+
* @returns Promise
|
|
2533
|
+
*/
|
|
2534
|
+
static removeGender<T>(gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2535
|
+
/**
|
|
2536
|
+
* Associate an ethnicity with the campaign.
|
|
2537
|
+
*
|
|
2538
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
2539
|
+
*
|
|
2540
|
+
* @param data The ethnicity information to be passed to update the campaign information.
|
|
2541
|
+
*
|
|
2542
|
+
* @returns Promise
|
|
2543
|
+
*/
|
|
2544
|
+
static addEthnicity<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2545
|
+
/**
|
|
2546
|
+
* Remove an ethnicity
|
|
2547
|
+
*
|
|
2548
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
2549
|
+
*
|
|
2550
|
+
* @param gender_id The id of the ethnicity to remove.
|
|
2551
|
+
*
|
|
2552
|
+
* @returns Promise
|
|
2553
|
+
*/
|
|
2554
|
+
static removeEthnicity<T>(ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2443
2555
|
}
|
|
2444
2556
|
|
|
2445
2557
|
declare class Subscriptions {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -287,6 +287,90 @@ class Campaigns {
|
|
|
287
287
|
return Requests.processRoute(CampaignsRoute.routes.deleteCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Associate a country with the campaign.
|
|
292
|
+
*
|
|
293
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addCountryToCampaign
|
|
294
|
+
*
|
|
295
|
+
* @param data The country information to be passed to update the country campaigns information.
|
|
296
|
+
*
|
|
297
|
+
* @returns Promise
|
|
298
|
+
*/
|
|
299
|
+
public static addCountry<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
300
|
+
|
|
301
|
+
return Requests.processRoute(CampaignsRoute.routes.addCountry, data, undefined, params);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Remove a country
|
|
306
|
+
*
|
|
307
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeCountry
|
|
308
|
+
*
|
|
309
|
+
* @param country_id The id of the country to remove.
|
|
310
|
+
*
|
|
311
|
+
* @returns Promise
|
|
312
|
+
*/
|
|
313
|
+
public static removeCountry<T>(country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
314
|
+
|
|
315
|
+
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, {country_id : country_id}, params);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Associate a gender with the campaign.
|
|
320
|
+
*
|
|
321
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
322
|
+
*
|
|
323
|
+
* @param data The gener information to be passed to update the gender information.
|
|
324
|
+
*
|
|
325
|
+
* @returns Promise
|
|
326
|
+
*/
|
|
327
|
+
public static addGender<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
328
|
+
|
|
329
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, undefined, params);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Remove a gender
|
|
334
|
+
*
|
|
335
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
336
|
+
*
|
|
337
|
+
* @param gender_id The id of the gender to remove.
|
|
338
|
+
*
|
|
339
|
+
* @returns Promise
|
|
340
|
+
*/
|
|
341
|
+
public static removeGender<T>(gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
342
|
+
|
|
343
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, {gender_id : gender_id}, params);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Associate an ethnicity with the campaign.
|
|
348
|
+
*
|
|
349
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
350
|
+
*
|
|
351
|
+
* @param data The ethnicity information to be passed to update the campaign information.
|
|
352
|
+
*
|
|
353
|
+
* @returns Promise
|
|
354
|
+
*/
|
|
355
|
+
public static addEthnicity<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
356
|
+
|
|
357
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, undefined, params);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Remove an ethnicity
|
|
362
|
+
*
|
|
363
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
364
|
+
*
|
|
365
|
+
* @param gender_id The id of the ethnicity to remove.
|
|
366
|
+
*
|
|
367
|
+
* @returns Promise
|
|
368
|
+
*/
|
|
369
|
+
public static removeEthnicity<T>(ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
370
|
+
|
|
371
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, {ethnicity_id : ethnicity_id}, params);
|
|
372
|
+
}
|
|
373
|
+
|
|
290
374
|
|
|
291
375
|
}
|
|
292
376
|
|
package/src/api/Users.ts
CHANGED
|
@@ -327,6 +327,34 @@ class Users {
|
|
|
327
327
|
return Requests.processRoute(UserRoutes.routes.getFacebookGroups, undefined, undefined, params);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
/**
|
|
331
|
+
* Add a genre to a user.
|
|
332
|
+
*
|
|
333
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
334
|
+
*
|
|
335
|
+
* @param data The genre information to be passed to update the genre information.
|
|
336
|
+
*
|
|
337
|
+
* @returns Promise
|
|
338
|
+
*/
|
|
339
|
+
public static addGenre<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
340
|
+
|
|
341
|
+
return Requests.processRoute(UserRoutes.routes.addGenre, data, undefined, params);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Remove a genre from a user.
|
|
346
|
+
*
|
|
347
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
348
|
+
*
|
|
349
|
+
* @param genre_id The id of the genre to remove.
|
|
350
|
+
*
|
|
351
|
+
* @returns Promise
|
|
352
|
+
*/
|
|
353
|
+
public static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
354
|
+
|
|
355
|
+
return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, {genre_id : genre_id}, params);
|
|
356
|
+
}
|
|
357
|
+
|
|
330
358
|
|
|
331
359
|
|
|
332
360
|
|
package/src/api/Utility.ts
CHANGED
|
@@ -16,6 +16,50 @@ class Utility {
|
|
|
16
16
|
return Requests.processRoute(UtilityRoutes.routes.social_interactions, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Get all the genres available on the platform.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
23
|
+
*
|
|
24
|
+
* @returns promise
|
|
25
|
+
*/
|
|
26
|
+
public static listGenres<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
27
|
+
return Requests.processRoute(UtilityRoutes.routes.genres, undefined, undefined, params);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get all the genders available on the platform.
|
|
32
|
+
*
|
|
33
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenders
|
|
34
|
+
*
|
|
35
|
+
* @returns promise
|
|
36
|
+
*/
|
|
37
|
+
public static listGenders<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
38
|
+
return Requests.processRoute(UtilityRoutes.routes.genders, undefined, undefined, params);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get all the countries available on the platform.
|
|
43
|
+
*
|
|
44
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
45
|
+
*
|
|
46
|
+
* @returns promise
|
|
47
|
+
*/
|
|
48
|
+
public static listCountries<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
49
|
+
return Requests.processRoute(UtilityRoutes.routes.countries, undefined, undefined, params);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get all the ethnicities available on the platform.
|
|
54
|
+
*
|
|
55
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
56
|
+
*
|
|
57
|
+
* @returns promise
|
|
58
|
+
*/
|
|
59
|
+
public static listEthnicities<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
60
|
+
return Requests.processRoute(UtilityRoutes.routes.ethnicities, undefined, undefined, params);
|
|
61
|
+
}
|
|
62
|
+
|
|
19
63
|
}
|
|
20
64
|
|
|
21
65
|
export default Utility;
|
|
@@ -24,7 +24,13 @@ class CampaignsRoute {
|
|
|
24
24
|
createCampaignMention :{ url: '/campaigns/{campaign_id}/mentions', method: HTTP_METHODS.POST },
|
|
25
25
|
getCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
26
26
|
updateCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
|
|
27
|
-
deleteCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
27
|
+
deleteCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
28
|
+
addCountry : { url: '/users/addCountry', method: HTTP_METHODS.POST },
|
|
29
|
+
removeCountry : { url: '/users/removeCountry/{country_id}', method: HTTP_METHODS.DELETE },
|
|
30
|
+
addGender : { url: '/users/addGender', method: HTTP_METHODS.POST },
|
|
31
|
+
removeGender : { url: '/users/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
|
|
32
|
+
addEthnicity : { url: '/users/addEthnicity', method: HTTP_METHODS.POST },
|
|
33
|
+
removeEthnicity : { url: '/users/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -28,6 +28,8 @@ class UserRoutes {
|
|
|
28
28
|
aggregateMonthlyGivenTips : { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
|
|
29
29
|
getYoutubeChannels : { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
|
|
30
30
|
getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
|
|
31
|
+
addGenre : { url: '/users/addGenre', method: HTTP_METHODS.POST },
|
|
32
|
+
removeGenre : { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
}
|
|
@@ -5,6 +5,10 @@ class UtilityRoutes {
|
|
|
5
5
|
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
7
|
social_interactions: { url: '/util/socialinteractions', method: HTTP_METHODS.GET },
|
|
8
|
+
genres: { url: '/util/genres', method: HTTP_METHODS.GET },
|
|
9
|
+
countries: { url: '/util/countries', method: HTTP_METHODS.GET },
|
|
10
|
+
genders: { url: '/util/genders', method: HTTP_METHODS.GET },
|
|
11
|
+
ethnicities : { url: '/util/ethnicities', method: HTTP_METHODS.GET },
|
|
8
12
|
};
|
|
9
13
|
|
|
10
14
|
}
|