dobo 1.0.16 → 1.0.18
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/intl/en-US.json +7 -7
- package/bajo/intl/id.json +7 -7
- package/bajo/method/record/clear.js +2 -1
- package/bajo/method/record/count.js +2 -1
- package/bajo/method/record/create.js +2 -1
- package/bajo/method/record/find-one.js +2 -1
- package/bajo/method/record/find.js +2 -1
- package/bajo/method/record/get.js +2 -1
- package/bajo/method/record/remove.js +2 -1
- package/bajo/method/record/update.js +2 -1
- package/bajo/method/record/upsert.js +2 -1
- package/lib/collect-schemas.js +2 -1
- package/package.json +1 -1
package/bajo/intl/en-US.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"isConnected%s%s": "
|
|
3
|
-
"errorOn%s%s": "
|
|
4
|
-
"isDestroyed%s%s": "
|
|
5
|
-
"loadedSchemas%s": "
|
|
6
|
-
"loadSchema%s%s%d": "
|
|
7
|
-
"loadedConns%s%s": "
|
|
2
|
+
"isConnected%s%s": "%s' is connected",
|
|
3
|
+
"errorOn%s%s": "Error on '%s': %s",
|
|
4
|
+
"isDestroyed%s%s": "'%s' is destroyed",
|
|
5
|
+
"loadedSchemas%s": "Loaded schemas: %s",
|
|
6
|
+
"loadSchema%s%s%d": "Load schema: %s (%d)",
|
|
7
|
+
"loadedConns%s%s": "Loaded connections: %s",
|
|
8
8
|
"unsupportedPropTypeIn%s%s": "Unsupported property type '%s' in '%s'",
|
|
9
9
|
"noSchemaFound": "No schema found!",
|
|
10
10
|
"enterSchemaName": "Enter schema name, separated by space:",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"errorCreatingModel%s%s": "Error creating model '%s': %s",
|
|
21
21
|
"modelDropped%s": "Model '%s' successfully dropped",
|
|
22
22
|
"memoryDbSkipped%s%s": "DB '%s' for '%s' is a memory DB, skipped",
|
|
23
|
-
"modelBuiltOnthefly%s%s%s": "
|
|
23
|
+
"modelBuiltOnthefly%s%s%s": "Model '%s@%s' successfully built on the fly",
|
|
24
24
|
"unableToBuildModel%s%s%s": "Unable to re-build model '%s' in '%s': %s",
|
|
25
25
|
"unknownSchema%s": "Unknown schema '%s'",
|
|
26
26
|
"payloadMustBeJson": "Payload must be a valid JSON",
|
package/bajo/intl/id.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"isConnected%s%s": "
|
|
3
|
-
"errorOn%s%s": "
|
|
4
|
-
"isDestroyed%s%s": "
|
|
5
|
-
"loadedSchemas%s": "
|
|
6
|
-
"loadSchema%s%s%d": "
|
|
7
|
-
"loadedConns%s%s": "
|
|
2
|
+
"isConnected%s%s": "'%s' telah tersambung",
|
|
3
|
+
"errorOn%s%s": "Kesalahan pada '%s': %s",
|
|
4
|
+
"isDestroyed%s%s": "'%s' telah dimusnahkan",
|
|
5
|
+
"loadedSchemas%s": "Skema termuat: %s",
|
|
6
|
+
"loadSchema%s%s%d": "Muat skema: %s (%d)",
|
|
7
|
+
"loadedConns%s%s": "Koneksi termuat: %s",
|
|
8
8
|
"unsupportedPropTypeIn%s%s": "Tipe properti '%s' di '%s' tidak didukung",
|
|
9
9
|
"noSchemaFound": "Tidak ditemukan skema!",
|
|
10
10
|
"enterSchemaName": "Masukkan nama skema, dipisah dengan spasi:",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"errorCreatingModel%s%s": "Gagal membuat model '%s': %s",
|
|
20
20
|
"modelDropped%s": "Model '%s' sukses dihapus",
|
|
21
21
|
"memoryDbSkipped%s%s": "Db '%s' untuk '%s' adalah database memori, lewati",
|
|
22
|
-
"modelBuiltOnthefly%s%s%s": "
|
|
22
|
+
"modelBuiltOnthefly%s%s%s": "Model '%s@%s' sukses dibuat ulang on the fly",
|
|
23
23
|
"unableToBuildModel%s%s%s": "Gagal membuat ulang model '%s' di '%s': %s",
|
|
24
24
|
"unknownSchema%s": "Skema '%s' tidak dikenal",
|
|
25
25
|
"payloadMustBeJson": "Data harus berupa obyek JSON yang valid",
|
|
@@ -4,8 +4,9 @@ async function clear (name, opts = {}) {
|
|
|
4
4
|
const { runHook } = this.app.bajo
|
|
5
5
|
await this.modelExists(name, true)
|
|
6
6
|
const { cloneDeep, camelCase, omit } = this.app.bajo.lib._
|
|
7
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
7
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
8
8
|
options.req = opts.req
|
|
9
|
+
options.reply = opts.reply
|
|
9
10
|
const { noHook } = options
|
|
10
11
|
const { handler, schema, driver } = await resolveMethod.call(this, name, 'record-clear', options)
|
|
11
12
|
if (!noHook) {
|
|
@@ -4,8 +4,9 @@ async function count (name, filter = {}, opts = {}) {
|
|
|
4
4
|
const { runHook } = this.app.bajo
|
|
5
5
|
const { get, set } = this.cache ?? {}
|
|
6
6
|
const { cloneDeep, camelCase, omit } = this.app.bajo.lib._
|
|
7
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
7
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
8
8
|
options.req = opts.req
|
|
9
|
+
options.reply = opts.reply
|
|
9
10
|
options.dataOnly = options.dataOnly ?? true
|
|
10
11
|
let { dataOnly, noHook, noCache } = options
|
|
11
12
|
options.dataOnly = false
|
|
@@ -9,8 +9,9 @@ async function create (name, input, opts = {}) {
|
|
|
9
9
|
const { generateId, runHook, isSet } = this.app.bajo
|
|
10
10
|
const { clearModel } = this.cache ?? {}
|
|
11
11
|
const { find, forOwn, cloneDeep, camelCase, omit, get, pick } = this.app.bajo.lib._
|
|
12
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
12
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
13
13
|
options.req = opts.req
|
|
14
|
+
options.reply = opts.reply
|
|
14
15
|
options.dataOnly = options.dataOnly ?? true
|
|
15
16
|
input = cloneDeep(input)
|
|
16
17
|
const { fields, dataOnly, noHook, noValidation, noCheckUnique, noFeatureHook, noResult, noSanitize, hidden, forceNoHidden } = options
|
|
@@ -5,8 +5,9 @@ async function findOne (name, filter = {}, opts = {}) {
|
|
|
5
5
|
const { runHook, isSet } = this.app.bajo
|
|
6
6
|
const { get, set } = this.cache ?? {}
|
|
7
7
|
const { cloneDeep, camelCase, omit } = this.app.bajo.lib._
|
|
8
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
8
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
9
9
|
options.req = opts.req
|
|
10
|
+
options.reply = opts.reply
|
|
10
11
|
options.dataOnly = options.dataOnly ?? true
|
|
11
12
|
let { fields, dataOnly, noHook, noCache, hidden, forceNoHidden } = options
|
|
12
13
|
options.count = false
|
|
@@ -5,8 +5,9 @@ async function find (name, filter = {}, opts = {}) {
|
|
|
5
5
|
const { runHook, isSet } = this.app.bajo
|
|
6
6
|
const { get, set } = this.cache ?? {}
|
|
7
7
|
const { cloneDeep, camelCase, omit } = this.app.bajo.lib._
|
|
8
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
8
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
9
9
|
options.req = opts.req
|
|
10
|
+
options.reply = opts.reply
|
|
10
11
|
options.dataOnly = options.dataOnly ?? true
|
|
11
12
|
let { fields, dataOnly, noHook, noCache, hidden, forceNoHidden } = options
|
|
12
13
|
options.count = options.count ?? false
|
|
@@ -5,8 +5,9 @@ async function get (name, id, opts = {}) {
|
|
|
5
5
|
const { runHook, isSet } = this.app.bajo
|
|
6
6
|
const { get, set } = this.cache ?? {}
|
|
7
7
|
const { cloneDeep, camelCase, omit } = this.app.bajo.lib._
|
|
8
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
8
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
9
9
|
options.req = opts.req
|
|
10
|
+
options.reply = opts.reply
|
|
10
11
|
options.dataOnly = options.dataOnly ?? true
|
|
11
12
|
let { fields, dataOnly, noHook, noCache, hidden = [], forceNoHidden } = options
|
|
12
13
|
await this.modelExists(name, true)
|
|
@@ -5,8 +5,9 @@ async function remove (name, id, opts = {}) {
|
|
|
5
5
|
const { runHook } = this.app.bajo
|
|
6
6
|
const { clearModel } = this.cache ?? {}
|
|
7
7
|
const { cloneDeep, camelCase, omit } = this.app.bajo.lib._
|
|
8
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
8
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
9
9
|
options.req = opts.req
|
|
10
|
+
options.reply = opts.reply
|
|
10
11
|
options.dataOnly = options.dataOnly ?? true
|
|
11
12
|
const { fields, dataOnly, noHook, noResult, hidden, forceNoHidden } = options
|
|
12
13
|
options.dataOnly = false
|
|
@@ -8,8 +8,9 @@ async function update (name, id, input, opts = {}) {
|
|
|
8
8
|
const { runHook, isSet } = this.app.bajo
|
|
9
9
|
const { clearModel } = this.cache ?? {}
|
|
10
10
|
const { forOwn, find, cloneDeep, camelCase, omit, get } = this.app.bajo.lib._
|
|
11
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
11
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
12
12
|
options.req = opts.req
|
|
13
|
+
options.reply = opts.reply
|
|
13
14
|
options.dataOnly = options.dataOnly ?? true
|
|
14
15
|
input = cloneDeep(input)
|
|
15
16
|
const { fields, dataOnly, noHook, noValidation, noCheckUnique, noFeatureHook, noResult, noSanitize, partial = true, hidden, forceNoHidden } = options
|
|
@@ -2,8 +2,9 @@ async function upsert (name, input, opts = {}) {
|
|
|
2
2
|
const { generateId } = this.app.bajo
|
|
3
3
|
const { find } = this.app.bajo.lib._
|
|
4
4
|
const { cloneDeep, omit } = this.app.bajo.lib._
|
|
5
|
-
const options = cloneDeep(omit(opts, ['req']))
|
|
5
|
+
const options = cloneDeep(omit(opts, ['req', 'reply']))
|
|
6
6
|
options.req = opts.req
|
|
7
|
+
options.reply = opts.reply
|
|
7
8
|
options.dataOnly = options.dataOnly ?? true
|
|
8
9
|
await this.modelExists(name, true)
|
|
9
10
|
const { schema } = this.getInfo(name)
|
package/lib/collect-schemas.js
CHANGED
|
@@ -30,7 +30,8 @@ async function handler ({ file, alias, ns }) {
|
|
|
30
30
|
})
|
|
31
31
|
}
|
|
32
32
|
mod.feature = feats
|
|
33
|
-
|
|
33
|
+
mod.properties = mod.properties ?? []
|
|
34
|
+
// if ((mod.properties ?? []).length === 0) this.fatal('noPropsFoundOnSchema%s', mod.name)
|
|
34
35
|
// schema extender
|
|
35
36
|
await eachPlugins(async function (opts) {
|
|
36
37
|
const glob = `${opts.dir}/dobo/extend/${mod.ns}/schema/${base}.*`
|