@xifan052/monitor 0.1.6 → 0.1.8

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xifan052/monitor",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -44,7 +44,6 @@
44
44
  "vitest": "^1"
45
45
  },
46
46
  "dependencies": {
47
- "tsup": "^8.5.1",
48
- "tslib": "^2.8.1"
47
+ "tsup": "^8.5.1"
49
48
  }
50
49
  }
@@ -1,5 +0,0 @@
1
- import * as Sentry from "@sentry/react-native";
2
- import { BaseClient } from "../../core/baseClient";
3
- export declare class RNMonitorClient extends BaseClient {
4
- constructor(options: Sentry.ReactNativeOptions);
5
- }
@@ -1,7 +0,0 @@
1
- import * as Sentry from "@sentry/react-native";
2
- import { BaseClient } from "../../core/baseClient";
3
- export class RNMonitorClient extends BaseClient {
4
- constructor(options) {
5
- super(Sentry, options);
6
- }
7
- }
@@ -1,5 +0,0 @@
1
- import * as Sentry from "@sentry/browser";
2
- import { BaseClient } from "../../core/baseClient";
3
- export declare class WebMonitorClient extends BaseClient {
4
- constructor(options: Sentry.BrowserOptions);
5
- }
@@ -1,7 +0,0 @@
1
- import * as Sentry from "@sentry/browser";
2
- import { BaseClient } from "../../core/baseClient";
3
- export class WebMonitorClient extends BaseClient {
4
- constructor(options) {
5
- super(Sentry, options);
6
- }
7
- }
@@ -1,27 +0,0 @@
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 };
@@ -1,27 +0,0 @@
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 };
@@ -1,24 +0,0 @@
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 };
@@ -1,24 +0,0 @@
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 };
@@ -1,27 +0,0 @@
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 };
@@ -1,27 +0,0 @@
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 };
@@ -1,27 +0,0 @@
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 };
@@ -1,27 +0,0 @@
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 };
@@ -1,26 +0,0 @@
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 };
@@ -1,26 +0,0 @@
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 };
@@ -1,25 +0,0 @@
1
- interface MonitorUser {
2
- id?: string;
3
- email?: string;
4
- username?: string;
5
- }
6
- interface CaptureContext {
7
- tags?: Record<string, string>;
8
- extra?: Record<string, any>;
9
- }
10
-
11
- /**
12
- * 通用的 Sentry 客户端实现
13
- * 接受 Sentry 实例和初始化选项作为参数
14
- */
15
- declare class BaseClient {
16
- private sentry;
17
- private options;
18
- constructor(sentry: any, options: any);
19
- init(): void;
20
- captureException(error: Error, ctx?: CaptureContext): void;
21
- captureMessage(message: string, ctx?: CaptureContext): void;
22
- setUser(user: MonitorUser | null): void;
23
- }
24
-
25
- export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -1,25 +0,0 @@
1
- interface MonitorUser {
2
- id?: string;
3
- email?: string;
4
- username?: string;
5
- }
6
- interface CaptureContext {
7
- tags?: Record<string, string>;
8
- extra?: Record<string, any>;
9
- }
10
-
11
- /**
12
- * 通用的 Sentry 客户端实现
13
- * 接受 Sentry 实例和初始化选项作为参数
14
- */
15
- declare class BaseClient {
16
- private sentry;
17
- private options;
18
- constructor(sentry: any, options: any);
19
- init(): void;
20
- captureException(error: Error, ctx?: CaptureContext): void;
21
- captureMessage(message: string, ctx?: CaptureContext): void;
22
- setUser(user: MonitorUser | null): void;
23
- }
24
-
25
- export { BaseClient as B, type CaptureContext as C, type MonitorUser as M };
@@ -1,14 +0,0 @@
1
- import type { CaptureContext, MonitorUser } from "./types";
2
- /**
3
- * 通用的 Sentry 客户端实现
4
- * 接受 Sentry 实例和初始化选项作为参数
5
- */
6
- export declare class BaseClient {
7
- private sentry;
8
- private options;
9
- constructor(sentry: any, options: any);
10
- init(): void;
11
- captureException(error: Error, ctx?: CaptureContext): void;
12
- captureMessage(message: string, ctx?: CaptureContext): void;
13
- setUser(user: MonitorUser | null): void;
14
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * 通用的 Sentry 客户端实现
3
- * 接受 Sentry 实例和初始化选项作为参数
4
- */
5
- export class BaseClient {
6
- constructor(sentry, options) {
7
- this.sentry = sentry;
8
- this.options = options;
9
- }
10
- init() {
11
- this.sentry.init(this.options);
12
- }
13
- captureException(error, ctx) {
14
- this.sentry.captureException(error, (scope) => {
15
- (ctx === null || ctx === void 0 ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
16
- (ctx === null || ctx === void 0 ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
17
- return scope;
18
- });
19
- }
20
- captureMessage(message, ctx) {
21
- this.sentry.captureMessage(message, (scope) => {
22
- (ctx === null || ctx === void 0 ? void 0 : ctx.tags) && scope.setTags(ctx.tags);
23
- (ctx === null || ctx === void 0 ? void 0 : ctx.extra) && scope.setExtras(ctx.extra);
24
- return scope;
25
- });
26
- }
27
- setUser(user) {
28
- this.sentry.setUser(user);
29
- }
30
- }
@@ -1,9 +0,0 @@
1
- export interface MonitorUser {
2
- id?: string;
3
- email?: string;
4
- username?: string;
5
- }
6
- export interface CaptureContext {
7
- tags?: Record<string, string>;
8
- extra?: Record<string, any>;
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { BaseClient } from "../core/baseClient";
3
- class MockClient extends BaseClient {
4
- constructor() {
5
- super({
6
- init: () => { },
7
- captureException: () => { },
8
- captureMessage: () => { },
9
- setUser: () => { },
10
- }, {});
11
- }
12
- }
13
- describe("SentryMonitorClient", () => {
14
- it("should instantiate", () => {
15
- const client = new MockClient();
16
- expect(client).toBeInstanceOf(BaseClient);
17
- });
18
- });