@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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CallbackFunction } from './types';
|
|
2
2
|
export type DcuplUpdateScope = 'all' | 'global' | 'list' | 'list$';
|
|
3
3
|
export type DcuplUpdateTrigger = 'user' | 'loader';
|
|
4
4
|
export type DcuplUpdateType = 'loader_fetch_finished' | 'file_loaded' | 'file_processed' | 'dcupl_initialized' | 'dcupl_updated_manually' | 'data_reprocessed_manually' | 'result_updated' | 'filter_applied' | 'global_triggered_update';
|
|
@@ -12,20 +12,20 @@ export type DcuplUpdateMessage = {
|
|
|
12
12
|
title?: string;
|
|
13
13
|
origin?: DcuplUpdateTrigger;
|
|
14
14
|
duration?: number;
|
|
15
|
-
|
|
15
|
+
originCdRefKey?: string;
|
|
16
16
|
modelKey?: string;
|
|
17
17
|
cloneResult?: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare class ChangeDetector {
|
|
20
|
-
|
|
20
|
+
key: string;
|
|
21
21
|
protected parentCd: ChangeDetector | undefined;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
22
|
+
private off;
|
|
23
|
+
private updateListener;
|
|
24
24
|
constructor();
|
|
25
|
-
_init(
|
|
25
|
+
_init(cdRefKey: string, parentCd?: ChangeDetector): void;
|
|
26
26
|
destroy(): void;
|
|
27
27
|
trigger(msg: DcuplUpdateMessage): void;
|
|
28
|
-
on
|
|
28
|
+
on(cb: CallbackFunction): () => void;
|
|
29
29
|
}
|
|
30
30
|
export declare const clone: (obj: any, shouldClone: boolean) => any;
|
|
31
31
|
export declare const trigger: (msg: DcuplUpdateMessage) => any;
|
|
@@ -5,47 +5,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.trigger = exports.clone = exports.ChangeDetector = void 0;
|
|
7
7
|
var cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
8
|
-
var rxjs_1 = require("rxjs");
|
|
9
|
-
var operators_1 = require("rxjs/operators");
|
|
10
8
|
var performance_1 = require("./performance");
|
|
11
9
|
var ChangeDetector = /** @class */ (function () {
|
|
12
10
|
function ChangeDetector() {
|
|
13
|
-
this.
|
|
11
|
+
this.updateListener = new Set();
|
|
14
12
|
}
|
|
15
|
-
ChangeDetector.prototype._init = function (
|
|
13
|
+
ChangeDetector.prototype._init = function (cdRefKey, parentCd) {
|
|
16
14
|
var _this = this;
|
|
17
|
-
this.
|
|
15
|
+
this.key = cdRefKey;
|
|
18
16
|
this.parentCd = parentCd;
|
|
19
17
|
if (this.parentCd) {
|
|
20
|
-
this.
|
|
18
|
+
this.off = this.parentCd.on(function (msg) {
|
|
21
19
|
var _a;
|
|
22
|
-
if (msg.action === 'update' && msg.
|
|
23
|
-
_this.trigger(
|
|
24
|
-
scope: 'list',
|
|
25
|
-
action: 'update',
|
|
26
|
-
title: 'global_triggered_update',
|
|
27
|
-
type: 'global_triggered_update',
|
|
28
|
-
});
|
|
20
|
+
if (msg.action === 'update' && msg.originCdRefKey === ((_a = _this.parentCd) === null || _a === void 0 ? void 0 : _a.key)) {
|
|
21
|
+
_this.trigger(msg);
|
|
29
22
|
}
|
|
30
23
|
});
|
|
31
24
|
}
|
|
32
25
|
};
|
|
33
26
|
ChangeDetector.prototype.destroy = function () {
|
|
34
|
-
if (this.
|
|
35
|
-
this.
|
|
27
|
+
if (this.off) {
|
|
28
|
+
this.off();
|
|
36
29
|
}
|
|
37
30
|
};
|
|
38
31
|
ChangeDetector.prototype.trigger = function (msg) {
|
|
39
|
-
if (!msg.
|
|
40
|
-
msg.
|
|
41
|
-
}
|
|
42
|
-
this.update$.next(msg);
|
|
43
|
-
if (this.parentCd) {
|
|
44
|
-
this.parentCd.trigger(msg);
|
|
32
|
+
if (!msg.originCdRefKey) {
|
|
33
|
+
msg.originCdRefKey = this.key;
|
|
45
34
|
}
|
|
35
|
+
this.updateListener.forEach(function (cb) {
|
|
36
|
+
cb(msg);
|
|
37
|
+
});
|
|
46
38
|
};
|
|
47
|
-
ChangeDetector.prototype.on
|
|
48
|
-
|
|
39
|
+
ChangeDetector.prototype.on = function (cb) {
|
|
40
|
+
var _this = this;
|
|
41
|
+
this.updateListener.add(cb);
|
|
42
|
+
return function () {
|
|
43
|
+
_this.updateListener.delete(cb);
|
|
44
|
+
};
|
|
49
45
|
};
|
|
50
46
|
return ChangeDetector;
|
|
51
47
|
}());
|
|
@@ -73,10 +69,9 @@ var trigger = function (msg) {
|
|
|
73
69
|
}
|
|
74
70
|
var cdRef = this.cdRef;
|
|
75
71
|
var start = performance_1.perf.now();
|
|
76
|
-
var listId = this.listId;
|
|
77
72
|
var modelKey = (_a = this.model) === null || _a === void 0 ? void 0 : _a.key;
|
|
78
|
-
if (
|
|
79
|
-
msg.
|
|
73
|
+
if (!msg.originCdRefKey && cdRef.key) {
|
|
74
|
+
msg.originCdRefKey = cdRef.key;
|
|
80
75
|
}
|
|
81
76
|
if (modelKey) {
|
|
82
77
|
msg.modelKey = modelKey;
|
|
@@ -86,23 +81,25 @@ var trigger = function (msg) {
|
|
|
86
81
|
msg.method = _propertyKey;
|
|
87
82
|
msg.args = args;
|
|
88
83
|
if (result && 'pipe' in result) {
|
|
89
|
-
result = result.pipe(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
// result = (result as Observable<any>).pipe(
|
|
85
|
+
// map((value) => {
|
|
86
|
+
// cdRef?.trigger(msg);
|
|
87
|
+
// return clone(value, !!msg.cloneResult);
|
|
88
|
+
// }),
|
|
89
|
+
// );
|
|
93
90
|
return result;
|
|
94
91
|
}
|
|
95
92
|
else if (result && 'then' in result) {
|
|
96
93
|
return result.then(function (value) {
|
|
97
94
|
var end = performance_1.perf.now();
|
|
98
95
|
msg.duration = end - start;
|
|
99
|
-
cdRef.trigger(msg);
|
|
96
|
+
cdRef === null || cdRef === void 0 ? void 0 : cdRef.trigger(msg);
|
|
100
97
|
return (0, exports.clone)(value, !!msg.cloneResult);
|
|
101
98
|
});
|
|
102
99
|
}
|
|
103
100
|
var end = performance_1.perf.now();
|
|
104
101
|
msg.duration = end - start;
|
|
105
|
-
cdRef.trigger(msg);
|
|
102
|
+
cdRef === null || cdRef === void 0 ? void 0 : cdRef.trigger(msg);
|
|
106
103
|
try {
|
|
107
104
|
return (0, exports.clone)(result, !!msg.cloneResult);
|
|
108
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeDetection.js","sourceRoot":"","sources":["../../src/changeDetection.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyC;
|
|
1
|
+
{"version":3,"file":"changeDetection.js","sourceRoot":"","sources":["../../src/changeDetection.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyC;AAEzC,6CAAqC;AAgCrC;IAOE;QAFQ,mBAAc,GAA0B,IAAI,GAAG,EAAE,CAAC;IAE3C,CAAC;IAET,8BAAK,GAAZ,UAAa,QAAgB,EAAE,QAAyB;QAAxD,iBAYC;QAXC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;QAEpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,UAAC,GAAuB;;gBAClD,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,cAAc,MAAK,MAAA,KAAI,CA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GAAG,GAAG,kBAAI,CAAC,GAAG,EAAE,CAAC;gBACvB,GAAG,CAAC,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;gBAC3B,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBAEpB,IAAI;oBACF,OAAO,IAAA,aAAK,EAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;iBACzC;gBAAC,OAAO,GAAG,EAAE;oBACZ,OAAO,MAAM,CAAC;iBACf;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,GAAG,CAAC;aACX;QACH,CAAC,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AA1DW,QAAA,OAAO,WA0DlB"}
|
|
@@ -40,11 +40,11 @@ exports.getFacets = void 0;
|
|
|
40
40
|
var queryData_1 = require("./queryData");
|
|
41
41
|
var query_builder_1 = require("./query-builder");
|
|
42
42
|
var lodash_1 = require("lodash");
|
|
43
|
-
var queryBuilder = new query_builder_1.
|
|
43
|
+
var queryBuilder = new query_builder_1.DcuplQueryBuilder();
|
|
44
44
|
function getFacets(modelData, remoteModelData, options, query, attributeKey, modelIndexMap) {
|
|
45
45
|
var e_1, _a, e_2, _b, e_3, _c;
|
|
46
46
|
var filterItemEntries = [];
|
|
47
|
-
var queryWithoutCurrentFilter = queryBuilder.removeQuery({
|
|
47
|
+
var queryWithoutCurrentFilter = queryBuilder.removeQuery({ groupKey: attributeKey }, (0, lodash_1.cloneDeep)(query));
|
|
48
48
|
var currentFilteredData = (0, queryData_1.queryData)(modelData, queryWithoutCurrentFilter, false, modelIndexMap);
|
|
49
49
|
var remoteModelDataKeys = remoteModelData ? __spreadArray([], __read(remoteModelData === null || remoteModelData === void 0 ? void 0 : remoteModelData.keys()), false) : [];
|
|
50
50
|
var validFacetKeys = new Set(remoteModelDataKeys);
|
|
@@ -123,10 +123,10 @@ function getFacets(modelData, remoteModelData, options, query, attributeKey, mod
|
|
|
123
123
|
}
|
|
124
124
|
exports.getFacets = getFacets;
|
|
125
125
|
var isFilterItemEntrySelected = function (groupKey, facetKey, query) {
|
|
126
|
-
var idx = query.
|
|
126
|
+
var idx = query.queries.findIndex(function (query) { return queryBuilder.isQueryGroup(query) && query.groupKey === groupKey; });
|
|
127
127
|
if (idx > -1) {
|
|
128
|
-
var queryGroup = query.
|
|
129
|
-
return !!queryGroup.
|
|
128
|
+
var queryGroup = query.queries[idx];
|
|
129
|
+
return !!queryGroup.queries.find(function (query) {
|
|
130
130
|
var _a;
|
|
131
131
|
if (queryBuilder.isQuery(query)) {
|
|
132
132
|
var key = ((_a = query.value) === null || _a === void 0 ? void 0 : _a.key) || query.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFacets.js","sourceRoot":"","sources":["../../src/getFacets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,yCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"getFacets.js","sourceRoot":"","sources":["../../src/getFacets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,yCAAwC;AACxC,iDAAoD;AACpD,iCAAmC;AAEnC,IAAM,YAAY,GAAG,IAAI,iCAAiB,EAAE,CAAC;AAE7C,SAAgB,SAAS,CACvB,SAAgC,EAChC,eAAsC,EACtC,OAA2B,EAC3B,KAAsC,EACtC,YAAoB,EACpB,aAAuC;;IAEvC,IAAM,iBAAiB,GAAsB,EAAE,CAAC;IAEhD,IAAM,yBAAyB,GAAG,YAAY,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,IAAA,kBAAS,EAAC,KAAK,CAAC,CAAC,CAAC;IAEzG,IAAM,mBAAmB,GAAG,IAAA,qBAAS,EACnC,SAAS,EACT,yBAAuD,EACvD,KAAK,EACL,aAAa,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,CAAC,OAAO,CAAC,IAAI,CAAC,UAAC,KAAK;;YACrC,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC/B,IAAM,GAAG,GAAG,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,GAAG,KAAI,KAAK,CAAC,KAAK,CAAC;gBAC5C,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,IAAI,GAAG,KAAK,QAAQ,CAAC;aACzD;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { DcuplGlobalQueryOptionsNew, DcuplItemsOptions, DcuplQuery, DcuplQueryGroup } from './types';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class DcuplQueryBuilder {
|
|
3
3
|
private _defaultQueryOptions;
|
|
4
4
|
private _initOptions;
|
|
5
|
-
private
|
|
5
|
+
private currentQuery;
|
|
6
6
|
constructor();
|
|
7
7
|
init(options: {
|
|
8
|
-
|
|
8
|
+
modelKey: string;
|
|
9
9
|
}): void;
|
|
10
|
-
reset():
|
|
10
|
+
reset(): DcuplGlobalQueryOptionsNew<any>;
|
|
11
11
|
isQuery(query: Partial<DcuplQuery> | Partial<DcuplQueryGroup>): query is DcuplQuery;
|
|
12
12
|
isQueryGroup(query: Partial<DcuplQuery> | Partial<DcuplQueryGroup>): query is DcuplQueryGroup;
|
|
13
|
-
isRootQueryGroup(
|
|
14
|
-
getQueryGroup(
|
|
13
|
+
isRootQueryGroup(groupOrQuery: Partial<DcuplGlobalQueryOptionsNew<any>> | Partial<DcuplQuery> | Partial<DcuplQueryGroup>): groupOrQuery is DcuplGlobalQueryOptionsNew<any>;
|
|
14
|
+
getQueryGroup(groupKey?: string): DcuplQueryGroup | undefined;
|
|
15
15
|
getQuery(): DcuplGlobalQueryOptionsNew<any>;
|
|
16
|
-
hasQueryGroup(
|
|
17
|
-
|
|
18
|
-
applyQuery(queryToApply: DcuplQueryGroup | DcuplQuery | DcuplQuery[] | DcuplQueryGroup[], options?: {
|
|
16
|
+
hasQueryGroup(groupKey: string): boolean;
|
|
17
|
+
applyOptions(options: DcuplItemsOptions<any>, mode?: 'set' | 'update'): DcuplGlobalQueryOptionsNew<any>;
|
|
18
|
+
applyQuery(queryToApply: DcuplGlobalQueryOptionsNew<any> | DcuplQueryGroup | DcuplQuery | DcuplQuery[] | DcuplQueryGroup[], options?: {
|
|
19
19
|
mode?: 'set' | 'add';
|
|
20
20
|
}, relevantQuery?: DcuplGlobalQueryOptionsNew<any>): DcuplGlobalQueryOptionsNew<any>;
|
|
21
|
+
removeAllQueries(): DcuplGlobalQueryOptionsNew<any>;
|
|
21
22
|
removeQuery(queryToRemove: Partial<DcuplQueryGroup> | DcuplQuery, relevantQuery?: DcuplGlobalQueryOptionsNew<any>): DcuplGlobalQueryOptionsNew<any>;
|
|
22
23
|
}
|
|
@@ -36,67 +36,76 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
36
36
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.DcuplQueryBuilder = void 0;
|
|
40
40
|
var lodash_1 = require("lodash");
|
|
41
|
-
var
|
|
42
|
-
function
|
|
41
|
+
var DcuplQueryBuilder = /** @class */ (function () {
|
|
42
|
+
function DcuplQueryBuilder() {
|
|
43
43
|
this._defaultQueryOptions = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
modelKey: '',
|
|
45
|
+
groupKey: 'root',
|
|
46
|
+
groupType: 'and',
|
|
47
|
+
queries: [],
|
|
48
48
|
};
|
|
49
|
-
this.
|
|
49
|
+
this.currentQuery = (0, lodash_1.cloneDeep)(this._defaultQueryOptions);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
DcuplQueryBuilder.prototype.init = function (options) {
|
|
52
52
|
this._initOptions = (0, lodash_1.cloneDeep)(options);
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
53
|
+
this.currentQuery = (0, lodash_1.cloneDeep)(this._defaultQueryOptions);
|
|
54
|
+
this.currentQuery.modelKey = options.modelKey;
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
DcuplQueryBuilder.prototype.reset = function () {
|
|
57
57
|
this.init(this._initOptions);
|
|
58
|
+
return this.getQuery();
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
+
DcuplQueryBuilder.prototype.isQuery = function (query) {
|
|
60
61
|
return 'attribute' in query;
|
|
61
62
|
};
|
|
62
|
-
|
|
63
|
-
return '
|
|
63
|
+
DcuplQueryBuilder.prototype.isQueryGroup = function (query) {
|
|
64
|
+
return 'groupKey' in query;
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
-
return
|
|
66
|
+
DcuplQueryBuilder.prototype.isRootQueryGroup = function (groupOrQuery) {
|
|
67
|
+
return this.isQueryGroup(groupOrQuery) && groupOrQuery.groupKey === 'root';
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
+
DcuplQueryBuilder.prototype.getQueryGroup = function (groupKey) {
|
|
69
70
|
var _this = this;
|
|
70
|
-
return this.
|
|
71
|
+
return this.currentQuery.queries.find(function (q) { return _this.isQueryGroup(q) && q.groupKey === groupKey; });
|
|
71
72
|
};
|
|
72
|
-
|
|
73
|
-
return (0, lodash_1.cloneDeep)(this.
|
|
73
|
+
DcuplQueryBuilder.prototype.getQuery = function () {
|
|
74
|
+
return (0, lodash_1.cloneDeep)(this.currentQuery);
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
DcuplQueryBuilder.prototype.hasQueryGroup = function (groupKey) {
|
|
76
77
|
var _this = this;
|
|
77
|
-
return this.
|
|
78
|
+
return this.currentQuery.queries.some(function (query) { return _this.isQueryGroup(query) && query.groupKey === groupKey; });
|
|
78
79
|
};
|
|
79
|
-
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
if (typeof (options === null || options === void 0 ? void 0 : options.start) !== 'undefined') {
|
|
87
|
-
this.queryOptions.start = options === null || options === void 0 ? void 0 : options.start;
|
|
80
|
+
DcuplQueryBuilder.prototype.applyOptions = function (options, mode) {
|
|
81
|
+
if (mode === void 0) { mode = 'update'; }
|
|
82
|
+
if (mode === 'set') {
|
|
83
|
+
this.currentQuery.count = options.count;
|
|
84
|
+
this.currentQuery.start = options.start;
|
|
85
|
+
this.currentQuery.sort = options.sort;
|
|
86
|
+
this.currentQuery.projection = options.projection;
|
|
88
87
|
}
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
else {
|
|
89
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.sort) !== 'undefined') {
|
|
90
|
+
this.currentQuery.sort = options.sort;
|
|
91
|
+
}
|
|
92
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.count) !== 'undefined') {
|
|
93
|
+
this.currentQuery.count = options.count;
|
|
94
|
+
}
|
|
95
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.start) !== 'undefined') {
|
|
96
|
+
this.currentQuery.start = options === null || options === void 0 ? void 0 : options.start;
|
|
97
|
+
}
|
|
98
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.projection) !== 'undefined') {
|
|
99
|
+
this.currentQuery.projection = options === null || options === void 0 ? void 0 : options.projection;
|
|
100
|
+
}
|
|
91
101
|
}
|
|
92
102
|
return this.getQuery();
|
|
93
103
|
};
|
|
94
|
-
|
|
95
|
-
// handle default query
|
|
104
|
+
DcuplQueryBuilder.prototype.applyQuery = function (queryToApply, options, relevantQuery) {
|
|
96
105
|
var e_1, _a;
|
|
97
106
|
var _this = this;
|
|
98
107
|
if (!relevantQuery)
|
|
99
|
-
relevantQuery = this.
|
|
108
|
+
relevantQuery = this.currentQuery;
|
|
100
109
|
if (Array.isArray(queryToApply)) {
|
|
101
110
|
try {
|
|
102
111
|
for (var queryToApply_1 = __values(queryToApply), queryToApply_1_1 = queryToApply_1.next(); !queryToApply_1_1.done; queryToApply_1_1 = queryToApply_1.next()) {
|
|
@@ -112,99 +121,101 @@ var QueryBuilder = /** @class */ (function () {
|
|
|
112
121
|
finally { if (e_1) throw e_1.error; }
|
|
113
122
|
}
|
|
114
123
|
}
|
|
124
|
+
else if (this.isRootQueryGroup(queryToApply)) {
|
|
125
|
+
if (queryToApply.groupType)
|
|
126
|
+
relevantQuery.groupType = queryToApply.groupType;
|
|
127
|
+
if (queryToApply.options)
|
|
128
|
+
relevantQuery.options = queryToApply.options;
|
|
129
|
+
if ((options === null || options === void 0 ? void 0 : options.mode) === 'set') {
|
|
130
|
+
relevantQuery.queries = queryToApply.queries;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
relevantQuery.queries = __spreadArray(__spreadArray([], __read(relevantQuery.queries), false), __read(queryToApply.queries), false);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
115
136
|
else if (this.isQuery(queryToApply)) {
|
|
116
|
-
var idx = relevantQuery.
|
|
137
|
+
var idx = relevantQuery.queries.findIndex(function (query) { return _this.isQueryGroup(query) && query.groupKey === queryToApply.attribute; });
|
|
117
138
|
if (idx > -1) {
|
|
118
|
-
var queryGroup = relevantQuery.
|
|
139
|
+
var queryGroup = relevantQuery.queries[idx];
|
|
119
140
|
if ((options === null || options === void 0 ? void 0 : options.mode) === 'set') {
|
|
120
|
-
queryGroup.
|
|
141
|
+
queryGroup.queries = [queryToApply];
|
|
121
142
|
}
|
|
122
143
|
else {
|
|
123
|
-
queryGroup.
|
|
144
|
+
queryGroup.queries.push(queryToApply);
|
|
124
145
|
}
|
|
125
146
|
}
|
|
126
147
|
else {
|
|
127
|
-
relevantQuery.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
148
|
+
relevantQuery.queries.push({
|
|
149
|
+
groupKey: queryToApply.attribute,
|
|
150
|
+
groupType: 'or',
|
|
151
|
+
queries: [queryToApply],
|
|
131
152
|
});
|
|
132
153
|
}
|
|
133
154
|
// handle query group
|
|
134
155
|
}
|
|
135
156
|
else if (this.isQueryGroup(queryToApply)) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
157
|
+
var idx = relevantQuery.queries.findIndex(function (query) { return _this.isQueryGroup(query) && query.groupKey === queryToApply.groupKey; });
|
|
158
|
+
if (idx > -1) {
|
|
159
|
+
var queryGroup = relevantQuery.queries[idx];
|
|
160
|
+
if (queryToApply.groupType)
|
|
161
|
+
queryGroup.groupType = queryToApply.groupType;
|
|
139
162
|
if (queryToApply.options)
|
|
140
|
-
|
|
163
|
+
queryGroup.options = queryToApply.options;
|
|
141
164
|
if ((options === null || options === void 0 ? void 0 : options.mode) === 'set') {
|
|
142
|
-
relevantQuery.
|
|
165
|
+
relevantQuery.queries[idx] = queryToApply;
|
|
143
166
|
}
|
|
144
167
|
else {
|
|
145
|
-
|
|
168
|
+
queryGroup.queries = __spreadArray(__spreadArray([], __read(queryGroup.queries), false), __read(queryToApply.queries), false);
|
|
146
169
|
}
|
|
147
170
|
}
|
|
148
171
|
else {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
queryGroup.options = queryToApply.options;
|
|
156
|
-
if ((options === null || options === void 0 ? void 0 : options.mode) === 'set') {
|
|
157
|
-
relevantQuery.query[idx] = queryToApply;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
queryGroup.query = __spreadArray(__spreadArray([], __read(queryGroup.query), false), __read(queryToApply.query), false);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
relevantQuery.query.push({
|
|
165
|
-
queryKey: queryToApply.queryKey,
|
|
166
|
-
queryType: queryToApply.queryType || 'or',
|
|
167
|
-
query: queryToApply.query,
|
|
168
|
-
options: queryToApply.options,
|
|
169
|
-
});
|
|
170
|
-
}
|
|
172
|
+
relevantQuery.queries.push({
|
|
173
|
+
groupKey: queryToApply.groupKey,
|
|
174
|
+
groupType: queryToApply.groupType || 'or',
|
|
175
|
+
queries: queryToApply.queries,
|
|
176
|
+
options: queryToApply.options,
|
|
177
|
+
});
|
|
171
178
|
}
|
|
172
179
|
}
|
|
173
180
|
return relevantQuery;
|
|
174
181
|
};
|
|
175
|
-
|
|
182
|
+
DcuplQueryBuilder.prototype.removeAllQueries = function () {
|
|
183
|
+
this.currentQuery.queries = [];
|
|
184
|
+
return this.getQuery();
|
|
185
|
+
};
|
|
186
|
+
DcuplQueryBuilder.prototype.removeQuery = function (queryToRemove, relevantQuery) {
|
|
176
187
|
// handle default query
|
|
177
188
|
var e_2, _a;
|
|
178
189
|
var _this = this;
|
|
179
190
|
if (!relevantQuery)
|
|
180
|
-
relevantQuery = this.
|
|
191
|
+
relevantQuery = this.currentQuery;
|
|
181
192
|
if (this.isQuery(queryToRemove)) {
|
|
182
|
-
var idx = relevantQuery.
|
|
193
|
+
var idx = relevantQuery.queries.findIndex(function (query) { return _this.isQueryGroup(query) && query.groupKey === queryToRemove.attribute; });
|
|
183
194
|
if (idx > -1) {
|
|
184
|
-
var queryGroup = relevantQuery.
|
|
185
|
-
var idxOfQueryToRemove = (0, lodash_1.findIndex)(queryGroup.
|
|
195
|
+
var queryGroup = relevantQuery.queries[idx];
|
|
196
|
+
var idxOfQueryToRemove = (0, lodash_1.findIndex)(queryGroup.queries, queryToRemove);
|
|
186
197
|
if (idxOfQueryToRemove > -1) {
|
|
187
|
-
queryGroup.
|
|
198
|
+
queryGroup.queries.splice(idxOfQueryToRemove, 1);
|
|
188
199
|
}
|
|
189
|
-
if (queryGroup.
|
|
190
|
-
relevantQuery.
|
|
200
|
+
if (queryGroup.queries.length === 0) {
|
|
201
|
+
relevantQuery.queries.splice(idx, 1);
|
|
191
202
|
}
|
|
192
203
|
}
|
|
193
204
|
}
|
|
194
205
|
else if (this.isQueryGroup(queryToRemove)) {
|
|
195
|
-
var idx = relevantQuery.
|
|
206
|
+
var idx = relevantQuery.queries.findIndex(function (query) { return _this.isQueryGroup(query) && query.groupKey === queryToRemove.groupKey; });
|
|
196
207
|
if (idx > -1) {
|
|
197
|
-
if (!queryToRemove.
|
|
198
|
-
relevantQuery.
|
|
208
|
+
if (!queryToRemove.queries) {
|
|
209
|
+
relevantQuery.queries.splice(idx, 1);
|
|
199
210
|
}
|
|
200
211
|
else {
|
|
201
|
-
var queryGroup = relevantQuery.
|
|
212
|
+
var queryGroup = relevantQuery.queries[idx];
|
|
202
213
|
try {
|
|
203
|
-
for (var _b = __values(queryToRemove.
|
|
214
|
+
for (var _b = __values(queryToRemove.queries), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
204
215
|
var q = _c.value;
|
|
205
|
-
var idxOfQueryToRemove = (0, lodash_1.findIndex)(queryGroup.
|
|
216
|
+
var idxOfQueryToRemove = (0, lodash_1.findIndex)(queryGroup.queries, q);
|
|
206
217
|
if (idxOfQueryToRemove > -1) {
|
|
207
|
-
queryGroup.
|
|
218
|
+
queryGroup.queries.splice(idxOfQueryToRemove, 1);
|
|
208
219
|
}
|
|
209
220
|
}
|
|
210
221
|
}
|
|
@@ -215,15 +226,15 @@ var QueryBuilder = /** @class */ (function () {
|
|
|
215
226
|
}
|
|
216
227
|
finally { if (e_2) throw e_2.error; }
|
|
217
228
|
}
|
|
218
|
-
if (queryGroup.
|
|
219
|
-
relevantQuery.
|
|
229
|
+
if (queryGroup.queries.length === 0) {
|
|
230
|
+
relevantQuery.queries.splice(idx, 1);
|
|
220
231
|
}
|
|
221
232
|
}
|
|
222
233
|
}
|
|
223
234
|
}
|
|
224
235
|
return relevantQuery;
|
|
225
236
|
};
|
|
226
|
-
return
|
|
237
|
+
return DcuplQueryBuilder;
|
|
227
238
|
}());
|
|
228
|
-
exports.
|
|
239
|
+
exports.DcuplQueryBuilder = DcuplQueryBuilder;
|
|
229
240
|
//# sourceMappingURL=query-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-builder.js","sourceRoot":"","sources":["../../src/query-builder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8C;AAG9C;IAUE;QATQ,yBAAoB,GAAoC;YAC9D,
|
|
1
|
+
{"version":3,"file":"query-builder.js","sourceRoot":"","sources":["../../src/query-builder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8C;AAG9C;IAUE;QATQ,yBAAoB,GAAoC;YAC9D,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,EAAE;SACZ,CAAC;QAEM,iBAAY,GAAoC,IAAA,kBAAS,EAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAE9E,CAAC;IAET,gCAAI,GAAX,UAAY,OAA6B;QACvC,IAAI,CAAC,YAAY,GAAG,IAAA,kBAAS,EAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACzD,IAAI,CAAC,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAChD,CAAC;IAEM,iCAAK,GAAZ;QACE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAEM,mCAAO,GAAd,UAAe,KAAqD;QAClE,OAAO,WAAW,IAAI,KAAK,CAAC;IAC9B,CAAC;IACM,wCAAY,GAAnB,UAAoB,KAAqD;QACvE,OAAO,UAAU,IAAI,KAAK,CAAC;IAC7B,CAAC;IAEM,4CAAgB,GAAvB,UACE,YAAuG;QAEvG,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,QAAQ,KAAK,MAAM,CAAC;IA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