forked from appirio-tech/thurgood
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
95 lines (89 loc) · 1.92 KB
/
schema.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
86
87
88
89
90
91
92
93
94
95
/**
* Use the schema to set a field's type. This will be used for parameter parsing
* - [] or {} = json
* - new ObjectID() = MongoDB object id
* - null = any primitive type
* - any other value = this is the default value that the field will have for newly created
* documents unless it is overwritten by a parameter (will be sent as-is)
*
* Exceptions: _id, createdAt and updatedAt will be overwritten
* when the document is created so their values here don't matter
*/
var ObjectID = require('mongodb').ObjectID;
/**
* Schema document for the servers collection
* @type {Object}
*/
exports.server = {
_id: null,
createdAt: null,
installedServices: [],
instanceUrl: null,
jobId: null,
languages: [],
name: null,
operatingSystem: null,
password: null,
platform: null,
repoName: null,
status: null,
updatedAt: null,
username: null
};
/**
* Schema document for the jobs collection
* @type {Object}
*/
exports.job = {
_id: null,
codeUrl: null,
createdAt: null,
email: null,
endTime: null,
language: null,
options: [],
loggerId: new ObjectID(),
platform: null,
startTime: null,
updatedAt: null,
userId: null,
status: 'created'
};
/**
* Schema document for the apiKeys collection
* @type {Object}
*/
exports.apiKey = {
_id: null,
access_key: null,
createdAt: null,
description: null,
updatedAt: null
};
/**
* Schema document for the loggerAccounts collection
* @type {Object}
*/
exports.loggerAccount = {
_id: null,
createdAt: null,
email: null,
name: null,
papertrailApiToken: null,
papertrailId: null,
updatedAt: null
};
/**
* Schema document for the loggerSystems collection
* @type {Object}
*/
exports.loggerSystem = {
_id: null,
createdAt: null,
loggerAccountId: null,
name: null,
papertrailId: null,
syslogHostname: null,
syslogPort: null,
updatedAt: null
};