@cloudcare/browser-rum 3.2.36 → 3.2.37
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/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/perStartRum.js +8 -0
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +16 -0
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js +4 -2
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/perStartRum.js +8 -0
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/rumPublicApi.js +17 -1
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/actionCollection.js +4 -2
- package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/package.json +2 -2
- package/src/boot/perStartRum.js +9 -0
- package/src/boot/rumPublicApi.js +18 -2
- package/src/domain/replay/record/serialize.js +0 -1
- package/src/domain/rumEventsCollection/actions/actionCollection.js +3 -2
- package/types/index.d.ts +5 -0
package/src/boot/rumPublicApi.js
CHANGED
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
sanitize,
|
|
18
18
|
createCustomerDataTrackerManager,
|
|
19
19
|
CustomerDataCompressionStatus,
|
|
20
|
-
displayAlreadyInitializedError
|
|
20
|
+
displayAlreadyInitializedError,
|
|
21
|
+
getType
|
|
21
22
|
} from '@cloudcare/browser-core'
|
|
22
23
|
import { buildCommonContext } from '../domain/contexts/commonContext'
|
|
23
24
|
import { createPreStartStrategy } from './perStartRum'
|
|
@@ -184,9 +185,24 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
184
185
|
addDebugSession: monitor(function (id) {}),
|
|
185
186
|
clearDebugSession: monitor(function () {}),
|
|
186
187
|
getDebugSession: monitor(function () {}),
|
|
187
|
-
|
|
188
|
+
addTypeAction: monitor(function (name, type, context) {
|
|
188
189
|
const handlingStack = createHandlingStack()
|
|
189
190
|
|
|
191
|
+
callMonitored(function () {
|
|
192
|
+
const sourceType = sanitize(type)
|
|
193
|
+
strategy.addAction({
|
|
194
|
+
name: sanitize(name),
|
|
195
|
+
context: sanitize(context),
|
|
196
|
+
startClocks: clocksNow(),
|
|
197
|
+
type:
|
|
198
|
+
getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,
|
|
199
|
+
handlingStack: handlingStack
|
|
200
|
+
})
|
|
201
|
+
addTelemetryUsage({ feature: 'add-type-action' })
|
|
202
|
+
})
|
|
203
|
+
}),
|
|
204
|
+
addAction: monitor(function (name, context) {
|
|
205
|
+
const handlingStack = createHandlingStack()
|
|
190
206
|
callMonitored(function () {
|
|
191
207
|
strategy.addAction({
|
|
192
208
|
name: sanitize(name),
|
|
@@ -79,7 +79,7 @@ function processAction(action, pageStateHistory) {
|
|
|
79
79
|
}
|
|
80
80
|
: {
|
|
81
81
|
action: {
|
|
82
|
-
loadingTime: 0
|
|
82
|
+
loadingTime: action.context?.duration || 0
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
var customerContext = !isAutoAction(action) ? action.context : undefined
|
|
@@ -115,5 +115,6 @@ function processAction(action, pageStateHistory) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function isAutoAction(action) {
|
|
118
|
-
return action.type
|
|
118
|
+
return action.type === ActionType.CLICK
|
|
119
|
+
// return action.type !== ActionType.CUSTOM
|
|
119
120
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -50,6 +50,11 @@ export declare const datafluxRum: {
|
|
|
50
50
|
| RumSiteInitConfiguration
|
|
51
51
|
| undefined
|
|
52
52
|
addAction: (name: string, context?: object | undefined) => void
|
|
53
|
+
addTypeAction: (
|
|
54
|
+
name: string,
|
|
55
|
+
type?: string,
|
|
56
|
+
context?: object | undefined
|
|
57
|
+
) => void
|
|
53
58
|
addError: (error: unknown, context?: object | undefined) => void
|
|
54
59
|
addTiming: (name: string, time?: number | undefined) => void
|
|
55
60
|
setUser: (newUser: User) => void
|