grm-shared-library 1.0.39 → 1.0.41
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/modules/organization/interfaces/organization.d.ts +4 -2
- package/dist/modules/organization/interfaces/partner.d.ts +17 -0
- package/dist/modules/organization/interfaces/partner.js +2 -0
- package/dist/modules/role/dtos/create-role.dto.js +0 -1
- package/dist/modules/role/dtos/update-tole.dto.d.ts +5 -0
- package/dist/modules/role/dtos/update-tole.dto.js +8 -0
- package/dist/modules/role/index.d.ts +1 -1
- package/dist/modules/role/index.js +1 -1
- package/dist/modules/user/dtos/create-user.dto.d.ts +12 -3
- package/dist/modules/user/dtos/create-user.dto.js +52 -8
- package/dist/modules/user/enums/user-status.enum.d.ts +5 -0
- package/dist/modules/user/enums/user-status.enum.js +9 -0
- package/dist/modules/user/index.d.ts +4 -0
- package/dist/modules/user/index.js +19 -0
- package/dist/modules/user/interfaces/user.d.ts +20 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./modules/organization/index"), exports);
|
|
|
21
21
|
__exportStar(require("./modules/common/index"), exports);
|
|
22
22
|
__exportStar(require("./modules/permission/index"), exports);
|
|
23
23
|
__exportStar(require("./modules/role/index"), exports);
|
|
24
|
+
__exportStar(require("./modules/user/index"), exports);
|
|
24
25
|
/**
|
|
25
26
|
* Kafka
|
|
26
27
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MapAddressDto } from "../../common/dtos/map-address.dto";
|
|
2
2
|
export interface Organization {
|
|
3
|
-
id
|
|
3
|
+
id?: number;
|
|
4
4
|
name: string;
|
|
5
5
|
phoneNumber?: string;
|
|
6
6
|
email?: string;
|
|
@@ -11,5 +11,7 @@ export interface Organization {
|
|
|
11
11
|
status: string;
|
|
12
12
|
logo?: string;
|
|
13
13
|
contactPerson: MapAddressDto;
|
|
14
|
-
|
|
14
|
+
partners?: number[];
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
15
17
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MapAddressDto } from "../../common";
|
|
2
|
+
import { Organization } from "./organization";
|
|
3
|
+
export interface Partner {
|
|
4
|
+
id?: number;
|
|
5
|
+
name: string;
|
|
6
|
+
phoneNumber?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
physicalAddress: MapAddressDto;
|
|
9
|
+
website: string;
|
|
10
|
+
type: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
status: string;
|
|
13
|
+
logo?: string;
|
|
14
|
+
organization: Organization;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateRoleDto = void 0;
|
|
4
|
+
const mapped_types_1 = require("@nestjs/mapped-types");
|
|
5
|
+
const create_role_dto_1 = require("./create-role.dto");
|
|
6
|
+
class UpdateRoleDto extends (0, mapped_types_1.PartialType)(create_role_dto_1.CreateRoleDto) {
|
|
7
|
+
}
|
|
8
|
+
exports.UpdateRoleDto = UpdateRoleDto;
|
|
@@ -16,6 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./data/roles.data"), exports);
|
|
18
18
|
__exportStar(require("./dtos/create-role.dto"), exports);
|
|
19
|
-
__exportStar(require("./dtos/update-
|
|
19
|
+
__exportStar(require("./dtos/update-tole.dto"), exports);
|
|
20
20
|
__exportStar(require("./enums/role.enum"), exports);
|
|
21
21
|
__exportStar(require("./interfaces/role"), exports);
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserStatus } from "../enums/user-status.enum";
|
|
2
2
|
export declare class CreateUserDto {
|
|
3
3
|
name: string;
|
|
4
4
|
email: string;
|
|
5
|
-
password: string;
|
|
6
5
|
phoneNumber?: string;
|
|
7
|
-
|
|
6
|
+
roles: number[];
|
|
7
|
+
password?: string;
|
|
8
|
+
avatar?: string;
|
|
9
|
+
designation?: string;
|
|
10
|
+
status: UserStatus;
|
|
11
|
+
isTermsAccepted?: boolean;
|
|
12
|
+
isEmailVerified?: boolean;
|
|
13
|
+
otp?: string;
|
|
14
|
+
otpExpiresAt?: Date;
|
|
15
|
+
partner: number;
|
|
16
|
+
organization: number;
|
|
8
17
|
}
|
|
@@ -11,12 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CreateUserDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
const user_role_enum_1 = require("../enums/user-role.enum");
|
|
15
14
|
const case_decorators_1 = require("../../../decorators/case-decorators");
|
|
15
|
+
const user_status_enum_1 = require("../enums/user-status.enum");
|
|
16
16
|
class CreateUserDto {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.role = user_role_enum_1.UserRole.USER;
|
|
19
|
-
}
|
|
20
17
|
}
|
|
21
18
|
exports.CreateUserDto = CreateUserDto;
|
|
22
19
|
__decorate([
|
|
@@ -31,6 +28,18 @@ __decorate([
|
|
|
31
28
|
(0, class_validator_1.IsNotEmpty)(),
|
|
32
29
|
__metadata("design:type", String)
|
|
33
30
|
], CreateUserDto.prototype, "email", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CreateUserDto.prototype, "phoneNumber", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsArray)(),
|
|
39
|
+
(0, class_validator_1.IsNumber)({}, { each: true }),
|
|
40
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], CreateUserDto.prototype, "roles", void 0);
|
|
34
43
|
__decorate([
|
|
35
44
|
(0, class_validator_1.IsString)(),
|
|
36
45
|
(0, class_validator_1.MinLength)(8),
|
|
@@ -40,12 +49,47 @@ __decorate([
|
|
|
40
49
|
__metadata("design:type", String)
|
|
41
50
|
], CreateUserDto.prototype, "password", void 0);
|
|
42
51
|
__decorate([
|
|
52
|
+
(0, class_validator_1.IsString)(),
|
|
43
53
|
(0, class_validator_1.IsOptional)(),
|
|
44
|
-
(0, class_validator_1.IsPhoneNumber)(),
|
|
45
54
|
__metadata("design:type", String)
|
|
46
|
-
], CreateUserDto.prototype, "
|
|
55
|
+
], CreateUserDto.prototype, "avatar", void 0);
|
|
47
56
|
__decorate([
|
|
57
|
+
(0, class_validator_1.IsString)(),
|
|
48
58
|
(0, class_validator_1.IsOptional)(),
|
|
49
|
-
(0, class_validator_1.IsEnum)(user_role_enum_1.UserRole),
|
|
50
59
|
__metadata("design:type", String)
|
|
51
|
-
], CreateUserDto.prototype, "
|
|
60
|
+
], CreateUserDto.prototype, "designation", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsEnum)(user_status_enum_1.UserStatus),
|
|
63
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], CreateUserDto.prototype, "status", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsBoolean)(),
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
__metadata("design:type", Boolean)
|
|
70
|
+
], CreateUserDto.prototype, "isTermsAccepted", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsBoolean)(),
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
__metadata("design:type", Boolean)
|
|
75
|
+
], CreateUserDto.prototype, "isEmailVerified", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsString)(),
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], CreateUserDto.prototype, "otp", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsDateString)(),
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
__metadata("design:type", Date)
|
|
85
|
+
], CreateUserDto.prototype, "otpExpiresAt", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsNumber)(),
|
|
88
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], CreateUserDto.prototype, "partner", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, class_validator_1.IsNumber)(),
|
|
93
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
94
|
+
__metadata("design:type", Number)
|
|
95
|
+
], CreateUserDto.prototype, "organization", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserStatus = void 0;
|
|
4
|
+
var UserStatus;
|
|
5
|
+
(function (UserStatus) {
|
|
6
|
+
UserStatus["ACTIVE"] = "active";
|
|
7
|
+
UserStatus["INACTIVE"] = "inactive";
|
|
8
|
+
UserStatus["PENDING"] = "pending";
|
|
9
|
+
})(UserStatus || (exports.UserStatus = UserStatus = {}));
|
|
@@ -1 +1,20 @@
|
|
|
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 __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("./dtos/create-user.dto"), exports);
|
|
18
|
+
__exportStar(require("./dtos/update-user.dto"), exports);
|
|
19
|
+
__exportStar(require("./enums/user-status.enum"), exports);
|
|
20
|
+
__exportStar(require("./interfaces/user"), exports);
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
import { Organization } from "../../organization";
|
|
2
|
+
import { Partner } from "../../organization/interfaces/partner";
|
|
3
|
+
import { Role } from "../../role";
|
|
1
4
|
export interface User {
|
|
5
|
+
id?: number;
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
phoneNumber?: string;
|
|
9
|
+
roles: Role[];
|
|
10
|
+
password?: string;
|
|
11
|
+
avatar?: string;
|
|
12
|
+
designation?: string;
|
|
13
|
+
status: string;
|
|
14
|
+
isTermsAccepted?: boolean;
|
|
15
|
+
isEmailVerified?: boolean;
|
|
16
|
+
otp?: string;
|
|
17
|
+
otpExpiresAt?: Date;
|
|
18
|
+
partner: Partner;
|
|
19
|
+
organization: Organization;
|
|
20
|
+
createdAt?: Date;
|
|
21
|
+
updatedAt?: Date;
|
|
2
22
|
}
|