From c6fdc2ee7a968ebf1eb5d926b60a7f133206ab60 Mon Sep 17 00:00:00 2001 From: bensigo Date: Thu, 12 Oct 2023 04:28:26 +0400 Subject: [PATCH] fix: for chat api --- package.json | 9 +- prisma/schema.prisma | 1 + src/env.mjs | 2 + src/pages/api/v2/chat.ts | 125 ++++++++++------------- src/shared-ui/ZenQuestCard/index.tsx | 2 +- src/ui/quest/components/Chat.tsx | 21 ++-- yarn.lock | 145 +++++++++++++++------------ 7 files changed, 152 insertions(+), 153 deletions(-) diff --git a/package.json b/package.json index 1b86bb6..a6a11fc 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "next build", "dev": "next dev", - "postinstall": "prisma db push && prisma generate", + "postinstall": "prisma generate --no-engine", "lint": "next lint", "start": "next start" }, @@ -16,7 +16,8 @@ "@emotion/styled": "^11.11.0", "@hookform/resolvers": "^3.1.1", "@next-auth/prisma-adapter": "^1.0.5", - "@prisma/client": "^4.14.0", + "@prisma/client": "^5.2.0", + "@prisma/extension-accelerate": "^0.6.2", "@reduxjs/toolkit": "^1.9.5", "@sendgrid/mail": "^7.7.0", "@t3-oss/env-nextjs": "^0.3.1", @@ -41,6 +42,7 @@ "next-redux-wrapper": "^8.1.0", "nodemailer": "^6.9.3", "openai": "^3.3.0", + "openai-edge": "^1.2.2", "react": "18.2.0", "react-chartjs-2": "^5.2.0", "react-datepicker": "^4.16.0", @@ -52,6 +54,7 @@ "react-redux": "^8.1.0", "react-type-animation": "^3.1.0", "superjson": "1.12.2", + "yarn": "^1.22.19", "yup": "^1.2.0", "zod": "^3.21.4" }, @@ -68,7 +71,7 @@ "env-cmd": "^10.1.0", "eslint": "^8.40.0", "eslint-config-next": "^13.4.2", - "prisma": "^4.14.0", + "prisma": "^5.2.0", "typescript": "^5.0.4" }, "ct3aMetadata": { diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6def1bb..c22548c 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -6,6 +6,7 @@ generator client { datasource db { provider = "postgresql" url = env("DATABASE_URL") + // directUrl = env("DIRECT_DATABASE_URL") } model Example { diff --git a/src/env.mjs b/src/env.mjs index fab5558..78f2192 100644 --- a/src/env.mjs +++ b/src/env.mjs @@ -8,6 +8,7 @@ export const env = createEnv({ */ server: { DATABASE_URL: z.string().url(), + // DIRECT_DATABASE_URL: z.string().url(), NODE_ENV: z.enum(["development", "test", "production"]), NEXTAUTH_SECRET: process.env.NODE_ENV === "production" @@ -45,6 +46,7 @@ export const env = createEnv({ */ runtimeEnv: { DATABASE_URL: process.env.DATABASE_URL, + DIRECT_DATABASE_URL: process.env.DIRECT_DATABASE_URL, NODE_ENV: process.env.NODE_ENV, NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, NEXTAUTH_URL: process.env.NEXTAUTH_URL, diff --git a/src/pages/api/v2/chat.ts b/src/pages/api/v2/chat.ts index 0548a2b..e6b2e0d 100644 --- a/src/pages/api/v2/chat.ts +++ b/src/pages/api/v2/chat.ts @@ -1,34 +1,41 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -import { type DailyTherapySession, PrismaClient } from "@prisma/client"; -import { type NextApiResponse, type NextApiRequest } from "next"; -import { Configuration, OpenAIApi } from "openai"; +import { type DailyTherapySession, PrismaClient } from "@prisma/client/edge"; +import { withAccelerate } from '@prisma/extension-accelerate'; +import { OpenAIStream, StreamingTextResponse } from 'ai' +import { Configuration, OpenAIApi } from 'openai-edge' import { env } from "@/env.mjs"; -import { authOptions, getServerAuthSession } from "@/server/auth"; -import { type IncomingMessage } from "http"; +import { auth } from "../auth/[...nextauth]"; -export const maxDuration = 100; + + +export const runtime = 'edge'; const config = new Configuration({ apiKey: env.OPEN_AI, -}); -const openai = new OpenAIApi(config) +}) -let content = '' +const openai = new OpenAIApi(config) -export default async function POST(req: NextApiRequest, res: NextApiResponse) { +export default async function POST(req: Request) { // handle auth - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const session = await getServerAuthSession({ req, res, authOptions }); - if(!session){ - return res.status(401).send("Unauthorized") - } + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + const session = req.headers.getSetCookie() + + console.log({ session }) + if (!session){ + return new Response('Unauthorized', { + status: 401 + }) + } - const prisma = new PrismaClient(); + const prisma = new PrismaClient().$extends(withAccelerate()); + const json = await req.json() as { messages: any[], sessionId: string } - const { sessionId, messages } = JSON.parse(req.body as string) as { messages: any[], sessionId: string }; + const { sessionId, messages } = json; + + const dailySession = await prisma.dailyTherapySession.findFirst({ where: { @@ -41,73 +48,51 @@ export default async function POST(req: NextApiRequest, res: NextApiResponse) { }); if (!dailySession) { - return res.status(400).send("Invalid Therapy Session") + return Response.json("Invalid Therapy Session") } + + - const isValidChatSession = isValidSession(dailySession) - if (!isValidChatSession){ - res.status(400).send("Expired session") - return; - } + // const isValidChatSession = isValidSession(dailySession) + // if (!isValidChatSession){ + // res.status(400).send("Expired session") + // return; + // } const response = await openai.createChatCompletion({ stream: true, model: "gpt-3.5-turbo", messages, - temperature: 0.6, - }, { responseType: 'stream'}); - + temperature: 0.4, + }); - const stream = response.data as unknown as IncomingMessage; - stream.on('data', (chunk: Buffer) => processChunk(chunk, res)); - - stream.on('error', (err: Error) => { - console.log(err); - res.status(500).send("Internal Server Error"); + const stream = OpenAIStream(response, { + async onCompletion(content){ + await prisma.message.createMany({ + data: [ + { + sender: "user", + sessionId, + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + content: messages[messages.length - 1].content, + }, + { + sender: "assistant", + sessionId, + content, + }, + ], }); - - stream.on('end', () => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - const msg = messages[messages.length - 1].content - const saveMessagesToDatabase = async () => await prisma.message.createMany({ - data: [ - { - sender: "user", - sessionId, - content: msg, - }, - { - sender: "assistant", - sessionId, - content, - }, - ], - }); - void saveMessagesToDatabase(); - return; + } }) - - return res.status(200); -} -function processChunk(chunk: Buffer, res: NextApiResponse) { - const payloads = chunk.toString().split("\n\n"); - for (const payload of payloads) { - if (payload.includes('[DONE]')) return; - if (payload.startsWith("data:")) { - const data = JSON.parse(payload.replace("data: ", "")); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - const chunkContent: string | undefined = data.choices[0].delta?.content; - if (chunkContent) { - content += chunkContent; - res.write(chunkContent); - } - } - } + return new StreamingTextResponse(stream) } + + function isValidSession(dailySession: DailyTherapySession) { const startTime = new Date(dailySession.start); const currentTime = new Date(); diff --git a/src/shared-ui/ZenQuestCard/index.tsx b/src/shared-ui/ZenQuestCard/index.tsx index f1b1c21..ae25fcc 100644 --- a/src/shared-ui/ZenQuestCard/index.tsx +++ b/src/shared-ui/ZenQuestCard/index.tsx @@ -36,7 +36,7 @@ export default function ZenQuestCard(props: ZenQuestCardProps) { mutate({ id: props.id }, { onSuccess: () => { const ctx = api.useContext() - const invalidateListQuest = async() => await ctx.quest.list.refetch({ + const invalidateListQuest = async() => await ctx.quest.list.reset({ filter: props.selectedFilter, take: 20 }) diff --git a/src/ui/quest/components/Chat.tsx b/src/ui/quest/components/Chat.tsx index 01ccf19..427851e 100644 --- a/src/ui/quest/components/Chat.tsx +++ b/src/ui/quest/components/Chat.tsx @@ -24,8 +24,6 @@ import { ChatScrollAnchor } from "./chatScrollArchor"; const ChatUI = ({ msgs }: { msgs: Message[] }) => { const router = useRouter(); const context = api.useContext(); - const [isSendBtnDisabled, setSendDisabled] = useState(false); - const [input, setInput] = useState(""); const [timeRemaining, setTimeRemaining] = useState(1800); // 30 minutes in seconds @@ -37,7 +35,7 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { const { mutate } = api.activity.completeQuestActivity.useMutation(); - const { messages, append } = useChat({ + const { messages, append, isLoading, input, setInput } = useChat({ api: `/api/v2/chat`, body: { sessionId: msgs[0]?.sessionId, @@ -49,7 +47,7 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { createdAt: msg.createdAt, })), onResponse(res) { - setSendDisabled(false) + if (res.status === 401) { toast({ description: res.statusText, @@ -67,10 +65,7 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { status: "error", }); }, - onFinish: () => { - console.log("got here"); - setSendDisabled(false); - }, + }); const goBack = () => { @@ -78,9 +73,8 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { }; const handleSendMessage = async () => { - const msg = input.trim() - setSendDisabled(true); - setInput(""); + const msg = input.trim() + setInput("") await append({ id: msgs[0]?.sessionId, content: msg, @@ -127,7 +121,6 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { }, 1000); if (timeRemaining <= 0) { - setSendDisabled(true); clearInterval(timer); } @@ -215,7 +208,7 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { {message.content} ))} - + @@ -251,7 +244,7 @@ const ChatUI = ({ msgs }: { msgs: Message[] }) => { colorScheme="sage" aria-label="Send" onClick={() => void handleSendMessage()} - isDisabled={isSendBtnDisabled} + isDisabled={isLoading} borderRadius="md" /> diff --git a/yarn.lock b/yarn.lock index 2dde349..ef8e466 100644 --- a/yarn.lock +++ b/yarn.lock @@ -42,9 +42,9 @@ js-tokens "^4.0.0" "@babel/runtime@^7.0.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.9.2": - version "7.23.1" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" - integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" + integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== dependencies: regenerator-runtime "^0.14.0" @@ -1143,22 +1143,27 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== -"@prisma/client@^4.14.0": - version "4.16.2" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.16.2.tgz#3bb9ebd49b35c8236b3d468d0215192267016e2b" - integrity sha512-qCoEyxv1ZrQ4bKy39GnylE8Zq31IRmm8bNhNbZx7bF2cU5aiCCnSa93J2imF88MBjn7J9eUQneNxUQVJdl/rPQ== +"@prisma/client@^5.2.0": + version "5.4.2" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.4.2.tgz#786f9c1d8f06d955933004ac638d14da4bf14025" + integrity sha512-2xsPaz4EaMKj1WS9iW6MlPhmbqtBsXAOeVttSePp8vTFTtvzh2hZbDgswwBdSCgPzmmwF+tLB259QzggvCmJqA== dependencies: - "@prisma/engines-version" "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81" + "@prisma/engines-version" "5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574" -"@prisma/engines-version@4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81": - version "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81.tgz#d3b5dcf95b6d220e258cbf6ae19b06d30a7e9f14" - integrity sha512-q617EUWfRIDTriWADZ4YiWRZXCa/WuhNgLTVd+HqWLffjMSPzyM5uOWoauX91wvQClSKZU4pzI4JJLQ9Kl62Qg== +"@prisma/engines-version@5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574": + version "5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574.tgz#ff14f2926890edee47e8f1d08df7b4f392ee34bf" + integrity sha512-wvupDL4AA1vf4TQNANg7kR7y98ITqPsk6aacfBxZKtrJKRIsWjURHkZCGcQliHdqCiW/hGreO6d6ZuSv9MhdAA== -"@prisma/engines@4.16.2": - version "4.16.2" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.16.2.tgz#5ec8dd672c2173d597e469194916ad4826ce2e5f" - integrity sha512-vx1nxVvN4QeT/cepQce68deh/Turxy5Mr+4L4zClFuK1GlxN3+ivxfuv+ej/gvidWn1cE1uAhW7ALLNlYbRUAw== +"@prisma/engines@5.4.2": + version "5.4.2" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.4.2.tgz#ba2b7faeb227c76e423e88f962afe6a031319f3f" + integrity sha512-fqeucJ3LH0e1eyFdT0zRx+oETLancu5+n4lhiYECyEz6H2RDskPJHJYHkVc0LhkU4Uv7fuEnppKU3nVKNzMh8g== + +"@prisma/extension-accelerate@^0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@prisma/extension-accelerate/-/extension-accelerate-0.6.2.tgz#31e0fabb0b0dc318dca9b4087e89bf07219a4866" + integrity sha512-KIBVPeWt8qaSg7wQ+TXmCVeUDoW75whtXcdS9dbHxRoO2OWFH5I9+qbkHBhx5Wj/h1wQpS8usuxGnsZqiBjUpQ== "@reduxjs/toolkit@^1.9.5": version "1.9.7" @@ -1253,9 +1258,9 @@ integrity sha512-49SUOMWzSZtu5+OdrADmJD+u+sjSE0qj1cWgYk2FY4jLkPJunLuNRuhzM7aOeBhiUjyfhg2YTfur8FN1WBmvEw== "@types/eslint@^8.37.0": - version "8.44.3" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.3.tgz#96614fae4875ea6328f56de38666f582d911d962" - integrity sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g== + version "8.44.4" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.4.tgz#28eaff82e1ca0a96554ec5bb0188f10ae1a74c2f" + integrity sha512-lOzjyfY/D9QR4hY9oblZ76B90MYTB3RrQ4z2vBIJKj9ROCRqdkYl2gSUx1x1a4IWPjKJZLL4Aw1Zfay7eMnmnA== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -1266,9 +1271,9 @@ integrity sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA== "@types/hoist-non-react-statics@^3.3.1": - version "3.3.2" - resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#dc1e9ded53375d37603c479cc12c693b0878aa2a" - integrity sha512-YIQtIg4PKr7ZyqNPZObpxfHsHEmuB8dXCxd6qVcGuQVDK2bpsF7bYNnBJ4Nn7giuACZg+WewExgrtAJ3XnA4Xw== + version "3.3.3" + resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.3.tgz#8bb41d9a88164f82dd2745ff05e637e655f34d19" + integrity sha512-Wny3a2UXn5FEA1l7gc6BbpoV5mD1XijZqgkp4TRgDCDL5r3B5ieOFGUX5h3n78Tr1MEG7BfvoM8qeztdvNU0fw== dependencies: "@types/react" "*" hoist-non-react-statics "^3.3.0" @@ -1323,9 +1328,9 @@ integrity sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ== "@types/react-datepicker@^4.15.0": - version "4.15.1" - resolved "https://registry.yarnpkg.com/@types/react-datepicker/-/react-datepicker-4.15.1.tgz#a66fee520f2a31f83b45f4ed7f28af7296e11d0c" - integrity sha512-6/LthK0pTDBKjjVJqA2ygY3jJsHH7uZXIk8WPQcGHUiFOQLOKIv3krOxFZ2mt3BB3guMB6jVTc6ansQAd0r7xQ== + version "4.15.2" + resolved "https://registry.yarnpkg.com/@types/react-datepicker/-/react-datepicker-4.15.2.tgz#be6b7ebfe91a6317f2e918b04c70ea551d9cfaaf" + integrity sha512-l6L+t/fnaE4/Vqq52bBCSyo2YKgqqfqZDAdjpBJfHCphgf5++BO2k9yOtXGNU2VMAETZtijF921Mlr5TcRUc0A== dependencies: "@popperjs/core" "^2.9.2" "@types/react" "*" @@ -1333,16 +1338,16 @@ react-popper "^2.2.5" "@types/react-dom@^18.2.4": - version "18.2.12" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.12.tgz#58479c463d1e0b7f1ee7cd80e09186189f9ec32d" - integrity sha512-QWZuiA/7J/hPIGocXreCRbx7wyoeet9ooxfbSA+zbIWqyQEE7GMtRn4A37BdYyksnN+/NDnWgfxZH9UVGDw1hg== + version "18.2.13" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.13.tgz#89cd7f9ec8b28c8b6f0392b9591671fb4a9e96b7" + integrity sha512-eJIUv7rPP+EC45uNYp/ThhSpE16k22VJUknt5OLoH9tbXoi8bMhwLf5xRuWMywamNbWzhrSmU7IBJfPup1+3fw== dependencies: "@types/react" "*" "@types/react@*", "@types/react@^18.2.6": - version "18.2.27" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.27.tgz#746e52b06f3ccd5d7a724fd53769b70792601440" - integrity sha512-Wfv7B7FZiR2r3MIqbAlXoY1+tXm4bOqfz4oRr+nyXdBqapDBZ0l/IGcSlAfvxIHEEJjkPU0MYAc/BlFPOcrgLw== + version "18.2.28" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.28.tgz#86877465c0fcf751659a36c769ecedfcfacee332" + integrity sha512-ad4aa/RaaJS3hyGz0BGegdnSRXQBkd1CCYDCdNjBPg90UUpLgo+WlJqb9fMYUxtehmzF3PJaTWqRZjko6BRzBg== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -1555,9 +1560,9 @@ add-to-calendar-button@^2.4.3: timezones-ical-library "^1.7.1" ai@^2.2.14: - version "2.2.14" - resolved "https://registry.yarnpkg.com/ai/-/ai-2.2.14.tgz#62ced8dbf78e5905aa207dbf1202c523d3c62e65" - integrity sha512-4kL2iYPVhH1pl6jJFIJCYcgx5mHzGOmdwiSYWVadmSkNOxKqokgevHyJKiyL9B9DjlreM9cDqkQop56Hdfkb0w== + version "2.2.15" + resolved "https://registry.yarnpkg.com/ai/-/ai-2.2.15.tgz#3c757e6c559177749b846454d0012ac399f1a531" + integrity sha512-pl3cWgb2aM6HQo/heX/oIH0TlXXI9hOyT2n6KokNPjLTfWiPFGZ6thXLEi80xaS0tvtAc30qJqwt8VtSsfLNLA== dependencies: eventsource-parser "1.0.0" nanoid "3.3.6" @@ -1785,9 +1790,9 @@ callsites@^3.0.0: integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== caniuse-lite@^1.0.30001406: - version "1.0.30001546" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz#10fdad03436cfe3cc632d3af7a99a0fb497407f0" - integrity sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw== + version "1.0.30001547" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz#d4f92efc488aab3c7f92c738d3977c2a3180472b" + integrity sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA== chalk@^2.4.2: version "2.4.2" @@ -2784,7 +2789,7 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.11.0, is-core-module@^2.13.0, is-core-module@^2.9.0: +is-core-module@^2.11.0, is-core-module@^2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== @@ -2947,9 +2952,9 @@ iterator.prototype@^1.1.2: set-function-name "^2.0.1" jose@^4.11.4, jose@^4.15.1: - version "4.15.2" - resolved "https://registry.yarnpkg.com/jose/-/jose-4.15.2.tgz#61f97383f0b433d45da26d35094155a30a672d92" - integrity sha512-IY73F228OXRl9ar3jJagh7Vnuhj/GzBunPiZP13K0lOl7Am9SoWW3kEzq3MCllJMTtZqHTiDXQvoRd4U95aU6A== + version "4.15.3" + resolved "https://registry.yarnpkg.com/jose/-/jose-4.15.3.tgz#92fdac3ff0f345aab103211fc90b58f187fcdceb" + integrity sha512-RZJdL9Qjd1sqNdyiVteRGV/bnWtik/+PJh1JP4kT6+x1QQMn+7ryueRys5BEueuayvSVY8CWGCisCDazeRLTuw== js-cookie@^3.0.5: version "3.0.5" @@ -3282,6 +3287,11 @@ once@^1.3.0: dependencies: wrappy "1" +openai-edge@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/openai-edge/-/openai-edge-1.2.2.tgz#0b1cd5aec2c366bbd25cdeba05399aa6eef73230" + integrity sha512-C3/Ao9Hkx5uBPv9YFBpX/x59XMPgPUU4dyGg/0J2sOJ7O9D98kD+lfdOc7v/60oYo5xzMGct80uFkYLH+X2qgw== + openai@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/openai/-/openai-3.3.0.tgz#a6408016ad0945738e1febf43f2fccca83a3f532" @@ -3291,9 +3301,9 @@ openai@^3.3.0: form-data "^4.0.0" openid-client@^5.4.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.6.0.tgz#3cc084b9a93a5e810a7f309d23812204d08286d9" - integrity sha512-uFTkN/iqgKvSnmpVAS/T6SNThukRMBcmymTQ71Ngus1F60tdtKVap7zCrleocY+fogPtpmoxi5Q1YdrgYuTlkA== + version "5.6.1" + resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.6.1.tgz#8f7526a50c290a5e28a7fe21b3ece3107511bc73" + integrity sha512-PtrWsY+dXg6y8mtMPyL/namZSYVz8pjXz3yJiBNZsEdCnu9miHLB4ELVC85WvneMKo2Rg62Ay7NkuCpM0bgiLQ== dependencies: jose "^4.15.1" lru-cache "^6.0.0" @@ -3409,12 +3419,12 @@ pretty-format@^3.8.0: resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" integrity sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew== -prisma@^4.14.0: - version "4.16.2" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.16.2.tgz#469e0a0991c6ae5bcde289401726bb012253339e" - integrity sha512-SYCsBvDf0/7XSJyf2cHTLjLeTLVXYfqp7pG5eEVafFLeT0u/hLFz/9W196nDRGUOo1JfPatAEb+uEnTQImQC1g== +prisma@^5.2.0: + version "5.4.2" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.4.2.tgz#7eac9276439ec7073ec697c6c0dfa259d96e955e" + integrity sha512-GDMZwZy7mysB2oXU+angQqJ90iaPFdD0rHaZNkn+dio5NRkGLmMqmXs31//tg/qXT3iB0cTQwnGGQNuirhSTZg== dependencies: - "@prisma/engines" "4.16.2" + "@prisma/engines" "5.4.2" prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" @@ -3453,9 +3463,9 @@ react-clientside-effect@^1.2.6: "@babel/runtime" "^7.12.13" react-datepicker@^4.16.0: - version "4.19.0" - resolved "https://registry.yarnpkg.com/react-datepicker/-/react-datepicker-4.19.0.tgz#4b8e5016ee6b88e73682302e761972da00be2fbf" - integrity sha512-p2IVcOdtMDGvaq27yBGQm43rWnPVJ3w6EMGOmNoG3Gh/Li9maDIfrAWJUeLXDXAxYbXkIsQRs5SwrHvKP65juA== + version "4.20.0" + resolved "https://registry.yarnpkg.com/react-datepicker/-/react-datepicker-4.20.0.tgz#611943721ab0847bfacadc38c8760018e9859294" + integrity sha512-I29yHN9SabUDSy7Xq3P8+E8E+D2vyeuYAYYWWjeMisGGtsatltV4CSHodyA7W9z0BuGycc/bhSClDbizx4gZHA== dependencies: "@popperjs/core" "^2.11.8" classnames "^2.2.6" @@ -3555,9 +3565,9 @@ react-remove-scroll-bar@^2.3.4: tslib "^2.0.0" react-remove-scroll@^2.5.6: - version "2.5.6" - resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.6.tgz#7510b8079e9c7eebe00e65a33daaa3aa29a10336" - integrity sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg== + version "2.5.7" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.7.tgz#15a1fd038e8497f65a695bf26a4a57970cac1ccb" + integrity sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA== dependencies: react-remove-scroll-bar "^2.3.4" react-style-singleton "^2.2.1" @@ -3580,9 +3590,9 @@ react-style-singleton@^2.2.1: tslib "^2.0.0" react-type-animation@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/react-type-animation/-/react-type-animation-3.1.0.tgz#7bc3d5e73d8f4677a7808365beaa12f0fee3e033" - integrity sha512-Ju74SpUFpSINqlGU8UeFAF+AnAn0nZcc8MB0Ho6QvRkh8uDKkOzAiMD3l9xEmkbKXnSYsljfVgIDM/zwqEImpQ== + version "3.2.0" + resolved "https://registry.yarnpkg.com/react-type-animation/-/react-type-animation-3.2.0.tgz#6863d5d60e3beb237f2bd690cceb585402c47e6a" + integrity sha512-WXTe0i3rRNKjmggPvT5ntye1QBt0ATGbijeW6V3cQe2W0jaMABXXlPPEdtofnS9tM7wSRHchEvI9SUw+0kUohw== react@18.2.0: version "18.2.0" @@ -3645,20 +3655,20 @@ resolve-pkg-maps@^1.0.0: integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== resolve@^1.19.0, resolve@^1.22.4: - version "1.22.6" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.6.tgz#dd209739eca3aef739c626fea1b4f3c506195362" - integrity sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw== + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" resolve@^2.0.0-next.4: - version "2.0.0-next.4" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" - integrity sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ== + version "2.0.0-next.5" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" + integrity sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== dependencies: - is-core-module "^2.9.0" + is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -4209,6 +4219,11 @@ yaml@^1.10.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yarn@^1.22.19: + version "1.22.19" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" + integrity sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"