@reclaimprotocol/inapp-rn-sdk 0.1.7 → 0.3.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 +1 -1
- package/README.md +12 -7
- package/android/build.gradle +3 -3
- package/android/generated/java/com/reclaimprotocol/inapp_rn_sdk/NativeInappRnSdkSpec.java +24 -0
- package/android/generated/jni/RNInappRnSdkSpec-generated.cpp +21 -0
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI-generated.cpp +22 -0
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h +348 -20
- package/android/src/main/java/com/reclaimprotocol/inapp_rn_sdk/InappRnSdkModule.kt +140 -20
- package/ios/InappRnSdk.mm +65 -11
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec-generated.mm +48 -0
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec.h +68 -6
- package/ios/generated/RNInappRnSdkSpecJSI-generated.cpp +22 -0
- package/ios/generated/RNInappRnSdkSpecJSI.h +348 -20
- package/ios/inapp_rn_sdk/Api.swift +124 -7
- package/lib/commonjs/ReclaimVerificationPlatformChannel.js +156 -36
- package/lib/commonjs/ReclaimVerificationPlatformChannel.js.map +1 -1
- package/lib/commonjs/index.js +14 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeInappRnSdk.js +1 -0
- package/lib/commonjs/specs/NativeInappRnSdk.js.map +1 -1
- package/lib/module/ReclaimVerificationPlatformChannel.js +153 -34
- package/lib/module/ReclaimVerificationPlatformChannel.js.map +1 -1
- package/lib/module/index.js +10 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeInappRnSdk.js +2 -0
- package/lib/module/specs/NativeInappRnSdk.js.map +1 -1
- package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts +37 -4
- package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +5 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts +38 -4
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/proof.d.ts.map +1 -1
- package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts +37 -4
- package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +5 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts +38 -4
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts.map +1 -1
- package/lib/typescript/module/src/types/proof.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ReclaimVerificationPlatformChannel.ts +194 -41
- package/src/index.ts +12 -4
- package/src/specs/NativeInappRnSdk.ts +51 -6
package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h
CHANGED
|
@@ -174,15 +174,16 @@ struct NativeInappRnSdkLogConsumerBridging {
|
|
|
174
174
|
|
|
175
175
|
#pragma mark - NativeInappRnSdkOverrides
|
|
176
176
|
|
|
177
|
-
template <typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
177
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
|
|
178
178
|
struct NativeInappRnSdkOverrides {
|
|
179
179
|
P0 provider;
|
|
180
180
|
P1 featureOptions;
|
|
181
181
|
P2 logConsumer;
|
|
182
182
|
P3 sessionManagement;
|
|
183
183
|
P4 appInfo;
|
|
184
|
+
P5 capabilityAccessToken;
|
|
184
185
|
bool operator==(const NativeInappRnSdkOverrides &other) const {
|
|
185
|
-
return provider == other.provider && featureOptions == other.featureOptions && logConsumer == other.logConsumer && sessionManagement == other.sessionManagement && appInfo == other.appInfo;
|
|
186
|
+
return provider == other.provider && featureOptions == other.featureOptions && logConsumer == other.logConsumer && sessionManagement == other.sessionManagement && appInfo == other.appInfo && capabilityAccessToken == other.capabilityAccessToken;
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
|
|
@@ -199,7 +200,8 @@ struct NativeInappRnSdkOverridesBridging {
|
|
|
199
200
|
bridging::fromJs<decltype(types.featureOptions)>(rt, value.getProperty(rt, "featureOptions"), jsInvoker),
|
|
200
201
|
bridging::fromJs<decltype(types.logConsumer)>(rt, value.getProperty(rt, "logConsumer"), jsInvoker),
|
|
201
202
|
bridging::fromJs<decltype(types.sessionManagement)>(rt, value.getProperty(rt, "sessionManagement"), jsInvoker),
|
|
202
|
-
bridging::fromJs<decltype(types.appInfo)>(rt, value.getProperty(rt, "appInfo"), jsInvoker)
|
|
203
|
+
bridging::fromJs<decltype(types.appInfo)>(rt, value.getProperty(rt, "appInfo"), jsInvoker),
|
|
204
|
+
bridging::fromJs<decltype(types.capabilityAccessToken)>(rt, value.getProperty(rt, "capabilityAccessToken"), jsInvoker)};
|
|
203
205
|
return result;
|
|
204
206
|
}
|
|
205
207
|
|
|
@@ -223,6 +225,10 @@ struct NativeInappRnSdkOverridesBridging {
|
|
|
223
225
|
static std::optional<jsi::Object> appInfoToJs(jsi::Runtime &rt, decltype(types.appInfo) value) {
|
|
224
226
|
return bridging::toJs(rt, value);
|
|
225
227
|
}
|
|
228
|
+
|
|
229
|
+
static std::optional<jsi::String> capabilityAccessTokenToJs(jsi::Runtime &rt, decltype(types.capabilityAccessToken) value) {
|
|
230
|
+
return bridging::toJs(rt, value);
|
|
231
|
+
}
|
|
226
232
|
#endif
|
|
227
233
|
|
|
228
234
|
static jsi::Object toJs(
|
|
@@ -245,6 +251,9 @@ struct NativeInappRnSdkOverridesBridging {
|
|
|
245
251
|
if (value.appInfo) {
|
|
246
252
|
result.setProperty(rt, "appInfo", bridging::toJs(rt, value.appInfo.value(), jsInvoker));
|
|
247
253
|
}
|
|
254
|
+
if (value.capabilityAccessToken) {
|
|
255
|
+
result.setProperty(rt, "capabilityAccessToken", bridging::toJs(rt, value.capabilityAccessToken.value(), jsInvoker));
|
|
256
|
+
}
|
|
248
257
|
return result;
|
|
249
258
|
}
|
|
250
259
|
};
|
|
@@ -253,12 +262,13 @@ struct NativeInappRnSdkOverridesBridging {
|
|
|
253
262
|
|
|
254
263
|
#pragma mark - NativeInappRnSdkProviderInformation
|
|
255
264
|
|
|
256
|
-
template <typename P0, typename P1>
|
|
265
|
+
template <typename P0, typename P1, typename P2>
|
|
257
266
|
struct NativeInappRnSdkProviderInformation {
|
|
258
267
|
P0 url;
|
|
259
268
|
P1 jsonString;
|
|
269
|
+
P2 canFetchProviderInformationFromHost;
|
|
260
270
|
bool operator==(const NativeInappRnSdkProviderInformation &other) const {
|
|
261
|
-
return url == other.url && jsonString == other.jsonString;
|
|
271
|
+
return url == other.url && jsonString == other.jsonString && canFetchProviderInformationFromHost == other.canFetchProviderInformationFromHost;
|
|
262
272
|
}
|
|
263
273
|
};
|
|
264
274
|
|
|
@@ -272,7 +282,8 @@ struct NativeInappRnSdkProviderInformationBridging {
|
|
|
272
282
|
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
273
283
|
T result{
|
|
274
284
|
bridging::fromJs<decltype(types.url)>(rt, value.getProperty(rt, "url"), jsInvoker),
|
|
275
|
-
bridging::fromJs<decltype(types.jsonString)>(rt, value.getProperty(rt, "jsonString"), jsInvoker)
|
|
285
|
+
bridging::fromJs<decltype(types.jsonString)>(rt, value.getProperty(rt, "jsonString"), jsInvoker),
|
|
286
|
+
bridging::fromJs<decltype(types.canFetchProviderInformationFromHost)>(rt, value.getProperty(rt, "canFetchProviderInformationFromHost"), jsInvoker)};
|
|
276
287
|
return result;
|
|
277
288
|
}
|
|
278
289
|
|
|
@@ -284,6 +295,10 @@ struct NativeInappRnSdkProviderInformationBridging {
|
|
|
284
295
|
static jsi::String jsonStringToJs(jsi::Runtime &rt, decltype(types.jsonString) value) {
|
|
285
296
|
return bridging::toJs(rt, value);
|
|
286
297
|
}
|
|
298
|
+
|
|
299
|
+
static bool canFetchProviderInformationFromHostToJs(jsi::Runtime &rt, decltype(types.canFetchProviderInformationFromHost) value) {
|
|
300
|
+
return bridging::toJs(rt, value);
|
|
301
|
+
}
|
|
287
302
|
#endif
|
|
288
303
|
|
|
289
304
|
static jsi::Object toJs(
|
|
@@ -297,6 +312,83 @@ struct NativeInappRnSdkProviderInformationBridging {
|
|
|
297
312
|
if (value.jsonString) {
|
|
298
313
|
result.setProperty(rt, "jsonString", bridging::toJs(rt, value.jsonString.value(), jsInvoker));
|
|
299
314
|
}
|
|
315
|
+
result.setProperty(rt, "canFetchProviderInformationFromHost", bridging::toJs(rt, value.canFetchProviderInformationFromHost, jsInvoker));
|
|
316
|
+
return result;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
#pragma mark - NativeInappRnSdkProviderInformationRequest
|
|
323
|
+
|
|
324
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
|
|
325
|
+
struct NativeInappRnSdkProviderInformationRequest {
|
|
326
|
+
P0 appId;
|
|
327
|
+
P1 providerId;
|
|
328
|
+
P2 sessionId;
|
|
329
|
+
P3 signature;
|
|
330
|
+
P4 timestamp;
|
|
331
|
+
P5 replyId;
|
|
332
|
+
bool operator==(const NativeInappRnSdkProviderInformationRequest &other) const {
|
|
333
|
+
return appId == other.appId && providerId == other.providerId && sessionId == other.sessionId && signature == other.signature && timestamp == other.timestamp && replyId == other.replyId;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
template <typename T>
|
|
338
|
+
struct NativeInappRnSdkProviderInformationRequestBridging {
|
|
339
|
+
static T types;
|
|
340
|
+
|
|
341
|
+
static T fromJs(
|
|
342
|
+
jsi::Runtime &rt,
|
|
343
|
+
const jsi::Object &value,
|
|
344
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
345
|
+
T result{
|
|
346
|
+
bridging::fromJs<decltype(types.appId)>(rt, value.getProperty(rt, "appId"), jsInvoker),
|
|
347
|
+
bridging::fromJs<decltype(types.providerId)>(rt, value.getProperty(rt, "providerId"), jsInvoker),
|
|
348
|
+
bridging::fromJs<decltype(types.sessionId)>(rt, value.getProperty(rt, "sessionId"), jsInvoker),
|
|
349
|
+
bridging::fromJs<decltype(types.signature)>(rt, value.getProperty(rt, "signature"), jsInvoker),
|
|
350
|
+
bridging::fromJs<decltype(types.timestamp)>(rt, value.getProperty(rt, "timestamp"), jsInvoker),
|
|
351
|
+
bridging::fromJs<decltype(types.replyId)>(rt, value.getProperty(rt, "replyId"), jsInvoker)};
|
|
352
|
+
return result;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
#ifdef DEBUG
|
|
356
|
+
static jsi::String appIdToJs(jsi::Runtime &rt, decltype(types.appId) value) {
|
|
357
|
+
return bridging::toJs(rt, value);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
static jsi::String providerIdToJs(jsi::Runtime &rt, decltype(types.providerId) value) {
|
|
361
|
+
return bridging::toJs(rt, value);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
static jsi::String sessionIdToJs(jsi::Runtime &rt, decltype(types.sessionId) value) {
|
|
365
|
+
return bridging::toJs(rt, value);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
static jsi::String signatureToJs(jsi::Runtime &rt, decltype(types.signature) value) {
|
|
369
|
+
return bridging::toJs(rt, value);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
static jsi::String timestampToJs(jsi::Runtime &rt, decltype(types.timestamp) value) {
|
|
373
|
+
return bridging::toJs(rt, value);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static jsi::String replyIdToJs(jsi::Runtime &rt, decltype(types.replyId) value) {
|
|
377
|
+
return bridging::toJs(rt, value);
|
|
378
|
+
}
|
|
379
|
+
#endif
|
|
380
|
+
|
|
381
|
+
static jsi::Object toJs(
|
|
382
|
+
jsi::Runtime &rt,
|
|
383
|
+
const T &value,
|
|
384
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
385
|
+
auto result = facebook::jsi::Object(rt);
|
|
386
|
+
result.setProperty(rt, "appId", bridging::toJs(rt, value.appId, jsInvoker));
|
|
387
|
+
result.setProperty(rt, "providerId", bridging::toJs(rt, value.providerId, jsInvoker));
|
|
388
|
+
result.setProperty(rt, "sessionId", bridging::toJs(rt, value.sessionId, jsInvoker));
|
|
389
|
+
result.setProperty(rt, "signature", bridging::toJs(rt, value.signature, jsInvoker));
|
|
390
|
+
result.setProperty(rt, "timestamp", bridging::toJs(rt, value.timestamp, jsInvoker));
|
|
391
|
+
result.setProperty(rt, "replyId", bridging::toJs(rt, value.replyId, jsInvoker));
|
|
300
392
|
return result;
|
|
301
393
|
}
|
|
302
394
|
};
|
|
@@ -360,9 +452,112 @@ struct NativeInappRnSdkReclaimAppInfoBridging {
|
|
|
360
452
|
|
|
361
453
|
|
|
362
454
|
|
|
455
|
+
#pragma mark - NativeInappRnSdkReclaimAttestorAuthRequest
|
|
456
|
+
|
|
457
|
+
template <typename P0, typename P1>
|
|
458
|
+
struct NativeInappRnSdkReclaimAttestorAuthRequest {
|
|
459
|
+
P0 reclaimHttpProviderJsonString;
|
|
460
|
+
P1 replyId;
|
|
461
|
+
bool operator==(const NativeInappRnSdkReclaimAttestorAuthRequest &other) const {
|
|
462
|
+
return reclaimHttpProviderJsonString == other.reclaimHttpProviderJsonString && replyId == other.replyId;
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
template <typename T>
|
|
467
|
+
struct NativeInappRnSdkReclaimAttestorAuthRequestBridging {
|
|
468
|
+
static T types;
|
|
469
|
+
|
|
470
|
+
static T fromJs(
|
|
471
|
+
jsi::Runtime &rt,
|
|
472
|
+
const jsi::Object &value,
|
|
473
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
474
|
+
T result{
|
|
475
|
+
bridging::fromJs<decltype(types.reclaimHttpProviderJsonString)>(rt, value.getProperty(rt, "reclaimHttpProviderJsonString"), jsInvoker),
|
|
476
|
+
bridging::fromJs<decltype(types.replyId)>(rt, value.getProperty(rt, "replyId"), jsInvoker)};
|
|
477
|
+
return result;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
#ifdef DEBUG
|
|
481
|
+
static jsi::String reclaimHttpProviderJsonStringToJs(jsi::Runtime &rt, decltype(types.reclaimHttpProviderJsonString) value) {
|
|
482
|
+
return bridging::toJs(rt, value);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
static jsi::String replyIdToJs(jsi::Runtime &rt, decltype(types.replyId) value) {
|
|
486
|
+
return bridging::toJs(rt, value);
|
|
487
|
+
}
|
|
488
|
+
#endif
|
|
489
|
+
|
|
490
|
+
static jsi::Object toJs(
|
|
491
|
+
jsi::Runtime &rt,
|
|
492
|
+
const T &value,
|
|
493
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
494
|
+
auto result = facebook::jsi::Object(rt);
|
|
495
|
+
result.setProperty(rt, "reclaimHttpProviderJsonString", bridging::toJs(rt, value.reclaimHttpProviderJsonString, jsInvoker));
|
|
496
|
+
result.setProperty(rt, "replyId", bridging::toJs(rt, value.replyId, jsInvoker));
|
|
497
|
+
return result;
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
#pragma mark - NativeInappRnSdkReclaimSessionIdentityUpdate
|
|
504
|
+
|
|
505
|
+
template <typename P0, typename P1, typename P2>
|
|
506
|
+
struct NativeInappRnSdkReclaimSessionIdentityUpdate {
|
|
507
|
+
P0 appId;
|
|
508
|
+
P1 providerId;
|
|
509
|
+
P2 sessionId;
|
|
510
|
+
bool operator==(const NativeInappRnSdkReclaimSessionIdentityUpdate &other) const {
|
|
511
|
+
return appId == other.appId && providerId == other.providerId && sessionId == other.sessionId;
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
template <typename T>
|
|
516
|
+
struct NativeInappRnSdkReclaimSessionIdentityUpdateBridging {
|
|
517
|
+
static T types;
|
|
518
|
+
|
|
519
|
+
static T fromJs(
|
|
520
|
+
jsi::Runtime &rt,
|
|
521
|
+
const jsi::Object &value,
|
|
522
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
523
|
+
T result{
|
|
524
|
+
bridging::fromJs<decltype(types.appId)>(rt, value.getProperty(rt, "appId"), jsInvoker),
|
|
525
|
+
bridging::fromJs<decltype(types.providerId)>(rt, value.getProperty(rt, "providerId"), jsInvoker),
|
|
526
|
+
bridging::fromJs<decltype(types.sessionId)>(rt, value.getProperty(rt, "sessionId"), jsInvoker)};
|
|
527
|
+
return result;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
#ifdef DEBUG
|
|
531
|
+
static jsi::String appIdToJs(jsi::Runtime &rt, decltype(types.appId) value) {
|
|
532
|
+
return bridging::toJs(rt, value);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
static jsi::String providerIdToJs(jsi::Runtime &rt, decltype(types.providerId) value) {
|
|
536
|
+
return bridging::toJs(rt, value);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
static jsi::String sessionIdToJs(jsi::Runtime &rt, decltype(types.sessionId) value) {
|
|
540
|
+
return bridging::toJs(rt, value);
|
|
541
|
+
}
|
|
542
|
+
#endif
|
|
543
|
+
|
|
544
|
+
static jsi::Object toJs(
|
|
545
|
+
jsi::Runtime &rt,
|
|
546
|
+
const T &value,
|
|
547
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
548
|
+
auto result = facebook::jsi::Object(rt);
|
|
549
|
+
result.setProperty(rt, "appId", bridging::toJs(rt, value.appId, jsInvoker));
|
|
550
|
+
result.setProperty(rt, "providerId", bridging::toJs(rt, value.providerId, jsInvoker));
|
|
551
|
+
result.setProperty(rt, "sessionId", bridging::toJs(rt, value.sessionId, jsInvoker));
|
|
552
|
+
return result;
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
363
558
|
#pragma mark - NativeInappRnSdkRequest
|
|
364
559
|
|
|
365
|
-
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8
|
|
560
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
|
|
366
561
|
struct NativeInappRnSdkRequest {
|
|
367
562
|
P0 appId;
|
|
368
563
|
P1 secret;
|
|
@@ -370,12 +565,11 @@ struct NativeInappRnSdkRequest {
|
|
|
370
565
|
P3 session;
|
|
371
566
|
P4 contextString;
|
|
372
567
|
P5 parameters;
|
|
373
|
-
P6
|
|
374
|
-
P7
|
|
375
|
-
P8
|
|
376
|
-
P9 webhookUrl;
|
|
568
|
+
P6 autoSubmit;
|
|
569
|
+
P7 acceptAiProviders;
|
|
570
|
+
P8 webhookUrl;
|
|
377
571
|
bool operator==(const NativeInappRnSdkRequest &other) const {
|
|
378
|
-
return appId == other.appId && secret == other.secret && providerId == other.providerId && session == other.session && contextString == other.contextString && parameters == other.parameters &&
|
|
572
|
+
return appId == other.appId && secret == other.secret && providerId == other.providerId && session == other.session && contextString == other.contextString && parameters == other.parameters && autoSubmit == other.autoSubmit && acceptAiProviders == other.acceptAiProviders && webhookUrl == other.webhookUrl;
|
|
379
573
|
}
|
|
380
574
|
};
|
|
381
575
|
|
|
@@ -394,7 +588,6 @@ struct NativeInappRnSdkRequestBridging {
|
|
|
394
588
|
bridging::fromJs<decltype(types.session)>(rt, value.getProperty(rt, "session"), jsInvoker),
|
|
395
589
|
bridging::fromJs<decltype(types.contextString)>(rt, value.getProperty(rt, "contextString"), jsInvoker),
|
|
396
590
|
bridging::fromJs<decltype(types.parameters)>(rt, value.getProperty(rt, "parameters"), jsInvoker),
|
|
397
|
-
bridging::fromJs<decltype(types.hideLanding)>(rt, value.getProperty(rt, "hideLanding"), jsInvoker),
|
|
398
591
|
bridging::fromJs<decltype(types.autoSubmit)>(rt, value.getProperty(rt, "autoSubmit"), jsInvoker),
|
|
399
592
|
bridging::fromJs<decltype(types.acceptAiProviders)>(rt, value.getProperty(rt, "acceptAiProviders"), jsInvoker),
|
|
400
593
|
bridging::fromJs<decltype(types.webhookUrl)>(rt, value.getProperty(rt, "webhookUrl"), jsInvoker)};
|
|
@@ -426,10 +619,6 @@ struct NativeInappRnSdkRequestBridging {
|
|
|
426
619
|
return bridging::toJs(rt, value);
|
|
427
620
|
}
|
|
428
621
|
|
|
429
|
-
static bool hideLandingToJs(jsi::Runtime &rt, decltype(types.hideLanding) value) {
|
|
430
|
-
return bridging::toJs(rt, value);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
622
|
static bool autoSubmitToJs(jsi::Runtime &rt, decltype(types.autoSubmit) value) {
|
|
434
623
|
return bridging::toJs(rt, value);
|
|
435
624
|
}
|
|
@@ -460,9 +649,6 @@ struct NativeInappRnSdkRequestBridging {
|
|
|
460
649
|
if (value.parameters) {
|
|
461
650
|
result.setProperty(rt, "parameters", bridging::toJs(rt, value.parameters.value(), jsInvoker));
|
|
462
651
|
}
|
|
463
|
-
if (value.hideLanding) {
|
|
464
|
-
result.setProperty(rt, "hideLanding", bridging::toJs(rt, value.hideLanding.value(), jsInvoker));
|
|
465
|
-
}
|
|
466
652
|
if (value.autoSubmit) {
|
|
467
653
|
result.setProperty(rt, "autoSubmit", bridging::toJs(rt, value.autoSubmit.value(), jsInvoker));
|
|
468
654
|
}
|
|
@@ -808,6 +994,97 @@ struct NativeInappRnSdkSessionUpdateRequestEventBridging {
|
|
|
808
994
|
}
|
|
809
995
|
};
|
|
810
996
|
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
#pragma mark - NativeInappRnSdkVerificationOptions
|
|
1000
|
+
|
|
1001
|
+
template <typename P0, typename P1>
|
|
1002
|
+
struct NativeInappRnSdkVerificationOptions {
|
|
1003
|
+
P0 canDeleteCookiesBeforeVerificationStarts;
|
|
1004
|
+
P1 canUseAttestorAuthenticationRequest;
|
|
1005
|
+
bool operator==(const NativeInappRnSdkVerificationOptions &other) const {
|
|
1006
|
+
return canDeleteCookiesBeforeVerificationStarts == other.canDeleteCookiesBeforeVerificationStarts && canUseAttestorAuthenticationRequest == other.canUseAttestorAuthenticationRequest;
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
template <typename T>
|
|
1011
|
+
struct NativeInappRnSdkVerificationOptionsBridging {
|
|
1012
|
+
static T types;
|
|
1013
|
+
|
|
1014
|
+
static T fromJs(
|
|
1015
|
+
jsi::Runtime &rt,
|
|
1016
|
+
const jsi::Object &value,
|
|
1017
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
1018
|
+
T result{
|
|
1019
|
+
bridging::fromJs<decltype(types.canDeleteCookiesBeforeVerificationStarts)>(rt, value.getProperty(rt, "canDeleteCookiesBeforeVerificationStarts"), jsInvoker),
|
|
1020
|
+
bridging::fromJs<decltype(types.canUseAttestorAuthenticationRequest)>(rt, value.getProperty(rt, "canUseAttestorAuthenticationRequest"), jsInvoker)};
|
|
1021
|
+
return result;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
#ifdef DEBUG
|
|
1025
|
+
static bool canDeleteCookiesBeforeVerificationStartsToJs(jsi::Runtime &rt, decltype(types.canDeleteCookiesBeforeVerificationStarts) value) {
|
|
1026
|
+
return bridging::toJs(rt, value);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
static bool canUseAttestorAuthenticationRequestToJs(jsi::Runtime &rt, decltype(types.canUseAttestorAuthenticationRequest) value) {
|
|
1030
|
+
return bridging::toJs(rt, value);
|
|
1031
|
+
}
|
|
1032
|
+
#endif
|
|
1033
|
+
|
|
1034
|
+
static jsi::Object toJs(
|
|
1035
|
+
jsi::Runtime &rt,
|
|
1036
|
+
const T &value,
|
|
1037
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
1038
|
+
auto result = facebook::jsi::Object(rt);
|
|
1039
|
+
result.setProperty(rt, "canDeleteCookiesBeforeVerificationStarts", bridging::toJs(rt, value.canDeleteCookiesBeforeVerificationStarts, jsInvoker));
|
|
1040
|
+
result.setProperty(rt, "canUseAttestorAuthenticationRequest", bridging::toJs(rt, value.canUseAttestorAuthenticationRequest, jsInvoker));
|
|
1041
|
+
return result;
|
|
1042
|
+
}
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
#pragma mark - NativeInappRnSdkVerificationOptionsOptional
|
|
1048
|
+
|
|
1049
|
+
template <typename P0>
|
|
1050
|
+
struct NativeInappRnSdkVerificationOptionsOptional {
|
|
1051
|
+
P0 options;
|
|
1052
|
+
bool operator==(const NativeInappRnSdkVerificationOptionsOptional &other) const {
|
|
1053
|
+
return options == other.options;
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1057
|
+
template <typename T>
|
|
1058
|
+
struct NativeInappRnSdkVerificationOptionsOptionalBridging {
|
|
1059
|
+
static T types;
|
|
1060
|
+
|
|
1061
|
+
static T fromJs(
|
|
1062
|
+
jsi::Runtime &rt,
|
|
1063
|
+
const jsi::Object &value,
|
|
1064
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
1065
|
+
T result{
|
|
1066
|
+
bridging::fromJs<decltype(types.options)>(rt, value.getProperty(rt, "options"), jsInvoker)};
|
|
1067
|
+
return result;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
#ifdef DEBUG
|
|
1071
|
+
static std::optional<jsi::Object> optionsToJs(jsi::Runtime &rt, decltype(types.options) value) {
|
|
1072
|
+
return bridging::toJs(rt, value);
|
|
1073
|
+
}
|
|
1074
|
+
#endif
|
|
1075
|
+
|
|
1076
|
+
static jsi::Object toJs(
|
|
1077
|
+
jsi::Runtime &rt,
|
|
1078
|
+
const T &value,
|
|
1079
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
1080
|
+
auto result = facebook::jsi::Object(rt);
|
|
1081
|
+
if (value.options) {
|
|
1082
|
+
result.setProperty(rt, "options", bridging::toJs(rt, value.options.value(), jsInvoker));
|
|
1083
|
+
}
|
|
1084
|
+
return result;
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
|
|
811
1088
|
class JSI_EXPORT NativeInappRnSdkCxxSpecJSI : public TurboModule {
|
|
812
1089
|
protected:
|
|
813
1090
|
NativeInappRnSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
@@ -816,7 +1093,10 @@ public:
|
|
|
816
1093
|
virtual jsi::Value startVerification(jsi::Runtime &rt, jsi::Object request) = 0;
|
|
817
1094
|
virtual jsi::Value startVerificationFromUrl(jsi::Runtime &rt, jsi::String requestUrl) = 0;
|
|
818
1095
|
virtual jsi::Value setOverrides(jsi::Runtime &rt, jsi::Object overrides) = 0;
|
|
1096
|
+
virtual jsi::Value clearAllOverrides(jsi::Runtime &rt) = 0;
|
|
1097
|
+
virtual jsi::Value setVerificationOptions(jsi::Runtime &rt, jsi::Object args) = 0;
|
|
819
1098
|
virtual void reply(jsi::Runtime &rt, jsi::String replyId, bool reply) = 0;
|
|
1099
|
+
virtual void replyWithString(jsi::Runtime &rt, jsi::String replyId, jsi::String value) = 0;
|
|
820
1100
|
virtual jsi::Value ping(jsi::Runtime &rt) = 0;
|
|
821
1101
|
|
|
822
1102
|
};
|
|
@@ -867,6 +1147,27 @@ protected:
|
|
|
867
1147
|
});
|
|
868
1148
|
}
|
|
869
1149
|
|
|
1150
|
+
template <typename OnProviderInformationRequestType> void emitOnProviderInformationRequest(OnProviderInformationRequestType value) {
|
|
1151
|
+
static_assert(bridging::supportsFromJs<OnProviderInformationRequestType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
1152
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onProviderInformationRequest"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
1153
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
template <typename OnReclaimAttestorAuthRequestType> void emitOnReclaimAttestorAuthRequest(OnReclaimAttestorAuthRequestType value) {
|
|
1158
|
+
static_assert(bridging::supportsFromJs<OnReclaimAttestorAuthRequestType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
1159
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onReclaimAttestorAuthRequest"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
1160
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
template <typename OnSessionIdentityUpdateType> void emitOnSessionIdentityUpdate(OnSessionIdentityUpdateType value) {
|
|
1165
|
+
static_assert(bridging::supportsFromJs<OnSessionIdentityUpdateType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
1166
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onSessionIdentityUpdate"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
1167
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
|
|
870
1171
|
private:
|
|
871
1172
|
class Delegate : public NativeInappRnSdkCxxSpecJSI {
|
|
872
1173
|
public:
|
|
@@ -876,6 +1177,9 @@ private:
|
|
|
876
1177
|
eventEmitterMap_["onSessionLogs"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
877
1178
|
eventEmitterMap_["onSessionCreateRequest"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
878
1179
|
eventEmitterMap_["onSessionUpdateRequest"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
1180
|
+
eventEmitterMap_["onProviderInformationRequest"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
1181
|
+
eventEmitterMap_["onReclaimAttestorAuthRequest"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
1182
|
+
eventEmitterMap_["onSessionIdentityUpdate"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
879
1183
|
}
|
|
880
1184
|
|
|
881
1185
|
jsi::Value startVerification(jsi::Runtime &rt, jsi::Object request) override {
|
|
@@ -902,6 +1206,22 @@ private:
|
|
|
902
1206
|
return bridging::callFromJs<jsi::Value>(
|
|
903
1207
|
rt, &T::setOverrides, jsInvoker_, instance_, std::move(overrides));
|
|
904
1208
|
}
|
|
1209
|
+
jsi::Value clearAllOverrides(jsi::Runtime &rt) override {
|
|
1210
|
+
static_assert(
|
|
1211
|
+
bridging::getParameterCount(&T::clearAllOverrides) == 1,
|
|
1212
|
+
"Expected clearAllOverrides(...) to have 1 parameters");
|
|
1213
|
+
|
|
1214
|
+
return bridging::callFromJs<jsi::Value>(
|
|
1215
|
+
rt, &T::clearAllOverrides, jsInvoker_, instance_);
|
|
1216
|
+
}
|
|
1217
|
+
jsi::Value setVerificationOptions(jsi::Runtime &rt, jsi::Object args) override {
|
|
1218
|
+
static_assert(
|
|
1219
|
+
bridging::getParameterCount(&T::setVerificationOptions) == 2,
|
|
1220
|
+
"Expected setVerificationOptions(...) to have 2 parameters");
|
|
1221
|
+
|
|
1222
|
+
return bridging::callFromJs<jsi::Value>(
|
|
1223
|
+
rt, &T::setVerificationOptions, jsInvoker_, instance_, std::move(args));
|
|
1224
|
+
}
|
|
905
1225
|
void reply(jsi::Runtime &rt, jsi::String replyId, bool reply) override {
|
|
906
1226
|
static_assert(
|
|
907
1227
|
bridging::getParameterCount(&T::reply) == 3,
|
|
@@ -910,6 +1230,14 @@ private:
|
|
|
910
1230
|
return bridging::callFromJs<void>(
|
|
911
1231
|
rt, &T::reply, jsInvoker_, instance_, std::move(replyId), std::move(reply));
|
|
912
1232
|
}
|
|
1233
|
+
void replyWithString(jsi::Runtime &rt, jsi::String replyId, jsi::String value) override {
|
|
1234
|
+
static_assert(
|
|
1235
|
+
bridging::getParameterCount(&T::replyWithString) == 3,
|
|
1236
|
+
"Expected replyWithString(...) to have 3 parameters");
|
|
1237
|
+
|
|
1238
|
+
return bridging::callFromJs<void>(
|
|
1239
|
+
rt, &T::replyWithString, jsInvoker_, instance_, std::move(replyId), std::move(value));
|
|
1240
|
+
}
|
|
913
1241
|
jsi::Value ping(jsi::Runtime &rt) override {
|
|
914
1242
|
static_assert(
|
|
915
1243
|
bridging::getParameterCount(&T::ping) == 1,
|