@datadog/mobile-react-native-session-replay 2.4.0-alpha.0 → 2.4.2-alpha.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.
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => "11.0", :tvos => "11.0" }
13
+ s.platforms = { :ios => "12.0", :tvos => "12.0" }
14
14
  s.source = { :git => "https://github.com/DataDog/dd-sdk-reactnative.git", :tag => "#{s.version}" }
15
15
 
16
16
 
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
19
19
  s.dependency "React-Core"
20
20
 
21
21
  # /!\ Remember to keep the version in sync with DatadogSDKReactNative.podspec
22
- s.dependency 'DatadogSessionReplay', '~> 2.13.0'
22
+ s.dependency 'DatadogSessionReplay', '~> 2.14.1'
23
23
  s.dependency 'DatadogSDKReactNative'
24
24
 
25
25
  s.test_spec 'Tests' do |test_spec|
@@ -3,68 +3,58 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SessionReplay = exports.SessionReplayWrapper = exports.SessionReplayPrivacy = void 0;
7
-
8
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
-
6
+ exports.SessionReplayWrapper = exports.SessionReplayPrivacy = exports.SessionReplay = void 0;
10
7
  /*
11
8
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
9
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
10
  * Copyright 2016-Present Datadog, Inc.
14
11
  */
15
- let SessionReplayPrivacy;
16
- /**
17
- * The Session Replay configuration object.
18
- */
19
-
20
- exports.SessionReplayPrivacy = SessionReplayPrivacy;
21
-
22
- (function (SessionReplayPrivacy) {
12
+ let SessionReplayPrivacy = exports.SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
23
13
  SessionReplayPrivacy["MASK"] = "MASK";
24
14
  SessionReplayPrivacy["ALLOW"] = "ALLOW";
25
15
  SessionReplayPrivacy["MASK_USER_INPUT"] = "MASK_USER_INPUT";
26
- })(SessionReplayPrivacy || (exports.SessionReplayPrivacy = SessionReplayPrivacy = {}));
27
-
16
+ return SessionReplayPrivacy;
17
+ }({});
18
+ /**
19
+ * The Session Replay configuration object.
20
+ */
28
21
  const DEFAULTS = {
29
22
  replaySampleRate: 0,
30
23
  defaultPrivacyLevel: SessionReplayPrivacy.MASK,
31
24
  customEndpoint: ''
32
25
  };
33
-
34
26
  class SessionReplayWrapper {
35
- constructor() {
36
- _defineProperty(this, "nativeSessionReplay", require('./specs/NativeDdSessionReplay').default);
37
-
38
- _defineProperty(this, "buildConfiguration", configuration => {
39
- if (!configuration) {
40
- return DEFAULTS;
41
- }
42
-
43
- const {
44
- replaySampleRate,
45
- defaultPrivacyLevel,
46
- customEndpoint
47
- } = configuration;
48
- return {
49
- replaySampleRate: replaySampleRate !== undefined ? replaySampleRate : DEFAULTS.replaySampleRate,
50
- defaultPrivacyLevel: defaultPrivacyLevel !== undefined ? defaultPrivacyLevel : DEFAULTS.defaultPrivacyLevel,
51
- customEndpoint: customEndpoint !== undefined ? customEndpoint : DEFAULTS.customEndpoint
52
- };
53
- });
54
-
55
- _defineProperty(this, "enable", configuration => {
56
- const {
57
- replaySampleRate,
58
- defaultPrivacyLevel,
59
- customEndpoint
60
- } = this.buildConfiguration(configuration);
61
- return this.nativeSessionReplay.enable(replaySampleRate, defaultPrivacyLevel, customEndpoint);
62
- });
63
- }
64
-
27
+ // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
28
+ nativeSessionReplay = require('./specs/NativeDdSessionReplay').default;
29
+ buildConfiguration = configuration => {
30
+ if (!configuration) {
31
+ return DEFAULTS;
32
+ }
33
+ const {
34
+ replaySampleRate,
35
+ defaultPrivacyLevel,
36
+ customEndpoint
37
+ } = configuration;
38
+ return {
39
+ replaySampleRate: replaySampleRate !== undefined ? replaySampleRate : DEFAULTS.replaySampleRate,
40
+ defaultPrivacyLevel: defaultPrivacyLevel !== undefined ? defaultPrivacyLevel : DEFAULTS.defaultPrivacyLevel,
41
+ customEndpoint: customEndpoint !== undefined ? customEndpoint : DEFAULTS.customEndpoint
42
+ };
43
+ };
44
+
45
+ /**
46
+ * Enable session replay and start recording session.
47
+ * @param configuration: The session replay configuration.
48
+ */
49
+ enable = configuration => {
50
+ const {
51
+ replaySampleRate,
52
+ defaultPrivacyLevel,
53
+ customEndpoint
54
+ } = this.buildConfiguration(configuration);
55
+ return this.nativeSessionReplay.enable(replaySampleRate, defaultPrivacyLevel, customEndpoint);
56
+ };
65
57
  }
