@dcupl/common 0.0.73 → 0.0.75
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.js +2 -1
- 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 +22 -22
- package/dist/lib-cjs/types/model.types.d.ts +37 -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.js +2 -1
- 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 +22 -22
- package/dist/lib-esm/types/model.types.d.ts +37 -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,44 +1,44 @@
|
|
|
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
25
|
excludeUndefineds?: boolean;
|
|
26
26
|
count?: number;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type DcuplFiltersOptions = DcuplFilterOptions & {
|
|
29
29
|
filterKeys?: string[];
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type DcuplListOptions<ModelNames extends string = string> = {
|
|
32
32
|
listKey: ModelNames;
|
|
33
33
|
name?: string;
|
|
34
34
|
listItemKeys?: string[];
|
|
35
35
|
empty?: boolean;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type DcuplRangeOptions = {
|
|
38
38
|
propertyKey: string;
|
|
39
39
|
filterKey?: string;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
41
|
+
export type DcuplFacetOptions = {
|
|
42
42
|
attributeKey: string;
|
|
43
43
|
filterKey?: string;
|
|
44
44
|
count?: number;
|
|
@@ -46,7 +46,7 @@ export declare type DcuplFacetOptions = {
|
|
|
46
46
|
excludeUndefineds?: boolean;
|
|
47
47
|
calculateFacets?: boolean;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type ListMetadata = {
|
|
50
50
|
key: string;
|
|
51
51
|
currentSize: number;
|
|
52
52
|
initialSize: number;
|
|
@@ -55,49 +55,49 @@ export declare type ListMetadata = {
|
|
|
55
55
|
itemOptions: DcuplItemsOptions<any>;
|
|
56
56
|
views: ViewDefinition[];
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export type ViewMetadata = {
|
|
59
59
|
key: string;
|
|
60
60
|
currentSize: number;
|
|
61
61
|
initialSize: number;
|
|
62
62
|
};
|
|
63
|
-
export
|
|
63
|
+
export type AggregationOptions = {
|
|
64
64
|
attributeKeys: string[];
|
|
65
65
|
};
|
|
66
|
-
export
|
|
67
|
-
export
|
|
66
|
+
export type AggregateType = 'number' | 'reference' | 'string';
|
|
67
|
+
export type AggregateBase = {
|
|
68
68
|
attribute: string;
|
|
69
69
|
type: AggregateType;
|
|
70
70
|
};
|
|
71
|
-
export
|
|
71
|
+
export type NumberAggregation = AggregateBase & {
|
|
72
72
|
attribute: string;
|
|
73
73
|
type: 'number';
|
|
74
74
|
value: NumberAggregationValue;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
76
|
+
export type ReferenceAggregation = AggregateBase & {
|
|
77
77
|
attribute: string;
|
|
78
78
|
type: 'reference';
|
|
79
79
|
value: ReferenceAggregationValue[];
|
|
80
80
|
};
|
|
81
|
-
export
|
|
81
|
+
export type StringAggregation = AggregateBase & {
|
|
82
82
|
attribute: string;
|
|
83
83
|
type: 'string';
|
|
84
84
|
value: StringAggregationValue[];
|
|
85
85
|
};
|
|
86
|
-
export
|
|
87
|
-
export
|
|
86
|
+
export type Aggregation = NumberAggregation | StringAggregation | ReferenceAggregation;
|
|
87
|
+
export type NumberAggregationValue = {
|
|
88
88
|
average: number;
|
|
89
89
|
count: number;
|
|
90
90
|
sum: number;
|
|
91
91
|
};
|
|
92
|
-
export
|
|
92
|
+
export type ReferenceAggregationValue = {
|
|
93
93
|
value: string;
|
|
94
94
|
count: number;
|
|
95
95
|
itemKeys: string[];
|
|
96
96
|
};
|
|
97
|
-
export
|
|
97
|
+
export type StringAggregationValue = {
|
|
98
98
|
value: string;
|
|
99
99
|
count: number;
|
|
100
100
|
};
|
|
101
|
-
export
|
|
101
|
+
export type CatalogApiOptions = {
|
|
102
102
|
skipProcessing?: boolean;
|
|
103
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
|
*
|
|
@@ -46,74 +46,74 @@ declare type PropertyBase = {
|
|
|
46
46
|
meta?: ModelMetadata;
|
|
47
47
|
index?: boolean;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type PropertyInt = PropertyBase & {
|
|
50
50
|
type: 'int' | 'Array<int>';
|
|
51
51
|
aggregate?: boolean;
|
|
52
52
|
filter?: boolean | FilterNumberArray[];
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type PropertyFloat = PropertyBase & {
|
|
55
55
|
type: 'float' | 'Array<float>';
|
|
56
56
|
aggregate?: boolean;
|
|
57
57
|
fractionDigits?: number;
|
|
58
58
|
filter?: boolean | FilterNumberArray[];
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type FilterNumberArray = {
|
|
61
61
|
key: string;
|
|
62
62
|
};
|
|
63
|
-
export
|
|
63
|
+
export type PropertyJson = PropertyBase & {
|
|
64
64
|
type: 'json' | 'Array<json>';
|
|
65
65
|
filter?: boolean;
|
|
66
66
|
};
|
|
67
|
-
export
|
|
67
|
+
export type PropertyAny = PropertyBase & {
|
|
68
68
|
type: 'any' | 'Array<any>';
|
|
69
69
|
};
|
|
70
|
-
export
|
|
71
|
-
export
|
|
70
|
+
export type PropertyDateInputFormat = 'date' | 'ts_seconds' | 'ts_milliseconds' | 'string';
|
|
71
|
+
export type PropertyDate = PropertyBase & {
|
|
72
72
|
type: 'date' | 'Array<date>';
|
|
73
73
|
inputFormat?: PropertyDateInputFormat;
|
|
74
74
|
filter?: boolean;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
76
|
+
export type PropertyString = PropertyBase & {
|
|
77
77
|
type: 'string' | 'Array<string>';
|
|
78
78
|
filter?: boolean | FilterStringSingle | FilterStringArray[];
|
|
79
79
|
};
|
|
80
|
-
export
|
|
80
|
+
export type PropertyExpression = PropertyBase & {
|
|
81
81
|
type: 'string';
|
|
82
82
|
expression: string;
|
|
83
83
|
filter?: boolean | FilterStringSingle | FilterStringArray[];
|
|
84
84
|
};
|
|
85
|
-
export
|
|
86
|
-
export
|
|
87
|
-
export
|
|
85
|
+
export type PropertyNumber = PropertyFloat | PropertyInt;
|
|
86
|
+
export type Property = PropertyExpression | PropertyString | PropertyInt | PropertyFloat | PropertyDate | PropertyJson | PropertyAny;
|
|
87
|
+
export type PropertyDerived = Property & {
|
|
88
88
|
derive: {
|
|
89
89
|
localReference: string;
|
|
90
90
|
remoteProperty: string;
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
export
|
|
93
|
+
export type PropertyAggregate = (PropertyNumber | PropertyString) & {
|
|
94
94
|
aggregate: true;
|
|
95
95
|
};
|
|
96
|
-
export
|
|
96
|
+
export type FilterStringArray = {
|
|
97
97
|
key: string;
|
|
98
98
|
comparisonType: FilterComparisonType;
|
|
99
99
|
};
|
|
100
|
-
export
|
|
100
|
+
export type FilterStringSingle = {
|
|
101
101
|
comparisonType?: FilterComparisonType;
|
|
102
102
|
};
|
|
103
103
|
/**
|
|
104
104
|
* Facet calculation is disabled by default
|
|
105
105
|
*/
|
|
106
|
-
export
|
|
106
|
+
export type ReferenceFilterDefinition = {
|
|
107
107
|
calculateFacets?: boolean;
|
|
108
108
|
excludeZeros?: boolean;
|
|
109
109
|
excludeUndefineds?: boolean;
|
|
110
110
|
};
|
|
111
|
-
export
|
|
111
|
+
export type ReferenceValidity = 'loose' | 'strict';
|
|
112
112
|
/**
|
|
113
113
|
* A Reference prepresent a list of elements along a explicite dimension.
|
|
114
114
|
* @defaultSnippets {"label":"Reference", "properties":["key","model", "type"]}
|
|
115
115
|
*/
|
|
116
|
-
export
|
|
116
|
+
export type ReferenceBase = {
|
|
117
117
|
/**
|
|
118
118
|
* A key is an unique identifier for all reference in this model.
|
|
119
119
|
*
|
|
@@ -139,10 +139,10 @@ export declare type ReferenceBase = {
|
|
|
139
139
|
meta?: ModelMetadata;
|
|
140
140
|
index?: boolean;
|
|
141
141
|
};
|
|
142
|
-
export
|
|
142
|
+
export type AggregatedReference = ReferenceBase & {
|
|
143
143
|
aggregate: true;
|
|
144
144
|
};
|
|
145
|
-
export
|
|
145
|
+
export type ResolvedReference = ReferenceBase & {
|
|
146
146
|
type: 'multiValued';
|
|
147
147
|
/**
|
|
148
148
|
* Resolve a Relationship to an foreign model
|
|
@@ -166,7 +166,7 @@ export declare type ResolvedReference = ReferenceBase & {
|
|
|
166
166
|
model: string;
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
-
export
|
|
169
|
+
export type DerivedReference = ReferenceBase & {
|
|
170
170
|
type: ReferenceType;
|
|
171
171
|
/**
|
|
172
172
|
* Derive a specific value from an other object/entity
|
|
@@ -189,7 +189,7 @@ export declare type DerivedReference = ReferenceBase & {
|
|
|
189
189
|
remoteReference: string;
|
|
190
190
|
};
|
|
191
191
|
};
|
|
192
|
-
export
|
|
192
|
+
export type GroupedRefeference = ReferenceBase & {
|
|
193
193
|
type: ReferenceType;
|
|
194
194
|
/**
|
|
195
195
|
* Group by a specific reference
|
|
@@ -206,23 +206,23 @@ export declare type GroupedRefeference = ReferenceBase & {
|
|
|
206
206
|
includeSelfInGroup?: boolean;
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
|
-
export
|
|
210
|
-
export
|
|
211
|
-
export
|
|
209
|
+
export type Reference = ResolvedReference | DerivedReference | GroupedRefeference | ReferenceBase;
|
|
210
|
+
export type ValueMappingValue = string | '$dcupl_falsy';
|
|
211
|
+
export type ValueMappingValues = {
|
|
212
212
|
from: ValueMappingValue[];
|
|
213
213
|
to: string;
|
|
214
214
|
};
|
|
215
|
-
export
|
|
215
|
+
export type ValueMappingConfig = {
|
|
216
216
|
attributes: string[];
|
|
217
217
|
values: ValueMappingValues[];
|
|
218
218
|
};
|
|
219
|
-
export
|
|
219
|
+
export type ModelAttribute = Property | Reference;
|
|
220
220
|
/**
|
|
221
221
|
* A model describes a real world object and hols attributes.
|
|
222
222
|
*
|
|
223
223
|
* @defaultSnippets {"label":"Model Description", "properties":["key:string", "properties:array", "references:array"]}
|
|
224
224
|
*/
|
|
225
|
-
export
|
|
225
|
+
export type ModelDefinition<ModelNames extends string = string> = {
|
|
226
226
|
/**
|
|
227
227
|
* The key is an unique identifier overall models in the application.
|
|
228
228
|
*
|
|
@@ -238,13 +238,13 @@ export declare type ModelDefinition<ModelNames extends string = string> = {
|
|
|
238
238
|
valueMappings?: ValueMappingConfig[];
|
|
239
239
|
meta?: ModelMetadata;
|
|
240
240
|
};
|
|
241
|
-
export
|
|
241
|
+
export type DcuplViewType = 'section';
|
|
242
242
|
/**
|
|
243
243
|
* A model describes a real world object and hols attributes.
|
|
244
244
|
*
|
|
245
245
|
* @defaultSnippets { "label": "Dcupl View", "properties": ["key", "model", "type", "primaryAttribute", "aggregates:array"] }
|
|
246
246
|
*/
|
|
247
|
-
export
|
|
247
|
+
export type ViewDefinition = {
|
|
248
248
|
/**
|
|
249
249
|
* The key is an unique identifier overall models in the application.
|
|
250
250
|
*
|
|
@@ -270,5 +270,5 @@ export declare type ViewDefinition = {
|
|
|
270
270
|
* Container for ModelDescriptions & Views
|
|
271
271
|
*
|
|
272
272
|
*/
|
|
273
|
-
export
|
|
273
|
+
export type Model = ViewDefinition | ModelDefinition | Array<ModelDefinition | ViewDefinition>;
|
|
274
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;
|