glitch-javascript-sdk 0.8.5 → 0.8.6
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 +37 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Users.d.ts +20 -0
- package/dist/esm/api/Utility.d.ts +8 -0
- package/dist/esm/index.js +37 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +28 -0
- package/package.json +1 -1
- package/src/api/Users.ts +28 -0
- package/src/api/Utility.ts +11 -0
- package/src/routes/UserRoutes.ts +2 -0
- package/src/routes/UtilityRoutes.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1093,6 +1093,26 @@ declare class Users {
|
|
|
1093
1093
|
* @returns promise
|
|
1094
1094
|
*/
|
|
1095
1095
|
static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Add a genre to a user.
|
|
1098
|
+
*
|
|
1099
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
1100
|
+
*
|
|
1101
|
+
* @param data The genre information to be passed to update the genre information.
|
|
1102
|
+
*
|
|
1103
|
+
* @returns Promise
|
|
1104
|
+
*/
|
|
1105
|
+
static addGenre<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Remove a genre from a user.
|
|
1108
|
+
*
|
|
1109
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
1110
|
+
*
|
|
1111
|
+
* @param genre_id The id of the genre to remove.
|
|
1112
|
+
*
|
|
1113
|
+
* @returns Promise
|
|
1114
|
+
*/
|
|
1115
|
+
static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1096
1116
|
}
|
|
1097
1117
|
|
|
1098
1118
|
declare class Events {
|
|
@@ -1930,6 +1950,14 @@ declare class Utility {
|
|
|
1930
1950
|
* @returns promise
|
|
1931
1951
|
*/
|
|
1932
1952
|
static listSocialInteractions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1953
|
+
/**
|
|
1954
|
+
* Get all the genres available on the platform.
|
|
1955
|
+
*
|
|
1956
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
1957
|
+
*
|
|
1958
|
+
* @returns promise
|
|
1959
|
+
*/
|
|
1960
|
+
static listGenres<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1933
1961
|
}
|
|
1934
1962
|
|
|
1935
1963
|
declare class Tips {
|
package/package.json
CHANGED
package/src/api/Users.ts
CHANGED
|
@@ -327,6 +327,34 @@ class Users {
|
|
|
327
327
|
return Requests.processRoute(UserRoutes.routes.getFacebookGroups, undefined, undefined, params);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
/**
|
|
331
|
+
* Add a genre to a user.
|
|
332
|
+
*
|
|
333
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
334
|
+
*
|
|
335
|
+
* @param data The genre information to be passed to update the genre information.
|
|
336
|
+
*
|
|
337
|
+
* @returns Promise
|
|
338
|
+
*/
|
|
339
|
+
public static addGenre<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
340
|
+
|
|
341
|
+
return Requests.processRoute(UserRoutes.routes.addGenre, data, undefined, params);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Remove a genre from a user.
|
|
346
|
+
*
|
|
347
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
348
|
+
*
|
|
349
|
+
* @param genre_id The id of the genre to remove.
|
|
350
|
+
*
|
|
351
|
+
* @returns Promise
|
|
352
|
+
*/
|
|
353
|
+
public static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
354
|
+
|
|
355
|
+
return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, {genre_id : genre_id}, params);
|
|
356
|
+
}
|
|
357
|
+
|
|
330
358
|
|
|
331
359
|
|
|
332
360
|
|
package/src/api/Utility.ts
CHANGED
|
@@ -16,6 +16,17 @@ class Utility {
|
|
|
16
16
|
return Requests.processRoute(UtilityRoutes.routes.social_interactions, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Get all the genres available on the platform.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
23
|
+
*
|
|
24
|
+
* @returns promise
|
|
25
|
+
*/
|
|
26
|
+
public static listGenres<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
27
|
+
return Requests.processRoute(UtilityRoutes.routes.genres, undefined, undefined, params);
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
}
|
|
20
31
|
|
|
21
32
|
export default Utility;
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -28,6 +28,8 @@ class UserRoutes {
|
|
|
28
28
|
aggregateMonthlyGivenTips : { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
|
|
29
29
|
getYoutubeChannels : { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
|
|
30
30
|
getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
|
|
31
|
+
addGenre : { url: '/users/addGenre', method: HTTP_METHODS.POST },
|
|
32
|
+
removeGenre : { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
}
|