@hautechai/sdk 2.21.8 → 2.21.10

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.mjs CHANGED
@@ -10487,7 +10487,10 @@ var useVideosApi = () => {
10487
10487
  if (typeof file === "string") {
10488
10488
  if (isBrowser) throw new Error("Cannot use file path in browser");
10489
10489
  const fs = __require("fs");
10490
- formData.append("file", fs.createReadStream(file));
10490
+ const path = __require("path");
10491
+ formData.append("file", fs.createReadStream(file), {
10492
+ filename: path.basename(file)
10493
+ });
10491
10494
  } else if (isBrowser && file instanceof Blob) {
10492
10495
  formData.append("file", file);
10493
10496
  } else if (!(file instanceof Blob) && typeof file === "object" && "stream" in file) {
@@ -10915,7 +10918,10 @@ var useImagesApi = () => {
10915
10918
  if (typeof file === "string") {
10916
10919
  if (isBrowser) throw new Error("Cannot use file path in browser");
10917
10920
  const fs = __require("fs");
10918
- formData.append("file", fs.createReadStream(file));
10921
+ const path = __require("path");
10922
+ formData.append("file", fs.createReadStream(file), {
10923
+ filename: path.basename(file)
10924
+ });
10919
10925
  } else if (isBrowser && file instanceof Blob) {
10920
10926
  formData.append("file", file);
10921
10927
  } else if (typeof file === "object" && "filename" in file) {