@rxap/nest-sentry 11.0.0-dev.7 → 11.0.0-dev.9
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 +10 -0
- package/package.json +9 -9
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/lib/sentry-init-hook.d.ts +1 -1
- package/src/lib/sentry-init-hook.js +1 -1
- package/src/lib/{sentry.module.d.ts → sentry-logger.module.d.ts} +4 -4
- package/src/lib/{sentry.module.js → sentry-logger.module.js} +11 -10
- package/src/lib/sentry-module-options.factory.d.ts +1 -4
- package/src/lib/sentry-module-options.factory.js +7 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [11.0.0-dev.9](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.8...@rxap/nest-sentry@11.0.0-dev.9) (2025-09-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
9
|
+
|
|
10
|
+
# [11.0.0-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.7...@rxap/nest-sentry@11.0.0-dev.8) (2025-09-08)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **nest-sentry:** set default value for sentryInitHook options ([db26f24](https://gitlab.com/rxap/packages/commit/db26f24ca7e5d52b3f8ef37aa2d224ca26d3d754))
|
|
15
|
+
|
|
6
16
|
# [11.0.0-dev.7](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.6...@rxap/nest-sentry@11.0.0-dev.7) (2025-09-08)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "11.0.0-dev.
|
|
2
|
+
"version": "11.0.0-dev.9",
|
|
3
3
|
"name": "@rxap/nest-sentry",
|
|
4
4
|
"description": "This package provides a Sentry integration for NestJS applications. It includes a logger, interceptor, and module to simplify error tracking and performance monitoring with Sentry. It offers configurable options for setting up Sentry in your NestJS application.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@nestjs/config": "^4.0.2",
|
|
15
15
|
"@nestjs/core": "^11.1.1",
|
|
16
16
|
"@rxap/nest-logger": "^11.0.0-dev.3",
|
|
17
|
-
"@rxap/nest-utilities": "^11.0.0-dev.
|
|
17
|
+
"@rxap/nest-utilities": "^11.0.0-dev.6",
|
|
18
18
|
"@sentry/core": "^8.55.0",
|
|
19
19
|
"@sentry/nestjs": "^8.55.0",
|
|
20
20
|
"@sentry/node": "^8.55.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"package": "@rxap/nest-utilities",
|
|
88
|
-
"version": "11.0.0-dev.
|
|
88
|
+
"version": "11.0.0-dev.6"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"package": "@rxap/utilities",
|
|
@@ -93,23 +93,23 @@
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"package": "@sentry/core",
|
|
96
|
-
"version": "
|
|
96
|
+
"version": "10.10.0"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"package": "@sentry/nestjs",
|
|
100
|
-
"version": "
|
|
100
|
+
"version": "10.10.0"
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"package": "@sentry/node",
|
|
104
|
-
"version": "
|
|
104
|
+
"version": "10.10.0"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"package": "@sentry/profiling-node",
|
|
108
|
-
"version": "
|
|
108
|
+
"version": "10.10.0"
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
"package": "@sentry/types",
|
|
112
|
-
"version": "
|
|
112
|
+
"version": "10.10.0"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"package": "@sentry/utils",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"schematics": "./generators.json",
|
|
130
130
|
"type": "commonjs",
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "89b366e39c6d6f00d6d5872c763c418c45d0737d",
|
|
132
132
|
"types": "./src/index.d.ts",
|
|
133
133
|
"main": "./src/index.js"
|
|
134
134
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export * from './lib/determine-sentry-release';
|
|
|
3
3
|
export * from './lib/get-sentry-log-levels';
|
|
4
4
|
export * from './lib/sentry-app-config';
|
|
5
5
|
export * from './lib/sentry-init-hook';
|
|
6
|
+
export * from './lib/sentry-logger.module';
|
|
6
7
|
export * from './lib/sentry-module-options.factory';
|
|
7
8
|
export * from './lib/sentry.interfaces';
|
|
8
9
|
export * from './lib/sentry.logger';
|
|
9
|
-
export * from './lib/sentry.module';
|
|
10
10
|
export * from './lib/tokens';
|
|
11
11
|
export * from './lib/use-sentry-logger-factory';
|
package/src/index.js
CHANGED
|
@@ -7,10 +7,10 @@ tslib_1.__exportStar(require("./lib/determine-sentry-release"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./lib/get-sentry-log-levels"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./lib/sentry-app-config"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./lib/sentry-init-hook"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/sentry-logger.module"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./lib/sentry-module-options.factory"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./lib/sentry.interfaces"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./lib/sentry.logger"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./lib/sentry.module"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./lib/tokens"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./lib/use-sentry-logger-factory"), exports);
|
|
16
16
|
// endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Environment } from '@rxap/nest-utilities';
|
|
2
2
|
import type { NodeOptions } from '@sentry/node/build/types/types';
|
|
3
|
-
export declare function sentryInitHook(options
|
|
3
|
+
export declare function sentryInitHook(options?: Partial<NodeOptions>): (_: any, environment: Environment) => void;
|
|
@@ -5,7 +5,7 @@ const Sentry = require("@sentry/nestjs");
|
|
|
5
5
|
const profiling_node_1 = require("@sentry/profiling-node");
|
|
6
6
|
const determine_sentry_environment_1 = require("./determine-sentry-environment");
|
|
7
7
|
const determine_sentry_release_1 = require("./determine-sentry-release");
|
|
8
|
-
function sentryInitHook(options) {
|
|
8
|
+
function sentryInitHook(options = {}) {
|
|
9
9
|
return (_, environment) => {
|
|
10
10
|
const dsn = process.env['SENTRY_DSN'] ?? environment.sentry?.dsn;
|
|
11
11
|
if (!dsn) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
1
|
+
import { ConsoleLoggerOptions, DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { PrintMessagesFunction } from '@rxap/nest-logger';
|
|
3
3
|
import { SentryModuleOptions } from './sentry.interfaces';
|
|
4
4
|
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<SentryModuleOptions, "register", "create", {
|
|
@@ -8,8 +8,8 @@ export declare const ConfigurableModuleClass: import("@nestjs/common").Configura
|
|
|
8
8
|
}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<SentryModuleOptions, "create"> & Partial<{
|
|
9
9
|
isGlobal: boolean;
|
|
10
10
|
}>;
|
|
11
|
-
export declare class
|
|
12
|
-
static register(options: typeof OPTIONS_TYPE, printMessagesFunction?: PrintMessagesFunction | null): DynamicModule;
|
|
13
|
-
static registerAsync(options: typeof ASYNC_OPTIONS_TYPE, printMessagesFunction?: PrintMessagesFunction | null): DynamicModule;
|
|
11
|
+
export declare class SentryLoggerModule extends ConfigurableModuleClass {
|
|
12
|
+
static register(options: typeof OPTIONS_TYPE, consoleLoggerOptions?: ConsoleLoggerOptions | null, printMessagesFunction?: PrintMessagesFunction | null): DynamicModule;
|
|
13
|
+
static registerAsync(options: typeof ASYNC_OPTIONS_TYPE, consoleLoggerOptions?: ConsoleLoggerOptions | null, printMessagesFunction?: PrintMessagesFunction | null): DynamicModule;
|
|
14
14
|
private static updateProviders;
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.SentryLoggerModule = exports.ASYNC_OPTIONS_TYPE = exports.OPTIONS_TYPE = exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const common_1 = require("@nestjs/common");
|
|
7
7
|
const config_1 = require("@nestjs/config");
|
|
@@ -14,14 +14,14 @@ _a = new common_1.ConfigurableModuleBuilder()
|
|
|
14
14
|
isGlobal: true,
|
|
15
15
|
})
|
|
16
16
|
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
|
|
17
|
-
let
|
|
18
|
-
static register(options, printMessagesFunction = null) {
|
|
19
|
-
return this.updateProviders(super.register(options), printMessagesFunction);
|
|
17
|
+
let SentryLoggerModule = class SentryLoggerModule extends exports.ConfigurableModuleClass {
|
|
18
|
+
static register(options, consoleLoggerOptions = null, printMessagesFunction = null) {
|
|
19
|
+
return this.updateProviders(super.register(options), consoleLoggerOptions, printMessagesFunction);
|
|
20
20
|
}
|
|
21
|
-
static registerAsync(options, printMessagesFunction = null) {
|
|
22
|
-
return this.updateProviders(super.registerAsync(options), printMessagesFunction);
|
|
21
|
+
static registerAsync(options, consoleLoggerOptions = null, printMessagesFunction = null) {
|
|
22
|
+
return this.updateProviders(super.registerAsync(options), consoleLoggerOptions, printMessagesFunction);
|
|
23
23
|
}
|
|
24
|
-
static updateProviders(module, printMessagesFunction) {
|
|
24
|
+
static updateProviders(module, consoleLoggerOptions = null, printMessagesFunction) {
|
|
25
25
|
module.providers ??= [];
|
|
26
26
|
module.providers.push({
|
|
27
27
|
provide: tokens_1.SENTRY_MODULE_OPTIONS,
|
|
@@ -33,6 +33,7 @@ let SentryModule = class SentryModule extends exports.ConfigurableModuleClass {
|
|
|
33
33
|
timestamp: true,
|
|
34
34
|
logLevels: (0, nest_utilities_1.GetLogLevels)(),
|
|
35
35
|
...options.logger ?? {},
|
|
36
|
+
...consoleLoggerOptions ?? {},
|
|
36
37
|
}),
|
|
37
38
|
inject: [tokens_1.SENTRY_MODULE_OPTIONS],
|
|
38
39
|
});
|
|
@@ -45,8 +46,8 @@ let SentryModule = class SentryModule extends exports.ConfigurableModuleClass {
|
|
|
45
46
|
return module;
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
49
|
+
exports.SentryLoggerModule = SentryLoggerModule;
|
|
50
|
+
exports.SentryLoggerModule = SentryLoggerModule = tslib_1.__decorate([
|
|
50
51
|
(0, common_1.Global)(),
|
|
51
52
|
(0, common_1.Module)({
|
|
52
53
|
providers: [
|
|
@@ -68,4 +69,4 @@ exports.SentryModule = SentryModule = tslib_1.__decorate([
|
|
|
68
69
|
imports: [],
|
|
69
70
|
exports: [common_1.Logger],
|
|
70
71
|
})
|
|
71
|
-
],
|
|
72
|
+
], SentryLoggerModule);
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { ConfigurableModuleOptionsFactory
|
|
2
|
-
import { ConsoleLoggerOptions } from '@nestjs/common/services/console-logger.service';
|
|
1
|
+
import { ConfigurableModuleOptionsFactory } from '@nestjs/common';
|
|
3
2
|
import { ConfigService } from '@nestjs/config';
|
|
4
3
|
import { SentryModuleOptions } from '@rxap/nest-sentry';
|
|
5
4
|
export declare class SentryModuleOptionsFactory implements ConfigurableModuleOptionsFactory<SentryModuleOptions, 'create'> {
|
|
6
5
|
protected readonly config: ConfigService;
|
|
7
|
-
protected readonly logger: Logger;
|
|
8
|
-
protected readonly options?: ConsoleLoggerOptions;
|
|
9
6
|
create(): Promise<SentryModuleOptions>;
|
|
10
7
|
}
|
|
@@ -4,17 +4,22 @@ exports.SentryModuleOptionsFactory = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
const config_1 = require("@nestjs/config");
|
|
7
|
-
const nest_logger_1 = require("@rxap/nest-logger");
|
|
8
7
|
const nest_utilities_1 = require("@rxap/nest-utilities");
|
|
9
8
|
const get_sentry_log_levels_1 = require("./get-sentry-log-levels");
|
|
10
9
|
let SentryModuleOptionsFactory = class SentryModuleOptionsFactory {
|
|
10
|
+
// Do not inject the logger, because it will be created circularly with the SentryModule
|
|
11
|
+
// @Inject(Logger)
|
|
12
|
+
// protected readonly logger!: Logger;
|
|
13
|
+
// Do not inject the logger, because it will be created circularly with the SentryModule
|
|
14
|
+
// @Optional()
|
|
15
|
+
// @Inject(CONSOLE_LOGGER_OPTIONS)
|
|
16
|
+
// protected readonly options?: ConsoleLoggerOptions;
|
|
11
17
|
async create() {
|
|
12
18
|
return {
|
|
13
19
|
logLevels: (0, get_sentry_log_levels_1.GetSentryLogLevels)(this.config.getOrThrow('SENTRY_LOG_LEVEL')),
|
|
14
20
|
logger: {
|
|
15
21
|
timestamp: true,
|
|
16
22
|
logLevels: (0, nest_utilities_1.GetLogLevels)(),
|
|
17
|
-
...this.options ?? {},
|
|
18
23
|
}
|
|
19
24
|
};
|
|
20
25
|
}
|
|
@@ -24,15 +29,6 @@ tslib_1.__decorate([
|
|
|
24
29
|
(0, common_1.Inject)(config_1.ConfigService),
|
|
25
30
|
tslib_1.__metadata("design:type", config_1.ConfigService)
|
|
26
31
|
], SentryModuleOptionsFactory.prototype, "config", void 0);
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
(0, common_1.Inject)(common_1.Logger),
|
|
29
|
-
tslib_1.__metadata("design:type", common_1.Logger)
|
|
30
|
-
], SentryModuleOptionsFactory.prototype, "logger", void 0);
|
|
31
|
-
tslib_1.__decorate([
|
|
32
|
-
(0, common_1.Optional)(),
|
|
33
|
-
(0, common_1.Inject)(nest_logger_1.CONSOLE_LOGGER_OPTIONS),
|
|
34
|
-
tslib_1.__metadata("design:type", Object)
|
|
35
|
-
], SentryModuleOptionsFactory.prototype, "options", void 0);
|
|
36
32
|
exports.SentryModuleOptionsFactory = SentryModuleOptionsFactory = tslib_1.__decorate([
|
|
37
33
|
(0, common_1.Injectable)()
|
|
38
34
|
], SentryModuleOptionsFactory);
|