set up cf ai worker

This commit is contained in:
Dhravya 2024-02-27 11:35:51 -07:00
parent 5bfb731e03
commit 3f056ccbe8
25 changed files with 75 additions and 50 deletions

1
apps/web/.gitignore vendored
View file

@ -1,4 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
wrangler.toml
# dependencies
/node_modules

View file

@ -1 +1 @@
OaB3peodHjkZq3Assb5S1
SzKUT5sJq-kZX8fUut2pa

View file

@ -1,22 +1,22 @@
{
"pages": {
"/not-found": [
"static/chunks/webpack-363780e1c974ae15.js",
"static/chunks/webpack-409f1dd28331797e.js",
"static/chunks/30b509c0-d7721ce4b2012053.js",
"static/chunks/25-2f3c60275645c813.js",
"static/chunks/main-app-8b951cccf46caf8d.js",
"static/chunks/app/not-found-dbc30055295c6650.js"
],
"/layout": [
"static/chunks/webpack-363780e1c974ae15.js",
"static/chunks/webpack-409f1dd28331797e.js",
"static/chunks/30b509c0-d7721ce4b2012053.js",
"static/chunks/25-2f3c60275645c813.js",
"static/chunks/main-app-8b951cccf46caf8d.js",
"static/css/cd3763a5087d66d7.css",
"static/chunks/app/layout-7fc1a26d3b06a390.js"
"static/css/1327fa673efb0c48.css",
"static/chunks/app/layout-3f46cd5460fe4d0d.js"
],
"/page": [
"static/chunks/webpack-363780e1c974ae15.js",
"static/chunks/webpack-409f1dd28331797e.js",
"static/chunks/30b509c0-d7721ce4b2012053.js",
"static/chunks/25-2f3c60275645c813.js",
"static/chunks/main-app-8b951cccf46caf8d.js",

View file

@ -5,24 +5,24 @@
"devFiles": [],
"ampDevFiles": [],
"lowPriorityFiles": [
"static/OaB3peodHjkZq3Assb5S1/_buildManifest.js",
"static/OaB3peodHjkZq3Assb5S1/_ssgManifest.js"
"static/SzKUT5sJq-kZX8fUut2pa/_buildManifest.js",
"static/SzKUT5sJq-kZX8fUut2pa/_ssgManifest.js"
],
"rootMainFiles": [
"static/chunks/webpack-363780e1c974ae15.js",
"static/chunks/webpack-409f1dd28331797e.js",
"static/chunks/30b509c0-d7721ce4b2012053.js",
"static/chunks/25-2f3c60275645c813.js",
"static/chunks/main-app-8b951cccf46caf8d.js"
],
"pages": {
"/_app": [
"static/chunks/webpack-363780e1c974ae15.js",
"static/chunks/webpack-409f1dd28331797e.js",
"static/chunks/framework-c25027af42eb8c45.js",
"static/chunks/main-2d7b2ac4e61285c5.js",
"static/chunks/pages/_app-508d387925ef2fa9.js"
],
"/_error": [
"static/chunks/webpack-363780e1c974ae15.js",
"static/chunks/webpack-409f1dd28331797e.js",
"static/chunks/framework-c25027af42eb8c45.js",
"static/chunks/main-2d7b2ac4e61285c5.js",
"static/chunks/pages/_error-e16765248192e4ee.js"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
self.__PRERENDER_MANIFEST="{\"version\":4,\"routes\":{\"/favicon.ico\":{\"initialHeaders\":{\"cache-control\":\"public, max-age=0, must-revalidate\",\"content-type\":\"image/x-icon\",\"x-next-cache-tags\":\"_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico\"},\"experimentalBypassFor\":[{\"type\":\"header\",\"key\":\"Next-Action\"},{\"type\":\"header\",\"key\":\"content-type\",\"value\":\"multipart/form-data\"}],\"initialRevalidateSeconds\":false,\"srcRoute\":\"/favicon.ico\",\"dataRoute\":null}},\"dynamicRoutes\":{},\"notFoundRoutes\":[],\"preview\":{\"previewModeId\":\"92fd96037866b5b4b21d0d0e3d3c89a7\",\"previewModeSigningKey\":\"5f32c1e389592c2eef6cb19ba8f03f76432dcbae3a51929dc428c86076f7e54e\",\"previewModeEncryptionKey\":\"1481818f54786afb3e193735b1a444c6213869c1606f6d63e0e839a88bf6a456\"}}"
self.__PRERENDER_MANIFEST="{\"version\":4,\"routes\":{\"/favicon.ico\":{\"initialHeaders\":{\"cache-control\":\"public, max-age=0, must-revalidate\",\"content-type\":\"image/x-icon\",\"x-next-cache-tags\":\"_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico\"},\"experimentalBypassFor\":[{\"type\":\"header\",\"key\":\"Next-Action\"},{\"type\":\"header\",\"key\":\"content-type\",\"value\":\"multipart/form-data\"}],\"initialRevalidateSeconds\":false,\"srcRoute\":\"/favicon.ico\",\"dataRoute\":null}},\"dynamicRoutes\":{},\"notFoundRoutes\":[],\"preview\":{\"previewModeId\":\"c559ba423614f4898a8a8c2b5f5b1772\",\"previewModeSigningKey\":\"7dc2f3f24b1c6fcd662ef08b78e53d2f8b4c46d01e7c17e8c012369a73782aa5\",\"previewModeEncryptionKey\":\"35099dc640f3df6cc521fedd450e30ca419133cf77386add249dad0f56bf3a68\"}}"

View file

@ -1 +1 @@
{"version":4,"routes":{"/favicon.ico":{"initialHeaders":{"cache-control":"public, max-age=0, must-revalidate","content-type":"image/x-icon","x-next-cache-tags":"_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico"},"experimentalBypassFor":[{"type":"header","key":"Next-Action"},{"type":"header","key":"content-type","value":"multipart/form-data"}],"initialRevalidateSeconds":false,"srcRoute":"/favicon.ico","dataRoute":null}},"dynamicRoutes":{},"notFoundRoutes":[],"preview":{"previewModeId":"92fd96037866b5b4b21d0d0e3d3c89a7","previewModeSigningKey":"5f32c1e389592c2eef6cb19ba8f03f76432dcbae3a51929dc428c86076f7e54e","previewModeEncryptionKey":"1481818f54786afb3e193735b1a444c6213869c1606f6d63e0e839a88bf6a456"}}
{"version":4,"routes":{"/favicon.ico":{"initialHeaders":{"cache-control":"public, max-age=0, must-revalidate","content-type":"image/x-icon","x-next-cache-tags":"_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico"},"experimentalBypassFor":[{"type":"header","key":"Next-Action"},{"type":"header","key":"content-type","value":"multipart/form-data"}],"initialRevalidateSeconds":false,"srcRoute":"/favicon.ico","dataRoute":null}},"dynamicRoutes":{},"notFoundRoutes":[],"preview":{"previewModeId":"c559ba423614f4898a8a8c2b5f5b1772","previewModeSigningKey":"7dc2f3f24b1c6fcd662ef08b78e53d2f8b4c46d01e7c17e8c012369a73782aa5","previewModeEncryptionKey":"35099dc640f3df6cc521fedd450e30ca419133cf77386add249dad0f56bf3a68"}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":1,"functions":{"/api/[...nextauth]":{},"/_not-found":{},"/api/store":{},"/api/hello":{},"/":{}}}
{"version":1,"functions":{"/api/[...nextauth]":{},"/_not-found":{},"/api/hello":{},"/api/store":{},"/":{}}}

View file

@ -1 +1 @@
self.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-c67a75d1b6f99dc8.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:["static/OaB3peodHjkZq3Assb5S1/_buildManifest.js","static/OaB3peodHjkZq3Assb5S1/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-363780e1c974ae15.js","static/chunks/30b509c0-d7721ce4b2012053.js","static/chunks/25-2f3c60275645c813.js","static/chunks/main-app-8b951cccf46caf8d.js"],pages:{"/_app":["static/chunks/webpack-363780e1c974ae15.js","static/chunks/framework-c25027af42eb8c45.js","static/chunks/main-2d7b2ac4e61285c5.js","static/chunks/pages/_app-508d387925ef2fa9.js"],"/_error":["static/chunks/webpack-363780e1c974ae15.js","static/chunks/framework-c25027af42eb8c45.js","static/chunks/main-2d7b2ac4e61285c5.js","static/chunks/pages/_error-e16765248192e4ee.js"]},ampFirstPages:[]};
self.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-c67a75d1b6f99dc8.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:["static/SzKUT5sJq-kZX8fUut2pa/_buildManifest.js","static/SzKUT5sJq-kZX8fUut2pa/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-409f1dd28331797e.js","static/chunks/30b509c0-d7721ce4b2012053.js","static/chunks/25-2f3c60275645c813.js","static/chunks/main-app-8b951cccf46caf8d.js"],pages:{"/_app":["static/chunks/webpack-409f1dd28331797e.js","static/chunks/framework-c25027af42eb8c45.js","static/chunks/main-2d7b2ac4e61285c5.js","static/chunks/pages/_app-508d387925ef2fa9.js"],"/_error":["static/chunks/webpack-409f1dd28331797e.js","static/chunks/framework-c25027af42eb8c45.js","static/chunks/main-2d7b2ac4e61285c5.js","static/chunks/pages/_error-e16765248192e4ee.js"]},ampFirstPages:[]};

View file

@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" crossorigin="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-363780e1c974ae15.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/framework-c25027af42eb8c45.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/main-2d7b2ac4e61285c5.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/pages/_app-508d387925ef2fa9.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/pages/_error-e16765248192e4ee.js" defer="" crossorigin=""></script><script src="/_next/static/OaB3peodHjkZq3Assb5S1/_buildManifest.js" defer="" crossorigin=""></script><script src="/_next/static/OaB3peodHjkZq3Assb5S1/_ssgManifest.js" defer="" crossorigin=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"OaB3peodHjkZq3Assb5S1","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>500: Internal Server Error</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" crossorigin="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-409f1dd28331797e.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/framework-c25027af42eb8c45.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/main-2d7b2ac4e61285c5.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/pages/_app-508d387925ef2fa9.js" defer="" crossorigin=""></script><script src="/_next/static/chunks/pages/_error-e16765248192e4ee.js" defer="" crossorigin=""></script><script src="/_next/static/SzKUT5sJq-kZX8fUut2pa/_buildManifest.js" defer="" crossorigin=""></script><script src="/_next/static/SzKUT5sJq-kZX8fUut2pa/_ssgManifest.js" defer="" crossorigin=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"SzKUT5sJq-kZX8fUut2pa","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

View file

@ -1 +1 @@
{"version":1,"files":["../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/pages/_app.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/package.json","../../../node_modules/react","../../../package.json","../../package.json","../webpack-runtime.js"]}
{"version":1,"files":["../webpack-runtime.js","../../../package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/pages/_app.js"]}

View file

@ -1 +1 @@
{"version":1,"files":["../../../node_modules/.pnpm/client-only@0.0.1/node_modules/client-only/index.js","../../../node_modules/.pnpm/client-only@0.0.1/node_modules/client-only/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/lru-cache/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/lru-cache/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/node-html-parser/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/node-html-parser/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/lib/semver-noop.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/pages/_document.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/lib/trace/constants.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/lib/trace/tracer.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/react","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/react-dom","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/styled-jsx","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.development.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/package.json","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/server.browser.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/package.json","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/client-only","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/react","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/styled-jsx/dist/index/index.js","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/styled-jsx/index.js","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/styled-jsx/package.json","../../../node_modules/next","../../../node_modules/react","../../../package.json","../../package.json","../chunks/72.js","../webpack-runtime.js"]}
{"version":1,"files":["../webpack-runtime.js","../chunks/72.js","../../../package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/pages/_document.js"]}

View file

@ -1 +1 @@
{"version":1,"files":["../../../node_modules/.pnpm/client-only@0.0.1/node_modules/client-only/index.js","../../../node_modules/.pnpm/client-only@0.0.1/node_modules/client-only/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/lru-cache/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/lru-cache/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/node-html-parser/index.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/node-html-parser/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/lib/semver-noop.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/lib/trace/constants.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/lib/trace/tracer.js","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/package.json","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/react","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/react-dom","../../../node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/styled-jsx","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.development.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/package.json","../../../node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/server.browser.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","../../../node_modules/.pnpm/react@18.2.0/node_modules/react/package.json","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/client-only","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/react","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/styled-jsx/dist/index/index.js","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/styled-jsx/index.js","../../../node_modules/.pnpm/styled-jsx@5.1.1_react@18.2.0/node_modules/styled-jsx/package.json","../../../node_modules/next","../../../node_modules/react","../../package.json","../chunks/72.js","../webpack-runtime.js"]}
{"version":1,"files":["../webpack-runtime.js","../chunks/72.js"]}

View file

@ -1 +1 @@
self.__RSC_SERVER_MANIFEST="{\"node\":{},\"edge\":{},\"encryptionKey\":\"Xz12aiWmSpv491/074P3fkwyBsGEGww1bcqDt6ANu7Q=\"}"
self.__RSC_SERVER_MANIFEST="{\"node\":{},\"edge\":{},\"encryptionKey\":\"heui3i/UgZrFd0yAF1g+fI4QiULTu5kU7Yvy3TbHbTg=\"}"

View file

@ -1 +1 @@
{"node":{},"edge":{},"encryptionKey":"Xz12aiWmSpv491/074P3fkwyBsGEGww1bcqDt6ANu7Q="}
{"node":{},"edge":{},"encryptionKey":"heui3i/UgZrFd0yAF1g+fI4QiULTu5kU7Yvy3TbHbTg="}

File diff suppressed because one or more lines are too long

View file

@ -2,24 +2,49 @@ import { db } from "@/server/db";
import { eq } from "drizzle-orm";
import { sessions, users } from "@/server/db/schema";
import { type NextRequest, NextResponse } from "next/server";
import { env } from "@/env";
export const runtime = "edge";
export async function GET(req: NextRequest) {
try {
const token = req.cookies.get("next-auth.session-token")?.value ?? req.cookies.get("__Secure-authjs.session-token")?.value ?? req.cookies.get("authjs.session-token")?.value ?? req.headers.get("Authorization")?.replace("Bearer ", "");
export async function POST(req: NextRequest) {
const token = req.cookies.get("next-auth.session-token")?.value ?? req.cookies.get("__Secure-authjs.session-token")?.value ?? req.cookies.get("authjs.session-token")?.value ?? req.headers.get("Authorization")?.replace("Bearer ", "");
console.log(token ? token : 'token not found lol')
console.log(process.env.DATABASE)
console.log(token ? token : 'token not found lol')
console.log(process.env.DATABASE)
const session = await db.select().from(sessions).where(eq(sessions.sessionToken, token!))
.leftJoin(users, eq(sessions.userId, users.id)).limit(1)
const session = await db.select().from(sessions).where(eq(sessions.sessionToken, token!))
.leftJoin(users, eq(sessions.userId, users.id)).limit(1)
if (!session || session.length === 0) {
return NextResponse.json({ message: "Invalid Key, session not found." }, { status: 404 });
}
return NextResponse.json({ message: "OK", data: session }, { status: 200 });
} catch (error) {
return NextResponse.json({ message: "Error", error }, { status: 500 });
if (!session || session.length === 0) {
return NextResponse.json({ message: "Invalid Key, session not found." }, { status: 404 });
}
if (!session[0].user) {
return NextResponse.json({ message: "Invalid Key, session not found." }, { status: 404 });
}
const data = await req.json() as {
pageContent: string,
title?: string,
description?: string,
url: string,
};
const resp = await fetch("https://cf-ai-backend.dhravya.workers.dev/add", {
method: "POST",
headers: {
"X-Custom-Auth-Key": env.BACKEND_SECURITY_KEY,
},
body: JSON.stringify({ ...data, user: session[0].user.email }),
});
const _ = await resp.json();
if (resp.status !== 200) {
return NextResponse.json({ message: "Error", error: "Error in CF function" }, { status: 500 });
}
return NextResponse.json({ message: "OK", data: "Success" }, { status: 200 });
}

View file

@ -23,7 +23,8 @@ export const env = createEnv({
process.env.VERCEL ? z.string() : z.string().url()
),
GOOGLE_CLIENT_ID: z.string(),
GOOGLE_CLIENT_SECRET: z.string()
GOOGLE_CLIENT_SECRET: z.string(),
BACKEND_SECURITY_KEY: z.string(),
},
/**
@ -46,6 +47,7 @@ export const env = createEnv({
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
BACKEND_SECURITY_KEY: process.env.BACKEND_SECURITY_KEY,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially