@vexpay/node 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ function errorFromResponse(status, body, requestId) {
62
62
  }
63
63
 
64
64
  // src/version.ts
65
- var VERSION = "0.1.1";
65
+ var VERSION = "0.2.0";
66
66
 
67
67
  // src/core.ts
68
68
  var INITIAL_RETRY_DELAY_MS = 500;
@@ -215,6 +215,11 @@ var ROUTES = {
215
215
  Balance_getBalance: { method: "GET", path: "/v1/balance" },
216
216
  CheckoutSessions_create: { method: "POST", path: "/v1/checkout/sessions" },
217
217
  CheckoutSessions_retrieve: { method: "GET", path: "/v1/checkout/sessions/{id}" },
218
+ Crypto_createDepositAddress: { method: "POST", path: "/v1/crypto/deposit-addresses" },
219
+ Crypto_createPayout: { method: "POST", path: "/v1/crypto/payouts" },
220
+ Crypto_getBalance: { method: "GET", path: "/v1/crypto/balance" },
221
+ Crypto_getPayout: { method: "GET", path: "/v1/crypto/payouts/{id}" },
222
+ Crypto_listNetworks: { method: "GET", path: "/v1/crypto/networks" },
218
223
  Merchants_addPayoutMethod: { method: "POST", path: "/v1/merchants/{id}/payout-methods" },
219
224
  Merchants_confirmVerify: { method: "POST", path: "/v1/merchants/{id}/verify" },
220
225
  Merchants_confirmVerifyMethod: { method: "POST", path: "/v1/merchants/{id}/payout-methods/{methodId}/verify" },
@@ -436,6 +441,38 @@ var PaymentLinks = class extends APIResource {
436
441
  }
437
442
  };
438
443
 
444
+ // src/resources/crypto.ts
445
+ var CryptoBalance = class extends APIResource {
446
+ retrieve(options) {
447
+ return this.call("Crypto_getBalance", {}, options);
448
+ }
449
+ };
450
+ var DepositAddresses = class extends APIResource {
451
+ /** Get or create — calling again for the same customer and network returns the same address. */
452
+ create(params, options) {
453
+ return this.call("Crypto_createDepositAddress", { body: params }, options);
454
+ }
455
+ };
456
+ var CryptoNetworks = class extends APIResource {
457
+ list(params = {}, options) {
458
+ return this.call("Crypto_listNetworks", { query: params }, options);
459
+ }
460
+ };
461
+ var CryptoPayouts = class extends APIResource {
462
+ create(params, options) {
463
+ return this.call("Crypto_createPayout", { body: params }, options);
464
+ }
465
+ retrieve(id, options) {
466
+ return this.call("Crypto_getPayout", { path: { id } }, options);
467
+ }
468
+ };
469
+ var Crypto = class extends APIResource {
470
+ balance = new CryptoBalance(this.http);
471
+ depositAddresses = new DepositAddresses(this.http);
472
+ networks = new CryptoNetworks(this.http);
473
+ payouts = new CryptoPayouts(this.http);
474
+ };
475
+
439
476
  // src/resources/merchants.ts
