@dcupl/common 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib-cjs/changeDetection.d.ts +5 -5
- package/dist/lib-cjs/changeDetection.js +4 -3
- package/dist/lib-cjs/changeDetection.js.map +1 -1
- package/dist/lib-cjs/getFacetEntries.d.ts +1 -1
- package/dist/lib-cjs/getFacetEntries.js +70 -37
- package/dist/lib-cjs/getFacetEntries.js.map +1 -1
- package/dist/lib-cjs/index.d.ts +1 -0
- package/dist/lib-cjs/index.js +1 -0
- package/dist/lib-cjs/index.js.map +1 -1
- package/dist/lib-cjs/performance.d.ts +3 -0
- package/dist/lib-cjs/performance.js +9 -0
- package/dist/lib-cjs/performance.js.map +1 -0
- package/dist/lib-cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/lib-cjs/types/data.types.d.ts +5 -5
- package/dist/lib-cjs/types/dcupl.types.d.ts +11 -11
- package/dist/lib-cjs/types/filter.types.d.ts +36 -36
- package/dist/lib-cjs/types/internal.types.d.ts +4 -4
- package/dist/lib-cjs/types/list.types.d.ts +24 -22
- package/dist/lib-cjs/types/model.types.d.ts +40 -37
- package/dist/lib-cjs/types/projection.types.d.ts +8 -7
- package/dist/lib-cjs/types/section.types.d.ts +1 -1
- package/dist/lib-cjs/types/selection.types.d.ts +3 -3
- package/dist/lib-cjs/types/suggestion.types.d.ts +3 -3
- package/dist/lib-esm/changeDetection.d.ts +5 -5
- package/dist/lib-esm/changeDetection.js +4 -3
- package/dist/lib-esm/changeDetection.js.map +1 -1
- package/dist/lib-esm/getFacetEntries.d.ts +1 -1
- package/dist/lib-esm/getFacetEntries.js +70 -37
- package/dist/lib-esm/getFacetEntries.js.map +1 -1
- package/dist/lib-esm/index.d.ts +1 -0
- package/dist/lib-esm/index.js +1 -0
- package/dist/lib-esm/index.js.map +1 -1
- package/dist/lib-esm/performance.d.ts +3 -0
- package/dist/lib-esm/performance.js +6 -0
- package/dist/lib-esm/performance.js.map +1 -0
- package/dist/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/dist/lib-esm/types/data.types.d.ts +5 -5
- package/dist/lib-esm/types/dcupl.types.d.ts +11 -11
- package/dist/lib-esm/types/filter.types.d.ts +36 -36
- package/dist/lib-esm/types/internal.types.d.ts +4 -4
- package/dist/lib-esm/types/list.types.d.ts +24 -22
- package/dist/lib-esm/types/model.types.d.ts +40 -37
- package/dist/lib-esm/types/projection.types.d.ts +8 -7
- package/dist/lib-esm/types/section.types.d.ts +1 -1
- package/dist/lib-esm/types/selection.types.d.ts +3 -3
- package/dist/lib-esm/types/suggestion.types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type RawItem = any;
|
|
2
|
+
export type ListItem = {
|
|
3
3
|
key: string;
|
|
4
4
|
[id: string]: any;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type DataContainer<ListType extends RawItem | ListItem = ListItem, ModelNames extends string = string> = {
|
|
7
7
|
model: ModelNames;
|
|
8
8
|
type?: DataContainerType;
|
|
9
9
|
data: ListType[];
|
|
10
10
|
keyProperty?: string;
|
|
11
11
|
autoGenerateKey?: boolean;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type DataContainerType = 'upsert' | 'update' | 'set' | 'delete';
|
|
14
|
+
export type ReferenceDataTypes<ListType extends ListItem = ListItem> = string | string[] | ListType | ListType[];
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { FilterOptions } from './filter.types';
|
|
2
2
|
import { DcuplItemOptions, DcuplItemsOptions } from './list.types';
|
|
3
|
-
export
|
|
3
|
+
export type DcuplInitOptions = {
|
|
4
4
|
config?: DcuplInitConfig;
|
|
5
5
|
logs?: DcuplInitLoggingConfig;
|
|
6
6
|
errorTracking?: DcuplInitErrorTrackingConfig;
|
|
7
7
|
selection?: DcuplSelectionConfig;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type DcuplInitErrorTrackingConfig = {
|
|
10
10
|
enabled: boolean;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type DcuplSelectionConfig = {
|
|
13
13
|
baseUrl: string;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type DcuplInitLoggingConfig = {
|
|
16
16
|
enabled: boolean;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type DcuplInitConfig = {
|
|
19
19
|
projectId?: string;
|
|
20
20
|
apiKey?: string;
|
|
21
21
|
version?: string;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type DcuplErrorResponse = {
|
|
24
24
|
name?: string;
|
|
25
25
|
message?: string;
|
|
26
26
|
type?: 'fatal' | 'minor';
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type DcuplMetrics = {
|
|
29
29
|
total?: number;
|
|
30
30
|
core?: number;
|
|
31
31
|
};
|
|
@@ -33,20 +33,20 @@ export interface DcuplFunction {
|
|
|
33
33
|
name: string;
|
|
34
34
|
args: Array<any>;
|
|
35
35
|
}
|
|
36
|
-
export
|
|
36
|
+
export type DcuplResponse<T> = {
|
|
37
37
|
id?: string;
|
|
38
38
|
func: DcuplFunction;
|
|
39
39
|
result?: T;
|
|
40
40
|
error?: DcuplErrorResponse;
|
|
41
41
|
metrics: DcuplMetrics;
|
|
42
42
|
};
|
|
43
|
-
export
|
|
43
|
+
export type DcuplGlobalItemsOptions<T> = DcuplItemsOptions<T> & {
|
|
44
44
|
listKey: string;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
46
|
+
export type DcuplGlobalItemOptions<T> = DcuplItemOptions<T> & {
|
|
47
47
|
listKey: string;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type DcuplGlobalQueryOptions<T> = DcuplItemsOptions<T> & {
|
|
50
50
|
listKey: string;
|
|
51
51
|
query: FilterOptions[];
|
|
52
52
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { ListItem } from '.';
|
|
2
2
|
import { CatalogApiOptions } from './list.types';
|
|
3
3
|
import { FilterComparisonType } from './model.types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type ConstraintTypes = 'referenceConstraint' | 'textConstraint' | 'numberConstraint' | 'dateConstraint';
|
|
5
|
+
export type ConstraintBase = {
|
|
6
6
|
uid: string;
|
|
7
7
|
filterKey: string;
|
|
8
8
|
attributeKey: string;
|
|
9
9
|
type: ConstraintTypes;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ReferenceConstraint = ConstraintBase & {
|
|
12
12
|
type: 'referenceConstraint';
|
|
13
13
|
value: string;
|
|
14
14
|
calculateFacets: boolean;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type TextConstraint = ConstraintBase & {
|
|
17
17
|
type: 'textConstraint';
|
|
18
18
|
comparisonType: FilterComparisonType;
|
|
19
19
|
value: string;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type NumberConstraint = ConstraintBase & NumberConstraintOperators & {
|
|
22
22
|
type: 'numberConstraint';
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type DateConstraint = ConstraintBase & DateConstraintOperators & {
|
|
25
25
|
type: 'dateConstraint';
|
|
26
26
|
};
|
|
27
|
-
export
|
|
28
|
-
export
|
|
27
|
+
export type FilterConstraint = ReferenceConstraint | TextConstraint | NumberConstraint | DateConstraint;
|
|
28
|
+
export type NumberConstraintOperators = {
|
|
29
29
|
gt?: number;
|
|
30
30
|
lt?: number;
|
|
31
31
|
gte?: number;
|
|
@@ -33,7 +33,7 @@ export declare type NumberConstraintOperators = {
|
|
|
33
33
|
eq?: number | number[];
|
|
34
34
|
ne?: number | number[];
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type DateConstraintOperators = {
|
|
37
37
|
gt?: Date;
|
|
38
38
|
lt?: Date;
|
|
39
39
|
gte?: Date;
|
|
@@ -41,18 +41,18 @@ export declare type DateConstraintOperators = {
|
|
|
41
41
|
eq?: Date | Date[];
|
|
42
42
|
ne?: Date | Date[];
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type FilterEntryNumberRange = {
|
|
45
45
|
min: number;
|
|
46
46
|
max: number;
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type FilterEntryDateRange = {
|
|
49
49
|
min: Date;
|
|
50
50
|
max: Date;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
53
|
-
export
|
|
54
|
-
export
|
|
55
|
-
export
|
|
52
|
+
export type FilterItemType = 'reference' | 'number' | 'text' | 'date';
|
|
53
|
+
export type FilterItemPropertyType = 'number' | 'text' | 'date';
|
|
54
|
+
export type FilterItemReferenceType = 'reference';
|
|
55
|
+
export type FilterItemBase = {
|
|
56
56
|
key: string;
|
|
57
57
|
attributeKey: string;
|
|
58
58
|
enabled: boolean;
|
|
@@ -62,36 +62,36 @@ export declare type FilterItemBase = {
|
|
|
62
62
|
range?: FilterItemNumberRangeValue | FilterItemDateRangeValue;
|
|
63
63
|
entries?: Array<FilterItemEntry>;
|
|
64
64
|
};
|
|
65
|
-
export
|
|
65
|
+
export type TextFilterItem = FilterItemBase & {
|
|
66
66
|
type: 'text';
|
|
67
67
|
comparisonType: FilterComparisonType;
|
|
68
68
|
text: string;
|
|
69
69
|
};
|
|
70
|
-
export
|
|
70
|
+
export type NumberFilterItem = FilterItemBase & {
|
|
71
71
|
type: 'number';
|
|
72
72
|
range: FilterItemNumberRangeValue;
|
|
73
73
|
};
|
|
74
|
-
export
|
|
74
|
+
export type DateFilterItem = FilterItemBase & {
|
|
75
75
|
type: 'date';
|
|
76
76
|
range: FilterItemDateRangeValue;
|
|
77
77
|
};
|
|
78
|
-
export
|
|
78
|
+
export type FilterItemNumberRangeValue = {
|
|
79
79
|
available: FilterEntryNumberRange;
|
|
80
80
|
initial: FilterEntryNumberRange;
|
|
81
81
|
selected: NumberConstraintOperators[];
|
|
82
82
|
};
|
|
83
|
-
export
|
|
83
|
+
export type FilterItemDateRangeValue = {
|
|
84
84
|
available: FilterEntryDateRange;
|
|
85
85
|
initial: FilterEntryDateRange;
|
|
86
86
|
selected: DateConstraintOperators[];
|
|
87
87
|
};
|
|
88
|
-
export
|
|
88
|
+
export type ReferenceFilterItem = FilterItemBase & {
|
|
89
89
|
type: 'reference';
|
|
90
90
|
entries: Array<FilterItemEntry>;
|
|
91
91
|
};
|
|
92
|
-
export
|
|
93
|
-
export
|
|
94
|
-
export
|
|
92
|
+
export type PropertyFilterItem = TextFilterItem | NumberFilterItem | DateFilterItem;
|
|
93
|
+
export type FilterItem = PropertyFilterItem | ReferenceFilterItem;
|
|
94
|
+
export type FilterItemEntry = {
|
|
95
95
|
key: string;
|
|
96
96
|
enabled: boolean;
|
|
97
97
|
selected: boolean;
|
|
@@ -101,8 +101,8 @@ export declare type FilterItemEntry = {
|
|
|
101
101
|
resultKeys: string[];
|
|
102
102
|
children?: Array<FilterItemEntry>;
|
|
103
103
|
};
|
|
104
|
-
export
|
|
105
|
-
export
|
|
104
|
+
export type FilterMode = 'add' | 'set';
|
|
105
|
+
export type BaseFilterOptions = {
|
|
106
106
|
type: FilterType;
|
|
107
107
|
filterKey: string;
|
|
108
108
|
/**
|
|
@@ -111,24 +111,24 @@ export declare type BaseFilterOptions = {
|
|
|
111
111
|
*/
|
|
112
112
|
mode?: FilterMode;
|
|
113
113
|
} & CatalogApiOptions;
|
|
114
|
-
export
|
|
115
|
-
|
|
114
|
+
export type FilterType = 'text' | 'number' | 'reference' | 'date';
|
|
115
|
+
type TextFilterOptionsFull = BaseFilterOptions & {
|
|
116
116
|
type: 'text';
|
|
117
117
|
text: string;
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
type NumberFilterOptionsFull = BaseFilterOptions & NumberConstraintOperators & {
|
|
120
120
|
type: 'number';
|
|
121
121
|
};
|
|
122
|
-
|
|
122
|
+
type DateFilterOptionsFull = BaseFilterOptions & DateConstraintOperators & {
|
|
123
123
|
type: 'date';
|
|
124
124
|
};
|
|
125
|
-
|
|
125
|
+
type ReferenceFilterOptionsFull = BaseFilterOptions & {
|
|
126
126
|
type: 'reference';
|
|
127
127
|
itemKeys: string[];
|
|
128
128
|
};
|
|
129
|
-
export
|
|
130
|
-
export
|
|
131
|
-
export
|
|
132
|
-
export
|
|
133
|
-
export
|
|
129
|
+
export type FilterOptions = TextFilterOptionsFull | NumberFilterOptionsFull | DateFilterOptionsFull | ReferenceFilterOptionsFull;
|
|
130
|
+
export type TextFilterOptions = Omit<TextFilterOptionsFull, 'type'>;
|
|
131
|
+
export type NumberFilterOptions = Omit<NumberFilterOptionsFull, 'type'>;
|
|
132
|
+
export type DateFilterOptions = Omit<DateFilterOptionsFull, 'type'>;
|
|
133
|
+
export type ReferenceFilterOptions = Omit<ReferenceFilterOptionsFull, 'type'>;
|
|
134
134
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListItem } from './data.types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
2
|
+
export type InverseIndexReferenceMap = Map<string, InverseIndexValuesMap>;
|
|
3
|
+
export type InverseIndexValuesMap = Map<string, string[]>;
|
|
4
|
+
export type InverseIndexDataMap = Map<string, InverseIndexDataValuesMap>;
|
|
5
|
+
export type InverseIndexDataValuesMap = Map<string, ListItem>;
|
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import { FilterConstraint } from './filter.types';
|
|
2
2
|
import { ViewDefinition, ModelAttribute } from './model.types';
|
|
3
3
|
import { Projection, SortingProjection } from './projection.types';
|
|
4
|
-
export
|
|
4
|
+
export type DcuplItemsOptions<T> = {
|
|
5
5
|
start?: number;
|
|
6
6
|
count?: number;
|
|
7
7
|
projection?: Projection<T>;
|
|
8
8
|
sort?: SortingProjection<T>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type DcuplItemOptions<T> = {
|
|
11
11
|
projection?: Projection<T>;
|
|
12
12
|
itemKey: string;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type DcuplSectionItemOption<T> = DcuplItemsOptions<T> & {
|
|
15
15
|
key: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type DcuplSectionOptions<T> = DcuplItemsOptions<T> & {
|
|
18
18
|
primaryAttribute: string;
|
|
19
19
|
aggregates?: string[];
|
|
20
20
|
items?: DcuplSectionItemOption<T>[];
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type DcuplFilterOptions = CatalogApiOptions & {
|
|
23
23
|
calculateFacets?: boolean;
|
|
24
24
|
excludeZeros?: boolean;
|
|
25
|
+
excludeUndefineds?: boolean;
|
|
25
26
|
count?: number;
|
|
26
27
|
};
|
|
27
|
-
export
|
|
28
|
+
export type DcuplFiltersOptions = DcuplFilterOptions & {
|
|
28
29
|
filterKeys?: string[];
|
|
29
30
|
};
|
|
30
|
-
export
|
|
31
|
+
export type DcuplListOptions<ModelNames extends string = string> = {
|
|
31
32
|
listKey: ModelNames;
|
|
32
33
|
name?: string;
|
|
33
34
|
listItemKeys?: string[];
|
|
34
35
|
empty?: boolean;
|
|
35
36
|
};
|
|
36
|
-
export
|
|
37
|
+
export type DcuplRangeOptions = {
|
|
37
38
|
propertyKey: string;
|
|
38
39
|
filterKey?: string;
|
|
39
40
|
};
|
|
40
|
-
export
|
|
41
|
+
export type DcuplFacetOptions = {
|
|
41
42
|
attributeKey: string;
|
|
42
43
|
filterKey?: string;
|
|
43
44
|
count?: number;
|
|
44
45
|
excludeZeros?: boolean;
|
|
46
|
+
excludeUndefineds?: boolean;
|
|
45
47
|
calculateFacets?: boolean;
|
|
46
48
|
};
|
|
47
|
-
export
|
|
49
|
+
export type ListMetadata = {
|
|
48
50
|
key: string;
|
|
49
51
|
currentSize: number;
|
|
50
52
|
initialSize: number;
|
|
@@ -53,49 +55,49 @@ export declare type ListMetadata = {
|
|
|
53
55
|
itemOptions: DcuplItemsOptions<any>;
|
|
54
56
|
views: ViewDefinition[];
|
|
55
57
|
};
|
|
56
|
-
export
|
|
58
|
+
export type ViewMetadata = {
|
|
57
59
|
key: string;
|
|
58
60
|
currentSize: number;
|
|
59
61
|
initialSize: number;
|
|
60
62
|
};
|
|
61
|
-
export
|
|
63
|
+
export type AggregationOptions = {
|
|
62
64
|
attributeKeys: string[];
|
|
63
65
|
};
|
|
64
|
-
export
|
|
65
|
-
export
|
|
66
|
+
export type AggregateType = 'number' | 'reference' | 'string';
|
|
67
|
+
export type AggregateBase = {
|
|
66
68
|
attribute: string;
|
|
67
69
|
type: AggregateType;
|
|
68
70
|
};
|
|
69
|
-
export
|
|
71
|
+
export type NumberAggregation = AggregateBase & {
|
|
70
72
|
attribute: string;
|
|
71
73
|
type: 'number';
|
|
72
74
|
value: NumberAggregationValue;
|
|
73
75
|
};
|
|
74
|
-
export
|
|
76
|
+
export type ReferenceAggregation = AggregateBase & {
|
|
75
77
|
attribute: string;
|
|
76
78
|
type: 'reference';
|
|
77
79
|
value: ReferenceAggregationValue[];
|
|
78
80
|
};
|
|
79
|
-
export
|
|
81
|
+
export type StringAggregation = AggregateBase & {
|
|
80
82
|
attribute: string;
|
|
81
83
|
type: 'string';
|
|
82
84
|
value: StringAggregationValue[];
|
|
83
85
|
};
|
|
84
|
-
export
|
|
85
|
-
export
|
|
86
|
+
export type Aggregation = NumberAggregation | StringAggregation | ReferenceAggregation;
|
|
87
|
+
export type NumberAggregationValue = {
|
|
86
88
|
average: number;
|
|
87
89
|
count: number;
|
|
88
90
|
sum: number;
|
|
89
91
|
};
|
|
90
|
-
export
|
|
92
|
+
export type ReferenceAggregationValue = {
|
|
91
93
|
value: string;
|
|
92
94
|
count: number;
|
|
93
95
|
itemKeys: string[];
|
|
94
96
|
};
|
|
95
|
-
export
|
|
97
|
+
export type StringAggregationValue = {
|
|
96
98
|
value: string;
|
|
97
99
|
count: number;
|
|
98
100
|
};
|
|
99
|
-
export
|
|
101
|
+
export type CatalogApiOptions = {
|
|
100
102
|
skipProcessing?: boolean;
|
|
101
103
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RawItem } from '.';
|
|
2
|
-
export
|
|
2
|
+
export type PropertyType = 'string' | 'int' | 'float' | 'json' | 'date' | 'any' | 'Array<string>' | 'Array<int>' | 'Array<float>' | 'Array<date>';
|
|
3
3
|
export declare const NumberPropertyTypes: PropertyType[];
|
|
4
4
|
export declare const DatePropertyTypes: PropertyType[];
|
|
5
5
|
/**
|
|
@@ -14,20 +14,20 @@ export declare const DatePropertyTypes: PropertyType[];
|
|
|
14
14
|
* @ignoreThis 2
|
|
15
15
|
* @important
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
17
|
+
export type ReferenceType = 'singleValued' | 'multiValued';
|
|
18
|
+
export type AttributeType = PropertyType | ReferenceType;
|
|
19
|
+
export type ModelMetadata = {
|
|
20
20
|
name: string;
|
|
21
21
|
description?: string;
|
|
22
22
|
[key: string]: any;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type FilterComparisonType = 'equal' | 'equalIgnoreCase' | 'contains' | 'containsIgnoreCase' | 'containsIgnoreCaseAndWhitespace';
|
|
25
25
|
/**
|
|
26
26
|
* A property is a quality or characteristic belonging an object.
|
|
27
27
|
* @defaultSnippets {"label":"Property", "properties":["key","type"]}
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
type PropertyBase = {
|
|
31
31
|
/**
|
|
32
32
|
* A key is an unique identifier overall properties in this model.
|
|
33
33
|
*
|
|
@@ -44,74 +44,76 @@ declare type PropertyBase = {
|
|
|
44
44
|
separator?: string;
|
|
45
45
|
};
|
|
46
46
|
meta?: ModelMetadata;
|
|
47
|
+
index?: boolean;
|
|
47
48
|
};
|
|
48
|
-
export
|
|
49
|
+
export type PropertyInt = PropertyBase & {
|
|
49
50
|
type: 'int' | 'Array<int>';
|
|
50
51
|
aggregate?: boolean;
|
|
51
52
|
filter?: boolean | FilterNumberArray[];
|
|
52
53
|
};
|
|
53
|
-
export
|
|
54
|
+
export type PropertyFloat = PropertyBase & {
|
|
54
55
|
type: 'float' | 'Array<float>';
|
|
55
56
|
aggregate?: boolean;
|
|
56
57
|
fractionDigits?: number;
|
|
57
58
|
filter?: boolean | FilterNumberArray[];
|
|
58
59
|
};
|
|
59
|
-
export
|
|
60
|
+
export type FilterNumberArray = {
|
|
60
61
|
key: string;
|
|
61
62
|
};
|
|
62
|
-
export
|
|
63
|
+
export type PropertyJson = PropertyBase & {
|
|
63
64
|
type: 'json' | 'Array<json>';
|
|
64
65
|
filter?: boolean;
|
|
65
66
|
};
|
|
66
|
-
export
|
|
67
|
+
export type PropertyAny = PropertyBase & {
|
|
67
68
|
type: 'any' | 'Array<any>';
|
|
68
69
|
};
|
|
69
|
-
export
|
|
70
|
-
export
|
|
70
|
+
export type PropertyDateInputFormat = 'date' | 'ts_seconds' | 'ts_milliseconds' | 'string';
|
|
71
|
+
export type PropertyDate = PropertyBase & {
|
|
71
72
|
type: 'date' | 'Array<date>';
|
|
72
73
|
inputFormat?: PropertyDateInputFormat;
|
|
73
74
|
filter?: boolean;
|
|
74
75
|
};
|
|
75
|
-
export
|
|
76
|
+
export type PropertyString = PropertyBase & {
|
|
76
77
|
type: 'string' | 'Array<string>';
|
|
77
78
|
filter?: boolean | FilterStringSingle | FilterStringArray[];
|
|
78
79
|
};
|
|
79
|
-
export
|
|
80
|
+
export type PropertyExpression = PropertyBase & {
|
|
80
81
|
type: 'string';
|
|
81
82
|
expression: string;
|
|
82
83
|
filter?: boolean | FilterStringSingle | FilterStringArray[];
|
|
83
84
|
};
|
|
84
|
-
export
|
|
85
|
-
export
|
|
86
|
-
export
|
|
85
|
+
export type PropertyNumber = PropertyFloat | PropertyInt;
|
|
86
|
+
export type Property = PropertyExpression | PropertyString | PropertyInt | PropertyFloat | PropertyDate | PropertyJson | PropertyAny;
|
|
87
|
+
export type PropertyDerived = Property & {
|
|
87
88
|
derive: {
|
|
88
89
|
localReference: string;
|
|
89
90
|
remoteProperty: string;
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
|
-
export
|
|
93
|
+
export type PropertyAggregate = (PropertyNumber | PropertyString) & {
|
|
93
94
|
aggregate: true;
|
|
94
95
|
};
|
|
95
|
-
export
|
|
96
|
+
export type FilterStringArray = {
|
|
96
97
|
key: string;
|
|
97
98
|
comparisonType: FilterComparisonType;
|
|
98
99
|
};
|
|
99
|
-
export
|
|
100
|
+
export type FilterStringSingle = {
|
|
100
101
|
comparisonType?: FilterComparisonType;
|
|
101
102
|
};
|
|
102
103
|
/**
|
|
103
104
|
* Facet calculation is disabled by default
|
|
104
105
|
*/
|
|
105
|
-
export
|
|
106
|
+
export type ReferenceFilterDefinition = {
|
|
106
107
|
calculateFacets?: boolean;
|
|
107
108
|
excludeZeros?: boolean;
|
|
109
|
+
excludeUndefineds?: boolean;
|
|
108
110
|
};
|
|
109
|
-
export
|
|
111
|
+
export type ReferenceValidity = 'loose' | 'strict';
|
|
110
112
|
/**
|
|
111
113
|
* A Reference prepresent a list of elements along a explicite dimension.
|
|
112
114
|
* @defaultSnippets {"label":"Reference", "properties":["key","model", "type"]}
|
|
113
115
|
*/
|
|
114
|
-
export
|
|
116
|
+
export type ReferenceBase = {
|
|
115
117
|
/**
|
|
116
118
|
* A key is an unique identifier for all reference in this model.
|
|
117
119
|
*
|
|
@@ -135,11 +137,12 @@ export declare type ReferenceBase = {
|
|
|
135
137
|
validity?: ReferenceValidity;
|
|
136
138
|
aggregate?: boolean;
|
|
137
139
|
meta?: ModelMetadata;
|
|
140
|
+
index?: boolean;
|
|
138
141
|
};
|
|
139
|
-
export
|
|
142
|
+
export type AggregatedReference = ReferenceBase & {
|
|
140
143
|
aggregate: true;
|
|
141
144
|
};
|
|
142
|
-
export
|
|
145
|
+
export type ResolvedReference = ReferenceBase & {
|
|
143
146
|
type: 'multiValued';
|
|
144
147
|
/**
|
|
145
148
|
* Resolve a Relationship to an foreign model
|
|
@@ -163,7 +166,7 @@ export declare type ResolvedReference = ReferenceBase & {
|
|
|
163
166
|
model: string;
|
|
164
167
|
};
|
|
165
168
|
};
|
|
166
|
-
export
|
|
169
|
+
export type DerivedReference = ReferenceBase & {
|
|
167
170
|
type: ReferenceType;
|
|
168
171
|
/**
|
|
169
172
|
* Derive a specific value from an other object/entity
|
|
@@ -186,7 +189,7 @@ export declare type DerivedReference = ReferenceBase & {
|
|
|
186
189
|
remoteReference: string;
|
|
187
190
|
};
|
|
188
191
|
};
|
|
189
|
-
export
|
|
192
|
+
export type GroupedRefeference = ReferenceBase & {
|
|
190
193
|
type: ReferenceType;
|
|
191
194
|
/**
|
|
192
195
|
* Group by a specific reference
|
|
@@ -203,23 +206,23 @@ export declare type GroupedRefeference = ReferenceBase & {
|
|
|
203
206
|
includeSelfInGroup?: boolean;
|
|
204
207
|
};
|
|
205
208
|
};
|
|
206
|
-
export
|
|
207
|
-
export
|
|
208
|
-
export
|
|
209
|
+
export type Reference = ResolvedReference | DerivedReference | GroupedRefeference | ReferenceBase;
|
|
210
|
+
export type ValueMappingValue = string | '$dcupl_falsy';
|
|
211
|
+
export type ValueMappingValues = {
|
|
209
212
|
from: ValueMappingValue[];
|
|
210
213
|
to: string;
|
|
211
214
|
};
|
|
212
|
-
export
|
|
215
|
+
export type ValueMappingConfig = {
|
|
213
216
|
attributes: string[];
|
|
214
217
|
values: ValueMappingValues[];
|
|
215
218
|
};
|
|
216
|
-
export
|
|
219
|
+
export type ModelAttribute = Property | Reference;
|
|
217
220
|
/**
|
|
218
221
|
* A model describes a real world object and hols attributes.
|
|
219
222
|
*
|
|
220
223
|
* @defaultSnippets {"label":"Model Description", "properties":["key:string", "properties:array", "references:array"]}
|
|
221
224
|
*/
|
|
222
|
-
export
|
|
225
|
+
export type ModelDefinition<ModelNames extends string = string> = {
|
|
223
226
|
/**
|
|
224
227
|
* The key is an unique identifier overall models in the application.
|
|
225
228
|
*
|
|
@@ -235,13 +238,13 @@ export declare type ModelDefinition<ModelNames extends string = string> = {
|
|
|
235
238
|
valueMappings?: ValueMappingConfig[];
|
|
236
239
|
meta?: ModelMetadata;
|
|
237
240
|
};
|
|
238
|
-
export
|
|
241
|
+
export type DcuplViewType = 'section';
|
|
239
242
|
/**
|
|
240
243
|
* A model describes a real world object and hols attributes.
|
|
241
244
|
*
|
|
242
245
|
* @defaultSnippets { "label": "Dcupl View", "properties": ["key", "model", "type", "primaryAttribute", "aggregates:array"] }
|
|
243
246
|
*/
|
|
244
|
-
export
|
|
247
|
+
export type ViewDefinition = {
|
|
245
248
|
/**
|
|
246
249
|
* The key is an unique identifier overall models in the application.
|
|
247
250
|
*
|
|
@@ -267,5 +270,5 @@ export declare type ViewDefinition = {
|
|
|
267
270
|
* Container for ModelDescriptions & Views
|
|
268
271
|
*
|
|
269
272
|
*/
|
|
270
|
-
export
|
|
273
|
+
export type Model = ViewDefinition | ModelDefinition | Array<ModelDefinition | ViewDefinition>;
|
|
271
274
|
export {};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type ArrayOfProperties<T, P extends keyof T> = Exclude<P, 'filterables'>[];
|
|
2
|
+
type WildCard = {
|
|
3
3
|
$?: boolean;
|
|
4
|
+
$$?: boolean;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
export
|
|
6
|
+
type CleanResultItem<T> = Omit<T, 'filterables'>;
|
|
7
|
+
export type ProjectionAdvanced<T> = {
|
|
7
8
|
[P in keyof CleanResultItem<T>]?: boolean | WildCard | ProjectionAdvanced<T[P]>;
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type Projection<T> = WildCard | ProjectionAdvanced<T>;
|
|
11
|
+
export type SortDirection = 'ASC' | 'DESC';
|
|
12
|
+
export type SortingProjection<T> = {
|
|
12
13
|
attributes: ArrayOfProperties<T, keyof T>;
|
|
13
14
|
order: SortDirection[];
|
|
14
15
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type DcuplSelectionProperty = {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type DcuplSelectionItem = {
|
|
5
5
|
key: string;
|
|
6
6
|
properties: DcuplSelectionProperty;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type DcuplSelection = {
|
|
9
9
|
uid?: string;
|
|
10
10
|
selectionKey: string;
|
|
11
11
|
listKey?: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CatalogApiOptions } from './list.types';
|
|
2
2
|
import { FilterComparisonType } from './model.types';
|
|
3
|
-
export
|
|
3
|
+
export type SuggestionValueEntry = {
|
|
4
4
|
key: string;
|
|
5
5
|
value: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type Suggestion<T extends string | SuggestionValueEntry = string> = {
|
|
8
8
|
value: T;
|
|
9
9
|
filterKey: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type SuggestionOptions = CatalogApiOptions & {
|
|
12
12
|
filterKey: string;
|
|
13
13
|
searchTerm: string;
|
|
14
14
|
max?: number;
|