waibu 2.19.0 → 2.20.0

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.
@@ -17,5 +17,9 @@
17
17
  "httpReq%s%s%s%s": "%s %s%s from IP %s",
18
18
  "httpReqExt%s": ", content length: %s",
19
19
  "internalServerError": "Internal Server Error",
20
- "pageNotFound": "Page Not Found"
20
+ "pageNotFound": "Page Not Found",
21
+ "pageNotFoundDesc": "Sorry, the page you're looking for is nowhere to be found!",
22
+ "accessDenied": "Access Denied",
23
+ "accessDeniedDesc": "Sorry, you don't have permission to access this page!",
24
+ "internalServerErrorDesc": "Sorry, something went wrong on our end. Please try again later or contact support if the problem persists."
21
25
  }
@@ -17,5 +17,9 @@
17
17
  "httpReq%s%s%s%s": "%s %s:%s dari IP %s",
18
18
  "httpReqExt%s": ", panjang konten: %s",
19
19
  "internalServerError": "Kesalahan Internal Server",
20
- "pageNotFound": "Halaman Tidak Ditemukan"
20
+ "pageNotFound": "Halaman Tidak Ditemukan",
21
+ "pageNotFoundDesc": "Maaf, halaman yang akan Anda tuju tidak bisa ditemukan dimanapun!",
22
+ "accessDenied": "Akses Ditolak",
23
+ "accessDeniedDesc": "Maaf, Anda tidak memiliki izin untuk mengakses halaman ini!",
24
+ "internalServerErrorDesc": "Maaf, terjadi kesalahan di pihak kami. Silakan coba lagi nanti atau hubungi dukungan jika masalah ini terus berlanjut."
21
25
  }
package/lib/decorate.js CHANGED
@@ -7,6 +7,7 @@ async function decorate () {
7
7
  this.instance.decorateRequest('langDetector', null)
8
8
  this.instance.decorateRequest('site', null)
9
9
  this.instance.decorateRequest('ns', null)
10
+ this.instance.decorateRequest('webApp', null)
10
11
  this.instance.decorateRequest('getSetting', function (key, defValue) {
11
12
  return me.app.waibu.getSetting(key, { req: this, defValue })
12
13
  })
@@ -16,7 +16,7 @@ async function handleError () {
16
16
  const me = this
17
17
  this.instance.setErrorHandler(async function (err, req, reply) {
18
18
  if (err.message === '_notFound' || err.statusCode === 404) return await notFound.call(me, err, req, reply)
19
- if (err.message === '_redirect' && err.redirect) return redirect.call(me, err, req, reply)
19
+ if (err.message === '_redirect' && err.path) return redirect.call(me, err, req, reply)
20
20
  return await error.call(me, err, req, reply)
21
21
  })
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-06-20
4
+
5
+ - [2.20.0] Add ```req.webApp``` decorator
6
+ - [2.20.0] Rename wrongly ```400.html``` to ```404.html``` template file
7
+
3
8
  ## 2026-06-19
4
9
 
5
10
  - [2.18.1] Bug fix in ```routePath()```
@@ -8,6 +13,7 @@
8
13
  - [2.19.0] Simplify ```config.home``` to only accept object
9
14
  - [2.19.0] Add ```options.redirectCode``` to ```reply.redirectTo()```
10
15
  - [2.19.0] Home route config now read from ```req.getSetting()```
16
+ - [2.19.1] Bug fix in ```handle-error.js```
11
17
 
12
18
  ## 2026-06-12
13
19