@reclaimprotocol/inapp-rn-sdk 0.3.0 → 0.6.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.
Files changed (44) hide show
  1. package/InappRnSdk.podspec +2 -1
  2. package/README.md +19 -17
  3. package/android/build.gradle +3 -3
  4. package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h +45 -35
  5. package/android/src/main/java/com/reclaimprotocol/inapp_rn_sdk/InappRnSdkModule.kt +18 -12
  6. package/ios/InappRnSdk.mm +8 -13
  7. package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec.h +18 -12
  8. package/ios/generated/RNInappRnSdkSpecJSI.h +45 -35
  9. package/ios/inapp_rn_sdk/Api.swift +32 -21
  10. package/lib/commonjs/index.js +327 -32
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/specs/NativeInappRnSdk.js.map +1 -1
  13. package/lib/module/index.js +324 -14
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/module/specs/NativeInappRnSdk.js.map +1 -1
  16. package/lib/typescript/commonjs/src/index.d.ts +170 -9
  17. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  18. package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts +18 -11
  19. package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts.map +1 -1
  20. package/lib/typescript/module/src/index.d.ts +170 -9
  21. package/lib/typescript/module/src/index.d.ts.map +1 -1
  22. package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts +18 -11
  23. package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts.map +1 -1
  24. package/package.json +4 -2
  25. package/src/index.ts +566 -21
  26. package/src/specs/NativeInappRnSdk.ts +22 -13
  27. package/lib/commonjs/ReclaimVerificationPlatformChannel.js +0 -306
  28. package/lib/commonjs/ReclaimVerificationPlatformChannel.js.map +0 -1
  29. package/lib/commonjs/types/proof.js +0 -16
  30. package/lib/commonjs/types/proof.js.map +0 -1
  31. package/lib/module/ReclaimVerificationPlatformChannel.js +0 -299
  32. package/lib/module/ReclaimVerificationPlatformChannel.js.map +0 -1
  33. package/lib/module/types/proof.js +0 -12
  34. package/lib/module/types/proof.js.map +0 -1
  35. package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts +0 -115
  36. package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts.map +0 -1
  37. package/lib/typescript/commonjs/src/types/proof.d.ts +0 -33
  38. package/lib/typescript/commonjs/src/types/proof.d.ts.map +0 -1
  39. package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts +0 -115
  40. package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts.map +0 -1
  41. package/lib/typescript/module/src/types/proof.d.ts +0 -33
  42. package/lib/typescript/module/src/types/proof.d.ts.map +0 -1
  43. package/src/ReclaimVerificationPlatformChannel.ts +0 -408
  44. package/src/types/proof.ts +0 -44
@@ -1,33 +1,343 @@
1
1
  "use strict";
2
2
 
