alicezetion 1.7.1 → 1.7.3
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/Extra/Database/index.js +399 -0
- package/Extra/Database/methods.js +286 -0
- package/Extra/ExtraAddons.js +213 -0
- package/Extra/ExtraGetThread.js +1 -0
- package/Extra/ExtraUptimeRobot.js +59 -0
- package/Extra/PM2/ecosystem.config.js +23 -0
- package/Extra/Src/Last-Run.js +48 -0
- package/Language/index.json +151 -0
- package/StateCrypt.js +22 -0
- package/broadcast.js +42 -0
- package/index.js +655 -120
- package/logger.js +21 -0
- package/package.json +37 -25
- package/replit.nix +3 -4
- package/src/addExternalModule.js +13 -5
- package/src/addUserToGroup.js +36 -12
- package/src/changeAdminStatus.js +85 -37
- package/src/changeArchivedStatus.js +15 -9
- package/src/changeAvt.js +91 -0
- package/src/changeBio.js +13 -8
- package/src/changeBlockedStatus.js +14 -8
- package/src/changeGroupImage.js +28 -13
- package/src/changeNickname.js +22 -11
- package/src/changeThreadColor.js +16 -10
- package/src/changeThreadEmoji.js +18 -9
- package/src/chat.js +401 -280
- package/src/createNewGroup.js +18 -10
- package/src/createPoll.js +17 -11
- package/src/deleteMessage.js +17 -10
- package/src/deleteThread.js +17 -10
- package/src/forwardAttachment.js +15 -9
- package/src/getAccessToken.js +32 -0
- package/src/getCurrentUserID.js +1 -1
- package/src/getEmojiUrl.js +3 -2
- package/src/getFriendsList.js +18 -10
- package/src/getMessage.js +84 -0
- package/src/getThreadHistory.js +156 -59
- package/src/getThreadHistoryDeprecated.js +26 -15
- package/src/getThreadInfo.js +68 -42
- package/src/getThreadInfoDeprecated.js +25 -13
- package/src/getThreadList.js +112 -53
- package/src/getThreadListDeprecated.js +30 -12
- package/src/getThreadPictures.js +25 -13
- package/src/getUserID.js +9 -7
- package/src/getUserInfo.js +12 -10
- package/src/getUserInfoV2.js +35 -0
- package/src/handleFriendRequest.js +36 -35
- package/src/handleMessageRequest.js +18 -10
- package/src/httpGet.js +20 -13
- package/src/httpPost.js +19 -13
- package/src/httpPostFormData.js +46 -0
- package/src/listenMqtt.js +1224 -621
- package/src/logout.js +18 -13
- package/src/markAsDelivered.js +17 -10
- package/src/markAsRead.js +36 -24
- package/src/markAsSeen.js +22 -12
- package/src/muteThread.js +15 -9
- package/src/{setMessageReaction.js → react.js} +20 -9
- package/src/removeUserFromGroup.js +38 -11
- package/src/resolvePhotoUrl.js +9 -6
- package/src/searchForThread.js +14 -8
- package/src/{markAsReadAll.js → seen.js} +17 -10
- package/src/sendTypingIndicator.js +44 -19
- package/src/setPostReaction.js +63 -22
- package/src/setTitle.js +22 -12
- package/src/threadColors.js +17 -19
- package/src/unfriend.js +15 -9
- package/src/{unsendMessage.js → unsend.js} +9 -8
- package/utils.js +120 -27
- package/.travis.yml +0 -6
- package/src/forwardMessage.js +0 -0
- package/src/listen.js +0 -553
- package/src/listenMqtt-Test.js +0 -687
- package/src/sendMessage.js +0 -315
- package/test/data/shareAttach.js +0 -146
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +0 -7
- package/test/example-config.json +0 -18
- package/test/test-page.js +0 -140
- 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
|
6
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function handleMessageRequest(threadID, accept, callback) {
|
8
|
-
if (utils.getType(accept) !== "Boolean")
|
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
|
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
|
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
|
-
|
32
|
+
|
33
|
+
for (var i = 0; i < threadID.length; i++)
|
34
|
+
form[messageBox + "[" + i + "]"] = threadID[i];
|
32
35
|
|
33
36
|
defaultFuncs
|
34
|
-
.post(
|
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
|
43
|
+
.then(function(resData) {
|
37
44
|
if (resData.error) throw resData;
|
45
|
+
|
38
46
|
return callback();
|
39
47
|
})
|
40
|
-
.catch(function
|
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
|
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
|
11
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
12
12
|
resolveFunc = resolve;
|
13
13
|
rejectFunc = reject;
|
14
14
|
});
|
15
15
|
|
16
|
-
if (
|
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 =
|
23
|
-
|
24
|
-
|
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
|
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
|
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
|
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
|
11
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
12
12
|
resolveFunc = resolve;
|
13
13
|
rejectFunc = reject;
|
14
14
|
});
|
15
15
|
|
16
|
-
if (
|
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 =
|
23
|
-
|
24
|
-
|
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
|
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
|
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
|
+
};
|