alicezetion 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -1
  2. package/.cache/replit/nix/env.json +1 -1
  3. package/Extra/Database/index.js +399 -0
  4. package/Extra/Database/methods.js +286 -0
  5. package/Extra/ExtraAddons.js +213 -0
  6. package/Extra/ExtraGetThread.js +1 -0
  7. package/Extra/ExtraUptimeRobot.js +59 -0
  8. package/Extra/PM2/ecosystem.config.js +23 -0
  9. package/Extra/Src/Last-Run.js +48 -0
  10. package/Language/index.json +151 -0
  11. package/StateCrypt.js +22 -0
  12. package/broadcast.js +42 -0
  13. package/index.js +654 -119
  14. package/logger.js +21 -0
  15. package/package.json +37 -25
  16. package/replit.nix +3 -4
  17. package/src/addExternalModule.js +13 -5
  18. package/src/addUserToGroup.js +36 -12
  19. package/src/changeAdminStatus.js +85 -37
  20. package/src/changeArchivedStatus.js +15 -9
  21. package/src/changeAvt.js +91 -0
  22. package/src/changeBio.js +13 -8
  23. package/src/changeBlockedStatus.js +14 -8
  24. package/src/changeGroupImage.js +28 -13
  25. package/src/changeNickname.js +22 -11
  26. package/src/changeThreadColor.js +16 -10
  27. package/src/changeThreadEmoji.js +18 -9
  28. package/src/chat.js +401 -280
  29. package/src/createNewGroup.js +18 -10
  30. package/src/createPoll.js +17 -11
  31. package/src/deleteMessage.js +17 -10
  32. package/src/deleteThread.js +17 -10
  33. package/src/forwardAttachment.js +15 -9
  34. package/src/getAccessToken.js +32 -0
  35. package/src/getCurrentUserID.js +1 -1
  36. package/src/getEmojiUrl.js +3 -2
  37. package/src/getFriendsList.js +18 -10
  38. package/src/getMessage.js +84 -0
  39. package/src/getThreadHistory.js +156 -59
  40. package/src/getThreadHistoryDeprecated.js +26 -15
  41. package/src/getThreadInfo.js +68 -42
  42. package/src/getThreadInfoDeprecated.js +25 -13
  43. package/src/getThreadList.js +112 -53
  44. package/src/getThreadListDeprecated.js +30 -12
  45. package/src/getThreadPictures.js +25 -13
  46. package/src/getUserID.js +9 -7
  47. package/src/getUserInfo.js +12 -10
  48. package/src/getUserInfoV2.js +35 -0
  49. package/src/handleFriendRequest.js +36 -35
  50. package/src/handleMessageRequest.js +18 -10
  51. package/src/httpGet.js +20 -13
  52. package/src/httpPost.js +19 -13
  53. package/src/httpPostFormData.js +46 -0
  54. package/src/listenMqtt.js +1224 -621
  55. package/src/logout.js +18 -13
  56. package/src/markAsDelivered.js +17 -10
  57. package/src/markAsRead.js +36 -24
  58. package/src/markAsSeen.js +22 -12
  59. package/src/muteThread.js +15 -9
  60. package/src/{setMessageReaction.js → react.js} +20 -9
  61. package/src/removeUserFromGroup.js +38 -11
  62. package/src/resolvePhotoUrl.js +9 -6
  63. package/src/searchForThread.js +14 -8
  64. package/src/{markAsReadAll.js → seen.js} +17 -10
  65. package/src/sendTypingIndicator.js +44 -19
  66. package/src/setPostReaction.js +63 -22
  67. package/src/setTitle.js +22 -12
  68. package/src/threadColors.js +17 -19
  69. package/src/unfriend.js +15 -9
  70. package/src/{unsendMessage.js → unsend.js} +9 -8
  71. package/utils.js +120 -27
  72. package/.travis.yml +0 -6
  73. package/src/forwardMessage.js +0 -0
  74. package/src/listen.js +0 -553
  75. package/src/listenMqtt-Test.js +0 -687
  76. package/src/sendMessage.js +0 -315
  77. package/test/data/shareAttach.js +0 -146
  78. package/test/data/something.mov +0 -0
  79. package/test/data/test.png +0 -0
  80. package/test/data/test.txt +0 -7
  81. package/test/example-config.json +0 -18
  82. package/test/test-page.js +0 -140
  83. package/test/test.js +0 -385
