1.1.0 #29

Merged
Xominus merged 25 commits from discord into main 2026-08-22 18:00:22 +00:00
Showing only changes of commit c5f6c25563 - Show all commits
+26 -24
View File
@@ -80,7 +80,6 @@ export const app = new Elysia()
/^https?:\/\/([a-z0-9-]+\.)?bladeandbrawn\.com$/i, /^https?:\/\/([a-z0-9-]+\.)?bladeandbrawn\.com$/i,
// testing // testing
/^https?:\/\/([a-z0-9-]+\.)?bladeandbrawn\.webflow\.io$/i, /^https?:\/\/([a-z0-9-]+\.)?bladeandbrawn\.webflow\.io$/i,
/^https?:\/\/([a-z0-9-]+\.)?bladeandbrawn-test\.webflow\.io$/i,
// development // development
"http://localhost:5173", "http://localhost:5173",
], ],
@@ -261,15 +260,16 @@ export const app = new Elysia()
}), }),
}) })
// Authenticated // Authenticated
.guard({ authAdmin: true }) .guard({ authAdmin: true }, (app) => app
.get("/standards/config", async () => { .get("/standards/config", async () => {
return await s.Calculator.Standards.Config.get(); return await s.Calculator.Standards.Config.get();
}) })
.post("/standards/config/switch", async ({ body: { standardsConfigId } }) => { .post("/standards/config/switch", async ({ body: { standardsConfigId } }) => {
await s.Calculator.Standards.Config.switch(standardsConfigId); await s.Calculator.Standards.Config.switch(standardsConfigId);
}, { }, {
body: t.Object({ standardsConfigId: t.String() }) body: t.Object({ standardsConfigId: t.String() })
}) })
)
) )
.group("/standards", { authAdmin: true }, (app) => app .group("/standards", { authAdmin: true }, (app) => app
.post("/configs", async ({ body: { name, datasetId, params } }) => { .post("/configs", async ({ body: { name, datasetId, params } }) => {
@@ -457,20 +457,22 @@ export const app = new Elysia()
}, { }, {
params: t.Object({ id: t.String() }) params: t.Object({ id: t.String() })
}) })
.guard({ authUser: true }) .guard({ authUser: true }, (app) => app
.get("/me/stats", async ({ accountId }) => { .get("/me/stats", async ({ accountId }) => {
const stats = await s.Accounts.stats(accountId); const stats = await s.Accounts.stats(accountId);
if (!stats) throw new NotFoundError("Account stats not found"); if (!stats) throw new NotFoundError("Account stats not found");
return stats; return stats;
}) })
.guard({ authAdmin: true }) )
.get("/:id", async ({ params: { id } }) => { .guard({ authAdmin: true }, (app) => app
const account = await s.Accounts.get(id); .get("/:id", async ({ params: { id } }) => {
if (!account) throw new NotFoundError("Account not found"); const account = await s.Accounts.get(id);
return account; if (!account) throw new NotFoundError("Account not found");
}, { return account;
params: t.Object({ id: t.String() }) }, {
}) params: t.Object({ id: t.String() })
})
)
) )
// WEBHOOKS // WEBHOOKS