@kitledger/server 0.0.6 → 0.0.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/main.d.ts +4 -0
- package/dist/main.js +19 -0
- package/package.json +3 -3
package/dist/main.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export type ServerOptions = {
|
|
|
19
19
|
* Factory function to define the server configuration.
|
|
20
20
|
*/
|
|
21
21
|
export declare function defineServerConfig(options: ServerOptions): ServerConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Prints the Kitledger ASCII logo to the console.
|
|
24
|
+
*/
|
|
25
|
+
export declare function printAsciiLogo(): void;
|
|
22
26
|
/**
|
|
23
27
|
* Factory function to create a Hono server based on the detected runtime.
|
|
24
28
|
* * This is the main entry point for the server package. It returns an initialized
|
package/dist/main.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAsciiLogo } from "@kitledger/core/art";
|
|
1
2
|
import { Hono } from "hono";
|
|
2
3
|
function detectRuntime() {
|
|
3
4
|
// @ts-ignore: Deno global detection
|
|
@@ -16,6 +17,12 @@ function detectRuntime() {
|
|
|
16
17
|
export function defineServerConfig(options) {
|
|
17
18
|
return options;
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Prints the Kitledger ASCII logo to the console.
|
|
22
|
+
*/
|
|
23
|
+
export function printAsciiLogo() {
|
|
24
|
+
console.log(getAsciiLogo());
|
|
25
|
+
}
|
|
19
26
|
/**
|
|
20
27
|
* Factory function to create a Hono server based on the detected runtime.
|
|
21
28
|
* * This is the main entry point for the server package. It returns an initialized
|
|
@@ -75,6 +82,18 @@ export async function createServer(config) {
|
|
|
75
82
|
server.get(`${staticUI.serverPath}/entities/models`, (c) => {
|
|
76
83
|
return c.json(c.get("config").entityModels);
|
|
77
84
|
});
|
|
85
|
+
server.get(`${staticUI.serverPath}/units/models`, (c) => {
|
|
86
|
+
return c.json(c.get("config").unitModels);
|
|
87
|
+
});
|
|
88
|
+
server.get(`${staticUI.serverPath}/transactions/forms`, (c) => {
|
|
89
|
+
return c.json(c.get("config").transactionForms ?? []);
|
|
90
|
+
});
|
|
91
|
+
server.get(`${staticUI.serverPath}/entities/forms`, (c) => {
|
|
92
|
+
return c.json(c.get("config").entityForms ?? []);
|
|
93
|
+
});
|
|
94
|
+
server.get(`${staticUI.serverPath}/units/forms`, (c) => {
|
|
95
|
+
return c.json(c.get("config").unitForms ?? []);
|
|
96
|
+
});
|
|
78
97
|
const cleanPath = staticUI.basePath.endsWith("/") ? staticUI.basePath.slice(0, -1) : staticUI.basePath;
|
|
79
98
|
server.use(`${cleanPath}/*`, serveStatic({
|
|
80
99
|
root: staticUI.assetsPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitledger/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"@hono/node-server": "^1.19.6",
|
|
19
19
|
"hono": "^4.10.7",
|
|
20
20
|
"valibot": "^1.1.0",
|
|
21
|
-
"@kitledger/core": "0.0.
|
|
21
|
+
"@kitledger/core": "0.0.8"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kitledger/admin": "0.0.
|
|
24
|
+
"@kitledger/admin": "0.0.5"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|