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
76 lines (75 loc) • 3.17 kB
TypeScript
import { JSONSchema4, JSONSchema4Array, JSONSchema4Object, JSONSchema6, JSONSchema6Object, JSONSchema7 } from 'json-schema';
type JSONSchema = JSONSchema4 | JSONSchema6 | JSONSchema7;
declare class SupportedFormat {
static readonly arazzo: Record<string, JSONSchema>;
static readonly asyncapi: Record<string, JSONSchema>;
static readonly flower: Record<string, JSONSchema>;
static readonly openapi: Record<string, JSONSchema>;
}
declare class API {
readonly definition: APIDefinition;
readonly location: string;
overlayedDefinition: APIDefinition | undefined;
readonly rawDefinition: string;
readonly references: APIReference[];
readonly specName?: string;
readonly version?: string;
constructor(location: string, data: Record<string, JSONSchemaWithRaw>);
static isArazzo(definition: JSONSchema4Object | JSONSchema6Object): definition is Arazzo;
static isAsyncAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is AsyncAPI;
static isFlower(definition: JSONSchema4Object | JSONSchema6Object): definition is Flower;
static isOpenAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPI;
static isOpenAPIOverlay(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPIOverlay;
static isSupportedFormat(definition: JSONSchema4Object | JSONSchema6Object): definition is APIDefinition;
static load(path: string): Promise<API>;
applyOverlay(overlayPath: string): Promise<void>;
extractDefinition(outputPath?: string, overlays?: string[] | undefined): Promise<[string, APIReference[]]>;
getSpec(definition: APIDefinition): JSONSchema | undefined;
getSpecName(definition: APIDefinition): string | undefined;
getVersion(definition: APIDefinition): string | undefined;
guessFormat(output?: string): string;
isMainRefPath(path: string): boolean;
serializeDefinition(outputPath?: string): string;
versionWithoutPatch(): string;
private _resolveArazzoSourceDescriptions;
private _resolveContentFrom;
private _resolveRelativeLocation;
private url;
}
type JSONSchemaWithRaw = {
readonly parsed?: JSONSchema4 | JSONSchema4Object | JSONSchema6 | JSONSchema6Object | string;
readonly raw?: string;
};
type APIReference = {
content: string;
location: string;
name?: string;
};
type APIDefinition = Arazzo | AsyncAPI | Flower | 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;
type Flower = {
readonly flower: string;
} & JSONSchema4Object;
type Arazzo = {
readonly arazzo: string;
readonly info: InfoObject;
} & JSONSchema4Object;
export { API, APIDefinition, OpenAPI, OpenAPIOverlay, SupportedFormat };