Skip to content

Commit 15339f2

Browse files
feat: documentation (#10)
1 parent 33eb440 commit 15339f2

24 files changed

+146
-39
lines changed

app/internal/adapters/auth/jwt.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/**
2-
* @module Auth/JWT
3-
*/
1+
/** @module Auth */
42

53
import jsonwebtoken from 'jsonwebtoken';
64

@@ -27,6 +25,11 @@ const generateToken = (adminID, expiresIn, secretKey) =>
2725
*/
2826
const verifyToken = (token, secretKey) => jsonwebtoken.verify(token, secretKey);
2927

28+
/**
29+
* @namespace JWT
30+
* @memberof module:Auth
31+
* @constant
32+
*/
3033
export const JWT = {
3134
generateToken,
3235
verifyToken,

app/internal/adapters/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AuthRoute, MainRoute, UsersRoute } from './routes';
33

44
/**
55
* Adapters module containing various adapters.
6+
* @namespace
67
* @property {object} Auth - Authentication adapter.
78
* @property {object} Routes - Routes adapter.
89
*/

app/internal/adapters/routes/auth.routes.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/**
2-
* @module Routes/Auth
3-
*/
4-
51
import express from 'express';
62
import { AuthController } from '../../core/controllers';
73

84
/**
95
* Set up routes related to authentication.
6+
* @namespace Auth
107
* @function AuthRoute
118
* @param {express.Application} app - The Express application.
9+
* @memberof module:Routes
1210
*/
1311
export const AuthRoute = (app) => {
1412
const router = express.Router();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @module Routes */
12
export * from './main.routes';
23
export * from './users.routes';
34
export * from './auth.routes';

app/internal/adapters/routes/main.routes.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/**
2-
* @module Routes/Main
3-
*/
4-
51
import express from 'express';
62
import { MainController } from '../../core/controllers';
73

84
/**
95
* Set up main routes.
6+
* @namespace Main
107
* @function MainRoute
118
* @param {express.Application} app - The Express application.
9+
* @memberof module:Routes
1210
*/
1311
export const MainRoute = (app) => {
1412
const router = express.Router();

app/internal/adapters/routes/users.routes.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/**
2-
* @module Routes/Users
3-
*/
4-
51
import express from 'express';
62
import { UsersController } from '../../core/controllers';
73

84
/**
95
* Set up routes related to Users CRUD operations
6+
* @namespace Users
107
* @function UsersRoute
118
* @param {express.Application} app - The Express application.
9+
* @memberof module:Routes
1210
*/
1311
export const UsersRoute = (app) => {
1412
const router = express.Router();

app/internal/core/controllers/auth.controller.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/**
2-
* @module Controllers/Auth
3-
*/
4-
1+
/** @module Controllers */
52
import { constants } from 'http2';
63
import { AuthServices } from '../services';
74

@@ -25,6 +22,11 @@ const getToken = (req, res, next) => {
2522
}
2623
};
2724

25+
/**
26+
* @namespace AuthController
27+
* @memberof module:Controllers
28+
* @constant
29+
*/
2830
export const AuthController = {
2931
getToken,
3032
};

app/internal/core/controllers/main.controller.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/**
2-
* @module Controllers/Main
3-
*/
1+
/** @module Controllers */
42

53
import { constants } from 'http2';
64
import { MainServices } from '../services';
@@ -21,6 +19,10 @@ const healthCheck = (req, res, next) => {
2119
}
2220
};
2321

22+
/**
23+
* @namespace MainController
24+
* @constant
25+
*/
2426
export const MainController = {
2527
healthCheck,
2628
};

app/internal/core/controllers/users.controller.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
* @module Controllers/Users
3-
*/
41
import { constants } from 'http2';
52
import { UserServices } from '../services';
63

@@ -68,6 +65,11 @@ const drop = async (req, res, next) => {
6865
}
6966
};
7067

68+
/**
69+
* @namespace UsersController
70+
* @memberof module:Controllers
71+
* @constant
72+
*/
7173
export const UsersController = {
7274
getById,
7375
create,
File renamed without changes.

0 commit comments

Comments
 (0)