From 8ff62c6008c1e299bbe958a8aa5aebf450bd9990 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Wed, 2 Nov 2022 21:32:38 -0300 Subject: [PATCH 1/5] Update http request and move versions to core I'm changing the fetch server to bds core because it's light enough to keep in core, but I'll have to remove mongoose I'm intending to keep a statistical page of versions. Changes: - HTTP Requests saparated and move to @http in core. - server version move to core (alpha). --- package-lock.json | 2132 +++++++++++++++++- package.json | 11 +- src/globalPlatfroms.ts | 9 - src/index.ts | 6 +- src/lib/processLoad.ts | 203 -- src/lib/request/client.ts | 26 + src/lib/request/github.ts | 107 + src/lib/request/large.ts | 53 + src/lib/request/simples.ts | 70 + src/lib/versions/db/bedrock.ts | 38 + src/lib/versions/db/connect.ts | 8 + src/lib/versions/db/java.ts | 33 + src/lib/versions/db/paper.ts | 42 + src/lib/versions/db/pocketmine.ts | 21 + src/lib/versions/db/powernukkit.ts | 37 + src/lib/versions/db/spigot.ts | 33 + src/lib/versions/exports.ts | 76 + src/lib/versions/fetchVersion/Bedrock.ts | 42 + src/lib/versions/fetchVersion/Java.ts | 35 + src/lib/versions/fetchVersion/Paper.ts | 48 + src/lib/versions/fetchVersion/Pocketmine.ts | 40 + src/lib/versions/fetchVersion/Powernukkit.ts | 161 ++ src/lib/versions/fetchVersion/Spigot.ts | 35 + src/lib/versions/fetchVersion/index.ts | 53 + src/lib/versions/fetchVersion/types/Java.ts | 165 ++ src/lib/versions/index.ts | 76 + tsconfig.json | 54 +- 27 files changed, 3279 insertions(+), 335 deletions(-) delete mode 100644 src/lib/processLoad.ts create mode 100644 src/lib/request/client.ts create mode 100644 src/lib/request/github.ts create mode 100644 src/lib/request/large.ts create mode 100644 src/lib/request/simples.ts create mode 100644 src/lib/versions/db/bedrock.ts create mode 100644 src/lib/versions/db/connect.ts create mode 100644 src/lib/versions/db/java.ts create mode 100644 src/lib/versions/db/paper.ts create mode 100644 src/lib/versions/db/pocketmine.ts create mode 100644 src/lib/versions/db/powernukkit.ts create mode 100644 src/lib/versions/db/spigot.ts create mode 100644 src/lib/versions/exports.ts create mode 100644 src/lib/versions/fetchVersion/Bedrock.ts create mode 100644 src/lib/versions/fetchVersion/Java.ts create mode 100644 src/lib/versions/fetchVersion/Paper.ts create mode 100644 src/lib/versions/fetchVersion/Pocketmine.ts create mode 100644 src/lib/versions/fetchVersion/Powernukkit.ts create mode 100644 src/lib/versions/fetchVersion/Spigot.ts create mode 100644 src/lib/versions/fetchVersion/index.ts create mode 100644 src/lib/versions/fetchVersion/types/Java.ts create mode 100644 src/lib/versions/index.ts diff --git a/package-lock.json b/package-lock.json index 1cb3f1b..789c535 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,24 +13,1023 @@ "adm-zip": "^0.5.9", "cron": "^2.1.0", "got": "^12.5.2", + "jsdom": "^20.0.2", + "mongoose": "^6.7.1", "prismarine-nbt": "^2.2.1", - "tar": "^6.1.11" + "tar": "^6.1.12" }, "devDependencies": { "@types/adm-zip": "^0.5.0", "@types/cron": "^2.0.0", + "@types/jsdom": "^20.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.11.0", + "@types/node": "^18.11.9", "@types/tar": "^6.1.3", "mocha": "^10.1.0", "ts-node": "^10.9.1", - "typedoc": "^0.23.16", + "typedoc": "^0.23.19", "typescript": "^4.8.4" }, "engines": { "node": ">=16.0.0" } }, + "node_modules/@aws-crypto/ie11-detection": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-2.0.2.tgz", + "integrity": "sha512-5XDMQY98gMAf/WRTic5G++jfmS/VLM0rwpiOpaainKi4L0nqWMSB1SzsrEG5rjFZGYN6ZAefO+/Yta2dFM0kMw==", + "optional": true, + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-2.0.0.tgz", + "integrity": "sha512-rYXOQ8BFOaqMEHJrLHul/25ckWH6GTJtdLSajhlqGMx0PmSueAuvboCuZCTqEKlxR8CQOwRarxYMZZSYlhRA1A==", + "optional": true, + "dependencies": { + "@aws-crypto/ie11-detection": "^2.0.0", + "@aws-crypto/sha256-js": "^2.0.0", + "@aws-crypto/supports-web-crypto": "^2.0.0", + "@aws-crypto/util": "^2.0.0", + "@aws-sdk/types": "^3.1.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-2.0.0.tgz", + "integrity": "sha512-VZY+mCY4Nmrs5WGfitmNqXzaE873fcIZDu54cbaDaaamsaTOP1DBImV9F4pICc3EHjQXujyE8jig+PFCaew9ig==", + "optional": true, + "dependencies": { + "@aws-crypto/util": "^2.0.0", + "@aws-sdk/types": "^3.1.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-2.0.2.tgz", + "integrity": "sha512-6mbSsLHwZ99CTOOswvCRP3C+VCWnzBf+1SnbWxzzJ9lR0mA0JnY2JEAhp8rqmTE0GPFy88rrM27ffgp62oErMQ==", + "optional": true, + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-2.0.2.tgz", + "integrity": "sha512-Lgu5v/0e/BcrZ5m/IWqzPUf3UYFTy/PpeED+uc9SWUR1iZQL8XXbGQg10UfllwwBryO3hFF5dizK+78aoXC1eA==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "^3.110.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-sdk/abort-controller": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.201.0.tgz", + "integrity": "sha512-xJ984k+CKlGjBmvNarzM8Y+b6X4L1Zt0TycQmVBJq7fAr/ju9l13pQIoXR5WlDIW1FkGeVczF5Nu6fN46SCORQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.202.0.tgz", + "integrity": "sha512-PebtNMe214k8ueVtC12SaXHgtfdBpGsbxg81nkGddzesYLhqsBIKlcAyI+ZotrXU50NJ8+rEzxslNleLZ0NI+w==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/client-sts": "3.202.0", + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/hash-node": "3.201.0", + "@aws-sdk/invalid-dependency": "3.201.0", + "@aws-sdk/middleware-content-length": "3.201.0", + "@aws-sdk/middleware-endpoint": "3.201.0", + "@aws-sdk/middleware-host-header": "3.201.0", + "@aws-sdk/middleware-logger": "3.201.0", + "@aws-sdk/middleware-recursion-detection": "3.201.0", + "@aws-sdk/middleware-retry": "3.201.0", + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/middleware-signing": "3.201.0", + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/middleware-user-agent": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/node-http-handler": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/smithy-client": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64-node": "3.201.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.201.0", + "@aws-sdk/util-defaults-mode-browser": "3.201.0", + "@aws-sdk/util-defaults-mode-node": "3.201.0", + "@aws-sdk/util-endpoints": "3.202.0", + "@aws-sdk/util-user-agent-browser": "3.201.0", + "@aws-sdk/util-user-agent-node": "3.201.0", + "@aws-sdk/util-utf8-browser": "3.188.0", + "@aws-sdk/util-utf8-node": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.202.0.tgz", + "integrity": "sha512-c0impiZUbJeB5AdyZyER81tsqF9bxxaEz6p2LYkTn62NWVXPWEUo/1CHQRj36MUzorz1xiWKIN0NPgK6GBJkPQ==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/hash-node": "3.201.0", + "@aws-sdk/invalid-dependency": "3.201.0", + "@aws-sdk/middleware-content-length": "3.201.0", + "@aws-sdk/middleware-endpoint": "3.201.0", + "@aws-sdk/middleware-host-header": "3.201.0", + "@aws-sdk/middleware-logger": "3.201.0", + "@aws-sdk/middleware-recursion-detection": "3.201.0", + "@aws-sdk/middleware-retry": "3.201.0", + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/middleware-user-agent": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/node-http-handler": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/smithy-client": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64-node": "3.201.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.201.0", + "@aws-sdk/util-defaults-mode-browser": "3.201.0", + "@aws-sdk/util-defaults-mode-node": "3.201.0", + "@aws-sdk/util-endpoints": "3.202.0", + "@aws-sdk/util-user-agent-browser": "3.201.0", + "@aws-sdk/util-user-agent-node": "3.201.0", + "@aws-sdk/util-utf8-browser": "3.188.0", + "@aws-sdk/util-utf8-node": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.202.0.tgz", + "integrity": "sha512-WGRFzODig8+cZR903q3fa7OAzGigSuzD9AoK+ybefQa7bxSuhT2ous4GNPOJz9WYWvugEPyrJu8vbG35IoF1ZQ==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/hash-node": "3.201.0", + "@aws-sdk/invalid-dependency": "3.201.0", + "@aws-sdk/middleware-content-length": "3.201.0", + "@aws-sdk/middleware-endpoint": "3.201.0", + "@aws-sdk/middleware-host-header": "3.201.0", + "@aws-sdk/middleware-logger": "3.201.0", + "@aws-sdk/middleware-recursion-detection": "3.201.0", + "@aws-sdk/middleware-retry": "3.201.0", + "@aws-sdk/middleware-sdk-sts": "3.201.0", + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/middleware-signing": "3.201.0", + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/middleware-user-agent": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/node-http-handler": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/smithy-client": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64-node": "3.201.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.201.0", + "@aws-sdk/util-defaults-mode-browser": "3.201.0", + "@aws-sdk/util-defaults-mode-node": "3.201.0", + "@aws-sdk/util-endpoints": "3.202.0", + "@aws-sdk/util-user-agent-browser": "3.201.0", + "@aws-sdk/util-user-agent-node": "3.201.0", + "@aws-sdk/util-utf8-browser": "3.188.0", + "@aws-sdk/util-utf8-node": "3.201.0", + "fast-xml-parser": "4.0.11", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/config-resolver": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/config-resolver/-/config-resolver-3.201.0.tgz", + "integrity": "sha512-6YLIel7OGMGi+r8XC1A54cQJRIpx/NJ4fBALy44zFpQ+fdJUEmw4daUf1LECmAQiPA2Pr/hD0nBtX+wiiTf5/g==", + "optional": true, + "dependencies": { + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-config-provider": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-cognito-identity": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.202.0.tgz", + "integrity": "sha512-W/Z4Zf05Yw5ya5SU1UO6xz/OZtxCzMMQmmb71eAHWsh/LIlJ9A3IFsAnAveG7eISTpFjMadT7n6mfsYt/eWgoQ==", + "optional": true, + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.202.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.201.0.tgz", + "integrity": "sha512-g2MJsowzFhSsIOITUjYp7EzWFeHINjEP526Uf+5z2/p2kxQVwYYWZQK7j+tPE2Bk3MEjGOCmVHbbE7IFj0rNHw==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-imds": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.201.0.tgz", + "integrity": "sha512-i8U2k3/L3iUWJJ1GSlwVBMfLQ2OTUT97E8yJi/xz5GavYuPOsUQWQe4fp7WGQivxh+AqybXAGFUCYub6zfUqag==", + "optional": true, + "dependencies": { + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.202.0.tgz", + "integrity": "sha512-d0kiYMpGzAq3EBXgEJ1SdeoMXVf3lk6NKHDi/Gy8LB03sZqgc5cY4XFCnY3cqE3DNWWZNR26M4j/KiA0LIjAVA==", + "optional": true, + "dependencies": { + "@aws-sdk/credential-provider-env": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-web-identity": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.202.0.tgz", + "integrity": "sha512-/uHNs3c1O3oFpH7z9nnpjyg8NKNyRbNxUDIHkuHkNSUUKXpfBisDX6TMbD4VcflGuNdkbT+8spkw5vsE8ox3ig==", + "optional": true, + "dependencies": { + "@aws-sdk/credential-provider-env": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/credential-provider-ini": "3.202.0", + "@aws-sdk/credential-provider-process": "3.201.0", + "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-web-identity": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.201.0.tgz", + "integrity": "sha512-jTK3HSZgNj/hVrWb0wuF/cPUWSJYoRI/80fnN55o6QLS8WWIgOI8o2PNeVTAT5OrKioSoN4fgKTeUm3DZy3npQ==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.202.0.tgz", + "integrity": "sha512-EBUY/qKboJwy3qxPHiD/LAnhzga4xR1p++QMoxg2BKgkgwlvGb23lYGr5DSCNhdtJj5o165YZDbGYH+PKn2NVw==", + "optional": true, + "dependencies": { + "@aws-sdk/client-sso": "3.202.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.201.0.tgz", + "integrity": "sha512-U54bqhYaClPVZfswgknhlICp3BAtKXpOgHQCUF8cko5xUgbL4lVgd1rC3lWviGFMQAaTIF3QOXyEouemxr3VXw==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.202.0.tgz", + "integrity": "sha512-CQVSlKh+V4X3tWv+6IJFB8Io89bwErQSP6m7pGynrwH37dr0jg04A5WQQt+l8tRX8NSteVYrAyxebefLnWMTyA==", + "optional": true, + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.202.0", + "@aws-sdk/client-sso": "3.202.0", + "@aws-sdk/client-sts": "3.202.0", + "@aws-sdk/credential-provider-cognito-identity": "3.202.0", + "@aws-sdk/credential-provider-env": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/credential-provider-ini": "3.202.0", + "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/credential-provider-process": "3.201.0", + "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-web-identity": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/fetch-http-handler": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.201.0.tgz", + "integrity": "sha512-uiEoH79j6WOpbp4THcpvD9XmD+vPgy+00oyYXjtZqJnv2PM/9b6tGWKTdI+TJW4P/oPv7HP7JmRlkGaTnkIdXw==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/querystring-builder": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/hash-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/hash-node/-/hash-node-3.201.0.tgz", + "integrity": "sha512-WJsMZg5/TMoWnLM+0NuwLwFzHsi89Bi9J1Dt7JdJHXFLoEZV54FEz1PK/Sq5NOldhVljpXQwWOB2dHA2wxFztg==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/invalid-dependency": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/invalid-dependency/-/invalid-dependency-3.201.0.tgz", + "integrity": "sha512-f/zgntOfIozNyKSaG9dvHjjBaR3y20kYNswMYkSuCM2NIT5LpyHiiq5I11TwaocatUFcDztWpcsv7vHpIgI5Ig==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/is-array-buffer": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/is-array-buffer/-/is-array-buffer-3.201.0.tgz", + "integrity": "sha512-UPez5qLh3dNgt0DYnPD/q0mVJY84rA17QE26hVNOW3fAji8W2wrwrxdacWOxyXvlxWsVRcKmr+lay1MDqpAMfg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-content-length": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-content-length/-/middleware-content-length-3.201.0.tgz", + "integrity": "sha512-p4G9AtdrKO8A3Z4RyZiy0isEYwuge7bQRBS7UzcGkcIOhJONq2pcM+gRZYz+NWvfYYNWUg5uODsFQfU8342yKg==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-endpoint": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-endpoint/-/middleware-endpoint-3.201.0.tgz", + "integrity": "sha512-F3JlXo5GusbeZR956hA9VxmDxUeg77Xh6o8fveAE2+G4Bjcb1iq9jPNlw6A14vDj3oTKenv2LLnjL2OIfl6hRA==", + "optional": true, + "dependencies": { + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-config-provider": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.201.0.tgz", + "integrity": "sha512-7KNzdV7nFcKAoahvgGAlzsOq9FFDsU5h3w2iPtVdJhz6ZRDH/2v6WFeUCji+UNZip36gFfMPivoO8Y5smb5r/A==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.201.0.tgz", + "integrity": "sha512-kYLsa9x3oUJxYU7V5KOO50Kl7b0kk+I4ltkrdarLvvXcVI7ZXmWHzHLT2dkUhj8S0ceVdi0FYHVPJ3GoE8re4A==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.201.0.tgz", + "integrity": "sha512-NGOr+n559ZcJLdFoJR8LNGdrOJFIp2BTuWEDYeicNdNb0bETTXrkzcfT1BRhV9CWqCDmjFvjdrzbhS0cw/UUGA==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-retry": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-retry/-/middleware-retry-3.201.0.tgz", + "integrity": "sha512-4jQjSKCpSc4oB1X9nNq4FbIAwQrr+mvmUSmg/oe2Llf42Ak1G9gg3rNTtQdfzA/wNMlL4ZFfF5Br+uz06e1hnQ==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/service-error-classification": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.201.0.tgz", + "integrity": "sha512-clZuXcoN0mAP4JH5C6pW5+0tdF25+fpFJqE7GNRjjH/NYNk6ImVI0Kq2espEWwVBuaS0/chTDK3b+pK8YOWdhw==", + "optional": true, + "dependencies": { + "@aws-sdk/middleware-signing": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-serde": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-serde/-/middleware-serde-3.201.0.tgz", + "integrity": "sha512-Z7AzIuqEDvsZmp80zeT1oYxsoB8uQZby20Z8kF6/vNoq3sIzaGf/wHeNn0p+Vgo2auGSbZcVUZKoDptQLSLwIQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.201.0.tgz", + "integrity": "sha512-08ri5+mB28tva9RjVIXFcUP5lRTx+Pj8C2HYqF2GL5H3uAo+h3RQ++fEG1uwUMLf7tCEFivcw6SHA1KmCnB7+w==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-stack": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-stack/-/middleware-stack-3.201.0.tgz", + "integrity": "sha512-lqHYSBP5FBxzA5w5XiYYYpfXabFzleXonqRkqZts1tapNJ4sOd+itiKG8JoNP7LDOwJ8qxNW/a33/gQeh3wkwQ==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.201.0.tgz", + "integrity": "sha512-/rYZ93WN1gDJudXis/0382CEoTqRa4qZJA608u2EPWs5aiMocUrm7pjH5XvKm2OYX8K/lyaMSBvL2OTIMzXGaQ==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/node-config-provider": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-config-provider/-/node-config-provider-3.201.0.tgz", + "integrity": "sha512-JO0K2qPTYn+pPC7g8rWr1oueg9CqGCkYbINuAuz79vjToOLUQnZT9GiFm7QADe6J6RT1oGEKRQabNaJnp8cFpQ==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/node-http-handler": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.201.0.tgz", + "integrity": "sha512-bWjXBd4WCiQcV4PwY+eFnlz9tZ4UiqfiJteav4MDt8YWkVlsVnR8RutmVSm3KZZjO2tJNSrla0ZWBebkNnI/Xg==", + "optional": true, + "dependencies": { + "@aws-sdk/abort-controller": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/querystring-builder": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/property-provider": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/property-provider/-/property-provider-3.201.0.tgz", + "integrity": "sha512-lVMP75VsYHIW04uYbkjA0I8Bb7b+aEj6PBBLdFoA22S0uCeJOD42OSr2Gtg2fToDGO7LQJw/K2D+LMCYKfZ3vQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/protocol-http": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.201.0.tgz", + "integrity": "sha512-RdOc1elWFpj8MogxG87nkhtylw0a+OD7W8WFM+Gw4yJMkl7cwW42VIBFfb0+KCGZfIQltIeSLRvfe3WvVPyo7Q==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/querystring-builder": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.201.0.tgz", + "integrity": "sha512-FgQnVHpYR19w/HmHEgWpykCn9tdogW0n45Ins6LBCo2aImDf9kBATD4xgN/F2rtogGuLGgu5LIIMHIOj1Tzs/w==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/querystring-parser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-parser/-/querystring-parser-3.201.0.tgz", + "integrity": "sha512-vS9Ljbqrwi0sIKYxgyZYJUN1AcE291hvuqwty9etgD2w/26SbWiMhjIW/fXJUOZjUvGKkYCpbivJYSzAGAuWfQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/service-error-classification": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/service-error-classification/-/service-error-classification-3.201.0.tgz", + "integrity": "sha512-Pfcfmurgq8UpM0rXco6FVblcruqN4Mo3TW8/yaXrbctWpmdNT/8v19fffQIIgk94TU8Vf/nPJ7E5DXL7MZr4Fw==", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/shared-ini-file-loader": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.201.0.tgz", + "integrity": "sha512-Pbxk0TXep0yI8MnK7Prly6JuBm5Me9AITav8/zPEgTZ3fMhXhQhhiuQcuTCI9GeosSzoiu8VvK53oPtBZZFnXQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4/-/signature-v4-3.201.0.tgz", + "integrity": "sha512-zEHoG1/hzJq169slggkPy1SN9YPWI78Bbe/MvHGYmCmQDspblu60JSBIbAatNqAxAmcWKc2HqpyGKjCkMG94ZA==", + "optional": true, + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/smithy-client": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/smithy-client/-/smithy-client-3.201.0.tgz", + "integrity": "sha512-cL87Jgxczee8YFkWGWKQ2Ze0vjn4+eCa1kDvEYMCOQvNujTuFgatXLgije5a7nVkSnL9WLoIP7Y7fsBGrKfMnQ==", + "optional": true, + "dependencies": { + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.201.0.tgz", + "integrity": "sha512-RCQj2pQyHD330Jd4c5CHJ87k2ZqC3Mmtl6nhwH1dy3vbnGUpc3q+3yinOKoTAY934kIa7ia32Y/2EjuyHxaj1A==", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/url-parser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/url-parser/-/url-parser-3.201.0.tgz", + "integrity": "sha512-V15aqj0tj4Y79VpuIdHUvX4Nvn4hYPB0RAn/qg5CCComIl0doLOirAQtW1MOBOyctdRlD9Uv7d1QdPLzJZMHjQ==", + "optional": true, + "dependencies": { + "@aws-sdk/querystring-parser": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-base64-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64-browser/-/util-base64-browser-3.188.0.tgz", + "integrity": "sha512-qlH+5NZBLiyKziL335BEPedYxX6j+p7KFRWXvDQox9S+s+gLCayednpK+fteOhBenCcR9fUZOVuAPScy1I8qCg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-base64-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64-node/-/util-base64-node-3.201.0.tgz", + "integrity": "sha512-ydZqNpB3l5kiicInpPDExPb5xHI7uyVIa1vMupnuIrJ412iNb0F2+K8LlFynzw6fSJShVKnqFcWOYRA96z1iIw==", + "optional": true, + "dependencies": { + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-body-length-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-browser/-/util-body-length-browser-3.188.0.tgz", + "integrity": "sha512-8VpnwFWXhnZ/iRSl9mTf+VKOX9wDE8QtN4bj9pBfxwf90H1X7E8T6NkiZD3k+HubYf2J94e7DbeHs7fuCPW5Qg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-body-length-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-node/-/util-body-length-node-3.201.0.tgz", + "integrity": "sha512-q+gwQoLn/DOwirb2hgZJeEwo1D3vLhoD6FfSV42Ecfvtb4jHnWReWMHguujfCubuDgZCrMEvYQzuocS75HHsbA==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-buffer-from": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-buffer-from/-/util-buffer-from-3.201.0.tgz", + "integrity": "sha512-s6Wjltd9vU+vR3n0pqSPmNDcrrkrVTdV4t7x2zz3nDsFKTI77iVNafDmuaUlOA/bIlpjCJqaWecoVrZmEKeR7A==", + "optional": true, + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-config-provider": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-config-provider/-/util-config-provider-3.201.0.tgz", + "integrity": "sha512-cCRJlnRRP8vrLJomzJRBIyiyohsjJKmnIaQ9t0tAhGCywZbyjx6TlpYRZYfVWo+MwdF1Pi8ZScTrFPW0JuBOIQ==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-defaults-mode-browser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.201.0.tgz", + "integrity": "sha512-skRMAM+xrV/sDvvtHC81ExEKQEiZFaRrRdUT39fBX1SpGnFTo2wpv7XK+rAW2XopGgnLPytXLQD97Kub79o4zA==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/util-defaults-mode-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.201.0.tgz", + "integrity": "sha512-9N5LXRhxigbkbEcjQ4nNXHuQxp0VFlbc2/5wbcuPjIKX/OROiQI4mYQ6nuSKk7eku5sNFb9FtEHeD/RZo8od6Q==", + "optional": true, + "dependencies": { + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.202.0.tgz", + "integrity": "sha512-sNees5uDp7nfEbvzaA1DAHqoEvEb9ZOkdNH5gcj/FMBETbr00YtsuXsTZogTHQsX/otRTiudZBE3iH7R4SLSAQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-hex-encoding": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.201.0.tgz", + "integrity": "sha512-7t1vR1pVxKx0motd3X9rI3m/xNp78p3sHtP5yo4NP4ARpxyJ0fokBomY8ScaH2D/B+U5o9ARxldJUdMqyBlJcA==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.201.0.tgz", + "integrity": "sha512-hPJgifWh/rADabLAk1C9xXA2B3O4NUmbU58KgBRgC1HksiiHGFVZObB5fkBH8US/XV2jwORkpSf4OhretXQuKg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-middleware": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-middleware/-/util-middleware-3.201.0.tgz", + "integrity": "sha512-iAitcEZo17IyKn4ku1IBgtomr25esu5OuSRjw5Or4bNOeqXB0w50cItf/9qft8LIhbvBEAUtNAYXvqNzvhTZdQ==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-uri-escape": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-uri-escape/-/util-uri-escape-3.201.0.tgz", + "integrity": "sha512-TeTWbGx4LU2c5rx0obHeDFeO9HvwYwQtMh1yniBz00pQb6Qt6YVOETVQikRZ+XRQwEyCg/dA375UplIpiy54mA==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.201.0.tgz", + "integrity": "sha512-iL2gyz7GuUVtZcMZpqvfxdFrl9hc28qpagymmJ/w2yhN86YNPHdK8Sx1Yo6VxNGVDCCWGb7tHXf7VP+U4Yv/Lg==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.201.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.201.0.tgz", + "integrity": "sha512-6lhhvwB3AZSISnYQpDGdlyTrzfYK2P9QYjy7vZEBRd9TSOaggiFICXe03ZvZfVOSeg0EInlMKn1fIHzPUHRuHQ==", + "optional": true, + "dependencies": { + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-utf8-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.188.0.tgz", + "integrity": "sha512-jt627x0+jE+Ydr9NwkFstg3cUvgWh56qdaqAMDsqgRlKD21md/6G226z/Qxl7lb1VEW2LlmCx43ai/37Qwcj2Q==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-utf8-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-node/-/util-utf8-node-3.201.0.tgz", + "integrity": "sha512-A+bJFR/1rHYOJg137E69L1sX0I+LH+xf9ZjMXG9BVO0hSo7yDPoJVpHrzTJyOc3tuRITjIGBv9Qi4TKcoOSi1A==", + "optional": true, + "dependencies": { + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -163,10 +1162,21 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, + "node_modules/@types/jsdom": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.0.tgz", + "integrity": "sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "node_modules/@types/luxon": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.0.1.tgz", - "integrity": "sha512-/LAvk1cMOJt0ghzMFrZEvByUhsiEfeeT2IF53Le+Ki3A538yEL9pRZ7a6MuCxdrYK+YNqNIDmrKU/r2nnw04zQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.0.2.tgz", + "integrity": "sha512-HM2OVWckUMmXbWYZufmWT2XMURGDZ6XbyNyQ+Lx+gCFGFqbZaIjsz7b+AGeGP/AuVYHBiuGY+wXfweP1RremnA==", "dev": true }, "node_modules/@types/mocha": { @@ -176,9 +1186,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.0.tgz", - "integrity": "sha512-IOXCvVRToe7e0ny7HpT/X9Rb2RYtElG1a+VshjwT00HxrM2dWBApHQoqsI6WiY7Q03vdf2bCrIGzVrkF/5t10w==" + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" }, "node_modules/@types/tar": { "version": "6.1.3", @@ -190,6 +1200,12 @@ "minipass": "^3.3.5" } }, + "node_modules/@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, "node_modules/@types/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -222,9 +1238,9 @@ } }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "bin": { "acorn": "bin/acorn" }, @@ -436,6 +1452,12 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", + "optional": true + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -514,16 +1536,16 @@ } }, "node_modules/cacheable-request": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.1.tgz", - "integrity": "sha512-3tLJyBjGuXw1s5gpKFSG3iS4kaKT4id04dZi98wzHQp/8cqZNweBnrF9J+rrlvrf4M53OdtDGNctNHFias8BEA==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.2.tgz", + "integrity": "sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==", "dependencies": { "@types/http-cache-semantics": "^4.0.1", "get-stream": "^6.0.1", "http-cache-semantics": "^4.1.0", "keyv": "^4.5.0", "mimic-response": "^4.0.0", - "normalize-url": "^7.1.0", + "normalize-url": "^7.2.0", "responselike": "^3.0.0" }, "engines": { @@ -1038,6 +2060,22 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "node_modules/fast-xml-parser": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz", + "integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==", + "optional": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1591,9 +2629,9 @@ } }, "node_modules/jsdom": { - "version": "20.0.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.1.tgz", - "integrity": "sha512-pksjj7Rqoa+wdpkKcLzQRHhJCEE42qQhl/xLMUKHgoSejaKOdaXEAnqs6uDNwMl/fciHTzKeR8Wm8cw7N+g98A==", + "version": "20.0.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.2.tgz", + "integrity": "sha512-AHWa+QO/cgRg4N+DsmHg1Y7xnz+8KU3EflM0LVDTdmrYOc1WWTSkOjtpUveQH+1Bqd5rtcVnb/DuxV/UjDO4rA==", "dependencies": { "abab": "^2.0.6", "acorn": "^8.8.0", @@ -1748,9 +2786,9 @@ "dev": true }, "node_modules/marked": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", - "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.1.tgz", + "integrity": "sha512-VK1/jNtwqDLvPktNpL0Fdg3qoeUZhmRsuiIjPEy/lHwXW4ouLoZfO4XoWd4ClDt+hupV1VLpkZhEovjU0W/kqA==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -1972,19 +3010,20 @@ } }, "node_modules/mongodb": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.9.1.tgz", - "integrity": "sha512-ZhgI/qBf84fD7sI4waZBoLBNJYPQN5IOC++SBCiPiyhzpNKOxN/fi0tBHvH2dEC42HXtNEbFB0zmNz4+oVtorQ==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.11.0.tgz", + "integrity": "sha512-9l9n4Nk2BYZzljW3vHah3Z0rfS5npKw6ktnkmFgTcnzaXH1DRm3pDl6VMHu84EVb1lzmSaJC4OzWZqTkB5i2wg==", "dependencies": { "bson": "^4.7.0", "denque": "^2.1.0", - "mongodb-connection-string-url": "^2.5.3", - "socks": "^2.7.0" + "mongodb-connection-string-url": "^2.5.4", + "socks": "^2.7.1" }, "engines": { "node": ">=12.9.0" }, "optionalDependencies": { + "@aws-sdk/credential-providers": "^3.186.0", "saslprep": "^1.0.3" } }, @@ -1998,17 +3037,17 @@ } }, "node_modules/mongoose": { - "version": "6.6.5", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.6.5.tgz", - "integrity": "sha512-iA/oDpWOc+K2QYzA4Eq7Z1oUBQOz9FGDmUwPLgw872Bfs/qizA5Db+gJorAn+TnnGu3VoCK8iP4Y+TECUelwjA==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.7.1.tgz", + "integrity": "sha512-qbagtqSyvIhUz4EWzXC00EA0DJHFrQwlzTlNGX5DjiESoJiPKqkEga1k9hviFKRFgBna+OlW54mkdi+0+AqxCw==", "dependencies": { - "bson": "^4.6.5", + "bson": "^4.7.0", "kareem": "2.4.1", - "mongodb": "4.9.1", + "mongodb": "4.11.0", "mpath": "0.9.0", "mquery": "4.0.3", "ms": "2.1.3", - "sift": "16.0.0" + "sift": "16.0.1" }, "engines": { "node": ">=12.0.0" @@ -2569,9 +3608,9 @@ } }, "node_modules/sift": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.0.tgz", - "integrity": "sha512-ILTjdP2Mv9V1kIxWMXeMTIRbOBrqKc4JAXmFMnFq3fKeyQ2Qwa3Dw1ubcye3vR+Y6ofA0b9gNDr/y2t6eUeIzQ==" + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", + "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" }, "node_modules/smart-buffer": { "version": "4.2.0", @@ -2665,6 +3704,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "optional": true + }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -2686,9 +3731,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -2698,7 +3743,7 @@ "yallist": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">=10" } }, "node_modules/to-regex-range": { @@ -2798,6 +3843,12 @@ "node": ">=0.3.1" } }, + "node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "optional": true + }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -2913,6 +3964,15 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -3037,9 +4097,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz", - "integrity": "sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", + "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", "engines": { "node": ">=10.0.0" }, @@ -3091,9 +4151,9 @@ } }, "node_modules/yargs": { - "version": "17.6.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz", - "integrity": "sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==", + "version": "17.6.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.1.tgz", + "integrity": "sha512-leBuCGrL4dAd6ispNOGsJlhd0uZ6Qehkbu/B9KCR+Pxa/NVdNwi+i31lo0buCm6XxhJQFshXCD0/evfV4xfoUg==", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -3162,6 +4222,851 @@ } }, "dependencies": { + "@aws-crypto/ie11-detection": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-2.0.2.tgz", + "integrity": "sha512-5XDMQY98gMAf/WRTic5G++jfmS/VLM0rwpiOpaainKi4L0nqWMSB1SzsrEG5rjFZGYN6ZAefO+/Yta2dFM0kMw==", + "optional": true, + "requires": { + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + } + } + }, + "@aws-crypto/sha256-browser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-2.0.0.tgz", + "integrity": "sha512-rYXOQ8BFOaqMEHJrLHul/25ckWH6GTJtdLSajhlqGMx0PmSueAuvboCuZCTqEKlxR8CQOwRarxYMZZSYlhRA1A==", + "optional": true, + "requires": { + "@aws-crypto/ie11-detection": "^2.0.0", + "@aws-crypto/sha256-js": "^2.0.0", + "@aws-crypto/supports-web-crypto": "^2.0.0", + "@aws-crypto/util": "^2.0.0", + "@aws-sdk/types": "^3.1.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + } + } + }, + "@aws-crypto/sha256-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-2.0.0.tgz", + "integrity": "sha512-VZY+mCY4Nmrs5WGfitmNqXzaE873fcIZDu54cbaDaaamsaTOP1DBImV9F4pICc3EHjQXujyE8jig+PFCaew9ig==", + "optional": true, + "requires": { + "@aws-crypto/util": "^2.0.0", + "@aws-sdk/types": "^3.1.0", + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + } + } + }, + "@aws-crypto/supports-web-crypto": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-2.0.2.tgz", + "integrity": "sha512-6mbSsLHwZ99CTOOswvCRP3C+VCWnzBf+1SnbWxzzJ9lR0mA0JnY2JEAhp8rqmTE0GPFy88rrM27ffgp62oErMQ==", + "optional": true, + "requires": { + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + } + } + }, + "@aws-crypto/util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-2.0.2.tgz", + "integrity": "sha512-Lgu5v/0e/BcrZ5m/IWqzPUf3UYFTy/PpeED+uc9SWUR1iZQL8XXbGQg10UfllwwBryO3hFF5dizK+78aoXC1eA==", + "optional": true, + "requires": { + "@aws-sdk/types": "^3.110.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + } + } + }, + "@aws-sdk/abort-controller": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.201.0.tgz", + "integrity": "sha512-xJ984k+CKlGjBmvNarzM8Y+b6X4L1Zt0TycQmVBJq7fAr/ju9l13pQIoXR5WlDIW1FkGeVczF5Nu6fN46SCORQ==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-cognito-identity": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.202.0.tgz", + "integrity": "sha512-PebtNMe214k8ueVtC12SaXHgtfdBpGsbxg81nkGddzesYLhqsBIKlcAyI+ZotrXU50NJ8+rEzxslNleLZ0NI+w==", + "optional": true, + "requires": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/client-sts": "3.202.0", + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/hash-node": "3.201.0", + "@aws-sdk/invalid-dependency": "3.201.0", + "@aws-sdk/middleware-content-length": "3.201.0", + "@aws-sdk/middleware-endpoint": "3.201.0", + "@aws-sdk/middleware-host-header": "3.201.0", + "@aws-sdk/middleware-logger": "3.201.0", + "@aws-sdk/middleware-recursion-detection": "3.201.0", + "@aws-sdk/middleware-retry": "3.201.0", + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/middleware-signing": "3.201.0", + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/middleware-user-agent": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/node-http-handler": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/smithy-client": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64-node": "3.201.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.201.0", + "@aws-sdk/util-defaults-mode-browser": "3.201.0", + "@aws-sdk/util-defaults-mode-node": "3.201.0", + "@aws-sdk/util-endpoints": "3.202.0", + "@aws-sdk/util-user-agent-browser": "3.201.0", + "@aws-sdk/util-user-agent-node": "3.201.0", + "@aws-sdk/util-utf8-browser": "3.188.0", + "@aws-sdk/util-utf8-node": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-sso": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.202.0.tgz", + "integrity": "sha512-c0impiZUbJeB5AdyZyER81tsqF9bxxaEz6p2LYkTn62NWVXPWEUo/1CHQRj36MUzorz1xiWKIN0NPgK6GBJkPQ==", + "optional": true, + "requires": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/hash-node": "3.201.0", + "@aws-sdk/invalid-dependency": "3.201.0", + "@aws-sdk/middleware-content-length": "3.201.0", + "@aws-sdk/middleware-endpoint": "3.201.0", + "@aws-sdk/middleware-host-header": "3.201.0", + "@aws-sdk/middleware-logger": "3.201.0", + "@aws-sdk/middleware-recursion-detection": "3.201.0", + "@aws-sdk/middleware-retry": "3.201.0", + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/middleware-user-agent": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/node-http-handler": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/smithy-client": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64-node": "3.201.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.201.0", + "@aws-sdk/util-defaults-mode-browser": "3.201.0", + "@aws-sdk/util-defaults-mode-node": "3.201.0", + "@aws-sdk/util-endpoints": "3.202.0", + "@aws-sdk/util-user-agent-browser": "3.201.0", + "@aws-sdk/util-user-agent-node": "3.201.0", + "@aws-sdk/util-utf8-browser": "3.188.0", + "@aws-sdk/util-utf8-node": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-sts": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.202.0.tgz", + "integrity": "sha512-WGRFzODig8+cZR903q3fa7OAzGigSuzD9AoK+ybefQa7bxSuhT2ous4GNPOJz9WYWvugEPyrJu8vbG35IoF1ZQ==", + "optional": true, + "requires": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/hash-node": "3.201.0", + "@aws-sdk/invalid-dependency": "3.201.0", + "@aws-sdk/middleware-content-length": "3.201.0", + "@aws-sdk/middleware-endpoint": "3.201.0", + "@aws-sdk/middleware-host-header": "3.201.0", + "@aws-sdk/middleware-logger": "3.201.0", + "@aws-sdk/middleware-recursion-detection": "3.201.0", + "@aws-sdk/middleware-retry": "3.201.0", + "@aws-sdk/middleware-sdk-sts": "3.201.0", + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/middleware-signing": "3.201.0", + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/middleware-user-agent": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/node-http-handler": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/smithy-client": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64-node": "3.201.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.201.0", + "@aws-sdk/util-defaults-mode-browser": "3.201.0", + "@aws-sdk/util-defaults-mode-node": "3.201.0", + "@aws-sdk/util-endpoints": "3.202.0", + "@aws-sdk/util-user-agent-browser": "3.201.0", + "@aws-sdk/util-user-agent-node": "3.201.0", + "@aws-sdk/util-utf8-browser": "3.188.0", + "@aws-sdk/util-utf8-node": "3.201.0", + "fast-xml-parser": "4.0.11", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/config-resolver": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/config-resolver/-/config-resolver-3.201.0.tgz", + "integrity": "sha512-6YLIel7OGMGi+r8XC1A54cQJRIpx/NJ4fBALy44zFpQ+fdJUEmw4daUf1LECmAQiPA2Pr/hD0nBtX+wiiTf5/g==", + "optional": true, + "requires": { + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-config-provider": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-cognito-identity": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.202.0.tgz", + "integrity": "sha512-W/Z4Zf05Yw5ya5SU1UO6xz/OZtxCzMMQmmb71eAHWsh/LIlJ9A3IFsAnAveG7eISTpFjMadT7n6mfsYt/eWgoQ==", + "optional": true, + "requires": { + "@aws-sdk/client-cognito-identity": "3.202.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-env": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.201.0.tgz", + "integrity": "sha512-g2MJsowzFhSsIOITUjYp7EzWFeHINjEP526Uf+5z2/p2kxQVwYYWZQK7j+tPE2Bk3MEjGOCmVHbbE7IFj0rNHw==", + "optional": true, + "requires": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-imds": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.201.0.tgz", + "integrity": "sha512-i8U2k3/L3iUWJJ1GSlwVBMfLQ2OTUT97E8yJi/xz5GavYuPOsUQWQe4fp7WGQivxh+AqybXAGFUCYub6zfUqag==", + "optional": true, + "requires": { + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-ini": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.202.0.tgz", + "integrity": "sha512-d0kiYMpGzAq3EBXgEJ1SdeoMXVf3lk6NKHDi/Gy8LB03sZqgc5cY4XFCnY3cqE3DNWWZNR26M4j/KiA0LIjAVA==", + "optional": true, + "requires": { + "@aws-sdk/credential-provider-env": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-web-identity": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-node": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.202.0.tgz", + "integrity": "sha512-/uHNs3c1O3oFpH7z9nnpjyg8NKNyRbNxUDIHkuHkNSUUKXpfBisDX6TMbD4VcflGuNdkbT+8spkw5vsE8ox3ig==", + "optional": true, + "requires": { + "@aws-sdk/credential-provider-env": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/credential-provider-ini": "3.202.0", + "@aws-sdk/credential-provider-process": "3.201.0", + "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-web-identity": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-process": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.201.0.tgz", + "integrity": "sha512-jTK3HSZgNj/hVrWb0wuF/cPUWSJYoRI/80fnN55o6QLS8WWIgOI8o2PNeVTAT5OrKioSoN4fgKTeUm3DZy3npQ==", + "optional": true, + "requires": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-sso": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.202.0.tgz", + "integrity": "sha512-EBUY/qKboJwy3qxPHiD/LAnhzga4xR1p++QMoxg2BKgkgwlvGb23lYGr5DSCNhdtJj5o165YZDbGYH+PKn2NVw==", + "optional": true, + "requires": { + "@aws-sdk/client-sso": "3.202.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-web-identity": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.201.0.tgz", + "integrity": "sha512-U54bqhYaClPVZfswgknhlICp3BAtKXpOgHQCUF8cko5xUgbL4lVgd1rC3lWviGFMQAaTIF3QOXyEouemxr3VXw==", + "optional": true, + "requires": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-providers": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.202.0.tgz", + "integrity": "sha512-CQVSlKh+V4X3tWv+6IJFB8Io89bwErQSP6m7pGynrwH37dr0jg04A5WQQt+l8tRX8NSteVYrAyxebefLnWMTyA==", + "optional": true, + "requires": { + "@aws-sdk/client-cognito-identity": "3.202.0", + "@aws-sdk/client-sso": "3.202.0", + "@aws-sdk/client-sts": "3.202.0", + "@aws-sdk/credential-provider-cognito-identity": "3.202.0", + "@aws-sdk/credential-provider-env": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/credential-provider-ini": "3.202.0", + "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/credential-provider-process": "3.201.0", + "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-web-identity": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/fetch-http-handler": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.201.0.tgz", + "integrity": "sha512-uiEoH79j6WOpbp4THcpvD9XmD+vPgy+00oyYXjtZqJnv2PM/9b6tGWKTdI+TJW4P/oPv7HP7JmRlkGaTnkIdXw==", + "optional": true, + "requires": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/querystring-builder": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-base64-browser": "3.188.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/hash-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/hash-node/-/hash-node-3.201.0.tgz", + "integrity": "sha512-WJsMZg5/TMoWnLM+0NuwLwFzHsi89Bi9J1Dt7JdJHXFLoEZV54FEz1PK/Sq5NOldhVljpXQwWOB2dHA2wxFztg==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/invalid-dependency": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/invalid-dependency/-/invalid-dependency-3.201.0.tgz", + "integrity": "sha512-f/zgntOfIozNyKSaG9dvHjjBaR3y20kYNswMYkSuCM2NIT5LpyHiiq5I11TwaocatUFcDztWpcsv7vHpIgI5Ig==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/is-array-buffer": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/is-array-buffer/-/is-array-buffer-3.201.0.tgz", + "integrity": "sha512-UPez5qLh3dNgt0DYnPD/q0mVJY84rA17QE26hVNOW3fAji8W2wrwrxdacWOxyXvlxWsVRcKmr+lay1MDqpAMfg==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-content-length": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-content-length/-/middleware-content-length-3.201.0.tgz", + "integrity": "sha512-p4G9AtdrKO8A3Z4RyZiy0isEYwuge7bQRBS7UzcGkcIOhJONq2pcM+gRZYz+NWvfYYNWUg5uODsFQfU8342yKg==", + "optional": true, + "requires": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-endpoint": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-endpoint/-/middleware-endpoint-3.201.0.tgz", + "integrity": "sha512-F3JlXo5GusbeZR956hA9VxmDxUeg77Xh6o8fveAE2+G4Bjcb1iq9jPNlw6A14vDj3oTKenv2LLnjL2OIfl6hRA==", + "optional": true, + "requires": { + "@aws-sdk/middleware-serde": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-config-provider": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-host-header": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.201.0.tgz", + "integrity": "sha512-7KNzdV7nFcKAoahvgGAlzsOq9FFDsU5h3w2iPtVdJhz6ZRDH/2v6WFeUCji+UNZip36gFfMPivoO8Y5smb5r/A==", + "optional": true, + "requires": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-logger": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.201.0.tgz", + "integrity": "sha512-kYLsa9x3oUJxYU7V5KOO50Kl7b0kk+I4ltkrdarLvvXcVI7ZXmWHzHLT2dkUhj8S0ceVdi0FYHVPJ3GoE8re4A==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-recursion-detection": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.201.0.tgz", + "integrity": "sha512-NGOr+n559ZcJLdFoJR8LNGdrOJFIp2BTuWEDYeicNdNb0bETTXrkzcfT1BRhV9CWqCDmjFvjdrzbhS0cw/UUGA==", + "optional": true, + "requires": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-retry": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-retry/-/middleware-retry-3.201.0.tgz", + "integrity": "sha512-4jQjSKCpSc4oB1X9nNq4FbIAwQrr+mvmUSmg/oe2Llf42Ak1G9gg3rNTtQdfzA/wNMlL4ZFfF5Br+uz06e1hnQ==", + "optional": true, + "requires": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/service-error-classification": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + } + }, + "@aws-sdk/middleware-sdk-sts": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.201.0.tgz", + "integrity": "sha512-clZuXcoN0mAP4JH5C6pW5+0tdF25+fpFJqE7GNRjjH/NYNk6ImVI0Kq2espEWwVBuaS0/chTDK3b+pK8YOWdhw==", + "optional": true, + "requires": { + "@aws-sdk/middleware-signing": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-serde": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-serde/-/middleware-serde-3.201.0.tgz", + "integrity": "sha512-Z7AzIuqEDvsZmp80zeT1oYxsoB8uQZby20Z8kF6/vNoq3sIzaGf/wHeNn0p+Vgo2auGSbZcVUZKoDptQLSLwIQ==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-signing": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.201.0.tgz", + "integrity": "sha512-08ri5+mB28tva9RjVIXFcUP5lRTx+Pj8C2HYqF2GL5H3uAo+h3RQ++fEG1uwUMLf7tCEFivcw6SHA1KmCnB7+w==", + "optional": true, + "requires": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/signature-v4": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-stack": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-stack/-/middleware-stack-3.201.0.tgz", + "integrity": "sha512-lqHYSBP5FBxzA5w5XiYYYpfXabFzleXonqRkqZts1tapNJ4sOd+itiKG8JoNP7LDOwJ8qxNW/a33/gQeh3wkwQ==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-user-agent": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.201.0.tgz", + "integrity": "sha512-/rYZ93WN1gDJudXis/0382CEoTqRa4qZJA608u2EPWs5aiMocUrm7pjH5XvKm2OYX8K/lyaMSBvL2OTIMzXGaQ==", + "optional": true, + "requires": { + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/node-config-provider": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-config-provider/-/node-config-provider-3.201.0.tgz", + "integrity": "sha512-JO0K2qPTYn+pPC7g8rWr1oueg9CqGCkYbINuAuz79vjToOLUQnZT9GiFm7QADe6J6RT1oGEKRQabNaJnp8cFpQ==", + "optional": true, + "requires": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/shared-ini-file-loader": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/node-http-handler": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.201.0.tgz", + "integrity": "sha512-bWjXBd4WCiQcV4PwY+eFnlz9tZ4UiqfiJteav4MDt8YWkVlsVnR8RutmVSm3KZZjO2tJNSrla0ZWBebkNnI/Xg==", + "optional": true, + "requires": { + "@aws-sdk/abort-controller": "3.201.0", + "@aws-sdk/protocol-http": "3.201.0", + "@aws-sdk/querystring-builder": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/property-provider": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/property-provider/-/property-provider-3.201.0.tgz", + "integrity": "sha512-lVMP75VsYHIW04uYbkjA0I8Bb7b+aEj6PBBLdFoA22S0uCeJOD42OSr2Gtg2fToDGO7LQJw/K2D+LMCYKfZ3vQ==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/protocol-http": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.201.0.tgz", + "integrity": "sha512-RdOc1elWFpj8MogxG87nkhtylw0a+OD7W8WFM+Gw4yJMkl7cwW42VIBFfb0+KCGZfIQltIeSLRvfe3WvVPyo7Q==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/querystring-builder": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.201.0.tgz", + "integrity": "sha512-FgQnVHpYR19w/HmHEgWpykCn9tdogW0n45Ins6LBCo2aImDf9kBATD4xgN/F2rtogGuLGgu5LIIMHIOj1Tzs/w==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/querystring-parser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-parser/-/querystring-parser-3.201.0.tgz", + "integrity": "sha512-vS9Ljbqrwi0sIKYxgyZYJUN1AcE291hvuqwty9etgD2w/26SbWiMhjIW/fXJUOZjUvGKkYCpbivJYSzAGAuWfQ==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/service-error-classification": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/service-error-classification/-/service-error-classification-3.201.0.tgz", + "integrity": "sha512-Pfcfmurgq8UpM0rXco6FVblcruqN4Mo3TW8/yaXrbctWpmdNT/8v19fffQIIgk94TU8Vf/nPJ7E5DXL7MZr4Fw==", + "optional": true + }, + "@aws-sdk/shared-ini-file-loader": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.201.0.tgz", + "integrity": "sha512-Pbxk0TXep0yI8MnK7Prly6JuBm5Me9AITav8/zPEgTZ3fMhXhQhhiuQcuTCI9GeosSzoiu8VvK53oPtBZZFnXQ==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/signature-v4": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4/-/signature-v4-3.201.0.tgz", + "integrity": "sha512-zEHoG1/hzJq169slggkPy1SN9YPWI78Bbe/MvHGYmCmQDspblu60JSBIbAatNqAxAmcWKc2HqpyGKjCkMG94ZA==", + "optional": true, + "requires": { + "@aws-sdk/is-array-buffer": "3.201.0", + "@aws-sdk/types": "3.201.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-middleware": "3.201.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/smithy-client": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/smithy-client/-/smithy-client-3.201.0.tgz", + "integrity": "sha512-cL87Jgxczee8YFkWGWKQ2Ze0vjn4+eCa1kDvEYMCOQvNujTuFgatXLgije5a7nVkSnL9WLoIP7Y7fsBGrKfMnQ==", + "optional": true, + "requires": { + "@aws-sdk/middleware-stack": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/types": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.201.0.tgz", + "integrity": "sha512-RCQj2pQyHD330Jd4c5CHJ87k2ZqC3Mmtl6nhwH1dy3vbnGUpc3q+3yinOKoTAY934kIa7ia32Y/2EjuyHxaj1A==", + "optional": true + }, + "@aws-sdk/url-parser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/url-parser/-/url-parser-3.201.0.tgz", + "integrity": "sha512-V15aqj0tj4Y79VpuIdHUvX4Nvn4hYPB0RAn/qg5CCComIl0doLOirAQtW1MOBOyctdRlD9Uv7d1QdPLzJZMHjQ==", + "optional": true, + "requires": { + "@aws-sdk/querystring-parser": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-base64-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64-browser/-/util-base64-browser-3.188.0.tgz", + "integrity": "sha512-qlH+5NZBLiyKziL335BEPedYxX6j+p7KFRWXvDQox9S+s+gLCayednpK+fteOhBenCcR9fUZOVuAPScy1I8qCg==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-base64-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64-node/-/util-base64-node-3.201.0.tgz", + "integrity": "sha512-ydZqNpB3l5kiicInpPDExPb5xHI7uyVIa1vMupnuIrJ412iNb0F2+K8LlFynzw6fSJShVKnqFcWOYRA96z1iIw==", + "optional": true, + "requires": { + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-body-length-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-browser/-/util-body-length-browser-3.188.0.tgz", + "integrity": "sha512-8VpnwFWXhnZ/iRSl9mTf+VKOX9wDE8QtN4bj9pBfxwf90H1X7E8T6NkiZD3k+HubYf2J94e7DbeHs7fuCPW5Qg==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-body-length-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-node/-/util-body-length-node-3.201.0.tgz", + "integrity": "sha512-q+gwQoLn/DOwirb2hgZJeEwo1D3vLhoD6FfSV42Ecfvtb4jHnWReWMHguujfCubuDgZCrMEvYQzuocS75HHsbA==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-buffer-from": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-buffer-from/-/util-buffer-from-3.201.0.tgz", + "integrity": "sha512-s6Wjltd9vU+vR3n0pqSPmNDcrrkrVTdV4t7x2zz3nDsFKTI77iVNafDmuaUlOA/bIlpjCJqaWecoVrZmEKeR7A==", + "optional": true, + "requires": { + "@aws-sdk/is-array-buffer": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-config-provider": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-config-provider/-/util-config-provider-3.201.0.tgz", + "integrity": "sha512-cCRJlnRRP8vrLJomzJRBIyiyohsjJKmnIaQ9t0tAhGCywZbyjx6TlpYRZYfVWo+MwdF1Pi8ZScTrFPW0JuBOIQ==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-defaults-mode-browser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.201.0.tgz", + "integrity": "sha512-skRMAM+xrV/sDvvtHC81ExEKQEiZFaRrRdUT39fBX1SpGnFTo2wpv7XK+rAW2XopGgnLPytXLQD97Kub79o4zA==", + "optional": true, + "requires": { + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-defaults-mode-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.201.0.tgz", + "integrity": "sha512-9N5LXRhxigbkbEcjQ4nNXHuQxp0VFlbc2/5wbcuPjIKX/OROiQI4mYQ6nuSKk7eku5sNFb9FtEHeD/RZo8od6Q==", + "optional": true, + "requires": { + "@aws-sdk/config-resolver": "3.201.0", + "@aws-sdk/credential-provider-imds": "3.201.0", + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/property-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-endpoints": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.202.0.tgz", + "integrity": "sha512-sNees5uDp7nfEbvzaA1DAHqoEvEb9ZOkdNH5gcj/FMBETbr00YtsuXsTZogTHQsX/otRTiudZBE3iH7R4SLSAQ==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-hex-encoding": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.201.0.tgz", + "integrity": "sha512-7t1vR1pVxKx0motd3X9rI3m/xNp78p3sHtP5yo4NP4ARpxyJ0fokBomY8ScaH2D/B+U5o9ARxldJUdMqyBlJcA==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-locate-window": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.201.0.tgz", + "integrity": "sha512-hPJgifWh/rADabLAk1C9xXA2B3O4NUmbU58KgBRgC1HksiiHGFVZObB5fkBH8US/XV2jwORkpSf4OhretXQuKg==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-middleware": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-middleware/-/util-middleware-3.201.0.tgz", + "integrity": "sha512-iAitcEZo17IyKn4ku1IBgtomr25esu5OuSRjw5Or4bNOeqXB0w50cItf/9qft8LIhbvBEAUtNAYXvqNzvhTZdQ==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-uri-escape": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-uri-escape/-/util-uri-escape-3.201.0.tgz", + "integrity": "sha512-TeTWbGx4LU2c5rx0obHeDFeO9HvwYwQtMh1yniBz00pQb6Qt6YVOETVQikRZ+XRQwEyCg/dA375UplIpiy54mA==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-user-agent-browser": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.201.0.tgz", + "integrity": "sha512-iL2gyz7GuUVtZcMZpqvfxdFrl9hc28qpagymmJ/w2yhN86YNPHdK8Sx1Yo6VxNGVDCCWGb7tHXf7VP+U4Yv/Lg==", + "optional": true, + "requires": { + "@aws-sdk/types": "3.201.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-user-agent-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.201.0.tgz", + "integrity": "sha512-6lhhvwB3AZSISnYQpDGdlyTrzfYK2P9QYjy7vZEBRd9TSOaggiFICXe03ZvZfVOSeg0EInlMKn1fIHzPUHRuHQ==", + "optional": true, + "requires": { + "@aws-sdk/node-config-provider": "3.201.0", + "@aws-sdk/types": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-utf8-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.188.0.tgz", + "integrity": "sha512-jt627x0+jE+Ydr9NwkFstg3cUvgWh56qdaqAMDsqgRlKD21md/6G226z/Qxl7lb1VEW2LlmCx43ai/37Qwcj2Q==", + "optional": true, + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-utf8-node": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-node/-/util-utf8-node-3.201.0.tgz", + "integrity": "sha512-A+bJFR/1rHYOJg137E69L1sX0I+LH+xf9ZjMXG9BVO0hSo7yDPoJVpHrzTJyOc3tuRITjIGBv9Qi4TKcoOSi1A==", + "optional": true, + "requires": { + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + } + }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -3273,10 +5178,21 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, + "@types/jsdom": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.0.tgz", + "integrity": "sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "@types/luxon": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.0.1.tgz", - "integrity": "sha512-/LAvk1cMOJt0ghzMFrZEvByUhsiEfeeT2IF53Le+Ki3A538yEL9pRZ7a6MuCxdrYK+YNqNIDmrKU/r2nnw04zQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.0.2.tgz", + "integrity": "sha512-HM2OVWckUMmXbWYZufmWT2XMURGDZ6XbyNyQ+Lx+gCFGFqbZaIjsz7b+AGeGP/AuVYHBiuGY+wXfweP1RremnA==", "dev": true }, "@types/mocha": { @@ -3286,9 +5202,9 @@ "dev": true }, "@types/node": { - "version": "18.11.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.0.tgz", - "integrity": "sha512-IOXCvVRToe7e0ny7HpT/X9Rb2RYtElG1a+VshjwT00HxrM2dWBApHQoqsI6WiY7Q03vdf2bCrIGzVrkF/5t10w==" + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" }, "@types/tar": { "version": "6.1.3", @@ -3300,6 +5216,12 @@ "minipass": "^3.3.5" } }, + "@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, "@types/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -3329,9 +5251,9 @@ } }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==" + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==" }, "acorn-globals": { "version": "7.0.1", @@ -3482,6 +5404,12 @@ "unpipe": "1.0.0" } }, + "bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", + "optional": true + }, "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -3534,16 +5462,16 @@ "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==" }, "cacheable-request": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.1.tgz", - "integrity": "sha512-3tLJyBjGuXw1s5gpKFSG3iS4kaKT4id04dZi98wzHQp/8cqZNweBnrF9J+rrlvrf4M53OdtDGNctNHFias8BEA==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.2.tgz", + "integrity": "sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==", "requires": { "@types/http-cache-semantics": "^4.0.1", "get-stream": "^6.0.1", "http-cache-semantics": "^4.1.0", "keyv": "^4.5.0", "mimic-response": "^4.0.0", - "normalize-url": "^7.1.0", + "normalize-url": "^7.2.0", "responselike": "^3.0.0" } }, @@ -3916,6 +5844,15 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "fast-xml-parser": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz", + "integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==", + "optional": true, + "requires": { + "strnum": "^1.0.5" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -4301,9 +6238,9 @@ } }, "jsdom": { - "version": "20.0.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.1.tgz", - "integrity": "sha512-pksjj7Rqoa+wdpkKcLzQRHhJCEE42qQhl/xLMUKHgoSejaKOdaXEAnqs6uDNwMl/fciHTzKeR8Wm8cw7N+g98A==", + "version": "20.0.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.2.tgz", + "integrity": "sha512-AHWa+QO/cgRg4N+DsmHg1Y7xnz+8KU3EflM0LVDTdmrYOc1WWTSkOjtpUveQH+1Bqd5rtcVnb/DuxV/UjDO4rA==", "requires": { "abab": "^2.0.6", "acorn": "^8.8.0", @@ -4423,9 +6360,9 @@ "dev": true }, "marked": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", - "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.1.tgz", + "integrity": "sha512-VK1/jNtwqDLvPktNpL0Fdg3qoeUZhmRsuiIjPEy/lHwXW4ouLoZfO4XoWd4ClDt+hupV1VLpkZhEovjU0W/kqA==", "dev": true }, "media-typer": { @@ -4584,15 +6521,16 @@ } }, "mongodb": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.9.1.tgz", - "integrity": "sha512-ZhgI/qBf84fD7sI4waZBoLBNJYPQN5IOC++SBCiPiyhzpNKOxN/fi0tBHvH2dEC42HXtNEbFB0zmNz4+oVtorQ==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.11.0.tgz", + "integrity": "sha512-9l9n4Nk2BYZzljW3vHah3Z0rfS5npKw6ktnkmFgTcnzaXH1DRm3pDl6VMHu84EVb1lzmSaJC4OzWZqTkB5i2wg==", "requires": { + "@aws-sdk/credential-providers": "^3.186.0", "bson": "^4.7.0", "denque": "^2.1.0", - "mongodb-connection-string-url": "^2.5.3", + "mongodb-connection-string-url": "^2.5.4", "saslprep": "^1.0.3", - "socks": "^2.7.0" + "socks": "^2.7.1" } }, "mongodb-connection-string-url": { @@ -4605,17 +6543,17 @@ } }, "mongoose": { - "version": "6.6.5", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.6.5.tgz", - "integrity": "sha512-iA/oDpWOc+K2QYzA4Eq7Z1oUBQOz9FGDmUwPLgw872Bfs/qizA5Db+gJorAn+TnnGu3VoCK8iP4Y+TECUelwjA==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.7.1.tgz", + "integrity": "sha512-qbagtqSyvIhUz4EWzXC00EA0DJHFrQwlzTlNGX5DjiESoJiPKqkEga1k9hviFKRFgBna+OlW54mkdi+0+AqxCw==", "requires": { - "bson": "^4.6.5", + "bson": "^4.7.0", "kareem": "2.4.1", - "mongodb": "4.9.1", + "mongodb": "4.11.0", "mpath": "0.9.0", "mquery": "4.0.3", "ms": "2.1.3", - "sift": "16.0.0" + "sift": "16.0.1" }, "dependencies": { "ms": { @@ -5021,9 +6959,9 @@ } }, "sift": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.0.tgz", - "integrity": "sha512-ILTjdP2Mv9V1kIxWMXeMTIRbOBrqKc4JAXmFMnFq3fKeyQ2Qwa3Dw1ubcye3vR+Y6ofA0b9gNDr/y2t6eUeIzQ==" + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", + "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" }, "smart-buffer": { "version": "4.2.0", @@ -5091,6 +7029,12 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "optional": true + }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -5106,9 +7050,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -5180,6 +7124,12 @@ } } }, + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "optional": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -5263,6 +7213,12 @@ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "optional": true + }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -5359,9 +7315,9 @@ "dev": true }, "ws": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz", - "integrity": "sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", + "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", "requires": {} }, "xml-name-validator": { @@ -5390,9 +7346,9 @@ "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==" }, "yargs": { - "version": "17.6.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz", - "integrity": "sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==", + "version": "17.6.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.1.tgz", + "integrity": "sha512-leBuCGrL4dAd6ispNOGsJlhd0uZ6Qehkbu/B9KCR+Pxa/NVdNwi+i31lo0buCm6XxhJQFshXCD0/evfV4xfoUg==", "requires": { "cliui": "^8.0.1", "escalade": "^3.1.1", diff --git a/package.json b/package.json index 5e22e91..d61069d 100644 --- a/package.json +++ b/package.json @@ -36,18 +36,21 @@ "adm-zip": "^0.5.9", "cron": "^2.1.0", "got": "^12.5.2", + "jsdom": "^20.0.2", + "mongoose": "^6.7.1", "prismarine-nbt": "^2.2.1", - "tar": "^6.1.11" + "tar": "^6.1.12" }, "devDependencies": { "@types/adm-zip": "^0.5.0", "@types/cron": "^2.0.0", + "@types/jsdom": "^20.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.11.0", + "@types/node": "^18.11.9", "@types/tar": "^6.1.3", "mocha": "^10.1.0", "ts-node": "^10.9.1", - "typedoc": "^0.23.16", + "typedoc": "^0.23.19", "typescript": "^4.8.4" } -} \ No newline at end of file +} diff --git a/src/globalPlatfroms.ts b/src/globalPlatfroms.ts index 8372b53..10f8c85 100644 --- a/src/globalPlatfroms.ts +++ b/src/globalPlatfroms.ts @@ -3,7 +3,6 @@ import readline from "node:readline"; import child_process from "node:child_process"; import { EventEmitter } from "node:events"; import { bdsPlatform } from "./platformPathManeger"; -import * as process_load from "./lib/processLoad"; export const internalSessions: {[sessionID: string]: serverActionV2} = {}; process.once("exit", () => Object.keys(internalSessions).forEach(id => internalSessions[id].stopServer())); @@ -45,10 +44,6 @@ export declare interface serverActionsEvent { once(act: "log", fn: (data: string) => void): this; emit(act: "log", data: string): boolean; - on(act: "avg", fn: (data: process_load.avg) => void): this; - once(act: "avg", fn: (data: process_load.avg) => void): this; - emit(act: "avg", data: process_load.avg): boolean; - on(act: "exit", fn: (data: {code: number, signal: NodeJS.Signals}) => void): this; once(act: "exit", fn: (data: {code: number, signal: NodeJS.Signals}) => void): this; emit(act: "exit", data: {code: number, signal: NodeJS.Signals}): boolean; @@ -134,10 +129,6 @@ export async function actionV2(options: {id: string, platform: bdsPlatform, proc // Add to internal sessions internalSessions[options.id] = serverObject; serverObject.events.on("exit", () => delete internalSessions[options.id]); - const processMetric = new process_load.processLoad(childProcess.pid); - processMetric.on("avg", data => serverObject.events.emit("avg", data)); - processMetric.on("error", err => serverObject.events.emit("error", err)); - serverObject.events.on("exit", () => processMetric.close()); // Register hooks // Server avaible to player diff --git a/src/index.ts b/src/index.ts index a3859f8..88b10de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,6 @@ import * as platformPathManeger from "./platformPathManeger" import * as globalPlatfroms from "./globalPlatfroms"; import * as pluginManeger from "./plugin/plugin"; import * as export_import from "./export_import"; -import * as process_load from "./lib/processLoad"; import * as pluginHooks from "./plugin/hook"; import * as proxy from "./lib/proxy"; @@ -16,7 +15,7 @@ import * as Spigot from "./spigot"; import * as Powernukkit from "./pwnuukit"; import * as PaperMC from "./paper"; -export {platformPathManeger, globalPlatfroms, pluginManeger, export_import, process_load, PocketmineMP, pluginHooks, Powernukkit, httpRequest, PaperMC, Bedrock, Spigot, proxy, Java}; +export {platformPathManeger, globalPlatfroms, pluginManeger, export_import, PocketmineMP, pluginHooks, Powernukkit, httpRequest, PaperMC, Bedrock, Spigot, proxy, Java}; export default { Bedrock, Java, @@ -31,7 +30,6 @@ export default { pluginHooks, httpRequest, export_import, - process_load, proxy } -}; \ No newline at end of file +}; diff --git a/src/lib/processLoad.ts b/src/lib/processLoad.ts deleted file mode 100644 index d91faff..0000000 --- a/src/lib/processLoad.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { EventEmitter } from "node:events"; -// import customProcess from "./childPromisses"; -import extendsFs from "./extendsFs"; -import path from "node:path"; -import fs from "node:fs/promises"; -// import os from "node:os"; - -export type pidstat = { - /** The process id. **/ - pid: number, - /** The filename of the executable **/ - exName: string, - /** 'R' is running, 'S' is sleeping, 'D' is sleeping in an uninterruptible wait, 'Z' is zombie, 'T' is traced or stopped **/ - state: "R"|"S"|"D"|"Z"|"T", - /** effective user id **/ - euid: number, - /** effective group id */ - egid: number, - /** The pid of the parent. **/ - ppid: number, - /** The pgrp of the process. **/ - pgrp: number, - /** The session id of the process. **/ - session: number, - /** The tty the process uses **/ - tty: number, - /** (too long) **/ - tpgid: number, - /** The flags of the process. **/ - flags: number, - /** The number of minor faults **/ - minflt: number, - /** The number of minor faults with childs **/ - cminflt: number, - /** The number of major faults **/ - majflt: number, - /** The number of major faults with childs **/ - cmajflt: number, - /** user mode jiffies **/ - utime: number, - /** kernel mode jiffies **/ - stime: number, - /** user mode jiffies with childs **/ - cutime: number, - /** kernel mode jiffies with childs **/ - cstime: number, - /** process's next timeslice **/ - counter: number, - /** the standard nice value, plus fifteen **/ - priority: number, - /** The time in jiffies of the next timeout **/ - timeout: number, - /** The time before the next SIGALRM is sent to the process **/ - itrealvalue: number, - /** Time the process started after system boot **/ - starttime: number, - /** Virtual memory size **/ - vsize: number, - /** Resident Set Size **/ - rss: number, - /** Current limit in bytes on the rss **/ - rlim: number, - /** The address above which program text can run **/ - startcode: number, - /** The address below which program text can run **/ - endcode: number, - /** The address of the start of the stack **/ - startstack: number, - /** The current value of ESP **/ - kstkesp: number, - /** The current value of EIP **/ - kstkeip: number, - /** The bitmap of pending signals **/ - signal: number, - /** The bitmap of blocked signals **/ - blocked: number, - /** The bitmap of ignored signals **/ - sigignore: number, - /** The bitmap of catched signals **/ - sigcatch: number, - /** (too long) **/ - wchan: number, - /** scheduler **/ - sched: number, - /** scheduler priority **/ - sched_priority: any -}; - -// Receive: bytes packets errs drop fifo frame compressed multicast -// Transmit: bytes packets errs drop fifo colls carrier compressed -export type netDef = { - recive: { - bytes: number, - packets: number, - errs: number, - drop: number, - fifo: number, - frame: number, - compressed: number, - multicast: number - }, - transmit: { - bytes: number, - packets: number, - errs: number, - drop: number, - fifo: number, - colls: number, - carrier: number, - compressed: number - } -}; - -export type avg = {cpuAvg: number, cpuAvgNoAbs: number, cwd: string, cmdline: string[], net: {[name: string]: netDef}} - -export declare interface processLoad { - on(act: "error", fn: (data: any) => void): this; - once(act: "error", fn: (data: any) => void): this; - emit(act: "error", data: any): boolean; - - on(act: "avg", fn: (data: avg & {latestLoop?: Date}) => void): this; - once(act: "avg", fn: (data: avg & {latestLoop?: Date}) => void): this; - emit(act: "avg", data: avg & {latestLoop?: Date}): boolean; -} - -const linuxPlatform: NodeJS.Platform[] = ["android", "linux"]; - -export class processLoad extends EventEmitter { - pidNumber: number; - private terminateProcess = true; - #procFolder = "/proc"; - - close(){this.terminateProcess = false; return this;} - - async #linux(): Promise { - const pidFolder = path.join(this.#procFolder, this.pidNumber.toFixed(0)); - if (!await extendsFs.exists(pidFolder)) throw new Error("PID not found!"); - // cwd - const cwd = await fs.realpath(path.join(pidFolder, "cwd")); - - // cmdline - const cmdline = (await fs.readFile(path.join(pidFolder, "cmdline"), "utf8")).trim().split(/\u0000/).filter(a => !!a); - - // stat - const [pid, exName, state, euid, egid, ppid, pgrp, session, tty, tpgid, flags, minflt, cminflt, majflt, cmajflt, utime, stime, cutime, cstime, counter, priority, timeout, itrealvalue, starttime, vsize, rss, rlim, startcode, endcode, startstack, kstkesp, kstkeip, signal, blocked, sigignore, sigcatch, wchan, sched, sched_priority] = (await fs.readFile(path.join(pidFolder, "stat"), "utf8")).trim().split(/\s+|[\t]+|\t/); - const cpuAvg: pidstat = {pid: parseInt(pid), exName, state: state as pidstat["state"], euid: parseInt(euid), egid: parseInt(egid), ppid: parseInt(ppid), pgrp: parseInt(pgrp), session: parseInt(session), tty: parseInt(tty), tpgid: parseInt(tpgid), flags: parseInt(flags), minflt: parseInt(minflt), cminflt: parseInt(cminflt), majflt: parseInt(majflt), cmajflt: parseInt(cmajflt), utime: parseInt(utime), stime: parseInt(stime), cutime: parseInt(cutime), cstime: parseInt(cstime), counter: parseInt(counter), priority: parseInt(priority), timeout: parseInt(timeout), itrealvalue: parseInt(itrealvalue), starttime: parseInt(starttime), vsize: parseInt(vsize), rss: parseInt(rss), rlim: parseInt(rlim), startcode: parseInt(startcode), endcode: parseInt(endcode), startstack: parseInt(startstack), kstkesp: parseInt(kstkesp), kstkeip: parseInt(kstkeip), signal: parseInt(signal), blocked: parseInt(blocked), sigignore: parseInt(sigignore), sigcatch: parseInt(sigcatch), wchan: parseInt(wchan), sched: parseInt(sched), sched_priority: sched_priority?parseInt(sched_priority):sched_priority}; - - // net - const netInterface = /([a-zA-Z0-9_\-]+):\s+(.*)/; - const net: {[name: string]: netDef} = {}; - (await fs.readFile(path.join(pidFolder, "net/dev"), "utf8")).split(/\r?\n/).filter(line => netInterface.test(line)).forEach(line => { - const dataMath = line.match(netInterface); - if (!dataMath) return; - const [, interfaceName, data] = dataMath; - const [recive_bytes, recive_packets, recive_errs, recive_drop, recive_fifo, recive_frame, recive_compressed, recive_multicast, transmit_bytes, transmit_packets, transmit_errs, transmit_drop, transmit_fifo, transmit_colls, transmit_carrier, transmit_compressed] = data.split(/\s+/).map(numberString => parseInt(numberString)); - net[interfaceName] = { - recive: { - bytes: recive_bytes, - compressed: recive_compressed, - drop: recive_drop, - errs: recive_errs, - fifo: recive_fifo, - frame: recive_frame, - multicast: recive_multicast, - packets: recive_packets - }, - transmit: { - bytes: transmit_bytes, - carrier: transmit_carrier, - colls: transmit_colls, - compressed: transmit_compressed, - drop: transmit_drop, - errs: transmit_errs, - fifo: transmit_fifo, - packets: transmit_packets - } - }; - return; - }); - - const cpu_usage = Math.abs((cpuAvg.cmajflt+cpuAvg.utime+cpuAvg.stime+cpuAvg.cutime+cpuAvg.cstime)/30)//Hartz; - return { - cpuAvg: parseFloat(cpu_usage.toFixed(2)), - cpuAvgNoAbs: cpu_usage, - cwd, - cmdline, - net, - }; - } - - latestLoop: Date; - latestAvg?: avg; - constructor(processPid: number) { - super({captureRejections: false}); - this.pidNumber = processPid; - (async () => { - while(this.terminateProcess) { - if (linuxPlatform.includes(process.platform)) await this.#linux().then(data => {this.latestAvg = data; this.latestLoop = new Date(); this.emit("avg", {...data, latestLoop: this.latestLoop});}).catch(err => {this.emit("error", err); this.close()}); - await new Promise(done => setTimeout(done, 1800)); - } - })(); - } -} \ No newline at end of file diff --git a/src/lib/request/client.ts b/src/lib/request/client.ts new file mode 100644 index 0000000..b81c32a --- /dev/null +++ b/src/lib/request/client.ts @@ -0,0 +1,26 @@ +import { getJSON } from "@http/simples"; + +export type testIp = { + ip: string, + type: protocolType, + subtype: string, + via: string, + padding: string, + asn: string, + asnlist: string, + asn_name: string, + country: string, + protocol: "HTTP/2.0"|"HTTP/1.1"|"HTTP/1.0" +}; + +export async function getExternalIP(): Promise<{ipv4: string, ipv6?: string, rawRequest?: {ipv4: testIp<"ipv4">, ipv6?: testIp<"ipv6">}}> { + const [ipv6, ipv4] = await Promise.all([ + await getJSON>("https://ipv6.lookup.test-ipv6.com/ip/").catch(() => undefined), + await getJSON>("https://ipv4.lookup.test-ipv6.com/ip/") + ]); + return { + ipv4: ipv4.ip, + ipv6: ipv6?.ip, + rawRequest: {ipv4, ipv6} + }; +} diff --git a/src/lib/request/github.ts b/src/lib/request/github.ts new file mode 100644 index 0000000..ef5cbf7 --- /dev/null +++ b/src/lib/request/github.ts @@ -0,0 +1,107 @@ +import { getJSON } from "@http/simples"; + +export type githubRelease = { + url: string; + assets_url: string; + upload_url: string; + html_url: string; + id: number; + tarball_url: string; + zipball_url: string; + body: string; + author: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + }; + node_id: string; + tag_name: string; + target_commitish: string; + name: string; + draft: boolean; + prerelease: boolean; + created_at: string; + published_at: string; + assets: Array<{ + url: string; + id: number; + node_id: string; + name: string; + label: string; + content_type: string; + state: string; + size: number; + download_count: number; + created_at: string; + updated_at: string; + browser_download_url: string; + uploader: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + }; + }>; +}; + +export async function GithubRelease(username: string, repo: string, releaseTag: string): Promise; +export async function GithubRelease(username: string, repo: string): Promise; +export async function GithubRelease(username: string): Promise; +export async function GithubRelease(username: string, repo?: string, releaseTag?: string): Promise { + let fullRepo = username; + if (!username) throw new Error("Repository is required, example: GithubRelease(\"Username/repo\") or GithubRelease(\"Username\", \"repo\")"); + if (repo) { + if (!/\//.test(fullRepo)) fullRepo += "/"+repo; + } + if (releaseTag) return getJSON(`https://api.github.com/repos/${fullRepo}/releases/tags/${releaseTag}`); + return getJSON(`https://api.github.com/repos/${fullRepo}/releases?per_page=100`); +} + +export type githubTree = { + "sha": string, + "url": string, + "truncated": boolean, + "tree": { + "path": string, + "mode": string, + "type": "blob"|"tree", + "sha": string, + "size": number, + "url": string + }[], +}; +export async function githubTree(username: string, repo: string, tree: string = "main") { + const validate = /^[a-zA-Z0-9_\-]+$/; + if (!validate.test(username)) throw new Error("Invalid username"); + if (!validate.test(repo)) throw new Error("Invalid repository name"); + return getJSON(`https://api.github.com/repos/${username}/${repo}/git/trees/${tree}?recursive=true`); +} diff --git a/src/lib/request/large.ts b/src/lib/request/large.ts new file mode 100644 index 0000000..0bc6e46 --- /dev/null +++ b/src/lib/request/large.ts @@ -0,0 +1,53 @@ +import { requestOptions, pipeFetch } from "@http/simples"; +import os from "node:os"; +import fs from "node:fs"; +import path from "node:path"; +import crypto from "node:crypto"; +import tar from "tar"; +import AdmZip from "adm-zip"; +import { exists } from "../extendsFs"; + +export async function saveFile(request: string|requestOptions & {filePath?: string}) { + if (typeof request === "string") request = {url: request}; + const filePath = request.filePath||path.join(os.tmpdir(), `raw_bdscore_${Date.now()}_${(path.parse(request.url||request.socket?.path||crypto.randomBytes(16).toString("hex"))).name}`); + await pipeFetch({...request, waitFinish: true, stream: fs.createWriteStream(filePath, {autoClose: false})}); + return filePath; +} + +export async function tarExtract(request: requestOptions & {folderPath?: string}) { + const folderToExtract = request.folderPath||path.join(os.tmpdir(), `raw_bdscore_${Date.now()}_${(path.parse(request.url||request.socket?.path||crypto.randomBytes(16).toString("hex"))).name}`); + if (!await exists(folderToExtract)) await fs.promises.mkdir(folderToExtract, {recursive: true}); + await pipeFetch({ + ...request, + waitFinish: true, + stream: tar.extract({ + cwd: folderToExtract, + noChmod: false, + noMtime: false, + preserveOwner: true, + keep: true, + p: true + }) + }); + return folderToExtract +} + +const githubAchive = /github.com\/[\S\w]+\/[\S\w]+\/archive\//; +export async function extractZip(request: requestOptions & {folderTarget: string}) { + const zip = new AdmZip(await saveFile(request)); + const targetFolder = githubAchive.test(request.url)?await fs.promises.mkdtemp(path.join(os.tmpdir(), "githubRoot_"), "utf8"):request.folderTarget; + await new Promise((done, reject) => { + zip.extractAllToAsync(targetFolder, true, true, (err) => { + if (!err) return done(); + return reject(err); + }) + }); + + if (githubAchive.test(request.url)) { + const files = await fs.promises.readdir(targetFolder); + if (files.length === 0) throw new Error("Invalid extract"); + await fs.promises.cp(path.join(targetFolder, files[0]), request.folderTarget, {recursive: true, force: true, preserveTimestamps: true, verbatimSymlinks: true}); + return await fs.promises.rm(targetFolder, {recursive: true, force: true}); + } + return; +} diff --git a/src/lib/request/simples.ts b/src/lib/request/simples.ts new file mode 100644 index 0000000..57c2fe0 --- /dev/null +++ b/src/lib/request/simples.ts @@ -0,0 +1,70 @@ +import type { Method } from "got"; +import * as fs from "node:fs"; +import * as stream from "node:stream"; + +const UserAgent = "Mozilla/5.0 (Linux; Android 12; moto g(7) plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36"; + +export let got; +async function gotCjs(): Promise<(typeof import("got"))["default"]> { + if (got) return got; + const dyImport = (await (eval('import("got")') as Promise)).default.extend({enableUnixSockets: true, headers: {"User-Agent": UserAgent, "USER-AGENT": UserAgent, "user-agent": UserAgent}}); + got = dyImport; + return dyImport; +} + +gotCjs().then(res => got = res); + +export type requestOptions = { + url?: string, + socket?: { + socketPath: string, + path?: string, + } + method?: Method, + headers?: {[headerName: string]: string[]|string}, + body?: any, +}; + +export async function pipeFetch(options: requestOptions & {stream: fs.WriteStream|stream.Writable, waitFinish?: boolean}) { + if (!(options?.url||options?.socket)) throw new Error("Host blank") + const urlRequest = (typeof options.url === "string")?options.url:`http://unix:${options.socket.socketPath}:${options.socket.path||"/"}`; + const gotStream = (await gotCjs()).stream(urlRequest, { + isStream: true, + headers: options.headers||{}, + method: options.method||"GET", + json: options.body, + }); + await new Promise((done, reject) => { + gotStream.pipe(options.stream); + options.stream.on("error", reject); + gotStream.on("error", reject); + gotStream.once("end", () => { + if (options.waitFinish) return options.stream.once("finish", done); + return done(); + }); + }); +} + +export async function bufferFetch(options: string|requestOptions) { + if (typeof options === "string") options = {url: options}; + if (!(options.url||options.socket)) throw new Error("Host blank") + const urlRequest = (typeof options.url === "string")?options.url:`http://unix:${options.socket.socketPath}:${options.socket.path||"/"}`; + return (await gotCjs())(urlRequest, { + headers: options.headers||{}, + method: options.method||"GET", + json: options.body, + responseType: "buffer", + }).then(res => ({headers: res.headers, data: Buffer.from(res.body), response: res})); +} + +export async function getJSON(request: string|requestOptions): Promise { + if (typeof request === "string") request = {url: request}; + const res = (await bufferFetch(request)).data.toString("utf8"); + return JSON.parse(res) as JSONReturn; +} + +const httpUrl = /^http[s]:\/\/[a-z0-9\.\-_]+(|\/([\s\W\S]+?))/; +export async function urls(options: requestOptions|string): Promise { + const data = (await bufferFetch(options)).data.toString("utf8"); + return data.split(/["'<>]/gi).filter(line => httpUrl.test(line)) +} diff --git a/src/lib/versions/db/bedrock.ts b/src/lib/versions/db/bedrock.ts new file mode 100644 index 0000000..7875bbc --- /dev/null +++ b/src/lib/versions/db/bedrock.ts @@ -0,0 +1,38 @@ +import mongoose from "mongoose"; +import connection from "./connect"; +import { Router } from "express"; +export const app = Router(); + +export type bedrockSchema = { + version: string, + date: Date, + latest: boolean, + url: { + win32: string, + linux: string + } +}; + +export const bedrock = connection.model("bedrock", new mongoose.Schema({ + version: { + type: String, + required: true, + unique: true + }, + date: Date, + latest: Boolean, + url: { + win32: String, + linux: String + } +})); + +app.get("/", ({res}) => bedrock.find().lean().then(data => res.json(data))); +app.get("/latest", async ({res}) => res.json(await bedrock.findOne({latest: true}).lean())); +app.get("/search", async (req, res) => { + let version = req.query.version as string; + if (!version) return res.status(400).json({error: "No version specified"}); + const versionFinded = await bedrock.findOne({version}).lean(); + if (!versionFinded) return res.status(404).json({error: "Version not found"}); + return res.json(versionFinded); +}); diff --git a/src/lib/versions/db/connect.ts b/src/lib/versions/db/connect.ts new file mode 100644 index 0000000..c5ddc4c --- /dev/null +++ b/src/lib/versions/db/connect.ts @@ -0,0 +1,8 @@ +import mongoose from "mongoose"; +export let authUsername = (!!process.env.MONGO_USER)?process.env.MONGO_USER:"public"; +export let authPassword = (!!process.env.MONGO_PASSWORD)?process.env.MONGO_PASSWORD:"n0v8IBKEI920sfy8"; +export const mongoURL = process.env.BDSVERSIONDB||`mongodb+srv://${authUsername}:${authPassword}@versionstorage.qgh8v.mongodb.net/v2_versions`; + +// Connect to MongoDB +export const connection = mongoose.createConnection(mongoURL); +export default connection; diff --git a/src/lib/versions/db/java.ts b/src/lib/versions/db/java.ts new file mode 100644 index 0000000..cf8a4f7 --- /dev/null +++ b/src/lib/versions/db/java.ts @@ -0,0 +1,33 @@ +import mongoose from "mongoose"; +import connection from "./connect"; +import { Router } from "express"; +export const app = Router(); + +export type javaSchema = { + version: string, + date: Date, + latest: boolean, + url: string +}; + +export const java = connection.model("java", new mongoose.Schema({ + version: { + type: String, + required: true, + unique: true + }, + date: Date, + latest: Boolean, + url: String +})); +export default java; + +app.get("/", ({res}) => java.find().lean().then(data => res.json(data))); +app.get("/latest", async ({res}) => res.json(await java.findOne({latest: true}).lean())); +app.get("/search", async (req, res) => { + let version = req.query.version as string; + if (!version) return res.status(400).json({error: "No version specified"}); + const versionFinded = await java.findOne({version: version}).lean(); + if (!versionFinded) return res.status(404).json({error: "Version not found"}); + return res.json(versionFinded); +}); diff --git a/src/lib/versions/db/paper.ts b/src/lib/versions/db/paper.ts new file mode 100644 index 0000000..a9ac3fd --- /dev/null +++ b/src/lib/versions/db/paper.ts @@ -0,0 +1,42 @@ +import mongoose from "mongoose"; +import connection from "./connect"; +import { Router } from "express"; +export const app = Router(); + +export type paperSchema = { + version: string, + build: number, + date: Date, + latest: boolean, + url: string +}; + +export const paper = connection.model("paper", new mongoose.Schema({ + version: String, + build: Number, + date: Date, + latest: Boolean, + url: String +})); + +app.get("/", ({res}) => paper.find().lean().then(data => res.json(data))); +app.get("/latest", ({res}) => paper.findOne({latest: true}).lean().then(data => res.json(data))); +app.get("/search", async (req, res) => { + let version = req.query.version as string; + if (!version) return res.status(400).json({erro: "Not allowd blank version"}); + let build = parseInt(req.query.build as string); + if (isNaN(build)) build = undefined; + if (!!build) { + const info = await paper.findOne({ + version, + build + }); + if (!info) return res.status(400).json({error: "version and build not exists"}); + return res.json(info); + } + const info = await paper.findOne({ + version + }); + if (!info) return res.status(400).json({error: "version not exists"}); + return res.json(info); +}); \ No newline at end of file diff --git a/src/lib/versions/db/pocketmine.ts b/src/lib/versions/db/pocketmine.ts new file mode 100644 index 0000000..453c6f4 --- /dev/null +++ b/src/lib/versions/db/pocketmine.ts @@ -0,0 +1,21 @@ +import mongoose from "mongoose"; +import connection from "./connect"; + +export type pocketminemmpSchema = { + version: string, + date: Date, + latest: boolean, + url: string +}; + +export const pocketmine = connection.model("pocketminemmp", new mongoose.Schema({ + version: { + type: String, + required: true, + unique: true + }, + date: Date, + latest: Boolean, + url: String +})); + diff --git a/src/lib/versions/db/powernukkit.ts b/src/lib/versions/db/powernukkit.ts new file mode 100644 index 0000000..ee44e02 --- /dev/null +++ b/src/lib/versions/db/powernukkit.ts @@ -0,0 +1,37 @@ +import mongoose from "mongoose"; +import connection from "./connect"; +import { Router } from "express"; +export const app = Router(); + +export type powernukkitSchema = { + version: string, + mcpeVersion: string, + date: Date, + latest: boolean, + url: string, + variantType: "stable"|"snapshot" +}; + +export const powernukkit = connection.model("powernukkit", new mongoose.Schema({ + version: { + type: String, + unique: false, + required: true + }, + mcpeVersion: String, + date: Date, + url: String, + variantType: String, + latest: Boolean +})); + +app.get("/", ({res}) => powernukkit.find().lean().then(data => res.json(data))); +app.get("/latest", ({res}) => powernukkit.findOne({latest: true}).lean().then(data => res.json(data))); +app.get("/search", async (req, res) => { + let version = req.query.version as string; + let variant = (req.query.variant as string)||undefined; + if (!version) return res.status(400).json({error: "No version specified"}); + const versionDB = await powernukkit.findOne({version, variant: {to: variant}}).lean(); + if (!versionDB) return res.status(404).json({error: "Version not found"}); + return res.json(versionDB); +}); \ No newline at end of file diff --git a/src/lib/versions/db/spigot.ts b/src/lib/versions/db/spigot.ts new file mode 100644 index 0000000..48b8f49 --- /dev/null +++ b/src/lib/versions/db/spigot.ts @@ -0,0 +1,33 @@ +import mongoose from "mongoose"; +import connection from "./connect"; +import { Router } from "express"; +export const app = Router(); + +// Type to represent the spigot model +export type spigotSchema = { + version: string, + date: Date, + latest: boolean, + url: string +}; + +export const spigot = connection.model("spigot", new mongoose.Schema({ + version: { + type: String, + required: true, + unique: true + }, + date: Date, + latest: Boolean, + url: String +})); + +app.get("/", ({res}) => spigot.find().lean().then(data => res.json(data))); +app.get("/latest", async ({res}) => res.json(await spigot.findOne({latest: true}).lean())); +app.get("/search", async (req, res) => { + let version = req.query.version as string; + if (!version) return res.status(400).json({error: "No version specified"}); + const versionFinded = await spigot.findOne({version}).lean(); + if (!versionFinded) return res.status(404).json({error: "Version not found"}); + return res.json(versionFinded); +}); diff --git a/src/lib/versions/exports.ts b/src/lib/versions/exports.ts new file mode 100644 index 0000000..006420c --- /dev/null +++ b/src/lib/versions/exports.ts @@ -0,0 +1,76 @@ +import fsOld from "node:fs"; +import path from "node:path"; +import fs from "node:fs/promises"; +import { findVersion as getVersions, bedrock, java, paper, pocketmine, powernukkit, spigot } from "./index"; + +const rootVersions = path.join(process.cwd(), "versions"); +const Bedrock = path.join(rootVersions, "bedrock"); +const Pocketmine = path.join(rootVersions, "pocketmine"); +const Powernukkit = path.join(rootVersions, "powernukkit"); +const Java = path.join(rootVersions, "java"); +const Spigot = path.join(rootVersions, "spigot"); +const Paper = path.join(rootVersions, "paper"); + +(async function(){ + if (!fsOld.existsSync(rootVersions)) await fs.mkdir(rootVersions, {recursive: true}); + if (!fsOld.existsSync(Bedrock)) await fs.mkdir(Bedrock, {recursive: true}); + if (!fsOld.existsSync(Pocketmine)) await fs.mkdir(Pocketmine, {recursive: true}); + if (!fsOld.existsSync(Powernukkit)) await fs.mkdir(Powernukkit, {recursive: true}); + if (!fsOld.existsSync(Java)) await fs.mkdir(Java, {recursive: true}); + if (!fsOld.existsSync(Spigot)) await fs.mkdir(Spigot, {recursive: true}); + if (!fsOld.existsSync(Paper)) await fs.mkdir(Paper, {recursive: true}); + + const bedrockData = await getVersions("bedrock", "all", true); + fs.writeFile(path.join(Bedrock, "latest.json"), JSON.stringify(bedrockData.find(release => release.latest), null, 2)); + fs.writeFile(path.join(Bedrock, "all.json"), JSON.stringify(bedrockData, null, 2)); + await Promise.all(bedrockData.map(async releases => { + const version = path.join(Bedrock, `${releases.version}.json`); + await fs.writeFile(version, JSON.stringify(releases, null, 2)); + await fs.utimes(version, new Date(releases.date), new Date(releases.date)); + })); + + const PocketmineData = await getVersions("pocketmine", "all", true); + fs.writeFile(path.join(Pocketmine, "latest.json"), JSON.stringify(PocketmineData.find(release => release.latest), null, 2)); + fs.writeFile(path.join(Pocketmine, "all.json"), JSON.stringify(PocketmineData, null, 2)); + await Promise.all(PocketmineData.map(async releases => { + const version = path.join(Pocketmine, `${releases.version}.json`); + await fs.writeFile(version, JSON.stringify(releases, null, 2)); + await fs.utimes(version, new Date(releases.date), new Date(releases.date)); + })); + + const PowernukkitData = await getVersions("powernukkit", "all", true); + fs.writeFile(path.join(Powernukkit, "latest.json"), JSON.stringify(PowernukkitData.find(release => release.latest), null, 2)); + fs.writeFile(path.join(Powernukkit, "all.json"), JSON.stringify(PowernukkitData, null, 2)); + await Promise.all(PowernukkitData.map(async releases => { + const version = path.join(Powernukkit, `${releases.version}.json`); + await fs.writeFile(version, JSON.stringify(releases, null, 2)); + await fs.utimes(version, new Date(releases.date), new Date(releases.date)); + })); + + const JavaData = await getVersions("java", "all", true); + fs.writeFile(path.join(Java, "latest.json"), JSON.stringify(JavaData.find(release => release.latest), null, 2)); + fs.writeFile(path.join(Java, "all.json"), JSON.stringify(JavaData, null, 2)); + await Promise.all(JavaData.map(async releases => { + const version = path.join(Java, `${releases.version}.json`); + await fs.writeFile(version, JSON.stringify(releases, null, 2)); + await fs.utimes(version, new Date(releases.date), new Date(releases.date)); + })); + + const SpigotData = await getVersions("spigot", "all", true); + fs.writeFile(path.join(Spigot, "latest.json"), JSON.stringify(SpigotData.find(release => release.latest), null, 2)); + fs.writeFile(path.join(Spigot, "all.json"), JSON.stringify(SpigotData, null, 2)); + await Promise.all(SpigotData.map(async releases => { + const version = path.join(Spigot, `${releases.version}.json`); + await fs.writeFile(version, JSON.stringify(releases, null, 2)); + await fs.utimes(version, new Date(releases.date), new Date(releases.date)); + })); + + const PaperData = await getVersions("paper", "all", true); + fs.writeFile(path.join(Paper, "latest.json"), JSON.stringify(PaperData.find(release => release.latest), null, 2)); + fs.writeFile(path.join(Paper, "all.json"), JSON.stringify(PaperData, null, 2)); + await Promise.all(PaperData.map(async releases => { + const version = path.join(Paper, `${releases.version}_${releases.build}.json`); + await fs.writeFile(version, JSON.stringify(releases, null, 2)); + await fs.utimes(version, new Date(releases.date), new Date(releases.date)); + })); +})(); \ No newline at end of file diff --git a/src/lib/versions/fetchVersion/Bedrock.ts b/src/lib/versions/fetchVersion/Bedrock.ts new file mode 100644 index 0000000..f25b9fd --- /dev/null +++ b/src/lib/versions/fetchVersion/Bedrock.ts @@ -0,0 +1,42 @@ +import adm_zip from "adm-zip"; +import { bufferFetch, urls } from "@http/simples"; +import { bedrock, bedrockSchema } from "../db/bedrock"; + +export default async function UpdateDatabase() { + const minecraftUrls = (await urls("https://minecraft.net/en-us/download/server/bedrock")).filter(Link => /bin-.*\.zip/.test(Link)); + const objURLs: {linux: string, win32: string} = {linux: undefined, win32: undefined}; + minecraftUrls.forEach((url: string) => { + if (/darwin|macos|mac/.test(url)) console.log("Macos Are now supported: %s", url); + else if (/win/.test(url)) objURLs.win32 = url; + else if (/linux/.test(url)) objURLs.linux = url; + }); + const anyZip = objURLs.win32||objURLs.linux; + if (!anyZip) throw new Error("cannot get url"); + const [, mcpeVersion] = anyZip.match(/\/[a-zA-Z-_]+([0-9\.]+).zip$/)||[]; + const mcpeDate = await new Promise(async resolve => { + const zip = new adm_zip((await bufferFetch(objURLs.linux)).data); + for (const entry of zip.getEntries()) { + if (entry.entryName === "bedrock_server") return resolve(entry.header.time); + }; + return resolve(new Date()); + }); + if (!mcpeVersion) return; + const version: bedrockSchema = { + version: mcpeVersion, + date: mcpeDate, + latest: false, + url: { + linux: objURLs.linux, + win32: objURLs.win32 + } + }; + if (await bedrock.findOne({version: version.version}).lean()) { + console.log("Bedrock version %s are exists", version.version); + return; + } + await bedrock.create(version); + console.log("Bedrock adding new version %s", version.version); + await bedrock.findOneAndUpdate({latest: true}, {$set: {latest: false}}); + const latest = (await bedrock.find().lean()).sort((a, b) => b.date.getTime() - a.date.getTime())[0]; + await bedrock.findByIdAndUpdate(latest._id, {$set: {latest: true}}); +} diff --git a/src/lib/versions/fetchVersion/Java.ts b/src/lib/versions/fetchVersion/Java.ts new file mode 100644 index 0000000..b425987 --- /dev/null +++ b/src/lib/versions/fetchVersion/Java.ts @@ -0,0 +1,35 @@ +import { getJSON } from "@http/simples"; +import { java } from "../db/java"; +import { javaRelease } from "./types/Java"; + +async function Add(Version: string, versionDate: Date, url: string): Promise { + if (await java.findOne({ version: Version }).lean().then(data => !!data).catch(() => true)) return; + else { + console.log("Java: Version '%s', url '%s'", Version, url); + await java.create({ + version: Version, + date: versionDate, + latest: false, + url: url + }); + } +} + +type version_manifest_v2 = {latest: {release: string, snapshot: string, }, versions: {id: string, type: "snapshot"|"release", url: string, time: string, releaseTime: string, sha1: string, complianceLevel: number}[]} + +async function Find() { + const Versions = await getJSON("https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"); + for (const ver of Versions.versions.filter(a => a.type === "release")) { + const Release = await getJSON(ver.url); + if (!!Release?.downloads?.server?.url) await Add(ver.id, new Date(ver.releaseTime), Release?.downloads?.server?.url); + } + return await java.findOneAndUpdate({version: Versions.latest.release}, {$set: {latest: true}}).lean(); +} + +export default async function UpdateDatabase() { + const latestVersion = await java.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); + return { + new: await Find(), + old: latestVersion + }; +} diff --git a/src/lib/versions/fetchVersion/Paper.ts b/src/lib/versions/fetchVersion/Paper.ts new file mode 100644 index 0000000..686f76e --- /dev/null +++ b/src/lib/versions/fetchVersion/Paper.ts @@ -0,0 +1,48 @@ +import { getJSON as getJson } from "@http/simples"; +import { paper } from "../db/paper"; + +type paperVersions = { + project_id: string, + project_name: string, + version_groups: string[], + versions: string[] +}; + +type paperBuilds = { + project_id: string, + project_name: string, + version: string, + builds: { + build: number; + time: string; + channel: string; + promoted: boolean; + changes: {commit: string, summary: string, message: string}[]; + downloads: { + application: {name: string, sha256: string}, + mojangMappings: {name: string, sha256: string} + } + }[] +}; + +export default async function find() { + const versions = (await getJson("https://api.papermc.io/v2/projects/paper")).versions; + for (const version of versions) { + const builds = await getJson(`https://api.papermc.io/v2/projects/paper/versions/${version}/builds`); + await Promise.all(builds.builds.map(async function(build){ + const downloadUrl = `https://api.papermc.io/v2/projects/paper/versions/${builds.version}/builds/${build.build}/downloads/${build.downloads.application.name}`; + if (await paper.findOne({url: downloadUrl}).lean()) return; + await paper.create({ + version: builds.version, + build: build.build, + date: new Date(build.time), + url: downloadUrl, + latest: false + }); + return console.log("Paper add %s version, build %s", builds.version, build.build); + })); + } + await paper.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); + const latestVersionByDate = (await paper.find().lean()).sort((a, b) => b.date.getTime()-a.date.getTime())[0]; + await paper.findByIdAndUpdate(latestVersionByDate._id, {$set: {latest: true}}).lean(); +} diff --git a/src/lib/versions/fetchVersion/Pocketmine.ts b/src/lib/versions/fetchVersion/Pocketmine.ts new file mode 100644 index 0000000..386193e --- /dev/null +++ b/src/lib/versions/fetchVersion/Pocketmine.ts @@ -0,0 +1,40 @@ +import { GithubRelease } from "@http/github"; +import { pocketmine as pocketminemmp} from "../db/pocketmine"; + +async function Add(Version: string, versionDate: Date, url: string) { + if (await pocketminemmp.findOne({ version: Version }).lean().then(data => !!data).catch(() => true)) console.log("Pocketmine: version (%s) already exists", Version); + else { + await pocketminemmp.create({ + version: Version, + date: versionDate, + latest: false, + url: url + }); + console.log("Pocketmine PMMP: Version %s, url %s", Version, url); + } +} + +async function Find() { + return await Promise.all((await GithubRelease("pmmp/PocketMine-MP")).filter(Release => !/beta|alpha/gi.test(Release.tag_name.toLowerCase())).map(Release => { + Release.assets = Release.assets.filter(asset => asset.name.endsWith(".phar")); + return Release; + }).filter(a => a.assets.length > 0).map(release => { + return Add(release.tag_name, new Date(release.published_at), release.assets[0].browser_download_url).catch(err => { + console.log("Pocketmine PMMP: Version %s, Error: %o", release.tag_name, err); + }).then(() => ({ + Date: new Date(release.published_at), + Version: release.tag_name, + url: release.assets[0].browser_download_url + })); + })); +} + +export default async function UpdateDatabase() { + const latestVersion = await pocketminemmp.findOneAndUpdate({ latest: true }, {$set: {latest: false}}).lean(); + const Releases = await Find(); + const newLatest = await pocketminemmp.findOneAndUpdate({ version: Releases[0].Version }, {$set: { latest: true }}).lean(); + return { + new: newLatest, + old: latestVersion + }; +} diff --git a/src/lib/versions/fetchVersion/Powernukkit.ts b/src/lib/versions/fetchVersion/Powernukkit.ts new file mode 100644 index 0000000..61748d1 --- /dev/null +++ b/src/lib/versions/fetchVersion/Powernukkit.ts @@ -0,0 +1,161 @@ +import { powernukkit, powernukkitSchema } from "../db/powernukkit"; +import { getJSON as getJson } from "@http/simples"; +export const exportUrl = "https://raw.githubusercontent.com/PowerNukkit/powernukkit-version-aggregator/master/powernukkit-versions.json"; +export type Release = { + version: string, + releaseTime: number, + minecraftVersion: string, + artefacts: string[], + commitId: string, + snapshotBuild?: number +} +export type PowernukkitVersions = { + releases: Release[], + snapshots: Release[] +} + +function buildVersion(data: Release): powernukkitSchema|void { + let artefacts: {[key: string]: any} = {}; + data.artefacts.forEach(function(artefactId) { + artefacts[artefactId] = buildArtefactUrl(data, artefactId); + }); + if (data.commitId) { + artefacts["GIT_SOURCE"] = buildArtefactUrl(data, "GIT_SOURCE"); + } + if (!data.snapshotBuild) { + artefacts["ONLINE_DOC"] = buildArtefactUrl(data, "ONLINE_DOC"); + } + + const releaseTime = new Date(data.releaseTime); + let url = getBestDownloadUrl(artefacts); + if (!url) return; + const schema: powernukkitSchema = { + version: data.version, + mcpeVersion: data.minecraftVersion, + date: releaseTime, + latest: false, + variantType: data.snapshotBuild === undefined ? "stable":"snapshot", + url + }; + + return schema; +} + +function getBestDownloadUrl(artefacts): string { + if (artefacts.SHADED_JAR) { + return artefacts.SHADED_JAR; + } else { + return artefacts.REDUCED_JAR; + } +} + +function buildArtefactUrl(data: any, artefactId?: string): string|void { + if (artefactId == "GIT_SOURCE") { + return buildGitSourceUrl(data); + } else if (artefactId == "ONLINE_DOC") { + return buildOnlineDocUrl(data); + } else if (data.snapshotBuild) { + return buildSnapshotArtefactUrl(data, artefactId); + } else { + return buildReleaseArtefactUrl(data, artefactId); + } +} + +function buildOnlineDocUrl(data: any) { + if (data.snapshotBuild) { + if (data.artefacts.includes("JAVADOC_JAR")) { + return buildSnapshotArtefactUrl(data, "JAVADOC_JAR"); + } + } + return "https://devs.powernukkit.org/#javadoc"; +} + +function buildGitSourceUrl(data) { + if (data.commitId) { + return "https://github.com/PowerNukkit/PowerNukkit/tree/" + data.commitId; + } else if (data.snapshotBuild) { + if (data.artefacts.includes("SHADED_SOURCES_JAR")) { + return buildSnapshotArtefactUrl(data, "SHADED_SOURCES_JAR"); + } else if (data.artefacts.includes("REDUCED_SOURCES_JAR")) { + return buildSnapshotArtefactUrl(data, "REDUCED_SOURCES_JAR"); + } + } else { + if (data.artefacts.includes("SHADED_SOURCES_JAR")) { + return buildReleaseArtefactUrl(data, "SHADED_SOURCES_JAR"); + } else if (data.artefacts.includes("REDUCED_SOURCES_JAR")) { + return buildReleaseArtefactUrl(data, "REDUCED_SOURCES_JAR"); + } + } +} + +function buildReleaseArtefactUrl(data: any, artefactId?: string): string|void { + if (!data.artefacts.includes(artefactId)) { + return; + } + return "https://search.maven.org/remotecontent?filepath=org/powernukkit/powernukkit/" + + data.version + + "/powernukkit-" + + data.version + + getArtefactExtension(artefactId); +} + +function buildSnapshotArtefactUrl(data: any, artefactId?: string): string|void { + if (!data.artefacts.includes(artefactId)) { + return; + } + let dt = new Date(data.releaseTime); + let snapshotCode = dt.getUTCFullYear().toString().padStart(4, "0") + + (dt.getUTCMonth() + 1).toString().padStart(2, "0") + + dt.getUTCDate().toString().padStart(2, "0") + + "." + + dt.getUTCHours().toString().padStart(2, "0") + + dt.getUTCMinutes().toString().padStart(2, "0") + + dt.getUTCSeconds().toString().padStart(2, "0") + + "-" + + data.snapshotBuild; + let snapshotIndex = data.version.indexOf("-SNAPSHOT"); + let version = data.version.substring(0, snapshotIndex); + let extension = getArtefactExtension(artefactId); + return "https://oss.sonatype.org/content/repositories/snapshots/org/powernukkit/powernukkit" + + "/" + + version + "-SNAPSHOT" + + "/" + + "powernukkit-" + version + + "-" + + snapshotCode + + extension +} + +function getArtefactExtension(artefactId) { + let extension = ".unknown"; + switch (artefactId) { + case "REDUCED_JAR": extension = ".jar"; break; + case "REDUCED_SOURCES_JAR": extension = "-sources.jar"; break; + case "SHADED_JAR": extension = "-shaded.jar"; break; + case "SHADED_SOURCES_JAR": extension = "-shaded-sources.jar"; break; + case "JAVADOC_JAR": extension = "-javadoc.jar"; break; + } + return extension; +} + +export default async function find() { + const releases_version = await getJson(exportUrl) as PowernukkitVersions; + for (const stable of releases_version.releases) { + const data = buildVersion(stable); + if (!data) continue + if (await powernukkit.findOne({version: data.version}).lean()) continue; + await powernukkit.create(data); + console.log("Powernukkit stable add %s version to minecraft bedrock %s version", data.version, data.mcpeVersion); + } + for (const snapshot of releases_version.snapshots) { + const data = buildVersion(snapshot); + if (!data) continue + if (await powernukkit.findOne({version: data.version}).lean()) continue; + await powernukkit.create(data); + console.log("Powernukkit snapshort add %s version to minecraft bedrock %s version", data.version, data.mcpeVersion); + } + const oldLatest = await powernukkit.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); + const latestVersion = (await powernukkit.find({variantType: "stable"}).lean()).sort((b, a) => a.date.getTime()-b.date.getTime())[0]; + await powernukkit.findOneAndUpdate({version: latestVersion.version, variant: {variantType: "stable"}}, {$set: {latest: true}}).lean().catch(err => powernukkit.findOneAndUpdate({version: oldLatest.version}, {$set: {latest: true}}).lean().then(() => Promise.reject(err))); + return; +} diff --git a/src/lib/versions/fetchVersion/Spigot.ts b/src/lib/versions/fetchVersion/Spigot.ts new file mode 100644 index 0000000..ef476c2 --- /dev/null +++ b/src/lib/versions/fetchVersion/Spigot.ts @@ -0,0 +1,35 @@ +import jsdom from "jsdom"; +import { bufferFetch } from "@http/simples"; +import {spigot} from "../db/spigot"; +export const urlRegex = /http[s]:\/\/.*/; +async function Find() { + const { document } = (new jsdom.JSDOM(await bufferFetch("https://getbukkit.org/download/spigot").then(({data}) => data.toString("utf8")).catch(err => {console.log(err); return ""}))).window; + const Versions = await Promise.all(([...document.querySelectorAll("#download > div > div > div > div")]).map(async DOM => { + const download = (new jsdom.JSDOM(await bufferFetch(DOM.querySelector("div > div.col-sm-4 > div.btn-group > a")["href"]).then(({data}) => data.toString("utf8")))); + const serverInfo = { + version: String(DOM.querySelector("div:nth-child(1) > h2").textContent), + Date: new Date(DOM.querySelector("div:nth-child(3) > h3").textContent), + url: download.window.document.querySelector("#get-download > div > div > div:nth-child(2) > div > h2 > a")["href"] + } + if (!urlRegex.test(serverInfo.url)||!serverInfo.url) return null; + return serverInfo; + })); + + for (const Version of Versions.filter(a => a)) { + if (await spigot.findOne({version: Version.version}).lean()) continue; + console.log("Spigot", Version.version, Version.url); + await spigot.create({ + version: Version.version, + date: Version.Date, + latest: false, + url: Version.url + }); + } + await spigot.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); + const latestVersion = (await spigot.find().lean()).sort((b, a) => a.date.getTime()-b.date.getTime())[0]; + await spigot.findByIdAndUpdate(latestVersion._id, {$set: {latest: true}}); +} + +export default async function UpdateDatabase() { + await Find(); +} diff --git a/src/lib/versions/fetchVersion/index.ts b/src/lib/versions/fetchVersion/index.ts new file mode 100644 index 0000000..3edcfa3 --- /dev/null +++ b/src/lib/versions/fetchVersion/index.ts @@ -0,0 +1,53 @@ +#!/usr/bin/env node +import yargs from "yargs"; +import bedrock from "./Bedrock"; +import pocketmine from "./Pocketmine"; +import java from "./Java"; +import spigot from "./Spigot"; +import paper from "./Paper"; +import powernukkit from "./Powernukkit" + +const options = yargs(process.argv.slice(2)).help().version(false).alias("h", "help").wrap(yargs.terminalWidth()).options("all", { + description: "Fetch all plaftorms", + type: "boolean" +}).option("bedrock", { + description: "Fetch Bedrock versions", + type: "boolean" +}).option("java", { + description: "Fetch Java versions", + type: "boolean" +}).option("pocketmine", { + description: "Fetch Pocketmine-MP versions", + type: "boolean" +}).option("spigot", { + description: "Fetch Spigot versions", + type: "boolean" +}).option("paper", { + description: "Fetch Paper versions", + type: "boolean" +}).option("powernukkit", { + description: "Fetch Powernukkit versions", + type: "boolean" +}) +.parseSync(); + +async function all() { + await bedrock() + await java(); + await pocketmine(); + await spigot(); + await paper(); + await powernukkit(); +} + +if (options.bedrock) bedrock().then(() => {console.log("Bedrock sucess update"); process.exit(0)}).catch(err => {console.log("Bedrock catch Error: %s", String(err)); process.exit(1)}); +else if (options.java) java().then(() => {console.log("Java sucess update"); process.exit(0)}).catch(err => {console.log("Java catch Error: %s", String(err)); process.exit(1)}); +else if (options.spigot) spigot().then(() => {console.log("Spigot sucess update"); process.exit(0)}).catch(err => {console.log("Spigot catch Error: %s", String(err)); process.exit(1)}); +else if (options.pocketmine) pocketmine().then(() => {console.log("Pocketmine sucess update"); process.exit(0)}).catch(err => {console.log("Pocketmine catch Error: %s", String(err)); process.exit(1)}); +else if (options.paper) paper().then(() => {console.log("Paper sucess update"); process.exit(0)}).catch(err => {console.log("Paper catch Error: %s", String(err)); process.exit(1)}); +else if (options.powernukkit) powernukkit().then(() => {console.log("Powernukkit sucess update"); process.exit(0)}).catch(err => {console.log("Powernukkit catch Error: %s", String(err)); process.exit(1)}); +else if (options.all) all().then(() => process.exit(0)).catch(err => {console.trace(err); process.exit(1)}); +else { + console.log("No options set"); + process.exit(1); +} \ No newline at end of file diff --git a/src/lib/versions/fetchVersion/types/Java.ts b/src/lib/versions/fetchVersion/types/Java.ts new file mode 100644 index 0000000..5944691 --- /dev/null +++ b/src/lib/versions/fetchVersion/types/Java.ts @@ -0,0 +1,165 @@ +export type javaRelease = { + arguments: { + game: Array + jvm: [ + { + rules: Array<{ + action: string + os: { + name: string + } + }> + value: Array + }, + { + rules: Array<{ + action: string + os: { + name: string + } + }> + value: string + }, + { + rules: Array<{ + action: string + os: { + name: string + version: string + } + }> + value: Array + }, + { + rules: Array<{ + action: string + os: { + arch: string + } + }> + value: string + }, + string, + string, + string, + string, + string + ] + } + assetIndex: { + id: string + sha1: string + size: number + totalSize: number + url: string + } + assets: string + complianceLevel: number + downloads: { + client: { + sha1: string + size: number + url: string + } + client_mappings: { + sha1: string + size: number + url: string + } + server: { + sha1: string + size: number + url: string + } + server_mappings: { + sha1: string + size: number + url: string + } + } + id: string + javaVersion: { + component: string + majorVersion: number + } + libraries: Array<{ + downloads: { + artifact: { + path: string + sha1: string + size: number + url: string + } + classifiers?: { + javadoc?: { + path: string + sha1: string + size: number + url: string + } + "natives-osx"?: { + path: string + sha1: string + size: number + url: string + } + sources?: { + path: string + sha1: string + size: number + url: string + } + "natives-linux"?: { + path: string + sha1: string + size: number + url: string + } + "natives-windows"?: { + path: string + sha1: string + size: number + url: string + } + "natives-macos"?: { + path: string + sha1: string + size: number + url: string + } + } + } + name: string + rules?: Array<{ + action: string + os?: { + name: string + } + }> + natives?: { + osx?: string + linux?: string + windows?: string + } + extract?: { + exclude: Array + } + }> + logging: { + client: { + argument: string + file: { + id: string + sha1: string + size: number + url: string + } + type: string + } + } + mainClass: string + minimumLauncherVersion: number + releaseTime: string + time: string + type: string +} \ No newline at end of file diff --git a/src/lib/versions/index.ts b/src/lib/versions/index.ts new file mode 100644 index 0000000..5ef0177 --- /dev/null +++ b/src/lib/versions/index.ts @@ -0,0 +1,76 @@ +import { bufferFetch } from "@http/simples" +import type { bedrockSchema } from "./db/bedrock"; +import type { javaSchema } from "./db/java"; +import type { paperSchema } from "./db/paper"; +import type { powernukkitSchema } from "./db/powernukkit"; +import type { pocketminemmpSchema } from "./db/pocketmine"; +import type { spigotSchema } from "./db/spigot"; + +export type BdsCorePlatforms = "bedrock"|"java"|"paper"|"powernukkit"|"pocketmine"|"spigot"; +export type all = bedrockSchema|javaSchema|powernukkitSchema|paperSchema|pocketminemmpSchema|spigotSchema +export type { + bedrockSchema as bedrock, + javaSchema as java, + paperSchema as paper, + pocketminemmpSchema as pocketmine, + spigotSchema as spigot, + powernukkitSchema as powernukkit +} + +export async function findVersion(bdsPlaform: BdsCorePlatforms): Promise; +export async function findVersion(bdsPlaform: BdsCorePlatforms, version: string|boolean): Promise; +export async function findVersion(bdsPlaform: BdsCorePlatforms, version: string|boolean, ignoreStatic: boolean): Promise; +export async function findVersion(bdsPlaform: BdsCorePlatforms, version?: string|boolean, ignoreStatic?: boolean): Promise { + const versionURLs = ["https://mcpeversions_backup.sirherobrine23.org", "https://mcpeversions.sirherobrine23.org"]; + if (!ignoreStatic) versionURLs.push("https://mcpeversion-static.sirherobrine23.org/"); else console.warn("Using dynamic APIs, some may be down!"); + for (let url of versionURLs.reverse()) { + url += "/"+bdsPlaform; + if (/static/.test(url)) { + if (version === undefined) url += "/all.json"; + else if (typeof version === "boolean") url += "/latest.json"; + else url += `/${version}.json`; + } else { + if (version === undefined||version === "all") url += "/"; + else { + if (typeof version === "boolean"||version === "latest") url += "/latest"; + else url += `/search?version=${version}`; + } + } + const res = await bufferFetch(url).then(({data}) => data).catch(() => false); + if (res === false) continue; + const data = JSON.parse(res.toString("utf8"), (key, value) => key === "date" ? new Date(value):value); + if (!data) throw new Error("Failed to get data"); + return data; + } + throw new Error("Failed to exec API request!"); +} + +export const platformManeger = { + bedrock: { + async all(){return findVersion("bedrock");}, + async find(version: string|boolean){return findVersion("bedrock", version);} + }, + pocketmine: { + async all(){return findVersion("pocketmine");}, + async find(version: string|boolean){return findVersion("pocketmine", version);} + }, + powernukkit: { + async all(){return findVersion("powernukkit");}, + async find(version: string|boolean){return findVersion("powernukkit", version);} + }, + java: { + async all(){return findVersion("java");}, + async find(version: string|boolean){return findVersion("java", version);} + }, + spigot: { + async all(){return findVersion("spigot");}, + async find(version: string|boolean){return findVersion("spigot", version);} + }, + paper: { + async all(){return findVersion("paper");}, + async find(version: string|boolean, build?: number|string){ + if (!build) build = (await findVersion("paper")).find(ver => ver.version === version)?.build; + return findVersion("paper", `${version}${!!build?"_"+build:""}`); + } + } +}; diff --git a/tsconfig.json b/tsconfig.json index da35096..5e857ce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,29 +1,29 @@ { - "compilerOptions": { - "esModuleInterop": true, - "module": "commonjs", - "moduleResolution": "node", - "target": "ES2019", - // "outDir": "./dist", - "declaration": true, - "strict": false, - "noUnusedLocals": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "skipLibCheck": true, - "allowJs": true, - "paths": { - "@/*": [ - "./node_modules/@*" - ] - } - }, - "include": [ - "src/**/*" -, "load.js" ], - "exclude": [ - "node_modules/", - "test/", - "load.js" - ] + "compilerOptions": { + "esModuleInterop": true, + "module": "commonjs", + "moduleResolution": "node", + "target": "ES2019", + "declaration": true, + "strict": false, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "allowJs": true, + "lib": ["ES6"], + "baseUrl": ".", + "paths": { + "@http/*": [ + "./src/lib/request/*" + ] + } + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules/", + "tests/" + ] } -- 2.45.2 From 4d88e8b443a7da1e64db30b82b6691a3f8f22808 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Wed, 2 Nov 2022 21:51:42 -0300 Subject: [PATCH 2/5] Remove express routes --- src/lib/versions/db/bedrock.ts | 11 ----------- src/lib/versions/db/java.ts | 11 ----------- src/lib/versions/db/paper.ts | 23 ----------------------- src/lib/versions/db/powernukkit.ts | 13 ------------- src/lib/versions/db/spigot.ts | 12 ------------ 5 files changed, 70 deletions(-) diff --git a/src/lib/versions/db/bedrock.ts b/src/lib/versions/db/bedrock.ts index 7875bbc..5a9df62 100644 --- a/src/lib/versions/db/bedrock.ts +++ b/src/lib/versions/db/bedrock.ts @@ -1,7 +1,5 @@ import mongoose from "mongoose"; import connection from "./connect"; -import { Router } from "express"; -export const app = Router(); export type bedrockSchema = { version: string, @@ -27,12 +25,3 @@ export const bedrock = connection.model("bedrock", new mongoose.S } })); -app.get("/", ({res}) => bedrock.find().lean().then(data => res.json(data))); -app.get("/latest", async ({res}) => res.json(await bedrock.findOne({latest: true}).lean())); -app.get("/search", async (req, res) => { - let version = req.query.version as string; - if (!version) return res.status(400).json({error: "No version specified"}); - const versionFinded = await bedrock.findOne({version}).lean(); - if (!versionFinded) return res.status(404).json({error: "Version not found"}); - return res.json(versionFinded); -}); diff --git a/src/lib/versions/db/java.ts b/src/lib/versions/db/java.ts index cf8a4f7..f62e49b 100644 --- a/src/lib/versions/db/java.ts +++ b/src/lib/versions/db/java.ts @@ -1,7 +1,5 @@ import mongoose from "mongoose"; import connection from "./connect"; -import { Router } from "express"; -export const app = Router(); export type javaSchema = { version: string, @@ -22,12 +20,3 @@ export const java = connection.model("java", new mongoose.Schema java.find().lean().then(data => res.json(data))); -app.get("/latest", async ({res}) => res.json(await java.findOne({latest: true}).lean())); -app.get("/search", async (req, res) => { - let version = req.query.version as string; - if (!version) return res.status(400).json({error: "No version specified"}); - const versionFinded = await java.findOne({version: version}).lean(); - if (!versionFinded) return res.status(404).json({error: "Version not found"}); - return res.json(versionFinded); -}); diff --git a/src/lib/versions/db/paper.ts b/src/lib/versions/db/paper.ts index a9ac3fd..d0bb4d1 100644 --- a/src/lib/versions/db/paper.ts +++ b/src/lib/versions/db/paper.ts @@ -1,7 +1,5 @@ import mongoose from "mongoose"; import connection from "./connect"; -import { Router } from "express"; -export const app = Router(); export type paperSchema = { version: string, @@ -19,24 +17,3 @@ export const paper = connection.model("paper", new mongoose.Schema< url: String })); -app.get("/", ({res}) => paper.find().lean().then(data => res.json(data))); -app.get("/latest", ({res}) => paper.findOne({latest: true}).lean().then(data => res.json(data))); -app.get("/search", async (req, res) => { - let version = req.query.version as string; - if (!version) return res.status(400).json({erro: "Not allowd blank version"}); - let build = parseInt(req.query.build as string); - if (isNaN(build)) build = undefined; - if (!!build) { - const info = await paper.findOne({ - version, - build - }); - if (!info) return res.status(400).json({error: "version and build not exists"}); - return res.json(info); - } - const info = await paper.findOne({ - version - }); - if (!info) return res.status(400).json({error: "version not exists"}); - return res.json(info); -}); \ No newline at end of file diff --git a/src/lib/versions/db/powernukkit.ts b/src/lib/versions/db/powernukkit.ts index ee44e02..7cd4f58 100644 --- a/src/lib/versions/db/powernukkit.ts +++ b/src/lib/versions/db/powernukkit.ts @@ -1,7 +1,5 @@ import mongoose from "mongoose"; import connection from "./connect"; -import { Router } from "express"; -export const app = Router(); export type powernukkitSchema = { version: string, @@ -24,14 +22,3 @@ export const powernukkit = connection.model("powernukkit", ne variantType: String, latest: Boolean })); - -app.get("/", ({res}) => powernukkit.find().lean().then(data => res.json(data))); -app.get("/latest", ({res}) => powernukkit.findOne({latest: true}).lean().then(data => res.json(data))); -app.get("/search", async (req, res) => { - let version = req.query.version as string; - let variant = (req.query.variant as string)||undefined; - if (!version) return res.status(400).json({error: "No version specified"}); - const versionDB = await powernukkit.findOne({version, variant: {to: variant}}).lean(); - if (!versionDB) return res.status(404).json({error: "Version not found"}); - return res.json(versionDB); -}); \ No newline at end of file diff --git a/src/lib/versions/db/spigot.ts b/src/lib/versions/db/spigot.ts index 48b8f49..d236009 100644 --- a/src/lib/versions/db/spigot.ts +++ b/src/lib/versions/db/spigot.ts @@ -1,7 +1,5 @@ import mongoose from "mongoose"; import connection from "./connect"; -import { Router } from "express"; -export const app = Router(); // Type to represent the spigot model export type spigotSchema = { @@ -21,13 +19,3 @@ export const spigot = connection.model("spigot", new mongoose.Sche latest: Boolean, url: String })); - -app.get("/", ({res}) => spigot.find().lean().then(data => res.json(data))); -app.get("/latest", async ({res}) => res.json(await spigot.findOne({latest: true}).lean())); -app.get("/search", async (req, res) => { - let version = req.query.version as string; - if (!version) return res.status(400).json({error: "No version specified"}); - const versionFinded = await spigot.findOne({version}).lean(); - if (!versionFinded) return res.status(404).json({error: "Version not found"}); - return res.json(versionFinded); -}); -- 2.45.2 From 80acb4ee6d652c9ba7045ddc2927e89ff8442036 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Wed, 2 Nov 2022 22:55:38 -0300 Subject: [PATCH 3/5] removed httpRequest.ts and fix required files --- package-lock.json | 74 ++++++++ package.json | 3 +- src/bedrock.ts | 6 +- src/export_import.ts | 4 +- src/index.ts | 18 +- src/java.ts | 4 +- src/lib/httpRequest.ts | 236 ------------------------ src/lib/versions/fetchVersion/Spigot.ts | 2 +- src/paper.ts | 4 +- src/plugin/hook.ts | 4 +- src/plugin/plugin.ts | 11 +- src/pocketmine.ts | 20 +- src/pwnuukit.ts | 2 +- src/spigot.ts | 6 +- tests/internal/httpRequest.ts | 9 +- tsconfig.json | 6 +- 16 files changed, 131 insertions(+), 278 deletions(-) delete mode 100644 src/lib/httpRequest.ts diff --git a/package-lock.json b/package-lock.json index 789c535..3772603 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@types/tar": "^6.1.3", "mocha": "^10.1.0", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.1.0", "typedoc": "^0.23.19", "typescript": "^4.8.4" }, @@ -2682,6 +2683,18 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", @@ -2877,6 +2890,15 @@ "node": ">=10" } }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.5.tgz", @@ -3692,6 +3714,15 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3843,6 +3874,20 @@ "node": ">=0.3.1" } }, + "node_modules/tsconfig-paths": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz", + "integrity": "sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow==", + "dev": true, + "dependencies": { + "json5": "^2.2.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tslib": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", @@ -6280,6 +6325,12 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true + }, "jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", @@ -6418,6 +6469,12 @@ "brace-expansion": "^2.0.1" } }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true + }, "minipass": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.5.tgz", @@ -7023,6 +7080,12 @@ "ansi-regex": "^5.0.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -7124,6 +7187,17 @@ } } }, + "tsconfig-paths": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz", + "integrity": "sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow==", + "dev": true, + "requires": { + "json5": "^2.2.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", diff --git a/package.json b/package.json index d61069d..9b789b9 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "docs": "typedoc --readme none --out docs src/index.ts", "dev": "nodemon", "build": "tsc", - "test:partial": "mocha -r ts-node/register --exit", + "test:partial": "mocha -r ts-node/register -r tsconfig-paths/register --exit", "test": "npm run test:partial -- 'tests/**/*.ts'" }, "repository": { @@ -50,6 +50,7 @@ "@types/tar": "^6.1.3", "mocha": "^10.1.0", "ts-node": "^10.9.1", + "tsconfig-paths": "^4.1.0", "typedoc": "^0.23.19", "typescript": "^4.8.4" } diff --git a/src/bedrock.ts b/src/bedrock.ts index 380c5eb..2381f62 100644 --- a/src/bedrock.ts +++ b/src/bedrock.ts @@ -5,7 +5,7 @@ import * as globalPlatfroms from "./globalPlatfroms"; import { platformManeger } from "@the-bds-maneger/server_versions"; import { pathControl, bdsPlatformOptions } from "./platformPathManeger"; import { commendExists } from "./lib/childPromisses"; -import * as httpRequest from "./lib/httpRequest"; +import * as httpLarge from "@http/large"; import extendsFs, { exists, readdirrecursive } from "./lib/extendsFs"; import { randomPort } from "./lib/randomPort"; import { manegerConfigProprieties } from "./configManipulate"; @@ -28,7 +28,7 @@ export async function installServer(version: string|boolean, platformOptions: bd await fs.readdir(serverPath).then(files => Promise.all(files.filter(file => !saveFileFolder.test(file)).map(file => fs.rm(path.join(serverPath, file), {recursive: true, force: true})))); const serverConfigProperties = (await fs.readFile(path.join(serverPath, "server.properties"), "utf8").catch(() => "")).trim(); - await httpRequest.extractZip({url, folderTarget: serverPath}); + await httpLarge.extractZip({url, folderTarget: serverPath}); if (serverConfigProperties) await fs.writeFile(path.join(serverPath, "server.properties"), serverConfigProperties); await fs.writeFile(path.join(serverRoot, "version_installed.json"), JSON.stringify({version: bedrockData.version, date: bedrockData.date, installDate: new Date()})); @@ -286,4 +286,4 @@ export async function addResourcePacksToWorld(resourceId: string, platformOption resourcesData.push({pack_id: packInfo.header.uuid, version: packInfo.header.version}); await fs.writeFile(path.join(serverPath, "worlds", serverConfigObject["level-name"], "world_resource_packs.json"), JSON.stringify(resourcesData, null, 2)); return resourcesData; -} \ No newline at end of file +} diff --git a/src/export_import.ts b/src/export_import.ts index a358de0..da72b25 100644 --- a/src/export_import.ts +++ b/src/export_import.ts @@ -4,7 +4,7 @@ import fs from "node:fs/promises"; import tar from "tar"; import { bdsRoot } from "./platformPathManeger"; import { exists } from "./lib/extendsFs"; -import { getExternalIP } from "./lib/httpRequest"; +import { getExternalIP } from "@http/client"; export type payload = { httpVersion?: string, @@ -153,4 +153,4 @@ export async function importBds(option: {host: string, port: number, authToken: tar_extract.on("error", reject); socket.once("close", () => tar_extract.on("finish", done)); }); -} \ No newline at end of file +} diff --git a/src/index.ts b/src/index.ts index 88b10de..8549a9a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,10 @@ +// HTTP +import * as httpSimples from "@http/simples"; +import * as httpLarge from "@http/large"; +import * as httpGithub from "@http/github"; +import * as httpClient from "@http/client"; + // Utils -import * as httpRequest from "./lib/httpRequest"; import * as platformPathManeger from "./platformPathManeger" import * as globalPlatfroms from "./globalPlatfroms"; import * as pluginManeger from "./plugin/plugin"; @@ -15,7 +20,7 @@ import * as Spigot from "./spigot"; import * as Powernukkit from "./pwnuukit"; import * as PaperMC from "./paper"; -export {platformPathManeger, globalPlatfroms, pluginManeger, export_import, PocketmineMP, pluginHooks, Powernukkit, httpRequest, PaperMC, Bedrock, Spigot, proxy, Java}; +export {platformPathManeger, globalPlatfroms, pluginManeger, export_import, PocketmineMP, pluginHooks, Powernukkit, PaperMC, Bedrock, Spigot, proxy, Java}; export default { Bedrock, Java, @@ -28,8 +33,13 @@ export default { globalPlatfroms, pluginManeger, pluginHooks, - httpRequest, export_import, - proxy + proxy, + httpRequest: { + httpSimples, + httpLarge, + httpGithub, + httpClient + } } }; diff --git a/src/java.ts b/src/java.ts index a4a2894..ce842ed 100644 --- a/src/java.ts +++ b/src/java.ts @@ -4,7 +4,7 @@ import fsOld from "node:fs"; import os from "node:os"; import { platformManeger } from "@the-bds-maneger/server_versions"; import { actionV2, actionsV2 } from "./globalPlatfroms"; -import { saveFile } from "./lib/httpRequest"; +import { saveFile } from "@http/large"; import { pathControl, bdsPlatformOptions } from "./platformPathManeger"; import { manegerConfigProprieties } from "./configManipulate"; import { randomPort } from "./lib/randomPort"; @@ -181,4 +181,4 @@ export async function serverConfig(platformOptions: bdsPlatformOptions = {id: "d } } }) -} \ No newline at end of file +} diff --git a/src/lib/httpRequest.ts b/src/lib/httpRequest.ts deleted file mode 100644 index 00fd019..0000000 --- a/src/lib/httpRequest.ts +++ /dev/null @@ -1,236 +0,0 @@ -import type { Method } from "got"; -import os from "node:os"; -import fs from "node:fs"; -import path from "node:path"; -import crypto from "node:crypto"; -import tar from "tar"; -import AdmZip from "adm-zip"; -import stream from "node:stream"; -import { exists } from "./extendsFs"; - -let got: (typeof import("got"))["default"]; -const gotCjs = async () => got||(await (eval('import("got")') as Promise)).default.extend({enableUnixSockets: true}); -gotCjs().then(res => got = res); - -export type requestOptions = { - url?: string, - socket?: { - socketPath: string, - path?: string, - } - method?: Method, - headers?: {[headerName: string]: string[]|string}, - body?: any, -}; - -export async function pipeFetch(options: requestOptions & {stream: fs.WriteStream|stream.Writable, waitFinish?: boolean}) { - if (!(options?.url||options?.socket)) throw new Error("Host blank") - const urlRequest = (typeof options.url === "string")?options.url:`http://unix:${options.socket.socketPath}:${options.socket.path||"/"}`; - const gotStream = (await gotCjs()).stream(urlRequest, { - isStream: true, - headers: options.headers||{}, - method: options.method||"GET", - json: options.body, - }); - await new Promise((done, reject) => { - gotStream.pipe(options.stream); - options.stream.on("error", reject); - gotStream.on("error", reject); - gotStream.once("end", () => { - if (options.waitFinish) return options.stream.once("finish", done); - return done(); - }); - }); -} - -export async function bufferFetch(options: string|requestOptions) { - if (typeof options === "string") options = {url: options}; - if (!(options.url||options.socket)) throw new Error("Host blank") - const urlRequest = (typeof options.url === "string")?options.url:`http://unix:${options.socket.socketPath}:${options.socket.path||"/"}`; - return (await gotCjs())(urlRequest, { - headers: options.headers||{}, - method: options.method||"GET", - json: options.body, - responseType: "buffer", - }).then(res => ({headers: res.headers, data: Buffer.from(res.body), response: res})); -} - -export async function getJSON(request: string|requestOptions): Promise { - if (typeof request === "string") request = {url: request}; - const res = (await bufferFetch(request)).data.toString("utf8"); - return JSON.parse(res) as JSONReturn; -} - -export async function saveFile(request: string|requestOptions & {filePath?: string}) { - if (typeof request === "string") request = {url: request}; - const filePath = request.filePath||path.join(os.tmpdir(), `raw_bdscore_${Date.now()}_${(path.parse(request.url||request.socket?.path||crypto.randomBytes(16).toString("hex"))).name}`); - await pipeFetch({...request, waitFinish: true, stream: fs.createWriteStream(filePath, {autoClose: false})}); - return filePath; -} - -export async function tarExtract(request: requestOptions & {folderPath?: string}) { - const folderToExtract = request.folderPath||path.join(os.tmpdir(), `raw_bdscore_${Date.now()}_${(path.parse(request.url||request.socket?.path||crypto.randomBytes(16).toString("hex"))).name}`); - if (!await exists(folderToExtract)) await fs.promises.mkdir(folderToExtract, {recursive: true}); - await pipeFetch({ - ...request, - waitFinish: true, - stream: tar.extract({ - cwd: folderToExtract, - noChmod: false, - noMtime: false, - preserveOwner: true, - keep: true, - p: true - }) - }); - return folderToExtract -} - -const githubAchive = /github.com\/[\S\w]+\/[\S\w]+\/archive\//; -export async function extractZip(request: requestOptions & {folderTarget: string}) { - const zip = new AdmZip(await saveFile(request)); - const targetFolder = githubAchive.test(request.url)?await fs.promises.mkdtemp(path.join(os.tmpdir(), "githubRoot_"), "utf8"):request.folderTarget; - await new Promise((done, reject) => { - zip.extractAllToAsync(targetFolder, true, true, (err) => { - if (!err) return done(); - return reject(err); - }) - }); - - if (githubAchive.test(request.url)) { - const files = await fs.promises.readdir(targetFolder); - if (files.length === 0) throw new Error("Invalid extract"); - await fs.promises.cp(path.join(targetFolder, files[0]), request.folderTarget, {recursive: true, force: true, preserveTimestamps: true, verbatimSymlinks: true}); - return await fs.promises.rm(targetFolder, {recursive: true, force: true}); - } - return; -} - -export type testIp = { - ip: string, - type: protocolType, - subtype: string, - via: string, - padding: string, - asn: string, - asnlist: string, - asn_name: string, - country: string, - protocol: "HTTP/2.0"|"HTTP/1.1"|"HTTP/1.0" -}; - -export async function getExternalIP(): Promise<{ipv4: string, ipv6?: string, rawRequest?: {ipv4: testIp<"ipv4">, ipv6?: testIp<"ipv6">}}> { - const ipv6: testIp<"ipv6"> = await getJSON("https://ipv6.lookup.test-ipv6.com/ip/").catch(() => undefined); - const ipv4: testIp<"ipv4"> = await getJSON("https://ipv4.lookup.test-ipv6.com/ip/"); - return { - ipv4: ipv4.ip, - ipv6: ipv6?.ip, - rawRequest: {ipv4, ipv6} - }; -} - -export type githubRelease = { - url: string; - assets_url: string; - upload_url: string; - html_url: string; - id: number; - tarball_url: string; - zipball_url: string; - body: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - assets: Array<{ - url: string; - id: number; - node_id: string; - name: string; - label: string; - content_type: string; - state: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - browser_download_url: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - }>; -}; - -export async function GithubRelease(username: string, repo: string, releaseTag: string): Promise; -export async function GithubRelease(username: string, repo: string): Promise; -export async function GithubRelease(username: string): Promise; -export async function GithubRelease(username: string, repo?: string, releaseTag?: string): Promise { - let fullRepo = username; - if (!username) throw new Error("Repository is required, example: GithubRelease(\"Username/repo\") or GithubRelease(\"Username\", \"repo\")"); - if (repo) { - if (!/\//.test(fullRepo)) fullRepo += "/"+repo; - } - if (releaseTag) return getJSON(`https://api.github.com/repos/${fullRepo}/releases/tags/${releaseTag}`); - return getJSON(`https://api.github.com/repos/${fullRepo}/releases?per_page=100`); -} - -export type githubTree = { - "sha": string, - "url": string, - "truncated": boolean, - "tree": { - "path": string, - "mode": string, - "type": "blob"|"tree", - "sha": string, - "size": number, - "url": string - }[], -}; -export async function githubTree(username: string, repo: string, tree: string = "main") { - const validate = /^[a-zA-Z0-9_\-]+$/; - if (!validate.test(username)) throw new Error("Invalid username"); - if (!validate.test(repo)) throw new Error("Invalid repository name"); - return getJSON(`https://api.github.com/repos/${username}/${repo}/git/trees/${tree}?recursive=true`); -} diff --git a/src/lib/versions/fetchVersion/Spigot.ts b/src/lib/versions/fetchVersion/Spigot.ts index ef476c2..7f43879 100644 --- a/src/lib/versions/fetchVersion/Spigot.ts +++ b/src/lib/versions/fetchVersion/Spigot.ts @@ -4,7 +4,7 @@ import {spigot} from "../db/spigot"; export const urlRegex = /http[s]:\/\/.*/; async function Find() { const { document } = (new jsdom.JSDOM(await bufferFetch("https://getbukkit.org/download/spigot").then(({data}) => data.toString("utf8")).catch(err => {console.log(err); return ""}))).window; - const Versions = await Promise.all(([...document.querySelectorAll("#download > div > div > div > div")]).map(async DOM => { + const Versions = await Promise.all(([...(document.querySelectorAll("#download > div > div > div > div") as any)]).map(async DOM => { const download = (new jsdom.JSDOM(await bufferFetch(DOM.querySelector("div > div.col-sm-4 > div.btn-group > a")["href"]).then(({data}) => data.toString("utf8")))); const serverInfo = { version: String(DOM.querySelector("div:nth-child(1) > h2").textContent), diff --git a/src/paper.ts b/src/paper.ts index 8b02dfa..f88fd2b 100644 --- a/src/paper.ts +++ b/src/paper.ts @@ -5,7 +5,7 @@ import os from "node:os"; import Proprieties from "./lib/Proprieties"; import * as globalPlatfroms from "./globalPlatfroms"; import { platformManeger } from "@the-bds-maneger/server_versions"; -import { saveFile } from "./lib/httpRequest"; +import { saveFile } from "@http/large"; import { pathControl, bdsPlatformOptions } from "./platformPathManeger"; import { spigotProprieties } from "./spigot"; @@ -115,4 +115,4 @@ export async function updateConfig(config: {key: string, value: any}, platformOp const { serverPath } = await pathControl("paper", platformOptions); currentConfig[config.key] = config.value; return fs.writeFile(path.join(serverPath, "server.properties"), Proprieties.stringify(currentConfig)); -} \ No newline at end of file +} diff --git a/src/plugin/hook.ts b/src/plugin/hook.ts index 386312c..3dc61ba 100644 --- a/src/plugin/hook.ts +++ b/src/plugin/hook.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "node:fs/promises"; import { actionsV2 } from "../globalPlatfroms"; import { execFileAsync } from "../lib/childPromisses"; -import { saveFile } from "../lib/httpRequest"; +import { saveFile } from "@http/large"; export type hooksPlatform = "bedrock"|"java"|"pocketmine"|"spigot"|"powernukkit"|"paper"; export type hooksPlatformGeneric = hooksPlatform|"generic"; @@ -80,4 +80,4 @@ export class script_hook { this.#localFolder = hookFolder; if (platformActions) this.#loadLocalScript(); } -} \ No newline at end of file +} diff --git a/src/plugin/plugin.ts b/src/plugin/plugin.ts index c6b2363..bd42b34 100644 --- a/src/plugin/plugin.ts +++ b/src/plugin/plugin.ts @@ -1,6 +1,7 @@ import path from "node:path"; -import * as http_request from "../lib/httpRequest"; import type { bdsPlatform } from "../platformPathManeger"; +import { getJSON } from "@http/simples"; +import { saveFile } from "@http/large"; export type pluginConfig = { version?: 1, @@ -40,11 +41,11 @@ export class pluginManeger { const urlandbds = /http[s]:\/\/|bdsplugin:\/\//; if (/bdsplugin:\/\//.test(plugin)) plugin = `https://raw.githubusercontent.com/The-Bds-Maneger/plugin_list/main/plugins/${plugin.replace(urlandbds, "").replace(".json", "")}.json`; else if (!/http[s]:\/\/\//.test(plugin)) plugin = "bdsplugin://"+plugin; - const info = await http_request.getJSON(plugin); + const info = await getJSON(plugin); if (info.version === 2) { const platformData = info.platform[this.#platform]; if (!platformData) throw new Error("Platform not supported to Plugin!"); - await http_request.saveFile({ + await saveFile({ url: platformData.url, filePath: path.join(this.#pluginFolder, platformData.fileName||path.basename(platformData.url)) }); @@ -52,10 +53,10 @@ export class pluginManeger { return; } if (!info.platforms.includes(this.#platform)) throw new Error("Platform not supported to Plugin!"); - await http_request.saveFile({ + await saveFile({ url: info.url, filePath: path.join(this.#pluginFolder, info.fileName||path.basename(info.url)) }); if (info.dependecies) await Promise.all(info.dependecies.map(dep => this.installPlugin(dep))); } -}; \ No newline at end of file +}; diff --git a/src/pocketmine.ts b/src/pocketmine.ts index 57a8dad..dbe4988 100644 --- a/src/pocketmine.ts +++ b/src/pocketmine.ts @@ -7,8 +7,10 @@ import { existsSync as fsExistsSync, Stats } from "node:fs"; import { promisify } from "node:util"; import { platformManeger } from "@the-bds-maneger/server_versions"; import { execFileAsync, execAsync } from "./lib/childPromisses"; -import * as httpRequest from "./lib/httpRequest"; +import { extractZip, saveFile, tarExtract } from "@http/large"; +import { bufferFetch } from "@http/simples"; import { pathControl, bdsPlatformOptions } from "./platformPathManeger"; +import {GithubRelease, githubRelease} from "@http/github"; async function findPhp(serverPath: string, extraPath?: string): Promise { if (!extraPath) extraPath = path.join(serverPath, "bin"); @@ -57,7 +59,7 @@ async function buildPhp(serverPath: string, buildFolder: string) { await promisify((new AdmZip(path.join(buildFolder, (await fs.readdir(buildFolder)).find(file => file.endsWith(".zip"))))).extractAllToAsync)(serverPath, false, true); } else { const buildFile = path.join(buildFolder, "build.sh"); - await fs.writeFile(buildFile, (await httpRequest.bufferFetch({url: "https://raw.githubusercontent.com/pmmp/php-build-scripts/stable/compile.sh"})).data); + await fs.writeFile(buildFile, (await bufferFetch({url: "https://raw.githubusercontent.com/pmmp/php-build-scripts/stable/compile.sh"})).data); await fs.chmod(buildFile, "777"); await execFileAsync(buildFile, ["-j"+os.cpus().length], {cwd: buildFolder, stdio: "inherit"}); await fs.cp(path.join(buildFolder, "bin", (await fs.readdir(path.join(buildFolder, "bin")))[0]), path.join(serverPath, "bin"), {force: true, recursive: true, preserveTimestamps: true, verbatimSymlinks: true}); @@ -67,20 +69,20 @@ async function buildPhp(serverPath: string, buildFolder: string) { } async function installPhp(serverPath: string, buildFolder: string): Promise { - const releases: (httpRequest.githubRelease["assets"][0])[] = []; - (await httpRequest.GithubRelease("The-Bds-Maneger", "Build-PHP-Bins")).map(re => re.assets).forEach(res => releases.push(...res)); + const releases: (githubRelease["assets"][0])[] = []; + (await GithubRelease("The-Bds-Maneger", "Build-PHP-Bins")).map(re => re.assets).forEach(res => releases.push(...res)); if (fsExistsSync(path.resolve(serverPath, "bin"))) await fs.rm(path.resolve(serverPath, "bin"), {recursive: true}); await fs.writeFile(path.join(os.tmpdir(), "bds_test.php"), ` assert.name.endsWith(".zip")).find(assert => /win32|windows/.test(assert.name))?.browser_download_url; if (!url) throw new Error("Cannnot get php url"); - return promisify((new AdmZip(await httpRequest.saveFile({url}))).extractAllToAsync)(serverPath, false, true); + return promisify((new AdmZip(await saveFile({url}))).extractAllToAsync)(serverPath, false, true); } else { const fileTest = RegExp(`${process.platform.toLowerCase()}.*${process.arch.toLowerCase()}`); const file = releases.find(re => fileTest.test(re.name.toLowerCase())); if (file) { - if (/\.zip/.test(file.name)) await httpRequest.extractZip({url: file.browser_download_url, folderTarget: serverPath}); - else await httpRequest.tarExtract({url: file.browser_download_url, folderPath: path.join(serverPath, "bin")}); + if (/\.zip/.test(file.name)) await extractZip({url: file.browser_download_url, folderTarget: serverPath}); + else await tarExtract({url: file.browser_download_url, folderPath: path.join(serverPath, "bin")}); // Update zts if (process.platform === "linux"||process.platform === "android"||process.platform === "darwin") { @@ -107,7 +109,7 @@ export async function installServer(version: string|boolean, platformOptions: bd const { serverPath, buildFolder, id } = await pathControl("pocketmine", platformOptions); await installPhp(serverPath, buildFolder); const info = await platformManeger.pocketmine.find(version); - await httpRequest.saveFile({url: info?.url, filePath: path.join(serverPath, "pocketmine.phar")}); + await saveFile({url: info?.url, filePath: path.join(serverPath, "pocketmine.phar")}); return { id, version: info.version, @@ -151,4 +153,4 @@ export async function startServer(platformOptions: bdsPlatformOptions = {id: "de processConfig: {command: await findPhp(serverPath), args: [serverPhar, "--no-wizard", "--enable-ansi"], options: {cwd: serverPath, maxBuffer: Infinity, logPath: {stdout: logFileOut}}}, hooks: pocketmineHooks }); -} \ No newline at end of file +} diff --git a/src/pwnuukit.ts b/src/pwnuukit.ts index bcf3771..5cdd3e3 100644 --- a/src/pwnuukit.ts +++ b/src/pwnuukit.ts @@ -4,7 +4,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import * as globalPlatfroms from "./globalPlatfroms"; import { platformManeger } from "@the-bds-maneger/server_versions"; -import { saveFile } from "./lib/httpRequest"; +import { saveFile } from "@http/large"; import { pathControl, bdsPlatformOptions } from "./platformPathManeger"; export async function installServer(version: string|boolean, platformOptions: bdsPlatformOptions = {id: "default"}) { diff --git a/src/spigot.ts b/src/spigot.ts index 87ae109..5cb9f73 100644 --- a/src/spigot.ts +++ b/src/spigot.ts @@ -3,7 +3,9 @@ import fs from "node:fs/promises"; import fsOld from "node:fs"; import os from "node:os"; import * as globalPlatfroms from "./globalPlatfroms"; -import { bufferFetch, getJSON, GithubRelease, saveFile } from "./lib/httpRequest"; +import { bufferFetch, getJSON } from "@http/simples"; +import { saveFile } from "@http/large"; +import { GithubRelease } from "@http/github"; import { pathControl, bdsPlatformOptions } from "./platformPathManeger"; import Proprieties from "./lib/Proprieties" @@ -194,4 +196,4 @@ export async function updateConfig(config: {key: string, value: any}, platformOp const { serverPath } = await pathControl("spigot", platformOptions); currentConfig[config.key] = config.value; return fs.writeFile(path.join(serverPath, "server.properties"), Proprieties.stringify(currentConfig)); -} \ No newline at end of file +} diff --git a/tests/internal/httpRequest.ts b/tests/internal/httpRequest.ts index 635ff0d..24029ba 100644 --- a/tests/internal/httpRequest.ts +++ b/tests/internal/httpRequest.ts @@ -1,13 +1,16 @@ import stream from "node:stream"; -import { getExternalIP, getJSON, saveFile, pipeFetch, githubTree, GithubRelease } from "../../src/lib/httpRequest"; +import { getJSON, pipeFetch } from "../../src/lib/request/simples"; +import { saveFile } from "../../src/lib/request/large"; +import { GithubRelease, githubTree } from "../../src/lib/request/github"; +import { getExternalIP } from "../../src/lib/request/client"; describe("HTTP Request", function(){ this.timeout(Infinity); - const Stream = new stream.Writable({write(chunk, encoding, callback) {callback()}}); + const Stream = new stream.Writable({write(_chunk, _encoding, callback) {callback()}}); it("External IP", async () => getExternalIP()); it("Github Releases", async () => GithubRelease("The-Bds-Maneger", "Bds-Maneger-Core")); it("Github Tree", async () => githubTree("The-Bds-Maneger", "Bds-Maneger-Core")); it("JSON", async () => getJSON("https://raw.githubusercontent.com/The-Bds-Maneger/Bds-Maneger-Core/main/package.json")); it("Stream", async () => pipeFetch({stream: Stream, url: "https://raw.githubusercontent.com/The-Bds-Maneger/Bds-Maneger-Core/main/package.json"})); it("Save File", async () => saveFile("https://raw.githubusercontent.com/The-Bds-Maneger/Bds-Maneger-Core/main/package.json")); -}); \ No newline at end of file +}); diff --git a/tsconfig.json b/tsconfig.json index 5e857ce..e0af647 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,15 +15,11 @@ "baseUrl": ".", "paths": { "@http/*": [ - "./src/lib/request/*" + "src/lib/request/*" ] } }, "include": [ "src/**/*" - ], - "exclude": [ - "node_modules/", - "tests/" ] } -- 2.45.2 From 545d72a34555abea9b13d70803446ce34e463ce8 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Sun, 6 Nov 2022 15:33:18 +0000 Subject: [PATCH 4/5] Remove fetch version --- package-lock.json | 304 +++++++++---------- package.json | 5 +- src/index.ts | 10 +- src/lib/versions/db/bedrock.ts | 27 -- src/lib/versions/db/connect.ts | 8 - src/lib/versions/db/java.ts | 22 -- src/lib/versions/db/paper.ts | 19 -- src/lib/versions/db/pocketmine.ts | 21 -- src/lib/versions/db/powernukkit.ts | 24 -- src/lib/versions/db/spigot.ts | 21 -- src/lib/versions/exports.ts | 76 ----- src/lib/versions/fetchVersion/Bedrock.ts | 42 --- src/lib/versions/fetchVersion/Java.ts | 35 --- src/lib/versions/fetchVersion/Paper.ts | 48 --- src/lib/versions/fetchVersion/Pocketmine.ts | 40 --- src/lib/versions/fetchVersion/Powernukkit.ts | 161 ---------- src/lib/versions/fetchVersion/Spigot.ts | 35 --- src/lib/versions/fetchVersion/index.ts | 53 ---- src/lib/versions/fetchVersion/types/Java.ts | 165 ---------- src/lib/versions/index.ts | 76 ----- src/{lib => }/request/client.ts | 0 src/{lib => }/request/github.ts | 0 src/{lib => }/request/large.ts | 0 src/{lib => }/request/simples.ts | 29 +- tsconfig.json | 2 +- 25 files changed, 167 insertions(+), 1056 deletions(-) delete mode 100644 src/lib/versions/db/bedrock.ts delete mode 100644 src/lib/versions/db/connect.ts delete mode 100644 src/lib/versions/db/java.ts delete mode 100644 src/lib/versions/db/paper.ts delete mode 100644 src/lib/versions/db/pocketmine.ts delete mode 100644 src/lib/versions/db/powernukkit.ts delete mode 100644 src/lib/versions/db/spigot.ts delete mode 100644 src/lib/versions/exports.ts delete mode 100644 src/lib/versions/fetchVersion/Bedrock.ts delete mode 100644 src/lib/versions/fetchVersion/Java.ts delete mode 100644 src/lib/versions/fetchVersion/Paper.ts delete mode 100644 src/lib/versions/fetchVersion/Pocketmine.ts delete mode 100644 src/lib/versions/fetchVersion/Powernukkit.ts delete mode 100644 src/lib/versions/fetchVersion/Spigot.ts delete mode 100644 src/lib/versions/fetchVersion/index.ts delete mode 100644 src/lib/versions/fetchVersion/types/Java.ts delete mode 100644 src/lib/versions/index.ts rename src/{lib => }/request/client.ts (100%) rename src/{lib => }/request/github.ts (100%) rename src/{lib => }/request/large.ts (100%) rename src/{lib => }/request/simples.ts (70%) diff --git a/package-lock.json b/package-lock.json index 3772603..167cfe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,22 +13,19 @@ "adm-zip": "^0.5.9", "cron": "^2.1.0", "got": "^12.5.2", - "jsdom": "^20.0.2", - "mongoose": "^6.7.1", "prismarine-nbt": "^2.2.1", "tar": "^6.1.12" }, "devDependencies": { "@types/adm-zip": "^0.5.0", "@types/cron": "^2.0.0", - "@types/jsdom": "^20.0.0", "@types/mocha": "^10.0.0", "@types/node": "^18.11.9", "@types/tar": "^6.1.3", "mocha": "^10.1.0", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.0", - "typedoc": "^0.23.19", + "typedoc": "^0.23.20", "typescript": "^4.8.4" }, "engines": { @@ -135,17 +132,17 @@ } }, "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.202.0.tgz", - "integrity": "sha512-PebtNMe214k8ueVtC12SaXHgtfdBpGsbxg81nkGddzesYLhqsBIKlcAyI+ZotrXU50NJ8+rEzxslNleLZ0NI+w==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.204.0.tgz", + "integrity": "sha512-uftJkNKYcZ8bXVwcpOn5ZUjUX0IRto0ZrTO8DBdS9b7PJu2Y84eSy46LsAYuRDC0PZreQxy8nOH5HmI86/W8xQ==", "optional": true, "dependencies": { "@aws-crypto/sha256-browser": "2.0.0", "@aws-crypto/sha256-js": "2.0.0", - "@aws-sdk/client-sts": "3.202.0", + "@aws-sdk/client-sts": "3.204.0", "@aws-sdk/config-resolver": "3.201.0", - "@aws-sdk/credential-provider-node": "3.202.0", - "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/credential-provider-node": "3.204.0", + "@aws-sdk/fetch-http-handler": "3.204.0", "@aws-sdk/hash-node": "3.201.0", "@aws-sdk/invalid-dependency": "3.201.0", "@aws-sdk/middleware-content-length": "3.201.0", @@ -164,6 +161,7 @@ "@aws-sdk/smithy-client": "3.201.0", "@aws-sdk/types": "3.201.0", "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64": "3.202.0", "@aws-sdk/util-base64-browser": "3.188.0", "@aws-sdk/util-base64-node": "3.201.0", "@aws-sdk/util-body-length-browser": "3.188.0", @@ -182,15 +180,15 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.202.0.tgz", - "integrity": "sha512-c0impiZUbJeB5AdyZyER81tsqF9bxxaEz6p2LYkTn62NWVXPWEUo/1CHQRj36MUzorz1xiWKIN0NPgK6GBJkPQ==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.204.0.tgz", + "integrity": "sha512-AECcNrcAQxV/Jlu8ogshRaYwt2jayx0omQJs/SXj70mWxmbk4MQnb+DqJIpPpOKBHaza/xlC2TKS1RzkiuZxyw==", "optional": true, "dependencies": { "@aws-crypto/sha256-browser": "2.0.0", "@aws-crypto/sha256-js": "2.0.0", "@aws-sdk/config-resolver": "3.201.0", - "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/fetch-http-handler": "3.204.0", "@aws-sdk/hash-node": "3.201.0", "@aws-sdk/invalid-dependency": "3.201.0", "@aws-sdk/middleware-content-length": "3.201.0", @@ -208,6 +206,7 @@ "@aws-sdk/smithy-client": "3.201.0", "@aws-sdk/types": "3.201.0", "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64": "3.202.0", "@aws-sdk/util-base64-browser": "3.188.0", "@aws-sdk/util-base64-node": "3.201.0", "@aws-sdk/util-body-length-browser": "3.188.0", @@ -226,16 +225,16 @@ } }, "node_modules/@aws-sdk/client-sts": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.202.0.tgz", - "integrity": "sha512-WGRFzODig8+cZR903q3fa7OAzGigSuzD9AoK+ybefQa7bxSuhT2ous4GNPOJz9WYWvugEPyrJu8vbG35IoF1ZQ==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.204.0.tgz", + "integrity": "sha512-Tp6FqENRw31XK5r5hul1JXnQgHBhbbXhoMebyFih6/zjpATaqg0bnV6tpww4yPi3uc+yDGXKw2/tDroSsyTsRA==", "optional": true, "dependencies": { "@aws-crypto/sha256-browser": "2.0.0", "@aws-crypto/sha256-js": "2.0.0", "@aws-sdk/config-resolver": "3.201.0", - "@aws-sdk/credential-provider-node": "3.202.0", - "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/credential-provider-node": "3.204.0", + "@aws-sdk/fetch-http-handler": "3.204.0", "@aws-sdk/hash-node": "3.201.0", "@aws-sdk/invalid-dependency": "3.201.0", "@aws-sdk/middleware-content-length": "3.201.0", @@ -255,6 +254,7 @@ "@aws-sdk/smithy-client": "3.201.0", "@aws-sdk/types": "3.201.0", "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64": "3.202.0", "@aws-sdk/util-base64-browser": "3.188.0", "@aws-sdk/util-base64-node": "3.201.0", "@aws-sdk/util-body-length-browser": "3.188.0", @@ -290,12 +290,12 @@ } }, "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.202.0.tgz", - "integrity": "sha512-W/Z4Zf05Yw5ya5SU1UO6xz/OZtxCzMMQmmb71eAHWsh/LIlJ9A3IFsAnAveG7eISTpFjMadT7n6mfsYt/eWgoQ==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.204.0.tgz", + "integrity": "sha512-DmiGXe7pXWuJiAGphzY5cRaphRiU5DJ6Tcg/88Td3wnj22As5DCELetb7E2YC9DfwmKiWcGAKQaYQqWe5AzSqw==", "optional": true, "dependencies": { - "@aws-sdk/client-cognito-identity": "3.202.0", + "@aws-sdk/client-cognito-identity": "3.204.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/types": "3.201.0", "tslib": "^2.3.1" @@ -335,14 +335,14 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.202.0.tgz", - "integrity": "sha512-d0kiYMpGzAq3EBXgEJ1SdeoMXVf3lk6NKHDi/Gy8LB03sZqgc5cY4XFCnY3cqE3DNWWZNR26M4j/KiA0LIjAVA==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.204.0.tgz", + "integrity": "sha512-ddtaS0ya5lgZZwfuJ/FuniroreLJ6yDgPAasol/rla9U5EU0qUEK1+6PX463exghUGjYfTqxdrKXhGYZfuEoIw==", "optional": true, "dependencies": { "@aws-sdk/credential-provider-env": "3.201.0", "@aws-sdk/credential-provider-imds": "3.201.0", - "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-sso": "3.204.0", "@aws-sdk/credential-provider-web-identity": "3.201.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", @@ -354,16 +354,16 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.202.0.tgz", - "integrity": "sha512-/uHNs3c1O3oFpH7z9nnpjyg8NKNyRbNxUDIHkuHkNSUUKXpfBisDX6TMbD4VcflGuNdkbT+8spkw5vsE8ox3ig==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.204.0.tgz", + "integrity": "sha512-kGbR5JE90zBGDS4cIz7tlUklMMeOm5oc5ES74YStLUacpQKwzVcHmDG8aT2DCONS/wEYysOIs5LygHurOJ/+Ww==", "optional": true, "dependencies": { "@aws-sdk/credential-provider-env": "3.201.0", "@aws-sdk/credential-provider-imds": "3.201.0", - "@aws-sdk/credential-provider-ini": "3.202.0", + "@aws-sdk/credential-provider-ini": "3.204.0", "@aws-sdk/credential-provider-process": "3.201.0", - "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-sso": "3.204.0", "@aws-sdk/credential-provider-web-identity": "3.201.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", @@ -390,12 +390,12 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.202.0.tgz", - "integrity": "sha512-EBUY/qKboJwy3qxPHiD/LAnhzga4xR1p++QMoxg2BKgkgwlvGb23lYGr5DSCNhdtJj5o165YZDbGYH+PKn2NVw==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.204.0.tgz", + "integrity": "sha512-iS884Gda99x4zmdCK3XxFcceve4wB+wudpeTUm2wwX9AGrSzoUnLWqNXv/R8UAMAsKANaWMBkqv/bsHpsEitZw==", "optional": true, "dependencies": { - "@aws-sdk/client-sso": "3.202.0", + "@aws-sdk/client-sso": "3.204.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", "@aws-sdk/types": "3.201.0", @@ -420,21 +420,21 @@ } }, "node_modules/@aws-sdk/credential-providers": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.202.0.tgz", - "integrity": "sha512-CQVSlKh+V4X3tWv+6IJFB8Io89bwErQSP6m7pGynrwH37dr0jg04A5WQQt+l8tRX8NSteVYrAyxebefLnWMTyA==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.204.0.tgz", + "integrity": "sha512-XlVfSWoXAiuQb5Q053McnmqSvllojKAc8ecQiLgLXstXXcHrI36E4XH7VkMaNV8JPPdLQhmLxrj01vzUyoT47Q==", "optional": true, "dependencies": { - "@aws-sdk/client-cognito-identity": "3.202.0", - "@aws-sdk/client-sso": "3.202.0", - "@aws-sdk/client-sts": "3.202.0", - "@aws-sdk/credential-provider-cognito-identity": "3.202.0", + "@aws-sdk/client-cognito-identity": "3.204.0", + "@aws-sdk/client-sso": "3.204.0", + "@aws-sdk/client-sts": "3.204.0", + "@aws-sdk/credential-provider-cognito-identity": "3.204.0", "@aws-sdk/credential-provider-env": "3.201.0", "@aws-sdk/credential-provider-imds": "3.201.0", - "@aws-sdk/credential-provider-ini": "3.202.0", - "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/credential-provider-ini": "3.204.0", + "@aws-sdk/credential-provider-node": "3.204.0", "@aws-sdk/credential-provider-process": "3.201.0", - "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-sso": "3.204.0", "@aws-sdk/credential-provider-web-identity": "3.201.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", @@ -446,15 +446,15 @@ } }, "node_modules/@aws-sdk/fetch-http-handler": { - "version": "3.201.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.201.0.tgz", - "integrity": "sha512-uiEoH79j6WOpbp4THcpvD9XmD+vPgy+00oyYXjtZqJnv2PM/9b6tGWKTdI+TJW4P/oPv7HP7JmRlkGaTnkIdXw==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.204.0.tgz", + "integrity": "sha512-TfIhWYQ4CTjrD+FSuBcKMSVrqq8GCwqCfUyalWmSKo4JIFhN5OxUnOFb1/ecE/TJX+YgZ65w4qhVJVHHmh229Q==", "optional": true, "dependencies": { "@aws-sdk/protocol-http": "3.201.0", "@aws-sdk/querystring-builder": "3.201.0", "@aws-sdk/types": "3.201.0", - "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64": "3.202.0", "tslib": "^2.3.1" } }, @@ -815,6 +815,19 @@ "tslib": "^2.3.1" } }, + "node_modules/@aws-sdk/util-base64": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64/-/util-base64-3.202.0.tgz", + "integrity": "sha512-0QlvxCSU2CITeR/x87zls9ma+CkN3EXRGM3M5XnHWaneDI9K+O2uPpAbDfLh0SBJyO0AfIMn7Vh/BvnNNPEDpg==", + "optional": true, + "dependencies": { + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@aws-sdk/util-base64-browser": { "version": "3.188.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64-browser/-/util-base64-browser-3.188.0.tgz", @@ -1163,21 +1176,10 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, - "node_modules/@types/jsdom": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.0.tgz", - "integrity": "sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==", - "dev": true, - "dependencies": { - "@types/node": "*", - "@types/tough-cookie": "*", - "parse5": "^7.0.0" - } - }, "node_modules/@types/luxon": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.0.2.tgz", - "integrity": "sha512-HM2OVWckUMmXbWYZufmWT2XMURGDZ6XbyNyQ+Lx+gCFGFqbZaIjsz7b+AGeGP/AuVYHBiuGY+wXfweP1RremnA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.1.0.tgz", + "integrity": "sha512-gCd/HcCgjqSxfMrgtqxCgYk/22NBQfypwFUG7ZAyG/4pqs51WLTcUzVp1hqTbieDYeHS3WoVEh2Yv/2l+7B0Vg==", "dev": true }, "node_modules/@types/mocha": { @@ -1201,12 +1203,6 @@ "minipass": "^3.3.5" } }, - "node_modules/@types/tough-cookie": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", - "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", - "dev": true - }, "node_modules/@types/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -2799,9 +2795,9 @@ "dev": true }, "node_modules/marked": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.1.tgz", - "integrity": "sha512-VK1/jNtwqDLvPktNpL0Fdg3qoeUZhmRsuiIjPEy/lHwXW4ouLoZfO4XoWd4ClDt+hupV1VLpkZhEovjU0W/kqA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.2.tgz", + "integrity": "sha512-JjBTFTAvuTgANXx82a5vzK9JLSMoV6V3LBVn4Uhdso6t7vXrGx7g1Cd2r6NYSsxrYbQGFCMqBDhFHyK5q2UvcQ==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -3918,9 +3914,9 @@ } }, "node_modules/typedoc": { - "version": "0.23.19", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.19.tgz", - "integrity": "sha512-70jPL0GQnSJtgQqI7ifOWxpTXrB3sxc4SWPPRn3K0wdx3txI6ZIT/ZYMF39dNg2Gjmql45cO+cAKXJp0TpqOVA==", + "version": "0.23.20", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.20.tgz", + "integrity": "sha512-nfb4Mx05ZZZXux3zPcLuc7+3TVePDW3jTdEBqXdQzJUyEILxoprgPIiTChbvci9crkqNJG9YESmfCptuh9Gn3g==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -4196,9 +4192,9 @@ } }, "node_modules/yargs": { - "version": "17.6.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.1.tgz", - "integrity": "sha512-leBuCGrL4dAd6ispNOGsJlhd0uZ6Qehkbu/B9KCR+Pxa/NVdNwi+i31lo0buCm6XxhJQFshXCD0/evfV4xfoUg==", + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -4206,7 +4202,7 @@ "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" + "yargs-parser": "^21.1.1" }, "engines": { "node": ">=12" @@ -4374,17 +4370,17 @@ } }, "@aws-sdk/client-cognito-identity": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.202.0.tgz", - "integrity": "sha512-PebtNMe214k8ueVtC12SaXHgtfdBpGsbxg81nkGddzesYLhqsBIKlcAyI+ZotrXU50NJ8+rEzxslNleLZ0NI+w==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.204.0.tgz", + "integrity": "sha512-uftJkNKYcZ8bXVwcpOn5ZUjUX0IRto0ZrTO8DBdS9b7PJu2Y84eSy46LsAYuRDC0PZreQxy8nOH5HmI86/W8xQ==", "optional": true, "requires": { "@aws-crypto/sha256-browser": "2.0.0", "@aws-crypto/sha256-js": "2.0.0", - "@aws-sdk/client-sts": "3.202.0", + "@aws-sdk/client-sts": "3.204.0", "@aws-sdk/config-resolver": "3.201.0", - "@aws-sdk/credential-provider-node": "3.202.0", - "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/credential-provider-node": "3.204.0", + "@aws-sdk/fetch-http-handler": "3.204.0", "@aws-sdk/hash-node": "3.201.0", "@aws-sdk/invalid-dependency": "3.201.0", "@aws-sdk/middleware-content-length": "3.201.0", @@ -4403,6 +4399,7 @@ "@aws-sdk/smithy-client": "3.201.0", "@aws-sdk/types": "3.201.0", "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64": "3.202.0", "@aws-sdk/util-base64-browser": "3.188.0", "@aws-sdk/util-base64-node": "3.201.0", "@aws-sdk/util-body-length-browser": "3.188.0", @@ -4418,15 +4415,15 @@ } }, "@aws-sdk/client-sso": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.202.0.tgz", - "integrity": "sha512-c0impiZUbJeB5AdyZyER81tsqF9bxxaEz6p2LYkTn62NWVXPWEUo/1CHQRj36MUzorz1xiWKIN0NPgK6GBJkPQ==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.204.0.tgz", + "integrity": "sha512-AECcNrcAQxV/Jlu8ogshRaYwt2jayx0omQJs/SXj70mWxmbk4MQnb+DqJIpPpOKBHaza/xlC2TKS1RzkiuZxyw==", "optional": true, "requires": { "@aws-crypto/sha256-browser": "2.0.0", "@aws-crypto/sha256-js": "2.0.0", "@aws-sdk/config-resolver": "3.201.0", - "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/fetch-http-handler": "3.204.0", "@aws-sdk/hash-node": "3.201.0", "@aws-sdk/invalid-dependency": "3.201.0", "@aws-sdk/middleware-content-length": "3.201.0", @@ -4444,6 +4441,7 @@ "@aws-sdk/smithy-client": "3.201.0", "@aws-sdk/types": "3.201.0", "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64": "3.202.0", "@aws-sdk/util-base64-browser": "3.188.0", "@aws-sdk/util-base64-node": "3.201.0", "@aws-sdk/util-body-length-browser": "3.188.0", @@ -4459,16 +4457,16 @@ } }, "@aws-sdk/client-sts": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.202.0.tgz", - "integrity": "sha512-WGRFzODig8+cZR903q3fa7OAzGigSuzD9AoK+ybefQa7bxSuhT2ous4GNPOJz9WYWvugEPyrJu8vbG35IoF1ZQ==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.204.0.tgz", + "integrity": "sha512-Tp6FqENRw31XK5r5hul1JXnQgHBhbbXhoMebyFih6/zjpATaqg0bnV6tpww4yPi3uc+yDGXKw2/tDroSsyTsRA==", "optional": true, "requires": { "@aws-crypto/sha256-browser": "2.0.0", "@aws-crypto/sha256-js": "2.0.0", "@aws-sdk/config-resolver": "3.201.0", - "@aws-sdk/credential-provider-node": "3.202.0", - "@aws-sdk/fetch-http-handler": "3.201.0", + "@aws-sdk/credential-provider-node": "3.204.0", + "@aws-sdk/fetch-http-handler": "3.204.0", "@aws-sdk/hash-node": "3.201.0", "@aws-sdk/invalid-dependency": "3.201.0", "@aws-sdk/middleware-content-length": "3.201.0", @@ -4488,6 +4486,7 @@ "@aws-sdk/smithy-client": "3.201.0", "@aws-sdk/types": "3.201.0", "@aws-sdk/url-parser": "3.201.0", + "@aws-sdk/util-base64": "3.202.0", "@aws-sdk/util-base64-browser": "3.188.0", "@aws-sdk/util-base64-node": "3.201.0", "@aws-sdk/util-body-length-browser": "3.188.0", @@ -4517,12 +4516,12 @@ } }, "@aws-sdk/credential-provider-cognito-identity": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.202.0.tgz", - "integrity": "sha512-W/Z4Zf05Yw5ya5SU1UO6xz/OZtxCzMMQmmb71eAHWsh/LIlJ9A3IFsAnAveG7eISTpFjMadT7n6mfsYt/eWgoQ==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.204.0.tgz", + "integrity": "sha512-DmiGXe7pXWuJiAGphzY5cRaphRiU5DJ6Tcg/88Td3wnj22As5DCELetb7E2YC9DfwmKiWcGAKQaYQqWe5AzSqw==", "optional": true, "requires": { - "@aws-sdk/client-cognito-identity": "3.202.0", + "@aws-sdk/client-cognito-identity": "3.204.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/types": "3.201.0", "tslib": "^2.3.1" @@ -4553,14 +4552,14 @@ } }, "@aws-sdk/credential-provider-ini": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.202.0.tgz", - "integrity": "sha512-d0kiYMpGzAq3EBXgEJ1SdeoMXVf3lk6NKHDi/Gy8LB03sZqgc5cY4XFCnY3cqE3DNWWZNR26M4j/KiA0LIjAVA==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.204.0.tgz", + "integrity": "sha512-ddtaS0ya5lgZZwfuJ/FuniroreLJ6yDgPAasol/rla9U5EU0qUEK1+6PX463exghUGjYfTqxdrKXhGYZfuEoIw==", "optional": true, "requires": { "@aws-sdk/credential-provider-env": "3.201.0", "@aws-sdk/credential-provider-imds": "3.201.0", - "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-sso": "3.204.0", "@aws-sdk/credential-provider-web-identity": "3.201.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", @@ -4569,16 +4568,16 @@ } }, "@aws-sdk/credential-provider-node": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.202.0.tgz", - "integrity": "sha512-/uHNs3c1O3oFpH7z9nnpjyg8NKNyRbNxUDIHkuHkNSUUKXpfBisDX6TMbD4VcflGuNdkbT+8spkw5vsE8ox3ig==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.204.0.tgz", + "integrity": "sha512-kGbR5JE90zBGDS4cIz7tlUklMMeOm5oc5ES74YStLUacpQKwzVcHmDG8aT2DCONS/wEYysOIs5LygHurOJ/+Ww==", "optional": true, "requires": { "@aws-sdk/credential-provider-env": "3.201.0", "@aws-sdk/credential-provider-imds": "3.201.0", - "@aws-sdk/credential-provider-ini": "3.202.0", + "@aws-sdk/credential-provider-ini": "3.204.0", "@aws-sdk/credential-provider-process": "3.201.0", - "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-sso": "3.204.0", "@aws-sdk/credential-provider-web-identity": "3.201.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", @@ -4599,12 +4598,12 @@ } }, "@aws-sdk/credential-provider-sso": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.202.0.tgz", - "integrity": "sha512-EBUY/qKboJwy3qxPHiD/LAnhzga4xR1p++QMoxg2BKgkgwlvGb23lYGr5DSCNhdtJj5o165YZDbGYH+PKn2NVw==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.204.0.tgz", + "integrity": "sha512-iS884Gda99x4zmdCK3XxFcceve4wB+wudpeTUm2wwX9AGrSzoUnLWqNXv/R8UAMAsKANaWMBkqv/bsHpsEitZw==", "optional": true, "requires": { - "@aws-sdk/client-sso": "3.202.0", + "@aws-sdk/client-sso": "3.204.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", "@aws-sdk/types": "3.201.0", @@ -4623,21 +4622,21 @@ } }, "@aws-sdk/credential-providers": { - "version": "3.202.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.202.0.tgz", - "integrity": "sha512-CQVSlKh+V4X3tWv+6IJFB8Io89bwErQSP6m7pGynrwH37dr0jg04A5WQQt+l8tRX8NSteVYrAyxebefLnWMTyA==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.204.0.tgz", + "integrity": "sha512-XlVfSWoXAiuQb5Q053McnmqSvllojKAc8ecQiLgLXstXXcHrI36E4XH7VkMaNV8JPPdLQhmLxrj01vzUyoT47Q==", "optional": true, "requires": { - "@aws-sdk/client-cognito-identity": "3.202.0", - "@aws-sdk/client-sso": "3.202.0", - "@aws-sdk/client-sts": "3.202.0", - "@aws-sdk/credential-provider-cognito-identity": "3.202.0", + "@aws-sdk/client-cognito-identity": "3.204.0", + "@aws-sdk/client-sso": "3.204.0", + "@aws-sdk/client-sts": "3.204.0", + "@aws-sdk/credential-provider-cognito-identity": "3.204.0", "@aws-sdk/credential-provider-env": "3.201.0", "@aws-sdk/credential-provider-imds": "3.201.0", - "@aws-sdk/credential-provider-ini": "3.202.0", - "@aws-sdk/credential-provider-node": "3.202.0", + "@aws-sdk/credential-provider-ini": "3.204.0", + "@aws-sdk/credential-provider-node": "3.204.0", "@aws-sdk/credential-provider-process": "3.201.0", - "@aws-sdk/credential-provider-sso": "3.202.0", + "@aws-sdk/credential-provider-sso": "3.204.0", "@aws-sdk/credential-provider-web-identity": "3.201.0", "@aws-sdk/property-provider": "3.201.0", "@aws-sdk/shared-ini-file-loader": "3.201.0", @@ -4646,15 +4645,15 @@ } }, "@aws-sdk/fetch-http-handler": { - "version": "3.201.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.201.0.tgz", - "integrity": "sha512-uiEoH79j6WOpbp4THcpvD9XmD+vPgy+00oyYXjtZqJnv2PM/9b6tGWKTdI+TJW4P/oPv7HP7JmRlkGaTnkIdXw==", + "version": "3.204.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.204.0.tgz", + "integrity": "sha512-TfIhWYQ4CTjrD+FSuBcKMSVrqq8GCwqCfUyalWmSKo4JIFhN5OxUnOFb1/ecE/TJX+YgZ65w4qhVJVHHmh229Q==", "optional": true, "requires": { "@aws-sdk/protocol-http": "3.201.0", "@aws-sdk/querystring-builder": "3.201.0", "@aws-sdk/types": "3.201.0", - "@aws-sdk/util-base64-browser": "3.188.0", + "@aws-sdk/util-base64": "3.202.0", "tslib": "^2.3.1" } }, @@ -4943,6 +4942,16 @@ "tslib": "^2.3.1" } }, + "@aws-sdk/util-base64": { + "version": "3.202.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64/-/util-base64-3.202.0.tgz", + "integrity": "sha512-0QlvxCSU2CITeR/x87zls9ma+CkN3EXRGM3M5XnHWaneDI9K+O2uPpAbDfLh0SBJyO0AfIMn7Vh/BvnNNPEDpg==", + "optional": true, + "requires": { + "@aws-sdk/util-buffer-from": "3.201.0", + "tslib": "^2.3.1" + } + }, "@aws-sdk/util-base64-browser": { "version": "3.188.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64-browser/-/util-base64-browser-3.188.0.tgz", @@ -5223,21 +5232,10 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, - "@types/jsdom": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.0.tgz", - "integrity": "sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==", - "dev": true, - "requires": { - "@types/node": "*", - "@types/tough-cookie": "*", - "parse5": "^7.0.0" - } - }, "@types/luxon": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.0.2.tgz", - "integrity": "sha512-HM2OVWckUMmXbWYZufmWT2XMURGDZ6XbyNyQ+Lx+gCFGFqbZaIjsz7b+AGeGP/AuVYHBiuGY+wXfweP1RremnA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.1.0.tgz", + "integrity": "sha512-gCd/HcCgjqSxfMrgtqxCgYk/22NBQfypwFUG7ZAyG/4pqs51WLTcUzVp1hqTbieDYeHS3WoVEh2Yv/2l+7B0Vg==", "dev": true }, "@types/mocha": { @@ -5261,12 +5259,6 @@ "minipass": "^3.3.5" } }, - "@types/tough-cookie": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", - "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", - "dev": true - }, "@types/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -6411,9 +6403,9 @@ "dev": true }, "marked": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.1.tgz", - "integrity": "sha512-VK1/jNtwqDLvPktNpL0Fdg3qoeUZhmRsuiIjPEy/lHwXW4ouLoZfO4XoWd4ClDt+hupV1VLpkZhEovjU0W/kqA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.2.tgz", + "integrity": "sha512-JjBTFTAvuTgANXx82a5vzK9JLSMoV6V3LBVn4Uhdso6t7vXrGx7g1Cd2r6NYSsxrYbQGFCMqBDhFHyK5q2UvcQ==", "dev": true }, "media-typer": { @@ -7222,9 +7214,9 @@ } }, "typedoc": { - "version": "0.23.19", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.19.tgz", - "integrity": "sha512-70jPL0GQnSJtgQqI7ifOWxpTXrB3sxc4SWPPRn3K0wdx3txI6ZIT/ZYMF39dNg2Gjmql45cO+cAKXJp0TpqOVA==", + "version": "0.23.20", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.20.tgz", + "integrity": "sha512-nfb4Mx05ZZZXux3zPcLuc7+3TVePDW3jTdEBqXdQzJUyEILxoprgPIiTChbvci9crkqNJG9YESmfCptuh9Gn3g==", "dev": true, "requires": { "lunr": "^2.3.9", @@ -7420,9 +7412,9 @@ "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==" }, "yargs": { - "version": "17.6.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.1.tgz", - "integrity": "sha512-leBuCGrL4dAd6ispNOGsJlhd0uZ6Qehkbu/B9KCR+Pxa/NVdNwi+i31lo0buCm6XxhJQFshXCD0/evfV4xfoUg==", + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "requires": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -7430,7 +7422,7 @@ "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" + "yargs-parser": "^21.1.1" }, "dependencies": { "yargs-parser": { diff --git a/package.json b/package.json index 9b789b9..fef2619 100644 --- a/package.json +++ b/package.json @@ -36,22 +36,19 @@ "adm-zip": "^0.5.9", "cron": "^2.1.0", "got": "^12.5.2", - "jsdom": "^20.0.2", - "mongoose": "^6.7.1", "prismarine-nbt": "^2.2.1", "tar": "^6.1.12" }, "devDependencies": { "@types/adm-zip": "^0.5.0", "@types/cron": "^2.0.0", - "@types/jsdom": "^20.0.0", "@types/mocha": "^10.0.0", "@types/node": "^18.11.9", "@types/tar": "^6.1.3", "mocha": "^10.1.0", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.0", - "typedoc": "^0.23.19", + "typedoc": "^0.23.20", "typescript": "^4.8.4" } } diff --git a/src/index.ts b/src/index.ts index 8549a9a..6e51f6e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import * as httpSimples from "@http/simples"; import * as httpLarge from "@http/large"; import * as httpGithub from "@http/github"; import * as httpClient from "@http/client"; +const httpRequest = {httpSimples, httpLarge, httpGithub, httpClient}; // Utils import * as platformPathManeger from "./platformPathManeger" @@ -20,7 +21,7 @@ import * as Spigot from "./spigot"; import * as Powernukkit from "./pwnuukit"; import * as PaperMC from "./paper"; -export {platformPathManeger, globalPlatfroms, pluginManeger, export_import, PocketmineMP, pluginHooks, Powernukkit, PaperMC, Bedrock, Spigot, proxy, Java}; +export {platformPathManeger, globalPlatfroms, pluginManeger, export_import, httpRequest, PocketmineMP, pluginHooks, Powernukkit, PaperMC, Bedrock, Spigot, proxy, Java}; export default { Bedrock, Java, @@ -35,11 +36,6 @@ export default { pluginHooks, export_import, proxy, - httpRequest: { - httpSimples, - httpLarge, - httpGithub, - httpClient - } + httpRequest } }; diff --git a/src/lib/versions/db/bedrock.ts b/src/lib/versions/db/bedrock.ts deleted file mode 100644 index 5a9df62..0000000 --- a/src/lib/versions/db/bedrock.ts +++ /dev/null @@ -1,27 +0,0 @@ -import mongoose from "mongoose"; -import connection from "./connect"; - -export type bedrockSchema = { - version: string, - date: Date, - latest: boolean, - url: { - win32: string, - linux: string - } -}; - -export const bedrock = connection.model("bedrock", new mongoose.Schema({ - version: { - type: String, - required: true, - unique: true - }, - date: Date, - latest: Boolean, - url: { - win32: String, - linux: String - } -})); - diff --git a/src/lib/versions/db/connect.ts b/src/lib/versions/db/connect.ts deleted file mode 100644 index c5ddc4c..0000000 --- a/src/lib/versions/db/connect.ts +++ /dev/null @@ -1,8 +0,0 @@ -import mongoose from "mongoose"; -export let authUsername = (!!process.env.MONGO_USER)?process.env.MONGO_USER:"public"; -export let authPassword = (!!process.env.MONGO_PASSWORD)?process.env.MONGO_PASSWORD:"n0v8IBKEI920sfy8"; -export const mongoURL = process.env.BDSVERSIONDB||`mongodb+srv://${authUsername}:${authPassword}@versionstorage.qgh8v.mongodb.net/v2_versions`; - -// Connect to MongoDB -export const connection = mongoose.createConnection(mongoURL); -export default connection; diff --git a/src/lib/versions/db/java.ts b/src/lib/versions/db/java.ts deleted file mode 100644 index f62e49b..0000000 --- a/src/lib/versions/db/java.ts +++ /dev/null @@ -1,22 +0,0 @@ -import mongoose from "mongoose"; -import connection from "./connect"; - -export type javaSchema = { - version: string, - date: Date, - latest: boolean, - url: string -}; - -export const java = connection.model("java", new mongoose.Schema({ - version: { - type: String, - required: true, - unique: true - }, - date: Date, - latest: Boolean, - url: String -})); -export default java; - diff --git a/src/lib/versions/db/paper.ts b/src/lib/versions/db/paper.ts deleted file mode 100644 index d0bb4d1..0000000 --- a/src/lib/versions/db/paper.ts +++ /dev/null @@ -1,19 +0,0 @@ -import mongoose from "mongoose"; -import connection from "./connect"; - -export type paperSchema = { - version: string, - build: number, - date: Date, - latest: boolean, - url: string -}; - -export const paper = connection.model("paper", new mongoose.Schema({ - version: String, - build: Number, - date: Date, - latest: Boolean, - url: String -})); - diff --git a/src/lib/versions/db/pocketmine.ts b/src/lib/versions/db/pocketmine.ts deleted file mode 100644 index 453c6f4..0000000 --- a/src/lib/versions/db/pocketmine.ts +++ /dev/null @@ -1,21 +0,0 @@ -import mongoose from "mongoose"; -import connection from "./connect"; - -export type pocketminemmpSchema = { - version: string, - date: Date, - latest: boolean, - url: string -}; - -export const pocketmine = connection.model("pocketminemmp", new mongoose.Schema({ - version: { - type: String, - required: true, - unique: true - }, - date: Date, - latest: Boolean, - url: String -})); - diff --git a/src/lib/versions/db/powernukkit.ts b/src/lib/versions/db/powernukkit.ts deleted file mode 100644 index 7cd4f58..0000000 --- a/src/lib/versions/db/powernukkit.ts +++ /dev/null @@ -1,24 +0,0 @@ -import mongoose from "mongoose"; -import connection from "./connect"; - -export type powernukkitSchema = { - version: string, - mcpeVersion: string, - date: Date, - latest: boolean, - url: string, - variantType: "stable"|"snapshot" -}; - -export const powernukkit = connection.model("powernukkit", new mongoose.Schema({ - version: { - type: String, - unique: false, - required: true - }, - mcpeVersion: String, - date: Date, - url: String, - variantType: String, - latest: Boolean -})); diff --git a/src/lib/versions/db/spigot.ts b/src/lib/versions/db/spigot.ts deleted file mode 100644 index d236009..0000000 --- a/src/lib/versions/db/spigot.ts +++ /dev/null @@ -1,21 +0,0 @@ -import mongoose from "mongoose"; -import connection from "./connect"; - -// Type to represent the spigot model -export type spigotSchema = { - version: string, - date: Date, - latest: boolean, - url: string -}; - -export const spigot = connection.model("spigot", new mongoose.Schema({ - version: { - type: String, - required: true, - unique: true - }, - date: Date, - latest: Boolean, - url: String -})); diff --git a/src/lib/versions/exports.ts b/src/lib/versions/exports.ts deleted file mode 100644 index 006420c..0000000 --- a/src/lib/versions/exports.ts +++ /dev/null @@ -1,76 +0,0 @@ -import fsOld from "node:fs"; -import path from "node:path"; -import fs from "node:fs/promises"; -import { findVersion as getVersions, bedrock, java, paper, pocketmine, powernukkit, spigot } from "./index"; - -const rootVersions = path.join(process.cwd(), "versions"); -const Bedrock = path.join(rootVersions, "bedrock"); -const Pocketmine = path.join(rootVersions, "pocketmine"); -const Powernukkit = path.join(rootVersions, "powernukkit"); -const Java = path.join(rootVersions, "java"); -const Spigot = path.join(rootVersions, "spigot"); -const Paper = path.join(rootVersions, "paper"); - -(async function(){ - if (!fsOld.existsSync(rootVersions)) await fs.mkdir(rootVersions, {recursive: true}); - if (!fsOld.existsSync(Bedrock)) await fs.mkdir(Bedrock, {recursive: true}); - if (!fsOld.existsSync(Pocketmine)) await fs.mkdir(Pocketmine, {recursive: true}); - if (!fsOld.existsSync(Powernukkit)) await fs.mkdir(Powernukkit, {recursive: true}); - if (!fsOld.existsSync(Java)) await fs.mkdir(Java, {recursive: true}); - if (!fsOld.existsSync(Spigot)) await fs.mkdir(Spigot, {recursive: true}); - if (!fsOld.existsSync(Paper)) await fs.mkdir(Paper, {recursive: true}); - - const bedrockData = await getVersions("bedrock", "all", true); - fs.writeFile(path.join(Bedrock, "latest.json"), JSON.stringify(bedrockData.find(release => release.latest), null, 2)); - fs.writeFile(path.join(Bedrock, "all.json"), JSON.stringify(bedrockData, null, 2)); - await Promise.all(bedrockData.map(async releases => { - const version = path.join(Bedrock, `${releases.version}.json`); - await fs.writeFile(version, JSON.stringify(releases, null, 2)); - await fs.utimes(version, new Date(releases.date), new Date(releases.date)); - })); - - const PocketmineData = await getVersions("pocketmine", "all", true); - fs.writeFile(path.join(Pocketmine, "latest.json"), JSON.stringify(PocketmineData.find(release => release.latest), null, 2)); - fs.writeFile(path.join(Pocketmine, "all.json"), JSON.stringify(PocketmineData, null, 2)); - await Promise.all(PocketmineData.map(async releases => { - const version = path.join(Pocketmine, `${releases.version}.json`); - await fs.writeFile(version, JSON.stringify(releases, null, 2)); - await fs.utimes(version, new Date(releases.date), new Date(releases.date)); - })); - - const PowernukkitData = await getVersions("powernukkit", "all", true); - fs.writeFile(path.join(Powernukkit, "latest.json"), JSON.stringify(PowernukkitData.find(release => release.latest), null, 2)); - fs.writeFile(path.join(Powernukkit, "all.json"), JSON.stringify(PowernukkitData, null, 2)); - await Promise.all(PowernukkitData.map(async releases => { - const version = path.join(Powernukkit, `${releases.version}.json`); - await fs.writeFile(version, JSON.stringify(releases, null, 2)); - await fs.utimes(version, new Date(releases.date), new Date(releases.date)); - })); - - const JavaData = await getVersions("java", "all", true); - fs.writeFile(path.join(Java, "latest.json"), JSON.stringify(JavaData.find(release => release.latest), null, 2)); - fs.writeFile(path.join(Java, "all.json"), JSON.stringify(JavaData, null, 2)); - await Promise.all(JavaData.map(async releases => { - const version = path.join(Java, `${releases.version}.json`); - await fs.writeFile(version, JSON.stringify(releases, null, 2)); - await fs.utimes(version, new Date(releases.date), new Date(releases.date)); - })); - - const SpigotData = await getVersions("spigot", "all", true); - fs.writeFile(path.join(Spigot, "latest.json"), JSON.stringify(SpigotData.find(release => release.latest), null, 2)); - fs.writeFile(path.join(Spigot, "all.json"), JSON.stringify(SpigotData, null, 2)); - await Promise.all(SpigotData.map(async releases => { - const version = path.join(Spigot, `${releases.version}.json`); - await fs.writeFile(version, JSON.stringify(releases, null, 2)); - await fs.utimes(version, new Date(releases.date), new Date(releases.date)); - })); - - const PaperData = await getVersions("paper", "all", true); - fs.writeFile(path.join(Paper, "latest.json"), JSON.stringify(PaperData.find(release => release.latest), null, 2)); - fs.writeFile(path.join(Paper, "all.json"), JSON.stringify(PaperData, null, 2)); - await Promise.all(PaperData.map(async releases => { - const version = path.join(Paper, `${releases.version}_${releases.build}.json`); - await fs.writeFile(version, JSON.stringify(releases, null, 2)); - await fs.utimes(version, new Date(releases.date), new Date(releases.date)); - })); -})(); \ No newline at end of file diff --git a/src/lib/versions/fetchVersion/Bedrock.ts b/src/lib/versions/fetchVersion/Bedrock.ts deleted file mode 100644 index f25b9fd..0000000 --- a/src/lib/versions/fetchVersion/Bedrock.ts +++ /dev/null @@ -1,42 +0,0 @@ -import adm_zip from "adm-zip"; -import { bufferFetch, urls } from "@http/simples"; -import { bedrock, bedrockSchema } from "../db/bedrock"; - -export default async function UpdateDatabase() { - const minecraftUrls = (await urls("https://minecraft.net/en-us/download/server/bedrock")).filter(Link => /bin-.*\.zip/.test(Link)); - const objURLs: {linux: string, win32: string} = {linux: undefined, win32: undefined}; - minecraftUrls.forEach((url: string) => { - if (/darwin|macos|mac/.test(url)) console.log("Macos Are now supported: %s", url); - else if (/win/.test(url)) objURLs.win32 = url; - else if (/linux/.test(url)) objURLs.linux = url; - }); - const anyZip = objURLs.win32||objURLs.linux; - if (!anyZip) throw new Error("cannot get url"); - const [, mcpeVersion] = anyZip.match(/\/[a-zA-Z-_]+([0-9\.]+).zip$/)||[]; - const mcpeDate = await new Promise(async resolve => { - const zip = new adm_zip((await bufferFetch(objURLs.linux)).data); - for (const entry of zip.getEntries()) { - if (entry.entryName === "bedrock_server") return resolve(entry.header.time); - }; - return resolve(new Date()); - }); - if (!mcpeVersion) return; - const version: bedrockSchema = { - version: mcpeVersion, - date: mcpeDate, - latest: false, - url: { - linux: objURLs.linux, - win32: objURLs.win32 - } - }; - if (await bedrock.findOne({version: version.version}).lean()) { - console.log("Bedrock version %s are exists", version.version); - return; - } - await bedrock.create(version); - console.log("Bedrock adding new version %s", version.version); - await bedrock.findOneAndUpdate({latest: true}, {$set: {latest: false}}); - const latest = (await bedrock.find().lean()).sort((a, b) => b.date.getTime() - a.date.getTime())[0]; - await bedrock.findByIdAndUpdate(latest._id, {$set: {latest: true}}); -} diff --git a/src/lib/versions/fetchVersion/Java.ts b/src/lib/versions/fetchVersion/Java.ts deleted file mode 100644 index b425987..0000000 --- a/src/lib/versions/fetchVersion/Java.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { getJSON } from "@http/simples"; -import { java } from "../db/java"; -import { javaRelease } from "./types/Java"; - -async function Add(Version: string, versionDate: Date, url: string): Promise { - if (await java.findOne({ version: Version }).lean().then(data => !!data).catch(() => true)) return; - else { - console.log("Java: Version '%s', url '%s'", Version, url); - await java.create({ - version: Version, - date: versionDate, - latest: false, - url: url - }); - } -} - -type version_manifest_v2 = {latest: {release: string, snapshot: string, }, versions: {id: string, type: "snapshot"|"release", url: string, time: string, releaseTime: string, sha1: string, complianceLevel: number}[]} - -async function Find() { - const Versions = await getJSON("https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"); - for (const ver of Versions.versions.filter(a => a.type === "release")) { - const Release = await getJSON(ver.url); - if (!!Release?.downloads?.server?.url) await Add(ver.id, new Date(ver.releaseTime), Release?.downloads?.server?.url); - } - return await java.findOneAndUpdate({version: Versions.latest.release}, {$set: {latest: true}}).lean(); -} - -export default async function UpdateDatabase() { - const latestVersion = await java.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); - return { - new: await Find(), - old: latestVersion - }; -} diff --git a/src/lib/versions/fetchVersion/Paper.ts b/src/lib/versions/fetchVersion/Paper.ts deleted file mode 100644 index 686f76e..0000000 --- a/src/lib/versions/fetchVersion/Paper.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { getJSON as getJson } from "@http/simples"; -import { paper } from "../db/paper"; - -type paperVersions = { - project_id: string, - project_name: string, - version_groups: string[], - versions: string[] -}; - -type paperBuilds = { - project_id: string, - project_name: string, - version: string, - builds: { - build: number; - time: string; - channel: string; - promoted: boolean; - changes: {commit: string, summary: string, message: string}[]; - downloads: { - application: {name: string, sha256: string}, - mojangMappings: {name: string, sha256: string} - } - }[] -}; - -export default async function find() { - const versions = (await getJson("https://api.papermc.io/v2/projects/paper")).versions; - for (const version of versions) { - const builds = await getJson(`https://api.papermc.io/v2/projects/paper/versions/${version}/builds`); - await Promise.all(builds.builds.map(async function(build){ - const downloadUrl = `https://api.papermc.io/v2/projects/paper/versions/${builds.version}/builds/${build.build}/downloads/${build.downloads.application.name}`; - if (await paper.findOne({url: downloadUrl}).lean()) return; - await paper.create({ - version: builds.version, - build: build.build, - date: new Date(build.time), - url: downloadUrl, - latest: false - }); - return console.log("Paper add %s version, build %s", builds.version, build.build); - })); - } - await paper.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); - const latestVersionByDate = (await paper.find().lean()).sort((a, b) => b.date.getTime()-a.date.getTime())[0]; - await paper.findByIdAndUpdate(latestVersionByDate._id, {$set: {latest: true}}).lean(); -} diff --git a/src/lib/versions/fetchVersion/Pocketmine.ts b/src/lib/versions/fetchVersion/Pocketmine.ts deleted file mode 100644 index 386193e..0000000 --- a/src/lib/versions/fetchVersion/Pocketmine.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { GithubRelease } from "@http/github"; -import { pocketmine as pocketminemmp} from "../db/pocketmine"; - -async function Add(Version: string, versionDate: Date, url: string) { - if (await pocketminemmp.findOne({ version: Version }).lean().then(data => !!data).catch(() => true)) console.log("Pocketmine: version (%s) already exists", Version); - else { - await pocketminemmp.create({ - version: Version, - date: versionDate, - latest: false, - url: url - }); - console.log("Pocketmine PMMP: Version %s, url %s", Version, url); - } -} - -async function Find() { - return await Promise.all((await GithubRelease("pmmp/PocketMine-MP")).filter(Release => !/beta|alpha/gi.test(Release.tag_name.toLowerCase())).map(Release => { - Release.assets = Release.assets.filter(asset => asset.name.endsWith(".phar")); - return Release; - }).filter(a => a.assets.length > 0).map(release => { - return Add(release.tag_name, new Date(release.published_at), release.assets[0].browser_download_url).catch(err => { - console.log("Pocketmine PMMP: Version %s, Error: %o", release.tag_name, err); - }).then(() => ({ - Date: new Date(release.published_at), - Version: release.tag_name, - url: release.assets[0].browser_download_url - })); - })); -} - -export default async function UpdateDatabase() { - const latestVersion = await pocketminemmp.findOneAndUpdate({ latest: true }, {$set: {latest: false}}).lean(); - const Releases = await Find(); - const newLatest = await pocketminemmp.findOneAndUpdate({ version: Releases[0].Version }, {$set: { latest: true }}).lean(); - return { - new: newLatest, - old: latestVersion - }; -} diff --git a/src/lib/versions/fetchVersion/Powernukkit.ts b/src/lib/versions/fetchVersion/Powernukkit.ts deleted file mode 100644 index 61748d1..0000000 --- a/src/lib/versions/fetchVersion/Powernukkit.ts +++ /dev/null @@ -1,161 +0,0 @@ -import { powernukkit, powernukkitSchema } from "../db/powernukkit"; -import { getJSON as getJson } from "@http/simples"; -export const exportUrl = "https://raw.githubusercontent.com/PowerNukkit/powernukkit-version-aggregator/master/powernukkit-versions.json"; -export type Release = { - version: string, - releaseTime: number, - minecraftVersion: string, - artefacts: string[], - commitId: string, - snapshotBuild?: number -} -export type PowernukkitVersions = { - releases: Release[], - snapshots: Release[] -} - -function buildVersion(data: Release): powernukkitSchema|void { - let artefacts: {[key: string]: any} = {}; - data.artefacts.forEach(function(artefactId) { - artefacts[artefactId] = buildArtefactUrl(data, artefactId); - }); - if (data.commitId) { - artefacts["GIT_SOURCE"] = buildArtefactUrl(data, "GIT_SOURCE"); - } - if (!data.snapshotBuild) { - artefacts["ONLINE_DOC"] = buildArtefactUrl(data, "ONLINE_DOC"); - } - - const releaseTime = new Date(data.releaseTime); - let url = getBestDownloadUrl(artefacts); - if (!url) return; - const schema: powernukkitSchema = { - version: data.version, - mcpeVersion: data.minecraftVersion, - date: releaseTime, - latest: false, - variantType: data.snapshotBuild === undefined ? "stable":"snapshot", - url - }; - - return schema; -} - -function getBestDownloadUrl(artefacts): string { - if (artefacts.SHADED_JAR) { - return artefacts.SHADED_JAR; - } else { - return artefacts.REDUCED_JAR; - } -} - -function buildArtefactUrl(data: any, artefactId?: string): string|void { - if (artefactId == "GIT_SOURCE") { - return buildGitSourceUrl(data); - } else if (artefactId == "ONLINE_DOC") { - return buildOnlineDocUrl(data); - } else if (data.snapshotBuild) { - return buildSnapshotArtefactUrl(data, artefactId); - } else { - return buildReleaseArtefactUrl(data, artefactId); - } -} - -function buildOnlineDocUrl(data: any) { - if (data.snapshotBuild) { - if (data.artefacts.includes("JAVADOC_JAR")) { - return buildSnapshotArtefactUrl(data, "JAVADOC_JAR"); - } - } - return "https://devs.powernukkit.org/#javadoc"; -} - -function buildGitSourceUrl(data) { - if (data.commitId) { - return "https://github.com/PowerNukkit/PowerNukkit/tree/" + data.commitId; - } else if (data.snapshotBuild) { - if (data.artefacts.includes("SHADED_SOURCES_JAR")) { - return buildSnapshotArtefactUrl(data, "SHADED_SOURCES_JAR"); - } else if (data.artefacts.includes("REDUCED_SOURCES_JAR")) { - return buildSnapshotArtefactUrl(data, "REDUCED_SOURCES_JAR"); - } - } else { - if (data.artefacts.includes("SHADED_SOURCES_JAR")) { - return buildReleaseArtefactUrl(data, "SHADED_SOURCES_JAR"); - } else if (data.artefacts.includes("REDUCED_SOURCES_JAR")) { - return buildReleaseArtefactUrl(data, "REDUCED_SOURCES_JAR"); - } - } -} - -function buildReleaseArtefactUrl(data: any, artefactId?: string): string|void { - if (!data.artefacts.includes(artefactId)) { - return; - } - return "https://search.maven.org/remotecontent?filepath=org/powernukkit/powernukkit/" + - data.version + - "/powernukkit-" + - data.version + - getArtefactExtension(artefactId); -} - -function buildSnapshotArtefactUrl(data: any, artefactId?: string): string|void { - if (!data.artefacts.includes(artefactId)) { - return; - } - let dt = new Date(data.releaseTime); - let snapshotCode = dt.getUTCFullYear().toString().padStart(4, "0") + - (dt.getUTCMonth() + 1).toString().padStart(2, "0") + - dt.getUTCDate().toString().padStart(2, "0") + - "." + - dt.getUTCHours().toString().padStart(2, "0") + - dt.getUTCMinutes().toString().padStart(2, "0") + - dt.getUTCSeconds().toString().padStart(2, "0") + - "-" + - data.snapshotBuild; - let snapshotIndex = data.version.indexOf("-SNAPSHOT"); - let version = data.version.substring(0, snapshotIndex); - let extension = getArtefactExtension(artefactId); - return "https://oss.sonatype.org/content/repositories/snapshots/org/powernukkit/powernukkit" + - "/" + - version + "-SNAPSHOT" + - "/" + - "powernukkit-" + version + - "-" + - snapshotCode + - extension -} - -function getArtefactExtension(artefactId) { - let extension = ".unknown"; - switch (artefactId) { - case "REDUCED_JAR": extension = ".jar"; break; - case "REDUCED_SOURCES_JAR": extension = "-sources.jar"; break; - case "SHADED_JAR": extension = "-shaded.jar"; break; - case "SHADED_SOURCES_JAR": extension = "-shaded-sources.jar"; break; - case "JAVADOC_JAR": extension = "-javadoc.jar"; break; - } - return extension; -} - -export default async function find() { - const releases_version = await getJson(exportUrl) as PowernukkitVersions; - for (const stable of releases_version.releases) { - const data = buildVersion(stable); - if (!data) continue - if (await powernukkit.findOne({version: data.version}).lean()) continue; - await powernukkit.create(data); - console.log("Powernukkit stable add %s version to minecraft bedrock %s version", data.version, data.mcpeVersion); - } - for (const snapshot of releases_version.snapshots) { - const data = buildVersion(snapshot); - if (!data) continue - if (await powernukkit.findOne({version: data.version}).lean()) continue; - await powernukkit.create(data); - console.log("Powernukkit snapshort add %s version to minecraft bedrock %s version", data.version, data.mcpeVersion); - } - const oldLatest = await powernukkit.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); - const latestVersion = (await powernukkit.find({variantType: "stable"}).lean()).sort((b, a) => a.date.getTime()-b.date.getTime())[0]; - await powernukkit.findOneAndUpdate({version: latestVersion.version, variant: {variantType: "stable"}}, {$set: {latest: true}}).lean().catch(err => powernukkit.findOneAndUpdate({version: oldLatest.version}, {$set: {latest: true}}).lean().then(() => Promise.reject(err))); - return; -} diff --git a/src/lib/versions/fetchVersion/Spigot.ts b/src/lib/versions/fetchVersion/Spigot.ts deleted file mode 100644 index 7f43879..0000000 --- a/src/lib/versions/fetchVersion/Spigot.ts +++ /dev/null @@ -1,35 +0,0 @@ -import jsdom from "jsdom"; -import { bufferFetch } from "@http/simples"; -import {spigot} from "../db/spigot"; -export const urlRegex = /http[s]:\/\/.*/; -async function Find() { - const { document } = (new jsdom.JSDOM(await bufferFetch("https://getbukkit.org/download/spigot").then(({data}) => data.toString("utf8")).catch(err => {console.log(err); return ""}))).window; - const Versions = await Promise.all(([...(document.querySelectorAll("#download > div > div > div > div") as any)]).map(async DOM => { - const download = (new jsdom.JSDOM(await bufferFetch(DOM.querySelector("div > div.col-sm-4 > div.btn-group > a")["href"]).then(({data}) => data.toString("utf8")))); - const serverInfo = { - version: String(DOM.querySelector("div:nth-child(1) > h2").textContent), - Date: new Date(DOM.querySelector("div:nth-child(3) > h3").textContent), - url: download.window.document.querySelector("#get-download > div > div > div:nth-child(2) > div > h2 > a")["href"] - } - if (!urlRegex.test(serverInfo.url)||!serverInfo.url) return null; - return serverInfo; - })); - - for (const Version of Versions.filter(a => a)) { - if (await spigot.findOne({version: Version.version}).lean()) continue; - console.log("Spigot", Version.version, Version.url); - await spigot.create({ - version: Version.version, - date: Version.Date, - latest: false, - url: Version.url - }); - } - await spigot.findOneAndUpdate({latest: true}, {$set: {latest: false}}).lean(); - const latestVersion = (await spigot.find().lean()).sort((b, a) => a.date.getTime()-b.date.getTime())[0]; - await spigot.findByIdAndUpdate(latestVersion._id, {$set: {latest: true}}); -} - -export default async function UpdateDatabase() { - await Find(); -} diff --git a/src/lib/versions/fetchVersion/index.ts b/src/lib/versions/fetchVersion/index.ts deleted file mode 100644 index 3edcfa3..0000000 --- a/src/lib/versions/fetchVersion/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env node -import yargs from "yargs"; -import bedrock from "./Bedrock"; -import pocketmine from "./Pocketmine"; -import java from "./Java"; -import spigot from "./Spigot"; -import paper from "./Paper"; -import powernukkit from "./Powernukkit" - -const options = yargs(process.argv.slice(2)).help().version(false).alias("h", "help").wrap(yargs.terminalWidth()).options("all", { - description: "Fetch all plaftorms", - type: "boolean" -}).option("bedrock", { - description: "Fetch Bedrock versions", - type: "boolean" -}).option("java", { - description: "Fetch Java versions", - type: "boolean" -}).option("pocketmine", { - description: "Fetch Pocketmine-MP versions", - type: "boolean" -}).option("spigot", { - description: "Fetch Spigot versions", - type: "boolean" -}).option("paper", { - description: "Fetch Paper versions", - type: "boolean" -}).option("powernukkit", { - description: "Fetch Powernukkit versions", - type: "boolean" -}) -.parseSync(); - -async function all() { - await bedrock() - await java(); - await pocketmine(); - await spigot(); - await paper(); - await powernukkit(); -} - -if (options.bedrock) bedrock().then(() => {console.log("Bedrock sucess update"); process.exit(0)}).catch(err => {console.log("Bedrock catch Error: %s", String(err)); process.exit(1)}); -else if (options.java) java().then(() => {console.log("Java sucess update"); process.exit(0)}).catch(err => {console.log("Java catch Error: %s", String(err)); process.exit(1)}); -else if (options.spigot) spigot().then(() => {console.log("Spigot sucess update"); process.exit(0)}).catch(err => {console.log("Spigot catch Error: %s", String(err)); process.exit(1)}); -else if (options.pocketmine) pocketmine().then(() => {console.log("Pocketmine sucess update"); process.exit(0)}).catch(err => {console.log("Pocketmine catch Error: %s", String(err)); process.exit(1)}); -else if (options.paper) paper().then(() => {console.log("Paper sucess update"); process.exit(0)}).catch(err => {console.log("Paper catch Error: %s", String(err)); process.exit(1)}); -else if (options.powernukkit) powernukkit().then(() => {console.log("Powernukkit sucess update"); process.exit(0)}).catch(err => {console.log("Powernukkit catch Error: %s", String(err)); process.exit(1)}); -else if (options.all) all().then(() => process.exit(0)).catch(err => {console.trace(err); process.exit(1)}); -else { - console.log("No options set"); - process.exit(1); -} \ No newline at end of file diff --git a/src/lib/versions/fetchVersion/types/Java.ts b/src/lib/versions/fetchVersion/types/Java.ts deleted file mode 100644 index 5944691..0000000 --- a/src/lib/versions/fetchVersion/types/Java.ts +++ /dev/null @@ -1,165 +0,0 @@ -export type javaRelease = { - arguments: { - game: Array - jvm: [ - { - rules: Array<{ - action: string - os: { - name: string - } - }> - value: Array - }, - { - rules: Array<{ - action: string - os: { - name: string - } - }> - value: string - }, - { - rules: Array<{ - action: string - os: { - name: string - version: string - } - }> - value: Array - }, - { - rules: Array<{ - action: string - os: { - arch: string - } - }> - value: string - }, - string, - string, - string, - string, - string - ] - } - assetIndex: { - id: string - sha1: string - size: number - totalSize: number - url: string - } - assets: string - complianceLevel: number - downloads: { - client: { - sha1: string - size: number - url: string - } - client_mappings: { - sha1: string - size: number - url: string - } - server: { - sha1: string - size: number - url: string - } - server_mappings: { - sha1: string - size: number - url: string - } - } - id: string - javaVersion: { - component: string - majorVersion: number - } - libraries: Array<{ - downloads: { - artifact: { - path: string - sha1: string - size: number - url: string - } - classifiers?: { - javadoc?: { - path: string - sha1: string - size: number - url: string - } - "natives-osx"?: { - path: string - sha1: string - size: number - url: string - } - sources?: { - path: string - sha1: string - size: number - url: string - } - "natives-linux"?: { - path: string - sha1: string - size: number - url: string - } - "natives-windows"?: { - path: string - sha1: string - size: number - url: string - } - "natives-macos"?: { - path: string - sha1: string - size: number - url: string - } - } - } - name: string - rules?: Array<{ - action: string - os?: { - name: string - } - }> - natives?: { - osx?: string - linux?: string - windows?: string - } - extract?: { - exclude: Array - } - }> - logging: { - client: { - argument: string - file: { - id: string - sha1: string - size: number - url: string - } - type: string - } - } - mainClass: string - minimumLauncherVersion: number - releaseTime: string - time: string - type: string -} \ No newline at end of file diff --git a/src/lib/versions/index.ts b/src/lib/versions/index.ts deleted file mode 100644 index 5ef0177..0000000 --- a/src/lib/versions/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { bufferFetch } from "@http/simples" -import type { bedrockSchema } from "./db/bedrock"; -import type { javaSchema } from "./db/java"; -import type { paperSchema } from "./db/paper"; -import type { powernukkitSchema } from "./db/powernukkit"; -import type { pocketminemmpSchema } from "./db/pocketmine"; -import type { spigotSchema } from "./db/spigot"; - -export type BdsCorePlatforms = "bedrock"|"java"|"paper"|"powernukkit"|"pocketmine"|"spigot"; -export type all = bedrockSchema|javaSchema|powernukkitSchema|paperSchema|pocketminemmpSchema|spigotSchema -export type { - bedrockSchema as bedrock, - javaSchema as java, - paperSchema as paper, - pocketminemmpSchema as pocketmine, - spigotSchema as spigot, - powernukkitSchema as powernukkit -} - -export async function findVersion(bdsPlaform: BdsCorePlatforms): Promise; -export async function findVersion(bdsPlaform: BdsCorePlatforms, version: string|boolean): Promise; -export async function findVersion(bdsPlaform: BdsCorePlatforms, version: string|boolean, ignoreStatic: boolean): Promise; -export async function findVersion(bdsPlaform: BdsCorePlatforms, version?: string|boolean, ignoreStatic?: boolean): Promise { - const versionURLs = ["https://mcpeversions_backup.sirherobrine23.org", "https://mcpeversions.sirherobrine23.org"]; - if (!ignoreStatic) versionURLs.push("https://mcpeversion-static.sirherobrine23.org/"); else console.warn("Using dynamic APIs, some may be down!"); - for (let url of versionURLs.reverse()) { - url += "/"+bdsPlaform; - if (/static/.test(url)) { - if (version === undefined) url += "/all.json"; - else if (typeof version === "boolean") url += "/latest.json"; - else url += `/${version}.json`; - } else { - if (version === undefined||version === "all") url += "/"; - else { - if (typeof version === "boolean"||version === "latest") url += "/latest"; - else url += `/search?version=${version}`; - } - } - const res = await bufferFetch(url).then(({data}) => data).catch(() => false); - if (res === false) continue; - const data = JSON.parse(res.toString("utf8"), (key, value) => key === "date" ? new Date(value):value); - if (!data) throw new Error("Failed to get data"); - return data; - } - throw new Error("Failed to exec API request!"); -} - -export const platformManeger = { - bedrock: { - async all(){return findVersion("bedrock");}, - async find(version: string|boolean){return findVersion("bedrock", version);} - }, - pocketmine: { - async all(){return findVersion("pocketmine");}, - async find(version: string|boolean){return findVersion("pocketmine", version);} - }, - powernukkit: { - async all(){return findVersion("powernukkit");}, - async find(version: string|boolean){return findVersion("powernukkit", version);} - }, - java: { - async all(){return findVersion("java");}, - async find(version: string|boolean){return findVersion("java", version);} - }, - spigot: { - async all(){return findVersion("spigot");}, - async find(version: string|boolean){return findVersion("spigot", version);} - }, - paper: { - async all(){return findVersion("paper");}, - async find(version: string|boolean, build?: number|string){ - if (!build) build = (await findVersion("paper")).find(ver => ver.version === version)?.build; - return findVersion("paper", `${version}${!!build?"_"+build:""}`); - } - } -}; diff --git a/src/lib/request/client.ts b/src/request/client.ts similarity index 100% rename from src/lib/request/client.ts rename to src/request/client.ts diff --git a/src/lib/request/github.ts b/src/request/github.ts similarity index 100% rename from src/lib/request/github.ts rename to src/request/github.ts diff --git a/src/lib/request/large.ts b/src/request/large.ts similarity index 100% rename from src/lib/request/large.ts rename to src/request/large.ts diff --git a/src/lib/request/simples.ts b/src/request/simples.ts similarity index 70% rename from src/lib/request/simples.ts rename to src/request/simples.ts index 57c2fe0..e947ee3 100644 --- a/src/lib/request/simples.ts +++ b/src/request/simples.ts @@ -2,18 +2,20 @@ import type { Method } from "got"; import * as fs from "node:fs"; import * as stream from "node:stream"; -const UserAgent = "Mozilla/5.0 (Linux; Android 12; moto g(7) plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36"; - -export let got; +export let got: (typeof import("got"))["default"]; async function gotCjs(): Promise<(typeof import("got"))["default"]> { if (got) return got; - const dyImport = (await (eval('import("got")') as Promise)).default.extend({enableUnixSockets: true, headers: {"User-Agent": UserAgent, "USER-AGENT": UserAgent, "user-agent": UserAgent}}); + const dyImport = (await (eval('import("got")') as Promise)).default.extend({ + enableUnixSockets: true, + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", + "Accept": "*/*" + } + }); got = dyImport; return dyImport; } -gotCjs().then(res => got = res); - export type requestOptions = { url?: string, socket?: { @@ -32,7 +34,7 @@ export async function pipeFetch(options: requestOptions & {stream: fs.WriteStrea isStream: true, headers: options.headers||{}, method: options.method||"GET", - json: options.body, + ...((options.method||"GET").toLowerCase()!=="get"?(typeof options.body === "string"?{body: options.body}:{json: options.body}):{}), }); await new Promise((done, reject) => { gotStream.pipe(options.stream); @@ -50,21 +52,18 @@ export async function bufferFetch(options: string|requestOptions) { if (!(options.url||options.socket)) throw new Error("Host blank") const urlRequest = (typeof options.url === "string")?options.url:`http://unix:${options.socket.socketPath}:${options.socket.path||"/"}`; return (await gotCjs())(urlRequest, { + responseType: "buffer", headers: options.headers||{}, method: options.method||"GET", - json: options.body, - responseType: "buffer", + ...((options.method||"GET").toLowerCase()!=="get"?(typeof options.body === "string"?{body: options.body}:{json: options.body}):{}), }).then(res => ({headers: res.headers, data: Buffer.from(res.body), response: res})); } export async function getJSON(request: string|requestOptions): Promise { - if (typeof request === "string") request = {url: request}; - const res = (await bufferFetch(request)).data.toString("utf8"); - return JSON.parse(res) as JSONReturn; + return bufferFetch(request).then(({data}) => JSON.parse(data.toString("utf8")) as JSONReturn) } -const httpUrl = /^http[s]:\/\/[a-z0-9\.\-_]+(|\/([\s\W\S]+?))/; export async function urls(options: requestOptions|string): Promise { const data = (await bufferFetch(options)).data.toString("utf8"); - return data.split(/["'<>]/gi).filter(line => httpUrl.test(line)) -} + return (data.match(/((http[s]):(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))/g)).map(res => typeof res === "string"?res:res[1]); +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index e0af647..b4ac188 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "baseUrl": ".", "paths": { "@http/*": [ - "src/lib/request/*" + "src/request/*" ] } }, -- 2.45.2 From ccb60370a3081417521c980042ba7b2123863b58 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Sun, 6 Nov 2022 15:40:43 +0000 Subject: [PATCH 5/5] Fix large.ts --- src/request/large.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/request/large.ts b/src/request/large.ts index 0bc6e46..a8e9312 100644 --- a/src/request/large.ts +++ b/src/request/large.ts @@ -5,7 +5,7 @@ import path from "node:path"; import crypto from "node:crypto"; import tar from "tar"; import AdmZip from "adm-zip"; -import { exists } from "../extendsFs"; +import { exists } from "../lib/extendsFs"; export async function saveFile(request: string|requestOptions & {filePath?: string}) { if (typeof request === "string") request = {url: request}; -- 2.45.2