UNPKG

mpp-sdk

Version:

SDK to talk to the Memento Payments Platform

75 lines (74 loc) 2.9 kB
import { AuthToken, DeviceInput, Verification, VerificationType } from "."; import { AddressInput } from "./address"; export declare const OnboardingAttributeKind: { readonly FullName: "@mpp/FULL_NAME"; readonly PreferredName: "@mpp/PREFERRED_NAME"; readonly DateOfBirth: "@mpp/DATE_OF_BIRTH"; readonly Email: "@mpp/EMAIL"; readonly Username: "@mpp/USERNAME"; readonly NIN: "@mpp/NIN"; readonly Phone: "@mpp/PHONE"; readonly AppPIN: "@mpp/APP_PIN"; readonly Password: "@mpp/PASSWORD"; readonly Address: "@mpp/ADDRESS"; readonly Device: "@mpp/DEVICE"; }; declare type StringAttributes = typeof OnboardingAttributeKind.FullName | typeof OnboardingAttributeKind.PreferredName | typeof OnboardingAttributeKind.DateOfBirth | typeof OnboardingAttributeKind.Email | typeof OnboardingAttributeKind.Username | typeof OnboardingAttributeKind.NIN | typeof OnboardingAttributeKind.Phone | typeof OnboardingAttributeKind.AppPIN | typeof OnboardingAttributeKind.Password; interface StringAttributeInput { kind: StringAttributes; value: string; } interface AddressAttributeInput { kind: typeof OnboardingAttributeKind.Address; value: AddressInput; } interface DeviceAttributeInput { kind: typeof OnboardingAttributeKind.Device; value: DeviceInput; } export declare type OnboardingAttributesInput = StringAttributeInput | AddressAttributeInput | DeviceAttributeInput; export interface OnboardingAddAttributesInput { batch?: string; attributes: OnboardingAttributesInput[]; } export declare type OnboardingStatus = "pending" | "processing" | "rejected" | "approved" | "user_created" | "expired"; export interface OnboardingState { is_completed: boolean; pending_verifications: Verification[]; missing_verifications: { type: VerificationType; verification_id: string; }[]; required_attributes: OnboardingAttributesInput[]; missing_attributes: OnboardingAttributesInput[]; } interface BaseOnboardingResult { id: string; status: OnboardingStatus; onboarding_state: OnboardingState; expires_at: string | Date; } interface ApprovedOnboardingResult extends BaseOnboardingResult { status: "approved"; user_id: string; authentication_token: AuthToken; } interface UserCreatedOnboardingResult extends BaseOnboardingResult { status: "user_created"; user_id: string; authentication_token: AuthToken; } interface NoUserCreatedOnboardingResult extends BaseOnboardingResult { status: Exclude<OnboardingStatus, "approved" | "user_created">; } export declare type OnboardingResult = ApprovedOnboardingResult | UserCreatedOnboardingResult | NoUserCreatedOnboardingResult; interface OnboardingInviteInput { id: string; token: string; } export interface OnboardingCreateInput { device: DeviceInput; email?: string; invite?: OnboardingInviteInput; } export {};