@xuda.io/ai_module 1.1.4535 → 1.1.4537

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 +4 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4455,8 +4455,8 @@ const chat_email = async function (req, job_id, headers) {
4455
4455
  if (!sent_email_result.success) {
4456
4456
  throw new Error('error sending email');
4457
4457
  }
4458
- for (const attachment of email_attachments) {
4459
- fs.rm(attachment.path, { force: true });
4458
+ for await (const attachment of email_attachments) {
4459
+ await fs.rm(attachment.path, { force: true });
4460
4460
  }
4461
4461
  }
4462
4462
 
@@ -7021,6 +7021,7 @@ const save_drive_file_to_disk = async function (drive_file) {
7021
7021
  const tempDir = os.tmpdir();
7022
7022
 
7023
7023
  const tempOutputPath = path.join(tempDir, drive_file.filename + '_' + Date.now());
7024
+ const validation_ret = drive_module.file_upload_validator(drive_file.filename);
7024
7025
 
7025
7026
  // 5. Write the downloaded image to disk
7026
7027
  fs.writeFileSync(tempOutputPath, imageBuffer);
@@ -7029,6 +7030,6 @@ const save_drive_file_to_disk = async function (drive_file) {
7029
7030
  return {
7030
7031
  filename: drive_file.filename,
7031
7032
  path: tempOutputPath,
7032
- contentType: 'application/pdf',
7033
+ contentType: validation_ret.mime,
7033
7034
  };
7034
7035
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4535",
3
+ "version": "1.1.4537",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",