@xifan052/monitor 0.1.3 → 0.1.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.
@@ -0,0 +1,27 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage1(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ get ErrorBoundary(): any;
25
+ }
26
+
27
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,27 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage1(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ get ErrorBoundary(): any;
25
+ }
26
+
27
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,24 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ declare abstract class BaseClient {
13
+ protected sentry: any;
14
+ protected options: any;
15
+ protected initialized: boolean;
16
+ constructor(sentry: any, options: any);
17
+ init(): void;
18
+ captureException(error: Error, ctx?: CaptureContext): void;
19
+ captureMessage(message: string, ctx?: CaptureContext): void;
20
+ setUser(user: MonitorUser): void;
21
+ get ErrorBoundary(): any;
22
+ }
23
+
24
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,24 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ declare abstract class BaseClient {
13
+ protected sentry: any;
14
+ protected options: any;
15
+ protected initialized: boolean;
16
+ constructor(sentry: any, options: any);
17
+ init(): void;
18
+ captureException(error: Error, ctx?: CaptureContext): void;
19
+ captureMessage(message: string, ctx?: CaptureContext): void;
20
+ setUser(user: MonitorUser): void;
21
+ get ErrorBoundary(): any;
22
+ }
23
+
24
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,27 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage1(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ ErrorBoundary(): any;
25
+ }
26
+
27
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,27 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage1(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ ErrorBoundary(): any;
25
+ }
26
+
27
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,27 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ ErrorBoundary(): any;
25
+ }
26
+
27
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,27 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ ErrorBoundary(): any;
25
+ }
26
+
27
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,26 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage1(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ }
25
+
26
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -0,0 +1,26 @@
1
+ interface MonitorUser {
2
+ id?: string;
3
+ email?: string;
4
+ username?: string;
5
+ [key: string]: string | undefined;
6
+ }
7
+ interface CaptureContext {
8
+ tags?: Record<string, string>;
9
+ extra?: Record<string, any>;
10
+ }
11
+
12
+ /**
13
+ * 通用的 Sentry 客户端实现
14
+ * 接受 Sentry 实例和初始化选项作为参数
15
+ */
16
+ declare class BaseClient {
17
+ private sentry;
18
+ private options;
19
+ constructor(sentry: any, options: any);
20
+ init(): void;
21
+ captureException(error: Error, ctx?: CaptureContext): void;
22
+ captureMessage1(message: string, ctx?: CaptureContext): void;
23
+ setUser(user: MonitorUser): void;
24
+ }
25
+
26
+ export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
package/dist/index.cjs CHANGED
@@ -1 +1,93 @@
1
- "use strict";var m=Object.create;var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!l.call(e,n)&&n!==r&&a(e,n,{get:()=>t[n],enumerable:!(s=g(t,n))||s.enumerable});return e};var y=(e,t,r)=>(r=e!=null?m(C(e)):{},u(t||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),E=e=>u(a({},"__esModule",{value:!0}),e);var U={};h(U,{RNMonitorClient:()=>p,WebMonitorClient:()=>i});module.exports=E(U);var M=y(require("@sentry/browser"),1);var o=class{constructor(t,r){this.sentry=t;this.options=r}init(){this.sentry.init(this.options)}captureException(t,r){this.sentry.captureException(t,s=>(r!=null&&r.tags&&s.setTags(r.tags),r!=null&&r.extra&&s.setExtras(r.extra),s))}captureMessage(t,r){this.sentry.captureMessage(t,s=>(r!=null&&r.tags&&s.setTags(r.tags),r!=null&&r.extra&&s.setExtras(r.extra),s))}setUser(t){this.sentry.setUser(t)}};var i=class extends o{constructor(t){super(M,t)}};var S=y(require("@sentry/react-native"),1);var p=class extends o{constructor(t){super(S,t)}};0&&(module.exports={RNMonitorClient,WebMonitorClient});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ RNMonitorClient: () => RNMonitorClient,
34
+ WebMonitorClient: () => WebMonitorClient
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // src/adapter/web/index.ts
39
+ var Sentry = __toESM(require("@sentry/react"), 1);
40
+
41
+ // src/core/baseClient.ts
42
+ var BaseClient = class {
43
+ constructor(sentry, options) {
44
+ this.sentry = sentry;
45
+ this.options = options;
46
+ this.initialized = false;
47
+ }
48
+ init() {
49
+ if (this.initialized) return;
50
+ this.sentry.init(this.options);
51
+ this.initialized = true;
52
+ }
53
+ captureException(error, ctx) {
54
+ this.sentry.captureException(error, (scope) => {
55
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
56
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
57
+ return scope;
58
+ });
59
+ }
60
+ captureMessage(message, ctx) {
61
+ this.sentry.captureMessage(message, (scope) => {
62
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
63
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
64
+ return scope;
65
+ });
66
+ }
67
+ setUser(user) {
68
+ this.sentry.setUser(user);
69
+ }
70
+ get ErrorBoundary() {
71
+ return this.sentry.ErrorBoundary;
72
+ }
73
+ };
74
+
75
+ // src/adapter/web/index.ts
76
+ var WebMonitorClient = class extends BaseClient {
77
+ constructor(options) {
78
+ super(Sentry, options);
79
+ }
80
+ };
81
+
82
+ // src/adapter/rn/index.ts
83
+ var Sentry2 = __toESM(require("@sentry/react-native"), 1);
84
+ var RNMonitorClient = class extends BaseClient {
85
+ constructor(options) {
86
+ super(Sentry2, options);
87
+ }
88
+ };
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ RNMonitorClient,
92
+ WebMonitorClient
93
+ });
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- export { C as CaptureContext, M as MonitorUser } from './baseClient-c4uYDw25.cjs';
1
+ export { C as CaptureContext, M as MonitorUser } from './baseClient-C7eELcmN.cjs';
2
2
  export { WebMonitorClient } from './web.cjs';
