import { ExecuteAFM as AFM, Execution } from "@gooddata/typings"; import * as e from "express"; import { IConfig } from "../../model/Config"; import { IMockProject } from "../../model/MockProject"; import IExecutionResponseWrapper = Execution.IExecutionResponseWrapper; import IExecutionResultWrapper = Execution.IExecutionResultWrapper; /** * Combination of both AFM executions responses. * * The local interface is used instead of the synonymous interface from `@gooddata/typings` for compatibility with * mock-js schemas that were created based on `@gooddata/typings@1.0.1` version. * * `null` value as executionResult means empty response (HTTP 204) */ export interface IExecutionResponses { executionResponse: IExecutionResponseWrapper; executionResult: IExecutionResultWrapper | null; } export interface IErrorResponse { error: { statusCode: number; message: string; }; } export declare function isErrorResponse(response: any): response is IErrorResponse; export declare function isExecutionValid(afm: AFM.IAfm, resultSpec: AFM.IResultSpec): boolean; export declare function getNormalizedExecution(execution: AFM.IExecution): AFM.IExecution; export declare function sanitize(execution: AFM.IExecution): AFM.IExecution; export declare type CachedResponse = IExecutionResultWrapper | number; export interface ICacheEntry { response: CachedResponse; createdAt: number; } export declare function addToCache(key: string, response: CachedResponse): void; export declare function getFromCache(key: string): CachedResponse | undefined; export declare function hasCachedResult(key: string): boolean; export declare function cleanOldCache(lifetime?: number): void; export declare function doExecuteAfm(project: IMockProject, execution: AFM.IExecution, config: IConfig): Execution.IExecutionResponseWrapper | IErrorResponse; export declare const executeAfm: { register(app: e.Application, project: IMockProject, config: IConfig): e.Application; };