@dcupl/common 0.0.81-beta.0 → 0.0.81-beta.2
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.d.ts +2 -0
- package/dist/lib-cjs/getFacets.js +137 -0
- package/dist/lib-cjs/getFacets.js.map +1 -0
- 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/queryData.d.ts +2 -2
- package/dist/lib-cjs/queryData.js +243 -70
- 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 +44 -11
- package/dist/lib-esm/getFacets.d.ts +2 -0
- package/dist/lib-esm/getFacets.js +133 -0
- package/dist/lib-esm/getFacets.js.map +1 -0
- 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/queryData.d.ts +2 -2
- package/dist/lib-esm/queryData.js +244 -71
- 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 +44 -11
- package/package.json +2 -2
|
@@ -50,26 +50,59 @@ export type DcuplGlobalQueryOptions<T> = DcuplItemsOptions<T> & {
|
|
|
50
50
|
listKey: string;
|
|
51
51
|
query: FilterOptions[];
|
|
52
52
|
};
|
|
53
|
-
type DcuplQueryTransformOptions = '
|
|
53
|
+
export type DcuplQueryTransformOptions = 'lowercase' | 'trim' | 'removeWhitespace';
|
|
54
54
|
type DcuplQueryOptions = {
|
|
55
|
-
transform
|
|
55
|
+
transform?: DcuplQueryTransformOptions[];
|
|
56
|
+
/**
|
|
57
|
+
* Invert possible for eq, typeof
|
|
58
|
+
*/
|
|
59
|
+
invert?: boolean;
|
|
56
60
|
};
|
|
57
|
-
type
|
|
58
|
-
type
|
|
59
|
-
type
|
|
60
|
-
type
|
|
61
|
-
export type DcuplQueryOperator = DcuplQueryGeneralOperators | DcuplQueryArrayOperators | DcuplQueryFalsy | DcuplQueryStringOperators;
|
|
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;
|
|
62
65
|
export type DcuplQueryType = 'and' | 'or';
|
|
63
|
-
|
|
66
|
+
type DcuplQueryBase = {
|
|
67
|
+
/**
|
|
68
|
+
* title, something.key someArray[0].key
|
|
69
|
+
* */
|
|
64
70
|
attribute: string;
|
|
65
|
-
operator: DcuplQueryOperator;
|
|
66
|
-
value: any;
|
|
67
71
|
options?: DcuplQueryOptions;
|
|
68
72
|
};
|
|
73
|
+
type DcuplQueryEq = DcuplQueryBase & {
|
|
74
|
+
operator: 'eq';
|
|
75
|
+
/**
|
|
76
|
+
* You may search for any value but
|
|
77
|
+
* only values of type string and { key:string } may be used for indexed search
|
|
78
|
+
*/
|
|
79
|
+
value: any;
|
|
80
|
+
};
|
|
81
|
+
type DcuplQueryFind = DcuplQueryBase & {
|
|
82
|
+
operator: 'find';
|
|
83
|
+
value: Record<string, unknown> | string;
|
|
84
|
+
};
|
|
85
|
+
type DcuplQueryNumbers = DcuplQueryBase & {
|
|
86
|
+
operator: 'gt' | 'lt' | 'gte' | 'lte';
|
|
87
|
+
value: string | number | Date;
|
|
88
|
+
};
|
|
89
|
+
type DcuplQueryTypeOf = DcuplQueryBase & {
|
|
90
|
+
operator: 'typeof';
|
|
91
|
+
value: string;
|
|
92
|
+
};
|
|
93
|
+
type DcuplQueryIsTruthy = DcuplQueryBase & {
|
|
94
|
+
operator: 'isTruthy';
|
|
95
|
+
value: boolean;
|
|
96
|
+
};
|
|
97
|
+
type DcuplQuerySize = DcuplQueryBase & {
|
|
98
|
+
operator: 'size';
|
|
99
|
+
value: number;
|
|
100
|
+
};
|
|
101
|
+
export type DcuplQuery = DcuplQueryEq | DcuplQueryNumbers | DcuplQueryTypeOf | DcuplQueryIsTruthy | DcuplQuerySize | DcuplQueryFind;
|
|
69
102
|
export type DcuplQueryGroup = {
|
|
70
103
|
queryType?: DcuplQueryType;
|
|
71
104
|
queryKey?: string;
|
|
72
|
-
query: Array<DcuplQuery
|
|
105
|
+
query: Array<DcuplQuery | DcuplQueryGroup>;
|
|
73
106
|
options?: DcuplQueryOptions;
|
|
74
107
|
};
|
|
75
108
|
export type DcuplGlobalQueryOptionsNew<T> = DcuplItemsOptions<T> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcupl/common",
|
|
3
|
-
"version": "0.0.81-beta.
|
|
3
|
+
"version": "0.0.81-beta.2",
|
|
4
4
|
"description": "Dcupl Common Code",
|
|
5
5
|
"main": "dist/lib-cjs/index.js",
|
|
6
6
|
"module": "dist/lib-esm/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "dcupl Team",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"date-fns": "^2.
|
|
24
|
+
"date-fns": "^2.29.x",
|
|
25
25
|
"lodash": "4.17.x"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|