@dcupl/common 0.0.81-beta.5 → 0.0.81-beta.6
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 +7 -7
- package/dist/lib-cjs/changeDetection.js +29 -32
- package/dist/lib-cjs/changeDetection.js.map +1 -1
- package/dist/lib-cjs/getFacets.js +5 -5
- package/dist/lib-cjs/getFacets.js.map +1 -1
- package/dist/lib-cjs/query-builder.d.ts +10 -9
- package/dist/lib-cjs/query-builder.js +103 -92
- package/dist/lib-cjs/query-builder.js.map +1 -1
- package/dist/lib-cjs/queryData.js +14 -14
- 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 +4 -67
- package/dist/lib-cjs/types/dcupl.types.js +0 -12
- package/dist/lib-cjs/types/dcupl.types.js.map +1 -1
- 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 +3 -4
- package/dist/lib-cjs/types/query.types.d.ts +70 -0
- package/dist/lib-cjs/types/query.types.js +15 -0
- package/dist/lib-cjs/types/query.types.js.map +1 -0
- package/dist/lib-cjs/types/selection.types.d.ts +1 -1
- package/dist/lib-esm/changeDetection.d.ts +7 -7
- package/dist/lib-esm/changeDetection.js +29 -32
- package/dist/lib-esm/changeDetection.js.map +1 -1
- package/dist/lib-esm/getFacets.js +6 -6
- package/dist/lib-esm/getFacets.js.map +1 -1
- package/dist/lib-esm/query-builder.d.ts +10 -9
- package/dist/lib-esm/query-builder.js +102 -91
- package/dist/lib-esm/query-builder.js.map +1 -1
- package/dist/lib-esm/queryData.js +15 -15
- 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 +4 -67
- package/dist/lib-esm/types/dcupl.types.js +1 -11
- package/dist/lib-esm/types/dcupl.types.js.map +1 -1
- 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 +3 -4
- package/dist/lib-esm/types/query.types.d.ts +70 -0
- package/dist/lib-esm/types/query.types.js +12 -0
- package/dist/lib-esm/types/query.types.js.map +1 -0
- package/dist/lib-esm/types/selection.types.d.ts +1 -1
- package/package.json +2 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DcuplUpdateMessage } from '../changeDetection';
|
|
2
|
+
import { DcuplItemsOptions } from './list.types';
|
|
3
3
|
export type DcuplInitOptions = {
|
|
4
4
|
config?: DcuplInitConfig;
|
|
5
5
|
logs?: DcuplInitLoggingConfig;
|
|
@@ -41,69 +41,6 @@ export type DcuplResponse<T> = {
|
|
|
41
41
|
metrics: DcuplMetrics;
|
|
42
42
|
};
|
|
43
43
|
export type DcuplGlobalItemsOptions<T> = DcuplItemsOptions<T> & {
|
|
44
|
-
|
|
44
|
+
modelKey: string;
|
|
45
45
|
};
|
|
46
|
-
export type
|
|
47
|
-
listKey: string;
|
|
48
|
-
};
|
|
49
|
-
export type DcuplGlobalQueryOptions<T> = DcuplItemsOptions<T> & {
|
|
50
|
-
listKey: string;
|
|
51
|
-
query: FilterOptions[];
|
|
52
|
-
};
|
|
53
|
-
export type DcuplQueryTransformOptions = 'lowercase' | 'trim' | 'removeWhitespace';
|
|
54
|
-
type DcuplQueryOptions = {
|
|
55
|
-
transform?: DcuplQueryTransformOptions[];
|
|
56
|
-
/**
|
|
57
|
-
* Invert possible for eq, typeof
|
|
58
|
-
*/
|
|
59
|
-
invert?: boolean;
|
|
60
|
-
};
|
|
61
|
-
export declare const DcuplQueryOperatorsAsArray: readonly ["eq", "find", "gt", "gte", "lt", "lte", "typeof", "isTruthy", "size"];
|
|
62
|
-
export type DcuplQueryOperator = (typeof DcuplQueryOperatorsAsArray)[number];
|
|
63
|
-
export type DcuplQueryType = 'and' | 'or';
|
|
64
|
-
type DcuplQueryBase = {
|
|
65
|
-
/**
|
|
66
|
-
* title, something.key someArray[0].key
|
|
67
|
-
* */
|
|
68
|
-
attribute: string;
|
|
69
|
-
options?: DcuplQueryOptions;
|
|
70
|
-
};
|
|
71
|
-
type DcuplQueryEq = DcuplQueryBase & {
|
|
72
|
-
operator: 'eq';
|
|
73
|
-
/**
|
|
74
|
-
* You may search for any value but
|
|
75
|
-
* only values of type string and { key:string } may be used for indexed search
|
|
76
|
-
*/
|
|
77
|
-
value: any;
|
|
78
|
-
};
|
|
79
|
-
type DcuplQueryFind = DcuplQueryBase & {
|
|
80
|
-
operator: 'find';
|
|
81
|
-
value: Record<string, unknown> | string;
|
|
82
|
-
};
|
|
83
|
-
type DcuplQueryNumbers = DcuplQueryBase & {
|
|
84
|
-
operator: 'gt' | 'lt' | 'gte' | 'lte';
|
|
85
|
-
value: string | number | Date;
|
|
86
|
-
};
|
|
87
|
-
type DcuplQueryTypeOf = DcuplQueryBase & {
|
|
88
|
-
operator: 'typeof';
|
|
89
|
-
value: string;
|
|
90
|
-
};
|
|
91
|
-
type DcuplQueryIsTruthy = DcuplQueryBase & {
|
|
92
|
-
operator: 'isTruthy';
|
|
93
|
-
value: boolean;
|
|
94
|
-
};
|
|
95
|
-
type DcuplQuerySize = DcuplQueryBase & {
|
|
96
|
-
operator: 'size';
|
|
97
|
-
value: number;
|
|
98
|
-
};
|
|
99
|
-
export type DcuplQuery = DcuplQueryEq | DcuplQueryNumbers | DcuplQueryTypeOf | DcuplQueryIsTruthy | DcuplQuerySize | DcuplQueryFind;
|
|
100
|
-
export type DcuplQueryGroup<QueryType extends DcuplQuery | DcuplQueryGroup = DcuplQuery> = {
|
|
101
|
-
queryType?: DcuplQueryType;
|
|
102
|
-
queryKey?: string;
|
|
103
|
-
query: Array<QueryType>;
|
|
104
|
-
options?: DcuplQueryOptions;
|
|
105
|
-
};
|
|
106
|
-
export type DcuplGlobalQueryOptionsNew<T> = DcuplItemsOptions<T> & {
|
|
107
|
-
listKey: string;
|
|
108
|
-
} & DcuplQueryGroup<DcuplQueryGroup<DcuplQuery>>;
|
|
109
|
-
export {};
|
|
46
|
+
export type CallbackFunction = (item: DcuplUpdateMessage) => void;
|
|
@@ -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":""}
|
|
@@ -6,6 +6,7 @@ export * from './internal.types';
|
|
|
6
6
|
export * from './list.types';
|
|
7
7
|
export * from './model.types';
|
|
8
8
|
export * from './projection.types';
|
|
9
|
+
export * from './query.types';
|
|
9
10
|
export * from './selection.types';
|
|
10
11
|
export * from './section.types';
|
|
11
12
|
export * from './suggestion.types';
|
|
@@ -6,6 +6,7 @@ export * from './internal.types';
|
|
|
6
6
|
export * from './list.types';
|
|
7
7
|
export * from './model.types';
|
|
8
8
|
export * from './projection.types';
|
|
9
|
+
export * from './query.types';
|
|
9
10
|
export * from './selection.types';
|
|
10
11
|
export * from './section.types';
|
|
11
12
|
export * from './suggestion.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,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,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,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,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DcuplGlobalQueryOptionsNew } from './
|
|
1
|
+
import { DcuplGlobalQueryOptionsNew } 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> = {
|
|
@@ -30,8 +30,8 @@ export type DcuplFiltersOptions = DcuplFilterOptions & {
|
|
|
30
30
|
filterKeys?: string[];
|
|
31
31
|
};
|
|
32
32
|
export type DcuplListOptions<ModelNames extends string = string> = {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
modelKey: ModelNames;
|
|
34
|
+
key?: string;
|
|
35
35
|
listItemKeys?: string[];
|
|
36
36
|
empty?: boolean;
|
|
37
37
|
};
|
|
@@ -54,7 +54,6 @@ export type ListMetadata = {
|
|
|
54
54
|
initialSize: number;
|
|
55
55
|
appliedQuery: DcuplGlobalQueryOptionsNew<any>;
|
|
56
56
|
attributes: ModelAttribute[];
|
|
57
|
-
itemOptions: DcuplItemsOptions<any>;
|
|
58
57
|
views: ViewDefinition[];
|
|
59
58
|
};
|
|
60
59
|
export type ViewMetadata = {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Projection, SortingProjection } from './projection.types';
|
|
2
|
+
export type DcuplQueryTransformOptions = 'lowercase' | 'trim' | 'removeWhitespace';
|
|
3
|
+
type DcuplQueryOptions = {
|
|
4
|
+
transform?: DcuplQueryTransformOptions[];
|
|
5
|
+
/**
|
|
6
|
+
* Invert possible for eq, typeof
|
|
7
|
+
*/
|
|
8
|
+
invert?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const DcuplQueryOperatorsAsArray: readonly ["eq", "find", "gt", "gte", "lt", "lte", "typeof", "isTruthy", "size"];
|
|
11
|
+
export type DcuplQueryOperator = (typeof DcuplQueryOperatorsAsArray)[number];
|
|
12
|
+
export type DcuplQueryType = 'and' | 'or';
|
|
13
|
+
type DcuplQueryBase = {
|
|
14
|
+
attribute: string;
|
|
15
|
+
options?: DcuplQueryOptions;
|
|
16
|
+
};
|
|
17
|
+
type DcuplQueryEq = DcuplQueryBase & {
|
|
18
|
+
operator: 'eq';
|
|
19
|
+
/**
|
|
20
|
+
* You may search for any value but
|
|
21
|
+
* only values of type string and { key:string } may be used for indexed search
|
|
22
|
+
*/
|
|
23
|
+
value: any;
|
|
24
|
+
};
|
|
25
|
+
type DcuplQueryFind = DcuplQueryBase & {
|
|
26
|
+
operator: 'find';
|
|
27
|
+
value: Record<string, unknown> | string;
|
|
28
|
+
};
|
|
29
|
+
type DcuplQueryNumbers = DcuplQueryBase & {
|
|
30
|
+
operator: 'gt' | 'lt' | 'gte' | 'lte';
|
|
31
|
+
value: string | number | Date;
|
|
32
|
+
};
|
|
33
|
+
type DcuplQueryTypeOf = DcuplQueryBase & {
|
|
34
|
+
operator: 'typeof';
|
|
35
|
+
value: string;
|
|
36
|
+
};
|
|
37
|
+
type DcuplQueryIsTruthy = DcuplQueryBase & {
|
|
38
|
+
operator: 'isTruthy';
|
|
39
|
+
value: boolean;
|
|
40
|
+
};
|
|
41
|
+
type DcuplQuerySize = DcuplQueryBase & {
|
|
42
|
+
operator: 'size';
|
|
43
|
+
value: number;
|
|
44
|
+
};
|
|
45
|
+
export type DcuplQuery = DcuplQueryEq | DcuplQueryNumbers | DcuplQueryTypeOf | DcuplQueryIsTruthy | DcuplQuerySize | DcuplQueryFind;
|
|
46
|
+
export type DcuplQueryGroup<ChildQuery extends DcuplQuery | DcuplQueryGroup = any> = {
|
|
47
|
+
groupType?: DcuplQueryType;
|
|
48
|
+
groupKey?: string;
|
|
49
|
+
queries: Array<ChildQuery>;
|
|
50
|
+
options?: DcuplQueryOptions;
|
|
51
|
+
};
|
|
52
|
+
export type DcuplGlobalQueryOptionsNew<T> = DcuplGlobalQueryOptions<T>;
|
|
53
|
+
type DcuplItemOptions<T> = {
|
|
54
|
+
start?: number;
|
|
55
|
+
count?: number;
|
|
56
|
+
projection?: Projection<T>;
|
|
57
|
+
sort?: SortingProjection<T>;
|
|
58
|
+
};
|
|
59
|
+
export type DcuplGlobalQueryOptions<T> = {
|
|
60
|
+
modelKey: string;
|
|
61
|
+
} & DcuplItemOptions<T> & DcuplQueryGroup;
|
|
62
|
+
export type DcuplGlobalItemOptions<T> = {
|
|
63
|
+
modelKey: string;
|
|
64
|
+
itemKey: string;
|
|
65
|
+
} & DcuplItemOptions<T>;
|
|
66
|
+
export type DcuplListQueryOptions<T> = DcuplItemOptions<T> & DcuplQueryGroup;
|
|
67
|
+
export type DcuplListItemOptions<T> = DcuplItemOptions<T> & {
|
|
68
|
+
itemKey: string;
|
|
69
|
+
};
|
|
70
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.types.js","sourceRoot":"","sources":["../../../src/types/query.types.ts"],"names":[],"mappings":"AAYA,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"}
|
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.6",
|
|
4
4
|
"description": "Dcupl Common Code",
|
|
5
5
|
"main": "dist/lib-cjs/index.js",
|
|
6
6
|
"module": "dist/lib-esm/index.js",
|
|
@@ -24,7 +24,5 @@
|
|
|
24
24
|
"date-fns": "^2.29.x",
|
|
25
25
|
"lodash": "4.17.x"
|
|
26
26
|
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"rxjs": ">= 6.x <= 7.x"
|
|
29
|
-
}
|
|
27
|
+
"peerDependencies": {}
|
|
30
28
|
}
|