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/esm/api/Titles.d.ts
CHANGED
|
@@ -141,9 +141,37 @@ declare class Titles {
|
|
|
141
141
|
* Remove media from a title.
|
|
142
142
|
*/
|
|
143
143
|
static removeMedia<T>(title_id: string, media_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
144
|
+
/**
|
|
145
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
146
|
+
*
|
|
147
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
148
|
+
*
|
|
149
|
+
* @param title_id The ID of the title to update
|
|
150
|
+
* @param media_order An array of objects, each containing:
|
|
151
|
+
* - media_id: string (the UUID of the media)
|
|
152
|
+
* - order: number (the new order/index)
|
|
153
|
+
* @returns Promise containing the server response
|
|
154
|
+
*/
|
|
144
155
|
static updateMediaOrder<T>(title_id: string, media_order: {
|
|
145
156
|
media_id: string;
|
|
146
157
|
order: number;
|
|
147
158
|
}[]): AxiosPromise<Response<T>>;
|
|
159
|
+
/**
|
|
160
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
161
|
+
*
|
|
162
|
+
* @param title_id The UUID of the title
|
|
163
|
+
* @param file The CSV or Excel file
|
|
164
|
+
* @param data Any additional form data, e.g. platform
|
|
165
|
+
* @returns AxiosPromise
|
|
166
|
+
*/
|
|
167
|
+
static importWishlist<T>(title_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
168
|
+
/**
|
|
169
|
+
* Retrieve the wishlist data for a specific title.
|
|
170
|
+
*
|
|
171
|
+
* @param title_id The UUID of the title
|
|
172
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
173
|
+
* @returns AxiosPromise
|
|
174
|
+
*/
|
|
175
|
+
static getWishlist<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
148
176
|
}
|
|
149
177
|
export default Titles;
|
package/dist/esm/index.js
CHANGED
|
@@ -9544,6 +9544,8 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
9544
9544
|
addMedia: { url: '/titles/{title_id}/addMedia', method: HTTP_METHODS.POST },
|
|
9545
9545
|
removeMedia: { url: '/titles/{title_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
|
|
9546
9546
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
9547
|
+
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
9548
|
+
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
9547
9549
|
};
|
|
9548
9550
|
return TitlesRoute;
|
|
9549
9551
|
}());
|
|
@@ -9725,9 +9727,43 @@ var Titles = /** @class */ (function () {
|
|
|
9725
9727
|
Titles.removeMedia = function (title_id, media_id, params) {
|
|
9726
9728
|
return Requests.processRoute(TitlesRoute.routes.removeMedia, {}, { title_id: title_id, media_id: media_id }, params);
|
|
9727
9729
|
};
|
|
9730
|
+
/**
|
|
9731
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
9732
|
+
*
|
|
9733
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
9734
|
+
*
|
|
9735
|
+
* @param title_id The ID of the title to update
|
|
9736
|
+
* @param media_order An array of objects, each containing:
|
|
9737
|
+
* - media_id: string (the UUID of the media)
|
|
9738
|
+
* - order: number (the new order/index)
|
|
9739
|
+
* @returns Promise containing the server response
|
|
9740
|
+
*/
|
|
9728
9741
|
Titles.updateMediaOrder = function (title_id, media_order) {
|
|
9729
9742
|
return Requests.processRoute(TitlesRoute.routes.updateMediaOrder, { media_order: media_order }, { title_id: title_id });
|
|
9730
9743
|
};
|
|
9744
|
+
/**
|
|
9745
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
9746
|
+
*
|
|
9747
|
+
* @param title_id The UUID of the title
|
|
9748
|
+
* @param file The CSV or Excel file
|
|
9749
|
+
* @param data Any additional form data, e.g. platform
|
|
9750
|
+
* @returns AxiosPromise
|
|
9751
|
+
*/
|
|
9752
|
+
Titles.importWishlist = function (title_id, file, data, params) {
|
|
9753
|
+
var url = TitlesRoute.routes.importWishlist.url.replace('{title_id}', title_id);
|
|
9754
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
9755
|
+
};
|
|
9756
|
+
/**
|
|
9757
|
+
* Retrieve the wishlist data for a specific title.
|
|
9758
|
+
*
|
|
9759
|
+
* @param title_id The UUID of the title
|
|
9760
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
9761
|
+
* @returns AxiosPromise
|
|
9762
|
+
*/
|
|
9763
|
+
Titles.getWishlist = function (title_id, params) {
|
|
9764
|
+
TitlesRoute.routes.getWishlist.url.replace('{title_id}', title_id);
|
|
9765
|
+
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id: title_id }, params);
|
|
9766
|
+
};
|
|
9731
9767
|
return Titles;
|
|
9732
9768
|
}());
|
|
9733
9769
|
|