@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 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
@@ -3,4 +3,5 @@ export default class Response {
3
3
  static setData(data?: any): ResponseBuilder;
4
4
  static setMessage(message: string): ResponseBuilder;
5
5
  static setStatus(status: number): ResponseBuilder;
6
+ static setCustom(custom?: Record<string, any>): ResponseBuilder;
6
7
  }
@@ -9,4 +9,7 @@ export default class Response {
9
9
  static setStatus(status) {
10
10
  return new ResponseBuilder().setStatus(status);
11
11
  }
12
+ static setCustom(custom) {
13
+ return new ResponseBuilder().setCustom(custom);
14
+ }
12
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bejibun/core",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "author": "Havea Crenata <havea.crenata@gmail.com>",
5
5
  "repository": {
6
6
  "type": "git",