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/esm/api/Titles.d.ts
CHANGED
|
@@ -173,5 +173,20 @@ declare class Titles {
|
|
|
173
173
|
* @returns AxiosPromise
|
|
174
174
|
*/
|
|
175
175
|
static getWishlist<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
176
|
+
/**
|
|
177
|
+
* Create a new API token for a title.
|
|
178
|
+
* Returns { full_token: string, token: TitleToken }.
|
|
179
|
+
*/
|
|
180
|
+
static createTitleToken<T>(title_id: string, data?: {
|
|
181
|
+
expires_at?: string;
|
|
182
|
+
}): AxiosPromise<Response<T>>;
|
|
183
|
+
/**
|
|
184
|
+
* List all tokens for a title.
|
|
185
|
+
*/
|
|
186
|
+
static listTitleTokens<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
187
|
+
/**
|
|
188
|
+
* Revoke a specific token by ID.
|
|
189
|
+
*/
|
|
190
|
+
static revokeTitleToken<T>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
|
|
176
191
|
}
|
|
177
192
|
export default Titles;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -358,5 +358,13 @@ declare class Users {
|
|
|
358
358
|
* @returns Promise resolving to the list of flairs
|
|
359
359
|
*/
|
|
360
360
|
static getSubredditFlairs<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
361
|
+
/**
|
|
362
|
+
* Search all the users with advanced meilisearch options
|
|
363
|
+
*
|
|
364
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userSearch
|
|
365
|
+
*
|
|
366
|
+
* @returns promise
|
|
367
|
+
*/
|
|
368
|
+
static search<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
361
369
|
}
|
|
362
370
|
export default Users;
|
package/dist/esm/index.js
CHANGED
|
@@ -7424,6 +7424,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
7424
7424
|
getFacebookPages: { url: "/users/facebookPages", method: HTTP_METHODS.GET },
|
|
7425
7425
|
getSubreddits: { url: "/users/reddit/subreddits", method: HTTP_METHODS.GET },
|
|
7426
7426
|
getSubredditFlairs: { url: "/users/reddit/redditflairs/{subreddit}", method: HTTP_METHODS.GET },
|
|
7427
|
+
search: { url: '/users/search', method: HTTP_METHODS.GET },
|
|
7427
7428
|
};
|
|
7428
7429
|
return UserRoutes;
|
|
7429
7430
|
}());
|
|
@@ -7866,6 +7867,16 @@ var Users = /** @class */ (function () {
|
|
|
7866
7867
|
Users.getSubredditFlairs = function (subreddit, params) {
|
|
7867
7868
|
return Requests.processRoute(UserRoutes.routes.getSubredditFlairs, undefined, { subreddit: subreddit }, params);
|
|
7868
7869
|
};
|
|
7870
|
+
/**
|
|
7871
|
+
* Search all the users with advanced meilisearch options
|
|
7872
|
+
*
|
|
7873
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userSearch
|
|
7874
|
+
*
|
|
7875
|
+
* @returns promise
|
|
7876
|
+
*/
|
|
7877
|
+
Users.search = function (params) {
|
|
7878
|
+
return Requests.processRoute(UserRoutes.routes.search, undefined, undefined, params);
|
|
7879
|
+
};
|
|
7869
7880
|
return Users;
|
|
7870
7881
|
}());
|
|
7871
7882
|
|
|
@@ -9591,6 +9602,9 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
9591
9602
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
9592
9603
|
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
9593
9604
|
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
9605
|
+
createToken: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.POST },
|
|
9606
|
+
listTokens: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.GET },
|
|
9607
|
+
revokeToken: { url: '/titles/{title_id}/tokens/{token_id}', method: HTTP_METHODS.DELETE },
|
|
9594
9608
|
};
|
|
9595
9609
|
return TitlesRoute;
|
|
9596
9610
|
}());
|
|
@@ -9809,6 +9823,25 @@ var Titles = /** @class */ (function () {
|
|
|
9809
9823
|
TitlesRoute.routes.getWishlist.url.replace('{title_id}', title_id);
|
|
9810
9824
|
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id: title_id }, params);
|
|
9811
9825
|
};
|
|
9826
|
+
/**
|
|
9827
|
+
* Create a new API token for a title.
|
|
9828
|
+
* Returns { full_token: string, token: TitleToken }.
|
|
9829
|
+
*/
|
|
9830
|
+
Titles.createTitleToken = function (title_id, data) {
|
|
9831
|
+
return Requests.processRoute(TitlesRoute.routes.createToken, data, { title_id: title_id });
|
|
9832
|
+
};
|
|
9833
|
+
/**
|
|
9834
|
+
* List all tokens for a title.
|
|
9835
|
+
*/
|
|
9836
|
+
Titles.listTitleTokens = function (title_id) {
|
|
9837
|
+
return Requests.processRoute(TitlesRoute.routes.listTokens, {}, { title_id: title_id });
|
|
9838
|
+
};
|
|
9839
|
+
/**
|
|
9840
|
+
* Revoke a specific token by ID.
|
|
9841
|
+
*/
|
|
9842
|
+
Titles.revokeTitleToken = function (title_id, token_id) {
|
|
9843
|
+
return Requests.processRoute(TitlesRoute.routes.revokeToken, {}, { title_id: title_id, token_id: token_id });
|
|
9844
|
+
};
|
|
9812
9845
|
return Titles;
|
|
9813
9846
|
}());
|
|
9814
9847
|
|