66
-
67
58
  exports.SessionReplayWrapper = SessionReplayWrapper;
68
- const SessionReplay = new SessionReplayWrapper();
69
- exports.SessionReplay = SessionReplay;
59
+ const SessionReplay = exports.SessionReplay = new SessionReplayWrapper();
70
60
  //# sourceMappingURL=SessionReplay.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["SessionReplay.ts"],"names":["SessionReplayPrivacy","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","SessionReplayWrapper","require","default","configuration","undefined","buildConfiguration","nativeSessionReplay","enable","SessionReplay"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;IAIYA,oB;AAMZ;AACA;AACA;;;;WARYA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;GAAAA,oB,oCAAAA,oB;;AA8BZ,MAAMC,QAAQ,GAAG;AACbC,EAAAA,gBAAgB,EAAE,CADL;AAEbC,EAAAA,mBAAmB,EAAEH,oBAAoB,CAACI,IAF7B;AAGbC,EAAAA,cAAc,EAAE;AAHH,CAAjB;;AAMO,MAAMC,oBAAN,CAA2B;AAAA;AAAA,iDAEyBC,OAAO,CAAC,+BAAD,CAAP,CAClDC,OAHyB;;AAAA,gDAM1BC,aADyB,IAMxB;AACD,UAAI,CAACA,aAAL,EAAoB;AAChB,eAAOR,QAAP;AACH;;AACD,YAAM;AACFC,QAAAA,gBADE;AAEFC,QAAAA,mBAFE;AAGFE,QAAAA;AAHE,UAIFI,aAJJ;AAKA,aAAO;AACHP,QAAAA,gBAAgB,EACZA,gBAAgB,KAAKQ,SAArB,GACMR,gBADN,GAEMD,QAAQ,CAACC,gBAJhB;AAKHC,QAAAA,mBAAmB,EACfA,mBAAmB,KAAKO,SAAxB,GACMP,mBADN,GAEMF,QAAQ,CAACE,mBARhB;AASHE,QAAAA,cAAc,EACVA,cAAc,KAAKK,SAAnB,GACML,cADN,GAEMJ,QAAQ,CAACI;AAZhB,OAAP;AAcH,KAlC6B;;AAAA,oCAwCpBI,aAAD,IAA+D;AACpE,YAAM;AACFP,QAAAA,gBADE;AAEFC,QAAAA,mBAFE;AAGFE,QAAAA;AAHE,UAIF,KAAKM,kBAAL,CAAwBF,aAAxB,CAJJ;AAMA,aAAO,KAAKG,mBAAL,CAAyBC,MAAzB,CACHX,gBADG,EAEHC,mBAFG,EAGHE,cAHG,CAAP;AAKH,KApD6B;AAAA;;AAAA;;;AAuD3B,MAAMS,aAAa,GAAG,IAAIR,oBAAJ,EAAtB","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { NativeSessionReplayType } from './nativeModulesTypes';\n\nexport enum SessionReplayPrivacy {\n MASK = 'MASK',\n ALLOW = 'ALLOW',\n MASK_USER_INPUT = 'MASK_USER_INPUT'\n}\n\n/**\n * The Session Replay configuration object.\n */\nexport interface SessionReplayConfiguration {\n /**\n * The sampling rate for Session Replay.\n * It is applied in addition to the RUM session sample rate.\n * Range `0`-`100`.\n *\n * Default value is `20`.\n */\n replaySampleRate?: number;\n /**\n * Defines the way sensitive content (e.g. text) should be masked.\n *\n * Default `SessionReplayPrivacy.MASK`.\n */\n defaultPrivacyLevel?: SessionReplayPrivacy;\n /**\n * Custom server url for sending replay data.\n */\n customEndpoint?: string;\n}\n\nconst DEFAULTS = {\n replaySampleRate: 0,\n defaultPrivacyLevel: SessionReplayPrivacy.MASK,\n customEndpoint: ''\n};\n\nexport class SessionReplayWrapper {\n // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires\n private nativeSessionReplay: NativeSessionReplayType = require('./specs/NativeDdSessionReplay')\n .default;\n\n private buildConfiguration = (\n configuration?: SessionReplayConfiguration\n ): {\n replaySampleRate: number;\n defaultPrivacyLevel: SessionReplayPrivacy;\n customEndpoint: string;\n } => {\n if (!configuration) {\n return DEFAULTS;\n }\n const {\n replaySampleRate,\n defaultPrivacyLevel,\n customEndpoint\n } = configuration;\n return {\n replaySampleRate:\n replaySampleRate !== undefined\n ? replaySampleRate\n : DEFAULTS.replaySampleRate,\n defaultPrivacyLevel:\n defaultPrivacyLevel !== undefined\n ? defaultPrivacyLevel\n : DEFAULTS.defaultPrivacyLevel,\n customEndpoint:\n customEndpoint !== undefined\n ? customEndpoint\n : DEFAULTS.customEndpoint\n };\n };\n\n /**\n * Enable session replay and start recording session.\n * @param configuration: The session replay configuration.\n */\n enable = (configuration?: SessionReplayConfiguration): Promise<void> => {\n const {\n replaySampleRate,\n defaultPrivacyLevel,\n customEndpoint\n } = this.buildConfiguration(configuration);\n\n return this.nativeSessionReplay.enable(\n replaySampleRate,\n defaultPrivacyLevel,\n customEndpoint\n );\n };\n}\n\nexport const SessionReplay = new SessionReplayWrapper();\n"]}
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;AAMhC;AACA;AACA;AAsBA,MAAME,QAAQ,GAAG;EACbC,gBAAgB,EAAE,CAAC;EACnBC,mBAAmB,EAAEJ,oBAAoB,CAACK,IAAI;EAC9CC,cAAc,EAAE;AACpB,CAAC;AAEM,MAAMC,oBAAoB,CAAC;EAC9B;EACQC,mBAAmB,GAA4BC,OAAO,CAAC,+BAA+B,CAAC,CAC1FC,OAAO;EAEJC,kBAAkB,GACtBC,aAA0C,IAKzC;IACD,IAAI,CAACA,aAAa,EAAE;MAChB,OAAOV,QAAQ;IACnB;IACA,MAAM;MACFC,gBAAgB;MAChBC,mBAAmB;MACnBE;IACJ,CAAC,GAAGM,aAAa;IACjB,OAAO;MACHT,gBAAgB,EACZA,gBAAgB,KAAKU,SAAS,GACxBV,gBAAgB,GAChBD,QAAQ,CAACC,gBAAgB;MACnCC,mBAAmB,EACfA,mBAAmB,KAAKS,SAAS,GAC3BT,mBAAmB,GACnBF,QAAQ,CAACE,mBAAmB;MACtCE,cAAc,EACVA,cAAc,KAAKO,SAAS,GACtBP,cAAc,GACdJ,QAAQ,CAACI;IACvB,CAAC;EACL,CAAC;;EAED;AACJ;AACA;AACA;EACIQ,MAAM,GAAIF,aAA0C,IAAoB;IACpE,MAAM;MACFT,gBAAgB;MAChBC,mBAAmB;MACnBE;IACJ,CAAC,GAAG,IAAI,CAACK,kBAAkB,CAACC,aAAa,CAAC;IAE1C,OAAO,IAAI,CAACJ,mBAAmB,CAACM,MAAM,CAClCX,gBAAgB,EAChBC,mBAAmB,EACnBE,cACJ,CAAC;EACL,CAAC;AACL;AAACL,OAAA,CAAAM,oBAAA,GAAAA,oBAAA;AAEM,MAAMQ,aAAa,GAAAd,OAAA,CAAAc,aAAA,GAAG,IAAIR,oBAAoB,CAAC,CAAC","ignoreList":[]}
@@ -15,6 +15,5 @@ Object.defineProperty(exports, "SessionReplayPrivacy", {
15
15
  return _SessionReplay.SessionReplayPrivacy;
16
16
  }
17
17
  });
