diff --git a/assets/openapi.json b/assets/openapi.json index e8a02845..03e1e49f 100644 Binary files a/assets/openapi.json and b/assets/openapi.json differ diff --git a/assets/public/client/test.js b/assets/public/client/test.js deleted file mode 100644 index 42490509..00000000 --- a/assets/public/client/test.js +++ /dev/null @@ -1,28 +0,0 @@ -// (A) CREATE/INSTALL CACHE -self.addEventListener("install", evt => { - self.skipWaiting(); - evt.waitUntil( - caches.open("Demo") - .then(cache => cache.addAll([ - "index.html", - "manifest.json" - //"YOUR-STYLES.css", - //"YOUR-SCRIPTS.js", - //"YOUR-IMAGES.jpg" - ])) - .catch(err => console.error(err)) - ); -}); - -// (B) CLAIM CONTROL INSTANTLY -self.addEventListener("activate", evt => self.clients.claim()); - -// (C) LOAD FROM CACHE FIRST, FALLBACK TO NETWORK IF NOT FOUND -self.addEventListener("fetch", evt => evt.respondWith( - caches.match(evt.request).then(res => res || fetch(evt.request)) -)); - -/* (C) LOAD WITH NETWORK FIRST, FALLBACK TO CACHE IF OFFLINE -self.addEventListener("fetch", evt => evt.respondWith( - fetch(evt.request).catch(() => caches.match(evt.request)) -));*/ \ No newline at end of file diff --git a/assets/public/index.html b/assets/public/index.html index 3216fd72..c4230e2a 100644 --- a/assets/public/index.html +++ b/assets/public/index.html @@ -1,50 +1,91 @@ - + + + + - - - - + + + + - - - Discord - - - - -
- - - \ No newline at end of file + [class*="qrCode-"][class*="spinner-"] { display: none; } + button[aria-label="Send a gift"], a[href="/store"] { display: none; } + .platform-win .notice-3bPHh- { display: none; } + div[aria-controls="Discord Nitro-tab"], + div[aria-controls="Nitro Server Boost-tab"], + div[aria-controls="Library Inventory-tab"], + div[aria-controls="Billing-tab"] { display: none; } + + + diff --git a/src/api/Server.ts b/src/api/Server.ts index 107b60a4..f7c0ba0a 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts @@ -91,7 +91,7 @@ export class SpacebarServer extends Server { await initTranslation(api); this.routes = await registerRoutes(this, path.join(__dirname, "routes", "/")); - + this.app = app; //app.use("/__development", ) @@ -103,7 +103,8 @@ export class SpacebarServer extends Server { app.use("/api", api); // allow unversioned requests app.use("/imageproxy/:hash/:size/:url", ImageProxy); - // for the 2021 discord frontend, can be replaced with anything else, just respect the way this file is structured + + // for the discord frontend, can be replaced with anything else, just respect the way this file is structured app.use("/assets", express.static(path.join(PUBLIC_ASSETS_FOLDER, "client"))); app.get("/verify-email", (req, res) => res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "verify.html"))); @@ -115,18 +116,18 @@ export class SpacebarServer extends Server { app.get("/_spacebar/api/openapi.json", (req, res) => { res.sendFile(path.join(ASSETS_FOLDER, "openapi.json")); }); - + app.use("*_", (req, res) => res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "index.html"))); - - // current well-known location (new commit 22 nov 2025 from spacebar) - app.get("/.well-known/spacebar", (req,res)=>{ + + // current well-known location (new commit 22 nov 2025 from spacebar) + app.get("/.well-known/spacebar", (req, res) => { res.json({ - api: Config.get().api.endpointPublic + api: Config.get().api.endpointPublic, }); }); // new well-known location - app.get("/.well-known/spacebar/client", (req,res)=>{ + app.get("/.well-known/spacebar/client", (req, res) => { let erlpackSupported = false; try { require("@yukikaze-bot/erlpack"); @@ -140,20 +141,20 @@ export class SpacebarServer extends Server { baseUrl: Config.get().api.endpointPublic?.split("/api")[0] || "", // TODO: migrate database values to not include /api/v9 apiVersions: { default: Config.get().api.defaultVersion, - active: Config.get().api.activeVersions - } + active: Config.get().api.activeVersions, + }, }, cdn: { - baseUrl: Config.get().cdn.endpointPublic + baseUrl: Config.get().cdn.endpointPublic, }, gateway: { baseUrl: Config.get().gateway.endpointPublic, encoding: [...(erlpackSupported ? ["etf"] : []), "json"], compression: ["zstd-stream", "zlib-stream", null], - } + }, }); }); - + this.app.use(ErrorHandler); ConnectionLoader.loadConnections();