glitch-javascript-sdk 2.9.7 → 2.9.9

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
@@ -2275,6 +2275,55 @@ declare class Users {
2275
2275
  title_id?: string;
2276
2276
  page?: number;
2277
2277
  }): AxiosPromise<Response<T>>;
2278
+ /**
2279
+ * List the authenticated user's media library (clips, screenshots, AI generated).
2280
+ *
2281
+ * @param params Optional filters: { type: 'clip'|'screenshot'|'ai_generated', title_id: string }
2282
+ */
2283
+ static listMedia<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2284
+ /**
2285
+ * Add a Media record to the user's personal library.
2286
+ *
2287
+ * @param data { media_id: string, type: string, title_id?: string, label?: string, studio_metadata?: object }
2288
+ */
2289
+ static storeMedia<T>(data: object): AxiosPromise<Response<T>>;
2290
+ /**
2291
+ * Retrieve details for a specific library item.
2292
+ */
2293
+ static viewMedia<T>(id: string): AxiosPromise<Response<T>>;
2294
+ /**
2295
+ * Update a library item's label or metadata.
2296
+ */
2297
+ static updateMedia<T>(id: string, data: object): AxiosPromise<Response<T>>;
2298
+ /**
2299
+ * Remove an item from the user's library (Soft Delete).
2300
+ */
2301
+ static deleteMedia<T>(id: string): AxiosPromise<Response<T>>;
2302
+ /**
2303
+ * Apply AI transformations (Style Transfer/Upscale) to a library item.
2304
+ *
2305
+ * @param id The UUID of the UserMedia record.
2306
+ * @param data { prompt: string, tool: 'style_transfer'|'upscale' }
2307
+ */
2308
+ static modifyMedia<T>(id: string, data: {
2309
+ prompt: string;
2310
+ tool: string;
2311
+ }): AxiosPromise<Response<T>>;
2312
+ /**
2313
+ * Get AI-generated suggestions for the best 15-second window to trim a video.
2314
+ */
2315
+ static suggestSmartTrim<T>(id: string): AxiosPromise<Response<T>>;
2316
+ /**
2317
+ * Share a library item to social media as User Generated Content (UGC).
2318
+ *
2319
+ * @param id The UUID of the UserMedia record.
2320
+ * @param data { platform: string, title?: string, content: string }
2321
+ */
2322
+ static shareMedia<T>(id: string, data: {
2323
+ platform: string;
2324
+ title?: string;
2325
+ content: string;
2326
+ }): AxiosPromise<Response<T>>;
2278
2327
  }
2279
2328
 
