@elysiumjs/plugin-sentry 0.2.2 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @elysiumjs/plugin-sentry
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#7](https://github.com/na2axl/elysiumjs/pull/7) [`e9c3d98`](https://github.com/na2axl/elysiumjs/commit/e9c3d98dd2714b69100215f7c8a80046da463148) Thanks [@na2axl](https://github.com/na2axl)! - Elysium runs on Elysia 2 (`elysia@^2.0.0-rc.1`), with TypeBox 1 (`typebox`), `@elysia/openapi` and `@elysia/opentelemetry`.
8
+
9
+ Breaking:
10
+
11
+ - `TSchema` and `Static` are re-exported from `typebox` instead of `@sinclair/typebox`; `Value` comes from `typebox/value` and `Value.Errors()` returns an array.
12
+ - `Application.onError()` receives a `ServerError` (exported from core). Elysia now names its errors in kebab case; the default error response keeps the upper snake case names (`VALIDATION`, `NOT_FOUND`, `UNKNOWN` for other errors).
13
+ - `AppHttpContext` is a plain interface with `decorator`, `store` and `derive` records (Elysia 2 renamed `resolve` to `derive`).
14
+ - Websocket controllers install Elysia's `websocket()` capability themselves.
15
+
16
+ A module or controller `onRequest` middleware that answers now stops the request: Elysia 2 ignores values returned from a transform hook, so the response is thrown as a status and sent as is, without going through `onError`.
17
+
18
+ `mnemosyne` builds date columns with `t.Codec` (TypeBox 1 dropped `Transform`). `argus` traces every route of the app it is installed on and ends each span once, keeping the error status when the request failed.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`6bc48fe`](https://github.com/na2axl/elysiumjs/commit/6bc48febd51f7090c582e73f349eaeff7261241c), [`e9c3d98`](https://github.com/na2axl/elysiumjs/commit/e9c3d98dd2714b69100215f7c8a80046da463148), [`557a3ca`](https://github.com/na2axl/elysiumjs/commit/557a3cab7af8053a8bab9944e492e5022d91aa82), [`ccc3f5b`](https://github.com/na2axl/elysiumjs/commit/ccc3f5bb904d1bf52d8c72ebf7ea8d10f617a8c4), [`6789879`](https://github.com/na2axl/elysiumjs/commit/678987976ecfd46b534b65276e0de3f448977562), [`87299fd`](https://github.com/na2axl/elysiumjs/commit/87299fd9da82d1a408ced1891c0c3d42991444e5), [`bee66bd`](https://github.com/na2axl/elysiumjs/commit/bee66bdc874b8f23fea356f7d3adf7555a48ca64), [`0057b67`](https://github.com/na2axl/elysiumjs/commit/0057b67df0e3abecab8a9accff6b55a6a64c21df), [`632d77b`](https://github.com/na2axl/elysiumjs/commit/632d77b561fc43ade605fb69b06ac1b9b9a2ffc4), [`1ea417e`](https://github.com/na2axl/elysiumjs/commit/1ea417e3583250bc2f975d795f398b7ff736115d), [`0956186`](https://github.com/na2axl/elysiumjs/commit/0956186db0ca5a83c0a6636aeb2a4c81a0033de4), [`fbcc7da`](https://github.com/na2axl/elysiumjs/commit/fbcc7dad127db29da42e7a4a5c2124966731cd88), [`ac96e55`](https://github.com/na2axl/elysiumjs/commit/ac96e55874b0ffe350b287c4278cd85afecb7576), [`98a16aa`](https://github.com/na2axl/elysiumjs/commit/98a16aae889d46f7a9fb5573188f4cbe3629dd3b)]:
23
+ - @elysiumjs/core@0.11.0
24
+
3
25
  ## 0.2.2
4
26
 
5
27
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var __legacyDecorateClassTS=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};import{opentelemetry}from"@elysiajs/opentelemetry";import{Env}from"@elysiumjs/core";import*as Sentry from"@sentry/bun";import{Elysia}from"elysia";var plugin=(options)=>async(_app)=>{let dsn=options?.dsn??Env.get("SENTRY_DSN");if(!dsn)throw Error("Must provide a DSN");let environment=options?.environment??Env.get("SENTRY_ENVIRONMENT");return Sentry.init({dsn,environment,tracesSampleRate:1,integrations:[Sentry.bunServerIntegration(),Sentry.onUnhandledRejectionIntegration({mode:"warn"}),Sentry.onUncaughtExceptionIntegration()],...options}),new Elysia({name:"@elysiumjs/plugin-sentry"}).decorate("Sentry",Sentry).use(opentelemetry({serviceName:options?.serverName})).onError({as:"global"},({error,Sentry})=>{Sentry.captureException(error)}).onAfterResponse({as:"global"},function({body,cookie,params,request,response,route,server,store,headers,path,query}){})};import{Application,Env as Env2,MissingModuleConfigError,Module}from"@elysiumjs/core";class SentryModule extends Module.configurable(){onInit(){if(!this.config.dsn&&!Env2.get("SENTRY_DSN"))throw new MissingModuleConfigError(SentryModule.name,["dsn (or SENTRY_DSN)"])}async onServe(app){app.use(await plugin(this.config)(Application.instance))}}SentryModule=__legacyDecorateClassTS([Module.register({})],SentryModule);export{SentryModule,plugin};
2
+ var __legacyDecorateClassTS=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};import{opentelemetry}from"@elysia/opentelemetry";import{Env}from"@elysiumjs/core";import*as Sentry from"@sentry/bun";import{Elysia}from"elysia";var plugin=(options)=>async(_app)=>{let dsn=options?.dsn??Env.get("SENTRY_DSN");if(!dsn)throw Error("Must provide a DSN");let environment=options?.environment??Env.get("SENTRY_ENVIRONMENT");return Sentry.init({dsn,environment,tracesSampleRate:1,integrations:[Sentry.bunServerIntegration(),Sentry.onUnhandledRejectionIntegration({mode:"warn"}),Sentry.onUncaughtExceptionIntegration()],...options}),new Elysia({name:"@elysiumjs/plugin-sentry"}).decorate("Sentry",Sentry).use(opentelemetry({serviceName:options?.serverName})).onError("global",({error,Sentry})=>{Sentry.captureException(error)}).onAfterResponse("global",function({body,cookie,params,request,responseValue,route,server,store,headers,path,query}){})};import{Application,Env as Env2,MissingModuleConfigError,Module}from"@elysiumjs/core";class SentryModule extends Module.configurable(){onInit(){if(!this.config.dsn&&!Env2.get("SENTRY_DSN"))throw new MissingModuleConfigError(SentryModule.name,["dsn (or SENTRY_DSN)"])}async onServe(app){app.use(await plugin(this.config)(Application.instance))}}SentryModule=__legacyDecorateClassTS([Module.register({})],SentryModule);export{SentryModule,plugin};
@@ -4,7 +4,7 @@ declare const SentryModule_base: (abstract new () => {
4
4
  readonly config: Sentry.BunOptions;
5
5
  onInit(): Promise<void> | void;
6
6
  onDestroy(): Promise<void> | void;
7
- onServe(_app: import("elysia").default<any>): Promise<void> | void;
7
+ onServe(_app: import("elysia").Elysia<any>): Promise<void> | void;
8
8
  }) & {
9
9
  readonly config: string;
10
10
  with(config: Partial<Sentry.BunOptions> | (() => Partial<Sentry.BunOptions> | Promise<Partial<Sentry.BunOptions>>)): import("@elysiumjs/core").ConfiguredModule<Sentry.BunOptions>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elysiumjs/plugin-sentry",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Sentry error reporting plugin for the Elysium.js framework.",
6
6
  "private": false,
@@ -46,13 +46,13 @@
46
46
  "CHANGELOG.md"
47
47
  ],
48
48
  "devDependencies": {
49
- "@elysiumjs/core": "0.10.0"
49
+ "@elysiumjs/core": "0.11.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@elysiumjs/core": "^0.10.0"
52
+ "@elysiumjs/core": "^0.11.0"
53
53
  },
54
54
  "dependencies": {
55
- "@elysiajs/opentelemetry": "^1.4.11",
55
+ "@elysia/opentelemetry": "^2.0.0-rc.0",
56
56
  "@sentry/bun": "^11.9.0"
57
57
  }
58
58
  }