@johnboxcodes/boxlogger 0.1.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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +248 -0
- package/dist/index.d.ts +607 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1147 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +180 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +389 -0
- package/dist/logger.js.map +1 -0
- package/dist/scope.d.ts +242 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +373 -0
- package/dist/scope.js.map +1 -0
- package/dist/stores/base.d.ts +127 -0
- package/dist/stores/base.d.ts.map +1 -0
- package/dist/stores/base.js +288 -0
- package/dist/stores/base.js.map +1 -0
- package/dist/stores/index.d.ts +12 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/index.js +12 -0
- package/dist/stores/index.js.map +1 -0
- package/dist/stores/memory.d.ts +131 -0
- package/dist/stores/memory.d.ts.map +1 -0
- package/dist/stores/memory.js +284 -0
- package/dist/stores/memory.js.map +1 -0
- package/dist/stores/sqlite.d.ts +204 -0
- package/dist/stores/sqlite.d.ts.map +1 -0
- package/dist/stores/sqlite.js +608 -0
- package/dist/stores/sqlite.js.map +1 -0
- package/dist/types.d.ts +607 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/package.json +84 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for NodeLogger
|
|
3
|
+
*
|
|
4
|
+
* @module types
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Log severity levels ordered from most to least severe
|
|
9
|
+
*/
|
|
10
|
+
export type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
11
|
+
/**
|
|
12
|
+
* Numeric values for log levels (lower = more severe)
|
|
13
|
+
*/
|
|
14
|
+
export declare const LogLevelValue: Record<LogLevel, number>;
|
|
15
|
+
/**
|
|
16
|
+
* Metadata attached to log entries
|
|
17
|
+
*/
|
|
18
|
+
export interface LogMetadata {
|
|
19
|
+
/** Additional tags for filtering */
|
|
20
|
+
tags?: Record<string, string>;
|
|
21
|
+
/** Arbitrary extra data */
|
|
22
|
+
extra?: Record<string, unknown>;
|
|
23
|
+
/** User information */
|
|
24
|
+
user?: UserInfo;
|
|
25
|
+
/** Request context */
|
|
26
|
+
request?: RequestInfo;
|
|
27
|
+
/** Error/exception data */
|
|
28
|
+
error?: ErrorInfo;
|
|
29
|
+
/** Trace correlation ID */
|
|
30
|
+
traceId?: string;
|
|
31
|
+
/** Span ID for distributed tracing */
|
|
32
|
+
spanId?: string;
|
|
33
|
+
/** Parent span ID */
|
|
34
|
+
parentSpanId?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Sentry-compatible severity level
|
|
38
|
+
*/
|
|
39
|
+
export type SeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug';
|
|
40
|
+
/**
|
|
41
|
+
* User information for attribution (Sentry-compatible)
|
|
42
|
+
*/
|
|
43
|
+
export interface UserInfo {
|
|
44
|
+
/** Unique user identifier */
|
|
45
|
+
id?: string | number;
|
|
46
|
+
/** User email */
|
|
47
|
+
email?: string;
|
|
48
|
+
/** Username or handle */
|
|
49
|
+
username?: string;
|
|
50
|
+
/** IP address - use '{{auto}}' for auto-detection */
|
|
51
|
+
ip_address?: string;
|
|
52
|
+
/** @deprecated Use ip_address instead */
|
|
53
|
+
ipAddress?: string;
|
|
54
|
+
/** User segment for analytics (e.g., 'free', 'pro', 'enterprise') */
|
|
55
|
+
segment?: string;
|
|
56
|
+
/** Additional user data */
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* HTTP request information
|
|
61
|
+
*/
|
|
62
|
+
export interface RequestInfo {
|
|
63
|
+
/** Request URL */
|
|
64
|
+
url?: string;
|
|
65
|
+
/** HTTP method */
|
|
66
|
+
method?: string;
|
|
67
|
+
/** Request headers */
|
|
68
|
+
headers?: Record<string, string>;
|
|
69
|
+
/** Query string or params */
|
|
70
|
+
query?: string | Record<string, string>;
|
|
71
|
+
/** Request body */
|
|
72
|
+
body?: unknown;
|
|
73
|
+
/** Response status code */
|
|
74
|
+
statusCode?: number;
|
|
75
|
+
/** Request duration in ms */
|
|
76
|
+
duration?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Error/exception information
|
|
80
|
+
*/
|
|
81
|
+
export interface ErrorInfo {
|
|
82
|
+
/** Error type/class name */
|
|
83
|
+
type: string;
|
|
84
|
+
/** Error message */
|
|
85
|
+
message: string;
|
|
86
|
+
/** Stack trace */
|
|
87
|
+
stack?: string;
|
|
88
|
+
/** Error code */
|
|
89
|
+
code?: string | number;
|
|
90
|
+
/** Whether the error was handled */
|
|
91
|
+
handled?: boolean;
|
|
92
|
+
/** Cause chain */
|
|
93
|
+
cause?: ErrorInfo;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A single log entry stored in the backend
|
|
97
|
+
*/
|
|
98
|
+
export interface LogEntry {
|
|
99
|
+
/** Unique log entry ID */
|
|
100
|
+
id: string;
|
|
101
|
+
/** ISO 8601 timestamp */
|
|
102
|
+
timestamp: string;
|
|
103
|
+
/** Log severity level */
|
|
104
|
+
level: LogLevel;
|
|
105
|
+
/** Log message */
|
|
106
|
+
message: string;
|
|
107
|
+
/** Logger name/category */
|
|
108
|
+
logger?: string;
|
|
109
|
+
/** Session ID */
|
|
110
|
+
sessionId?: string;
|
|
111
|
+
/** Metadata */
|
|
112
|
+
metadata?: LogMetadata;
|
|
113
|
+
/** Application/service name */
|
|
114
|
+
service?: string;
|
|
115
|
+
/** Environment (production, staging, etc.) */
|
|
116
|
+
environment?: string;
|
|
117
|
+
/** Release/version */
|
|
118
|
+
release?: string;
|
|
119
|
+
/** Host/server name */
|
|
120
|
+
hostname?: string;
|
|
121
|
+
/** Process ID */
|
|
122
|
+
pid?: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Session tracking data
|
|
126
|
+
*/
|
|
127
|
+
export interface Session {
|
|
128
|
+
/** Unique session ID */
|
|
129
|
+
id: string;
|
|
130
|
+
/** Session start time (ISO 8601) */
|
|
131
|
+
startedAt: string;
|
|
132
|
+
/** Session end time (ISO 8601) */
|
|
133
|
+
endedAt?: string;
|
|
134
|
+
/** Session status */
|
|
135
|
+
status: 'active' | 'ended' | 'crashed';
|
|
136
|
+
/** Error count during session */
|
|
137
|
+
errorCount: number;
|
|
138
|
+
/** Session duration in ms */
|
|
139
|
+
duration?: number;
|
|
140
|
+
/** User info */
|
|
141
|
+
user?: UserInfo;
|
|
142
|
+
/** Session attributes */
|
|
143
|
+
attributes?: Record<string, unknown>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Filter options for querying logs
|
|
147
|
+
*/
|
|
148
|
+
export interface LogFilter {
|
|
149
|
+
/** Filter by log level(s) */
|
|
150
|
+
level?: LogLevel | LogLevel[];
|
|
151
|
+
/** Filter by session ID */
|
|
152
|
+
sessionId?: string;
|
|
153
|
+
/** Filter by logger name */
|
|
154
|
+
logger?: string;
|
|
155
|
+
/** Filter from this time (inclusive) */
|
|
156
|
+
startTime?: string | Date;
|
|
157
|
+
/** Filter to this time (inclusive) */
|
|
158
|
+
endTime?: string | Date;
|
|
159
|
+
/** Full-text search in message */
|
|
160
|
+
search?: string;
|
|
161
|
+
/** Filter by tags */
|
|
162
|
+
tags?: Record<string, string>;
|
|
163
|
+
/** Filter by trace ID */
|
|
164
|
+
traceId?: string;
|
|
165
|
+
/** Filter by service name */
|
|
166
|
+
service?: string;
|
|
167
|
+
/** Filter by environment */
|
|
168
|
+
environment?: string;
|
|
169
|
+
/** Maximum results to return */
|
|
170
|
+
limit?: number;
|
|
171
|
+
/** Skip this many results */
|
|
172
|
+
offset?: number;
|
|
173
|
+
/** Sort field */
|
|
174
|
+
orderBy?: 'timestamp' | 'level';
|
|
175
|
+
/** Sort direction */
|
|
176
|
+
orderDirection?: 'asc' | 'desc';
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Filter options for querying sessions
|
|
180
|
+
*/
|
|
181
|
+
export interface SessionFilter {
|
|
182
|
+
/** Filter by status */
|
|
183
|
+
status?: Session['status'] | Session['status'][];
|
|
184
|
+
/** Filter by user ID */
|
|
185
|
+
userId?: string | number;
|
|
186
|
+
/** Filter from this time */
|
|
187
|
+
startTime?: string | Date;
|
|
188
|
+
/** Filter to this time */
|
|
189
|
+
endTime?: string | Date;
|
|
190
|
+
/** Maximum results */
|
|
191
|
+
limit?: number;
|
|
192
|
+
/** Skip this many results */
|
|
193
|
+
offset?: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Configuration for store providers
|
|
197
|
+
*/
|
|
198
|
+
export interface StoreProviderConfig {
|
|
199
|
+
/** Maximum log entries to retain */
|
|
200
|
+
maxLogs?: number;
|
|
201
|
+
/** Maximum sessions to retain */
|
|
202
|
+
maxSessions?: number;
|
|
203
|
+
/** Auto-cleanup interval in ms (0 to disable) */
|
|
204
|
+
cleanupInterval?: number;
|
|
205
|
+
/** Retention period in ms */
|
|
206
|
+
retentionPeriod?: number;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Store provider interface that all implementations must follow
|
|
210
|
+
*
|
|
211
|
+
* @remarks
|
|
212
|
+
* Implement this interface to create custom storage backends.
|
|
213
|
+
* All methods are async to support both sync and async stores.
|
|
214
|
+
*/
|
|
215
|
+
export interface StoreProvider {
|
|
216
|
+
/** Provider name (e.g., 'sqlite', 'mongodb', 'memory') */
|
|
217
|
+
readonly name: string;
|
|
218
|
+
/**
|
|
219
|
+
* Check if the store is ready for operations
|
|
220
|
+
* @returns true if initialized and ready
|
|
221
|
+
*/
|
|
222
|
+
isReady(): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Initialize the store provider
|
|
225
|
+
* @throws Error if initialization fails
|
|
226
|
+
*/
|
|
227
|
+
init(): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Close the store and release resources
|
|
230
|
+
*/
|
|
231
|
+
close(): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Save a log entry
|
|
234
|
+
* @param entry - Log entry to save
|
|
235
|
+
*/
|
|
236
|
+
saveLog(entry: LogEntry): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Retrieve log entries matching filter
|
|
239
|
+
* @param filter - Query filter
|
|
240
|
+
* @returns Matching log entries
|
|
241
|
+
*/
|
|
242
|
+
getLogs(filter?: LogFilter): Promise<LogEntry[]>;
|
|
243
|
+
/**
|
|
244
|
+
* Delete log entries matching filter
|
|
245
|
+
* @param filter - Query filter (deletes all if not provided)
|
|
246
|
+
*/
|
|
247
|
+
deleteLogs(filter?: LogFilter): Promise<number>;
|
|
248
|
+
/**
|
|
249
|
+
* Count log entries matching filter
|
|
250
|
+
* @param filter - Query filter
|
|
251
|
+
* @returns Number of matching entries
|
|
252
|
+
*/
|
|
253
|
+
countLogs(filter?: LogFilter): Promise<number>;
|
|
254
|
+
/**
|
|
255
|
+
* Create a new session
|
|
256
|
+
* @param session - Session to create
|
|
257
|
+
*/
|
|
258
|
+
createSession(session: Session): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Update an existing session
|
|
261
|
+
* @param sessionId - Session ID
|
|
262
|
+
* @param updates - Partial session data to merge
|
|
263
|
+
*/
|
|
264
|
+
updateSession(sessionId: string, updates: Partial<Session>): Promise<void>;
|
|
265
|
+
/**
|
|
266
|
+
* Get a session by ID
|
|
267
|
+
* @param sessionId - Session ID
|
|
268
|
+
* @returns Session or null if not found
|
|
269
|
+
*/
|
|
270
|
+
getSession(sessionId: string): Promise<Session | null>;
|
|
271
|
+
/**
|
|
272
|
+
* Get sessions matching filter
|
|
273
|
+
* @param filter - Query filter
|
|
274
|
+
* @returns Matching sessions
|
|
275
|
+
*/
|
|
276
|
+
getSessions(filter?: SessionFilter): Promise<Session[]>;
|
|
277
|
+
/**
|
|
278
|
+
* Delete a session and its logs
|
|
279
|
+
* @param sessionId - Session ID to delete
|
|
280
|
+
*/
|
|
281
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
282
|
+
/**
|
|
283
|
+
* Run cleanup to remove old data
|
|
284
|
+
* @param olderThan - Delete entries older than this date
|
|
285
|
+
* @returns Number of deleted entries
|
|
286
|
+
*/
|
|
287
|
+
cleanup(olderThan: Date): Promise<number>;
|
|
288
|
+
/**
|
|
289
|
+
* Get storage statistics
|
|
290
|
+
* @returns Storage stats
|
|
291
|
+
*/
|
|
292
|
+
getStats(): Promise<StoreStats>;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Storage statistics
|
|
296
|
+
*/
|
|
297
|
+
export interface StoreStats {
|
|
298
|
+
/** Total log entries */
|
|
299
|
+
totalLogs: number;
|
|
300
|
+
/** Total sessions */
|
|
301
|
+
totalSessions: number;
|
|
302
|
+
/** Active sessions */
|
|
303
|
+
activeSessions: number;
|
|
304
|
+
/** Logs by level */
|
|
305
|
+
logsByLevel: Record<LogLevel, number>;
|
|
306
|
+
/** Storage size in bytes (if available) */
|
|
307
|
+
sizeBytes?: number;
|
|
308
|
+
/** Oldest log timestamp */
|
|
309
|
+
oldestLog?: string;
|
|
310
|
+
/** Newest log timestamp */
|
|
311
|
+
newestLog?: string;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Logger configuration options
|
|
315
|
+
*/
|
|
316
|
+
export interface LoggerConfig {
|
|
317
|
+
/** Store provider instance */
|
|
318
|
+
store: StoreProvider;
|
|
319
|
+
/** Default logger name */
|
|
320
|
+
name?: string;
|
|
321
|
+
/** Minimum log level to record */
|
|
322
|
+
minLevel?: LogLevel;
|
|
323
|
+
/** Service/application name */
|
|
324
|
+
service?: string;
|
|
325
|
+
/** Environment name */
|
|
326
|
+
environment?: string;
|
|
327
|
+
/** Release/version string */
|
|
328
|
+
release?: string;
|
|
329
|
+
/** Enable session tracking */
|
|
330
|
+
enableSessions?: boolean;
|
|
331
|
+
/** Default metadata for all logs */
|
|
332
|
+
defaultMetadata?: Partial<LogMetadata>;
|
|
333
|
+
/** Format log message before storing */
|
|
334
|
+
formatMessage?: (message: string, ...args: unknown[]) => string;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Breadcrumb data structure (Sentry-compatible)
|
|
338
|
+
*/
|
|
339
|
+
export interface Breadcrumb {
|
|
340
|
+
/** Breadcrumb type (default, http, navigation, ui, etc.) */
|
|
341
|
+
type?: string;
|
|
342
|
+
/** Category for grouping (ui.click, api, navigation, console, etc.) */
|
|
343
|
+
category?: string;
|
|
344
|
+
/** Human-readable message */
|
|
345
|
+
message?: string;
|
|
346
|
+
/** Severity level */
|
|
347
|
+
level?: SeverityLevel;
|
|
348
|
+
/** Unix timestamp in seconds (Sentry format) */
|
|
349
|
+
timestamp?: number;
|
|
350
|
+
/** Additional structured data */
|
|
351
|
+
data?: Record<string, unknown>;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Capture context for exceptions and messages (Sentry-compatible)
|
|
355
|
+
*
|
|
356
|
+
* @remarks
|
|
357
|
+
* This matches Sentry's `CaptureContext` type for maximum compatibility.
|
|
358
|
+
* Use with `captureException()` and `captureMessage()`.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```typescript
|
|
362
|
+
* captureException(error, {
|
|
363
|
+
* tags: { section: 'checkout', userId: '123' },
|
|
364
|
+
* extra: { orderId: 'abc', amount: 99.99 },
|
|
365
|
+
* level: 'error',
|
|
366
|
+
* fingerprint: ['checkout', 'payment-failed'],
|
|
367
|
+
* });
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
export interface CaptureContext {
|
|
371
|
+
/** Tags for filtering and searching in Sentry */
|
|
372
|
+
tags?: Record<string, string>;
|
|
373
|
+
/** Extra data attached to the event */
|
|
374
|
+
extra?: Record<string, unknown>;
|
|
375
|
+
/** User context */
|
|
376
|
+
user?: UserInfo;
|
|
377
|
+
/** Severity level (overrides default) */
|
|
378
|
+
level?: SeverityLevel;
|
|
379
|
+
/** Custom fingerprint for error grouping */
|
|
380
|
+
fingerprint?: string[];
|
|
381
|
+
/** Named contexts (e.g., 'browser', 'os', 'device') */
|
|
382
|
+
contexts?: Record<string, Record<string, unknown>>;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Exception value for SentryEvent (Sentry-compatible)
|
|
386
|
+
*/
|
|
387
|
+
export interface ExceptionValue {
|
|
388
|
+
/** Exception type/class name */
|
|
389
|
+
type: string;
|
|
390
|
+
/** Exception message */
|
|
391
|
+
value: string;
|
|
392
|
+
/** Stack trace frames */
|
|
393
|
+
stacktrace?: {
|
|
394
|
+
frames: Array<{
|
|
395
|
+
filename?: string;
|
|
396
|
+
function?: string;
|
|
397
|
+
lineno?: number;
|
|
398
|
+
colno?: number;
|
|
399
|
+
in_app?: boolean;
|
|
400
|
+
}>;
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Raw Sentry event structure (Sentry-compatible)
|
|
405
|
+
*
|
|
406
|
+
* @remarks
|
|
407
|
+
* This is the low-level event format used by Sentry's captureEvent API.
|
|
408
|
+
* Use this for maximum control over event data.
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```typescript
|
|
412
|
+
* captureEvent({
|
|
413
|
+
* message: 'Manual event',
|
|
414
|
+
* level: 'info',
|
|
415
|
+
* tags: { source: 'manual' },
|
|
416
|
+
* extra: { customData: 'value' },
|
|
417
|
+
* });
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
export interface SentryEvent {
|
|
421
|
+
/** Unique event identifier (auto-generated if not provided) */
|
|
422
|
+
event_id?: string;
|
|
423
|
+
/** Event message */
|
|
424
|
+
message?: string;
|
|
425
|
+
/** Severity level */
|
|
426
|
+
level?: SeverityLevel;
|
|
427
|
+
/** Unix timestamp in seconds */
|
|
428
|
+
timestamp?: number;
|
|
429
|
+
/** Platform identifier (e.g., 'node', 'javascript') */
|
|
430
|
+
platform?: string;
|
|
431
|
+
/** Logger name/category */
|
|
432
|
+
logger?: string;
|
|
433
|
+
/** Server/host name */
|
|
434
|
+
server_name?: string;
|
|
435
|
+
/** Release/version string */
|
|
436
|
+
release?: string;
|
|
437
|
+
/** Environment name (production, staging, etc.) */
|
|
438
|
+
environment?: string;
|
|
439
|
+
/** Tags for filtering and searching */
|
|
440
|
+
tags?: Record<string, string>;
|
|
441
|
+
/** Extra data attached to the event */
|
|
442
|
+
extra?: Record<string, unknown>;
|
|
443
|
+
/** User context */
|
|
444
|
+
user?: UserInfo;
|
|
445
|
+
/** Named contexts (e.g., 'browser', 'os', 'device') */
|
|
446
|
+
contexts?: Record<string, Record<string, unknown>>;
|
|
447
|
+
/** Breadcrumb trail */
|
|
448
|
+
breadcrumbs?: Breadcrumb[];
|
|
449
|
+
/** Exception data */
|
|
450
|
+
exception?: {
|
|
451
|
+
values: ExceptionValue[];
|
|
452
|
+
};
|
|
453
|
+
/** Custom fingerprint for error grouping */
|
|
454
|
+
fingerprint?: string[];
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Transaction status values (Sentry-compatible)
|
|
458
|
+
*/
|
|
459
|
+
export type TransactionStatus = 'ok' | 'cancelled' | 'unknown' | 'invalid_argument' | 'deadline_exceeded' | 'not_found' | 'permission_denied' | 'internal_error';
|
|
460
|
+
/**
|
|
461
|
+
* Measurement data for performance metrics
|
|
462
|
+
*/
|
|
463
|
+
export interface Measurement {
|
|
464
|
+
/** The measurement value */
|
|
465
|
+
value: number;
|
|
466
|
+
/** Optional unit (e.g., 'millisecond', 'byte', 'percent') */
|
|
467
|
+
unit?: string;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Transaction interface for performance monitoring (Sentry-compatible)
|
|
471
|
+
*
|
|
472
|
+
* @remarks
|
|
473
|
+
* Transactions represent a unit of work, such as an HTTP request or a task.
|
|
474
|
+
* They can contain measurements and contextual data.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```typescript
|
|
478
|
+
* const transaction = startTransaction({ name: 'checkout', op: 'http.server' });
|
|
479
|
+
* transaction.setMeasurement('ttfb', 250, 'millisecond');
|
|
480
|
+
* // ... do work ...
|
|
481
|
+
* transaction.finish();
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
484
|
+
export interface Transaction {
|
|
485
|
+
/** Transaction name (e.g., 'checkout', '/api/users') */
|
|
486
|
+
name: string;
|
|
487
|
+
/** Operation type (e.g., 'http.server', 'db.query', 'task') */
|
|
488
|
+
op?: string;
|
|
489
|
+
/** Human-readable description */
|
|
490
|
+
description?: string;
|
|
491
|
+
/** Trace ID for distributed tracing (32 hex characters) */
|
|
492
|
+
traceId: string;
|
|
493
|
+
/** Span ID (16 hex characters) */
|
|
494
|
+
spanId: string;
|
|
495
|
+
/** Start timestamp in milliseconds since epoch */
|
|
496
|
+
startTimestamp: number;
|
|
497
|
+
/** End timestamp in milliseconds since epoch (set on finish) */
|
|
498
|
+
endTimestamp?: number;
|
|
499
|
+
/** Transaction status */
|
|
500
|
+
status?: TransactionStatus;
|
|
501
|
+
/** Tags for filtering */
|
|
502
|
+
tags?: Record<string, string>;
|
|
503
|
+
/** Arbitrary data */
|
|
504
|
+
data?: Record<string, unknown>;
|
|
505
|
+
/** Performance measurements */
|
|
506
|
+
measurements?: Record<string, Measurement>;
|
|
507
|
+
/**
|
|
508
|
+
* Set a tag on the transaction
|
|
509
|
+
* @param key - Tag key
|
|
510
|
+
* @param value - Tag value
|
|
511
|
+
*/
|
|
512
|
+
setTag(key: string, value: string): void;
|
|
513
|
+
/**
|
|
514
|
+
* Set arbitrary data on the transaction
|
|
515
|
+
* @param key - Data key
|
|
516
|
+
* @param value - Data value
|
|
517
|
+
*/
|
|
518
|
+
setData(key: string, value: unknown): void;
|
|
519
|
+
/**
|
|
520
|
+
* Set a performance measurement
|
|
521
|
+
* @param name - Measurement name (e.g., 'ttfb', 'fcp', 'memory')
|
|
522
|
+
* @param value - Measurement value
|
|
523
|
+
* @param unit - Optional unit (e.g., 'millisecond', 'byte')
|
|
524
|
+
*/
|
|
525
|
+
setMeasurement(name: string, value: number, unit?: string): void;
|
|
526
|
+
/**
|
|
527
|
+
* Set the transaction status
|
|
528
|
+
* @param status - Status value
|
|
529
|
+
*/
|
|
530
|
+
setStatus(status: TransactionStatus): void;
|
|
531
|
+
/**
|
|
532
|
+
* Finish the transaction and calculate duration
|
|
533
|
+
*/
|
|
534
|
+
finish(): void;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Context for starting a transaction
|
|
538
|
+
*/
|
|
539
|
+
export interface TransactionContext {
|
|
540
|
+
/** Transaction name */
|
|
541
|
+
name: string;
|
|
542
|
+
/** Operation type */
|
|
543
|
+
op?: string;
|
|
544
|
+
/** Description */
|
|
545
|
+
description?: string;
|
|
546
|
+
/** Initial tags */
|
|
547
|
+
tags?: Record<string, string>;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Hint object passed to beforeSend for exception events
|
|
551
|
+
*/
|
|
552
|
+
export interface BeforeSendHint {
|
|
553
|
+
/** The original exception that was captured */
|
|
554
|
+
originalException?: Error;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Hint object passed to beforeSendMessage for message events
|
|
558
|
+
*/
|
|
559
|
+
export interface BeforeSendMessageHint {
|
|
560
|
+
/** The original message that was captured */
|
|
561
|
+
originalMessage?: string;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Hook called before sending an exception event (Sentry-compatible)
|
|
565
|
+
*
|
|
566
|
+
* @param event - The log entry about to be stored
|
|
567
|
+
* @param hint - Additional context about the event
|
|
568
|
+
* @returns The modified event, or null to drop the event
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
* ```typescript
|
|
572
|
+
* await Sentry.init('memory', {
|
|
573
|
+
* beforeSend(event, hint) {
|
|
574
|
+
* // Filter out certain errors
|
|
575
|
+
* if (hint?.originalException?.message?.includes('ignore')) {
|
|
576
|
+
* return null;
|
|
577
|
+
* }
|
|
578
|
+
* // Modify event data
|
|
579
|
+
* event.metadata = { ...event.metadata, processed: true };
|
|
580
|
+
* return event;
|
|
581
|
+
* },
|
|
582
|
+
* });
|
|
583
|
+
* ```
|
|
584
|
+
*/
|
|
585
|
+
export type BeforeSendHook = (event: LogEntry, hint?: BeforeSendHint) => LogEntry | null;
|
|
586
|
+
/**
|
|
587
|
+
* Hook called before sending a message event (Sentry-compatible)
|
|
588
|
+
*
|
|
589
|
+
* @param event - The log entry about to be stored
|
|
590
|
+
* @param hint - Additional context about the event
|
|
591
|
+
* @returns The modified event, or null to drop the event
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```typescript
|
|
595
|
+
* await Sentry.init('memory', {
|
|
596
|
+
* beforeSendMessage(event, hint) {
|
|
597
|
+
* // Filter out sensitive messages
|
|
598
|
+
* if (event.message?.includes('password')) {
|
|
599
|
+
* return null;
|
|
600
|
+
* }
|
|
601
|
+
* return event;
|
|
602
|
+
* },
|
|
603
|
+
* });
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
606
|
+
export type BeforeSendMessageHook = (event: LogEntry, hint?: BeforeSendMessageHint) => LogEntry | null;
|
|
607
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,aAA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MAAM,MAAM,cAAc,GAAG,CAC3B,KAAK,EAAE,QAAQ,EACf,IAAI,CAAC,EAAE,cAAc,KAClB,QAAQ,GAAG,IAAI,CAAC;AAErB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,KAAK,EAAE,QAAQ,EACf,IAAI,CAAC,EAAE,qBAAqB,KACzB,QAAQ,GAAG,IAAI,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for NodeLogger
|
|
3
|
+
*
|
|
4
|
+
* @module types
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Numeric values for log levels (lower = more severe)
|
|
9
|
+
*/
|
|
10
|
+
export const LogLevelValue = {
|
|
11
|
+
fatal: 0,
|
|
12
|
+
error: 1,
|
|
13
|
+
warn: 2,
|
|
14
|
+
info: 3,
|
|
15
|
+
debug: 4,
|
|
16
|
+
trace: 5,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAA6B;IACrD,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACT,CAAC"}
|