Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Webhook } from './Webhook';
@Table
export class WebhookCall extends Model {
@PrimaryKey
@Default(DataType.UUIDV4)
@Column(DataType.UUID)
public id;
@Column(DataType.UUID)
public webhookId: any;
@Column(DataType.BOOLEAN)
public success: any;
@Column(DataType.INTEGER)
public status: number;
@Column(DataType.JSONB)
public request: any;
@Column(DataType.JSONB)
public response: any;
@Column
public executedAt: Date;
@BelongsTo(() => Webhook, {
foreignKey: 'webhookId',
onDelete: 'SET NULL',
onUpdate: 'SET NULL',
})
isActive?: boolean;
@Column({
type: DataType.STRING,
allowNull: false,
})
passwordHash: string;
@Column({
type: DataType.STRING,
allowNull: false,
})
username: string;
@Column({
type: DataType.INTEGER,
allowNull: false,
})
@ForeignKey(() => Contact)
contactId: number;
@BelongsTo(() => Contact)
contact: Contact;
@CreatedAt
createdAt?: Date;
@UpdatedAt
updatedAt?: Date;
}
@Column(DataType.BOOLEAN)
public doesAllowOracleBypass: boolean;
@Default(false)
@Column(DataType.BOOLEAN)
public isMIBWithoutRestarts: boolean;
@AllowNull(false)
@Default(1)
@Column(DataType.INTEGER)
public schedulingPriority: number;
@AllowNull(false)
@Default(6)
@Column(DataType.INTEGER)
public depthLimit: number;
@BelongsTo(() => Workspace)
public rootWorkspace: Workspace;
@BelongsToMany(
() => Experiment,
"ExperimentTreeRelation",
"TreeId",
"ExperimentId",
)
public experiments: Experiment[];
@HasMany(() => UserTreeOracleRelation)
public oracleRelations: UserTreeOracleRelation[];
DataType,
CreatedAt,
UpdatedAt,
DeletedAt,
BeforeValidate,
BeforeCreate,
} from 'sequelize-typescript';
import { IDefineOptions } from 'sequelize-typescript/lib/interfaces/IDefineOptions';
import { MessageCodeError } from '../common/lib/error/MessageCodeError';
const tableOptions: IDefineOptions = { timestamp: true, tableName: 'users' } as IDefineOptions;
@Table(tableOptions)
export class User extends Model {
@Column({
type: DataType.INTEGER,
allowNull: false,
autoIncrement: true,
unique: true,
primaryKey: true,
})
public id: number;
@Column({
type: DataType.CHAR(30),
allowNull: false,
})
public firstName: string;
@Column({
type: DataType.CHAR(30),
allowNull: false,
.then(() => queryInterface.createTable("dimension_upstreams", {
"id": {type: DataType.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false},
"name": {type: DataType.STRING, allowNull: false},
"type": {type: DataType.STRING, allowNull: false},
"scalarUrl": {type: DataType.STRING, allowNull: false},
"apiUrl": {type: DataType.STRING, allowNull: false},
}))
.then(() => queryInterface.createTable("dimension_scalar_tokens", {