glitch-javascript-sdk 0.8.8 → 0.9.0
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 +65 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +20 -0
- package/dist/esm/api/Users.d.ts +20 -0
- package/dist/esm/api/Utility.d.ts +8 -0
- package/dist/esm/index.js +65 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +48 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +30 -2
- package/src/api/Users.ts +29 -0
- package/src/api/Utility.ts +11 -0
- package/src/routes/CampaignsRoute.ts +3 -1
- package/src/routes/UserRoutes.ts +2 -0
- package/src/routes/UtilityRoutes.ts +1 -0
|
@@ -264,5 +264,25 @@ declare class Campaigns {
|
|
|
264
264
|
* @returns Promise
|
|
265
265
|
*/
|
|
266
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;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -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;
|
|
@@ -41,5 +41,13 @@ declare class Utility {
|
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
43
|
static listEthnicities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
44
|
+
/**
|
|
45
|
+
* Get all the game types available on the platform.
|
|
46
|
+
*
|
|
47
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilTypes
|
|
48
|
+
*
|
|
49
|
+
* @returns promise
|
|
50
|
+
*/
|
|
51
|
+
static listTypes<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
44
52
|
}
|
|
45
53
|
export default Utility;
|
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
|
|
|
@@ -8390,6 +8416,7 @@ var UtilityRoutes = /** @class */ (function () {
|
|
|
8390
8416
|
countries: { url: '/util/countries', method: HTTP_METHODS.GET },
|
|
8391
8417
|
genders: { url: '/util/genders', method: HTTP_METHODS.GET },
|
|
8392
8418
|
ethnicities: { url: '/util/ethnicities', method: HTTP_METHODS.GET },
|
|
8419
|
+
types: { url: '/util/types', method: HTTP_METHODS.GET },
|
|
8393
8420
|
};
|
|
8394
8421
|
return UtilityRoutes;
|
|
8395
8422
|
}());
|
|
@@ -8447,6 +8474,16 @@ var Utility = /** @class */ (function () {
|
|
|
8447
8474
|
Utility.listEthnicities = function (params) {
|
|
8448
8475
|
return Requests.processRoute(UtilityRoutes.routes.ethnicities, undefined, undefined, params);
|
|
8449
8476
|
};
|
|
8477
|
+
/**
|
|
8478
|
+
* Get all the game types available on the platform.
|
|
8479
|
+
*
|
|
8480
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilTypes
|
|
8481
|
+
*
|
|
8482
|
+
* @returns promise
|
|
8483
|
+
*/
|
|
8484
|
+
Utility.listTypes = function (params) {
|
|
8485
|
+
return Requests.processRoute(UtilityRoutes.routes.types, undefined, undefined, params);
|
|
8486
|
+
};
|
|
8450
8487
|
return Utility;
|
|
8451
8488
|
}());
|
|
8452
8489
|
|
|
@@ -8943,6 +8980,8 @@ var CampaignsRoute = /** @class */ (function () {
|
|
|
8943
8980
|
removeGender: { url: '/campaigns/{campaign_id}/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
|
|
8944
8981
|
addEthnicity: { url: '/campaigns/{campaign_id}/addEthnicity', method: HTTP_METHODS.POST },
|
|
8945
8982
|
removeEthnicity: { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
8983
|
+
addType: { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
|
|
8984
|
+
removeType: { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
8946
8985
|
};
|
|
8947
8986
|
return CampaignsRoute;
|
|
8948
8987
|
}());
|
|
@@ -9253,7 +9292,7 @@ var Campaigns = /** @class */ (function () {
|
|
|
9253
9292
|
* @returns Promise
|
|
9254
9293
|
*/
|
|
9255
9294
|
Campaigns.addEthnicity = function (campaign_id, data, params) {
|
|
9256
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
9295
|
+
return Requests.processRoute(CampaignsRoute.routes.addEthnicity, data, { campaign_id: campaign_id }, params);
|
|
9257
9296
|
};
|
|
9258
9297
|
/**
|
|
9259
9298
|
* Remove an ethnicity
|
|
@@ -9265,7 +9304,31 @@ var Campaigns = /** @class */ (function () {
|
|
|
9265
9304
|
* @returns Promise
|
|
9266
9305
|
*/
|
|
9267
9306
|
Campaigns.removeEthnicity = function (campaign_id, ethnicity_id, params) {
|
|
9268
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
9307
|
+
return Requests.processRoute(CampaignsRoute.routes.removeEthnicity, undefined, { campaign_id: campaign_id, ethnicity_id: ethnicity_id }, params);
|
|
9308
|
+
};
|
|
9309
|
+
/**
|
|
9310
|
+
* Associate a type with the campaign.
|
|
9311
|
+
*
|
|
9312
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
9313
|
+
*
|
|
9314
|
+
* @param data The type information to be passed to update the campaign information.
|
|
9315
|
+
*
|
|
9316
|
+
* @returns Promise
|
|
9317
|
+
*/
|
|
9318
|
+
Campaigns.addType = function (campaign_id, data, params) {
|
|
9319
|
+
return Requests.processRoute(CampaignsRoute.routes.addType, data, { campaign_id: campaign_id }, params);
|
|
9320
|
+
};
|
|
9321
|
+
/**
|
|
9322
|
+
* Remove an type
|
|
9323
|
+
*
|
|
9324
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
9325
|
+
*
|
|
9326
|
+
* @param type_id The id of the ethnicity to remove.
|
|
9327
|
+
*
|
|
9328
|
+
* @returns Promise
|
|
9329
|
+
*/
|
|
9330
|
+
Campaigns.removeType = function (campaign_id, type_id, params) {
|
|
9331
|
+
return Requests.processRoute(CampaignsRoute.routes.removeType, undefined, { campaign_id: campaign_id, type_id: type_id }, params);
|
|
9269
9332
|
};
|
|
9270
9333
|
return Campaigns;
|
|
9271
9334
|
}());
|