@portone/server-sdk
Version:
PortOne JavaScript SDK for server-side usage
339 lines (338 loc) • 21.2 kB
TypeScript
import { PartnerError } from "./PartnerError.js";
import type { Unrecognized } from "./../../../utils/unrecognized.js";
import { type PortOneClientInit } from "../../../client.js";
import type { ArchivePlatformPartnerResponse } from "../../../generated/platform/partner/ArchivePlatformPartnerResponse.js";
import type { ConnectBulkPartnerMemberCompanyResponse } from "../../../generated/platform/partner/ConnectBulkPartnerMemberCompanyResponse.js";
import type { ConnectPartnerMemberCompanyResponse } from "../../../generated/platform/partner/ConnectPartnerMemberCompanyResponse.js";
import type { CreatePlatformPartnerBody } from "../../../generated/platform/partner/CreatePlatformPartnerBody.js";
import type { CreatePlatformPartnerBodyAccount } from "../../../generated/platform/partner/CreatePlatformPartnerBodyAccount.js";
import type { CreatePlatformPartnerBodyContact } from "../../../generated/platform/partner/CreatePlatformPartnerBodyContact.js";
import type { CreatePlatformPartnerBodyType } from "../../../generated/platform/partner/CreatePlatformPartnerBodyType.js";
import type { CreatePlatformPartnerResponse } from "../../../generated/platform/partner/CreatePlatformPartnerResponse.js";
import type { CreatePlatformPartnersResponse } from "../../../generated/platform/partner/CreatePlatformPartnersResponse.js";
import type { DisconnectBulkPartnerMemberCompanyResponse } from "../../../generated/platform/partner/DisconnectBulkPartnerMemberCompanyResponse.js";
import type { DisconnectPartnerMemberCompanyResponse } from "../../../generated/platform/partner/DisconnectPartnerMemberCompanyResponse.js";
import type { ForbiddenError } from "../../../generated/common/ForbiddenError.js";
import type { GetPlatformPartnersResponse } from "../../../generated/platform/partner/GetPlatformPartnersResponse.js";
import type { InvalidRequestError } from "../../../generated/common/InvalidRequestError.js";
import type { PageInput } from "../../../generated/common/PageInput.js";
import type { PlatformAccountVerificationAlreadyUsedError } from "../../../generated/platform/PlatformAccountVerificationAlreadyUsedError.js";
import type { PlatformAccountVerificationFailedError } from "../../../generated/platform/PlatformAccountVerificationFailedError.js";
import type { PlatformAccountVerificationNotFoundError } from "../../../generated/platform/PlatformAccountVerificationNotFoundError.js";
import type { PlatformArchivedPartnerError } from "../../../generated/platform/PlatformArchivedPartnerError.js";
import type { PlatformBtxNotEnabledError } from "../../../generated/platform/partner/PlatformBtxNotEnabledError.js";
import type { PlatformCannotArchiveScheduledPartnerError } from "../../../generated/platform/partner/PlatformCannotArchiveScheduledPartnerError.js";
import type { PlatformCompanyVerificationAlreadyUsedError } from "../../../generated/platform/PlatformCompanyVerificationAlreadyUsedError.js";
import type { PlatformContractNotFoundError } from "../../../generated/platform/PlatformContractNotFoundError.js";
import type { PlatformContractsNotFoundError } from "../../../generated/platform/partner/PlatformContractsNotFoundError.js";
import type { PlatformCurrencyNotSupportedError } from "../../../generated/platform/PlatformCurrencyNotSupportedError.js";
import type { PlatformExternalApiFailedError } from "../../../generated/platform/PlatformExternalApiFailedError.js";
import type { PlatformInsufficientDataToChangePartnerTypeError } from "../../../generated/platform/PlatformInsufficientDataToChangePartnerTypeError.js";
import type { PlatformMemberCompanyConnectedPartnerBrnUnchangeableError } from "../../../generated/platform/PlatformMemberCompanyConnectedPartnerBrnUnchangeableError.js";
import type { PlatformMemberCompanyConnectedPartnerTypeUnchangeableError } from "../../../generated/platform/PlatformMemberCompanyConnectedPartnerTypeUnchangeableError.js";
import type { PlatformMemberCompanyNotConnectableStatusError } from "../../../generated/platform/partner/PlatformMemberCompanyNotConnectableStatusError.js";
import type { PlatformMemberCompanyNotConnectedError } from "../../../generated/platform/partner/PlatformMemberCompanyNotConnectedError.js";
import type { PlatformNotEnabledError } from "../../../generated/platform/PlatformNotEnabledError.js";
import type { PlatformOngoingTaxInvoiceExistsError } from "../../../generated/platform/partner/PlatformOngoingTaxInvoiceExistsError.js";
import type { PlatformPartner } from "../../../generated/platform/PlatformPartner.js";
import type { PlatformPartnerFilterInput } from "../../../generated/platform/PlatformPartnerFilterInput.js";
import type { PlatformPartnerIdAlreadyExistsError } from "../../../generated/platform/partner/PlatformPartnerIdAlreadyExistsError.js";
import type { PlatformPartnerIdsAlreadyExistError } from "../../../generated/platform/partner/PlatformPartnerIdsAlreadyExistError.js";
import type { PlatformPartnerIdsDuplicatedError } from "../../../generated/platform/partner/PlatformPartnerIdsDuplicatedError.js";
import type { PlatformPartnerNotFoundError } from "../../../generated/platform/PlatformPartnerNotFoundError.js";
import type { PlatformPartnerScheduleExistsError } from "../../../generated/platform/partner/PlatformPartnerScheduleExistsError.js";
import type { PlatformPartnerTaxationTypeIsSimpleError } from "../../../generated/platform/partner/PlatformPartnerTaxationTypeIsSimpleError.js";
import type { PlatformPartnerTypeIsNotBusinessError } from "../../../generated/platform/partner/PlatformPartnerTypeIsNotBusinessError.js";
import type { PlatformProperties } from "../../../generated/platform/PlatformProperties.js";
import type { PlatformTargetPartnerNotFoundError } from "../../../generated/platform/partner/PlatformTargetPartnerNotFoundError.js";
import type { PlatformUserDefinedPropertyNotFoundError } from "../../../generated/platform/PlatformUserDefinedPropertyNotFoundError.js";
import type { RecoverPlatformPartnerResponse } from "../../../generated/platform/partner/RecoverPlatformPartnerResponse.js";
import type { UnauthorizedError } from "../../../generated/common/UnauthorizedError.js";
import type { UpdatePlatformPartnerBodyAccount } from "../../../generated/platform/UpdatePlatformPartnerBodyAccount.js";
import type { UpdatePlatformPartnerBodyContact } from "../../../generated/platform/UpdatePlatformPartnerBodyContact.js";
import type { UpdatePlatformPartnerBodyType } from "../../../generated/platform/UpdatePlatformPartnerBodyType.js";
import type { UpdatePlatformPartnerResponse } from "../../../generated/platform/partner/UpdatePlatformPartnerResponse.js";
/**
* 포트원 API 클라이언트를 생성합니다.
*/
export declare function PartnerClient(init: PortOneClientInit): PartnerClient;
export type PartnerClient = {
/**
* 파트너 다건 조회
*
* 여러 파트너를 조회합니다.
*
* @throws {@link GetPlatformPartnersError}
*/
getPlatformPartners: (options?: {
/** 요청할 페이지 정보 */
page?: PageInput;
/** 조회할 파트너 조건 필터 */
filter?: PlatformPartnerFilterInput;
}) => Promise<GetPlatformPartnersResponse>;
/**
* 파트너 생성
*
* 새로운 파트너를 생성합니다.
*
* @throws {@link CreatePlatformPartnerError}
*/
createPlatformPartner: (options: {
/**
* 파트너에 부여할 고유 아이디
*
* 고객사 서버에 등록된 파트너 지칭 아이디와 동일하게 설정하는 것을 권장합니다. 명시하지 않는 경우 포트원이 임의의 아이디를 발급해드립니다.
*/
id?: string;
/** 파트너 법인명 혹은 이름 */
name: string;
/** 파트너 담당자 연락 정보 */
contact: CreatePlatformPartnerBodyContact;
/**
* 정산 계좌
*
* 파트너의 사업자등록번호가 존재하는 경우 명시합니다. 별도로 검증하지는 않으며, 번호와 기호 모두 입력 가능합니다.
*/
account: CreatePlatformPartnerBodyAccount;
/**
* 기본 계약 아이디
*
* 이미 존재하는 계약 아이디를 등록해야 합니다.
*/
defaultContractId: string;
/**
* 파트너에 대한 메모
*
* 총 256자까지 입력할 수 있습니다.
*/
memo?: string;
/**
* 파트너에 부여할 태그 리스트
*
* 최대 10개까지 입력할 수 있습니다.
*/
tags: string[];
/**
* 파트너 유형별 추가 정보
*
* 사업자/원천징수 대상자 중 추가할 파트너의 유형에 따른 정보를 입력해야 합니다.
*/
type: CreatePlatformPartnerBodyType;
/** 사용자 정의 속성 */
userDefinedProperties?: PlatformProperties;
}) => Promise<CreatePlatformPartnerResponse>;
/**
* 파트너 다건 생성
*
* 새로운 파트너를 다건 생성합니다.
*
* @throws {@link CreatePlatformPartnersError}
*/
createPlatformPartners: (options: {
/** 생성할 파트너 리스트 정보 */
partners: CreatePlatformPartnerBody[];
}) => Promise<CreatePlatformPartnersResponse>;
/**
* 파트너 연동 사업자 일괄 연동
*
* 파트너들을 연동 사업자로 일괄 연동합니다.
*
* @throws {@link ConnectBulkPartnerMemberCompanyError}
*/
connectBulkPartnerMemberCompany: (options?: {
/** 연동 사업자로 일괄 연동할 파트너 조건 필터 */
filter?: PlatformPartnerFilterInput;
}) => Promise<ConnectBulkPartnerMemberCompanyResponse>;
/**
* 파트너 연동 사업자 연동
*
* 파트너를 연동 사업자로 연동합니다.
*
* @throws {@link ConnectPartnerMemberCompanyError}
*/
connectPartnerMemberCompany: (options: {
/** 파트너 아이디 */
id: string;
}) => Promise<ConnectPartnerMemberCompanyResponse>;
/**
* 파트너 연동 사업자 연동 해제
*
* 파트너들을 연동 사업자에서 일괄 연동 해제합니다.
*
* @throws {@link DisconnectBulkPartnerMemberCompanyError}
*/
disconnectBulkPartnerMemberCompany: (options?: {
/** 연동 사업자에서 일괄 연동 해제할 파트너 조건 필터 */
filter?: PlatformPartnerFilterInput;
}) => Promise<DisconnectBulkPartnerMemberCompanyResponse>;
/**
* 연동 사업자 연동 해제
*
* 파트너를 연동 사업자에서 연동 해제합니다.
*
* @throws {@link DisconnectPartnerMemberCompanyError}
*/
disconnectPartnerMemberCompany: (options: {
/** 파트너 아이디 */
id: string;
}) => Promise<DisconnectPartnerMemberCompanyResponse>;
/**
* 파트너 조회
*
* 파트너 객체를 조회합니다.
*
* @throws {@link GetPlatformPartnerError}
*/
getPlatformPartner: (options: {
/** 조회하고 싶은 파트너 아이디 */
id: string;
}) => Promise<PlatformPartner>;
/**
* 파트너 수정
*
* 주어진 아이디에 대응되는 파트너 정보를 업데이트합니다.
*
* @throws {@link UpdatePlatformPartnerError}
*/
updatePlatformPartner: (options: {
/** 업데이트할 파트너 아이디 */
id: string;
/** 파트너 법인명 혹은 이름 */
name?: string;
/** 파트너 담당자 연락 정보 */
contact?: UpdatePlatformPartnerBodyContact;
/** 정산 계좌 */
account?: UpdatePlatformPartnerBodyAccount;
/** 파트너에 설정된 기본 계약 아이디 */
defaultContractId?: string;
/** 파트너에 대한 메모 */
memo?: string;
/** 파트너의 태그 리스트 */
tags?: string[];
/** 파트너 유형별 정보 */
type?: UpdatePlatformPartnerBodyType;
/** 사용자 정의 속성 */
userDefinedProperties?: PlatformProperties;
}) => Promise<UpdatePlatformPartnerResponse>;
/**
* 파트너 복원
*
* 주어진 아이디에 대응되는 파트너를 보관합니다.
*
* @throws {@link ArchivePlatformPartnerError}
*/
archivePlatformPartner: (options: {
/** 파트너 아이디 */
id: string;
}) => Promise<ArchivePlatformPartnerResponse>;
/**
* 파트너 복원
*
* 주어진 아이디에 대응되는 파트너를 복원합니다.
*
* @throws {@link RecoverPlatformPartnerError}
*/
recoverPlatformPartner: (options: {
/** 파트너 아이디 */
id: string;
}) => Promise<RecoverPlatformPartnerResponse>;
};
export declare class GetPlatformPartnersError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformNotEnabledError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformNotEnabledError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class CreatePlatformPartnerError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformAccountVerificationAlreadyUsedError | PlatformAccountVerificationFailedError | PlatformAccountVerificationNotFoundError | PlatformCompanyVerificationAlreadyUsedError | PlatformContractNotFoundError | PlatformCurrencyNotSupportedError | PlatformNotEnabledError | PlatformPartnerIdAlreadyExistsError | PlatformUserDefinedPropertyNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformAccountVerificationAlreadyUsedError | PlatformAccountVerificationFailedError | PlatformAccountVerificationNotFoundError | PlatformCompanyVerificationAlreadyUsedError | PlatformContractNotFoundError | PlatformCurrencyNotSupportedError | PlatformNotEnabledError | PlatformPartnerIdAlreadyExistsError | PlatformUserDefinedPropertyNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class CreatePlatformPartnersError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformContractsNotFoundError | PlatformCurrencyNotSupportedError | PlatformNotEnabledError | PlatformPartnerIdsAlreadyExistError | PlatformPartnerIdsDuplicatedError | PlatformUserDefinedPropertyNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformContractsNotFoundError | PlatformCurrencyNotSupportedError | PlatformNotEnabledError | PlatformPartnerIdsAlreadyExistError | PlatformPartnerIdsDuplicatedError | PlatformUserDefinedPropertyNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class ConnectBulkPartnerMemberCompanyError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformTargetPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformTargetPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class ConnectPartnerMemberCompanyError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformMemberCompanyNotConnectableStatusError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformPartnerScheduleExistsError | PlatformPartnerTaxationTypeIsSimpleError | PlatformPartnerTypeIsNotBusinessError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformMemberCompanyNotConnectableStatusError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformPartnerScheduleExistsError | PlatformPartnerTaxationTypeIsSimpleError | PlatformPartnerTypeIsNotBusinessError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class DisconnectBulkPartnerMemberCompanyError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformTargetPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformTargetPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class DisconnectPartnerMemberCompanyError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformMemberCompanyNotConnectedError | PlatformNotEnabledError | PlatformOngoingTaxInvoiceExistsError | PlatformPartnerNotFoundError | PlatformPartnerTaxationTypeIsSimpleError | PlatformPartnerTypeIsNotBusinessError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformBtxNotEnabledError | PlatformExternalApiFailedError | PlatformMemberCompanyNotConnectedError | PlatformNotEnabledError | PlatformOngoingTaxInvoiceExistsError | PlatformPartnerNotFoundError | PlatformPartnerTaxationTypeIsSimpleError | PlatformPartnerTypeIsNotBusinessError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class GetPlatformPartnerError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformNotEnabledError | PlatformPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformNotEnabledError | PlatformPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class UpdatePlatformPartnerError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformAccountVerificationAlreadyUsedError | PlatformAccountVerificationFailedError | PlatformAccountVerificationNotFoundError | PlatformArchivedPartnerError | PlatformCompanyVerificationAlreadyUsedError | PlatformContractNotFoundError | PlatformInsufficientDataToChangePartnerTypeError | PlatformMemberCompanyConnectedPartnerBrnUnchangeableError | PlatformMemberCompanyConnectedPartnerTypeUnchangeableError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformUserDefinedPropertyNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformAccountVerificationAlreadyUsedError | PlatformAccountVerificationFailedError | PlatformAccountVerificationNotFoundError | PlatformArchivedPartnerError | PlatformCompanyVerificationAlreadyUsedError | PlatformContractNotFoundError | PlatformInsufficientDataToChangePartnerTypeError | PlatformMemberCompanyConnectedPartnerBrnUnchangeableError | PlatformMemberCompanyConnectedPartnerTypeUnchangeableError | PlatformNotEnabledError | PlatformPartnerNotFoundError | PlatformUserDefinedPropertyNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class ArchivePlatformPartnerError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformCannotArchiveScheduledPartnerError | PlatformNotEnabledError | PlatformPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformCannotArchiveScheduledPartnerError | PlatformNotEnabledError | PlatformPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}
export declare class RecoverPlatformPartnerError extends PartnerError {
readonly data: ForbiddenError | InvalidRequestError | PlatformNotEnabledError | PlatformPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
};
/** @ignore */
constructor(data: ForbiddenError | InvalidRequestError | PlatformNotEnabledError | PlatformPartnerNotFoundError | UnauthorizedError | {
readonly type: Unrecognized;
});
}