glitch-javascript-sdk 2.5.7 → 2.5.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/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
 
@@ -29869,6 +29892,15 @@ var Education = /** @class */ (function () {
29869
29892
  Education.viewQuizAttempt = function (uuid) {
29870
29893
  return Requests.processRoute(EducationRoute.routes.viewQuizAttempt, undefined, { uuid: uuid });
29871
29894
  };
29895
+ Education.createQuiz = function (data) {
29896
+ return Requests.processRoute(EducationRoute.routes.createQuiz, data);
29897
+ };
29898
+ Education.updateQuiz = function (uuid, data) {
29899
+ return Requests.processRoute(EducationRoute.routes.updateQuiz, data, { uuid: uuid });
29900
+ };
29901
+ Education.deleteQuiz = function (uuid) {
29902
+ return Requests.processRoute(EducationRoute.routes.deleteQuiz, undefined, { uuid: uuid });
29903
+ };
29872
29904
  // --- 6. QUIZ QUESTIONS & OPTIONS ---
29873
29905
  Education.listQuizQuestions = function (quiz_id) {
29874
29906
  return Requests.processRoute(EducationRoute.routes.listQuizQuestions, undefined, { quiz_id: quiz_id });
@@ -29885,6 +29917,25 @@ var Education = /** @class */ (function () {
29885
29917
  Education.createQuizOption = function (question_id, data) {
29886
29918
  return Requests.processRoute(EducationRoute.routes.createQuizOption, data, { question_id: question_id });
29887
29919
  };
29920
+ Education.viewQuizQuestion = function (uuid) {
29921
+ return Requests.processRoute(EducationRoute.routes.viewQuizQuestion, undefined, { uuid: uuid });
29922
+ };
29923
+ Education.updateQuizQuestion = function (uuid, data) {
29924
+ return Requests.processRoute(EducationRoute.routes.updateQuizQuestion, data, { uuid: uuid });
29925
+ };
29926
+ Education.deleteQuizQuestion = function (uuid) {
29927
+ return Requests.processRoute(EducationRoute.routes.deleteQuizQuestion, undefined, { uuid: uuid });
29928
+ };
29929
+ // --- QUIZ OPTIONS (CRUD) ---
29930
+ Education.viewQuizOption = function (uuid) {
29931
+ return Requests.processRoute(EducationRoute.routes.viewQuizOption, undefined, { uuid: uuid });
29932
+ };
29933
+ Education.updateQuizOption = function (uuid, data) {
29934
+ return Requests.processRoute(EducationRoute.routes.updateQuizOption, data, { uuid: uuid });
29935
+ };
29936
+ Education.deleteQuizOption = function (uuid) {
29937
+ return Requests.processRoute(EducationRoute.routes.deleteQuizOption, undefined, { uuid: uuid });
29938
+ };
29888
29939
  // --- 7. PROGRESS & REGISTRATIONS ---
29889
29940
  Education.syncProgress = function (data) {
29890
29941
  return Requests.processRoute(EducationRoute.routes.syncProgress, data);