glitch-javascript-sdk 0.8.6 → 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/index.d.ts CHANGED
@@ -1958,6 +1958,30 @@ declare class Utility {
1958
1958
  * @returns promise
1959
1959
  */
1960
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>>;
1961
1985
  }
1962
1986
 
1963
1987
  declare class Tips {
@@ -2468,6 +2492,66 @@ declare class Campaigns {
2468
2492
  * @returns promise
2469
2493
  */
2470
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>>;
2471
2555
  }
2472
2556
 
2473
2557
  declare class Subscriptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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
 
@@ -27,6 +27,39 @@ class Utility {
27
27
  return Requests.processRoute(UtilityRoutes.routes.genres, undefined, undefined, params);
28
28
  }
29
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
+
30
63
  }
31
64
 
32
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
  }
@@ -6,6 +6,9 @@ class UtilityRoutes {
6
6
  public static routes: { [key: string]: Route } = {
7
7
  social_interactions: { url: '/util/socialinteractions', method: HTTP_METHODS.GET },
8
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 },
9
12
  };
10
13
 
11
14
  }