Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
AllowNull,
BelongsTo,
Column,
DataType,
ForeignKey,
Model,
Table,
} from "sequelize-typescript";
import Experiment from "./experiment";
import User from "./user";
import getScheduler from "../scheduler";
@Table
export default class NotificationRequest extends Model {
@ForeignKey(() => Experiment)
@AllowNull(false)
@Column(DataType.UUID)
public experimentId: string;
@BelongsTo(() => Experiment)
public experiment: Experiment;
@ForeignKey(() => User)
@AllowNull(false)
@Column(DataType.STRING)
public userId: string;
@BelongsTo(() => User)
public user: User;
public static async findAllWithWorkAvailable() {
// Notification system disabled
@Column(DataType.STRING)
public name: string;
@AllowNull
@Default(null)
@Column(DataType.INTEGER)
public eligibilityRank: number;
@Column(DataType.JSON)
public description: Object;
@Column(DataType.JSON)
public metadata: Object;
@AllowNull(false)
@Default(true)
@Column(DataType.BOOLEAN)
public areNewWorkspacesOracleOnlyByDefault: boolean;
@BelongsToMany(() => Tree, "ExperimentTreeRelation", "ExperimentId", "TreeId")
public trees: Tree[];
@BelongsToMany(
() => Experiment,
"FallbackRelation",
"primaryExperimentId",
"fallbackExperimentId",
)
public fallbacks: Experiment[];
@HasMany(() => Instructions, "experimentId")
@Column
feedback: string;
@Column({type: DataType.DECIMAL })
pss: string;
@Column
active: boolean;
@Column
ishistory: boolean;
@Column
version: number;
@AllowNull(false)
@ForeignKey(() => Program)
@Column
programId: number;
@BelongsTo(() => Program)
program: Program;
@ForeignKey(() => Domain)
@Column
domainId: number;
@BelongsTo(() => Domain)
domain: Domain;
@ForeignKey(() => Type)
@Column
import { Model } from '../structures/Model';
/**
* Keeps track of command usages
*/
@Table({
tableName: 'command_logs',
underscored: true,
updatedAt: false,
})
export class CommandLog extends Model
{
/**
* Name of the command
*/
@AllowNull(false)
@Column({
field: 'command_name',
type: DataType.TEXT,
})
public readonly commandName!: string;
/**
* Guild Id where this command ran
*/
@Column({
field: 'guild_id',
type: DataType.TEXT,
})
public readonly guildId!: string;
/**
public static METHODS = methods
public request?: object
public response?: object
@AutoIncrement
@PrimaryKey
@Column
id: number
@AllowNull(false)
@Column(DataType.STRING(256))
name: string
@AllowNull(false)
@Column(DataType.STRING(256))
url: string
@AllowNull(false)
@Column({ comment: 'API method' })
method: string
@Column(DataType.TEXT)
description: string
@AllowNull(false)
@Default(1)
@Column(DataType.BIGINT(11))
priority: number
@Default(200)
},
{
name: 'Makoto Takiya',
photo: 'https://myanimelist.cdn-dena.com/images/characters/4/317870.jpg',
},
{
name: 'Shouta Magatsuchi',
photo: 'https://68.media.tumblr.com/104abedcd97ce15a51ed3238091aedff/tumblr_op4vnkjh9g1uctmvwo7_1280.png',
},
{
name: 'Saikawa Riko',
photo: 'https://myanimelist.cdn-dena.com/images/characters/8/323304.jpg',
},
];
@AllowNull(false)
@Column({
defaultValue: 15,
type: DataType.INTEGER,
})
public duration!: number;
@PrimaryKey
@Validate({
min: {
args: 11,
msg: 'guild_id must be 11 or larger!',
},
})
@Column({
field: 'guild_id',
type: DataType.TEXT,