@peopl-health/nexus 1.7.9 → 1.7.12

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.
@@ -90,7 +90,10 @@ const getInfoAssistantController = async (req, res) => {
90
90
 
91
91
  const listAssistantController = async (req, res) => {
92
92
  try {
93
- const assistants = await getRecordByFilter(Config_ID, 'assistants', `status="${process.env.NODE_ENV}"`);
93
+ const nodeEnv = process.env.NODE_ENV;
94
+ const airtableStatus = nodeEnv === 'production' ? 'prod' :
95
+ nodeEnv === 'development' ? 'dev' : nodeEnv;
96
+ const assistants = await getRecordByFilter(Config_ID, 'assistants', `status="${airtableStatus}"`);
94
97
  return res.status(200).send({ message: 'List assistants' , assistants});
95
98
  } catch (error) {
96
99
  console.log(error);
@@ -637,7 +637,7 @@ class NexusMessaging {
637
637
  if (botResponse) {
638
638
  await this.sendMessage({
639
639
  code: chatId,
640
- message: botResponse,
640
+ body: botResponse,
641
641
  processed: true
642
642
  });
643
643
  }
@@ -1,7 +1,6 @@
1
- const { Historial_Clinico_ID, Monitoreo_ID } = require('../config/airtableConfig.js');
1
+ const { Historial_Clinico_ID } = require('../config/airtableConfig.js');
2
2
  const AWS = require('../config/awsConfig.js');
3
3
  const { combineImagesToPDF, cleanupFiles } = require('../helpers/filesHelper.js');
4
- const { addRecord } = require('../services/airtableService.js');
5
4
  const runtimeConfig = require('../config/runtimeConfig');
6
5
  const llmConfig = require('../config/llmConfig');
7
6
  const { BaseAssistant } = require('../assistants/BaseAssistant');
@@ -389,15 +388,6 @@ const replyAssistant = async function (code, message_ = null, thread_ = null, ru
389
388
  const bucket = runtimeConfig.get('AWS_S3_BUCKET_NAME');
390
389
  if (bucket && pdfBuffer) {
391
390
  await AWS.uploadBufferToS3(pdfBuffer, bucket, key, 'application/pdf');
392
- const url = await AWS.generatePresignedUrl(bucket, key);
393
- const curRow = await getCurRow(Monitoreo_ID, code);
394
- const customer_id = curRow?.[0]?.recordID || curRow?.[0]?.record_id || curRow?.[0]?.id || null;
395
- console.log('customer_id:', customer_id);
396
- try {
397
- await addRecord(Monitoreo_ID, 'estudios', [{ fields: { estudios: urls, combined_estudios: [{ url }], patient_id: customer_id ? [customer_id] : [] } }]);
398
- } catch (e) {
399
- console.warn('Failed to add Airtable estudios record:', e?.message || e);
400
- }
401
391
  }
402
392
  if (processedFiles && processedFiles.length) {
403
393
  await cleanupFiles(processedFiles);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "1.7.9",
3
+ "version": "1.7.12",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",