sumba 0.3.6 → 0.3.7
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/config.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getSetting } from './api-key.js'
|
|
2
2
|
|
|
3
3
|
async function setHeader (setting, reply) {
|
|
4
|
-
const { importPkg } = this.bajo.helper
|
|
5
4
|
const { isString } = this.bajo.helper._
|
|
6
5
|
let header = setting.type
|
|
7
6
|
const exts = []
|
|
@@ -13,7 +12,7 @@ async function setHeader (setting, reply) {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
async function verifyBasic (ctx, req, reply, source) {
|
|
16
|
-
const {
|
|
15
|
+
const { print, error } = this.bajo.helper
|
|
17
16
|
const { getUserFromUsernamePassword } = this.sumba.helper
|
|
18
17
|
const { getUser } = this.sumba.helper
|
|
19
18
|
const { isEmpty } = this.bajo.helper._
|
package/bajoDb/feature/slug.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import slug from 'slug'
|
|
2
2
|
|
|
3
3
|
async function autoInc ({ schema, body, opts }) {
|
|
4
|
-
const { importPkg } = this.bajo.helper
|
|
5
4
|
const { recordFind } = this.bajoDb.helper
|
|
6
5
|
const { set, last } = this.bajo.helper._
|
|
7
6
|
const query = set({}, opts.fieldName, { $regex: new RegExp('^' + body[opts.fieldName]) })
|
|
@@ -40,7 +39,7 @@ async function mainFn (opts = {}) {
|
|
|
40
39
|
}],
|
|
41
40
|
hook: {
|
|
42
41
|
beforeCreate: async function ({ schema, body }) {
|
|
43
|
-
const {
|
|
42
|
+
const { error } = this.bajo.helper
|
|
44
43
|
const { isEmpty, isString } = this.bajo.helper._
|
|
45
44
|
if (isEmpty(body[opts.fieldName])) {
|
|
46
45
|
if (isString(opts.fieldSource)) opts.fieldSource = [opts.fieldSource]
|