@furkanogutcu/nest-common 1.0.4 → 1.0.6
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/filters/global.exception-filter.js +35 -2
- package/dist/exceptions/filters/global.exception-filter.js.map +1 -1
- package/dist/exceptions/validation.exception.d.ts +3 -3
- package/dist/exceptions/validation.exception.js +10 -8
- 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 +45 -9
- 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,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,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/v4/core';
|
|
2
2
|
import { AppException } from './app.exception';
|
|
3
3
|
import { IValidationErrorDetails } from './interfaces/validation-error-detail.interface';
|
|
4
4
|
export declare class AppValidationException extends AppException<IValidationErrorDetails[]> {
|
|
5
|
-
readonly zodError: ZodError;
|
|
6
|
-
constructor(error
|
|
5
|
+
readonly zodError: z.$ZodError;
|
|
6
|
+
constructor(error?: z.$ZodError);
|
|
7
7
|
private static buildDetails;
|
|
8
8
|
private static detectDetailType;
|
|
9
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");
|
|
@@ -12,15 +11,17 @@ class AppValidationException extends app_exception_1.AppException {
|
|
|
12
11
|
code: exception_code_reference_1.ExceptionCode.ValidationFailed,
|
|
13
12
|
httpCode: common_1.HttpStatus.BAD_REQUEST,
|
|
14
13
|
message: 'Invalid request payload.',
|
|
15
|
-
details: AppValidationException.buildDetails(error),
|
|
14
|
+
details: error ? AppValidationException.buildDetails(error) : undefined,
|
|
16
15
|
});
|
|
17
|
-
|
|
16
|
+
if (error) {
|
|
17
|
+
this.zodError = error;
|
|
18
|
+
}
|
|
18
19
|
}
|
|
19
20
|
static buildDetails(zodError) {
|
|
20
|
-
return zodError.
|
|
21
|
+
return zodError.issues.flatMap((error) => {
|
|
21
22
|
const type = this.detectDetailType(error);
|
|
22
23
|
const paths = error.path.map((item) => item.toString());
|
|
23
|
-
if (error.code ===
|
|
24
|
+
if (error.code === 'unrecognized_keys') {
|
|
24
25
|
return error.keys.map((key) => ({
|
|
25
26
|
type: validation_error_type_reference_1.ValidationErrorType.Unrecognized,
|
|
26
27
|
path: [...paths, key].join('.'),
|
|
@@ -38,12 +39,13 @@ class AppValidationException extends app_exception_1.AppException {
|
|
|
38
39
|
}
|
|
39
40
|
static detectDetailType(error) {
|
|
40
41
|
switch (error.code) {
|
|
41
|
-
case
|
|
42
|
-
if (error.received
|
|
42
|
+
case 'invalid_type': {
|
|
43
|
+
if (error.message.includes('received undefined')) {
|
|
43
44
|
return validation_error_type_reference_1.ValidationErrorType.MissingField;
|
|
45
|
+
}
|
|
44
46
|
return validation_error_type_reference_1.ValidationErrorType.Invalid;
|
|
45
47
|
}
|
|
46
|
-
case
|
|
48
|
+
case 'unrecognized_keys':
|
|
47
49
|
return validation_error_type_reference_1.ValidationErrorType.Unrecognized;
|
|
48
50
|
default:
|
|
49
51
|
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,KAAmB;QAC7B,KAAK,CAAC;YACJ,IAAI,EAAE,wCAAa,CAAC,gBAAgB;YACpC,QAAQ,EAAE,mBAAU,CAAC,WAAW;YAChC,OAAO,EAAE,0BAA0B;YACnC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,sBAAsB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SACxE,CAAC,CAAC;QAEH,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,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;AAzDD,wDAyDC"}
|
|
@@ -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
|
}
|
|
@@ -1,24 +1,60 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
42
|
exports.AppZodValidationPipe = void 0;
|
|
10
|
-
const zod_nestjs_1 = require("@anatine/zod-nestjs");
|
|
11
43
|
const common_1 = require("@nestjs/common");
|
|
44
|
+
const nestjs_zod_1 = require("nestjs-zod");
|
|
45
|
+
const z = __importStar(require("zod/v4/core"));
|
|
12
46
|
const exceptions_1 = require("../exceptions");
|
|
13
|
-
let AppZodValidationPipe = class AppZodValidationPipe extends
|
|
47
|
+
let AppZodValidationPipe = class AppZodValidationPipe extends nestjs_zod_1.ZodValidationPipe {
|
|
14
48
|
transform(value, metadata) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
49
|
+
try {
|
|
50
|
+
return super.transform(value, metadata);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error.error && error.error instanceof z.$ZodError) {
|
|
54
|
+
throw new exceptions_1.AppValidationException(error.error);
|
|
55
|
+
}
|
|
56
|
+
throw new exceptions_1.AppValidationException();
|
|
57
|
+
}
|
|
22
58
|
}
|
|
23
59
|
};
|
|
24
60
|
exports.AppZodValidationPipe = AppZodValidationPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-zod-validation.pipe.js","sourceRoot":"","sources":["../../src/pipes/app-zod-validation.pipe.ts"],"names":[],"mappings":"
|
|
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;AAC/C,+CAAiC;AAEjC,8CAAuD;AAGhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,8BAAiB;IACzD,SAAS,CAAC,KAAc,EAAE,QAA0B;QAClD,IAAI,CAAC;YACH,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC;gBACtD,MAAM,IAAI,mCAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAChD,CAAC;YAED,MAAM,IAAI,mCAAsB,EAAE,CAAC;QACrC,CAAC;IACH,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.6",
|
|
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": [
|