@furkanogutcu/nest-common 1.0.3 → 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/dist/exceptions/app.exception.d.ts +7 -4
- package/dist/exceptions/app.exception.js +1 -1
- package/dist/exceptions/app.exception.js.map +1 -1
- package/dist/exceptions/bad-request.exception.d.ts +3 -2
- package/dist/exceptions/bad-request.exception.js +2 -1
- package/dist/exceptions/bad-request.exception.js.map +1 -1
- package/dist/exceptions/conflict.exception.d.ts +2 -1
- package/dist/exceptions/conflict.exception.js.map +1 -1
- package/dist/exceptions/filters/global.exception-filter.js +35 -2
- package/dist/exceptions/filters/global.exception-filter.js.map +1 -1
- package/dist/exceptions/forbidden.exception.d.ts +3 -2
- package/dist/exceptions/forbidden.exception.js +2 -1
- package/dist/exceptions/forbidden.exception.js.map +1 -1
- package/dist/exceptions/interfaces/error-response.interface.d.ts +2 -2
- package/dist/exceptions/internal.exception.d.ts +3 -2
- package/dist/exceptions/internal.exception.js +2 -1
- package/dist/exceptions/internal.exception.js.map +1 -1
- package/dist/exceptions/not-found.exception.d.ts +3 -2
- package/dist/exceptions/not-found.exception.js +2 -1
- package/dist/exceptions/not-found.exception.js.map +1 -1
- package/dist/exceptions/too-many-request.exception.d.ts +3 -2
- package/dist/exceptions/too-many-request.exception.js +2 -1
- package/dist/exceptions/too-many-request.exception.js.map +1 -1
- package/dist/exceptions/transformers/nestjs.exception-transformer.d.ts +1 -1
- package/dist/exceptions/transformers/typeorm.exception-transformer.d.ts +1 -1
- package/dist/exceptions/unauthorized.exception.d.ts +3 -2
- package/dist/exceptions/unauthorized.exception.js +2 -1
- package/dist/exceptions/unauthorized.exception.js.map +1 -1
- package/dist/exceptions/unprocessable-entity.exception.d.ts +3 -2
- package/dist/exceptions/unprocessable-entity.exception.js +2 -1
- package/dist/exceptions/unprocessable-entity.exception.js.map +1 -1
- package/dist/exceptions/validation.exception.d.ts +5 -4
- package/dist/exceptions/validation.exception.js +6 -6
- package/dist/exceptions/validation.exception.js.map +1 -1
- package/dist/pipes/app-zod-validation.pipe.d.ts +2 -2
- package/dist/pipes/app-zod-validation.pipe.js +3 -3
- package/dist/pipes/app-zod-validation.pipe.js.map +1 -1
- package/dist/validations/order-by.validation.d.ts +3 -11
- package/dist/validations/pagination.validation.d.ts +7 -13
- package/dist/validations/search.validation.d.ts +1 -5
- package/package.json +27 -27
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { HttpStatus } from '@nestjs/common';
|
|
2
2
|
import { IErrorResponse } from './interfaces/error-response.interface';
|
|
3
3
|
import { IValidationErrorDetails } from './interfaces/validation-error-detail.interface';
|
|
4
|
-
export declare class AppException extends Error {
|
|
4
|
+
export declare class AppException<TDetails = IValidationErrorDetails[]> extends Error {
|
|
5
5
|
readonly code: string;
|
|
6
6
|
readonly httpCode: HttpStatus;
|
|
7
|
-
readonly details?:
|
|
8
|
-
constructor({ message, httpCode, code, details }:
|
|
7
|
+
readonly details?: TDetails;
|
|
8
|
+
constructor({ message, httpCode, code, details, }: {
|
|
9
|
+
message: string;
|
|
9
10
|
httpCode: HttpStatus;
|
|
11
|
+
code: string;
|
|
12
|
+
details?: TDetails;
|
|
10
13
|
});
|
|
11
|
-
toJSON(): IErrorResponse
|
|
14
|
+
toJSON(): IErrorResponse<TDetails>;
|
|
12
15
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppException = void 0;
|
|
4
4
|
class AppException extends Error {
|
|
5
|
-
constructor({ message, httpCode, code, details }) {
|
|
5
|
+
constructor({ message, httpCode, code, details, }) {
|
|
6
6
|
super(message);
|
|
7
7
|
this.httpCode = httpCode;
|
|
8
8
|
this.code = code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.exception.js","sourceRoot":"","sources":["../../src/exceptions/app.exception.ts"],"names":[],"mappings":";;;AAKA,MAAa,
|
|
1
|
+
{"version":3,"file":"app.exception.js","sourceRoot":"","sources":["../../src/exceptions/app.exception.ts"],"names":[],"mappings":";;;AAKA,MAAa,YAAmD,SAAQ,KAAK;IAK3E,YAAY,EACV,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,OAAO,GAMR;QACC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,OAAO;YACL,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB;SACF,CAAC;IACJ,CAAC;CACF;AAhCD,oCAgCC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppBadRequestException extends AppException {
|
|
3
|
-
constructor({ message, code }?: {
|
|
2
|
+
export declare class AppBadRequestException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
|
+
constructor({ message, code, details, }?: {
|
|
4
4
|
message?: string;
|
|
5
5
|
code?: string;
|
|
6
|
+
details?: TDetails;
|
|
6
7
|
});
|
|
7
8
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppBadRequestException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ message = 'Bad request.', code } = {}) {
|
|
8
|
+
constructor({ message = 'Bad request.', code, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.BadRequest,
|
|
12
12
|
httpCode: common_1.HttpStatus.BAD_REQUEST,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bad-request.exception.js","sourceRoot":"","sources":["../../src/exceptions/bad-request.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,
|
|
1
|
+
{"version":3,"file":"bad-request.exception.js","sourceRoot":"","sources":["../../src/exceptions/bad-request.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,sBAA6C,SAAQ,4BAAsB;IACtF,YAAY,EACV,OAAO,GAAG,cAAc,EACxB,IAAI,EACJ,OAAO,MACoD,EAAE;QAC7D,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,UAAU;YACtC,QAAQ,EAAE,mBAAU,CAAC,WAAW;YAChC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAbD,wDAaC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
|
|
2
|
+
import { IValidationErrorDetails } from './interfaces/validation-error-detail.interface';
|
|
3
|
+
export declare class AppConflictException extends AppException<IValidationErrorDetails[]> {
|
|
3
4
|
readonly conflictedFields: string[];
|
|
4
5
|
constructor({ conflictedFields, message, code, }: {
|
|
5
6
|
conflictedFields: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conflict.exception.js","sourceRoot":"","sources":["../../src/exceptions/conflict.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAE/C,mFAAqE;AACrE,iGAAkF;AAElF,MAAa,oBAAqB,SAAQ,
|
|
1
|
+
{"version":3,"file":"conflict.exception.js","sourceRoot":"","sources":["../../src/exceptions/conflict.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAE/C,mFAAqE;AACrE,iGAAkF;AAElF,MAAa,oBAAqB,SAAQ,4BAAuC;IAG/E,YAAY,EACV,gBAAgB,EAChB,OAAO,GAAG,6BAA6B,EACvC,IAAI,GAKL;QACC,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,uBAAuB;YACnD,QAAQ,EAAE,mBAAU,CAAC,QAAQ;YAC7B,OAAO,EAAE,oBAAoB,CAAC,YAAY,CAAC,gBAAgB,CAAC;SAC7D,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,gBAA0B;QACpD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAK,EAA2B,EAAE;YAC7D,OAAO;gBACL,IAAI,EAAE,qDAAmB,CAAC,aAAa;gBACvC,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,GAAG,KAAK,iBAAiB;aACnC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,oDA+BC"}
|
|
@@ -1,16 +1,49 @@
|
|
|
1
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
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
8
41
|
var GlobalExceptionFilter_1;
|
|
9
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
43
|
exports.GlobalExceptionFilter = void 0;
|
|
11
44
|
const common_1 = require("@nestjs/common");
|
|
12
45
|
const typeorm_1 = require("typeorm");
|
|
13
|
-
const
|
|
46
|
+
const z = __importStar(require("zod/v4/core"));
|
|
14
47
|
const app_exception_1 = require("../app.exception");
|
|
15
48
|
const internal_exception_1 = require("../internal.exception");
|
|
16
49
|
const nestjs_exception_transformer_1 = require("../transformers/nestjs.exception-transformer");
|
|
@@ -30,7 +63,7 @@ let GlobalExceptionFilter = GlobalExceptionFilter_1 = class GlobalExceptionFilte
|
|
|
30
63
|
return response.status(exception.httpCode).json(exception.toJSON());
|
|
31
64
|
}
|
|
32
65
|
let appException;
|
|
33
|
-
if (exception instanceof
|
|
66
|
+
if (exception instanceof z.$ZodError) {
|
|
34
67
|
appException = new validation_exception_1.AppValidationException(exception);
|
|
35
68
|
}
|
|
36
69
|
else if (exception instanceof typeorm_1.TypeORMError) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.exception-filter.js","sourceRoot":"","sources":["../../../src/exceptions/filters/global.exception-filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"global.exception-filter.js","sourceRoot":"","sources":["../../../src/exceptions/filters/global.exception-filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8F;AAC9F,qCAAuC;AACvC,+CAAiC;AAEjC,oDAAgD;AAChD,8DAA6D;AAC7D,+FAA0F;AAC1F,iGAA4F;AAC5F,kEAAiE;AAG1D,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAA3B;QACY,WAAM,GAAG,IAAI,eAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IAsCnE,CAAC;IApCC,KAAK,CAAC,SAAc,EAAE,IAAmB;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAEnC,IAAI,CAAC;YACH,IAAI,SAAS,YAAY,4BAAY,EAAE,CAAC;gBACtC,IAAI,SAAS,YAAY,yCAAoB;oBAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBAE5E,OAAO,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;YACtE,CAAC;YAED,IAAI,YAAsC,CAAC;YAE3C,IAAI,SAAS,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC;gBACrC,YAAY,GAAG,IAAI,6CAAsB,CAAC,SAAS,CAAC,CAAC;YACvD,CAAC;iBAAM,IAAI,SAAS,YAAY,sBAAY,EAAE,CAAC;gBAC7C,YAAY,GAAG,2DAA2B,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YAClE,CAAC;iBAAM,IAAI,SAAS,YAAY,sBAAa,EAAE,CAAC;gBAC9C,YAAY,GAAG,yDAA0B,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACjE,CAAC;YAED,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,YAAY,GAAG,IAAI,yCAAoB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAChE,CAAC;YAED,IAAI,YAAY,YAAY,yCAAoB;gBAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAElF,OAAO,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,GAAG,GAAG,IAAI,yCAAoB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YAEhD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEvB,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF,CAAA;AAvCY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,cAAK,GAAE;GACK,qBAAqB,CAuCjC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppForbiddenException extends AppException {
|
|
3
|
-
constructor({ message, code, }?: {
|
|
2
|
+
export declare class AppForbiddenException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
|
+
constructor({ message, code, details, }?: {
|
|
4
4
|
message?: string;
|
|
5
5
|
code?: string;
|
|
6
|
+
details?: TDetails;
|
|
6
7
|
});
|
|
7
8
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppForbiddenException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ message = 'You do not have permission to access this resource.', code, } = {}) {
|
|
8
|
+
constructor({ message = 'You do not have permission to access this resource.', code, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.InsufficientPermissions,
|
|
12
12
|
httpCode: common_1.HttpStatus.FORBIDDEN,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forbidden.exception.js","sourceRoot":"","sources":["../../src/exceptions/forbidden.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,
|
|
1
|
+
{"version":3,"file":"forbidden.exception.js","sourceRoot":"","sources":["../../src/exceptions/forbidden.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,qBAA4C,SAAQ,4BAAsB;IACrF,YAAY,EACV,OAAO,GAAG,qDAAqD,EAC/D,IAAI,EACJ,OAAO,MACoD,EAAE;QAC7D,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,uBAAuB;YACnD,QAAQ,EAAE,mBAAU,CAAC,SAAS;YAC9B,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAbD,sDAaC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IValidationErrorDetails } from './validation-error-detail.interface';
|
|
2
|
-
export interface IErrorResponse {
|
|
2
|
+
export interface IErrorResponse<TDetails = IValidationErrorDetails[]> {
|
|
3
3
|
error: {
|
|
4
4
|
code: string;
|
|
5
5
|
message: string;
|
|
6
|
-
details?:
|
|
6
|
+
details?: TDetails;
|
|
7
7
|
};
|
|
8
8
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppInternalException extends AppException {
|
|
2
|
+
export declare class AppInternalException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
3
|
readonly originalError?: Error;
|
|
4
|
-
constructor({ message, code, error, }?: {
|
|
4
|
+
constructor({ message, code, error, details, }?: {
|
|
5
5
|
message?: string;
|
|
6
6
|
code?: string;
|
|
7
7
|
error?: Error;
|
|
8
|
+
details?: TDetails;
|
|
8
9
|
});
|
|
9
10
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppInternalException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ message = 'An unexpected error occurred.', code, error, } = {}) {
|
|
8
|
+
constructor({ message = 'An unexpected error occurred.', code, error, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.UnexpectedError,
|
|
12
12
|
httpCode: common_1.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
this.originalError = error;
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.exception.js","sourceRoot":"","sources":["../../src/exceptions/internal.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,
|
|
1
|
+
{"version":3,"file":"internal.exception.js","sourceRoot":"","sources":["../../src/exceptions/internal.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,oBAA2C,SAAQ,4BAAsB;IAGpF,YAAY,EACV,OAAO,GAAG,+BAA+B,EACzC,IAAI,EACJ,KAAK,EACL,OAAO,MACmE,EAAE;QAC5E,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,eAAe;YAC3C,QAAQ,EAAE,mBAAU,CAAC,qBAAqB;YAC1C,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;CACF;AAlBD,oDAkBC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppNotFoundException extends AppException {
|
|
2
|
+
export declare class AppNotFoundException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
3
|
readonly resourceName: string;
|
|
4
|
-
constructor({ resourceName, message, code, }?: {
|
|
4
|
+
constructor({ resourceName, message, code, details, }?: {
|
|
5
5
|
resourceName?: string;
|
|
6
6
|
message?: string;
|
|
7
7
|
code?: string;
|
|
8
|
+
details?: TDetails;
|
|
8
9
|
});
|
|
9
10
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppNotFoundException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ resourceName = 'Resource', message, code, } = {}) {
|
|
8
|
+
constructor({ resourceName = 'Resource', message, code, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message: message || `${resourceName} not found.`,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.ResourceNotFound,
|
|
12
12
|
httpCode: common_1.HttpStatus.NOT_FOUND,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
this.resourceName = resourceName;
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-found.exception.js","sourceRoot":"","sources":["../../src/exceptions/not-found.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,
|
|
1
|
+
{"version":3,"file":"not-found.exception.js","sourceRoot":"","sources":["../../src/exceptions/not-found.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,oBAA2C,SAAQ,4BAAsB;IAGpF,YAAY,EACV,YAAY,GAAG,UAAU,EACzB,OAAO,EACP,IAAI,EACJ,OAAO,MAC2E,EAAE;QACpF,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,IAAI,GAAG,YAAY,aAAa;YAChD,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,gBAAgB;YAC5C,QAAQ,EAAE,mBAAU,CAAC,SAAS;YAC9B,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAlBD,oDAkBC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppTooManyRequestException extends AppException {
|
|
3
|
-
constructor({ message, code, }?: {
|
|
2
|
+
export declare class AppTooManyRequestException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
|
+
constructor({ message, code, details, }?: {
|
|
4
4
|
message?: string;
|
|
5
5
|
code?: string;
|
|
6
|
+
details?: TDetails;
|
|
6
7
|
});
|
|
7
8
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppTooManyRequestException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ message = 'You have exceeded the number of allowed requests. Please try again later.', code, } = {}) {
|
|
8
|
+
constructor({ message = 'You have exceeded the number of allowed requests. Please try again later.', code, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.RateLimit,
|
|
12
12
|
httpCode: common_1.HttpStatus.TOO_MANY_REQUESTS,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"too-many-request.exception.js","sourceRoot":"","sources":["../../src/exceptions/too-many-request.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,
|
|
1
|
+
{"version":3,"file":"too-many-request.exception.js","sourceRoot":"","sources":["../../src/exceptions/too-many-request.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,0BAAiD,SAAQ,4BAAsB;IAC1F,YAAY,EACV,OAAO,GAAG,2EAA2E,EACrF,IAAI,EACJ,OAAO,MACoD,EAAE;QAC7D,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,SAAS;YACrC,QAAQ,EAAE,mBAAU,CAAC,iBAAiB;YACtC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAbD,gEAaC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpException } from '@nestjs/common';
|
|
2
2
|
import { AppException } from '../app.exception';
|
|
3
3
|
export declare class NestJSExceptionTransformer {
|
|
4
|
-
static transform(exception: HttpException): AppException | undefined;
|
|
4
|
+
static transform(exception: HttpException): AppException<any> | undefined;
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeORMError } from 'typeorm';
|
|
2
2
|
import { AppException } from '../app.exception';
|
|
3
3
|
export declare class TypeORMExceptionTransformer {
|
|
4
|
-
static transform(exception: TypeORMError): AppException | undefined;
|
|
4
|
+
static transform(exception: TypeORMError): AppException<any> | undefined;
|
|
5
5
|
private static postgresQueryFailedExceptionMapper;
|
|
6
6
|
private static transformEntityNotFoundError;
|
|
7
7
|
private static transformConflictError;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppUnauthorizedException extends AppException {
|
|
3
|
-
constructor({ message, code }?: {
|
|
2
|
+
export declare class AppUnauthorizedException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
|
+
constructor({ message, code, details, }?: {
|
|
4
4
|
message?: string;
|
|
5
5
|
code?: string;
|
|
6
|
+
details?: TDetails;
|
|
6
7
|
});
|
|
7
8
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppUnauthorizedException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ message = 'Access denied.', code } = {}) {
|
|
8
|
+
constructor({ message = 'Access denied.', code, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.Unauthorized,
|
|
12
12
|
httpCode: common_1.HttpStatus.UNAUTHORIZED,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unauthorized.exception.js","sourceRoot":"","sources":["../../src/exceptions/unauthorized.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,
|
|
1
|
+
{"version":3,"file":"unauthorized.exception.js","sourceRoot":"","sources":["../../src/exceptions/unauthorized.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,wBAA+C,SAAQ,4BAAsB;IACxF,YAAY,EACV,OAAO,GAAG,gBAAgB,EAC1B,IAAI,EACJ,OAAO,MACoD,EAAE;QAC7D,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,YAAY;YACxC,QAAQ,EAAE,mBAAU,CAAC,YAAY;YACjC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAbD,4DAaC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AppException } from './app.exception';
|
|
2
|
-
export declare class AppUnprocessableEntityException extends AppException {
|
|
3
|
-
constructor({ message, code }?: {
|
|
2
|
+
export declare class AppUnprocessableEntityException<TDetails = undefined> extends AppException<TDetails> {
|
|
3
|
+
constructor({ message, code, details, }?: {
|
|
4
4
|
message?: string;
|
|
5
5
|
code?: string;
|
|
6
|
+
details?: TDetails;
|
|
6
7
|
});
|
|
7
8
|
}
|
|
@@ -5,11 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const app_exception_1 = require("./app.exception");
|
|
6
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
7
7
|
class AppUnprocessableEntityException extends app_exception_1.AppException {
|
|
8
|
-
constructor({ message = 'Unprocessable entity.', code } = {}) {
|
|
8
|
+
constructor({ message = 'Unprocessable entity.', code, details, } = {}) {
|
|
9
9
|
super({
|
|
10
10
|
message,
|
|
11
11
|
code: code || exception_code_reference_1.ExceptionCode.UnprocessableEntity,
|
|
12
12
|
httpCode: common_1.HttpStatus.UNPROCESSABLE_ENTITY,
|
|
13
|
+
details,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unprocessable-entity.exception.js","sourceRoot":"","sources":["../../src/exceptions/unprocessable-entity.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,+
|
|
1
|
+
{"version":3,"file":"unprocessable-entity.exception.js","sourceRoot":"","sources":["../../src/exceptions/unprocessable-entity.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,+BAAsD,SAAQ,4BAAsB;IAC/F,YAAY,EACV,OAAO,GAAG,uBAAuB,EACjC,IAAI,EACJ,OAAO,MACoD,EAAE;QAC7D,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,mBAAmB;YAC/C,QAAQ,EAAE,mBAAU,CAAC,oBAAoB;YACzC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAbD,0EAaC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/v4/core';
|
|
2
2
|
import { AppException } from './app.exception';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { IValidationErrorDetails } from './interfaces/validation-error-detail.interface';
|
|
4
|
+
export declare class AppValidationException extends AppException<IValidationErrorDetails[]> {
|
|
5
|
+
readonly zodError: z.$ZodError;
|
|
6
|
+
constructor(error: z.$ZodError);
|
|
6
7
|
private static buildDetails;
|
|
7
8
|
private static detectDetailType;
|
|
8
9
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppValidationException = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
5
|
const app_exception_1 = require("./app.exception");
|
|
7
6
|
const exception_code_reference_1 = require("./reference/exception-code.reference");
|
|
8
7
|
const validation_error_type_reference_1 = require("./reference/validation-error-type.reference");
|
|
@@ -17,10 +16,10 @@ class AppValidationException extends app_exception_1.AppException {
|
|
|
17
16
|
this.zodError = error;
|
|
18
17
|
}
|
|
19
18
|
static buildDetails(zodError) {
|
|
20
|
-
return zodError.
|
|
19
|
+
return zodError.issues.flatMap((error) => {
|
|
21
20
|
const type = this.detectDetailType(error);
|
|
22
21
|
const paths = error.path.map((item) => item.toString());
|
|
23
|
-
if (error.code ===
|
|
22
|
+
if (error.code === 'unrecognized_keys') {
|
|
24
23
|
return error.keys.map((key) => ({
|
|
25
24
|
type: validation_error_type_reference_1.ValidationErrorType.Unrecognized,
|
|
26
25
|
path: [...paths, key].join('.'),
|
|
@@ -38,12 +37,13 @@ class AppValidationException extends app_exception_1.AppException {
|
|
|
38
37
|
}
|
|
39
38
|
static detectDetailType(error) {
|
|
40
39
|
switch (error.code) {
|
|
41
|
-
case
|
|
42
|
-
if (error.received
|
|
40
|
+
case 'invalid_type': {
|
|
41
|
+
if (error.message.includes('received undefined')) {
|
|
43
42
|
return validation_error_type_reference_1.ValidationErrorType.MissingField;
|
|
43
|
+
}
|
|
44
44
|
return validation_error_type_reference_1.ValidationErrorType.Invalid;
|
|
45
45
|
}
|
|
46
|
-
case
|
|
46
|
+
case 'unrecognized_keys':
|
|
47
47
|
return validation_error_type_reference_1.ValidationErrorType.Unrecognized;
|
|
48
48
|
default:
|
|
49
49
|
return validation_error_type_reference_1.ValidationErrorType.Invalid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.exception.js","sourceRoot":"","sources":["../../src/exceptions/validation.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;
|
|
1
|
+
{"version":3,"file":"validation.exception.js","sourceRoot":"","sources":["../../src/exceptions/validation.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAG5C,mDAA+C;AAE/C,mFAAqE;AACrE,iGAAkF;AAElF,MAAa,sBAAuB,SAAQ,4BAAuC;IAGjF,YAAY,KAAkB;QAC5B,KAAK,CAAC;YACJ,IAAI,EAAE,wCAAa,CAAC,gBAAgB;YACpC,QAAQ,EAAE,mBAAU,CAAC,WAAW;YAChC,OAAO,EAAE,0BAA0B;YACnC,OAAO,EAAE,sBAAsB,CAAC,YAAY,CAAC,KAAK,CAAC;SACpD,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,QAAqB;QAC/C,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAA6B,EAAE;YAClE,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAE1C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAExD,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;gBACvC,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,qDAAmB,CAAC,YAAY;oBACtC,IAAI,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;oBAC/B,OAAO,EAAE,4BAA4B;iBACtC,CAAC,CAAC,CAAC;YACN,CAAC;YAED,OAAO;gBACL;oBACE,IAAI;oBACJ,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;oBACrB,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,KAAkB;QAChD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,cAAc,CAAC,CAAC,CAAC;gBACpB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;oBACjD,OAAO,qDAAmB,CAAC,YAAY,CAAC;gBAC1C,CAAC;gBAED,OAAO,qDAAmB,CAAC,OAAO,CAAC;YACrC,CAAC;YAED,KAAK,mBAAmB;gBACtB,OAAO,qDAAmB,CAAC,YAAY,CAAC;YAE1C;gBACE,OAAO,qDAAmB,CAAC,OAAO,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAvDD,wDAuDC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZodValidationPipe } from '@anatine/zod-nestjs';
|
|
2
1
|
import { ArgumentMetadata } from '@nestjs/common';
|
|
2
|
+
import { ZodValidationPipe } from 'nestjs-zod';
|
|
3
3
|
export declare class AppZodValidationPipe extends ZodValidationPipe {
|
|
4
|
-
transform(value: unknown, metadata: ArgumentMetadata):
|
|
4
|
+
transform(value: unknown, metadata: ArgumentMetadata): any;
|
|
5
5
|
}
|
|
@@ -7,12 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AppZodValidationPipe = void 0;
|
|
10
|
-
const zod_nestjs_1 = require("@anatine/zod-nestjs");
|
|
11
10
|
const common_1 = require("@nestjs/common");
|
|
11
|
+
const nestjs_zod_1 = require("nestjs-zod");
|
|
12
12
|
const exceptions_1 = require("../exceptions");
|
|
13
|
-
let AppZodValidationPipe = class AppZodValidationPipe extends
|
|
13
|
+
let AppZodValidationPipe = class AppZodValidationPipe extends nestjs_zod_1.ZodValidationPipe {
|
|
14
14
|
transform(value, metadata) {
|
|
15
|
-
const zodSchema = metadata?.metatype?.
|
|
15
|
+
const zodSchema = metadata?.metatype?.schema;
|
|
16
16
|
if (!zodSchema)
|
|
17
17
|
return value;
|
|
18
18
|
const parseResult = zodSchema.safeParse(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-zod-validation.pipe.js","sourceRoot":"","sources":["../../src/pipes/app-zod-validation.pipe.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"app-zod-validation.pipe.js","sourceRoot":"","sources":["../../src/pipes/app-zod-validation.pipe.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8D;AAC9D,2CAA+C;AAE/C,8CAAuD;AAGhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,8BAAiB;IACzD,SAAS,CAAC,KAAc,EAAE,QAA0B;QAClD,MAAM,SAAS,GAAI,QAAQ,EAAE,QAAgB,EAAE,MAAM,CAAC;QAEtD,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAE7B,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAE/C,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE,MAAM,IAAI,mCAAsB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE9E,OAAO,WAAW,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF,CAAA;AAZY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CAYhC"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const createOrderBySchema: (fields: string[]) => z.ZodObject<{
|
|
3
|
-
order_by: z.ZodOptional<z.
|
|
3
|
+
order_by: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
4
4
|
[x: string]: string;
|
|
5
|
-
}, string
|
|
6
|
-
|
|
7
|
-
}, string>>;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
order_by?: {
|
|
10
|
-
[x: string]: string;
|
|
11
|
-
} | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
order_by?: string | undefined;
|
|
14
|
-
}>;
|
|
5
|
+
}, string>>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const paginationSchema: z.
|
|
3
|
-
page: z.ZodDefault<z.ZodOptional<z.
|
|
4
|
-
per_page: z.ZodDefault<z.ZodOptional<z.
|
|
5
|
-
},
|
|
6
|
-
page: number;
|
|
7
|
-
per_page: number;
|
|
8
|
-
}, {
|
|
9
|
-
page?: number | undefined;
|
|
10
|
-
per_page?: number | undefined;
|
|
11
|
-
}>, {
|
|
2
|
+
export declare const paginationSchema: z.ZodPipe<z.ZodObject<{
|
|
3
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
4
|
+
per_page: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
5
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
12
6
|
skip: number;
|
|
13
7
|
take: number;
|
|
14
8
|
}, {
|
|
15
|
-
page
|
|
16
|
-
per_page
|
|
17
|
-
}
|
|
9
|
+
page: number;
|
|
10
|
+
per_page: number;
|
|
11
|
+
}>>;
|
|
18
12
|
export type PaginationParams = z.output<typeof paginationSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furkanogutcu/nest-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Package of common structures for NestJS.",
|
|
5
5
|
"author": "Furkan Ogutcu",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,45 +45,45 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/furkanogutcu/nest-common#readme",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@nestjs/common": "^11.1.
|
|
49
|
-
"@nestjs/core": "^11.1.
|
|
48
|
+
"@nestjs/common": "^11.1.6",
|
|
49
|
+
"@nestjs/core": "^11.1.6",
|
|
50
|
+
"@nestjs/platform-express": "^11.1.6",
|
|
51
|
+
"@nestjs/testing": "11.1.6",
|
|
50
52
|
"@nestjs/typeorm": "^11.0.0",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"zod": "^
|
|
54
|
-
"typeorm": "^0.3.25",
|
|
55
|
-
"@anatine/zod-nestjs": "^2.0.12"
|
|
53
|
+
"typeorm": "^0.3.26",
|
|
54
|
+
"zod": "^4.0.17",
|
|
55
|
+
"nestjs-zod": "^5.0.0"
|
|
56
56
|
},
|
|
57
|
-
"dependencies": {},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
58
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
59
|
+
"@eslint/js": "^9.33.0",
|
|
60
|
+
"@nestjs/common": "^11.1.6",
|
|
61
|
+
"@nestjs/core": "^11.1.6",
|
|
62
|
+
"@nestjs/platform-express": "^11.1.6",
|
|
63
|
+
"@nestjs/testing": "11.1.6",
|
|
61
64
|
"@nestjs/typeorm": "^11.0.0",
|
|
62
|
-
"
|
|
63
|
-
"@
|
|
64
|
-
"
|
|
65
|
-
"typeorm": "^0.3.25",
|
|
65
|
+
"nestjs-zod": "^5.0.0",
|
|
66
|
+
"@swc/cli": "^0.7.8",
|
|
67
|
+
"@swc/core": "^1.13.3",
|
|
66
68
|
"@types/express": "5.0.3",
|
|
67
69
|
"@types/jest": "30.0.0",
|
|
68
|
-
"@types/node": "24.
|
|
70
|
+
"@types/node": "24.3.0",
|
|
69
71
|
"@types/supertest": "6.0.3",
|
|
72
|
+
"eslint": "^9.33.0",
|
|
73
|
+
"eslint-config-prettier": "^10.1.8",
|
|
74
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
75
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
70
76
|
"jest": "30.0.5",
|
|
71
77
|
"prettier": "3.6.2",
|
|
72
78
|
"supertest": "7.1.4",
|
|
73
|
-
"ts-jest": "29.4.
|
|
79
|
+
"ts-jest": "29.4.1",
|
|
74
80
|
"ts-node": "10.9.2",
|
|
75
81
|
"tsc-watch": "7.1.1",
|
|
76
82
|
"tsconfig-paths": "4.2.0",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"@swc/core": "^1.13.2",
|
|
82
|
-
"eslint": "^9.31.0",
|
|
83
|
-
"eslint-config-prettier": "^10.1.8",
|
|
84
|
-
"eslint-plugin-prettier": "^5.5.3",
|
|
85
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
86
|
-
"typescript-eslint": "^8.38.0"
|
|
83
|
+
"typeorm": "^0.3.26",
|
|
84
|
+
"typescript": "5.9.2",
|
|
85
|
+
"typescript-eslint": "^8.40.0",
|
|
86
|
+
"zod": "^4.0.17"
|
|
87
87
|
},
|
|
88
88
|
"jest": {
|
|
89
89
|
"moduleFileExtensions": [
|