@xuda.io/ai_module 1.1.4525 → 1.1.4526

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.
Files changed (2) hide show
  1. package/index.mjs +3 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6999,7 +6999,7 @@ const get_chat_picture_cache = async function (uid, docType, name) {
6999
6999
  return null;
7000
7000
  };
7001
7001
 
7002
- const save_attachment_to_file = async function (attachment) {
7002
+ const save_drive_file_to_disk = async function (drive_file) {
7003
7003
  async function hasTransparentBackground(filePath) {
7004
7004
  const image = sharp(filePath);
7005
7005
  const metadata = await image.metadata();
@@ -7049,12 +7049,12 @@ const save_attachment_to_file = async function (attachment) {
7049
7049
  return { is_transparent, image_blob: new Blob([buffer], { type: 'image/png' }) };
7050
7050
  }
7051
7051
  // try {
7052
- if (!url) {
7052
+ if (!drive_file.file_url) {
7053
7053
  throw new Error('No URL provided in request');
7054
7054
  }
7055
7055
 
7056
7056
  // 3. Download the image to a Buffer
7057
- const res = await fetch(attachment.file_url);
7057
+ const res = await fetch(drive_file.file_url);
7058
7058
  if (!res.ok) {
7059
7059
  throw new Error(`Failed to fetch image URL: ${res.status} ${res.statusText}`);
7060
7060
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4525",
3
+ "version": "1.1.4526",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",