/// /** * @file Common interfaces for SDK responses */ import * as types from '@globalid/attestations-types'; import { GrantTypes } from '../exposed_interfaces'; import { AuthClientDetails, KeyChainResponse, OAuth2Response } from './modules/api_interfaces'; import Attestations = types.API.V1.Attestations; type AttestationRequestBody = Attestations.Requests.POST.RequestBody; import Agency = types.Agency; import AttestationRequest = types.AttestationRequest; /**y * Enum for auth grant-types. */ export declare type ACRCConfig = types.API.V1.Identity.Me.Attested._acrc_uuid.GET.Response; export interface OAuthOptions { grant_type: GrantTypes; state?: string; } export interface AllPasswords { [key: string]: string[]; } export interface ErrorWithHashValidationDetails extends Error { details: { invalid_hashes?: string[]; invalid_types?: string[]; needs_more_hashes?: string[]; required_types?: string[]; }; } export interface ErrorWithPasswordValidationDetails extends Error { details: { missing_passwords?: string[]; must_be_unique?: string[]; must_be_a_string?: string[]; }; } export interface ExtendedError extends Error { original_error?: Error; } export interface ConfigInterface { acrc_uuid?: string; agencies_url?: string; api_base_url?: string; client_id: string; redirect_url: string; nonce?: string; scopes?: string[]; access_token?: string; default_oauth_options: OAuthOptions; default_signup_options?: any; gid_connect_base_url?: string; version?: string; refresh_token?: string; pii_request_uuid?: string; branch_key?: string; } /** * Enum for axios REST API methods */ export declare enum AxiosMethods { get = "get", post = "post", put = "put", delete = "delete" } export interface TokenData { access_token: string; token_type: GrantTypes; expires_in: number; refresh_token?: string; } export interface Attestation { uuid?: string; tracking_id: string; sig_version: number; type: string; attestee: string; attestor: string; related_attestations: string; attestor_signed_at: string; attestor_signature: string; attestor_signature_private_only?: string; public_attestor_note?: string; public_data?: string; } export interface IPAttestation extends Attestation { data_hash: string; salt_idx?: number; } export interface Signature { attestee_signature: string; attestee_signed_at: string; } export interface EncryptedData { enc_data: string; enc_password: string; } export interface RootHashes { [key: string]: string[]; } export interface Salts { [key: string]: string[]; } export interface RootHashByType { [key: string]: RootHash[]; } export interface AgencyRootHashes { type: string; rootHashes: string[]; rootPasswords: string[]; } export interface HashesAndPasswordsByType { rootHashes: { [key: string]: string[]; }; rootPasswords: { [key: string]: string[]; }; } export interface CryptoMaterial { cryptoMaterial: HashesAndPasswordsByType; agencyUUID: string; } export interface RootHash { appType: string; password: string; rootHash: string; } export interface KeyPair { publicKey: string; privateKey: string; } export interface StartAttestationProcess { access_token: string; phoneNumber: string; publicEncryptionKey: string; gid_uuid: string; } export interface ConfirmPhoneNumber { confirmationCode: string; attestationTrackingUUID: string; attestationUUID: string; gidUUID: string; rootHashSalt: string; phoneNumber: string; access_token: string; } export interface ImagePiiData { digest_alg: string; digest_hash: string; ext?: string; file_size: number; mime_type: string; } export interface Address { address: string; city: string; postal_code: string; country_code: string; } type Document = string | Buffer | Uint32Array; export interface AttestInfo { document: Document; document_2?: Document; document_3?: Document; document_4?: Document; address: Address; } export interface AttestInfoArgs extends AttestInfo { publicEncryptionKey: string; access_token: string; signingPrivateKey: string; } export interface DecryptIdentityStateArgs { encryptedIdentityState: string; keyChain: KeyChainResponse; password: string; } export interface EncryptedIdentityStateObject { created_at: string; deleted_at: string; encrypted_identity_state: string; encrypted_identity_state_password: string; forgot_password_key: string; gid_uuid: string; updated_at: string; } export interface DecryptedIdentityStateObject { private_encryption_key: string; public_encryption_key: string; private_signing_key: string; public_signing_key: string; encryption_key_type: string; signing_key_type: string; gid_uuid: string; } export interface FieldValuePair { field: string; value: string; } export interface RendererOptions { labelPrefix?: string; } export declare type TRenderer = (memoryKey: string, options?: RendererOptions) => string; export interface GiDSDKError extends Error { customMessage?: string; srcError?: Error; } export interface AttestationAppType { icon?: string; name: string; description: string; appType: string; } export interface MissingAttestation { app_name?: string; app_uuid?: string; agency_icon: string; agency_name: string; attestation_category: string; attestation_request_uuid?: string; updated_at?: string; failure_reason?: string; status?: string; } export interface MissingAttestationData { acrc?: types.ACRCConfiguration.Model; refresh: boolean; missing_attestations: MissingAttestation[]; current_attestations: MissingAttestation[]; failed_attestations: MissingAttestation[]; } export interface AttestationFormDefinitionData { attestationAppUUID: string; attestationFormConfig: object; attestationAgency: Agency.Model; attestationApp: { app_category?: types.Category.Model; description: string; name: string; app_types: AttestationAppType[]; }; } export interface CreateAttestationData { id: string; cryptoMaterial: AttestationRequestBody; } export interface SandboxFormDefinitionData { attestationFormConfig: object; } export interface LinkData { attestationData?: { id: string; cryptoMaterial: AttestationRequestBody; }; whitelistedDomains: string[]; url: string; queryPath?: object; } export interface PIIAttestationPair { pii: string; attestation: types.AttestationRequest.PendingAttestation; } export interface AttestationApprovalData { agency: Agency.Model; attestation_request: AttestationRequest.Model; pii: PIIAttestationPair[]; } export interface FileUploadResponse { file_uuid: string; } export interface SandboxFormDefinition { uuid: string; name: string; content: string; agency_app_uuid: string; last_update_by: string; min_android_version: string; min_ios_version: string; min_web_version: string; created_at?: string; updated_at?: string; } export declare namespace PIISharing { interface PII { pii_type: types.Type.Model; value: string; } interface GroupedPII { agency: types.Agency.Model; pii: PII[]; } interface GroupedPIIParent { [key: string]: GroupedPII; } interface PIIData { request_id: string; valid_to: string; auth_client: AuthClientDetails; pii: GroupedPIIParent; data_accessors: DataAccessor[]; attestations: string[]; acrc_config: ACRCConfig; } } /** * Response types for the authentication */ export declare enum AuthenticationResponseType { MISSING_ATTESTATION_FLOW = "MISSING_ATTESTATION_FLOW", PII_SHARING = "PII_SHARING", DECOUPLED_PII_SHARING = "DECOUPLED_PII_SHARING", DECOUPLED_MISSING_ATTESTATION_FLOW = "DECOUPLED_MISSING_ATTESTATION_FLOW", AUTOMATIC_APPROVE = "AUTOMATIC_APPROVE" } export interface AuthenticationResponse { response_type: AuthenticationResponseType; pii_data?: PIISharing.PIIData; oauth_response?: OAuth2Response; decoupled_maf_uuid?: string; } export interface AttestationTypes { [key: string]: types.Type.Model; } export interface GetSandboxAttestationFormsResponse { available_forms: SandboxFormDefinition[]; } export interface AttestationData { attestation_uuid: string; attestation_type: string; attestor: string; } export interface MapAttestationDataResponse { attestation_request_ids: string[]; required_attestation_data: AttestationData[]; required_attestation_agencies: string[]; required_attestation_types: string[]; picked_attestations: string[]; } export interface DecryptedVaultData { private_data_token: string; decrypted_data_password: string; root_password: string; decrypted_data: PrivateDataRecord; } export interface EncryptedVaultData { private_data_token: string; encrypted_data_token: string; encrypted_data_password: string; encrypted_root_password: string; } export interface DataAccessor { authorised_entity_id: string; consent_id: string; encrypted_data_password: string; encrypted_data_token: string; encrypted_root_password: string; private_data_token: string; } export interface ApproveConsentRequestParams { request_uuid: string; access_token: string; decouple?: boolean; data_accessors?: DataAccessor[]; attestations?: string[]; } /** * Types of PII */ export declare enum PrivateDataValueType { PII = "PII", METADATA = "METADATA" } export interface AttachmentData { password: string; path: string; bucket: string; } export interface PrivateDataRecord { value: string; type: string; gid_uuid: string; attestation_request_uuid: string; attestation_uuid?: string; meta_uuid?: string; timestamp: string; value_type: PrivateDataValueType; enc_root_password?: string; has_attachment: boolean; attachment_data?: AttachmentData; } export {};