alicezetion 1.6.7 → 1.6.9
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 +804 -381
- package/leiamnash/addExternalModule.js +19 -19
- package/leiamnash/addUserToGroup.js +113 -113
- package/leiamnash/changeAdminStatus.js +79 -79
- package/leiamnash/changeApprovalMode.js +80 -0
- package/leiamnash/changeArchivedStatus.js +55 -55
- package/leiamnash/changeBio.js +77 -77
- package/leiamnash/changeBlockedStatus.js +47 -47
- package/leiamnash/changeGroupImage.js +129 -129
- package/leiamnash/changeNickname.js +59 -59
- package/leiamnash/changeThreadColor.js +71 -71
- package/leiamnash/changeThreadEmoji.js +55 -55
- package/leiamnash/chat.js +447 -459
- package/leiamnash/createNewGroup.js +86 -86
- package/leiamnash/createPoll.js +71 -71
- package/leiamnash/deleteMessage.js +56 -56
- package/leiamnash/deleteThread.js +56 -56
- package/leiamnash/forwardAttachment.js +60 -60
- package/leiamnash/getCurrentUserID.js +7 -7
- package/leiamnash/getEmojiUrl.js +29 -29
- package/leiamnash/getFriendsList.js +84 -84
- package/leiamnash/getThreadHistory.js +645 -645
- package/leiamnash/getThreadHistoryDeprecated.js +93 -93
- package/leiamnash/getThreadInfo.js +212 -206
- package/leiamnash/getThreadInfoDeprecated.js +80 -80
- package/leiamnash/getThreadList.js +238 -238
- package/leiamnash/getThreadListDeprecated.js +75 -75
- package/leiamnash/getThreadPictures.js +79 -79
- package/leiamnash/getUserID.js +66 -66
- package/leiamnash/getUserInfo.js +72 -72
- package/leiamnash/handleFriendRequest.js +61 -61
- package/leiamnash/handleMessageRequest.js +65 -65
- package/leiamnash/httpGet.js +52 -52
- package/leiamnash/httpPost.js +52 -52
- package/leiamnash/listenMqtt.js +1078 -509
- package/leiamnash/logout.js +75 -75
- package/leiamnash/markAsDelivered.js +58 -58
- package/leiamnash/markAsRead.js +80 -80
- package/leiamnash/markAsReadAll.js +49 -49
- package/leiamnash/markAsSeen.js +59 -59
- package/leiamnash/muteThread.js +52 -52
- package/leiamnash/removeUserFromGroup.js +79 -79
- package/leiamnash/resolvePhotoUrl.js +45 -45
- package/leiamnash/searchForThread.js +53 -53
- package/leiamnash/sendTypingIndicator.js +103 -103
- package/leiamnash/setMessageReaction.js +117 -117
- package/leiamnash/setPostReaction.js +76 -76
- package/leiamnash/setTitle.js +86 -86
- package/leiamnash/threadColors.js +57 -57
- package/leiamnash/unfriend.js +52 -52
- package/leiamnash/unsendMessage.js +49 -49
- package/package.json +72 -72
- package/replit.nix +3 -0
- package/utils.js +196 -71
- package/leiamnash/listen.js +0 -553
@@ -1,61 +1,61 @@
|
|
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 handleFriendRequest(userID, 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
|
-
viewer_id: ctx.userID,
|
32
|
-
"frefs[0]": "jwl",
|
33
|
-
floc: "friend_center_requests",
|
34
|
-
ref: "/reqs.php",
|
35
|
-
action: (accept ? "confirm" : "reject")
|
36
|
-
};
|
37
|
-
|
38
|
-
defaultFuncs
|
39
|
-
.post(
|
40
|
-
"https://www.facebook.com/requests/friends/ajax/",
|
41
|
-
ctx.jar,
|
42
|
-
form
|
43
|
-
)
|
44
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
45
|
-
.then(function(resData) {
|
46
|
-
if (resData.payload.err) {
|
47
|
-
throw {
|
48
|
-
err: resData.payload.err
|
49
|
-
};
|
50
|
-
}
|
51
|
-
|
52
|
-
return callback();
|
53
|
-
})
|
54
|
-
.catch(function(err) {
|
55
|
-
log.error("handleFriendRequest", err);
|
56
|
-
return callback(err);
|
57
|
-
});
|
58
|
-
|
59
|
-
return returnPromise;
|
60
|
-
};
|
61
|
-
};
|
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 handleFriendRequest(userID, 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
|
+
viewer_id: ctx.userID,
|
32
|
+
"frefs[0]": "jwl",
|
33
|
+
floc: "friend_center_requests",
|
34
|
+
ref: "/reqs.php",
|
35
|
+
action: (accept ? "confirm" : "reject")
|
36
|
+
};
|
37
|
+
|
38
|
+
defaultFuncs
|
39
|
+
.post(
|
40
|
+
"https://www.facebook.com/requests/friends/ajax/",
|
41
|
+
ctx.jar,
|
42
|
+
form
|
43
|
+
)
|
44
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
45
|
+
.then(function(resData) {
|
46
|
+
if (resData.payload.err) {
|
47
|
+
throw {
|
48
|
+
err: resData.payload.err
|
49
|
+
};
|
50
|
+
}
|
51
|
+
|
52
|
+
return callback();
|
53
|
+
})
|
54
|
+
.catch(function(err) {
|
55
|
+
log.error("handleFriendRequest", err);
|
56
|
+
return callback(err);
|
57
|
+
});
|
58
|
+
|
59
|
+
return returnPromise;
|
60
|
+
};
|
61
|
+
};
|
@@ -1,65 +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") {
|
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
|
+
"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
|
+
};
|
package/leiamnash/httpGet.js
CHANGED
@@ -1,52 +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
|
-
|
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
|
+
"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
|
+
};
|
package/leiamnash/httpPost.js
CHANGED
@@ -1,52 +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
|
-
|
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
|
-
};
|
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
|
+
};
|