@meltwater/conversations-api-services 1.1.21 → 1.1.22

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.
@@ -308,7 +308,10 @@ async function reply(token, text, attachment, inReplyToId, removeInReplyToId, lo
308
308
  }
309
309
  };
310
310
  if (removeInReplyToId.length) {
311
- payload.reply.exclude_reply_user_ids = removeInReplyToId.map(_externalIdHelpers.removePrefix);
311
+ const filteredIds = removeInReplyToId.map(_externalIdHelpers.removePrefix).filter(id => id && id.trim().length > 0);
312
+ if (filteredIds.length > 0) {
313
+ payload.reply.exclude_reply_user_ids = filteredIds;
314
+ }
312
315
  }
313
316
  let query = 'https://api.twitter.com/2/tweets';
314
317
  return publishTweet(token, payload, query, false, logger);
@@ -285,7 +285,10 @@ export async function reply(token, text, attachment, inReplyToId, removeInReplyT
285
285
  }
286
286
  };
287
287
  if (removeInReplyToId.length) {
288
- payload.reply.exclude_reply_user_ids = removeInReplyToId.map(removePrefix);
288
+ const filteredIds = removeInReplyToId.map(removePrefix).filter(id => id && id.trim().length > 0);
289
+ if (filteredIds.length > 0) {
290
+ payload.reply.exclude_reply_user_ids = filteredIds;
291
+ }
289
292
  }
290
293
  let query = 'https://api.twitter.com/2/tweets';
291
294
  return publishTweet(token, payload, query, false, logger);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meltwater/conversations-api-services",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "Repository to contain all conversations api services shared across our services",
5
5
  "main": "dist/cjs/data-access/index.js",
6
6
  "module": "dist/esm/data-access/index.js",
@@ -335,9 +335,12 @@ export async function reply(token, text, attachment, inReplyToId, removeInReplyT
335
335
  },
336
336
  };
337
337
  if (removeInReplyToId.length){
338
- payload.reply.exclude_reply_user_ids = removeInReplyToId.map(
339
- removePrefix
340
- );
338
+ const filteredIds = removeInReplyToId
339
+ .map(removePrefix)
340
+ .filter(id => id && id.trim().length > 0);
341
+ if (filteredIds.length > 0) {
342
+ payload.reply.exclude_reply_user_ids = filteredIds;
343
+ }
341
344
  }
342
345
 
343
346
  let query = 'https://api.twitter.com/2/tweets';