@peopl-health/nexus 3.8.17 → 3.8.18

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 (128) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/LICENSE +0 -0
  3. package/README.md +0 -0
  4. package/examples/.env.example +0 -0
  5. package/examples/assistants/BaseAssistant.js +0 -0
  6. package/examples/assistants/DoctorScheduleAssistant.js +0 -0
  7. package/examples/assistants/ExampleAssistant.js +0 -0
  8. package/examples/assistants/index.js +0 -0
  9. package/examples/basic-usage.js +0 -0
  10. package/examples/consumer-server.js +0 -0
  11. package/examples/test-batching.js +0 -0
  12. package/lib/adapters/BaileysProvider.js +0 -0
  13. package/lib/adapters/MessageProvider.js +0 -0
  14. package/lib/adapters/TwilioProvider.js +0 -0
  15. package/lib/adapters/index.js +0 -0
  16. package/lib/adapters/registry.js +0 -0
  17. package/lib/assistants/BaseAssistant.js +0 -0
  18. package/lib/config/airtableConfig.js +0 -0
  19. package/lib/config/awsConfig.js +0 -0
  20. package/lib/config/interactionConfig.js +0 -0
  21. package/lib/config/lifecycle.js +0 -0
  22. package/lib/config/llmConfig.js +0 -0
  23. package/lib/config/metaConfig.js +0 -0
  24. package/lib/config/mongoAuthConfig.js +0 -0
  25. package/lib/config/mongoConfig.js +0 -0
  26. package/lib/config/runtimeConfig.js +0 -0
  27. package/lib/controllers/assistantController.js +0 -0
  28. package/lib/controllers/bugReportController.js +0 -0
  29. package/lib/controllers/caseDocumentationController.js +0 -0
  30. package/lib/controllers/conversationController.js +0 -0
  31. package/lib/controllers/dashboardController.js +9 -1
  32. package/lib/controllers/flowDataExchangeController.js +0 -0
  33. package/lib/controllers/interactionController.js +0 -0
  34. package/lib/controllers/mediaController.js +0 -0
  35. package/lib/controllers/messageController.js +0 -0
  36. package/lib/controllers/messageStatusController.js +0 -0
  37. package/lib/controllers/patientController.js +0 -0
  38. package/lib/controllers/qualityMessageController.js +0 -0
  39. package/lib/controllers/templateController.js +0 -0
  40. package/lib/controllers/templateFlowController.js +0 -0
  41. package/lib/controllers/uploadController.js +0 -0
  42. package/lib/core/AssistantProcessor.js +0 -0
  43. package/lib/core/BatchingManager.js +0 -0
  44. package/lib/core/MessageParser.js +0 -0
  45. package/lib/core/NexusMessaging.js +0 -0
  46. package/lib/eval/EvalProvider.js +0 -0
  47. package/lib/helpers/assistantHelper.js +0 -0
  48. package/lib/helpers/baileysHelper.js +0 -0
  49. package/lib/helpers/dashboardHelper.js +0 -0
  50. package/lib/helpers/filesHelper.js +0 -0
  51. package/lib/helpers/flowDataExchangeHelper.js +0 -0
  52. package/lib/helpers/flowEncryptionHelper.js +0 -0
  53. package/lib/helpers/llmsHelper.js +0 -0
  54. package/lib/helpers/mediaHelper.js +0 -0
  55. package/lib/helpers/messageHelper.js +0 -0
  56. package/lib/helpers/messageStatusHelper.js +0 -0
  57. package/lib/helpers/metaFlowHelper.js +0 -0
  58. package/lib/helpers/metaSignatureHelper.js +0 -0
  59. package/lib/helpers/mongoHelper.js +0 -0
  60. package/lib/helpers/phoneFilterHelper.js +0 -0
  61. package/lib/helpers/processHelper.js +0 -0
  62. package/lib/helpers/qrHelper.js +0 -0
  63. package/lib/helpers/templateApprovalPoller.js +0 -0
  64. package/lib/helpers/templateFlowControllerHelper.js +0 -0
  65. package/lib/helpers/templateRecoveryHelper.js +0 -0
  66. package/lib/helpers/threadHelper.js +0 -0
  67. package/lib/helpers/threadRecoveryHelper.js +0 -0
  68. package/lib/helpers/trendHelper.js +0 -0
  69. package/lib/helpers/twilioHelper.js +0 -0
  70. package/lib/helpers/twilioMediaHelper.js +0 -0
  71. package/lib/helpers/whatsappHelper.js +0 -0
  72. package/lib/index.d.ts +0 -0
  73. package/lib/index.js +0 -0
  74. package/lib/memory/DefaultMemoryManager.js +0 -0
  75. package/lib/memory/MemoryManager.js +0 -0
  76. package/lib/middleware/requestId.js +0 -0
  77. package/lib/models/agendaMessageModel.js +0 -0
  78. package/lib/models/bugModel.js +0 -0
  79. package/lib/models/flowRoutingModel.js +0 -0
  80. package/lib/models/interactionModel.js +0 -0
  81. package/lib/models/messageModel.js +0 -0
  82. package/lib/models/predictionMetricsModel.js +0 -0
  83. package/lib/models/qualityMessageModel.js +0 -0
  84. package/lib/models/templateModel.js +0 -0
  85. package/lib/models/threadModel.js +0 -0
  86. package/lib/observability/index.js +0 -0
  87. package/lib/observability/telemetry.js +0 -0
  88. package/lib/providers/OpenAIResponsesProvider.js +0 -0
  89. package/lib/providers/OpenAIResponsesProviderTools.js +0 -0
  90. package/lib/providers/createLLMProvider.js +0 -0
  91. package/lib/queue/LocalQueueAdapter.js +0 -0
  92. package/lib/queue/QueueAdapter.js +0 -0
  93. package/lib/queue/RedisQueueAdapter.js +0 -0
  94. package/lib/queue/index.js +0 -0
  95. package/lib/routes/index.js +0 -0
  96. package/lib/services/airtableService.js +0 -0
  97. package/lib/services/assistantResolver.js +0 -0
  98. package/lib/services/assistantService.js +0 -0
  99. package/lib/services/conversationService.js +0 -0
  100. package/lib/services/dashboardService.js +3 -0
  101. package/lib/services/flowDataExchangeService.js +0 -0
  102. package/lib/services/metaFlowService.js +0 -0
  103. package/lib/services/metaService.js +0 -0
  104. package/lib/services/preprocessingService.js +0 -0
  105. package/lib/services/promptComposerService.js +0 -0
  106. package/lib/services/templateFlowService.js +0 -0
  107. package/lib/services/templateService.js +0 -0
  108. package/lib/services/toolRegistryService.js +0 -0
  109. package/lib/services/twilioService.js +0 -0
  110. package/lib/storage/MongoStorage.js +0 -0
  111. package/lib/storage/NoopStorage.js +0 -0
  112. package/lib/storage/registry.js +0 -0
  113. package/lib/templates/predefinedTemplates.js +0 -0
  114. package/lib/templates/templateStructure.js +0 -0
  115. package/lib/utils/MapCache.js +0 -0
  116. package/lib/utils/base64Utils.js +0 -0
  117. package/lib/utils/dateUtils.js +0 -0
  118. package/lib/utils/errorUtils.js +0 -0
  119. package/lib/utils/eventUtils.js +0 -0
  120. package/lib/utils/formatUtils.js +0 -0
  121. package/lib/utils/jsonUtils.js +0 -0
  122. package/lib/utils/logger.js +0 -0
  123. package/lib/utils/mediaValidator.js +0 -0
  124. package/lib/utils/retryUtils.js +0 -0
  125. package/lib/utils/sanitizerUtils.js +0 -0
  126. package/lib/utils/scheduleUtils.js +0 -0
  127. package/lib/utils/tracingDecorator.js +0 -0
  128. package/package.json +1 -1
