rapido-fca 0.0.10 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rapido-fca might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/index.js +4 -4
- package/package.json +15 -16
- package/readme.md +237 -39
- package/src/Screenshot.js +83 -0
- package/src/addExternalModule.js +19 -23
- package/src/addUserToGroup.js +99 -97
- package/src/changeAdminStatus.js +86 -62
- package/src/changeArchivedStatus.js +49 -49
- package/src/changeAvatar.js +118 -108
- package/src/changeBio.js +63 -64
- package/src/changeBlockedStatus.js +40 -38
- package/src/changeGroupImage.js +129 -126
- package/src/changeNickname.js +49 -49
- package/src/changeThreadColor.js +53 -53
- package/src/changeThreadEmoji.js +45 -45
- package/src/createNewGroup.js +74 -72
- package/src/createPoll.js +59 -59
- package/src/deleteMessage.js +50 -50
- package/src/deleteThread.js +50 -50
- package/src/editMessage.js +51 -49
- package/src/forwardAttachment.js +54 -54
- package/src/getCurrentUserID.js +3 -3
- package/src/getEmojiUrl.js +17 -17
- package/src/getFriendsList.js +67 -67
- package/src/getMessage.js +806 -767
- package/src/getThreadHistory.js +656 -642
- package/src/getThreadInfo.js +1 -1
- package/src/getThreadList.js +199 -227
- package/src/getThreadPictures.js +51 -71
- package/src/getUserID.js +53 -58
- package/src/getUserInfo.js +52 -60
- package/src/handleFriendRequest.js +41 -65
- package/src/handleMessageRequest.js +42 -60
- package/src/httpGet.js +49 -57
- package/src/httpPost.js +48 -57
- package/src/listenMqtt.js +827 -827
- package/src/listenMqtt.txt +827 -0
- package/src/logout.js +61 -61
- package/src/markAsDelivered.js +42 -53
- package/src/markAsRead.js +59 -69
- package/src/markAsReadAll.js +32 -42
- package/src/markAsSeen.js +43 -54
- package/src/muteThread.js +40 -47
- package/src/postFormData.txt +46 -0
- package/src/refreshFb_dtsg.js +77 -69
- package/src/removeUserFromGroup.js +67 -67
- package/src/resolvePhotoUrl.js +34 -34
- package/src/searchForThread.js +43 -43
- package/src/sendMessage.js +80 -228
- package/src/sendTypingIndicator.js +86 -88
- package/src/setPostReaction.js +90 -87
- package/src/setTitle.js +76 -72
- package/src/threadColors.js +121 -121
- package/src/unfriend.js +43 -43
- package/src/unsendMessage.js +34 -38
- package/src/uploadAttachment.js +80 -81
- package/src/httpPostFormData.js +0 -63
- package/src/setEmojiReaction.js +0 -59
- package/src/videoAttachment.js +0 -76
package/src/createNewGroup.js
CHANGED
|
@@ -1,86 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const utils = require("../utils");
|
|
4
|
-
|
|
4
|
+
// @NethWs3Dev
|
|
5
5
|
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
return function createNewGroup(participantIDs, groupTitle, callback) {
|
|
8
|
+
if (utils.getType(groupTitle) == "Function") {
|
|
9
|
+
callback = groupTitle;
|
|
10
|
+
groupTitle = null;
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (utils.getType(participantIDs) !== "Array") {
|
|
14
|
+
throw { error: "createNewGroup: participantIDs should be an array." };//
|
|
15
|
+
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (participantIDs.length < 2) {
|
|
18
|
+
throw {
|
|
19
|
+
error: "createNewGroup: participantIDs should have at least 2 IDs.",
|
|
20
|
+
};
|
|
21
|
+
}
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
let resolveFunc = function () {};
|
|
24
|
+
let rejectFunc = function () {};
|
|
25
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
|
26
|
+
resolveFunc = resolve;
|
|
27
|
+
rejectFunc = reject;
|
|
28
|
+
});
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
if (!callback) {
|
|
31
|
+
callback = function (err, threadID) {
|
|
32
|
+
if (err) {
|
|
33
|
+
return rejectFunc(err);
|
|
34
|
+
}
|
|
35
|
+
resolveFunc(threadID);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const pids = [];
|
|
40
|
+
for (const n in participantIDs) {
|
|
41
|
+
pids.push({
|
|
42
|
+
fbid: participantIDs[n],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
pids.push({ fbid: ctx.userID });
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
const form = {
|
|
48
|
+
fb_api_caller_class: "RelayModern",
|
|
49
|
+
fb_api_req_friendly_name: "MessengerGroupCreateMutation",
|
|
50
|
+
av: ctx.userID,
|
|
51
|
+
//This doc_id is valid as of January 11th, 2020
|
|
52
|
+
doc_id: "577041672419534",
|
|
53
|
+
variables: JSON.stringify({
|
|
54
|
+
input: {
|
|
55
|
+
entry_point: "jewel_new_group",
|
|
56
|
+
actor_id: ctx.userID,
|
|
57
|
+
participants: pids,
|
|
58
|
+
client_mutation_id: Math.round(Math.random() * 1024).toString(),
|
|
59
|
+
thread_settings: {
|
|
60
|
+
name: groupTitle,
|
|
61
|
+
joinable_mode: "PRIVATE",
|
|
62
|
+
thread_image_fbid: null,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
defaultFuncs
|
|
69
|
+
.post("https://www.facebook.com/api/graphql/", ctx.jar, form)
|
|
70
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
71
|
+
.then(function (resData) {
|
|
72
|
+
if (resData.errors) {
|
|
73
|
+
throw resData;
|
|
74
|
+
}
|
|
75
|
+
return callback(
|
|
76
|
+
null,
|
|
77
|
+
resData.data.messenger_group_thread_create.thread.thread_key
|
|
78
|
+
.thread_fbid,
|
|
79
|
+
);
|
|
80
|
+
})
|
|
81
|
+
.catch(function (err) {
|
|
82
|
+
console.error("createNewGroup", err);
|
|
83
|
+
return callback(err);
|
|
84
|
+
});
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
return returnPromise;
|
|
87
|
+
};
|
|
86
88
|
};
|
package/src/createPoll.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const utils = require("../utils");
|
|
4
|
-
|
|
4
|
+
// @NethWs3Dev
|
|
5
5
|
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
return function createPoll(title, threadID, options, callback) {
|
|
8
|
+
let resolveFunc = function () {};
|
|
9
|
+
let rejectFunc = function () {};
|
|
10
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
|
11
|
+
resolveFunc = resolve;
|
|
12
|
+
rejectFunc = reject;
|
|
13
|
+
});
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
if (!callback) {
|
|
16
|
+
if (utils.getType(options) == "Function") {
|
|
17
|
+
callback = options;
|
|
18
|
+
options = null;
|
|
19
|
+
} else {
|
|
20
|
+
callback = function (err) {
|
|
21
|
+
if (err) {
|
|
22
|
+
return rejectFunc(err);
|
|
23
|
+
}
|
|
24
|
+
resolveFunc();
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!options) {
|
|
29
|
+
options = {}; // Initial poll options are optional
|
|
30
|
+
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const form = {
|
|
33
|
+
target_id: threadID,
|
|
34
|
+
question_text: title,
|
|
35
|
+
};
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
// Set fields for options (and whether they are selected initially by the posting user)
|
|
38
|
+
let ind = 0;
|
|
39
|
+
for (const opt in options) {
|
|
40
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
41
|
+
if (options.hasOwnProperty(opt)) {
|
|
42
|
+
form["option_text_array[" + ind + "]"] = opt;
|
|
43
|
+
form["option_is_selected_array[" + ind + "]"] = options[opt]
|
|
44
|
+
? "1"
|
|
45
|
+
: "0";
|
|
46
|
+
ind++;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
defaultFuncs
|
|
51
|
+
.post(
|
|
52
|
+
"https://www.facebook.com/messaging/group_polling/create_poll/?dpr=1",
|
|
53
|
+
ctx.jar,
|
|
54
|
+
form,
|
|
55
|
+
)
|
|
56
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
57
|
+
.then(function (resData) {
|
|
58
|
+
if (resData.payload.status != "success") {
|
|
59
|
+
throw resData;
|
|
60
|
+
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
return callback();
|
|
63
|
+
})
|
|
64
|
+
.catch(function (err) {
|
|
65
|
+
console.error("createPoll", err);
|
|
66
|
+
return callback(err);
|
|
67
|
+
});
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
return returnPromise;
|
|
70
|
+
};
|
|
71
71
|
};
|
package/src/deleteMessage.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const utils = require("../utils");
|
|
4
|
-
|
|
4
|
+
// @NethWs3Dev
|
|
5
5
|
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
7
|
+
return function deleteMessage(messageOrMessages, callback) {
|
|
8
|
+
let resolveFunc = function () {};
|
|
9
|
+
let rejectFunc = function () {};
|
|
10
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
|
11
|
+
resolveFunc = resolve;
|
|
12
|
+
rejectFunc = reject;
|
|
13
|
+
});
|
|
14
|
+
if (!callback) {
|
|
15
|
+
callback = function (err) {
|
|
16
|
+
if (err) {
|
|
17
|
+
return rejectFunc(err);
|
|
18
|
+
}
|
|
19
|
+
resolveFunc();
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const form = {
|
|
24
|
+
client: "mercury",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
if (utils.getType(messageOrMessages) !== "Array") {
|
|
28
|
+
messageOrMessages = [messageOrMessages];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < messageOrMessages.length; i++) {
|
|
32
|
+
form["message_ids[" + i + "]"] = messageOrMessages[i];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
defaultFuncs
|
|
36
|
+
.post(
|
|
37
|
+
"https://www.facebook.com/ajax/mercury/delete_messages.php",
|
|
38
|
+
ctx.jar,
|
|
39
|
+
form,
|
|
40
|
+
)
|
|
41
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
42
|
+
.then(function (resData) {
|
|
43
|
+
if (resData.error) {
|
|
44
|
+
throw resData;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return callback();
|
|
48
|
+
})
|
|
49
|
+
.catch(function (err) {
|
|
50
|
+
console.error("deleteMessage", err);
|
|
51
|
+
return callback(err);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return returnPromise;
|
|
55
|
+
};
|
|
56
56
|
};
|
package/src/deleteThread.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const utils = require("../utils");
|
|
4
|
-
|
|
4
|
+
// @NethWs3Dev
|
|
5
5
|
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
7
|
+
return function deleteThread(threadOrThreads, callback) {
|
|
8
|
+
let resolveFunc = function () {};
|
|
9
|
+
let rejectFunc = function () {};
|
|
10
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
|
11
|
+
resolveFunc = resolve;
|
|
12
|
+
rejectFunc = reject;
|
|
13
|
+
});
|
|
14
|
+
if (!callback) {
|
|
15
|
+
callback = function (err) {
|
|
16
|
+
if (err) {
|
|
17
|
+
return rejectFunc(err);
|
|
18
|
+
}
|
|
19
|
+
resolveFunc();
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const form = {
|
|
24
|
+
client: "mercury",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
if (utils.getType(threadOrThreads) !== "Array") {
|
|
28
|
+
threadOrThreads = [threadOrThreads];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < threadOrThreads.length; i++) {
|
|
32
|
+
form["ids[" + i + "]"] = threadOrThreads[i];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
defaultFuncs
|
|
36
|
+
.post(
|
|
37
|
+
"https://www.facebook.com/ajax/mercury/delete_thread.php",
|
|
38
|
+
ctx.jar,
|
|
39
|
+
form,
|
|
40
|
+
)
|
|
41
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
42
|
+
.then(function (resData) {
|
|
43
|
+
if (resData.error) {
|
|
44
|
+
throw resData;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return callback();
|
|
48
|
+
})
|
|
49
|
+
.catch(function (err) {
|
|
50
|
+
console.error("deleteThread", err);
|
|
51
|
+
return callback(err);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return returnPromise;
|
|
55
|
+
};
|
|
56
56
|
};
|
package/src/editMessage.js
CHANGED
|
@@ -1,66 +1,68 @@
|
|
|
1
1
|
"use_strict";
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
* @author RFS-ADRENO
|
|
4
|
+
* @rewrittenBy Isai Ivanov
|
|
5
|
+
*/
|
|
6
6
|
const generateOfflineThreadingId = require('../utils');
|
|
7
7
|
|
|
8
8
|
function canBeCalled(func) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
try {
|
|
10
|
+
Reflect.apply(func, null, []);
|
|
11
|
+
return true;
|
|
12
|
+
} catch (error) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
* A function for editing bot's messages.
|
|
19
|
+
* @param {string} text - The text with which the bot will edit its messages.
|
|
20
|
+
* @param {string} messageID - The message ID of the message the bot will edit.
|
|
21
|
+
* @param {Object} callback - Callback for the function.
|
|
22
|
+
*/
|
|
23
23
|
|
|
24
24
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
return function editMessage(text, messageID, callback) {
|
|
26
|
+
if (!ctx.mqttClient) {
|
|
27
|
+
throw new Error('Not connected to MQTT');
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
ctx.wsReqNumber += 1;
|
|
31
|
+
ctx.wsTaskNumber += 1;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const queryPayload = {
|
|
34
|
+
message_id: messageID,
|
|
35
|
+
text: text
|
|
36
|
+
};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
const query = {
|
|
39
|
+
failure_count: null,
|
|
40
|
+
label: '742',
|
|
41
|
+
payload: JSON.stringify(queryPayload),
|
|
42
|
+
queue_name: 'edit_message',
|
|
43
|
+
task_id: ctx.wsTaskNumber
|
|
44
|
+
};
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
const context = {
|
|
47
|
+
app_id: '2220391788200892',
|
|
48
|
+
payload: {
|
|
49
|
+
data_trace_id: null,
|
|
50
|
+
epoch_id: parseInt(generateOfflineThreadingId),
|
|
51
|
+
tasks: [query],
|
|
52
|
+
version_id: '6903494529735864'
|
|
53
|
+
},
|
|
54
|
+
request_id: ctx.wsReqNumber,
|
|
55
|
+
type: 3
|
|
56
|
+
};
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
context.payload = JSON.stringify(context.payload);
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
// if (canBeCalled(callback)) {
|
|
61
|
+
// ctx.reqCallbacks[ctx.wsReqNumber] = callback;
|
|
62
|
+
// }
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
64
|
+
ctx.mqttClient.publish('/ls_req', JSON.stringify(context), {
|
|
65
|
+
qos: 1, retain: false
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
};
|