UNPKG

netstorage

Version:

A TypeScript API and CLI for the Akamai NetStorage REST interface

28 lines (27 loc) 1.16 kB
import { type NetStorageClientConfig, type RequestOptions } from '../index'; /** * Parameters for a generic NetStorage HTTP request. * * @property request - Custom request settings including the HTTP method. * @property headers - Optional HTTP headers to include in the request. * @property body - Optional request payload (e.g., string, FormData, stream). * @property options - Optional settings for request timeout or abort signal. */ export interface GenericRequestParams { request?: { method?: string; }; headers?: Record<string, string>; body?: BodyInit | null; options?: RequestOptions; } /** * Executes a NetStorage API request and parses the XML response. * * @param config - The client config containing credentials and logger. * @param path - The API path to send the request to. * @param params - Optional configuration for method, headers, body, and options. * @returns The parsed response body, typed as T. * @throws HttpError if the HTTP response status indicates a failure. */ export declare function sendRequest<T>(config: NetStorageClientConfig, path: string, params?: GenericRequestParams): Promise<T>;