sumba 2.25.1 → 2.26.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.js +430 -0
- package/extend/dobo/model.js +215 -0
- package/extend/dobo/model.json +214 -0
- package/package.json +1 -1
- package/wiki/CHANGES.md +5 -0
- package/extend/bajo/hook/bajo.extend@after-read-config.js +0 -13
- package/extend/bajo/hook/dobo.sumba-attrib-guard$dobo.sumba-x-attrib-guard@after-transaction.js +0 -6
- package/extend/bajo/hook/dobo.sumba-contact-form@after-create-record.js +0 -17
- package/extend/bajo/hook/dobo.sumba-contact-form@before-create-record.js +0 -16
- package/extend/bajo/hook/dobo.sumba-model-guard$dobo.sumba-x-model-guard@after-transaction.js +0 -6
- package/extend/bajo/hook/dobo.sumba-route-guard$dobo.sumba-x-route-guard@after-transaction.js +0 -6
- package/extend/bajo/hook/dobo.sumba-site@after-create-record.js +0 -8
- package/extend/bajo/hook/dobo.sumba-site@after-remove-record.js +0 -9
- package/extend/bajo/hook/dobo.sumba-site@after-update-record.js +0 -14
- package/extend/bajo/hook/dobo.sumba-team$dobo.sumba-site@after-transaction.js +0 -8
- package/extend/bajo/hook/dobo.sumba-user@after-create-record.js +0 -15
- package/extend/bajo/hook/dobo.sumba-user@after-record-validation.js +0 -8
- package/extend/bajo/hook/dobo.sumba-user@after-remove-record.js +0 -7
- package/extend/bajo/hook/dobo.sumba-user@after-update-record.js +0 -44
- package/extend/bajo/hook/dobo.sumba-user@before-create-record.js +0 -7
- package/extend/bajo/hook/dobo.sumba-user@before-record-validation.js +0 -8
- package/extend/bajo/hook/dobo.sumba-user@before-update-record.js +0 -9
- package/extend/bajo/hook/dobo@before-count-record.js +0 -8
- package/extend/bajo/hook/dobo@before-driver-create-record.js +0 -17
- package/extend/bajo/hook/dobo@before-driver-find-all-record.js +0 -8
- package/extend/bajo/hook/dobo@before-driver-find-record.js +0 -133
- package/extend/bajo/hook/dobo@before-driver-get-record.js +0 -23
- package/extend/bajo/hook/dobo@before-driver-remove-record.js +0 -10
- package/extend/bajo/hook/dobo@before-driver-update-record.js +0 -10
- package/extend/bajo/hook/waibu-mpa.sumba@after-build-locals.js +0 -19
- package/extend/bajo/hook/waibu-mpa@pre-parsing.js +0 -15
- package/extend/bajo/hook/waibu-rest-api@pre-parsing.js +0 -13
- package/extend/bajo/hook/waibu-static@pre-parsing.js +0 -13
- package/extend/bajo/hook/waibu@after-app-boot.js +0 -7
- package/extend/bajo/hook/waibu@after-create-context.js +0 -5
- package/extend/bajo/hook/waibu@pre-parsing.js +0 -9
- package/extend/dobo/model/attrib-guard.js +0 -32
- package/extend/dobo/model/contact-form-cat.json +0 -3
- package/extend/dobo/model/contact-form.json +0 -16
- package/extend/dobo/model/download.json +0 -19
- package/extend/dobo/model/model-guard.js +0 -48
- package/extend/dobo/model/route-guard.js +0 -48
- package/extend/dobo/model/site-setting.json +0 -16
- package/extend/dobo/model/site.json +0 -45
- package/extend/dobo/model/team-setting.json +0 -17
- package/extend/dobo/model/team-user.json +0 -16
- package/extend/dobo/model/team.json +0 -23
- package/extend/dobo/model/ticket-cat.json +0 -3
- package/extend/dobo/model/ticket-detail.json +0 -7
- package/extend/dobo/model/ticket.json +0 -31
- package/extend/dobo/model/user-setting.json +0 -17
- package/extend/dobo/model/user.js +0 -84
- package/extend/dobo/model/x-attrib-guard.js +0 -14
- package/extend/dobo/model/x-model-guard.js +0 -13
- package/extend/dobo/model/x-route-guard.js +0 -13
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { checker } from './dobo@before-driver-get-record.js'
|
|
2
|
-
|
|
3
|
-
const doboBeforeDriverUpdateRecord = {
|
|
4
|
-
level: 1000,
|
|
5
|
-
handler: async function (model, id, body, options = {}) {
|
|
6
|
-
await checker.call(this, model, id, options)
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default doboBeforeDriverUpdateRecord
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
async function afterBuildLocals (locals, req) {
|
|
2
|
-
const { routePath } = this.app.waibu
|
|
3
|
-
const items = []
|
|
4
|
-
if (req.user) {
|
|
5
|
-
items.push({ icon: 'person', 't:tooltip': 'yourProfile', href: routePath('sumba:/your-stuff/profile') })
|
|
6
|
-
items.push({ icon: 'key', 't:tooltip': 'changePassword', href: routePath('sumba:/your-stuff/change-password') })
|
|
7
|
-
items.push({ component: 'navItemSignout', 't:tooltip': 'signout', bottom: true })
|
|
8
|
-
} else {
|
|
9
|
-
items.push({ icon: 'signin', 't:tooltip': 'signin', href: routePath('sumba:/signin') })
|
|
10
|
-
items.push({ icon: 'key', 't:tooltip': 'forgotPassword', href: routePath('sumba:/user/forgot-password') })
|
|
11
|
-
items.push({ icon: 'personAdd', 't:tooltip': 'newUserSignup', href: routePath('sumba:/user/signup') })
|
|
12
|
-
}
|
|
13
|
-
items.push({ divider: true })
|
|
14
|
-
items.push({ icon: 'envelope', 't:tooltip': 'contactForm', href: routePath('sumba:/help/contact-form') })
|
|
15
|
-
items.push({ icon: 'chat', 't:tooltip': 'troubleTickets', href: routePath('sumba:/help/trouble-tickets') })
|
|
16
|
-
locals.sidebar = items
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default afterBuildLocals
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { checkUserId, checkTeam, checkTheme, checkIconset, checkXSite } from '../../../lib/util.js'
|
|
2
|
-
|
|
3
|
-
const preParsing = {
|
|
4
|
-
level: 10,
|
|
5
|
-
handler: async function (req, reply) {
|
|
6
|
-
await checkTheme.call(this, req, reply)
|
|
7
|
-
await checkIconset.call(this, req, reply)
|
|
8
|
-
const secure = await checkUserId.call(this, req, reply, 'waibuMpa')
|
|
9
|
-
if (!secure) return
|
|
10
|
-
await checkTeam.call(this, req, reply, secure)
|
|
11
|
-
await checkXSite.call(this, req, reply)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default preParsing
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { checkUserId, checkTeam, checkXSite } from '../../../lib/util.js'
|
|
2
|
-
|
|
3
|
-
const preParsing = {
|
|
4
|
-
level: 10,
|
|
5
|
-
handler: async function (req, reply) {
|
|
6
|
-
const secure = await checkUserId.call(this, req, reply, 'waibuRestApi')
|
|
7
|
-
if (!secure) return
|
|
8
|
-
await checkTeam.call(this, req, reply, secure)
|
|
9
|
-
await checkXSite.call(this, req, reply)
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default preParsing
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { checkUserId, checkTeam, checkXSite } from '../../../lib/util.js'
|
|
2
|
-
|
|
3
|
-
const preParsing = {
|
|
4
|
-
level: 10,
|
|
5
|
-
handler: async function (req, reply) {
|
|
6
|
-
const secure = await checkUserId.call(this, req, reply, 'waibuStatic')
|
|
7
|
-
if (!secure) return
|
|
8
|
-
await checkTeam.call(this, req, reply, secure)
|
|
9
|
-
await checkXSite.call(this, req, reply)
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default preParsing
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { buildEnd, options } from './model-guard.js'
|
|
2
|
-
|
|
3
|
-
export const properties = [
|
|
4
|
-
{
|
|
5
|
-
name: 'models',
|
|
6
|
-
type: 'array',
|
|
7
|
-
required: true
|
|
8
|
-
},
|
|
9
|
-
'hiddenCols,array',
|
|
10
|
-
'siteId,sumba:siteId',
|
|
11
|
-
'teamIds,sumba:teamIds'
|
|
12
|
-
]
|
|
13
|
-
|
|
14
|
-
export const features = [
|
|
15
|
-
{
|
|
16
|
-
name: 'sumba:status',
|
|
17
|
-
values: ['ACTIVE', 'INACTIVE'],
|
|
18
|
-
default: 'ACTIVE'
|
|
19
|
-
},
|
|
20
|
-
'dobo:updatedAt'
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
async function routeGuard () {
|
|
24
|
-
return {
|
|
25
|
-
properties,
|
|
26
|
-
features,
|
|
27
|
-
options,
|
|
28
|
-
buildEnd
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default routeGuard
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"properties": [
|
|
3
|
-
"firstName,,50,true,true",
|
|
4
|
-
"lastName,,50,true,true",
|
|
5
|
-
"email,,50,true,true",
|
|
6
|
-
"category,,50,true",
|
|
7
|
-
"subject,,255,,true",
|
|
8
|
-
"message,text"
|
|
9
|
-
],
|
|
10
|
-
"features": [{
|
|
11
|
-
"name": "sumba:status",
|
|
12
|
-
"default": "NEW",
|
|
13
|
-
"values": ["NEW", "ACK"]
|
|
14
|
-
}, "sumba:userId", "sumba:siteId", "dobo:createdAt", "dobo:updatedAt"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"properties": [
|
|
3
|
-
"description,,50,true",
|
|
4
|
-
"file,text,,,true",
|
|
5
|
-
"type,,20,true",
|
|
6
|
-
"jobQueue,object",
|
|
7
|
-
{
|
|
8
|
-
"name": "size",
|
|
9
|
-
"type": "integer",
|
|
10
|
-
"default": 0,
|
|
11
|
-
"index": true
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"features": ["sumba:siteId", "sumba:userId", "dobo:createdAt", "dobo:updatedAt", {
|
|
15
|
-
"name": "sumba:status",
|
|
16
|
-
"default": "INQUEUE",
|
|
17
|
-
"values": ["INQUEUE", "PROCESSING", "COMPLETE", "FAIL"]
|
|
18
|
-
}]
|
|
19
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export async function buildEnd (model) {
|
|
2
|
-
const prop = model.properties.find(prop => prop.name === 'models')
|
|
3
|
-
if (prop) prop.values = this.app.sumba.getModelNames(true)
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const properties = [
|
|
7
|
-
{
|
|
8
|
-
name: 'models',
|
|
9
|
-
type: 'array',
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
'column,,50,true,true',
|
|
13
|
-
{
|
|
14
|
-
name: 'negation',
|
|
15
|
-
type: 'boolean',
|
|
16
|
-
required: true,
|
|
17
|
-
default: false
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'status',
|
|
21
|
-
type: 'sumba:status',
|
|
22
|
-
values: ['ACTIVE', 'INACTIVE'],
|
|
23
|
-
default: 'ACTIVE'
|
|
24
|
-
},
|
|
25
|
-
'value,array,,,true',
|
|
26
|
-
'siteId,sumba:siteId',
|
|
27
|
-
'teamIds,sumba:teamIds'
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
export const options = {
|
|
31
|
-
attachment: false,
|
|
32
|
-
cache: { ttlDur: 0 }
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const features = [
|
|
36
|
-
'dobo:updatedAt'
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
async function routeGuard () {
|
|
40
|
-
return {
|
|
41
|
-
properties,
|
|
42
|
-
features,
|
|
43
|
-
options,
|
|
44
|
-
buildEnd
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default routeGuard
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { options } from './model-guard.js'
|
|
2
|
-
|
|
3
|
-
export const properties = [
|
|
4
|
-
'path,,255,true,true',
|
|
5
|
-
{
|
|
6
|
-
name: 'methods',
|
|
7
|
-
type: 'array',
|
|
8
|
-
required: true,
|
|
9
|
-
default: ['GET', 'POST', 'UPDATE', 'DELETE'],
|
|
10
|
-
values: ['GET', 'POST', 'UPDATE', 'DELETE']
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'weight',
|
|
14
|
-
type: 'smallint',
|
|
15
|
-
default: 0
|
|
16
|
-
}, {
|
|
17
|
-
name: 'negation',
|
|
18
|
-
type: 'boolean',
|
|
19
|
-
required: true,
|
|
20
|
-
default: false
|
|
21
|
-
}, {
|
|
22
|
-
name: 'anonymous',
|
|
23
|
-
type: 'boolean',
|
|
24
|
-
required: true,
|
|
25
|
-
default: false
|
|
26
|
-
},
|
|
27
|
-
'siteId,sumba:siteId',
|
|
28
|
-
'teamIds,sumba:teamIds'
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
export const features = [
|
|
32
|
-
{
|
|
33
|
-
name: 'sumba:status',
|
|
34
|
-
values: ['ACTIVE', 'INACTIVE'],
|
|
35
|
-
default: 'ACTIVE'
|
|
36
|
-
},
|
|
37
|
-
'dobo:updatedAt'
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
async function routeGuard () {
|
|
41
|
-
return {
|
|
42
|
-
properties,
|
|
43
|
-
features,
|
|
44
|
-
options
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default routeGuard
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"properties": [
|
|
3
|
-
"ns,,50,true,true",
|
|
4
|
-
"key,,255,true,true",
|
|
5
|
-
"value,text"
|
|
6
|
-
],
|
|
7
|
-
"indexes": [{
|
|
8
|
-
"fields": ["ns", "key", "siteId"],
|
|
9
|
-
"type": "unique"
|
|
10
|
-
}],
|
|
11
|
-
"features": [
|
|
12
|
-
"sumba:siteId",
|
|
13
|
-
"dobo:immutable",
|
|
14
|
-
"dobo:updatedAt"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"buildLevel": 1,
|
|
3
|
-
"properties": [{
|
|
4
|
-
"name": "hostname",
|
|
5
|
-
"type": "string",
|
|
6
|
-
"maxLength": 100,
|
|
7
|
-
"required": true,
|
|
8
|
-
"index": "unique"
|
|
9
|
-
}, {
|
|
10
|
-
"name": "alias",
|
|
11
|
-
"type": "string",
|
|
12
|
-
"maxLength": 100,
|
|
13
|
-
"index": "unique",
|
|
14
|
-
"required": true,
|
|
15
|
-
"immutable": true
|
|
16
|
-
}, {
|
|
17
|
-
"name": "title",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"maxLength": 50,
|
|
20
|
-
"required": true
|
|
21
|
-
}, {
|
|
22
|
-
"name": "orgName",
|
|
23
|
-
"type": "string",
|
|
24
|
-
"maxLength": 100,
|
|
25
|
-
"index": true
|
|
26
|
-
}, {
|
|
27
|
-
"name": "email",
|
|
28
|
-
"type": "string",
|
|
29
|
-
"maxLength": 100,
|
|
30
|
-
"rules": ["email"]
|
|
31
|
-
}],
|
|
32
|
-
"features": [
|
|
33
|
-
"sumba:personInCharge",
|
|
34
|
-
"sumba:address",
|
|
35
|
-
"sumba:social",
|
|
36
|
-
{
|
|
37
|
-
"name": "sumba:status",
|
|
38
|
-
"default": "ACTIVE"
|
|
39
|
-
},
|
|
40
|
-
"dobo:createdAt",
|
|
41
|
-
"dobo:updatedAt",
|
|
42
|
-
"dobo:immutable"
|
|
43
|
-
],
|
|
44
|
-
"scanables": ["hostname", "alias", "title", "orgName"]
|
|
45
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"buildLevel": 5,
|
|
3
|
-
"properties": [
|
|
4
|
-
"ns,,50,true,true",
|
|
5
|
-
"key,,255,true,true",
|
|
6
|
-
"value,text"
|
|
7
|
-
],
|
|
8
|
-
"indexes": [{
|
|
9
|
-
"fields": ["ns", "key", "siteId", "teamId"],
|
|
10
|
-
"type": "unique"
|
|
11
|
-
}],
|
|
12
|
-
"features": [
|
|
13
|
-
"sumba:siteId",
|
|
14
|
-
"dobo:updatedAt",
|
|
15
|
-
"sumba:teamId"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"buildLevel": 4,
|
|
3
|
-
"properties": [],
|
|
4
|
-
"indexes": [{
|
|
5
|
-
"fields": ["userId", "siteId", "teamId"],
|
|
6
|
-
"type": "unique"
|
|
7
|
-
}],
|
|
8
|
-
"features": [
|
|
9
|
-
"dobo:createdAt",
|
|
10
|
-
"dobo:updatedAt",
|
|
11
|
-
"sumba:siteId",
|
|
12
|
-
"sumba:userId",
|
|
13
|
-
"sumba:teamId",
|
|
14
|
-
"dobo:immutable"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"buildLevel": 3,
|
|
3
|
-
"properties": [
|
|
4
|
-
"alias,,20,,true",
|
|
5
|
-
"name,,50,true,true"
|
|
6
|
-
],
|
|
7
|
-
"indexes": [{
|
|
8
|
-
"fields": ["alias", "siteId"],
|
|
9
|
-
"type": "unique"
|
|
10
|
-
}],
|
|
11
|
-
"features": [
|
|
12
|
-
"dobo:createdAt",
|
|
13
|
-
"dobo:updatedAt",
|
|
14
|
-
"dobo:immutable",
|
|
15
|
-
"sumba:siteId",
|
|
16
|
-
{
|
|
17
|
-
"name": "sumba:status",
|
|
18
|
-
"default": "ENABLED",
|
|
19
|
-
"values": ["ENABLED", "DISABLED"]
|
|
20
|
-
},
|
|
21
|
-
"dobo:immutable"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"properties": [
|
|
3
|
-
"subject,,255,true,true",
|
|
4
|
-
{
|
|
5
|
-
"name": "cat",
|
|
6
|
-
"type": "string",
|
|
7
|
-
"maxLength": 50,
|
|
8
|
-
"index": true,
|
|
9
|
-
"required": true,
|
|
10
|
-
"ref": {
|
|
11
|
-
"cat": {
|
|
12
|
-
"model": "SumbaTicketCat",
|
|
13
|
-
"searchField": "name",
|
|
14
|
-
"labelField": "name"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"message,text,,,true"
|
|
19
|
-
],
|
|
20
|
-
"features": [
|
|
21
|
-
"dobo:createdAt",
|
|
22
|
-
"dobo:updatedAt",
|
|
23
|
-
"sumba:siteId",
|
|
24
|
-
"sumba:userId",
|
|
25
|
-
{
|
|
26
|
-
"name": "sumba:status",
|
|
27
|
-
"default": "OPEN",
|
|
28
|
-
"values": ["OPEN", "CLOSED"]
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"buildLevel": 5,
|
|
3
|
-
"properties": [
|
|
4
|
-
"ns,,50,true,true",
|
|
5
|
-
"key,,255,true,true",
|
|
6
|
-
"value,text"
|
|
7
|
-
],
|
|
8
|
-
"indexes": [{
|
|
9
|
-
"fields": ["ns", "key", "siteId", "userId"],
|
|
10
|
-
"type": "unique"
|
|
11
|
-
}],
|
|
12
|
-
"features": [
|
|
13
|
-
"sumba:siteId",
|
|
14
|
-
"dobo:updatedAt",
|
|
15
|
-
"sumba:userId"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
async function user () {
|
|
2
|
-
return {
|
|
3
|
-
buildLevel: 2,
|
|
4
|
-
properties: [{
|
|
5
|
-
name: 'username',
|
|
6
|
-
type: 'string',
|
|
7
|
-
minLength: 5,
|
|
8
|
-
maxLength: 50,
|
|
9
|
-
rules: ['alphanum']
|
|
10
|
-
}, {
|
|
11
|
-
name: 'password',
|
|
12
|
-
type: 'string',
|
|
13
|
-
minLength: 8,
|
|
14
|
-
maxLength: 100
|
|
15
|
-
}, {
|
|
16
|
-
name: 'token',
|
|
17
|
-
type: 'string',
|
|
18
|
-
maxLength: 100,
|
|
19
|
-
index: true
|
|
20
|
-
}, {
|
|
21
|
-
name: 'salt',
|
|
22
|
-
type: 'string',
|
|
23
|
-
maxLength: 100,
|
|
24
|
-
required: true
|
|
25
|
-
}, {
|
|
26
|
-
name: 'apiKey',
|
|
27
|
-
type: 'string',
|
|
28
|
-
maxLength: 100,
|
|
29
|
-
virtual: true,
|
|
30
|
-
getValue: async function (val, rec) {
|
|
31
|
-
if (!rec.salt) return
|
|
32
|
-
return await this.plugin.hash(rec.salt)
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
name: 'provider',
|
|
36
|
-
type: 'string',
|
|
37
|
-
maxLength: 50,
|
|
38
|
-
index: true,
|
|
39
|
-
default: 'local'
|
|
40
|
-
}, {
|
|
41
|
-
name: 'email',
|
|
42
|
-
type: 'string',
|
|
43
|
-
maxLength: 100,
|
|
44
|
-
required: true,
|
|
45
|
-
rules: ['email']
|
|
46
|
-
}, {
|
|
47
|
-
name: 'firstName',
|
|
48
|
-
type: 'string',
|
|
49
|
-
maxLength: 50,
|
|
50
|
-
required: true,
|
|
51
|
-
index: true
|
|
52
|
-
}, {
|
|
53
|
-
name: 'lastName',
|
|
54
|
-
type: 'string',
|
|
55
|
-
maxLength: 50,
|
|
56
|
-
required: true,
|
|
57
|
-
index: true
|
|
58
|
-
}],
|
|
59
|
-
rules: [{ rule: 'trim', fields: ['username', 'firstName', 'lastName'] }],
|
|
60
|
-
indexes: [{
|
|
61
|
-
fields: ['username', 'siteId'],
|
|
62
|
-
type: 'unique'
|
|
63
|
-
}, {
|
|
64
|
-
fields: ['email', 'siteId'],
|
|
65
|
-
type: 'unique'
|
|
66
|
-
}],
|
|
67
|
-
hidden: ['password'],
|
|
68
|
-
features: [
|
|
69
|
-
'sumba:address',
|
|
70
|
-
'sumba:social',
|
|
71
|
-
{
|
|
72
|
-
name: 'sumba:status',
|
|
73
|
-
default: 'UNVERIFIED',
|
|
74
|
-
values: ['UNVERIFIED', 'ACTIVE', 'INACTIVE']
|
|
75
|
-
},
|
|
76
|
-
'sumba:siteId',
|
|
77
|
-
'dobo:createdAt',
|
|
78
|
-
'dobo:updatedAt',
|
|
79
|
-
'dobo:immutable'
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default user
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { properties, features } from './attrib-guard.js'
|
|
2
|
-
import { options, buildEnd } from './model-guard.js'
|
|
3
|
-
|
|
4
|
-
async function routeGuard () {
|
|
5
|
-
const { isString } = this.app.lib._
|
|
6
|
-
return {
|
|
7
|
-
properties: properties.filter(prop => !isString(prop) || (isString(prop) && !prop.startsWith('teamIds'))),
|
|
8
|
-
features: features.filter(feat => !isString(feat) || (isString(feat) && !['sumba:siteId', 'dobo:updatedAt'].includes(feat))).concat('sumba:siteIds', 'dobo:updatedAt'),
|
|
9
|
-
options,
|
|
10
|
-
buildEnd
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default routeGuard
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { buildEnd, properties, features, options } from './model-guard.js'
|
|
2
|
-
|
|
3
|
-
async function xModelGuard () {
|
|
4
|
-
const { isString } = this.app.lib._
|
|
5
|
-
return {
|
|
6
|
-
properties: properties.filter(prop => !isString(prop) || (isString(prop) && !prop.startsWith('teamIds'))),
|
|
7
|
-
features: features.filter(feat => !isString(feat) || (isString(feat) && !['sumba:siteId', 'dobo:updatedAt'].includes(feat))).concat('sumba:siteIds', 'dobo:updatedAt'),
|
|
8
|
-
options,
|
|
9
|
-
buildEnd
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default xModelGuard
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { properties, features } from './route-guard.js'
|
|
2
|
-
import { options } from './model-guard.js'
|
|
3
|
-
|
|
4
|
-
async function xRouteGuard () {
|
|
5
|
-
const { isString } = this.app.lib._
|
|
6
|
-
return {
|
|
7
|
-
properties: properties.filter(prop => !isString(prop) || (isString(prop) && !prop.startsWith('teamIds'))),
|
|
8
|
-
features: features.filter(feat => !isString(feat) || (isString(feat) && !['sumba:siteId', 'dobo:updatedAt'].includes(feat))).concat('sumba:siteIds', 'dobo:updatedAt'),
|
|
9
|
-
options
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default xRouteGuard
|