From de4c1c9c814f36ccbbfe7d10d73a36a72cce93de Mon Sep 17 00:00:00 2001 From: Lawin0129 <56766256+Lawin0129@users.noreply.github.com> Date: Thu, 16 Feb 2023 23:23:32 +0000 Subject: [PATCH] Some changes --- athena_template.json | 170 +++++++++++++++++++++++++++++++++++++++++ index.js | 43 ++++++----- package-lock.json | 177 ++++++++++++++++++++++++++++++++++++++----- package.json | 6 +- 4 files changed, 354 insertions(+), 42 deletions(-) create mode 100644 athena_template.json diff --git a/athena_template.json b/athena_template.json new file mode 100644 index 0000000..60db6fe --- /dev/null +++ b/athena_template.json @@ -0,0 +1,170 @@ +{ + "created": "", + "updated": "", + "rvn": 0, + "wipeNumber": 1, + "accountId": "", + "profileId": "athena", + "version": "no_version", + "items": { + "loadout1": { + "templateId": "CosmeticLocker:cosmeticlocker_athena", + "attributes": { + "locker_slots_data": { + "slots": { + "MusicPack": { + "items": [ + "" + ] + }, + "Character": { + "items": [ + "" + ], + "activeVariants": [ + null + ] + }, + "Backpack": { + "items": [ + "" + ], + "activeVariants": [ + null + ] + }, + "SkyDiveContrail": { + "items": [ + "" + ], + "activeVariants": [ + null + ] + }, + "Dance": { + "items": [ + "", + "", + "", + "", + "", + "" + ] + }, + "LoadingScreen": { + "items": [ + "" + ] + }, + "Pickaxe": { + "items": [ + "" + ], + "activeVariants": [ + null + ] + }, + "Glider": { + "items": [ + "" + ], + "activeVariants": [ + null + ] + }, + "ItemWrap": { + "items": [ + "", + "", + "", + "", + "", + "", + "" + ], + "activeVariants": [ + null, + null, + null, + null, + null, + null, + null, + null + ] + } + } + }, + "use_count": 0, + "banner_icon_template": "StandardBanner1", + "banner_color_template": "DefaultColor1", + "locker_name": "", + "item_seen": false, + "favorite": false + }, + "quantity": 1 + } + }, + "stats": { + "attributes": { + "past_seasons": [], + "season_match_boost": 999999999, + "loadouts": [ + "loadout1" + ], + "favorite_victorypose": "", + "mfa_reward_claimed": false, + "quest_manager": { + "dailyLoginInterval": "", + "dailyQuestRerolls": 1 + }, + "book_level": 100, + "season_num": 0, + "favorite_consumableemote": "", + "banner_color": "DefaultColor1", + "favorite_callingcard": "", + "favorite_character": "", + "favorite_spray": [], + "book_xp": 100, + "favorite_loadingscreen": "", + "book_purchased": true, + "lifetime_wins": 100, + "favorite_hat": "", + "level": 100, + "favorite_battlebus": "", + "favorite_mapmarker": "", + "favorite_vehicledeco": "", + "accountLevel": 100, + "favorite_backpack": "", + "favorite_dance": [ + "", + "", + "", + "", + "", + "" + ], + "inventory_limit_bonus": 0, + "last_applied_loadout": "", + "favorite_skydivecontrail": "", + "favorite_pickaxe": "", + "favorite_glider": "", + "daily_rewards": {}, + "xp": 999, + "season_friend_match_boost": 999999999, + "active_loadout_index": 0, + "favorite_musicpack": "", + "banner_icon": "StandardBanner1", + "favorite_itemwraps": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "commandRevision": 0 +} \ No newline at end of file diff --git a/index.js b/index.js index 7e70b3d..341c81d 100644 --- a/index.js +++ b/index.js @@ -1,18 +1,22 @@ -const axios = require("axios").default; +const { default: request } = require("axios"); const fs = require("fs"); -var athena = {"created":"","updated":"","rvn":0,"wipeNumber":1,"accountId":"","profileId":"athena","version":"no_version","items":{"loadout1":{"templateId":"CosmeticLocker:cosmeticlocker_athena","attributes":{"locker_slots_data":{"slots":{"MusicPack":{"items":[""]},"Character":{"items":[""],"activeVariants":[null]},"Backpack":{"items":[""],"activeVariants":[null]},"SkyDiveContrail":{"items":[""],"activeVariants":[null]},"Dance":{"items":["","","","","",""]},"LoadingScreen":{"items":[""]},"Pickaxe":{"items":[""],"activeVariants":[null]},"Glider":{"items":[""],"activeVariants":[null]},"ItemWrap":{"items":["","","","","","",""],"activeVariants":[null,null,null,null,null,null,null,null]}}},"use_count":0,"banner_icon_template":"StandardBanner1","banner_color_template":"DefaultColor1","locker_name":"","item_seen":false,"favorite":false},"quantity":1}},"stats":{"attributes":{"past_seasons":[],"season_match_boost":999999999,"loadouts":["loadout1"],"favorite_victorypose":"","mfa_reward_claimed":false,"quest_manager":{"dailyLoginInterval":"","dailyQuestRerolls":1},"book_level":100,"season_num":0,"favorite_consumableemote":"","banner_color":"DefaultColor1","favorite_callingcard":"","favorite_character":"","favorite_spray":[],"book_xp":100,"favorite_loadingscreen":"","book_purchased":true,"lifetime_wins":100,"favorite_hat":"","level":100,"favorite_battlebus":"","favorite_mapmarker":"","favorite_vehicledeco":"","accountLevel":100,"favorite_backpack":"","favorite_dance":["","","","","",""],"inventory_limit_bonus":0,"last_applied_loadout":"","favorite_skydivecontrail":"","favorite_pickaxe":"","favorite_glider":"","daily_rewards":{},"xp":999,"season_friend_match_boost":999999999,"active_loadout_index":0,"favorite_musicpack":"","banner_icon":"StandardBanner1","favorite_itemwraps":["","","","","","",""]}},"commandRevision":0}; +let athena = require("./athena_template.json"); -console.log("Fortnite Athena Profile Generator by Lawin v1.0.0\n\n[GEN] Starting to generate..."); -axios.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => { - var data = resp.data.data; +console.log("Fortnite Athena Profile Generator by Lawin v1.0.2\n"); +request.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => { + let data = resp.data.data; + + console.log("[GEN] Starting to generate...\n"); data.forEach(item => { + if (item.id.toLowerCase().includes("random")) return; + // Credits to PRO100KatYT for backendValue fixes if (item.type.backendValue == "AthenaEmoji" || item.type.backendValue == "AthenaSpray" || item.type.backendValue == "AthenaToy") item.type.backendValue = "AthenaDance"; if (item.type.backendValue == "AthenaPetCarrier") item.type.backendValue = "AthenaBackpack"; - var id = item.type.backendValue + ":" + item.id; - var variants = []; + let id = `${item.type.backendValue}:${item.id}`; + let variants = []; if (item.variants) { item.variants.forEach(obj => { @@ -24,20 +28,17 @@ axios.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => { }) } - // Dont add anything that includes "random" in the id (Chapter 1 Season 4 and 5 crash fix) - if (!item.id.toLowerCase().includes("random")) { - athena.items[id] = { - "templateId": id, - "attributes": { - "max_level_bonus": 0, - "level": 1, - "item_seen": true, - "xp": 0, - "variants": variants, - "favorite": false - }, - "quantity": 1 - } + athena.items[id] = { + "templateId": id, + "attributes": { + "max_level_bonus": 0, + "level": 1, + "item_seen": true, + "xp": 0, + "variants": variants, + "favorite": false + }, + "quantity": 1 } }) diff --git a/package-lock.json b/package-lock.json index 3e69813..4a1e3e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,26 +1,169 @@ { "name": "athenaprofilegenerator", - "version": "1.0.0", - "lockfileVersion": 1, + "version": "1.0.2", + "lockfileVersion": 2, "requires": true, - "dependencies": { - "axios": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", - "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", - "requires": { - "follow-redirects": "^1.14.4" + "packages": { + "": { + "name": "athenaprofilegenerator", + "version": "1.0.2", + "license": "GPL-3.0", + "dependencies": { + "axios": "^1.3.3" } }, - "follow-redirects": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", - "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + "node_modules/axios": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.3.tgz", + "integrity": "sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + } + }, + "dependencies": { + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "axios": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.3.tgz", + "integrity": "sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" } } } diff --git a/package.json b/package.json index d600059..ce4ed4b 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,11 @@ { "name": "athenaprofilegenerator", - "version": "1.0.0", + "version": "1.0.2", "description": "A fortnite athena profile generator made for fortnite backends (LawinServer, etc...)", "main": "index.js", "dependencies": { - "axios": "^0.24.0", - "fs": "^0.0.1-security" + "axios": "^1.3.3" }, - "devDependencies": {}, "scripts": { "start": "node index.js", "test": "echo \"Error: no test specified\" && exit 1"