Add endpoints

This commit is contained in:
Lawin0129
2021-12-02 19:52:15 +00:00
parent a211296c57
commit 4003d2dcfd
3 changed files with 87 additions and 37 deletions

View File

@@ -8,7 +8,8 @@ const config = require("./config.json");
const worldstw = require("./responses/worldstw.json"); const worldstw = require("./responses/worldstw.json");
const friendslist = require("./responses/friendslist.json"); const friendslist = require("./responses/friendslist.json");
const friendslist2 = require("./responses/friendslist2.json"); const friendslist2 = require("./responses/friendslist2.json");
const Keychain = require("./responses/keychain.json"); const keychain = require("./responses/keychain.json");
const privacy = require("./responses/privacy.json");
const catalog = getItemShop(); const catalog = getItemShop();
express.use(function(req, res, next) { express.use(function(req, res, next) {
// Getting the raw body of a request for client saving // Getting the raw body of a request for client saving
@@ -142,12 +143,6 @@ express.get("/fortnite/api/version", async (req, res) => {
res.end(); res.end();
}) })
express.post("/fortnite/api/feedback/Bug", async (req, res) => {
res.json({});
res.status(200);
res.end();
})
express.get("/launcher/api/public/distributionpoints/", async (req, res) => { express.get("/launcher/api/public/distributionpoints/", async (req, res) => {
res.json({ res.json({
"distributions": [ "distributions": [
@@ -244,11 +239,68 @@ express.get("/fortnite/api/matchmaking/session/findPlayer/*", async (req, res) =
res.end(); res.end();
}) })
express.get("/fortnite/api/statsv2/account/*", async (req, res) => { express.get("/fortnite/api/game/v2/privacy/account/:accountId", async (req, res) => {
res.json([]) privacy.accountId = req.params.accountId;
res.json(privacy);
res.status(200); res.status(200);
res.end(); res.end();
}) });
express.post("/fortnite/api/game/v2/privacy/account/:accountId", async (req, res) => {
privacy.accountId = req.params.accountId;
privacy.optOutOfPublicLeaderboards = req.body.optOutOfPublicLeaderboards;
fs.writeFileSync("./responses/privacy.json", JSON.stringify(privacy, null, 2));
res.json(privacy);
res.status(200);
res.end();
});
express.get("/fortnite/api/statsv2/account/:accountId", async (req, res) => {
res.json({
"startTime": 0,
"endTime": 0,
"stats": {},
"accountId": req.params.accountId
});
res.status(200);
res.end();
});
express.get("/statsproxy/api/statsv2/account/:accountId", async (req, res) => {
res.json({
"startTime": 0,
"endTime": 0,
"stats": {},
"accountId": req.params.accountId
});
res.status(200);
res.end();
});
express.post("/fortnite/api/feedback/*", async (req, res) => {
res.status(200);
res.end();
});
express.post("/fortnite/api/statsv2/query", async (req, res) => {
res.json([]);
res.status(200);
res.end();
});
express.post("/statsproxy/api/statsv2/query", async (req, res) => {
res.json([]);
res.status(200);
res.end();
});
express.post("/fortnite/api/game/v2/events/v2/setSubgroup/*", async (req, res) => {
res.status(204);
res.end();
});
express.get("/fortnite/api/game/v2/enabled_features", async (req, res) => { express.get("/fortnite/api/game/v2/enabled_features", async (req, res) => {
res.json([]) res.json([])
@@ -518,12 +570,6 @@ express.get("/account/api/public/account", async (req, res) => {
res.end(); res.end();
}) })
express.get("/fortnite/api/game/v2/privacy/account/*", async (req, res) => {
res.json({})
res.status(200);
res.end();
})
express.get("/account/api/public/account/:accountId", async (req, res) => { express.get("/account/api/public/account/:accountId", async (req, res) => {
res.json({ res.json({
"id": req.params.accountId, "id": req.params.accountId,
@@ -1258,7 +1304,7 @@ express.get("/friends/api/public/blocklist/*", async (req, res) => {
res.end(); res.end();
}) })
express.get("/content/api/pages/fortnite-game", async (req, res) => { express.get("/content/api/pages/*", async (req, res) => {
const contentpages = getContentPages(req); const contentpages = getContentPages(req);
res.json(contentpages) res.json(contentpages)
@@ -1273,7 +1319,7 @@ express.get("/fortnite/api/game/v2/world/info", async (req, res) => {
}) })
express.get("/fortnite/api/storefront/v2/keychain", async (req, res) => { express.get("/fortnite/api/storefront/v2/keychain", async (req, res) => {
res.json(Keychain) res.json(keychain)
res.status(200); res.status(200);
res.end(); res.end();
}) })

View File

@@ -1,19 +1,19 @@
{ {
"refreshIntervalHrs":24, "refreshIntervalHrs": 24,
"dailyPurchaseHrs":24, "dailyPurchaseHrs": 24,
"expiration":"9999-12-31T00:00:00.000Z", "expiration": "9999-12-31T00:00:00.000Z",
"storefronts":[ "storefronts": [
{
"name": "BRDailyStorefront",
"catalogEntries": []
},
{
"name": "BRWeeklyStorefront",
"catalogEntries": []
},
{ {
"name":"CardPackStore", "name": "BRDailyStorefront",
"catalogEntries":[ "catalogEntries": []
},
{
"name": "BRWeeklyStorefront",
"catalogEntries": []
},
{
"name": "CardPackStore",
"catalogEntries": [
{ {
"offerId":"B9B0CE758A5049F898773C1A47A69ED4", "offerId":"B9B0CE758A5049F898773C1A47A69ED4",
"devName":"Always.UpgradePack.03", "devName":"Always.UpgradePack.03",
@@ -299,8 +299,8 @@
] ]
}, },
{ {
"name":"CardPackStorePreroll", "name": "CardPackStorePreroll",
"catalogEntries":[ "catalogEntries": [
{ {
"offerId":"D2E08EFA731D437B85B7340EB51A5E1D", "offerId":"D2E08EFA731D437B85B7340EB51A5E1D",
"devName":"Always.UpgradePack.01", "devName":"Always.UpgradePack.01",
@@ -488,8 +488,8 @@
] ]
}, },
{ {
"name":"CardPackStoreGameplay", "name": "CardPackStoreGameplay",
"catalogEntries":[ "catalogEntries": [
{ {
"offerId":"1F6B613D4B7BAD47D8A93CAEED2C4996", "offerId":"1F6B613D4B7BAD47D8A93CAEED2C4996",
"devName":"Mini Llama Manual Tutorial - high SharedDisplayPriority", "devName":"Mini Llama Manual Tutorial - high SharedDisplayPriority",
@@ -580,4 +580,4 @@
] ]
} }
] ]
} }

4
responses/privacy.json Normal file
View File

@@ -0,0 +1,4 @@
{
"accountId": "",
"optOutOfPublicLeaderboards": false
}