glitch-javascript-sdk 0.8.4 → 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 +49 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Messages.d.ts +8 -0
- package/dist/esm/api/Users.d.ts +20 -0
- package/dist/esm/api/Utility.d.ts +8 -0
- package/dist/esm/index.js +49 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/package.json +1 -1
- package/src/api/Messages.ts +11 -0
- package/src/api/Users.ts +28 -0
- package/src/api/Utility.ts +11 -0
- package/src/routes/CampaignsRoute.ts +1 -1
- package/src/routes/MessagesRoute.ts +1 -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 {
|
|
@@ -2543,6 +2571,14 @@ declare class Messages {
|
|
|
2543
2571
|
* @returns A promise
|
|
2544
2572
|
*/
|
|
2545
2573
|
static createOrGetThread<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2574
|
+
/**
|
|
2575
|
+
* Get a single thread.
|
|
2576
|
+
*
|
|
2577
|
+
* @see https://api.glitch.fun/api/documentation#/Messages/getThread
|
|
2578
|
+
*
|
|
2579
|
+
* @returns promise
|
|
2580
|
+
*/
|
|
2581
|
+
static getThread<T>(thread_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2546
2582
|
}
|
|
2547
2583
|
|
|
2548
2584
|
declare class Feedback {
|
package/package.json
CHANGED
package/src/api/Messages.ts
CHANGED
|
@@ -50,6 +50,17 @@ class Messages {
|
|
|
50
50
|
return Requests.processRoute(MessagesRoute.routes.createOrGetThread, data, {}, params);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Get a single thread.
|
|
55
|
+
*
|
|
56
|
+
* @see https://api.glitch.fun/api/documentation#/Messages/getThread
|
|
57
|
+
*
|
|
58
|
+
* @returns promise
|
|
59
|
+
*/
|
|
60
|
+
public static getThread<T>(thread_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
61
|
+
return Requests.processRoute(MessagesRoute.routes.getThread, undefined, {thread_id : thread_id}, params);
|
|
62
|
+
}
|
|
63
|
+
|
|
53
64
|
|
|
54
65
|
|
|
55
66
|
}
|
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;
|
|
@@ -24,7 +24,7 @@ class CampaignsRoute {
|
|
|
24
24
|
createCampaignMention :{ url: '/campaigns/{campaign_id}/mentions', method: HTTP_METHODS.POST },
|
|
25
25
|
getCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
26
26
|
updateCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
|
|
27
|
-
deleteCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.
|
|
27
|
+
deleteCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
}
|
|
@@ -8,6 +8,7 @@ class MessagesRoute {
|
|
|
8
8
|
sendMessage: { url: '/messages', method: HTTP_METHODS.POST },
|
|
9
9
|
deleteMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.DELETE },
|
|
10
10
|
createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
|
|
11
|
+
getThread: { url: '/messages/thread/{thread_id}', method: HTTP_METHODS.GET },
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
}
|
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
|
}
|