@push.rocks/smartrequest
Version:
A module for modern HTTP/HTTPS requests with support for form data, file uploads, JSON, binary data, streams, and more.
17 lines (16 loc) • 923 B
TypeScript
import type { ICoreResponse } from '../../core_base/types.js';
import { type TPaginationConfig, type TPaginatedResponse } from '../types/pagination.js';
/**
* Creates a paginated response from a regular response
*/
export declare function createPaginatedResponse<T>(response: ICoreResponse<any>, paginationConfig: TPaginationConfig, queryParams: Record<string, string>, fetchNextPage: (params: Record<string, string>) => Promise<TPaginatedResponse<T>>): Promise<TPaginatedResponse<T>>;
/**
* Parse Link header for pagination
* Link: <https://api.example.com/users?page=2>; rel="next", <https://api.example.com/users?page=5>; rel="last"
*/
export declare function parseLinkHeader(header: string): Record<string, string>;
/**
* Get a nested value from an object using dot notation path
* e.g., getValueByPath(obj, "data.pagination.nextCursor")
*/
export declare function getValueByPath(obj: any, path?: string): any;