gj-boomlings-api 2.0.3 → 2.1.1
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.
- package/LICENSE +1 -1
- package/README.md +5 -5
- package/functions/acceptFriendRequest.js +32 -0
- package/functions/blockUser.js +14 -22
- package/functions/deleteAccountPost.js +13 -16
- package/functions/deleteComment.js +11 -16
- package/functions/deleteFriendRequest.js +36 -0
- package/functions/deleteLevel.js +11 -17
- package/functions/deleteMessage.js +33 -0
- package/functions/{dlLevel.js → downloadLevel.js} +47 -43
- package/functions/{dlMessage.js → downloadMessage.js} +10 -13
- package/functions/getAccountPosts.js +4 -9
- package/functions/getBlockedList.js +32 -17
- package/functions/getCommentHistory.js +8 -7
- package/functions/getComments.js +12 -9
- package/functions/getCreatorScores.js +13 -5
- package/functions/getDailyLevel.js +3 -3
- package/functions/getFriendRequests.js +83 -0
- package/functions/getFriendsList.js +26 -16
- package/functions/getGauntlets.js +5 -3
- package/functions/getLevelByID.js +2 -3
- package/functions/getLevelScores.js +23 -26
- package/functions/getMapPacks.js +2 -6
- package/functions/getMessages.js +11 -15
- package/functions/getProfile.js +146 -57
- package/functions/getSongInfo.js +4 -9
- package/functions/getSongsLibrary.js +14 -3
- package/functions/getTab.js +3 -4
- package/functions/getTop100.js +3 -6
- package/functions/getTopLists.js +1 -2
- package/functions/getUserLevels.js +4 -8
- package/functions/getWeeklyDemon.js +3 -3
- package/functions/removeFriend.js +33 -0
- package/functions/reportLevel.js +3 -6
- package/functions/searchLevels.js +2 -3
- package/functions/searchLists.js +2 -3
- package/functions/unblockUser.js +17 -27
- package/functions/updateAccountSettings.js +75 -0
- package/functions/updateLevelDesc.js +11 -16
- package/functions/uploadAccountPost.js +11 -16
- package/functions/uploadComment.js +15 -19
- package/functions/uploadFriendRequest.js +35 -0
- package/functions/uploadMessage.js +18 -25
- package/index.js +30 -3
- package/misc/GJDecode.js +12 -9
- package/misc/gauntlets.json +14 -1
- package/misc/gjReq.js +33 -0
- package/misc/gjp2.js +5 -0
- package/package.json +2 -5
- package/gjReq.js +0 -18
- /package/{xor.js → misc/xor.js} +0 -0
|
@@ -2,33 +2,28 @@ module.exports = {
|
|
|
2
2
|
/**
|
|
3
3
|
* Updates the description on a level.
|
|
4
4
|
* @param {number} level - The level ID.
|
|
5
|
-
* @param {string} desc - The new description.
|
|
5
|
+
* @param {string} desc - The new description. Leave empty to reset to "(No description provided)".
|
|
6
6
|
* @param {string} username - The level uploader's username or player ID.
|
|
7
7
|
* @param {string} password - The level uploader's password.
|
|
8
|
-
* @returns {number} Returns 1 if everything's OK,
|
|
8
|
+
* @returns {number} Returns 1 if everything's OK, or -1 if something went wrong.
|
|
9
9
|
*/
|
|
10
10
|
updateLevelDesc: async function (level, desc, username, password) {
|
|
11
11
|
if (isNaN(level)) throw new Error("Please provide a valid level ID!");
|
|
12
|
-
if (!username) throw new Error("Please provide
|
|
13
|
-
if (!password) throw new Error("Please provide
|
|
12
|
+
if (!username) throw new Error("Please provide the player ID or username!");
|
|
13
|
+
if (!password) throw new Error("Please provide the password!");
|
|
14
14
|
|
|
15
|
-
const { gjReq } = require("../gjReq");
|
|
16
|
-
const
|
|
17
|
-
const xor = new XOR;
|
|
15
|
+
const { gjReq } = require("../misc/gjReq");
|
|
16
|
+
const { gjp2 } = require("../misc/gjp2");
|
|
18
17
|
|
|
19
|
-
let search = await gjReq("getGJUsers20", {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
if (search.data == -1) throw new Error(-1);
|
|
24
|
-
let accID = search.data.split(":")[21];
|
|
18
|
+
let search = await gjReq("getGJUsers20", { str: username });
|
|
19
|
+
if (search.data == -1) throw new Error(`-1: Player with the ID or player username "${username}" not found`);
|
|
20
|
+
let accID = search.data.split(":")[23];
|
|
25
21
|
|
|
26
22
|
let res = await gjReq("updateGJDesc20", {
|
|
27
23
|
accountID: accID,
|
|
28
|
-
|
|
24
|
+
gjp2: gjp2(password),
|
|
29
25
|
levelID: level,
|
|
30
|
-
levelDesc: Buffer.from(desc).toString("base64")
|
|
31
|
-
secret: "Wmfd2893gb7"
|
|
26
|
+
levelDesc: Buffer.from(desc).toString("base64")
|
|
32
27
|
});
|
|
33
28
|
|
|
34
29
|
return res.data;
|
|
@@ -4,33 +4,28 @@ module.exports = {
|
|
|
4
4
|
* @param {string} content - The account post content.
|
|
5
5
|
* @param {string} username - The poster's username or player ID.
|
|
6
6
|
* @param {string} password - The poster's password.
|
|
7
|
-
* @returns {number} Returns
|
|
7
|
+
* @returns {number} Returns the published post's ID, or -1 if something went wrong.
|
|
8
8
|
*/
|
|
9
9
|
uploadAccountPost: async function (content, username, password) {
|
|
10
|
-
if (!content) throw new Error("Please provide
|
|
11
|
-
if (!username) throw new Error("Please provide
|
|
12
|
-
if (!password) throw new Error("Please provide
|
|
10
|
+
if (!content) throw new Error("Please provide the account post content!");
|
|
11
|
+
if (!username) throw new Error("Please provide the username or the player ID!");
|
|
12
|
+
if (!password) throw new Error("Please provide the password!");
|
|
13
13
|
|
|
14
|
-
const { gjReq } = require("../gjReq");
|
|
15
|
-
const
|
|
16
|
-
const xor = new XOR;
|
|
14
|
+
const { gjReq } = require("../misc/gjReq");
|
|
15
|
+
const { gjp2 } = require("../misc/gjp2");
|
|
17
16
|
|
|
18
|
-
let search = await gjReq("getGJUsers20", {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
if (search.data == -1) throw new Error(-1);
|
|
23
|
-
let accID = search.data.split(":")[21];
|
|
17
|
+
let search = await gjReq("getGJUsers20", { str: username });
|
|
18
|
+
if (search.data == -1) throw new Error(`-1: Player with the ID or player username "${username}" not found`);
|
|
19
|
+
let accID = search.data.split(":")[23];
|
|
24
20
|
|
|
25
21
|
let res = await gjReq("uploadGJAccComment20", {
|
|
26
22
|
accountID: accID,
|
|
27
|
-
|
|
28
|
-
gjp: xor.encrypt(password, 37526),
|
|
23
|
+
gjp2: gjp2(password),
|
|
29
24
|
comment: Buffer.from(content).toString("base64"),
|
|
30
25
|
cType: 1
|
|
31
26
|
});
|
|
32
27
|
if (res.status == 500) throw new Error("500 Error: couldn't post!");
|
|
33
28
|
|
|
34
|
-
return res.data;
|
|
29
|
+
return Number(res.data);
|
|
35
30
|
}
|
|
36
31
|
}
|
|
@@ -6,49 +6,45 @@ module.exports = {
|
|
|
6
6
|
* @param {string} username - The commenter's username or player ID.
|
|
7
7
|
* @param {string} password - The commenter's password.
|
|
8
8
|
* @param {number} percent - The achieved level percentage to be displayed on the comment.
|
|
9
|
-
* @returns {number} Returns 1 if everything's OK,
|
|
9
|
+
* @returns {number} Returns 1 if everything's OK, or -1 if something went wrong.
|
|
10
10
|
*/
|
|
11
11
|
uploadComment: async function (comment, level, username, password, percent = 0) {
|
|
12
|
-
if (!comment) throw new Error("Please provide
|
|
13
|
-
if (!level) throw new Error("Please provide
|
|
14
|
-
if (!username) throw new Error("Please provide
|
|
15
|
-
if (!password) throw new Error("Please provide
|
|
12
|
+
if (!comment) throw new Error("Please provide the comment!");
|
|
13
|
+
if (!level) throw new Error("Please provide the level ID!");
|
|
14
|
+
if (!username) throw new Error("Please provide the username or the player ID!");
|
|
15
|
+
if (!password) throw new Error("Please provide the password!");
|
|
16
16
|
if (Number(percent) > 100) throw new Error("The percentage cannot be more than 100!");
|
|
17
17
|
|
|
18
|
-
const { gjReq } = require("../gjReq
|
|
19
|
-
const crypto = require(
|
|
18
|
+
const { gjReq } = require("../misc/gjReq");
|
|
19
|
+
const crypto = require("crypto");
|
|
20
20
|
|
|
21
21
|
function sha1(data) { return crypto.createHash("sha1").update(data, "binary").digest("hex"); }
|
|
22
22
|
|
|
23
|
-
let search = await gjReq("getGJUsers20", {
|
|
24
|
-
|
|
25
|
-
secret: "Wmfd2893gb7"
|
|
26
|
-
});
|
|
27
|
-
if (search.data == -1) throw new Error(-1);
|
|
23
|
+
let search = await gjReq("getGJUsers20", {str: username});
|
|
24
|
+
if (search.data == -1) throw new Error(`-1: Player with the ID or player username "${username}" not found`);
|
|
28
25
|
let name = search.data.split(":")[1];
|
|
29
|
-
let accID = search.data.split(":")[
|
|
26
|
+
let accID = search.data.split(":")[23];
|
|
30
27
|
|
|
31
|
-
const XOR = require("../xor
|
|
28
|
+
const XOR = require("../misc/xor");
|
|
32
29
|
const xor = new XOR;
|
|
30
|
+
const { gjp2 } = require("../misc/gjp2");
|
|
33
31
|
|
|
34
32
|
let chkStr = name.toLowerCase() + Buffer.from(comment).toString("base64") + level + percent + "0xPT6iUrtws0J";
|
|
35
33
|
let chk = xor.encrypt(sha1(chkStr), 29481);
|
|
36
34
|
|
|
37
35
|
let res = await gjReq("uploadGJComment21", {
|
|
38
36
|
accountID: accID,
|
|
39
|
-
|
|
37
|
+
gjp2: gjp2(password),
|
|
40
38
|
userName: name.toLowerCase(),
|
|
41
39
|
comment: Buffer.from(comment).toString("base64"),
|
|
42
40
|
levelID: level,
|
|
43
41
|
percent: percent,
|
|
44
|
-
chk: chk
|
|
45
|
-
secret: "Wmfd2893gb7"
|
|
42
|
+
chk: chk
|
|
46
43
|
});
|
|
47
44
|
|
|
48
|
-
if (res.data == -1) throw new Error("Whoops, the servers have rejected your request!");
|
|
49
45
|
if (res.data == -10) throw new Error("You're permanently banned from commenting!");
|
|
50
46
|
if (res.data.startsWith("temp_")) throw new Error(`You're temporarily banned from commenting!\nBan duration: ${res.data.split("_")[1]} seconds\nReason: ${res.data.split("_")[2]}`);
|
|
51
47
|
|
|
52
|
-
return res.data;
|
|
48
|
+
return Number(res.data);
|
|
53
49
|
}
|
|
54
50
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Sends a friend request to another player.
|
|
4
|
+
* @param {string} target - The player receiving the friend request.
|
|
5
|
+
* @param {string} username - The sender's username or player ID.
|
|
6
|
+
* @param {string} password - The sender's password.
|
|
7
|
+
* @param {string} comment - The comment that goes along with the request. Optional.
|
|
8
|
+
* @returns {number} Returns 1 if everything's OK, or -1 if something went wrong.
|
|
9
|
+
*/
|
|
10
|
+
uploadFriendRequest: async function (target, username, password, comment) {
|
|
11
|
+
if (!target) throw new Error("Please specify the target!");
|
|
12
|
+
if (!username) throw new Error("Please provide the username or the player ID!");
|
|
13
|
+
if (!password) throw new Error("Please provide the password!");
|
|
14
|
+
|
|
15
|
+
const { gjReq } = require("../misc/gjReq");
|
|
16
|
+
const { gjp2 } = require("../misc/gjp2");
|
|
17
|
+
|
|
18
|
+
let userSearch = await gjReq("getGJUsers20", {str: username});
|
|
19
|
+
if (userSearch.data == -1) throw new Error(`-1: Player with the ID or player username "${username}" not found`);
|
|
20
|
+
let userAccID = userSearch.data.split(":")[23];
|
|
21
|
+
|
|
22
|
+
let recSearch = await gjReq("getGJUsers20", {str: target});
|
|
23
|
+
if (recSearch.data == -1) throw new Error(`-1: Player with the ID or player username "${target}" not found`);
|
|
24
|
+
let recAccID = recSearch.data.split(":")[23];
|
|
25
|
+
|
|
26
|
+
let res = await gjReq("uploadFriendRequest20", {
|
|
27
|
+
accountID: userAccID,
|
|
28
|
+
toAccountID: recAccID,
|
|
29
|
+
gjp2: gjp2(password),
|
|
30
|
+
comment: comment ? Buffer.from(comment).toString("base64") : ""
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return Number(res.data);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -6,43 +6,36 @@ module.exports = {
|
|
|
6
6
|
* @param {string} content - The message content.
|
|
7
7
|
* @param {string} username - The sender's username or player ID.
|
|
8
8
|
* @param {string} password - The sender's password.
|
|
9
|
-
* @returns {number} Returns 1 if everything's OK,
|
|
9
|
+
* @returns {number} Returns 1 if everything's OK, or -1 if something went wrong.
|
|
10
10
|
*/
|
|
11
11
|
uploadMessage: async function (recipient, subject, content, username, password) {
|
|
12
|
-
if (!recipient) throw new Error("Please specify
|
|
13
|
-
if (!subject) throw new Error("Please specify
|
|
14
|
-
if (!content) throw new Error("Please specify
|
|
15
|
-
if (!username) throw new Error("Please provide
|
|
16
|
-
if (!password) throw new Error("Please provide
|
|
12
|
+
if (!recipient) throw new Error("Please specify the message recipient!");
|
|
13
|
+
if (!subject) throw new Error("Please specify the message subject!");
|
|
14
|
+
if (!content) throw new Error("Please specify the message content!");
|
|
15
|
+
if (!username) throw new Error("Please provide the username or the player ID!");
|
|
16
|
+
if (!password) throw new Error("Please provide the password!");
|
|
17
17
|
|
|
18
|
-
const { gjReq } = require("../gjReq");
|
|
19
|
-
const XOR = require("../xor");
|
|
18
|
+
const { gjReq } = require("../misc/gjReq");
|
|
19
|
+
const XOR = require("../misc/xor");
|
|
20
20
|
const xor = new XOR;
|
|
21
|
+
const { gjp2 } = require("../misc/gjp2");
|
|
21
22
|
|
|
22
|
-
let userSearch = await gjReq("getGJUsers20", {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
if (userSearch.data == -1) throw new Error(-1);
|
|
27
|
-
let userAccID = userSearch.data.split(":")[21];
|
|
23
|
+
let userSearch = await gjReq("getGJUsers20", {str: username});
|
|
24
|
+
if (userSearch.data == -1) throw new Error(`-1: Player with the ID or player username "${username}" not found`);
|
|
25
|
+
let userAccID = userSearch.data.split(":")[23];
|
|
28
26
|
|
|
29
|
-
let recSearch = await gjReq("getGJUsers20", {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
if (recSearch.data == -1) throw new Error(-1);
|
|
34
|
-
let recAccID = recSearch.data.split(":")[21];
|
|
27
|
+
let recSearch = await gjReq("getGJUsers20", {str: recipient});
|
|
28
|
+
if (recSearch.data == -1) throw new Error(`-1: Player with the ID or player username "${target}" not found`);
|
|
29
|
+
let recAccID = recSearch.data.split(":")[23];
|
|
35
30
|
|
|
36
31
|
let res = await gjReq("uploadGJMessage20", {
|
|
37
32
|
accountID: userAccID,
|
|
38
33
|
toAccountID: recAccID,
|
|
39
|
-
|
|
34
|
+
gjp2: gjp2(password),
|
|
40
35
|
subject: Buffer.from(subject).toString("base64"),
|
|
41
|
-
body: xor.encrypt(content, 14251)
|
|
42
|
-
secret: "Wmfd2893gb7"
|
|
36
|
+
body: xor.encrypt(content, 14251)
|
|
43
37
|
});
|
|
44
|
-
if (res.data == -1) throw new Error(-1);
|
|
45
38
|
|
|
46
|
-
return res.data;
|
|
39
|
+
return Number(res.data);
|
|
47
40
|
}
|
|
48
41
|
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { downloadLevel } = require("./functions/downloadLevel");
|
|
2
2
|
const { getProfile } = require("./functions/getProfile");
|
|
3
3
|
const { getSongsLibrary } = require("./functions/getSongsLibrary");
|
|
4
4
|
const { getSongInfo } = require("./functions/getSongInfo");
|
|
@@ -13,7 +13,7 @@ const { getTop100 } = require("./functions/getTop100");
|
|
|
13
13
|
const { reportLevel } = require("./functions/reportLevel");
|
|
14
14
|
const { uploadMessage } = require("./functions/uploadMessage");
|
|
15
15
|
const { getMessages } = require("./functions/getMessages");
|
|
16
|
-
const {
|
|
16
|
+
const { downloadMessage } = require("./functions/downloadMessage");
|
|
17
17
|
const { getBlockedList } = require("./functions/getBlockedList");
|
|
18
18
|
const { getFriendsList } = require("./functions/getFriendsList");
|
|
19
19
|
const { deleteLevel } = require("./functions/deleteLevel");
|
|
@@ -33,4 +33,31 @@ const { deleteComment } = require("./functions/deleteComment");
|
|
|
33
33
|
const { getCommentHistory } = require("./functions/getCommentHistory");
|
|
34
34
|
const { getLevelScores } = require("./functions/getLevelScores");
|
|
35
35
|
const { uploadComment } = require("./functions/uploadComment");
|
|
36
|
-
|
|
36
|
+
const { uploadFriendRequest } = require("./functions/uploadFriendRequest");
|
|
37
|
+
const { deleteFriendRequest } = require("./functions/deleteFriendRequest");
|
|
38
|
+
const { getFriendRequests } = require("./functions/getFriendRequests");
|
|
39
|
+
const { acceptFriendRequest } = require("./functions/acceptFriendRequest");
|
|
40
|
+
const { removeFriend } = require("./functions/removeFriend");
|
|
41
|
+
const { deleteMessage } = require("./functions/deleteMessage");
|
|
42
|
+
const { updateAccountSettings } = require("./functions/updateAccountSettings");
|
|
43
|
+
|
|
44
|
+
const dlLevel = downloadLevel;
|
|
45
|
+
const dlMessage = downloadMessage;
|
|
46
|
+
|
|
47
|
+
module.exports = {
|
|
48
|
+
dlLevel, dlMessage, // aliases
|
|
49
|
+
downloadLevel, getProfile, getSongsLibrary,
|
|
50
|
+
getSongInfo, getAccountPosts, getGauntlets,
|
|
51
|
+
getMapPacks, getOfficialSongInfo, getDailyLevel,
|
|
52
|
+
getWeeklyDemon, getCreatorScores, getTop100,
|
|
53
|
+
reportLevel, uploadMessage, getMessages,
|
|
54
|
+
downloadMessage, getBlockedList, getFriendsList,
|
|
55
|
+
deleteLevel, blockUser, unblockUser,
|
|
56
|
+
uploadAccountPost, deleteAccountPost, updateLevelDesc,
|
|
57
|
+
getLevelByID, searchLevels, getComments,
|
|
58
|
+
getTopLists, searchLists, getTab,
|
|
59
|
+
getUserLevels, deleteComment, getCommentHistory,
|
|
60
|
+
getLevelScores, uploadComment, uploadFriendRequest,
|
|
61
|
+
deleteFriendRequest, getFriendRequests, acceptFriendRequest,
|
|
62
|
+
removeFriend, deleteMessage, updateAccountSettings
|
|
63
|
+
};
|
package/misc/GJDecode.js
CHANGED
|
@@ -18,18 +18,21 @@ module.exports = class GJDecode {
|
|
|
18
18
|
return {
|
|
19
19
|
name: s[1],
|
|
20
20
|
playerID: Number(s[3]),
|
|
21
|
-
accountID: Number(s[
|
|
21
|
+
accountID: Number(s[23]),
|
|
22
22
|
rank: Number(s[9]),
|
|
23
|
-
stars: Number(s[
|
|
24
|
-
diamonds: Number(s[
|
|
23
|
+
stars: Number(s[25]),
|
|
24
|
+
diamonds: Number(s[31]),
|
|
25
25
|
secretCoins: Number(s[5]),
|
|
26
26
|
userCoins: Number(s[7]),
|
|
27
|
-
demons: Number(s[
|
|
28
|
-
moons: Number(s[
|
|
29
|
-
creatorPoints: Number(s[
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
demons: Number(s[33]),
|
|
28
|
+
moons: Number(s[27]),
|
|
29
|
+
creatorPoints: Number(s[29]),
|
|
30
|
+
iconID: Number(s[11]),
|
|
31
|
+
color1: rgbToHEX(colors[s[13]]),
|
|
32
|
+
color2: rgbToHEX(colors[s[15]]),
|
|
33
|
+
glow: Boolean(Number(s[21])),
|
|
34
|
+
glowColor: rgbToHEX(colors[s[17]]),
|
|
35
|
+
iconType: iconObj[s[19]]
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
decodeSearchResults(res) {
|
package/misc/gauntlets.json
CHANGED
|
@@ -16,9 +16,15 @@
|
|
|
16
16
|
"15": "Death",
|
|
17
17
|
"16": "Forest",
|
|
18
18
|
"18": "Force",
|
|
19
|
+
"19": "Spooky",
|
|
19
20
|
"21": "Water",
|
|
20
21
|
"22": "Haunted",
|
|
22
|
+
"23": "Acid",
|
|
23
|
+
"25": "Power",
|
|
21
24
|
"29": "Halloween",
|
|
25
|
+
"30": "Treasure",
|
|
26
|
+
"32": "Spider",
|
|
27
|
+
"33": "Gem",
|
|
22
28
|
"34": "Inferno",
|
|
23
29
|
"35": "Portal",
|
|
24
30
|
"36": "Strange",
|
|
@@ -32,5 +38,12 @@
|
|
|
32
38
|
"47": "Galaxy",
|
|
33
39
|
"48": "Universe",
|
|
34
40
|
"49": "Discord",
|
|
35
|
-
"50": "Split"
|
|
41
|
+
"50": "Split",
|
|
42
|
+
"51": "NCS I",
|
|
43
|
+
"52": "NCS II",
|
|
44
|
+
"53": "Space",
|
|
45
|
+
"54": "Cosmos",
|
|
46
|
+
"55": "Random",
|
|
47
|
+
"56": "Chance",
|
|
48
|
+
"60": "Love"
|
|
36
49
|
}
|
package/misc/gjReq.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const https = require("https");
|
|
2
|
+
module.exports = {
|
|
3
|
+
gjReq: function (endpoint, data) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
if (!data.secret) data.secret = "Wmfd2893gb7";
|
|
6
|
+
const body = new URLSearchParams(data).toString();
|
|
7
|
+
|
|
8
|
+
const r = https.request({
|
|
9
|
+
hostname: "www.boomlings.com",
|
|
10
|
+
path: `/database/${endpoint.endsWith(".php") ? endpoint.split(".php")[0] : endpoint}.php`,
|
|
11
|
+
method: "POST",
|
|
12
|
+
headers: {
|
|
13
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
14
|
+
"User-Agent": ""
|
|
15
|
+
}
|
|
16
|
+
}, (res) => {
|
|
17
|
+
let output = "";
|
|
18
|
+
|
|
19
|
+
res.on("data", chunk => {output += chunk;});
|
|
20
|
+
res.on("end", () => {
|
|
21
|
+
resolve({
|
|
22
|
+
data: output,
|
|
23
|
+
status: r.statusCode
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
r.on("error", reject);
|
|
29
|
+
r.write(body);
|
|
30
|
+
r.end();
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
};
|
package/misc/gjp2.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gj-boomlings-api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "A light-weight Geometry Dash API wrapper",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,8 +26,5 @@
|
|
|
26
26
|
"gaming",
|
|
27
27
|
"robtop",
|
|
28
28
|
"geometry dash"
|
|
29
|
-
]
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"node-fetch": "^2.7.0"
|
|
32
|
-
}
|
|
29
|
+
]
|
|
33
30
|
}
|
package/gjReq.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const fetch = require("node-fetch");
|
|
2
|
-
module.exports = {
|
|
3
|
-
gjReq: async function (endpoint, data) {
|
|
4
|
-
let r = await fetch(`https://www.boomlings.com/database/${endpoint.endsWith(".php") ? endpoint.split(".php")[0] : endpoint}.php`, {
|
|
5
|
-
method: "POST",
|
|
6
|
-
headers: {
|
|
7
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
8
|
-
"User-Agent": " "
|
|
9
|
-
},
|
|
10
|
-
body: new URLSearchParams(data)
|
|
11
|
-
});
|
|
12
|
-
let res = await r.text();
|
|
13
|
-
return {
|
|
14
|
-
data: res,
|
|
15
|
-
status: r.status
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
/package/{xor.js → misc/xor.js}
RENAMED
|
File without changes
|