bump-cli
Version:
The Bump CLI is used to interact with your API documentation hosted on Bump.sh by using the API of developers.bump.sh
59 lines (58 loc) • 2.37 kB
TypeScript
import { JSONSchema4, JSONSchema4Array, JSONSchema4Object, JSONSchema6, JSONSchema6Object, JSONSchema7 } from 'json-schema';
type SpecSchema = JSONSchema4 | JSONSchema6 | JSONSchema7;
declare class SupportedFormat {
static readonly asyncapi: Record<string, SpecSchema>;
static readonly openapi: Record<string, SpecSchema>;
}
declare class API {
readonly definition: APIDefinition;
readonly location: string;
overlayedDefinition: APIDefinition | undefined;
readonly rawDefinition: string;
readonly references: APIReference[];
readonly spec?: SpecSchema;
readonly specName: string;
readonly version: string;
constructor(location: string, values: SpecSchema);
static isAsyncAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is AsyncAPI;
static isOpenAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPI;
static isOpenAPIOverlay(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPIOverlay;
static load(path: string): Promise<API>;
applyOverlay(overlayPath: string): Promise<void>;
extractDefinition(outputPath?: string, overlays?: string[] | undefined): Promise<[string, APIReference[]]>;
getSpec(definition: APIDefinition): SpecSchema;
getSpecName(definition: APIDefinition): string;
getVersion(definition: APIDefinition): string;
guessFormat(output?: string): string;
isMainRefPath(path: string): boolean;
resolveContent(values: SpecSchema): [string, APIDefinition];
resolveRelativeLocation(absPath: string): string;
serializeDefinition(outputPath?: string): string;
versionWithoutPatch(): string;
private url;
}
type APIReference = {
content: string;
location: string;
};
type APIDefinition = AsyncAPI | OpenAPI | OpenAPIOverlay;
type InfoObject = {
readonly description?: string;
readonly title: string;
readonly version: string;
};
type OpenAPI = {
readonly info: InfoObject;
readonly openapi?: string;
readonly swagger?: string;
} & JSONSchema4Object;
type OpenAPIOverlay = {
readonly actions: JSONSchema4Array;
readonly info: InfoObject;
readonly overlay: string;
} & JSONSchema4Object;
type AsyncAPI = {
readonly asyncapi: string;
readonly info: InfoObject;
} & JSONSchema4Object;
export { API, APIDefinition, OpenAPIOverlay, SupportedFormat };