Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@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
@field('notifications') notifications
@field('broadcast') broadcast
// // muted: { type: 'list', objectType: 'usersMuted' },
@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('notifications') notifications
@field('broadcast') broadcast
// // muted: { type: 'list', objectType: 'usersMuted' },
@date('room_updated_at') roomUpdatedAt
// // lastMessage: { type: 'messages', optional: true },
@lazy
roles = this.collections
.get('roles')
.query(Q.on('subscriptions_roles', 'subscription_id', this.id));
@children('subscriptions_roles') subscriptions_roles
@action deleteRoles() {
this.subscriptions_roles.destroyAllPermanently();
import { Model } from '@nozbe/watermelondb'
import { action, field, json } from '@nozbe/watermelondb/decorators'
const sanitizeValues = json => json
export default class VaultEvent extends Model {
static table = 'vault_events'
@field('address') address
@field('event_id') eventId
@field('event') event
@field('block_number') blockNumber
@field('ref') ref
@json('return_values', sanitizeValues) returnValues
@action async addEvent(data) {
return this.create(lpEvent => {
const { event, address, id, blockNumber } = data
lpEvent.eventId = id
lpEvent.address = address
lpEvent.event = event
lpEvent.blockNumber = blockNumber
})
}
}
@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('notifications') notifications;
@json('muted', sanitizer) muted;
@field('broadcast') broadcast;
@field('prid') prid;
pledge.nDelegates = Number(nDelegates)
pledge.pledgeState = Number(pledgeState)
pledge.intendedProject = Number(project)
pledge.delegates = delegates
pledge.profile.set(profile)
}
const sanitizeValues = json => json
export default class Pledge extends LiquidModel {
static table = 'pledges'
static associations = {
profiles: { type: 'belongs_to', key: 'profile_id' },
}
@field('id_pledge') idPledge
@field('owner_id') owner
@field('amount') amount
@field('token') token
@field('commit_time') commitTime
@field('n_delegates') nDelegates
@field('intended_project') intendedProject
@field('pledge_state') pledgeState
@field('block_number') blockNumber
@relation('profiles', 'profile_id') profile
@json('delegates', sanitizeValues) delegates
@action async transferTo(to, amount, projectId) {
const toPledgeQuery = await this.collections.get('pledges').query(
Q.where('pledge_id', to)
).fetch()
const pledgesCollection = await this.collections.get('pledges')
const toPledge = toPledgeQuery[0]
@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
@field('notifications') notifications
@field('broadcast') broadcast
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;
@date('room_updated_at') roomUpdatedAt;
@field('ro') ro;
import { Model } from '@nozbe/watermelondb'
import { action, field, json } from '@nozbe/watermelondb/decorators'
const sanitizeValues = json => json
export default class VaultEvent extends Model {
static table = 'vault_events'
@field('address') address
@field('event_id') eventId
@field('event') event
@field('block_number') blockNumber
@field('ref') ref
@json('return_values', sanitizeValues) returnValues
@action async addEvent(data) {
return this.create(lpEvent => {
const { event, address, id, blockNumber } = data
lpEvent.eventId = id
lpEvent.address = address
pledge.profile.set(profile)
}
const sanitizeValues = json => json
export default class Pledge extends LiquidModel {
static table = 'pledges'
static associations = {
profiles: { type: 'belongs_to', key: 'profile_id' },
}
@field('id_pledge') idPledge
@field('owner_id') owner
@field('amount') amount
@field('token') token
@field('commit_time') commitTime
@field('n_delegates') nDelegates
@field('intended_project') intendedProject
@field('pledge_state') pledgeState
@field('block_number') blockNumber
@relation('profiles', 'profile_id') profile
@json('delegates', sanitizeValues) delegates
@action async transferTo(to, amount, projectId) {
const toPledgeQuery = await this.collections.get('pledges').query(
Q.where('pledge_id', to)
).fetch()
const pledgesCollection = await this.collections.get('pledges')
const toPledge = toPledgeQuery[0]
const args = [
this.prepareUpdate(pledge => {
pledge.amount = (BigInt(pledge.amount) - BigInt(amount)).toString()
})
@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
@date('last_open') lastOpen
@field('description') description
@field('announcement') announcement
@field('topic') topic