3
3
  export { RNMonitorClient } from './rn.cjs';
4
- import '@sentry/browser';
4
+ import '@sentry/react';
5
5
  import '@sentry/react-native';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { C as CaptureContext, M as MonitorUser } from './baseClient-c4uYDw25.js';
1
+ export { C as CaptureContext, M as MonitorUser } from './baseClient-C7eELcmN.js';
2
2
  export { WebMonitorClient } from './web.js';
3
3
  export { RNMonitorClient } from './rn.js';
4
- import '@sentry/browser';
4
+ import '@sentry/react';
5
5
  import '@sentry/react-native';
package/dist/index.js CHANGED
@@ -1 +1,55 @@
1
- import*as i from"@sentry/browser";var s=class{constructor(t,r){this.sentry=t;this.options=r}init(){this.sentry.init(this.options)}captureException(t,r){this.sentry.captureException(t,e=>(r!=null&&r.tags&&e.setTags(r.tags),r!=null&&r.extra&&e.setExtras(r.extra),e))}captureMessage(t,r){this.sentry.captureMessage(t,e=>(r!=null&&r.tags&&e.setTags(r.tags),r!=null&&r.extra&&e.setExtras(r.extra),e))}setUser(t){this.sentry.setUser(t)}};var o=class extends s{constructor(t){super(i,t)}};import*as p from"@sentry/react-native";var n=class extends s{constructor(t){super(p,t)}};export{n as RNMonitorClient,o as WebMonitorClient};
1
+ // src/adapter/web/index.ts
2
+ import * as Sentry from "@sentry/react";
3
+
4
+ // src/core/baseClient.ts
5
+ var BaseClient = class {
6
+ constructor(sentry, options) {
7
+ this.sentry = sentry;
8
+ this.options = options;
9
+ this.initialized = false;
10
+ }
11
+ init() {
12
+ if (this.initialized) return;
13
+ this.sentry.init(this.options);
14
+ this.initialized = true;
15
+ }
16
+ captureException(error, ctx) {
17
+ this.sentry.captureException(error, (scope) => {
18
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
19
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
20
+ return scope;
21
+ });
22
+ }
23
+ captureMessage(message, ctx) {
24
+ this.sentry.captureMessage(message, (scope) => {
25
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
26
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
27
+ return scope;
28
+ });
29
+ }
30
+ setUser(user) {
31
+ this.sentry.setUser(user);
32
+ }
33
+ get ErrorBoundary() {
34
+ return this.sentry.ErrorBoundary;
35
+ }
36
+ };
37
+
38
+ // src/adapter/web/index.ts
39
+ var WebMonitorClient = class extends BaseClient {
40
+ constructor(options) {
41
+ super(Sentry, options);
42
+ }
43
+ };
44
+
45
+ // src/adapter/rn/index.ts
46
+ import * as Sentry2 from "@sentry/react-native";
47
+ var RNMonitorClient = class extends BaseClient {
48
+ constructor(options) {
49
+ super(Sentry2, options);
50
+ }
51
+ };
52
+ export {
53
+ RNMonitorClient,
54
+ WebMonitorClient
55
+ };
package/dist/rn.cjs CHANGED
@@ -1 +1,81 @@
1
- "use strict";var u=Object.create;var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},p=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of g(e))!h.call(t,a)&&a!==r&&n(t,a,{get:()=>e[a],enumerable:!(s=y(e,a))||s.enumerable});return t};var E=(t,e,r)=>(r=t!=null?u(m(t)):{},p(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>p(n({},"__esModule",{value:!0}),t);var l={};C(l,{RNMonitorClient:()=>o});module.exports=U(l);var f=E(require("@sentry/react-native"),1);var i=class{constructor(e,r){this.sentry=e;this.options=r}init(){this.sentry.init(this.options)}captureException(e,r){this.sentry.captureException(e,s=>(r!=null&&r.tags&&s.setTags(r.tags),r!=null&&r.extra&&s.setExtras(r.extra),s))}captureMessage(e,r){this.sentry.captureMessage(e,s=>(r!=null&&r.tags&&s.setTags(r.tags),r!=null&&r.extra&&s.setExtras(r.extra),s))}setUser(e){this.sentry.setUser(e)}};var o=class extends i{constructor(e){super(f,e)}};0&&(module.exports={RNMonitorClient});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/adapter/rn/index.ts
31
+ var rn_exports = {};
32
+ __export(rn_exports, {
33
+ RNMonitorClient: () => RNMonitorClient
34
+ });
35
+ module.exports = __toCommonJS(rn_exports);
36
+ var Sentry = __toESM(require("@sentry/react-native"), 1);
37
+
38
+ // src/core/baseClient.ts
39
+ var BaseClient = class {
40
+ constructor(sentry, options) {
41
+ this.sentry = sentry;
42
+ this.options = options;
43
+ this.initialized = false;
44
+ }
45
+ init() {
46
+ if (this.initialized) return;
47
+ this.sentry.init(this.options);
48
+ this.initialized = true;
49
+ }
50
+ captureException(error, ctx) {
51
+ this.sentry.captureException(error, (scope) => {
52
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
53
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
54
+ return scope;
55
+ });
56
+ }
57
+ captureMessage(message, ctx) {
58
+ this.sentry.captureMessage(message, (scope) => {
59
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
60
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
61
+ return scope;
62
+ });
63
+ }
64
+ setUser(user) {
65
+ this.sentry.setUser(user);
66
+ }
67
+ get ErrorBoundary() {
68
+ return this.sentry.ErrorBoundary;
69
+ }
70
+ };
71
+
72
+ // src/adapter/rn/index.ts
73
+ var RNMonitorClient = class extends BaseClient {
74
+ constructor(options) {
75
+ super(Sentry, options);
76
+ }
77
+ };
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ RNMonitorClient
81
+ });
package/dist/rn.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Sentry from '@sentry/react-native';
2
- import { B as BaseClient } from './baseClient-c4uYDw25.cjs';
2
+ import { B as BaseClient } from './baseClient-C7eELcmN.cjs';
3
3
 
