@xcodleox/devinspector 1.0.5 → 1.0.6

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/next.d.cts CHANGED
@@ -1,13 +1,7 @@
1
1
  import { InitOptions } from './index.cjs';
2
2
  export { audit } from './index.cjs';
3
3
 
4
- /**
5
- * Inicializa o Dev Inspector para Next.js (Client e Server)
6
- */
7
4
  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
5
  declare function captureNextError(error: unknown, metadata?: Record<string, any>): void;
12
6
 
13
7
  export { InitOptions, captureNextError, initNextDevInspector };
package/dist/next.d.ts CHANGED
@@ -1,13 +1,7 @@
1
1
  import { InitOptions } from './index.js';
2
2
  export { audit } from './index.js';
3
3
 
4
- /**
5
- * Inicializa o Dev Inspector para Next.js (Client e Server)
6
- */
7
4
  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
5
  declare function captureNextError(error: unknown, metadata?: Record<string, any>): void;
12
6
 
13
7
  export { InitOptions, captureNextError, initNextDevInspector };
package/dist/node.d.cts CHANGED
@@ -2,9 +2,6 @@ import { InitOptions } from './index.cjs';
2
2
 
3
3
  interface DevInspectorNodeOptions extends InitOptions {
4
4
  }
5
- /**
6
- * Middleware para capturar erros e requisições em ambientes Node.js / Express
7
- */
8
5
  declare function devInspector(options: DevInspectorNodeOptions): (err: any, req: any, res: any, next: any) => void;
9
6
 
10
7
  export { type DevInspectorNodeOptions, devInspector };
package/dist/node.d.ts CHANGED
@@ -2,9 +2,6 @@ import { InitOptions } from './index.js';
2
2
 
3
3
  interface DevInspectorNodeOptions extends InitOptions {
4
4
  }
5
- /**
6
- * Middleware para capturar erros e requisições em ambientes Node.js / Express
7
- */
8
5
  declare function devInspector(options: DevInspectorNodeOptions): (err: any, req: any, res: any, next: any) => void;
9
6
 
10
7
  export { type DevInspectorNodeOptions, devInspector };
package/dist/svelte.d.cts CHANGED
@@ -1,9 +1,6 @@
1
1
  import { InitOptions } from './index.cjs';
2
2
  export { audit } from './index.cjs';
3
3
 
4
- /**
5
- * Inicializa o Dev Inspector para Svelte
6
- */
7
4
  declare function initSvelteDevInspector(options: InitOptions): void;
8
5
 
9
6
  export { InitOptions, initSvelteDevInspector };
package/dist/svelte.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  import { InitOptions } from './index.js';
2
2
  export { audit } from './index.js';
3
3
 
4
- /**
5
- * Inicializa o Dev Inspector para Svelte
6
- */
7
4
  declare function initSvelteDevInspector(options: InitOptions): void;
8
5
 
9
6
  export { InitOptions, initSvelteDevInspector };
