@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,80 @@
|
|
|
1
|
+
import * as NativeReclaimInappModuleTypes from "./specs/NativeInappRnSdk";
|
|
2
|
+
/**
|
|
3
|
+
* This namespace provides types involved in initiating and managing the verification process
|
|
4
|
+
* for proving claims about user data through various providers.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace ReclaimVerificationApi {
|
|
7
|
+
/**
|
|
8
|
+
* Represents user's session information for a verification attempt.
|
|
9
|
+
* This data class contains the necessary data to identify and validate a verification session.
|
|
10
|
+
*/
|
|
11
|
+
type SessionInformation = NativeReclaimInappModuleTypes.SessionInformation;
|
|
12
|
+
/**
|
|
13
|
+
* Represents a request for a verification attempt.
|
|
14
|
+
*
|
|
15
|
+
* You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method.
|
|
16
|
+
*/
|
|
17
|
+
type Request = NativeReclaimInappModuleTypes.Request;
|
|
18
|
+
/**
|
|
19
|
+
* Contains the proof and response data after verification
|
|
20
|
+
*/
|
|
21
|
+
type Response = NativeReclaimInappModuleTypes.Response;
|
|
22
|
+
namespace Overrides {
|
|
23
|
+
type ProviderInformation = NativeReclaimInappModuleTypes.ProviderInformation;
|
|
24
|
+
type FeatureOptions = NativeReclaimInappModuleTypes.FeatureOptions;
|
|
25
|
+
interface LogConsumer {
|
|
26
|
+
/**
|
|
27
|
+
* Handler for consuming logs exported from the SDK.
|
|
28
|
+
* Defaults to false.
|
|
29
|
+
*/
|
|
30
|
+
onLogs?: (logJsonString: String, cancel: () => void) => void;
|
|
31
|
+
/**
|
|
32
|
+
* When enabled, logs are sent to reclaim that can be used to help you.
|
|
33
|
+
* Defaults to true.
|
|
34
|
+
*/
|
|
35
|
+
canSdkCollectTelemetry?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Defaults to enabled when not in release mode.
|
|
38
|
+
*/
|
|
39
|
+
canSdkPrintLogs?: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface SessionManagement {
|
|
42
|
+
onLog: (event: NativeReclaimInappModuleTypes.SessionLogEvent) => void;
|
|
43
|
+
onSessionCreateRequest: (event: NativeReclaimInappModuleTypes.SessionCreateRequestEvent) => Promise<boolean>;
|
|
44
|
+
onSessionUpdateRequest: (event: NativeReclaimInappModuleTypes.SessionUpdateRequestEvent) => Promise<boolean>;
|
|
45
|
+
}
|
|
46
|
+
type ReclaimAppInfo = NativeReclaimInappModuleTypes.ReclaimAppInfo;
|
|
47
|
+
}
|
|
48
|
+
type OverrideConfig = {
|
|
49
|
+
provider?: Overrides.ProviderInformation;
|
|
50
|
+
featureOptions?: Overrides.FeatureOptions;
|
|
51
|
+
logConsumer?: Overrides.LogConsumer;
|
|
52
|
+
sessionManagement?: Overrides.SessionManagement;
|
|
53
|
+
appInfo?: Overrides.ReclaimAppInfo;
|
|
54
|
+
};
|
|
55
|
+
enum ExceptionType {
|
|
56
|
+
Cancelled = "Cancelled",
|
|
57
|
+
Dismissed = "Dismissed",
|
|
58
|
+
SessionExpired = "SessionExpired",
|
|
59
|
+
Failed = "Failed"
|
|
60
|
+
}
|
|
61
|
+
class ReclaimVerificationException extends Error {
|
|
62
|
+
readonly innerError: Error;
|
|
63
|
+
readonly type: ExceptionType;
|
|
64
|
+
readonly sessionId: string;
|
|
65
|
+
readonly "didSubmitManualVerification": boolean;
|
|
66
|
+
readonly "reason": string;
|
|
67
|
+
constructor(message: string, innerError: Error, type: ExceptionType, sessionId: string, didSubmitManualVerification: boolean, reason: string);
|
|
68
|
+
private static fromTypeName;
|
|
69
|
+
static fromError(error: Error, sessionIdHint: string): ReclaimVerificationException;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export declare class ReclaimVerificationPlatformChannel {
|
|
73
|
+
startVerification(request: ReclaimVerificationApi.Request): Promise<ReclaimVerificationApi.Response>;
|
|
74
|
+
startVerificationFromUrl(requestUrl: string): Promise<ReclaimVerificationApi.Response>;
|
|
75
|
+
ping(): Promise<boolean>;
|
|
76
|
+
private previousLogSubscription;
|
|
77
|
+
private previousSessionManagementCancelCallback;
|
|
78
|
+
setOverrides({ provider, featureOptions, logConsumer, sessionManagement, appInfo }: ReclaimVerificationApi.OverrideConfig): void;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=ReclaimVerificationPlatformChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReclaimVerificationPlatformChannel.d.ts","sourceRoot":"","sources":["../../../../src/ReclaimVerificationPlatformChannel.ts"],"names":[],"mappings":"AAE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ificationPlatformChannel';
|
|
2
|
+
export { ReclaimVerificationPlatformChannel, ReclaimVerificationApi } from './ReclaimVerificationPlatformChannel';
|
|
3
|
+
export type { ReclaimVerificationApi as ReclaimVerificationApiType } from './ReclaimVerificationPlatformChannel';
|
|
4
|
+
export declare class ReclaimVerification {
|
|
5
|
+
channel: ReclaimVerificationPlatformChannel;
|
|
6
|
+
private static defaultChannel;
|
|
7
|
+
constructor(channel?: ReclaimVerificationPlatformChannel);
|
|
8
|
+
startVerification(request: ReclaimVerificationApi.Request): Promise<ReclaimVerificationApi.Response>;
|
|
9
|
+
ping(): Promise<boolean>;
|
|
10
|
+
setOverrides(overrides: ReclaimVerificationApi.OverrideConfig): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACvH,OAAO,EAAE,kCAAkC,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAClH,YAAY,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAEjH,qBAAa,mBAAmB;IACvB,OAAO,EAAE,kCAAkC,CAAC;IAEnD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAmD;gBAE7D,OAAO,CAAC,EAAE,kCAAkC;IAWlD,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,CAAC,OAAO,GAAG,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAIpG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,YAAY,CAAC,SAAS,EAAE,sBAAsB,CAAC,cAAc;CAGrE"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface SessionInformation {
|
|
4
|
+
/**
|
|
5
|
+
* The timestamp of the session creation.
|
|
6
|
+
*
|
|
7
|
+
* Represented as a string from number of milliseconds since
|
|
8
|
+
* the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
|
|
9
|
+
*
|
|
10
|
+
* This value is independent of the time zone.
|
|
11
|
+
*
|
|
12
|
+
* This value is at most 8,640,000,000,000,000ms (100,000,000 days) from the Unix epoch.
|
|
13
|
+
*/
|
|
14
|
+
timestamp: string;
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier for the verification session
|
|
17
|
+
*/
|
|
18
|
+
sessionId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Cryptographic signature to validate the session
|
|
21
|
+
*/
|
|
22
|
+
signature: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents a request for a verification attempt.
|
|
26
|
+
*
|
|
27
|
+
* You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method.
|
|
28
|
+
*/
|
|
29
|
+
export interface Request {
|
|
30
|
+
/**
|
|
31
|
+
* The Reclaim application ID for the verification process.
|
|
32
|
+
* If not provided, the appId will be fetched from:
|
|
33
|
+
* - the `AndroidManifest.xml` metadata along with secret on android:
|
|
34
|
+
*
|
|
35
|
+
* ```xml
|
|
36
|
+
* <meta-data android:name="org.reclaimprotocol.inapp_sdk.APP_ID"
|
|
37
|
+
* android:value="YOUR_RECLAIM_APP_ID" />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* - the `ReclaimInAppSDKParam.ReclaimAppId` in Info.plist along with secret on iOS:
|
|
41
|
+
*
|
|
42
|
+
* ```xml
|
|
43
|
+
* <key>ReclaimInAppSDKParam</key>
|
|
44
|
+
* <dict>
|
|
45
|
+
* <key>ReclaimAppId</key>
|
|
46
|
+
* <string>YOUR_RECLAIM_APP_ID</string>
|
|
47
|
+
* <key>ReclaimAppSecret</key>
|
|
48
|
+
* <string>YOUR_RECLAIM_APP_SECRET</string>
|
|
49
|
+
* </dict>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
appId: string;
|
|
53
|
+
/**
|
|
54
|
+
* The Reclaim application secret for the verification process.
|
|
55
|
+
* If not provided, the secret will be fetched from:
|
|
56
|
+
* - the `AndroidManifest.xml` metadata along with appId on android:
|
|
57
|
+
*
|
|
58
|
+
* ```xml
|
|
59
|
+
* <meta-data android:name="org.reclaimprotocol.inapp_sdk.APP_SECRET"
|
|
60
|
+
* android:value="YOUR_RECLAIM_APP_SECRET" />
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* - the `ReclaimInAppSDKParam.ReclaimAppSecret` in Info.plist along with appId on iOS:
|
|
64
|
+
*
|
|
65
|
+
* ```xml
|
|
66
|
+
* <key>ReclaimInAppSDKParam</key>
|
|
67
|
+
* <dict>
|
|
68
|
+
* <key>ReclaimAppId</key>
|
|
69
|
+
* <string>YOUR_RECLAIM_APP_ID</string>
|
|
70
|
+
* <key>ReclaimAppSecret</key>
|
|
71
|
+
* <string>YOUR_RECLAIM_APP_SECRET</string>
|
|
72
|
+
* </dict>
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
secret: string;
|
|
76
|
+
/**
|
|
77
|
+
* The identifier for the Reclaim data provider to use in verification
|
|
78
|
+
*/
|
|
79
|
+
providerId: string;
|
|
80
|
+
/**
|
|
81
|
+
* Optional session information. If nil, SDK generates new session details.
|
|
82
|
+
*/
|
|
83
|
+
session?: SessionInformation | null;
|
|
84
|
+
/**
|
|
85
|
+
* Additional data to associate with the verification attempt
|
|
86
|
+
*/
|
|
87
|
+
contextString?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Key-value pairs for prefilling claim creation variables
|
|
90
|
+
*/
|
|
91
|
+
parameters?: {
|
|
92
|
+
[key: string]: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Whether to hide the landing page of the verification process. When false, shows an introductory page with claims to be proven.
|
|
96
|
+
*/
|
|
97
|
+
hideLanding?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Whether to automatically submit the proof after generation.
|
|
100
|
+
*/
|
|
101
|
+
autoSubmit?: boolean;
|
|
102
|
+
acceptAiProviders?: boolean;
|
|
103
|
+
webhookUrl?: string | null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Contains the proof and response data after verification
|
|
107
|
+
*/
|
|
108
|
+
export interface Response {
|
|
109
|
+
/**
|
|
110
|
+
* The session ID for the verification attempt
|
|
111
|
+
*/
|
|
112
|
+
sessionId: string;
|
|
113
|
+
/**
|
|
114
|
+
* Whether the proof was submitted manually
|
|
115
|
+
*/
|
|
116
|
+
didSubmitManualVerification: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* The list of proofs generated during the verification attempt
|
|
119
|
+
*/
|
|
120
|
+
proofs: {
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
}[];
|
|
123
|
+
}
|
|
124
|
+
export interface ProviderInformation {
|
|
125
|
+
url?: string;
|
|
126
|
+
jsonString?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Interface representing Feature Options.
|
|
130
|
+
*/
|
|
131
|
+
export interface FeatureOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Whether to persist a cookie.
|
|
134
|
+
* Optional, defaults to null.
|
|
135
|
+
*/
|
|
136
|
+
cookiePersist?: boolean | null;
|
|
137
|
+
/**
|
|
138
|
+
* Whether to allow a single reclaim request.
|
|
139
|
+
* Optional, defaults to null.
|
|
140
|
+
*/
|
|
141
|
+
singleReclaimRequest?: boolean | null;
|
|
142
|
+
/**
|
|
143
|
+
* Idle time threshold (in milliseconds?) for triggering manual verification.
|
|
144
|
+
* Optional, defaults to null.
|
|
145
|
+
*/
|
|
146
|
+
idleTimeThresholdForManualVerificationTrigger?: number | null;
|
|
147
|
+
/**
|
|
148
|
+
* Session timeout (in milliseconds?) for triggering manual verification.
|
|
149
|
+
* Optional, defaults to null.
|
|
150
|
+
*/
|
|
151
|
+
sessionTimeoutForManualVerificationTrigger?: number | null;
|
|
152
|
+
/**
|
|
153
|
+
* URL for the Attestor Browser RPC.
|
|
154
|
+
* Optional, defaults to null.
|
|
155
|
+
*/
|
|
156
|
+
attestorBrowserRpcUrl?: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* Whether response redaction regex escaping is enabled.
|
|
159
|
+
* Optional, defaults to null.
|
|
160
|
+
*/
|
|
161
|
+
isResponseRedactionRegexEscapingEnabled?: boolean | null;
|
|
162
|
+
/**
|
|
163
|
+
* Whether AI flow is enabled.
|
|
164
|
+
* Optional, defaults to null.
|
|
165
|
+
*/
|
|
166
|
+
isAIFlowEnabled?: boolean | null;
|
|
167
|
+
}
|
|
168
|
+
export interface LogConsumer {
|
|
169
|
+
/**
|
|
170
|
+
* Handler for consuming logs exported from the SDK.
|
|
171
|
+
* Defaults to false.
|
|
172
|
+
*/
|
|
173
|
+
enableLogHandler: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* When enabled, logs are sent to reclaim that can be used to help you.
|
|
176
|
+
* Defaults to true.
|
|
177
|
+
*/
|
|
178
|
+
canSdkCollectTelemetry?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Defaults to enabled when not in release mode.
|
|
181
|
+
*/
|
|
182
|
+
canSdkPrintLogs?: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Interface representing Reclaim App Information.
|
|
186
|
+
*/
|
|
187
|
+
export interface ReclaimAppInfo {
|
|
188
|
+
/**
|
|
189
|
+
* The name of the application.
|
|
190
|
+
*/
|
|
191
|
+
appName: string;
|
|
192
|
+
/**
|
|
193
|
+
* The URL of the application's image.
|
|
194
|
+
*/
|
|
195
|
+
appImageUrl: string;
|
|
196
|
+
/**
|
|
197
|
+
* Whether the reclaim is recurring.
|
|
198
|
+
* Optional, defaults to false.
|
|
199
|
+
*/
|
|
200
|
+
isRecurring?: boolean;
|
|
201
|
+
}
|
|
202
|
+
export interface SessionManagement {
|
|
203
|
+
/**
|
|
204
|
+
* Whether to enable SDK session management.
|
|
205
|
+
* Optional, defaults to true.
|
|
206
|
+
*
|
|
207
|
+
* When false, a handler must be provided. We'll not let SDK manage sessions in this case.
|
|
208
|
+
*/
|
|
209
|
+
enableSdkSessionManagement?: boolean;
|
|
210
|
+
}
|
|
211
|
+
export interface SessionLogEvent {
|
|
212
|
+
/**
|
|
213
|
+
* The app ID for the verification attempt
|
|
214
|
+
*/
|
|
215
|
+
appId: string;
|
|
216
|
+
/**
|
|
217
|
+
* The provider ID for the verification attempt
|
|
218
|
+
*/
|
|
219
|
+
providerId: string;
|
|
220
|
+
/**
|
|
221
|
+
* The session ID for the verification attempt
|
|
222
|
+
*/
|
|
223
|
+
sessionId: string;
|
|
224
|
+
/**
|
|
225
|
+
* The type of log event
|
|
226
|
+
*/
|
|
227
|
+
logType: string;
|
|
228
|
+
}
|
|
229
|
+
export interface SessionCreateRequestEvent {
|
|
230
|
+
/**
|
|
231
|
+
* The app ID for the verification attempt
|
|
232
|
+
*/
|
|
233
|
+
appId: string;
|
|
234
|
+
/**
|
|
235
|
+
* The provider ID for the verification attempt
|
|
236
|
+
*/
|
|
237
|
+
providerId: string;
|
|
238
|
+
/**
|
|
239
|
+
* The session ID for the verification attempt
|
|
240
|
+
*/
|
|
241
|
+
sessionId: string;
|
|
242
|
+
/**
|
|
243
|
+
* internal
|
|
244
|
+
*/
|
|
245
|
+
readonly replyId: string;
|
|
246
|
+
}
|
|
247
|
+
export interface SessionUpdateRequestEvent {
|
|
248
|
+
/**
|
|
249
|
+
* The session ID for the verification attempt
|
|
250
|
+
*/
|
|
251
|
+
sessionId: string;
|
|
252
|
+
/**
|
|
253
|
+
* The status type of this session event
|
|
254
|
+
*/
|
|
255
|
+
status: string;
|
|
256
|
+
/**
|
|
257
|
+
* internal
|
|
258
|
+
*/
|
|
259
|
+
readonly replyId: string;
|
|
260
|
+
}
|
|
261
|
+
export interface Overrides {
|
|
262
|
+
provider?: ProviderInformation | null;
|
|
263
|
+
featureOptions?: FeatureOptions | null;
|
|
264
|
+
logConsumer?: LogConsumer | null;
|
|
265
|
+
sessionManagement?: SessionManagement | null;
|
|
266
|
+
appInfo?: ReclaimAppInfo | null;
|
|
267
|
+
}
|
|
268
|
+
export interface Spec extends TurboModule {
|
|
269
|
+
startVerification(request: Request): Promise<Response>;
|
|
270
|
+
startVerificationFromUrl(requestUrl: string): Promise<Response>;
|
|
271
|
+
setOverrides(overrides: Overrides): Promise<void>;
|
|
272
|
+
reply(replyId: string, reply: boolean): void;
|
|
273
|
+
ping(): Promise<boolean>;
|
|
274
|
+
readonly onLogs: EventEmitter<string>;
|
|
275
|
+
readonly onSessionLogs: EventEmitter<SessionLogEvent>;
|
|
276
|
+
readonly onSessionCreateRequest: EventEmitter<SessionCreateRequestEvent>;
|
|
277
|
+
readonly onSessionUpdateRequest: EventEmitter<SessionUpdateRequestEvent>;
|
|
278
|
+
}
|
|
279
|
+
declare const _default: Spec;
|
|
280
|
+
export default _default;
|
|
281
|
+
//# sourceMappingURL=NativeInappRnSdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeInappRnSdk.d.ts","sourceRoot":"","sources":["../../../../../src/specs/NativeInappRnSdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AACD;;;;KAIK;AACL,MAAM,WAAW,OAAO;IACtB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;;;;;;;;;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AC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvD,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChE,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IACrC,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACrD,QAAQ,CAAC,sBAAsB,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAA;IACxE,QAAQ,CAAC,sBAAsB,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAA;CACzE;;AAED,wBAAoE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reclaimprotocol/inapp-rn-sdk",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Reclaim Protocol's InApp React Native SDK for ZK proof generations for requests with an in-app experience of web verification",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"module": "./lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"lib",
|
|
23
|
+
"android",
|
|
24
|
+
"ios",
|
|
25
|
+
"cpp",
|
|
26
|
+
"*.podspec",
|
|
27
|
+
"react-native.config.js",
|
|
28
|
+
"!ios/build",
|
|
29
|
+
"!android/build",
|
|
30
|
+
"!android/gradle",
|
|
31
|
+
"!android/gradlew",
|
|
32
|
+
"!android/gradlew.bat",
|
|
33
|
+
"!android/local.properties",
|
|
34
|
+
"!**/__tests__",
|
|
35
|
+
"!**/__fixtures__",
|
|
36
|
+
"!**/__mocks__",
|
|
37
|
+
"!**/.*"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"example": "yarn workspace @reclaimprotocol/inapp-rn-sdk-example",
|
|
41
|
+
"test": "jest",
|
|
42
|
+
"typecheck": "tsc",
|
|
43
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
44
|
+
"android:gen:specs": "cd example/android && ./gradlew :app:invokeLibraryCodegen",
|
|
45
|
+
"ios:gen:specs": "cd example/ios && bundle install && bundle exec pod install",
|
|
46
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
47
|
+
"prepare": "bob build",
|
|
48
|
+
"release": "release-it"
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"react-native",
|
|
52
|
+
"ios",
|
|
53
|
+
"android"
|
|
54
|
+
],
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git.git"
|
|
58
|
+
},
|
|
59
|
+
"author": "Reclaim Protocol (https://reclaimprotocol.org)",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git/issues"
|
|
63
|
+
},
|
|
64
|
+
"homepage": "https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git#readme",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"registry": "https://registry.npmjs.org/",
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
71
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
72
|
+
"@react-native-community/cli": "15.0.1",
|
|
73
|
+
"@react-native/eslint-config": "^0.73.1",
|
|
74
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
75
|
+
"@types/jest": "^29.5.5",
|
|
76
|
+
"@types/react": "^18.2.44",
|
|
77
|
+
"commitlint": "^17.0.2",
|
|
78
|
+
"del-cli": "^5.1.0",
|
|
79
|
+
"eslint": "^8.51.0",
|
|
80
|
+
"eslint-config-prettier": "^9.0.0",
|
|
81
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
82
|
+
"jest": "^29.7.0",
|
|
83
|
+
"prettier": "^3.0.3",
|
|
84
|
+
"react": "18.3.1",
|
|
85
|
+
"react-native": "0.77.1",
|
|
86
|
+
"react-native-builder-bob": "^0.37.0",
|
|
87
|
+
"release-it": "^17.10.0",
|
|
88
|
+
"turbo": "^1.10.7",
|
|
89
|
+
"typescript": "^5.2.2"
|
|
90
|
+
},
|
|
91
|
+
"resolutions": {
|
|
92
|
+
"@types/react": "^18.2.44"
|
|
93
|
+
},
|
|
94
|
+
"peerDependencies": {
|
|
95
|
+
"react": "*",
|
|
96
|
+
"react-native": "*"
|
|
97
|
+
},
|
|
98
|
+
"workspaces": [
|
|
99
|
+
"example"
|
|
100
|
+
],
|
|
101
|
+
"packageManager": "yarn@3.6.1",
|
|
102
|
+
"jest": {
|
|
103
|
+
"preset": "react-native",
|
|
104
|
+
"modulePathIgnorePatterns": [
|
|
105
|
+
"<rootDir>/example/node_modules",
|
|
106
|
+
"<rootDir>/lib/"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"commitlint": {
|
|
110
|
+
"extends": [
|
|
111
|
+
"@commitlint/config-conventional"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"release-it": {
|
|
115
|
+
"git": {
|
|
116
|
+
"commitMessage": "chore: release ${version}",
|
|
117
|
+
"tagName": "v${version}"
|
|
118
|
+
},
|
|
119
|
+
"npm": {
|
|
120
|
+
"publish": true
|
|
121
|
+
},
|
|
122
|
+
"github": {
|
|
123
|
+
"release": true
|
|
124
|
+
},
|
|
125
|
+
"plugins": {
|
|
126
|
+
"@release-it/conventional-changelog": {}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"eslintConfig": {
|
|
130
|
+
"root": true,
|
|
131
|
+
"extends": [
|
|
132
|
+
"@react-native",
|
|
133
|
+
"prettier"
|
|
134
|
+
],
|
|
135
|
+
"rules": {
|
|
136
|
+
"react/react-in-jsx-scope": "off",
|
|
137
|
+
"prettier/prettier": [
|
|
138
|
+
"error",
|
|
139
|
+
{
|
|
140
|
+
"quoteProps": "consistent",
|
|
141
|
+
"singleQuote": true,
|
|
142
|
+
"tabWidth": 2,
|
|
143
|
+
"trailingComma": "es5",
|
|
144
|
+
"useTabs": false
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"eslintIgnore": [
|
|
150
|
+
"node_modules/",
|
|
151
|
+
"lib/"
|
|
152
|
+
],
|
|
153
|
+
"prettier": {
|
|
154
|
+
"quoteProps": "consistent",
|
|
155
|
+
"singleQuote": true,
|
|
156
|
+
"tabWidth": 2,
|
|
157
|
+
"trailingComma": "es5",
|
|
158
|
+
"useTabs": false
|
|
159
|
+
},
|
|
160
|
+
"react-native-builder-bob": {
|
|
161
|
+
"source": "src",
|
|
162
|
+
"output": "lib",
|
|
163
|
+
"targets": [
|
|
164
|
+
"codegen",
|
|
165
|
+
[
|
|
166
|
+
"commonjs",
|
|
167
|
+
{
|
|
168
|
+
"esm": true
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
[
|
|
172
|
+
"module",
|
|
173
|
+
{
|
|
174
|
+
"esm": true
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
"typescript",
|
|
179
|
+
{
|
|
180
|
+
"project": "tsconfig.build.json",
|
|
181
|
+
"esm": true
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
"codegenConfig": {
|
|
187
|
+
"name": "RNInappRnSdkSpec",
|
|
188
|
+
"type": "modules",
|
|
189
|
+
"jsSrcsDir": "src/specs",
|
|
190
|
+
"outputDir": {
|
|
191
|
+
"ios": "ios/generated",
|
|
192
|
+
"android": "android/generated"
|
|
193
|
+
},
|
|
194
|
+
"android": {
|
|
195
|
+
"javaPackageName": "com.reclaimprotocol.inapp_rn_sdk"
|
|
196
|
+
},
|
|
197
|
+
"includesGeneratedCode": true
|
|
198
|
+
},
|
|
199
|
+
"create-react-native-library": {
|
|
200
|
+
"type": "turbo-module",
|
|
201
|
+
"languages": "kotlin-objc",
|
|
202
|
+
"version": "0.48.1"
|
|
203
|
+
}
|
|
204
|
+
}
|