-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
115 lines (100 loc) · 3.02 KB
/
index.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import helpers from './src/helpers.js'
const NEOS = {
// Retrieving information from NEOS
help() {
return helpers.call('help')
},
emailHelp() {
return helpers.call('emailHelp')
},
welcome() {
return helpers.call('welcome')
},
version() {
return helpers.call('version')
},
ping() {
return helpers.call('ping')
},
printQueue() {
return helpers.call('printQueue')
},
getSolverTemplate(category, solvername, inputMethod) {
return helpers.call('getSolverTemplate', [category, solvername, inputMethod])
},
listAllSolvers() {
return helpers.call('listAllSolvers')
},
listCategories() {
return helpers.call('listCategories')
},
listSolversInCategory(category) {
return helpers.call('listSolversInCategory', [category])
},
// Submitting Jobs and Retrieving Results from NEOS
submitJob(xml) {
return helpers.call('submitJob', [xml])
},
authenticatedSubmitJob(xml, user, password) {
return helpers.call('authenticatedSubmitJob', [xml, user, password])
},
getJobStatus(jobNumber, password) {
if (typeof jobNumber === 'object') {
const credentials = jobNumber
jobNumber = credentials.jobNumber
password = credentials.password
}
return helpers.call('getJobStatus', [jobNumber, password])
},
getJobInfo(jobNumber, password) {
if (typeof jobNumber === 'object') {
const credentials = jobNumber
jobNumber = credentials.jobNumber
password = credentials.password
}
return helpers.call('getJobInfo', [jobNumber, password])
},
killJob(jobNumber, password) {
if (typeof jobNumber === 'object') {
const credentials = jobNumber
jobNumber = credentials.jobNumber
password = credentials.password
}
return helpers.call('killJob', [jobNumber, password])
},
getFinalResults(jobNumber, password) {
if (typeof jobNumber === 'object') {
const credentials = jobNumber
jobNumber = credentials.jobNumber
password = credentials.password
}
return helpers.call('getFinalResults', [jobNumber, password])
},
getIntermediateResults(jobNumber, password, offset) {
return helpers.call('getIntermediateResults', [jobNumber, password, offset])
},
getFinalResultsNonBlocking(jobNumber, password) {
if (typeof jobNumber === 'object') {
const credentials = jobNumber
jobNumber = credentials.jobNumber
password = credentials.password
}
return helpers.call('getFinalResultsNonBlocking', [jobNumber, password])
},
getIntermediateResultsNonBlocking(jobNumber, password, offset) {
return helpers.call('getIntermediateResultsNonBlocking', [jobNumber, password, offset])
},
getOutputFile(jobNumber, password, filename) {
return helpers.call('getOutputFile', [jobNumber, password, filename])
},
prepareJob(template, model, email) {
return helpers.prepareJob(template, model, email)
},
xmlstring(obj) {
return helpers.xmlstring(obj)
},
parseXML(string) {
return helpers.parseXML(string)
}
}
export default NEOS