typeorm-extensions 1.2.5 → 1.2.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/README.md
CHANGED
|
@@ -35,7 +35,7 @@ const query = myDataSource
|
|
|
35
35
|
.createQueryBuilder()
|
|
36
36
|
.from(UserEntity, 'users')
|
|
37
37
|
// Join relation defined in entity model
|
|
38
|
-
.leftJoinTyped(user =>
|
|
38
|
+
.leftJoinTyped(user => user.profile, 'profile')
|
|
39
39
|
// Select type-safe properties
|
|
40
40
|
.selectTyped(user => ([
|
|
41
41
|
id: user.id,
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const SelectQueryBuilder_1 = require("typeorm/query-builder/SelectQueryBuilder");
|
|
4
4
|
const pagination_utils_1 = require("../utils/pagination.utils");
|
|
5
|
+
require("./pagination.extension");
|
|
5
6
|
SelectQueryBuilder_1.SelectQueryBuilder.prototype.getManyWithTotals = async function (paginationFilter, options) {
|
|
6
|
-
const { disableTotalsCalculation = false, loadAll = false } = options || {};
|
|
7
|
+
const { disableTotalsCalculation = false, loadAll = false, ...paginationOptions } = options || {};
|
|
7
8
|
const { limit, offset } = loadAll
|
|
8
9
|
? { limit: null, offset: null }
|
|
9
10
|
: (0, pagination_utils_1.getLimitAndOffset)(paginationFilter);
|
|
@@ -18,12 +19,12 @@ SelectQueryBuilder_1.SelectQueryBuilder.prototype.getManyWithTotals = async func
|
|
|
18
19
|
requests[1] = this.getMany();
|
|
19
20
|
}
|
|
20
21
|
else {
|
|
21
|
-
requests[1] = this.applyPaginationFilter(paginationFilter).getMany();
|
|
22
|
+
requests[1] = this.applyPaginationFilter(paginationFilter, paginationOptions).getMany();
|
|
22
23
|
}
|
|
23
24
|
const [totalCount, list] = (await Promise.all(requests));
|
|
24
25
|
return {
|
|
25
26
|
list,
|
|
26
|
-
totalCount
|
|
27
|
+
totalCount,
|
|
27
28
|
limit,
|
|
28
29
|
offset,
|
|
29
30
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typeorm-extensions",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "typeorm commonly used extensions",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": ["dist", "LICENSE", "README.md", "package.json"],
|
|
8
8
|
"type": "module",
|
|
9
|
+
"homepage": "https://koenigstag.github.io/typeorm-extensions/",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "https://github.com/koenigstag/typeorm-extensions.git"
|