@reclaimprotocol/inapp-rn-sdk 0.18.0 → 0.24.1-alpha.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 +4 -27
- package/android/build.gradle +8 -59
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/reclaimprotocol/{inapp_rn_sdk → inapprnsdk}/InappRnSdkModule.kt +138 -70
- package/android/src/main/java/com/reclaimprotocol/{inapp_rn_sdk → inapprnsdk}/InappRnSdkPackage.kt +1 -1
- package/android/src/main/java/com/reclaimprotocol/{inapp_rn_sdk → inapprnsdk}/JsonExtension.kt +1 -1
- package/expo-plugin/src/index.ts +1 -1
- package/ios/InappRnSdk-Bridging-Header.h +0 -1
- package/ios/InappRnSdk.h +2 -13
- package/ios/InappRnSdk.mm +70 -16
- package/ios/inapp_rn_sdk/Api.swift +43 -0
- package/lib/module/NativeInappRnSdk.js.map +1 -0
- package/lib/module/index.js +57 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/expo-plugin/src/android/index.d.ts +3 -0
- package/lib/typescript/expo-plugin/src/android/index.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/src/android/withReclaimAndroidManifest.d.ts +3 -0
- package/lib/typescript/expo-plugin/src/android/withReclaimAndroidManifest.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/src/android/withReclaimProjectBuildGradle.d.ts +3 -0
- package/lib/typescript/expo-plugin/src/android/withReclaimProjectBuildGradle.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/src/index.d.ts +4 -0
- package/lib/typescript/expo-plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/{commonjs/src/specs → src}/NativeInappRnSdk.d.ts +18 -9
- package/lib/typescript/src/NativeInappRnSdk.d.ts.map +1 -0
- package/lib/typescript/{module/src → src}/index.d.ts +17 -1
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +84 -128
- package/src/{specs/NativeInappRnSdk.ts → NativeInappRnSdk.ts} +19 -9
- package/src/{index.ts → index.tsx} +85 -1
- package/android/generated/java/com/reclaimprotocol/inapp_rn_sdk/NativeInappRnSdkSpec.java +0 -99
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/RNInappRnSdkSpec-generated.cpp +0 -88
- package/android/generated/jni/RNInappRnSdkSpec.h +0 -31
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI-generated.cpp +0 -85
- package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h +0 -1348
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec-generated.mm +0 -197
- package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec.h +0 -494
- package/ios/generated/RNInappRnSdkSpecJSI-generated.cpp +0 -85
- package/ios/generated/RNInappRnSdkSpecJSI.h +0 -1348
- package/lib/commonjs/index.js +0 -389
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/specs/NativeInappRnSdk.js +0 -24
- package/lib/commonjs/specs/NativeInappRnSdk.js.map +0 -1
- package/lib/module/specs/NativeInappRnSdk.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -192
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts +0 -345
- package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts.map +0 -1
- package/react-native.config.js +0 -12
- /package/lib/module/{specs/NativeInappRnSdk.js → NativeInappRnSdk.js} +0 -0
- /package/lib/{typescript/module → module}/package.json +0 -0
package/package.json
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reclaimprotocol/inapp-rn-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1-alpha.0",
|
|
4
4
|
"description": "Reclaim Protocol's InApp React Native SDK for ZK proof generations for requests with an in-app experience of web verification",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"module": "./lib/module/index.js",
|
|
8
|
-
"types": "./lib/typescript/module/src/index.d.ts",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
9
7
|
"exports": {
|
|
10
8
|
".": {
|
|
11
|
-
"source": "./src/index.
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"default": "./lib/module/index.js"
|
|
15
|
-
},
|
|
16
|
-
"require": {
|
|
17
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
18
|
-
"default": "./lib/commonjs/index.js"
|
|
19
|
-
}
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
20
12
|
},
|
|
21
13
|
"./app.plugin.js": "./app.plugin.js",
|
|
22
14
|
"./package.json": "./package.json"
|
|
@@ -43,18 +35,18 @@
|
|
|
43
35
|
"!**/.*"
|
|
44
36
|
],
|
|
45
37
|
"scripts": {
|
|
46
|
-
"user-workspace": "yarn workspace @reclaimprotocol/inapp-rn-sdk-
|
|
47
|
-
"test": "jest",
|
|
48
|
-
"typecheck": "tsc",
|
|
49
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
50
|
-
"android:gen:specs": "cd user-workspace/android && ./gradlew :app:invokeLibraryCodegen",
|
|
51
|
-
"ios:gen:specs": "cd user-workspace/ios && bundle install && bundle exec pod install",
|
|
52
|
-
"gen:specs": "npx react-native codegen",
|
|
38
|
+
"user-workspace": "yarn workspace @reclaimprotocol/inapp-rn-sdk-example",
|
|
53
39
|
"clean": "del-cli android/build user-workspace/android/build user-workspace/android/app/build user-workspace/ios/build lib",
|
|
54
40
|
"prepare": "bob build && npm run build:expo:plugin",
|
|
55
|
-
"
|
|
41
|
+
"typecheck": "tsc",
|
|
42
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
43
|
+
"release": "release-it --only-version",
|
|
56
44
|
"build:expo:plugin": "tsc -p ./expo-plugin/tsconfig.json",
|
|
57
|
-
"
|
|
45
|
+
"gen:ios": "(cd user-workspace/ios; bundle install; bundle exec pod install;)",
|
|
46
|
+
"gen:android": "(cd user-workspace/android; ./gradlew generateCodegenArtifactsFromSchema;)",
|
|
47
|
+
"publish:prepare": "npm version prerelease --preid alpha",
|
|
48
|
+
"publish:pre": "npm run prepare; npm publish --tag alpha",
|
|
49
|
+
"test": "jest"
|
|
58
50
|
},
|
|
59
51
|
"keywords": [
|
|
60
52
|
"react-native",
|
|
@@ -63,42 +55,40 @@
|
|
|
63
55
|
],
|
|
64
56
|
"repository": {
|
|
65
57
|
"type": "git",
|
|
66
|
-
"url": "git+https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git
|
|
58
|
+
"url": "git+https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git"
|
|
67
59
|
},
|
|
68
60
|
"author": "Reclaim Protocol (https://reclaimprotocol.org)",
|
|
69
61
|
"license": "MIT",
|
|
70
62
|
"bugs": {
|
|
71
|
-
"url": "https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk
|
|
63
|
+
"url": "https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk/issues"
|
|
72
64
|
},
|
|
73
|
-
"homepage": "https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk
|
|
65
|
+
"homepage": "https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk#readme",
|
|
74
66
|
"publishConfig": {
|
|
75
67
|
"registry": "https://registry.npmjs.org/"
|
|
76
68
|
},
|
|
77
69
|
"devDependencies": {
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
82
|
-
"@react-native/
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"eslint
|
|
90
|
-
"eslint-
|
|
70
|
+
"@eslint/compat": "^1.3.2",
|
|
71
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
72
|
+
"@eslint/js": "^9.35.0",
|
|
73
|
+
"@expo/config-plugins": "^54.0.2",
|
|
74
|
+
"@react-native-community/cli": "20.0.1",
|
|
75
|
+
"@react-native/babel-preset": "0.81.1",
|
|
76
|
+
"@react-native/eslint-config": "^0.81.1",
|
|
77
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
78
|
+
"@types/jest": "^29.5.14",
|
|
79
|
+
"@types/react": "^19.1.0",
|
|
80
|
+
"del-cli": "^6.0.0",
|
|
81
|
+
"eslint": "^9.35.0",
|
|
82
|
+
"eslint-config-prettier": "^10.1.8",
|
|
83
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
91
84
|
"jest": "^29.7.0",
|
|
92
|
-
"prettier": "^
|
|
93
|
-
"react": "
|
|
94
|
-
"react-native": "0.
|
|
95
|
-
"react-native-builder-bob": "^0.
|
|
96
|
-
"release-it": "^
|
|
97
|
-
"turbo": "^
|
|
98
|
-
"typescript": "^5.
|
|
99
|
-
},
|
|
100
|
-
"resolutions": {
|
|
101
|
-
"@types/react": "^18.2.44"
|
|
85
|
+
"prettier": "^2.8.8",
|
|
86
|
+
"react": "19.1.0",
|
|
87
|
+
"react-native": "0.81.1",
|
|
88
|
+
"react-native-builder-bob": "^0.40.15",
|
|
89
|
+
"release-it": "^19.0.4",
|
|
90
|
+
"turbo": "^2.5.6",
|
|
91
|
+
"typescript": "^5.9.2"
|
|
102
92
|
},
|
|
103
93
|
"peerDependencies": {
|
|
104
94
|
"react": "*",
|
|
@@ -107,77 +97,11 @@
|
|
|
107
97
|
"workspaces": [
|
|
108
98
|
"user-workspace"
|
|
109
99
|
],
|
|
110
|
-
"packageManager": "yarn@
|
|
111
|
-
"jest": {
|
|
112
|
-
"preset": "react-native",
|
|
113
|
-
"modulePathIgnorePatterns": [
|
|
114
|
-
"<rootDir>/user-workspace/node_modules",
|
|
115
|
-
"<rootDir>/samples/",
|
|
116
|
-
"<rootDir>/lib/"
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
"commitlint": {
|
|
120
|
-
"extends": [
|
|
121
|
-
"@commitlint/config-conventional"
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
"release-it": {
|
|
125
|
-
"git": {
|
|
126
|
-
"commitMessage": "chore: release ${version}",
|
|
127
|
-
"tagName": "v${version}"
|
|
128
|
-
},
|
|
129
|
-
"npm": {
|
|
130
|
-
"publish": true
|
|
131
|
-
},
|
|
132
|
-
"github": {
|
|
133
|
-
"release": true
|
|
134
|
-
},
|
|
135
|
-
"plugins": {
|
|
136
|
-
"@release-it/conventional-changelog": {}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"eslintConfig": {
|
|
140
|
-
"root": true,
|
|
141
|
-
"extends": [
|
|
142
|
-
"@react-native",
|
|
143
|
-
"prettier"
|
|
144
|
-
],
|
|
145
|
-
"rules": {
|
|
146
|
-
"react/react-in-jsx-scope": "off",
|
|
147
|
-
"prettier/prettier": [
|
|
148
|
-
"error",
|
|
149
|
-
{
|
|
150
|
-
"quoteProps": "consistent",
|
|
151
|
-
"singleQuote": true,
|
|
152
|
-
"tabWidth": 2,
|
|
153
|
-
"trailingComma": "es5",
|
|
154
|
-
"useTabs": false
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
"eslintIgnore": [
|
|
160
|
-
"node_modules/",
|
|
161
|
-
"lib/"
|
|
162
|
-
],
|
|
163
|
-
"prettier": {
|
|
164
|
-
"quoteProps": "consistent",
|
|
165
|
-
"singleQuote": true,
|
|
166
|
-
"tabWidth": 2,
|
|
167
|
-
"trailingComma": "es5",
|
|
168
|
-
"useTabs": false
|
|
169
|
-
},
|
|
100
|
+
"packageManager": "yarn@4.11.0",
|
|
170
101
|
"react-native-builder-bob": {
|
|
171
102
|
"source": "src",
|
|
172
103
|
"output": "lib",
|
|
173
104
|
"targets": [
|
|
174
|
-
"codegen",
|
|
175
|
-
[
|
|
176
|
-
"commonjs",
|
|
177
|
-
{
|
|
178
|
-
"esm": true
|
|
179
|
-
}
|
|
180
|
-
],
|
|
181
105
|
[
|
|
182
106
|
"module",
|
|
183
107
|
{
|
|
@@ -187,28 +111,60 @@
|
|
|
187
111
|
[
|
|
188
112
|
"typescript",
|
|
189
113
|
{
|
|
190
|
-
"project": "tsconfig.build.json"
|
|
191
|
-
"esm": true
|
|
114
|
+
"project": "tsconfig.build.json"
|
|
192
115
|
}
|
|
193
116
|
]
|
|
194
117
|
]
|
|
195
118
|
},
|
|
196
119
|
"codegenConfig": {
|
|
197
|
-
"name": "
|
|
120
|
+
"name": "InappRnSdkSpec",
|
|
198
121
|
"type": "modules",
|
|
199
|
-
"jsSrcsDir": "src
|
|
200
|
-
"outputDir": {
|
|
201
|
-
"ios": "ios/generated",
|
|
202
|
-
"android": "android/generated"
|
|
203
|
-
},
|
|
122
|
+
"jsSrcsDir": "src",
|
|
204
123
|
"android": {
|
|
205
|
-
"javaPackageName": "com.reclaimprotocol.
|
|
124
|
+
"javaPackageName": "com.reclaimprotocol.inapprnsdk"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"prettier": {
|
|
128
|
+
"quoteProps": "consistent",
|
|
129
|
+
"singleQuote": true,
|
|
130
|
+
"tabWidth": 2,
|
|
131
|
+
"trailingComma": "es5",
|
|
132
|
+
"useTabs": false
|
|
133
|
+
},
|
|
134
|
+
"release-it": {
|
|
135
|
+
"git": {
|
|
136
|
+
"commitMessage": "chore: release ${version}",
|
|
137
|
+
"tagName": "v${version}"
|
|
206
138
|
},
|
|
207
|
-
"
|
|
139
|
+
"npm": {
|
|
140
|
+
"publish": true
|
|
141
|
+
},
|
|
142
|
+
"github": {
|
|
143
|
+
"release": true
|
|
144
|
+
},
|
|
145
|
+
"plugins": {
|
|
146
|
+
"@release-it/conventional-changelog": {
|
|
147
|
+
"preset": {
|
|
148
|
+
"name": "angular"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"jest": {
|
|
154
|
+
"preset": "react-native",
|
|
155
|
+
"modulePathIgnorePatterns": [
|
|
156
|
+
"<rootDir>/user-workspace/node_modules",
|
|
157
|
+
"<rootDir>/lib/"
|
|
158
|
+
]
|
|
208
159
|
},
|
|
209
160
|
"create-react-native-library": {
|
|
210
|
-
"type": "turbo-module",
|
|
211
161
|
"languages": "kotlin-objc",
|
|
212
|
-
"
|
|
162
|
+
"type": "turbo-module",
|
|
163
|
+
"tools": [
|
|
164
|
+
"eslint",
|
|
165
|
+
"release-it",
|
|
166
|
+
"jest"
|
|
167
|
+
],
|
|
168
|
+
"version": "0.55.0"
|
|
213
169
|
}
|
|
214
170
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
1
|
+
import type { TurboModule, CodegenTypes } from 'react-native';
|
|
2
2
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
-
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
3
|
|
|
5
4
|
export interface SessionInformation {
|
|
6
5
|
/**
|
|
@@ -307,6 +306,10 @@ export interface SessionUpdateRequestEvent {
|
|
|
307
306
|
* The status type of this session event
|
|
308
307
|
*/
|
|
309
308
|
status: string;
|
|
309
|
+
/**
|
|
310
|
+
* session update metadata as JSON string
|
|
311
|
+
*/
|
|
312
|
+
metadata: string;
|
|
310
313
|
/**
|
|
311
314
|
* internal
|
|
312
315
|
*/
|
|
@@ -359,6 +362,10 @@ export interface VerificationOptionsOptional {
|
|
|
359
362
|
options?: VerificationOptions | null;
|
|
360
363
|
}
|
|
361
364
|
|
|
365
|
+
export interface SetConsoleLoggingOptions {
|
|
366
|
+
enabled: boolean
|
|
367
|
+
}
|
|
368
|
+
|
|
362
369
|
export interface ReclaimAttestorAuthRequest {
|
|
363
370
|
reclaimHttpProviderJsonString: string;
|
|
364
371
|
/**
|
|
@@ -374,18 +381,21 @@ export interface Spec extends TurboModule {
|
|
|
374
381
|
setOverrides(overrides: Overrides): Promise<void>;
|
|
375
382
|
clearAllOverrides(): Promise<void>;
|
|
376
383
|
setVerificationOptions(args: VerificationOptionsOptional): Promise<void>;
|
|
384
|
+
setConsoleLogging(args: SetConsoleLoggingOptions): Promise<void>;
|
|
377
385
|
reply(replyId: string, reply: boolean): void;
|
|
378
386
|
replyWithString(replyId: string, value: string): void;
|
|
387
|
+
startEventSubscription(event: string): void;
|
|
388
|
+
removeEventSubscription(event: string): void;
|
|
379
389
|
ping(): Promise<boolean>;
|
|
380
390
|
|
|
381
|
-
readonly onLogs: EventEmitter<string>
|
|
382
|
-
readonly onSessionLogs: EventEmitter<SessionLogEvent>
|
|
383
|
-
readonly onSessionCreateRequest: EventEmitter<SessionCreateRequestEvent>
|
|
384
|
-
readonly onSessionUpdateRequest: EventEmitter<SessionUpdateRequestEvent>
|
|
385
|
-
readonly onProviderInformationRequest: EventEmitter<ProviderInformationRequest>
|
|
386
|
-
readonly onReclaimAttestorAuthRequest: EventEmitter<ReclaimAttestorAuthRequest>
|
|
391
|
+
readonly onLogs: CodegenTypes.EventEmitter<string>
|
|
392
|
+
readonly onSessionLogs: CodegenTypes.EventEmitter<SessionLogEvent>
|
|
393
|
+
readonly onSessionCreateRequest: CodegenTypes.EventEmitter<SessionCreateRequestEvent>
|
|
394
|
+
readonly onSessionUpdateRequest: CodegenTypes.EventEmitter<SessionUpdateRequestEvent>
|
|
395
|
+
readonly onProviderInformationRequest: CodegenTypes.EventEmitter<ProviderInformationRequest>
|
|
396
|
+
readonly onReclaimAttestorAuthRequest: CodegenTypes.EventEmitter<ReclaimAttestorAuthRequest>
|
|
387
397
|
// unimplemented
|
|
388
|
-
readonly onSessionIdentityUpdate: EventEmitter<ReclaimSessionIdentityUpdate>
|
|
398
|
+
readonly onSessionIdentityUpdate: CodegenTypes.EventEmitter<ReclaimSessionIdentityUpdate>
|
|
389
399
|
}
|
|
390
400
|
|
|
391
401
|
export default TurboModuleRegistry.getEnforcing<Spec>('InappRnSdk');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EventSubscription } from 'react-native';
|
|
2
|
-
import NativeReclaimInappModule, * as NativeReclaimInappModuleTypes from './
|
|
2
|
+
import NativeReclaimInappModule, * as NativeReclaimInappModuleTypes from './NativeInappRnSdk';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* [ReclaimVerification] is the main class for interacting with the Reclaim verification system.
|
|
5
6
|
* It provides methods to start verification processes, manage platform configurations,
|
|
@@ -59,6 +60,18 @@ export class ReclaimVerification {
|
|
|
59
60
|
) {
|
|
60
61
|
return this.platform.setVerificationOptions(options);
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
public setConsoleLogging(
|
|
65
|
+
enabled: boolean
|
|
66
|
+
) {
|
|
67
|
+
return this.platform.setConsoleLogging({
|
|
68
|
+
enabled: enabled == true,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public addEventListener<T extends keyof ReclaimVerification.EventListener.EventMap>(type: T, listener: ReclaimVerification.EventListener.EventListener<T>): ReclaimVerification.EventListener.CancelEventSubscription {
|
|
73
|
+
return this.platform.addEventListener(type, listener);
|
|
74
|
+
}
|
|
62
75
|
}
|
|
63
76
|
|
|
64
77
|
/**
|
|
@@ -167,6 +180,9 @@ export namespace ReclaimVerification {
|
|
|
167
180
|
isCloseButtonVisible?: boolean; // Optional
|
|
168
181
|
}
|
|
169
182
|
|
|
183
|
+
export type SetConsoleLoggingOptions =
|
|
184
|
+
NativeReclaimInappModuleTypes.SetConsoleLoggingOptions;
|
|
185
|
+
|
|
170
186
|
export namespace Overrides {
|
|
171
187
|
export interface ProviderInformation {
|
|
172
188
|
url?: string;
|
|
@@ -217,6 +233,15 @@ export namespace ReclaimVerification {
|
|
|
217
233
|
export type ReclaimAppInfo = NativeReclaimInappModuleTypes.ReclaimAppInfo;
|
|
218
234
|
}
|
|
219
235
|
|
|
236
|
+
export namespace EventListener {
|
|
237
|
+
export type SessionIdentityUpdate = NativeReclaimInappModuleTypes.ReclaimSessionIdentityUpdate;
|
|
238
|
+
export interface EventMap {
|
|
239
|
+
"sessionIdentityUpdate": SessionIdentityUpdate,
|
|
240
|
+
};
|
|
241
|
+
export type EventListener<T extends keyof EventMap> = (event: EventMap[T]) => void | Promise<void>;
|
|
242
|
+
export type CancelEventSubscription = () => void;
|
|
243
|
+
}
|
|
244
|
+
|
|
220
245
|
export type OverrideConfig = {
|
|
221
246
|
provider?: Overrides.ProviderInformation;
|
|
222
247
|
featureOptions?: Overrides.FeatureOptions;
|
|
@@ -365,6 +390,12 @@ export namespace ReclaimVerification {
|
|
|
365
390
|
abstract setVerificationOptions(
|
|
366
391
|
options?: ReclaimVerification.VerificationOptions | null
|
|
367
392
|
): Promise<void>;
|
|
393
|
+
|
|
394
|
+
abstract setConsoleLogging(
|
|
395
|
+
options?: ReclaimVerification.SetConsoleLoggingOptions | null
|
|
396
|
+
): Promise<void>;
|
|
397
|
+
|
|
398
|
+
abstract addEventListener<T extends keyof ReclaimVerification.EventListener.EventMap>(type: T, listener: ReclaimVerification.EventListener.EventListener<T>): ReclaimVerification.EventListener.CancelEventSubscription;
|
|
368
399
|
}
|
|
369
400
|
}
|
|
370
401
|
|
|
@@ -645,4 +676,57 @@ export class PlatformImpl extends ReclaimVerification.Platform {
|
|
|
645
676
|
);
|
|
646
677
|
}
|
|
647
678
|
}
|
|
679
|
+
|
|
680
|
+
override async setConsoleLogging(
|
|
681
|
+
options?: ReclaimVerification.SetConsoleLoggingOptions | null
|
|
682
|
+
): Promise<void> {
|
|
683
|
+
try {
|
|
684
|
+
return await NativeReclaimInappModule.setConsoleLogging({
|
|
685
|
+
enabled: options?.enabled == true,
|
|
686
|
+
});
|
|
687
|
+
} catch (error) {
|
|
688
|
+
throw new ReclaimVerification.ReclaimPlatformException(
|
|
689
|
+
'Failed to set console logging',
|
|
690
|
+
error as Error
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
static listenersCount: Record<keyof ReclaimVerification.EventListener.EventMap, number> = {
|
|
696
|
+
'sessionIdentityUpdate': 0,
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
override addEventListener<T extends keyof ReclaimVerification.EventListener.EventMap>(type: T, listener: ReclaimVerification.EventListener.EventListener<T>): ReclaimVerification.EventListener.CancelEventSubscription {
|
|
700
|
+
let subscription: EventSubscription;
|
|
701
|
+
switch (type) {
|
|
702
|
+
case 'sessionIdentityUpdate':
|
|
703
|
+
subscription = NativeReclaimInappModule.onSessionIdentityUpdate((param) => {
|
|
704
|
+
try {
|
|
705
|
+
listener(param);
|
|
706
|
+
} catch (_) {
|
|
707
|
+
// ignore listener errors
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
NativeReclaimInappModule.startEventSubscription(type);
|
|
711
|
+
PlatformImpl.listenersCount[type] = PlatformImpl.listenersCount[type] + 1;
|
|
712
|
+
break;
|
|
713
|
+
default:
|
|
714
|
+
throw new Error('Tried to subscribe to an unknown event');
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
const cancelSubscription = () => {
|
|
718
|
+
PlatformImpl.listenersCount[type] = PlatformImpl.listenersCount[type] - 1;
|
|
719
|
+
subscription.remove();
|
|
720
|
+
if (PlatformImpl.listenersCount[type] <= 0) {
|
|
721
|
+
PlatformImpl.listenersCount[type] = 0;
|
|
722
|
+
try {
|
|
723
|
+
NativeReclaimInappModule.removeEventSubscription(type);
|
|
724
|
+
} catch (error) {
|
|
725
|
+
// ignore subscription removal errors
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
return cancelSubscription;
|
|
731
|
+
}
|
|
648
732
|
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.reclaimprotocol.inapp_rn_sdk;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.Promise;
|
|
17
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
21
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
22
|
-
import javax.annotation.Nonnull;
|
|
23
|
-
|
|
24
|
-
public abstract class NativeInappRnSdkSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
25
|
-
public static final String NAME = "InappRnSdk";
|
|
26
|
-
|
|
27
|
-
public NativeInappRnSdkSpec(ReactApplicationContext reactContext) {
|
|
28
|
-
super(reactContext);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@Override
|
|
32
|
-
public @Nonnull String getName() {
|
|
33
|
-
return NAME;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
protected final void emitOnLogs(String value) {
|
|
37
|
-
mEventEmitterCallback.invoke("onLogs", value);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
protected final void emitOnSessionLogs(ReadableMap value) {
|
|
41
|
-
mEventEmitterCallback.invoke("onSessionLogs", value);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
protected final void emitOnSessionCreateRequest(ReadableMap value) {
|
|
45
|
-
mEventEmitterCallback.invoke("onSessionCreateRequest", value);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
protected final void emitOnSessionUpdateRequest(ReadableMap value) {
|
|
49
|
-
mEventEmitterCallback.invoke("onSessionUpdateRequest", value);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
protected final void emitOnProviderInformationRequest(ReadableMap value) {
|
|
53
|
-
mEventEmitterCallback.invoke("onProviderInformationRequest", value);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
protected final void emitOnReclaimAttestorAuthRequest(ReadableMap value) {
|
|
57
|
-
mEventEmitterCallback.invoke("onReclaimAttestorAuthRequest", value);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
protected final void emitOnSessionIdentityUpdate(ReadableMap value) {
|
|
61
|
-
mEventEmitterCallback.invoke("onSessionIdentityUpdate", value);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@ReactMethod
|
|
65
|
-
@DoNotStrip
|
|
66
|
-
public abstract void startVerification(ReadableMap request, Promise promise);
|
|
67
|
-
|
|
68
|
-
@ReactMethod
|
|
69
|
-
@DoNotStrip
|
|
70
|
-
public abstract void startVerificationFromUrl(String requestUrl, Promise promise);
|
|
71
|
-
|
|
72
|
-
@ReactMethod
|
|
73
|
-
@DoNotStrip
|
|
74
|
-
public abstract void startVerificationFromJson(String templateJsonString, Promise promise);
|
|
75
|
-
|
|
76
|
-
@ReactMethod
|
|
77
|
-
@DoNotStrip
|
|
78
|
-
public abstract void setOverrides(ReadableMap overrides, Promise promise);
|
|
79
|
-
|
|
80
|
-
@ReactMethod
|
|
81
|
-
@DoNotStrip
|
|
82
|
-
public abstract void clearAllOverrides(Promise promise);
|
|
83
|
-
|
|
84
|
-
@ReactMethod
|
|
85
|
-
@DoNotStrip
|
|
86
|
-
public abstract void setVerificationOptions(ReadableMap args, Promise promise);
|
|
87
|
-
|
|
88
|
-
@ReactMethod
|
|
89
|
-
@DoNotStrip
|
|
90
|
-
public abstract void reply(String replyId, boolean reply);
|
|
91
|
-
|
|
92
|
-
@ReactMethod
|
|
93
|
-
@DoNotStrip
|
|
94
|
-
public abstract void replyWithString(String replyId, String value);
|
|
95
|
-
|
|
96
|
-
@ReactMethod
|
|
97
|
-
@DoNotStrip
|
|
98
|
-
public abstract void ping(Promise promise);
|
|
99
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNInappRnSdkSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNInappRnSdkSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNInappRnSdkSpec PUBLIC . react/renderer/components/RNInappRnSdkSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNInappRnSdkSpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_RNInappRnSdkSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|