@bejibun/core 0.2.13 → 0.2.15
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 +29 -0
- package/bases/BaseModel.d.ts +6 -6
- package/bases/BaseModel.js +12 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
## [v0.2.15](https://github.com/Bejibun-Framework/bejibun-core/compare/v0.2.14...v0.2.15) - 2026-03-02
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
### 📖 Changes
|
|
11
|
+
#### Upgrade [@bejibun/cache](https://github.com/Bejibun-Framework/bejibun-cache) to v0.1.19
|
|
12
|
+
[https://github.com/Bejibun-Framework/bejibun-cache/releases/tag/v0.1.19](https://github.com/Bejibun-Framework/bejibun-cache/releases/tag/v0.1.19)
|
|
13
|
+
|
|
14
|
+
### ❤️Contributors
|
|
15
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
16
|
+
|
|
17
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-core/blob/master/CHANGELOG.md
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## [v0.2.14](https://github.com/Bejibun-Framework/bejibun-core/compare/v0.2.13...v0.2.14) - 2026-02-27
|
|
22
|
+
|
|
23
|
+
### 🩹 Fixes
|
|
24
|
+
|
|
25
|
+
### 📖 Changes
|
|
26
|
+
- Added support transaction for soft deletes
|
|
27
|
+
|
|
28
|
+
### ❤️Contributors
|
|
29
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
30
|
+
|
|
31
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-core/blob/master/CHANGELOG.md
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
6
35
|
## [v0.2.13](https://github.com/Bejibun-Framework/bejibun-core/compare/v0.2.12...v0.2.13) - 2026-02-24
|
|
7
36
|
|
|
8
37
|
### 🩹 Fixes
|
package/bases/BaseModel.d.ts
CHANGED
|
@@ -20,11 +20,11 @@ export default class BaseModel extends Model {
|
|
|
20
20
|
$beforeUpdate(opt: ModelOptions, queryContext: QueryContext): void;
|
|
21
21
|
static setNamespace(namespace: string): void;
|
|
22
22
|
static query<T extends Model>(this: Constructor<T>, trxOrKnex?: TransactionOrKnex): QueryBuilderType<T>;
|
|
23
|
-
static withTrashed<T extends Model>(this: T): QueryBuilderType<T>;
|
|
24
|
-
static onlyTrashed<T extends Model>(this: T): QueryBuilderType<T>;
|
|
25
|
-
static all<T extends Model>(this: T): QueryBuilderType<T>;
|
|
26
|
-
static create<T extends Model>(this: T, payload: Record<string, any
|
|
27
|
-
static find<T extends Model>(this: T, id: bigint | number | string): QueryBuilderType<T>;
|
|
28
|
-
static findOrFail<T extends Model>(this: T, id: bigint | number | string): Promise<T>;
|
|
23
|
+
static withTrashed<T extends Model>(this: T, trxOrKnex?: TransactionOrKnex): QueryBuilderType<T>;
|
|
24
|
+
static onlyTrashed<T extends Model>(this: T, trxOrKnex?: TransactionOrKnex): QueryBuilderType<T>;
|
|
25
|
+
static all<T extends Model>(this: T, trxOrKnex?: TransactionOrKnex): QueryBuilderType<T>;
|
|
26
|
+
static create<T extends Model>(this: T, payload: Record<string, any>, trxOrKnex?: TransactionOrKnex): QueryBuilderType<T>;
|
|
27
|
+
static find<T extends Model>(this: T, id: bigint | number | string, trxOrKnex?: TransactionOrKnex): QueryBuilderType<T>;
|
|
28
|
+
static findOrFail<T extends Model>(this: T, id: bigint | number | string, trxOrKnex?: TransactionOrKnex): Promise<T>;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
package/bases/BaseModel.js
CHANGED
|
@@ -50,23 +50,23 @@ export default class BaseModel extends Model {
|
|
|
50
50
|
return super.query(trxOrKnex);
|
|
51
51
|
}
|
|
52
52
|
;
|
|
53
|
-
static withTrashed() {
|
|
54
|
-
return this.query().withTrashed();
|
|
53
|
+
static withTrashed(trxOrKnex) {
|
|
54
|
+
return this.query(trxOrKnex).withTrashed();
|
|
55
55
|
}
|
|
56
|
-
static onlyTrashed() {
|
|
57
|
-
return this.query().onlyTrashed();
|
|
56
|
+
static onlyTrashed(trxOrKnex) {
|
|
57
|
+
return this.query(trxOrKnex).onlyTrashed();
|
|
58
58
|
}
|
|
59
|
-
static all() {
|
|
60
|
-
return this.query().select();
|
|
59
|
+
static all(trxOrKnex) {
|
|
60
|
+
return this.query(trxOrKnex).select();
|
|
61
61
|
}
|
|
62
|
-
static create(payload) {
|
|
63
|
-
return this.query().insert(payload);
|
|
62
|
+
static create(payload, trxOrKnex) {
|
|
63
|
+
return this.query(trxOrKnex).insert(payload);
|
|
64
64
|
}
|
|
65
|
-
static find(id) {
|
|
66
|
-
return this.query().findById(id);
|
|
65
|
+
static find(id, trxOrKnex) {
|
|
66
|
+
return this.query(trxOrKnex).findById(id);
|
|
67
67
|
}
|
|
68
|
-
static async findOrFail(id) {
|
|
69
|
-
const result = await this.
|
|
68
|
+
static async findOrFail(id, trxOrKnex) {
|
|
69
|
+
const result = await this.query(trxOrKnex).findById(id);
|
|
70
70
|
if (isEmpty(result))
|
|
71
71
|
throw new ModelNotFoundException(`No query results for model [${this.namespace}] [${id}].`);
|
|
72
72
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bejibun/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"author": "Havea Crenata <havea.crenata@gmail.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"module": "index.js",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@bejibun/app": "^0.1.23",
|
|
13
|
-
"@bejibun/cache": "^0.1.
|
|
13
|
+
"@bejibun/cache": "^0.1.19",
|
|
14
14
|
"@bejibun/cors": "^0.1.17",
|
|
15
15
|
"@bejibun/database": "^0.1.19",
|
|
16
16
|
"@bejibun/logger": "^0.1.22",
|