-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathschemas.controller.js
More file actions
269 lines (229 loc) · 9.99 KB
/
Copy pathschemas.controller.js
File metadata and controls
269 lines (229 loc) · 9.99 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// Schemas relating to CVE records
async function getCreateCveRecordResponseSchema (req, res) {
const createCveRecordResponseSchema = require('../../../schemas/cve/create-cve-record-response.json')
res.json(createCveRecordResponseSchema)
res.status(200)
}
async function getCreateCveRecordRejectionRequestSchema (req, res) {
const createCveRecordRejectionRequestSchema = require('../../../schemas/cve/create-cve-record-rejection-request.json')
res.json(createCveRecordRejectionRequestSchema)
res.status(200)
}
async function getCreateCveRecordRejectionResponseSchema (req, res) {
const createCveRecordRejectionResponseSchema = require('../../../schemas/cve/create-cve-record-rejection-response.json')
res.json(createCveRecordRejectionResponseSchema)
res.status(200)
}
async function getUpdateCveRecordRejectionRequestSchema (req, res) {
const updateCveRecordRejectionRequestSchema = require('../../../schemas/cve/update-cve-record-rejection-request.json')
res.json(updateCveRecordRejectionRequestSchema)
res.status(200)
}
async function getUpdateCveRecordRejectionResponseSchema (req, res) {
const updateCveRecordRejectionResponseSchema = require('../../../schemas/cve/update-cve-record-rejection-response.json')
res.json(updateCveRecordRejectionResponseSchema)
res.status(200)
}
async function getCveRecordMinimumSchema (req, res) {
const cveRecordMinimumSchema = require('../../../schemas/cve/cve-record-minimum-request.json')
res.json(cveRecordMinimumSchema)
res.status(200)
}
async function getCveRecordResponseSchema (req, res) {
const cveRecordSchema = require('../../../schemas/cve/get-cve-record-response.json')
res.json(cveRecordSchema)
res.status(200)
}
async function getFullCveRecordRequestSchema (req, res) {
const getFullCveRecordRequestSchema = require('../../../schemas/cve/create-full-cve-record-request.json')
res.json(getFullCveRecordRequestSchema)
res.status(200)
}
async function getFullUpdateCveRecordResponseSchema (req, res) {
const getFullUpdateCveRecordResponseSchema = require('../../../schemas/cve/update-full-cve-record-response.json')
res.json(getFullUpdateCveRecordResponseSchema)
res.status(200)
}
async function getListCveRecordsResponseSchema (req, res) {
const listCveRecordsSchema = require('../../../schemas/cve/list-cve-records-response.json')
res.json(listCveRecordsSchema)
res.status(200)
}
async function getCursorCveRecordsResponseSchema (req, res) {
const cursorCveRecordsSchema = require('../../../schemas/cve/cursor-cve-records-response.json')
res.json(cursorCveRecordsSchema)
res.status(200)
}
async function getUpdateCveRecordResponseSchema (req, res) {
const updateCveRecordResponseSchema = require('../../../schemas/cve/update-cve-record-response.json')
res.json(updateCveRecordResponseSchema)
res.status(200)
}
async function getAdpMinimumSchema (req, res) {
const adpMinimumSchema = require('../../../schemas/cve/adp-minimum-request.json')
res.json(adpMinimumSchema)
res.status(200)
}
async function getCnaFullSchema (req, res) {
const cnaFullSchema = require('../../../schemas/cve/create-cve-record-cna-request.json')
res.json(cnaFullSchema)
res.status(200)
}
async function getCnaMinSchema (req, res) {
const cnaMinSchema = require('../../../schemas/cve/cna-minimum-request.json')
res.json(cnaMinSchema)
res.status(200)
}
async function getAdpFullSchema (req, res) {
const adpFullSchema = require('../../../schemas/cve/create-adp-record-adp-request.json')
res.json(adpFullSchema)
res.status(200)
}
async function getCnaSecretariatFullSchema (req, res) {
const cnaFullSchemaSecretariat = require('../../../schemas/cve/create-cve-record-secretariat-request.json')
res.json(cnaFullSchemaSecretariat)
res.status(200)
}
// Schemas relating to CVE IDs
async function getCreateCveIdsResponseSchema (req, res) {
const createCveIdsResponseSchema = require('../../../schemas/cve-id/create-cve-ids-response.json')
res.json(createCveIdsResponseSchema)
res.status(200)
}
async function getCreateCveIdsPartialResponseSchema (req, res) {
const createCveIdsPartialResponseSchema = require('../../../schemas/cve-id/create-cve-ids-partial-response.json')
res.json(createCveIdsPartialResponseSchema)
res.status(200)
}
async function getCveIdResponseSchema (req, res) {
const getCveIdResponseSchema = require('../../../schemas/cve-id/get-cve-id-response.json')
res.json(getCveIdResponseSchema)
res.status(200)
}
async function getListCveIdsResponseSchema (req, res) {
const listCveIdsResponseSchema = require('../../../schemas/cve-id/list-cve-ids-response.json')
res.json(listCveIdsResponseSchema)
res.status(200)
}
async function getUpdateCVEIdResponseSchema (req, res) {
const updateCveIdsResponseSchema = require('../../../schemas/cve-id/update-cve-id-response.json')
res.json(updateCveIdsResponseSchema)
res.status(200)
}
// Schemas relating to errors
async function getBadRequestSchema (req, res) {
const badRequestSchema = require('../../../schemas/errors/bad-request.json')
res.json(badRequestSchema)
res.status(200)
}
async function getGenericErrorSchema (req, res) {
const genericErrorSchema = require('../../../schemas/errors/generic.json')
res.json(genericErrorSchema)
res.status(200)
}
// Schemas relating to organizations
async function getCreateOrgRequestSchema (req, res) {
const createOrgRequestSchema = require('../../../schemas/org/create-org-request.json')
res.json(createOrgRequestSchema)
res.status(200)
}
async function getCreateOrgResponseSchema (req, res) {
const createOrgResponseSchema = require('../../../schemas/org/create-org-response.json')
res.json(createOrgResponseSchema)
res.status(200)
}
async function getListOrgsResponseSchema (req, res) {
const listOrgsResponseSchema = require('../../../schemas/org/list-orgs-response.json')
res.json(listOrgsResponseSchema)
res.status(200)
}
async function getOrgResponseSchema (req, res) {
const getOrgResponseSchema = require('../../../schemas/org/get-org-response.json')
res.json(getOrgResponseSchema)
res.status(200)
}
async function getOrgQuotaResponseSchema (req, res) {
const getOrgQuotaResponseSchema = require('../../../schemas/org/get-org-quota-response.json')
res.json(getOrgQuotaResponseSchema)
res.status(200)
}
async function getUpdateOrgResponseSchema (req, res) {
const updateOrgResponseSchema = require('../../../schemas/org/update-org-response.json')
res.json(updateOrgResponseSchema)
res.status(200)
}
// Schemas relating to users
async function getCreateUserRequestSchema (req, res) {
const createUserRequestSchema = require('../../../schemas/user/create-user-request.json')
res.json(createUserRequestSchema)
res.status(200)
}
async function getCreateUserResponseSchema (req, res) {
const createUserResponseSchema = require('../../../schemas/user/create-user-response.json')
res.json(createUserResponseSchema)
res.status(200)
}
async function getListUsersSchema (req, res) {
const listUsersResponseSchema = require('../../../schemas/user/list-users-response.json')
res.json(listUsersResponseSchema)
res.status(200)
}
async function getUserResponseSchema (req, res) {
const getUserResponseSchema = require('../../../schemas/user/get-user-response.json')
res.json(getUserResponseSchema)
res.status(200)
}
async function getResetSecretResponseSchema (req, res) {
const resetSecretResponseSchema = require('../../../schemas/user/reset-secret-response.json')
res.json(resetSecretResponseSchema)
res.status(200)
}
async function getUpdateUserResponseSchema (req, res) {
const updateUserResponseSchema = require('../../../schemas/user/update-user-response.json')
res.json(updateUserResponseSchema)
res.status(200)
}
async function getCveCountResponseSchema (req, res) {
const cveCountResponseSchema = require('../../../schemas/cve/get-cve-record-count.json')
res.json(cveCountResponseSchema)
res.status(200)
}
module.exports = {
getBadRequestSchema: getBadRequestSchema,
getCreateCveRecordResponseSchema: getCreateCveRecordResponseSchema,
getCreateCveRecordRejectionRequestSchema: getCreateCveRecordRejectionRequestSchema,
getCreateCveRecordRejectionResponseSchema: getCreateCveRecordRejectionResponseSchema,
getUpdateCveRecordRejectionRequestSchema: getUpdateCveRecordRejectionRequestSchema,
getUpdateCveRecordRejectionResponseSchema: getUpdateCveRecordRejectionResponseSchema,
getCveRecordMinimumSchema: getCveRecordMinimumSchema,
getCveRecordResponseSchema: getCveRecordResponseSchema,
getFullCveRecordRequestSchema: getFullCveRecordRequestSchema,
getFullUpdateCveRecordResponseSchema: getFullUpdateCveRecordResponseSchema,
getListCveRecordsResponseSchema: getListCveRecordsResponseSchema,
getCursorCveRecordsResponseSchema: getCursorCveRecordsResponseSchema,
getUpdateCveRecordResponseSchema: getUpdateCveRecordResponseSchema,
getCreateCveIdsResponseSchema: getCreateCveIdsResponseSchema,
getCreateCveIdsPartialResponseSchema: getCreateCveIdsPartialResponseSchema,
getCveIdResponseSchema: getCveIdResponseSchema,
getListCveIdsResponseSchema: getListCveIdsResponseSchema,
getGenericErrorSchema: getGenericErrorSchema,
getCreateOrgRequestSchema: getCreateOrgRequestSchema,
getCreateOrgResponseSchema: getCreateOrgResponseSchema,
getListOrgsResponseSchema: getListOrgsResponseSchema,
getOrgResponseSchema: getOrgResponseSchema,
getOrgQuotaResponseSchema: getOrgQuotaResponseSchema,
getUpdateOrgResponseSchema: getUpdateOrgResponseSchema,
getCreateUserRequestSchema: getCreateUserRequestSchema,
getCreateUserResponseSchema: getCreateUserResponseSchema,
getListUsersSchema: getListUsersSchema,
getUserResponseSchema: getUserResponseSchema,
getResetSecretResponseSchema: getResetSecretResponseSchema,
getUpdateUserResponseSchema: getUpdateUserResponseSchema,
getUpdateCVEIdResponseSchema: getUpdateCVEIdResponseSchema,
getAdpMinimumSchema: getAdpMinimumSchema,
getCnaFullSchema: getCnaFullSchema,
getAdpFullSchema: getAdpFullSchema,
getCnaSecretariatFullSchema: getCnaSecretariatFullSchema,
getCnaMinSchema: getCnaMinSchema,
getCveCountResponseSchema: getCveCountResponseSchema
}