@mrxsys/mrx-core 2.12.0-1-and-288-20251203 → 2.12.0-2-and-288-20251203
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/CHANGELOG.md +0 -0
- package/dist/{chunk-s53cbgkb.js → chunk-47yta3gd.js} +6 -4
- package/dist/{chunk-kne89z1w.js → chunk-hnds0krm.js} +1 -1
- package/dist/modules/database/index.js +2 -2
- package/dist/modules/elysia/db-resolver/index.js +2 -2
- package/dist/modules/repository/index.js +1 -1
- package/dist/modules/repository/repository.d.ts +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
ADDED
|
File without changes
|
|
@@ -102,7 +102,8 @@ class Repository {
|
|
|
102
102
|
}
|
|
103
103
|
async count(options) {
|
|
104
104
|
const query = this._knex(this._table.name).count({ count: "*" });
|
|
105
|
-
|
|
105
|
+
if (options?.filters)
|
|
106
|
+
this._applyFilter(query, options?.filters);
|
|
106
107
|
if (options?.transaction)
|
|
107
108
|
query.transacting(options.transaction);
|
|
108
109
|
return this._executeQuery(query, options?.throwIfNoResult).then((result) => result[0].count);
|
|
@@ -161,9 +162,9 @@ class Repository {
|
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
|
-
if (
|
|
165
|
+
if (Array.isArray(search))
|
|
165
166
|
search.reduce((acc, item) => acc.orWhere((q) => this._applyFilter(q, item)), query);
|
|
166
|
-
else
|
|
167
|
+
else
|
|
167
168
|
processing(query, search);
|
|
168
169
|
}
|
|
169
170
|
_applyOrderBy(query, orderBy) {
|
|
@@ -180,7 +181,8 @@ class Repository {
|
|
|
180
181
|
query.orderBy(`[${this._table.name}].${orderBy.selectedField}`, orderBy.direction);
|
|
181
182
|
}
|
|
182
183
|
_applyQueryOptions(query, options) {
|
|
183
|
-
|
|
184
|
+
if (options?.filters)
|
|
185
|
+
this._applyFilter(query, options.filters);
|
|
184
186
|
this._applyOrderBy(query, options?.orderBy);
|
|
185
187
|
this._applySelectedFields(query, options?.selectedFields);
|
|
186
188
|
if (options?.transaction)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
MSSQL,
|
|
4
4
|
Table
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import"../../chunk-
|
|
5
|
+
} from "../../chunk-hnds0krm.js";
|
|
6
|
+
import"../../chunk-47yta3gd.js";
|
|
7
7
|
import"../../chunk-grfyngq0.js";
|
|
8
8
|
import"../../chunk-mvrxngm7.js";
|
|
9
9
|
import"../../chunk-zv4ta4fb.js";
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
} from "../../../chunk-ayyrgqyv.js";
|
|
9
9
|
import {
|
|
10
10
|
MSSQL
|
|
11
|
-
} from "../../../chunk-
|
|
12
|
-
import"../../../chunk-
|
|
11
|
+
} from "../../../chunk-hnds0krm.js";
|
|
12
|
+
import"../../../chunk-47yta3gd.js";
|
|
13
13
|
import"../../../chunk-grfyngq0.js";
|
|
14
14
|
import"../../../chunk-mvrxngm7.js";
|
|
15
15
|
import"../../../chunk-zv4ta4fb.js";
|
|
@@ -363,7 +363,7 @@ export declare class Repository<TModel = Record<string, unknown>> {
|
|
|
363
363
|
* @param query - The Knex.js query builder to apply the search criteria to.
|
|
364
364
|
* @param search - The advanced search criteria to apply. Can be a single object or an array of objects.
|
|
365
365
|
*/
|
|
366
|
-
protected _applyFilter<KModel>(query: Knex.QueryBuilder, search: Filter<KModel> | Filter<KModel>[]
|
|
366
|
+
protected _applyFilter<KModel>(query: Knex.QueryBuilder, search: Filter<KModel> | Filter<KModel>[]): void;
|
|
367
367
|
/**
|
|
368
368
|
* Applies order by criteria to a Knex.js query builder. This method supports both single and multiple order by items.
|
|
369
369
|
* It is used to specify the sorting order of the query results.
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrxsys/mrx-core",
|
|
3
|
-
"version": "2.12.0-
|
|
3
|
+
"version": "2.12.0-2-and-288-20251203",
|
|
4
4
|
"author": "Ruby",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@eslint/js": "^9.39.1",
|
|
7
7
|
"@sinclair/typebox": "0.34.41",
|
|
8
8
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
9
|
-
"@types/bun": "^1.3.
|
|
9
|
+
"@types/bun": "^1.3.4",
|
|
10
10
|
"@types/nodemailer": "^7.0.4",
|
|
11
|
-
"elysia": "1.4.
|
|
11
|
+
"elysia": "1.4.18",
|
|
12
12
|
"eslint": "^9.39.1",
|
|
13
13
|
"globals": "^16.5.0",
|
|
14
14
|
"ioredis": "^5.8.2",
|
|
15
|
-
"jose": "^6.1.
|
|
15
|
+
"jose": "^6.1.3",
|
|
16
16
|
"knex": "^3.1.0",
|
|
17
|
-
"mssql": "^12.
|
|
17
|
+
"mssql": "^12.2.0",
|
|
18
18
|
"nodemailer": "^7.0.11",
|
|
19
|
-
"typescript-eslint": "^8.
|
|
19
|
+
"typescript-eslint": "^8.49.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@sinclair/typebox": "0.34.41",
|
|
23
|
-
"elysia": "^1.4.
|
|
23
|
+
"elysia": "^1.4.18",
|
|
24
24
|
"ioredis": "^5.8.2",
|
|
25
|
-
"jose": "^6.1.
|
|
26
|
-
"mssql": "^12.
|
|
25
|
+
"jose": "^6.1.3",
|
|
26
|
+
"mssql": "^12.2.0",
|
|
27
27
|
"knex": "^3.1.0",
|
|
28
28
|
"nodemailer": "^7.0.11",
|
|
29
29
|
"typescript": "^5.9.3"
|