@reclaimprotocol/inapp-rn-sdk 0.3.1 → 0.7.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/InappRnSdk.podspec +2 -1
- package/README.md +19 -17
- package/android/build.gradle +3 -3
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h +45 -35
- package/android/src/main/java/com/reclaimprotocol/inapp_rn_sdk/InappRnSdkModule.kt +18 -12
- package/ios/InappRnSdk.mm +8 -13
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec.h +18 -12
- package/ios/generated/RNInappRnSdkSpecJSI.h +45 -35
- package/ios/inapp_rn_sdk/Api.swift +32 -21
- package/lib/commonjs/index.js +227 -22
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeInappRnSdk.js.map +1 -1
- package/lib/module/index.js +223 -21
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeInappRnSdk.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +41 -10
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts +18 -11
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +41 -10
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts +18 -11
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +378 -65
- package/src/specs/NativeInappRnSdk.ts +22 -13
- package/lib/commonjs/platform.js +0 -212
- package/lib/commonjs/platform.js.map +0 -1
- package/lib/module/platform.js +0 -206
- package/lib/module/platform.js.map +0 -1
- package/lib/typescript/commonjs/src/platform.d.ts +0 -18
- package/lib/typescript/commonjs/src/platform.d.ts.map +0 -1
- package/lib/typescript/module/src/platform.d.ts +0 -18
- package/lib/typescript/module/src/platform.d.ts.map +0 -1
- package/src/platform.ts +0 -218
|
@@ -18,17 +18,16 @@ namespace facebook::react {
|
|
|
18
18
|
|
|
19
19
|
#pragma mark - NativeInappRnSdkFeatureOptions
|
|
20
20
|
|
|
21
|
-
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5
|
|
21
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
|
|
22
22
|
struct NativeInappRnSdkFeatureOptions {
|
|
23
23
|
P0 cookiePersist;
|
|
24
24
|
P1 singleReclaimRequest;
|
|
25
25
|
P2 idleTimeThresholdForManualVerificationTrigger;
|
|
26
26
|
P3 sessionTimeoutForManualVerificationTrigger;
|
|
27
27
|
P4 attestorBrowserRpcUrl;
|
|
28
|
-
P5
|
|
29
|
-
P6 isAIFlowEnabled;
|
|
28
|
+
P5 isAIFlowEnabled;
|
|
30
29
|
bool operator==(const NativeInappRnSdkFeatureOptions &other) const {
|
|
31
|
-
return cookiePersist == other.cookiePersist && singleReclaimRequest == other.singleReclaimRequest && idleTimeThresholdForManualVerificationTrigger == other.idleTimeThresholdForManualVerificationTrigger && sessionTimeoutForManualVerificationTrigger == other.sessionTimeoutForManualVerificationTrigger && attestorBrowserRpcUrl == other.attestorBrowserRpcUrl &&
|
|
30
|
+
return cookiePersist == other.cookiePersist && singleReclaimRequest == other.singleReclaimRequest && idleTimeThresholdForManualVerificationTrigger == other.idleTimeThresholdForManualVerificationTrigger && sessionTimeoutForManualVerificationTrigger == other.sessionTimeoutForManualVerificationTrigger && attestorBrowserRpcUrl == other.attestorBrowserRpcUrl && isAIFlowEnabled == other.isAIFlowEnabled;
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
|
|
@@ -46,7 +45,6 @@ struct NativeInappRnSdkFeatureOptionsBridging {
|
|
|
46
45
|
bridging::fromJs<decltype(types.idleTimeThresholdForManualVerificationTrigger)>(rt, value.getProperty(rt, "idleTimeThresholdForManualVerificationTrigger"), jsInvoker),
|
|
47
46
|
bridging::fromJs<decltype(types.sessionTimeoutForManualVerificationTrigger)>(rt, value.getProperty(rt, "sessionTimeoutForManualVerificationTrigger"), jsInvoker),
|
|
48
47
|
bridging::fromJs<decltype(types.attestorBrowserRpcUrl)>(rt, value.getProperty(rt, "attestorBrowserRpcUrl"), jsInvoker),
|
|
49
|
-
bridging::fromJs<decltype(types.isResponseRedactionRegexEscapingEnabled)>(rt, value.getProperty(rt, "isResponseRedactionRegexEscapingEnabled"), jsInvoker),
|
|
50
48
|
bridging::fromJs<decltype(types.isAIFlowEnabled)>(rt, value.getProperty(rt, "isAIFlowEnabled"), jsInvoker)};
|
|
51
49
|
return result;
|
|
52
50
|
}
|
|
@@ -72,10 +70,6 @@ struct NativeInappRnSdkFeatureOptionsBridging {
|
|
|
72
70
|
return bridging::toJs(rt, value);
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
static std::optional<bool> isResponseRedactionRegexEscapingEnabledToJs(jsi::Runtime &rt, decltype(types.isResponseRedactionRegexEscapingEnabled) value) {
|
|
76
|
-
return bridging::toJs(rt, value);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
73
|
static std::optional<bool> isAIFlowEnabledToJs(jsi::Runtime &rt, decltype(types.isAIFlowEnabled) value) {
|
|
80
74
|
return bridging::toJs(rt, value);
|
|
81
75
|
}
|
|
@@ -101,9 +95,6 @@ struct NativeInappRnSdkFeatureOptionsBridging {
|
|
|
101
95
|
if (value.attestorBrowserRpcUrl) {
|
|
102
96
|
result.setProperty(rt, "attestorBrowserRpcUrl", bridging::toJs(rt, value.attestorBrowserRpcUrl.value(), jsInvoker));
|
|
103
97
|
}
|
|
104
|
-
if (value.isResponseRedactionRegexEscapingEnabled) {
|
|
105
|
-
result.setProperty(rt, "isResponseRedactionRegexEscapingEnabled", bridging::toJs(rt, value.isResponseRedactionRegexEscapingEnabled.value(), jsInvoker));
|
|
106
|
-
}
|
|
107
98
|
if (value.isAIFlowEnabled) {
|
|
108
99
|
result.setProperty(rt, "isAIFlowEnabled", bridging::toJs(rt, value.isAIFlowEnabled.value(), jsInvoker));
|
|
109
100
|
}
|
|
@@ -557,7 +548,7 @@ struct NativeInappRnSdkReclaimSessionIdentityUpdateBridging {
|
|
|
557
548
|
|
|
558
549
|
#pragma mark - NativeInappRnSdkRequest
|
|
559
550
|
|
|
560
|
-
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7
|
|
551
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
|
|
561
552
|
struct NativeInappRnSdkRequest {
|
|
562
553
|
P0 appId;
|
|
563
554
|
P1 secret;
|
|
@@ -565,11 +556,10 @@ struct NativeInappRnSdkRequest {
|
|
|
565
556
|
P3 session;
|
|
566
557
|
P4 contextString;
|
|
567
558
|
P5 parameters;
|
|
568
|
-
P6
|
|
569
|
-
P7
|
|
570
|
-
P8 webhookUrl;
|
|
559
|
+
P6 acceptAiProviders;
|
|
560
|
+
P7 webhookUrl;
|
|
571
561
|
bool operator==(const NativeInappRnSdkRequest &other) const {
|
|
572
|
-
return appId == other.appId && secret == other.secret && providerId == other.providerId && session == other.session && contextString == other.contextString && parameters == other.parameters &&
|
|
562
|
+
return appId == other.appId && secret == other.secret && providerId == other.providerId && session == other.session && contextString == other.contextString && parameters == other.parameters && acceptAiProviders == other.acceptAiProviders && webhookUrl == other.webhookUrl;
|
|
573
563
|
}
|
|
574
564
|
};
|
|
575
565
|
|
|
@@ -588,7 +578,6 @@ struct NativeInappRnSdkRequestBridging {
|
|
|
588
578
|
bridging::fromJs<decltype(types.session)>(rt, value.getProperty(rt, "session"), jsInvoker),
|
|
589
579
|
bridging::fromJs<decltype(types.contextString)>(rt, value.getProperty(rt, "contextString"), jsInvoker),
|
|
590
580
|
bridging::fromJs<decltype(types.parameters)>(rt, value.getProperty(rt, "parameters"), jsInvoker),
|
|
591
|
-
bridging::fromJs<decltype(types.autoSubmit)>(rt, value.getProperty(rt, "autoSubmit"), jsInvoker),
|
|
592
581
|
bridging::fromJs<decltype(types.acceptAiProviders)>(rt, value.getProperty(rt, "acceptAiProviders"), jsInvoker),
|
|
593
582
|
bridging::fromJs<decltype(types.webhookUrl)>(rt, value.getProperty(rt, "webhookUrl"), jsInvoker)};
|
|
594
583
|
return result;
|
|
@@ -619,10 +608,6 @@ struct NativeInappRnSdkRequestBridging {
|
|
|
619
608
|
return bridging::toJs(rt, value);
|
|
620
609
|
}
|
|
621
610
|
|
|
622
|
-
static bool autoSubmitToJs(jsi::Runtime &rt, decltype(types.autoSubmit) value) {
|
|
623
|
-
return bridging::toJs(rt, value);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
611
|
static bool acceptAiProvidersToJs(jsi::Runtime &rt, decltype(types.acceptAiProviders) value) {
|
|
627
612
|
return bridging::toJs(rt, value);
|
|
628
613
|
}
|
|
@@ -649,9 +634,6 @@ struct NativeInappRnSdkRequestBridging {
|
|
|
649
634
|
if (value.parameters) {
|
|
650
635
|
result.setProperty(rt, "parameters", bridging::toJs(rt, value.parameters.value(), jsInvoker));
|
|
651
636
|
}
|
|
652
|
-
if (value.autoSubmit) {
|
|
653
|
-
result.setProperty(rt, "autoSubmit", bridging::toJs(rt, value.autoSubmit.value(), jsInvoker));
|
|
654
|
-
}
|
|
655
637
|
if (value.acceptAiProviders) {
|
|
656
638
|
result.setProperty(rt, "acceptAiProviders", bridging::toJs(rt, value.acceptAiProviders.value(), jsInvoker));
|
|
657
639
|
}
|
|
@@ -721,14 +703,15 @@ struct NativeInappRnSdkResponseBridging {
|
|
|
721
703
|
|
|
722
704
|
#pragma mark - NativeInappRnSdkSessionCreateRequestEvent
|
|
723
705
|
|
|
724
|
-
template <typename P0, typename P1, typename P2, typename P3>
|
|
706
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
725
707
|
struct NativeInappRnSdkSessionCreateRequestEvent {
|
|
726
708
|
P0 appId;
|
|
727
709
|
P1 providerId;
|
|
728
|
-
P2
|
|
729
|
-
P3
|
|
710
|
+
P2 timestamp;
|
|
711
|
+
P3 signature;
|
|
712
|
+
P4 replyId;
|
|
730
713
|
bool operator==(const NativeInappRnSdkSessionCreateRequestEvent &other) const {
|
|
731
|
-
return appId == other.appId && providerId == other.providerId &&
|
|
714
|
+
return appId == other.appId && providerId == other.providerId && timestamp == other.timestamp && signature == other.signature && replyId == other.replyId;
|
|
732
715
|
}
|
|
733
716
|
};
|
|
734
717
|
|
|
@@ -743,7 +726,8 @@ struct NativeInappRnSdkSessionCreateRequestEventBridging {
|
|
|
743
726
|
T result{
|
|
744
727
|
bridging::fromJs<decltype(types.appId)>(rt, value.getProperty(rt, "appId"), jsInvoker),
|
|
745
728
|
bridging::fromJs<decltype(types.providerId)>(rt, value.getProperty(rt, "providerId"), jsInvoker),
|
|
746
|
-
bridging::fromJs<decltype(types.
|
|
729
|
+
bridging::fromJs<decltype(types.timestamp)>(rt, value.getProperty(rt, "timestamp"), jsInvoker),
|
|
730
|
+
bridging::fromJs<decltype(types.signature)>(rt, value.getProperty(rt, "signature"), jsInvoker),
|
|
747
731
|
bridging::fromJs<decltype(types.replyId)>(rt, value.getProperty(rt, "replyId"), jsInvoker)};
|
|
748
732
|
return result;
|
|
749
733
|
}
|
|
@@ -757,7 +741,11 @@ struct NativeInappRnSdkSessionCreateRequestEventBridging {
|
|
|
757
741
|
return bridging::toJs(rt, value);
|
|
758
742
|
}
|
|
759
743
|
|
|
760
|
-
static jsi::String
|
|
744
|
+
static jsi::String timestampToJs(jsi::Runtime &rt, decltype(types.timestamp) value) {
|
|
745
|
+
return bridging::toJs(rt, value);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
static jsi::String signatureToJs(jsi::Runtime &rt, decltype(types.signature) value) {
|
|
761
749
|
return bridging::toJs(rt, value);
|
|
762
750
|
}
|
|
763
751
|
|
|
@@ -773,7 +761,8 @@ struct NativeInappRnSdkSessionCreateRequestEventBridging {
|
|
|
773
761
|
auto result = facebook::jsi::Object(rt);
|
|
774
762
|
result.setProperty(rt, "appId", bridging::toJs(rt, value.appId, jsInvoker));
|
|
775
763
|
result.setProperty(rt, "providerId", bridging::toJs(rt, value.providerId, jsInvoker));
|
|
776
|
-
result.setProperty(rt, "
|
|
764
|
+
result.setProperty(rt, "timestamp", bridging::toJs(rt, value.timestamp, jsInvoker));
|
|
765
|
+
result.setProperty(rt, "signature", bridging::toJs(rt, value.signature, jsInvoker));
|
|
777
766
|
result.setProperty(rt, "replyId", bridging::toJs(rt, value.replyId, jsInvoker));
|
|
778
767
|
return result;
|
|
779
768
|
}
|
|
@@ -998,12 +987,15 @@ struct NativeInappRnSdkSessionUpdateRequestEventBridging {
|
|
|
998
987
|
|
|
999
988
|
#pragma mark - NativeInappRnSdkVerificationOptions
|
|
1000
989
|
|
|
1001
|
-
template <typename P0, typename P1>
|
|
990
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
1002
991
|
struct NativeInappRnSdkVerificationOptions {
|
|
1003
992
|
P0 canDeleteCookiesBeforeVerificationStarts;
|
|
1004
993
|
P1 canUseAttestorAuthenticationRequest;
|
|
994
|
+
P2 claimCreationType;
|
|
995
|
+
P3 canAutoSubmit;
|
|
996
|
+
P4 isCloseButtonVisible;
|
|
1005
997
|
bool operator==(const NativeInappRnSdkVerificationOptions &other) const {
|
|
1006
|
-
return canDeleteCookiesBeforeVerificationStarts == other.canDeleteCookiesBeforeVerificationStarts && canUseAttestorAuthenticationRequest == other.canUseAttestorAuthenticationRequest;
|
|
998
|
+
return canDeleteCookiesBeforeVerificationStarts == other.canDeleteCookiesBeforeVerificationStarts && canUseAttestorAuthenticationRequest == other.canUseAttestorAuthenticationRequest && claimCreationType == other.claimCreationType && canAutoSubmit == other.canAutoSubmit && isCloseButtonVisible == other.isCloseButtonVisible;
|
|
1007
999
|
}
|
|
1008
1000
|
};
|
|
1009
1001
|
|
|
@@ -1017,7 +1009,10 @@ struct NativeInappRnSdkVerificationOptionsBridging {
|
|
|
1017
1009
|
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
1018
1010
|
T result{
|
|
1019
1011
|
bridging::fromJs<decltype(types.canDeleteCookiesBeforeVerificationStarts)>(rt, value.getProperty(rt, "canDeleteCookiesBeforeVerificationStarts"), jsInvoker),
|
|
1020
|
-
bridging::fromJs<decltype(types.canUseAttestorAuthenticationRequest)>(rt, value.getProperty(rt, "canUseAttestorAuthenticationRequest"), jsInvoker)
|
|
1012
|
+
bridging::fromJs<decltype(types.canUseAttestorAuthenticationRequest)>(rt, value.getProperty(rt, "canUseAttestorAuthenticationRequest"), jsInvoker),
|
|
1013
|
+
bridging::fromJs<decltype(types.claimCreationType)>(rt, value.getProperty(rt, "claimCreationType"), jsInvoker),
|
|
1014
|
+
bridging::fromJs<decltype(types.canAutoSubmit)>(rt, value.getProperty(rt, "canAutoSubmit"), jsInvoker),
|
|
1015
|
+
bridging::fromJs<decltype(types.isCloseButtonVisible)>(rt, value.getProperty(rt, "isCloseButtonVisible"), jsInvoker)};
|
|
1021
1016
|
return result;
|
|
1022
1017
|
}
|
|
1023
1018
|
|
|
@@ -1029,6 +1024,18 @@ struct NativeInappRnSdkVerificationOptionsBridging {
|
|
|
1029
1024
|
static bool canUseAttestorAuthenticationRequestToJs(jsi::Runtime &rt, decltype(types.canUseAttestorAuthenticationRequest) value) {
|
|
1030
1025
|
return bridging::toJs(rt, value);
|
|
1031
1026
|
}
|
|
1027
|
+
|
|
1028
|
+
static jsi::String claimCreationTypeToJs(jsi::Runtime &rt, decltype(types.claimCreationType) value) {
|
|
1029
|
+
return bridging::toJs(rt, value);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
static bool canAutoSubmitToJs(jsi::Runtime &rt, decltype(types.canAutoSubmit) value) {
|
|
1033
|
+
return bridging::toJs(rt, value);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
static bool isCloseButtonVisibleToJs(jsi::Runtime &rt, decltype(types.isCloseButtonVisible) value) {
|
|
1037
|
+
return bridging::toJs(rt, value);
|
|
1038
|
+
}
|
|
1032
1039
|
#endif
|
|
1033
1040
|
|
|
1034
1041
|
static jsi::Object toJs(
|
|
@@ -1038,6 +1045,9 @@ struct NativeInappRnSdkVerificationOptionsBridging {
|
|
|
1038
1045
|
auto result = facebook::jsi::Object(rt);
|
|
1039
1046
|
result.setProperty(rt, "canDeleteCookiesBeforeVerificationStarts", bridging::toJs(rt, value.canDeleteCookiesBeforeVerificationStarts, jsInvoker));
|
|
1040
1047
|
result.setProperty(rt, "canUseAttestorAuthenticationRequest", bridging::toJs(rt, value.canUseAttestorAuthenticationRequest, jsInvoker));
|
|
1048
|
+
result.setProperty(rt, "claimCreationType", bridging::toJs(rt, value.claimCreationType, jsInvoker));
|
|
1049
|
+
result.setProperty(rt, "canAutoSubmit", bridging::toJs(rt, value.canAutoSubmit, jsInvoker));
|
|
1050
|
+
result.setProperty(rt, "isCloseButtonVisible", bridging::toJs(rt, value.isCloseButtonVisible, jsInvoker));
|
|
1041
1051
|
return result;
|
|
1042
1052
|
}
|
|
1043
1053
|
};
|
|
@@ -72,9 +72,8 @@ import ReclaimInAppSdk
|
|
|
72
72
|
sessionSignature: String?,
|
|
73
73
|
context: String?,
|
|
74
74
|
parameters: [String: String]?,
|
|
75
|
-
autoSubmit: Bool,
|
|
76
75
|
acceptAiProviders: Bool,
|
|
77
|
-
webhookUrl: String
|
|
76
|
+
webhookUrl: String?
|
|
78
77
|
) async throws -> [String: Any] {
|
|
79
78
|
var session: ReclaimSessionInformation? = nil
|
|
80
79
|
if let sessionTimestamp = sessionTimestamp, let sessionSessionId = sessionSessionId, let sessionSignature = sessionSignature {
|
|
@@ -92,7 +91,6 @@ import ReclaimInAppSdk
|
|
|
92
91
|
session: session,
|
|
93
92
|
context: context ?? "",
|
|
94
93
|
parameters: parameters ?? [String:String](),
|
|
95
|
-
autoSubmit: autoSubmit,
|
|
96
94
|
acceptAiProviders: acceptAiProviders,
|
|
97
95
|
webhookUrl: webhookUrl
|
|
98
96
|
))
|
|
@@ -102,7 +100,7 @@ import ReclaimInAppSdk
|
|
|
102
100
|
session: session,
|
|
103
101
|
context: context ?? "",
|
|
104
102
|
parameters: parameters ?? [String:String](),
|
|
105
|
-
autoSubmit:
|
|
103
|
+
autoSubmit: true, // unused.
|
|
106
104
|
acceptAiProviders: acceptAiProviders,
|
|
107
105
|
webhookUrl: webhookUrl
|
|
108
106
|
))
|
|
@@ -134,14 +132,13 @@ import ReclaimInAppSdk
|
|
|
134
132
|
nil
|
|
135
133
|
}
|
|
136
134
|
|
|
137
|
-
|
|
135
|
+
let featureOptionsOverrides: ReclaimOverrides.FeatureOptions? = if let featureOptions {
|
|
138
136
|
.init(
|
|
139
137
|
cookiePersist: featureOptions.cookiePersist?.boolValue,
|
|
140
138
|
singleReclaimRequest: featureOptions.singleReclaimRequest?.boolValue,
|
|
141
139
|
idleTimeThresholdForManualVerificationTrigger: featureOptions.idleTimeThresholdForManualVerificationTrigger?.int64Value,
|
|
142
140
|
sessionTimeoutForManualVerificationTrigger: featureOptions.sessionTimeoutForManualVerificationTrigger?.int64Value,
|
|
143
141
|
attestorBrowserRpcUrl: featureOptions.attestorBrowserRpcUrl,
|
|
144
|
-
isResponseRedactionRegexEscapingEnabled: featureOptions.isResponseRedactionRegexEscapingEnabled?.boolValue,
|
|
145
142
|
isAIFlowEnabled: featureOptions.isAIFlowEnabled?.boolValue
|
|
146
143
|
)
|
|
147
144
|
} else {
|
|
@@ -311,8 +308,6 @@ public typealias OverridenProviderCallback = (
|
|
|
311
308
|
@objc public var sessionTimeoutForManualVerificationTrigger: NSNumber?
|
|
312
309
|
@objc public var attestorBrowserRpcUrl: String?
|
|
313
310
|
// bool
|
|
314
|
-
@objc public var isResponseRedactionRegexEscapingEnabled: NSNumber?
|
|
315
|
-
// bool
|
|
316
311
|
@objc public var isAIFlowEnabled: NSNumber?
|
|
317
312
|
|
|
318
313
|
@objc public init(
|
|
@@ -321,7 +316,6 @@ public typealias OverridenProviderCallback = (
|
|
|
321
316
|
idleTimeThresholdForManualVerificationTrigger: NSNumber? = nil,
|
|
322
317
|
sessionTimeoutForManualVerificationTrigger: NSNumber? = nil,
|
|
323
318
|
attestorBrowserRpcUrl: String? = nil,
|
|
324
|
-
isResponseRedactionRegexEscapingEnabled: NSNumber? = nil,
|
|
325
319
|
isAIFlowEnabled: NSNumber? = nil
|
|
326
320
|
) {
|
|
327
321
|
self.cookiePersist = cookiePersist
|
|
@@ -329,7 +323,6 @@ public typealias OverridenProviderCallback = (
|
|
|
329
323
|
self.idleTimeThresholdForManualVerificationTrigger = idleTimeThresholdForManualVerificationTrigger
|
|
330
324
|
self.sessionTimeoutForManualVerificationTrigger = sessionTimeoutForManualVerificationTrigger
|
|
331
325
|
self.attestorBrowserRpcUrl = attestorBrowserRpcUrl
|
|
332
|
-
self.isResponseRedactionRegexEscapingEnabled = isResponseRedactionRegexEscapingEnabled
|
|
333
326
|
self.isAIFlowEnabled = isAIFlowEnabled
|
|
334
327
|
}
|
|
335
328
|
}
|
|
@@ -392,7 +385,8 @@ public typealias OverridenProviderCallback = (
|
|
|
392
385
|
public typealias OverridenCreateSessionCallback = (
|
|
393
386
|
_ appId: String,
|
|
394
387
|
_ providerId: String,
|
|
395
|
-
_
|
|
388
|
+
_ timestamp: String,
|
|
389
|
+
_ signature: String,
|
|
396
390
|
_ replyId: String
|
|
397
391
|
) -> Void
|
|
398
392
|
public typealias OverridenUpdateSessionCallback = (
|
|
@@ -416,7 +410,6 @@ public typealias OverridenLogSessionCallback = (
|
|
|
416
410
|
}
|
|
417
411
|
|
|
418
412
|
@objc(OverridenSessionHandler) public class OverridenSessionHandler: NSObject, ReclaimOverrides.SessionManagement.SessionHandler {
|
|
419
|
-
|
|
420
413
|
@objc let _createSession: OverridenCreateSessionCallback
|
|
421
414
|
@objc let _updateSession: OverridenUpdateSessionCallback
|
|
422
415
|
@objc let _logSession: OverridenLogSessionCallback
|
|
@@ -430,12 +423,9 @@ public typealias OverridenLogSessionCallback = (
|
|
|
430
423
|
self._updateSession = _updateSession
|
|
431
424
|
self._logSession = _logSession
|
|
432
425
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
appId
|
|
436
|
-
) {
|
|
437
|
-
let replyId = Api.setReplyCallback(completion)
|
|
438
|
-
self._createSession(appId, providerId, sessionId, replyId)
|
|
426
|
+
public func createSession(appId: String, providerId: String, timestamp: String, signature: String, completion: @escaping (Result<String, any Error>) -> Void) {
|
|
427
|
+
let replyId = Api.setReplyWithStringCallback(completion)
|
|
428
|
+
self._createSession(appId, providerId, timestamp, signature, replyId)
|
|
439
429
|
}
|
|
440
430
|
|
|
441
431
|
public func updateSession(
|
|
@@ -469,7 +459,8 @@ public typealias OverridenLogSessionCallback = (
|
|
|
469
459
|
appId: String,
|
|
470
460
|
providerId: String,
|
|
471
461
|
sessionId: String,
|
|
472
|
-
logType: String
|
|
462
|
+
logType: String,
|
|
463
|
+
metadata: [String : (any Sendable)?]?
|
|
473
464
|
) {
|
|
474
465
|
self._logSession(appId, providerId, sessionId, logType)
|
|
475
466
|
}
|
|
@@ -484,10 +475,17 @@ public typealias ReclaimVerificationOptionFetchAttestorAuthRequestHandler = (
|
|
|
484
475
|
@objc(ReclaimApiVerificationOptions) public class ReclaimApiVerificationOptions: NSObject {
|
|
485
476
|
public let canDeleteCookiesBeforeVerificationStarts: Bool
|
|
486
477
|
public let attestorAuthRequestProvider: ReclaimVerification.VerificationOptions.AttestorAuthRequestProvider?
|
|
478
|
+
public let claimCreationType: String?
|
|
479
|
+
public let canAutoSubmit: Bool
|
|
480
|
+
public let isCloseButtonVisible: Bool
|
|
481
|
+
|
|
487
482
|
|
|
488
483
|
@objc public init(
|
|
489
484
|
canDeleteCookiesBeforeVerificationStarts: Bool,
|
|
490
|
-
fetchAttestorAuthenticationRequest: ReclaimVerificationOptionFetchAttestorAuthRequestHandler
|
|
485
|
+
fetchAttestorAuthenticationRequest: ReclaimVerificationOptionFetchAttestorAuthRequestHandler?,
|
|
486
|
+
claimCreationType: String?,
|
|
487
|
+
canAutoSubmit: Bool,
|
|
488
|
+
isCloseButtonVisible: Bool
|
|
491
489
|
) {
|
|
492
490
|
self.canDeleteCookiesBeforeVerificationStarts = canDeleteCookiesBeforeVerificationStarts
|
|
493
491
|
if let fetchAttestorAuthenticationRequest {
|
|
@@ -497,12 +495,25 @@ public typealias ReclaimVerificationOptionFetchAttestorAuthRequestHandler = (
|
|
|
497
495
|
} else {
|
|
498
496
|
self.attestorAuthRequestProvider = nil
|
|
499
497
|
}
|
|
498
|
+
self.claimCreationType = claimCreationType
|
|
499
|
+
self.canAutoSubmit = canAutoSubmit
|
|
500
|
+
self.isCloseButtonVisible = isCloseButtonVisible
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
func claimCreationTypeApi() -> ReclaimVerification.VerificationOptions.ClaimCreationType {
|
|
504
|
+
switch (claimCreationType) {
|
|
505
|
+
case "meChain": return .meChain
|
|
506
|
+
case _: return .standalone
|
|
507
|
+
}
|
|
500
508
|
}
|
|
501
509
|
|
|
502
510
|
func toSdkOptions() -> ReclaimVerification.VerificationOptions {
|
|
503
511
|
return .init(
|
|
504
512
|
canDeleteCookiesBeforeVerificationStarts: canDeleteCookiesBeforeVerificationStarts,
|
|
505
|
-
attestorAuthRequestProvider: attestorAuthRequestProvider
|
|
513
|
+
attestorAuthRequestProvider: attestorAuthRequestProvider,
|
|
514
|
+
claimCreationType: claimCreationTypeApi(),
|
|
515
|
+
canAutoSubmit: canAutoSubmit,
|
|
516
|
+
isCloseButtonVisible: isCloseButtonVisible,
|
|
506
517
|
)
|
|
507
518
|
}
|
|
508
519
|
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ReclaimVerification = void 0;
|
|
7
|
-
var
|
|
6
|
+
exports.ReclaimVerification = exports.PlatformImpl = void 0;
|
|
7
|
+
var _NativeInappRnSdk = _interopRequireDefault(require("./specs/NativeInappRnSdk.js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
9
|
/**
|
|
9
10
|
* [ReclaimVerification] is the main class for interacting with the Reclaim verification system.
|
|
10
11
|
* It provides methods to start verification processes, manage platform configurations,
|
|
11
12
|
* and handle verification options.
|
|
12
|
-
*
|
|
13
|
+
*
|
|
13
14
|
* The class can be instantiated with a custom platform implementation, or will use
|
|
14
15
|
* the default [PlatformImpl] if none is provided.
|
|
15
16
|
*/
|
|
@@ -20,7 +21,7 @@ class ReclaimVerification {
|
|
|
20
21
|
this.platform = platform;
|
|
21
22
|
} else {
|
|
22
23
|
if (ReclaimVerification.defaultPlatform == null) {
|
|
23
|
-
ReclaimVerification.defaultPlatform = new
|
|
24
|
+
ReclaimVerification.defaultPlatform = new PlatformImpl();
|
|
24
25
|
}
|
|
25
26
|
this.platform = ReclaimVerification.defaultPlatform;
|
|
26
27
|
}
|
|
@@ -28,6 +29,9 @@ class ReclaimVerification {
|
|
|
28
29
|
async startVerification(request) {
|
|
29
30
|
return this.platform.startVerification(request);
|
|
30
31
|
}
|
|
32
|
+
async startVerificationFromUrl(requestUrl) {
|
|
33
|
+
return this.platform.startVerificationFromUrl(requestUrl);
|
|
34
|
+
}
|
|
31
35
|
async ping() {
|
|
32
36
|
return this.platform.ping();
|
|
33
37
|
}
|
|
@@ -69,10 +73,6 @@ exports.ReclaimVerification = ReclaimVerification;
|
|
|
69
73
|
return proofs.filter(isProof);
|
|
70
74
|
};
|
|
71
75
|
})(ReclaimResult || (ReclaimResult = _ReclaimVerification.ReclaimResult || (_ReclaimVerification.ReclaimResult = {})));
|
|
72
|
-
let Overrides;
|
|
73
|
-
(function (_Overrides) {
|
|
74
|
-
;
|
|
75
|
-
})(Overrides || (Overrides = _ReclaimVerification.Overrides || (_ReclaimVerification.Overrides = {})));
|
|
76
76
|
let ExceptionType = /*#__PURE__*/function (ExceptionType) {
|
|
77
77
|
ExceptionType["Cancelled"] = "Cancelled";
|
|
78
78
|
ExceptionType["Dismissed"] = "Dismissed";
|
|
@@ -100,7 +100,7 @@ exports.ReclaimVerification = ReclaimVerification;
|
|
|
100
100
|
}
|
|
101
101
|
_ReclaimVerification.ReclaimPlatformException = ReclaimPlatformException;
|
|
102
102
|
class ReclaimVerificationException extends Error {
|
|
103
|
-
constructor(message, innerError, type, sessionId, didSubmitManualVerification, reason) {
|
|
103
|
+
'constructor'(message, innerError, type, sessionId, didSubmitManualVerification, reason) {
|
|
104
104
|
super(message);
|
|
105
105
|
this.innerError = innerError;
|
|
106
106
|
this.type = type;
|
|
@@ -108,36 +108,36 @@ exports.ReclaimVerification = ReclaimVerification;
|
|
|
108
108
|
this.didSubmitManualVerification = didSubmitManualVerification;
|
|
109
109
|
this.reason = reason;
|
|
110
110
|
}
|
|
111
|
-
static fromTypeName(name) {
|
|
111
|
+
static 'fromTypeName'(name) {
|
|
112
112
|
switch (name) {
|
|
113
|
-
case
|
|
114
|
-
case
|
|
113
|
+
case 'cancelled':
|
|
114
|
+
case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Cancelled':
|
|
115
115
|
return ExceptionType.Cancelled;
|
|
116
|
-
case
|
|
117
|
-
case
|
|
116
|
+
case 'dismissed':
|
|
117
|
+
case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Dismissed':
|
|
118
118
|
return ExceptionType.Dismissed;
|
|
119
|
-
case
|
|
120
|
-
case
|
|
119
|
+
case 'sessionExpired':
|
|
120
|
+
case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.SessionExpired':
|
|
121
121
|
return ExceptionType.SessionExpired;
|
|
122
|
-
case
|
|
123
|
-
case
|
|
122
|
+
case 'failed':
|
|
123
|
+
case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Failed':
|
|
124
124
|
return ExceptionType.Failed;
|
|
125
125
|
}
|
|
126
126
|
return ExceptionType.Failed;
|
|
127
127
|
}
|
|
128
|
-
static fromError(error, sessionIdHint) {
|
|
128
|
+
static 'fromError'(error, sessionIdHint) {
|
|
129
129
|
if ('userInfo' in error) {
|
|
130
130
|
// From native, we send information about error in userInfo
|
|
131
131
|
let userInfo = error.userInfo;
|
|
132
132
|
if (userInfo) {
|
|
133
133
|
let type = ReclaimVerification.ReclaimVerificationException.fromTypeName(userInfo.errorType);
|
|
134
134
|
let maybeSessionId = userInfo?.sessionId;
|
|
135
|
-
return new ReclaimVerificationException(error.message, error, type, typeof maybeSessionId === 'string' && maybeSessionId ? maybeSessionId : sessionIdHint, userInfo?.didSubmitManualVerification ?? false, userInfo?.reason ??
|
|
135
|
+
return new ReclaimVerificationException(error.message, error, type, typeof maybeSessionId === 'string' && maybeSessionId ? maybeSessionId : sessionIdHint, userInfo?.didSubmitManualVerification ?? false, userInfo?.reason ?? '');
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
return new ReclaimVerificationException(error.message, error, ReclaimVerification.ExceptionType.Failed, sessionIdHint, false,
|
|
138
|
+
return new ReclaimVerificationException(error.message, error, ReclaimVerification.ExceptionType.Failed, sessionIdHint, false, '');
|
|
139
139
|
}
|
|
140
|
-
static isReclaimVerificationException(error) {
|
|
140
|
+
static 'isReclaimVerificationException'(error) {
|
|
141
141
|
return error instanceof ReclaimVerificationException;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -145,4 +145,209 @@ exports.ReclaimVerification = ReclaimVerification;
|
|
|
145
145
|
class Platform {}
|
|
146
146
|
_ReclaimVerification.Platform = Platform;
|
|
147
147
|
})(ReclaimVerification || (exports.ReclaimVerification = ReclaimVerification = {}));
|
|
148
|
+
class PlatformImpl extends ReclaimVerification.Platform {
|
|
149
|
+
async startVerification(request) {
|
|
150
|
+
try {
|
|
151
|
+
const response = await _NativeInappRnSdk.default.startVerification(request);
|
|
152
|
+
return {
|
|
153
|
+
...response,
|
|
154
|
+
proofs: ReclaimVerification.ReclaimResult.asProofs(response.proofs)
|
|
155
|
+
};
|
|
156
|
+
} catch (error) {
|
|
157
|
+
console.info({
|
|
158
|
+
error
|
|
159
|
+
});
|
|
160
|
+
if (error instanceof Error) {
|
|
161
|
+
throw ReclaimVerification.ReclaimVerificationException.fromError(error, request.session?.sessionId ?? '');
|
|
162
|
+
}
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
async startVerificationFromUrl(requestUrl) {
|
|
167
|
+
try {
|
|
168
|
+
const response = await _NativeInappRnSdk.default.startVerificationFromUrl(requestUrl);
|
|
169
|
+
return {
|
|
170
|
+
...response,
|
|
171
|
+
proofs: ReclaimVerification.ReclaimResult.asProofs(response.proofs)
|
|
172
|
+
};
|
|
173
|
+
} catch (error) {
|
|
174
|
+
console.info({
|
|
175
|
+
error
|
|
176
|
+
});
|
|
177
|
+
if (error instanceof Error) {
|
|
178
|
+
throw ReclaimVerification.ReclaimVerificationException.fromError(error, '');
|
|
179
|
+
}
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
async ping() {
|
|
184
|
+
return await _NativeInappRnSdk.default.ping();
|
|
185
|
+
}
|
|
186
|
+
previousSessionManagementCancelCallback = null;
|
|
187
|
+
disposeSessionManagement() {
|
|
188
|
+
let callback = this.previousSessionManagementCancelCallback;
|
|
189
|
+
if (callback != null && callback != undefined) {
|
|
190
|
+
callback();
|
|
191
|
+
}
|
|
192
|
+
this.previousSessionManagementCancelCallback = null;
|
|
193
|
+
}
|
|
194
|
+
previousLogSubscription = null;
|
|
195
|
+
disposeLogListener() {
|
|
196
|
+
this.previousLogSubscription?.remove();
|
|
197
|
+
this.previousLogSubscription = null;
|
|
198
|
+
}
|
|
199
|
+
previousProviderRequestCancelCallback = null;
|
|
200
|
+
disposeProviderRequestListener() {
|
|
201
|
+
let callback = this.previousProviderRequestCancelCallback;
|
|
202
|
+
if (callback != null && callback != undefined) {
|
|
203
|
+
callback();
|
|
204
|
+
}
|
|
205
|
+
this.previousProviderRequestCancelCallback = null;
|
|
206
|
+
}
|
|
207
|
+
async setOverrides({
|
|
208
|
+
provider,
|
|
209
|
+
featureOptions,
|
|
210
|
+
logConsumer,
|
|
211
|
+
sessionManagement,
|
|
212
|
+
appInfo,
|
|
213
|
+
capabilityAccessToken
|
|
214
|
+
}) {
|
|
215
|
+
let providerCallback = provider?.callback;
|
|
216
|
+
let providerOverride = !provider ? null : {
|
|
217
|
+
url: provider?.url,
|
|
218
|
+
jsonString: provider?.jsonString,
|
|
219
|
+
canFetchProviderInformationFromHost: !!providerCallback
|
|
220
|
+
};
|
|
221
|
+
if (providerCallback) {
|
|
222
|
+
this.disposeProviderRequestListener();
|
|
223
|
+
let providerRequestSubscription = _NativeInappRnSdk.default.onProviderInformationRequest(async event => {
|
|
224
|
+
try {
|
|
225
|
+
let result = await providerCallback(event);
|
|
226
|
+
_NativeInappRnSdk.default.replyWithString(event.replyId, result);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
console.error(error);
|
|
229
|
+
_NativeInappRnSdk.default.replyWithString(event.replyId, '');
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
const cancel = () => {
|
|
233
|
+
providerRequestSubscription.remove();
|
|
234
|
+
};
|
|
235
|
+
this.previousProviderRequestCancelCallback = cancel;
|
|
236
|
+
}
|
|
237
|
+
const onLogsListener = logConsumer?.onLogs;
|
|
238
|
+
let logConsumerRequest = !logConsumer ? undefined : {
|
|
239
|
+
enableLogHandler: !!onLogsListener,
|
|
240
|
+
canSdkCollectTelemetry: logConsumer?.canSdkCollectTelemetry,
|
|
241
|
+
canSdkPrintLogs: logConsumer?.canSdkPrintLogs
|
|
242
|
+
};
|
|
243
|
+
if (onLogsListener) {
|
|
244
|
+
this.disposeLogListener();
|
|
245
|
+
const cancel = () => {
|
|
246
|
+
this.previousLogSubscription?.remove();
|
|
247
|
+
this.previousLogSubscription = null;
|
|
248
|
+
};
|
|
249
|
+
this.previousLogSubscription = _NativeInappRnSdk.default.onLogs(arg => {
|
|
250
|
+
onLogsListener(arg, cancel);
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
let sessionManagementRequest = !sessionManagement ? undefined : {
|
|
254
|
+
// A handler is provided, so we don't let SDK manage sessions
|
|
255
|
+
enableSdkSessionManagement: false
|
|
256
|
+
};
|
|
257
|
+
if (sessionManagement) {
|
|
258
|
+
this.disposeSessionManagement();
|
|
259
|
+
let sessionCreateSubscription = _NativeInappRnSdk.default.onSessionCreateRequest(async event => {
|
|
260
|
+
const replyId = event.replyId;
|
|
261
|
+
try {
|
|
262
|
+
let result = await sessionManagement.onSessionCreateRequest(event);
|
|
263
|
+
_NativeInappRnSdk.default.replyWithString(replyId, result);
|
|
264
|
+
} catch (error) {
|
|
265
|
+
console.error(error);
|
|
266
|
+
_NativeInappRnSdk.default.reply(replyId, false);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
let sessionUpdateSubscription = _NativeInappRnSdk.default.onSessionUpdateRequest(async event => {
|
|
270
|
+
const replyId = event.replyId;
|
|
271
|
+
try {
|
|
272
|
+
let result = await sessionManagement.onSessionUpdateRequest(event);
|
|
273
|
+
_NativeInappRnSdk.default.reply(replyId, result);
|
|
274
|
+
} catch (error) {
|
|
275
|
+
console.error(error);
|
|
276
|
+
_NativeInappRnSdk.default.reply(replyId, false);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
let sessionLogsSubscription = _NativeInappRnSdk.default.onSessionLogs(event => {
|
|
280
|
+
try {
|
|
281
|
+
sessionManagement.onLog(event);
|
|
282
|
+
} catch (error) {
|
|
283
|
+
console.error(error);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
const cancel = () => {
|
|
287
|
+
sessionCreateSubscription.remove();
|
|
288
|
+
sessionUpdateSubscription.remove();
|
|
289
|
+
sessionLogsSubscription.remove();
|
|
290
|
+
};
|
|
291
|
+
this.previousSessionManagementCancelCallback = cancel;
|
|
292
|
+
}
|
|
293
|
+
try {
|
|
294
|
+
return await _NativeInappRnSdk.default.setOverrides({
|
|
295
|
+
provider: providerOverride,
|
|
296
|
+
featureOptions,
|
|
297
|
+
logConsumer: logConsumerRequest,
|
|
298
|
+
sessionManagement: sessionManagementRequest,
|
|
299
|
+
appInfo,
|
|
300
|
+
capabilityAccessToken
|
|
301
|
+
});
|
|
302
|
+
} catch (error) {
|
|
303
|
+
throw new ReclaimVerification.ReclaimPlatformException('Failed to set overrides', error);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async clearAllOverrides() {
|
|
307
|
+
this.disposeProviderRequestListener();
|
|
308
|
+
this.disposeLogListener();
|
|
309
|
+
this.disposeSessionManagement();
|
|
310
|
+
return _NativeInappRnSdk.default.clearAllOverrides();
|
|
311
|
+
}
|
|
312
|
+
previousAttestorAuthRequestCancelCallback = null;
|
|
313
|
+
disposeAttestorAuthRequestListener() {
|
|
314
|
+
let callback = this.previousAttestorAuthRequestCancelCallback;
|
|
315
|
+
if (callback != null && callback != undefined) {
|
|
316
|
+
callback();
|
|
317
|
+
}
|
|
318
|
+
this.previousAttestorAuthRequestCancelCallback = null;
|
|
319
|
+
}
|
|
320
|
+
async setVerificationOptions(options) {
|
|
321
|
+
let args = null;
|
|
322
|
+
if (options) {
|
|
323
|
+
let canUseAttestorAuthenticationRequest = options.fetchAttestorAuthenticationRequest != null;
|
|
324
|
+
args = {
|
|
325
|
+
canDeleteCookiesBeforeVerificationStarts: options.canDeleteCookiesBeforeVerificationStarts,
|
|
326
|
+
canUseAttestorAuthenticationRequest: canUseAttestorAuthenticationRequest,
|
|
327
|
+
claimCreationType: options.claimCreationType ?? 'standalone',
|
|
328
|
+
canAutoSubmit: options.canAutoSubmit ?? true,
|
|
329
|
+
isCloseButtonVisible: options.isCloseButtonVisible ?? true
|
|
330
|
+
};
|
|
331
|
+
if (canUseAttestorAuthenticationRequest) {
|
|
332
|
+
this.disposeAttestorAuthRequestListener();
|
|
333
|
+
let attestorAuthRequestSubscription = _NativeInappRnSdk.default.onReclaimAttestorAuthRequest(async event => {
|
|
334
|
+
let result = await options.fetchAttestorAuthenticationRequest(event.reclaimHttpProviderJsonString);
|
|
335
|
+
_NativeInappRnSdk.default.replyWithString(event.replyId, result);
|
|
336
|
+
});
|
|
337
|
+
const cancel = () => {
|
|
338
|
+
attestorAuthRequestSubscription.remove();
|
|
339
|
+
};
|
|
340
|
+
this.previousAttestorAuthRequestCancelCallback = cancel;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
try {
|
|
344
|
+
return await _NativeInappRnSdk.default.setVerificationOptions({
|
|
345
|
+
options: args
|
|
346
|
+
});
|
|
347
|
+
} catch (error) {
|
|
348
|
+
throw new ReclaimVerification.ReclaimPlatformException('Failed to set verification options', error);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
exports.PlatformImpl = PlatformImpl;
|
|
148
353
|
//# sourceMappingURL=index.js.map
|