glitch-javascript-sdk 3.0.0 → 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/index.d.ts CHANGED
@@ -6322,13 +6322,12 @@ declare class Media {
6322
6322
  static uploadTikTokMusic<T>(file: File, scheduler_id: string): AxiosPromise<Response<T>>;
6323
6323
  /**
6324
6324
  * Generate an S3 Presigned URL for direct upload.
6325
- * Use this for large files (up to 2GB) to bypass the Laravel server.
6326
6325
  *
6327
6326
  * @param filename The original name of the file.
6328
6327
  * @param extension The file extension (e.g., 'mp4').
6329
- * @returns AxiosPromise containing upload_url and file_path.
6328
+ * @param is_public Set to true if the file should be publicly accessible via URL.
6330
6329
  */
6331
- static getPresignedUrl<T = PresignedUrlResponse>(filename: string, extension: string): AxiosPromise<Response<T>>;
6330
+ static getPresignedUrl<T = PresignedUrlResponse>(filename: string, extension: string, is_public?: boolean): AxiosPromise<Response<T>>;
6332
6331
  /**
6333
6332
  * Confirm a successful S3 upload and create the database record.
6334
6333
  * Call this after the direct S3 upload is complete.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Media.ts CHANGED
@@ -396,14 +396,21 @@ class Media {
396
396
 
397
397
  /**
398
398
  * Generate an S3 Presigned URL for direct upload.
399
- * Use this for large files (up to 2GB) to bypass the Laravel server.
400
399
  *
401
400
  * @param filename The original name of the file.
402
401
  * @param extension The file extension (e.g., 'mp4').
403
- * @returns AxiosPromise containing upload_url and file_path.
402
+ * @param is_public Set to true if the file should be publicly accessible via URL.
404
403
  */
405
- public static getPresignedUrl<T = PresignedUrlResponse>(filename: string, extension: string): AxiosPromise<Response<T>> {
406
- return Requests.processRoute(MediaRoute.routes.getPresignedUrl, { filename, extension });
404
+ public static getPresignedUrl<T = PresignedUrlResponse>(
405
+ filename: string,
406
+ extension: string,
407
+ is_public: boolean = false // Added parameter
408
+ ): AxiosPromise<Response<T>> {
409
+ return Requests.processRoute(MediaRoute.routes.getPresignedUrl, {
410
+ filename,
411
+ extension,
412
+ is_public // Pass to backend
413
+ });
407
414
  }
408
415
 
409
416
  /**