glitch-javascript-sdk 1.5.6 → 1.5.7
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 +36 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Titles.d.ts +28 -0
- package/dist/esm/index.js +36 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +28 -0
- package/package.json +1 -1
- package/src/api/Titles.ts +44 -0
- package/src/routes/TitlesRoute.ts +2 -1
package/dist/cjs/index.js
CHANGED
|
@@ -22728,6 +22728,8 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
22728
22728
|
addMedia: { url: '/titles/{title_id}/addMedia', method: HTTP_METHODS.POST },
|
|
22729
22729
|
removeMedia: { url: '/titles/{title_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
|
|
22730
22730
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
22731
|
+
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
22732
|
+
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
22731
22733
|
};
|
|
22732
22734
|
return TitlesRoute;
|
|
22733
22735
|
}());
|
|
@@ -22909,9 +22911,43 @@ var Titles = /** @class */ (function () {
|
|
|
22909
22911
|
Titles.removeMedia = function (title_id, media_id, params) {
|
|
22910
22912
|
return Requests.processRoute(TitlesRoute.routes.removeMedia, {}, { title_id: title_id, media_id: media_id }, params);
|
|
22911
22913
|
};
|
|
22914
|
+
/**
|
|
22915
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
22916
|
+
*
|
|
22917
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
22918
|
+
*
|
|
22919
|
+
* @param title_id The ID of the title to update
|
|
22920
|
+
* @param media_order An array of objects, each containing:
|
|
22921
|
+
* - media_id: string (the UUID of the media)
|
|
22922
|
+
* - order: number (the new order/index)
|
|
22923
|
+
* @returns Promise containing the server response
|
|
22924
|
+
*/
|
|
22912
22925
|
Titles.updateMediaOrder = function (title_id, media_order) {
|
|
22913
22926
|
return Requests.processRoute(TitlesRoute.routes.updateMediaOrder, { media_order: media_order }, { title_id: title_id });
|
|
22914
22927
|
};
|
|
22928
|
+
/**
|
|
22929
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
22930
|
+
*
|
|
22931
|
+
* @param title_id The UUID of the title
|
|
22932
|
+
* @param file The CSV or Excel file
|
|
22933
|
+
* @param data Any additional form data, e.g. platform
|
|
22934
|
+
* @returns AxiosPromise
|
|
22935
|
+
*/
|
|
22936
|
+
Titles.importWishlist = function (title_id, file, data, params) {
|
|
22937
|
+
var url = TitlesRoute.routes.importWishlist.url.replace('{title_id}', title_id);
|
|
22938
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
22939
|
+
};
|
|
22940
|
+
/**
|
|
22941
|
+
* Retrieve the wishlist data for a specific title.
|
|
22942
|
+
*
|
|
22943
|
+
* @param title_id The UUID of the title
|
|
22944
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
22945
|
+
* @returns AxiosPromise
|
|
22946
|
+
*/
|
|
22947
|
+
Titles.getWishlist = function (title_id, params) {
|
|
22948
|
+
TitlesRoute.routes.getWishlist.url.replace('{title_id}', title_id);
|
|
22949
|
+
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id: title_id }, params);
|
|
22950
|
+
};
|
|
22915
22951
|
return Titles;
|
|
22916
22952
|
}());
|
|
22917
22953
|
|