-
Notifications
You must be signed in to change notification settings - Fork 2
/
.settingsschema.js
executable file
·85 lines (80 loc) · 1.69 KB
/
.settingsschema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const SimpleSchema = require('simpl-schema')
const schema = def => new SimpleSchema(def)
const optional = type => ({ type, optional: true })
const settingsSchema = schema({
public: schema({
issueMail: String,
debug: {
type: Array,
optional: true
},
'debug.$': String,
app: schema({
name: String,
label: String,
description: String,
icon: String,
logLevel: String
}),
hosts: schema({
otulea: schema({
name: String,
debug: optional(Boolean),
url: String,
icon: String,
methods: schema({
generateUser: String,
userExists: String,
getRecords: String,
recentCompleted: String
})
}),
content: schema({
role: String
})
})
}),
// PRIVATE
oauth: schema({
clientId: String,
secret: String,
dialogUrl: String,
accessTokenUrl: String,
authorizeUrl: String,
identityUrl: String,
redirectUrl: String
}),
hosts: schema({
content: schema({
name: String,
debug: optional(Boolean),
url: String,
icon: String,
methods: schema({
getAll: String
}),
jwt: schema({
key: String,
sub: String
}),
sync: schema({
dryRun: Boolean,
dimension: Boolean,
alphaLevel: Boolean,
competency: Boolean,
competencyCategory: Boolean
})
})
}),
accounts: schema({
request: schema({
from: String,
subject: String, // TODO move to i18n
to: Array,
'to.$': SimpleSchema.RegEx.Email
})
})
})
module.exports = function (settings) {
settingsSchema.validate(settings)
}