fb-anya 0.0.1-security → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fb-anya might be problematic. Click here for more details.
- package/.cache/replit/__replit_disk_meta.json +1 -0
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.config/configstore/update-notifier-npm.json +4 -0
- package/.gitattributes +2 -0
- package/Extra/ExtraAddons.js +78 -0
- package/Extra/ExtraFindUID.js +60 -0
- package/Extra/ExtraGetThread.js +118 -0
- package/Extra/ExtraTranslate.js +62 -0
- package/Extra/ExtraUptimeRobot.js +59 -0
- package/Extra/Html/Classic/script.js +231 -0
- package/Extra/Html/Classic/style.css +149 -0
- package/Extra/PM2/ecosystem.config.js +23 -0
- package/Extra/Security/Index.js +174 -0
- package/Extra/Security/Step_1.js +15 -0
- package/Extra/Security/Step_2.js +23 -0
- package/Extra/Security/Step_3.js +23 -0
- package/Extra/Src/History.js +115 -0
- package/Extra/Src/Last-Run.js +65 -0
- package/Extra/Src/Premium.js +85 -0
- package/Extra/Src/SecurityCheck.js +2 -0
- package/Func/AcceptAgreement.js +33 -0
- package/Func/ClearCache.js +63 -0
- package/Func/ReportV1.js +54 -0
- package/Language/index.json +176 -0
- package/OldSecurity.js +100 -0
- package/README.md +16 -3
- package/Settings/Database.js +21 -0
- package/Settings/Location.js +60 -0
- package/Settings/Location.json +24 -0
- package/Settings/Settings.js +60 -0
- package/StateCrypt.js +98 -0
- package/broadcast.js +38 -0
- package/index.js +1451 -0
- package/logger.js +65 -0
- package/package-anya/Database-Anya/index.js +358 -0
- package/package-anya/Database-Anya/package.json +63 -0
- package/package-anya/Database-Anya/readme.md +8 -0
- package/package-anya/anya-sp/README.md +11 -0
- package/package-anya/anya-sp/desktop.ini +2 -0
- package/package-anya/anya-sp/index.js +41 -0
- package/package-anya/anya-sp/logger.js +16 -0
- package/package-anya/anya-sp/package.json +54 -0
- package/package.json +84 -4
- package/src/K2IMG.js +8 -0
- package/src/Premium.js +30 -0
- package/src/Screenshot.js +77 -0
- package/src/T2S.js +8 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +79 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +85 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -0
- package/src/changeNickname.js +45 -0
- package/src/changeThreadColor.js +62 -0
- package/src/changeThreadEmoji.js +42 -0
- package/src/createNewGroup.js +70 -0
- package/src/createPoll.js +60 -0
- package/src/deleteMessage.js +45 -0
- package/src/deleteThread.js +43 -0
- package/src/desktop.ini +2 -0
- package/src/forwardAttachment.js +48 -0
- package/src/getAccessToken.js +32 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +80 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadInfo.js +346 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadMain.js +219 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUID.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +129 -0
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +35 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +49 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/httpPostFormData.js +41 -0
- package/src/listenMqtt.js +725 -0
- package/src/logout.js +68 -0
- package/src/markAsDelivered.js +48 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +43 -0
- package/src/markAsSeen.js +51 -0
- package/src/muteThread.js +47 -0
- package/src/removeUserFromGroup.js +49 -0
- package/src/resolvePhotoUrl.js +37 -0
- package/src/searchForThread.js +43 -0
- package/src/sendMessage.js +334 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +102 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +39 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -0
- package/utils.js +1648 -0
package/logger.js
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
/* eslint-disable linebreak-style */
|
2
|
+
|
3
|
+
const chalk = require('chalk');
|
4
|
+
var isHexcolor = require('is-hexcolor');
|
5
|
+
var getText = function(/** @type {string[]} */ ...Data) {
|
6
|
+
var Main = (Data.splice(0,1)).toString();
|
7
|
+
for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
|
8
|
+
return Main;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* @param {any} obj
|
12
|
+
*/
|
13
|
+
function getType(obj) {
|
14
|
+
return Object.prototype.toString.call(obj).slice(8, -1);
|
15
|
+
}
|
16
|
+
|
17
|
+
module.exports = {
|
18
|
+
Normal: function(/** @type {string} */ Str, /** @type {() => any} */ Data ,/** @type {() => void} */ Callback) {
|
19
|
+
if (isHexcolor(global.Fca.Require.FastConfig.MainColor) != true) {
|
20
|
+
this.Warning(getText(global.Fca.Require.Language.Index.InvaildMainColor,global.Fca.Require.FastConfig.MainColor),process.exit(0));
|
21
|
+
}
|
22
|
+
else console.log(chalk.hex(global.Fca.Require.FastConfig.MainColor).bold(`${global.Fca.Require.FastConfig.MainName || '[ FB-ANYA ]'} > `) + Str);
|
23
|
+
if (getType(Data) == 'Function' || getType(Data) == 'AsyncFunction') {
|
24
|
+
return Data()
|
25
|
+
}
|
26
|
+
if (Data) {
|
27
|
+
return Data;
|
28
|
+
}
|
29
|
+
if (getType(Callback) == 'Function' || getType(Callback) == 'AsyncFunction') {
|
30
|
+
Callback();
|
31
|
+
}
|
32
|
+
else return Callback;
|
33
|
+
},
|
34
|
+
Warning: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
35
|
+
console.log(chalk.magenta.bold('[ FCA-WARNING ] > ') + chalk.yellow(str));
|
36
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
37
|
+
callback();
|
38
|
+
}
|
39
|
+
else return callback;
|
40
|
+
},
|
41
|
+
Error: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
42
|
+
if (!str) {
|
43
|
+
console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red("Already Faulty, Please Contact: https://www.facebook.com/profile.php?id=100084149373287\nor https://www.facebook.com/Lazic.Kanzu?mibextid=ZbWKwL"));
|
44
|
+
}
|
45
|
+
console.log(chalk.magenta.bold('[ FB-ERROR ] > ') + chalk.red(str));
|
46
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
47
|
+
callback();
|
48
|
+
}
|
49
|
+
else return callback;
|
50
|
+
},
|
51
|
+
Success: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
52
|
+
console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA-ANYA ]'} > `) + chalk.green(str));
|
53
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
54
|
+
callback();
|
55
|
+
}
|
56
|
+
else return callback;
|
57
|
+
},
|
58
|
+
Info: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
59
|
+
console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FB-ANYA ]'} > `) + chalk.blue(str));
|
60
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
61
|
+
callback();
|
62
|
+
}
|
63
|
+
else return callback;
|
64
|
+
}
|
65
|
+
}
|
@@ -0,0 +1,358 @@
|
|
1
|
+
var get = require('lodash/get'),
|
2
|
+
set = require('lodash/set'),
|
3
|
+
fetch = require("node-fetch"),
|
4
|
+
BetterDB = require("better-sqlite3"),
|
5
|
+
db = new BetterDB(__dirname + "/SyntheticDatabase.sqlite");
|
6
|
+
|
7
|
+
module.exports = {
|
8
|
+
get: function(key, ops,forceFuction) {
|
9
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
10
|
+
if (!key)
|
11
|
+
throw new TypeError(
|
12
|
+
"No key specified."
|
13
|
+
);
|
14
|
+
return arbitrate("fetch", { id: key, ops: ops || {} });
|
15
|
+
}
|
16
|
+
else return fetch(process.env.REPLIT_DB_URL + "/" + key)
|
17
|
+
.then((e) => e.text())
|
18
|
+
.then((strValue) => {
|
19
|
+
if (ops && ops.raw) return strValue;
|
20
|
+
if (!strValue) return null;
|
21
|
+
try {
|
22
|
+
var value = JSON.parse(strValue);
|
23
|
+
} catch (_err) {
|
24
|
+
throw new SyntaxError(
|
25
|
+
`Failed to parse value of ${key}, try passing a raw option to get the raw value`
|
26
|
+
);
|
27
|
+
}
|
28
|
+
if (value === null || value === undefined) {
|
29
|
+
return null;
|
30
|
+
}
|
31
|
+
return value;
|
32
|
+
});
|
33
|
+
},
|
34
|
+
|
35
|
+
set: function(key, value,forceFuction) {
|
36
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
37
|
+
if (!key)
|
38
|
+
throw new TypeError(
|
39
|
+
"No key specified."
|
40
|
+
);
|
41
|
+
return arbitrate("set",{
|
42
|
+
stringify: false,
|
43
|
+
id: key,
|
44
|
+
data: value,
|
45
|
+
ops: {},
|
46
|
+
});
|
47
|
+
}
|
48
|
+
else return fetch(process.env.REPLIT_DB_URL, {
|
49
|
+
method: "POST",
|
50
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
51
|
+
body: encodeURIComponent(key) + "=" + encodeURIComponent(JSON.stringify(value)),
|
52
|
+
});
|
53
|
+
},
|
54
|
+
has: function(key,forceFuction) {
|
55
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
56
|
+
if (!key)
|
57
|
+
throw new TypeError(
|
58
|
+
"No key specified."
|
59
|
+
);
|
60
|
+
return arbitrate("has", { id: key, ops: {} });
|
61
|
+
}
|
62
|
+
else return fetch(process.env.REPLIT_DB_URL + "/" + key)
|
63
|
+
.then((e) => e.text())
|
64
|
+
.then((strValue) => {
|
65
|
+
if (strValue === "") return false;
|
66
|
+
return true;
|
67
|
+
});
|
68
|
+
},
|
69
|
+
delete: function(key,forceFuction) {
|
70
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
71
|
+
if (!key)
|
72
|
+
throw new TypeError(
|
73
|
+
"No key specified."
|
74
|
+
);
|
75
|
+
return arbitrate("delete", { id: key, ops: {} });
|
76
|
+
}
|
77
|
+
else return fetch(process.env.REPLIT_DB_URL + "/" + key, {
|
78
|
+
method: "DELETE",
|
79
|
+
});
|
80
|
+
},
|
81
|
+
|
82
|
+
deleteMultiple: function(forceFuction,...args) {
|
83
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
84
|
+
if (!key)
|
85
|
+
throw new TypeError(
|
86
|
+
"No key specified."
|
87
|
+
);
|
88
|
+
try {
|
89
|
+
for (let i of args) {
|
90
|
+
arbitrate("delete", { id: i, ops: {} });
|
91
|
+
}
|
92
|
+
return true;
|
93
|
+
}
|
94
|
+
catch (err) {
|
95
|
+
return false;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
const promises = [];
|
100
|
+
|
101
|
+
for (const arg of args) {
|
102
|
+
promises.push(this.delete(arg));
|
103
|
+
}
|
104
|
+
|
105
|
+
Promise.all(promises);
|
106
|
+
|
107
|
+
return this;
|
108
|
+
}
|
109
|
+
},
|
110
|
+
|
111
|
+
empty: async function(forceFuction) {
|
112
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
113
|
+
return arbitrate("clear");
|
114
|
+
}
|
115
|
+
else {
|
116
|
+
const promises = [];
|
117
|
+
for (const key of await this.list()) {
|
118
|
+
promises.push(this.delete(key));
|
119
|
+
}
|
120
|
+
|
121
|
+
Promise.all(promises);
|
122
|
+
|
123
|
+
return this;
|
124
|
+
}
|
125
|
+
},
|
126
|
+
|
127
|
+
list: async function(forceFuction) {
|
128
|
+
if (process.env["REPL_ID"] == undefined || forceFuction) {
|
129
|
+
return arbitrate("all",{ ops: {} });
|
130
|
+
}
|
131
|
+
else {
|
132
|
+
return fetch(
|
133
|
+
this.key + `?encode=true&prefix=${encodeURIComponent(true)}`
|
134
|
+
)
|
135
|
+
.then((r) => r.text())
|
136
|
+
.then((t) => {
|
137
|
+
if (t.length === 0) {
|
138
|
+
return [];
|
139
|
+
}
|
140
|
+
return t.split("\n").map(decodeURIComponent);
|
141
|
+
});
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
var methods = {
|
147
|
+
fetch: function(db, params, options) {
|
148
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
149
|
+
if (!fetched) return null;
|
150
|
+
try {
|
151
|
+
fetched = JSON.parse(fetched.json)
|
152
|
+
} catch (e) {
|
153
|
+
fetched = fetched.json;
|
154
|
+
}
|
155
|
+
if (params.ops.target) fetched = get(fetched, params.ops.target);
|
156
|
+
return fetched;
|
157
|
+
},
|
158
|
+
set: function(db, params, options) {
|
159
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
160
|
+
if (!fetched) {
|
161
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
162
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
163
|
+
}
|
164
|
+
try {
|
165
|
+
fetched = JSON.parse(fetched);
|
166
|
+
} catch (e) {
|
167
|
+
fetched = fetched;
|
168
|
+
}
|
169
|
+
if (typeof fetched === 'object' && params.ops.target) {
|
170
|
+
params.data = JSON.parse(params.data);
|
171
|
+
params.data = set(fetched, params.ops.target, params.data);
|
172
|
+
}
|
173
|
+
else if (params.ops.target) throw new TypeError('Cannot target a non-object.');
|
174
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(JSON.stringify(params.data), params.id);
|
175
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
176
|
+
if (newData === '{}') return null;
|
177
|
+
else {
|
178
|
+
try { newData = JSON.parse(newData);
|
179
|
+
}
|
180
|
+
catch (e) {
|
181
|
+
newData = newData;
|
182
|
+
}
|
183
|
+
return newData;
|
184
|
+
}
|
185
|
+
},
|
186
|
+
add: function addDB(db, params, options) {
|
187
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
188
|
+
if (!fetched) {
|
189
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
190
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
191
|
+
}
|
192
|
+
if (params.ops.target) {
|
193
|
+
try {
|
194
|
+
fetched = JSON.parse(fetched)
|
195
|
+
}
|
196
|
+
catch (e) {
|
197
|
+
fetched = fetched;
|
198
|
+
}
|
199
|
+
let oldValue = get(fetched, params.ops.target);
|
200
|
+
if (oldValue === undefined) oldValue = 0;
|
201
|
+
else if (isNaN(oldValue)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched}\nEXPECTED: number`);
|
202
|
+
params.data = set(fetched, params.ops.target, oldValue + JSON.parse(params.data));
|
203
|
+
}
|
204
|
+
else {
|
205
|
+
if (fetched.json === '{}') fetched.json = 0;
|
206
|
+
try {
|
207
|
+
fetched.json = JSON.parse(fetched)
|
208
|
+
} catch (e) {
|
209
|
+
fetched.json = fetched.json;
|
210
|
+
}
|
211
|
+
if (isNaN(fetched.json)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched.json}\nEXPECTED: number`);
|
212
|
+
params.data = parseInt(fetched.json, 10) + parseInt(params.data, 10);
|
213
|
+
}
|
214
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(JSON.stringify(params.data), params.id);
|
215
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
216
|
+
if (newData === '{}') return null;
|
217
|
+
else {
|
218
|
+
try {
|
219
|
+
newData = JSON.parse(newData);
|
220
|
+
}
|
221
|
+
catch (e) {
|
222
|
+
newData = newData;
|
223
|
+
}
|
224
|
+
return newData;
|
225
|
+
}
|
226
|
+
},
|
227
|
+
subtract: function subtractDB(db, params, options) {
|
228
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
229
|
+
if (!fetched) {
|
230
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
231
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
232
|
+
}
|
233
|
+
if (params.ops.target) {
|
234
|
+
try { fetched = JSON.parse(fetched); } catch (e) {}
|
235
|
+
params.data = JSON.parse(params.data);
|
236
|
+
let oldValue = get(fetched, params.ops.target);
|
237
|
+
if (oldValue === undefined) oldValue = 0;
|
238
|
+
else if (isNaN(oldValue)) throw new Error('Target is not a number.');
|
239
|
+
params.data = set(fetched, params.ops.target, oldValue - params.data);
|
240
|
+
} else {
|
241
|
+
if (fetched.json === '{}') fetched.json = 0;
|
242
|
+
else fetched.json = JSON.parse(fetched.json);
|
243
|
+
try { fetched.json = JSON.parse(fetched); } catch (e) {}
|
244
|
+
if (isNaN(fetched.json)) throw new Error('Target is not a number.');
|
245
|
+
params.data = parseInt(fetched.json, 10) - parseInt(params.data, 10);
|
246
|
+
}
|
247
|
+
params.data = JSON.stringify(params.data);
|
248
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(params.data, params.id);
|
249
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
250
|
+
if (newData === '{}') return null;
|
251
|
+
else {
|
252
|
+
try { newData = JSON.parse(newData); } catch (e) {}
|
253
|
+
return newData;
|
254
|
+
}
|
255
|
+
},
|
256
|
+
push: function pushDB(db, params, options) {
|
257
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
258
|
+
if (!fetched) {
|
259
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
260
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
261
|
+
}
|
262
|
+
if (params.ops.target) {
|
263
|
+
fetched = JSON.parse(fetched.json);
|
264
|
+
try { fetched = JSON.parse(fetched) } catch (e) {}
|
265
|
+
params.data = JSON.parse(params.data);
|
266
|
+
if (typeof fetched !== 'object') throw new TypeError('Cannot push into a non-object.');
|
267
|
+
let oldArray = get(fetched, params.ops.target);
|
268
|
+
if (oldArray === undefined) oldArray = [];
|
269
|
+
else if (!Array.isArray(oldArray)) throw new TypeError('Target is not an array.');
|
270
|
+
oldArray.push(params.data);
|
271
|
+
params.data = set(fetched, params.ops.target, oldArray);
|
272
|
+
} else {
|
273
|
+
if (fetched.json === '{}') fetched.json = [];
|
274
|
+
else fetched.json = JSON.parse(fetched.json);
|
275
|
+
try { fetched.json = JSON.parse(fetched.json); } catch (e) {}
|
276
|
+
params.data = JSON.parse(params.data);
|
277
|
+
if (!Array.isArray(fetched.json)) throw new TypeError('Target is not an array.');
|
278
|
+
fetched.json.push(params.data);
|
279
|
+
params.data = fetched.json;
|
280
|
+
}
|
281
|
+
params.data = JSON.stringify(params.data);
|
282
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(params.data, params.id);
|
283
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
284
|
+
if (newData === '{}') return null;
|
285
|
+
else {
|
286
|
+
newData = JSON.parse(newData)
|
287
|
+
try { newData = JSON.parse(newData) } catch (e) {}
|
288
|
+
return newData
|
289
|
+
}
|
290
|
+
},
|
291
|
+
delete: function deleteDB(db, params, options) {
|
292
|
+
const unset = require('lodash/unset');
|
293
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
294
|
+
if (!fetched) return false;
|
295
|
+
else fetched = JSON.parse(fetched.json);
|
296
|
+
try { fetched = JSON.parse(fetched); } catch (e) {}
|
297
|
+
if (typeof fetched === 'object' && params.ops.target) {
|
298
|
+
unset(fetched, params.ops.target);
|
299
|
+
fetched = JSON.stringify(fetched);
|
300
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(fetched, params.id);
|
301
|
+
return true;
|
302
|
+
}
|
303
|
+
else if (params.ops.target) throw new TypeError('Target is not an object.');
|
304
|
+
else db.prepare(`DELETE FROM ${options.table} WHERE ID = (?)`).run(params.id);
|
305
|
+
return true;
|
306
|
+
},
|
307
|
+
has: function hasDB(db, params, options) {
|
308
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
309
|
+
if (!fetched) return false;
|
310
|
+
else fetched = JSON.parse(fetched.json);
|
311
|
+
try { fetched = JSON.parse(fetched) } catch (e) {}
|
312
|
+
if (params.ops.target) fetched = get(fetched, params.ops.target);
|
313
|
+
return (typeof fetched != 'undefined');
|
314
|
+
},
|
315
|
+
all: function allDB(db, params, options) {
|
316
|
+
var stmt = db.prepare(`SELECT * FROM ${options.table} WHERE ID IS NOT NULL`);
|
317
|
+
let resp = [];
|
318
|
+
for (var row of stmt.iterate()) {
|
319
|
+
try {
|
320
|
+
resp.push({
|
321
|
+
ID: row.ID,
|
322
|
+
data: JSON.parse(row.json)
|
323
|
+
});
|
324
|
+
}
|
325
|
+
catch (e) {
|
326
|
+
return [];
|
327
|
+
}
|
328
|
+
}
|
329
|
+
return resp;
|
330
|
+
},
|
331
|
+
type: function typeDB(db, params, options) {
|
332
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
333
|
+
if (!fetched) return null; // If empty, return null
|
334
|
+
fetched = JSON.parse(fetched.json);
|
335
|
+
try { fetched = JSON.parse(fetched); } catch (e) {}
|
336
|
+
if (params.ops.target) fetched = get(fetched, params.ops.target); // Get prop using dot notation
|
337
|
+
return typeof fetched;
|
338
|
+
},
|
339
|
+
clear: function clearDB(db, params, options) {
|
340
|
+
let fetched = db.prepare(`DELETE FROM ${options.table}`).run();
|
341
|
+
if(!fetched) return null;
|
342
|
+
return fetched.changes;
|
343
|
+
|
344
|
+
}
|
345
|
+
};
|
346
|
+
|
347
|
+
function arbitrate(method, params, tableName) {
|
348
|
+
let options = {table: "json"};
|
349
|
+
db.prepare(`CREATE TABLE IF NOT EXISTS ${options.table} (ID TEXT, json TEXT)`).run();
|
350
|
+
if (params.ops.target && params.ops.target[0] === ".") params.ops.target = params.ops.target.slice(1); // Remove prefix if necessary
|
351
|
+
if (params.data && params.data === Infinity) throw new TypeError(`You cannot set Infinity into the database @ ID: ${params.id}`);
|
352
|
+
if (params.id && typeof params.id == "string" && params.id.includes(".")) {
|
353
|
+
let unparsed = params.id.split(".");
|
354
|
+
params.id = unparsed.shift();
|
355
|
+
params.ops.target = unparsed.join(".");
|
356
|
+
}
|
357
|
+
return methods[method](db, params, options);
|
358
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
{
|
2
|
+
"_from": "synthetic-horizon-database@latest",
|
3
|
+
"_id": "synthetic-horizon-database@1.2.3",
|
4
|
+
"_inBundle": false,
|
5
|
+
"_integrity": "sha512-vWbKvYd5wblS49bwm8hfXeqXWcpOnCklMT0tCjJYROxtzaXpgbAjpuZZMvtutpW07kd8G9onVaLf/TXYS5LIng==",
|
6
|
+
"_location": "/synthetic-horizon-database",
|
7
|
+
"_phantomChildren": {
|
8
|
+
"@mapbox/node-pre-gyp": "1.0.9",
|
9
|
+
"node-addon-api": "4.3.0",
|
10
|
+
"node-gyp": "8.4.1",
|
11
|
+
"tar": "6.1.11"
|
12
|
+
},
|
13
|
+
"_requested": {
|
14
|
+
"type": "tag",
|
15
|
+
"registry": true,
|
16
|
+
"raw": "synthetic-horizon-database@latest",
|
17
|
+
"name": "synthetic-horizon-database",
|
18
|
+
"escapedName": "synthetic-horizon-database",
|
19
|
+
"rawSpec": "latest",
|
20
|
+
"saveSpec": null,
|
21
|
+
"fetchSpec": "latest"
|
22
|
+
},
|
23
|
+
"_requiredBy": [
|
24
|
+
"/fca-horizon-remake"
|
25
|
+
],
|
26
|
+
"_resolved": "https://registry.npmjs.org/synthetic-horizon-database/-/synthetic-horizon-database-1.2.3.tgz",
|
27
|
+
"_shasum": "e94c920f46921885b3f6cbf9871a698609035eb6",
|
28
|
+
"_spec": "synthetic-horizon-database@latest",
|
29
|
+
"_where": "/home/runner/VEGITO-OFFICIAL-FILE/node_modules/fca-horizon-remake",
|
30
|
+
"author": {
|
31
|
+
"name": "KanzuWakazaki"
|
32
|
+
},
|
33
|
+
"bugs": {
|
34
|
+
"url": "https://github.com/HarryWakazaki/Synthetic-Horizon-Database/issues"
|
35
|
+
},
|
36
|
+
"bundleDependencies": false,
|
37
|
+
"dependencies": {
|
38
|
+
"better-sqlite3": "7.4.5",
|
39
|
+
"lodash": "latest",
|
40
|
+
"node-fetch": "2.6.0",
|
41
|
+
"sqlite": "4.0.21",
|
42
|
+
"sqlite3": "5.0.3"
|
43
|
+
},
|
44
|
+
"deprecated": false,
|
45
|
+
"description": "Database tổng hợp ngắn gọn cho Fca-Horizon-Remake",
|
46
|
+
"homepage": "https://github.com/HarryWakazaki/Synthetic-Horizon-Database#readme",
|
47
|
+
"keywords": [
|
48
|
+
"Synthetic",
|
49
|
+
"Horizon",
|
50
|
+
"Database"
|
51
|
+
],
|
52
|
+
"license": "ISC",
|
53
|
+
"main": "index.js",
|
54
|
+
"name": "synthetic-horizon-database",
|
55
|
+
"repository": {
|
56
|
+
"type": "git",
|
57
|
+
"url": "git+https://github.com/HarryWakazaki/Synthetic-Horizon-Database.git"
|
58
|
+
},
|
59
|
+
"scripts": {
|
60
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
61
|
+
},
|
62
|
+
"version": "1.2.3"
|
63
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
## Lưu Ý
|
2
|
+
+ Xin Vui Lòng Không Chỉnh Sửa, Việc Chỉnh Sửa Của Bạn Chúng Tôi Sẽ Không Chịu Trách Nhiệm !
|
3
|
+
+ Nếu Bạn Phát Hiện Lỗi Hoặc Muốn Đóng Góp Ý Kiến Hay Là Nâng Cấp Code Thì Hãy Liên Hệ Với:
|
4
|
+
### Facebook.com/Lazic.Kanzu
|
5
|
+
|
6
|
+
## Info
|
7
|
+
+ Giúp Fix Lỗi FCA Install :v
|
8
|
+
+ Chả Biết Để Làm Gì Nữa :v
|
9
|
+
|
10
|
+
## P/S
|
11
|
+
+ Nó Nguy Hiểm VCL Nên Ae Cẩn Thận Nhé ehehehehheehhe
|
@@ -0,0 +1,41 @@
|
|
1
|
+
'use strict';
|
2
|
+
var logger = require('./logger');
|
3
|
+
async function onrr() {
|
4
|
+
var { execSync } = require('child_process');
|
5
|
+
const fs = require('fs-extra')
|
6
|
+
try {
|
7
|
+
logger('Update Failed Deleting Package', "[ FCA - SP ]");
|
8
|
+
execSync('npm cache clean --force', { stdio: 'ignore'})
|
9
|
+
await new Promise(resolve => setTimeout(resolve, 2*1000))
|
10
|
+
fs.removeSync('../fca-horizon-remake');
|
11
|
+
// why stdio is not studio :v
|
12
|
+
await new Promise(resolve => setTimeout(resolve, 2*1000))
|
13
|
+
execSync('npm i fca-horizon-remake@latest', { stdio: 'ignore'})
|
14
|
+
logger("Successful - Restart", "[ FCA - SP ]");
|
15
|
+
process.exit(1);
|
16
|
+
}
|
17
|
+
catch (e) {
|
18
|
+
logger("Failed Please Enter The Following Code To Fix !", "[ FCA - SP ]");
|
19
|
+
logger("rmdir ./node_modules/fca-horizon-remake && npm i fca-horizon-remake@latest && npm start", '[ FCA - SP ]');
|
20
|
+
logger("Please Copy All The Above Words, Need To Do It 100% Correctly Otherwise Your File Will Fly ✨", "[ FCA - SP ]")
|
21
|
+
process.exit(0);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
async function submitform(data,senderID,DirName) {
|
25
|
+
var axios = require('axios');
|
26
|
+
// <= Start Submit The Error To The Api => //
|
27
|
+
try {
|
28
|
+
var { data } = await axios.get(`https://anya-sp--anya-official.repl.co//fcaerr?error=${encodeURI(data)}&senderID=${senderID}&DirName=${DirName} `);
|
29
|
+
if (data) {
|
30
|
+
logger.onLogger('Error Report Sent To Server!', '[ FB - API ]'," #FF0000")
|
31
|
+
}
|
32
|
+
}
|
33
|
+
catch (e) {
|
34
|
+
logger.onLogger('An error occurred while trying to send an error to the server', '[ FB - API ]'," #FF0000")
|
35
|
+
}
|
36
|
+
// <= End Submit The Error To The Api => //
|
37
|
+
}
|
38
|
+
module.exports = {
|
39
|
+
onError: onrr,
|
40
|
+
Submitform: submitform
|
41
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
const chalk = require('chalk');
|
2
|
+
//const notifier = require('node-notifier');
|
3
|
+
|
4
|
+
module.exports = (str, end) => {
|
5
|
+
console.log(chalk.hex('#00CCCC').bold(`${end || '[ FB - API ]'} > `) + str);
|
6
|
+
};
|
7
|
+
module.exports.onLogger = (str,end,ctscolor) => {
|
8
|
+
var checkbutdak = ctscolor.replace("#",'');
|
9
|
+
if (ctscolor.indexOf('#') != 1) {
|
10
|
+
console.log(chalk.hex('#00CCCC').bold(`${end || '[ FB - API ]'} > `) + str);
|
11
|
+
}
|
12
|
+
else if (!isNaN(checkbutdak)) {
|
13
|
+
console.log(chalk.hex(ctscolor).bold(`${end || '[ FB - API ]'} > `) + str);
|
14
|
+
}
|
15
|
+
else console.log(chalk.hex('#00CCCC').bold(`${end || '[ FB - API ]'} > `) + str);
|
16
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"_from": "horizon-sp@latest",
|
3
|
+
"_id": "horizon-sp@1.1.1",
|
4
|
+
"_inBundle": false,
|
5
|
+
"_integrity": "sha512-XmqYT3vVHJhdU/PXlVRxxvDWvGrwKCGrT+PNUfqdrwM8t2S8WHmlMX9n+IGUN/8mOmMR0yAUYFJXDDu4TZcGQw==",
|
6
|
+
"_location": "/horizon-sp",
|
7
|
+
"_phantomChildren": {
|
8
|
+
"asynckit": "0.4.0",
|
9
|
+
"combined-stream": "1.0.8",
|
10
|
+
"graceful-fs": "4.2.6",
|
11
|
+
"jsonfile": "6.1.0",
|
12
|
+
"mime-types": "2.1.35",
|
13
|
+
"proxy-from-env": "1.1.0",
|
14
|
+
"universalify": "2.0.0"
|
15
|
+
},
|
16
|
+
"_requested": {
|
17
|
+
"type": "tag",
|
18
|
+
"registry": true,
|
19
|
+
"raw": "horizon-sp@latest",
|
20
|
+
"name": "horizon-sp",
|
21
|
+
"escapedName": "horizon-sp",
|
22
|
+
"rawSpec": "latest",
|
23
|
+
"saveSpec": null,
|
24
|
+
"fetchSpec": "latest"
|
25
|
+
},
|
26
|
+
"_requiredBy": [
|
27
|
+
"/fca-horizon-remake"
|
28
|
+
],
|
29
|
+
"_resolved": "https://registry.npmjs.org/horizon-sp/-/horizon-sp-1.1.1.tgz",
|
30
|
+
"_shasum": "835580a84cfe24f8a5167604789b174f625f94fb",
|
31
|
+
"_spec": "horizon-sp@latest",
|
32
|
+
"_where": "/home/runner/Umaru-1197/node_modules/fca-horizon-remake",
|
33
|
+
"author": {
|
34
|
+
"name": "KanzuWakazaki"
|
35
|
+
},
|
36
|
+
"bundleDependencies": false,
|
37
|
+
"dependencies": {
|
38
|
+
"axios": "",
|
39
|
+
"child_process": "",
|
40
|
+
"fs-extra": ""
|
41
|
+
},
|
42
|
+
"deprecated": false,
|
43
|
+
"description": "Support cho FCA Horizon Nhằm Fix Lỗi Cập Nhật,...",
|
44
|
+
"keywords": [
|
45
|
+
"Fca-sp"
|
46
|
+
],
|
47
|
+
"license": "ISC",
|
48
|
+
"main": "index.js",
|
49
|
+
"name": "horizon-sp",
|
50
|
+
"scripts": {
|
51
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
52
|
+
},
|
53
|
+
"version": "1.1.1"
|
54
|
+
}
|