@dashwire/server 0.5.0 → 0.7.0
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/index.js +10 -21
- package/package.json +1 -1
- package/public/404/index.html +1 -0
- package/public/404.html +1 -1
- package/public/_next/static/chunks/{117-5bdd47edc08524f9.js → 117-ccb2edbe70d1646b.js} +1 -1
- package/public/_next/static/chunks/main-f78a79381de1e450.js +1 -0
- package/public/index.html +1 -1
- package/public/index.txt +1 -1
- package/public/login/index.html +1 -0
- package/public/{login.txt → login/index.txt} +1 -1
- package/public/projects/index.html +1 -0
- package/public/{projects.txt → projects/index.txt} +1 -1
- package/public/security/index.html +1 -0
- package/public/{security.txt → security/index.txt} +1 -1
- package/public/setup/index.html +1 -0
- package/public/{setup.txt → setup/index.txt} +1 -1
- package/public/users/index.html +1 -0
- package/public/{users.txt → users/index.txt} +1 -1
- package/public/_next/static/chunks/main-a2f7bb812f950d68.js +0 -1
- package/public/login.html +0 -1
- package/public/projects.html +0 -1
- package/public/security.html +0 -1
- package/public/setup.html +0 -1
- package/public/users.html +0 -1
- /package/public/_next/static/{TvJNogLk013ve6RbE7Vv7 → 5AVLeb4nYng3dTaQwNq8I}/_buildManifest.js +0 -0
- /package/public/_next/static/{TvJNogLk013ve6RbE7Vv7 → 5AVLeb4nYng3dTaQwNq8I}/_ssgManifest.js +0 -0
package/dist/index.js
CHANGED
|
@@ -4,13 +4,16 @@ import { Server as SocketServer } from "socket.io";
|
|
|
4
4
|
import Database from "better-sqlite3";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
7
|
+
import { authRoutes } from "./routes/auth.js";
|
|
8
|
+
import { projectRoutes } from "./routes/projects.js";
|
|
9
|
+
import { overviewRoutes } from "./routes/overview.js";
|
|
7
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
11
|
const PORT = Number(process.env.PORT ?? 4000);
|
|
9
12
|
const dbPath = process.env.DASHWIRE_DB_PATH ?? "./dashwire.db";
|
|
10
13
|
const app = Fastify({ logger: true });
|
|
11
14
|
const sqlite = new Database(dbPath);
|
|
12
15
|
sqlite.pragma("journal_mode = WAL");
|
|
13
|
-
// Database Schema Initialisatie
|
|
16
|
+
// Database Schema Initialisatie (voor zover nodig in index, overige schema's draaien via Drizzle)
|
|
14
17
|
sqlite.exec(`
|
|
15
18
|
CREATE TABLE IF NOT EXISTS projects (
|
|
16
19
|
id TEXT PRIMARY KEY,
|
|
@@ -38,25 +41,12 @@ app.addHook("onRequest", async (req, reply) => {
|
|
|
38
41
|
return reply.code(200).send();
|
|
39
42
|
});
|
|
40
43
|
app.get("/health", async () => ({ ok: true }));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
app
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return reply.status(404).send({ error: "not found" });
|
|
48
|
-
const states = sqlite.prepare("SELECT capability_path, value_json FROM capability_state WHERE project_id = ?").all(req.params.id);
|
|
49
|
-
const stateMap = {};
|
|
50
|
-
for (const row of states)
|
|
51
|
-
stateMap[row.capability_path] = JSON.parse(row.value_json);
|
|
52
|
-
return {
|
|
53
|
-
id: project.id,
|
|
54
|
-
name: project.name,
|
|
55
|
-
status: project.status,
|
|
56
|
-
structure: JSON.parse(project.structure_json),
|
|
57
|
-
state: stateMap,
|
|
58
|
-
};
|
|
59
|
-
});
|
|
44
|
+
// Socket.io instantie aanmaken
|
|
45
|
+
const io = new SocketServer(app.server, { cors: { origin: "*" } });
|
|
46
|
+
// --- REGISTREER ALLE API ROUTES ---
|
|
47
|
+
authRoutes(app);
|
|
48
|
+
projectRoutes(app, io);
|
|
49
|
+
overviewRoutes(app);
|
|
60
50
|
// Serveer de ingebouwde Dashboard UI
|
|
61
51
|
app.register(fastifyStatic, {
|
|
62
52
|
root: join(__dirname, "../public"),
|
|
@@ -69,7 +59,6 @@ app.setNotFoundHandler((req, reply) => {
|
|
|
69
59
|
}
|
|
70
60
|
return reply.sendFile("index.html");
|
|
71
61
|
});
|
|
72
|
-
const io = new SocketServer(app.server, { cors: { origin: "*" } });
|
|
73
62
|
const sdkNsp = io.of("/sdk");
|
|
74
63
|
sdkNsp.on("connection", (socket) => {
|
|
75
64
|
const { projectId } = socket.handshake.auth || {};
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7f0b8a2f588b6ebf.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1068460781f8c7ff.js"/><script src="/_next/static/chunks/fd9d1056-84af1d4af83bcc05.js" async=""></script><script src="/_next/static/chunks/117-ccb2edbe70d1646b.js" async=""></script><script src="/_next/static/chunks/main-app-432f0af2a648435c.js" async=""></script><script src="/_next/static/chunks/app/layout-a60591b983ebb2e1.js" async=""></script><meta name="robots" content="noindex"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><main class="dw-main dw-loading-screen">Laden...</main><script src="/_next/static/chunks/webpack-1068460781f8c7ff.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/7f0b8a2f588b6ebf.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[6423,[],\"\"]\n6:I[4374,[\"185\",\"static/chunks/app/layout-a60591b983ebb2e1.js\"],\"default\",1]\nc:I[1060,[],\"\"]\n7:{\"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\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"5AVLeb4nYng3dTaQwNq8I\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"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],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7f0b8a2f588b6ebf.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"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\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
|
package/public/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7f0b8a2f588b6ebf.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1068460781f8c7ff.js"/><script src="/_next/static/chunks/fd9d1056-84af1d4af83bcc05.js" async=""></script><script src="/_next/static/chunks/117-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7f0b8a2f588b6ebf.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1068460781f8c7ff.js"/><script src="/_next/static/chunks/fd9d1056-84af1d4af83bcc05.js" async=""></script><script src="/_next/static/chunks/117-ccb2edbe70d1646b.js" async=""></script><script src="/_next/static/chunks/main-app-432f0af2a648435c.js" async=""></script><script src="/_next/static/chunks/app/layout-a60591b983ebb2e1.js" async=""></script><meta name="robots" content="noindex"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><main class="dw-main dw-loading-screen">Laden...</main><script src="/_next/static/chunks/webpack-1068460781f8c7ff.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/7f0b8a2f588b6ebf.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[6423,[],\"\"]\n6:I[4374,[\"185\",\"static/chunks/app/layout-a60591b983ebb2e1.js\"],\"default\",1]\nc:I[1060,[],\"\"]\n7:{\"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\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"5AVLeb4nYng3dTaQwNq8I\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"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],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7f0b8a2f588b6ebf.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"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\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
|