@cloudcare/browser-core 3.1.13 → 3.1.14

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/types/index.d.ts +25 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "3.1.13",
3
+ "version": "3.1.14",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -22,5 +22,5 @@
22
22
  "author": "dataflux",
23
23
  "license": "MIT",
24
24
  "description": "DataFlux RUM Web 端数据指标监控",
25
- "gitHead": "f7180bcedb58d06418d937389efee132b995af2b"
25
+ "gitHead": "b1e48a057524da9bd63262a8b9d56500e5c6ae46"
26
26
  }
package/types/index.d.ts CHANGED
@@ -22,11 +22,28 @@ export declare const RawReportType: {
22
22
  readonly cspViolation: 'csp_violation'
23
23
  }
24
24
  export type RawReportType = (typeof RawReportType)[keyof typeof RawReportType]
25
- export interface InitConfiguration {
25
+
26
+ export interface SiteInitConfiguration {
26
27
  /**
27
28
  * 以openway 方式上报数据令牌,从观测云控制台获取,必填
28
29
  */
29
- clientToken?: string | undefined
30
+ clientToken: string | undefined
31
+
32
+ /**
33
+ * 以 公共openway 方式上报数据地址,从观测云控制台获取,必填
34
+ */
35
+ site: string | undefined
36
+ }
37
+ export interface DatakitInitConfiguration {
38
+ /** DataKit 数据上报 Origin 注释:
39
+ * 协议(包括://),域名(或IP地址)[和端口号]
40
+ * 例如:
41
+ * https://www.datakit.com;
42
+ * http://100.20.34.3:8088。
43
+ */
44
+ datakitOrigin: string
45
+ }
46
+ export interface InitConfiguration {
30
47
  /**
31
48
  * 数据发送前的的拦截器
32
49
  * @param event 事件内容
@@ -40,17 +57,7 @@ export interface InitConfiguration {
40
57
  sessionSampleRate?: number | undefined
41
58
  telemetrySampleRate?: number | undefined
42
59
  silentMultipleInit?: boolean | undefined
43
- /**
44
- * 以 公共openway 方式上报数据地址,从观测云控制台获取,必填
45
- */
46
- site?: string | undefined
47
- /** DataKit 数据上报 Origin 注释:
48
- * 协议(包括://),域名(或IP地址)[和端口号]
49
- * 例如:
50
- * https://www.datakit.com;
51
- * http://100.20.34.3:8088。
52
- */
53
- datakitOrigin: string
60
+
54
61
  service?: string | undefined
55
62
  /** Web 应用当前环境,如 prod:线上环境;gray:灰度环境;pre:预发布环境;common:日常环境;local:本地环境。 */
56
63
  env?: string | undefined
@@ -112,7 +119,7 @@ export declare function matchList(
112
119
  useStartsWith?: boolean
113
120
  ): boolean
114
121
 
115
- export interface RumInitConfiguration extends InitConfiguration {
122
+ export interface RumBaseInitConfiguration extends InitConfiguration {
116
123
  /**从观测云创建的应用 ID */
117
124
  applicationId: string
118
125
  /**
@@ -149,3 +156,7 @@ export interface RumInitConfiguration extends InitConfiguration {
149
156
  */
150
157
  traceId128Bit?: boolean | undefined
151
158
  }
159
+ export type RumInitConfiguration = RumBaseInitConfiguration &
160
+ DatakitInitConfiguration
161
+ export type RumSiteInitConfiguration = RumBaseInitConfiguration &
162
+ SiteInitConfiguration