UNPKG

@sirhc77/postman-sdk-gen

Version:

Generate a fully-typed TypeScript SDK from a Postman collection, with support for Axios or Fetch, folder-based namespacing, and auto-inferred types.

20 lines (19 loc) 635 B
import { Collection, RequestAuth, Url } from "postman-collection"; export interface ParsedCollection { auth: RequestAuth; endpoints: ParsedEndpoint[]; } export interface ParsedEndpoint { name: string; method: string; url: Url; pathParams: string[]; queryParams: string[]; requestBody?: string; headers: Record<string, string>; responseSample: string | undefined; namespacePath: string[]; effectiveAuth: RequestAuth; } export declare function loadCollection(collectionPath: string): Promise<Collection>; export declare function extractEndpoints(collection: Collection): ParsedCollection;