@scalar/api-client
Version:
the open source API testing client
32 lines • 1.52 kB
TypeScript
import { type ErrorResponse } from '../../libs/errors.js';
import type { EventBus } from '../../libs/event-bus.js';
import type { PluginManager } from '../../plugins/index.js';
import type { Cookie } from '@scalar/oas-utils/entities/cookie';
import type { Operation, RequestExample, ResponseInstance, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
export type RequestStatus = 'start' | 'stop' | 'abort';
/** Response from sendRequest hoisted so we can use it as the return type for createRequestOperation */
type SendRequestResponse = Promise<ErrorResponse<{
response: ResponseInstance;
request: RequestExample;
timestamp: number;
}>>;
export type SendRequestResult = Awaited<SendRequestResponse>[1];
/** Execute the request */
export declare const createRequestOperation: ({ environment, example, globalCookies, proxyUrl, request, securitySchemes, selectedSecuritySchemeUids, server, status, pluginManager, }: {
environment: object | undefined;
example: RequestExample;
globalCookies: Cookie[];
proxyUrl: string | undefined;
request: Operation;
securitySchemes: Record<string, SecurityScheme>;
selectedSecuritySchemeUids?: Operation["selectedSecuritySchemeUids"];
server?: Server | undefined;
status?: EventBus<RequestStatus>;
pluginManager?: PluginManager;
}) => ErrorResponse<{
controller: AbortController;
sendRequest: () => SendRequestResponse;
request: Request;
}>;
export {};
//# sourceMappingURL=create-request-operation.d.ts.map