dobo 2.6.4 → 2.6.6
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/lib/collect-drivers.js +1 -1
- package/lib/collect-models.js +8 -8
- package/package.json +1 -1
- package/wiki/CHANGES.md +7 -1
package/lib/collect-drivers.js
CHANGED
|
@@ -26,7 +26,7 @@ async function collectDrivers () {
|
|
|
26
26
|
const instance = new Cls(this, name)
|
|
27
27
|
if (!(instance instanceof DoboDriver)) this.fatal('invalidDriverClass%s%s', this.ns, name)
|
|
28
28
|
me.drivers.push(instance)
|
|
29
|
-
me.log.trace('- %s', name)
|
|
29
|
+
me.log.trace('- %s:%s', this.ns, name)
|
|
30
30
|
}, { glob: 'driver/*.js', prefix: this.ns })
|
|
31
31
|
await runHook(`${this.ns}:afterCollectDrivers`)
|
|
32
32
|
this.log.debug('collected%s%d', this.t('driver'), this.drivers.length)
|
package/lib/collect-models.js
CHANGED
|
@@ -110,15 +110,15 @@ async function findAllFeats (model, inputs = [], indexes = [], isExtender) {
|
|
|
110
110
|
* @param {Object} model - Model
|
|
111
111
|
* @param {Array} [inputs] - Array of properties
|
|
112
112
|
*/
|
|
113
|
-
async function findAllIndexes (model, inputs = []) {
|
|
114
|
-
const
|
|
113
|
+
async function findAllIndexes (model, inputs = [], indexes = []) {
|
|
114
|
+
const items = []
|
|
115
115
|
for (const index of inputs) {
|
|
116
116
|
index.type = index.type ?? 'index'
|
|
117
117
|
index.fields = index.fields ?? []
|
|
118
118
|
if (!index.name) index.name = `${model.name}_${index.fields.join('_')}_${index.type}`
|
|
119
|
-
|
|
119
|
+
items.push(index)
|
|
120
120
|
}
|
|
121
|
-
model.indexes = indexes
|
|
121
|
+
model.indexes = [...items, ...indexes]
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
@@ -255,14 +255,14 @@ async function createSchema (item) {
|
|
|
255
255
|
if (item.base) {
|
|
256
256
|
for (const ns of this.app.getAllNs()) {
|
|
257
257
|
const plugin = this.app[ns]
|
|
258
|
-
const glob = `${plugin.dir.pkg}/extend/dobo/extend/${item.ns}/
|
|
258
|
+
const glob = `${plugin.dir.pkg}/extend/dobo/extend/${item.ns}/model/${item.base}.*`
|
|
259
259
|
const files = await fastGlob(glob)
|
|
260
260
|
for (const file of files) {
|
|
261
261
|
const extender = await readConfig(file, { ns: plugin.ns, ignoreError: true })
|
|
262
262
|
if (!isPlainObject(extender)) this.plugin.fatal('invalidModelExtender%s%s', ns, item.name)
|
|
263
263
|
await findAllProps.call(this, item, extender.properties ?? [], indexes, true)
|
|
264
264
|
await findAllFeats.call(this, item, extender.features ?? [], indexes, true)
|
|
265
|
-
await findAllIndexes.call(this, item, extender.indexes ?? [], true)
|
|
265
|
+
await findAllIndexes.call(this, item, extender.indexes ?? [], indexes, true)
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -305,9 +305,9 @@ async function collectModels () {
|
|
|
305
305
|
item.name = item.name ?? defName
|
|
306
306
|
item.collName = item.collName ?? item.name
|
|
307
307
|
item.file = file
|
|
308
|
+
item.ns = this.ns
|
|
308
309
|
const schema = await createSchema.call(me, item)
|
|
309
|
-
schema
|
|
310
|
-
schemas.push(item)
|
|
310
|
+
schemas.push(schema)
|
|
311
311
|
}, { glob: 'model/*.*', prefix: this.ns })
|
|
312
312
|
schemas = orderBy(schemas, ['buildLevel', 'name'])
|
|
313
313
|
for (const schema of schemas) {
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-02-17
|
|
4
|
+
|
|
5
|
+
- [2.6.5] Bug fix on model extender
|
|
6
|
+
- [2.6.5] Bug fix on trace logging
|
|
7
|
+
- [2.6.6] Bug fix on extender indexes
|
|
8
|
+
|
|
3
9
|
## 2026-02-05
|
|
4
10
|
|
|
5
|
-
- [2.6.
|
|
11
|
+
- [2.6.4] Bug fix on driver options, ```noCheckUnique``` must be perform in ```create```, ```update``` and ```upsert```
|
|
6
12
|
|
|
7
13
|
## 2026-02-03
|
|
8
14
|
|