Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
@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;
/**
* The user-defined description of the playground.
*
*/
@Column({
type: DataType.STRING(4095),
})
description: string;
/**
* The playground contents.
*
*/
@AllowNull(false)
@Column({
type: DataType.ENUM(TYPES.STRING, TYPES.NUMBER, TYPES.BOOLEAN, TYPES.OBJECT, TYPES.ARRAY, TYPES.FUNCTION, TYPES.REGEXP, TYPES.Null),
comment: 'property type',
})
/** Data Type */
type: string
@AllowNull(false)
@Default(2)
@Column
/** request params type (position) */
pos: number
@AllowNull(false)
@Column(DataType.STRING(256))
name: string
@Column({ type: DataType.STRING(128), comment: 'property generation rules' })
rule: string
@Column({ type: DataType.TEXT, comment: 'value of this property' })
value: string
@Column(DataType.TEXT)
description: string
@AllowNull(false)
@Default(-1)
@Column({ comment: 'parent property ID' })
parentId: number
comment: 'property type',
})
/** Data Type */
type: string
@AllowNull(false)
@Default(2)
@Column
/** request params type (position) */
pos: number
@AllowNull(false)
@Column(DataType.STRING(256))
name: string
@Column({ type: DataType.STRING(128), comment: 'property generation rules' })
rule: string
@Column({ type: DataType.TEXT, comment: 'value of this property' })
value: string
@Column(DataType.TEXT)
description: string
@AllowNull(false)
@Default(-1)
@Column({ comment: 'parent property ID' })
parentId: number
@AllowNull(false)
@Default(1)
@Column(DataType.BIGINT())
registered: boolean;
@ForeignKey(() => App)
@Column(DataType.INTEGER)
appId: number;
@BelongsTo(() => App)
app: App;
@HasMany(() => WebHookError)
errors: WebHookError[];
}
@Table
export class WebHookError extends Model {
@Column(DataType.STRING(1000))
message: string;
@Column(DataType.INTEGER)
responseCode: number;
@Column(DataType.STRING(10000))
responseBody: string;
@ForeignKey(() => WebHook)
@Column(DataType.INTEGER)
webHookId: number;
@BelongsTo(() => WebHook)
webHook: WebHook;
}
@Table
export class File extends Model {
@Column(DataType.STRING)
fileName: string;
@Column(DataType.STRING)
platform: string;
@Column(DataType.STRING)
arch: string;
@Column(DataType.STRING)
type: string;
@Column(DataType.STRING({ length: 40 }))
sha1: string;
@Column(DataType.STRING({ length: 64 }))
sha256: string;
@ForeignKey(() => Version)
@Column(DataType.INTEGER)
versionId: number;
@BelongsTo(() => Version)
version: Version;
}
@Table
export class Migration extends Model implements NucleusMigration {
@Column(DataType.STRING)
type: DataType.STRING(100),
})
public firstName: string;
@Column({
type: DataType.DATEONLY,
})
public dateOfBirth: string;
@Column({
type: DataType.STRING(100),
})
public title: string;
@Column({
type: DataType.STRING(100),
})
public lastName: string;
@Column({
type: DataType.STRING,
})
public city: string;
@Column({
type: DataType.STRING,
})
public zip: string;
@Column({
type: DataType.STRING,
})
import { Table, Column, Model, HasMany, AutoIncrement, PrimaryKey, AllowNull, DataType, Unique, BelongsToMany } from 'sequelize-typescript'
import { Organization, Repository, OrganizationsMembers, RepositoriesMembers } from '../'
@Table({ paranoid: true, freezeTableName: false, timestamps: true })
export default class User extends Model {
@AutoIncrement
@PrimaryKey
@Column
id: number
@AllowNull(false)
@Column(DataType.STRING(32))
fullname: string
@Column(DataType.STRING(32))
password: string
@AllowNull(false)
@Unique
@Column(DataType.STRING(128))
email: string
@HasMany(() => Organization, 'ownerId')
ownedOrganizations: Organization[]
@BelongsToMany(() => Organization, () => OrganizationsMembers)
joinedOrganizations: Organization[]
@HasMany(() => Repository, 'ownerId')
ownedRepositories: Repository[]
})
}
@AutoIncrement
@PrimaryKey
@Column
id: number
@AllowNull(false)
@Column(DataType.STRING(256))
name: string
@Column(DataType.TEXT)
description: string
@Column(DataType.STRING(256))
logo: string
@AllowNull(false)
@Default(true)
@Column({ comment: 'true:public, false:private' })
visibility: boolean
@ForeignKey(() => User)
@Column
creatorId: number
@ForeignKey(() => User)
@Column
ownerId: number
@BelongsTo(() => User, 'creatorId')
@PrimaryKey
@Column
id: number
@Column({ comment: 'sender' })
fromId: number
@AllowNull(false)
@Column({ comment: 'receiver' })
toId: number
@AllowNull(false)
@Column({ comment: 'msg type' })
type: string
@Column(DataType.STRING(128))
param1: string
@Column(DataType.STRING(128))
param2: string
@Column(DataType.STRING(128))
param3: string
@AllowNull(false)
@Default(false)
@Column
readed: boolean
}
@AutoIncrement
@PrimaryKey
@Column
id: number
@AllowNull(false)
@Column(DataType.STRING(256))
name: string
@Column(DataType.TEXT)
description: string
@Column(DataType.STRING(256))
logo: string
@Column(DataType.STRING(32))
token: string
@AllowNull(false)
@Default(true)
@Column({ comment: 'true:public, false:private' })
visibility: boolean
@ForeignKey(() => User)
@Column
ownerId: number
@ForeignKey(() => Organization)
@Column
organizationId: number
@ForeignKey(() => User)