glitch-javascript-sdk 1.6.0 → 1.6.2
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 +33 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Titles.d.ts +15 -0
- package/dist/esm/api/Users.d.ts +8 -0
- package/dist/esm/index.js +33 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +23 -0
- package/package.json +1 -1
- package/src/api/Titles.ts +42 -0
- package/src/api/Users.ts +12 -0
- package/src/routes/TitlesRoute.ts +3 -0
- package/src/routes/UserRoutes.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1583,6 +1583,14 @@ declare class Users {
|
|
|
1583
1583
|
* @returns Promise resolving to the list of flairs
|
|
1584
1584
|
*/
|
|
1585
1585
|
static getSubredditFlairs<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Search all the users with advanced meilisearch options
|
|
1588
|
+
*
|
|
1589
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userSearch
|
|
1590
|
+
*
|
|
1591
|
+
* @returns promise
|
|
1592
|
+
*/
|
|
1593
|
+
static search<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1586
1594
|
}
|
|
1587
1595
|
|
|
1588
1596
|
declare class Events {
|
|
@@ -2920,6 +2928,21 @@ declare class Titles {
|
|
|
2920
2928
|
* @returns AxiosPromise
|
|
2921
2929
|
*/
|
|
2922
2930
|
static getWishlist<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2931
|
+
/**
|
|
2932
|
+
* Create a new API token for a title.
|
|
2933
|
+
* Returns { full_token: string, token: TitleToken }.
|
|
2934
|
+
*/
|
|
2935
|
+
static createTitleToken<T>(title_id: string, data?: {
|
|
2936
|
+
expires_at?: string;
|
|
2937
|
+
}): AxiosPromise<Response<T>>;
|
|
2938
|
+
/**
|
|
2939
|
+
* List all tokens for a title.
|
|
2940
|
+
*/
|
|
2941
|
+
static listTitleTokens<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
2942
|
+
/**
|
|
2943
|
+
* Revoke a specific token by ID.
|
|
2944
|
+
*/
|
|
2945
|
+
static revokeTitleToken<T>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
|
|
2923
2946
|
}
|
|
2924
2947
|
|
|
2925
2948
|
declare class Campaigns {
|
package/package.json
CHANGED
package/src/api/Titles.ts
CHANGED
|
@@ -262,6 +262,48 @@ class Titles {
|
|
|
262
262
|
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id }, params);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Create a new API token for a title.
|
|
267
|
+
* Returns { full_token: string, token: TitleToken }.
|
|
268
|
+
*/
|
|
269
|
+
public static createTitleToken<T>(
|
|
270
|
+
title_id: string,
|
|
271
|
+
data?: { expires_at?: string }
|
|
272
|
+
): AxiosPromise<Response<T>> {
|
|
273
|
+
return Requests.processRoute(
|
|
274
|
+
TitlesRoute.routes.createToken,
|
|
275
|
+
data,
|
|
276
|
+
{ title_id }
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* List all tokens for a title.
|
|
282
|
+
*/
|
|
283
|
+
public static listTitleTokens<T>(
|
|
284
|
+
title_id: string
|
|
285
|
+
): AxiosPromise<Response<T>> {
|
|
286
|
+
return Requests.processRoute(
|
|
287
|
+
TitlesRoute.routes.listTokens,
|
|
288
|
+
{},
|
|
289
|
+
{ title_id }
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Revoke a specific token by ID.
|
|
295
|
+
*/
|
|
296
|
+
public static revokeTitleToken<T>(
|
|
297
|
+
title_id: string,
|
|
298
|
+
token_id: string
|
|
299
|
+
): AxiosPromise<Response<T>> {
|
|
300
|
+
return Requests.processRoute(
|
|
301
|
+
TitlesRoute.routes.revokeToken,
|
|
302
|
+
{},
|
|
303
|
+
{ title_id, token_id }
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
265
307
|
}
|
|
266
308
|
|
|
267
309
|
export default Titles;
|
package/src/api/Users.ts
CHANGED
|
@@ -517,6 +517,18 @@ class Users {
|
|
|
517
517
|
}
|
|
518
518
|
|
|
519
519
|
|
|
520
|
+
/**
|
|
521
|
+
* Search all the users with advanced meilisearch options
|
|
522
|
+
*
|
|
523
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userSearch
|
|
524
|
+
*
|
|
525
|
+
* @returns promise
|
|
526
|
+
*/
|
|
527
|
+
public static search<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
528
|
+
return Requests.processRoute(UserRoutes.routes.search, undefined, undefined, params);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
|
|
520
532
|
|
|
521
533
|
|
|
522
534
|
|
|
@@ -20,6 +20,9 @@ class TitlesRoute {
|
|
|
20
20
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
21
21
|
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
22
22
|
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
23
|
+
createToken: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.POST },
|
|
24
|
+
listTokens: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.GET },
|
|
25
|
+
revokeToken: { url: '/titles/{title_id}/tokens/{token_id}', method: HTTP_METHODS.DELETE },
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -44,6 +44,8 @@ class UserRoutes {
|
|
|
44
44
|
getSubreddits: { url: "/users/reddit/subreddits", method: HTTP_METHODS.GET },
|
|
45
45
|
getSubredditFlairs: { url: "/users/reddit/redditflairs/{subreddit}", method: HTTP_METHODS.GET },
|
|
46
46
|
|
|
47
|
+
search: { url: '/users/search', method: HTTP_METHODS.GET },
|
|
48
|
+
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
}
|