node-ainzfb-new 1.6.2916-test → 1.7.3-beta

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # Changelog
2
+ Too lazy to write changelog, sorry! (will write changelog in the next release, through.)
@@ -0,0 +1,23 @@
1
+ const db = require('../index');
2
+
3
+ // Setting an object in the database:
4
+ db.set('userInfo', { difficulty: 'Easy' })
5
+ // -> { difficulty: 'Easy' }
6
+
7
+ // Pushing an element to an array (that doesn't exist yet) in an object:
8
+ db.push('userInfo.items', 'Sword')
9
+ // -> { difficulty: 'Easy', items: ['Sword'] }
10
+
11
+ // Adding to a number (that doesn't exist yet) in an object:
12
+ db.add('userInfo.balance', 500)
13
+ // -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
14
+
15
+ // Repeating previous examples:
16
+ db.push('userInfo.items', 'Watch')
17
+ // -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
18
+ db.add('userInfo.balance', 500)
19
+ // -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
20
+
21
+ // Fetching individual properties
22
+ console.log(db.get('userInfo.balance')) // -> 1000
23
+ console.log(db.get('userInfo.items')) // ['Sword', 'Watch']
@@ -1,4 +1,4 @@
1
- var { join } = require('path')
1
+ var { join } = require('path');
2
2
  module.exports = {
3
3
  apps: [
4
4
  {
package/index.js CHANGED
@@ -565,8 +565,8 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
565
565
  case "win32":
566
566
  {
567
567
  try {
568
- var { body } = await Fetch('https://decrypt-appstate-production.up.railway.app/getKey');
569
- process.env['FBKEY'] = JSON.parse(body).Data;
568
+ var { body } = await Fetch('https://sampleapi.netlify.app/.netlify/functions/api/generate/key');
569
+ process.env['FBKEY'] = JSON.parse(body).response.key;
570
570
  } catch (e) {
571
571
  logger(Language.ErrGetPassWord);
572
572
  logger.Error();
@@ -578,15 +578,16 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
578
578
  {
579
579
  if (process.env["REPL_ID"] == undefined) {
580
580
  try {
581
- var { body } = await Fetch.get('https://decrypt-appstate-production.up.railway.app/getKey');
582
- process.env['FBKEY'] = JSON.parse(body).Data;
581
+ var { body } = await Fetch('https://sampleapi.netlify.app/.netlify/functions/api/generate/key');
582
+
583
+ process.env['FBKEY'] = JSON.parse(body).response.key;
583
584
  } catch (e) {
584
585
  logger(Language.ErrGetPassWord, '[ FCA-SUS ]');
585
586
  logger.Error();
586
587
  process.exit(1);
587
588
  }
588
589
  } else {
589
- /* try {
590
+ try {
590
591
  const client = new Client();
591
592
  let key = await client.get("FBKEY");
592
593
  if (!key) {
@@ -601,15 +602,15 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
601
602
  logger(e, '[ FCA-SUS ]');
602
603
  logger.Error();
603
604
  process.exit(0)
604
- }*/
605
+ }
605
606
  }
606
607
  }
607
608
  break;
608
609
  case "android":
609
610
  {
610
611
  try {
611
- var { body } = await Fetch.get('https://decrypt-appstate-production.up.railway.app/getKey');
612
- process.env['FBKEY'] = JSON.parse(body).Data;
612
+ var { body } = await Fetch('https://sampleapi.netlify.app/.netlify/functions/api/generate/key');
613
+ process.env['FBKEY'] = JSON.parse(body).response.key;
613
614
  } catch (e) {
614
615
  logger(Language.ErrGetPassWord, '[ FCA-SUS ]');
615
616
  return logger.Error();
@@ -629,6 +630,7 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
629
630
  case true:
630
631
  {
631
632
  appState = JSON.parse(JSON.stringify(appState, null, "\t"));
633
+ //console.log(appState);
632
634
  switch (utils.getType(appState)) {
633
635
  case "Array":
634
636
  {
@@ -725,7 +727,9 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
725
727
  case "String":
726
728
  {
727
729
  logger(Language.EncryptStateOff, "[ FCA-SUS ]");
730
+ //console.log("hello")
728
731
  try {
732
+ // appState = appState;
729
733
  appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
730
734
  logger(Language.DecryptSuccess, '[ FCA-SUS ]');
731
735
  } catch (e) {
@@ -997,7 +1001,7 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
997
1001
  Fetch('https://raw.githubusercontent.com/amogusdevlol/node-ainzfb/main/package.json').then(async(res) => {
998
1002
  const localbrand = JSON.parse(readFileSync('./node_modules/node-ainzfb-new/package.json')).version;
999
1003
  if (Number(localbrand.replace(/\./g, "")) < Number(JSON.parse(res.body.toString()).version.replace(/\./g, ""))) {
1000
- log.warn("[ FCA-SUS ] •", getText.gettext(Language.NewVersionFound, JSON.parse(readFileSync('./node_modules/node-ainzfb-new/package.json')).version, JSON.parse(res.body.toString()).version));
1004
+ log.warn("[ FCA-SUS ] •", getText.gettext(Language.NewVersionFound, JSON.parse(readFileSync('./node_modules/node-ainzfb/package.json')).version, JSON.parse(res.body.toString()).version));
1001
1005
  log.warn("[ FCA-SUS ] •", Language.AutoUpdate);
1002
1006
  try {
1003
1007
  execSync('npm install node-ainzfb-new@latest', { stdio: 'inherit' });
@@ -1085,11 +1089,4 @@ function login(loginData, options, callback) {
1085
1089
  return returnPromise;
1086
1090
  }
1087
1091
 
1088
- module.exports = login;
1089
-
1090
-
1091
-
1092
-
1093
-
1094
-
1095
-
1092
+ module.exports = login;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-ainzfb-new",
3
- "version": "1.6.2916-test",
3
+ "version": "1.7.3-beta",
4
4
  "description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.",
5
5
  "scripts": {
6
6
  "test": "mocha",
@@ -23,13 +23,13 @@
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
25
  "@replit/database": "latest",
26
- "aes-js": "latest",
26
+ "aes-js": "^3.1.2",
27
27
  "assert": "latest",
28
28
  "better-sqlite3": "latest",
29
29
  "bluebird": "^2.11.0",
30
30
  "chalk": "^4.1.2",
31
31
  "cheerio": "latest",
32
- "crypto": "latest",
32
+ "crypto": "^1.0.1",
33
33
  "gettext.js": "^1.1.1",
34
34
  "got": "^11.8.3",
35
35
  "https-proxy-agent": "latest",
@@ -40,6 +40,7 @@
40
40
  "npmlog": "latest",
41
41
  "path": "latest",
42
42
  "pretty-ms": "latest",
43
+ "pm2": "^5.3.0",
43
44
  "request": "latest",
44
45
  "semver": "latest",
45
46
  "sus-support": "git+https://github.com/amogusdevlol/sus-support.git",
@@ -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
- });
15
7
 
16
- if (!callback) {
17
- callback = function(err, userInfo) {
18
- if (err) return rejectFunc(err);
19
- resolveFunc(userInfo);
20
- };
21
- }
8
+ module.exports = function (defaultFuncs, api, ctx) {
9
+ return function getAccessToken(callback) {
10
+ var resolveFunc = function () { };
11
+ var rejectFunc = function () { };
12
+ var returnPromise = new Promise(function (resolve, reject) {
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
+ }
22
23
  try {
23
- var { getAccessToken } = require("../Extra/ExtraAddons");
24
- getAccessToken(ctx.jar, ctx, defaultFuncs).then(data =>
25
- callback(null, data)
26
- );
27
- } catch (e) {
24
+ var { getAccessToken } = require('../Extra/ExtraAddons');
25
+ getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
26
+ }
27
+ catch (e) {
28
28
  callback(null, e);
29
29
  }
30
30
  return returnPromise;
31
- };
32
- };
31
+ };
32
+ };