@@ -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=(t,n)=>{for(var e in n)s(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&&s(t,r,{get:()=>n[r],enumerable:!(i=p(n,r))||i.enumerable});return t};var h=t=>y(s({},"__esModule",{value:!0}),t);var E={};f(E,{audit:()=>o,default:()=>w});module.exports=h(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}init(n){if(!n.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=n.apiKey,n.endpoint&&(this.endpoint=n.endpoint),n.environment&&(this.environment=n.environment),this.initialized=!0,this.listenGlobalErrors()}listenGlobalErrors(){if(typeof window<"u")window.addEventListener("error",n=>{this.captureError(n.error||new Error(n.message||"Erro global desconhecido"),{filename:n.filename,lineno:n.lineno,colno:n.colno})}),window.addEventListener("unhandledrejection",n=>{let e=n.reason instanceof Error?n.reason:new Error(String(n.reason));this.captureError(e,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let n=globalThis.process;n.on("uncaughtException",e=>{this.captureError(e,{type:"uncaught_exception"})}),n.on("unhandledRejection",e=>{let i=e instanceof Error?e:new Error(String(e));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,a]of Object.entries(n))i[r]=this.truncate(a,e);return i}return n}captureError(n,e={}){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({...e,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(a)}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(()=>{})}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[c]||(t[c]=new d),t[c]},o=g();typeof window<"u"&&(window.DevInspector=o);var w=o;0&&(module.exports={audit});
@@ -0,0 +1,6 @@
1
+ import { audit } from './index.cjs';
2
+ export { InitOptions } from './index.cjs';
3
+
4
+
5
+
6
+ export { audit, audit as default };
@@ -0,0 +1,6 @@
1
+ import { audit } from './index.js';
2
+ export { InitOptions } from './index.js';
3
+
4
+
5
+
6
+ export { audit, audit as default };
@@ -0,0 +1 @@
1
+ "use strict";var DevInspector=(()=>{var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(t,n)=>{for(var e in n)s(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&&s(t,r,{get:()=>n[r],enumerable:!(i=p(n,r))||i.enumerable});return t};var h=t=>y(s({},"__esModule",{value:!0}),t);var E={};f(E,{audit:()=>o,default:()=>w});var d=class{constructor(){this.apiKey="PENDING_API_KEY";this.endpoint="https://api.devinspector.com.br/api/ingest/track";this.environment="production";this.initialized=!1}init(n){if(!n.apiKey){console.warn("[AuditSDK] API Key n\xE3o fornecida no init().");return}this.apiKey=n.apiKey,n.endpoint&&(this.endpoint=n.endpoint),n.environment&&(this.environment=n.environment),this.initialized=!0,this.listenGlobalErrors()}listenGlobalErrors(){if(typeof window<"u")window.addEventListener("error",n=>{this.captureError(n.error||new Error(n.message||"Erro global desconhecido"),{filename:n.filename,lineno:n.lineno,colno:n.colno})}),window.addEventListener("unhandledrejection",n=>{let e=n.reason instanceof Error?n.reason:new Error(String(n.reason));this.captureError(e,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let n=globalThis.process;n.on("uncaughtException",e=>{this.captureError(e,{type:"uncaught_exception"})}),n.on("unhandledRejection",e=>{let i=e instanceof Error?e:new Error(String(e));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,a]of Object.entries(n))i[r]=this.truncate(a,e);return i}return n}captureError(n,e={}){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({...e,environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(a)}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(()=>{})}},c="__DEVINSPECT_AUDIT_CORE_INSTANCE__",g=()=>{let t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return t[c]||(t[c]=new d),t[c]},o=g();typeof window<"u"&&(window.DevInspector=o);var w=o;return h(E);})();
@@ -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(){if(typeof window<"u")window.addEventListener("error",n=>{this.captureError(n.error||new Error(n.message||"Erro global desconhecido"),{filename:n.filename,lineno:n.lineno,colno:n.colno})}),window.addEventListener("unhandledrejection",n=>{let e=n.reason instanceof Error?n.reason:new Error(String(n.reason));this.captureError(e,{type:"unhandled_rejection"})});else if(typeof globalThis<"u"&&globalThis.process?.on){let n=globalThis.process;n.on("uncaughtException",e=>{this.captureError(e,{type:"uncaught_exception"})}),n.on("unhandledRejection",e=>{let t=e instanceof Error?e:new Error(String(e));this.captureError(t,{type:"unhandled_rejection"})})}}truncate(n,e=5e3){if(typeof n=="string")return n.length>e?n.substring(0,e)+"... [truncated]":n;if(n&&typeof n=="object"&&n!==null){let t={};for(let[o,a]of Object.entries(n))t[o]=this.truncate(a,e);return t}return n}captureError(n,e={}){let t=n.message||"Erro Desconhecido",o=n.stack||"",a={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(a)}captureException(n,e={}){this.captureError(n,e)}captureMessage(n,e={}){let t={message:this.truncate(n,500),stackTrace:"",url:typeof window<"u"?window.location.href:"",browser:typeof navigator<"u"?navigator.userAgent:"",metadata:this.truncate({...e,level:"info",environment:this.environment,timestamp:new Date().toISOString()},5e3)};this.send(t)}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__",d=()=>{let i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};return i[s]||(i[s]=new c),i[s]},r=d();typeof window<"u"&&(window.DevInspector=r);var h=r;export{r as audit,h as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcodleox/devinspector",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
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",
@@ -78,6 +78,12 @@
78
78
  "types": "./dist/node.d.ts",
79
79
  "import": "./dist/node.js",
80
80
  "require": "./dist/node.cjs"
81
+ },
82
+ "./vanilla": {
83
+ "types": "./dist/vanilla.d.ts",
84
+ "import": "./dist/vanilla.js",
85
+ "require": "./dist/vanilla.cjs",
86
+ "script": "./dist/vanilla.global.js"
81
87
  }
82
88
  }
83
89
  }