@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/android/src/main/java/dev/rovenue/sdkrn/RovenueModule.kt +2 -0
- package/dist/chunk-YTPDJ5NA.js +7 -0
- package/dist/{chunk-OY3RRQZQ.js.map → chunk-YTPDJ5NA.js.map} +1 -1
- package/dist/index.cjs +15 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.mts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/RovenueModule.swift +2 -0
- package/package.json +1 -1
- package/dist/chunk-OY3RRQZQ.js +0 -7
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-
|
|
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);
|