18
-
19
18
  var _SessionReplay = require("./SessionReplay");
20
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAOA","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { SessionReplayConfiguration } from './SessionReplay';\nimport { SessionReplay, SessionReplayPrivacy } from './SessionReplay';\n\nexport { SessionReplay, SessionReplayPrivacy };\n\nexport type { SessionReplayConfiguration };\n"]}
1
+ {"version":3,"names":["_SessionReplay","require"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAOA,IAAAA,cAAA,GAAAC,OAAA","ignoreList":[]}
@@ -1,2 +1,6 @@
1
1
  "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
2
6
  //# sourceMappingURL=nativeModulesTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["nativeModulesTypes.ts"],"mappings":"","ignoreList":[]}
@@ -4,17 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _reactNative = require("react-native");
9
-
10
8
  /*
11
9
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
10
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
11
  * Copyright 2016-Present Datadog, Inc.
14
12
  */
15
-
16
13
  /* eslint-disable @typescript-eslint/ban-types */
17
- var _default = _reactNative.TurboModuleRegistry.get('DdSessionReplay');
18
-
19
- exports.default = _default;
14
+ /**
15
+ * Do not import this Spec directly, use NativeSessionReplayType instead.
16
+ */
17
+ // eslint-disable-next-line func-names
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('DdSessionReplay');
20
19
  //# sourceMappingURL=NativeDdSessionReplay.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeDdSessionReplay.ts"],"names":["TurboModuleRegistry","get"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;AACA;AACA;;AAEA;eAuBeA,iCAAoBC,GAApB,CAA8B,iBAA9B,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/**\n * Do not import this Spec directly, use NativeSessionReplayType instead.\n */\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n /**\n * Enable session replay and start recording session.\n * @param replaySampleRate: The sample rate applied for session replay.\n * @param defaultPrivacyLevel: The privacy level used for replay.\n * @param customEndpoint: Custom server url for sending replay data.\n */\n enable(\n replaySampleRate: number,\n defaultPrivacyLevel: string,\n customEndpoint: string\n ): Promise<void>;\n}\n\nexport default TurboModuleRegistry.get<Spec>('DdSessionReplay');\n"]}
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;AAiBA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,iBAAiB,CAAC","ignoreList":[]}
@@ -1,20 +1,19 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
1
  /*
4
2
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
5
3
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
6
4
  * Copyright 2016-Present Datadog, Inc.
7
5
  */
8
- export let SessionReplayPrivacy;
9
- /**
10
- * The Session Replay configuration object.
11
- */
12
6
 
13
- (function (SessionReplayPrivacy) {
7
+ export let SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
14
8
  SessionReplayPrivacy["MASK"] = "MASK";
15
9
  SessionReplayPrivacy["ALLOW"] = "ALLOW";
16
10
  SessionReplayPrivacy["MASK_USER_INPUT"] = "MASK_USER_INPUT";
17
- })(SessionReplayPrivacy || (SessionReplayPrivacy = {}));
11
+ return SessionReplayPrivacy;
12
+ }({});
13
+
14
+ /**
15
+ * The Session Replay configuration object.
16
+ */
18
17
 
19
18
  const DEFAULTS = {
20
19
  replaySampleRate: 0,
@@ -22,36 +21,36 @@ const DEFAULTS = {
22
21
  customEndpoint: ''
23
22
  };
24
23
  export class SessionReplayWrapper {
25
- constructor() {
26
- _defineProperty(this, "nativeSessionReplay", require('./specs/NativeDdSessionReplay').default);
27
-
28
- _defineProperty(this, "buildConfiguration", configuration => {
29
- if (!configuration) {
30
- return DEFAULTS;
31
- }
32
-
33
- const {
34
- replaySampleRate,
35
- defaultPrivacyLevel,
36
- customEndpoint
37
- } = configuration;
38
- return {
39
- replaySampleRate: replaySampleRate !== undefined ? replaySampleRate : DEFAULTS.replaySampleRate,
40
- defaultPrivacyLevel: defaultPrivacyLevel !== undefined ? defaultPrivacyLevel : DEFAULTS.defaultPrivacyLevel,
41
- customEndpoint: customEndpoint !== undefined ? customEndpoint : DEFAULTS.customEndpoint
42
- };
43
- });
44
-
45
- _defineProperty(this, "enable", configuration => {
46
- const {
47
- replaySampleRate,
48
- defaultPrivacyLevel,
49
- customEndpoint
50
- } = this.buildConfiguration(configuration);
51
- return this.nativeSessionReplay.enable(replaySampleRate, defaultPrivacyLevel, customEndpoint);
52
- });
53
- }
24
+ // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
25
+ nativeSessionReplay = require('./specs/NativeDdSessionReplay').default;
26
+ buildConfiguration = configuration => {
27
+ if (!configuration) {
28
+ return DEFAULTS;
29
+ }
30
+ const {
31
+ replaySampleRate,
32
+ defaultPrivacyLevel,
33
+ customEndpoint
34
+ } = configuration;
35
+ return {
36
+ replaySampleRate: replaySampleRate !== undefined ? replaySampleRate : DEFAULTS.replaySampleRate,
37
+ defaultPrivacyLevel: defaultPrivacyLevel !== undefined ? defaultPrivacyLevel : DEFAULTS.defaultPrivacyLevel,
38
+ customEndpoint: customEndpoint !== undefined ? customEndpoint : DEFAULTS.customEndpoint
39
+ };
40
+ };
54
41
 
42
+ /**
43
+ * Enable session replay and start recording session.
44
+ * @param configuration: The session replay configuration.
45
+ */
46
+ enable = configuration => {
47
+ const {
48
+ replaySampleRate,
49
+ defaultPrivacyLevel,
50
+ customEndpoint
51
+ } = this.buildConfiguration(configuration);
52
+ return this.nativeSessionReplay.enable(replaySampleRate, defaultPrivacyLevel, customEndpoint);
53
+ };
55
54
  }
56
55
  export const SessionReplay = new SessionReplayWrapper();
57
56
  //# sourceMappingURL=SessionReplay.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["SessionReplay.ts"],"names":["SessionReplayPrivacy","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","SessionReplayWrapper","require","default","configuration","undefined","buildConfiguration","nativeSessionReplay","enable","SessionReplay"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AAIA,WAAYA,oBAAZ;AAMA;AACA;AACA;;WARYA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;GAAAA,oB,KAAAA,oB;;AA8BZ,MAAMC,QAAQ,GAAG;AACbC,EAAAA,gBAAgB,EAAE,CADL;AAEbC,EAAAA,mBAAmB,EAAEH,oBAAoB,CAACI,IAF7B;AAGbC,EAAAA,cAAc,EAAE;AAHH,CAAjB;AAMA,OAAO,MAAMC,oBAAN,CAA2B;AAAA;AAAA,iDAEyBC,OAAO,CAAC,+BAAD,CAAP,CAClDC,OAHyB;;AAAA,gDAM1BC,aADyB,IAMxB;AACD,UAAI,CAACA,aAAL,EAAoB;AAChB,eAAOR,QAAP;AACH;;AACD,YAAM;AACFC,QAAAA,gBADE;AAEFC,QAAAA,mBAFE;AAGFE,QAAAA;AAHE,UAIFI,aAJJ;AAKA,aAAO;AACHP,QAAAA,gBAAgB,EACZA,gBAAgB,KAAKQ,SAArB,GACMR,gBADN,GAEMD,QAAQ,CAACC,gBAJhB;AAKHC,QAAAA,mBAAmB,EACfA,mBAAmB,KAAKO,SAAxB,GACMP,mBADN,GAEMF,QAAQ,CAACE,mBARhB;AASHE,QAAAA,cAAc,EACVA,cAAc,KAAKK,SAAnB,GACML,cADN,GAEMJ,QAAQ,CAACI;AAZhB,OAAP;AAcH,KAlC6B;;AAAA,oCAwCpBI,aAAD,IAA+D;AACpE,YAAM;AACFP,QAAAA,gBADE;AAEFC,QAAAA,mBAFE;AAGFE,QAAAA;AAHE,UAIF,KAAKM,kBAAL,CAAwBF,aAAxB,CAJJ;AAMA,aAAO,KAAKG,mBAAL,CAAyBC,MAAzB,CACHX,gBADG,EAEHC,mBAFG,EAGHE,cAHG,CAAP;AAKH,KApD6B;AAAA;;AAAA;AAuDlC,OAAO,MAAMS,aAAa,GAAG,IAAIR,oBAAJ,EAAtB","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { NativeSessionReplayType } from './nativeModulesTypes';\n\nexport enum SessionReplayPrivacy {\n MASK = 'MASK',\n ALLOW = 'ALLOW',\n MASK_USER_INPUT = 'MASK_USER_INPUT'\n}\n\n/**\n * The Session Replay configuration object.\n */\nexport interface SessionReplayConfiguration {\n /**\n * The sampling rate for Session Replay.\n * It is applied in addition to the RUM session sample rate.\n * Range `0`-`100`.\n *\n * Default value is `20`.\n */\n replaySampleRate?: number;\n /**\n * Defines the way sensitive content (e.g. text) should be masked.\n *\n * Default `SessionReplayPrivacy.MASK`.\n */\n defaultPrivacyLevel?: SessionReplayPrivacy;\n /**\n * Custom server url for sending replay data.\n */\n customEndpoint?: string;\n}\n\nconst DEFAULTS = {\n replaySampleRate: 0,\n defaultPrivacyLevel: SessionReplayPrivacy.MASK,\n customEndpoint: ''\n};\n\nexport class SessionReplayWrapper {\n // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires\n private nativeSessionReplay: NativeSessionReplayType = require('./specs/NativeDdSessionReplay')\n .default;\n\n private buildConfiguration = (\n configuration?: SessionReplayConfiguration\n ): {\n replaySampleRate: number;\n defaultPrivacyLevel: SessionReplayPrivacy;\n customEndpoint: string;\n } => {\n if (!configuration) {\n return DEFAULTS;\n }\n const {\n replaySampleRate,\n defaultPrivacyLevel,\n customEndpoint\n } = configuration;\n return {\n replaySampleRate:\n replaySampleRate !== undefined\n ? replaySampleRate\n : DEFAULTS.replaySampleRate,\n defaultPrivacyLevel:\n defaultPrivacyLevel !== undefined\n ? defaultPrivacyLevel\n : DEFAULTS.defaultPrivacyLevel,\n customEndpoint:\n customEndpoint !== undefined\n ? customEndpoint\n : DEFAULTS.customEndpoint\n };\n };\n\n /**\n * Enable session replay and start recording session.\n * @param configuration: The session replay configuration.\n */\n enable = (configuration?: SessionReplayConfiguration): Promise<void> => {\n const {\n replaySampleRate,\n defaultPrivacyLevel,\n customEndpoint\n } = this.buildConfiguration(configuration);\n\n return this.nativeSessionReplay.enable(\n replaySampleRate,\n defaultPrivacyLevel,\n customEndpoint\n );\n };\n}\n\nexport const SessionReplay = new SessionReplayWrapper();\n"]}
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;;AAMhC;AACA;AACA;;AAsBA,MAAMC,QAAQ,GAAG;EACbC,gBAAgB,EAAE,CAAC;EACnBC,mBAAmB,EAAEH,oBAAoB,CAACI,IAAI;EAC9CC,cAAc,EAAE;AACpB,CAAC;AAED,OAAO,MAAMC,oBAAoB,CAAC;EAC9B;EACQC,mBAAmB,GAA4BC,OAAO,CAAC,+BAA+B,CAAC,CAC1FC,OAAO;EAEJC,kBAAkB,GACtBC,aAA0C,IAKzC;IACD,IAAI,CAACA,aAAa,EAAE;MAChB,OAAOV,QAAQ;IACnB;IACA,MAAM;MACFC,gBAAgB;MAChBC,mBAAmB;MACnBE;IACJ,CAAC,GAAGM,aAAa;IACjB,OAAO;MACHT,gBAAgB,EACZA,gBAAgB,KAAKU,SAAS,GACxBV,gBAAgB,GAChBD,QAAQ,CAACC,gBAAgB;MACnCC,mBAAmB,EACfA,mBAAmB,KAAKS,SAAS,GAC3BT,mBAAmB,GACnBF,QAAQ,CAACE,mBAAmB;MACtCE,cAAc,EACVA,cAAc,KAAKO,SAAS,GACtBP,cAAc,GACdJ,QAAQ,CAACI;IACvB,CAAC;EACL,CAAC;;EAED;AACJ;AACA;AACA;EACIQ,MAAM,GAAIF,aAA0C,IAAoB;IACpE,MAAM;MACFT,gBAAgB;MAChBC,mBAAmB;MACnBE;IACJ,CAAC,GAAG,IAAI,CAACK,kBAAkB,CAACC,aAAa,CAAC;IAE1C,OAAO,IAAI,CAACJ,mBAAmB,CAACM,MAAM,CAClCX,gBAAgB,EAChBC,mBAAmB,EACnBE,cACJ,CAAC;EACL,CAAC;AACL;AAEA,OAAO,MAAMS,aAAa,GAAG,IAAIR,oBAAoB,CAAC,CAAC","ignoreList":[]}
@@ -3,6 +3,7 @@
3
3
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
4
  * Copyright 2016-Present Datadog, Inc.
5
5
  */
6
+
6
7
  import { SessionReplay, SessionReplayPrivacy } from './SessionReplay';
7
8
  export { SessionReplay, SessionReplayPrivacy };
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["SessionReplay","SessionReplayPrivacy"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AAGA,SAASA,aAAT,EAAwBC,oBAAxB,QAAoD,iBAApD;AAEA,SAASD,aAAT,EAAwBC,oBAAxB","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { SessionReplayConfiguration } from './SessionReplay';\nimport { SessionReplay, SessionReplayPrivacy } from './SessionReplay';\n\nexport { SessionReplay, SessionReplayPrivacy };\n\nexport type { SessionReplayConfiguration };\n"]}
1
+ {"version":3,"names":["SessionReplay","SessionReplayPrivacy"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,EAAEC,oBAAoB,QAAQ,iBAAiB;AAErE,SAASD,aAAa,EAAEC,oBAAoB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
-
1
+ export {};
2
2
  //# sourceMappingURL=nativeModulesTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["nativeModulesTypes.ts"],"mappings":"","ignoreList":[]}
@@ -5,10 +5,13 @@
5
5
  */
6
6
 
7
7
  /* eslint-disable @typescript-eslint/ban-types */
8
+
8
9
  import { TurboModuleRegistry } from 'react-native';
10
+
9
11
  /**
10
12
  * Do not import this Spec directly, use NativeSessionReplayType instead.
11
13
  */
12
14
 
15
+ // eslint-disable-next-line func-names
13
16
  export default TurboModuleRegistry.get('DdSessionReplay');
14
17
  //# sourceMappingURL=NativeDdSessionReplay.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeDdSessionReplay.ts"],"names":["TurboModuleRegistry","get"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AAEA,SAASA,mBAAT,QAAoC,cAApC;AAEA;AACA;AACA;;AAiBA,eAAeA,mBAAmB,CAACC,GAApB,CAA8B,iBAA9B,CAAf","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/**\n * Do not import this Spec directly, use NativeSessionReplayType instead.\n */\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n /**\n * Enable session replay and start recording session.\n * @param replaySampleRate: The sample rate applied for session replay.\n * @param defaultPrivacyLevel: The privacy level used for replay.\n * @param customEndpoint: Custom server url for sending replay data.\n */\n enable(\n replaySampleRate: number,\n defaultPrivacyLevel: string,\n customEndpoint: string\n ): Promise<void>;\n}\n\nexport default TurboModuleRegistry.get<Spec>('DdSessionReplay');\n"]}
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;;AAiBA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,iBAAiB,CAAC","ignoreList":[]}
@@ -36,3 +36,4 @@ export declare class SessionReplayWrapper {
36
36
  enable: (configuration?: SessionReplayConfiguration) => Promise<void>;
37
37
  }
38
38
  export declare const SessionReplay: SessionReplayWrapper;
39
+ //# sourceMappingURL=SessionReplay.d.ts.map
@@ -0,0 +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;IAC1B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;IAC3C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,mBAAmB,CACd;IAEb,OAAO,CAAC,kBAAkB,CA6BxB;IAEF;;;OAGG;IACH,MAAM,mBAAoB,0BAA0B,KAAG,QAAQ,IAAI,CAAC,CAYlE;CACL;AAED,eAAO,MAAM,aAAa,sBAA6B,CAAC"}
@@ -2,3 +2,4 @@ import type { SessionReplayConfiguration } from './SessionReplay';
2
2
  import { SessionReplay, SessionReplayPrivacy } from './SessionReplay';
3
3
  export { SessionReplay, SessionReplayPrivacy };
4
4
  export type { SessionReplayConfiguration };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;AAE/C,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
@@ -17,3 +17,4 @@ export interface NativeSessionReplayType extends NativeDdSessionReplay {
17
17
  enable(replaySampleRate: number, defaultPrivacyLevel: PrivacyLevel, customEndpoint: string): Promise<void>;
18
18
  }
19
19
  export {};
20
+ //# sourceMappingURL=nativeModulesTypes.d.ts.map
@@ -0,0 +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,YAAY,GAAG,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IAClE;;;;;OAKG;IACH,MAAM,CACF,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,EAAE,YAAY,EACjC,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
@@ -14,3 +14,4 @@ export interface Spec extends TurboModule {
14
14
  }
15
15
  declare const _default: Spec | null;
16
16
  export default _default;
17
+ //# sourceMappingURL=NativeDdSessionReplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeDdSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeDdSessionReplay.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;GAEG;AACH,MAAM,WAAW,IAAK,SAAQ,WAAW;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;;OAKG;IACH,MAAM,CACF,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;;AAGD,wBAAgE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/mobile-react-native-session-replay",
3
- "version": "2.4.0-alpha.0",
3
+ "version": "2.4.2-alpha.0",
4
4
  "description": "A client-side React Native module to enable session replay with Datadog",
5
5
  "keywords": [
6
6
  "datadog",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@testing-library/react-native": "7.0.2",
50
- "react-native-builder-bob": "0.17.1"
50
+ "react-native-builder-bob": "0.26.0"
51
51
  },
52
52
  "jest": {
53
53
  "preset": "react-native",
@@ -27,4 +27,5 @@ export interface Spec extends TurboModule {
27
27
  ): Promise<void>;
28
28
  }
29
29
 
30
+ // eslint-disable-next-line func-names
30
31
  export default TurboModuleRegistry.get<Spec>('DdSessionReplay');