st-open-api
Version:
Generates API client SDKs from an OpenAPI specification written in OpenAPI version 3.x.x
165 lines (164 loc) • 4.81 kB
TypeScript
import { IPropertyClass, IRenderResult } from "../interface/i-property-class";
import { UniqueArray } from "./unique-array";
import { FolderManager } from "./folder-manager";
import { IHeaderParameter } from "../interface/i-header-parameter";
export declare const HTTP_FUNCTION_REF: (folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
};
export declare const HTTP_REQUEST_INTERCEPTOR_INTERFACE_REF: (folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
};
export declare const HTTP_RESPONSE_INTERCEPTOR_INTERFACE_REF: (folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
};
export declare const HTTP_ERROR_HANDLER_INTERFACE_REF: (folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
};
export declare const OPEN_API_FUNCTION_REF: (folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
};
export declare const QUERY_PARAMETER_FUNCTION_REF: (folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
};
export declare const SERVICE_REFERENCES: ((folder: FolderManager) => {
fileName: string;
refKey: string;
className: string;
folderPath: string;
})[];
export declare class ObjectProperty implements IPropertyClass {
className: string;
fileName: string;
description: Array<string>;
imports: UniqueArray<string>;
functions: Array<{
data: IMustacheFunction;
imports: Array<string>;
name: string;
}>;
properties: Array<{
data: IMustacheProperty;
import?: string;
name: string;
}>;
constructor(originalName: string);
private convertName;
addImports(_import: string): void;
addFunction(fun: IFunction): void;
addProperty(prop: IProperty): void;
render(): IRenderResult;
}
interface IMustacheFunction {
functionName: string;
httpMethod: string;
originalPath: string;
isPathParameters: boolean;
pathParameterClassName?: string;
pathParameters?: Array<string>;
isJsonResponse: boolean;
isPlaintextResponse: boolean;
isDownloadResponse: boolean;
isRequestBodyJson: boolean;
isDescription: boolean;
description?: Array<string>;
isQueryParameters: boolean;
queryParameterClassName?: string;
queryParameters?: Array<string>;
isHeaderParameters: boolean;
headerParameterClassName?: string;
headerParameters?: Array<{
name: string;
nameOriginal: string;
required: boolean;
}>;
isRequestBody: boolean;
requestBodyClass?: string;
forceInterceptor: boolean;
isResponse: boolean;
responseClass?: string;
}
export interface IFunction {
functionName: string;
imports: Array<string>;
httpMethod: string;
originalPath: string;
pathParameters?: {
className: string;
params: Array<string>;
};
headerParameters?: {
className: string;
params: {
[parameterName: string]: IHeaderParameter;
};
};
queryParameters?: {
className: string;
params: Array<string>;
};
requestBody: IFunctionRequestBody;
response: IFunctionResponse;
description: string;
forceInterceptor: boolean;
}
export interface IFunctionResponse {
isJsonResponse: boolean;
isPlaintextResponse: boolean;
isDownloadResponse: boolean;
responseClass?: string;
}
export type RequestBodyCardinality = "oneOf" | "single";
interface IFunctionRequestBodyBase {
isRequestBodyJson: boolean;
requestBodyCardinality?: RequestBodyCardinality;
requestBodyClass?: string | string[];
}
export interface IFunctionRequestBodySingle extends IFunctionRequestBodyBase {
requestBodyCardinality: "single";
requestBodyClass?: string;
}
export interface IFunctionRequestBodyOneOf extends IFunctionRequestBodyBase {
requestBodyCardinality: "oneOf";
requestBodyClass?: string[];
}
export interface IFunctionRequestBodyNonJSON extends IFunctionRequestBodyBase {
isRequestBodyJson: false;
requestBodyCardinality: undefined;
requestBodyClass: undefined;
}
export type IFunctionRequestBody = IFunctionRequestBodySingle | IFunctionRequestBodyOneOf;
interface IMustacheProperty {
propertyName: string;
isDescription: boolean;
description?: Array<string>;
required: boolean;
isArray: boolean;
value: string;
}
export interface IProperty {
propertyName: string;
import: string;
description?: string;
required: boolean;
isArray: boolean;
value: string;
}
export {};