@kb-labs/rest-api-app 1.6.0 → 2.9.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 +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +41 -42
- package/README.md +0 -54
package/package.json
CHANGED
|
@@ -1,69 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kb-labs/rest-api-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "REST API application for KB Labs, providing HTTP endpoints for plugin functionality",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"clean": "rimraf dist",
|
|
12
|
-
"build": "tsup",
|
|
13
|
-
"dev": "tsx watch src/index.ts",
|
|
14
|
-
"start": "node dist/index.js",
|
|
15
|
-
"type-check": "tsc --noEmit",
|
|
16
|
-
"lint": "eslint .",
|
|
17
|
-
"lint:fix": "eslint . --fix",
|
|
18
|
-
"test": "vitest run --passWithNoTests -c ../../vitest.config.ts",
|
|
19
|
-
"test:watch": "vitest --passWithNoTests -c ../../vitest.config.ts"
|
|
20
|
-
},
|
|
21
10
|
"dependencies": {
|
|
22
11
|
"@fastify/cors": "^10.0.1",
|
|
23
12
|
"@fastify/rate-limit": "^10.1.1",
|
|
24
13
|
"@fastify/swagger": ">=9.5.1",
|
|
25
14
|
"@fastify/swagger-ui": "^5.2.0",
|
|
26
15
|
"@fastify/websocket": "^11.0.1",
|
|
27
|
-
"@kb-labs/shared-http": "^1.4.0",
|
|
28
|
-
"@kb-labs/core-contracts": "^1.7.0",
|
|
29
|
-
"fastify-type-provider-zod": "^6.0.0",
|
|
30
|
-
"@kb-labs/core-registry": "^1.7.0",
|
|
31
|
-
"@kb-labs/core-config": "^1.7.0",
|
|
32
|
-
"@kb-labs/core-platform": "^1.7.0",
|
|
33
|
-
"@kb-labs/core-runtime": "^1.7.0",
|
|
34
|
-
"@kb-labs/gateway-contracts": "^0.4.0",
|
|
35
|
-
"@kb-labs/core-tenant": "^1.7.0",
|
|
36
|
-
"@kb-labs/core-sys": "^1.7.0",
|
|
37
|
-
"@kb-labs/core-workspace": "^1.7.0",
|
|
38
|
-
"@kb-labs/plugin-contracts": "^1.4.0",
|
|
39
|
-
"@kb-labs/plugin-execution": "^1.4.0",
|
|
40
|
-
"@kb-labs/plugin-execution-factory": "^1.4.0",
|
|
41
|
-
"@kb-labs/plugin-runtime": "^1.4.0",
|
|
42
|
-
"@kb-labs/rest-api-contracts": "^1.6.0",
|
|
43
|
-
"@kb-labs/rest-api-core": "^1.6.0",
|
|
44
|
-
"@kb-labs/workflow-constants": "^1.5.0",
|
|
45
|
-
"@kb-labs/workflow-contracts": "^1.5.0",
|
|
46
|
-
"@kb-labs/workflow-engine": "^1.5.0",
|
|
47
16
|
"fastify": "^5.2.0",
|
|
48
17
|
"fastify-plugin": "^5.0.1",
|
|
49
|
-
"
|
|
18
|
+
"fastify-type-provider-zod": "^6.0.0",
|
|
19
|
+
"pino": "^9.0.0",
|
|
50
20
|
"pino-pretty": "^10.2.3",
|
|
51
21
|
"prom-client": "^15.1.3",
|
|
52
22
|
"ulid": "^2.3.0",
|
|
53
23
|
"ws": "^8.18.0",
|
|
54
24
|
"yaml": "^2.8.0",
|
|
55
|
-
"zod": "^
|
|
25
|
+
"zod": "^3.23.8",
|
|
26
|
+
"@kb-labs/shared-http": "2.9.0",
|
|
27
|
+
"@kb-labs/core-config": "2.9.0",
|
|
28
|
+
"@kb-labs/core-contracts": "2.9.0",
|
|
29
|
+
"@kb-labs/core-runtime": "2.9.0",
|
|
30
|
+
"@kb-labs/core-platform": "2.9.0",
|
|
31
|
+
"@kb-labs/core-tenant": "2.9.0",
|
|
32
|
+
"@kb-labs/gateway-contracts": "2.9.0",
|
|
33
|
+
"@kb-labs/core-sys": "2.9.0",
|
|
34
|
+
"@kb-labs/plugin-execution-factory": "2.9.0",
|
|
35
|
+
"@kb-labs/plugin-execution": "2.9.0",
|
|
36
|
+
"@kb-labs/plugin-contracts": "2.9.0",
|
|
37
|
+
"@kb-labs/plugin-runtime": "2.9.0",
|
|
38
|
+
"@kb-labs/core-registry": "2.9.0",
|
|
39
|
+
"@kb-labs/workflow-engine": "2.9.0",
|
|
40
|
+
"@kb-labs/core-workspace": "2.9.0",
|
|
41
|
+
"@kb-labs/rest-api-contracts": "2.9.0",
|
|
42
|
+
"@kb-labs/workflow-contracts": "2.9.0",
|
|
43
|
+
"@kb-labs/workflow-constants": "2.9.0",
|
|
44
|
+
"@kb-labs/rest-api-core": "2.9.0"
|
|
56
45
|
},
|
|
57
46
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@types/node": "^20.10.0",
|
|
47
|
+
"@types/node": "^24.3.3",
|
|
60
48
|
"@types/ws": "^8.5.13",
|
|
61
|
-
"
|
|
62
|
-
"tsup": "^8",
|
|
49
|
+
"rimraf": "^6.0.1",
|
|
50
|
+
"tsup": "^8.5.0",
|
|
63
51
|
"tsx": "^4.20.5",
|
|
64
|
-
"typescript": "^5",
|
|
65
|
-
"vitest": "^3",
|
|
66
|
-
"
|
|
52
|
+
"typescript": "^5.6.3",
|
|
53
|
+
"vitest": "^3.2.4",
|
|
54
|
+
"@kb-labs/devkit": "2.9.0"
|
|
67
55
|
},
|
|
68
56
|
"engines": {
|
|
69
57
|
"node": ">=20.0.0",
|
|
@@ -71,5 +59,16 @@
|
|
|
71
59
|
},
|
|
72
60
|
"kb": {
|
|
73
61
|
"manifest": "./dist/manifest.js"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"clean": "rimraf dist",
|
|
65
|
+
"build": "tsup",
|
|
66
|
+
"dev": "tsx watch src/index.ts",
|
|
67
|
+
"start": "node dist/index.js",
|
|
68
|
+
"type-check": "tsc --noEmit",
|
|
69
|
+
"lint": "eslint .",
|
|
70
|
+
"lint:fix": "eslint . --fix",
|
|
71
|
+
"test": "vitest run --passWithNoTests -c ../../vitest.config.ts",
|
|
72
|
+
"test:watch": "vitest --passWithNoTests -c ../../vitest.config.ts"
|
|
74
73
|
}
|
|
75
|
-
}
|
|
74
|
+
}
|
package/README.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# @kb-labs/rest-api-app
|
|
2
|
-
|
|
3
|
-
Deployable Fastify application for the KB Labs REST API.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Wires together `@kb-labs/rest-api-core`, plugin manifests, and runtime middleware into a production-ready HTTP service. All business capabilities come from discovered plugin manifests — the app itself only provides shared system endpoints and middleware.
|
|
8
|
-
|
|
9
|
-
## Running Locally
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# From kb-labs-rest-api root
|
|
13
|
-
pnpm install
|
|
14
|
-
pnpm --filter @kb-labs/rest-api-app dev
|
|
15
|
-
# Server starts on http://localhost:5050
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Build and run compiled output:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
pnpm --filter @kb-labs/rest-api-app build
|
|
22
|
-
pnpm --filter @kb-labs/rest-api-app start
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Key Components
|
|
26
|
-
|
|
27
|
-
| Path | Responsibility |
|
|
28
|
-
|------|----------------|
|
|
29
|
-
| `src/bootstrap.ts` | Fastify server setup, middleware wiring, route registration |
|
|
30
|
-
| `src/index.ts` | Entry point — calls `bootstrap` with repo root |
|
|
31
|
-
| `src/routes/` | System routes: health, readiness, metrics, registry, OpenAPI, events |
|
|
32
|
-
| `src/middleware/` | Security headers, CORS, rate limiting, request envelopes, timeouts |
|
|
33
|
-
| `src/plugins/` | Plugin discovery and dynamic route mounting |
|
|
34
|
-
| `src/events/` | SSE hub and registry event bridge |
|
|
35
|
-
|
|
36
|
-
## System Endpoints
|
|
37
|
-
|
|
38
|
-
- `GET /health` — versioned health snapshot (`kb.health/1`)
|
|
39
|
-
- `GET /ready` — readiness probe (`200` or `503`)
|
|
40
|
-
- `GET /openapi.json` — aggregated OpenAPI from all mounted plugins
|
|
41
|
-
- `GET /api/v1/plugins/registry` — mounted plugin manifest list
|
|
42
|
-
- `GET /api/v1/metrics` — Prometheus metrics
|
|
43
|
-
- `GET /api/v1/events/registry` — SSE stream for registry and health changes
|
|
44
|
-
|
|
45
|
-
## Tests
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# From repo root
|
|
49
|
-
pnpm test
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## License
|
|
53
|
-
|
|
54
|
-
KB Public License v1.1 © KB Labs
|