/** * App Store Connect API 에러 친절화. * * Apple은 표준 JSON 에러 응답을 내려준다: * { "errors": [{ "code": "...", "title": "...", "detail": "...", * "source": { "pointer": "/data/attributes/whatsNew" } }] } * * 실제 거부 사례에서 자주 만나는 코드별 hint 를 첨가해 * "App Store API 409: { errors: [...] }" 같은 raw dump 대신 * 무엇을 고쳐야 하는지 즉시 보이게 한다. * * 비표준 body (HTML, plain text, 빈 응답 등) 는 폴백으로 원본 보존. */ /** Apple JSON Error response 구조 (단일 errors 배열). */ interface AppleError { id?: string; code?: string; status?: string; title?: string; detail?: string; source?: { pointer?: string; parameter?: string; }; } /** Apple 표준 에러 응답 파싱 시도. 실패하면 null 반환. */ declare function parseAppleErrorBody(body: string): AppleError[] | null; /** 단일 Apple error → 한 줄 사람용 표기. */ declare function formatAppleError(e: AppleError): string; /** * App Store API 응답 (status + raw body) 을 친절한 Error 로 변환. * * - 표준 Apple JSON: `App Store API {status}: [CODE] detail @ pointer 💡 hint` 형식. * 여러 errors 가 있으면 줄바꿈으로 나열. * - 비표준 body: 기존 형식(`App Store API {status}: {body}`) 그대로 보존. * * `Error.cause` 에 원본 `{ status, body, parsedErrors }` 첨부 — 호출자가 코드별 분기 필요 시 사용. */ export declare function friendlyAppStoreError(status: number, body: string): Error; export declare const __testing: { CODE_HINTS: Record; parseAppleErrorBody: typeof parseAppleErrorBody; formatAppleError: typeof formatAppleError; }; export {};