@rovenue/react-native-sdk 0.28.3 → 0.28.5

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.
@@ -499,6 +499,8 @@ class RovenueModule : Module() {
499
499
  "lastError" to result.lastError?.let(::errorDto),
500
500
  "reason" to result.reason,
501
501
  "photos" to result.photos.mapValues { (_, photo) -> FunnelCheckRequests.photoDto(photo) },
502
+ "answersJson" to result.answersJson,
503
+ "preselected" to result.preselected,
502
504
  )
503
505
  }
504
506
 
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var SDK_VERSION = "0.28.5";
3
+
4
+ export {
5
+ SDK_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-ZK6V36IR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["/** This package's version, as published — the same string `package.json` carries. */\nexport const SDK_VERSION = \"0.28.3\";\n"],"mappings":";AACO,IAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["/** This package's version, as published — the same string `package.json` carries. */\nexport const SDK_VERSION = \"0.28.5\";\n"],"mappings":";AACO,IAAM,cAAc;","names":[]}
package/dist/index.cjs CHANGED
@@ -44,7 +44,7 @@ __export(index_exports, {
44
44
  module.exports = __toCommonJS(index_exports);
45
45
 
46
46
  // src/version.ts
47
- var SDK_VERSION = "0.28.3";
47
+ var SDK_VERSION = "0.28.5";
48
48
 
49
49
  // src/events.ts
50
50
  var EVENT_WIRE_VERSION = 1;
@@ -767,6 +767,18 @@ function answerCheckRequest(requestId, request, handler) {
767
767
  }
768
768
 
769
769
  // src/api/present-funnel.ts
770
+ function answersFrom(dto) {
771
+ let answers = {};
772
+ try {
773
+ const parsed = JSON.parse(dto.answersJson ?? "{}");
774
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
775
+ answers = parsed;
776
+ }
777
+ } catch {
778
+ }
779
+ const preselected = Array.isArray(dto.preselected) ? dto.preselected.filter((k) => typeof k === "string") : [];
780
+ return { answers, preselected };
781
+ }
770
782
  var FUNNEL_PRESENT_EVENT = "onFunnelPresentEvent";
771
783
  var presentationSerial = 0;
772
784
  function toError(dto) {
@@ -832,7 +844,8 @@ async function presentFunnel(options) {
832
844
  ...dto.customerInfo ? { customerInfo: dto.customerInfo } : {},
833
845
  ...dto.lastError ? { lastError: toError(dto.lastError) } : {},
834
846
  ...dto.reason ? { reason: dto.reason } : {},
835
- photos: photosFrom(dto.photos)
847
+ photos: photosFrom(dto.photos),
848
+ ...answersFrom(dto)
836
849
  };
837
850
  } catch (e) {
838
851
  throw fromNativeError(e);