1 | import { ErrorResponse, ReadResponse, WriteResponses } from '../../batch-response';
|
2 | import { Constructable, Entity } from '../../entity';
|
3 | import { EntityDeserializer } from '../../entity-deserializer';
|
4 | import { ResponseDataAccessor } from '../../response-data-accessor';
|
5 | import { ResponseData } from './batch-response-parser';
|
6 |
|
7 |
|
8 |
|
9 | export declare class BatchResponseDeserializer {
|
10 | private readonly entityToConstructorMap;
|
11 | private readonly responseDataAccessor;
|
12 | private readonly deserializer;
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | constructor(entityToConstructorMap: Record<string, Constructable<Entity>>, responseDataAccessor: ResponseDataAccessor, deserializer: EntityDeserializer);
|
20 | /**
|
21 | * Deserialize the parsed batch response.
|
22 | * @param parsedBatchResponse - Two dimensional list of parsed batch sub responses.
|
23 | * @returns An array of parsed sub responses of the batch response.
|
24 | */
|
25 | deserializeBatchResponse(parsedBatchResponse: (ResponseData[] | ResponseData)[]): (ErrorResponse | ReadResponse | WriteResponses)[];
|
26 | private deserializeRetrieveResponse;
|
27 | private deserializeErrorResponse;
|
28 | private deserializeChangeSetSubResponse;
|
29 | private deserializeChangeSet;
|
30 | /**
|
31 | * Retrieve the constructor for a specific single response body.
|
32 | * @param responseBody - The body of a single response as an object.
|
33 | * @returns The constructor if found in the mapping, `undefined` otherwise.
|
34 | */
|
35 | private getConstructor;
|
36 | }
|
37 | /**
|
38 | * Deserialize the parsed batch response.
|
39 | * @param parsedBatchResponse - Two dimensional list of parsed batch sub responses.
|
40 | * @param entityToConstructorMap - A map that holds the entity type to constructor mapping.
|
41 | * @param responseDataAccessor - Response data access module.
|
42 | * @param deserializer - Entity deserializer.
|
43 | * @returns An array of parsed sub responses of the batch response.
|
44 | */
|
45 | export declare function deserializeBatchResponse(parsedBatchResponse: (ResponseData[] | ResponseData)[], entityToConstructorMap: Record<string, Constructable<Entity>>, responseDataAccessor: ResponseDataAccessor, deserializer: EntityDeserializer): (ErrorResponse | ReadResponse | WriteResponses)[];
|
46 | /**
|
47 | * Parse the entity name from the metadata uri. This should be the `__metadata` property of a single entity in the response.
|
48 | * @param uri - The URI to parse the entity name from
|
49 | * @returns The entity name.
|
50 | */
|
51 | export declare function parseEntityNameFromMetadataUri(uri: string): string;
|
52 | //# sourceMappingURL=batch-response-deserializer.d.ts.map |
\ | No newline at end of file |