UNPKG

@scalar/api-client

Version:

the open source API testing client

25 lines 1.42 kB
import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'; import type { OpenApiDocument, SecurityRequirementObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; /** * Get the selected security schemes from the selected security. * Takes security requirement objects and resolves them to actual security scheme objects. */ export declare const getSelectedSecuritySchemes: (securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"], selectedSecurity: SecurityRequirementObject[]) => SecuritySchemeObject[]; /** * Generates the headers, cookies and query params for selected security schemes * In the future we can add customization for where the security is applied */ export declare const buildRequestSecurity: ( /** Document defined security schemes */ securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"], /** Currently selected security for the current operation */ selectedSecurity: SecurityRequirementObject[], /** Environment variables flattened into a key-value object */ env?: Record<string, string>, /** Include this parameter to set the placeholder for empty tokens */ emptyTokenPlaceholder?: string) => { headers: Record<string, string>; cookies: XScalarCookie[]; urlParams: URLSearchParams; }; //# sourceMappingURL=build-request-security.d.ts.map