From d96fb38aa13260e1597ab5cf14e89f727f6400f7 Mon Sep 17 00:00:00 2001 From: cyclane Date: Sun, 18 Jul 2021 21:13:00 +0100 Subject: [PATCH] big commit without a message --- package-lock.json | 143 ++++++++++++++++++ package.json | 6 + src/components/Graphs.svelte | 25 +-- src/components/Navbar.svelte | 35 ++++- src/components/stores.ts | 25 +++ src/lib/api.ts | 80 +++++++++- src/lib/butil.ts | 1 + src/lib/hypixel.ts | 34 ++++- src/lib/permissions.ts | 3 +- src/logger.ts | 47 +++++- src/routes/_layout.svelte | 4 +- src/routes/api/_types.ts | 24 ++- src/routes/api/graphs.ts | 98 +++++++++++- .../api/graphs/[graph]/[profile]/[player].ts | 54 +++++++ src/routes/api/permissions.ts | 11 ++ src/routes/api/profiles.ts | 4 +- src/routes/api/profiles/[player].ts | 9 +- .../profiles/[player]/[profile]/cute-name.ts | 42 +++++ src/routes/graph/new.svelte | 97 ++++++++++++ src/routes/index.svelte | 70 +-------- .../profile/[profile]/member/[member].svelte | 22 +++ .../member/[member]/graph/[graph].svelte | 75 +++++++++ src/routes/profile/new.svelte | 2 +- src/routes/profiles.svelte | 75 +++++++++ src/server.ts | 12 +- src/styles/CodeForm.scss | 4 + src/styles/Form.scss | 5 +- src/styles/GridItems.scss | 18 +++ src/styles/GridList.scss | 18 --- 29 files changed, 919 insertions(+), 124 deletions(-) create mode 100644 src/routes/api/graphs/[graph]/[profile]/[player].ts create mode 100644 src/routes/api/permissions.ts create mode 100644 src/routes/api/profiles/[player]/[profile]/cute-name.ts create mode 100644 src/routes/graph/new.svelte create mode 100644 src/routes/profile/[profile]/member/[member]/graph/[graph].svelte create mode 100644 src/routes/profiles.svelte create mode 100644 src/styles/CodeForm.scss create mode 100644 src/styles/GridItems.scss diff --git a/package-lock.json b/package-lock.json index a5c5b38..c7a8de7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,12 @@ "bcrypt": "^5.0.1", "compression": "^1.7.1", "cookie": "^0.4.0", + "echarts": "^5.1.2", "hat": "^0.0.3", + "json-bigint": "^1.0.0", + "nbt-ts": "^1.3.3", "node-fetch": "^2.6.1", + "node-gzip": "^1.1.2", "polka": "^0.5.2", "sirv": "^1.0.0" }, @@ -34,7 +38,9 @@ "@types/compression": "^1.7.0", "@types/cookie": "^0.4.0", "@types/hat": "^0.0.1", + "@types/json-bigint": "^1.0.1", "@types/node": "^14.11.1", + "@types/node-gzip": "^1.1.0", "@types/polka": "^0.5.1", "rollup": "^2.3.4", "rollup-plugin-svelte": "^7.0.0", @@ -1864,6 +1870,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/json-bigint": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.1.tgz", + "integrity": "sha512-zpchZLNsNuzJHi6v64UBoFWAvQlPhch7XAi36FkH6tL1bbbmimIF+cS7vwkzY4u5RaSWMoflQfu+TshMPPw8uw==", + "dev": true + }, "node_modules/@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -1875,6 +1887,15 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.4.tgz", "integrity": "sha512-8kQ3+wKGRNN0ghtEn7EGps/B8CzuBz1nXZEIGGLP2GnwbqYn4dbTs7k+VKLTq1HvZLRCIDtN3Snx1Ege8B7L5A==" }, + "node_modules/@types/node-gzip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@types/node-gzip/-/node-gzip-1.1.0.tgz", + "integrity": "sha512-j7cGb6HIOZbDx3sqe9/9VAPeSvyt143yu5k35gzRXE3mxEgK6BOZ6BAiJ3ToXBcJqLzL9Cr53dav21jlp3f9gw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/polka": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@types/polka/-/polka-0.5.2.tgz", @@ -2095,6 +2116,14 @@ "node": ">= 10.0.0" } }, + "node_modules/bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -2490,6 +2519,20 @@ "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" }, + "node_modules/echarts": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.1.2.tgz", + "integrity": "sha512-okUhO4sw22vwZp+rTPNjd/bvTdpug4K4sHNHyrV8NdAncIX9/AarlolFqtJCAYKGFYhUBNjIWu1EznFrSWTFxg==", + "dependencies": { + "tslib": "2.0.3", + "zrender": "5.1.1" + } + }, + "node_modules/echarts/node_modules/tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + }, "node_modules/electron-to-chromium": { "version": "1.3.768", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.768.tgz", @@ -2947,6 +2990,14 @@ "node": ">=4" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json5": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", @@ -3169,6 +3220,11 @@ "node": ">=8.3.0" } }, + "node_modules/nbt-ts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/nbt-ts/-/nbt-ts-1.3.3.tgz", + "integrity": "sha512-xmEVWDJzO7YdA2YJHqAkfiOKlKECXe/hfNB10t3W7aDJsCXTjXyRbhP5HYvCwrMefGk8p6arQqeMO2V6djyfxQ==" + }, "node_modules/negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -3199,6 +3255,11 @@ "node": "4.x || >=6.0.0" } }, + "node_modules/node-gzip": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/node-gzip/-/node-gzip-1.1.2.tgz", + "integrity": "sha512-ZB6zWpfZHGtxZnPMrJSKHVPrRjURoUzaDbLFj3VO70mpLTW5np96vXyHwft4Id0o+PYIzgDkBUjIzaNHhQ8srw==" + }, "node_modules/node-releases": { "version": "1.1.73", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", @@ -4196,6 +4257,19 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/zrender": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.1.1.tgz", + "integrity": "sha512-oeWlmUZPQdS9f5hK4pV21tHPqA3wgQ7CkKkw7l0CCBgWlJ/FP+lRgLFtUBW6yam4JX8y9CdHJo1o587VVrbcoQ==", + "dependencies": { + "tslib": "2.0.3" + } + }, + "node_modules/zrender/node_modules/tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" } }, "dependencies": { @@ -5481,6 +5555,12 @@ "integrity": "sha512-GQoFDN07Knft7pvik72m/ddy8wmwMykzJEPZLoT7Wp3PHZsttdAbQ51qKf1DLWAdU6Ac31xon1Ji3g0hqQv6sw==", "dev": true }, + "@types/json-bigint": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.1.tgz", + "integrity": "sha512-zpchZLNsNuzJHi6v64UBoFWAvQlPhch7XAi36FkH6tL1bbbmimIF+cS7vwkzY4u5RaSWMoflQfu+TshMPPw8uw==", + "dev": true + }, "@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -5492,6 +5572,15 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.4.tgz", "integrity": "sha512-8kQ3+wKGRNN0ghtEn7EGps/B8CzuBz1nXZEIGGLP2GnwbqYn4dbTs7k+VKLTq1HvZLRCIDtN3Snx1Ege8B7L5A==" }, + "@types/node-gzip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@types/node-gzip/-/node-gzip-1.1.0.tgz", + "integrity": "sha512-j7cGb6HIOZbDx3sqe9/9VAPeSvyt143yu5k35gzRXE3mxEgK6BOZ6BAiJ3ToXBcJqLzL9Cr53dav21jlp3f9gw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/polka": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@types/polka/-/polka-0.5.2.tgz", @@ -5681,6 +5770,11 @@ "node-addon-api": "^3.1.0" } }, + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -5988,6 +6082,22 @@ "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" }, + "echarts": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.1.2.tgz", + "integrity": "sha512-okUhO4sw22vwZp+rTPNjd/bvTdpug4K4sHNHyrV8NdAncIX9/AarlolFqtJCAYKGFYhUBNjIWu1EznFrSWTFxg==", + "requires": { + "tslib": "2.0.3", + "zrender": "5.1.1" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } + } + }, "electron-to-chromium": { "version": "1.3.768", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.768.tgz", @@ -6335,6 +6445,14 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, "json5": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", @@ -6497,6 +6615,11 @@ "resolved": "https://registry.npmjs.org/multi-part-lite/-/multi-part-lite-1.0.0.tgz", "integrity": "sha512-KxIRbBZZ45hoKX1ROD/19wJr0ql1bef1rE8Y1PCwD3PuNXV42pp7Wo8lEHYuAajoT4vfAFcd3rPjlkyEEyt1nw==" }, + "nbt-ts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/nbt-ts/-/nbt-ts-1.3.3.tgz", + "integrity": "sha512-xmEVWDJzO7YdA2YJHqAkfiOKlKECXe/hfNB10t3W7aDJsCXTjXyRbhP5HYvCwrMefGk8p6arQqeMO2V6djyfxQ==" + }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -6521,6 +6644,11 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, + "node-gzip": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/node-gzip/-/node-gzip-1.1.2.tgz", + "integrity": "sha512-ZB6zWpfZHGtxZnPMrJSKHVPrRjURoUzaDbLFj3VO70mpLTW5np96vXyHwft4Id0o+PYIzgDkBUjIzaNHhQ8srw==" + }, "node-releases": { "version": "1.1.73", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", @@ -7259,6 +7387,21 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "zrender": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.1.1.tgz", + "integrity": "sha512-oeWlmUZPQdS9f5hK4pV21tHPqA3wgQ7CkKkw7l0CCBgWlJ/FP+lRgLFtUBW6yam4JX8y9CdHJo1o587VVrbcoQ==", + "requires": { + "tslib": "2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } + } } } } diff --git a/package.json b/package.json index 467c41f..1f5de96 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,12 @@ "bcrypt": "^5.0.1", "compression": "^1.7.1", "cookie": "^0.4.0", + "echarts": "^5.1.2", "hat": "^0.0.3", + "json-bigint": "^1.0.0", + "nbt-ts": "^1.3.3", "node-fetch": "^2.6.1", + "node-gzip": "^1.1.2", "polka": "^0.5.2", "sirv": "^1.0.0" }, @@ -37,7 +41,9 @@ "@types/compression": "^1.7.0", "@types/cookie": "^0.4.0", "@types/hat": "^0.0.1", + "@types/json-bigint": "^1.0.1", "@types/node": "^14.11.1", + "@types/node-gzip": "^1.1.0", "@types/polka": "^0.5.1", "rollup": "^2.3.4", "rollup-plugin-svelte": "^7.0.0", diff --git a/src/components/Graphs.svelte b/src/components/Graphs.svelte index f394472..ed0dc70 100644 --- a/src/components/Graphs.svelte +++ b/src/components/Graphs.svelte @@ -1,4 +1,5 @@