-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswagger.js
101 lines (98 loc) · 3.4 KB
/
swagger.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
const swaggerAutogen = require("swagger-autogen")();
const outputFile = "./swagger_output.json";
const endpointsFiles = ["./app.js"];
const doc = {
info: {
version: "3.0.0",
title: "Havo Express Application",
description:
"Havo Express Application Routes\n\n The backend written in Node JS for mobile application which is used to convert handwriting to speech via Machine Learning. This application is for the people who are unable to speak, by helping them save their daily conversation in the form of phrases. The server provides authentication via email OTP and JSON Web Token to help the user to secure their data. User can log on to multiple devices and stay logged in for a longer period of time.",
},
host: "havo-backend.onrender.com",
basePath: "/",
schemes: ["https"],
consumes: ["application/json"],
produces: ["application/json"],
tags: [
{
name: "API Docs",
description: "API documentation",
},
{
name: "Email",
description: "Trigger OTP and verify Email Address",
},
{
name: "User",
description: "Sign Up , Login and Logout users",
},
{
name: "User Category",
description: "User`s categories and dialogue",
},
{
name: "Login Activity",
description: "Login Activity routes",
},
],
securityDefinitions: {
api_key: {
type: "apiKey",
name: "authorization",
in: "header",
},
},
definitions: {
BlacklistToken: {
token:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxYmY3N2M4MTcwMWYwM2QxMGZkOTBlYyIsInRva2VuX2lkIjoiMzkwMk9HRUwwOTEzREFESiIsImlhdCI6MTYzOTkzNzk5Mn0.noLtLpwevdnkhFU9uOKepT2Ynd-rjnRCCeLA3yd323g",
createdAt: "1640285891286",
updatedAt: "1640285891286",
},
OTP: {
createdAt: "1640286062295",
expirationTime: "1640286062295",
otp: "XXXXXX",
verified: true,
email: "[email protected]",
},
User: {
username: "Shreyans13",
email: "[email protected]",
password: "xxxxxxxxxxxxxxxxx",
token:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxYmY3N2M4MTcwMWYwM2QxMGZkOTBlYyIsInRva2VuX2lkIjoiMzkwMk9HRUwwOTEzREFESiIsImlhdCI6MTYzOTkzNzk5Mn0.noLtLpwevdnkhFU9uOKepT2Ynd-rjnRCCeLA3yd323g",
resetPasswordToken:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxYmY3N2M4MTcwMWYwM2QxMGZkOTBlYyIsInRva2VuX2lkIjoiMzkwMk9HRUwwOTEzREFESiIsImlhdCI6MTYzOTkzNzk5Mn0.noLtLpwevdnkhFU9uOKepT2Ynd-rjnRCCeLA3yd323g",
resetPasswordExpiry:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxYmY3N2M4MTcwMWYwM2QxMGZkOTBlYyIsInRva2VuX2lkIjoiMzkwMk9HRUwwOTEzREFESiIsImlhdCI6MTYzOTkzNzk5Mn0.noLtLpwevdnkhFU9uOKepT2Ynd-rjnRCCeLA3yd323g",
categories: [
{
_id: "61c8af95598a5a9a7a56ee92",
title: "INTRO",
dialogues: ["abcd"],
},
],
},
UserLogin: {
userId: "61bcd94c9975fe02148587b1",
loggedOut: false,
loggedInAt: "1639766269396",
loggedOutAt: "1639766269396",
ipAddress: "::1",
tokenId: "8778YZFX5888JYJL",
tokenSecret: "22449244HBUBSKAF22929924JYKKLORN",
tokenDeleted: true,
device: "PostmanRuntime/7.28.4",
},
Category: {
_id: "61c8af95598a5a9b7a56ee92",
title: "INTRO",
dialogues: ["abcd"],
},
},
};
// const controlSwagger = async () => {
swaggerAutogen(outputFile, endpointsFiles, doc);
// };
// module.exports = controlSwagger;