Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Column, DataType, Model, PrimaryKey, Table } from 'sequelize-typescript';
@Table
export class Navigation extends Model {
@PrimaryKey
@Column({
type: DataType.UUID,
defaultValue: DataType.UUIDV4,
})
public id;
@Column(DataType.UUID)
public parentNavigationId;
@Column(DataType.STRING)
public name: string;
@Column(DataType.UUID)
public contentTypeId: string;
@Column(DataType.UUID)
public contentEntryId: string;
master: true,
};
const masterLocale = [].concat(settings.locales).find((locale: any) => locale && locale.master);
if (!masterLocale) {
settings.locales.push(defaultLocale);
}
settings.masterLocale = [].concat(settings.locales).find((locale: any) => locale && locale.master);
return settings;
}
@PrimaryKey
@Default(DataType.UUIDV4)
@Column(DataType.UUID)
public id: any;
@Column(DataType.JSONB)
public data: any;
@Column(DataType.UUID)
public userId;
@CreatedAt
@Column
public createdAt: Date;
@UpdatedAt
@Column
public updatedAt: Date;
allowNull: false,
})
public id: string;
@Column(DataType.BOOLEAN)
public isLocked: boolean;
@ForeignKey(() => Pointer)
@Column(DataType.UUID)
public pointerId: string;
@BelongsTo(() => Pointer)
public pointer: Pointer;
@ForeignKey(() => Workspace)
@Column(DataType.UUID)
public workspaceId: string;
@BelongsTo(() => Workspace)
public workspace: Workspace;
}
public user: User;
@Column(DataType.BIGINT)
public startAtTimestamp: number;
@Column(DataType.BIGINT)
public endAtTimestamp: number;
@Column(DataType.BOOLEAN)
public isOracle: boolean;
@Column(DataType.BOOLEAN)
public isTimed: boolean;
@ForeignKey(() => Workspace)
@Column(DataType.UUID)
public workspaceId: string;
@BelongsTo(() => Workspace)
public Workspace: Workspace;
@ForeignKey(() => Experiment)
@Column(DataType.UUID)
public experimentId: string;
@BelongsTo(() => Experiment)
public Experiments: Experiment;
@HasMany(() => Snapshot)
public snapshots: Snapshot[];
}
import { ContentType } from './ContentType';
@Scopes({
contentType: {
include: [{
model: () => ContentType,
through: { attributes: [] },
}],
},
})
@Table
export class ContentEntry extends Model {
@PrimaryKey
@Column({
type: DataType.UUID,
defaultValue: DataType.UUIDV4
})
id;
@Column(DataType.UUID)
@ForeignKey(() => ContentType)
contentTypeId;
@Column
language: string;
@Column(DataType.JSON)
data;
@BelongsTo(() => ContentType)
contentType: ContentType;
"returningMaliciousOracle",
"lazyPointerUnlock",
];
@Table
export default class Instructions extends Model {
@AllowNull(false)
@Column(DataType.ENUM({ values: InstructionTypes }))
public type: string;
@AllowNull(false)
@Column(DataType.TEXT)
public value: string;
@ForeignKey(() => Experiment)
@Column(DataType.UUID)
public experimentId: string;
@BelongsTo(() => Experiment)
public experiment: Experiment;
}
import Workspace from "./workspace";
import UserTreeOracleRelation from "./userTreeOracleRelation";
import User from "./user";
@Table
export default class Tree extends Model {
@Column({
type: DataType.UUID,
primaryKey: true,
defaultValue: UUIDV4,
allowNull: false,
})
public id: string;
@ForeignKey(() => Workspace)
@Column(DataType.UUID)
public rootWorkspaceId: string;
@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)