@datadog/mobile-react-native-session-replay 2.4.4-alpha.0 → 2.6.0
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/DatadogSDKReactNativeSessionReplay.podspec +1 -1
- package/android/build.gradle +11 -1
- package/android/consumer-proguard-rules.pro +3 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt +32 -27
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupport.kt +15 -4
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactTextPropertiesResolver.kt +8 -10
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/SessionReplayPrivacySettings.kt +90 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/SessionReplaySDKWrapper.kt +14 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/SessionReplayWrapper.kt +10 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/extensions/ReactDrawablesExt.kt +190 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactEditTextMapper.kt +84 -10
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactNativeImageViewMapper.kt +106 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewGroupMapper.kt +4 -5
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/resources/ReactDrawableCopier.kt +34 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/DrawableUtils.kt +10 -23
- package/android/src/newarch/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplay.kt +28 -4
- package/android/src/oldarch/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplay.kt +35 -3
- package/android/src/{main/kotlin/com/datadog/reactnative/sessionreplay/extensions/LongExt.kt → rn75/kotlin/com/datadog/reactnative/sessionreplay/extensions/LengthPercentageExt.kt} +6 -8
- package/android/src/rn75/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +101 -0
- package/android/src/rn76/kotlin/com/datadog/reactnative/sessionreplay/extensions/LengthPercentageExt.kt +13 -0
- package/android/src/rn76/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +101 -0
- package/android/src/rnlegacy/kotlin/com.datadog.reactnative.sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +88 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt +59 -50
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupportTest.kt +7 -3
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/ReactTextPropertiesResolverTest.kt +2 -7
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewGroupMapperTest.kt +2 -7
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/utils/DrawableUtilsTest.kt +2 -1
- package/ios/Sources/DdSessionReplay.mm +46 -4
- package/ios/Sources/DdSessionReplayImplementation.swift +83 -11
- package/ios/Sources/RCTTextViewRecorder.swift +1 -1
- package/lib/commonjs/SessionReplay.js +78 -10
- package/lib/commonjs/SessionReplay.js.map +1 -1
- package/lib/commonjs/index.js +18 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSessionReplay.js.map +1 -1
- package/lib/module/SessionReplay.js +77 -9
- package/lib/module/SessionReplay.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeDdSessionReplay.js.map +1 -1
- package/lib/typescript/SessionReplay.d.ts +73 -4
- package/lib/typescript/SessionReplay.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +18 -3
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSessionReplay.d.ts +15 -2
- package/lib/typescript/specs/NativeDdSessionReplay.d.ts.map +1 -1
- package/package.json +85 -84
- package/src/SessionReplay.ts +170 -23
- package/src/__tests__/SessionReplay.test.ts +94 -8
- package/src/index.ts +14 -2
- package/src/nativeModulesTypes.ts +27 -4
- package/src/specs/NativeDdSessionReplay.ts +21 -3
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +0 -66
|
@@ -30,14 +30,26 @@ public class DdSessionReplayImplementation: NSObject {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
@objc
|
|
33
|
-
public func enable(
|
|
33
|
+
public func enable(
|
|
34
|
+
replaySampleRate: Double,
|
|
35
|
+
customEndpoint: String,
|
|
36
|
+
imagePrivacyLevel: NSString,
|
|
37
|
+
touchPrivacyLevel: NSString,
|
|
38
|
+
textAndInputPrivacyLevel: NSString,
|
|
39
|
+
startRecordingImmediately: Bool,
|
|
40
|
+
resolve:RCTPromiseResolveBlock,
|
|
41
|
+
reject:RCTPromiseRejectBlock
|
|
42
|
+
) -> Void {
|
|
34
43
|
var customEndpointURL: URL? = nil
|
|
35
44
|
if (customEndpoint != "") {
|
|
36
45
|
customEndpointURL = URL(string: "\(customEndpoint)/api/v2/replay" as String)
|
|
37
46
|
}
|
|
38
47
|
var sessionReplayConfiguration = SessionReplay.Configuration(
|
|
39
48
|
replaySampleRate: Float(replaySampleRate),
|
|
40
|
-
|
|
49
|
+
textAndInputPrivacyLevel: convertTextAndInputPrivacy(textAndInputPrivacyLevel),
|
|
50
|
+
imagePrivacyLevel: convertImagePrivacy(imagePrivacyLevel),
|
|
51
|
+
touchPrivacyLevel: convertTouchPrivacy(touchPrivacyLevel),
|
|
52
|
+
startRecordingImmediately: startRecordingImmediately,
|
|
41
53
|
customEndpoint: customEndpointURL
|
|
42
54
|
)
|
|
43
55
|
|
|
@@ -55,16 +67,65 @@ public class DdSessionReplayImplementation: NSObject {
|
|
|
55
67
|
resolve(nil)
|
|
56
68
|
}
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
@objc
|
|
71
|
+
public func startRecording(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
72
|
+
if let core = DatadogSDKWrapper.shared.getCoreInstance() {
|
|
73
|
+
sessionReplay.startRecording(in: core)
|
|
74
|
+
} else {
|
|
75
|
+
consolePrint("Core instance was not found when calling startRecording in Session Replay.", .critical)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
resolve(nil)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@objc
|
|
82
|
+
public func stopRecording(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
83
|
+
if let core = DatadogSDKWrapper.shared.getCoreInstance() {
|
|
84
|
+
sessionReplay.stopRecording(in: core)
|
|
85
|
+
} else {
|
|
86
|
+
consolePrint("Core instance was not found when calling stopRecording in Session Replay.", .critical)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
resolve(nil)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
func convertImagePrivacy(_ imagePrivacy: NSString) -> ImagePrivacyLevel {
|
|
93
|
+
switch imagePrivacy {
|
|
94
|
+
case "MASK_NON_BUNDLED_ONLY":
|
|
95
|
+
return .maskNonBundledOnly
|
|
96
|
+
case "MASK_ALL":
|
|
97
|
+
return .maskAll
|
|
98
|
+
case "MASK_NONE":
|
|
99
|
+
return .maskNone
|
|
66
100
|
default:
|
|
67
|
-
|
|
101
|
+
consolePrint("Unknown Session Replay Image Privacy Level given: \(imagePrivacy), using .maskAll as default.", .warn)
|
|
102
|
+
return .maskAll
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
func convertTouchPrivacy(_ touchPrivacy: NSString) -> TouchPrivacyLevel {
|
|
107
|
+
switch touchPrivacy {
|
|
108
|
+
case "SHOW":
|
|
109
|
+
return .show
|
|
110
|
+
case "HIDE":
|
|
111
|
+
return .hide
|
|
112
|
+
default:
|
|
113
|
+
consolePrint("Unknown Session Replay Touch Privacy Level given: \(touchPrivacy), using .hide as default.", .warn)
|
|
114
|
+
return .hide
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
func convertTextAndInputPrivacy(_ textAndInputPrivacy: NSString) -> TextAndInputPrivacyLevel {
|
|
119
|
+
switch textAndInputPrivacy {
|
|
120
|
+
case "MASK_SENSITIVE_INPUTS":
|
|
121
|
+
return .maskSensitiveInputs
|
|
122
|
+
case "MASK_ALL_INPUTS":
|
|
123
|
+
return .maskAllInputs
|
|
124
|
+
case "MASK_ALL":
|
|
125
|
+
return .maskAll
|
|
126
|
+
default:
|
|
127
|
+
consolePrint("Unknown Session Replay Text and Input Privacy Level given: \(textAndInputPrivacy), using .maskAll as default.", .warn)
|
|
128
|
+
return .maskAll
|
|
68
129
|
}
|
|
69
130
|
}
|
|
70
131
|
}
|
|
@@ -74,10 +135,21 @@ internal protocol SessionReplayProtocol {
|
|
|
74
135
|
with configuration: SessionReplay.Configuration,
|
|
75
136
|
in core: DatadogCoreProtocol
|
|
76
137
|
)
|
|
138
|
+
|
|
139
|
+
func startRecording(in core: DatadogCoreProtocol)
|
|
140
|
+
func stopRecording(in core: DatadogCoreProtocol)
|
|
77
141
|
}
|
|
78
142
|
|
|
79
143
|
internal class NativeSessionReplay: SessionReplayProtocol {
|
|
80
144
|
func enable(with configuration: DatadogSessionReplay.SessionReplay.Configuration, in core: DatadogCoreProtocol) {
|
|
81
145
|
SessionReplay.enable(with: configuration, in: core)
|
|
82
146
|
}
|
|
147
|
+
|
|
148
|
+
func startRecording(in core: any DatadogInternal.DatadogCoreProtocol) {
|
|
149
|
+
SessionReplay.startRecording(in: core)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
func stopRecording(in core: any DatadogInternal.DatadogCoreProtocol) {
|
|
153
|
+
SessionReplay.stopRecording(in: core)
|
|
154
|
+
}
|
|
83
155
|
}
|
|
@@ -139,11 +139,11 @@ internal struct RCTTextViewWireframesBuilder: SessionReplayNodeWireframesBuilder
|
|
|
139
139
|
builder.createTextWireframe(
|
|
140
140
|
id: wireframeID,
|
|
141
141
|
frame: relativeIntersectedRect,
|
|
142
|
+
clip: attributes.clip,
|
|
142
143
|
text: textObfuscator.mask(text: text ?? ""),
|
|
143
144
|
textFrame: textFrame,
|
|
144
145
|
// Text alignment is top for all RCTTextView components.
|
|
145
146
|
textAlignment: .init(systemTextAlignment: textAlignment, vertical: .top),
|
|
146
|
-
clip: clip,
|
|
147
147
|
textColor: textColor ?? DEFAULT_COLOR,
|
|
148
148
|
fontOverride: SessionReplayWireframesBuilder.FontOverride(size: fontSize.isNaN ? DEFAULT_FONT_SIZE : fontSize),
|
|
149
149
|
borderColor: attributes.layerBorderColor,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SessionReplayWrapper = exports.SessionReplayPrivacy = exports.SessionReplay = void 0;
|
|
6
|
+
exports.TouchPrivacyLevel = exports.TextAndInputPrivacyLevel = exports.SessionReplayWrapper = exports.SessionReplayPrivacy = exports.SessionReplay = exports.ImagePrivacyLevel = void 0;
|
|
7
7
|
/*
|
|
8
8
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
9
9
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
@@ -15,13 +15,34 @@ let SessionReplayPrivacy = exports.SessionReplayPrivacy = /*#__PURE__*/function
|
|
|
15
15
|
SessionReplayPrivacy["MASK_USER_INPUT"] = "MASK_USER_INPUT";
|
|
16
16
|
return SessionReplayPrivacy;
|
|
17
17
|
}({});
|
|
18
|
+
let ImagePrivacyLevel = exports.ImagePrivacyLevel = /*#__PURE__*/function (ImagePrivacyLevel) {
|
|
19
|
+
ImagePrivacyLevel["MASK_NON_BUNDLED_ONLY"] = "MASK_NON_BUNDLED_ONLY";
|
|
20
|
+
ImagePrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
21
|
+
ImagePrivacyLevel["MASK_NONE"] = "MASK_NONE";
|
|
22
|
+
return ImagePrivacyLevel;
|
|
23
|
+
}({});
|
|
24
|
+
let TouchPrivacyLevel = exports.TouchPrivacyLevel = /*#__PURE__*/function (TouchPrivacyLevel) {
|
|
25
|
+
TouchPrivacyLevel["SHOW"] = "SHOW";
|
|
26
|
+
TouchPrivacyLevel["HIDE"] = "HIDE";
|
|
27
|
+
return TouchPrivacyLevel;
|
|
28
|
+
}({});
|
|
29
|
+
let TextAndInputPrivacyLevel = exports.TextAndInputPrivacyLevel = /*#__PURE__*/function (TextAndInputPrivacyLevel) {
|
|
30
|
+
TextAndInputPrivacyLevel["MASK_SENSITIVE_INPUTS"] = "MASK_SENSITIVE_INPUTS";
|
|
31
|
+
TextAndInputPrivacyLevel["MASK_ALL_INPUTS"] = "MASK_ALL_INPUTS";
|
|
32
|
+
TextAndInputPrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
33
|
+
return TextAndInputPrivacyLevel;
|
|
34
|
+
}({});
|
|
18
35
|
/**
|
|
19
36
|
* The Session Replay configuration object.
|
|
20
37
|
*/
|
|
21
38
|
const DEFAULTS = {
|
|
22
39
|
replaySampleRate: 0,
|
|
23
40
|
defaultPrivacyLevel: SessionReplayPrivacy.MASK,
|
|
24
|
-
customEndpoint: ''
|
|
41
|
+
customEndpoint: '',
|
|
42
|
+
imagePrivacyLevel: ImagePrivacyLevel.MASK_ALL,
|
|
43
|
+
touchPrivacyLevel: TouchPrivacyLevel.HIDE,
|
|
44
|
+
textAndInputPrivacyLevel: TextAndInputPrivacyLevel.MASK_ALL,
|
|
45
|
+
startRecordingImmediately: true
|
|
25
46
|
};
|
|
26
47
|
class SessionReplayWrapper {
|
|
27
48
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
@@ -32,13 +53,43 @@ class SessionReplayWrapper {
|
|
|
32
53
|
}
|
|
33
54
|
const {
|
|
34
55
|
replaySampleRate,
|
|
35
|
-
|
|
36
|
-
|
|
56
|
+
customEndpoint,
|
|
57
|
+
startRecordingImmediately
|
|
37
58
|
} = configuration;
|
|
38
|
-
|
|
59
|
+
const baseConfig = {
|
|
39
60
|
replaySampleRate: replaySampleRate !== undefined ? replaySampleRate : DEFAULTS.replaySampleRate,
|
|
40
|
-
|
|
41
|
-
|
|
61
|
+
customEndpoint: customEndpoint !== undefined ? customEndpoint : DEFAULTS.customEndpoint,
|
|
62
|
+
startRecordingImmediately: startRecordingImmediately !== undefined ? startRecordingImmediately : DEFAULTS.startRecordingImmediately
|
|
63
|
+
};
|
|
64
|
+
const privacyConfig = {
|
|
65
|
+
imagePrivacyLevel: configuration.imagePrivacyLevel ?? DEFAULTS.imagePrivacyLevel,
|
|
66
|
+
touchPrivacyLevel: configuration.touchPrivacyLevel ?? DEFAULTS.touchPrivacyLevel,
|
|
67
|
+
textAndInputPrivacyLevel: configuration.textAndInputPrivacyLevel ?? DEFAULTS.textAndInputPrivacyLevel
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Legacy Default Privacy Level property handling
|
|
71
|
+
if (configuration.defaultPrivacyLevel) {
|
|
72
|
+
switch (configuration.defaultPrivacyLevel) {
|
|
73
|
+
case SessionReplayPrivacy.MASK:
|
|
74
|
+
privacyConfig.imagePrivacyLevel = ImagePrivacyLevel.MASK_ALL;
|
|
75
|
+
privacyConfig.touchPrivacyLevel = TouchPrivacyLevel.HIDE;
|
|
76
|
+
privacyConfig.textAndInputPrivacyLevel = TextAndInputPrivacyLevel.MASK_ALL;
|
|
77
|
+
break;
|
|
78
|
+
case SessionReplayPrivacy.MASK_USER_INPUT:
|
|
79
|
+
privacyConfig.imagePrivacyLevel = ImagePrivacyLevel.MASK_NONE;
|
|
80
|
+
privacyConfig.touchPrivacyLevel = TouchPrivacyLevel.HIDE;
|
|
81
|
+
privacyConfig.textAndInputPrivacyLevel = TextAndInputPrivacyLevel.MASK_ALL_INPUTS;
|
|
82
|
+
break;
|
|
83
|
+
case SessionReplayPrivacy.ALLOW:
|
|
84
|
+
privacyConfig.imagePrivacyLevel = ImagePrivacyLevel.MASK_NONE;
|
|
85
|
+
privacyConfig.touchPrivacyLevel = TouchPrivacyLevel.SHOW;
|
|
86
|
+
privacyConfig.textAndInputPrivacyLevel = TextAndInputPrivacyLevel.MASK_SENSITIVE_INPUTS;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
...baseConfig,
|
|
92
|
+
...privacyConfig
|
|
42
93
|
};
|
|
43
94
|
};
|
|
44
95
|
|
|
@@ -49,10 +100,27 @@ class SessionReplayWrapper {
|
|
|
49
100
|
enable = configuration => {
|
|
50
101
|
const {
|
|
51
102
|
replaySampleRate,
|
|
52
|
-
|
|
53
|
-
|
|
103
|
+
customEndpoint,
|
|
104
|
+
imagePrivacyLevel,
|
|
105
|
+
touchPrivacyLevel,
|
|
106
|
+
textAndInputPrivacyLevel,
|
|
107
|
+
startRecordingImmediately
|
|
54
108
|
} = this.buildConfiguration(configuration);
|
|
55
|
-
return this.nativeSessionReplay.enable(replaySampleRate,
|
|
109
|
+
return this.nativeSessionReplay.enable(replaySampleRate, customEndpoint, imagePrivacyLevel, touchPrivacyLevel, textAndInputPrivacyLevel, startRecordingImmediately);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Manually start the recording of the current session.
|
|
114
|
+
*/
|
|
115
|
+
startRecording = () => {
|
|
116
|
+
return this.nativeSessionReplay.startRecording();
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Manually stop the recording of the current session.
|
|
121
|
+
*/
|
|
122
|
+
stopRecording = () => {
|
|
123
|
+
return this.nativeSessionReplay.stopRecording();
|
|
56
124
|
};
|
|
57
125
|
}
|
|
58
126
|
exports.SessionReplayWrapper = SessionReplayWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionReplayPrivacy","exports","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","undefined","enable","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAQYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;
|
|
1
|
+
{"version":3,"names":["SessionReplayPrivacy","exports","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","imagePrivacyLevel","MASK_ALL","touchPrivacyLevel","HIDE","textAndInputPrivacyLevel","startRecordingImmediately","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","baseConfig","undefined","privacyConfig","MASK_USER_INPUT","MASK_NONE","MASK_ALL_INPUTS","ALLOW","SHOW","MASK_SENSITIVE_INPUTS","enable","startRecording","stopRecording","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAQYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAA,IAMpBE,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAAA,IAiBjBC,iBA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C,iBAAiB,EACjBE,iBAAiB,EACjBE,wBAAwB,EACxBC,yBACJ,CAAC;EACL,CAAC;;EAED;AACJ;AACA;EACIiB,cAAc,GAAGA,CAAA,KAAqB;IAClC,OAAO,IAAI,CAACf,mBAAmB,CAACe,cAAc,CAAC,CAAC;EACpD,CAAC;;EAED;AACJ;AACA;EACIC,aAAa,GAAGA,CAAA,KAAqB;IACjC,OAAO,IAAI,CAAChB,mBAAmB,CAACgB,aAAa,CAAC,CAAC;EACnD,CAAC;AACL;AAAChC,OAAA,CAAAe,oBAAA,GAAAA,oBAAA;AAEM,MAAMkB,aAAa,GAAAjC,OAAA,CAAAiC,aAAA,GAAG,IAAIlB,oBAAoB,CAAC,CAAC","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "ImagePrivacyLevel", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _SessionReplay.ImagePrivacyLevel;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "SessionReplay", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -15,5 +21,17 @@ Object.defineProperty(exports, "SessionReplayPrivacy", {
|
|
|
15
21
|
return _SessionReplay.SessionReplayPrivacy;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "TextAndInputPrivacyLevel", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _SessionReplay.TextAndInputPrivacyLevel;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "TouchPrivacyLevel", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _SessionReplay.TouchPrivacyLevel;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
18
36
|
var _SessionReplay = require("./SessionReplay");
|
|
19
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_SessionReplay","require"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_SessionReplay","require"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,cAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSessionReplay.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSessionReplay.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAmCA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -10,6 +10,23 @@ export let SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
|
|
|
10
10
|
SessionReplayPrivacy["MASK_USER_INPUT"] = "MASK_USER_INPUT";
|
|
11
11
|
return SessionReplayPrivacy;
|
|
12
12
|
}({});
|
|
13
|
+
export let ImagePrivacyLevel = /*#__PURE__*/function (ImagePrivacyLevel) {
|
|
14
|
+
ImagePrivacyLevel["MASK_NON_BUNDLED_ONLY"] = "MASK_NON_BUNDLED_ONLY";
|
|
15
|
+
ImagePrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
16
|
+
ImagePrivacyLevel["MASK_NONE"] = "MASK_NONE";
|
|
17
|
+
return ImagePrivacyLevel;
|
|
18
|
+
}({});
|
|
19
|
+
export let TouchPrivacyLevel = /*#__PURE__*/function (TouchPrivacyLevel) {
|
|
20
|
+
TouchPrivacyLevel["SHOW"] = "SHOW";
|
|
21
|
+
TouchPrivacyLevel["HIDE"] = "HIDE";
|
|
22
|
+
return TouchPrivacyLevel;
|
|
23
|
+
}({});
|
|
24
|
+
export let TextAndInputPrivacyLevel = /*#__PURE__*/function (TextAndInputPrivacyLevel) {
|
|
25
|
+
TextAndInputPrivacyLevel["MASK_SENSITIVE_INPUTS"] = "MASK_SENSITIVE_INPUTS";
|
|
26
|
+
TextAndInputPrivacyLevel["MASK_ALL_INPUTS"] = "MASK_ALL_INPUTS";
|
|
27
|
+
TextAndInputPrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
28
|
+
return TextAndInputPrivacyLevel;
|
|
29
|
+
}({});
|
|
13
30
|
|
|
14
31
|
/**
|
|
15
32
|
* The Session Replay configuration object.
|
|
@@ -18,7 +35,11 @@ export let SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
|
|
|
18
35
|
const DEFAULTS = {
|
|
19
36
|
replaySampleRate: 0,
|
|
20
37
|
defaultPrivacyLevel: SessionReplayPrivacy.MASK,
|
|
21
|
-
customEndpoint: ''
|
|
38
|
+
customEndpoint: '',
|
|
39
|
+
imagePrivacyLevel: ImagePrivacyLevel.MASK_ALL,
|
|
40
|
+
touchPrivacyLevel: TouchPrivacyLevel.HIDE,
|
|
41
|
+
textAndInputPrivacyLevel: TextAndInputPrivacyLevel.MASK_ALL,
|
|
42
|
+
startRecordingImmediately: true
|
|
22
43
|
};
|
|
23
44
|
export class SessionReplayWrapper {
|
|
24
45
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
@@ -29,13 +50,43 @@ export class SessionReplayWrapper {
|
|
|
29
50
|
}
|
|
30
51
|
const {
|
|
31
52
|
replaySampleRate,
|
|
32
|
-
|
|
33
|
-
|
|
53
|
+
customEndpoint,
|
|
54
|
+
startRecordingImmediately
|
|
34
55
|
} = configuration;
|
|
35
|
-
|
|
56
|
+
const baseConfig = {
|
|
36
57
|
replaySampleRate: replaySampleRate !== undefined ? replaySampleRate : DEFAULTS.replaySampleRate,
|
|
37
|
-
|
|
38
|
-
|
|
58
|
+
customEndpoint: customEndpoint !== undefined ? customEndpoint : DEFAULTS.customEndpoint,
|
|
59
|
+
startRecordingImmediately: startRecordingImmediately !== undefined ? startRecordingImmediately : DEFAULTS.startRecordingImmediately
|
|
60
|
+
};
|
|
61
|
+
const privacyConfig = {
|
|
62
|
+
imagePrivacyLevel: configuration.imagePrivacyLevel ?? DEFAULTS.imagePrivacyLevel,
|
|
63
|
+
touchPrivacyLevel: configuration.touchPrivacyLevel ?? DEFAULTS.touchPrivacyLevel,
|
|
64
|
+
textAndInputPrivacyLevel: configuration.textAndInputPrivacyLevel ?? DEFAULTS.textAndInputPrivacyLevel
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Legacy Default Privacy Level property handling
|
|
68
|
+
if (configuration.defaultPrivacyLevel) {
|
|
69
|
+
switch (configuration.defaultPrivacyLevel) {
|
|
70
|
+
case SessionReplayPrivacy.MASK:
|
|
71
|
+
privacyConfig.imagePrivacyLevel = ImagePrivacyLevel.MASK_ALL;
|
|
72
|
+
privacyConfig.touchPrivacyLevel = TouchPrivacyLevel.HIDE;
|
|
73
|
+
privacyConfig.textAndInputPrivacyLevel = TextAndInputPrivacyLevel.MASK_ALL;
|
|
74
|
+
break;
|
|
75
|
+
case SessionReplayPrivacy.MASK_USER_INPUT:
|
|
76
|
+
privacyConfig.imagePrivacyLevel = ImagePrivacyLevel.MASK_NONE;
|
|
77
|
+
privacyConfig.touchPrivacyLevel = TouchPrivacyLevel.HIDE;
|
|
78
|
+
privacyConfig.textAndInputPrivacyLevel = TextAndInputPrivacyLevel.MASK_ALL_INPUTS;
|
|
79
|
+
break;
|
|
80
|
+
case SessionReplayPrivacy.ALLOW:
|
|
81
|
+
privacyConfig.imagePrivacyLevel = ImagePrivacyLevel.MASK_NONE;
|
|
82
|
+
privacyConfig.touchPrivacyLevel = TouchPrivacyLevel.SHOW;
|
|
83
|
+
privacyConfig.textAndInputPrivacyLevel = TextAndInputPrivacyLevel.MASK_SENSITIVE_INPUTS;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
...baseConfig,
|
|
89
|
+
...privacyConfig
|
|
39
90
|
};
|
|
40
91
|
};
|
|
41
92
|
|
|
@@ -46,10 +97,27 @@ export class SessionReplayWrapper {
|
|
|
46
97
|
enable = configuration => {
|
|
47
98
|
const {
|
|
48
99
|
replaySampleRate,
|
|
49
|
-
|
|
50
|
-
|
|
100
|
+
customEndpoint,
|
|
101
|
+
imagePrivacyLevel,
|
|
102
|
+
touchPrivacyLevel,
|
|
103
|
+
textAndInputPrivacyLevel,
|
|
104
|
+
startRecordingImmediately
|
|
51
105
|
} = this.buildConfiguration(configuration);
|
|
52
|
-
return this.nativeSessionReplay.enable(replaySampleRate,
|
|
106
|
+
return this.nativeSessionReplay.enable(replaySampleRate, customEndpoint, imagePrivacyLevel, touchPrivacyLevel, textAndInputPrivacyLevel, startRecordingImmediately);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Manually start the recording of the current session.
|
|
111
|
+
*/
|
|
112
|
+
startRecording = () => {
|
|
113
|
+
return this.nativeSessionReplay.startRecording();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Manually stop the recording of the current session.
|
|
118
|
+
*/
|
|
119
|
+
stopRecording = () => {
|
|
120
|
+
return this.nativeSessionReplay.stopRecording();
|
|
53
121
|
};
|
|
54
122
|
}
|
|
55
123
|
export const SessionReplay = new SessionReplayWrapper();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionReplayPrivacy","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","undefined","enable","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAIA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA
|
|
1
|
+
{"version":3,"names":["SessionReplayPrivacy","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","imagePrivacyLevel","MASK_ALL","touchPrivacyLevel","HIDE","textAndInputPrivacyLevel","startRecordingImmediately","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","baseConfig","undefined","privacyConfig","MASK_USER_INPUT","MASK_NONE","MASK_ALL_INPUTS","ALLOW","SHOW","MASK_SENSITIVE_INPUTS","enable","startRecording","stopRecording","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAIA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAiB7B,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAW7B,WAAYC,wBAAwB,0BAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAA,OAAxBA,wBAAwB;AAAA;;AAepC;AACA;AACA;;AAgEA,MAAMC,QA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AC,CAAC;EACnD,CAAC;AACL;AAEA,OAAO,MAAMC,aAAa,GAAG,IAAIlB,oBAAoB,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { SessionReplay, SessionReplayPrivacy } from './SessionReplay';
|
|
8
|
-
export { SessionReplay, SessionReplayPrivacy };
|
|
7
|
+
import { SessionReplay, SessionReplayPrivacy, ImagePrivacyLevel, TouchPrivacyLevel, TextAndInputPrivacyLevel } from './SessionReplay';
|
|
8
|
+
export { SessionReplay, SessionReplayPrivacy, ImagePrivacyLevel, TouchPrivacyLevel, TextAndInputPrivacyLevel };
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionReplay","SessionReplayPrivacy"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAGA,
|
|
1
|
+
{"version":3,"names":["SessionReplay","SessionReplayPrivacy","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAGA,SACIA,aAAa,EACbC,oBAAoB,EACpBC,iBAAiB,EACjBC,iBAAiB,EACjBC,wBAAwB,QACrB,iBAAiB;AAExB,SACIJ,aAAa,EACbC,oBAAoB,EACpBC,iBAAiB,EACjBC,iBAAiB,EACjBC,wBAAwB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSessionReplay.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSessionReplay.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;AACA;AACA;;AAmCA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -3,6 +3,46 @@ export declare enum SessionReplayPrivacy {
|
|
|
3
3
|
ALLOW = "ALLOW",
|
|
4
4
|
MASK_USER_INPUT = "MASK_USER_INPUT"
|
|
5
5
|
}
|
|
6
|
+
export declare enum ImagePrivacyLevel {
|
|
7
|
+
/**
|
|
8
|
+
* Only images that are bundled within the application will be recorded.
|
|
9
|
+
*
|
|
10
|
+
* On Android, all images larger than 100x100 dp will be masked, as we consider them non-bundled images.
|
|
11
|
+
*/
|
|
12
|
+
MASK_NON_BUNDLED_ONLY = "MASK_NON_BUNDLED_ONLY",
|
|
13
|
+
/**
|
|
14
|
+
* No images will be recorded.
|
|
15
|
+
*/
|
|
16
|
+
MASK_ALL = "MASK_ALL",
|
|
17
|
+
/**
|
|
18
|
+
* All images will be recorded, including the ones downloaded from the Internet or generated during the app runtime.
|
|
19
|
+
*/
|
|
20
|
+
MASK_NONE = "MASK_NONE"
|
|
21
|
+
}
|
|
22
|
+
export declare enum TouchPrivacyLevel {
|
|
23
|
+
/**
|
|
24
|
+
* Show all user touches.
|
|
25
|
+
*/
|
|
26
|
+
SHOW = "SHOW",
|
|
27
|
+
/**
|
|
28
|
+
* Hide all user touches.
|
|
29
|
+
*/
|
|
30
|
+
HIDE = "HIDE"
|
|
31
|
+
}
|
|
32
|
+
export declare enum TextAndInputPrivacyLevel {
|
|
33
|
+
/**
|
|
34
|
+
* Show all texts except sensitive inputs (e.g password fields).
|
|
35
|
+
*/
|
|
36
|
+
MASK_SENSITIVE_INPUTS = "MASK_SENSITIVE_INPUTS",
|
|
37
|
+
/**
|
|
38
|
+
* Mask all input fields (e.g text fields, switches, checkboxes).
|
|
39
|
+
*/
|
|
40
|
+
MASK_ALL_INPUTS = "MASK_ALL_INPUTS",
|
|
41
|
+
/**
|
|
42
|
+
* Mask all texts and inputs (e.g labels).
|
|
43
|
+
*/
|
|
44
|
+
MASK_ALL = "MASK_ALL"
|
|
45
|
+
}
|
|
6
46
|
/**
|
|
7
47
|
* The Session Replay configuration object.
|
|
8
48
|
*/
|
|
@@ -16,15 +56,36 @@ export interface SessionReplayConfiguration {
|
|
|
16
56
|
*/
|
|
17
57
|
replaySampleRate?: number;
|
|
18
58
|
/**
|
|
19
|
-
* Defines the way
|
|
20
|
-
*
|
|
21
|
-
* Default `SessionReplayPrivacy.MASK`.
|
|
59
|
+
* Defines the way images should be masked (Default: `MASK_ALL`)
|
|
22
60
|
*/
|
|
23
|
-
|
|
61
|
+
imagePrivacyLevel?: ImagePrivacyLevel;
|
|
62
|
+
/**
|
|
63
|
+
* Defines the way user touches (e.g tap) should be masked (Default: `HIDE`)
|
|
64
|
+
*/
|
|
65
|
+
touchPrivacyLevel?: TouchPrivacyLevel;
|
|
66
|
+
/**
|
|
67
|
+
* Defines the way text and input (e.g text fields, checkboxes) should be masked (Default: `MASK_ALL`)
|
|
68
|
+
*/
|
|
69
|
+
textAndInputPrivacyLevel?: TextAndInputPrivacyLevel;
|
|
24
70
|
/**
|
|
25
71
|
* Custom server url for sending replay data.
|
|
26
72
|
*/
|
|
27
73
|
customEndpoint?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Whether the recording should start automatically when the feature is enabled.
|
|
76
|
+
* When `true`, the recording starts automatically.
|
|
77
|
+
* when `false` it doesn't, and the recording will need to be started manually.
|
|
78
|
+
* Default: `true`.
|
|
79
|
+
*/
|
|
80
|
+
startRecordingImmediately?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Defines the way sensitive content (e.g. text) should be masked.
|
|
83
|
+
*
|
|
84
|
+
* Default `SessionReplayPrivacy.MASK`.
|
|
85
|
+
* @deprecated Use {@link imagePrivacyLevel}, {@link touchPrivacyLevel} and {@link textAndInputPrivacyLevel} instead.
|
|
86
|
+
* Note: setting this property (`defaultPrivacyLevel`) will override the individual privacy levels.
|
|
87
|
+
*/
|
|
88
|
+
defaultPrivacyLevel?: SessionReplayPrivacy;
|
|
28
89
|
}
|
|
29
90
|
export declare class SessionReplayWrapper {
|
|
30
91
|
private nativeSessionReplay;
|
|
@@ -34,6 +95,14 @@ export declare class SessionReplayWrapper {
|
|
|
34
95
|
* @param configuration: The session replay configuration.
|
|
35
96
|
*/
|
|
36
97
|
enable: (configuration?: SessionReplayConfiguration) => Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Manually start the recording of the current session.
|
|
100
|
+
*/
|
|
101
|
+
startRecording: () => Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Manually stop the recording of the current session.
|
|
104
|
+
*/
|
|
105
|
+
stopRecording: () => Promise<void>;
|
|
37
106
|
}
|
|
38
107
|
export declare const SessionReplay: SessionReplayWrapper;
|
|
39
108
|
//# sourceMappingURL=SessionReplay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionReplay.d.ts","sourceRoot":"","sources":["../../src/SessionReplay.ts"],"names":[],"mappings":"AAQA,oBAAY,oBAAoB;IAC5B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,eAAe,oBAAoB;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionReplay.d.ts","sourceRoot":"","sources":["../../src/SessionReplay.ts"],"names":[],"mappings":"AAQA,oBAAY,oBAAoB;IAC5B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,eAAe,oBAAoB;CACtC;AAED,oBAAY,iBAAiB;IACzB;;;;OAIG;IACH,qBAAqB,0BAA0B;IAC/C;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,SAAS,cAAc;CAC1B;AAED,oBAAY,iBAAiB;IACzB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;CAChB;AAED,oBAAY,wBAAwB;IAChC;;OAEG;IACH,qBAAqB,0BAA0B;IAC/C;;OAEG;IACH,eAAe,oBAAoB;IACnC;;OAEG;IACH,QAAQ,aAAa;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IAEpD;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;CAC9C;AA6BD,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,mBAAmB,CACd;IAEb,OAAO,CAAC,kBAAkB,CAiExB;IAEF;;;OAGG;IACH,MAAM,mBAAoB,0BAA0B,KAAG,QAAQ,IAAI,CAAC,CAkBlE;IAEF;;OAEG;IACH,cAAc,QAAO,QAAQ,IAAI,CAAC,CAEhC;IAEF;;OAEG;IACH,aAAa,QAAO,QAAQ,IAAI,CAAC,CAE/B;CACL;AAED,eAAO,MAAM,aAAa,sBAA6B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionReplayConfiguration } from './SessionReplay';
|
|
2
|
-
import { SessionReplay, SessionReplayPrivacy } from './SessionReplay';
|
|
3
|
-
export { SessionReplay, SessionReplayPrivacy };
|
|
2
|
+
import { SessionReplay, SessionReplayPrivacy, ImagePrivacyLevel, TouchPrivacyLevel, TextAndInputPrivacyLevel } from './SessionReplay';
|
|
3
|
+
export { SessionReplay, SessionReplayPrivacy, ImagePrivacyLevel, TouchPrivacyLevel, TextAndInputPrivacyLevel };
|
|
4
4
|
export type { SessionReplayConfiguration };
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,CAAC;AAEF,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -3,7 +3,9 @@ import type { Spec as NativeDdSessionReplay } from './specs/NativeDdSessionRepla
|
|
|
3
3
|
* In this file, native modules types extend the specs for TurboModules.
|
|
4
4
|
* As we cannot use enums or classes in the specs, we override methods using them here.
|
|
5
5
|
*/
|
|
6
|
-
type
|
|
6
|
+
type ImagePrivacyLevel = 'MASK_NON_BUNDLED_ONLY' | 'MASK_ALL' | 'MASK_NONE';
|
|
7
|
+
type TouchPrivacyLevel = 'SHOW' | 'HIDE';
|
|
8
|
+
type TextAndInputPrivacyLevel = 'MASK_SENSITIVE_INPUTS' | 'MASK_ALL_INPUTS' | 'MASK_ALL';
|
|
7
9
|
/**
|
|
8
10
|
* The entry point to use Datadog's Session Replay feature.
|
|
9
11
|
*/
|
|
@@ -11,10 +13,23 @@ export interface NativeSessionReplayType extends NativeDdSessionReplay {
|
|
|
11
13
|
/**
|
|
12
14
|
* Enable session replay and start recording session.
|
|
13
15
|
* @param replaySampleRate: The sample rate applied for session replay.
|
|
14
|
-
* @param defaultPrivacyLevel: The privacy level used for replay.
|
|
15
16
|
* @param customEndpoint: Custom server url for sending replay data.
|
|
17
|
+
* @param imagePrivacyLevel: Defines the way images should be masked.
|
|
18
|
+
* @param touchPrivacyLevel: Defines the way user touches should be masked.
|
|
19
|
+
* @param textAndInputPrivacyLevel: Defines the way text and input should be masked.
|
|
20
|
+
* @param startRecordingImmediately: Whether the recording should start automatically when the feature is enabled.
|
|
21
|
+
* When `true`, the recording starts automatically; when `false` it doesn't, and the recording will need
|
|
22
|
+
* to be started manually. Default: `true`.
|
|
16
23
|
*/
|
|
17
|
-
enable(replaySampleRate: number,
|
|
24
|
+
enable(replaySampleRate: number, customEndpoint: string, imagePrivacyLevel: ImagePrivacyLevel, touchPrivacyLevel: TouchPrivacyLevel, textAndInputPrivacyLevel: TextAndInputPrivacyLevel, startRecordingImmediately: boolean): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Manually start the recording of the current session.
|
|
27
|
+
*/
|
|
28
|
+
startRecording(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Manually stop the recording of the current session.
|
|
31
|
+
*/
|
|
32
|
+
stopRecording(): Promise<void>;
|
|
18
33
|
}
|
|
19
34
|
export {};
|
|
20
35
|
//# sourceMappingURL=nativeModulesTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeModulesTypes.d.ts","sourceRoot":"","sources":["../../src/nativeModulesTypes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;GAGG;AAEH,KAAK,
|
|
1
|
+
{"version":3,"file":"nativeModulesTypes.d.ts","sourceRoot":"","sources":["../../src/nativeModulesTypes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;GAGG;AAEH,KAAK,iBAAiB,GAAG,uBAAuB,GAAG,UAAU,GAAG,WAAW,CAAC;AAC5E,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AACzC,KAAK,wBAAwB,GACvB,uBAAuB,GACvB,iBAAiB,GACjB,UAAU,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IAClE;;;;;;;;;;OAUG;IACH,MAAM,CACF,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,wBAAwB,EAAE,wBAAwB,EAClD,yBAAyB,EAAE,OAAO,GACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhC;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC"}
|