3
- import { ReclaimVerificationPlatformChannelImpl } from "./ReclaimVerificationPlatformChannel.js";
4
- export { ReclaimVerificationPlatformChannel, ReclaimVerificationApi, ReclaimVerificationPlatformChannelImpl } from "./ReclaimVerificationPlatformChannel.js";
3
+ import NativeReclaimInappModule from "./specs/NativeInappRnSdk.js";
4
+ /**
5
+ * [ReclaimVerification] is the main class for interacting with the Reclaim verification system.
6
+ * It provides methods to start verification processes, manage platform configurations,
7
+ * and handle verification options.
8
+ *
9
+ * The class can be instantiated with a custom platform implementation, or will use
10
+ * the default [PlatformImpl] if none is provided.
11
+ */
5
12
  export class ReclaimVerification {
6
- static defaultChannel = null;
7
- constructor(channel) {
8
- if (channel) {
9
- this.channel = channel;
13
+ static defaultPlatform = null;
14
+ constructor(platform) {
15
+ if (platform) {
16
+ this.platform = platform;
10
17
  } else {
11
- if (ReclaimVerification.defaultChannel == null) {
12
- ReclaimVerification.defaultChannel = new ReclaimVerificationPlatformChannelImpl();
18
+ if (ReclaimVerification.defaultPlatform == null) {
19
+ ReclaimVerification.defaultPlatform = new PlatformImpl();
13
20
  }
14
- this.channel = ReclaimVerification.defaultChannel;
21
+ this.platform = ReclaimVerification.defaultPlatform;
15
22
  }
16
23
  }
17
24
  async startVerification(request) {
18
- return this.channel.startVerification(request);
25
+ return this.platform.startVerification(request);
19
26
  }
20
27
  async ping() {
21
- return this.channel.ping();
28
+ return this.platform.ping();
22
29
  }
23
30
  setOverrides(overrides) {
24
- return this.channel.setOverrides(overrides);
31
+ return this.platform.setOverrides(overrides);
25
32
  }
26
33
  clearAllOverrides() {
27
- return this.channel.clearAllOverrides();
34
+ return this.platform.clearAllOverrides();
28
35
  }
29
36
  setVerificationOptions(options) {
30
- return this.channel.setVerificationOptions(options);
37
+ return this.platform.setVerificationOptions(options);
38
+ }
39
+ }
40
+
41
+ /**
42
+ * This namespace provides types involved in initiating and managing the verification process
43
+ * for proving claims about user data through various providers.
44
+ */
45
+ (function (_ReclaimVerification) {
46
+ /**
47
+ * Represents user's session information for a verification attempt.
48
+ * This data class contains the necessary data to identify and validate a verification session.
49
+ */
50
+ /**
51
+ * Represents a request for a verification attempt.
52
+ *
53
+ * You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method.
54
+ */
55
+ /**
56
+ * Contains the proof and response data after verification
57
+ */
58
+ let ReclaimResult;
59
+ (function (_ReclaimResult) {
60
+ const isProof = _ReclaimResult.isProof = value => {
61
+ return typeof value === 'object' && value !== null && 'identifier' in value && 'signatures' in value && 'witnesses' in value;
62
+ };
63
+ const asProofs = _ReclaimResult.asProofs = proofs => {
64
+ return proofs.filter(isProof);
65
+ };
66
+ })(ReclaimResult || (ReclaimResult = _ReclaimVerification.ReclaimResult || (_ReclaimVerification.ReclaimResult = {})));
67
+ let ExceptionType = /*#__PURE__*/function (ExceptionType) {
68
+ ExceptionType["Cancelled"] = "Cancelled";
69
+ ExceptionType["Dismissed"] = "Dismissed";
70
+ ExceptionType["SessionExpired"] = "SessionExpired";
71
+ ExceptionType["Failed"] = "Failed";
72
+ return ExceptionType;
73
+ }({});
74
+ _ReclaimVerification.ExceptionType = ExceptionType;
75
+ class ReclaimPlatformException extends Error {
76
+ constructor(message, innerError) {
77
+ super(message);
78
+ this.innerError = innerError;
79
+ this.reason = innerError.message;
80
+ if ('userInfo' in innerError) {
81
+ const details = innerError.userInfo;
82
+ this.details = details;
83
+ if ('message' in details) {
84
+ this.reason = details.message || this.reason;
85
+ }
86
+ }
87
+ }
88
+ static isReclaimPlatformException(error) {
89
+ return error instanceof ReclaimPlatformException;
90
+ }
91
+ }
92
+ _ReclaimVerification.ReclaimPlatformException = ReclaimPlatformException;
93
+ class ReclaimVerificationException extends Error {
94
+ 'constructor'(message, innerError, type, sessionId, didSubmitManualVerification, reason) {
95
+ super(message);
96
+ this.innerError = innerError;
97
+ this.type = type;
98
+ this.sessionId = sessionId;
99
+ this.didSubmitManualVerification = didSubmitManualVerification;
100
+ this.reason = reason;
101
+ }
102
+ static 'fromTypeName'(name) {
103
+ switch (name) {
104
+ case 'cancelled':
105
+ case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Cancelled':
106
+ return ExceptionType.Cancelled;
107
+ case 'dismissed':
108
+ case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Dismissed':
109
+ return ExceptionType.Dismissed;
110
+ case 'sessionExpired':
111
+ case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.SessionExpired':
112
+ return ExceptionType.SessionExpired;
113
+ case 'failed':
114
+ case 'org.reclaimprotocol.inapp_sdk.ReclaimVerification.ReclaimVerificationException.Failed':
115
+ return ExceptionType.Failed;
116
+ }
117
+ return ExceptionType.Failed;
118
+ }
119
+ static 'fromError'(error, sessionIdHint) {
120
+ if ('userInfo' in error) {
121
+ // From native, we send information about error in userInfo
122
+ let userInfo = error.userInfo;
123
+ if (userInfo) {
124
+ let type = ReclaimVerification.ReclaimVerificationException.fromTypeName(userInfo.errorType);
125
+ let maybeSessionId = userInfo?.sessionId;
126
+ return new ReclaimVerificationException(error.message, error, type, typeof maybeSessionId === 'string' && maybeSessionId ? maybeSessionId : sessionIdHint, userInfo?.didSubmitManualVerification ?? false, userInfo?.reason ?? '');
127
+ }
128
+ }
129
+ return new ReclaimVerificationException(error.message, error, ReclaimVerification.ExceptionType.Failed, sessionIdHint, false, '');
130
+ }
131
+ static 'isReclaimVerificationException'(error) {
132
+ return error instanceof ReclaimVerificationException;
133
+ }
134
+ }
135
+ _ReclaimVerification.ReclaimVerificationException = ReclaimVerificationException;
136
+ class Platform {}
137
+ _ReclaimVerification.Platform = Platform;
138
+ })(ReclaimVerification || (ReclaimVerification = {}));
139
+ export class PlatformImpl extends ReclaimVerification.Platform {
140
+ async startVerification(request) {
141
+ try {
142
+ const response = await NativeReclaimInappModule.startVerification(request);
143
+ return {
144
+ ...response,
145
+ proofs: ReclaimVerification.ReclaimResult.asProofs(response.proofs)
146
+ };
147
+ } catch (error) {
148
+ console.info({
149
+ error
150
+ });
151
+ if (error instanceof Error) {
152
+ throw ReclaimVerification.ReclaimVerificationException.fromError(error, request.session?.sessionId ?? '');
153
+ }
154
+ throw error;
155
+ }
156
+ }
157
+ async startVerificationFromUrl(requestUrl) {
158
+ try {
159
+ const response = await NativeReclaimInappModule.startVerificationFromUrl(requestUrl);
160
+ return {
161
+ ...response,
162
+ proofs: ReclaimVerification.ReclaimResult.asProofs(response.proofs)
163
+ };
164
+ } catch (error) {
165
+ console.info({
166
+ error
167
+ });
168
+ if (error instanceof Error) {
169
+ throw ReclaimVerification.ReclaimVerificationException.fromError(error, '');
170
+ }
171
+ throw error;
172
+ }
173
+ }
174
+ async ping() {
175
+ return await NativeReclaimInappModule.ping();
176
+ }
177
+ previousSessionManagementCancelCallback = null;
178
+ disposeSessionManagement() {
179
+ let callback = this.previousSessionManagementCancelCallback;
180
+ if (callback != null && callback != undefined) {
181
+ callback();
182
+ }
183
+ this.previousSessionManagementCancelCallback = null;
184
+ }
185
+ previousLogSubscription = null;
186
+ disposeLogListener() {
187
+ this.previousLogSubscription?.remove();
188
+ this.previousLogSubscription = null;
189
+ }
190
+ previousProviderRequestCancelCallback = null;
191
+ disposeProviderRequestListener() {
192
+ let callback = this.previousProviderRequestCancelCallback;
193
+ if (callback != null && callback != undefined) {
194
+ callback();
195
+ }
196
+ this.previousProviderRequestCancelCallback = null;
197
+ }
198
+ async setOverrides({
199
+ provider,
200
+ featureOptions,
201
+ logConsumer,
202
+ sessionManagement,
203
+ appInfo,
204
+ capabilityAccessToken
205
+ }) {
206
+ let providerCallback = provider?.callback;
207
+ let providerOverride = !provider ? null : {
208
+ url: provider?.url,
209
+ jsonString: provider?.jsonString,
210
+ canFetchProviderInformationFromHost: !!providerCallback
211
+ };
212
+ if (providerCallback) {
213
+ this.disposeProviderRequestListener();
214
+ let providerRequestSubscription = NativeReclaimInappModule.onProviderInformationRequest(async event => {
215
+ try {
216
+ let result = await providerCallback(event);
217
+ NativeReclaimInappModule.replyWithString(event.replyId, result);
218
+ } catch (error) {
219
+ console.error(error);
220
+ NativeReclaimInappModule.replyWithString(event.replyId, '');
221
+ }
222
+ });
223
+ const cancel = () => {
224
+ providerRequestSubscription.remove();
225
+ };
226
+ this.previousProviderRequestCancelCallback = cancel;
227
+ }
228
+ const onLogsListener = logConsumer?.onLogs;
229
+ let logConsumerRequest = !logConsumer ? undefined : {
230
+ enableLogHandler: !!onLogsListener,
231
+ canSdkCollectTelemetry: logConsumer?.canSdkCollectTelemetry,
232
+ canSdkPrintLogs: logConsumer?.canSdkPrintLogs
233
+ };
234
+ if (onLogsListener) {
235
+ this.disposeLogListener();
236
+ const cancel = () => {
237
+ this.previousLogSubscription?.remove();
238
+ this.previousLogSubscription = null;
239
+ };
240
+ this.previousLogSubscription = NativeReclaimInappModule.onLogs(arg => {
241
+ onLogsListener(arg, cancel);
242
+ });
243
+ }
244
+ let sessionManagementRequest = !sessionManagement ? undefined : {
245
+ // A handler is provided, so we don't let SDK manage sessions
246
+ enableSdkSessionManagement: false
247
+ };
248
+ if (sessionManagement) {
249
+ this.disposeSessionManagement();
250
+ let sessionCreateSubscription = NativeReclaimInappModule.onSessionCreateRequest(async event => {
251
+ const replyId = event.replyId;
252
+ try {
253
+ let result = await sessionManagement.onSessionCreateRequest(event);
254
+ NativeReclaimInappModule.replyWithString(replyId, result);
255
+ } catch (error) {
256
+ console.error(error);
257
+ NativeReclaimInappModule.reply(replyId, false);
258
+ }
259
+ });
260
+ let sessionUpdateSubscription = NativeReclaimInappModule.onSessionUpdateRequest(async event => {
261
+ const replyId = event.replyId;
262
+ try {
263
+ let result = await sessionManagement.onSessionUpdateRequest(event);
264
+ NativeReclaimInappModule.reply(replyId, result);
265
+ } catch (error) {
266
+ console.error(error);
267
+ NativeReclaimInappModule.reply(replyId, false);
268
+ }
269
+ });
270
+ let sessionLogsSubscription = NativeReclaimInappModule.onSessionLogs(event => {
271
+ try {
272
+ sessionManagement.onLog(event);
273
+ } catch (error) {
274
+ console.error(error);
275
+ }
276
+ });
277
+ const cancel = () => {
278
+ sessionCreateSubscription.remove();
279
+ sessionUpdateSubscription.remove();
280
+ sessionLogsSubscription.remove();
281
+ };
282
+ this.previousSessionManagementCancelCallback = cancel;
283
+ }
284
+ try {
285
+ return await NativeReclaimInappModule.setOverrides({
286
+ provider: providerOverride,
287
+ featureOptions,
288
+ logConsumer: logConsumerRequest,
289
+ sessionManagement: sessionManagementRequest,
290
+ appInfo,
291
+ capabilityAccessToken
292
+ });
293
+ } catch (error) {
294
+ throw new ReclaimVerification.ReclaimPlatformException('Failed to set overrides', error);
295
+ }
296
+ }
297
+ async clearAllOverrides() {
298
+ this.disposeProviderRequestListener();
299
+ this.disposeLogListener();
300
+ this.disposeSessionManagement();
301
+ return NativeReclaimInappModule.clearAllOverrides();
302
+ }
303
+ previousAttestorAuthRequestCancelCallback = null;
304
+ disposeAttestorAuthRequestListener() {
305
+ let callback = this.previousAttestorAuthRequestCancelCallback;
306
+ if (callback != null && callback != undefined) {
307
+ callback();
308
+ }
309
+ this.previousAttestorAuthRequestCancelCallback = null;
310
+ }
311
+ async setVerificationOptions(options) {
312
+ let args = null;
313
+ if (options) {
314
+ let canUseAttestorAuthenticationRequest = options.fetchAttestorAuthenticationRequest != null;
315
+ args = {
316
+ canDeleteCookiesBeforeVerificationStarts: options.canDeleteCookiesBeforeVerificationStarts,
317
+ canUseAttestorAuthenticationRequest: canUseAttestorAuthenticationRequest,
318
+ claimCreationType: options.claimCreationType ?? 'standalone',
319
+ canAutoSubmit: options.canAutoSubmit ?? true,
320
+ isCloseButtonVisible: options.isCloseButtonVisible ?? true
321
+ };
322
+ if (canUseAttestorAuthenticationRequest) {
323
+ this.disposeAttestorAuthRequestListener();
324
+ let attestorAuthRequestSubscription = NativeReclaimInappModule.onReclaimAttestorAuthRequest(async event => {
325
+ let result = await options.fetchAttestorAuthenticationRequest(event.reclaimHttpProviderJsonString);
326
+ NativeReclaimInappModule.replyWithString(event.replyId, result);
327
+ });
328
+ const cancel = () => {
329
+ attestorAuthRequestSubscription.remove();
330
+ };
331
+ this.previousAttestorAuthRequestCancelCallback = cancel;
332
+ }
333
+ }
334
+ try {
335
+ return await NativeReclaimInappModule.setVerificationOptions({
336
+ options: args
337
+ });
338
+ } catch (error) {
339
+ throw new ReclaimVerification.ReclaimPlatformException('Failed to set verification options', error);
340
+ }
31
341
  }
32
342
  }
33
343
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ReclaimVerificationPlatformChannelImpl","ReclaimVerificationPlatformChannel","ReclaimVerificationApi","ReclaimVerification","defaultChannel","constructor","channel","startVerification","request","ping","setOverrides","overrides","clearAllOverrides","setVerificationOptions","options"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAA0EA,sCAAsC,QAAQ,yCAAsC;AAC9J,SAASC,kCAAkC,EAAEC,sBAAsB,EAAEF,sCAAsC,QAAQ,yCAAsC;AAGzJ,OAAO,MAAMG,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,IAAIJ,sCAAsC,CAAC,CAAC;MACnF;MACA,IAAI,CAACM,OAAO,GAAGH,mBAAmB,CAACC,cAAc;IACnD;EACF;EAEA,MAAaG,iBAAiBA,CAACC,OAAuC,EAA4C;IAChH,OAAO,IAAI,CAACF,OAAO,CAACC,iBAAiB,CAACC,OAAO,CAAC;EAChD;EAEA,MAAaC,IAAIA,CAAA,EAAqB;IACpC,OAAO,IAAI,CAACH,OAAO,CAACG,IAAI,CAAC,CAAC;EAC5B;EAEOC,YAAYA,CAACC,SAAgD,EAAE;IACpE,OAAO,IAAI,CAACL,OAAO,CAACI,YAAY,CAACC,SAAS,CAAC;EAC7C;EAEOC,iBAAiBA,CAAA,EAAG;IACzB,OAAO,IAAI,CAACN,OAAO,CAACM,iBAAiB,CAAC,CAAC;EACzC;EAEOC,sBAAsBA,CAACC,OAA2D,EAAE;IACzF,OAAO,IAAI,CAACR,OAAO,CAACO,sBAAsB,CAACC,OAAO,CAAC;EACrD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NativeReclaimInappModule","ReclaimVerification","defaultPlatform","constructor","platform","PlatformImpl","startVerification","request","ping","setOverrides","overrides","clearAllOverrides","setVerificationOptions","options","_ReclaimVerification","ReclaimResult","_ReclaimResult","isProof","value","asProofs","proofs","filter","ExceptionType","ReclaimPlatformException","Error","message","innerError","reason","details","userInfo","isReclaimPlatformException","error","ReclaimVerificationException","type","sessionId","didSubmitManualVerification","fromTypeName","name","Cancelled","Dismissed","SessionExpired","Failed","fromError","sessionIdHint","errorType","maybeSessionId","isReclaimVerificationException","Platform","response","console","info","session","startVerificationFromUrl","requestUrl","previousSessionManagementCancelCallback","disposeSessionManagement","callback","undefined","previousLogSubscription","disposeLogListener","remove","previousProviderRequestCancelCallback","disposeProviderRequestListener","provider","featureOptions","logConsumer","sessionManagement","appInfo","capabilityAccessToken","providerCallback","providerOverride","url","jsonString","canFetchProviderInformationFromHost","providerRequestSubscription","onProviderInformationRequest","event","result","replyWithString","replyId","cancel","onLogsListener","onLogs","logConsumerRequest","enableLogHandler","canSdkCollectTelemetry","canSdkPrintLogs","arg","sessionManagementRequest","enableSdkSessionManagement","sessionCreateSubscription","onSessionCreateRequest","reply","sessionUpdateSubscription","onSessionUpdateRequest","sessionLogsSubscription","onSessionLogs","onLog","previousAttestorAuthRequestCancelCallback","disposeAttestorAuthRequestListener","args","canUseAttestorAuthenticationRequest","fetchAttestorAuthenticationRequest","canDeleteCookiesBeforeVerificationStarts","claimCreationType","canAutoSubmit","isCloseButtonVisible","attestorAuthRequestSubscription","onReclaimAttestorAuthRequest","reclaimHttpProviderJsonString"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AACA,OAAOA,wBAAwB,MAA0C,6BAA0B;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAC;EAG/B,OAAeC,eAAe,GAAwC,IAAI;EAEnEC,WAAWA,CAACC,QAAuC,EAAE;IAC1D,IAAIA,QAAQ,EAAE;MACZ,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IAC1B,CAAC,MAAM;MACL,IAAIH,mBAAmB,CAACC,eAAe,IAAI,IAAI,EAAE;QAC/CD,mBAAmB,CAACC,eAAe,GAAG,IAAIG,YAAY,CAAC,CAAC;MAC1D;MACA,IAAI,CAACD,QAAQ,GAAGH,mBAAmB,CAACC,eAAe;IACrD;EACF;EAEA,MAAaI,iBAAiBA,CAC5BC,OAAoC,EACG;IACvC,OAAO,IAAI,CAACH,QAAQ,CAACE,iBAAiB,CAACC,OAAO,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C,CAC3D1B,KAAK,CAACiC,6BACR,CAAC;UACD7G,wBAAwB,CAAC8E,eAAe,CAACF,KAAK,CAACG,OAAO,EAAEF,MAAM,CAAC;QACjE,CACF,CAAC;QACH,MAAMG,MAAM,GAAGA,CAAA,KAAM;UACnB2B,+BAA+B,CAAC/C,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,CAACsC,yCAAyC,GAAGlB,MAAM;MACzD;IACF;IACA,IAAI;MACF,OAAO,MAAMhF,wBAAwB,CAACY,sBAAsB,CAAC;QAC3DC,OAAO,EAAEuF;MACX,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOrE,KAAK,EAAE;MACd,MAAM,IAAI9B,mBAAmB,CAACsB,wBAAwB,CACpD,oCAAoC,EACpCQ,KACF,CAAC;IACH;EACF;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeInappRnSdk.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AA0BlD;AACA;AACA;AACA;AACA;;AA+EA;AACA;AACA;;AAwBA;AACA;AACA;;AAkEA;AACA;AACA;;AAgDA;;AAwGA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeInappRnSdk.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AA0BlD;AACA;AACA;AACA;AACA;;AA2EA;AACA;AACA;;AAwBA;AACA;AACA;;AA4DA;AACA;AACA;;AAgDA;;AA2HA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,YAAY,CAAC","ignoreList":[]}
@@ -1,14 +1,175 @@
1
- import { type ReclaimVerificationApi, ReclaimVerificationPlatformChannel } from './ReclaimVerificationPlatformChannel';
2
- export { ReclaimVerificationPlatformChannel, ReclaimVerificationApi, ReclaimVerificationPlatformChannelImpl } from './ReclaimVerificationPlatformChannel';
3
- export type { ReclaimVerificationApi as ReclaimVerificationApiType, ReclaimResult } from './ReclaimVerificationPlatformChannel';
1
+ import * as NativeReclaimInappModuleTypes from './specs/NativeInappRnSdk';
2
+ /**
3
+ * [ReclaimVerification] is the main class for interacting with the Reclaim verification system.
4
+ * It provides methods to start verification processes, manage platform configurations,
5
+ * and handle verification options.
6
+ *
7
+ * The class can be instantiated with a custom platform implementation, or will use
8
+ * the default [PlatformImpl] if none is provided.
9
+ */
4
10
  export declare class ReclaimVerification {
5
- channel: ReclaimVerificationPlatformChannel;
6
- private static defaultChannel;
7
- constructor(channel?: ReclaimVerificationPlatformChannel);
8
- startVerification(request: ReclaimVerificationApi.Request): Promise<ReclaimVerificationApi.Response>;
11
+ platform: ReclaimVerification.Platform;
12
+ private static defaultPlatform;
13
+ constructor(platform?: ReclaimVerification.Platform);
14
+ startVerification(request: ReclaimVerification.Request): Promise<ReclaimVerification.Response>;
9
15
  ping(): Promise<boolean>;
10
- setOverrides(overrides: ReclaimVerificationApi.OverrideConfig): Promise<void>;
16
+ setOverrides(overrides: ReclaimVerification.OverrideConfig): Promise<void>;
11
17
  clearAllOverrides(): Promise<void>;
12
- setVerificationOptions(options?: ReclaimVerificationApi.VerificationOptions | null): Promise<void>;
18
+ setVerificationOptions(options?: ReclaimVerification.VerificationOptions | null): Promise<void>;
19
+ }
20
+ /**
21
+ * This namespace provides types involved in initiating and managing the verification process
22
+ * for proving claims about user data through various providers.
23
+ */
24
+ export declare namespace ReclaimVerification {
25
+ /**
26
+ * Represents user's session information for a verification attempt.
27
+ * This data class contains the necessary data to identify and validate a verification session.
28
+ */
29
+ type SessionInformation = NativeReclaimInappModuleTypes.SessionInformation;
30
+ /**
31
+ * Represents a request for a verification attempt.
32
+ *
33
+ * You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method.
34
+ */
35
+ type Request = NativeReclaimInappModuleTypes.Request;
36
+ /**
37
+ * Contains the proof and response data after verification
38
+ */
39
+ interface Response extends NativeReclaimInappModuleTypes.Response {
40
+ proofs: ReclaimResult.Proof[];
41
+ }
42
+ namespace ReclaimResult {
43
+ interface Proof {
44
+ identifier: string;
45
+ signatures: string[];
46
+ /**
47
+ * A data associated with this [Proof].
48
+ * The data type of this object is dynamic and can be any JSON serializable Javascript object.
49
+ */
50
+ publicData?: any | null;
51
+ witnesses: WitnessData[];
52
+ claimData: ProviderClaimData;
53
+ }
54
+ const isProof: (value: Record<string, any>) => value is Proof;
55
+ const asProofs: (proofs: Record<string, any>[]) => Proof[];
56
+ interface ProviderClaimData {
57
+ owner: string;
58
+ provider: string;
59
+ timestampS: number;
60
+ epoch: number;
61
+ context: string;
62
+ identifier: string;
63
+ parameters: string;
64
+ }
65
+ interface WitnessData {
66
+ id: string;
67
+ url: string;
68
+ }
69
+ }
70
+ interface VerificationOptions {
71
+ canDeleteCookiesBeforeVerificationStarts: boolean;
72
+ fetchAttestorAuthenticationRequest: (reclaimHttpProviderJsonString: string) => Promise<string>;
73
+ claimCreationType?: 'standalone' | 'meChain';
74
+ /**
75
+ * Whether to automatically submit the proof after generation. Defaults to true.
76
+ */
77
+ canAutoSubmit?: boolean;
78
+ /**
79
+ * Whether the close button is visible. Defaults to true.
80
+ */
81
+ isCloseButtonVisible?: boolean;
82
+ }
83
+ namespace Overrides {
84
+ interface ProviderInformation {
85
+ url?: string;
86
+ jsonString?: string;
87
+ callback?: (request: NativeReclaimInappModuleTypes.ProviderInformationRequest) => Promise<string>;
88
+ }
89
+ type FeatureOptions = NativeReclaimInappModuleTypes.FeatureOptions;
90
+ interface LogConsumer {
91
+ /**
92
+ * Handler for consuming logs exported from the SDK.
93
+ * Defaults to false.
94
+ */
95
+ onLogs?: (logJsonString: String, cancel: () => void) => void;
96
+ /**
97
+ * When enabled, logs are sent to reclaim that can be used to help you.
98
+ * Defaults to true.
99
+ */
100
+ canSdkCollectTelemetry?: boolean;
101
+ /**
102
+ * Defaults to enabled when not in release mode.
103
+ */
104
+ canSdkPrintLogs?: boolean;
105
+ }
106
+ interface SessionManagement {
107
+ onLog: (event: NativeReclaimInappModuleTypes.SessionLogEvent) => void;
108
+ /**
109
+ * Receive request for creating a session and return a session id.
110
+ * @param event Receive request for creating a session and return a session id.
111
+ * @returns A session id.
112
+ */
113
+ onSessionCreateRequest: (event: NativeReclaimInappModuleTypes.SessionCreateRequestEvent) => Promise<string>;
114
+ onSessionUpdateRequest: (event: NativeReclaimInappModuleTypes.SessionUpdateRequestEvent) => Promise<boolean>;
115
+ }
116
+ type ReclaimAppInfo = NativeReclaimInappModuleTypes.ReclaimAppInfo;
117
+ }
118
+ type OverrideConfig = {
119
+ provider?: Overrides.ProviderInformation;
120
+ featureOptions?: Overrides.FeatureOptions;
121
+ logConsumer?: Overrides.LogConsumer;
122
+ sessionManagement?: Overrides.SessionManagement;
123
+ appInfo?: Overrides.ReclaimAppInfo;
124
+ capabilityAccessToken?: string | null;
125
+ };
126
+ enum ExceptionType {
127
+ Cancelled = "Cancelled",
128
+ Dismissed = "Dismissed",
129
+ SessionExpired = "SessionExpired",
130
+ Failed = "Failed"
131
+ }
132
+ class ReclaimPlatformException extends Error {
133
+ readonly innerError: Error;
134
+ readonly reason?: string;
135
+ readonly details?: any;
136
+ constructor(message: string, innerError: Error);
137
+ static isReclaimPlatformException(error: Error): error is ReclaimPlatformException;
138
+ }
139
+ class ReclaimVerificationException extends Error {
140
+ readonly 'innerError': Error;
141
+ readonly 'type': ExceptionType;
142
+ readonly 'sessionId': string;
143
+ readonly 'didSubmitManualVerification': boolean;
144
+ readonly 'reason': string;
145
+ constructor(message: string, innerError: Error, type: ExceptionType, sessionId: string, didSubmitManualVerification: boolean, reason: string);
146
+ private static 'fromTypeName';
147
+ static 'fromError'(error: Error, sessionIdHint: string): ReclaimVerificationException;
148
+ static 'isReclaimVerificationException'(error: Error): error is ReclaimVerificationException;
149
+ }
150
+ abstract class Platform {
151
+ abstract startVerification(request: ReclaimVerification.Request): Promise<ReclaimVerification.Response>;
152
+ abstract startVerificationFromUrl(requestUrl: string): Promise<ReclaimVerification.Response>;
153
+ abstract ping(): Promise<boolean>;
154
+ abstract setOverrides(config: ReclaimVerification.OverrideConfig): Promise<void>;
155
+ abstract clearAllOverrides(): Promise<void>;
156
+ abstract setVerificationOptions(options?: ReclaimVerification.VerificationOptions | null): Promise<void>;
157
+ }
158
+ }
159
+ export declare class PlatformImpl extends ReclaimVerification.Platform {
160
+ startVerification(request: ReclaimVerification.Request): Promise<ReclaimVerification.Response>;
161
+ startVerificationFromUrl(requestUrl: string): Promise<ReclaimVerification.Response>;
162
+ ping(): Promise<boolean>;
163
+ private previousSessionManagementCancelCallback;
164
+ disposeSessionManagement(): void;
165
+ private previousLogSubscription;
166
+ disposeLogListener(): void;
167
+ private previousProviderRequestCancelCallback;
168
+ private disposeProviderRequestListener;
169
+ setOverrides({ provider, featureOptions, logConsumer, sessionManagement, appInfo, capabilityAccessToken, }: ReclaimVerification.OverrideConfig): Promise<void>;
170
+ clearAllOverrides(): Promise<void>;
171
+ private previousAttestorAuthRequestCancelCallback;
172
+ disposeAttestorAuthRequestListener(): void;
173
+ setVerificationOptions(options?: ReclaimVerification.VerificationOptions | null): Promise<void>;
13
174
  }
14
175
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,kCAAkC,EAA0C,MAAM,sCAAsC,CAAC;AAC/J,OAAO,EAAE,kCAAkC,EAAE,sBAAsB,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC1J,YAAY,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhI,qBAAa,mBAAmB;IACvB,OAAO,EAAE,kCAAkC,CAAC;IAEnD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAmD;gBAE7D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IAAI,OAAO,CAAC,IAAI,CAAC;QAE3C,QAAQ,CAAC,sBAAsB,CAC7B,OAAO,CAAC,EAAE,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,GACvD,OAAO,CAAC,IAAI,CAAC;KACjB;CACF;AAED,qBAAa,YAAa,SAAQ,mBAAmB,CAAC,QAAQ;IAC7C,iBAAiB,CAC9B,OAAO,EAAE,mBAAmB,CAAC,OAAO,GACnC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC;IAsBzB,wBAAwB,CACrC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC;IAsBzB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIvC,OAAO,CAAC,uCAAuC,CAA6B;IAC5E,wBAAwB;IAQxB,OAAO,CAAC,uBAAuB,CAAkC;IACjE,kBAAkB;IAKlB,OAAO,CAAC,qCAAqC,CAA6B;IAC1E,OAAO,CAAC,8BAA8B;IAQvB,YAAY,CAAC,EAC1B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,qBAAqB,GACtB,EAAE,mBAAmB,CAAC,cAAc;IA8GtB,iBAAiB;IAOhC,OAAO,CAAC,yCAAyC,CAA6B;IAC9E,kCAAkC;IAQnB,sBAAsB,CACnC,OAAO,CAAC,EAAE,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,GACvD,OAAO,CAAC,IAAI,CAAC;CA0CjB"}
@@ -91,10 +91,6 @@ export interface Request {
91
91
  parameters?: {
92
92
  [key: string]: string;
93
93
  };
94
- /**
95
- * Whether to automatically submit the proof after generation.
96
- */
97
- autoSubmit?: boolean;
98
94
  acceptAiProviders?: boolean;
99
95
  webhookUrl?: string | null;
100
96
  }
@@ -151,11 +147,6 @@ export interface FeatureOptions {
151
147
  * Optional, defaults to null.
152
148
  */
153
149
  attestorBrowserRpcUrl?: string | null;
154
- /**
155
- * Whether response redaction regex escaping is enabled.
156
- * Optional, defaults to null.
157
- */
158
- isResponseRedactionRegexEscapingEnabled?: boolean | null;
159
150
  /**
160
151
  * Whether AI flow is enabled.
161
152
  * Optional, defaults to null.
@@ -240,9 +231,13 @@ export interface SessionCreateRequestEvent {
240
231
  */
241
232
  providerId: string;
242
233
  /**
243
- * The session ID for the verification attempt
234
+ * The session timestamp for the verification attempt
244
235
  */
245
- sessionId: string;
236
+ timestamp: string;
237
+ /**
238
+ * The session signature for the verification attempt
239
+ */
240
+ signature: string;
246
241
  /**
247
242
  * internal
248
243
  */
@@ -284,6 +279,18 @@ export interface ProviderInformationRequest {
284
279
  export interface VerificationOptions {
285
280
  canDeleteCookiesBeforeVerificationStarts: boolean;
286
281
  canUseAttestorAuthenticationRequest: boolean;
282
+ /**
283
+ * The type of claim creation to use. Defaults to 'standalone'.
284
+ */
285
+ claimCreationType: 'standalone' | 'meChain';
286
+ /**
287
+ * Whether to automatically submit the proof after generation. Defaults to true.
288
+ */
289
+ canAutoSubmit: boolean;
290
+ /**
291
+ * Whether the close button is visible. Defaults to true.
292
+ */
293
+ isCloseButtonVisible: boolean;
287
294
  }
288
295
  export interface VerificationOptionsOptional {
289
296
  options?: VerificationOptions | null;