@sigmatech/pergamo 0.1.1 → 0.1.3
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/entities/chat/chat-message.entity.d.ts +27 -0
- package/dist/entities/chat/chat-message.entity.d.ts.map +1 -0
- package/dist/entities/chat/chat-message.entity.js +91 -0
- package/dist/entities/chat/chat-message.entity.js.map +1 -0
- package/dist/entities/chat/chat-participant.entity.d.ts +21 -0
- package/dist/entities/chat/chat-participant.entity.d.ts.map +1 -0
- package/dist/entities/chat/chat-participant.entity.js +68 -0
- package/dist/entities/chat/chat-participant.entity.js.map +1 -0
- package/dist/entities/chat/chat.entity.d.ts +21 -0
- package/dist/entities/chat/chat.entity.d.ts.map +1 -0
- package/dist/entities/chat/chat.entity.js +69 -0
- package/dist/entities/chat/chat.entity.js.map +1 -0
- package/dist/entities/chat/contact-request.entity.d.ts +19 -0
- package/dist/entities/chat/contact-request.entity.d.ts.map +1 -0
- package/dist/entities/chat/contact-request.entity.js +61 -0
- package/dist/entities/chat/contact-request.entity.js.map +1 -0
- package/dist/entities/chat/index.d.ts +5 -0
- package/dist/entities/chat/index.d.ts.map +1 -0
- package/dist/entities/chat/index.js +21 -0
- package/dist/entities/chat/index.js.map +1 -0
- package/dist/entities/index.d.ts +3 -0
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +4 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/telefonia/location-request.entity.d.ts +111 -0
- package/dist/entities/telefonia/location-request.entity.d.ts.map +1 -0
- package/dist/entities/telefonia/location-request.entity.js +156 -0
- package/dist/entities/telefonia/location-request.entity.js.map +1 -0
- package/dist/entities/telefonia/location-response.entity.d.ts +129 -0
- package/dist/entities/telefonia/location-response.entity.d.ts.map +1 -0
- package/dist/entities/telefonia/location-response.entity.js +185 -0
- package/dist/entities/telefonia/location-response.entity.js.map +1 -0
- package/dist/entities/user.entity.d.ts +6 -0
- package/dist/entities/user.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.js +6 -1
- package/dist/entities/user.entity.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GlobalBase } from '../base/_global-base';
|
|
2
|
+
import { Chat } from './chat.entity';
|
|
3
|
+
import { User } from '../user.entity';
|
|
4
|
+
export declare enum MessageType {
|
|
5
|
+
TEXT = "TEXT",
|
|
6
|
+
IMAGE = "IMAGE",
|
|
7
|
+
FILE = "FILE",
|
|
8
|
+
SYSTEM = "SYSTEM"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ChatMessage Entity
|
|
12
|
+
* Stores all messages sent in chats
|
|
13
|
+
*/
|
|
14
|
+
export declare class ChatMessage extends GlobalBase {
|
|
15
|
+
chat: Chat;
|
|
16
|
+
sender: User;
|
|
17
|
+
content: string;
|
|
18
|
+
type: MessageType;
|
|
19
|
+
replyTo?: ChatMessage;
|
|
20
|
+
fileUrl?: string;
|
|
21
|
+
fileName?: string;
|
|
22
|
+
deliveredAt?: Date;
|
|
23
|
+
readAt?: Date;
|
|
24
|
+
isEdited: boolean;
|
|
25
|
+
editedAt?: Date;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=chat-message.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/chat/chat-message.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,qBAKa,WAAY,SAAQ,UAAU;IAKzC,IAAI,EAAG,IAAI,CAAC;IAIZ,MAAM,EAAG,IAAI,CAAC;IAGd,OAAO,EAAG,MAAM,CAAC;IAOjB,IAAI,EAAG,WAAW,CAAC;IAInB,OAAO,CAAC,EAAE,WAAW,CAAC;IAGtB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,IAAI,CAAC;IAGnB,MAAM,CAAC,EAAE,IAAI,CAAC;IAGd,QAAQ,EAAG,OAAO,CAAC;IAGnB,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,91 @@
|
|
|
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.ChatMessage = exports.MessageType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _global_base_1 = require("../base/_global-base");
|
|
15
|
+
const chat_entity_1 = require("./chat.entity");
|
|
16
|
+
const user_entity_1 = require("../user.entity");
|
|
17
|
+
var MessageType;
|
|
18
|
+
(function (MessageType) {
|
|
19
|
+
MessageType["TEXT"] = "TEXT";
|
|
20
|
+
MessageType["IMAGE"] = "IMAGE";
|
|
21
|
+
MessageType["FILE"] = "FILE";
|
|
22
|
+
MessageType["SYSTEM"] = "SYSTEM";
|
|
23
|
+
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
24
|
+
/**
|
|
25
|
+
* ChatMessage Entity
|
|
26
|
+
* Stores all messages sent in chats
|
|
27
|
+
*/
|
|
28
|
+
let ChatMessage = class ChatMessage extends _global_base_1.GlobalBase {
|
|
29
|
+
};
|
|
30
|
+
exports.ChatMessage = ChatMessage;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => chat_entity_1.Chat, (chat) => chat.messages, {
|
|
33
|
+
onDelete: 'CASCADE',
|
|
34
|
+
}),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: 'chat_id' }),
|
|
36
|
+
__metadata("design:type", chat_entity_1.Chat)
|
|
37
|
+
], ChatMessage.prototype, "chat", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: true }),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: 'sender_id' }),
|
|
41
|
+
__metadata("design:type", user_entity_1.User)
|
|
42
|
+
], ChatMessage.prototype, "sender", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ChatMessage.prototype, "content", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({
|
|
49
|
+
type: 'enum',
|
|
50
|
+
enum: MessageType,
|
|
51
|
+
default: MessageType.TEXT,
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ChatMessage.prototype, "type", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(() => ChatMessage, { nullable: true }),
|
|
57
|
+
(0, typeorm_1.JoinColumn)({ name: 'reply_to_id' }),
|
|
58
|
+
__metadata("design:type", ChatMessage)
|
|
59
|
+
], ChatMessage.prototype, "replyTo", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true, name: 'file_url' }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], ChatMessage.prototype, "fileUrl", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true, name: 'file_name' }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], ChatMessage.prototype, "fileName", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, name: 'delivered_at' }),
|
|
70
|
+
__metadata("design:type", Date)
|
|
71
|
+
], ChatMessage.prototype, "deliveredAt", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, name: 'read_at' }),
|
|
74
|
+
__metadata("design:type", Date)
|
|
75
|
+
], ChatMessage.prototype, "readAt", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false, name: 'is_edited' }),
|
|
78
|
+
__metadata("design:type", Boolean)
|
|
79
|
+
], ChatMessage.prototype, "isEdited", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, name: 'edited_at' }),
|
|
82
|
+
__metadata("design:type", Date)
|
|
83
|
+
], ChatMessage.prototype, "editedAt", void 0);
|
|
84
|
+
exports.ChatMessage = ChatMessage = __decorate([
|
|
85
|
+
(0, typeorm_1.Entity)('chat_message'),
|
|
86
|
+
(0, typeorm_1.Index)('chat_message_chat_idx', ['chat']),
|
|
87
|
+
(0, typeorm_1.Index)('chat_message_sender_idx', ['sender']),
|
|
88
|
+
(0, typeorm_1.Index)('chat_message_created_at_idx', ['createdAt']),
|
|
89
|
+
(0, typeorm_1.Index)('chat_message_chat_created_idx', ['chat', 'createdAt'])
|
|
90
|
+
], ChatMessage);
|
|
91
|
+
//# sourceMappingURL=chat-message.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message.entity.js","sourceRoot":"","sources":["../../../src/entities/chat/chat-message.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,uDAAkD;AAClD,+CAAqC;AACrC,gDAAsC;AAEtC,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED;;;GAGG;AAMI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,yBAAU;CA0C1C,CAAA;AA1CY,kCAAW;AAKtB;IAJC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC9C,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,kBAAI;yCAAC;AAIZ;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtC,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BACzB,kBAAI;2CAAC;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACR;AAOjB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,WAAW,CAAC,IAAI;KAC1B,CAAC;;yCACiB;AAInB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChD,IAAA,oBAAU,E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vB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GlobalBase } from '../base/_global-base';
|
|
2
|
+
import { Chat } from './chat.entity';
|
|
3
|
+
import { User } from '../user.entity';
|
|
4
|
+
export declare enum ParticipantStatus {
|
|
5
|
+
ACTIVE = "ACTIVE",
|
|
6
|
+
BLOCKED = "BLOCKED",
|
|
7
|
+
LEFT = "LEFT"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ChatParticipant Entity
|
|
11
|
+
* Links users to chats and tracks their participation status
|
|
12
|
+
*/
|
|
13
|
+
export declare class ChatParticipant extends GlobalBase {
|
|
14
|
+
chat: Chat;
|
|
15
|
+
user: User;
|
|
16
|
+
status: ParticipantStatus;
|
|
17
|
+
joinedAt: Date;
|
|
18
|
+
lastReadAt?: Date;
|
|
19
|
+
unreadCount: number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=chat-participant.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-participant.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/chat/chat-participant.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,qBAIa,eAAgB,SAAQ,UAAU;IAK7C,IAAI,EAAG,IAAI,CAAC;IAIZ,IAAI,EAAG,IAAI,CAAC;IAOZ,MAAM,EAAG,iBAAiB,CAAC;IAG3B,QAAQ,EAAG,IAAI,CAAC;IAGhB,UAAU,CAAC,EAAE,IAAI,CAAC;IAGlB,WAAW,EAAG,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.ChatParticipant = exports.ParticipantStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _global_base_1 = require("../base/_global-base");
|
|
15
|
+
const chat_entity_1 = require("./chat.entity");
|
|
16
|
+
const user_entity_1 = require("../user.entity");
|
|
17
|
+
var ParticipantStatus;
|
|
18
|
+
(function (ParticipantStatus) {
|
|
19
|
+
ParticipantStatus["ACTIVE"] = "ACTIVE";
|
|
20
|
+
ParticipantStatus["BLOCKED"] = "BLOCKED";
|
|
21
|
+
ParticipantStatus["LEFT"] = "LEFT";
|
|
22
|
+
})(ParticipantStatus || (exports.ParticipantStatus = ParticipantStatus = {}));
|
|
23
|
+
/**
|
|
24
|
+
* ChatParticipant Entity
|
|
25
|
+
* Links users to chats and tracks their participation status
|
|
26
|
+
*/
|
|
27
|
+
let ChatParticipant = class ChatParticipant extends _global_base_1.GlobalBase {
|
|
28
|
+
};
|
|
29
|
+
exports.ChatParticipant = ChatParticipant;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(() => chat_entity_1.Chat, (chat) => chat.participants, {
|
|
32
|
+
onDelete: 'CASCADE',
|
|
33
|
+
}),
|
|
34
|
+
(0, typeorm_1.JoinColumn)({ name: 'chat_id' }),
|
|
35
|
+
__metadata("design:type", chat_entity_1.Chat)
|
|
36
|
+
], ChatParticipant.prototype, "chat", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: true }),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
40
|
+
__metadata("design:type", user_entity_1.User)
|
|
41
|
+
], ChatParticipant.prototype, "user", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({
|
|
44
|
+
type: 'enum',
|
|
45
|
+
enum: ParticipantStatus,
|
|
46
|
+
default: ParticipantStatus.ACTIVE,
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ChatParticipant.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'joined_at', default: () => 'CURRENT_TIMESTAMP' }),
|
|
52
|
+
__metadata("design:type", Date)
|
|
53
|
+
], ChatParticipant.prototype, "joinedAt", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, name: 'last_read_at' }),
|
|
56
|
+
__metadata("design:type", Date)
|
|
57
|
+
], ChatParticipant.prototype, "lastReadAt", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0, name: 'unread_count' }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], ChatParticipant.prototype, "unreadCount", void 0);
|
|
62
|
+
exports.ChatParticipant = ChatParticipant = __decorate([
|
|
63
|
+
(0, typeorm_1.Entity)('chat_participant'),
|
|
64
|
+
(0, typeorm_1.Index)('chat_participant_chat_user_idx', ['chat', 'user'], { unique: true }),
|
|
65
|
+
(0, typeorm_1.Index)('chat_participant_user_idx', ['user']),
|
|
66
|
+
(0, typeorm_1.Index)('chat_participant_status_idx', ['status'])
|
|
67
|
+
], ChatParticipant);
|
|
68
|
+
//# sourceMappingURL=chat-participant.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-participant.entity.js","sourceRoot":"","sources":["../../../src/entities/chat/chat-participant.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,uDAAkD;AAClD,+CAAqC;AACrC,gDAAsC;AAEtC,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAED;;;GAGG;AAKI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,yBAAU;CA0B9C,CAAA;AA1BY,0CAAe;AAK1B;IAJC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;QAClD,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,kBAAI;6CAAC;AAIZ;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtC,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,kBAAI;6CAAC;AAOZ;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,iBAAiB,CAAC,MAAM;KAClC,CAAC;;+CACyB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,CAAC;8BAC1E,IAAI;iDAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;8BACvD,IAAI;mDAAC;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;oDACrC;0BAzBV,eAAe;IAJ3B,IAAA,gBAAM,EAAC,kBAAkB,CAAC;IAC1B,IAAA,eAAK,EAAC,gCAAgC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC3E,IAAA,eAAK,EAAC,2BAA2B,EAAE,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAA,eAAK,EAAC,6BAA6B,EAAE,CAAC,QAAQ,CAAC,CAAC;GACpC,eAAe,CA0B3B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GlobalBase } from '../base/_global-base';
|
|
2
|
+
import { ChatParticipant } from './chat-participant.entity';
|
|
3
|
+
import { ChatMessage } from './chat-message.entity';
|
|
4
|
+
export declare enum ChatType {
|
|
5
|
+
DIRECT = "DIRECT",
|
|
6
|
+
GROUP = "GROUP"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Chat Entity
|
|
10
|
+
* Represents a conversation between two or more users
|
|
11
|
+
*/
|
|
12
|
+
export declare class Chat extends GlobalBase {
|
|
13
|
+
type: ChatType;
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
lastMessageAt?: Date;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
participants?: ChatParticipant[];
|
|
19
|
+
messages?: ChatMessage[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=chat.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/chat/chat.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED;;;GAGG;AACH,qBAEa,IAAK,SAAQ,UAAU;IAMlC,IAAI,EAAG,QAAQ,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,aAAa,CAAC,EAAE,IAAI,CAAC;IAGrB,QAAQ,EAAG,OAAO,CAAC;IAMnB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IAKjC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.Chat = exports.ChatType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _global_base_1 = require("../base/_global-base");
|
|
15
|
+
const chat_participant_entity_1 = require("./chat-participant.entity");
|
|
16
|
+
const chat_message_entity_1 = require("./chat-message.entity");
|
|
17
|
+
var ChatType;
|
|
18
|
+
(function (ChatType) {
|
|
19
|
+
ChatType["DIRECT"] = "DIRECT";
|
|
20
|
+
ChatType["GROUP"] = "GROUP";
|
|
21
|
+
})(ChatType || (exports.ChatType = ChatType = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Chat Entity
|
|
24
|
+
* Represents a conversation between two or more users
|
|
25
|
+
*/
|
|
26
|
+
let Chat = class Chat extends _global_base_1.GlobalBase {
|
|
27
|
+
};
|
|
28
|
+
exports.Chat = Chat;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({
|
|
31
|
+
type: 'enum',
|
|
32
|
+
enum: ChatType,
|
|
33
|
+
default: ChatType.DIRECT,
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], Chat.prototype, "type", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], Chat.prototype, "name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], Chat.prototype, "description", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, name: 'last_message_at' }),
|
|
47
|
+
__metadata("design:type", Date)
|
|
48
|
+
], Chat.prototype, "lastMessageAt", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true, name: 'is_active' }),
|
|
51
|
+
__metadata("design:type", Boolean)
|
|
52
|
+
], Chat.prototype, "isActive", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.OneToMany)(() => chat_participant_entity_1.ChatParticipant, (participant) => participant.chat, {
|
|
55
|
+
cascade: true,
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], Chat.prototype, "participants", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.OneToMany)(() => chat_message_entity_1.ChatMessage, (message) => message.chat, {
|
|
61
|
+
cascade: true,
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Array)
|
|
64
|
+
], Chat.prototype, "messages", void 0);
|
|
65
|
+
exports.Chat = Chat = __decorate([
|
|
66
|
+
(0, typeorm_1.Entity)('chat'),
|
|
67
|
+
(0, typeorm_1.Index)('chat_last_message_at_idx', ['lastMessageAt'])
|
|
68
|
+
], Chat);
|
|
69
|
+
//# sourceMappingURL=chat.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.entity.js","sourceRoot":"","sources":["../../../src/entities/chat/chat.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA2D;AAC3D,uDAAkD;AAClD,uEAA4D;AAC5D,+DAAoD;AAEpD,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;;GAGG;AAGI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,yBAAU;CA8BnC,CAAA;AA9BY,oBAAI;AAMf;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,QAAQ,CAAC,MAAM;KACzB,CAAC;;kCACc;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kCAC3C;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACpB;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;8BACvD,IAAI;2CAAC;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;;sCAC3C;AAMnB;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAAe,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE;QACnE,OAAO,EAAE,IAAI;KACd,CAAC;;0CAC+B;AAKjC;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,iCAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;QACvD,OAAO,EAAE,IAAI;KACd,CAAC;;sCACuB;eA7Bd,IAAI;IAFhB,IAAA,gBAAM,EAAC,MAAM,CAAC;IACd,IAAA,eAAK,EAAC,0BAA0B,EAAE,CAAC,eAAe,CAAC,CAAC;GACxC,IAAI,CA8BhB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GlobalBase } from '../base/_global-base';
|
|
2
|
+
import { User } from '../user.entity';
|
|
3
|
+
export declare enum ContactRequestStatus {
|
|
4
|
+
PENDING = "PENDING",
|
|
5
|
+
ACCEPTED = "ACCEPTED",
|
|
6
|
+
REJECTED = "REJECTED"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* ContactRequest Entity
|
|
10
|
+
* Handles contact invitations between users via IUD
|
|
11
|
+
*/
|
|
12
|
+
export declare class ContactRequest extends GlobalBase {
|
|
13
|
+
fromUser: User;
|
|
14
|
+
toUser: User;
|
|
15
|
+
status: ContactRequestStatus;
|
|
16
|
+
message?: string;
|
|
17
|
+
respondedAt?: Date;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=contact-request.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-request.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/chat/contact-request.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED;;;GAGG;AACH,qBAIa,cAAe,SAAQ,UAAU;IAG5C,QAAQ,EAAG,IAAI,CAAC;IAIhB,MAAM,EAAG,IAAI,CAAC;IAOd,MAAM,EAAG,oBAAoB,CAAC;IAG9B,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB"}
|
|
@@ -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.ContactRequest = exports.ContactRequestStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _global_base_1 = require("../base/_global-base");
|
|
15
|
+
const user_entity_1 = require("../user.entity");
|
|
16
|
+
var ContactRequestStatus;
|
|
17
|
+
(function (ContactRequestStatus) {
|
|
18
|
+
ContactRequestStatus["PENDING"] = "PENDING";
|
|
19
|
+
ContactRequestStatus["ACCEPTED"] = "ACCEPTED";
|
|
20
|
+
ContactRequestStatus["REJECTED"] = "REJECTED";
|
|
21
|
+
})(ContactRequestStatus || (exports.ContactRequestStatus = ContactRequestStatus = {}));
|
|
22
|
+
/**
|
|
23
|
+
* ContactRequest Entity
|
|
24
|
+
* Handles contact invitations between users via IUD
|
|
25
|
+
*/
|
|
26
|
+
let ContactRequest = class ContactRequest extends _global_base_1.GlobalBase {
|
|
27
|
+
};
|
|
28
|
+
exports.ContactRequest = ContactRequest;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: true }),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: 'from_user_id' }),
|
|
32
|
+
__metadata("design:type", user_entity_1.User)
|
|
33
|
+
], ContactRequest.prototype, "fromUser", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: true }),
|
|
36
|
+
(0, typeorm_1.JoinColumn)({ name: 'to_user_id' }),
|
|
37
|
+
__metadata("design:type", user_entity_1.User)
|
|
38
|
+
], ContactRequest.prototype, "toUser", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({
|
|
41
|
+
type: 'enum',
|
|
42
|
+
enum: ContactRequestStatus,
|
|
43
|
+
default: ContactRequestStatus.PENDING,
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ContactRequest.prototype, "status", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ContactRequest.prototype, "message", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, name: 'responded_at' }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], ContactRequest.prototype, "respondedAt", void 0);
|
|
55
|
+
exports.ContactRequest = ContactRequest = __decorate([
|
|
56
|
+
(0, typeorm_1.Entity)('contact_request'),
|
|
57
|
+
(0, typeorm_1.Index)('contact_request_from_to_idx', ['fromUser', 'toUser'], { unique: true }),
|
|
58
|
+
(0, typeorm_1.Index)('contact_request_to_user_idx', ['toUser']),
|
|
59
|
+
(0, typeorm_1.Index)('contact_request_status_idx', ['status'])
|
|
60
|
+
], ContactRequest);
|
|
61
|
+
//# sourceMappingURL=contact-request.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-request.entity.js","sourceRoot":"","sources":["../../../src/entities/chat/contact-request.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,uDAAkD;AAClD,gDAAsC;AAEtC,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACvB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED;;;GAGG;AAKI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,yBAAU;CAqB7C,CAAA;AArBY,wCAAc;AAGzB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtC,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;8BAC1B,kBAAI;gDAAC;AAIhB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtC,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC1B,kBAAI;8CAAC;AAOd;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,oBAAoB,CAAC,OAAO;KACtC,CAAC;;8CAC4B;AAG9B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACxB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;8BACtD,IAAI;mDAAC;yBApBR,cAAc;IAJ1B,IAAA,gBAAM,EAAC,iBAAiB,CAAC;IACzB,IAAA,eAAK,EAAC,6BAA6B,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9E,IAAA,eAAK,EAAC,6BAA6B,EAAE,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAA,eAAK,EAAC,4BAA4B,EAAE,CAAC,QAAQ,CAAC,CAAC;GACnC,cAAc,CAqB1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/chat/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./chat.entity"), exports);
|
|
18
|
+
__exportStar(require("./chat-participant.entity"), exports);
|
|
19
|
+
__exportStar(require("./chat-message.entity"), exports);
|
|
20
|
+
__exportStar(require("./contact-request.entity"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/chat/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,4DAA0C;AAC1C,wDAAsC;AACtC,2DAAyC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export * from './vehicle/vehicle.entity';
|
|
|
21
21
|
export * from './telefonia/telefonia.entity';
|
|
22
22
|
export * from './telefonia/historial-ubicacion.entity';
|
|
23
23
|
export * from './telefonia/bts.entity';
|
|
24
|
+
export * from './telefonia/location-request.entity';
|
|
25
|
+
export * from './telefonia/location-response.entity';
|
|
24
26
|
export * from './telefonia/m_digitel_2024.entity';
|
|
25
27
|
export * from './telefonia/m_digitel_2025.entity';
|
|
26
28
|
export * from './telefonia/m_movilnet_api_latest.entity';
|
|
@@ -55,6 +57,7 @@ export * from './user-profile/user-profile-visit.entity';
|
|
|
55
57
|
export * from './user-profile/user-search-log.entity';
|
|
56
58
|
export * from './user-profile/user-session-log.entity';
|
|
57
59
|
export * from './user.entity';
|
|
60
|
+
export * from './chat';
|
|
58
61
|
export * from './app-config.entity';
|
|
59
62
|
export * from './audit-log.entity';
|
|
60
63
|
export * from './contribuyente.entity';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AAGpD,cAAc,0BAA0B,CAAC;AAGzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC;AAGzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AAGvD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAGlD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA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AC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC;AAGzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AAGvD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAGlD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6BAA6B,CAAC;AAG5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,qCAAqC,CAAC;AAGpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAGlD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+CAA+C,CAAC;AAG9D,cAAc,oCAAoC,CAAC;AACnD,cAAc,2CAA2C,CAAC;AAG1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AAGvD,cAAc,eAAe,CAAC;AAG9B,cAAc,QAAQ,CAAC;AAGvB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC"}
|
package/dist/entities/index.js
CHANGED
|
@@ -41,6 +41,8 @@ __exportStar(require("./vehicle/vehicle.entity"), exports);
|
|
|
41
41
|
__exportStar(require("./telefonia/telefonia.entity"), exports);
|
|
42
42
|
__exportStar(require("./telefonia/historial-ubicacion.entity"), exports);
|
|
43
43
|
__exportStar(require("./telefonia/bts.entity"), exports);
|
|
44
|
+
__exportStar(require("./telefonia/location-request.entity"), exports);
|
|
45
|
+
__exportStar(require("./telefonia/location-response.entity"), exports);
|
|
44
46
|
__exportStar(require("./telefonia/m_digitel_2024.entity"), exports);
|
|
45
47
|
__exportStar(require("./telefonia/m_digitel_2025.entity"), exports);
|
|
46
48
|
__exportStar(require("./telefonia/m_movilnet_api_latest.entity"), exports);
|
|
@@ -89,6 +91,8 @@ __exportStar(require("./user-profile/user-search-log.entity"), exports);
|
|
|
89
91
|
__exportStar(require("./user-profile/user-session-log.entity"), exports);
|
|
90
92
|
// User entity
|
|
91
93
|
__exportStar(require("./user.entity"), exports);
|
|
94
|
+
// Chat module
|
|
95
|
+
__exportStar(require("./chat"), exports);
|
|
92
96
|
// App Config
|
|
93
97
|
__exportStar(require("./app-config.entity"), exports);
|
|
94
98
|
// Audit Log
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,gBAAgB;AAChB,+CAA6B;AAC7B,sDAAoC;AAEpC,gBAAgB;AAChB,yDAAuC;AACvC,wEAAsD;AACtD,mEAAiD;AACjD,qEAAmD;AACnD,6DAA2C;AAC3C,wEAAsD;AACtD,+DAA6C;AAC7C,wDAAsC;AACtC,uEAAqD;AACrD,oEAAkD;AAClD,qEAAmD;AACnD,qEAAmD;AACnD,sEAAoD;AAEpD,iBAAiB;AACjB,2DAAyC;AAEzC,mBAAmB;AACnB,+DAA6C;AAC7C,yEAAuD;AACvD,yDAAuC;AACvC,oEAAkD;AAClD,oEAAkD;AAClD,2EAAyD;AAEzD,kBAAkB;AAClB,6DAA2C;AAC3C,yEAAuD;AAEvD,cAAc;AACd,qDAAmC;AACnC,2DAAyC;AACzC,0DAAwC;AACxC,4DAA0C;AAE1C,eAAe;AACf,uDAAqC;AAErC,cAAc;AACd,yDAAuC;AACvC,yDAAuC;AAEvC,cAAc;AACd,4DAA0C;AAC1C,6DAA2C;AAC3C,iEAA+C;AAC/C,oEAAkD;AAElD,sBAAsB;AACtB,8EAA4D;AAC5D,gFAA8D;AAC9D,8DAA4C;AAE5C,uBAAuB;AACvB,yDAAuC;AACvC,6DAA2C;AAE3C,kBAAkB;AAClB,sEAAoD;AAEpD,sBAAsB;AACtB,iEAA+C;AAC/C,wEAAsD;AACtD,oEAAkD;AAElD,qBAAqB;AACrB,0EAAwD;AAExD,uBAAuB;AACvB,6EAA2D;AAC3D,gFAA8D;AAE9D,mBAAmB;AACnB,qEAAmD;AACnD,4EAA0D;AAE1D,sBAAsB;AACtB,2EAAyD;AACzD,wEAAsD;AACtD,yEAAuD;AAEvD,cAAc;AACd,gDAA8B;AAE9B,aAAa;AACb,sDAAoC;AAEpC,YAAY;AACZ,qDAAmC;AAEnC,yBAAyB;AACzB,yDAAuC;AACvC,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,gBAAgB;AAChB,+CAA6B;AAC7B,sDAAoC;AAEpC,gBAAgB;AAChB,yDAAuC;AACvC,wEAAsD;AACtD,mEAAiD;AACjD,qEAAmD;AACnD,6DAA2C;AAC3C,wEAAsD;AACtD,+DAA6C;AAC7C,wDAAsC;AACtC,uEAAqD;AACrD,oEAAkD;AAClD,qEAAmD;AACnD,qEAAmD;AACnD,sEAAoD;AAEpD,iBAAiB;AACjB,2DAAyC;AAEzC,mBAAmB;AACnB,+DAA6C;AAC7C,yEAAuD;AACvD,yDAAuC;AACvC,sEAAoD;AACpD,uEAAqD;AACrD,oEAAkD;AAClD,oEAAkD;AAClD,2EAAyD;AAEzD,kBAAkB;AAClB,6DAA2C;AAC3C,yEAAuD;AAEvD,cAAc;AACd,qDAAmC;AACnC,2DAAyC;AACzC,0DAAwC;AACxC,4DAA0C;AAE1C,eAAe;AACf,uDAAqC;AAErC,cAAc;AACd,yDAAuC;AACvC,yDAAuC;AAEvC,cAAc;AACd,4DAA0C;AAC1C,6DAA2C;AAC3C,iEAA+C;AAC/C,oEAAkD;AAElD,sBAAsB;AACtB,8EAA4D;AAC5D,gFAA8D;AAC9D,8DAA4C;AAE5C,uBAAuB;AACvB,yDAAuC;AACvC,6DAA2C;AAE3C,kBAAkB;AAClB,sEAAoD;AAEpD,sBAAsB;AACtB,iEAA+C;AAC/C,wEAAsD;AACtD,oEAAkD;AAElD,qBAAqB;AACrB,0EAAwD;AAExD,uBAAuB;AACvB,6EAA2D;AAC3D,gFAA8D;AAE9D,mBAAmB;AACnB,qEAAmD;AACnD,4EAA0D;AAE1D,sBAAsB;AACtB,2EAAyD;AACzD,wEAAsD;AACtD,yEAAuD;AAEvD,cAAc;AACd,gDAA8B;AAE9B,cAAc;AACd,yCAAuB;AAEvB,aAAa;AACb,sDAAoC;AAEpC,YAAY;AACZ,qDAAmC;AAEnC,yBAAyB;AACzB,yDAAuC;AACvC,kDAAgC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { Phone } from '../data-telecom/phone.entity';
|
|
3
|
+
import { LocationResponse } from './location-response.entity';
|
|
4
|
+
/**
|
|
5
|
+
* Estado de la solicitud de ubicación
|
|
6
|
+
*/
|
|
7
|
+
export declare enum LocationRequestStatus {
|
|
8
|
+
PENDING = "pending",
|
|
9
|
+
SENT = "sent",
|
|
10
|
+
WAITING = "waiting",
|
|
11
|
+
PARTIAL = "partial",
|
|
12
|
+
COMPLETED = "completed",
|
|
13
|
+
FAILED = "failed",
|
|
14
|
+
TIMEOUT = "timeout",
|
|
15
|
+
CANCELLED = "cancelled"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Entidad que representa una solicitud de ubicación telefónica
|
|
19
|
+
*/
|
|
20
|
+
export declare class LocationRequest extends BaseEntity {
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* Número telefónico solicitado
|
|
24
|
+
*/
|
|
25
|
+
phoneNumber: string;
|
|
26
|
+
/**
|
|
27
|
+
* Relación con la entidad Phone (opcional, si existe en BD)
|
|
28
|
+
*/
|
|
29
|
+
phone?: Phone;
|
|
30
|
+
/**
|
|
31
|
+
* ID del usuario que realizó la solicitud
|
|
32
|
+
*/
|
|
33
|
+
userId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Tenant ID
|
|
36
|
+
*/
|
|
37
|
+
tenant: string;
|
|
38
|
+
/**
|
|
39
|
+
* Estado actual de la solicitud
|
|
40
|
+
*/
|
|
41
|
+
status: LocationRequestStatus;
|
|
42
|
+
/**
|
|
43
|
+
* Tipo de comando enviado
|
|
44
|
+
*/
|
|
45
|
+
commandType: string;
|
|
46
|
+
/**
|
|
47
|
+
* Prioridad de la solicitud (1-5, siendo 1 la más alta)
|
|
48
|
+
*/
|
|
49
|
+
priority: number;
|
|
50
|
+
/**
|
|
51
|
+
* Tiempo estimado de respuesta (en segundos)
|
|
52
|
+
*/
|
|
53
|
+
estimatedResponseTime?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Tiempo real de respuesta (en segundos)
|
|
56
|
+
*/
|
|
57
|
+
actualResponseTime?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Fecha y hora de envío del SMS
|
|
60
|
+
*/
|
|
61
|
+
sentAt?: Date;
|
|
62
|
+
/**
|
|
63
|
+
* Fecha y hora de finalización (éxito o error)
|
|
64
|
+
*/
|
|
65
|
+
completedAt?: Date;
|
|
66
|
+
/**
|
|
67
|
+
* Número de intentos de envío
|
|
68
|
+
*/
|
|
69
|
+
retryCount: number;
|
|
70
|
+
/**
|
|
71
|
+
* Mensaje de error (si aplica)
|
|
72
|
+
*/
|
|
73
|
+
errorMessage?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Metadatos adicionales (JSON)
|
|
76
|
+
*/
|
|
77
|
+
metadata?: Record<string, any>;
|
|
78
|
+
/**
|
|
79
|
+
* Dirección IP del solicitante
|
|
80
|
+
*/
|
|
81
|
+
ipAddress?: string;
|
|
82
|
+
/**
|
|
83
|
+
* User Agent del solicitante
|
|
84
|
+
*/
|
|
85
|
+
userAgent?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Respuestas asociadas a esta solicitud
|
|
88
|
+
*/
|
|
89
|
+
responses: LocationResponse[];
|
|
90
|
+
/**
|
|
91
|
+
* Fecha de creación
|
|
92
|
+
*/
|
|
93
|
+
createdAt: Date;
|
|
94
|
+
/**
|
|
95
|
+
* Fecha de última actualización
|
|
96
|
+
*/
|
|
97
|
+
updatedAt: Date;
|
|
98
|
+
/**
|
|
99
|
+
* Calcula el tiempo de respuesta
|
|
100
|
+
*/
|
|
101
|
+
calculateResponseTime(): number | null;
|
|
102
|
+
/**
|
|
103
|
+
* Verifica si la solicitud está en estado final
|
|
104
|
+
*/
|
|
105
|
+
isFinalState(): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Verifica si la solicitud fue exitosa
|
|
108
|
+
*/
|
|
109
|
+
isSuccessful(): boolean;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=location-request.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-request.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/telefonia/location-request.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAIX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED;;GAEG;AACH,qBAKa,eAAgB,SAAQ,UAAU;IAE7C,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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.LocationRequest = exports.LocationRequestStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const phone_entity_1 = require("../data-telecom/phone.entity");
|
|
15
|
+
const location_response_entity_1 = require("./location-response.entity");
|
|
16
|
+
/**
|
|
17
|
+
* Estado de la solicitud de ubicación
|
|
18
|
+
*/
|
|
19
|
+
var LocationRequestStatus;
|
|
20
|
+
(function (LocationRequestStatus) {
|
|
21
|
+
LocationRequestStatus["PENDING"] = "pending";
|
|
22
|
+
LocationRequestStatus["SENT"] = "sent";
|
|
23
|
+
LocationRequestStatus["WAITING"] = "waiting";
|
|
24
|
+
LocationRequestStatus["PARTIAL"] = "partial";
|
|
25
|
+
LocationRequestStatus["COMPLETED"] = "completed";
|
|
26
|
+
LocationRequestStatus["FAILED"] = "failed";
|
|
27
|
+
LocationRequestStatus["TIMEOUT"] = "timeout";
|
|
28
|
+
LocationRequestStatus["CANCELLED"] = "cancelled";
|
|
29
|
+
})(LocationRequestStatus || (exports.LocationRequestStatus = LocationRequestStatus = {}));
|
|
30
|
+
/**
|
|
31
|
+
* Entidad que representa una solicitud de ubicación telefónica
|
|
32
|
+
*/
|
|
33
|
+
let LocationRequest = class LocationRequest extends typeorm_1.BaseEntity {
|
|
34
|
+
/**
|
|
35
|
+
* Calcula el tiempo de respuesta
|
|
36
|
+
*/
|
|
37
|
+
calculateResponseTime() {
|
|
38
|
+
if (this.sentAt && this.completedAt) {
|
|
39
|
+
return Math.floor((this.completedAt.getTime() - this.sentAt.getTime()) / 1000);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Verifica si la solicitud está en estado final
|
|
45
|
+
*/
|
|
46
|
+
isFinalState() {
|
|
47
|
+
return [
|
|
48
|
+
LocationRequestStatus.COMPLETED,
|
|
49
|
+
LocationRequestStatus.FAILED,
|
|
50
|
+
LocationRequestStatus.TIMEOUT,
|
|
51
|
+
LocationRequestStatus.CANCELLED,
|
|
52
|
+
].includes(this.status);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Verifica si la solicitud fue exitosa
|
|
56
|
+
*/
|
|
57
|
+
isSuccessful() {
|
|
58
|
+
return this.status === LocationRequestStatus.COMPLETED;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.LocationRequest = LocationRequest;
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], LocationRequest.prototype, "id", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 15, nullable: false }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], LocationRequest.prototype, "phoneNumber", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToOne)(() => phone_entity_1.Phone, { nullable: true, eager: false }),
|
|
72
|
+
(0, typeorm_1.JoinColumn)({ name: 'phone_id' }),
|
|
73
|
+
__metadata("design:type", phone_entity_1.Phone)
|
|
74
|
+
], LocationRequest.prototype, "phone", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], LocationRequest.prototype, "userId", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: false, default: 'sp3' }),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], LocationRequest.prototype, "tenant", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
type: 'enum',
|
|
86
|
+
enum: LocationRequestStatus,
|
|
87
|
+
default: LocationRequestStatus.PENDING,
|
|
88
|
+
}),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], LocationRequest.prototype, "status", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 20, default: '734' }),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], LocationRequest.prototype, "commandType", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ type: 'int', default: 3 }),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], LocationRequest.prototype, "priority", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
101
|
+
__metadata("design:type", Number)
|
|
102
|
+
], LocationRequest.prototype, "estimatedResponseTime", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
105
|
+
__metadata("design:type", Number)
|
|
106
|
+
], LocationRequest.prototype, "actualResponseTime", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
109
|
+
__metadata("design:type", Date)
|
|
110
|
+
], LocationRequest.prototype, "sentAt", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
113
|
+
__metadata("design:type", Date)
|
|
114
|
+
], LocationRequest.prototype, "completedAt", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
117
|
+
__metadata("design:type", Number)
|
|
118
|
+
], LocationRequest.prototype, "retryCount", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], LocationRequest.prototype, "errorMessage", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
125
|
+
__metadata("design:type", Object)
|
|
126
|
+
], LocationRequest.prototype, "metadata", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], LocationRequest.prototype, "ipAddress", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
133
|
+
__metadata("design:type", String)
|
|
134
|
+
], LocationRequest.prototype, "userAgent", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.OneToMany)(() => location_response_entity_1.LocationResponse, (response) => response.request, {
|
|
137
|
+
cascade: true,
|
|
138
|
+
}),
|
|
139
|
+
__metadata("design:type", Array)
|
|
140
|
+
], LocationRequest.prototype, "responses", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamp' }),
|
|
143
|
+
__metadata("design:type", Date)
|
|
144
|
+
], LocationRequest.prototype, "createdAt", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamp' }),
|
|
147
|
+
__metadata("design:type", Date)
|
|
148
|
+
], LocationRequest.prototype, "updatedAt", void 0);
|
|
149
|
+
exports.LocationRequest = LocationRequest = __decorate([
|
|
150
|
+
(0, typeorm_1.Entity)({ name: 'location_requests' }),
|
|
151
|
+
(0, typeorm_1.Index)('idx_location_request_phone', ['phoneNumber']),
|
|
152
|
+
(0, typeorm_1.Index)('idx_location_request_status', ['status']),
|
|
153
|
+
(0, typeorm_1.Index)('idx_location_request_user', ['userId']),
|
|
154
|
+
(0, typeorm_1.Index)('idx_location_request_created', ['createdAt'])
|
|
155
|
+
], LocationRequest);
|
|
156
|
+
//# sourceMappingURL=location-request.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-request.entity.js","sourceRoot":"","sources":["../../../src/entities/telefonia/location-request.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAWiB;AACjB,+DAAqD;AACrD,yEAA8D;AAE9D;;GAEG;AACH,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,4CAAmB,CAAA;IACnB,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,gDAAuB,CAAA;AACzB,CAAC,EATW,qBAAqB,qCAArB,qBAAqB,QAShC;AAED;;GAEG;AAMI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,oBAAU;IA6H7C;;OAEG;IACH,qBAAqB;QACnB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,KAAK,CACf,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO;YACL,qBAAqB,CAAC,SAAS;YAC/B,qBAAqB,CAAC,MAAM;YAC5B,qBAAqB,CAAC,OAAO;YAC7B,qBAAqB,CAAC,SAAS;SAChC,CAAC,QAA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W,EAAE,CAAC;8BAC5B,IAAI;kDAAC;0BA3HN,eAAe;IAL3B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;IACrC,IAAA,eAAK,EAAC,4BAA4B,EAAE,CAAC,aAAa,CAAC,CAAC;IACpD,IAAA,eAAK,EAAC,6BAA6B,EAAE,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAA,eAAK,EAAC,2BAA2B,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAA,eAAK,EAAC,8BAA8B,EAAE,CAAC,WAAW,CAAC,CAAC;GACxC,eAAe,CA2J3B"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { Point } from 'geojson';
|
|
3
|
+
import { LocationRequest } from './location-request.entity';
|
|
4
|
+
import { BTS } from './bts.entity';
|
|
5
|
+
/**
|
|
6
|
+
* Tipo de respuesta de ubicación
|
|
7
|
+
*/
|
|
8
|
+
export declare enum LocationResponseType {
|
|
9
|
+
COMPLETE = "complete",// Respuesta completa con GPS
|
|
10
|
+
PARTIAL = "partial",// Solo BTS, sin GPS
|
|
11
|
+
ERROR = "error"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Entidad que representa la respuesta de ubicación de un teléfono
|
|
15
|
+
*/
|
|
16
|
+
export declare class LocationResponse extends BaseEntity {
|
|
17
|
+
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* Relación con la solicitud de ubicación
|
|
20
|
+
*/
|
|
21
|
+
request: LocationRequest;
|
|
22
|
+
/**
|
|
23
|
+
* Número telefónico (desnormalizado para consultas rápidas)
|
|
24
|
+
*/
|
|
25
|
+
phoneNumber: string;
|
|
26
|
+
/**
|
|
27
|
+
* Tipo de respuesta
|
|
28
|
+
*/
|
|
29
|
+
responseType: LocationResponseType;
|
|
30
|
+
/**
|
|
31
|
+
* Coordenadas GPS (si están disponibles)
|
|
32
|
+
* Formato: POINT(longitude latitude)
|
|
33
|
+
*/
|
|
34
|
+
coordinates?: Point;
|
|
35
|
+
/**
|
|
36
|
+
* Latitud (desnormalizado para facilitar consultas)
|
|
37
|
+
*/
|
|
38
|
+
latitude?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Longitud (desnormalizado para facilitar consultas)
|
|
41
|
+
*/
|
|
42
|
+
longitude?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Dirección textual aproximada
|
|
45
|
+
*/
|
|
46
|
+
address?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Orientación cardinal (N, S, E, O, NE, etc.)
|
|
49
|
+
*/
|
|
50
|
+
orientation?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Grados de orientación (0-360)
|
|
53
|
+
*/
|
|
54
|
+
degrees?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Relación con BTS (antena celular)
|
|
57
|
+
*/
|
|
58
|
+
bts?: BTS;
|
|
59
|
+
/**
|
|
60
|
+
* Cell ID (desnormalizado)
|
|
61
|
+
*/
|
|
62
|
+
cellId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Nombre de la celda/antena
|
|
65
|
+
*/
|
|
66
|
+
cellName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Radio de cobertura estimado (en metros)
|
|
69
|
+
*/
|
|
70
|
+
coverageRadius?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Precisión de la ubicación (en metros)
|
|
73
|
+
*/
|
|
74
|
+
accuracy?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Tecnología de red (2G, 3G, 4G, 5G)
|
|
77
|
+
*/
|
|
78
|
+
networkType?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Operadora
|
|
81
|
+
*/
|
|
82
|
+
carrier: string;
|
|
83
|
+
/**
|
|
84
|
+
* Fecha y hora reportada en el SMS
|
|
85
|
+
*/
|
|
86
|
+
reportedAt?: Date;
|
|
87
|
+
/**
|
|
88
|
+
* Fecha y hora de recepción del SMS
|
|
89
|
+
*/
|
|
90
|
+
receivedAt: Date;
|
|
91
|
+
/**
|
|
92
|
+
* Número de parte del mensaje (para SMS multiparte)
|
|
93
|
+
*/
|
|
94
|
+
messagePart: number;
|
|
95
|
+
/**
|
|
96
|
+
* Total de partes del mensaje
|
|
97
|
+
*/
|
|
98
|
+
totalParts: number;
|
|
99
|
+
/**
|
|
100
|
+
* Contenido crudo del SMS recibido
|
|
101
|
+
*/
|
|
102
|
+
rawMessage?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Mensajes completos (para multiparte)
|
|
105
|
+
*/
|
|
106
|
+
rawMessages?: Record<string, string>;
|
|
107
|
+
/**
|
|
108
|
+
* Metadatos adicionales
|
|
109
|
+
*/
|
|
110
|
+
metadata?: Record<string, any>;
|
|
111
|
+
/**
|
|
112
|
+
* Fecha de creación del registro
|
|
113
|
+
*/
|
|
114
|
+
createdAt: Date;
|
|
115
|
+
/**
|
|
116
|
+
* Calcula la distancia desde un punto dado (en metros)
|
|
117
|
+
* Usa la fórmula de Haversine
|
|
118
|
+
*/
|
|
119
|
+
calculateDistance(lat: number, lon: number): number | null;
|
|
120
|
+
/**
|
|
121
|
+
* Verifica si la respuesta está completa (tiene coordenadas GPS)
|
|
122
|
+
*/
|
|
123
|
+
isComplete(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Verifica si es una respuesta parcial (solo BTS)
|
|
126
|
+
*/
|
|
127
|
+
isPartial(): boolean;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=location-response.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-response.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/telefonia/location-response.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,UAAU,EAGX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,cA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;;OAEG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC;;OAEG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B;;OAEG;IAEH,SAAS,EAAG,IAAI,CAAC;IAEjB;;;OAGG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAkB1D;;OAEG;IACH,UAAU,IAAI,OAAO;IAQrB;;OAEG;IACH,SAAS,IAAI,OAAO;CAMrB"}
|
|
@@ -0,0 +1,185 @@
|
|
|
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.LocationResponse = exports.LocationResponseType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const location_request_entity_1 = require("./location-request.entity");
|
|
15
|
+
const bts_entity_1 = require("./bts.entity");
|
|
16
|
+
/**
|
|
17
|
+
* Tipo de respuesta de ubicación
|
|
18
|
+
*/
|
|
19
|
+
var LocationResponseType;
|
|
20
|
+
(function (LocationResponseType) {
|
|
21
|
+
LocationResponseType["COMPLETE"] = "complete";
|
|
22
|
+
LocationResponseType["PARTIAL"] = "partial";
|
|
23
|
+
LocationResponseType["ERROR"] = "error";
|
|
24
|
+
})(LocationResponseType || (exports.LocationResponseType = LocationResponseType = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Entidad que representa la respuesta de ubicación de un teléfono
|
|
27
|
+
*/
|
|
28
|
+
let LocationResponse = class LocationResponse extends typeorm_1.BaseEntity {
|
|
29
|
+
/**
|
|
30
|
+
* Calcula la distancia desde un punto dado (en metros)
|
|
31
|
+
* Usa la fórmula de Haversine
|
|
32
|
+
*/
|
|
33
|
+
calculateDistance(lat, lon) {
|
|
34
|
+
if (!this.latitude || !this.longitude)
|
|
35
|
+
return null;
|
|
36
|
+
const R = 6371e3; // Radio de la Tierra en metros
|
|
37
|
+
const φ1 = (this.latitude * Math.PI) / 180;
|
|
38
|
+
const φ2 = (lat * Math.PI) / 180;
|
|
39
|
+
const Δφ = ((lat - this.latitude) * Math.PI) / 180;
|
|
40
|
+
const Δλ = ((lon - this.longitude) * Math.PI) / 180;
|
|
41
|
+
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
|
42
|
+
Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
|
|
43
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
44
|
+
return R * c;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Verifica si la respuesta está completa (tiene coordenadas GPS)
|
|
48
|
+
*/
|
|
49
|
+
isComplete() {
|
|
50
|
+
return (this.responseType === LocationResponseType.COMPLETE &&
|
|
51
|
+
this.latitude !== null &&
|
|
52
|
+
this.longitude !== null);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Verifica si es una respuesta parcial (solo BTS)
|
|
56
|
+
*/
|
|
57
|
+
isPartial() {
|
|
58
|
+
return (this.responseType === LocationResponseType.PARTIAL ||
|
|
59
|
+
(this.cellId !== null && this.latitude === null));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.LocationResponse = LocationResponse;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], LocationResponse.prototype, "id", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.ManyToOne)(() => location_request_entity_1.LocationRequest, (request) => request.responses, {
|
|
69
|
+
nullable: false,
|
|
70
|
+
onDelete: 'CASCADE',
|
|
71
|
+
}),
|
|
72
|
+
(0, typeorm_1.JoinColumn)({ name: 'request_id' }),
|
|
73
|
+
__metadata("design:type", location_request_entity_1.LocationRequest)
|
|
74
|
+
], LocationResponse.prototype, "request", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 15, nullable: false }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], LocationResponse.prototype, "phoneNumber", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({
|
|
81
|
+
type: 'enum',
|
|
82
|
+
enum: LocationResponseType,
|
|
83
|
+
default: LocationResponseType.COMPLETE,
|
|
84
|
+
}),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], LocationResponse.prototype, "responseType", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.Column)({
|
|
89
|
+
type: 'geometry',
|
|
90
|
+
spatialFeatureType: 'Point',
|
|
91
|
+
srid: 4326,
|
|
92
|
+
nullable: true,
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], LocationResponse.prototype, "coordinates", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 7, nullable: true }),
|
|
98
|
+
__metadata("design:type", Number)
|
|
99
|
+
], LocationResponse.prototype, "latitude", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 7, nullable: true }),
|
|
102
|
+
__metadata("design:type", Number)
|
|
103
|
+
], LocationResponse.prototype, "longitude", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], LocationResponse.prototype, "address", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
|
|
110
|
+
__metadata("design:type", String)
|
|
111
|
+
], LocationResponse.prototype, "orientation", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
114
|
+
__metadata("design:type", Number)
|
|
115
|
+
], LocationResponse.prototype, "degrees", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.ManyToOne)(() => bts_entity_1.BTS, { nullable: true, eager: true }),
|
|
118
|
+
(0, typeorm_1.JoinColumn)({ name: 'bts_id' }),
|
|
119
|
+
__metadata("design:type", bts_entity_1.BTS)
|
|
120
|
+
], LocationResponse.prototype, "bts", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: true }),
|
|
123
|
+
__metadata("design:type", String)
|
|
124
|
+
], LocationResponse.prototype, "cellId", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
127
|
+
__metadata("design:type", String)
|
|
128
|
+
], LocationResponse.prototype, "cellName", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
131
|
+
__metadata("design:type", Number)
|
|
132
|
+
], LocationResponse.prototype, "coverageRadius", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
135
|
+
__metadata("design:type", Number)
|
|
136
|
+
], LocationResponse.prototype, "accuracy", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
|
|
139
|
+
__metadata("design:type", String)
|
|
140
|
+
], LocationResponse.prototype, "networkType", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'Digitel' }),
|
|
143
|
+
__metadata("design:type", String)
|
|
144
|
+
], LocationResponse.prototype, "carrier", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
147
|
+
__metadata("design:type", Date)
|
|
148
|
+
], LocationResponse.prototype, "reportedAt", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: false }),
|
|
151
|
+
__metadata("design:type", Date)
|
|
152
|
+
], LocationResponse.prototype, "receivedAt", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, typeorm_1.Column)({ type: 'int', default: 1 }),
|
|
155
|
+
__metadata("design:type", Number)
|
|
156
|
+
], LocationResponse.prototype, "messagePart", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, typeorm_1.Column)({ type: 'int', default: 1 }),
|
|
159
|
+
__metadata("design:type", Number)
|
|
160
|
+
], LocationResponse.prototype, "totalParts", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], LocationResponse.prototype, "rawMessage", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
167
|
+
__metadata("design:type", Object)
|
|
168
|
+
], LocationResponse.prototype, "rawMessages", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
171
|
+
__metadata("design:type", Object)
|
|
172
|
+
], LocationResponse.prototype, "metadata", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamp' }),
|
|
175
|
+
__metadata("design:type", Date)
|
|
176
|
+
], LocationResponse.prototype, "createdAt", void 0);
|
|
177
|
+
exports.LocationResponse = LocationResponse = __decorate([
|
|
178
|
+
(0, typeorm_1.Entity)({ name: 'location_responses' }),
|
|
179
|
+
(0, typeorm_1.Index)('idx_location_response_request', ['request']),
|
|
180
|
+
(0, typeorm_1.Index)('idx_location_response_phone', ['phoneNumber']),
|
|
181
|
+
(0, typeorm_1.Index)('idx_location_response_bts', ['bts']),
|
|
182
|
+
(0, typeorm_1.Index)('idx_location_response_received', ['receivedAt']),
|
|
183
|
+
(0, typeorm_1.Index)('idx_location_response_geom', ['coordinates'], { spatial: true })
|
|
184
|
+
], LocationResponse);
|
|
185
|
+
//# sourceMappingURL=location-response.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-response.entity.js","sourceRoot":"","sources":["../../../src/entities/telefonia/location-response.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;AAEjB,uEAA4D;AAC5D,6CAAmC;AAEnC;;GAEG;AACH,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,uCAAe,CAAA;AACjB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED;;GAEG;AAOI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,oBAAU;IAmK9C;;;OAGG;IACH,iBAAiB,CAAC,GAAW,EAAE,GAAW;QACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAEnD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC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,12 @@ export declare class User {
|
|
|
3
3
|
tenantId?: string;
|
|
4
4
|
username: string;
|
|
5
5
|
email?: string;
|
|
6
|
+
/**
|
|
7
|
+
* IUD - Identificador Único Dataven
|
|
8
|
+
* Unique identifier used for contact discovery and chat invitations
|
|
9
|
+
* Generated automatically on user creation using cuid2
|
|
10
|
+
*/
|
|
11
|
+
iud?: string;
|
|
6
12
|
firstName?: string;
|
|
7
13
|
lastName?: string;
|
|
8
14
|
roles?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":"AASA,
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":"AASA,qBAGa,IAAI;IAEf,EAAE,EAAG,MAAM,CAAC;IAGZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC;IAGlB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IAEH,GAAG,CAAC,EAAE,MAAM,CAAC;IAGb,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAGjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAGrB,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,cAAc,CAAC,EAAE,IAAI,CAAC;IAGtB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAGjB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO;IAIpC,SAAS,IAAI,OAAO;IAIpB,YAAY,IAAI,OAAO;IAIvB,OAAO,IAAI,OAAO;IAIlB,YAAY,IAAI,MAAM;CAMvB"}
|
|
@@ -55,6 +55,10 @@ __decorate([
|
|
|
55
55
|
(0, typeorm_1.Column)({ length: 255, nullable: true }),
|
|
56
56
|
__metadata("design:type", String)
|
|
57
57
|
], User.prototype, "email", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true, unique: true }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], User.prototype, "iud", void 0);
|
|
58
62
|
__decorate([
|
|
59
63
|
(0, typeorm_1.Column)({ length: 100, nullable: true }),
|
|
60
64
|
__metadata("design:type", String)
|
|
@@ -89,6 +93,7 @@ __decorate([
|
|
|
89
93
|
], User.prototype, "updatedAt", void 0);
|
|
90
94
|
exports.User = User = __decorate([
|
|
91
95
|
(0, typeorm_1.Entity)({ name: 'users' }),
|
|
92
|
-
(0, typeorm_1.Index)(['tenantId', 'username'])
|
|
96
|
+
(0, typeorm_1.Index)(['tenantId', 'username']),
|
|
97
|
+
(0, typeorm_1.Index)('user_iud_idx', ['iud'], { unique: true })
|
|
93
98
|
], User);
|
|
94
99
|
//# sourceMappingURL=user.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AAKV,IAAM,IAAI,GAAV,MAAM,IAAI;IA8Cf,sBAAsB;IACtB,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,KAAe;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,SAAS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M,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mCACxC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;uCACpC;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACtD,IAAI;uCAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;8BACvD,IAAI;4CAAC;AAGtB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC7B,IAAI;uCAAC;AAGjB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC7B,IAAI;uCAAC;eA5CN,IAAI;IAHhB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACzB,IAAA,eAAK,EAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC/B,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACpC,IAAI,CAyEhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigmatech/pergamo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Shared TypeORM entities and utilities for Dataven intelligence system - Named after the ancient library of Pergamon",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|