UNPKG

@sap-cloud-sdk/odata-v4

Version:

SAP Cloud SDK for JavaScript common functions of OData client generator and OpenAPI clint generator.

40 lines (39 loc) 1.44 kB
import type { ResponseDataAccessor } from '@sap-cloud-sdk/odata-common'; /** * Methods to extract the data from OData v4 responses. */ /** * Extract the collection data from the response. * If the data does not contain a collection an empty array is returned. * @param data - Response of the OData v4 service. * @returns Collection extracted from the response. * @internal */ export declare function getCollectionResult(data: any): any[]; /** * Checks if the data contains a collection result. * @param data - Response of the OData v4 service * @returns `true`, if the data is a collection result * @internal */ export declare function isCollectionResult(data: any): boolean; /** * Extract the collection data from the one to many link response. * If the data does not contain a collection an empty array is returned. * @param data - Response of the one to many link. * @returns Collection extracted from the response. * @internal */ export declare function getLinkedCollectionResult(data: any): any[]; /** * Extract the single entry data from the response. * If the data does not contain a single object an empty object is returned. * @param data - Response of the OData v4 service. * @returns A single object extracted from the response. * @internal */ export declare function getSingleResult(data: any): Record<string, any>; /** * @internal */ export declare const responseDataAccessor: ResponseDataAccessor;