4
4
  declare class RNMonitorClient extends BaseClient {
5
5
  constructor(options: Sentry.ReactNativeOptions);
package/dist/rn.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Sentry from '@sentry/react-native';
2
- import { B as BaseClient } from './baseClient-c4uYDw25.js';
2
+ import { B as BaseClient } from './baseClient-C7eELcmN.js';
3
3
 
4
4
  declare class RNMonitorClient extends BaseClient {
5
5
  constructor(options: Sentry.ReactNativeOptions);
package/dist/rn.js CHANGED
@@ -1 +1,46 @@
1
- import*as i from"@sentry/react-native";var s=class{constructor(e,r){this.sentry=e;this.options=r}init(){this.sentry.init(this.options)}captureException(e,r){this.sentry.captureException(e,t=>(r!=null&&r.tags&&t.setTags(r.tags),r!=null&&r.extra&&t.setExtras(r.extra),t))}captureMessage(e,r){this.sentry.captureMessage(e,t=>(r!=null&&r.tags&&t.setTags(r.tags),r!=null&&r.extra&&t.setExtras(r.extra),t))}setUser(e){this.sentry.setUser(e)}};var a=class extends s{constructor(e){super(i,e)}};export{a as RNMonitorClient};
1
+ // src/adapter/rn/index.ts
2
+ import * as Sentry from "@sentry/react-native";
3
+
4
+ // src/core/baseClient.ts
5
+ var BaseClient = class {
6
+ constructor(sentry, options) {
7
+ this.sentry = sentry;
8
+ this.options = options;
9
+ this.initialized = false;
10
+ }
11
+ init() {
12
+ if (this.initialized) return;
13
+ this.sentry.init(this.options);
14
+ this.initialized = true;
15
+ }
16
+ captureException(error, ctx) {
17
+ this.sentry.captureException(error, (scope) => {
18
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
19
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
20
+ return scope;
21
+ });
22
+ }
23
+ captureMessage(message, ctx) {
24
+ this.sentry.captureMessage(message, (scope) => {
25
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
26
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
27
+ return scope;
28
+ });
29
+ }
30
+ setUser(user) {
31
+ this.sentry.setUser(user);
32
+ }
33
+ get ErrorBoundary() {
34
+ return this.sentry.ErrorBoundary;
35
+ }
36
+ };
37
+
38
+ // src/adapter/rn/index.ts
39
+ var RNMonitorClient = class extends BaseClient {
40
+ constructor(options) {
41
+ super(Sentry, options);
42
+ }
43
+ };
44
+ export {
45
+ RNMonitorClient
46
+ };
package/dist/web.cjs CHANGED
@@ -1 +1,81 @@
1
- "use strict";var u=Object.create;var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var C=(s,e)=>{for(var r in e)n(s,r,{get:e[r],enumerable:!0})},p=(s,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of g(e))!h.call(s,a)&&a!==r&&n(s,a,{get:()=>e[a],enumerable:!(t=y(e,a))||t.enumerable});return s};var E=(s,e,r)=>(r=s!=null?u(m(s)):{},p(e||!s||!s.__esModule?n(r,"default",{value:s,enumerable:!0}):r,s)),U=s=>p(n({},"__esModule",{value:!0}),s);var l={};C(l,{WebMonitorClient:()=>i});module.exports=U(l);var f=E(require("@sentry/browser"),1);var o=class{constructor(e,r){this.sentry=e;this.options=r}init(){this.sentry.init(this.options)}captureException(e,r){this.sentry.captureException(e,t=>(r!=null&&r.tags&&t.setTags(r.tags),r!=null&&r.extra&&t.setExtras(r.extra),t))}captureMessage(e,r){this.sentry.captureMessage(e,t=>(r!=null&&r.tags&&t.setTags(r.tags),r!=null&&r.extra&&t.setExtras(r.extra),t))}setUser(e){this.sentry.setUser(e)}};var i=class extends o{constructor(e){super(f,e)}};0&&(module.exports={WebMonitorClient});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/adapter/web/index.ts
31
+ var web_exports = {};
32
+ __export(web_exports, {
33
+ WebMonitorClient: () => WebMonitorClient
34
+ });
35
+ module.exports = __toCommonJS(web_exports);
36
+ var Sentry = __toESM(require("@sentry/react"), 1);
37
+
38
+ // src/core/baseClient.ts
39
+ var BaseClient = class {
40
+ constructor(sentry, options) {
41
+ this.sentry = sentry;
42
+ this.options = options;
43
+ this.initialized = false;
44
+ }
45
+ init() {
46
+ if (this.initialized) return;
47
+ this.sentry.init(this.options);
48
+ this.initialized = true;
49
+ }
50
+ captureException(error, ctx) {
51
+ this.sentry.captureException(error, (scope) => {
52
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
53
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
54
+ return scope;
55
+ });
56
+ }
57
+ captureMessage(message, ctx) {
58
+ this.sentry.captureMessage(message, (scope) => {
59
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
60
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
61
+ return scope;
62
+ });
63
+ }
64
+ setUser(user) {
65
+ this.sentry.setUser(user);
66
+ }
67
+ get ErrorBoundary() {
68
+ return this.sentry.ErrorBoundary;
69
+ }
70
+ };
71
+
72
+ // src/adapter/web/index.ts
73
+ var WebMonitorClient = class extends BaseClient {
74
+ constructor(options) {
75
+ super(Sentry, options);
76
+ }
77
+ };
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ WebMonitorClient
81
+ });
package/dist/web.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import * as Sentry from '@sentry/browser';
2
- import { B as BaseClient } from './baseClient-c4uYDw25.cjs';
1
+ import * as Sentry from '@sentry/react';
2
+ import { B as BaseClient } from './baseClient-C7eELcmN.cjs';
3
3
 
