alicezetion 1.8.3 → 1.8.4
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 +210 -375
- package/package.json +6 -3
- package/replit.nix +4 -4
- package/src/addExternalModule.js +17 -0
- package/src/addUserToGroup.js +113 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +55 -0
- package/src/changeAvatar.js +93 -0
- package/src/changeBio.js +77 -0
- package/src/changeBlockedStatus.js +47 -0
- package/src/changeCover.js +73 -0
- package/src/changeGroupImage.js +132 -0
- package/src/changeName.js +79 -0
- package/src/changeNickname.js +59 -0
- package/src/changeThreadColor.js +65 -0
- package/src/changeThreadEmoji.js +55 -0
- package/{leiamnash → src}/chat.js +28 -3
- package/src/createNewGroup.js +86 -0
- package/src/createPoll.js +71 -0
- package/src/data/getThreadInfo.json +1 -0
- package/src/deleteMessage.js +56 -0
- package/src/deleteThread.js +56 -0
- package/src/forwardAttachment.js +60 -0
- package/src/getAccess.js +112 -0
- package/src/getAvatarUser.js +78 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +29 -0
- package/src/getFriendsList.js +83 -0
- package/src/getThreadHistory.js +666 -0
- package/{leiamnash → src}/getThreadInfo.js +70 -54
- package/src/getThreadList.js +237 -0
- package/src/getThreadPictures.js +79 -0
- package/src/getUserID.js +66 -0
- package/src/getUserInfo.js +163 -0
- package/src/handleFriendRequest.js +61 -0
- package/src/handleMessageRequest.js +65 -0
- package/src/httpGet.js +57 -0
- package/src/httpPost.js +57 -0
- package/src/httpPostFormData.js +63 -0
- package/{leiamnash → src}/listenMqtt.js +16 -6
- package/src/listenNotification.js +88 -0
- package/src/logout.js +275 -0
- package/src/markAsDelivered.js +58 -0
- package/src/markAsRead.js +80 -0
- package/src/markAsReadAll.js +50 -0
- package/src/markAsSeen.js +59 -0
- package/src/muteThread.js +52 -0
- package/src/react.js +117 -0
- package/{leiamnash → src}/refreshFb_dtsg.js +1 -1
- package/src/removeUserFromGroup.js +79 -0
- package/src/resolvePhotoUrl.js +45 -0
- package/src/searchForThread.js +53 -0
- package/src/searchStickers.js +52 -0
- package/src/seen.js +50 -0
- package/src/sendMessage.js +477 -0
- package/src/sendMessageMqtt.js +316 -0
- package/src/sendTypingIndicator.js +103 -0
- package/src/setMessageReaction.js +117 -0
- package/src/setPostReaction.js +109 -0
- package/src/setTitle.js +86 -0
- package/src/threadColors.js +131 -0
- package/src/unfriend.js +52 -0
- package/src/unsendMessage.js +49 -0
- package/utils.js +135 -176
- package/.cache/replit/modules.stamp +0 -1
- package/leiamnash/addExternalModule.js +0 -15
- package/leiamnash/addUserToGroup.js +0 -77
- package/leiamnash/changeAdminStatus.js +0 -47
- package/leiamnash/changeArchivedStatus.js +0 -41
- package/leiamnash/changeAvatar.js +0 -127
- package/leiamnash/changeBio.js +0 -64
- package/leiamnash/changeBlockedStatus.js +0 -36
- package/leiamnash/changeGroupImage.js +0 -105
- package/leiamnash/changeNickname.js +0 -43
- package/leiamnash/changeThreadColor.js +0 -61
- package/leiamnash/changeThreadEmoji.js +0 -41
- package/leiamnash/createNewGroup.js +0 -70
- package/leiamnash/createPoll.js +0 -59
- package/leiamnash/deleteMessage.js +0 -44
- package/leiamnash/deleteThread.js +0 -42
- package/leiamnash/forwardAttachment.js +0 -47
- package/leiamnash/forwardMessage.js +0 -0
- package/leiamnash/getCurrentUserID.js +0 -7
- package/leiamnash/getEmojiUrl.js +0 -27
- package/leiamnash/getFriendsList.js +0 -73
- package/leiamnash/getInfoVideo.js +0 -134
- package/leiamnash/getThreadHistory.js +0 -537
- package/leiamnash/getThreadHistoryDeprecated.js +0 -71
- package/leiamnash/getThreadInfoDeprecated.js +0 -56
- package/leiamnash/getThreadList.js +0 -213
- package/leiamnash/getThreadListDeprecated.js +0 -46
- package/leiamnash/getThreadPictures.js +0 -59
- package/leiamnash/getUserID.js +0 -61
- package/leiamnash/getUserInfo.js +0 -66
- package/leiamnash/handleFriendRequest.js +0 -46
- package/leiamnash/handleMessageRequest.js +0 -47
- package/leiamnash/httpGet.js +0 -47
- package/leiamnash/httpPost.js +0 -47
- package/leiamnash/httpPostFormData.js +0 -42
- package/leiamnash/logout.js +0 -68
- package/leiamnash/markAsDelivered.js +0 -47
- package/leiamnash/markAsRead.js +0 -70
- package/leiamnash/markAsReadAll.js +0 -40
- package/leiamnash/markAsSeen.js +0 -48
- package/leiamnash/muteThread.js +0 -45
- package/leiamnash/react.js +0 -109
- package/leiamnash/removeUserFromGroup.js +0 -45
- package/leiamnash/resolvePhotoUrl.js +0 -36
- package/leiamnash/searchForThread.js +0 -42
- package/leiamnash/seen.js +0 -40
- package/leiamnash/sendMessage.js +0 -315
- package/leiamnash/sendTypingIndicator.js +0 -70
- package/leiamnash/setMessageReaction.js +0 -103
- package/leiamnash/setPostReaction.js +0 -63
- package/leiamnash/setTitle.js +0 -70
- package/leiamnash/threadColors.js +0 -41
- package/leiamnash/unfriend.js +0 -42
- package/leiamnash/unsendMessage.js +0 -39
- package/leiamnash/uploadAttachment.js +0 -96
- /package/{leiamnash → src}/getMessage.js +0 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
const 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
|
+
let resolveFunc = function () { };
|
15
|
+
let rejectFunc = function () { };
|
16
|
+
const 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
|
+
const form = {
|
31
|
+
viewer_id: ctx.i_userID || 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
|
+
};
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
const 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
|
+
let resolveFunc = function () { };
|
15
|
+
let rejectFunc = function () { };
|
16
|
+
const 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
|
+
const form = {
|
31
|
+
client: "mercury"
|
32
|
+
};
|
33
|
+
|
34
|
+
if (utils.getType(threadID) !== "Array") {
|
35
|
+
threadID = [threadID];
|
36
|
+
}
|
37
|
+
|
38
|
+
const messageBox = accept ? "inbox" : "other";
|
39
|
+
|
40
|
+
for (let 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/src/httpGet.js
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
const log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function httpGet(url, form, customHeader, callback, notAPI) {
|
8
|
+
let resolveFunc = function () { };
|
9
|
+
let rejectFunc = function () { };
|
10
|
+
|
11
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
12
|
+
resolveFunc = resolve;
|
13
|
+
rejectFunc = reject;
|
14
|
+
});
|
15
|
+
|
16
|
+
if (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction") {
|
17
|
+
callback = form;
|
18
|
+
form = {};
|
19
|
+
}
|
20
|
+
|
21
|
+
if (utils.getType(customHeader) == "Function" || utils.getType(customHeader) == "AsyncFunction") {
|
22
|
+
callback = customHeader;
|
23
|
+
customHeader = {};
|
24
|
+
}
|
25
|
+
|
26
|
+
customHeader = customHeader || {};
|
27
|
+
|
28
|
+
callback = callback || function (err, data) {
|
29
|
+
if (err) return rejectFunc(err);
|
30
|
+
resolveFunc(data);
|
31
|
+
};
|
32
|
+
|
33
|
+
if (notAPI) {
|
34
|
+
utils
|
35
|
+
.get(url, ctx.jar, form, ctx.globalOptions, ctx, customHeader)
|
36
|
+
.then(function (resData) {
|
37
|
+
callback(null, resData.body.toString());
|
38
|
+
})
|
39
|
+
.catch(function (err) {
|
40
|
+
log.error("httpGet", err);
|
41
|
+
return callback(err);
|
42
|
+
});
|
43
|
+
} else {
|
44
|
+
defaultFuncs
|
45
|
+
.get(url, ctx.jar, form, null, customHeader)
|
46
|
+
.then(function (resData) {
|
47
|
+
callback(null, resData.body.toString());
|
48
|
+
})
|
49
|
+
.catch(function (err) {
|
50
|
+
log.error("httpGet", err);
|
51
|
+
return callback(err);
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
return returnPromise;
|
56
|
+
};
|
57
|
+
};
|
package/src/httpPost.js
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
const log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function httpPost(url, form, customHeader, callback, notAPI) {
|
8
|
+
let resolveFunc = function () { };
|
9
|
+
let rejectFunc = function () { };
|
10
|
+
|
11
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
12
|
+
resolveFunc = resolve;
|
13
|
+
rejectFunc = reject;
|
14
|
+
});
|
15
|
+
|
16
|
+
if (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction") {
|
17
|
+
callback = form;
|
18
|
+
form = {};
|
19
|
+
}
|
20
|
+
|
21
|
+
if (utils.getType(customHeader) == "Function" || utils.getType(customHeader) == "AsyncFunction") {
|
22
|
+
callback = customHeader;
|
23
|
+
customHeader = {};
|
24
|
+
}
|
25
|
+
|
26
|
+
customHeader = customHeader || {};
|
27
|
+
|
28
|
+
callback = callback || function (err, data) {
|
29
|
+
if (err) return rejectFunc(err);
|
30
|
+
resolveFunc(data);
|
31
|
+
};
|
32
|
+
|
33
|
+
if (notAPI) {
|
34
|
+
utils
|
35
|
+
.post(url, ctx.jar, form, ctx.globalOptions, ctx, customHeader)
|
36
|
+
.then(function (resData) {
|
37
|
+
callback(null, resData.body.toString());
|
38
|
+
})
|
39
|
+
.catch(function (err) {
|
40
|
+
log.error("httpPost", err);
|
41
|
+
return callback(err);
|
42
|
+
});
|
43
|
+
} else {
|
44
|
+
defaultFuncs
|
45
|
+
.post(url, ctx.jar, form, {}, customHeader)
|
46
|
+
.then(function (resData) {
|
47
|
+
callback(null, resData.body.toString());
|
48
|
+
})
|
49
|
+
.catch(function (err) {
|
50
|
+
log.error("httpPost", err);
|
51
|
+
return callback(err);
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
return returnPromise;
|
56
|
+
};
|
57
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
const log = require("npmlog");
|
5
|
+
|
6
|
+
|
7
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
8
|
+
return function httpPostFormData(url, form, customHeader, callback, notAPI) {
|
9
|
+
let resolveFunc = function () { };
|
10
|
+
let rejectFunc = function () { };
|
11
|
+
|
12
|
+
const returnPromise = new Promise(function (resolve, reject) {
|
13
|
+
resolveFunc = resolve;
|
14
|
+
rejectFunc = reject;
|
15
|
+
});
|
16
|
+
|
17
|
+
if (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction") {
|
18
|
+
callback = form;
|
19
|
+
form = {};
|
20
|
+
}
|
21
|
+
|
22
|
+
if (utils.getType(customHeader) == "Function" || utils.getType(customHeader) == "AsyncFunction") {
|
23
|
+
callback = customHeader;
|
24
|
+
customHeader = {};
|
25
|
+
}
|
26
|
+
|
27
|
+
customHeader = customHeader || {};
|
28
|
+
|
29
|
+
if (utils.getType(callback) == "Boolean") {
|
30
|
+
notAPI = callback;
|
31
|
+
callback = null;
|
32
|
+
}
|
33
|
+
|
34
|
+
callback = callback || function (err, data) {
|
35
|
+
if (err) return rejectFunc(err);
|
36
|
+
resolveFunc(data);
|
37
|
+
};
|
38
|
+
|
39
|
+
if (notAPI) {
|
40
|
+
utils
|
41
|
+
.postFormData(url, ctx.jar, form, ctx.globalOptions, ctx, customHeader)
|
42
|
+
.then(function (resData) {
|
43
|
+
callback(null, resData.body.toString());
|
44
|
+
})
|
45
|
+
.catch(function (err) {
|
46
|
+
log.error("httpPostFormData", err);
|
47
|
+
return callback(err);
|
48
|
+
});
|
49
|
+
} else {
|
50
|
+
defaultFuncs
|
51
|
+
.postFormData(url, ctx.jar, form, null, customHeader)
|
52
|
+
.then(function (resData) {
|
53
|
+
callback(null, resData.body.toString());
|
54
|
+
})
|
55
|
+
.catch(function (err) {
|
56
|
+
log.error("httpPostFormData", err);
|
57
|
+
return callback(err);
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
return returnPromise;
|
62
|
+
};
|
63
|
+
};
|
@@ -109,10 +109,19 @@ function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
|
|
109
109
|
if (ctx.globalOptions.autoReconnect) {
|
110
110
|
listenMqtt(defaultFuncs, api, ctx, globalCallback);
|
111
111
|
} else {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
112
|
+
utils.checkLiveCookie(ctx, defaultFuncs)
|
113
|
+
.then(res => {
|
114
|
+
globalCallback({
|
115
|
+
type: "stop_listen",
|
116
|
+
error: "Connection refused: Server unavailable"
|
117
|
+
}, null);
|
118
|
+
})
|
119
|
+
.catch(err => {
|
120
|
+
globalCallback({
|
121
|
+
type: "account_inactive",
|
122
|
+
error: "Maybe your account is blocked by facebook, please login and check at https://facebook.com"
|
123
|
+
}, null);
|
124
|
+
});
|
116
125
|
}
|
117
126
|
});
|
118
127
|
|
@@ -363,7 +372,7 @@ function parseDelta(defaultFuncs, api, ctx, globalCallback, v) {
|
|
363
372
|
.otherUserFbId).toString(),
|
364
373
|
messageID: delta.deltaMessageReply.message.messageMetadata.messageId,
|
365
374
|
senderID: delta.deltaMessageReply.message.messageMetadata.actorFbId.toString(),
|
366
|
-
attachments: delta.deltaMessageReply.message.attachments.map(function (att) {
|
375
|
+
attachments: (delta.deltaMessageReply.message.attachments || []).map(function (att) {
|
367
376
|
const mercury = JSON.parse(att.mercuryJSON);
|
368
377
|
Object.assign(att, mercury);
|
369
378
|
return att;
|
@@ -382,7 +391,7 @@ function parseDelta(defaultFuncs, api, ctx, globalCallback, v) {
|
|
382
391
|
isGroup: !!delta.deltaMessageReply.message.messageMetadata.threadKey.threadFbId,
|
383
392
|
mentions: mentions,
|
384
393
|
timestamp: delta.deltaMessageReply.message.messageMetadata.timestamp,
|
385
|
-
participantIDs: (delta.deltaMessageReply.message.messageMetadata.cid.canonicalParticipantFbids || []).map(e => e.toString())
|
394
|
+
participantIDs: (delta.deltaMessageReply.message.messageMetadata.cid.canonicalParticipantFbids || delta.deltaMessageReply.message.participants || []).map(e => e.toString())
|
386
395
|
};
|
387
396
|
|
388
397
|
if (delta.deltaMessageReply.repliedToMessage) {
|
@@ -543,6 +552,7 @@ function parseDelta(defaultFuncs, api, ctx, globalCallback, v) {
|
|
543
552
|
case "change_thread_theme":
|
544
553
|
case "change_thread_nickname":
|
545
554
|
case "change_thread_icon":
|
555
|
+
case "change_thread_quick_reaction":
|
546
556
|
case "change_thread_admins":
|
547
557
|
case "group_poll":
|
548
558
|
case "joinable_group_link_mode_change":
|
@@ -0,0 +1,88 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var utils = require('../utils.js');
|
4
|
+
var log = require('npmlog');
|
5
|
+
|
6
|
+
function formatGraphResponse(data) {
|
7
|
+
var Obj = [];
|
8
|
+
var convertMS = function (ms, date) {
|
9
|
+
var time = (date - ms) / 1000;
|
10
|
+
return time;
|
11
|
+
};
|
12
|
+
var edges = data.viewer.notifications_page.edges;
|
13
|
+
|
14
|
+
for (let res of edges) {
|
15
|
+
res = res.node;
|
16
|
+
if (res.row_type !== 'NOTIFICATION') continue;
|
17
|
+
var timestamp = res.notif.creation_time.timestamp * 1000;
|
18
|
+
if (convertMS(timestamp, Date.now()) > 60) break;
|
19
|
+
var data = {
|
20
|
+
id: res.notif.id,
|
21
|
+
noti_id: res.notif.notif_id,
|
22
|
+
type: res.notif.notif_type,
|
23
|
+
body: res.notif.body,
|
24
|
+
url: res.notif.url,
|
25
|
+
timestamp
|
26
|
+
}
|
27
|
+
Obj.push(data);
|
28
|
+
}
|
29
|
+
|
30
|
+
return Obj;
|
31
|
+
}
|
32
|
+
|
33
|
+
module.exports = function (http, api, ctx) {
|
34
|
+
function listen(callback) {
|
35
|
+
var interval = setInterval(function (form) {
|
36
|
+
return http
|
37
|
+
.post('https://www.facebook.com/api/graphql/', ctx.jar, form)
|
38
|
+
.then(utils.parseAndCheckLogin(ctx, http))
|
39
|
+
.then(function (res) {
|
40
|
+
if (res.error) throw res;
|
41
|
+
return http
|
42
|
+
.post('https://www.facebook.com/ajax/navigation/', ctx.jar, {
|
43
|
+
client_previous_actor_id: '',
|
44
|
+
route_url: '/notifications',
|
45
|
+
routing_namespace: 'fb_comet'
|
46
|
+
})
|
47
|
+
.then(utils.parseAndCheckLogin(ctx, http))
|
48
|
+
.then(function () {
|
49
|
+
return callback(null, formatGraphResponse(res.data));
|
50
|
+
});
|
51
|
+
})
|
52
|
+
.catch(function (err) {
|
53
|
+
log.error('listenNotification', err);
|
54
|
+
return callback(err);
|
55
|
+
});
|
56
|
+
}, 60000, {
|
57
|
+
fb_api_req_friendly_name: "CometNotificationsRootQuery",
|
58
|
+
doc_id: "6663491207045267",
|
59
|
+
variables: JSON.stringify({
|
60
|
+
count: 15,
|
61
|
+
environment: "MAIN_SURFACE",
|
62
|
+
filter_tokens: ["Cg8CZnQPA2FsbAE="],
|
63
|
+
scale: 1
|
64
|
+
}),
|
65
|
+
server_timestamps: !0
|
66
|
+
});
|
67
|
+
|
68
|
+
return function stopListen() {
|
69
|
+
return clearInterval(interval);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
return function GraphNoti(callback) {
|
74
|
+
if (typeof callback != 'function') {
|
75
|
+
var error = new Error('callback is not a function');
|
76
|
+
log.error('listenNotification', error);
|
77
|
+
return error;
|
78
|
+
}
|
79
|
+
|
80
|
+
try {
|
81
|
+
var rCb = listen(callback);
|
82
|
+
return rCb;
|
83
|
+
} catch (err) {
|
84
|
+
log.error('listenNotification', err);
|
85
|
+
return err;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|