Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@field('open') open;
@field('alert') alert;
@json('roles', sanitizer) roles;
@field('unread') unread;
@field('user_mentions') userMentions;
@date('room_updated_at') roomUpdatedAt;
@field('ro') ro;
@date('last_open') lastOpen;
@field('description') description;
@field('announcement') announcement;
@field('topic') topic;
@field('blocked') blocked;
@field('blocker') blocker;
@field('react_when_read_only') reactWhenReadOnly;
@field('archived') archived;
@field('join_code_required') joinCodeRequired;
@field('fname') fname;
@field('rid') rid;
@field('open') open;
@field('alert') alert;
@json('roles', sanitizer) roles;
@field('unread') unread;
@field('user_mentions') userMentions;
@date('room_updated_at') roomUpdatedAt;
@field('ro') ro;
@date('last_open') lastOpen;
@field('description') description;
@field('announcement') announcement;
@field('topic') topic;
@field('blocked') blocked;
@field('blocker') blocker;
@field('react_when_read_only') reactWhenReadOnly;
import { Model, Q } from '@nozbe/watermelondb';
import { readonly, date, lazy } from '@nozbe/watermelondb/decorators';
export default class Permission extends Model {
static table = 'permissions'
static associations = {
permission_roles: { type: 'has_many', foreignKey: 'role_id' }
}
@readonly @date('updated_at') updatedAt
@lazy
roles = this.collections
.get('roles')
.query(Q.on('permission_roles', 'permission_id', this.id));
}
static table = 'subscriptions';
static associations = {
messages: { type: 'has_many', foreignKey: 'rid' },
threads: { type: 'has_many', foreignKey: 'rid' },
thread_messages: { type: 'has_many', foreignKey: 'subscription_id' },
uploads: { type: 'has_many', foreignKey: 'rid' }
}
@field('_id') _id;
@field('f') f;
@field('t') t;
@date('ts') ts;
@date('ls') ls;
@field('name') name;
@field('fname') fname;
@field('rid') rid;
@field('open') open;
@field('alert') alert;
@json('roles', sanitizer) roles;
@field('unread') unread;
} from '@nozbe/watermelondb/decorators';
import { sanitizer } from '../utils';
export default class Message extends Model {
static table = 'messages';
static associations = {
subscriptions: { type: 'belongs_to', key: 'rid' }
}
@field('msg') msg;
@field('t') t;
@date('ts') ts;
@json('u', sanitizer) u;
@relation('subscriptions', 'rid') subscription;
@field('alias') alias;
@json('parse_urls', sanitizer) parseUrls;
@field('groupable') groupable;
@field('avatar') avatar;
@json('attachments', sanitizer) attachments;
@json('urls', sanitizer) urls;
static associations = {
messages: { type: 'has_many', foreignKey: 'rid' },
threads: { type: 'has_many', foreignKey: 'rid' },
thread_messages: { type: 'has_many', foreignKey: 'subscription_id' },
uploads: { type: 'has_many', foreignKey: 'rid' }
}
@field('_id') _id;
@field('f') f;
@field('t') t;
@date('ts') ts;
@date('ls') ls;
@field('name') name;
@field('fname') fname;
@field('rid') rid;
@field('open') open;
@field('alert') alert;
@json('roles', sanitizer) roles;
@field('unread') unread;
@field('user_mentions') userMentions;
import action from '@nozbe/watermelondb/decorators/action';
export default class Subscription extends Model {
static table = 'subscriptions'
static associations = {
subscriptions_roles: { type: 'has_many', foreignKey: 'subscription_id' }
}
@field('f') f
@field('t') t
@date('ts') ts
@date('ls') ls
@field('name') name
@field('fname') fname
@field('rid') rid
@field('open') open
@field('alert') alert
@field('unread') unread
@field('user_mentions') userMentions
@field('ro') ro
@field('fname') fname
@field('rid') rid
@field('open') open
@field('alert') alert
@field('unread') unread
@field('user_mentions') userMentions
@field('ro') ro
@date('last_open') lastOpen
@field('description') description
@field('announcement') announcement
@field('topic') topic
@field('blocked') blocked
@field('blocker') blocker
@field('react_when_read_only') reactWhenReadOnly
@field('archived') archived
@field('join_code_required') joinCodeRequired
import { date, field, children } from '@nozbe/watermelondb/decorators';
import lazy from '@nozbe/watermelondb/decorators/lazy';
import action from '@nozbe/watermelondb/decorators/action';
export default class Subscription extends Model {
static table = 'subscriptions'
static associations = {
subscriptions_roles: { type: 'has_many', foreignKey: 'subscription_id' }
}
@field('f') f
@field('t') t
@date('ts') ts
@date('ls') ls
@field('name') name
@field('fname') fname
@field('rid') rid
@field('open') open
@field('alert') alert
@field('unread') unread
@field('user_mentions') userMentions
@json('reactions', sanitizer) reactions;
@field('role') role;
@field('drid') drid;
@field('dcount') dcount;
@date('dlm') dlm;
@field('tmid') tmid;
@field('tcount') tcount;
@date('tlm') tlm;
@json('replies', sanitizer) replies;
@json('mentions', sanitizer) mentions;
@json('channels', sanitizer) channels;
@field('unread') unread;
@field('auto_translate') autoTranslate;
@json('translations', sanitizer) translations;
@field('tmsg') tmsg;
@json('blocks', sanitizer) blocks;