waibu-rest-api 2.4.0 → 2.5.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 +3 -1
- package/lib/doc-schema/for-find.js +2 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +8 -0
package/index.js
CHANGED
|
@@ -61,6 +61,7 @@ async function factory (pkgName) {
|
|
|
61
61
|
error: 'error',
|
|
62
62
|
cached: 'cached',
|
|
63
63
|
message: 'message',
|
|
64
|
+
warnings: 'warnings',
|
|
64
65
|
details: 'details'
|
|
65
66
|
},
|
|
66
67
|
mapSlash: '~',
|
|
@@ -107,8 +108,9 @@ async function factory (pkgName) {
|
|
|
107
108
|
const { forOwn, get } = this.app.lib._
|
|
108
109
|
const newData = {}
|
|
109
110
|
forOwn(data, (v, k) => {
|
|
110
|
-
let key = get(this.config, `responseKey.${k}
|
|
111
|
+
let key = get(this.config, `responseKey.${k}`)
|
|
111
112
|
if (options.forFind && k === 'data') key = get(this.config, 'responseKey.data')
|
|
113
|
+
if (!key) return undefined
|
|
112
114
|
newData[key] = v
|
|
113
115
|
})
|
|
114
116
|
return newData
|
|
@@ -9,7 +9,8 @@ async function docSchemaForFind (items) {
|
|
|
9
9
|
pages: { type: 'integer' },
|
|
10
10
|
count: { type: 'integer' },
|
|
11
11
|
success: { type: 'boolean', default: true },
|
|
12
|
-
statusCode: { type: 'integer', default: 200 }
|
|
12
|
+
statusCode: { type: 'integer', default: 200 },
|
|
13
|
+
warnings: { type: 'array' }
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
|
package/package.json
CHANGED