plac-micro-common 1.2.17 → 1.2.18
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/http/constants/index.d.ts +1 -0
- package/dist/http/constants/index.js +2 -1
- package/dist/http/dtos/index.d.ts +1 -0
- package/dist/http/dtos/index.js +17 -0
- package/dist/http/dtos/pagination.dto.d.ts +15 -0
- package/dist/http/dtos/pagination.dto.js +64 -0
- package/dist/http/index.d.ts +1 -0
- package/dist/http/index.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./pagination.dto";
|
|
@@ -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("./pagination.dto"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class PaginationDto {
|
|
2
|
+
page?: number;
|
|
3
|
+
limit?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class SortDto {
|
|
6
|
+
sort_by?: string;
|
|
7
|
+
sort_order?: "asc" | "desc";
|
|
8
|
+
}
|
|
9
|
+
export declare class SearchDto {
|
|
10
|
+
search?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ListBaseDto_base: import("@nestjs/mapped-types").MappedType<PaginationDto & SortDto & SearchDto>;
|
|
13
|
+
export declare class ListBaseDto extends ListBaseDto_base {
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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.ListBaseDto = exports.SearchDto = exports.SortDto = exports.PaginationDto = void 0;
|
|
13
|
+
const mapped_types_1 = require("@nestjs/mapped-types");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const constants_1 = require("../constants");
|
|
17
|
+
class PaginationDto {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.page = 1;
|
|
20
|
+
this.limit = constants_1.PER_PAGE;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.PaginationDto = PaginationDto;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_transformer_1.Transform)(({ value }) => parseInt(value, 10)),
|
|
27
|
+
(0, class_validator_1.IsInt)(),
|
|
28
|
+
(0, class_validator_1.Min)(1),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], PaginationDto.prototype, "page", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_transformer_1.Transform)(({ value }) => parseInt(value, 10)),
|
|
34
|
+
(0, class_validator_1.IsInt)(),
|
|
35
|
+
(0, class_validator_1.Min)(1),
|
|
36
|
+
(0, class_validator_1.Max)(100),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], PaginationDto.prototype, "limit", void 0);
|
|
39
|
+
class SortDto {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.sort_order = "desc";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.SortDto = SortDto;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], SortDto.prototype, "sort_by", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
(0, class_validator_1.IsIn)(["asc", "desc"]),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], SortDto.prototype, "sort_order", void 0);
|
|
54
|
+
class SearchDto {
|
|
55
|
+
}
|
|
56
|
+
exports.SearchDto = SearchDto;
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], SearchDto.prototype, "search", void 0);
|
|
62
|
+
class ListBaseDto extends (0, mapped_types_1.IntersectionType)(PaginationDto, SortDto, SearchDto) {
|
|
63
|
+
}
|
|
64
|
+
exports.ListBaseDto = ListBaseDto;
|
package/dist/http/index.d.ts
CHANGED
package/dist/http/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./common"), exports);
|
|
18
18
|
__exportStar(require("./decorators"), exports);
|
|
19
|
+
__exportStar(require("./dtos"), exports);
|
|
19
20
|
__exportStar(require("./guards"), exports);
|
|
20
21
|
__exportStar(require("./modules"), exports);
|
|
21
22
|
__exportStar(require("./pipes"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plac-micro-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@nestjs/common": "^11.1.9",
|
|
31
31
|
"@nestjs/config": "^4.0.2",
|
|
32
32
|
"@nestjs/core": "^11.1.9",
|
|
33
|
+
"@nestjs/mapped-types": "^2.1.0",
|
|
33
34
|
"axios": "^1.13.2",
|
|
34
35
|
"express": "^5.2.1",
|
|
35
36
|
"ioredis": "^5.9.1",
|