@sip-protocol/api 0.1.0 → 0.1.1
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 +8 -0
- package/dist/routes/index.js +1164 -145
- package/dist/server.d.ts +29 -1
- package/dist/server.js +1514 -173
- package/package.json +25 -11
- package/src/config.ts +121 -0
- package/src/logger.ts +99 -0
- package/src/middleware/auth.ts +128 -0
- package/src/middleware/cors.ts +163 -0
- package/src/middleware/error-handler.ts +18 -7
- package/src/middleware/index.ts +13 -1
- package/src/middleware/rate-limit.ts +203 -0
- package/src/middleware/request-id.ts +66 -0
- package/src/middleware/validation.ts +100 -11
- package/src/monitoring/index.ts +36 -0
- package/src/monitoring/metrics.ts +163 -0
- package/src/monitoring/sentry.ts +179 -0
- package/src/routes/commitment.ts +1 -1
- package/src/routes/health.ts +35 -3
- package/src/routes/index.ts +2 -0
- package/src/routes/metrics.ts +27 -0
- package/src/routes/proof.ts +68 -1
- package/src/routes/swap.ts +116 -47
- package/src/routes/webhook.ts +156 -0
- package/src/server.ts +142 -19
- package/src/services/helius-listener.ts +104 -0
- package/src/services/index.ts +15 -0
- package/src/services/token-metadata.ts +91 -0
- package/src/services/webhook-delivery.ts +146 -0
- package/src/shutdown.ts +119 -0
- package/src/stores/index.ts +2 -0
- package/src/stores/swap-store.ts +158 -0
- package/src/stores/webhook-store.ts +120 -0
- package/src/types/api.ts +67 -1
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Graceful Shutdown Handler
|
|
5
|
+
*
|
|
6
|
+
* Handles SIGTERM and SIGINT signals to:
|
|
7
|
+
* - Stop accepting new connections
|
|
8
|
+
* - Allow in-flight requests to complete
|
|
9
|
+
* - Clean up resources
|
|
10
|
+
* - Exit gracefully
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Check if server is currently shutting down
|
|
15
|
+
*/
|
|
16
|
+
declare function isServerShuttingDown(): boolean;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* SIP Protocol REST API Server
|
|
20
|
+
*
|
|
21
|
+
* Production-ready Express server with:
|
|
22
|
+
* - Structured logging (pino)
|
|
23
|
+
* - Environment validation (envalid)
|
|
24
|
+
* - Graceful shutdown handling
|
|
25
|
+
* - Security middleware (helmet, CORS, rate limiting)
|
|
26
|
+
* - Request authentication
|
|
27
|
+
* - Error monitoring (Sentry)
|
|
28
|
+
* - Metrics collection (Prometheus)
|
|
29
|
+
*/
|
|
30
|
+
|
|
3
31
|
declare const app: Express;
|
|
4
32
|
|
|
5
|
-
export { app as default };
|
|
33
|
+
export { app as default, isServerShuttingDown };
|