From dc4f9f6bfbee53e02ec72b1701ee11698742df2d Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 7 Jan 2025 15:55:49 +0000 Subject: [PATCH] Minor changes --- app/api/info/version/route.ts | 7 ++--- next.config.js | 13 ++++++++++ prisma/schema.prisma | 48 ++++++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/app/api/info/version/route.ts b/app/api/info/version/route.ts index 7359565..bd49c87 100644 --- a/app/api/info/version/route.ts +++ b/app/api/info/version/route.ts @@ -3,10 +3,11 @@ import { NextResponse } from "next/server"; export async function GET(req: Request) { return NextResponse.json({ major_version: 4, - minor_version: 3, - download: "https://drive.proton.me/urls/YH86153EWM#W6VTyaoAVHKP", - changelog: "Reconnecting should be fixed.\nNew TTS messages when queue is empty will be played faster, up to 200 ms.\nRemoved subscriptions errors when reconnecting on Twitch\nAdded !refresh connections" + minor_version: 5, + download: "https://drive.proton.me/urls/7JMTHDQ7VM#6h85HeLaxXgr", + changelog: "Added Veadotube integration.\nFixed voice changes via redemptions.\nMessages in queue for longer than a minute will be skipped automatically." + //changelog: "Reconnecting should be fixed.\nNew TTS messages when queue is empty will be played faster, up to 200 ms.\nRemoved subscriptions errors when reconnecting on Twitch\nAdded !refresh connections" //changelog: "When using multiple voices (ex: brian: hello amy: world), TTS messages are now merged as a single TTS message.\nNightbot integration\nTwitch authentication changed. Need to refresh connection every 30-60 days.\nFixed raid spam, probably." //changelog: "Added raid spam prevention (lasts 30 seconds; works on joined chats as well).\nAdded permission check for chat messages with bits." //changelog: "Fixed group permissions.\nRemoved default permissions.\nSome commands may have additional permission requirements, which are more strict.\nAdded support for redeemable actions via adbreak, follow, subscription.\nMessage deletion and bans automatically remove TTS messages from queue and playing.\nAdded support to read TTS from multiple chats via !tts join.\nFixed some reconnection problems." diff --git a/next.config.js b/next.config.js index 7761c6a..8c19695 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,19 @@ const nextConfig = { reactStrictMode: false, output: 'standalone', + headers: async () => { + return [ + { + source: "/api/:path*", + headers: [ + { key: "Access-Control-Allow-Credentials", value: "true" }, + { key: "Access-Control-Allow-Origin", value: "*" }, // replace this your actual origin + { key: "Access-Control-Allow-Methods", value: "GET,DELETE,PATCH,POST,PUT" }, + { key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }, + ] + } + ] + } } module.exports = nextConfig diff --git a/prisma/schema.prisma b/prisma/schema.prisma index dc9e707..e4f3208 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -30,20 +30,21 @@ model User { impersonationSources Impersonation[] @relation(name: "impersonationSources") impersonationTargets Impersonation[] @relation(name: "impersonationTargets") - apiKeys ApiKey[] - accounts Account[] - twitchConnections TwitchConnection[] - Connection Connection[] - ConnectionState ConnectionState[] - ttsUsernameFilter TtsUsernameFilter[] - ttsWordFilter TtsWordFilter[] - ttsChatVoices TtsChatVoice[] - ttsVoiceStates TtsVoiceState[] - actions Action[] - redemptions Redemption[] - groups Group[] - chatterGroups ChatterGroup[] - groupPermissions GroupPermission[] + apiKeys ApiKey[] + accounts Account[] + twitchConnections TwitchConnection[] + Connection Connection[] + ConnectionState ConnectionState[] + ttsUsernameFilter TtsUsernameFilter[] + ttsWordFilter TtsWordFilter[] + ttsChatVoices TtsChatVoice[] + ttsVoiceStates TtsVoiceState[] + actions Action[] + redemptions Redemption[] + groups Group[] + chatterGroups ChatterGroup[] + groupPermissions GroupPermission[] + GroupPermissionPolicy GroupPermissionPolicy[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -105,7 +106,7 @@ model Connection { grantType String scope String expiresAt DateTime - default Boolean @default(false) + default Boolean @default(false) userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade) @@ -223,6 +224,20 @@ model GroupPermission { @@index([userId]) } +model GroupPermissionPolicy { + id String @id @default(uuid()) @db.Uuid + userId String + groupId String @db.Uuid + path String + count Int + timespan Int + + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + + @@unique([userId, groupId, path]) + @@index([userId]) +} + model Chatter { id BigInt name String @@ -273,6 +288,9 @@ enum ActionType { NIGHTBOT_CLEAR_PLAYLIST NIGHTBOT_CLEAR_QUEUE TWITCH_OAUTH + VEADOTUBE_SET_STATE + VEADOTUBE_PUSH_STATE + VEADOTUBE_POP_STATE } model Action {