@bejibun/core 0.1.71 → 0.1.72
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 +14 -0
- package/builders/ResponseBuilder.d.ts +2 -0
- package/builders/ResponseBuilder.js +8 -1
- package/facades/Response.d.ts +1 -0
- package/facades/Response.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
## [v0.1.72](https://github.com/Bejibun-Framework/bejibun-core/compare/v0.1.71...v0.1.72) - 2026-01-29
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
### 📖 Changes
|
|
11
|
+
- Added `setCustom(custom?: Record<string, any>)` on Response builder.
|
|
12
|
+
|
|
13
|
+
### ❤️Contributors
|
|
14
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
15
|
+
|
|
16
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-core/blob/master/CHANGELOG.md
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
6
20
|
## [v0.1.71](https://github.com/Bejibun-Framework/bejibun-core/compare/v0.1.70...v0.1.71) - 2026-01-29
|
|
7
21
|
|
|
8
22
|
### 🩹 Fixes
|
|
@@ -2,10 +2,12 @@ export default class ResponseBuilder {
|
|
|
2
2
|
protected data?: any;
|
|
3
3
|
protected message: string;
|
|
4
4
|
protected status: number;
|
|
5
|
+
protected custom?: Record<string, any>;
|
|
5
6
|
constructor();
|
|
6
7
|
setData(data?: any): ResponseBuilder;
|
|
7
8
|
setMessage(message: string): ResponseBuilder;
|
|
8
9
|
setStatus(status: number): ResponseBuilder;
|
|
10
|
+
setCustom(custom?: Record<string, any>): ResponseBuilder;
|
|
9
11
|
send(): globalThis.Response;
|
|
10
12
|
stream(options?: ResponseInit): globalThis.Response;
|
|
11
13
|
}
|
|
@@ -3,10 +3,12 @@ export default class ResponseBuilder {
|
|
|
3
3
|
data;
|
|
4
4
|
message;
|
|
5
5
|
status;
|
|
6
|
+
custom;
|
|
6
7
|
constructor() {
|
|
7
8
|
this.data = null;
|
|
8
9
|
this.message = "Success";
|
|
9
10
|
this.status = 200;
|
|
11
|
+
this.custom = {};
|
|
10
12
|
}
|
|
11
13
|
setData(data) {
|
|
12
14
|
this.data = data;
|
|
@@ -20,11 +22,16 @@ export default class ResponseBuilder {
|
|
|
20
22
|
this.status = status;
|
|
21
23
|
return this;
|
|
22
24
|
}
|
|
25
|
+
setCustom(custom) {
|
|
26
|
+
this.custom = custom;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
23
29
|
send() {
|
|
24
30
|
return globalThis.Response.json({
|
|
25
31
|
data: this.data,
|
|
26
32
|
message: this.message,
|
|
27
|
-
status: this.status
|
|
33
|
+
status: this.status,
|
|
34
|
+
...this.custom
|
|
28
35
|
}, {
|
|
29
36
|
headers: {
|
|
30
37
|
...Cors.init
|
package/facades/Response.d.ts
CHANGED
package/facades/Response.js
CHANGED