@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.
Files changed (35) hide show
  1. package/dist/lib-cjs/getFacets.js +7 -4
  2. package/dist/lib-cjs/getFacets.js.map +1 -1
  3. package/dist/lib-cjs/index.d.ts +1 -0
  4. package/dist/lib-cjs/index.js +1 -0
  5. package/dist/lib-cjs/index.js.map +1 -1
  6. package/dist/lib-cjs/query-builder.d.ts +22 -0
  7. package/dist/lib-cjs/query-builder.js +229 -0
  8. package/dist/lib-cjs/query-builder.js.map +1 -0
  9. package/dist/lib-cjs/queryData.js +56 -15
  10. package/dist/lib-cjs/queryData.js.map +1 -1
  11. package/dist/lib-cjs/tsconfig-cjs.tsbuildinfo +1 -1
  12. package/dist/lib-cjs/types/dcupl.types.d.ts +5 -7
  13. package/dist/lib-cjs/types/dcupl.types.js +12 -0
  14. package/dist/lib-cjs/types/dcupl.types.js.map +1 -1
  15. package/dist/lib-cjs/types/filter.types.d.ts +4 -3
  16. package/dist/lib-cjs/types/filter.types.js.map +1 -1
  17. package/dist/lib-cjs/types/list.types.d.ts +2 -2
  18. package/dist/lib-esm/getFacets.js +7 -4
  19. package/dist/lib-esm/getFacets.js.map +1 -1
  20. package/dist/lib-esm/index.d.ts +1 -0
  21. package/dist/lib-esm/index.js +1 -0
  22. package/dist/lib-esm/index.js.map +1 -1
  23. package/dist/lib-esm/query-builder.d.ts +22 -0
  24. package/dist/lib-esm/query-builder.js +226 -0
  25. package/dist/lib-esm/query-builder.js.map +1 -0
  26. package/dist/lib-esm/queryData.js +57 -16
  27. package/dist/lib-esm/queryData.js.map +1 -1
  28. package/dist/lib-esm/tsconfig.tsbuildinfo +1 -1
  29. package/dist/lib-esm/types/dcupl.types.d.ts +5 -7
  30. package/dist/lib-esm/types/dcupl.types.js +11 -1
  31. package/dist/lib-esm/types/dcupl.types.js.map +1 -1
  32. package/dist/lib-esm/types/filter.types.d.ts +4 -3
  33. package/dist/lib-esm/types/filter.types.js.map +1 -1
  34. package/dist/lib-esm/types/list.types.d.ts +2 -2
  35. package/package.json +1 -1
@@ -58,10 +58,8 @@ type DcuplQueryOptions = {
58
58
  */
59
59
  invert?: boolean;
60
60
  };
61
- type DcuplQueryFindOperator = 'find';
62
- type DcuplQueryGeneralOperators = 'eq' | 'gt' | 'gte' | 'lt' | 'lte';
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<DcuplQuery | DcuplQueryGroup>;
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,2 +1,12 @@
1
- export {};
1
+ export var DcuplQueryOperatorsAsArray = [
2
+ 'eq',
3
+ 'find',
4
+ 'gt',
5
+ 'gte',
6
+ 'lt',
7
+ 'lte',
8
+ 'typeof',
9
+ 'isTruthy',
10
+ 'size',
11
+ ];
2
12
  //# sourceMappingURL=dcupl.types.js.map
@@ -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
- selected: NumberConstraintOperators[];
94
+ relatedQuery: DcuplQueryGroup | undefined;
94
95
  };
95
96
  export type FilterItemDateRangeValue = {
96
97
  available: FilterEntryDateRange;
97
98
  initial: FilterEntryDateRange;
98
- selected: DateConstraintOperators[];
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":"AAoDA,MAAM,CAAC,IAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"}
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 { FilterConstraint } from './filter.types';
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
- appliedFilters: FilterConstraint[];
55
+ appliedQuery: DcuplGlobalQueryOptionsNew<any>;
56
56
  attributes: ModelAttribute[];
57
57
  itemOptions: DcuplItemsOptions<any>;
58
58
  views: ViewDefinition[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcupl/common",
3
- "version": "0.0.81-beta.2",
3
+ "version": "0.0.81-beta.3",
4
4
  "description": "Dcupl Common Code",
5
5
  "main": "dist/lib-cjs/index.js",
6
6
  "module": "dist/lib-esm/index.js",