package/CHANGELOG.md CHANGED
File without changes
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,9 +1,12 @@
1
1
  const { logger } = require('../utils/logger');
2
+ const { createEvent, safeEmit } = require('../utils/eventUtils');
2
3
 
3
4
  const { validateAndAdaptBox } = require('../helpers/dashboardHelper');
4
5
 
5
6
  const { getAllBoxes, getStatsById, updateBox, getDailyTrend } = require('../services/dashboardService');
6
7
 
8
+ const { getEventBus: getStatusEventBus } = require('../core/NexusMessaging');
9
+
7
10
  const getDashboardController = async (req, res) => {
8
11
  try {
9
12
  const force = req.query.force === 'true';
@@ -42,7 +45,12 @@ const updateDashboardControllerById = async (req, res) => {
42
45
 
43
46
  res.json({ success: true, message: 'Box updated', id: box.id });
44
47
 
45
- await updateBox(box.id, box);
48
+ const updatedBox = await updateBox(box.id, box);
49
+
50
+ safeEmit(getStatusEventBus(), 'dashboard:updated', createEvent('dashboard:updated', {
51
+ ...updatedBox
52
+ }));
53
+
46
54
  } catch (error) {
47
55
  logger.error('[DashboardController] Error updating dashboard:', { error: error.message, id: req.params?.id });
48
56
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -63,6 +63,9 @@ async function updateBox(id, data) {
63
63
  logger.info('[DashboardService] Detail cache refreshed after box update', { id });
64
64
  }
65
65
  }
66
+
67
+ const { config: _config, ...rest } = box;
68
+ return { id, ...rest };
66
69
  }
67
70
 
68
71
  async function getDailyTrend(days) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "3.8.17",
3
+ "version": "3.8.18",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",