alicezetion 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -1
  2. package/.cache/replit/nix/env.json +1 -1
  3. package/index.js +10 -2
  4. package/leiamnash/addExternalModule.js +6 -10
  5. package/leiamnash/addUserToGroup.js +16 -52
  6. package/leiamnash/changeAdminStatus.js +37 -69
  7. package/leiamnash/changeArchivedStatus.js +12 -26
  8. package/leiamnash/changeBio.js +6 -19
  9. package/leiamnash/changeBlockedStatus.js +3 -14
  10. package/leiamnash/changeGroupImage.js +16 -40
  11. package/leiamnash/changeNickname.js +11 -27
  12. package/leiamnash/changeThreadColor.js +10 -20
  13. package/leiamnash/changeThreadEmoji.js +10 -24
  14. package/leiamnash/chat.js +279 -414
  15. package/leiamnash/createNewGroup.js +12 -28
  16. package/leiamnash/createPoll.js +13 -25
  17. package/leiamnash/deleteMessage.js +12 -24
  18. package/leiamnash/deleteThread.js +11 -25
  19. package/leiamnash/forwardAttachment.js +13 -26
  20. package/leiamnash/forwardMessage.js +0 -0
  21. package/leiamnash/getCurrentUserID.js +1 -1
  22. package/leiamnash/getEmojiUrl.js +2 -4
  23. package/leiamnash/getFriendsList.js +10 -21
  24. package/leiamnash/getThreadHistory.js +58 -166
  25. package/leiamnash/getThreadHistoryDeprecated.js +20 -42
  26. package/leiamnash/getThreadInfo.js +25 -60
  27. package/leiamnash/getThreadInfoDeprecated.js +18 -42
  28. package/leiamnash/getThreadList.js +41 -66
  29. package/leiamnash/getThreadListDeprecated.js +14 -43
  30. package/leiamnash/getThreadPictures.js +17 -37
  31. package/leiamnash/getUserID.js +9 -14
  32. package/leiamnash/getUserInfo.js +12 -18
  33. package/leiamnash/handleFriendRequest.js +37 -52
  34. package/leiamnash/handleMessageRequest.js +14 -32
  35. package/leiamnash/httpGet.js +12 -17
  36. package/leiamnash/httpPost.js +12 -17
  37. package/leiamnash/listen.js +553 -0
  38. package/leiamnash/listenMqtt-Test.js +687 -0
  39. package/leiamnash/listenMqtt.js +1 -2
  40. package/leiamnash/logout.js +13 -20
  41. package/leiamnash/markAsDelivered.js +11 -22
  42. package/leiamnash/markAsRead.js +11 -21
  43. package/leiamnash/markAsReadAll.js +10 -20
  44. package/leiamnash/markAsSeen.js +7 -18
  45. package/leiamnash/muteThread.js +11 -18
  46. package/leiamnash/removeUserFromGroup.js +14 -48
  47. package/leiamnash/resolvePhotoUrl.js +8 -17
  48. package/leiamnash/searchForThread.js +10 -21
  49. package/leiamnash/sendTypingIndicator.js +14 -47
  50. package/leiamnash/setMessageReaction.js +12 -26
  51. package/leiamnash/setPostReaction.js +13 -26
  52. package/leiamnash/setTitle.js +13 -29
  53. package/leiamnash/threadColors.js +28 -44
  54. package/leiamnash/unfriend.js +9 -19
  55. package/leiamnash/unsendMessage.js +9 -19
  56. package/package.json +1 -1
  57. package/replit.nix +1 -3
  58. package/utils.js +0 -0
@@ -8,7 +8,6 @@ A L I C E » this project recode by one
8
8
  */
9
9
 
10
10
  "use strict";
11
-
12
11
  var utils = require("../utils");
13
12
  var log = require("npmlog");
14
13
  var mqtt = require('mqtt');
@@ -683,4 +682,4 @@ module.exports = function(defaultFuncs, api, ctx) {
683
682
  ctx.firstListen = false;
684
683
  return msgEmitter;
685
684
  };
