Update some patches, switch to node-fetch-commonjs, more updates

This commit is contained in:
Emma [it/its]@Rory&
2024-10-28 00:32:15 +01:00
committed by Rory&
parent a2ffc536aa
commit 168758924c
17 changed files with 52787 additions and 522 deletions
+2 -2
View File
@@ -17,7 +17,7 @@
*/
import "missing-native-js-functions";
import fetch from "node-fetch";
import fetch from "node-fetch-commonjs";
import { ProxyAgent } from "proxy-agent";
import readline from "readline";
import fs from "fs/promises";
@@ -100,7 +100,7 @@ async function getLatestVersion(url: string) {
try {
const agent = new ProxyAgent();
const response = await fetch(url, { agent });
const content = await response.json();
const content = (await response.json()) as { version: string };
return content.version;
} catch (error) {
throw new Error("[Auto update] check failed for " + url);
+1 -1
View File
@@ -18,7 +18,7 @@
import FormData from "form-data";
import { HTTPError } from "lambert-server";
import fetch from "node-fetch";
import fetch from "node-fetch-commonjs";
import { Attachment } from "../entities";
import { Config } from "./Config";