@xcodleox/devinspector 1.0.1 → 1.0.2

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},m=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!u.call(t,o)&&o!==r&&c(t,o,{get:()=>e[o],enumerable:!(n=l(e,o))||n.enumerable});return t};var g=t=>m(c({},"__esModule",{value:!0}),t);var b={};h(b,{AuditAngularErrorHandler:()=>a});module.exports=g(b);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(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()}listenGlobalErrors(){let e=typeof window<"u"?window:globalThis;e&&(e.addEventListener("error",r=>{this.captureError(r.error||new Error(r.message||"Erro global desconhecido"),{filename:r.filename,lineno:r.lineno,colno:r.colno})}),e.addEventListener("unhandledrejection",r=>{let n=r.reason instanceof Error?r.reason:new Error(String(r.reason));this.captureError(n,{type:"unhandled_rejection"})}))}truncate(e,r=5e3){if(typeof e=="string")return e.length>r?e.substring(0,r)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[o,s]of Object.entries(e))n[o]=this.truncate(s,r);return n}return e}captureError(e,r={}){let n=e.message||"Erro Desconhecido",o=e.stack||"",s={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({...r,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(s)}captureMessage(e,r={}){let n={message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...r,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}send(e){let r=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})}},d="__DEVINSPECT_AUDIT_CORE_INSTANCE__",E=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[d]||(t[d]=new p),t[d]},i=E();var y=require("react");var w=require("react/jsx-runtime");var a=class{handleError(e){let r=e instanceof Error?e:new Error(String(e));i.captureError(r,{framework:"Angular"}),console.error(e)}};0&&(module.exports={AuditAngularErrorHandler});
1
+ "use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var g=(t,n)=>{for(var e in n)a(t,e,{get:n[e],enumerable:!0})},y=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of f(n))!u.call(t,i)&&i!==e&&a(t,i,{get:()=>n[i],enumerable:!(r=l(n,i))||r.enumerable});return t};var h=t=>y(a({},"__esModule",{value:!0}),t);var m={};g(m,{AuditAngularErrorHandler:()=>p});module.exports=h(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}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(){let n=typeof window<"u"?window:globalThis;n&&(n.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),n.addEventListener("unhandledrejection",e=>{let r=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(r,{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 r={};for(let[i,o]of Object.entries(n))r[i]=this.truncate(o,e);return r}return n}captureError(n,e={}){let r=n.message||"Erro Desconhecido",i=n.stack||"",o={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({...e,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureMessage(n,e={}){let r={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(r)}send(n){let e=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":e},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",w=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[s]||(t[s]=new c),t[s]},d=w();var p=class{handleError(n){let e=n instanceof Error?n:new Error(String(n));d.captureError(e,{framework:"Angular"}),console.error(n)}};0&&(module.exports={AuditAngularErrorHandler});
package/dist/angular.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(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()}listenGlobalErrors(){let e=typeof window<"u"?window:globalThis;e&&(e.addEventListener("error",r=>{this.captureError(r.error||new Error(r.message||"Erro global desconhecido"),{filename:r.filename,lineno:r.lineno,colno:r.colno})}),e.addEventListener("unhandledrejection",r=>{let t=r.reason instanceof Error?r.reason:new Error(String(r.reason));this.captureError(t,{type:"unhandled_rejection"})}))}truncate(e,r=5e3){if(typeof e=="string")return e.length>r?e.substring(0,r)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let t={};for(let[i,a]of Object.entries(e))t[i]=this.truncate(a,r);return t}return e}captureError(e,r={}){let t=e.message||"Erro Desconhecido",i=e.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({...r,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(a)}captureMessage(e,r={}){let t={message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...r,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}send(e){let r=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",p=()=>{let n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return n[s]||(n[s]=new c),n[s]},o=p();import{Component as h}from"react";import{jsx as w}from"react/jsx-runtime";var d=class{handleError(e){let r=e instanceof Error?e:new Error(String(e));o.captureError(r,{framework:"Angular"}),console.error(e)}};export{d as AuditAngularErrorHandler};
1
+ 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}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(){let n=typeof window<"u"?window:globalThis;n&&(n.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),n.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));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,o]of Object.entries(n))t[i]=this.truncate(o,e);return t}return n}captureError(n,e={}){let t=n.message||"Erro Desconhecido",i=n.stack||"",o={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(o)}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)}send(n){let e=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":e},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",p=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[a]||(r[a]=new s),r[a]},c=p();var d=class{handleError(n){let e=n instanceof Error?n:new Error(String(n));c.captureError(e,{framework:"Angular"}),console.error(n)}};export{d as AuditAngularErrorHandler};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var E=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!g.call(t,o)&&o!==r&&d(t,o,{get:()=>e[o],enumerable:!(n=h(e,o))||n.enumerable});return t};var w=t=>y(d({},"__esModule",{value:!0}),t);var v={};E(v,{AuditAngularErrorHandler:()=>s,AuditErrorBoundary:()=>a,audit:()=>i});module.exports=w(v);var l=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!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()}listenGlobalErrors(){let e=typeof window<"u"?window:globalThis;e&&(e.addEventListener("error",r=>{this.captureError(r.error||new Error(r.message||"Erro global desconhecido"),{filename:r.filename,lineno:r.lineno,colno:r.colno})}),e.addEventListener("unhandledrejection",r=>{let n=r.reason instanceof Error?r.reason:new Error(String(r.reason));this.captureError(n,{type:"unhandled_rejection"})}))}truncate(e,r=5e3){if(typeof e=="string")return e.length>r?e.substring(0,r)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[o,c]of Object.entries(e))n[o]=this.truncate(c,r);return n}return e}captureError(e,r={}){let n=e.message||"Erro Desconhecido",o=e.stack||"",c={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({...r,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(c)}captureMessage(e,r={}){let n={message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...r,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(n)}send(e){let r=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})}},p="__DEVINSPECT_AUDIT_CORE_INSTANCE__",b=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[p]||(t[p]=new l),t[p]},i=b();var f=require("react");var u=require("react/jsx-runtime"),a=class extends f.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){i.captureError(r,{componentStack:n.componentStack})}render(){return this.state.hasError?this.props.fallback||(0,u.jsx)("h1",{children:"Algo deu errado na aplica\xE7\xE3o."}):this.props.children}};var s=class{handleError(e){let r=e instanceof Error?e:new Error(String(e));i.captureError(r,{framework:"Angular"}),console.error(e)}};0&&(module.exports={AuditAngularErrorHandler,AuditErrorBoundary,audit});
1
+ "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var f=(t,n)=>{for(var e in n)a(t,e,{get:n[e],enumerable:!0})},y=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of l(n))!u.call(t,r)&&r!==e&&a(t,r,{get:()=>n[r],enumerable:!(i=p(n,r))||i.enumerable});return t};var g=t=>y(a({},"__esModule",{value:!0}),t);var w={};f(w,{audit:()=>d});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}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(){let n=typeof window<"u"?window:globalThis;n&&(n.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),n.addEventListener("unhandledrejection",e=>{let i=e.reason instanceof Error?e.reason:new Error(String(e.reason));this.captureError(i,{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 i={};for(let[r,o]of Object.entries(n))i[r]=this.truncate(o,e);return i}return n}captureError(n,e={}){let i=n.message||"Erro Desconhecido",r=n.stack||"",o={message:this.truncate(i,500),stackTrace:this.truncate(r,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(o)}captureMessage(n,e={}){let i={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(i)}send(n){let e=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":e},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",h=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[s]||(t[s]=new c),t[s]},d=h();0&&(module.exports={audit});
package/dist/index.d.cts CHANGED
@@ -1,8 +1,3 @@
1
- export { AuditErrorBoundary } from './react.cjs';
2
- export { AuditAngularErrorHandler } from './angular.cjs';
3
- import 'react';
4
- import '@angular/core';
5
-
6
1
  interface InitOptions {
7
2
  apiKey: string;
8
3
  endpoint?: string;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- export { AuditErrorBoundary } from './react.js';
2
- export { AuditAngularErrorHandler } from './angular.js';
3
- import 'react';
4
- import '@angular/core';
5
-
6
1
  interface InitOptions {
7
2
  apiKey: string;
8
3
  endpoint?: string;
package/dist/index.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(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()}listenGlobalErrors(){let e=typeof window<"u"?window:globalThis;e&&(e.addEventListener("error",r=>{this.captureError(r.error||new Error(r.message||"Erro global desconhecido"),{filename:r.filename,lineno:r.lineno,colno:r.colno})}),e.addEventListener("unhandledrejection",r=>{let t=r.reason instanceof Error?r.reason:new Error(String(r.reason));this.captureError(t,{type:"unhandled_rejection"})}))}truncate(e,r=5e3){if(typeof e=="string")return e.length>r?e.substring(0,r)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let t={};for(let[i,a]of Object.entries(e))t[i]=this.truncate(a,r);return t}return e}captureError(e,r={}){let t=e.message||"Erro Desconhecido",i=e.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({...r,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(a)}captureMessage(e,r={}){let t={message:this.truncate(e,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...r,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}send(e){let r=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",l=()=>{let n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return n[s]||(n[s]=new c),n[s]},o=l();import{Component as f}from"react";import{jsx as u}from"react/jsx-runtime";var d=class extends f{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,t){o.captureError(r,{componentStack:t.componentStack})}render(){return this.state.hasError?this.props.fallback||u("h1",{children:"Algo deu errado na aplica\xE7\xE3o."}):this.props.children}};var p=class{handleError(e){let r=e instanceof Error?e:new Error(String(e));o.captureError(r,{framework:"Angular"}),console.error(e)}};export{p as AuditAngularErrorHandler,d as AuditErrorBoundary,o as audit};
1
+ 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}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(){let n=typeof window<"u"?window:globalThis;n&&(n.addEventListener("error",e=>{this.captureError(e.error||new Error(e.message||"Erro global desconhecido"),{filename:e.filename,lineno:e.lineno,colno:e.colno})}),n.addEventListener("unhandledrejection",e=>{let t=e.reason instanceof Error?e.reason:new Error(String(e.reason));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[r,o]of Object.entries(n))t[r]=this.truncate(o,e);return t}return n}captureError(n,e={}){let t=n.message||"Erro Desconhecido",r=n.stack||"",o={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({...e,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}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)}send(n){let e=this.apiKey&&this.apiKey!=="PENDING_API_KEY"?this.apiKey:"dev-fallback-key";fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":e},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",c=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[a]||(i[a]=new s),i[a]},d=c();export{d as audit};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcodleox/devinspector",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "SDK de monitoramento e auditoria de erros em tempo real | Dev Inspector",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",