@ttt-productions/monitoring-core 0.0.6 → 0.0.7

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/package.json CHANGED
@@ -1,21 +1,31 @@
1
1
  {
2
2
  "name": "@ttt-productions/monitoring-core",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ttt-productions/ttt-packages.git",
7
7
  "directory": "packages/monitoring-core"
8
8
  },
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "module": "dist/index.js",
12
+ "types": "dist/index.d.ts",
13
+ "sideEffects": false,
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ }
22
+ },
9
23
  "scripts": {
10
24
  "build": "tsc",
11
25
  "clean": "rm -rf dist *.tsbuildinfo",
12
26
  "typecheck": "tsc --noEmit",
13
27
  "prepublishOnly": "npm run clean && npm run build"
14
28
  },
15
- "main": "dist/index.js",
16
- "types": "dist/index.d.ts",
17
- "sideEffects": false,
18
- "dependencies": {},
19
29
  "peerDependencies": {
20
30
  "@sentry/nextjs": ">=8.0.0",
21
31
  "@sentry/node": ">=8.0.0"
@@ -27,5 +37,10 @@
27
37
  "@sentry/node": {
28
38
  "optional": true
29
39
  }
30
- }
40
+ },
41
+ "devDependencies": {
42
+ "typescript": "^5.8.3"
43
+ },
44
+ "author": "DJ (TTT Productions)",
45
+ "license": "MIT"
31
46
  }
