@naman_deep_singh/errors-utils 1.3.2 → 1.3.4
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/README.md +1 -1
- package/dist/cjs/error/TokenExpiredError.d.ts +2 -2
- package/dist/cjs/error/TokenExpiredError.js +2 -2
- package/dist/cjs/error/TokenMalformedError.d.ts +2 -2
- package/dist/cjs/error/TokenMalformedError.js +2 -2
- package/dist/cjs/error/UnauthorizedError.d.ts +1 -2
- package/dist/cjs/error/UnauthorizedError.js +2 -2
- package/dist/esm/error/TokenExpiredError.d.ts +2 -2
- package/dist/esm/error/TokenExpiredError.js +2 -2
- package/dist/esm/error/TokenMalformedError.d.ts +2 -2
- package/dist/esm/error/TokenMalformedError.js +2 -2
- package/dist/esm/error/UnauthorizedError.d.ts +1 -2
- package/dist/esm/error/UnauthorizedError.js +2 -2
- package/dist/types/error/TokenExpiredError.d.ts +2 -2
- package/dist/types/error/TokenMalformedError.d.ts +2 -2
- package/dist/types/error/UnauthorizedError.d.ts +1 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TokenExpiredError extends
|
|
1
|
+
import { HTTPError } from './HTTPError';
|
|
2
|
+
export declare class TokenExpiredError extends HTTPError {
|
|
3
3
|
constructor(details?: unknown, cause?: Error);
|
|
4
4
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TokenExpiredError = void 0;
|
|
4
4
|
const response_utils_1 = require("@naman_deep_singh/response-utils");
|
|
5
5
|
const constants_1 = require("src/constants");
|
|
6
|
-
const
|
|
7
|
-
class TokenExpiredError extends
|
|
6
|
+
const HTTPError_1 = require("./HTTPError");
|
|
7
|
+
class TokenExpiredError extends HTTPError_1.HTTPError {
|
|
8
8
|
constructor(details, cause) {
|
|
9
9
|
super(constants_1.ERROR_CODES.TOKEN_EXPIRED, response_utils_1.HTTP_STATUS.CLIENT_ERROR.UNAUTHORIZED, details, cause);
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TokenMalformedError extends
|
|
1
|
+
import { HTTPError } from './HTTPError';
|
|
2
|
+
export declare class TokenMalformedError extends HTTPError {
|
|
3
3
|
constructor(details?: unknown, cause?: Error);
|
|
4
4
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TokenMalformedError = void 0;
|
|
4
4
|
const response_utils_1 = require("@naman_deep_singh/response-utils");
|
|
5
5
|
const constants_1 = require("src/constants");
|
|
6
|
-
const
|
|
7
|
-
class TokenMalformedError extends
|
|
6
|
+
const HTTPError_1 = require("./HTTPError");
|
|
7
|
+
class TokenMalformedError extends HTTPError_1.HTTPError {
|
|
8
8
|
constructor(details, cause) {
|
|
9
9
|
super(constants_1.ERROR_CODES.TOKEN_INVALID, response_utils_1.HTTP_STATUS.CLIENT_ERROR.UNAUTHORIZED, details, cause);
|
|
10
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type ErrorCode } from 'src/constants';
|
|
2
1
|
import { HTTPError } from './HTTPError';
|
|
3
2
|
export declare class UnauthorizedError extends HTTPError {
|
|
4
|
-
constructor(
|
|
3
|
+
constructor(details?: unknown, cause?: Error);
|
|
5
4
|
}
|
|
@@ -5,8 +5,8 @@ const response_utils_1 = require("@naman_deep_singh/response-utils");
|
|
|
5
5
|
const constants_1 = require("src/constants");
|
|
6
6
|
const HTTPError_1 = require("./HTTPError");
|
|
7
7
|
class UnauthorizedError extends HTTPError_1.HTTPError {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
8
|
+
constructor(details, cause) {
|
|
9
|
+
super(constants_1.ERROR_CODES.UNAUTHORIZED, response_utils_1.HTTP_STATUS.CLIENT_ERROR.UNAUTHORIZED, details, cause);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TokenExpiredError extends
|
|
1
|
+
import { HTTPError } from './HTTPError';
|
|
2
|
+
export declare class TokenExpiredError extends HTTPError {
|
|
3
3
|
constructor(details?: unknown, cause?: Error);
|
|
4
4
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTTP_STATUS } from '@naman_deep_singh/response-utils';
|
|
2
2
|
import { ERROR_CODES } from 'src/constants';
|
|
3
|
-
import {
|
|
4
|
-
export class TokenExpiredError extends
|
|
3
|
+
import { HTTPError } from './HTTPError';
|
|
4
|
+
export class TokenExpiredError extends HTTPError {
|
|
5
5
|
constructor(details, cause) {
|
|
6
6
|
super(ERROR_CODES.TOKEN_EXPIRED, HTTP_STATUS.CLIENT_ERROR.UNAUTHORIZED, details, cause);
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TokenMalformedError extends
|
|
1
|
+
import { HTTPError } from './HTTPError';
|
|
2
|
+
export declare class TokenMalformedError extends HTTPError {
|
|
3
3
|
constructor(details?: unknown, cause?: Error);
|
|
4
4
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTTP_STATUS } from '@naman_deep_singh/response-utils';
|
|
2
2
|
import { ERROR_CODES } from 'src/constants';
|
|
3
|
-
import {
|
|
4
|
-
export class TokenMalformedError extends
|
|
3
|
+
import { HTTPError } from './HTTPError';
|
|
4
|
+
export class TokenMalformedError extends HTTPError {
|
|
5
5
|
constructor(details, cause) {
|
|
6
6
|
super(ERROR_CODES.TOKEN_INVALID, HTTP_STATUS.CLIENT_ERROR.UNAUTHORIZED, details, cause);
|
|
7
7
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type ErrorCode } from 'src/constants';
|
|
2
1
|
import { HTTPError } from './HTTPError';
|
|
3
2
|
export declare class UnauthorizedError extends HTTPError {
|
|
4
|
-
constructor(
|
|
3
|
+
constructor(details?: unknown, cause?: Error);
|
|
5
4
|
}
|
|
@@ -2,7 +2,7 @@ import { HTTP_STATUS } from '@naman_deep_singh/response-utils';
|
|
|
2
2
|
import { ERROR_CODES } from 'src/constants';
|
|
3
3
|
import { HTTPError } from './HTTPError';
|
|
4
4
|
export class UnauthorizedError extends HTTPError {
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(details, cause) {
|
|
6
|
+
super(ERROR_CODES.UNAUTHORIZED, HTTP_STATUS.CLIENT_ERROR.UNAUTHORIZED, details, cause);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TokenExpiredError extends
|
|
1
|
+
import { HTTPError } from './HTTPError';
|
|
2
|
+
export declare class TokenExpiredError extends HTTPError {
|
|
3
3
|
constructor(details?: unknown, cause?: Error);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TokenMalformedError extends
|
|
1
|
+
import { HTTPError } from './HTTPError';
|
|
2
|
+
export declare class TokenMalformedError extends HTTPError {
|
|
3
3
|
constructor(details?: unknown, cause?: Error);
|
|
4
4
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type ErrorCode } from 'src/constants';
|
|
2
1
|
import { HTTPError } from './HTTPError';
|
|
3
2
|
export declare class UnauthorizedError extends HTTPError {
|
|
4
|
-
constructor(
|
|
3
|
+
constructor(details?: unknown, cause?: Error);
|
|
5
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naman_deep_singh/errors-utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Standardized error classes and Express middleware for consistent error handling with TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"@types/express": "^5.0.5",
|
|
27
27
|
"@types/node": "^25.0.1",
|
|
28
28
|
"express": "^5.1.0",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"rimraf": "^5.0.5",
|
|
30
|
+
"typescript": "^5.9.3"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@naman_deep_singh/response-utils": "^2.
|
|
33
|
+
"@naman_deep_singh/response-utils": "^2.1.4"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "pnpm run build:types && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json",
|