-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathodataOption.interface.ts
60 lines (44 loc) · 2.46 KB
/
odataOption.interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import type { BackendServiceFilterQueryOverrideArgs, BackendServiceOption, CaseType } from '@slickgrid-universal/common';
export interface OdataOption extends BackendServiceOption {
/** What is the casing type to use? Typically that would be 1 of the following 2: camelCase or PascalCase */
caseType: CaseType;
/** Add the total count $inlinecount (OData v2) or $count (OData v4) to the OData query */
enableCount?: boolean;
/**
* Query fields using $select. The row identifier field is always added.
* E.g.: columns [{ field: 'date' }] results in $select=id,date
*/
enableSelect?: boolean;
/**
* Query navigation fields (containing '/') using $expand.
* E.g.: with odata v4 and columns [{ field: 'date' }, { field: 'products/name' }] result in $select=id,date&$expand=products($select=name)
*/
enableExpand?: boolean;
/** How many rows to pull? */
top?: number;
/** How many rows to skip on the pagination? */
skip?: number;
/** (alias to "filter") Filter string (or array of string) that must be a valid OData string */
filter?: string | string[];
/** Filter string (or array of string) that must be a valid OData string */
filterBy?: any;
/** What is the separator between each filters? Typically "and", "or" */
filterBySeparator?: 'and' | 'or';
/** Filter queue */
filterQueue?: any[];
/** An optional predicate function to overide the built-in filter construction */
filterQueryOverride?: (args: BackendServiceFilterQueryOverrideArgs) => string | undefined;
/** Sorting string (or array of string) that must be a valid OData string */
orderBy?: string | string[];
/** OData (or any other) version number (the query string is different between versions) */
version?: number;
/**
* When false, searchTerms may be manipulated to be functional with certain filters eg: string only filters.
* When true, JSON.stringify is used on the searchTerms and used in the query "as-is". It is then the responsibility of the developer to sanitise the `searchTerms` property if necessary.
*/
useVerbatimSearchTerms?: boolean;
/** A callback which will extract and return the count from the data queried. Defaults to 'd.__count' for v2, '__count' for v3 and '@odata.count' for v4. */
countExtractor?: (response: any) => number;
/** A callback which will extract and return the dataset from the data queried. Defaults to 'd.results' for v2, 'results' for v3 and 'value' for v4. */
datasetExtractor?: (response: any) => number;
}