request-scope-api 1.0.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 +275 -0
- package/dist/cjs/adapters/adapter.interface.js +9 -0
- package/dist/cjs/adapters/adapter.interface.js.map +1 -0
- package/dist/cjs/adapters/mongo.adapter.js +188 -0
- package/dist/cjs/adapters/mongo.adapter.js.map +1 -0
- package/dist/cjs/adapters/mysql.adapter.js +243 -0
- package/dist/cjs/adapters/mysql.adapter.js.map +1 -0
- package/dist/cjs/adapters/pg.adapter.js +334 -0
- package/dist/cjs/adapters/pg.adapter.js.map +1 -0
- package/dist/cjs/capture.js +310 -0
- package/dist/cjs/capture.js.map +1 -0
- package/dist/cjs/config.js +122 -0
- package/dist/cjs/config.js.map +1 -0
- package/dist/cjs/dashboard/api.js +173 -0
- package/dist/cjs/dashboard/api.js.map +1 -0
- package/dist/cjs/dashboard/router.js +96 -0
- package/dist/cjs/dashboard/router.js.map +1 -0
- package/dist/cjs/index.js +49 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/masker.js +73 -0
- package/dist/cjs/masker.js.map +1 -0
- package/dist/cjs/middleware.js +198 -0
- package/dist/cjs/middleware.js.map +1 -0
- package/dist/cjs/queue.js +114 -0
- package/dist/cjs/queue.js.map +1 -0
- package/dist/cjs/retention.js +64 -0
- package/dist/cjs/retention.js.map +1 -0
- package/dist/cjs/types.js +9 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/dashboard/assets/index-C0TqFHk6.css +1 -0
- package/dist/dashboard/assets/index-MCuAZo4Q.js +67 -0
- package/dist/dashboard/index.html +13 -0
- package/dist/esm/adapters/adapter.interface.js +8 -0
- package/dist/esm/adapters/adapter.interface.js.map +1 -0
- package/dist/esm/adapters/mongo.adapter.js +184 -0
- package/dist/esm/adapters/mongo.adapter.js.map +1 -0
- package/dist/esm/adapters/mysql.adapter.js +236 -0
- package/dist/esm/adapters/mysql.adapter.js.map +1 -0
- package/dist/esm/adapters/pg.adapter.js +330 -0
- package/dist/esm/adapters/pg.adapter.js.map +1 -0
- package/dist/esm/capture.js +304 -0
- package/dist/esm/capture.js.map +1 -0
- package/dist/esm/config.js +117 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/dashboard/api.js +168 -0
- package/dist/esm/dashboard/api.js.map +1 -0
- package/dist/esm/dashboard/router.js +90 -0
- package/dist/esm/dashboard/router.js.map +1 -0
- package/dist/esm/index.js +50 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/masker.js +70 -0
- package/dist/esm/masker.js.map +1 -0
- package/dist/esm/middleware.js +193 -0
- package/dist/esm/middleware.js.map +1 -0
- package/dist/esm/queue.js +110 -0
- package/dist/esm/queue.js.map +1 -0
- package/dist/esm/retention.js +60 -0
- package/dist/esm/retention.js.map +1 -0
- package/dist/esm/types.js +8 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/types/adapters/adapter.interface.d.ts +7 -0
- package/dist/types/adapters/mongo.adapter.d.ts +25 -0
- package/dist/types/adapters/mysql.adapter.d.ts +24 -0
- package/dist/types/adapters/pg.adapter.d.ts +29 -0
- package/dist/types/capture.d.ts +88 -0
- package/dist/types/config.d.ts +38 -0
- package/dist/types/dashboard/api.d.ts +49 -0
- package/dist/types/dashboard/router.d.ts +28 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/masker.d.ts +15 -0
- package/dist/types/middleware.d.ts +67 -0
- package/dist/types/queue.d.ts +49 -0
- package/dist/types/retention.d.ts +30 -0
- package/dist/types/types.d.ts +101 -0
- package/package.json +48 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequestScope — Dashboard router.
|
|
3
|
+
*
|
|
4
|
+
* Provides an Express router with:
|
|
5
|
+
* - Optional BasicAuth middleware
|
|
6
|
+
* - API routes for querying records
|
|
7
|
+
* - Static file serving for the React SPA
|
|
8
|
+
* - SPA fallback for client-side routing
|
|
9
|
+
*
|
|
10
|
+
* Requirements: 8.1, 8.2, 8.3, 8.4
|
|
11
|
+
*/
|
|
12
|
+
import { Router } from 'express';
|
|
13
|
+
import type { DashboardConfig, StorageAdapter } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Creates and returns an Express router for the RequestScope dashboard.
|
|
16
|
+
*
|
|
17
|
+
* The router includes:
|
|
18
|
+
* - BasicAuth middleware (if auth config is provided)
|
|
19
|
+
* - GET /api/records — List records with filtering and pagination
|
|
20
|
+
* - GET /api/records/:id — Get a single record by ID
|
|
21
|
+
* - Static file serving for the React SPA
|
|
22
|
+
* - SPA fallback for client-side routing
|
|
23
|
+
*
|
|
24
|
+
* @param config - Optional dashboard configuration
|
|
25
|
+
* @param adapter - Storage adapter instance (must be set on the app)
|
|
26
|
+
* @returns Express Router
|
|
27
|
+
*/
|
|
28
|
+
export declare function createDashboardRouter(config?: DashboardConfig, adapter?: StorageAdapter): Router;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequestScope — Public API entry point.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - Default export: requestscope(config) middleware factory
|
|
6
|
+
* - requestscope.dashboard: dashboard router factory
|
|
7
|
+
* - All public TypeScript interfaces
|
|
8
|
+
*
|
|
9
|
+
* Requirements: 1.1, 12.1, 12.2, 12.3, 12.4
|
|
10
|
+
*/
|
|
11
|
+
import { requestscope as requestscopeMiddleware, errorHandler, setup } from './middleware';
|
|
12
|
+
import type { RequestScopeConfig, StorageConfig, AuthConfig, RequestRecord, StorageAdapter, QueryFilters, DashboardConfig } from './types';
|
|
13
|
+
/**
|
|
14
|
+
* Creates and returns an Express middleware that captures HTTP requests.
|
|
15
|
+
*
|
|
16
|
+
* @param config - RequestScope configuration object
|
|
17
|
+
* @returns Express RequestHandler middleware
|
|
18
|
+
*/
|
|
19
|
+
export default requestscopeMiddleware;
|
|
20
|
+
/**
|
|
21
|
+
* Creates and returns an Express router for the RequestScope dashboard.
|
|
22
|
+
*
|
|
23
|
+
* @param config - Optional dashboard configuration
|
|
24
|
+
* @param adapter - Optional storage adapter instance
|
|
25
|
+
* @returns Express Router
|
|
26
|
+
*/
|
|
27
|
+
export declare function dashboard(config?: DashboardConfig, adapter?: StorageAdapter): import("express").Router;
|
|
28
|
+
export { setup };
|
|
29
|
+
export { errorHandler };
|
|
30
|
+
export type { RequestScopeConfig, StorageConfig, AuthConfig, RequestRecord, StorageAdapter, QueryFilters, DashboardConfig, };
|
|
31
|
+
export { requestscope as requestscopeMiddleware } from './middleware';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* masker.ts — Recursive sensitive field masking
|
|
3
|
+
*
|
|
4
|
+
* Provides a pure function that recursively replaces sensitive field values
|
|
5
|
+
* with "******" at any nesting depth.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Recursively masks sensitive fields in an object.
|
|
9
|
+
*
|
|
10
|
+
* @param obj - The object to mask
|
|
11
|
+
* @param sensitiveFields - Set of field names to mask (stored in lowercase)
|
|
12
|
+
* @param depth - Current recursion depth (default: 0)
|
|
13
|
+
* @returns A new object with sensitive fields replaced by "******"
|
|
14
|
+
*/
|
|
15
|
+
export declare function maskObject(obj: Record<string, unknown>, sensitiveFields: Set<string>, depth?: number): Record<string, unknown>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequestScope — Core middleware factory.
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* - requestscope(config) — Express middleware factory that validates config,
|
|
6
|
+
* instantiates the appropriate storage adapter, creates AsyncQueue and
|
|
7
|
+
* RetentionScheduler, and returns a request handler.
|
|
8
|
+
* - errorHandler — 4-arity error middleware that attaches error data to
|
|
9
|
+
* the request for capture by the finish handler.
|
|
10
|
+
*
|
|
11
|
+
* Requirements: 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.2, 4.1, 4.2, 4.3, 5.1
|
|
12
|
+
*/
|
|
13
|
+
import type { Request, Response, NextFunction, RequestHandler } from 'express';
|
|
14
|
+
import type { RequestScopeConfig, StorageAdapter } from './types';
|
|
15
|
+
/**
|
|
16
|
+
* Creates and returns an Express middleware that captures HTTP requests.
|
|
17
|
+
*
|
|
18
|
+
* Validation and initialization:
|
|
19
|
+
* 1. Calls `validateConfig()`, `applyDefaults()`, and `buildSensitiveFieldSet()`
|
|
20
|
+
* synchronously; throws on any validation error.
|
|
21
|
+
* 2. Instantiates the correct `StorageAdapter` based on `storage.type` (unless adapter is provided).
|
|
22
|
+
* 3. Calls `adapter.initialize()` asynchronously; logs errors to `stderr`
|
|
23
|
+
* without throwing (middleware continues to function even if storage fails).
|
|
24
|
+
* 4. Creates `AsyncQueue` and `RetentionScheduler`; starts both.
|
|
25
|
+
* 5. Attaches queue `drain()` to `process.on('SIGTERM')` and
|
|
26
|
+
* `process.on('SIGINT')` for graceful shutdown.
|
|
27
|
+
*
|
|
28
|
+
* Request handling:
|
|
29
|
+
* - Checks `ignore` list; skips capture and calls `next()` if matched.
|
|
30
|
+
* - Buffers request body via `bufferRequestBody()`.
|
|
31
|
+
* - Wraps response via `wrapResponse()` to accumulate response chunks.
|
|
32
|
+
* - On response finish, builds `RequestRecord` and enqueues it.
|
|
33
|
+
*
|
|
34
|
+
* @param config - RequestScope configuration object
|
|
35
|
+
* @param adapter - Optional storage adapter instance (for sharing with dashboard)
|
|
36
|
+
* @returns Express RequestHandler middleware
|
|
37
|
+
*/
|
|
38
|
+
export declare function requestscope(config: RequestScopeConfig, adapter?: StorageAdapter): RequestHandler;
|
|
39
|
+
/**
|
|
40
|
+
* Sets up RequestScope middleware and automatically mounts the dashboard at /requestscope.
|
|
41
|
+
*
|
|
42
|
+
* This function:
|
|
43
|
+
* 1. Creates the storage adapter
|
|
44
|
+
* 2. Sets up the request capture middleware
|
|
45
|
+
* 3. Automatically mounts the dashboard at /requestscope
|
|
46
|
+
*
|
|
47
|
+
* @param app - Express application instance
|
|
48
|
+
* @param config - RequestScope configuration object
|
|
49
|
+
*/
|
|
50
|
+
export declare function setup(app: any, config: RequestScopeConfig): void;
|
|
51
|
+
/**
|
|
52
|
+
* 4-arity error middleware that attaches error data to the request.
|
|
53
|
+
*
|
|
54
|
+
* The error data (message, stack, statusCode) is attached via a Symbol-keyed
|
|
55
|
+
* property so the response finish handler can include it in the RequestRecord.
|
|
56
|
+
*
|
|
57
|
+
* Usage:
|
|
58
|
+
* app.use(requestscope(config));
|
|
59
|
+
* app.use(errorHandler);
|
|
60
|
+
* // ... route handlers that may throw
|
|
61
|
+
*
|
|
62
|
+
* @param err - Error object
|
|
63
|
+
* @param req - Express Request
|
|
64
|
+
* @param res - Express Response
|
|
65
|
+
* @param next - Express NextFunction
|
|
66
|
+
*/
|
|
67
|
+
export declare function errorHandler(err: Error, req: Request, res: Response, next: NextFunction): void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AsyncQueue — In-process batch write queue.
|
|
3
|
+
*
|
|
4
|
+
* Decouples the hot-path enqueue (synchronous, ≤1 ms) from database writes,
|
|
5
|
+
* which happen asynchronously in configurable batches. Fault isolation is
|
|
6
|
+
* total: adapter failures are caught, logged to stderr, and discarded so
|
|
7
|
+
* they never propagate to the caller.
|
|
8
|
+
*/
|
|
9
|
+
import type { RequestRecord, StorageAdapter } from './types';
|
|
10
|
+
export declare class AsyncQueue {
|
|
11
|
+
private readonly adapter;
|
|
12
|
+
private readonly batchSize;
|
|
13
|
+
private readonly flushIntervalMs;
|
|
14
|
+
private readonly maxCapacity;
|
|
15
|
+
private items;
|
|
16
|
+
private flushTimer;
|
|
17
|
+
private isFlushing;
|
|
18
|
+
constructor(adapter: StorageAdapter, batchSize?: number, flushIntervalMs?: number, maxCapacity?: number);
|
|
19
|
+
/**
|
|
20
|
+
* Synchronously adds a record to the queue.
|
|
21
|
+
*
|
|
22
|
+
* If the queue is at capacity, the record is discarded and a warning is
|
|
23
|
+
* written to stderr. If the queue has reached `batchSize` after this push,
|
|
24
|
+
* a flush is triggered immediately (fire-and-forget).
|
|
25
|
+
*/
|
|
26
|
+
enqueue(record: RequestRecord): void;
|
|
27
|
+
/**
|
|
28
|
+
* Flushes up to `batchSize` items from the front of the queue.
|
|
29
|
+
*
|
|
30
|
+
* A guard (`isFlushing`) prevents concurrent flushes. The splice is
|
|
31
|
+
* performed atomically before the async adapter call so no records are
|
|
32
|
+
* lost even if the adapter rejects. On failure the batch is discarded
|
|
33
|
+
* and the error is written to stderr.
|
|
34
|
+
*/
|
|
35
|
+
private flush;
|
|
36
|
+
/**
|
|
37
|
+
* Flushes all remaining items in the queue, waiting at most `timeoutMs`
|
|
38
|
+
* milliseconds. Any items that could not be flushed before the timeout
|
|
39
|
+
* are logged to stderr.
|
|
40
|
+
*
|
|
41
|
+
* Used during graceful shutdown (SIGTERM / SIGINT).
|
|
42
|
+
*/
|
|
43
|
+
drain(timeoutMs?: number): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Clears the periodic flush timer. Call this to allow the Node.js process
|
|
46
|
+
* to exit cleanly, or when the queue is no longer needed.
|
|
47
|
+
*/
|
|
48
|
+
destroy(): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RetentionScheduler — automatically purges records older than the configured
|
|
3
|
+
* retention window by calling `adapter.deleteOlderThan()` once per day.
|
|
4
|
+
*
|
|
5
|
+
* Requirements: 7.1, 7.2, 7.4, 7.5
|
|
6
|
+
*/
|
|
7
|
+
import type { StorageAdapter } from './adapters/adapter.interface';
|
|
8
|
+
export declare class RetentionScheduler {
|
|
9
|
+
private readonly adapter;
|
|
10
|
+
private readonly retentionDays;
|
|
11
|
+
private intervalHandle;
|
|
12
|
+
constructor(adapter: StorageAdapter, retentionDays: number);
|
|
13
|
+
/**
|
|
14
|
+
* Runs the retention job immediately, then schedules it to repeat every 24 h.
|
|
15
|
+
* Calling `start()` more than once has no additional effect until `stop()` is
|
|
16
|
+
* called first (the previous interval is replaced by the new one).
|
|
17
|
+
*/
|
|
18
|
+
start(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Stops the scheduled retention job. Inflight `runOnce()` calls are allowed
|
|
21
|
+
* to complete naturally because they are fire-and-forget.
|
|
22
|
+
*/
|
|
23
|
+
stop(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Computes the cutoff date from `retentionDays` and asks the adapter to
|
|
26
|
+
* delete every record older than that date. Any error is logged to `stderr`
|
|
27
|
+
* but never rethrown so the scheduler stays alive for the next tick.
|
|
28
|
+
*/
|
|
29
|
+
private runOnce;
|
|
30
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequestScope — All exported TypeScript interfaces.
|
|
3
|
+
*
|
|
4
|
+
* This file is the single source of truth for every public type in the library.
|
|
5
|
+
* All interfaces are written to compile under `strict: true` with zero errors.
|
|
6
|
+
*/
|
|
7
|
+
export interface RequestRecord {
|
|
8
|
+
id: string;
|
|
9
|
+
method: string;
|
|
10
|
+
url: string;
|
|
11
|
+
route: string | null;
|
|
12
|
+
queryParams: Record<string, string>;
|
|
13
|
+
pathParams: Record<string, string>;
|
|
14
|
+
requestHeaders: Record<string, string>;
|
|
15
|
+
requestBody: string;
|
|
16
|
+
requestBodySize: number;
|
|
17
|
+
clientIp: string;
|
|
18
|
+
userAgent: string;
|
|
19
|
+
statusCode: number;
|
|
20
|
+
responseHeaders: Record<string, string>;
|
|
21
|
+
responseBody: string;
|
|
22
|
+
responseBodySize: number;
|
|
23
|
+
responseTime: number;
|
|
24
|
+
errorMessage: string | null;
|
|
25
|
+
errorStack: string | null;
|
|
26
|
+
errorStatusCode: number | null;
|
|
27
|
+
timestamp: string;
|
|
28
|
+
}
|
|
29
|
+
export interface QueryFilters {
|
|
30
|
+
/** Case-insensitive substring match on url */
|
|
31
|
+
search?: string;
|
|
32
|
+
/** ISO 8601 — inclusive lower bound on timestamp */
|
|
33
|
+
startDate?: string;
|
|
34
|
+
/** ISO 8601 — inclusive upper bound on timestamp */
|
|
35
|
+
endDate?: string;
|
|
36
|
+
statusCodeGroup?: '2xx' | '3xx' | '4xx' | '5xx';
|
|
37
|
+
/** Exact match; takes precedence over statusCodeGroup */
|
|
38
|
+
statusCode?: number;
|
|
39
|
+
/** Exact match, case-insensitive */
|
|
40
|
+
method?: string;
|
|
41
|
+
/** Exact match on record ID */
|
|
42
|
+
id?: string;
|
|
43
|
+
sortBy?: 'timestamp' | 'responseTime' | 'statusCode';
|
|
44
|
+
sortOrder?: 'asc' | 'desc';
|
|
45
|
+
page: number;
|
|
46
|
+
pageSize: number;
|
|
47
|
+
}
|
|
48
|
+
export interface StorageConfig {
|
|
49
|
+
type: 'mongodb' | 'mysql' | 'postgresql';
|
|
50
|
+
uri?: string;
|
|
51
|
+
host?: string;
|
|
52
|
+
port?: number;
|
|
53
|
+
database?: string;
|
|
54
|
+
username?: string;
|
|
55
|
+
password?: string;
|
|
56
|
+
/** Connection pool size. Default: 5 */
|
|
57
|
+
poolSize?: number;
|
|
58
|
+
/** Enable SSL/TLS. Default: false */
|
|
59
|
+
ssl?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface AuthConfig {
|
|
62
|
+
username: string;
|
|
63
|
+
password: string;
|
|
64
|
+
}
|
|
65
|
+
export interface DashboardConfig {
|
|
66
|
+
auth?: AuthConfig;
|
|
67
|
+
/** Mount path for the dashboard. Default: "/requestscope" */
|
|
68
|
+
mountPath?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface RequestScopeConfig {
|
|
71
|
+
storage: StorageConfig;
|
|
72
|
+
/** Number of days to retain records. Range: 1–365. Default: 30 */
|
|
73
|
+
retentionDays?: number;
|
|
74
|
+
/** Exact URL paths to skip (no capture). Default: [] */
|
|
75
|
+
ignore?: string[];
|
|
76
|
+
/** Additional field names to mask. Merged with the built-in defaults. Default: [] */
|
|
77
|
+
maskFields?: string[];
|
|
78
|
+
dashboard?: DashboardConfig;
|
|
79
|
+
}
|
|
80
|
+
export interface StorageAdapter {
|
|
81
|
+
/** Creates tables / collections if they do not already exist. */
|
|
82
|
+
initialize(): Promise<void>;
|
|
83
|
+
/** Batch-inserts an array of request records. */
|
|
84
|
+
insert(records: RequestRecord[]): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Returns the page slice of records matching `filters` together with the
|
|
87
|
+
* total count of all matching records (across all pages).
|
|
88
|
+
*/
|
|
89
|
+
query(filters: QueryFilters, pagination: {
|
|
90
|
+
page: number;
|
|
91
|
+
pageSize: number;
|
|
92
|
+
}): Promise<{
|
|
93
|
+
records: RequestRecord[];
|
|
94
|
+
total: number;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Deletes all records whose creation timestamp is older than `date`.
|
|
98
|
+
* Returns the number of deleted records.
|
|
99
|
+
*/
|
|
100
|
+
deleteOlderThan(date: Date): Promise<number>;
|
|
101
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "request-scope-api",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Zero-friction API request observability for Express.js applications",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"express",
|
|
7
|
+
"middleware",
|
|
8
|
+
"monitoring",
|
|
9
|
+
"telescope",
|
|
10
|
+
"observability",
|
|
11
|
+
"request-logging"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "jaydip",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/esm/index.js",
|
|
18
|
+
"require": "./dist/cjs/index.js",
|
|
19
|
+
"types": "./dist/types/index.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "dist/cjs/index.js",
|
|
23
|
+
"types": "dist/types/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc --project tsconfig.json",
|
|
30
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"express": "4.18.2",
|
|
35
|
+
"mongodb": "6.3.0",
|
|
36
|
+
"mysql2": "3.6.5",
|
|
37
|
+
"pg": "8.11.3",
|
|
38
|
+
"uuid": "9.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/express": "4.17.21",
|
|
42
|
+
"@types/node": "20.10.0",
|
|
43
|
+
"@types/pg": "8.10.9",
|
|
44
|
+
"@types/uuid": "9.0.7",
|
|
45
|
+
"typescript": "^5.9.3"
|
|
46
|
+
},
|
|
47
|
+
"module": "dist/esm/index.js"
|
|
48
|
+
}
|