polyv-rum-sdk 0.1.2
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/.github/workflows/publish.yml +34 -0
- package/README.md +168 -0
- package/dist/index.d.mts +300 -0
- package/dist/index.d.ts +300 -0
- package/dist/index.js +1657 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1599 -0
- package/dist/index.mjs.map +1 -0
- package/jest.config.cjs +8 -0
- package/package.json +33 -0
- package/src/__tests__/SLSWebTrackingAdapter.test.ts +43 -0
- package/src/__tests__/config.test.ts +76 -0
- package/src/core/MitoSLSAdapter.ts +468 -0
- package/src/core/config.ts +338 -0
- package/src/core/env.ts +17 -0
- package/src/index.ts +26 -0
- package/src/transport/SLSWebTrackingAdapter.ts +602 -0
- package/src/types/external.d.ts +8 -0
- package/src/vue2/RUMManager.vue2.ts +455 -0
- package/src/vue2/plugin.vue2.ts +56 -0
- package/src/vue3/RUMManager.vue3.ts +56 -0
- package/src/vue3/plugin.vue3.ts +40 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Publish polyv-rum-sdk
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Use Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: 20
|
|
20
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm ci
|
|
24
|
+
|
|
25
|
+
- name: Run tests
|
|
26
|
+
run: npm test
|
|
27
|
+
|
|
28
|
+
- name: Build package
|
|
29
|
+
run: npm run build
|
|
30
|
+
|
|
31
|
+
- name: Publish to npm
|
|
32
|
+
env:
|
|
33
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
34
|
+
run: npm publish --access public
|
package/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# polyv-rum-sdk
|
|
2
|
+
|
|
3
|
+
Polyv RUM SDK,基于 **MitoJS + 阿里云 SLS Web Tracking** 的前端监控采集与日志上报库,支持:
|
|
4
|
+
|
|
5
|
+
- Core:与框架无关的采集与上报逻辑(MitoJS + SLS)。
|
|
6
|
+
- Vue2:与现有 `live-admin-v3` 的 RUM 使用方式 100% 兼容。
|
|
7
|
+
- Vue3:提供插件工厂与 `useRUM` composable。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install polyv-rum-sdk
|
|
13
|
+
# 或者使用 pnpm / yarn
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> 作为依赖使用时,不需要再单独安装 `@mitojs/browser` 和 `@aliyun-sls/web-track-browser`,它们已作为依赖内置。
|
|
17
|
+
|
|
18
|
+
## 环境变量
|
|
19
|
+
|
|
20
|
+
SDK 通过 `window.VUE_APP_ENV` 或 `process.env` 读取以下变量(与 `live-admin-v3` 保持一致):
|
|
21
|
+
|
|
22
|
+
- SLS 相关
|
|
23
|
+
- `VUE_APP_SLS_HOST`
|
|
24
|
+
- `VUE_APP_SLS_PROJECT`
|
|
25
|
+
- `VUE_APP_SLS_LOGSTORE`
|
|
26
|
+
- `VUE_APP_SLS_ENABLED`
|
|
27
|
+
- RUM 相关
|
|
28
|
+
- `VUE_APP_RUM_DSN`
|
|
29
|
+
- `VUE_APP_RUM_DEBUG`
|
|
30
|
+
- `VUE_APP_RUM_ENABLED`
|
|
31
|
+
- 通用
|
|
32
|
+
- `NODE_ENV`
|
|
33
|
+
- `MODE`
|
|
34
|
+
- `PACKAGE_VERSION`
|
|
35
|
+
|
|
36
|
+
## 使用方式
|
|
37
|
+
|
|
38
|
+
### Vue 2 项目(推荐)
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
// main.js
|
|
42
|
+
import Vue from 'vue';
|
|
43
|
+
import router from './router';
|
|
44
|
+
import store from './store';
|
|
45
|
+
import { initRUMSystemVue2 as initRUMSystem } from 'polyv-rum-sdk';
|
|
46
|
+
|
|
47
|
+
initRUMSystem(
|
|
48
|
+
{ store, router, Vue },
|
|
49
|
+
{
|
|
50
|
+
debug: import.meta.env.VUE_APP_RUM_DEBUG === 'true',
|
|
51
|
+
environment:
|
|
52
|
+
import.meta.env.MODE || import.meta.env.NODE_ENV || 'development'
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
业务代码中可以仍然通过 `this.$rum.xxx` 使用(在 `live-admin-v3` 中通过 alias 或统一替换即可):
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
this.$rum.trackEvent('event_name', { foo: 'bar' });
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
可用方法:
|
|
64
|
+
|
|
65
|
+
- `trackEvent(eventName, eventData?)`
|
|
66
|
+
- `trackPerformance(performanceData)`
|
|
67
|
+
- `trackAction(action, actionData?)`
|
|
68
|
+
- `trackMetric(metricName, value, dimensions?)`
|
|
69
|
+
- `getBreadcrumbs()`
|
|
70
|
+
- `enableRUM()` / `disableRUM()`
|
|
71
|
+
- `getRUMConfig()` / `destroyRUM()`
|
|
72
|
+
|
|
73
|
+
### Vue 3 项目(示例)
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { createApp } from 'vue';
|
|
77
|
+
import { createRUMPluginVue3 } from 'polyv-rum-sdk';
|
|
78
|
+
|
|
79
|
+
const app = createApp(App);
|
|
80
|
+
|
|
81
|
+
app
|
|
82
|
+
.use(store)
|
|
83
|
+
.use(router)
|
|
84
|
+
.use(
|
|
85
|
+
createRUMPluginVue3({
|
|
86
|
+
store,
|
|
87
|
+
router,
|
|
88
|
+
coreOptions: {
|
|
89
|
+
debug: import.meta.env.VUE_APP_RUM_DEBUG === 'true'
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
)
|
|
93
|
+
.mount('#app');
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
在组件中:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { useRUM } from 'polyv-rum-sdk';
|
|
100
|
+
|
|
101
|
+
const rum = useRUM();
|
|
102
|
+
rum?.trackEvent('event_name');
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Core 能力(非框架场景)
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { initRUMCore } from 'polyv-rum-sdk';
|
|
109
|
+
|
|
110
|
+
const adapter = await initRUMCore({});
|
|
111
|
+
adapter.trackEvent({ name: 'custom', foo: 'bar' });
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 本地开发
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# 安装依赖
|
|
118
|
+
npm install
|
|
119
|
+
|
|
120
|
+
# 构建
|
|
121
|
+
npm run build
|
|
122
|
+
|
|
123
|
+
# 运行单元测试
|
|
124
|
+
npm test
|
|
125
|
+
|
|
126
|
+
# 开发模式打包(watch)
|
|
127
|
+
npm run dev
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 发布与 GitHub Actions
|
|
131
|
+
|
|
132
|
+
本仓库自带一个 GitHub Actions 工作流 `.github/workflows/publish.yml`,用于在打 tag 时自动发布到 npm。
|
|
133
|
+
|
|
134
|
+
### 前置配置
|
|
135
|
+
|
|
136
|
+
1. 在 GitHub 仓库的 **Settings → Secrets and variables → Actions → New repository secret** 中添加:
|
|
137
|
+
- `NPM_TOKEN`: 拥有 `npm publish` 权限的 token。
|
|
138
|
+
2. 确认 `package.json` 中的包名 `"polyv-rum-sdk"` 在 npm 上可用(未被他人占用)。
|
|
139
|
+
|
|
140
|
+
### 发布流程
|
|
141
|
+
|
|
142
|
+
1. 在本地修改 `package.json` 的 `version` 字段,或使用:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npm version patch # 或 minor / major
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
2. 推送 tag:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
git push origin --tags
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
3. GitHub Actions 会在检测到 tag(形如 `v1.2.3`)后自动:
|
|
155
|
+
- 安装依赖
|
|
156
|
+
- 运行 `npm test`
|
|
157
|
+
- 运行 `npm run build`
|
|
158
|
+
- 执行 `npm publish --access public`
|
|
159
|
+
|
|
160
|
+
如需手动发布,也可以在本地执行:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npm test
|
|
164
|
+
npm run build
|
|
165
|
+
npm publish --access public
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
确保本地已通过 `npm login` 并具有发布权限。
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
|
|
3
|
+
interface RUMEnv {
|
|
4
|
+
[key: string]: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
declare const getRUMEnv: () => RUMEnv;
|
|
7
|
+
declare const RUM_ENV: RUMEnv;
|
|
8
|
+
|
|
9
|
+
interface SlsConfig {
|
|
10
|
+
host: string;
|
|
11
|
+
project: string;
|
|
12
|
+
logstore: string;
|
|
13
|
+
time: number;
|
|
14
|
+
count: number;
|
|
15
|
+
topic: string;
|
|
16
|
+
source: string;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
debug: boolean;
|
|
19
|
+
appName: string;
|
|
20
|
+
appVersion: string;
|
|
21
|
+
retryCount: number;
|
|
22
|
+
retryInterval: number;
|
|
23
|
+
}
|
|
24
|
+
declare const slsConfig: SlsConfig;
|
|
25
|
+
interface MitoSampleRateConfig {
|
|
26
|
+
error: number;
|
|
27
|
+
click: number;
|
|
28
|
+
route: number;
|
|
29
|
+
custom: number;
|
|
30
|
+
xhr: number;
|
|
31
|
+
}
|
|
32
|
+
interface MitoConfig {
|
|
33
|
+
dsn: string | null;
|
|
34
|
+
appName: string;
|
|
35
|
+
appVersion: string;
|
|
36
|
+
environment: string;
|
|
37
|
+
debug: boolean;
|
|
38
|
+
maxBreadcrumbs: number;
|
|
39
|
+
sampleRate: MitoSampleRateConfig;
|
|
40
|
+
vue: {
|
|
41
|
+
Vue?: any;
|
|
42
|
+
lifecycle: boolean;
|
|
43
|
+
performance: boolean;
|
|
44
|
+
};
|
|
45
|
+
network: {
|
|
46
|
+
xhr: boolean;
|
|
47
|
+
fetch: boolean;
|
|
48
|
+
ignoreUrls: (string | RegExp)[];
|
|
49
|
+
responseSizeLimit: number;
|
|
50
|
+
};
|
|
51
|
+
error: {
|
|
52
|
+
javascript: boolean;
|
|
53
|
+
promise: boolean;
|
|
54
|
+
resource: boolean;
|
|
55
|
+
ignoreErrors: (string | RegExp)[];
|
|
56
|
+
};
|
|
57
|
+
user: {
|
|
58
|
+
click: boolean;
|
|
59
|
+
route: boolean;
|
|
60
|
+
performance: boolean;
|
|
61
|
+
sensitiveSelectors: string[];
|
|
62
|
+
};
|
|
63
|
+
breadcrumb: {
|
|
64
|
+
console: boolean;
|
|
65
|
+
dom: boolean;
|
|
66
|
+
navigation: boolean;
|
|
67
|
+
customTypes: string[];
|
|
68
|
+
};
|
|
69
|
+
transport: {
|
|
70
|
+
type: 'xhr' | 'fetch' | 'image';
|
|
71
|
+
batch: {
|
|
72
|
+
size: number;
|
|
73
|
+
interval: number;
|
|
74
|
+
immediateOnError: boolean;
|
|
75
|
+
};
|
|
76
|
+
retry: {
|
|
77
|
+
times: number;
|
|
78
|
+
interval: number;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
declare const mitoConfig: MitoConfig;
|
|
83
|
+
interface TransformContext {
|
|
84
|
+
store?: any;
|
|
85
|
+
router?: any;
|
|
86
|
+
}
|
|
87
|
+
declare const getUserInfo: (store?: any) => any;
|
|
88
|
+
declare const transformDataForSLS: (data: any, context?: TransformContext) => any;
|
|
89
|
+
declare const shouldReport: (data: any) => boolean;
|
|
90
|
+
|
|
91
|
+
interface SLSAdapterConfig {
|
|
92
|
+
host?: string;
|
|
93
|
+
project?: string;
|
|
94
|
+
logstore?: string;
|
|
95
|
+
time?: number;
|
|
96
|
+
count?: number;
|
|
97
|
+
topic?: string;
|
|
98
|
+
source?: string;
|
|
99
|
+
environment?: string;
|
|
100
|
+
debug?: boolean;
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
userId?: string | null;
|
|
103
|
+
sessionId?: string;
|
|
104
|
+
appName?: string;
|
|
105
|
+
appVersion?: string;
|
|
106
|
+
retryCount?: number;
|
|
107
|
+
retryInterval?: number;
|
|
108
|
+
}
|
|
109
|
+
declare class SLSWebTrackingAdapter {
|
|
110
|
+
private config;
|
|
111
|
+
private slsTracker;
|
|
112
|
+
private isInitialized;
|
|
113
|
+
private isDestroyed;
|
|
114
|
+
private pendingLogs;
|
|
115
|
+
private retryQueue;
|
|
116
|
+
constructor(config?: SLSAdapterConfig);
|
|
117
|
+
init(): Promise<void>;
|
|
118
|
+
sendLog(data: Record<string, any>): Promise<void>;
|
|
119
|
+
sendBatchLogs(logs: Record<string, any>[]): Promise<void>;
|
|
120
|
+
transformLogData(data: Record<string, any>): Promise<Record<string, any>>;
|
|
121
|
+
private addErrorFields;
|
|
122
|
+
private addApiFields;
|
|
123
|
+
private addClickFields;
|
|
124
|
+
private filterSensitiveData;
|
|
125
|
+
private handleSendError;
|
|
126
|
+
private retryFailedLogs;
|
|
127
|
+
private shouldRetry;
|
|
128
|
+
private handleError;
|
|
129
|
+
private checkReady;
|
|
130
|
+
private generateSessionId;
|
|
131
|
+
handleBeforeSend(logData: any): boolean | Record<string, any>;
|
|
132
|
+
setUserId(userId: string): void;
|
|
133
|
+
updateConfig(newConfig: Partial<SLSAdapterConfig>): void;
|
|
134
|
+
getConfig(): SLSAdapterConfig;
|
|
135
|
+
getStats(): {
|
|
136
|
+
isInitialized: boolean;
|
|
137
|
+
isDestroyed: boolean;
|
|
138
|
+
pendingLogsCount: number;
|
|
139
|
+
retryQueueCount: number;
|
|
140
|
+
config: {
|
|
141
|
+
project: string | undefined;
|
|
142
|
+
logstore: string | undefined;
|
|
143
|
+
enabled: boolean | undefined;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
destroy(): void;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface MitoSLSAdapterOptions extends MitoConfig {
|
|
150
|
+
slsConfigOverride?: Partial<SLSAdapterConfig>;
|
|
151
|
+
}
|
|
152
|
+
declare class MitoSLSAdapter {
|
|
153
|
+
private options;
|
|
154
|
+
private mitoInstance;
|
|
155
|
+
private slsAdapter;
|
|
156
|
+
private store;
|
|
157
|
+
private router;
|
|
158
|
+
private isInitialized;
|
|
159
|
+
constructor(options?: Partial<MitoSLSAdapterOptions>);
|
|
160
|
+
addBreadcrumb(payload: any): void;
|
|
161
|
+
init(context?: TransformContext & {
|
|
162
|
+
Vue?: any;
|
|
163
|
+
}): Promise<void>;
|
|
164
|
+
private setupVueIntegration;
|
|
165
|
+
private setupRouterIntegration;
|
|
166
|
+
private setupErrorHandling;
|
|
167
|
+
handleDataReport(data: any): boolean | void;
|
|
168
|
+
handleRouteChange(to: any, from: any): void;
|
|
169
|
+
handleError(error: any): void;
|
|
170
|
+
sendToSLS(data: any): Promise<void>;
|
|
171
|
+
transformDataForSLSLog(data: any): any;
|
|
172
|
+
getEventCategory(dataType: string): string;
|
|
173
|
+
getEventLevel(dataType: string): string;
|
|
174
|
+
getUserInfoFromStore(): any;
|
|
175
|
+
shouldTrackMutation(mutation: any): boolean;
|
|
176
|
+
trackEvent(eventData: Record<string, any>): void;
|
|
177
|
+
setUser(userInfo: {
|
|
178
|
+
userId?: string;
|
|
179
|
+
userName?: string;
|
|
180
|
+
email?: string;
|
|
181
|
+
accountId?: string;
|
|
182
|
+
roles?: string[];
|
|
183
|
+
}): void;
|
|
184
|
+
getBreadcrumbs(): any[];
|
|
185
|
+
destroy(): void;
|
|
186
|
+
}
|
|
187
|
+
declare const getMitoAdapter: (options?: Partial<MitoSLSAdapterOptions>) => MitoSLSAdapter;
|
|
188
|
+
declare const initRUMCore: (context: TransformContext & {
|
|
189
|
+
Vue?: any;
|
|
190
|
+
}, options?: Partial<MitoSLSAdapterOptions>) => Promise<MitoSLSAdapter>;
|
|
191
|
+
declare const getRUMCoreInstance: () => MitoSLSAdapter | null;
|
|
192
|
+
|
|
193
|
+
interface RUMManagerContext extends TransformContext {
|
|
194
|
+
Vue?: any;
|
|
195
|
+
}
|
|
196
|
+
declare class RUMManagerVue2 {
|
|
197
|
+
private adapter;
|
|
198
|
+
private isInitialized;
|
|
199
|
+
private isEnabled;
|
|
200
|
+
private context;
|
|
201
|
+
init(context: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
|
|
202
|
+
private shouldEnableRUM;
|
|
203
|
+
private setUserInfo;
|
|
204
|
+
private setupUserStateListener;
|
|
205
|
+
private setupUserInteractionTracking;
|
|
206
|
+
private getCSSSelector;
|
|
207
|
+
trackEvent(eventName: string, eventData?: Record<string, any>): void;
|
|
208
|
+
trackPerformance(performanceData: Record<string, any>): void;
|
|
209
|
+
trackAction(action: string, actionData?: Record<string, any>): void;
|
|
210
|
+
trackMetric(metricName: string, value: number, dimensions?: Record<string, any>): void;
|
|
211
|
+
getBreadcrumbs(): any[];
|
|
212
|
+
enable(): void;
|
|
213
|
+
disable(): void;
|
|
214
|
+
private checkRUMAvailable;
|
|
215
|
+
getConfig(): Record<string, any>;
|
|
216
|
+
destroy(): void;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare const initRUMSystem: (context: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
|
|
220
|
+
declare const trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
|
|
221
|
+
declare const trackPerformance: (performanceData: Record<string, any>) => void;
|
|
222
|
+
declare const trackAction: (action: string, actionData?: Record<string, any>) => void;
|
|
223
|
+
declare const trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
|
|
224
|
+
declare const getBreadcrumbs: () => any[];
|
|
225
|
+
declare const enableRUM: () => void;
|
|
226
|
+
declare const disableRUM: () => void;
|
|
227
|
+
declare const getRUMConfig: () => Record<string, any>;
|
|
228
|
+
declare const destroyRUM: () => void;
|
|
229
|
+
declare const getRUMManager: () => RUMManagerVue2;
|
|
230
|
+
declare const RUMPluginVue2: {
|
|
231
|
+
install(Vue: any): void;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
declare const plugin_vue2_RUMPluginVue2: typeof RUMPluginVue2;
|
|
235
|
+
declare const plugin_vue2_destroyRUM: typeof destroyRUM;
|
|
236
|
+
declare const plugin_vue2_disableRUM: typeof disableRUM;
|
|
237
|
+
declare const plugin_vue2_enableRUM: typeof enableRUM;
|
|
238
|
+
declare const plugin_vue2_getBreadcrumbs: typeof getBreadcrumbs;
|
|
239
|
+
declare const plugin_vue2_getRUMConfig: typeof getRUMConfig;
|
|
240
|
+
declare const plugin_vue2_getRUMManager: typeof getRUMManager;
|
|
241
|
+
declare const plugin_vue2_initRUMSystem: typeof initRUMSystem;
|
|
242
|
+
declare const plugin_vue2_trackAction: typeof trackAction;
|
|
243
|
+
declare const plugin_vue2_trackEvent: typeof trackEvent;
|
|
244
|
+
declare const plugin_vue2_trackMetric: typeof trackMetric;
|
|
245
|
+
declare const plugin_vue2_trackPerformance: typeof trackPerformance;
|
|
246
|
+
declare namespace plugin_vue2 {
|
|
247
|
+
export {
|
|
248
|
+
plugin_vue2_RUMPluginVue2 as RUMPluginVue2,
|
|
249
|
+
plugin_vue2_destroyRUM as destroyRUM,
|
|
250
|
+
plugin_vue2_disableRUM as disableRUM,
|
|
251
|
+
plugin_vue2_enableRUM as enableRUM,
|
|
252
|
+
plugin_vue2_getBreadcrumbs as getBreadcrumbs,
|
|
253
|
+
plugin_vue2_getRUMConfig as getRUMConfig,
|
|
254
|
+
plugin_vue2_getRUMManager as getRUMManager,
|
|
255
|
+
plugin_vue2_initRUMSystem as initRUMSystem,
|
|
256
|
+
plugin_vue2_trackAction as trackAction,
|
|
257
|
+
plugin_vue2_trackEvent as trackEvent,
|
|
258
|
+
plugin_vue2_trackMetric as trackMetric,
|
|
259
|
+
plugin_vue2_trackPerformance as trackPerformance,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
interface RUMManagerContextVue3 extends TransformContext {
|
|
264
|
+
}
|
|
265
|
+
declare class RUMManagerVue3 {
|
|
266
|
+
private inner;
|
|
267
|
+
init(context: RUMManagerContextVue3, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
|
|
268
|
+
trackEvent(eventName: string, eventData?: Record<string, any>): void;
|
|
269
|
+
trackPerformance(performanceData: Record<string, any>): void;
|
|
270
|
+
trackAction(action: string, actionData?: Record<string, any>): void;
|
|
271
|
+
trackMetric(metricName: string, value: number, dimensions?: Record<string, any>): void;
|
|
272
|
+
getBreadcrumbs(): any[];
|
|
273
|
+
enable(): void;
|
|
274
|
+
disable(): void;
|
|
275
|
+
getConfig(): Record<string, any>;
|
|
276
|
+
destroy(): void;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface RUMVue3PluginOptions {
|
|
280
|
+
store?: any;
|
|
281
|
+
router?: any;
|
|
282
|
+
coreOptions?: Partial<MitoSLSAdapterOptions>;
|
|
283
|
+
}
|
|
284
|
+
declare function createRUMPluginVue3(options: RUMVue3PluginOptions): {
|
|
285
|
+
install(app: App): void;
|
|
286
|
+
};
|
|
287
|
+
declare function useRUM(): RUMManagerVue3 | undefined;
|
|
288
|
+
|
|
289
|
+
type plugin_vue3_RUMVue3PluginOptions = RUMVue3PluginOptions;
|
|
290
|
+
declare const plugin_vue3_createRUMPluginVue3: typeof createRUMPluginVue3;
|
|
291
|
+
declare const plugin_vue3_useRUM: typeof useRUM;
|
|
292
|
+
declare namespace plugin_vue3 {
|
|
293
|
+
export {
|
|
294
|
+
plugin_vue3_RUMVue3PluginOptions as RUMVue3PluginOptions,
|
|
295
|
+
plugin_vue3_createRUMPluginVue3 as createRUMPluginVue3,
|
|
296
|
+
plugin_vue3_useRUM as useRUM,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export { MitoConfig, MitoSLSAdapter, MitoSLSAdapterOptions, MitoSampleRateConfig, RUMEnv, RUMPluginVue2, RUM_ENV, SLSAdapterConfig, SLSWebTrackingAdapter, SlsConfig, TransformContext, createRUMPluginVue3, destroyRUM as destroyRUMVue2, disableRUM as disableRUMVue2, enableRUM as enableRUMVue2, getBreadcrumbs as getBreadcrumbsVue2, getMitoAdapter, getRUMConfig as getRUMConfigVue2, getRUMCoreInstance, getRUMEnv, getRUMManager as getRUMManagerVue2, getUserInfo, initRUMCore, initRUMSystem as initRUMSystemVue2, mitoConfig, shouldReport, slsConfig, trackAction as trackActionVue2, trackEvent as trackEventVue2, trackMetric as trackMetricVue2, trackPerformance as trackPerformanceVue2, transformDataForSLS, useRUM, plugin_vue2 as vue2, plugin_vue3 as vue3 };
|