sumba 2.33.5 → 2.34.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.
@@ -423,6 +423,7 @@ async function hook () {
423
423
  handler: async function (req, reply) {
424
424
  const { getHostname } = this.app.waibu
425
425
  req.site = await this.getSite(getHostname(req))
426
+ await this.checkRoute(req)
426
427
  }
427
428
  }, {
428
429
  name: 'waibu:beforeStart',
package/index.js CHANGED
@@ -810,6 +810,16 @@ async function factory (pkgName) {
810
810
  if (!get(req, 'user.isXSiteAdmin')) throw this.error('accessDenied', { statusCode: 403 })
811
811
  }
812
812
 
813
+ checkRoute = async (req) => {
814
+ const { routePath } = this.app.waibu
815
+ const { outmatch } = this.app.lib
816
+ const routes = req.getSetting('waibu:route.disabled', []).map(item => routePath(item, false))
817
+ if (routes.length === 0) return
818
+ const isMatch = outmatch(routes)
819
+ const paths = this.pathsToCheck(req)
820
+ if (paths.find(isMatch)) throw this.error('_notFound')
821
+ }
822
+
813
823
  parseNsSettings = (ns, setting, items) => {
814
824
  const { trim, set, isPlainObject, isArray, isEmpty, find } = this.app.lib._
815
825
  const { parseObject, dayjs } = this.app.lib
@@ -828,7 +838,6 @@ async function factory (pkgName) {
828
838
  } catch (err) {}
829
839
  } else if (Number(value)) value = Number(value)
830
840
  else if (['true', 'false'].includes(value)) value = value === 'true'
831
- else if (item.key.endsWith('$in')) value = value.split('\n').map(v => v.trim())
832
841
  else {
833
842
  const dt = dayjs(value)
834
843
  if (dt.isValid()) value = dt.toDate()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "2.33.5",
3
+ "version": "2.34.0",
4
4
  "description": "Biz Suite for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -3,6 +3,8 @@
3
3
  ## 2026-06-19
4
4
 
5
5
  - [2.33.5] Bug fix in ```team-user.json```
6
+ - [2.34.0] Add ```checkRoute()```
7
+ - [2.34.0] Add route checking to ```waibu:preParsing``` hook
6
8
 
7
9
  ## 2026-06-18
8
10