2280
2329
  declare class Events {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.9.7",
3
+ "version": "2.9.9",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Users.ts CHANGED
@@ -593,6 +593,71 @@ class Users {
593
593
  return Requests.processRoute(UserRoutes.routes.userProgressionHistory, undefined, { user_id }, params);
594
594
  }
595
595
 
596
+ /**
597
+ * List the authenticated user's media library (clips, screenshots, AI generated).
598
+ *
599
+ * @param params Optional filters: { type: 'clip'|'screenshot'|'ai_generated', title_id: string }
600
+ */
601
+ public static listMedia<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
602
+ return Requests.processRoute(UserRoutes.routes.listMedia, undefined, undefined, params);
603
+ }
604
+
605
+ /**
606
+ * Add a Media record to the user's personal library.
607
+ *
608
+ * @param data { media_id: string, type: string, title_id?: string, label?: string, studio_metadata?: object }
609
+ */
610
+ public static storeMedia<T>(data: object): AxiosPromise<Response<T>> {
611
+ return Requests.processRoute(UserRoutes.routes.storeMedia, data);
612
+ }
613
+
614
+ /**
615
+ * Retrieve details for a specific library item.
616
+ */
617
+ public static viewMedia<T>(id: string): AxiosPromise<Response<T>> {
618
+ return Requests.processRoute(UserRoutes.routes.viewMedia, undefined, { id });
619
+ }
620
+
621
+ /**
622
+ * Update a library item's label or metadata.
623
+ */
624
+ public static updateMedia<T>(id: string, data: object): AxiosPromise<Response<T>> {
625
+ return Requests.processRoute(UserRoutes.routes.updateMedia, data, { id });
626
+ }
627
+
628
+ /**
629
+ * Remove an item from the user's library (Soft Delete).
630
+ */
631
+ public static deleteMedia<T>(id: string): AxiosPromise<Response<T>> {
632
+ return Requests.processRoute(UserRoutes.routes.deleteMedia, undefined, { id });
633
+ }
634
+
635
+ /**
636
+ * Apply AI transformations (Style Transfer/Upscale) to a library item.
637
+ *
638
+ * @param id The UUID of the UserMedia record.
639
+ * @param data { prompt: string, tool: 'style_transfer'|'upscale' }
640
+ */
641
+ public static modifyMedia<T>(id: string, data: { prompt: string, tool: string }): AxiosPromise<Response<T>> {
642
+ return Requests.processRoute(UserRoutes.routes.modifyMedia, data, { id });
643
+ }
644
+
645
+ /**
646
+ * Get AI-generated suggestions for the best 15-second window to trim a video.
647
+ */
648
+ public static suggestSmartTrim<T>(id: string): AxiosPromise<Response<T>> {
649
+ return Requests.processRoute(UserRoutes.routes.suggestSmartTrim, undefined, { id });
650
+ }
651
+
652
+ /**
653
+ * Share a library item to social media as User Generated Content (UGC).
654
+ *
655
+ * @param id The UUID of the UserMedia record.
656
+ * @param data { platform: string, title?: string, content: string }
657
+ */
658
+ public static shareMedia<T>(id: string, data: { platform: string, title?: string, content: string }): AxiosPromise<Response<T>> {
659
+ return Requests.processRoute(UserRoutes.routes.shareMedia, data, { id });
660
+ }
596
661
 
597
662
  }
598
663
 
@@ -280,7 +280,7 @@ class TitlesRoute {
280
280
 
281
281
  communityActivity: { url: '/titles/activity/trending', method: HTTP_METHODS.GET },
282
282
  socialTrending: { url: '/titles/activity/social', method: HTTP_METHODS.GET },
283
-
283
+ discoveryQueue: { url: '/titles/discovery/queue', method: HTTP_METHODS.GET },
284
284
 
285
285
  };
286
286
 
@@ -57,7 +57,17 @@ class UserRoutes {
57
57
  userProgressionAchievements: { url: '/users/{user_id}/progression/achievements', method: HTTP_METHODS.GET },
58
58
  userProgressionHistory: { url: '/users/{user_id}/progression/history', method: HTTP_METHODS.GET },
59
59
 
60
-
60
+ // --- User Media Library (Viral Clip Studio) ---
61
+ listMedia: { url: '/users/me/media', method: HTTP_METHODS.GET },
62
+ storeMedia: { url: '/users/me/media', method: HTTP_METHODS.POST },
63
+ viewMedia: { url: '/users/me/media/{id}', method: HTTP_METHODS.GET },
64
+ updateMedia: { url: '/users/me/media/{id}', method: HTTP_METHODS.PUT },
65
+ deleteMedia: { url: '/users/me/media/{id}', method: HTTP_METHODS.DELETE },
66
+
67
+ // AI & Social Actions
68
+ modifyMedia: { url: '/users/me/media/{id}/modify', method: HTTP_METHODS.POST },
69
+ suggestSmartTrim: { url: '/users/me/media/{id}/smart-trim', method: HTTP_METHODS.GET },
70
+ shareMedia: { url: '/users/me/media/{id}/share', method: HTTP_METHODS.POST },
61
71
  };
62
72
 
63
73
  }