-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.settingsschema.js
56 lines (52 loc) · 1.08 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
const SimpleSchema = require('simpl-schema')
const oauthFlows = ['authorization_code']
const schema = def => new SimpleSchema(def)
const urlField = {
type: String,
regEx: SimpleSchema.RegEx.url
}
const remoteApp = {
label: String,
name: String,
url: urlField,
icon: String,
ddpConnect: Boolean,
ddpLogin: Boolean
}
const settingsSchema = schema({
oauth: schema({
clientId: String,
secret: String,
dialogUrl: urlField,
accessTokenUrl: urlField,
authorizeUrl: urlField,
identityUrl: urlField,
redirectUrl: urlField
}),
public: schema({
app: schema({
title: String,
version: String
}),
editor: schema({
textAreaThreshold: SimpleSchema.Integer
}),
hosts: schema({
otulea: schema(remoteApp),
content: schema(remoteApp),
teacher: schema(remoteApp),
app: schema(remoteApp)
}),
tts: schema({
url: urlField
}),
pages: schema({
sessions: schema({
use: String
})
})
})
})
module.exports = function (settings) {
settingsSchema.validate(settings)
}