@dcupl/common 0.0.81-beta.7 → 1.0.0-beta.1
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/computeSuggestions.d.ts +2 -2
- package/dist/lib-cjs/computeSuggestions.js +44 -97
- package/dist/lib-cjs/computeSuggestions.js.map +1 -1
- package/dist/lib-cjs/getFacets.d.ts +2 -2
- package/dist/lib-cjs/getFacets.js.map +1 -1
- package/dist/lib-cjs/query-builder.d.ts +9 -9
- package/dist/lib-cjs/query-builder.js.map +1 -1
- package/dist/lib-cjs/queryData.d.ts +3 -1
- package/dist/lib-cjs/queryData.js +7 -5
- package/dist/lib-cjs/queryData.js.map +1 -1
- package/dist/lib-cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/lib-cjs/types/aggregation.types.d.ts +6 -38
- package/dist/lib-cjs/types/aggregation.types.js +3 -0
- package/dist/lib-cjs/types/aggregation.types.js.map +1 -1
- package/dist/lib-cjs/types/data.types.d.ts +5 -0
- package/dist/lib-cjs/types/group-by.types.d.ts +13 -0
- package/dist/lib-cjs/types/group-by.types.js +3 -0
- package/dist/lib-cjs/types/group-by.types.js.map +1 -0
- package/dist/lib-cjs/types/index.d.ts +1 -0
- package/dist/lib-cjs/types/index.js +1 -0
- package/dist/lib-cjs/types/index.js.map +1 -1
- package/dist/lib-cjs/types/list.types.d.ts +2 -10
- package/dist/lib-cjs/types/model.types.d.ts +2 -2
- package/dist/lib-cjs/types/query.types.d.ts +7 -2
- package/dist/lib-cjs/types/suggestion.types.d.ts +3 -17
- package/dist/lib-esm/computeSuggestions.d.ts +2 -2
- package/dist/lib-esm/computeSuggestions.js +43 -96
- package/dist/lib-esm/computeSuggestions.js.map +1 -1
- package/dist/lib-esm/getFacets.d.ts +2 -2
- package/dist/lib-esm/getFacets.js.map +1 -1
- package/dist/lib-esm/query-builder.d.ts +9 -9
- package/dist/lib-esm/query-builder.js.map +1 -1
- package/dist/lib-esm/queryData.d.ts +3 -1
- package/dist/lib-esm/queryData.js +2 -2
- package/dist/lib-esm/queryData.js.map +1 -1
- package/dist/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/dist/lib-esm/types/aggregation.types.d.ts +6 -38
- package/dist/lib-esm/types/aggregation.types.js +3 -0
- package/dist/lib-esm/types/aggregation.types.js.map +1 -1
- package/dist/lib-esm/types/data.types.d.ts +5 -0
- package/dist/lib-esm/types/group-by.types.d.ts +13 -0
- package/dist/lib-esm/types/group-by.types.js +2 -0
- package/dist/lib-esm/types/group-by.types.js.map +1 -0
- package/dist/lib-esm/types/index.d.ts +1 -0
- package/dist/lib-esm/types/index.js +1 -0
- package/dist/lib-esm/types/index.js.map +1 -1
- package/dist/lib-esm/types/list.types.d.ts +2 -10
- package/dist/lib-esm/types/model.types.d.ts +2 -2
- package/dist/lib-esm/types/query.types.d.ts +7 -2
- package/dist/lib-esm/types/suggestion.types.d.ts +3 -17
- package/package.json +1 -1
|
@@ -1,45 +1,12 @@
|
|
|
1
|
-
export type AggregationOptions = {
|
|
2
|
-
attributeKeys: string[];
|
|
3
|
-
};
|
|
4
|
-
export type AggregateType = 'number' | 'reference' | 'string';
|
|
5
|
-
export type AggregateBase = {
|
|
6
|
-
attribute: string;
|
|
7
|
-
type: AggregateType;
|
|
8
|
-
};
|
|
9
|
-
export type NumberAggregation = AggregateBase & {
|
|
10
|
-
attribute: string;
|
|
11
|
-
type: 'number';
|
|
12
|
-
value: NumberAggregationValue;
|
|
13
|
-
};
|
|
14
|
-
export type ReferenceAggregation = AggregateBase & {
|
|
15
|
-
attribute: string;
|
|
16
|
-
type: 'reference';
|
|
17
|
-
value: ReferenceAggregationValue[];
|
|
18
|
-
};
|
|
19
|
-
export type StringAggregation = AggregateBase & {
|
|
20
|
-
attribute: string;
|
|
21
|
-
type: 'string';
|
|
22
|
-
value: StringAggregationValue[];
|
|
23
|
-
};
|
|
24
|
-
export type Aggregation = NumberAggregation | StringAggregation | ReferenceAggregation;
|
|
25
1
|
export type NumberAggregationValue = {
|
|
26
2
|
average: number;
|
|
27
3
|
count: number;
|
|
28
4
|
sum: number;
|
|
29
5
|
};
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
count: number;
|
|
33
|
-
itemKeys: string[];
|
|
34
|
-
};
|
|
35
|
-
export type StringAggregationValue = {
|
|
36
|
-
value: string;
|
|
37
|
-
count: number;
|
|
38
|
-
};
|
|
39
|
-
export type AggregationTypeNew = 'sum' | 'avg' | 'min' | 'max' | 'distinct' | 'group';
|
|
40
|
-
export type AggregationOptionsNew = {
|
|
6
|
+
export type AggregationType = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'distinct' | 'group';
|
|
7
|
+
export type AggregationOptions = {
|
|
41
8
|
attribute: string;
|
|
42
|
-
types:
|
|
9
|
+
types: AggregationType[];
|
|
43
10
|
distinctOptions?: {
|
|
44
11
|
limit?: number;
|
|
45
12
|
};
|
|
@@ -67,11 +34,12 @@ export type AggregationGroupValue = {
|
|
|
67
34
|
count: number;
|
|
68
35
|
keys: string[];
|
|
69
36
|
};
|
|
70
|
-
export type
|
|
37
|
+
export type Aggregation = {
|
|
71
38
|
attribute: string;
|
|
72
|
-
types:
|
|
39
|
+
types: AggregationType[];
|
|
73
40
|
sum?: number;
|
|
74
41
|
avg?: number;
|
|
42
|
+
count?: number;
|
|
75
43
|
min?: number;
|
|
76
44
|
max?: number;
|
|
77
45
|
distinct?: AggregationDistinctValue[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregation.types.js","sourceRoot":"","sources":["../../../src/types/aggregation.types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"aggregation.types.js","sourceRoot":"","sources":["../../../src/types/aggregation.types.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,6BAA6B;AAC7B,KAAK"}
|
|
@@ -12,3 +12,8 @@ export type DataContainer<ListType extends RawItem | ListItem = ListItem, ModelN
|
|
|
12
12
|
};
|
|
13
13
|
export type DataContainerType = 'upsert' | 'update' | 'set' | 'delete';
|
|
14
14
|
export type ReferenceDataTypes<ListType extends ListItem = ListItem> = string | string[] | ListType | ListType[];
|
|
15
|
+
export type DataOptions<ModelNames extends string = string> = {
|
|
16
|
+
model: ModelNames;
|
|
17
|
+
keyProperty?: string;
|
|
18
|
+
autoGenerateKey?: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AggregationOptions } from './aggregation.types';
|
|
2
|
+
import { DcuplItemsOptions } from './list.types';
|
|
3
|
+
export type DcuplSectionItemOption<T> = DcuplItemsOptions<T> & {
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
export type DcuplGroupByOptions<T> = DcuplItemsOptions<T> & {
|
|
7
|
+
attribute: string;
|
|
8
|
+
aggregates?: AggregationOptions[];
|
|
9
|
+
items?: DcuplSectionItemOption<T>[];
|
|
10
|
+
excludeZeros?: boolean;
|
|
11
|
+
excludeUndefineds?: boolean;
|
|
12
|
+
excludeUnresolved?: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by.types.js","sourceRoot":"","sources":["../../../src/types/group-by.types.ts"],"names":[],"mappings":""}
|
|
@@ -4,6 +4,7 @@ export * from './dcupl.types';
|
|
|
4
4
|
export * from './facets.types';
|
|
5
5
|
export * from './filter.types';
|
|
6
6
|
export * from './global.types';
|
|
7
|
+
export * from './group-by.types';
|
|
7
8
|
export * from './internal.types';
|
|
8
9
|
export * from './list.types';
|
|
9
10
|
export * from './model.types';
|
|
@@ -4,6 +4,7 @@ export * from './dcupl.types';
|
|
|
4
4
|
export * from './facets.types';
|
|
5
5
|
export * from './filter.types';
|
|
6
6
|
export * from './global.types';
|
|
7
|
+
export * from './group-by.types';
|
|
7
8
|
export * from './internal.types';
|
|
8
9
|
export * from './list.types';
|
|
9
10
|
export * from './model.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DcuplGlobalQueryOptions } from './query.types';
|
|
2
2
|
import { ViewDefinition, ModelAttribute } from './model.types';
|
|
3
3
|
import { Projection, SortingProjection } from './projection.types';
|
|
4
4
|
export type DcuplItemsOptions<T> = {
|
|
@@ -15,14 +15,6 @@ export type DcuplManyItemsOptions<T> = {
|
|
|
15
15
|
projection?: Projection<T>;
|
|
16
16
|
itemKeys: string[];
|
|
17
17
|
};
|
|
18
|
-
export type DcuplSectionItemOption<T> = DcuplItemsOptions<T> & {
|
|
19
|
-
key: string;
|
|
20
|
-
};
|
|
21
|
-
export type DcuplSectionOptions<T> = DcuplItemsOptions<T> & {
|
|
22
|
-
primaryAttribute: string;
|
|
23
|
-
aggregates?: string[];
|
|
24
|
-
items?: DcuplSectionItemOption<T>[];
|
|
25
|
-
};
|
|
26
18
|
export type DcuplFilterOptions = CatalogApiOptions & {
|
|
27
19
|
calculateFacets?: boolean;
|
|
28
20
|
excludeZeros?: boolean;
|
|
@@ -47,7 +39,7 @@ export type ListMetadata = {
|
|
|
47
39
|
key: string;
|
|
48
40
|
currentSize: number;
|
|
49
41
|
initialSize: number;
|
|
50
|
-
appliedQuery:
|
|
42
|
+
appliedQuery: DcuplGlobalQueryOptions<any>;
|
|
51
43
|
attributes: ModelAttribute[];
|
|
52
44
|
views: ViewDefinition[];
|
|
53
45
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RawItem } from '.';
|
|
1
|
+
import { AggregationOptions, RawItem } from '.';
|
|
2
2
|
export type PropertyType = 'string' | 'int' | 'float' | 'json' | 'date' | 'boolean' | 'any' | 'Array<string>' | 'Array<int>' | 'Array<float>' | 'Array<date>';
|
|
3
3
|
export declare const NumberPropertyTypes: PropertyType[];
|
|
4
4
|
export declare const DatePropertyTypes: PropertyType[];
|
|
@@ -278,7 +278,7 @@ export type ViewDefinition = {
|
|
|
278
278
|
* @minLength 1
|
|
279
279
|
*/
|
|
280
280
|
primaryAttribute: string;
|
|
281
|
-
aggregates:
|
|
281
|
+
aggregates: AggregationOptions[];
|
|
282
282
|
meta?: ModelMetadata;
|
|
283
283
|
};
|
|
284
284
|
/**
|
|
@@ -49,7 +49,6 @@ export type DcuplQueryGroup<ChildQuery extends DcuplQuery | DcuplQueryGroup = an
|
|
|
49
49
|
queries: Array<ChildQuery>;
|
|
50
50
|
options?: DcuplQueryOptions;
|
|
51
51
|
};
|
|
52
|
-
export type DcuplGlobalQueryOptionsNew<T> = DcuplGlobalQueryOptions<T>;
|
|
53
52
|
type DcuplItemOptions<T> = {
|
|
54
53
|
start?: number;
|
|
55
54
|
count?: number;
|
|
@@ -62,7 +61,13 @@ export type DcuplGlobalQueryOptions<T> = {
|
|
|
62
61
|
export type DcuplGlobalItemOptions<T> = {
|
|
63
62
|
modelKey: string;
|
|
64
63
|
itemKey: string;
|
|
65
|
-
|
|
64
|
+
projection?: Projection<T>;
|
|
65
|
+
};
|
|
66
|
+
export type DcuplGlobalManyItemOptions<T> = {
|
|
67
|
+
modelKey: string;
|
|
68
|
+
itemKeys: string[];
|
|
69
|
+
projection?: Projection<T>;
|
|
70
|
+
};
|
|
66
71
|
export type DcuplListQueryOptions<T> = DcuplItemOptions<T> & DcuplQueryGroup;
|
|
67
72
|
export type DcuplListItemOptions<T> = DcuplItemOptions<T> & {
|
|
68
73
|
itemKey: string;
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
import { CatalogApiOptions } from './list.types';
|
|
2
|
-
import { FilterComparisonType } from './model.types';
|
|
3
2
|
import { DcuplQueryTransformOptions } from './query.types';
|
|
4
|
-
export type SuggestionValueEntry = {
|
|
5
|
-
key: string;
|
|
6
|
-
value: string;
|
|
7
|
-
};
|
|
8
|
-
export type Suggestion<T extends string | SuggestionValueEntry = string> = {
|
|
9
|
-
value: T;
|
|
10
|
-
filterKey: string;
|
|
11
|
-
};
|
|
12
3
|
export type SuggestionOptions = CatalogApiOptions & {
|
|
13
|
-
filterKey: string;
|
|
14
|
-
searchTerm: string;
|
|
15
|
-
max?: number;
|
|
16
|
-
comparisonType?: FilterComparisonType;
|
|
17
|
-
};
|
|
18
|
-
export type SuggestionOptionsNew = CatalogApiOptions & {
|
|
19
4
|
attribute: string;
|
|
20
5
|
searchTerm: string;
|
|
21
6
|
max?: number;
|
|
22
7
|
calculateResultKeys?: boolean;
|
|
23
|
-
|
|
8
|
+
relevantData?: 'filtered' | 'all';
|
|
9
|
+
transform?: DcuplQueryTransformOptions[];
|
|
24
10
|
};
|
|
25
|
-
export type
|
|
11
|
+
export type Suggestion = {
|
|
26
12
|
value: string;
|
|
27
13
|
keys: string[];
|
|
28
14
|
};
|