From 342fc3955a91cc8e9cd9f489ace77277ce19698e Mon Sep 17 00:00:00 2001 From: Zack3D Date: Sat, 4 Oct 2025 01:52:54 -0700 Subject: [PATCH] FurryPlace --- .env.example | 2 +- frontend-backup/404.html | 2 +- .../_app/immutable/chunks/D3yDgRbd.js | 2 +- .../_app/immutable/nodes/10.DqbXhTAj.js | 2 +- .../_app/immutable/nodes/11.C3Fd3lks.js | 2 +- .../_app/immutable/nodes/12.B7-BJxmw.js | 2 +- .../_app/immutable/nodes/13.DbQSn9aq.js | 2 +- .../_app/immutable/nodes/14.ClqwdR4T.js | 2 +- .../_app/immutable/nodes/15.D6A8EYfF.js | 2 +- .../_app/immutable/nodes/16.DTKQOukW.js | 2 +- .../_app/immutable/nodes/18.24JvCqRi.js | 2 +- .../_app/immutable/nodes/19.B2QYN1F_.js | 2 +- .../_app/immutable/nodes/2.-6emjql3.js | 2 +- .../_app/immutable/nodes/20.LCTNv26D.js | 2 +- .../_app/immutable/nodes/21.zScYLJw9.js | 2 +- .../_app/immutable/nodes/3.DOMAwJeg.js | 2 +- .../_app/immutable/nodes/4.CrDfIbdR.js | 8 +- .../_app/immutable/nodes/6.WPRvZASS.js | 2 +- .../_app/immutable/nodes/7.ACRjrnuj.js | 2 +- .../_app/immutable/nodes/8.BbOUPQlW.js | 2 +- .../_app/immutable/nodes/9.Cn-noR6e.js | 2 +- frontend-backup/admin.html | 18 +- frontend-backup/index.html | 20 +- frontend-backup/join.html | 18 +- frontend-backup/moderation.html | 18 +- frontend-backup/offline.html | 20 +- frontend-backup/payment/success.html | 20 +- frontend-backup/profile-picture.html | 16 +- frontend-backup/site.webmanifest | 6 +- prisma/schema.prisma | 12 + src/routes/rules.ts | 261 ++++++++++++++++++ 31 files changed, 365 insertions(+), 92 deletions(-) create mode 100644 src/routes/rules.ts diff --git a/.env.example b/.env.example index e8b4590..22ad8a7 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ PORT=3000 DATABASE_URL="mysql://root:password@localhost/FurryPlace" # Only required for development -SHADOW_DATABASE_URL="mysql://root:password@localhost/openplace_shadow" +SHADOW_DATABASE_URL="mysql://root:password@localhost/FurryPlace_shadow" JWT_SECRET="your-secret-key" diff --git a/frontend-backup/404.html b/frontend-backup/404.html index faa85ba..496a7f5 100644 --- a/frontend-backup/404.html +++ b/frontend-backup/404.html @@ -26,5 +26,5 @@ -
+
diff --git a/frontend-backup/_app/immutable/chunks/D3yDgRbd.js b/frontend-backup/_app/immutable/chunks/D3yDgRbd.js index 7009636..1935d51 100644 --- a/frontend-backup/_app/immutable/chunks/D3yDgRbd.js +++ b/frontend-backup/_app/immutable/chunks/D3yDgRbd.js @@ -48,7 +48,7 @@ try { } catch {} const B = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAABJQTFRFAQEBAAAAHGHnRcxVStlbMXLnk8SHtQAAAAF0Uk5TAEDm2GYAAABMSURBVHjadc9JCgAhDERRa7r/lZs0ikawdv+tkvEYALS07U2QawmOTo1oQBKr8/cUMLY7JLEPYLW0oISSNLtgiojRBfv0AuB67vH3B+FjAY/0rrGiAAAAAElFTkSuQmCC"; -var L = c("openplace"), +var L = c("FurryPlace"), R = c('
Wplace logo
'); function z(e, a) { m(a, !0); diff --git a/frontend-backup/_app/immutable/nodes/10.DqbXhTAj.js b/frontend-backup/_app/immutable/nodes/10.DqbXhTAj.js index 4ef65e0..a8d9b8f 100644 --- a/frontend-backup/_app/immutable/nodes/10.DqbXhTAj.js +++ b/frontend-backup/_app/immutable/nodes/10.DqbXhTAj.js @@ -262,7 +262,7 @@ function Oa(u, v) { } var P = fa(); Ce((r) => { - Oe.title = "openplace - Admin - Mods - Leaderboard"; + Oe.title = "FurryPlace - Admin - Mods - Leaderboard"; }); var F = t(P), V = t(F), diff --git a/frontend-backup/_app/immutable/nodes/11.C3Fd3lks.js b/frontend-backup/_app/immutable/nodes/11.C3Fd3lks.js index c70a347..de5c1dd 100644 --- a/frontend-backup/_app/immutable/nodes/11.C3Fd3lks.js +++ b/frontend-backup/_app/immutable/nodes/11.C3Fd3lks.js @@ -266,7 +266,7 @@ function Or(v, u) { } var F = xr(); Ce((a) => { - Oe.title = "openplace - Admin - Reports - Leaderboard"; + Oe.title = "FurryPlace - Admin - Reports - Leaderboard"; }); var P = t(F), V = t(P), diff --git a/frontend-backup/_app/immutable/nodes/12.B7-BJxmw.js b/frontend-backup/_app/immutable/nodes/12.B7-BJxmw.js index a2f943b..d5ba0a5 100644 --- a/frontend-backup/_app/immutable/nodes/12.B7-BJxmw.js +++ b/frontend-backup/_app/immutable/nodes/12.B7-BJxmw.js @@ -565,7 +565,7 @@ function Oi(u, o) { } var Kt = bi(); js((n) => { - Ss.title = "openplace - Admin - Users"; + Ss.title = "FurryPlace - Admin - Users"; }); var Qt = a(Kt), Wt = a(Qt), diff --git a/frontend-backup/_app/immutable/nodes/13.DbQSn9aq.js b/frontend-backup/_app/immutable/nodes/13.DbQSn9aq.js index 52ddf60..cb2d0b7 100644 --- a/frontend-backup/_app/immutable/nodes/13.DbQSn9aq.js +++ b/frontend-backup/_app/immutable/nodes/13.DbQSn9aq.js @@ -146,7 +146,7 @@ function aa(a, e) { var I = Me(); fe((r) => { var d = Ve(); - ue(4), w((L) => (ce.title = `openplace - ${L ?? ""}`), [() => ke()]), l(r, d); + ue(4), w((L) => (ce.title = `FurryPlace - ${L ?? ""}`), [() => ke()]), l(r, d); }); var W = s(I); { diff --git a/frontend-backup/_app/immutable/nodes/14.ClqwdR4T.js b/frontend-backup/_app/immutable/nodes/14.ClqwdR4T.js index c83be3a..269e922 100644 --- a/frontend-backup/_app/immutable/nodes/14.ClqwdR4T.js +++ b/frontend-backup/_app/immutable/nodes/14.ClqwdR4T.js @@ -400,7 +400,7 @@ function Vr(p, c) { Z = B(void 0); var va = Ur(); vs((n) => { - ns.title = "openplace - Moderation"; + ns.title = "FurryPlace - Moderation"; }); var Ie = K(va), ze = t(Ie), diff --git a/frontend-backup/_app/immutable/nodes/15.D6A8EYfF.js b/frontend-backup/_app/immutable/nodes/15.D6A8EYfF.js index 424c255..a70aaf8 100644 --- a/frontend-backup/_app/immutable/nodes/15.D6A8EYfF.js +++ b/frontend-backup/_app/immutable/nodes/15.D6A8EYfF.js @@ -68,7 +68,7 @@ function M(e, t) { y(t, !1), E(); var n = j(); $((p) => { - u((f) => (T.title = `openplace - ${f ?? ""}`), [() => b()]); + u((f) => (T.title = `FurryPlace - ${f ?? ""}`), [() => b()]); }); var s = a(n), _ = a(s); diff --git a/frontend-backup/_app/immutable/nodes/16.DTKQOukW.js b/frontend-backup/_app/immutable/nodes/16.DTKQOukW.js index 62eb701..16b236b 100644 --- a/frontend-backup/_app/immutable/nodes/16.DTKQOukW.js +++ b/frontend-backup/_app/immutable/nodes/16.DTKQOukW.js @@ -98,7 +98,7 @@ function ge(e, t) { }); var l = ae(); O((r) => { - w((s) => (N.title = `openplace - ${s ?? ""}`), [() => T()]); + w((s) => (N.title = `FurryPlace - ${s ?? ""}`), [() => T()]); }); var c = a(l), q = a(c); diff --git a/frontend-backup/_app/immutable/nodes/18.24JvCqRi.js b/frontend-backup/_app/immutable/nodes/18.24JvCqRi.js index 98291e5..5a79765 100644 --- a/frontend-backup/_app/immutable/nodes/18.24JvCqRi.js +++ b/frontend-backup/_app/immutable/nodes/18.24JvCqRi.js @@ -1086,7 +1086,7 @@ var r = function g(s) { var e = r(); d((b) => { - c.title = "openplace - Privacy Policy"; + c.title = "FurryPlace - Privacy Policy"; }); var l = t(e), n = t(l); diff --git a/frontend-backup/_app/immutable/nodes/19.B2QYN1F_.js b/frontend-backup/_app/immutable/nodes/19.B2QYN1F_.js index 0075368..6c06c1b 100644 --- a/frontend-backup/_app/immutable/nodes/19.B2QYN1F_.js +++ b/frontend-backup/_app/immutable/nodes/19.B2QYN1F_.js @@ -55,7 +55,7 @@ var h = function w(e) { var a = h(); u((f) => { - n.title = "openplace - Refund Policy"; + n.title = "FurryPlace - Refund Policy"; }); var i = s(a), r = s(i); diff --git a/frontend-backup/_app/immutable/nodes/2.-6emjql3.js b/frontend-backup/_app/immutable/nodes/2.-6emjql3.js index 4149e73..cb0a38b 100644 --- a/frontend-backup/_app/immutable/nodes/2.-6emjql3.js +++ b/frontend-backup/_app/immutable/nodes/2.-6emjql3.js @@ -76,7 +76,7 @@ function re(e, d) { } var n = H(); U((r) => { - S.title = "openplace - Admin"; + S.title = "FurryPlace - Admin"; }); var l = t(n), c = t(l), diff --git a/frontend-backup/_app/immutable/nodes/20.LCTNv26D.js b/frontend-backup/_app/immutable/nodes/20.LCTNv26D.js index 12e68ba..d053325 100644 --- a/frontend-backup/_app/immutable/nodes/20.LCTNv26D.js +++ b/frontend-backup/_app/immutable/nodes/20.LCTNv26D.js @@ -50,7 +50,7 @@ var u = function y(o) { var e = u(); c((p) => { - t.title = "openplace - Política de Reembolso"; + t.title = "FurryPlace - Política de Reembolso"; }); var a = s(e), i = s(a); diff --git a/frontend-backup/_app/immutable/nodes/21.zScYLJw9.js b/frontend-backup/_app/immutable/nodes/21.zScYLJw9.js index 351e4dc..5462d0f 100644 --- a/frontend-backup/_app/immutable/nodes/21.zScYLJw9.js +++ b/frontend-backup/_app/immutable/nodes/21.zScYLJw9.js @@ -472,7 +472,7 @@ Calibri;color:#595959;mso-themecolor:text1;mso-themetint:166;" class="svelte-11v function u(t) { var e = p(); v((b) => { - r.title = "openplace - Terms of Service"; + r.title = "FurryPlace - Terms of Service"; }); var s = l(e), o = l(s); diff --git a/frontend-backup/_app/immutable/nodes/3.DOMAwJeg.js b/frontend-backup/_app/immutable/nodes/3.DOMAwJeg.js index e39dc3c..b457a78 100644 --- a/frontend-backup/_app/immutable/nodes/3.DOMAwJeg.js +++ b/frontend-backup/_app/immutable/nodes/3.DOMAwJeg.js @@ -80,7 +80,7 @@ function X(e, d) { } var n = B(); j((t) => { - D.title = "openplace - Admin - Mods"; + D.title = "FurryPlace - Admin - Mods"; }); var l = o(n), m = v(o(l), 2), diff --git a/frontend-backup/_app/immutable/nodes/4.CrDfIbdR.js b/frontend-backup/_app/immutable/nodes/4.CrDfIbdR.js index 20b9d94..438421e 100644 --- a/frontend-backup/_app/immutable/nodes/4.CrDfIbdR.js +++ b/frontend-backup/_app/immutable/nodes/4.CrDfIbdR.js @@ -417,9 +417,9 @@ const Xx = Q1, Uw = () => "Importante", $w = (m = {}, a = {}) => ((a.locale ?? Ne()) === "en" ? Zw() : Uw()), Gw = () => - "🚫 No inappropriate content (+18, hate speech, inappropriate links, highly suggestive material, ...)", + "✅ NSFW content is allowed to a reasonable extent(No Cub, Loli, Guro, Bathroom fetishes, ...)", Hw = () => - "🚫 Conteúdo inapropriado não permitido (+18, discurso de ódio, links inapropriados, conteúdo altamente sugestivo, ...)", + "✅ Conteúdo NSFW é permitido até certo ponto razoável (Sem Cub, Loli, Guro, fetiches de banheiro, ...)", Ww = (m = {}, a = {}) => ((a.locale ?? Ne()) === "en" ? Gw() : Hw()), Xw = () => "😈 Do not paint over other artworks using random colors or patterns just to mess things up", @@ -70094,7 +70094,7 @@ function R9(m, a) { return Math.round(m * p) / p; } var B9 = Te( - ' ', + ' ', 1 ), F9 = (m, a) => { @@ -70700,7 +70700,7 @@ function uF(m, a) { var qr = wB(); nx((bt) => { var Xt = B9(); - (rx.title = "openplace - Paint the world"), yn(6), $(bt, Xt); + (rx.title = "FurryPlace - Paint the world"), yn(6), $(bt, Xt); }); var ue = Ct(qr); { diff --git a/frontend-backup/_app/immutable/nodes/6.WPRvZASS.js b/frontend-backup/_app/immutable/nodes/6.WPRvZASS.js index f945800..660107b 100644 --- a/frontend-backup/_app/immutable/nodes/6.WPRvZASS.js +++ b/frontend-backup/_app/immutable/nodes/6.WPRvZASS.js @@ -66,7 +66,7 @@ function M(e, o) { y(); var t = E(); g((n) => { - m.title = "openplace - Admin Dashboard"; + m.title = "FurryPlace - Admin Dashboard"; }); var a = u(s(t), 2), r = s(a, !0); diff --git a/frontend-backup/_app/immutable/nodes/7.ACRjrnuj.js b/frontend-backup/_app/immutable/nodes/7.ACRjrnuj.js index 021d1b8..7fd54a9 100644 --- a/frontend-backup/_app/immutable/nodes/7.ACRjrnuj.js +++ b/frontend-backup/_app/immutable/nodes/7.ACRjrnuj.js @@ -484,7 +484,7 @@ function Ro(d, r) { } var Se = no(); tr((n) => { - Za.title = "openplace - Admin - Alliances"; + Za.title = "FurryPlace - Admin - Alliances"; }); var De = a(Se), Re = a(De), diff --git a/frontend-backup/_app/immutable/nodes/8.BbOUPQlW.js b/frontend-backup/_app/immutable/nodes/8.BbOUPQlW.js index 538c319..bc04736 100644 --- a/frontend-backup/_app/immutable/nodes/8.BbOUPQlW.js +++ b/frontend-backup/_app/immutable/nodes/8.BbOUPQlW.js @@ -170,7 +170,7 @@ function Et(f, p) { } var P = vt(); Ge((a) => { - Me.title = "openplace - Admin Dashboard"; + Me.title = "FurryPlace - Admin Dashboard"; }); var Q = t(P), U = t(Q), diff --git a/frontend-backup/_app/immutable/nodes/9.Cn-noR6e.js b/frontend-backup/_app/immutable/nodes/9.Cn-noR6e.js index e456c49..57cc696 100644 --- a/frontend-backup/_app/immutable/nodes/9.Cn-noR6e.js +++ b/frontend-backup/_app/immutable/nodes/9.Cn-noR6e.js @@ -41,7 +41,7 @@ try { } catch {} function s(e) { o((d) => { - n.title = "openplace - Admin - Mods Dashboard"; + n.title = "FurryPlace - Admin - Mods Dashboard"; }); } export { s as component }; diff --git a/frontend-backup/admin.html b/frontend-backup/admin.html index e988dcb..8d1b828 100644 --- a/frontend-backup/admin.html +++ b/frontend-backup/admin.html @@ -32,7 +32,7 @@ - openplace - Admin Dashboard + FurryPlace - Admin Dashboard @@ -41,24 +41,24 @@ - - + + diff --git a/frontend-backup/index.html b/frontend-backup/index.html index de45ce7..6e71300 100644 --- a/frontend-backup/index.html +++ b/frontend-backup/index.html @@ -52,7 +52,7 @@ - openplace - Paint the world + FurryPlace - Paint the world @@ -61,24 +61,24 @@ - - + + @@ -111,7 +111,7 @@ -
+
diff --git a/frontend-backup/moderation.html b/frontend-backup/moderation.html index 341d9be..36cbac7 100644 --- a/frontend-backup/moderation.html +++ b/frontend-backup/moderation.html @@ -39,7 +39,7 @@ - openplace - Moderation + FurryPlace - Moderation @@ -48,24 +48,24 @@ - - + + diff --git a/frontend-backup/offline.html b/frontend-backup/offline.html index 6168cc4..252f75f 100644 --- a/frontend-backup/offline.html +++ b/frontend-backup/offline.html @@ -31,7 +31,7 @@ - openplace - No internet connection + FurryPlace - No internet connection @@ -40,24 +40,24 @@ - - + + @@ -90,7 +90,7 @@ -
Wplace logo openplace

