reportli 1.0.3 → 1.0.4
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/dist/index.d.ts +77 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +642 -305
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +642 -313
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
- package/src/index.ts +735 -366
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// src/index.ts \u2014 Reportli SDK v1.0.3\n\nconst ENDPOINT =\n \"https://fahikyfmgdyzejdfftox.supabase.co/functions/v1/rapid-processor\";\n\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ntype Config = {\n apiKey: string;\n environment?: string;\n};\n\ntype QueueItem = Record<string, unknown>;\n\n// \u2500\u2500\u2500 State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet initialized = false;\nlet _config: Config;\nconst queue: QueueItem[] = [];\nlet flushTimer: ReturnType<typeof setTimeout> | null = null;\nlet isFlushing = false;\n\n// \u2500\u2500\u2500 Queue & Batch Send \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction scheduleFlush() {\n if (flushTimer) return;\n flushTimer = setTimeout(() => {\n flushTimer = null;\n flush();\n }, 2000); // batch every 2 seconds\n}\n\nasync function flush() {\n if (isFlushing || queue.length === 0) return;\n isFlushing = true;\n\n const batch = queue.splice(0, 10); // send max 10 at a time\n\n for (const payload of batch) {\n await sendNow(payload);\n }\n\n isFlushing = false;\n\n if (queue.length > 0) flush(); // flush remaining\n}\n\nasync function sendNow(payload: QueueItem, attempts = 3): Promise<void> {\n for (let i = 0; i < attempts; i++) {\n try {\n const res = await fetch(ENDPOINT, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": _config?.apiKey ?? \"\",\n },\n body: JSON.stringify(payload),\n });\n if (res.ok) return; // success \u2014 stop retrying\n } catch {\n // network error \u2014 wait before retry\n }\n await sleep(1000 * (i + 1)); // 1s, 2s, 3s\n }\n // give up silently after 3 attempts \u2014 never crash user app\n}\n\nfunction sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n// \u2500\u2500\u2500 Enqueue \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction enqueue(payload: QueueItem) {\n if (queue.length >= 100) return; // cap queue to prevent memory issues\n queue.push(payload);\n scheduleFlush();\n}\n\n// \u2500\u2500\u2500 Send immediately (for critical messages) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction sendImmediate(payload: QueueItem) {\n sendNow(payload).catch(() => {}); // fire and forget\n}\n\n// \u2500\u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getUrl(): string {\n if (typeof window !== \"undefined\") return window.location.href;\n try { return require(\"os\").hostname(); } catch { return \"server\"; }\n}\n\nfunction getBrowser(): string {\n if (typeof navigator !== \"undefined\") return navigator.userAgent;\n return `Node.js ${typeof process !== \"undefined\" ? process.version : \"unknown\"}`;\n}\n\nfunction getEnvironment(): string {\n return _config?.environment ?? (typeof window !== \"undefined\" ? \"browser\" : \"server\");\n}\n\nfunction parseStack(stack: string | undefined): { file: string; line: number; column: number } {\n if (!stack) return { file: \"unknown\", line: 0, column: 0 };\n const match =\n stack.match(/at .+ \\((.+):(\\d+):(\\d+)\\)/) ||\n stack.match(/at (.+):(\\d+):(\\d+)/);\n return {\n file: match?.[1]?.split(\"/\")?.pop() || \"unknown\",\n line: parseInt(match?.[2] || \"0\"),\n column: parseInt(match?.[3] || \"0\"),\n };\n}\n\nfunction getErrorCode(error: any): string {\n return (\n error?.code ||\n error?.status?.toString() ||\n error?.statusCode?.toString() ||\n error?.name ||\n \"ERR_UNKNOWN\"\n );\n}\n\nfunction classifyError(error: any, context?: string): { category: string; severity: \"low\" | \"medium\" | \"high\" | \"critical\" } {\n const msg = String(error?.message || error || \"\").toLowerCase();\n const name = String(error?.name || \"\").toLowerCase();\n\n // Payment \u2014 always critical\n if (msg.includes(\"stripe\") || msg.includes(\"payment\") || msg.includes(\"card declined\") || msg.includes(\"checkout\") || msg.includes(\"refund\"))\n return { category: \"Payment Error\", severity: \"critical\" };\n\n // Auth\n if (msg.includes(\"jwt\") || msg.includes(\"token expired\") || msg.includes(\"unauthorized\") || msg.includes(\"session\") || msg.includes(\"oauth\") || msg.includes(\"login failed\"))\n return { category: \"Auth Error\", severity: \"high\" };\n\n // Database\n if (msg.includes(\"supabase\") || msg.includes(\"database\") || msg.includes(\"query\") || msg.includes(\"connection lost\") || msg.includes(\"transaction\") || msg.includes(\"duplicate key\") || msg.includes(\"foreign key\"))\n return { category: \"Database Error\", severity: \"critical\" };\n\n // React/Next.js\n if (msg.includes(\"hydration\") || msg.includes(\"does not match server\"))\n return { category: \"Hydration Error\", severity: \"high\" };\n if (msg.includes(\"invalid hook\") || msg.includes(\"rules of hooks\"))\n return { category: \"Hook Error\", severity: \"critical\" };\n if (msg.includes(\"render\") || msg.includes(\"error boundary\"))\n return { category: \"Render Error\", severity: \"critical\" };\n if (msg.includes(\"dynamic import\") || msg.includes(\"failed to fetch dynamically\"))\n return { category: \"Import Error\", severity: \"high\" };\n\n // Network\n if (msg.includes(\"cors\") || msg.includes(\"cross-origin\"))\n return { category: \"CORS Error\", severity: \"high\" };\n if (msg.includes(\"fetch failed\") || msg.includes(\"failed to fetch\") || name === \"fetcherror\")\n return { category: \"Network Error\", severity: \"high\" };\n if (msg.includes(\"timeout\") || msg.includes(\"timed out\") || msg.includes(\"etimedout\"))\n return { category: \"Timeout Error\", severity: \"medium\" };\n if (msg.includes(\"websocket\"))\n return { category: \"WebSocket Error\", severity: \"high\" };\n\n // HTTP status codes\n if (msg.includes(\"http 401\") || msg.includes(\"xhr 401\"))\n return { category: \"Auth Error\", severity: \"high\" };\n if (msg.includes(\"http 403\") || msg.includes(\"xhr 403\"))\n return { category: \"Auth Error\", severity: \"high\" };\n if (msg.includes(\"http 404\") || msg.includes(\"xhr 404\"))\n return { category: \"Not Found Error\", severity: \"medium\" };\n if (msg.includes(\"http 500\") || msg.includes(\"xhr 500\"))\n return { category: \"Server Error\", severity: \"critical\" };\n if (msg.includes(\"http 503\") || msg.includes(\"xhr 503\"))\n return { category: \"Server Error\", severity: \"critical\" };\n\n // Memory\n if (msg.includes(\"maximum call stack\") || msg.includes(\"out of memory\") || msg.includes(\"heap limit\"))\n return { category: \"Memory Error\", severity: \"critical\" };\n\n // Server\n if (msg.includes(\"cannot find module\") || msg.includes(\"module not found\"))\n return { category: \"Module Error\", severity: \"critical\" };\n if (msg.includes(\"econnrefused\") || msg.includes(\"connection refused\"))\n return { category: \"Connection Error\", severity: \"critical\" };\n\n // Email & Jobs\n if (msg.includes(\"email\") || msg.includes(\"smtp\") || msg.includes(\"sendgrid\"))\n return { category: \"Email Error\", severity: \"high\" };\n if (msg.includes(\"cron\") || msg.includes(\"webhook\") || msg.includes(\"queue\"))\n return { category: \"Job Error\", severity: \"high\" };\n\n // Files\n if (msg.includes(\"upload\") || msg.includes(\"file size\") || msg.includes(\"invalid file\"))\n return { category: \"File Error\", severity: \"medium\" };\n\n // Storage\n if (msg.includes(\"quota exceeded\") || msg.includes(\"localstorage\") || msg.includes(\"indexeddb\"))\n return { category: \"Storage Error\", severity: \"medium\" };\n\n // JS core\n if (name === \"typeerror\") return { category: \"TypeError\", severity: \"high\" };\n if (name === \"referenceerror\") return { category: \"ReferenceError\", severity: \"critical\" };\n if (name === \"rangeerror\") return { category: \"RangeError\", severity: \"high\" };\n if (name === \"syntaxerror\") return { category: \"SyntaxError\", severity: \"high\" };\n\n // Context based\n if (context === \"unhandledrejection\") return { category: \"Promise Error\", severity: \"medium\" };\n if (context === \"express\") return { category: \"Server Error\", severity: \"high\" };\n if (context === \"resource\") return { category: \"Resource Error\", severity: \"low\" };\n\n return { category: \"Unknown Error\", severity: \"medium\" };\n}\n\nfunction buildErrorPayload(error: any, context?: string): QueueItem {\n const message = error?.message || String(error) || \"Unknown error\";\n const stack = error?.stack || \"\";\n const { file, line, column } = parseStack(stack);\n const { category, severity } = classifyError(error, context);\n\n return {\n type: \"ERROR\",\n apiKey: _config?.apiKey,\n message,\n code: getErrorCode(error),\n stack,\n file,\n line,\n column,\n url: getUrl(),\n timestamp: new Date().toISOString(),\n environment: getEnvironment(),\n browser: getBrowser(),\n error_category: category,\n severity,\n status: \"open\",\n context: context || \"auto\",\n };\n}\n\n// \u2500\u2500\u2500 Browser Listeners \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction activateBrowserListeners() {\n // JS errors + resource errors\n window.addEventListener(\"error\", (event) => {\n // Resource load error (img, script, link, video)\n const target = event.target as HTMLElement;\n if (target && target.tagName && [\"IMG\", \"SCRIPT\", \"LINK\", \"VIDEO\", \"AUDIO\"].includes(target.tagName)) {\n const src = (target as any).src || (target as any).href || \"unknown\";\n enqueue(buildErrorPayload({ name: \"ResourceError\", message: `${target.tagName} failed to load: ${src}`, stack: \"\" }, \"resource\"));\n return;\n }\n\n const err = (event as ErrorEvent).error || {\n name: \"Error\",\n message: (event as ErrorEvent).message,\n stack: `at ${(event as ErrorEvent).filename}:${(event as ErrorEvent).lineno}:${(event as ErrorEvent).colno}`,\n };\n enqueue(buildErrorPayload(err, \"window\"));\n }, true);\n\n // Unhandled promise rejections\n window.addEventListener(\"unhandledrejection\", (event) => {\n const err = event.reason instanceof Error\n ? event.reason\n : { name: \"UnhandledRejection\", message: String(event.reason || \"Unhandled Promise Rejection\"), stack: \"\" };\n enqueue(buildErrorPayload(err, \"unhandledrejection\"));\n });\n\n // Intercept fetch \u2014 catches all API errors automatically\n const originalFetch = window.fetch;\n window.fetch = async function (...args: Parameters<typeof fetch>): Promise<Response> {\n const url = typeof args[0] === \"string\"\n ? args[0]\n : args[0] instanceof URL\n ? args[0].toString()\n : (args[0] as Request)?.url ?? \"\";\n\n // Never intercept our own requests\n if (url.includes(\"rapid-processor\")) return originalFetch(...args);\n\n try {\n const response = await originalFetch(...args);\n if (!response.ok) {\n enqueue(buildErrorPayload({\n name: `HTTP_${response.status}`,\n message: `HTTP ${response.status}: ${(args[1] as RequestInit)?.method || \"GET\"} ${url}`,\n stack: `${(args[1] as RequestInit)?.method || \"GET\"} ${url} \u2192 ${response.status} ${response.statusText}`,\n status: response.status,\n }, \"fetch\"));\n }\n return response;\n } catch (err: any) {\n enqueue(buildErrorPayload({\n name: \"FetchError\",\n message: `Fetch failed: ${(args[1] as RequestInit)?.method || \"GET\"} ${url} \u2014 ${err.message}`,\n stack: err.stack,\n }, \"fetch\"));\n throw err;\n }\n };\n\n // Intercept XHR\n const originalOpen = XMLHttpRequest.prototype.open;\n const originalSend = XMLHttpRequest.prototype.send;\n\n XMLHttpRequest.prototype.open = function (method: string, url: string, ...rest: any[]) {\n (this as any)._r_method = method;\n (this as any)._r_url = url;\n return originalOpen.call(this, method, url, ...rest);\n } as any;\n\n XMLHttpRequest.prototype.send = function (...args: any[]) {\n const url: string = (this as any)._r_url || \"\";\n const method: string = (this as any)._r_method || \"GET\";\n\n if (!url.includes(\"rapid-processor\")) {\n this.addEventListener(\"loadend\", () => {\n if (this.status >= 400 || this.status === 0) {\n enqueue(buildErrorPayload({\n name: `XHR_${this.status}`,\n message: `XHR ${this.status}: ${method} ${url}`,\n stack: `${method} ${url} \u2192 ${this.status} ${this.statusText}`,\n status: this.status,\n }, \"xhr\"));\n }\n });\n }\n\n return originalSend.apply(this, args);\n } as any;\n\n // Disconnect when page closes\n window.addEventListener(\"beforeunload\", () => {\n try {\n navigator.sendBeacon(\n ENDPOINT,\n JSON.stringify({\n type: \"SDK_DISCONNECTED\",\n apiKey: _config?.apiKey,\n timestamp: new Date().toISOString(),\n environment: getEnvironment(),\n url: getUrl(),\n })\n );\n } catch { /* silent */ }\n });\n}\n\n// \u2500\u2500\u2500 Server Listeners \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction activateServerListeners() {\n process.on(\"uncaughtException\", (error: Error) => {\n enqueue(buildErrorPayload(error, \"uncaughtException\"));\n flush(); // flush immediately on crash\n });\n\n process.on(\"unhandledRejection\", (reason: any) => {\n enqueue(buildErrorPayload(\n reason instanceof Error ? reason : { name: \"UnhandledRejection\", message: String(reason), stack: \"\" },\n \"unhandledrejection\"\n ));\n });\n\n const shutdown = async (signal: string) => {\n await sendNow({\n type: \"SDK_DISCONNECTED\",\n apiKey: _config?.apiKey,\n timestamp: new Date().toISOString(),\n environment: getEnvironment(),\n url: getUrl(),\n signal,\n });\n process.exit(0);\n };\n\n process.on(\"SIGTERM\", () => shutdown(\"SIGTERM\"));\n process.on(\"SIGINT\", () => shutdown(\"SIGINT\"));\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const Reportli = {\n init(cfg: Config) {\n if (initialized) return;\n if (!cfg?.apiKey) return;\n\n _config = cfg;\n initialized = true;\n\n // Send SDK_INITIALIZED immediately \u2014 not queued\n sendImmediate({\n type: \"SDK_INITIALIZED\",\n apiKey: cfg.apiKey,\n timestamp: new Date().toISOString(),\n environment: getEnvironment(),\n url: getUrl(),\n browser: getBrowser(),\n });\n\n // Activate listeners\n if (typeof window !== \"undefined\") {\n activateBrowserListeners();\n } else if (typeof process !== \"undefined\" && process.versions?.node) {\n activateServerListeners();\n }\n },\n\n capture(error: unknown) {\n if (!initialized) return;\n const err = error instanceof Error\n ? error\n : { name: \"ManualCapture\", message: String(error), stack: new Error().stack };\n enqueue(buildErrorPayload(err, \"manual\"));\n },\n\n captureMessage(message: string) {\n if (!initialized) return;\n enqueue(buildErrorPayload({ name: \"Message\", message, stack: \"\" }, \"manual\"));\n },\n\n errorHandler() {\n return function (err: any, _req: any, _res: any, next: any) {\n enqueue(buildErrorPayload(err, \"express\"));\n next(err);\n };\n },\n};\n\nexport default Reportli;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAM,WACJ;AAaF,IAAI,cAAc;AAClB,IAAI;AACJ,IAAM,QAAqB,CAAC;AAC5B,IAAI,aAAmD;AACvD,IAAI,aAAa;AAIjB,SAAS,gBAAgB;AACvB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K,GAAG,OAAO,IAAI,MAAM,EAAE,MAAM;AAC9E,YAAQ,kBAAkB,KAAK,QAAQ,CAAC;AAAA,EAC1C;AAAA,EAEA,eAAe,SAAiB;AAC9B,QAAI,CAAC;AAAa;AAClB,YAAQ,kBAAkB,EAAE,MAAM,WAAW,SAAS,OAAO,GAAG,GAAG,QAAQ,CAAC;AAAA,EAC9E;AAAA,EAEA,eAAe;AACb,WAAO,SAAU,KAAU,MAAW,MAAW,MAAW;AAC1D,cAAQ,kBAAkB,KAAK,SAAS,CAAC;AACzC,WAAK,GAAG;AAAA,IACV;AAAA,EACF;AACF;AAEA,IAAO,cAAQ;",
|
|
4
|
+
"sourcesContent": ["/**\n * Reportli SDK\n * Enterprise-grade real-time exception tracking and AI diagnostic companion.\n */\n\nexport interface ReportliConfig {\n apiKey: string;\n projectId?: string;\n projectName?: string;\n environment?: string;\n framework?: string;\n disableHmrLogging?: boolean;\n captureUnhandledRejections?: boolean;\n autoCreateGitHubIssues?: boolean;\n userEmail?: string;\n endpoint?: string;\n}\n\nexport interface ExceptionPayload {\n apiKey: string;\n projectId?: string;\n projectName?: string;\n errorType: string;\n errorMessage: string;\n errorStack: string;\n framework?: string;\n user_email?: string;\n severity?: \"low\" | \"medium\" | \"high\" | \"critical\";\n status?: string;\n}\n\nconst isBrowser = typeof window !== \"undefined\";\n\nconst REPORTLI_BASE_URL = \"https://ais-dev-ohcojup63zslqou25sisle-541405064838.asia-east1.run.app\";\n\nclass ReportliTracker {\n private config: ReportliConfig | null = null;\n private isInitialized = false;\n\n /**\n * Initializes the Reportli tracker with your secure project credentials.\n */\n public init(config: ReportliConfig): void {\n if (!config || !config.apiKey) {\n console.error(\"[Reportli SDK] Initialization failed: 'apiKey' is required.\");\n return;\n }\n\n if (this.isInitialized) {\n return; // Already active in thread\n }\n\n this.config = {\n environment: \"production\",\n captureUnhandledRejections: true,\n autoCreateGitHubIssues: true,\n ...config,\n };\n this.isInitialized = true;\n\n const isBrowser = typeof window !== \"undefined\";\n const isNode = typeof process !== \"undefined\" && process.versions && process.versions.node;\n\n // A static flag to prevent multiple registration sends per runtime instance\n if ((ReportliTracker as any)._registrationSent) {\n return;\n }\n\n // 1. Send the installation/setup success message on initial setup block\n this.sendRegistrationWebhook(isBrowser);\n (ReportliTracker as any)._registrationSent = true;\n\n // 2. Setup standard listeners\n if (isBrowser) {\n this.setupBrowserListeners();\n } else if (isNode) {\n this.setupNodeListeners();\n }\n\n console.log(\"[Reportli SDK] Exception listener successfully initialized.\");\n }\n\n /**\n * Manually captures and files a custom application exception with custom severity.\n */\n public captureException(error: Error | any, severityInput?: \"low\" | \"medium\" | \"high\" | \"critical\"): void {\n if (!this.isInitialized || !this.config) {\n console.warn(\"[Reportli SDK] Capture failed: SDK is not initialized yet.\");\n return;\n }\n\n const errorObject = this.normalizeError(error);\n const { errorType, severity } = this.classifyError(errorObject);\n\n const payload: ExceptionPayload = {\n apiKey: this.config.apiKey,\n projectId: this.config.projectId || \"proj-sandbox\",\n projectName: this.config.projectName || \"SaaS App\",\n errorType: errorType,\n errorMessage: errorObject.message || \"Manual trace reported\",\n errorStack: errorObject.stack || \"\",\n framework: this.config.framework || (typeof window !== \"undefined\" ? \"React/Next.js Client\" : \"Node.js Server\"),\n user_email: this.config.userEmail || \"anonymous\",\n severity: severityInput || severity,\n status: \"open\"\n };\n\n this.sendCrashReport(payload);\n }\n\n /**\n * Express error handler middleware\n */\n public expressErrorHandler = (err: any, req: any, res: any, next: any): void => {\n if (this.isInitialized && this.config) {\n try {\n const errorObject = this.normalizeError(err);\n const { errorType, severity } = this.classifyError(errorObject, \"express\");\n\n const payload: ExceptionPayload = {\n apiKey: this.config.apiKey,\n projectId: this.config.projectId || \"express-server\",\n projectName: this.config.projectName || \"Express App\",\n errorType: errorType || \"Route handler error\",\n errorMessage: `${req.method} ${req.url} - ${errorObject.message}`,\n errorStack: errorObject.stack || \"\",\n framework: this.config.framework || \"Express\",\n user_email: this.config.userEmail || req.user?.email || \"anonymous\",\n severity: severity || \"high\",\n status: \"open\"\n };\n\n this.sendCrashReport(payload);\n } catch (e) {\n console.error(\"[Reportli SDK] Failed to process express exception:\", e);\n }\n }\n next(err);\n };\n\n /**\n * Registers global window listeners for DOM-based exceptions.\n */\n private setupBrowserListeners(): void {\n if (typeof window === \"undefined\") return;\n\n // A. Uncaught JavaScript Runtime Crashes\n window.addEventListener(\"error\", (event) => {\n // Prevent loop tracing reportli requests\n if (event.filename && event.filename.includes(\"rapid-processor\")) return;\n\n try {\n const error = event.error || {\n message: event.message,\n filename: event.filename,\n lineno: event.lineno,\n colno: event.colno,\n stack: `${event.message} at ${event.filename}:${event.lineno}:${event.colno}`,\n };\n\n const errorObject = this.normalizeError(error);\n const { errorType, severity } = this.classifyError(errorObject);\n\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"proj-sandbox\",\n projectName: this.config?.projectName || \"SaaS App\",\n errorType: errorType,\n errorMessage: errorObject.message,\n errorStack: errorObject.stack || \"\",\n framework: this.config?.framework || \"React/Next.js Client\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: severity,\n status: \"open\",\n };\n\n this.sendCrashReport(payload);\n } catch (err) {\n console.error(\"[Reportli SDK] Inner listener exception:\", err);\n }\n });\n\n // B. Unhandled Promise Rejections (e.g. async/await loops)\n window.addEventListener(\"unhandledrejection\", (event) => {\n try {\n const reason = event.reason;\n const errorObject = this.normalizeError(reason);\n const { errorType, severity } = this.classifyError(errorObject, \"unhandledrejection\");\n\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"proj-sandbox\",\n projectName: this.config?.projectName || \"SaaS App\",\n errorType: errorType,\n errorMessage: `Unhandled Promise: ${errorObject.message}`,\n errorStack: errorObject.stack || \"\",\n framework: this.config?.framework || \"React/Next.js Client\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: severity,\n status: \"open\",\n };\n\n this.sendCrashReport(payload);\n } catch (err) {\n console.error(\"[Reportli SDK] Promise rejection listener exception:\", err);\n }\n });\n\n // C. Resource loading errors (capture phase for elements failing to load)\n window.addEventListener(\n \"error\",\n (event) => {\n try {\n const target = event.target || event.srcElement;\n if (!target) return;\n\n const tagName = (target as HTMLElement).tagName;\n if (!tagName) return;\n\n let resourceType = \"\";\n let sourceUrl = \"\";\n\n if (tagName === \"IMG\") {\n resourceType = \"Image failed to load\";\n sourceUrl = (target as HTMLImageElement).src;\n } else if (tagName === \"SCRIPT\") {\n resourceType = \"Script failed to load\";\n sourceUrl = (target as HTMLScriptElement).src;\n } else if (tagName === \"LINK\") {\n resourceType = \"CSS failed to load\";\n sourceUrl = (target as HTMLLinkElement).href;\n } else if (tagName === \"VIDEO\" || tagName === \"AUDIO\") {\n resourceType = \"Video failed to load\";\n sourceUrl = (target as HTMLVideoElement).src;\n }\n\n if (resourceType) {\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"proj-sandbox\",\n projectName: this.config?.projectName || \"SaaS App\",\n errorType: resourceType,\n errorMessage: `Failed to load static resource asset: ${sourceUrl}`,\n errorStack: `HTML Tag: <${tagName.toLowerCase()}> failed to download at location ${window.location.href}`,\n framework: this.config?.framework || \"React/Next.js Client\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: \"low\",\n status: \"open\",\n };\n this.sendCrashReport(payload);\n }\n } catch (err) {\n console.error(\"[Reportli SDK] Resource load listener failure:\", err);\n }\n },\n true // capture phase is required for element errors\n );\n\n // D. Network Fetch Interceptors (Monkey patch global fetch to trace bad status codes)\n this.interceptFetch();\n this.interceptXhr();\n }\n\n /**\n * Registers node process listeners for server instances.\n */\n private setupNodeListeners(): void {\n if (typeof process === \"undefined\") return;\n\n process.on(\"uncaughtException\", (error) => {\n try {\n const errorObject = this.normalizeError(error);\n const { errorType, severity } = this.classifyError(errorObject, \"uncaughtexception\");\n\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"node-server\",\n projectName: this.config?.projectName || \"Node Server\",\n errorType: errorType,\n errorMessage: `Uncaught Exception: ${errorObject.message}`,\n errorStack: errorObject.stack || \"\",\n framework: this.config?.framework || \"NodeJS backend\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: severity,\n status: \"open\",\n };\n\n // Send-sync block\n this.sendCrashReport(payload);\n } catch (err) {\n console.error(\"[Reportli SDK] Node fatal uncaughtexception logging failed:\", err);\n }\n });\n\n process.on(\"unhandledRejection\", (reason) => {\n try {\n const errorObject = this.normalizeError(reason);\n const { errorType, severity } = this.classifyError(errorObject, \"unhandledrejection\");\n\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"node-server\",\n projectName: this.config?.projectName || \"Node Server\",\n errorType: errorType,\n errorMessage: `Unhandled Rejection: ${errorObject.message}`,\n errorStack: errorObject.stack || \"\",\n framework: this.config?.framework || \"NodeJS backend\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: severity,\n status: \"open\",\n };\n\n this.sendCrashReport(payload);\n } catch (err) {\n console.error(\"[Reportli SDK] Node fatal unhandledrejection logging failed:\", err);\n }\n });\n }\n\n /**\n * Safe payload sender with retry limits.\n */\n private async sendCrashReport(payload: ExceptionPayload): Promise<void> {\n try {\n // Avoid looping report-sends\n if (payload.errorMessage && (payload.errorMessage.includes(\"rapid-processor\") || payload.errorMessage.includes(\"api/error\") || payload.errorMessage.includes(\"supabase\"))) {\n return;\n }\n\n // Default to the Reportli Production Server for NPM users\n let destinationUrl = this.config?.endpoint || `${REPORTLI_BASE_URL}/api/error`;\n \n const response = await fetch(destinationUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": this.config?.apiKey || \"\"\n },\n body: JSON.stringify(payload),\n });\n } catch (err) {\n // Fail silently to prevent user software crash\n console.warn(\"[Reportli SDK] Failed to synchronize crash traces to diagnostics server:\", err);\n }\n }\n\n /**\n * Sends registration verification to user edge function on first install.\n */\n private sendRegistrationWebhook(isBrowser: boolean): void {\n if (!this.config) return;\n\n const key = `reportli_initialized_success_${this.config.apiKey}`;\n if (isBrowser && typeof localStorage !== \"undefined\") {\n if (localStorage.getItem(key)) {\n return; // Already verified registration autrefois\n }\n localStorage.setItem(key, \"true\");\n }\n\n const deviceDetails = isBrowser\n ? typeof navigator !== \"undefined\" ? navigator.userAgent : \"Browser sandbox\"\n : typeof process !== \"undefined\" ? `NodeJS environment: ${process.version}` : \"Cloud instance\";\n\n const welcomePayload: ExceptionPayload = {\n apiKey: this.config.apiKey,\n projectId: this.config.projectId || \"proj-sandbox\",\n projectName: this.config.projectName || \"SaaS App Component\",\n errorType: \"SDK_INITIALIZED\",\n errorMessage: \"Reportli SDK successfully initialized! Error listener is active.\",\n errorStack: `SDK Active Diagnostics: Success registration from execution agent. Device context: ${deviceDetails}`,\n framework: this.config.framework || (isBrowser ? \"React/Next.js Client\" : \"Node.js Server\"),\n user_email: this.config.userEmail || \"anonymous\",\n severity: \"low\",\n status: \"info\"\n };\n\n this.sendCrashReport(welcomePayload);\n }\n\n /**\n * Capture fetch network status deviations.\n */\n private interceptFetch(): void {\n if (typeof window === \"undefined\" || typeof window.fetch !== \"function\") return;\n\n const originalFetch = window.fetch;\n const self = this;\n\n window.fetch = async function (input: RequestInfo | URL, init?: RequestInit): Promise<Response> {\n const url = typeof input === \"string\" ? input : (input instanceof URL ? input.toString() : input.url);\n \n // Skip tracking of reportli's own API calls to avoid circular logging loop\n if (url.includes(\"rapid-processor\") || url.includes(\"api/error\") || url.includes(\"supabase.co/functions\")) {\n return originalFetch.apply(this, arguments as any);\n }\n\n try {\n const response = await originalFetch.apply(this, arguments as any);\n if (response && !response.ok) {\n self.logNetworkError(url, response.status, response.statusText, init?.method || \"GET\");\n }\n return response;\n } catch (err: any) {\n // Fetch throwing means CORS, connection refused, dns failures or timeout aborts\n self.logNetworkFailure(url, err, init?.method || \"GET\");\n throw err;\n }\n };\n }\n\n /**\n * Trace XHR status failures.\n */\n private interceptXhr(): void {\n if (typeof window === \"undefined\" || typeof XMLHttpRequest === \"undefined\") return;\n\n const originalOpen = XMLHttpRequest.prototype.open;\n const originalSend = XMLHttpRequest.prototype.send;\n const self = this;\n\n XMLHttpRequest.prototype.open = function (method: string, url: string) {\n (this as any)._reportli_method = method;\n (this as any)._reportli_url = url;\n return originalOpen.apply(this, arguments as any);\n } as any;\n\n XMLHttpRequest.prototype.send = function () {\n const xhrInstance = this;\n \n xhrInstance.addEventListener(\"loadend\", () => {\n try {\n const url = (xhrInstance as any)._reportli_url || \"\";\n const method = (xhrInstance as any)._reportli_method || \"GET\";\n const status = xhrInstance.status;\n\n // Skip self calls\n if (url.includes(\"rapid-processor\") || url.includes(\"supabase.co/functions\")) {\n return;\n }\n\n if (status >= 400 || status === 0) {\n if (status === 0) {\n self.logNetworkFailure(url, new Error(\"CORS or Connection Refused\"), method);\n } else {\n self.logNetworkError(url, status, xhrInstance.statusText || \"XHR Error\", method);\n }\n }\n } catch (e) {\n console.error(\"[Reportli SDK] Failed to extract XHR statistics:\", e);\n }\n });\n\n return originalSend.apply(this, arguments as any);\n } as any;\n }\n\n private logNetworkError(url: string, status: number, statusText: string, method: string) {\n let errorType = `API ${status} Error`;\n let severity: \"medium\" | \"high\" | \"critical\" = \"medium\";\n\n if (status === 400) errorType = \"API 400 Bad Request\";\n else if (status === 401) { errorType = \"API 401 Unauthorized\"; severity = \"high\"; }\n else if (status === 403) { errorType = \"API 403 Forbidden\"; severity = \"high\"; }\n else if (status === 404) errorType = \"API 404 Not Found\";\n else if (status === 500) { errorType = \"API 500 Internal Server Error\"; severity = \"high\"; }\n else if (status === 503) { errorType = \"API 503 Service Unavailable\"; severity = \"high\"; }\n\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"proj-sandbox\",\n projectName: this.config?.projectName || \"SaaS App\",\n errorType: errorType,\n errorMessage: `HTTP API failed with code ${status}: ${method} ${url}`,\n errorStack: `Network Request Header Context: [Method: ${method}] Url: ${url} Response Description: ${statusText || \"Dev server returned error.\"}`,\n framework: this.config?.framework || \"React/Next.js Client\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: severity,\n status: \"open\",\n };\n\n this.sendCrashReport(payload);\n }\n\n private logNetworkFailure(url: string, error: Error | any, method: string) {\n const errorMsg = String(error.message || error || \"\");\n let errorType = \"Fetch failed error\";\n let severity: \"medium\" | \"high\" = \"high\";\n\n if (errorMsg.includes(\"timeout\") || errorMsg.includes(\"abort\")) {\n errorType = \"Request timeout error\";\n severity = \"medium\";\n } else if (errorMsg.includes(\"CORS\") || errorMsg.includes(\"origin\") || errorMsg.includes(\"Access-Control\")) {\n errorType = \"CORS error\";\n }\n\n const payload: ExceptionPayload = {\n apiKey: this.config?.apiKey || \"\",\n projectId: this.config?.projectId || \"proj-sandbox\",\n projectName: this.config?.projectName || \"SaaS App\",\n errorType: errorType,\n errorMessage: `Failed to complete HTTP request: [${method}] ${url}`,\n errorStack: `Network crash context: ${errorMsg}\\nConnection status: Failed to resolve.`,\n framework: this.config?.framework || \"React/Next.js Client\",\n user_email: this.config?.userEmail || \"anonymous\",\n severity: severity,\n status: \"open\",\n };\n\n this.sendCrashReport(payload);\n }\n\n /**\n * Helper to safely format raw objects / strings into structured Errors\n */\n private normalizeError(err: any): { name: string; message: string; stack?: string } {\n if (err instanceof Error) {\n return {\n name: err.name,\n message: err.message,\n stack: err.stack,\n };\n }\n\n if (typeof err === \"string\") {\n return {\n name: \"Error\",\n message: err,\n stack: new Error(err).stack,\n };\n }\n\n if (err && typeof err === \"object\") {\n return {\n name: err.name || err.code || \"Error\",\n message: err.message || err.reason || JSON.stringify(err),\n stack: err.stack || err.traceback || new Error(err.message).stack,\n };\n }\n\n return {\n name: \"Error\",\n message: \"An unhandled execution trace slipped past standard boundaries.\",\n stack: new Error().stack,\n };\n }\n\n /**\n * Comprehensive classification rules checking substring and classifications\n */\n private classifyError(error: any, context?: string): { errorType: string; severity: \"low\" | \"medium\" | \"high\" | \"critical\" } {\n const msg = String(error.message || error || \"\").toLowerCase();\n const name = String(error.name || \"\").toLowerCase();\n\n // 1. Storage Errors\n if (name.includes(\"quotaexceeded\") || msg.includes(\"quota exceeded\") || msg.includes(\"localstorage\") || msg.includes(\"sessionstorage\") || msg.includes(\"indexeddb\")) {\n return { errorType: \"localStorage quota exceeded\", severity: \"medium\" };\n }\n\n // 2. React/Next.js/Vue Hydration Mismatches & Hook Violations\n if (msg.includes(\"hydration\") || msg.includes(\"does not match server\") || msg.includes(\"text content did not match\")) {\n return { errorType: \"React hydration error\", severity: \"high\" };\n }\n if (msg.includes(\"invalid hook call\") || msg.includes(\"rules of hooks\")) {\n return { errorType: \"Invalid hook call error\", severity: \"critical\" };\n }\n if (msg.includes(\"failed prop type\") || msg.includes(\"invalid prop\")) {\n return { errorType: \"Props type error\", severity: \"low\" };\n }\n if (msg.includes(\"render\") || msg.includes(\"react error boundary\") || msg.includes(\"component render\")) {\n return { errorType: \"Component render error\", severity: \"critical\" };\n }\n if (msg.includes(\"route not found\") || msg.includes(\"cannot find route\") || msg.includes(\"404 route\")) {\n return { errorType: \"Route not found error\", severity: \"medium\" };\n }\n if (msg.includes(\"failed to fetch dynamically imported\") || msg.includes(\"dynamic import\")) {\n return { errorType: \"Dynamic import error\", severity: \"high\" };\n }\n if (msg.includes(\"suspense\") || msg.includes(\"fallback\")) {\n return { errorType: \"Suspense boundary error\", severity: \"medium\" };\n }\n\n // 3. Engine standard throws\n if (name === \"typeerror\" || msg.startsWith(\"typeerror\")) {\n return { errorType: \"TypeError\", severity: \"high\" };\n }\n if (name === \"referenceerror\" || msg.startsWith(\"referenceerror\")) {\n return { errorType: \"ReferenceError\", severity: \"critical\" };\n }\n if (name === \"rangeerror\" || msg.startsWith(\"rangeerror\")) {\n if (msg.includes(\"maximum call stack\") || msg.includes(\"stack overflow\")) {\n return { errorType: \"Stack overflow error\", severity: \"critical\" };\n }\n return { errorType: \"RangeError\", severity: \"high\" };\n }\n if (name === \"syntaxerror\" || msg.startsWith(\"syntaxerror\")) {\n return { errorType: \"SyntaxError\", severity: \"high\" };\n }\n if (name === \"evalerror\") {\n return { errorType: \"EvalError\", severity: \"medium\" };\n }\n if (name === \"urierror\") {\n return { errorType: \"URIError\", severity: \"medium\" };\n }\n\n // 4. Payment & Billing Errors (Stripe/Paypal)\n if (msg.includes(\"stripe\") && (msg.includes(\"key\") || msg.includes(\"init\") || msg.includes(\"key is required\") || msg.includes(\"is not defined\"))) {\n return { errorType: \"Stripe initialization error\", severity: \"critical\" };\n }\n if (msg.includes(\"stripe\") && (msg.includes(\"payment\") || msg.includes(\"processing\") || msg.includes(\"charge\"))) {\n return { errorType: \"Payment processing error\", severity: \"critical\" };\n }\n if (msg.includes(\"card declined\") || msg.includes(\"card_declined\") || msg.includes(\"declined\")) {\n return { errorType: \"Card declined error\", severity: \"high\" };\n }\n if (msg.includes(\"checkout session\") || msg.includes(\"create checkout\")) {\n return { errorType: \"Checkout session error\", severity: \"high\" };\n }\n if (msg.includes(\"refund failed\") || msg.includes(\"refund_failed\")) {\n return { errorType: \"Refund failed error\", severity: \"high\" };\n }\n\n // 5. Database Errors (Supabase / PG / Mongo)\n if (msg.includes(\"supabase query\") || msg.includes(\"postgresterror\")) {\n return { errorType: \"Supabase query error\", severity: \"critical\" };\n }\n if (msg.includes(\"unique constraint\") || msg.includes(\"duplicate key\")) {\n return { errorType: \"Unique constraint error\", severity: \"high\" };\n }\n if (msg.includes(\"foreign key\")) {\n return { errorType: \"Foreign key error\", severity: \"high\" };\n }\n if (msg.includes(\"transaction failed\") || msg.includes(\"rollback\")) {\n return { errorType: \"Transaction failed error\", severity: \"critical\" };\n }\n if (msg.includes(\"connection lost\") || msg.includes(\"db connection\") || msg.includes(\"connection refused\") || msg.includes(\"econnrefused\")) {\n return { errorType: \"Connection lost error\", severity: \"critical\" };\n }\n if (msg.includes(\"query timeout\") || msg.includes(\"statement timeout\")) {\n return { errorType: \"Query timeout error\", severity: \"high\" };\n }\n\n // 6. JWT & Auth Server Errors\n if (msg.includes(\"jwt expired\") || msg.includes(\"token expired\") || msg.includes(\"jsonwebtokenexpired\")) {\n return { errorType: \"JWT expired error\", severity: \"high\" };\n }\n if (msg.includes(\"jwt verification\") || msg.includes(\"invalid signature\") || msg.includes(\"jwt malformed\")) {\n return { errorType: \"JWT verification error\", severity: \"high\" };\n }\n if (msg.includes(\"firebase-admin\") || msg.includes(\"firebase admin\")) {\n return { errorType: \"Firebase admin error\", severity: \"critical\" };\n }\n if (msg.includes(\"session creation\") || msg.includes(\"create session\")) {\n return { errorType: \"Session creation error\", severity: \"high\" };\n }\n if (msg.includes(\"password hash\") || msg.includes(\"bcrypt\") || msg.includes(\"argon2\")) {\n return { errorType: \"Password hash error\", severity: \"critical\" };\n }\n\n // 7. General Client Authentication Errors\n if (msg.includes(\"auth/id-token-expired\") || msg.includes(\"id token expired\")) {\n return { errorType: \"Token expired error\", severity: \"high\" };\n }\n if (msg.includes(\"invalid-credential\") || msg.includes(\"auth/invalid-credential\") || msg.includes(\"invalid token\")) {\n return { errorType: \"Invalid token error\", severity: \"high\" };\n }\n if (msg.includes(\"session ended\") || msg.includes(\"session expired\")) {\n return { errorType: \"Session ended error\", severity: \"medium\" };\n }\n if (msg.includes(\"oauth callback\") || msg.includes(\"oauth error\")) {\n return { errorType: \"OAuth callback error\", severity: \"high\" };\n }\n if (msg.includes(\"login failed\") || msg.includes(\"invalid credentials\")) {\n return { errorType: \"Login failed error\", severity: \"medium\" };\n }\n if (msg.includes(\"unauthorized\") || msg.includes(\"permission denied\") || msg.includes(\"forbidden\") || msg.includes(\"unauthorized access\") || msg.includes(\"permission_denied\")) {\n return { errorType: \"Unauthorized access error\", severity: \"high\" };\n }\n\n // 8. Background & Queue\n if (msg.includes(\"cron job\") || msg.includes(\"cron_failed\") || msg.includes(\"cron failed\")) {\n return { errorType: \"Cron job failed\", severity: \"high\" };\n }\n if (msg.includes(\"queue processing\") || msg.includes(\"bullmq\") || msg.includes(\"redis queue\") || msg.includes(\"celery error\")) {\n return { errorType: \"Queue processing error\", severity: \"high\" };\n }\n if (msg.includes(\"webhook delivery\") || msg.includes(\"webhook_failed\") || msg.includes(\"webhook failed\")) {\n return { errorType: \"Webhook delivery failed\", severity: \"high\" };\n }\n if (msg.includes(\"retry limit exceeded\") || msg.includes(\"max retries\")) {\n return { errorType: \"Retry limit exceeded\", severity: \"high\" };\n }\n\n // 9. Node Errors (Server backend context)\n if (msg.includes(\"out of memory\") || msg.includes(\"oom\") || msg.includes(\"heap limit\") || msg.includes(\"heap out of memory\")) {\n return { errorType: \"Out of memory error\", severity: \"critical\" };\n }\n if (msg.includes(\"cannot find module\") || msg.includes(\"module_not_found\") || msg.includes(\"module not found\")) {\n return { errorType: \"Module not found error\", severity: \"critical\" };\n }\n if (msg.includes(\"process crash\") || msg.includes(\"sigterm\") || msg.includes(\"sigint\") || msg.includes(\"process.exit\")) {\n return { errorType: \"Process crash error\", severity: \"critical\" };\n }\n\n // 10. Express Server Specifics\n if (context === \"express\" || msg.includes(\"route handler\") || msg.includes(\"api router\")) {\n return { errorType: \"Route handler error\", severity: \"high\" };\n }\n if (msg.includes(\"middleware\")) {\n return { errorType: \"Middleware error\", severity: \"high\" };\n }\n if (msg.includes(\"validation error\") || msg.includes(\"zoderror\") || msg.includes(\"joi validation\")) {\n return { errorType: \"Request validation error\", severity: \"medium\" };\n }\n if (msg.includes(\"body parser\") || msg.includes(\"multer\") || msg.includes(\"multipart\") || msg.includes(\"body-parser\")) {\n return { errorType: \"Body parser error\", severity: \"high\" };\n }\n if (msg.includes(\"too many requests\") || msg.includes(\"rate limit\") || msg.includes(\"429\")) {\n return { errorType: \"Rate limit error\", severity: \"high\" };\n }\n\n // 11. Files, Uploads, CDNs\n if (msg.includes(\"file upload\") || msg.includes(\"upload failed\") || msg.includes(\"cloudinary\") || msg.includes(\"s3 upload\") || msg.includes(\"multipart upload\")) {\n return { errorType: \"File upload failed\", severity: \"high\" };\n }\n if (msg.includes(\"file size exceeded\") || msg.includes(\"payload too large\") || msg.includes(\"size validation\")) {\n return { errorType: \"File size exceeded\", severity: \"medium\" };\n }\n if (msg.includes(\"invalid file type\") || msg.includes(\"mime type mismatch\") || msg.includes(\"file format\")) {\n return { errorType: \"Invalid file type\", severity: \"medium\" };\n }\n if (msg.includes(\"storage quota exceeded\") || msg.includes(\"bucket quota\") || msg.includes(\"exhausted quota\")) {\n return { errorType: \"Storage quota exceeded\", severity: \"high\" };\n }\n if (msg.includes(\"cdn \") || msg.includes(\"upload to cdn\") || msg.includes(\"cdn distribution\")) {\n return { errorType: \"CDN upload failed\", severity: \"high\" };\n }\n\n // 12. Email System failures\n if (msg.includes(\"email sending failed\") || msg.includes(\"sendgrid\") || msg.includes(\"nodemailer\") || msg.includes(\"resend\")) {\n return { errorType: \"Email sending failed\", severity: \"high\" };\n }\n if (msg.includes(\"smtp connection\") || msg.includes(\"smtp error\") || msg.includes(\"mail connection\")) {\n return { errorType: \"SMTP connection error\", severity: \"high\" };\n }\n if (msg.includes(\"template rendering\") || msg.includes(\"mjml\") || msg.includes(\"pug render\")) {\n return { errorType: \"Template rendering error\", severity: \"medium\" };\n }\n if (msg.includes(\"onesignal\") || msg.includes(\"push notification\") || msg.includes(\"fcm payload\")) {\n return { errorType: \"OneSignal API error\", severity: \"high\" };\n }\n\n // 13. Networking / API / CORS\n if (msg.includes(\"cors\") || msg.includes(\"cross-origin\") || msg.includes(\"preflight\") || msg.includes(\"access-control-allow\")) {\n return { errorType: \"CORS error\", severity: \"high\" };\n }\n if (msg.includes(\"fetch failed\") || msg.includes(\"failed to fetch\")) {\n return { errorType: \"Fetch failed error\", severity: \"high\" };\n }\n if (msg.includes(\"timeout\") || msg.includes(\"aborted\") || msg.includes(\"timed out\") || msg.includes(\"etimedout\")) {\n return { errorType: \"Request timeout error\", severity: \"medium\" };\n }\n if (msg.includes(\"websocket connection\") || msg.includes(\"ws connection failed\") || msg.includes(\"ws://\") || msg.includes(\"wss://\")) {\n return { errorType: \"WebSocket connection error\", severity: \"high\" };\n }\n if (msg.includes(\"websocket closed\") || msg.includes(\"websocket disconnected\") || msg.includes(\"ws.close\")) {\n return { errorType: \"WebSocket disconnect error\", severity: \"medium\" };\n }\n\n // 14. Standard Promise Failures\n if (context === \"unhandledrejection\") {\n return { errorType: \"Unhandled promise rejection\", severity: \"medium\" };\n }\n if (msg.includes(\"async\") && msg.includes(\"await\")) {\n return { errorType: \"Async await failure\", severity: \"high\" };\n }\n if (msg.includes(\"promise chain\") || msg.includes(\"promise.all\") || msg.includes(\"promise.race\")) {\n return { errorType: \"Promise chain error\", severity: \"high\" };\n }\n if (msg.includes(\"promise timed out\") || msg.includes(\"promise timeout\")) {\n return { errorType: \"Promise timeout error\", severity: \"medium\" };\n }\n\n // Fallbacks\n if (context === \"uncaughtexception\") {\n return { errorType: \"Uncaught exception\", severity: \"high\" };\n }\n\n return { errorType: \"Uncaught exception\", severity: \"medium\" };\n }\n}\n\nexport const Reportli = new ReportliTracker();\nexport default Reportli;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCA,IAAM,oBAAoB;AAE1B,IAAM,kBAAN,MAAM,iBAAgB;AAAA,EAAtB;AACE,SAAQ,SAAgC;AACxC,SAAQ,gBAAgB;AA4ExB;AAAA;AAAA;AAAA,SAAO,sBAAsB,CAAC,KAAU,KAAU,KAAU,SAAoB;AAC9E,UAAI,KAAK,iBAAiB,KAAK,QAAQ;AACrC,YAAI;AACF,gBAAM,cAAc,KAAK,eAAe,GAAG;AAC3C,gBAAM,EAAE,WAAW,SAAS,IAAI,KAAK,cAAc,aAAa,SAAS;AAEzE,gBAAM,UAA4B;AAAA,YAChC,QAAQ,KAAK,OAAO;AAAA,YACpB,WAAW,KAAK,OAAO,aAAa;AAAA,YACpC,aAAa,KAAK,OAAO,eAAe;AAAA,YACxC,WAAW,aAAa;AAAA,YACxB,cAAc,GAAG,IAAI,MAAM,IAA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