@maioradv/nestjs-core 1.7.2 → 1.8.0
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/decorators/api-response-with-rels.decorator.d.ts +1 -1
- package/dist/decorators/api-response-with-rels.decorator.js +2 -2
- package/dist/decorators/boolean.transform.d.ts +1 -1
- package/dist/dto/clauses/standard-clauses.decorator.d.ts +5 -5
- package/dist/dto/index.d.ts +1 -0
- package/dist/dto/index.js +1 -0
- package/dist/dto/pagination/cursor-paginated.dto.js +2 -2
- package/dist/dto/pagination/paginated-response.decorator.d.ts +1 -1
- package/dist/dto/pagination/pagination-params.decorator.d.ts +1 -1
- package/dist/dto/slugger/index.d.ts +3 -0
- package/dist/dto/slugger/index.js +7 -0
- package/dist/dto/slugger/slug-check.dto.d.ts +3 -0
- package/dist/dto/slugger/slug-check.dto.js +23 -0
- package/dist/dto/slugger/slug-check.response.dto.d.ts +5 -0
- package/dist/dto/slugger/slug-check.response.dto.js +35 -0
- package/dist/dto/sorting/sorting-params.decorator.d.ts +2 -2
- package/dist/pipes/image-compression.pipe.d.ts +0 -1
- package/dist/providers/crypt.service.js +17 -7
- package/dist/providers/s3.service.d.ts +0 -1
- package/dist/providers/storage.service.d.ts +0 -4
- package/dist/utils/image.helper.d.ts +0 -1
- package/dist/utils/image.helper.js +1 -2
- package/dist/utils/price.helper.js +1 -2
- package/dist/utils/time.helper.js +1 -2
- package/package.json +24 -25
|
@@ -22,7 +22,7 @@ export type RelationDefs = {
|
|
|
22
22
|
manyToMany?: [TModel, TModel | TModel[]][];
|
|
23
23
|
};
|
|
24
24
|
export type ApiReponseWithRelsOptions = WithRequired<ApiResponseMetadata, 'type'>;
|
|
25
|
-
export declare const ApiResponseWithRels: (options: ApiReponseWithRelsOptions, relations: RelationDefs) => <TFunction extends Function, Y>(target:
|
|
25
|
+
export declare const ApiResponseWithRels: (options: ApiReponseWithRelsOptions, relations: RelationDefs) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
26
26
|
export declare function handleRelationsForSwagger(relations: RelationDefs): {
|
|
27
27
|
properties: Record<string, SchemaObject | ReferenceObject>;
|
|
28
28
|
extraModels: Type<any>[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ApiResponseWithRels = void 0;
|
|
4
|
+
exports.handleRelationsForSwagger = handleRelationsForSwagger;
|
|
4
5
|
const common_1 = require("@nestjs/common");
|
|
5
6
|
const swagger_1 = require("@nestjs/swagger");
|
|
6
7
|
const ApiResponseWithRels = (options, relations) => {
|
|
@@ -66,4 +67,3 @@ function handleRelationsForSwagger(relations) {
|
|
|
66
67
|
});
|
|
67
68
|
return { properties, extraModels };
|
|
68
69
|
}
|
|
69
|
-
exports.handleRelationsForSwagger = handleRelationsForSwagger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const BooleanTransform: () => <TFunction extends Function, Y>(target:
|
|
1
|
+
export declare const BooleanTransform: () => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const IsStringClause: (options?: {
|
|
2
2
|
isArray?: boolean;
|
|
3
|
-
}) => <TFunction extends Function, Y>(target:
|
|
4
|
-
export declare const IsEnumClause: (model: object) => <TFunction extends Function, Y>(target:
|
|
5
|
-
export declare const IsNumberClause: () => <TFunction extends Function, Y>(target:
|
|
6
|
-
export declare const IsBooleanClause: () => <TFunction extends Function, Y>(target:
|
|
7
|
-
export declare const IsDateStringClause: () => <TFunction extends Function, Y>(target:
|
|
3
|
+
}) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
4
|
+
export declare const IsEnumClause: (model: object) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
5
|
+
export declare const IsNumberClause: () => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
6
|
+
export declare const IsBooleanClause: () => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
7
|
+
export declare const IsDateStringClause: () => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
package/dist/dto/index.d.ts
CHANGED
package/dist/dto/index.js
CHANGED
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.PaginatedGQLDto =
|
|
15
|
+
exports.PaginatedGQLDto = void 0;
|
|
16
|
+
exports.PaginatedGQL = PaginatedGQL;
|
|
16
17
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
18
|
const cursor_meta_dto_1 = __importDefault(require("./cursor-meta.dto"));
|
|
18
19
|
function PaginatedGQL(classRef) {
|
|
@@ -48,7 +49,6 @@ function PaginatedGQL(classRef) {
|
|
|
48
49
|
], PaginatedType);
|
|
49
50
|
return PaginatedType;
|
|
50
51
|
}
|
|
51
|
-
exports.PaginatedGQL = PaginatedGQL;
|
|
52
52
|
class PaginatedGQLDto {
|
|
53
53
|
constructor(data, meta) {
|
|
54
54
|
this.edges = this.getEdges(data);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@nestjs/common";
|
|
2
2
|
import { ApiResponseOptions } from "@nestjs/swagger";
|
|
3
3
|
import { RelationDefs } from "../../decorators";
|
|
4
|
-
declare const ApiPaginatedResponse: <TModel extends Type<any>>(model: TModel, relations?: RelationDefs, options?: ApiResponseOptions) => <TFunction extends Function, Y>(target:
|
|
4
|
+
declare const ApiPaginatedResponse: <TModel extends Type<any>>(model: TModel, relations?: RelationDefs, options?: ApiResponseOptions) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
5
5
|
export default ApiPaginatedResponse;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Type } from "@nestjs/common";
|
|
2
|
-
declare const ApiPaginationParams: <TModel extends Type<any>>() => <TFunction extends Function, Y>(target:
|
|
2
|
+
declare const ApiPaginationParams: <TModel extends Type<any>>() => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
3
3
|
export default ApiPaginationParams;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlugCheckResponseDto = exports.SlugCheckDto = void 0;
|
|
4
|
+
const slug_check_dto_1 = require("./slug-check.dto");
|
|
5
|
+
Object.defineProperty(exports, "SlugCheckDto", { enumerable: true, get: function () { return slug_check_dto_1.SlugCheckDto; } });
|
|
6
|
+
const slug_check_response_dto_1 = require("./slug-check.response.dto");
|
|
7
|
+
Object.defineProperty(exports, "SlugCheckResponseDto", { enumerable: true, get: function () { return slug_check_response_dto_1.SlugCheckResponseDto; } });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SlugCheckDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class SlugCheckDto {
|
|
16
|
+
}
|
|
17
|
+
exports.SlugCheckDto = SlugCheckDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)(),
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], SlugCheckDto.prototype, "input", void 0);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SlugCheckResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class SlugCheckResponseDto {
|
|
16
|
+
}
|
|
17
|
+
exports.SlugCheckResponseDto = SlugCheckResponseDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)(),
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], SlugCheckResponseDto.prototype, "input", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, swagger_1.ApiProperty)(),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], SlugCheckResponseDto.prototype, "output", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)(),
|
|
32
|
+
(0, class_validator_1.IsBoolean)(),
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
34
|
+
__metadata("design:type", Boolean)
|
|
35
|
+
], SlugCheckResponseDto.prototype, "available", void 0);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Type as TypeI } from "@nestjs/common";
|
|
2
|
-
export declare const ApiSortingParams: <TModel extends TypeI<any>>(model: TModel) => <TFunction extends Function, Y>(target:
|
|
3
|
-
export declare const IsSortingObject: <TModel extends TypeI<any>>(model: TModel) => <TFunction extends Function, Y>(target:
|
|
2
|
+
export declare const ApiSortingParams: <TModel extends TypeI<any>>(model: TModel) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
3
|
+
export declare const IsSortingObject: <TModel extends TypeI<any>>(model: TModel) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -21,13 +21,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
21
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;
|
|
22
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
23
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
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
|
+
})();
|
|
31
41
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
42
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
43
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checksumFromBuffer =
|
|
3
|
+
exports.checksumFromBuffer = checksumFromBuffer;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
5
|
function checksumFromBuffer(buffer) {
|
|
6
6
|
return (0, crypto_1.createHash)('md5').update(buffer).digest("base64");
|
|
7
7
|
}
|
|
8
|
-
exports.checksumFromBuffer = checksumFromBuffer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.priceFormat =
|
|
3
|
+
exports.priceFormat = priceFormat;
|
|
4
4
|
const formatter = new Intl.NumberFormat('it-IT', {
|
|
5
5
|
style: 'currency',
|
|
6
6
|
currency: 'EUR',
|
|
@@ -10,4 +10,3 @@ const formatter = new Intl.NumberFormat('it-IT', {
|
|
|
10
10
|
function priceFormat(n) {
|
|
11
11
|
return formatter.format(n);
|
|
12
12
|
}
|
|
13
|
-
exports.priceFormat = priceFormat;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toMs =
|
|
3
|
+
exports.toMs = toMs;
|
|
4
4
|
/** Transform a time string (s,m,h,d) to milliseconds
|
|
5
5
|
* @example toMs('1s') => 1 * 1000
|
|
6
6
|
* @example toMs('1m') => 1 * 60 * 1000
|
|
@@ -18,4 +18,3 @@ function toMs(str) {
|
|
|
18
18
|
};
|
|
19
19
|
return (conversion[mode] ?? 0) * number;
|
|
20
20
|
}
|
|
21
|
-
exports.toMs = toMs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maioradv/nestjs-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "NestJS helpers by MaiorADV",
|
|
5
5
|
"repository": "https://github.com/maioradv/nestjs-core.git",
|
|
6
6
|
"author": "Maior ADV Srl",
|
|
@@ -18,54 +18,53 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@aws-sdk/client-s3": "^3.608.0",
|
|
21
|
-
"@maioradv/accounts-lib": "^1.2.
|
|
22
|
-
"@nestjs/cache-manager": "^
|
|
23
|
-
"@nestjs/common": "^
|
|
24
|
-
"@nestjs/config": "^
|
|
25
|
-
"@nestjs/graphql": "^
|
|
26
|
-
"@nestjs/platform-express": "^
|
|
27
|
-
"@nestjs/swagger": "^
|
|
28
|
-
"@nestjs/throttler": "^
|
|
21
|
+
"@maioradv/accounts-lib": "^1.2.4",
|
|
22
|
+
"@nestjs/cache-manager": "^3.0.0",
|
|
23
|
+
"@nestjs/common": "^11.0.4",
|
|
24
|
+
"@nestjs/config": "^4.0.0",
|
|
25
|
+
"@nestjs/graphql": "^13.0.2",
|
|
26
|
+
"@nestjs/platform-express": "^11.0.4",
|
|
27
|
+
"@nestjs/swagger": "^11.0.2",
|
|
28
|
+
"@nestjs/throttler": "^6.3.0",
|
|
29
29
|
"bcrypt": "^5.1.1",
|
|
30
30
|
"class-transformer": "^0.5.1",
|
|
31
31
|
"class-validator": "^0.14.1",
|
|
32
32
|
"handlebars": "^4.7.8",
|
|
33
33
|
"image-size": "^1.1.1",
|
|
34
|
-
"nest-winston": "^1.10.
|
|
34
|
+
"nest-winston": "^1.10.2",
|
|
35
35
|
"nodemailer": "^6.9.14",
|
|
36
36
|
"request-ip": "^3.3.0",
|
|
37
37
|
"sharp": "^0.33.5",
|
|
38
|
-
"winston": "^3.
|
|
38
|
+
"winston": "^3.17.0",
|
|
39
39
|
"winston-daily-rotate-file": "^5.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/multer": "^1.4.
|
|
43
|
-
"@types/node": "^
|
|
42
|
+
"@types/multer": "^1.4.12",
|
|
43
|
+
"@types/node": "^22.10.7",
|
|
44
44
|
"@types/nodemailer": "^6.4.15",
|
|
45
45
|
"@types/request-ip": "^0.0.41",
|
|
46
46
|
"ts-node": "^10.9.2",
|
|
47
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.7.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@aws-sdk/client-s3": "^3.608.0",
|
|
51
|
-
"@maioradv/accounts-lib": "^1.2.
|
|
52
|
-
"@nestjs/cache-manager": "^
|
|
53
|
-
"@nestjs/common": "^
|
|
54
|
-
"@nestjs/config": "^
|
|
55
|
-
"@nestjs/graphql": "^
|
|
56
|
-
"@nestjs/platform-express": "^
|
|
57
|
-
"@nestjs/swagger": "^
|
|
58
|
-
"@
|
|
59
|
-
"@types/nodemailer": "^6.4.15",
|
|
51
|
+
"@maioradv/accounts-lib": "^1.2.4",
|
|
52
|
+
"@nestjs/cache-manager": "^3.0.0",
|
|
53
|
+
"@nestjs/common": "^11.0.4",
|
|
54
|
+
"@nestjs/config": "^4.0.0",
|
|
55
|
+
"@nestjs/graphql": "^13.0.2",
|
|
56
|
+
"@nestjs/platform-express": "^11.0.4",
|
|
57
|
+
"@nestjs/swagger": "^11.0.2",
|
|
58
|
+
"@nestjs/throttler": "^6.3.0",
|
|
60
59
|
"bcrypt": "^5.1.1",
|
|
61
60
|
"class-transformer": "^0.5.1",
|
|
62
61
|
"class-validator": "^0.14.1",
|
|
63
62
|
"handlebars": "^4.7.8",
|
|
64
63
|
"image-size": "^1.1.1",
|
|
65
|
-
"nest-winston": "^1.10.
|
|
64
|
+
"nest-winston": "^1.10.2",
|
|
66
65
|
"nodemailer": "^6.9.14",
|
|
67
66
|
"sharp": "^0.33.5",
|
|
68
|
-
"winston": "^3.
|
|
67
|
+
"winston": "^3.17.0",
|
|
69
68
|
"winston-daily-rotate-file": "^5.0.0"
|
|
70
69
|
},
|
|
71
70
|
"keywords": [
|