glitch-javascript-sdk 2.5.8 → 2.6.0

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 CHANGED
@@ -27222,6 +27222,8 @@ var MediaRoute = /** @class */ (function () {
27222
27222
  createLibraryLogo: { url: '/media/create-library-logo', method: HTTP_METHODS.POST },
27223
27223
  validateScreenshot: { url: '/media/validate-screenshot', method: HTTP_METHODS.POST },
27224
27224
  uploadTikTokMusic: { url: '/media/tiktok/music', method: HTTP_METHODS.POST },
27225
+ getPresignedUrl: { url: '/media/presigned-url', method: HTTP_METHODS.POST },
27226
+ confirmS3Upload: { url: '/media/s3-confirm', method: HTTP_METHODS.POST },
27225
27227
  };
27226
27228
  return MediaRoute;
27227
27229
  }());
@@ -27452,6 +27454,27 @@ var Media = /** @class */ (function () {
27452
27454
  // We use the raw URL here as it's a specialized upload path
27453
27455
  return Requests.uploadFile('/media/tiktok/music', 'audio', file, { scheduler_id: scheduler_id });
27454
27456
  };
27457
+ /**
27458
+ * Generate an S3 Presigned URL for direct upload.
27459
+ * Use this for large files (up to 2GB) to bypass the Laravel server.
27460
+ *
27461
+ * @param filename The original name of the file.
27462
+ * @param extension The file extension (e.g., 'mp4').
27463
+ * @returns AxiosPromise containing upload_url and file_path.
27464
+ */
27465
+ Media.getPresignedUrl = function (filename, extension) {
27466
+ return Requests.processRoute(MediaRoute.routes.getPresignedUrl, { filename: filename, extension: extension });
27467
+ };
27468
+ /**
27469
+ * Confirm a successful S3 upload and create the database record.
27470
+ * Call this after the direct S3 upload is complete.
27471
+ *
27472
+ * @param data The file metadata (path, size, mime_type).
27473
+ * @returns AxiosPromise containing the created Media resource.
27474
+ */
27475
+ Media.confirmS3Upload = function (data) {
27476
+ return Requests.processRoute(MediaRoute.routes.confirmS3Upload, data);
27477
+ };
27455
27478
  return Media;
27456
27479
  }());
27457
27480
 
@@ -29677,6 +29700,7 @@ var EducationRoute = /** @class */ (function () {
29677
29700
  saveContentModuleState: { url: '/education/content/{uuid}/module-state', method: HTTP_METHODS.POST },
29678
29701
  getContentModuleState: { url: '/education/content/{uuid}/module-state', method: HTTP_METHODS.GET },
29679
29702
  getSecureVideo: { url: '/education/content/{uuid}/secure-video', method: HTTP_METHODS.GET },
29703
+ getPreviewSecureVideo: { url: '/education/content/{uuid}/preview-secure-video', method: HTTP_METHODS.GET },
29680
29704
  // 4. EducationContentTrackController (Pivot)
29681
29705
  listTrackContent: { url: '/education/tracks/{track_id}/content', method: HTTP_METHODS.GET },
29682
29706
  addContentToTrack: { url: '/education/tracks/{track_id}/content', method: HTTP_METHODS.POST },
@@ -29840,6 +29864,9 @@ var Education = /** @class */ (function () {
29840
29864
  Education.getSecureVideo = function (uuid) {
29841
29865
  return Requests.processRoute(EducationRoute.routes.getSecureVideo, undefined, { uuid: uuid });
29842
29866
  };
29867
+ Education.getPreviewSecureVideo = function (uuid) {
29868
+ return Requests.processRoute(EducationRoute.routes.getPreviewSecureVideo, undefined, { uuid: uuid });
29869
+ };
29843
29870
  // --- 4. TRACK CONTENT (PIVOT) ---
29844
29871
  Education.listTrackContent = function (track_id) {
29845
29872
  return Requests.processRoute(EducationRoute.routes.listTrackContent, undefined, { track_id: track_id });