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

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