Skip to content

Commit 4eb0906

Browse files
committed
missing docs
1 parent 4b0096e commit 4eb0906

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

src/routes/domain.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ router.use(logRequest);
3232
3333
We also keep our own database of domains and their status, so we can return the status of the domain quickly if it has been checked before.
3434
35-
* @tags Domain - Endpoints related to domain checking
35+
* @tags Domain - Endpoints for checking / reporting domains.
3636
* @security BearerAuth
3737
* @param {string} domain.query.required - Domain to check
3838
* @return {object} 200 - Success message
@@ -75,7 +75,7 @@ router.get("/check", authenticateToken, stripeMeter, async (req, res) => {
7575
return res
7676
.status(400)
7777
.json(
78-
"Invalid domain parameter, should be a top level domain. Ex: google.com, amazon.com"
78+
"Invalid domain parameter, should be a top level domain. Ex: google.com, amazon.com",
7979
);
8080
}
8181

@@ -115,7 +115,7 @@ router.get("/check", authenticateToken, stripeMeter, async (req, res) => {
115115
phishObserverData,
116116
urlScanData,
117117
securitytrailsData,
118-
phishreportData
118+
phishreportData,
119119
);
120120

121121
if (isPhish) {
@@ -186,19 +186,36 @@ router.get("/check", authenticateToken, stripeMeter, async (req, res) => {
186186
}
187187
});
188188

189+
/**
190+
* Classification Type
191+
* @typedef {string} ClassificationType
192+
* @enum {string}
193+
* @property {string} postal - postal
194+
* @property {string} banking - banking
195+
* @property {string} item_scams - item_scams
196+
* @property {string} other - other
197+
*/
198+
199+
/**
200+
* Domain Classification Body
201+
* @typedef {object} DomainClassification
202+
* @property {string} domain.required - Domain to classify
203+
* @property {ClassificationTyoe} classification.required - Classification to assign to the domain - eg: postal, banking, item_scams, other
204+
*/
205+
189206
/**
190207
* PUT /domain/classify
191208
* @summary Classify a domain to specific types (scam, phishing, etc.)
192209
* @description Classify a domain to specific types (scam, phishing, etc.).
193210
The classification parameter should be one of the following: "postal", "banking", "item_scams", or "other".
211+
(Check the ClassificationType enum for more information) (see swagger ui)
194212
195213
This endpoint requires TRUSTED level access. To check if you have this access run /user/me with your token.
196214
197215
To request trusted level access or a new classification type, contact Jasper via email at jasper@phish.directory or via Slack.
198-
* @tags Domain - Endpoints related to domain checking
216+
* @tags Domain - Endpoints for checking / reporting domains.
199217
* @security BearerAuth
200-
* @body {string} domain - Domain to classify
201-
* @body {string} classification - Classification to assign to the domain
218+
* @param {DomainClassification} request.body.required - Domain Classification Body
202219
* @return {object} 200 - Success message
203220
* @return {string} 400 - Error message
204221
* @example response - 200 - Success message

src/routes/email.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ router.use(express.json());
99
router.use(express.urlencoded({ extended: false }));
1010
router.use(logRequest);
1111

12+
/**
13+
* GET /email/check/:email
14+
* @summary Asynchronously checks a given email against services for any known bad emails.
15+
* @tags Email - Endpoints for checking email addresses.
16+
* @param {string} email.path.required - The email address to be checked.
17+
* @return {object} 200 - Success message
18+
*/
1219
router.get("/check/:email", async (req, res) => {
1320
const email = req.params.email;
1421

0 commit comments

Comments
 (0)