node-ainzfb-new 1.7.9-uOw19mf → 1.7.10-11
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +83 -41
- package/package.json +2 -2
- package/src/changeAvt.js +73 -73
- package/src/editMessage.js +29 -26
- package/src/getAccessToken.js +21 -21
- package/src/getThreadInfo.js +3423 -18
- package/src/getUserInfoV2.js +19 -22
- package/src/pinMessage.js +61 -0
- package/src/shareContact.js +56 -0
- package/src/shareLink.js +57 -0
- package/utils.js +1452 -1131
package/src/getAccessToken.js
CHANGED
@@ -4,29 +4,29 @@
|
|
4
4
|
var utils = require("../utils");
|
5
5
|
var log = require("npmlog");
|
6
6
|
|
7
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
8
|
+
return function getAccessToken(callback) {
|
9
|
+
var resolveFunc = function() {};
|
10
|
+
var rejectFunc = function() {};
|
11
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
12
|
+
resolveFunc = resolve;
|
13
|
+
rejectFunc = reject;
|
14
|
+
});
|
7
15
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
resolveFunc = resolve;
|
14
|
-
rejectFunc = reject;
|
15
|
-
});
|
16
|
-
|
17
|
-
if (!callback) {
|
18
|
-
callback = function (err, userInfo) {
|
19
|
-
if (err) return rejectFunc(err);
|
20
|
-
resolveFunc(userInfo);
|
21
|
-
};
|
22
|
-
}
|
23
|
-
try {
|
24
|
-
var { getAccessToken } = require('../Extra/ExtraAddons');
|
25
|
-
getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
|
16
|
+
if (!callback) {
|
17
|
+
callback = function(err, userInfo) {
|
18
|
+
if (err) return rejectFunc(err);
|
19
|
+
resolveFunc(userInfo);
|
20
|
+
};
|
26
21
|
}
|
27
|
-
|
22
|
+
try {
|
23
|
+
var { getAccessToken } = require("../Extra/ExtraAddons");
|
24
|
+
getAccessToken(ctx.jar, ctx, defaultFuncs).then(data =>
|
25
|
+
callback(null, data)
|
26
|
+
);
|
27
|
+
} catch (e) {
|
28
28
|
callback(null, e);
|
29
29
|
}
|
30
30
|
return returnPromise;
|
31
|
-
|
32
|
-
|
31
|
+
};
|
32
|
+
};
|