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
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 {
|
|
@@ -1982,6 +2002,14 @@ declare class Utility {
|
|
|
1982
2002
|
* @returns promise
|
|
1983
2003
|
*/
|
|
1984
2004
|
static listEthnicities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2005
|
+
/**
|
|
2006
|
+
* Get all the game types available on the platform.
|
|
2007
|
+
*
|
|
2008
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilTypes
|
|
2009
|
+
*
|
|
2010
|
+
* @returns promise
|
|
2011
|
+
*/
|
|
2012
|
+
static listTypes<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1985
2013
|
}
|
|
1986
2014
|
|
|
1987
2015
|
declare class Tips {
|
|
@@ -2552,6 +2580,26 @@ declare class Campaigns {
|
|
|
2552
2580
|
* @returns Promise
|
|
2553
2581
|
*/
|
|
2554
2582
|
static removeEthnicity<T>(campaign_id: string, ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2583
|
+
/**
|
|
2584
|
+
* Associate a type with the campaign.
|
|
2585
|
+
*
|
|
2586
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
2587
|
+
*
|
|
2588
|
+
* @param data The type information to be passed to update the campaign information.
|
|
2589
|
+
*
|
|
2590
|
+
* @returns Promise
|
|
2591
|
+
*/
|
|
2592
|
+
static addType<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2593
|
+
/**
|
|
2594
|
+
* Remove an type
|
|
2595
|
+
*
|
|
2596
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
2597
|
+
*
|
|
2598
|
+
* @param type_id The id of the ethnicity to remove.
|
|
2599
|
+
*
|
|
2600
|
+
* @returns Promise
|
|
2601
|
+
*/
|
|
2602
|
+
static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2555
2603
|
}
|
|
2556
2604
|
|
|
2557
2605
|
declare class Subscriptions {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
|
package/src/api/Utility.ts
CHANGED
|
@@ -60,6 +60,17 @@ class Utility {
|
|
|
60
60
|
return Requests.processRoute(UtilityRoutes.routes.ethnicities, undefined, undefined, params);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Get all the game types available on the platform.
|
|
65
|
+
*
|
|
66
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilTypes
|
|
67
|
+
*
|
|
68
|
+
* @returns promise
|
|
69
|
+
*/
|
|
70
|
+
public static listTypes<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
71
|
+
return Requests.processRoute(UtilityRoutes.routes.types, undefined, undefined, params);
|
|
72
|
+
}
|
|
73
|
+
|
|
63
74
|
}
|
|
64
75
|
|
|
65
76
|
export default Utility;
|
|
@@ -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
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -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
|
}
|
|
@@ -9,6 +9,7 @@ class UtilityRoutes {
|
|
|
9
9
|
countries: { url: '/util/countries', method: HTTP_METHODS.GET },
|
|
10
10
|
genders: { url: '/util/genders', method: HTTP_METHODS.GET },
|
|
11
11
|
ethnicities : { url: '/util/ethnicities', method: HTTP_METHODS.GET },
|
|
12
|
+
types : { url: '/util/types', method: HTTP_METHODS.GET },
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
}
|