zigrix 0.1.0-alpha.6 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/.next/BUILD_ID +1 -1
- package/dist/dashboard/.next/app-build-manifest.json +4 -4
- package/dist/dashboard/.next/app-path-routes-manifest.json +1 -1
- package/dist/dashboard/.next/build-manifest.json +2 -2
- package/dist/dashboard/.next/prerender-manifest.json +10 -10
- package/dist/dashboard/.next/server/app/_not-found.html +1 -1
- package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
- package/dist/dashboard/.next/server/app/api/auth/login/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/logout/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/session/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/setup/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/overview/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/stream/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route.js +1 -1
- package/dist/dashboard/.next/server/app/login.html +1 -1
- package/dist/dashboard/.next/server/app/login.rsc +1 -1
- package/dist/dashboard/.next/server/app/setup.html +1 -1
- package/dist/dashboard/.next/server/app/setup.rsc +1 -1
- package/dist/dashboard/.next/server/app-paths-manifest.json +1 -1
- package/dist/dashboard/.next/server/functions-config-manifest.json +3 -3
- package/dist/dashboard/.next/server/middleware.js +1 -1
- package/dist/dashboard/.next/server/pages/404.html +1 -1
- package/dist/dashboard/.next/server/pages/500.html +1 -1
- package/package.json +1 -1
- /package/dist/dashboard/.next/static/{gRA9c2paEVq8f_EGHdXMe → afoa9JVywKLyR6X4Cxspl}/_buildManifest.js +0 -0
- /package/dist/dashboard/.next/static/{gRA9c2paEVq8f_EGHdXMe → afoa9JVywKLyR6X4Cxspl}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
afoa9JVywKLyR6X4Cxspl
|
|
@@ -50,19 +50,19 @@
|
|
|
50
50
|
"static/chunks/main-app-458501fc143f8dcb.js",
|
|
51
51
|
"static/chunks/app/api/overview/route-aaf047a494f0055f.js"
|
|
52
52
|
],
|
|
53
|
-
"/api/tasks/[taskId]/
|
|
53
|
+
"/api/tasks/[taskId]/conversation/route": [
|
|
54
54
|
"static/chunks/webpack-1c485544eee88ef7.js",
|
|
55
55
|
"static/chunks/4bd1b696-c023c6e3521b1417.js",
|
|
56
56
|
"static/chunks/255-ebd51be49873d76c.js",
|
|
57
57
|
"static/chunks/main-app-458501fc143f8dcb.js",
|
|
58
|
-
"static/chunks/app/api/tasks/[taskId]/
|
|
58
|
+
"static/chunks/app/api/tasks/[taskId]/conversation/route-aaf047a494f0055f.js"
|
|
59
59
|
],
|
|
60
|
-
"/api/tasks/[taskId]/
|
|
60
|
+
"/api/tasks/[taskId]/cancel/route": [
|
|
61
61
|
"static/chunks/webpack-1c485544eee88ef7.js",
|
|
62
62
|
"static/chunks/4bd1b696-c023c6e3521b1417.js",
|
|
63
63
|
"static/chunks/255-ebd51be49873d76c.js",
|
|
64
64
|
"static/chunks/main-app-458501fc143f8dcb.js",
|
|
65
|
-
"static/chunks/app/api/tasks/[taskId]/
|
|
65
|
+
"static/chunks/app/api/tasks/[taskId]/cancel/route-aaf047a494f0055f.js"
|
|
66
66
|
],
|
|
67
67
|
"/api/tasks/[taskId]/route": [
|
|
68
68
|
"static/chunks/webpack-1c485544eee88ef7.js",
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"/api/auth/setup/route": "/api/auth/setup",
|
|
6
6
|
"/api/auth/login/route": "/api/auth/login",
|
|
7
7
|
"/api/overview/route": "/api/overview",
|
|
8
|
-
"/api/tasks/[taskId]/cancel/route": "/api/tasks/[taskId]/cancel",
|
|
9
8
|
"/api/tasks/[taskId]/conversation/route": "/api/tasks/[taskId]/conversation",
|
|
9
|
+
"/api/tasks/[taskId]/cancel/route": "/api/tasks/[taskId]/cancel",
|
|
10
10
|
"/api/tasks/[taskId]/route": "/api/tasks/[taskId]",
|
|
11
11
|
"/api/stream/route": "/api/stream",
|
|
12
12
|
"/login/page": "/login",
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"ampDevFiles": [],
|
|
7
7
|
"lowPriorityFiles": [
|
|
8
|
-
"static/
|
|
9
|
-
"static/
|
|
8
|
+
"static/afoa9JVywKLyR6X4Cxspl/_buildManifest.js",
|
|
9
|
+
"static/afoa9JVywKLyR6X4Cxspl/_ssgManifest.js"
|
|
10
10
|
],
|
|
11
11
|
"rootMainFiles": [
|
|
12
12
|
"static/chunks/webpack-1c485544eee88ef7.js",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 4,
|
|
3
3
|
"routes": {
|
|
4
|
-
"/
|
|
5
|
-
"initialStatus": 404,
|
|
4
|
+
"/setup": {
|
|
6
5
|
"experimentalBypassFor": [
|
|
7
6
|
{
|
|
8
7
|
"type": "header",
|
|
@@ -15,8 +14,8 @@
|
|
|
15
14
|
}
|
|
16
15
|
],
|
|
17
16
|
"initialRevalidateSeconds": false,
|
|
18
|
-
"srcRoute": "/
|
|
19
|
-
"dataRoute": "/
|
|
17
|
+
"srcRoute": "/setup",
|
|
18
|
+
"dataRoute": "/setup.rsc",
|
|
20
19
|
"allowHeader": [
|
|
21
20
|
"host",
|
|
22
21
|
"x-matched-path",
|
|
@@ -26,7 +25,8 @@
|
|
|
26
25
|
"x-next-revalidate-tag-token"
|
|
27
26
|
]
|
|
28
27
|
},
|
|
29
|
-
"/
|
|
28
|
+
"/_not-found": {
|
|
29
|
+
"initialStatus": 404,
|
|
30
30
|
"experimentalBypassFor": [
|
|
31
31
|
{
|
|
32
32
|
"type": "header",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"initialRevalidateSeconds": false,
|
|
42
|
-
"srcRoute": "/
|
|
43
|
-
"dataRoute": "/
|
|
42
|
+
"srcRoute": "/_not-found",
|
|
43
|
+
"dataRoute": "/_not-found.rsc",
|
|
44
44
|
"allowHeader": [
|
|
45
45
|
"host",
|
|
46
46
|
"x-matched-path",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"x-next-revalidate-tag-token"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"/
|
|
53
|
+
"/login": {
|
|
54
54
|
"experimentalBypassFor": [
|
|
55
55
|
{
|
|
56
56
|
"type": "header",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
65
|
"initialRevalidateSeconds": false,
|
|
66
|
-
"srcRoute": "/
|
|
67
|
-
"dataRoute": "/
|
|
66
|
+
"srcRoute": "/login",
|
|
67
|
+
"dataRoute": "/login.rsc",
|
|
68
68
|
"allowHeader": [
|
|
69
69
|
"host",
|
|
70
70
|
"x-matched-path",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--afoa9JVywKLyR6X4Cxspl--><html lang="ko"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/9f7ffdac282b0450.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1c485544eee88ef7.js"/><script src="/_next/static/chunks/4bd1b696-c023c6e3521b1417.js" async=""></script><script src="/_next/static/chunks/255-ebd51be49873d76c.js" async=""></script><script src="/_next/static/chunks/main-app-458501fc143f8dcb.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Zigrix Dashboard</title><meta name="description" content="Zigrix task orchestration dashboard"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><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:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-1c485544eee88ef7.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[9766,[],\"\"]\n3:I[8924,[],\"\"]\n4:I[4431,[],\"OutletBoundary\"]\n6:I[5278,[],\"AsyncMetadataOutlet\"]\n8:I[4431,[],\"ViewportBoundary\"]\na:I[4431,[],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[7150,[],\"\"]\n:HL[\"/_next/static/css/9f7ffdac282b0450.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"afoa9JVywKLyR6X4Cxspl\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9f7ffdac282b0450.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"ko\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"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)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Zigrix Dashboard\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Zigrix task orchestration dashboard\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"c:\"$7:metadata\"\n"])</script></body></html>
|
|
@@ -8,7 +8,7 @@ a:I[4431,[],"MetadataBoundary"]
|
|
|
8
8
|
b:"$Sreact.suspense"
|
|
9
9
|
d:I[7150,[],""]
|
|
10
10
|
:HL["/_next/static/css/9f7ffdac282b0450.css","style"]
|
|
11
|
-
0:{"P":null,"b":"
|
|
11
|
+
0:{"P":null,"b":"afoa9JVywKLyR6X4Cxspl","p":"","c":["","_not-found"],"i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9f7ffdac282b0450.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"ko","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["/_not-found",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"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)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$L5",["$","$L6",null,{"promise":"$@7"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],[["$","$L8",null,{"children":"$L9"}],null],["$","$La",null,{"children":["$","div",null,{"hidden":true,"children":["$","$b",null,{"fallback":null,"children":"$Lc"}]}]}]]}],false]],"m":"$undefined","G":["$d",[]],"s":false,"S":true}
|
|
12
12
|
9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
13
13
|
5:null
|
|
14
14
|
7:{"metadata":[["$","title","0",{"children":"Zigrix Dashboard"}],["$","meta","1",{"name":"description","content":"Zigrix task orchestration dashboard"}]],"error":null,"digest":"$undefined"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=758,a.ids=[758],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");return b?{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}:{allowedOrigin:null,origin:null}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},57510:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>O,patchFetch:()=>N,routeModule:()=>J,serverHooks:()=>M,workAsyncStorage:()=>K,workUnitAsyncStorage:()=>L});var d={};c.r(d),c.d(d,{OPTIONS:()=>H,POST:()=>I,runtime:()=>G});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360);let w=new Map,x=new Map,y=0;function z(a){return(a||"unknown").trim().toLowerCase()}function A(a){return(a||"").trim().toLowerCase()}function B(a){if(!(a-y<6e4)){y=a;w.forEach((b,c)=>{a-b.lastSeenAtMs>36e4&&w.delete(c)}),x.forEach((b,c)=>{a-b.lastSeenAtMs>36e4&&x.delete(c)})}}function C(a,b,c){let d=a.get(b);if(!d)return null;let e=c-d.firstFailureAtMs>=6e4,f=d.lockedUntilMs<=c;return e&&f?(a.delete(b),null):d}function D(a,b){if(!(b-a.firstFailureAtMs<6e4))return a.lockedUntilMs>b?a.lockedUntilMs:null;let c=Math.max(a.failures>=5?a.firstFailureAtMs+6e4:0,a.lockedUntilMs>b?a.lockedUntilMs:0);return c>b?c:null}function E(a,b,c){let d=a.get(b),e=!d||c-d.firstFailureAtMs>=6e4?{failures:0,firstFailureAtMs:c,lockedUntilMs:0,lastSeenAtMs:c}:d;if(e.failures+=1,e.lastSeenAtMs=c,e.failures>=5){let a=e.failures-5,b=Math.min(3e5,15e3*2**a);e.lockedUntilMs=Math.max(e.lockedUntilMs,c+b)}return a.set(b,e),D(e,c)}var F=c(3563);let G="nodejs";function H(a){return(0,F.rp)(a,["POST","OPTIONS"])}async function I(a){let b,c=(0,F.wx)(a);if(c)return c;if((0,v.dV)())return(0,F.mN)(a,u.NextResponse.json({error:"Setup required"},{status:403}));let d=a.headers.get("x-forwarded-for")?.split(",")[0]?.trim()||a.headers.get("x-real-ip")||"unknown";try{b=await a.json()}catch{return(0,F.mN)(a,u.NextResponse.json({error:"Invalid JSON body"},{status:400}))}if(!b||"object"!=typeof b||Array.isArray(b))return(0,F.mN)(a,u.NextResponse.json({error:"Invalid request body"},{status:400}));let{username:e,password:f}=b;if("string"!=typeof e||!e.trim())return(0,F.mN)(a,u.NextResponse.json({error:"username is required"},{status:400}));if("string"!=typeof f)return(0,F.mN)(a,u.NextResponse.json({error:"password is required"},{status:400}));let g=e.trim(),h=function(a,b){let c=Date.now();B(c);let d=C(w,z(a),c),e=C(x,A(b),c),f=Math.max((d?D(d,c):null)??0,(e?D(e,c):null)??0);return f?{limited:!0,retryAfterSeconds:Math.max(1,Math.ceil((f-c)/1e3))}:{limited:!1,retryAfterSeconds:0}}(d,g);if(h.limited)return(0,F.mN)(a,u.NextResponse.json({error:"Too many attempts. Try again later."},{status:429,headers:{"Retry-After":String(h.retryAfterSeconds)}}));if(!await (0,v.BE)(g,f)){let b=Date.now();return B(b),E(w,z(d),b),E(x,A(g),b),(0,F.mN)(a,u.NextResponse.json({error:"Invalid credentials"},{status:401}))}w.delete(z(d)),x.delete(A(g));let i=await (0,v.jw)(g),j=u.NextResponse.json({ok:!0,username:g});return j.cookies.set(v.IX,i,{httpOnly:!0,secure:!0,sameSite:"lax",maxAge:v.gw,path:"/"}),(0,F.mN)(a,j)}let J=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/login/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:K,workUnitAsyncStorage:L,serverHooks:M}=J;function N(){return(0,g.patchFetch)({workAsyncStorage:K,workUnitAsyncStorage:L})}async function O(a,b,c){var d;let e="/api/auth/login/route";"/index"===e&&(e="/");let g=await J.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let F=null;!E||J.isDev||x||(F="/index"===(F=C)?"/":F);let G=!0===J.isDev||!E,H=E&&!G,I=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:G,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:H,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>J.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>J.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${I} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${I} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await J.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:H,isOnDemandRevalidate:A})},z),b}},l=await J.handleResponse({req:a,nextConfig:w,cacheKey:F,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${I} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":I,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await J.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:H,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=57510));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=758,a.ids=[758],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");if(!b)return{allowedOrigin:null,origin:null};try{if(new URL(a.url).origin===b)return{allowedOrigin:b,origin:b}}catch{}return{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},57510:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>O,patchFetch:()=>N,routeModule:()=>J,serverHooks:()=>M,workAsyncStorage:()=>K,workUnitAsyncStorage:()=>L});var d={};c.r(d),c.d(d,{OPTIONS:()=>H,POST:()=>I,runtime:()=>G});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360);let w=new Map,x=new Map,y=0;function z(a){return(a||"unknown").trim().toLowerCase()}function A(a){return(a||"").trim().toLowerCase()}function B(a){if(!(a-y<6e4)){y=a;w.forEach((b,c)=>{a-b.lastSeenAtMs>36e4&&w.delete(c)}),x.forEach((b,c)=>{a-b.lastSeenAtMs>36e4&&x.delete(c)})}}function C(a,b,c){let d=a.get(b);if(!d)return null;let e=c-d.firstFailureAtMs>=6e4,f=d.lockedUntilMs<=c;return e&&f?(a.delete(b),null):d}function D(a,b){if(!(b-a.firstFailureAtMs<6e4))return a.lockedUntilMs>b?a.lockedUntilMs:null;let c=Math.max(a.failures>=5?a.firstFailureAtMs+6e4:0,a.lockedUntilMs>b?a.lockedUntilMs:0);return c>b?c:null}function E(a,b,c){let d=a.get(b),e=!d||c-d.firstFailureAtMs>=6e4?{failures:0,firstFailureAtMs:c,lockedUntilMs:0,lastSeenAtMs:c}:d;if(e.failures+=1,e.lastSeenAtMs=c,e.failures>=5){let a=e.failures-5,b=Math.min(3e5,15e3*2**a);e.lockedUntilMs=Math.max(e.lockedUntilMs,c+b)}return a.set(b,e),D(e,c)}var F=c(3563);let G="nodejs";function H(a){return(0,F.rp)(a,["POST","OPTIONS"])}async function I(a){let b,c=(0,F.wx)(a);if(c)return c;if((0,v.dV)())return(0,F.mN)(a,u.NextResponse.json({error:"Setup required"},{status:403}));let d=a.headers.get("x-forwarded-for")?.split(",")[0]?.trim()||a.headers.get("x-real-ip")||"unknown";try{b=await a.json()}catch{return(0,F.mN)(a,u.NextResponse.json({error:"Invalid JSON body"},{status:400}))}if(!b||"object"!=typeof b||Array.isArray(b))return(0,F.mN)(a,u.NextResponse.json({error:"Invalid request body"},{status:400}));let{username:e,password:f}=b;if("string"!=typeof e||!e.trim())return(0,F.mN)(a,u.NextResponse.json({error:"username is required"},{status:400}));if("string"!=typeof f)return(0,F.mN)(a,u.NextResponse.json({error:"password is required"},{status:400}));let g=e.trim(),h=function(a,b){let c=Date.now();B(c);let d=C(w,z(a),c),e=C(x,A(b),c),f=Math.max((d?D(d,c):null)??0,(e?D(e,c):null)??0);return f?{limited:!0,retryAfterSeconds:Math.max(1,Math.ceil((f-c)/1e3))}:{limited:!1,retryAfterSeconds:0}}(d,g);if(h.limited)return(0,F.mN)(a,u.NextResponse.json({error:"Too many attempts. Try again later."},{status:429,headers:{"Retry-After":String(h.retryAfterSeconds)}}));if(!await (0,v.BE)(g,f)){let b=Date.now();return B(b),E(w,z(d),b),E(x,A(g),b),(0,F.mN)(a,u.NextResponse.json({error:"Invalid credentials"},{status:401}))}w.delete(z(d)),x.delete(A(g));let i=await (0,v.jw)(g),j=u.NextResponse.json({ok:!0,username:g});return j.cookies.set(v.IX,i,{httpOnly:!0,secure:!0,sameSite:"lax",maxAge:v.gw,path:"/"}),(0,F.mN)(a,j)}let J=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/login/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:K,workUnitAsyncStorage:L,serverHooks:M}=J;function N(){return(0,g.patchFetch)({workAsyncStorage:K,workUnitAsyncStorage:L})}async function O(a,b,c){var d;let e="/api/auth/login/route";"/index"===e&&(e="/");let g=await J.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let F=null;!E||J.isDev||x||(F="/index"===(F=C)?"/":F);let G=!0===J.isDev||!E,H=E&&!G,I=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:G,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:H,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>J.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>J.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${I} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${I} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await J.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:H,isOnDemandRevalidate:A})},z),b}},l=await J.handleResponse({req:a,nextConfig:w,cacheKey:F,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${I} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":I,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await J.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:H,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=57510));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=489,a.ids=[489],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");return b?{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}:{allowedOrigin:null,origin:null}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10086:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{OPTIONS:()=>y,POST:()=>z,runtime:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360),w=c(3563);let x="nodejs";function y(a){return(0,w.rp)(a,["POST","OPTIONS"])}async function z(a){let b=(0,w.wx)(a);if(b)return b;let c=u.NextResponse.json({ok:!0});return c.cookies.set(v.IX,"",{httpOnly:!0,secure:!0,sameSite:"lax",maxAge:0,path:"/"}),(0,w.mN)(a,c)}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/logout/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){var d;let e="/api/auth/logout/route";"/index"===e&&(e="/");let g=await A.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||A.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===A.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>A.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>A.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},z),b}},l=await A.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=10086));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=489,a.ids=[489],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");if(!b)return{allowedOrigin:null,origin:null};try{if(new URL(a.url).origin===b)return{allowedOrigin:b,origin:b}}catch{}return{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10086:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{OPTIONS:()=>y,POST:()=>z,runtime:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360),w=c(3563);let x="nodejs";function y(a){return(0,w.rp)(a,["POST","OPTIONS"])}async function z(a){let b=(0,w.wx)(a);if(b)return b;let c=u.NextResponse.json({ok:!0});return c.cookies.set(v.IX,"",{httpOnly:!0,secure:!0,sameSite:"lax",maxAge:0,path:"/"}),(0,w.mN)(a,c)}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/logout/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){var d;let e="/api/auth/logout/route";"/index"===e&&(e="/");let g=await A.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||A.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===A.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>A.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>A.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},z),b}},l=await A.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=10086));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=745,a.ids=[745],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");return b?{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}:{allowedOrigin:null,origin:null}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},85017:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z,OPTIONS:()=>y,runtime:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360),w=c(3563);let x="nodejs";function y(a){return(0,w.rp)(a,["GET","OPTIONS"])}async function z(a){let b=(0,w.wx)(a);if(b)return b;let c=a.cookies.get(v.IX)?.value,d=await (0,v.gV)(c);return d?(0,w.mN)(a,u.NextResponse.json({authenticated:!0,username:d.username,issuedAt:new Date(1e3*d.issuedAt).toISOString(),expiresAt:new Date(1e3*d.expiresAt).toISOString()})):(0,w.mN)(a,u.NextResponse.json({authenticated:!1},{status:401}))}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/session/route",pathname:"/api/auth/session",filename:"route",bundlePath:"app/api/auth/session/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/session/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){var d;let e="/api/auth/session/route";"/index"===e&&(e="/");let g=await A.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||A.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===A.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>A.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>A.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},z),b}},l=await A.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=85017));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=745,a.ids=[745],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");if(!b)return{allowedOrigin:null,origin:null};try{if(new URL(a.url).origin===b)return{allowedOrigin:b,origin:b}}catch{}return{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},85017:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z,OPTIONS:()=>y,runtime:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360),w=c(3563);let x="nodejs";function y(a){return(0,w.rp)(a,["GET","OPTIONS"])}async function z(a){let b=(0,w.wx)(a);if(b)return b;let c=a.cookies.get(v.IX)?.value,d=await (0,v.gV)(c);return d?(0,w.mN)(a,u.NextResponse.json({authenticated:!0,username:d.username,issuedAt:new Date(1e3*d.issuedAt).toISOString(),expiresAt:new Date(1e3*d.expiresAt).toISOString()})):(0,w.mN)(a,u.NextResponse.json({authenticated:!1},{status:401}))}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/session/route",pathname:"/api/auth/session",filename:"route",bundlePath:"app/api/auth/session/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/session/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){var d;let e="/api/auth/session/route";"/index"===e&&(e="/");let g=await A.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||A.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===A.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>A.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>A.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},z),b}},l=await A.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=85017));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=490,a.ids=[490],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");return b?{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}:{allowedOrigin:null,origin:null}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},26745:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>z,OPTIONS:()=>y,POST:()=>A,runtime:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360),w=c(3563);let x="nodejs";function y(a){return(0,w.rp)(a,["GET","POST","OPTIONS"])}async function z(a){let b=(0,w.wx)(a);return b||((0,v.dV)()?(0,w.mN)(a,u.NextResponse.json({setupRequired:!0})):(0,w.mN)(a,u.NextResponse.json({error:"Not found"},{status:404})))}async function A(a){let b,c=(0,w.wx)(a);if(c)return c;if(!(0,v.dV)())return(0,w.mN)(a,u.NextResponse.json({error:"Not found"},{status:404}));try{b=await a.json()}catch{return(0,w.mN)(a,u.NextResponse.json({error:"Invalid JSON body"},{status:400}))}if(!b||"object"!=typeof b||Array.isArray(b))return(0,w.mN)(a,u.NextResponse.json({error:"Invalid request body"},{status:400}));let{username:d,password:e}=b;if("string"!=typeof d||!d.trim())return(0,w.mN)(a,u.NextResponse.json({error:"username is required"},{status:400}));if("string"!=typeof e||e.length<8)return(0,w.mN)(a,u.NextResponse.json({error:"password must be at least 8 characters"},{status:400}));try{return await (0,v.xC)(d.trim(),e),(0,w.mN)(a,u.NextResponse.json({ok:!0}))}catch(b){return console.error("[setup] Failed to create admin:",b),(0,w.mN)(a,u.NextResponse.json({error:"Failed to create admin account"},{status:500}))}}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/setup/route",pathname:"/api/auth/setup",filename:"route",bundlePath:"app/api/auth/setup/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/setup/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){var d;let e="/api/auth/setup/route";"/index"===e&&(e="/");let g=await B.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||B.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===B.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>B.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>B.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await B.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await B.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await B.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=26745));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=490,a.ids=[490],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");if(!b)return{allowedOrigin:null,origin:null};try{if(new URL(a.url).origin===b)return{allowedOrigin:b,origin:b}}catch{}return{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47600:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{GET:()=>B,OPTIONS:()=>A,POST:()=>C,runtime:()=>z});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(67360),w=c(3563);let x=new Set(["localhost","127.0.0.1","::1","[::1]"]);function y(a){let b=function(a){let b=a.headers.get("x-forwarded-for");if(b){let a=b.split(",")[0]?.trim();if(a)return a}let c=a.headers.get("x-real-ip")?.trim();return c||null}(a);if(b){let a=b.trim().toLowerCase();return!!a&&("::1"===a||"[::1]"===a||a.startsWith("127.")||a.startsWith("::ffff:127."))}try{let b=new URL(a.url).hostname.toLowerCase();return x.has(b)}catch{return!1}}let z="nodejs";function A(a){return(0,w.rp)(a,["GET","POST","OPTIONS"])}async function B(a){let b=(0,w.wx)(a);return b||(y(a)?(0,v.dV)()?(0,w.mN)(a,u.NextResponse.json({setupRequired:!0})):(0,w.mN)(a,u.NextResponse.json({error:"Not found"},{status:404})):(0,w.mN)(a,u.NextResponse.json({error:"Setup is allowed only from local access"},{status:403})))}async function C(a){let b,c=(0,w.wx)(a);if(c)return c;if(!y(a))return(0,w.mN)(a,u.NextResponse.json({error:"Setup is allowed only from local access"},{status:403}));if(!(0,v.dV)())return(0,w.mN)(a,u.NextResponse.json({error:"Not found"},{status:404}));try{b=await a.json()}catch{return(0,w.mN)(a,u.NextResponse.json({error:"Invalid JSON body"},{status:400}))}if(!b||"object"!=typeof b||Array.isArray(b))return(0,w.mN)(a,u.NextResponse.json({error:"Invalid request body"},{status:400}));let{username:d,password:e}=b;if("string"!=typeof d||!d.trim())return(0,w.mN)(a,u.NextResponse.json({error:"username is required"},{status:400}));if("string"!=typeof e||e.length<8)return(0,w.mN)(a,u.NextResponse.json({error:"password must be at least 8 characters"},{status:400}));try{return await (0,v.xC)(d.trim(),e),(0,w.mN)(a,u.NextResponse.json({ok:!0}))}catch(b){return console.error("[setup] Failed to create admin:",b),(0,w.mN)(a,u.NextResponse.json({error:"Failed to create admin account"},{status:500}))}}let D=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/setup/route",pathname:"/api/auth/setup",filename:"route",bundlePath:"app/api/auth/setup/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/auth/setup/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){var d;let e="/api/auth/setup/route";"/index"===e&&(e="/");let g=await D.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[C]);if(F&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||D.isDev||x||(G="/index"===(G=C)?"/":G);let H=!0===D.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>D.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>D.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await D.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await D.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67360:(a,b,c)=>{"use strict";c.d(b,{BE:()=>w,IX:()=>n,TI:()=>t,dV:()=>u,gV:()=>A,gw:()=>o,jw:()=>z,xC:()=>v});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h),j=c(77598),k=c.n(j),l=c(74729),m=c.n(l);let n="zigrix_session",o=43200,p=new TextEncoder,q=new TextDecoder;function r(){return process.env.ZIGRIX_HOME||g().join(i().homedir(),".zigrix")}function s(){return g().join(r(),"dashboard.json")}function t(){let a=s();try{let b=e().readFileSync(a,"utf-8"),c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c))return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""};return{admins:Array.isArray(c.admins)?c.admins:[],sessionSecret:"string"==typeof c.sessionSecret?c.sessionSecret:"",corsOrigins:Array.isArray(c.corsOrigins)?c.corsOrigins:[],createdAt:"string"==typeof c.createdAt?c.createdAt:""}}catch{return{admins:[],sessionSecret:"",corsOrigins:[],createdAt:""}}}function u(){return 0===t().admins.length}async function v(a,b){let c={admins:[{username:a,passwordHash:await m().hash(b,12)}],sessionSecret:k().randomBytes(64).toString("hex"),corsOrigins:["http://localhost:3000"],createdAt:new Date().toISOString()},d=s(),f=r();e().existsSync(f)||e().mkdirSync(f,{recursive:!0}),e().writeFileSync(d,JSON.stringify(c,null,2),{encoding:"utf-8",mode:384});try{e().chmodSync(d,384)}catch{}}async function w(a,b){let c=t().admins.find(b=>b.username===a);if(!c)return await m().hash(b,12),!1;if(!await m().compare(b,c.passwordHash))return!1;let d=p.encode(a),e=p.encode(c.username);return d.length===e.length&&k().timingSafeEqual(d,e)}function x(a){return Buffer.from(a).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function y(a,b){let c=await k().subtle.importKey("raw",p.encode(b),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return x(new Uint8Array(await k().subtle.sign("HMAC",c,p.encode(a))))}async function z(a){let b=t().sessionSecret;if(!b)throw Error("Session secret not configured. Run setup first.");let c=Math.floor(Date.now()/1e3),d=x(p.encode(JSON.stringify({sub:a,iat:c,exp:c+o}))),e=await y(d,b);return`${d}.${e}`}async function A(a){let b;if(!a)return null;let c=a.split(".");if(2!==c.length)return null;let[d,e]=c;if(!d||!e)return null;let f=t().sessionSecret;if(!f||!function(a,b){if(a.length!==b.length)return!1;let c=p.encode(a),d=p.encode(b);return k().timingSafeEqual(c,d)}(await y(d,f),e))return null;try{let a=q.decode(function(a){let b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.padEnd(4*Math.ceil(b.length/4),"=");return new Uint8Array(Buffer.from(c,"base64"))}(d));b=JSON.parse(a)}catch{return null}if("number"!=typeof b.exp||"number"!=typeof b.iat)return null;let g=Math.floor(Date.now()/1e3);return b.exp<=g||b.iat>g+60?null:{username:"string"==typeof b.sub?b.sub:"",issuedAt:b.iat,expiresAt:b.exp}}},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692],()=>b(b.s=47600));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=647,a.ids=[647],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");return b
|
|
1
|
+
(()=>{var a={};a.id=647,a.ids=[647],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");if(!b)return{allowedOrigin:null,origin:null};try{if(new URL(a.url).origin===b)return{allowedOrigin:b,origin:b}}catch{}return{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},84453:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>B,OPTIONS:()=>A,dynamic:()=>y,runtime:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(48383),w=c(3563);let x="nodejs",y="force-dynamic",z=(0,v.HB)();function A(a){return(0,w.rp)(a,["GET","OPTIONS"])}async function B(a){let b=(0,w.wx)(a);if(b)return b;try{let b=z.loadOverview();return(0,w.mN)(a,u.NextResponse.json(b))}catch(b){return console.error("[overview] Failed to load overview:",b),(0,w.mN)(a,u.NextResponse.json({error:"Failed to load overview data"},{status:500}))}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/overview/route",pathname:"/api/overview",filename:"route",bundlePath:"app/api/overview/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/overview/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){var d;let e="/api/overview/route";"/index"===e&&(e="/");let g=await C.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||C.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===C.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>C.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>C.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await C.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692,972],()=>b(b.s=84453));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=918,a.ids=[918],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");return b
|
|
1
|
+
(()=>{var a={};a.id=918,a.ids=[918],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3563:(a,b,c)=>{"use strict";c.d(b,{mN:()=>i,rp:()=>j,wx:()=>h});var d=c(10641),e=c(67360);function f(a){let b=a.headers.get("origin");if(!b)return{allowedOrigin:null,origin:null};try{if(new URL(a.url).origin===b)return{allowedOrigin:b,origin:b}}catch{}return{allowedOrigin:(function(){let a=(0,e.TI)(),b=new Set;for(let c of a.corsOrigins){if("string"!=typeof c)continue;let a=c.trim();a&&"*"!==a&&b.add(a)}return Array.from(b)})().find(a=>a===b)||null,origin:b}}function g(a){let b=a.get("Vary");if(!b)return void a.set("Vary","Origin");let c=b.split(",").map(a=>a.trim()).filter(Boolean);c.includes("Origin")||(c.push("Origin"),a.set("Vary",c.join(", ")))}function h(a){let{allowedOrigin:b,origin:c}=f(a);if(!c||b)return null;let e=d.NextResponse.json({error:"Forbidden"},{status:403});return g(e.headers),e}function i(a,b){let c=new Headers(b.headers);g(c);let{allowedOrigin:d}=f(a);return d&&(c.set("Access-Control-Allow-Origin",d),c.set("Access-Control-Allow-Credentials","true")),new Response(b.body,{status:b.status,statusText:b.statusText,headers:c})}function j(a,b){let{allowedOrigin:c,origin:e}=f(a);if(e&&!c){let a=d.NextResponse.json({error:"Forbidden"},{status:403});return g(a.headers),a}let h=new d.NextResponse(null,{status:204});if(g(h.headers),!c)return h;let i=a.headers.get("access-control-request-headers");return h.headers.set("Access-Control-Allow-Origin",c),h.headers.set("Access-Control-Allow-Credentials","true"),h.headers.set("Access-Control-Allow-Methods",b.join(", ")),h.headers.set("Access-Control-Allow-Headers",i||"Content-Type, Authorization"),h.headers.set("Access-Control-Max-Age",String(600)),h}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{"use strict";a.exports=require("node:fs")},74729:a=>{"use strict";a.exports=require("bcryptjs")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},84066:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>L,patchFetch:()=>K,routeModule:()=>G,serverHooks:()=>J,workAsyncStorage:()=>H,workUnitAsyncStorage:()=>I});var d={};c.r(d),c.d(d,{GET:()=>F,OPTIONS:()=>E,dynamic:()=>A,runtime:()=>z});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(73024),v=c.n(u),w=c(48383),x=c(67360),y=c(3563);let z="nodejs",A="force-dynamic",B=(0,w.HB)(),C=new TextEncoder;function D(a){try{let b=v().statSync(a);return`${b.mtimeMs}:${b.size}`}catch{return null}}function E(a){return(0,y.rp)(a,["GET","OPTIONS"])}async function F(a){let b=(0,y.wx)(a);if(b)return b;let c=a.cookies.get(x.IX)?.value;if(!await (0,x.gV)(c))return(0,y.mN)(a,new Response(JSON.stringify({error:"Unauthorized"}),{status:401,headers:{"Content-Type":"application/json"}}));let d=new URL(a.url),e=d.searchParams.get("taskId")||null,f=d.searchParams.get("lastEventTs")||null,g=new ReadableStream({start(b){let c=!1,d=0,g=[],h=(a,e)=>{c||(d+=1,b.enqueue(function(a,b,c){let d=[];return"number"==typeof c?.retryMs&&c.retryMs>0&&d.push(`retry: ${Math.floor(c.retryMs)}`),c?.id&&d.push(`id: ${c.id}`),d.push(`event: ${a}`),d.push(`data: ${JSON.stringify(b)}`),C.encode(`${d.join("\n")}
|
|
2
2
|
|
|
3
3
|
`)}(a,e,{id:`${Date.now()}-${d}`,retryMs:3e3})))},i=!1,j=()=>{c||!e||i||(i=!0,B.loadTaskConversation(e).then(a=>{i=!1,c||h("conversation_update",{ts:new Date().toISOString(),taskId:a.taskId,sessionKeys:a.sessionKeys,stream:a.stream,recentEvents:a.recentEvents,openclawAvailable:a.openclawAvailable})}).catch(()=>{i=!1}))},k=()=>{if(!c&&e)try{let a=B.loadTaskDetail(e);h("task_detail_update",{ts:new Date().toISOString(),taskId:e,detail:a})}catch{}},l=D(B.paths.eventsPath),m=setInterval(()=>{let a=D(B.paths.eventsPath);if(a!==l){if(l=a,!c)try{let a=B.loadOverview();h("event_update",{ts:new Date().toISOString(),recentEvents:a.recentEvents,taskHistory:a.taskHistory,bucketCounts:a.bucketCounts})}catch{}k()}},1e3);if(g.push(()=>clearInterval(m)),e){let a=new Map,b=`${B.paths.specsDir}/${e}.meta.json`,c=D(b),d=()=>{try{let b=B.getTaskSessionFilePaths(e),c=!1,d=new Set(b);for(let b of Array.from(a.keys()))d.has(b)||(a.delete(b),c=!0);for(let d of b){let b=D(d);a.has(d)&&a.get(d)===b||(a.set(d,b),c=!0)}return c}catch{return!1}};d();let f=setInterval(()=>{d()&&j()},1e3);g.push(()=>clearInterval(f));let h=`${B.paths.evidenceDir}/${e}`,i=()=>{try{if(!v().existsSync(h))return null;return v().readdirSync(h).filter(a=>a.endsWith(".json")).map(a=>`${a}:${D(`${h}/${a}`)}`).join("|")}catch{return null}},l=i(),m=setInterval(()=>{let a=!1,d=D(b);d!==c&&(c=d,a=!0);let e=i();e!==l&&(l=e,a=!0),a&&(k(),j())},1e3);g.push(()=>clearInterval(m))}let n=setInterval(()=>{h("ping",{ts:new Date().toISOString()})},15e3);g.push(()=>clearInterval(n));let o=()=>(()=>{if(!c){for(let a of(c=!0,g))try{a()}catch{}g.length=0;try{b.close()}catch{}}})();if(a.signal.addEventListener("abort",o,{once:!0}),g.push(()=>a.signal.removeEventListener("abort",o)),f)try{let a=function(a){let b=(()=>{try{return v().readFileSync(B.paths.eventsPath,"utf-8")}catch{return""}})();if(!b.trim())return[];let c=[];for(let d of b.split(/\r?\n/))if(d.trim())try{let b=JSON.parse(d),e=b.ts;"string"==typeof e&&e>a&&c.push(b)}catch{}return c}(f);if(a.length>0){let b=B.loadOverview();h("event_update",{ts:new Date().toISOString(),recentEvents:b.recentEvents,taskHistory:b.taskHistory,bucketCounts:b.bucketCounts,missedEvents:a})}else{let a=B.loadOverview();h("event_update",{ts:new Date().toISOString(),recentEvents:a.recentEvents,taskHistory:a.taskHistory,bucketCounts:a.bucketCounts})}}catch{try{let a=B.loadOverview();h("update",{ts:new Date().toISOString(),reason:"reconnect_fallback",overview:a})}catch{}}else try{let a=B.loadOverview();h("update",{ts:new Date().toISOString(),reason:"initial",overview:a,latestEvent:a.recentEvents[0]||null,refresh:{overview:!0,recentEvents:!0,taskIds:[],conversationTaskIds:e?[e]:[]}})}catch{}e&&j()},cancel(){}});return(0,y.mN)(a,new Response(g,{headers:{"Content-Type":"text/event-stream; charset=utf-8","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}let G=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/stream/route",pathname:"/api/stream",filename:"route",bundlePath:"app/api/stream/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/janos/.openclaw/workspace/projects/zigrix/dashboard/src/app/api/stream/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:H,workUnitAsyncStorage:I,serverHooks:J}=G;function K(){return(0,g.patchFetch)({workAsyncStorage:H,workUnitAsyncStorage:I})}async function L(a,b,c){var d;let e="/api/stream/route";"/index"===e&&(e="/");let g=await G.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let F=null;!E||G.isDev||x||(F="/index"===(F=C)?"/":F);let H=!0===G.isDev||!E,I=E&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>G.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>G.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await G.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await G.handleResponse({req:a,nextConfig:w,cacheKey:F,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await G.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692,972],()=>b(b.s=84066));module.exports=c})();
|