@articketing2021/common 1.0.2 → 1.0.5
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/build/errors/bad-request-error.d.ts +10 -0
- package/build/errors/bad-request-error.js +21 -0
- package/build/errors/custom-error.d.ts +8 -0
- package/build/errors/custom-error.js +10 -0
- package/build/errors/database-connection-error.d.ts +9 -0
- package/build/errors/database-connection-error.js +20 -0
- package/build/errors/not-authorized-error.d.ts +10 -0
- package/build/errors/not-authorized-error.js +16 -0
- package/build/errors/not-found-error.d.ts +9 -0
- package/build/errors/not-found-error.js +19 -0
- package/build/errors/request-validation-error.d.ts +14 -0
- package/build/errors/request-validation-error.js +27 -0
- package/build/index.d.ts +12 -7
- package/build/index.js +29 -6
- package/build/middleware/Authentication.d.ts +18 -0
- package/build/middleware/Authentication.js +58 -0
- package/build/middleware/current-user.d.ts +14 -0
- package/build/middleware/current-user.js +20 -0
- package/build/middleware/error-handler.d.ts +2 -0
- package/build/middleware/error-handler.js +14 -0
- package/build/middleware/require-auth.d.ts +2 -0
- package/build/middleware/require-auth.js +11 -0
- package/build/middleware/validate-request.d.ts +2 -0
- package/build/middleware/validate-request.js +13 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +17 -0
- package/build/types/users/index.d.ts +4 -0
- package/build/types/users/index.js +8 -0
- package/package.json +27 -9
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomError } from "./custom-error";
|
|
2
|
+
export declare class BadRequestError extends CustomError {
|
|
3
|
+
message: string;
|
|
4
|
+
statusCode: number;
|
|
5
|
+
constructor(message: string, statusCode?: number);
|
|
6
|
+
serializeErrors(): {
|
|
7
|
+
message: string;
|
|
8
|
+
fields?: string;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadRequestError = void 0;
|
|
4
|
+
const custom_error_1 = require("./custom-error");
|
|
5
|
+
class BadRequestError extends custom_error_1.CustomError {
|
|
6
|
+
constructor(message, statusCode = 400) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.message = message;
|
|
9
|
+
this.statusCode = statusCode;
|
|
10
|
+
this.statusCode = statusCode;
|
|
11
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
12
|
+
}
|
|
13
|
+
serializeErrors() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
message: this.message,
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.BadRequestError = BadRequestError;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomError = void 0;
|
|
4
|
+
class CustomError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
Object.setPrototypeOf(this, CustomError.prototype);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.CustomError = CustomError;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseConnectionError = void 0;
|
|
4
|
+
const custom_error_1 = require("./custom-error");
|
|
5
|
+
class DatabaseConnectionError extends custom_error_1.CustomError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('Error connecting db');
|
|
8
|
+
this.reason = "Error connecting the database";
|
|
9
|
+
this.statusCode = 500;
|
|
10
|
+
Object.setPrototypeOf(this, DatabaseConnectionError.prototype);
|
|
11
|
+
}
|
|
12
|
+
serializeErrors() {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
message: this.reason
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DatabaseConnectionError = DatabaseConnectionError;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotAuthorizedError = void 0;
|
|
4
|
+
const custom_error_1 = require("./custom-error");
|
|
5
|
+
class NotAuthorizedError extends custom_error_1.CustomError {
|
|
6
|
+
constructor(message = "Not authorized") {
|
|
7
|
+
super(message);
|
|
8
|
+
this.message = message;
|
|
9
|
+
this.statusCode = 401;
|
|
10
|
+
Object.setPrototypeOf(this, NotAuthorizedError.prototype);
|
|
11
|
+
}
|
|
12
|
+
serializeErrors() {
|
|
13
|
+
return [{ message: this.message }];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.NotAuthorizedError = NotAuthorizedError;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotFoundError = void 0;
|
|
4
|
+
const custom_error_1 = require("./custom-error");
|
|
5
|
+
class NotFoundError extends custom_error_1.CustomError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("In-valid route");
|
|
8
|
+
this.statusCode = 404;
|
|
9
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
10
|
+
}
|
|
11
|
+
serializeErrors() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
message: "In-valid route, this route does not exist",
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.NotFoundError = NotFoundError;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ValidationError } from "express-validator";
|
|
2
|
+
import { CustomError } from './custom-error';
|
|
3
|
+
export declare class RequestValidationError extends CustomError {
|
|
4
|
+
errors: ValidationError[];
|
|
5
|
+
statusCode: number;
|
|
6
|
+
constructor(errors: ValidationError[]);
|
|
7
|
+
serializeErrors(): ({
|
|
8
|
+
message: any;
|
|
9
|
+
field: string;
|
|
10
|
+
} | {
|
|
11
|
+
message: any;
|
|
12
|
+
field?: undefined;
|
|
13
|
+
})[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestValidationError = void 0;
|
|
4
|
+
const custom_error_1 = require("./custom-error");
|
|
5
|
+
class RequestValidationError extends custom_error_1.CustomError {
|
|
6
|
+
constructor(errors) {
|
|
7
|
+
super("Invalid request parameters");
|
|
8
|
+
this.errors = errors;
|
|
9
|
+
this.statusCode = 400;
|
|
10
|
+
// only because we are extending the built in class
|
|
11
|
+
Object.setPrototypeOf(this, RequestValidationError.prototype);
|
|
12
|
+
}
|
|
13
|
+
serializeErrors() {
|
|
14
|
+
return this.errors.map((error) => {
|
|
15
|
+
if (error.type === "field")
|
|
16
|
+
return {
|
|
17
|
+
message: error.msg,
|
|
18
|
+
field: error.path,
|
|
19
|
+
};
|
|
20
|
+
else
|
|
21
|
+
return {
|
|
22
|
+
message: error.msg,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.RequestValidationError = RequestValidationError;
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
1
|
+
export * from "./errors/bad-request-error";
|
|
2
|
+
export * from "./errors/custom-error";
|
|
3
|
+
export * from "./errors/database-connection-error";
|
|
4
|
+
export * from "./errors/not-authorized-error";
|
|
5
|
+
export * from "./errors/not-found-error";
|
|
6
|
+
export * from "./errors/request-validation-error";
|
|
7
|
+
export * from "./middleware/Authentication";
|
|
8
|
+
export * from "./middleware/current-user";
|
|
9
|
+
export * from "./middleware/error-handler";
|
|
10
|
+
export * from "./middleware/require-auth";
|
|
11
|
+
export * from "./middleware/validate-request";
|
|
12
|
+
export * from "./types/index";
|
package/build/index.js
CHANGED
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
7
15
|
};
|
|
8
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
//Middleware
|
|
18
|
+
__exportStar(require("./errors/bad-request-error"), exports);
|
|
19
|
+
__exportStar(require("./errors/custom-error"), exports);
|
|
20
|
+
__exportStar(require("./errors/database-connection-error"), exports);
|
|
21
|
+
__exportStar(require("./errors/not-authorized-error"), exports);
|
|
22
|
+
__exportStar(require("./errors/not-found-error"), exports);
|
|
23
|
+
__exportStar(require("./errors/request-validation-error"), exports);
|
|
24
|
+
//Errors
|
|
25
|
+
__exportStar(require("./middleware/Authentication"), exports);
|
|
26
|
+
__exportStar(require("./middleware/current-user"), exports);
|
|
27
|
+
__exportStar(require("./middleware/error-handler"), exports);
|
|
28
|
+
__exportStar(require("./middleware/require-auth"), exports);
|
|
29
|
+
__exportStar(require("./middleware/validate-request"), exports);
|
|
30
|
+
//enum
|
|
31
|
+
__exportStar(require("./types/index"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from "express";
|
|
2
|
+
interface UserPayload {
|
|
3
|
+
id: string;
|
|
4
|
+
email: string;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
namespace Express {
|
|
8
|
+
interface Request {
|
|
9
|
+
currentUser?: UserPayload;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare class Authentication {
|
|
14
|
+
private static handle;
|
|
15
|
+
static blank(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
16
|
+
static auth(req: Request, res: Response, next: NextFunction): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Authentication = void 0;
|
|
16
|
+
const express_validator_1 = require("express-validator");
|
|
17
|
+
const types_1 = require("../types");
|
|
18
|
+
const request_validation_error_1 = require("../errors/request-validation-error");
|
|
19
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
20
|
+
const bad_request_error_1 = require("../errors/bad-request-error");
|
|
21
|
+
//This is my middleware
|
|
22
|
+
class Authentication {
|
|
23
|
+
static handle(req, res, next, loginType) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
26
|
+
const errors = (0, express_validator_1.validationResult)(req);
|
|
27
|
+
if (!errors.isEmpty()) {
|
|
28
|
+
return next(new request_validation_error_1.RequestValidationError(errors.array()));
|
|
29
|
+
// return next(new Error("Invalid input fields"))
|
|
30
|
+
// throw new RequestValidationError(errors.array());
|
|
31
|
+
}
|
|
32
|
+
if (loginType === types_1.UserLogin.LOGGED_IN) {
|
|
33
|
+
if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
|
|
34
|
+
return next(new bad_request_error_1.BadRequestError("Token is required", 401));
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const payload = jsonwebtoken_1.default.verify(req.session.jwt, process.env.JWT_KEY);
|
|
38
|
+
req.currentUser = payload;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return next(new bad_request_error_1.BadRequestError("In-valid token", 401));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
next();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
static blank(req, res, next) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
Authentication.handle(req, res, next, types_1.UserLogin.OPEN_TO_ALL);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
static auth(req, res, next) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
Authentication.handle(req, res, next, types_1.UserLogin.LOGGED_IN);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Authentication = Authentication;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Request, type Response, type NextFunction } from 'express';
|
|
2
|
+
interface UserPayload {
|
|
3
|
+
id: string;
|
|
4
|
+
email: string;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
namespace Express {
|
|
8
|
+
interface Request {
|
|
9
|
+
currentUser?: UserPayload;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const currentUser: (req: Request, res: Response, next: NextFunction) => void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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.currentUser = void 0;
|
|
7
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
|
+
const currentUser = (req, res, next) => {
|
|
9
|
+
var _a;
|
|
10
|
+
if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
|
|
11
|
+
return next();
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const payload = jsonwebtoken_1.default.verify(req.session.jwt, process.env.JWT_KEY);
|
|
15
|
+
req.currentUser = payload;
|
|
16
|
+
}
|
|
17
|
+
catch (err) { }
|
|
18
|
+
next();
|
|
19
|
+
};
|
|
20
|
+
exports.currentUser = currentUser;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errorHandler = void 0;
|
|
4
|
+
const custom_error_1 = require("../errors/custom-error");
|
|
5
|
+
const errorHandler = (err, req, res, next) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (err instanceof custom_error_1.CustomError) {
|
|
8
|
+
return res.status(err.statusCode).json(err.serializeErrors());
|
|
9
|
+
}
|
|
10
|
+
res.status(500).send({
|
|
11
|
+
message: (_a = err.message) !== null && _a !== void 0 ? _a : 'Something went wrong',
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
exports.errorHandler = errorHandler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requireAuth = void 0;
|
|
4
|
+
const not_authorized_error_1 = require("../errors/not-authorized-error");
|
|
5
|
+
const requireAuth = (req, res, next) => {
|
|
6
|
+
if (!req.currentUser) {
|
|
7
|
+
return next(new not_authorized_error_1.NotAuthorizedError());
|
|
8
|
+
}
|
|
9
|
+
next();
|
|
10
|
+
};
|
|
11
|
+
exports.requireAuth = requireAuth;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateRequest = void 0;
|
|
4
|
+
const express_validator_1 = require("express-validator");
|
|
5
|
+
const request_validation_error_1 = require("../errors/request-validation-error");
|
|
6
|
+
const validateRequest = (req, res, next) => {
|
|
7
|
+
const errors = (0, express_validator_1.validationResult)(req);
|
|
8
|
+
if (!errors.isEmpty()) {
|
|
9
|
+
return next(new request_validation_error_1.RequestValidationError(errors.array()));
|
|
10
|
+
}
|
|
11
|
+
next();
|
|
12
|
+
};
|
|
13
|
+
exports.validateRequest = validateRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./users";
|
|
@@ -0,0 +1,17 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./users"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserLogin = void 0;
|
|
4
|
+
var UserLogin;
|
|
5
|
+
(function (UserLogin) {
|
|
6
|
+
UserLogin["LOGGED_IN"] = "login-user";
|
|
7
|
+
UserLogin["OPEN_TO_ALL"] = "open-to-all";
|
|
8
|
+
})(UserLogin || (exports.UserLogin = UserLogin = {}));
|
package/package.json
CHANGED
|
@@ -1,23 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@articketing2021/common",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Common reusable utilities, middlewares, and types for Articketing microservices.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"build/**/*"
|
|
9
9
|
],
|
|
10
|
-
"keywords": [
|
|
11
|
-
|
|
10
|
+
"keywords": [
|
|
11
|
+
"common",
|
|
12
|
+
"typescript",
|
|
13
|
+
"express",
|
|
14
|
+
"microservices",
|
|
15
|
+
"articketing"
|
|
16
|
+
],
|
|
17
|
+
"author": "Ajay Rathod",
|
|
12
18
|
"license": "ISC",
|
|
13
19
|
"devDependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
20
|
+
"@types/cookie-session": "^2.0.49",
|
|
21
|
+
"@types/express": "^5.0.3",
|
|
22
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
23
|
+
"typescript": "^5.9.3",
|
|
24
|
+
"tsconfig-paths": "^4.2.0",
|
|
25
|
+
"ts-node-dev": "^2.0.0",
|
|
26
|
+
"tsc-alias": "^1.8.9",
|
|
27
|
+
"del-cli": "^7.0.0"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"cookie-session": "^2.1.1",
|
|
31
|
+
"express": "^5.1.0",
|
|
32
|
+
"express-validator": "^7.2.1",
|
|
33
|
+
"jsonwebtoken": "^9.0.2"
|
|
16
34
|
},
|
|
17
35
|
"scripts": {
|
|
18
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
19
36
|
"clean": "del-cli ./build/*",
|
|
20
|
-
"build": "pnpm clean && tsc",
|
|
21
|
-
"pub": "pnpm version patch && pnpm build && pnpm publish"
|
|
37
|
+
"build": "pnpm clean && tsc && tsc-alias",
|
|
38
|
+
"pub": "pnpm version patch && pnpm build && pnpm publish",
|
|
39
|
+
"dev": "ts-node-dev -r tsconfig-paths/register src/index.ts"
|
|
22
40
|
}
|
|
23
41
|
}
|