From 4ccae56210bfc5e0c0a0b863cac02596674ab5a0 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 18 Jul 2022 21:56:07 +0200 Subject: Update packages --- api/package-lock.json | 2 +- api/package.json | 40 ++++++++++------------ api/patches/typescript-json-schema+0.50.1.patch | 14 -------- api/patches/typescript-json-schema+0.54.0.patch | 14 ++++++++ .../#channel_id/messages/#message_id/index.ts | 2 +- .../routes/channels/#channel_id/messages/index.ts | 2 +- api/src/routes/gifs/search.ts | 2 +- api/src/routes/gifs/trending-gifs.ts | 2 +- api/src/routes/gifs/trending.ts | 4 +-- api/src/util/utility/ipAddress.ts | 2 +- api/tsconfig.json | 2 +- 11 files changed, 42 insertions(+), 44 deletions(-) delete mode 100644 api/patches/typescript-json-schema+0.50.1.patch create mode 100644 api/patches/typescript-json-schema+0.54.0.patch (limited to 'api') diff --git a/api/package-lock.json b/api/package-lock.json index 4e65e886..bb7f725f 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -58,7 +58,7 @@ "@types/node": "^14.18.22", "@types/node-fetch": "^2.5.5", "@types/supertest": "^2.0.11", - "@zerollup/ts-transform-paths": "^1.7.18", + "@ovos-media/ts-transform-paths": "^1.7.18-1", "jest": "^27.2.5", "jest-expect-message": "^1.0.2", "jest-runtime": "^27.2.1", diff --git a/api/package.json b/api/package.json index 48a857b1..8f9d1c8f 100644 --- a/api/package.json +++ b/api/package.json @@ -36,14 +36,14 @@ }, "homepage": "https://fosscord.com", "devDependencies": { - "@babel/core": "^7.15.5", - "@babel/preset-env": "^7.15.8", + "@babel/core": "^7.18.9", + "@babel/preset-env": "^7.18.9", "@babel/preset-typescript": "^7.15.0", "@types/amqplib": "^0.8.1", "@types/bcrypt": "^5.0.0", "@types/express": "^4.17.9", "@types/i18next-node-fs-backend": "^2.1.0", - "@types/jest": "^27.0.1", + "@types/jest": "^28.1.6", "@types/jest-expect-message": "^1.0.3", "@types/jsonwebtoken": "^8.5.0", "@types/morgan": "^1.9.3", @@ -51,34 +51,32 @@ "@types/node": "^14.18.22", "@types/node-fetch": "^2.5.5", "@types/supertest": "^2.0.11", - "@zerollup/ts-transform-paths": "^1.7.18", - "jest": "^27.2.5", + "@ovos-media/ts-transform-paths": "^1.7.18-1", + "jest": "^28.1.3", "jest-expect-message": "^1.0.2", - "jest-runtime": "^27.2.1", - "ts-node": "^9.1.1", - "ts-node-dev": "^1.1.6", - "ts-patch": "^1.4.4", + "jest-runtime": "^28.1.3", + "ts-node": "^10.9.1", + "ts-node-dev": "^2.0.0", + "ts-patch": "^2.0.1", "typescript": "^4.4.2", - "typescript-json-schema": "0.50.1" + "typescript-json-schema": "^0.54.0" }, "dependencies": { - "@babel/preset-env": "^7.15.8", "@babel/preset-typescript": "^7.15.0", "@fosscord/util": "file:../util", - "@sentry/node": "^6.16.1", - "@sentry/tracing": "^6.16.1", - "@yukikaze-bot/erlpack": "^1.0.1", + "@sentry/node": "^7.7.0", + "@sentry/tracing": "^7.7.0", "ajv": "8.6.2", "ajv-formats": "^2.1.1", - "amqplib": "^0.8.0", - "assert": "^1.5.0", + "amqplib": "^0.10.0", + "assert": "^2.0.0", "bcrypt": "^5.0.1", "body-parser": "^1.19.0", "cheerio": "^1.0.0-rc.10", - "dotenv": "^8.2.0", + "dotenv": "^16.0.1", "express": "^4.17.1", - "form-data": "^3.0.0", - "i18next": "^19.9.2", + "form-data": "^4.0.0", + "i18next": "^21.8.14", "i18next-http-middleware": "^3.1.3", "i18next-node-fs-backend": "^2.1.3", "image-size": "^1.0.0", @@ -86,9 +84,9 @@ "lambert-server": "^1.2.12", "missing-native-js-functions": "^1.2.18", "morgan": "^1.10.0", - "multer": "^1.4.2", + "multer": "^1.4.5-lts.1", "node-2fa": "^2.0.3", - "node-fetch": "^2.6.2", + "node-fetch": "^3.2.9", "patch-package": "^6.4.7", "picocolors": "^1.0.0", "proxy-agent": "^5.0.0", diff --git a/api/patches/typescript-json-schema+0.50.1.patch b/api/patches/typescript-json-schema+0.50.1.patch deleted file mode 100644 index a0d479de..00000000 --- a/api/patches/typescript-json-schema+0.50.1.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/node_modules/typescript-json-schema/dist/typescript-json-schema.js b/node_modules/typescript-json-schema/dist/typescript-json-schema.js -index 47e1598..8397b9d 100644 ---- a/node_modules/typescript-json-schema/dist/typescript-json-schema.js -+++ b/node_modules/typescript-json-schema/dist/typescript-json-schema.js -@@ -432,6 +432,9 @@ var JsonSchemaGenerator = (function () { - else if (flags & ts.TypeFlags.Boolean) { - definition.type = "boolean"; - } -+ else if (flags & ts.TypeFlags.BigInt) { -+ definition.type = "bigint"; -+ } - else if (flags & ts.TypeFlags.Null) { - definition.type = "null"; - } diff --git a/api/patches/typescript-json-schema+0.54.0.patch b/api/patches/typescript-json-schema+0.54.0.patch new file mode 100644 index 00000000..2a319ec4 --- /dev/null +++ b/api/patches/typescript-json-schema+0.54.0.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/typescript-json-schema/dist/typescript-json-schema.js b/node_modules/typescript-json-schema/dist/typescript-json-schema.js +index 78f97ba..790c516 100644 +--- a/node_modules/typescript-json-schema/dist/typescript-json-schema.js ++++ b/node_modules/typescript-json-schema/dist/typescript-json-schema.js +@@ -453,6 +453,9 @@ var JsonSchemaGenerator = (function () { + else if (flags & ts.TypeFlags.Boolean) { + definition.type = "boolean"; + } ++ else if (flags & ts.TypeFlags.BigInt) { ++ definition.type = "bigint"; ++ } + else if (flags & ts.TypeFlags.Null) { + definition.type = "null"; + } diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts index 1f5b68c2..b7f1e130 100644 --- a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts +++ b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts @@ -116,7 +116,7 @@ router.put( if (req.file) { try { - const file = await uploadFile(`/attachments/${req.params.channel_id}`, req.file); + const file: any = await uploadFile(`/attachments/${req.params.channel_id}`, req.file); attachments.push({ ...file, proxy_url: file.url }); } catch (error) { return res.status(400).json(error); diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts index 1ed6080e..6d4d5794 100644 --- a/api/src/routes/channels/#channel_id/messages/index.ts +++ b/api/src/routes/channels/#channel_id/messages/index.ts @@ -200,7 +200,7 @@ router.post( const files = req.files as Express.Multer.File[] ?? []; for (let currFile of files) { try { - const file = await uploadFile(`/attachments/${channel.id}`, currFile); + const file: any = await uploadFile(`/attachments/${channel.id}`, currFile); attachments.push({ ...file, proxy_url: file.url }); } catch (error) { diff --git a/api/src/routes/gifs/search.ts b/api/src/routes/gifs/search.ts index 9ad7a592..1099dc4a 100644 --- a/api/src/routes/gifs/search.ts +++ b/api/src/routes/gifs/search.ts @@ -20,7 +20,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { headers: { "Content-Type": "application/json" } }); - const { results } = await response.json(); + const { results } = await response.json() as any; res.json(results.map(parseGifResult)).status(200); }); diff --git a/api/src/routes/gifs/trending-gifs.ts b/api/src/routes/gifs/trending-gifs.ts index 6d97bf7c..2b28d9d2 100644 --- a/api/src/routes/gifs/trending-gifs.ts +++ b/api/src/routes/gifs/trending-gifs.ts @@ -20,7 +20,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { headers: { "Content-Type": "application/json" } }); - const { results } = await response.json(); + const { results } = await response.json() as any; res.json(results.map(parseGifResult)).status(200); }); diff --git a/api/src/routes/gifs/trending.ts b/api/src/routes/gifs/trending.ts index c81b4c08..bc143f00 100644 --- a/api/src/routes/gifs/trending.ts +++ b/api/src/routes/gifs/trending.ts @@ -50,8 +50,8 @@ router.get("/", route({}), async (req: Request, res: Response) => { }) ]); - const { tags } = await responseSource.json(); - const { results } = await trendGifSource.json(); + const { tags } = await responseSource.json() as any; + const { results } = await trendGifSource.json() as any; res.json({ categories: tags.map((x: any) => ({ name: x.searchterm, src: x.image })), diff --git a/api/src/util/utility/ipAddress.ts b/api/src/util/utility/ipAddress.ts index 13cc9603..8d986b26 100644 --- a/api/src/util/utility/ipAddress.ts +++ b/api/src/util/utility/ipAddress.ts @@ -65,7 +65,7 @@ export async function IPAnalysis(ip: string): Promise { const { ipdataApiKey } = Config.get().security; if (!ipdataApiKey) return { ...exampleData, ip }; - return (await fetch(`https://api.ipdata.co/${ip}?api-key=${ipdataApiKey}`)).json(); + return (await fetch(`https://api.ipdata.co/${ip}?api-key=${ipdataApiKey}`)).json() as any; } export function isProxy(data: typeof exampleData) { diff --git a/api/tsconfig.json b/api/tsconfig.json index 80d7251f..91396aa8 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -69,7 +69,7 @@ "paths": { "@fosscord/api": ["src/index"] }, - "plugins": [{ "transform": "@zerollup/ts-transform-paths" }], + "plugins": [{ "transform": "@ovos-media/ts-transform-paths" }], "experimentalDecorators": true } } -- cgit 1.4.1