No internet connection

+
Wplace logo FurryPlace

No internet connection

@@ -89,7 +89,7 @@ -
Wplace logo openplace

Payment succeeded!

Thank you for your support!

Go to map
+
Wplace logo FurryPlace

Payment succeeded!

Thank you for your support!

Go to map
diff --git a/frontend-backup/site.webmanifest b/frontend-backup/site.webmanifest index 2611d92..b303156 100644 --- a/frontend-backup/site.webmanifest +++ b/frontend-backup/site.webmanifest @@ -1,7 +1,7 @@ { - "name": "openplace", - "short_name": "openplace", - "description": "openplace is a free unofficial open source backend for wplace.", + "name": "FurryPlace", + "short_name": "FurryPlace", + "description": "FurryPlace is a free unofficial open source backend for wplace.", "start_url": "/", "theme_color": "#f8f4f0", "background_color": "#ffffff", diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ad6281f..d9f7835 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -191,3 +191,15 @@ model City { updatedAt DateTime @updatedAt @default(now()) regions Region[] } + +model Rule { + id Int @id @default(autoincrement()) + text String @db.Text + locale String @default("en") + order Int + enabled Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@index([locale, enabled, order]) +} diff --git a/src/routes/rules.ts b/src/routes/rules.ts new file mode 100644 index 0000000..1d04401 --- /dev/null +++ b/src/routes/rules.ts @@ -0,0 +1,261 @@ +import type { App, Response, NextFunction } from '@tinyhttp/app'; +import { prisma } from '../config/database.js'; +import { authMiddleware } from '../middleware/auth.js'; +import { AuthenticatedRequest, UserRole } from '../types/index.js'; + +const adminMiddleware = async (req: AuthenticatedRequest, res: Response, next?: NextFunction) => { + try { + const user = await prisma.user.findUnique({ + where: { id: req.user!.id } + }); + if (!user || user.role !== UserRole.Admin) { + return res.status(403).json({ error: 'Forbidden', status: 403 }); + } + return next?.(); + } catch (error) { + console.error('Error fetching user:', error); + return res.status(500).json({ error: 'Internal Server Error', status: 500 }); + } +}; + +export function setupRulesRoutes(app: App) { + // Public endpoint - Get rules for display + app.get('/api/rules', async (req, res) => { + try { + const locale = (req.query['locale'] as string) || 'en'; + + const rules = await prisma.rule.findMany({ + where: { + locale: locale, + enabled: true, + }, + orderBy: { + order: 'asc', + }, + select: { + id: true, + text: true, + order: true, + }, + }); + + return res.json({ rules }); + } catch (error) { + console.error('Error fetching rules:', error); + return res.status(500).json({ error: 'Failed to fetch rules', status: 500 }); + } + }); + + // Admin endpoint - Get all rules for editing + app.get( + '/api/admin/rules', + authMiddleware, + adminMiddleware, + async (_req, res) => { + try { + const rules = await prisma.rule.findMany({ + orderBy: [{ locale: 'asc' }, { order: 'asc' }], + }); + + return res.json({ rules }); + } catch (error) { + console.error('Error fetching rules:', error); + return res.status(500).json({ error: 'Failed to fetch rules', status: 500 }); + } + } + ); + + // Admin endpoint - Create or update a rule + app.post( + '/api/admin/rules', + authMiddleware, + adminMiddleware, + async (req: AuthenticatedRequest, res) => { + try { + const { id, text, locale = 'en', order, enabled = true } = req.body; + + if (!text || order === undefined) { + return res.status(400).json({ error: 'Text and order are required', status: 400 }); + } + + let rule; + if (id) { + // Update existing rule + rule = await prisma.rule.update({ + where: { id }, + data: { + text, + locale, + order, + enabled, + }, + }); + } else { + // Create new rule + rule = await prisma.rule.create({ + data: { + text, + locale, + order, + enabled, + }, + }); + } + + return res.json({ rule }); + } catch (error) { + console.error('Error saving rule:', error); + return res.status(500).json({ error: 'Failed to save rule', status: 500 }); + } + } + ); + + // Admin endpoint - Delete a rule + app.delete( + '/api/admin/rules/:id', + authMiddleware, + adminMiddleware, + async (req, res) => { + try { + const id = parseInt(req.params['id'] || ''); + if (isNaN(id)) { + return res.status(400).json({ error: 'Invalid rule ID', status: 400 }); + } + + await prisma.rule.delete({ + where: { id }, + }); + + return res.json({ success: true }); + } catch (error) { + console.error('Error deleting rule:', error); + return res.status(500).json({ error: 'Failed to delete rule', status: 500 }); + } + } + ); + + // Admin endpoint - Initialize default rules + app.post( + '/api/admin/rules/initialize', + authMiddleware, + adminMiddleware, + async (_req, res) => { + try { + const defaultRules = [ + // English rules + { + text: '📜 All users are responsible for the content they post. The platform reserves the right of final interpretation.', + locale: 'en', + order: 0, + enabled: true, + }, + { + text: '🛑 Any violation may result in immediate removal of content and permanent ban of the account', + locale: 'en', + order: 1, + enabled: true, + }, + { + text: '😈 Do not paint over other artworks using random colors or patterns just to mess things up', + locale: 'en', + order: 2, + enabled: true, + }, + { + text: "🙅 Disclosing other's personal information is not allowed", + locale: 'en', + order: 3, + enabled: true, + }, + { + text: '✅ NSFW content is allowed to a reasonable extent(No Cub, Loli, Guro, Bathroom fetishes, ...)', + locale: 'en', + order: 4, + enabled: true, + }, + { + text: '🧑‍🤝‍🧑 Do not paint with more than one account', + locale: 'en', + order: 5, + enabled: true, + }, + { + text: '✅ Painting over other artworks to complement them or create a new drawing is allowed', + locale: 'en', + order: 6, + enabled: true, + }, + { + text: '✅ Griefing political party flags or portraits of politicians is allowed', + locale: 'en', + order: 7, + enabled: true, + }, + + // Portuguese rules + { + text: '📜 Todos os utilizadores são responsáveis pelo conteúdo que publicam. A plataforma reserva-se o direito de interpretação final.', + locale: 'pt', + order: 0, + enabled: true, + }, + { + text: '🛑 Qualquer violação pode resultar na remoção imediata do conteúdo e banimento permanente da conta', + locale: 'pt', + order: 1, + enabled: true, + }, + { + text: '😈 Não desenhe sobre outras obras usando cores ou padrões aleatórios apenas para estragar as coisas', + locale: 'pt', + order: 2, + enabled: true, + }, + { + text: '🙅 A divulgação de informações pessoais de terceiros não é permitida', + locale: 'pt', + order: 3, + enabled: true, + }, + { + text: '✅ Conteúdo NSFW é permitido até certo ponto razoável (Sem Cub, Loli, Guro, fetiches de banheiro, ...)', + locale: 'pt', + order: 4, + enabled: true, + }, + { + text: '🧑‍🤝‍🧑 Não desenhe com mais de uma conta', + locale: 'pt', + order: 5, + enabled: true, + }, + { + text: '✅ Desenhar sobre outras artes para complementar ou criar novas artes é permitido', + locale: 'pt', + order: 6, + enabled: true, + }, + { + text: '✅ Desenhar sobre bandeiras de partidos e retratos de políticos é permitido', + locale: 'pt', + order: 7, + enabled: true, + }, + ]; + + const results = await Promise.all( + defaultRules.map((rule) => + prisma.rule.create({ + data: rule, + }) + ) + ); + + return res.json({ initialized: results.length, rules: results }); + } catch (error) { + console.error('Error initializing rules:', error); + return res.status(500).json({ error: 'Failed to initialize rules', status: 500 }); + } + } + ); +}