mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-28 00:54:16 +00:00
update node types to v18, ditch node-fetch
This commit is contained in:
+2
-4
@@ -39,6 +39,7 @@
|
||||
"@babel/core": "^7.18.9",
|
||||
"@babel/preset-env": "^7.18.9",
|
||||
"@babel/preset-typescript": "^7.15.0",
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/bcrypt": "^5.0.0",
|
||||
"@types/express": "^4.17.9",
|
||||
@@ -48,10 +49,8 @@
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/morgan": "^1.9.3",
|
||||
"@types/multer": "^1.4.5",
|
||||
"@types/node": "^14.18.22",
|
||||
"@types/node-fetch": "^2.5.5",
|
||||
"@types/node": "^18.0.6",
|
||||
"@types/supertest": "^2.0.11",
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"jest": "^28.1.3",
|
||||
"jest-expect-message": "^1.0.2",
|
||||
"jest-runtime": "^28.1.3",
|
||||
@@ -86,7 +85,6 @@
|
||||
"morgan": "^1.10.0",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"node-2fa": "^2.0.3",
|
||||
"node-fetch": "^3.2.9",
|
||||
"patch-package": "^6.4.7",
|
||||
"picocolors": "^1.0.0",
|
||||
"proxy-agent": "^5.0.0",
|
||||
|
||||
Generated
BIN
Binary file not shown.
+2
-4
@@ -29,6 +29,7 @@
|
||||
"@babel/core": "^7.18.9",
|
||||
"@babel/preset-env": "^7.18.9",
|
||||
"@babel/preset-typescript": "^7.15.0",
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/bcrypt": "^5.0.0",
|
||||
"@types/body-parser": "^1.19.0",
|
||||
@@ -42,12 +43,10 @@
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/morgan": "^1.9.3",
|
||||
"@types/multer": "^1.4.7",
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"@types/node": "^18.0.6",
|
||||
"@types/node-os-utils": "^1.2.0",
|
||||
"@types/supertest": "^2.0.11",
|
||||
"@types/ws": "^8.5.3",
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"jest": "^28.1.3",
|
||||
"jest-expect-message": "^1.0.2",
|
||||
"jest-runtime": "^28.1.3",
|
||||
@@ -98,7 +97,6 @@
|
||||
"nan": "^2.15.0",
|
||||
"nanocolors": "^0.2.12",
|
||||
"node-2fa": "^2.0.3",
|
||||
"node-fetch": "^3.2.9",
|
||||
"node-os-utils": "^1.3.5",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.3",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
|
||||
"lib": [
|
||||
"ES2021"
|
||||
"ESNext"
|
||||
] /* Specify library files to be included in the compilation. */,
|
||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||
"checkJs": true /* Report errors in .js files. */,
|
||||
|
||||
+2
-4
@@ -21,6 +21,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/fosscord/fosscord-server#readme",
|
||||
"devDependencies": {
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/body-parser": "^1.19.0",
|
||||
"@types/btoa": "^1.2.3",
|
||||
@@ -29,9 +30,7 @@
|
||||
"@types/fs-extra": "^9.0.12",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/multer": "^1.4.7",
|
||||
"@types/node": "^14.17.0",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"@types/node": "^18.0.6",
|
||||
"ts-patch": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -54,7 +53,6 @@
|
||||
"missing-native-js-functions": "^1.2.17",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"nanocolors": "^0.2.12",
|
||||
"node-fetch": "^3.2.9",
|
||||
"supertest": "^6.1.6",
|
||||
"typescript": "^4.1.2"
|
||||
},
|
||||
|
||||
@@ -15,12 +15,11 @@
|
||||
"author": "Fosscord",
|
||||
"license": "AGPL-3.0-only",
|
||||
"devDependencies": {
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"@types/node": "^18.0.6",
|
||||
"@types/ws": "^8.5.3",
|
||||
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
||||
"ts-node-dev": "^2.0.0",
|
||||
"ts-patch": "^2.0.1",
|
||||
"typescript": "^4.2.3"
|
||||
@@ -32,7 +31,6 @@
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"lambert-server": "^1.2.11",
|
||||
"missing-native-js-functions": "^1.2.18",
|
||||
"node-fetch": "^3.2.9",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"typeorm": "^0.3.7",
|
||||
"ws": "^8.8.1"
|
||||
|
||||
Generated
BIN
Binary file not shown.
Generated
BIN
Binary file not shown.
+2
-7
@@ -32,8 +32,7 @@
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/jsonwebtoken": "^8.5.8",
|
||||
"@types/multer": "^1.4.7",
|
||||
"@types/node": "^14.18.22",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/node": "^18.0.6",
|
||||
"jest": "^28.1.3",
|
||||
"ts-node": "^10.2.1"
|
||||
},
|
||||
@@ -44,15 +43,11 @@
|
||||
"lambert-server": "^1.2.12",
|
||||
"missing-native-js-functions": "^1.2.18",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"node-fetch": "^3.2.9",
|
||||
"patch-package": "^6.4.7",
|
||||
"pg": "^8.7.3",
|
||||
"picocolors": "^1.0.0",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"typeorm": "^0.3.7",
|
||||
"typescript": "^4.7.4",
|
||||
"typescript-json-schema": "^0.54.0"
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"jest": {
|
||||
"setupFilesAfterEnv": [
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export default fetch;
|
||||
@@ -4,3 +4,4 @@ export * from "./util/index";
|
||||
export * from "./interfaces/index";
|
||||
export * from "./entities/index";
|
||||
export * from "./dtos/index";
|
||||
export * from "./fetch.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import "missing-native-js-functions";
|
||||
import fetch from "node-fetch";
|
||||
import fetch from "../fetch";
|
||||
import ProxyAgent from 'proxy-agent';
|
||||
import readline from "readline";
|
||||
import fs from "fs/promises";
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import FormData from "form-data";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import fetch from "node-fetch";
|
||||
import { Config } from "./Config";
|
||||
import multer from "multer";
|
||||
import fetch from "../fetch"
|
||||
import { nodeModuleNameResolver } from "typescript";
|
||||
|
||||
export async function uploadFile(path: string, file?: Express.Multer.File) {
|
||||
if (!file?.buffer) throw new HTTPError("Missing file in body");
|
||||
|
||||
Reference in New Issue
Block a user