grm-shared-library 1.0.229 → 1.0.231
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/case-decorators.js +7 -12
- package/dist/exceptions/custom-exception/custom-rpc.exception.js +5 -9
- package/dist/exceptions/enums/error-codes.enum.js +1 -4
- package/dist/exceptions/error-logger/error-logger.js +2 -6
- package/dist/exceptions/filters/all-exceptions.filter.js +17 -20
- package/dist/exceptions/filters/http-exceptions.filter.js +10 -13
- package/dist/exceptions/index.js +7 -23
- package/dist/exceptions/interfaces/error-context.js +1 -2
- package/dist/exceptions/interfaces/error-response.js +1 -2
- package/dist/index.js +18 -34
- package/dist/interfaces/i-request-with-user.js +1 -2
- package/dist/interfaces/jwt-payload.js +1 -2
- package/dist/interfaces/server-message.js +1 -2
- package/dist/interfaces/validated-user.js +1 -2
- package/dist/kafka/dtos/otp/create-otp-payload.dto.js +25 -29
- package/dist/kafka/dtos/otp/otp-payload.dto.js +10 -14
- package/dist/kafka/dtos/password/password-reset-payload.dto.js +13 -17
- package/dist/kafka/dtos/user/create-user-created-payload.dto.js +27 -31
- package/dist/kafka/dtos/user/create-user-registered-payload.dto.js +14 -18
- package/dist/kafka/dtos/user/user-created-payload.dto.js +10 -14
- package/dist/kafka/dtos/user/user-registered-payload.dto.js +6 -10
- package/dist/kafka/index.js +8 -24
- package/dist/kafka/topics.js +1 -4
- package/dist/modules/auth/dtos/change-password.dto.js +17 -21
- package/dist/modules/auth/dtos/forgot-password.dto.js +4 -8
- package/dist/modules/auth/dtos/login.dto.js +9 -13
- package/dist/modules/auth/dtos/refresh-token.dto.js +4 -8
- package/dist/modules/auth/dtos/register.dto.js +43 -47
- package/dist/modules/auth/dtos/resend-otp.dto.js +7 -11
- package/dist/modules/auth/dtos/reset-password.dto.js +15 -19
- package/dist/modules/auth/dtos/verify-otp.dto.js +6 -10
- package/dist/modules/auth/enums/otp-action.js +2 -5
- package/dist/modules/auth/index.d.ts +1 -0
- package/dist/modules/auth/index.js +12 -26
- package/dist/modules/auth/interfaces/login-response.js +1 -2
- package/dist/modules/auth/interfaces/register-response.js +1 -2
- package/dist/modules/auth/validators/match.decorator.js +3 -6
- package/dist/modules/common/constants/password-regex.const.js +1 -5
- package/dist/modules/common/constants/service.const.js +1 -4
- package/dist/modules/common/dtos/contact-person.dto.js +12 -16
- package/dist/modules/common/dtos/map-address.dto.js +20 -24
- package/dist/modules/common/dtos/map-location.dto.js +10 -14
- package/dist/modules/common/index.js +7 -23
- package/dist/modules/common/interfaces/contact-person.js +1 -2
- package/dist/modules/common/interfaces/map-address.js +1 -2
- package/dist/modules/common/interfaces/map-location.js +1 -2
- package/dist/modules/control-centre/dtos/create-control-centre.dto.js +29 -33
- package/dist/modules/control-centre/dtos/update-control-centre.dto.js +3 -7
- package/dist/modules/control-centre/enums/control-centre.enum.js +2 -5
- package/dist/modules/control-centre/index.js +4 -20
- package/dist/modules/control-centre/interfaces/control-centre.js +1 -2
- package/dist/modules/email/index.js +1 -17
- package/dist/modules/email/interfaces/user-created.js +1 -2
- package/dist/modules/incident/dtos/action/create-incident-action.dto.js +13 -17
- package/dist/modules/incident/dtos/action/incident-action.dto.js +8 -12
- package/dist/modules/incident/dtos/action/update-inident-action.dto.js +3 -7
- package/dist/modules/incident/dtos/assignment/create-incident-assignment.dto.js +14 -18
- package/dist/modules/incident/dtos/assignment/incident-assignment.dto.js +8 -12
- package/dist/modules/incident/dtos/assignment/update-incident-assignment.dto.js +3 -7
- package/dist/modules/incident/dtos/attachment/create-incident-attachment.dto.js +12 -16
- package/dist/modules/incident/dtos/attachment/update-incident-attachment.dto.js +3 -7
- package/dist/modules/incident/dtos/category/create-incident-category.dto.js +10 -14
- package/dist/modules/incident/dtos/category/update-incident-category.dto.js +3 -7
- package/dist/modules/incident/dtos/incident/create-incident.dto.js +53 -57
- package/dist/modules/incident/dtos/incident/incident.dto.js +37 -41
- package/dist/modules/incident/dtos/incident/update-incident.dto.js +3 -7
- package/dist/modules/incident/dtos/reporter/create-incident-reporter.dto.js +12 -16
- package/dist/modules/incident/dtos/reporter/incident-reporter.dto.js +10 -14
- package/dist/modules/incident/dtos/reporter/update-incident-reporter.dto.js +3 -7
- package/dist/modules/incident/dtos/response-unit-assignment/create-incident-response-unit-assignment.dto.js +16 -20
- package/dist/modules/incident/dtos/response-unit-assignment/incident-response-unit-assignment.dto.js +3 -7
- package/dist/modules/incident/dtos/response-unit-assignment/update-incident-response-unit-assignment.dto.js +8 -12
- package/dist/modules/incident/dtos/type/create-incident-type.dto.js +12 -16
- package/dist/modules/incident/dtos/type/update-incident-type.dto.js +3 -7
- package/dist/modules/incident/enums/incident-actions.enum.js +2 -5
- package/dist/modules/incident/enums/incident-app-id.enum.js +2 -5
- package/dist/modules/incident/enums/incident-channel.enum.js +2 -5
- package/dist/modules/incident/enums/incident-class.enum.js +2 -5
- package/dist/modules/incident/enums/incident-priority.enum.js +2 -5
- package/dist/modules/incident/enums/incident-status.enum.js +2 -5
- package/dist/modules/incident/enums/incident-workflow-queue-name.enum.js +2 -5
- package/dist/modules/incident/index.js +37 -53
- package/dist/modules/incident/intefaces/incident-action.js +1 -2
- package/dist/modules/incident/intefaces/incident-assignment.js +1 -2
- package/dist/modules/incident/intefaces/incident-attachment.js +1 -2
- package/dist/modules/incident/intefaces/incident-category.js +1 -2
- package/dist/modules/incident/intefaces/incident-reporter.js +1 -2
- package/dist/modules/incident/intefaces/incident-response-unit-assignment.js +1 -2
- package/dist/modules/incident/intefaces/incident-type.js +1 -2
- package/dist/modules/incident/intefaces/incident.js +1 -2
- package/dist/modules/organization/dtos/create-organization.dto.js +41 -45
- package/dist/modules/organization/dtos/organization-sla.dto.js +12 -16
- package/dist/modules/organization/dtos/update-organization.dto.js +3 -7
- package/dist/modules/organization/enums/org-status.enum.js +2 -5
- package/dist/modules/organization/enums/org-type.enum.js +2 -5
- package/dist/modules/organization/index.d.ts +1 -0
- package/dist/modules/organization/index.js +10 -22
- package/dist/modules/organization/interfaces/organization-sla.js +1 -2
- package/dist/modules/organization/interfaces/organization.js +1 -2
- package/dist/modules/permission/data/permissions.data.js +28 -31
- package/dist/modules/permission/dtos/create-permission.dto.js +7 -11
- package/dist/modules/permission/dtos/update-permission.dto.js +3 -7
- package/dist/modules/permission/enums/permission-actions.enum.js +2 -5
- package/dist/modules/permission/enums/permissions-moudule.enum.js +2 -5
- package/dist/modules/permission/index.js +6 -22
- package/dist/modules/permission/interfaces/permission.js +1 -2
- package/dist/modules/response-unit/dtos/person-unit/base-person-unit.dto.js +15 -19
- package/dist/modules/response-unit/dtos/person-unit/create-person-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/person-unit/person-unit.dto.js +2 -6
- package/dist/modules/response-unit/dtos/person-unit/update-person-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +25 -29
- package/dist/modules/response-unit/dtos/response-unit/create-response-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/response-unit/response-unit.dto.js +2 -6
- package/dist/modules/response-unit/dtos/response-unit/station.dto.js +8 -12
- package/dist/modules/response-unit/dtos/response-unit/update-response-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/base-team-unit.dto.js +10 -14
- package/dist/modules/response-unit/dtos/team-unit/create-team-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/crew/create-team-unit-crew.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/crew/team-unit-crew.dto.js +14 -18
- package/dist/modules/response-unit/dtos/team-unit/crew/update-team-unit-crew.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/team-unit.dto.js +2 -6
- package/dist/modules/response-unit/dtos/team-unit/update-team-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/base-vehicle-unit.dto.js +27 -31
- package/dist/modules/response-unit/dtos/vehicle-unit/create-vehicle-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/crew/create-vehicle-unit-crew.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/crew/update-vehicle-unit-crew.dto.js +11 -15
- package/dist/modules/response-unit/dtos/vehicle-unit/crew/vehicle-unit-crew.dto.js +19 -23
- package/dist/modules/response-unit/dtos/vehicle-unit/device/create-vehicle-unit-device.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/device/update-vehicle-unit-device.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/device/vehicle-unit-device.dto.js +23 -27
- package/dist/modules/response-unit/dtos/vehicle-unit/update-vehicle-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/ambulance-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/base-ambulance-vehicle.dto.js +6 -10
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/create-ambulance-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/update-ambulance-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/base-fire-vehicle.dto.js +6 -10
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/create-fire-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/fire-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/update-fire-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/base-road-rescue-vehicle.dto.js +5 -9
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/create-road-rescue-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/road-rescue-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/update-road-rescue-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/base-security-vehicle.dto.js +5 -9
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/create-security-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/security-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/update-security-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-unit.dto.js +2 -6
- package/dist/modules/response-unit/enums/person-unit/person-unit-category.enum.js +2 -5
- package/dist/modules/response-unit/enums/person-unit/person-unit-status.enum.js +2 -5
- package/dist/modules/response-unit/enums/response-unit/response-unit-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/ambulance-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/fire-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/road-rescue-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/security-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/ambulance-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/fire-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/road-rescue-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/security-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-unit-ownership.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-unit-status.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-unit-type.enum.js +2 -5
- package/dist/modules/response-unit/index.js +67 -83
- package/dist/modules/response-unit/interfaces/person-unit/person-unit.js +1 -2
- package/dist/modules/response-unit/interfaces/response-unit/response-unit.js +1 -2
- package/dist/modules/response-unit/interfaces/team-unit/team-unit-crew.js +1 -2
- package/dist/modules/response-unit/interfaces/team-unit/team-unit.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/ambulance-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/fire-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/road-rescue-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/security-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-unit-crew.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-unit-device.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-unit.js +1 -2
- package/dist/modules/response-unit/validators/valid-vehicle-role.decorator.js +16 -19
- package/dist/modules/role/data/roles.data.js +62 -65
- package/dist/modules/role/dtos/create-role.dto.js +10 -14
- package/dist/modules/role/dtos/update-tole.dto.js +3 -7
- package/dist/modules/role/enums/role.enum.js +2 -5
- package/dist/modules/role/index.js +5 -21
- package/dist/modules/role/interfaces/role.js +1 -2
- package/dist/modules/user/dtos/create-user.dto.js +41 -45
- package/dist/modules/user/dtos/update-user.dto.js +3 -7
- package/dist/modules/user/enums/user-status.enum.js +2 -5
- package/dist/modules/user/index.js +4 -20
- package/dist/modules/user/interfaces/user.js +1 -2
- package/dist/modules/workflow/index.js +1 -17
- package/dist/modules/workflow/interfaces/workflow-query-info.js +1 -2
- package/package.json +3 -1
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.UpperCase = UpperCase;
|
|
5
|
-
exports.LowerCase = LowerCase;
|
|
6
|
-
const class_transformer_1 = require("class-transformer");
|
|
7
|
-
function SentenceCase() {
|
|
8
|
-
return (0, class_transformer_1.Transform)(({ value }) => {
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
export function SentenceCase() {
|
|
3
|
+
return Transform(({ value }) => {
|
|
9
4
|
if (typeof value !== 'string') {
|
|
10
5
|
return value;
|
|
11
6
|
}
|
|
@@ -15,14 +10,14 @@ function SentenceCase() {
|
|
|
15
10
|
.join(' ');
|
|
16
11
|
});
|
|
17
12
|
}
|
|
18
|
-
function UpperCase() {
|
|
19
|
-
return
|
|
13
|
+
export function UpperCase() {
|
|
14
|
+
return Transform(({ value }) => {
|
|
20
15
|
if (typeof value !== 'string') {
|
|
21
16
|
return value;
|
|
22
17
|
}
|
|
23
18
|
return value.toUpperCase();
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
|
-
function LowerCase() {
|
|
27
|
-
return
|
|
21
|
+
export function LowerCase() {
|
|
22
|
+
return Transform(({ value }) => typeof value === "string" ? value.toLowerCase() : value);
|
|
28
23
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const microservices_1 = require("@nestjs/microservices");
|
|
5
|
-
const error_codes_enum_1 = require("../enums/error-codes.enum");
|
|
6
|
-
class CustomRpcException extends microservices_1.RpcException {
|
|
1
|
+
import { RpcException } from "@nestjs/microservices";
|
|
2
|
+
import { ErrorCodes } from "../enums/error-codes.enum";
|
|
3
|
+
export class CustomRpcException extends RpcException {
|
|
7
4
|
constructor(message, code, details, context) {
|
|
8
5
|
const errorResponse = {
|
|
9
6
|
message,
|
|
@@ -15,10 +12,10 @@ class CustomRpcException extends microservices_1.RpcException {
|
|
|
15
12
|
super(errorResponse);
|
|
16
13
|
}
|
|
17
14
|
static fromError(message, error, context) {
|
|
18
|
-
return new CustomRpcException(message,
|
|
15
|
+
return new CustomRpcException(message, ErrorCodes.INTERNAL_SERVER_ERROR, error.message, context);
|
|
19
16
|
}
|
|
20
17
|
static fromDBError(message, error, context) {
|
|
21
|
-
return new CustomRpcException(message,
|
|
18
|
+
return new CustomRpcException(message, ErrorCodes.DATABASE_ERROR, error.message, context);
|
|
22
19
|
}
|
|
23
20
|
getErrorResponse() {
|
|
24
21
|
return this.getError();
|
|
@@ -27,4 +24,3 @@ class CustomRpcException extends microservices_1.RpcException {
|
|
|
27
24
|
return this.getErrorResponse().context;
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
|
-
exports.CustomRpcException = CustomRpcException;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorCodes = void 0;
|
|
4
|
-
exports.ErrorCodes = {
|
|
1
|
+
export const ErrorCodes = {
|
|
5
2
|
INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR',
|
|
6
3
|
DATABASE_ERROR: 'DATABASE_ERROR',
|
|
7
4
|
UNKNOWN_ERROR: 'UNKNOWN_ERROR',
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.logError = void 0;
|
|
4
|
-
const Sentry = require("@sentry/node");
|
|
5
|
-
const logError = async (error, context) => {
|
|
1
|
+
import * as Sentry from '@sentry/node';
|
|
2
|
+
export const logError = async (error, context) => {
|
|
6
3
|
Sentry.withScope(scope => {
|
|
7
4
|
if (context) {
|
|
8
5
|
scope.setTag('service', context.service);
|
|
@@ -21,4 +18,3 @@ const logError = async (error, context) => {
|
|
|
21
18
|
});
|
|
22
19
|
await Sentry.flush(2000);
|
|
23
20
|
};
|
|
24
|
-
exports.logError = logError;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6,28 +5,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
7
|
var AllExceptionsFilter_1;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const error_codes_enum_1 = require("../enums/error-codes.enum");
|
|
16
|
-
const error_logger_1 = require("../error-logger/error-logger");
|
|
8
|
+
import { Catch, Logger } from '@nestjs/common';
|
|
9
|
+
import { throwError } from 'rxjs';
|
|
10
|
+
import { RpcException } from '@nestjs/microservices';
|
|
11
|
+
import { CustomRpcException } from '../custom-exception/custom-rpc.exception';
|
|
12
|
+
import { ErrorCodes } from '../enums/error-codes.enum';
|
|
13
|
+
import { logError } from '../error-logger/error-logger';
|
|
17
14
|
let AllExceptionsFilter = AllExceptionsFilter_1 = class AllExceptionsFilter {
|
|
18
15
|
constructor() {
|
|
19
|
-
this.logger = new
|
|
16
|
+
this.logger = new Logger(AllExceptionsFilter_1.name);
|
|
20
17
|
}
|
|
21
18
|
catch(exception, host) {
|
|
22
19
|
var _a, _b, _c, _d, _e, _f;
|
|
23
20
|
let customException;
|
|
24
|
-
if (exception instanceof
|
|
21
|
+
if (exception instanceof CustomRpcException) {
|
|
25
22
|
customException = exception;
|
|
26
23
|
}
|
|
27
|
-
else if (exception instanceof
|
|
24
|
+
else if (exception instanceof RpcException) {
|
|
28
25
|
const errorResponse = exception.getError();
|
|
29
26
|
if (typeof errorResponse === 'string') {
|
|
30
|
-
customException = new
|
|
27
|
+
customException = new CustomRpcException(errorResponse, ErrorCodes.UNKNOWN_ERROR, 'An unexpected error occurred', {
|
|
31
28
|
service: 'unknown service',
|
|
32
29
|
method: (_a = host.getArgByIndex(1)) === null || _a === void 0 ? void 0 : _a.pattern,
|
|
33
30
|
payload: (_b = host.getArgByIndex(1)) === null || _b === void 0 ? void 0 : _b.data
|
|
@@ -35,7 +32,7 @@ let AllExceptionsFilter = AllExceptionsFilter_1 = class AllExceptionsFilter {
|
|
|
35
32
|
}
|
|
36
33
|
else {
|
|
37
34
|
const error = errorResponse;
|
|
38
|
-
customException = new
|
|
35
|
+
customException = new CustomRpcException(error.message || 'Unknown error', error.code || ErrorCodes.UNKNOWN_ERROR, error.details || undefined, error.context || {
|
|
39
36
|
service: 'unknown service',
|
|
40
37
|
method: (_c = host.getArgByIndex(1)) === null || _c === void 0 ? void 0 : _c.pattern,
|
|
41
38
|
payload: (_d = host.getArgByIndex(1)) === null || _d === void 0 ? void 0 : _d.data
|
|
@@ -48,15 +45,15 @@ let AllExceptionsFilter = AllExceptionsFilter_1 = class AllExceptionsFilter {
|
|
|
48
45
|
method: (_e = host.getArgByIndex(1)) === null || _e === void 0 ? void 0 : _e.pattern,
|
|
49
46
|
payload: (_f = host.getArgByIndex(1)) === null || _f === void 0 ? void 0 : _f.data
|
|
50
47
|
};
|
|
51
|
-
customException =
|
|
48
|
+
customException = CustomRpcException.fromError('An unknown Error occured', exception, context);
|
|
52
49
|
}
|
|
53
50
|
this.logger.error(customException.getErrorResponse().message, customException.getErrorResponse().details);
|
|
54
|
-
|
|
51
|
+
logError(exception, customException.getContext()); // Log to Sentry
|
|
55
52
|
const responseError = { ...customException.getErrorResponse() };
|
|
56
|
-
return
|
|
53
|
+
return throwError(() => responseError);
|
|
57
54
|
}
|
|
58
55
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(0, common_1.Catch)()
|
|
56
|
+
AllExceptionsFilter = AllExceptionsFilter_1 = __decorate([
|
|
57
|
+
Catch()
|
|
62
58
|
], AllExceptionsFilter);
|
|
59
|
+
export { AllExceptionsFilter };
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const error_codes_enum_1 = require("../enums/error-codes.enum");
|
|
12
|
-
const error_logger_1 = require("../error-logger/error-logger");
|
|
7
|
+
import { Catch, HttpException, HttpStatus } from "@nestjs/common";
|
|
8
|
+
import { ErrorCodes } from "../enums/error-codes.enum";
|
|
9
|
+
import { logError } from "../error-logger/error-logger";
|
|
13
10
|
let HttpExceptionFilter = class HttpExceptionFilter {
|
|
14
11
|
catch(exception, host) {
|
|
15
12
|
const ctx = host.switchToHttp();
|
|
16
13
|
const response = ctx.getResponse();
|
|
17
14
|
const request = ctx.getRequest();
|
|
18
|
-
let status =
|
|
15
|
+
let status = HttpStatus.INTERNAL_SERVER_ERROR;
|
|
19
16
|
let errorResponse = {
|
|
20
17
|
message: 'Internal server error',
|
|
21
|
-
code:
|
|
18
|
+
code: ErrorCodes.UNKNOWN_ERROR,
|
|
22
19
|
timestamp: new Date().toISOString()
|
|
23
20
|
};
|
|
24
|
-
if (exception instanceof
|
|
21
|
+
if (exception instanceof HttpException) {
|
|
25
22
|
status = exception.getStatus();
|
|
26
23
|
errorResponse = exception.getResponse();
|
|
27
24
|
}
|
|
28
|
-
|
|
25
|
+
logError(exception, errorResponse.context || {}); // Log to Sentry
|
|
29
26
|
response.status(status).json({
|
|
30
27
|
...errorResponse,
|
|
31
28
|
path: request.url,
|
|
@@ -33,7 +30,7 @@ let HttpExceptionFilter = class HttpExceptionFilter {
|
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
32
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(0, common_1.Catch)()
|
|
33
|
+
HttpExceptionFilter = __decorate([
|
|
34
|
+
Catch()
|
|
39
35
|
], HttpExceptionFilter);
|
|
36
|
+
export { HttpExceptionFilter };
|
package/dist/exceptions/index.js
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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("./custom-exception/custom-rpc.exception"), exports);
|
|
18
|
-
__exportStar(require("./enums/error-codes.enum"), exports);
|
|
19
|
-
__exportStar(require("./error-logger/error-logger"), exports);
|
|
20
|
-
__exportStar(require("./filters/all-exceptions.filter"), exports);
|
|
21
|
-
__exportStar(require("./filters/http-exceptions.filter"), exports);
|
|
22
|
-
__exportStar(require("./interfaces/error-context"), exports);
|
|
23
|
-
__exportStar(require("./interfaces/error-response"), exports);
|
|
1
|
+
export * from './custom-exception/custom-rpc.exception';
|
|
2
|
+
export * from './enums/error-codes.enum';
|
|
3
|
+
export * from './error-logger/error-logger';
|
|
4
|
+
export * from './filters/all-exceptions.filter';
|
|
5
|
+
export * from './filters/http-exceptions.filter';
|
|
6
|
+
export * from './interfaces/error-context';
|
|
7
|
+
export * from './interfaces/error-response';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,23 @@
|
|
|
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
1
|
// Modules
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
export * from './modules/auth/index';
|
|
3
|
+
export * from './modules/organization/index';
|
|
4
|
+
export * from './modules/common/index';
|
|
5
|
+
export * from './modules/permission/index';
|
|
6
|
+
export * from './modules/role/index';
|
|
7
|
+
export * from './modules/user/index';
|
|
8
|
+
export * from './modules/control-centre/index';
|
|
9
|
+
export * from './modules/email/index';
|
|
10
|
+
export * from './modules/response-unit/index';
|
|
11
|
+
export * from './modules/incident/index';
|
|
12
|
+
export * from './modules/workflow/index';
|
|
29
13
|
// Interfaces
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
export * from './interfaces/server-message';
|
|
15
|
+
export * from './interfaces/i-request-with-user';
|
|
16
|
+
export * from './interfaces/validated-user';
|
|
17
|
+
export * from './interfaces/jwt-payload';
|
|
34
18
|
// Kafka
|
|
35
|
-
|
|
19
|
+
export * from './kafka/index';
|
|
36
20
|
// Utilities
|
|
37
|
-
|
|
21
|
+
export * from './decorators/case-decorators';
|
|
38
22
|
// Exceptions
|
|
39
|
-
|
|
23
|
+
export * from './exceptions/index';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,65 +7,62 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const otp_action_1 = require("../../../modules/auth/enums/otp-action");
|
|
15
|
-
class CreateOTPPayloadDto {
|
|
10
|
+
import { IsDate, IsEmail, IsNotEmpty, IsObject, IsOptional, IsPhoneNumber, IsString } from "class-validator";
|
|
11
|
+
import { OtpAction } from "../../../modules/auth/enums/otp-action";
|
|
12
|
+
export class CreateOTPPayloadDto {
|
|
16
13
|
}
|
|
17
|
-
exports.CreateOTPPayloadDto = CreateOTPPayloadDto;
|
|
18
14
|
__decorate([
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
IsString(),
|
|
16
|
+
IsNotEmpty(),
|
|
21
17
|
__metadata("design:type", String)
|
|
22
18
|
], CreateOTPPayloadDto.prototype, "name", void 0);
|
|
23
19
|
__decorate([
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
IsEmail(),
|
|
21
|
+
IsNotEmpty(),
|
|
26
22
|
__metadata("design:type", String)
|
|
27
23
|
], CreateOTPPayloadDto.prototype, "email", void 0);
|
|
28
24
|
__decorate([
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
IsPhoneNumber(),
|
|
26
|
+
IsOptional(),
|
|
31
27
|
__metadata("design:type", String)
|
|
32
28
|
], CreateOTPPayloadDto.prototype, "phoneNumber", void 0);
|
|
33
29
|
__decorate([
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
IsString(),
|
|
31
|
+
IsOptional(),
|
|
36
32
|
__metadata("design:type", String)
|
|
37
33
|
], CreateOTPPayloadDto.prototype, "role", void 0);
|
|
38
34
|
__decorate([
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
IsString(),
|
|
36
|
+
IsNotEmpty(),
|
|
41
37
|
__metadata("design:type", String)
|
|
42
38
|
], CreateOTPPayloadDto.prototype, "verificationToken", void 0);
|
|
43
39
|
__decorate([
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
IsDate(),
|
|
41
|
+
IsOptional(),
|
|
46
42
|
__metadata("design:type", Date)
|
|
47
43
|
], CreateOTPPayloadDto.prototype, "verificationTokenExpiresAt", void 0);
|
|
48
44
|
__decorate([
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
IsString(),
|
|
46
|
+
IsNotEmpty(),
|
|
51
47
|
__metadata("design:type", String)
|
|
52
48
|
], CreateOTPPayloadDto.prototype, "otp", void 0);
|
|
53
49
|
__decorate([
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
IsDate(),
|
|
51
|
+
IsOptional(),
|
|
56
52
|
__metadata("design:type", Date)
|
|
57
53
|
], CreateOTPPayloadDto.prototype, "otpExpiresAt", void 0);
|
|
58
54
|
__decorate([
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
IsString(),
|
|
56
|
+
IsOptional(),
|
|
61
57
|
__metadata("design:type", String)
|
|
62
58
|
], CreateOTPPayloadDto.prototype, "otpExpirationDescription", void 0);
|
|
63
59
|
__decorate([
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
IsString(),
|
|
61
|
+
IsNotEmpty(),
|
|
66
62
|
__metadata("design:type", String)
|
|
67
63
|
], CreateOTPPayloadDto.prototype, "action", void 0);
|
|
68
64
|
__decorate([
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
IsObject(),
|
|
66
|
+
IsOptional(),
|
|
71
67
|
__metadata("design:type", Object)
|
|
72
68
|
], CreateOTPPayloadDto.prototype, "attributes", void 0);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,26 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const class_validator_1 = require("class-validator");
|
|
16
|
-
class OTPPayloadDto extends (0, mapped_types_1.OmitType)(create_otp_payload_dto_1.CreateOTPPayloadDto, ['verificationTokenExpiresAt', 'otpExpiresAt', 'action']) {
|
|
10
|
+
import { OmitType } from "@nestjs/mapped-types";
|
|
11
|
+
import { CreateOTPPayloadDto } from "./create-otp-payload.dto";
|
|
12
|
+
import { IsNotEmpty, IsOptional, IsString } from "class-validator";
|
|
13
|
+
export class OTPPayloadDto extends OmitType(CreateOTPPayloadDto, ['verificationTokenExpiresAt', 'otpExpiresAt', 'action']) {
|
|
17
14
|
}
|
|
18
|
-
exports.OTPPayloadDto = OTPPayloadDto;
|
|
19
15
|
__decorate([
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
IsString(),
|
|
17
|
+
IsOptional(),
|
|
22
18
|
__metadata("design:type", String)
|
|
23
19
|
], OTPPayloadDto.prototype, "verificationTokenExpiresAt", void 0);
|
|
24
20
|
__decorate([
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
IsString(),
|
|
22
|
+
IsNotEmpty(),
|
|
27
23
|
__metadata("design:type", String)
|
|
28
24
|
], OTPPayloadDto.prototype, "otpExpiresAt", void 0);
|
|
29
25
|
__decorate([
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
IsString(),
|
|
27
|
+
IsNotEmpty(),
|
|
32
28
|
__metadata("design:type", String)
|
|
33
29
|
], OTPPayloadDto.prototype, "action", void 0);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,32 +7,29 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const class_transformer_1 = require("class-transformer");
|
|
15
|
-
class PasswordResetPayloadDto {
|
|
10
|
+
import { IsEmail, IsIP, IsNotEmpty, IsOptional, IsString } from "class-validator";
|
|
11
|
+
import { Transform } from "class-transformer";
|
|
12
|
+
export class PasswordResetPayloadDto {
|
|
16
13
|
}
|
|
17
|
-
exports.PasswordResetPayloadDto = PasswordResetPayloadDto;
|
|
18
14
|
__decorate([
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
IsString(),
|
|
16
|
+
IsNotEmpty(),
|
|
21
17
|
__metadata("design:type", String)
|
|
22
18
|
], PasswordResetPayloadDto.prototype, "name", void 0);
|
|
23
19
|
__decorate([
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
IsEmail(),
|
|
21
|
+
IsNotEmpty(),
|
|
26
22
|
__metadata("design:type", String)
|
|
27
23
|
], PasswordResetPayloadDto.prototype, "email", void 0);
|
|
28
24
|
__decorate([
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
IsOptional(),
|
|
26
|
+
IsIP(),
|
|
27
|
+
Transform(({ value }) => value === "" ? undefined : value),
|
|
32
28
|
__metadata("design:type", String)
|
|
33
29
|
], PasswordResetPayloadDto.prototype, "ipAddress", void 0);
|
|
34
30
|
__decorate([
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
IsOptional(),
|
|
32
|
+
IsString(),
|
|
33
|
+
Transform(({ value }) => value === "" ? undefined : value),
|
|
38
34
|
__metadata("design:type", String)
|
|
39
35
|
], PasswordResetPayloadDto.prototype, "address", void 0);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,70 +7,67 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class CreateUserCreatedPayloadDto {
|
|
10
|
+
import { ArrayNotEmpty, IsArray, IsDate, IsEmail, IsNotEmpty, IsNumber, IsObject, IsOptional, IsPhoneNumber, IsString } from "class-validator";
|
|
11
|
+
export class CreateUserCreatedPayloadDto {
|
|
15
12
|
}
|
|
16
|
-
exports.CreateUserCreatedPayloadDto = CreateUserCreatedPayloadDto;
|
|
17
13
|
__decorate([
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
IsNumber(),
|
|
15
|
+
IsNotEmpty(),
|
|
20
16
|
__metadata("design:type", Number)
|
|
21
17
|
], CreateUserCreatedPayloadDto.prototype, "id", void 0);
|
|
22
18
|
__decorate([
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
IsString(),
|
|
20
|
+
IsNotEmpty(),
|
|
25
21
|
__metadata("design:type", String)
|
|
26
22
|
], CreateUserCreatedPayloadDto.prototype, "firstName", void 0);
|
|
27
23
|
__decorate([
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
IsString(),
|
|
25
|
+
IsOptional(),
|
|
30
26
|
__metadata("design:type", String)
|
|
31
27
|
], CreateUserCreatedPayloadDto.prototype, "lastName", void 0);
|
|
32
28
|
__decorate([
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
IsEmail(),
|
|
30
|
+
IsNotEmpty(),
|
|
35
31
|
__metadata("design:type", String)
|
|
36
32
|
], CreateUserCreatedPayloadDto.prototype, "email", void 0);
|
|
37
33
|
__decorate([
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
IsPhoneNumber(),
|
|
35
|
+
IsOptional(),
|
|
40
36
|
__metadata("design:type", String)
|
|
41
37
|
], CreateUserCreatedPayloadDto.prototype, "phoneNumber", void 0);
|
|
42
38
|
__decorate([
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
IsArray(),
|
|
40
|
+
ArrayNotEmpty(),
|
|
41
|
+
IsString({ each: true }),
|
|
46
42
|
__metadata("design:type", Array)
|
|
47
43
|
], CreateUserCreatedPayloadDto.prototype, "roles", void 0);
|
|
48
44
|
__decorate([
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
IsString(),
|
|
46
|
+
IsOptional(),
|
|
51
47
|
__metadata("design:type", String)
|
|
52
48
|
], CreateUserCreatedPayloadDto.prototype, "otp", void 0);
|
|
53
49
|
__decorate([
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
IsDate(),
|
|
51
|
+
IsOptional(),
|
|
56
52
|
__metadata("design:type", Date)
|
|
57
53
|
], CreateUserCreatedPayloadDto.prototype, "otpExpiresAt", void 0);
|
|
58
54
|
__decorate([
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
IsString(),
|
|
56
|
+
IsOptional(),
|
|
61
57
|
__metadata("design:type", String)
|
|
62
58
|
], CreateUserCreatedPayloadDto.prototype, "verificationToken", void 0);
|
|
63
59
|
__decorate([
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
IsString(),
|
|
61
|
+
IsOptional(),
|
|
66
62
|
__metadata("design:type", Date)
|
|
67
63
|
], CreateUserCreatedPayloadDto.prototype, "verificationTokenExpiresAt", void 0);
|
|
68
64
|
__decorate([
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
IsDate(),
|
|
66
|
+
IsNotEmpty(),
|
|
71
67
|
__metadata("design:type", Date)
|
|
72
68
|
], CreateUserCreatedPayloadDto.prototype, "createdAt", void 0);
|
|
73
69
|
__decorate([
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
IsObject(),
|
|
71
|
+
IsOptional(),
|
|
76
72
|
__metadata("design:type", Object)
|
|
77
73
|
], CreateUserCreatedPayloadDto.prototype, "attributes", void 0);
|