UNPKG

@portone/server-sdk

Version:

PortOne JavaScript SDK for server-side usage

185 lines (184 loc) 9.44 kB
import { IdentityVerificationError } from "./IdentityVerificationError.js"; import type { Unrecognized } from "./../../utils/unrecognized.js"; import { type PortOneClientInit } from "../../client.js"; import type { ChannelNotFoundError } from "../../generated/common/ChannelNotFoundError.js"; import type { ConfirmIdentityVerificationResponse } from "../../generated/identityVerification/ConfirmIdentityVerificationResponse.js"; import type { ForbiddenError } from "../../generated/common/ForbiddenError.js"; import type { GetIdentityVerificationsResponse } from "../../generated/identityVerification/GetIdentityVerificationsResponse.js"; import type { IdentityVerification } from "../../generated/identityVerification/IdentityVerification.js"; import type { IdentityVerificationAlreadySentError } from "../../generated/identityVerification/IdentityVerificationAlreadySentError.js"; import type { IdentityVerificationAlreadyVerifiedError } from "../../generated/identityVerification/IdentityVerificationAlreadyVerifiedError.js"; import type { IdentityVerificationFilterInput } from "../../generated/identityVerification/IdentityVerificationFilterInput.js"; import type { IdentityVerificationMethod } from "../../generated/identityVerification/IdentityVerificationMethod.js"; import type { IdentityVerificationNotFoundError } from "../../generated/identityVerification/IdentityVerificationNotFoundError.js"; import type { IdentityVerificationNotSentError } from "../../generated/identityVerification/IdentityVerificationNotSentError.js"; import type { IdentityVerificationOperator } from "../../generated/identityVerification/IdentityVerificationOperator.js"; import type { IdentityVerificationSortInput } from "../../generated/identityVerification/IdentityVerificationSortInput.js"; import type { InvalidRequestError } from "../../generated/common/InvalidRequestError.js"; import type { MaxTransactionCountReachedError } from "../../generated/common/MaxTransactionCountReachedError.js"; import type { PageInput } from "../../generated/common/PageInput.js"; import type { PgProviderError } from "../../generated/common/PgProviderError.js"; import type { ResendIdentityVerificationResponse } from "../../generated/identityVerification/ResendIdentityVerificationResponse.js"; import type { SendIdentityVerificationBodyCustomer } from "../../generated/identityVerification/SendIdentityVerificationBodyCustomer.js"; import type { SendIdentityVerificationResponse } from "../../generated/identityVerification/SendIdentityVerificationResponse.js"; import type { UnauthorizedError } from "../../generated/common/UnauthorizedError.js"; /** * 포트원 API 클라이언트를 생성합니다. */ export declare function IdentityVerificationClient(init: PortOneClientInit): IdentityVerificationClient; export type IdentityVerificationClient = { /** * 본인인증 확인 * * 요청된 본인인증에 대한 확인을 진행합니다. * * @throws {@link ConfirmIdentityVerificationError} */ confirmIdentityVerification: (options: { /** 본인인증 아이디 */ identityVerificationId: string; /** * 상점 아이디 * * 접근 권한이 있는 상점 아이디만 입력 가능하며, 미입력시 토큰에 담긴 상점 아이디를 사용합니다. */ storeId?: string; /** * OTP (One-Time Password) * * SMS 방식에서만 사용됩니다. */ otp?: string; }) => Promise<ConfirmIdentityVerificationResponse>; /** * SMS 본인인증 요청 재전송 * * SMS 본인인증 요청을 재전송합니다. * * @throws {@link ResendIdentityVerificationError} */ resendIdentityVerification: (options: { /** 본인인증 아이디 */ identityVerificationId: string; /** * 상점 아이디 * * 접근 권한이 있는 상점 아이디만 입력 가능하며, 미입력시 토큰에 담긴 상점 아이디를 사용합니다. */ storeId?: string; }) => Promise<ResendIdentityVerificationResponse>; /** * 본인인증 요청 전송 * * SMS 또는 APP 방식을 이용하여 본인인증 요청을 전송합니다. * * @throws {@link SendIdentityVerificationError} */ sendIdentityVerification: (options: { /** 본인인증 아이디 */ identityVerificationId: string; /** * 상점 아이디 * * 접근 권한이 있는 상점 아이디만 입력 가능하며, 미입력시 토큰에 담긴 상점 아이디를 사용합니다. */ storeId?: string; /** 채널 키 */ channelKey: string; /** 고객 정보 */ customer: SendIdentityVerificationBodyCustomer; /** 사용자 지정 데이터 */ customData?: string; /** PG사별 추가 파라미터 ("PG사별 연동 가이드" 참고) */ bypass?: object; /** 통신사 */ operator: IdentityVerificationOperator; /** 본인인증 방식 */ method: IdentityVerificationMethod; }) => Promise<SendIdentityVerificationResponse>; /** * 본인인증 단건 조회 * * 주어진 아이디에 대응되는 본인인증 내역을 조회합니다. * * @throws {@link GetIdentityVerificationError} */ getIdentityVerification: (options: { /** 조회할 본인인증 아이디 */ identityVerificationId: string; /** * 상점 아이디 * * 접근 권한이 있는 상점 아이디만 입력 가능하며, 미입력시 토큰에 담긴 상점 아이디를 사용합니다. */ storeId?: string; }) => Promise<IdentityVerification>; /** * 본인인증 내역 다건 조회 * * 주어진 조건에 맞는 본인인증 내역들을 페이지 기반으로 조회합니다. * * @throws {@link GetIdentityVerificationsError} */ getIdentityVerifications: (options?: { /** * 요청할 페이지 정보 * * 미 입력 시 number: 0, size: 10 으로 기본값이 적용됩니다. */ page?: PageInput; /** * 정렬 조건 * * 미 입력 시 sortBy: REQUESTED_AT, sortOrder: DESC 으로 기본값이 적용됩니다. */ sort?: IdentityVerificationSortInput; /** 조회할 본인인증 내역 조건 필터 */ filter?: IdentityVerificationFilterInput; }) => Promise<GetIdentityVerificationsResponse>; }; export declare class ConfirmIdentityVerificationError extends IdentityVerificationError { readonly data: ForbiddenError | IdentityVerificationAlreadyVerifiedError | IdentityVerificationNotFoundError | IdentityVerificationNotSentError | InvalidRequestError | PgProviderError | UnauthorizedError | { readonly type: Unrecognized; }; /** @ignore */ constructor(data: ForbiddenError | IdentityVerificationAlreadyVerifiedError | IdentityVerificationNotFoundError | IdentityVerificationNotSentError | InvalidRequestError | PgProviderError | UnauthorizedError | { readonly type: Unrecognized; }); } export declare class ResendIdentityVerificationError extends IdentityVerificationError { readonly data: ForbiddenError | IdentityVerificationAlreadyVerifiedError | IdentityVerificationNotFoundError | IdentityVerificationNotSentError | InvalidRequestError | PgProviderError | UnauthorizedError | { readonly type: Unrecognized; }; /** @ignore */ constructor(data: ForbiddenError | IdentityVerificationAlreadyVerifiedError | IdentityVerificationNotFoundError | IdentityVerificationNotSentError | InvalidRequestError | PgProviderError | UnauthorizedError | { readonly type: Unrecognized; }); } export declare class SendIdentityVerificationError extends IdentityVerificationError { readonly data: ChannelNotFoundError | ForbiddenError | IdentityVerificationAlreadySentError | IdentityVerificationAlreadyVerifiedError | IdentityVerificationNotFoundError | InvalidRequestError | MaxTransactionCountReachedError | PgProviderError | UnauthorizedError | { readonly type: Unrecognized; }; /** @ignore */ constructor(data: ChannelNotFoundError | ForbiddenError | IdentityVerificationAlreadySentError | IdentityVerificationAlreadyVerifiedError | IdentityVerificationNotFoundError | InvalidRequestError | MaxTransactionCountReachedError | PgProviderError | UnauthorizedError | { readonly type: Unrecognized; }); } export declare class GetIdentityVerificationError extends IdentityVerificationError { readonly data: ForbiddenError | IdentityVerificationNotFoundError | InvalidRequestError | UnauthorizedError | { readonly type: Unrecognized; }; /** @ignore */ constructor(data: ForbiddenError | IdentityVerificationNotFoundError | InvalidRequestError | UnauthorizedError | { readonly type: Unrecognized; }); } export declare class GetIdentityVerificationsError extends IdentityVerificationError { readonly data: ForbiddenError | InvalidRequestError | UnauthorizedError | { readonly type: Unrecognized; }; /** @ignore */ constructor(data: ForbiddenError | InvalidRequestError | UnauthorizedError | { readonly type: Unrecognized; }); }