glitch-javascript-sdk 0.8.8 → 0.8.9

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
@@ -1113,6 +1113,26 @@ declare class Users {
1113
1113
  * @returns Promise
1114
1114
  */
1115
1115
  static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1116
+ /**
1117
+ * Add a type to a user.
1118
+ *
1119
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
1120
+ *
1121
+ * @param data The genre information to be passed to update the type information.
1122
+ *
1123
+ * @returns Promise
1124
+ */
1125
+ static addType<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1126
+ /**
1127
+ * Remove a genre from a user.
1128
+ *
1129
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
1130
+ *
1131
+ * @param genre_id The id of the genre to remove.
1132
+ *
1133
+ * @returns Promise
1134
+ */
1135
+ static removeType<T>(type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1116
1136
  }
1117
1137
 
1118
1138
  declare class Events {
@@ -2552,6 +2572,26 @@ declare class Campaigns {
2552
2572
  * @returns Promise
2553
2573
  */
2554
2574
  static removeEthnicity<T>(campaign_id: string, ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2575
+ /**
2576
+ * Associate a type with the campaign.
2577
+ *
2578
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
2579
+ *
2580
+ * @param data The type information to be passed to update the campaign information.
2581
+ *
2582
+ * @returns Promise
2583
+ */
2584
+ static addType<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2585
+ /**
2586
+ * Remove an type
2587
+ *
2588
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
2589
+ *
2590
+ * @param type_id The id of the ethnicity to remove.
2591
+ *
2592
+ * @returns Promise
2593
+ */
2594
+ static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2555
2595
  }
2556
2596
 
2557
2597
  declare class Subscriptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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.addGender, data, {campaign_id : campaign_id}, params);
357
+ return Requests.processRoute(CampaignsRoute.routes.addEthnicity, data, {campaign_id : campaign_id}, params);
358
358
  }
359
359
 
360
360
  /**
@@ -368,7 +368,35 @@ 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.removeGender, undefined, {campaign_id : campaign_id, ethnicity_id : ethnicity_id}, params);
371
+ return Requests.processRoute(CampaignsRoute.routes.removeEthnicity, undefined, {campaign_id : campaign_id, ethnicity_id : ethnicity_id}, params);
372
+ }
373
+
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
390
+ *
391
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
392
+ *
393
+ * @param type_id The id of the ethnicity to remove.
394
+ *
395
+ * @returns Promise
396
+ */
397
+ public static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
398
+
399
+ return Requests.processRoute(CampaignsRoute.routes.removeType, undefined, {campaign_id : campaign_id, type_id : type_id}, params);
372
400
  }
373
401
 
374
402
 
package/src/api/Users.ts CHANGED
@@ -355,6 +355,35 @@ class Users {
355
355
  return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, {genre_id : genre_id}, params);
356
356
  }
357
357
 
358
+ /**
359
+ * Add a type to a user.
360
+ *
361
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
362
+ *
363
+ * @param data The genre information to be passed to update the type information.
364
+ *
365
+ * @returns Promise
366
+ */
367
+ public static addType<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
368
+
369
+ return Requests.processRoute(UserRoutes.routes.addType, data, undefined, params);
370
+ }
371
+
372
+ /**
373
+ * Remove a genre from a user.
374
+ *
375
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
376
+ *
377
+ * @param genre_id The id of the genre to remove.
378
+ *
379
+ * @returns Promise
380
+ */
381
+ public static removeType<T>(type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
382
+
383
+ return Requests.processRoute(UserRoutes.routes.removeType, undefined, {type_id : type_id}, params);
384
+ }
385
+
386
+
358
387
 
359
388
 
360
389
 
@@ -30,7 +30,9 @@ class CampaignsRoute {
30
30
  addGender : { url: '/campaigns/{campaign_id}/addGender', method: HTTP_METHODS.POST },
31
31
  removeGender : { url: '/campaigns/{campaign_id}/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
32
32
  addEthnicity : { url: '/campaigns/{campaign_id}/addEthnicity', method: HTTP_METHODS.POST },
33
- removeEthnicity : { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
33
+ removeEthnicity : { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
34
+ addType : { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
35
+ removeType : { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
34
36
  };
35
37
 
36
38
  }
@@ -30,6 +30,8 @@ class UserRoutes {
30
30
  getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
31
31
  addGenre : { url: '/users/addGenre', method: HTTP_METHODS.POST },
32
32
  removeGenre : { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
33
+ addType : { url: '/users/addType', method: HTTP_METHODS.POST },
34
+ removeType : { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
33
35
  };
34
36
 
35
37
  }