@scalar/api-client
Version:
the open source API testing client
145 lines • 6.05 kB
TypeScript
import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
import type { AuthMeta } from '@scalar/workspace-store/mutators';
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
import type { ClientLayout } from '../../../hooks/index.js';
import { type History } from '../../../v2/blocks/scalar-address-bar-block/index.js';
import type { ClientPlugin } from '../../../v2/plugins';
/**
* OperationBlock
*
* Orchestrates the operation view by wiring together the Header, OperationBlock,
* and ResponseBlock. Forwards user interactions to the workspace event bus and
* passes through configuration such as auth, servers, plugins, and environment.
* This component keeps the Operation page lean by centralizing event emission
* and prop wiring between the blocks.
*
* Notable behavior:
* - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide
* draft overrides for the UI when present.
*/
declare const _default: import("vue").DefineComponent<{
eventBus: WorkspaceEventBus;
/** Application version */
appVersion: string;
/** Current request path */
path: string;
/** Current request method */
method: HttpMethodType;
/** Client layout */
layout: ClientLayout;
/** Currently selected server */
server: ServerObject | null;
/** Server list available for operation/document */
servers: ServerObject[];
/** List of request history */
history: History[];
/**
* When the request is sent from the modal, this indicates the progress percentage
* of the request being sent.
*
* The amount remaining to load from 100 -> 0
*/
requestLoadingPercentage?: number;
/** Preprocessed response */
response?: ResponseInstance;
/** Original request instance */
request?: Request;
/** Total number of performed requests */
totalPerformedRequests: number;
/** Sidebar open state */
isSidebarOpen?: boolean;
/** Controls sidebar visibility */
showSidebar?: boolean;
/** Hides the client button on the header */
hideClientButton?: boolean;
/** Client integration */
integration?: string | null;
/** Openapi document url for `modal` mode to open the client app */
documentUrl?: string;
/** Client source */
source?: "gitbook" | "api-reference";
/** Operation object */
operation: OperationObject;
/** Currently selected example key for the current operation */
exampleKey: string;
/** Meta information for the auth update */
authMeta?: AuthMeta;
/** Document defined security schemes */
securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"];
/** Currently selected security for the current operation */
selectedSecurity: OpenApiDocument["x-scalar-selected-security"];
/** Required security for the operation/document */
security: OpenApiDocument["security"];
/** Client plugins */
plugins?: ClientPlugin[];
/** For environment variables in the inputs */
environment: XScalarEnvironment;
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
"update:servers": () => any;
}, string, import("vue").PublicProps, Readonly<{
eventBus: WorkspaceEventBus;
/** Application version */
appVersion: string;
/** Current request path */
path: string;
/** Current request method */
method: HttpMethodType;
/** Client layout */
layout: ClientLayout;
/** Currently selected server */
server: ServerObject | null;
/** Server list available for operation/document */
servers: ServerObject[];
/** List of request history */
history: History[];
/**
* When the request is sent from the modal, this indicates the progress percentage
* of the request being sent.
*
* The amount remaining to load from 100 -> 0
*/
requestLoadingPercentage?: number;
/** Preprocessed response */
response?: ResponseInstance;
/** Original request instance */
request?: Request;
/** Total number of performed requests */
totalPerformedRequests: number;
/** Sidebar open state */
isSidebarOpen?: boolean;
/** Controls sidebar visibility */
showSidebar?: boolean;
/** Hides the client button on the header */
hideClientButton?: boolean;
/** Client integration */
integration?: string | null;
/** Openapi document url for `modal` mode to open the client app */
documentUrl?: string;
/** Client source */
source?: "gitbook" | "api-reference";
/** Operation object */
operation: OperationObject;
/** Currently selected example key for the current operation */
exampleKey: string;
/** Meta information for the auth update */
authMeta?: AuthMeta;
/** Document defined security schemes */
securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"];
/** Currently selected security for the current operation */
selectedSecurity: OpenApiDocument["x-scalar-selected-security"];
/** Required security for the operation/document */
security: OpenApiDocument["security"];
/** Client plugins */
plugins?: ClientPlugin[];
/** For environment variables in the inputs */
environment: XScalarEnvironment;
}> & Readonly<{
"onUpdate:servers"?: (() => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
export default _default;
//# sourceMappingURL=OperationBlock.vue.d.ts.map