easywork-common-lib 1.0.116 → 1.0.117
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/common/constants/index.d.ts +1 -0
- package/dist/common/constants/index.js +18 -0
- package/dist/common/constants/index.js.map +1 -0
- package/dist/common/constants/regex.constant.d.ts +6 -0
- package/dist/common/constants/regex.constant.js +10 -0
- package/dist/common/constants/regex.constant.js.map +1 -0
- package/dist/common/dtos/index.d.ts +1 -0
- package/dist/common/dtos/index.js +18 -0
- package/dist/common/dtos/index.js.map +1 -0
- package/dist/common/dtos/send-notification.dto.d.ts +10 -0
- package/dist/common/dtos/send-notification.dto.js +54 -0
- package/dist/common/dtos/send-notification.dto.js.map +1 -0
- package/dist/common/enums/notification.enum.d.ts +22 -0
- package/dist/common/enums/notification.enum.js +25 -1
- package/dist/common/enums/notification.enum.js.map +1 -1
- package/dist/common/helpers/app.utils.d.ts +5 -0
- package/dist/common/helpers/app.utils.js +32 -0
- package/dist/common/helpers/app.utils.js.map +1 -0
- package/dist/common/helpers/helpers.utils.d.ts +5 -0
- package/dist/common/helpers/helpers.utils.js +26 -0
- package/dist/common/helpers/helpers.utils.js.map +1 -0
- package/dist/common/helpers/index.d.ts +2 -0
- package/dist/common/helpers/index.js +19 -0
- package/dist/common/helpers/index.js.map +1 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/index.js +4 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/interceptors/index.d.ts +1 -0
- package/dist/common/interceptors/index.js +18 -0
- package/dist/common/interceptors/index.js.map +1 -0
- package/dist/common/interceptors/security.interceptor.d.ts +5 -0
- package/dist/common/interceptors/security.interceptor.js +22 -0
- package/dist/common/interceptors/security.interceptor.js.map +1 -0
- package/dist/entities/helpers/contact_email.entity.d.ts +11 -0
- package/dist/entities/helpers/contact_email.entity.js +61 -0
- package/dist/entities/helpers/contact_email.entity.js.map +1 -0
- package/dist/entities/helpers/contact_phone.entity.d.ts +11 -0
- package/dist/entities/helpers/contact_phone.entity.js +61 -0
- package/dist/entities/helpers/contact_phone.entity.js.map +1 -0
- package/dist/entities/helpers/contact_sources.entity.d.ts +5 -0
- package/dist/entities/helpers/contact_sources.entity.js +33 -0
- package/dist/entities/helpers/contact_sources.entity.js.map +1 -0
- package/dist/entities/helpers/contact_types.entity.d.ts +5 -0
- package/dist/entities/helpers/contact_types.entity.js +33 -0
- package/dist/entities/helpers/contact_types.entity.js.map +1 -0
- package/dist/entities/helpers/lead_email.entity.d.ts +11 -0
- package/dist/entities/helpers/lead_email.entity.js +59 -0
- package/dist/entities/helpers/lead_email.entity.js.map +1 -0
- package/dist/entities/helpers/lead_phone.entity.d.ts +11 -0
- package/dist/entities/helpers/lead_phone.entity.js +59 -0
- package/dist/entities/helpers/lead_phone.entity.js.map +1 -0
- package/dist/entities/helpers/sales/h_poliza_forma_cobro.entity.d.ts +5 -0
- package/dist/entities/helpers/sales/h_poliza_forma_cobro.entity.js +30 -0
- package/dist/entities/helpers/sales/h_poliza_forma_cobro.entity.js.map +1 -0
- package/dist/entities/helpers/sales/h_poliza_frecuencia_pago.entity.d.ts +6 -0
- package/dist/entities/helpers/sales/h_poliza_frecuencia_pago.entity.js +35 -0
- package/dist/entities/helpers/sales/h_poliza_frecuencia_pago.entity.js.map +1 -0
- package/dist/entities/helpers/sales/h_poliza_type.entity.d.ts +5 -0
- package/dist/entities/helpers/sales/h_poliza_type.entity.js +30 -0
- package/dist/entities/helpers/sales/h_poliza_type.entity.js.map +1 -0
- package/dist/entities/imap-folder.entity.d.ts +1 -0
- package/dist/entities/imap-folder.entity.js +5 -0
- package/dist/entities/imap-folder.entity.js.map +1 -1
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/notifications/index.d.ts +1 -0
- package/dist/entities/notifications/index.js +18 -0
- package/dist/entities/notifications/index.js.map +1 -0
- package/dist/entities/notifications/notification.entity.d.ts +13 -0
- package/dist/entities/notifications/notification.entity.js +83 -0
- package/dist/entities/notifications/notification.entity.js.map +1 -0
- package/package.json +1 -1
- package/scripts/bump.sh +5 -5
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./regex.constant";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./regex.constant"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const JWT_EXPIRY_REGEX: RegExp;
|
|
2
|
+
export declare const SENTRY_DSN_REGEX: RegExp;
|
|
3
|
+
export declare const RABBIT_MQ_URI_REGEX: RegExp;
|
|
4
|
+
export declare const REDIS_URI_REGEX: RegExp;
|
|
5
|
+
export declare const USERNAME_REGEX: RegExp;
|
|
6
|
+
export declare const PASSWORD_REGEX: RegExp;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PASSWORD_REGEX = exports.USERNAME_REGEX = exports.REDIS_URI_REGEX = exports.RABBIT_MQ_URI_REGEX = exports.SENTRY_DSN_REGEX = exports.JWT_EXPIRY_REGEX = void 0;
|
|
4
|
+
exports.JWT_EXPIRY_REGEX = /\b(\d+)\s*(ms|s|m|h|d)\b/;
|
|
5
|
+
exports.SENTRY_DSN_REGEX = /https:\/\/[\da-f]{32}@o\d+\.ingest\.sentry\.io\/\d+/;
|
|
6
|
+
exports.RABBIT_MQ_URI_REGEX = /^(amqps?):\/\/(?:[^:@]+:[^:@]+@)?[^/:?]+(?::\d+)?(?:\/[^/?]+)?(?:\?.*)?$/;
|
|
7
|
+
exports.REDIS_URI_REGEX = /^redis:\/\/(?:([^:@]+):([^:@]+)@)?([^/:]+)(?::(\d+))?(?:\/(\d+))?$/;
|
|
8
|
+
exports.USERNAME_REGEX = /^(?![\d._-])[\w-.]+$/;
|
|
9
|
+
exports.PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W).*$/;
|
|
10
|
+
//# sourceMappingURL=regex.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.constant.js","sourceRoot":"","sources":["../../../src/common/constants/regex.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,gBAAgB,GAAG,0BAA0B,CAAC;AAC9C,QAAA,gBAAgB,GACzB,qDAAqD,CAAC;AAC7C,QAAA,mBAAmB,GAC5B,0EAA0E,CAAC;AAClE,QAAA,eAAe,GACxB,oEAAoE,CAAC;AAC5D,QAAA,cAAc,GAAG,sBAAsB,CAAC;AACxC,QAAA,cAAc,GAAG,4CAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./send-notification.dto";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./send-notification.dto"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NotificationCategory, NotificationChannel, NotificationSubcategory } from "../../common";
|
|
2
|
+
export declare class SendNotificationDto {
|
|
3
|
+
title: string;
|
|
4
|
+
recipientsId: string[];
|
|
5
|
+
entityId: string;
|
|
6
|
+
content: string;
|
|
7
|
+
channels: NotificationChannel[];
|
|
8
|
+
category?: NotificationCategory;
|
|
9
|
+
subCategory?: NotificationSubcategory;
|
|
10
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.SendNotificationDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const common_1 = require("../../common");
|
|
15
|
+
class SendNotificationDto {
|
|
16
|
+
title;
|
|
17
|
+
recipientsId;
|
|
18
|
+
entityId;
|
|
19
|
+
content;
|
|
20
|
+
channels;
|
|
21
|
+
category;
|
|
22
|
+
subCategory;
|
|
23
|
+
}
|
|
24
|
+
exports.SendNotificationDto = SendNotificationDto;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], SendNotificationDto.prototype, "title", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsUUID)("all", { each: true }),
|
|
31
|
+
__metadata("design:type", Array)
|
|
32
|
+
], SendNotificationDto.prototype, "recipientsId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsUUID)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], SendNotificationDto.prototype, "entityId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], SendNotificationDto.prototype, "content", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsEnum)(common_1.NotificationChannel, { each: true }),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], SendNotificationDto.prototype, "channels", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsEnum)(common_1.NotificationCategory),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], SendNotificationDto.prototype, "category", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsEnum)(common_1.NotificationSubcategory),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], SendNotificationDto.prototype, "subCategory", void 0);
|
|
54
|
+
//# sourceMappingURL=send-notification.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-notification.dto.js","sourceRoot":"","sources":["../../../src/common/dtos/send-notification.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AACvE,yCAAkG;AAElG,MAAa,mBAAmB;IAE5B,KAAK,CAAS;IAGd,YAAY,CAAW;IAIvB,QAAQ,CAAS;IAGjB,OAAO,CAAS;IAGhB,QAAQ,CAAwB;IAGhC,QAAQ,CAAwB;IAGhC,WAAW,CAA2B;CACzC;AAtBD,kDAsBC;AApBG;IADC,IAAA,0BAAQ,GAAE;;kDACG;AAGd;IADC,IAAA,wBAAM,EAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yDACP;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;qDACQ;AAGjB;IADC,IAAA,0BAAQ,GAAE;;oDACK;AAGhB;IADC,IAAA,wBAAM,EAAC,4BAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;qDACZ;AAGhC;IADC,IAAA,wBAAM,EAAC,6BAAoB,CAAC;;qDACG;AAGhC;IADC,IAAA,wBAAM,EAAC,gCAAuB,CAAC;;wDACM"}
|
|
@@ -4,3 +4,25 @@ export declare enum NotificationChannel {
|
|
|
4
4
|
PUSH = "push",
|
|
5
5
|
APP = "app"
|
|
6
6
|
}
|
|
7
|
+
export declare enum NotificationSubcategory {
|
|
8
|
+
NEW_TASK = "new-task",
|
|
9
|
+
TASK_COMPLETED = "task-complete",
|
|
10
|
+
TASK_OVERDUE = "task-overdue",
|
|
11
|
+
TASK_REMINDER = "task-reminder",
|
|
12
|
+
TASK_NEW_COMMNET = "task-new-comment",
|
|
13
|
+
TASK_APPROVED = "task-approved",
|
|
14
|
+
TASK_REJECTED = "task-rejected",
|
|
15
|
+
TASK_UPDATED = "task-updated",
|
|
16
|
+
DEFAULT = "default"
|
|
17
|
+
}
|
|
18
|
+
export declare enum NotificationCategory {
|
|
19
|
+
TASK = "task",
|
|
20
|
+
CRM = "crm",
|
|
21
|
+
SALES = "sales",
|
|
22
|
+
DRIVE = "drive",
|
|
23
|
+
EMAIL = "email",
|
|
24
|
+
CALENDAR = "calendar",
|
|
25
|
+
TOOLS = "tools",
|
|
26
|
+
INFO = "info",
|
|
27
|
+
DEFAULT = "default"
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationChannel = void 0;
|
|
3
|
+
exports.NotificationCategory = exports.NotificationSubcategory = exports.NotificationChannel = void 0;
|
|
4
4
|
var NotificationChannel;
|
|
5
5
|
(function (NotificationChannel) {
|
|
6
6
|
NotificationChannel["EMAIL"] = "email";
|
|
@@ -8,4 +8,28 @@ var NotificationChannel;
|
|
|
8
8
|
NotificationChannel["PUSH"] = "push";
|
|
9
9
|
NotificationChannel["APP"] = "app";
|
|
10
10
|
})(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
|
|
11
|
+
var NotificationSubcategory;
|
|
12
|
+
(function (NotificationSubcategory) {
|
|
13
|
+
NotificationSubcategory["NEW_TASK"] = "new-task";
|
|
14
|
+
NotificationSubcategory["TASK_COMPLETED"] = "task-complete";
|
|
15
|
+
NotificationSubcategory["TASK_OVERDUE"] = "task-overdue";
|
|
16
|
+
NotificationSubcategory["TASK_REMINDER"] = "task-reminder";
|
|
17
|
+
NotificationSubcategory["TASK_NEW_COMMNET"] = "task-new-comment";
|
|
18
|
+
NotificationSubcategory["TASK_APPROVED"] = "task-approved";
|
|
19
|
+
NotificationSubcategory["TASK_REJECTED"] = "task-rejected";
|
|
20
|
+
NotificationSubcategory["TASK_UPDATED"] = "task-updated";
|
|
21
|
+
NotificationSubcategory["DEFAULT"] = "default";
|
|
22
|
+
})(NotificationSubcategory || (exports.NotificationSubcategory = NotificationSubcategory = {}));
|
|
23
|
+
var NotificationCategory;
|
|
24
|
+
(function (NotificationCategory) {
|
|
25
|
+
NotificationCategory["TASK"] = "task";
|
|
26
|
+
NotificationCategory["CRM"] = "crm";
|
|
27
|
+
NotificationCategory["SALES"] = "sales";
|
|
28
|
+
NotificationCategory["DRIVE"] = "drive";
|
|
29
|
+
NotificationCategory["EMAIL"] = "email";
|
|
30
|
+
NotificationCategory["CALENDAR"] = "calendar";
|
|
31
|
+
NotificationCategory["TOOLS"] = "tools";
|
|
32
|
+
NotificationCategory["INFO"] = "info";
|
|
33
|
+
NotificationCategory["DEFAULT"] = "default";
|
|
34
|
+
})(NotificationCategory || (exports.NotificationCategory = NotificationCategory = {}));
|
|
11
35
|
//# sourceMappingURL=notification.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.enum.js","sourceRoot":"","sources":["../../../src/common/enums/notification.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B"}
|
|
1
|
+
{"version":3,"file":"notification.enum.js","sourceRoot":"","sources":["../../../src/common/enums/notification.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,IAAY,uBAUX;AAVD,WAAY,uBAAuB;IAC/B,gDAAqB,CAAA;IACrB,2DAAgC,CAAA;IAChC,wDAA6B,CAAA;IAC7B,0DAA+B,CAAA;IAC/B,gEAAqC,CAAA;IACrC,0DAA+B,CAAA;IAC/B,0DAA+B,CAAA;IAC/B,wDAA6B,CAAA;IAC7B,8CAAmB,CAAA;AACvB,CAAC,EAVW,uBAAuB,uCAAvB,uBAAuB,QAUlC;AAED,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,mCAAW,CAAA;IACX,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,6CAAqB,CAAA;IACrB,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,2CAAmB,CAAA;AACvB,CAAC,EAVW,oBAAoB,oCAApB,oBAAoB,QAU/B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppUtils = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const helpers_utils_1 = require("./helpers.utils");
|
|
6
|
+
const logger = new common_1.Logger("App:Utils");
|
|
7
|
+
exports.AppUtils = {
|
|
8
|
+
validationPipeOptions() {
|
|
9
|
+
return {
|
|
10
|
+
whitelist: true,
|
|
11
|
+
transform: true,
|
|
12
|
+
forbidUnknownValues: false,
|
|
13
|
+
validateCustomDecorators: true,
|
|
14
|
+
enableDebugMessages: helpers_utils_1.HelperService.isDev(),
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
async gracefulShutdown(app, code) {
|
|
18
|
+
setTimeout(() => process.exit(1), 5000);
|
|
19
|
+
logger.verbose(`Signal received with code ${code} ⚡.`);
|
|
20
|
+
logger.log("❗Closing http server with grace.");
|
|
21
|
+
try {
|
|
22
|
+
await app.close();
|
|
23
|
+
logger.log("✅ Http server closed.");
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
logger.error(`❌ Http server closed with error: ${error}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=app.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.utils.js","sourceRoot":"","sources":["../../../src/common/helpers/app.utils.ts"],"names":[],"mappings":";;;AAAA,2CAAiF;AACjF,mDAAgD;AAEhD,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,WAAW,CAAC,CAAC;AAE1B,QAAA,QAAQ,GAAG;IACpB,qBAAqB;QACjB,OAAO;YACH,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,mBAAmB,EAAE,KAAK;YAC1B,wBAAwB,EAAE,IAAI;YAC9B,mBAAmB,EAAE,6BAAa,CAAC,KAAK,EAAE;SAC7C,CAAA;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,GAAqB,EAAE,IAAY;QACtD,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,CAAC,OAAO,CAAC,6BAA6B,IAAI,KAAK,CAAC,CAAC;QACvD,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAE/C,IAAI,CAAC;YACD,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YAClB,MAAM,CAAC,KAAK,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC;CAEJ,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HelperService = void 0;
|
|
7
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
exports.HelperService = {
|
|
11
|
+
isDev() {
|
|
12
|
+
return node_process_1.default.env.NODE_ENV?.startsWith("dev");
|
|
13
|
+
},
|
|
14
|
+
isProd() {
|
|
15
|
+
return node_process_1.default.env.NODE_ENV?.startsWith("prod");
|
|
16
|
+
},
|
|
17
|
+
getAppRootDir() {
|
|
18
|
+
let currentDirectory = __dirname;
|
|
19
|
+
while (!(0, node_fs_1.existsSync)((0, node_path_1.join)(currentDirectory, "resources")))
|
|
20
|
+
currentDirectory = (0, node_path_1.join)(currentDirectory, "..");
|
|
21
|
+
return node_process_1.default.env.NODE_ENV === "prod"
|
|
22
|
+
? (0, node_path_1.join)(currentDirectory, "dist")
|
|
23
|
+
: currentDirectory;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=helpers.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.utils.js","sourceRoot":"","sources":["../../../src/common/helpers/helpers.utils.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAmC;AACnC,yCAAiC;AACjC,qCAAqC;AAExB,QAAA,aAAa,GAAG;IACzB,KAAK;QACD,OAAO,sBAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,MAAM;QACF,OAAO,sBAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,aAAa;QACT,IAAI,gBAAgB,GAAG,SAAS,CAAC;QAEjC,OAAO,CAAC,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;YACnD,gBAAgB,GAAG,IAAA,gBAAI,EAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAEpD,OAAO,sBAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;YAClC,CAAC,CAAC,IAAA,gBAAI,EAAC,gBAAgB,EAAE,MAAM,CAAC;YAChC,CAAC,CAAC,gBAAgB,CAAC;IAC3B,CAAC;CACJ,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./app.utils"), exports);
|
|
18
|
+
__exportStar(require("./helpers.utils"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,kDAAgC"}
|
package/dist/common/index.d.ts
CHANGED
package/dist/common/index.js
CHANGED
|
@@ -16,4 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums"), exports);
|
|
18
18
|
__exportStar(require("./database"), exports);
|
|
19
|
+
__exportStar(require("./interceptors"), exports);
|
|
20
|
+
__exportStar(require("./helpers"), exports);
|
|
21
|
+
__exportStar(require("./constants"), exports);
|
|
22
|
+
__exportStar(require("./dtos"), exports);
|
|
19
23
|
//# sourceMappingURL=index.js.map
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,iDAA+B;AAC/B,4CAA0B;AAC1B,8CAA4B;AAC5B,yCAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./security.interceptor";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./security.interceptor"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/interceptors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CallHandler, ExecutionContext, NestInterceptor } from "@nestjs/common";
|
|
2
|
+
import type { Observable } from "rxjs";
|
|
3
|
+
export declare class SecurityInterceptor implements NestInterceptor {
|
|
4
|
+
intercept(_context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SecurityInterceptor = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const class_transformer_1 = require("class-transformer");
|
|
12
|
+
const rxjs_1 = require("rxjs");
|
|
13
|
+
let SecurityInterceptor = class SecurityInterceptor {
|
|
14
|
+
intercept(_context, next) {
|
|
15
|
+
return next.handle().pipe((0, rxjs_1.map)(data => (0, class_transformer_1.instanceToPlain)(data)));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.SecurityInterceptor = SecurityInterceptor;
|
|
19
|
+
exports.SecurityInterceptor = SecurityInterceptor = __decorate([
|
|
20
|
+
(0, common_1.Injectable)()
|
|
21
|
+
], SecurityInterceptor);
|
|
22
|
+
//# sourceMappingURL=security.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/security.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAKA,2CAEwB;AACxB,yDAAoD;AAEpD,+BAA2B;AAGpB,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC5B,SAAS,CAAC,QAA0B,EAAE,IAAiB;QACnD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAA,UAAG,EAAC,IAAI,CAAC,EAAE,CAAC,IAAA,mCAAe,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;CACJ,CAAA;AAJY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;GACA,mBAAmB,CAI/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEntity } from "typeorm";
|
|
2
|
+
import { Contact } from "../sales/contact.entity";
|
|
3
|
+
import { Email } from "../email.entity";
|
|
4
|
+
export declare class ContactEmail extends BaseEntity {
|
|
5
|
+
id?: string;
|
|
6
|
+
contactId: string;
|
|
7
|
+
emailId: string;
|
|
8
|
+
relation: string;
|
|
9
|
+
contact: Contact;
|
|
10
|
+
email: Email;
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.ContactEmail = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const contact_entity_1 = require("../sales/contact.entity");
|
|
16
|
+
const email_entity_1 = require("../email.entity");
|
|
17
|
+
let ContactEmail = class ContactEmail extends typeorm_1.BaseEntity {
|
|
18
|
+
id;
|
|
19
|
+
contactId;
|
|
20
|
+
emailId;
|
|
21
|
+
relation;
|
|
22
|
+
contact;
|
|
23
|
+
email;
|
|
24
|
+
};
|
|
25
|
+
exports.ContactEmail = ContactEmail;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], ContactEmail.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ContactEmail.prototype, "contactId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ContactEmail.prototype, "emailId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ContactEmail.prototype, "relation", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_transformer_1.Exclude)(),
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => contact_entity_1.Contact, contact => contact.emails, {
|
|
45
|
+
onDelete: "CASCADE",
|
|
46
|
+
onUpdate: "CASCADE",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", contact_entity_1.Contact)
|
|
49
|
+
], ContactEmail.prototype, "contact", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => email_entity_1.Email, {
|
|
52
|
+
onDelete: "CASCADE",
|
|
53
|
+
onUpdate: "CASCADE",
|
|
54
|
+
eager: true,
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", email_entity_1.Email)
|
|
57
|
+
], ContactEmail.prototype, "email", void 0);
|
|
58
|
+
exports.ContactEmail = ContactEmail = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)()
|
|
60
|
+
], ContactEmail);
|
|
61
|
+
//# sourceMappingURL=contact_email.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact_email.entity.js","sourceRoot":"","sources":["../../../src/entities/helpers/contact_email.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwF;AACxF,yDAA4C;AAC5C,4DAAkD;AAClD,kDAAwC;AAGjC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,oBAAU;IAE1C,EAAE,CAAU;IAGZ,SAAS,CAAS;IAGlB,OAAO,CAAS;IAGhB,QAAQ,CAAS;IAOV,OAAO,CAAU;IAOjB,KAAK,CAAQ;CACrB,CAAA;AA1BY,oCAAY;AAEvB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;wCACnB;AAGZ;IADC,IAAA,gBAAM,GAAE;;+CACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;6CACO;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAOV;IALN,IAAA,2BAAO,GAAE;IACT,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE;QACnD,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;8BACc,wBAAO;6CAAC;AAOjB;IALN,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE;QACtB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,IAAI;KACZ,CAAC;8BACY,oBAAK;2CAAC;uBAzBT,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CA0BxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEntity } from "typeorm";
|
|
2
|
+
import { Contact } from "../sales/contact.entity";
|
|
3
|
+
import { Phone } from "../phone.entity";
|
|
4
|
+
export declare class ContactPhone extends BaseEntity {
|
|
5
|
+
id?: string;
|
|
6
|
+
contactId: string;
|
|
7
|
+
phoneId: string;
|
|
8
|
+
relation: string;
|
|
9
|
+
contact: Contact;
|
|
10
|
+
phone: Phone;
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.ContactPhone = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const contact_entity_1 = require("../sales/contact.entity");
|
|
16
|
+
const phone_entity_1 = require("../phone.entity");
|
|
17
|
+
let ContactPhone = class ContactPhone extends typeorm_1.BaseEntity {
|
|
18
|
+
id;
|
|
19
|
+
contactId;
|
|
20
|
+
phoneId;
|
|
21
|
+
relation;
|
|
22
|
+
contact;
|
|
23
|
+
phone;
|
|
24
|
+
};
|
|
25
|
+
exports.ContactPhone = ContactPhone;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], ContactPhone.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ContactPhone.prototype, "contactId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ContactPhone.prototype, "phoneId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ContactPhone.prototype, "relation", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_transformer_1.Exclude)(),
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => contact_entity_1.Contact, contact => contact.phones, {
|
|
45
|
+
onDelete: "CASCADE",
|
|
46
|
+
onUpdate: "CASCADE",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", contact_entity_1.Contact)
|
|
49
|
+
], ContactPhone.prototype, "contact", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => phone_entity_1.Phone, {
|
|
52
|
+
onDelete: "CASCADE",
|
|
53
|
+
onUpdate: "CASCADE",
|
|
54
|
+
eager: true,
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", phone_entity_1.Phone)
|
|
57
|
+
], ContactPhone.prototype, "phone", void 0);
|
|
58
|
+
exports.ContactPhone = ContactPhone = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)()
|
|
60
|
+
], ContactPhone);
|
|
61
|
+
//# sourceMappingURL=contact_phone.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact_phone.entity.js","sourceRoot":"","sources":["../../../src/entities/helpers/contact_phone.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwF;AACxF,yDAA4C;AAC5C,4DAAkD;AAClD,kDAAwC;AAGjC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,oBAAU;IAE1C,EAAE,CAAU;IAGZ,SAAS,CAAS;IAGlB,OAAO,CAAS;IAGhB,QAAQ,CAAS;IAOV,OAAO,CAAU;IAOjB,KAAK,CAAQ;CACrB,CAAA;AA1BY,oCAAY;AAEvB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;wCACnB;AAGZ;IADC,IAAA,gBAAM,GAAE;;+CACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;6CACO;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAOV;IALN,IAAA,2BAAO,GAAE;IACT,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE;QACnD,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;8BACc,wBAAO;6CAAC;AAOjB;IALN,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE;QACtB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,IAAI;KACZ,CAAC;8BACY,oBAAK;2CAAC;uBAzBT,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CA0BxB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.ContactSource = void 0;
|
|
13
|
+
const database_1 = require("../../common/database");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
let ContactSource = class ContactSource extends database_1.BaseEntity {
|
|
17
|
+
name;
|
|
18
|
+
isDefault;
|
|
19
|
+
};
|
|
20
|
+
exports.ContactSource = ContactSource;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.MinLength)(3),
|
|
23
|
+
(0, typeorm_1.Column)({ unique: true }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ContactSource.prototype, "name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
28
|
+
__metadata("design:type", Boolean)
|
|
29
|
+
], ContactSource.prototype, "isDefault", void 0);
|
|
30
|
+
exports.ContactSource = ContactSource = __decorate([
|
|
31
|
+
(0, typeorm_1.Entity)()
|
|
32
|
+
], ContactSource);
|
|
33
|
+
//# sourceMappingURL=contact_sources.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact_sources.entity.js","sourceRoot":"","sources":["../../../src/entities/helpers/contact_sources.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmD;AACnD,qDAA4C;AAC5C,qCAAyC;AAGlC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,qBAAU;IAG3C,IAAI,CAAS;IAGb,SAAS,CAAU;CACpB,CAAA;AAPY,sCAAa;AAGxB;IAFC,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;2CACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACR;wBANR,aAAa;IADzB,IAAA,gBAAM,GAAE;GACI,aAAa,CAOzB"}
|