sumba 1.1.23 → 1.1.24

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.
@@ -10,7 +10,7 @@ async function status (opts = {}) {
10
10
  }],
11
11
  hook: {
12
12
  beforeCreate: async function ({ body }) {
13
- const { isSet } = this.app.bajo
13
+ const { isSet } = this.lib.aneka
14
14
  if (!isSet(body[opts.fieldName])) body[opts.fieldName] = opts.default
15
15
  }
16
16
  }
@@ -1,5 +1,5 @@
1
1
  async function hook (schema, body, options) {
2
- const { isSet } = this.app.bajo
2
+ const { isSet } = this.lib.aneka
3
3
  let val = body[options.fieldName]
4
4
  if (!isSet(val)) return
5
5
  const [, ...params] = val.split('://')
@@ -1,5 +1,6 @@
1
1
  async function hook (body, options) {
2
- const { round, isSet } = this.app.bajo
2
+ const { isSet } = this.lib.aneka
3
+ const { round } = this.lib.aneka
3
4
  if (!isSet(body[options.fieldName])) return
4
5
  body[options.fieldName] = round(body[options.fieldName], options.scale)
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/factory.js CHANGED
@@ -1,5 +1,5 @@
1
1
  async function getSetting (type, source) {
2
- const { defaultsDeep } = this.app.bajo
2
+ const { defaultsDeep } = this.lib.aneka
3
3
  const { get } = this.lib._
4
4
 
5
5
  const setting = defaultsDeep(get(this.config, `auth.${source}.${type}`, {}), get(this.config, `auth.common.${type}`, {}))
@@ -330,7 +330,7 @@ async function factory (pkgName) {
330
330
  }
331
331
 
332
332
  checkPathsByTeam = ({ paths = [], method = 'GET', teams = [], guards = [] }) => {
333
- const { includes } = this.app.bajo
333
+ const { includes } = this.lib.aneka
334
334
  const { outmatch } = this.lib
335
335
 
336
336
  for (const item of guards) {
@@ -377,7 +377,8 @@ async function factory (pkgName) {
377
377
  const omitted = ['status']
378
378
 
379
379
  const mergeSetting = async (site) => {
380
- const { defaultsDeep, parseObject } = this.app.bajo
380
+ const { defaultsDeep } = this.lib.aneka
381
+ const { parseObject } = this.app.bajo
381
382
  const { trim, get, filter } = this.lib._
382
383
  const { recordFind, recordGet } = this.app.dobo
383
384
  const defSetting = {}
@@ -4,8 +4,9 @@ const resetUserPassword = {
4
4
  method: ['GET', 'POST'],
5
5
  title: 'resetUserPassword',
6
6
  handler: async function (req, reply) {
7
- const { defaultsDeep, importPkg } = this.app.bajo
7
+ const { importPkg } = this.app.bajo
8
8
  const { recordFindOne, recordUpdate } = this.app.dobo
9
+ const { defaultsDeep } = this.lib.aneka
9
10
  const Joi = await importPkg('dobo:joi')
10
11
  const model = 'SumbaUser'
11
12
  const form = defaultsDeep(req.body, { username: req.query.username })
@@ -1,7 +1,7 @@
1
1
  const contactForm = {
2
2
  method: ['GET', 'POST'],
3
3
  handler: async function (req, reply) {
4
- const { defaultsDeep } = this.app.bajo
4
+ const { defaultsDeep } = this.lib.aneka
5
5
  const { pick } = this.lib._
6
6
  const { recordCreate, recordFind } = this.app.waibuDb
7
7
 
@@ -3,8 +3,8 @@ const model = 'SumbaTicket'
3
3
  const add = {
4
4
  method: ['GET', 'POST'],
5
5
  handler: async function (req, reply) {
6
+ const { defaultsDeep } = this.lib.aneka
6
7
  const { recordCreate, recordFind } = this.app.waibuDb
7
- const { defaultsDeep } = this.lib._
8
8
  const options = {}
9
9
  const form = defaultsDeep(req.body, {})
10
10
  let error
@@ -3,7 +3,7 @@ const model = 'SumbaUser'
3
3
  const userActivation = {
4
4
  method: ['GET', 'POST'],
5
5
  handler: async function (req, reply) {
6
- const { defaultsDeep } = this.app.bajo
6
+ const { defaultsDeep } = this.lib.aneka
7
7
  const { recordFind, recordUpdate } = this.app.dobo
8
8
  const form = defaultsDeep(req.body, { key: req.query.key })
9
9
  let error
@@ -19,7 +19,8 @@ const forgotPasswordLink = {
19
19
  method: ['GET', 'POST'],
20
20
  handler: async function (req, reply) {
21
21
  const { sendMail } = this.app.waibu
22
- const { defaultsDeep, importPkg } = this.app.bajo
22
+ const { defaultsDeep } = this.lib.aneka
23
+ const { importPkg } = this.app.bajo
23
24
  const { isString } = this.lib._
24
25
  const { recordUpdate } = this.app.dobo
25
26
  const Joi = await importPkg('dobo:joi')
@@ -5,7 +5,7 @@ const profile = {
5
5
  handler: async function (req, reply) {
6
6
  if (!this.app.masohiMail) return reply.view('sumba.template:/user/forgot-password.html')
7
7
  const { sendMail } = this.app.waibu
8
- const { defaultsDeep } = this.app.bajo
8
+ const { defaultsDeep } = this.lib.aneka
9
9
  const { dayjs } = this.lib
10
10
  const { recordFind } = this.app.dobo
11
11
  const form = defaultsDeep(req.body, {})
@@ -1,7 +1,8 @@
1
1
  const signup = {
2
2
  method: ['GET', 'POST'],
3
3
  handler: async function (req, reply) {
4
- const { defaultsDeep, generateId } = this.app.bajo
4
+ const { defaultsDeep } = this.lib.aneka
5
+ const { generateId } = this.app.bajo
5
6
  const { recordCreate } = this.app.waibuDb
6
7
 
7
8
  const form = defaultsDeep(req.body, {})
@@ -3,7 +3,8 @@ import passwordRule from '../../../lib/password-rule.js'
3
3
  const profile = {
4
4
  method: ['GET', 'POST'],
5
5
  handler: async function (req, reply) {
6
- const { defaultsDeep, importPkg } = this.app.bajo
6
+ const { defaultsDeep } = this.lib.aneka
7
+ const { importPkg } = this.app.bajo
7
8
  const { recordGet, recordUpdate } = this.app.dobo
8
9
  const bcrypt = await importPkg('bajoExtra:bcrypt')
9
10
  const Joi = await importPkg('dobo:joi')
@@ -1,7 +1,7 @@
1
1
  const profile = {
2
2
  method: ['GET', 'POST'],
3
3
  handler: async function (req, reply) {
4
- const { defaultsDeep } = this.app.bajo
4
+ const { defaultsDeep } = this.lib.aneka
5
5
  // const { attachmentCopyUploaded } = this.app.dobo
6
6
  const { recordUpdate, recordGet } = this.app.waibuDb
7
7
  const { omit, pick } = this.lib._
@@ -3,7 +3,8 @@ const model = 'SumbaUser'
3
3
  const resetApiKey = {
4
4
  method: ['GET', 'POST'],
5
5
  handler: async function (req, reply) {
6
- const { defaultsDeep, importPkg, generateId } = this.app.bajo
6
+ const { defaultsDeep } = this.lib.aneka
7
+ const { importPkg, generateId } = this.app.bajo
7
8
  const { recordGet, recordUpdate } = this.app.dobo
8
9
  const { hash } = this.app.bajoExtra
9
10
  const delay = await importPkg('bajo:delay')