waibu-rest-api 2.10.0 → 2.11.1
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/index.js +0 -1
- package/lib/route-by-model-builder.js +1 -2
- package/lib/serve-route.js +1 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +10 -0
package/index.js
CHANGED
|
@@ -106,7 +106,6 @@ async function factory (pkgName) {
|
|
|
106
106
|
|
|
107
107
|
transformResult = ({ data, req, reply, options = {} }) => {
|
|
108
108
|
const reformat = ({ data, req, reply, options = {} }) => {
|
|
109
|
-
// console.log(data)
|
|
110
109
|
const { forOwn, get } = this.app.lib._
|
|
111
110
|
const newData = {}
|
|
112
111
|
forOwn(data, (v, k) => {
|
|
@@ -11,8 +11,7 @@ export function extractHeaders (req, options) {
|
|
|
11
11
|
if (isSet(headers['x-refs'])) options.refs = headers['x-refs']
|
|
12
12
|
if (typeof options.refs === 'string' && !['*', 'all'].includes(options.refs)) options.refs = [options.refs]
|
|
13
13
|
if (headers['x-warnings']) options.showWarnings = true
|
|
14
|
-
if (headers['x-
|
|
15
|
-
if (headers['x-retain-original']) options.retainOriginalValue = true
|
|
14
|
+
if (headers['x-formatted'] || headers['x-fmt']) options.fmt = true
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
async function routeByModelBuilder ({ file, dir, pathPrefix, ns, parent }) {
|
package/lib/serve-route.js
CHANGED
|
@@ -11,7 +11,7 @@ async function serveRoute ({ mod, ns, parent }) {
|
|
|
11
11
|
mod.config.webApp = parent ?? ns
|
|
12
12
|
mod.config.ns = ns
|
|
13
13
|
mod.config.subNs = 'restapi'
|
|
14
|
-
mod.config.
|
|
14
|
+
mod.config.xSite = mod.xSite
|
|
15
15
|
mod.config.title = mod.title
|
|
16
16
|
delete mod.title
|
|
17
17
|
if (mod.method === 'PUT' && cfgWdb.dbModel.patchEnabled) mod.method = [mod.method, 'PATCH']
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-05-22
|
|
4
|
+
|
|
5
|
+
- [2.11.1] Bug fix in ```serve-route.js```
|
|
6
|
+
|
|
7
|
+
## 2026-04-25
|
|
8
|
+
|
|
9
|
+
- [2.11.0] Change options to format value using the new key set by dobo
|
|
10
|
+
- [2.11.0] Remove ```options.retainOriginalValue``` since it is not needed anymore
|
|
11
|
+
- [2.11.0] Change related header to ```X-Fmt```
|
|
12
|
+
|
|
3
13
|
## 2026-04-11
|
|
4
14
|
|
|
5
15
|
- [2.10.0] Add support to format output values using header ```X-Format-Value```
|