1
0

chore: move frontend files

This commit is contained in:
kolaente
2024-02-07 14:56:56 +01:00
parent 447641c222
commit fc4676315d
606 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,5 @@
import type {Right} from '@/constants/rights'
export interface IAbstract {
maxRight: Right | null // FIXME: should this be readonly?
}

View 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
}

View 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
}

View 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
}

View 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
}

View 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
}

View File

@ -0,0 +1,7 @@
import type {IAbstract} from './IAbstract'
export interface ICaldavToken extends IAbstract {
id: number;
created: Date;
}

View File

@ -0,0 +1,6 @@
import type {IAbstract} from './IAbstract'
export interface IEmailUpdate extends IAbstract {
newEmail: string
password: string
}

View 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
}

View 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
}

View File

@ -0,0 +1,7 @@
import type {IAbstract} from './IAbstract'
export interface ILabelTask extends IAbstract {
id: number
taskId: number
labelId: number
}

View 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
}

View 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
}

View File

@ -0,0 +1,7 @@
import type {IAbstract} from './IAbstract'
export interface IPasswordReset extends IAbstract {
token: string
newPassword: string
email: string
}

View File

@ -0,0 +1,6 @@
import type {IAbstract} from './IAbstract'
export interface IPasswordUpdate extends IAbstract {
newPassword: string
oldPassword: string
}

View 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
}

View 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']
}

View 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
}

View 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
}

View 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>

View 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']
}

View 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
}

View 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
}

View 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
}

View 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
}

View 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']
}

View File

@ -0,0 +1,6 @@
import type {ITeamShareBase} from './ITeamShareBase'
import type {IProject} from './IProject'
export interface ITeamProject extends ITeamShareBase {
projectId: IProject['id']
}

View 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
}

View File

@ -0,0 +1,7 @@
import type {IAbstract} from './IAbstract'
export interface ITotp extends IAbstract {
secret: string
enabled: boolean
url: string
}

View 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
}

View File

@ -0,0 +1,6 @@
import type {IUserShareBase} from './IUserShareBase'
import type {IProject} from './IProject'
export interface IUserProject extends IUserShareBase {
projectId: IProject['id']
}

View 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
}

View 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
}

View 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
}