alicezetion 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/replit/__replit_disk_meta.json +1 -1
- package/.cache/replit/nix/env.json +1 -1
- package/index.js +489 -526
- package/leiamnash/addExternalModule.js +15 -19
- package/leiamnash/addUserToGroup.js +77 -113
- package/leiamnash/changeAdminStatus.js +47 -79
- package/leiamnash/changeArchivedStatus.js +41 -55
- package/leiamnash/changeBio.js +64 -77
- package/leiamnash/changeBlockedStatus.js +36 -47
- package/leiamnash/changeGroupImage.js +105 -129
- package/leiamnash/changeNickname.js +43 -59
- package/leiamnash/changeThreadColor.js +61 -71
- package/leiamnash/changeThreadEmoji.js +41 -55
- package/leiamnash/chat.js +324 -459
- package/leiamnash/createNewGroup.js +70 -86
- package/leiamnash/createPoll.js +59 -71
- package/leiamnash/deleteMessage.js +44 -56
- package/leiamnash/deleteThread.js +42 -56
- package/leiamnash/forwardAttachment.js +47 -60
- package/leiamnash/forwardMessage.js +0 -0
- package/leiamnash/getCurrentUserID.js +7 -7
- package/leiamnash/getEmojiUrl.js +27 -29
- package/leiamnash/getFriendsList.js +73 -84
- package/leiamnash/getThreadHistory.js +537 -645
- package/leiamnash/getThreadHistoryDeprecated.js +71 -93
- package/leiamnash/getThreadInfo.js +171 -206
- package/leiamnash/getThreadInfoDeprecated.js +56 -80
- package/leiamnash/getThreadList.js +213 -238
- package/leiamnash/getThreadListDeprecated.js +46 -75
- package/leiamnash/getThreadPictures.js +59 -79
- package/leiamnash/getUserID.js +61 -66
- package/leiamnash/getUserInfo.js +66 -72
- package/leiamnash/handleFriendRequest.js +46 -61
- package/leiamnash/handleMessageRequest.js +47 -65
- package/leiamnash/httpGet.js +47 -52
- package/leiamnash/httpPost.js +47 -52
- package/leiamnash/listen.js +553 -0
- package/leiamnash/listenMqtt-Test.js +687 -0
- package/leiamnash/listenMqtt.js +685 -789
- package/leiamnash/logout.js +68 -75
- package/leiamnash/markAsDelivered.js +47 -58
- package/leiamnash/markAsRead.js +70 -80
- package/leiamnash/markAsReadAll.js +39 -49
- package/leiamnash/markAsSeen.js +48 -59
- package/leiamnash/muteThread.js +45 -52
- package/leiamnash/removeUserFromGroup.js +45 -79
- package/leiamnash/resolvePhotoUrl.js +36 -45
- package/leiamnash/searchForThread.js +42 -53
- package/leiamnash/sendTypingIndicator.js +70 -103
- package/leiamnash/setMessageReaction.js +103 -117
- package/leiamnash/setPostReaction.js +63 -76
- package/leiamnash/setTitle.js +70 -86
- package/leiamnash/threadColors.js +41 -57
- package/leiamnash/unfriend.js +42 -52
- package/leiamnash/unsendMessage.js +39 -49
- package/package.json +73 -71
- package/utils.js +1198 -1356
@@ -1,65 +1,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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
var
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
+
"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
|
+
};
|
package/leiamnash/httpGet.js
CHANGED
@@ -1,52 +1,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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
.
|
31
|
-
.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
.
|
41
|
-
|
42
|
-
callback(
|
43
|
-
})
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
return returnPromise;
|
51
|
-
};
|
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
|
+
};
|
package/leiamnash/httpPost.js
CHANGED
@@ -1,52 +1,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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
.
|
31
|
-
.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
.
|
41
|
-
|
42
|
-
callback(
|
43
|
-
})
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
return returnPromise;
|
51
|
-
};
|
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
|
+
};
|