@reclaimprotocol/inapp-rn-sdk 0.1.3
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 +43 -0
- package/LICENSE +20 -0
- package/README.md +292 -0
- package/android/build.gradle +130 -0
- package/android/generated/java/com/reclaimprotocol/inapp_rn_sdk/NativeInappRnSdkSpec.java +71 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNInappRnSdkSpec-generated.cpp +61 -0
- package/android/generated/jni/RNInappRnSdkSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI-generated.cpp +56 -0
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h +930 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/reclaimprotocol/inapp_rn_sdk/InappRnSdkModule.kt +327 -0
- package/android/src/main/java/com/reclaimprotocol/inapp_rn_sdk/InappRnSdkPackage.kt +33 -0
- package/ios/InappRnSdk-Bridging-Header.h +1 -0
- package/ios/InappRnSdk.h +17 -0
- package/ios/InappRnSdk.mm +215 -0
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec-generated.mm +136 -0
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec.h +391 -0
- package/ios/generated/RNInappRnSdkSpecJSI-generated.cpp +56 -0
- package/ios/generated/RNInappRnSdkSpecJSI.h +930 -0
- package/ios/inapp_rn_sdk/Api.swift +405 -0
- package/lib/commonjs/ReclaimVerificationPlatformChannel.js +177 -0
- package/lib/commonjs/ReclaimVerificationPlatformChannel.js.map +1 -0
- package/lib/commonjs/index.js +43 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/specs/NativeInappRnSdk.js +23 -0
- package/lib/commonjs/specs/NativeInappRnSdk.js.map +1 -0
- package/lib/module/ReclaimVerificationPlatformChannel.js +171 -0
- package/lib/module/ReclaimVerificationPlatformChannel.js.map +1 -0
- package/lib/module/index.js +27 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/NativeInappRnSdk.js +24 -0
- package/lib/module/specs/NativeInappRnSdk.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts +80 -0
- package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +12 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts +281 -0
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts +80 -0
- package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +12 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts +281 -0
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts.map +1 -0
- package/package.json +204 -0
- package/react-native.config.js +12 -0
- package/src/ReclaimVerificationPlatformChannel.ts +245 -0
- package/src/index.tsx +32 -0
- package/src/specs/NativeInappRnSdk.ts +313 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import ReclaimInAppSdk
|
|
2
|
+
|
|
3
|
+
@objc(Api) public class Api: NSObject {
|
|
4
|
+
@objc public func ping() -> Bool {
|
|
5
|
+
return true
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@MainActor
|
|
9
|
+
static fileprivate var replyHandlers: [String: (Result<Bool, any Error>) -> Void] = [:]
|
|
10
|
+
|
|
11
|
+
static fileprivate func setReplyCallback(
|
|
12
|
+
_ callback: @escaping (Result<Bool, any Error>) -> Void
|
|
13
|
+
) -> String {
|
|
14
|
+
let replyId = UUID().uuidString
|
|
15
|
+
Task { @MainActor in
|
|
16
|
+
Api.replyHandlers[replyId] = callback
|
|
17
|
+
}
|
|
18
|
+
return replyId
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@objc public func reply(replyId: String?, reply: Bool) {
|
|
22
|
+
if let replyId {
|
|
23
|
+
Task { @MainActor in
|
|
24
|
+
let callback = Api.replyHandlers[replyId]
|
|
25
|
+
if let callback = callback {
|
|
26
|
+
Api.replyHandlers.removeValue(forKey: replyId)
|
|
27
|
+
callback(.success(reply))
|
|
28
|
+
} else {
|
|
29
|
+
NSLog("[Api.reply] No callback found for replyId \(replyId)")
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
NSLog("[Api.reply] Missing arg replyId")
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@objc public func startVerification(
|
|
38
|
+
appId: String?,
|
|
39
|
+
secret: String?,
|
|
40
|
+
providerId: String,
|
|
41
|
+
sessionTimestamp: String?,
|
|
42
|
+
sessionSessionId: String?,
|
|
43
|
+
sessionSignature: String?,
|
|
44
|
+
context: String?,
|
|
45
|
+
parameters: [String: String]?,
|
|
46
|
+
hideLanding: Bool,
|
|
47
|
+
autoSubmit: Bool,
|
|
48
|
+
acceptAiProviders: Bool,
|
|
49
|
+
webhookUrl: String
|
|
50
|
+
) async throws -> [String: Any] {
|
|
51
|
+
var session: ReclaimSessionInformation? = nil
|
|
52
|
+
if let sessionTimestamp = sessionTimestamp, let sessionSessionId = sessionSessionId, let sessionSignature = sessionSignature {
|
|
53
|
+
session = .init(
|
|
54
|
+
timestamp: sessionTimestamp,
|
|
55
|
+
sessionId: sessionSessionId,
|
|
56
|
+
signature: sessionSignature
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
let request: ReclaimVerification.Request = if let appId = appId, let secret = secret, !appId.isEmpty && !secret.isEmpty {
|
|
60
|
+
.params(.init(
|
|
61
|
+
appId: appId,
|
|
62
|
+
secret: secret,
|
|
63
|
+
providerId: providerId,
|
|
64
|
+
session: session,
|
|
65
|
+
context: context ?? "",
|
|
66
|
+
parameters: parameters ?? [String:String](),
|
|
67
|
+
hideLanding: hideLanding,
|
|
68
|
+
autoSubmit: autoSubmit,
|
|
69
|
+
acceptAiProviders: acceptAiProviders,
|
|
70
|
+
webhookUrl: webhookUrl
|
|
71
|
+
))
|
|
72
|
+
} else {
|
|
73
|
+
.params(try .init(
|
|
74
|
+
providerId: providerId,
|
|
75
|
+
session: session,
|
|
76
|
+
context: context ?? "",
|
|
77
|
+
parameters: parameters ?? [String:String](),
|
|
78
|
+
hideLanding: hideLanding,
|
|
79
|
+
autoSubmit: autoSubmit,
|
|
80
|
+
acceptAiProviders: acceptAiProviders,
|
|
81
|
+
webhookUrl: webhookUrl
|
|
82
|
+
))
|
|
83
|
+
}
|
|
84
|
+
return try await startVerificationWithRequest(request)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@objc public func startVerificationFromUrl(
|
|
88
|
+
url: String
|
|
89
|
+
) async throws -> [String: Any] {
|
|
90
|
+
return try await startVerificationWithRequest(.url(url))
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@objc public func setOverrides(
|
|
94
|
+
provider: OverridenProviderInformation?,
|
|
95
|
+
featureOptions: OverridenFeatureOptions?,
|
|
96
|
+
logConsumer: OverridenLogConsumer?,
|
|
97
|
+
sessionManagement: OverridenSessionManagement?,
|
|
98
|
+
appInfo: OverridenReclaimAppInfo?
|
|
99
|
+
) async throws {
|
|
100
|
+
let providerOverrides: ReclaimOverrides.ProviderInformation? = if let url = provider?.url {
|
|
101
|
+
.url(url: url)
|
|
102
|
+
} else if let jsonString = provider?.jsonString {
|
|
103
|
+
.jsonString(jsonString: jsonString)
|
|
104
|
+
} else {
|
|
105
|
+
nil
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var featureOptionsOverrides: ReclaimOverrides.FeatureOptions? = if let featureOptions {
|
|
109
|
+
.init(
|
|
110
|
+
cookiePersist: featureOptions.cookiePersist?.boolValue,
|
|
111
|
+
singleReclaimRequest: featureOptions.singleReclaimRequest?.boolValue,
|
|
112
|
+
idleTimeThresholdForManualVerificationTrigger: featureOptions.idleTimeThresholdForManualVerificationTrigger?.int64Value,
|
|
113
|
+
sessionTimeoutForManualVerificationTrigger: featureOptions.sessionTimeoutForManualVerificationTrigger?.int64Value,
|
|
114
|
+
attestorBrowserRpcUrl: featureOptions.attestorBrowserRpcUrl,
|
|
115
|
+
isResponseRedactionRegexEscapingEnabled: featureOptions.isResponseRedactionRegexEscapingEnabled?.boolValue,
|
|
116
|
+
isAIFlowEnabled: featureOptions.isAIFlowEnabled?.boolValue
|
|
117
|
+
)
|
|
118
|
+
} else {
|
|
119
|
+
nil
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
let logConsumerOverrides: ReclaimOverrides.LogConsumer? = if let logConsumer = logConsumer {
|
|
123
|
+
.init(
|
|
124
|
+
logHandler: logConsumer.logHandler,
|
|
125
|
+
canSdkCollectTelemetry: logConsumer.canSdkCollectTelemetry,
|
|
126
|
+
canSdkPrintLogs: logConsumer.canSdkPrintLogs?.boolValue
|
|
127
|
+
)
|
|
128
|
+
} else {
|
|
129
|
+
nil
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let sessionManagementOverrides: ReclaimOverrides.SessionManagement? = if let sessionManagement = sessionManagement {
|
|
133
|
+
.init(handler: sessionManagement.handler)
|
|
134
|
+
} else {
|
|
135
|
+
nil
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let appInfoOverrides: ReclaimOverrides.ReclaimAppInfo? = if let appInfo {
|
|
139
|
+
.init(
|
|
140
|
+
appName: appInfo.appName,
|
|
141
|
+
appImageUrl: appInfo.appImageUrl,
|
|
142
|
+
isRecurring: appInfo.isRecurring?.boolValue ?? false
|
|
143
|
+
)
|
|
144
|
+
} else {
|
|
145
|
+
nil
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return try await ReclaimVerification.setOverrides(
|
|
149
|
+
provider: providerOverrides,
|
|
150
|
+
featureOptions: featureOptionsOverrides,
|
|
151
|
+
logConsumer: logConsumerOverrides,
|
|
152
|
+
sessionManagement: sessionManagementOverrides,
|
|
153
|
+
appInfo: appInfoOverrides
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
func startVerificationWithRequest(_ request: ReclaimVerification.Request) async throws -> [String: Any] {
|
|
158
|
+
NSLog("[Api] starting verification");
|
|
159
|
+
return try await withCheckedThrowingContinuation { continuation in
|
|
160
|
+
NSLog("[Api] starting verification going");
|
|
161
|
+
Task { @MainActor in
|
|
162
|
+
NSLog("[Api] starting verification doing");
|
|
163
|
+
do {
|
|
164
|
+
let result = try await ReclaimVerification.startVerification(request)
|
|
165
|
+
let map: [String: Any] = [
|
|
166
|
+
"sessionId": result.sessionId,
|
|
167
|
+
"didSubmitManualVerification": result.didSubmitManualVerification,
|
|
168
|
+
"proofs": result.proofs
|
|
169
|
+
]
|
|
170
|
+
continuation.resume(returning: map)
|
|
171
|
+
} catch {
|
|
172
|
+
NSLog("[Api] failed verification \(error)");
|
|
173
|
+
let apiError: ApiError = if (error is ReclaimVerificationError) {
|
|
174
|
+
switch (error as! ReclaimVerificationError) {
|
|
175
|
+
case .cancelled(sessionId: let sessionId, didSubmitManualVerification: let didSubmitManualVerification):
|
|
176
|
+
.init(errorType: "cancelled", sessionId: sessionId, didSubmitManualVerification: didSubmitManualVerification, reason: nil)
|
|
177
|
+
case .dismissed(sessionId: let sessionId, didSubmitManualVerification: let didSubmitManualVerification):
|
|
178
|
+
.init(errorType: "dismissed", sessionId: sessionId, didSubmitManualVerification: didSubmitManualVerification, reason: nil)
|
|
179
|
+
case .sessionExpired(sessionId: let sessionId, didSubmitManualVerification: let didSubmitManualVerification):
|
|
180
|
+
.init(errorType: "sessionExpired", sessionId: sessionId, didSubmitManualVerification: didSubmitManualVerification, reason: nil)
|
|
181
|
+
case .failed(sessionId: let sessionId, didSubmitManualVerification: let didSubmitManualVerification, reason: let reason):
|
|
182
|
+
.init(errorType: "failed", sessionId: sessionId, didSubmitManualVerification: didSubmitManualVerification, reason: reason)
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
ApiError(errorType: "failed", sessionId: request.maybeSessionId ?? "", didSubmitManualVerification: false, reason: "\(error)")
|
|
186
|
+
}
|
|
187
|
+
continuation.resume(throwing: apiError)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@objc(ApiError) public class ApiError: NSError, @unchecked Sendable {
|
|
195
|
+
@objc public let errorType: String
|
|
196
|
+
@objc public let sessionId: String?
|
|
197
|
+
@objc public let didSubmitManualVerification: Bool
|
|
198
|
+
@objc public let reason: String?
|
|
199
|
+
|
|
200
|
+
public init(errorType: String, sessionId: String?, didSubmitManualVerification: Bool, reason: String?) {
|
|
201
|
+
self.errorType = errorType
|
|
202
|
+
self.sessionId = sessionId
|
|
203
|
+
self.didSubmitManualVerification = didSubmitManualVerification
|
|
204
|
+
self.reason = reason
|
|
205
|
+
super.init(domain: "ApiError", code: 1, userInfo: [
|
|
206
|
+
"errorType": errorType,
|
|
207
|
+
"sessionId": sessionId ?? "",
|
|
208
|
+
"didSubmitManualVerification": didSubmitManualVerification,
|
|
209
|
+
"reason": reason ?? ""
|
|
210
|
+
])
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
required init?(coder: NSCoder) {
|
|
214
|
+
fatalError("init(coder:) has not been implemented")
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@objc(OverridenProviderInformation) public class OverridenProviderInformation: NSObject {
|
|
219
|
+
@objc public var url: String?
|
|
220
|
+
@objc public var jsonString: String?
|
|
221
|
+
|
|
222
|
+
@objc public init(
|
|
223
|
+
url: String? = nil,
|
|
224
|
+
jsonString: String? = nil
|
|
225
|
+
) {
|
|
226
|
+
self.url = url
|
|
227
|
+
self.jsonString = jsonString
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@objc(OverridenFeatureOptions) public class OverridenFeatureOptions: NSObject {
|
|
232
|
+
// bool
|
|
233
|
+
@objc public var cookiePersist: NSNumber?
|
|
234
|
+
// bool
|
|
235
|
+
@objc public var singleReclaimRequest: NSNumber?
|
|
236
|
+
// int64 (long)
|
|
237
|
+
@objc public var idleTimeThresholdForManualVerificationTrigger: NSNumber?
|
|
238
|
+
// int64 (long)
|
|
239
|
+
@objc public var sessionTimeoutForManualVerificationTrigger: NSNumber?
|
|
240
|
+
@objc public var attestorBrowserRpcUrl: String?
|
|
241
|
+
// bool
|
|
242
|
+
@objc public var isResponseRedactionRegexEscapingEnabled: NSNumber?
|
|
243
|
+
// bool
|
|
244
|
+
@objc public var isAIFlowEnabled: NSNumber?
|
|
245
|
+
|
|
246
|
+
@objc public init(
|
|
247
|
+
cookiePersist: NSNumber? = nil,
|
|
248
|
+
singleReclaimRequest: NSNumber? = nil,
|
|
249
|
+
idleTimeThresholdForManualVerificationTrigger: NSNumber? = nil,
|
|
250
|
+
sessionTimeoutForManualVerificationTrigger: NSNumber? = nil,
|
|
251
|
+
attestorBrowserRpcUrl: String? = nil,
|
|
252
|
+
isResponseRedactionRegexEscapingEnabled: NSNumber? = nil,
|
|
253
|
+
isAIFlowEnabled: NSNumber? = nil
|
|
254
|
+
) {
|
|
255
|
+
self.cookiePersist = cookiePersist
|
|
256
|
+
self.singleReclaimRequest = singleReclaimRequest
|
|
257
|
+
self.idleTimeThresholdForManualVerificationTrigger = idleTimeThresholdForManualVerificationTrigger
|
|
258
|
+
self.sessionTimeoutForManualVerificationTrigger = sessionTimeoutForManualVerificationTrigger
|
|
259
|
+
self.attestorBrowserRpcUrl = attestorBrowserRpcUrl
|
|
260
|
+
self.isResponseRedactionRegexEscapingEnabled = isResponseRedactionRegexEscapingEnabled
|
|
261
|
+
self.isAIFlowEnabled = isAIFlowEnabled
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@objc(OverridenReclaimAppInfo) public class OverridenReclaimAppInfo: NSObject {
|
|
266
|
+
@objc public let appName: String
|
|
267
|
+
@objc public let appImageUrl: String
|
|
268
|
+
@objc public let isRecurring: NSNumber?
|
|
269
|
+
|
|
270
|
+
@objc public init(
|
|
271
|
+
appName: String,
|
|
272
|
+
appImageUrl: String,
|
|
273
|
+
isRecurring: NSNumber?
|
|
274
|
+
) {
|
|
275
|
+
self.appName = appName
|
|
276
|
+
self.appImageUrl = appImageUrl
|
|
277
|
+
self.isRecurring = isRecurring
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@objc(OverridenLogConsumer) public class OverridenLogConsumer: NSObject {
|
|
282
|
+
/**
|
|
283
|
+
* Handler for consuming logs exported from the SDK.
|
|
284
|
+
*/
|
|
285
|
+
@objc public let logHandler: OverridenLogHandler?
|
|
286
|
+
/**
|
|
287
|
+
* When enabled, logs are sent to reclaim that can be used to help you.
|
|
288
|
+
* Defaults to true.
|
|
289
|
+
*/
|
|
290
|
+
@objc public let canSdkCollectTelemetry: Bool
|
|
291
|
+
/**
|
|
292
|
+
* Defaults to enabled when not in release mode.
|
|
293
|
+
* Type: Bool.
|
|
294
|
+
*/
|
|
295
|
+
@objc public let canSdkPrintLogs: NSNumber?
|
|
296
|
+
|
|
297
|
+
@objc public init(
|
|
298
|
+
logHandler: OverridenLogHandler? = nil,
|
|
299
|
+
canSdkCollectTelemetry: Bool = true,
|
|
300
|
+
canSdkPrintLogs: NSNumber? = nil
|
|
301
|
+
) {
|
|
302
|
+
self.logHandler = logHandler
|
|
303
|
+
self.canSdkCollectTelemetry = canSdkCollectTelemetry
|
|
304
|
+
self.canSdkPrintLogs = canSdkPrintLogs
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@objc(OverridenLogHandler) public class OverridenLogHandler: NSObject, ReclaimOverrides.LogConsumer.LogHandler {
|
|
309
|
+
@objc let _onLogs: (String) -> Void
|
|
310
|
+
|
|
311
|
+
@objc public init(onLogs: @escaping (String) -> Void) {
|
|
312
|
+
self._onLogs = onLogs
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
@objc public func onLogs(logJsonString: String) {
|
|
316
|
+
self._onLogs(logJsonString)
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
public typealias OverridenCreateSessionCallback = (
|
|
321
|
+
_ appId: String,
|
|
322
|
+
_ providerId: String,
|
|
323
|
+
_ sessionId: String,
|
|
324
|
+
_ replyId: String
|
|
325
|
+
) -> Void
|
|
326
|
+
public typealias OverridenUpdateSessionCallback = (
|
|
327
|
+
_ sessionId: String,
|
|
328
|
+
/// `ReclaimOverrides.SessionManament.SessionStatus` enum
|
|
329
|
+
_ status: String,
|
|
330
|
+
_ replyId: String
|
|
331
|
+
) -> Void
|
|
332
|
+
public typealias OverridenLogSessionCallback = (
|
|
333
|
+
_ appId: String,
|
|
334
|
+
_ providerId: String,
|
|
335
|
+
_ sessionId: String,
|
|
336
|
+
_ logType: String
|
|
337
|
+
) -> Void
|
|
338
|
+
|
|
339
|
+
@objc(OverridenSessionManagement) public class OverridenSessionManagement: NSObject {
|
|
340
|
+
@objc public let handler: OverridenSessionHandler
|
|
341
|
+
|
|
342
|
+
@objc public init(handler: OverridenSessionHandler) {
|
|
343
|
+
self.handler = handler
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@objc(OverridenSessionHandler) public class OverridenSessionHandler: NSObject, ReclaimOverrides.SessionManagement.SessionHandler {
|
|
347
|
+
|
|
348
|
+
@objc let _createSession: OverridenCreateSessionCallback
|
|
349
|
+
@objc let _updateSession: OverridenUpdateSessionCallback
|
|
350
|
+
@objc let _logSession: OverridenLogSessionCallback
|
|
351
|
+
|
|
352
|
+
@objc public init(
|
|
353
|
+
_createSession: @escaping OverridenCreateSessionCallback,
|
|
354
|
+
_updateSession: @escaping OverridenUpdateSessionCallback,
|
|
355
|
+
_logSession: @escaping OverridenLogSessionCallback
|
|
356
|
+
) {
|
|
357
|
+
self._createSession = _createSession
|
|
358
|
+
self._updateSession = _updateSession
|
|
359
|
+
self._logSession = _logSession
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
public func createSession(
|
|
363
|
+
appId: String, providerId: String, sessionId: String, completion: @escaping (Result<Bool, any Error>) -> Void
|
|
364
|
+
) {
|
|
365
|
+
let replyId = Api.setReplyCallback(completion)
|
|
366
|
+
self._createSession(appId, providerId, sessionId, replyId)
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
public func updateSession(
|
|
370
|
+
sessionId: String, status: ReclaimInAppSdk.ReclaimOverrides.SessionManagement.SessionStatus, completion: @escaping (Result<Bool, any Error>) -> Void
|
|
371
|
+
) {
|
|
372
|
+
let statusString = switch (status) {
|
|
373
|
+
case .USER_STARTED_VERIFICATION:
|
|
374
|
+
"USER_STARTED_VERIFICATION"
|
|
375
|
+
case .USER_INIT_VERIFICATION:
|
|
376
|
+
"USER_INIT_VERIFICATION"
|
|
377
|
+
case .PROOF_GENERATION_STARTED:
|
|
378
|
+
"PROOF_GENERATION_STARTED"
|
|
379
|
+
case .PROOF_GENERATION_RETRY:
|
|
380
|
+
"PROOF_GENERATION_RETRY"
|
|
381
|
+
case .PROOF_GENERATION_SUCCESS:
|
|
382
|
+
"PROOF_GENERATION_SUCCESS"
|
|
383
|
+
case .PROOF_GENERATION_FAILED:
|
|
384
|
+
"PROOF_GENERATION_FAILED"
|
|
385
|
+
case .PROOF_SUBMITTED:
|
|
386
|
+
"PROOF_SUBMITTED"
|
|
387
|
+
case .PROOF_SUBMISSION_FAILED:
|
|
388
|
+
"PROOF_SUBMISSION_FAILED"
|
|
389
|
+
case .PROOF_MANUAL_VERIFICATION_SUBMITTED:
|
|
390
|
+
"PROOF_MANUAL_VERIFICATION_SUBMITTED"
|
|
391
|
+
}
|
|
392
|
+
let replyId = Api.setReplyCallback(completion)
|
|
393
|
+
self._updateSession(sessionId, statusString, replyId)
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
public func logSession(
|
|
397
|
+
appId: String,
|
|
398
|
+
providerId: String,
|
|
399
|
+
sessionId: String,
|
|
400
|
+
logType: String
|
|
401
|
+
) {
|
|
402
|
+
self._logSession(appId, providerId, sessionId, logType)
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReclaimVerificationPlatformChannel = exports.ReclaimVerificationApi = void 0;
|
|
7
|
+
var _NativeInappRnSdk = _interopRequireDefault(require("./specs/NativeInappRnSdk.js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* This namespace provides types involved in initiating and managing the verification process
|
|
11
|
+
* for proving claims about user data through various providers.
|
|
12
|
+
*/
|
|
13
|
+
let ReclaimVerificationApi = exports.ReclaimVerificationApi = void 0;
|
|
14
|
+
(function (_ReclaimVerificationApi) {
|
|
15
|
+
/**
|
|
16
|
+
* Represents user's session information for a verification attempt.
|
|
17
|
+
* This data class contains the necessary data to identify and validate a verification session.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Represents a request for a verification attempt.
|
|
21
|
+
*
|
|
22
|
+
* You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Contains the proof and response data after verification
|
|
26
|
+
*/
|
|
27
|
+
let Overrides;
|
|
28
|
+
(function (_Overrides) {
|
|
29
|
+
;
|
|
30
|
+
})(Overrides || (Overrides = _ReclaimVerificationApi.Overrides || (_ReclaimVerificationApi.Overrides = {})));
|
|
31
|
+
let ExceptionType = /*#__PURE__*/function (ExceptionType) {
|
|
32
|
+
ExceptionType["Cancelled"] = "Cancelled";
|
|
33
|
+
ExceptionType["Dismissed"] = "Dismissed";
|
|
34
|
+
ExceptionType["SessionExpired"] = "SessionExpired";
|
|
35
|
+
ExceptionType["Failed"] = "Failed";
|
|
36
|
+
return ExceptionType;
|
|
37
|
+
}({});
|
|
38
|
+
_ReclaimVerificationApi.ExceptionType = ExceptionType;
|
|
39
|
+
class ReclaimVerificationException extends Error {
|
|
40
|
+
constructor(message, innerError, type, sessionId, didSubmitManualVerification, reason) {
|
|
41
|
+
super(message);
|
|
42
|
+
this.innerError = innerError;
|
|
43
|
+
this.type = type;
|
|
44
|
+
this.sessionId = sessionId;
|
|
45
|
+
this.didSubmitManualVerification = didSubmitManualVerification;
|
|
46
|
+
this.reason = reason;
|
|
47
|
+
}
|
|
48
|
+
static fromTypeName(name) {
|
|
49
|
+
switch (name) {
|
|
50
|
+
case "cancelled":
|
|
51
|
+
case "org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Cancelled":
|
|
52
|
+
return ExceptionType.Cancelled;
|
|
53
|
+
case "dismissed":
|
|
54
|
+
case "org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Dismissed":
|
|
55
|
+
return ExceptionType.Dismissed;
|
|
56
|
+
case "sessionExpired":
|
|
57
|
+
case "org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.SessionExpired":
|
|
58
|
+
return ExceptionType.SessionExpired;
|
|
59
|
+
case "failed":
|
|
60
|
+
case "org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Failed":
|
|
61
|
+
return ExceptionType.Failed;
|
|
62
|
+
}
|
|
63
|
+
return ExceptionType.Failed;
|
|
64
|
+
}
|
|
65
|
+
static fromError(error, sessionIdHint) {
|
|
66
|
+
if (Object.hasOwn(error, 'userInfo')) {
|
|
67
|
+
// From native, we send information about error in userInfo
|
|
68
|
+
let unTypedError = error;
|
|
69
|
+
let userInfo = unTypedError.userInfo;
|
|
70
|
+
if (userInfo) {
|
|
71
|
+
let type = ReclaimVerificationApi.ReclaimVerificationException.fromTypeName(unTypedError.userInfo.errorType);
|
|
72
|
+
let maybeSessionId = unTypedError?.userInfo?.sessionId;
|
|
73
|
+
return new ReclaimVerificationException(error.message, error, type, typeof maybeSessionId === 'string' && maybeSessionId ? maybeSessionId : sessionIdHint, unTypedError?.userInfo?.didSubmitManualVerification ?? false, unTypedError?.userInfo?.reason ?? "");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return new ReclaimVerificationException(error.message, error, ReclaimVerificationApi.ExceptionType.Failed, sessionIdHint, false, "");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
_ReclaimVerificationApi.ReclaimVerificationException = ReclaimVerificationException;
|
|
80
|
+
})(ReclaimVerificationApi || (exports.ReclaimVerificationApi = ReclaimVerificationApi = {}));
|
|
81
|
+
class ReclaimVerificationPlatformChannel {
|
|
82
|
+
async startVerification(request) {
|
|
83
|
+
try {
|
|
84
|
+
return await _NativeInappRnSdk.default.startVerification(request);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.info({
|
|
87
|
+
error
|
|
88
|
+
});
|
|
89
|
+
if (error instanceof Error) {
|
|
90
|
+
throw ReclaimVerificationApi.ReclaimVerificationException.fromError(error, request.session?.sessionId ?? "");
|
|
91
|
+
}
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async startVerificationFromUrl(requestUrl) {
|
|
96
|
+
try {
|
|
97
|
+
return await _NativeInappRnSdk.default.startVerificationFromUrl(requestUrl);
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.info({
|
|
100
|
+
error
|
|
101
|
+
});
|
|
102
|
+
if (error instanceof Error) {
|
|
103
|
+
throw ReclaimVerificationApi.ReclaimVerificationException.fromError(error, "");
|
|
104
|
+
}
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async ping() {
|
|
109
|
+
return await _NativeInappRnSdk.default.ping();
|
|
110
|
+
}
|
|
111
|
+
previousLogSubscription = null;
|
|
112
|
+
previousSessionManagementCancelCallback = null;
|
|
113
|
+
setOverrides({
|
|
114
|
+
provider,
|
|
115
|
+
featureOptions,
|
|
116
|
+
logConsumer,
|
|
117
|
+
sessionManagement,
|
|
118
|
+
appInfo
|
|
119
|
+
}) {
|
|
120
|
+
this.previousLogSubscription?.remove();
|
|
121
|
+
this.previousLogSubscription = null;
|
|
122
|
+
let callback = this.previousSessionManagementCancelCallback;
|
|
123
|
+
if (callback != null) {
|
|
124
|
+
callback();
|
|
125
|
+
}
|
|
126
|
+
this.previousSessionManagementCancelCallback = null;
|
|
127
|
+
let logConsumerRequest = logConsumer == null ? undefined : {
|
|
128
|
+
enableLogHandler: logConsumer?.onLogs != null,
|
|
129
|
+
canSdkCollectTelemetry: logConsumer?.canSdkCollectTelemetry,
|
|
130
|
+
canSdkPrintLogs: logConsumer?.canSdkPrintLogs
|
|
131
|
+
};
|
|
132
|
+
const onLogsListener = logConsumer?.onLogs;
|
|
133
|
+
if (onLogsListener != null) {
|
|
134
|
+
const cancel = () => {
|
|
135
|
+
this.previousLogSubscription?.remove();
|
|
136
|
+
this.previousLogSubscription = null;
|
|
137
|
+
};
|
|
138
|
+
this.previousLogSubscription = _NativeInappRnSdk.default.onLogs(arg => {
|
|
139
|
+
onLogsListener(arg, cancel);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
let sessionManagementRequest = sessionManagement == null ? undefined : {
|
|
143
|
+
// A handler is provided, so we don't let SDK manage sessions
|
|
144
|
+
enableSdkSessionManagement: false
|
|
145
|
+
};
|
|
146
|
+
if (sessionManagement != null) {
|
|
147
|
+
let sessionCreateSubscription = _NativeInappRnSdk.default.onSessionCreateRequest(async event => {
|
|
148
|
+
const replyId = event.replyId;
|
|
149
|
+
let result = await sessionManagement.onSessionCreateRequest(event);
|
|
150
|
+
_NativeInappRnSdk.default.reply(replyId, result);
|
|
151
|
+
});
|
|
152
|
+
let sessionUpdateSubscription = _NativeInappRnSdk.default.onSessionUpdateRequest(async event => {
|
|
153
|
+
const replyId = event.replyId;
|
|
154
|
+
let result = await sessionManagement.onSessionUpdateRequest(event);
|
|
155
|
+
_NativeInappRnSdk.default.reply(replyId, result);
|
|
156
|
+
});
|
|
157
|
+
let sessionLogsSubscription = _NativeInappRnSdk.default.onSessionLogs(event => {
|
|
158
|
+
sessionManagement.onLog(event);
|
|
159
|
+
});
|
|
160
|
+
const cancel = () => {
|
|
161
|
+
sessionCreateSubscription.remove();
|
|
162
|
+
sessionUpdateSubscription.remove();
|
|
163
|
+
sessionLogsSubscription.remove();
|
|
164
|
+
};
|
|
165
|
+
this.previousSessionManagementCancelCallback = cancel;
|
|
166
|
+
}
|
|
167
|
+
_NativeInappRnSdk.default.setOverrides({
|
|
168
|
+
provider,
|
|
169
|
+
featureOptions,
|
|
170
|
+
logConsumer: logConsumerRequest,
|
|
171
|
+
sessionManagement: sessionManagementRequest,
|
|
172
|
+
appInfo
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.ReclaimVerificationPlatformChannel = ReclaimVerificationPlatformChannel;
|
|
177
|
+
//# sourceMappingURL=ReclaimVerificationPlatformChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_NativeInappRnSdk","_interopRequireDefault","require","e","__esModule","default","ReclaimVerificationApi","exports","_ReclaimVerificationApi","Overrides","_Overrides","ExceptionType","ReclaimVerificationException","Error","constructor","message","innerError","type","sessionId","didSubmitManualVerification","reason","fromTypeName","name","Cancelled","Dismissed","SessionExpired","Failed","fromError","error","sessionIdHint","Object","hasOwn","unTypedError","userInfo","errorType","maybeSessionId","ReclaimVerificationPlatformChannel","startVerification","request","NativeReclaimInappModule","console","info","session","startVerificationFromUrl","requestUrl","ping","previousLogSubscription","previousSessionManagementCancelCallback","setOverrides","provider","featureOptions","logConsumer","sessionManagement","appInfo","remove","callback","logConsumerRequest","undefined","enableLogHandler","onLogs","canSdkCollectTelemetry","canSdkPrintLogs","onLogsListener","cancel","arg","sessionManagementRequest","enableSdkSessionManagement","sessionCreateSubscription","onSessionCreateRequest","event","replyId","result","reply","sessionUpdateSubscription","onSessionUpdateRequest","sessionLogsSubscription","onSessionLogs","onLog"],"sourceRoot":"../../src","sources":["ReclaimVerificationPlatformChannel.ts"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGhE;AACA;AACA;AACA;AAHA,IAIiBG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA;AAAA,WAAAE,uBAAA;EACnC;AACJ;AACA;AACA;EAGI;AACJ;AACA;AACA;AACA;EAGI;AACJ;AACA;EAFI,IAAAC,SAAA;EAAA,WAAAC,UAAA;IA8BK;EAAC,GAzBWD,SAAS,KAATA,SAAS,GAAAD,uBAAA,CAATC,SAAS,KAAAD,uBAAA,CAATC,SAAS;EAAA,IAqCdE,aAAa,0BAAbA,aAAa;IAAbA,aAAa;IAAbA,aAAa;IAAbA,aAAa;IAAbA,aAAa;IAAA,OAAbA,aAAa;EAAA;EAAAH,uBAAA,CAAAG,aAAA,GAAAA,aAAA;EAOlB,MAAMC,4BAA4B,SAASC,KAAK,CAAC;IAOpDC,WAAWA,CACPC,OAAe,EACfC,UAAiB,EACjBC,IAAmB,EACnBC,SAAiB,EACjBC,2BAAoC,EACpCC,MAAc,EAChB;MACE,KAAK,CAACL,OAAO,CAAC;MACd,IAAI,CAACC,UAAU,GAAGA,UAAU;MAC5B,IAAI,CAACC,IAAI,GAAGA,IAAI;MAChB,IAAI,CAACC,SAAS,GAAGA,SAAS;MAC1B,IAAI,CAACC,2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IE,yBAAyB,GAAGlC,yBAAwB,CAACmC,sBAAsB,CAAC,MAAOL,KAAK,IAAK;QAC7F,MAAMC,OAAO,GAAGD,KAAK,CAACC,OAAO;QAC7B,IAAIC,MAAM,GAAG,MAAMnB,iBAAiB,CAACsB,sBAAsB,CAACL,KAAK,CAAC;QAClE9B,yBAAwB,CAACiC,KAAK,CAACF,OAAO,EAAEC,MAAM,CAAC;MACnD,CAAC,CAAC;MACF,IAAII,uBAAuB,GAAGpC,yBAAwB,CAACqC,aAAa,CAAEP,KAAK,IAAK;QAC5EjB,iBAAiB,CAACyB,KAAK,CAACR,KAAK,CAAC;MAClC,CAAC,CAAC;MACF,MAAMN,MAAM,GAAGA,CAAA,KAAM;QACjBI,yBAAyB,CAACb,MAAM,CAAC,CAAC;QAClCmB,yBAAyB,CAACnB,MAAM,CAAC,CAAC;QAClCqB,uBAAuB,CAACrB,MAAM,CAAC,CAAC;MACpC,CAAC;MACD,IAAI,CAACP,uCAAuC,GAAGgB,MAAM;IACzD;IAEAxB,yBAAwB,CAACS,YAAY,CAAC;MAClCC,QAAQ;MACRC,cAAc;MACdC,WAAW,EAAEK,kBAAkB;MAC/BJ,iBAAiB,EAAEa,wBAAwB;MAC3CZ;IACJ,CAAC,CAAC;EACN;AACJ;AAAC9C,OAAA,CAAA6B,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReclaimVerification = void 0;
|
|
7
|
+
Object.defineProperty(exports, "ReclaimVerificationApi", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _ReclaimVerificationPlatformChannel.ReclaimVerificationApi;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "ReclaimVerificationPlatformChannel", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _ReclaimVerificationPlatformChannel.ReclaimVerificationPlatformChannel;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _ReclaimVerificationPlatformChannel = require("./ReclaimVerificationPlatformChannel.js");
|
|
20
|
+
class ReclaimVerification {
|
|
21
|
+
static defaultChannel = null;
|
|
22
|
+
constructor(channel) {
|
|
23
|
+
if (channel) {
|
|
24
|
+
this.channel = channel;
|
|
25
|
+
} else {
|
|
26
|
+
if (ReclaimVerification.defaultChannel == null) {
|
|
27
|
+
ReclaimVerification.defaultChannel = new _ReclaimVerificationPlatformChannel.ReclaimVerificationPlatformChannel();
|
|
28
|
+
}
|
|
29
|
+
this.channel = ReclaimVerification.defaultChannel;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async startVerification(request) {
|
|
33
|
+
return this.channel.startVerification(request);
|
|
34
|
+
}
|
|
35
|
+
async ping() {
|
|
36
|
+
return this.channel.ping();
|
|
37
|
+
}
|
|
38
|
+
setOverrides(overrides) {
|
|
39
|
+
this.channel.setOverrides(overrides);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.ReclaimVerification = ReclaimVerification;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ReclaimVerificationPlatformChannel","require","ReclaimVerification","defaultChannel","constructor","channel","ReclaimVerificationPlatformChannel","startVerification","request","ping","setOverrides","overrides","exports"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,mCAAA,GAAAC,OAAA;AAIO,MAAMC,mBAAmB,CAAC;EAG/B,OAAeC,cAAc,GAA8C,IAAI;EAExEC,WAAWA,CAACC,OAA4C,EAAE;IAC/D,IAAIA,OAAO,EAAE;MACX,IAAI,CAACA,OAAO,GAAGA,OAAO;IACxB,CAAC,MAAM;MACL,IAAIH,mBAAmB,CAACC,cAAc,IAAI,IAAI,EAAE;QAC9CD,mBAAmB,CAACC,cAAc,GAAG,IAAIG,sEAAkC,CAAC,CAAC;MAC/E;MACA,IAAI,CAACD,OAAO,GAAGH,mBAAmB,CAACC,cAAc;IACnD;EACF;EAEA,MAAaI,iBAAiBA,CAACC,OAAuC,EAA4C;IAChH,OAAO,IAAI,CAACH,OAAO,CAACE,iBAAiB,CAACC,OAAO,CAAC;EAChD;EAEA,MAAaC,IAAIA,CAAA,EAAqB;IACpC,OAAO,IAAI,CAACJ,OAAO,CAACI,IAAI,CAAC,CAAC;EAC5B;EAEOC,YAAYA,CAACC,SAAgD,EAAE;IACpE,IAAI,CAACN,OAAO,CAACK,YAAY,CAACC,SAAS,CAAC;EACtC;AACF;AAACC,OAAA,CAAAV,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* Represents a request for a verification attempt.
|
|
10
|
+
*
|
|
11
|
+
* You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Contains the proof and response data after verification
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Interface representing Feature Options.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Interface representing Reclaim App Information.
|
|
21
|
+
*/
|
|
22
|
+
var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('InappRnSdk');
|
|
23
|
+
//# sourceMappingURL=NativeInappRnSdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeInappRnSdk.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AA0BA;AACA;AACA;AACA;AACA;AAoFA;AACA;AACA;AAwBA;AACA;AACA;AAgEA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAyGeC,gCAAmB,CAACC,YAAY,CAAO,YAAY,CAAC","ignoreList":[]}
|