@xcodleox/devinspector 1.0.8 → 2.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/dist/angular.cjs +1 -1
- package/dist/angular.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/next.cjs +1 -1
- package/dist/next.js +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/svelte.cjs +1 -1
- package/dist/svelte.js +1 -1
- package/dist/vanilla.cjs +1 -1
- package/dist/vanilla.global.js +1 -0
- package/dist/vanilla.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +182 -89
- package/dist/vanilla.global.global.js +0 -1
package/dist/angular.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},g=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!h.call(r,i)&&i!==t&&s(r,i,{get:()=>e[i],enumerable:!(n=u(e,i))||n.enumerable});return r};var y=r=>g(s({},"__esModule",{value:!0}),r);var w={};f(w,{AuditAngularErrorHandler:()=>p});module.exports=y(w);var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",m=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},d=m();var p=class{handleError(e){let t=e instanceof Error?e:new Error(String(e));d.captureError(t,{framework:"Angular"}),console.error(e)}};0&&(module.exports={AuditAngularErrorHandler});
|
package/dist/angular.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",p=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[s]||(r[s]=new a),r[s]},c=p();var d=class{handleError(e){let t=e instanceof Error?e:new Error(String(e));c.captureError(t,{framework:"Angular"}),console.error(e)}};export{d as AuditAngularErrorHandler};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u(e))!l.call(r,i)&&i!==t&&s(r,i,{get:()=>e[i],enumerable:!(n=p(e,i))||n.enumerable});return r};var f=r=>y(s({},"__esModule",{value:!0}),r);var m={};h(m,{audit:()=>d});module.exports=f(m);var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},d=g();0&&(module.exports={audit});
|
package/dist/index.d.cts
CHANGED
|
@@ -3,12 +3,21 @@ interface InitOptions {
|
|
|
3
3
|
endpoint?: string;
|
|
4
4
|
environment?: string;
|
|
5
5
|
}
|
|
6
|
+
interface RequestMetricData {
|
|
7
|
+
method: string;
|
|
8
|
+
url: string;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
durationMs: number;
|
|
11
|
+
userAgent?: string;
|
|
12
|
+
}
|
|
6
13
|
declare class AuditCore {
|
|
7
14
|
private apiKey;
|
|
8
15
|
private endpoint;
|
|
9
16
|
private environment;
|
|
10
17
|
initialized: boolean;
|
|
18
|
+
private listenersAttached;
|
|
11
19
|
init(options: InitOptions): void;
|
|
20
|
+
captureRequest(data: RequestMetricData): void;
|
|
12
21
|
private listenGlobalErrors;
|
|
13
22
|
private truncate;
|
|
14
23
|
captureError(error: Error, metadata?: Record<string, any>): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,21 @@ interface InitOptions {
|
|
|
3
3
|
endpoint?: string;
|
|
4
4
|
environment?: string;
|
|
5
5
|
}
|
|
6
|
+
interface RequestMetricData {
|
|
7
|
+
method: string;
|
|
8
|
+
url: string;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
durationMs: number;
|
|
11
|
+
userAgent?: string;
|
|
12
|
+
}
|
|
6
13
|
declare class AuditCore {
|
|
7
14
|
private apiKey;
|
|
8
15
|
private endpoint;
|
|
9
16
|
private environment;
|
|
10
17
|
initialized: boolean;
|
|
18
|
+
private listenersAttached;
|
|
11
19
|
init(options: InitOptions): void;
|
|
20
|
+
captureRequest(data: RequestMetricData): void;
|
|
12
21
|
private listenGlobalErrors;
|
|
13
22
|
private truncate;
|
|
14
23
|
captureError(error: Error, metadata?: Record<string, any>): void;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",c=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[s]||(r[s]=new a),r[s]},d=c();export{d as audit};
|
package/dist/next.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},f=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u(e))!l.call(n,i)&&i!==t&&a(n,i,{get:()=>e[i],enumerable:!(r=d(e,i))||r.enumerable});return n};var g=n=>f(a({},"__esModule",{value:!0}),n);var E={};h(E,{audit:()=>o,captureNextError:()=>m,initNextDevInspector:()=>w});module.exports=g(E);var p=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let r=t instanceof Error?t:new Error(String(t));this.captureError(r,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let r={};for(let[i,s]of Object.entries(e))r[i]=this.truncate(s,t);return r}return e}captureError(e,t={}){let r=e.message||"Erro Desconhecido",i=e.stack||"",s={type:"error",message:this.truncate(r,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(s)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let r={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(r)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});r.ok||console.error(`[DevInspector] Erro na API (${r.status}): ${r.statusText}`)}catch(r){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",r)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",y=()=>{let n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return n[c]||(n[c]=new p),n[c]},o=y();function w(n){o.init(n)}function m(n,e={}){let t=n instanceof Error?n:new Error(String(n));o.captureError(t,{framework:"nextjs",...e})}0&&(module.exports={audit,captureNextError,initNextDevInspector});
|
package/dist/next.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",p=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[s]||(r[s]=new a),r[s]},c=p();function h(r){c.init(r)}function f(r,e={}){let t=r instanceof Error?r:new Error(String(r));c.captureError(t,{framework:"nextjs",...e})}export{c as audit,f as captureNextError,h as initNextDevInspector};
|
package/dist/node.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of u(e))!l.call(r,o)&&o!==t&&a(r,o,{get:()=>e[o],enumerable:!(n=p(e,o))||n.enumerable});return r};var f=r=>y(a({},"__esModule",{value:!0}),r);var E={};h(E,{devInspector:()=>m,devInspectorErrorHandler:()=>w});module.exports=f(E);var d=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[o,i]of Object.entries(e))n[o]=this.truncate(i,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",o=e.stack||"",i={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(o,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(i)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new d),r[c]},s=g();function m(r){return s.init(r),(e,t,n)=>{let o=performance.now();t.on("finish",()=>{let i=Math.round(performance.now()-o);s.captureRequest({method:e.method,url:e.originalUrl||e.url,statusCode:t.statusCode,durationMs:i,userAgent:e.headers["user-agent"]})}),n()}}function w(){return(r,e,t,n)=>{s.captureException(r,{url:e.originalUrl||e.url,method:e.method,headers:e.headers}),n(r)}}0&&(module.exports={devInspector,devInspectorErrorHandler});
|
package/dist/node.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { InitOptions } from './index.cjs';
|
|
|
2
2
|
|
|
3
3
|
interface DevInspectorNodeOptions extends InitOptions {
|
|
4
4
|
}
|
|
5
|
-
declare function devInspectorErrorHandler(): (err: any, req: any, res: any, next: any) => void;
|
|
6
5
|
declare function devInspector(options: DevInspectorNodeOptions): (req: any, res: any, next: any) => void;
|
|
6
|
+
declare function devInspectorErrorHandler(): (err: any, req: any, res: any, next: any) => void;
|
|
7
7
|
|
|
8
8
|
export { type DevInspectorNodeOptions, devInspector, devInspectorErrorHandler };
|
package/dist/node.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { InitOptions } from './index.js';
|
|
|
2
2
|
|
|
3
3
|
interface DevInspectorNodeOptions extends InitOptions {
|
|
4
4
|
}
|
|
5
|
-
declare function devInspectorErrorHandler(): (err: any, req: any, res: any, next: any) => void;
|
|
6
5
|
declare function devInspector(options: DevInspectorNodeOptions): (req: any, res: any, next: any) => void;
|
|
6
|
+
declare function devInspectorErrorHandler(): (err: any, req: any, res: any, next: any) => void;
|
|
7
7
|
|
|
8
8
|
export { type DevInspectorNodeOptions, devInspector, devInspectorErrorHandler };
|
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[o,i]of Object.entries(e))n[o]=this.truncate(i,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",o=e.stack||"",i={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(o,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(i)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",d=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},s=d();function l(r){return s.init(r),(e,t,n)=>{let o=performance.now();t.on("finish",()=>{let i=Math.round(performance.now()-o);s.captureRequest({method:e.method,url:e.originalUrl||e.url,statusCode:t.statusCode,durationMs:i,userAgent:e.headers["user-agent"]})}),n()}}function h(){return(r,e,t,n)=>{s.captureException(r,{url:e.originalUrl||e.url,method:e.method,headers:e.headers}),n(r)}}export{l as devInspector,h as devInspectorErrorHandler};
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var y=(
|
|
1
|
+
"use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var y=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},m=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!g.call(n,o)&&o!==t&&a(n,o,{get:()=>e[o],enumerable:!(r=h(e,o))||r.enumerable});return n};var E=n=>m(a({},"__esModule",{value:!0}),n);var w={};y(w,{AuditErrorBoundary:()=>d});module.exports=E(w);var u=require("react");var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let r=t instanceof Error?t:new Error(String(t));this.captureError(r,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let r={};for(let[o,i]of Object.entries(e))r[o]=this.truncate(i,t);return r}return e}captureError(e,t={}){let r=e.message||"Erro Desconhecido",o=e.stack||"",i={type:"error",message:this.truncate(r,500),stackTrace:this.truncate(o,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(i)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let r={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(r)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});r.ok||console.error(`[DevInspector] Erro na API (${r.status}): ${r.statusText}`)}catch(r){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",r)}}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",b=()=>{let n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return n[s]||(n[s]=new c),n[s]},p=b();var l=require("react/jsx-runtime"),d=class extends u.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){p.captureError(t,{componentStack:r.componentStack})}render(){return this.state.hasError?this.props.fallback||(0,l.jsx)("h1",{children:"Algo deu errado na aplica\xE7\xE3o."}):this.props.children}};0&&(module.exports={AuditErrorBoundary});
|
package/dist/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as
|
|
1
|
+
import{Component as u}from"react";var s=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let r=t instanceof Error?t:new Error(String(t));this.captureError(r,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let r={};for(let[o,i]of Object.entries(e))r[o]=this.truncate(i,t);return r}return e}captureError(e,t={}){let r=e.message||"Erro Desconhecido",o=e.stack||"",i={type:"error",message:this.truncate(r,500),stackTrace:this.truncate(o,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(i)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let r={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(r)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});r.ok||console.error(`[DevInspector] Erro na API (${r.status}): ${r.statusText}`)}catch(r){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",r)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",p=()=>{let n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return n[a]||(n[a]=new s),n[a]},c=p();import{jsx as l}from"react/jsx-runtime";var d=class extends u{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){c.captureError(t,{componentStack:r.componentStack})}render(){return this.state.hasError?this.props.fallback||l("h1",{children:"Algo deu errado na aplica\xE7\xE3o."}):this.props.children}};export{d as AuditErrorBoundary};
|
package/dist/svelte.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u(e))!l.call(r,i)&&i!==t&&s(r,i,{get:()=>e[i],enumerable:!(n=d(e,i))||n.enumerable});return r};var f=r=>y(s({},"__esModule",{value:!0}),r);var w={};h(w,{audit:()=>p,initSvelteDevInspector:()=>m});module.exports=f(w);var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},p=g();function m(r){p.init(r)}0&&(module.exports={audit,initSvelteDevInspector});
|
package/dist/svelte.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",p=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[s]||(r[s]=new a),r[s]},c=p();function h(r){c.init(r)}export{c as audit,h as initSvelteDevInspector};
|
package/dist/vanilla.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u(e))!l.call(r,i)&&i!==t&&a(r,i,{get:()=>e[i],enumerable:!(n=p(e,i))||n.enumerable});return r};var y=r=>f(a({},"__esModule",{value:!0}),r);var m={};h(m,{audit:()=>o,default:()=>w});module.exports=y(m);var d=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,s]of Object.entries(e))n[i]=this.truncate(s,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",s={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(s)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new d),r[c]},o=g();typeof window<"u"&&(window.DevInspector=o);var w=o;0&&(module.exports={audit});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var DevInspector=(()=>{var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u(e))!l.call(r,i)&&i!==t&&a(r,i,{get:()=>e[i],enumerable:!(n=p(e,i))||n.enumerable});return r};var y=r=>f(a({},"__esModule",{value:!0}),r);var m={};h(m,{audit:()=>o,default:()=>w});var d=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,s]of Object.entries(e))n[i]=this.truncate(s,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",s={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(s)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new d),r[c]},o=g();typeof window<"u"&&(window.DevInspector=o);var w=o;return y(m);})();
|
package/dist/vanilla.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1}init(
|
|
1
|
+
var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let t={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(t)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),e.on("unhandledRejection",t=>{let n=t instanceof Error?t:new Error(String(t));this.captureError(n,{type:"unhandled_rejection"})})}}}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[o,s]of Object.entries(e))n[o]=this.truncate(s,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",o=e.stack||"",s={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(o,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(s)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let n={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...t,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}async send(e){let t=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let n=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t},body:JSON.stringify(e),keepalive:!0});n.ok||console.error(`[DevInspector] Erro na API (${n.status}): ${n.statusText}`)}catch(n){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",n)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",d=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},i=d();typeof window<"u"&&(window.DevInspector=i);var y=i;export{i as audit,y as default};
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(r,e)=>{for(var n in e)a(r,n,{get:e[n],enumerable:!0})},h=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!f.call(r,i)&&i!==n&&a(r,i,{get:()=>e[i],enumerable:!(t=p(e,i))||t.enumerable});return r};var y=r=>h(a({},"__esModule",{value:!0}),r);var E={};g(E,{DevInspectorVue:()=>m,audit:()=>s});module.exports=y(E);var d=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let n={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(n)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let n=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),e.on("unhandledRejection",n=>{let t=n instanceof Error?n:new Error(String(n));this.captureError(t,{type:"unhandled_rejection"})})}}}truncate(e,n=5e3){if(typeof e=="string")return e.length>n?e.substring(0,n)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let t={};for(let[i,o]of Object.entries(e))t[i]=this.truncate(o,n);return t}return e}captureError(e,n={}){let t=e.message||"Erro Desconhecido",i=e.stack||"",o={type:"error",message:this.truncate(t,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...n,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,n={}){this.captureError(e,n)}captureMessage(e,n={}){let t={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...n,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}async send(e){let n=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify(e),keepalive:!0});t.ok||console.error(`[DevInspector] Erro na API (${t.status}): ${t.statusText}`)}catch(t){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",t)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",w=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new d),r[c]},s=w();var m={install(r,e){if(s.init(e),r.config&&r.config.errorHandler){let n=r.config.errorHandler;r.config.errorHandler=(t,i,o)=>{let u=t instanceof Error?t:new Error(String(t));s.captureError(u,{framework:"vue",vueInfo:o}),n&&n(t,i,o)}}else r.config&&(r.config.errorHandler=(n,t,i)=>{let o=n instanceof Error?n:new Error(String(n));s.captureError(o,{framework:"vue",vueInfo:i}),console.error(n)})}};0&&(module.exports={DevInspectorVue,audit});
|
package/dist/vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1}init(
|
|
1
|
+
var c=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1;this.listenersAttached=!1}init(e){if(!e.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=e.apiKey,e.endpoint&&(this.endpoint=e.endpoint),e.environment&&(this.environment=e.environment),this.initialized=!0,this.listenGlobalErrors()}captureRequest(e){let n={type:"request_metric",method:e.method,url:e.url,statusCode:e.statusCode,durationMs:e.durationMs,browser:e.userAgent||"",metadata:{environment:this.environment,timestamp:new Date().toISOString()}};this.send(n)}listenGlobalErrors(){if(!this.listenersAttached){if(this.listenersAttached=!0,typeof window<"u")window.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{let n=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let e=globalThis.process;e.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),e.on("unhandledRejection",n=>{let t=n instanceof Error?n:new Error(String(n));this.captureError(t,{type:"unhandled_rejection"})})}}}truncate(e,n=5e3){if(typeof e=="string")return e.length>n?e.substring(0,n)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let t={};for(let[o,i]of Object.entries(e))t[o]=this.truncate(i,n);return t}return e}captureError(e,n={}){let t=e.message||"Erro Desconhecido",o=e.stack||"",i={type:"error",message:this.truncate(t,500),stackTrace:this.truncate(o,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...n,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(i)}captureException(e,n={}){this.captureError(e,n)}captureMessage(e,n={}){let t={type:"message",message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...n,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}async send(e){let n=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify(e),keepalive:!0});t.ok||console.error(`[DevInspector] Erro na API (${t.status}): ${t.statusText}`)}catch(t){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",t)}}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",u=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},s=u();var g={install(r,e){if(s.init(e),r.config&&r.config.errorHandler){let n=r.config.errorHandler;r.config.errorHandler=(t,o,i)=>{let d=t instanceof Error?t:new Error(String(t));s.captureError(d,{framework:"vue",vueInfo:i}),n&&n(t,o,i)}}else r.config&&(r.config.errorHandler=(n,t,o)=>{let i=n instanceof Error?n:new Error(String(n));s.captureError(i,{framework:"vue",vueInfo:o}),console.error(n)})}};export{g as DevInspectorVue,s as audit};
|
package/package.json
CHANGED
|
@@ -1,89 +1,182 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xcodleox/devinspector",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "SDK de monitoramento e auditoria de erros em tempo real | Dev Inspector",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"require":
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
},
|
|
72
|
-
"./
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@xcodleox/devinspector",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "SDK de monitoramento e auditoria de erros em tempo real | Dev Inspector",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"unpkg": "./dist/vanilla.global.js",
|
|
10
|
+
"jsdelivr": "./dist/vanilla.global.js",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=16.0.0"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"monitoring",
|
|
27
|
+
"error-tracking",
|
|
28
|
+
"audit",
|
|
29
|
+
"devinspector",
|
|
30
|
+
"logger",
|
|
31
|
+
"react",
|
|
32
|
+
"angular",
|
|
33
|
+
"vue",
|
|
34
|
+
"svelte",
|
|
35
|
+
"nextjs"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"default": "./dist/index.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/index.d.cts",
|
|
46
|
+
"default": "./dist/index.cjs"
|
|
47
|
+
},
|
|
48
|
+
"default": "./dist/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./next": {
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/next.d.ts",
|
|
53
|
+
"default": "./dist/next.js"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/next.d.cts",
|
|
57
|
+
"default": "./dist/next.cjs"
|
|
58
|
+
},
|
|
59
|
+
"default": "./dist/next.js"
|
|
60
|
+
},
|
|
61
|
+
"./react": {
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./dist/react.d.ts",
|
|
64
|
+
"default": "./dist/react.js"
|
|
65
|
+
},
|
|
66
|
+
"require": {
|
|
67
|
+
"types": "./dist/react.d.cts",
|
|
68
|
+
"default": "./dist/react.cjs"
|
|
69
|
+
},
|
|
70
|
+
"default": "./dist/react.js"
|
|
71
|
+
},
|
|
72
|
+
"./angular": {
|
|
73
|
+
"import": {
|
|
74
|
+
"types": "./dist/angular.d.ts",
|
|
75
|
+
"default": "./dist/angular.js"
|
|
76
|
+
},
|
|
77
|
+
"require": {
|
|
78
|
+
"types": "./dist/angular.d.cts",
|
|
79
|
+
"default": "./dist/angular.cjs"
|
|
80
|
+
},
|
|
81
|
+
"default": "./dist/angular.js"
|
|
82
|
+
},
|
|
83
|
+
"./vue": {
|
|
84
|
+
"types": {
|
|
85
|
+
"require": "./dist/vue.d.cts",
|
|
86
|
+
"import": "./dist/vue.d.ts"
|
|
87
|
+
},
|
|
88
|
+
"require": "./dist/vue.cjs",
|
|
89
|
+
"import": "./dist/vue.js"
|
|
90
|
+
},
|
|
91
|
+
"./svelte": {
|
|
92
|
+
"import": {
|
|
93
|
+
"types": "./dist/svelte.d.ts",
|
|
94
|
+
"default": "./dist/svelte.js"
|
|
95
|
+
},
|
|
96
|
+
"require": {
|
|
97
|
+
"types": "./dist/svelte.d.cts",
|
|
98
|
+
"default": "./dist/svelte.cjs"
|
|
99
|
+
},
|
|
100
|
+
"default": "./dist/svelte.js"
|
|
101
|
+
},
|
|
102
|
+
"./node": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/node.d.ts",
|
|
105
|
+
"default": "./dist/node.js"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/node.d.cts",
|
|
109
|
+
"default": "./dist/node.cjs"
|
|
110
|
+
},
|
|
111
|
+
"default": "./dist/node.js"
|
|
112
|
+
},
|
|
113
|
+
"./vanilla": {
|
|
114
|
+
"script": "./dist/vanilla.global.js",
|
|
115
|
+
"import": {
|
|
116
|
+
"types": "./dist/vanilla.d.ts",
|
|
117
|
+
"default": "./dist/vanilla.js"
|
|
118
|
+
},
|
|
119
|
+
"require": {
|
|
120
|
+
"types": "./dist/vanilla.d.cts",
|
|
121
|
+
"default": "./dist/vanilla.cjs"
|
|
122
|
+
},
|
|
123
|
+
"default": "./dist/vanilla.js"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"typesVersions": {
|
|
127
|
+
"*": {
|
|
128
|
+
"next": [
|
|
129
|
+
"./dist/next.d.ts"
|
|
130
|
+
],
|
|
131
|
+
"react": [
|
|
132
|
+
"./dist/react.d.ts"
|
|
133
|
+
],
|
|
134
|
+
"angular": [
|
|
135
|
+
"./dist/angular.d.ts"
|
|
136
|
+
],
|
|
137
|
+
"vue": [
|
|
138
|
+
"./dist/vue.d.ts"
|
|
139
|
+
],
|
|
140
|
+
"svelte": [
|
|
141
|
+
"./dist/svelte.d.ts"
|
|
142
|
+
],
|
|
143
|
+
"node": [
|
|
144
|
+
"./dist/node.d.ts"
|
|
145
|
+
],
|
|
146
|
+
"vanilla": [
|
|
147
|
+
"./dist/vanilla.d.ts"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"peerDependencies": {
|
|
152
|
+
"@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
153
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
154
|
+
"svelte": "^4.0.0 || ^5.0.0",
|
|
155
|
+
"vue": "^3.0.0"
|
|
156
|
+
},
|
|
157
|
+
"peerDependenciesMeta": {
|
|
158
|
+
"react": {
|
|
159
|
+
"optional": true
|
|
160
|
+
},
|
|
161
|
+
"@angular/core": {
|
|
162
|
+
"optional": true
|
|
163
|
+
},
|
|
164
|
+
"vue": {
|
|
165
|
+
"optional": true
|
|
166
|
+
},
|
|
167
|
+
"svelte": {
|
|
168
|
+
"optional": true
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"devDependencies": {
|
|
172
|
+
"@angular/core": "^21.2.18",
|
|
173
|
+
"@types/react": "^18.3.31",
|
|
174
|
+
"react": "^19.2.8",
|
|
175
|
+
"rxjs": "^7.8.2",
|
|
176
|
+
"svelte": "^5.0.0",
|
|
177
|
+
"tsup": "^8.0.0",
|
|
178
|
+
"typescript": "^5.0.0",
|
|
179
|
+
"vue": "^3.4.0",
|
|
180
|
+
"zone.js": "^0.16.2"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var DevInspector=(()=>{var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(r,n)=>{for(var e in n)s(r,e,{get:n[e],enumerable:!0})},y=(r,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!l.call(r,i)&&i!==e&&s(r,i,{get:()=>n[i],enumerable:!(t=d(n,i))||t.enumerable});return r};var h=r=>y(s({},"__esModule",{value:!0}),r);var E={};f(E,{audit:()=>o,default:()=>w});var p=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1}init(n){if(!n.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=n.apiKey,n.endpoint&&(this.endpoint=n.endpoint),n.environment&&(this.environment=n.environment),this.initialized=!0,this.listenGlobalErrors()}listenGlobalErrors(){if(typeof window<"u")window.addEventListener("error",n=>{this.captureError(n.error||new Error(n.message||"Erro global desconhecido"),{filename:n.filename,lineno:n.lineno,colno:n.colno})}),window.addEventListener("unhandledrejection",n=>{let e=n.reason instanceof Error?n.reason:new Error(String(n.reason));this.captureError(e,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let n=globalThis.process;n.on("uncaughtException",e=>{this.captureError(e,{type:"uncaught_exception"})}),n.on("unhandledRejection",e=>{let t=e instanceof Error?e:new Error(String(e));this.captureError(t,{type:"unhandled_rejection"})})}}truncate(n,e=5e3){if(typeof n=="string")return n.length>e?n.substring(0,e)+"... [truncated]":n;if(n&&typeof n=="object"&&n!==null){let t={};for(let[i,a]of Object.entries(n))t[i]=this.truncate(a,e);return t}return n}captureError(n,e={}){let t=n.message||"Erro Desconhecido",i=n.stack||"",a={message:this.truncate(t,500),stackTrace:this.truncate(i,1e4),url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(a)}captureException(n,e={}){this.captureError(n,e)}captureMessage(n,e={}){let t={message:this.truncate(n,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}async send(n){let e=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";try{let t=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":e},body:JSON.stringify(n),keepalive:!0});t.ok||console.error(`[DevInspector] Erro na API (${t.status}): ${t.statusText}`)}catch(t){console.error("[DevInspector] Falha ao enviar requisi\xE7\xE3o para o painel:",t)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new p),r[c]},o=g();typeof window<"u"&&(window.DevInspector=o);var w=o;return h(E);})();
|