@sentienguard/apm 1.0.7 → 1.0.8
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/package.json +3 -1
- package/src/index.d.ts +102 -0
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentienguard/apm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "SentienGuard APM SDK - Minimal, production-safe application performance monitoring",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
+
"types": "src/index.d.ts",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"browser": "./src/browser.js",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
10
12
|
"browser": "./src/browser.js",
|
|
11
13
|
"default": "./src/index.js"
|
|
12
14
|
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SentienGuard APM SDK TypeScript Declarations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Configuration types
|
|
6
|
+
export interface ApmConfig {
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
service?: string;
|
|
9
|
+
environment?: string;
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
flushInterval?: number;
|
|
12
|
+
maxRoutes?: number;
|
|
13
|
+
maxPayloadSize?: number;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface BrowserApmConfig {
|
|
19
|
+
apiKey: string;
|
|
20
|
+
service: string;
|
|
21
|
+
endpoint?: string;
|
|
22
|
+
environment?: string;
|
|
23
|
+
flushInterval?: number;
|
|
24
|
+
debug?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ApmStatus {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
initialized: boolean;
|
|
30
|
+
config: {
|
|
31
|
+
service: string;
|
|
32
|
+
environment: string;
|
|
33
|
+
flushInterval: number;
|
|
34
|
+
};
|
|
35
|
+
stats: {
|
|
36
|
+
requestMetrics?: number;
|
|
37
|
+
dependencyMetrics?: number;
|
|
38
|
+
webVitals?: number;
|
|
39
|
+
jsErrors?: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Core functions
|
|
44
|
+
export function initialize(options?: BrowserApmConfig): void;
|
|
45
|
+
export function init(options?: BrowserApmConfig): void;
|
|
46
|
+
export function shutdown(): Promise<void>;
|
|
47
|
+
export function getStatus(): ApmStatus;
|
|
48
|
+
export function flush(): Promise<void>;
|
|
49
|
+
export function getConfig(): ApmConfig;
|
|
50
|
+
export function isEnabled(): boolean;
|
|
51
|
+
|
|
52
|
+
// Express middleware (no-ops in browser)
|
|
53
|
+
export function expressMiddleware(): (req: any, res: any, next: any) => void;
|
|
54
|
+
export function expressErrorMiddleware(): (err: any, req: any, res: any, next: any) => void;
|
|
55
|
+
|
|
56
|
+
// Fastify plugin (no-ops in browser)
|
|
57
|
+
export function fastifyPlugin(): any;
|
|
58
|
+
export function fastifyErrorHandler(): any;
|
|
59
|
+
|
|
60
|
+
// Route utilities (no-ops in browser)
|
|
61
|
+
export function normalizeRoute(route: string): string;
|
|
62
|
+
export function extractRoute(req: any): string;
|
|
63
|
+
export const RouteRegistry: any;
|
|
64
|
+
|
|
65
|
+
// Aggregator
|
|
66
|
+
export function getAggregator(): any;
|
|
67
|
+
|
|
68
|
+
// MongoDB instrumentation (no-ops in browser)
|
|
69
|
+
export function instrumentMongoDB(): void;
|
|
70
|
+
|
|
71
|
+
// OpenAI instrumentation (no-ops in browser)
|
|
72
|
+
export function instrumentOpenAI(): void;
|
|
73
|
+
|
|
74
|
+
// Circuit breaker (no-ops in browser)
|
|
75
|
+
export function createBreaker(fn: any): any;
|
|
76
|
+
export function wrapMongoOperation(fn: any): any;
|
|
77
|
+
export function getBreakerStats(): any;
|
|
78
|
+
|
|
79
|
+
// Default export
|
|
80
|
+
declare const SentienGuard: {
|
|
81
|
+
init: typeof init;
|
|
82
|
+
initialize: typeof initialize;
|
|
83
|
+
shutdown: typeof shutdown;
|
|
84
|
+
getStatus: typeof getStatus;
|
|
85
|
+
flush: typeof flush;
|
|
86
|
+
getConfig: typeof getConfig;
|
|
87
|
+
isEnabled: typeof isEnabled;
|
|
88
|
+
getAggregator: typeof getAggregator;
|
|
89
|
+
expressMiddleware: typeof expressMiddleware;
|
|
90
|
+
expressErrorMiddleware: typeof expressErrorMiddleware;
|
|
91
|
+
fastifyPlugin: typeof fastifyPlugin;
|
|
92
|
+
fastifyErrorHandler: typeof fastifyErrorHandler;
|
|
93
|
+
normalizeRoute: typeof normalizeRoute;
|
|
94
|
+
extractRoute: typeof extractRoute;
|
|
95
|
+
instrumentMongoDB: typeof instrumentMongoDB;
|
|
96
|
+
instrumentOpenAI: typeof instrumentOpenAI;
|
|
97
|
+
createBreaker: typeof createBreaker;
|
|
98
|
+
wrapMongoOperation: typeof wrapMongoOperation;
|
|
99
|
+
getBreakerStats: typeof getBreakerStats;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default SentienGuard;
|