waibu-db 2.31.0 → 2.32.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.
@@ -27,7 +27,7 @@ async function exportHandler (opts = {}) {
27
27
  options = {}
28
28
  } = opts
29
29
  // const { dayjs } = this.app.lib
30
- const { omit, kebabCase, get, merge } = this.app.lib._
30
+ const { omit, kebabCase, get, merge, isEmpty } = this.app.lib._
31
31
  const { pascalCase } = this.app.lib.aneka
32
32
  const { getSchemaExt } = this.app.waibuDb
33
33
  const { buildUrl } = this.app.waibuMpa
@@ -39,6 +39,8 @@ async function exportHandler (opts = {}) {
39
39
  const data = await prepCrud.call(this.app.getPlugin('waibuDb'), { model, req, reply, args: ['model'] })
40
40
  data.opts = omit(data.opts, ['req', 'reply'])
41
41
  data.opts.lang = req.lang
42
+ data.opts.fields = isEmpty(req.query.fields) ? get(schema, 'view.fields', []) : req.query.fields.split(',')
43
+
42
44
  data.opts.timeZone = get(req, 'site.setting.sumba.timeZone', this.app.bajo.config.intl.format.datetime.timeZone)
43
45
  data.opts.dateStyle = get(req, 'site.setting.sumba.dateStyle', this.app.bajo.config.intl.format.datetime.dateStyle)
44
46
  data.opts.timeStyle = get(req, 'site.setting.sumba.timeStyle', this.app.bajo.config.intl.format.datetime.timeStyle)
@@ -49,7 +51,7 @@ async function exportHandler (opts = {}) {
49
51
  const ext = data.exportOpts.includes('zip') ? `${type}.gz` : type
50
52
  // const file = `${kebabCase(model)}_${dayjs().format('YYYYMMDDhhmmss')}.${ext}`
51
53
  const file = `${kebabCase(model)}.${ext}`
52
- if (this.app.sumbaXXX) {
54
+ if (this.app.sumba) {
53
55
  await this.app.sumba.download({ file, type, worker, source, data, req })
54
56
  req.flash('notify', req.t('exportInQueue'))
55
57
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "2.31.0",
3
+ "version": "2.32.0",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-07-27
4
+
5
+ - [2.32.0] Add support for `sumba.download()` through `export-handler.js`
6
+
3
7
  ## 2026-07-26
4
8
 
5
9
  - [2.30.0] Canges in `exportTo()`