Fix cloud attachments (dont circular import in cdn)

This commit is contained in:
Rory&
2026-06-18 09:04:53 +02:00
parent 1612bb0d12
commit 18dd02f151
20 changed files with 57 additions and 49 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -22,7 +22,7 @@ import imageSize from "image-size";
import { HTTPError } from "lambert-server/HTTPError";
import { CloudAttachment } from "@spacebar/database";
import { Config, hasValidSignature, NewUrlUserSignatureData, Snowflake, UrlSignResult } from "@spacebar/util";
import { storage, multer, cache } from "@spacebar/cdn/util";
import { storage, multer, cache } from "../util";
const router = Router({ mergeParams: true });
+1 -1
View File
@@ -19,7 +19,7 @@
import { Router, Response, Request } from "express";
import { HTTPError } from "lambert-server/HTTPError";
import { fileTypeFromBuffer } from "file-type";
import { storage, cache } from "@spacebar/cdn/util";
import { storage, cache } from "../util";
const router = Router({ mergeParams: true });
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { Config } from "@spacebar/util";
import { HTTPError } from "lambert-server/HTTPError";
import { storage, multer, cache } from "@spacebar/cdn/util";
import { storage, multer, cache } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -19,7 +19,7 @@
import { Router, Response, Request } from "express";
import { HTTPError } from "lambert-server/HTTPError";
import { fileTypeFromBuffer } from "file-type";
import { storage, cache } from "@spacebar/cdn/util";
import { storage, cache } from "../util";
const router = Router({ mergeParams: true });
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { join } from "node:path";
import { Request, Response, Router } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { cache } from "@spacebar/cdn/util";
import { cache } from "../util";
const defaultAvatarHashMap = new Map([
["0", "4a8562cf00887030c416d3ec2d46385a"],
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Request, Response, Router } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache } from "@spacebar/cdn/util";
import { storage, multer, cache } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache } from "@spacebar/cdn/util";
import { storage, multer, cache } from "../util";
//Role icons ---> avatars.ts modified
+1 -1
View File
@@ -21,7 +21,7 @@ import crypto from "node:crypto";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon
+1 -1
View File
@@ -21,7 +21,7 @@ import { Router, Response, Request } from "express";
import { fileTypeFromBuffer } from "file-type";
import { HTTPError } from "lambert-server/HTTPError";
import { Config } from "@spacebar/util";
import { storage, multer, cache, cacheNotFound } from "@spacebar/cdn/util";
import { storage, multer, cache, cacheNotFound } from "../util";
// TODO: check premium and animated pfp are allowed in the config
// TODO: generate different sizes of icon