mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
change storage package to beast-rom
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
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]
|
||||
})
|
||||
@@ -67,6 +67,7 @@ interface FirstUnread {
|
||||
export interface Message {
|
||||
customFields:any;
|
||||
_id: string;
|
||||
id: null | string;
|
||||
rid: string;
|
||||
msg: string;
|
||||
ts: Ts;
|
||||
|
||||
@@ -1,4 +1,46 @@
|
||||
export interface Message {
|
||||
author: string;
|
||||
message: string;
|
||||
}
|
||||
export interface IncomingChatMessage {
|
||||
msg: string;
|
||||
collection: string;
|
||||
id: string;
|
||||
fields: {
|
||||
args: {
|
||||
_id: string;
|
||||
rid: string;
|
||||
localReference: string;
|
||||
msg: string;
|
||||
file?: any;
|
||||
ts: {
|
||||
$date: number;
|
||||
};
|
||||
u: {
|
||||
_id: string;
|
||||
username: string;
|
||||
name: string;
|
||||
};
|
||||
_updatedAt: {
|
||||
$date: number;
|
||||
};
|
||||
mentions: any[];
|
||||
channels: any[];
|
||||
} [];
|
||||
}
|
||||
eventName: string;
|
||||
|
||||
};
|
||||
|
||||
export interface ChatMessageInterface {
|
||||
_id: string;
|
||||
rid: string;
|
||||
localReference: string;
|
||||
msg: string;
|
||||
file?: any;
|
||||
ts: number;
|
||||
u: {
|
||||
_id: string;
|
||||
username: string;
|
||||
name: string;
|
||||
};
|
||||
_updatedAt: number;
|
||||
mentions: any[];
|
||||
channels: any[];
|
||||
};
|
||||
Reference in New Issue
Block a user