eservices-core 1.0.446 → 1.0.447
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/index.js +12 -4
- package/dist/utils/Filter.d.ts +4 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.447
|
|
3
3
|
* (c) 2022 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -2455,7 +2455,6 @@ class List$2 extends EventEmitter {
|
|
|
2455
2455
|
options.filter = ReadParams.filter;
|
|
2456
2456
|
const newHash = JSON.stringify(options.order) + JSON.stringify(options.filter);
|
|
2457
2457
|
if (newHash !== this.hashParams) {
|
|
2458
|
-
console.log(newHash, this.hashParams, 'cleanoffset');
|
|
2459
2458
|
this.offset = 0;
|
|
2460
2459
|
this.hashParams = newHash;
|
|
2461
2460
|
}
|
|
@@ -2468,7 +2467,6 @@ class List$2 extends EventEmitter {
|
|
|
2468
2467
|
if (this.offset === 0)
|
|
2469
2468
|
this.array = [];
|
|
2470
2469
|
this.offset += options.limit;
|
|
2471
|
-
console.log('Up offset', this.offset, options.limit);
|
|
2472
2470
|
return v;
|
|
2473
2471
|
})
|
|
2474
2472
|
.then(v => {
|
|
@@ -4908,7 +4906,17 @@ function Filter(filters) {
|
|
|
4908
4906
|
return arrayFilter;
|
|
4909
4907
|
}
|
|
4910
4908
|
// Date
|
|
4911
|
-
if (instanceOfDate(values))
|
|
4909
|
+
if (instanceOfDate(values)) {
|
|
4910
|
+
function parseDate(data) {
|
|
4911
|
+
var _a;
|
|
4912
|
+
return ((_a = data.match(/([^Z]*)/)) === null || _a === void 0 ? void 0 : _a[0]) + '0000Z';
|
|
4913
|
+
}
|
|
4914
|
+
if (values.start)
|
|
4915
|
+
arrayFilter.push(`@${name} ge ${parseDate(values.start)}`);
|
|
4916
|
+
if (values.end)
|
|
4917
|
+
arrayFilter.push(`@${name} le ${parseDate(values.end)}`);
|
|
4918
|
+
return arrayFilter;
|
|
4919
|
+
}
|
|
4912
4920
|
// String
|
|
4913
4921
|
if (typeof values === 'string') {
|
|
4914
4922
|
if (values.length !== 0)
|
package/dist/utils/Filter.d.ts
CHANGED
|
@@ -5,13 +5,10 @@ interface IFilters {
|
|
|
5
5
|
* @description Generate filter's string by provided input data.
|
|
6
6
|
* */
|
|
7
7
|
export default function Filter(filters: IFilters): string;
|
|
8
|
-
interface IFilterDateStart {
|
|
9
|
-
start: string;
|
|
10
|
-
}
|
|
11
|
-
interface IFilterDateEnd {
|
|
12
|
-
end: string;
|
|
13
|
-
}
|
|
14
8
|
export declare type IFilterString = string;
|
|
15
9
|
export declare type IFilterEnum = Array<number | string>;
|
|
16
|
-
export declare type IFilterDate =
|
|
10
|
+
export declare type IFilterDate = {
|
|
11
|
+
start?: string;
|
|
12
|
+
end?: string;
|
|
13
|
+
};
|
|
17
14
|
export {};
|