waibu-rest-api 1.0.3 → 1.0.5
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/bajo/config.json
CHANGED
|
@@ -2,8 +2,8 @@ const waibuRestApiPreParsing = {
|
|
|
2
2
|
level: 9,
|
|
3
3
|
handler: async function (req, reply) {
|
|
4
4
|
const { importModule } = this.app.bajo
|
|
5
|
-
const attachI18N = await importModule('waibu:/lib/webapp-scope/attach-
|
|
6
|
-
await attachI18N.call(this, this.config.
|
|
5
|
+
const attachI18N = await importModule('waibu:/lib/webapp-scope/attach-intl.js')
|
|
6
|
+
await attachI18N.call(this, this.config.intl.detectors, req, reply)
|
|
7
7
|
reply.header('Content-Language', req.lang)
|
|
8
8
|
if (this.config.format.asExt && req.params.format) {
|
|
9
9
|
if (!this.config.format.supported.includes(req.params.format)) {
|
package/lib/decorate.js
CHANGED
package/lib/serve-route.js
CHANGED
|
@@ -5,7 +5,7 @@ async function serveRoute ({ mod, ns, parent }) {
|
|
|
5
5
|
const mergeRouteHooks = await importModule('waibu:/lib/webapp-scope/merge-route-hooks.js')
|
|
6
6
|
const cfgWdb = this.app.waibuDb.config
|
|
7
7
|
mod.config = mod.config ?? {}
|
|
8
|
-
mod.config.prefix = getPluginPrefix(ns)
|
|
8
|
+
mod.config.prefix = getPluginPrefix(ns, 'waibuRestApi')
|
|
9
9
|
mod.config.pathSrc = mod.url
|
|
10
10
|
mod.config.webApp = parent ?? ns
|
|
11
11
|
mod.config.ns = ns
|
package/package.json
CHANGED
package/waibu/boot.js
CHANGED
|
@@ -51,7 +51,7 @@ const boot = {
|
|
|
51
51
|
const me = this
|
|
52
52
|
|
|
53
53
|
await eachPlugins(async function ({ dir, alias, ns }) {
|
|
54
|
-
const appPrefix = '/' + (ns === me.app.bajo.mainNs &&
|
|
54
|
+
const appPrefix = '/' + (ns === me.app.bajo.mainNs && getPluginPrefix(ns, 'waibuRestApi'))
|
|
55
55
|
const pattern = [
|
|
56
56
|
`${dir}/${pathPrefix}/**/{${actions.join(',')}}.js`,
|
|
57
57
|
`${dir}/${pathPrefix}/**/model-builder.*`
|
|
File without changes
|