@blinkdotnew/sdk 0.17.0 → 0.17.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.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -3
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -625,6 +625,7 @@ declare class HttpClient {
|
|
|
625
625
|
uploadFile(path: string, file: File | Blob | Buffer, filePath: string, options?: {
|
|
626
626
|
upsert?: boolean;
|
|
627
627
|
onProgress?: (percent: number) => void;
|
|
628
|
+
contentType?: string;
|
|
628
629
|
}): Promise<BlinkResponse<any>>;
|
|
629
630
|
/**
|
|
630
631
|
* Upload with progress tracking using XMLHttpRequest
|
package/dist/index.d.ts
CHANGED
|
@@ -625,6 +625,7 @@ declare class HttpClient {
|
|
|
625
625
|
uploadFile(path: string, file: File | Blob | Buffer, filePath: string, options?: {
|
|
626
626
|
upsert?: boolean;
|
|
627
627
|
onProgress?: (percent: number) => void;
|
|
628
|
+
contentType?: string;
|
|
628
629
|
}): Promise<BlinkResponse<any>>;
|
|
629
630
|
/**
|
|
630
631
|
* Upload with progress tracking using XMLHttpRequest
|
package/dist/index.js
CHANGED
|
@@ -403,9 +403,10 @@ var HttpClient = class {
|
|
|
403
403
|
if (file instanceof File) {
|
|
404
404
|
formData.append("file", file);
|
|
405
405
|
} else if (file instanceof Blob) {
|
|
406
|
-
|
|
406
|
+
const blobWithType = options.contentType ? new Blob([file], { type: options.contentType }) : file;
|
|
407
|
+
formData.append("file", blobWithType);
|
|
407
408
|
} else if (typeof Buffer !== "undefined" && file instanceof Buffer) {
|
|
408
|
-
const blob = new Blob([file]);
|
|
409
|
+
const blob = new Blob([file], { type: options.contentType || "application/octet-stream" });
|
|
409
410
|
formData.append("file", blob);
|
|
410
411
|
} else {
|
|
411
412
|
throw new BlinkValidationError("Unsupported file type");
|
|
@@ -1866,7 +1867,9 @@ var BlinkStorageImpl = class {
|
|
|
1866
1867
|
// Use corrected path with proper extension
|
|
1867
1868
|
{
|
|
1868
1869
|
upsert: options.upsert,
|
|
1869
|
-
onProgress: options.onProgress
|
|
1870
|
+
onProgress: options.onProgress,
|
|
1871
|
+
contentType: detectedContentType
|
|
1872
|
+
// Pass detected content type
|
|
1870
1873
|
}
|
|
1871
1874
|
);
|
|
1872
1875
|
if (response.data?.data?.publicUrl) {
|
package/dist/index.mjs
CHANGED
|
@@ -401,9 +401,10 @@ var HttpClient = class {
|
|
|
401
401
|
if (file instanceof File) {
|
|
402
402
|
formData.append("file", file);
|
|
403
403
|
} else if (file instanceof Blob) {
|
|
404
|
-
|
|
404
|
+
const blobWithType = options.contentType ? new Blob([file], { type: options.contentType }) : file;
|
|
405
|
+
formData.append("file", blobWithType);
|
|
405
406
|
} else if (typeof Buffer !== "undefined" && file instanceof Buffer) {
|
|
406
|
-
const blob = new Blob([file]);
|
|
407
|
+
const blob = new Blob([file], { type: options.contentType || "application/octet-stream" });
|
|
407
408
|
formData.append("file", blob);
|
|
408
409
|
} else {
|
|
409
410
|
throw new BlinkValidationError("Unsupported file type");
|
|
@@ -1864,7 +1865,9 @@ var BlinkStorageImpl = class {
|
|
|
1864
1865
|
// Use corrected path with proper extension
|
|
1865
1866
|
{
|
|
1866
1867
|
upsert: options.upsert,
|
|
1867
|
-
onProgress: options.onProgress
|
|
1868
|
+
onProgress: options.onProgress,
|
|
1869
|
+
contentType: detectedContentType
|
|
1870
|
+
// Pass detected content type
|
|
1868
1871
|
}
|
|
1869
1872
|
);
|
|
1870
1873
|
if (response.data?.data?.publicUrl) {
|
package/package.json
CHANGED