c2-mongoose 2.1.196 → 2.1.198
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/flow/SearchFlow.js +2 -2
- package/dist/utils/Utils.d.ts +2 -1
- package/dist/utils/Utils.js +5 -1
- package/package.json +1 -1
- package/src/flow/SearchFlow.ts +2 -2
- package/src/utils/Utils.ts +5 -2
package/dist/flow/SearchFlow.js
CHANGED
|
@@ -483,14 +483,14 @@ var SearchFlow = /** @class */ (function () {
|
|
|
483
483
|
momentValue.hour(0);
|
|
484
484
|
momentValue.minute(0);
|
|
485
485
|
momentValue.second(0);
|
|
486
|
-
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.tz('America/Sao_Paulo',
|
|
486
|
+
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $gte: momentValue.tz('America/Sao_Paulo', true).toDate() });
|
|
487
487
|
}
|
|
488
488
|
if ((0, Utils_1.isNotEmpty)(values[1])) {
|
|
489
489
|
var momentValue = (0, moment_timezone_1.default)(values[1]);
|
|
490
490
|
momentValue.hour(23);
|
|
491
491
|
momentValue.minute(59);
|
|
492
492
|
momentValue.second(59);
|
|
493
|
-
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.tz('America/Sao_Paulo',
|
|
493
|
+
condition[fieldName] = __assign(__assign({}, condition[fieldName]), { $lte: momentValue.tz('America/Sao_Paulo', true).toDate() });
|
|
494
494
|
}
|
|
495
495
|
filters.$and.push(condition);
|
|
496
496
|
}
|
package/dist/utils/Utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Connection } from "mongoose";
|
|
1
|
+
import mongoose, { Connection } from "mongoose";
|
|
2
2
|
export declare const initialize: (connection: Connection) => void;
|
|
3
|
+
export declare const getLoggerRepository: () => mongoose.Model<any>;
|
|
3
4
|
export declare const isNotEmpty: (obj: any) => boolean;
|
|
4
5
|
export declare const isEmpty: (obj: any) => boolean;
|
|
5
6
|
export declare const isIterable: (input: any) => boolean;
|
package/dist/utils/Utils.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compareDesc = exports.compareAsc = exports.isNotIterable = exports.isIterable = exports.isEmpty = exports.isNotEmpty = exports.initialize = void 0;
|
|
3
|
+
exports.compareDesc = exports.compareAsc = exports.isNotIterable = exports.isIterable = exports.isEmpty = exports.isNotEmpty = exports.getLoggerRepository = exports.initialize = void 0;
|
|
4
4
|
var Logger_1 = require("../model/Logger");
|
|
5
5
|
var initialize = function (connection) {
|
|
6
6
|
global.LoggerRepository = connection.model('c2-mongoose-logger', Logger_1.LoggerModel);
|
|
7
7
|
};
|
|
8
8
|
exports.initialize = initialize;
|
|
9
|
+
var getLoggerRepository = function () {
|
|
10
|
+
return global.LoggerRepository;
|
|
11
|
+
};
|
|
12
|
+
exports.getLoggerRepository = getLoggerRepository;
|
|
9
13
|
var isNotEmpty = function (obj) {
|
|
10
14
|
return !(0, exports.isEmpty)(obj);
|
|
11
15
|
};
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -429,7 +429,7 @@ abstract class SearchFlow {
|
|
|
429
429
|
momentValue.second(0)
|
|
430
430
|
condition[fieldName] = {
|
|
431
431
|
...condition[fieldName],
|
|
432
|
-
$gte: momentValue.tz('America/Sao_Paulo',
|
|
432
|
+
$gte: momentValue.tz('America/Sao_Paulo', true).toDate()
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
@@ -440,7 +440,7 @@ abstract class SearchFlow {
|
|
|
440
440
|
momentValue.second(59)
|
|
441
441
|
condition[fieldName] = {
|
|
442
442
|
...condition[fieldName],
|
|
443
|
-
$lte: momentValue.tz('America/Sao_Paulo',
|
|
443
|
+
$lte: momentValue.tz('America/Sao_Paulo', true).toDate()
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
filters.$and.push(condition)
|
package/src/utils/Utils.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { Connection } from "mongoose"
|
|
1
|
+
import mongoose, { Connection } from "mongoose"
|
|
2
2
|
import { LoggerModel } from "../model/Logger"
|
|
3
3
|
|
|
4
4
|
export const initialize = (connection: Connection) => {
|
|
5
|
-
|
|
6
5
|
(global as any).LoggerRepository = connection.model('c2-mongoose-logger', LoggerModel)
|
|
7
6
|
}
|
|
8
7
|
|
|
8
|
+
export const getLoggerRepository = (): mongoose.Model<any> => {
|
|
9
|
+
return (global as any).LoggerRepository
|
|
10
|
+
}
|
|
11
|
+
|
|
9
12
|
export const isNotEmpty = (obj: any) => {
|
|
10
13
|
return !isEmpty(obj)
|
|
11
14
|
}
|