diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..ed2653d7e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.git/**/* +.example/**/* +.github/**/* +.idea/**/* +.vscode/** +dist/**/* +node_modules/**/* +.env +npm-debug.log +package-lock.json +yarn.lock diff --git a/package-lock.json b/package-lock.json index eb79d88bd..f9bcfc984 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,14 @@ "version": "5.2.2", "license": "MIT", "dependencies": { - "@tf2autobot/bptf-listings": "^5.6.2", + "@tf2autobot/bptf-listings": "^5.6.5", "@tf2autobot/bptf-login": "^2.3.4", - "@tf2autobot/filter-axios-error": "^1.3.1", + "@tf2autobot/filter-axios-error": "^1.4.0", "@tf2autobot/jsonlint": "^1.0.0", "@tf2autobot/steamcommunity": "^3.45.4", "@tf2autobot/tf2": "^1.2.1", "@tf2autobot/tf2-currencies": "^2.0.1", - "@tf2autobot/tf2-schema": "^4.0.0", + "@tf2autobot/tf2-schema": "^4.2.1", "@tf2autobot/tf2-sku": "^2.0.3", "@tf2autobot/tradeoffer-manager": "^2.14.1", "axios": "^0.27.2", @@ -42,11 +42,10 @@ "retry": "^0.13.1", "socket.io-client": "^4.5.1", "steam-totp": "^2.1.2", - "steam-user": "^4.24.5", + "steam-user": "^4.24.6", "steamid": "^2.0.0", "url": "^0.11.0", "valid-url": "^1.0.9", - "websocket-extensions": "^0.1.4", "winston": "^3.8.1", "winston-daily-rotate-file": "^4.7.1", "write-file-atomic": "^4.0.1", @@ -59,7 +58,7 @@ "@types/express": "^4.17.13", "@types/graceful-fs": "^4.1.5", "@types/jest": "^28.1.6", - "@types/node": "^18.0.6", + "@types/node": "^18.6.3", "@types/pluralize": "0.0.29", "@types/request": "^2.48.8", "@types/retry": "^0.12.2", @@ -67,11 +66,11 @@ "@types/valid-url": "^1.0.3", "@types/write-file-atomic": "^4.0.0", "@types/ws": "^8.5.3", - "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.30.7", - "eslint": "^8.20.0", + "@typescript-eslint/eslint-plugin": "^5.32.0", + "@typescript-eslint/parser": "^5.32.0", + "eslint": "^8.21.0", "eslint-config-prettier": "^8.5.0", - "eslint-plugin-jest": "^26.6.0", + "eslint-plugin-jest": "^26.7.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", "jest": "^28.1.3", @@ -780,9 +779,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -793,6 +792,16 @@ "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -1958,11 +1967,11 @@ "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" }, "node_modules/@tf2autobot/bptf-listings": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@tf2autobot/bptf-listings/-/bptf-listings-5.6.2.tgz", - "integrity": "sha512-xsIievP3qWnJMRQziexgHiumdjfJfx1LQVnQY2KRSunzNONHazBMYnBgSi/iATM4sptf6mBDO5oxMYdrLwk2+g==", + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/@tf2autobot/bptf-listings/-/bptf-listings-5.6.5.tgz", + "integrity": "sha512-ZVExpAp432lxf5bjSCrqbiSPayRRPGHObhbuJnmbMPyRYiG6bCJ0v0U1tiwZA8M+mtwssfWgYUynrcpzxho0Qg==", "dependencies": { - "@tf2autobot/filter-axios-error": "^1.3.1", + "@tf2autobot/filter-axios-error": "^1.4.0", "@tf2autobot/tf2-currencies": "^2.0.1", "@tf2autobot/tf2-sku": "^2.0.3", "async": "^3.2.4", @@ -1983,9 +1992,9 @@ } }, "node_modules/@tf2autobot/filter-axios-error": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@tf2autobot/filter-axios-error/-/filter-axios-error-1.3.1.tgz", - "integrity": "sha512-eBP5qK1usrpRGnY59DQ/VeTzhjuG3s5U7bLuDoTcOhvcMHpCEqmi2wIxxWx0+bf6uAuoO2/ieudsXurMlYmmVg==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@tf2autobot/filter-axios-error/-/filter-axios-error-1.4.0.tgz", + "integrity": "sha512-szr8TrRkrpezAullZpHibO3MjvtMmhbE5Hdahw0YFef6Or8xw3pzgUUqEePpeWx05pAQYjvA7TvVtCoC/diiVg==" }, "node_modules/@tf2autobot/jsonlint": { "version": "1.0.0", @@ -2097,9 +2106,9 @@ } }, "node_modules/@tf2autobot/tf2-schema": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tf2autobot/tf2-schema/-/tf2-schema-4.0.0.tgz", - "integrity": "sha512-pf8cp6ZWRfpDdt52aGLong8N+g8n4Is9MIHrDwIGwoIkCnGyJ0WgZqXrhru93jtntWlTTfQ+5YwHuOw8hjx66w==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tf2autobot/tf2-schema/-/tf2-schema-4.2.1.tgz", + "integrity": "sha512-yxn/yL5wjIeYBxzBHvwrTkDVLLg3TCHOmJPaw1yga//7L/gfMNlBgW6nKSljIeQVa/hNqHMqC6KGUjDioYWdUA==", "dependencies": { "@tf2autobot/tf2-sku": "^2.0.3", "async": "^3.2.4", @@ -2309,9 +2318,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.0.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.6.tgz", - "integrity": "sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw==" + "version": "18.6.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz", + "integrity": "sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -2458,14 +2467,14 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz", - "integrity": "sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz", + "integrity": "sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/type-utils": "5.30.7", - "@typescript-eslint/utils": "5.30.7", + "@typescript-eslint/scope-manager": "5.32.0", + "@typescript-eslint/type-utils": "5.32.0", + "@typescript-eslint/utils": "5.32.0", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -2491,14 +2500,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.7.tgz", - "integrity": "sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.32.0.tgz", + "integrity": "sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/typescript-estree": "5.30.7", + "@typescript-eslint/scope-manager": "5.32.0", + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/typescript-estree": "5.32.0", "debug": "^4.3.4" }, "engines": { @@ -2518,13 +2527,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz", - "integrity": "sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz", + "integrity": "sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/visitor-keys": "5.30.7" + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/visitor-keys": "5.32.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2535,12 +2544,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz", - "integrity": "sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz", + "integrity": "sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.30.7", + "@typescript-eslint/utils": "5.32.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -2561,9 +2570,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.7.tgz", - "integrity": "sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.32.0.tgz", + "integrity": "sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2574,13 +2583,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz", - "integrity": "sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz", + "integrity": "sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/visitor-keys": "5.30.7", + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/visitor-keys": "5.32.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2601,15 +2610,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.7.tgz", - "integrity": "sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.32.0.tgz", + "integrity": "sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/typescript-estree": "5.30.7", + "@typescript-eslint/scope-manager": "5.32.0", + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/typescript-estree": "5.32.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -2625,12 +2634,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz", - "integrity": "sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz", + "integrity": "sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.30.7", + "@typescript-eslint/types": "5.32.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -2654,9 +2663,9 @@ } }, "node_modules/acorn": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "bin": { "acorn": "bin/acorn" }, @@ -4366,13 +4375,14 @@ } }, "node_modules/eslint": { - "version": "8.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz", - "integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", + "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -4382,14 +4392,17 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -4430,9 +4443,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "26.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.6.0.tgz", - "integrity": "sha512-f8n46/97ZFdU4KqeQYqO8AEVGIhHWvkpgNBWHH3jrM28/y8llnbf3IjfIKv6p2pZIMinK1PCqbbROxs9Eud02Q==", + "version": "26.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.7.0.tgz", + "integrity": "sha512-/YNitdfG3o3cC6juZziAdkk6nfJt01jXVfj4AgaYVLs7bupHzRDL5K+eipdzhDXtQsiqaX1TzfwSuRlEgeln1A==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" @@ -4616,6 +4629,22 @@ "node": ">=4.0" } }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -4665,6 +4694,21 @@ "node": ">= 0.8.0" } }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -4682,6 +4726,36 @@ "node": ">= 0.8.0" } }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4716,17 +4790,20 @@ } }, "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "dev": true, "dependencies": { - "acorn": "^8.7.1", + "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -5435,6 +5512,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -9931,9 +10014,9 @@ } }, "node_modules/steam-user": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/steam-user/-/steam-user-4.24.5.tgz", - "integrity": "sha512-Qzcvov+bE658AVS+ZDJKuAmXeuJWyUp56HeWTIWwVDGNxD7OJcqNwqkzyH8D0PveE8x+yrWFW+VjjloeUhJxlg==", + "version": "4.24.6", + "resolved": "https://registry.npmjs.org/steam-user/-/steam-user-4.24.6.tgz", + "integrity": "sha512-Xn8w+jdhDEV5VaZjT3tqk6mL2Q+/avwxgtJ7GLjhGXyVC6LKBjs9py/xhmebU19ZdHqolG3bkQDuHqcbeiKonw==", "dependencies": { "@bbob/parser": "^2.2.0", "@doctormckay/stdlib": "^1.11.1", @@ -11501,9 +11584,9 @@ } }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -11511,6 +11594,12 @@ "minimatch": "^3.0.4" } }, + "@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "dev": true + }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -12429,11 +12518,11 @@ "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" }, "@tf2autobot/bptf-listings": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@tf2autobot/bptf-listings/-/bptf-listings-5.6.2.tgz", - "integrity": "sha512-xsIievP3qWnJMRQziexgHiumdjfJfx1LQVnQY2KRSunzNONHazBMYnBgSi/iATM4sptf6mBDO5oxMYdrLwk2+g==", + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/@tf2autobot/bptf-listings/-/bptf-listings-5.6.5.tgz", + "integrity": "sha512-ZVExpAp432lxf5bjSCrqbiSPayRRPGHObhbuJnmbMPyRYiG6bCJ0v0U1tiwZA8M+mtwssfWgYUynrcpzxho0Qg==", "requires": { - "@tf2autobot/filter-axios-error": "^1.3.1", + "@tf2autobot/filter-axios-error": "^1.4.0", "@tf2autobot/tf2-currencies": "^2.0.1", "@tf2autobot/tf2-sku": "^2.0.3", "async": "^3.2.4", @@ -12454,9 +12543,9 @@ } }, "@tf2autobot/filter-axios-error": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@tf2autobot/filter-axios-error/-/filter-axios-error-1.3.1.tgz", - "integrity": "sha512-eBP5qK1usrpRGnY59DQ/VeTzhjuG3s5U7bLuDoTcOhvcMHpCEqmi2wIxxWx0+bf6uAuoO2/ieudsXurMlYmmVg==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@tf2autobot/filter-axios-error/-/filter-axios-error-1.4.0.tgz", + "integrity": "sha512-szr8TrRkrpezAullZpHibO3MjvtMmhbE5Hdahw0YFef6Or8xw3pzgUUqEePpeWx05pAQYjvA7TvVtCoC/diiVg==" }, "@tf2autobot/jsonlint": { "version": "1.0.0", @@ -12543,9 +12632,9 @@ } }, "@tf2autobot/tf2-schema": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tf2autobot/tf2-schema/-/tf2-schema-4.0.0.tgz", - "integrity": "sha512-pf8cp6ZWRfpDdt52aGLong8N+g8n4Is9MIHrDwIGwoIkCnGyJ0WgZqXrhru93jtntWlTTfQ+5YwHuOw8hjx66w==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tf2autobot/tf2-schema/-/tf2-schema-4.2.1.tgz", + "integrity": "sha512-yxn/yL5wjIeYBxzBHvwrTkDVLLg3TCHOmJPaw1yga//7L/gfMNlBgW6nKSljIeQVa/hNqHMqC6KGUjDioYWdUA==", "requires": { "@tf2autobot/tf2-sku": "^2.0.3", "async": "^3.2.4", @@ -12749,9 +12838,9 @@ "dev": true }, "@types/node": { - "version": "18.0.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.6.tgz", - "integrity": "sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw==" + "version": "18.6.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz", + "integrity": "sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg==" }, "@types/node-fetch": { "version": "2.6.1", @@ -12896,14 +12985,14 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz", - "integrity": "sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz", + "integrity": "sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/type-utils": "5.30.7", - "@typescript-eslint/utils": "5.30.7", + "@typescript-eslint/scope-manager": "5.32.0", + "@typescript-eslint/type-utils": "5.32.0", + "@typescript-eslint/utils": "5.32.0", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -12913,52 +13002,52 @@ } }, "@typescript-eslint/parser": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.7.tgz", - "integrity": "sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.32.0.tgz", + "integrity": "sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/typescript-estree": "5.30.7", + "@typescript-eslint/scope-manager": "5.32.0", + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/typescript-estree": "5.32.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz", - "integrity": "sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz", + "integrity": "sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/visitor-keys": "5.30.7" + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/visitor-keys": "5.32.0" } }, "@typescript-eslint/type-utils": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz", - "integrity": "sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz", + "integrity": "sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.30.7", + "@typescript-eslint/utils": "5.32.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.7.tgz", - "integrity": "sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.32.0.tgz", + "integrity": "sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz", - "integrity": "sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz", + "integrity": "sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/visitor-keys": "5.30.7", + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/visitor-keys": "5.32.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -12967,26 +13056,26 @@ } }, "@typescript-eslint/utils": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.7.tgz", - "integrity": "sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.32.0.tgz", + "integrity": "sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/typescript-estree": "5.30.7", + "@typescript-eslint/scope-manager": "5.32.0", + "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/typescript-estree": "5.32.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { - "version": "5.30.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz", - "integrity": "sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz", + "integrity": "sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==", "dev": true, "requires": { - "@typescript-eslint/types": "5.30.7", + "@typescript-eslint/types": "5.32.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -13000,9 +13089,9 @@ } }, "acorn": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==" + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==" }, "acorn-jsx": { "version": "5.3.2", @@ -14330,13 +14419,14 @@ } }, "eslint": { - "version": "8.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz", - "integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", + "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -14346,14 +14436,17 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -14428,6 +14521,16 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, "glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -14462,6 +14565,15 @@ "type-check": "~0.4.0" } }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -14476,6 +14588,24 @@ "word-wrap": "^1.2.3" } }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -14510,9 +14640,9 @@ "requires": {} }, "eslint-plugin-jest": { - "version": "26.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.6.0.tgz", - "integrity": "sha512-f8n46/97ZFdU4KqeQYqO8AEVGIhHWvkpgNBWHH3jrM28/y8llnbf3IjfIKv6p2pZIMinK1PCqbbROxs9Eud02Q==", + "version": "26.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.7.0.tgz", + "integrity": "sha512-/YNitdfG3o3cC6juZziAdkk6nfJt01jXVfj4AgaYVLs7bupHzRDL5K+eipdzhDXtQsiqaX1TzfwSuRlEgeln1A==", "dev": true, "requires": { "@typescript-eslint/utils": "^5.10.0" @@ -14571,12 +14701,12 @@ "dev": true }, "espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "dev": true, "requires": { - "acorn": "^8.7.1", + "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } @@ -15118,6 +15248,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -18487,9 +18623,9 @@ "integrity": "sha512-bTKlc/NoIUQId+my+O556s55DDsNNXfVIPWFDNVu68beql7AJhV0c+GTjFxfwCDYfdc4NkAme+0WrDdnY2D2VA==" }, "steam-user": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/steam-user/-/steam-user-4.24.5.tgz", - "integrity": "sha512-Qzcvov+bE658AVS+ZDJKuAmXeuJWyUp56HeWTIWwVDGNxD7OJcqNwqkzyH8D0PveE8x+yrWFW+VjjloeUhJxlg==", + "version": "4.24.6", + "resolved": "https://registry.npmjs.org/steam-user/-/steam-user-4.24.6.tgz", + "integrity": "sha512-Xn8w+jdhDEV5VaZjT3tqk6mL2Q+/avwxgtJ7GLjhGXyVC6LKBjs9py/xhmebU19ZdHqolG3bkQDuHqcbeiKonw==", "requires": { "@bbob/parser": "^2.2.0", "@doctormckay/stdlib": "^1.11.1", diff --git a/package.json b/package.json index a532c34b7..521cbb977 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,14 @@ "updateMessage": "", "homepage": "https://github.com/TF2Autobot/tf2autobot#readme", "dependencies": { - "@tf2autobot/bptf-listings": "^5.6.2", + "@tf2autobot/bptf-listings": "^5.6.5", "@tf2autobot/bptf-login": "^2.3.4", - "@tf2autobot/filter-axios-error": "^1.3.1", + "@tf2autobot/filter-axios-error": "^1.4.0", "@tf2autobot/jsonlint": "^1.0.0", "@tf2autobot/steamcommunity": "^3.45.4", "@tf2autobot/tf2": "^1.2.1", "@tf2autobot/tf2-currencies": "^2.0.1", - "@tf2autobot/tf2-schema": "^4.0.0", + "@tf2autobot/tf2-schema": "^4.2.1", "@tf2autobot/tf2-sku": "^2.0.3", "@tf2autobot/tradeoffer-manager": "^2.14.1", "axios": "^0.27.2", @@ -59,11 +59,10 @@ "retry": "^0.13.1", "socket.io-client": "^4.5.1", "steam-totp": "^2.1.2", - "steam-user": "^4.24.5", + "steam-user": "^4.24.6", "steamid": "^2.0.0", "url": "^0.11.0", "valid-url": "^1.0.9", - "websocket-extensions": "^0.1.4", "winston": "^3.8.1", "winston-daily-rotate-file": "^4.7.1", "write-file-atomic": "^4.0.1", @@ -76,7 +75,7 @@ "@types/express": "^4.17.13", "@types/graceful-fs": "^4.1.5", "@types/jest": "^28.1.6", - "@types/node": "^18.0.6", + "@types/node": "^18.6.3", "@types/pluralize": "0.0.29", "@types/request": "^2.48.8", "@types/retry": "^0.12.2", @@ -84,11 +83,11 @@ "@types/valid-url": "^1.0.3", "@types/write-file-atomic": "^4.0.0", "@types/ws": "^8.5.3", - "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.30.7", - "eslint": "^8.20.0", + "@typescript-eslint/eslint-plugin": "^5.32.0", + "@typescript-eslint/parser": "^5.32.0", + "eslint": "^8.21.0", "eslint-config-prettier": "^8.5.0", - "eslint-plugin-jest": "^26.6.0", + "eslint-plugin-jest": "^26.7.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", "jest": "^28.1.3", diff --git a/src/app.ts b/src/app.ts index da8a8ce27..180aeec5b 100644 --- a/src/app.ts +++ b/src/app.ts @@ -155,23 +155,33 @@ botManager if (err) { // https://stackoverflow.com/questions/30715367/why-can-i-not-throw-inside-a-promise-catch-handler setTimeout(() => { - if (err instanceof AxiosError) { + /*eslint-disable */ + if (err.response || err.name === 'AxiosError') { // if it's Axios error, filter the error const e = new Error(err.message); - e['status'] = err.response?.status; - if (typeof err.response?.data === 'string' && err.response?.data.includes('')) { - throw e; + e['code'] = err.code; + e['status'] = err.response?.status ?? err.status; + e['method'] = err.config?.method ?? err.method; + e['url'] = err.config?.url?.replace(/\?.+/, '') ?? err.baseURL?.replace(/\?.+/, ''); // Ignore parameters + + if (typeof err.response?.data === 'string' && err.response?.data?.includes('')) { + return throwErr(e); } - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment e['data'] = err.response?.data; - throw e; + return throwErr(e); } + /*eslint-enable */ - throw err; - }); + return throwErr(err); + }, 10); } }); + +function throwErr(err): void { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + process.emit('uncaughtException', err); +} diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index c933828f1..e9cf1c87f 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -1,6 +1,6 @@ import SteamID from 'steamid'; -import SteamUser, { EResult } from 'steam-user'; // { EResult, EPersonaState } gives me crash -import { EPersonaState } from 'steam-user'; +import SteamUser from 'steam-user'; +import { EResult, EPersonaState } from 'steam-user'; import TradeOfferManager, { CustomError } from '@tf2autobot/tradeoffer-manager'; import SteamCommunity from '@tf2autobot/steamcommunity'; import SteamTotp from 'steam-totp'; @@ -793,7 +793,7 @@ export default class Bot { this.addListener(this.manager, 'receivedOfferChanged', this.trades.onOfferChanged.bind(this.trades), true); this.addListener(this.manager, 'offerList', this.trades.onOfferList.bind(this.trades), true); - const promisesChain = [ + const firstTwoChain = [ async () => { log.debug('Calling onRun'); @@ -817,32 +817,11 @@ export default class Bot { async () => { log.info('Signing in to Steam...'); - let lastLoginFailed = false; - - const successResponse = () => { - log.info('Signed in to Steam!'); - }; - - const failResponse = (err: CustomError) => { - this.handler.onLoginError(err); - log.warn('Failed to sign in to Steam: ', err); - throw err; - }; + return await this.login(data.loginKey || null); + } + ]; - await this.login(data.loginKey || null) - .then(successResponse) - .catch(async (err: CustomError) => { - if (!lastLoginFailed && err.eresult === 5) { - this.handler.onLoginError(err); - lastLoginFailed = true; - // Try and sign in without login key - log.warn('Failed to sign in to Steam, retrying without login key...'); - await this.login(null).then(successResponse).catch(failResponse); - } else { - failResponse(err); - } - }); - }, + const promisesChain = [ async () => { log.debug('Waiting for web session'); cookies = await this.getWebSession(); @@ -1017,6 +996,7 @@ export default class Bot { } ]; + let promiseFirstTwo = Promise.resolve(); let promise = Promise.resolve(); return new Promise((resolve, reject) => { @@ -1024,24 +1004,61 @@ export default class Bot { if (this.botManager.isStopping) return reject(); }; - for (const promiseToChain of promisesChain) { - promise = promise.then(promiseToChain).then(checkIfStopping); + for (const promiseToChainFirstTwo of firstTwoChain) { + promiseFirstTwo = promiseFirstTwo.then(promiseToChainFirstTwo).then(checkIfStopping); } - void promise.then(() => { - if (this.options.discordBotToken) { - this.discordBot.setPresence('online'); - } + let lastLoginFailed = false; - this.manager.pollInterval = 5 * 1000; - this.setReady = true; - this.handler.onReady(); - this.manager.doPoll(); - this.startVersionChecker(); - this.initResetCacheInterval(); + const successResponse = () => { + log.info('Signed in to Steam!'); + }; - resolve(); - }); + const failResponse = (err: CustomError) => { + this.handler.onLoginError(err); + log.warn('Failed to sign in to Steam: ', err); + return reject(err); + }; + + promiseFirstTwo + .then(() => { + successResponse(); + }) + .catch(async (err: CustomError) => { + if (!lastLoginFailed && err.eresult === EResult.InvalidPassword) { + this.handler.onLoginError(err); + lastLoginFailed = true; + // Try and sign in without login key + log.warn('Failed to sign in to Steam, retrying without login key...'); + await this.login(null).then(successResponse).catch(failResponse); + } else { + failResponse(err); + } + }) + .finally(() => { + for (const promiseToChain of promisesChain) { + promise = promise.then(promiseToChain).then(checkIfStopping); + } + + promise + .then(() => { + if (this.options.discordBotToken) { + this.discordBot.setPresence('online'); + } + + this.manager.pollInterval = 5 * 1000; + this.setReady = true; + this.handler.onReady(); + this.manager.doPoll(); + this.startVersionChecker(); + this.initResetCacheInterval(); + + resolve(); + }) + .catch(err => { + return reject(err); + }); + }); }); } diff --git a/src/classes/Commands/sub-classes/Crafting.ts b/src/classes/Commands/sub-classes/Crafting.ts index 366a83c9d..d40ae735f 100644 --- a/src/classes/Commands/sub-classes/Crafting.ts +++ b/src/classes/Commands/sub-classes/Crafting.ts @@ -118,10 +118,17 @@ export default class CraftingCommands { const capTokenType = capitalize(tokenType); const capSubTokenType = subTokenType === 'pda2' ? 'PDA2' : capitalize(subTokenType); + if (amount === 'max' && amountCanCraft === 0) { + return this.bot.sendMessage( + steamID, + `❌ Unable to craft ${capTokenType} Token - ${capSubTokenType} since I only have of ${capSubTokenType} ${tokenType} items.` + ); + } + if (amount !== 'max' && amount > amountCanCraft) { return this.bot.sendMessage( steamID, - `❌ I can only craft ${amountCanCraft} ${capTokenType} Token - ${capSubTokenType} at the moment, since I only ` + + `❌ I can only craft ${amountCanCraft} ${capTokenType} Token - ${capSubTokenType} at the moment, since I only ` + `have ${availableAmount} of ${capSubTokenType} ${tokenType} items.` ); } diff --git a/src/classes/Commands/sub-classes/Manager.ts b/src/classes/Commands/sub-classes/Manager.ts index c2049730c..70883fb36 100644 --- a/src/classes/Commands/sub-classes/Manager.ts +++ b/src/classes/Commands/sub-classes/Manager.ts @@ -965,7 +965,11 @@ export default class ManagerCommands { ); this.bot.sendMessage(steamID, '⌛ Installing packages...'); - await exec(`npm install${process.env.RUN_ON_ANDROID === 'true' ? ' --no-bin-links --force' : ''}`); + await exec( + `npm install${ + process.env.RUN_ON_ANDROID === 'true' ? ' --no-bin-links --force' : '' + } --omit=dev` + ); this.bot.sendMessage(steamID, '⌛ Compiling TypeScript codes into JavaScript...'); await exec('npm run build'); diff --git a/src/classes/Commands/sub-classes/Misc.ts b/src/classes/Commands/sub-classes/Misc.ts index 23802ae6b..074f87c3d 100644 --- a/src/classes/Commands/sub-classes/Misc.ts +++ b/src/classes/Commands/sub-classes/Misc.ts @@ -8,8 +8,7 @@ import CommandParser from '../../CommandParser'; import Bot from '../../Bot'; import { Discord, Stock } from '../../Options'; import { pure, timeNow, uptime, testPriceKey } from '../../../lib/tools/export'; -import { killstreakersData, sheensData, spellsData } from '../../../lib/data'; -import { Paints, StrangeParts } from '@tf2autobot/tf2-schema'; +import getAttachmentName from '../../../lib/tools/getAttachmentName'; type Misc = 'time' | 'uptime' | 'pure' | 'rate' | 'owner' | 'discord' | 'stock'; type CraftUncraft = 'craftweapon' | 'uncraftweapon'; @@ -374,15 +373,3 @@ export default class MiscCommands { return stock; } } - -function getKeyByValue(object: { [key: string]: any }, value: any): string { - return Object.keys(object).find(key => object[key] === value); -} - -function getAttachmentName(attachment: string, pSku: string, paints: Paints, parts: StrangeParts): string { - if (attachment === 's') return getKeyByValue(spellsData, pSku); - else if (attachment === 'sp') return getKeyByValue(parts, pSku); - else if (attachment === 'ke') return getKeyByValue(killstreakersData, pSku); - else if (attachment === 'ks') return getKeyByValue(sheensData, pSku); - else if (attachment === 'p') return getKeyByValue(paints, parseInt(pSku.replace('p', ''))); -} diff --git a/src/classes/Commands/sub-classes/PricelistManager.ts b/src/classes/Commands/sub-classes/PricelistManager.ts index 48c38a99b..0b7ae6472 100644 --- a/src/classes/Commands/sub-classes/PricelistManager.ts +++ b/src/classes/Commands/sub-classes/PricelistManager.ts @@ -2273,14 +2273,15 @@ export default class PricelistManagerCommands { const isPremium = this.bot.handler.getBotInfo.premium; const list = filter.map((entry, i) => { + const priceKey = entry.id ? entry.id : entry.sku; const name = entry.name; const stock = this.bot.inventoryManager.getInventory.getAmount({ - priceKey: entry.sku, + priceKey, includeNonNormalized: false, tradableOnly: true }); - return `${i + 1}. ${entry.sku} - ${name}${name.length > 40 ? '\n' : ' '}(${stock}, ${entry.min}, ${ + return `${i + 1}. ${priceKey} - ${name}${name.length > 40 ? '\n' : ' '}(${stock}, ${entry.min}, ${ entry.max }, ${entry.intent === 2 ? 'bank' : entry.intent === 1 ? 'sell' : 'buy'}, ${ entry.enabled ? '✅' : '❌' diff --git a/src/classes/Commands/sub-classes/Request.ts b/src/classes/Commands/sub-classes/Request.ts index fad77a0a8..eaacdfa52 100644 --- a/src/classes/Commands/sub-classes/Request.ts +++ b/src/classes/Commands/sub-classes/Request.ts @@ -11,6 +11,7 @@ import { fixItem } from '../../../lib/items'; import { testPriceKey } from '../../../lib/tools/export'; import { UnknownDictionary } from '../../../types/common'; import IPricer, { RequestCheckFn, RequestCheckResponse } from '../../IPricer'; +import Pricelist from '../../Pricelist'; export default class RequestCommands { constructor(private readonly bot: Bot, private priceSource: IPricer) { @@ -70,7 +71,9 @@ export default class RequestCommands { } const pricelist = this.bot.pricelist.getPrices; - const skus = Object.keys(pricelist).filter(sku => sku !== '5021;6'); + const skus = Object.keys(pricelist).filter( + sku => sku !== '5021;6' && !Pricelist.isAssetId(sku) && !/;[p][0-9]+/.test(sku) + ); const total = skus.length; const totalTime = total * 2 * 1000; diff --git a/src/classes/Inventory.ts b/src/classes/Inventory.ts index f3f6f23a7..a4cc57a04 100644 --- a/src/classes/Inventory.ts +++ b/src/classes/Inventory.ts @@ -250,11 +250,12 @@ export default class Inventory { } } - return accAmount - amountToDeduct; + return accAmount === 1 && amountToDeduct === 1 ? 1 : accAmount - amountToDeduct; } // else just return amount - return this.findBySKU(sku, tradableOnly).length - amountToDeduct; + const amount = this.findBySKU(sku, tradableOnly).length; + return amount === 1 && amountToDeduct === 1 ? 1 : amount - amountToDeduct; } getAmountOfGenerics({ diff --git a/src/classes/Listings.ts b/src/classes/Listings.ts index d39cda2b9..76e4e440e 100644 --- a/src/classes/Listings.ts +++ b/src/classes/Listings.ts @@ -7,11 +7,11 @@ import Bot from './Bot'; import Pricelist, { Entry, PricesObject } from './Pricelist'; import log from '../lib/logger'; import { exponentialBackoff } from '../lib/helpers'; -import { noiseMakers, spellsData, killstreakersData, sheensData } from '../lib/data'; +import { noiseMakers } from '../lib/data'; import { DictItem } from './Inventory'; import { PaintedNames } from './Options'; -import { Paints, StrangeParts } from '@tf2autobot/tf2-schema'; import ListingManager from '@tf2autobot/bptf-listings'; +import getAttachmentName from '../lib/tools/getAttachmentName'; export default class Listings { private checkingAllListings = false; @@ -717,18 +717,6 @@ export default class Listings { type Attachment = 's' | 'sp' | 'ke' | 'ks' | 'p'; -function getKeyByValue(object: { [key: string]: any }, value: any): string { - return Object.keys(object).find(key => object[key] === value); -} - -function getAttachmentName(attachment: string, pSKU: string, paints: Paints, parts: StrangeParts): string { - if (attachment === 's') return getKeyByValue(spellsData, pSKU); - else if (attachment === 'sp') return getKeyByValue(parts, pSKU); - else if (attachment === 'ke') return getKeyByValue(killstreakersData, pSKU); - else if (attachment === 'ks') return getKeyByValue(sheensData, pSKU); - else if (attachment === 'p') return getKeyByValue(paints, parseInt(pSKU.replace('p', ''))); -} - function boldDetails(str: string, style: number): string { // https://lingojam.com/BoldTextGenerator diff --git a/src/classes/MyHandler/MyHandler.ts b/src/classes/MyHandler/MyHandler.ts index e65ea7462..3d004a7a5 100644 --- a/src/classes/MyHandler/MyHandler.ts +++ b/src/classes/MyHandler/MyHandler.ts @@ -258,13 +258,13 @@ export default class MyHandler extends Handler { keepMetalSupply(this.bot, this.minimumScrap, this.minimumReclaimed, this.combineThreshold); // Craft duplicate weapons - void craftDuplicateWeapons(this.bot); - - // Craft class weapons - this.classWeaponsTimeout = setTimeout(() => { - // called after 5 seconds to craft metals and duplicated weapons first. - void craftClassWeapons(this.bot); - }, 5 * 1000); + craftDuplicateWeapons(this.bot) + .then(() => { + return craftClassWeapons(this.bot); + }) + .catch(err => { + log.warn('Failed to craft duplicated craft/class weapons', err); + }); } if (this.isDeletingUntradableJunk) { @@ -679,8 +679,9 @@ export default class MyHandler extends Handler { // Get High-value items items[which][sku].forEach(item => { if (item.hv !== undefined) { + const priceKey = this.bot.pricelist.hasPrice({ priceKey: item.id }) ? item.id : sku; // If hv exist, get the high value and assign into items - getHighValue[which].items[sku] = item.hv; + getHighValue[which].items[priceKey] = item.hv; Object.keys(item.hv).forEach(attachment => { if (item.hv[attachment] !== undefined) { @@ -696,7 +697,8 @@ export default class MyHandler extends Handler { } }); } else if (item.isFullUses !== undefined) { - getHighValue[which].items[sku] = { isFull: item.isFullUses }; + const priceKey = this.bot.pricelist.hasPrice({ priceKey: item.id }) ? item.id : sku; + getHighValue[which].items[priceKey] = { isFull: item.isFullUses }; if (which === 'their') { // Only check for their side @@ -2203,18 +2205,14 @@ export default class MyHandler extends Handler { // Smelt / combine metal keepMetalSupply(this.bot, this.minimumScrap, this.minimumReclaimed, this.combineThreshold); - // Craft duplicated weapons - void craftDuplicateWeapons(this.bot); - - this.classWeaponsTimeout = setTimeout(() => { - // called after 5 second to craft metals and duplicated weapons first. - void craftClassWeapons(this.bot); - }, 5 * 1000); - } - - if (this.isDeletingUntradableJunk) { - // Delete untradable junk - this.deleteUntradableJunk(); + // Craft duplicate weapons + craftDuplicateWeapons(this.bot) + .then(() => { + return craftClassWeapons(this.bot); + }) + .catch(err => { + log.warn('Failed to craft duplicated craft/class weapons', err); + }); } // Sort inventory @@ -2495,7 +2493,7 @@ export default class MyHandler extends Handler { clearTimeout(this.retryRequest); this.retryRequest = setTimeout(() => { - void this.getBPTFAccountInfo().catch(() => { + this.getBPTFAccountInfo().catch(() => { // ignore error }); }, 5 * 60 * 1000); @@ -2544,7 +2542,9 @@ export default class MyHandler extends Handler { for (const assetid of assetidsToDelete) { log.debug(`Deleting junk item ${assetid}`); - this.bot.tf2gc.deleteItem(assetid); + this.bot.tf2gc.deleteItem(assetid, err => { + log.warn('Error deleting untradable junk', err); + }); } } diff --git a/src/classes/MyHandler/utils/craftClassWeapons.ts b/src/classes/MyHandler/utils/craftClassWeapons.ts index e8a780419..db698947d 100644 --- a/src/classes/MyHandler/utils/craftClassWeapons.ts +++ b/src/classes/MyHandler/utils/craftClassWeapons.ts @@ -17,13 +17,13 @@ export type ClassesForCraftableWeapons = export type SlotsForCraftableWeapons = 'primary' | 'secondary' | 'melee' | 'pda2'; -export default function craftClassWeapons(bot: Bot): Promise { +export default async function craftClassWeapons(bot: Bot): Promise { if (!bot.options.crafting.weapons.enable) { return; } const currencies = bot.inventoryManager.getInventory.getCurrencies(bot.craftWeapons, false); - void Promise.all( + await Promise.all( ['scout', 'soldier', 'pyro', 'demoman', 'heavy', 'engineer', 'medic', 'sniper', 'spy'].map(classChar => craftEachClassWeapons(bot, bot.craftWeaponsByClass[classChar as ClassesForCraftableWeapons], currencies) ) diff --git a/src/classes/Pricelist.ts b/src/classes/Pricelist.ts index f10b0c35b..c50b077b1 100644 --- a/src/classes/Pricelist.ts +++ b/src/classes/Pricelist.ts @@ -77,7 +77,13 @@ export class Entry implements EntryData { this.autoprice = entry.autoprice; this.min = entry.min; this.max = entry.max; - this.intent = entry.intent; + + if (entry.id) { + // Always set to sell if id is defined + this.intent = 1; + } else { + this.intent = entry.intent; + } if (entry.buy && entry.sell) { // Added both buy and sell diff --git a/src/classes/Trades.ts b/src/classes/Trades.ts index fcf393213..8c3e7cc42 100644 --- a/src/classes/Trades.ts +++ b/src/classes/Trades.ts @@ -1653,21 +1653,23 @@ export default class Trades { offer.itemsToGive.forEach(item => this.bot.inventoryManager.getInventory.removeItem(item.assetid)); } - // Exit all running apps ("TF2Autobot" or custom, and Team Fortress 2) - // Will play again after craft/smelt/sort inventory job - // https://github.com/TF2Autobot/tf2autobot/issues/527 - this.bot.client.gamesPlayed([]); - if ( offer.state === TradeOfferManager.ETradeOfferState['Active'] || offer.state === TradeOfferManager.ETradeOfferState['CreatedNeedsConfirmation'] || offer.state === TradeOfferManager.ETradeOfferState['Countered'] || (oldState === TradeOfferManager.ETradeOfferState['Countered'] && + offer.state === TradeOfferManager.ETradeOfferState['Declined']) || + (oldState === TradeOfferManager.ETradeOfferState['Active'] && offer.state === TradeOfferManager.ETradeOfferState['Declined']) ) { // Offer is active, or countered, or declined countered, no need to fetch // Do nothing } else { + // Exit all running apps ("TF2Autobot" or custom, and Team Fortress 2) + // Will play again after craft/smelt/sort inventory job + // https://github.com/TF2Autobot/tf2autobot/issues/527 + this.bot.client.gamesPlayed([]); + this.offerChangedAcc.push({ offer, oldState, timeTakenToComplete }); log.debug('Accumulated offerChanged: ', this.offerChangedAcc.length); diff --git a/src/lib/pricer/pricestf/prices-tf-api.ts b/src/lib/pricer/pricestf/prices-tf-api.ts index 0834da348..e6391d5be 100644 --- a/src/lib/pricer/pricestf/prices-tf-api.ts +++ b/src/lib/pricer/pricestf/prices-tf-api.ts @@ -1,5 +1,5 @@ import axios, { AxiosRequestConfig, Method, AxiosError } from 'axios'; -import filterAxiosError from '@tf2autobot/filter-axios-error'; +import filterAxiosError, { ErrorFiltered } from '@tf2autobot/filter-axios-error'; import { PricerOptions } from '../../../classes/IPricer'; import log from '../../logger'; @@ -63,8 +63,8 @@ export default class PricesTfApi { ...headers }); } catch (e) { - const err = e as AxiosError; - if (err.response && err.response.status === 401) { + const err = e as ErrorFiltered; + if (err?.status === 401) { log.debug('Requesting new token from prices.tf due to 401'); await this.setupToken(); return this.authedApiRequest(httpMethod, path, params, data, headers); @@ -123,16 +123,12 @@ export default class PricesTfApi { } async setupToken(): Promise { - return new Promise((resolve, reject) => { - void PricesTfApi.requestAuthAccess() - .then(response => { - this.token = response.accessToken; - resolve(); - }) - .catch(err => { - reject(err); - }); - }); + try { + const r = await PricesTfApi.requestAuthAccess(); + this.token = r.accessToken; + } catch (e) { + log.error(e as Error); + } } async requestCheck(sku: string): Promise { diff --git a/src/lib/tools/getAttachmentName.ts b/src/lib/tools/getAttachmentName.ts new file mode 100644 index 000000000..a78757334 --- /dev/null +++ b/src/lib/tools/getAttachmentName.ts @@ -0,0 +1,19 @@ +import { spellsData, killstreakersData, sheensData } from '../data'; +import { Paints, StrangeParts } from '@tf2autobot/tf2-schema'; + +function getKeyByValue(object: { [key: string]: any }, value: any): string { + return Object.keys(object).find(key => object[key] === value); +} + +export default function getAttachmentName( + attachment: string, + pSKU: string, + paints: Paints, + parts: StrangeParts +): string { + if (attachment === 's') return getKeyByValue(spellsData, pSKU); + else if (attachment === 'sp') return getKeyByValue(parts, pSKU); + else if (attachment === 'ke') return getKeyByValue(killstreakersData, pSKU); + else if (attachment === 'ks') return getKeyByValue(sheensData, pSKU); + else if (attachment === 'p') return getKeyByValue(paints, parseInt(pSKU.replace('p', ''))); +} diff --git a/src/lib/tools/getHighValue.ts b/src/lib/tools/getHighValue.ts index a59b4f602..fc36ccdd4 100644 --- a/src/lib/tools/getHighValue.ts +++ b/src/lib/tools/getHighValue.ts @@ -1,9 +1,9 @@ import SKU from '@tf2autobot/tf2-sku'; import { Items } from '@tf2autobot/tradeoffer-manager'; -import { spellsData, killstreakersData, sheensData } from '../data'; import Bot from '../../classes/Bot'; -import { Paints, StrangeParts } from '@tf2autobot/tf2-schema'; import { testPriceKey } from '../tools/export'; +import getAttachmentName from './getAttachmentName'; +import Pricelist from '../../classes/Pricelist'; interface ItemsWithName { [name: string]: string; @@ -68,24 +68,11 @@ export default function getHighValueItems(items: Items, bot: Bot): ItemsWithName } }); - itemsWithName[bot.schema.getName(SKU.fromString(sku.replace(/;p\d+/, '')))] = toString; + const nameSku = Pricelist.isAssetId(sku) ? bot.pricelist.getPrice({ priceKey: sku }).sku : sku; + itemsWithName[bot.schema.getName(SKU.fromString(nameSku.replace(/;p\d+/, '')))] = toString; } return itemsWithName; } type Attachment = 's' | 'sp' | 'ke' | 'ks' | 'p'; - -function getAttachmentName(attachment: string, pSKU: string, paints: Paints, parts: StrangeParts): string { - if (attachment === 's') return getKeyByValue(spellsData, pSKU); - else if (attachment === 'sp') return getKeyByValue(parts, pSKU); - else if (attachment === 'ke') return getKeyByValue(killstreakersData, pSKU); - else if (attachment === 'ks') return getKeyByValue(sheensData, pSKU); - else if (attachment === 'p') return getKeyByValue(paints, parseInt(pSKU.replace('p', ''))); -} - -function getKeyByValue(object: { [key: string]: any }, value: any): string { - const keys = Object.keys(object); - const key = keys.find(key => object[key] === value); - return key; -}