@@ -3,19 +3,20 @@
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 handleMessageRequest(threadID, accept, callback) {
8
- if (utils.getType(accept) !== "Boolean") throw { error: "Please pass a boolean as a second argument." };
8
+ if (utils.getType(accept) !== "Boolean")
9
+ throw { error: "Please pass a boolean as a second argument." };
9
10
 
10
- var resolveFunc = function () { };
11
- var rejectFunc = function () { };
12
- var returnPromise = new Promise(function (resolve, reject) {
11
+ var resolveFunc = function() {};
12
+ var rejectFunc = function() {};
13
+ var returnPromise = new Promise(function(resolve, reject) {
13
14
  resolveFunc = resolve;
14
15
  rejectFunc = reject;
15
16
  });
16
17
 
17
18
  if (!callback) {
18
- callback = function (err, data) {
19
+ callback = function(err, data) {
19
20
  if (err) return rejectFunc(err);
20
21
  resolveFunc(data);
21
22
  };
@@ -28,16 +29,23 @@ module.exports = function (defaultFuncs, api, ctx) {
28
29
  if (utils.getType(threadID) !== "Array") threadID = [threadID];
29
30
 
30
31
  var messageBox = accept ? "inbox" : "other";
31
- for (var i = 0; i < threadID.length; i++) form[messageBox + "[" + i + "]"] = threadID[i];
32
+
33
+ for (var i = 0; i < threadID.length; i++)
34
+ form[messageBox + "[" + i + "]"] = threadID[i];
32
35
 
33
36
  defaultFuncs
34
- .post("https://www.facebook.com/ajax/mercury/move_thread.php", ctx.jar, form)
37
+ .post(
38
+ "https://www.facebook.com/ajax/mercury/move_thread.php",
39
+ ctx.jar,
40
+ form
41
+ )
35
42
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
36
- .then(function (resData) {
43
+ .then(function(resData) {
37
44
  if (resData.error) throw resData;
45
+
38
46
  return callback();
39
47
  })
40
- .catch(function (err) {
48
+ .catch(function(err) {
41
49
  log.error("handleMessageRequest", err);
42
50
  return callback(err);
43
51
  });
package/src/httpGet.js CHANGED
@@ -3,45 +3,52 @@
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 httpGet(url, form, callback, notAPI) {
8
- var resolveFunc = function () { };
9
- var rejectFunc = function () { };
8
+ var resolveFunc = function() {};
9
+ var rejectFunc = function() {};
10
10
 
11
- var returnPromise = new Promise(function (resolve, reject) {
11
+ var returnPromise = new Promise(function(resolve, reject) {
12
12
  resolveFunc = resolve;
13
13
  rejectFunc = reject;
14
14
  });
15
15
 
16
- if (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
16
+ if (
17
+ !callback &&
18
+ (utils.getType(form) == "Function" ||
19
+ utils.getType(form) == "AsyncFunction")
20
+ ) {
17
21
  callback = form;
18
22
  form = {};
19
23
  }
24
+
20
25
  form = form || {};
21
26
 
22
- callback = callback || function (err, data) {
23
- if (err) return rejectFunc(err);
24
- resolveFunc(data);
25
- };
27
+ callback =
28
+ callback ||
29
+ function(err, data) {
30
+ if (err) return rejectFunc(err);
31
+ resolveFunc(data);
32
+ };
26
33
 
27
34
  if (notAPI) {
28
35
  utils
29
36
  .get(url, ctx.jar, form, ctx.globalOptions)
30
37
  .then(resData => callback(null, resData.body.toString()))
31
- .catch(function (err) {
38
+ .catch(function(err) {
32
39
  log.error("httpGet", err);
33
40
  return callback(err);
34
41
  });
35
- }
36
- else {
42
+ } else {
37
43
  defaultFuncs
38
44
  .get(url, ctx.jar, form)
39
45
  .then(resData => callback(null, resData.body.toString()))
40
- .catch(function (err) {
46
+ .catch(function(err) {
41
47
  log.error("httpGet", err);
42
48
  return callback(err);
43
49
  });
44
50
  }
51
+
45
52
  return returnPromise;
46
53
  };
47
54
  };
package/src/httpPost.js CHANGED
@@ -3,41 +3,47 @@
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 httpGet(url, form, callback, notAPI) {
8
- var resolveFunc = function () { };
9
- var rejectFunc = function () { };
8
+ var resolveFunc = function() {};
9
+ var rejectFunc = function() {};
10
10
 
11
- var returnPromise = new Promise(function (resolve, reject) {
11
+ var returnPromise = new Promise(function(resolve, reject) {
12
12
  resolveFunc = resolve;
13
13
  rejectFunc = reject;
14
14
  });
15
15
 
16
- if (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
16
+ if (
17
+ !callback &&
18
+ (utils.getType(form) == "Function" ||
19
+ utils.getType(form) == "AsyncFunction")
20
+ ) {
17
21
  callback = form;
18
22
  form = {};
19
23
  }
24
+
20
25
  form = form || {};
21
26
 
22
- callback = callback || function (err, data) {
23
- if (err) return rejectFunc(err);
24
- resolveFunc(data);
25
- };
27
+ callback =
28
+ callback ||
29
+ function(err, data) {
30
+ if (err) return rejectFunc(err);
31
+ resolveFunc(data);
32
+ };
26
33
 
27
34
  if (notAPI) {
28
35
  utils
29
36
  .post(url, ctx.jar, form, ctx.globalOptions)
30
37
  .then(resData => callback(null, resData.body.toString()))
31
- .catch(function (err) {
38
+ .catch(function(err) {
32
39
  log.error("httpPost", err);
33
40
  return callback(err);
34
41
  });
35
- }
36
- else {
42
+ } else {
37
43
  defaultFuncs
38
44
  .post(url, ctx.jar, form, {})
39
45
  .then(resData => callback(null, resData.body.toString()))
40
- .catch(function (err) {
46
+ .catch(function(err) {
41
47
  log.error("httpPost", err);
42
48
  return callback(err);
43
49
  });
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function(defaultFuncs, api, ctx) {
7
+ return function httpPostFormData(url, form, callback) {
8
+ var resolveFunc = function() {};
9
+ var rejectFunc = function() {};
10
+
11
+ var returnPromise = new Promise(function(resolve, reject) {
12
+ resolveFunc = resolve;
13
+ rejectFunc = reject;
14
+ });
15
+
16
+ if (
17
+ !callback &&
18
+ (utils.getType(form) == "Function" ||
19
+ utils.getType(form) == "AsyncFunction")
20
+ ) {
21
+ callback = form;
22
+ form = {};
23
+ }
24
+
25
+ form = form || {};
26
+
27
+ callback =
28
+ callback ||
29
+ function(err, data) {
30
+ if (err) return rejectFunc(err);
31
+ resolveFunc(data);
32
+ };
33
+
34
+ defaultFuncs
35
+ .postFormData(url, ctx.jar, form)
36
+ .then(function(resData) {
37
+ callback(null, resData.body.toString());
38
+ })
39
+ .catch(function(err) {
40
+ log.error("httpPostFormData", err);
41
+ return callback(err);
42
+ });
43
+
44
+ return returnPromise;
45
+ };
46
+ };