440
477
  var PayoutMethods = class extends APIResource {
441
478
  list(merchantId, options) {
@@ -510,7 +547,7 @@ var Merchants = class extends APIResource {
510
547
 
511
548
  // src/resources/payments.ts
512
549
  var C2p = class extends APIResource {
513
- /** Create a C2P intent; the payer's bank sends them a token (R4 also triggers the SMS). */
550
+ /** Create a C2P intent; the payer's bank sends them a token (see `otpRequested`). */
514
551
  request(params, options) {
515
552
  return this.call("Payments_requestC2p", { body: params }, options);
516
553
  }
@@ -625,6 +662,7 @@ var WEBHOOK_EVENT_NAMES = [
625
662
  "tenant.api_key.created",
626
663
  "tenant.api_key.rotated",
627
664
  "tenant.api_key.revoked",
665
+ "tenant.live_status_changed",
628
666
  "notification.test"
629
667
  ];
630
668
  var SIGNATURE_HEADER = "VexPay-Signature";
@@ -716,6 +754,8 @@ var VexPay = class {
716
754
  checkout;
717
755
  merchants;
718
756
  payouts;
757
+ /** USDT: deposit addresses, balance, networks and payouts. */
758
+ crypto;
719
759
  products;
720
760
  paymentLinks;
721
761
  tenantPayoutAccount;
@@ -747,6 +787,7 @@ var VexPay = class {
747
787
  this.checkout = new Checkout(this.http);
748
788
  this.merchants = new Merchants(this.http);
749
789
  this.payouts = new Payouts(this.http);
790
+ this.crypto = new Crypto(this.http);
750
791
  this.products = new Products(this.http);
751
792
  this.paymentLinks = new PaymentLinks(this.http);
752
793
  this.tenantPayoutAccount = new TenantPayoutAccount(this.http);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/version.ts","../src/core.ts","../src/pagination.ts","../src/generated/routes.ts","../src/resource.ts","../src/resources/account.ts","../src/resources/commerce.ts","../src/resources/merchants.ts","../src/resources/payments.ts","../src/webhooks.ts","../src/client.ts"],"sourcesContent":["/** Every error the SDK throws extends VexPayError. */\nexport class VexPayError extends Error {\n /** HTTP status, when the API answered. */\n readonly status?: number;\n /** Machine-readable API code, e.g. `insufficient_balance`. */\n readonly code?: string;\n /** Parsed response body, when the API answered. */\n readonly body?: unknown;\n /** Request id from the `x-request-id` response header, when present. */\n readonly requestId?: string;\n\n constructor(\n message: string,\n details: { status?: number; code?: string; body?: unknown; requestId?: string } = {},\n ) {\n super(message);\n this.name = new.target.name;\n this.status = details.status;\n this.code = details.code;\n this.body = details.body;\n this.requestId = details.requestId;\n }\n}\n\n/** Invalid client configuration (e.g. missing API key). Thrown before any request. */\nexport class VexPayConfigurationError extends VexPayError {}\n\n/** 401 — missing, invalid, or revoked API key. */\nexport class VexPayAuthenticationError extends VexPayError {}\n\n/** 400, 403, 410, 422 and other non-retryable 4xx — fix the request before retrying. */\nexport class VexPayInvalidRequestError extends VexPayError {}\n\n/** 404 — the resource does not exist (or belongs to another account). */\nexport class VexPayNotFoundError extends VexPayError {}\n\n/** 409 — e.g. `external_ref_conflict`, `idempotency_key_reused`. */\nexport class VexPayConflictError extends VexPayError {}\n\n/** 429 — too many requests. Retried automatically before surfacing. */\nexport class VexPayRateLimitError extends VexPayError {}\n\n/** 5xx — VEXPay or an upstream bank failed. Retried automatically before surfacing. */\nexport class VexPayAPIError extends VexPayError {}\n\n/** The request never got an HTTP answer (DNS, refused, reset). */\nexport class VexPayConnectionError extends VexPayError {}\n\n/** The request exceeded `timeoutMs`. */\nexport class VexPayTimeoutError extends VexPayConnectionError {}\n\n/** A webhook signature did not verify (see `webhooks.constructEvent`). */\nexport class VexPaySignatureVerificationError extends VexPayError {}\n\nconst MACHINE_CODE = /^[a-z][a-z0-9_]*$/;\n\nfunction messageFrom(body: unknown, status: number): string {\n if (body && typeof body === 'object') {\n const { message, error } = body as { message?: unknown; error?: unknown };\n if (Array.isArray(message)) return message.join('; ');\n if (typeof message === 'string' && message) return message;\n if (typeof error === 'string' && error) return error;\n }\n if (typeof body === 'string' && body) return body;\n return `VEXPay API responded with HTTP ${status}`;\n}\n\n/** Maps an HTTP error response to the matching error class. */\nexport function errorFromResponse(status: number, body: unknown, requestId?: string): VexPayError {\n const rawCode = body && typeof body === 'object' ? (body as { error?: unknown }).error : undefined;\n const code = typeof rawCode === 'string' && MACHINE_CODE.test(rawCode) ? rawCode : undefined;\n const details = { status, code, body, requestId };\n const message = messageFrom(body, status);\n\n if (status === 401) return new VexPayAuthenticationError(message, details);\n if (status === 404) return new VexPayNotFoundError(message, details);\n if (status === 409) return new VexPayConflictError(message, details);\n if (status === 429) return new VexPayRateLimitError(message, details);\n if (status >= 500) return new VexPayAPIError(message, details);\n return new VexPayInvalidRequestError(message, details);\n}\n","export const VERSION = '0.1.1';\n","import {\n VexPayConnectionError,\n VexPayError,\n VexPayTimeoutError,\n errorFromResponse,\n} from './errors';\nimport { VERSION } from './version';\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport type QueryValue = string | number | boolean | null | undefined;\n\n/** Per-request options accepted by every resource method. */\nexport interface RequestOptions {\n /** Sent as `Idempotency-Key` on POST. Defaults to a random UUID per call, reused across retries. */\n idempotencyKey?: string;\n /** Overrides the client's `timeoutMs` for this call. */\n timeoutMs?: number;\n /** Overrides the client's `maxNetworkRetries` for this call. */\n maxNetworkRetries?: number;\n /** Aborts the call (and any pending retry). */\n signal?: AbortSignal;\n}\n\nexport interface CoreConfig {\n apiKey: string;\n baseUrl: string;\n timeoutMs: number;\n maxNetworkRetries: number;\n fetch: typeof fetch;\n /** Test hook — defaults to setTimeout. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst INITIAL_RETRY_DELAY_MS = 500;\nconst MAX_RETRY_DELAY_MS = 8_000;\nconst MAX_RETRY_AFTER_MS = 60_000;\n\nfunction defaultSleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction userAgent(): string {\n const runtime = typeof process !== 'undefined' && process.version ? ` node/${process.version}` : '';\n return `vexpay-node/${VERSION}${runtime}`;\n}\n\n/** Retry-After as seconds or an HTTP date → milliseconds, capped. */\nexport function parseRetryAfter(value: string | null, now = Date.now()): number | undefined {\n if (!value) return undefined;\n const seconds = Number(value);\n if (Number.isFinite(seconds) && seconds >= 0) return Math.min(seconds * 1000, MAX_RETRY_AFTER_MS);\n const date = Date.parse(value);\n if (Number.isFinite(date)) return Math.min(Math.max(0, date - now), MAX_RETRY_AFTER_MS);\n return undefined;\n}\n\n/** Exponential backoff with full jitter: attempt 0 → [250, 500) ms, doubling, capped. */\nexport function backoffDelay(attempt: number, random = Math.random): number {\n const ceiling = Math.min(INITIAL_RETRY_DELAY_MS * 2 ** attempt, MAX_RETRY_DELAY_MS);\n return Math.round(ceiling / 2 + random() * (ceiling / 2));\n}\n\nfunction isRetryable(error: VexPayError): boolean {\n if (error instanceof VexPayConnectionError) return true;\n if (error.status === 429) return true;\n if (error.status !== undefined && error.status >= 500) return true;\n return error.status === 409 && error.code === 'idempotency_request_in_progress';\n}\n\nfunction buildUrl(baseUrl: string, path: string, query?: Record<string, QueryValue>): string {\n const url = new URL(path.replace(/^\\//, ''), baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`);\n for (const [key, value] of Object.entries(query ?? {})) {\n if (value !== undefined && value !== null) url.searchParams.set(key, String(value));\n }\n return url.toString();\n}\n\nasync function readBody(response: Response): Promise<unknown> {\n const text = await response.text();\n if (!text) return undefined;\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n}\n\nexport class HttpClient {\n private readonly sleep: (ms: number) => Promise<void>;\n\n constructor(private readonly config: CoreConfig) {\n this.sleep = config.sleep ?? defaultSleep;\n }\n\n async request<T>(\n method: HttpMethod,\n path: string,\n params: { query?: Record<string, QueryValue>; body?: unknown } = {},\n options: RequestOptions = {},\n ): Promise<T> {\n const maxRetries = options.maxNetworkRetries ?? this.config.maxNetworkRetries;\n const timeoutMs = options.timeoutMs ?? this.config.timeoutMs;\n const url = buildUrl(this.config.baseUrl, path, params.query);\n\n const headers: Record<string, string> = {\n accept: 'application/json',\n 'x-api-key': this.config.apiKey,\n 'user-agent': userAgent(),\n };\n if (params.body !== undefined) headers['content-type'] = 'application/json';\n // One key for every attempt of this call: a retried POST can never charge twice.\n if (method === 'POST') headers['idempotency-key'] = options.idempotencyKey ?? crypto.randomUUID();\n const body = params.body === undefined ? undefined : JSON.stringify(params.body);\n\n for (let attempt = 0; ; attempt += 1) {\n let error: VexPayError;\n let retryAfterMs: number | undefined;\n\n try {\n const response = await this.send(url, { method, headers, body }, timeoutMs, options.signal);\n const parsed = await readBody(response);\n if (response.ok) return parsed as T;\n error = errorFromResponse(response.status, parsed, response.headers.get('x-request-id') ?? undefined);\n retryAfterMs = parseRetryAfter(response.headers.get('retry-after'));\n } catch (caught) {\n if (!(caught instanceof VexPayError)) throw caught;\n error = caught;\n }\n\n if (attempt >= maxRetries || !isRetryable(error) || options.signal?.aborted) throw error;\n await this.sleep(retryAfterMs ?? backoffDelay(attempt));\n }\n }\n\n private async send(\n url: string,\n init: { method: HttpMethod; headers: Record<string, string>; body?: string },\n timeoutMs: number,\n signal?: AbortSignal,\n ): Promise<Response> {\n const controller = new AbortController();\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n controller.abort();\n }, timeoutMs);\n const onAbort = () => controller.abort();\n signal?.addEventListener('abort', onAbort, { once: true });\n\n try {\n return await this.config.fetch(url, { ...init, signal: controller.signal });\n } catch (caught) {\n if (timedOut) {\n throw new VexPayTimeoutError(`Request to VEXPay timed out after ${timeoutMs}ms`);\n }\n if (signal?.aborted) throw caught;\n const reason = caught instanceof Error ? caught.message : String(caught);\n throw new VexPayConnectionError(`Could not reach VEXPay: ${reason}`);\n } finally {\n clearTimeout(timer);\n signal?.removeEventListener('abort', onAbort);\n }\n }\n}\n","export type CursorPage<Item> = { items: Item[]; nextCursor?: string | null };\n\n/**\n * Result of a cursor-paginated `list()`.\n *\n * const page = await vexpay.merchants.list({ limit: 100 }); // first page\n * for await (const merchant of vexpay.merchants.list()) { … } // every item, all pages\n *\n * The first request is sent when the result is awaited or iterated.\n */\nexport class PagePromise<Page extends CursorPage<Item>, Item = Page['items'][number]>\n implements PromiseLike<Page>, AsyncIterable<Item>\n{\n private firstPage?: Promise<Page>;\n\n constructor(\n private readonly fetchPage: (cursor: string | undefined) => Promise<Page>,\n private readonly startCursor?: string,\n ) {}\n\n private first(): Promise<Page> {\n return (this.firstPage ??= this.fetchPage(this.startCursor));\n }\n\n then<TResult1 = Page, TResult2 = never>(\n onfulfilled?: ((value: Page) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,\n ): Promise<TResult1 | TResult2> {\n return this.first().then(onfulfilled, onrejected);\n }\n\n catch<TResult = never>(\n onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null,\n ): Promise<Page | TResult> {\n return this.first().catch(onrejected);\n }\n\n finally(onfinally?: (() => void) | null): Promise<Page> {\n return this.first().finally(onfinally);\n }\n\n async *[Symbol.asyncIterator](): AsyncIterator<Item> {\n let page = await this.first();\n let cursor = this.startCursor;\n for (;;) {\n for (const item of page.items) yield item;\n const next = page.nextCursor;\n // Stop on the last page, or if the API ever repeats a cursor.\n if (!next || next === cursor) return;\n cursor = next;\n page = await this.fetchPage(next);\n }\n }\n\n /** Collects items across pages, stopping after `limit` (default 10 000). */\n async autoPagingToArray({ limit = 10_000 }: { limit?: number } = {}): Promise<Item[]> {\n const items: Item[] = [];\n for await (const item of this) {\n items.push(item);\n if (items.length >= limit) break;\n }\n return items;\n }\n}\n","// Generated by scripts/generate-routes.mjs from packages/sdk-spec/openapi.json — do not edit.\nimport type { operations } from './openapi';\n\nexport type OperationId = keyof operations;\n\nexport const ROUTES = {\n Balance_getBalance: { method: 'GET', path: '/v1/balance' },\n CheckoutSessions_create: { method: 'POST', path: '/v1/checkout/sessions' },\n CheckoutSessions_retrieve: { method: 'GET', path: '/v1/checkout/sessions/{id}' },\n Merchants_addPayoutMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods' },\n Merchants_confirmVerify: { method: 'POST', path: '/v1/merchants/{id}/verify' },\n Merchants_confirmVerifyMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods/{methodId}/verify' },\n Merchants_create: { method: 'POST', path: '/v1/merchants' },\n Merchants_deletePayoutMethod: { method: 'DELETE', path: '/v1/merchants/{id}/payout-methods/{methodId}' },\n Merchants_getBalance: { method: 'GET', path: '/v1/merchants/{id}/balance' },\n Merchants_getById: { method: 'GET', path: '/v1/merchants/{id}' },\n Merchants_listAuditEvents: { method: 'GET', path: '/v1/merchants/{id}/audit-events' },\n Merchants_listOrGetByRef: { method: 'GET', path: '/v1/merchants' },\n Merchants_listPayoutMethods: { method: 'GET', path: '/v1/merchants/{id}/payout-methods' },\n Merchants_remove: { method: 'DELETE', path: '/v1/merchants/{id}' },\n Merchants_setDefaultPayoutMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods/{methodId}/default' },\n Merchants_startVerify: { method: 'POST', path: '/v1/merchants/{id}/verify/start' },\n Merchants_startVerifyMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods/{methodId}/verify/start' },\n Merchants_transfer: { method: 'POST', path: '/v1/merchants/{id}/transfers' },\n Merchants_update: { method: 'PATCH', path: '/v1/merchants/{id}' },\n Notifications_sendTest: { method: 'POST', path: '/v1/notifications/test' },\n PaymentLinks_get: { method: 'GET', path: '/v1/payment-links/{id}' },\n PaymentLinks_remove: { method: 'DELETE', path: '/v1/payment-links/{id}' },\n PaymentLinks_update: { method: 'PATCH', path: '/v1/payment-links/{id}' },\n Payments_executeC2p: { method: 'POST', path: '/v1/payments/c2p' },\n Payments_executeVpos: { method: 'POST', path: '/v1/payments/vpos' },\n Payments_getBanks: { method: 'GET', path: '/v1/banks' },\n Payments_getPagoMovilReceivingAccount: { method: 'GET', path: '/v1/payments/pago-movil/receiving-account' },\n Payments_getPayment: { method: 'GET', path: '/v1/payments/{id}' },\n Payments_getPaymentByRef: { method: 'GET', path: '/v1/payments/by-ref/{externalRef}' },\n Payments_getQuote: { method: 'GET', path: '/v1/quote' },\n Payments_requestC2p: { method: 'POST', path: '/v1/payments/c2p/request' },\n Payments_reversePayment: { method: 'POST', path: '/v1/payments/{id}/reverse' },\n Payments_verifyPagoMovil: { method: 'POST', path: '/v1/payments/pago-movil/verify' },\n Payouts_create: { method: 'POST', path: '/v1/payouts' },\n Payouts_createBatch: { method: 'POST', path: '/v1/payouts/batch' },\n Payouts_createInstant: { method: 'POST', path: '/v1/payouts/instant' },\n Payouts_getById: { method: 'GET', path: '/v1/payouts/{id}' },\n Payouts_getByRef: { method: 'GET', path: '/v1/payouts/by-ref/{externalRef}' },\n Payouts_list: { method: 'GET', path: '/v1/payouts' },\n Products_create: { method: 'POST', path: '/v1/products' },\n Products_createLink: { method: 'POST', path: '/v1/products/{id}/links' },\n Products_get: { method: 'GET', path: '/v1/products/{id}' },\n Products_list: { method: 'GET', path: '/v1/products' },\n Products_listLinks: { method: 'GET', path: '/v1/products/{id}/links' },\n Products_remove: { method: 'DELETE', path: '/v1/products/{id}' },\n Products_update: { method: 'PATCH', path: '/v1/products/{id}' },\n R4Operations_consultarOperacion: { method: 'GET', path: '/v1/payments/operations/{id}' },\n R4Operations_creditoCuentas: { method: 'POST', path: '/v1/payments/credit/account' },\n R4Operations_creditoInmediato: { method: 'POST', path: '/v1/payments/credit' },\n R4Operations_debitoInmediato: { method: 'POST', path: '/v1/payments/debit' },\n R4Operations_dispersarCredito: { method: 'POST', path: '/v1/payments/credit/disburse' },\n R4Operations_dispersarPagos: { method: 'POST', path: '/v1/payments/payouts' },\n R4Operations_ejecutarVuelto: { method: 'POST', path: '/v1/payments/change' },\n R4Operations_generarOtp: { method: 'POST', path: '/v1/payments/debit/otp' },\n R4Operations_pollOperation: { method: 'POST', path: '/v1/payments/operations/poll' },\n TenantPayoutAccount_confirmVerify: { method: 'POST', path: '/v1/tenant/payout-account/verify' },\n TenantPayoutAccount_get: { method: 'GET', path: '/v1/tenant/payout-account' },\n TenantPayoutAccount_startVerify: { method: 'POST', path: '/v1/tenant/payout-account/verify/start' },\n TenantPayoutAccount_upsert: { method: 'PUT', path: '/v1/tenant/payout-account' },\n TenantPayoutAccount_upsertPost: { method: 'POST', path: '/v1/tenant/payout-account' },\n Webhooks_createWebhook: { method: 'POST', path: '/v1/webhooks' },\n Webhooks_deleteWebhook: { method: 'DELETE', path: '/v1/webhooks/{id}' },\n Webhooks_listWebhooks: { method: 'GET', path: '/v1/webhooks' },\n Webhooks_updateWebhook: { method: 'PATCH', path: '/v1/webhooks/{id}' },\n} as const satisfies Record<OperationId, { method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; path: string }>;\n","import type { HttpClient, QueryValue, RequestOptions } from './core';\nimport { VexPayInvalidRequestError } from './errors';\nimport { ROUTES } from './generated/routes';\nimport type { OperationId, ResponseBody } from './types';\n\nexport type CallArgs = {\n path?: Record<string, string>;\n query?: object;\n body?: unknown;\n};\n\n/** Base class for resources: turns an operationId + args into a typed HTTP call. */\nexport abstract class APIResource {\n constructor(protected readonly http: HttpClient) {}\n\n /** Async so a bad argument surfaces as a rejected promise, never a synchronous throw. */\n protected async call<O extends OperationId>(\n operationId: O,\n args: CallArgs = {},\n options?: RequestOptions,\n ): Promise<ResponseBody<O>> {\n const route = ROUTES[operationId];\n const path = route.path.replace(/\\{(\\w+)\\}/g, (_match, name: string) => {\n const value = args.path?.[name];\n if (typeof value !== 'string' || value === '') {\n throw new VexPayInvalidRequestError(`Missing required path parameter \"${name}\" for ${operationId}.`);\n }\n return encodeURIComponent(value);\n });\n return this.http.request<ResponseBody<O>>(\n route.method,\n path,\n { query: args.query as Record<string, QueryValue> | undefined, body: args.body },\n options,\n );\n }\n}\n","import type { RequestOptions } from '../core';\nimport { PagePromise } from '../pagination';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody } from '../types';\n\n/** Venezuelan bank catalog (SIMF codes, supported services, logos). */\nexport class Banks extends APIResource {\n list(options?: RequestOptions) {\n return this.call('Payments_getBanks', {}, options);\n }\n}\n\n/** USD → VES at the official BCV rate. */\nexport class Quotes extends APIResource {\n retrieve(params: QueryParams<'Payments_getQuote'>, options?: RequestOptions) {\n return this.call('Payments_getQuote', { query: params }, options);\n }\n}\n\n/** Your platform balance. */\nexport class Balance extends APIResource {\n retrieve(options?: RequestOptions) {\n return this.call('Balance_getBalance', {}, options);\n }\n}\n\n/** VES payouts to verified merchants. `externalRef` is the idempotency key. */\nexport class Payouts extends APIResource {\n create(params: RequestBody<'Payouts_create'>, options?: RequestOptions) {\n return this.call('Payouts_create', { body: params }, options);\n }\n\n /** Pay out immediately (crédito inmediato). */\n createInstant(params: RequestBody<'Payouts_createInstant'>, options?: RequestOptions) {\n return this.call('Payouts_createInstant', { body: params }, options);\n }\n\n /** Many payouts in one request, with item-level idempotency. */\n createBatch(params: RequestBody<'Payouts_createBatch'>, options?: RequestOptions) {\n return this.call('Payouts_createBatch', { body: params }, options);\n }\n\n /** Await for one page, or `for await` over every payout. */\n list(params: QueryParams<'Payouts_list'> = {}, options?: RequestOptions) {\n return new PagePromise(\n (cursor) => this.call('Payouts_list', { query: { ...params, cursor } }, options),\n params.cursor,\n );\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Payouts_getById', { path: { id } }, options);\n }\n\n retrieveByRef(externalRef: string, options?: RequestOptions) {\n return this.call('Payouts_getByRef', { path: { externalRef } }, options);\n }\n}\n\n/** The account your own VEXPay earnings are paid out to. */\nexport class TenantPayoutAccount extends APIResource {\n retrieve(options?: RequestOptions) {\n return this.call('TenantPayoutAccount_get', {}, options);\n }\n\n /** Create or replace the payout account (PUT). */\n upsert(params: RequestBody<'TenantPayoutAccount_upsert'>, options?: RequestOptions) {\n return this.call('TenantPayoutAccount_upsert', { body: params }, options);\n }\n\n /** Same as `upsert`, sent as POST (supports `Idempotency-Key`). */\n create(params: RequestBody<'TenantPayoutAccount_upsertPost'>, options?: RequestOptions) {\n return this.call('TenantPayoutAccount_upsertPost', { body: params }, options);\n }\n\n startVerification(options?: RequestOptions) {\n return this.call('TenantPayoutAccount_startVerify', {}, options);\n }\n\n confirmVerification(params: RequestBody<'TenantPayoutAccount_confirmVerify'>, options?: RequestOptions) {\n return this.call('TenantPayoutAccount_confirmVerify', { body: params }, options);\n }\n}\n\n/** Where VEXPay delivers signed webhooks. */\nexport class WebhookEndpoints extends APIResource {\n /** The response includes the signing `secret` — store it to verify deliveries. */\n create(params: RequestBody<'Webhooks_createWebhook'>, options?: RequestOptions) {\n return this.call('Webhooks_createWebhook', { body: params }, options);\n }\n\n list(options?: RequestOptions) {\n return this.call('Webhooks_listWebhooks', {}, options);\n }\n\n update(id: string, params: RequestBody<'Webhooks_updateWebhook'>, options?: RequestOptions) {\n return this.call('Webhooks_updateWebhook', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('Webhooks_deleteWebhook', { path: { id } }, options);\n }\n\n /** Send a `notification.test` delivery to your endpoints. */\n sendTest(options?: RequestOptions) {\n return this.call('Notifications_sendTest', {}, options);\n }\n}\n","import type { RequestOptions } from '../core';\nimport { PagePromise } from '../pagination';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody } from '../types';\n\n/** Single-purchase checkouts: redirect to `url`, or embed with @vexpay/js using `clientSecret`. */\nexport class CheckoutSessions extends APIResource {\n /** `clientSecret` is returned only here — hand it to the browser, never store or log it. */\n create(params: RequestBody<'CheckoutSessions_create'>, options?: RequestOptions) {\n return this.call('CheckoutSessions_create', { body: params }, options);\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('CheckoutSessions_retrieve', { path: { id } }, options);\n }\n}\n\nexport class Checkout extends APIResource {\n readonly sessions = new CheckoutSessions(this.http);\n}\n\n/** No-code products sold through hosted payment links. */\nexport class Products extends APIResource {\n create(params: RequestBody<'Products_create'>, options?: RequestOptions) {\n return this.call('Products_create', { body: params }, options);\n }\n\n /** Await for one page, or `for await` over every product. */\n list(params: QueryParams<'Products_list'> = {}, options?: RequestOptions) {\n return new PagePromise(\n (cursor) => this.call('Products_list', { query: { ...params, cursor } }, options),\n params.cursor,\n );\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Products_get', { path: { id } }, options);\n }\n\n update(id: string, params: RequestBody<'Products_update'>, options?: RequestOptions) {\n return this.call('Products_update', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('Products_remove', { path: { id } }, options);\n }\n\n /** Publish a shareable `/pay/:slug` link for this product. */\n createLink(id: string, params: RequestBody<'Products_createLink'>, options?: RequestOptions) {\n return this.call('Products_createLink', { path: { id }, body: params }, options);\n }\n\n listLinks(id: string, options?: RequestOptions) {\n return this.call('Products_listLinks', { path: { id } }, options);\n }\n}\n\nexport class PaymentLinks extends APIResource {\n retrieve(id: string, options?: RequestOptions) {\n return this.call('PaymentLinks_get', { path: { id } }, options);\n }\n\n update(id: string, params: RequestBody<'PaymentLinks_update'>, options?: RequestOptions) {\n return this.call('PaymentLinks_update', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('PaymentLinks_remove', { path: { id } }, options);\n }\n}\n","import type { RequestOptions } from '../core';\nimport { PagePromise } from '../pagination';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody, Schemas } from '../types';\n\nexport type MerchantListParams = Omit<QueryParams<'Merchants_listOrGetByRef'>, 'externalRef'>;\n\n/** Where a merchant gets paid (bank account or Pago Móvil). */\nexport class PayoutMethods extends APIResource {\n list(merchantId: string, options?: RequestOptions) {\n return this.call('Merchants_listPayoutMethods', { path: { id: merchantId } }, options);\n }\n\n create(merchantId: string, params: RequestBody<'Merchants_addPayoutMethod'>, options?: RequestOptions) {\n return this.call('Merchants_addPayoutMethod', { path: { id: merchantId }, body: params }, options);\n }\n\n setDefault(merchantId: string, methodId: string, options?: RequestOptions) {\n return this.call('Merchants_setDefaultPayoutMethod', { path: { id: merchantId, methodId } }, options);\n }\n\n delete(merchantId: string, methodId: string, options?: RequestOptions) {\n return this.call('Merchants_deletePayoutMethod', { path: { id: merchantId, methodId } }, options);\n }\n\n /** Send micro-deposits to this payout method. */\n startVerification(merchantId: string, methodId: string, options?: RequestOptions) {\n return this.call('Merchants_startVerifyMethod', { path: { id: merchantId, methodId } }, options);\n }\n\n /** Confirm the micro-deposit amounts the merchant saw. */\n confirmVerification(\n merchantId: string,\n methodId: string,\n params: RequestBody<'Merchants_confirmVerifyMethod'>,\n options?: RequestOptions,\n ) {\n return this.call(\n 'Merchants_confirmVerifyMethod',\n { path: { id: merchantId, methodId }, body: params },\n options,\n );\n }\n}\n\nexport class Merchants extends APIResource {\n readonly payoutMethods = new PayoutMethods(this.http);\n\n /** `externalRef` is required and is the idempotency key for merchant creation. */\n create(params: RequestBody<'Merchants_create'>, options?: RequestOptions) {\n return this.call('Merchants_create', { body: params }, options);\n }\n\n /** Await for one page (`items`, `nextCursor`), or `for await` over every merchant. */\n list(params: MerchantListParams = {}, options?: RequestOptions) {\n return new PagePromise<Schemas['MerchantListResponseDto']>(\n (cursor) =>\n this.call('Merchants_listOrGetByRef', { query: { ...params, cursor } }, options) as Promise<\n Schemas['MerchantListResponseDto']\n >,\n params.cursor,\n );\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Merchants_getById', { path: { id } }, options);\n }\n\n /** Look up a merchant by the `externalRef` you created it with. */\n retrieveByRef(externalRef: string, options?: RequestOptions) {\n return this.call('Merchants_listOrGetByRef', { query: { externalRef } }, options) as Promise<\n Schemas['MerchantResponseDto']\n >;\n }\n\n update(id: string, params: RequestBody<'Merchants_update'>, options?: RequestOptions) {\n return this.call('Merchants_update', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('Merchants_remove', { path: { id } }, options);\n }\n\n retrieveBalance(id: string, options?: RequestOptions) {\n return this.call('Merchants_getBalance', { path: { id } }, options);\n }\n\n /** Move VES between this merchant's balance and another. */\n transfer(id: string, params: RequestBody<'Merchants_transfer'>, options?: RequestOptions) {\n return this.call('Merchants_transfer', { path: { id }, body: params }, options);\n }\n\n listAuditEvents(id: string, options?: RequestOptions) {\n return this.call('Merchants_listAuditEvents', { path: { id } }, options);\n }\n\n /** Send micro-deposits to the merchant's default payout method. */\n startVerification(id: string, options?: RequestOptions) {\n return this.call('Merchants_startVerify', { path: { id } }, options);\n }\n\n confirmVerification(id: string, params: RequestBody<'Merchants_confirmVerify'>, options?: RequestOptions) {\n return this.call('Merchants_confirmVerify', { path: { id }, body: params }, options);\n }\n}\n","import type { RequestOptions } from '../core';\nimport { APIResource } from '../resource';\nimport type { RequestBody } from '../types';\n\n/** Pago Móvil C2P: request the bank OTP, then charge with the customer's token. */\nexport class C2p extends APIResource {\n /** Create a C2P intent; the payer's bank sends them a token (R4 also triggers the SMS). */\n request(params: RequestBody<'Payments_requestC2p'>, options?: RequestOptions) {\n return this.call('Payments_requestC2p', { body: params }, options);\n }\n\n /** Charge with the bank-issued token. Pass `intentId` from `request()`. */\n execute(params: RequestBody<'Payments_executeC2p'>, options?: RequestOptions) {\n return this.call('Payments_executeC2p', { body: params }, options);\n }\n}\n\n/** Card payments (VPOS). Prefer the hosted/embedded checkout so card data never touches your servers. */\nexport class Vpos extends APIResource {\n create(params: RequestBody<'Payments_executeVpos'>, options?: RequestOptions) {\n return this.call('Payments_executeVpos', { body: params }, options);\n }\n}\n\n/** Confirm a Pago Móvil the customer already sent to you. */\nexport class PagoMovil extends APIResource {\n /**\n * The account your customers must send the Pago Móvil to (bank, phone, identification).\n * Don't offer Pago Móvil while `configured` is false.\n */\n receivingAccount(options?: RequestOptions) {\n return this.call('Payments_getPagoMovilReceivingAccount', {}, options);\n }\n\n verify(params: RequestBody<'Payments_verifyPagoMovil'>, options?: RequestOptions) {\n return this.call('Payments_verifyPagoMovil', { body: params }, options);\n }\n}\n\n/** Débito inmediato (requires R4). */\nexport class Debit extends APIResource {\n requestOtp(params: RequestBody<'R4Operations_generarOtp'>, options?: RequestOptions) {\n return this.call('R4Operations_generarOtp', { body: params }, options);\n }\n\n execute(params: RequestBody<'R4Operations_debitoInmediato'>, options?: RequestOptions) {\n return this.call('R4Operations_debitoInmediato', { body: params }, options);\n }\n}\n\n/** Crédito inmediato and disbursements (requires R4). */\nexport class Credit extends APIResource {\n /** Instant credit to a Pago Móvil phone. */\n create(params: RequestBody<'R4Operations_creditoInmediato'>, options?: RequestOptions) {\n return this.call('R4Operations_creditoInmediato', { body: params }, options);\n }\n\n /** Instant credit to a bank account. */\n toAccount(params: RequestBody<'R4Operations_creditoCuentas'>, options?: RequestOptions) {\n return this.call('R4Operations_creditoCuentas', { body: params }, options);\n }\n\n /** Disburse one credit across several recipients. */\n disburse(params: RequestBody<'R4Operations_dispersarCredito'>, options?: RequestOptions) {\n return this.call('R4Operations_dispersarCredito', { body: params }, options);\n }\n}\n\n/** Bank operation status for débito/crédito (requires R4). */\nexport class Operations extends APIResource {\n retrieve(id: string, options?: RequestOptions) {\n return this.call('R4Operations_consultarOperacion', { path: { id } }, options);\n }\n\n /** Re-check a pending operation with the bank now. */\n poll(params: RequestBody<'R4Operations_pollOperation'>, options?: RequestOptions) {\n return this.call('R4Operations_pollOperation', { body: params }, options);\n }\n}\n\n/** Account payout dispersion (requires R4). */\nexport class Dispersals extends APIResource {\n create(params: RequestBody<'R4Operations_dispersarPagos'>, options?: RequestOptions) {\n return this.call('R4Operations_dispersarPagos', { body: params }, options);\n }\n}\n\n/** Vuelto / change payments (requires R4). */\nexport class Change extends APIResource {\n create(params: RequestBody<'R4Operations_ejecutarVuelto'>, options?: RequestOptions) {\n return this.call('R4Operations_ejecutarVuelto', { body: params }, options);\n }\n}\n\nexport class Payments extends APIResource {\n readonly c2p = new C2p(this.http);\n readonly vpos = new Vpos(this.http);\n readonly pagoMovil = new PagoMovil(this.http);\n readonly debit = new Debit(this.http);\n readonly credit = new Credit(this.http);\n readonly operations = new Operations(this.http);\n readonly dispersals = new Dispersals(this.http);\n readonly change = new Change(this.http);\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Payments_getPayment', { path: { id } }, options);\n }\n\n /** Look up a payment by the `externalRef` you sent. */\n retrieveByRef(externalRef: string, options?: RequestOptions) {\n return this.call('Payments_getPaymentByRef', { path: { externalRef } }, options);\n }\n\n /** Reverse a completed C2P payment. */\n reverse(id: string, options?: RequestOptions) {\n return this.call('Payments_reversePayment', { path: { id } }, options);\n }\n}\n","import { createHmac, timingSafeEqual } from 'node:crypto';\nimport { VexPaySignatureVerificationError } from './errors';\n\nexport const WEBHOOK_EVENT_NAMES = [\n 'payment.pending',\n 'payment.completed',\n 'payment.failed',\n 'payment.canceled',\n 'payment.reversed',\n 'merchant.verified',\n 'merchant.rejected',\n 'merchant.deactivated',\n 'merchant.reactivated',\n 'merchant.balance.updated',\n 'merchant.created',\n 'merchant.activated',\n 'merchant.updated',\n 'merchant.kyb_required',\n 'merchant.restricted',\n 'merchant.capability.updated',\n 'merchant.wallet_credit',\n 'payout.completed',\n 'payout.failed',\n 'tenant.status_changed',\n 'tenant.api_key.created',\n 'tenant.api_key.rotated',\n 'tenant.api_key.revoked',\n 'notification.test',\n] as const;\n\nexport type WebhookEventName = (typeof WEBHOOK_EVENT_NAMES)[number];\n\n/** `data` of every `payment.*` event. */\nexport interface PaymentWebhookData {\n paymentId: string;\n externalRef?: string;\n status: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'REVERSED';\n method: 'C2P' | 'VPOS' | 'PAGO_MOVIL' | 'DEBITO_INMEDIATO';\n usdAmount: number;\n vesAmount: number;\n bcvRate: number;\n feeUsd?: number;\n feeVes?: number;\n netVes?: number;\n bankReference?: string;\n bankTxId?: number;\n debtorId?: string;\n debtorPhone?: string;\n debtorBankCode?: number;\n debtorBankName?: string;\n cardLast4?: string;\n cardBrand?: string;\n cardProduct?: string;\n accountTypeLabel?: string;\n tenantName: string;\n createdAt: string;\n failureCode?: string;\n cancelReason?: 'superseded' | 'expired';\n reversedAt?: string;\n reversalRef?: string;\n reversalTxId?: number;\n livemode: boolean;\n /** Present when the payment came from a checkout session. */\n checkoutSession?: { id: string; reference: string | null; metadata: Record<string, string> };\n}\n\ntype PaymentEventName = Extract<WebhookEventName, `payment.${string}`>;\n\n/** A verified webhook delivery, discriminated by `event`. */\nexport type WebhookEvent =\n | { event: PaymentEventName; data: PaymentWebhookData; timestamp: string }\n | {\n event: Exclude<WebhookEventName, PaymentEventName>;\n data: Record<string, unknown> & { livemode: boolean };\n timestamp: string;\n };\n\nexport const SIGNATURE_HEADER = 'VexPay-Signature';\nexport const DEFAULT_TOLERANCE_SECONDS = 300;\n\nconst RAW_BODY_HINT =\n 'Pass the raw request body exactly as received (string or Buffer). Parsing and re-serializing JSON — e.g. JSON.stringify(req.body) — changes the bytes and breaks the signature. In Express use express.raw({ type: \"application/json\" }) on the webhook route.';\n\nfunction sign(secret: string, timestamp: number | string, payload: string): string {\n return createHmac('sha256', secret).update(`${timestamp}.${payload}`, 'utf8').digest('hex');\n}\n\nfunction parseHeader(header: string): { timestamp: number; signatures: string[] } | null {\n let timestamp: string | undefined;\n const signatures: string[] = [];\n for (const part of header.split(',')) {\n const index = part.indexOf('=');\n if (index <= 0) return null;\n const key = part.slice(0, index).trim();\n const value = part.slice(index + 1).trim();\n if (key === 't') timestamp = value;\n else if (key === 'v1') signatures.push(value);\n // Unknown schemes (v0, future v2…) are ignored.\n }\n if (!timestamp || !/^\\d+$/.test(timestamp)) return null;\n return { timestamp: Number(timestamp), signatures };\n}\n\nfunction safeEqualHex(expected: string, actual: string): boolean {\n const a = Buffer.from(expected, 'utf8');\n const b = Buffer.from(actual, 'utf8');\n return a.length === b.length && timingSafeEqual(a, b);\n}\n\nexport class Webhooks {\n /**\n * Verifies a delivery's `VexPay-Signature` header and returns the parsed event.\n * Throws VexPaySignatureVerificationError on a bad signature or a stale timestamp.\n */\n constructEvent(\n rawBody: string | Buffer | Uint8Array,\n signatureHeader: string | string[] | null | undefined,\n secret: string,\n options: { toleranceSeconds?: number; now?: number } = {},\n ): WebhookEvent {\n if (typeof rawBody !== 'string' && !(rawBody instanceof Uint8Array)) {\n throw new VexPaySignatureVerificationError(`Webhook payload must be the raw body. ${RAW_BODY_HINT}`);\n }\n if (!secret) {\n throw new VexPaySignatureVerificationError('A webhook signing secret is required.');\n }\n const payload = typeof rawBody === 'string' ? rawBody : Buffer.from(rawBody).toString('utf8');\n const header = Array.isArray(signatureHeader) ? signatureHeader[0] : signatureHeader;\n const parsed = header ? parseHeader(header) : null;\n if (!parsed) {\n throw new VexPaySignatureVerificationError(\n `Unable to parse the ${SIGNATURE_HEADER} header. Expected \"t=<timestamp>,v1=<signature>\".`,\n );\n }\n if (parsed.signatures.length === 0) {\n throw new VexPaySignatureVerificationError(`No v1 signatures found in the ${SIGNATURE_HEADER} header.`);\n }\n\n const tolerance = options.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;\n const now = options.now ?? Math.floor(Date.now() / 1000);\n if (tolerance > 0 && Math.abs(now - parsed.timestamp) > tolerance) {\n throw new VexPaySignatureVerificationError(\n `Webhook timestamp is outside the ${tolerance}s tolerance — possible replay. Check your server clock if this repeats.`,\n );\n }\n\n const expected = sign(secret, parsed.timestamp, payload);\n if (!parsed.signatures.some((candidate) => safeEqualHex(expected, candidate))) {\n throw new VexPaySignatureVerificationError(\n `No signature matches the expected signature for this payload. Check the endpoint secret. ${RAW_BODY_HINT}`,\n );\n }\n\n try {\n return JSON.parse(payload) as WebhookEvent;\n } catch {\n throw new VexPaySignatureVerificationError('Webhook payload is not valid JSON.');\n }\n }\n\n /** Builds a valid `VexPay-Signature` value — for your own tests. */\n generateTestHeader({\n payload,\n secret,\n timestamp = Math.floor(Date.now() / 1000),\n }: {\n payload: string;\n secret: string;\n timestamp?: number;\n }): string {\n return `t=${timestamp},v1=${sign(secret, timestamp, payload)}`;\n }\n}\n","import { HttpClient, type CoreConfig } from './core';\nimport { VexPayConfigurationError } from './errors';\nimport {\n Balance,\n Banks,\n Payouts,\n Quotes,\n TenantPayoutAccount,\n WebhookEndpoints,\n} from './resources/account';\nimport { Checkout, PaymentLinks, Products } from './resources/commerce';\nimport { Merchants } from './resources/merchants';\nimport { Payments } from './resources/payments';\nimport { Webhooks } from './webhooks';\n\nexport const DEFAULT_BASE_URL = 'https://api.pay.vexwallet.co';\n\nexport interface VexPayOptions {\n /** API origin. Defaults to production (`https://api.pay.vexwallet.co`). */\n baseUrl?: string;\n /** Per-attempt timeout. Default 30 000 ms. */\n timeoutMs?: number;\n /** Retries for connection errors, timeouts, 429 and 5xx. Default 2. */\n maxNetworkRetries?: number;\n /** Custom fetch (proxies, instrumentation, tests). Defaults to the global fetch. */\n fetch?: typeof fetch;\n}\n\nexport class VexPay {\n /** @internal */\n readonly http: HttpClient;\n\n readonly banks: Banks;\n readonly quotes: Quotes;\n readonly balance: Balance;\n readonly payments: Payments;\n readonly checkout: Checkout;\n readonly merchants: Merchants;\n readonly payouts: Payouts;\n readonly products: Products;\n readonly paymentLinks: PaymentLinks;\n readonly tenantPayoutAccount: TenantPayoutAccount;\n readonly webhookEndpoints: WebhookEndpoints;\n /** Offline helpers: `constructEvent` verifies deliveries; no API calls. */\n readonly webhooks = new Webhooks();\n\n constructor(apiKey: string, options: VexPayOptions = {}) {\n if (typeof apiKey !== 'string' || apiKey.trim() === '') {\n throw new VexPayConfigurationError(\n 'A VEXPay API key is required: new VexPay(process.env.VEXPAY_API_KEY).',\n );\n }\n const fetchImpl = options.fetch ?? globalThis.fetch;\n if (typeof fetchImpl !== 'function') {\n throw new VexPayConfigurationError('No fetch implementation found. Use Node.js 20+ or pass options.fetch.');\n }\n const config: CoreConfig = {\n apiKey: apiKey.trim(),\n baseUrl: options.baseUrl ?? DEFAULT_BASE_URL,\n timeoutMs: options.timeoutMs ?? 30_000,\n maxNetworkRetries: options.maxNetworkRetries ?? 2,\n fetch: fetchImpl.bind(globalThis),\n };\n this.http = new HttpClient(config);\n\n this.banks = new Banks(this.http);\n this.quotes = new Quotes(this.http);\n this.balance = new Balance(this.http);\n this.payments = new Payments(this.http);\n this.checkout = new Checkout(this.http);\n this.merchants = new Merchants(this.http);\n this.payouts = new Payouts(this.http);\n this.products = new Products(this.http);\n this.paymentLinks = new PaymentLinks(this.http);\n this.tenantPayoutAccount = new TenantPayoutAccount(this.http);\n this.webhookEndpoints = new WebhookEndpoints(this.http);\n }\n}\n"],"mappings":";AACO,IAAM,cAAN,cAA0B,MAAM;AAAA;AAAA,EAE5B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAET,YACE,SACA,UAAkF,CAAC,GACnF;AACA,UAAM,OAAO;AACb,SAAK,OAAO,WAAW;AACvB,SAAK,SAAS,QAAQ;AACtB,SAAK,OAAO,QAAQ;AACpB,SAAK,OAAO,QAAQ;AACpB,SAAK,YAAY,QAAQ;AAAA,EAC3B;AACF;AAGO,IAAM,2BAAN,cAAuC,YAAY;AAAC;AAGpD,IAAM,4BAAN,cAAwC,YAAY;AAAC;AAGrD,IAAM,4BAAN,cAAwC,YAAY;AAAC;AAGrD,IAAM,sBAAN,cAAkC,YAAY;AAAC;AAG/C,IAAM,sBAAN,cAAkC,YAAY;AAAC;AAG/C,IAAM,uBAAN,cAAmC,YAAY;AAAC;AAGhD,IAAM,iBAAN,cAA6B,YAAY;AAAC;AAG1C,IAAM,wBAAN,cAAoC,YAAY;AAAC;AAGjD,IAAM,qBAAN,cAAiC,sBAAsB;AAAC;AAGxD,IAAM,mCAAN,cAA+C,YAAY;AAAC;AAEnE,IAAM,eAAe;AAErB,SAAS,YAAY,MAAe,QAAwB;AAC1D,MAAI,QAA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,YAAY,IAAI,UAAU,KAAK,IAAI;AACxC,SAAK,UAAU,IAAI,QAAQ,KAAK,IAAI;AACpC,SAAK,WAAW,IAAI,SAAS,KAAK,IAAI;AACtC,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,sBAAsB,IAAI,oBAAoB,KAAK,IAAI;AAC5D,SAAK,mBAAmB,IAAI,iBAAiB,KAAK,IAAI;AAAA,EACxD;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/version.ts","../src/core.ts","../src/pagination.ts","../src/generated/routes.ts","../src/resource.ts","../src/resources/account.ts","../src/resources/commerce.ts","../src/resources/crypto.ts","../src/resources/merchants.ts","../src/resources/payments.ts","../src/webhooks.ts","../src/client.ts"],"sourcesContent":["/** Every error the SDK throws extends VexPayError. */\nexport class VexPayError extends Error {\n /** HTTP status, when the API answered. */\n readonly status?: number;\n /** Machine-readable API code, e.g. `insufficient_balance`. */\n readonly code?: string;\n /** Parsed response body, when the API answered. */\n readonly body?: unknown;\n /** Request id from the `x-request-id` response header, when present. */\n readonly requestId?: string;\n\n constructor(\n message: string,\n details: { status?: number; code?: string; body?: unknown; requestId?: string } = {},\n ) {\n super(message);\n this.name = new.target.name;\n this.status = details.status;\n this.code = details.code;\n this.body = details.body;\n this.requestId = details.requestId;\n }\n}\n\n/** Invalid client configuration (e.g. missing API key). Thrown before any request. */\nexport class VexPayConfigurationError extends VexPayError {}\n\n/** 401 — missing, invalid, or revoked API key. */\nexport class VexPayAuthenticationError extends VexPayError {}\n\n/** 400, 403, 410, 422 and other non-retryable 4xx — fix the request before retrying. */\nexport class VexPayInvalidRequestError extends VexPayError {}\n\n/** 404 — the resource does not exist (or belongs to another account). */\nexport class VexPayNotFoundError extends VexPayError {}\n\n/** 409 — e.g. `external_ref_conflict`, `idempotency_key_reused`. */\nexport class VexPayConflictError extends VexPayError {}\n\n/** 429 — too many requests. Retried automatically before surfacing. */\nexport class VexPayRateLimitError extends VexPayError {}\n\n/** 5xx — VEXPay or an upstream bank failed. Retried automatically before surfacing. */\nexport class VexPayAPIError extends VexPayError {}\n\n/** The request never got an HTTP answer (DNS, refused, reset). */\nexport class VexPayConnectionError extends VexPayError {}\n\n/** The request exceeded `timeoutMs`. */\nexport class VexPayTimeoutError extends VexPayConnectionError {}\n\n/** A webhook signature did not verify (see `webhooks.constructEvent`). */\nexport class VexPaySignatureVerificationError extends VexPayError {}\n\nconst MACHINE_CODE = /^[a-z][a-z0-9_]*$/;\n\nfunction messageFrom(body: unknown, status: number): string {\n if (body && typeof body === 'object') {\n const { message, error } = body as { message?: unknown; error?: unknown };\n if (Array.isArray(message)) return message.join('; ');\n if (typeof message === 'string' && message) return message;\n if (typeof error === 'string' && error) return error;\n }\n if (typeof body === 'string' && body) return body;\n return `VEXPay API responded with HTTP ${status}`;\n}\n\n/** Maps an HTTP error response to the matching error class. */\nexport function errorFromResponse(status: number, body: unknown, requestId?: string): VexPayError {\n const rawCode = body && typeof body === 'object' ? (body as { error?: unknown }).error : undefined;\n const code = typeof rawCode === 'string' && MACHINE_CODE.test(rawCode) ? rawCode : undefined;\n const details = { status, code, body, requestId };\n const message = messageFrom(body, status);\n\n if (status === 401) return new VexPayAuthenticationError(message, details);\n if (status === 404) return new VexPayNotFoundError(message, details);\n if (status === 409) return new VexPayConflictError(message, details);\n if (status === 429) return new VexPayRateLimitError(message, details);\n if (status >= 500) return new VexPayAPIError(message, details);\n return new VexPayInvalidRequestError(message, details);\n}\n","export const VERSION = '0.2.0';\n","import {\n VexPayConnectionError,\n VexPayError,\n VexPayTimeoutError,\n errorFromResponse,\n} from './errors';\nimport { VERSION } from './version';\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport type QueryValue = string | number | boolean | null | undefined;\n\n/** Per-request options accepted by every resource method. */\nexport interface RequestOptions {\n /** Sent as `Idempotency-Key` on POST. Defaults to a random UUID per call, reused across retries. */\n idempotencyKey?: string;\n /** Overrides the client's `timeoutMs` for this call. */\n timeoutMs?: number;\n /** Overrides the client's `maxNetworkRetries` for this call. */\n maxNetworkRetries?: number;\n /** Aborts the call (and any pending retry). */\n signal?: AbortSignal;\n}\n\nexport interface CoreConfig {\n apiKey: string;\n baseUrl: string;\n timeoutMs: number;\n maxNetworkRetries: number;\n fetch: typeof fetch;\n /** Test hook — defaults to setTimeout. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst INITIAL_RETRY_DELAY_MS = 500;\nconst MAX_RETRY_DELAY_MS = 8_000;\nconst MAX_RETRY_AFTER_MS = 60_000;\n\nfunction defaultSleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction userAgent(): string {\n const runtime = typeof process !== 'undefined' && process.version ? ` node/${process.version}` : '';\n return `vexpay-node/${VERSION}${runtime}`;\n}\n\n/** Retry-After as seconds or an HTTP date → milliseconds, capped. */\nexport function parseRetryAfter(value: string | null, now = Date.now()): number | undefined {\n if (!value) return undefined;\n const seconds = Number(value);\n if (Number.isFinite(seconds) && seconds >= 0) return Math.min(seconds * 1000, MAX_RETRY_AFTER_MS);\n const date = Date.parse(value);\n if (Number.isFinite(date)) return Math.min(Math.max(0, date - now), MAX_RETRY_AFTER_MS);\n return undefined;\n}\n\n/** Exponential backoff with full jitter: attempt 0 → [250, 500) ms, doubling, capped. */\nexport function backoffDelay(attempt: number, random = Math.random): number {\n const ceiling = Math.min(INITIAL_RETRY_DELAY_MS * 2 ** attempt, MAX_RETRY_DELAY_MS);\n return Math.round(ceiling / 2 + random() * (ceiling / 2));\n}\n\nfunction isRetryable(error: VexPayError): boolean {\n if (error instanceof VexPayConnectionError) return true;\n if (error.status === 429) return true;\n if (error.status !== undefined && error.status >= 500) return true;\n return error.status === 409 && error.code === 'idempotency_request_in_progress';\n}\n\nfunction buildUrl(baseUrl: string, path: string, query?: Record<string, QueryValue>): string {\n const url = new URL(path.replace(/^\\//, ''), baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`);\n for (const [key, value] of Object.entries(query ?? {})) {\n if (value !== undefined && value !== null) url.searchParams.set(key, String(value));\n }\n return url.toString();\n}\n\nasync function readBody(response: Response): Promise<unknown> {\n const text = await response.text();\n if (!text) return undefined;\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n}\n\nexport class HttpClient {\n private readonly sleep: (ms: number) => Promise<void>;\n\n constructor(private readonly config: CoreConfig) {\n this.sleep = config.sleep ?? defaultSleep;\n }\n\n async request<T>(\n method: HttpMethod,\n path: string,\n params: { query?: Record<string, QueryValue>; body?: unknown } = {},\n options: RequestOptions = {},\n ): Promise<T> {\n const maxRetries = options.maxNetworkRetries ?? this.config.maxNetworkRetries;\n const timeoutMs = options.timeoutMs ?? this.config.timeoutMs;\n const url = buildUrl(this.config.baseUrl, path, params.query);\n\n const headers: Record<string, string> = {\n accept: 'application/json',\n 'x-api-key': this.config.apiKey,\n 'user-agent': userAgent(),\n };\n if (params.body !== undefined) headers['content-type'] = 'application/json';\n // One key for every attempt of this call: a retried POST can never charge twice.\n if (method === 'POST') headers['idempotency-key'] = options.idempotencyKey ?? crypto.randomUUID();\n const body = params.body === undefined ? undefined : JSON.stringify(params.body);\n\n for (let attempt = 0; ; attempt += 1) {\n let error: VexPayError;\n let retryAfterMs: number | undefined;\n\n try {\n const response = await this.send(url, { method, headers, body }, timeoutMs, options.signal);\n const parsed = await readBody(response);\n if (response.ok) return parsed as T;\n error = errorFromResponse(response.status, parsed, response.headers.get('x-request-id') ?? undefined);\n retryAfterMs = parseRetryAfter(response.headers.get('retry-after'));\n } catch (caught) {\n if (!(caught instanceof VexPayError)) throw caught;\n error = caught;\n }\n\n if (attempt >= maxRetries || !isRetryable(error) || options.signal?.aborted) throw error;\n await this.sleep(retryAfterMs ?? backoffDelay(attempt));\n }\n }\n\n private async send(\n url: string,\n init: { method: HttpMethod; headers: Record<string, string>; body?: string },\n timeoutMs: number,\n signal?: AbortSignal,\n ): Promise<Response> {\n const controller = new AbortController();\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n controller.abort();\n }, timeoutMs);\n const onAbort = () => controller.abort();\n signal?.addEventListener('abort', onAbort, { once: true });\n\n try {\n return await this.config.fetch(url, { ...init, signal: controller.signal });\n } catch (caught) {\n if (timedOut) {\n throw new VexPayTimeoutError(`Request to VEXPay timed out after ${timeoutMs}ms`);\n }\n if (signal?.aborted) throw caught;\n const reason = caught instanceof Error ? caught.message : String(caught);\n throw new VexPayConnectionError(`Could not reach VEXPay: ${reason}`);\n } finally {\n clearTimeout(timer);\n signal?.removeEventListener('abort', onAbort);\n }\n }\n}\n","export type CursorPage<Item> = { items: Item[]; nextCursor?: string | null };\n\n/**\n * Result of a cursor-paginated `list()`.\n *\n * const page = await vexpay.merchants.list({ limit: 100 }); // first page\n * for await (const merchant of vexpay.merchants.list()) { … } // every item, all pages\n *\n * The first request is sent when the result is awaited or iterated.\n */\nexport class PagePromise<Page extends CursorPage<Item>, Item = Page['items'][number]>\n implements PromiseLike<Page>, AsyncIterable<Item>\n{\n private firstPage?: Promise<Page>;\n\n constructor(\n private readonly fetchPage: (cursor: string | undefined) => Promise<Page>,\n private readonly startCursor?: string,\n ) {}\n\n private first(): Promise<Page> {\n return (this.firstPage ??= this.fetchPage(this.startCursor));\n }\n\n then<TResult1 = Page, TResult2 = never>(\n onfulfilled?: ((value: Page) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,\n ): Promise<TResult1 | TResult2> {\n return this.first().then(onfulfilled, onrejected);\n }\n\n catch<TResult = never>(\n onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null,\n ): Promise<Page | TResult> {\n return this.first().catch(onrejected);\n }\n\n finally(onfinally?: (() => void) | null): Promise<Page> {\n return this.first().finally(onfinally);\n }\n\n async *[Symbol.asyncIterator](): AsyncIterator<Item> {\n let page = await this.first();\n let cursor = this.startCursor;\n for (;;) {\n for (const item of page.items) yield item;\n const next = page.nextCursor;\n // Stop on the last page, or if the API ever repeats a cursor.\n if (!next || next === cursor) return;\n cursor = next;\n page = await this.fetchPage(next);\n }\n }\n\n /** Collects items across pages, stopping after `limit` (default 10 000). */\n async autoPagingToArray({ limit = 10_000 }: { limit?: number } = {}): Promise<Item[]> {\n const items: Item[] = [];\n for await (const item of this) {\n items.push(item);\n if (items.length >= limit) break;\n }\n return items;\n }\n}\n","// Generated by scripts/generate-routes.mjs from packages/sdk-spec/openapi.json — do not edit.\nimport type { operations } from './openapi';\n\nexport type OperationId = keyof operations;\n\nexport const ROUTES = {\n Balance_getBalance: { method: 'GET', path: '/v1/balance' },\n CheckoutSessions_create: { method: 'POST', path: '/v1/checkout/sessions' },\n CheckoutSessions_retrieve: { method: 'GET', path: '/v1/checkout/sessions/{id}' },\n Crypto_createDepositAddress: { method: 'POST', path: '/v1/crypto/deposit-addresses' },\n Crypto_createPayout: { method: 'POST', path: '/v1/crypto/payouts' },\n Crypto_getBalance: { method: 'GET', path: '/v1/crypto/balance' },\n Crypto_getPayout: { method: 'GET', path: '/v1/crypto/payouts/{id}' },\n Crypto_listNetworks: { method: 'GET', path: '/v1/crypto/networks' },\n Merchants_addPayoutMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods' },\n Merchants_confirmVerify: { method: 'POST', path: '/v1/merchants/{id}/verify' },\n Merchants_confirmVerifyMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods/{methodId}/verify' },\n Merchants_create: { method: 'POST', path: '/v1/merchants' },\n Merchants_deletePayoutMethod: { method: 'DELETE', path: '/v1/merchants/{id}/payout-methods/{methodId}' },\n Merchants_getBalance: { method: 'GET', path: '/v1/merchants/{id}/balance' },\n Merchants_getById: { method: 'GET', path: '/v1/merchants/{id}' },\n Merchants_listAuditEvents: { method: 'GET', path: '/v1/merchants/{id}/audit-events' },\n Merchants_listOrGetByRef: { method: 'GET', path: '/v1/merchants' },\n Merchants_listPayoutMethods: { method: 'GET', path: '/v1/merchants/{id}/payout-methods' },\n Merchants_remove: { method: 'DELETE', path: '/v1/merchants/{id}' },\n Merchants_setDefaultPayoutMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods/{methodId}/default' },\n Merchants_startVerify: { method: 'POST', path: '/v1/merchants/{id}/verify/start' },\n Merchants_startVerifyMethod: { method: 'POST', path: '/v1/merchants/{id}/payout-methods/{methodId}/verify/start' },\n Merchants_transfer: { method: 'POST', path: '/v1/merchants/{id}/transfers' },\n Merchants_update: { method: 'PATCH', path: '/v1/merchants/{id}' },\n Notifications_sendTest: { method: 'POST', path: '/v1/notifications/test' },\n PaymentLinks_get: { method: 'GET', path: '/v1/payment-links/{id}' },\n PaymentLinks_remove: { method: 'DELETE', path: '/v1/payment-links/{id}' },\n PaymentLinks_update: { method: 'PATCH', path: '/v1/payment-links/{id}' },\n Payments_executeC2p: { method: 'POST', path: '/v1/payments/c2p' },\n Payments_executeVpos: { method: 'POST', path: '/v1/payments/vpos' },\n Payments_getBanks: { method: 'GET', path: '/v1/banks' },\n Payments_getPagoMovilReceivingAccount: { method: 'GET', path: '/v1/payments/pago-movil/receiving-account' },\n Payments_getPayment: { method: 'GET', path: '/v1/payments/{id}' },\n Payments_getPaymentByRef: { method: 'GET', path: '/v1/payments/by-ref/{externalRef}' },\n Payments_getQuote: { method: 'GET', path: '/v1/quote' },\n Payments_requestC2p: { method: 'POST', path: '/v1/payments/c2p/request' },\n Payments_reversePayment: { method: 'POST', path: '/v1/payments/{id}/reverse' },\n Payments_verifyPagoMovil: { method: 'POST', path: '/v1/payments/pago-movil/verify' },\n Payouts_create: { method: 'POST', path: '/v1/payouts' },\n Payouts_createBatch: { method: 'POST', path: '/v1/payouts/batch' },\n Payouts_createInstant: { method: 'POST', path: '/v1/payouts/instant' },\n Payouts_getById: { method: 'GET', path: '/v1/payouts/{id}' },\n Payouts_getByRef: { method: 'GET', path: '/v1/payouts/by-ref/{externalRef}' },\n Payouts_list: { method: 'GET', path: '/v1/payouts' },\n Products_create: { method: 'POST', path: '/v1/products' },\n Products_createLink: { method: 'POST', path: '/v1/products/{id}/links' },\n Products_get: { method: 'GET', path: '/v1/products/{id}' },\n Products_list: { method: 'GET', path: '/v1/products' },\n Products_listLinks: { method: 'GET', path: '/v1/products/{id}/links' },\n Products_remove: { method: 'DELETE', path: '/v1/products/{id}' },\n Products_update: { method: 'PATCH', path: '/v1/products/{id}' },\n R4Operations_consultarOperacion: { method: 'GET', path: '/v1/payments/operations/{id}' },\n R4Operations_creditoCuentas: { method: 'POST', path: '/v1/payments/credit/account' },\n R4Operations_creditoInmediato: { method: 'POST', path: '/v1/payments/credit' },\n R4Operations_debitoInmediato: { method: 'POST', path: '/v1/payments/debit' },\n R4Operations_dispersarCredito: { method: 'POST', path: '/v1/payments/credit/disburse' },\n R4Operations_dispersarPagos: { method: 'POST', path: '/v1/payments/payouts' },\n R4Operations_ejecutarVuelto: { method: 'POST', path: '/v1/payments/change' },\n R4Operations_generarOtp: { method: 'POST', path: '/v1/payments/debit/otp' },\n R4Operations_pollOperation: { method: 'POST', path: '/v1/payments/operations/poll' },\n TenantPayoutAccount_confirmVerify: { method: 'POST', path: '/v1/tenant/payout-account/verify' },\n TenantPayoutAccount_get: { method: 'GET', path: '/v1/tenant/payout-account' },\n TenantPayoutAccount_startVerify: { method: 'POST', path: '/v1/tenant/payout-account/verify/start' },\n TenantPayoutAccount_upsert: { method: 'PUT', path: '/v1/tenant/payout-account' },\n TenantPayoutAccount_upsertPost: { method: 'POST', path: '/v1/tenant/payout-account' },\n Webhooks_createWebhook: { method: 'POST', path: '/v1/webhooks' },\n Webhooks_deleteWebhook: { method: 'DELETE', path: '/v1/webhooks/{id}' },\n Webhooks_listWebhooks: { method: 'GET', path: '/v1/webhooks' },\n Webhooks_updateWebhook: { method: 'PATCH', path: '/v1/webhooks/{id}' },\n} as const satisfies Record<OperationId, { method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; path: string }>;\n","import type { HttpClient, QueryValue, RequestOptions } from './core';\nimport { VexPayInvalidRequestError } from './errors';\nimport { ROUTES } from './generated/routes';\nimport type { OperationId, ResponseBody } from './types';\n\nexport type CallArgs = {\n path?: Record<string, string>;\n query?: object;\n body?: unknown;\n};\n\n/** Base class for resources: turns an operationId + args into a typed HTTP call. */\nexport abstract class APIResource {\n constructor(protected readonly http: HttpClient) {}\n\n /** Async so a bad argument surfaces as a rejected promise, never a synchronous throw. */\n protected async call<O extends OperationId>(\n operationId: O,\n args: CallArgs = {},\n options?: RequestOptions,\n ): Promise<ResponseBody<O>> {\n const route = ROUTES[operationId];\n const path = route.path.replace(/\\{(\\w+)\\}/g, (_match, name: string) => {\n const value = args.path?.[name];\n if (typeof value !== 'string' || value === '') {\n throw new VexPayInvalidRequestError(`Missing required path parameter \"${name}\" for ${operationId}.`);\n }\n return encodeURIComponent(value);\n });\n return this.http.request<ResponseBody<O>>(\n route.method,\n path,\n { query: args.query as Record<string, QueryValue> | undefined, body: args.body },\n options,\n );\n }\n}\n","import type { RequestOptions } from '../core';\nimport { PagePromise } from '../pagination';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody } from '../types';\n\n/** Venezuelan bank catalog (SIMF codes, supported services, logos). */\nexport class Banks extends APIResource {\n list(options?: RequestOptions) {\n return this.call('Payments_getBanks', {}, options);\n }\n}\n\n/** USD → VES at the official BCV rate. */\nexport class Quotes extends APIResource {\n retrieve(params: QueryParams<'Payments_getQuote'>, options?: RequestOptions) {\n return this.call('Payments_getQuote', { query: params }, options);\n }\n}\n\n/** Your platform balance. */\nexport class Balance extends APIResource {\n retrieve(options?: RequestOptions) {\n return this.call('Balance_getBalance', {}, options);\n }\n}\n\n/** VES payouts to verified merchants. `externalRef` is the idempotency key. */\nexport class Payouts extends APIResource {\n create(params: RequestBody<'Payouts_create'>, options?: RequestOptions) {\n return this.call('Payouts_create', { body: params }, options);\n }\n\n /** Pay out immediately (crédito inmediato). */\n createInstant(params: RequestBody<'Payouts_createInstant'>, options?: RequestOptions) {\n return this.call('Payouts_createInstant', { body: params }, options);\n }\n\n /** Many payouts in one request, with item-level idempotency. */\n createBatch(params: RequestBody<'Payouts_createBatch'>, options?: RequestOptions) {\n return this.call('Payouts_createBatch', { body: params }, options);\n }\n\n /** Await for one page, or `for await` over every payout. */\n list(params: QueryParams<'Payouts_list'> = {}, options?: RequestOptions) {\n return new PagePromise(\n (cursor) => this.call('Payouts_list', { query: { ...params, cursor } }, options),\n params.cursor,\n );\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Payouts_getById', { path: { id } }, options);\n }\n\n retrieveByRef(externalRef: string, options?: RequestOptions) {\n return this.call('Payouts_getByRef', { path: { externalRef } }, options);\n }\n}\n\n/** The account your own VEXPay earnings are paid out to. */\nexport class TenantPayoutAccount extends APIResource {\n retrieve(options?: RequestOptions) {\n return this.call('TenantPayoutAccount_get', {}, options);\n }\n\n /** Create or replace the payout account (PUT). */\n upsert(params: RequestBody<'TenantPayoutAccount_upsert'>, options?: RequestOptions) {\n return this.call('TenantPayoutAccount_upsert', { body: params }, options);\n }\n\n /** Same as `upsert`, sent as POST (supports `Idempotency-Key`). */\n create(params: RequestBody<'TenantPayoutAccount_upsertPost'>, options?: RequestOptions) {\n return this.call('TenantPayoutAccount_upsertPost', { body: params }, options);\n }\n\n startVerification(options?: RequestOptions) {\n return this.call('TenantPayoutAccount_startVerify', {}, options);\n }\n\n confirmVerification(params: RequestBody<'TenantPayoutAccount_confirmVerify'>, options?: RequestOptions) {\n return this.call('TenantPayoutAccount_confirmVerify', { body: params }, options);\n }\n}\n\n/** Where VEXPay delivers signed webhooks. */\nexport class WebhookEndpoints extends APIResource {\n /** The response includes the signing `secret` — store it to verify deliveries. */\n create(params: RequestBody<'Webhooks_createWebhook'>, options?: RequestOptions) {\n return this.call('Webhooks_createWebhook', { body: params }, options);\n }\n\n list(options?: RequestOptions) {\n return this.call('Webhooks_listWebhooks', {}, options);\n }\n\n update(id: string, params: RequestBody<'Webhooks_updateWebhook'>, options?: RequestOptions) {\n return this.call('Webhooks_updateWebhook', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('Webhooks_deleteWebhook', { path: { id } }, options);\n }\n\n /** Send a `notification.test` delivery to your endpoints. */\n sendTest(options?: RequestOptions) {\n return this.call('Notifications_sendTest', {}, options);\n }\n}\n","import type { RequestOptions } from '../core';\nimport { PagePromise } from '../pagination';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody } from '../types';\n\n/** Single-purchase checkouts: redirect to `url`, or embed with @vexpay/js using `clientSecret`. */\nexport class CheckoutSessions extends APIResource {\n /** `clientSecret` is returned only here — hand it to the browser, never store or log it. */\n create(params: RequestBody<'CheckoutSessions_create'>, options?: RequestOptions) {\n return this.call('CheckoutSessions_create', { body: params }, options);\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('CheckoutSessions_retrieve', { path: { id } }, options);\n }\n}\n\nexport class Checkout extends APIResource {\n readonly sessions = new CheckoutSessions(this.http);\n}\n\n/** No-code products sold through hosted payment links. */\nexport class Products extends APIResource {\n create(params: RequestBody<'Products_create'>, options?: RequestOptions) {\n return this.call('Products_create', { body: params }, options);\n }\n\n /** Await for one page, or `for await` over every product. */\n list(params: QueryParams<'Products_list'> = {}, options?: RequestOptions) {\n return new PagePromise(\n (cursor) => this.call('Products_list', { query: { ...params, cursor } }, options),\n params.cursor,\n );\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Products_get', { path: { id } }, options);\n }\n\n update(id: string, params: RequestBody<'Products_update'>, options?: RequestOptions) {\n return this.call('Products_update', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('Products_remove', { path: { id } }, options);\n }\n\n /** Publish a shareable `/pay/:slug` link for this product. */\n createLink(id: string, params: RequestBody<'Products_createLink'>, options?: RequestOptions) {\n return this.call('Products_createLink', { path: { id }, body: params }, options);\n }\n\n listLinks(id: string, options?: RequestOptions) {\n return this.call('Products_listLinks', { path: { id } }, options);\n }\n}\n\nexport class PaymentLinks extends APIResource {\n retrieve(id: string, options?: RequestOptions) {\n return this.call('PaymentLinks_get', { path: { id } }, options);\n }\n\n update(id: string, params: RequestBody<'PaymentLinks_update'>, options?: RequestOptions) {\n return this.call('PaymentLinks_update', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('PaymentLinks_remove', { path: { id } }, options);\n }\n}\n","import type { RequestOptions } from '../core';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody } from '../types';\n\n/** Your USDT balance (USDT settles in USDT, never converted to VES). */\nexport class CryptoBalance extends APIResource {\n retrieve(options?: RequestOptions) {\n return this.call('Crypto_getBalance', {}, options);\n }\n}\n\n/** Static USDT deposit addresses per customer and network. */\nexport class DepositAddresses extends APIResource {\n /** Get or create — calling again for the same customer and network returns the same address. */\n create(params: RequestBody<'Crypto_createDepositAddress'>, options?: RequestOptions) {\n return this.call('Crypto_createDepositAddress', { body: params }, options);\n }\n}\n\n/** Enabled USDT networks with the payout fee and availability for an amount. */\nexport class CryptoNetworks extends APIResource {\n list(params: QueryParams<'Crypto_listNetworks'> = {}, options?: RequestOptions) {\n return this.call('Crypto_listNetworks', { query: params }, options);\n }\n}\n\n/** USDT payouts to external addresses. `idempotencyKey` (in the body) makes retries safe. */\nexport class CryptoPayouts extends APIResource {\n create(params: RequestBody<'Crypto_createPayout'>, options?: RequestOptions) {\n return this.call('Crypto_createPayout', { body: params }, options);\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Crypto_getPayout', { path: { id } }, options);\n }\n}\n\n/** USDT: deposit addresses, balance, networks and payouts. */\nexport class Crypto extends APIResource {\n readonly balance = new CryptoBalance(this.http);\n readonly depositAddresses = new DepositAddresses(this.http);\n readonly networks = new CryptoNetworks(this.http);\n readonly payouts = new CryptoPayouts(this.http);\n}\n","import type { RequestOptions } from '../core';\nimport { PagePromise } from '../pagination';\nimport { APIResource } from '../resource';\nimport type { QueryParams, RequestBody, Schemas } from '../types';\n\nexport type MerchantListParams = Omit<QueryParams<'Merchants_listOrGetByRef'>, 'externalRef'>;\n\n/** Where a merchant gets paid (bank account or Pago Móvil). */\nexport class PayoutMethods extends APIResource {\n list(merchantId: string, options?: RequestOptions) {\n return this.call('Merchants_listPayoutMethods', { path: { id: merchantId } }, options);\n }\n\n create(merchantId: string, params: RequestBody<'Merchants_addPayoutMethod'>, options?: RequestOptions) {\n return this.call('Merchants_addPayoutMethod', { path: { id: merchantId }, body: params }, options);\n }\n\n setDefault(merchantId: string, methodId: string, options?: RequestOptions) {\n return this.call('Merchants_setDefaultPayoutMethod', { path: { id: merchantId, methodId } }, options);\n }\n\n delete(merchantId: string, methodId: string, options?: RequestOptions) {\n return this.call('Merchants_deletePayoutMethod', { path: { id: merchantId, methodId } }, options);\n }\n\n /** Send micro-deposits to this payout method. */\n startVerification(merchantId: string, methodId: string, options?: RequestOptions) {\n return this.call('Merchants_startVerifyMethod', { path: { id: merchantId, methodId } }, options);\n }\n\n /** Confirm the micro-deposit amounts the merchant saw. */\n confirmVerification(\n merchantId: string,\n methodId: string,\n params: RequestBody<'Merchants_confirmVerifyMethod'>,\n options?: RequestOptions,\n ) {\n return this.call(\n 'Merchants_confirmVerifyMethod',\n { path: { id: merchantId, methodId }, body: params },\n options,\n );\n }\n}\n\nexport class Merchants extends APIResource {\n readonly payoutMethods = new PayoutMethods(this.http);\n\n /** `externalRef` is required and is the idempotency key for merchant creation. */\n create(params: RequestBody<'Merchants_create'>, options?: RequestOptions) {\n return this.call('Merchants_create', { body: params }, options);\n }\n\n /** Await for one page (`items`, `nextCursor`), or `for await` over every merchant. */\n list(params: MerchantListParams = {}, options?: RequestOptions) {\n return new PagePromise<Schemas['MerchantListResponseDto']>(\n (cursor) =>\n this.call('Merchants_listOrGetByRef', { query: { ...params, cursor } }, options) as Promise<\n Schemas['MerchantListResponseDto']\n >,\n params.cursor,\n );\n }\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Merchants_getById', { path: { id } }, options);\n }\n\n /** Look up a merchant by the `externalRef` you created it with. */\n retrieveByRef(externalRef: string, options?: RequestOptions) {\n return this.call('Merchants_listOrGetByRef', { query: { externalRef } }, options) as Promise<\n Schemas['MerchantResponseDto']\n >;\n }\n\n update(id: string, params: RequestBody<'Merchants_update'>, options?: RequestOptions) {\n return this.call('Merchants_update', { path: { id }, body: params }, options);\n }\n\n delete(id: string, options?: RequestOptions) {\n return this.call('Merchants_remove', { path: { id } }, options);\n }\n\n retrieveBalance(id: string, options?: RequestOptions) {\n return this.call('Merchants_getBalance', { path: { id } }, options);\n }\n\n /** Move VES between this merchant's balance and another. */\n transfer(id: string, params: RequestBody<'Merchants_transfer'>, options?: RequestOptions) {\n return this.call('Merchants_transfer', { path: { id }, body: params }, options);\n }\n\n listAuditEvents(id: string, options?: RequestOptions) {\n return this.call('Merchants_listAuditEvents', { path: { id } }, options);\n }\n\n /** Send micro-deposits to the merchant's default payout method. */\n startVerification(id: string, options?: RequestOptions) {\n return this.call('Merchants_startVerify', { path: { id } }, options);\n }\n\n confirmVerification(id: string, params: RequestBody<'Merchants_confirmVerify'>, options?: RequestOptions) {\n return this.call('Merchants_confirmVerify', { path: { id }, body: params }, options);\n }\n}\n","import type { RequestOptions } from '../core';\nimport { APIResource } from '../resource';\nimport type { RequestBody } from '../types';\n\n/** Pago Móvil C2P: request the bank OTP, then charge with the customer's token. */\nexport class C2p extends APIResource {\n /** Create a C2P intent; the payer's bank sends them a token (see `otpRequested`). */\n request(params: RequestBody<'Payments_requestC2p'>, options?: RequestOptions) {\n return this.call('Payments_requestC2p', { body: params }, options);\n }\n\n /** Charge with the bank-issued token. Pass `intentId` from `request()`. */\n execute(params: RequestBody<'Payments_executeC2p'>, options?: RequestOptions) {\n return this.call('Payments_executeC2p', { body: params }, options);\n }\n}\n\n/** Card payments (VPOS). Prefer the hosted/embedded checkout so card data never touches your servers. */\nexport class Vpos extends APIResource {\n create(params: RequestBody<'Payments_executeVpos'>, options?: RequestOptions) {\n return this.call('Payments_executeVpos', { body: params }, options);\n }\n}\n\n/** Confirm a Pago Móvil the customer already sent to you. */\nexport class PagoMovil extends APIResource {\n /**\n * The account your customers must send the Pago Móvil to (bank, phone, identification).\n * Don't offer Pago Móvil while `configured` is false.\n */\n receivingAccount(options?: RequestOptions) {\n return this.call('Payments_getPagoMovilReceivingAccount', {}, options);\n }\n\n verify(params: RequestBody<'Payments_verifyPagoMovil'>, options?: RequestOptions) {\n return this.call('Payments_verifyPagoMovil', { body: params }, options);\n }\n}\n\n/** Débito inmediato (advanced payments, enabled per account). */\nexport class Debit extends APIResource {\n requestOtp(params: RequestBody<'R4Operations_generarOtp'>, options?: RequestOptions) {\n return this.call('R4Operations_generarOtp', { body: params }, options);\n }\n\n execute(params: RequestBody<'R4Operations_debitoInmediato'>, options?: RequestOptions) {\n return this.call('R4Operations_debitoInmediato', { body: params }, options);\n }\n}\n\n/** Crédito inmediato and disbursements (advanced payments, enabled per account). */\nexport class Credit extends APIResource {\n /** Instant credit to a Pago Móvil phone. */\n create(params: RequestBody<'R4Operations_creditoInmediato'>, options?: RequestOptions) {\n return this.call('R4Operations_creditoInmediato', { body: params }, options);\n }\n\n /** Instant credit to a bank account. */\n toAccount(params: RequestBody<'R4Operations_creditoCuentas'>, options?: RequestOptions) {\n return this.call('R4Operations_creditoCuentas', { body: params }, options);\n }\n\n /** Disburse one credit across several recipients. */\n disburse(params: RequestBody<'R4Operations_dispersarCredito'>, options?: RequestOptions) {\n return this.call('R4Operations_dispersarCredito', { body: params }, options);\n }\n}\n\n/** Bank operation status for débito/crédito (advanced payments, enabled per account). */\nexport class Operations extends APIResource {\n retrieve(id: string, options?: RequestOptions) {\n return this.call('R4Operations_consultarOperacion', { path: { id } }, options);\n }\n\n /** Re-check a pending operation with the bank now. */\n poll(params: RequestBody<'R4Operations_pollOperation'>, options?: RequestOptions) {\n return this.call('R4Operations_pollOperation', { body: params }, options);\n }\n}\n\n/** Account payout dispersion (advanced payments, enabled per account). */\nexport class Dispersals extends APIResource {\n create(params: RequestBody<'R4Operations_dispersarPagos'>, options?: RequestOptions) {\n return this.call('R4Operations_dispersarPagos', { body: params }, options);\n }\n}\n\n/** Vuelto / change payments (advanced payments, enabled per account). */\nexport class Change extends APIResource {\n create(params: RequestBody<'R4Operations_ejecutarVuelto'>, options?: RequestOptions) {\n return this.call('R4Operations_ejecutarVuelto', { body: params }, options);\n }\n}\n\nexport class Payments extends APIResource {\n readonly c2p = new C2p(this.http);\n readonly vpos = new Vpos(this.http);\n readonly pagoMovil = new PagoMovil(this.http);\n readonly debit = new Debit(this.http);\n readonly credit = new Credit(this.http);\n readonly operations = new Operations(this.http);\n readonly dispersals = new Dispersals(this.http);\n readonly change = new Change(this.http);\n\n retrieve(id: string, options?: RequestOptions) {\n return this.call('Payments_getPayment', { path: { id } }, options);\n }\n\n /** Look up a payment by the `externalRef` you sent. */\n retrieveByRef(externalRef: string, options?: RequestOptions) {\n return this.call('Payments_getPaymentByRef', { path: { externalRef } }, options);\n }\n\n /** Reverse a completed C2P payment. */\n reverse(id: string, options?: RequestOptions) {\n return this.call('Payments_reversePayment', { path: { id } }, options);\n }\n}\n","import { createHmac, timingSafeEqual } from 'node:crypto';\nimport { VexPaySignatureVerificationError } from './errors';\n\nexport const WEBHOOK_EVENT_NAMES = [\n 'payment.pending',\n 'payment.completed',\n 'payment.failed',\n 'payment.canceled',\n 'payment.reversed',\n 'merchant.verified',\n 'merchant.rejected',\n 'merchant.deactivated',\n 'merchant.reactivated',\n 'merchant.balance.updated',\n 'merchant.created',\n 'merchant.activated',\n 'merchant.updated',\n 'merchant.kyb_required',\n 'merchant.restricted',\n 'merchant.capability.updated',\n 'merchant.wallet_credit',\n 'payout.completed',\n 'payout.failed',\n 'tenant.status_changed',\n 'tenant.api_key.created',\n 'tenant.api_key.rotated',\n 'tenant.api_key.revoked',\n 'tenant.live_status_changed',\n 'notification.test',\n] as const;\n\nexport type WebhookEventName = (typeof WEBHOOK_EVENT_NAMES)[number];\n\n/** `data` of every `payment.*` event. */\nexport interface PaymentWebhookData {\n paymentId: string;\n externalRef?: string;\n status: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'REVERSED';\n method: 'C2P' | 'VPOS' | 'PAGO_MOVIL' | 'DEBITO_INMEDIATO';\n usdAmount: number;\n vesAmount: number;\n bcvRate: number;\n feeUsd?: number;\n feeVes?: number;\n netVes?: number;\n bankReference?: string;\n bankTxId?: number;\n debtorId?: string;\n debtorPhone?: string;\n debtorBankCode?: number;\n debtorBankName?: string;\n cardLast4?: string;\n cardBrand?: string;\n cardProduct?: string;\n accountTypeLabel?: string;\n tenantName: string;\n createdAt: string;\n failureCode?: string;\n cancelReason?: 'superseded' | 'expired';\n reversedAt?: string;\n reversalRef?: string;\n reversalTxId?: number;\n livemode: boolean;\n /** Present when the payment came from a checkout session. */\n checkoutSession?: { id: string; reference: string | null; metadata: Record<string, string> };\n}\n\ntype PaymentEventName = Extract<WebhookEventName, `payment.${string}`>;\n\n/** A verified webhook delivery, discriminated by `event`. */\nexport type WebhookEvent =\n | { event: PaymentEventName; data: PaymentWebhookData; timestamp: string }\n | {\n event: Exclude<WebhookEventName, PaymentEventName>;\n data: Record<string, unknown> & { livemode: boolean };\n timestamp: string;\n };\n\nexport const SIGNATURE_HEADER = 'VexPay-Signature';\nexport const DEFAULT_TOLERANCE_SECONDS = 300;\n\nconst RAW_BODY_HINT =\n 'Pass the raw request body exactly as received (string or Buffer). Parsing and re-serializing JSON — e.g. JSON.stringify(req.body) — changes the bytes and breaks the signature. In Express use express.raw({ type: \"application/json\" }) on the webhook route.';\n\nfunction sign(secret: string, timestamp: number | string, payload: string): string {\n return createHmac('sha256', secret).update(`${timestamp}.${payload}`, 'utf8').digest('hex');\n}\n\nfunction parseHeader(header: string): { timestamp: number; signatures: string[] } | null {\n let timestamp: string | undefined;\n const signatures: string[] = [];\n for (const part of header.split(',')) {\n const index = part.indexOf('=');\n if (index <= 0) return null;\n const key = part.slice(0, index).trim();\n const value = part.slice(index + 1).trim();\n if (key === 't') timestamp = value;\n else if (key === 'v1') signatures.push(value);\n // Unknown schemes (v0, future v2…) are ignored.\n }\n if (!timestamp || !/^\\d+$/.test(timestamp)) return null;\n return { timestamp: Number(timestamp), signatures };\n}\n\nfunction safeEqualHex(expected: string, actual: string): boolean {\n const a = Buffer.from(expected, 'utf8');\n const b = Buffer.from(actual, 'utf8');\n return a.length === b.length && timingSafeEqual(a, b);\n}\n\nexport class Webhooks {\n /**\n * Verifies a delivery's `VexPay-Signature` header and returns the parsed event.\n * Throws VexPaySignatureVerificationError on a bad signature or a stale timestamp.\n */\n constructEvent(\n rawBody: string | Buffer | Uint8Array,\n signatureHeader: string | string[] | null | undefined,\n secret: string,\n options: { toleranceSeconds?: number; now?: number } = {},\n ): WebhookEvent {\n if (typeof rawBody !== 'string' && !(rawBody instanceof Uint8Array)) {\n throw new VexPaySignatureVerificationError(`Webhook payload must be the raw body. ${RAW_BODY_HINT}`);\n }\n if (!secret) {\n throw new VexPaySignatureVerificationError('A webhook signing secret is required.');\n }\n const payload = typeof rawBody === 'string' ? rawBody : Buffer.from(rawBody).toString('utf8');\n const header = Array.isArray(signatureHeader) ? signatureHeader[0] : signatureHeader;\n const parsed = header ? parseHeader(header) : null;\n if (!parsed) {\n throw new VexPaySignatureVerificationError(\n `Unable to parse the ${SIGNATURE_HEADER} header. Expected \"t=<timestamp>,v1=<signature>\".`,\n );\n }\n if (parsed.signatures.length === 0) {\n throw new VexPaySignatureVerificationError(`No v1 signatures found in the ${SIGNATURE_HEADER} header.`);\n }\n\n const tolerance = options.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;\n const now = options.now ?? Math.floor(Date.now() / 1000);\n if (tolerance > 0 && Math.abs(now - parsed.timestamp) > tolerance) {\n throw new VexPaySignatureVerificationError(\n `Webhook timestamp is outside the ${tolerance}s tolerance — possible replay. Check your server clock if this repeats.`,\n );\n }\n\n const expected = sign(secret, parsed.timestamp, payload);\n if (!parsed.signatures.some((candidate) => safeEqualHex(expected, candidate))) {\n throw new VexPaySignatureVerificationError(\n `No signature matches the expected signature for this payload. Check the endpoint secret. ${RAW_BODY_HINT}`,\n );\n }\n\n try {\n return JSON.parse(payload) as WebhookEvent;\n } catch {\n throw new VexPaySignatureVerificationError('Webhook payload is not valid JSON.');\n }\n }\n\n /** Builds a valid `VexPay-Signature` value — for your own tests. */\n generateTestHeader({\n payload,\n secret,\n timestamp = Math.floor(Date.now() / 1000),\n }: {\n payload: string;\n secret: string;\n timestamp?: number;\n }): string {\n return `t=${timestamp},v1=${sign(secret, timestamp, payload)}`;\n }\n}\n","import { HttpClient, type CoreConfig } from './core';\nimport { VexPayConfigurationError } from './errors';\nimport {\n Balance,\n Banks,\n Payouts,\n Quotes,\n TenantPayoutAccount,\n WebhookEndpoints,\n} from './resources/account';\nimport { Checkout, PaymentLinks, Products } from './resources/commerce';\nimport { Crypto } from './resources/crypto';\nimport { Merchants } from './resources/merchants';\nimport { Payments } from './resources/payments';\nimport { Webhooks } from './webhooks';\n\nexport const DEFAULT_BASE_URL = 'https://api.pay.vexwallet.co';\n\nexport interface VexPayOptions {\n /** API origin. Defaults to production (`https://api.pay.vexwallet.co`). */\n baseUrl?: string;\n /** Per-attempt timeout. Default 30 000 ms. */\n timeoutMs?: number;\n /** Retries for connection errors, timeouts, 429 and 5xx. Default 2. */\n maxNetworkRetries?: number;\n /** Custom fetch (proxies, instrumentation, tests). Defaults to the global fetch. */\n fetch?: typeof fetch;\n}\n\nexport class VexPay {\n /** @internal */\n readonly http: HttpClient;\n\n readonly banks: Banks;\n readonly quotes: Quotes;\n readonly balance: Balance;\n readonly payments: Payments;\n readonly checkout: Checkout;\n readonly merchants: Merchants;\n readonly payouts: Payouts;\n /** USDT: deposit addresses, balance, networks and payouts. */\n readonly crypto: Crypto;\n readonly products: Products;\n readonly paymentLinks: PaymentLinks;\n readonly tenantPayoutAccount: TenantPayoutAccount;\n readonly webhookEndpoints: WebhookEndpoints;\n /** Offline helpers: `constructEvent` verifies deliveries; no API calls. */\n readonly webhooks = new Webhooks();\n\n constructor(apiKey: string, options: VexPayOptions = {}) {\n if (typeof apiKey !== 'string' || apiKey.trim() === '') {\n throw new VexPayConfigurationError(\n 'A VEXPay API key is required: new VexPay(process.env.VEXPAY_API_KEY).',\n );\n }\n const fetchImpl = options.fetch ?? globalThis.fetch;\n if (typeof fetchImpl !== 'function') {\n throw new VexPayConfigurationError('No fetch implementation found. Use Node.js 20+ or pass options.fetch.');\n }\n const config: CoreConfig = {\n apiKey: apiKey.trim(),\n baseUrl: options.baseUrl ?? DEFAULT_BASE_URL,\n timeoutMs: options.timeoutMs ?? 30_000,\n maxNetworkRetries: options.maxNetworkRetries ?? 2,\n fetch: fetchImpl.bind(globalThis),\n };\n this.http = new HttpClient(config);\n\n this.banks = new Banks(this.http);\n this.quotes = new Quotes(this.http);\n this.balance = new Balance(this.http);\n this.payments = new Payments(this.http);\n this.checkout = new Checkout(this.http);\n this.merchants = new Merchants(this.http);\n this.payouts = new Payouts(this.http);\n this.crypto = new Crypto(this.http);\n this.products = new Products(this.http);\n this.paymentLinks = new PaymentLinks(this.http);\n this.tenantPayoutAccount = new TenantPayoutAccount(this.http);\n this.webhookEndpoints = new WebhookEndpoints(this.http);\n }\n}\n"],"mappings":";AACO,IAAM,cAAN,cAA0B,MAAM;AAAA;AAAA,EAE5B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAET,YACE,SACA,UAAkF,CAAC,GACnF;AACA,UAAM,OAAO;AACb,SAAK,OAAO,WAAW;AACvB,SAAK,SAAS,QAAQ;AACtB,SAAK,OAAO,QAAQ;AACpB,SAAK,OAAO,QAAQ;AACpB,SAAK,YAAY,QAAQ;AAAA,EAC3B;AACF;AAGO,IAAM,2BAAN,cAAuC,YAAY;AAAC;AAGpD,IAAM,4BAAN,cAAwC,YAAY;AAAC;AAGrD,IAAM,4BAAN,cAAwC,YAAY;AAAC;AAGrD,IAAM,sBAAN,cAAkC,YAAY;AAAC;AAG/C,IAAM,sBAAN,cAAkC,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AA,IAClC;AACA,SAAK,OAAO,IAAI,WAAW,MAAM;AAEjC,SAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;AAChC,SAAK,SAAS,IAAI,OAAO,KAAK,IAAI;AAClC,SAAK,UAAU,IAAI,QAAQ,KAAK,IAAI;AACpC,SAAK,WAAW,IAAI,SAAS,KAAK,IAAI;AACtC,SAAK,WAAW,IAAI,SAAS,KAAK,IAAI;AACtC,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AACxC,SAAK,UAAU,IAAI,QAAQ,KAAK,IAAI;AACpC,SAAK,SAAS,IAAI,OAAO,KAAK,IAAI;AAClC,SAAK,WAAW,IAAI,SAAS,KAAK,IAAI;AACtC,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,sBAAsB,IAAI,oBAAoB,KAAK,IAAI;AAC5D,SAAK,mBAAmB,IAAI,iBAAiB,KAAK,IAAI;AAAA,EACxD;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vexpay/node",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Official Node.js/TypeScript SDK for the VEXPay API \u2014 Venezuelan payments (Pago M\u00f3vil C2P, cards, d\u00e9bito inmediato), payouts, checkout sessions, and signed webhooks.",
5
5
  "license": "MIT",
6
6
  "keywords": [