package/src/adapter.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { MonitoringInitOptions, MonitoringUser, ScopeLike } from "./types";
2
- export interface MonitoringAdapter {
3
- init(options: MonitoringInitOptions): void | Promise<void>;
4
- captureException(error: unknown, context?: Record<string, unknown>): void;
5
- captureMessage(message: string, level?: "fatal" | "error" | "warning" | "info" | "debug"): void;
6
- setUser(user: MonitoringUser | null): void;
7
- setTag(key: string, value: string): void;
8
- withScope?<T>(fn: (scope: ScopeLike) => T): T;
9
- addBreadcrumb?(breadcrumb: {
10
- category?: string;
11
- message?: string;
12
- level?: "fatal" | "error" | "warning" | "info" | "debug";
13
- data?: Record<string, unknown>;
14
- }): void;
15
- }
16
- //# sourceMappingURL=adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC1E,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GACvD,IAAI,CAAC;IAER,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9C,aAAa,CAAC,CAAC,UAAU,EAAE;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;QACzD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,GAAG,IAAI,CAAC;CACV"}
package/src/adapter.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["adapter.ts"],"names":[],"mappings":""}
package/src/adapter.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { MonitoringInitOptions, MonitoringUser, ScopeLike } from "./types";
2
-
3
- export interface MonitoringAdapter {
4
- init(options: MonitoringInitOptions): void | Promise<void>;
5
-
6
- captureException(error: unknown, context?: Record<string, unknown>): void;
7
- captureMessage(
8
- message: string,
9
- level?: "fatal" | "error" | "warning" | "info" | "debug"
10
- ): void;
11
-
12
- setUser(user: MonitoringUser | null): void;
13
- setTag(key: string, value: string): void;
14
-
15
- withScope?<T>(fn: (scope: ScopeLike) => T): T;
16
-
17
- addBreadcrumb?(breadcrumb: {
18
- category?: string;
19
- message?: string;
20
- level?: "fatal" | "error" | "warning" | "info" | "debug";
21
- data?: Record<string, unknown>;
22
- }): void;
23
- }
@@ -1,3 +0,0 @@
1
- import type { MonitoringAdapter } from "../adapter";
2
- export declare const NoopAdapter: MonitoringAdapter;
3
- //# sourceMappingURL=noop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAUpD,eAAO,MAAM,WAAW,EAAE,iBAiBzB,CAAC"}
@@ -1,16 +0,0 @@
1
- const noopScope = {
2
- setTag: () => { },
3
- setUser: () => { },
4
- setExtra: () => { },
5
- setContext: () => { },
6
- };
7
- export const NoopAdapter = {
8
- init: (_options) => { },
9
- captureException: (_error, _context) => { },
10
- captureMessage: (_message, _level) => { },
11
- setUser: (_user) => { },
12
- setTag: (_key, _value) => { },
13
- withScope: (fn) => fn(noopScope),
14
- addBreadcrumb: (_breadcrumb) => { },
15
- };
16
- //# sourceMappingURL=noop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"noop.js","sourceRoot":"","sources":["noop.ts"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAAc;IAC3B,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;IAChB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,IAAI,EAAE,CAAC,QAA+B,EAAE,EAAE,GAAE,CAAC;IAE7C,gBAAgB,EAAE,CAAC,MAAe,EAAE,QAAkC,EAAE,EAAE,GAAE,CAAC;IAC7E,cAAc,EAAE,CAAC,QAAgB,EAAE,MAAY,EAAE,EAAE,GAAE,CAAC;IAEtD,OAAO,EAAE,CAAC,KAA4B,EAAE,EAAE,GAAE,CAAC;IAC7C,MAAM,EAAE,CAAC,IAAY,EAAE,MAAc,EAAE,EAAE,GAAE,CAAC;IAE5C,SAAS,EAAE,CAAI,EAA2B,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IAE5D,aAAa,EAAE,CAAC,WAKf,EAAE,EAAE,GAAE,CAAC;CACT,CAAC"}
@@ -1,28 +0,0 @@
1
- import type { MonitoringAdapter } from "../adapter";
2
- import type { MonitoringInitOptions, MonitoringUser, ScopeLike } from "../types";
3
-
4
- const noopScope: ScopeLike = {
5
- setTag: () => {},
6
- setUser: () => {},
7
- setExtra: () => {},
8
- setContext: () => {},
9
- };
10
-
11
- export const NoopAdapter: MonitoringAdapter = {
12
- init: (_options: MonitoringInitOptions) => {},
13
-
14
- captureException: (_error: unknown, _context?: Record<string, unknown>) => {},
15
- captureMessage: (_message: string, _level?: any) => {},
16
-
17
- setUser: (_user: MonitoringUser | null) => {},
18
- setTag: (_key: string, _value: string) => {},
19
-
20
- withScope: <T>(fn: (scope: ScopeLike) => T) => fn(noopScope),
21
-
22
- addBreadcrumb: (_breadcrumb: {
23
- category?: string;
24
- message?: string;
25
- level?: "fatal" | "error" | "warning" | "info" | "debug";
26
- data?: Record<string, unknown>;
27
- }) => {},
28
- };
@@ -1,3 +0,0 @@
1
- import type { MonitoringAdapter } from "../adapter";
2
- export declare const SentryNodeAdapter: MonitoringAdapter;
3
- //# sourceMappingURL=sentry-node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry-node.d.ts","sourceRoot":"","sources":["sentry-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAwBpD,eAAO,MAAM,iBAAiB,EAAE,iBAgF/B,CAAC"}
@@ -1,75 +0,0 @@
1
- let sentryNodePromise = null;
2
- function getSentryNode() {
3
- if (!sentryNodePromise) {
4
- sentryNodePromise = Function("return import('@sentry/node')")().then((m) => m);
5
- }
6
- return sentryNodePromise;
7
- }
8
- export const SentryNodeAdapter = {
9
- async init(options) {
10
- const enabled = options.enabled ?? true;
11
- if (!enabled || !options.dsn)
12
- return;
13
- const S = await getSentryNode();
14
- S.init({
15
- dsn: options.dsn,
16
- environment: options.environment,
17
- enabled: true,
18
- release: options.release,
19
- });
20
- },
21
- captureException(error, context) {
22
- void (async () => {
23
- const S = await getSentryNode();
24
- if (context) {
25
- S.withScope((scope) => {
26
- for (const [k, v] of Object.entries(context)) {
27
- if (typeof scope?.setExtra === "function")
28
- scope.setExtra(k, v);
29
- }
30
- S.captureException(error);
31
- });
32
- return;
33
- }
34
- S.captureException(error);
35
- })();
36
- },
37
- captureMessage(message, level) {
38
- void (async () => {
39
- const S = await getSentryNode();
40
- S.captureMessage(message, level);
41
- })();
42
- },
43
- setUser(user) {
44
- void (async () => {
45
- const S = await getSentryNode();
46
- S.setUser(user);
47
- })();
48
- },
49
- setTag(key, value) {
50
- void (async () => {
51
- const S = await getSentryNode();
52
- S.setTag(key, value);
53
- })();
54
- },
55
- withScope(fn) {
56
- const minimalScope = {
57
- setTag: () => { },
58
- setUser: () => { },
59
- setExtra: () => { },
60
- setContext: () => { },
61
- };
62
- void (async () => {
63
- const S = await getSentryNode();
64
- S.withScope((scope) => fn(scope));
65
- })();
66
- return fn(minimalScope);
67
- },
68
- addBreadcrumb(breadcrumb) {
69
- void (async () => {
70
- const S = await getSentryNode();
71
- S.addBreadcrumb(breadcrumb);
72
- })();
73
- },
74
- };
75
- //# sourceMappingURL=sentry-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry-node.js","sourceRoot":"","sources":["sentry-node.ts"],"names":[],"mappings":"AAaA,IAAI,iBAAiB,GAAmC,IAAI,CAAC;AAE7D,SAAS,aAAa;IACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,iBAAiB,GAAI,QAAQ,CAAC,+BAA+B,CAAC,EAAmB,CAAC,IAAI,CACpF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAmB,CAC3B,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,KAAK,CAAC,IAAI,CAAC,OAA8B;QACvC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;QACxC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG;YAAE,OAAO;QAErC,MAAM,CAAC,GAAG,MAAM,aAAa,EAAE,CAAC;QAChC,CAAC,CAAC,IAAI,CAAC;YACL,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,KAAc,EAAE,OAAiC;QAChE,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,CAAC,GAAG,MAAM,aAAa,EAAE,CAAC;YAEhC,IAAI,OAAO,E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,GAAG,EAAE,GAAE,CAAC;YACjB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;YAClB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;SACrB,CAAC;QAEF,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,CAAC,GAAG,MAAM,aAAa,EAAE,CAAC;YAChC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,KAAY,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,EAAE,CAAC;QAEL,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAED,aAAa,CAAC,UAKb;QACC,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,CAAC,GAAG,MAAM,aAAa,EAAE,CAAC;YAChC,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC9B,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;CACF,CAAC"}
@@ -1,105 +0,0 @@
1
- import type { MonitoringAdapter } from "../adapter";
2
- import type { MonitoringInitOptions, MonitoringUser, ScopeLike } from "../types";
3
-
4
- type SentryNodeLike = {
5
- init: (opts: any) => void;
6
- captureException: (e: unknown, hint?: any) => void;
7
- captureMessage: (m: string, level?: any) => void;
8
- setUser: (u: any) => void;
9
- setTag: (k: string, v: string) => void;
10
- withScope: (fn: (scope: any) => void) => void;
11
- addBreadcrumb: (breadcrumb: any) => void;
12
- };
13
-
14
- let sentryNodePromise: Promise<SentryNodeLike> | null = null;
15
-
16
- function getSentryNode(): Promise<SentryNodeLike> {
17
- if (!sentryNodePromise) {
18
- sentryNodePromise = (Function("return import('@sentry/node')")() as Promise<any>).then(
19
- (m) => m as SentryNodeLike
20
- );
21
- }
22
- return sentryNodePromise;
23
- }
24
-
25
- export const SentryNodeAdapter: MonitoringAdapter = {
26
- async init(options: MonitoringInitOptions) {
27
- const enabled = options.enabled ?? true;
28
- if (!enabled || !options.dsn) return;
29
-
30
- const S = await getSentryNode();
31
- S.init({
32
- dsn: options.dsn,
33
- environment: options.environment,
34
- enabled: true,
35
- release: options.release,
36
- });
37
- },
38
-
39
- captureException(error: unknown, context?: Record<string, unknown>) {
40
- void (async () => {
41
- const S = await getSentryNode();
42
-
43
- if (context) {
44
- S.withScope((scope) => {
45
- for (const [k, v] of Object.entries(context)) {
46
- if (typeof scope?.setExtra === "function") scope.setExtra(k, v);
47
- }
48
- S.captureException(error);
49
- });
50
- return;
51
- }
52
-
53
- S.captureException(error);
54
- })();
55
- },
56
-
57
- captureMessage(message: string, level?: any) {
58
- void (async () => {
59
- const S = await getSentryNode();
60
- S.captureMessage(message, level);
61
- })();
62
- },
63
-
64
- setUser(user: MonitoringUser | null) {
65
- void (async () => {
66
- const S = await getSentryNode();
67
- S.setUser(user as any);
68
- })();
69
- },
70
-
71
- setTag(key: string, value: string) {
72
- void (async () => {
73
- const S = await getSentryNode();
74
- S.setTag(key, value);
75
- })();
76
- },
77
-
78
- withScope<T>(fn: (scope: ScopeLike) => T): T {
79
- const minimalScope: ScopeLike = {
80
- setTag: () => {},
81
- setUser: () => {},
82
- setExtra: () => {},
83
- setContext: () => {},
84
- };
85
-
86
- void (async () => {
87
- const S = await getSentryNode();
88
- S.withScope((scope) => fn(scope as any));
89
- })();
90
-
91
- return fn(minimalScope);
92
- },
93
-
94
- addBreadcrumb(breadcrumb: {
95
- category?: string;
96
- message?: string;
97
- level?: "fatal" | "error" | "warning" | "info" | "debug";
98
- data?: Record<string, unknown>;
99
- }) {
100
- void (async () => {
101
- const S = await getSentryNode();
102
- S.addBreadcrumb(breadcrumb);
103
- })();
104
- },
105
- };
@@ -1,3 +0,0 @@
1
- import type { MonitoringAdapter } from "../adapter";
2
- export declare const SentryAdapter: MonitoringAdapter;
3
- //# sourceMappingURL=sentry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["sentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAyBpD,eAAO,MAAM,aAAa,EAAE,iBAqF3B,CAAC"}
@@ -1,82 +0,0 @@
1
- let sentryPromise = null;
2
- function getSentry() {
3
- if (!sentryPromise) {
4
- // keep the import fully dynamic and untyped so TS doesn't require the module at build time
5
- sentryPromise = Function("return import('@sentry/nextjs')")().then((m) => m);
6
- }
7
- return sentryPromise;
8
- }
9
- export const SentryAdapter = {
10
- async init(options) {
11
- const enabled = options.enabled ?? true;
12
- if (!enabled || !options.dsn)
13
- return;
14
- const S = await getSentry();
15
- S.init({
16
- dsn: options.dsn,
17
- environment: options.environment,
18
- enabled: true,
19
- release: options.release,
20
- });
21
- },
22
- captureException(error, context) {
23
- void (async () => {
24
- const S = await getSentry();
25
- if (context && S.withScope) {
26
- S.withScope((scope) => {
27
- for (const [k, v] of Object.entries(context)) {
28
- if (typeof scope?.setExtra === "function")
29
- scope.setExtra(k, v);
30
- }
31
- S.captureException(error);
32
- });
33
- return;
34
- }
35
- S.captureException(error);
36
- })();
37
- },
38
- captureMessage(message, level) {
39
- void (async () => {
40
- const S = await getSentry();
41
- S.captureMessage(message, level);
42
- })();
43
- },
44
- setUser(user) {
45
- void (async () => {
46
- const S = await getSentry();
47
- S.setUser(user);
48
- })();
49
- },
50
- setTag(key, value) {
51
- void (async () => {
52
- const S = await getSentry();
53
- S.setTag(key, value);
54
- })();
55
- },
56
- withScope(fn) {
57
- // run immediately (sync) with a minimal scope.
58
- // also try to run in real Sentry scope when available.
59
- const minimalScope = {
60
- setTag: () => { },
61
- setUser: () => { },
62
- setExtra: () => { },
63
- setContext: () => { },
64
- };
65
- void (async () => {
66
- const S = await getSentry();
67
- if (!S.withScope)
68
- return;
69
- S.withScope((scope) => fn(scope));
70
- })();
71
- return fn(minimalScope);
72
- },
73
- addBreadcrumb(breadcrumb) {
74
- void (async () => {
75
- const S = await getSentry();
76
- if (S.addBreadcrumb) {
77
- S.addBreadcrumb(breadcrumb);
78
- }
79
- })();
80
- },
81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5B,IAAI,CAAC,CAAC,CAAC,SAAS;gBAAE,OAAO;YACzB,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,KAAY,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,EAAE,CAAC;QAEL,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAED,aAAa,CAAC,UAKb;QACC,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,CAAC,GAAG,MAAM,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;gBACpB,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;CACF,CAAC"}
@@ -1,111 +0,0 @@
1
- import type { MonitoringAdapter } from "../adapter";
2
- import type { MonitoringInitOptions, MonitoringUser, ScopeLike } from "../types";
3
-
4
- type SentryLike = {
5
- init: (opts: any) => void;
6
- captureException: (e: unknown) => void;
7
- captureMessage: (m: string, level?: any) => void;
8
- setUser: (u: any) => void;
9
- setTag: (k: string, v: string) => void;
10
- withScope?: (fn: (scope: any) => void) => void;
11
- addBreadcrumb?: (breadcrumb: any) => void;
12
- };
13
-
14
- let sentryPromise: Promise<SentryLike> | null = null;
15
-
16
- function getSentry(): Promise<SentryLike> {
17
- if (!sentryPromise) {
18
- // keep the import fully dynamic and untyped so TS doesn't require the module at build time
19
- sentryPromise = (Function("return import('@sentry/nextjs')")() as Promise<any>).then(
20
- (m) => m as SentryLike
21
- );
22
- }
23
- return sentryPromise;
24
- }
25
-
26
- export const SentryAdapter: MonitoringAdapter = {
27
- async init(options: MonitoringInitOptions) {
28
- const enabled = options.enabled ?? true;
29
- if (!enabled || !options.dsn) return;
30
-
31
- const S = await getSentry();
32
- S.init({
33
- dsn: options.dsn,
34
- environment: options.environment,
35
- enabled: true,
36
- release: options.release,
37
- });
38
- },
39
-
40
- captureException(error: unknown, context?: Record<string, unknown>) {
41
- void (async () => {
42
- const S = await getSentry();
43
-
44
- if (context && S.withScope) {
45
- S.withScope((scope) => {
46
- for (const [k, v] of Object.entries(context)) {
47
- if (typeof scope?.setExtra === "function") scope.setExtra(k, v);
48
- }
49
- S.captureException(error);
50
- });
51
- return;
52
- }
53
-
54
- S.captureException(error);
55
- })();
56
- },
57
-
58
- captureMessage(message: string, level?: any) {
59
- void (async () => {
60
- const S = await getSentry();
61
- S.captureMessage(message, level);
62
- })();
63
- },
64
-
65
- setUser(user: MonitoringUser | null) {
66
- void (async () => {
67
- const S = await getSentry();
68
- S.setUser(user as any);
69
- })();
70
- },
71
-
72
- setTag(key: string, value: string) {
73
- void (async () => {
74
- const S = await getSentry();
75
- S.setTag(key, value);
76
- })();
77
- },
78
-
79
- withScope<T>(fn: (scope: ScopeLike) => T): T {
80
- // run immediately (sync) with a minimal scope.
81
- // also try to run in real Sentry scope when available.
82
- const minimalScope: ScopeLike = {
83
- setTag: () => {},
84
- setUser: () => {},
85
- setExtra: () => {},
86
- setContext: () => {},
87
- };
88
-
89
- void (async () => {
90
- const S = await getSentry();
91
- if (!S.withScope) return;
92
- S.withScope((scope) => fn(scope as any));
93
- })();
94
-
95
- return fn(minimalScope);
96
- },
97
-
98
- addBreadcrumb(breadcrumb: {
99
- category?: string;
100
- message?: string;
101
- level?: "fatal" | "error" | "warning" | "info" | "debug";
102
- data?: Record<string, unknown>;
103
- }) {
104
- void (async () => {
105
- const S = await getSentry();
106
- if (S.addBreadcrumb) {
107
- S.addBreadcrumb(breadcrumb);
108
- }
109
- })();
110
- },
111
- };
package/src/api.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import type { MonitoringUser } from "./types";
2
- export declare function captureException(error: unknown, context?: Record<string, unknown>): void;
3
- export declare function captureMessage(message: string, level?: "fatal" | "error" | "warning" | "info" | "debug"): void;
4
- export declare function setUser(user: MonitoringUser | null): void;
5
- export declare function setTag(key: string, value: string): void;
6
- export declare function withScope(fn: (scope: any) => any): any;
7
- export declare function addBreadcrumb(breadcrumb: {
8
- category?: string;
9
- message?: string;
10
- level?: "fatal" | "error" | "warning" | "info" | "debug";
11
- data?: Record<string, unknown>;
12
- }): void;
13
- //# sourceMappingURL=api.d.ts.map
package/src/api.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAEjF;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,QAGzD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,QAElD;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAEhD;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,OAQhD;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,QAKA"}
package/src/api.js DELETED
@@ -1,29 +0,0 @@
1
- import { getMonitoringAdapter } from "./init";
2
- export function captureException(error, context) {
3
- return getMonitoringAdapter().captureException(error, context);
4
- }
5
- export function captureMessage(message, level) {
6
- return getMonitoringAdapter().captureMessage(message, level);
7
- }
8
- export function setUser(user) {
9
- return getMonitoringAdapter().setUser(user);
10
- }
11
- export function setTag(key, value) {
12
- return getMonitoringAdapter().setTag(key, value);
13
- }
14
- export function withScope(fn) {
15
- const a = getMonitoringAdapter();
16
- return a.withScope ? a.withScope(fn) : fn({
17
- setTag: () => { },
18
- setUser: () => { },
19
- setExtra: () => { },
20
- setContext: () => { },
21
- });
22
- }
23
- export function addBreadcrumb(breadcrumb) {
24
- const a = getMonitoringAdapter();
25
- if (a.addBreadcrumb) {
26
- a.addBreadcrumb(breadcrumb);
27
- }
28
- }
29
- //# sourceMappingURL=api.js.map
package/src/api.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,UAAU,gBAAgB,CAAC,KAAc,EAAE,OAAiC;IAChF,OAAO,oBAAoB,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,KAAwD;IAExD,OAAO,oBAAoB,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAA2B;IACjD,OAAO,oBAAoB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,KAAa;IAC/C,OAAO,oBAAoB,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAuB;IAC/C,MAAM,CAAC,GAAG,oBAAoB,EAAE,CAAC;IACjC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;QAChB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;QAClB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;KACrB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAK7B;IACC,MAAM,CAAC,GAAG,oBAAoB,EAAE,CAAC;IACjC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;QACpB,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
package/src/api.ts DELETED
@@ -1,43 +0,0 @@
1
- import type { MonitoringUser } from "./types";
2
- import { getMonitoringAdapter } from "./init";
3
-
4
- export function captureException(error: unknown, context?: Record<string, unknown>) {
5
- return getMonitoringAdapter().captureException(error, context);
6
- }
7
-
8
- export function captureMessage(
9
- message: string,
10
- level?: "fatal" | "error" | "warning" | "info" | "debug"
11
- ) {
12
- return getMonitoringAdapter().captureMessage(message, level);
13
- }
14
-
15
- export function setUser(user: MonitoringUser | null) {
16
- return getMonitoringAdapter().setUser(user);
17
- }
18
-
19
- export function setTag(key: string, value: string) {
20
- return getMonitoringAdapter().setTag(key, value);
21
- }
22
-
23
- export function withScope(fn: (scope: any) => any) {
24
- const a = getMonitoringAdapter();
25
- return a.withScope ? a.withScope(fn as any) : fn({
26
- setTag: () => {},
27
- setUser: () => {},
28
- setExtra: () => {},
29
- setContext: () => {},
30
- });
31
- }
32
-
33
- export function addBreadcrumb(breadcrumb: {
34
- category?: string;
35
- message?: string;
36
- level?: "fatal" | "error" | "warning" | "info" | "debug";
37
- data?: Record<string, unknown>;
38
- }) {
39
- const a = getMonitoringAdapter();
40
- if (a.addBreadcrumb) {
41
- a.addBreadcrumb(breadcrumb);
42
- }
43
- }
package/src/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export type { MonitoringInitOptions, MonitoringUser, MonitoringProvider, ScopeLike } from "./types";
2
- export { initMonitoring } from "./init";
3
- export { captureException, captureMessage, setUser, setTag, withScope, addBreadcrumb } from "./api";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
package/src/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { initMonitoring } from "./init";
2
- export { captureException, captureMessage, setUser, setTag, withScope, addBreadcrumb } from "./api";
3
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export type { MonitoringInitOptions, MonitoringUser, MonitoringProvider, ScopeLike } from "./types";
2
-
3
- export { initMonitoring } from "./init";
4
- export { captureException, captureMessage, setUser, setTag, withScope, addBreadcrumb } from "./api";
package/src/init.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { MonitoringAdapter } from "./adapter";
2
- import type { MonitoringInitOptions } from "./types";
3
- export declare function getMonitoringAdapter(): MonitoringAdapter;
4
- export declare function initMonitoring(options: MonitoringInitOptions): Promise<void>;
5
- //# sourceMappingURL=init.d.ts.map
package/src/init.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAQrD,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BlF"}
package/src/init.js DELETED
@@ -1,33 +0,0 @@
1
- import { NoopAdapter } from "./adapters/noop";
2
- import { SentryAdapter } from "./adapters/sentry";
3
- import { SentryNodeAdapter } from "./adapters/sentry-node";
4
- let adapter = NoopAdapter;
5
- let initialized = false;
6
- export function getMonitoringAdapter() {
7
- return adapter;
8
- }
9
- export async function initMonitoring(options) {
10
- if (initialized)
11
- return;
12
- const enabled = options.enabled ?? true;
13
- if (!enabled || options.provider === "noop") {
14
- adapter = NoopAdapter;
15
- initialized = true;
16
- return;
17
- }
18
- if (options.provider === "sentry") {
19
- adapter = SentryAdapter;
20
- await adapter.init(options);
21
- initialized = true;
22
- return;
23
- }
24
- if (options.provider === "sentry-node") {
25
- adapter = SentryNodeAdapter;
26
- await adapter.init(options);
27
- initialized = true;
28
- return;
29
- }
30
- adapter = NoopAdapter;
31
- initialized = true;
32
- }
33
- //# sourceMappingURL=init.js.map
package/src/init.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,IAAI,OAAO,GAAsB,WAAW,CAAC;AAC7C,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAA8B;IACjE,IAAI,WAAW;QAAE,OAAO;IAExB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;IAExC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC5C,OAAO,GAAG,WAAW,CAAC;QACtB,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,GAAG,aAAa,CAAC;QACxB,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QACvC,OAAO,GAAG,iBAAiB,CAAC;QAC5B,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO;IACT,CAAC;IAED,OAAO,GAAG,WAAW,CAAC;IACtB,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC"}
package/src/init.ts DELETED
@@ -1,41 +0,0 @@
1
- import type { MonitoringAdapter } from "./adapter";
2
- import type { MonitoringInitOptions } from "./types";
3
- import { NoopAdapter } from "./adapters/noop";
4
- import { SentryAdapter } from "./adapters/sentry";
5
- import { SentryNodeAdapter } from "./adapters/sentry-node";
6
-
7
- let adapter: MonitoringAdapter = NoopAdapter;
8
- let initialized = false;
9
-
10
- export function getMonitoringAdapter(): MonitoringAdapter {
11
- return adapter;
12
- }
13
-
14
- export async function initMonitoring(options: MonitoringInitOptions): Promise<void> {
15
- if (initialized) return;
16
-
17
- const enabled = options.enabled ?? true;
18
-
19
- if (!enabled || options.provider === "noop") {
20
- adapter = NoopAdapter;
21
- initialized = true;
22
- return;
23
- }
24
-
25
- if (options.provider === "sentry") {
26
- adapter = SentryAdapter;
27
- await adapter.init(options);
28
- initialized = true;
29
- return;
30
- }
31
-
32
- if (options.provider === "sentry-node") {
33
- adapter = SentryNodeAdapter;
34
- await adapter.init(options);
35
- initialized = true;
36
- return;
37
- }
38
-
39
- adapter = NoopAdapter;
40
- initialized = true;
41
- }
package/src/types.d.ts DELETED
@@ -1,21 +0,0 @@
1
- export type MonitoringProvider = "sentry" | "sentry-node" | "noop";
2
- export type MonitoringInitOptions = {
3
- provider: MonitoringProvider;
4
- dsn?: string;
5
- environment?: string;
6
- enabled?: boolean;
7
- release?: string;
8
- };
9
- export type MonitoringUser = {
10
- id?: string;
11
- email?: string;
12
- username?: string;
13
- ip_address?: string;
14
- };
15
- export type ScopeLike = {
16
- setTag: (key: string, value: string) => void;
17
- setUser: (user: MonitoringUser | null) => void;
18
- setExtra: (key: string, value: unknown) => void;
19
- setContext: (key: string, context: Record<string, unknown>) => void;
20
- };
21
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACrE,CAAC"}
package/src/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/src/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":""}
package/src/types.ts DELETED
@@ -1,23 +0,0 @@
1
- export type MonitoringProvider = "sentry" | "sentry-node" | "noop";
2
-
3
- export type MonitoringInitOptions = {
4
- provider: MonitoringProvider;
5
- dsn?: string;
6
- environment?: string;
7
- enabled?: boolean; // default true
8
- release?: string;
9
- };
10
-
11
- export type MonitoringUser = {
12
- id?: string;
13
- email?: string;
14
- username?: string;
15
- ip_address?: string;
16
- };
17
-
18
- export type ScopeLike = {
19
- setTag: (key: string, value: string) => void;
20
- setUser: (user: MonitoringUser | null) => void;
21
- setExtra: (key: string, value: unknown) => void;
22
- setContext: (key: string, context: Record<string, unknown>) => void;
23
- };
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "declaration": true,
7
- "declarationMap": true,
8
- "sourceMap": true,
9
- "outDir": "dist",
10
- "rootDir": "src",
11
- "strict": true,
12
- "esModuleInterop": true,
13
- "skipLibCheck": true,
14
- "forceConsistentCasingInFileNames": true
15
- },
16
- "include": ["src"],
17
- "exclude": ["node_modules", "dist"]
18
- }