alicezetion 1.6.1 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) 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 +556 -493
  4. package/leiamnash/addExternalModule.js +19 -15
  5. package/leiamnash/addUserToGroup.js +113 -77
  6. package/leiamnash/changeAdminStatus.js +79 -47
  7. package/leiamnash/changeArchivedStatus.js +55 -41
  8. package/leiamnash/changeBio.js +77 -64
  9. package/leiamnash/changeBlockedStatus.js +47 -36
  10. package/leiamnash/changeGroupImage.js +129 -105
  11. package/leiamnash/changeNickname.js +59 -43
  12. package/leiamnash/changeThreadColor.js +71 -61
  13. package/leiamnash/changeThreadEmoji.js +55 -41
  14. package/leiamnash/chat.js +459 -324
  15. package/leiamnash/createNewGroup.js +86 -70
  16. package/leiamnash/createPoll.js +71 -59
  17. package/leiamnash/deleteMessage.js +56 -44
  18. package/leiamnash/deleteThread.js +56 -42
  19. package/leiamnash/forwardAttachment.js +60 -47
  20. package/leiamnash/getCurrentUserID.js +7 -7
  21. package/leiamnash/getEmojiUrl.js +29 -27
  22. package/leiamnash/getFriendsList.js +84 -73
  23. package/leiamnash/getThreadHistory.js +645 -537
  24. package/leiamnash/getThreadHistoryDeprecated.js +93 -71
  25. package/leiamnash/getThreadInfo.js +206 -171
  26. package/leiamnash/getThreadInfoDeprecated.js +80 -56
  27. package/leiamnash/getThreadList.js +238 -213
  28. package/leiamnash/getThreadListDeprecated.js +75 -46
  29. package/leiamnash/getThreadPictures.js +79 -59
  30. package/leiamnash/getUserID.js +66 -61
  31. package/leiamnash/getUserInfo.js +72 -66
  32. package/leiamnash/handleFriendRequest.js +61 -46
  33. package/leiamnash/handleMessageRequest.js +65 -47
  34. package/leiamnash/httpGet.js +52 -47
  35. package/leiamnash/httpPost.js +52 -47
  36. package/leiamnash/listenMqtt.js +789 -685
  37. package/leiamnash/logout.js +75 -68
  38. package/leiamnash/markAsDelivered.js +58 -47
  39. package/leiamnash/markAsRead.js +80 -70
  40. package/leiamnash/markAsReadAll.js +49 -39
  41. package/leiamnash/markAsSeen.js +59 -48
  42. package/leiamnash/muteThread.js +52 -45
  43. package/leiamnash/removeUserFromGroup.js +79 -45
  44. package/leiamnash/resolvePhotoUrl.js +45 -36
  45. package/leiamnash/searchForThread.js +53 -42
  46. package/leiamnash/sendTypingIndicator.js +103 -70
  47. package/leiamnash/setMessageReaction.js +117 -103
  48. package/leiamnash/setPostReaction.js +76 -63
  49. package/leiamnash/setTitle.js +86 -70
  50. package/leiamnash/threadColors.js +57 -41
  51. package/leiamnash/unfriend.js +52 -42
  52. package/leiamnash/unsendMessage.js +49 -39
  53. package/package.json +71 -73
  54. package/utils.js +1356 -1198
  55. package/leiamnash/forwardMessage.js +0 -0
  56. package/leiamnash/listen.js +0 -553
  57. package/leiamnash/listenMqtt-Test.js +0 -687
