arkos 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +10 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +114 -0
- package/dist/app.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/auth/auth.controller.d.ts +23 -0
- package/dist/modules/auth/auth.controller.d.ts.map +1 -0
- package/dist/modules/auth/auth.controller.js +317 -0
- package/dist/modules/auth/auth.controller.js.map +1 -0
- package/dist/modules/auth/auth.router.d.ts +4 -0
- package/dist/modules/auth/auth.router.d.ts.map +1 -0
- package/dist/modules/auth/auth.router.js +64 -0
- package/dist/modules/auth/auth.router.js.map +1 -0
- package/dist/modules/auth/auth.service.d.ts +16 -0
- package/dist/modules/auth/auth.service.d.ts.map +1 -0
- package/dist/modules/auth/auth.service.js +122 -0
- package/dist/modules/auth/auth.service.js.map +1 -0
- package/dist/modules/base/base.controller.d.ts +17 -0
- package/dist/modules/base/base.controller.d.ts.map +1 -0
- package/dist/modules/base/base.controller.js +296 -0
- package/dist/modules/base/base.controller.js.map +1 -0
- package/dist/modules/base/base.middlewares.d.ts +20 -0
- package/dist/modules/base/base.middlewares.d.ts.map +1 -0
- package/dist/modules/base/base.middlewares.js +86 -0
- package/dist/modules/base/base.middlewares.js.map +1 -0
- package/dist/modules/base/base.router.d.ts +4 -0
- package/dist/modules/base/base.router.d.ts.map +1 -0
- package/dist/modules/base/base.router.js +74 -0
- package/dist/modules/base/base.router.js.map +1 -0
- package/dist/modules/base/base.service.d.ts +32 -0
- package/dist/modules/base/base.service.d.ts.map +1 -0
- package/dist/modules/base/base.service.js +149 -0
- package/dist/modules/base/base.service.js.map +1 -0
- package/dist/modules/base/utils/base.helpers.d.ts +29 -0
- package/dist/modules/base/utils/base.helpers.d.ts.map +1 -0
- package/dist/modules/base/utils/base.helpers.js +106 -0
- package/dist/modules/base/utils/base.helpers.js.map +1 -0
- package/dist/modules/email/email.service.d.ts +22 -0
- package/dist/modules/email/email.service.d.ts.map +1 -0
- package/dist/modules/email/email.service.js +45 -0
- package/dist/modules/email/email.service.js.map +1 -0
- package/dist/modules/email/utils/email.helpers.d.ts +9 -0
- package/dist/modules/email/utils/email.helpers.d.ts.map +1 -0
- package/dist/modules/email/utils/email.helpers.js +25 -0
- package/dist/modules/email/utils/email.helpers.js.map +1 -0
- package/dist/modules/error-handler/error-handler.controller.d.ts +4 -0
- package/dist/modules/error-handler/error-handler.controller.d.ts.map +1 -0
- package/dist/modules/error-handler/error-handler.controller.js +182 -0
- package/dist/modules/error-handler/error-handler.controller.js.map +1 -0
- package/dist/modules/error-handler/utils/app-error.d.ts +11 -0
- package/dist/modules/error-handler/utils/app-error.d.ts.map +1 -0
- package/dist/modules/error-handler/utils/app-error.js +23 -0
- package/dist/modules/error-handler/utils/app-error.js.map +1 -0
- package/dist/modules/error-handler/utils/catch-async.d.ts +4 -0
- package/dist/modules/error-handler/utils/catch-async.d.ts.map +1 -0
- package/dist/modules/error-handler/utils/catch-async.js +9 -0
- package/dist/modules/error-handler/utils/catch-async.js.map +1 -0
- package/dist/modules/error-handler/utils/error-handler.helpers.d.ts +43 -0
- package/dist/modules/error-handler/utils/error-handler.helpers.d.ts.map +1 -0
- package/dist/modules/error-handler/utils/error-handler.helpers.js +209 -0
- package/dist/modules/error-handler/utils/error-handler.helpers.js.map +1 -0
- package/dist/modules/file-uploader/file-uploader.service.d.ts +20 -0
- package/dist/modules/file-uploader/file-uploader.service.d.ts.map +1 -0
- package/dist/modules/file-uploader/file-uploader.service.js +114 -0
- package/dist/modules/file-uploader/file-uploader.service.js.map +1 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +9 -0
- package/dist/paths.js.map +1 -0
- package/dist/utils/features/api.features.d.ts +20 -0
- package/dist/utils/features/api.features.d.ts.map +1 -0
- package/dist/utils/features/api.features.js +177 -0
- package/dist/utils/features/api.features.js.map +1 -0
- package/dist/utils/features/prisma.helpers.d.ts +3 -0
- package/dist/utils/features/prisma.helpers.d.ts.map +1 -0
- package/dist/utils/features/prisma.helpers.js +20 -0
- package/dist/utils/features/prisma.helpers.js.map +1 -0
- package/dist/utils/helpers/api.features.helpers.d.ts +41 -0
- package/dist/utils/helpers/api.features.helpers.d.ts.map +1 -0
- package/dist/utils/helpers/api.features.helpers.js +161 -0
- package/dist/utils/helpers/api.features.helpers.js.map +1 -0
- package/dist/utils/helpers/models.helpers.d.ts +21 -0
- package/dist/utils/helpers/models.helpers.d.ts.map +1 -0
- package/dist/utils/helpers/models.helpers.js +195 -0
- package/dist/utils/helpers/models.helpers.js.map +1 -0
- package/dist/utils/helpers/text.helpers.d.ts +2 -0
- package/dist/utils/helpers/text.helpers.d.ts.map +1 -0
- package/dist/utils/helpers/text.helpers.js +12 -0
- package/dist/utils/helpers/text.helpers.js.map +1 -0
- package/dist/utils/permissions/index.d.ts +3 -0
- package/dist/utils/permissions/index.d.ts.map +1 -0
- package/dist/utils/permissions/index.js +17 -0
- package/dist/utils/permissions/index.js.map +1 -0
- package/dist/utils/scripts/export-prisma-types.d.ts +2 -0
- package/dist/utils/scripts/export-prisma-types.d.ts.map +1 -0
- package/dist/utils/scripts/export-prisma-types.js +152 -0
- package/dist/utils/scripts/export-prisma-types.js.map +1 -0
- package/dist/utils/scripts/generate-zod-schemas.d.ts +2 -0
- package/dist/utils/scripts/generate-zod-schemas.d.ts.map +1 -0
- package/dist/utils/scripts/generate-zod-schemas.js +121 -0
- package/dist/utils/scripts/generate-zod-schemas.js.map +1 -0
- package/dist/utils/scripts/prisma-db-push.d.ts +2 -0
- package/dist/utils/scripts/prisma-db-push.d.ts.map +1 -0
- package/dist/utils/scripts/prisma-db-push.js +24 -0
- package/dist/utils/scripts/prisma-db-push.js.map +1 -0
- package/dist/utils/validate-dto.d.ts +3 -0
- package/dist/utils/validate-dto.d.ts.map +1 -0
- package/dist/utils/validate-dto.js +17 -0
- package/dist/utils/validate-dto.js.map +1 -0
- package/package.json +1 -1
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
export type InitConfigs = {
|
|
3
|
+
prisma: any;
|
|
4
|
+
port?: number;
|
|
5
|
+
authentication?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare let initConfigs: InitConfigs;
|
|
8
|
+
export declare function bootstrap(app: express.Express, configs: InitConfigs): express.Express;
|
|
9
|
+
export { initConfigs };
|
|
10
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AA4B9B,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,QAAA,IAAI,WAAW,EAAE,WAAW,CAAC;AAE7B,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,mBA+DnE;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.initConfigs = void 0;
|
|
40
|
+
exports.bootstrap = bootstrap;
|
|
41
|
+
const express_1 = __importDefault(require("express"));
|
|
42
|
+
const body_parser_1 = __importDefault(require("body-parser"));
|
|
43
|
+
const cors_1 = __importDefault(require("cors"));
|
|
44
|
+
const cookie_parser_1 = __importDefault(require("cookie-parser"));
|
|
45
|
+
const express_query_parser_1 = require("express-query-parser");
|
|
46
|
+
const auth_router_1 = __importDefault(require("./modules/auth/auth.router"));
|
|
47
|
+
const base_router_1 = __importDefault(require("./modules/base/base.router"));
|
|
48
|
+
const error_handler_controller_1 = __importDefault(require("./modules/error-handler/error-handler.controller"));
|
|
49
|
+
const express_rate_limit_1 = require("express-rate-limit");
|
|
50
|
+
const path_1 = __importDefault(require("path"));
|
|
51
|
+
const dotenv = __importStar(require("dotenv"));
|
|
52
|
+
const compression_1 = __importDefault(require("compression"));
|
|
53
|
+
const base_middlewares_1 = require("./modules/base/base.middlewares");
|
|
54
|
+
const prisma_helpers_1 = require("./utils/features/prisma.helpers");
|
|
55
|
+
const ENV = process.env.NODE_ENV || "development";
|
|
56
|
+
let envPath = ".env";
|
|
57
|
+
if (ENV === "production") {
|
|
58
|
+
envPath = path_1.default.resolve(process.cwd(), ".env.production");
|
|
59
|
+
}
|
|
60
|
+
else if (ENV === "staging") {
|
|
61
|
+
envPath = path_1.default.resolve(process.cwd(), ".env.staging");
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
envPath = path_1.default.resolve(process.cwd(), ".env.development");
|
|
65
|
+
}
|
|
66
|
+
dotenv.config({ path: envPath });
|
|
67
|
+
let initConfigs;
|
|
68
|
+
function bootstrap(app, configs) {
|
|
69
|
+
exports.initConfigs = initConfigs = configs;
|
|
70
|
+
app.use((0, compression_1.default)());
|
|
71
|
+
const limiter = (0, express_rate_limit_1.rateLimit)({
|
|
72
|
+
windowMs: 60 * 1000,
|
|
73
|
+
limit: 1000,
|
|
74
|
+
standardHeaders: "draft-7",
|
|
75
|
+
legacyHeaders: false,
|
|
76
|
+
});
|
|
77
|
+
app.use(limiter);
|
|
78
|
+
app.set("trust proxy", 1);
|
|
79
|
+
app.use("/api/uploads", express_1.default.static(path_1.default.join("uploads"), {
|
|
80
|
+
maxAge: "1y",
|
|
81
|
+
etag: true,
|
|
82
|
+
lastModified: true,
|
|
83
|
+
dotfiles: "ignore",
|
|
84
|
+
fallthrough: true,
|
|
85
|
+
index: false,
|
|
86
|
+
cacheControl: true,
|
|
87
|
+
}));
|
|
88
|
+
app.use((0, cors_1.default)({
|
|
89
|
+
origin: (origin, callback) => {
|
|
90
|
+
callback(null, true);
|
|
91
|
+
},
|
|
92
|
+
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTION"],
|
|
93
|
+
allowedHeaders: ["Content-Type", "Authorization", "Connection"],
|
|
94
|
+
credentials: true,
|
|
95
|
+
}));
|
|
96
|
+
app.use(express_1.default.json());
|
|
97
|
+
app.use(body_parser_1.default.json());
|
|
98
|
+
app.use((0, cookie_parser_1.default)());
|
|
99
|
+
app.use((0, express_query_parser_1.queryParser)({
|
|
100
|
+
parseNull: true,
|
|
101
|
+
parseUndefined: true,
|
|
102
|
+
parseBoolean: true,
|
|
103
|
+
parseNumber: true,
|
|
104
|
+
}));
|
|
105
|
+
app.use((0, prisma_helpers_1.checkDatabaseConnection)(initConfigs.prisma));
|
|
106
|
+
// const specs = swaggerJsdoc(options)
|
|
107
|
+
app.use(base_middlewares_1.handleRequestLogs);
|
|
108
|
+
if (configs.authentication)
|
|
109
|
+
app.use("/api", auth_router_1.default);
|
|
110
|
+
app.use("/api", base_router_1.default);
|
|
111
|
+
app.use(error_handler_controller_1.default);
|
|
112
|
+
return app;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,8BA+DC;AAnGD,sDAA8B;AAC9B,8DAAqC;AACrC,gDAAwB;AACxB,kEAAyC;AACzC,+DAAmD;AACnD,6EAAoD;AACpD,6EAAoD;AACpD,gHAA4E;AAC5E,2DAA+C;AAC/C,gDAAwB;AACxB,+CAAiC;AACjC,8DAAsC;AACtC,sEAAoE;AACpE,oEAA0E;AAE1E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,IAAI,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ServerResponse } from "http";
|
|
2
|
+
import { Express } from "express";
|
|
3
|
+
import { InitConfigs } from "./app";
|
|
4
|
+
declare let server: Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
5
|
+
declare let app: Express;
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the application server.
|
|
8
|
+
*
|
|
9
|
+
* This function starts the server by listening on a specified port.
|
|
10
|
+
* The port is determined by the following order of precedence:
|
|
11
|
+
* 1. The `PORT` environment variable.
|
|
12
|
+
* 2. The `port` argument passed to the function.
|
|
13
|
+
* 3. Defaults to `3000` if neither is provided.
|
|
14
|
+
*
|
|
15
|
+
* @param {Express} app - express app.
|
|
16
|
+
* @param {InitConfigs} initConfigs - initial configs for the api (prisma, authentication, port).
|
|
17
|
+
* @returns {void} This function does not return a value.
|
|
18
|
+
*/
|
|
19
|
+
declare function initApp(app: Express, initConfigs: InitConfigs): void;
|
|
20
|
+
export { server, app, initApp };
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAa,WAAW,EAAE,MAAM,OAAO,CAAC;AAS/C,QAAA,IAAI,MAAM,EAAE,MAAM,CAAC,OAAO,eAAe,EAAE,OAAO,cAAc,CAAC,CAAC;AAClE,QAAA,IAAI,GAAG,EAAE,OAAO,CAAC;AAEjB;;;;;;;;;;;;GAYG;AACH,iBAAS,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAa7D;AAiBD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.app = exports.server = void 0;
|
|
4
|
+
exports.initApp = initApp;
|
|
5
|
+
const app_1 = require("./app");
|
|
6
|
+
process.on("uncaughtException", (err) => {
|
|
7
|
+
console.error("UNCAUGHT EXCEPTION! SHUTTING DOWN...");
|
|
8
|
+
console.error(err.name, err.message);
|
|
9
|
+
console.error(err);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
12
|
+
let server;
|
|
13
|
+
let app;
|
|
14
|
+
/**
|
|
15
|
+
* Initializes the application server.
|
|
16
|
+
*
|
|
17
|
+
* This function starts the server by listening on a specified port.
|
|
18
|
+
* The port is determined by the following order of precedence:
|
|
19
|
+
* 1. The `PORT` environment variable.
|
|
20
|
+
* 2. The `port` argument passed to the function.
|
|
21
|
+
* 3. Defaults to `3000` if neither is provided.
|
|
22
|
+
*
|
|
23
|
+
* @param {Express} app - express app.
|
|
24
|
+
* @param {InitConfigs} initConfigs - initial configs for the api (prisma, authentication, port).
|
|
25
|
+
* @returns {void} This function does not return a value.
|
|
26
|
+
*/
|
|
27
|
+
function initApp(app, initConfigs) {
|
|
28
|
+
const port = initConfigs.port || Number(process.env.PORT) || 8000;
|
|
29
|
+
const application = (0, app_1.bootstrap)(app, {
|
|
30
|
+
authentication: false,
|
|
31
|
+
prisma: {},
|
|
32
|
+
});
|
|
33
|
+
exports.server = server = application.listen(port, () => {
|
|
34
|
+
const time = new Date().toTimeString().split(" ")[0];
|
|
35
|
+
console.info(`[\x1b[32mREADY\x1b[0m] \x1b[90m${time}\x1b[0m App running on port \x1b[33m${port}\x1b[0m, server waiting on http://localhost:${port}`);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
process.on("unhandledRejection", (err) => {
|
|
39
|
+
console.error("UNHANDLED REJECTION! SHUTTING DOWN...");
|
|
40
|
+
console.error(err.name, err.message);
|
|
41
|
+
server.close(() => {
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
process.on("SIGTERM", () => {
|
|
46
|
+
console.error("👋🏽 SIGTERM RECEIVED. Shutting down gracefully!");
|
|
47
|
+
server.close(() => {
|
|
48
|
+
console.error("🔥 Process terminated");
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA0DsB,0BAAO;AAvD7B,+BAA+C;AAE/C,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;IACtC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,IAAI,MAA6D,CAAC;AAClE,IAAI,GAAY,CAAC;AAEjB;;;;;;;;;;;;GAYG;AACH,SAAS,OAAO,CAAC,GAAY,EAAE,WAAwB;IACrD,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAClE,MAAM,WAAW,GAAG,IAAA,eAAS,EAAC,GAAG,EAAE;QACjC,cAAc,EAAE,KAAK;QACrB,MAAM,EAAE,EAAS;KAClB,CAAC,CAAC;IAEH,iBAAA,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACrC,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CACV,kCAAkC,IAAI,uCAAuC,IAAI,+CAA+C,IAAI,EAAE,CACvI,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,GAAa,EAAE,EAAE;IACjD,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACvD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from 'express';
|
|
2
|
+
export declare const excludedUserFields: {
|
|
3
|
+
password: boolean;
|
|
4
|
+
passwordChangedAt: boolean;
|
|
5
|
+
passwordResetOtp: boolean;
|
|
6
|
+
passwordResetOtpExpiresAt: boolean;
|
|
7
|
+
verificationOtp: boolean;
|
|
8
|
+
verificationOptExpiresAt: boolean;
|
|
9
|
+
isVerified: boolean;
|
|
10
|
+
deletedSelfAccount: boolean;
|
|
11
|
+
active: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const authControllerFactory: (middlewares?: any) => {
|
|
14
|
+
getMe: (req: Request, res: Response, next: NextFunction) => void;
|
|
15
|
+
logout: (req: Request, res: Response, next: NextFunction) => void;
|
|
16
|
+
login: (req: Request, res: Response, next: NextFunction) => void;
|
|
17
|
+
signup: (req: Request, res: Response, next: NextFunction) => void;
|
|
18
|
+
verifyEmail: (req: Request, res: Response, next: NextFunction) => void;
|
|
19
|
+
forgotPassword: (req: Request, res: Response, next: NextFunction) => void;
|
|
20
|
+
resetPassword: (req: Request, res: Response, next: NextFunction) => void;
|
|
21
|
+
updatePassword: (req: Request, res: Response, next: NextFunction) => void;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=auth.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAMxE,eAAO,MAAM,kBAAkB;;;;;;;;;;CAU9B,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,cAAa,GAAQ;;;;;;;;;CAuc1D,CAAA"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.authControllerFactory = exports.excludedUserFields = void 0;
|
|
7
|
+
const catch_async_1 = __importDefault(require("../error-handler/utils/catch-async"));
|
|
8
|
+
const app_error_1 = __importDefault(require("../error-handler/utils/app-error"));
|
|
9
|
+
const auth_service_1 = __importDefault(require("./auth.service"));
|
|
10
|
+
const base_service_1 = __importDefault(require("../base/base.service"));
|
|
11
|
+
const app_1 = require("../../app");
|
|
12
|
+
exports.excludedUserFields = {
|
|
13
|
+
password: false,
|
|
14
|
+
passwordChangedAt: false,
|
|
15
|
+
passwordResetOtp: false,
|
|
16
|
+
passwordResetOtpExpiresAt: false,
|
|
17
|
+
verificationOtp: false,
|
|
18
|
+
verificationOptExpiresAt: false,
|
|
19
|
+
isVerified: false,
|
|
20
|
+
deletedSelfAccount: false,
|
|
21
|
+
active: false,
|
|
22
|
+
};
|
|
23
|
+
const authControllerFactory = (middlewares = {}) => {
|
|
24
|
+
const prisma = app_1.initConfigs.prisma;
|
|
25
|
+
return {
|
|
26
|
+
getMe: (0, catch_async_1.default)(async (req, res, next) => {
|
|
27
|
+
Object.keys(exports.excludedUserFields).forEach((key) => {
|
|
28
|
+
if (req.user)
|
|
29
|
+
delete req.user[key];
|
|
30
|
+
});
|
|
31
|
+
if (middlewares?.afterGetMe) {
|
|
32
|
+
;
|
|
33
|
+
req.responseData = req.user;
|
|
34
|
+
req.responseStatus = 200;
|
|
35
|
+
return next();
|
|
36
|
+
}
|
|
37
|
+
res.status(200).json(req.user);
|
|
38
|
+
}),
|
|
39
|
+
logout: (0, catch_async_1.default)(async (req, res, next) => {
|
|
40
|
+
res.cookie('jwt', 'no-token', {
|
|
41
|
+
expires: new Date(Date.now() + 10 * 1000),
|
|
42
|
+
httpOnly: true,
|
|
43
|
+
});
|
|
44
|
+
if (middlewares?.afterLogout) {
|
|
45
|
+
;
|
|
46
|
+
req.responseData = null;
|
|
47
|
+
req.responseStatus = 204;
|
|
48
|
+
return next();
|
|
49
|
+
}
|
|
50
|
+
res.status(204).json();
|
|
51
|
+
}),
|
|
52
|
+
login: (0, catch_async_1.default)(async (req, res, next) => {
|
|
53
|
+
const { email, password } = req.body;
|
|
54
|
+
if (!email || !password) {
|
|
55
|
+
return next(new app_error_1.default('Please provide an email and a password', 400));
|
|
56
|
+
}
|
|
57
|
+
const user = await prisma.user.findUnique({ where: { email } });
|
|
58
|
+
if (!user ||
|
|
59
|
+
!(await auth_service_1.default.isCorrectPassword(password, user.password))) {
|
|
60
|
+
return next(new app_error_1.default('Incorrect email or password', 401));
|
|
61
|
+
}
|
|
62
|
+
if (!user.isVerified)
|
|
63
|
+
return next(new app_error_1.default('You must verifiy your email in order to proceed!', 423));
|
|
64
|
+
const token = auth_service_1.default.signJwtToken(user.id);
|
|
65
|
+
const cookieOptions = {
|
|
66
|
+
expires: new Date(Date.now() +
|
|
67
|
+
Number(process.env.JWT_COOKIE_EXPIRES_IN) * 24 * 60 * 60 * 1000),
|
|
68
|
+
httpOnly: true,
|
|
69
|
+
secure: req.secure || req.headers['x-forwarded-proto'] === 'https',
|
|
70
|
+
sameSite: process.env.JWT_SECURE != 'false' ? 'lax' : 'none',
|
|
71
|
+
};
|
|
72
|
+
if (process.env.NODE_ENV === 'production')
|
|
73
|
+
cookieOptions.secure = true;
|
|
74
|
+
res.cookie('jwt', token, cookieOptions);
|
|
75
|
+
if (middlewares?.afterLogin) {
|
|
76
|
+
;
|
|
77
|
+
req.responseData = { token };
|
|
78
|
+
req.responseStatus = 200;
|
|
79
|
+
return next();
|
|
80
|
+
}
|
|
81
|
+
res.status(200).send();
|
|
82
|
+
}),
|
|
83
|
+
signup: (0, catch_async_1.default)(async (req, res, next) => {
|
|
84
|
+
const userService = base_service_1.default['user'];
|
|
85
|
+
const user = await userService.createOne(req.body);
|
|
86
|
+
// const user = await prisma.user.create({
|
|
87
|
+
// data: {
|
|
88
|
+
// ...req.body,
|
|
89
|
+
// password: await authService.hashPassword(req.body.password),
|
|
90
|
+
// } as any,
|
|
91
|
+
// })
|
|
92
|
+
if (middlewares?.afterSignup) {
|
|
93
|
+
;
|
|
94
|
+
req.responseData = { data: user };
|
|
95
|
+
req.responseStatus = 201;
|
|
96
|
+
return next();
|
|
97
|
+
}
|
|
98
|
+
Object.keys(exports.excludedUserFields).forEach((key) => {
|
|
99
|
+
delete user[key];
|
|
100
|
+
});
|
|
101
|
+
res.status(201).json({ data: user });
|
|
102
|
+
}),
|
|
103
|
+
verifyEmail: (0, catch_async_1.default)(async (req, res, next) => {
|
|
104
|
+
const { otp, email } = req.body;
|
|
105
|
+
// Check if email and OTP are provided
|
|
106
|
+
if (!email || !otp) {
|
|
107
|
+
return next(new app_error_1.default('Email and otp are required', 400, {
|
|
108
|
+
error: 'Missing parameters',
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
const user = await prisma.user.findUnique({
|
|
112
|
+
where: { email },
|
|
113
|
+
});
|
|
114
|
+
if (!user) {
|
|
115
|
+
return next(new app_error_1.default('No account found with this email.', 400, {
|
|
116
|
+
error: 'user_not_found',
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
if (user.isVerified)
|
|
120
|
+
return next(new app_error_1.default('Your email is already verified.', 400, {
|
|
121
|
+
error: 'already_verified',
|
|
122
|
+
}));
|
|
123
|
+
if (user.verificationOtp !== otp)
|
|
124
|
+
return next(new app_error_1.default('The OTP is incorrect.', 400, {
|
|
125
|
+
error: 'invalid_otp',
|
|
126
|
+
}));
|
|
127
|
+
if (user.verificationOptExpiresAt &&
|
|
128
|
+
new Date() > user.verificationOptExpiresAt)
|
|
129
|
+
return next(new app_error_1.default('The OTP has expired. Please request a new one.', 400, {
|
|
130
|
+
error: 'expired_otp',
|
|
131
|
+
}));
|
|
132
|
+
await prisma.user.update({
|
|
133
|
+
where: { email },
|
|
134
|
+
data: {
|
|
135
|
+
isVerified: true,
|
|
136
|
+
verificationOtp: null,
|
|
137
|
+
verificationOptExpiresAt: null,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
if (middlewares?.afterVerifyEmail) {
|
|
141
|
+
;
|
|
142
|
+
req.additionalData = {
|
|
143
|
+
user,
|
|
144
|
+
};
|
|
145
|
+
req.responseData = {
|
|
146
|
+
message: 'Email verified successfully.',
|
|
147
|
+
};
|
|
148
|
+
req.responseStatus = 200;
|
|
149
|
+
return next();
|
|
150
|
+
}
|
|
151
|
+
res.status(200).json({
|
|
152
|
+
message: 'Email verified successfully.',
|
|
153
|
+
});
|
|
154
|
+
}),
|
|
155
|
+
forgotPassword: (0, catch_async_1.default)(async (req, res, next) => {
|
|
156
|
+
if (!req.body.email)
|
|
157
|
+
return next(new app_error_1.default('Email is required in order to trigger forgot password', 400));
|
|
158
|
+
const user = await prisma.user.findUnique({
|
|
159
|
+
where: {
|
|
160
|
+
email: req.body.email,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
if (!user ||
|
|
164
|
+
user?.active === false ||
|
|
165
|
+
user?.deletedSelfAccount === true)
|
|
166
|
+
return next(new app_error_1.default('User not found!', 404));
|
|
167
|
+
if (!user.isVerified)
|
|
168
|
+
return next(new app_error_1.default('You need to verify your account to proceed', 423, {
|
|
169
|
+
error: 'email_verification_required',
|
|
170
|
+
}));
|
|
171
|
+
// Verifica se um OTP foi solicitado recentemente
|
|
172
|
+
if (user.passwordResetOtpExpiresAt) {
|
|
173
|
+
const now = new Date();
|
|
174
|
+
const lastOtpRequestedAt = new Date(new Date(user.passwordResetOtpExpiresAt).getTime() - 15 * 60 * 1000);
|
|
175
|
+
const timeElapsed = (now.getTime() - lastOtpRequestedAt.getTime()) / 1000;
|
|
176
|
+
const minInterval = 2 * 60; // 2 minutos em segundos
|
|
177
|
+
if (timeElapsed < minInterval)
|
|
178
|
+
return next(new app_error_1.default(`Please wait ${Math.ceil(minInterval - timeElapsed)} seconds before requesting a new OTP.`, 429, {
|
|
179
|
+
remainingTime: Math.ceil(minInterval - timeElapsed),
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
const resetOtp = Math.floor(100000 + Math.random() * 900000).toString();
|
|
183
|
+
const resetOtpExpiresAt = new Date(Date.now() + 15 * 60 * 1000);
|
|
184
|
+
await prisma.user.update({
|
|
185
|
+
where: {
|
|
186
|
+
id: user.id,
|
|
187
|
+
},
|
|
188
|
+
data: {
|
|
189
|
+
passwordResetOtp: resetOtp,
|
|
190
|
+
passwordResetOtpExpiresAt: resetOtpExpiresAt,
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
if (middlewares?.afterForgotPassword) {
|
|
194
|
+
;
|
|
195
|
+
req.additionalData = {
|
|
196
|
+
user,
|
|
197
|
+
resetOtp,
|
|
198
|
+
};
|
|
199
|
+
req.responseData = {
|
|
200
|
+
status: 'success',
|
|
201
|
+
message: 'OTP code sent successfully!',
|
|
202
|
+
};
|
|
203
|
+
req.responseStatus = 200;
|
|
204
|
+
return next();
|
|
205
|
+
}
|
|
206
|
+
res.status(200).json({
|
|
207
|
+
status: 'success',
|
|
208
|
+
message: 'OTP code sent successfully!',
|
|
209
|
+
});
|
|
210
|
+
}),
|
|
211
|
+
resetPassword: (0, catch_async_1.default)(async (req, res, next) => {
|
|
212
|
+
const { email, otp, newPassword } = req.body;
|
|
213
|
+
if (!otp || !email || !newPassword)
|
|
214
|
+
return next(new app_error_1.default('email, otp and newPassword are required to reset password', 400));
|
|
215
|
+
if (!auth_service_1.default.isPasswordStrong(newPassword))
|
|
216
|
+
return next(new app_error_1.default('Password must contain at least one uppercase letter, one lowercase letter, and one number', 400));
|
|
217
|
+
const user = await prisma.user.findUnique({
|
|
218
|
+
where: { email },
|
|
219
|
+
});
|
|
220
|
+
if (!user?.passwordResetOtp)
|
|
221
|
+
return next(new app_error_1.default('You must request an otp in order to reset password!', 400, {
|
|
222
|
+
error: 'no_requested_otp',
|
|
223
|
+
}));
|
|
224
|
+
if (await auth_service_1.default.isCorrectPassword(newPassword, user?.password))
|
|
225
|
+
return next(new app_error_1.default('New password must not be the same as last one!', 400, {
|
|
226
|
+
error: 'new_password_equals_last_password',
|
|
227
|
+
}));
|
|
228
|
+
if (!user ||
|
|
229
|
+
user?.active === false ||
|
|
230
|
+
user?.deletedSelfAccount === true)
|
|
231
|
+
return next(new app_error_1.default('User not found!', 404));
|
|
232
|
+
if (!user.isVerified)
|
|
233
|
+
return next(new app_error_1.default('You need to verify your account to proceed', 423, {
|
|
234
|
+
error: 'email_verification_required',
|
|
235
|
+
}));
|
|
236
|
+
if (!user.passwordResetOtp || !user.passwordResetOtpExpiresAt)
|
|
237
|
+
return next(new app_error_1.default('Invalid or expired OTP.', 400));
|
|
238
|
+
const now = new Date();
|
|
239
|
+
if (now > new Date(user.passwordResetOtpExpiresAt))
|
|
240
|
+
return next(new app_error_1.default('OTP expired. Please request a new one.', 400));
|
|
241
|
+
if (user.passwordResetOtp != otp)
|
|
242
|
+
return next(new app_error_1.default('Invalid OTP. Please try again.', 400));
|
|
243
|
+
await prisma.user.update({
|
|
244
|
+
where: { id: user.id },
|
|
245
|
+
data: {
|
|
246
|
+
password: await auth_service_1.default.hashPassword(newPassword),
|
|
247
|
+
passwordResetOtp: null,
|
|
248
|
+
passwordResetOtpExpiresAt: null,
|
|
249
|
+
passwordChangedAt: new Date(),
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
if (middlewares?.afterResetPassword) {
|
|
253
|
+
;
|
|
254
|
+
req.additionalData = {
|
|
255
|
+
user,
|
|
256
|
+
};
|
|
257
|
+
req.responseData = {
|
|
258
|
+
status: 'success',
|
|
259
|
+
message: 'Password reset successfully!',
|
|
260
|
+
};
|
|
261
|
+
req.responseStatus = 200;
|
|
262
|
+
return next();
|
|
263
|
+
}
|
|
264
|
+
res.status(200).json({
|
|
265
|
+
status: 'success',
|
|
266
|
+
message: 'Password reset successfully!',
|
|
267
|
+
});
|
|
268
|
+
}),
|
|
269
|
+
updatePassword: (0, catch_async_1.default)(async (req, res, next) => {
|
|
270
|
+
const { currentPassword, newPassword } = req.body;
|
|
271
|
+
if (!currentPassword || !newPassword)
|
|
272
|
+
return next(new app_error_1.default('currentPassword and newPassword are required', 400));
|
|
273
|
+
const user = req.user;
|
|
274
|
+
if (!user ||
|
|
275
|
+
user?.active === false ||
|
|
276
|
+
user?.deletedSelfAccount === true)
|
|
277
|
+
return next(new app_error_1.default('User not found!', 404));
|
|
278
|
+
if (!user.isVerified)
|
|
279
|
+
return next(new app_error_1.default('You need to verify your account to proceed', 423, {
|
|
280
|
+
error: 'email_verification_required',
|
|
281
|
+
}));
|
|
282
|
+
// Check if the current password is correct
|
|
283
|
+
const isPasswordCorrect = await auth_service_1.default.isCorrectPassword(String(currentPassword), String(user.password));
|
|
284
|
+
if (!isPasswordCorrect)
|
|
285
|
+
return next(new app_error_1.default('Current password is incorrect.', 400));
|
|
286
|
+
// Check password strength (optional but recommended)
|
|
287
|
+
if (!auth_service_1.default.isPasswordStrong(String(newPassword)))
|
|
288
|
+
return next(new app_error_1.default('Password must contain at least one uppercase letter, one lowercase letter, and one number', 400));
|
|
289
|
+
// Update the password
|
|
290
|
+
await prisma.user.update({
|
|
291
|
+
where: { id: user.id },
|
|
292
|
+
data: {
|
|
293
|
+
password: await auth_service_1.default.hashPassword(newPassword),
|
|
294
|
+
passwordChangedAt: new Date(),
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
if (middlewares?.afterUpdatePassword) {
|
|
298
|
+
;
|
|
299
|
+
req.additionalData = {
|
|
300
|
+
user,
|
|
301
|
+
};
|
|
302
|
+
req.responseData = {
|
|
303
|
+
status: 'success',
|
|
304
|
+
message: 'Password updated successfully!',
|
|
305
|
+
};
|
|
306
|
+
req.responseStatus = 200;
|
|
307
|
+
return next();
|
|
308
|
+
}
|
|
309
|
+
res.status(200).json({
|
|
310
|
+
status: 'success',
|
|
311
|
+
message: 'Password updated successfully!',
|
|
312
|
+
});
|
|
313
|
+
}),
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
exports.authControllerFactory = authControllerFactory;
|
|
317
|
+
//# sourceMappingURL=auth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../src/modules/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;AAAA,qFAA2D;AAC3D,iFAAuD;AAEvD,kEAAwC;AACxC,wEAA+C;AAE/C,mCAAuC;AAE1B,QAAA,kBAAkB,GAAG;IAChC,QAAQ,EAAE,KAAK;IACf,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,EAAE,KAAK;IACvB,yBAAyB,EAAE,KAAK;IAChC,eAAe,EAAE,KAAK;IACtB,wBAAwB,EAAE,KAAK;IAC/B,UAAU,EAAE,KAAK;IACjB,kBAAkB,EAAE,KAAK;IACzB,MAAM,EAAE,KAAK;CACd,CAAA;A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