@rovenue/react-native-sdk 0.28.2 → 0.28.4

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/dist/index.d.mts CHANGED
@@ -648,6 +648,19 @@ interface FunnelPresentResult {
648
648
  * days. Empty when there were none.
649
649
  */
650
650
  photos: Record<string, FunnelPhotoRef>;
651
+ /**
652
+ * The visitor's answers by question key: every key the funnel wrote —
653
+ * answers, `set_variable` results and app values — exactly as a web
654
+ * funnel's claim carries them (`FunnelClaimResult.funnelAnswers`). Empty
655
+ * when nothing was presented or nothing was answered.
656
+ */
657
+ answers: Record<string, unknown>;
658
+ /**
659
+ * The question keys an app value preselected and the visitor left
660
+ * unchanged, so a default can be told from a choice (the claim's
661
+ * `funnelPreselected`). Empty when none.
662
+ */
663
+ preselected: string[];
651
664
  }
652
665
  /**
653
666
  * Present the funnel a placement serves — natively, the way the funnel's
package/dist/index.d.ts CHANGED
@@ -648,6 +648,19 @@ interface FunnelPresentResult {
648
648
  * days. Empty when there were none.
649
649
  */
650
650
  photos: Record<string, FunnelPhotoRef>;
651
+ /**
652
+ * The visitor's answers by question key: every key the funnel wrote —
653
+ * answers, `set_variable` results and app values — exactly as a web
654
+ * funnel's claim carries them (`FunnelClaimResult.funnelAnswers`). Empty
655
+ * when nothing was presented or nothing was answered.
656
+ */
657
+ answers: Record<string, unknown>;
658
+ /**
659
+ * The question keys an app value preselected and the visitor left
660
+ * unchanged, so a default can be told from a choice (the claim's
661
+ * `funnelPreselected`). Empty when none.
662
+ */
663
+ preselected: string[];
651
664
  }
652
665
  /**
653
666
  * Present the funnel a placement serves — natively, the way the funnel's
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SDK_VERSION
3
- } from "./chunk-OY3RRQZQ.js";
3
+ } from "./chunk-YTPDJ5NA.js";
4
4
 
5
5
  // src/events.ts
6
6
  var EVENT_WIRE_VERSION = 1;
@@ -723,6 +723,18 @@ function answerCheckRequest(requestId, request, handler) {
723
723
  }
724
724
 
725
725
  // src/api/present-funnel.ts
726
+ function answersFrom(dto) {
727
+ let answers = {};
728
+ try {
729
+ const parsed = JSON.parse(dto.answersJson ?? "{}");
730
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
731
+ answers = parsed;
732
+ }
733
+ } catch {
734
+ }
735
+ const preselected = Array.isArray(dto.preselected) ? dto.preselected.filter((k) => typeof k === "string") : [];
736
+ return { answers, preselected };
737
+ }
726
738
  var FUNNEL_PRESENT_EVENT = "onFunnelPresentEvent";
727
739
  var presentationSerial = 0;
728
740
  function toError(dto) {
@@ -788,7 +800,8 @@ async function presentFunnel(options) {
788
800
  ...dto.customerInfo ? { customerInfo: dto.customerInfo } : {},
789
801
  ...dto.lastError ? { lastError: toError(dto.lastError) } : {},
790
802
  ...dto.reason ? { reason: dto.reason } : {},
791
- photos: photosFrom(dto.photos)
803
+ photos: photosFrom(dto.photos),
804
+ ...answersFrom(dto)
792
805
  };
793
806
  } catch (e) {
794
807
  throw fromNativeError(e);