import { Config, InternalConfig } from '../config/configure'; export declare namespace ApiV3 { const BATCH_LIMIT = 100; /** * Generic response format of any ODP v3 API call */ interface V3Response { [key: string]: any; } /** * Standard 200/202 response format for many ODP v3 API calls */ interface V3SuccessResponse { title: 'Accepted' | string; status: 202 | 200 | number; timestamp: string; } /** * The error response payload format of an ODP v3 API call */ interface V3ErrorResponse { title: string; status: 400 | 500 | number; timestamp: string; message?: string; detail?: { [key: string]: any; invalids?: V3InvalidEventDetail[] | V3InvalidSchemaDetail[]; }; } /** * Embedded error response detail format for invalid event */ interface V3InvalidEventDetail { [key: string]: any; event: number; message: string; } /** * Embedded error response detail format for invalid schema */ interface V3InvalidSchemaDetail { field: string; reason: string | string[]; } /** * An http response from a v3 API call */ interface HttpResponse { success: boolean; data: T; status: number; statusText: string; headers: Headers; } enum ErrorCode { BatchLimitExceeded = "BatchLimitExceeded", Non2xx = "Non2xx", Unexpected = "Unexpected" } class HttpError extends Error { code?: string | undefined; response?: HttpResponse | undefined; constructor(message: string, code?: string | undefined, response?: HttpResponse | undefined); } type Payload = object | object[]; /** * http request method */ type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE'; interface RequestOptions { retry: boolean; } class API { private static ERROR_CODE_MESSAGES; private static DEFAULT_REQUEST_OPTIONS; /** * @hidden backward compatibility */ readonly BATCH_LIMIT = 100; private readonly config?; constructor(config: Config | InternalConfig | null); errorForCode: (code: ErrorCode) => HttpError; get: (path: string) => Promise>; post: (path: string, payload: Payload) => Promise>; request: (method: HttpMethod, path: string, payload: Payload | undefined, options?: RequestOptions) => Promise>; getContext: () => import("../config/configure").AppContext | undefined; private buildHeaders; private getConfig; } /** * @hidden * @deprecated for backward compatibility; use odp.v3Api.get instead */ function get(path: string): Promise>; /** * @hidden * @deprecated for backward compatibility; use odp.v3Api.post instead */ function post(path: string, payload: Payload): Promise>; } //# sourceMappingURL=ApiV3.d.ts.map