UNPKG

@scalar/api-client

Version:

the open source API testing client

27 lines 1.31 kB
import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'; import type { ParameterObject, ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; /** * Converts the parameters into a set of headers, cookies and url params while * replacing environment variables and extracting example values. Also builds up a record of the path * parameters which can then be used to replace variables in the path. * Also handles both content based and schema based parameters. * * @param parameters - Unfiltered parameters * @param env - Environment variables flattened into a key-value object * @param exampleKey - The key of the current example * @param contentType - Content type for content based parameters * @returns A set of headers, cookies and url params */ export declare const buildRequestParameters: ( /** All parameters */ parameters?: ReferenceType<ParameterObject>[], /** Environment variables flattened into a key-value object */ env?: Record<string, string>, /** The key of the current example */ exampleKey?: string) => { cookies: XScalarCookie[]; headers: Record<string, string>; pathVariables: Record<string, string>; urlParams: URLSearchParams; }; //# sourceMappingURL=build-request-parameters.d.ts.map