glitch-javascript-sdk 2.9.9 → 3.0.1
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 +21 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Media.d.ts +42 -3
- package/dist/esm/index.js +21 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +42 -3
- package/package.json +1 -1
- package/src/api/Media.ts +65 -4
- package/src/routes/MediaRoute.ts +1 -0
package/dist/cjs/index.js
CHANGED
|
@@ -28097,6 +28097,7 @@ var MediaRoute = /** @class */ (function () {
|
|
|
28097
28097
|
uploadTikTokMusic: { url: '/media/tiktok/music', method: HTTP_METHODS.POST },
|
|
28098
28098
|
getPresignedUrl: { url: '/media/presigned-url', method: HTTP_METHODS.POST },
|
|
28099
28099
|
confirmS3Upload: { url: '/media/s3-confirm', method: HTTP_METHODS.POST },
|
|
28100
|
+
processVideo: { url: '/media/{media_id}/process', method: HTTP_METHODS.POST },
|
|
28100
28101
|
};
|
|
28101
28102
|
return MediaRoute;
|
|
28102
28103
|
}());
|
|
@@ -28329,14 +28330,19 @@ var Media = /** @class */ (function () {
|
|
|
28329
28330
|
};
|
|
28330
28331
|
/**
|
|
28331
28332
|
* Generate an S3 Presigned URL for direct upload.
|
|
28332
|
-
* Use this for large files (up to 2GB) to bypass the Laravel server.
|
|
28333
28333
|
*
|
|
28334
28334
|
* @param filename The original name of the file.
|
|
28335
28335
|
* @param extension The file extension (e.g., 'mp4').
|
|
28336
|
-
* @
|
|
28336
|
+
* @param is_public Set to true if the file should be publicly accessible via URL.
|
|
28337
28337
|
*/
|
|
28338
|
-
Media.getPresignedUrl = function (filename, extension
|
|
28339
|
-
|
|
28338
|
+
Media.getPresignedUrl = function (filename, extension, is_public // Added parameter
|
|
28339
|
+
) {
|
|
28340
|
+
if (is_public === void 0) { is_public = false; }
|
|
28341
|
+
return Requests.processRoute(MediaRoute.routes.getPresignedUrl, {
|
|
28342
|
+
filename: filename,
|
|
28343
|
+
extension: extension,
|
|
28344
|
+
is_public: is_public // Pass to backend
|
|
28345
|
+
});
|
|
28340
28346
|
};
|
|
28341
28347
|
/**
|
|
28342
28348
|
* Confirm a successful S3 upload and create the database record.
|
|
@@ -28348,6 +28354,17 @@ var Media = /** @class */ (function () {
|
|
|
28348
28354
|
Media.confirmS3Upload = function (data) {
|
|
28349
28355
|
return Requests.processRoute(MediaRoute.routes.confirmS3Upload, data);
|
|
28350
28356
|
};
|
|
28357
|
+
/**
|
|
28358
|
+
* Submit a video for processing (Trim, Crop, Text, etc.)
|
|
28359
|
+
* This triggers a background job on the server.
|
|
28360
|
+
*
|
|
28361
|
+
* @param media_id The UUID of the source video.
|
|
28362
|
+
* @param data The edit manifest containing the array of transformations.
|
|
28363
|
+
* @returns Promise with the pending_media_id.
|
|
28364
|
+
*/
|
|
28365
|
+
Media.process = function (media_id, data) {
|
|
28366
|
+
return Requests.processRoute(MediaRoute.routes.processVideo, data, { media_id: media_id });
|
|
28367
|
+
};
|
|
28351
28368
|
return Media;
|
|
28352
28369
|
}());
|
|
28353
28370
|
|