import * as NativeReclaimInappModuleTypes from './NativeInappRnSdk'; /** * [ReclaimVerification] is the main class for interacting with the Reclaim verification system. * It provides methods to start verification processes, manage platform configurations, * and handle verification options. * * The class can be instantiated with a custom platform implementation, or will use * the default [PlatformImpl] if none is provided. */ export declare class ReclaimVerification { platform: ReclaimVerification.Platform; private static defaultPlatform; private static isStrictConfigCheckEnabled; private static lastOverrides; private static lastVerificationOptions; constructor(platform?: ReclaimVerification.Platform); /** * Enables or disables strict configuration checks. When enabled, * [startVerification], [startVerificationFromUrl], and [startVerificationFromJson] * will throw if any field of [OverrideConfig] was not provided via [setOverrides], * or if any option of [VerificationOptions] was not provided via [setVerificationOptions]. * * Disabled by default. */ setStrictConfigCheck(enabled: boolean): void; startVerification(request: ReclaimVerification.Request): Promise; startVerificationFromUrl(requestUrl: string): Promise; startVerificationFromJson(template: Record): Promise; ping(): Promise; setOverrides(overrides: ReclaimVerification.OverrideConfig): Promise; clearAllOverrides(): Promise; setVerificationOptions(options?: ReclaimVerification.VerificationOptions | null): Promise; parseLog(log: string): ReclaimVerification.LogEntry; setConsoleLogging(enabled: boolean): Promise; addEventListener(type: T, listener: ReclaimVerification.EventListener.EventListener): ReclaimVerification.EventListener.CancelEventSubscription; private static assertStrictConfig; } /** * This namespace provides types involved in initiating and managing the verification process * for proving claims about user data through various providers. */ export declare namespace ReclaimVerification { /** * Represents user's session information for a verification attempt. * This data class contains the necessary data to identify and validate a verification session. */ type SessionInformation = NativeReclaimInappModuleTypes.SessionInformation; /** * Represents a request for a verification attempt. * * You can create a request using the [ReclaimVerification.Request] constructor or the [ReclaimVerification.Request.fromManifestMetaData] factory method. */ type Request = NativeReclaimInappModuleTypes.Request & { providerVersion?: ProviderVersion; }; class ProviderVersion implements NativeReclaimInappModuleTypes.ProviderVersion { resolvedVersion: string; versionExpression: string; private constructor(); static resolved(exactVersion: string, versionExpression?: string): ProviderVersion; static from(versionExpression?: string): ProviderVersion; } /** * Contains the proof and response data after verification */ interface Response extends NativeReclaimInappModuleTypes.Response { proofs: ReclaimResult.Proof[]; } namespace ReclaimResult { interface Proof { identifier: string; signatures: string[]; /** * A data associated with this [Proof]. * The data type of this object is dynamic and can be any JSON serializable Javascript object. */ publicData?: any | null; witnesses: WitnessData[]; claimData: ProviderClaimData; } const isProof: (value: Record) => value is Proof; const asProofs: (proofs: Record[]) => Proof[]; interface ProviderClaimData { owner: string; provider: string; timestampS: number; epoch: number; context: string; identifier: string; parameters: string; } interface WitnessData { id: string; url: string; } } interface VerificationOptions { /** * Whether to delete cookies before user journey starts in the client web view. * Defaults to true. */ canDeleteCookiesBeforeVerificationStarts?: boolean; /** * A callback to host that returns an authentication request when a Reclaim HTTP provider is provided. * Used for verifying authentication to attestor. */ fetchAttestorAuthenticationRequest?: (reclaimHttpProviderJsonString: string) => Promise; claimCreationType?: 'standalone' | 'meChain'; /** * Whether to automatically submit the proof after generation. Defaults to true. */ canAutoSubmit?: boolean; /** * Whether the close button is visible. Defaults to true. */ isCloseButtonVisible?: boolean; /** * A language code & Country code for localization that should be enforced in the verification flow. */ locale?: string | null; /** * Enables use of Reclaim's TEE+MPC protocol for HTTP Request claim verification and * attestation. * * When set to `true`, the verification will use Trusted Execution Environment * (TEE) with Multi-Party Computation (MPC) for enhanced security. * * When set to `false`, the standard Reclaim's proxy attestor verification flow is used. * * When `null` (default), inappsdk decides whether to use TEE based on * a feature flag. */ useTeeOperator?: boolean | null; } type SetConsoleLoggingOptions = NativeReclaimInappModuleTypes.SetConsoleLoggingOptions; namespace Overrides { interface ProviderInformation { url?: string; jsonString?: string; callback?: (request: NativeReclaimInappModuleTypes.ProviderInformationRequest) => Promise; } type FeatureOptions = NativeReclaimInappModuleTypes.FeatureOptions; interface LogConsumer { /** * Handler for consuming logs exported from the SDK. * Defaults to false. */ onLogs?: (logJsonString: string, cancel: () => void) => void; /** * When enabled, logs are sent to reclaim that can be used to help you. * Defaults to true. */ canSdkCollectTelemetry?: boolean; /** * Defaults to enabled when not in release mode. */ canSdkPrintLogs?: boolean; } interface SessionManagement { onLog: (event: NativeReclaimInappModuleTypes.SessionLogEvent) => void; /** * Receive request for creating a session and return a session id. * @param event Receive request for creating a session and return a session id. * @returns A session id. */ onSessionCreateRequest: (event: NativeReclaimInappModuleTypes.SessionCreateRequestEvent) => Promise; onSessionUpdateRequest: (event: NativeReclaimInappModuleTypes.SessionUpdateRequestEvent) => Promise; } interface SessionInitResponse { sessionId: string; resolvedProviderVersion: string; } type ReclaimAppInfo = NativeReclaimInappModuleTypes.ReclaimAppInfo; } namespace EventListener { type SessionIdentityUpdate = NativeReclaimInappModuleTypes.ReclaimSessionIdentityUpdate; interface EventMap { sessionIdentityUpdate: SessionIdentityUpdate; } type EventListener = (event: EventMap[T]) => void | Promise; type CancelEventSubscription = () => void; } type OverrideConfig = { provider?: Overrides.ProviderInformation; featureOptions?: Overrides.FeatureOptions; logConsumer?: Overrides.LogConsumer; sessionManagement?: Overrides.SessionManagement; appInfo?: Overrides.ReclaimAppInfo; capabilityAccessToken?: string | null; }; enum LogLevel { SEVERE = "SEVERE", WARNING = "WARNING", INFO = "INFO", CONFIG = "CONFIG", FINE = "FINE", FINER = "FINER", FINEST = "FINEST" } enum LogEventType { VERIFICATION_FLOW_STARTED = 0, IS_RECLAIM_VERIFIER = 1, IS_RECLAIM_INAPPSDK = 2, UPDATE_AVAILABLE = 3, SDK_OUTDATED = 4, RECLAIM_VERIFICATION_PLATFORM_NOT_SUPPORTED_EXCEPTION = 5, INVALID_REQUEST_RECLAIM_EXCEPTION = 6, RECLAIM_VERIFICATION_DISMISSED = 7, RECLAIM_VERIFICATION_CANCELLED_EXCEPTION = 8, RECLAIM_VERIFICATION_PROVIDER_LOAD_EXCEPTION = 9, RECLAIM_INIT_SESSION_EXCEPTION = 10, RECLAIM_EXPIRED_SESSION_EXCEPTION = 11, RECLAIM_VERIFICATION_SKIPPED = 12, RECLAIM_ATTESTOR_AUTH_EXCEPTION = 13, LOADING_INITIAL_URL = 14, WEB_PAGE_READY = 15, PAGE_LOADING_STARTED = 16, PAGE_LOADING_STOPPED = 17, RECLAIM_VERIFICATION_NO_ACTIVITY_DETECTED_EXCEPTION = 18, REQUEST_INTERCEPTED = 19, REQUEST_MATCHED = 20, PROVIDER_SCRIPT_REQUESTED_CLAIM = 21, PREPARING_CLAIM = 22, VALIDATING_CLAIM_PARAMETERS = 23, X_PATH_MATCH_REQUIREMENT_FAILED = 24, JSON_PATH_MATCH_REQUIREMENT_FAILED = 25, REGEX_MATCH_REQUIREMENT_FAILED = 26, NO_PARAMETERS_FOUND = 27, CLAIM_PARAMETER_VALIDATION_FAILED_EXCEPTION = 28, NO_RESPONSE_MATCH_WARNING = 29, STARTING_CLAIM_CREATION = 30, CLAIM_CREATION_STARTED = 31, ATTESTOR_NOT_RESPONDING = 32, CLAIM_CREATION_CANCELLED_EXCEPTION = 33, PROOF_GENERATED = 34, PROOF_GENERATION_FAILED_EXCEPTION = 35, CLAIM_CREATION_TIMED_OUT_EXCEPTION = 36, RESULT_RECEIVED = 37, SUBMITTING_PROOF = 38, PROOF_SUBMITTED = 39, PROOF_SUBMISSION_FAILED = 40 } type LogEntry = { logLine: string; /** * Timestamp in nanoseconds since unix epoch */ ts: string; /** * Same as `ts` but as JavaScript Date */ datetime: Date; /** * Logger name */ type: string; /** * Session id */ sessionId: string | '' | 'unknown'; /** * Provider id */ providerId: string; /** * App id */ appId: string; /** * Log level */ logLevel: keyof typeof LogLevel; /** * Log event */ eventType?: keyof typeof LogEventType | ''; }; enum ExceptionType { Cancelled = "Cancelled", Dismissed = "Dismissed", SessionExpired = "SessionExpired", Failed = "Failed" } class ReclaimPlatformException extends Error { readonly innerError: Error; readonly reason?: string; readonly details?: any; constructor(message: string, innerError: Error); static isReclaimPlatformException(error: Error): error is ReclaimPlatformException; } class ReclaimVerificationException extends Error { readonly 'innerError': Error; readonly 'type': ExceptionType; readonly 'sessionId': string; readonly 'didSubmitManualVerification': boolean; readonly 'reason': string; constructor(message: string, innerError: Error, type: ExceptionType, sessionId: string, didSubmitManualVerification: boolean, reason: string); private static 'fromTypeName'; static 'fromError'(error: Error, sessionIdHint: string): ReclaimVerificationException; static 'isReclaimVerificationException'(error: Error): error is ReclaimVerificationException; } abstract class Platform { abstract startVerification(request: ReclaimVerification.Request): Promise; abstract startVerificationFromUrl(requestUrl: string): Promise; abstract startVerificationFromJson(template: Record): Promise; abstract ping(): Promise; abstract setOverrides(config: ReclaimVerification.OverrideConfig): Promise; abstract clearAllOverrides(): Promise; abstract setVerificationOptions(options?: ReclaimVerification.VerificationOptions | null): Promise; abstract parseLog(log: string): ReclaimVerification.LogEntry; abstract setConsoleLogging(options?: ReclaimVerification.SetConsoleLoggingOptions | null): Promise; abstract addEventListener(type: T, listener: ReclaimVerification.EventListener.EventListener): ReclaimVerification.EventListener.CancelEventSubscription; } } export declare class PlatformImpl extends ReclaimVerification.Platform { startVerification(request: ReclaimVerification.Request): Promise; startVerificationFromUrl(requestUrl: string): Promise; startVerificationFromJson(template: Record): Promise; ping(): Promise; private previousSessionManagementCancelCallback; disposeSessionManagement(): void; private previousLogSubscription; disposeLogListener(): void; private previousProviderRequestCancelCallback; private disposeProviderRequestListener; setOverrides({ provider, featureOptions, logConsumer, sessionManagement, appInfo, capabilityAccessToken, }: ReclaimVerification.OverrideConfig): Promise; clearAllOverrides(): Promise; private previousAttestorAuthRequestCancelCallback; disposeAttestorAuthRequestListener(): void; setVerificationOptions(options?: ReclaimVerification.VerificationOptions | null): Promise; /** * Converts a nanosecond timestamp string back to a JavaScript Date object. * @param {string} timeStampStr - The timestamp string (ms * 1,000,000) * @returns {Date} */ fromTimeStampToDate(timeStampStr: string): Date; parseLog(log: string): ReclaimVerification.LogEntry; setConsoleLogging(options?: ReclaimVerification.SetConsoleLoggingOptions | null): Promise; static listenersCount: Record; addEventListener(type: T, listener: ReclaimVerification.EventListener.EventListener): ReclaimVerification.EventListener.CancelEventSubscription; } //# sourceMappingURL=index.d.ts.map