import { SudoPlatformSignInCallback } from '@sudoplatform/sudo-user'; import { IdDocumentCaptureInitiationInfo, IdentityDataProcessingConsentContent, IdentityDataProcessingConsentContentInput, IdentityDataProcessingConsentInput, IdentityDataProcessingConsentResponse, IdentityDataProcessingConsentStatus, VerifiedIdentity, VerifyIdentityDocumentInput, VerifyIdentityInput } from './types'; import { SudoSecureIdVerificationClientOptions } from './types/sudoIdentityVerificationClientOptions'; /** * Client interface for accessing Secure ID Verification service. */ export interface SudoSecureIdVerificationClient { /** * Resets internal state and clear any cached data. */ reset(): Promise; /** * Sets an optional callback to handle sign-in when operations are attempted * while not signed in. * * When set, all operations (excepting subscriptions and initialization/reset) will * check sign-in status before performing their normal behavior. If the client is * not signed in, the callback will be invoked to allow the host app to perform * sign-in. Once the callback completes, then the client will attempt the original * operation that triggered the callback. * If the callback throws an error, then the error will be propagated to the caller * and the original operation will not be attempted. * To clear the callback, call this method with no arguments or undefined. */ setSignInCallback(callback?: SudoPlatformSignInCallback): void; /** * Retrieves the list of countries for which secure ID verification is supported in the * environment. * * @returns List of ISO 3166-1 alpha-2 country codes. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ listSupportedCountries(): Promise; /** * Retrieves whether face images must be provided as part of ID document * verification. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isFaceImageRequiredWithDocumentVerification(): Promise; /** * Retrieves whether face images must be provided as part of ID document * capture. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isFaceImageRequiredWithDocumentCapture(): Promise; /** * Retrieves whether initiateIdentityDocumentCapture() can be called in the configured * service environment. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isDocumentCaptureInitiationEnabled(): Promise; /** * Retrieves whether consent is required before identity verification can succeed in the configured * service environment. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isConsentRequiredForVerification(): Promise; /** * Queries the current identity verification status for the signed in user. * * @returns Verified identity results. * * @throws NotSignedInError * @throws ServiceError * @throws UnknownGraphQLError * @throws FatalError */ checkIdentityVerification(): Promise; /** * Attempts to verify identity based on provided personally identifiable information (PII). * * @param {VerifyIdentityInput} pii Dictionary of personally identifiable information required to verify identity. * * @returns Verified identity results. * * @throws NotSignedInError * @throws {@link ImplausibleAgeError} * @throws {@link InvalidAgeError} * @throws {@link UnsupportedVerificationMethodError} * @throws {@link UnsupportedCountryError} * @throws {@link UnsupportedNetworkLocationError} * @throws ServiceError * @throws UnknownGraphQLError * @throws FatalError */ verifyIdentity(pii: VerifyIdentityInput): Promise; /** * Attempts to verify identity based on provided identity documents. * * @returns Verified identity results. * * @param {VerifyIdentityDocumentInput} idDocumentInfo Identity document information * * @throws NotSignedInError * @throws {@link ImplausibleAgeError} * @throws {@link InvalidAgeError} * @throws {@link UnsupportedVerificationMethodError} * @throws {@link UnsupportedCountryError} * @throws {@link UnsupportedNetworkLocationError} * @throws ServiceError * @throws UnknownGraphQLError * @throws FatalError */ verifyIdentityDocument(idDocumentInfo: VerifyIdentityDocumentInput): Promise; /** * Attempts to extracts identity information from provided identity documents, * and then use that to verify identity. * * @returns Verified identity results. * * @param {VerifyIdentityDocumentInput} idDocumentInfo Identity document information * * @throws NotSignedInError * @throws {@link ImplausibleAgeError} * @throws {@link InvalidAgeError} * @throws {@link UnsupportedVerificationMethodError} * @throws {@link UnsupportedCountryError} * @throws {@link UnsupportedNetworkLocationError} * @throws ServiceError * @throws UnknownGraphQLError * @throws FatalError */ captureAndVerifyIdentityDocument(idDocumentInfo: VerifyIdentityDocumentInput): Promise; /** * Attempt to initiate ID document capture using underlying provider's web * based method. * * @returns Information a client can use to initiate document capture. * * @throws NotSignedInError * @throws {@link IdentityAlreadyVerifiedError} * @throws ServiceError * @throws UnknownGraphQLError * @throws FatalError */ initiateIdentityDocumentCapture(): Promise; /** * Retrieves the content for identity data processing consent, for a given preferred language * (in RFC 5646 format) and content type. * * @param {IdentityDataProcessingConsentContentInput} input * Preferred content type and language for consent content. * @returns Consent content for the given preferences. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ getIdentityDataProcessingConsentContent(input: IdentityDataProcessingConsentContentInput): Promise; /** * Withdraws the user's identity data processing consent. * * @returns Response indicating if the withdrawal was processed. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ withdrawIdentityDataProcessingConsent(): Promise; /** * Retrieves the user's current identity data processing consent status. * * @returns Consent status for the user. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ getIdentityDataProcessingConsentStatus(): Promise; /** * Provides the user's identity data processing consent. * * @param {IdentityDataProcessingConsentInput} input * Consent content, content type, and language. * @returns Response indicating if the consent was processed. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ provideIdentityDataProcessingConsent(input: IdentityDataProcessingConsentInput): Promise; } /** * Implementation of Secure ID Verification client. */ export declare class DefaultSudoSecureIdVerificationClient implements SudoSecureIdVerificationClient { private readonly sudoUserClient; private readonly apiClient; private readonly identityVerificationServiceConfig; private readonly signInGuard; private readonly logger; /** * Initializes the Secure ID Verification client. * * @param {SudoSecureIdVerificationClientOptions} options * Specify the SudoUserClient and Logger to use. If no Logger is * specified, a new one is constructed. * * @throws ConfigurationSetNotFoundError * If identity verification service is not configured in the environment */ constructor(options: SudoSecureIdVerificationClientOptions); /** * Resets internal state and clear any cached data. */ reset(): Promise; /** * Sets an optional callback to handle sign-in when operations are attempted * while not signed in. */ setSignInCallback(callback?: SudoPlatformSignInCallback): void; /** * Retrieves the list of countries for which secure ID verification is supported in the * environment. * * @returns List of ISO 3166-1 alpha-2 country codes. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ listSupportedCountries(): Promise; /** * Retrieves whether face images must be provided as part of ID document * verification. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isFaceImageRequiredWithDocumentVerification(): Promise; /** * Retrieves whether face images must be provided as part of ID document * capture. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isFaceImageRequiredWithDocumentCapture(): Promise; /** * Retrieves whether initiateIdentityDocumentCapture() can be called in the configured * service environment. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isDocumentCaptureInitiationEnabled(): Promise; /** * Retrieves whether consent is required before identity verification can succeed in the configured * service environment. * * @returns Boolean * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ isConsentRequiredForVerification(): Promise; /** * Queries the current identity verification status for the signed in user. * * @returns Verified identity results. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ checkIdentityVerification(): Promise; /** * Attempts to verify identity based on provided personally identifiable information (PII). * * @param {VerifyIdentityInput} pii * Dictionary of personally identifiable information required to * verify identity. The verificationMethod property must be absent * or set to {@link VerificationMethod.KnowledgeOfPII} * * @returns Verified identity results. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ verifyIdentity(pii: VerifyIdentityInput): Promise; /** * Attempts to verify identity based on provided identity documents. * * @returns Verified identity results. * * @param {VerifyIdentityDocumentInput} idDocumentInfo * Identity document information. The verificationMethod property must * be absent or set to {@link VerificationMethod.GovernmentID} * * @throws NotSignedInError * @throws ConsentRequiredError * @throws IllegalArgumentError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ verifyIdentityDocument(idDocumentInfo: VerifyIdentityDocumentInput): Promise; /** * Attempts to extracts identity information from provided identity documents, * and then use that to verify identity. * * @returns Verified identity results. * * @param {VerifyIdentityDocumentInput} idDocumentInfo * Identity document information. The verificationMethod property must * be absent or set to {@link VerificationMethod.GovernmentID} * * @throws NotSignedInError * @throws IllegalArgumentError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ captureAndVerifyIdentityDocument(idDocumentInfo: VerifyIdentityDocumentInput): Promise; /** * Attempt to initiate ID document capture using underlying provider's web * based method. * * @returns Information a client can use to initiate document capture. * * @throws NotSignedInError * @throws {@link IdentityAlreadyVerifiedError} * @throws ServiceError * @throws UnknownGraphQLError * @throws FatalError */ initiateIdentityDocumentCapture(): Promise; /** * Retrieves the content for identity data processing consent, for a given preferred language * (in RFC 5646 format) and content type. * * @param {IdentityDataProcessingConsentContentInput} input * Preferred content type and language for consent content. * @returns Consent content for the given preferences. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ getIdentityDataProcessingConsentContent(input: IdentityDataProcessingConsentContentInput): Promise; /** * Withdraws the user's identity data processing consent. * * @returns Response indicating if the withdrawal was processed. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ withdrawIdentityDataProcessingConsent(): Promise; /** * Retrieves the user's current identity data processing consent status. * * @returns Consent status for the user. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ getIdentityDataProcessingConsentStatus(): Promise; /** * Provides the user's identity data processing consent. * * @param {IdentityDataProcessingConsentContentInput} input * Consent content, content type, and language. * @returns Response indicating if the consent was processed. * * @throws NotSignedInError * @throws UnknownGraphQLError * @throws ServiceError * @throws FatalError */ provideIdentityDataProcessingConsent(input: IdentityDataProcessingConsentInput): Promise; /** * Checks if user is signed in and invokes callback if needed. * Only performs check if callback is configured. * * Throws: Any error thrown by the sign-in callback */ private ensureSignedIn; }