686
- };
685
+ };
@@ -3,10 +3,10 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function logout(callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
@@ -14,9 +14,8 @@ module.exports = function(defaultFuncs, api, ctx) {
14
14
 
15
15
  if (!callback) {
16
16
  callback = function (err, friendList) {
17
- if (err) {
18
- return rejectFunc(err);
19
- }
17
+ if (err) return rejectFunc(err);
18
+
20
19
  resolveFunc(friendList);
21
20
  };
22
21
  }
@@ -26,18 +25,14 @@ module.exports = function(defaultFuncs, api, ctx) {
26
25
  };
27
26
 
28
27
  defaultFuncs
29
- .post(
30
- "https://www.facebook.com/bluebar/modern_settings_menu/?help_type=364455653583099&show_contextual_help=1",
31
- ctx.jar,
32
- form
33
- )
28
+ .post("https://www.facebook.com/bluebar/modern_settings_menu/?help_type=364455653583099&show_contextual_help=1", ctx.jar, form)
34
29
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
35
- .then(function(resData) {
36
- var elem = resData.jsmods.instances[0][2][0].filter(function(v) {
30
+ .then(function (resData) {
31
+ var elem = resData.jsmods.instances[0][2][0].filter(function (v) {
37
32
  return v.value === "logout";
38
33
  })[0];
39
34
 
40
- var html = resData.jsmods.markup.filter(function(v) {
35
+ var html = resData.jsmods.markup.filter(function (v) {
41
36
  return v[0] === elem.markup.__m;
42
37
  })[0][1].__html;
43
38
 
@@ -51,21 +46,19 @@ module.exports = function(defaultFuncs, api, ctx) {
51
46
  .post("https://www.facebook.com/logout.php", ctx.jar, form)
52
47
  .then(utils.saveCookies(ctx.jar));
53
48
  })
54
- .then(function(res) {
55
- if (!res.headers) {
56
- throw { error: "An error occurred when logging out." };
57
- }
49
+ .then(function (res) {
50
+ if (!res.headers) throw { error: "An error occurred when logging out." };
58
51
 
59
52
  return defaultFuncs
60
53
  .get(res.headers.location, ctx.jar)
61
54
  .then(utils.saveCookies(ctx.jar));
62
55
  })
63
- .then(function() {
56
+ .then(function () {
64
57
  ctx.loggedIn = false;
65
58
  log.info("logout", "Logged out successfully.");
66
59
  callback();
67
60
  })
68
- .catch(function(err) {
61
+ .catch(function (err) {
69
62
  log.error("logout", err);
70
63
  return callback(err);
71
64
  });
@@ -5,51 +5,40 @@ var log = require("npmlog");
5
5
 
6
6
  module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function markAsDelivered(threadID, messageID, callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
13
13
  });
14
14
 
15
15
  if (!callback) {
16
- callback = function (err, friendList) {
17
- if (err) {
18
- return rejectFunc(err);
19
- }
20
- resolveFunc(friendList);
16
+ callback = function (err, data) {
17
+ if (err) return rejectFunc(err);
18
+
19
+ resolveFunc(data);
21
20
  };
22
21
  }
23
22
 
24
- if (!threadID || !messageID) {
25
- return callback("Error: messageID or threadID is not defined");
26
- }
23
+ if (!threadID || !messageID) return callback("Error: messageID or threadID is not defined");
27
24
 
28
25
  var form = {};
29
-
30
26
  form["message_ids[0]"] = messageID;
31
27
  form["thread_ids[" + threadID + "][0]"] = messageID;
32
28
 
33
29
  defaultFuncs
34
- .post(
35
- "https://www.facebook.com/ajax/mercury/delivery_receipts.php",
36
- ctx.jar,
37
- form
38
- )
30
+ .post("https://www.facebook.com/ajax/mercury/delivery_receipts.php", ctx.jar, form)
39
31
  .then(utils.saveCookies(ctx.jar))
40
32
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
41
33
  .then(function (resData) {
42
- if (resData.error) {
43
- throw resData;
44
- }
34
+ if (resData.error) throw resData;
45
35
 
46
36
  return callback();
47
37
  })
48
38
  .catch(function (err) {
49
39
  log.error("markAsDelivered", err);
50
- if (utils.getType(err) == "Object" && err.error === "Not logged in.") {
51
- ctx.loggedIn = false;
52
- }
40
+ if (utils.getType(err) == "Object" && err.error === "Not logged in.") ctx.loggedIn = false;
41
+
53
42
  return callback(err);
54
43
  });
55
44
 
@@ -9,13 +9,9 @@ module.exports = function (defaultFuncs, api, ctx) {
9
9
  callback = read;
10
10
  read = true;
11
11
  }
12
- if (read == undefined) {
13
- read = true;
14
- }
12
+ if (read == undefined) read = true;
15
13
 
16
- if (!callback) {
17
- callback = () => { };
18
- }
14
+ if (!callback) callback = () => { };
19
15
 
20
16
  var form = {};
21
17
 
@@ -32,15 +28,12 @@ module.exports = function (defaultFuncs, api, ctx) {
32
28
  try {
33
29
  resData = await (
34
30
  defaultFuncs
35
- .post(
36
- "https://www.facebook.com/ajax/mercury/change_read_status.php",
37
- ctx.jar,
38
- form
39
- )
31
+ .post("https://www.facebook.com/ajax/mercury/change_read_status.php", ctx.jar, form)
40
32
  .then(utils.saveCookies(ctx.jar))
41
33
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
42
34
  );
43
- } catch (e) {
35
+ }
36
+ catch (e) {
44
37
  callback(e);
45
38
  return e;
46
39
  }
@@ -48,16 +41,15 @@ module.exports = function (defaultFuncs, api, ctx) {
48
41
  if (resData.error) {
49
42
  let err = resData.error;
50
43
  log.error("markAsRead", err);
51
- if (utils.getType(err) == "Object" && err.error === "Not logged in.") {
52
- ctx.loggedIn = false;
53
- }
44
+ if (utils.getType(err) == "Object" && err.error === "Not logged in.") ctx.loggedIn = false;
54
45
  callback(err);
55
46
  return err;
56
47
  }
57
48
 
58
49
  callback();
59
50
  return null;
60
- } else {
51
+ }
52
+ else {
61
53
  try {
62
54
  if (ctx.mqttClient) {
63
55
  let err = await new Promise(r => ctx.mqttClient.publish("/mark_thread", JSON.stringify({
@@ -66,12 +58,10 @@ module.exports = function (defaultFuncs, api, ctx) {
66
58
  state: read
67
59
  }), { qos: 1, retain: false }, r));
68
60
  if (err) throw err;
69
- } else {
70
- throw {
71
- error: "You can only use this function after you start listening."
72
- };
73
61
  }
74
- } catch (e) {
62
+ else throw { error: "You can only use this function after you start listening." };
63
+ }
64
+ catch (e) {
75
65
  callback(e);
76
66
  return e;
77
67
  }
@@ -3,21 +3,19 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function markAsReadAll(callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
13
13
  });
14
14
 
15
15
  if (!callback) {
16
- callback = function (err, friendList) {
17
- if (err) {
18
- return rejectFunc(err);
19
- }
20
- resolveFunc(friendList);
16
+ callback = function (err, data) {
17
+ if (err) return rejectFunc(err);
18
+ resolveFunc(data);
21
19
  };
22
20
  }
23
21
 
@@ -26,25 +24,17 @@ module.exports = function(defaultFuncs, api, ctx) {
26
24
  };
27
25
 
28
26
  defaultFuncs
29
- .post(
30
- "https://www.facebook.com/ajax/mercury/mark_folder_as_read.php",
31
- ctx.jar,
32
- form
33
- )
27
+ .post("https://www.facebook.com/ajax/mercury/mark_folder_as_read.php", ctx.jar, form)
34
28
  .then(utils.saveCookies(ctx.jar))
35
29
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
36
- .then(function(resData) {
37
- if (resData.error) {
38
- throw resData;
39
- }
40
-
30
+ .then(function (resData) {
31
+ if (resData.error) throw resData;
41
32
  return callback();
42
33
  })
43
- .catch(function(err) {
34
+ .catch(function (err) {
44
35
  log.error("markAsReadAll", err);
45
36
  return callback(err);
46
37
  });
47
-
48
38
  return returnPromise;
49
39
  };
50
40
  };
@@ -19,11 +19,10 @@ module.exports = function (defaultFuncs, api, ctx) {
19
19
  });
20
20
 
21
21
  if (!callback) {
22
- callback = function (err, friendList) {
23
- if (err) {
24
- return rejectFunc(err);
25
- }
26
- resolveFunc(friendList);
22
+ callback = function (err, data) {
23
+ if (err) return rejectFunc(err);
24
+
25
+ resolveFunc(data);
27
26
  };
28
27
  }
29
28
 
@@ -32,28 +31,18 @@ module.exports = function (defaultFuncs, api, ctx) {
32
31
  };
33
32
 
34
33
  defaultFuncs
35
- .post(
36
- "https://www.facebook.com/ajax/mercury/mark_seen.php",
37
- ctx.jar,
38
- form
39
- )
34
+ .post("https://www.facebook.com/ajax/mercury/mark_seen.php", ctx.jar, form)
40
35
  .then(utils.saveCookies(ctx.jar))
41
36
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
42
37
  .then(function (resData) {
43
- if (resData.error) {
44
- throw resData;
45
- }
46
-
38
+ if (resData.error) throw resData;
47
39
  return callback();
48
40
  })
49
41
  .catch(function (err) {
50
42
  log.error("markAsSeen", err);
51
- if (utils.getType(err) == "Object" && err.error === "Not logged in.") {
52
- ctx.loggedIn = false;
53
- }
43
+ if (utils.getType(err) == "Object" && err.error === "Not logged in.") ctx.loggedIn = false;
54
44
  return callback(err);
55
45
  });
56
-
57
46
  return returnPromise;
58
47
  };
59
48
  };
@@ -3,22 +3,21 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  // muteSecond: -1=permanent mute, 0=unmute, 60=one minute, 3600=one hour, etc.
8
8
  return function muteThread(threadID, muteSeconds, callback) {
9
- var resolveFunc = function(){};
10
- var rejectFunc = function(){};
9
+ var resolveFunc = function () { };
10
+ var rejectFunc = function () { };
11
11
  var returnPromise = new Promise(function (resolve, reject) {
12
12
  resolveFunc = resolve;
13
13
  rejectFunc = reject;
14
14
  });
15
15
 
16
16
  if (!callback) {
17
- callback = function (err, friendList) {
18
- if (err) {
19
- return rejectFunc(err);
20
- }
21
- resolveFunc(friendList);
17
+ callback = function (err, data) {
18
+ if (err) return rejectFunc(err);
19
+
20
+ resolveFunc(data);
22
21
  };
23
22
  }
24
23
 
@@ -28,21 +27,15 @@ module.exports = function(defaultFuncs, api, ctx) {
28
27
  };
29
28
 
30
29
  defaultFuncs
31
- .post(
32
- "https://www.facebook.com/ajax/mercury/change_mute_thread.php",
33
- ctx.jar,
34
- form
35
- )
30
+ .post("https://www.facebook.com/ajax/mercury/change_mute_thread.php", ctx.jar, form)
36
31
  .then(utils.saveCookies(ctx.jar))
37
32
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
38
- .then(function(resData) {
39
- if (resData.error) {
40
- throw resData;
41
- }
33
+ .then(function (resData) {
34
+ if (resData.error) throw resData;
42
35
 
43
36
  return callback();
44
37
  })
45
- .catch(function(err) {
38
+ .catch(function (err) {
46
39
  log.error("muteThread", err);
47
40
  return callback(err);
48
41
  });
@@ -3,51 +3,23 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function removeUserFromGroup(userID, threadID, callback) {
8
- if (
9
- !callback &&
10
- (utils.getType(threadID) === "Function" ||
11
- utils.getType(threadID) === "AsyncFunction")
12
- ) {
13
- throw { error: "please pass a threadID as a second argument." };
14
- }
15
- if (
16
- utils.getType(threadID) !== "Number" &&
17
- utils.getType(threadID) !== "String"
18
- ) {
19
- throw {
20
- error:
21
- "threadID should be of type Number or String and not " +
22
- utils.getType(threadID) +
23
- "."
24
- };
25
- }
26
- if (
27
- utils.getType(userID) !== "Number" &&
28
- utils.getType(userID) !== "String"
29
- ) {
30
- throw {
31
- error:
32
- "userID should be of type Number or String and not " +
33
- utils.getType(userID) +
34
- "."
35
- };
36
- }
8
+ if (!callback && (utils.getType(threadID) === "Function" || utils.getType(threadID) === "AsyncFunction")) throw { error: "please pass a threadID as a second argument." };
9
+ if (utils.getType(threadID) !== "Number" && utils.getType(threadID) !== "String") throw { error: "threadID should be of type Number or String and not " + utils.getType(threadID) + "." };
10
+ if (utils.getType(userID) !== "Number" && utils.getType(userID) !== "String") throw { error: "userID should be of type Number or String and not " + utils.getType(userID) + "." };
37
11
 
38
- var resolveFunc = function(){};
39
- var rejectFunc = function(){};
12
+ var resolveFunc = function () { };
13
+ var rejectFunc = function () { };
40
14
  var returnPromise = new Promise(function (resolve, reject) {
41
15
  resolveFunc = resolve;
42
16
  rejectFunc = reject;
43
17
  });
44
18
 
45
19
  if (!callback) {
46
- callback = function (err, friendList) {
47
- if (err) {
48
- return rejectFunc(err);
49
- }
50
- resolveFunc(friendList);
20
+ callback = function (err, data) {
21
+ if (err) return rejectFunc(err);
22
+ resolveFunc(data);
51
23
  };
52
24
  }
53
25
 
@@ -59,21 +31,15 @@ module.exports = function(defaultFuncs, api, ctx) {
59
31
  defaultFuncs
60
32
  .post("https://www.facebook.com/chat/remove_participants", ctx.jar, form)
61
33
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
62
- .then(function(resData) {
63
- if (!resData) {
64
- throw { error: "Remove from group failed." };
65
- }
66
- if (resData.error) {
67
- throw resData;
68
- }
69
-
34
+ .then(function (resData) {
35
+ if (!resData) throw { error: "Remove from group failed." };
36
+ if (resData.error) throw resData;
70
37
  return callback();
71
38
  })
72
- .catch(function(err) {
73
- log.error("removeUserFromGroup", err);
39
+ .catch(function (err) {
40
+ log.error("removeUserFromGroup", "» Bailing out of trying to parse response");
74
41
  return callback(err);
75
42
  });
76
-
77
43
  return returnPromise;
78
44
  };
79
45
  };
@@ -3,43 +3,34 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function resolvePhotoUrl(photoID, callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
13
13
  });
14
14
 
15
15
  if (!callback) {
16
- callback = function (err, friendList) {
17
- if (err) {
18
- return rejectFunc(err);
19
- }
20
- resolveFunc(friendList);
16
+ callback = function (err, data) {
17
+ if (err) return rejectFunc(err);
18
+ resolveFunc(data);
21
19
  };
22
20
  }
23
21
 
24
22
  defaultFuncs
25
- .get("https://www.facebook.com/mercury/attachments/photo", ctx.jar, {
26
- photo_id: photoID
27
- })
23
+ .get("https://www.facebook.com/mercury/attachments/photo", ctx.jar, { photo_id: photoID })
28
24
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
29
25
  .then(resData => {
30
- if (resData.error) {
31
- throw resData;
32
- }
33
-
26
+ if (resData.error) throw resData;
34
27
  var photoUrl = resData.jsmods.require[0][3][0];
35
-
36
28
  return callback(null, photoUrl);
37
29
  })
38
30
  .catch(err => {
39
31
  log.error("resolvePhotoUrl", err);
40
32
  return callback(err);
41
33
  });
42
-
43
34
  return returnPromise;
44
35
  };
45
36
  };
@@ -2,21 +2,19 @@
2
2
 
3
3
  var utils = require("../utils");
4
4
 
5
- module.exports = function(defaultFuncs, api, ctx) {
5
+ module.exports = function (defaultFuncs, api, ctx) {
6
6
  return function searchForThread(name, callback) {
7
- var resolveFunc = function(){};
8
- var rejectFunc = function(){};
7
+ var resolveFunc = function () { };
8
+ var rejectFunc = function () { };
9
9
  var returnPromise = new Promise(function (resolve, reject) {
10
10
  resolveFunc = resolve;
11
11
  rejectFunc = reject;
12
12
  });
13
13
 
14
14
  if (!callback) {
15
- callback = function (err, friendList) {
16
- if (err) {
17
- return rejectFunc(err);
18
- }
19
- resolveFunc(friendList);
15
+ callback = function (err, data) {
16
+ if (err) return rejectFunc(err);
17
+ resolveFunc(data);
20
18
  };
21
19
  }
22
20
 
@@ -29,25 +27,16 @@ module.exports = function(defaultFuncs, api, ctx) {
29
27
  };
30
28
 
31
29
  defaultFuncs
32
- .post(
33
- "https://www.facebook.com/ajax/mercury/search_threads.php",
34
- ctx.jar,
35
- tmpForm
36
- )
30
+ .post("https://www.facebook.com/ajax/mercury/search_threads.php", ctx.jar, tmpForm)
37
31
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
38
- .then(function(resData) {
39
- if (resData.error) {
40
- throw resData;
41
- }
42
- if (!resData.payload.mercury_payload.threads) {
43
- return callback({ error: "Could not find thread `" + name + "`." });
44
- }
32
+ .then(function (resData) {
33
+ if (resData.error) throw resData;
34
+ if (!resData.payload.mercury_payload.threads) return callback({ error: "Could not find thread `" + name + "`." });
45
35
  return callback(
46
36
  null,
47
37
  resData.payload.mercury_payload.threads.map(utils.formatThread)
48
38
  );
49
39
  });
50
-
51
40
  return returnPromise;
52
41
  };
53
42
  };