@carlonicora/nestjs-neo4jsonapi 1.20.0 → 1.21.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/README.md +115 -0
- package/dist/core/core.module.d.ts.map +1 -1
- package/dist/core/core.module.js +6 -2
- package/dist/core/core.module.js.map +1 -1
- package/dist/core/health/controllers/health.controller.d.ts +65 -0
- package/dist/core/health/controllers/health.controller.d.ts.map +1 -0
- package/dist/core/health/controllers/health.controller.js +125 -0
- package/dist/core/health/controllers/health.controller.js.map +1 -0
- package/dist/core/health/health.module.d.ts +3 -0
- package/dist/core/health/health.module.d.ts.map +1 -0
- package/dist/core/health/health.module.js +28 -0
- package/dist/core/health/health.module.js.map +1 -0
- package/dist/core/health/index.d.ts +7 -0
- package/dist/core/health/index.d.ts.map +1 -0
- package/dist/core/health/index.js +23 -0
- package/dist/core/health/index.js.map +1 -0
- package/dist/core/health/indicators/disk.health.d.ts +9 -0
- package/dist/core/health/indicators/disk.health.d.ts.map +1 -0
- package/dist/core/health/indicators/disk.health.js +145 -0
- package/dist/core/health/indicators/disk.health.js.map +1 -0
- package/dist/core/health/indicators/neo4j.health.d.ts +9 -0
- package/dist/core/health/indicators/neo4j.health.d.ts.map +1 -0
- package/dist/core/health/indicators/neo4j.health.js +49 -0
- package/dist/core/health/indicators/neo4j.health.js.map +1 -0
- package/dist/core/health/indicators/redis.health.d.ts +9 -0
- package/dist/core/health/indicators/redis.health.d.ts.map +1 -0
- package/dist/core/health/indicators/redis.health.js +59 -0
- package/dist/core/health/indicators/redis.health.js.map +1 -0
- package/dist/core/health/indicators/s3.health.d.ts +12 -0
- package/dist/core/health/indicators/s3.health.d.ts.map +1 -0
- package/dist/core/health/indicators/s3.health.js +118 -0
- package/dist/core/health/indicators/s3.health.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ A comprehensive NestJS foundation package providing JSON:API compliant APIs, Neo
|
|
|
13
13
|
- [Company-User Model (B2B & B2C)](#company-user-model-b2b--b2c)
|
|
14
14
|
- [Required Configuration Files](#required-configuration-files)
|
|
15
15
|
- [Core Modules](#core-modules)
|
|
16
|
+
- [Health Check Endpoints](#health-check-endpoints)
|
|
16
17
|
- [Foundation Modules](#foundation-modules)
|
|
17
18
|
- [AI Agents](#ai-agents)
|
|
18
19
|
- [Security & Authentication](#security--authentication)
|
|
@@ -902,6 +903,120 @@ The library includes 18 core infrastructure modules:
|
|
|
902
903
|
| `MigratorModule` | Database migrations |
|
|
903
904
|
| `AppModeModule` | Application mode (API/Worker) |
|
|
904
905
|
| `DebugModule` | Debugging utilities |
|
|
906
|
+
| `HealthModule` | Health check endpoints for liveness/readiness |
|
|
907
|
+
|
|
908
|
+
## Health Check Endpoints
|
|
909
|
+
|
|
910
|
+
The package includes built-in health check endpoints using `@nestjs/terminus` for container orchestration and load balancer integration. Rate limiting is automatically disabled for all health endpoints.
|
|
911
|
+
|
|
912
|
+
### Endpoints
|
|
913
|
+
|
|
914
|
+
| Endpoint | Purpose | Checks |
|
|
915
|
+
|----------|---------|--------|
|
|
916
|
+
| `GET /health` | Full health status | Neo4j, Redis, S3, Disk |
|
|
917
|
+
| `GET /health/live` | Liveness probe | None (process running) |
|
|
918
|
+
| `GET /health/ready` | Readiness probe | Neo4j, Redis |
|
|
919
|
+
|
|
920
|
+
### Full Health Check: GET /health
|
|
921
|
+
|
|
922
|
+
Returns detailed status of all dependencies. Use for monitoring dashboards.
|
|
923
|
+
|
|
924
|
+
**Response when healthy (200 OK):**
|
|
925
|
+
```json
|
|
926
|
+
{
|
|
927
|
+
"status": "ok",
|
|
928
|
+
"info": {
|
|
929
|
+
"neo4j": { "status": "up", "message": "Neo4j connection healthy" },
|
|
930
|
+
"redis": { "status": "up", "message": "Redis connection healthy" },
|
|
931
|
+
"storage": { "status": "up", "message": "aws storage connection healthy" },
|
|
932
|
+
"disk": { "status": "up", "message": "Disk space healthy", "free": "50.00 GB" }
|
|
933
|
+
},
|
|
934
|
+
"error": {},
|
|
935
|
+
"details": { ... }
|
|
936
|
+
}
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
### Liveness Probe: GET /health/live
|
|
940
|
+
|
|
941
|
+
Indicates if the application process is running. Does NOT check external dependencies.
|
|
942
|
+
|
|
943
|
+
**Use for Kubernetes livenessProbe:** If this fails, the container should be restarted.
|
|
944
|
+
|
|
945
|
+
**Response (200 OK):**
|
|
946
|
+
```json
|
|
947
|
+
{
|
|
948
|
+
"status": "ok",
|
|
949
|
+
"info": {},
|
|
950
|
+
"error": {},
|
|
951
|
+
"details": {}
|
|
952
|
+
}
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
### Readiness Probe: GET /health/ready
|
|
956
|
+
|
|
957
|
+
Indicates if the application can accept traffic. Checks critical dependencies (Neo4j, Redis).
|
|
958
|
+
|
|
959
|
+
**Use for Kubernetes readinessProbe:** If this fails, traffic should be routed elsewhere.
|
|
960
|
+
|
|
961
|
+
**Response when healthy (200 OK):**
|
|
962
|
+
```json
|
|
963
|
+
{
|
|
964
|
+
"status": "ok",
|
|
965
|
+
"info": {
|
|
966
|
+
"neo4j": { "status": "up", "message": "Neo4j connection healthy" },
|
|
967
|
+
"redis": { "status": "up", "message": "Redis connection healthy" }
|
|
968
|
+
},
|
|
969
|
+
"error": {},
|
|
970
|
+
"details": { ... }
|
|
971
|
+
}
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
**Response when unhealthy (503 Service Unavailable):**
|
|
975
|
+
```json
|
|
976
|
+
{
|
|
977
|
+
"status": "error",
|
|
978
|
+
"info": {
|
|
979
|
+
"redis": { "status": "up", "message": "Redis connection healthy" }
|
|
980
|
+
},
|
|
981
|
+
"error": {
|
|
982
|
+
"neo4j": { "status": "down", "message": "Connection refused" }
|
|
983
|
+
},
|
|
984
|
+
"details": { ... }
|
|
985
|
+
}
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
### Kubernetes Configuration Example
|
|
989
|
+
|
|
990
|
+
```yaml
|
|
991
|
+
apiVersion: v1
|
|
992
|
+
kind: Pod
|
|
993
|
+
spec:
|
|
994
|
+
containers:
|
|
995
|
+
- name: api
|
|
996
|
+
livenessProbe:
|
|
997
|
+
httpGet:
|
|
998
|
+
path: /health/live
|
|
999
|
+
port: 3000
|
|
1000
|
+
initialDelaySeconds: 10
|
|
1001
|
+
periodSeconds: 10
|
|
1002
|
+
readinessProbe:
|
|
1003
|
+
httpGet:
|
|
1004
|
+
path: /health/ready
|
|
1005
|
+
port: 3000
|
|
1006
|
+
initialDelaySeconds: 5
|
|
1007
|
+
periodSeconds: 5
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
### Health Indicators
|
|
1011
|
+
|
|
1012
|
+
The module includes four health indicators:
|
|
1013
|
+
|
|
1014
|
+
| Indicator | Timeout | What it checks |
|
|
1015
|
+
|-----------|---------|----------------|
|
|
1016
|
+
| `Neo4jHealthIndicator` | 3s | Executes `RETURN 1` query |
|
|
1017
|
+
| `RedisHealthIndicator` | 3s | Connection status + PING |
|
|
1018
|
+
| `S3HealthIndicator` | 5s | Bucket access (HeadBucket) |
|
|
1019
|
+
| `DiskHealthIndicator` | - | Free space ≥ 1GB or 10% |
|
|
905
1020
|
|
|
906
1021
|
## Foundation Modules
|
|
907
1022
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.module.d.ts","sourceRoot":"","sources":["../../src/core/core.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"core.module.d.ts","sourceRoot":"","sources":["../../src/core/core.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAC;AA6GzE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAEa,UAAU;IACrB;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,aAAa;CAW3D"}
|
package/dist/core/core.module.js
CHANGED
|
@@ -15,6 +15,7 @@ const passport_1 = require("@nestjs/passport");
|
|
|
15
15
|
// Import all core modules
|
|
16
16
|
const blocknote_module_1 = require("./blocknote/blocknote.module");
|
|
17
17
|
const cache_module_1 = require("./cache/cache.module");
|
|
18
|
+
const health_module_1 = require("./health/health.module");
|
|
18
19
|
const cors_module_1 = require("./cors/cors.module");
|
|
19
20
|
const debug_module_1 = require("./debug/debug.module");
|
|
20
21
|
const email_module_1 = require("./email/email.module");
|
|
@@ -71,9 +72,11 @@ function getCoreModules(queueIds = []) {
|
|
|
71
72
|
neo4j_module_1.Neo4JModule,
|
|
72
73
|
redis_module_1.RedisModule,
|
|
73
74
|
cache_module_1.CacheModule,
|
|
74
|
-
// 3.
|
|
75
|
+
// 3. Health module - needs Neo4j and Redis for health checks
|
|
76
|
+
health_module_1.HealthModule,
|
|
77
|
+
// 4. Queue module - uses ConfigService for Redis, explicit queue IDs for registration
|
|
75
78
|
queue_module_1.QueueModule.forRootWithQueues(queueIds),
|
|
76
|
-
//
|
|
79
|
+
// 5. Services using external connections
|
|
77
80
|
email_module_1.EmailModule.forRoot(),
|
|
78
81
|
websocket_module_1.WebsocketModule,
|
|
79
82
|
llm_module_1.LLMModule,
|
|
@@ -97,6 +100,7 @@ function getCoreModuleExports() {
|
|
|
97
100
|
email_module_1.EmailModule,
|
|
98
101
|
cors_module_1.CorsModule,
|
|
99
102
|
version_module_1.VersionModule,
|
|
103
|
+
health_module_1.HealthModule,
|
|
100
104
|
websocket_module_1.WebsocketModule,
|
|
101
105
|
llm_module_1.LLMModule,
|
|
102
106
|
blocknote_module_1.BlockNoteModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.module.js","sourceRoot":"","sources":["../../src/core/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,2CAA6D;AAC7D,qCAAwC;AACxC,+CAAkD;AAGlD,0BAA0B;AAC1B,mEAA+D;AAC/D,uDAAmD;AACnD,oDAAgD;AAChD,uDAAmD;AACnD,uDAAmD;AACnD,6DAAyD;AACzD,iDAA6C;AAC7C,6DAAyD;AACzD,gEAA4D;AAC5D,uDAAmD;AACnD,uDAAmD;AACnD,uDAAmD;AACnD,gEAA4D;AAC5D,6DAAyD;AACzD,6DAAyD;AACzD,mEAA+D;AAE/D;;;;;;;;;;;;;;GAcG;AACH,SAAS,cAAc,CAAC,WAAqB,EAAE;IAC7C,OAAO;QACL,iEAAiE;QACjE,eAAS,CAAC,aAAa,CAAC;YACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;YACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;YACvB,UAAU,EAAE,CAAC,aAAiD,EAAE,EAAE;gBAChE,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAqB,KAAK,CAAC,CAAC;gBACzD,OAAO;oBACL,MAAM,EAAE,GAAG,EAAE,MAAM;oBACnB,WAAW,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,SAAgB,EAAE;iBAClD,CAAC;YACJ,CAAC;SACF,CAAC;QACF,yBAAc;QACd,kDAAkD;QAClD,gCAAc;QACd,wBAAU,CAAC,OAAO,EAAE;QACpB,8BAAa,CAAC,OAAO,EAAE;QACvB,8BAAa;QACb,0BAAW;QACX,8BAAa,CAAC,OAAO,EAAE;QACvB,8BAAa,CAAC,OAAO,EAAE;QACvB,iDAAiD;QACjD,0BAAW;QACX,0BAAW;QACX,0BAAW;QACX,sFAAsF;QACtF,0BAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC;QACvC,yCAAyC;QACzC,0BAAW,CAAC,OAAO,EAAE;QACrB,kCAAe;QACf,sBAAS;QACT,kCAAe;QACf,gCAAc;QACd,8BAAa;KACd,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB;IAC3B,OAAO;QACL,eAAS;QACT,yBAAc;QACd,0BAAW;QACX,0BAAW;QACX,0BAAW;QACX,gCAAc;QACd,0BAAW;QACX,wBAAU;QACV,8BAAa;QACb,kCAAe;QACf,sBAAS;QACT,kCAAe;QACf,0BAAW;QACX,8BAAa;QACb,8BAAa;QACb,8BAAa;QACb,0BAAW;QACX,8BAAa;KACd,CAAC;AACJ,CAAC;AAcD;;;;;;;;;;;;;;;;GAgBG;AAGI,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAA2B;QACxC,MAAM,SAAS,GAAe,EAAE,CAAC;QAEjC,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,CAAC;YAChD,SAAS;YACT,OAAO,EAAE,CAAC,GAAG,oBAAoB,EAAE,CAAC;YACpC,MAAM,EAAE,IAAI;SACb,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,gCAAU;qBAAV,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAetB"}
|
|
1
|
+
{"version":3,"file":"core.module.js","sourceRoot":"","sources":["../../src/core/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,2CAA6D;AAC7D,qCAAwC;AACxC,+CAAkD;AAGlD,0BAA0B;AAC1B,mEAA+D;AAC/D,uDAAmD;AACnD,0DAAsD;AACtD,oDAAgD;AAChD,uDAAmD;AACnD,uDAAmD;AACnD,6DAAyD;AACzD,iDAA6C;AAC7C,6DAAyD;AACzD,gEAA4D;AAC5D,uDAAmD;AACnD,uDAAmD;AACnD,uDAAmD;AACnD,gEAA4D;AAC5D,6DAAyD;AACzD,6DAAyD;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;;;;;;;;;;;;;;GAgBG;AAGI,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAA2B;QACxC,MAAM,SAAS,GAAe,EAAE,CAAC;QAEjC,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,CAAC;YAChD,SAAS;YACT,OAAO,EAAE,CAAC,GAAG,oBAAoB,EAAE,CAAC;YACpC,MAAM,EAAE,IAAI;SACb,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,gCAAU;qBAAV,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAetB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { HealthCheckService, HealthCheckResult } from "@nestjs/terminus";
|
|
2
|
+
import { Neo4jHealthIndicator } from "../indicators/neo4j.health";
|
|
3
|
+
import { RedisHealthIndicator } from "../indicators/redis.health";
|
|
4
|
+
import { S3HealthIndicator } from "../indicators/s3.health";
|
|
5
|
+
import { DiskHealthIndicator } from "../indicators/disk.health";
|
|
6
|
+
/**
|
|
7
|
+
* Health Check Controller
|
|
8
|
+
*
|
|
9
|
+
* Provides health check endpoints for monitoring and orchestration.
|
|
10
|
+
* All endpoints are PUBLIC (no authentication required).
|
|
11
|
+
* Rate limiting is disabled for health endpoints.
|
|
12
|
+
*
|
|
13
|
+
* Endpoints:
|
|
14
|
+
* - GET /health - Full health status with all dependency checks
|
|
15
|
+
* - GET /health/live - Liveness probe (process is running)
|
|
16
|
+
* - GET /health/ready - Readiness probe (can accept traffic)
|
|
17
|
+
*/
|
|
18
|
+
export declare class HealthController {
|
|
19
|
+
private health;
|
|
20
|
+
private neo4jHealth;
|
|
21
|
+
private redisHealth;
|
|
22
|
+
private s3Health;
|
|
23
|
+
private diskHealth;
|
|
24
|
+
constructor(health: HealthCheckService, neo4jHealth: Neo4jHealthIndicator, redisHealth: RedisHealthIndicator, s3Health: S3HealthIndicator, diskHealth: DiskHealthIndicator);
|
|
25
|
+
/**
|
|
26
|
+
* Full health check endpoint
|
|
27
|
+
*
|
|
28
|
+
* Checks all dependencies and returns detailed status.
|
|
29
|
+
* Use for monitoring dashboards and detailed health analysis.
|
|
30
|
+
*
|
|
31
|
+
* @returns HealthCheckResult with status of all dependencies
|
|
32
|
+
* - HTTP 200: All dependencies healthy
|
|
33
|
+
* - HTTP 503: One or more dependencies unhealthy
|
|
34
|
+
*/
|
|
35
|
+
check(): Promise<HealthCheckResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Liveness probe endpoint
|
|
38
|
+
*
|
|
39
|
+
* Indicates if the application process is running.
|
|
40
|
+
* Does NOT check external dependencies.
|
|
41
|
+
*
|
|
42
|
+
* Use for Kubernetes livenessProbe:
|
|
43
|
+
* - If this fails, container should be restarted
|
|
44
|
+
*
|
|
45
|
+
* @returns HealthCheckResult
|
|
46
|
+
* - HTTP 200: Process is alive
|
|
47
|
+
*/
|
|
48
|
+
liveness(): Promise<HealthCheckResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Readiness probe endpoint
|
|
51
|
+
*
|
|
52
|
+
* Indicates if the application can accept traffic.
|
|
53
|
+
* Checks critical dependencies (Neo4j, Redis).
|
|
54
|
+
*
|
|
55
|
+
* Use for Kubernetes readinessProbe:
|
|
56
|
+
* - If this fails, traffic should be routed elsewhere
|
|
57
|
+
* - Container should NOT be restarted
|
|
58
|
+
*
|
|
59
|
+
* @returns HealthCheckResult
|
|
60
|
+
* - HTTP 200: Ready to accept traffic
|
|
61
|
+
* - HTTP 503: Not ready (dependency unavailable)
|
|
62
|
+
*/
|
|
63
|
+
readiness(): Promise<HealthCheckResult>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=health.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.controller.d.ts","sourceRoot":"","sources":["../../../../src/core/health/controllers/health.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,qBAEa,gBAAgB;IAEzB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,UAAU;gBAJV,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,oBAAoB,EACjC,WAAW,EAAE,oBAAoB,EACjC,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,mBAAmB;IAGzC;;;;;;;;;OASG;IAGG,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;IASzC;;;;;;;;;;;OAWG;IAGG,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAM5C;;;;;;;;;;;;;OAaG;IAGG,SAAS,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAI9C"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HealthController = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const throttler_1 = require("@nestjs/throttler");
|
|
15
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
16
|
+
const neo4j_health_1 = require("../indicators/neo4j.health");
|
|
17
|
+
const redis_health_1 = require("../indicators/redis.health");
|
|
18
|
+
const s3_health_1 = require("../indicators/s3.health");
|
|
19
|
+
const disk_health_1 = require("../indicators/disk.health");
|
|
20
|
+
/**
|
|
21
|
+
* Health Check Controller
|
|
22
|
+
*
|
|
23
|
+
* Provides health check endpoints for monitoring and orchestration.
|
|
24
|
+
* All endpoints are PUBLIC (no authentication required).
|
|
25
|
+
* Rate limiting is disabled for health endpoints.
|
|
26
|
+
*
|
|
27
|
+
* Endpoints:
|
|
28
|
+
* - GET /health - Full health status with all dependency checks
|
|
29
|
+
* - GET /health/live - Liveness probe (process is running)
|
|
30
|
+
* - GET /health/ready - Readiness probe (can accept traffic)
|
|
31
|
+
*/
|
|
32
|
+
let HealthController = class HealthController {
|
|
33
|
+
constructor(health, neo4jHealth, redisHealth, s3Health, diskHealth) {
|
|
34
|
+
this.health = health;
|
|
35
|
+
this.neo4jHealth = neo4jHealth;
|
|
36
|
+
this.redisHealth = redisHealth;
|
|
37
|
+
this.s3Health = s3Health;
|
|
38
|
+
this.diskHealth = diskHealth;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Full health check endpoint
|
|
42
|
+
*
|
|
43
|
+
* Checks all dependencies and returns detailed status.
|
|
44
|
+
* Use for monitoring dashboards and detailed health analysis.
|
|
45
|
+
*
|
|
46
|
+
* @returns HealthCheckResult with status of all dependencies
|
|
47
|
+
* - HTTP 200: All dependencies healthy
|
|
48
|
+
* - HTTP 503: One or more dependencies unhealthy
|
|
49
|
+
*/
|
|
50
|
+
async check() {
|
|
51
|
+
return this.health.check([
|
|
52
|
+
() => this.neo4jHealth.isHealthy("neo4j"),
|
|
53
|
+
() => this.redisHealth.isHealthy("redis"),
|
|
54
|
+
() => this.s3Health.isHealthy("storage"),
|
|
55
|
+
() => this.diskHealth.isHealthy("disk"),
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Liveness probe endpoint
|
|
60
|
+
*
|
|
61
|
+
* Indicates if the application process is running.
|
|
62
|
+
* Does NOT check external dependencies.
|
|
63
|
+
*
|
|
64
|
+
* Use for Kubernetes livenessProbe:
|
|
65
|
+
* - If this fails, container should be restarted
|
|
66
|
+
*
|
|
67
|
+
* @returns HealthCheckResult
|
|
68
|
+
* - HTTP 200: Process is alive
|
|
69
|
+
*/
|
|
70
|
+
async liveness() {
|
|
71
|
+
// Liveness only checks if process is running
|
|
72
|
+
// No external dependency checks
|
|
73
|
+
return this.health.check([]);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Readiness probe endpoint
|
|
77
|
+
*
|
|
78
|
+
* Indicates if the application can accept traffic.
|
|
79
|
+
* Checks critical dependencies (Neo4j, Redis).
|
|
80
|
+
*
|
|
81
|
+
* Use for Kubernetes readinessProbe:
|
|
82
|
+
* - If this fails, traffic should be routed elsewhere
|
|
83
|
+
* - Container should NOT be restarted
|
|
84
|
+
*
|
|
85
|
+
* @returns HealthCheckResult
|
|
86
|
+
* - HTTP 200: Ready to accept traffic
|
|
87
|
+
* - HTTP 503: Not ready (dependency unavailable)
|
|
88
|
+
*/
|
|
89
|
+
async readiness() {
|
|
90
|
+
// Readiness checks critical dependencies needed to handle requests
|
|
91
|
+
return this.health.check([() => this.neo4jHealth.isHealthy("neo4j"), () => this.redisHealth.isHealthy("redis")]);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.HealthController = HealthController;
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, common_1.Get)(),
|
|
97
|
+
(0, terminus_1.HealthCheck)(),
|
|
98
|
+
__metadata("design:type", Function),
|
|
99
|
+
__metadata("design:paramtypes", []),
|
|
100
|
+
__metadata("design:returntype", Promise)
|
|
101
|
+
], HealthController.prototype, "check", null);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, common_1.Get)("live"),
|
|
104
|
+
(0, terminus_1.HealthCheck)(),
|
|
105
|
+
__metadata("design:type", Function),
|
|
106
|
+
__metadata("design:paramtypes", []),
|
|
107
|
+
__metadata("design:returntype", Promise)
|
|
108
|
+
], HealthController.prototype, "liveness", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, common_1.Get)("ready"),
|
|
111
|
+
(0, terminus_1.HealthCheck)(),
|
|
112
|
+
__metadata("design:type", Function),
|
|
113
|
+
__metadata("design:paramtypes", []),
|
|
114
|
+
__metadata("design:returntype", Promise)
|
|
115
|
+
], HealthController.prototype, "readiness", null);
|
|
116
|
+
exports.HealthController = HealthController = __decorate([
|
|
117
|
+
(0, common_1.Controller)("health"),
|
|
118
|
+
(0, throttler_1.SkipThrottle)(),
|
|
119
|
+
__metadata("design:paramtypes", [terminus_1.HealthCheckService,
|
|
120
|
+
neo4j_health_1.Neo4jHealthIndicator,
|
|
121
|
+
redis_health_1.RedisHealthIndicator,
|
|
122
|
+
s3_health_1.S3HealthIndicator,
|
|
123
|
+
disk_health_1.DiskHealthIndicator])
|
|
124
|
+
], HealthController);
|
|
125
|
+
//# sourceMappingURL=health.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.controller.js","sourceRoot":"","sources":["../../../../src/core/health/controllers/health.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,iDAAiD;AACjD,+CAAsF;AACtF,6DAAkE;AAClE,6DAAkE;AAClE,uDAA4D;AAC5D,2DAAgE;AAEhE;;;;;;;;;;;GA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L,IAAA,sBAAW,GAAE;;;;6CAQb;AAgBK;IAFL,IAAA,YAAG,EAAC,MAAM,CAAC;IACX,IAAA,sBAAW,GAAE;;;;gDAKb;AAkBK;IAFL,IAAA,YAAG,EAAC,OAAO,CAAC;IACZ,IAAA,sBAAW,GAAE;;;;iDAIb;2BArEU,gBAAgB;IAF5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,wBAAY,GAAE;qCAGK,6BAAkB;QACb,mCAAoB;QACpB,mCAAoB;QACvB,6BAAiB;QACf,iCAAmB;GAN9B,gBAAgB,CAsE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.module.d.ts","sourceRoot":"","sources":["../../../src/core/health/health.module.ts"],"names":[],"mappings":"AAQA,qBAMa,YAAY;CAAG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.HealthModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
12
|
+
const health_controller_1 = require("./controllers/health.controller");
|
|
13
|
+
const neo4j_health_1 = require("./indicators/neo4j.health");
|
|
14
|
+
const redis_health_1 = require("./indicators/redis.health");
|
|
15
|
+
const s3_health_1 = require("./indicators/s3.health");
|
|
16
|
+
const disk_health_1 = require("./indicators/disk.health");
|
|
17
|
+
let HealthModule = class HealthModule {
|
|
18
|
+
};
|
|
19
|
+
exports.HealthModule = HealthModule;
|
|
20
|
+
exports.HealthModule = HealthModule = __decorate([
|
|
21
|
+
(0, common_1.Module)({
|
|
22
|
+
imports: [terminus_1.TerminusModule],
|
|
23
|
+
controllers: [health_controller_1.HealthController],
|
|
24
|
+
providers: [neo4j_health_1.Neo4jHealthIndicator, redis_health_1.RedisHealthIndicator, s3_health_1.S3HealthIndicator, disk_health_1.DiskHealthIndicator],
|
|
25
|
+
exports: [neo4j_health_1.Neo4jHealthIndicator, redis_health_1.RedisHealthIndicator, s3_health_1.S3HealthIndicator, disk_health_1.DiskHealthIndicator],
|
|
26
|
+
})
|
|
27
|
+
], HealthModule);
|
|
28
|
+
//# sourceMappingURL=health.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../../src/core/health/health.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,uEAAmE;AACnE,4DAAiE;AACjE,4DAAiE;AACjE,sDAA2D;AAC3D,0DAA+D;AAQxD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAc,CAAC;QACzB,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,mCAAoB,EAAE,mCAAoB,EAAE,6BAAiB,EAAE,iCAAmB,CAAC;QAC/F,OAAO,EAAE,CAAC,mCAAoB,EAAE,mCAAoB,EAAE,6BAAiB,EAAE,iCAAmB,CAAC;KAC9F,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./controllers/health.controller";
|
|
2
|
+
export * from "./indicators/neo4j.health";
|
|
3
|
+
export * from "./indicators/redis.health";
|
|
4
|
+
export * from "./indicators/s3.health";
|
|
5
|
+
export * from "./indicators/disk.health";
|
|
6
|
+
export * from "./health.module";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/health/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./controllers/health.controller"), exports);
|
|
18
|
+
__exportStar(require("./indicators/neo4j.health"), exports);
|
|
19
|
+
__exportStar(require("./indicators/redis.health"), exports);
|
|
20
|
+
__exportStar(require("./indicators/s3.health"), exports);
|
|
21
|
+
__exportStar(require("./indicators/disk.health"), exports);
|
|
22
|
+
__exportStar(require("./health.module"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/health/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,4DAA0C;AAC1C,4DAA0C;AAC1C,yDAAuC;AACvC,2DAAyC;AACzC,kDAAgC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HealthIndicator, HealthIndicatorResult } from "@nestjs/terminus";
|
|
2
|
+
export declare class DiskHealthIndicator extends HealthIndicator {
|
|
3
|
+
private readonly MIN_FREE_BYTES;
|
|
4
|
+
private readonly MIN_FREE_PERCENTAGE;
|
|
5
|
+
isHealthy(key: string): Promise<HealthIndicatorResult>;
|
|
6
|
+
private getDiskStats;
|
|
7
|
+
private formatBytes;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=disk.health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk.health.d.ts","sourceRoot":"","sources":["../../../../src/core/health/indicators/disk.health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAoB,MAAM,kBAAkB,CAAC;AAW5F,qBACa,mBAAoB,SAAQ,eAAe;IAEtD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsB;IACrD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAM;IAEpC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;YA2C9C,YAAY;IA4C1B,OAAO,CAAC,WAAW;CAYpB"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.DiskHealthIndicator = void 0;
|
|
43
|
+
const common_1 = require("@nestjs/common");
|
|
44
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const os = __importStar(require("os"));
|
|
47
|
+
let DiskHealthIndicator = class DiskHealthIndicator extends terminus_1.HealthIndicator {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
// Minimum free space threshold: 1GB or 10% of total, whichever is smaller
|
|
51
|
+
this.MIN_FREE_BYTES = 1024 * 1024 * 1024; // 1GB
|
|
52
|
+
this.MIN_FREE_PERCENTAGE = 10; // 10%
|
|
53
|
+
}
|
|
54
|
+
async isHealthy(key) {
|
|
55
|
+
try {
|
|
56
|
+
const stats = await this.getDiskStats();
|
|
57
|
+
const minRequiredByPercentage = (stats.total * this.MIN_FREE_PERCENTAGE) / 100;
|
|
58
|
+
const threshold = Math.min(this.MIN_FREE_BYTES, minRequiredByPercentage);
|
|
59
|
+
const isHealthy = stats.free >= threshold;
|
|
60
|
+
if (!isHealthy) {
|
|
61
|
+
throw new terminus_1.HealthCheckError("Disk space critically low", this.getStatus(key, false, {
|
|
62
|
+
message: `Low disk space: ${this.formatBytes(stats.free)} free (${(100 - stats.usedPercentage).toFixed(1)}%)`,
|
|
63
|
+
total: this.formatBytes(stats.total),
|
|
64
|
+
free: this.formatBytes(stats.free),
|
|
65
|
+
used: this.formatBytes(stats.used),
|
|
66
|
+
usedPercentage: `${stats.usedPercentage.toFixed(1)}%`,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
return this.getStatus(key, true, {
|
|
70
|
+
message: "Disk space healthy",
|
|
71
|
+
total: this.formatBytes(stats.total),
|
|
72
|
+
free: this.formatBytes(stats.free),
|
|
73
|
+
used: this.formatBytes(stats.used),
|
|
74
|
+
usedPercentage: `${stats.usedPercentage.toFixed(1)}%`,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (error instanceof terminus_1.HealthCheckError) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
82
|
+
throw new terminus_1.HealthCheckError("Disk health check failed", this.getStatus(key, false, {
|
|
83
|
+
message: errorMessage,
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async getDiskStats() {
|
|
88
|
+
// Get the root path based on OS
|
|
89
|
+
const checkPath = os.platform() === "win32" ? "C:\\" : "/";
|
|
90
|
+
return new Promise((resolve) => {
|
|
91
|
+
// Use statvfs-like approach for Unix systems
|
|
92
|
+
if (os.platform() !== "win32") {
|
|
93
|
+
try {
|
|
94
|
+
const stats = fs.statfsSync(checkPath);
|
|
95
|
+
const total = stats.bsize * stats.blocks;
|
|
96
|
+
const free = stats.bsize * stats.bfree;
|
|
97
|
+
const used = total - free;
|
|
98
|
+
resolve({
|
|
99
|
+
total,
|
|
100
|
+
free,
|
|
101
|
+
used,
|
|
102
|
+
usedPercentage: (used / total) * 100,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// Fallback: use os module for basic memory info as indicator
|
|
107
|
+
const totalMem = os.totalmem();
|
|
108
|
+
const freeMem = os.freemem();
|
|
109
|
+
resolve({
|
|
110
|
+
total: totalMem,
|
|
111
|
+
free: freeMem,
|
|
112
|
+
used: totalMem - freeMem,
|
|
113
|
+
usedPercentage: ((totalMem - freeMem) / totalMem) * 100,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
// For Windows, use a different approach or return system memory
|
|
119
|
+
const totalMem = os.totalmem();
|
|
120
|
+
const freeMem = os.freemem();
|
|
121
|
+
resolve({
|
|
122
|
+
total: totalMem,
|
|
123
|
+
free: freeMem,
|
|
124
|
+
used: totalMem - freeMem,
|
|
125
|
+
usedPercentage: ((totalMem - freeMem) / totalMem) * 100,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
formatBytes(bytes) {
|
|
131
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
132
|
+
let unitIndex = 0;
|
|
133
|
+
let size = bytes;
|
|
134
|
+
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
135
|
+
size /= 1024;
|
|
136
|
+
unitIndex++;
|
|
137
|
+
}
|
|
138
|
+
return `${size.toFixed(2)} ${units[unitIndex]}`;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
exports.DiskHealthIndicator = DiskHealthIndicator;
|
|
142
|
+
exports.DiskHealthIndicator = DiskHealthIndicator = __decorate([
|
|
143
|
+
(0, common_1.Injectable)()
|
|
144
|
+
], DiskHealthIndicator);
|
|
145
|
+
//# sourceMappingURL=disk.health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk.health.js","sourceRoot":"","sources":["../../../../src/core/health/indicators/disk.health.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA4F;AAC5F,uCAAyB;AACzB,uCAAyB;AAUlB,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,0BAAe;IAAjD;;QACL,0EAA0E;QACzD,mBAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,MAAM;QAC3C,wBAAmB,GAAG,EAAE,CAAC,CAAC,MAAM;IAqGnD,CAAC;IAnGC,KAAK,CAAC,SAAS,CAAC,GAAW;QACzB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YAExC,MAAM,uBAAuB,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,GA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us";
|
|
2
|
+
import { Neo4jService } from "../../neo4j/services/neo4j.service";
|
|
3
|
+
export declare class Neo4jHealthIndicator extends HealthIndicator {
|
|
4
|
+
private readonly neo4jService;
|
|
5
|
+
private readonly TIMEOUT_MS;
|
|
6
|
+
constructor(neo4jService: Neo4jService);
|
|
7
|
+
isHealthy(key: string): Promise<HealthIndicatorResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=neo4j.health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neo4j.health.d.ts","sourceRoot":"","sources":["../../../../src/core/health/indicators/neo4j.health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAoB,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,qBACa,oBAAqB,SAAQ,eAAe;IAG3C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAFzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;gBAEN,YAAY,EAAE,YAAY;IAIjD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA0B7D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Neo4jHealthIndicator = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
15
|
+
const neo4j_service_1 = require("../../neo4j/services/neo4j.service");
|
|
16
|
+
let Neo4jHealthIndicator = class Neo4jHealthIndicator extends terminus_1.HealthIndicator {
|
|
17
|
+
constructor(neo4jService) {
|
|
18
|
+
super();
|
|
19
|
+
this.neo4jService = neo4jService;
|
|
20
|
+
this.TIMEOUT_MS = 3000;
|
|
21
|
+
}
|
|
22
|
+
async isHealthy(key) {
|
|
23
|
+
try {
|
|
24
|
+
// Create a timeout promise
|
|
25
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
26
|
+
setTimeout(() => reject(new Error("Health check timeout")), this.TIMEOUT_MS);
|
|
27
|
+
});
|
|
28
|
+
// Execute simple query to verify connection
|
|
29
|
+
const checkPromise = this.neo4jService.read("RETURN 1 as result", {});
|
|
30
|
+
// Race between query and timeout
|
|
31
|
+
await Promise.race([checkPromise, timeoutPromise]);
|
|
32
|
+
return this.getStatus(key, true, {
|
|
33
|
+
message: "Neo4j connection healthy",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
38
|
+
throw new terminus_1.HealthCheckError("Neo4j health check failed", this.getStatus(key, false, {
|
|
39
|
+
message: errorMessage,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.Neo4jHealthIndicator = Neo4jHealthIndicator;
|
|
45
|
+
exports.Neo4jHealthIndicator = Neo4jHealthIndicator = __decorate([
|
|
46
|
+
(0, common_1.Injectable)(),
|
|
47
|
+
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService])
|
|
48
|
+
], Neo4jHealthIndicator);
|
|
49
|
+
//# sourceMappingURL=neo4j.health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neo4j.health.js","sourceRoot":"","sources":["../../../../src/core/health/indicators/neo4j.health.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA4F;AAC5F,sEAAkE;AAG3D,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,0BAAe;IAGvD,YAA6B,YAA0B;QACrD,KAAK,EAAE,CAAC;QADmB,iBAAY,GAAZ,YAAY,CAAc;QAFtC,eAAU,GAAG,IAAI,CAAC;IAInC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAW;QACzB,IAAI,CAAC;YACH,2BAA2B;YAC3B,MAAM,cAAc,GAAG,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;gBACtD,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/E,CAAC,CAAC,CAAC;YAEH,4CAA4C;YAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;YAEtE,iCAAiC;YACjC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC;YAEnD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,0BAA0B;aACpC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAC9E,MAAM,IAAI,2BAAgB,CACxB,2BAA2B,EAC3B,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE;gBACzB,OAAO,EAAE,YAAY;aACtB,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAjCY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAIgC,4BAAY;GAH5C,oBAAoB,CAiChC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HealthIndicator, HealthIndicatorResult } from "@nestjs/terminus";
|
|
2
|
+
import { RedisClientStorageService } from "../../redis/services/redis.client.storage.service";
|
|
3
|
+
export declare class RedisHealthIndicator extends HealthIndicator {
|
|
4
|
+
private readonly redisService;
|
|
5
|
+
private readonly TIMEOUT_MS;
|
|
6
|
+
constructor(redisService: RedisClientStorageService);
|
|
7
|
+
isHealthy(key: string): Promise<HealthIndicatorResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=redis.health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.health.d.ts","sourceRoot":"","sources":["../../../../src/core/health/indicators/redis.health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAoB,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAE9F,qBACa,oBAAqB,SAAQ,eAAe;IAG3C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAFzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;gBAEN,YAAY,EAAE,yBAAyB;IAI9D,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAwC7D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RedisHealthIndicator = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
15
|
+
const redis_client_storage_service_1 = require("../../redis/services/redis.client.storage.service");
|
|
16
|
+
let RedisHealthIndicator = class RedisHealthIndicator extends terminus_1.HealthIndicator {
|
|
17
|
+
constructor(redisService) {
|
|
18
|
+
super();
|
|
19
|
+
this.redisService = redisService;
|
|
20
|
+
this.TIMEOUT_MS = 3000;
|
|
21
|
+
}
|
|
22
|
+
async isHealthy(key) {
|
|
23
|
+
try {
|
|
24
|
+
// Check if Redis client is connected
|
|
25
|
+
const isConnected = this.redisService.isConnected();
|
|
26
|
+
if (!isConnected) {
|
|
27
|
+
throw new Error("Redis client not connected");
|
|
28
|
+
}
|
|
29
|
+
// Execute PING command to verify responsiveness
|
|
30
|
+
const redis = this.redisService.getRedisClient();
|
|
31
|
+
// Create a timeout promise
|
|
32
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
33
|
+
setTimeout(() => reject(new Error("Health check timeout")), this.TIMEOUT_MS);
|
|
34
|
+
});
|
|
35
|
+
// Execute PING
|
|
36
|
+
const pingPromise = redis.ping();
|
|
37
|
+
// Race between ping and timeout
|
|
38
|
+
const result = await Promise.race([pingPromise, timeoutPromise]);
|
|
39
|
+
if (result !== "PONG") {
|
|
40
|
+
throw new Error(`Unexpected PING response: ${result}`);
|
|
41
|
+
}
|
|
42
|
+
return this.getStatus(key, true, {
|
|
43
|
+
message: "Redis connection healthy",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
48
|
+
throw new terminus_1.HealthCheckError("Redis health check failed", this.getStatus(key, false, {
|
|
49
|
+
message: errorMessage,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.RedisHealthIndicator = RedisHealthIndicator;
|
|
55
|
+
exports.RedisHealthIndicator = RedisHealthIndicator = __decorate([
|
|
56
|
+
(0, common_1.Injectable)(),
|
|
57
|
+
__metadata("design:paramtypes", [redis_client_storage_service_1.RedisClientStorageService])
|
|
58
|
+
], RedisHealthIndicator);
|
|
59
|
+
//# sourceMappingURL=redis.health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.health.js","sourceRoot":"","sources":["../../../../src/core/health/indicators/redis.health.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA4F;AAC5F,oGAA8F;AAGvF,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,0BAAe;IAGvD,YAA6B,YAAuC;QAClE,KAAK,EAAE,CAAC;QADmB,iBAAY,GAAZ,YAAY,CAA2B;QAFnD,eAAU,GAAG,IAAI,CAAC;IAInC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAW;QACzB,IAAI,CAAC;YACH,qCAAqC;YACrC,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;YAEpD,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;YAED,gDAAgD;YAChD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;YAEjD,2BAA2B;YAC3B,MAAM,cAAc,GAAG,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;gBACtD,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/E,CAAC,CAAC,CAAC;YAEH,eAAe;YACf,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YAEjC,gCAAgC;YAChC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;YAEjE,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;YACzD,CAAC;YAED,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,0BAA0B;aACpC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAC9E,MAAM,IAAI,2BAAgB,CACxB,2BAA2B,EAC3B,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE;gBACzB,OAAO,EAAE,YAAY;aACtB,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA/CY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAIgC,wDAAyB;GAHzD,oBAAoB,CA+ChC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConfigService } from "@nestjs/config";
|
|
2
|
+
import { HealthIndicator, HealthIndicatorResult } from "@nestjs/terminus";
|
|
3
|
+
import { BaseConfigInterface } from "../../../config/interfaces";
|
|
4
|
+
export declare class S3HealthIndicator extends HealthIndicator {
|
|
5
|
+
private readonly config;
|
|
6
|
+
private readonly TIMEOUT_MS;
|
|
7
|
+
constructor(config: ConfigService<BaseConfigInterface>);
|
|
8
|
+
isHealthy(key: string): Promise<HealthIndicatorResult>;
|
|
9
|
+
private checkS3Compatible;
|
|
10
|
+
private checkAzure;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=s3.health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.health.d.ts","sourceRoot":"","sources":["../../../../src/core/health/indicators/s3.health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAoB,MAAM,kBAAkB,CAAC;AAG5F,OAAO,EAAE,mBAAmB,EAAqB,MAAM,4BAA4B,CAAC;AAEpF,qBACa,iBAAkB,SAAQ,eAAe;IAGxC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;gBAEN,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC;IAIjE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;YA0C9C,iBAAiB;YAgDjB,UAAU;CAazB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.S3HealthIndicator = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
15
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
16
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
17
|
+
const storage_blob_1 = require("@azure/storage-blob");
|
|
18
|
+
let S3HealthIndicator = class S3HealthIndicator extends terminus_1.HealthIndicator {
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super();
|
|
21
|
+
this.config = config;
|
|
22
|
+
this.TIMEOUT_MS = 5000;
|
|
23
|
+
}
|
|
24
|
+
async isHealthy(key) {
|
|
25
|
+
try {
|
|
26
|
+
const s3Config = this.config.get("s3");
|
|
27
|
+
if (!s3Config || !s3Config.bucket) {
|
|
28
|
+
return this.getStatus(key, true, {
|
|
29
|
+
message: "S3 not configured - skipping check",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const storageType = s3Config.type;
|
|
33
|
+
// Create a timeout promise
|
|
34
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
35
|
+
setTimeout(() => reject(new Error("Health check timeout")), this.TIMEOUT_MS);
|
|
36
|
+
});
|
|
37
|
+
let checkPromise;
|
|
38
|
+
if (storageType === "azure") {
|
|
39
|
+
checkPromise = this.checkAzure(s3Config);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
checkPromise = this.checkS3Compatible(s3Config);
|
|
43
|
+
}
|
|
44
|
+
await Promise.race([checkPromise, timeoutPromise]);
|
|
45
|
+
return this.getStatus(key, true, {
|
|
46
|
+
message: `${storageType} storage connection healthy`,
|
|
47
|
+
storageType,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
52
|
+
throw new terminus_1.HealthCheckError("S3/Storage health check failed", this.getStatus(key, false, {
|
|
53
|
+
message: errorMessage,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async checkS3Compatible(s3Config) {
|
|
58
|
+
const type = s3Config.type;
|
|
59
|
+
let s3Client;
|
|
60
|
+
switch (type) {
|
|
61
|
+
case "s3":
|
|
62
|
+
case "aws":
|
|
63
|
+
s3Client = new client_s3_1.S3Client({
|
|
64
|
+
region: s3Config.region,
|
|
65
|
+
credentials: {
|
|
66
|
+
accessKeyId: s3Config.key,
|
|
67
|
+
secretAccessKey: s3Config.secret,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
break;
|
|
71
|
+
case "digitalocean":
|
|
72
|
+
case "hetzner":
|
|
73
|
+
s3Client = new client_s3_1.S3Client({
|
|
74
|
+
region: s3Config.region,
|
|
75
|
+
endpoint: s3Config.endpoint,
|
|
76
|
+
credentials: {
|
|
77
|
+
accessKeyId: s3Config.key,
|
|
78
|
+
secretAccessKey: s3Config.secret,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
break;
|
|
82
|
+
case "minio":
|
|
83
|
+
s3Client = new client_s3_1.S3Client({
|
|
84
|
+
endpoint: s3Config.endpoint,
|
|
85
|
+
region: "local",
|
|
86
|
+
credentials: {
|
|
87
|
+
accessKeyId: s3Config.key,
|
|
88
|
+
secretAccessKey: s3Config.secret,
|
|
89
|
+
},
|
|
90
|
+
forcePathStyle: true,
|
|
91
|
+
});
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Unsupported storage type: ${type}`);
|
|
95
|
+
}
|
|
96
|
+
// HeadBucket is a lightweight operation to check bucket access
|
|
97
|
+
const command = new client_s3_1.HeadBucketCommand({ Bucket: s3Config.bucket });
|
|
98
|
+
await s3Client.send(command);
|
|
99
|
+
s3Client.destroy();
|
|
100
|
+
}
|
|
101
|
+
async checkAzure(s3Config) {
|
|
102
|
+
const connectionString = s3Config.key;
|
|
103
|
+
const containerName = s3Config.bucket;
|
|
104
|
+
const blobServiceClient = storage_blob_1.BlobServiceClient.fromConnectionString(connectionString);
|
|
105
|
+
const containerClient = blobServiceClient.getContainerClient(containerName);
|
|
106
|
+
// Check if container exists - lightweight operation
|
|
107
|
+
const exists = await containerClient.exists();
|
|
108
|
+
if (!exists) {
|
|
109
|
+
throw new Error(`Azure container '${containerName}' does not exist`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.S3HealthIndicator = S3HealthIndicator;
|
|
114
|
+
exports.S3HealthIndicator = S3HealthIndicator = __decorate([
|
|
115
|
+
(0, common_1.Injectable)(),
|
|
116
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
117
|
+
], S3HealthIndicator);
|
|
118
|
+
//# sourceMappingURL=s3.health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.health.js","sourceRoot":"","sources":["../../../../src/core/health/indicators/s3.health.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAC/C,+CAA4F;AAC5F,kDAAiE;AACjE,sDAAwD;AAIjD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,0BAAe;IAGpD,YAA6B,MAA0C;QACrE,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAoC;QAFtD,eAAU,GAAG,IAAI,CAAC;IAInC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAW;QACzB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAoB,IAAI,CAAC,CAAC;YAE1D,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClC,O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AAC,QAA2B;QAClD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC;QACtC,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC;QAEtC,MAAM,iBAAiB,GAAG,gCAAiB,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;QACnF,MAAM,eAAe,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;QAE5E,oDAAoD;QACpD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,oBAAoB,aAAa,kBAAkB,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;CACF,CAAA;AA9GY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAI0B,sBAAa;GAHvC,iBAAiB,CA8G7B"}
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -46,6 +46,8 @@ __exportStar(require("./debug"), exports);
|
|
|
46
46
|
__exportStar(require("./jsonapi"), exports);
|
|
47
47
|
// Tracing module (exports TracingContext)
|
|
48
48
|
__exportStar(require("./tracing"), exports);
|
|
49
|
+
// Health module for liveness/readiness probes
|
|
50
|
+
__exportStar(require("./health"), exports);
|
|
49
51
|
// Logging module (exports TracingServiceInterface but not TracingContext to avoid duplicates)
|
|
50
52
|
__exportStar(require("./logging"), exports);
|
|
51
53
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;AAEH,8EAA8E;AAC9E,gDAA8B;AAE9B,8BAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AAExB,mDAAmD;AACnD,4CAA0B;AAE1B,0CAA0C;AAC1C,4CAA0B;AAE1B,8FAA8F;AAC9F,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;AAEH,8EAA8E;AAC9E,gDAA8B;AAE9B,8BAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AAExB,mDAAmD;AACnD,4CAA0B;AAE1B,0CAA0C;AAC1C,4CAA0B;AAE1B,8CAA8C;AAC9C,2CAAyB;AAEzB,8FAA8F;AAC9F,4CAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carlonicora/nestjs-neo4jsonapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "NestJS foundation package with JSON:API, Neo4j, Redis, LangChain agents, and common utilities",
|
|
5
5
|
"author": "Carlo Nicora",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -182,6 +182,7 @@
|
|
|
182
182
|
"@nestjs/platform-fastify": "^11.1.9",
|
|
183
183
|
"@nestjs/platform-socket.io": "^11.1.9",
|
|
184
184
|
"@nestjs/schedule": "^6.0.1",
|
|
185
|
+
"@nestjs/terminus": "^11.0.0",
|
|
185
186
|
"@nestjs/throttler": "^6.5.0",
|
|
186
187
|
"@nestjs/websockets": "^11.1.9",
|
|
187
188
|
"nestjs-cls": "^6.1.0",
|