glitch-javascript-sdk 0.8.7 → 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.
@@ -213,7 +213,7 @@ declare class Campaigns {
213
213
  *
214
214
  * @returns Promise
215
215
  */
216
- static addCountry<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
216
+ static addCountry<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
217
217
  /**
218
218
  * Remove a country
219
219
  *
@@ -223,7 +223,7 @@ declare class Campaigns {
223
223
  *
224
224
  * @returns Promise
225
225
  */
226
- static removeCountry<T>(country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
226
+ static removeCountry<T>(campaign_id: string, country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
227
227
  /**
228
228
  * Associate a gender with the campaign.
229
229
  *
@@ -233,7 +233,7 @@ declare class Campaigns {
233
233
  *
234
234
  * @returns Promise
235
235
  */
236
- static addGender<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
236
+ static addGender<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
237
237
  /**
238
238
  * Remove a gender
239
239
  *
@@ -243,7 +243,7 @@ declare class Campaigns {
243
243
  *
244
244
  * @returns Promise
245
245
  */
246
- static removeGender<T>(gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
246
+ static removeGender<T>(campaign_id: string, gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
247
247
  /**
248
248
  * Associate an ethnicity with the campaign.
249
249
  *
@@ -253,7 +253,7 @@ declare class Campaigns {
253
253
  *
254
254
  * @returns Promise
255
255
  */
256
- static addEthnicity<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
256
+ static addEthnicity<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
257
257
  /**
258
258
  * Remove an ethnicity
259
259
  *
@@ -263,6 +263,26 @@ declare class Campaigns {
263
263
  *
264
264
  * @returns Promise
265
265
  */
266
- static removeEthnicity<T>(ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
266
+ static removeEthnicity<T>(campaign_id: string, ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
267
+ /**
268
+ * Associate a type with the campaign.
269
+ *
270
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
271
+ *
272
+ * @param data The type information to be passed to update the campaign information.
273
+ *
274
+ * @returns Promise
275
+ */
276
+ static addType<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
277
+ /**
278
+ * Remove an type
279
+ *
280
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
281
+ *
282
+ * @param type_id The id of the ethnicity to remove.
283
+ *
284
+ * @returns Promise
285
+ */
286
+ static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
267
287
  }
268
288
  export default Campaigns;
@@ -243,5 +243,25 @@ declare class Users {
243
243
  * @returns Promise
244
244
  */
245
245
  static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
246
+ /**
247
+ * Add a type to a user.
248
+ *
249
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
250
+ *
251
+ * @param data The genre information to be passed to update the type information.
252
+ *
253
+ * @returns Promise
254
+ */
255
+ static addType<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
256
+ /**
257
+ * Remove a genre from a user.
258
+ *
259
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
260
+ *
261
+ * @param genre_id The id of the genre to remove.
262
+ *
263
+ * @returns Promise
264
+ */
265
+ static removeType<T>(type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
246
266
  }
247
267
  export default Users;
package/dist/esm/index.js CHANGED
@@ -6880,6 +6880,8 @@ var UserRoutes = /** @class */ (function () {
6880
6880
  getFacebookGroups: { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
6881
6881
  addGenre: { url: '/users/addGenre', method: HTTP_METHODS.POST },
6882
6882
  removeGenre: { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
6883
+ addType: { url: '/users/addType', method: HTTP_METHODS.POST },
6884
+ removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
6883
6885
  };
6884
6886
  return UserRoutes;
6885
6887
  }());
@@ -7183,6 +7185,30 @@ var Users = /** @class */ (function () {
7183
7185
  Users.removeGenre = function (genre_id, params) {
7184
7186
  return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, { genre_id: genre_id }, params);
7185
7187
  };
7188
+ /**
7189
+ * Add a type to a user.
7190
+ *
7191
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
7192
+ *
7193
+ * @param data The genre information to be passed to update the type information.
7194
+ *
7195
+ * @returns Promise
7196
+ */
7197
+ Users.addType = function (data, params) {
7198
+ return Requests.processRoute(UserRoutes.routes.addType, data, undefined, params);
7199
+ };
7200
+ /**
7201
+ * Remove a genre from a user.
7202
+ *
7203
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
7204
+ *
7205
+ * @param genre_id The id of the genre to remove.
7206
+ *
7207
+ * @returns Promise
7208
+ */
7209
+ Users.removeType = function (type_id, params) {
7210
+ return Requests.processRoute(UserRoutes.routes.removeType, undefined, { type_id: type_id }, params);
7211
+ };
7186
7212
  return Users;
7187
7213
  }());
7188
7214
 
@@ -8937,12 +8963,14 @@ var CampaignsRoute = /** @class */ (function () {
8937
8963
  getCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
8938
8964
  updateCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
8939
8965
  deleteCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
8940
- addCountry: { url: '/users/addCountry', method: HTTP_METHODS.POST },
8941
- removeCountry: { url: '/users/removeCountry/{country_id}', method: HTTP_METHODS.DELETE },
8942
- addGender: { url: '/users/addGender', method: HTTP_METHODS.POST },
8943
- removeGender: { url: '/users/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
8944
- addEthnicity: { url: '/users/addEthnicity', method: HTTP_METHODS.POST },
8945
- removeEthnicity: { url: '/users/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
8966
+ addCountry: { url: '/campaigns/{campaign_id}/addCountry', method: HTTP_METHODS.POST },
8967
+ removeCountry: { url: '/campaigns/{campaign_id}/removeCountry/{country_id}', method: HTTP_METHODS.DELETE },
8968
+ addGender: { url: '/campaigns/{campaign_id}/addGender', method: HTTP_METHODS.POST },
8969
+ removeGender: { url: '/campaigns/{campaign_id}/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
8970
+ addEthnicity: { url: '/campaigns/{campaign_id}/addEthnicity', method: HTTP_METHODS.POST },
8971
+ removeEthnicity: { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
8972
+ addType: { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
8973
+ removeType: { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
8946
8974
  };
8947
8975
  return CampaignsRoute;
8948
8976
  }());
@@ -9204,8 +9232,8 @@ var Campaigns = /** @class */ (function () {
9204
9232
  *
9205
9233
  * @returns Promise
9206
9234
  */
9207
- Campaigns.addCountry = function (data, params) {
9208
- return Requests.processRoute(CampaignsRoute.routes.addCountry, data, undefined, params);
9235
+ Campaigns.addCountry = function (campaign_id, data, params) {
9236
+ return Requests.processRoute(CampaignsRoute.routes.addCountry, data, { campaign_id: campaign_id }, params);
9209
9237
  };
9210
9238
  /**
9211
9239
  * Remove a country
@@ -9216,8 +9244,8 @@ var Campaigns = /** @class */ (function () {
9216
9244
  *
9217
9245
  * @returns Promise
9218
9246
  */
9219
- Campaigns.removeCountry = function (country_id, params) {
9220
- return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, { country_id: country_id }, params);
9247
+ Campaigns.removeCountry = function (campaign_id, country_id, params) {
9248
+ return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, { campaign_id: campaign_id, country_id: country_id }, params);
9221
9249
  };
9222
9250
  /**
9223
9251
  * Associate a gender with the campaign.
@@ -9228,8 +9256,8 @@ var Campaigns = /** @class */ (function () {
9228
9256
  *
9229
9257
  * @returns Promise
9230
9258
  */
9231
- Campaigns.addGender = function (data, params) {
9232
- return Requests.processRoute(CampaignsRoute.routes.addGender, data, undefined, params);
9259
+ Campaigns.addGender = function (campaign_id, data, params) {
9260
+ return Requests.processRoute(CampaignsRoute.routes.addGender, data, { campaign_id: campaign_id }, params);
9233
9261
  };
9234
9262
  /**
9235
9263
  * Remove a gender
@@ -9240,8 +9268,8 @@ var Campaigns = /** @class */ (function () {
9240
9268
  *
9241
9269
  * @returns Promise
9242
9270
  */
9243
- Campaigns.removeGender = function (gender_id, params) {
9244
- return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { gender_id: gender_id }, params);
9271
+ Campaigns.removeGender = function (campaign_id, gender_id, params) {
9272
+ return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { campaign_id: campaign_id, gender_id: gender_id }, params);
9245
9273
  };
9246
9274
  /**
9247
9275
  * Associate an ethnicity with the campaign.
@@ -9252,8 +9280,8 @@ var Campaigns = /** @class */ (function () {
9252
9280
  *
9253
9281
  * @returns Promise
9254
9282
  */
9255
- Campaigns.addEthnicity = function (data, params) {
9256
- return Requests.processRoute(CampaignsRoute.routes.addGender, data, undefined, params);
9283
+ Campaigns.addEthnicity = function (campaign_id, data, params) {
9284
+ return Requests.processRoute(CampaignsRoute.routes.addEthnicity, data, { campaign_id: campaign_id }, params);
9257
9285
  };
9258
9286
  /**
9259
9287
  * Remove an ethnicity
@@ -9264,8 +9292,32 @@ var Campaigns = /** @class */ (function () {
9264
9292
  *
9265
9293
  * @returns Promise
9266
9294
  */
9267
- Campaigns.removeEthnicity = function (ethnicity_id, params) {
9268
- return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { ethnicity_id: ethnicity_id }, params);
9295
+ Campaigns.removeEthnicity = function (campaign_id, ethnicity_id, params) {
9296
+ return Requests.processRoute(CampaignsRoute.routes.removeEthnicity, undefined, { campaign_id: campaign_id, ethnicity_id: ethnicity_id }, params);
9297
+ };
9298
+ /**
9299
+ * Associate a type with the campaign.
9300
+ *
9301
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
9302
+ *
9303
+ * @param data The type information to be passed to update the campaign information.
9304
+ *
9305
+ * @returns Promise
9306
+ */
9307
+ Campaigns.addType = function (campaign_id, data, params) {
9308
+ return Requests.processRoute(CampaignsRoute.routes.addType, data, { campaign_id: campaign_id }, params);
9309
+ };
9310
+ /**
9311
+ * Remove an type
9312
+ *
9313
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
9314
+ *
9315
+ * @param type_id The id of the ethnicity to remove.
9316
+ *
9317
+ * @returns Promise
9318
+ */
9319
+ Campaigns.removeType = function (campaign_id, type_id, params) {
9320
+ return Requests.processRoute(CampaignsRoute.routes.removeType, undefined, { campaign_id: campaign_id, type_id: type_id }, params);
9269
9321
  };
9270
9322
  return Campaigns;
9271
9323
  }());