@@ -1,47 +1,65 @@
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 handleMessageRequest(threadID, accept, callback) {
8
- if (utils.getType(accept) !== "Boolean") throw { error: "Please pass a boolean as a second argument." };
9
-
10
- var resolveFunc = function () { };
11
- var rejectFunc = function () { };
12
- var returnPromise = new Promise(function (resolve, reject) {
13
- resolveFunc = resolve;
14
- rejectFunc = reject;
15
- });
16
-
17
- if (!callback) {
18
- callback = function (err, data) {
19
- if (err) return rejectFunc(err);
20
- resolveFunc(data);
21
- };
22
- }
23
-
24
- var form = {
25
- client: "mercury"
26
- };
27
-
28
- if (utils.getType(threadID) !== "Array") threadID = [threadID];
29
-
30
- var messageBox = accept ? "inbox" : "other";
31
- for (var i = 0; i < threadID.length; i++) form[messageBox + "[" + i + "]"] = threadID[i];
32
-
33
- defaultFuncs
34
- .post("https://www.facebook.com/ajax/mercury/move_thread.php", ctx.jar, form)
35
- .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
36
- .then(function (resData) {
37
- if (resData.error) throw resData;
38
- return callback();
39
- })
40
- .catch(function (err) {
41
- log.error("handleMessageRequest", err);
42
- return callback(err);
43
- });
44
-
45
- return returnPromise;
46
- };
47
- };
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 handleMessageRequest(threadID, accept, callback) {
8
+ if (utils.getType(accept) !== "Boolean") {
9
+ throw {
10
+ error: "Please pass a boolean as a second argument."
11
+ };
12
+ }
13
+
14
+ var resolveFunc = function(){};
15
+ var rejectFunc = function(){};
16
+ var returnPromise = new Promise(function (resolve, reject) {
17
+ resolveFunc = resolve;
18
+ rejectFunc = reject;
19
+ });
20
+
21
+ if (!callback) {
22
+ callback = function (err, friendList) {
23
+ if (err) {
24
+ return rejectFunc(err);
25
+ }
26
+ resolveFunc(friendList);
27
+ };
28
+ }
29
+
30
+ var form = {
31
+ client: "mercury"
32
+ };
33
+
34
+ if (utils.getType(threadID) !== "Array") {
35
+ threadID = [threadID];
36
+ }
37
+
38
+ var messageBox = accept ? "inbox" : "other";
39
+
40
+ for (var i = 0; i < threadID.length; i++) {
41
+ form[messageBox + "[" + i + "]"] = threadID[i];
42
+ }
43
+
44
+ defaultFuncs
45
+ .post(
46
+ "https://www.facebook.com/ajax/mercury/move_thread.php",
47
+ ctx.jar,
48
+ form
49
+ )
50
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
51
+ .then(function(resData) {
52
+ if (resData.error) {
53
+ throw resData;
54
+ }
55
+
56
+ return callback();
57
+ })
58
+ .catch(function(err) {
59
+ log.error("handleMessageRequest", err);
60
+ return callback(err);
61
+ });
62
+
63
+ return returnPromise;
64
+ };
65
+ };
@@ -1,47 +1,52 @@
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 httpGet(url, form, callback, notAPI) {
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 (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
17
- callback = form;
18
- form = {};
19
- }
20
- form = form || {};
21
-
22
- callback = callback || function (err, data) {
23
- if (err) return rejectFunc(err);
24
- resolveFunc(data);
25
- };
26
-
27
- if (notAPI) {
28
- utils
29
- .get(url, ctx.jar, form, ctx.globalOptions)
30
- .then(resData => callback(null, resData.body.toString()))
31
- .catch(function (err) {
32
- log.error("httpGet", err);
33
- return callback(err);
34
- });
35
- }
36
- else {
37
- defaultFuncs
38
- .get(url, ctx.jar, form)
39
- .then(resData => callback(null, resData.body.toString()))
40
- .catch(function (err) {
41
- log.error("httpGet", err);
42
- return callback(err);
43
- });
44
- }
45
- return returnPromise;
46
- };
47
- };
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 httpGet(url, form, callback, notAPI) {
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 (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
17
+ callback = form;
18
+ form = {};
19
+ }
20
+
21
+ form = form || {};
22
+
23
+ callback = callback || function(err, data) {
24
+ if (err) return rejectFunc(err);
25
+ resolveFunc(data);
26
+ };
27
+
28
+ if (notAPI) {
29
+ utils
30
+ .get(url, ctx.jar, form, ctx.globalOptions)
31
+ .then(function(resData) {
32
+ callback(null, resData.body.toString());
33
+ })
34
+ .catch(function(err) {
35
+ log.error("httpGet", err);
36
+ return callback(err);
37
+ });
38
+ } else {
39
+ defaultFuncs
40
+ .get(url, ctx.jar, form)
41
+ .then(function(resData) {
42
+ callback(null, resData.body.toString());
43
+ })
44
+ .catch(function(err) {
45
+ log.error("httpGet", err);
46
+ return callback(err);
47
+ });
48
+ }
49
+
50
+ return returnPromise;
51
+ };
52
+ };
@@ -1,47 +1,52 @@
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 httpGet(url, form, callback, notAPI) {
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 (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
17
- callback = form;
18
- form = {};
19
- }
20
- form = form || {};
21
-
22
- callback = callback || function (err, data) {
23
- if (err) return rejectFunc(err);
24
- resolveFunc(data);
25
- };
26
-
27
- if (notAPI) {
28
- utils
29
- .post(url, ctx.jar, form, ctx.globalOptions)
30
- .then(resData => callback(null, resData.body.toString()))
31
- .catch(function (err) {
32
- log.error("httpPost", err);
33
- return callback(err);
34
- });
35
- }
36
- else {
37
- defaultFuncs
38
- .post(url, ctx.jar, form, {})
39
- .then(resData => callback(null, resData.body.toString()))
40
- .catch(function (err) {
41
- log.error("httpPost", err);
42
- return callback(err);
43
- });
44
- }
45
- return returnPromise;
46
- };
47
- };
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 httpGet(url, form, callback, notAPI) {
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 (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
17
+ callback = form;
18
+ form = {};
19
+ }
20
+
21
+ form = form || {};
22
+
23
+ callback = callback || function(err, data) {
24
+ if (err) return rejectFunc(err);
25
+ resolveFunc(data);
26
+ };
27
+
28
+ if (notAPI) {
29
+ utils
30
+ .post(url, ctx.jar, form, ctx.globalOptions)
31
+ .then(function(resData) {
32
+ callback(null, resData.body.toString());
33
+ })
34
+ .catch(function(err) {
35
+ log.error("httpPost", err);
36
+ return callback(err);
37
+ });
38
+ } else {
39
+ defaultFuncs
40
+ .post(url, ctx.jar, form, {})
41
+ .then(function(resData) {
42
+ callback(null, resData.body.toString());
43
+ })
44
+ .catch(function(err) {
45
+ log.error("httpPost", err);
46
+ return callback(err);
47
+ });
48
+ }
49
+
50
+ return returnPromise;
51
+ };
52
+ };