@cloudcare/browser-core 3.1.12 → 3.1.13

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 +64 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "3.1.12",
3
+ "version": "3.1.13",
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": "01fca1d8b95bbd1e8e7936bda860af98bf76fa02"
25
+ "gitHead": "f7180bcedb58d06418d937389efee132b995af2b"
26
26
  }
package/types/index.d.ts CHANGED
@@ -23,25 +23,59 @@ export declare const RawReportType: {
23
23
  }
24
24
  export type RawReportType = (typeof RawReportType)[keyof typeof RawReportType]
25
25
  export interface InitConfiguration {
26
+ /**
27
+ * 以openway 方式上报数据令牌,从观测云控制台获取,必填
28
+ */
26
29
  clientToken?: string | undefined
30
+ /**
31
+ * 数据发送前的的拦截器
32
+ * @param event 事件内容
33
+ * @param context 事件额外属性
34
+ * @returns
35
+ */
27
36
  beforeSend?: (event: any, context?: any) => unknown | undefined
37
+ /**
38
+ * 数据上报采样率,100 表示全收集;0 表示不收集。默认 100
39
+ */
28
40
  sessionSampleRate?: number | undefined
29
41
  telemetrySampleRate?: number | undefined
30
42
  silentMultipleInit?: boolean | undefined
43
+ /**
44
+ * 以 公共openway 方式上报数据地址,从观测云控制台获取,必填
45
+ */
31
46
  site?: string | undefined
47
+ /** DataKit 数据上报 Origin 注释:
48
+ * 协议(包括://),域名(或IP地址)[和端口号]
49
+ * 例如:
50
+ * https://www.datakit.com;
51
+ * http://100.20.34.3:8088。
52
+ */
32
53
  datakitOrigin: string
33
54
  service?: string | undefined
55
+ /** Web 应用当前环境,如 prod:线上环境;gray:灰度环境;pre:预发布环境;common:日常环境;local:本地环境。 */
34
56
  env?: string | undefined
57
+ /** Web 应用的版本号。 */
35
58
  version?: string | undefined
36
- tracingSampleRate: number | undefined
59
+ /** 链路数据采样百分比:100 表示全收集;0 表示不收集。 */
60
+ tracingSampleRate?: number | undefined
37
61
  /**
38
62
  * @deprecated use usePartitionedCrossSiteSessionCookie instead
39
63
  */
40
64
  useCrossSiteSessionCookie?: boolean | undefined
65
+ /**
66
+ * 是否使用跨域 cookie,开启第三方 cookie 跨分区实现。默认不允许跨域,例如嵌套跨域 iframe 的情况。
67
+ */
68
+ usePartitionedCrossSiteSessionCookie?: boolean | undefined
41
69
  useSecureSessionCookie?: boolean | undefined
42
70
  trackSessionAcrossSubdomains?: boolean | undefined
43
- storeContextsToLocal: boolean | undefined
44
- sendContentTypeByJson: boolean | undefined
71
+ /**
72
+ * 是否把公共数据存储到localstorage,默认不存储
73
+ */
74
+ storeContextsToLocal?: boolean | undefined
75
+ /**
76
+ * 数据以 application/json 的发送方式,默认text
77
+ */
78
+ sendContentTypeByJson?: boolean | undefined
45
79
  }
46
80
  export enum TraceType {
47
81
  DDTRACE = 'ddtrace',
@@ -79,14 +113,39 @@ export declare function matchList(
79
113
  ): boolean
80
114
 
81
115
  export interface RumInitConfiguration extends InitConfiguration {
116
+ /**从观测云创建的应用 ID */
82
117
  applicationId: string
118
+ /**
119
+ * 排除一些影响 loadingtime 的指标准确性的url,具体可参考下面文档
120
+ * https://docs.guance.com/security/page-performance/#_3
121
+ */
83
122
  excludedActivityUrls?: MatchOption[] | undefined
123
+ /**
124
+ * 允许注入 trace 采集器所需 header 头部的所有请求列表。可以是请求的 origin,也可以是正则,origin: 协议(包括://),域名(或IP地址)[和端口号]。例如:
125
+ ["https://api.example.com", /https:\\/\\/.*\\.my-api-domain\\.com/]。
126
+ */
84
127
  allowedTracingUrls?: Array<MatchOption | TracingOption> | undefined
85
128
  defaultPrivacyLevel?: DefaultPrivacyLevel | undefined
129
+ /**
130
+ * Session Replay 数据采集百分比:
131
+ 100 表示全收集;0 表示不收集。
132
+ */
86
133
  sessionReplaySampleRate?: number | undefined
134
+ /**
135
+ * 是否开启用户行为采集。
136
+ */
87
137
  trackUserInteractions?: boolean | undefined
138
+ /**
139
+ * 指定 action 数据 name 获取方式,默认自动获取,可以指定元素特定属性名称
140
+ */
88
141
  actionNameAttribute?: string | undefined
89
142
  trackViewsManually?: boolean | undefined
90
- traceType: TraceType
91
- traceId128Bit: boolean | undefined
143
+ /**
144
+ * 配置链路追踪工具类型,如果不配置默认为 ddtrace。目前支持 ddtrace、zipkin、skywalking_v3、jaeger、zipkin_single_header、w3c_traceparent 6 种数据类型。
145
+ */
146
+ traceType?: TraceType
147
+ /**
148
+ * 是否以 128 字节的方式生成 traceID,与 traceType 对应,目前支持类型 zipkin、jaeger。
149
+ */
150
+ traceId128Bit?: boolean | undefined
92
151
  }