Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import Realm from 'realm';
export class Emoji extends Realm.Object {
static schema = {
name: 'Emoji',
primaryKey: 'id',
properties: {
id: 'string',
name: {type: 'string', indexed: true},
},
};
}
export class NonExistentEmoji extends Realm.Object {
static schema = {
name: 'NonExistentEmoji',
primary: 'name',
properties: {
name: 'string',
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import Realm from 'realm';
export default class General extends Realm.Object {
get config() {
try {
return JSON.parse(this.serverConfig);
} catch {
return null;
}
}
get license() {
try {
return JSON.parse(this.serverLicense);
} catch {
return null;
}
}
createAt: 'int',
updateAt: 'int',
deleteAt: {type: 'int', default: 0},
lastIconUpdateAt: {type: 'int', default: 0},
displayName: 'string',
name: 'string',
type: 'string',
description: 'string?',
groupConstrained: {type: 'bool', default: false},
allowOpenInvites: {type: 'bool', default: false},
members: 'TeamMember[]',
},
}
}
export class TeamMember extends Realm.Object {
get team() {
if (this.teams?.length) {
return this.teams[0];
}
return null;
}
static schema = {
name: 'TeamMember',
primaryKey: 'id', // the way we can update a nested object without having to specify the object to update we need a primary key
properties: {
id: 'string', // the primary key is {teamId}-{userId}
teams: {type: 'linkingObjects', objectType: 'Team', property: 'members'},
user: 'User',
deleteAt: {type: 'int', default: 0},
export class ImageMetadata extends Realm.Object {
static schema = {
name: 'ImageMetadata',
primaryKey: 'url',
properties: {
url: 'string',
width: 'int',
height: 'int',
format: 'string',
frameCount: 'int',
},
}
}
export class Embed extends Realm.Object {
get dataAsJson() {
try {
return JSON.parse(this.data);
} catch {
return null;
}
}
static schema = {
name: 'Embed',
properties: {
type: 'string',
url: 'string',
data: 'string?',
},
}
displayName: {type: 'string', default: ''},
name: 'string',
header: 'string?',
lastPostAt: {type: 'int', default: 0},
totalMsgCount: {type: 'int', default: 0},
purpose: 'string?',
groupConstrained: {type: 'bool', default: false},
members: 'ChannelMember[]',
memberCount: {type: 'int', default: 0},
guestCount: {type: 'int', default: 0},
pinnedCount: {type: 'int', default: 0},
},
}
}
export class ChannelMember extends Realm.Object {
get channel() {
if (this.channels?.length) {
return this.channel[0];
}
return null;
}
get notifyPropsAsJSON() {
try {
return JSON.parse(this.notifyProps);
} catch {
return null;
}
}
messages: {type: 'list', objectType: 'Message'}
}
};
export class Message extends Realm.Object { }
Message.schema = {
name: 'Message',
properties: {
id: 'int',
text: 'string',
time: 'int',
type: 'string'
}
};
export class Photo extends Realm.Object { }
Photo.schema = {
name: 'Photo',
properties: {
id: 'int'
}
};
export class Card extends Realm.Object { }
Card.schema = {
name: 'Card',
primaryKey: 'id',
properties: {
id: 'int',
name: 'string',
bank: 'string',
amount: 'int',
/**
* Created by lam Date: 2018/8/13 Time: 上午11:48
*/
import Realm from 'realm';
import realm from "./realm";
export class CardSchema extends Realm.Object {
}
CardSchema.schema = {
name: 'Card',
properties: {
merCode: 'int', //用户ID 用作多账号管理的唯一标识
bankPhone: 'string', //银行卡预留手机号(根据卡片,可以不同)
bankCard: {type: 'string', default: '6228480038115651200'}, //银行卡号
bank: {type: 'string', default: '招商银行'}, //所属银行
bankMark: {type: 'string', default: 'abc'}, //银行唯一标识 例如:abc 中国农业银行
cardType: {type: 'string', default: 'DC'}, //CC 信用卡 DC 储蓄卡 SCC 准贷记卡 PC 预付费卡
isDefault: {type: 'bool', default: false}, //false 非默认卡 true 默认卡
isComplete: {type: 'bool', default: false}, //false 信息是否完善(信用卡) true 默认卡
} catch {
return null;
}
}
static schema = {
name: 'Embed',
properties: {
type: 'string',
url: 'string',
data: 'string?',
},
}
}
export class PostsTimesInChannel extends Realm.Object {
static schema = {
name: 'PostsTimesInChannel',
properties: {
channelId: 'string',
start: 'int',
end: 'int',
},
}
}
/**
* @author: Est
* @date: 2017/6/5
* @description:
*/
import Realm from 'realm';
class LovedSong extends Realm.Object {}
class LocalSong extends Realm.Object {}
LovedSong.schema = {
name:'LovedSong',
primaryKey: 'id',
properties: {
id: {type: 'int'},
title: {type: 'string'},
date: {type: 'int'},
cover: {type: 'string'},
url: {type: 'string', optional: true},
quality: {type: 'string', optional: true},
time: {type: 'string', optional: true},
size: {type: 'int', optional: true},
isLoved: {type: 'bool'},
isLocaled: {type: 'bool'},