@peopl-health/nexus 3.13.12 → 3.13.13

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.
@@ -1,7 +1,5 @@
1
1
  const moment = require('moment-timezone');
2
2
 
3
- const runtimeConfig = require('../config/runtimeConfig');
4
-
5
3
  const { logger } = require('../utils/logger');
6
4
 
7
5
  const { Message } = require('../models/messageModel.js');
@@ -95,7 +93,6 @@ const sendMessageController = async (req, res) => {
95
93
  timeZone: timeZone || null,
96
94
  sendTime: sendTime ? moment.tz(sendTime, timeZone) + 2500 : new Date(),
97
95
  code: ensureWhatsAppFormat(code),
98
- author: runtimeConfig.get('USER_DB_MONGO'),
99
96
  extraDelay: 0,
100
97
  frontendId,
101
98
  triggeredBy
@@ -125,12 +122,11 @@ const sendBulkMessageController = async (req, res) => {
125
122
  variables = null,
126
123
  triggeredBy = null
127
124
  } = req.body || {};
128
- const author = runtimeConfig.get('USER_DB_MONGO');
129
125
  const sendMoment = sendTime ? moment.tz(sendTime, timeZone) + 20000 : new Date();
130
126
 
131
127
  try {
132
128
  const isFlowTemplate = contentSid && await FlowRouting.findOne({ contentSid }).lean();
133
-
129
+
134
130
  let extraDelay = 0;
135
131
  const payloads = [];
136
132
  for (const recipient of codes) {
@@ -140,7 +136,6 @@ const sendBulkMessageController = async (req, res) => {
140
136
  timeZone: timeZone || null,
141
137
  sendTime: new Date(sendMoment + extraDelay),
142
138
  code: ensureWhatsAppFormat(recipient),
143
- author,
144
139
  extraDelay: extraDelay += Math.floor(Math.random() * 5001) + 5000,
145
140
  triggeredBy
146
141
  });
@@ -167,7 +162,6 @@ const sendBulkMessageAirtableController = async (req, res) => {
167
162
  variables = null,
168
163
  triggeredBy = null
169
164
  } = req.body || {};
170
- const author = runtimeConfig.get('USER_DB_MONGO');
171
165
  const sendMoment = sendTime ? moment.tz(sendTime, timeZone) + 20000 : new Date();
172
166
 
173
167
  const envVariables = [...message.matchAll(/\[(.*?)\]/g)].map(m => m[1]);
@@ -199,7 +193,7 @@ const sendBulkMessageAirtableController = async (req, res) => {
199
193
  : variables,
200
194
  timeZone: timeZone || null,
201
195
  sendTime: new Date(sendMoment + extraDelay),
202
- code, author,
196
+ code,
203
197
  triggeredBy
204
198
  });
205
199
  extraDelay += Math.floor(Math.random() * 5001) + 5000;
@@ -9,7 +9,6 @@ const scheduledMessageSchema = new mongoose.Schema({
9
9
  contentSid: String,
10
10
  contentType: { type: String, default: null },
11
11
  code: String,
12
- author: String,
13
12
  variables: Object,
14
13
  extraDelay: Number,
15
14
  timeZone: { type: String, default: 'Etc/GMT' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "3.13.12",
3
+ "version": "3.13.13",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",