@scalar/api-client
Version:
the open source API testing client
35 lines • 1.41 kB
TypeScript
import type { ComponentsObject, OpenApiDocument, SecurityRequirementObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
/** Format a scheme object into a display object */
export declare const formatScheme: ({ name, type, value, }: {
name: string;
type: SecuritySchemeObject["type"] | "complex";
value: SecurityRequirementObject;
}) => {
id: string;
label: string;
value: SecurityRequirementObject;
};
/** Formats complex security schemes */
export declare const formatComplexScheme: (scheme: NonNullable<OpenApiDocument["security"]>[number]) => {
id: string;
label: string;
value: SecurityRequirementObject;
};
export type SecuritySchemeOption = {
id: string;
label: string;
value: SecurityRequirementObject;
isDeletable?: boolean;
payload?: SecuritySchemeObject;
};
export type SecuritySchemeGroup = {
label: string;
options: SecuritySchemeOption[];
};
/**
* Generates the options for the security scheme combobox
*
* contains either a flat list, or different groups of required, available, and add new
*/
export declare const getSecuritySchemeOptions: (security: NonNullable<OpenApiDocument["security"]>, securitySchemes: NonNullable<ComponentsObject["securitySchemes"]>, isReadOnly?: boolean) => SecuritySchemeOption[] | SecuritySchemeGroup[];
//# sourceMappingURL=security-scheme.d.ts.map