index.js 868 Bytes
/**
 * @drama/service-call —— 外部服务调用的稳定性组合器(唯一对外入口)。
 *
 * 纯高阶函数:输入若干个同形 `async fn`,输出一个同形 `fn`。零 IO、零 DB、零依赖。
 * 包不认识 key/凭据/厂商/审计——候选数组怎么构造、key 从哪来(env 常量或 keyrouter 池)、
 * observe 落不落审计,全部属于调用方(装配层)。
 */

export { DEFAULT_RETRY_POLICY, isRetryableReason, shouldRetry, backoffDelayMs } from './retry.js'
export { mapHttpStatus, isTimeoutError, isAbortError } from './http.js'
export { isRetryableError, withRetry, withFallback, bindEach } from './combinators.js'

/** @typedef {import('./retry.js').RetryPolicy} RetryPolicy */
/** @typedef {import('./retry.js').CallErrorReason} CallErrorReason */
/** @typedef {import('./http.js').MappedError} MappedError */