@onivoro/server-typeorm-postgres 0.1.8 → 0.1.9
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/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/functions/generate-date-query.function.d.ts +2 -0
- package/src/lib/functions/generate-date-query.function.js +18 -0
- package/src/lib/functions/generate-date-query.function.js.map +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './lib/decorators/table-column.decorator';
|
|
|
10
10
|
export * from './lib/decorators/table.decorator';
|
|
11
11
|
export * from './lib/functions/data-source-config-factory.function';
|
|
12
12
|
export * from './lib/functions/data-source-factory.function';
|
|
13
|
+
export * from './lib/functions/generate-date-query.function';
|
|
13
14
|
export * from './lib/functions/get-api-type-from-column.function';
|
|
14
15
|
export * from './lib/functions/get-paging-key.function';
|
|
15
16
|
export * from './lib/functions/get-skip.function';
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ tslib_1.__exportStar(require("./lib/decorators/table-column.decorator"), exports
|
|
|
13
13
|
tslib_1.__exportStar(require("./lib/decorators/table.decorator"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./lib/functions/data-source-config-factory.function"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./lib/functions/data-source-factory.function"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./lib/functions/generate-date-query.function"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./lib/functions/get-api-type-from-column.function"), exports);
|
|
17
18
|
tslib_1.__exportStar(require("./lib/functions/get-paging-key.function"), exports);
|
|
18
19
|
tslib_1.__exportStar(require("./lib/functions/get-skip.function"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/server-typeorm-postgres/src/index.ts"],"names":[],"mappings":";;;AAAA,oFAA0D;AAC1D,qFAA2D;AAC3D,yFAA+D;AAC/D,mFAAyD;AACzD,yEAA+C;AAC/C,kFAAwD;AAExD,2FAAiE;AACjE,0FAAgE;AAChE,kFAAwD;AACxD,2EAAiD;AAEjD,8FAAoE;AACpE,uFAA6D;AAC7D,4FAAkE;AAClE,kFAAwD;AACxD,4EAAkD;AAClD,sFAA4D;AAE5D,oFAA0D;AAC1D,gFAAsD;AAEtD,+EAAqD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/server-typeorm-postgres/src/index.ts"],"names":[],"mappings":";;;AAAA,oFAA0D;AAC1D,qFAA2D;AAC3D,yFAA+D;AAC/D,mFAAyD;AACzD,yEAA+C;AAC/C,kFAAwD;AAExD,2FAAiE;AACjE,0FAAgE;AAChE,kFAAwD;AACxD,2EAAiD;AAEjD,8FAAoE;AACpE,uFAA6D;AAC7D,uFAA6D;AAC7D,4FAAkE;AAClE,kFAAwD;AACxD,4EAAkD;AAClD,sFAA4D;AAE5D,oFAA0D;AAC1D,gFAAsD;AAEtD,+EAAqD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateDateQuery = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
function generateDateQuery(minDueDate, maxDueDate) {
|
|
6
|
+
if (minDueDate && maxDueDate) {
|
|
7
|
+
return (0, typeorm_1.Between)(minDueDate, maxDueDate);
|
|
8
|
+
}
|
|
9
|
+
if (maxDueDate) {
|
|
10
|
+
return (0, typeorm_1.LessThanOrEqual)(new Date(maxDueDate));
|
|
11
|
+
}
|
|
12
|
+
if (minDueDate) {
|
|
13
|
+
return (0, typeorm_1.MoreThanOrEqual)(new Date(minDueDate));
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
exports.generateDateQuery = generateDateQuery;
|
|
18
|
+
//# sourceMappingURL=generate-date-query.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-date-query.function.js","sourceRoot":"","sources":["../../../../../../libs/server-typeorm-postgres/src/lib/functions/generate-date-query.function.ts"],"names":[],"mappings":";;;AAAA,qCAAkF;AAElF,SAAgB,iBAAiB,CAC7B,UAAkB,EAClB,UAAkB;IAElB,IAAI,UAAU,IAAI,UAAU,EAAE;QAC1B,OAAO,IAAA,iBAAO,EAAC,UAAiB,EAAE,UAAiB,CAAC,CAAC;KACxD;IAED,IAAI,UAAU,EAAE;QACZ,OAAO,IAAA,yBAAe,EAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;KAChD;IAED,IAAI,UAAU,EAAE;QACZ,OAAO,IAAA,yBAAe,EAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;KAChD;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAjBD,8CAiBC"}
|