@xcodleox/devinspector 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.cjs +1 -1
- package/dist/angular.js +1 -1
- package/dist/index.cjs +1 -1
- 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.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 -1
- package/dist/vanilla.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +1 -1
package/dist/angular.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var h=(i,e)=>{for(var t in e)s(i,t,{get:e[t],enumerable:!0})},g=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!f.call(i,r)&&r!==t&&s(i,r,{get:()=>e[r],enumerable:!(n=l(e,r))||n.enumerable});return i};var y=i=>g(s({},"__esModule",{value:!0}),i);var m={};h(m,{AuditAngularErrorHandler:()=>p});module.exports=y(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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,o]of Object.entries(e))n[r]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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__",E=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[a]||(i[a]=new c),i[a]},d=E();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 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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,o]of Object.entries(e))n[r]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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 i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[s]||(i[s]=new a),i[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 s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(
|
|
1
|
+
"use strict";var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(i,e)=>{for(var t in e)s(i,t,{get:e[t],enumerable:!0})},f=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!l.call(i,r)&&r!==t&&s(i,r,{get:()=>e[r],enumerable:!(n=p(e,r))||n.enumerable});return i};var g=i=>f(s({},"__esModule",{value:!0}),i);var E={};h(E,{audit:()=>d});module.exports=g(E);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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,o]of Object.entries(e))n[r]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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__",y=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[a]||(i[a]=new c),i[a]},d=y();0&&(module.exports={audit});
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let i=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,i]of Object.entries(e))n[r]=this.truncate(i,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",i={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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)}}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",c=()=>{let o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return o[s]||(o[s]=new a),o[s]},d=c();export{d as audit};
|
package/dist/next.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})},h=(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 g=r=>h(a({},"__esModule",{value:!0}),r);var m={};f(m,{audit:()=>s,captureNextError:()=>w,initNextDevInspector:()=>E});module.exports=g(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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,i)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!i}),t&&t(n,i)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let i=n instanceof Error?n:new Error(String(n));this.captureError(i,{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)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",y=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new d),r[c]},s=y();function E(r){s.init(r)}function w(r,e={}){let t=r instanceof Error?r:new Error(String(r));s.captureError(t,{framework:"nextjs",...e})}0&&(module.exports={audit,captureNextError,initNextDevInspector});
|
package/dist/next.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,i)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!i}),t&&t(n,i)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let i=n instanceof Error?n:new Error(String(n));this.captureError(i,{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__",d=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[s]||(r[s]=new a),r[s]},c=d();function f(r){c.init(r)}function h(r,e={}){let t=r instanceof Error?r:new Error(String(r));c.captureError(t,{framework:"nextjs",...e})}export{c as audit,h as captureNextError,f 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 h=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})},
|
|
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 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 y=r=>f(a({},"__esModule",{value:!0}),r);var w={};h(w,{devInspector:()=>m,devInspectorErrorHandler:()=>E});module.exports=y(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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,o)=>{let i=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!o}),t&&t(n,o)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let o=n instanceof Error?n:new Error(String(n));this.captureError(o,{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 E(){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.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;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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let i=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,i]of Object.entries(e))n[r]=this.truncate(i,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",i={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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 o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return o[a]||(o[a]=new c),o[a]},s=d();function l(o){return s.init(o),(e,t,n)=>{let r=performance.now();t.on("finish",()=>{let i=Math.round(performance.now()-r);s.captureRequest({method:e.method,url:e.originalUrl||e.url,statusCode:t.statusCode,durationMs:i,userAgent:e.headers["user-agent"]})}),n()}}function h(){return(o,e,t,n)=>{s.captureException(o,{url:e.originalUrl||e.url,method:e.method,headers:e.headers}),n(o)}}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
|
|
1
|
+
"use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var E=(o,e)=>{for(var t in e)a(o,t,{get:e[t],enumerable:!0})},y=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of f(e))!g.call(o,n)&&n!==t&&a(o,n,{get:()=>e[n],enumerable:!(r=h(e,n))||r.enumerable});return o};var m=o=>y(a({},"__esModule",{value:!0}),o);var w={};E(w,{AuditErrorBoundary:()=>d});module.exports=m(w);var l=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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((r,n)=>{let i=r instanceof Error?r:new Error(String(r?.message||r||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!n}),t&&t(r,n)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let r=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(r,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",r=>{this.captureError(r,{type:"uncaught_exception"})}),t.on("unhandledRejection",r=>{let n=r instanceof Error?r:new Error(String(r));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 r={};for(let[n,i]of Object.entries(e))r[n]=this.truncate(i,t);return r}return e}captureError(e,t={}){let r=e.message||"Erro Desconhecido",n=e.stack||"",i={type:"error",message:this.truncate(r,500),stackTrace:this.truncate(n,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 o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return o[s]||(o[s]=new c),o[s]},p=b();var u=require("react/jsx-runtime"),d=class extends l.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,u.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 l}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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((r,n)=>{let i=r instanceof Error?r:new Error(String(r?.message||r||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!n}),t&&t(r,n)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let r=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(r,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",r=>{this.captureError(r,{type:"uncaught_exception"})}),t.on("unhandledRejection",r=>{let n=r instanceof Error?r:new Error(String(r));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 r={};for(let[n,i]of Object.entries(e))r[n]=this.truncate(i,t);return r}return e}captureError(e,t={}){let r=e.message||"Erro Desconhecido",n=e.stack||"",i={type:"error",message:this.truncate(r,500),stackTrace:this.truncate(n,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 o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return o[a]||(o[a]=new s),o[a]},c=p();import{jsx as u}from"react/jsx-runtime";var d=class extends l{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||u("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 s=Object.defineProperty;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})},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&&s(r,i,{get:()=>e[i],enumerable:!(n=p(e,i))||n.enumerable});return r};var g=r=>f(s({},"__esModule",{value:!0}),r);var w={};h(w,{audit:()=>d,initSvelteDevInspector:()=>E});module.exports=g(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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,i)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!i}),t&&t(n,i)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let i=n instanceof Error?n:new Error(String(n));this.captureError(i,{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__",y=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new c),r[a]},d=y();function E(r){d.init(r)}0&&(module.exports={audit,initSvelteDevInspector});
|
package/dist/svelte.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,o]of Object.entries(e))n[r]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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__",d=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[s]||(i[s]=new a),i[s]},c=d();function h(i){c.init(i)}export{c as audit,h as initSvelteDevInspector};
|
package/dist/vanilla.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 f=(i,e)=>{for(var t in e)a(i,t,{get:e[t],enumerable:!0})},h=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!l.call(i,r)&&r!==t&&a(i,r,{get:()=>e[r],enumerable:!(n=p(e,r))||n.enumerable});return i};var y=i=>h(a({},"__esModule",{value:!0}),i);var E={};f(E,{audit:()=>s,default:()=>w});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 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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,o]of Object.entries(e))n[r]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[c]||(i[c]=new d),i[c]},s=g();typeof window<"u"&&(window.DevInspector=s);var w=s;0&&(module.exports={audit});
|
package/dist/vanilla.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var DevInspector=(()=>{var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var
|
|
1
|
+
"use strict";var DevInspector=(()=>{var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(i,e)=>{for(var t in e)a(i,t,{get:e[t],enumerable:!0})},h=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!l.call(i,r)&&r!==t&&a(i,r,{get:()=>e[r],enumerable:!(n=p(e,r))||n.enumerable});return i};var y=i=>h(a({},"__esModule",{value:!0}),i);var E={};f(E,{audit:()=>s,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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let o=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(o,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,o]of Object.entries(e))n[r]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",o={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[c]||(i[c]=new d),i[c]},s=g();typeof window<"u"&&(window.DevInspector=s);var w=s;return y(E);})();
|
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;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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let t=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((n,r)=>{let i=n instanceof Error?n:new Error(String(n?.message||n||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!r}),t&&t(n,r)})}else if(typeof window<"u"&&window.addEventListener)window.addEventListener("error",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),window.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})});else if(e.process?.on){let t=e.process;t.on("uncaughtException",n=>{this.captureError(n,{type:"uncaught_exception"})}),t.on("unhandledRejection",n=>{let r=n instanceof Error?n:new Error(String(n));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 n={};for(let[r,i]of Object.entries(e))n[r]=this.truncate(i,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",r=e.stack||"",i={type:"error",message:this.truncate(n,500),stackTrace:this.truncate(r,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 o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return o[a]||(o[a]=new c),o[a]},s=d();typeof window<"u"&&(window.DevInspector=s);var y=s;export{s as audit,y as default};
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=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 o of p(e))!f.call(r,o)&&o!==n&&a(r,o,{get:()=>e[o],enumerable:!(t=l(e,o))||t.enumerable});return r};var y=r=>h(a({},"__esModule",{value:!0}),r);var m={};g(m,{DevInspectorVue:()=>w,audit:()=>s});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 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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let n=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((t,o)=>{let i=t instanceof Error?t:new Error(String(t?.message||t||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!o}),n&&n(t,o)})}else if(typeof window<"u"&&window.addEventListener)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 t=n.reason instanceof Error?n.reason:new Error(String(n.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(e.process?.on){let n=e.process;n.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),n.on("unhandledRejection",t=>{let o=t instanceof Error?t:new Error(String(t));this.captureError(o,{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)}}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",E=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[c]||(r[c]=new d),r[c]},s=E();var w={install(r,e){if(s.init(e),r.config&&r.config.errorHandler){let n=r.config.errorHandler;r.config.errorHandler=(t,o,i)=>{let u=t instanceof Error?t:new Error(String(t));s.captureError(u,{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)})}};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;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(
|
|
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)return;this.listenersAttached=!0;let e=globalThis;if(e.ErrorUtils&&typeof e.ErrorUtils.setGlobalHandler=="function"){let n=e.ErrorUtils.getGlobalHandler();e.ErrorUtils.setGlobalHandler((t,r)=>{let i=t instanceof Error?t:new Error(String(t?.message||t||"Erro React Native desconhecido"));this.captureError(i,{type:"react_native_error",isFatal:!!r}),n&&n(t,r)})}else if(typeof window<"u"&&window.addEventListener)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 t=n.reason instanceof Error?n.reason:new Error(String(n.reason));this.captureError(t,{type:"unhandled_rejection"})});else if(e.process?.on){let n=e.process;n.on("uncaughtException",t=>{this.captureError(t,{type:"uncaught_exception"})}),n.on("unhandledRejection",t=>{let r=t instanceof Error?t:new Error(String(t));this.captureError(r,{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[r,i]of Object.entries(e))t[r]=this.truncate(i,n);return t}return e}captureError(e,n={}){let t=e.message||"Erro Desconhecido",r=e.stack||"",i={type:"error",message:this.truncate(t,500),stackTrace:this.truncate(r,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 o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return o[a]||(o[a]=new c),o[a]},s=u();var g={install(o,e){if(s.init(e),o.config&&o.config.errorHandler){let n=o.config.errorHandler;o.config.errorHandler=(t,r,i)=>{let d=t instanceof Error?t:new Error(String(t));s.captureError(d,{framework:"vue",vueInfo:i}),n&&n(t,r,i)}}else o.config&&(o.config.errorHandler=(n,t,r)=>{let i=n instanceof Error?n:new Error(String(n));s.captureError(i,{framework:"vue",vueInfo:r}),console.error(n)})}};export{g as DevInspectorVue,s as audit};
|