dobo 2.32.0 → 2.34.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.
- package/extend/bajo/{hook-docs.js → hook.js} +0 -2
- package/lib/factory/model/sanitize-record.js +9 -4
- package/lib/factory/model.js +48 -46
- package/lib/helper.js +1 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +200 -192
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
* @param {boolean} [opts.forceNoHidden=false] - If `true`, force ALL fields to be picked, thus ignoring hidden fields. If an array, force all fields except those in the array to be picked.
|
|
11
11
|
* @param {boolean} [opts.fmt=false] - If `true`, add a `_fmt` property to the sanitized record with formatted values automatically based on the model's properties and rules
|
|
12
12
|
* @param {Object} [opts.req] - Request object, used for formatting values based on request context
|
|
13
|
+
* @param {Object} [opts.i18n] - Internationalization options, used for formatting values based on i18n context
|
|
14
|
+
* @param {string} [opts.i18n.lang] - Language code for formatting values
|
|
15
|
+
* @param {string} [opts.i18n.dateStyle] - Date style for formatting date values
|
|
16
|
+
* @param {string} [opts.i18n.timeStyle] - Time style for formatting time values
|
|
17
|
+
* @param {string} [opts.i18n.timeZone] - Time zone for formatting date/time values
|
|
13
18
|
* @returns {Object} Returns sanitized record object
|
|
14
19
|
*/
|
|
15
20
|
async function sanitizeRecord (record = {}, opts = {}) {
|
|
@@ -51,11 +56,11 @@ async function sanitizeRecord (record = {}, opts = {}) {
|
|
|
51
56
|
else if (isString(prop.format)) newRecord._fmt[key] = await callHandler(this.plugin, this, value, newRecord, opts)
|
|
52
57
|
else {
|
|
53
58
|
const options = {
|
|
54
|
-
lang: get(opts, 'req.lang'),
|
|
59
|
+
lang: get(opts, 'i18n.lang', get(opts, 'req.lang')),
|
|
55
60
|
datetime: {
|
|
56
|
-
dateStyle: get(opts, 'req.site.setting.sumba.dateStyle'),
|
|
57
|
-
timeStyle: get(opts, 'req.site.setting.sumba.timeStyle'),
|
|
58
|
-
timeZone: get(opts, 'req.site.setting.sumba.timeZone')
|
|
61
|
+
dateStyle: get(opts, 'i18n.dateStyle', get(opts, 'req.site.setting.sumba.dateStyle')),
|
|
62
|
+
timeStyle: get(opts, 'i18n.timeStyle', get(opts, 'req.site.setting.sumba.timeStyle')),
|
|
63
|
+
timeZone: get(opts, 'i18n.timeZone', get(opts, 'req.site.setting.sumba.timeZone'))
|
|
59
64
|
},
|
|
60
65
|
latitude: ['lat', 'latitude'].includes(key),
|
|
61
66
|
longitude: ['lon', 'lng', 'longitude'].includes(key)
|
package/lib/factory/model.js
CHANGED
|
@@ -252,6 +252,54 @@ async function modelFactory () {
|
|
|
252
252
|
* @type {string}
|
|
253
253
|
*/
|
|
254
254
|
this.adapter = this.connection.adapter
|
|
255
|
+
|
|
256
|
+
this.bindThis(
|
|
257
|
+
build,
|
|
258
|
+
exists,
|
|
259
|
+
drop,
|
|
260
|
+
|
|
261
|
+
createRecord,
|
|
262
|
+
getRecord,
|
|
263
|
+
updateRecord,
|
|
264
|
+
upsertRecord,
|
|
265
|
+
removeRecord,
|
|
266
|
+
clearRecord,
|
|
267
|
+
findRecord,
|
|
268
|
+
findOneRecord,
|
|
269
|
+
findAllRecord,
|
|
270
|
+
|
|
271
|
+
transaction,
|
|
272
|
+
bulkCreateRecord,
|
|
273
|
+
|
|
274
|
+
createAggregate,
|
|
275
|
+
createHistogram,
|
|
276
|
+
countRecord,
|
|
277
|
+
|
|
278
|
+
createAttachment,
|
|
279
|
+
getAttachment,
|
|
280
|
+
updateAttachment,
|
|
281
|
+
removeAttachment,
|
|
282
|
+
findAttachment,
|
|
283
|
+
listAttachment,
|
|
284
|
+
|
|
285
|
+
loadFixtures,
|
|
286
|
+
sanitizeRecord,
|
|
287
|
+
sanitizeBody,
|
|
288
|
+
sanitizeFixture,
|
|
289
|
+
validate
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
// aliases
|
|
293
|
+
this.deleteRecord = this.removeRecord
|
|
294
|
+
this.clearRecords = this.clearRecord
|
|
295
|
+
this.countRecords = this.countRecord
|
|
296
|
+
this.findRecords = this.findRecord
|
|
297
|
+
this.findAllRecords = this.findAllRecord
|
|
298
|
+
this.listAttachments = this.listAttachment
|
|
299
|
+
this.bulkCreateRecords = this.bulkCreateRecord
|
|
300
|
+
|
|
301
|
+
this.getField = this.getProperty
|
|
302
|
+
this.hasField = this.hasProperty
|
|
255
303
|
}
|
|
256
304
|
|
|
257
305
|
/**
|
|
@@ -441,52 +489,6 @@ async function modelFactory () {
|
|
|
441
489
|
})
|
|
442
490
|
}
|
|
443
491
|
|
|
444
|
-
build = build
|
|
445
|
-
exists = exists
|
|
446
|
-
drop = drop
|
|
447
|
-
|
|
448
|
-
createRecord = createRecord
|
|
449
|
-
getRecord = getRecord
|
|
450
|
-
updateRecord = updateRecord
|
|
451
|
-
upsertRecord = upsertRecord
|
|
452
|
-
removeRecord = removeRecord
|
|
453
|
-
clearRecord = clearRecord
|
|
454
|
-
findRecord = findRecord
|
|
455
|
-
findOneRecord = findOneRecord
|
|
456
|
-
findAllRecord = findAllRecord
|
|
457
|
-
|
|
458
|
-
transaction = transaction
|
|
459
|
-
bulkCreateRecord = bulkCreateRecord
|
|
460
|
-
|
|
461
|
-
createAggregate = createAggregate
|
|
462
|
-
createHistogram = createHistogram
|
|
463
|
-
countRecord = countRecord
|
|
464
|
-
|
|
465
|
-
createAttachment = createAttachment
|
|
466
|
-
getAttachment = getAttachment
|
|
467
|
-
updateAttachment = updateAttachment
|
|
468
|
-
removeAttachment = removeAttachment
|
|
469
|
-
findAttachment = findAttachment
|
|
470
|
-
listAttachment = listAttachment
|
|
471
|
-
|
|
472
|
-
loadFixtures = loadFixtures
|
|
473
|
-
sanitizeRecord = sanitizeRecord
|
|
474
|
-
sanitizeBody = sanitizeBody
|
|
475
|
-
sanitizeFixture = sanitizeFixture
|
|
476
|
-
validate = validate
|
|
477
|
-
|
|
478
|
-
// aliases
|
|
479
|
-
deleteRecord = removeRecord
|
|
480
|
-
clearRecords = clearRecord
|
|
481
|
-
countRecords = countRecord
|
|
482
|
-
findRecords = findRecord
|
|
483
|
-
findAllRecords = findAllRecord
|
|
484
|
-
listAttachments = listAttachment
|
|
485
|
-
bulkCreateRecords = bulkCreateRecord
|
|
486
|
-
|
|
487
|
-
getField = (name) => this.getProperty(name)
|
|
488
|
-
hasField = (name) => this.hasProperty(name)
|
|
489
|
-
|
|
490
492
|
dispose = async () => {
|
|
491
493
|
await super.dispose()
|
|
492
494
|
this.connection = null
|
package/lib/helper.js
CHANGED
|
@@ -329,7 +329,7 @@ export async function collectModels () {
|
|
|
329
329
|
const { pascalCase } = this.app.lib.aneka
|
|
330
330
|
const { isPlainObject, isEmpty, isArray } = this.app.lib._
|
|
331
331
|
|
|
332
|
-
let items = await readConfig(file, { ns: this.ns, baseNs: me.ns, merge:
|
|
332
|
+
let items = await readConfig(file, { ns: this.ns, baseNs: me.ns, merge: 'concat' })
|
|
333
333
|
if (isEmpty(items)) return undefined
|
|
334
334
|
if (isPlainObject(items)) {
|
|
335
335
|
items.baseName = items.baseName ?? path.basename(file, path.extname(file))
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-07-26
|
|
4
|
+
|
|
5
|
+
- [2.34.0] Add `options.i18n` to `model.sanitizeRecord()`
|
|
6
|
+
|
|
7
|
+
## 2026-07-24
|
|
8
|
+
|
|
9
|
+
- [2.33.0] Change `selfBind` to `bindThis`
|
|
10
|
+
|
|
3
11
|
## 2026-07-12
|
|
4
12
|
|
|
5
13
|
- [2.32.0] Change `driver` to `adapter`
|
|
@@ -8,286 +16,286 @@
|
|
|
8
16
|
|
|
9
17
|
## 2026-06-29
|
|
10
18
|
|
|
11
|
-
- [2.31.0] Add
|
|
19
|
+
- [2.31.0] Add `dobo.driver:{before|after}Any`
|
|
12
20
|
|
|
13
21
|
## 2026-06-24
|
|
14
22
|
|
|
15
|
-
- [2.30.5] Bug fix in
|
|
16
|
-
- [2.30.5] Bug fix in
|
|
17
|
-
- [2.30.6] Bug fix in
|
|
18
|
-
- [2.30.7] Bug fix in
|
|
19
|
-
- [2.30.7] Bug fix in
|
|
20
|
-
- [2.30.7] Bug fix in
|
|
23
|
+
- [2.30.5] Bug fix in `model.sanitizeBody()`
|
|
24
|
+
- [2.30.5] Bug fix in `model.sanitizeRecord()`
|
|
25
|
+
- [2.30.6] Bug fix in `driver.sanitizeRecord()`
|
|
26
|
+
- [2.30.7] Bug fix in `util.getRefs()`
|
|
27
|
+
- [2.30.7] Bug fix in `model.sanitizeBody()`
|
|
28
|
+
- [2.30.7] Bug fix in `model.sanitizeRecord()`
|
|
21
29
|
|
|
22
30
|
## 2026-06-16
|
|
23
31
|
|
|
24
|
-
- [2.30.4] Bug fix in
|
|
25
|
-
- [2.30.4] Bug fix in
|
|
32
|
+
- [2.30.4] Bug fix in `model.sanitizeBody()`
|
|
33
|
+
- [2.30.4] Bug fix in `model._prepBodyForCreate()`
|
|
26
34
|
|
|
27
35
|
## 2026-06-13
|
|
28
36
|
|
|
29
|
-
- [2.30.2] Bug fix in
|
|
30
|
-
- [2.30.2] Bug fix in
|
|
31
|
-
- [2.30.2] Bug fix in
|
|
32
|
-
- [2.30.3] Bug fix in
|
|
37
|
+
- [2.30.2] Bug fix in `model.findAllRecord()`
|
|
38
|
+
- [2.30.2] Bug fix in `memory.findAllRecord()`
|
|
39
|
+
- [2.30.2] Bug fix in `collect-models.js`
|
|
40
|
+
- [2.30.3] Bug fix in `memory.findRecord()`
|
|
33
41
|
|
|
34
42
|
## 2026-06-12
|
|
35
43
|
|
|
36
|
-
- [2.30.0] Necessary updates to
|
|
37
|
-
- [2.30.0] Add
|
|
38
|
-
- [2.30.0] Add
|
|
39
|
-
- [2.30.0] Refactor
|
|
40
|
-
- [2.30.1] Bug fix in
|
|
44
|
+
- [2.30.0] Necessary updates to `bajo@2.18.0` specs
|
|
45
|
+
- [2.30.0] Add `sanitizeByType()`
|
|
46
|
+
- [2.30.0] Add `error._abortAction` to abort an action in driver level
|
|
47
|
+
- [2.30.0] Refactor `model.sanitizeBody()` to use shared sanitizing function
|
|
48
|
+
- [2.30.1] Bug fix in `model.sanitizeBody()`
|
|
41
49
|
|
|
42
50
|
## 2026-06-11
|
|
43
51
|
|
|
44
|
-
- [2.29.1] Bug fix in
|
|
45
|
-
- [2.29.2] Bug fix in
|
|
52
|
+
- [2.29.1] Bug fix in `model.sanitizeBody()`
|
|
53
|
+
- [2.29.2] Bug fix in `model.sanitizeBody()`
|
|
46
54
|
|
|
47
55
|
## 2026-06-10
|
|
48
56
|
|
|
49
|
-
- [2.29.0] Feature
|
|
50
|
-
- [2.29.0] Add
|
|
51
|
-
- [2.29.0] Options
|
|
52
|
-
- [2.29.0] Add
|
|
57
|
+
- [2.29.0] Feature `dobo:immutable` now using array instead of boolean
|
|
58
|
+
- [2.29.0] Add `model.sanitizeFixture()`
|
|
59
|
+
- [2.29.0] Options `noMagic` no without touching `noModelHook`
|
|
60
|
+
- [2.29.0] Add `array` validator type
|
|
53
61
|
|
|
54
62
|
## 2026-06-03
|
|
55
63
|
|
|
56
|
-
- [2.28.0] Property
|
|
57
|
-
- [2.28.0]
|
|
58
|
-
- [2.28.0] Bug fix in
|
|
59
|
-
- [2.28.0] Bug fix in
|
|
64
|
+
- [2.28.0] Property `values` can now accept a function that will be called dynamically upon used
|
|
65
|
+
- [2.28.0] `_util.buildPropValues()` now become a new model method
|
|
66
|
+
- [2.28.0] Bug fix in `model.sanitizeRecord()`
|
|
67
|
+
- [2.28.0] Bug fix in `model.validate()`
|
|
60
68
|
|
|
61
69
|
## 2026-05-30
|
|
62
70
|
|
|
63
|
-
- [2.27.0] Bug fix in
|
|
64
|
-
- [2.27.0] Add
|
|
65
|
-
- [2.27.0] Bug fix in
|
|
66
|
-
- [2.27.0] Bug fix in
|
|
67
|
-
- [2.27.1] Bug fix in
|
|
68
|
-
- [2.27.2] Bug fix in
|
|
71
|
+
- [2.27.0] Bug fix in `model.transaction()`
|
|
72
|
+
- [2.27.0] Add `model:[before|after]RecordValidation` model hooks
|
|
73
|
+
- [2.27.0] Bug fix in `model.countRecord()`
|
|
74
|
+
- [2.27.0] Bug fix in `model.loadFixtures()`
|
|
75
|
+
- [2.27.1] Bug fix in `model.sanitizeRecord()`
|
|
76
|
+
- [2.27.2] Bug fix in `collect-models.js`
|
|
69
77
|
|
|
70
78
|
## 2026-05-29
|
|
71
79
|
|
|
72
|
-
- [2.26.1] Bug fix in
|
|
73
|
-
- [2.26.1] Bug fix in
|
|
74
|
-
- [2.26.1] Bug fix in
|
|
75
|
-
- [2.26.1] Bug fix in
|
|
76
|
-
- [2.26.4] Bug fix in
|
|
80
|
+
- [2.26.1] Bug fix in `model.createRecord()`
|
|
81
|
+
- [2.26.1] Bug fix in `model.updateRecord()`
|
|
82
|
+
- [2.26.1] Bug fix in `model.upsertRecord()`
|
|
83
|
+
- [2.26.1] Bug fix in `model.removeRecord()`
|
|
84
|
+
- [2.26.4] Bug fix in `model.listAttachment()`
|
|
77
85
|
|
|
78
86
|
## 2026-05-26
|
|
79
87
|
|
|
80
|
-
- [2.26.0] Add loading multiple model schema as in one
|
|
88
|
+
- [2.26.0] Add loading multiple model schema as in one `model.js` file
|
|
81
89
|
- [2.26.0] Remove caching feature of model schema
|
|
82
|
-
- [2.26.0] Change driver hook name with this syntax:
|
|
83
|
-
- [2.26.1] Bug fix in
|
|
84
|
-
- [2.26.2] Bug fix in
|
|
90
|
+
- [2.26.0] Change driver hook name with this syntax: `dobo.driver:<action>`
|
|
91
|
+
- [2.26.1] Bug fix in `memory.js`
|
|
92
|
+
- [2.26.2] Bug fix in `driver.js`
|
|
85
93
|
|
|
86
94
|
## 2026-05-22
|
|
87
95
|
|
|
88
|
-
- [2.25.0] Add
|
|
89
|
-
- [2.25.0] Change
|
|
90
|
-
- [2.25.0] Add
|
|
91
|
-
- [2.25.0] Bug fix in
|
|
92
|
-
- [2.25.0] Handle
|
|
96
|
+
- [2.25.0] Add `array` & `object` validator handling
|
|
97
|
+
- [2.25.0] Change `interSite` definition to `xSite`
|
|
98
|
+
- [2.25.0] Add `model.getNonVirtualProperties()`
|
|
99
|
+
- [2.25.0] Bug fix in `model.loadFixtures()`
|
|
100
|
+
- [2.25.0] Handle `array` validation schema
|
|
93
101
|
|
|
94
102
|
## 2026-05-16
|
|
95
103
|
|
|
96
|
-
- [2.24.0] Change
|
|
97
|
-
- [2.24.0] Add
|
|
98
|
-
- [2.24.0] Add
|
|
99
|
-
- [2.24.0] Change
|
|
100
|
-
- [2.24.0] Remove
|
|
101
|
-
- [2.24.0] Change
|
|
102
|
-
- [2.24.0] Bugfix in
|
|
103
|
-
- [2.24.0] Add
|
|
104
|
-
- [2.24.0] Add
|
|
104
|
+
- [2.24.0] Change `dobo:immutable` feature, field no longer hidden
|
|
105
|
+
- [2.24.0] Add `dobo:[before|after]driver<Action>` hook
|
|
106
|
+
- [2.24.0] Add `dobo.<modelName>:[before|after]driver<Action>` hook
|
|
107
|
+
- [2.24.0] Change `model._simpleLookup()`
|
|
108
|
+
- [2.24.0] Remove `dobo:[before|after]Build[Query|Search]` hook
|
|
109
|
+
- [2.24.0] Change `model.loadFixtures()`
|
|
110
|
+
- [2.24.0] Bugfix in `model.sanitizeBody()`
|
|
111
|
+
- [2.24.0] Add `dobo:afterTransaction` hook
|
|
112
|
+
- [2.24.0] Add `dobo.<modelName>:afterTransaction` hook
|
|
105
113
|
|
|
106
114
|
## 2026-05-11
|
|
107
115
|
|
|
108
|
-
- [2.23.0] Add
|
|
109
|
-
- [2.23.0] Add
|
|
110
|
-
- [2.23.0] Add
|
|
111
|
-
- [2.23.0] Add
|
|
112
|
-
- [2.23.0] Move
|
|
113
|
-
- [2.23.0] Move
|
|
114
|
-
- [2.23.0] Add
|
|
115
|
-
- [2.23.0] Add
|
|
116
|
-
- [2.23.0] Add
|
|
117
|
-
- [2.23.0] Rename method to
|
|
118
|
-
- [2.23.0] Remove
|
|
119
|
-
- [2.23.0] Add reference support for
|
|
120
|
-
- [2.23.0] Bug fix in
|
|
121
|
-
- [2.23.0] Bug fix in
|
|
122
|
-
- [2.23.0] Bug fix in
|
|
116
|
+
- [2.23.0] Add `beforeBulkCreate` model hook on `dobo:unique` feature
|
|
117
|
+
- [2.23.0] Add `beforeBulkCreate` model hook on `dobo:updatedAt` feature
|
|
118
|
+
- [2.23.0] Add `beforeBulkCreate` model hook on `dobo:unique` feature
|
|
119
|
+
- [2.23.0] Add `connection.initdriver()`
|
|
120
|
+
- [2.23.0] Move `model.file` in model definition to `model.options.file`
|
|
121
|
+
- [2.23.0] Move `model.attachment` in model definition to `model.options.attachment`
|
|
122
|
+
- [2.23.0] Add `model.buildStart()` and `model.buildEnd()` in model definition
|
|
123
|
+
- [2.23.0] Add `null` driver
|
|
124
|
+
- [2.23.0] Add `model.syncIdField()`
|
|
125
|
+
- [2.23.0] Rename method to `model.bulkCreateRecord` instead `bulkCreateRecords`. The later name now serve only as alias
|
|
126
|
+
- [2.23.0] Remove `getSingleRef()` and `getMultiRefs()`, use `getRefs()` instead
|
|
127
|
+
- [2.23.0] Add reference support for `array` column type
|
|
128
|
+
- [2.23.0] Bug fix in `model.findAllRecord()`, now use correctly hook names
|
|
129
|
+
- [2.23.0] Bug fix in `model.sanitizeBody()`
|
|
130
|
+
- [2.23.0] Bug fix in `model.sanitizeRecord()`
|
|
123
131
|
|
|
124
132
|
## 2026-05-03
|
|
125
133
|
|
|
126
|
-
- [2.22.1] Bug fix in
|
|
134
|
+
- [2.22.1] Bug fix in `dobo:image` feature
|
|
127
135
|
|
|
128
136
|
## 2026-05-02
|
|
129
137
|
|
|
130
138
|
- [2.22.0] Add auto thumbnail creation when image attachment is uploaded
|
|
131
139
|
- [2.22.0] Add feature to get the thumbnail instead of attachment file in attachment route
|
|
132
|
-
- [2.22.0] Add
|
|
133
|
-
- [2.22.0] Bug fix in
|
|
134
|
-
- [2.22.0] Bug fix in
|
|
135
|
-
- [2.22.0] Bug fix in
|
|
136
|
-
- [2.22.0] Bug fix in
|
|
140
|
+
- [2.22.0] Add `dobo:image` feature
|
|
141
|
+
- [2.22.0] Bug fix in `model.createRecord()`
|
|
142
|
+
- [2.22.0] Bug fix in `model.updateRecord()`
|
|
143
|
+
- [2.22.0] Bug fix in `model.upsertRecord()`
|
|
144
|
+
- [2.22.0] Bug fix in `model.removeRecord()`
|
|
137
145
|
- [2.22.0] Remove attachment now also remove corresponding thumbnails
|
|
138
146
|
|
|
139
147
|
## 2026-04-28
|
|
140
148
|
|
|
141
|
-
- [2.21.1] Bug fix in
|
|
142
|
-
- [2.21.1] Bug fix in
|
|
143
|
-
- [2.21.1] Bug fix in
|
|
149
|
+
- [2.21.1] Bug fix in `collect-models.js`
|
|
150
|
+
- [2.21.1] Bug fix in `driver._updateRecord()`
|
|
151
|
+
- [2.21.1] Bug fix in `util.getMultiRef()`
|
|
144
152
|
- [2.21.1] Bug fix in setting references
|
|
145
|
-
- [2.21.1] Bug fix in
|
|
153
|
+
- [2.21.1] Bug fix in `model.sanitizeRecord()`
|
|
146
154
|
|
|
147
155
|
## 2026-04-25
|
|
148
156
|
|
|
149
|
-
- [2.21.0] Change
|
|
150
|
-
- [2.21.0] Remove
|
|
151
|
-
- [2.21.0] Remove
|
|
152
|
-
- [2.21.0] Remove
|
|
153
|
-
- [2.21.0] Add
|
|
157
|
+
- [2.21.0] Change `options.formatValue` to `options.fmt`
|
|
158
|
+
- [2.21.0] Remove `options.retainOriginalValue` since it is not needed anymore
|
|
159
|
+
- [2.21.0] Remove `formatValue` altogether
|
|
160
|
+
- [2.21.0] Remove `record._orig`, in exchange switch the formatted value to `record._fmt`
|
|
161
|
+
- [2.21.0] Add `property.virtual` to set property is a virtual/calculated property
|
|
154
162
|
- [2.21.0] Add necessary safe guards for virtual property
|
|
155
|
-
- [2.21.0] Add
|
|
156
|
-
- [2.21.0] Add
|
|
157
|
-
- [2.21.0] Add
|
|
158
|
-
- [2.21.0] Activate transaction on
|
|
163
|
+
- [2.21.0] Add `model.getProperties()`
|
|
164
|
+
- [2.21.0] Add `model.getIndexes()`
|
|
165
|
+
- [2.21.0] Add `model.getVirtualPropertties()`
|
|
166
|
+
- [2.21.0] Activate transaction on `loadFixtures()`
|
|
159
167
|
|
|
160
168
|
## 2026-04-23
|
|
161
169
|
|
|
162
|
-
- [2.20.1] Bug fix in
|
|
170
|
+
- [2.20.1] Bug fix in `collect-models.js`, now with deep merge in advance
|
|
163
171
|
|
|
164
172
|
## 2026-04-21
|
|
165
173
|
|
|
166
|
-
- [2.19.1] Bug fix in
|
|
167
|
-
- [2.19.1] Bug fix in
|
|
168
|
-
- [2.19.1] Add
|
|
174
|
+
- [2.19.1] Bug fix in `collect-models.js`, now values are sanitized with `parseObject()`
|
|
175
|
+
- [2.19.1] Bug fix in `options.dataOnly` on all model methods
|
|
176
|
+
- [2.19.1] Add `options.noMagic`
|
|
169
177
|
- [2.20.0] Revert back to NOT using hooks for caching
|
|
170
178
|
|
|
171
179
|
## 2026-04-19
|
|
172
180
|
|
|
173
|
-
- [2.19.0] Add
|
|
174
|
-
- [2.19.0] Bug fix in
|
|
181
|
+
- [2.19.0] Add `queryAny()` for query using model's scanables fields
|
|
182
|
+
- [2.19.0] Bug fix in `reviveRegexInJson()`
|
|
175
183
|
- [2.19.0] Bug fix in query sanitizing especially for regex existance
|
|
176
|
-
- [2.19.0] Remove
|
|
184
|
+
- [2.19.0] Remove `replaceIdInQuerySearch()` in `_util.js` as it isn't needed anymore
|
|
177
185
|
|
|
178
186
|
## 2026-04-18
|
|
179
187
|
|
|
180
|
-
- [2.18.2] Bug fix in
|
|
181
|
-
- [2.18.2] Bug fix in
|
|
182
|
-
- [2.18.2] Bug fix in
|
|
183
|
-
- [2.18.2] Bug fix in
|
|
188
|
+
- [2.18.2] Bug fix in `config` object
|
|
189
|
+
- [2.18.2] Bug fix in `getDefaultValues`
|
|
190
|
+
- [2.18.2] Bug fix in `sanitizeProp()` in `collect-models.js`
|
|
191
|
+
- [2.18.2] Bug fix in `sanitizeRecord()` for prop with `format` set to `false`
|
|
184
192
|
|
|
185
193
|
## 2026-04-17
|
|
186
194
|
|
|
187
|
-
- [2.18.1] Bug fix in
|
|
188
|
-
- [2.18.1] Bug fix in
|
|
189
|
-
- [2.18.1] Bug fix in
|
|
195
|
+
- [2.18.1] Bug fix in `model.createAttachment()`
|
|
196
|
+
- [2.18.1] Bug fix in `model.sanitizeBody()`
|
|
197
|
+
- [2.18.1] Bug fix in `model.sanitizeRecord()`
|
|
190
198
|
|
|
191
199
|
## 2026-04-16
|
|
192
200
|
|
|
193
|
-
- [2.18.0] Add parameter options to
|
|
194
|
-
- [2.18.0] Rewrite
|
|
195
|
-
- [2.18.0] Bug fix in
|
|
196
|
-
- [2.18.0] Changes in
|
|
197
|
-
- [2.18.0] Changes in
|
|
198
|
-
- [2.18.0] Bug fix in
|
|
199
|
-
- [2.18.0] Bug fix in
|
|
201
|
+
- [2.18.0] Add parameter options to `sanitizeObject()`
|
|
202
|
+
- [2.18.0] Rewrite `dobo:dt` feature to support customization
|
|
203
|
+
- [2.18.0] Bug fix in `model.createRecord()`
|
|
204
|
+
- [2.18.0] Changes in `model.sanitizeBody()` to throw error with payload details
|
|
205
|
+
- [2.18.0] Changes in `model.sanitizeRecord()` to support `options.retainOriginalValue`
|
|
206
|
+
- [2.18.0] Bug fix in `model.updateRecord()`
|
|
207
|
+
- [2.18.0] Bug fix in `model.upsertRecord()`
|
|
200
208
|
|
|
201
209
|
## 2026-04-13
|
|
202
210
|
|
|
203
|
-
- [2.17.0] Add
|
|
211
|
+
- [2.17.0] Add `{ strict }` as parameter to `sanitizeObject()`
|
|
204
212
|
|
|
205
213
|
## 2026-04-11
|
|
206
214
|
|
|
207
|
-
- [2.16.0] Add
|
|
208
|
-
- [2.16.0] Rewrite
|
|
209
|
-
- [2.16.0] All inter site admins are now exempts from
|
|
210
|
-
- [2.16.0] Bug fix in
|
|
211
|
-
- [2.16.0] Bug fix in
|
|
212
|
-
- [2.16.0] Add feature to return formatted row(s) with
|
|
213
|
-
- [2.16.0] If row is formatted, add feature to save original row in
|
|
215
|
+
- [2.16.0] Add `format` as new model's property key
|
|
216
|
+
- [2.16.0] Rewrite `getDefaultValues()` to base on `req.getSetting()`
|
|
217
|
+
- [2.16.0] All inter site admins are now exempts from `immutable` row
|
|
218
|
+
- [2.16.0] Bug fix in `collect-models.js`
|
|
219
|
+
- [2.16.0] Bug fix in `getRefs()` and `getRefs()`
|
|
220
|
+
- [2.16.0] Add feature to return formatted row(s) with `options.formatValue`
|
|
221
|
+
- [2.16.0] If row is formatted, add feature to save original row in `_orig` with `options.retainOriginalValue`
|
|
214
222
|
|
|
215
223
|
## 2026-04-07
|
|
216
224
|
|
|
217
|
-
- [2.15.0] Add
|
|
218
|
-
- [2.15.0] Add
|
|
219
|
-
- [2.15.0] Add
|
|
220
|
-
- [2.15.0] Add
|
|
221
|
-
- [2.15.0] Change all
|
|
222
|
-
- [2.15.0] Add
|
|
223
|
-
- [2.15.0] Add
|
|
224
|
-
- [2.15.0] Add
|
|
225
|
-
- [2.15.0] change
|
|
225
|
+
- [2.15.0] Add `parseNql()`
|
|
226
|
+
- [2.15.0] Add `parseQuery()`
|
|
227
|
+
- [2.15.0] Add `replaceRegexInJson()`
|
|
228
|
+
- [2.15.0] Add `reviveRegexInJson()`
|
|
229
|
+
- [2.15.0] Change all `opts.fieldName` to `opts.field` in features
|
|
230
|
+
- [2.15.0] Add `ref.searchField` in model reference
|
|
231
|
+
- [2.15.0] Add `ref.labelField` in model reference
|
|
232
|
+
- [2.15.0] Add `ref.valueField` in model reference
|
|
233
|
+
- [2.15.0] change `ref.propName` to `ref.field` in model reference
|
|
226
234
|
|
|
227
235
|
## 2026-04-02
|
|
228
236
|
|
|
229
|
-
- [2.14.1] Bug fix in
|
|
230
|
-
- [2.14.1]
|
|
237
|
+
- [2.14.1] Bug fix in `hardCap`
|
|
238
|
+
- [2.14.1] `warnings` now can be turned off through `config` or site settings
|
|
231
239
|
|
|
232
240
|
## 2026-04-01
|
|
233
241
|
|
|
234
|
-
- [2.14.0] Add
|
|
242
|
+
- [2.14.0] Add `between` as custom query, since it doesn't exists in NQL
|
|
235
243
|
|
|
236
244
|
## 2026-03-30
|
|
237
245
|
|
|
238
|
-
- [2.12.0] Add
|
|
239
|
-
- [2.12.0] Bug fix in
|
|
246
|
+
- [2.12.0] Add `.bootorder` level 10
|
|
247
|
+
- [2.12.0] Bug fix in `model._simpleLookup()`
|
|
240
248
|
- [2.12.0] Add model name in validation error's payload
|
|
241
|
-
- [2.13.0] Add
|
|
249
|
+
- [2.13.0] Add `hardCap` support
|
|
242
250
|
|
|
243
251
|
## 2026-03-26
|
|
244
252
|
|
|
245
|
-
- [2.11.4] Exceptions thrown in
|
|
253
|
+
- [2.11.4] Exceptions thrown in `getRefs()` && `getRefs()` will be catched and are ignored
|
|
246
254
|
|
|
247
255
|
## 2026-03-25
|
|
248
256
|
|
|
249
257
|
- [2.11.2] Bug fix in result sets cache
|
|
250
|
-
- [2.11.3] Bug fix in cache handling if
|
|
258
|
+
- [2.11.3] Bug fix in cache handling if `bajoCache` isn't loaded
|
|
251
259
|
|
|
252
260
|
## 2026-03-17
|
|
253
261
|
|
|
254
|
-
- [2.11.1] Bug fix on
|
|
262
|
+
- [2.11.1] Bug fix on `model.validate()`: if `partial` is true, set `fields` from `body` keys
|
|
255
263
|
|
|
256
264
|
## 2026-03-16
|
|
257
265
|
|
|
258
|
-
- [2.11.0] Attachment can now listed by its type (
|
|
259
|
-
- [2.11.0] Add
|
|
266
|
+
- [2.11.0] Attachment can now listed by its type (`image`, `video`, etc)
|
|
267
|
+
- [2.11.0] Add `_last` to autodetect last item in list in `@id.js`
|
|
260
268
|
|
|
261
269
|
## 2026-03-12
|
|
262
270
|
|
|
263
|
-
- [2.10.1] Bug fix in
|
|
271
|
+
- [2.10.1] Bug fix in `model._simpleLookup()` should return `null` if query results empty value
|
|
264
272
|
|
|
265
273
|
## 2026-03-11
|
|
266
274
|
|
|
267
|
-
- [2.10.0] Add
|
|
268
|
-
- [2.10.0] Set
|
|
269
|
-
- [2.10.0] Add
|
|
270
|
-
- [2.10.0] Refactor
|
|
271
|
-
- [2.10.0] Add
|
|
275
|
+
- [2.10.0] Add `immutable` and `feature` to the list of allowed property keys
|
|
276
|
+
- [2.10.0] Set `property.feature` to the name of feature name if property is build using `feature`
|
|
277
|
+
- [2.10.0] Add `model._simpleLookup()`
|
|
278
|
+
- [2.10.0] Refactor `model.loadFixtures()`
|
|
279
|
+
- [2.10.0] Add `property.immutable` for property that can't be updated
|
|
272
280
|
|
|
273
281
|
## 2026-03-09
|
|
274
282
|
|
|
275
|
-
- [2.9.3] Bug fix in
|
|
283
|
+
- [2.9.3] Bug fix in `model.findAllRecord`
|
|
276
284
|
|
|
277
285
|
## 2026-03-07
|
|
278
286
|
|
|
279
|
-
- [2.9.2] Bug fix in
|
|
280
|
-
- [2.9.2] Bug fix in
|
|
287
|
+
- [2.9.2] Bug fix in `model.loadFixtures()`
|
|
288
|
+
- [2.9.2] Bug fix in `collect-connections.js`
|
|
281
289
|
|
|
282
290
|
## 2026-03-06
|
|
283
291
|
|
|
284
|
-
- [2.9.1] Bug fix in
|
|
292
|
+
- [2.9.1] Bug fix in `model.sanitizeBody()`
|
|
285
293
|
|
|
286
294
|
## 2026-03-05
|
|
287
295
|
|
|
288
|
-
- [2.9.0] Add transaction support with
|
|
289
|
-
- [2.9.0] Add property
|
|
290
|
-
- [2.9.0] Add property
|
|
296
|
+
- [2.9.0] Add transaction support with `model.transaction()` wrapper
|
|
297
|
+
- [2.9.0] Add property `driver.support.transaction` to indicate a driver is fully support transaction or not
|
|
298
|
+
- [2.9.0] Add property `connection.options.connName`
|
|
291
299
|
|
|
292
300
|
## 2026-02-25
|
|
293
301
|
|
|
@@ -295,24 +303,24 @@
|
|
|
295
303
|
|
|
296
304
|
## 2026-02-24
|
|
297
305
|
|
|
298
|
-
- [2.8.2] Bug fix in field type
|
|
299
|
-
- [2.8.2] Bug fix in
|
|
306
|
+
- [2.8.2] Bug fix in field type `textType`
|
|
307
|
+
- [2.8.2] Bug fix in `collect-models.js` when empty model is returned
|
|
300
308
|
|
|
301
309
|
## 2026-02-23
|
|
302
310
|
|
|
303
|
-
- [2.8.1] Bug fix in
|
|
304
|
-
- [2.8.1] Bug fix in
|
|
311
|
+
- [2.8.1] Bug fix in `memory._getCursor()`
|
|
312
|
+
- [2.8.1] Bug fix in `model.upsertRecord()`
|
|
305
313
|
|
|
306
314
|
## 2026-02-22
|
|
307
315
|
|
|
308
|
-
- [2.8.0] Add
|
|
309
|
-
- [2.8.0] Throw error if
|
|
316
|
+
- [2.8.0] Add `warnings` to response object
|
|
317
|
+
- [2.8.0] Throw error if `page` above the allowed threshold
|
|
310
318
|
|
|
311
319
|
## 2026-02-20
|
|
312
320
|
|
|
313
|
-
- [2.7.0] Add
|
|
314
|
-
- [2.7.0] Add
|
|
315
|
-
- [2.7.0] Change
|
|
321
|
+
- [2.7.0] Add `prop.values` support
|
|
322
|
+
- [2.7.0] Add `prop.rulesMsg` support
|
|
323
|
+
- [2.7.0] Change `buildFromDbModel()` on validation to async function
|
|
316
324
|
|
|
317
325
|
## 2026-02-17
|
|
318
326
|
|
|
@@ -322,11 +330,11 @@
|
|
|
322
330
|
|
|
323
331
|
## 2026-02-05
|
|
324
332
|
|
|
325
|
-
- [2.6.4] Bug fix in driver options,
|
|
333
|
+
- [2.6.4] Bug fix in driver options, `noCheckUnique` must be perform in `create`, `update` and `upsert`
|
|
326
334
|
|
|
327
335
|
## 2026-02-03
|
|
328
336
|
|
|
329
|
-
- [2.6.3] Bug fix in
|
|
337
|
+
- [2.6.3] Bug fix in `model.sanitizeRecord()`
|
|
330
338
|
|
|
331
339
|
## 2026-02-02
|
|
332
340
|
|
|
@@ -334,24 +342,24 @@
|
|
|
334
342
|
|
|
335
343
|
## 2026-02-01
|
|
336
344
|
|
|
337
|
-
- [2.6.0] Add
|
|
338
|
-
- [2.6.0] Add
|
|
339
|
-
- [2.6.0] Add model hooks
|
|
345
|
+
- [2.6.0] Add `model.scanables` for fields that can participate in table scans if necessary
|
|
346
|
+
- [2.6.0] Add `driver.support.search` for driver's fulltext search support
|
|
347
|
+
- [2.6.0] Add model hooks `before/afterBuildQuery/Search`
|
|
340
348
|
|
|
341
349
|
## 2026-01-30
|
|
342
350
|
|
|
343
|
-
- [2.5.0] Add feature to push custom
|
|
344
|
-
- [2.5.0] Remove
|
|
345
|
-
- [2.5.1] driver now support
|
|
346
|
-
- [2.5.1] Bug fix in
|
|
351
|
+
- [2.5.0] Add feature to push custom `options._data`. If provided, this will be used instead of auto generated one.
|
|
352
|
+
- [2.5.0] Remove `silent` in `options` object
|
|
353
|
+
- [2.5.1] driver now support `this.useUtc` for database that store values in UTC string
|
|
354
|
+
- [2.5.1] Bug fix in `driver.sanitizeRecord()`
|
|
347
355
|
|
|
348
356
|
## 2026-01-29
|
|
349
357
|
|
|
350
|
-
- [2.4.0] Add
|
|
351
|
-
- [2.4.0] Add
|
|
358
|
+
- [2.4.0] Add `bulkCreateRecord()` on model & driver
|
|
359
|
+
- [2.4.0] Add `execModelHook()`
|
|
352
360
|
- [2.4.0] Bug fix in models collection
|
|
353
|
-
- [2.4.0] Add
|
|
354
|
-
- [2.4.0]
|
|
361
|
+
- [2.4.0] Add `DoboAction` to the `app.baseClass`
|
|
362
|
+
- [2.4.0] `findAllRecord()` can't be called as action
|
|
355
363
|
|
|
356
364
|
## 2026-01-26
|
|
357
365
|
|
|
@@ -360,22 +368,22 @@
|
|
|
360
368
|
|
|
361
369
|
## 2026-01-24
|
|
362
370
|
|
|
363
|
-
- [2.3.0] Add
|
|
364
|
-
- [2.3.0] Add
|
|
365
|
-
- [2.3.0] Add
|
|
371
|
+
- [2.3.0] Add `dynHooks` to model's options
|
|
372
|
+
- [2.3.0] Add `dobo:unique` feature
|
|
373
|
+
- [2.3.0] Add `noWait` handler for model's hook
|
|
366
374
|
|
|
367
375
|
## 2026-01-21
|
|
368
376
|
|
|
369
|
-
- [2.2.5] Add
|
|
377
|
+
- [2.2.5] Add `proto` to `connection.options`
|
|
370
378
|
|
|
371
379
|
## 2026-01-19
|
|
372
380
|
|
|
373
|
-
- [2.2.4] Bug fix in route
|
|
381
|
+
- [2.2.4] Bug fix in route `dobo:/attachment/...`
|
|
374
382
|
|
|
375
383
|
## 2026-01-18
|
|
376
384
|
|
|
377
|
-
- [2.2.2] Revert back to
|
|
378
|
-
- [2.2.3] Bug fix in driver's
|
|
385
|
+
- [2.2.2] Revert back to `mingo@6.5.1` because of bugs in `skip` operation
|
|
386
|
+
- [2.2.3] Bug fix in driver's `sanitizeBody()`
|
|
379
387
|
|
|
380
388
|
## 2026-01-16
|
|
381
389
|
|
|
@@ -384,24 +392,24 @@
|
|
|
384
392
|
## 2026-01-11
|
|
385
393
|
|
|
386
394
|
- [2.2.0] Any driver that support memory DB can now declare itself as in-memory DB and be handled as such
|
|
387
|
-
- [2.2.0]
|
|
395
|
+
- [2.2.0] `driver.init()` is removed, and driver should solely use `driver.createClient()` instead
|
|
388
396
|
- [2.2.0] Bug fixes
|
|
389
397
|
|
|
390
398
|
## 2026-01-07
|
|
391
399
|
|
|
392
|
-
- [2.2.0] Add
|
|
400
|
+
- [2.2.0] Add `immutable` feature
|
|
393
401
|
- [2.2.0] Lots of bug fixes
|
|
394
402
|
|
|
395
403
|
## 2025-12-28
|
|
396
404
|
|
|
397
|
-
- [2.2.0] Add
|
|
398
|
-
- [2.2.0] Implement
|
|
399
|
-
- [2.2.0] If no
|
|
405
|
+
- [2.2.0] Add `calcAggregate()` & `calcHistogram()` for array of data objects
|
|
406
|
+
- [2.2.0] Implement `createAggregate()` & `createHistogram()` to the built-in memory database driver
|
|
407
|
+
- [2.2.0] If no `default` connection found, all models automatically bound to `memory` connection
|
|
400
408
|
|
|
401
409
|
## 2025-12-22
|
|
402
410
|
|
|
403
411
|
- [2.2.0] Introduce Action class that enables you to work on models with chainable methods
|
|
404
|
-
- [2.2.0] All base class definitions moved now to
|
|
412
|
+
- [2.2.0] All base class definitions moved now to `this.baseClass` instead of `this.lib`
|
|
405
413
|
|
|
406
414
|
## 2025-12-16
|
|
407
415
|
|
|
@@ -416,12 +424,12 @@
|
|
|
416
424
|
- [2.2.0] Rewrite the whole thing into class based modules: Connection, driver, Feature, Model. Dobo will solely serve as DB Manager in the future
|
|
417
425
|
|
|
418
426
|
## 2025-12-05
|
|
419
|
-
- [2.2.0] Connection now saved in
|
|
427
|
+
- [2.2.0] Connection now saved in `this.connections` as `Connection` instance
|
|
420
428
|
|
|
421
429
|
## 2025-12-03
|
|
422
430
|
|
|
423
431
|
- [2.1.0] Upgrade joi to 18.0.2
|
|
424
432
|
- [2.1.0] Upgrade mingo to 7.0.2
|
|
425
|
-
- [2.1.0] Feature now saved in
|
|
426
|
-
- [2.1.0] driver now saved in
|
|
427
|
-
- [2.1.0] Add
|
|
433
|
+
- [2.1.0] Feature now saved in `this.features` as `Feature` instance
|
|
434
|
+
- [2.1.0] driver now saved in `this.drivers` as `driver` instance
|
|
435
|
+
- [2.1.0] Add `this.getdriver()`. Accept short name or NsPath format
|