Merge "Web Client context menu item display"
[ccsdk/features.git] / sdnr / wt / odlux / framework / src / models / elasticSearch.ts
1 /**
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt odlux
4  * =================================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6  * =================================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  * ============LICENSE_END==========================================================================
17  */
18 export type Result<TSource extends {}> = {
19   "data-provider:output": {
20     pagination?: {
21       size: number;
22       page: number;
23       total: number;
24     },
25     data: TSource[];
26   }
27 }
28
29 export type SingeResult<TSource extends {}> = {
30   "data-provider:output": TSource;
31 }
32
33
34 export type ResultTopology<TSource extends {}> = {
35   "output": {
36     pagination?: {
37       size: number;
38       page: number;
39       total: number;
40     },
41     data: TSource[];
42   }
43 }
44
45 export type HitEntry<TSource extends {}> = {
46   _index: string;
47   _type: string;
48   _id: string;
49   _score: number;
50   _source: TSource;
51 }
52
53 type ActionResponse ={
54   _index: string;
55   _type: string;
56   _id: string;
57   _shards: {
58     total: number,
59     successful: number,
60     failed: number
61     },
62
63 }
64
65 export type PostResponse = ActionResponse & {
66   created: boolean
67 }
68
69 export type DeleteResponse = ActionResponse & {
70   found: boolean
71 }
72