import type { RequestOptions, TagadaClientOptions } from './types/common.js'; export declare class HttpClient { /** * CRM domain base URL (`/api/public/v1`). Used by all top-level CRM * resources (orders, stores, customers…) and by `partners.crm.*`. * @internal */ /** @internal */ readonly apiKey: string; /** @internal */ readonly baseUrl: string; /** * Processing domain base URL (TagadaPay Processing), served by payment-stack * on its own origin (`api.tagadapay.io/api/tagadapay/v1`) — NOT the monolith. * The whole payfac write surface (tpas create/retrieve/list/provision/ * sub-merchants, requirements, documents + upload, keys, acquirers) was * migrated off the monolith to payment-stack, so this now derives from the * payment-stack origin (same host as the applications + reads planes). * Used by the top-level `processing.*` namespace and by `partners.processing.*`. * @internal */ readonly processingBaseUrl: string; /** * Applications / onboarding API base URL (`/api/v2`). Used by * `processing.applications.*` (intake via CRM key). * @internal */ readonly applicationsBaseUrl: string; /** * Migrated Processing **read** plane base URL — served by payment-stack on * its own origin (`api.tagadapay.io/api/tagadapay/v1`), NOT the monolith. * Used by the read resources (`processing.charges` / `.disputes` / * `.payouts` / `.balanceTransactions` / `.chargebackAlerts`). * * The path is identical to the monolith's processing plane, so once the * write/provisioning routes also move to payment-stack this whole surface * collapses onto a single host swap. Kept separate for now because those * write routes still live on the monolith (see `processingBaseUrl`). * @internal */ readonly processingReadsBaseUrl: string; private readonly timeout; private readonly maxRetries; private readonly apiVersion; constructor(opts: TagadaClientOptions); get(path: string, query?: Record, opts?: RequestOptions): Promise; post(path: string, body?: unknown, opts?: RequestOptions): Promise; put(path: string, body?: unknown, opts?: RequestOptions): Promise; patch(path: string, body?: unknown, opts?: RequestOptions): Promise; del(path: string, body?: unknown, opts?: RequestOptions): Promise; processingGet(path: string, query?: Record, opts?: RequestOptions): Promise; processingPost(path: string, body?: unknown, opts?: RequestOptions): Promise; /** * POST a `multipart/form-data` body to the processing domain. Used for raw * file uploads (e.g. KYB documents) where the browser/runtime must set the * boundary itself — we deliberately do NOT send a JSON Content-Type here. */ processingPostForm(path: string, form: FormData, opts?: RequestOptions): Promise; processingPut(path: string, body?: unknown, opts?: RequestOptions): Promise; processingPatch(path: string, body?: unknown, opts?: RequestOptions): Promise; processingDel(path: string, body?: unknown, opts?: RequestOptions): Promise; processingReadsGet(path: string, query?: Record, opts?: RequestOptions): Promise; /** * POST on the processing read plane with query params — used by the * charge/dispute action endpoints, which take the target TPA as * `?account=` (like the read lists) plus a JSON body. */ processingReadsPost(path: string, body?: unknown, query?: Record, opts?: RequestOptions): Promise; applicationsGet(path: string, query?: Record, opts?: RequestOptions): Promise; applicationsPost(path: string, body?: unknown, opts?: RequestOptions): Promise; getRedirectUrl(path: string, query?: Record, opts?: RequestOptions): Promise; private request; private executeRequest; private handleErrorResponse; /** * Extract the machine error code. Public API errors use the envelope * `{ error: { code, message } }`; some legacy surfaces put `code` at the * top level. */ private extractCode; /** * Extract a human-readable message from the API response. Handles ZSA error * shapes where message can be a JSON string of Zod issues. */ private extractMessage; /** * Extract structured validation errors from ZSA/Zod error responses. */ private extractValidationErrors; private buildUrl; private buildHeaders; private shouldRetry; private retryDelay; } //# sourceMappingURL=HttpClient.d.ts.map