mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
|
|
import { models } from 'beast-orm'
|
||
|
|
import { AESEncrypt } from '../services/aesencrypt.service'
|
||
|
|
|
||
|
|
const _AESEncrypt = new AESEncrypt()
|
||
|
|
|
||
|
|
|
||
|
|
export class MessageModel extends models.Model {
|
||
|
|
|
||
|
|
channels = models.IndDbJsonField()
|
||
|
|
mentions = models.IndDbJsonField()
|
||
|
|
msg = models.CharField()
|
||
|
|
rid = models.CharField()
|
||
|
|
ts = models.CharField()
|
||
|
|
u = models.IndDbJsonField()
|
||
|
|
_id = models.CharField({unique:true})
|
||
|
|
_updatedAt = models.CharField()
|
||
|
|
messageSend = models.BooleanField()
|
||
|
|
offline = models.BooleanField()
|
||
|
|
viewed = models.IndDbJsonField()
|
||
|
|
received = models.IndDbJsonField()
|
||
|
|
localReference = models.CharField({blank:true})
|
||
|
|
attachments = models.IndDbJsonField()
|
||
|
|
file = models.IndDbJsonField()
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
export class DeleteMessageModel extends models.Model {
|
||
|
|
|
||
|
|
messageId = models.IntegerField()
|
||
|
|
rid = models.CharField()
|
||
|
|
ts = models.CharField()
|
||
|
|
u = models.IndDbJsonField()
|
||
|
|
_id = models.CharField({unique:true})
|
||
|
|
receivedBy = models.IndDbJsonField()
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
models.register({
|
||
|
|
databaseName: 'chat-storage',
|
||
|
|
type: 'indexeddb',
|
||
|
|
version: 1,
|
||
|
|
models: [MessageModel, DeleteMessageModel]
|
||
|
|
})
|