* fix: type server models * fix: make ParanoidModel generic * fix: ApiKey * fix: Attachment * fix: AuthenticationProvider * fix: Backlink * fix: Collection * fix: Comment * fix: Document * fix: FileOperation * fix: Group * fix: GroupPermission * fix: GroupUser * fix: Integration * fix: IntegrationAuthentication * fix: Notification * fix: Pin * fix: Revision * fix: SearchQuery * fix: Share * fix: Star * fix: Subscription * fix: TypeError * fix: Imports * fix: Team * fix: TeamDomain * fix: User * fix: UserAuthentication * fix: UserPermission * fix: View * fix: WebhookDelivery * fix: WebhookSubscription * Remove type duplication --------- Co-authored-by: Tom Moor <tom.moor@gmail.com>
31 lines
551 B
TypeScript
31 lines
551 B
TypeScript
/* eslint-disable @typescript-eslint/ban-types */
|
|
import {
|
|
CreatedAt,
|
|
UpdatedAt,
|
|
Column,
|
|
PrimaryKey,
|
|
IsUUID,
|
|
DataType,
|
|
Default,
|
|
} from "sequelize-typescript";
|
|
import Model from "./Model";
|
|
|
|
class IdModel<
|
|
TModelAttributes extends {} = any,
|
|
TCreationAttributes extends {} = TModelAttributes
|
|
> extends Model<TModelAttributes, TCreationAttributes> {
|
|
@IsUUID(4)
|
|
@PrimaryKey
|
|
@Default(DataType.UUIDV4)
|
|
@Column(DataType.UUID)
|
|
id: string;
|
|
|
|
@CreatedAt
|
|
createdAt: Date;
|
|
|
|
@UpdatedAt
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export default IdModel;
|