Module exposing: buildRetryOptions, RetryPolicy, retryDelayMs, shouldRetry, delayFromRetryAfterHeader, sleep
// Source: https://github.com/context-plugins/plugin-marketplace | License: MIT | Copyright 2026- APIMatic
// Provided via justclaw.it.com; keep this notice with the code.
import type { HttpMethod } from "./api-request.js";
import { ConfigurationError, type ConnectionError, type TimeoutError } from "./errors.js";
import type { HttpLogger } from "./http-logger.js";
import * as s from "./validation/index.js";
import type { Schema } from "./validation/schema.js";
const MAX_DELAY_MS = 60_000;
const MAX_TIMEOUT_MS = 2_147_483_647;
const MAX_BACKOFF_FACTOR = 100;
const MIN_STATUS = 100;
const MAX_STATUS = 599;
const HTTP_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"] as const;
const DEFAULT_RETRY_OPTIONS: ResolvedRetryOptions = {
timeout: 60_000,
statusCodesToRetry:
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key