@xcodleox/devinspector 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.cjs +1 -1
- package/dist/angular.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/next.cjs +1 -0
- package/dist/next.d.cts +13 -0
- package/dist/next.d.ts +13 -0
- package/dist/next.js +1 -0
- package/dist/node.cjs +1 -0
- package/dist/node.d.cts +10 -0
- package/dist/node.d.ts +10 -0
- package/dist/node.js +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/svelte.cjs +1 -0
- package/dist/svelte.d.cts +9 -0
- package/dist/svelte.d.ts +9 -0
- package/dist/svelte.js +1 -0
- package/dist/vue.cjs +1 -0
- package/dist/vue.d.cts +8 -0
- package/dist/vue.d.ts +8 -0
- package/dist/vue.js +1 -0
- package/package.json +6 -1
package/dist/angular.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=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 u(n))!f.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)}captureException(n,e={}){this.captureError(n,e)}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 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};
|
|
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)}captureException(n,e={}){this.captureError(n,e)}captureMessage(n,e={}){let t={message:this.truncate(n,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}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 a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=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 u(n))!l.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)}captureException(n,e={}){this.captureError(n,e)}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
|
@@ -12,6 +12,7 @@ declare class AuditCore {
|
|
|
12
12
|
private listenGlobalErrors;
|
|
13
13
|
private truncate;
|
|
14
14
|
captureError(error: Error, metadata?: Record<string, any>): void;
|
|
15
|
+
captureException(error: Error, metadata?: Record<string, any>): void;
|
|
15
16
|
captureMessage(message: string, metadata?: Record<string, any>): void;
|
|
16
17
|
private send;
|
|
17
18
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare class AuditCore {
|
|
|
12
12
|
private listenGlobalErrors;
|
|
13
13
|
private truncate;
|
|
14
14
|
captureError(error: Error, metadata?: Record<string, any>): void;
|
|
15
|
+
captureException(error: Error, metadata?: Record<string, any>): void;
|
|
15
16
|
captureMessage(message: string, metadata?: Record<string, any>): void;
|
|
16
17
|
private send;
|
|
17
18
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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};
|
|
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)}captureException(n,e={}){this.captureError(n,e)}captureMessage(n,e={}){let t={message:this.truncate(n,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}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/dist/next.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(e,n)=>{for(var t in n)s(e,t,{get:n[t],enumerable:!0})},g=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of u(n))!l.call(e,r)&&r!==t&&s(e,r,{get:()=>n[r],enumerable:!(i=p(n,r))||i.enumerable});return e};var y=e=>g(s({},"__esModule",{value:!0}),e);var m={};f(m,{audit:()=>o,captureNextError:()=>E,initNextDevInspector:()=>w});module.exports=y(m);var d=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1}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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),n.addEventListener("unhandledrejection",t=>{let i=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(i,{type:"unhandled_rejection"})}))}truncate(n,t=5e3){if(typeof n=="string")return n.length>t?n.substring(0,t)+"... [truncated]":n;if(n&&typeof n=="object"&&n!==null){let i={};for(let[r,a]of Object.entries(n))i[r]=this.truncate(a,t);return i}return n}captureError(n,t={}){let i=n.message||"Erro Desconhecido",r=n.stack||"",a={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({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(a)}captureException(n,t={}){this.captureError(n,t)}captureMessage(n,t={}){let i={message:this.truncate(n,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(i)}send(n){let t=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":t},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",h=()=>{let e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return e[c]||(e[c]=new d),e[c]},o=h();function w(e){o.init(e)}function E(e,n={}){let t=e instanceof Error?e:new Error(String(e));o.captureError(t,{framework:"nextjs",...n})}0&&(module.exports={audit,captureNextError,initNextDevInspector});
|
package/dist/next.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InitOptions } from './index.cjs';
|
|
2
|
+
export { audit } from './index.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Inicializa o Dev Inspector para Next.js (Client e Server)
|
|
6
|
+
*/
|
|
7
|
+
declare function initNextDevInspector(options: InitOptions): void;
|
|
8
|
+
/**
|
|
9
|
+
* Função utilitária para capturar erros em API Routes ou Server Actions do Next.js
|
|
10
|
+
*/
|
|
11
|
+
declare function captureNextError(error: unknown, metadata?: Record<string, any>): void;
|
|
12
|
+
|
|
13
|
+
export { InitOptions, captureNextError, initNextDevInspector };
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InitOptions } from './index.js';
|
|
2
|
+
export { audit } from './index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Inicializa o Dev Inspector para Next.js (Client e Server)
|
|
6
|
+
*/
|
|
7
|
+
declare function initNextDevInspector(options: InitOptions): void;
|
|
8
|
+
/**
|
|
9
|
+
* Função utilitária para capturar erros em API Routes ou Server Actions do Next.js
|
|
10
|
+
*/
|
|
11
|
+
declare function captureNextError(error: unknown, metadata?: Record<string, any>): void;
|
|
12
|
+
|
|
13
|
+
export { InitOptions, captureNextError, initNextDevInspector };
|
package/dist/next.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),n.addEventListener("unhandledrejection",t=>{let i=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(i,{type:"unhandled_rejection"})}))}truncate(n,t=5e3){if(typeof n=="string")return n.length>t?n.substring(0,t)+"... [truncated]":n;if(n&&typeof n=="object"&&n!==null){let i={};for(let[r,o]of Object.entries(n))i[r]=this.truncate(o,t);return i}return n}captureError(n,t={}){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({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(n,t={}){this.captureError(n,t)}captureMessage(n,t={}){let i={message:this.truncate(n,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(i)}send(n){let t=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":t},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",d=()=>{let e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return e[a]||(e[a]=new s),e[a]},c=d();function f(e){c.init(e)}function g(e,n={}){let t=e instanceof Error?e:new Error(String(e));c.captureError(t,{framework:"nextjs",...n})}export{c as audit,g as captureNextError,f as initNextDevInspector};
|
package/dist/node.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=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 u(n))!l.call(t,r)&&r!==e&&a(t,r,{get:()=>n[r],enumerable:!(i=p(n,r))||i.enumerable});return t};var h=t=>y(a({},"__esModule",{value:!0}),t);var m={};f(m,{devInspector:()=>w});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 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)}captureException(n,e={}){this.captureError(n,e)}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__",g=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[s]||(t[s]=new c),t[s]},d=g();function w(t){return d.init(t),(n,e,i,r)=>{n&&d.captureException(n,{url:e.originalUrl||e.url,method:e.method,headers:e.headers}),r(n)}}0&&(module.exports={devInspector});
|
package/dist/node.d.cts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InitOptions } from './index.cjs';
|
|
2
|
+
|
|
3
|
+
interface DevInspectorNodeOptions extends InitOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Middleware para capturar erros e requisições em ambientes Node.js / Express
|
|
7
|
+
*/
|
|
8
|
+
declare function devInspector(options: DevInspectorNodeOptions): (err: any, req: any, res: any, next: any) => void;
|
|
9
|
+
|
|
10
|
+
export { type DevInspectorNodeOptions, devInspector };
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InitOptions } from './index.js';
|
|
2
|
+
|
|
3
|
+
interface DevInspectorNodeOptions extends InitOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Middleware para capturar erros e requisições em ambientes Node.js / Express
|
|
7
|
+
*/
|
|
8
|
+
declare function devInspector(options: DevInspectorNodeOptions): (err: any, req: any, res: any, next: any) => void;
|
|
9
|
+
|
|
10
|
+
export { type DevInspectorNodeOptions, devInspector };
|
package/dist/node.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
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)}captureException(n,e={}){this.captureError(n,e)}captureMessage(n,e={}){let t={message:this.truncate(n,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}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__",d=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[a]||(i[a]=new s),i[a]},c=d();function l(i){return c.init(i),(n,e,t,r)=>{n&&c.captureException(n,{url:e.originalUrl||e.url,method:e.method,headers:e.headers}),r(n)}}export{l as devInspector};
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var y=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},
|
|
1
|
+
"use strict";var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var y=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},E=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h(e))!g.call(n,i)&&i!==t&&a(n,i,{get:()=>e[i],enumerable:!(r=f(e,i))||r.enumerable});return n};var b=n=>E(a({},"__esModule",{value:!0}),n);var w={};y(w,{AuditErrorBoundary:()=>d});module.exports=b(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}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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),e.addEventListener("unhandledrejection",t=>{let r=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(r,{type:"unhandled_rejection"})}))}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let r={};for(let[i,o]of Object.entries(e))r[i]=this.truncate(o,t);return r}return e}captureError(e,t={}){let r=e.message||"Erro Desconhecido",i=e.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({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(e,t={}){this.captureError(e,t)}captureMessage(e,t={}){let r={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)}send(e){let t=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":t},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",m=()=>{let n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return n[s]||(n[s]=new c),n[s]},p=m();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 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}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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),e.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})}))}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={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)}captureMessage(e,t={}){let n={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)}send(e){let t=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":t},body:JSON.stringify(e),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();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,n){c.captureError(t,{componentStack:n.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};
|
|
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}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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),e.addEventListener("unhandledrejection",t=>{let n=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(n,{type:"unhandled_rejection"})}))}truncate(e,t=5e3){if(typeof e=="string")return e.length>t?e.substring(0,t)+"... [truncated]":e;if(e&&typeof e=="object"&&e!==null){let n={};for(let[i,o]of Object.entries(e))n[i]=this.truncate(o,t);return n}return e}captureError(e,t={}){let n=e.message||"Erro Desconhecido",i=e.stack||"",o={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={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)}send(e){let t=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":t},body:JSON.stringify(e),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();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,n){c.captureError(t,{componentStack:n.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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},y=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of u(n))!l.call(e,r)&&r!==t&&a(e,r,{get:()=>n[r],enumerable:!(i=p(n,r))||i.enumerable});return e};var g=e=>y(a({},"__esModule",{value:!0}),e);var E={};f(E,{audit:()=>d,initSvelteDevInspector:()=>w});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}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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),n.addEventListener("unhandledrejection",t=>{let i=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(i,{type:"unhandled_rejection"})}))}truncate(n,t=5e3){if(typeof n=="string")return n.length>t?n.substring(0,t)+"... [truncated]":n;if(n&&typeof n=="object"&&n!==null){let i={};for(let[r,o]of Object.entries(n))i[r]=this.truncate(o,t);return i}return n}captureError(n,t={}){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({...t,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(o)}captureException(n,t={}){this.captureError(n,t)}captureMessage(n,t={}){let i={message:this.truncate(n,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(i)}send(n){let t=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":t},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},s="__DEVINSPECT_AUDIT_CORE_INSTANCE__",h=()=>{let e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return e[s]||(e[s]=new c),e[s]},d=h();function w(e){d.init(e)}0&&(module.exports={audit,initSvelteDevInspector});
|
package/dist/svelte.d.ts
ADDED
package/dist/svelte.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
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",t=>{this.captureError(t.error||new Error(t.message||"Erro global desconhecido"),{filename:t.filename,lineno:t.lineno,colno:t.colno})}),n.addEventListener("unhandledrejection",t=>{let e=t.reason instanceof Error?t.reason:new Error(String(t.reason));this.captureError(e,{type:"unhandled_rejection"})}))}truncate(n,t=5e3){if(typeof n=="string")return n.length>t?n.substring(0,t)+"... [truncated]":n;if(n&&typeof n=="object"&&n!==null){let e={};for(let[r,o]of Object.entries(n))e[r]=this.truncate(o,t);return e}return n}captureError(n,t={}){let e=n.message||"Erro Desconhecido",r=n.stack||"",o={message:this.truncate(e,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(n,t={}){this.captureError(n,t)}captureMessage(n,t={}){let e={message:this.truncate(n,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(e)}send(n){let t=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":t},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}},a="__DEVINSPECT_AUDIT_CORE_INSTANCE__",d=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[a]||(i[a]=new s),i[a]},c=d();function f(i){c.init(i)}export{c as audit,f as initSvelteDevInspector};
|
package/dist/vue.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var g=(t,n)=>{for(var e in n)s(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))!l.call(t,i)&&i!==e&&s(t,i,{get:()=>n[i],enumerable:!(r=u(n,i))||r.enumerable});return t};var w=t=>y(s({},"__esModule",{value:!0}),t);var m={};g(m,{DevInspectorVue:()=>E,audit:()=>a});module.exports=w(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}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)}captureException(n,e={}){this.captureError(n,e)}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(()=>{})}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",h=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[c]||(t[c]=new d),t[c]},a=h();var E={install(t,n){if(a.init(n),t.config&&t.config.errorHandler){let e=t.config.errorHandler;t.config.errorHandler=(r,i,o)=>{let p=r instanceof Error?r:new Error(String(r));a.captureError(p,{framework:"vue",vueInfo:o}),e&&e(r,i,o)}}else t.config&&(t.config.errorHandler=(e,r,i)=>{let o=e instanceof Error?e:new Error(String(e));a.captureError(o,{framework:"vue",vueInfo:i})})}};0&&(module.exports={DevInspectorVue,audit});
|
package/dist/vue.d.cts
ADDED
package/dist/vue.d.ts
ADDED
package/dist/vue.js
ADDED
|
@@ -0,0 +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(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[o,i]of Object.entries(n))t[o]=this.truncate(i,e);return t}return n}captureError(n,e={}){let t=n.message||"Erro Desconhecido",o=n.stack||"",i={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({...e,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(i)}captureException(n,e={}){this.captureError(n,e)}captureMessage(n,e={}){let t={message:this.truncate(n,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}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__",p=()=>{let r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return r[s]||(r[s]=new c),r[s]},a=p();var g={install(r,n){if(a.init(n),r.config&&r.config.errorHandler){let e=r.config.errorHandler;r.config.errorHandler=(t,o,i)=>{let d=t instanceof Error?t:new Error(String(t));a.captureError(d,{framework:"vue",vueInfo:i}),e&&e(t,o,i)}}else r.config&&(r.config.errorHandler=(e,t,o)=>{let i=e instanceof Error?e:new Error(String(e));a.captureError(i,{framework:"vue",vueInfo:o})})}};export{g as DevInspectorVue,a as audit};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcodleox/devinspector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
"import": "./dist/index.js",
|
|
51
51
|
"require": "./dist/index.cjs"
|
|
52
52
|
},
|
|
53
|
+
"./next": {
|
|
54
|
+
"types": "./dist/next.d.ts",
|
|
55
|
+
"import": "./dist/next.js",
|
|
56
|
+
"require": "./dist/next.cjs"
|
|
57
|
+
},
|
|
53
58
|
"./react": {
|
|
54
59
|
"types": "./dist/react.d.ts",
|
|
55
60
|
"import": "./dist/react.js",
|