chore: move frontend files
This commit is contained in:
5
frontend/src/modelTypes/IAbstract.ts
Normal file
5
frontend/src/modelTypes/IAbstract.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import type {Right} from '@/constants/rights'
|
||||
|
||||
export interface IAbstract {
|
||||
maxRight: Right | null // FIXME: should this be readonly?
|
||||
}
|
14
frontend/src/modelTypes/IApiToken.ts
Normal file
14
frontend/src/modelTypes/IApiToken.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import type {IAbstract} from '@/modelTypes/IAbstract'
|
||||
|
||||
export interface IApiPermission {
|
||||
[key: string]: string[]
|
||||
}
|
||||
|
||||
export interface IApiToken extends IAbstract {
|
||||
id: number
|
||||
title: string
|
||||
token: string
|
||||
permissions: IApiPermission
|
||||
expiresAt: Date
|
||||
created: Date
|
||||
}
|
11
frontend/src/modelTypes/IAttachment.ts
Normal file
11
frontend/src/modelTypes/IAttachment.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IFile} from './IFile'
|
||||
import type {IUser} from './IUser'
|
||||
|
||||
export interface IAttachment extends IAbstract {
|
||||
id: number
|
||||
taskId: number
|
||||
createdBy: IUser
|
||||
file: IFile
|
||||
created: Date
|
||||
}
|
7
frontend/src/modelTypes/IAvatar.ts
Normal file
7
frontend/src/modelTypes/IAvatar.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export type AvatarProvider = 'default' | 'initials' | 'gravatar' | 'marble' | 'upload'
|
||||
|
||||
export interface IAvatar extends IAbstract {
|
||||
avatarProvider: AvatarProvider
|
||||
}
|
12
frontend/src/modelTypes/IBackgroundImage.ts
Normal file
12
frontend/src/modelTypes/IBackgroundImage.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface IBackgroundImage extends IAbstract {
|
||||
id: number
|
||||
url: string
|
||||
thumb: string
|
||||
info: {
|
||||
author: string
|
||||
authorName: string
|
||||
}
|
||||
blurHash: string
|
||||
}
|
17
frontend/src/modelTypes/IBucket.ts
Normal file
17
frontend/src/modelTypes/IBucket.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ITask} from './ITask'
|
||||
|
||||
export interface IBucket extends IAbstract {
|
||||
id: number
|
||||
title: string
|
||||
projectId: number
|
||||
limit: number
|
||||
tasks: ITask[]
|
||||
position: number
|
||||
count: number
|
||||
|
||||
createdBy: IUser
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
7
frontend/src/modelTypes/ICaldavToken.ts
Normal file
7
frontend/src/modelTypes/ICaldavToken.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface ICaldavToken extends IAbstract {
|
||||
id: number;
|
||||
|
||||
created: Date;
|
||||
}
|
6
frontend/src/modelTypes/IEmailUpdate.ts
Normal file
6
frontend/src/modelTypes/IEmailUpdate.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface IEmailUpdate extends IAbstract {
|
||||
newEmail: string
|
||||
password: string
|
||||
}
|
10
frontend/src/modelTypes/IFile.ts
Normal file
10
frontend/src/modelTypes/IFile.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface IFile extends IAbstract {
|
||||
id: number
|
||||
mime: string
|
||||
name: string
|
||||
size: number
|
||||
|
||||
created: Date
|
||||
}
|
15
frontend/src/modelTypes/ILabel.ts
Normal file
15
frontend/src/modelTypes/ILabel.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
|
||||
export interface ILabel extends IAbstract {
|
||||
id: number
|
||||
title: string
|
||||
hexColor: string
|
||||
description: string
|
||||
createdBy: IUser
|
||||
projectId: number
|
||||
textColor: string
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
7
frontend/src/modelTypes/ILabelTask.ts
Normal file
7
frontend/src/modelTypes/ILabelTask.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface ILabelTask extends IAbstract {
|
||||
id: number
|
||||
taskId: number
|
||||
labelId: number
|
||||
}
|
17
frontend/src/modelTypes/ILinkShare.ts
Normal file
17
frontend/src/modelTypes/ILinkShare.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type { Right } from '@/constants/rights'
|
||||
|
||||
export interface ILinkShare extends IAbstract {
|
||||
id: number
|
||||
hash: string
|
||||
right: Right
|
||||
sharedBy: IUser
|
||||
sharingType: number // FIXME: use correct numbers
|
||||
projectId: number
|
||||
name: string
|
||||
password: string
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
57
frontend/src/modelTypes/INotification.ts
Normal file
57
frontend/src/modelTypes/INotification.ts
Normal file
@ -0,0 +1,57 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ITask} from './ITask'
|
||||
import type {ITaskComment} from './ITaskComment'
|
||||
import type {ITeam} from './ITeam'
|
||||
import type { IProject } from './IProject'
|
||||
|
||||
export const NOTIFICATION_NAMES = {
|
||||
'TASK_COMMENT': 'task.comment',
|
||||
'TASK_ASSIGNED': 'task.assigned',
|
||||
'TASK_DELETED': 'task.deleted',
|
||||
'TASK_REMINDER': 'task.reminder',
|
||||
'PROJECT_CREATED': 'project.created',
|
||||
'TEAM_MEMBER_ADDED': 'team.member.added',
|
||||
} as const
|
||||
|
||||
interface Notification {
|
||||
doer: IUser
|
||||
}
|
||||
interface NotificationTask extends Notification {
|
||||
task: ITask
|
||||
comment: ITaskComment
|
||||
}
|
||||
|
||||
interface NotificationAssigned extends Notification {
|
||||
task: ITask
|
||||
assignee: IUser
|
||||
}
|
||||
|
||||
interface NotificationDeleted extends Notification {
|
||||
task: ITask
|
||||
}
|
||||
|
||||
interface NotificationCreated extends Notification {
|
||||
task: ITask
|
||||
project: IProject
|
||||
}
|
||||
|
||||
interface NotificationTaskReminder extends Notification {
|
||||
task: ITask
|
||||
project: IProject
|
||||
}
|
||||
|
||||
interface NotificationMemberAdded extends Notification {
|
||||
member: IUser
|
||||
team: ITeam
|
||||
}
|
||||
|
||||
export interface INotification extends IAbstract {
|
||||
id: number
|
||||
name: string
|
||||
notification: NotificationTask | NotificationAssigned | NotificationDeleted | NotificationCreated | NotificationMemberAdded | NotificationTaskReminder
|
||||
read: boolean
|
||||
readAt: Date | null
|
||||
|
||||
created: Date
|
||||
}
|
7
frontend/src/modelTypes/IPasswordReset.ts
Normal file
7
frontend/src/modelTypes/IPasswordReset.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface IPasswordReset extends IAbstract {
|
||||
token: string
|
||||
newPassword: string
|
||||
email: string
|
||||
}
|
6
frontend/src/modelTypes/IPasswordUpdate.ts
Normal file
6
frontend/src/modelTypes/IPasswordUpdate.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface IPasswordUpdate extends IAbstract {
|
||||
newPassword: string
|
||||
oldPassword: string
|
||||
}
|
27
frontend/src/modelTypes/IProject.ts
Normal file
27
frontend/src/modelTypes/IProject.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {ITask} from './ITask'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ISubscription} from './ISubscription'
|
||||
|
||||
|
||||
export interface IProject extends IAbstract {
|
||||
id: number
|
||||
title: string
|
||||
description: string
|
||||
owner: IUser
|
||||
tasks: ITask[]
|
||||
isArchived: boolean
|
||||
hexColor: string
|
||||
identifier: string
|
||||
backgroundInformation: unknown | null // FIXME: improve type
|
||||
isFavorite: boolean
|
||||
subscription: ISubscription
|
||||
position: number
|
||||
backgroundBlurHash: string
|
||||
parentProjectId: number
|
||||
doneBucketId: number
|
||||
defaultBucketId: number
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
8
frontend/src/modelTypes/IProjectDuplicate.ts
Normal file
8
frontend/src/modelTypes/IProjectDuplicate.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IProject} from './IProject'
|
||||
|
||||
export interface IProjectDuplicate extends IAbstract {
|
||||
projectId: number
|
||||
duplicatedProject: IProject | null
|
||||
parentProjectId: IProject['id']
|
||||
}
|
14
frontend/src/modelTypes/ISavedFilter.ts
Normal file
14
frontend/src/modelTypes/ISavedFilter.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {IFilter} from '@/types/IFilter'
|
||||
|
||||
export interface ISavedFilter extends IAbstract {
|
||||
id: number
|
||||
title: string
|
||||
description: string
|
||||
filters: IFilter
|
||||
|
||||
owner: IUser
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
11
frontend/src/modelTypes/ISubscription.ts
Normal file
11
frontend/src/modelTypes/ISubscription.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
|
||||
export interface ISubscription extends IAbstract {
|
||||
id: number
|
||||
entity: string // FIXME: correct type?
|
||||
entityId: number // FIXME: correct type?
|
||||
user: IUser
|
||||
|
||||
created: Date
|
||||
}
|
57
frontend/src/modelTypes/ITask.ts
Normal file
57
frontend/src/modelTypes/ITask.ts
Normal file
@ -0,0 +1,57 @@
|
||||
import type {Priority} from '@/constants/priorities'
|
||||
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ILabel} from './ILabel'
|
||||
import type {IAttachment} from './IAttachment'
|
||||
import type {ISubscription} from './ISubscription'
|
||||
import type {IProject} from './IProject'
|
||||
import type {IBucket} from './IBucket'
|
||||
|
||||
import type {IRelationKind} from '@/types/IRelationKind'
|
||||
import type {IRepeatAfter} from '@/types/IRepeatAfter'
|
||||
import type {IRepeatMode} from '@/types/IRepeatMode'
|
||||
|
||||
import type {PartialWithId} from '@/types/PartialWithId'
|
||||
import type {ITaskReminder} from '@/modelTypes/ITaskReminder'
|
||||
|
||||
export interface ITask extends IAbstract {
|
||||
id: number
|
||||
title: string
|
||||
description: string
|
||||
done: boolean
|
||||
doneAt: Date | null
|
||||
priority: Priority
|
||||
labels: ILabel[]
|
||||
assignees: IUser[]
|
||||
|
||||
dueDate: Date | null
|
||||
startDate: Date | null
|
||||
endDate: Date | null
|
||||
repeatAfter: number | IRepeatAfter
|
||||
repeatFromCurrentDate: boolean
|
||||
repeatMode: IRepeatMode
|
||||
reminders: ITaskReminder[]
|
||||
parentTaskId: ITask['id']
|
||||
hexColor: string
|
||||
percentDone: number
|
||||
relatedTasks: Partial<Record<IRelationKind, ITask[]>>
|
||||
attachments: IAttachment[]
|
||||
coverImageAttachmentId: IAttachment['id'] | null
|
||||
identifier: string
|
||||
index: number
|
||||
isFavorite: boolean
|
||||
subscription: ISubscription
|
||||
|
||||
position: number
|
||||
kanbanPosition: number
|
||||
|
||||
createdBy: IUser
|
||||
created: Date
|
||||
updated: Date
|
||||
|
||||
projectId: IProject['id'] // Meta, only used when creating a new task
|
||||
bucketId: IBucket['id']
|
||||
}
|
||||
|
||||
export type ITaskPartialWithId = PartialWithId<ITask>
|
9
frontend/src/modelTypes/ITaskAssignee.ts
Normal file
9
frontend/src/modelTypes/ITaskAssignee.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {ITask} from './ITask'
|
||||
import type {IUser} from './IUser'
|
||||
|
||||
export interface ITaskAssignee extends IAbstract {
|
||||
created: Date
|
||||
userId: IUser['id']
|
||||
taskId: ITask['id']
|
||||
}
|
13
frontend/src/modelTypes/ITaskComment.ts
Normal file
13
frontend/src/modelTypes/ITaskComment.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ITask} from './ITask'
|
||||
|
||||
export interface ITaskComment extends IAbstract {
|
||||
id: number
|
||||
taskId: ITask['id']
|
||||
comment: string
|
||||
author: IUser
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
15
frontend/src/modelTypes/ITaskRelation.ts
Normal file
15
frontend/src/modelTypes/ITaskRelation.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ITask} from './ITask'
|
||||
|
||||
import type {IRelationKind} from '@/types/IRelationKind'
|
||||
|
||||
export interface ITaskRelation extends IAbstract {
|
||||
id: number
|
||||
otherTaskId: ITask['id']
|
||||
taskId: ITask['id']
|
||||
relationKind: IRelationKind
|
||||
|
||||
createdBy: IUser
|
||||
created: Date
|
||||
}
|
8
frontend/src/modelTypes/ITaskReminder.ts
Normal file
8
frontend/src/modelTypes/ITaskReminder.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import type { IAbstract } from './IAbstract'
|
||||
import type { IReminderPeriodRelativeTo } from '@/types/IReminderPeriodRelativeTo'
|
||||
|
||||
export interface ITaskReminder extends IAbstract {
|
||||
reminder: Date | null
|
||||
relativePeriod: number
|
||||
relativeTo: IReminderPeriodRelativeTo | null
|
||||
}
|
16
frontend/src/modelTypes/ITeam.ts
Normal file
16
frontend/src/modelTypes/ITeam.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {ITeamMember} from './ITeamMember'
|
||||
import type {Right} from '@/constants/rights'
|
||||
|
||||
export interface ITeam extends IAbstract {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
members: ITeamMember[]
|
||||
right: Right
|
||||
|
||||
createdBy: IUser
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
7
frontend/src/modelTypes/ITeamMember.ts
Normal file
7
frontend/src/modelTypes/ITeamMember.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type {IUser} from './IUser'
|
||||
import type {IProject} from './IProject'
|
||||
|
||||
export interface ITeamMember extends IUser {
|
||||
admin: boolean
|
||||
teamId: IProject['id']
|
||||
}
|
6
frontend/src/modelTypes/ITeamProject.ts
Normal file
6
frontend/src/modelTypes/ITeamProject.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import type {ITeamShareBase} from './ITeamShareBase'
|
||||
import type {IProject} from './IProject'
|
||||
|
||||
export interface ITeamProject extends ITeamShareBase {
|
||||
projectId: IProject['id']
|
||||
}
|
11
frontend/src/modelTypes/ITeamShareBase.ts
Normal file
11
frontend/src/modelTypes/ITeamShareBase.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {ITeam} from './ITeam'
|
||||
import type {Right} from '@/constants/rights'
|
||||
|
||||
export interface ITeamShareBase extends IAbstract {
|
||||
teamId: ITeam['id']
|
||||
right: Right
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
7
frontend/src/modelTypes/ITotp.ts
Normal file
7
frontend/src/modelTypes/ITotp.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
|
||||
export interface ITotp extends IAbstract {
|
||||
secret: string
|
||||
enabled: boolean
|
||||
url: string
|
||||
}
|
26
frontend/src/modelTypes/IUser.ts
Normal file
26
frontend/src/modelTypes/IUser.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUserSettings} from './IUserSettings'
|
||||
|
||||
export const AUTH_TYPES = {
|
||||
'UNKNOWN': 0,
|
||||
'USER': 1,
|
||||
'LINK_SHARE': 2,
|
||||
} as const
|
||||
|
||||
export type AuthType = typeof AUTH_TYPES[keyof typeof AUTH_TYPES]
|
||||
|
||||
export interface IUser extends IAbstract {
|
||||
id: number
|
||||
email: string
|
||||
username: string
|
||||
name: string
|
||||
exp: number
|
||||
type: AuthType
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
settings: IUserSettings
|
||||
|
||||
isLocalUser: boolean
|
||||
deletionScheduledAt: string | Date | null
|
||||
}
|
6
frontend/src/modelTypes/IUserProject.ts
Normal file
6
frontend/src/modelTypes/IUserProject.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import type {IUserShareBase} from './IUserShareBase'
|
||||
import type {IProject} from './IProject'
|
||||
|
||||
export interface IUserProject extends IUserShareBase {
|
||||
projectId: IProject['id']
|
||||
}
|
27
frontend/src/modelTypes/IUserSettings.ts
Normal file
27
frontend/src/modelTypes/IUserSettings.ts
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IProject} from './IProject'
|
||||
import type {PrefixMode} from '@/modules/parseTaskText'
|
||||
import type {BasicColorSchema} from '@vueuse/core'
|
||||
import type {SupportedLocale} from '@/i18n'
|
||||
|
||||
export interface IFrontendSettings {
|
||||
playSoundWhenDone: boolean
|
||||
quickAddMagicMode: PrefixMode
|
||||
colorSchema: BasicColorSchema
|
||||
filterIdUsedOnOverview: IProject['id'] | null
|
||||
}
|
||||
|
||||
export interface IUserSettings extends IAbstract {
|
||||
name: string
|
||||
emailRemindersEnabled: boolean
|
||||
discoverableByName: boolean
|
||||
discoverableByEmail: boolean
|
||||
overdueTasksRemindersEnabled: boolean
|
||||
overdueTasksRemindersTime: string | Date
|
||||
defaultProjectId: undefined | IProject['id']
|
||||
weekStart: 0 | 1 | 2 | 3 | 4 | 5 | 6
|
||||
timezone: string
|
||||
language: SupportedLocale
|
||||
frontendSettings: IFrontendSettings
|
||||
}
|
11
frontend/src/modelTypes/IUserShareBase.ts
Normal file
11
frontend/src/modelTypes/IUserShareBase.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from './IUser'
|
||||
import type {Right} from '@/constants/rights'
|
||||
|
||||
export interface IUserShareBase extends IAbstract {
|
||||
userId: IUser['id']
|
||||
right: Right
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
14
frontend/src/modelTypes/IWebhook.ts
Normal file
14
frontend/src/modelTypes/IWebhook.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import type {IAbstract} from './IAbstract'
|
||||
import type {IUser} from '@/modelTypes/IUser'
|
||||
|
||||
export interface IWebhook extends IAbstract {
|
||||
id: number
|
||||
projectId: number
|
||||
secret: string
|
||||
targetUrl: string
|
||||
events: string[]
|
||||
createdBy: IUser
|
||||
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
Reference in New Issue
Block a user