4
4
  declare class WebMonitorClient extends BaseClient {
5
5
  constructor(options: Sentry.BrowserOptions);
package/dist/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as Sentry from '@sentry/browser';
2
- import { B as BaseClient } from './baseClient-c4uYDw25.js';
1
+ import * as Sentry from '@sentry/react';
2
+ import { B as BaseClient } from './baseClient-C7eELcmN.js';
3
3
 
4
4
  declare class WebMonitorClient extends BaseClient {
5
5
  constructor(options: Sentry.BrowserOptions);
package/dist/web.js CHANGED
@@ -1 +1,46 @@
1
- import*as o from"@sentry/browser";var t=class{constructor(e,r){this.sentry=e;this.options=r}init(){this.sentry.init(this.options)}captureException(e,r){this.sentry.captureException(e,s=>(r!=null&&r.tags&&s.setTags(r.tags),r!=null&&r.extra&&s.setExtras(r.extra),s))}captureMessage(e,r){this.sentry.captureMessage(e,s=>(r!=null&&r.tags&&s.setTags(r.tags),r!=null&&r.extra&&s.setExtras(r.extra),s))}setUser(e){this.sentry.setUser(e)}};var a=class extends t{constructor(e){super(o,e)}};export{a as WebMonitorClient};
1
+ // src/adapter/web/index.ts
2
+ import * as Sentry from "@sentry/react";
3
+
4
+ // src/core/baseClient.ts
5
+ var BaseClient = class {
6
+ constructor(sentry, options) {
7
+ this.sentry = sentry;
8
+ this.options = options;
9
+ this.initialized = false;
10
+ }
11
+ init() {
12
+ if (this.initialized) return;
13
+ this.sentry.init(this.options);
14
+ this.initialized = true;
15
+ }
16
+ captureException(error, ctx) {
17
+ this.sentry.captureException(error, (scope) => {
18
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
19
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
20
+ return scope;
21
+ });
22
+ }
23
+ captureMessage(message, ctx) {
24
+ this.sentry.captureMessage(message, (scope) => {
25
+ (ctx == null ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
26
+ (ctx == null ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
27
+ return scope;
28
+ });
29
+ }
30
+ setUser(user) {
31
+ this.sentry.setUser(user);
32
+ }
33
+ get ErrorBoundary() {
34
+ return this.sentry.ErrorBoundary;
35
+ }
36
+ };
37
+
38
+ // src/adapter/web/index.ts
39
+ var WebMonitorClient = class extends BaseClient {
40
+ constructor(options) {
41
+ super(Sentry, options);
42
+ }
43
+ };
44
+ export {
45
+ WebMonitorClient
46
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xifan052/monitor",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  }
28
28
  },
29
29
  "peerDependencies": {
30
- "@sentry/browser": "^7",
30
+ "@sentry/react": "^7",
31
31
  "@sentry/react-native": "^5"
32
32
  },
33
33
  "devDependencies": {