@signa-app/entities 0.3.2 → 0.4.1
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.
|
@@ -11,11 +11,24 @@ export declare class PaymentMessageEntity extends BaseEntity {
|
|
|
11
11
|
fee: string;
|
|
12
12
|
paymentInvoice: PaymentInvoiceEntity;
|
|
13
13
|
}
|
|
14
|
+
export declare class FilesMessageEntity extends BaseEntity {
|
|
15
|
+
text: string;
|
|
16
|
+
filesCount: number;
|
|
17
|
+
fileTypes: string[];
|
|
18
|
+
files: ChatFilesEntity[];
|
|
19
|
+
}
|
|
20
|
+
export declare class ChatFilesEntity extends BaseEntity {
|
|
21
|
+
originalName: string;
|
|
22
|
+
mimeType: string;
|
|
23
|
+
metadata: Record<string, unknown>;
|
|
24
|
+
filesMessage: FilesMessageEntity;
|
|
25
|
+
}
|
|
14
26
|
export declare class MessageEntity extends BaseEntity {
|
|
15
27
|
author: UserEntity;
|
|
16
28
|
chat: ChatEntity;
|
|
17
29
|
type: EMessageType;
|
|
18
30
|
textMessage: TextMessageEntity;
|
|
19
31
|
paymentMessage: PaymentMessageEntity;
|
|
32
|
+
filesMessage: FilesMessageEntity;
|
|
20
33
|
}
|
|
21
34
|
//# sourceMappingURL=message.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.entity.d.ts","sourceRoot":"","sources":["../../src/entities/message.entity.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"message.entity.d.ts","sourceRoot":"","sources":["../../src/entities/message.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAG9D,qBACa,iBAAkB,SAAQ,UAAU;IAE7C,IAAI,EAAG,MAAM,CAAC;CACjB;AAGD,qBACa,oBAAqB,SAAQ,UAAU;IAEhD,MAAM,EAAG,MAAM,CAAC;IAGhB,GAAG,EAAG,MAAM,CAAC;IAIb,cAAc,EAAG,oBAAoB,CAAC;CACzC;AAGD,qBACa,kBAAmB,SAAQ,UAAU;IAE9C,IAAI,EAAG,MAAM,CAAC;IAGd,UAAU,EAAG,MAAM,CAAC;IAGpB,SAAS,EAAG,MAAM,EAAE,CAAC;IAGrB,KAAK,EAAG,eAAe,EAAE,CAAC;CAC7B;AAGD,qBACa,eAAgB,SAAQ,UAAU;IAE3C,YAAY,EAAG,MAAM,CAAC;IAGtB,QAAQ,EAAG,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAMnC,YAAY,EAAG,kBAAkB,CAAC;CACrC;AAED,qBACa,aAAc,SAAQ,UAAU;IAEzC,MAAM,EAAG,UAAU,CAAC;IAGpB,IAAI,EAAG,UAAU,CAAC;IAGlB,IAAI,EAAG,YAAY,CAAC;IAKpB,WAAW,EAAG,iBAAiB,CAAC;IAKhC,cAAc,EAAG,oBAAoB,CAAC;IAKtC,YAAY,EAAG,kBAAkB,CAAC;CACrC"}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.MessageEntity = exports.PaymentMessageEntity = exports.TextMessageEntity = void 0;
|
|
12
|
+
exports.MessageEntity = exports.ChatFilesEntity = exports.FilesMessageEntity = exports.PaymentMessageEntity = exports.TextMessageEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const base_entity_1 = require("./base.entity");
|
|
15
15
|
const user_entity_1 = require("./user.entity");
|
|
@@ -47,6 +47,55 @@ __decorate([
|
|
|
47
47
|
exports.PaymentMessageEntity = PaymentMessageEntity = __decorate([
|
|
48
48
|
(0, typeorm_1.Entity)('payment_messages')
|
|
49
49
|
], PaymentMessageEntity);
|
|
50
|
+
// Holds content for messages contain files. Linked 1:1 with base MessageEntity.
|
|
51
|
+
let FilesMessageEntity = class FilesMessageEntity extends base_entity_1.BaseEntity {
|
|
52
|
+
};
|
|
53
|
+
exports.FilesMessageEntity = FilesMessageEntity;
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], FilesMessageEntity.prototype, "text", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'int', default: '0' }),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], FilesMessageEntity.prototype, "filesCount", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'text', array: true, default: '{}' }),
|
|
64
|
+
__metadata("design:type", Array)
|
|
65
|
+
], FilesMessageEntity.prototype, "fileTypes", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.OneToMany)(() => ChatFilesEntity, (file) => file.filesMessage, { cascade: true }),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], FilesMessageEntity.prototype, "files", void 0);
|
|
70
|
+
exports.FilesMessageEntity = FilesMessageEntity = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)('files_messages')
|
|
72
|
+
], FilesMessageEntity);
|
|
73
|
+
// Files are stored in the cloud.
|
|
74
|
+
let ChatFilesEntity = class ChatFilesEntity extends base_entity_1.BaseEntity {
|
|
75
|
+
};
|
|
76
|
+
exports.ChatFilesEntity = ChatFilesEntity;
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], ChatFilesEntity.prototype, "originalName", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], ChatFilesEntity.prototype, "mimeType", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({ type: 'jsonb', default: '{}' }),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], ChatFilesEntity.prototype, "metadata", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.ManyToOne)(() => FilesMessageEntity, (filesMessage) => filesMessage.files, {
|
|
91
|
+
nullable: false,
|
|
92
|
+
onDelete: 'CASCADE',
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", FilesMessageEntity)
|
|
95
|
+
], ChatFilesEntity.prototype, "filesMessage", void 0);
|
|
96
|
+
exports.ChatFilesEntity = ChatFilesEntity = __decorate([
|
|
97
|
+
(0, typeorm_1.Entity)('chat_files')
|
|
98
|
+
], ChatFilesEntity);
|
|
50
99
|
let MessageEntity = class MessageEntity extends base_entity_1.BaseEntity {
|
|
51
100
|
};
|
|
52
101
|
exports.MessageEntity = MessageEntity;
|
|
@@ -72,6 +121,11 @@ __decorate([
|
|
|
72
121
|
(0, typeorm_1.JoinColumn)(),
|
|
73
122
|
__metadata("design:type", PaymentMessageEntity)
|
|
74
123
|
], MessageEntity.prototype, "paymentMessage", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.OneToOne)(() => FilesMessageEntity),
|
|
126
|
+
(0, typeorm_1.JoinColumn)(),
|
|
127
|
+
__metadata("design:type", FilesMessageEntity)
|
|
128
|
+
], MessageEntity.prototype, "filesMessage", void 0);
|
|
75
129
|
exports.MessageEntity = MessageEntity = __decorate([
|
|
76
130
|
(0, typeorm_1.Entity)('messages')
|
|
77
131
|
], MessageEntity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.entity.js","sourceRoot":"","sources":["../../src/entities/message.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"message.entity.js","sourceRoot":"","sources":["../../src/entities/message.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmF;AACnF,+CAAyC;AACzC,+CAAyC;AACzC,+CAAyC;AACzC,0CAA4C;AAC5C,qEAA8D;AAE9D,uEAAuE;AAEhE,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,wBAAU;CAGhD,CAAA;AAHY,8CAAiB;AAE1B;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;+CACT;4BAFL,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,eAAe,CAAC;GACX,iBAAiB,CAG7B;AAED,0EAA0E;AAEnE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,wBAAU;CAUnD,CAAA;AAVY,oDAAoB;AAE7B;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;oDACP;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;iDACV;AAIb;IAFC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,6CAAoB,CAAC;IACpC,IAAA,oBAAU,GAAE;8BACI,6CAAoB;4DAAC;+BAT7B,oBAAoB;IADhC,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,oBAAoB,CAUhC;AAED,gFAAgF;AAEzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,wBAAU;CAYjD,CAAA;AAZY,gDAAkB;AAE3B;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;gDACT;AAGd;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAC,CAAC;;sDA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