Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
timestamps: true,
})
export class Playground extends Model implements IPlayground
{
@BelongsToMany(() => Tag, () => PlaygroundTag)
tags: Tag[];
@HasMany(() => ExternalJs)
externaljs: ExternalJs[];
/**
* A unique identifier that is used in the URL when referring to a Playground.
*
*/
@Column({
type: DataType.CHAR(63),
allowNull: false,
defaultValue: () => nanoid(),
unique: 'unique_slug',
// unique: 'unique_slug_version',
})
slug: string;
/**
* The user-defined name of the playground.
*
*/
@Column({
type: DataType.STRING(1023),
})
name: string;
id: number;
@Column({
type: DataType.CHAR(30),
allowNull: false
})
firstName: string;
@Column({
type: DataType.CHAR(30),
allowNull: false
})
lastName: string;
@Column({
type: DataType.CHAR(100),
allowNull: false,
validate: {
isEmail: true,
unique: "L'adresse e-mail fourni existe déjà, veuillez en choisir une autre."
}
})
email: string;
@Column({
type: DataType.TEXT,
allowNull: false
})
accessToken: string;
@Column({
type: DataType.TEXT,
tableName: 'users'
} as IDefineOptions;
@Table(tableOptions)
export class User extends Model {
@Column({
type: DataType.NUMERIC,
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
})
public lastName: string;
@Column({
type: DataType.CHAR(100),
allowNull: false,
validate: {
isEmail: true,
isUnique: async (value: string, next: Function): Promise => {
type: DataType.NUMERIC,
allowNull: false,
autoIncrement: true,
unique: true,
primaryKey: true
})
id: number;
@Column({
type: DataType.CHAR(30),
allowNull: false
})
firstName: string;
@Column({
type: DataType.CHAR(30),
allowNull: false
})
lastName: string;
@Column({
type: DataType.CHAR(100),
allowNull: false,
validate: {
isEmail: true,
unique: "L'adresse e-mail fourni existe déjà, veuillez en choisir une autre."
}
})
email: string;
@Column({
type: DataType.TEXT,
public id: number;
@Column({
type: DataType.CHAR(30),
allowNull: false,
})
public firstName: string;
@Column({
type: DataType.CHAR(30),
allowNull: false,
})
public lastName: string;
@Column({
type: DataType.CHAR(100),
allowNull: false,
validate: {
isEmail: true,
isUnique: async (value: string, next: Function): Promise => {
const isExist = await User.findOne({ where: { email: value }});
if (isExist) {
const error = new MessageCodeError('user:create:emailAlreadyExist');
next(error);
}
next();
},
},
})
public email: string;
@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,
})
public lastName: string;
@Column({
type: DataType.CHAR(100),
allowNull: false,
validate: {
isEmail: true,
isUnique: async (value: string, next: Function): Promise => {
const isExist = await User.findOne({ where: { email: value }});
if (isExist) {
const error = new MessageCodeError('user:create:emailAlreadyExist');
next(error);
}
next();
allowNull: false,
autoIncrement: true,
unique: true,
primaryKey: true,
})
public id: number;
@Column({
type: DataType.INTEGER,
allowNull: false,
})
@ForeignKey(() => User)
public userId: number;
@Column({
type: DataType.CHAR(50),
allowNull: false,
})
public brandName: string;
@Column({
type: DataType.DATE,
allowNull: false,
})
public purchaseDate: Date;
@CreatedAt
public createdAt: Date;
@UpdatedAt
public updatedAt: Date;
public id: number;
@Column({
type: DataType.CHAR(30),
allowNull: false
})
public firstName: string;
@Column({
type: DataType.CHAR(30),
allowNull: false
})
public lastName: string;
@Column({
type: DataType.CHAR(100),
allowNull: false,
validate: {
isEmail: true,
isUnique: async (value: string, next: Function): Promise => {
const isExist = await User.findOne({ where: { email: value } });
if (isExist) {
const error = new MessageCodeError('user:create:emailAlreadyExist');
next(error);
}
next();
}
}
})
public email: string;
@Column({