@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.
- package/dist/baseClient-Bh0cdvk1.d.cts +27 -0
- package/dist/baseClient-Bh0cdvk1.d.ts +27 -0
- package/dist/baseClient-C7eELcmN.d.cts +24 -0
- package/dist/baseClient-C7eELcmN.d.ts +24 -0
- package/dist/baseClient-CRg861-R.d.cts +27 -0
- package/dist/baseClient-CRg861-R.d.ts +27 -0
- package/dist/baseClient-CwRxR6U7.d.cts +27 -0
- package/dist/baseClient-CwRxR6U7.d.ts +27 -0
- package/dist/baseClient-D1NnEbD8.d.cts +26 -0
- package/dist/baseClient-D1NnEbD8.d.ts +26 -0
- package/dist/index.cjs +93 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +55 -1
- package/dist/rn.cjs +81 -1
- package/dist/rn.d.cts +1 -1
- package/dist/rn.d.ts +1 -1
- package/dist/rn.js +46 -1
- package/dist/web.cjs +81 -1
- package/dist/web.d.cts +2 -2
- package/dist/web.d.ts +2 -2
- package/dist/web.js +46 -1
- package/package.json +2 -2
|
@@ -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";
|
|
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-
|
|
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/
|
|
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-
|
|
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/
|
|
4
|
+
import '@sentry/react';
|
|
5
5
|
import '@sentry/react-native';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,55 @@
|
|
|
1
|
-
|
|
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";
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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";
|
|
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/
|
|
2
|
-
import { B as BaseClient } from './baseClient-
|
|
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/
|
|
2
|
-
import { B as BaseClient } from './baseClient-
|
|
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
|
-
|
|
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
|
+
"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/
|
|
30
|
+
"@sentry/react": "^7",
|
|
31
31
|
"@sentry/react-native": "^5"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|