node-ainzfb-new 1.6.1-test → 1.6.32-stable

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/index.js +1 -1
  2. package/package.json +2 -3
  3. package/src/addExternalModule.js +13 -6
  4. package/src/addUserToGroup.js +35 -12
  5. package/src/changeAdminStatus.js +32 -16
  6. package/src/changeArchivedStatus.js +15 -9
  7. package/src/changeAvt.js +91 -0
  8. package/src/changeBio.js +12 -8
  9. package/src/changeBlockedStatus.js +14 -8
  10. package/src/changeGroupImage.js +27 -13
  11. package/src/changeNickname.js +19 -10
  12. package/src/changeThreadColor.js +15 -10
  13. package/src/changeThreadEmoji.js +17 -9
  14. package/src/createNewGroup.js +18 -10
  15. package/src/createPoll.js +16 -11
  16. package/src/deleteMessage.js +16 -10
  17. package/src/deleteThread.js +16 -10
  18. package/src/forwardAttachment.js +14 -9
  19. package/src/getCurrentUserID.js +1 -1
  20. package/src/getEmojiUrl.js +3 -2
  21. package/src/getFriendsList.js +18 -10
  22. package/src/getMessage.js +52 -48
  23. package/src/getThreadHistory.js +156 -59
  24. package/src/getThreadHistoryDeprecated.js +26 -15
  25. package/src/getThreadInfoDeprecated.js +25 -13
  26. package/src/getThreadList.js +112 -53
  27. package/src/getThreadListDeprecated.js +30 -12
  28. package/src/getThreadPictures.js +25 -13
  29. package/src/getUserID.js +8 -7
  30. package/src/getUserInfo.js +12 -9
  31. package/src/handleFriendRequest.js +10 -9
  32. package/src/handleMessageRequest.js +16 -10
  33. package/src/httpGet.js +18 -13
  34. package/src/httpPost.js +18 -13
  35. package/src/httpPostFormData.js +14 -9
  36. package/src/listenMqtt.js +1218 -571
  37. package/src/logout.js +18 -13
  38. package/src/markAsDelivered.js +16 -10
  39. package/src/markAsRead.js +36 -24
  40. package/src/markAsReadAll.js +14 -10
  41. package/src/markAsSeen.js +18 -11
  42. package/src/muteThread.js +12 -8
  43. package/src/removeUserFromGroup.js +33 -10
  44. package/src/resolvePhotoUrl.js +8 -6
  45. package/src/searchForThread.js +13 -8
  46. package/src/sendMessage.js +172 -78
  47. package/src/sendTypingIndicator.js +29 -14
  48. package/src/setMessageReaction.js +13 -8
  49. package/src/setPostReaction.js +97 -95
  50. package/src/setTitle.js +18 -12
  51. package/src/threadColors.js +17 -17
  52. package/src/unfriend.js +14 -9
  53. package/src/unsendMessage.js +7 -7
  54. package/utils.js +18 -19
package/src/httpGet.js CHANGED
@@ -3,42 +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
  }
20
24
 
21
25
  form = form || {};
22
26
 
23
- callback = callback || function (err, data) {
24
- if (err) return rejectFunc(err);
25
- resolveFunc(data);
26
- };
27
+ callback =
28
+ callback ||
29
+ function(err, data) {
30
+ if (err) return rejectFunc(err);
31
+ resolveFunc(data);
32
+ };
27
33
 
28
34
  if (notAPI) {
29
35
  utils
30
36
  .get(url, ctx.jar, form, ctx.globalOptions)
31
37
  .then(resData => callback(null, resData.body.toString()))
32
- .catch(function (err) {
38
+ .catch(function(err) {
33
39
  log.error("httpGet", err);
34
40
  return callback(err);
35
41
  });
36
- }
37
- else {
42
+ } else {
38
43
  defaultFuncs
39
44
  .get(url, ctx.jar, form)
40
45
  .then(resData => callback(null, resData.body.toString()))
41
- .catch(function (err) {
46
+ .catch(function(err) {
42
47
  log.error("httpGet", err);
43
48
  return callback(err);
44
49
  });
package/src/httpPost.js CHANGED
@@ -3,42 +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
  }
20
24
 
21
25
  form = form || {};
22
26
 
23
- callback = callback || function (err, data) {
24
- if (err) return rejectFunc(err);
25
- resolveFunc(data);
26
- };
27
+ callback =
28
+ callback ||
29
+ function(err, data) {
30
+ if (err) return rejectFunc(err);
31
+ resolveFunc(data);
32
+ };
27
33
 
28
34
  if (notAPI) {
29
35
  utils
30
36
  .post(url, ctx.jar, form, ctx.globalOptions)
31
37
  .then(resData => callback(null, resData.body.toString()))
32
- .catch(function (err) {
38
+ .catch(function(err) {
33
39
  log.error("httpPost", err);
34
40
  return callback(err);
35
41
  });
36
- }
37
- else {
42
+ } else {
38
43
  defaultFuncs
39
44
  .post(url, ctx.jar, form, {})
40
45
  .then(resData => callback(null, resData.body.toString()))
41
- .catch(function (err) {
46
+ .catch(function(err) {
42
47
  log.error("httpPost", err);
43
48
  return callback(err);
44
49
  });
@@ -5,26 +5,31 @@ var log = require("npmlog");
5
5
 
6
6
  module.exports = function(defaultFuncs, api, ctx) {
7
7
  return function httpPostFormData(url, form, callback) {
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
  }
20
24
 
21
25
  form = form || {};
22
-
23
-
24
- callback = callback || function(err, data) {
26
+
27
+ callback =
28
+ callback ||
29
+ function(err, data) {
25
30
  if (err) return rejectFunc(err);
26
31
  resolveFunc(data);
27
- };
32
+ };
28
33
 
29
34
  defaultFuncs
30
35
  .postFormData(url, ctx.jar, form)
@@ -38,4 +43,4 @@ module.exports = function(defaultFuncs, api, ctx) {
38
43
 
39
44
  return returnPromise;
40
45
  };
41
- };
46
+ };