sumba 2.43.0 → 2.45.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.
@@ -1,5 +1,6 @@
1
1
  async function address (opts = {}) {
2
- return {
2
+ opts.latLng = opts.latLng ?? true
3
+ const item = {
3
4
  properties: [{
4
5
  name: 'address1',
5
6
  type: 'string'
@@ -36,12 +37,32 @@ async function address (opts = {}) {
36
37
  name: 'website',
37
38
  type: 'string',
38
39
  maxLength: 100
40
+ }, {
41
+ name: 'lat',
42
+ type: 'sumba:lat',
43
+ required: false
44
+ }, {
45
+ name: 'lng',
46
+ type: 'sumba:lng',
47
+ required: false
39
48
  }],
40
49
  rules: [{
41
50
  rule: 'trim',
42
51
  fields: ['address1', 'address2', 'city', 'zipCode', 'provinceState', 'phone', 'website']
43
52
  }]
44
53
  }
54
+ if (opts.latLng) {
55
+ item.properties.push({
56
+ name: 'lat',
57
+ type: 'sumba:lat',
58
+ required: false
59
+ }, {
60
+ name: 'lng',
61
+ type: 'sumba:lng',
62
+ required: false
63
+ })
64
+ }
65
+ return item
45
66
  }
46
67
 
47
68
  export default address
package/index.js CHANGED
@@ -98,6 +98,7 @@ async function factory (pkgName) {
98
98
  */
99
99
  start = async () => {
100
100
  await this.populateRouteGuards()
101
+ const { setInterval } = this.app.lib
101
102
  if (!this.config.multiSite.enabled) {
102
103
  this.config.xSiteAdmins = []
103
104
  return
@@ -107,10 +108,7 @@ async function factory (pkgName) {
107
108
  const user = await getModel('SumbaUser').findOneRecord({ query: { username: 'admin', siteId: site.id + '' } }, { noMagic: true })
108
109
  this.config.xSiteAdmins.push(`${site.alias}:${user.username}`)
109
110
  }
110
- this._queueIntv = setInterval(() => {
111
- this.execDownload()
112
- }, this.config.queue.intvDur)
113
- await this.execDownload()
111
+ await setInterval(this.execDownload, this.config.queue.intvDur, { lockFile: 'download', scope: this })
114
112
  }
115
113
 
116
114
  /**
@@ -605,15 +603,12 @@ async function factory (pkgName) {
605
603
  const { fs } = this.app.lib
606
604
  const { callHandler } = this.app.bajo
607
605
  const { getModel } = this.app.dobo
608
- const { lock } = this.app.bajoExtra
609
606
  const query = { status: 'QUEUE', sort: { createdAt: 1 } }
610
607
  const model = getModel('SumbaDownload')
611
608
  const rec = await model.findOneRecord({ query }, { noMagic: true, dataOnly: true })
612
609
  if (isEmpty(rec)) return
613
610
  const opts = { payload: { data: rec.jobQueue.payload.data } }
614
611
  opts.payload.data.file = rec.file
615
- const release = await lock(`sumba-download-${rec.id}`)
616
- if (!release) return
617
612
  try {
618
613
  await model.updateRecord(rec.id, { status: 'PROCESSING' })
619
614
  rec.jobQueue.result = await callHandler(rec.jobQueue.worker, opts)
@@ -624,7 +619,6 @@ async function factory (pkgName) {
624
619
  await model.updateRecord(rec.id, { status: 'FAIL', jobQueue: rec.jobQueue })
625
620
  }
626
621
  // TODO: notify user that the download is ready
627
- await release()
628
622
  }
629
623
 
630
624
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "2.43.0",
3
+ "version": "2.45.0",
4
4
  "description": "Biz Suite for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-08-08
4
+
5
+ - [2.45.0] Add `lat` & `lng` columns to `site` schema
6
+ - [2.45.0] Add `lat` & `lng` columns to `user` schema
7
+
8
+ ## 2026-08-06
9
+
10
+ - [2.44.0] Update `start()` to use the new `app.lib.setInterval()`
11
+
3
12
  ## 2026-08-05
4
13
 
5
14
  - [2.43.0] Add `subTitle` field on `SumbaSite` model