@dcupl/common 0.0.81-beta.2 → 0.0.81-beta.3
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/getFacets.js +7 -4
- package/dist/lib-cjs/getFacets.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/query-builder.d.ts +22 -0
- package/dist/lib-cjs/query-builder.js +229 -0
- package/dist/lib-cjs/query-builder.js.map +1 -0
- package/dist/lib-cjs/queryData.js +56 -15
- package/dist/lib-cjs/queryData.js.map +1 -1
- package/dist/lib-cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/lib-cjs/types/dcupl.types.d.ts +5 -7
- package/dist/lib-cjs/types/dcupl.types.js +12 -0
- package/dist/lib-cjs/types/dcupl.types.js.map +1 -1
- package/dist/lib-cjs/types/filter.types.d.ts +4 -3
- package/dist/lib-cjs/types/filter.types.js.map +1 -1
- package/dist/lib-cjs/types/list.types.d.ts +2 -2
- package/dist/lib-esm/getFacets.js +7 -4
- package/dist/lib-esm/getFacets.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/query-builder.d.ts +22 -0
- package/dist/lib-esm/query-builder.js +226 -0
- package/dist/lib-esm/query-builder.js.map +1 -0
- package/dist/lib-esm/queryData.js +57 -16
- package/dist/lib-esm/queryData.js.map +1 -1
- package/dist/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/dist/lib-esm/types/dcupl.types.d.ts +5 -7
- package/dist/lib-esm/types/dcupl.types.js +11 -1
- package/dist/lib-esm/types/dcupl.types.js.map +1 -1
- package/dist/lib-esm/types/filter.types.d.ts +4 -3
- package/dist/lib-esm/types/filter.types.js.map +1 -1
- package/dist/lib-esm/types/list.types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -58,10 +58,8 @@ type DcuplQueryOptions = {
|
|
|
58
58
|
*/
|
|
59
59
|
invert?: boolean;
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
type
|
|
63
|
-
type DcuplQuerySpecialOperator = 'typeof' | 'isTruthy' | 'size';
|
|
64
|
-
export type DcuplQueryOperator = DcuplQueryGeneralOperators | DcuplQueryFindOperator | DcuplQuerySpecialOperator;
|
|
61
|
+
export declare const DcuplQueryOperatorsAsArray: readonly ["eq", "find", "gt", "gte", "lt", "lte", "typeof", "isTruthy", "size"];
|
|
62
|
+
export type DcuplQueryOperator = (typeof DcuplQueryOperatorsAsArray)[number];
|
|
65
63
|
export type DcuplQueryType = 'and' | 'or';
|
|
66
64
|
type DcuplQueryBase = {
|
|
67
65
|
/**
|
|
@@ -99,13 +97,13 @@ type DcuplQuerySize = DcuplQueryBase & {
|
|
|
99
97
|
value: number;
|
|
100
98
|
};
|
|
101
99
|
export type DcuplQuery = DcuplQueryEq | DcuplQueryNumbers | DcuplQueryTypeOf | DcuplQueryIsTruthy | DcuplQuerySize | DcuplQueryFind;
|
|
102
|
-
export type DcuplQueryGroup = {
|
|
100
|
+
export type DcuplQueryGroup<QueryType extends DcuplQuery | DcuplQueryGroup = DcuplQuery> = {
|
|
103
101
|
queryType?: DcuplQueryType;
|
|
104
102
|
queryKey?: string;
|
|
105
|
-
query: Array<
|
|
103
|
+
query: Array<QueryType>;
|
|
106
104
|
options?: DcuplQueryOptions;
|
|
107
105
|
};
|
|
108
106
|
export type DcuplGlobalQueryOptionsNew<T> = DcuplItemsOptions<T> & {
|
|
109
107
|
listKey: string;
|
|
110
|
-
} & DcuplQueryGroup
|
|
108
|
+
} & DcuplQueryGroup<DcuplQueryGroup<DcuplQuery>>;
|
|
111
109
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dcupl.types.js","sourceRoot":"","sources":["../../../src/types/dcupl.types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"dcupl.types.js","sourceRoot":"","sources":["../../../src/types/dcupl.types.ts"],"names":[],"mappings":"AAkEA,MAAM,CAAC,IAAM,0BAA0B,GAAG;IACxC,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,QAAQ;IACR,UAAU;IACV,MAAM;CACE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListItem } from '.';
|
|
1
|
+
import { DcuplQueryGroup, ListItem } from '.';
|
|
2
2
|
import { CatalogApiOptions } from './list.types';
|
|
3
3
|
import { FilterComparisonType } from './model.types';
|
|
4
4
|
export type ConstraintTypes = 'referenceConstraint' | 'textConstraint' | 'numberConstraint' | 'dateConstraint' | 'booleanConstraint';
|
|
@@ -7,6 +7,7 @@ export type ConstraintBase = {
|
|
|
7
7
|
filterKey: string;
|
|
8
8
|
attributeKey: string;
|
|
9
9
|
type: ConstraintTypes;
|
|
10
|
+
query?: any;
|
|
10
11
|
};
|
|
11
12
|
export type ReferenceConstraint = ConstraintBase & {
|
|
12
13
|
type: 'referenceConstraint';
|
|
@@ -90,12 +91,12 @@ export type BooleanFilterItem = FilterItemBase & {
|
|
|
90
91
|
export type FilterItemNumberRangeValue = {
|
|
91
92
|
available: FilterEntryNumberRange;
|
|
92
93
|
initial: FilterEntryNumberRange;
|
|
93
|
-
|
|
94
|
+
relatedQuery: DcuplQueryGroup | undefined;
|
|
94
95
|
};
|
|
95
96
|
export type FilterItemDateRangeValue = {
|
|
96
97
|
available: FilterEntryDateRange;
|
|
97
98
|
initial: FilterEntryDateRange;
|
|
98
|
-
|
|
99
|
+
relatedQuery: DcuplQueryGroup | undefined;
|
|
99
100
|
};
|
|
100
101
|
export type ReferenceFilterItem = FilterItemBase & {
|
|
101
102
|
type: 'reference';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.types.js","sourceRoot":"","sources":["../../../src/types/filter.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.types.js","sourceRoot":"","sources":["../../../src/types/filter.types.ts"],"names":[],"mappings":"AAqDA,MAAM,CAAC,IAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DcuplGlobalQueryOptionsNew } from './dcupl.types';
|
|
2
2
|
import { ViewDefinition, ModelAttribute } from './model.types';
|
|
3
3
|
import { Projection, SortingProjection } from './projection.types';
|
|
4
4
|
export type DcuplItemsOptions<T> = {
|
|
@@ -52,7 +52,7 @@ export type ListMetadata = {
|
|
|
52
52
|
key: string;
|
|
53
53
|
currentSize: number;
|
|
54
54
|
initialSize: number;
|
|
55
|
-
|
|
55
|
+
appliedQuery: DcuplGlobalQueryOptionsNew<any>;
|
|
56
56
|
attributes: ModelAttribute[];
|
|
57
57
|
itemOptions: DcuplItemsOptions<any>;
|
|
58
58
|
views: ViewDefinition[];
|