glitch-javascript-sdk 1.5.5 → 1.5.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/index.d.ts CHANGED
@@ -2862,6 +2862,10 @@ declare class Titles {
2862
2862
  * Remove media from a title.
2863
2863
  */
2864
2864
  static removeMedia<T>(title_id: string, media_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2865
+ static updateMediaOrder<T>(title_id: string, media_order: {
2866
+ media_id: string;
2867
+ order: number;
2868
+ }[]): AxiosPromise<Response<T>>;
2865
2869
  }
2866
2870
 
2867
2871
  declare class Campaigns {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Titles.ts CHANGED
@@ -196,10 +196,10 @@ class Titles {
196
196
  return Requests.uploadBlob(url, 'image', blob, data);
197
197
  }
198
198
 
199
- /**
200
- * Add media to a title.
201
- */
202
- public static addMedia<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
199
+ /**
200
+ * Add media to a title.
201
+ */
202
+ public static addMedia<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
203
203
  return Requests.processRoute(TitlesRoute.routes.addMedia, data, { title_id: title_id }, params);
204
204
  }
205
205
 
@@ -210,6 +210,14 @@ class Titles {
210
210
  return Requests.processRoute(TitlesRoute.routes.removeMedia, {}, { title_id: title_id, media_id: media_id }, params);
211
211
  }
212
212
 
213
+ public static updateMediaOrder<T>(title_id: string, media_order: { media_id: string, order: number }[]): AxiosPromise<Response<T>> {
214
+ return Requests.processRoute(
215
+ TitlesRoute.routes.updateMediaOrder,
216
+ { media_order },
217
+ { title_id: title_id }
218
+ );
219
+ }
220
+
213
221
  }
214
222
 
215
223
  export default Titles;
@@ -17,6 +17,8 @@ class TitlesRoute {
17
17
  removeAdministrator : { url: '/titles/{title_id}/removeAdministrator/{user_id}', method: HTTP_METHODS.DELETE },
18
18
  addMedia: { url: '/titles/{title_id}/addMedia', method: HTTP_METHODS.POST },
19
19
  removeMedia: { url: '/titles/{title_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
20
+ updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
21
+
20
22
  };
21
23
 
22
24
  }